@vonage/vivid 5.3.0 → 5.5.0
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.
- package/accordion-item/definition.js +1 -1
- package/alert/definition.cjs +1 -1
- package/alert/definition.js +2 -2
- package/badge/definition.js +1 -1
- package/banner/definition.js +1 -1
- package/bundled/base-color-picker.cjs +18 -13
- package/bundled/base-color-picker.js +98 -81
- package/bundled/calendar-picker.template.cjs +7 -7
- package/bundled/calendar-picker.template.js +102 -102
- package/bundled/char-count.cjs +1 -1
- package/bundled/char-count.js +1 -1
- package/bundled/definition10.cjs +1 -1
- package/bundled/definition10.js +2 -2
- package/bundled/definition11.cjs +12 -19
- package/bundled/definition11.js +87 -66
- package/bundled/definition12.cjs +19 -10
- package/bundled/definition12.js +217 -36
- package/bundled/definition13.cjs +10 -1
- package/bundled/definition13.js +38 -14
- package/bundled/definition14.cjs +1 -5
- package/bundled/definition14.js +15 -24
- package/bundled/definition15.cjs +5 -30
- package/bundled/definition15.js +22 -73
- package/bundled/definition16.cjs +30 -19
- package/bundled/definition16.js +74 -97
- package/bundled/definition17.cjs +19 -13
- package/bundled/definition17.js +83 -117
- package/bundled/definition18.cjs +13 -12
- package/bundled/definition18.js +114 -71
- package/bundled/definition19.cjs +26 -27
- package/bundled/definition19.js +171 -180
- package/bundled/definition2.cjs +9 -9
- package/bundled/definition2.js +84 -129
- package/bundled/definition3.cjs +1 -1
- package/bundled/definition3.js +1 -1
- package/bundled/definition6.cjs +3 -3
- package/bundled/definition6.js +19 -19
- package/bundled/definition9.cjs +5 -5
- package/bundled/definition9.js +394 -392
- package/bundled/listbox.cjs +1 -1
- package/bundled/listbox.js +82 -102
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +48 -31
- package/bundled/mixins.cjs +1 -1
- package/bundled/mixins.js +1 -1
- package/bundled/picker-field.template.cjs +14 -14
- package/bundled/picker-field.template.js +35 -56
- package/bundled/time-selection-picker.template.cjs +12 -12
- package/bundled/time-selection-picker.template.js +13 -12
- package/bundled/trapped-focus.cjs +1 -0
- package/bundled/trapped-focus.js +26 -0
- package/bundled/vivid-element.cjs +5 -1
- package/bundled/vivid-element.js +401 -358
- package/calendar/index.cjs +13 -13
- package/calendar/index.js +171 -143
- package/card/definition.cjs +1 -1
- package/card/definition.js +1 -1
- package/color-picker/definition.cjs +209 -113
- package/color-picker/definition.js +209 -113
- package/color-picker/index.cjs +104 -75
- package/color-picker/index.js +412 -326
- package/combobox/definition.cjs +7 -27
- package/combobox/definition.js +8 -28
- package/combobox/index.cjs +6 -6
- package/combobox/index.js +57 -71
- package/contextual-help/index.cjs +1 -1
- package/contextual-help/index.js +1 -1
- package/custom-elements.json +354 -2
- package/data-grid/index.cjs +1 -1
- package/data-grid/index.js +1 -1
- package/date-picker/definition.cjs +1 -1
- package/date-picker/definition.js +1 -1
- package/date-picker/index.cjs +1 -1
- package/date-picker/index.js +2 -2
- package/date-range-picker/definition.cjs +1 -1
- package/date-range-picker/definition.js +1 -1
- package/date-range-picker/index.cjs +1 -1
- package/date-range-picker/index.js +2 -2
- package/date-time-picker/definition.cjs +1 -1
- package/date-time-picker/definition.js +1 -1
- package/date-time-picker/index.cjs +1 -1
- package/date-time-picker/index.js +2 -2
- package/dial-pad/definition.cjs +139 -0
- package/dial-pad/definition.js +139 -0
- package/dial-pad/index.cjs +27 -20
- package/dial-pad/index.js +177 -100
- package/dialog/definition.cjs +2 -2
- package/dialog/definition.js +2 -2
- package/dialog/index.cjs +7 -7
- package/dialog/index.js +6 -6
- package/divider/index.cjs +1 -1
- package/divider/index.js +1 -1
- package/elevation/definition.cjs +1 -1
- package/elevation/definition.js +1 -1
- package/fab/definition.js +1 -1
- package/header/definition.cjs +1 -1
- package/header/definition.js +1 -1
- package/icon/definition.cjs +56 -22
- package/icon/definition.js +56 -22
- package/index.cjs +3 -4
- package/index.js +2 -3
- package/lib/accordion/accordion.d.ts +1 -1
- package/lib/accordion/definition.d.ts +1 -1
- package/lib/audio-player/audio-player.d.ts +1 -1
- package/lib/color-picker/color-picker.d.ts +390 -12
- package/lib/color-picker/locale.d.ts +4 -0
- package/lib/combobox/combobox.d.ts +1 -0
- package/lib/combobox/combobox.options.d.ts +1 -1
- package/lib/date-picker/date-picker.d.ts +38 -38
- package/lib/date-range-picker/date-range-picker.d.ts +20 -20
- package/lib/date-time-picker/date-time-picker.d.ts +40 -40
- package/lib/dial-pad/dial-pad.d.ts +1 -0
- package/lib/divider/divider.d.ts +1 -1
- package/lib/icon/icon.d.ts +1 -0
- package/lib/menu-item/menu-item-role.d.ts +1 -1
- package/lib/popup/popup.d.ts +1 -1
- package/lib/searchable-select/locale.d.ts +4 -0
- package/lib/searchable-select/searchable-select.d.ts +3 -0
- package/lib/select/select.d.ts +3 -1
- package/lib/simple-color-picker/simple-color-picker.d.ts +2 -1
- package/lib/slider/slider.d.ts +1 -1
- package/lib/tabs/tabs.d.ts +2 -2
- package/lib/text-area/text-area.d.ts +1 -1
- package/lib/text-field/text-field.d.ts +1 -1
- package/lib/time-picker/time-picker.d.ts +20 -20
- package/locales/de-DE.cjs +20 -3
- package/locales/de-DE.js +20 -3
- package/locales/en-GB.cjs +21 -4
- package/locales/en-GB.js +21 -4
- package/locales/en-US.cjs +21 -4
- package/locales/en-US.js +21 -4
- package/locales/ja-JP.cjs +20 -3
- package/locales/ja-JP.js +20 -3
- package/locales/zh-CN.cjs +19 -2
- package/locales/zh-CN.js +19 -2
- package/menu/definition.cjs +4 -4
- package/menu/definition.js +4 -4
- package/nav-disclosure/definition.js +1 -1
- package/nav-item/definition.js +1 -1
- package/note/definition.js +1 -1
- package/number-field/definition.js +1 -1
- package/number-field/index.cjs +1 -1
- package/number-field/index.js +3 -3
- package/option/definition.cjs +6 -77
- package/option/definition.js +3 -78
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +31 -5
- package/popup/definition.cjs +2 -2
- package/popup/definition.js +2 -2
- package/progress-ring/index.cjs +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.cjs +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.cjs +1 -1
- package/radio-group/index.js +1 -1
- package/range-slider/definition.cjs +1 -1
- package/range-slider/definition.js +1 -1
- package/rich-text-editor/definition.cjs +2 -3
- package/rich-text-editor/definition.js +1 -2
- package/rich-text-editor/index.cjs +27 -27
- package/rich-text-editor/index.js +1209 -1199
- package/searchable-select/definition.cjs +103 -11
- package/searchable-select/definition.js +103 -11
- package/searchable-select/index.cjs +81 -69
- package/searchable-select/index.js +359 -273
- package/select/definition.cjs +30 -44
- package/select/definition.js +30 -44
- package/selectable-box/definition.cjs +1 -1
- package/selectable-box/definition.js +1 -1
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +2 -2
- package/shared/aria/aria-mixin.d.ts +1 -1
- package/shared/color-picker/base-color-picker.d.ts +2 -1
- package/shared/foundation/listbox/listbox.d.ts +4 -0
- package/shared/picker-field/mixins/calendar-picker.d.ts +10 -10
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +10 -10
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +20 -20
- package/shared/picker-field/mixins/single-date-picker.d.ts +28 -28
- package/shared/picker-field/mixins/single-value-picker.d.ts +8 -8
- package/shared/picker-field/mixins/time-selection-picker.d.ts +20 -20
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +20 -20
- package/simple-color-picker/definition.cjs +9 -7
- package/simple-color-picker/definition.js +9 -7
- package/simple-color-picker/index.cjs +6 -6
- package/simple-color-picker/index.js +41 -39
- package/slider/definition.cjs +1 -1
- package/slider/definition.js +1 -1
- package/split-button/definition.js +1 -1
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/tab/definition.js +1 -1
- package/tag/definition.cjs +34 -14
- package/tag/definition.js +35 -15
- package/tag/index.cjs +25 -12
- package/tag/index.js +64 -47
- package/tag-group/definition.cjs +1 -2
- package/tag-group/definition.js +1 -2
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +11 -12
- package/text-area/index.cjs +1 -1
- package/text-area/index.js +2 -2
- package/text-field/definition.js +1 -1
- package/time-picker/definition.cjs +1 -1
- package/time-picker/definition.js +1 -1
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +1 -1
- package/toggletip/definition.cjs +1 -1
- package/toggletip/definition.js +1 -1
- package/toggletip/index.cjs +1 -1
- package/toggletip/index.js +1 -1
- package/tooltip/definition.cjs +3 -3
- package/tooltip/definition.js +3 -3
- package/tooltip/index.cjs +1 -1
- package/tooltip/index.js +1 -1
- package/tree-item/definition.cjs +1 -1
- package/tree-item/definition.js +1 -1
- package/tree-view/definition.cjs +1 -1
- package/tree-view/definition.js +1 -1
- package/unbundled/affix.js +1 -1
- package/unbundled/base-color-picker.cjs +36 -18
- package/unbundled/base-color-picker.js +36 -18
- package/unbundled/calendar-picker.template.cjs +2 -2
- package/unbundled/calendar-picker.template.js +2 -2
- package/unbundled/definition.js +1 -1
- package/unbundled/definition2.js +1 -1
- package/unbundled/definition3.cjs +222 -141
- package/unbundled/definition3.js +220 -139
- package/unbundled/definition4.cjs +145 -235
- package/unbundled/definition4.js +143 -233
- package/unbundled/definition5.cjs +269 -27
- package/unbundled/definition5.js +267 -26
- package/unbundled/definition6.cjs +56 -0
- package/unbundled/definition6.js +52 -0
- package/unbundled/listbox.cjs +41 -63
- package/unbundled/listbox.js +39 -61
- package/unbundled/picker-field.template.cjs +3 -36
- package/unbundled/picker-field.template.js +3 -35
- package/unbundled/slider.template.cjs +1 -1
- package/unbundled/slider.template.js +1 -1
- package/unbundled/time-selection-picker.template.cjs +2 -1
- package/unbundled/time-selection-picker.template.js +2 -1
- package/unbundled/trapped-focus.cjs +37 -0
- package/unbundled/trapped-focus.js +34 -0
- package/unbundled/vivid-element.cjs +1 -1
- package/unbundled/vivid-element.js +1 -1
- package/video-player/definition.cjs +56 -16
- package/video-player/definition.js +56 -16
- package/video-player/index.cjs +36 -36
- package/video-player/index.js +2461 -2445
- package/visually-hidden/index.cjs +1 -1
- package/visually-hidden/index.js +1 -1
- package/vivid.api.json +285 -38
- package/bundled/_has.cjs +0 -1
- package/bundled/_has.js +0 -34
- package/bundled/option.cjs +0 -1
- package/bundled/option.js +0 -158
- package/unbundled/option.cjs +0 -217
- package/unbundled/option.js +0 -214
package/bundled/definition9.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"use strict";const Vt=require("./definition3.cjs"),Ht=require("./definition4.cjs"),S=require("./vivid-element.cjs"),ht=require("./ref.cjs"),Pt=require("./when.cjs"),Jt=require("./class-names.cjs"),Mt=["top","right","bottom","left"],At=["start","end"],Et=Mt.reduce((t,e)=>t.concat(e,e+"-"+At[0],e+"-"+At[1]),[]),N=Math.min,C=Math.max,ct=Math.round,lt=Math.floor,Y=t=>({x:t,y:t}),Qt={left:"right",right:"left",bottom:"top",top:"bottom"},Zt={start:"end",end:"start"};function te(t,e,n){return C(t,N(e,n))}function J(t,e){return typeof t=="function"?t(e):t}function _(t){return t.split("-")[0]}function M(t){return t.split("-")[1]}function ee(t){return t==="x"?"y":"x"}function wt(t){return t==="y"?"height":"width"}const ne=new Set(["top","bottom"]);function X(t){return ne.has(_(t))?"y":"x"}function vt(t){return ee(X(t))}function Nt(t,e,n){n===void 0&&(n=!1);const o=M(t),i=vt(t),r=wt(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=ft(s)),[s,ft(s)]}function oe(t){const e=ft(t);return[at(t),e,at(e)]}function at(t){return t.replace(/start|end/g,e=>Zt[e])}const Ct=["left","right"],St=["right","left"],ie=["top","bottom"],re=["bottom","top"];function se(t,e,n){switch(t){case"top":case"bottom":return n?e?St:Ct:e?Ct:St;case"left":case"right":return e?ie:re;default:return[]}}function le(t,e,n,o){const i=M(t);let r=se(_(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(at)))),r}function ft(t){return t.replace(/left|right|bottom|top/g,e=>Qt[e])}function ce(t){return{top:0,right:0,bottom:0,left:0,...t}}function yt(t){return typeof t!="number"?ce(t):{top:t,right:t,bottom:t,left:t}}function tt(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Tt(t,e,n){let{reference:o,floating:i}=t;const r=X(e),s=vt(e),l=wt(s),c=_(e),a=r==="y",p=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,d=o[l]/2-i[l]/2;let u;switch(c){case"top":u={x:p,y:o.y-i.height};break;case"bottom":u={x:p,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:f};break;case"left":u={x:o.x-i.width,y:f};break;default:u={x:o.x,y:o.y}}switch(M(e)){case"start":u[s]-=d*(n&&a?-1:1);break;case"end":u[s]+=d*(n&&a?-1:1);break}return u}const ae=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,l=r.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(e));let a=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:p,y:f}=Tt(a,o,c),d=o,u={},m=0;for(let h=0;h<l.length;h++){const{name:g,fn:w}=l[h],{x:y,y:x,data:R,reset:b}=await w({x:p,y:f,initialPlacement:o,placement:d,strategy:i,middlewareData:u,rects:a,platform:s,elements:{reference:t,floating:e}});p=y??p,f=x??f,u={...u,[g]:{...u[g],...R}},b&&m<=50&&(m++,typeof b=="object"&&(b.placement&&(d=b.placement),b.rects&&(a=b.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):b.rects),{x:p,y:f}=Tt(a,d,c)),h=-1)}return{x:p,y:f,placement:d,strategy:i,middlewareData:u}};async function it(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:s,elements:l,strategy:c}=t,{boundary:a="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:d=!1,padding:u=0}=J(e,t),m=yt(u),g=l[d?f==="floating"?"reference":"floating":f],w=tt(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(g)))==null||n?g:g.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:a,rootBoundary:p,strategy:c})),y=f==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,x=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),R=await(r.isElement==null?void 0:r.isElement(x))?await(r.getScale==null?void 0:r.getScale(x))||{x:1,y:1}:{x:1,y:1},b=tt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:x,strategy:c}):y);return{top:(w.top-b.top+m.top)/R.y,bottom:(b.bottom-w.bottom+m.bottom)/R.y,left:(w.left-b.left+m.left)/R.x,right:(b.right-w.right+m.right)/R.x}}const fe=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:s,elements:l,middlewareData:c}=e,{element:a,padding:p=0}=J(t,e)||{};if(a==null)return{};const f=yt(p),d={x:n,y:o},u=vt(i),m=wt(u),h=await s.getDimensions(a),g=u==="y",w=g?"top":"left",y=g?"bottom":"right",x=g?"clientHeight":"clientWidth",R=r.reference[m]+r.reference[u]-d[u]-r.floating[m],b=d[u]-r.reference[u],P=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a));let O=P?P[x]:0;(!O||!await(s.isElement==null?void 0:s.isElement(P)))&&(O=l.floating[x]||r.floating[m]);const B=R/2-b/2,T=O/2-h[m]/2-1,v=N(f[w],T),A=N(f[y],T),L=v,D=O-h[m]-A,E=O/2-h[m]/2+B,H=te(L,E,D),V=!c.arrow&&M(i)!=null&&E!==H&&r.reference[m]/2-(E<L?v:A)-h[m]/2<0,k=V?E<L?E-L:E-D:0;return{[u]:d[u]+k,data:{[u]:H,centerOffset:E-H-k,...V&&{alignmentOffset:k}},reset:V}}});function ue(t,e,n){return(t?[...n.filter(i=>M(i)===t),...n.filter(i=>M(i)!==t)]:n.filter(i=>_(i)===i)).filter(i=>t?M(i)===t||(e?at(i)!==i:!1):!0)}const pe=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:r,middlewareData:s,placement:l,platform:c,elements:a}=e,{crossAxis:p=!1,alignment:f,allowedPlacements:d=Et,autoAlignment:u=!0,...m}=J(t,e),h=f!==void 0||d===Et?ue(f||null,u,d):d,g=await it(e,m),w=((n=s.autoPlacement)==null?void 0:n.index)||0,y=h[w];if(y==null)return{};const x=Nt(y,r,await(c.isRTL==null?void 0:c.isRTL(a.floating)));if(l!==y)return{reset:{placement:h[0]}};const R=[g[_(y)],g[x[0]],g[x[1]]],b=[...((o=s.autoPlacement)==null?void 0:o.overflows)||[],{placement:y,overflows:R}],P=h[w+1];if(P)return{data:{index:w+1,overflows:b},reset:{placement:P}};const O=b.map(v=>{const A=M(v.placement);return[v.placement,A&&p?v.overflows.slice(0,2).reduce((L,D)=>L+D,0):v.overflows[0],v.overflows]}).sort((v,A)=>v[1]-A[1]),T=((i=O.filter(v=>v[2].slice(0,M(v[0])?2:3).every(A=>A<=0))[0])==null?void 0:i[0])||O[0][0];return T!==l?{data:{index:w+1,overflows:b},reset:{placement:T}}:{}}}},de=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:c,elements:a}=e,{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...g}=J(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const w=_(i),y=X(l),x=_(l)===l,R=await(c.isRTL==null?void 0:c.isRTL(a.floating)),b=d||(x||!h?[ft(l)]:oe(l)),P=m!=="none";!d&&P&&b.push(...le(l,h,m,R));const O=[l,...b],B=await it(e,g),T=[];let v=((o=r.flip)==null?void 0:o.overflows)||[];if(p&&T.push(B[w]),f){const E=Nt(i,s,R);T.push(B[E[0]],B[E[1]])}if(v=[...v,{placement:i,overflows:T}],!T.every(E=>E<=0)){var A,L;const E=(((A=r.flip)==null?void 0:A.index)||0)+1,H=O[E];if(H&&(!(f==="alignment"?y!==X(H):!1)||v.every($=>X($.placement)===y?$.overflows[0]>0:!0)))return{data:{index:E,overflows:v},reset:{placement:H}};let V=(L=v.filter(k=>k.overflows[0]<=0).sort((k,$)=>k.overflows[1]-$.overflows[1])[0])==null?void 0:L.placement;if(!V)switch(u){case"bestFit":{var D;const k=(D=v.filter($=>{if(P){const K=X($.placement);return K===y||K==="y"}return!0}).map($=>[$.placement,$.overflows.filter(K=>K>0).reduce((K,Gt)=>K+Gt,0)]).sort(($,K)=>$[1]-K[1])[0])==null?void 0:D[0];k&&(V=k);break}case"initialPlacement":V=l;break}if(i!==V)return{reset:{placement:V}}}return{}}}};function Lt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Dt(t){return Mt.some(e=>t[e]>=0)}const he=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=J(t,e);switch(o){case"referenceHidden":{const r=await it(e,{...i,elementContext:"reference"}),s=Lt(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Dt(s)}}}case"escaped":{const r=await it(e,{...i,altBoundary:!0}),s=Lt(r,n.floating);return{data:{escapedOffsets:s,escaped:Dt(s)}}}default:return{}}}}};function _t(t){const e=N(...t.map(r=>r.left)),n=N(...t.map(r=>r.top)),o=C(...t.map(r=>r.right)),i=C(...t.map(r=>r.bottom));return{x:e,y:n,width:o-e,height:i-n}}function me(t){const e=t.slice().sort((i,r)=>i.y-r.y),n=[];let o=null;for(let i=0;i<e.length;i++){const r=e[i];!o||r.y-o.y>o.height/2?n.push([r]):n[n.length-1].push(r),o=r}return n.map(i=>tt(_t(i)))}const ge=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:i,platform:r,strategy:s}=e,{padding:l=2,x:c,y:a}=J(t,e),p=Array.from(await(r.getClientRects==null?void 0:r.getClientRects(o.reference))||[]),f=me(p),d=tt(_t(p)),u=yt(l);function m(){if(f.length===2&&f[0].left>f[1].right&&c!=null&&a!=null)return f.find(g=>c>g.left-u.left&&c<g.right+u.right&&a>g.top-u.top&&a<g.bottom+u.bottom)||d;if(f.length>=2){if(X(n)==="y"){const v=f[0],A=f[f.length-1],L=_(n)==="top",D=v.top,E=A.bottom,H=L?v.left:A.left,V=L?v.right:A.right,k=V-H,$=E-D;return{top:D,bottom:E,left:H,right:V,width:k,height:$,x:H,y:D}}const g=_(n)==="left",w=C(...f.map(v=>v.right)),y=N(...f.map(v=>v.left)),x=f.filter(v=>g?v.left===y:v.right===w),R=x[0].top,b=x[x.length-1].bottom,P=y,O=w,B=O-P,T=b-R;return{top:R,bottom:b,left:P,right:O,width:B,height:T,x:P,y:R}}return d}const h=await r.getElementRects({reference:{getBoundingClientRect:m},floating:o.floating,strategy:s});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},we=new Set(["left","top"]);async function ve(t,e){const{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=_(n),l=M(n),c=X(n)==="y",a=we.has(s)?-1:1,p=r&&c?-1:1,f=J(e,t);let{mainAxis:d,crossAxis:u,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof m=="number"&&(u=l==="end"?m*-1:m),c?{x:u*p,y:d*a}:{x:d*a,y:u*p}}const ye=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:l}=e,c=await ve(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:i+c.x,y:r+c.y,data:{...c,placement:s}}}}},xe=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:r,platform:s,elements:l}=e,{apply:c=()=>{},...a}=J(t,e),p=await it(e,a),f=_(i),d=M(i),u=X(i)==="y",{width:m,height:h}=r.floating;let g,w;f==="top"||f==="bottom"?(g=f,w=d===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(w=f,g=d==="end"?"top":"bottom");const y=h-p.top-p.bottom,x=m-p.left-p.right,R=N(h-p[g],y),b=N(m-p[w],x),P=!e.middlewareData.shift;let O=R,B=b;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(B=x),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(O=y),P&&!d){const v=C(p.left,0),A=C(p.right,0),L=C(p.top,0),D=C(p.bottom,0);u?B=m-2*(v!==0||A!==0?v+A:C(p.left,p.right)):O=h-2*(L!==0||D!==0?L+D:C(p.top,p.bottom))}await c({...e,availableWidth:B,availableHeight:O});const T=await s.getDimensions(l.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function ut(){return typeof window<"u"}function nt(t){return Wt(t)?(t.nodeName||"").toLowerCase():"#document"}function F(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function I(t){var e;return(e=(Wt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Wt(t){return ut()?t instanceof Node||t instanceof F(t).Node:!1}function W(t){return ut()?t instanceof Element||t instanceof F(t).Element:!1}function q(t){return ut()?t instanceof HTMLElement||t instanceof F(t).HTMLElement:!1}function kt(t){return!ut()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof F(t).ShadowRoot}const be=new Set(["inline","contents"]);function st(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=z(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!be.has(i)}const Re=new Set(["table","td","th"]);function Oe(t){return Re.has(nt(t))}const Pe=[":popover-open",":modal"];function pt(t){return Pe.some(e=>{try{return t.matches(e)}catch{return!1}})}const Ae=["transform","translate","scale","rotate","perspective"],Ee=["transform","translate","scale","rotate","perspective","filter"],Ce=["paint","layout","strict","content"];function xt(t){const e=bt(),n=W(t)?z(t):t;return Ae.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Ee.some(o=>(n.willChange||"").includes(o))||Ce.some(o=>(n.contain||"").includes(o))}function Se(t){let e=G(t);for(;q(e)&&!et(e);){if(xt(e))return e;if(pt(e))return null;e=G(e)}return null}function bt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Te=new Set(["html","body","#document"]);function et(t){return Te.has(nt(t))}function z(t){return F(t).getComputedStyle(t)}function dt(t){return W(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function G(t){if(nt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||kt(t)&&t.host||I(t);return kt(e)?e.host:e}function zt(t){const e=G(t);return et(e)?t.ownerDocument?t.ownerDocument.body:t.body:q(e)&&st(e)?e:zt(e)}function rt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=zt(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=F(i);if(r){const l=gt(s);return e.concat(s,s.visualViewport||[],st(i)?i:[],l&&n?rt(l):[])}return e.concat(i,rt(i,[],n))}function gt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function jt(t){const e=z(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=q(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,l=ct(n)!==r||ct(o)!==s;return l&&(n=r,o=s),{width:n,height:o,$:l}}function Rt(t){return W(t)?t:t.contextElement}function Z(t){const e=Rt(t);if(!q(e))return Y(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=jt(e);let s=(r?ct(n.width):n.width)/o,l=(r?ct(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Le=Y(0);function Yt(t){const e=F(t);return!bt()||!e.visualViewport?Le:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function De(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==F(t)?!1:e}function Q(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=Rt(t);let s=Y(1);e&&(o?W(o)&&(s=Z(o)):s=Z(t));const l=De(r,n,o)?Yt(r):Y(0);let c=(i.left+l.x)/s.x,a=(i.top+l.y)/s.y,p=i.width/s.x,f=i.height/s.y;if(r){const d=F(r),u=o&&W(o)?F(o):o;let m=d,h=gt(m);for(;h&&o&&u!==m;){const g=Z(h),w=h.getBoundingClientRect(),y=z(h),x=w.left+(h.clientLeft+parseFloat(y.paddingLeft))*g.x,R=w.top+(h.clientTop+parseFloat(y.paddingTop))*g.y;c*=g.x,a*=g.y,p*=g.x,f*=g.y,c+=x,a+=R,m=F(h),h=gt(m)}}return tt({width:p,height:f,x:c,y:a})}function Ot(t,e){const n=dt(t).scrollLeft;return e?e.left+n:Q(I(t)).left+n}function qt(t,e,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),i=o.left+e.scrollLeft-(n?0:Ot(t,o)),r=o.top+e.scrollTop;return{x:i,y:r}}function ke(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r=i==="fixed",s=I(o),l=e?pt(e.floating):!1;if(o===s||l&&r)return n;let c={scrollLeft:0,scrollTop:0},a=Y(1);const p=Y(0),f=q(o);if((f||!f&&!r)&&((nt(o)!=="body"||st(s))&&(c=dt(o)),q(o))){const u=Q(o);a=Z(o),p.x=u.x+o.clientLeft,p.y=u.y+o.clientTop}const d=s&&!f&&!r?qt(s,c,!0):Y(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-c.scrollLeft*a.x+p.x+d.x,y:n.y*a.y-c.scrollTop*a.y+p.y+d.y}}function $e(t){return Array.from(t.getClientRects())}function Fe(t){const e=I(t),n=dt(t),o=t.ownerDocument.body,i=C(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=C(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+Ot(t);const l=-n.scrollTop;return z(o).direction==="rtl"&&(s+=C(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:l}}function Be(t,e){const n=F(t),o=I(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,l=0,c=0;if(i){r=i.width,s=i.height;const a=bt();(!a||a&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}return{width:r,height:s,x:l,y:c}}const Ve=new Set(["absolute","fixed"]);function He(t,e){const n=Q(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=q(t)?Z(t):Y(1),s=t.clientWidth*r.x,l=t.clientHeight*r.y,c=i*r.x,a=o*r.y;return{width:s,height:l,x:c,y:a}}function $t(t,e,n){let o;if(e==="viewport")o=Be(t,n);else if(e==="document")o=Fe(I(t));else if(W(e))o=He(e,n);else{const i=Yt(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return tt(o)}function It(t,e){const n=G(t);return n===e||!W(n)||et(n)?!1:z(n).position==="fixed"||It(n,e)}function Me(t,e){const n=e.get(t);if(n)return n;let o=rt(t,[],!1).filter(l=>W(l)&&nt(l)!=="body"),i=null;const r=z(t).position==="fixed";let s=r?G(t):t;for(;W(s)&&!et(s);){const l=z(s),c=xt(s);!c&&l.position==="fixed"&&(i=null),(r?!c&&!i:!c&&l.position==="static"&&!!i&&Ve.has(i.position)||st(s)&&!c&&It(t,s))?o=o.filter(p=>p!==s):i=l,s=G(s)}return e.set(t,o),o}function Ne(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=[...n==="clippingAncestors"?pt(e)?[]:Me(e,this._c):[].concat(n),o],l=s[0],c=s.reduce((a,p)=>{const f=$t(e,p,i);return a.top=C(f.top,a.top),a.right=N(f.right,a.right),a.bottom=N(f.bottom,a.bottom),a.left=C(f.left,a.left),a},$t(e,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function _e(t){const{width:e,height:n}=jt(t);return{width:e,height:n}}function We(t,e,n){const o=q(e),i=I(e),r=n==="fixed",s=Q(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const c=Y(0);function a(){c.x=Ot(i)}if(o||!o&&!r)if((nt(e)!=="body"||st(i))&&(l=dt(e)),o){const u=Q(e,!0,r,e);c.x=u.x+e.clientLeft,c.y=u.y+e.clientTop}else i&&a();r&&!o&&i&&a();const p=i&&!o&&!r?qt(i,l):Y(0),f=s.left+l.scrollLeft-c.x-p.x,d=s.top+l.scrollTop-c.y-p.y;return{x:f,y:d,width:s.width,height:s.height}}function mt(t){return z(t).position==="static"}function Ft(t,e){if(!q(t)||z(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return I(t)===n&&(n=n.ownerDocument.body),n}function Xt(t,e){const n=F(t);if(pt(t))return n;if(!q(t)){let i=G(t);for(;i&&!et(i);){if(W(i)&&!mt(i))return i;i=G(i)}return n}let o=Ft(t,e);for(;o&&Oe(o)&&mt(o);)o=Ft(o,e);return o&&et(o)&&mt(o)&&!xt(o)?n:o||Se(t)||n}const ze=async function(t){const e=this.getOffsetParent||Xt,n=this.getDimensions,o=await n(t.floating);return{reference:We(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function je(t){return z(t).direction==="rtl"}const Ye={convertOffsetParentRelativeRectToViewportRelativeRect:ke,getDocumentElement:I,getClippingRect:Ne,getOffsetParent:Xt,getElementRects:ze,getClientRects:$e,getDimensions:_e,getScale:Z,isElement:W,isRTL:je};function Ut(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function qe(t,e){let n=null,o;const i=I(t);function r(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),r();const a=t.getBoundingClientRect(),{left:p,top:f,width:d,height:u}=a;if(l||e(),!d||!u)return;const m=lt(f),h=lt(i.clientWidth-(p+d)),g=lt(i.clientHeight-(f+u)),w=lt(p),x={rootMargin:-m+"px "+-h+"px "+-g+"px "+-w+"px",threshold:C(0,N(1,c))||1};let R=!0;function b(P){const O=P[0].intersectionRatio;if(O!==c){if(!R)return s();O?s(!1,O):o=setTimeout(()=>{s(!1,1e-7)},1e3)}O===1&&!Ut(a,t.getBoundingClientRect())&&s(),R=!1}try{n=new IntersectionObserver(b,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,x)}n.observe(t)}return s(!0),r}function Ie(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,a=Rt(t),p=i||r?[...a?rt(a):[],...rt(e)]:[];p.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),r&&w.addEventListener("resize",n)});const f=a&&l?qe(a,n):null;let d=-1,u=null;s&&(u=new ResizeObserver(w=>{let[y]=w;y&&y.target===a&&u&&(u.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var x;(x=u)==null||x.observe(e)})),n()}),a&&!c&&u.observe(a),u.observe(e));let m,h=c?Q(t):null;c&&g();function g(){const w=Q(t);h&&!Ut(h,w)&&n(),h=w,m=requestAnimationFrame(g)}return n(),()=>{var w;p.forEach(y=>{i&&y.removeEventListener("scroll",n),r&&y.removeEventListener("resize",n)}),f?.(),(w=u)==null||w.disconnect(),u=null,c&&cancelAnimationFrame(m)}}const Xe=ye,Bt=pe,Ue=de,Ke=xe,Ge=he,Je=fe,Qe=ge,Ze=(t,e,n)=>{const o=new Map,i={platform:Ye,...n},r={...i.platform,_c:o};return ae(t,e,{...i,platform:r})};var tn=Object.defineProperty,U=(t,e,n,o)=>{for(var i=void 0,r=t.length-1,s;r>=0;r--)(s=t[r])&&(i=s(e,n,i)||i);return i&&tn(e,n,i),i};const ot={Flip:"flip",AutoPlacementHorizontal:"auto-placement-horizontal",AutoPlacementVertical:"auto-placement-vertical"},en={[ot.Flip]:Ue(),[ot.AutoPlacementHorizontal]:Bt({allowedPlacements:["bottom","top","bottom-start","bottom-end","top-start","top-end"]}),[ot.AutoPlacementVertical]:Bt({allowedPlacements:["left","right","left-start","left-end","right-start","right-end"]})};class j extends S.VividElement{constructor(){super(...arguments),this.open=!1,this.dismissible=!1,this.arrow=!1,this.alternate=!1,this.placementStrategy=ot.Flip,this.animationFrame=!1,this.strategy="fixed",this.offset=null,this.#i=()=>(this.#n=this.updatePosition(),this.#n)}get#r(){let e=[Qe(),en[this.placementStrategy],Ge(),Ke({apply({availableWidth:o,availableHeight:i,elements:r}){Object.assign(r.floating.style,{maxWidth:`${o}px`,maxHeight:`${i}px`})}})],n=this.offset??0;return this.arrow&&(n+=12,e=[...e,Je({element:this.arrowEl,padding:10})]),n>0&&e.unshift(Xe(n)),e}#o;openChanged(e,n){this.#e(),this.#t(),this.$emit(n?"vwc-popup:open":"vwc-popup:close")}animationFrameChanged(){this.#t()}anchorChanged(){this.#t()}strategyChanged(){this.#e()}connectedCallback(){super.connectedCallback(),this.#e(),this.#t()}disconnectedCallback(){super.disconnectedCallback(),this.#t()}#t(){this.#o?.(),this.open&&this.controlEl&&this.controlEl.classList.add("open"),this.anchorEl&&this.open&&this.popupEl&&(this.#o=Ie(this.anchorEl,this.popupEl,this.#i,{animationFrame:this.animationFrame}))}#e(){this.popupEl&&this.strategy==="fixed"&&(this.open?this.popupEl.showPopover():this.popupEl.hidePopover())}#n;#i;async updatePosition(){if(!this.open||!this.anchorEl)return;const e=await Ze(this.anchorEl,this.popupEl,{placement:this.placement,strategy:this.strategy,middleware:this.#r});this.#s(e),this.arrow&&this.#l(e)}#s(e){const{x:n,y:o}=e,{referenceHidden:i}=e.middlewareData.hide;Object.assign(this.popupEl.style,{left:`${n}px`,top:`${o}px`,visibility:i?"hidden":"visible"})}#l(e){const{x:n,y:o}=e.middlewareData.arrow,i={left:"calc(100% - 4px)",right:"-4px",top:"calc(100% - 4px)",bottom:"-4px"},r=e.placement.split("-")[0];Object.assign(this.arrowEl.style,{left:n?`${n}px`:i[r],top:o?`${o}px`:i[r]})}get anchorEl(){return this.anchor??null}show(){return this.open=!0,this.#n??Promise.resolve()}hide(){this.open=!1}}U([S.attr({mode:"boolean"})],j.prototype,"open");U([S.attr({mode:"boolean"})],j.prototype,"dismissible");U([S.attr({mode:"boolean"})],j.prototype,"arrow");U([S.attr({mode:"boolean"})],j.prototype,"alternate");U([S.attr({mode:"fromView"})],j.prototype,"placement");U([S.attr({mode:"boolean",attribute:"animation-frame"})],j.prototype,"animationFrame");U([S.attr({mode:"fromView"})],j.prototype,"strategy");U([S.attr({attribute:"offset",converter:S.nullableNumberConverter})],j.prototype,"offset");U([S.observable],j.prototype,"anchor");const nn=":host{display:var(--_popup-display, inline)}.control{border-radius:inherit;background:var(--vvd-color-surface-4dp);contain:layout}.control:not(.open){display:none}.popup-wrapper{white-space:initial;--scrollbar-track-color: transparent;--scrollbar-thumb-color: color-mix(in srgb, var(--vvd-color-neutral-950), transparent 70%)}.popup-wrapper{scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);scrollbar-width:thin}.popup-wrapper ::-webkit-scrollbar{width:4px}.popup-wrapper ::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.popup-wrapper ::-webkit-scrollbar-thumb{border:0;border-radius:4px;background-color:var(--scrollbar-fallback-track-color, var(--scrollbar-thumb-color))}.popup-wrapper{z-index:var(--_popup-z-index, 10);overflow:visible;padding:0;border:none;border-radius:8px;margin:0;inline-size:max-content}.popup-wrapper:not(.absolute){position:fixed}.popup-wrapper.absolute{position:absolute;top:0;left:0}.popup-content{display:grid;color:var(--vvd-color-canvas-text)}.dismissible .popup-content{align-content:start;grid-template-columns:1fr auto}.arrow{position:absolute;z-index:-1;width:8px;height:8px;background:var(--vvd-color-surface-4dp);transform:rotate(45deg)}.dismissible-button{align-self:flex-start;margin-block-start:4px;margin-inline-end:4px}",on=({open:t,dismissible:e,alternate:n})=>Jt.classNames("control",["open",!!t],["dismissible",!!e],["alternate",!!n]);function rn(t){return t.strategy&&t.strategy==="fixed"?"manual":null}const sn=t=>{const e=t.tagFor(Ht.Elevation),n=t.tagFor(Vt.Button);return S.html`
|
|
1
|
+
"use strict";const Vt=require("./definition3.cjs"),Wt=require("./definition4.cjs"),S=require("./vivid-element.cjs"),mt=require("./ref.cjs"),Pt=require("./when.cjs"),Qt=require("./class-names.cjs"),Ht=["top","right","bottom","left"],At=["start","end"],Ct=Ht.reduce((t,e)=>t.concat(e,e+"-"+At[0],e+"-"+At[1]),[]),H=Math.min,E=Math.max,ct=Math.round,lt=Math.floor,X=t=>({x:t,y:t}),Zt={left:"right",right:"left",bottom:"top",top:"bottom"},te={start:"end",end:"start"};function ee(t,e,n){return E(t,H(e,n))}function J(t,e){return typeof t=="function"?t(e):t}function _(t){return t.split("-")[0]}function W(t){return t.split("-")[1]}function ne(t){return t==="x"?"y":"x"}function bt(t){return t==="y"?"height":"width"}const oe=new Set(["top","bottom"]);function q(t){return oe.has(_(t))?"y":"x"}function yt(t){return ne(q(t))}function _t(t,e,n){n===void 0&&(n=!1);const o=W(t),i=yt(t),r=bt(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=ft(s)),[s,ft(s)]}function ie(t){const e=ft(t);return[at(t),e,at(e)]}function at(t){return t.replace(/start|end/g,e=>te[e])}const Et=["left","right"],St=["right","left"],re=["top","bottom"],se=["bottom","top"];function le(t,e,n){switch(t){case"top":case"bottom":return n?e?St:Et:e?Et:St;case"left":case"right":return e?re:se;default:return[]}}function ce(t,e,n,o){const i=W(t);let r=le(_(t),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),e&&(r=r.concat(r.map(at)))),r}function ft(t){return t.replace(/left|right|bottom|top/g,e=>Zt[e])}function ae(t){return{top:0,right:0,bottom:0,left:0,...t}}function vt(t){return typeof t!="number"?ae(t):{top:t,right:t,bottom:t,left:t}}function tt(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function Lt(t,e,n){let{reference:o,floating:i}=t;const r=q(e),s=yt(e),l=bt(s),c=_(e),a=r==="y",u=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,d=o[l]/2-i[l]/2;let p;switch(c){case"top":p={x:u,y:o.y-i.height};break;case"bottom":p={x:u,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:f};break;case"left":p={x:o.x-i.width,y:f};break;default:p={x:o.x,y:o.y}}switch(W(e)){case"start":p[s]-=d*(n&&a?-1:1);break;case"end":p[s]+=d*(n&&a?-1:1);break}return p}const fe=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,l=r.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(e));let a=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=Lt(a,o,c),d=o,p={},h=0;for(let m=0;m<l.length;m++){const{name:g,fn:w}=l[m],{x:y,y:v,data:R,reset:x}=await w({x:u,y:f,initialPlacement:o,placement:d,strategy:i,middlewareData:p,rects:a,platform:s,elements:{reference:t,floating:e}});u=y??u,f=v??f,p={...p,[g]:{...p[g],...R}},x&&h<=50&&(h++,typeof x=="object"&&(x.placement&&(d=x.placement),x.rects&&(a=x.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):x.rects),{x:u,y:f}=Lt(a,d,c)),m=-1)}return{x:u,y:f,placement:d,strategy:i,middlewareData:p}};async function it(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:s,elements:l,strategy:c}=t,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=J(e,t),h=vt(p),g=l[d?f==="floating"?"reference":"floating":f],w=tt(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(g)))==null||n?g:g.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(l.floating)),boundary:a,rootBoundary:u,strategy:c})),y=f==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,v=await(r.getOffsetParent==null?void 0:r.getOffsetParent(l.floating)),R=await(r.isElement==null?void 0:r.isElement(v))?await(r.getScale==null?void 0:r.getScale(v))||{x:1,y:1}:{x:1,y:1},x=tt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:v,strategy:c}):y);return{top:(w.top-x.top+h.top)/R.y,bottom:(x.bottom-w.bottom+h.bottom)/R.y,left:(w.left-x.left+h.left)/R.x,right:(x.right-w.right+h.right)/R.x}}const ue=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:i,rects:r,platform:s,elements:l,middlewareData:c}=e,{element:a,padding:u=0}=J(t,e)||{};if(a==null)return{};const f=vt(u),d={x:n,y:o},p=yt(i),h=bt(p),m=await s.getDimensions(a),g=p==="y",w=g?"top":"left",y=g?"bottom":"right",v=g?"clientHeight":"clientWidth",R=r.reference[h]+r.reference[p]-d[p]-r.floating[h],x=d[p]-r.reference[p],P=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a));let O=P?P[v]:0;(!O||!await(s.isElement==null?void 0:s.isElement(P)))&&(O=l.floating[v]||r.floating[h]);const B=R/2-x/2,L=O/2-m[h]/2-1,b=H(f[w],L),A=H(f[y],L),T=b,D=O-m[h]-A,C=O/2-m[h]/2+B,V=ee(T,C,D),M=!c.arrow&&W(i)!=null&&C!==V&&r.reference[h]/2-(C<T?b:A)-m[h]/2<0,$=M?C<T?C-T:C-D:0;return{[p]:d[p]+$,data:{[p]:V,centerOffset:C-V-$,...M&&{alignmentOffset:$}},reset:M}}});function pe(t,e,n){return(t?[...n.filter(i=>W(i)===t),...n.filter(i=>W(i)!==t)]:n.filter(i=>_(i)===i)).filter(i=>t?W(i)===t||(e?at(i)!==i:!1):!0)}const de=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,o,i;const{rects:r,middlewareData:s,placement:l,platform:c,elements:a}=e,{crossAxis:u=!1,alignment:f,allowedPlacements:d=Ct,autoAlignment:p=!0,...h}=J(t,e),m=f!==void 0||d===Ct?pe(f||null,p,d):d,g=await it(e,h),w=((n=s.autoPlacement)==null?void 0:n.index)||0,y=m[w];if(y==null)return{};const v=_t(y,r,await(c.isRTL==null?void 0:c.isRTL(a.floating)));if(l!==y)return{reset:{placement:m[0]}};const R=[g[_(y)],g[v[0]],g[v[1]]],x=[...((o=s.autoPlacement)==null?void 0:o.overflows)||[],{placement:y,overflows:R}],P=m[w+1];if(P)return{data:{index:w+1,overflows:x},reset:{placement:P}};const O=x.map(b=>{const A=W(b.placement);return[b.placement,A&&u?b.overflows.slice(0,2).reduce((T,D)=>T+D,0):b.overflows[0],b.overflows]}).sort((b,A)=>b[1]-A[1]),L=((i=O.filter(b=>b[2].slice(0,W(b[0])?2:3).every(A=>A<=0))[0])==null?void 0:i[0])||O[0][0];return L!==l?{data:{index:w+1,overflows:x},reset:{placement:L}}:{}}}},he=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:c,elements:a}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=J(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const w=_(i),y=q(l),v=_(l)===l,R=await(c.isRTL==null?void 0:c.isRTL(a.floating)),x=d||(v||!m?[ft(l)]:ie(l)),P=h!=="none";!d&&P&&x.push(...ce(l,m,h,R));const O=[l,...x],B=await it(e,g),L=[];let b=((o=r.flip)==null?void 0:o.overflows)||[];if(u&&L.push(B[w]),f){const C=_t(i,s,R);L.push(B[C[0]],B[C[1]])}if(b=[...b,{placement:i,overflows:L}],!L.every(C=>C<=0)){var A,T;const C=(((A=r.flip)==null?void 0:A.index)||0)+1,V=O[C];if(V&&(!(f==="alignment"?y!==q(V):!1)||b.every(k=>q(k.placement)===y?k.overflows[0]>0:!0)))return{data:{index:C,overflows:b},reset:{placement:V}};let M=(T=b.filter($=>$.overflows[0]<=0).sort(($,k)=>$.overflows[1]-k.overflows[1])[0])==null?void 0:T.placement;if(!M)switch(p){case"bestFit":{var D;const $=(D=b.filter(k=>{if(P){const K=q(k.placement);return K===y||K==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(K=>K>0).reduce((K,Jt)=>K+Jt,0)]).sort((k,K)=>k[1]-K[1])[0])==null?void 0:D[0];$&&(M=$);break}case"initialPlacement":M=l;break}if(i!==M)return{reset:{placement:M}}}return{}}}};function Tt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Dt(t){return Ht.some(e=>t[e]>=0)}const me=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:o="referenceHidden",...i}=J(t,e);switch(o){case"referenceHidden":{const r=await it(e,{...i,elementContext:"reference"}),s=Tt(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Dt(s)}}}case"escaped":{const r=await it(e,{...i,altBoundary:!0}),s=Tt(r,n.floating);return{data:{escapedOffsets:s,escaped:Dt(s)}}}default:return{}}}}};function Nt(t){const e=H(...t.map(r=>r.left)),n=H(...t.map(r=>r.top)),o=E(...t.map(r=>r.right)),i=E(...t.map(r=>r.bottom));return{x:e,y:n,width:o-e,height:i-n}}function ge(t){const e=t.slice().sort((i,r)=>i.y-r.y),n=[];let o=null;for(let i=0;i<e.length;i++){const r=e[i];!o||r.y-o.y>o.height/2?n.push([r]):n[n.length-1].push(r),o=r}return n.map(i=>tt(Nt(i)))}const we=function(t){return t===void 0&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:i,platform:r,strategy:s}=e,{padding:l=2,x:c,y:a}=J(t,e),u=Array.from(await(r.getClientRects==null?void 0:r.getClientRects(o.reference))||[]),f=ge(u),d=tt(Nt(u)),p=vt(l);function h(){if(f.length===2&&f[0].left>f[1].right&&c!=null&&a!=null)return f.find(g=>c>g.left-p.left&&c<g.right+p.right&&a>g.top-p.top&&a<g.bottom+p.bottom)||d;if(f.length>=2){if(q(n)==="y"){const b=f[0],A=f[f.length-1],T=_(n)==="top",D=b.top,C=A.bottom,V=T?b.left:A.left,M=T?b.right:A.right,$=M-V,k=C-D;return{top:D,bottom:C,left:V,right:M,width:$,height:k,x:V,y:D}}const g=_(n)==="left",w=E(...f.map(b=>b.right)),y=H(...f.map(b=>b.left)),v=f.filter(b=>g?b.left===y:b.right===w),R=v[0].top,x=v[v.length-1].bottom,P=y,O=w,B=O-P,L=x-R;return{top:R,bottom:x,left:P,right:O,width:B,height:L,x:P,y:R}}return d}const m=await r.getElementRects({reference:{getBoundingClientRect:h},floating:o.floating,strategy:s});return i.reference.x!==m.reference.x||i.reference.y!==m.reference.y||i.reference.width!==m.reference.width||i.reference.height!==m.reference.height?{reset:{rects:m}}:{}}}},be=new Set(["left","top"]);async function ye(t,e){const{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=_(n),l=W(n),c=q(n)==="y",a=be.has(s)?-1:1,u=r&&c?-1:1,f=J(e,t);let{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof h=="number"&&(p=l==="end"?h*-1:h),c?{x:p*u,y:d*a}:{x:d*a,y:p*u}}const ve=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:l}=e,c=await ye(e,t);return s===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:i+c.x,y:r+c.y,data:{...c,placement:s}}}}},xe=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:r,platform:s,elements:l}=e,{apply:c=()=>{},...a}=J(t,e),u=await it(e,a),f=_(i),d=W(i),p=q(i)==="y",{width:h,height:m}=r.floating;let g,w;f==="top"||f==="bottom"?(g=f,w=d===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(w=f,g=d==="end"?"top":"bottom");const y=m-u.top-u.bottom,v=h-u.left-u.right,R=H(m-u[g],y),x=H(h-u[w],v),P=!e.middlewareData.shift;let O=R,B=x;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(B=v),(o=e.middlewareData.shift)!=null&&o.enabled.y&&(O=y),P&&!d){const b=E(u.left,0),A=E(u.right,0),T=E(u.top,0),D=E(u.bottom,0);p?B=h-2*(b!==0||A!==0?b+A:E(u.left,u.right)):O=m-2*(T!==0||D!==0?T+D:E(u.top,u.bottom))}await c({...e,availableWidth:B,availableHeight:O});const L=await s.getDimensions(l.floating);return h!==L.width||m!==L.height?{reset:{rects:!0}}:{}}}};function ut(){return typeof window<"u"}function nt(t){return zt(t)?(t.nodeName||"").toLowerCase():"#document"}function F(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Y(t){var e;return(e=(zt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function zt(t){return ut()?t instanceof Node||t instanceof F(t).Node:!1}function N(t){return ut()?t instanceof Element||t instanceof F(t).Element:!1}function I(t){return ut()?t instanceof HTMLElement||t instanceof F(t).HTMLElement:!1}function $t(t){return!ut()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof F(t).ShadowRoot}const Re=new Set(["inline","contents"]);function st(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=z(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!Re.has(i)}const Oe=new Set(["table","td","th"]);function Pe(t){return Oe.has(nt(t))}const Ae=[":popover-open",":modal"];function pt(t){return Ae.some(e=>{try{return t.matches(e)}catch{return!1}})}const Ce=["transform","translate","scale","rotate","perspective"],Ee=["transform","translate","scale","rotate","perspective","filter"],Se=["paint","layout","strict","content"];function xt(t){const e=Rt(),n=N(t)?z(t):t;return Ce.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||Ee.some(o=>(n.willChange||"").includes(o))||Se.some(o=>(n.contain||"").includes(o))}function Le(t){let e=G(t);for(;I(e)&&!et(e);){if(xt(e))return e;if(pt(e))return null;e=G(e)}return null}function Rt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Te=new Set(["html","body","#document"]);function et(t){return Te.has(nt(t))}function z(t){return F(t).getComputedStyle(t)}function dt(t){return N(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function G(t){if(nt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||$t(t)&&t.host||Y(t);return $t(e)?e.host:e}function jt(t){const e=G(t);return et(e)?t.ownerDocument?t.ownerDocument.body:t.body:I(e)&&st(e)?e:jt(e)}function rt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=jt(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),s=F(i);if(r){const l=wt(s);return e.concat(s,s.visualViewport||[],st(i)?i:[],l&&n?rt(l):[])}return e.concat(i,rt(i,[],n))}function wt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Xt(t){const e=z(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=I(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,l=ct(n)!==r||ct(o)!==s;return l&&(n=r,o=s),{width:n,height:o,$:l}}function Ot(t){return N(t)?t:t.contextElement}function Z(t){const e=Ot(t);if(!I(e))return X(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=Xt(e);let s=(r?ct(n.width):n.width)/o,l=(r?ct(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const De=X(0);function It(t){const e=F(t);return!Rt()||!e.visualViewport?De:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function $e(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==F(t)?!1:e}function Q(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=Ot(t);let s=X(1);e&&(o?N(o)&&(s=Z(o)):s=Z(t));const l=$e(r,n,o)?It(r):X(0);let c=(i.left+l.x)/s.x,a=(i.top+l.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(r){const d=F(r),p=o&&N(o)?F(o):o;let h=d,m=wt(h);for(;m&&o&&p!==h;){const g=Z(m),w=m.getBoundingClientRect(),y=z(m),v=w.left+(m.clientLeft+parseFloat(y.paddingLeft))*g.x,R=w.top+(m.clientTop+parseFloat(y.paddingTop))*g.y;c*=g.x,a*=g.y,u*=g.x,f*=g.y,c+=v,a+=R,h=F(m),m=wt(h)}}return tt({width:u,height:f,x:c,y:a})}function ht(t,e){const n=dt(t).scrollLeft;return e?e.left+n:Q(Y(t)).left+n}function Yt(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-ht(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function ke(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r=i==="fixed",s=Y(o),l=e?pt(e.floating):!1;if(o===s||l&&r)return n;let c={scrollLeft:0,scrollTop:0},a=X(1);const u=X(0),f=I(o);if((f||!f&&!r)&&((nt(o)!=="body"||st(s))&&(c=dt(o)),I(o))){const p=Q(o);a=Z(o),u.x=p.x+o.clientLeft,u.y=p.y+o.clientTop}const d=s&&!f&&!r?Yt(s,c):X(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-c.scrollLeft*a.x+u.x+d.x,y:n.y*a.y-c.scrollTop*a.y+u.y+d.y}}function Fe(t){return Array.from(t.getClientRects())}function Be(t){const e=Y(t),n=dt(t),o=t.ownerDocument.body,i=E(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=E(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+ht(t);const l=-n.scrollTop;return z(o).direction==="rtl"&&(s+=E(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:l}}const kt=25;function Me(t,e){const n=F(t),o=Y(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,l=0,c=0;if(i){r=i.width,s=i.height;const u=Rt();(!u||u&&e==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}const a=ht(o);if(a<=0){const u=o.ownerDocument,f=u.body,d=getComputedStyle(f),p=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,h=Math.abs(o.clientWidth-f.clientWidth-p);h<=kt&&(r-=h)}else a<=kt&&(r+=a);return{width:r,height:s,x:l,y:c}}const Ve=new Set(["absolute","fixed"]);function We(t,e){const n=Q(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=I(t)?Z(t):X(1),s=t.clientWidth*r.x,l=t.clientHeight*r.y,c=i*r.x,a=o*r.y;return{width:s,height:l,x:c,y:a}}function Ft(t,e,n){let o;if(e==="viewport")o=Me(t,n);else if(e==="document")o=Be(Y(t));else if(N(e))o=We(e,n);else{const i=It(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return tt(o)}function qt(t,e){const n=G(t);return n===e||!N(n)||et(n)?!1:z(n).position==="fixed"||qt(n,e)}function He(t,e){const n=e.get(t);if(n)return n;let o=rt(t,[],!1).filter(l=>N(l)&&nt(l)!=="body"),i=null;const r=z(t).position==="fixed";let s=r?G(t):t;for(;N(s)&&!et(s);){const l=z(s),c=xt(s);!c&&l.position==="fixed"&&(i=null),(r?!c&&!i:!c&&l.position==="static"&&!!i&&Ve.has(i.position)||st(s)&&!c&&qt(t,s))?o=o.filter(u=>u!==s):i=l,s=G(s)}return e.set(t,o),o}function _e(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const s=[...n==="clippingAncestors"?pt(e)?[]:He(e,this._c):[].concat(n),o],l=s[0],c=s.reduce((a,u)=>{const f=Ft(e,u,i);return a.top=E(f.top,a.top),a.right=H(f.right,a.right),a.bottom=H(f.bottom,a.bottom),a.left=E(f.left,a.left),a},Ft(e,l,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Ne(t){const{width:e,height:n}=Xt(t);return{width:e,height:n}}function ze(t,e,n){const o=I(e),i=Y(e),r=n==="fixed",s=Q(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const c=X(0);function a(){c.x=ht(i)}if(o||!o&&!r)if((nt(e)!=="body"||st(i))&&(l=dt(e)),o){const p=Q(e,!0,r,e);c.x=p.x+e.clientLeft,c.y=p.y+e.clientTop}else i&&a();r&&!o&&i&&a();const u=i&&!o&&!r?Yt(i,l):X(0),f=s.left+l.scrollLeft-c.x-u.x,d=s.top+l.scrollTop-c.y-u.y;return{x:f,y:d,width:s.width,height:s.height}}function gt(t){return z(t).position==="static"}function Bt(t,e){if(!I(t)||z(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Y(t)===n&&(n=n.ownerDocument.body),n}function Ut(t,e){const n=F(t);if(pt(t))return n;if(!I(t)){let i=G(t);for(;i&&!et(i);){if(N(i)&&!gt(i))return i;i=G(i)}return n}let o=Bt(t,e);for(;o&&Pe(o)&>(o);)o=Bt(o,e);return o&&et(o)&>(o)&&!xt(o)?n:o||Le(t)||n}const je=async function(t){const e=this.getOffsetParent||Ut,n=this.getDimensions,o=await n(t.floating);return{reference:ze(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Xe(t){return z(t).direction==="rtl"}const Ie={convertOffsetParentRelativeRectToViewportRelativeRect:ke,getDocumentElement:Y,getClippingRect:_e,getOffsetParent:Ut,getElementRects:je,getClientRects:Fe,getDimensions:Ne,getScale:Z,isElement:N,isRTL:Xe};function Kt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Ye(t,e){let n=null,o;const i=Y(t);function r(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function s(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),r();const a=t.getBoundingClientRect(),{left:u,top:f,width:d,height:p}=a;if(l||e(),!d||!p)return;const h=lt(f),m=lt(i.clientWidth-(u+d)),g=lt(i.clientHeight-(f+p)),w=lt(u),v={rootMargin:-h+"px "+-m+"px "+-g+"px "+-w+"px",threshold:E(0,H(1,c))||1};let R=!0;function x(P){const O=P[0].intersectionRatio;if(O!==c){if(!R)return s();O?s(!1,O):o=setTimeout(()=>{s(!1,1e-7)},1e3)}O===1&&!Kt(a,t.getBoundingClientRect())&&s(),R=!1}try{n=new IntersectionObserver(x,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,v)}n.observe(t)}return s(!0),r}function qe(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,a=Ot(t),u=i||r?[...a?rt(a):[],...rt(e)]:[];u.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),r&&w.addEventListener("resize",n)});const f=a&&l?Ye(a,n):null;let d=-1,p=null;s&&(p=new ResizeObserver(w=>{let[y]=w;y&&y.target===a&&p&&(p.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var v;(v=p)==null||v.observe(e)})),n()}),a&&!c&&p.observe(a),p.observe(e));let h,m=c?Q(t):null;c&&g();function g(){const w=Q(t);m&&!Kt(m,w)&&n(),m=w,h=requestAnimationFrame(g)}return n(),()=>{var w;u.forEach(y=>{i&&y.removeEventListener("scroll",n),r&&y.removeEventListener("resize",n)}),f?.(),(w=p)==null||w.disconnect(),p=null,c&&cancelAnimationFrame(h)}}const Ue=ve,Mt=de,Ke=he,Ge=xe,Je=me,Qe=ue,Ze=we,tn=(t,e,n)=>{const o=new Map,i={platform:Ie,...n},r={...i.platform,_c:o};return fe(t,e,{...i,platform:r})};var en=Object.defineProperty,U=(t,e,n,o)=>{for(var i=void 0,r=t.length-1,s;r>=0;r--)(s=t[r])&&(i=s(e,n,i)||i);return i&&en(e,n,i),i};const ot={Flip:"flip",AutoPlacementHorizontal:"auto-placement-horizontal",AutoPlacementVertical:"auto-placement-vertical"},nn={[ot.Flip]:Ke(),[ot.AutoPlacementHorizontal]:Mt({allowedPlacements:["bottom","top","bottom-start","bottom-end","top-start","top-end"]}),[ot.AutoPlacementVertical]:Mt({allowedPlacements:["left","right","left-start","left-end","right-start","right-end"]})};class j extends S.VividElement{constructor(){super(...arguments),this.open=!1,this.dismissible=!1,this.arrow=!1,this.alternate=!1,this.placementStrategy=ot.Flip,this.animationFrame=!1,this.strategy="fixed",this.offset=null,this.#i=()=>(this.#n=this.updatePosition(),this.#n)}get#r(){let e=[Ze(),nn[this.placementStrategy],Je(),Ge({apply({availableWidth:o,availableHeight:i,elements:r}){Object.assign(r.floating.style,{maxWidth:`${o}px`,maxHeight:`${i}px`})}})],n=this.offset??0;return this.arrow&&(n+=12,e=[...e,Qe({element:this.arrowEl,padding:10})]),n>0&&e.unshift(Ue(n)),e}#o;openChanged(e,n){this.#e(),this.#t(),this.$emit(n?"vwc-popup:open":"vwc-popup:close")}animationFrameChanged(){this.#t()}anchorChanged(){this.#t()}strategyChanged(){this.#e()}connectedCallback(){super.connectedCallback(),this.#e(),this.#t()}disconnectedCallback(){super.disconnectedCallback(),this.#t()}#t(){this.#o?.(),this.open&&this.controlEl&&this.controlEl.classList.add("open"),this.anchorEl&&this.open&&this.popupEl&&(this.#o=qe(this.anchorEl,this.popupEl,this.#i,{animationFrame:this.animationFrame}))}#e(){this.popupEl&&this.strategy==="fixed"&&(this.open?this.popupEl.showPopover():this.popupEl.hidePopover())}#n;#i;async updatePosition(){if(!this.open||!this.anchorEl)return;const e=await tn(this.anchorEl,this.popupEl,{placement:this.placement,strategy:this.strategy,middleware:this.#r});this.#s(e),this.arrow&&this.#l(e)}#s(e){const{x:n,y:o}=e,{referenceHidden:i}=e.middlewareData.hide;Object.assign(this.popupEl.style,{left:`${n}px`,top:`${o}px`,visibility:i?"hidden":"visible"})}#l(e){const{x:n,y:o}=e.middlewareData.arrow,i={left:"calc(100% - 4px)",right:"-4px",top:"calc(100% - 4px)",bottom:"-4px"},r=e.placement.split("-")[0];Object.assign(this.arrowEl.style,{left:n?`${n}px`:i[r],top:o?`${o}px`:i[r]})}get anchorEl(){return this.anchor??null}show(){return this.open=!0,this.#n??Promise.resolve()}hide(){this.open=!1}}U([S.attr({mode:"boolean"})],j.prototype,"open");U([S.attr({mode:"boolean"})],j.prototype,"dismissible");U([S.attr({mode:"boolean"})],j.prototype,"arrow");U([S.attr({mode:"boolean"})],j.prototype,"alternate");U([S.attr({mode:"fromView"})],j.prototype,"placement");U([S.attr({mode:"boolean",attribute:"animation-frame"})],j.prototype,"animationFrame");U([S.attr({mode:"fromView"})],j.prototype,"strategy");U([S.attr({attribute:"offset",converter:S.nullableNumberConverter})],j.prototype,"offset");U([S.observable],j.prototype,"anchor");const on=":host{display:var(--_popup-display, inline)}.control{border-radius:inherit;background:var(--vvd-color-surface-4dp);contain:layout}.control:not(.open){display:none}.popup-wrapper{white-space:initial;--scrollbar-track-color: transparent;--scrollbar-thumb-color: color-mix(in srgb, var(--vvd-color-neutral-950), transparent 70%)}.popup-wrapper{scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);scrollbar-width:thin}.popup-wrapper ::-webkit-scrollbar{width:4px}.popup-wrapper ::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.popup-wrapper ::-webkit-scrollbar-thumb{border:0;border-radius:4px;background-color:var(--scrollbar-fallback-track-color, var(--scrollbar-thumb-color))}.popup-wrapper{z-index:var(--_popup-z-index, 10);overflow:visible;padding:0;border:none;border-radius:8px;margin:0;inline-size:max-content}.popup-wrapper:not(.absolute){position:fixed}.popup-wrapper.absolute{position:absolute;top:0;left:0}.popup-content{display:grid;color:var(--vvd-color-canvas-text)}.dismissible .popup-content{align-content:start;grid-template-columns:1fr auto}.arrow{position:absolute;z-index:-1;width:8px;height:8px;background:var(--vvd-color-surface-4dp);transform:rotate(45deg)}.dismissible-button{align-self:flex-start;margin-block-start:4px;margin-inline-end:4px}",rn=({open:t,dismissible:e,alternate:n})=>Qt.classNames("control",["open",!!t],["dismissible",!!e],["alternate",!!n]);function sn(t){return t.strategy&&t.strategy==="fixed"?"manual":null}const ln=t=>{const e=t.tagFor(Wt.Elevation),n=t.tagFor(Vt.Button);return S.html`
|
|
2
2
|
<${e}>
|
|
3
|
-
<div popover="${
|
|
4
|
-
<div ${
|
|
3
|
+
<div popover="${sn}" class="popup-wrapper ${o=>o.strategy}" ${mt.ref("popupEl")} part="popup-base">
|
|
4
|
+
<div ${mt.ref("controlEl")} class="${rn}" aria-hidden="${o=>o.open?"false":"true"}"
|
|
5
5
|
part="${o=>o.alternate?"vvd-theme-alternate":""}">
|
|
6
6
|
<div class="popup-content">
|
|
7
7
|
<slot></slot>
|
|
8
8
|
${Pt.when(o=>o.dismissible,S.html`<${n} size="condensed" @click="${o=>o.open=!1}"
|
|
9
9
|
class="dismissible-button" icon="close-small-solid" shape="pill"></${n}>`)}
|
|
10
10
|
</div>
|
|
11
|
-
${Pt.when(o=>o.arrow,S.html`<div class="arrow" ${
|
|
11
|
+
${Pt.when(o=>o.arrow,S.html`<div class="arrow" ${mt.ref("arrowEl")}></div>`)}
|
|
12
12
|
</div>
|
|
13
13
|
</div>
|
|
14
|
-
</${e}>`},
|
|
14
|
+
</${e}>`},Gt=S.defineVividComponent("popup",j,ln,[Wt.elevationDefinition,Vt.buttonDefinition],{styles:on}),cn=S.createRegisterFunction(Gt);exports.PlacementStrategy=ot;exports.Popup=j;exports.popupDefinition=Gt;exports.registerPopup=cn;
|