@simai-studio/ui 5.20261021.2249 → 5.20261022.1303

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 (33) hide show
  1. package/README.md +4 -4
  2. package/distr/component/dropdown/js/dropdown.min.js +1 -1
  3. package/distr/core/contracts/packages/larena.package.json +1 -0
  4. package/distr/core/js/core-loader.js +133 -7
  5. package/distr/core/js/core-loader.min.js +1 -1
  6. package/distr/core/js/smart-base.js +134 -12
  7. package/distr/core/js/smart-base.min.js +1 -1
  8. package/distr/smart/buttons/js/buttons.min.js +1 -1
  9. package/distr/smart/buttons/smart.manifest.json +1 -1
  10. package/distr/smart/country-code/js/country-code.min.js +9 -7
  11. package/distr/smart/country-code/smart.manifest.json +6 -1
  12. package/distr/smart/country-code/template/default.js +12 -4
  13. package/distr/smart/datepicker/js/datepicker.min.js +12 -9
  14. package/distr/smart/datepicker/smart.manifest.json +13 -3
  15. package/distr/smart/datepicker/template/default.js +4 -1
  16. package/distr/smart/dropdown/js/dropdown.min.js +10 -10
  17. package/distr/smart/dropdown/smart.manifest.json +1 -1
  18. package/distr/smart/dropdown/template/default.js +10 -3
  19. package/distr/smart/field-renderers/js/field-renderers.min.js +17 -17
  20. package/distr/smart/icon-buttons/js/icon-buttons.min.js +1 -1
  21. package/distr/smart/icon-buttons/smart.manifest.json +1 -1
  22. package/distr/smart/icons/js/icons.min.js +1 -1
  23. package/distr/smart/icons/smart.manifest.json +1 -1
  24. package/distr/smart/inputs/js/inputs.min.js +33 -31
  25. package/distr/smart/inputs/smart.manifest.json +6 -1
  26. package/distr/smart/inputs/template/default.js +8 -0
  27. package/distr/smart/popover/js/popover.min.js +1 -1
  28. package/distr/smart/popover/smart.manifest.json +1 -1
  29. package/distr/smart/switch/js/switch.min.js +12 -11
  30. package/distr/smart/switch/smart.manifest.json +6 -1
  31. package/distr/smart/switch/template/default.js +2 -1
  32. package/package-manifest.json +33 -33
  33. package/package.json +4 -4
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # @simai-studio/ui
2
2
 
