@vanelsas/baredom 2.8.0 → 3.0.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 +45 -0
- package/README.md +1 -1
- package/custom-elements.json +467 -0
- package/dist/baredom.d.ts +25 -0
- package/dist/base.js +541 -452
- package/dist/integrity.json +103 -97
- package/dist/x-alert.js +16 -17
- package/dist/x-avatar-group.js +9 -9
- package/dist/x-avatar.js +14 -15
- package/dist/x-badge.js +9 -9
- package/dist/x-bento-grid.js +5 -5
- package/dist/x-bento-item.js +4 -4
- package/dist/x-breadcrumbs.js +13 -13
- package/dist/x-button.js +1 -16
- package/dist/x-cancel-dialogue.js +13 -13
- package/dist/x-card.js +7 -7
- package/dist/x-carousel.js +31 -31
- package/dist/x-chart.js +47 -47
- package/dist/x-checkbox.js +1 -11
- package/dist/x-chip.js +1 -1
- package/dist/x-collapse.js +10 -10
- package/dist/x-color-picker.js +45 -44
- package/dist/x-combobox.js +26 -26
- package/dist/x-command-palette.js +24 -24
- package/dist/x-confetti.d.ts +50 -0
- package/dist/x-confetti.js +25 -0
- package/dist/x-container.js +5 -4
- package/dist/x-context-menu.js +20 -20
- package/dist/x-copy.js +20 -20
- package/dist/x-currency-field.js +23 -23
- package/dist/x-date-picker.js +40 -40
- package/dist/x-divider.js +9 -9
- package/dist/x-drawer.js +9 -9
- package/dist/x-dropdown.js +11 -11
- package/dist/x-fieldset.js +5 -5
- package/dist/x-file-download.js +7 -7
- package/dist/x-file-upload.js +22 -22
- package/dist/x-form-field.js +15 -15
- package/dist/x-form.js +9 -9
- package/dist/x-gaussian-blur.js +12 -12
- package/dist/x-grid.js +7 -6
- package/dist/x-i18n-provider.js +7 -7
- package/dist/x-i18n.js +4 -4
- package/dist/x-icon.js +6 -6
- package/dist/x-image.js +16 -17
- package/dist/x-kbd.d.ts +17 -0
- package/dist/x-kbd.js +17 -0
- package/dist/x-kinetic-canvas.js +25 -25
- package/dist/x-kinetic-font.js +27 -27
- package/dist/x-kinetic-typography.js +33 -33
- package/dist/x-liquid-dock.js +38 -39
- package/dist/x-liquid-fill.js +44 -44
- package/dist/x-liquid-glass.js +47 -47
- package/dist/x-menu-item.js +8 -8
- package/dist/x-menu.js +10 -9
- package/dist/x-metaball-cursor.js +26 -27
- package/dist/x-modal.js +10 -10
- package/dist/x-morph-stack.js +36 -37
- package/dist/x-multi-combobox.js +36 -36
- package/dist/x-navbar.js +12 -12
- package/dist/x-neural-glow.js +32 -32
- package/dist/x-notification-center.js +9 -9
- package/dist/x-organic-divider.js +17 -17
- package/dist/x-organic-progress.js +37 -37
- package/dist/x-organic-shape.js +13 -13
- package/dist/x-otp-input.d.ts +55 -0
- package/dist/x-otp-input.js +23 -0
- package/dist/x-pagination.js +15 -15
- package/dist/x-particle-button.js +51 -51
- package/dist/x-popover.js +25 -26
- package/dist/x-progress-circle.js +8 -8
- package/dist/x-progress.js +10 -10
- package/dist/x-proximity-list.d.ts +43 -0
- package/dist/x-proximity-list.js +21 -0
- package/dist/x-radio.js +11 -11
- package/dist/x-ripple-effect.js +10 -10
- package/dist/x-scroll-parallax.js +18 -18
- package/dist/x-scroll-stack.js +17 -17
- package/dist/x-scroll-story.js +34 -34
- package/dist/x-scroll-timeline.js +45 -45
- package/dist/x-scroll.js +38 -38
- package/dist/x-search-field.js +1 -15
- package/dist/x-select.js +1 -11
- package/dist/x-sidebar.js +15 -15
- package/dist/x-skeleton-group.js +12 -12
- package/dist/x-skeleton.js +1 -1
- package/dist/x-slider.js +15 -15
- package/dist/x-soft-body.js +22 -22
- package/dist/x-spacer.js +4 -4
- package/dist/x-spinner.js +4 -4
- package/dist/x-splash.js +12 -12
- package/dist/x-spotlight-card.d.ts +19 -0
- package/dist/x-spotlight-card.js +13 -0
- package/dist/x-stat.js +10 -10
- package/dist/x-stepper.js +14 -14
- package/dist/x-switch.js +10 -10
- package/dist/x-tab.js +7 -7
- package/dist/x-table-cell.js +18 -18
- package/dist/x-table-row.js +8 -8
- package/dist/x-table.js +12 -12
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.js +19 -19
- package/dist/x-theme.js +25 -25
- package/dist/x-timeline-item.js +20 -21
- package/dist/x-timeline.js +8 -8
- package/dist/x-toast.js +21 -22
- package/dist/x-toaster.js +8 -8
- package/dist/x-tooltip.js +12 -12
- package/dist/x-trace-history.d.ts +242 -0
- package/dist/x-trace-history.js +118 -0
- package/dist/x-typography.js +9 -9
- package/dist/x-welcome-tour.js +60 -59
- package/package.json +32 -2
package/dist/x-menu.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
(
|
|
4
|
-
|
|
5
|
-
0))return b.preventDefault(),e[e.length-1].focus();return null},
|
|
6
|
-
$APP.
|
|
7
|
-
return $APP.n($APP.n(l)?
|
|
2
|
+
var RY=function(a){a=a.querySelectorAll("x-menu-item");for(var b=[],c=a.length,d=0;;)if(d<c){var e=a[d];$APP.p(e.hasAttribute("disabled"))&&$APP.I(e.getAttribute("type"),"divider")&&b.push(e);d+=1}else break;return b},SY=function(a){$APP.n(a.hasAttribute("open"))||($APP.S(a,"open",""),$APP.Nh(a,"x-menu-open",{}));if($APP.n(null)){a=RY(a);var b=a.length;return b>0?$APP.A.j(null,Ica)?a[0].focus():$APP.A.j(null,Jca)?a[b-1].focus():null:null}return null},TY=function(a,b){$APP.n(a.hasAttribute("open"))&&
|
|
3
|
+
($APP.T(a,"open"),$APP.Nh(a,"x-menu-close",{}));return $APP.n(b)?(a=$APP.k(a,"__xMenuRefs"),a=$APP.n(a)?$APP.k(a,"trigger-slot"):null,a=$APP.n(a)?a.assignedElements():null,a=$APP.n($APP.n(a)?a.length>0:a)?a[0]:null,$APP.n(a)?a.focus():null):null},Kca=function(a,b){var c=b.composedPath();a=$APP.Ac(a.assignedElements());return $APP.D($APP.ge(function(d){return c.indexOf(d)>-1},a))},Lca=function(a,b){var c=b.key,d=a.hasAttribute("open");if($APP.A.j(c,"Escape"))return $APP.n(d)?(b.preventDefault(),TY(a,
|
|
4
|
+
!0)):null;if($APP.A.j(c,"Tab"))return $APP.n(d)?TY(a,!1):null;if($APP.A.j(c,"ArrowDown")||$APP.A.j(c,"ArrowUp")){var e=RY(a),f=e.length;if(f>0){b.preventDefault();if($APP.n(d))return a=e.indexOf(document.activeElement),c=$APP.A.j(c,"ArrowDown")?a>=f-1?0:a<0?0:a+1:a<=0?f-1:a-1,e[c].focus();SY(a);return e[$APP.A.j(c,"ArrowDown")?0:f-1].focus()}}else if($APP.A.j(c,"Home")){if($APP.n(d)&&(e=RY(a),e.length>0))return b.preventDefault(),e[0].focus()}else if($APP.A.j(c,"End")&&$APP.n(d)&&(e=RY(a),e.length>
|
|
5
|
+
0))return b.preventDefault(),e[e.length-1].focus();return null},UY=function(a){var b=$APP.k(a,"__xMenuRefs");b=$APP.n(b)?$APP.k(b,"popup"):null;a=new $APP.O(null,3,[$APP.wq,a.hasAttribute("open"),$APP.Vn,a.getAttribute("placement"),$APP.Z,a.getAttribute("label")],null);a=$APP.G(a);var c=$APP.C(a,$APP.wq),d=$APP.C(a,$APP.Vn);a=$APP.C(a,$APP.Z);c=$APP.D(c);d=$APP.n(d)?d:"";d=$APP.$c(Mca,d)?d:"bottom-start";a=new $APP.O(null,3,[$APP.wq,c,$APP.Vn,d,$APP.Z,$APP.n(a)?a:""],null);return $APP.n(b)?(b.setAttribute("data-placement",
|
|
6
|
+
$APP.Vn.i(a)),a=$APP.Z.i(a),$APP.n($APP.n(a)?$APP.I(a,""):a)?b.setAttribute("aria-label",a):b.removeAttribute("aria-label")):null},VY=function(a){function b(h){h.stopPropagation();h=h.detail.value;TY(a,!1);return $APP.Nh(a,"x-menu-select",{value:$APP.n(h)?h:""})}function c(h){return Lca(a,h)}function d(h){$APP.n(a.hasAttribute("open"))?(h=h.composedPath(),h=$APP.A.j(-1,h.indexOf(a))?TY(a,!1):null):h=null;return h}function e(h){var l=$APP.k(a,"__xMenuRefs");l=$APP.n(l)?$APP.k(l,"trigger-slot"):null;
|
|
7
|
+
return $APP.n($APP.n(l)?Kca(l,h):l)?$APP.n(a.hasAttribute("open"))?TY(a,!0):SY(a):null}var f={};a.addEventListener("click",e);document.addEventListener("click",d,!0);a.addEventListener("keydown",c);a.addEventListener("x-menu-item-select",b);f.click=e;f["doc-click"]=d;f.keydown=c;f["item-select"]=b;$APP.R(a,"__xMenuHandlers",f)},Nca=function(a){if($APP.Fh(a,"__xMenuInit"))return VY(a),UY(a);if(!$APP.Fh(a,"__xMenuInit")){var b=a.attachShadow({mode:"open"}),c=document.createElement("style"),d=document.createElement("div"),
|
|
8
8
|
e=document.createElement("slot"),f=document.createElement("div"),h=document.createElement("slot");c.textContent=":host{display:inline-block;position:relative;color-scheme:light dark;--x-menu-bg:var(--x-color-bg,#ffffff);--x-menu-border:1px solid var(--x-color-border,#e5e7eb);--x-menu-border-radius:var(--x-radius-md,8px);--x-menu-shadow:var(--x-shadow-md,0 4px 16px rgba(0,0,0,0.12));--x-menu-min-width:160px;--x-menu-padding:4px;--x-menu-z-index:1000;}@media (prefers-color-scheme:dark){:host{--x-menu-bg:var(--x-color-bg,#1f2937);--x-menu-border:1px solid var(--x-color-border,#374151);--x-menu-shadow:var(--x-shadow-md,0 4px 16px rgba(0,0,0,0.4));}}.base{position:relative;display:inline-block;}.popup{display:none;position:absolute;background:var(--x-menu-bg);border:var(--x-menu-border);border-radius:var(--x-menu-border-radius);box-shadow:var(--x-menu-shadow);min-width:var(--x-menu-min-width);max-width:calc(100vw - 1rem);padding:var(--x-menu-padding);z-index:var(--x-menu-z-index);box-sizing:border-box;}:host([open]) .popup{display:block;}.popup[data-placement\x3d'bottom-start']{top:100%;left:0;margin-top:4px;}.popup[data-placement\x3d'bottom-end']{top:100%;right:0;margin-top:4px;}.popup[data-placement\x3d'top-start']{bottom:100%;left:0;margin-bottom:4px;}.popup[data-placement\x3d'top-end']{bottom:100%;right:0;margin-bottom:4px;}";
|
|
9
|
-
d.setAttribute("part","base");d.className="base";e.setAttribute("name","trigger");f.setAttribute("part","popup");f.className="popup";f.setAttribute("role","menu");f.appendChild(h);d.appendChild(e);d.appendChild(f);b.appendChild(c);b.appendChild(d);b={};b.base=d;b.popup=f;b["trigger-slot"]=e;b["item-slot"]=h
|
|
10
|
-
a.removeEventListener("click",$APP.k(b,"click"));document.removeEventListener("click",c,!0);a.removeEventListener("keydown",d);a=a.removeEventListener("x-menu-item-select",e)}else a=null;return a},
|
|
11
|
-
|
|
9
|
+
d.setAttribute("part","base");d.className="base";e.setAttribute("name","trigger");f.setAttribute("part","popup");f.className="popup";f.setAttribute("role","menu");f.appendChild(h);d.appendChild(e);d.appendChild(f);b.appendChild(c);b.appendChild(d);b={};b.base=d;b.popup=f;b["trigger-slot"]=e;b["item-slot"]=h;$APP.R(a,"__xMenuRefs",b);VY(a);$APP.R(a,"__xMenuInit",!0)}UY(a);return a},Oca=function(a){var b=$APP.k(a,"__xMenuHandlers");if($APP.n(b)){var c=$APP.k(b,"doc-click"),d=$APP.k(b,"keydown"),e=$APP.k(b,
|
|
10
|
+
"item-select");a.removeEventListener("click",$APP.k(b,"click"));document.removeEventListener("click",c,!0);a.removeEventListener("keydown",d);a=a.removeEventListener("x-menu-item-select",e)}else a=null;return a},Pca=function(a){return $APP.Fh(a,"__xMenuInit")?UY(a):null},Rca=function(a){return $APP.Zh(a,Qca)},WY=function(){return $APP.Ah("x-menu",new $APP.O(null,5,[$APP.qh,Sca,$APP.oh,Nca,$APP.lh,Oca,$APP.kh,Pca,$APP.ph,Rca],null))},Jca=new $APP.F(null,"last","last",1105735132),Ica=new $APP.F(null,
|
|
11
|
+
"first","first",-644103046);var Sca=["open","placement","label"],Mca=new $APP.pg(null,new $APP.O(null,4,["bottom-start",null,"bottom-end",null,"top-end",null,"top-start",null],null),null),Qca=new $APP.O(null,3,[$APP.wq,new $APP.O(null,2,[$APP.Q,$APP.Xh,$APP.W,"open"],null),$APP.Vn,new $APP.O(null,2,[$APP.Q,$APP.X,$APP.W,"placement"],null),$APP.Z,new $APP.O(null,2,[$APP.Q,$APP.X,$APP.W,"label"],null)],null);
|
|
12
|
+
$APP.ce(["x-menu-open",new $APP.O(null,1,[$APP.U,$APP.de],null),"x-menu-close",new $APP.O(null,1,[$APP.U,$APP.de],null),"x-menu-select",new $APP.O(null,1,[$APP.U,new $APP.O(null,1,[$APP.Eh,$APP.X],null)],null)]);$APP.ha("baredom.exports.x_menu.init",WY);export const init=WY;
|
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
3:Math.min(20,Math.max(.5,a))}return 3},
|
|
4
|
-
function(a){return typeof a==="string"&&a.trim().length>0?a.trim():"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -10"},
|
|
5
|
-
return b},
|
|
6
|
-
var b=$APP.
|
|
7
|
-
|
|
8
|
-
window.addEventListener("pointermove",b);a.__xMetaballHandler=b},
|
|
9
|
-
set:function(b){return b==null?this.removeAttribute("blob-size"):this.setAttribute("blob-size",""+$APP.
|
|
10
|
-
null?this.removeAttribute("noise-scale"):this.setAttribute("noise-scale",""+$APP.
|
|
11
|
-
this.removeAttribute("noise-intensity"):this.setAttribute("noise-intensity",""+$APP.
|
|
12
|
-
this.setAttribute("threshold",""+$APP.
|
|
13
|
-
d+1;var e="mb-"+$APP.
|
|
14
|
-
"defs"),
|
|
15
|
-
"140%");
|
|
16
|
-
|
|
17
|
-
0;;)if(l<h)m=f[l],$APP.n(m.parentNode)&&m.parentNode.removeChild(m),l+=1;else break;a.__xMetaballBlobs=[];a.__xMetaballPos=[]}h=$APP.
|
|
18
|
-
e;a.__xMetaballPos=c;f=
|
|
19
|
-
h=$APP.C(f,$APP.
|
|
20
|
-
c;f=$APP.
|
|
21
|
-
5,[$APP.
|
|
22
|
-
"palette","palette",-456203511),
|
|
23
|
-
$APP.
|
|
24
|
-
null),new $APP.
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
$APP.
|
|
28
|
-
$APP.Q.g(x)+"px,"+$APP.Q.g(v)+"px) translate(-50%,-50%)";q+=1}else break;$APP.n(vO.g(l))&&(d=$APP.k(a,"__xMetaballSeed")+rO.g(l),e=$APP.k(a,"__xMetaballRefs"),a.__xMetaballSeed=d,e=$APP.fn.g(e),$APP.n(e)&&e.setAttribute("seed",""+$APP.Q.g(Math.floor(d))));$APP.fa(a,"__xMetaballRaf",requestAnimationFrame(function(){return zO.g?zO.g(a):zO.call(null,a)}))}return null};$APP.ca("baredom.exports.x_metaball_cursor.init",KO);export const init=KO;
|
|
2
|
+
var eW=function(a){if(typeof a==="string"){a=parseInt(a.trim(),10);var b=isNaN(a);return $APP.n($APP.n(b)?b:!(a>0))?5:Math.min(10,Math.max(2,a))}return 5},fW=function(a){if(typeof a==="string"){a=parseFloat(a.trim());var b=isNaN(a);return $APP.n($APP.n(b)?b:!(a>0))?40:Math.min(200,Math.max(10,a))}return 40},gW=function(a){return typeof a==="string"&&a.trim().length>0?a.trim():"#6366f1"},hW=function(a){if(typeof a==="string"){a=parseFloat(a.trim());var b=isNaN(a);return $APP.n($APP.n(b)?b:!(a>0))?
|
|
3
|
+
3:Math.min(20,Math.max(.5,a))}return 3},iW=function(a){if(typeof a==="string"){a=parseFloat(a.trim());var b=isNaN(a);return $APP.n($APP.n(b)?b:!(a>0))?.02:Math.min(.1,Math.max(.001,a))}return.02},jW=function(a){if(typeof a==="string"){a=parseFloat(a.trim());var b=isNaN(a);return $APP.n($APP.n(b)?b:!(a>0))?6:Math.min(30,Math.max(1,a))}return 6},kW=function(a){if(typeof a==="string"){a=parseFloat(a.trim());var b=isNaN(a);return $APP.n($APP.n(b)?b:!(a>0))?12:Math.min(40,Math.max(4,a))}return 12},lW=
|
|
4
|
+
function(a){return typeof a==="string"&&a.trim().length>0?a.trim():"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -10"},mW=function(a){if(typeof a==="string"&&a.trim().length>0){var b=$APP.C(raa,a.trim().toLowerCase());if($APP.n(b))return b;if(a.indexOf(",")>=0)return a=a.split(","),$APP.sf.m($APP.ye,$APP.Il.j($APP.pe.i(function(c){return c.trim()}),$APP.ve(function(c){return c.length>0})),a)}return null},nW=function(a){for(var b=[],c=0;;)if(c<a)b.push(Math.max(.01,.35*Math.pow(.45,c))),c+=1;else break;
|
|
5
|
+
return b},oW=function(a,b){for(var c=[],d=0;;)if(d<b)c.push(Math.max(a*.5,a*(1-d*.08))),d+=1;else break;return c},pW=function(a,b,c){return a+(b-a)*c},EW=function(a){a=$APP.Wf([$APP.Gq,qW,rW,sW,tW,uW,$APP.om,$APP.qr,vW,wW],[a.getAttribute("blur"),a.getAttribute("noise-intensity"),a.getAttribute("blob-size"),a.getAttribute("palette"),a.getAttribute("noise-scale"),a.getAttribute("noise"),a.getAttribute("threshold"),a.getAttribute("color"),a.getAttribute("blob-count"),a.getAttribute("noise-speed")]);
|
|
6
|
+
var b=$APP.G(a),c=$APP.C(b,wW);a=$APP.C(b,$APP.Gq);var d=$APP.C(b,qW),e=$APP.C(b,rW),f=$APP.C(b,sW),h=$APP.C(b,tW),l=$APP.C(b,uW),m=$APP.C(b,$APP.om),q=$APP.C(b,$APP.qr);b=$APP.C(b,vW);b=eW(b);q=gW(q);f=mW(f);c=iW(c);var r=[];if($APP.n($APP.n(f)?$APP.y(f)>0:f))for(var v=$APP.y(f),x=0;;)if(x<b)r.push($APP.tc(f,$APP.qd(x,v))),x+=1;else break;else for(v=0;;)if(v<b)r.push(q),v+=1;else break;return $APP.Wf([$APP.Un,xW,yW,$APP.Iq,$APP.iq,zW,AW,$APP.xm,BW,CW,DW],[q,f,c,r,lW(m),hW(h),b,kW(a),fW(e),l!=null,
|
|
7
|
+
jW(d)])},FW=function(a,b){b=$APP.G(b);b=$APP.C(b,$APP.Un);return a.style.setProperty("--x-metaball-cursor-color",b)},saa=function(a){$APP.D(window.matchMedia("(prefers-reduced-motion:reduce)").matches)||(a.__xMetaballSeed=0,$APP.ja(a,"__xMetaballRaf",requestAnimationFrame(function(){return GW(a)})))},taa=function(a){function b(c){var d=$APP.wn.i($APP.k(a,"__xMetaballRefs"));if($APP.n(d)){d=d.getBoundingClientRect();var e=$APP.k(a,"__xMetaballMouse");e.x=c.clientX-d.left;e.y=c.clientY-d.top}return null}
|
|
8
|
+
window.addEventListener("pointermove",b);a.__xMetaballHandler=b},HW=function(a){var b=$APP.k(a,"__xMetaballHandler");$APP.n(b)&&(window.removeEventListener("pointermove",b),a.__xMetaballHandler=null)},uaa=function(a){Object.defineProperty(a,"blobCount",{get:function(){return eW(this.getAttribute("blob-count"))},set:function(b){return b==null?this.removeAttribute("blob-count"):this.setAttribute("blob-count",""+$APP.V.i(b|0))},enumerable:!0,configurable:!0});Object.defineProperty(a,"blobSize",{get:function(){return fW(this.getAttribute("blob-size"))},
|
|
9
|
+
set:function(b){return b==null?this.removeAttribute("blob-size"):this.setAttribute("blob-size",""+$APP.V.i(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"color",{get:function(){return gW(this.getAttribute("color"))},set:function(b){return b==null?this.removeAttribute("color"):this.setAttribute("color",""+$APP.V.i(b))},enumerable:!0,configurable:!0});$APP.Sh(a,"noise","noise");Object.defineProperty(a,"noiseScale",{get:function(){return hW(this.getAttribute("noise-scale"))},set:function(b){return b==
|
|
10
|
+
null?this.removeAttribute("noise-scale"):this.setAttribute("noise-scale",""+$APP.V.i(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"noiseSpeed",{get:function(){return iW(this.getAttribute("noise-speed"))},set:function(b){return b==null?this.removeAttribute("noise-speed"):this.setAttribute("noise-speed",""+$APP.V.i(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"noiseIntensity",{get:function(){return jW(this.getAttribute("noise-intensity"))},set:function(b){return b==null?
|
|
11
|
+
this.removeAttribute("noise-intensity"):this.setAttribute("noise-intensity",""+$APP.V.i(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"blur",{get:function(){return kW(this.getAttribute("blur"))},set:function(b){return b==null?this.removeAttribute("blur"):this.setAttribute("blur",""+$APP.V.i(b))},enumerable:!0,configurable:!0});Object.defineProperty(a,"threshold",{get:function(){return lW(this.getAttribute("threshold"))},set:function(b){return b==null?this.removeAttribute("threshold"):
|
|
12
|
+
this.setAttribute("threshold",""+$APP.V.i(b))},enumerable:!0,configurable:!0});return Object.defineProperty(a,"palette",{get:function(){return mW(this.getAttribute("palette"))},set:function(b){return b==null||$APP.A.j("",b)?this.removeAttribute("palette"):this.setAttribute("palette",""+$APP.V.i(b))},enumerable:!0,configurable:!0})},waa=function(a){var b=EW(a);a.__xMetaballModel=b;a.__xMetaballMouse={x:0,y:0};if(!$APP.n($APP.k(a,"__xMetaballRefs"))){var c=$APP.k(a,"__xMetaballModel"),d=IW[0];IW[0]=
|
|
13
|
+
d+1;var e="mb-"+$APP.V.i(d),f=a.attachShadow({mode:"open"}),h=document.createElement("style"),l=document.createElement("div"),m=document.createElementNS("http://www.w3.org/2000/svg","svg");a.__xMetaballUid=d;h.textContent=vaa;l.setAttribute("part","viewport");l.style.filter="url(#"+$APP.V.i(e)+")";m.style.position="absolute";m.style.width="0";m.style.height="0";m.style.overflow="hidden";var q=$APP.G(c);c=$APP.C(q,$APP.xm);d=$APP.C(q,$APP.iq);var r=$APP.C(q,CW),v=$APP.C(q,zW);q=$APP.C(q,DW);var x=
|
|
14
|
+
document.createElementNS("http://www.w3.org/2000/svg","defs"),z=document.createElementNS("http://www.w3.org/2000/svg","filter"),B=document.createElementNS("http://www.w3.org/2000/svg","feGaussianBlur"),E=document.createElementNS("http://www.w3.org/2000/svg","feColorMatrix"),H=document.createElementNS("http://www.w3.org/2000/svg","feTurbulence"),K=document.createElementNS("http://www.w3.org/2000/svg","feDisplacementMap");z.setAttribute("id",e);z.setAttribute("x","-20%");z.setAttribute("y","-20%");
|
|
15
|
+
z.setAttribute("width","140%");z.setAttribute("height","140%");B.setAttribute("in","SourceGraphic");B.setAttribute("stdDeviation",""+$APP.V.i(c));B.setAttribute("result","blur");E.setAttribute("in","blur");E.setAttribute("type","matrix");E.setAttribute("values",d);E.setAttribute("result","threshold");H.setAttribute("type","fractalNoise");H.setAttribute("baseFrequency",""+$APP.V.i(.01*v));H.setAttribute("numOctaves","3");H.setAttribute("seed","0");H.setAttribute("result","noise");K.setAttribute("in",
|
|
16
|
+
"threshold");K.setAttribute("in2","noise");K.setAttribute("scale",$APP.n(r)?""+$APP.V.i(q):"0");K.setAttribute("xChannelSelector","R");K.setAttribute("yChannelSelector","G");z.appendChild(B);z.appendChild(E);z.appendChild(H);z.appendChild(K);x.appendChild(z);m.appendChild(x);e=new $APP.O(null,5,[$APP.Bp,z,$APP.xn,B,$APP.fr,E,$APP.dq,H,$APP.Rn,K],null);l.appendChild(m);f.appendChild(h);f.appendChild(l);f=$APP.ng($APP.zc([e,new $APP.O(null,3,[$APP.jj,f,$APP.wn,l,$APP.po,m],null)]));a.__xMetaballRefs=
|
|
17
|
+
f}f=$APP.k(a,"__xMetaballBlobs");if($APP.n(f)){h=f.length;for(l=0;;)if(l<h)m=f[l],$APP.n(m.parentNode)&&m.parentNode.removeChild(m),l+=1;else break;a.__xMetaballBlobs=[];a.__xMetaballPos=[]}h=$APP.G(b);f=$APP.C(h,AW);m=$APP.C(h,BW);h=$APP.C(h,$APP.Iq);l=$APP.G($APP.k(a,"__xMetaballRefs"));l=$APP.C(l,$APP.wn);m=oW(m,f);e=[];c=[];for(d=0;;)if(d<f)r=document.createElement("div"),v=m[d],r.className="blob",r.style.width=""+$APP.V.i(v)+"px",r.style.height=""+$APP.V.i(v)+"px",r.style.background=h[d],l.appendChild(r),
|
|
18
|
+
e.push(r),c.push({x:0,y:0}),d+=1;else break;a.__xMetaballBlobs=e;a.__xMetaballPos=c;f=nW(f);a.__xMetaballSpeeds=f;FW(a,b);$APP.S(a,"aria-hidden","true");$APP.S(a,"role","presentation");HW(a);taa(a);saa(a);return null},xaa=function(a){var b=$APP.k(a,"__xMetaballRaf");$APP.n(b)&&(cancelAnimationFrame(b),a.__xMetaballRaf=null);HW(a);return null},yaa=function(a,b,c,d){if($APP.I(c,d)&&(b=EW(a),a.__xMetaballModel=b,$APP.n($APP.k(a,"__xMetaballRefs")))){d=$APP.G(b);c=$APP.C(d,AW);var e=$APP.C(d,BW);d=$APP.C(d,
|
|
19
|
+
$APP.Iq);var f=$APP.G($APP.k(a,"__xMetaballRefs")),h=$APP.C(f,$APP.wn);f=$APP.k(a,"__xMetaballBlobs");var l=$APP.k(a,"__xMetaballPos"),m=f.length;e=oW(e,c);for(var q=m;;)if(q<c){var r=document.createElement("div");r.className="blob";h.appendChild(r);f.push(r);l.push({x:0,y:0});q+=1}else break;for(h=m;;)if(h>c)m=f.pop(),l.pop(),$APP.n(m.parentNode)&&m.parentNode.removeChild(m),--h;else break;for(l=0;;)if(l<c)h=f[l],m=e[l],h.style.width=""+$APP.V.i(m)+"px",h.style.height=""+$APP.V.i(m)+"px",h.style.background=
|
|
20
|
+
d[l],l+=1;else break;c=nW(c);a.__xMetaballSpeeds=c;f=$APP.G(b);h=$APP.C(f,$APP.xm);e=$APP.C(f,$APP.iq);c=$APP.C(f,CW);d=$APP.C(f,zW);f=$APP.C(f,DW);l=$APP.k(a,"__xMetaballRefs");m=$APP.xn.i(l);$APP.n(m)&&m.setAttribute("stdDeviation",""+$APP.V.i(h));h=$APP.fr.i(l);$APP.n(h)&&h.setAttribute("values",e);e=$APP.dq.i(l);$APP.n(e)&&e.setAttribute("baseFrequency",""+$APP.V.i(.01*d));d=$APP.Rn.i(l);$APP.n(d)&&d.setAttribute("scale",$APP.n(c)?""+$APP.V.i(f):"0");return FW(a,b)}return null},JW=function(){return $APP.Ah("x-metaball-cursor",
|
|
21
|
+
new $APP.O(null,5,[$APP.qh,zaa,$APP.oh,waa,$APP.lh,xaa,$APP.kh,yaa,$APP.ph,uaa],null))},tW=new $APP.F(null,"noise-scale-raw","noise-scale-raw",123215597),qW=new $APP.F(null,"noise-intensity-raw","noise-intensity-raw",-116633534),CW=new $APP.F(null,"noise?","noise?",-38350370),BW=new $APP.F(null,"blob-size","blob-size",-1862159046),zW=new $APP.F(null,"noise-scale","noise-scale",-2033475279),uW=new $APP.F(null,"noise-attr","noise-attr",-1534959409),sW=new $APP.F(null,"palette-raw","palette-raw",-1398782582),
|
|
22
|
+
xW=new $APP.F(null,"palette","palette",-456203511),vW=new $APP.F(null,"blob-count-raw","blob-count-raw",-1850938603),wW=new $APP.F(null,"noise-speed-raw","noise-speed-raw",1761342974),yW=new $APP.F(null,"noise-speed","noise-speed",866692139),AW=new $APP.F(null,"blob-count","blob-count",-248711053),DW=new $APP.F(null,"noise-intensity","noise-intensity",747731519),rW=new $APP.F(null,"blob-size-raw","blob-size-raw",530207878);var zaa="blob-count blob-size color noise noise-scale noise-speed noise-intensity blur threshold palette".split(" ");
|
|
23
|
+
$APP.Wf([$APP.Un,new $APP.F(null,"blobSize","blobSize",-64083896),new $APP.F(null,"noiseIntensity","noiseIntensity",-792053623),xW,new $APP.F(null,"noiseScale","noiseScale",2003002730),new $APP.F(null,"noise","noise",-994696820),$APP.iq,$APP.xm,new $APP.F(null,"noiseSpeed","noiseSpeed",-959403627),new $APP.F(null,"blobCount","blobCount",-1279691625)],[new $APP.O(null,1,[$APP.Q,$APP.X],null),new $APP.O(null,1,[$APP.Q,$APP.Y],null),new $APP.O(null,1,[$APP.Q,$APP.Y],null),new $APP.O(null,1,[$APP.Q,$APP.X],
|
|
24
|
+
null),new $APP.O(null,1,[$APP.Q,$APP.Y],null),new $APP.O(null,1,[$APP.Q,$APP.Xh],null),new $APP.O(null,1,[$APP.Q,$APP.X],null),new $APP.O(null,1,[$APP.Q,$APP.Y],null),new $APP.O(null,1,[$APP.Q,$APP.Y],null),new $APP.O(null,1,[$APP.Q,$APP.Y],null)]);
|
|
25
|
+
var raa=new $APP.O(null,5,["rainbow",new $APP.M(null,5,5,$APP.N,["#ef4444","#f59e0b","#22c55e","#3b82f6","#a855f7"],null),"ocean",new $APP.M(null,5,5,$APP.N,["#06b6d4","#0ea5e9","#6366f1","#8b5cf6","#0d9488"],null),"sunset",new $APP.M(null,5,5,$APP.N,["#ef4444","#f97316","#eab308","#ec4899","#f43f5e"],null),"neon",new $APP.M(null,5,5,$APP.N,["#22d3ee","#a78bfa","#f472b6","#34d399","#facc15"],null),"ember",new $APP.M(null,5,5,$APP.N,["#dc2626","#ea580c","#d97706","#b91c1c","#f59e0b"],null)],null);var IW=[0],vaa=":host{display:block;position:relative;width:100%;height:100%;overflow:hidden;pointer-events:none;z-index:var("+$APP.V.i("--x-metaball-cursor-z-index")+",9999);}[part\x3dviewport]{position:absolute;inset:var("+$APP.V.i("--x-metaball-cursor-inset")+",0);pointer-events:none;opacity:var("+$APP.V.i("--x-metaball-cursor-opacity")+",1);mix-blend-mode:var("+$APP.V.i("--x-metaball-cursor-blend-mode")+",normal);}.blob{position:absolute;border-radius:50%;will-change:transform;pointer-events:none;top:0;left:0;background:var("+
|
|
26
|
+
$APP.V.i("--x-metaball-cursor-color")+",#6366f1);}@media(prefers-reduced-motion:reduce){.blob{transition:none!important;}}",GW=function GW(a){if($APP.n(a.isConnected)){var c=$APP.k(a,"__xMetaballMouse"),d=$APP.k(a,"__xMetaballBlobs"),e=$APP.k(a,"__xMetaballPos"),f=$APP.k(a,"__xMetaballSpeeds"),h=$APP.k(c,"x");c=$APP.k(c,"y");for(var l=$APP.k(a,"__xMetaballModel"),m=d.length,q=0;;)if(q<m){var r=e[q],v=f[q],x=pW($APP.k(r,"x"),h,v);v=pW($APP.k(r,"y"),c,v);var z=d[q];r.x=x;r.y=v;z.style.transform="translate("+
|
|
27
|
+
$APP.V.i(x)+"px,"+$APP.V.i(v)+"px) translate(-50%,-50%)";q+=1}else break;$APP.n(CW.i(l))&&(d=$APP.k(a,"__xMetaballSeed")+yW.i(l),e=$APP.k(a,"__xMetaballRefs"),a.__xMetaballSeed=d,e=$APP.dq.i(e),$APP.n(e)&&e.setAttribute("seed",""+$APP.V.i(Math.floor(d))));$APP.ja(a,"__xMetaballRaf",requestAnimationFrame(function(){return GW.i?GW.i(a):GW.call(null,a)}))}return null};$APP.ha("baredom.exports.x_metaball_cursor.init",JW);export const init=JW;
|
package/dist/x-modal.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
2
|
+
var u4=function(a){var b=$APP.k(a,"__xModalRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("div"),f=document.createElement("div"),h=document.createElement("slot"),l=document.createElement("div"),m=document.createElement("slot"),q=document.createElement("div"),r=document.createElement("slot");c.textContent=":host{display:contents;color-scheme:light dark;--x-modal-bg:var(--x-color-bg,Canvas);--x-modal-fg:var(--x-color-text,CanvasText);--x-modal-backdrop:rgb(0 0 0/0.45);--x-modal-shadow:var(--x-shadow-lg,0 20px 60px rgb(0 0 0/0.25));--x-modal-radius:var(--x-radius-md,0.75rem);--x-modal-width-sm:22rem;--x-modal-width-md:32rem;--x-modal-width-lg:44rem;--x-modal-width-xl:60rem;--x-modal-max-height:90dvh;--x-modal-header-padding:1rem 1.25rem;--x-modal-body-padding:1rem 1.25rem;--x-modal-footer-padding:0.75rem 1.25rem;--x-modal-border:var(--x-color-border,color-mix(in srgb,currentColor 12%,transparent));--x-modal-duration:var(--x-transition-duration,180ms);--x-modal-easing:ease;--x-modal-z:1000;}[part\x3dbackdrop]{position:fixed;inset:0;background:var(--x-modal-backdrop);z-index:var(--x-modal-z);opacity:0;visibility:hidden;pointer-events:none;transition:opacity var(--x-modal-duration) var(--x-modal-easing),visibility 0s var(--x-modal-easing) var(--x-modal-duration);}:host([data-open\x3dtrue]) [part\x3dbackdrop]{opacity:1;visibility:visible;pointer-events:auto;transition:opacity var(--x-modal-duration) var(--x-modal-easing),visibility 0s;}[part\x3ddialog]{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%) scale(0.96);opacity:0;visibility:hidden;pointer-events:none;background:var(--x-modal-bg);color:var(--x-modal-fg);box-shadow:var(--x-modal-shadow);border-radius:var(--x-modal-radius);display:flex;flex-direction:column;overflow:hidden;z-index:calc(var(--x-modal-z) + 1);max-height:var(--x-modal-max-height);transition:opacity var(--x-modal-duration) var(--x-modal-easing),transform var(--x-modal-duration) var(--x-modal-easing),visibility 0s var(--x-modal-easing) var(--x-modal-duration);}:host([data-size\x3dsm]) [part\x3ddialog]{width:var(--x-modal-width-sm);}:host([data-size\x3dmd]) [part\x3ddialog]{width:var(--x-modal-width-md);}:host([data-size\x3dlg]) [part\x3ddialog]{width:var(--x-modal-width-lg);}:host([data-size\x3dxl]) [part\x3ddialog]{width:var(--x-modal-width-xl);}:host([data-size\x3dfull]) [part\x3ddialog]{inset:0;top:0;left:0;width:100%;height:100dvh;border-radius:0;max-width:100%;max-height:100dvh;transform:scale(0.98);}:host([data-open\x3dtrue]) [part\x3ddialog]{opacity:1;transform:translate(-50%,-50%) scale(1);visibility:visible;pointer-events:auto;transition:opacity var(--x-modal-duration) var(--x-modal-easing),transform var(--x-modal-duration) var(--x-modal-easing),visibility 0s;}:host([data-open\x3dtrue][data-size\x3dfull]) [part\x3ddialog]{transform:scale(1);}[part\x3ddialog]:focus{outline:none;}[part\x3dheader]{padding:var(--x-modal-header-padding);border-bottom:1px solid var(--x-modal-border);flex-shrink:0;}[part\x3dbody]{padding:var(--x-modal-body-padding);overflow-y:auto;flex:1;}[part\x3dfooter]{padding:var(--x-modal-footer-padding);border-top:1px solid var(--x-modal-border);flex-shrink:0;}[part\x3ddialog]{max-width:calc(100vw - 2rem);}:host([data-size\x3dfull]) [part\x3ddialog]{max-width:100%;}@media (prefers-reduced-motion:reduce){[part\x3ddialog],[part\x3dbackdrop]{transition:none;}}";
|
|
3
3
|
d.setAttribute("part","backdrop");e.setAttribute("part","dialog");e.setAttribute("role","dialog");e.setAttribute("aria-modal","true");f.setAttribute("part","header");h.setAttribute("name","header");l.setAttribute("part","body");q.setAttribute("part","footer");r.setAttribute("name","footer");f.appendChild(h);l.appendChild(m);q.appendChild(r);e.appendChild(f);e.appendChild(l);e.appendChild(q);b.appendChild(c);b.appendChild(d);b.appendChild(e);a.__xModalRefs={root:b,backdrop:d,dialog:e,header:f,body:l,
|
|
4
|
-
footer:q};return $APP.k(a,"__xModalRefs")},
|
|
5
|
-
return $APP.n(e.matches("a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex\x3d'-1'])"))?$APP.
|
|
6
|
-
null;a.__xModalRestore=null;$APP.n($APP.n(b)?d:b)&&(b.removeAttribute("tabindex"),a.__xModalDialogTab=!1);$APP.n($APP.n(c)?c.isConnected:c)&&c.focus()},
|
|
7
|
-
$APP.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
footer:q};return $APP.k(a,"__xModalRefs")},Wha=function(a){function b(d){var e=window.getComputedStyle(d);return $APP.I("none",e.display)&&$APP.I("hidden",e.visibility)&&d.offsetWidth>0&&d.offsetHeight>0}var c=$APP.we(b,$APP.zc($APP.k(a,"dialog").querySelectorAll("a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex\x3d'-1'])")));a=$APP.ue(function(d){return $APP.we(b,$APP.ue(function(e){var f=$APP.zc(e.querySelectorAll("a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex\x3d'-1'])"));
|
|
5
|
+
return $APP.n(e.matches("a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex\x3d'-1'])"))?$APP.zd(e,f):f},$APP.zc([$APP.Ac(d.assignedElements({flatten:!0}))])))},$APP.zc([$APP.zc($APP.k(a,"root").querySelectorAll("slot"))]));return $APP.Qe($APP.te.j(c,a))},v4=function(a){var b=$APP.k(a,"__xModalRefs");b=$APP.n(b)?$APP.k(b,"dialog"):null;var c=$APP.k(a,"__xModalRestore"),d=$APP.k(a,"__xModalDialogTab")===!0;a.__xModalTabbables=
|
|
6
|
+
null;a.__xModalRestore=null;$APP.n($APP.n(b)?d:b)&&(b.removeAttribute("tabindex"),a.__xModalDialogTab=!1);$APP.n($APP.n(c)?c.isConnected:c)&&c.focus()},w4=function(a,b){$APP.Nh(a,"x-modal-dismiss",{reason:b});$APP.T(a,"open");return null},x4=function(a){$APP.n(a.hasAttribute("open"))||$APP.S(a,"open","");return null},y4=function(a){$APP.T(a,"open");return null},Xha=function(a,b){$APP.I($APP.k(a,"__xModalPrevOpen"),b)&&(a.__xModalPrevOpen=b,$APP.Nh(a,"x-modal-toggle",{open:b}),$APP.n(b)?setTimeout(function(){var c=
|
|
7
|
+
$APP.k(a,"__xModalRefs"),d=$APP.n(c)?$APP.k(c,"dialog"):null;c=$APP.n(c)?Wha(c):null;a.__xModalRestore=document.activeElement;var e=$APP.n(c)?$APP.$l(c):null;a.__xModalTabbables=e;$APP.t(c)?$APP.u(c).focus():$APP.n(d)&&($APP.n(d.hasAttribute("tabindex"))||(d.setAttribute("tabindex","-1"),a.__xModalDialogTab=!0),d.focus());return null},0):v4(a))},z4=function(a){var b=u4(a);b=$APP.k(b,"dialog");var c=new $APP.O(null,3,[$APP.Qm,a.hasAttribute("open"),$APP.Vk,a.getAttribute("size"),$APP.ui,a.getAttribute("label")],
|
|
8
|
+
null);var d=$APP.G(c),e=$APP.C(d,$APP.Qm);c=$APP.C(d,$APP.Vk);d=$APP.C(d,$APP.ui);e=$APP.D(e);c=typeof c==="string"&&$APP.$c(Yha,c)?c:"md";d=typeof d==="string"&&$APP.I(d,"")?d:"Modal";c=new $APP.O(null,3,[$APP.Zq,e,$APP.ok,c,$APP.Z,d],null);d=$APP.Zq.i(c);$APP.S(a,"data-open",$APP.n(d)?"true":"false");$APP.S(a,"data-size",$APP.ok.i(c));b.setAttribute("aria-label",$APP.Z.i(c));Xha(a,d)},Zha=function(a){function b(f){var h=f.key;if($APP.A.j(h,"Escape"))f.preventDefault(),w4(a,"escape");else if($APP.A.j(h,
|
|
9
|
+
"Tab")){h=$APP.k(a,"__xModalTabbables");h=$APP.n(h)?$APP.Qe($APP.zc(h)):$APP.ye;var l=$APP.k(a,"__xModalRefs");l=$APP.n(l)?$APP.k(l,"dialog"):null;if($APP.Pc(h))f.preventDefault(),$APP.n(l)&&l.focus();else{l=document.activeElement;var m=$APP.u(h);h=$APP.Dc(h);var q=f.shiftKey;$APP.n($APP.n(q)?$APP.A.j(l,m):q)?(f.preventDefault(),h.focus()):$APP.p(q)&&$APP.A.j(l,h)&&(f.preventDefault(),m.focus())}}return null}function c(){return w4(a,"backdrop")}var d=u4(a),e=$APP.k(d,"dialog");$APP.k(d,"backdrop").addEventListener("click",
|
|
10
|
+
c);e.addEventListener("keydown",b);$APP.ja(a,"__xModalHandlers",{backdrop:c,keydown:b})},A4=function(a){var b=$APP.k(a,"__xModalHandlers"),c=$APP.k(a,"__xModalRefs");if($APP.n($APP.n(b)?c:b)){var d=$APP.k(c,"backdrop");c=$APP.k(c,"dialog");var e=$APP.k(b,"backdrop");b=$APP.k(b,"keydown");$APP.n(e)&&d.removeEventListener("click",e);$APP.n(b)&&c.removeEventListener("keydown",b)}a.__xModalHandlers=null},$ha=function(a){u4(a);A4(a);Zha(a);z4(a);return null},aia=function(a){A4(a);v4(a);return null},bia=
|
|
11
|
+
function(a,b,c,d){$APP.I(c,d)&&z4(a);return null},cia=function(a){Object.defineProperty(a,"open",{get:function(){return this.hasAttribute("open")},set:function(b){return $APP.n(b)?x4(this):y4(this)},enumerable:!0,configurable:!0});$APP.Th(a,"size","size","md");$APP.Th(a,"label","label","Modal");Object.defineProperty(a,"show",{value:function(){return x4(this)},enumerable:!0,configurable:!0,writable:!0});Object.defineProperty(a,"hide",{value:function(){return y4(this)},enumerable:!0,configurable:!0,
|
|
12
|
+
writable:!0});return Object.defineProperty(a,"toggle",{value:function(){$APP.n(this.hasAttribute("open"))?y4(this):x4(this);return null},enumerable:!0,configurable:!0,writable:!0})},B4=function(){return $APP.Ah("x-modal",new $APP.O(null,5,[$APP.qh,dia,$APP.oh,$ha,$APP.lh,aia,$APP.kh,bia,$APP.ph,cia],null))};var Yha=new $APP.pg(null,new $APP.O(null,5,["md",null,"lg",null,"full",null,"xl",null,"sm",null],null),null),dia=["open","size","label"];$APP.ce(["x-modal-toggle",new $APP.O(null,2,[$APP.Aq,!1,$APP.U,new $APP.O(null,1,[$APP.wq,$APP.Xh],null)],null),"x-modal-dismiss",new $APP.O(null,2,[$APP.Aq,!1,$APP.U,new $APP.O(null,1,[$APP.Ym,$APP.X],null)],null)]);$APP.ha("baredom.exports.x_modal.init",B4);export const init=B4;
|
package/dist/x-morph-stack.js
CHANGED
|
@@ -1,39 +1,38 @@
|
|
|
1
1
|
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var
|
|
3
|
-
$APP.n(b)?b:0);c=$APP.
|
|
4
|
-
1,$APP.n(b)?b:0));return $APP.
|
|
5
|
-
$APP.
|
|
6
|
-
b){return new $APP.
|
|
7
|
-
"true");c.setAttribute("data-x-morph-stack-ghost-layer","");d.style.position="absolute";d.style.width="0";d.style.height="0";d.style.overflow="hidden";d.setAttribute("aria-hidden","true");c.appendChild(d);document.body.appendChild(c);b=$APP.
|
|
2
|
+
var YC=function(a){return typeof a==="string"?(a=a.trim().toLowerCase(),$APP.$c(XC,a)?a:"clean"):"clean"},ZC=function(a){return $APP.A.j(a,"organic")||$APP.A.j(a,"liquid")},$C=function(a){var b=(a-1)/17*-7;return"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 "+$APP.V.i(a)+" "+$APP.V.i(b)},aD=function(a,b,c,d){if(typeof a==="string"){a=a.trim();if($APP.A.j(a,""))return b;a=parseFloat(a);return $APP.n(isNaN(a))?b:Math.min(d,Math.max(c,a))}return b},bD=function(a,b,c,d){if($APP.n($APP.n(a)?a>0:a)){b=$APP.Gl.j(1E-4,
|
|
3
|
+
$APP.n(b)?b:0);c=$APP.Gl.j(1E-4,$APP.n(c)?c:0);d=$APP.Gl.j(1E-4,$APP.n(d)?d:0);var e=Math.sqrt(b/d);a=1E3*(4/($APP.Gl.j(.2,$APP.Hl.j(5,c/(2*Math.sqrt(b*d))))*e)+Math.PI/e)/a}else a=1;return a},cD=function(a,b,c,d,e,f){b+=(e*(1-a)-f*b)/d*c;return[a+b*c,b]},eD=function(a,b){b=$APP.G(b);var c=$APP.C(b,dD);b=$APP.C(b,$APP.ho);var d=$APP.Qe(a);a=$APP.y(d);if(a>0){var e=$APP.n(function(){return $APP.n(c)?$APP.ge(function(f){return $APP.A.j(f,c)},d):c}())?c:null;if($APP.n(e))return e;a=$APP.Gl.j(0,$APP.Hl.j(a-
|
|
4
|
+
1,$APP.n(b)?b:0));return $APP.tc(d,a)}return null},fD=function(a,b,c){return a+(b-a)*c},gD=function(a){if(typeof a==="string"){a=a.match(/rgba?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)(?:\s*,\s*(\d*(?:\.\d+)?))?\s*\)/);if($APP.n(a)){var b=parseFloat(a[1]),c=parseFloat(a[2]),d=parseFloat(a[3]);var e=a[4];e=$APP.n(e)?$APP.I("",a[4]):e;a=[b,c,d,$APP.n(e)?parseFloat(a[4]):1]}else a=null;return a}return null},hD=function(a,b,c){var d=gD(a),e=gD(b);return $APP.n($APP.n(d)?e:d)?"rgba("+
|
|
5
|
+
$APP.V.i(Math.round(fD(d[0],e[0],c)))+","+$APP.V.i(Math.round(fD(d[1],e[1],c)))+","+$APP.V.i(Math.round(fD(d[2],e[2],c)))+","+$APP.V.i(fD(d[3],e[3],c))+")":c<.5?a:b},iD=function(a){if(typeof a==="string")if(a=a.trim(),$APP.I(a,"")){a=a.split(/\s+/);for(var b=a.length,c=[],d=0;;){if(d>=b)return c.length>0?c:null;var e=a[d];if($APP.n(e.endsWith("px"))){e=parseFloat(e.slice(0,e.length-2));if($APP.n(isNaN(e)))return null;c.push(e);d+=1}else return null}}else return null;else return null},jD=function(a,
|
|
6
|
+
b){return new $APP.O(null,2,[$APP.nm,$APP.n(a)?a:"",$APP.rq,$APP.n(b)?b:""],null)},lD=function(a){var b=$APP.k(a,"__xMorphStackRefs"),c=$APP.n(b)?kD.i(b):null;if($APP.n($APP.n(c)?c.isConnected:c))return b;c=document.createElement("div");var d=document.createElementNS("http://www.w3.org/2000/svg","svg");c.style.position="fixed";c.style.top="0";c.style.left="0";c.style.width="100%";c.style.height="100dvh";c.style.pointerEvents="none";c.style.overflow="visible";c.style.zIndex="2147483646";c.setAttribute("aria-hidden",
|
|
7
|
+
"true");c.setAttribute("data-x-morph-stack-ghost-layer","");d.style.position="absolute";d.style.width="0";d.style.height="0";d.style.overflow="hidden";d.setAttribute("aria-hidden","true");c.appendChild(d);document.body.appendChild(c);b=$APP.Dk.B(b,kD,c,$APP.zc([$APP.po,d]));return a.__xMorphStackRefs=b},mD=function(a){var b=$APP.k(a,"__xMorphStackRefs");if($APP.n(b))return b;b=a.attachShadow({mode:"open"});var c=document.createElement("style"),d=document.createElement("div"),e=document.createElement("slot");
|
|
8
8
|
c.textContent=":host{display:block;position:relative;color-scheme:light dark;--x-morph-stack-spring-stiffness:170;--x-morph-stack-spring-damping:26;--x-morph-stack-spring-mass:1;--x-morph-stack-fade-ms:160ms;--x-morph-stack-goo-blur:10;--x-morph-stack-goo-threshold:18;--x-morph-stack-bg:transparent;}:host([data-variant\x3d'clean']){--x-morph-stack-spring-stiffness:280;--x-morph-stack-spring-damping:30;--x-morph-stack-spring-mass:0.7;}:host([data-variant\x3d'organic']){--x-morph-stack-spring-stiffness:180;--x-morph-stack-spring-damping:5;--x-morph-stack-spring-mass:1.0;--x-morph-stack-goo-blur:6;--x-morph-stack-goo-threshold:14;}:host([data-variant\x3d'liquid']){--x-morph-stack-spring-stiffness:50;--x-morph-stack-spring-damping:14;--x-morph-stack-spring-mass:2.0;--x-morph-stack-goo-blur:26;--x-morph-stack-goo-threshold:26;}[part\x3dviewport]{position:relative;display:block;background:var(--x-morph-stack-bg);}:host([disabled]){opacity:0.7;}";
|
|
9
|
-
d.setAttribute("part","viewport");e.setAttribute("name","state");d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__xMorphStackRefs=new $APP.
|
|
10
|
-
$APP.
|
|
11
|
-
$APP.
|
|
12
|
-
f=$APP.
|
|
13
|
-
"":f.style.display="none";e+=1}else break;$APP.n(b)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"140%");
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
y=bA(x.t,x.v,f,l,m,h),A=y[0];y=y[1];x.t=A;x.v=y;x=x.update;x.g?x.g(A):x.call(null,A);A<q[0]&&(q[0]=A);Math.abs(A-1)<.001&&Math.abs(y)<.01||(b[0]=!1);v+=1}else break;vA(a,q[0]);$APP.n(b[0])?LA.l?LA.l(a,d,!0):LA.call(null,a,d,!0):(e=window.requestAnimationFrame(function(D){return $APP.B.i(d,$APP.k(a,"__xMorphStackToken"))?NA.i?NA.i(a,D):NA.call(null,a,D):null}),a.__xMorphStackRaf=e)}return null};$APP.ca("baredom.exports.x_morph_stack.init",$A);export const init=$A;
|
|
9
|
+
d.setAttribute("part","viewport");e.setAttribute("name","state");d.appendChild(e);b.appendChild(c);b.appendChild(d);a.__xMorphStackRefs=new $APP.O(null,3,[$APP.jj,b,$APP.wn,d,$APP.un,e],null);return $APP.k(a,"__xMorphStackRefs")},oD=function(a){a=new $APP.O(null,8,[nD,a.getAttribute("active-state"),$APP.Ep,a.getAttribute("active-index"),$APP.zq,a.getAttribute("stiffness"),$APP.ir,a.getAttribute("damping"),$APP.Ln,a.getAttribute("mass"),$APP.Lp,a.getAttribute("variant"),$APP.dn,a.getAttribute("duration"),
|
|
10
|
+
$APP.vi,a.hasAttribute("disabled")],null);a=$APP.G(a);var b=$APP.C(a,nD),c=$APP.C(a,$APP.Ep),d=$APP.C(a,$APP.zq),e=$APP.C(a,$APP.ir),f=$APP.C(a,$APP.Ln),h=$APP.C(a,$APP.Lp),l=$APP.C(a,$APP.dn);a=$APP.C(a,$APP.vi);b=typeof b==="string"&&$APP.I("",b.trim())?b.trim():null;a:{if(typeof c==="string"&&(c=c.trim(),$APP.I(c,""))){c=parseInt(c,10);c=typeof c==="number"&&$APP.p(isNaN(c))&&c>=0?c:null;break a}c=null}d=aD(d,170,10,500);e=aD(e,26,1,100);f=aD(f,1,.1,10);h=YC(h);a:{if(typeof l==="string"&&(l=l.trim(),
|
|
11
|
+
$APP.I(l,""))){l=parseFloat(l);l=typeof l==="number"&&$APP.p(isNaN(l))&&l>0?l:null;break a}l=null}return new $APP.O(null,8,[dD,b,$APP.ho,c,$APP.hq,d,$APP.Zo,e,$APP.Jq,f,$APP.nk,h,$APP.wp,l,$APP.Bi,$APP.D(a)],null)},pD=function(a,b,c){a=window.getComputedStyle(a).getPropertyValue(b);return typeof a==="string"&&$APP.I("",a.trim())?(a=parseFloat(a.trim()),$APP.n(isNaN(a))?c:a):c},qD=function(a){a=mD(a);a=$APP.G(a);a=$APP.C(a,$APP.un).assignedElements();for(var b=[],c=a.length,d=0;;)if(d<c){var e=a[d],
|
|
12
|
+
f=$APP.A.j(1,e.nodeType);$APP.n(f?e.hasAttribute("data-state"):f)&&b.push(e);d+=1}else break;return b},rD=function(a){a=qD(a);for(var b=[],c=a.length,d=0;;)if(d<c)b.push(a[d].getAttribute("data-state")),d+=1;else break;return b},sD=function(a,b){a=qD(a);for(var c=a.length,d=0;;)if(d<c){var e=a[d];if($APP.A.j(b,e.getAttribute("data-state")))return e;d+=1}else return null},tD=function(a,b){for(var c=qD(a),d=c.length,e=0;;)if(e<d){var f=c[e],h=f.getAttribute("data-state");$APP.A.j(h,b)?f.style.display=
|
|
13
|
+
"":f.style.display="none";e+=1}else break;$APP.n(b)?$APP.S(a,"data-active-state",b):$APP.T(a,"data-active-state");a.__xMorphStackCurrent=b},uD=function(a){var b={};if($APP.n(a)){a=a.querySelectorAll("["+$APP.V.i("data-morph-id")+"]");for(var c=a.length,d=0;;)if(d<c){var e=a[d],f=e.getAttribute("data-morph-id"),h=e.getBoundingClientRect(),l=window.getComputedStyle(e);b[f]={rect:{x:h.left,y:h.top,w:h.width,h:h.height},br:l.borderRadius,bg:l.backgroundColor,color:l.color,clip:l.clipPath,text:e.textContent,
|
|
14
|
+
node:e};d+=1}else break}return b},vD=function(a,b,c){var d=$APP.k(a,"__xMorphStackFilterBlur");a=$APP.k(a,"__xMorphStackFilterMatrix");$APP.n(d)&&d.setAttribute("stdDeviation",""+$APP.V.i(b));$APP.n(a)&&a.setAttribute("values",$C(c))},wD=function(a,b){var c=$APP.k(a,"__xMorphStackGooBaseBlur"),d=$APP.k(a,"__xMorphStackGooBaseThreshold");c!=null&&d!=null&&(b=b<=0?1:b<.18?1-b/.18:b<.7?0:b<1?(b-.7)/(1-.7):1,vD(a,c*(1-b),fD(d,1,b)))},yD=function(a){var b=lD(a);b=$APP.G(b);b=$APP.C(b,$APP.po);var c=$APP.k(a,
|
|
15
|
+
"__xMorphStackFilterId");if($APP.n(c))b=c;else{c=xD[0];xD[0]=c+1;c="x-morph-stack-goo-"+$APP.V.i(c);var d=document.createElementNS("http://www.w3.org/2000/svg","defs"),e=document.createElementNS("http://www.w3.org/2000/svg","filter"),f=document.createElementNS("http://www.w3.org/2000/svg","feGaussianBlur"),h=document.createElementNS("http://www.w3.org/2000/svg","feColorMatrix");e.setAttribute("id",c);e.setAttribute("x","-20%");e.setAttribute("y","-20%");e.setAttribute("width","140%");e.setAttribute("height",
|
|
16
|
+
"140%");f.setAttribute("in","SourceGraphic");f.setAttribute("stdDeviation",""+$APP.V.i(10));f.setAttribute("result","blur");h.setAttribute("in","blur");h.setAttribute("type","matrix");h.setAttribute("values",$C(18));e.appendChild(f);e.appendChild(h);d.appendChild(e);b.appendChild(d);a.__xMorphStackFilterId=c;a.__xMorphStackFilterBlur=f;a.__xMorphStackFilterMatrix=h;b=c}c=lD(a);c=$APP.G(c);c=$APP.C(c,kD);d=pD(a,"--x-morph-stack-goo-blur",10);e=pD(a,"--x-morph-stack-goo-threshold",18);a.__xMorphStackGooBaseBlur=
|
|
17
|
+
d;a.__xMorphStackGooBaseThreshold=e;vD(a,d,e);c.style.filter="url(#"+$APP.V.i(b)+")";c.style.webkitFilter="url(#"+$APP.V.i(b)+")"},zD=function(a){a=$APP.k(a,"__xMorphStackRefs");a=$APP.n(a)?kD.i(a):null;$APP.n(a)&&(a.style.filter="",a.style.webkitFilter="")},AD=function(a){a.style.position="absolute";a.style.margin="0";a.style.boxSizing="border-box";a.style.transformOrigin="top left";a.style.pointerEvents="none"},BD=function(a,b,c){var d=b.y-c.top;a.style.left=""+$APP.V.i(b.x-c.left)+"px";a.style.top=
|
|
18
|
+
""+$APP.V.i(d)+"px";a.style.width=""+$APP.V.i(b.w)+"px";a.style.height=""+$APP.V.i(b.h)+"px"},CD=function(a,b,c,d){function e(Ea){Ea=$APP.Gl.j(0,$APP.Hl.j(1,Ea));var Na=fD(la,0,Ea),Za=fD(J,1,Ea),Eb=fD(P,1,Ea);E.style.transform="translate("+$APP.V.i(fD(ea,0,Ea))+"px,"+$APP.V.i(Na)+"px) scale("+$APP.V.i(Za)+","+$APP.V.i(Eb)+")";Na=E.style;Za=iD(m);Eb=iD(q);if($APP.n($APP.n(Za)?$APP.n(Eb)?$APP.A.j(Za.length,Eb.length):Eb:Za)){for(var Cb=[],Kb=Za.length,Dd=0;;)if(Dd<Kb)Cb.push(""+$APP.V.i(fD(Za[Dd],Eb[Dd],
|
|
19
|
+
Ea))+"px"),Dd+=1;else break;Za=Cb.join(" ")}else Za=Ea<.5?m:q;Na.borderRadius=Za;$APP.n($APP.n(r)?v:r)&&(E.style.backgroundColor=hD(r,v,Ea));$APP.n($APP.n(x)?z:x)&&(E.style.color=hD(x,z,Ea));B&&(E.style.opacity=""+$APP.V.i($APP.Gl.j(0,$APP.Hl.j(1,Ea))));return null}var f=$APP.k(d,"node"),h=$APP.k(d,"rect"),l=$APP.k(c,"rect"),m=$APP.k(c,"br"),q=$APP.k(d,"br"),r=$APP.k(c,"bg"),v=$APP.k(d,"bg"),x=$APP.k(c,"color"),z=$APP.k(d,"color"),B=$APP.I($APP.k(c,"text"),$APP.k(d,"text")),E=f.cloneNode(!0);c=h.w;
|
|
20
|
+
d=h.h;var H=l.w,K=l.h,J=c>0?H/c:1,P=d>0?K/d:1,ea=l.x-h.x,la=l.y-h.y;AD(E);BD(E,h,b);a.appendChild(E);f.style.visibility="hidden";e(0);return{t:0,v:0,update:e,finalize:function(){f.style.visibility="";return $APP.n(E.parentNode)?E.parentNode.removeChild(E):null}}},DD=function(a,b,c,d){function e(E){E=$APP.Gl.j(0,$APP.Hl.j(1,E));var H=fD(0,v,E),K=fD(1,x,E),J=fD(1,z,E);B.style.transform="translate("+$APP.V.i(fD(0,r,E))+"px,"+$APP.V.i(H)+"px) scale("+$APP.V.i(K)+","+$APP.V.i(J)+")";B.style.opacity=""+
|
|
21
|
+
$APP.V.i($APP.Gl.j(0,1-E));return null}var f=$APP.k(c,"rect");d=$APP.k(d,"rect");var h=f.w,l=f.h,m=d.w,q=d.h,r=d.x-f.x,v=d.y-f.y,x=h>0?m/h:1,z=l>0?q/l:1,B=$APP.k(c,"node").cloneNode(!0);AD(B);BD(B,f,b);a.appendChild(B);e(0);return{t:0,v:0,update:e,finalize:function(){return $APP.n(B.parentNode)?B.parentNode.removeChild(B):null}}},ED=function(a,b,c){var d=$APP.k(c,"rect"),e=$APP.k(c,"node").cloneNode(!0);AD(e);BD(e,d,b);a.appendChild(e);return{t:0,v:0,update:function(f){e.style.opacity=""+$APP.V.i($APP.Gl.j(0,
|
|
22
|
+
1-f));return null},finalize:function(){return $APP.n(e.parentNode)?e.parentNode.removeChild(e):null}}},FD=function(a){var b=$APP.k(a,"node");b.style.opacity="0";return{t:0,v:0,update:function(c){b.style.opacity=""+$APP.V.i($APP.Gl.j(0,$APP.Hl.j(1,c)));return null},finalize:function(){return b.style.opacity=""}}},KD=function(a,b,c){a=lD(a);a=$APP.G(a);var d=$APP.C(a,kD),e=d.getBoundingClientRect(),f=Object.keys(b);a=Object.keys(c);f=$APP.Qe(f);a=$APP.Qe(a);f=$APP.vg(f);a=$APP.vg(a);a=new $APP.O(null,
|
|
23
|
+
3,[GD,$APP.wr.j(f,a),HD,ID.j(f,a),JD,ID.j(a,f)],null);var h=GD.i(a),l=HD.i(a);f=JD.i(a);a=[];h=$APP.t(h);for(var m=null,q=0,r=0;;)if(r<q){var v=m.F(null,r),x=$APP.k(b,v);v=$APP.k(c,v);var z=$APP.k(x,"text"),B=$APP.k(v,"text");a.push(CD(d,e,x,v));$APP.I(z,B)&&a.push(DD(d,e,x,v));r+=1}else if(h=$APP.t(h))$APP.Wc(h)?(q=$APP.Ab(h),h=$APP.Bb(h),m=q,q=$APP.y(q)):(q=$APP.u(h),m=$APP.k(b,q),q=$APP.k(c,q),r=$APP.k(m,"text"),x=$APP.k(q,"text"),a.push(CD(d,e,m,q)),$APP.I(r,x)&&a.push(DD(d,e,m,q)),h=$APP.w(h),
|
|
24
|
+
m=null,q=0),r=0;else break;l=$APP.t(l);h=null;for(q=m=0;;)if(q<m)r=h.F(null,q),a.push(ED(d,e,$APP.k(b,r))),q+=1;else if(l=$APP.t(l))h=l,$APP.Wc(h)?(l=$APP.Ab(h),q=$APP.Bb(h),h=l,m=$APP.y(l),l=q):(l=$APP.u(h),a.push(ED(d,e,$APP.k(b,l))),l=$APP.w(h),h=null,m=0),q=0;else break;b=$APP.t(f);d=null;for(f=e=0;;)if(f<e)l=d.F(null,f),a.push(FD($APP.k(c,l))),f+=1;else if(b=$APP.t(b))d=b,$APP.Wc(d)?(b=$APP.Ab(d),f=$APP.Bb(d),d=b,e=$APP.y(b),b=f):(b=$APP.u(d),a.push(FD($APP.k(c,b))),b=$APP.w(d),d=null,e=0),f=
|
|
25
|
+
0;else break;return a},LD=function(a){if($APP.n(a))for(var b=a.length,c=0;;)if(c<b){var d=a[c].finalize;$APP.n(d)&&(d.H?d.H():d.call(null));c+=1}else break},MD=function(a,b,c){if($APP.A.j(b,$APP.k(a,"__xMorphStackToken"))){b=$APP.k(a,"__xMorphStackEntries");var d=$APP.k(a,"__xMorphStackRaf");$APP.n(d)&&(window.cancelAnimationFrame(d),a.__xMorphStackRaf=null);LD(b);a.__xMorphStackEntries=null;a.__xMorphStackLast=null;zD(a);$APP.n(c)&&(c=$APP.$l(jD($APP.k(a,"__xMorphStackFrom"),$APP.k(a,"__xMorphStackTo"))),
|
|
26
|
+
$APP.Nh(a,"x-morph-stack-changed",c),a.__xMorphStackFrom=null,a.__xMorphStackTo=null)}return null},ND=function(a){var b=$APP.k(a,"__xMorphStackRaf");$APP.n(b)&&(window.cancelAnimationFrame(b),a.__xMorphStackRaf=null);LD($APP.k(a,"__xMorphStackEntries"));a.__xMorphStackEntries=null;a.__xMorphStackLast=null;zD(a)},PD=function(a,b,c){var d=$APP.k(a,"__xMorphStackCurrent"),e=function(){var m=$APP.k(a,"__xMorphStackModel");return $APP.n(m)?m:oD(a)}(),f=rD(a);if(f.length===0||b==null||$APP.p($APP.ge(function(m){return $APP.A.j(m,
|
|
27
|
+
b)},f)))return!1;if($APP.A.j(d,b))return!0;var h=$APP.n(d)?sD(a,d):null;f=sD(a,b);c=$APP.$l(new $APP.O(null,3,[$APP.nm,$APP.n(d)?d:"",$APP.rq,$APP.n(b)?b:"",$APP.Ym,$APP.n(c)?c:"method"],null));if($APP.Ph(a,"x-morph-stack-change",c)){ND(a);c=function(){var m=$APP.D(window.matchMedia("(prefers-reduced-motion:reduce)").matches);return m?m:$APP.Bi.i(e)}();if($APP.n(c))tD(a,b),queueMicrotask(function(){return $APP.Nh(a,"x-morph-stack-changed",$APP.$l(jD(d,b)))});else{h=uD(h);tD(a,b);$APP.wn.i(mD(a));
|
|
28
|
+
f=uD(f);f=KD(a,h,f);var l=function(){var m=$APP.k(a,"__xMorphStackToken");return $APP.n(m)?m:0}()+1;a.__xMorphStackToken=l;a.__xMorphStackEntries=f;a.__xMorphStackLast=null;a.__xMorphStackFrom=d;a.__xMorphStackTo=b;$APP.ja(a,"__xMorphStackTimeScale",bD($APP.wp.i(e),$APP.hq.i(e),$APP.Zo.i(e),$APP.Jq.i(e)));ZC($APP.nk.i(e))&&(yD(a),wD(a,0));f.length===0?MD(a,l,!0):(f=window.requestAnimationFrame(function(m){return $APP.A.j(l,$APP.k(a,"__xMorphStackToken"))?OD(a,m):null}),a.__xMorphStackRaf=f)}return!0}return!1},
|
|
29
|
+
QD=function(a){mD(a);var b=oD(a);a.__xMorphStackModel=b;$APP.S(a,"data-variant",$APP.nk.i(b));var c=rD(a);c=eD($APP.Qe($APP.zc(c)),b);b=$APP.k(a,"__xMorphStackCurrent");b==null?$APP.n(c)&&tD(a,c):$APP.n($APP.n(c)?$APP.I(c,b):c)?PD(a,c,"attribute"):(c=c==null,$APP.n(c?b:c)&&(ND(a),tD(a,null)))},RD=function(a){var b=rD(a);var c=$APP.k(a,"__xMorphStackModel");c=$APP.n(c)?c:oD(a);b=eD($APP.Qe($APP.zc(b)),c);c=$APP.k(a,"__xMorphStackCurrent");b==null?(ND(a),tD(a,null)):$APP.n($APP.n(c)?sD(a,c)==null:c)?
|
|
30
|
+
(ND(a),tD(a,b)):c==null?tD(a,b):tD(a,c);return null},SD=function(a){function b(){return RD(a)}var c=mD(a);c=$APP.G(c);$APP.C(c,$APP.un).addEventListener("slotchange",b);$APP.ja(a,"__xMorphStackHandlers",{slot:b})},TD=function(a){var b=$APP.k(a,"__xMorphStackHandlers"),c=$APP.k(a,"__xMorphStackRefs");$APP.n($APP.n(b)?c:b)&&(c=$APP.un.i(c),b=$APP.k(b,"slot"),$APP.n(b)&&c.removeEventListener("slotchange",b));a.__xMorphStackHandlers=null},UD=function(a,b,c){Object.defineProperty(a,b,{get:function(){var d=
|
|
31
|
+
this.getAttribute(c);return d==null?null:parseFloat(d)},set:function(d){return d==null?this.removeAttribute(c):this.setAttribute(c,""+$APP.V.i(d))},enumerable:!0,configurable:!0})},VD=function(a){$APP.Uh(a,"activeState","active-state");Object.defineProperty(a,"activeIndex",{get:function(){var b=this.getAttribute("active-index");return b==null?null:parseInt(b,10)},set:function(b){return b==null?this.removeAttribute("active-index"):this.setAttribute("active-index",""+$APP.V.i(b|0))},enumerable:!0,configurable:!0});
|
|
32
|
+
UD(a,"stiffness","stiffness");UD(a,"damping","damping");UD(a,"mass","mass");UD(a,"duration","duration");Object.defineProperty(a,"variant",{get:function(){return YC(this.getAttribute("variant"))},set:function(b){return b==null?this.removeAttribute("variant"):this.setAttribute("variant",""+$APP.V.i(b))},enumerable:!0,configurable:!0});$APP.Sh(a,"disabled","disabled");a.goTo=function(b){b=b!=null?""+$APP.V.i(b):null;return PD(this,b,"method")};a.next=function(){var b=rD(this);var c=b.length,d=$APP.k(this,
|
|
33
|
+
"__xMorphStackCurrent");if(c>0){b:{for(var e=0;;){if(e>=c){d=-1;break b}if($APP.A.j(b[e],d)){d=e;break b}e+=1}d=void 0}b=PD(this,b[$APP.qd(d+1,c)],"method")}else b=null;return b};a.prev=function(){var b=rD(this);var c=b.length,d=$APP.k(this,"__xMorphStackCurrent");if(c>0){b:{for(var e=0;;){if(e>=c){d=0;break b}if($APP.A.j(b[e],d)){d=e;break b}e+=1}d=void 0}b=PD(this,b[$APP.qd(d-1+c,c)],"method")}else b=null;return b};return a.states=function(){return rD(this)}},WD=function(a){mD(a);TD(a);SD(a);QD(a);
|
|
34
|
+
$APP.k(a,"__xMorphStackCurrent")==null&&RD(a);return null},XD=function(a){ND(a);var b=$APP.k(a,"__xMorphStackRefs"),c=$APP.n(b)?kD.i(b):null;$APP.n($APP.n(c)?c.parentNode:c)&&c.parentNode.removeChild(c);$APP.n(b)&&(b=$APP.El.j($APP.El.j(b,kD),$APP.po),a.__xMorphStackRefs=b);a.__xMorphStackFilterId=null;a.__xMorphStackFilterBlur=null;a.__xMorphStackFilterMatrix=null;a.__xMorphStackGooBaseBlur=null;a.__xMorphStackGooBaseThreshold=null;TD(a);return null},YD=function(a,b,c,d){$APP.I(c,d)&&QD(a);return null},
|
|
35
|
+
$D=function(){return $APP.Ah("x-morph-stack",new $APP.O(null,5,[$APP.qh,ZD,$APP.oh,WD,$APP.lh,XD,$APP.kh,YD,$APP.ph,VD],null))},ID=function ID(a){switch(arguments.length){case 1:return ID.i(arguments[0]);case 2:return ID.j(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;return ID.B(arguments[0],arguments[1],2<c.length?new $APP.Yb(c.slice(2),0,null):null)}};ID.i=function(a){return a};
|
|
36
|
+
ID.j=function(a,b){return $APP.y(a)<$APP.y(b)?$APP.xa(function(c,d){return $APP.$c(b,d)?$APP.Fl.j(c,d):c},a,a):$APP.xa($APP.Fl,a,b)};ID.B=function(a,b,c){return $APP.xa(ID,a,$APP.wd.j(c,b))};ID.K=function(a){var b=$APP.u(a),c=$APP.w(a);a=$APP.u(c);c=$APP.w(c);return this.B(b,a,c)};ID.M=2;
|
|
37
|
+
var JD=new $APP.F(null,"entering","entering",-413471949),HD=new $APP.F(null,"leaving","leaving",608616060),GD=new $APP.F(null,"matched","matched",-975207164),nD=new $APP.F(null,"active-state-raw","active-state-raw",-60607051),dD=new $APP.F(null,"active-state","active-state",-1185168001),kD=new $APP.F(null,"ghost-layer","ghost-layer",1707493707);var ZD="active-state active-index stiffness damping mass variant duration disabled".split(" "),XC=$APP.rg(["liquid","clean","organic"]);$APP.ce(["x-morph-stack-change",new $APP.O(null,2,[$APP.U,new $APP.O(null,3,[$APP.nm,$APP.X,$APP.rq,$APP.X,$APP.Ym,$APP.X],null),$APP.Aq,!0],null),"x-morph-stack-changed",new $APP.O(null,2,[$APP.U,new $APP.O(null,2,[$APP.nm,$APP.X,$APP.rq,$APP.X],null),$APP.Aq,!1],null)]);var xD=[0],OD=function OD(a,b){var d=$APP.k(a,"__xMorphStackToken"),e=$APP.k(a,"__xMorphStackEntries"),f=$APP.k(a,"__xMorphStackLast"),h=function(){var E=$APP.k(a,"__xMorphStackModel");return $APP.n(E)?E:oD(a)}(),l=$APP.Jq.i(h),m=$APP.hq.i(h);h=$APP.Zo.i(h);f=$APP.Gl.j(0,$APP.Hl.j(1/30,function(){var E=$APP.k(a,"__xMorphStackTimeScale");return $APP.n(E)?E:1}()*($APP.n(f)?(b-f)/1E3:1/60)));a.__xMorphStackLast=b;if($APP.n($APP.n(e)?e.length:e)){b=[!0];for(var q=[1],r=e.length,v=0;;)if(v<r){var x=e[v],
|
|
38
|
+
z=cD(x.t,x.v,f,l,m,h),B=z[0];z=z[1];x.t=B;x.v=z;x=x.update;x.i?x.i(B):x.call(null,B);B<q[0]&&(q[0]=B);Math.abs(B-1)<.001&&Math.abs(z)<.01||(b[0]=!1);v+=1}else break;wD(a,q[0]);$APP.n(b[0])?MD.m?MD.m(a,d,!0):MD.call(null,a,d,!0):(e=window.requestAnimationFrame(function(E){return $APP.A.j(d,$APP.k(a,"__xMorphStackToken"))?OD.j?OD.j(a,E):OD.call(null,a,E):null}),a.__xMorphStackRaf=e)}return null};$APP.ha("baredom.exports.x_morph_stack.init",$D);export const init=$D;
|