@tempots/ui 4.3.2 → 4.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.cjs +1 -1
  2. package/index.js +175 -168
  3. package/package.json +1 -1
package/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var we=Object.defineProperty;var xe=(t,e,n)=>e in t?we(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var gt=(t,e,n)=>xe(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@tempots/dom"),O=require("@tempots/std"),Bt=t=>{const e=t.split("/").pop();if(e==null||e.startsWith("."))return;const n=e.split(".")||[];return n.length>1?"."+n.pop():void 0},zt=(t,e)=>{const n=Bt(e);return n!=null&&(t.length===0||!t.some(o=>n==o))},ve=(t,e,n,o)=>{let s=t.target;for(;s!=null&&!(s instanceof HTMLAnchorElement);)s=s.parentElement;if(s==null)return!0;const i=s;if(t.button!==0||t.ctrlKey||t.metaKey||i.target!=="_self"&&i.target!==""||i.getAttribute("download")!=null)return!0;const{pathname:r,search:c,hash:l}=i;if(o){const u=r+c+l,d=i.getAttribute("href");if(!(d!=null&&d.startsWith("#"))&&d!==u)return!0}return e?!1:zt(n,r)},_t=(t,e={ignoreUrlWithExtension:!0,allowedExtensions:[],ignoreExternalUrl:!0})=>{const n=e.ignoreUrlWithExtension===!0&&Array.isArray(e.allowedExtensions)?e.allowedExtensions.map(o=>o.startsWith(".")?o:"."+o):[];return o=>{ve(o,e.ignoreUrlWithExtension??!0,n,e.ignoreExternalUrl??!0)||t()&&o.preventDefault()}},It=(t,e)=>t.pathname===e.pathname&&JSON.stringify(t.search)===JSON.stringify(e.search)&&t.hash===e.hash,Et=(t,e)=>{var i;const n=new URL(t,e??((i=a.getWindow())==null?void 0:i.location.toString())),o=Object.fromEntries(n.searchParams.entries());let s=n.hash;return s.startsWith("#")&&(s=s.substring(1)),{pathname:n.pathname,search:o,hash:s===""?void 0:s}},wt=(t,e)=>{const n=Et(e);return t.set(n),t},lt=t=>{const n=new URLSearchParams(t.search).toString(),o=t.hash;return`${t.pathname}${n?`?${n}`:""}${o?`#${o}`:""}`},be=t=>t.startsWith("http://")||t.startsWith("https://")||t.startsWith("//"),Ae=t=>{const e=t.container.currentURL,n=e.iso(o=>Et(o),o=>{if(be(o.pathname))return lt(o);const s=new URL(o.pathname,e.value),i=s.origin+s.pathname;return lt({...o,pathname:i})});return{value:n,dispose:n.dispose}},Re=()=>{const t=a.getWindow(),e=(t==null?void 0:t.location.hash)===""?void 0:(t==null?void 0:t.location.hash.substring(1))??void 0;return{pathname:(t==null?void 0:t.location.pathname)??"",search:Object.fromEntries(new URLSearchParams((t==null?void 0:t.location.search)??"").entries()),hash:e}},Ee=()=>{const t=a.prop(Re(),It),e=a.getWindow(),n=()=>{let o=(e==null?void 0:e.location.hash)??"";o.startsWith("#")&&(o=o.substring(1));const s={pathname:(e==null?void 0:e.location.pathname)??"",search:Object.fromEntries(new URLSearchParams((e==null?void 0:e.location.search)??"").entries()),hash:o===""?void 0:o};t.set(s)};return e==null||e.addEventListener("popstate",n),t.onDispose(()=>{e==null||e.removeEventListener("popstate",n)}),t.on(o=>{e==null||e.history.pushState({},"",lt(o))}),{value:t,dispose:t.dispose}},Ot={mark:a.makeProviderMark("LocationProvider"),create:(t,e)=>{if(e.isBrowser())return Ee();if(e.isHeadless())return Ae(e);throw new Error("Unknown context")}},Oe=t=>{document.startViewTransition?document.startViewTransition(t):t()},jt=(t,...e)=>{if(typeof t=="string"||a.Signal.is(t))return jt({href:t},...e);const{href:n,withViewTransition:o,...s}=t;return a.Use(Ot,i=>a.html.a(a.on.click(_t(()=>(o==!0?Oe(()=>{wt(i,a.Value.get(n))}):wt(i,a.Value.get(n)),!0),s)),a.attr.href(n),...e))},Se={mark:a.makeProviderMark("Appearance"),create:()=>{const t=qt();return{value:t,dispose:t.dispose}}};function qt(){const t=a.getWindow(),e=t!=null&&t.matchMedia!=null?t.matchMedia("(prefers-color-scheme: dark)"):void 0,n=(e==null?void 0:e.matches)??!1,o=a.prop(n?"dark":"light"),s=i=>o.set(i.matches?"dark":"light");return e==null||e.addEventListener("change",s),o.onDispose(()=>e==null?void 0:e.removeEventListener("change",s)),o}const St=(t,e)=>{if(typeof e=="function")return St(t,{success:e});const n=e.failure??(r=>r.map(c=>`Error: ${c}`)),o=e.success,s=e.loading??(()=>a.Empty),i=e.notAsked??(()=>a.Empty);return a.OneOfType(a.Value.toSignal(t),{AsyncSuccess:r=>o(r.$.value),AsyncFailure:r=>n(r.$.error),Loading:r=>s(r.map(c=>c.previousValue)),NotAsked:i})},Le=(t=10)=>a.WithElement(e=>a.OnDispose(O.delayed(()=>e==null?void 0:e.focus(),t))),Te=(t=10)=>a.WithElement(e=>{const n=O.delayed(()=>e.select(),t);return a.OnDispose(n)}),ke=a.WithElement(t=>{const e=t.style.getPropertyValue(":empty");return t.style.setProperty(":empty","display:none"),a.OnDispose(n=>{n&&t.style.setProperty(":empty",e)})}),De=t=>a.Portal("head > title",a.attr.innerText(t)),We={partial:{root:null,rootMargin:"0px",threshold:0},full:{root:null,rootMargin:"0px",threshold:1}},ct={partial:new Map,full:new Map},Z={partial:null,full:null};function Ce(t){return Z[t]==null&&(Z[t]=new IntersectionObserver(e=>{e.forEach(n=>{const o=ct[t].get(n.target);o==null||o.set(n.isIntersecting)})},We[t])),Z[t]}const Yt=({mode:t="partial",once:e=!1},n)=>{const o=a.prop(!1);return a.Fragment(a.WithElement(s=>{const i=typeof IntersectionObserver<"u"?Ce(t):null;ct[t].set(s,o),i==null||i.observe(s);function r(){var l;i==null||i.unobserve(s),ct[t].delete(s),ct[t].size===0&&((l=Z[t])==null||l.disconnect(),Z[t]=null)}let c=null;return e&&(c=o.on(l=>{l&&r()})),a.OnDispose(()=>{o.dispose(),r(),c==null||c()})}),a.renderableOfTNode(n(o)))},Pe=(t,e,n)=>Yt(t,o=>a.When(o,e,n??(()=>a.Empty))),K=Math.min,j=Math.max,at=Math.round,rt=Math.floor,P=t=>({x:t,y:t}),Fe={left:"right",right:"left",bottom:"top",top:"bottom"},Ve={start:"end",end:"start"};function xt(t,e,n){return j(t,K(e,n))}function nt(t,e){return typeof t=="function"?t(e):t}function q(t){return t.split("-")[0]}function ot(t){return t.split("-")[1]}function Xt(t){return t==="x"?"y":"x"}function Lt(t){return t==="y"?"height":"width"}function U(t){return["top","bottom"].includes(q(t))?"y":"x"}function Tt(t){return Xt(U(t))}function Me(t,e,n){n===void 0&&(n=!1);const o=ot(t),s=Tt(t),i=Lt(s);let r=s==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(r=ut(r)),[r,ut(r)]}function Ne(t){const e=ut(t);return[vt(t),e,vt(e)]}function vt(t){return t.replace(/start|end/g,e=>Ve[e])}function He(t,e,n){const o=["left","right"],s=["right","left"],i=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?s:o:e?o:s;case"left":case"right":return e?i:r;default:return[]}}function $e(t,e,n,o){const s=ot(t);let i=He(q(t),n==="start",o);return s&&(i=i.map(r=>r+"-"+s),e&&(i=i.concat(i.map(vt)))),i}function ut(t){return t.replace(/left|right|bottom|top/g,e=>Fe[e])}function Ue(t){return{top:0,right:0,bottom:0,left:0,...t}}function Kt(t){return typeof t!="number"?Ue(t):{top:t,right:t,bottom:t,left:t}}function ft(t){const{x:e,y:n,width:o,height:s}=t;return{width:o,height:s,top:n,left:e,right:e+o,bottom:n+s,x:e,y:n}}function Pt(t,e,n){let{reference:o,floating:s}=t;const i=U(e),r=Tt(e),c=Lt(r),l=q(e),u=i==="y",d=o.x+o.width/2-s.width/2,h=o.y+o.height/2-s.height/2,p=o[c]/2-s[c]/2;let f;switch(l){case"top":f={x:d,y:o.y-s.height};break;case"bottom":f={x:d,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:h};break;case"left":f={x:o.x-s.width,y:h};break;default:f={x:o.x,y:o.y}}switch(ot(e)){case"start":f[r]-=p*(n&&u?-1:1);break;case"end":f[r]+=p*(n&&u?-1:1);break}return f}const Be=async(t,e,n)=>{const{placement:o="bottom",strategy:s="absolute",middleware:i=[],platform:r}=n,c=i.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(e));let u=await r.getElementRects({reference:t,floating:e,strategy:s}),{x:d,y:h}=Pt(u,o,l),p=o,f={},m=0;for(let g=0;g<c.length;g++){const{name:y,fn:w}=c[g],{x,y:v,data:A,reset:b}=await w({x:d,y:h,initialPlacement:o,placement:p,strategy:s,middlewareData:f,rects:u,platform:r,elements:{reference:t,floating:e}});d=x??d,h=v??h,f={...f,[y]:{...f[y],...A}},b&&m<=50&&(m++,typeof b=="object"&&(b.placement&&(p=b.placement),b.rects&&(u=b.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:s}):b.rects),{x:d,y:h}=Pt(u,p,l)),g=-1)}return{x:d,y:h,placement:p,strategy:s,middlewareData:f}};async function Jt(t,e){var n;e===void 0&&(e={});const{x:o,y:s,platform:i,rects:r,elements:c,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:p=!1,padding:f=0}=nt(e,t),m=Kt(f),y=c[p?h==="floating"?"reference":"floating":h],w=ft(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:u,rootBoundary:d,strategy:l})),x=h==="floating"?{x:o,y:s,width:r.floating.width,height:r.floating.height}:r.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),A=await(i.isElement==null?void 0:i.isElement(v))?await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1}:{x:1,y:1},b=ft(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:v,strategy:l}):x);return{top:(w.top-b.top+m.top)/A.y,bottom:(b.bottom-w.bottom+m.bottom)/A.y,left:(w.left-b.left+m.left)/A.x,right:(b.right-w.right+m.right)/A.x}}const ze=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:s,rects:i,platform:r,elements:c,middlewareData:l}=e,{element:u,padding:d=0}=nt(t,e)||{};if(u==null)return{};const h=Kt(d),p={x:n,y:o},f=Tt(s),m=Lt(f),g=await r.getDimensions(u),y=f==="y",w=y?"top":"left",x=y?"bottom":"right",v=y?"clientHeight":"clientWidth",A=i.reference[m]+i.reference[f]-p[f]-i.floating[m],b=p[f]-i.reference[f],L=await(r.getOffsetParent==null?void 0:r.getOffsetParent(u));let R=L?L[v]:0;(!R||!await(r.isElement==null?void 0:r.isElement(L)))&&(R=c.floating[v]||i.floating[m]);const z=A/2-b/2,M=R/2-g[m]/2-1,T=K(h[w],M),_=K(h[x],M),N=T,Q=R-g[m]-_,E=R/2-g[m]/2+z,I=xt(N,E,Q),H=!l.arrow&&ot(s)!=null&&E!==I&&i.reference[m]/2-(E<N?T:_)-g[m]/2<0,k=H?E<N?E-N:E-Q:0;return{[f]:p[f]+k,data:{[f]:I,centerOffset:E-I-k,...H&&{alignmentOffset:k}},reset:H}}}),_e=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:s,middlewareData:i,rects:r,initialPlacement:c,platform:l,elements:u}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=nt(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=q(s),x=U(c),v=q(c)===c,A=await(l.isRTL==null?void 0:l.isRTL(u.floating)),b=p||(v||!g?[ut(c)]:Ne(c)),L=m!=="none";!p&&L&&b.push(...$e(c,g,m,A));const R=[c,...b],z=await Jt(e,y),M=[];let T=((o=i.flip)==null?void 0:o.overflows)||[];if(d&&M.push(z[w]),h){const E=Me(s,r,A);M.push(z[E[0]],z[E[1]])}if(T=[...T,{placement:s,overflows:M}],!M.every(E=>E<=0)){var _,N;const E=(((_=i.flip)==null?void 0:_.index)||0)+1,I=R[E];if(I&&(!(h==="alignment"?x!==U(I):!1)||T.every(D=>D.overflows[0]>0&&U(D.placement)===x)))return{data:{index:E,overflows:T},reset:{placement:I}};let H=(N=T.filter(k=>k.overflows[0]<=0).sort((k,D)=>k.overflows[1]-D.overflows[1])[0])==null?void 0:N.placement;if(!H)switch(f){case"bestFit":{var Q;const k=(Q=T.filter(D=>{if(L){const $=U(D.placement);return $===x||$==="y"}return!0}).map(D=>[D.placement,D.overflows.filter($=>$>0).reduce(($,ye)=>$+ye,0)]).sort((D,$)=>D[1]-$[1])[0])==null?void 0:Q[0];k&&(H=k);break}case"initialPlacement":H=c;break}if(s!==H)return{reset:{placement:H}}}return{}}}};async function Ie(t,e){const{placement:n,platform:o,elements:s}=t,i=await(o.isRTL==null?void 0:o.isRTL(s.floating)),r=q(n),c=ot(n),l=U(n)==="y",u=["left","top"].includes(r)?-1:1,d=i&&l?-1:1,h=nt(e,t);let{mainAxis:p,crossAxis:f,alignmentAxis:m}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof m=="number"&&(f=c==="end"?m*-1:m),l?{x:f*d,y:p*u}:{x:p*u,y:f*d}}const je=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:s,y:i,placement:r,middlewareData:c}=e,l=await Ie(e,t);return r===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:r}}}}},qe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:s}=e,{mainAxis:i=!0,crossAxis:r=!1,limiter:c={fn:y=>{let{x:w,y:x}=y;return{x:w,y:x}}},...l}=nt(t,e),u={x:n,y:o},d=await Jt(e,l),h=U(q(s)),p=Xt(h);let f=u[p],m=u[h];if(i){const y=p==="y"?"top":"left",w=p==="y"?"bottom":"right",x=f+d[y],v=f-d[w];f=xt(x,f,v)}if(r){const y=h==="y"?"top":"left",w=h==="y"?"bottom":"right",x=m+d[y],v=m-d[w];m=xt(x,m,v)}const g=c.fn({...e,[p]:f,[h]:m});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[p]:i,[h]:r}}}}}};function dt(){return typeof window<"u"}function G(t){return Gt(t)?(t.nodeName||"").toLowerCase():"#document"}function S(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function V(t){var e;return(e=(Gt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Gt(t){return dt()?t instanceof Node||t instanceof S(t).Node:!1}function W(t){return dt()?t instanceof Element||t instanceof S(t).Element:!1}function F(t){return dt()?t instanceof HTMLElement||t instanceof S(t).HTMLElement:!1}function Ft(t){return!dt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof S(t).ShadowRoot}function st(t){const{overflow:e,overflowX:n,overflowY:o,display:s}=C(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(s)}function Ye(t){return["table","td","th"].includes(G(t))}function mt(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function kt(t){const e=Dt(),n=W(t)?C(t):t;return["transform","translate","scale","rotate","perspective"].some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Xe(t){let e=B(t);for(;F(e)&&!J(e);){if(kt(e))return e;if(mt(e))return null;e=B(e)}return null}function Dt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function J(t){return["html","body","#document"].includes(G(t))}function C(t){return S(t).getComputedStyle(t)}function pt(t){return W(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function B(t){if(G(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Ft(t)&&t.host||V(t);return Ft(e)?e.host:e}function Qt(t){const e=B(t);return J(e)?t.ownerDocument?t.ownerDocument.body:t.body:F(e)&&st(e)?e:Qt(e)}function tt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=Qt(t),i=s===((o=t.ownerDocument)==null?void 0:o.body),r=S(s);if(i){const c=bt(r);return e.concat(r,r.visualViewport||[],st(s)?s:[],c&&n?tt(c):[])}return e.concat(s,tt(s,[],n))}function bt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Zt(t){const e=C(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const s=F(t),i=s?t.offsetWidth:n,r=s?t.offsetHeight:o,c=at(n)!==i||at(o)!==r;return c&&(n=i,o=r),{width:n,height:o,$:c}}function Wt(t){return W(t)?t:t.contextElement}function X(t){const e=Wt(t);if(!F(e))return P(1);const n=e.getBoundingClientRect(),{width:o,height:s,$:i}=Zt(e);let r=(i?at(n.width):n.width)/o,c=(i?at(n.height):n.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const Ke=P(0);function te(t){const e=S(t);return!Dt()||!e.visualViewport?Ke:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Je(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==S(t)?!1:e}function Y(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=Wt(t);let r=P(1);e&&(o?W(o)&&(r=X(o)):r=X(t));const c=Je(i,n,o)?te(i):P(0);let l=(s.left+c.x)/r.x,u=(s.top+c.y)/r.y,d=s.width/r.x,h=s.height/r.y;if(i){const p=S(i),f=o&&W(o)?S(o):o;let m=p,g=bt(m);for(;g&&o&&f!==m;){const y=X(g),w=g.getBoundingClientRect(),x=C(g),v=w.left+(g.clientLeft+parseFloat(x.paddingLeft))*y.x,A=w.top+(g.clientTop+parseFloat(x.paddingTop))*y.y;l*=y.x,u*=y.y,d*=y.x,h*=y.y,l+=v,u+=A,m=S(g),g=bt(m)}}return ft({width:d,height:h,x:l,y:u})}function Ct(t,e){const n=pt(t).scrollLeft;return e?e.left+n:Y(V(t)).left+n}function ee(t,e,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),s=o.left+e.scrollLeft-(n?0:Ct(t,o)),i=o.top+e.scrollTop;return{x:s,y:i}}function Ge(t){let{elements:e,rect:n,offsetParent:o,strategy:s}=t;const i=s==="fixed",r=V(o),c=e?mt(e.floating):!1;if(o===r||c&&i)return n;let l={scrollLeft:0,scrollTop:0},u=P(1);const d=P(0),h=F(o);if((h||!h&&!i)&&((G(o)!=="body"||st(r))&&(l=pt(o)),F(o))){const f=Y(o);u=X(o),d.x=f.x+o.clientLeft,d.y=f.y+o.clientTop}const p=r&&!h&&!i?ee(r,l,!0):P(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-l.scrollTop*u.y+d.y+p.y}}function Qe(t){return Array.from(t.getClientRects())}function Ze(t){const e=V(t),n=pt(t),o=t.ownerDocument.body,s=j(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=j(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+Ct(t);const c=-n.scrollTop;return C(o).direction==="rtl"&&(r+=j(e.clientWidth,o.clientWidth)-s),{width:s,height:i,x:r,y:c}}function tn(t,e){const n=S(t),o=V(t),s=n.visualViewport;let i=o.clientWidth,r=o.clientHeight,c=0,l=0;if(s){i=s.width,r=s.height;const u=Dt();(!u||u&&e==="fixed")&&(c=s.offsetLeft,l=s.offsetTop)}return{width:i,height:r,x:c,y:l}}function en(t,e){const n=Y(t,!0,e==="fixed"),o=n.top+t.clientTop,s=n.left+t.clientLeft,i=F(t)?X(t):P(1),r=t.clientWidth*i.x,c=t.clientHeight*i.y,l=s*i.x,u=o*i.y;return{width:r,height:c,x:l,y:u}}function Vt(t,e,n){let o;if(e==="viewport")o=tn(t,n);else if(e==="document")o=Ze(V(t));else if(W(e))o=en(e,n);else{const s=te(t);o={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return ft(o)}function ne(t,e){const n=B(t);return n===e||!W(n)||J(n)?!1:C(n).position==="fixed"||ne(n,e)}function nn(t,e){const n=e.get(t);if(n)return n;let o=tt(t,[],!1).filter(c=>W(c)&&G(c)!=="body"),s=null;const i=C(t).position==="fixed";let r=i?B(t):t;for(;W(r)&&!J(r);){const c=C(r),l=kt(r);!l&&c.position==="fixed"&&(s=null),(i?!l&&!s:!l&&c.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||st(r)&&!l&&ne(t,r))?o=o.filter(d=>d!==r):s=c,r=B(r)}return e.set(t,o),o}function on(t){let{element:e,boundary:n,rootBoundary:o,strategy:s}=t;const r=[...n==="clippingAncestors"?mt(e)?[]:nn(e,this._c):[].concat(n),o],c=r[0],l=r.reduce((u,d)=>{const h=Vt(e,d,s);return u.top=j(h.top,u.top),u.right=K(h.right,u.right),u.bottom=K(h.bottom,u.bottom),u.left=j(h.left,u.left),u},Vt(e,c,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function sn(t){const{width:e,height:n}=Zt(t);return{width:e,height:n}}function rn(t,e,n){const o=F(e),s=V(e),i=n==="fixed",r=Y(t,!0,i,e);let c={scrollLeft:0,scrollTop:0};const l=P(0);function u(){l.x=Ct(s)}if(o||!o&&!i)if((G(e)!=="body"||st(s))&&(c=pt(e)),o){const f=Y(e,!0,i,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else s&&u();i&&!o&&s&&u();const d=s&&!o&&!i?ee(s,c):P(0),h=r.left+c.scrollLeft-l.x-d.x,p=r.top+c.scrollTop-l.y-d.y;return{x:h,y:p,width:r.width,height:r.height}}function yt(t){return C(t).position==="static"}function Mt(t,e){if(!F(t)||C(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return V(t)===n&&(n=n.ownerDocument.body),n}function oe(t,e){const n=S(t);if(mt(t))return n;if(!F(t)){let s=B(t);for(;s&&!J(s);){if(W(s)&&!yt(s))return s;s=B(s)}return n}let o=Mt(t,e);for(;o&&Ye(o)&&yt(o);)o=Mt(o,e);return o&&J(o)&&yt(o)&&!kt(o)?n:o||Xe(t)||n}const cn=async function(t){const e=this.getOffsetParent||oe,n=this.getDimensions,o=await n(t.floating);return{reference:rn(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function ln(t){return C(t).direction==="rtl"}const an={convertOffsetParentRelativeRectToViewportRelativeRect:Ge,getDocumentElement:V,getClippingRect:on,getOffsetParent:oe,getElementRects:cn,getClientRects:Qe,getDimensions:sn,getScale:X,isElement:W,isRTL:ln};function se(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function un(t,e){let n=null,o;const s=V(t);function i(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function r(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),i();const u=t.getBoundingClientRect(),{left:d,top:h,width:p,height:f}=u;if(c||e(),!p||!f)return;const m=rt(h),g=rt(s.clientWidth-(d+p)),y=rt(s.clientHeight-(h+f)),w=rt(d),v={rootMargin:-m+"px "+-g+"px "+-y+"px "+-w+"px",threshold:j(0,K(1,l))||1};let A=!0;function b(L){const R=L[0].intersectionRatio;if(R!==l){if(!A)return r();R?r(!1,R):o=setTimeout(()=>{r(!1,1e-7)},1e3)}R===1&&!se(u,t.getBoundingClientRect())&&r(),A=!1}try{n=new IntersectionObserver(b,{...v,root:s.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(t)}return r(!0),i}function fn(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=Wt(t),d=s||i?[...u?tt(u):[],...tt(e)]:[];d.forEach(w=>{s&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const h=u&&c?un(u,n):null;let p=-1,f=null;r&&(f=new ResizeObserver(w=>{let[x]=w;x&&x.target===u&&f&&(f.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var v;(v=f)==null||v.observe(e)})),n()}),u&&!l&&f.observe(u),f.observe(e));let m,g=l?Y(t):null;l&&y();function y(){const w=Y(t);g&&!se(g,w)&&n(),g=w,m=requestAnimationFrame(y)}return n(),()=>{var w;d.forEach(x=>{s&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),h==null||h(),(w=f)==null||w.disconnect(),f=null,l&&cancelAnimationFrame(m)}}const hn=je,dn=qe,Nt=_e,mn=ze,pn=(t,e,n)=>{const o=new Map,s={platform:an,...n},i={...s.platform,_c:o};return Be(t,e,{...s,platform:i})},gn=({content:t,open:e,placement:n,offset:o={mainAxis:0,crossAxis:0},arrow:s})=>a.WithBrowserCtx(i=>{const r=a.Value.toSignal(e),c=i.element,l=a.Value.toSignal(o),u=l.$.mainAxis.map(f=>f??0),d=l.$.crossAxis.map(f=>f??0),h=a.Value.toSignal(n??"top"),p=a.prop({centerOffset:0,alignmentOffset:0,containerWidth:0,containerHeight:0,placement:"top",x:0,y:void 0});return a.When(r,()=>a.Portal("body",a.html.div(a.WithElement(f=>{var x;const m=f;m.style.position="absolute";let g=null;async function y(){const v=[Nt(),hn({mainAxis:u.get(),crossAxis:d.get()}),dn(),Nt()];s!=null&&g!=null&&v.push(mn({element:g,padding:(s==null?void 0:s.padding)??0}));const A=await pn(c,m,{placement:h.get(),strategy:"absolute",middleware:v}),{x:b,y:L,middlewareData:R}=A;if(m.style.top=`${L}px`,m.style.left=`${b}px`,g&&R.arrow){const{x:z,y:M,centerOffset:T,alignmentOffset:_}=R.arrow,N={x:z,y:M,centerOffset:T,alignmentOffset:_,placement:h.get(),containerWidth:m.offsetWidth,containerHeight:m.offsetHeight};p.set(N)}}const w=a.effectOf(u,d,h)(y);return a.Fragment(s!=null?a.html.div((x=s.content)==null?void 0:x.call(s,p),a.WithElement(v=>{g=v,y()})):null,a.OnDispose(p.dispose,fn(c,m,y),w))}),t())))}),ie=(t,e,n)=>{const o=a.prop(O.AsyncResult.notAsked),s=o.map(h=>O.AsyncResult.isSuccess(h)?h.value:void 0),i=o.map(h=>O.AsyncResult.isFailure(h)?h.error:void 0),r=o.map(h=>O.AsyncResult.isLoading(h));let c;const l=async h=>{c==null||c.abort(),c=new AbortController;const p=c.signal,f=o.get();o.set(O.AsyncResult.loading(O.AsyncResult.getOrUndefined(f)));try{const m=await e({request:h,abortSignal:p,previous:f});await Promise.resolve(),c=void 0,o.set(O.AsyncResult.success(m))}catch(m){c=void 0,o.set(O.AsyncResult.failure(n(m)))}},u=()=>l(a.Value.get(t)),d=()=>{c==null||c.abort(),c=void 0,o.dispose()};return o.onDispose(a.Value.on(t,l)),{status:o,value:s,error:i,loading:r,reload:u,dispose:d}},re=(t,e)=>{const{status:n,dispose:o,reload:s}=t,{loading:i,failure:r,success:c}=e;return a.Fragment(a.OnDispose(o),St(n,{loading:i!=null?l=>i(l,s):void 0,failure:r!=null?l=>r(l,s):void 0,success:l=>c(l,s)}))},yn=({request:t,load:e,mapError:n=o=>o})=>{const o=ie(t,e,n);return s=>re(o,s)},ce=(t,e)=>{if(typeof e=="function")return ce(t,{success:e});const n=e.failure??(s=>a.Fragment(a.OnDispose(s.on(console.error)),s.map(i=>`Error: ${i}`))),o=e.success;return a.OneOfType(a.Value.toSignal(t),{Success:s=>o(s.$.value),Failure:s=>n(s.$.error)})},wn=()=>a.on.focus(t=>{var e;return(e=t.target)==null?void 0:e.select()});class it{constructor(e,n,o,s){gt(this,"equals",e=>O.nearEqual(this.left,e.left)&&O.nearEqual(this.top,e.top)&&O.nearEqual(this.width,e.width)&&O.nearEqual(this.height,e.height));this.left=e,this.top=n,this.width=o,this.height=s}static of({left:e=0,top:n=0,width:o=0,height:s=0}){return new it(e,n,o,s)}get right(){return this.left+this.width}get bottom(){return this.top+this.height}get center(){return{x:this.left+this.width/2,y:this.top+this.height/2}}get size(){return{width:this.width,height:this.height}}}function At(t){const e=t.getBoundingClientRect();return it.of({top:e.top+window.scrollY,left:e.left+window.scrollX,width:e.width,height:e.height})}const le=t=>a.WithBrowserCtx(e=>{const{element:n}=e,o=a.prop(At(n)),s=a.renderableOfTNode(t(o))(e),i=()=>{o.set(it.of(At(n)))};let r;return typeof ResizeObserver=="function"&&(r=new ResizeObserver(i),r.observe(n)),a.OnDispose(c=>{r==null||r.disconnect(),s(c)})}),xn=t=>le(t),vn=t=>e=>{const n=a.getWindow(),o=a.prop({width:(n==null?void 0:n.innerWidth)??0,height:(n==null?void 0:n.innerHeight)??0}),s=a.renderableOfTNode(t(o))(e),i=()=>{o.set({width:(n==null?void 0:n.innerWidth)??0,height:(n==null?void 0:n.innerHeight)??0})};return n==null||n.addEventListener("resize",i),r=>{n==null||n.removeEventListener("resize",i),s(r)}},ae=(t,e)=>{const n=e.split("/").filter(s=>s!==""),o={};for(let s=0;s<t.length;s++){const i=t[s],r=n[s];if(!r&&i.type!=="catch-all")return null;if(i.type==="literal"){if(i.value!==r)return null}else if(i.type==="param")o[i.name]=r;else if(i.type==="catch-all")return{params:o,path:e}}return n.length!==t.length?null:{params:o,path:e}},ue=t=>t.split("/").map(e=>e.startsWith(":")?{type:"param",name:e.slice(1)}:e==="*"?{type:"catch-all"}:{type:"literal",value:e}).filter(e=>e.type!=="literal"||e.value!==""),fe=t=>{const e=t.map(n=>{const o=ue(n);return{route:n,segments:o}});return function(o){for(const{segments:s,route:i}of e){const r=ae(s,o);if(r)return{...r,route:i}}return null}},bn=t=>{const e=fe(Object.keys(t));return a.Use(Ot,n=>{const o=n.map(s=>{const i=e(s.pathname);if(i==null)throw console.error("No route found for",s),new Error("No route found");return{params:i.params,route:i.route,path:i.path,search:s.search,hash:s.hash}});return a.OneOfTuple(o.map(s=>[s.route,s]),t)})},ht=60*1e3,Rt=60*ht,et=24*Rt,Ht=7*et,$t=30*et,An=365*et,Rn=[{max:ht*90,value:ht,name:"minute",past:{singular:"a minute ago",plural:"{} minutes ago"},future:{singular:"in a minute",plural:"in {} minutes"}},{max:Rt*36,value:Rt,name:"hour",past:{singular:"an hour ago",plural:"{} hours ago"},future:{singular:"in an hour",plural:"in {} hours"}},{max:et*10,value:et,name:"day",past:{singular:"yesterday",plural:"{} days ago"},future:{singular:"tomorrow",plural:"in {} days"}},{max:Ht*6,value:Ht,name:"week",past:{singular:"last week",plural:"{} weeks ago"},future:{singular:"in a week",plural:"in {} weeks"}},{max:$t*18,value:$t,name:"month",past:{singular:"last month",plural:"{} months ago"},future:{singular:"in a month",plural:"in {} months"}},{max:1/0,value:An,name:"year",past:{singular:"last year",plural:"{} years ago"},future:{singular:"in a year",plural:"in {} years"}}];function Ut(t,e,n,o){const s=Math.round(t/e);return s<=1?n:o.replace("{}",s.toLocaleString(void 0,{maximumFractionDigits:0,minimumFractionDigits:0}))}const he=(t=1e3)=>{const e=a.prop(new Date),n=O.interval(()=>e.set(new Date),t);return e.onDispose(n),e},de=t=>{const e=Math.abs(t);if(e<ht)return t<0?"just now":"in a moment";for(const n of Rn)if(e<n.max)return t<0?Ut(e,n.value,n.past.singular,n.past.plural):Ut(e,n.value,n.future.singular,n.future.plural);throw new Error("unreachable")},me=(t,{now:e,frequency:n=1e4}={})=>{const o=e!=null?a.Signal.is(e)?e.derive():a.prop(e):he(n),s=a.computedOf(t,o)((i,r)=>i.getTime()-r.getTime());return s.onDispose(()=>a.Value.dispose(o)),s},pe=(t,e={})=>{const n=me(t,e),o=n.map(de);return o.onDispose(n.dispose),o},En=(t,e={})=>pe(t,e);class ge extends a.Prop{constructor(){super(...arguments);gt(this,"tick",()=>this.update(n=>n+1))}}const On=(t=0)=>new ge(t,(e,n)=>e===n);exports.Anchor=jt;exports.Appearance=Se;exports.AsyncResultView=St;exports.AutoFocus=Le;exports.AutoSelect=Te;exports.ElementRect=le;exports.ElementSize=xn;exports.HTMLTitle=De;exports.HiddenWhenEmpty=ke;exports.InViewport=Yt;exports.Location=Ot;exports.PopOver=gn;exports.Rect=it;exports.Resource=yn;exports.ResourceDisplay=re;exports.ResultView=ce;exports.Router=bn;exports.SelectOnFocus=wn;exports.Ticker=ge;exports.WhenInViewport=Pe;exports.WindowSize=vn;exports._checkExtensionCondition=zt;exports._getExtension=Bt;exports._makeRouteMatcher=fe;exports._parseRouteSegments=ue;exports.areLocationsEqual=It;exports.getAbsoluteRect=At;exports.handleAnchorClick=_t;exports.locationFromURL=Et;exports.makeResource=ie;exports.matchesRoute=ae;exports.nowSignal=he;exports.relativeTime=En;exports.relativeTimeMillisSignal=me;exports.relativeTimeSignal=pe;exports.setLocationFromUrl=wt;exports.ticker=On;exports.timeDiffToString=de;exports.urlFromLocation=lt;exports.useAppearance=qt;
1
+ "use strict";var we=Object.defineProperty;var xe=(t,e,n)=>e in t?we(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var gt=(t,e,n)=>xe(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@tempots/dom"),O=require("@tempots/std"),Bt=t=>{const e=t.split("/").pop();if(e==null||e.startsWith("."))return;const n=e.split(".")||[];return n.length>1?"."+n.pop():void 0},zt=(t,e)=>{const n=Bt(e);return n!=null&&(t.length===0||!t.some(o=>n==o))},ve=(t,e,n,o)=>{let s=t.target;for(;s!=null&&!(s instanceof HTMLAnchorElement);)s=s.parentElement;if(s==null)return!0;const i=s;if(t.button!==0||t.ctrlKey||t.metaKey||i.target!=="_self"&&i.target!==""||i.getAttribute("download")!=null)return!0;const{pathname:r,search:c,hash:l}=i;if(o){const u=r+c+l,d=i.getAttribute("href");if(!(d!=null&&d.startsWith("#"))&&d!==u)return!0}return e?!1:zt(n,r)},_t=(t,e={ignoreUrlWithExtension:!0,allowedExtensions:[],ignoreExternalUrl:!0})=>{const n=e.ignoreUrlWithExtension===!0&&Array.isArray(e.allowedExtensions)?e.allowedExtensions.map(o=>o.startsWith(".")?o:"."+o):[];return o=>{ve(o,e.ignoreUrlWithExtension??!0,n,e.ignoreExternalUrl??!0)||t()&&o.preventDefault()}},It=(t,e)=>t.pathname===e.pathname&&JSON.stringify(t.search)===JSON.stringify(e.search)&&t.hash===e.hash,Et=(t,e)=>{var i;const n=new URL(t,e??((i=a.getWindow())==null?void 0:i.location.toString())),o=Object.fromEntries(n.searchParams.entries());let s=n.hash;return s.startsWith("#")&&(s=s.substring(1)),{pathname:n.pathname,search:o,hash:s===""?void 0:s}},wt=(t,e)=>{const n=Et(e);return t.set(n),t},lt=t=>{const n=new URLSearchParams(t.search).toString(),o=t.hash;return`${t.pathname}${n?`?${n}`:""}${o?`#${o}`:""}`},be=t=>t.startsWith("http://")||t.startsWith("https://")||t.startsWith("//"),Ae=t=>{const e=t.container.currentURL,n=e.iso(o=>Et(o),o=>{if(be(o.pathname))return lt(o);const s=new URL(o.pathname,e.value),i=s.origin+s.pathname;return lt({...o,pathname:i})});return{value:n,dispose:n.dispose}},Re=()=>{const t=a.getWindow(),e=(t==null?void 0:t.location.hash)===""?void 0:(t==null?void 0:t.location.hash.substring(1))??void 0;return{pathname:(t==null?void 0:t.location.pathname)??"",search:Object.fromEntries(new URLSearchParams((t==null?void 0:t.location.search)??"").entries()),hash:e}},Ee=()=>{const t=a.prop(Re(),It),e=a.getWindow(),n=()=>{let o=(e==null?void 0:e.location.hash)??"";o.startsWith("#")&&(o=o.substring(1));const s={pathname:(e==null?void 0:e.location.pathname)??"",search:Object.fromEntries(new URLSearchParams((e==null?void 0:e.location.search)??"").entries()),hash:o===""?void 0:o};t.set(s)};return e==null||e.addEventListener("popstate",n),t.onDispose(()=>{e==null||e.removeEventListener("popstate",n)}),t.on(o=>{e==null||e.history.pushState({},"",lt(o))}),{value:t,dispose:t.dispose}},Ot={mark:a.makeProviderMark("LocationProvider"),create:(t,e)=>{if(e.isBrowser())return Ee();if(e.isHeadless())return Ae(e);throw new Error("Unknown context")}},Oe=t=>{document.startViewTransition?document.startViewTransition(t):t()},jt=(t,...e)=>{if(typeof t=="string"||a.Signal.is(t))return jt({href:t},...e);const{href:n,withViewTransition:o,...s}=t;return a.Use(Ot,i=>a.html.a(a.on.click(_t(()=>(o==!0?Oe(()=>{wt(i,a.Value.get(n))}):wt(i,a.Value.get(n)),!0),s)),a.attr.href(n),...e))},Se={mark:a.makeProviderMark("Appearance"),create:()=>{const t=qt();return{value:t,dispose:t.dispose}}};function qt(){const t=a.getWindow(),e=t!=null&&t.matchMedia!=null?t.matchMedia("(prefers-color-scheme: dark)"):void 0,n=(e==null?void 0:e.matches)??!1,o=a.prop(n?"dark":"light"),s=i=>o.set(i.matches?"dark":"light");return e==null||e.addEventListener("change",s),o.onDispose(()=>e==null?void 0:e.removeEventListener("change",s)),o}const St=(t,e)=>{if(typeof e=="function")return St(t,{success:e});const n=e.failure??(r=>r.map(c=>`Error: ${c}`)),o=e.success,s=e.loading??(()=>a.Empty),i=e.notAsked??(()=>a.Empty);return a.OneOfType(a.Value.toSignal(t),{AsyncSuccess:r=>o(r.$.value),AsyncFailure:r=>n(r.$.error),Loading:r=>s(r.map(c=>c.previousValue)),NotAsked:i})},Le=(t=10)=>a.WithElement(e=>a.OnDispose(O.delayed(()=>e==null?void 0:e.focus(),t))),Te=(t=10)=>a.WithElement(e=>{const n=O.delayed(()=>e.select(),t);return a.OnDispose(n)}),ke=a.WithElement(t=>{const e=t.style.getPropertyValue(":empty");return t.style.setProperty(":empty","display:none"),a.OnDispose(n=>{n&&t.style.setProperty(":empty",e)})}),De=t=>a.Portal("head > title",a.attr.innerText(t)),We={partial:{root:null,rootMargin:"0px",threshold:0},full:{root:null,rootMargin:"0px",threshold:1}},ct={partial:new Map,full:new Map},Z={partial:null,full:null};function Ce(t){return Z[t]==null&&(Z[t]=new IntersectionObserver(e=>{e.forEach(n=>{const o=ct[t].get(n.target);o==null||o.set(n.isIntersecting)})},We[t])),Z[t]}const Yt=({mode:t="partial",once:e=!1},n)=>{const o=a.prop(!1);return a.Fragment(a.WithElement(s=>{const i=typeof IntersectionObserver<"u"?Ce(t):null;ct[t].set(s,o),i==null||i.observe(s);function r(){var l;i==null||i.unobserve(s),ct[t].delete(s),ct[t].size===0&&((l=Z[t])==null||l.disconnect(),Z[t]=null)}let c=null;return e&&(c=o.on(l=>{l&&r()})),a.OnDispose(()=>{o.dispose(),r(),c==null||c()})}),a.renderableOfTNode(n(o)))},Pe=(t,e,n)=>Yt(t,o=>a.When(o,e,n??(()=>a.Empty))),K=Math.min,j=Math.max,at=Math.round,rt=Math.floor,P=t=>({x:t,y:t}),Fe={left:"right",right:"left",bottom:"top",top:"bottom"},Ve={start:"end",end:"start"};function xt(t,e,n){return j(t,K(e,n))}function nt(t,e){return typeof t=="function"?t(e):t}function q(t){return t.split("-")[0]}function ot(t){return t.split("-")[1]}function Xt(t){return t==="x"?"y":"x"}function Lt(t){return t==="y"?"height":"width"}function $(t){return["top","bottom"].includes(q(t))?"y":"x"}function Tt(t){return Xt($(t))}function Me(t,e,n){n===void 0&&(n=!1);const o=ot(t),s=Tt(t),i=Lt(s);let r=s==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(r=ut(r)),[r,ut(r)]}function Ne(t){const e=ut(t);return[vt(t),e,vt(e)]}function vt(t){return t.replace(/start|end/g,e=>Ve[e])}function He(t,e,n){const o=["left","right"],s=["right","left"],i=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?s:o:e?o:s;case"left":case"right":return e?i:r;default:return[]}}function $e(t,e,n,o){const s=ot(t);let i=He(q(t),n==="start",o);return s&&(i=i.map(r=>r+"-"+s),e&&(i=i.concat(i.map(vt)))),i}function ut(t){return t.replace(/left|right|bottom|top/g,e=>Fe[e])}function Ue(t){return{top:0,right:0,bottom:0,left:0,...t}}function Kt(t){return typeof t!="number"?Ue(t):{top:t,right:t,bottom:t,left:t}}function ft(t){const{x:e,y:n,width:o,height:s}=t;return{width:o,height:s,top:n,left:e,right:e+o,bottom:n+s,x:e,y:n}}function Pt(t,e,n){let{reference:o,floating:s}=t;const i=$(e),r=Tt(e),c=Lt(r),l=q(e),u=i==="y",d=o.x+o.width/2-s.width/2,h=o.y+o.height/2-s.height/2,p=o[c]/2-s[c]/2;let f;switch(l){case"top":f={x:d,y:o.y-s.height};break;case"bottom":f={x:d,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:h};break;case"left":f={x:o.x-s.width,y:h};break;default:f={x:o.x,y:o.y}}switch(ot(e)){case"start":f[r]-=p*(n&&u?-1:1);break;case"end":f[r]+=p*(n&&u?-1:1);break}return f}const Be=async(t,e,n)=>{const{placement:o="bottom",strategy:s="absolute",middleware:i=[],platform:r}=n,c=i.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(e));let u=await r.getElementRects({reference:t,floating:e,strategy:s}),{x:d,y:h}=Pt(u,o,l),p=o,f={},m=0;for(let g=0;g<c.length;g++){const{name:y,fn:w}=c[g],{x,y:v,data:A,reset:b}=await w({x:d,y:h,initialPlacement:o,placement:p,strategy:s,middlewareData:f,rects:u,platform:r,elements:{reference:t,floating:e}});d=x??d,h=v??h,f={...f,[y]:{...f[y],...A}},b&&m<=50&&(m++,typeof b=="object"&&(b.placement&&(p=b.placement),b.rects&&(u=b.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:s}):b.rects),{x:d,y:h}=Pt(u,p,l)),g=-1)}return{x:d,y:h,placement:p,strategy:s,middlewareData:f}};async function Jt(t,e){var n;e===void 0&&(e={});const{x:o,y:s,platform:i,rects:r,elements:c,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:p=!1,padding:f=0}=nt(e,t),m=Kt(f),y=c[p?h==="floating"?"reference":"floating":h],w=ft(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:u,rootBoundary:d,strategy:l})),x=h==="floating"?{x:o,y:s,width:r.floating.width,height:r.floating.height}:r.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),A=await(i.isElement==null?void 0:i.isElement(v))?await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1}:{x:1,y:1},b=ft(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:v,strategy:l}):x);return{top:(w.top-b.top+m.top)/A.y,bottom:(b.bottom-w.bottom+m.bottom)/A.y,left:(w.left-b.left+m.left)/A.x,right:(b.right-w.right+m.right)/A.x}}const ze=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:s,rects:i,platform:r,elements:c,middlewareData:l}=e,{element:u,padding:d=0}=nt(t,e)||{};if(u==null)return{};const h=Kt(d),p={x:n,y:o},f=Tt(s),m=Lt(f),g=await r.getDimensions(u),y=f==="y",w=y?"top":"left",x=y?"bottom":"right",v=y?"clientHeight":"clientWidth",A=i.reference[m]+i.reference[f]-p[f]-i.floating[m],b=p[f]-i.reference[f],L=await(r.getOffsetParent==null?void 0:r.getOffsetParent(u));let R=L?L[v]:0;(!R||!await(r.isElement==null?void 0:r.isElement(L)))&&(R=c.floating[v]||i.floating[m]);const B=A/2-b/2,M=R/2-g[m]/2-1,T=K(h[w],M),z=K(h[x],M),_=T,Q=R-g[m]-z,E=R/2-g[m]/2+B,I=xt(_,E,Q),N=!l.arrow&&ot(s)!=null&&E!==I&&i.reference[m]/2-(E<_?T:z)-g[m]/2<0,k=N?E<_?E-_:E-Q:0;return{[f]:p[f]+k,data:{[f]:I,centerOffset:E-I-k,...N&&{alignmentOffset:k}},reset:N}}}),_e=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:s,middlewareData:i,rects:r,initialPlacement:c,platform:l,elements:u}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=nt(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=q(s),x=$(c),v=q(c)===c,A=await(l.isRTL==null?void 0:l.isRTL(u.floating)),b=p||(v||!g?[ut(c)]:Ne(c)),L=m!=="none";!p&&L&&b.push(...$e(c,g,m,A));const R=[c,...b],B=await Jt(e,y),M=[];let T=((o=i.flip)==null?void 0:o.overflows)||[];if(d&&M.push(B[w]),h){const E=Me(s,r,A);M.push(B[E[0]],B[E[1]])}if(T=[...T,{placement:s,overflows:M}],!M.every(E=>E<=0)){var z,_;const E=(((z=i.flip)==null?void 0:z.index)||0)+1,I=R[E];if(I&&(!(h==="alignment"?x!==$(I):!1)||T.every(D=>D.overflows[0]>0&&$(D.placement)===x)))return{data:{index:E,overflows:T},reset:{placement:I}};let N=(_=T.filter(k=>k.overflows[0]<=0).sort((k,D)=>k.overflows[1]-D.overflows[1])[0])==null?void 0:_.placement;if(!N)switch(f){case"bestFit":{var Q;const k=(Q=T.filter(D=>{if(L){const H=$(D.placement);return H===x||H==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(H=>H>0).reduce((H,ye)=>H+ye,0)]).sort((D,H)=>D[1]-H[1])[0])==null?void 0:Q[0];k&&(N=k);break}case"initialPlacement":N=c;break}if(s!==N)return{reset:{placement:N}}}return{}}}};async function Ie(t,e){const{placement:n,platform:o,elements:s}=t,i=await(o.isRTL==null?void 0:o.isRTL(s.floating)),r=q(n),c=ot(n),l=$(n)==="y",u=["left","top"].includes(r)?-1:1,d=i&&l?-1:1,h=nt(e,t);let{mainAxis:p,crossAxis:f,alignmentAxis:m}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof m=="number"&&(f=c==="end"?m*-1:m),l?{x:f*d,y:p*u}:{x:p*u,y:f*d}}const je=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:s,y:i,placement:r,middlewareData:c}=e,l=await Ie(e,t);return r===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:r}}}}},qe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:s}=e,{mainAxis:i=!0,crossAxis:r=!1,limiter:c={fn:y=>{let{x:w,y:x}=y;return{x:w,y:x}}},...l}=nt(t,e),u={x:n,y:o},d=await Jt(e,l),h=$(q(s)),p=Xt(h);let f=u[p],m=u[h];if(i){const y=p==="y"?"top":"left",w=p==="y"?"bottom":"right",x=f+d[y],v=f-d[w];f=xt(x,f,v)}if(r){const y=h==="y"?"top":"left",w=h==="y"?"bottom":"right",x=m+d[y],v=m-d[w];m=xt(x,m,v)}const g=c.fn({...e,[p]:f,[h]:m});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[p]:i,[h]:r}}}}}};function dt(){return typeof window<"u"}function G(t){return Gt(t)?(t.nodeName||"").toLowerCase():"#document"}function S(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function V(t){var e;return(e=(Gt(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Gt(t){return dt()?t instanceof Node||t instanceof S(t).Node:!1}function W(t){return dt()?t instanceof Element||t instanceof S(t).Element:!1}function F(t){return dt()?t instanceof HTMLElement||t instanceof S(t).HTMLElement:!1}function Ft(t){return!dt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof S(t).ShadowRoot}function st(t){const{overflow:e,overflowX:n,overflowY:o,display:s}=C(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(s)}function Ye(t){return["table","td","th"].includes(G(t))}function mt(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function kt(t){const e=Dt(),n=W(t)?C(t):t;return["transform","translate","scale","rotate","perspective"].some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Xe(t){let e=U(t);for(;F(e)&&!J(e);){if(kt(e))return e;if(mt(e))return null;e=U(e)}return null}function Dt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function J(t){return["html","body","#document"].includes(G(t))}function C(t){return S(t).getComputedStyle(t)}function pt(t){return W(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function U(t){if(G(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Ft(t)&&t.host||V(t);return Ft(e)?e.host:e}function Qt(t){const e=U(t);return J(e)?t.ownerDocument?t.ownerDocument.body:t.body:F(e)&&st(e)?e:Qt(e)}function tt(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=Qt(t),i=s===((o=t.ownerDocument)==null?void 0:o.body),r=S(s);if(i){const c=bt(r);return e.concat(r,r.visualViewport||[],st(s)?s:[],c&&n?tt(c):[])}return e.concat(s,tt(s,[],n))}function bt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Zt(t){const e=C(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const s=F(t),i=s?t.offsetWidth:n,r=s?t.offsetHeight:o,c=at(n)!==i||at(o)!==r;return c&&(n=i,o=r),{width:n,height:o,$:c}}function Wt(t){return W(t)?t:t.contextElement}function X(t){const e=Wt(t);if(!F(e))return P(1);const n=e.getBoundingClientRect(),{width:o,height:s,$:i}=Zt(e);let r=(i?at(n.width):n.width)/o,c=(i?at(n.height):n.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const Ke=P(0);function te(t){const e=S(t);return!Dt()||!e.visualViewport?Ke:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Je(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==S(t)?!1:e}function Y(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=Wt(t);let r=P(1);e&&(o?W(o)&&(r=X(o)):r=X(t));const c=Je(i,n,o)?te(i):P(0);let l=(s.left+c.x)/r.x,u=(s.top+c.y)/r.y,d=s.width/r.x,h=s.height/r.y;if(i){const p=S(i),f=o&&W(o)?S(o):o;let m=p,g=bt(m);for(;g&&o&&f!==m;){const y=X(g),w=g.getBoundingClientRect(),x=C(g),v=w.left+(g.clientLeft+parseFloat(x.paddingLeft))*y.x,A=w.top+(g.clientTop+parseFloat(x.paddingTop))*y.y;l*=y.x,u*=y.y,d*=y.x,h*=y.y,l+=v,u+=A,m=S(g),g=bt(m)}}return ft({width:d,height:h,x:l,y:u})}function Ct(t,e){const n=pt(t).scrollLeft;return e?e.left+n:Y(V(t)).left+n}function ee(t,e,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),s=o.left+e.scrollLeft-(n?0:Ct(t,o)),i=o.top+e.scrollTop;return{x:s,y:i}}function Ge(t){let{elements:e,rect:n,offsetParent:o,strategy:s}=t;const i=s==="fixed",r=V(o),c=e?mt(e.floating):!1;if(o===r||c&&i)return n;let l={scrollLeft:0,scrollTop:0},u=P(1);const d=P(0),h=F(o);if((h||!h&&!i)&&((G(o)!=="body"||st(r))&&(l=pt(o)),F(o))){const f=Y(o);u=X(o),d.x=f.x+o.clientLeft,d.y=f.y+o.clientTop}const p=r&&!h&&!i?ee(r,l,!0):P(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x+p.x,y:n.y*u.y-l.scrollTop*u.y+d.y+p.y}}function Qe(t){return Array.from(t.getClientRects())}function Ze(t){const e=V(t),n=pt(t),o=t.ownerDocument.body,s=j(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=j(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+Ct(t);const c=-n.scrollTop;return C(o).direction==="rtl"&&(r+=j(e.clientWidth,o.clientWidth)-s),{width:s,height:i,x:r,y:c}}function tn(t,e){const n=S(t),o=V(t),s=n.visualViewport;let i=o.clientWidth,r=o.clientHeight,c=0,l=0;if(s){i=s.width,r=s.height;const u=Dt();(!u||u&&e==="fixed")&&(c=s.offsetLeft,l=s.offsetTop)}return{width:i,height:r,x:c,y:l}}function en(t,e){const n=Y(t,!0,e==="fixed"),o=n.top+t.clientTop,s=n.left+t.clientLeft,i=F(t)?X(t):P(1),r=t.clientWidth*i.x,c=t.clientHeight*i.y,l=s*i.x,u=o*i.y;return{width:r,height:c,x:l,y:u}}function Vt(t,e,n){let o;if(e==="viewport")o=tn(t,n);else if(e==="document")o=Ze(V(t));else if(W(e))o=en(e,n);else{const s=te(t);o={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return ft(o)}function ne(t,e){const n=U(t);return n===e||!W(n)||J(n)?!1:C(n).position==="fixed"||ne(n,e)}function nn(t,e){const n=e.get(t);if(n)return n;let o=tt(t,[],!1).filter(c=>W(c)&&G(c)!=="body"),s=null;const i=C(t).position==="fixed";let r=i?U(t):t;for(;W(r)&&!J(r);){const c=C(r),l=kt(r);!l&&c.position==="fixed"&&(s=null),(i?!l&&!s:!l&&c.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||st(r)&&!l&&ne(t,r))?o=o.filter(d=>d!==r):s=c,r=U(r)}return e.set(t,o),o}function on(t){let{element:e,boundary:n,rootBoundary:o,strategy:s}=t;const r=[...n==="clippingAncestors"?mt(e)?[]:nn(e,this._c):[].concat(n),o],c=r[0],l=r.reduce((u,d)=>{const h=Vt(e,d,s);return u.top=j(h.top,u.top),u.right=K(h.right,u.right),u.bottom=K(h.bottom,u.bottom),u.left=j(h.left,u.left),u},Vt(e,c,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function sn(t){const{width:e,height:n}=Zt(t);return{width:e,height:n}}function rn(t,e,n){const o=F(e),s=V(e),i=n==="fixed",r=Y(t,!0,i,e);let c={scrollLeft:0,scrollTop:0};const l=P(0);function u(){l.x=Ct(s)}if(o||!o&&!i)if((G(e)!=="body"||st(s))&&(c=pt(e)),o){const f=Y(e,!0,i,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else s&&u();i&&!o&&s&&u();const d=s&&!o&&!i?ee(s,c):P(0),h=r.left+c.scrollLeft-l.x-d.x,p=r.top+c.scrollTop-l.y-d.y;return{x:h,y:p,width:r.width,height:r.height}}function yt(t){return C(t).position==="static"}function Mt(t,e){if(!F(t)||C(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return V(t)===n&&(n=n.ownerDocument.body),n}function oe(t,e){const n=S(t);if(mt(t))return n;if(!F(t)){let s=U(t);for(;s&&!J(s);){if(W(s)&&!yt(s))return s;s=U(s)}return n}let o=Mt(t,e);for(;o&&Ye(o)&&yt(o);)o=Mt(o,e);return o&&J(o)&&yt(o)&&!kt(o)?n:o||Xe(t)||n}const cn=async function(t){const e=this.getOffsetParent||oe,n=this.getDimensions,o=await n(t.floating);return{reference:rn(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function ln(t){return C(t).direction==="rtl"}const an={convertOffsetParentRelativeRectToViewportRelativeRect:Ge,getDocumentElement:V,getClippingRect:on,getOffsetParent:oe,getElementRects:cn,getClientRects:Qe,getDimensions:sn,getScale:X,isElement:W,isRTL:ln};function se(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function un(t,e){let n=null,o;const s=V(t);function i(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function r(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),i();const u=t.getBoundingClientRect(),{left:d,top:h,width:p,height:f}=u;if(c||e(),!p||!f)return;const m=rt(h),g=rt(s.clientWidth-(d+p)),y=rt(s.clientHeight-(h+f)),w=rt(d),v={rootMargin:-m+"px "+-g+"px "+-y+"px "+-w+"px",threshold:j(0,K(1,l))||1};let A=!0;function b(L){const R=L[0].intersectionRatio;if(R!==l){if(!A)return r();R?r(!1,R):o=setTimeout(()=>{r(!1,1e-7)},1e3)}R===1&&!se(u,t.getBoundingClientRect())&&r(),A=!1}try{n=new IntersectionObserver(b,{...v,root:s.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(t)}return r(!0),i}function fn(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=Wt(t),d=s||i?[...u?tt(u):[],...tt(e)]:[];d.forEach(w=>{s&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const h=u&&c?un(u,n):null;let p=-1,f=null;r&&(f=new ResizeObserver(w=>{let[x]=w;x&&x.target===u&&f&&(f.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var v;(v=f)==null||v.observe(e)})),n()}),u&&!l&&f.observe(u),f.observe(e));let m,g=l?Y(t):null;l&&y();function y(){const w=Y(t);g&&!se(g,w)&&n(),g=w,m=requestAnimationFrame(y)}return n(),()=>{var w;d.forEach(x=>{s&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),h==null||h(),(w=f)==null||w.disconnect(),f=null,l&&cancelAnimationFrame(m)}}const hn=je,dn=qe,Nt=_e,mn=ze,pn=(t,e,n)=>{const o=new Map,s={platform:an,...n},i={...s.platform,_c:o};return Be(t,e,{...s,platform:i})},gn=({content:t,open:e,placement:n,offset:o={mainAxis:0,crossAxis:0},arrow:s})=>a.WithBrowserCtx(i=>{const r=a.Value.toSignal(e),c=i.element,l=a.Value.toSignal(o),u=l.$.mainAxis.map(f=>f??0),d=l.$.crossAxis.map(f=>f??0),h=a.Value.toSignal(n??"top"),p=a.prop({centerOffset:0,alignmentOffset:0,containerWidth:0,containerHeight:0,x:void 0,y:void 0});return a.When(r,()=>a.Portal("body",a.html.div(a.WithElement(f=>{var x;const m=f;m.style.position="absolute";let g=null;async function y(){const v=[Nt(),hn({mainAxis:u.get(),crossAxis:d.get()}),dn(),Nt()];s!=null&&g!=null&&v.push(mn({element:g,padding:(s==null?void 0:s.padding)??0}));const A=await pn(c,m,{placement:h.get(),strategy:"absolute",middleware:v}),{x:b,y:L,middlewareData:R}=A;if(m.style.top=`${L}px`,m.style.left=`${b}px`,g!=null&&R.arrow!=null){const{x:B,y:M,centerOffset:T,alignmentOffset:z}=R.arrow;p.set({x:B,y:M,centerOffset:T,alignmentOffset:z,containerWidth:m.offsetWidth,containerHeight:m.offsetHeight})}}const w=a.effectOf(u,d,h)(y);return a.Fragment(s!=null?a.html.div((x=s.content)==null?void 0:x.call(s,a.computedOf(p,h)((v,A)=>({...v,placement:A}))),a.WithElement(v=>{g=v,y()})):null,a.OnDispose(p.dispose,fn(c,m,y),w))}),t())))}),ie=(t,e,n)=>{const o=a.prop(O.AsyncResult.notAsked),s=o.map(h=>O.AsyncResult.isSuccess(h)?h.value:void 0),i=o.map(h=>O.AsyncResult.isFailure(h)?h.error:void 0),r=o.map(h=>O.AsyncResult.isLoading(h));let c;const l=async h=>{c==null||c.abort(),c=new AbortController;const p=c.signal,f=o.get();o.set(O.AsyncResult.loading(O.AsyncResult.getOrUndefined(f)));try{const m=await e({request:h,abortSignal:p,previous:f});await Promise.resolve(),c=void 0,o.set(O.AsyncResult.success(m))}catch(m){c=void 0,o.set(O.AsyncResult.failure(n(m)))}},u=()=>l(a.Value.get(t)),d=()=>{c==null||c.abort(),c=void 0,o.dispose()};return o.onDispose(a.Value.on(t,l)),{status:o,value:s,error:i,loading:r,reload:u,dispose:d}},re=(t,e)=>{const{status:n,dispose:o,reload:s}=t,{loading:i,failure:r,success:c}=e;return a.Fragment(a.OnDispose(o),St(n,{loading:i!=null?l=>i(l,s):void 0,failure:r!=null?l=>r(l,s):void 0,success:l=>c(l,s)}))},yn=({request:t,load:e,mapError:n=o=>o})=>{const o=ie(t,e,n);return s=>re(o,s)},ce=(t,e)=>{if(typeof e=="function")return ce(t,{success:e});const n=e.failure??(s=>a.Fragment(a.OnDispose(s.on(console.error)),s.map(i=>`Error: ${i}`))),o=e.success;return a.OneOfType(a.Value.toSignal(t),{Success:s=>o(s.$.value),Failure:s=>n(s.$.error)})},wn=()=>a.on.focus(t=>{var e;return(e=t.target)==null?void 0:e.select()});class it{constructor(e,n,o,s){gt(this,"equals",e=>O.nearEqual(this.left,e.left)&&O.nearEqual(this.top,e.top)&&O.nearEqual(this.width,e.width)&&O.nearEqual(this.height,e.height));this.left=e,this.top=n,this.width=o,this.height=s}static of({left:e=0,top:n=0,width:o=0,height:s=0}){return new it(e,n,o,s)}get right(){return this.left+this.width}get bottom(){return this.top+this.height}get center(){return{x:this.left+this.width/2,y:this.top+this.height/2}}get size(){return{width:this.width,height:this.height}}}function At(t){const e=t.getBoundingClientRect();return it.of({top:e.top+window.scrollY,left:e.left+window.scrollX,width:e.width,height:e.height})}const le=t=>a.WithBrowserCtx(e=>{const{element:n}=e,o=a.prop(At(n)),s=a.renderableOfTNode(t(o))(e),i=()=>{o.set(it.of(At(n)))};let r;return typeof ResizeObserver=="function"&&(r=new ResizeObserver(i),r.observe(n)),a.OnDispose(c=>{r==null||r.disconnect(),s(c)})}),xn=t=>le(t),vn=t=>e=>{const n=a.getWindow(),o=a.prop({width:(n==null?void 0:n.innerWidth)??0,height:(n==null?void 0:n.innerHeight)??0}),s=a.renderableOfTNode(t(o))(e),i=()=>{o.set({width:(n==null?void 0:n.innerWidth)??0,height:(n==null?void 0:n.innerHeight)??0})};return n==null||n.addEventListener("resize",i),r=>{n==null||n.removeEventListener("resize",i),s(r)}},ae=(t,e)=>{const n=e.split("/").filter(s=>s!==""),o={};for(let s=0;s<t.length;s++){const i=t[s],r=n[s];if(!r&&i.type!=="catch-all")return null;if(i.type==="literal"){if(i.value!==r)return null}else if(i.type==="param")o[i.name]=r;else if(i.type==="catch-all")return{params:o,path:e}}return n.length!==t.length?null:{params:o,path:e}},ue=t=>t.split("/").map(e=>e.startsWith(":")?{type:"param",name:e.slice(1)}:e==="*"?{type:"catch-all"}:{type:"literal",value:e}).filter(e=>e.type!=="literal"||e.value!==""),fe=t=>{const e=t.map(n=>{const o=ue(n);return{route:n,segments:o}});return function(o){for(const{segments:s,route:i}of e){const r=ae(s,o);if(r)return{...r,route:i}}return null}},bn=t=>{const e=fe(Object.keys(t));return a.Use(Ot,n=>{const o=n.map(s=>{const i=e(s.pathname);if(i==null)throw console.error("No route found for",s),new Error("No route found");return{params:i.params,route:i.route,path:i.path,search:s.search,hash:s.hash}});return a.OneOfTuple(o.map(s=>[s.route,s]),t)})},ht=60*1e3,Rt=60*ht,et=24*Rt,Ht=7*et,$t=30*et,An=365*et,Rn=[{max:ht*90,value:ht,name:"minute",past:{singular:"a minute ago",plural:"{} minutes ago"},future:{singular:"in a minute",plural:"in {} minutes"}},{max:Rt*36,value:Rt,name:"hour",past:{singular:"an hour ago",plural:"{} hours ago"},future:{singular:"in an hour",plural:"in {} hours"}},{max:et*10,value:et,name:"day",past:{singular:"yesterday",plural:"{} days ago"},future:{singular:"tomorrow",plural:"in {} days"}},{max:Ht*6,value:Ht,name:"week",past:{singular:"last week",plural:"{} weeks ago"},future:{singular:"in a week",plural:"in {} weeks"}},{max:$t*18,value:$t,name:"month",past:{singular:"last month",plural:"{} months ago"},future:{singular:"in a month",plural:"in {} months"}},{max:1/0,value:An,name:"year",past:{singular:"last year",plural:"{} years ago"},future:{singular:"in a year",plural:"in {} years"}}];function Ut(t,e,n,o){const s=Math.round(t/e);return s<=1?n:o.replace("{}",s.toLocaleString(void 0,{maximumFractionDigits:0,minimumFractionDigits:0}))}const he=(t=1e3)=>{const e=a.prop(new Date),n=O.interval(()=>e.set(new Date),t);return e.onDispose(n),e},de=t=>{const e=Math.abs(t);if(e<ht)return t<0?"just now":"in a moment";for(const n of Rn)if(e<n.max)return t<0?Ut(e,n.value,n.past.singular,n.past.plural):Ut(e,n.value,n.future.singular,n.future.plural);throw new Error("unreachable")},me=(t,{now:e,frequency:n=1e4}={})=>{const o=e!=null?a.Signal.is(e)?e.derive():a.prop(e):he(n),s=a.computedOf(t,o)((i,r)=>i.getTime()-r.getTime());return s.onDispose(()=>a.Value.dispose(o)),s},pe=(t,e={})=>{const n=me(t,e),o=n.map(de);return o.onDispose(n.dispose),o},En=(t,e={})=>pe(t,e);class ge extends a.Prop{constructor(){super(...arguments);gt(this,"tick",()=>this.update(n=>n+1))}}const On=(t=0)=>new ge(t,(e,n)=>e===n);exports.Anchor=jt;exports.Appearance=Se;exports.AsyncResultView=St;exports.AutoFocus=Le;exports.AutoSelect=Te;exports.ElementRect=le;exports.ElementSize=xn;exports.HTMLTitle=De;exports.HiddenWhenEmpty=ke;exports.InViewport=Yt;exports.Location=Ot;exports.PopOver=gn;exports.Rect=it;exports.Resource=yn;exports.ResourceDisplay=re;exports.ResultView=ce;exports.Router=bn;exports.SelectOnFocus=wn;exports.Ticker=ge;exports.WhenInViewport=Pe;exports.WindowSize=vn;exports._checkExtensionCondition=zt;exports._getExtension=Bt;exports._makeRouteMatcher=fe;exports._parseRouteSegments=ue;exports.areLocationsEqual=It;exports.getAbsoluteRect=At;exports.handleAnchorClick=_t;exports.locationFromURL=Et;exports.makeResource=ie;exports.matchesRoute=ae;exports.nowSignal=he;exports.relativeTime=En;exports.relativeTimeMillisSignal=me;exports.relativeTimeSignal=pe;exports.setLocationFromUrl=wt;exports.ticker=On;exports.timeDiffToString=de;exports.urlFromLocation=lt;exports.useAppearance=qt;
package/index.js CHANGED
@@ -1,8 +1,8 @@
1
- var we = Object.defineProperty;
2
- var xe = (t, e, n) => e in t ? we(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var bt = (t, e, n) => xe(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { getWindow as it, prop as $, makeProviderMark as qt, Signal as Xt, Use as Kt, html as Rt, on as Jt, Value as P, attr as Gt, Empty as Et, OneOfType as Qt, WithElement as G, OnDispose as _, Portal as Zt, Fragment as pt, renderableOfTNode as Ct, When as te, WithBrowserCtx as ee, effectOf as ve, OneOfTuple as be, computedOf as Ae, Prop as Re } from "@tempots/dom";
5
- import { delayed as ne, AsyncResult as B, nearEqual as at, interval as Ee } from "@tempots/std";
1
+ var xe = Object.defineProperty;
2
+ var ve = (t, e, n) => e in t ? xe(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var bt = (t, e, n) => ve(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import { getWindow as it, prop as N, makeProviderMark as qt, Signal as Xt, Use as Kt, html as Rt, on as Jt, Value as P, attr as Gt, Empty as Et, OneOfType as Qt, WithElement as G, OnDispose as z, Portal as Zt, Fragment as pt, renderableOfTNode as Ct, When as te, WithBrowserCtx as ee, effectOf as be, computedOf as ne, OneOfTuple as Ae, Prop as Re } from "@tempots/dom";
5
+ import { delayed as oe, AsyncResult as H, nearEqual as at, interval as Ee } from "@tempots/std";
6
6
  const Le = (t) => {
7
7
  const e = t.split("/").pop();
8
8
  if (e == null || e.startsWith(".")) return;
@@ -43,7 +43,7 @@ const Le = (t) => {
43
43
  e.ignoreExternalUrl ?? !0
44
44
  ) || t() && o.preventDefault();
45
45
  };
46
- }, ke = (t, e) => t.pathname === e.pathname && JSON.stringify(t.search) === JSON.stringify(e.search) && t.hash === e.hash, oe = (t, e) => {
46
+ }, ke = (t, e) => t.pathname === e.pathname && JSON.stringify(t.search) === JSON.stringify(e.search) && t.hash === e.hash, se = (t, e) => {
47
47
  var i;
48
48
  const n = new URL(t, e ?? ((i = it()) == null ? void 0 : i.location.toString())), o = Object.fromEntries(n.searchParams.entries());
49
49
  let s = n.hash;
@@ -53,14 +53,14 @@ const Le = (t) => {
53
53
  hash: s === "" ? void 0 : s
54
54
  };
55
55
  }, Nt = (t, e) => {
56
- const n = oe(e);
56
+ const n = se(e);
57
57
  return t.set(n), t;
58
58
  }, Lt = (t) => {
59
59
  const n = new URLSearchParams(t.search).toString(), o = t.hash;
60
60
  return `${t.pathname}${n ? `?${n}` : ""}${o ? `#${o}` : ""}`;
61
61
  }, Ce = (t) => t.startsWith("http://") || t.startsWith("https://") || t.startsWith("//"), Pe = (t) => {
62
62
  const e = t.container.currentURL, n = e.iso(
63
- (o) => oe(o),
63
+ (o) => se(o),
64
64
  (o) => {
65
65
  if (Ce(o.pathname))
66
66
  return Lt(o);
@@ -79,7 +79,7 @@ const Le = (t) => {
79
79
  hash: e
80
80
  };
81
81
  }, We = () => {
82
- const t = $(De(), ke), e = it(), n = () => {
82
+ const t = N(De(), ke), e = it(), n = () => {
83
83
  let o = (e == null ? void 0 : e.location.hash) ?? "";
84
84
  o.startsWith("#") && (o = o.substring(1));
85
85
  const s = {
@@ -99,7 +99,7 @@ const Le = (t) => {
99
99
  value: t,
100
100
  dispose: t.dispose
101
101
  };
102
- }, se = {
102
+ }, ie = {
103
103
  mark: qt("LocationProvider"),
104
104
  create: (t, e) => {
105
105
  if (e.isBrowser())
@@ -118,7 +118,7 @@ const Le = (t) => {
118
118
  withViewTransition: o,
119
119
  ...s
120
120
  } = t;
121
- return Kt(se, (i) => Rt.a(
121
+ return Kt(ie, (i) => Rt.a(
122
122
  Jt.click(
123
123
  Te(() => (o == !0 ? Fe(() => {
124
124
  Nt(i, P.get(n));
@@ -138,12 +138,12 @@ const Le = (t) => {
138
138
  }
139
139
  };
140
140
  function Ve() {
141
- const t = it(), e = t != null && t.matchMedia != null ? t.matchMedia("(prefers-color-scheme: dark)") : void 0, n = (e == null ? void 0 : e.matches) ?? !1, o = $(n ? "dark" : "light"), s = (i) => o.set(i.matches ? "dark" : "light");
141
+ const t = it(), e = t != null && t.matchMedia != null ? t.matchMedia("(prefers-color-scheme: dark)") : void 0, n = (e == null ? void 0 : e.matches) ?? !1, o = N(n ? "dark" : "light"), s = (i) => o.set(i.matches ? "dark" : "light");
142
142
  return e == null || e.addEventListener("change", s), o.onDispose(() => e == null ? void 0 : e.removeEventListener("change", s)), o;
143
143
  }
144
- const ie = (t, e) => {
144
+ const re = (t, e) => {
145
145
  if (typeof e == "function")
146
- return ie(t, { success: e });
146
+ return re(t, { success: e });
147
147
  const n = e.failure ?? ((r) => r.map((c) => `Error: ${c}`)), o = e.success, s = e.loading ?? (() => Et), i = e.notAsked ?? (() => Et);
148
148
  return Qt(P.toSignal(t), {
149
149
  AsyncSuccess: (r) => o(r.$.value),
@@ -151,12 +151,12 @@ const ie = (t, e) => {
151
151
  Loading: (r) => s(r.map((c) => c.previousValue)),
152
152
  NotAsked: i
153
153
  });
154
- }, Bn = (t = 10) => G((e) => _(ne(() => e == null ? void 0 : e.focus(), t))), Un = (t = 10) => G((e) => {
155
- const n = ne(() => e.select(), t);
156
- return _(n);
154
+ }, Bn = (t = 10) => G((e) => z(oe(() => e == null ? void 0 : e.focus(), t))), Un = (t = 10) => G((e) => {
155
+ const n = oe(() => e.select(), t);
156
+ return z(n);
157
157
  }), zn = G((t) => {
158
158
  const e = t.style.getPropertyValue(":empty");
159
- return t.style.setProperty(":empty", "display:none"), _((n) => {
159
+ return t.style.setProperty(":empty", "display:none"), z((n) => {
160
160
  n && t.style.setProperty(":empty", e);
161
161
  });
162
162
  }), _n = (t) => Zt("head > title", Gt.innerText(t)), Ne = {
@@ -186,7 +186,7 @@ function $e(t) {
186
186
  }, Ne[t])), nt[t];
187
187
  }
188
188
  const He = ({ mode: t = "partial", once: e = !1 }, n) => {
189
- const o = $(!1);
189
+ const o = N(!1);
190
190
  return pt(
191
191
  G((s) => {
192
192
  const i = typeof IntersectionObserver < "u" ? $e(t) : null;
@@ -198,7 +198,7 @@ const He = ({ mode: t = "partial", once: e = !1 }, n) => {
198
198
  let c = null;
199
199
  return e && (c = o.on((l) => {
200
200
  l && r();
201
- })), _(() => {
201
+ })), z(() => {
202
202
  o.dispose(), r(), c == null || c();
203
203
  });
204
204
  }),
@@ -228,17 +228,17 @@ function X(t) {
228
228
  function ct(t) {
229
229
  return t.split("-")[1];
230
230
  }
231
- function re(t) {
231
+ function ce(t) {
232
232
  return t === "x" ? "y" : "x";
233
233
  }
234
234
  function Pt(t) {
235
235
  return t === "y" ? "height" : "width";
236
236
  }
237
- function U(t) {
237
+ function B(t) {
238
238
  return ["top", "bottom"].includes(X(t)) ? "y" : "x";
239
239
  }
240
240
  function Dt(t) {
241
- return re(U(t));
241
+ return ce(B(t));
242
242
  }
243
243
  function ze(t, e, n) {
244
244
  n === void 0 && (n = !1);
@@ -283,7 +283,7 @@ function Ye(t) {
283
283
  ...t
284
284
  };
285
285
  }
286
- function ce(t) {
286
+ function le(t) {
287
287
  return typeof t != "number" ? Ye(t) : {
288
288
  top: t,
289
289
  right: t,
@@ -314,7 +314,7 @@ function $t(t, e, n) {
314
314
  reference: o,
315
315
  floating: s
316
316
  } = t;
317
- const i = U(e), r = Dt(e), c = Pt(r), l = X(e), a = i === "y", h = o.x + o.width / 2 - s.width / 2, f = o.y + o.height / 2 - s.height / 2, m = o[c] / 2 - s[c] / 2;
317
+ const i = B(e), r = Dt(e), c = Pt(r), l = X(e), a = i === "y", h = o.x + o.width / 2 - s.width / 2, f = o.y + o.height / 2 - s.height / 2, m = o[c] / 2 - s[c] / 2;
318
318
  let u;
319
319
  switch (l) {
320
320
  case "top":
@@ -375,13 +375,13 @@ const qe = async (t, e, n) => {
375
375
  for (let g = 0; g < c.length; g++) {
376
376
  const {
377
377
  name: p,
378
- fn: y
378
+ fn: w
379
379
  } = c[g], {
380
- x: w,
380
+ x: y,
381
381
  y: x,
382
382
  data: b,
383
383
  reset: v
384
- } = await y({
384
+ } = await w({
385
385
  x: h,
386
386
  y: f,
387
387
  initialPlacement: o,
@@ -395,7 +395,7 @@ const qe = async (t, e, n) => {
395
395
  floating: e
396
396
  }
397
397
  });
398
- h = w ?? h, f = x ?? f, u = {
398
+ h = y ?? h, f = x ?? f, u = {
399
399
  ...u,
400
400
  [p]: {
401
401
  ...u[p],
@@ -418,7 +418,7 @@ const qe = async (t, e, n) => {
418
418
  middlewareData: u
419
419
  };
420
420
  };
421
- async function le(t, e) {
421
+ async function ae(t, e) {
422
422
  var n;
423
423
  e === void 0 && (e = {});
424
424
  const {
@@ -434,12 +434,12 @@ async function le(t, e) {
434
434
  elementContext: f = "floating",
435
435
  altBoundary: m = !1,
436
436
  padding: u = 0
437
- } = rt(e, t), d = ce(u), p = c[m ? f === "floating" ? "reference" : "floating" : f], y = mt(await i.getClippingRect({
437
+ } = rt(e, t), d = le(u), p = c[m ? f === "floating" ? "reference" : "floating" : f], w = mt(await i.getClippingRect({
438
438
  element: (n = await (i.isElement == null ? void 0 : i.isElement(p))) == null || n ? p : p.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(c.floating)),
439
439
  boundary: a,
440
440
  rootBoundary: h,
441
441
  strategy: l
442
- })), w = f === "floating" ? {
442
+ })), y = f === "floating" ? {
443
443
  x: o,
444
444
  y: s,
445
445
  width: r.floating.width,
@@ -452,15 +452,15 @@ async function le(t, e) {
452
452
  y: 1
453
453
  }, v = mt(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
454
454
  elements: c,
455
- rect: w,
455
+ rect: y,
456
456
  offsetParent: x,
457
457
  strategy: l
458
- }) : w);
458
+ }) : y);
459
459
  return {
460
- top: (y.top - v.top + d.top) / b.y,
461
- bottom: (v.bottom - y.bottom + d.bottom) / b.y,
462
- left: (y.left - v.left + d.left) / b.x,
463
- right: (v.right - y.right + d.right) / b.x
460
+ top: (w.top - v.top + d.top) / b.y,
461
+ bottom: (v.bottom - w.bottom + d.bottom) / b.y,
462
+ left: (w.left - v.left + d.left) / b.x,
463
+ right: (v.right - w.right + d.right) / b.x
464
464
  };
465
465
  }
466
466
  const Xe = (t) => ({
@@ -481,23 +481,23 @@ const Xe = (t) => ({
481
481
  } = rt(t, e) || {};
482
482
  if (a == null)
483
483
  return {};
484
- const f = ce(h), m = {
484
+ const f = le(h), m = {
485
485
  x: n,
486
486
  y: o
487
- }, u = Dt(s), d = Pt(u), g = await r.getDimensions(a), p = u === "y", y = p ? "top" : "left", w = p ? "bottom" : "right", x = p ? "clientHeight" : "clientWidth", b = i.reference[d] + i.reference[u] - m[u] - i.floating[d], v = m[u] - i.reference[u], L = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(a));
487
+ }, u = Dt(s), d = Pt(u), g = await r.getDimensions(a), p = u === "y", w = p ? "top" : "left", y = p ? "bottom" : "right", x = p ? "clientHeight" : "clientWidth", b = i.reference[d] + i.reference[u] - m[u] - i.floating[d], v = m[u] - i.reference[u], L = await (r.getOffsetParent == null ? void 0 : r.getOffsetParent(a));
488
488
  let A = L ? L[x] : 0;
489
489
  (!A || !await (r.isElement == null ? void 0 : r.isElement(L))) && (A = c.floating[x] || i.floating[d]);
490
- const I = b / 2 - v / 2, M = A / 2 - g[d] / 2 - 1, O = Q(f[y], M), j = Q(f[w], M), V = O, et = A - g[d] - j, R = A / 2 - g[d] / 2 + I, Y = Ot(V, R, et), N = !l.arrow && ct(s) != null && R !== Y && i.reference[d] / 2 - (R < V ? O : j) - g[d] / 2 < 0, S = N ? R < V ? R - V : R - et : 0;
490
+ const _ = b / 2 - v / 2, M = A / 2 - g[d] / 2 - 1, O = Q(f[w], M), I = Q(f[y], M), j = O, et = A - g[d] - I, R = A / 2 - g[d] / 2 + _, Y = Ot(j, R, et), V = !l.arrow && ct(s) != null && R !== Y && i.reference[d] / 2 - (R < j ? O : I) - g[d] / 2 < 0, S = V ? R < j ? R - j : R - et : 0;
491
491
  return {
492
492
  [u]: m[u] + S,
493
493
  data: {
494
494
  [u]: Y,
495
495
  centerOffset: R - Y - S,
496
- ...N && {
496
+ ...V && {
497
497
  alignmentOffset: S
498
498
  }
499
499
  },
500
- reset: N
500
+ reset: V
501
501
  };
502
502
  }
503
503
  }), Ke = function(t) {
@@ -524,23 +524,23 @@ const Xe = (t) => ({
524
524
  } = rt(t, e);
525
525
  if ((n = i.arrow) != null && n.alignmentOffset)
526
526
  return {};
527
- const y = X(s), w = U(c), x = X(c) === c, b = await (l.isRTL == null ? void 0 : l.isRTL(a.floating)), v = m || (x || !g ? [dt(c)] : _e(c)), L = d !== "none";
527
+ const w = X(s), y = B(c), x = X(c) === c, b = await (l.isRTL == null ? void 0 : l.isRTL(a.floating)), v = m || (x || !g ? [dt(c)] : _e(c)), L = d !== "none";
528
528
  !m && L && v.push(...je(c, g, d, b));
529
- const A = [c, ...v], I = await le(e, p), M = [];
529
+ const A = [c, ...v], _ = await ae(e, p), M = [];
530
530
  let O = ((o = i.flip) == null ? void 0 : o.overflows) || [];
531
- if (h && M.push(I[y]), f) {
531
+ if (h && M.push(_[w]), f) {
532
532
  const R = ze(s, r, b);
533
- M.push(I[R[0]], I[R[1]]);
533
+ M.push(_[R[0]], _[R[1]]);
534
534
  }
535
535
  if (O = [...O, {
536
536
  placement: s,
537
537
  overflows: M
538
538
  }], !M.every((R) => R <= 0)) {
539
- var j, V;
540
- const R = (((j = i.flip) == null ? void 0 : j.index) || 0) + 1, Y = A[R];
541
- if (Y && (!(f === "alignment" ? w !== U(Y) : !1) || // We leave the current main axis only if every placement on that axis
539
+ var I, j;
540
+ const R = (((I = i.flip) == null ? void 0 : I.index) || 0) + 1, Y = A[R];
541
+ if (Y && (!(f === "alignment" ? y !== B(Y) : !1) || // We leave the current main axis only if every placement on that axis
542
542
  // overflows the main axis.
543
- O.every((T) => T.overflows[0] > 0 && U(T.placement) === w)))
543
+ O.every((T) => T.overflows[0] > 0 && B(T.placement) === y)))
544
544
  return {
545
545
  data: {
546
546
  index: R,
@@ -550,31 +550,31 @@ const Xe = (t) => ({
550
550
  placement: Y
551
551
  }
552
552
  };
553
- let N = (V = O.filter((S) => S.overflows[0] <= 0).sort((S, T) => S.overflows[1] - T.overflows[1])[0]) == null ? void 0 : V.placement;
554
- if (!N)
553
+ let V = (j = O.filter((S) => S.overflows[0] <= 0).sort((S, T) => S.overflows[1] - T.overflows[1])[0]) == null ? void 0 : j.placement;
554
+ if (!V)
555
555
  switch (u) {
556
556
  case "bestFit": {
557
557
  var et;
558
558
  const S = (et = O.filter((T) => {
559
559
  if (L) {
560
- const H = U(T.placement);
561
- return H === w || // Create a bias to the `y` side axis due to horizontal
560
+ const $ = B(T.placement);
561
+ return $ === y || // Create a bias to the `y` side axis due to horizontal
562
562
  // reading directions favoring greater width.
563
- H === "y";
563
+ $ === "y";
564
564
  }
565
565
  return !0;
566
- }).map((T) => [T.placement, T.overflows.filter((H) => H > 0).reduce((H, ye) => H + ye, 0)]).sort((T, H) => T[1] - H[1])[0]) == null ? void 0 : et[0];
567
- S && (N = S);
566
+ }).map((T) => [T.placement, T.overflows.filter(($) => $ > 0).reduce(($, ye) => $ + ye, 0)]).sort((T, $) => T[1] - $[1])[0]) == null ? void 0 : et[0];
567
+ S && (V = S);
568
568
  break;
569
569
  }
570
570
  case "initialPlacement":
571
- N = c;
571
+ V = c;
572
572
  break;
573
573
  }
574
- if (s !== N)
574
+ if (s !== V)
575
575
  return {
576
576
  reset: {
577
- placement: N
577
+ placement: V
578
578
  }
579
579
  };
580
580
  }
@@ -587,7 +587,7 @@ async function Je(t, e) {
587
587
  placement: n,
588
588
  platform: o,
589
589
  elements: s
590
- } = t, i = await (o.isRTL == null ? void 0 : o.isRTL(s.floating)), r = X(n), c = ct(n), l = U(n) === "y", a = ["left", "top"].includes(r) ? -1 : 1, h = i && l ? -1 : 1, f = rt(e, t);
590
+ } = t, i = await (o.isRTL == null ? void 0 : o.isRTL(s.floating)), r = X(n), c = ct(n), l = B(n) === "y", a = ["left", "top"].includes(r) ? -1 : 1, h = i && l ? -1 : 1, f = rt(e, t);
591
591
  let {
592
592
  mainAxis: m,
593
593
  crossAxis: u,
@@ -646,12 +646,12 @@ const Ge = function(t) {
646
646
  limiter: c = {
647
647
  fn: (p) => {
648
648
  let {
649
- x: y,
650
- y: w
649
+ x: w,
650
+ y
651
651
  } = p;
652
652
  return {
653
- x: y,
654
- y: w
653
+ x: w,
654
+ y
655
655
  };
656
656
  }
657
657
  },
@@ -659,15 +659,15 @@ const Ge = function(t) {
659
659
  } = rt(t, e), a = {
660
660
  x: n,
661
661
  y: o
662
- }, h = await le(e, l), f = U(X(s)), m = re(f);
662
+ }, h = await ae(e, l), f = B(X(s)), m = ce(f);
663
663
  let u = a[m], d = a[f];
664
664
  if (i) {
665
- const p = m === "y" ? "top" : "left", y = m === "y" ? "bottom" : "right", w = u + h[p], x = u - h[y];
666
- u = Ot(w, u, x);
665
+ const p = m === "y" ? "top" : "left", w = m === "y" ? "bottom" : "right", y = u + h[p], x = u - h[w];
666
+ u = Ot(y, u, x);
667
667
  }
668
668
  if (r) {
669
- const p = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right", w = d + h[p], x = d - h[y];
670
- d = Ot(w, d, x);
669
+ const p = f === "y" ? "top" : "left", w = f === "y" ? "bottom" : "right", y = d + h[p], x = d - h[w];
670
+ d = Ot(y, d, x);
671
671
  }
672
672
  const g = c.fn({
673
673
  ...e,
@@ -688,11 +688,11 @@ const Ge = function(t) {
688
688
  }
689
689
  };
690
690
  };
691
- function yt() {
691
+ function wt() {
692
692
  return typeof window < "u";
693
693
  }
694
694
  function tt(t) {
695
- return ae(t) ? (t.nodeName || "").toLowerCase() : "#document";
695
+ return ue(t) ? (t.nodeName || "").toLowerCase() : "#document";
696
696
  }
697
697
  function E(t) {
698
698
  var e;
@@ -700,19 +700,19 @@ function E(t) {
700
700
  }
701
701
  function F(t) {
702
702
  var e;
703
- return (e = (ae(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
703
+ return (e = (ue(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
704
704
  }
705
- function ae(t) {
706
- return yt() ? t instanceof Node || t instanceof E(t).Node : !1;
705
+ function ue(t) {
706
+ return wt() ? t instanceof Node || t instanceof E(t).Node : !1;
707
707
  }
708
708
  function k(t) {
709
- return yt() ? t instanceof Element || t instanceof E(t).Element : !1;
709
+ return wt() ? t instanceof Element || t instanceof E(t).Element : !1;
710
710
  }
711
711
  function W(t) {
712
- return yt() ? t instanceof HTMLElement || t instanceof E(t).HTMLElement : !1;
712
+ return wt() ? t instanceof HTMLElement || t instanceof E(t).HTMLElement : !1;
713
713
  }
714
714
  function Ht(t) {
715
- return !yt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof E(t).ShadowRoot;
715
+ return !wt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof E(t).ShadowRoot;
716
716
  }
717
717
  function lt(t) {
718
718
  const {
@@ -726,7 +726,7 @@ function lt(t) {
726
726
  function Ze(t) {
727
727
  return ["table", "td", "th"].includes(tt(t));
728
728
  }
729
- function wt(t) {
729
+ function yt(t) {
730
730
  return [":popover-open", ":modal"].some((e) => {
731
731
  try {
732
732
  return t.matches(e);
@@ -740,13 +740,13 @@ function Wt(t) {
740
740
  return ["transform", "translate", "scale", "rotate", "perspective"].some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((o) => (n.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (n.contain || "").includes(o));
741
741
  }
742
742
  function tn(t) {
743
- let e = z(t);
743
+ let e = U(t);
744
744
  for (; W(e) && !Z(e); ) {
745
745
  if (Wt(e))
746
746
  return e;
747
- if (wt(e))
747
+ if (yt(e))
748
748
  return null;
749
- e = z(e);
749
+ e = U(e);
750
750
  }
751
751
  return null;
752
752
  }
@@ -768,7 +768,7 @@ function xt(t) {
768
768
  scrollTop: t.scrollY
769
769
  };
770
770
  }
771
- function z(t) {
771
+ function U(t) {
772
772
  if (tt(t) === "html")
773
773
  return t;
774
774
  const e = (
@@ -780,14 +780,14 @@ function z(t) {
780
780
  );
781
781
  return Ht(e) ? e.host : e;
782
782
  }
783
- function ue(t) {
784
- const e = z(t);
785
- return Z(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : W(e) && lt(e) ? e : ue(e);
783
+ function fe(t) {
784
+ const e = U(t);
785
+ return Z(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : W(e) && lt(e) ? e : fe(e);
786
786
  }
787
787
  function ot(t, e, n) {
788
788
  var o;
789
789
  e === void 0 && (e = []), n === void 0 && (n = !0);
790
- const s = ue(t), i = s === ((o = t.ownerDocument) == null ? void 0 : o.body), r = E(s);
790
+ const s = fe(t), i = s === ((o = t.ownerDocument) == null ? void 0 : o.body), r = E(s);
791
791
  if (i) {
792
792
  const c = Tt(r);
793
793
  return e.concat(r, r.visualViewport || [], lt(s) ? s : [], c && n ? ot(c) : []);
@@ -797,7 +797,7 @@ function ot(t, e, n) {
797
797
  function Tt(t) {
798
798
  return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
799
799
  }
800
- function fe(t) {
800
+ function he(t) {
801
801
  const e = C(t);
802
802
  let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
803
803
  const s = W(t), i = s ? t.offsetWidth : n, r = s ? t.offsetHeight : o, c = ht(n) !== i || ht(o) !== r;
@@ -818,7 +818,7 @@ function J(t) {
818
818
  width: o,
819
819
  height: s,
820
820
  $: i
821
- } = fe(e);
821
+ } = he(e);
822
822
  let r = (i ? ht(n.width) : n.width) / o, c = (i ? ht(n.height) : n.height) / s;
823
823
  return (!r || !Number.isFinite(r)) && (r = 1), (!c || !Number.isFinite(c)) && (c = 1), {
824
824
  x: r,
@@ -826,7 +826,7 @@ function J(t) {
826
826
  };
827
827
  }
828
828
  const en = /* @__PURE__ */ D(0);
829
- function he(t) {
829
+ function de(t) {
830
830
  const e = E(t);
831
831
  return !Ft() || !e.visualViewport ? en : {
832
832
  x: e.visualViewport.offsetLeft,
@@ -841,13 +841,13 @@ function K(t, e, n, o) {
841
841
  const s = t.getBoundingClientRect(), i = Mt(t);
842
842
  let r = D(1);
843
843
  e && (o ? k(o) && (r = J(o)) : r = J(t));
844
- const c = nn(i, n, o) ? he(i) : D(0);
844
+ const c = nn(i, n, o) ? de(i) : D(0);
845
845
  let l = (s.left + c.x) / r.x, a = (s.top + c.y) / r.y, h = s.width / r.x, f = s.height / r.y;
846
846
  if (i) {
847
847
  const m = E(i), u = o && k(o) ? E(o) : o;
848
848
  let d = m, g = Tt(d);
849
849
  for (; g && o && u !== d; ) {
850
- const p = J(g), y = g.getBoundingClientRect(), w = C(g), x = y.left + (g.clientLeft + parseFloat(w.paddingLeft)) * p.x, b = y.top + (g.clientTop + parseFloat(w.paddingTop)) * p.y;
850
+ const p = J(g), w = g.getBoundingClientRect(), y = C(g), x = w.left + (g.clientLeft + parseFloat(y.paddingLeft)) * p.x, b = w.top + (g.clientTop + parseFloat(y.paddingTop)) * p.y;
851
851
  l *= p.x, a *= p.y, h *= p.x, f *= p.y, l += x, a += b, d = E(g), g = Tt(d);
852
852
  }
853
853
  }
@@ -862,7 +862,7 @@ function Vt(t, e) {
862
862
  const n = xt(t).scrollLeft;
863
863
  return e ? e.left + n : K(F(t)).left + n;
864
864
  }
865
- function de(t, e, n) {
865
+ function me(t, e, n) {
866
866
  n === void 0 && (n = !1);
867
867
  const o = t.getBoundingClientRect(), s = o.left + e.scrollLeft - (n ? 0 : (
868
868
  // RTL <body> scrollbar.
@@ -880,7 +880,7 @@ function on(t) {
880
880
  offsetParent: o,
881
881
  strategy: s
882
882
  } = t;
883
- const i = s === "fixed", r = F(o), c = e ? wt(e.floating) : !1;
883
+ const i = s === "fixed", r = F(o), c = e ? yt(e.floating) : !1;
884
884
  if (o === r || c && i)
885
885
  return n;
886
886
  let l = {
@@ -892,7 +892,7 @@ function on(t) {
892
892
  const u = K(o);
893
893
  a = J(o), h.x = u.x + o.clientLeft, h.y = u.y + o.clientTop;
894
894
  }
895
- const m = r && !f && !i ? de(r, l, !0) : D(0);
895
+ const m = r && !f && !i ? me(r, l, !0) : D(0);
896
896
  return {
897
897
  width: n.width * a.x,
898
898
  height: n.height * a.y,
@@ -947,7 +947,7 @@ function Bt(t, e, n) {
947
947
  else if (k(e))
948
948
  o = ln(e, n);
949
949
  else {
950
- const s = he(t);
950
+ const s = de(t);
951
951
  o = {
952
952
  x: e.x - s.x,
953
953
  y: e.y - s.y,
@@ -957,9 +957,9 @@ function Bt(t, e, n) {
957
957
  }
958
958
  return mt(o);
959
959
  }
960
- function me(t, e) {
961
- const n = z(t);
962
- return n === e || !k(n) || Z(n) ? !1 : C(n).position === "fixed" || me(n, e);
960
+ function ge(t, e) {
961
+ const n = U(t);
962
+ return n === e || !k(n) || Z(n) ? !1 : C(n).position === "fixed" || ge(n, e);
963
963
  }
964
964
  function an(t, e) {
965
965
  const n = e.get(t);
@@ -967,10 +967,10 @@ function an(t, e) {
967
967
  return n;
968
968
  let o = ot(t, [], !1).filter((c) => k(c) && tt(c) !== "body"), s = null;
969
969
  const i = C(t).position === "fixed";
970
- let r = i ? z(t) : t;
970
+ let r = i ? U(t) : t;
971
971
  for (; k(r) && !Z(r); ) {
972
972
  const c = C(r), l = Wt(r);
973
- !l && c.position === "fixed" && (s = null), (i ? !l && !s : !l && c.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || lt(r) && !l && me(t, r)) ? o = o.filter((h) => h !== r) : s = c, r = z(r);
973
+ !l && c.position === "fixed" && (s = null), (i ? !l && !s : !l && c.position === "static" && !!s && ["absolute", "fixed"].includes(s.position) || lt(r) && !l && ge(t, r)) ? o = o.filter((h) => h !== r) : s = c, r = U(r);
974
974
  }
975
975
  return e.set(t, o), o;
976
976
  }
@@ -981,7 +981,7 @@ function un(t) {
981
981
  rootBoundary: o,
982
982
  strategy: s
983
983
  } = t;
984
- const r = [...n === "clippingAncestors" ? wt(e) ? [] : an(e, this._c) : [].concat(n), o], c = r[0], l = r.reduce((a, h) => {
984
+ const r = [...n === "clippingAncestors" ? yt(e) ? [] : an(e, this._c) : [].concat(n), o], c = r[0], l = r.reduce((a, h) => {
985
985
  const f = Bt(e, h, s);
986
986
  return a.top = q(f.top, a.top), a.right = Q(f.right, a.right), a.bottom = Q(f.bottom, a.bottom), a.left = q(f.left, a.left), a;
987
987
  }, Bt(e, c, s));
@@ -996,7 +996,7 @@ function fn(t) {
996
996
  const {
997
997
  width: e,
998
998
  height: n
999
- } = fe(t);
999
+ } = he(t);
1000
1000
  return {
1001
1001
  width: e,
1002
1002
  height: n
@@ -1018,7 +1018,7 @@ function hn(t, e, n) {
1018
1018
  l.x = u.x + e.clientLeft, l.y = u.y + e.clientTop;
1019
1019
  } else s && a();
1020
1020
  i && !o && s && a();
1021
- const h = s && !o && !i ? de(s, c) : D(0), f = r.left + c.scrollLeft - l.x - h.x, m = r.top + c.scrollTop - l.y - h.y;
1021
+ const h = s && !o && !i ? me(s, c) : D(0), f = r.left + c.scrollLeft - l.x - h.x, m = r.top + c.scrollTop - l.y - h.y;
1022
1022
  return {
1023
1023
  x: f,
1024
1024
  y: m,
@@ -1037,16 +1037,16 @@ function Ut(t, e) {
1037
1037
  let n = t.offsetParent;
1038
1038
  return F(t) === n && (n = n.ownerDocument.body), n;
1039
1039
  }
1040
- function ge(t, e) {
1040
+ function pe(t, e) {
1041
1041
  const n = E(t);
1042
- if (wt(t))
1042
+ if (yt(t))
1043
1043
  return n;
1044
1044
  if (!W(t)) {
1045
- let s = z(t);
1045
+ let s = U(t);
1046
1046
  for (; s && !Z(s); ) {
1047
1047
  if (k(s) && !At(s))
1048
1048
  return s;
1049
- s = z(s);
1049
+ s = U(s);
1050
1050
  }
1051
1051
  return n;
1052
1052
  }
@@ -1056,7 +1056,7 @@ function ge(t, e) {
1056
1056
  return o && Z(o) && At(o) && !Wt(o) ? n : o || tn(t) || n;
1057
1057
  }
1058
1058
  const dn = async function(t) {
1059
- const e = this.getOffsetParent || ge, n = this.getDimensions, o = await n(t.floating);
1059
+ const e = this.getOffsetParent || pe, n = this.getDimensions, o = await n(t.floating);
1060
1060
  return {
1061
1061
  reference: hn(t.reference, await e(t.floating), t.strategy),
1062
1062
  floating: {
@@ -1074,7 +1074,7 @@ const gn = {
1074
1074
  convertOffsetParentRelativeRectToViewportRelativeRect: on,
1075
1075
  getDocumentElement: F,
1076
1076
  getClippingRect: un,
1077
- getOffsetParent: ge,
1077
+ getOffsetParent: pe,
1078
1078
  getElementRects: dn,
1079
1079
  getClientRects: sn,
1080
1080
  getDimensions: fn,
@@ -1082,7 +1082,7 @@ const gn = {
1082
1082
  isElement: k,
1083
1083
  isRTL: mn
1084
1084
  };
1085
- function pe(t, e) {
1085
+ function we(t, e) {
1086
1086
  return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
1087
1087
  }
1088
1088
  function pn(t, e) {
@@ -1102,8 +1102,8 @@ function pn(t, e) {
1102
1102
  } = a;
1103
1103
  if (c || e(), !m || !u)
1104
1104
  return;
1105
- const d = ut(f), g = ut(s.clientWidth - (h + m)), p = ut(s.clientHeight - (f + u)), y = ut(h), x = {
1106
- rootMargin: -d + "px " + -g + "px " + -p + "px " + -y + "px",
1105
+ const d = ut(f), g = ut(s.clientWidth - (h + m)), p = ut(s.clientHeight - (f + u)), w = ut(h), x = {
1106
+ rootMargin: -d + "px " + -g + "px " + -p + "px " + -w + "px",
1107
1107
  threshold: q(0, Q(1, l)) || 1
1108
1108
  };
1109
1109
  let b = !0;
@@ -1116,7 +1116,7 @@ function pn(t, e) {
1116
1116
  r(!1, 1e-7);
1117
1117
  }, 1e3);
1118
1118
  }
1119
- A === 1 && !pe(a, t.getBoundingClientRect()) && r(), b = !1;
1119
+ A === 1 && !we(a, t.getBoundingClientRect()) && r(), b = !1;
1120
1120
  }
1121
1121
  try {
1122
1122
  n = new IntersectionObserver(v, {
@@ -1131,7 +1131,7 @@ function pn(t, e) {
1131
1131
  }
1132
1132
  return r(!0), i;
1133
1133
  }
1134
- function yn(t, e, n, o) {
1134
+ function wn(t, e, n, o) {
1135
1135
  o === void 0 && (o = {});
1136
1136
  const {
1137
1137
  ancestorScroll: s = !0,
@@ -1140,16 +1140,16 @@ function yn(t, e, n, o) {
1140
1140
  layoutShift: c = typeof IntersectionObserver == "function",
1141
1141
  animationFrame: l = !1
1142
1142
  } = o, a = Mt(t), h = s || i ? [...a ? ot(a) : [], ...ot(e)] : [];
1143
- h.forEach((y) => {
1144
- s && y.addEventListener("scroll", n, {
1143
+ h.forEach((w) => {
1144
+ s && w.addEventListener("scroll", n, {
1145
1145
  passive: !0
1146
- }), i && y.addEventListener("resize", n);
1146
+ }), i && w.addEventListener("resize", n);
1147
1147
  });
1148
1148
  const f = a && c ? pn(a, n) : null;
1149
1149
  let m = -1, u = null;
1150
- r && (u = new ResizeObserver((y) => {
1151
- let [w] = y;
1152
- w && w.target === a && u && (u.unobserve(e), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
1150
+ r && (u = new ResizeObserver((w) => {
1151
+ let [y] = w;
1152
+ y && y.target === a && u && (u.unobserve(e), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
1153
1153
  var x;
1154
1154
  (x = u) == null || x.observe(e);
1155
1155
  })), n();
@@ -1157,17 +1157,17 @@ function yn(t, e, n, o) {
1157
1157
  let d, g = l ? K(t) : null;
1158
1158
  l && p();
1159
1159
  function p() {
1160
- const y = K(t);
1161
- g && !pe(g, y) && n(), g = y, d = requestAnimationFrame(p);
1160
+ const w = K(t);
1161
+ g && !we(g, w) && n(), g = w, d = requestAnimationFrame(p);
1162
1162
  }
1163
1163
  return n(), () => {
1164
- var y;
1165
- h.forEach((w) => {
1166
- s && w.removeEventListener("scroll", n), i && w.removeEventListener("resize", n);
1167
- }), f == null || f(), (y = u) == null || y.disconnect(), u = null, l && cancelAnimationFrame(d);
1164
+ var w;
1165
+ h.forEach((y) => {
1166
+ s && y.removeEventListener("scroll", n), i && y.removeEventListener("resize", n);
1167
+ }), f == null || f(), (w = u) == null || w.disconnect(), u = null, l && cancelAnimationFrame(d);
1168
1168
  };
1169
1169
  }
1170
- const wn = Ge, xn = Qe, zt = Ke, vn = Xe, bn = (t, e, n) => {
1170
+ const yn = Ge, xn = Qe, zt = Ke, vn = Xe, bn = (t, e, n) => {
1171
1171
  const o = /* @__PURE__ */ new Map(), s = {
1172
1172
  platform: gn,
1173
1173
  ...n
@@ -1186,13 +1186,12 @@ const wn = Ge, xn = Qe, zt = Ke, vn = Xe, bn = (t, e, n) => {
1186
1186
  offset: o = { mainAxis: 0, crossAxis: 0 },
1187
1187
  arrow: s
1188
1188
  }) => ee((i) => {
1189
- const r = P.toSignal(e), c = i.element, l = P.toSignal(o), a = l.$.mainAxis.map((u) => u ?? 0), h = l.$.crossAxis.map((u) => u ?? 0), f = P.toSignal(n ?? "top"), m = $({
1189
+ const r = P.toSignal(e), c = i.element, l = P.toSignal(o), a = l.$.mainAxis.map((u) => u ?? 0), h = l.$.crossAxis.map((u) => u ?? 0), f = P.toSignal(n ?? "top"), m = N({
1190
1190
  centerOffset: 0,
1191
1191
  alignmentOffset: 0,
1192
1192
  containerWidth: 0,
1193
1193
  containerHeight: 0,
1194
- placement: "top",
1195
- x: 0,
1194
+ x: void 0,
1196
1195
  y: void 0
1197
1196
  });
1198
1197
  return te(
@@ -1201,14 +1200,14 @@ const wn = Ge, xn = Qe, zt = Ke, vn = Xe, bn = (t, e, n) => {
1201
1200
  "body",
1202
1201
  Rt.div(
1203
1202
  G((u) => {
1204
- var w;
1203
+ var y;
1205
1204
  const d = u;
1206
1205
  d.style.position = "absolute";
1207
1206
  let g = null;
1208
1207
  async function p() {
1209
1208
  const x = [
1210
1209
  zt(),
1211
- wn({
1210
+ yn({
1212
1211
  mainAxis: a.get(),
1213
1212
  crossAxis: h.get()
1214
1213
  }),
@@ -1226,40 +1225,48 @@ const wn = Ge, xn = Qe, zt = Ke, vn = Xe, bn = (t, e, n) => {
1226
1225
  strategy: "absolute",
1227
1226
  middleware: x
1228
1227
  }), { x: v, y: L, middlewareData: A } = b;
1229
- if (d.style.top = `${L}px`, d.style.left = `${v}px`, g && A.arrow) {
1228
+ if (d.style.top = `${L}px`, d.style.left = `${v}px`, g != null && A.arrow != null) {
1230
1229
  const {
1231
- x: I,
1230
+ x: _,
1232
1231
  y: M,
1233
1232
  centerOffset: O,
1234
- alignmentOffset: j
1235
- } = A.arrow, V = {
1236
- x: I,
1233
+ alignmentOffset: I
1234
+ } = A.arrow;
1235
+ m.set({
1236
+ x: _,
1237
1237
  y: M,
1238
1238
  centerOffset: O,
1239
- alignmentOffset: j,
1240
- placement: f.get(),
1239
+ alignmentOffset: I,
1241
1240
  containerWidth: d.offsetWidth,
1242
1241
  containerHeight: d.offsetHeight
1243
- };
1244
- m.set(V);
1242
+ });
1245
1243
  }
1246
1244
  }
1247
- const y = ve(
1245
+ const w = be(
1248
1246
  a,
1249
1247
  h,
1250
1248
  f
1251
1249
  )(p);
1252
1250
  return pt(
1253
1251
  s != null ? Rt.div(
1254
- (w = s.content) == null ? void 0 : w.call(s, m),
1252
+ (y = s.content) == null ? void 0 : y.call(
1253
+ s,
1254
+ ne(
1255
+ m,
1256
+ f
1257
+ )((x, b) => ({
1258
+ ...x,
1259
+ placement: b
1260
+ }))
1261
+ ),
1255
1262
  G((x) => {
1256
1263
  g = x, p();
1257
1264
  })
1258
1265
  ) : null,
1259
- _(
1266
+ z(
1260
1267
  m.dispose,
1261
- yn(c, d, p),
1262
- y
1268
+ wn(c, d, p),
1269
+ w
1263
1270
  )
1264
1271
  );
1265
1272
  }),
@@ -1268,21 +1275,21 @@ const wn = Ge, xn = Qe, zt = Ke, vn = Xe, bn = (t, e, n) => {
1268
1275
  )
1269
1276
  );
1270
1277
  }), An = (t, e, n) => {
1271
- const o = $(B.notAsked), s = o.map(
1272
- (f) => B.isSuccess(f) ? f.value : void 0
1278
+ const o = N(H.notAsked), s = o.map(
1279
+ (f) => H.isSuccess(f) ? f.value : void 0
1273
1280
  ), i = o.map(
1274
- (f) => B.isFailure(f) ? f.error : void 0
1275
- ), r = o.map((f) => B.isLoading(f));
1281
+ (f) => H.isFailure(f) ? f.error : void 0
1282
+ ), r = o.map((f) => H.isLoading(f));
1276
1283
  let c;
1277
1284
  const l = async (f) => {
1278
1285
  c == null || c.abort(), c = new AbortController();
1279
1286
  const m = c.signal, u = o.get();
1280
- o.set(B.loading(B.getOrUndefined(u)));
1287
+ o.set(H.loading(H.getOrUndefined(u)));
1281
1288
  try {
1282
1289
  const d = await e({ request: f, abortSignal: m, previous: u });
1283
- await Promise.resolve(), c = void 0, o.set(B.success(d));
1290
+ await Promise.resolve(), c = void 0, o.set(H.success(d));
1284
1291
  } catch (d) {
1285
- c = void 0, o.set(B.failure(n(d)));
1292
+ c = void 0, o.set(H.failure(n(d)));
1286
1293
  }
1287
1294
  }, a = () => l(P.get(t)), h = () => {
1288
1295
  c == null || c.abort(), c = void 0, o.dispose();
@@ -1298,8 +1305,8 @@ const wn = Ge, xn = Qe, zt = Ke, vn = Xe, bn = (t, e, n) => {
1298
1305
  }, Rn = (t, e) => {
1299
1306
  const { status: n, dispose: o, reload: s } = t, { loading: i, failure: r, success: c } = e;
1300
1307
  return pt(
1301
- _(o),
1302
- ie(n, {
1308
+ z(o),
1309
+ re(n, {
1303
1310
  loading: i != null ? (l) => i(l, s) : void 0,
1304
1311
  failure: r != null ? (l) => r(l, s) : void 0,
1305
1312
  success: (l) => c(l, s)
@@ -1316,7 +1323,7 @@ const wn = Ge, xn = Qe, zt = Ke, vn = Xe, bn = (t, e, n) => {
1316
1323
  if (typeof e == "function")
1317
1324
  return En(t, { success: e });
1318
1325
  const n = e.failure ?? ((s) => pt(
1319
- _(s.on(console.error)),
1326
+ z(s.on(console.error)),
1320
1327
  s.map((i) => `Error: ${i}`)
1321
1328
  )), o = e.success;
1322
1329
  return Qt(P.toSignal(t), {
@@ -1476,15 +1483,15 @@ function _t(t) {
1476
1483
  });
1477
1484
  }
1478
1485
  const Ln = (t) => ee((e) => {
1479
- const { element: n } = e, o = $(_t(n)), s = Ct(t(o))(e), i = () => {
1486
+ const { element: n } = e, o = N(_t(n)), s = Ct(t(o))(e), i = () => {
1480
1487
  o.set(vt.of(_t(n)));
1481
1488
  };
1482
1489
  let r;
1483
- return typeof ResizeObserver == "function" && (r = new ResizeObserver(i), r.observe(n)), _((c) => {
1490
+ return typeof ResizeObserver == "function" && (r = new ResizeObserver(i), r.observe(n)), z((c) => {
1484
1491
  r == null || r.disconnect(), s(c);
1485
1492
  });
1486
1493
  }), Xn = (t) => Ln(t), Kn = (t) => (e) => {
1487
- const n = it(), o = $({
1494
+ const n = it(), o = N({
1488
1495
  width: (n == null ? void 0 : n.innerWidth) ?? 0,
1489
1496
  height: (n == null ? void 0 : n.innerHeight) ?? 0
1490
1497
  }), s = Ct(t(o))(e), i = () => {
@@ -1526,7 +1533,7 @@ const Ln = (t) => ee((e) => {
1526
1533
  };
1527
1534
  }, Jn = (t) => {
1528
1535
  const e = Tn(Object.keys(t));
1529
- return Kt(se, (n) => {
1536
+ return Kt(ie, (n) => {
1530
1537
  const o = n.map((s) => {
1531
1538
  const i = e(s.pathname);
1532
1539
  if (i == null)
@@ -1539,7 +1546,7 @@ const Ln = (t) => ee((e) => {
1539
1546
  hash: s.hash
1540
1547
  };
1541
1548
  });
1542
- return be(
1549
+ return Ae(
1543
1550
  o.map((s) => [s.route, s]),
1544
1551
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1545
1552
  t
@@ -1600,7 +1607,7 @@ function Yt(t, e, n, o) {
1600
1607
  );
1601
1608
  }
1602
1609
  const Pn = (t = 1e3) => {
1603
- const e = $(/* @__PURE__ */ new Date()), n = Ee(() => e.set(/* @__PURE__ */ new Date()), t);
1610
+ const e = N(/* @__PURE__ */ new Date()), n = Ee(() => e.set(/* @__PURE__ */ new Date()), t);
1604
1611
  return e.onDispose(n), e;
1605
1612
  }, Dn = (t) => {
1606
1613
  const e = Math.abs(t);
@@ -1611,7 +1618,7 @@ const Pn = (t = 1e3) => {
1611
1618
  return t < 0 ? Yt(e, n.value, n.past.singular, n.past.plural) : Yt(e, n.value, n.future.singular, n.future.plural);
1612
1619
  throw new Error("unreachable");
1613
1620
  }, Wn = (t, { now: e, frequency: n = 1e4 } = {}) => {
1614
- const o = e != null ? Xt.is(e) ? e.derive() : $(e) : Pn(n), s = Ae(
1621
+ const o = e != null ? Xt.is(e) ? e.derive() : N(e) : Pn(n), s = ne(
1615
1622
  t,
1616
1623
  o
1617
1624
  )((i, r) => i.getTime() - r.getTime());
@@ -1634,7 +1641,7 @@ const Qn = (t = 0) => new Mn(t, (e, n) => e === n);
1634
1641
  export {
1635
1642
  Me as Anchor,
1636
1643
  Hn as Appearance,
1637
- ie as AsyncResultView,
1644
+ re as AsyncResultView,
1638
1645
  Bn as AutoFocus,
1639
1646
  Un as AutoSelect,
1640
1647
  Ln as ElementRect,
@@ -1642,7 +1649,7 @@ export {
1642
1649
  _n as HTMLTitle,
1643
1650
  zn as HiddenWhenEmpty,
1644
1651
  He as InViewport,
1645
- se as Location,
1652
+ ie as Location,
1646
1653
  jn as PopOver,
1647
1654
  vt as Rect,
1648
1655
  Yn as Resource,
@@ -1660,7 +1667,7 @@ export {
1660
1667
  ke as areLocationsEqual,
1661
1668
  _t as getAbsoluteRect,
1662
1669
  Te as handleAnchorClick,
1663
- oe as locationFromURL,
1670
+ se as locationFromURL,
1664
1671
  An as makeResource,
1665
1672
  On as matchesRoute,
1666
1673
  Pn as nowSignal,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tempots/ui",
3
- "version": "4.3.2",
3
+ "version": "4.3.4",
4
4
  "type": "module",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",