Files
nextcloud-server/dist/NcSelect-B1uITk_3-D769WsNG.chunk.mjs
nextcloud-command 78098c8325 chore(assets): Recompile assets
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2026-04-01 13:41:02 +00:00

5 lines
35 KiB
JavaScript

import{m as V,r as ke,n as Z,o as te,p as Ke,q as I,s as de,t as We,v as qe,w as Ue,x as Ye}from"./NcModal-kyWZ3UFC-BxKwwKAq.chunk.mjs";import{o as d,f as g,g as S,t as H,h as E,m as R,ae as Je,i as b,N as w,O as v,H as we,I as pe,j as ne,c as j,P as ae,Q as De,K as ce,L as ve,k as U,w as T,M as Oe,F as xe,ag as Xe,b as Qe,a9 as ee,r as q,B as Ze}from"./preload-helper-DoJVKVMq.chunk.mjs";import{_ as ie,r as Ge,o as et,b as G,c as Se}from"./NcIconSvgWrapper-De-2-ukl-CcvQeIAt.chunk.mjs";import{N as tt}from"./Web-rJva_rmF.chunk.mjs";import{n as nt}from"./mdi-BUoBIgaz.chunk.mjs";const it={name:"ChevronDownIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},ot=["aria-hidden","aria-label"],st=["fill","width","height"],lt={d:"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"},rt={key:0};function at(e,t,n,i,s,o){return d(),g("span",R(e.$attrs,{"aria-hidden":n.title?null:"true","aria-label":n.title,class:"material-design-icon chevron-down-icon",role:"img",onClick:t[0]||(t[0]=r=>e.$emit("click",r))}),[(d(),g("svg",{fill:n.fillColor,class:"material-design-icon__svg",width:n.size,height:n.size,viewBox:"0 0 24 24"},[S("path",lt,[n.title?(d(),g("title",rt,H(n.title),1)):E("",!0)])],8,st))],16,ot)}const ct=ie(it,[["render",at]]),ht={name:"CloseIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},ut=["aria-hidden","aria-label"],dt=["fill","width","height"],pt={d:"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"},ft={key:0};function gt(e,t,n,i,s,o){return d(),g("span",R(e.$attrs,{"aria-hidden":n.title?null:"true","aria-label":n.title,class:"material-design-icon close-icon",role:"img",onClick:t[0]||(t[0]=r=>e.$emit("click",r))}),[(d(),g("svg",{fill:n.fillColor,class:"material-design-icon__svg",width:n.size,height:n.size,viewBox:"0 0 24 24"},[S("path",pt,[n.title?(d(),g("title",ft,H(n.title),1)):E("",!0)])],8,dt))],16,ut)}const mt=ie(ht,[["render",gt]]);function oe(){return typeof window<"u"}function W(e){return Pe(e)?(e.nodeName||"").toLowerCase():"#document"}function O(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function B(e){var t;return(t=(Pe(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Pe(e){return oe()?e instanceof Node||e instanceof O(e).Node:!1}function _(e){return oe()?e instanceof Element||e instanceof O(e).Element:!1}function F(e){return oe()?e instanceof HTMLElement||e instanceof O(e).HTMLElement:!1}function Le(e){return!oe()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof O(e).ShadowRoot}function J(e){const{overflow:t,overflowX:n,overflowY:i,display:s}=$(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&s!=="inline"&&s!=="contents"}function yt(e){return/^(table|td|th)$/.test(W(e))}function se(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const bt=/transform|translate|scale|rotate|perspective|filter/,wt=/paint|layout|strict|content/,P=e=>!!e&&e!=="none";let he;function ge(e){const t=_(e)?$(e):e;return P(t.transform)||P(t.translate)||P(t.scale)||P(t.rotate)||P(t.perspective)||!me()&&(P(t.backdropFilter)||P(t.filter))||bt.test(t.willChange||"")||wt.test(t.contain||"")}function vt(e){let t=k(e);for(;F(t)&&!K(t);){if(ge(t))return t;if(se(t))return null;t=k(t)}return null}function me(){return he==null&&(he=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),he}function K(e){return/^(html|body|#document)$/.test(W(e))}function $(e){return O(e).getComputedStyle(e)}function le(e){return _(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function k(e){if(W(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Le(e)&&e.host||B(e);return Le(t)?t.host:t}function Ae(e){const t=k(e);return K(t)?e.ownerDocument?e.ownerDocument.body:e.body:F(t)&&J(t)?t:Ae(t)}function Y(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Ae(e),o=s===((i=e.ownerDocument)==null?void 0:i.body),r=O(s);if(o){const l=fe(r);return t.concat(r,r.visualViewport||[],J(s)?s:[],l&&n?Y(l):[])}else return t.concat(s,Y(s,[],n))}function fe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ee(e){const t=$(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const s=F(e),o=s?e.offsetWidth:n,r=s?e.offsetHeight:i,l=te(n)!==o||te(i)!==r;return l&&(n=o,i=r),{width:n,height:i,$:l}}function ye(e){return _(e)?e:e.contextElement}function z(e){const t=ye(e);if(!F(t))return V(1);const n=t.getBoundingClientRect(),{width:i,height:s,$:o}=Ee(t);let r=(o?te(n.width):n.width)/i,l=(o?te(n.height):n.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}const Ot=V(0);function Re(e){const t=O(e);return!me()||!t.visualViewport?Ot:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function xt(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==O(e)?!1:t}function N(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=ye(e);let r=V(1);t&&(i?_(i)&&(r=z(i)):r=z(e));const l=xt(o,n,i)?Re(o):V(0);let a=(s.left+l.x)/r.x,c=(s.top+l.y)/r.y,h=s.width/r.x,u=s.height/r.y;if(o){const p=O(o),f=i&&_(i)?O(i):i;let x=p,y=fe(x);for(;y&&i&&f!==x;){const L=z(y),m=y.getBoundingClientRect(),C=$(y),D=m.left+(y.clientLeft+parseFloat(C.paddingLeft))*L.x,X=m.top+(y.clientTop+parseFloat(C.paddingTop))*L.y;a*=L.x,c*=L.y,h*=L.x,u*=L.y,a+=D,c+=X,x=O(y),y=fe(x)}}return ke({width:h,height:u,x:a,y:c})}function re(e,t){const n=le(e).scrollLeft;return t?t.left+n:N(B(e)).left+n}function Ne(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-re(e,n),s=n.top+t.scrollTop;return{x:i,y:s}}function St(e){let{elements:t,rect:n,offsetParent:i,strategy:s}=e;const o=s==="fixed",r=B(i),l=t?se(t.floating):!1;if(i===r||l&&o)return n;let a={scrollLeft:0,scrollTop:0},c=V(1);const h=V(0),u=F(i);if((u||!u&&!o)&&((W(i)!=="body"||J(r))&&(a=le(i)),u)){const f=N(i);c=z(i),h.x=f.x+i.clientLeft,h.y=f.y+i.clientTop}const p=r&&!u&&!o?Ne(r,a):V(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+h.x+p.x,y:n.y*c.y-a.scrollTop*c.y+h.y+p.y}}function Lt(e){return Array.from(e.getClientRects())}function Ct(e){const t=B(e),n=le(e),i=e.ownerDocument.body,s=I(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),o=I(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let r=-n.scrollLeft+re(e);const l=-n.scrollTop;return $(i).direction==="rtl"&&(r+=I(t.clientWidth,i.clientWidth)-s),{width:s,height:o,x:r,y:l}}const Ce=25;function _t(e,t){const n=O(e),i=B(e),s=n.visualViewport;let o=i.clientWidth,r=i.clientHeight,l=0,a=0;if(s){o=s.width,r=s.height;const h=me();(!h||h&&t==="fixed")&&(l=s.offsetLeft,a=s.offsetTop)}const c=re(i);if(c<=0){const h=i.ownerDocument,u=h.body,p=getComputedStyle(u),f=h.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,x=Math.abs(i.clientWidth-u.clientWidth-f);x<=Ce&&(o-=x)}else c<=Ce&&(o+=c);return{width:o,height:r,x:l,y:a}}function $t(e,t){const n=N(e,!0,t==="fixed"),i=n.top+e.clientTop,s=n.left+e.clientLeft,o=F(e)?z(e):V(1),r=e.clientWidth*o.x,l=e.clientHeight*o.y,a=s*o.x,c=i*o.y;return{width:r,height:l,x:a,y:c}}function _e(e,t,n){let i;if(t==="viewport")i=_t(e,n);else if(t==="document")i=Ct(B(e));else if(_(t))i=$t(t,n);else{const s=Re(e);i={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return ke(i)}function Me(e,t){const n=k(e);return n===t||!_(n)||K(n)?!1:$(n).position==="fixed"||Me(n,t)}function Vt(e,t){const n=t.get(e);if(n)return n;let i=Y(e,[],!1).filter(l=>_(l)&&W(l)!=="body"),s=null;const o=$(e).position==="fixed";let r=o?k(e):e;for(;_(r)&&!K(r);){const l=$(r),a=ge(r);!a&&l.position==="fixed"&&(s=null),(o?!a&&!s:!a&&l.position==="static"&&s&&(s.position==="absolute"||s.position==="fixed")||J(r)&&!a&&Me(e,r))?i=i.filter(c=>c!==r):s=l,r=k(r)}return t.set(e,i),i}function Bt(e){let{element:t,boundary:n,rootBoundary:i,strategy:s}=e;const o=[...n==="clippingAncestors"?se(t)?[]:Vt(t,this._c):[].concat(n),i],r=_e(t,o[0],s);let l=r.top,a=r.right,c=r.bottom,h=r.left;for(let u=1;u<o.length;u++){const p=_e(t,o[u],s);l=I(p.top,l),a=de(p.right,a),c=de(p.bottom,c),h=I(p.left,h)}return{width:a-h,height:c-l,x:h,y:l}}function Tt(e){const{width:t,height:n}=Ee(e);return{width:t,height:n}}function Ft(e,t,n){const i=F(t),s=B(t),o=n==="fixed",r=N(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const a=V(0);function c(){a.x=re(s)}if(i||!i&&!o)if((W(t)!=="body"||J(s))&&(l=le(t)),i){const f=N(t,!0,o,t);a.x=f.x+t.clientLeft,a.y=f.y+t.clientTop}else s&&c();o&&!i&&s&&c();const h=s&&!i&&!o?Ne(s,l):V(0),u=r.left+l.scrollLeft-a.x-h.x,p=r.top+l.scrollTop-a.y-h.y;return{x:u,y:p,width:r.width,height:r.height}}function ue(e){return $(e).position==="static"}function $e(e,t){if(!F(e)||$(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return B(e)===n&&(n=n.ownerDocument.body),n}function Ie(e,t){const n=O(e);if(se(e))return n;if(!F(e)){let s=k(e);for(;s&&!K(s);){if(_(s)&&!ue(s))return s;s=k(s)}return n}let i=$e(e,t);for(;i&&yt(i)&&ue(i);)i=$e(i,t);return i&&K(i)&&ue(i)&&!ge(i)?n:i||vt(e)||n}const kt=async function(e){const t=this.getOffsetParent||Ie,n=this.getDimensions,i=await n(e.floating);return{reference:Ft(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function Dt(e){return $(e).direction==="rtl"}const Pt={convertOffsetParentRelativeRectToViewportRelativeRect:St,getDocumentElement:B,getClippingRect:Bt,getOffsetParent:Ie,getElementRects:kt,getClientRects:Lt,getDimensions:Tt,getScale:z,isElement:_,isRTL:Dt};function je(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function At(e,t){let n=null,i;const s=B(e);function o(){var l;clearTimeout(i),(l=n)==null||l.disconnect(),n=null}function r(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),o();const c=e.getBoundingClientRect(),{left:h,top:u,width:p,height:f}=c;if(l||t(),!p||!f)return;const x=Z(u),y=Z(s.clientWidth-(h+p)),L=Z(s.clientHeight-(u+f)),m=Z(h),C={rootMargin:-x+"px "+-y+"px "+-L+"px "+-m+"px",threshold:I(0,de(1,a))||1};let D=!0;function X(He){const Q=He[0].intersectionRatio;if(Q!==a){if(!D)return r();Q?r(!1,Q):i=setTimeout(()=>{r(!1,1e-7)},1e3)}Q===1&&!je(c,e.getBoundingClientRect())&&r(),D=!1}try{n=new IntersectionObserver(X,{...C,root:s.ownerDocument})}catch{n=new IntersectionObserver(X,C)}n.observe(e)}return r(!0),o}function Et(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=i,c=ye(e),h=s||o?[...c?Y(c):[],...t?Y(t):[]]:[];h.forEach(m=>{s&&m.addEventListener("scroll",n,{passive:!0}),o&&m.addEventListener("resize",n)});const u=c&&l?At(c,n):null;let p=-1,f=null;r&&(f=new ResizeObserver(m=>{let[C]=m;C&&C.target===c&&f&&t&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var D;(D=f)==null||D.observe(t)})),n()}),c&&!a&&f.observe(c),t&&f.observe(t));let x,y=a?N(e):null;a&&L();function L(){const m=N(e);y&&!je(y,m)&&n(),y=m,x=requestAnimationFrame(L)}return n(),()=>{var m;h.forEach(C=>{s&&C.removeEventListener("scroll",n),o&&C.removeEventListener("resize",n)}),u?.(),(m=f)==null||m.disconnect(),f=null,a&&cancelAnimationFrame(x)}}const Rt=We,Nt=Ue,Mt=qe,It=Ye,jt=(e,t,n)=>{const i=new Map,s={platform:Pt,...n},o={...s.platform,_c:i};return Ke(e,t,{...s,platform:o})};var zt=Object.defineProperty,Ht=Object.defineProperties,Kt=Object.getOwnPropertyDescriptors,Ve=Object.getOwnPropertySymbols,Wt=Object.prototype.hasOwnProperty,qt=Object.prototype.propertyIsEnumerable,Be=(e,t,n)=>t in e?zt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M=(e,t)=>{for(var n in t||(t={}))Wt.call(t,n)&&Be(e,n,t[n]);if(Ve)for(var n of Ve(t))qt.call(t,n)&&Be(e,n,t[n]);return e},Te=(e,t)=>Ht(e,Kt(t));const Ut={props:{autoscroll:{type:Boolean,default:!0}},watch:{typeAheadPointer(){this.autoscroll&&this.maybeAdjustScroll()},open(e){this.autoscroll&&e&&this.$nextTick(()=>this.maybeAdjustScroll())}},methods:{maybeAdjustScroll(){var e;const t=((e=this.$refs.dropdownMenu)==null?void 0:e.children[this.typeAheadPointer])||!1;if(t){const n=this.getDropdownViewport(),{top:i,bottom:s,height:o}=t.getBoundingClientRect();if(i<n.top)return this.$refs.dropdownMenu.scrollTop=t.offsetTop;if(s>n.bottom)return this.$refs.dropdownMenu.scrollTop=t.offsetTop-(n.height-o)}},getDropdownViewport(){return this.$refs.dropdownMenu?this.$refs.dropdownMenu.getBoundingClientRect():{height:0,top:0,bottom:0}}}},Yt={data(){return{typeAheadPointer:-1}},watch:{filteredOptions(){for(let e=0;e<this.filteredOptions.length;e++)if(this.selectable(this.filteredOptions[e])){this.typeAheadPointer=e;break}},open(e){e&&this.typeAheadToLastSelected()},selectedValue(){this.open&&this.typeAheadToLastSelected()}},methods:{typeAheadUp(){for(let e=this.typeAheadPointer-1;e>=0;e--)if(this.selectable(this.filteredOptions[e])){this.typeAheadPointer=e;break}},typeAheadDown(){for(let e=this.typeAheadPointer+1;e<this.filteredOptions.length;e++)if(this.selectable(this.filteredOptions[e])){this.typeAheadPointer=e;break}},typeAheadSelect(){const e=this.filteredOptions[this.typeAheadPointer];e&&this.selectable(e)&&this.select(e)},typeAheadToLastSelected(){this.typeAheadPointer=this.selectedValue.length!==0?this.filteredOptions.indexOf(this.selectedValue[this.selectedValue.length-1]):-1}}},Jt={props:{loading:{type:Boolean,default:!1}},data(){return{mutableLoading:!1}},watch:{search(){this.$emit("search",this.search,this.toggleLoading)},loading(e){this.mutableLoading=e}},methods:{toggleLoading(e=null){return e==null?this.mutableLoading=!this.mutableLoading:this.mutableLoading=e}}},be=(e,t)=>{const n=e.__vccOpts||e;for(const[i,s]of t)n[i]=s;return n},Xt={},Qt={xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"},Zt=S("path",{d:"M6.895455 5l2.842897-2.842898c.348864-.348863.348864-.914488 0-1.263636L9.106534.261648c-.348864-.348864-.914489-.348864-1.263636 0L5 3.104545 2.157102.261648c-.348863-.348864-.914488-.348864-1.263636 0L.261648.893466c-.348864.348864-.348864.914489 0 1.263636L3.104545 5 .261648 7.842898c-.348864.348863-.348864.914488 0 1.263636l.631818.631818c.348864.348864.914773.348864 1.263636 0L5 6.895455l2.842898 2.842897c.348863.348864.914772.348864 1.263636 0l.631818-.631818c.348864-.348864.348864-.914489 0-1.263636L6.895455 5z"},null,-1),Gt=[Zt];function en(e,t){return d(),g("svg",Qt,Gt)}const tn=be(Xt,[["render",en]]),nn={},on={xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10"},sn=S("path",{d:"M9.211364 7.59931l4.48338-4.867229c.407008-.441854.407008-1.158247 0-1.60046l-.73712-.80023c-.407008-.441854-1.066904-.441854-1.474243 0L7 5.198617 2.51662.33139c-.407008-.441853-1.066904-.441853-1.474243 0l-.737121.80023c-.407008.441854-.407008 1.158248 0 1.600461l4.48338 4.867228L7 10l2.211364-2.40069z"},null,-1),ln=[sn];function rn(e,t){return d(),g("svg",on,ln)}const an=be(nn,[["render",rn]]),Fe={Deselect:tn,OpenIndicator:an},cn={mounted(e,{instance:t}){if(t.appendToBody){const{height:n,top:i,left:s,width:o}=t.$refs.toggle.getBoundingClientRect();let r=window.scrollX||window.pageXOffset,l=window.scrollY||window.pageYOffset;e.unbindPosition=t.calculatePosition(e,t,{width:o+"px",left:r+s+"px",top:l+i+n+"px"}),document.body.appendChild(e)}},unmounted(e,{instance:t}){t.appendToBody&&(e.unbindPosition&&typeof e.unbindPosition=="function"&&e.unbindPosition(),e.parentNode&&e.parentNode.removeChild(e))}};function hn(e){const t={};return Object.keys(e).sort().forEach(n=>{t[n]=e[n]}),JSON.stringify(t)}let un=0;function dn(){return++un}const pn={components:M({},Fe),directives:{appendToBody:cn},mixins:[Ut,Yt,Jt],compatConfig:{MODE:3},emits:["open","close","update:modelValue","search","search:compositionstart","search:compositionend","search:keydown","search:blur","search:focus","search:input","option:created","option:selecting","option:selected","option:deselecting","option:deselected"],props:{modelValue:{},components:{type:Object,default:()=>({})},options:{type:Array,default(){return[]}},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},deselectFromDropdown:{type:Boolean,default:!1},searchable:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},placeholder:{type:String,default:""},transition:{type:String,default:"vs__fade"},clearSearchOnSelect:{type:Boolean,default:!0},closeOnSelect:{type:Boolean,default:!0},label:{type:String,default:"label"},autocomplete:{type:String,default:"off"},reduce:{type:Function,default:e=>e},selectable:{type:Function,default:e=>!0},getOptionLabel:{type:Function,default(e){return typeof e=="object"?e.hasOwnProperty(this.label)?e[this.label]:console.warn(`[vue-select warn]: Label key "option.${this.label}" does not exist in options object ${JSON.stringify(e)}.
https://vue-select.org/api/props.html#getoptionlabel`):e}},getOptionKey:{type:Function,default(e){if(typeof e!="object")return e;try{return e.hasOwnProperty("id")?e.id:hn(e)}catch(t){return console.warn(`[vue-select warn]: Could not stringify this option to generate unique key. Please provide'getOptionKey' prop to return a unique key for each option.
https://vue-select.org/api/props.html#getoptionkey`,e,t)}}},onTab:{type:Function,default:function(){this.selectOnTab&&!this.isComposing&&this.typeAheadSelect()}},taggable:{type:Boolean,default:!1},tabindex:{type:Number,default:null},pushTags:{type:Boolean,default:!1},filterable:{type:Boolean,default:!0},filterBy:{type:Function,default(e,t,n){return(t||"").toLocaleLowerCase().indexOf(n.toLocaleLowerCase())>-1}},filter:{type:Function,default(e,t){return e.filter(n=>{let i=this.getOptionLabel(n);return typeof i=="number"&&(i=i.toString()),this.filterBy(n,i,t)})}},createOption:{type:Function,default(e){return typeof this.optionList[0]=="object"?{[this.label]:e}:e}},resetOnOptionsChange:{default:!1,validator:e=>["function","boolean"].includes(typeof e)},clearSearchOnBlur:{type:Function,default:function({clearSearchOnSelect:e,multiple:t}){return e&&!t}},noDrop:{type:Boolean,default:!1},inputId:{type:String},dir:{type:String,default:"auto"},selectOnTab:{type:Boolean,default:!1},selectOnKeyCodes:{type:Array,default:()=>[13]},searchInputQuerySelector:{type:String,default:"[type=search]"},mapKeydown:{type:Function,default:(e,t)=>e},appendToBody:{type:Boolean,default:!1},calculatePosition:{type:Function,default(e,t,{width:n,top:i,left:s}){e.style.top=i,e.style.left=s,e.style.width=n}},dropdownShouldOpen:{type:Function,default({noDrop:e,open:t,mutableLoading:n}){return e?!1:t&&!n}},uid:{type:[String,Number],default:()=>dn()}},data(){return{search:"",open:!1,isComposing:!1,pushedTags:[],_value:[],deselectButtons:[]}},computed:{isReducingValues(){return this.$props.reduce!==this.$options.props.reduce.default},isTrackingValues(){return typeof this.modelValue>"u"||this.isReducingValues},selectedValue(){let e=this.modelValue;return this.isTrackingValues&&(e=this.$data._value),e!=null&&e!==""?[].concat(e):[]},optionList(){return this.options.concat(this.pushTags?this.pushedTags:[])},searchEl(){return this.$slots.search?this.$refs.selectedOptions.querySelector(this.searchInputQuerySelector):this.$refs.search},scope(){const e={search:this.search,loading:this.loading,searching:this.searching,filteredOptions:this.filteredOptions};return{search:{attributes:M({disabled:this.disabled,placeholder:this.searchPlaceholder,tabindex:this.tabindex,readonly:!this.searchable,id:this.inputId,"aria-autocomplete":"list","aria-labelledby":`vs${this.uid}__combobox`,"aria-controls":`vs${this.uid}__listbox`,ref:"search",type:"search",autocomplete:this.autocomplete,value:this.search},this.dropdownOpen&&this.filteredOptions[this.typeAheadPointer]?{"aria-activedescendant":`vs${this.uid}__option-${this.typeAheadPointer}`}:{}),events:{compositionstart:()=>this.isComposing=!0,compositionend:()=>this.isComposing=!1,keydown:this.onSearchKeyDown,blur:this.onSearchBlur,focus:this.onSearchFocus,input:t=>this.search=t.target.value}},spinner:{loading:this.mutableLoading},noOptions:{search:this.search,loading:this.mutableLoading,searching:this.searching},openIndicator:{attributes:{ref:"openIndicator",role:"presentation",class:"vs__open-indicator"}},listHeader:e,listFooter:e,header:Te(M({},e),{deselect:this.deselect}),footer:Te(M({},e),{deselect:this.deselect})}},childComponents(){return M(M({},Fe),this.components)},stateClasses(){return{"vs--open":this.dropdownOpen,"vs--single":!this.multiple,"vs--multiple":this.multiple,"vs--searching":this.searching&&!this.noDrop,"vs--searchable":this.searchable&&!this.noDrop,"vs--unsearchable":!this.searchable,"vs--loading":this.mutableLoading,"vs--disabled":this.disabled}},searching(){return!!this.search},dropdownOpen(){return this.dropdownShouldOpen(this)},searchPlaceholder(){return this.isValueEmpty&&this.placeholder?this.placeholder:void 0},filteredOptions(){const e=[].concat(this.optionList);if(!this.filterable&&!this.taggable)return e;const t=this.search.length?this.filter(e,this.search,this):e;if(this.taggable&&this.search.length){const n=this.createOption(this.search);this.optionExists(n)||t.unshift(n)}return t},isValueEmpty(){return this.selectedValue.length===0},showClearButton(){return!this.multiple&&this.clearable&&!this.open&&!this.isValueEmpty}},watch:{options(e,t){const n=()=>typeof this.resetOnOptionsChange=="function"?this.resetOnOptionsChange(e,t,this.selectedValue):this.resetOnOptionsChange;!this.taggable&&n()&&this.clearSelection(),this.modelValue&&this.isTrackingValues&&this.setInternalValueFromOptions(this.modelValue)},modelValue:{immediate:!0,handler(e){this.isTrackingValues&&this.setInternalValueFromOptions(e)}},multiple(){this.clearSelection()},open(e){this.$emit(e?"open":"close")}},created(){this.mutableLoading=this.loading},methods:{setInternalValueFromOptions(e){Array.isArray(e)?this.$data._value=e.map(t=>this.findOptionFromReducedValue(t)):this.$data._value=this.findOptionFromReducedValue(e)},select(e){this.$emit("option:selecting",e),this.isOptionSelected(e)?this.deselectFromDropdown&&(this.clearable||this.multiple&&this.selectedValue.length>1)&&this.deselect(e):(this.taggable&&!this.optionExists(e)&&(this.$emit("option:created",e),this.pushTag(e)),this.multiple&&(e=this.selectedValue.concat(e)),this.updateValue(e),this.$emit("option:selected",e)),this.onAfterSelect(e)},deselect(e){this.$emit("option:deselecting",e),this.updateValue(this.selectedValue.filter(t=>!this.optionComparator(t,e))),this.$emit("option:deselected",e)},clearSelection(){this.updateValue(this.multiple?[]:null)},onAfterSelect(e){this.closeOnSelect&&(this.open=!this.open,this.searchEl.blur()),this.clearSearchOnSelect&&(this.search="")},updateValue(e){typeof this.modelValue>"u"&&(this.$data._value=e),e!==null&&(Array.isArray(e)?e=e.map(t=>this.reduce(t)):e=this.reduce(e)),this.$emit("update:modelValue",e)},toggleDropdown(e){const t=e.target!==this.searchEl;t&&e.preventDefault();const n=[...this.deselectButtons||[],this.$refs.clearButton];if(this.searchEl===void 0||n.filter(Boolean).some(i=>i.contains(e.target)||i===e.target)){e.preventDefault();return}this.open&&t?this.searchEl.blur():this.disabled||(this.open=!0,this.searchEl.focus())},isOptionSelected(e){return this.selectedValue.some(t=>this.optionComparator(t,e))},isOptionDeselectable(e){return this.isOptionSelected(e)&&this.deselectFromDropdown},optionComparator(e,t){return this.getOptionKey(e)===this.getOptionKey(t)},findOptionFromReducedValue(e){const t=i=>JSON.stringify(this.reduce(i))===JSON.stringify(e),n=[...this.options,...this.pushedTags].filter(t);return n.length===1?n[0]:n.find(i=>this.optionComparator(i,this.$data._value))||e},closeSearchOptions(){this.open=!1,this.$emit("search:blur")},maybeDeleteValue(){if(!this.searchEl.value.length&&this.selectedValue&&this.selectedValue.length&&this.clearable){let e=null;this.multiple&&(e=[...this.selectedValue.slice(0,this.selectedValue.length-1)]),this.updateValue(e)}},optionExists(e){return this.optionList.some(t=>this.optionComparator(t,e))},normalizeOptionForSlot(e){return typeof e=="object"?e:{[this.label]:e}},pushTag(e){this.pushedTags.push(e)},onEscape(){this.search.length?this.search="":this.searchEl.blur()},onSearchBlur(){if(this.mousedown&&!this.searching)this.mousedown=!1;else{const{clearSearchOnSelect:e,multiple:t}=this;this.clearSearchOnBlur({clearSearchOnSelect:e,multiple:t})&&(this.search=""),this.closeSearchOptions();return}if(this.search.length===0&&this.options.length===0){this.closeSearchOptions();return}},onSearchFocus(){this.open=!0,this.$emit("search:focus")},onMousedown(){this.mousedown=!0},onMouseUp(){this.mousedown=!1},onSearchKeyDown(e){const t=s=>(s.preventDefault(),!this.isComposing&&this.typeAheadSelect()),n={8:s=>this.maybeDeleteValue(),9:s=>this.onTab(),27:s=>this.onEscape(),38:s=>(s.preventDefault(),this.typeAheadUp()),40:s=>(s.preventDefault(),this.typeAheadDown())};this.selectOnKeyCodes.forEach(s=>n[s]=t);const i=this.mapKeydown(n,this);if(typeof i[e.keyCode]=="function")return i[e.keyCode](e)}}},fn=["dir"],gn=["id","aria-expanded","aria-owns"],mn={ref:"selectedOptions",class:"vs__selected-options"},yn=["disabled","title","aria-label","onClick"],bn={ref:"actions",class:"vs__actions"},wn=["disabled"],vn={class:"vs__spinner"},On=["id"],xn=["id","aria-selected","onMouseover","onClick"],Sn={key:0,class:"vs__no-options"},Ln=ne(" Sorry, no matching options. "),Cn=["id"];function _n(e,t,n,i,s,o){const r=Je("append-to-body");return d(),g("div",{dir:n.dir,class:xe(["v-select",o.stateClasses])},[b(e.$slots,"header",w(v(o.scope.header))),S("div",{id:`vs${n.uid}__combobox`,ref:"toggle",class:"vs__dropdown-toggle",role:"combobox","aria-expanded":o.dropdownOpen.toString(),"aria-owns":`vs${n.uid}__listbox`,"aria-label":"Search for option",onMousedown:t[1]||(t[1]=l=>o.toggleDropdown(l))},[S("div",mn,[(d(!0),g(we,null,pe(o.selectedValue,(l,a)=>b(e.$slots,"selected-option-container",{option:o.normalizeOptionForSlot(l),deselect:o.deselect,multiple:n.multiple,disabled:n.disabled},()=>[(d(),g("span",{key:n.getOptionKey(l),class:"vs__selected"},[b(e.$slots,"selected-option",w(v(o.normalizeOptionForSlot(l))),()=>[ne(H(n.getOptionLabel(l)),1)]),n.multiple?(d(),g("button",{key:0,ref_for:!0,ref:c=>s.deselectButtons[a]=c,disabled:n.disabled,type:"button",class:"vs__deselect",title:`Deselect ${n.getOptionLabel(l)}`,"aria-label":`Deselect ${n.getOptionLabel(l)}`,onClick:c=>o.deselect(l)},[(d(),j(ae(o.childComponents.Deselect)))],8,yn)):E("",!0)]))])),256)),b(e.$slots,"search",w(v(o.scope.search)),()=>[S("input",R({class:"vs__search"},o.scope.search.attributes,De(o.scope.search.events)),null,16)])],512),S("div",bn,[ce(S("button",{ref:"clearButton",disabled:n.disabled,type:"button",class:"vs__clear",title:"Clear Selected","aria-label":"Clear Selected",onClick:t[0]||(t[0]=(...l)=>o.clearSelection&&o.clearSelection(...l))},[(d(),j(ae(o.childComponents.Deselect)))],8,wn),[[ve,o.showClearButton]]),b(e.$slots,"open-indicator",w(v(o.scope.openIndicator)),()=>[n.noDrop?E("",!0):(d(),j(ae(o.childComponents.OpenIndicator),w(R({key:0},o.scope.openIndicator.attributes)),null,16))]),b(e.$slots,"spinner",w(v(o.scope.spinner)),()=>[ce(S("div",vn,"Loading...",512),[[ve,e.mutableLoading]])])],512)],40,gn),U(Xe,{name:n.transition},{default:T(()=>[o.dropdownOpen?ce((d(),g("ul",{id:`vs${n.uid}__listbox`,ref:"dropdownMenu",key:`vs${n.uid}__listbox`,class:"vs__dropdown-menu",role:"listbox",tabindex:"-1",onMousedown:t[2]||(t[2]=Oe((...l)=>o.onMousedown&&o.onMousedown(...l),["prevent"])),onMouseup:t[3]||(t[3]=(...l)=>o.onMouseUp&&o.onMouseUp(...l))},[b(e.$slots,"list-header",w(v(o.scope.listHeader))),(d(!0),g(we,null,pe(o.filteredOptions,(l,a)=>(d(),g("li",{id:`vs${n.uid}__option-${a}`,key:n.getOptionKey(l),role:"option",class:xe(["vs__dropdown-option",{"vs__dropdown-option--deselect":o.isOptionDeselectable(l)&&a===e.typeAheadPointer,"vs__dropdown-option--selected":o.isOptionSelected(l),"vs__dropdown-option--highlight":a===e.typeAheadPointer,"vs__dropdown-option--disabled":!n.selectable(l)}]),"aria-selected":a===e.typeAheadPointer?!0:null,onMouseover:c=>n.selectable(l)?e.typeAheadPointer=a:null,onClick:Oe(c=>n.selectable(l)?o.select(l):null,["prevent","stop"])},[b(e.$slots,"option",w(v(o.normalizeOptionForSlot(l))),()=>[ne(H(n.getOptionLabel(l)),1)])],42,xn))),128)),o.filteredOptions.length===0?(d(),g("li",Sn,[b(e.$slots,"no-options",w(v(o.scope.noOptions)),()=>[Ln])])):E("",!0),b(e.$slots,"list-footer",w(v(o.scope.listFooter)))],40,On)),[[r]]):(d(),g("ul",{key:1,id:`vs${n.uid}__listbox`,role:"listbox",style:{display:"none",visibility:"hidden"}},null,8,Cn))]),_:3},8,["name"]),b(e.$slots,"footer",w(v(o.scope.footer)))],10,fn)}const A=be(pn,[["render",_n]]);function ze(e,t){const n=[];let i=0,s=e.toLowerCase().indexOf(t.toLowerCase(),i),o=0;for(;s>-1&&o++<e.length;)i=s+t.length,n.push({start:s,end:i}),s=e.toLowerCase().indexOf(t.toLowerCase(),i);return n}const $n=Qe({name:"NcHighlight",props:{text:{type:String,default:""},search:{type:String,default:""},highlight:{type:Array,default:()=>[]}},computed:{ranges(){let e=[];return!this.search&&this.highlight.length===0||(this.highlight.length>0?e=this.highlight:e=ze(this.text,this.search),e.forEach((t,n)=>{t.end<t.start&&(e[n]={start:t.end,end:t.start})}),e=e.reduce((t,n)=>(n.start<this.text.length&&n.end>0&&t.push({start:n.start<0?0:n.start,end:n.end>this.text.length?this.text.length:n.end}),t),[]),e.sort((t,n)=>t.start-n.start),e=e.reduce((t,n)=>{if(!t.length)t.push(n);else{const i=t.length-1;t[i].end>=n.start?t[i]={start:t[i].start,end:Math.max(t[i].end,n.end)}:t.push(n)}return t},[])),e},chunks(){if(this.ranges.length===0)return[{start:0,end:this.text.length,highlight:!1,text:this.text}];const e=[];let t=0,n=0;for(;t<this.text.length;){const i=this.ranges[n];if(i.start===t){e.push({...i,highlight:!0,text:this.text.slice(i.start,i.end)}),n++,t=i.end,n>=this.ranges.length&&t<this.text.length&&(e.push({start:t,end:this.text.length,highlight:!1,text:this.text.slice(t)}),t=this.text.length);continue}e.push({start:t,end:i.start,highlight:!1,text:this.text.slice(t,i.start)}),t=i.start}return e}},render(){return this.ranges.length?ee("span",{},this.chunks.map(e=>e.highlight?ee("strong",{},e.text):e.text)):ee("span",{},this.text)}}),Vn={name:"NcEllipsisedOption",components:{NcHighlight:$n},props:{name:{type:String,default:""},search:{type:String,default:""}},computed:{needsTruncate(){return this.name&&this.name.length>=10},split(){return this.name.length-Math.min(Math.floor(this.name.length/2),10)},part1(){return this.needsTruncate?this.name.slice(0,this.split):this.name},part2(){return this.needsTruncate?this.name.slice(this.split):""},highlight1(){return this.search?ze(this.name,this.search):[]},highlight2(){return this.highlight1.map(e=>({start:e.start-this.split,end:e.end-this.split}))}}},Bn=["title"];function Tn(e,t,n,i,s,o){const r=q("NcHighlight");return d(),g("span",{dir:"auto",class:"name-parts",title:n.name},[U(r,{class:"name-parts__first",text:o.part1,search:n.search,highlight:o.highlight1},null,8,["text","search","highlight"]),o.part2?(d(),j(r,{key:0,class:"name-parts__last",text:o.part2,search:n.search,highlight:o.highlight2},null,8,["text","search","highlight"])):E("",!0)],8,Bn)}const Fn=ie(Vn,[["render",Tn],["__scopeId","data-v-a612f185"]]);Ge(et);const kn={name:"NcSelect",components:{ChevronDown:ct,NcEllipsisedOption:Fn,NcLoadingIcon:tt,VueSelect:A},props:{...A.props,...A.mixins.reduce((e,t)=>({...e,...t.props}),{}),ariaLabelClearSelected:{type:String,default:G("Clear selected")},ariaLabelCombobox:{type:String,default:null},ariaLabelListbox:{type:String,default:G("Options")},ariaLabelDeselectOption:{type:Function,default:e=>G("Deselect {option}",{option:e})},appendToBody:{type:Boolean,default:!0},calculatePosition:{type:Function,default:null},keepOpen:{type:Boolean,default:!1},components:{type:Object,default:()=>({Deselect:{render:()=>ee(mt,{size:20,fillColor:"var(--vs-controls-color)",style:[{cursor:"pointer"}]})}})},limit:{type:Number,default:null},disabled:{type:Boolean,default:!1},dropdownShouldOpen:{type:Function,default:({noDrop:e,open:t})=>e?!1:t},filterBy:{type:Function,default:null},inputClass:{type:[String,Object],default:null},inputId:{type:String,default:()=>Se()},inputLabel:{type:String,default:null},labelOutside:{type:Boolean,default:!1},keyboardFocusBorder:{type:Boolean,default:!0},label:{type:String,default:null},loading:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},noWrap:{type:Boolean,default:!1},options:{type:Array,default:()=>[]},placeholder:{type:String,default:""},mapKeydown:{type:Function,default(e,t){return{...e,27:n=>{t.open&&n.stopPropagation(),e[27](n)}}}},uid:{type:String,default:()=>Se()},placement:{type:String,default:"bottom"},resetFocusOnOptionsChange:{type:Boolean,default:!0},modelValue:{type:[String,Number,Object,Array],default:null},required:{type:Boolean,default:!1}," ":{}},emits:[" ","update:modelValue"],setup(){const e=Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--default-clickable-area")),t=Number.parseInt(window.getComputedStyle(document.body).getPropertyValue("--default-grid-baseline"));return{avatarSize:e-2*t,isLegacy:nt}},data(){return{search:""}},computed:{inputRequired(){return this.required?this.modelValue===null||Array.isArray(this.modelValue)&&this.modelValue.length===0:null},localCalculatePosition(){return this.calculatePosition!==null?this.calculatePosition:(e,t,{width:n})=>{e.style.width=n;const i={name:"addClass",fn(){return e.classList.add("vs__dropdown-menu--floating"),{}}},s={name:"togglePlacementClass",fn({placement:r}){return t.$el.classList.toggle("select--drop-up",r==="top"),e.classList.toggle("vs__dropdown-menu--floating-placement-top",r==="top"),{}}},o=()=>{jt(t.$refs.toggle,e,{placement:this.placement,middleware:[Rt(-1),i,s,Mt(),Nt({limiter:It()})]}).then(({x:r,y:l})=>{Object.assign(e.style,{left:`${r}px`,top:`${l}px`,width:`${t.$refs.toggle.getBoundingClientRect().width}px`})})};return Et(t.$refs.toggle,e,o)}},localFilterBy(){return this.filterBy??A.props.filterBy.default},localLabel(){return this.label??A.props.label.default},propsToForward(){const e=[...Object.keys(A.props),...A.mixins.flatMap(t=>Object.keys(t.props??{}))];return{...Object.fromEntries(Object.entries(this.$props).filter(([t,n])=>e.includes(t))),calculatePosition:this.localCalculatePosition,closeOnSelect:!this.keepOpen,filterBy:this.localFilterBy,label:this.localLabel}}},mounted(){!this.labelOutside&&!this.inputLabel&&this.ariaLabelCombobox,this.inputLabel&&this.ariaLabelCombobox},methods:{t:G}},Dn=["for"],Pn=["required"];function An(e,t,n,i,s,o){const r=q("ChevronDown"),l=q("NcEllipsisedOption"),a=q("NcLoadingIcon"),c=q("VueSelect");return d(),j(c,R({class:["select",{"select--legacy":i.isLegacy,"select--no-wrap":n.noWrap}]},o.propsToForward,{onSearch:t[0]||(t[0]=h=>s.search=h),"onUpdate:modelValue":t[1]||(t[1]=h=>e.$emit("update:modelValue",h))}),Ze({search:T(({attributes:h,events:u})=>[S("input",R({class:["vs__search",[n.inputClass]]},h,{required:o.inputRequired,dir:"auto"},De(u,!0)),null,16,Pn)]),"open-indicator":T(({attributes:h})=>[U(r,R(h,{fillColor:"var(--vs-controls-color)",style:{cursor:n.disabled?null:"pointer"},size:26}),null,16,["style"])]),option:T(h=>[b(e.$slots,"option",w(v(h)),()=>[U(l,{name:String(h[o.localLabel]),search:s.search},null,8,["name","search"])])]),"selected-option":T(h=>[b(e.$slots,"selected-option",w(v(h)),()=>[U(l,{name:String(h[o.localLabel]),search:s.search},null,8,["name","search"])])]),spinner:T(h=>[h.loading?(d(),j(a,{key:0})):E("",!0)]),"no-options":T(()=>[ne(H(o.t("No results")),1)]),_:2},[!n.labelOutside&&n.inputLabel?{name:"header",fn:T(()=>[S("label",{for:n.inputId,class:"select__label"},H(n.inputLabel),9,Dn)]),key:"0"}:void 0,pe(e.$slots,(h,u)=>({name:u,fn:T(p=>[b(e.$slots,u,w(v(p)))])}))]),1040,["class"])}const jn=ie(kn,[["render",An]]);export{mt as I,jn as N,$n as _,Fn as a};
//# sourceMappingURL=NcSelect-B1uITk_3-D769WsNG.chunk.mjs.map