@vanelsas/baredom 2.3.1 → 2.4.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/CHANGELOG.md +18 -0
- package/README.md +3 -3
- package/dist/base.js +265 -264
- package/dist/integrity.json +98 -0
- package/dist/x-alert.js +17 -17
- package/dist/x-avatar-group.js +11 -11
- package/dist/x-avatar.js +14 -14
- package/dist/x-badge.js +11 -11
- package/dist/x-bento-grid.js +5 -5
- package/dist/x-bento-item.js +4 -4
- package/dist/x-breadcrumbs.js +14 -14
- package/dist/x-button.js +15 -15
- package/dist/x-cancel-dialogue.js +16 -16
- package/dist/x-card.js +7 -7
- package/dist/x-carousel.js +32 -32
- package/dist/x-chart.js +47 -47
- package/dist/x-checkbox.js +11 -11
- package/dist/x-chip.js +8 -8
- package/dist/x-collapse.js +10 -10
- package/dist/x-color-picker.js +42 -42
- package/dist/x-combobox.js +24 -24
- package/dist/x-command-palette.js +24 -24
- package/dist/x-container.js +6 -6
- package/dist/x-context-menu.js +18 -18
- package/dist/x-copy.js +22 -22
- package/dist/x-currency-field.js +22 -22
- package/dist/x-date-picker.js +37 -37
- package/dist/x-divider.js +8 -8
- package/dist/x-drawer.js +11 -11
- package/dist/x-dropdown.js +9 -9
- package/dist/x-fieldset.js +5 -5
- package/dist/x-file-download.js +7 -7
- package/dist/x-file-upload.js +26 -0
- package/dist/x-form-field.js +15 -15
- package/dist/x-form.js +10 -10
- package/dist/x-gaussian-blur.js +18 -18
- package/dist/x-grid.js +6 -6
- package/dist/x-icon.js +7 -7
- package/dist/x-image.js +18 -18
- package/dist/x-kinetic-font.js +28 -28
- package/dist/x-kinetic-typography.js +38 -38
- package/dist/x-liquid-dock.js +36 -36
- package/dist/x-liquid-fill.js +42 -42
- package/dist/x-liquid-glass.js +40 -40
- package/dist/x-menu-item.js +10 -10
- package/dist/x-menu.js +10 -10
- package/dist/x-metaball-cursor.js +27 -27
- package/dist/x-modal.js +11 -11
- package/dist/x-morph-stack.js +39 -39
- package/dist/x-navbar.js +13 -13
- package/dist/x-neural-glow.js +30 -30
- package/dist/x-notification-center.js +10 -10
- package/dist/x-organic-divider.js +16 -16
- package/dist/x-organic-progress.js +35 -35
- package/dist/x-organic-shape.js +12 -12
- package/dist/x-pagination.js +16 -16
- package/dist/x-particle-button.js +49 -49
- package/dist/x-popover.js +23 -23
- package/dist/x-progress-circle.js +8 -8
- package/dist/x-progress.js +8 -8
- package/dist/x-radio.js +11 -11
- package/dist/x-ripple-effect.js +11 -11
- package/dist/x-scroll-parallax.js +17 -17
- package/dist/x-scroll-stack.js +18 -18
- package/dist/x-scroll-story.js +34 -34
- package/dist/x-scroll-timeline.js +45 -45
- package/dist/x-scroll.js +40 -40
- package/dist/x-search-field.js +14 -14
- package/dist/x-select.js +9 -9
- package/dist/x-sidebar.js +16 -16
- package/dist/x-skeleton-group.js +13 -13
- package/dist/x-skeleton.js +1 -1
- package/dist/x-slider.js +16 -16
- package/dist/x-soft-body.js +20 -20
- package/dist/x-spacer.js +5 -5
- package/dist/x-spinner.js +5 -5
- package/dist/x-splash.js +13 -13
- package/dist/x-stat.js +11 -11
- package/dist/x-stepper.js +15 -15
- package/dist/x-switch.js +10 -10
- package/dist/x-tab.js +7 -7
- package/dist/x-table-cell.js +20 -20
- package/dist/x-table-row.js +10 -10
- package/dist/x-table.js +14 -14
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.js +17 -17
- package/dist/x-theme.js +25 -25
- package/dist/x-timeline-item.js +20 -21
- package/dist/x-timeline.js +9 -9
- package/dist/x-toast.js +22 -22
- package/dist/x-toaster.js +8 -8
- package/dist/x-tooltip.js +12 -12
- package/dist/x-typography.js +8 -8
- package/dist/x-welcome-tour.js +66 -0
- package/package.json +10 -2
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
e:g;var h=$APP.pc(a,d),l=$APP.M(h);h=$APP.D(l,$APP.
|
|
4
|
-
e+1),m=$APP.
|
|
2
|
+
var my=function(a){return typeof a==="string"?(a=parseFloat(a.trim()),$APP.n(isNaN(a))?.5:$APP.oh.i(0,$APP.sh.i(1,a))):.5},ny=function(a){return typeof a==="string"?(a=parseFloat(a.trim()),$APP.n(isNaN(a))?50:$APP.oh.i(1,$APP.sh.i(1E3,a))):50},oy=function(a,b){switch(a){case "alternating":return $APP.fd(b,2)===0?"left":"right";case "left":return"right";case "right":return"left";default:return"right"}},py=function(a,b){var c=$APP.z(a);if(c===0)return-1;for(var d=0,e=-1,g=-1;;){if(d>=c)return e>=0?
|
|
3
|
+
e:g;var h=$APP.pc(a,d),l=$APP.M(h);h=$APP.D(l,$APP.si);l=$APP.D(l,$APP.Kk);e=h<=b&&l>b?d:e;g=h<=b?d:g;d+=1}},qy=function(a,b,c){return b<=0?0:$APP.oh.i(0,$APP.sh.i(1,(c-a)/b))},sy=function(a,b,c){var d=$APP.z(a);if(d===0)return"";if($APP.B.i(d,1))return a=$APP.u(a),a=$APP.M(a),a=$APP.D(a,$APP.Il),"M "+$APP.T.g(c)+" "+$APP.T.g(a);var e=$APP.u(a),g=$APP.Il.g(e);e=0;for(g=new $APP.O(null,1,5,$APP.P,["M "+$APP.T.g(c)+" "+$APP.T.g(g)],null);;){if(e>=d-1)return $APP.Gg(g);var h=$APP.pc(a,e),l=$APP.pc(a,
|
|
4
|
+
e+1),m=$APP.Il.g(h),p=$APP.Il.g(l);h=ry.g(h);var q=ry.g(l);l=$APP.B.i(h,"left")?-b:b;q=$APP.B.i(q,"left")?-b:b;h=m+(p-m)*.33;q=c+q;m+=(p-m)*.66;var v=c;e+=1;g=$APP.ld.i(g,"C "+$APP.T.g(c+l)+" "+$APP.T.g(h)+" "+$APP.T.g(q)+" "+$APP.T.g(m)+" "+$APP.T.g(v)+" "+$APP.T.g(p))}},Ay=function(a){var b=$APP.k(a,"__xScrollTimelineRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),g=document.createElement("div"),
|
|
5
5
|
h=document.createElement("div"),l=document.createElementNS("http://www.w3.org/2000/svg","svg"),m=document.createElementNS("http://www.w3.org/2000/svg","path"),p=document.createElementNS("http://www.w3.org/2000/svg","path"),q=document.createElement("div"),v=document.createElement("slot"),x=document.createElement("div"),y=document.createElement("div");c.textContent=":host{display:block;position:relative;color-scheme:light dark;--x-scroll-timeline-track-color:rgba(0,0,0,0.12);--x-scroll-timeline-track-fill-color:var(--x-color-primary,#3b82f6);--x-scroll-timeline-track-width:3px;--x-scroll-timeline-marker-size:14px;--x-scroll-timeline-marker-color:rgba(0,0,0,0.15);--x-scroll-timeline-marker-active-color:var(--x-color-primary,#3b82f6);--x-scroll-timeline-marker-border-color:var(--x-color-primary,#3b82f6);--x-scroll-timeline-entry-gap:2rem;--x-scroll-timeline-date-color:rgba(0,0,0,0.5);--x-scroll-timeline-date-font-size:0.8125rem;--x-scroll-timeline-transition-duration:300ms;--x-scroll-timeline-curve-amplitude:60;--x-scroll-timeline-disabled-opacity:0.55;}@media (prefers-color-scheme:dark){:host{--x-scroll-timeline-track-color:rgba(255,255,255,0.12);--x-scroll-timeline-marker-color:rgba(255,255,255,0.18);--x-scroll-timeline-date-color:rgba(255,255,255,0.5);}}[part\x3dcontainer]{position:relative;padding:0;}[part\x3dtrack]{position:absolute;top:0;bottom:0;left:50%;transform:translateX(-50%);width:var(--x-scroll-timeline-track-width);pointer-events:none;z-index:1;}:host([data-layout\x3dleft]) [part\x3dtrack]{left:calc(var(--x-scroll-timeline-marker-size) / 2);transform:none;}:host([data-layout\x3dright]) [part\x3dtrack]{left:auto;right:calc(var(--x-scroll-timeline-marker-size) / 2);transform:none;}[part\x3dtrack-line]{position:absolute;top:0;bottom:0;left:0;right:0;background:var(--x-scroll-timeline-track-color);border-radius:999px;}[part\x3dtrack-fill]{position:absolute;top:0;left:0;right:0;height:0%;background:var(--x-scroll-timeline-track-fill-color);border-radius:999px;transition:height 60ms linear;}[part\x3dtrack-svg]{display:none;position:absolute;top:0;left:0;width:100%;height:100%;overflow:visible;pointer-events:none;z-index:1;}:host([data-track\x3dcurved]) [part\x3dtrack-line],:host([data-track\x3dcurved]) [part\x3dtrack-fill]{display:none;}:host([data-track\x3dcurved]) [part\x3dtrack-svg]{display:block;}[part\x3dtrack-path]{fill:none;stroke:var(--x-scroll-timeline-track-color);stroke-width:3px;stroke-linecap:round;}[part\x3dtrack-fill-path]{fill:none;stroke:var(--x-scroll-timeline-track-fill-color);stroke-width:3px;stroke-linecap:round;transition:stroke-dashoffset 60ms linear;}[part\x3dentries]{position:relative;z-index:2;}::slotted(*){display:block;margin-bottom:var(--x-scroll-timeline-entry-gap);opacity:0.4;transition:opacity var(--x-scroll-timeline-transition-duration) ease;}::slotted(:last-child){margin-bottom:0;}::slotted([data-active]){opacity:1;}:host([data-layout\x3dalternating]) ::slotted(*){width:calc(50% - var(--x-scroll-timeline-marker-size));}:host([data-layout\x3dalternating]) ::slotted([data-side\x3dleft]){margin-left:0;margin-right:auto;text-align:right;padding-right:1.5rem;}:host([data-layout\x3dalternating]) ::slotted([data-side\x3dright]){margin-left:auto;margin-right:0;text-align:left;padding-left:1.5rem;}:host([data-layout\x3dleft]) ::slotted(*){margin-left:calc(var(--x-scroll-timeline-marker-size) + 1.5rem);width:auto;}:host([data-layout\x3dright]) ::slotted(*){margin-right:calc(var(--x-scroll-timeline-marker-size) + 1.5rem);width:auto;text-align:right;}.tl-marker{position:absolute;z-index:3;width:var(--x-scroll-timeline-marker-size);height:var(--x-scroll-timeline-marker-size);border-radius:50%;background:var(--x-scroll-timeline-marker-color);border:2px solid transparent;transform:translate(-50%,-50%);transition:background var(--x-scroll-timeline-transition-duration) ease,border-color var(--x-scroll-timeline-transition-duration) ease,box-shadow var(--x-scroll-timeline-transition-duration) ease;}.tl-marker[data-active]{background:var(--x-scroll-timeline-marker-active-color);border-color:var(--x-scroll-timeline-marker-active-color);box-shadow:0 0 0 3px rgba(59,130,246,0.25);}:host([data-marker\x3dring]) .tl-marker{background:transparent;border:2px solid var(--x-scroll-timeline-marker-color);}:host([data-marker\x3dring]) .tl-marker[data-active]{background:var(--x-scroll-timeline-marker-active-color);border-color:var(--x-scroll-timeline-marker-active-color);}:host([data-marker\x3dnone]) .tl-marker{display:none;}.tl-marker{left:50%;}:host([data-layout\x3dleft]) .tl-marker{left:calc(var(--x-scroll-timeline-marker-size) / 2);}:host([data-layout\x3dright]) .tl-marker{left:auto;right:calc(var(--x-scroll-timeline-marker-size) / 2);transform:translate(50%,-50%);}.tl-date{position:absolute;z-index:3;font-size:var(--x-scroll-timeline-date-font-size);color:var(--x-scroll-timeline-date-color);white-space:nowrap;transform:translateY(-50%);transition:color var(--x-scroll-timeline-transition-duration) ease;}.tl-date[data-active]{color:var(--x-scroll-timeline-marker-active-color);font-weight:600;}:host([data-layout\x3dalternating]) .tl-date[data-side\x3dleft]{left:calc(50% + var(--x-scroll-timeline-marker-size));padding-left:0.5rem;}:host([data-layout\x3dalternating]) .tl-date[data-side\x3dright]{right:calc(50% + var(--x-scroll-timeline-marker-size));padding-right:0.5rem;text-align:right;}:host([data-layout\x3dleft]) .tl-date{left:calc(var(--x-scroll-timeline-marker-size) + 0.5rem);}:host([data-layout\x3dright]) .tl-date{right:calc(var(--x-scroll-timeline-marker-size) + 0.5rem);text-align:right;}:host([disabled]){opacity:var(--x-scroll-timeline-disabled-opacity);}[part\x3dlive]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;}[part\x3dindicator]{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);pointer-events:none;width:48px;height:48px;opacity:0.7;z-index:4;}[part\x3dindicator]::before,[part\x3dindicator]::after{content:'';position:absolute;top:8px;width:12px;height:32px;background:rgba(255,255,255,0.9);border-radius:3px;}[part\x3dindicator]::before{left:8px;}[part\x3dindicator]::after{right:8px;}:host([data-autoplay-paused][autoplay-indicator]) [part\x3dindicator]{display:block;}@media (pointer:coarse){:host{--x-scroll-timeline-marker-size:44px;}}@media (prefers-reduced-motion:reduce){::slotted(*){transition:none !important;}.tl-marker{transition:none !important;}.tl-date{transition:none !important;}[part\x3dtrack-fill]{transition:none !important;}[part\x3dtrack-fill-path]{transition:none !important;}}";
|
|
6
6
|
d.setAttribute("part","container");d.setAttribute("role","feed");e.setAttribute("part","track");g.setAttribute("part","track-line");h.setAttribute("part","track-fill");l.setAttribute("part","track-svg");l.setAttribute("aria-hidden","true");l.setAttribute("focusable","false");m.setAttribute("part","track-path");p.setAttribute("part","track-fill-path");p.setAttribute("pathLength","1");l.appendChild(m);l.appendChild(p);e.appendChild(g);e.appendChild(h);q.setAttribute("part","entries");q.appendChild(v);
|
|
7
|
-
x.setAttribute("part","indicator");d.appendChild(e);d.appendChild(q);d.appendChild(l);d.appendChild(x);y.setAttribute("part","live");y.setAttribute("aria-live","polite");y.setAttribute("aria-atomic","true");b.appendChild(c);b.appendChild(d);b.appendChild(y);b=$APP.zf([$APP.
|
|
8
|
-
|
|
9
|
-
$APP.
|
|
10
|
-
[p,g,c!=null,d!=null,m,e,q!=null,a!=null,h,b,l!=null])},
|
|
11
|
-
$APP.
|
|
12
|
-
var d=$APP.k(a,"__xScrollTimelineMarkerEls");d=$APP.n(d)?d:[];b=b.length;for(var e=d.length,g=0;;)if(g<e)d[g].remove(),g+=1;else break;d=Array(b);for(e=0;;)if(e<b)g=document.createElement("div"),g.classList.add("tl-marker"),c.appendChild(g),d[e]=g,e+=1;else break;a.__xScrollTimelineMarkerEls=d},
|
|
13
|
-
l.remove();h+=1}else break;e=Array(d);for(g=0;;)if(g<d)h=b[g].getAttribute("data-date"),typeof h==="string"&&$APP.N(h,"")?(l=document.createElement("span"),l.classList.add("tl-date"),l.textContent=h,c.appendChild(l),e[g]=l):e[g]=null,g+=1;else break;a.__xScrollTimelineDateEls=e},
|
|
14
|
-
$APP.
|
|
15
|
-
7:E/2}(),y=function(){switch(l){case "left":return x;case "right":return p-x;default:return p*.5}}(),A=b.length;if(A>0){var
|
|
16
|
-
|
|
17
|
-
e[d].removeAttribute("data-active"),c>=0&&c<e.length&&e[c].setAttribute("data-active",""));$APP.n(g)&&(d>=0&&d<g.length&&(e=g[d],$APP.n(e)&&e.removeAttribute("data-active")),c>=0&&c<g.length&&(g=g[c],$APP.n(g)&&g.setAttribute("data-active","")));c>=0?a.setAttribute("data-active-index",""+$APP.T.g(c)):a.removeAttribute("data-active-index");a.__xScrollTimelineActiveIndex=c;g=d>=0&&d<b.length
|
|
18
|
-
previousId:g});
|
|
19
|
-
{index:h,id:v,progress:m})):$APP.n($APP.n(q)?!l:q)&&(g[h]=!1,
|
|
20
|
-
l=
|
|
21
|
-
1);return($APP.
|
|
22
|
-
$APP.n(h)?$APP.r($APP.k(a,"__xScrollTimelineAutoplayPaused")):h):h}())){var e=$APP.k(a,"__xScrollTimelineModel");if($APP.n(function(){if($APP.n(e)){var h=$APP.
|
|
23
|
-
g,window.scrollTo(0,$APP.
|
|
24
|
-
return $APP.n(e)?e:0}();var c=function(){var e=$APP.k(a,"__xScrollTimelineActiveIndex");return $APP.n(e)?e:-1}(),d=
|
|
25
|
-
function(){var e=$APP.k(a,"__xScrollTimelineLastProg");return $APP.n(e)?e:0}(),c=function(){var e=$APP.k(a,"__xScrollTimelineActiveIndex");return $APP.n(e)?e:-1}(),d=
|
|
26
|
-
$APP.k(b,"pointerdown")),a.removeEventListener("pointerup",$APP.k(b,"pointerup")),a.removeEventListener("pointerleave",$APP.k(b,"pointerleave")),a.removeEventListener("keydown",$APP.k(b,"keydown")),a.removeEventListener("keyup",$APP.k(b,"keyup")),a.__xScrollTimelineAutoplayHandlers=null);a.removeAttribute("data-autoplay-paused");a.removeAttribute("tabindex");a.__xScrollTimelineAutoplayPaused=!1;a.__xScrollTimelineAutoplayLast=null},
|
|
27
|
-
$APP.k(a,"__xScrollTimelineModel");if($APP.n(function(){if($APP.n(b)){var l=$APP.
|
|
28
|
-
|
|
29
|
-
$APP.X.g(a):a},
|
|
30
|
-
!0)},
|
|
31
|
-
return $APP.n($APP.n(b)?$APP.
|
|
32
|
-
"__xScrollTimelineDateEls"),h=$APP.M($APP.k(a,"__xScrollTimelineRefs"));h=$APP.D(h,$APP.
|
|
33
|
-
|
|
34
|
-
$APP.k(a,"__xScrollTimelineHandlers");if($APP.n(b)){
|
|
35
|
-
c)},{threshold:[0]});b.observe(a);a.__xScrollTimelineIO=b},
|
|
36
|
-
b;$APP.n(e)?(
|
|
37
|
-
return $APP.n(e)?e:d},set:function(e){return $APP.n(e)?this.setAttribute(c,""+$APP.T.g(e)):this.removeAttribute(c)},enumerable:!0,configurable:!0})},
|
|
38
|
-
set:function(d){return $APP.n(d)?this.setAttribute(c,""):this.removeAttribute(c)},enumerable:!0,configurable:!0})},
|
|
39
|
-
|
|
40
|
-
!1)},
|
|
41
|
-
this.__xScrollTimelineVisible=!1;this.__xScrollTimelineActiveIndex=-1;return this.__xScrollTimelineEntryStates=this.__xScrollTimelineLastProg=null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&
|
|
42
|
-
"marker-raw","marker-raw",2140891555),
|
|
43
|
-
"track-line","track-line",1370628624);var
|
|
44
|
-
$APP.zf([$APP.
|
|
45
|
-
new $APP.
|
|
46
|
-
$APP.
|
|
47
|
-
2,[$APP.V,new $APP.
|
|
48
|
-
new $APP.
|
|
7
|
+
x.setAttribute("part","indicator");d.appendChild(e);d.appendChild(q);d.appendChild(l);d.appendChild(x);y.setAttribute("part","live");y.setAttribute("aria-live","polite");y.setAttribute("aria-atomic","true");b.appendChild(c);b.appendChild(d);b.appendChild(y);b=$APP.zf([$APP.kj,ty,uy,vy,wy,xy,$APP.Hi,$APP.Hj,yy,$APP.Fi,zy,$APP.dj],[v,l,p,q,m,g,b,d,x,y,h,e]);a.__xScrollTimelineRefs=b;return $APP.k(a,"__xScrollTimelineRefs")},Iy=function(a){a=$APP.zf([$APP.pi,By,$APP.Vj,$APP.fm,$APP.Wh,$APP.kl,$APP.Ri,
|
|
8
|
+
Cy,$APP.ej,$APP.dm,Dy],[a.getAttribute("label"),a.getAttribute("marker"),a.getAttribute("autoplay-speed"),$APP.n(a.hasAttribute("autoplay"))?"":null,a.getAttribute("threshold"),a.getAttribute("layout"),$APP.n(a.hasAttribute("autoplay-indicator"))?"":null,a.getAttribute("track"),$APP.n(a.hasAttribute("disabled"))?"":null,$APP.n(a.hasAttribute("autoplay-loop"))?"":null,$APP.n(a.hasAttribute("no-progress"))?"":null]);var b=$APP.M(a);a=$APP.D(b,$APP.ej);var c=$APP.D(b,$APP.dm),d=$APP.D(b,Dy),e=$APP.D(b,
|
|
9
|
+
$APP.pi),g=$APP.D(b,By),h=$APP.D(b,$APP.Vj),l=$APP.D(b,$APP.fm),m=$APP.D(b,$APP.Wh),p=$APP.D(b,$APP.kl),q=$APP.D(b,$APP.Ri);b=$APP.D(b,Cy);p=typeof p==="string"?p.trim().toLowerCase():null;p=$APP.I(Ey,p)?p:"alternating";g=typeof g==="string"?g.trim().toLowerCase():null;g=$APP.I(Fy,g)?g:"dot";m=my(m);e=$APP.n(e)?e:"";h=ny(h);b=typeof b==="string"?b.trim().toLowerCase():null;b=$APP.I(Gy,b)?b:"straight";return $APP.zf([$APP.qk,$APP.Rk,$APP.Ai,Hy,$APP.Sl,$APP.U,$APP.Ki,$APP.X,$APP.Wj,$APP.dj,$APP.Ni],
|
|
10
|
+
[p,g,c!=null,d!=null,m,e,q!=null,a!=null,h,b,l!=null])},Jy=function(a){a=Ay(a);a=$APP.M(a);return $APP.D(a,$APP.kj).assignedElements()},Ky=function(){return $APP.F(window.matchMedia("(prefers-reduced-motion:reduce)").matches)},Ly=function(a){a=a.getAttribute("id");return typeof a==="string"&&$APP.N(a,"")?a:null},My=function(a,b,c){b=new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:!1});return a.dispatchEvent(b)},Ny=function(a,b){a=$APP.M($APP.k(a,"__xScrollTimelineRefs"));var c=$APP.D(a,
|
|
11
|
+
$APP.Fi);c.textContent=b;setTimeout(function(){return c.textContent=""},1E3)},Oy=function(a,b){for(var c=a.length,d=0;;)if(d<c){var e=a[d];e.setAttribute("data-side",oy(b,d));e.setAttribute("data-index",""+$APP.T.g(d));d+=1}else break},Py=function(a){a=Jy(a);for(var b=a.length,c=0;;)if(c<b){var d=a[c];d.removeAttribute("data-active");d.removeAttribute("data-side");d.removeAttribute("data-index");c+=1}else break},Qy=function(a,b){var c=$APP.M($APP.k(a,"__xScrollTimelineRefs"));c=$APP.D(c,$APP.Hj);
|
|
12
|
+
var d=$APP.k(a,"__xScrollTimelineMarkerEls");d=$APP.n(d)?d:[];b=b.length;for(var e=d.length,g=0;;)if(g<e)d[g].remove(),g+=1;else break;d=Array(b);for(e=0;;)if(e<b)g=document.createElement("div"),g.classList.add("tl-marker"),c.appendChild(g),d[e]=g,e+=1;else break;a.__xScrollTimelineMarkerEls=d},Ry=function(a,b){var c=$APP.M($APP.k(a,"__xScrollTimelineRefs"));c=$APP.D(c,$APP.Hj);var d=$APP.k(a,"__xScrollTimelineDateEls");var e=$APP.n(d)?d:[];d=b.length;for(var g=e.length,h=0;;)if(h<g){var l=e[h];$APP.n(l)&&
|
|
13
|
+
l.remove();h+=1}else break;e=Array(d);for(g=0;;)if(g<d)h=b[g].getAttribute("data-date"),typeof h==="string"&&$APP.N(h,"")?(l=document.createElement("span"),l.classList.add("tl-date"),l.textContent=h,c.appendChild(l),e[g]=l):e[g]=null,g+=1;else break;a.__xScrollTimelineDateEls=e},Sy=function(a,b,c){a=$APP.M($APP.k(a,"__xScrollTimelineRefs"));a=$APP.D(a,zy);$APP.n(c)?a.style.height="0%":a.style.height=""+$APP.T.g(b*100)+"%"},Ty=function(a,b){var c=$APP.M($APP.k(a,"__xScrollTimelineRefs")),d=$APP.D(c,
|
|
14
|
+
$APP.Hj),e=$APP.D(c,ty),g=$APP.D(c,wy);c=$APP.D(c,uy);var h=function(){var E=$APP.k(a,"__xScrollTimelineModel");return $APP.n(E)?E:Iy(a)}(),l=$APP.qk.g(h);h=d.getBoundingClientRect();var m=h.top;d=h.height;var p=h.width,q=window.getComputedStyle(a).getPropertyValue("--x-scroll-timeline-curve-amplitude");h=function(){var E=parseFloat(q);return $APP.n(isNaN(E))?60:E}();var v=window.getComputedStyle(a).getPropertyValue("--x-scroll-timeline-marker-size"),x=function(){var E=parseFloat(v);return $APP.n(isNaN(E))?
|
|
15
|
+
7:E/2}(),y=function(){switch(l){case "left":return x;case "right":return p-x;default:return p*.5}}(),A=b.length;if(A>0){var C=function(){for(var E=0,H=$APP.fe;;){if(E>=A)return H;var G=b[E].getBoundingClientRect(),J=E+1;H=$APP.ld.i(H,new $APP.R(null,2,[$APP.Il,G.top+G.height/2-m,ry,oy(l,E)],null));E=J}}();h=sy(C,h,y);e.setAttribute("viewBox","0 0 "+$APP.T.g(p)+" "+$APP.T.g(d));g.setAttribute("d",h);c.setAttribute("d",h);c.setAttribute("stroke-dasharray","1");c.setAttribute("stroke-dashoffset","1")}},
|
|
16
|
+
Uy=function(a,b,c){a=$APP.M($APP.k(a,"__xScrollTimelineRefs"));a=$APP.D(a,uy);$APP.n(c)?a.setAttribute("stroke-dashoffset","1"):a.setAttribute("stroke-dashoffset",""+$APP.T.g(1-b))},Vy=function(a,b,c){var d=$APP.k(a,"__xScrollTimelineActiveIndex");d=$APP.n(d)?d:-1;if($APP.N(d,c)){d>=0&&d<b.length&&b[d].removeAttribute("data-active");c>=0&&c<b.length&&b[c].setAttribute("data-active","");var e=$APP.k(a,"__xScrollTimelineMarkerEls"),g=$APP.k(a,"__xScrollTimelineDateEls");$APP.n(e)&&(d>=0&&d<e.length&&
|
|
17
|
+
e[d].removeAttribute("data-active"),c>=0&&c<e.length&&e[c].setAttribute("data-active",""));$APP.n(g)&&(d>=0&&d<g.length&&(e=g[d],$APP.n(e)&&e.removeAttribute("data-active")),c>=0&&c<g.length&&(g=g[c],$APP.n(g)&&g.setAttribute("data-active","")));c>=0?a.setAttribute("data-active-index",""+$APP.T.g(c)):a.removeAttribute("data-active-index");a.__xScrollTimelineActiveIndex=c;g=d>=0&&d<b.length?Ly(b[d]):null;b=c>=0&&c<b.length?Ly(b[c]):null;My(a,"x-scroll-timeline-entry-change",{index:c,id:b,previousIndex:d,
|
|
18
|
+
previousId:g});Ny(a,"Entry "+$APP.T.g(c+1)+" active")}},Wy=function(a,b,c,d){var e=b.length;var g=$APP.k(a,"__xScrollTimelineEntryStates");if(!$APP.n($APP.n(g)?$APP.B.i(g.length,e):g)){for(var h=Array(e),l=0;;)if(l<e)h[l]=$APP.n($APP.n(g)?l<g.length:g)?g[l]:!1,l+=1;else break;g=a.__xScrollTimelineEntryStates=h}for(h=0;;)if(h<e){if(h<$APP.z(c)){l=$APP.pc(c,h);l=$APP.M(l);var m=$APP.D(l,$APP.si),p=$APP.D(l,$APP.Kk),q=g[h];l=m<=d&&p>d;var v=Ly(b[h]);m=qy(m,p-m,d);$APP.r(q)&&l?(g[h]=!0,My(a,"x-scroll-timeline-entry-enter",
|
|
19
|
+
{index:h,id:v,progress:m})):$APP.n($APP.n(q)?!l:q)&&(g[h]=!1,My(a,"x-scroll-timeline-entry-leave",{index:h,id:v,progress:m}))}h+=1}else break},Xy=function(a){var b=function(){var q=$APP.k(a,"__xScrollTimelineModel");return $APP.n(q)?q:Iy(a)}();if(!$APP.n($APP.X.g(b))){var c=Jy(a),d=c.length,e=window.innerHeight,g=e*$APP.Sl.g(b),h=function(){for(var q=0,v=$APP.fe;;){if(q>=d)return v;var x=c[q].getBoundingClientRect();q+=1;v=$APP.ld.i(v,new $APP.R(null,2,[$APP.si,x.top,$APP.Kk,x.top+x.height],null))}}(),
|
|
20
|
+
l=py(h,g),m=$APP.M($APP.k(a,"__xScrollTimelineRefs"));m=$APP.D(m,$APP.Hj).getBoundingClientRect();e=$APP.oh.i(0,$APP.sh.i(1,(e-m.top)/(e+m.height)));m=$APP.k(a,"__xScrollTimelineLastProg");var p=d<2||l<0?0:function(){var q=function(){var C=$APP.pc(h,0);return($APP.si.g(C)+$APP.Kk.g(C))/2}(),v=function(){var C=$APP.pc(h,d-1);return($APP.si.g(C)+$APP.Kk.g(C))/2}()-q,x=$APP.pc(h,l),y=($APP.si.g(x)+$APP.Kk.g(x))/2;x=qy($APP.si.g(x),$APP.Kk.g(x)-$APP.si.g(x),g);var A=l<d-1?function(){var C=$APP.pc(h,l+
|
|
21
|
+
1);return($APP.si.g(C)+$APP.Kk.g(C))/2}():y;return v<=0?1:$APP.oh.i(0,$APP.sh.i(1,(y+x*(A-y)-q)/v))}();Vy(a,c,l);Wy(a,c,h,g);$APP.B.i($APP.dj.g(b),"curved")?Uy(a,p,Hy.g(b)):Sy(a,p,Hy.g(b));if(m==null||Math.abs(e-m)>.001)a.__xScrollTimelineLastProg=e,b=l>=0&&l<d?Ly(c[l]):null,My(a,"x-scroll-timeline-progress",{progress:e,activeIndex:l,activeId:b})}a.__xScrollTimelineRAF=null},Yy=function(a){return function d(c){if($APP.n(function(){var h=a.isConnected;return $APP.n(h)?(h=$APP.k(a,"__xScrollTimelineVisible"),
|
|
22
|
+
$APP.n(h)?$APP.r($APP.k(a,"__xScrollTimelineAutoplayPaused")):h):h}())){var e=$APP.k(a,"__xScrollTimelineModel");if($APP.n(function(){if($APP.n(e)){var h=$APP.Ni.g(e);return $APP.n(h)?$APP.r($APP.X.g(e)):h}return e}())){var g=$APP.k(a,"__xScrollTimelineAutoplayLast");g=$APP.n(g)?(c-g)/1E3:0;a.__xScrollTimelineAutoplayLast=c;g>0&&(window.scrollBy(0,$APP.Wj.g(e)*g),$APP.n($APP.Ai.g(e))&&(g=window.scrollY,c=window.innerHeight,g+c>=document.documentElement.scrollHeight-1&&(g=a.getBoundingClientRect().top+
|
|
23
|
+
g,window.scrollTo(0,$APP.oh.i(0,g-c)),a.__xScrollTimelineAutoplayLast=null)));return $APP.ja(a,"__xScrollTimelineAutoplayRAF",requestAnimationFrame(d))}}return null}},Zy=function(a){if($APP.n($APP.k(a,"__xScrollTimelineAutoplayPaused")))return null;a.__xScrollTimelineAutoplayPaused=!0;var b=$APP.k(a,"__xScrollTimelineAutoplayRAF");$APP.n(b)&&(cancelAnimationFrame(b),a.__xScrollTimelineAutoplayRAF=null);a.setAttribute("data-autoplay-paused","");b=function(){var e=$APP.k(a,"__xScrollTimelineLastProg");
|
|
24
|
+
return $APP.n(e)?e:0}();var c=function(){var e=$APP.k(a,"__xScrollTimelineActiveIndex");return $APP.n(e)?e:-1}(),d=Jy(a);d=c>=0&&c<d.length?Ly(d[c]):null;return My(a,"x-scroll-timeline-autoplay-pause",{progress:b,activeIndex:c,activeId:d})},$y=function(a){if($APP.n($APP.k(a,"__xScrollTimelineAutoplayPaused"))){a.__xScrollTimelineAutoplayPaused=!1;a.removeAttribute("data-autoplay-paused");a.__xScrollTimelineAutoplayLast=null;$APP.ja(a,"__xScrollTimelineAutoplayRAF",requestAnimationFrame(Yy(a)));var b=
|
|
25
|
+
function(){var e=$APP.k(a,"__xScrollTimelineLastProg");return $APP.n(e)?e:0}(),c=function(){var e=$APP.k(a,"__xScrollTimelineActiveIndex");return $APP.n(e)?e:-1}(),d=Jy(a);d=c>=0&&c<d.length?Ly(d[c]):null;return My(a,"x-scroll-timeline-autoplay-resume",{progress:b,activeIndex:c,activeId:d})}return null},az=function(a){var b=$APP.k(a,"__xScrollTimelineAutoplayRAF");$APP.n(b)&&(cancelAnimationFrame(b),a.__xScrollTimelineAutoplayRAF=null);b=$APP.k(a,"__xScrollTimelineAutoplayHandlers");$APP.n(b)&&(a.removeEventListener("pointerdown",
|
|
26
|
+
$APP.k(b,"pointerdown")),a.removeEventListener("pointerup",$APP.k(b,"pointerup")),a.removeEventListener("pointerleave",$APP.k(b,"pointerleave")),a.removeEventListener("keydown",$APP.k(b,"keydown")),a.removeEventListener("keyup",$APP.k(b,"keyup")),a.__xScrollTimelineAutoplayHandlers=null);a.removeAttribute("data-autoplay-paused");a.removeAttribute("tabindex");a.__xScrollTimelineAutoplayPaused=!1;a.__xScrollTimelineAutoplayLast=null},bz=function(a){if($APP.k(a,"__xScrollTimelineAutoplayRAF")==null){var b=
|
|
27
|
+
$APP.k(a,"__xScrollTimelineModel");if($APP.n(function(){if($APP.n(b)){var l=$APP.Ni.g(b);return $APP.n(l)?(l=$APP.r($APP.X.g(b)))?(l=$APP.k(a,"__xScrollTimelineVisible"),$APP.n(l)?!Ky():l):l:l}return b}())){a.setAttribute("tabindex","0");a.__xScrollTimelineAutoplayPaused=!1;a.__xScrollTimelineAutoplayLast=null;var c=function(){return Zy(a)},d=function(){return $y(a)},e=function(){return $APP.n($APP.k(a,"__xScrollTimelineAutoplayPaused"))?$y(a):null},g=function(l){return $APP.B.i(l.code,"Space")?(l.preventDefault(),
|
|
28
|
+
Zy(a)):null},h=function(l){return $APP.B.i(l.code,"Space")?$y(a):null};a.addEventListener("pointerdown",c);a.addEventListener("pointerup",d);a.addEventListener("pointerleave",e);a.addEventListener("keydown",g);a.addEventListener("keyup",h);$APP.ja(a,"__xScrollTimelineAutoplayHandlers",{pointerdown:c,pointerup:d,pointerleave:e,keydown:g,keyup:h});$APP.ja(a,"__xScrollTimelineAutoplayRAF",requestAnimationFrame(Yy(a)))}}return null},cz=function(a){a=$APP.k(a,"__xScrollTimelineModel");return $APP.n(a)?
|
|
29
|
+
$APP.X.g(a):a},dz=function(a){return $APP.n(function(){var b=a.isConnected;return $APP.n(b)?(b=$APP.k(a,"__xScrollTimelineVisible"),$APP.n(b)?$APP.r(cz(a))&&!Ky():b):b}())?$APP.n($APP.k(a,"__xScrollTimelineRAF"))?null:$APP.ja(a,"__xScrollTimelineRAF",requestAnimationFrame(function(){return Xy(a)})):null},ez=function(a){a=$APP.k(a,"__xScrollTimelineHandlers");$APP.n($APP.n(a)?$APP.r($APP.k(a,"scrollAttached")):a)&&(window.addEventListener("scroll",$APP.k(a,"scroll"),{passive:!0}),a.scrollAttached=
|
|
30
|
+
!0)},fz=function(a){a=$APP.k(a,"__xScrollTimelineHandlers");$APP.n($APP.n(a)?$APP.k(a,"scrollAttached"):a)&&(window.removeEventListener("scroll",$APP.k(a,"scroll")),a.scrollAttached=!1)},gz=function(a,b){b=b[0].isIntersecting;a.__xScrollTimelineVisible=b;if($APP.n(b)){if($APP.n(cz(a)))return null;ez(a);Xy(a);Ny(a,"Timeline entered viewport");My(a,"x-scroll-timeline-enter",{progress:function(){var c=$APP.k(a,"__xScrollTimelineLastProg");return $APP.n(c)?c:0}()});b=$APP.k(a,"__xScrollTimelineModel");
|
|
31
|
+
return $APP.n($APP.n(b)?$APP.Ni.g(b):b)?bz(a):null}fz(a);az(a);if($APP.n(cz(a)))return null;Ny(a,"Timeline left viewport");return My(a,"x-scroll-timeline-leave",{progress:function(){var c=$APP.k(a,"__xScrollTimelineLastProg");return $APP.n(c)?c:0}()})},hz=function(a){var b=function(){var d=$APP.k(a,"__xScrollTimelineModel");return $APP.n(d)?d:Iy(a)}(),c=Jy(a);Oy(c,$APP.qk.g(b));Qy(a,c);Ry(a,c);return requestAnimationFrame(function(){var d=Jy(a),e=$APP.k(a,"__xScrollTimelineMarkerEls"),g=$APP.k(a,
|
|
32
|
+
"__xScrollTimelineDateEls"),h=$APP.M($APP.k(a,"__xScrollTimelineRefs"));h=$APP.D(h,$APP.Hj).getBoundingClientRect().top;var l=$APP.k(a,"__xScrollTimelineModel");l=$APP.n(l)?l:Iy(a);l=$APP.qk.g(l);for(var m=d.length,p=0;;)if(p<m){var q=d[p].getBoundingClientRect();q=q.top+q.height/2-h;var v=oy(l,p),x=$APP.n(e)?e[p]:e;$APP.n(x)&&(x.style.top=""+$APP.T.g(q)+"px");x=$APP.n(g)?g[p]:g;$APP.n(x)&&(x.style.top=""+$APP.T.g(q)+"px",x.setAttribute("data-side",v));p+=1}else break;$APP.B.i($APP.dj.g(b),"curved")&&
|
|
33
|
+
Ty(a,d);return $APP.n($APP.k(a,"__xScrollTimelineVisible"))?Xy(a):null})},iz=function(a){function b(){return $APP.n($APP.k(a,"__xScrollTimelineVisible"))?(a.__xScrollTimelineEntryStates=null,hz(a)):null}function c(){a.__xScrollTimelineEntryStates=null;return hz(a)}var d=Ay(a);d=$APP.M(d);$APP.D(d,$APP.kj).addEventListener("slotchange",c);window.addEventListener("resize",b);$APP.ja(a,"__xScrollTimelineHandlers",{scroll:function(){return dz(a)},slot:c,resize:b,scrollAttached:!1})},jz=function(a){var b=
|
|
34
|
+
$APP.k(a,"__xScrollTimelineHandlers");if($APP.n(b)){fz(a);var c=$APP.k(a,"__xScrollTimelineRefs");if($APP.n(c)){c=$APP.kj.g(c);var d=$APP.k(b,"slot");$APP.n(d)&&c.removeEventListener("slotchange",d)}b=$APP.k(b,"resize");$APP.n(b)&&window.removeEventListener("resize",b)}b=$APP.k(a,"__xScrollTimelineRAF");$APP.n(b)&&(cancelAnimationFrame(b),a.__xScrollTimelineRAF=null);a.__xScrollTimelineHandlers=null},kz=function(a){var b=$APP.k(a,"__xScrollTimelineIO");$APP.n(b)&&b.disconnect();b=new IntersectionObserver(function(c){return gz(a,
|
|
35
|
+
c)},{threshold:[0]});b.observe(a);a.__xScrollTimelineIO=b},lz=function(a){var b=Iy(a);if($APP.N($APP.k(a,"__xScrollTimelineModel"),b)){b=$APP.M(b);var c=$APP.D(b,$APP.qk),d=$APP.D(b,$APP.dj),e=$APP.D(b,$APP.X),g=$APP.D(b,$APP.U),h=$APP.D(b,$APP.Rk),l=Ay(a);l=$APP.M(l);l=$APP.D(l,$APP.Hj);var m=$APP.k(a,"__xScrollTimelineModel");a.setAttribute("data-layout",c);a.setAttribute("data-track",d);a.setAttribute("data-marker",h);$APP.t(g)?l.setAttribute("aria-label",g):l.removeAttribute("aria-label");a.__xScrollTimelineModel=
|
|
36
|
+
b;$APP.n(e)?(Py(a),a.__xScrollTimelineActiveIndex=-1,a.__xScrollTimelineEntryStates=null,fz(a),az(a)):$APP.n(m)&&($APP.N($APP.qk.g(m),c)||$APP.N($APP.dj.g(m),d)||$APP.N($APP.Rk.g(m),h)||$APP.N($APP.X.g(m),e)?hz(a):($APP.N($APP.Sl.g(m),$APP.Sl.g(b))||$APP.N(Hy.g(m),Hy.g(b)))&&$APP.n($APP.k(a,"__xScrollTimelineVisible"))&&Xy(a));$APP.n(e)||(b=$APP.Ni.g(b),$APP.n($APP.n(b)?$APP.k(a,"__xScrollTimelineVisible"):b)?bz(a):az(a))}},mz=function(a,b,c,d){Object.defineProperty(a,b,{get:function(){var e=this.getAttribute(c);
|
|
37
|
+
return $APP.n(e)?e:d},set:function(e){return $APP.n(e)?this.setAttribute(c,""+$APP.T.g(e)):this.removeAttribute(c)},enumerable:!0,configurable:!0})},nz=function(a){Object.defineProperty(a,"label",{get:function(){var b=this.getAttribute("label");return $APP.n(b)?b:""},set:function(b){return $APP.n($APP.n(b)?$APP.N(b,""):b)?this.setAttribute("label",""+$APP.T.g(b)):this.removeAttribute("label")},enumerable:!0,configurable:!0})},oz=function(a,b,c){Object.defineProperty(a,b,{get:function(){return this.hasAttribute(c)},
|
|
38
|
+
set:function(d){return $APP.n(d)?this.setAttribute(c,""):this.removeAttribute(c)},enumerable:!0,configurable:!0})},pz=function(a,b,c,d){Object.defineProperty(a,b,{get:function(){var e=this.getAttribute(c);return d.g?d.g(e):d.call(null,e)},set:function(e){return e!=null?this.setAttribute(c,""+$APP.T.g(e)):this.removeAttribute(c)},enumerable:!0,configurable:!0})},qz=function(a,b,c,d){Object.defineProperty(a,b,{get:function(){var e=$APP.k(this,c);return e!=null?e:d},enumerable:!0,configurable:!0})},
|
|
39
|
+
rz=function(a){mz(a,"layout","layout","alternating");mz(a,"track","track","straight");mz(a,"marker","marker","dot");nz(a);pz(a,"threshold","threshold",my);oz(a,"noProgress","no-progress");oz(a,"disabled","disabled");oz(a,"autoplay","autoplay");pz(a,"autoplaySpeed","autoplay-speed",ny);oz(a,"autoplayLoop","autoplay-loop");oz(a,"autoplayIndicator","autoplay-indicator");qz(a,"activeIndex","__xScrollTimelineActiveIndex",-1);qz(a,"progress","__xScrollTimelineLastProg",0);qz(a,"autoplayPaused","__xScrollTimelineAutoplayPaused",
|
|
40
|
+
!1)},tz=function(){var a=class extends HTMLElement{};a.observedAttributes=sz;a.prototype.connectedCallback=function(){Ay(this);jz(this);iz(this);kz(this);lz(this);return null};a.prototype.disconnectedCallback=function(){az(this);Py(this);if($APP.n($APP.k(this,"__xScrollTimelineVisible"))){var b=$APP.k(this,"__xScrollTimelineLastProg");My(this,"x-scroll-timeline-leave",{progress:$APP.n(b)?b:0})}jz(this);b=$APP.k(this,"__xScrollTimelineIO");$APP.n(b)&&(b.disconnect(),this.__xScrollTimelineIO=null);
|
|
41
|
+
this.__xScrollTimelineVisible=!1;this.__xScrollTimelineActiveIndex=-1;return this.__xScrollTimelineEntryStates=this.__xScrollTimelineLastProg=null};a.prototype.attributeChangedCallback=function(b,c,d){$APP.N(c,d)&&lz(this);return null};rz(a.prototype);return a},uz=function(){$APP.n(customElements.get("x-scroll-timeline"))||customElements.define("x-scroll-timeline",tz());return null},zy=new $APP.K(null,"track-fill","track-fill",1852369499),vy=new $APP.K(null,"entries","entries",-86943161),By=new $APP.K(null,
|
|
42
|
+
"marker-raw","marker-raw",2140891555),yy=new $APP.K(null,"indicator","indicator",1928219637),Hy=new $APP.K(null,"no-progress?","no-progress?",-1599319890),Cy=new $APP.K(null,"track-raw","track-raw",751958776),wy=new $APP.K(null,"track-path","track-path",-1838135442),uy=new $APP.K(null,"fill-path","fill-path",-792439899),Dy=new $APP.K(null,"no-progress-attr","no-progress-attr",115951679),ty=new $APP.K(null,"track-svg","track-svg",-556455964),ry=new $APP.K(null,"side","side",389652279),xy=new $APP.K(null,
|
|
43
|
+
"track-line","track-line",1370628624);var sz="layout track threshold no-progress disabled label marker autoplay autoplay-speed autoplay-loop autoplay-indicator".split(" ");
|
|
44
|
+
$APP.zf([$APP.rl,$APP.Jh,$APP.Ok,$APP.Pj,$APP.qk,$APP.sk,$APP.Rk,$APP.Sl,$APP.Km,$APP.U,$APP.Hk,$APP.am,new $APP.K(null,"noProgress","noProgress",-2114530658),$APP.dj],[new $APP.R(null,1,[$APP.Z,$APP.Zj],null),new $APP.R(null,1,[$APP.Z,$APP.W],null),new $APP.R(null,1,[$APP.Z,$APP.Zj],null),new $APP.R(null,1,[$APP.Z,$APP.Zj],null),new $APP.R(null,1,[$APP.Z,$APP.Y],null),new $APP.R(null,2,[$APP.Z,$APP.W,$APP.wk,!0],null),new $APP.R(null,1,[$APP.Z,$APP.Y],null),new $APP.R(null,1,[$APP.Z,$APP.W],null),
|
|
45
|
+
new $APP.R(null,2,[$APP.Z,$APP.Zj,$APP.wk,!0],null),new $APP.R(null,1,[$APP.Z,$APP.Y],null),new $APP.R(null,1,[$APP.Z,$APP.Zj],null),new $APP.R(null,2,[$APP.Z,$APP.W,$APP.wk,!0],null),new $APP.R(null,1,[$APP.Z,$APP.Zj],null),new $APP.R(null,1,[$APP.Z,$APP.Y],null)]);
|
|
46
|
+
$APP.Pd(["x-scroll-timeline-entry-change",new $APP.R(null,2,[$APP.V,new $APP.R(null,4,[$APP.ai,$APP.W,$APP.xl,$APP.Y,$APP.ak,$APP.W,$APP.dn,$APP.Y],null),$APP.jm,!1],null),"x-scroll-timeline-entry-enter",new $APP.R(null,2,[$APP.V,new $APP.R(null,3,[$APP.ai,$APP.W,$APP.xl,$APP.Y,$APP.am,$APP.W],null),$APP.jm,!1],null),"x-scroll-timeline-entry-leave",new $APP.R(null,2,[$APP.V,new $APP.R(null,3,[$APP.ai,$APP.W,$APP.xl,$APP.Y,$APP.am,$APP.W],null),$APP.jm,!1],null),"x-scroll-timeline-progress",new $APP.R(null,
|
|
47
|
+
2,[$APP.V,new $APP.R(null,3,[$APP.am,$APP.W,$APP.sk,$APP.W,$APP.El,$APP.Y],null),$APP.jm,!1],null),"x-scroll-timeline-enter",new $APP.R(null,2,[$APP.V,new $APP.R(null,1,[$APP.am,$APP.W],null),$APP.jm,!1],null),"x-scroll-timeline-leave",new $APP.R(null,2,[$APP.V,new $APP.R(null,1,[$APP.am,$APP.W],null),$APP.jm,!1],null),"x-scroll-timeline-autoplay-pause",new $APP.R(null,2,[$APP.V,new $APP.R(null,3,[$APP.am,$APP.W,$APP.sk,$APP.W,$APP.El,$APP.Y],null),$APP.jm,!1],null),"x-scroll-timeline-autoplay-resume",
|
|
48
|
+
new $APP.R(null,2,[$APP.V,new $APP.R(null,3,[$APP.am,$APP.W,$APP.sk,$APP.W,$APP.El,$APP.Y],null),$APP.jm,!1],null)]);var Ey=new $APP.S(null,new $APP.R(null,3,["right",null,"left",null,"alternating",null],null),null),Gy=new $APP.S(null,new $APP.R(null,2,["curved",null,"straight",null],null),null),Fy=new $APP.S(null,new $APP.R(null,3,["ring",null,"none",null,"dot",null],null),null);$APP.ha("baredom.exports.x_scroll_timeline.init",uz);export const init=uz;
|
package/dist/x-scroll.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
$APP.M(a);a=$APP.D(c,$APP.
|
|
2
|
+
var H6=function(a){return a==null?!0:$APP.N((""+$APP.T.g(a)).trim().toLowerCase(),"false")},I6=function(a,b){if(typeof a==="string"){a=parseInt(a.trim(),10);var c=isNaN(a);return $APP.n($APP.n(c)?c:a<0)?b:a}return b},J6=function(a,b){return $APP.n(a)?b>=3:a},K6=function(a,b,c,d){a+=b;return $APP.n(J6(d,c))?c<=0?0:$APP.fd($APP.fd(a,c)+c,c):c<=0?0:$APP.oh.i(0,$APP.sh.i(a,c-1))},L6=function(a,b){var c=$APP.M(a);a=$APP.D(c,$APP.gk);c=$APP.D(c,$APP.ul);return $APP.n(J6(c,b))?b>0:a>0},M6=function(a,b){var c=
|
|
3
|
+
$APP.M(a);a=$APP.D(c,$APP.gk);c=$APP.D(c,$APP.ul);return $APP.n(J6(c,b))?b>0:a<b-1},O6=function(a){var b=$APP.k(a,"__xScrollRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),g=document.createElement("slot"),h=document.createElement("button"),l=document.createElement("button"),m=document.createElement("div"),p=document.createElement("div");c.textContent=":host{display:block;position:relative;overflow:hidden;color-scheme:light dark;--x-scroll-gap:0px;--x-scroll-padding:0px;--x-scroll-border-radius:0px;--x-scroll-bg:transparent;--x-scroll-control-size:36px;--x-scroll-control-bg:var(--x-color-bg,rgba(255,255,255,0.9));--x-scroll-control-color:var(--x-color-text,rgba(0,0,0,0.7));--x-scroll-control-hover-bg:var(--x-color-bg,rgba(255,255,255,1));--x-scroll-control-border-radius:50%;--x-scroll-control-shadow:var(--x-shadow-md,0 2px 8px rgba(0,0,0,.15));--x-scroll-indicator-size:8px;--x-scroll-indicator-gap:6px;--x-scroll-indicator-color:var(--x-color-text-muted,rgba(0,0,0,0.25));--x-scroll-indicator-active-color:var(--x-color-text,rgba(0,0,0,0.7));--x-scroll-transition-duration:var(--x-transition-duration,300ms);--x-scroll-slide-size:100%;--x-scroll-disabled-opacity:0.55;--x-scroll-focus-ring:var(--x-color-focus-ring,rgba(0,102,204,0.6));}@media (prefers-color-scheme:dark){:host{--x-scroll-control-bg:var(--x-color-bg,rgba(40,40,40,0.9));--x-scroll-control-color:var(--x-color-text,rgba(255,255,255,0.8));--x-scroll-control-hover-bg:var(--x-color-bg,rgba(50,50,50,1));--x-scroll-control-shadow:var(--x-shadow-md,0 2px 8px rgba(0,0,0,.4));--x-scroll-indicator-color:var(--x-color-text-muted,rgba(255,255,255,0.3));--x-scroll-indicator-active-color:var(--x-color-text,rgba(255,255,255,0.8));--x-scroll-focus-ring:var(--x-color-focus-ring,rgba(100,180,255,0.7));}}[part\x3dviewport]{position:relative;overflow:hidden;width:100%;height:100%;border-radius:var(--x-scroll-border-radius);background:var(--x-scroll-bg);padding:var(--x-scroll-padding);}[part\x3dtrack]{display:flex;position:relative;will-change:transform;transition:transform var(--x-scroll-transition-duration) cubic-bezier(0.25,0.1,0.25,1);touch-action:none;user-select:none;}:host([data-mode\x3dhorizontal]) [part\x3dtrack]{flex-direction:row;}:host([data-mode\x3dvertical]) [part\x3dtrack]{flex-direction:column;}::slotted(*){flex:0 0 var(--x-scroll-slide-size);min-width:0;min-height:0;box-sizing:border-box;}[part\x3dprev],[part\x3dnext]{position:absolute;top:50%;z-index:2;appearance:none;border:0;margin:0;padding:0;width:var(--x-scroll-control-size);height:var(--x-scroll-control-size);border-radius:var(--x-scroll-control-border-radius);background:var(--x-scroll-control-bg);color:var(--x-scroll-control-color);box-shadow:var(--x-scroll-control-shadow);cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:calc(var(--x-scroll-control-size) * 0.5);line-height:1;transform:translateY(-50%);transition:background 120ms ease,opacity 120ms ease;}[part\x3dprev]{left:8px;}[part\x3dnext]{right:8px;}:host([data-mode\x3dvertical]) [part\x3dprev],:host([data-mode\x3dvertical]) [part\x3dnext]{top:auto;left:50%;transform:translateX(-50%);}:host([data-mode\x3dvertical]) [part\x3dprev]{top:8px;}:host([data-mode\x3dvertical]) [part\x3dnext]{bottom:8px;top:auto;}[part\x3dprev]:hover,[part\x3dnext]:hover{background:var(--x-scroll-control-hover-bg);}[part\x3dprev]:focus,[part\x3dnext]:focus{outline:none;}[part\x3dprev]:focus-visible,[part\x3dnext]:focus-visible{outline:2px solid var(--x-scroll-focus-ring);outline-offset:2px;}[part\x3dprev]:disabled,[part\x3dnext]:disabled{opacity:0.3;cursor:default;pointer-events:none;}[data-hide-controls] [part\x3dprev],[data-hide-controls] [part\x3dnext]{display:none;}[part\x3dindicators]{display:flex;justify-content:center;gap:var(--x-scroll-indicator-gap);position:absolute;bottom:12px;left:50%;transform:translateX(-50%);z-index:2;}:host([data-mode\x3dvertical]) [part\x3dindicators]{flex-direction:column;bottom:auto;left:auto;right:12px;top:50%;transform:translateY(-50%);}[part\x3dindicator]{appearance:none;border:0;margin:0;padding:0;width:var(--x-scroll-indicator-size);height:var(--x-scroll-indicator-size);border-radius:50%;background:var(--x-scroll-indicator-color);cursor:pointer;transition:background 120ms ease;}[part\x3dindicator]:focus{outline:none;}[part\x3dindicator]:focus-visible{outline:2px solid var(--x-scroll-focus-ring);outline-offset:2px;}[part\x3dindicator][aria-selected\x3dtrue]{background:var(--x-scroll-indicator-active-color);}[part\x3dlive]{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0;}:host([disabled]){opacity:var(--x-scroll-disabled-opacity);pointer-events:none;}@media (prefers-reduced-motion:reduce){[part\x3dtrack]{transition:none !important;}}";
|
|
4
4
|
d.setAttribute("part","viewport");d.setAttribute("role","region");d.setAttribute("aria-roledescription","carousel");e.setAttribute("part","track");e.appendChild(g);d.appendChild(e);h.setAttribute("part","prev");h.setAttribute("type","button");h.setAttribute("aria-label","Previous slide");h.textContent="‹";l.setAttribute("part","next");l.setAttribute("type","button");l.setAttribute("aria-label","Next slide");l.textContent="›";m.setAttribute("part","indicators");m.setAttribute("role","tablist");m.setAttribute("aria-label",
|
|
5
|
-
"Slide indicators");p.setAttribute("part","live");p.setAttribute("aria-live","polite");p.setAttribute("aria-atomic","true");b.appendChild(c);b.appendChild(d);b.appendChild(h);b.appendChild(l);b.appendChild(m);b.appendChild(p);a.__xScrollRefs=new $APP.
|
|
6
|
-
$APP.n(a.hasAttribute("auto-play"))?"":null,a.getAttribute("mode"),$APP.n(a.hasAttribute("loop"))?"":null,a.getAttribute("gap"),$APP.n(a.hasAttribute("show-indicators"))?"":null,a.getAttribute("interval"),$APP.n(a.hasAttribute("disabled"))?"":null,a.getAttribute("snap"),a.getAttribute("active-index")]);var b=$APP.M(a),c=$APP.D(b,
|
|
7
|
-
b=$APP.D(b,
|
|
8
|
-
|
|
9
|
-
"translateY("+$APP.T.g(-a)+"px)"},
|
|
10
|
-
"",a+=1;else break;a=m*(h+l)-d;return
|
|
11
|
-
g)?(g.removeEventListener("transitionend",A),g.style.transition="none",
|
|
12
|
-
l.addEventListener("click",function(m){return function(){return d.g?d.g(m):d.call(null,m)}}(h,l,b,a,e,g,g));g.appendChild(l);h+=1}else break},
|
|
13
|
-
$APP.n(b)&&(clearInterval(b),a.__xScrollAutoplayTid=null);return null},
|
|
14
|
-
g
|
|
15
|
-
$APP.k(a,"__xScrollChildCount");return $APP.n(v)?v:
|
|
16
|
-
d=$APP.
|
|
17
|
-
function y(x){return $APP.
|
|
18
|
-
c=function(){var d=$APP.k(a,"__xScrollChildCount");return $APP.n(d)?d:
|
|
19
|
-
p);return
|
|
20
|
-
($APP.n(d)?$APP.k(c,"startX"):$APP.k(c,"startY"));$APP.r($APP.k(c,"isDragging"))&&Math.abs(e)>3&&(c.isDragging=!0);if($APP.n($APP.k(c,"isDragging"))){c.lastX=b.clientX;c.lastY=b.clientY;$APP.ja(c,"lastTime",Date.now());b=
|
|
21
|
-
c);g=
|
|
22
|
-
"startX"):$APP.k(c,"startY"));c=Date.now()-$APP.k(c,"lastTime");var e=c>0?Math.abs(b)/c:0;c=function(){var l=$APP.k(a,"__xScrollModel");return $APP.n(l)?l
|
|
23
|
-
e
|
|
24
|
-
h
|
|
25
|
-
1)+" of "+$APP.T.g(c));return
|
|
26
|
-
p);a.addEventListener("keydown",m);x.addEventListener("pointerdown",l);A.addEventListener("slotchange",h);document.addEventListener("visibilitychange",g);a.addEventListener("pointerenter",e);a.addEventListener("pointerleave",d);a.addEventListener("focusin",c);a.addEventListener("focusout",b);$APP.ja(a,"__xScrollHandlers",{slot:h,focusin:c,keydown:m,vis:g,enter:e,next:p,leave:d,prev:q,pdown:l,focusout:b})},
|
|
27
|
-
c:b)){var d=$APP.
|
|
28
|
-
c),a.__xScrollDragState=null);c=$APP.k(b,"slot");$APP.n(c)&&g.removeEventListener("slotchange",c);g=$APP.k(b,"vis");$APP.n(g)&&document.removeEventListener("visibilitychange",g);g=$APP.k(b,"enter");$APP.n(g)&&a.removeEventListener("pointerenter",g);g=$APP.k(b,"leave");$APP.n(g)&&a.removeEventListener("pointerleave",g);g=$APP.k(b,"focusin");$APP.n(g)&&a.removeEventListener("focusin",g);b=$APP.k(b,"focusout");$APP.n(b)&&a.removeEventListener("focusout",b)}a.__xScrollHandlers=null},
|
|
29
|
-
$APP.k(a,"__xScrollResizeObs");$APP.n(b)&&b.disconnect();b=
|
|
30
|
-
m=$APP.D(m,$APP.
|
|
31
|
-
"Slide "+$APP.T.g(l+1)+" of "+$APP.T.g(x));
|
|
5
|
+
"Slide indicators");p.setAttribute("part","live");p.setAttribute("aria-live","polite");p.setAttribute("aria-atomic","true");b.appendChild(c);b.appendChild(d);b.appendChild(h);b.appendChild(l);b.appendChild(m);b.appendChild(p);a.__xScrollRefs=new $APP.R(null,8,[$APP.Hi,b,$APP.mj,d,$APP.dj,e,$APP.kj,g,$APP.hj,h,$APP.Sh,l,N6,m,$APP.Fi,p],null);return $APP.k(a,"__xScrollRefs")},$6=function(a){a=$APP.zf([P6,$APP.pi,Q6,$APP.vl,R6,$APP.Wi,S6,$APP.bi,$APP.ej,T6,$APP.ml],[a.getAttribute("show-controls"),a.getAttribute("label"),
|
|
6
|
+
$APP.n(a.hasAttribute("auto-play"))?"":null,a.getAttribute("mode"),$APP.n(a.hasAttribute("loop"))?"":null,a.getAttribute("gap"),$APP.n(a.hasAttribute("show-indicators"))?"":null,a.getAttribute("interval"),$APP.n(a.hasAttribute("disabled"))?"":null,a.getAttribute("snap"),a.getAttribute("active-index")]);var b=$APP.M(a),c=$APP.D(b,T6);a=$APP.D(b,$APP.bi);var d=$APP.D(b,$APP.ej),e=$APP.D(b,$APP.ml),g=$APP.D(b,P6),h=$APP.D(b,$APP.pi),l=$APP.D(b,Q6),m=$APP.D(b,$APP.vl),p=$APP.D(b,R6),q=$APP.D(b,$APP.Wi);
|
|
7
|
+
b=$APP.D(b,S6);e=I6(e,0);g=H6(g);c=typeof c==="string"?c.trim().toLowerCase():null;c=$APP.I(U6,c)?c:"none";m=typeof m==="string"?m.trim().toLowerCase():null;m=$APP.I(V6,m)?m:"horizontal";return $APP.zf([$APP.gk,W6,X6,$APP.wj,Y6,Z6,$APP.U,$APP.Yj,$APP.ul,$APP.Xk,$APP.X],[e,g,c,m,b!=null,l!=null,$APP.n(h)?h:"",I6(q,0),p!=null,$APP.oh.i(500,I6(a,5E3)),d!=null])},a7=function(a){a=O6(a);a=$APP.M(a);return $APP.D(a,$APP.kj).assignedElements()},b7=function(){return $APP.F(window.matchMedia("(prefers-reduced-motion:reduce)").matches)},
|
|
8
|
+
c7=function(a){return $APP.B.i("horizontal",$APP.wj.g(a))},d7=function(a,b){a=a7(a);return a.length>0?(a=a[0].getBoundingClientRect(),c7(b)?a.width:a.height):0},e7=function(a,b){return a.style.transform=b},f7=function(a,b){a=a.getBoundingClientRect();return $APP.B.i("horizontal",$APP.wj.g(b))?a.width:a.height},g7=function(a,b,c){switch(a){case "center":return(b-c)/2;case "end":return b-c;default:return 0}},h7=function(a,b,c,d,e){a=$APP.gd(a)*(b+c)-d;return $APP.n(e)?"translateX("+$APP.T.g(-a)+"px)":
|
|
9
|
+
"translateY("+$APP.T.g(-a)+"px)"},i7=function(a,b,c){for(var d=0;;)if(d<b){var e=$APP.gd(b);a[d].style.order=""+$APP.T.g($APP.fd(d-c+e+b,b)-e);d+=1}else break},j7=function(a,b){var c=O6(a);c=$APP.M(c);var d=$APP.D(c,$APP.mj);c=$APP.D(c,$APP.dj);var e=a7(a),g=e.length,h=d7(a,b),l=$APP.Yj.g(b),m=$APP.gk.g(b),p=J6($APP.ul.g(b),g);d=f7(d,b);d=g7(X6.g(b),d,h);a.__xScrollChildCount=g;if(g>0){c.style.gap=""+$APP.T.g(l)+"px";if($APP.n(p))return i7(e,g,m),e7(c,h7(g,h,l,d,c7(b)));for(a=0;;)if(a<g)e[a].style.order=
|
|
10
|
+
"",a+=1;else break;a=m*(h+l)-d;return e7(c,c7(b)?"translateX("+$APP.T.g(-a)+"px)":"translateY("+$APP.T.g(-a)+"px)")}return null},k7=function(a,b,c){var d=O6(a);d=$APP.M(d);var e=$APP.D(d,$APP.mj),g=$APP.D(d,$APP.dj),h=a7(a),l=h.length,m=d7(a,b),p=$APP.Yj.g(b),q=c7(b);a=f7(e,b);var v=g7(X6.g(b),a,m);c=-($APP.gd(l)*(m+p)-v+c*(m+p));e7(g,q?"translateX("+$APP.T.g(c)+"px)":"translateY("+$APP.T.g(c)+"px)");b7()?(i7(h,l,$APP.gk.g(b)),e7(g,h7(l,m,p,v,q))):g.addEventListener("transitionend",function A(y){return $APP.B.i(y.target,
|
|
11
|
+
g)?(g.removeEventListener("transitionend",A),g.style.transition="none",i7(h,l,$APP.gk.g(b)),e7(g,h7(l,m,p,v,q)),g.offsetHeight,g.style.transition=""):null})},l7=function(a,b,c,d){a=O6(a);var e=$APP.M(a),g=$APP.D(e,N6);g.innerHTML="";for(var h=0;;)if(h<b){var l=document.createElement("button");l.setAttribute("part","indicator");l.setAttribute("type","button");l.setAttribute("role","tab");l.setAttribute("aria-label","Slide "+$APP.T.g(h+1));l.setAttribute("aria-selected",""+$APP.T.g($APP.B.i(h,c)));
|
|
12
|
+
l.addEventListener("click",function(m){return function(){return d.g?d.g(m):d.call(null,m)}}(h,l,b,a,e,g,g));g.appendChild(l);h+=1}else break},m7=function(a,b){a=O6(a);a=$APP.M(a);a=$APP.D(a,N6).children;for(var c=a.length,d=0;;)if(d<c)a[d].setAttribute("aria-selected",""+$APP.T.g($APP.B.i(d,b))),d+=1;else break},n7=function(a,b,c,d){b=new CustomEvent(b,{detail:$APP.Hh(c),bubbles:!0,composed:!0,cancelable:$APP.F(d)});return a.dispatchEvent(b)},o7=function(a){var b=$APP.k(a,"__xScrollAutoplayTid");
|
|
13
|
+
$APP.n(b)&&(clearInterval(b),a.__xScrollAutoplayTid=null);return null},r7=function(a){o7(a);var b=function(){var c=$APP.k(a,"__xScrollModel");return $APP.n(c)?c:$6(a)}();$APP.n(function(){var c=Z6.g(b);return $APP.n(c)?$APP.r($APP.X.g(b)):c}())&&$APP.ja(a,"__xScrollAutoplayTid",setInterval(function(){if($APP.n(a.isConnected)){var c=a7(a).length;if(c>0){var d=$APP.gk.g(function(){var g=$APP.k(a,"__xScrollModel");return $APP.n(g)?g:$6(a)}()),e=function(){var g=$APP.k(a,"__xScrollModel");return $APP.n(g)?
|
|
14
|
+
g:$6(a)}();c=K6(d,1,c,$APP.ul.g(e));return $APP.N(d,c)?p7?p7(a,c,1):q7.call(null,a,c,1):null}}return null},$APP.Xk.g(b)));return null},s7=function(a){o7(a);return r7(a)},q7=function(a){switch(arguments.length){case 2:return p7(arguments[0],arguments[1],null);case 3:return p7(arguments[0],arguments[1],arguments[2]);default:throw Error(["Invalid arity: ",arguments.length].join(""));}},p7=function(a,b,c){var d=function(){var v=$APP.k(a,"__xScrollModel");return $APP.n(v)?v:$6(a)}(),e=function(){var v=
|
|
15
|
+
$APP.k(a,"__xScrollChildCount");return $APP.n(v)?v:a7(a).length}(),g=$APP.gk.g(d);if(e>0&&$APP.r($APP.X.g(d))){var h=J6($APP.ul.g(d),e),l=$APP.n(h)?e<=0?0:$APP.fd($APP.fd(b,e)+e,e):e<=0?0:$APP.oh.i(0,$APP.sh.i(b,e-1));b=l-g;if($APP.N(l,g)){c=$APP.n(c)?c:b>0?1:-1;var m=e>0&&(c>0&&l<g||c<0&&l>g),p=c>0?"forward":"backward";if($APP.n(function(){var v=!m;return v?v:n7(a,"x-scroll-loop",new $APP.R(null,1,[$APP.tj,p],null),!0)}())){n7(a,"x-scroll-start",new $APP.R(null,2,[$APP.tj,p,$APP.sk,g],null),!1);
|
|
16
|
+
d=$APP.mh.m(d,$APP.gk,l);a.__xScrollModel=d;a.setAttribute("active-index",""+$APP.T.g(l));$APP.n(h)?k7(a,d,c):j7(a,d);m7(a,l);h=O6(a);b=$APP.M(h);h=$APP.D(b,$APP.hj);c=$APP.D(b,$APP.Sh);b=$APP.D(b,$APP.Fi);h.disabled=!L6(d,e);c.disabled=!M6(d,e);b.textContent="Slide "+$APP.T.g(l+1)+" of "+$APP.T.g(e);n7(a,"x-scroll-change",new $APP.R(null,2,[$APP.sk,l,$APP.ak,g],null),!1);if(b7())n7(a,"x-scroll-end",new $APP.R(null,1,[$APP.sk,l],null),!1);else{e=O6(a);e=$APP.M(e);var q=$APP.D(e,$APP.dj);q.addEventListener("transitionend",
|
|
17
|
+
function y(x){return $APP.B.i(x.target,q)?(q.removeEventListener("transitionend",y),n7(a,"x-scroll-end",new $APP.R(null,1,[$APP.sk,l],null),!1)):null})}return s7(a)}}}return null},t7=function(a){var b=function(){var d=$APP.k(a,"__xScrollModel");return $APP.n(d)?d:$6(a)}(),c=function(){var d=$APP.k(a,"__xScrollChildCount");return $APP.n(d)?d:a7(a).length}();b=K6($APP.gk.g(b),1,c,$APP.ul.g(b));return p7(a,b,1)},u7=function(a){var b=function(){var d=$APP.k(a,"__xScrollModel");return $APP.n(d)?d:$6(a)}(),
|
|
18
|
+
c=function(){var d=$APP.k(a,"__xScrollChildCount");return $APP.n(d)?d:a7(a).length}();b=K6($APP.gk.g(b),-1,c,$APP.ul.g(b));return p7(a,b,-1)},x7=function(a,b){function c(l){return v7.i?v7.i(a,l):v7.call(null,a,l)}var d=function(){var l=$APP.k(a,"__xScrollModel");return $APP.n(l)?l:$6(a)}();if($APP.n($APP.X.g(d)))return null;var e=O6(a);e=$APP.M(e);e=$APP.D(e,$APP.dj);var g=c7(d);e.style.transition="none";o7(a);var h=function p(m){window.removeEventListener("pointermove",c);window.removeEventListener("pointerup",
|
|
19
|
+
p);return w7.i?w7.i(a,m):w7.call(null,a,m)};window.addEventListener("pointermove",c);window.addEventListener("pointerup",h);return $APP.ja(a,"__xScrollDragState",function(){var m={};m.startX=b.clientX;m.startTime=Date.now();m.startY=b.clientY;m.upH=h;m.moveH=c;m.isDragging=!1;m.lastY=b.clientY;m.lastTime=Date.now();m.horiz=g;m.lastX=b.clientX;return m}())},v7=function(a,b){var c=$APP.k(a,"__xScrollDragState");if($APP.n(c)){b.preventDefault();var d=$APP.k(c,"horiz"),e=($APP.n(d)?b.clientX:b.clientY)-
|
|
20
|
+
($APP.n(d)?$APP.k(c,"startX"):$APP.k(c,"startY"));$APP.r($APP.k(c,"isDragging"))&&Math.abs(e)>3&&(c.isDragging=!0);if($APP.n($APP.k(c,"isDragging"))){c.lastX=b.clientX;c.lastY=b.clientY;$APP.ja(c,"lastTime",Date.now());b=O6(a);b=$APP.M(b);var g=$APP.D(b,$APP.mj);b=$APP.D(b,$APP.dj);var h=function(){var v=$APP.k(a,"__xScrollModel");return $APP.n(v)?v:$6(a)}(),l=d7(a,h),m=$APP.Yj.g(h);c=function(){var v=$APP.k(a,"__xScrollChildCount");return $APP.n(v)?v:a7(a).length}();var p=$APP.gk.g(h),q=J6($APP.ul.g(h),
|
|
21
|
+
c);g=f7(g,h);g=g7(X6.g(h),g,l);l=($APP.n(q)?$APP.gd(c)*(l+m):p*(l+m))-g;e=($APP.r(q)&&(e<0&&$APP.B.i(p,c-1)||e>0&&$APP.B.i(p,0))?e*.3:e)-l;return e7(b,$APP.n(d)?"translateX("+$APP.T.g(e)+"px)":"translateY("+$APP.T.g(e)+"px)")}}return null},w7=function(a,b){var c=$APP.k(a,"__xScrollDragState");if($APP.n(c)){a.__xScrollDragState=null;var d=O6(a);d=$APP.M(d);$APP.D(d,$APP.dj).style.transition="";if($APP.n($APP.k(c,"isDragging"))){d=$APP.k(c,"horiz");b=($APP.n(d)?b.clientX:b.clientY)-($APP.n(d)?$APP.k(c,
|
|
22
|
+
"startX"):$APP.k(c,"startY"));c=Date.now()-$APP.k(c,"lastTime");var e=c>0?Math.abs(b)/c:0;c=function(){var l=$APP.k(a,"__xScrollModel");return $APP.n(l)?l:$6(a)}();var g=d7(a,c),h=function(){var l=$APP.k(a,"__xScrollChildCount");return $APP.n(l)?l:a7(a).length}();d=$APP.gk.g(c);e=e>.5?b<0?1:-1:Math.abs(b)>.5*g?b<0?1:-1:0;h=e===0?d:K6(d,e,h,$APP.ul.g(c));$APP.B.i(h,d)?j7(a,c):p7(a,h,b<0?1:-1);return s7(a)}}return null},y7=function(a,b){var c=function(){var e=$APP.k(a,"__xScrollModel");return $APP.n(e)?
|
|
23
|
+
e:$6(a)}();if($APP.n($APP.X.g(c)))return null;var d=b.key;(c=c7(c))&&$APP.B.i(d,"ArrowLeft")?(u7(a),d=!0):c&&$APP.B.i(d,"ArrowRight")?(t7(a),d=!0):!c&&$APP.B.i(d,"ArrowUp")?(u7(a),d=!0):!c&&$APP.B.i(d,"ArrowDown")?(t7(a),d=!0):$APP.B.i(d,"Home")?(p7(a,0,null),d=!0):d=$APP.B.i(d,"End")&&function(){var e=$APP.k(a,"__xScrollChildCount");e=$APP.n(e)?e:a7(a).length;p7(a,e-1,null);return!0}();return d?b.preventDefault():null},z7=function(a){var b=function(){var h=$APP.k(a,"__xScrollModel");return $APP.n(h)?
|
|
24
|
+
h:$6(a)}(),c=a7(a).length;a.__xScrollChildCount=c;if(c>0&&$APP.gk.g(b)>=c){var d=c-1;a.setAttribute("active-index",""+$APP.T.g(d));$APP.ja(a,"__xScrollModel",$APP.mh.m(b,$APP.gk,d))}b=function(){var h=$APP.k(a,"__xScrollModel");return $APP.n(h)?h:$6(a)}();d=O6(a);var e=$APP.M(d);d=$APP.D(e,$APP.hj);var g=$APP.D(e,$APP.Sh);e=$APP.D(e,$APP.Fi);$APP.n(Y6.g(b))&&l7(a,c,$APP.gk.g(b),function(h){return p7(a,h,null)});d.disabled=!L6(b,c);g.disabled=!M6(b,c);c>0&&(e.textContent="Slide "+$APP.T.g($APP.gk.g(b)+
|
|
25
|
+
1)+" of "+$APP.T.g(c));return j7(a,b)},A7=function(a){function b(){return s7(a)}function c(){return o7(a)}function d(){return s7(a)}function e(){return o7(a)}function g(){return $APP.n(document.hidden)?o7(a):s7(a)}function h(){return z7(a)}function l(C){return x7(a,C)}function m(C){return y7(a,C)}function p(){return t7(a)}function q(){return u7(a)}var v=O6(a),x=$APP.M(v);v=$APP.D(x,$APP.hj);var y=$APP.D(x,$APP.Sh),A=$APP.D(x,$APP.kj);x=$APP.D(x,$APP.mj);v.addEventListener("click",q);y.addEventListener("click",
|
|
26
|
+
p);a.addEventListener("keydown",m);x.addEventListener("pointerdown",l);A.addEventListener("slotchange",h);document.addEventListener("visibilitychange",g);a.addEventListener("pointerenter",e);a.addEventListener("pointerleave",d);a.addEventListener("focusin",c);a.addEventListener("focusout",b);$APP.ja(a,"__xScrollHandlers",{slot:h,focusin:c,keydown:m,vis:g,enter:e,next:p,leave:d,prev:q,pdown:l,focusout:b})},B7=function(a){o7(a);var b=$APP.k(a,"__xScrollHandlers"),c=$APP.k(a,"__xScrollRefs");if($APP.n($APP.n(b)?
|
|
27
|
+
c:b)){var d=$APP.hj.g(c),e=$APP.Sh.g(c),g=$APP.kj.g(c);c=$APP.mj.g(c);var h=$APP.k(b,"prev");$APP.n(h)&&d.removeEventListener("click",h);d=$APP.k(b,"next");$APP.n(d)&&e.removeEventListener("click",d);e=$APP.k(b,"keydown");$APP.n(e)&&a.removeEventListener("keydown",e);e=$APP.k(b,"pdown");$APP.n(e)&&c.removeEventListener("pointerdown",e);c=$APP.k(a,"__xScrollDragState");$APP.n(c)&&(e=$APP.k(c,"moveH"),$APP.n(e)&&window.removeEventListener("pointermove",e),c=$APP.k(c,"upH"),$APP.n(c)&&window.removeEventListener("pointerup",
|
|
28
|
+
c),a.__xScrollDragState=null);c=$APP.k(b,"slot");$APP.n(c)&&g.removeEventListener("slotchange",c);g=$APP.k(b,"vis");$APP.n(g)&&document.removeEventListener("visibilitychange",g);g=$APP.k(b,"enter");$APP.n(g)&&a.removeEventListener("pointerenter",g);g=$APP.k(b,"leave");$APP.n(g)&&a.removeEventListener("pointerleave",g);g=$APP.k(b,"focusin");$APP.n(g)&&a.removeEventListener("focusin",g);b=$APP.k(b,"focusout");$APP.n(b)&&a.removeEventListener("focusout",b)}a.__xScrollHandlers=null},C7=function(a){var b=
|
|
29
|
+
$APP.k(a,"__xScrollResizeObs");$APP.n(b)&&b.disconnect();b=O6(a);b=$APP.M(b);b=$APP.D(b,$APP.mj);var c=new ResizeObserver(function(){if($APP.n(a.isConnected)){var d=$APP.k(a,"__xScrollModel");d=$APP.n(d)?d:$6(a);return j7(a,d)}return null});c.observe(b);a.__xScrollResizeObs=c},D7=function(a,b){b=$APP.M(b);var c=$APP.D(b,$APP.wj),d=$APP.D(b,W6),e=$APP.D(b,Y6),g=$APP.D(b,$APP.X),h=$APP.D(b,$APP.U),l=$APP.D(b,$APP.gk),m=O6(a);m=$APP.M(m);var p=$APP.D(m,$APP.mj),q=$APP.D(m,$APP.hj),v=$APP.D(m,$APP.Sh);
|
|
30
|
+
m=$APP.D(m,$APP.Fi);var x=function(){var y=$APP.k(a,"__xScrollChildCount");return $APP.n(y)?y:a7(a).length}();a.setAttribute("data-mode",c);$APP.n(d)?a.removeAttribute("data-hide-controls"):a.setAttribute("data-hide-controls","");$APP.t(h)?p.setAttribute("aria-label",h):p.removeAttribute("aria-label");q.disabled=!L6(b,x);v.disabled=!M6(b,x);a.tabIndex=$APP.n(g)?-1:0;$APP.n(e)&&l7(a,x,l,function(y){return p7(a,y,null)});$APP.n(e)||(c=O6(a),c=$APP.M(c),$APP.D(c,N6).innerHTML="");x>0&&(m.textContent=
|
|
31
|
+
"Slide "+$APP.T.g(l+1)+" of "+$APP.T.g(x));j7(a,b);a.__xScrollModel=b},E7=function(a){var b=$6(a);$APP.N($APP.k(a,"__xScrollModel"),b)&&D7(a,b)},F7=function(a){Object.defineProperty(a,"mode",{get:function(){var b=this.getAttribute("mode");return $APP.n(b)?b:"horizontal"},set:function(b){return $APP.n(b)?this.setAttribute("mode",""+$APP.T.g(b)):this.removeAttribute("mode")},enumerable:!0,configurable:!0});Object.defineProperty(a,"snap",{get:function(){var b=this.getAttribute("snap");return $APP.n(b)?
|
|
32
32
|
b:"none"},set:function(b){return $APP.n(b)?this.setAttribute("snap",""+$APP.T.g(b)):this.removeAttribute("snap")},enumerable:!0,configurable:!0});Object.defineProperty(a,"loop",{get:function(){return this.hasAttribute("loop")},set:function(b){return $APP.n(b)?this.setAttribute("loop",""):this.removeAttribute("loop")},enumerable:!0,configurable:!0});Object.defineProperty(a,"autoPlay",{get:function(){return this.hasAttribute("auto-play")},set:function(b){return $APP.n(b)?this.setAttribute("auto-play",
|
|
33
|
-
""):this.removeAttribute("auto-play")},enumerable:!0,configurable:!0});Object.defineProperty(a,"interval",{get:function(){var b=this.getAttribute("interval");return $APP.
|
|
34
|
-
this.setAttribute("show-controls","false")},enumerable:!0,configurable:!0});Object.defineProperty(a,"showIndicators",{get:function(){return this.hasAttribute("show-indicators")},set:function(b){return $APP.n(b)?this.setAttribute("show-indicators",""):this.removeAttribute("show-indicators")},enumerable:!0,configurable:!0});Object.defineProperty(a,"activeIndex",{get:function(){var b=this.getAttribute("active-index");return
|
|
35
|
-
this.setAttribute("active-index",""+$APP.T.g(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"gap",{get:function(){var b=this.getAttribute("gap");return
|
|
36
|
-
configurable:!0});Object.defineProperty(a,"label",{get:function(){var b=this.getAttribute("label");return $APP.n(b)?b:""},set:function(b){return $APP.n($APP.n(b)?$APP.N(b,""):b)?this.setAttribute("label",""+$APP.T.g(b)):this.removeAttribute("label")},enumerable:!0,configurable:!0})},
|
|
37
|
-
var c=$APP.k(this,"__xScrollResizeObs");$APP.n(c)&&(c.disconnect(),this.__xScrollResizeObs=null);c=
|
|
38
|
-
b.prev=function(){return
|
|
39
|
-
-894641087),
|
|
40
|
-
$APP.zf([$APP.
|
|
41
|
-
$APP.
|
|
42
|
-
$APP.
|
|
43
|
-
var
|
|
33
|
+
""):this.removeAttribute("auto-play")},enumerable:!0,configurable:!0});Object.defineProperty(a,"interval",{get:function(){var b=this.getAttribute("interval");return $APP.oh.i(500,I6(b,5E3))},set:function(b){return b==null?this.removeAttribute("interval"):this.setAttribute("interval",""+$APP.T.g(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"showControls",{get:function(){return H6(this.getAttribute("show-controls"))},set:function(b){return $APP.n(b)?this.removeAttribute("show-controls"):
|
|
34
|
+
this.setAttribute("show-controls","false")},enumerable:!0,configurable:!0});Object.defineProperty(a,"showIndicators",{get:function(){return this.hasAttribute("show-indicators")},set:function(b){return $APP.n(b)?this.setAttribute("show-indicators",""):this.removeAttribute("show-indicators")},enumerable:!0,configurable:!0});Object.defineProperty(a,"activeIndex",{get:function(){var b=this.getAttribute("active-index");return I6(b,0)},set:function(b){return b==null?this.removeAttribute("active-index"):
|
|
35
|
+
this.setAttribute("active-index",""+$APP.T.g(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"gap",{get:function(){var b=this.getAttribute("gap");return I6(b,0)},set:function(b){return b==null?this.removeAttribute("gap"):this.setAttribute("gap",""+$APP.T.g(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"disabled",{get:function(){return this.hasAttribute("disabled")},set:function(b){return $APP.n(b)?this.setAttribute("disabled",""):this.removeAttribute("disabled")},enumerable:!0,
|
|
36
|
+
configurable:!0});Object.defineProperty(a,"label",{get:function(){var b=this.getAttribute("label");return $APP.n(b)?b:""},set:function(b){return $APP.n($APP.n(b)?$APP.N(b,""):b)?this.setAttribute("label",""+$APP.T.g(b)):this.removeAttribute("label")},enumerable:!0,configurable:!0})},H7=function(){var a=class extends HTMLElement{};a.observedAttributes=G7;a.prototype.connectedCallback=function(){O6(this);B7(this);A7(this);C7(this);E7(this);r7(this);return null};a.prototype.disconnectedCallback=function(){B7(this);
|
|
37
|
+
var c=$APP.k(this,"__xScrollResizeObs");$APP.n(c)&&(c.disconnect(),this.__xScrollResizeObs=null);c=a7(this);for(var d=c.length,e=0;;)if(e<d)c[e].style.order="",e+=1;else break;return null};a.prototype.attributeChangedCallback=function(c,d,e){$APP.N(d,e)&&(E7(this),d=this.isConnected,c=$APP.n(d)?$APP.B.i(c,"auto-play")||$APP.B.i(c,"interval")||$APP.B.i(c,"disabled"):d,$APP.n(c)&&s7(this));return null};var b=a.prototype;F7(b);b.goTo=function(c){return p7(this,c,null)};b.next=function(){return t7(this)};
|
|
38
|
+
b.prev=function(){return u7(this)};return a},I7=function(){$APP.n(customElements.get("x-scroll"))||customElements.define("x-scroll",H7());return null},X6=new $APP.K(null,"snap","snap",-51714904),T6=new $APP.K(null,"snap-raw","snap-raw",828444409),Z6=new $APP.K(null,"auto-play?","auto-play?",385278451),W6=new $APP.K(null,"show-controls?","show-controls?",1318868354),S6=new $APP.K(null,"show-indicators-attr","show-indicators-attr",1148535895),P6=new $APP.K(null,"show-controls-attr","show-controls-attr",
|
|
39
|
+
-894641087),R6=new $APP.K(null,"loop-attr","loop-attr",-132212822),Q6=new $APP.K(null,"auto-play-attr","auto-play-attr",329299716),Y6=new $APP.K(null,"show-indicators?","show-indicators?",-370587412),N6=new $APP.K(null,"indicators","indicators",1312373003);var G7="mode snap loop auto-play interval show-controls show-indicators active-index gap disabled label".split(" ");
|
|
40
|
+
$APP.zf([$APP.Pj,new $APP.K(null,"showIndicators","showIndicators",1780978055),X6,$APP.sk,$APP.wj,new $APP.K(null,"showControls","showControls",1591218925),$APP.Hm,$APP.U,$APP.Yj,new $APP.K(null,"autoPlay","autoPlay",-561263241),$APP.Xk],[new $APP.R(null,1,[$APP.Z,$APP.Zj],null),new $APP.R(null,1,[$APP.Z,$APP.Zj],null),new $APP.R(null,1,[$APP.Z,$APP.Y],null),new $APP.R(null,1,[$APP.Z,$APP.W],null),new $APP.R(null,1,[$APP.Z,$APP.Y],null),new $APP.R(null,1,[$APP.Z,$APP.Zj],null),new $APP.R(null,1,[$APP.Z,
|
|
41
|
+
$APP.Zj],null),new $APP.R(null,1,[$APP.Z,$APP.Y],null),new $APP.R(null,1,[$APP.Z,$APP.W],null),new $APP.R(null,1,[$APP.Z,$APP.Zj],null),new $APP.R(null,1,[$APP.Z,$APP.W],null)]);
|
|
42
|
+
$APP.Pd(["x-scroll-change",new $APP.R(null,2,[$APP.V,new $APP.R(null,2,[$APP.sk,$APP.W,$APP.ak,$APP.W],null),$APP.jm,!1],null),"x-scroll-start",new $APP.R(null,2,[$APP.V,new $APP.R(null,2,[$APP.tj,$APP.Y,$APP.sk,$APP.W],null),$APP.jm,!1],null),"x-scroll-end",new $APP.R(null,2,[$APP.V,new $APP.R(null,1,[$APP.sk,$APP.W],null),$APP.jm,!1],null),"x-scroll-loop",new $APP.R(null,2,[$APP.V,new $APP.R(null,1,[$APP.tj,$APP.Y],null),$APP.jm,!0],null)]);
|
|
43
|
+
var V6=new $APP.S(null,new $APP.R(null,2,["vertical",null,"horizontal",null],null),null),U6=new $APP.S(null,new $APP.R(null,4,["none",null,"center",null,"start",null,"end",null],null),null);$APP.ha("baredom.exports.x_scroll.init",I7);export const init=I7;
|
package/dist/x-search-field.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
"input");b=$APP.k(b,"clear");var d=new $APP.
|
|
4
|
-
l:"";m=$APP.n(m)?m:"";p=$APP.F(p);d=$APP.F(d);e=typeof e==="string"&&$APP.I(
|
|
5
|
-
$APP.k(a,"__xSearchFieldInternals");return $APP.n(b)?
|
|
6
|
-
{name:e,value:d},!1)}return null}},
|
|
7
|
-
b=function(){var d=a.getAttribute("name");return $APP.n(d)?d:""}();return $APP.n(function(){var d=a.hasAttribute("required");return $APP.n(d)?$APP.
|
|
8
|
-
"__xSearchFieldInternals");$APP.n(e)&&(e.setFormValue(""),
|
|
9
|
-
"click"));a.__xSearchFieldHandlers=null;return}}return null},
|
|
10
|
-
"value",{configurable:!0,enumerable:!0,get:function(){var b=$APP.k(this,"__xSearchFieldRefs");if($APP.n(b))return $APP.k(b,"input").value;b=this.getAttribute("value");return $APP.n(b)?b:""},set:function(b){b=b!=null&&$APP.N(b)?""+$APP.T.g(b):"";this.setAttribute("value",b);var c=$APP.k(this,"__xSearchFieldRefs");return $APP.n(c)?$APP.k(c,"input").value=b:null}})}
|
|
11
|
-
|
|
2
|
+
var Lp=function(a,b,c){return $APP.n(c)?a.setAttribute(b,""):a.removeAttribute(b)},Mp=function(a,b,c){a=$APP.B.i("",a.value);c=c.hasAttribute("disabled");$APP.n(a?a:c)?b.classList.add("clear-hidden"):b.classList.remove("clear-hidden")},Np=function(a,b,c){a=a.hasAttribute("required");var d=c.value;return $APP.n($APP.n(a)?$APP.B.i(d,""):a)?b.setValidity({valueMissing:!0},"Please fill in this field.",c):b.setValidity({},"",c)},Pp=function(a){var b=$APP.k(a,"__xSearchFieldRefs");if($APP.n(b)){var c=$APP.k(b,
|
|
3
|
+
"input");b=$APP.k(b,"clear");var d=new $APP.R(null,7,[$APP.yl,a.getAttribute("name"),$APP.Cm,a.getAttribute("value"),$APP.Pi,a.getAttribute("placeholder"),$APP.pi,a.getAttribute("label"),$APP.Ml,a.hasAttribute("disabled"),$APP.Nh,a.hasAttribute("required"),$APP.oi,a.getAttribute("autocomplete")],null);var e=$APP.M(d),g=$APP.D(e,$APP.yl),h=$APP.D(e,$APP.Cm),l=$APP.D(e,$APP.Pi),m=$APP.D(e,$APP.pi),p=$APP.D(e,$APP.Ml);d=$APP.D(e,$APP.Nh);e=$APP.D(e,$APP.oi);g=$APP.n(g)?g:"";h=$APP.n(h)?h:"";l=$APP.n(l)?
|
|
4
|
+
l:"";m=$APP.n(m)?m:"";p=$APP.F(p);d=$APP.F(d);e=typeof e==="string"&&$APP.I(Op,e)?e:"off";d=new $APP.R(null,7,[$APP.Aj,g,$APP.Yi,h,$APP.qm,l,$APP.U,m,$APP.X,p,$APP.mi,d,$APP.Zl,e],null);c.name=$APP.Aj.g(d);c.placeholder=$APP.qm.g(d);c.disabled=$APP.X.g(d);c.required=$APP.mi.g(d);c.autocomplete=$APP.Zl.g(d);e=$APP.U.g(d);$APP.n($APP.n(e)?$APP.N(e,""):e)?c.setAttribute("aria-label",e):c.removeAttribute("aria-label");d=$APP.n($APP.mi.g(d))?"true":"false";c.setAttribute("aria-required",d);Mp(c,b,a);b=
|
|
5
|
+
$APP.k(a,"__xSearchFieldInternals");return $APP.n(b)?Np(a,b,c):null}return null},Qp=function(a,b,c,d){return a.dispatchEvent(new CustomEvent(b,{detail:c,bubbles:!0,composed:!0,cancelable:$APP.F(d)}))},Rp=function(a){return function(){var b=$APP.k(a,"__xSearchFieldRefs");if($APP.n(b)){var c=$APP.k(b,"input");b=$APP.k(b,"clear");var d=c.value;var e=a.getAttribute("name");e=$APP.n(e)?e:"";var g=$APP.k(a,"__xSearchFieldInternals");$APP.n(g)&&(g.setFormValue(d),Np(a,g,c));Mp(c,b,a);return Qp(a,"x-search-field-input",
|
|
6
|
+
{name:e,value:d},!1)}return null}},Sp=function(a){return function(){var b=$APP.k(a,"__xSearchFieldRefs");if($APP.n(b)){b=$APP.k(b,"input");var c=b.value;var d=a.getAttribute("name");d=$APP.n(d)?d:"";var e=$APP.k(a,"__xSearchFieldInternals");$APP.n(e)&&(e.setFormValue(c),Np(a,e,b));return Qp(a,"x-search-field-change",{name:d,value:c},!1)}return null}},Tp=function(a){return function(b){if($APP.B.i("Enter",b.key)&&(b.preventDefault(),b=$APP.k(a,"__xSearchFieldRefs"),$APP.n(b))){var c=$APP.k(b,"input").value;
|
|
7
|
+
b=function(){var d=a.getAttribute("name");return $APP.n(d)?d:""}();return $APP.n(function(){var d=a.hasAttribute("required");return $APP.n(d)?$APP.B.i(c,""):d}())?(b=$APP.k(a,"__xSearchFieldInternals"),$APP.n(b)?b.reportValidity():null):Qp(a,"x-search-field-search",{name:b,value:c},!0)}return null}},Up=function(a){return function(){var b=$APP.k(a,"__xSearchFieldRefs");if($APP.n(b)){var c=$APP.k(b,"input");b=$APP.k(b,"clear");var d=a.getAttribute("name");d=$APP.n(d)?d:"";c.value="";var e=$APP.k(a,
|
|
8
|
+
"__xSearchFieldInternals");$APP.n(e)&&(e.setFormValue(""),Np(a,e,c));Mp(c,b,a);Qp(a,"x-search-field-clear",{name:d},!1);return c.focus()}return null}},Vp=function(a){var b=$APP.k(a,"__xSearchFieldRefs");if($APP.n(b)){var c=$APP.k(a,"__xSearchFieldHandlers");if($APP.n(c)){var d=$APP.k(b,"input");b=$APP.k(b,"clear");d.removeEventListener("input",$APP.k(c,"input"));d.removeEventListener("change",$APP.k(c,"change"));d.removeEventListener("keydown",$APP.k(c,"keydown"));b.removeEventListener("click",$APP.k(c,
|
|
9
|
+
"click"));a.__xSearchFieldHandlers=null;return}}return null},Wp=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){var d=this.getAttribute(c);return $APP.n(d)?d:""},set:function(d){d!=null&&$APP.N(d)?(d=""+$APP.T.g(d),d=this.setAttribute(c,d)):d=this.removeAttribute(c);return d}})},Xp=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return Lp(this,c,$APP.F(d))}})},Yp=function(a){Object.defineProperty(a,
|
|
10
|
+
"value",{configurable:!0,enumerable:!0,get:function(){var b=$APP.k(this,"__xSearchFieldRefs");if($APP.n(b))return $APP.k(b,"input").value;b=this.getAttribute("value");return $APP.n(b)?b:""},set:function(b){b=b!=null&&$APP.N(b)?""+$APP.T.g(b):"";this.setAttribute("value",b);var c=$APP.k(this,"__xSearchFieldRefs");return $APP.n(c)?$APP.k(c,"input").value=b:null}})},$p=function(){var a=class extends HTMLElement{},b=a.prototype;a.formAssociated=!0;Object.defineProperty(a,"observedAttributes",{get:function(){return Zp}});
|
|
11
|
+
Yp(b);Wp(b,"name","name");Wp(b,"placeholder","placeholder");Wp(b,"label","label");Wp(b,"autocomplete","autocomplete");Xp(b,"disabled","disabled");Xp(b,"required","required");b.checkValidity=function(){var c=$APP.k(this,"__xSearchFieldInternals");return $APP.n(c)?c.checkValidity():!0};b.reportValidity=function(){var c=$APP.k(this,"__xSearchFieldInternals");return $APP.n(c)?c.reportValidity():!0};b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xSearchFieldRefs"))){if(!$APP.n(this.shadowRoot)){var c=
|
|
12
12
|
this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("div"),g=document.createElement("span"),h=document.createElement("input"),l=document.createElement("button");d.textContent=":host{display:block;color-scheme:light dark;--x-search-field-bg:var(--x-color-surface,#ffffff);--x-search-field-color:#111827;--x-search-field-border:1px solid var(--x-color-border,#d1d5db);--x-search-field-border-radius:var(--x-radius-md,6px);--x-search-field-focus-ring-color:var(--x-color-primary,#2563eb);--x-search-field-icon-color:var(--x-color-border,#9ca3af);--x-search-field-clear-color:var(--x-color-border,#9ca3af);--x-search-field-disabled-opacity:0.45;}@media (prefers-color-scheme:dark){:host{--x-search-field-bg:var(--x-color-surface,#1f2937);--x-search-field-color:#f9fafb;--x-search-field-border:1px solid var(--x-color-border,#4b5563);--x-search-field-focus-ring-color:var(--x-color-primary,#3b82f6);--x-search-field-icon-color:#6b7280;--x-search-field-clear-color:#6b7280;}}[part\x3dwrapper]{display:flex;align-items:center;position:relative;background:var(--x-search-field-bg);border:var(--x-search-field-border);border-radius:var(--x-search-field-border-radius);transition:border-color 120ms ease,box-shadow 120ms ease;}[part\x3dwrapper]:focus-within{border-color:var(--x-search-field-focus-ring-color);box-shadow:0 0 0 3px color-mix(in srgb,var(--x-search-field-focus-ring-color) 20%,transparent);}[part\x3dicon]{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:36px;color:var(--x-search-field-icon-color);pointer-events:none;}[part\x3dinput]{flex:1;min-width:0;padding:0.5rem 0.25rem;background:transparent;color:var(--x-search-field-color);border:none;outline:none;font-size:1rem;line-height:1.5;font-family:inherit;}[part\x3dinput]::-webkit-search-cancel-button{-webkit-appearance:none;}[part\x3dinput]::-webkit-search-decoration{-webkit-appearance:none;}[part\x3dclear]{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:32px;height:32px;margin-right:2px;background:none;border:none;cursor:pointer;color:var(--x-search-field-clear-color);font-size:1.125rem;line-height:1;border-radius:4px;padding:0;}[part\x3dclear]:hover{color:var(--x-search-field-color);}.clear-hidden{display:none;}:host([disabled]) [part\x3dwrapper]{opacity:var(--x-search-field-disabled-opacity);cursor:not-allowed;}:host([disabled]) [part\x3dinput]{cursor:not-allowed;}@media (prefers-reduced-motion:reduce){[part\x3dwrapper]{transition:none;}}";
|
|
13
13
|
e.setAttribute("part","wrapper");g.setAttribute("part","icon");g.innerHTML='\x3csvg xmlns\x3d"http://www.w3.org/2000/svg" width\x3d"16" height\x3d"16" viewBox\x3d"0 0 24 24" fill\x3d"none" stroke\x3d"currentColor" stroke-width\x3d"2" stroke-linecap\x3d"round" stroke-linejoin\x3d"round" aria-hidden\x3d"true"\x3e\x3ccircle cx\x3d"11" cy\x3d"11" r\x3d"8"/\x3e\x3cline x1\x3d"21" y1\x3d"21" x2\x3d"16.65" y2\x3d"16.65"/\x3e\x3c/svg\x3e';h.setAttribute("part","input");h.setAttribute("type","search");h.setAttribute("spellcheck",
|
|
14
|
-
"false");l.setAttribute("part","clear");l.setAttribute("type","button");l.setAttribute("aria-label","Clear search");l.textContent="×";l.classList.add("clear-hidden");e.appendChild(g);e.appendChild(h);e.appendChild(l);c.appendChild(d);c.appendChild(e);this.__xSearchFieldRefs={wrapper:e,icon:g,input:h,clear:l}}$APP.n(this.attachInternals)&&(this.__xSearchFieldInternals=this.attachInternals())}
|
|
15
|
-
(c.value=d));c=$APP.k(this,"__xSearchFieldInternals");$APP.n(c)&&(d=c.setFormValue,e=this.getAttribute("value"),d.call(c,$APP.n(e)?e:""));d=$APP.k(this,"__xSearchFieldRefs");$APP.n(d)&&(c=$APP.k(d,"input"),d=$APP.k(d,"clear"),e=
|
|
16
|
-
b.attributeChangedCallback=function(c,d,e){$APP.
|
|
17
|
-
return a}
|
|
14
|
+
"false");l.setAttribute("part","clear");l.setAttribute("type","button");l.setAttribute("aria-label","Clear search");l.textContent="×";l.classList.add("clear-hidden");e.appendChild(g);e.appendChild(h);e.appendChild(l);c.appendChild(d);c.appendChild(e);this.__xSearchFieldRefs={wrapper:e,icon:g,input:h,clear:l}}$APP.n(this.attachInternals)&&(this.__xSearchFieldInternals=this.attachInternals())}Vp(this);c=$APP.k(this,"__xSearchFieldRefs");$APP.n(c)&&(c=$APP.k(c,"input"),d=this.getAttribute("value"),$APP.n(d)&&
|
|
15
|
+
(c.value=d));c=$APP.k(this,"__xSearchFieldInternals");$APP.n(c)&&(d=c.setFormValue,e=this.getAttribute("value"),d.call(c,$APP.n(e)?e:""));d=$APP.k(this,"__xSearchFieldRefs");$APP.n(d)&&(c=$APP.k(d,"input"),d=$APP.k(d,"clear"),e=Rp(this),g=Sp(this),h=Tp(this),l=Up(this),c.addEventListener("input",e),c.addEventListener("change",g),c.addEventListener("keydown",h),d.addEventListener("click",l),this.__xSearchFieldHandlers={input:e,change:g,keydown:h,click:l});return Pp(this)};b.disconnectedCallback=function(){return Vp(this)};
|
|
16
|
+
b.attributeChangedCallback=function(c,d,e){$APP.B.i(c,"value")&&(c=$APP.k(this,"__xSearchFieldRefs"),$APP.n(c)&&(c=$APP.k(c,"input"),$APP.N(c.value,e)&&(c.value=$APP.n(e)?e:"")));return Pp(this)};b.formDisabledCallback=function(c){Lp(this,"disabled",$APP.F(c));return Pp(this)};b.formResetCallback=function(){this.removeAttribute("value");var c=$APP.k(this,"__xSearchFieldRefs");$APP.n(c)&&($APP.k(c,"input").value="");c=$APP.k(this,"__xSearchFieldInternals");$APP.n(c)&&c.setFormValue("");return Pp(this)};
|
|
17
|
+
return a},aq=function(){return $APP.n(customElements.get("x-search-field"))?null:customElements.define("x-search-field",$p())};var Zp="name value placeholder label disabled required autocomplete".split(" "),Op=new $APP.S(null,new $APP.R(null,2,["off",null,"on",null],null),null);$APP.ha("baredom.exports.x_search_field.init",aq);export const init=aq;
|
package/dist/x-select.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
"md";c=new $APP.
|
|
4
|
-
$APP.N(e,"")?(b.textContent=e,b.hidden=!1):b.hidden=!0;l.value=$APP.n(m)?m:"";a.setAttribute("data-size",g);$APP.n(h)?a.setAttribute("data-disabled",""):a.removeAttribute("data-disabled");return c==null||$APP.
|
|
5
|
-
g=e;if($APP.n($APP.n(g)?e!==d:g))c.removeChild(e);else break}d=$APP.t($APP.uc(b));b=null;for(g=e=0;;)if(g<e){var h=b.F(null,g),l=h.tagName.toLowerCase();($APP.
|
|
6
|
-
|
|
7
|
-
$APP.k(c,"change"));d.removeEventListener("slotchange",$APP.k(c,"slotchange"));a.__xSelectHandlers=null;return}}return null},
|
|
8
|
-
null&&$APP.N(b)?(b=""+$APP.T.g(b),b=this.setAttribute("value",b)):b=this.removeAttribute("value");return b}})},
|
|
2
|
+
var GS=function(a){var b=$APP.k(a,"__xSelectRefs");if($APP.n(b)){var c=new $APP.R(null,6,[$APP.Ml,a.hasAttribute("disabled"),$APP.Nh,a.hasAttribute("required"),$APP.Ul,a.getAttribute("size"),$APP.Pi,a.getAttribute("placeholder"),$APP.Cm,a.getAttribute("value"),$APP.yl,a.getAttribute("name")],null);var d=$APP.M(c),e=$APP.D(d,$APP.Ml),g=$APP.D(d,$APP.Nh),h=$APP.D(d,$APP.Ul);c=$APP.D(d,$APP.Pi);var l=$APP.D(d,$APP.Cm);d=$APP.D(d,$APP.yl);e=$APP.F(e);g=$APP.F(g);h=typeof h==="string"&&$APP.I(FS,h)?h:
|
|
3
|
+
"md";c=new $APP.R(null,6,[$APP.X,e,$APP.mi,g,$APP.Mh,h,$APP.qm,c,$APP.Yi,l,$APP.Aj,d],null);if($APP.N(c,$APP.k(a,"__xSelectModel"))){a.__xSelectModel=c;a=$APP.k(b,"wrapper");l=$APP.k(b,"select");b=$APP.k(b,"placeholder-opt");h=$APP.X.g(c);d=$APP.mi.g(c);g=$APP.Mh.g(c);e=$APP.qm.g(c);var m=$APP.Yi.g(c);c=$APP.Aj.g(c);l.disabled=h;$APP.n(d)?l.setAttribute("required",""):l.removeAttribute("required");typeof c==="string"&&$APP.N(c,"")?l.setAttribute("name",c):l.removeAttribute("name");typeof e==="string"&&
|
|
4
|
+
$APP.N(e,"")?(b.textContent=e,b.hidden=!1):b.hidden=!0;l.value=$APP.n(m)?m:"";a.setAttribute("data-size",g);$APP.n(h)?a.setAttribute("data-disabled",""):a.removeAttribute("data-disabled");return c==null||$APP.B.i(c,"")?l.setAttribute("aria-label",$APP.n(e)?e:"select"):l.removeAttribute("aria-label")}}return null},HS=function(a){var b=$APP.k(a,"__xSelectRefs");if($APP.n(b)){var c=$APP.k(b,"select"),d=$APP.k(b,"placeholder-opt");for(b=$APP.k(b,"slot").assignedElements({flatten:!0});;){var e=c.lastChild,
|
|
5
|
+
g=e;if($APP.n($APP.n(g)?e!==d:g))c.removeChild(e);else break}d=$APP.t($APP.uc(b));b=null;for(g=e=0;;)if(g<e){var h=b.F(null,g),l=h.tagName.toLowerCase();($APP.B.i(l,"option")||$APP.B.i(l,"optgroup"))&&c.appendChild(h.cloneNode(!0));g+=1}else if(d=$APP.t(d))$APP.Nc(d)?(e=$APP.yb(d),d=$APP.zb(d),b=e,e=$APP.z(e)):(b=$APP.u(d),e=b.tagName.toLowerCase(),($APP.B.i(e,"option")||$APP.B.i(e,"optgroup"))&&c.appendChild(b.cloneNode(!0)),d=$APP.w(d),b=null,e=0),g=0;else break;a.__xSelectModel=null;return GS(a)}return null},
|
|
6
|
+
IS=function(a){return function(){var b=$APP.k(a,"__xSelectRefs");return $APP.n(b)?(b=$APP.k(b,"select"),a.dispatchEvent(new CustomEvent("select-change",{detail:{value:b.value,label:b.selectedOptions.length>0?b.selectedOptions[0].text:""},bubbles:!0,composed:!0,cancelable:!1}))):null}},JS=function(a){return function(){return HS(a)}},KS=function(a){var b=$APP.k(a,"__xSelectRefs");if($APP.n(b)){var c=$APP.k(a,"__xSelectHandlers");if($APP.n(c)){var d=$APP.k(b,"slot");$APP.k(b,"select").removeEventListener("change",
|
|
7
|
+
$APP.k(c,"change"));d.removeEventListener("slotchange",$APP.k(c,"slotchange"));a.__xSelectHandlers=null;return}}return null},LS=function(a,b,c){Object.defineProperty(a,b,{configurable:!0,enumerable:!0,get:function(){return this.hasAttribute(c)},set:function(d){return $APP.n($APP.F(d))?this.setAttribute(c,""):this.removeAttribute(c)}})},MS=function(a){Object.defineProperty(a,"value",{configurable:!0,enumerable:!0,get:function(){var b=this.getAttribute("value");return $APP.n(b)?b:null},set:function(b){b!=
|
|
8
|
+
null&&$APP.N(b)?(b=""+$APP.T.g(b),b=this.setAttribute("value",b)):b=this.removeAttribute("value");return b}})},OS=function(){var a=class extends HTMLElement{},b=a.prototype;Object.defineProperty(a,"observedAttributes",{get:function(){return NS}});LS(b,"disabled","disabled");LS(b,"required","required");MS(b);b.connectedCallback=function(){if(!$APP.n($APP.k(this,"__xSelectRefs"))){var c=this.attachShadow({mode:"open"}),d=document.createElement("style"),e=document.createElement("div"),g=document.createElement("select"),
|
|
9
9
|
h=document.createElement("option"),l=document.createElement("span"),m=document.createElement("slot");d.textContent=":host{display:inline-block;color-scheme:light dark;--x-select-height-sm:2rem;--x-select-height-md:2.5rem;--x-select-height-lg:3rem;--x-select-radius:var(--x-radius-md,0.5rem);--x-select-font-size-sm:0.75rem;--x-select-font-size-md:var(--x-font-size-sm,0.875rem);--x-select-font-size-lg:var(--x-font-size-base,1rem);--x-select-padding-inline:0.75rem;--x-select-bg:var(--x-color-bg,#ffffff);--x-select-bg-disabled:var(--x-color-bg,#f8fafc);--x-select-fg:var(--x-color-text,#0f172a);--x-select-fg-disabled:var(--x-color-text-muted,#94a3b8);--x-select-placeholder-fg:var(--x-color-text-muted,#94a3b8);--x-select-border:var(--x-color-border,#cbd5e1);--x-select-border-hover:var(--x-color-border,#94a3b8);--x-select-border-focus:var(--x-color-primary,#3b82f6);--x-select-chevron:var(--x-color-text-muted,#64748b);--x-select-focus-ring:var(--x-color-focus-ring,#93c5fd);--x-select-shadow:var(--x-shadow-sm,0 1px 2px rgba(15,23,42,0.06));--x-select-transition-duration:var(--x-transition-duration,140ms);}@media (prefers-color-scheme:dark){:host{--x-select-bg:var(--x-color-bg,#1f2937);--x-select-bg-disabled:var(--x-color-bg,#111827);--x-select-fg:var(--x-color-text,#f1f5f9);--x-select-border:var(--x-color-border,#374151);--x-select-border-hover:var(--x-color-border,#4b5563);--x-select-border-focus:var(--x-color-focus-ring,#60a5fa);--x-select-chevron:var(--x-color-text-muted,#94a3b8);}}[part\x3dwrapper]{position:relative;display:flex;align-items:stretch;height:var(--x-select-height-md);border:1px solid var(--x-select-border);border-radius:var(--x-select-radius);background:var(--x-select-bg);box-shadow:var(--x-select-shadow);transition:border-color var(--x-select-transition-duration) ease,box-shadow var(--x-select-transition-duration) ease;overflow:hidden;font-size:var(--x-select-font-size-md);}[part\x3dwrapper][data-size\x3dsm]{height:var(--x-select-height-sm);font-size:var(--x-select-font-size-sm);}[part\x3dwrapper][data-size\x3dlg]{height:var(--x-select-height-lg);font-size:var(--x-select-font-size-lg);}[part\x3dwrapper][data-disabled]{background:var(--x-select-bg-disabled);opacity:0.6;pointer-events:none;}[part\x3dwrapper]:hover:not([data-disabled]){border-color:var(--x-select-border-hover);}[part\x3dwrapper]:focus-within:not([data-disabled]){border-color:var(--x-select-border-focus);box-shadow:0 0 0 3px var(--x-select-focus-ring);}[part\x3dselect]{appearance:none;-webkit-appearance:none;flex:1;min-width:0;background:transparent;border:none;outline:none;color:var(--x-select-fg);font-size:inherit;font-family:inherit;padding-inline:var(--x-select-padding-inline);padding-inline-end:calc(var(--x-select-padding-inline) + 1.75rem);cursor:pointer;width:100%;}[part\x3dselect]:disabled{color:var(--x-select-fg-disabled);cursor:default;}[part\x3dselect] option[data-placeholder]{color:var(--x-select-placeholder-fg);}[part\x3dchevron]{position:absolute;right:var(--x-select-padding-inline);top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;pointer-events:none;color:var(--x-select-chevron);width:1rem;height:1rem;}slot{display:none;}@media (prefers-reduced-motion:reduce){[part\x3dwrapper]{transition:none;}}";
|
|
10
10
|
e.setAttribute("part","wrapper");g.setAttribute("part","select");l.setAttribute("part","chevron");l.setAttribute("aria-hidden","true");h.setAttribute("data-placeholder","");h.setAttribute("value","");h.hidden=!0;h.disabled=!0;h.selected=!0;l.innerHTML='\x3csvg xmlns\x3d"http://www.w3.org/2000/svg" width\x3d"16" height\x3d"16" viewBox\x3d"0 0 16 16" fill\x3d"none" stroke\x3d"currentColor" stroke-width\x3d"2" stroke-linecap\x3d"round" stroke-linejoin\x3d"round" aria-hidden\x3d"true"\x3e\x3cpolyline points\x3d"4 6 8 10 12 6"/\x3e\x3c/svg\x3e';
|
|
11
|
-
g.appendChild(h);e.appendChild(g);e.appendChild(l);c.appendChild(d);c.appendChild(e);c.appendChild(m);this.__xSelectRefs={root:c,wrapper:e,select:g,"placeholder-opt":h,slot:m,chevron:l}}
|
|
12
|
-
function(c,d,e){return $APP.N(d,e)?
|
|
11
|
+
g.appendChild(h);e.appendChild(g);e.appendChild(l);c.appendChild(d);c.appendChild(e);c.appendChild(m);this.__xSelectRefs={root:c,wrapper:e,select:g,"placeholder-opt":h,slot:m,chevron:l}}KS(this);c=$APP.k(this,"__xSelectRefs");$APP.n(c)&&(d=$APP.k(c,"slot"),e=IS(this),g=JS(this),h={change:e,slotchange:g},$APP.k(c,"select").addEventListener("change",e),d.addEventListener("slotchange",g),this.__xSelectHandlers=h);HS(this);return GS(this)};b.disconnectedCallback=function(){return KS(this)};b.attributeChangedCallback=
|
|
12
|
+
function(c,d,e){return $APP.N(d,e)?GS(this):null};return a},PS=function(){return $APP.n(customElements.get("x-select"))?null:customElements.define("x-select",OS())};var FS=new $APP.S(null,new $APP.R(null,3,["md",null,"lg",null,"sm",null],null),null),NS="disabled required size placeholder value name".split(" ");$APP.Pd(["select-change",new $APP.R(null,2,[$APP.jm,!1,$APP.V,new $APP.R(null,2,[$APP.Yi,$APP.Y,$APP.U,$APP.Y],null)],null)]);$APP.ha("baredom.exports.x_select.init",PS);export const init=PS;
|