@govtechsg/sgds-web-component 3.24.0 → 3.24.1-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/components/ComboBox/index.umd.min.js +1 -1
  2. package/components/Datepicker/datepicker-calendar.js +4 -4
  3. package/components/Datepicker/datepicker-calendar.js.map +1 -1
  4. package/components/Datepicker/datepicker-header.js +2 -2
  5. package/components/Datepicker/datepicker-header.js.map +1 -1
  6. package/components/Datepicker/datepicker-input.js +13 -48
  7. package/components/Datepicker/datepicker-input.js.map +1 -1
  8. package/components/Datepicker/index.umd.min.js +335 -335
  9. package/components/Datepicker/index.umd.min.js.map +1 -1
  10. package/components/Datepicker/sgds-datepicker.js +6 -6
  11. package/components/Datepicker/sgds-datepicker.js.map +1 -1
  12. package/components/Input/index.umd.min.js +2 -2
  13. package/components/Input/index.umd.min.js.map +1 -1
  14. package/components/Input/input.js +1 -1
  15. package/components/QuantityToggle/index.umd.min.js +1 -1
  16. package/components/QuantityToggle/index.umd.min.js.map +1 -1
  17. package/components/Select/index.umd.min.js +1 -1
  18. package/components/Tab/index.umd.min.js +1 -1
  19. package/components/Tab/index.umd.min.js.map +1 -1
  20. package/components/Tab/tab-panel.js +1 -1
  21. package/components/Textarea/index.umd.min.js +1 -1
  22. package/components/index.umd.min.js +423 -423
  23. package/components/index.umd.min.js.map +1 -1
  24. package/css/fouc.css +1 -1
  25. package/custom-elements.json +893 -893
  26. package/index.umd.min.js +467 -467
  27. package/index.umd.min.js.map +1 -1
  28. package/package.json +1 -3
  29. package/react/components/Datepicker/datepicker-calendar.cjs.js +4 -4
  30. package/react/components/Datepicker/datepicker-calendar.cjs.js.map +1 -1
  31. package/react/components/Datepicker/datepicker-calendar.js +4 -4
  32. package/react/components/Datepicker/datepicker-calendar.js.map +1 -1
  33. package/react/components/Datepicker/datepicker-header.cjs.js +2 -2
  34. package/react/components/Datepicker/datepicker-header.cjs.js.map +1 -1
  35. package/react/components/Datepicker/datepicker-header.js +2 -2
  36. package/react/components/Datepicker/datepicker-header.js.map +1 -1
  37. package/react/components/Datepicker/datepicker-input.cjs.js +13 -52
  38. package/react/components/Datepicker/datepicker-input.cjs.js.map +1 -1
  39. package/react/components/Datepicker/datepicker-input.js +13 -48
  40. package/react/components/Datepicker/datepicker-input.js.map +1 -1
  41. package/react/components/Datepicker/sgds-datepicker.cjs.js +6 -6
  42. package/react/components/Datepicker/sgds-datepicker.cjs.js.map +1 -1
  43. package/react/components/Datepicker/sgds-datepicker.js +6 -6
  44. package/react/components/Datepicker/sgds-datepicker.js.map +1 -1
  45. package/react/components/Input/input.cjs.js +1 -1
  46. package/react/components/Input/input.js +1 -1
  47. package/react/components/Tab/tab-panel.cjs.js +1 -1
  48. package/react/components/Tab/tab-panel.js +1 -1
  49. package/react/index.cjs.js +4 -4
  50. package/react/index.d.ts +1 -1
  51. package/react/index.js +1 -1
  52. package/react/styles/form-text-control.cjs.js +1 -1
  53. package/react/styles/form-text-control.js +1 -1
  54. package/react/utils/date-helpers.cjs.js +120 -0
  55. package/react/utils/date-helpers.cjs.js.map +1 -0
  56. package/react/utils/date-helpers.js +108 -0
  57. package/react/utils/date-helpers.js.map +1 -0
  58. package/react/utils/date-mask.cjs.js +203 -0
  59. package/react/utils/date-mask.cjs.js.map +1 -0
  60. package/react/utils/date-mask.js +199 -0
  61. package/react/utils/date-mask.js.map +1 -0
  62. package/react/utils/time.cjs.js +7 -7
  63. package/react/utils/time.cjs.js.map +1 -1
  64. package/react/utils/time.js +1 -1
  65. package/react/utils/time.js.map +1 -1
  66. package/styles/form-text-control.js +1 -1
  67. package/types/react.d.ts +23 -23
  68. package/utils/date-helpers.d.ts +22 -0
  69. package/utils/date-helpers.js +107 -0
  70. package/utils/date-helpers.js.map +1 -0
  71. package/utils/date-mask.d.ts +44 -0
  72. package/utils/date-mask.js +198 -0
  73. package/utils/date-mask.js.map +1 -0
  74. package/utils/time.js +1 -1
  75. package/utils/time.js.map +1 -1
@@ -80,7 +80,7 @@ window.ShadyDOM?.inUse&&!0===window.ShadyDOM?.noPatch&&window.ShadyDOM.wrap;cons
80
80
  * @license
81
81
  * Copyright 2020 Google LLC
82
82
  * SPDX-License-Identifier: BSD-3-Clause