3
- SIMAI Framework, release `ui-68a2e7c1167f` (commit 68a2e7c1167f93042b7bd47bbcef7b399fe781be of [simai/ui](https://github.com/simai/ui)).
3
+ SIMAI Framework, release `ui-3d6921cd2516` (commit 3d6921cd25169dc9b29fd277466bd0dccbef1691 of [simai/ui](https://github.com/simai/ui)).
4
4
 
5
5
  ```html
6
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@simai-studio/ui@5.20261021.2249/distr/core/css/core.css">
7
- <script>window.sfPath = 'https://cdn.jsdelivr.net/npm/@simai-studio/ui@5.20261021.2249/distr/';</script>
8
- <script src="https://cdn.jsdelivr.net/npm/@simai-studio/ui@5.20261021.2249/distr/core/js/core.js"></script>
6
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@simai-studio/ui@5.20261022.1303/distr/core/css/core.css">
7
+ <script>window.sfPath = 'https://cdn.jsdelivr.net/npm/@simai-studio/ui@5.20261022.1303/distr/';</script>
8
+ <script src="https://cdn.jsdelivr.net/npm/@simai-studio/ui@5.20261022.1303/distr/core/js/core.js"></script>
9
9
  ```
10
10
 
11
11
  Components, utilities and Smart Components ship in their minified form (the Loader asks for it); Core in both forms. Documentation: https://ui.simai.io/
@@ -1 +1 @@
1
- (()=>{"use strict";let e=0;function t(e,t){const n=e.querySelector('.sf-checkbox input[type="checkbox"]');if(!n)return;const o=e.querySelector(".sf-checkbox-box sf-icon, .sf-checkbox-box .sf-icon"),r="sf-icon"===o?.tagName?.toLowerCase()?o.getAttribute("icon")||"":o?.textContent;(n.checked!==t||n.indeterminate||o&&r!==(t?"check":""))&&(n.checked=t,n.indeterminate=!1,globalThis.SF?.Checkbox?.setState?.(n,{checked:t,indeterminate:!1}))}function n(t,n){if(!t.id){let o;do{o=`${n}-${++e}`}while(document.getElementById(o));t.id=o}return t.id}function o(e,o){let r=null,i=null,s=null,a=!1;const l=new WeakMap,c=(e,t,n)=>{const o=l.get(e)||{};void 0!==o[t]&&e.getAttribute(t)===o[t]&&e.removeAttribute(t),delete o[t],!e.hasAttribute(t)&&n&&(e.setAttribute(t,n),o[t]=n),l.set(e,o)},d=()=>e.querySelector(".sf-dropdown-field, .sf-dropdown-trigger"),f=()=>d()?.querySelector(":scope > button")||d(),u=()=>d()?.querySelector('input:not([type="hidden"])'),p=()=>o.getList()?.querySelector(".sf-input input"),m=()=>[...o.getList()?.querySelectorAll(".sf-list-item")||[]],h=()=>m().filter(e=>!e.hidden&&!e.classList.contains("disabled")&&"true"!==e.getAttribute("aria-disabled")&&"true"!==e.getAttribute("aria-hidden")),g=e=>e.querySelector(".sf-list-item-container, .sf-avatar-label-group-title, .sf-tag-container")?.textContent?.trim()||e.dataset.value||"",w=e=>{e&&!e.disabled&&(e.focus({preventScroll:!0}),e.scrollIntoView({block:"nearest",inline:"nearest"}))},b=()=>{i="trigger",w(f()),o.close(),_()},y=e=>{if(o.isDisabled()||e.altKey||e.ctrlKey||e.metaKey)return;const t=e.target,n=t.closest?.(".sf-list-item"),r=o.getList()?.contains(t),s=t===f()||t===u()||t===d();let a=!1;if("Escape"===e.key&&o.isOpen())b(),a=!0;else{if("Tab"===e.key&&o.isOpen())return r&&w(f()),o.close(),void _();if(s&&["ArrowDown","ArrowUp","Enter"," "].includes(e.key))o.isOpen()&&["Enter"," "].includes(e.key)?b():(e=>{i=e,o.open(),_()})("ArrowUp"===e.key?"last":"search"),a=!0;else if(r&&["ArrowDown","ArrowUp"].includes(e.key)){const t=h(),o=t.indexOf(n),r=o<0?"ArrowUp"===e.key?t.length-1:0:Math.max(0,Math.min(t.length-1,o+("ArrowUp"===e.key?-1:1)));w(t[r]),a=!0}else if(n&&r&&["Home","End"].includes(e.key)){const t=h();w("Home"===e.key?t[0]:t.at(-1)),a=!0}else n&&r&&["Enter"," "].includes(e.key)&&(h().includes(n)&&(i=o.isMultiple()?{value:n.dataset.value}:"trigger",o.select(n),_()),a=!0)}a&&(e.preventDefault(),e.stopImmediatePropagation())},v=()=>{null!==s&&cancelAnimationFrame(s),s=requestAnimationFrame(()=>{var t;s=null,a||!o.isOpen()||i||(t=document.activeElement)&&(e.contains(t)||o.getList()?.contains(t))||(o.close(),_())})};let x=document.createElement("span");x.className="sf-dropdown-value",e.append(x),n(x,"sf-dropdown-value");const _=()=>{if(a)return;const s=o.getList();r!==s&&(r?.removeEventListener("keydown",y,!0),r?.removeEventListener("focusout",v),r=s,r?.addEventListener("keydown",y,!0),r?.addEventListener("focusout",v));const b=f(),_=r?.querySelector(".sf-list-container");if(!b||!_)return;x.isConnected||e.append(x);const L=e.querySelector(".sf-dropdown-label .sf-dropdown-text"),S=o.owner||e,E=L?.textContent.trim()?n(L,"sf-dropdown-label"):"",D=S.getAttribute("aria-label")||e.getAttribute("aria-label"),A=S.getAttribute("aria-labelledby")||e.getAttribute("aria-labelledby"),k=n(b,"sf-dropdown-trigger"),C=b.hasAttribute("aria-label")&&l.get(b)?.["aria-label"]!==b.getAttribute("aria-label");c(b,"aria-labelledby",A||(!D&&E?C?`${k} ${E}`:E:"")),c(b,"aria-label",D),"BUTTON"!==b.tagName&&b.setAttribute("role","button"),b.tabIndex=o.isDisabled()?-1:0,b.setAttribute("aria-expanded",String(o.isOpen())),b.setAttribute("aria-haspopup","listbox"),b.setAttribute("aria-controls",n(_,"sf-dropdown-listbox")),b.querySelectorAll(".sf-icon").forEach(e=>e.setAttribute("aria-hidden","true")),d()!==b&&(d().tabIndex=-1),u()&&(u().tabIndex=-1),_.setAttribute("role","listbox"),_.setAttribute("aria-multiselectable",String(o.isMultiple())),c(_,"aria-labelledby",A||E||k);const O=p();O&&(O.setAttribute("role","searchbox"),O.setAttribute("aria-controls",_.id),c(O,"aria-labelledby",O.hasAttribute("aria-label")?"":A||E||k)),m().forEach(e=>{e.setAttribute("role","option"),e.tabIndex=-1,e.setAttribute("aria-selected",String(e.classList.contains("selected"))),c(e,"aria-disabled",e.classList.contains("disabled")?"true":""),t(e,e.classList.contains("selected")),e.querySelectorAll(".sf-checkbox").forEach(e=>{"true"!==e.getAttribute("aria-hidden")&&e.setAttribute("aria-hidden","true")}),e.querySelectorAll(".sf-icon, sf-icon").forEach(e=>{"true"!==e.getAttribute("aria-hidden")&&e.setAttribute("aria-hidden","true")}),e.querySelectorAll("input, button, a[href], [tabindex]").forEach(e=>{e.tabIndex=-1})});const P=o.selectedLabels?.()||m().filter(e=>e.classList.contains("selected")).map(g);x.textContent=P.join(", ")||u()?.value||u()?.placeholder||"";const T=new Set((b.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean));T.add(x.id),b.setAttribute("aria-describedby",[...T].join(" ")),(()=>{if(!i)return;if("trigger"===i)return i=null,void w(f());if(!o.isOpen()||o.getList()?.hidden)return;const e=h(),t="search"===i?p()||e[0]||f():"last"===i?e.at(-1):"object"==typeof i?e.find(e=>e.dataset.value===i.value):e[0];i=null,w(t)})()};return e.addEventListener("keydown",y,!0),e.addEventListener("focusout",v),_(),{refresh:_,beforeClose:()=>{o.getList()?.contains(document.activeElement)&&(i="trigger")},release(){a=!0,null!==s&&cancelAnimationFrame(s),e.removeEventListener("keydown",y,!0),e.removeEventListener("focusout",v),r?.removeEventListener("keydown",y,!0),r?.removeEventListener("focusout",v);const t=f();if(t){const e=(t.getAttribute("aria-describedby")||"").split(/\s+/).filter(e=>e&&e!==x.id);e.length?t.setAttribute("aria-describedby",e.join(" ")):t.removeAttribute("aria-describedby")}x.remove()}}}const r=new WeakMap,i=new WeakSet;const s=Math.min,a=Math.max,l=Math.round,c=Math.floor,d=e=>({x:e,y:e}),f={left:"right",right:"left",bottom:"top",top:"bottom"};function u(e,t){return"function"==typeof e?e(t):e}function p(e){return e.split("-")[0]}function m(e){return e.split("-")[1]}function h(e){return"x"===e?"y":"x"}function g(e){return"y"===e?"height":"width"}function w(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function b(e){return h(w(e))}function y(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const v=["left","right"],x=["right","left"],_=["top","bottom"],L=["bottom","top"];function S(e,t,n,o){const r=m(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?x:v:t?v:x;case"left":case"right":return t?_:L;default:return[]}}(p(e),"start"===n,o);return r&&(i=i.map(e=>e+"-"+r),t&&(i=i.concat(i.map(y)))),i}function E(e){const t=p(e);return f[t]+e.slice(t.length)}function D(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function A(e,t,n){let{reference:o,floating:r}=e;const i=w(t),s=b(t),a=g(s),l=p(t),c="y"===i,d=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,u=o[a]/2-r[a]/2;let h;switch(l){case"top":h={x:d,y:o.y-r.height};break;case"bottom":h={x:d,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:f};break;case"left":h={x:o.x-r.width,y:f};break;default:h={x:o.x,y:o.y}}const y=m(t);return y&&(h[s]+=u*("end"===y?1:-1)*(n&&c?-1:1)),h}async function k(e,t){var n;void 0===t&&(t={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:m=0}=u(t,e),h=function(e){return"number"!=typeof e?function(e){var t,n,o,r;return{top:null!=(t=e.top)?t:0,right:null!=(n=e.right)?n:0,bottom:null!=(o=e.bottom)?o:0,left:null!=(r=e.left)?r:0}}(e):{top:e,right:e,bottom:e,left:e}}(m),g=a[p?"floating"===f?"reference":"floating":f],w=D(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),b="floating"===f?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),v=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=D(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:y,strategy:l}):b);return{top:(w.top-x.top+h.top)/v.y,bottom:(x.bottom-w.bottom+h.bottom)/v.y,left:(w.left-x.left+h.left)/v.x,right:(x.right-w.right+h.right)/v.x}}const C=new Set(["left","top"]);function O(){return"undefined"!=typeof window}function P(e){return q(e)?(e.nodeName||"").toLowerCase():"#document"}function T(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function R(e){var t;return null==(t=(q(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function q(e){return!!O()&&(e instanceof Node||e instanceof T(e).Node)}function F(e){return!!O()&&(e instanceof Element||e instanceof T(e).Element)}function I(e){return!!O()&&(e instanceof HTMLElement||e instanceof T(e).HTMLElement)}function M(e){return!(!O()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof T(e).ShadowRoot)}function z(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Y(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&"inline"!==r&&"contents"!==r}function $(e){return/^(table|td|th)$/.test(P(e))}function N(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const V=/transform|translate|scale|rotate|perspective|filter/,W=/paint|layout|strict|content/,H=e=>!!e&&"none"!==e;let B;function j(e){const t=F(e)?Y(e):e;return H(t.transform)||H(t.translate)||H(t.scale)||H(t.rotate)||H(t.perspective)||!U()&&(H(t.backdropFilter)||H(t.filter))||V.test(t.willChange||"")||W.test(t.contain||"")}function U(){return null==B&&(B="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),B}function K(e){return/^(html|body|#document)$/.test(P(e))}function Y(e){return T(e).getComputedStyle(e)}function X(e){return F(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function G(e){if("html"===P(e))return e;const t=e.assignedSlot||e.parentNode||M(e)&&e.host||R(e);return M(t)?t.host:t}function J(e){const t=G(e);return K(t)?(e.ownerDocument||e).body:I(t)&&z(t)?t:J(t)}function Q(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=J(e),i=r===(null==(o=e.ownerDocument)?void 0:o.body),s=T(r);if(i){const e=Z(s);return t.concat(s,s.visualViewport||[],z(r)?r:[],e&&n?Q(e):[])}return t.concat(r,Q(r,[],n))}function Z(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ee(e){const t=Y(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=I(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,a=l(n)!==i||l(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function te(e){return F(e)?e:e.contextElement}function ne(e){const t=te(e);if(!I(t))return d(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=ee(t);let s=(i?l(n.width):n.width)/o,a=(i?l(n.height):n.height)/r;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const oe=d(0);function re(e){const t=T(e);return U()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:oe}function ie(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),i=te(e);let s=d(1);t&&(o?F(o)&&(s=ne(o)):s=ne(e));const a=function(e,t,n){return void 0===t&&(t=!1),!!n&&t&&n===T(e)}(i,n,o)?re(i):d(0);let l=(r.left+a.x)/s.x,c=(r.top+a.y)/s.y,f=r.width/s.x,u=r.height/s.y;if(i&&o){const e=T(i),t=F(o)?T(o):o;let n=e,r=Z(n);for(;r&&t!==n;){const e=ne(r),t=r.getBoundingClientRect(),o=Y(r),i=t.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,s=t.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;l*=e.x,c*=e.y,f*=e.x,u*=e.y,l+=i,c+=s,n=T(r),r=Z(n)}}return D({width:f,height:u,x:l,y:c})}function se(e,t){const n=X(e).scrollLeft;return t?t.left+n:ie(R(e)).left+n}function ae(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-se(e,n),y:n.top+t.scrollTop}}function le(e,t,n){let o;if("viewport"===t||"layoutViewport"===t)o=function(e,t,n){void 0===n&&(n="viewport");const o="layoutViewport"===n,r=T(e),i=R(e),s=r.visualViewport;let a=i.clientWidth,l=i.clientHeight,c=0,d=0;if(s){const e=!U()||"fixed"===t;o?e||(c=-s.offsetLeft,d=-s.offsetTop):(a=s.width,l=s.height,e&&(c=s.offsetLeft,d=s.offsetTop))}if(se(i)<=0){const e=i.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,r=Math.abs(i.clientWidth-t.clientWidth-o),s="stable both-edges"===getComputedStyle(i).scrollbarGutter?r/2:r;s<=25&&(a-=s)}return{width:a,height:l,x:c,y:d}}(e,n,t);else if("document"===t)o=function(e){const t=X(e),n=e.ownerDocument.body,o=a(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=a(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+se(e);const s=-t.scrollTop;return"rtl"===Y(n).direction&&(i+=a(e.clientWidth,n.clientWidth)-o),{width:o,height:r,x:i,y:s}}(R(e));else if(F(t))o=function(e,t){const n=ie(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=ne(e);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:o*i.y}}(t,n);else{const n=re(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return D(o)}function ce(e,t,n){const o=I(t),r=R(t),i="fixed"===n,s=ie(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=d(0);if((o||!i)&&(("body"!==P(t)||z(r))&&(a=X(t)),o)){const e=ie(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}!o&&r&&(l.x=se(r));const c=!r||o||i?d(0):ae(r,a);return{x:s.left+a.scrollLeft-l.x-c.x,y:s.top+a.scrollTop-l.y-c.y,width:s.width,height:s.height}}function de(e){return"static"===Y(e).position}function fe(e,t){if(!I(e)||"fixed"===Y(e).position)return null;if(t)return t(e);let n=e.offsetParent;return R(e)===n&&(n=n.ownerDocument.body),n}function ue(e,t){const n=T(e);if(N(e))return n;if(!I(e)){let t=G(e);for(;t&&!K(t);){if(F(t)&&!de(t))return t;t=G(t)}return n}let o=fe(e,t);for(;o&&$(o)&&de(o);)o=fe(o,t);return o&&K(o)&&de(o)&&!j(o)?n:o||function(e){let t=G(e);for(;I(t)&&!K(t);){if(j(t))return t;if(N(t))return null;t=G(t)}return null}(e)||n}const pe={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i="fixed"===r,s=R(o),a=!!t&&N(t.floating);if(o===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=d(1);const f=d(0),u=I(o);if((u||!i)&&(("body"!==P(o)||z(s))&&(l=X(o)),u)){const e=ie(o);c=ne(o),f.x=e.x+o.clientLeft,f.y=e.y+o.clientTop}const p=!s||u||i?d(0):ae(s,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+f.x+p.x,y:n.y*c.y-l.scrollTop*c.y+f.y+p.y}},getDocumentElement:R,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[..."clippingAncestors"===n?N(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=Q(e,[],!1).filter(e=>F(e)&&"body"!==P(e)),r=null;const i="fixed"===Y(e).position;let s=i?G(e):e;for(;F(s)&&!K(s);){const e=Y(s),t=j(s),n=r?r.position:i?"fixed":"";t||"fixed"!==n&&("absolute"!==n||"static"!==e.position)?r=e:o=o.filter(e=>e!==s),s=G(s)}return t.set(e,o),o}(t,this._c):[].concat(n),o],l=le(t,i[0],r);let c=l.top,d=l.right,f=l.bottom,u=l.left;for(let e=1;e<i.length;e++){const n=le(t,i[e],r);c=a(n.top,c),d=s(n.right,d),f=s(n.bottom,f),u=a(n.left,u)}return{width:d-u,height:f-c,x:u,y:c}},getOffsetParent:ue,getElementRects:async function(e){const t=this.getOffsetParent||ue,n=this.getDimensions,o=await n(e.floating);return{reference:ce(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return e.getClientRects?Array.from(e.getClientRects()):[]},getDimensions:function(e){const{width:t,height:n}=ee(e);return{width:t,height:n}},getScale:ne,isElement:F,isRTL:function(e){return"rtl"===Y(e).direction}};function me(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function he(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:d="function"==typeof IntersectionObserver,animationFrame:f=!1}=o,u=te(e),p=r||i?[...u?Q(u):[],...t?Q(t):[]]:[];p.forEach(e=>{r&&e.addEventListener("scroll",n),i&&e.addEventListener("resize",n)});const m=u&&d?function(e,t,n){let o,r=null;const i=R(e);function l(){var e;clearTimeout(o),null==(e=r)||e.disconnect(),r=null}function d(n,f){void 0===n&&(n=!1),void 0===f&&(f=1),l();const u=e.getBoundingClientRect(),{left:p,top:m,width:h,height:g}=u;if(n||t(),!h||!g)return;const w={rootMargin:-c(m)+"px "+-c(i.clientWidth-(p+h))+"px "+-c(i.clientHeight-(m+g))+"px "+-c(p)+"px",threshold:a(0,s(1,f))||1};let b=!0;function y(t){const n=t[0].intersectionRatio;if(!me(u,e.getBoundingClientRect()))return d();if(n!==f){if(!b)return d();n?d(!1,n):o=setTimeout(()=>{d(!1,1e-7)},1e3)}b=!1}try{r=new IntersectionObserver(y,{...w,root:i.ownerDocument})}catch(e){r=new IntersectionObserver(y,w)}r.observe(e)}const f=T(e),u=()=>d(n);return f.addEventListener("resize",u),d(!0),()=>{f.removeEventListener("resize",u),l()}}(u,n,i):null;let h,g=-1,w=null;l&&(w=new ResizeObserver(e=>{let[o]=e;o&&o.target===u&&w&&t&&(w.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var e;null==(e=w)||e.observe(t)})),n()}),u&&!f&&w.observe(u),t&&w.observe(t));let b=f?ie(e):null;return f&&function t(){const o=ie(e);b&&!me(b,o)&&n();b=o,h=requestAnimationFrame(t)}(),n(),()=>{var e;p.forEach(e=>{r&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==m||m(),null==(e=w)||e.disconnect(),w=null,f&&cancelAnimationFrame(h)}}const ge=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:o,elements:r}=e,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),s=p(n),a=m(n),l="y"===w(n),c=C.has(s)?-1:1,d=i&&l?-1:1,f=u(t,e);let{mainAxis:h,crossAxis:g,alignmentAxis:b}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&"number"==typeof b&&(g="end"===a?-1*b:b),l?{x:g*d,y:h*c}:{x:h*c,y:g*d}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:s}}}}},we=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:d={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...f}=u(e,t),p={x:n,y:o},m=await i.detectOverflow(t,f),g=w(r),b=h(g);let y=p[b],v=p[g];const x=(e,t)=>{return n=t+m["y"===e?"top":"left"],o=t,r=t-m["y"===e?"bottom":"right"],a(n,s(o,r));var n,o,r};l&&(y=x(b,y)),c&&(v=x(g,v));const _=d.fn({...t,[b]:y,[g]:v});return{..._,data:{x:_.x-n,y:_.y-o,enabled:{[b]:l,[g]:c}}}}}},be=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:_=!0,...L}=u(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const D=p(r),A=w(a),k=p(a)===a,C=await(null==l.isRTL?void 0:l.isRTL(c.floating)),O=h||(k||!_?[E(a)]:function(e){const t=E(e);return[y(e),t,y(t)]}(a)),P="none"!==x;!h&&P&&O.push(...S(a,_,x,C));const T=[a,...O],R=await l.detectOverflow(t,L),q=[];let F=(null==(o=i.flip)?void 0:o.overflows)||[];if(d&&q.push(R[D]),f){const e=function(e,t,n){void 0===n&&(n=!1);const o=m(e),r=b(e),i=g(r);let s="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=E(s)),[s,E(s)]}(r,s,C);q.push(R[e[0]],R[e[1]])}if(F=[...F,{placement:r,overflows:q}],!q.every(e=>e<=0)){var I,M;const e=((null==(I=i.flip)?void 0:I.index)||0)+1,t=T[e];if(t){if(!("alignment"===f&&A!==w(t))||F.every(e=>w(e.placement)!==A||e.overflows[0]>0))return{data:{index:e,overflows:F},reset:{placement:t}}}let n=null==(M=F.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:M.placement;if(!n)switch(v){case"bestFit":{var z;const e=null==(z=F.filter(e=>{if(P){const t=w(e.placement);return t===A||"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:z[0];e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}},ye=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:o,platform:r,elements:i}=t,{apply:l=()=>{},...c}=u(e,t),d=await r.detectOverflow(t,c),f=p(n),h=m(n),g="y"===w(n),{width:b,height:y}=o.floating;let v,x;"top"===f||"bottom"===f?(v=f,x=h===(await(null==r.isRTL?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(x=f,v="end"===h?"top":"bottom");const _=y-d.top-d.bottom,L=b-d.left-d.right,S=s(y-d[v],_),E=s(b-d[x],L),D=t.middlewareData.shift,A=!D;let k=S,C=E;null!=D&&D.enabled.x&&(C=L),null!=D&&D.enabled.y&&(k=_),A&&!h&&(g?C=b-2*a(d.left,d.right):k=y-2*a(d.top,d.bottom)),await l({...t,availableWidth:C,availableHeight:k});const O=await r.getDimensions(i.floating);return b!==O.width||y!==O.height?{reset:{rects:!0}}:{}}}},ve=(e,t,n)=>{const o=new Map,r=null!=n?n:{},i={...pe,...r.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:k},l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:f}=A(c,o,l),u=o,p=0;const m={};for(let n=0;n<i.length;n++){const h=i[n];if(!h)continue;const{name:g,fn:w}=h,{x:b,y,data:v,reset:x}=await w({x:d,y:f,initialPlacement:o,placement:u,strategy:r,middlewareData:m,rects:c,platform:a,elements:{reference:e,floating:t}});d=null!=b?b:d,f=null!=y?y:f,m[g]={...m[g],...v},x&&p<50&&(p++,"object"==typeof x&&(x.placement&&(u=x.placement),x.rects&&(c=!0===x.rects?await s.getElementRects({reference:e,floating:t,strategy:r}):x.rects),({x:d,y:f}=A(c,u,l))),n=-1)}return{x:d,y:f,placement:u,strategy:r,middlewareData:m}})(e,t,{...r,platform:i})},xe=["block-start","block-end","inline-start","inline-end"],_e=["start","center","end"];function Le(e="block-end",t="start",n=!1){if(!xe.includes(e))throw new TypeError(`Unknown placement side: ${e}`);if(!_e.includes(t))throw new TypeError(`Unknown placement alignment: ${t}`);const o="block-start"===e?"top":"block-end"===e?"bottom":"inline-start"===e?n?"right":"left":n?"left":"right";return"center"===t?o:`${o}-${t}`}function Se(e,t=!1){const n=String(e).split("-")[0];return"top"===n?"block-start":"bottom"===n?"block-end":"left"===n?t?"inline-end":"inline-start":t?"inline-start":"inline-end"}function Ee(e,t=document.body){if("number"==typeof e)return Number.isFinite(e)?e:0;if("string"!=typeof e||""===e.trim())return 0;const n=document.createElement("span");n.style.cssText="position:absolute;visibility:hidden;pointer-events:none;block-size:0;padding:0;border:0",n.style.inlineSize=e,(t?.isConnected?t:document.body).append(n);const o=parseFloat(getComputedStyle(n).width)||0;return n.remove(),o}const De=Object.freeze({anchor:function(e,t,n={}){if(!(e instanceof Element&&t instanceof HTMLElement))throw new TypeError("Anchored positioning needs a reference element and a floating element");const o={side:"block-end",align:"start",offset:"var(--sf-space-1\\/4)",alignmentOffset:0,padding:"var(--sf-space-1\\/2)",flip:!0,shift:!0,matchWidth:!1,fitHeight:!0,autoUpdate:!0,onPosition:null,...n},r=["position","left","top","right","bottom","margin","max-height","max-width",...o.matchWidth?["width"]:[]].map(e=>[e,t.style.getPropertyValue(e),t.style.getPropertyPriority(e)]),i={maxHeight:t.style.getPropertyValue("max-height")},s=getComputedStyle(t),a=(e,t)=>{const n=parseFloat(e);return Number.isFinite(n)?String(e).trim().endsWith("%")?n/100*t:n:1/0},l=a(s.maxHeight,document.documentElement.clientHeight),c=a(s.maxWidth,document.documentElement.clientWidth),d={side:o.side,stopped:!1};let f=null,u=!1;const p=async()=>{const n="rtl"===getComputedStyle(e).direction;const r=Ee(o.offset,e.parentElement),s=Ee(o.padding,e.parentElement);o.fitHeight&&(t.style.maxHeight=i.maxHeight||"");const a=e.getBoundingClientRect(),f=document.documentElement.clientWidth,u={top:s,bottom:s,left:Math.min(s,Math.max(0,a.left)),right:Math.min(s,Math.max(0,f-a.right))},p=[ge({mainAxis:r,alignmentAxis:Ee(o.alignmentOffset,e.parentElement)})];o.flip&&p.push(be({padding:s,crossAxis:!1})),o.shift&&p.push(we({padding:u,crossAxis:!1})),p.push(ye({padding:u,apply({availableWidth:e,availableHeight:t,rects:n,elements:r}){if(d.stopped)return;const i=f-u.left-u.right;o.matchWidth&&(r.floating.style.width=`${Math.max(0,Math.min(n.reference.width,i))}px`),r.floating.style.maxWidth=`${Math.max(0,Math.min(e,i,c))}px`,o.fitHeight&&(r.floating.style.maxHeight=`${Math.max(0,Math.min(t,l))}px`)}}));const m=await ve(e,t,{strategy:"fixed",placement:Le(o.side,o.align,n),middleware:p});return d.stopped||(Object.assign(t.style,{position:"fixed",left:`${m.x}px`,top:`${m.y}px`,right:"auto",bottom:"auto",margin:"0"}),d.side=Se(m.placement,n),t.dataset.sfSide=d.side,o.onPosition?.({side:d.side,placement:m.placement,x:m.x,y:m.y})),m};d.update=()=>d.stopped?Promise.resolve(null):f?(u=!0,f):(f=p().finally(()=>{f=null,u&&!d.stopped&&(u=!1,d.update())}),f);const m=o.autoUpdate?he(e,t,d.update):null;return d.stop=()=>{d.stopped=!0,m?.(),delete t.dataset.sfSide;for(const[e,n,o]of r)n?t.style.setProperty(e,n,o):t.style.removeProperty(e)},o.autoUpdate||d.update(),d},logicalSide:Se,physicalPlacement:Le,resolveLength:Ee});"undefined"!=typeof globalThis&&(globalThis.SF=globalThis.SF||{},globalThis.SF.Position||(globalThis.SF.Position=De));const Ae=De,ke=new WeakMap,Ce=["position","inset","margin","width","max-width","max-height","overflow","left","top","right","bottom","z-index"],Oe=["font-family","font-size","font-weight","font-style","font-stretch","font-variant","font-feature-settings","font-variation-settings","font-optical-sizing","font-kerning","line-height","letter-spacing","word-spacing","text-transform","text-indent","white-space","word-break","overflow-wrap","text-rendering","direction","writing-mode","text-orientation","color","color-scheme","text-align"];function Pe(e,t){if(!t.context)return;const n=t.context,o=getComputedStyle(e),r=["sf-dropdown",...Array.from(e.classList).filter(e=>e.startsWith("sf-dropdown--")&&!["sf-dropdown--open","sf-dropdown--drop-up","sf-dropdown--drop-down"].includes(e))].join(" ");n.className!==r&&(n.className=r);const i=[...Array.from(o).filter(e=>e.startsWith("--sf-")),...Oe],s=new Set(i);for(const e of t.contextProperties||[])s.has(e)||n.style.removeProperty(e);for(const e of i){const t=o.getPropertyValue(e);n.style.getPropertyValue(e)!==t&&n.style.setProperty(e,t)}t.contextProperties=i}function Te(e){return e?.querySelector(".sf-dropdown-field, .sf-dropdown-trigger")??null}function Re(e,t){const n=ke.get(t);if(!n||!e.isConnected||t.hidden)return!1;const o=Te(e);return!!o&&(e.closest('[hidden], [inert], [aria-hidden="true"], dialog:not([open])')||!o.getClientRects().length||["hidden","collapse"].includes(getComputedStyle(o).visibility)?(n.onUnavailable?.(),!1):(Pe(e,n),n.wrap&&(n.wrap.style.minHeight="0",n.wrap.style.overflowY="auto"),n.anchor||(n.anchor=(globalThis.SF?.Position||Ae).anchor(o,t,{side:"block-end",align:"start",matchWidth:o.classList.contains("sf-dropdown-field"),fitHeight:!0,autoUpdate:!1,onPosition:({side:n})=>{const o="block-start"===n;t.dataset.placement=e.dataset.placement=o?"top":"bottom",e.classList.toggle("sf-dropdown--drop-up",o),e.classList.toggle("sf-dropdown--drop-down",!o)}})),n.anchor.update(),!0))}function qe(){const e=globalThis.SF=globalThis.SF||{};return e.__deprecationNotes instanceof Map||Object.defineProperty(e,"__deprecationNotes",{value:new Map,configurable:!0}),e.__deprecationNotes}function Fe({component:e="",kind:t="attribute",attribute:n="",from:o,to:r=null}={}){if(!o)return;const i=[e,t,n,o].join("|"),s=qe(),a=s.get(i);if(a)a.count+=1;else if(s.set(i,{component:e,kind:t,attribute:n,from:o,to:r,count:1}),function(){const e=globalThis.document?.documentElement;return"warn"===e?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const i=e?`${e}: `:"",s="value"===t?`${n}="${o}"`:`${t} ${o}`;globalThis.console?.warn?.(`[SIMAI Framework] ${i}${s} is a legacy name${r?`; write ${r}`:""}. See contracts/changes/journal.json.`)}}if("undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const e=globalThis.SF.deprecations||{};e.list=function(){return[...qe().values()].map(e=>({...e}))},e.clear=function(){qe().clear()},e.note=Fe,globalThis.SF.deprecations=e}const Ie=Object.freeze(["1/2","1","2"]),Me=Object.freeze({"1/3":"1/2",3:"2"}),ze=new Set;function $e(e,t="field",n="1"){const o=String(e??"").trim().toLowerCase();if(Ie.includes(o))return o;if(Object.hasOwn(Me,o)){const e=Me[o];Fe({component:t,kind:"value",attribute:"size",from:o,to:e});const n=`${t}:${o}`;return ze.has(n)||"undefined"==typeof console||(ze.add(n),console.warn(`[SIMAI Framework] ${t}: size ${o} is retired for form fields; rendering size ${e}.`)),e}return n}const Ne=".sf-dropdown",Ve="sfDropdownBound",We=".sf-list-item-selected-item",He=Object.freeze({"1/2":{size:"1/3",spacing:""},1:{size:"1",spacing:"compact"},2:{size:"2",spacing:"compact"}});function Be(e){return e.classList.contains("sf-dropdown--tag")}function je(e){const t=e?.closest?.("sf-dropdown");return Boolean(t?.__sfSmartElement)}function Ue(e,t=!1){return null==e||""===e?t:"boolean"==typeof e?e:["1","true","yes","on"].includes(String(e).toLowerCase())}function Ke(e){return!!e&&(e.hasAttribute("multiple")?Ue(e.getAttribute("multiple"),!0):void 0!==e.dataset.multiple?Ue(e.dataset.multiple,!1):Be(e))}function Ye(e){return!!e&&(!!e.classList.contains("disabled")||!!e.hasAttribute("disabled")&&Ue(e.getAttribute("disabled"),!0))}function Xe(e){return!!e&&(e.hasAttribute("portal")?Ue(e.getAttribute("portal"),!0):void 0===e.dataset.portal||Ue(e.dataset.portal,!0))}function Ge(e){return e.querySelector(".sf-dropdown-field")}function Je(e){return e.querySelector(".sf-dropdown-field input:not(.sf-dropdown-hidden-input)")}function Qe(e){return e.__sfDropdownPortalList||e.querySelector(".sf-list")}function Ze(e){return Qe(e)?.querySelector(".sf-input input")||null}function et(e){return e.querySelector(".sf-dropdown-hidden-input")}function tt(e){return Qe(e)?.querySelector(".sf-list-container")||null}function nt(e){return Array.from(Qe(e)?.querySelectorAll(".sf-list-item")||[])}function ot(e,t){return!(!e||!t)&&(!!e.contains(t)||Boolean(e.__sfDropdownPortalList?.contains(t)))}function rt(e){e&&Xe(e)&&Re(e,Qe(e))}function it(e){if(!e||!Xe(e))return;const t=Qe(e);t&&function(e,t,n){if(!t?.isConnected||!Te(e))return!1;const o=t.contains(document.activeElement)?document.activeElement:null;if(!ke.has(t)){const o=Ce.map(e=>[e,t.style.getPropertyValue(e),t.style.getPropertyPriority(e)]),r={root:e,saved:o,onUnavailable:n,popover:t.getAttribute("popover"),frame:0,native:"function"==typeof t.showPopover};r.wrap=t.querySelector(".sf-list-container-wrap"),r.wrapStyles=r.wrap?["min-height","overflow-y"].map(e=>[e,r.wrap.style.getPropertyValue(e),r.wrap.style.getPropertyPriority(e)]):[],r.schedule=()=>{r.frame||(r.frame=requestAnimationFrame(()=>{r.frame=0,Re(e,t)}))},ke.set(t,r),e.__sfDropdownPortalList=t,r.native?t.setAttribute("popover","manual"):(r.parent=t.parentNode,r.next=t.nextSibling,r.context=document.createElement("div"),r.context.style.cssText="display:contents;position:static",Pe(e,r),(e.closest('dialog[open], [role="dialog"][aria-modal="true"]')||document.body).append(r.context),r.context.append(t),t.style.zIndex="var(--sf-z-index-9)"),r.inheritance=new MutationObserver(r.schedule);for(let t=e;t;t=t.parentElement)r.inheritance.observe(t,{attributes:!0,attributeFilter:["class","style","dir","hidden","inert","aria-hidden","open"]});Object.assign(t.style,{position:"fixed",inset:"auto",margin:"0",overflow:r.wrap?"hidden":"auto"}),"function"==typeof ResizeObserver&&(r.resize=new ResizeObserver(r.schedule),r.resize.observe(Te(e)),r.resize.observe(t)),window.visualViewport?.addEventListener("resize",r.schedule),window.visualViewport?.addEventListener("scroll",r.schedule)}return t.hidden=!1,ke.get(t).native&&!t.matches(":popover-open")&&t.showPopover(),!!Re(e,t)&&(o&&document.activeElement!==o&&o.focus({preventScroll:!0}),!0)}(e,t,()=>bt(e))&&(t.__sfDropdownRoot=e,e.__sfDropdownPortalClick||(e.__sfDropdownPortalClick=St,e.__sfDropdownPortalKeydown=Et,t.addEventListener("click",St),t.addEventListener("keydown",Et)),e.__sfDropdownPortalOnViewportChange||(e.__sfDropdownPortalOnViewportChange=()=>{e.classList.contains("sf-dropdown--open")&&rt(e)}),window.addEventListener("resize",e.__sfDropdownPortalOnViewportChange),document.addEventListener("scroll",e.__sfDropdownPortalOnViewportChange,!0))}function st(e){if(!e)return;const t=Qe(e);!function(e){const t=ke.get(e);if(!t)return!1;const n=e.contains(document.activeElement)?document.activeElement:null;t.anchor?.stop(),t.resize?.disconnect(),cancelAnimationFrame(t.frame),t.inheritance?.disconnect(),window.visualViewport?.removeEventListener("resize",t.schedule),window.visualViewport?.removeEventListener("scroll",t.schedule),t.native?(e.matches(":popover-open")&&e.hidePopover(),null===t.popover?e.removeAttribute("popover"):e.setAttribute("popover",t.popover)):(t.next?.parentNode===t.parent?t.parent.insertBefore(e,t.next):t.parent.append(e),t.context.remove());for(const[n,o,r]of t.saved)o?e.style.setProperty(n,o,r):e.style.removeProperty(n);for(const[e,n,o]of t.wrapStyles)n?t.wrap.style.setProperty(e,n,o):t.wrap.style.removeProperty(e);delete e.dataset.placement,delete t.root.dataset.placement,t.root.classList.remove("sf-dropdown--drop-up","sf-dropdown--drop-down"),t.root.__sfDropdownPortalList===e&&delete t.root.__sfDropdownPortalList,ke.delete(e),n&&!e.hidden&&t.root.isConnected&&document.activeElement!==n&&n.focus({preventScroll:!0})}(t),t&&e.__sfDropdownPortalClick&&(t.removeEventListener("click",e.__sfDropdownPortalClick),t.removeEventListener("keydown",e.__sfDropdownPortalKeydown)),delete e.__sfDropdownPortalClick,delete e.__sfDropdownPortalKeydown,e.__sfDropdownPortalOnViewportChange&&(window.removeEventListener("resize",e.__sfDropdownPortalOnViewportChange),document.removeEventListener("scroll",e.__sfDropdownPortalOnViewportChange,!0)),t&&delete t.__sfDropdownRoot,delete e.__sfDropdownPortalOnViewportChange}function at(e){return e?.dataset?.value??lt(e)}function lt(e){if(!e)return"";const t=e.querySelector(".sf-list-item-container")?.textContent?.trim();if(t)return t;const n=e.querySelector(".sf-tag-container")?.textContent?.trim();if(n)return n;const o=e.querySelector(".sf-avatar-label-group-title")?.textContent?.trim();return o||(e.dataset?.value?.trim?.()||e.textContent?.trim()||"")}function ct(e,n=[]){const o=new Set(n);nt(e).forEach(e=>{const n=o.has(e);e.classList.toggle("selected",n),e.setAttribute("aria-selected",n?"true":"false");const r=e.querySelector(We);n?function(e){if(!e.classList.contains("sf-list-item--text")&&!e.classList.contains("sf-list-item--icon"))return;if(!e||e.querySelector(We))return;const t=document.createElement("div");t.className="sf-list-item-selected-item flex";const n=document.createElement("i");n.className="sf-icon",n.textContent="check",t.append(n),e.append(t)}(e):r&&r.remove(),t(e,n)}),e.__sfDropdownInteraction?.refresh()}function dt(e){nt(e).forEach(t=>{const n=t.querySelector(".sf-checkbox"),o=t.querySelector(".sf-checkbox input");n&&o&&(o.tabIndex=-1,o.dataset.dropdownManaged="1",o.style.pointerEvents="none",n.style.pointerEvents="none",Ye(e)||t.classList.contains("disabled")?o.disabled=!0:o.disabled=!1)})}function ft(e){if(!Be(e))return;const t=function(e){return e.querySelector(".sf-dropdown-tag-container")}(e);t&&(t.innerHTML="",nt(e).filter(e=>e.classList.contains("selected")).forEach(n=>{t.append(function(e,t){const n=at(t),o=lt(t),r=e.className.match(/sf-dropdown--size-([^\s]+)/)?.[1]||"1",i=He[r]||He[1],s=i.size,a=i.spacing?` spacing-${i.spacing}`:"",l=t.classList.contains("sf-list-item--icon"),c=t.classList.contains("sf-list-item--avatar"),d=t.classList.contains("sf-list-item--color"),f=Ye(e),u=d?"color":c?"avatar":"icon",p=document.createElement("div");p.className=`sf-tag transition sf-tag--${u} sf-tag--size-${s} sf-tag--inline${a} flex flex-row flex-nowrap items-center active`,p.dataset.value=n,f&&(p.classList.add("disabled"),p.setAttribute("aria-disabled","true"));const m=document.createElement("span");if(m.className="sf-tag-container",m.textContent=o,d){const e=t.querySelector(".sf-tag-color-icon"),n=document.createElement("span");n.className=e?.className||"sf-tag-color-icon",p.append(n)}else if(c){const e=t.querySelector(".sf-avatar");e&&p.append(e.cloneNode(!0))}else if(l){const e=document.createElement("i");e.className="sf-icon sf-tag-icon",e.textContent=t.querySelector(".sf-list-item-wrap > .sf-icon")?.textContent?.trim()||"favorite",p.append(e)}p.append(m);const h=document.createElement("button");h.type="button",h.className="sf-icon-button sf-icon-button--link sf-icon-button--on-surface sf-icon-button--size-1/3",h.setAttribute("aria-label",`Remove ${o}`),h.dataset.role="remove-tag",h.dataset.value=n,h.disabled=f,h.tabIndex=f?-1:0;const g=document.createElement("div");g.className="sf-close sf-close--size-1/3 flex";const w=document.createElement("div");return w.className="sf-close-icon",g.append(w),h.append(g),p.append(h),p}(e,n))}))}function ut(e){const t=et(e);t&&(t.value=Ke(e)?vt(e).map(at).join(","):e.dataset.selectedValue||"",t.disabled=Ye(e))}const pt=":scope > .sf-list-item-wrap :is(.sf-flag, .sf-icon, .sf-tag-color-icon, .sf-avatar):not(.sf-checkbox *)";function mt(e){const t=vt(e),n=Ke(e)?t:t.slice(0,1);!function(e,t){if(Be(e))return;const n=Je(e);n&&(n.value=t)}(e,n.map(lt).join(", ")),function(e,t){if(Be(e))return;const n=Ge(e),o=Je(e);if(!n||!o)return;if(n.querySelector(":scope > .sf-dropdown-field-visual")?.remove(),Ke(e)||1!==t.length)return;const r=t[0].querySelector(pt);if(!r)return;const i=r.cloneNode(!0);i.classList.add("sf-dropdown-field-visual"),i.setAttribute("aria-hidden","true"),i.classList.contains("sf-flag")&&(delete i.dataset.sfFlagReady,i.replaceChildren()),o.before(i)}(e,n),e.dataset.selectedValue=n.map(at).join(","),ft(e),ut(e)}function ht(e,t){const n=function(e){return e.querySelector(".sf-dropdown-field .sf-icon-button .sf-icon")}(e);n&&(n.textContent=t?"keyboard_arrow_up":"keyboard_arrow_down")}function gt(e,t=4){const n=function(e){return Qe(e)?.querySelector(".sf-list-container-wrap")||null}(e),o=tt(e);if(!n||!o||t<=0)return;const r=nt(e).filter(e=>!e.hidden);if(!r.length)return;const i=r[0].getBoundingClientRect().height;if(!i)return;const s=window.getComputedStyle(o),a=Number.parseFloat(s.rowGap||"")||Number.parseFloat(s.gap||"")||0,l=Number.parseFloat(s.paddingTop||"")||0,c=Number.parseFloat(s.paddingBottom||"")||0,d=Math.min(t,r.length),f=d*i+Math.max(d-1,0)*a+l+c;n.style.maxHeight=`${Math.ceil(f)}px`,n.style.overflowY=r.length>d?"auto":"hidden",n.style.overflowX="hidden"}function wt(e){if(!e||Ye(e))return;const t=Je(e);if(t&&t.disabled)return;const n=Qe(e);n&&(e.classList.add("sf-dropdown--open"),it(e),n.hidden=!1,ht(e,!0),gt(e,4),rt(e),e.__sfDropdownInteraction?.refresh())}function bt(e){if(!e)return;if(je(e))return void e.closest("sf-dropdown").closeDropdown();e.__sfDropdownInteraction?.beforeClose();const t=Qe(e);if(!t)return;e.classList.remove("sf-dropdown--open"),t.hidden=!0,ht(e,!1),st(e);const n=Ze(e);n&&(n.value="",yt(e,"")),e.__sfDropdownInteraction?.refresh()}function yt(e,t=""){const n=String(t).trim().toLowerCase();nt(e).forEach(e=>{const t=lt(e).toLowerCase();e.hidden=Boolean(n)&&!t.includes(n)}),gt(e,4),e.__sfDropdownInteraction?.refresh(),e.classList.contains("sf-dropdown--open")&&rt(e)}function vt(e){return nt(e).filter(e=>e.classList.contains("selected"))}function xt(e){const t=Ye(e),n=e.__sfDropdownDisabledState!==t;e.__sfDropdownDisabledState=t;const o=Ge(e),r=Je(e),i=Ze(e),s=e.querySelector(".sf-dropdown-field .sf-icon-button");e.removeAttribute("aria-disabled");const a=o?.querySelector(":scope > button")||o;a&&"BUTTON"!==a.tagName&&a.setAttribute("aria-disabled",t?"true":"false"),o&&o.classList.toggle("cursor-pointer",!t),r&&(r.disabled=t),i&&(i.disabled=t);const l=et(e);return l&&(l.disabled=t),s&&(s.disabled=t,s.tabIndex=t?-1:0),nt(e).forEach(e=>{e.tabIndex=t||e.classList.contains("disabled")?-1:0}),t&&e.classList.contains("sf-dropdown--open")&&bt(e),e.__sfDropdownInteraction?.refresh(),n}function _t(e,t){e&&(e.dispatchEvent(new CustomEvent("sf-dropdown:change",{bubbles:!0,composed:!0,detail:t})),e.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:t})))}function Lt(e,t){if(!e||!t||t.classList.contains("disabled")||Ye(e))return;const n=lt(t),o=at(t),r=Ke(e);if(r){const n=vt(e);ct(e,t.classList.contains("selected")?n.filter(e=>e!==t):[...n,t])}else ct(e,[t]);mt(e),_t(e,{value:o,label:n,values:r?vt(e).map(at):[o],item:t,root:e,multiple:r}),dt(e),r||bt(e)}function St(e){const t=e.currentTarget.__sfDropdownRoot||e.currentTarget;if(e.currentTarget!==t&&t.contains(e.currentTarget))return;if(Ye(t))return void e.preventDefault();const n=Ge(t),o=e.target.closest(".sf-list-item"),r=e.target.closest('[data-role="remove-tag"]'),i=e.target.closest(".sf-list .sf-input"),s=e.target.closest(".sf-list-item .sf-checkbox");if(!i||!ot(t,i)){if(s&&ot(t,s)&&e.preventDefault(),r&&ot(t,r)){e.preventDefault(),e.stopPropagation();const n=r.dataset.value,o=vt(t).filter(e=>at(e)!==n);return ct(t,o),mt(t),_t(t,{value:"",label:"",values:o.map(at),item:null,root:t,multiple:Ke(t)}),void dt(t)}if(o&&ot(t,o))return e.preventDefault(),void Lt(t,o);n?.contains(e.target)&&(e.target.closest(".sf-list")||(e.preventDefault(),function(e){e&&(e.classList.contains("sf-dropdown--open")?bt(e):(document.querySelectorAll(`${Ne}.sf-dropdown--open`).forEach(t=>{t!==e&&bt(t)}),wt(e)))}(t)))}}function Et(e){const t=e.currentTarget.__sfDropdownRoot||e.currentTarget;if(e.currentTarget!==t&&t.contains(e.currentTarget))return;if(Ye(t))return;if("Escape"===e.key)return void bt(t);const n=e.target.closest(".sf-list-item");n&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Lt(t,n)))}function Dt(e){const t=e.currentTarget.__sfDropdownRoot||e.currentTarget.closest(Ne);t&&!Ye(t)&&yt(t,e.currentTarget.value)}function At(e){if(function(e,t){if(e?.classList)for(const[n,o]of Object.entries(Me)){const o=`${t}--size-${n}`;e.classList.contains(o)&&e.classList.replace(o,`${t}--size-${$e(n,t)}`)}}(e,"sf-dropdown"),je(e))return;if(!e||"1"===e.dataset[Ve])return;const t=Ge(e),n=Qe(e),s=Je(e);if(!t||!n)return;e.dataset[Ve]="1",e.removeAttribute("aria-expanded"),s&&!Be(e)&&(s.readOnly=!0),n.hidden=!e.classList.contains("sf-dropdown--open"),ht(e,e.classList.contains("sf-dropdown--open")),gt(e,4),xt(e),dt(e),e.__sfDropdownStateObserver=new MutationObserver(t=>{const n=xt(e);dt(e),n&&ft(e),t.some(e=>["portal","data-portal"].includes(e.attributeName))&&(e.classList.contains("sf-dropdown--open")&&Xe(e)?it(e):st(e),e.__sfDropdownInteraction?.refresh())}),e.__sfDropdownStateObserver.observe(e,{attributes:!0,attributeFilter:["class","disabled","portal","data-portal"]});const a=tt(e);a&&!e.__sfDropdownItemsObserver&&(e.__sfDropdownItemsObserver=new MutationObserver(()=>{xt(e),dt(e)}),e.__sfDropdownItemsObserver.observe(a,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","hidden","aria-hidden"]}));const l=vt(e);if(l.length>0)ct(e,l),mt(e);else{const t=e.getAttribute("value")||e.dataset.selectedValue||"";if(t){const n=Ke(e)?t.split(",").map(e=>e.trim()).filter(Boolean):[t],o=nt(e).filter(e=>n.includes(at(e))),r=o[0];r&&(ct(e,Ke(e)?o:[r]),mt(e))}}!l.length&&Be(e)&&(ft(e),ut(e)),e.__sfDropdownOnClick=St,e.__sfDropdownOnKeydown=Et,e.addEventListener("click",St),e.addEventListener("keydown",Et);const c=Ze(e);c&&(e.__sfDropdownSearchInput=c,e.__sfDropdownOnSearchInput=Dt,c.__sfDropdownRoot=e,c.addEventListener("input",Dt)),e.__sfDropdownInteraction=o(e,{getList:()=>Qe(e),isOpen:()=>e.classList.contains("sf-dropdown--open"),isDisabled:()=>Ye(e),isMultiple:()=>Ke(e),selectedLabels:()=>vt(e).map(lt),open:()=>wt(e),close:()=>bt(e),select:t=>Lt(e,t)}),Object.prototype.hasOwnProperty.call(e,"__sfDropdownResetValues")||(e.__sfDropdownResetValues=vt(e).map(at));const d=et(e)||t.querySelector(":scope > button")||s;d&&(e.__sfDropdownReleaseReset=function(e,t){const n=e.ownerDocument;i.has(n)||(n.addEventListener("reset",e=>{const t=e.target;if("FORM"!==t?.tagName)return;const n=Array.from(t.elements);setTimeout(()=>{if(!e.defaultPrevented)for(const e of n)if(e.isConnected&&e.form===t)for(const t of r.get(e)||[])t()},0)},!0),i.add(n));let o=r.get(e);return o||r.set(e,o=new Set),o.add(t),()=>o.delete(t)}(d,()=>{const t=nt(e).filter(t=>e.__sfDropdownResetValues.includes(at(t))),n=Ke(e)?t:t.slice(0,1);ct(e,n),mt(e),bt(e)}))}function kt(e){if(!e||"1"!==e.dataset[Ve])return;e.__sfDropdownInteraction?.release(),delete e.__sfDropdownInteraction,e.__sfDropdownReleaseReset?.(),delete e.__sfDropdownReleaseReset,st(e),e.__sfDropdownItemsObserver?.disconnect?.(),e.__sfDropdownStateObserver?.disconnect?.(),e.removeEventListener("click",e.__sfDropdownOnClick),e.removeEventListener("keydown",e.__sfDropdownOnKeydown);const t=Qe(e);t&&e.__sfDropdownPortalClick&&(t.removeEventListener("click",e.__sfDropdownPortalClick),t.removeEventListener("keydown",e.__sfDropdownPortalKeydown)),e.__sfDropdownSearchInput&&e.__sfDropdownOnSearchInput&&(e.__sfDropdownSearchInput.removeEventListener("input",e.__sfDropdownOnSearchInput),delete e.__sfDropdownSearchInput.__sfDropdownRoot),delete e.__sfDropdownOnClick,delete e.__sfDropdownOnKeydown,delete e.__sfDropdownPortalClick,delete e.__sfDropdownPortalKeydown,delete e.__sfDropdownSearchInput,delete e.__sfDropdownOnSearchInput,delete e.__sfDropdownItemsObserver,delete e.__sfDropdownStateObserver,delete e.__sfDropdownDisabledState,delete e.dataset[Ve]}function Ct(e=document){e.querySelectorAll(Ne).forEach(At)}document.__sfDropdownDocumentClickBound||(document.addEventListener("click",function(e){document.querySelectorAll(`${Ne}.sf-dropdown--open`).forEach(t=>{ot(t,e.target)||bt(t)})}),document.__sfDropdownDocumentClickBound=!0),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>Ct()):Ct();new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{e instanceof Element&&(e.matches?.(Ne)&&At(e),Ct(e))}),e.removedNodes.forEach(e=>{e instanceof Element&&!e.isConnected&&(e.matches?.(Ne)&&kt(e),e.querySelectorAll?.(Ne).forEach(kt))})})}).observe(document.documentElement,{childList:!0,subtree:!0})})();
1
+ (()=>{"use strict";let e=0;function t(e,t){const n=e.querySelector('.sf-checkbox input[type="checkbox"]');if(!n)return;const o=e.querySelector(".sf-checkbox-box sf-icon, .sf-checkbox-box .sf-icon"),r="sf-icon"===o?.tagName?.toLowerCase()?o.getAttribute("icon")||"":o?.textContent;(n.checked!==t||n.indeterminate||o&&r!==(t?"check":""))&&(n.checked=t,n.indeterminate=!1,globalThis.SF?.Checkbox?.setState?.(n,{checked:t,indeterminate:!1}))}function n(t,n){if(!t.id){let o;do{o=`${n}-${++e}`}while(document.getElementById(o));t.id=o}return t.id}function o(e,o){let r=null,i=null,s=null,a=!1;const l=new WeakMap,c=(e,t,n)=>{const o=l.get(e)||{};void 0!==o[t]&&e.getAttribute(t)===o[t]&&e.removeAttribute(t),delete o[t],!e.hasAttribute(t)&&n&&(e.setAttribute(t,n),o[t]=n),l.set(e,o)},d=()=>e.querySelector(".sf-dropdown-field, .sf-dropdown-trigger"),f=()=>d()?.querySelector(":scope > button")||d(),u=()=>d()?.querySelector('input:not([type="hidden"])'),p=()=>o.getList()?.querySelector(".sf-input input"),m=()=>[...o.getList()?.querySelectorAll(".sf-list-item")||[]],h=()=>m().filter(e=>!e.hidden&&!e.classList.contains("disabled")&&"true"!==e.getAttribute("aria-disabled")&&"true"!==e.getAttribute("aria-hidden")),g=e=>e.querySelector(".sf-list-item-container, .sf-avatar-label-group-title, .sf-tag-container")?.textContent?.trim()||e.dataset.value||"",w=e=>{e&&!e.disabled&&(e.focus({preventScroll:!0}),e.scrollIntoView({block:"nearest",inline:"nearest"}))},b=()=>{i="trigger",w(f()),o.close(),_()},y=e=>{if(o.isDisabled()||e.altKey||e.ctrlKey||e.metaKey)return;const t=e.target,n=t.closest?.(".sf-list-item"),r=o.getList()?.contains(t),s=t===f()||t===u()||t===d();let a=!1;if("Escape"===e.key&&o.isOpen())b(),a=!0;else{if("Tab"===e.key&&o.isOpen())return r&&w(f()),o.close(),void _();if(s&&["ArrowDown","ArrowUp","Enter"," "].includes(e.key))o.isOpen()&&["Enter"," "].includes(e.key)?b():(e=>{i=e,o.open(),_()})("ArrowUp"===e.key?"last":"search"),a=!0;else if(r&&["ArrowDown","ArrowUp"].includes(e.key)){const t=h(),o=t.indexOf(n),r=o<0?"ArrowUp"===e.key?t.length-1:0:Math.max(0,Math.min(t.length-1,o+("ArrowUp"===e.key?-1:1)));w(t[r]),a=!0}else if(n&&r&&["Home","End"].includes(e.key)){const t=h();w("Home"===e.key?t[0]:t.at(-1)),a=!0}else n&&r&&["Enter"," "].includes(e.key)&&(h().includes(n)&&(i=o.isMultiple()?{value:n.dataset.value}:"trigger",o.select(n),_()),a=!0)}a&&(e.preventDefault(),e.stopImmediatePropagation())},v=()=>{null!==s&&cancelAnimationFrame(s),s=requestAnimationFrame(()=>{var t;s=null,a||!o.isOpen()||i||(t=document.activeElement)&&(e.contains(t)||o.getList()?.contains(t))||(o.close(),_())})};let x=document.createElement("span");x.className="sf-dropdown-value",e.append(x),n(x,"sf-dropdown-value");const _=()=>{if(a)return;const s=o.getList();r!==s&&(r?.removeEventListener("keydown",y,!0),r?.removeEventListener("focusout",v),r=s,r?.addEventListener("keydown",y,!0),r?.addEventListener("focusout",v));const b=f(),_=r?.querySelector(".sf-list-container");if(!b||!_)return;x.isConnected||e.append(x);const L=e.querySelector(".sf-dropdown-label .sf-dropdown-text"),S=o.owner||e,E=L?.textContent.trim()?n(L,"sf-dropdown-label"):"",D=S.getAttribute("aria-label")||e.getAttribute("aria-label"),A=S.getAttribute("aria-labelledby")||e.getAttribute("aria-labelledby"),k=n(b,"sf-dropdown-trigger"),C=b.hasAttribute("aria-label")&&l.get(b)?.["aria-label"]!==b.getAttribute("aria-label");c(b,"aria-labelledby",A||(!D&&E?C?`${k} ${E}`:E:"")),c(b,"aria-label",D),"BUTTON"!==b.tagName&&b.setAttribute("role","button"),b.tabIndex=o.isDisabled()?-1:0,b.setAttribute("aria-expanded",String(o.isOpen())),b.setAttribute("aria-haspopup","listbox"),b.setAttribute("aria-controls",n(_,"sf-dropdown-listbox")),b.querySelectorAll(".sf-icon").forEach(e=>e.setAttribute("aria-hidden","true")),d()!==b&&(d().tabIndex=-1),u()&&(u().tabIndex=-1),_.setAttribute("role","listbox"),_.setAttribute("aria-multiselectable",String(o.isMultiple())),c(_,"aria-labelledby",A||E||k);const O=p();O&&(O.setAttribute("role","searchbox"),O.setAttribute("aria-controls",_.id),c(O,"aria-labelledby",O.hasAttribute("aria-label")?"":A||E||k)),m().forEach(e=>{e.setAttribute("role","option"),e.tabIndex=-1,e.setAttribute("aria-selected",String(e.classList.contains("selected"))),c(e,"aria-disabled",e.classList.contains("disabled")?"true":""),t(e,e.classList.contains("selected")),e.querySelectorAll(".sf-checkbox").forEach(e=>{"true"!==e.getAttribute("aria-hidden")&&e.setAttribute("aria-hidden","true")}),e.querySelectorAll(".sf-icon, sf-icon").forEach(e=>{"true"!==e.getAttribute("aria-hidden")&&e.setAttribute("aria-hidden","true")}),e.querySelectorAll("input, button, a[href], [tabindex]").forEach(e=>{e.tabIndex=-1})});const P=o.selectedLabels?.()||m().filter(e=>e.classList.contains("selected")).map(g);x.textContent=P.join(", ")||u()?.value||u()?.placeholder||"";const T=new Set((b.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean));T.add(x.id),b.setAttribute("aria-describedby",[...T].join(" ")),(()=>{if(!i)return;if("trigger"===i)return i=null,void w(f());if(!o.isOpen()||o.getList()?.hidden)return;const e=h(),t="search"===i?p()||e[0]||f():"last"===i?e.at(-1):"object"==typeof i?e.find(e=>e.dataset.value===i.value):e[0];i=null,w(t)})()};return e.addEventListener("keydown",y,!0),e.addEventListener("focusout",v),_(),{refresh:_,beforeClose:()=>{o.getList()?.contains(document.activeElement)&&(i="trigger")},release(){a=!0,null!==s&&cancelAnimationFrame(s),e.removeEventListener("keydown",y,!0),e.removeEventListener("focusout",v),r?.removeEventListener("keydown",y,!0),r?.removeEventListener("focusout",v);const t=f();if(t){const e=(t.getAttribute("aria-describedby")||"").split(/\s+/).filter(e=>e&&e!==x.id);e.length?t.setAttribute("aria-describedby",e.join(" ")):t.removeAttribute("aria-describedby")}x.remove()}}}const r=new WeakMap,i=new WeakSet;const s=Math.min,a=Math.max,l=Math.round,c=Math.floor,d=e=>({x:e,y:e}),f={left:"right",right:"left",bottom:"top",top:"bottom"};function u(e,t){return"function"==typeof e?e(t):e}function p(e){return e.split("-")[0]}function m(e){return e.split("-")[1]}function h(e){return"x"===e?"y":"x"}function g(e){return"y"===e?"height":"width"}function w(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function b(e){return h(w(e))}function y(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const v=["left","right"],x=["right","left"],_=["top","bottom"],L=["bottom","top"];function S(e,t,n,o){const r=m(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?x:v:t?v:x;case"left":case"right":return t?_:L;default:return[]}}(p(e),"start"===n,o);return r&&(i=i.map(e=>e+"-"+r),t&&(i=i.concat(i.map(y)))),i}function E(e){const t=p(e);return f[t]+e.slice(t.length)}function D(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function A(e,t,n){let{reference:o,floating:r}=e;const i=w(t),s=b(t),a=g(s),l=p(t),c="y"===i,d=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,u=o[a]/2-r[a]/2;let h;switch(l){case"top":h={x:d,y:o.y-r.height};break;case"bottom":h={x:d,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:f};break;case"left":h={x:o.x-r.width,y:f};break;default:h={x:o.x,y:o.y}}const y=m(t);return y&&(h[s]+=u*("end"===y?1:-1)*(n&&c?-1:1)),h}async function k(e,t){var n;void 0===t&&(t={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:m=0}=u(t,e),h=function(e){return"number"!=typeof e?function(e){var t,n,o,r;return{top:null!=(t=e.top)?t:0,right:null!=(n=e.right)?n:0,bottom:null!=(o=e.bottom)?o:0,left:null!=(r=e.left)?r:0}}(e):{top:e,right:e,bottom:e,left:e}}(m),g=a[p?"floating"===f?"reference":"floating":f],w=D(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),b="floating"===f?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),v=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=D(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:y,strategy:l}):b);return{top:(w.top-x.top+h.top)/v.y,bottom:(x.bottom-w.bottom+h.bottom)/v.y,left:(w.left-x.left+h.left)/v.x,right:(x.right-w.right+h.right)/v.x}}const C=new Set(["left","top"]);function O(){return"undefined"!=typeof window}function P(e){return q(e)?(e.nodeName||"").toLowerCase():"#document"}function T(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function R(e){var t;return null==(t=(q(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function q(e){return!!O()&&(e instanceof Node||e instanceof T(e).Node)}function F(e){return!!O()&&(e instanceof Element||e instanceof T(e).Element)}function M(e){return!!O()&&(e instanceof HTMLElement||e instanceof T(e).HTMLElement)}function I(e){return!(!O()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof T(e).ShadowRoot)}function z(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Y(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&"inline"!==r&&"contents"!==r}function N(e){return/^(table|td|th)$/.test(P(e))}function $(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const V=/transform|translate|scale|rotate|perspective|filter/,W=/paint|layout|strict|content/,H=e=>!!e&&"none"!==e;let B;function j(e){const t=F(e)?Y(e):e;return H(t.transform)||H(t.translate)||H(t.scale)||H(t.rotate)||H(t.perspective)||!U()&&(H(t.backdropFilter)||H(t.filter))||V.test(t.willChange||"")||W.test(t.contain||"")}function U(){return null==B&&(B="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),B}function K(e){return/^(html|body|#document)$/.test(P(e))}function Y(e){return T(e).getComputedStyle(e)}function X(e){return F(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function G(e){if("html"===P(e))return e;const t=e.assignedSlot||e.parentNode||I(e)&&e.host||R(e);return I(t)?t.host:t}function J(e){const t=G(e);return K(t)?(e.ownerDocument||e).body:M(t)&&z(t)?t:J(t)}function Q(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=J(e),i=r===(null==(o=e.ownerDocument)?void 0:o.body),s=T(r);if(i){const e=Z(s);return t.concat(s,s.visualViewport||[],z(r)?r:[],e&&n?Q(e):[])}return t.concat(r,Q(r,[],n))}function Z(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ee(e){const t=Y(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=M(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,a=l(n)!==i||l(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function te(e){return F(e)?e:e.contextElement}function ne(e){const t=te(e);if(!M(t))return d(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=ee(t);let s=(i?l(n.width):n.width)/o,a=(i?l(n.height):n.height)/r;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const oe=d(0);function re(e){const t=T(e);return U()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:oe}function ie(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),i=te(e);let s=d(1);t&&(o?F(o)&&(s=ne(o)):s=ne(e));const a=function(e,t,n){return void 0===t&&(t=!1),!!n&&t&&n===T(e)}(i,n,o)?re(i):d(0);let l=(r.left+a.x)/s.x,c=(r.top+a.y)/s.y,f=r.width/s.x,u=r.height/s.y;if(i&&o){const e=T(i),t=F(o)?T(o):o;let n=e,r=Z(n);for(;r&&t!==n;){const e=ne(r),t=r.getBoundingClientRect(),o=Y(r),i=t.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,s=t.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;l*=e.x,c*=e.y,f*=e.x,u*=e.y,l+=i,c+=s,n=T(r),r=Z(n)}}return D({width:f,height:u,x:l,y:c})}function se(e,t){const n=X(e).scrollLeft;return t?t.left+n:ie(R(e)).left+n}function ae(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-se(e,n),y:n.top+t.scrollTop}}function le(e,t,n){let o;if("viewport"===t||"layoutViewport"===t)o=function(e,t,n){void 0===n&&(n="viewport");const o="layoutViewport"===n,r=T(e),i=R(e),s=r.visualViewport;let a=i.clientWidth,l=i.clientHeight,c=0,d=0;if(s){const e=!U()||"fixed"===t;o?e||(c=-s.offsetLeft,d=-s.offsetTop):(a=s.width,l=s.height,e&&(c=s.offsetLeft,d=s.offsetTop))}if(se(i)<=0){const e=i.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,r=Math.abs(i.clientWidth-t.clientWidth-o),s="stable both-edges"===getComputedStyle(i).scrollbarGutter?r/2:r;s<=25&&(a-=s)}return{width:a,height:l,x:c,y:d}}(e,n,t);else if("document"===t)o=function(e){const t=X(e),n=e.ownerDocument.body,o=a(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=a(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+se(e);const s=-t.scrollTop;return"rtl"===Y(n).direction&&(i+=a(e.clientWidth,n.clientWidth)-o),{width:o,height:r,x:i,y:s}}(R(e));else if(F(t))o=function(e,t){const n=ie(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=ne(e);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:o*i.y}}(t,n);else{const n=re(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return D(o)}function ce(e,t,n){const o=M(t),r=R(t),i="fixed"===n,s=ie(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=d(0);if((o||!i)&&(("body"!==P(t)||z(r))&&(a=X(t)),o)){const e=ie(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}!o&&r&&(l.x=se(r));const c=!r||o||i?d(0):ae(r,a);return{x:s.left+a.scrollLeft-l.x-c.x,y:s.top+a.scrollTop-l.y-c.y,width:s.width,height:s.height}}function de(e){return"static"===Y(e).position}function fe(e,t){if(!M(e)||"fixed"===Y(e).position)return null;if(t)return t(e);let n=e.offsetParent;return R(e)===n&&(n=n.ownerDocument.body),n}function ue(e,t){const n=T(e);if($(e))return n;if(!M(e)){let t=G(e);for(;t&&!K(t);){if(F(t)&&!de(t))return t;t=G(t)}return n}let o=fe(e,t);for(;o&&N(o)&&de(o);)o=fe(o,t);return o&&K(o)&&de(o)&&!j(o)?n:o||function(e){let t=G(e);for(;M(t)&&!K(t);){if(j(t))return t;if($(t))return null;t=G(t)}return null}(e)||n}const pe={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i="fixed"===r,s=R(o),a=!!t&&$(t.floating);if(o===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=d(1);const f=d(0),u=M(o);if((u||!i)&&(("body"!==P(o)||z(s))&&(l=X(o)),u)){const e=ie(o);c=ne(o),f.x=e.x+o.clientLeft,f.y=e.y+o.clientTop}const p=!s||u||i?d(0):ae(s,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+f.x+p.x,y:n.y*c.y-l.scrollTop*c.y+f.y+p.y}},getDocumentElement:R,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[..."clippingAncestors"===n?$(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=Q(e,[],!1).filter(e=>F(e)&&"body"!==P(e)),r=null;const i="fixed"===Y(e).position;let s=i?G(e):e;for(;F(s)&&!K(s);){const e=Y(s),t=j(s),n=r?r.position:i?"fixed":"";t||"fixed"!==n&&("absolute"!==n||"static"!==e.position)?r=e:o=o.filter(e=>e!==s),s=G(s)}return t.set(e,o),o}(t,this._c):[].concat(n),o],l=le(t,i[0],r);let c=l.top,d=l.right,f=l.bottom,u=l.left;for(let e=1;e<i.length;e++){const n=le(t,i[e],r);c=a(n.top,c),d=s(n.right,d),f=s(n.bottom,f),u=a(n.left,u)}return{width:d-u,height:f-c,x:u,y:c}},getOffsetParent:ue,getElementRects:async function(e){const t=this.getOffsetParent||ue,n=this.getDimensions,o=await n(e.floating);return{reference:ce(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return e.getClientRects?Array.from(e.getClientRects()):[]},getDimensions:function(e){const{width:t,height:n}=ee(e);return{width:t,height:n}},getScale:ne,isElement:F,isRTL:function(e){return"rtl"===Y(e).direction}};function me(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function he(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:d="function"==typeof IntersectionObserver,animationFrame:f=!1}=o,u=te(e),p=r||i?[...u?Q(u):[],...t?Q(t):[]]:[];p.forEach(e=>{r&&e.addEventListener("scroll",n),i&&e.addEventListener("resize",n)});const m=u&&d?function(e,t,n){let o,r=null;const i=R(e);function l(){var e;clearTimeout(o),null==(e=r)||e.disconnect(),r=null}function d(n,f){void 0===n&&(n=!1),void 0===f&&(f=1),l();const u=e.getBoundingClientRect(),{left:p,top:m,width:h,height:g}=u;if(n||t(),!h||!g)return;const w={rootMargin:-c(m)+"px "+-c(i.clientWidth-(p+h))+"px "+-c(i.clientHeight-(m+g))+"px "+-c(p)+"px",threshold:a(0,s(1,f))||1};let b=!0;function y(t){const n=t[0].intersectionRatio;if(!me(u,e.getBoundingClientRect()))return d();if(n!==f){if(!b)return d();n?d(!1,n):o=setTimeout(()=>{d(!1,1e-7)},1e3)}b=!1}try{r=new IntersectionObserver(y,{...w,root:i.ownerDocument})}catch(e){r=new IntersectionObserver(y,w)}r.observe(e)}const f=T(e),u=()=>d(n);return f.addEventListener("resize",u),d(!0),()=>{f.removeEventListener("resize",u),l()}}(u,n,i):null;let h,g=-1,w=null;l&&(w=new ResizeObserver(e=>{let[o]=e;o&&o.target===u&&w&&t&&(w.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var e;null==(e=w)||e.observe(t)})),n()}),u&&!f&&w.observe(u),t&&w.observe(t));let b=f?ie(e):null;return f&&function t(){const o=ie(e);b&&!me(b,o)&&n();b=o,h=requestAnimationFrame(t)}(),n(),()=>{var e;p.forEach(e=>{r&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==m||m(),null==(e=w)||e.disconnect(),w=null,f&&cancelAnimationFrame(h)}}const ge=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:o,elements:r}=e,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),s=p(n),a=m(n),l="y"===w(n),c=C.has(s)?-1:1,d=i&&l?-1:1,f=u(t,e);let{mainAxis:h,crossAxis:g,alignmentAxis:b}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&"number"==typeof b&&(g="end"===a?-1*b:b),l?{x:g*d,y:h*c}:{x:h*c,y:g*d}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:s}}}}},we=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:d={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...f}=u(e,t),p={x:n,y:o},m=await i.detectOverflow(t,f),g=w(r),b=h(g);let y=p[b],v=p[g];const x=(e,t)=>{return n=t+m["y"===e?"top":"left"],o=t,r=t-m["y"===e?"bottom":"right"],a(n,s(o,r));var n,o,r};l&&(y=x(b,y)),c&&(v=x(g,v));const _=d.fn({...t,[b]:y,[g]:v});return{..._,data:{x:_.x-n,y:_.y-o,enabled:{[b]:l,[g]:c}}}}}},be=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:_=!0,...L}=u(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const D=p(r),A=w(a),k=p(a)===a,C=await(null==l.isRTL?void 0:l.isRTL(c.floating)),O=h||(k||!_?[E(a)]:function(e){const t=E(e);return[y(e),t,y(t)]}(a)),P="none"!==x;!h&&P&&O.push(...S(a,_,x,C));const T=[a,...O],R=await l.detectOverflow(t,L),q=[];let F=(null==(o=i.flip)?void 0:o.overflows)||[];if(d&&q.push(R[D]),f){const e=function(e,t,n){void 0===n&&(n=!1);const o=m(e),r=b(e),i=g(r);let s="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=E(s)),[s,E(s)]}(r,s,C);q.push(R[e[0]],R[e[1]])}if(F=[...F,{placement:r,overflows:q}],!q.every(e=>e<=0)){var M,I;const e=((null==(M=i.flip)?void 0:M.index)||0)+1,t=T[e];if(t){if(!("alignment"===f&&A!==w(t))||F.every(e=>w(e.placement)!==A||e.overflows[0]>0))return{data:{index:e,overflows:F},reset:{placement:t}}}let n=null==(I=F.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:I.placement;if(!n)switch(v){case"bestFit":{var z;const e=null==(z=F.filter(e=>{if(P){const t=w(e.placement);return t===A||"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:z[0];e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}},ye=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:o,platform:r,elements:i}=t,{apply:l=()=>{},...c}=u(e,t),d=await r.detectOverflow(t,c),f=p(n),h=m(n),g="y"===w(n),{width:b,height:y}=o.floating;let v,x;"top"===f||"bottom"===f?(v=f,x=h===(await(null==r.isRTL?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(x=f,v="end"===h?"top":"bottom");const _=y-d.top-d.bottom,L=b-d.left-d.right,S=s(y-d[v],_),E=s(b-d[x],L),D=t.middlewareData.shift,A=!D;let k=S,C=E;null!=D&&D.enabled.x&&(C=L),null!=D&&D.enabled.y&&(k=_),A&&!h&&(g?C=b-2*a(d.left,d.right):k=y-2*a(d.top,d.bottom)),await l({...t,availableWidth:C,availableHeight:k});const O=await r.getDimensions(i.floating);return b!==O.width||y!==O.height?{reset:{rects:!0}}:{}}}},ve=(e,t,n)=>{const o=new Map,r=null!=n?n:{},i={...pe,...r.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:k},l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:f}=A(c,o,l),u=o,p=0;const m={};for(let n=0;n<i.length;n++){const h=i[n];if(!h)continue;const{name:g,fn:w}=h,{x:b,y,data:v,reset:x}=await w({x:d,y:f,initialPlacement:o,placement:u,strategy:r,middlewareData:m,rects:c,platform:a,elements:{reference:e,floating:t}});d=null!=b?b:d,f=null!=y?y:f,m[g]={...m[g],...v},x&&p<50&&(p++,"object"==typeof x&&(x.placement&&(u=x.placement),x.rects&&(c=!0===x.rects?await s.getElementRects({reference:e,floating:t,strategy:r}):x.rects),({x:d,y:f}=A(c,u,l))),n=-1)}return{x:d,y:f,placement:u,strategy:r,middlewareData:m}})(e,t,{...r,platform:i})},xe=["block-start","block-end","inline-start","inline-end"],_e=["start","center","end"];function Le(e="block-end",t="start",n=!1){if(!xe.includes(e))throw new TypeError(`Unknown placement side: ${e}`);if(!_e.includes(t))throw new TypeError(`Unknown placement alignment: ${t}`);const o="block-start"===e?"top":"block-end"===e?"bottom":"inline-start"===e?n?"right":"left":n?"left":"right";return"center"===t?o:`${o}-${t}`}function Se(e,t=!1){const n=String(e).split("-")[0];return"top"===n?"block-start":"bottom"===n?"block-end":"left"===n?t?"inline-end":"inline-start":t?"inline-start":"inline-end"}function Ee(e,t=document.body){if("number"==typeof e)return Number.isFinite(e)?e:0;if("string"!=typeof e||""===e.trim())return 0;const n=document.createElement("span");n.style.cssText="position:absolute;visibility:hidden;pointer-events:none;block-size:0;padding:0;border:0",n.style.inlineSize=e,(t?.isConnected?t:document.body).append(n);const o=parseFloat(getComputedStyle(n).width)||0;return n.remove(),o}const De=Object.freeze({anchor:function(e,t,n={}){if(!(e instanceof Element&&t instanceof HTMLElement))throw new TypeError("Anchored positioning needs a reference element and a floating element");const o={side:"block-end",align:"start",offset:"var(--sf-space-1\\/4)",alignmentOffset:0,padding:"var(--sf-space-1\\/2)",flip:!0,shift:!0,matchWidth:!1,fitHeight:!0,autoUpdate:!0,onPosition:null,...n},r=["position","left","top","right","bottom","margin","max-height","max-width",...o.matchWidth?["width"]:[]].map(e=>[e,t.style.getPropertyValue(e),t.style.getPropertyPriority(e)]),i={maxHeight:t.style.getPropertyValue("max-height")},s=getComputedStyle(t),a=(e,t)=>{const n=parseFloat(e);return Number.isFinite(n)?String(e).trim().endsWith("%")?n/100*t:n:1/0},l=a(s.maxHeight,document.documentElement.clientHeight),c=a(s.maxWidth,document.documentElement.clientWidth),d={side:o.side,stopped:!1};let f=null,u=!1;const p=async()=>{const n="rtl"===getComputedStyle(e).direction;const r=Ee(o.offset,e.parentElement),s=Ee(o.padding,e.parentElement);o.fitHeight&&(t.style.maxHeight=i.maxHeight||"");const a=e.getBoundingClientRect(),f=document.documentElement.clientWidth,u={top:s,bottom:s,left:Math.min(s,Math.max(0,a.left)),right:Math.min(s,Math.max(0,f-a.right))},p=[ge({mainAxis:r,alignmentAxis:Ee(o.alignmentOffset,e.parentElement)})];o.flip&&p.push(be({padding:s,crossAxis:!1})),o.shift&&p.push(we({padding:u,crossAxis:!1})),p.push(ye({padding:u,apply({availableWidth:e,availableHeight:t,rects:n,elements:r}){if(d.stopped)return;const i=f-u.left-u.right;o.matchWidth&&(r.floating.style.width=`${Math.max(0,Math.min(n.reference.width,i))}px`),r.floating.style.maxWidth=`${Math.max(0,Math.min(e,i,c))}px`,o.fitHeight&&(r.floating.style.maxHeight=`${Math.max(0,Math.min(t,l))}px`)}}));const m=await ve(e,t,{strategy:"fixed",placement:Le(o.side,o.align,n),middleware:p});return d.stopped||(Object.assign(t.style,{position:"fixed",left:`${m.x}px`,top:`${m.y}px`,right:"auto",bottom:"auto",margin:"0"}),d.side=Se(m.placement,n),t.dataset.sfSide=d.side,o.onPosition?.({side:d.side,placement:m.placement,x:m.x,y:m.y})),m};d.update=()=>d.stopped?Promise.resolve(null):f?(u=!0,f):(f=p().finally(()=>{f=null,u&&!d.stopped&&(u=!1,d.update())}),f);const m=o.autoUpdate?he(e,t,d.update):null;return d.stop=()=>{d.stopped=!0,m?.(),delete t.dataset.sfSide;for(const[e,n,o]of r)n?t.style.setProperty(e,n,o):t.style.removeProperty(e)},o.autoUpdate||d.update(),d},logicalSide:Se,physicalPlacement:Le,resolveLength:Ee});"undefined"!=typeof globalThis&&(globalThis.SF=globalThis.SF||{},globalThis.SF.Position||(globalThis.SF.Position=De));const Ae=De,ke=new WeakMap,Ce=["position","inset","margin","width","max-width","max-height","overflow","left","top","right","bottom","z-index"],Oe=["font-family","font-size","font-weight","font-style","font-stretch","font-variant","font-feature-settings","font-variation-settings","font-optical-sizing","font-kerning","line-height","letter-spacing","word-spacing","text-transform","text-indent","white-space","word-break","overflow-wrap","text-rendering","direction","writing-mode","text-orientation","color","color-scheme","text-align"];function Pe(e,t){if(!t.context)return;const n=t.context,o=getComputedStyle(e),r=["sf-dropdown",...Array.from(e.classList).filter(e=>e.startsWith("sf-dropdown--")&&!["sf-dropdown--open","sf-dropdown--drop-up","sf-dropdown--drop-down"].includes(e))].join(" ");n.className!==r&&(n.className=r);const i=[...Array.from(o).filter(e=>e.startsWith("--sf-")),...Oe],s=new Set(i);for(const e of t.contextProperties||[])s.has(e)||n.style.removeProperty(e);for(const e of i){const t=o.getPropertyValue(e);n.style.getPropertyValue(e)!==t&&n.style.setProperty(e,t)}t.contextProperties=i}function Te(e){return e?.querySelector(".sf-dropdown-field, .sf-dropdown-trigger")??null}function Re(e,t){const n=ke.get(t);if(!n||!e.isConnected||t.hidden)return!1;const o=Te(e);return!!o&&(e.closest('[hidden], [inert], [aria-hidden="true"], dialog:not([open])')||!o.getClientRects().length||["hidden","collapse"].includes(getComputedStyle(o).visibility)?(n.onUnavailable?.(),!1):(Pe(e,n),n.wrap&&(n.wrap.style.minHeight="0",n.wrap.style.overflowY="auto"),n.anchor||(n.anchor=(globalThis.SF?.Position||Ae).anchor(o,t,{side:"block-end",align:"start",matchWidth:o.classList.contains("sf-dropdown-field"),fitHeight:!0,autoUpdate:!1,onPosition:({side:n})=>{const o="block-start"===n;t.dataset.placement=e.dataset.placement=o?"top":"bottom",e.classList.toggle("sf-dropdown--drop-up",o),e.classList.toggle("sf-dropdown--drop-down",!o)}})),n.anchor.update(),!0))}function qe(){const e=globalThis.SF=globalThis.SF||{};return e.__deprecationNotes instanceof Map||Object.defineProperty(e,"__deprecationNotes",{value:new Map,configurable:!0}),e.__deprecationNotes}function Fe({component:e="",kind:t="attribute",attribute:n="",from:o,to:r=null}={}){if(!o)return;const i=[e,t,n,o].join("|"),s=qe(),a=s.get(i);if(a)a.count+=1;else if(s.set(i,{component:e,kind:t,attribute:n,from:o,to:r,count:1}),function(){const e=globalThis.document?.documentElement;return"warn"===e?.dataset?.sfDeprecations||!0===globalThis.SF?.deprecations?.warn}()){const i=e?`${e}: `:"",s="value"===t?`${n}="${o}"`:`${t} ${o}`;globalThis.console?.warn?.(`[SIMAI Framework] ${i}${s} is a legacy name${r?`; write ${r}`:""}. See contracts/changes/journal.json.`)}}if("undefined"!=typeof globalThis){globalThis.SF=globalThis.SF||{};const e=globalThis.SF.deprecations||{};e.list=function(){return[...qe().values()].map(e=>({...e}))},e.clear=function(){qe().clear()},e.note=Fe,globalThis.SF.deprecations=e}const Me=Object.freeze(["1/2","1","2"]),Ie=Object.freeze({"1/3":"1/2",3:"2"}),ze=new Set;function Ne(e,t="field",n="1"){const o=String(e??"").trim().toLowerCase();if(Me.includes(o))return o;if(Object.hasOwn(Ie,o)){const e=Ie[o];Fe({component:t,kind:"value",attribute:"size",from:o,to:e});const n=`${t}:${o}`;return ze.has(n)||"undefined"==typeof console||(ze.add(n),console.warn(`[SIMAI Framework] ${t}: size ${o} is retired for form fields; rendering size ${e}.`)),e}return n}const $e="sfPopoverOpen",Ve=new WeakSet;function We(e,t){if(!e)return;const n=Boolean(t);n!==Ve.has(e)&&(n?Ve.add(e):Ve.delete(e),function(e){const t=globalThis.document?.documentElement;if(!t)return;const n=Math.max(0,Number(t.dataset[$e]||0)+e);n?t.dataset[$e]=String(n):delete t.dataset[$e]}(n?1:-1))}const He=".sf-dropdown",Be="sfDropdownBound",je=".sf-list-item-selected-item",Ue=Object.freeze({"1/2":{size:"1/3",spacing:""},1:{size:"1",spacing:"compact"},2:{size:"2",spacing:"compact"}});function Ke(e){return e.classList.contains("sf-dropdown--tag")}function Ye(e){const t=e?.closest?.("sf-dropdown");return Boolean(t?.__sfSmartElement)}function Xe(e,t=!1){return null==e||""===e?t:"boolean"==typeof e?e:["1","true","yes","on"].includes(String(e).toLowerCase())}function Ge(e){return!!e&&(e.hasAttribute("multiple")?Xe(e.getAttribute("multiple"),!0):void 0!==e.dataset.multiple?Xe(e.dataset.multiple,!1):Ke(e))}function Je(e){return!!e&&(!!e.classList.contains("disabled")||!!e.hasAttribute("disabled")&&Xe(e.getAttribute("disabled"),!0))}function Qe(e){return!!e&&(e.hasAttribute("portal")?Xe(e.getAttribute("portal"),!0):void 0===e.dataset.portal||Xe(e.dataset.portal,!0))}function Ze(e){return e.querySelector(".sf-dropdown-field")}function et(e){return e.querySelector(".sf-dropdown-field input:not(.sf-dropdown-hidden-input)")}function tt(e){return e.__sfDropdownPortalList||e.querySelector(".sf-list")}function nt(e){return tt(e)?.querySelector(".sf-input input")||null}function ot(e){return e.querySelector(".sf-dropdown-hidden-input")}function rt(e){return tt(e)?.querySelector(".sf-list-container")||null}function it(e){return Array.from(tt(e)?.querySelectorAll(".sf-list-item")||[])}function st(e,t){return!(!e||!t)&&(!!e.contains(t)||Boolean(e.__sfDropdownPortalList?.contains(t)))}function at(e){e&&Qe(e)&&Re(e,tt(e))}function lt(e){if(!e||!Qe(e))return;const t=tt(e);t&&function(e,t,n){if(!t?.isConnected||!Te(e))return!1;const o=t.contains(document.activeElement)?document.activeElement:null;if(!ke.has(t)){const o=Ce.map(e=>[e,t.style.getPropertyValue(e),t.style.getPropertyPriority(e)]),r={root:e,saved:o,onUnavailable:n,popover:t.getAttribute("popover"),frame:0,native:"function"==typeof t.showPopover};r.wrap=t.querySelector(".sf-list-container-wrap"),r.wrapStyles=r.wrap?["min-height","overflow-y"].map(e=>[e,r.wrap.style.getPropertyValue(e),r.wrap.style.getPropertyPriority(e)]):[],r.schedule=()=>{r.frame||(r.frame=requestAnimationFrame(()=>{r.frame=0,Re(e,t)}))},ke.set(t,r),e.__sfDropdownPortalList=t,r.native?t.setAttribute("popover","manual"):(r.parent=t.parentNode,r.next=t.nextSibling,r.context=document.createElement("div"),r.context.style.cssText="display:contents;position:static",Pe(e,r),(e.closest('dialog[open], [role="dialog"][aria-modal="true"]')||document.body).append(r.context),r.context.append(t),t.style.zIndex="var(--sf-z-index-9)"),r.inheritance=new MutationObserver(r.schedule);for(let t=e;t;t=t.parentElement)r.inheritance.observe(t,{attributes:!0,attributeFilter:["class","style","dir","hidden","inert","aria-hidden","open"]});Object.assign(t.style,{position:"fixed",inset:"auto",margin:"0",overflow:r.wrap?"hidden":"auto"}),"function"==typeof ResizeObserver&&(r.resize=new ResizeObserver(r.schedule),r.resize.observe(Te(e)),r.resize.observe(t)),window.visualViewport?.addEventListener("resize",r.schedule),window.visualViewport?.addEventListener("scroll",r.schedule)}return t.hidden=!1,ke.get(t).native&&!t.matches(":popover-open")&&t.showPopover(),!!Re(e,t)&&(o&&document.activeElement!==o&&o.focus({preventScroll:!0}),!0)}(e,t,()=>xt(e))&&(t.__sfDropdownRoot=e,e.__sfDropdownPortalClick||(e.__sfDropdownPortalClick=At,e.__sfDropdownPortalKeydown=kt,t.addEventListener("click",At),t.addEventListener("keydown",kt)),e.__sfDropdownPortalOnViewportChange||(e.__sfDropdownPortalOnViewportChange=()=>{e.classList.contains("sf-dropdown--open")&&at(e)}),window.addEventListener("resize",e.__sfDropdownPortalOnViewportChange),document.addEventListener("scroll",e.__sfDropdownPortalOnViewportChange,!0))}function ct(e){if(!e)return;const t=tt(e);!function(e){const t=ke.get(e);if(!t)return!1;const n=e.contains(document.activeElement)?document.activeElement:null;t.anchor?.stop(),t.resize?.disconnect(),cancelAnimationFrame(t.frame),t.inheritance?.disconnect(),window.visualViewport?.removeEventListener("resize",t.schedule),window.visualViewport?.removeEventListener("scroll",t.schedule),t.native?(e.matches(":popover-open")&&e.hidePopover(),null===t.popover?e.removeAttribute("popover"):e.setAttribute("popover",t.popover)):(t.next?.parentNode===t.parent?t.parent.insertBefore(e,t.next):t.parent.append(e),t.context.remove());for(const[n,o,r]of t.saved)o?e.style.setProperty(n,o,r):e.style.removeProperty(n);for(const[e,n,o]of t.wrapStyles)n?t.wrap.style.setProperty(e,n,o):t.wrap.style.removeProperty(e);delete e.dataset.placement,delete t.root.dataset.placement,t.root.classList.remove("sf-dropdown--drop-up","sf-dropdown--drop-down"),t.root.__sfDropdownPortalList===e&&delete t.root.__sfDropdownPortalList,ke.delete(e),n&&!e.hidden&&t.root.isConnected&&document.activeElement!==n&&n.focus({preventScroll:!0})}(t),t&&e.__sfDropdownPortalClick&&(t.removeEventListener("click",e.__sfDropdownPortalClick),t.removeEventListener("keydown",e.__sfDropdownPortalKeydown)),delete e.__sfDropdownPortalClick,delete e.__sfDropdownPortalKeydown,e.__sfDropdownPortalOnViewportChange&&(window.removeEventListener("resize",e.__sfDropdownPortalOnViewportChange),document.removeEventListener("scroll",e.__sfDropdownPortalOnViewportChange,!0)),t&&delete t.__sfDropdownRoot,delete e.__sfDropdownPortalOnViewportChange}function dt(e){return e?.dataset?.value??ft(e)}function ft(e){if(!e)return"";const t=e.querySelector(".sf-list-item-container")?.textContent?.trim();if(t)return t;const n=e.querySelector(".sf-tag-container")?.textContent?.trim();if(n)return n;const o=e.querySelector(".sf-avatar-label-group-title")?.textContent?.trim();return o||(e.dataset?.value?.trim?.()||e.textContent?.trim()||"")}function ut(e,n=[]){const o=new Set(n);it(e).forEach(e=>{const n=o.has(e);e.classList.toggle("selected",n),e.setAttribute("aria-selected",n?"true":"false");const r=e.querySelector(je);n?function(e){if(!e.classList.contains("sf-list-item--text")&&!e.classList.contains("sf-list-item--icon"))return;if(!e||e.querySelector(je))return;const t=document.createElement("div");t.className="sf-list-item-selected-item flex";const n=document.createElement("i");n.className="sf-icon",n.textContent="check",t.append(n),e.append(t)}(e):r&&r.remove(),t(e,n)}),e.__sfDropdownInteraction?.refresh()}function pt(e){it(e).forEach(t=>{const n=t.querySelector(".sf-checkbox"),o=t.querySelector(".sf-checkbox input");n&&o&&(o.tabIndex=-1,o.dataset.dropdownManaged="1",o.style.pointerEvents="none",n.style.pointerEvents="none",Je(e)||t.classList.contains("disabled")?o.disabled=!0:o.disabled=!1)})}function mt(e){if(!Ke(e))return;const t=function(e){return e.querySelector(".sf-dropdown-tag-container")}(e);t&&(t.innerHTML="",it(e).filter(e=>e.classList.contains("selected")).forEach(n=>{t.append(function(e,t){const n=dt(t),o=ft(t),r=e.className.match(/sf-dropdown--size-([^\s]+)/)?.[1]||"1",i=Ue[r]||Ue[1],s=i.size,a=i.spacing?` spacing-${i.spacing}`:"",l=t.classList.contains("sf-list-item--icon"),c=t.classList.contains("sf-list-item--avatar"),d=t.classList.contains("sf-list-item--color"),f=Je(e),u=d?"color":c?"avatar":"icon",p=document.createElement("div");p.className=`sf-tag transition sf-tag--${u} sf-tag--size-${s} sf-tag--inline${a} flex flex-row flex-nowrap items-center active`,p.dataset.value=n,f&&(p.classList.add("disabled"),p.setAttribute("aria-disabled","true"));const m=document.createElement("span");if(m.className="sf-tag-container",m.textContent=o,d){const e=t.querySelector(".sf-tag-color-icon"),n=document.createElement("span");n.className=e?.className||"sf-tag-color-icon",p.append(n)}else if(c){const e=t.querySelector(".sf-avatar");e&&p.append(e.cloneNode(!0))}else if(l){const e=document.createElement("i");e.className="sf-icon sf-tag-icon",e.textContent=t.querySelector(".sf-list-item-wrap > .sf-icon")?.textContent?.trim()||"favorite",p.append(e)}p.append(m);const h=document.createElement("button");h.type="button",h.className="sf-icon-button sf-icon-button--link sf-icon-button--on-surface sf-icon-button--size-1/3",h.setAttribute("aria-label",`Remove ${o}`),h.dataset.role="remove-tag",h.dataset.value=n,h.disabled=f,h.tabIndex=f?-1:0;const g=document.createElement("div");g.className="sf-close sf-close--size-1/3 flex";const w=document.createElement("div");return w.className="sf-close-icon",g.append(w),h.append(g),p.append(h),p}(e,n))}))}function ht(e){const t=ot(e);t&&(t.value=Ge(e)?Lt(e).map(dt).join(","):e.dataset.selectedValue||"",t.disabled=Je(e))}const gt=":scope > .sf-list-item-wrap :is(.sf-flag, .sf-icon, .sf-tag-color-icon, .sf-avatar):not(.sf-checkbox *)";function wt(e){const t=Lt(e),n=Ge(e)?t:t.slice(0,1);!function(e,t){if(Ke(e))return;const n=et(e);n&&(n.value=t)}(e,n.map(ft).join(", ")),function(e,t){if(Ke(e))return;const n=Ze(e),o=et(e);if(!n||!o)return;if(n.querySelector(":scope > .sf-dropdown-field-visual")?.remove(),Ge(e)||1!==t.length)return;const r=t[0].querySelector(gt);if(!r)return;const i=r.cloneNode(!0);i.classList.add("sf-dropdown-field-visual"),i.setAttribute("aria-hidden","true"),i.classList.contains("sf-flag")&&(delete i.dataset.sfFlagReady,i.replaceChildren()),o.before(i)}(e,n),e.dataset.selectedValue=n.map(dt).join(","),mt(e),ht(e)}function bt(e,t){const n=function(e){return e.querySelector(".sf-dropdown-field .sf-icon-button .sf-icon")}(e);n&&(n.textContent=t?"keyboard_arrow_up":"keyboard_arrow_down")}function yt(e,t=4){const n=function(e){return tt(e)?.querySelector(".sf-list-container-wrap")||null}(e),o=rt(e);if(!n||!o||t<=0)return;const r=it(e).filter(e=>!e.hidden);if(!r.length)return;const i=r[0].getBoundingClientRect().height;if(!i)return;const s=window.getComputedStyle(o),a=Number.parseFloat(s.rowGap||"")||Number.parseFloat(s.gap||"")||0,l=Number.parseFloat(s.paddingTop||"")||0,c=Number.parseFloat(s.paddingBottom||"")||0,d=Math.min(t,r.length),f=d*i+Math.max(d-1,0)*a+l+c;n.style.maxHeight=`${Math.ceil(f)}px`,n.style.overflowY=r.length>d?"auto":"hidden",n.style.overflowX="hidden"}function vt(e){if(!e||Je(e))return;if(Ye(e))return void e.closest("sf-dropdown").openDropdown();const t=et(e);if(t&&t.disabled)return;const n=tt(e);n&&(e.classList.add("sf-dropdown--open"),lt(e),n.hidden=!1,We(e,!0),bt(e,!0),yt(e,4),at(e),e.__sfDropdownInteraction?.refresh())}function xt(e){if(!e)return;if(Ye(e))return void e.closest("sf-dropdown").closeDropdown();e.__sfDropdownInteraction?.beforeClose();const t=tt(e);if(!t)return;e.classList.remove("sf-dropdown--open"),t.hidden=!0,We(e,!1),bt(e,!1),ct(e);const n=nt(e);n&&(n.value="",_t(e,"")),e.__sfDropdownInteraction?.refresh()}function _t(e,t=""){const n=String(t).trim().toLowerCase();it(e).forEach(e=>{const t=ft(e).toLowerCase();e.hidden=Boolean(n)&&!t.includes(n)}),yt(e,4),e.__sfDropdownInteraction?.refresh(),e.classList.contains("sf-dropdown--open")&&at(e)}function Lt(e){return it(e).filter(e=>e.classList.contains("selected"))}function St(e){const t=Je(e),n=e.__sfDropdownDisabledState!==t;e.__sfDropdownDisabledState=t;const o=Ze(e),r=et(e),i=nt(e),s=e.querySelector(".sf-dropdown-field .sf-icon-button");e.removeAttribute("aria-disabled");const a=o?.querySelector(":scope > button")||o;a&&"BUTTON"!==a.tagName&&a.setAttribute("aria-disabled",t?"true":"false"),o&&o.classList.toggle("cursor-pointer",!t),r&&(r.disabled=t),i&&(i.disabled=t);const l=ot(e);return l&&(l.disabled=t),s&&(s.disabled=t,s.tabIndex=t?-1:0),it(e).forEach(e=>{e.tabIndex=t||e.classList.contains("disabled")?-1:0}),t&&e.classList.contains("sf-dropdown--open")&&xt(e),e.__sfDropdownInteraction?.refresh(),n}function Et(e,t){e&&(e.dispatchEvent(new CustomEvent("sf-dropdown:change",{bubbles:!0,composed:!0,detail:t})),e.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:t})))}function Dt(e,t){if(!e||!t||t.classList.contains("disabled")||Je(e))return;const n=ft(t),o=dt(t),r=Ge(e);if(r){const n=Lt(e);ut(e,t.classList.contains("selected")?n.filter(e=>e!==t):[...n,t])}else ut(e,[t]);wt(e),Et(e,{value:o,label:n,values:r?Lt(e).map(dt):[o],item:t,root:e,multiple:r}),pt(e),r||xt(e)}function At(e){const t=e.currentTarget.__sfDropdownRoot||e.currentTarget;if(e.currentTarget!==t&&t.contains(e.currentTarget))return;if(Je(t))return void e.preventDefault();const n=Ze(t),o=e.target.closest(".sf-list-item"),r=e.target.closest('[data-role="remove-tag"]'),i=e.target.closest(".sf-list .sf-input"),s=e.target.closest(".sf-list-item .sf-checkbox");if(!i||!st(t,i)){if(s&&st(t,s)&&e.preventDefault(),r&&st(t,r)){e.preventDefault(),e.stopPropagation();const n=r.dataset.value,o=Lt(t).filter(e=>dt(e)!==n);return ut(t,o),wt(t),Et(t,{value:"",label:"",values:o.map(dt),item:null,root:t,multiple:Ge(t)}),void pt(t)}if(o&&st(t,o))return e.preventDefault(),void Dt(t,o);n?.contains(e.target)&&(e.target.closest(".sf-list")||(e.preventDefault(),function(e){e&&(e.classList.contains("sf-dropdown--open")?xt(e):(document.querySelectorAll(`${He}.sf-dropdown--open`).forEach(t=>{t!==e&&xt(t)}),vt(e)))}(t)))}}function kt(e){const t=e.currentTarget.__sfDropdownRoot||e.currentTarget;if(e.currentTarget!==t&&t.contains(e.currentTarget))return;if(Je(t))return;if("Escape"===e.key)return void xt(t);const n=e.target.closest(".sf-list-item");n&&("Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Dt(t,n)))}function Ct(e){const t=e.currentTarget.__sfDropdownRoot||e.currentTarget.closest(He);t&&!Je(t)&&_t(t,e.currentTarget.value)}function Ot(e){if(function(e,t){if(e?.classList)for(const[n,o]of Object.entries(Ie)){const o=`${t}--size-${n}`;e.classList.contains(o)&&e.classList.replace(o,`${t}--size-${Ne(n,t)}`)}}(e,"sf-dropdown"),Ye(e))return;if(!e||"1"===e.dataset[Be])return;const t=Ze(e),n=tt(e),s=et(e);if(!t||!n)return;e.dataset[Be]="1",e.removeAttribute("aria-expanded"),s&&!Ke(e)&&(s.readOnly=!0),n.hidden=!e.classList.contains("sf-dropdown--open"),bt(e,e.classList.contains("sf-dropdown--open")),yt(e,4),St(e),pt(e),e.__sfDropdownStateObserver=new MutationObserver(t=>{const n=St(e);pt(e),We(e,e.classList.contains("sf-dropdown--open")),n&&mt(e),t.some(e=>["portal","data-portal"].includes(e.attributeName))&&(e.classList.contains("sf-dropdown--open")&&Qe(e)?lt(e):ct(e),e.__sfDropdownInteraction?.refresh())}),e.__sfDropdownStateObserver.observe(e,{attributes:!0,attributeFilter:["class","disabled","portal","data-portal"]});const a=rt(e);a&&!e.__sfDropdownItemsObserver&&(e.__sfDropdownItemsObserver=new MutationObserver(()=>{St(e),pt(e)}),e.__sfDropdownItemsObserver.observe(a,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","hidden","aria-hidden"]}));const l=Lt(e);if(l.length>0)ut(e,l),wt(e);else{const t=e.getAttribute("value")||e.dataset.selectedValue||"";if(t){const n=Ge(e)?t.split(",").map(e=>e.trim()).filter(Boolean):[t],o=it(e).filter(e=>n.includes(dt(e))),r=o[0];r&&(ut(e,Ge(e)?o:[r]),wt(e))}}!l.length&&Ke(e)&&(mt(e),ht(e)),e.__sfDropdownOnClick=At,e.__sfDropdownOnKeydown=kt,e.addEventListener("click",At),e.addEventListener("keydown",kt);const c=nt(e);c&&(e.__sfDropdownSearchInput=c,e.__sfDropdownOnSearchInput=Ct,c.__sfDropdownRoot=e,c.addEventListener("input",Ct)),e.__sfDropdownInteraction=o(e,{getList:()=>tt(e),isOpen:()=>e.classList.contains("sf-dropdown--open"),isDisabled:()=>Je(e),isMultiple:()=>Ge(e),selectedLabels:()=>Lt(e).map(ft),open:()=>vt(e),close:()=>xt(e),select:t=>Dt(e,t)}),Object.prototype.hasOwnProperty.call(e,"__sfDropdownResetValues")||(e.__sfDropdownResetValues=Lt(e).map(dt));const d=ot(e)||t.querySelector(":scope > button")||s;d&&(e.__sfDropdownReleaseReset=function(e,t){const n=e.ownerDocument;i.has(n)||(n.addEventListener("reset",e=>{const t=e.target;if("FORM"!==t?.tagName)return;const n=Array.from(t.elements);setTimeout(()=>{if(!e.defaultPrevented)for(const e of n)if(e.isConnected&&e.form===t)for(const t of r.get(e)||[])t()},0)},!0),i.add(n));let o=r.get(e);return o||r.set(e,o=new Set),o.add(t),()=>o.delete(t)}(d,()=>{const t=it(e).filter(t=>e.__sfDropdownResetValues.includes(dt(t))),n=Ge(e)?t:t.slice(0,1);ut(e,n),wt(e),xt(e)}))}function Pt(e){if(!e||"1"!==e.dataset[Be])return;We(e,!1),e.__sfDropdownInteraction?.release(),delete e.__sfDropdownInteraction,e.__sfDropdownReleaseReset?.(),delete e.__sfDropdownReleaseReset,ct(e),e.__sfDropdownItemsObserver?.disconnect?.(),e.__sfDropdownStateObserver?.disconnect?.(),e.removeEventListener("click",e.__sfDropdownOnClick),e.removeEventListener("keydown",e.__sfDropdownOnKeydown);const t=tt(e);t&&e.__sfDropdownPortalClick&&(t.removeEventListener("click",e.__sfDropdownPortalClick),t.removeEventListener("keydown",e.__sfDropdownPortalKeydown)),e.__sfDropdownSearchInput&&e.__sfDropdownOnSearchInput&&(e.__sfDropdownSearchInput.removeEventListener("input",e.__sfDropdownOnSearchInput),delete e.__sfDropdownSearchInput.__sfDropdownRoot),delete e.__sfDropdownOnClick,delete e.__sfDropdownOnKeydown,delete e.__sfDropdownPortalClick,delete e.__sfDropdownPortalKeydown,delete e.__sfDropdownSearchInput,delete e.__sfDropdownOnSearchInput,delete e.__sfDropdownItemsObserver,delete e.__sfDropdownStateObserver,delete e.__sfDropdownDisabledState,delete e.dataset[Be]}function Tt(e=document){e.querySelectorAll(He).forEach(Ot)}document.__sfDropdownDocumentClickBound||(document.addEventListener("click",function(e){document.querySelectorAll(`${He}.sf-dropdown--open`).forEach(t=>{st(t,e.target)||xt(t)})}),document.__sfDropdownDocumentClickBound=!0),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>Tt()):Tt();new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{e instanceof Element&&(e.matches?.(He)&&Ot(e),Tt(e))}),e.removedNodes.forEach(e=>{e instanceof Element&&!e.isConnected&&(e.matches?.(He)&&Pt(e),e.querySelectorAll?.(He).forEach(Pt))})})}).observe(document.documentElement,{childList:!0,subtree:!0})})();
@@ -105,6 +105,7 @@
105
105
  "smart.empty-state",
106
106
  "smart.file-preview",
107
107
  "smart.file-upload",
108
+ "smart.help-mark",
108
109
  "smart.icon-buttons",
109
110
  "smart.icons",
110
111
  "smart.inputs",
@@ -165,6 +165,119 @@ function installIconSubsetRuntime(SFLoaderPlugin, {
165
165
  }
166
166
 
167
167
  return true;
168
+ }; // With the subset disabled the icons stylesheet draws from the full local
169
+ // font, and nothing ever marked an icon loaded: every readiness signal came
170
+ // from the subset path, so `.sf-icon:not(.sf-icon-loaded)` kept each icon at
171
+ // font-size 0 while the font sat loaded (ui-chat, 2026-10-22). An icon is
172
+ // loaded once the family it is drawn in is ready -- the same promise the
173
+ // subset path keeps, so the ligature text still never flashes.
174
+
175
+
176
+ const localIconFontFamilies = Object.freeze({
177
+ outlined: "Material Symbols Outlined",
178
+ rounded: "Material Symbols Rounded",
179
+ sharp: "Material Symbols Sharp"
180
+ });
181
+
182
+ SFLoaderPlugin.prototype.getLocalIconFontFaces = function (type = "") {
183
+ const family = localIconFontFamilies[this.normalizeIconType(type)] || localIconFontFamilies.outlined;
184
+ const faces = [];
185
+ document.fonts?.forEach?.(face => {
186
+ if (String(face.family || "").replace(/["']/g, "").trim() === family) {
187
+ faces.push(face);
188
+ }
189
+ });
190
+ return faces;
191
+ }; // Ready means a face of the family is declared and has loaded (or failed,
192
+ // which settles it too). A family that is not declared yet is not ready:
193
+ // the icons stylesheet arrives after the first scan, and asking the browser
194
+ // before it does answered «nothing to load» -- the ligature text then drew in
195
+ // a system font until the face arrived.
196
+
197
+
198
+ SFLoaderPlugin.prototype.isLocalIconFontReady = function (type = "") {
199
+ const normalizedType = this.normalizeIconType(type);
200
+ if (!this.localIconFontsReady) this.localIconFontsReady = new Set();
201
+ if (this.localIconFontsReady.has(normalizedType)) return true;
202
+ if (!document.fonts?.forEach) return true;
203
+ const settled = this.getLocalIconFontFaces(normalizedType).some(face => face.status === "loaded" || face.status === "error");
204
+
205
+ if (settled) {
206
+ this.localIconFontsReady.add(normalizedType);
207
+ return true;
208
+ }
209
+
210
+ this.waitForLocalIconFont(normalizedType);
211
+ return false;
212
+ };
213
+
214
+ SFLoaderPlugin.prototype.waitForLocalIconFont = function (type = "") {
215
+ const normalizedType = this.normalizeIconType(type);
216
+ if (!this.localIconFontWaits) this.localIconFontWaits = new Map();
217
+
218
+ if (this.localIconFontWaits.has(normalizedType)) {
219
+ return this.localIconFontWaits.get(normalizedType);
220
+ }
221
+
222
+ const fonts = document.fonts;
223
+ const wait = new Promise(resolve => {
224
+ let done = false;
225
+ let poll = 0;
226
+ let timer = 0;
227
+
228
+ const finish = () => {
229
+ if (done) return;
230
+ done = true;
231
+ clearInterval(poll);
232
+ clearTimeout(timer);
233
+ fonts.removeEventListener?.("loadingdone", check);
234
+ fonts.removeEventListener?.("loadingerror", check);
235
+ resolve();
236
+ };
237
+
238
+ const check = () => {
239
+ const faces = this.getLocalIconFontFaces(normalizedType);
240
+
241
+ if (faces.some(face => face.status === "loaded" || face.status === "error")) {
242
+ finish();
243
+ return;
244
+ } // An icon at font-size 0 may not make the browser fetch the face, so
245
+ // the face is asked for as soon as a stylesheet declares it.
246
+
247
+
248
+ faces.forEach(face => {
249
+ if (face.status === "unloaded") face.load().then(check, check);
250
+ });
251
+ };
252
+
253
+ fonts.addEventListener?.("loadingdone", check);
254
+ fonts.addEventListener?.("loadingerror", check); // A stylesheet that declares the face sends no font event; look for it.
255
+
256
+ poll = setInterval(check, 50); // A family no stylesheet ever declares (a rounded or sharp icon with no
257
+ // fallback face) still settles, the way subset-pending lifts on its
258
+ // timer: the icon then shows as it would with no Framework at all,
259
+ // instead of staying zero-sized for good.
260
+
261
+ timer = setTimeout(finish, 6000);
262
+ check();
263
+ }).then(() => {
264
+ this.localIconFontsReady.add(normalizedType);
265
+ this.iconFontReady = true;
266
+ document.body?.classList?.add("sf-icons-loaded");
267
+ this.syncStaticIconLoadedState();
268
+ window.dispatchEvent(new CustomEvent("sf-icons-subset:ready", {
269
+ detail: {
270
+ icons: new Set(),
271
+ all: true,
272
+ local: true,
273
+ types: [normalizedType],
274
+ loader: this
275
+ }
276
+ }));
277
+ return true;
278
+ });
279
+ this.localIconFontWaits.set(normalizedType, wait);
280
+ return wait;
168
281
  };
169
282
 
170
283
  SFLoaderPlugin.prototype.getDefaultIconType = function () {
@@ -608,6 +721,10 @@ function installIconSubsetRuntime(SFLoaderPlugin, {
608
721
 
609
722
  const loadAttrs = this.getIconLoadAttrs(tracked.attrs);
610
723
 
724
+ if (!this.isIconSubsetEnabled()) {
725
+ return this.isLocalIconFontReady(loadAttrs.type);
726
+ }
727
+
611
728
  if (this.isIconCoveredByManifest(tracked.icon, loadAttrs)) {
612
729
  return true;
613
730
  }
@@ -742,10 +859,16 @@ function installIconSubsetRuntime(SFLoaderPlugin, {
742
859
 
743
860
  SFLoaderPlugin.prototype.processStaticIconMutation = function (node, autoLoad = true) {
744
861
  if (!this.isIconSubsetEnabled()) {
745
- return {
862
+ const localIcon = this.getStaticIconElement(node);
863
+ if (!localIcon) return {
746
864
  handled: false,
747
865
  iconCount: 0
748
866
  };
867
+ this.syncStaticIconLoadedState(localIcon);
868
+ return {
869
+ handled: true,
870
+ iconCount: 0
871
+ };
749
872
  }
750
873
 
751
874
  const iconElement = this.getStaticIconElement(node);
@@ -786,7 +909,6 @@ function installIconSubsetRuntime(SFLoaderPlugin, {
786
909
  };
787
910
 
788
911
  SFLoaderPlugin.prototype.syncStaticIconLoadedState = function (root = null) {
789
- if (!this.isIconSubsetEnabled()) return;
790
912
  const host = root || document.body;
791
913
  if (!host) return;
792
914
 
@@ -835,21 +957,25 @@ function installIconSubsetRuntime(SFLoaderPlugin, {
835
957
  };
836
958
 
837
959
  SFLoaderPlugin.prototype.scanStaticIcons = function (root = null, autoLoad = true) {
838
- if (!this.isIconSubsetEnabled()) {
960
+ const host = root?.nodeType === Node.ELEMENT_NODE ? root : root?.parentElement || document.body;
961
+
962
+ if (!host) {
839
963
  return {
840
964
  iconCount: 0
841
965
  };
842
966
  }
843
967
 
844
- const host = root?.nodeType === Node.ELEMENT_NODE ? root : root?.parentElement || document.body;
845
-
846
- if (!host) {
968
+ if (this.shouldSkipNode(host)) {
847
969
  return {
848
970
  iconCount: 0
849
971
  };
850
972
  }
851
973
 
852
- if (this.shouldSkipNode(host)) {
974
+ if (!this.isIconSubsetEnabled()) {
975
+ // Ask for the default family now: an <sf-icon> drawn before this scan
976
+ // waits on the ready event this wait sends.
977
+ this.isLocalIconFontReady(this.getDefaultIconType());
978
+ this.syncStaticIconLoadedState(host);
853
979
  return {
854
980
  iconCount: 0
855
981
  };