83
- */const Fe=()=>new We;class We{}const qe=new WeakMap;const Ke=je(class extends Ue{render(e){return oe}update(e,[t]){const l=t!==this._ref;return l&&void 0!==this._ref&&this._updateRefValue(void 0),(l||this._lastElementForRef!==this._element)&&(this._ref=t,this._context=e.options?.host,this._updateRefValue(this._element=e.element)),oe}_updateRefValue(e){if(this.isConnected||(e=void 0),"function"==typeof this._ref){const t=this._context??globalThis;let l=qe.get(t);void 0===l&&(l=new WeakMap,qe.set(t,l)),void 0!==l.get(this._ref)&&this._ref.call(this._context,void 0),l.set(this._ref,e),void 0!==e&&this._ref.call(this._context,e)}else this._ref.value=e}get _lastElementForRef(){return"function"==typeof this._ref?qe.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),Je=Math.min,Ge=Math.max,Ye=Math.round,Xe=Math.floor,Qe=e=>({x:e,y:e}),et={left:"right",right:"left",bottom:"top",top:"bottom"},tt={start:"end",end:"start"};function lt(e,t,l){return Ge(e,Je(t,l))}function ot(e,t){return"function"==typeof e?e(t):e}function nt(e){return e.split("-")[0]}function it(e){return e.split("-")[1]}function rt(e){return"x"===e?"y":"x"}function at(e){return"y"===e?"height":"width"}const st=new Set(["top","bottom"]);function ct(e){return st.has(nt(e))?"y":"x"}function dt(e){return rt(ct(e))}function ht(e,t,l){void 0===l&&(l=!1);const o=it(e),n=dt(e),i=at(n);let r="x"===n?o===(l?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[i]>t.floating[i]&&(r=wt(r)),[r,wt(r)]}function ut(e){return e.replace(/start|end/g,e=>tt[e])}const vt=["left","right"],ft=["right","left"],pt=["top","bottom"],gt=["bottom","top"];function mt(e,t,l,o){const n=it(e);let i=function(e,t,l){switch(e){case"top":case"bottom":return l?t?ft:vt:t?vt:ft;case"left":case"right":return t?pt:gt;default:return[]}}(nt(e),"start"===l,o);return n&&(i=i.map(e=>e+"-"+n),t&&(i=i.concat(i.map(ut)))),i}function wt(e){return e.replace(/left|right|bottom|top/g,e=>et[e])}function _t(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function bt(e){const{x:t,y:l,width:o,height:n}=e;return{width:o,height:n,top:l,left:t,right:t+o,bottom:l+n,x:t,y:l}}function xt(e,t,l){let{reference:o,floating:n}=e;const i=ct(t),r=dt(t),a=at(r),s=nt(t),c="y"===i,d=o.x+o.width/2-n.width/2,h=o.y+o.height/2-n.height/2,u=o[a]/2-n[a]/2;let v;switch(s){case"top":v={x:d,y:o.y-n.height};break;case"bottom":v={x:d,y:o.y+o.height};break;case"right":v={x:o.x+o.width,y:h};break;case"left":v={x:o.x-n.width,y:h};break;default:v={x:o.x,y:o.y}}switch(it(t)){case"start":v[r]-=u*(l&&c?-1:1);break;case"end":v[r]+=u*(l&&c?-1:1)}return v}async function Zt(e,t){var l;void 0===t&&(t={});const{x:o,y:n,platform:i,rects:r,elements:a,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:u=!1,padding:v=0}=ot(t,e),f=_t(v),p=a[u?"floating"===h?"reference":"floating":h],g=bt(await i.getClippingRect({element:null==(l=await(null==i.isElement?void 0:i.isElement(p)))||l?p:p.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:s})),m="floating"===h?{x:o,y:n,width:r.floating.width,height:r.floating.height}:r.reference,w=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),_=await(null==i.isElement?void 0:i.isElement(w))&&await(null==i.getScale?void 0:i.getScale(w))||{x:1,y:1},b=bt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:w,strategy:s}):m);return{top:(g.top-b.top+f.top)/_.y,bottom:(b.bottom-g.bottom+f.bottom)/_.y,left:(g.left-b.left+f.left)/_.x,right:(b.right-g.right+f.right)/_.x}}const Ct=new Set(["left","top"]);function yt(){return"undefined"!=typeof window}function Mt(e){return Pt(e)?(e.nodeName||"").toLowerCase():"#document"}function Vt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Ht(e){var t;return null==(t=(Pt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Pt(e){return!!yt()&&(e instanceof Node||e instanceof Vt(e).Node)}function Ot(e){return!!yt()&&(e instanceof Element||e instanceof Vt(e).Element)}function zt(e){return!!yt()&&(e instanceof HTMLElement||e instanceof Vt(e).HTMLElement)}function $t(e){return!(!yt()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Vt(e).ShadowRoot)}const St=new Set(["inline","contents"]);function Bt(e){const{overflow:t,overflowX:l,overflowY:o,display:n}=Ft(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+l)&&!St.has(n)}const jt=new Set(["table","td","th"]);function At(e){return jt.has(Mt(e))}const kt=[":popover-open",":modal"];function Lt(e){return kt.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Et=["transform","translate","scale","rotate","perspective"],It=["transform","translate","scale","rotate","perspective","filter"],Tt=["paint","layout","strict","content"];function Rt(e){const t=Dt(),l=Ot(e)?Ft(e):e;return Et.some(e=>!!l[e]&&"none"!==l[e])||!!l.containerType&&"normal"!==l.containerType||!t&&!!l.backdropFilter&&"none"!==l.backdropFilter||!t&&!!l.filter&&"none"!==l.filter||It.some(e=>(l.willChange||"").includes(e))||Tt.some(e=>(l.contain||"").includes(e))}function Dt(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Nt=new Set(["html","body","#document"]);function Ut(e){return Nt.has(Mt(e))}function Ft(e){return Vt(e).getComputedStyle(e)}function Wt(e){return Ot(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qt(e){if("html"===Mt(e))return e;const t=e.assignedSlot||e.parentNode||$t(e)&&e.host||Ht(e);return $t(t)?t.host:t}function Kt(e){const t=qt(e);return Ut(t)?e.ownerDocument?e.ownerDocument.body:e.body:zt(t)&&Bt(t)?t:Kt(t)}function Jt(e,t,l){var o;void 0===t&&(t=[]),void 0===l&&(l=!0);const n=Kt(e),i=n===(null==(o=e.ownerDocument)?void 0:o.body),r=Vt(n);if(i){const e=Gt(r);return t.concat(r,r.visualViewport||[],Bt(n)?n:[],e&&l?Jt(e):[])}return t.concat(n,Jt(n,[],l))}function Gt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Yt(e){const t=Ft(e);let l=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const n=zt(e),i=n?e.offsetWidth:l,r=n?e.offsetHeight:o,a=Ye(l)!==i||Ye(o)!==r;return a&&(l=i,o=r),{width:l,height:o,$:a}}function Xt(e){return Ot(e)?e:e.contextElement}function Qt(e){const t=Xt(e);if(!zt(t))return Qe(1);const l=t.getBoundingClientRect(),{width:o,height:n,$:i}=Yt(t);let r=(i?Ye(l.width):l.width)/o,a=(i?Ye(l.height):l.height)/n;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}const el=Qe(0);function tl(e){const t=Vt(e);return Dt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:el}function ll(e,t,l,o){void 0===t&&(t=!1),void 0===l&&(l=!1);const n=e.getBoundingClientRect(),i=Xt(e);let r=Qe(1);t&&(o?Ot(o)&&(r=Qt(o)):r=Qt(e));const a=function(e,t,l){return void 0===t&&(t=!1),!(!l||t&&l!==Vt(e))&&t}(i,l,o)?tl(i):Qe(0);let s=(n.left+a.x)/r.x,c=(n.top+a.y)/r.y,d=n.width/r.x,h=n.height/r.y;if(i){const e=Vt(i),t=o&&Ot(o)?Vt(o):o;let l=e,n=Gt(l);for(;n&&o&&t!==l;){const e=Qt(n),t=n.getBoundingClientRect(),o=Ft(n),i=t.left+(n.clientLeft+parseFloat(o.paddingLeft))*e.x,r=t.top+(n.clientTop+parseFloat(o.paddingTop))*e.y;s*=e.x,c*=e.y,d*=e.x,h*=e.y,s+=i,c+=r,l=Vt(n),n=Gt(l)}}return bt({width:d,height:h,x:s,y:c})}function ol(e,t){const l=Wt(e).scrollLeft;return t?t.left+l:ll(Ht(e)).left+l}function nl(e,t){const l=e.getBoundingClientRect();return{x:l.left+t.scrollLeft-ol(e,l),y:l.top+t.scrollTop}}const il=new Set(["absolute","fixed"]);function rl(e,t,l){let o;if("viewport"===t)o=function(e,t){const l=Vt(e),o=Ht(e),n=l.visualViewport;let i=o.clientWidth,r=o.clientHeight,a=0,s=0;if(n){i=n.width,r=n.height;const e=Dt();(!e||e&&"fixed"===t)&&(a=n.offsetLeft,s=n.offsetTop)}const c=ol(o);if(c<=0){const e=o.ownerDocument,t=e.body,l=getComputedStyle(t),n="CSS1Compat"===e.compatMode&&parseFloat(l.marginLeft)+parseFloat(l.marginRight)||0,r=Math.abs(o.clientWidth-t.clientWidth-n);r<=25&&(i-=r)}else c<=25&&(i+=c);return{width:i,height:r,x:a,y:s}}(e,l);else if("document"===t)o=function(e){const t=Ht(e),l=Wt(e),o=e.ownerDocument.body,n=Ge(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=Ge(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-l.scrollLeft+ol(e);const a=-l.scrollTop;return"rtl"===Ft(o).direction&&(r+=Ge(t.clientWidth,o.clientWidth)-n),{width:n,height:i,x:r,y:a}}(Ht(e));else if(Ot(t))o=function(e,t){const l=ll(e,!0,"fixed"===t),o=l.top+e.clientTop,n=l.left+e.clientLeft,i=zt(e)?Qt(e):Qe(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:n*i.x,y:o*i.y}}(t,l);else{const l=tl(e);o={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return bt(o)}function al(e,t){const l=qt(e);return!(l===t||!Ot(l)||Ut(l))&&("fixed"===Ft(l).position||al(l,t))}function sl(e,t,l){const o=zt(t),n=Ht(t),i="fixed"===l,r=ll(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const s=Qe(0);function c(){s.x=ol(n)}if(o||!o&&!i)if(("body"!==Mt(t)||Bt(n))&&(a=Wt(t)),o){const e=ll(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else n&&c();i&&!o&&n&&c();const d=!n||o||i?Qe(0):nl(n,a);return{x:r.left+a.scrollLeft-s.x-d.x,y:r.top+a.scrollTop-s.y-d.y,width:r.width,height:r.height}}function cl(e){return"static"===Ft(e).position}function dl(e,t){if(!zt(e)||"fixed"===Ft(e).position)return null;if(t)return t(e);let l=e.offsetParent;return Ht(e)===l&&(l=l.ownerDocument.body),l}function hl(e,t){const l=Vt(e);if(Lt(e))return l;if(!zt(e)){let t=qt(e);for(;t&&!Ut(t);){if(Ot(t)&&!cl(t))return t;t=qt(t)}return l}let o=dl(e,t);for(;o&&At(o)&&cl(o);)o=dl(o,t);return o&&Ut(o)&&cl(o)&&!Rt(o)?l:o||function(e){let t=qt(e);for(;zt(t)&&!Ut(t);){if(Rt(t))return t;if(Lt(t))return null;t=qt(t)}return null}(e)||l}const ul={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:l,offsetParent:o,strategy:n}=e;const i="fixed"===n,r=Ht(o),a=!!t&&Lt(t.floating);if(o===r||a&&i)return l;let s={scrollLeft:0,scrollTop:0},c=Qe(1);const d=Qe(0),h=zt(o);if((h||!h&&!i)&&(("body"!==Mt(o)||Bt(r))&&(s=Wt(o)),zt(o))){const e=ll(o);c=Qt(o),d.x=e.x+o.clientLeft,d.y=e.y+o.clientTop}const u=!r||h||i?Qe(0):nl(r,s);return{width:l.width*c.x,height:l.height*c.y,x:l.x*c.x-s.scrollLeft*c.x+d.x+u.x,y:l.y*c.y-s.scrollTop*c.y+d.y+u.y}},getDocumentElement:Ht,getClippingRect:function(e){let{element:t,boundary:l,rootBoundary:o,strategy:n}=e;const i=[..."clippingAncestors"===l?Lt(t)?[]:function(e,t){const l=t.get(e);if(l)return l;let o=Jt(e,[],!1).filter(e=>Ot(e)&&"body"!==Mt(e)),n=null;const i="fixed"===Ft(e).position;let r=i?qt(e):e;for(;Ot(r)&&!Ut(r);){const t=Ft(r),l=Rt(r);l||"fixed"!==t.position||(n=null),(i?!l&&!n:!l&&"static"===t.position&&n&&il.has(n.position)||Bt(r)&&!l&&al(e,r))?o=o.filter(e=>e!==r):n=t,r=qt(r)}return t.set(e,o),o}(t,this._c):[].concat(l),o],r=i[0],a=i.reduce((e,l)=>{const o=rl(t,l,n);return e.top=Ge(o.top,e.top),e.right=Je(o.right,e.right),e.bottom=Je(o.bottom,e.bottom),e.left=Ge(o.left,e.left),e},rl(t,r,n));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:hl,getElementRects:async function(e){const t=this.getOffsetParent||hl,l=this.getDimensions,o=await l(e.floating);return{reference:sl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:l}=Yt(e);return{width:t,height:l}},getScale:Qt,isElement:Ot,isRTL:function(e){return"rtl"===Ft(e).direction}};function vl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fl(e,t,l,o){void 0===o&&(o={});const{ancestorScroll:n=!0,ancestorResize:i=!0,elementResize:r="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:s=!1}=o,c=Xt(e),d=n||i?[...c?Jt(c):[],...Jt(t)]:[];d.forEach(e=>{n&&e.addEventListener("scroll",l,{passive:!0}),i&&e.addEventListener("resize",l)});const h=c&&a?function(e,t){let l,o=null;const n=Ht(e);function i(){var e;clearTimeout(l),null==(e=o)||e.disconnect(),o=null}return function r(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),i();const c=e.getBoundingClientRect(),{left:d,top:h,width:u,height:v}=c;if(a||t(),!u||!v)return;const f={rootMargin:-Xe(h)+"px "+-Xe(n.clientWidth-(d+u))+"px "+-Xe(n.clientHeight-(h+v))+"px "+-Xe(d)+"px",threshold:Ge(0,Je(1,s))||1};let p=!0;function g(t){const o=t[0].intersectionRatio;if(o!==s){if(!p)return r();o?r(!1,o):l=setTimeout(()=>{r(!1,1e-7)},1e3)}1!==o||vl(c,e.getBoundingClientRect())||r(),p=!1}try{o=new IntersectionObserver(g,{...f,root:n.ownerDocument})}catch(e){o=new IntersectionObserver(g,f)}o.observe(e)}(!0),i}(c,l):null;let u,v=-1,f=null;r&&(f=new ResizeObserver(e=>{let[o]=e;o&&o.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),l()}),c&&!s&&f.observe(c),f.observe(t));let p=s?ll(e):null;return s&&function t(){const o=ll(e);p&&!vl(p,o)&&l();p=o,u=requestAnimationFrame(t)}(),l(),()=>{var e;d.forEach(e=>{n&&e.removeEventListener("scroll",l),i&&e.removeEventListener("resize",l)}),null==h||h(),null==(e=f)||e.disconnect(),f=null,s&&cancelAnimationFrame(u)}}const pl=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var l,o;const{x:n,y:i,placement:r,middlewareData:a}=t,s=await async function(e,t){const{placement:l,platform:o,elements:n}=e,i=await(null==o.isRTL?void 0:o.isRTL(n.floating)),r=nt(l),a=it(l),s="y"===ct(l),c=Ct.has(r)?-1:1,d=i&&s?-1:1,h=ot(t,e);let{mainAxis:u,crossAxis:v,alignmentAxis:f}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&"number"==typeof f&&(v="end"===a?-1*f:f),s?{x:v*d,y:u*c}:{x:u*c,y:v*d}}(t,e);return r===(null==(l=a.offset)?void 0:l.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{x:n+s.x,y:i+s.y,data:{...s,placement:r}}}}},gl=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:l,y:o,placement:n}=t,{mainAxis:i=!0,crossAxis:r=!1,limiter:a={fn:e=>{let{x:t,y:l}=e;return{x:t,y:l}}},...s}=ot(e,t),c={x:l,y:o},d=await Zt(t,s),h=ct(nt(n)),u=rt(h);let v=c[u],f=c[h];if(i){const e="y"===u?"bottom":"right";v=lt(v+d["y"===u?"top":"left"],v,v-d[e])}if(r){const e="y"===h?"bottom":"right";f=lt(f+d["y"===h?"top":"left"],f,f-d[e])}const p=a.fn({...t,[u]:v,[h]:f});return{...p,data:{x:p.x-l,y:p.y-o,enabled:{[u]:i,[h]:r}}}}}},ml=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var l,o;const{placement:n,middlewareData:i,rects:r,initialPlacement:a,platform:s,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:p=!0,...g}=ot(e,t);if(null!=(l=i.arrow)&&l.alignmentOffset)return{};const m=nt(n),w=ct(a),_=nt(a)===a,b=await(null==s.isRTL?void 0:s.isRTL(c.floating)),x=u||(_||!p?[wt(a)]:function(e){const t=wt(e);return[ut(e),t,ut(t)]}(a)),Z="none"!==f;!u&&Z&&x.push(...mt(a,p,f,b));const C=[a,...x],y=await Zt(t,g),M=[];let V=(null==(o=i.flip)?void 0:o.overflows)||[];if(d&&M.push(y[m]),h){const e=ht(n,r,b);M.push(y[e[0]],y[e[1]])}if(V=[...V,{placement:n,overflows:M}],!M.every(e=>e<=0)){var H,P;const e=((null==(H=i.flip)?void 0:H.index)||0)+1,t=C[e];if(t){if(!("alignment"===h&&w!==ct(t))||V.every(e=>ct(e.placement)!==w||e.overflows[0]>0))return{data:{index:e,overflows:V},reset:{placement:t}}}let l=null==(P=V.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:P.placement;if(!l)switch(v){case"bestFit":{var O;const e=null==(O=V.filter(e=>{if(Z){const t=ct(e.placement);return t===w||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:O[0];e&&(l=e);break}case"initialPlacement":l=a}if(n!==l)return{reset:{placement:l}}}return{}}}},wl=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var l,o;const{placement:n,rects:i,platform:r,elements:a}=t,{apply:s=()=>{},...c}=ot(e,t),d=await Zt(t,c),h=nt(n),u=it(n),v="y"===ct(n),{width:f,height:p}=i.floating;let g,m;"top"===h||"bottom"===h?(g=h,m=u===(await(null==r.isRTL?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(m=h,g="end"===u?"top":"bottom");const w=p-d.top-d.bottom,_=f-d.left-d.right,b=Je(p-d[g],w),x=Je(f-d[m],_),Z=!t.middlewareData.shift;let C=b,y=x;if(null!=(l=t.middlewareData.shift)&&l.enabled.x&&(y=_),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(C=w),Z&&!u){const e=Ge(d.left,0),t=Ge(d.right,0),l=Ge(d.top,0),o=Ge(d.bottom,0);v?y=f-2*(0!==e||0!==t?e+t:Ge(d.left,d.right)):C=p-2*(0!==l||0!==o?l+o:Ge(d.top,d.bottom))}await s({...t,availableWidth:y,availableHeight:C});const M=await r.getDimensions(a.floating);return f!==M.width||p!==M.height?{reset:{rects:!0}}:{}}}},_l=(e,t,l)=>{const o=new Map,n={platform:ul,...l},i={...n.platform,_c:o};return(async(e,t,l)=>{const{placement:o="bottom",strategy:n="absolute",middleware:i=[],platform:r}=l,a=i.filter(Boolean),s=await(null==r.isRTL?void 0:r.isRTL(t));let c=await r.getElementRects({reference:e,floating:t,strategy:n}),{x:d,y:h}=xt(c,o,s),u=o,v={},f=0;for(let l=0;l<a.length;l++){const{name:i,fn:p}=a[l],{x:g,y:m,data:w,reset:_}=await p({x:d,y:h,initialPlacement:o,placement:u,strategy:n,middlewareData:v,rects:c,platform:r,elements:{reference:e,floating:t}});d=null!=g?g:d,h=null!=m?m:h,v={...v,[i]:{...v[i],...w}},_&&f<=50&&(f++,"object"==typeof _&&(_.placement&&(u=_.placement),_.rects&&(c=!0===_.rects?await r.getElementRects({reference:e,floating:t,strategy:n}):_.rects),({x:d,y:h}=xt(c,u,s))),l=-1)}return{x:d,y:h,placement:u,strategy:n,middlewareData:v}})(e,t,{...n,platform:i})};var bl=a`:host([menuisopen]:not([disabled]):not([readonly])) .dropdown-menu{display:block}.dropdown-menu{background-clip:padding-box;background-color:var(--sgds-surface-default);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 1px 0 hsla(0,0%,5%,.12),0 4px 8px 0 hsla(0,0%,5%,.12);color:var(--sgds-color-default);display:none;list-style:none;margin:0;max-height:var(--sgds-dimension-480);min-width:var(--sgds-dimension-192);overflow-y:auto;padding:var(--sgds-padding-xs) 0;position:absolute;text-align:left;z-index:var(--sgds-z-index-floating)}.nav-tabs .dropdown-menu{border-top-left-radius:0;border-top-right-radius:0;margin-top:calc(var(--sgds-nav-tabs-border-width)*-1)}@media (min-width:512px){.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:768px){.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1024px){.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1280px){.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1440px){.navbar-expand-xxl .navbar-nav .dropdown-menu{position:absolute}}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.sgds.navbar .dropdown-menu.megamenu{left:0;right:0;width:100%}.sgds.combobox>.dropdown-menu{min-width:100%}`,xl=a`.invalid-feedback-container{display:flex;gap:var(--sgds-form-gap-sm)}.invalid-feedback,.invalid-feedback-container{color:var(--sgds-form-danger-color-default);line-height:var(--sgds-line-height-20)}.invalid-feedback{font-size:var(--sgds-font-size-14);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,Zl=a`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs)}.form-text.disabled{opacity:var(--sgds-opacity-40)}`,Cl=a`.form-control-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.m-width-160{min-width:var(--sgds-dimension-160)}.m-width-256{min-width:var(--sgds-dimension-256)}.form-label{color:var(--sgds-form-color-default);font-size:var(--sgds-font-size-label-md);font-weight:var(--sgds-font-weight-semibold)}.form-control-group{align-items:center;background-color:var(--sgds-form-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-default);border-radius:var(--input-border-radius,var(--sgds-form-border-radius-md));display:flex;gap:var(--sgds-form-gap-md);height:var(--sgds-dimension-48);justify-content:center;overflow:hidden;padding:0 var(--sgds-form-padding-x);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:-webkit-fill-available;width:-moz-available}.form-control{appearance:none;background-clip:padding-box;background:none;border:none;color:var(--sgds-form-color-default);display:block;flex-grow:1;font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-label-md);line-height:var(--sgds-line-height-xs);min-width:0;outline:none;padding:0;width:100%}.form-clearable{color:var(--sgds-color-subtle);cursor:pointer}@media (prefers-reduced-motion:reduce){.form-control-group{transition:none}}.form-control-group:not(.disabled):not(.is-invalid):not(.readonly):not(:focus-within):hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-group:not(.disabled):not(.is-invalid):focus-within{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-container.disabled{opacity:var(--sgds-opacity-40)}.form-control-group.disabled{background-color:var(--sgds-form-surface-muted);cursor:not-allowed}.form-control-group.readonly{background-color:var(--sgds-form-surface-raised)}.form-control-group.is-invalid:not(.disabled){border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.form-control-group:not(.disabled).is-invalid:focus-within{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-form-outline-offset-focus)}`;function yl(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}class Ml{constructor(e,t){(this.host=e).addController(this),this._internals=e._internals||this.host.attachInternals(),this.options=Object.assign({setInvalid:(e,t)=>{e.invalid=t},value:e=>e.value,input:e=>e.input},t)}hostConnected(){this.host.addEventListener("invalid",e=>this.handleInvalid(e))}hostDisconnected(){this.host.removeEventListener("invalid",e=>this.handleInvalid(e))}handleInvalid(e){e.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(e){const t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){const t=e.target;this.validateInput(t),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(e,t,l){return this._internals.setValidity(e,t,l)}setFormValue(){const e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const t=e.validity;if(t.valid)this._internals.setValidity({});else for(const l in t)t[l]&&(this.validationError=l.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}}const Vl=e=>{class l extends e{constructor(...e){super(...e),this._isTouched=!1,this._internals=this.attachInternals()}connectedCallback(){var e;super.connectedCallback(),null!==(e=this.inputValidationController)&&void 0!==e||(this.inputValidationController=new Ml(this))}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this._mixinValidate(this.input)}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this._isTouched&&(this._isTouched=!1),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinValidate(e){this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinSetFormValue(){const e=this.value;this._internals.setFormValue(e)}_mixinCheckValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.checkValidity()}_mixinReportValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.reportValidity()}_mixinGetValidity(){return this._internals.validity}_mixinGetValidationMessage(){return this._internals.validationMessage}_mixinSetValidity(e,t,l){if(!this._mixinShouldSkipSgdsValidation())return this.inputValidationController.setValidity(e,t,l)}_mixinShouldSkipSgdsValidation(){const e=this.closest("form");return(null==e?void 0:e.noValidate)||this.noValidate}}return l.formAssociated=!0,t([$e("sgds-input")],l.prototype,"sgdsInput",void 0),t([$e("sgds-datepicker-input")],l.prototype,"sgdsDatepickerInput",void 0),l};var Hl=a`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-font-smoothing:antialiased;color:var(--sgds-body-color-default,#1a1a1a);display:block;font-family:var(--sgds-font-family-brand,"Inter",system-ui,sans-serif);font-size:var(--sgds-font-size-body-md,1rem);font-weight:var(--sgds-font-weight-regular,400);line-height:var(--sgds-line-height-xs,24px);margin:0;*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:1em;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:top;width:1em}::slotted(svg){vertical-align:middle}}`;class Pl extends xe{emit(e,t){const l=new CustomEvent(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(l),l}static define(e,t=this,l={}){if(customElements.get(e));else try{customElements.define(e,t,l)}catch(o){customElements.define(e,class extends t{},l)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach(([e,t])=>{this.constructor.define(e,t)})}firstUpdated(e){var t;super.firstUpdated(e),this.ssr&&(null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("slot").forEach(e=>{e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}}Pl.styles=[Hl],Pl.dependencies={},t([He({type:Boolean,reflect:!0})],Pl.prototype,"ssr",void 0);class Ol extends Pl{constructor(){super(...arguments),this.myDropdown=Fe(),this.dropdownMenuId=yl("dropdown-menu","div"),this.noFlip=!1,this.menuAlignRight=!1,this.drop="down",this.floatingOpts={},this.menuIsOpen=!1,this.close="default",this.disabled=!1,this.readonly=!1,this.menuRef=Fe(),this._handleClickOutOfElement=e=>{this.menuIsOpen&&(e.composedPath().includes(this)||this.hideMenu(!0))}}connectedCallback(){super.connectedCallback(),"inside"!==this.close&&document.addEventListener("click",this._handleClickOutOfElement),this.addEventListener("keydown",this._handleKeyboardMenuEvent)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutOfElement),this.removeEventListener("keydown",this._handleKeyboardMenuEvent),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0)}firstUpdated(e){super.firstUpdated(e),this.menuIsOpen&&requestAnimationFrame(async()=>{await this.updateFloatingPosition(),this._startAutoUpdate()})}async showMenu(){this.disabled||this.menuIsOpen||(this.menuIsOpen=!0,this.emit("sgds-show"),await this.updateFloatingPosition(),this.emit("sgds-after-show"),this._startAutoUpdate())}_startAutoUpdate(){this.myDropdown.value&&this.menuRef.value&&(this._cleanupAutoUpdate=fl(this.myDropdown.value,this.menuRef.value,()=>this.updateFloatingPosition()))}hideMenu(e){this.menuIsOpen&&(this.emit("sgds-hide",{detail:{isOutside:e}}),this.menuIsOpen=!1,setTimeout(()=>this.emit("sgds-after-hide"),0),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0))}toggleMenu(){this.menuIsOpen?this.hideMenu():this.showMenu()}_handleKeyboardMenuEvent(e){if(!this.readonly)switch(e.key){case"ArrowDown":case"ArrowUp":e.preventDefault(),this.menuIsOpen||this.showMenu();break;case"Escape":this.hideMenu()}}mergeMiddleware(e,t){const l=e=>{var t;return(null==e?void 0:e.name)||(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)},o=t.map(l),n=e.map(e=>{const n=l(e),i=o.indexOf(n);return-1!==i?t[i]:e}).concat(t.filter(t=>!e.some(e=>l(e)===l(t))));return n}async updateFloatingPosition(){if(!this.myDropdown.value||!this.menuRef.value)return;let e="bottom-start";switch(this.drop){case"up":e=this.menuAlignRight?"top-end":"top-start";break;case"right":e="right-start";break;case"left":e="left-start";break;case"down":e=this.menuAlignRight?"bottom-end":"bottom-start";break;default:e="bottom-start"}const t=[pl(8),this.noFlip?void 0:ml(),gl()].filter(Boolean);let l=t;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(l=this.mergeMiddleware(t,this.floatingOpts.middleware.filter(Boolean)));const o=Object.assign(Object.assign({strategy:"fixed",placement:e},this.floatingOpts),{middleware:l}),{x:n,y:i,strategy:r,placement:a}=await _l(this.myDropdown.value,this.menuRef.value,o);this.menuRef.value.setAttribute("data-placement",a),Object.assign(this.menuRef.value.style,{position:r,left:`${n}px`,top:`${i}px`})}}t([He({type:Boolean,state:!0})],Ol.prototype,"noFlip",void 0),t([He({type:Boolean,reflect:!0,state:!0})],Ol.prototype,"menuAlignRight",void 0),t([He({type:String,reflect:!0,state:!0})],Ol.prototype,"drop",void 0),t([He({type:Object})],Ol.prototype,"floatingOpts",void 0),t([He({type:Boolean,reflect:!0})],Ol.prototype,"menuIsOpen",void 0),t([He({type:Boolean,reflect:!0})],Ol.prototype,"disabled",void 0),t([He({type:Boolean,reflect:!0})],Ol.prototype,"readonly",void 0);class zl extends Ol{constructor(){super(...arguments),this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1,this.hidden=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("sgds-hide",this._resetMenu)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("sgds-hide",this._resetMenu)}firstUpdated(e){super.firstUpdated(e),this.addEventListener("keydown",this._handleKeyboardMenuItemsEvent)}handleSelectSlot(e){const t=this._getActiveMenuItems(),l=t.find(t=>e.composedPath().includes(t));if(!l)return;const o=t.indexOf(l);this.nextDropdownItemNo=o+1,this.prevDropdownItemNo=o<=0?t.length-1:o-1,l.disabled||(this.emit("sgds-select",{detail:{item:l}}),"outside"!==this.close&&this.hideMenu())}_resetMenu(){this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1;this._getMenuItems().forEach(e=>{var t;const l=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(".dropdown-item");l&&l.removeAttribute("tabindex")})}_handleKeyboardMenuItemsEvent(e){if(this.readonly)return;const t=this._getActiveMenuItems();if(0!==t.length)switch(e.key){case"ArrowDown":e.preventDefault(),this._setMenuItem(this.nextDropdownItemNo);break;case"ArrowUp":e.preventDefault(),this._setMenuItem(this.prevDropdownItemNo);break;case"Tab":if(!this.menuIsOpen)return;e.preventDefault(),e.shiftKey?this._setMenuItem(this.prevDropdownItemNo):this._setMenuItem(this.nextDropdownItemNo);break;case"Enter":t.find(t=>e.composedPath().includes(t))&&this.handleSelectSlot(e);break}}_getMenuItems(){var e,t;if(this.shadowRoot.querySelector("slot#default")){return null===(e=this.shadowRoot.querySelector("slot#default"))||void 0===e?void 0:e.assignedElements({flatten:!0}).filter(e=>!e.classList.contains("empty-menu")&&!e.hasAttribute("hidden"))}if(null===(t=this.menu)||void 0===t?void 0:t.hasChildNodes()){return[...Array.from(this.menu.children)]}return[]}_getActiveMenuItems(){return this._getMenuItems().filter(e=>!e.disabled&&!e.hidden)}_setMenuItem(e){const t=this._getActiveMenuItems();if(0===t.length)return;const l=(e%t.length+t.length)%t.length,o=t[l];this.emit("i-sgds-option-focus",{detail:{option:o}}),this.nextDropdownItemNo=(l+1)%t.length,this.prevDropdownItemNo=(l-1+t.length)%t.length,t.forEach(e=>{const t=e.shadowRoot.querySelector(".dropdown-item");t.setAttribute("tabindex",e===o?"0":"-1"),e===o&&t.focus()})}}var $l,Sl;zl.styles=Ol.styles,t([($l="ul.dropdown-menu",(e,t,l)=>{const o=e=>{const l=e.renderRoot?.querySelector($l)??null;if(null===l&&Sl&&!e.hasUpdated){const e="object"==typeof t?t.name:t;ze("",`@query'd field ${JSON.stringify(String(e))} with the 'cache' flag set for selector '${$l}' has been accessed before the first update and returned null. This is expected if the renderRoot tree has not been provided beforehand (e.g. via Declarative Shadow DOM). Therefore the value hasn't been cached.`)}return l};if(Sl){const{get:n,set:i}="object"==typeof t?e:l??(()=>{const e=Symbol(`${String(t)} (@query() cache)`);return{get(){return this[e]},set(t){this[e]=t}}})();return Oe(e,t,{get(){let e=n.call(this);return void 0===e&&(e=o(this),(null!==e||this.hasUpdated)&&i.call(this,e)),e}})}return Oe(e,t,{get(){return o(this)}})})],zl.prototype,"menu",void 0),t([Pe()],zl.prototype,"nextDropdownItemNo",void 0),t([Pe()],zl.prototype,"prevDropdownItemNo",void 0),t([He({type:Boolean,reflect:!0})],zl.prototype,"hidden",void 0);var Bl=a`.empty-menu,.loading-menu{padding:var(--sgds-padding-sm) var(--sgds-padding-lg,20px);pointer-events:none}.loading-menu{align-items:center;display:flex;gap:var(--sgds-gap-xs)}`;class jl extends(Vl(zl)){setInvalid(e){this.invalid=e,e?this.emit("sgds-invalid"):this.emit("sgds-valid")}constructor(){super(),this.label="",this.hintText="",this.autofocus=!1,this.disabled=!1,this.required=!1,this.loading=!1,this.value="",this.displayValue="",this.defaultValue="",this.hasFeedback=!1,this.invalidFeedback="",this.invalid=!1,this.autocomplete="on",this.menuList=[],this.selectedItems=[],this.filteredList=[],this._isTouched=!1,this._controlId=yl("input"),this._labelId=yl("label"),this.floatingOpts={middleware:[wl({apply({rects:e,elements:t}){t.floating.style.width=`${e.reference.width}px`}})]}}connectedCallback(){super.connectedCallback(),this.addEventListener("blur",async e=>{var t;if(this._mixinShouldSkipSgdsValidation())return;const l=this.constructor.childName,o=(null===(t=e.relatedTarget)||void 0===t?void 0:t.tagName.toLowerCase())===l;this.invalid=!o&&!this._mixinReportValidity()})}reportValidity(){return this._mixinReportValidity()}setValidity(e,t,l){return this._mixinSetValidity(e,t,l)}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_renderFeedback(){return this.invalid&&this.hasFeedback?ee` <div class="invalid-feedback-container">
83
+ */const Fe=()=>new We;class We{}const qe=new WeakMap;const Ke=je(class extends Ue{render(e){return oe}update(e,[t]){const l=t!==this._ref;return l&&void 0!==this._ref&&this._updateRefValue(void 0),(l||this._lastElementForRef!==this._element)&&(this._ref=t,this._context=e.options?.host,this._updateRefValue(this._element=e.element)),oe}_updateRefValue(e){if(this.isConnected||(e=void 0),"function"==typeof this._ref){const t=this._context??globalThis;let l=qe.get(t);void 0===l&&(l=new WeakMap,qe.set(t,l)),void 0!==l.get(this._ref)&&this._ref.call(this._context,void 0),l.set(this._ref,e),void 0!==e&&this._ref.call(this._context,e)}else this._ref.value=e}get _lastElementForRef(){return"function"==typeof this._ref?qe.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),Je=Math.min,Ge=Math.max,Ye=Math.round,Xe=Math.floor,Qe=e=>({x:e,y:e}),et={left:"right",right:"left",bottom:"top",top:"bottom"},tt={start:"end",end:"start"};function lt(e,t,l){return Ge(e,Je(t,l))}function ot(e,t){return"function"==typeof e?e(t):e}function nt(e){return e.split("-")[0]}function it(e){return e.split("-")[1]}function rt(e){return"x"===e?"y":"x"}function at(e){return"y"===e?"height":"width"}const st=new Set(["top","bottom"]);function ct(e){return st.has(nt(e))?"y":"x"}function dt(e){return rt(ct(e))}function ht(e,t,l){void 0===l&&(l=!1);const o=it(e),n=dt(e),i=at(n);let r="x"===n?o===(l?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[i]>t.floating[i]&&(r=wt(r)),[r,wt(r)]}function ut(e){return e.replace(/start|end/g,e=>tt[e])}const vt=["left","right"],ft=["right","left"],pt=["top","bottom"],gt=["bottom","top"];function mt(e,t,l,o){const n=it(e);let i=function(e,t,l){switch(e){case"top":case"bottom":return l?t?ft:vt:t?vt:ft;case"left":case"right":return t?pt:gt;default:return[]}}(nt(e),"start"===l,o);return n&&(i=i.map(e=>e+"-"+n),t&&(i=i.concat(i.map(ut)))),i}function wt(e){return e.replace(/left|right|bottom|top/g,e=>et[e])}function _t(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function bt(e){const{x:t,y:l,width:o,height:n}=e;return{width:o,height:n,top:l,left:t,right:t+o,bottom:l+n,x:t,y:l}}function xt(e,t,l){let{reference:o,floating:n}=e;const i=ct(t),r=dt(t),a=at(r),s=nt(t),c="y"===i,d=o.x+o.width/2-n.width/2,h=o.y+o.height/2-n.height/2,u=o[a]/2-n[a]/2;let v;switch(s){case"top":v={x:d,y:o.y-n.height};break;case"bottom":v={x:d,y:o.y+o.height};break;case"right":v={x:o.x+o.width,y:h};break;case"left":v={x:o.x-n.width,y:h};break;default:v={x:o.x,y:o.y}}switch(it(t)){case"start":v[r]-=u*(l&&c?-1:1);break;case"end":v[r]+=u*(l&&c?-1:1)}return v}async function Zt(e,t){var l;void 0===t&&(t={});const{x:o,y:n,platform:i,rects:r,elements:a,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:u=!1,padding:v=0}=ot(t,e),f=_t(v),p=a[u?"floating"===h?"reference":"floating":h],g=bt(await i.getClippingRect({element:null==(l=await(null==i.isElement?void 0:i.isElement(p)))||l?p:p.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:s})),m="floating"===h?{x:o,y:n,width:r.floating.width,height:r.floating.height}:r.reference,w=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),_=await(null==i.isElement?void 0:i.isElement(w))&&await(null==i.getScale?void 0:i.getScale(w))||{x:1,y:1},b=bt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:w,strategy:s}):m);return{top:(g.top-b.top+f.top)/_.y,bottom:(b.bottom-g.bottom+f.bottom)/_.y,left:(g.left-b.left+f.left)/_.x,right:(b.right-g.right+f.right)/_.x}}const Ct=new Set(["left","top"]);function yt(){return"undefined"!=typeof window}function Mt(e){return Pt(e)?(e.nodeName||"").toLowerCase():"#document"}function Vt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Ht(e){var t;return null==(t=(Pt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Pt(e){return!!yt()&&(e instanceof Node||e instanceof Vt(e).Node)}function Ot(e){return!!yt()&&(e instanceof Element||e instanceof Vt(e).Element)}function zt(e){return!!yt()&&(e instanceof HTMLElement||e instanceof Vt(e).HTMLElement)}function $t(e){return!(!yt()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Vt(e).ShadowRoot)}const St=new Set(["inline","contents"]);function Bt(e){const{overflow:t,overflowX:l,overflowY:o,display:n}=Ft(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+l)&&!St.has(n)}const jt=new Set(["table","td","th"]);function At(e){return jt.has(Mt(e))}const kt=[":popover-open",":modal"];function Lt(e){return kt.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Et=["transform","translate","scale","rotate","perspective"],It=["transform","translate","scale","rotate","perspective","filter"],Tt=["paint","layout","strict","content"];function Rt(e){const t=Dt(),l=Ot(e)?Ft(e):e;return Et.some(e=>!!l[e]&&"none"!==l[e])||!!l.containerType&&"normal"!==l.containerType||!t&&!!l.backdropFilter&&"none"!==l.backdropFilter||!t&&!!l.filter&&"none"!==l.filter||It.some(e=>(l.willChange||"").includes(e))||Tt.some(e=>(l.contain||"").includes(e))}function Dt(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Nt=new Set(["html","body","#document"]);function Ut(e){return Nt.has(Mt(e))}function Ft(e){return Vt(e).getComputedStyle(e)}function Wt(e){return Ot(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qt(e){if("html"===Mt(e))return e;const t=e.assignedSlot||e.parentNode||$t(e)&&e.host||Ht(e);return $t(t)?t.host:t}function Kt(e){const t=qt(e);return Ut(t)?e.ownerDocument?e.ownerDocument.body:e.body:zt(t)&&Bt(t)?t:Kt(t)}function Jt(e,t,l){var o;void 0===t&&(t=[]),void 0===l&&(l=!0);const n=Kt(e),i=n===(null==(o=e.ownerDocument)?void 0:o.body),r=Vt(n);if(i){const e=Gt(r);return t.concat(r,r.visualViewport||[],Bt(n)?n:[],e&&l?Jt(e):[])}return t.concat(n,Jt(n,[],l))}function Gt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Yt(e){const t=Ft(e);let l=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const n=zt(e),i=n?e.offsetWidth:l,r=n?e.offsetHeight:o,a=Ye(l)!==i||Ye(o)!==r;return a&&(l=i,o=r),{width:l,height:o,$:a}}function Xt(e){return Ot(e)?e:e.contextElement}function Qt(e){const t=Xt(e);if(!zt(t))return Qe(1);const l=t.getBoundingClientRect(),{width:o,height:n,$:i}=Yt(t);let r=(i?Ye(l.width):l.width)/o,a=(i?Ye(l.height):l.height)/n;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}const el=Qe(0);function tl(e){const t=Vt(e);return Dt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:el}function ll(e,t,l,o){void 0===t&&(t=!1),void 0===l&&(l=!1);const n=e.getBoundingClientRect(),i=Xt(e);let r=Qe(1);t&&(o?Ot(o)&&(r=Qt(o)):r=Qt(e));const a=function(e,t,l){return void 0===t&&(t=!1),!(!l||t&&l!==Vt(e))&&t}(i,l,o)?tl(i):Qe(0);let s=(n.left+a.x)/r.x,c=(n.top+a.y)/r.y,d=n.width/r.x,h=n.height/r.y;if(i){const e=Vt(i),t=o&&Ot(o)?Vt(o):o;let l=e,n=Gt(l);for(;n&&o&&t!==l;){const e=Qt(n),t=n.getBoundingClientRect(),o=Ft(n),i=t.left+(n.clientLeft+parseFloat(o.paddingLeft))*e.x,r=t.top+(n.clientTop+parseFloat(o.paddingTop))*e.y;s*=e.x,c*=e.y,d*=e.x,h*=e.y,s+=i,c+=r,l=Vt(n),n=Gt(l)}}return bt({width:d,height:h,x:s,y:c})}function ol(e,t){const l=Wt(e).scrollLeft;return t?t.left+l:ll(Ht(e)).left+l}function nl(e,t){const l=e.getBoundingClientRect();return{x:l.left+t.scrollLeft-ol(e,l),y:l.top+t.scrollTop}}const il=new Set(["absolute","fixed"]);function rl(e,t,l){let o;if("viewport"===t)o=function(e,t){const l=Vt(e),o=Ht(e),n=l.visualViewport;let i=o.clientWidth,r=o.clientHeight,a=0,s=0;if(n){i=n.width,r=n.height;const e=Dt();(!e||e&&"fixed"===t)&&(a=n.offsetLeft,s=n.offsetTop)}const c=ol(o);if(c<=0){const e=o.ownerDocument,t=e.body,l=getComputedStyle(t),n="CSS1Compat"===e.compatMode&&parseFloat(l.marginLeft)+parseFloat(l.marginRight)||0,r=Math.abs(o.clientWidth-t.clientWidth-n);r<=25&&(i-=r)}else c<=25&&(i+=c);return{width:i,height:r,x:a,y:s}}(e,l);else if("document"===t)o=function(e){const t=Ht(e),l=Wt(e),o=e.ownerDocument.body,n=Ge(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=Ge(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-l.scrollLeft+ol(e);const a=-l.scrollTop;return"rtl"===Ft(o).direction&&(r+=Ge(t.clientWidth,o.clientWidth)-n),{width:n,height:i,x:r,y:a}}(Ht(e));else if(Ot(t))o=function(e,t){const l=ll(e,!0,"fixed"===t),o=l.top+e.clientTop,n=l.left+e.clientLeft,i=zt(e)?Qt(e):Qe(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:n*i.x,y:o*i.y}}(t,l);else{const l=tl(e);o={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return bt(o)}function al(e,t){const l=qt(e);return!(l===t||!Ot(l)||Ut(l))&&("fixed"===Ft(l).position||al(l,t))}function sl(e,t,l){const o=zt(t),n=Ht(t),i="fixed"===l,r=ll(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const s=Qe(0);function c(){s.x=ol(n)}if(o||!o&&!i)if(("body"!==Mt(t)||Bt(n))&&(a=Wt(t)),o){const e=ll(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else n&&c();i&&!o&&n&&c();const d=!n||o||i?Qe(0):nl(n,a);return{x:r.left+a.scrollLeft-s.x-d.x,y:r.top+a.scrollTop-s.y-d.y,width:r.width,height:r.height}}function cl(e){return"static"===Ft(e).position}function dl(e,t){if(!zt(e)||"fixed"===Ft(e).position)return null;if(t)return t(e);let l=e.offsetParent;return Ht(e)===l&&(l=l.ownerDocument.body),l}function hl(e,t){const l=Vt(e);if(Lt(e))return l;if(!zt(e)){let t=qt(e);for(;t&&!Ut(t);){if(Ot(t)&&!cl(t))return t;t=qt(t)}return l}let o=dl(e,t);for(;o&&At(o)&&cl(o);)o=dl(o,t);return o&&Ut(o)&&cl(o)&&!Rt(o)?l:o||function(e){let t=qt(e);for(;zt(t)&&!Ut(t);){if(Rt(t))return t;if(Lt(t))return null;t=qt(t)}return null}(e)||l}const ul={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:l,offsetParent:o,strategy:n}=e;const i="fixed"===n,r=Ht(o),a=!!t&&Lt(t.floating);if(o===r||a&&i)return l;let s={scrollLeft:0,scrollTop:0},c=Qe(1);const d=Qe(0),h=zt(o);if((h||!h&&!i)&&(("body"!==Mt(o)||Bt(r))&&(s=Wt(o)),zt(o))){const e=ll(o);c=Qt(o),d.x=e.x+o.clientLeft,d.y=e.y+o.clientTop}const u=!r||h||i?Qe(0):nl(r,s);return{width:l.width*c.x,height:l.height*c.y,x:l.x*c.x-s.scrollLeft*c.x+d.x+u.x,y:l.y*c.y-s.scrollTop*c.y+d.y+u.y}},getDocumentElement:Ht,getClippingRect:function(e){let{element:t,boundary:l,rootBoundary:o,strategy:n}=e;const i=[..."clippingAncestors"===l?Lt(t)?[]:function(e,t){const l=t.get(e);if(l)return l;let o=Jt(e,[],!1).filter(e=>Ot(e)&&"body"!==Mt(e)),n=null;const i="fixed"===Ft(e).position;let r=i?qt(e):e;for(;Ot(r)&&!Ut(r);){const t=Ft(r),l=Rt(r);l||"fixed"!==t.position||(n=null),(i?!l&&!n:!l&&"static"===t.position&&n&&il.has(n.position)||Bt(r)&&!l&&al(e,r))?o=o.filter(e=>e!==r):n=t,r=qt(r)}return t.set(e,o),o}(t,this._c):[].concat(l),o],r=i[0],a=i.reduce((e,l)=>{const o=rl(t,l,n);return e.top=Ge(o.top,e.top),e.right=Je(o.right,e.right),e.bottom=Je(o.bottom,e.bottom),e.left=Ge(o.left,e.left),e},rl(t,r,n));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:hl,getElementRects:async function(e){const t=this.getOffsetParent||hl,l=this.getDimensions,o=await l(e.floating);return{reference:sl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:l}=Yt(e);return{width:t,height:l}},getScale:Qt,isElement:Ot,isRTL:function(e){return"rtl"===Ft(e).direction}};function vl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fl(e,t,l,o){void 0===o&&(o={});const{ancestorScroll:n=!0,ancestorResize:i=!0,elementResize:r="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:s=!1}=o,c=Xt(e),d=n||i?[...c?Jt(c):[],...Jt(t)]:[];d.forEach(e=>{n&&e.addEventListener("scroll",l,{passive:!0}),i&&e.addEventListener("resize",l)});const h=c&&a?function(e,t){let l,o=null;const n=Ht(e);function i(){var e;clearTimeout(l),null==(e=o)||e.disconnect(),o=null}return function r(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),i();const c=e.getBoundingClientRect(),{left:d,top:h,width:u,height:v}=c;if(a||t(),!u||!v)return;const f={rootMargin:-Xe(h)+"px "+-Xe(n.clientWidth-(d+u))+"px "+-Xe(n.clientHeight-(h+v))+"px "+-Xe(d)+"px",threshold:Ge(0,Je(1,s))||1};let p=!0;function g(t){const o=t[0].intersectionRatio;if(o!==s){if(!p)return r();o?r(!1,o):l=setTimeout(()=>{r(!1,1e-7)},1e3)}1!==o||vl(c,e.getBoundingClientRect())||r(),p=!1}try{o=new IntersectionObserver(g,{...f,root:n.ownerDocument})}catch(e){o=new IntersectionObserver(g,f)}o.observe(e)}(!0),i}(c,l):null;let u,v=-1,f=null;r&&(f=new ResizeObserver(e=>{let[o]=e;o&&o.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),l()}),c&&!s&&f.observe(c),f.observe(t));let p=s?ll(e):null;return s&&function t(){const o=ll(e);p&&!vl(p,o)&&l();p=o,u=requestAnimationFrame(t)}(),l(),()=>{var e;d.forEach(e=>{n&&e.removeEventListener("scroll",l),i&&e.removeEventListener("resize",l)}),null==h||h(),null==(e=f)||e.disconnect(),f=null,s&&cancelAnimationFrame(u)}}const pl=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var l,o;const{x:n,y:i,placement:r,middlewareData:a}=t,s=await async function(e,t){const{placement:l,platform:o,elements:n}=e,i=await(null==o.isRTL?void 0:o.isRTL(n.floating)),r=nt(l),a=it(l),s="y"===ct(l),c=Ct.has(r)?-1:1,d=i&&s?-1:1,h=ot(t,e);let{mainAxis:u,crossAxis:v,alignmentAxis:f}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&"number"==typeof f&&(v="end"===a?-1*f:f),s?{x:v*d,y:u*c}:{x:u*c,y:v*d}}(t,e);return r===(null==(l=a.offset)?void 0:l.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{x:n+s.x,y:i+s.y,data:{...s,placement:r}}}}},gl=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:l,y:o,placement:n}=t,{mainAxis:i=!0,crossAxis:r=!1,limiter:a={fn:e=>{let{x:t,y:l}=e;return{x:t,y:l}}},...s}=ot(e,t),c={x:l,y:o},d=await Zt(t,s),h=ct(nt(n)),u=rt(h);let v=c[u],f=c[h];if(i){const e="y"===u?"bottom":"right";v=lt(v+d["y"===u?"top":"left"],v,v-d[e])}if(r){const e="y"===h?"bottom":"right";f=lt(f+d["y"===h?"top":"left"],f,f-d[e])}const p=a.fn({...t,[u]:v,[h]:f});return{...p,data:{x:p.x-l,y:p.y-o,enabled:{[u]:i,[h]:r}}}}}},ml=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var l,o;const{placement:n,middlewareData:i,rects:r,initialPlacement:a,platform:s,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:p=!0,...g}=ot(e,t);if(null!=(l=i.arrow)&&l.alignmentOffset)return{};const m=nt(n),w=ct(a),_=nt(a)===a,b=await(null==s.isRTL?void 0:s.isRTL(c.floating)),x=u||(_||!p?[wt(a)]:function(e){const t=wt(e);return[ut(e),t,ut(t)]}(a)),Z="none"!==f;!u&&Z&&x.push(...mt(a,p,f,b));const C=[a,...x],y=await Zt(t,g),M=[];let V=(null==(o=i.flip)?void 0:o.overflows)||[];if(d&&M.push(y[m]),h){const e=ht(n,r,b);M.push(y[e[0]],y[e[1]])}if(V=[...V,{placement:n,overflows:M}],!M.every(e=>e<=0)){var H,P;const e=((null==(H=i.flip)?void 0:H.index)||0)+1,t=C[e];if(t){if(!("alignment"===h&&w!==ct(t))||V.every(e=>ct(e.placement)!==w||e.overflows[0]>0))return{data:{index:e,overflows:V},reset:{placement:t}}}let l=null==(P=V.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:P.placement;if(!l)switch(v){case"bestFit":{var O;const e=null==(O=V.filter(e=>{if(Z){const t=ct(e.placement);return t===w||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:O[0];e&&(l=e);break}case"initialPlacement":l=a}if(n!==l)return{reset:{placement:l}}}return{}}}},wl=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var l,o;const{placement:n,rects:i,platform:r,elements:a}=t,{apply:s=()=>{},...c}=ot(e,t),d=await Zt(t,c),h=nt(n),u=it(n),v="y"===ct(n),{width:f,height:p}=i.floating;let g,m;"top"===h||"bottom"===h?(g=h,m=u===(await(null==r.isRTL?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(m=h,g="end"===u?"top":"bottom");const w=p-d.top-d.bottom,_=f-d.left-d.right,b=Je(p-d[g],w),x=Je(f-d[m],_),Z=!t.middlewareData.shift;let C=b,y=x;if(null!=(l=t.middlewareData.shift)&&l.enabled.x&&(y=_),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(C=w),Z&&!u){const e=Ge(d.left,0),t=Ge(d.right,0),l=Ge(d.top,0),o=Ge(d.bottom,0);v?y=f-2*(0!==e||0!==t?e+t:Ge(d.left,d.right)):C=p-2*(0!==l||0!==o?l+o:Ge(d.top,d.bottom))}await s({...t,availableWidth:y,availableHeight:C});const M=await r.getDimensions(a.floating);return f!==M.width||p!==M.height?{reset:{rects:!0}}:{}}}},_l=(e,t,l)=>{const o=new Map,n={platform:ul,...l},i={...n.platform,_c:o};return(async(e,t,l)=>{const{placement:o="bottom",strategy:n="absolute",middleware:i=[],platform:r}=l,a=i.filter(Boolean),s=await(null==r.isRTL?void 0:r.isRTL(t));let c=await r.getElementRects({reference:e,floating:t,strategy:n}),{x:d,y:h}=xt(c,o,s),u=o,v={},f=0;for(let l=0;l<a.length;l++){const{name:i,fn:p}=a[l],{x:g,y:m,data:w,reset:_}=await p({x:d,y:h,initialPlacement:o,placement:u,strategy:n,middlewareData:v,rects:c,platform:r,elements:{reference:e,floating:t}});d=null!=g?g:d,h=null!=m?m:h,v={...v,[i]:{...v[i],...w}},_&&f<=50&&(f++,"object"==typeof _&&(_.placement&&(u=_.placement),_.rects&&(c=!0===_.rects?await r.getElementRects({reference:e,floating:t,strategy:n}):_.rects),({x:d,y:h}=xt(c,u,s))),l=-1)}return{x:d,y:h,placement:u,strategy:n,middlewareData:v}})(e,t,{...n,platform:i})};var bl=a`:host([menuisopen]:not([disabled]):not([readonly])) .dropdown-menu{display:block}.dropdown-menu{background-clip:padding-box;background-color:var(--sgds-surface-default);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 1px 0 hsla(0,0%,5%,.12),0 4px 8px 0 hsla(0,0%,5%,.12);color:var(--sgds-color-default);display:none;list-style:none;margin:0;max-height:var(--sgds-dimension-480);min-width:var(--sgds-dimension-192);overflow-y:auto;padding:var(--sgds-padding-xs) 0;position:absolute;text-align:left;z-index:var(--sgds-z-index-floating)}.nav-tabs .dropdown-menu{border-top-left-radius:0;border-top-right-radius:0;margin-top:calc(var(--sgds-nav-tabs-border-width)*-1)}@media (min-width:512px){.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:768px){.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1024px){.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1280px){.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1440px){.navbar-expand-xxl .navbar-nav .dropdown-menu{position:absolute}}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.sgds.navbar .dropdown-menu.megamenu{left:0;right:0;width:100%}.sgds.combobox>.dropdown-menu{min-width:100%}`,xl=a`.invalid-feedback-container{display:flex;gap:var(--sgds-form-gap-sm)}.invalid-feedback,.invalid-feedback-container{color:var(--sgds-form-danger-color-default);line-height:var(--sgds-line-height-20)}.invalid-feedback{font-size:var(--sgds-font-size-14);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,Zl=a`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs)}.form-text.disabled{opacity:var(--sgds-opacity-40)}`,Cl=a`.form-control-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.m-width-160{min-width:var(--sgds-dimension-160)}.m-width-256{min-width:var(--sgds-dimension-256)}.form-label{color:var(--sgds-form-color-default);font-size:var(--sgds-font-size-label-md);font-weight:var(--sgds-font-weight-semibold)}.form-control-group{align-items:center;background-color:var(--sgds-form-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-default);border-radius:var(--input-border-radius,var(--sgds-form-border-radius-md));display:flex;gap:var(--sgds-form-gap-xl);height:var(--sgds-dimension-48);justify-content:center;overflow:hidden;padding:0 var(--sgds-form-padding-x);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:-webkit-fill-available;width:-moz-available}.form-control{appearance:none;background-clip:padding-box;background:none;border:none;color:var(--sgds-form-color-default);display:block;flex-grow:1;font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-label-md);line-height:var(--sgds-line-height-xs);min-width:0;outline:none;padding:0;width:100%}.form-clearable{color:var(--sgds-color-subtle);cursor:pointer}@media (prefers-reduced-motion:reduce){.form-control-group{transition:none}}.form-control-group:not(.disabled):not(.is-invalid):not(.readonly):not(:focus-within):hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-group:not(.disabled):not(.is-invalid):focus-within{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-container.disabled{opacity:var(--sgds-opacity-40)}.form-control-group.disabled{background-color:var(--sgds-form-surface-muted);cursor:not-allowed}.form-control-group.readonly{background-color:var(--sgds-form-surface-raised)}.form-control-group.is-invalid:not(.disabled){border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.form-control-group:not(.disabled).is-invalid:focus-within{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-form-outline-offset-focus)}`;function yl(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}class Ml{constructor(e,t){(this.host=e).addController(this),this._internals=e._internals||this.host.attachInternals(),this.options=Object.assign({setInvalid:(e,t)=>{e.invalid=t},value:e=>e.value,input:e=>e.input},t)}hostConnected(){this.host.addEventListener("invalid",e=>this.handleInvalid(e))}hostDisconnected(){this.host.removeEventListener("invalid",e=>this.handleInvalid(e))}handleInvalid(e){e.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(e){const t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){const t=e.target;this.validateInput(t),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(e,t,l){return this._internals.setValidity(e,t,l)}setFormValue(){const e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const t=e.validity;if(t.valid)this._internals.setValidity({});else for(const l in t)t[l]&&(this.validationError=l.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}}const Vl=e=>{class l extends e{constructor(...e){super(...e),this._isTouched=!1,this._internals=this.attachInternals()}connectedCallback(){var e;super.connectedCallback(),null!==(e=this.inputValidationController)&&void 0!==e||(this.inputValidationController=new Ml(this))}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this._mixinValidate(this.input)}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this._isTouched&&(this._isTouched=!1),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinValidate(e){this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinSetFormValue(){const e=this.value;this._internals.setFormValue(e)}_mixinCheckValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.checkValidity()}_mixinReportValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.reportValidity()}_mixinGetValidity(){return this._internals.validity}_mixinGetValidationMessage(){return this._internals.validationMessage}_mixinSetValidity(e,t,l){if(!this._mixinShouldSkipSgdsValidation())return this.inputValidationController.setValidity(e,t,l)}_mixinShouldSkipSgdsValidation(){const e=this.closest("form");return(null==e?void 0:e.noValidate)||this.noValidate}}return l.formAssociated=!0,t([$e("sgds-input")],l.prototype,"sgdsInput",void 0),t([$e("sgds-datepicker-input")],l.prototype,"sgdsDatepickerInput",void 0),l};var Hl=a`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-font-smoothing:antialiased;color:var(--sgds-body-color-default,#1a1a1a);display:block;font-family:var(--sgds-font-family-brand,"Inter",system-ui,sans-serif);font-size:var(--sgds-font-size-body-md,1rem);font-weight:var(--sgds-font-weight-regular,400);line-height:var(--sgds-line-height-xs,24px);margin:0;*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:1em;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:top;width:1em}::slotted(svg){vertical-align:middle}}`;class Pl extends xe{emit(e,t){const l=new CustomEvent(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(l),l}static define(e,t=this,l={}){if(customElements.get(e));else try{customElements.define(e,t,l)}catch(o){customElements.define(e,class extends t{},l)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach(([e,t])=>{this.constructor.define(e,t)})}firstUpdated(e){var t;super.firstUpdated(e),this.ssr&&(null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("slot").forEach(e=>{e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}}Pl.styles=[Hl],Pl.dependencies={},t([He({type:Boolean,reflect:!0})],Pl.prototype,"ssr",void 0);class Ol extends Pl{constructor(){super(...arguments),this.myDropdown=Fe(),this.dropdownMenuId=yl("dropdown-menu","div"),this.noFlip=!1,this.menuAlignRight=!1,this.drop="down",this.floatingOpts={},this.menuIsOpen=!1,this.close="default",this.disabled=!1,this.readonly=!1,this.menuRef=Fe(),this._handleClickOutOfElement=e=>{this.menuIsOpen&&(e.composedPath().includes(this)||this.hideMenu(!0))}}connectedCallback(){super.connectedCallback(),"inside"!==this.close&&document.addEventListener("click",this._handleClickOutOfElement),this.addEventListener("keydown",this._handleKeyboardMenuEvent)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutOfElement),this.removeEventListener("keydown",this._handleKeyboardMenuEvent),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0)}firstUpdated(e){super.firstUpdated(e),this.menuIsOpen&&requestAnimationFrame(async()=>{await this.updateFloatingPosition(),this._startAutoUpdate()})}async showMenu(){this.disabled||this.menuIsOpen||(this.menuIsOpen=!0,this.emit("sgds-show"),await this.updateFloatingPosition(),this.emit("sgds-after-show"),this._startAutoUpdate())}_startAutoUpdate(){this.myDropdown.value&&this.menuRef.value&&(this._cleanupAutoUpdate=fl(this.myDropdown.value,this.menuRef.value,()=>this.updateFloatingPosition()))}hideMenu(e){this.menuIsOpen&&(this.emit("sgds-hide",{detail:{isOutside:e}}),this.menuIsOpen=!1,setTimeout(()=>this.emit("sgds-after-hide"),0),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0))}toggleMenu(){this.menuIsOpen?this.hideMenu():this.showMenu()}_handleKeyboardMenuEvent(e){if(!this.readonly)switch(e.key){case"ArrowDown":case"ArrowUp":e.preventDefault(),this.menuIsOpen||this.showMenu();break;case"Escape":this.hideMenu()}}mergeMiddleware(e,t){const l=e=>{var t;return(null==e?void 0:e.name)||(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)},o=t.map(l),n=e.map(e=>{const n=l(e),i=o.indexOf(n);return-1!==i?t[i]:e}).concat(t.filter(t=>!e.some(e=>l(e)===l(t))));return n}async updateFloatingPosition(){if(!this.myDropdown.value||!this.menuRef.value)return;let e="bottom-start";switch(this.drop){case"up":e=this.menuAlignRight?"top-end":"top-start";break;case"right":e="right-start";break;case"left":e="left-start";break;case"down":e=this.menuAlignRight?"bottom-end":"bottom-start";break;default:e="bottom-start"}const t=[pl(8),this.noFlip?void 0:ml(),gl()].filter(Boolean);let l=t;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(l=this.mergeMiddleware(t,this.floatingOpts.middleware.filter(Boolean)));const o=Object.assign(Object.assign({strategy:"fixed",placement:e},this.floatingOpts),{middleware:l}),{x:n,y:i,strategy:r,placement:a}=await _l(this.myDropdown.value,this.menuRef.value,o);this.menuRef.value.setAttribute("data-placement",a),Object.assign(this.menuRef.value.style,{position:r,left:`${n}px`,top:`${i}px`})}}t([He({type:Boolean,state:!0})],Ol.prototype,"noFlip",void 0),t([He({type:Boolean,reflect:!0,state:!0})],Ol.prototype,"menuAlignRight",void 0),t([He({type:String,reflect:!0,state:!0})],Ol.prototype,"drop",void 0),t([He({type:Object})],Ol.prototype,"floatingOpts",void 0),t([He({type:Boolean,reflect:!0})],Ol.prototype,"menuIsOpen",void 0),t([He({type:Boolean,reflect:!0})],Ol.prototype,"disabled",void 0),t([He({type:Boolean,reflect:!0})],Ol.prototype,"readonly",void 0);class zl extends Ol{constructor(){super(...arguments),this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1,this.hidden=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("sgds-hide",this._resetMenu)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("sgds-hide",this._resetMenu)}firstUpdated(e){super.firstUpdated(e),this.addEventListener("keydown",this._handleKeyboardMenuItemsEvent)}handleSelectSlot(e){const t=this._getActiveMenuItems(),l=t.find(t=>e.composedPath().includes(t));if(!l)return;const o=t.indexOf(l);this.nextDropdownItemNo=o+1,this.prevDropdownItemNo=o<=0?t.length-1:o-1,l.disabled||(this.emit("sgds-select",{detail:{item:l}}),"outside"!==this.close&&this.hideMenu())}_resetMenu(){this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1;this._getMenuItems().forEach(e=>{var t;const l=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(".dropdown-item");l&&l.removeAttribute("tabindex")})}_handleKeyboardMenuItemsEvent(e){if(this.readonly)return;const t=this._getActiveMenuItems();if(0!==t.length)switch(e.key){case"ArrowDown":e.preventDefault(),this._setMenuItem(this.nextDropdownItemNo);break;case"ArrowUp":e.preventDefault(),this._setMenuItem(this.prevDropdownItemNo);break;case"Tab":if(!this.menuIsOpen)return;e.preventDefault(),e.shiftKey?this._setMenuItem(this.prevDropdownItemNo):this._setMenuItem(this.nextDropdownItemNo);break;case"Enter":t.find(t=>e.composedPath().includes(t))&&this.handleSelectSlot(e);break}}_getMenuItems(){var e,t;if(this.shadowRoot.querySelector("slot#default")){return null===(e=this.shadowRoot.querySelector("slot#default"))||void 0===e?void 0:e.assignedElements({flatten:!0}).filter(e=>!e.classList.contains("empty-menu")&&!e.hasAttribute("hidden"))}if(null===(t=this.menu)||void 0===t?void 0:t.hasChildNodes()){return[...Array.from(this.menu.children)]}return[]}_getActiveMenuItems(){return this._getMenuItems().filter(e=>!e.disabled&&!e.hidden)}_setMenuItem(e){const t=this._getActiveMenuItems();if(0===t.length)return;const l=(e%t.length+t.length)%t.length,o=t[l];this.emit("i-sgds-option-focus",{detail:{option:o}}),this.nextDropdownItemNo=(l+1)%t.length,this.prevDropdownItemNo=(l-1+t.length)%t.length,t.forEach(e=>{const t=e.shadowRoot.querySelector(".dropdown-item");t.setAttribute("tabindex",e===o?"0":"-1"),e===o&&t.focus()})}}var $l,Sl;zl.styles=Ol.styles,t([($l="ul.dropdown-menu",(e,t,l)=>{const o=e=>{const l=e.renderRoot?.querySelector($l)??null;if(null===l&&Sl&&!e.hasUpdated){const e="object"==typeof t?t.name:t;ze("",`@query'd field ${JSON.stringify(String(e))} with the 'cache' flag set for selector '${$l}' has been accessed before the first update and returned null. This is expected if the renderRoot tree has not been provided beforehand (e.g. via Declarative Shadow DOM). Therefore the value hasn't been cached.`)}return l};if(Sl){const{get:n,set:i}="object"==typeof t?e:l??(()=>{const e=Symbol(`${String(t)} (@query() cache)`);return{get(){return this[e]},set(t){this[e]=t}}})();return Oe(e,t,{get(){let e=n.call(this);return void 0===e&&(e=o(this),(null!==e||this.hasUpdated)&&i.call(this,e)),e}})}return Oe(e,t,{get(){return o(this)}})})],zl.prototype,"menu",void 0),t([Pe()],zl.prototype,"nextDropdownItemNo",void 0),t([Pe()],zl.prototype,"prevDropdownItemNo",void 0),t([He({type:Boolean,reflect:!0})],zl.prototype,"hidden",void 0);var Bl=a`.empty-menu,.loading-menu{padding:var(--sgds-padding-sm) var(--sgds-padding-lg,20px);pointer-events:none}.loading-menu{align-items:center;display:flex;gap:var(--sgds-gap-xs)}`;class jl extends(Vl(zl)){setInvalid(e){this.invalid=e,e?this.emit("sgds-invalid"):this.emit("sgds-valid")}constructor(){super(),this.label="",this.hintText="",this.autofocus=!1,this.disabled=!1,this.required=!1,this.loading=!1,this.value="",this.displayValue="",this.defaultValue="",this.hasFeedback=!1,this.invalidFeedback="",this.invalid=!1,this.autocomplete="on",this.menuList=[],this.selectedItems=[],this.filteredList=[],this._isTouched=!1,this._controlId=yl("input"),this._labelId=yl("label"),this.floatingOpts={middleware:[wl({apply({rects:e,elements:t}){t.floating.style.width=`${e.reference.width}px`}})]}}connectedCallback(){super.connectedCallback(),this.addEventListener("blur",async e=>{var t;if(this._mixinShouldSkipSgdsValidation())return;const l=this.constructor.childName,o=(null===(t=e.relatedTarget)||void 0===t?void 0:t.tagName.toLowerCase())===l;this.invalid=!o&&!this._mixinReportValidity()})}reportValidity(){return this._mixinReportValidity()}setValidity(e,t,l){return this._mixinSetValidity(e,t,l)}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_renderFeedback(){return this.invalid&&this.hasFeedback?ee` <div class="invalid-feedback-container">
84
84
  <slot name="invalidIcon">
85
85
  <sgds-icon name="exclamation-circle-fill" size="md"></sgds-icon>
86
86
  </slot>
@@ -68,7 +68,7 @@ const Dt=1;class It{constructor(t){}get _$isConnected(){return this._$parent._$i
68
68
  * @license
69
69
  * Copyright 2018 Google LLC
70
70
  * SPDX-License-Identifier: BSD-3-Clause
71
- */const Wt=(jt=class extends It{constructor(t){if(super(t),t.type!==Dt||"class"!==t.name||t.strings?.length>2)throw new Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){if(void 0===this._previousClasses){this._previousClasses=new Set,void 0!==t.strings&&(this._staticClasses=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in e)e[t]&&!this._staticClasses?.has(t)&&this._previousClasses.add(t);return this.render(e)}const s=t.element.classList;for(const t of this._previousClasses)t in e||(s.remove(t),this._previousClasses.delete(t));for(const t in e){const i=!!e[t];i===this._previousClasses.has(t)||this._staticClasses?.has(t)||(i?(s.add(t),this._previousClasses.add(t)):(s.remove(t),this._previousClasses.delete(t)))}return et}},(...t)=>({_$litDirective$:jt,values:t}));var jt,qt=o`.tab-panel{display:block}.tab-panel:not(.tab-panel--active){display:none}`;let Ht=0;class Bt extends Nt{constructor(){super(...arguments),this.attrId=++Ht,this.componentId=`sgds-tab-panel-${this.attrId}`,this.name="",this.active=!1}connectedCallback(){super.connectedCallback(),this.id=this.id.length>0?this.id:this.componentId,this.setAttribute("role","tabpanel")}_handleActiveChange(){this.setAttribute("aria-hidden",this.active?"false":"true"),this.inert=!this.active}render(){return Q`
71
+ */const Wt=(jt=class extends It{constructor(t){if(super(t),t.type!==Dt||"class"!==t.name||t.strings?.length>2)throw new Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){if(void 0===this._previousClasses){this._previousClasses=new Set,void 0!==t.strings&&(this._staticClasses=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in e)e[t]&&!this._staticClasses?.has(t)&&this._previousClasses.add(t);return this.render(e)}const s=t.element.classList;for(const t of this._previousClasses)t in e||(s.remove(t),this._previousClasses.delete(t));for(const t in e){const i=!!e[t];i===this._previousClasses.has(t)||this._staticClasses?.has(t)||(i?(s.add(t),this._previousClasses.add(t)):(s.remove(t),this._previousClasses.delete(t)))}return et}},(...t)=>({_$litDirective$:jt,values:t}));var jt,qt=o`:host(:not([active])){display:none}.tab-panel{display:block}.tab-panel:not(.tab-panel--active){display:none}`;let Ht=0;class Bt extends Nt{constructor(){super(...arguments),this.attrId=++Ht,this.componentId=`sgds-tab-panel-${this.attrId}`,this.name="",this.active=!1}connectedCallback(){super.connectedCallback(),this.id=this.id.length>0?this.id:this.componentId,this.setAttribute("role","tabpanel")}_handleActiveChange(){this.setAttribute("aria-hidden",this.active?"false":"true"),this.inert=!this.active}render(){return Q`
72
72
  <slot
73
73
  class=${Wt({"tab-panel":!0,"tab-panel--active":this.active})}
74
74
  ></slot>