@tempots/ui 0.23.0-next.14 → 0.23.0-next.16

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 +197 -197
  3. package/package.json +2 -2
package/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@tempots/dom"),Ct=t=>{const e=t.split("/").pop();if(e==null||e.startsWith("."))return;const n=e.split(".")||[];return n.length>1?"."+n.pop():void 0},Ft=(t,e)=>{const n=Ct(e);return n!=null&&(t.length===0||!t.some(o=>n==o))},re=(t,e,n,o)=>{let r=t.target;for(;r!=null&&!(r instanceof HTMLAnchorElement);)r=r.parentElement;if(r==null)return!0;const i=r;if(t.button!==0||t.ctrlKey||t.metaKey||i.target!=="_self"&&i.target!==""||i.getAttribute("download")!=null)return!0;const{pathname:s,search:c,hash:a}=i;if(o){const l=s+c+a,m=i.getAttribute("href");if(!(m!=null&&m.startsWith("#"))&&m!==l)return!0}return e?!1:Ft(n,s)},Wt=(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=>{re(o,e.ignoreUrlWithExtension??!0,n,e.ignoreExternalUrl??!0)||t()&&o.preventDefault()}},Dt=u.makeProviderMark("LocationProvider"),ie=t=>u.Fragment(u.OnBrowserCtx(e=>u.Async(Promise.resolve().then(()=>require("./browser-location-D36kVbd7.cjs")).then(n=>n.ProvideBrowserLocation),n=>n(t))(e)),u.OnHeadlessCtx(e=>u.Async(Promise.resolve().then(()=>require("./headless-location-8Va85S-Q.cjs")).then(n=>n.ProvideHeadlessLocation),n=>n(e.container.currentURL,t))(e))),mt=t=>u.UseProvider(Dt,e=>n=>{const o=u.makeProp(e.value,e.equals);e.feedProp(o),o.on(e.set);const r=u.renderableOfTNode(t(o))(n);return i=>{o.dispose(),r(i)}}),se=(t,e)=>t.pathname===e.pathname&&JSON.stringify(t.search)===JSON.stringify(e.search)&&t.hash===e.hash,Mt=(t,e)=>{var i;const n=new URL(t,e??((i=u.getWindow())==null?void 0:i.location.toString())),o=Object.fromEntries(n.searchParams.entries());let r=n.hash;return r.startsWith("#")&&(r=r.substring(1)),{pathname:n.pathname,search:o,hash:r===""?void 0:r}},Vt=(t,e)=>{const n=Mt(e);return t.set(n),t},ce=t=>{const n=new URLSearchParams(t.search).toString(),o=t.hash;return`${t.pathname}${n?`?${n}`:""}${o?`#${o}`:""}`},Nt=(t,...e)=>{if(typeof t=="string"||u.Signal.is(t))return Nt({href:t},...e);const{href:n,...o}=t;return mt(r=>u.html.a(u.on.click(Wt(()=>(Vt(r,u.Value.get(n)),!0),o)),u.attr.href(n),...e))},ht=u.makeProviderMark("Appearance"),le=t=>{const e=u.getWindow(),n=e!=null&&e.matchMedia!=null&&e.matchMedia("(prefers-color-scheme: dark)").matches,o=u.makeProp(n?"dark":"light"),r=s=>{o.set(s.matches?"dark":"light")},i=e!=null&&e.matchMedia!=null?e.matchMedia("(prefers-color-scheme: dark)"):void 0;return i==null||i.addEventListener("change",r),u.Fragment(u.WithProvider(ht,o,t),u.OnDispose(()=>i==null?void 0:i.removeEventListener("change",r)))},ae=t=>u.UseProvider(ht,t),Ht=(t,e)=>{if(typeof e=="function")return Ht(t,{success:e});const n=e.failure??(s=>u.Fragment(u.OnDispose(s.on(console.error)),s.map(c=>`Error: ${c}`))),o=e.success,r=e.loading??(()=>u.Empty),i=e.notAsked??(()=>u.Empty);return u.OneOfType(u.Value.toSignal(t),{AsyncSuccess:s=>o(s.$.value),AsyncFailure:s=>n(s.$.error),Loading:s=>r(s.$.previousValue??u.makeSignal(void 0)),NotAsked:i})},ue=(t=10)=>u.OnElement(e=>{const n=setTimeout(()=>{e==null||e.focus()},t);return()=>clearTimeout(n)}),fe=(t=10)=>u.OnElement(e=>{const n=setTimeout(()=>{e==null||e.select()},t);return()=>clearTimeout(n)}),me=u.OnElement(t=>{const e=t.style.getPropertyValue(":empty");return t.style.setProperty(":empty","display:none"),n=>{n&&t.style.setProperty(":empty",e)}}),he=t=>u.Portal("head > title",u.attr.innerText(t)),de={partial:{root:null,rootMargin:"0px",threshold:0},full:{root:null,rootMargin:"0px",threshold:1}},J={partial:new Map,full:new Map},I={partial:null,full:null};function pe(t){return I[t]==null&&(I[t]=new IntersectionObserver(e=>{e.forEach(n=>{const o=J[t].get(n.target);o==null||o.set(n.isIntersecting)})},de[t])),I[t]}const $t=(t,e)=>{const n=u.makeProp(!1);return u.Fragment(u.OnElement(o=>{const r=typeof IntersectionObserver<"u"?pe(t):null;return J[t].set(o,n),r==null||r.observe(o),()=>{var i;n.dispose(),r==null||r.unobserve(o),J[t].delete(o),J[t].size===0&&((i=I[t])==null||i.disconnect(),I[t]=null)}}),u.renderableOfTNode(e(n)))},ge=(t,e,n)=>$t(t,o=>u.When(o,e,n??u.Empty)),G=Math.min,W=Math.max,Q=Math.round,X=Math.floor,L=t=>({x:t,y:t}),ye={left:"right",right:"left",bottom:"top",top:"bottom"},we={start:"end",end:"start"};function At(t,e,n){return W(t,G(e,n))}function nt(t,e){return typeof t=="function"?t(e):t}function D(t){return t.split("-")[0]}function ot(t){return t.split("-")[1]}function zt(t){return t==="x"?"y":"x"}function Bt(t){return t==="y"?"height":"width"}function $(t){return["top","bottom"].includes(D(t))?"y":"x"}function Ut(t){return zt($(t))}function xe(t,e,n){n===void 0&&(n=!1);const o=ot(t),r=Ut(t),i=Bt(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=Z(s)),[s,Z(s)]}function ve(t){const e=Z(t);return[at(t),e,at(e)]}function at(t){return t.replace(/start|end/g,e=>we[e])}function be(t,e,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?r:o:e?o:r;case"left":case"right":return e?i:s;default:return[]}}function Ae(t,e,n,o){const r=ot(t);let i=be(D(t),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),e&&(i=i.concat(i.map(at)))),i}function Z(t){return t.replace(/left|right|bottom|top/g,e=>ye[e])}function Ee(t){return{top:0,right:0,bottom:0,left:0,...t}}function Oe(t){return typeof t!="number"?Ee(t):{top:t,right:t,bottom:t,left:t}}function tt(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function Et(t,e,n){let{reference:o,floating:r}=t;const i=$(e),s=Ut(e),c=Bt(s),a=D(e),l=i==="y",m=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,d=o[c]/2-r[c]/2;let h;switch(a){case"top":h={x:m,y:o.y-r.height};break;case"bottom":h={x:m,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:f};break;case"left":h={x:o.x-r.width,y:f};break;default:h={x:o.x,y:o.y}}switch(ot(e)){case"start":h[s]-=d*(n&&l?-1:1);break;case"end":h[s]+=d*(n&&l?-1:1);break}return h}const Re=async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,c=i.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(e));let l=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:m,y:f}=Et(l,o,a),d=o,h={},g=0;for(let y=0;y<c.length;y++){const{name:w,fn:p}=c[y],{x,y:v,data:A,reset:b}=await p({x:m,y:f,initialPlacement:o,placement:d,strategy:r,middlewareData:h,rects:l,platform:s,elements:{reference:t,floating:e}});m=x??m,f=v??f,h={...h,[w]:{...h[w],...A}},b&&g<=50&&(g++,typeof b=="object"&&(b.placement&&(d=b.placement),b.rects&&(l=b.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:r}):b.rects),{x:m,y:f}=Et(l,d,a)),y=-1)}return{x:m,y:f,placement:d,strategy:r,middlewareData:h}};async function _t(t,e){var n;e===void 0&&(e={});const{x:o,y:r,platform:i,rects:s,elements:c,strategy:a}=t,{boundary:l="clippingAncestors",rootBoundary:m="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=nt(e,t),g=Oe(h),w=c[d?f==="floating"?"reference":"floating":f],p=tt(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:l,rootBoundary:m,strategy:a})),x=f==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.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=tt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:v,strategy:a}):x);return{top:(p.top-b.top+g.top)/A.y,bottom:(b.bottom-p.bottom+g.bottom)/A.y,left:(p.left-b.left+g.left)/A.x,right:(b.right-p.right+g.right)/A.x}}const Le=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:c,platform:a,elements:l}=e,{mainAxis:m=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...w}=nt(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const p=D(r),x=$(c),v=D(c)===c,A=await(a.isRTL==null?void 0:a.isRTL(l.floating)),b=d||(v||!y?[Z(c)]:ve(c)),V=g!=="none";!d&&V&&b.push(...Ae(c,y,g,A));const ne=[c,...b],ct=await _t(e,w),K=[];let U=((o=i.flip)==null?void 0:o.overflows)||[];if(m&&K.push(ct[p]),f){const F=xe(r,s,A);K.push(ct[F[0]],ct[F[1]])}if(U=[...U,{placement:r,overflows:K}],!K.every(F=>F<=0)){var wt,xt;const F=(((wt=i.flip)==null?void 0:wt.index)||0)+1,bt=ne[F];if(bt)return{data:{index:F,overflows:U},reset:{placement:bt}};let _=(xt=U.filter(N=>N.overflows[0]<=0).sort((N,S)=>N.overflows[1]-S.overflows[1])[0])==null?void 0:xt.placement;if(!_)switch(h){case"bestFit":{var vt;const N=(vt=U.filter(S=>{if(V){const P=$(S.placement);return P===x||P==="y"}return!0}).map(S=>[S.placement,S.overflows.filter(P=>P>0).reduce((P,oe)=>P+oe,0)]).sort((S,P)=>S[1]-P[1])[0])==null?void 0:vt[0];N&&(_=N);break}case"initialPlacement":_=c;break}if(r!==_)return{reset:{placement:_}}}return{}}}};async function Te(t,e){const{placement:n,platform:o,elements:r}=t,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=D(n),c=ot(n),a=$(n)==="y",l=["left","top"].includes(s)?-1:1,m=i&&a?-1:1,f=nt(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof g=="number"&&(h=c==="end"?g*-1:g),a?{x:h*m,y:d*l}:{x:d*l,y:h*m}}const ke=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:i,placement:s,middlewareData:c}=e,a=await Te(e,t);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+a.x,y:i+a.y,data:{...a,placement:s}}}}},Se=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:c={fn:w=>{let{x:p,y:x}=w;return{x:p,y:x}}},...a}=nt(t,e),l={x:n,y:o},m=await _t(e,a),f=$(D(r)),d=zt(f);let h=l[d],g=l[f];if(i){const w=d==="y"?"top":"left",p=d==="y"?"bottom":"right",x=h+m[w],v=h-m[p];h=At(x,h,v)}if(s){const w=f==="y"?"top":"left",p=f==="y"?"bottom":"right",x=g+m[w],v=g-m[p];g=At(x,g,v)}const y=c.fn({...e,[d]:h,[f]:g});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[d]:i,[f]:s}}}}}};function rt(){return typeof window<"u"}function B(t){return It(t)?(t.nodeName||"").toLowerCase():"#document"}function E(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function k(t){var e;return(e=(It(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function It(t){return rt()?t instanceof Node||t instanceof E(t).Node:!1}function O(t){return rt()?t instanceof Element||t instanceof E(t).Element:!1}function T(t){return rt()?t instanceof HTMLElement||t instanceof E(t).HTMLElement:!1}function Ot(t){return!rt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof E(t).ShadowRoot}function Y(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=R(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(r)}function Pe(t){return["table","td","th"].includes(B(t))}function it(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function dt(t){const e=pt(),n=O(t)?R(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Ce(t){let e=C(t);for(;T(e)&&!z(e);){if(dt(e))return e;if(it(e))return null;e=C(e)}return null}function pt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function z(t){return["html","body","#document"].includes(B(t))}function R(t){return E(t).getComputedStyle(t)}function st(t){return O(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function C(t){if(B(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Ot(t)&&t.host||k(t);return Ot(e)?e.host:e}function jt(t){const e=C(t);return z(e)?t.ownerDocument?t.ownerDocument.body:t.body:T(e)&&Y(e)?e:jt(e)}function j(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=jt(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),s=E(r);if(i){const c=ut(s);return e.concat(s,s.visualViewport||[],Y(r)?r:[],c&&n?j(c):[])}return e.concat(r,j(r,[],n))}function ut(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function qt(t){const e=R(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=T(t),i=r?t.offsetWidth:n,s=r?t.offsetHeight:o,c=Q(n)!==i||Q(o)!==s;return c&&(n=i,o=s),{width:n,height:o,$:c}}function gt(t){return O(t)?t:t.contextElement}function H(t){const e=gt(t);if(!T(e))return L(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=qt(e);let s=(i?Q(n.width):n.width)/o,c=(i?Q(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const Fe=L(0);function Yt(t){const e=E(t);return!pt()||!e.visualViewport?Fe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function We(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==E(t)?!1:e}function M(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=gt(t);let s=L(1);e&&(o?O(o)&&(s=H(o)):s=H(t));const c=We(i,n,o)?Yt(i):L(0);let a=(r.left+c.x)/s.x,l=(r.top+c.y)/s.y,m=r.width/s.x,f=r.height/s.y;if(i){const d=E(i),h=o&&O(o)?E(o):o;let g=d,y=ut(g);for(;y&&o&&h!==g;){const w=H(y),p=y.getBoundingClientRect(),x=R(y),v=p.left+(y.clientLeft+parseFloat(x.paddingLeft))*w.x,A=p.top+(y.clientTop+parseFloat(x.paddingTop))*w.y;a*=w.x,l*=w.y,m*=w.x,f*=w.y,a+=v,l+=A,g=E(y),y=ut(g)}}return tt({width:m,height:f,x:a,y:l})}function yt(t,e){const n=st(t).scrollLeft;return e?e.left+n:M(k(t)).left+n}function Kt(t,e,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),r=o.left+e.scrollLeft-(n?0:yt(t,o)),i=o.top+e.scrollTop;return{x:r,y:i}}function De(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i=r==="fixed",s=k(o),c=e?it(e.floating):!1;if(o===s||c&&i)return n;let a={scrollLeft:0,scrollTop:0},l=L(1);const m=L(0),f=T(o);if((f||!f&&!i)&&((B(o)!=="body"||Y(s))&&(a=st(o)),T(o))){const h=M(o);l=H(o),m.x=h.x+o.clientLeft,m.y=h.y+o.clientTop}const d=s&&!f&&!i?Kt(s,a,!0):L(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+m.x+d.x,y:n.y*l.y-a.scrollTop*l.y+m.y+d.y}}function Me(t){return Array.from(t.getClientRects())}function Ve(t){const e=k(t),n=st(t),o=t.ownerDocument.body,r=W(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=W(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+yt(t);const c=-n.scrollTop;return R(o).direction==="rtl"&&(s+=W(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:c}}function Ne(t,e){const n=E(t),o=k(t),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,c=0,a=0;if(r){i=r.width,s=r.height;const l=pt();(!l||l&&e==="fixed")&&(c=r.offsetLeft,a=r.offsetTop)}return{width:i,height:s,x:c,y:a}}function He(t,e){const n=M(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=T(t)?H(t):L(1),s=t.clientWidth*i.x,c=t.clientHeight*i.y,a=r*i.x,l=o*i.y;return{width:s,height:c,x:a,y:l}}function Rt(t,e,n){let o;if(e==="viewport")o=Ne(t,n);else if(e==="document")o=Ve(k(t));else if(O(e))o=He(e,n);else{const r=Yt(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return tt(o)}function Xt(t,e){const n=C(t);return n===e||!O(n)||z(n)?!1:R(n).position==="fixed"||Xt(n,e)}function $e(t,e){const n=e.get(t);if(n)return n;let o=j(t,[],!1).filter(c=>O(c)&&B(c)!=="body"),r=null;const i=R(t).position==="fixed";let s=i?C(t):t;for(;O(s)&&!z(s);){const c=R(s),a=dt(s);!a&&c.position==="fixed"&&(r=null),(i?!a&&!r:!a&&c.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||Y(s)&&!a&&Xt(t,s))?o=o.filter(m=>m!==s):r=c,s=C(s)}return e.set(t,o),o}function ze(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?it(e)?[]:$e(e,this._c):[].concat(n),o],c=s[0],a=s.reduce((l,m)=>{const f=Rt(e,m,r);return l.top=W(f.top,l.top),l.right=G(f.right,l.right),l.bottom=G(f.bottom,l.bottom),l.left=W(f.left,l.left),l},Rt(e,c,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Be(t){const{width:e,height:n}=qt(t);return{width:e,height:n}}function Ue(t,e,n){const o=T(e),r=k(e),i=n==="fixed",s=M(t,!0,i,e);let c={scrollLeft:0,scrollTop:0};const a=L(0);if(o||!o&&!i)if((B(e)!=="body"||Y(r))&&(c=st(e)),o){const d=M(e,!0,i,e);a.x=d.x+e.clientLeft,a.y=d.y+e.clientTop}else r&&(a.x=yt(r));const l=r&&!o&&!i?Kt(r,c):L(0),m=s.left+c.scrollLeft-a.x-l.x,f=s.top+c.scrollTop-a.y-l.y;return{x:m,y:f,width:s.width,height:s.height}}function lt(t){return R(t).position==="static"}function Lt(t,e){if(!T(t)||R(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return k(t)===n&&(n=n.ownerDocument.body),n}function Jt(t,e){const n=E(t);if(it(t))return n;if(!T(t)){let r=C(t);for(;r&&!z(r);){if(O(r)&&!lt(r))return r;r=C(r)}return n}let o=Lt(t,e);for(;o&&Pe(o)&&lt(o);)o=Lt(o,e);return o&&z(o)&&lt(o)&&!dt(o)?n:o||Ce(t)||n}const _e=async function(t){const e=this.getOffsetParent||Jt,n=this.getDimensions,o=await n(t.floating);return{reference:Ue(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ie(t){return R(t).direction==="rtl"}const je={convertOffsetParentRelativeRectToViewportRelativeRect:De,getDocumentElement:k,getClippingRect:ze,getOffsetParent:Jt,getElementRects:_e,getClientRects:Me,getDimensions:Be,getScale:H,isElement:O,isRTL:Ie};function qe(t,e){let n=null,o;const r=k(t);function i(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),i();const{left:l,top:m,width:f,height:d}=t.getBoundingClientRect();if(c||e(),!f||!d)return;const h=X(m),g=X(r.clientWidth-(l+f)),y=X(r.clientHeight-(m+d)),w=X(l),x={rootMargin:-h+"px "+-g+"px "+-y+"px "+-w+"px",threshold:W(0,G(1,a))||1};let v=!0;function A(b){const V=b[0].intersectionRatio;if(V!==a){if(!v)return s();V?s(!1,V):o=setTimeout(()=>{s(!1,1e-7)},1e3)}v=!1}try{n=new IntersectionObserver(A,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(A,x)}n.observe(t)}return s(!0),i}function Ye(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,l=gt(t),m=r||i?[...l?j(l):[],...j(e)]:[];m.forEach(p=>{r&&p.addEventListener("scroll",n,{passive:!0}),i&&p.addEventListener("resize",n)});const f=l&&c?qe(l,n):null;let d=-1,h=null;s&&(h=new ResizeObserver(p=>{let[x]=p;x&&x.target===l&&h&&(h.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var v;(v=h)==null||v.observe(e)})),n()}),l&&!a&&h.observe(l),h.observe(e));let g,y=a?M(t):null;a&&w();function w(){const p=M(t);y&&(p.x!==y.x||p.y!==y.y||p.width!==y.width||p.height!==y.height)&&n(),y=p,g=requestAnimationFrame(w)}return n(),()=>{var p;m.forEach(x=>{r&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),f==null||f(),(p=h)==null||p.disconnect(),h=null,a&&cancelAnimationFrame(g)}}const Ke=ke,Xe=Se,Tt=Le,Je=(t,e,n)=>{const o=new Map,r={platform:je,...n},i={...r.platform,_c:o};return Re(t,e,{...r,platform:i})},Ge=({content:t,open:e,placement:n,offset:{mainAxis:o,crossAxis:r}={mainAxis:0,crossAxis:0}})=>u.OnBrowserCtx(i=>{const s=u.Value.toSignal(e),c=i.element;return u.When(s,u.Portal("body",u.html.div(u.OnElement(a=>{const l=a;return l.style.position="absolute",Ye(c,l,()=>{Je(c,l,{placement:n,strategy:"absolute",middleware:[Tt(),Ke({mainAxis:o,crossAxis:r}),Xe(),Tt()]}).then(({x:m,y:f})=>{l.style.top=`${f}px`,l.style.left=`${m}px`})})}),t())))(i)}),Gt=(t,e)=>{if(typeof e=="function")return Gt(t,{success:e});const n=e.failure??(r=>u.Fragment(u.OnDispose(r.on(console.error)),r.map(i=>`Error: ${i}`))),o=e.success;return u.OneOfType(u.Value.toSignal(t),{Success:r=>o(r.$.value),Failure:r=>n(r.$.error)})},Qe=()=>u.on.focus(t=>{var e;return(e=t.target)==null?void 0:e.select()}),Ze=t=>u.OnBrowserCtx(e=>{const{element:n}=e,o=u.makeProp({width:n.clientWidth,height:n.clientHeight}),r=u.renderableOfTNode(t(o))(e),i=()=>{o.set({width:n.clientWidth,height:n.clientHeight})};let s;return typeof ResizeObserver=="function"&&(s=new ResizeObserver(i),s.observe(n)),c=>{s==null||s.disconnect(),r(c)}}),tn=t=>e=>{const n=u.getWindow(),o=u.makeProp({width:(n==null?void 0:n.innerWidth)??0,height:(n==null?void 0:n.innerHeight)??0}),r=u.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),s=>{n==null||n.removeEventListener("resize",i),r(s)}},Qt=(t,e)=>{const n=e.split("/").filter(r=>r!==""),o={};for(let r=0;r<t.length;r++){const i=t[r],s=n[r];if(!s&&i.type!=="catch-all")return null;if(i.type==="literal"){if(i.value!==s)return null}else if(i.type==="param")o[i.name]=s;else if(i.type==="catch-all")return{params:o,path:e}}return n.length!==t.length?null:{params:o,path:e}},Zt=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!==""),te=t=>{const e=t.map(n=>{const o=Zt(n);return{route:n,segments:o}});return function(o){for(const{segments:r,route:i}of e){const s=Qt(r,o);if(s)return{...s,route:i}}return null}},en=t=>{const e=te(Object.keys(t));return mt(n=>{const o=n.map(r=>{const i=e(r.pathname);if(i==null)throw console.error("No route found for",r),new Error("No route found");return{params:i.params,route:i.route,path:i.path,search:r.search,hash:r.hash}});return u.OneOfTuple(o.map(r=>[r.route,r]),t)})},et=60*1e3,ft=60*et,q=24*ft,kt=7*q,St=30*q,nn=365*q,on=[{max:et*90,value:et,name:"minute",past:{singular:"a minute ago",plural:"{} minutes ago"},future:{singular:"in a minute",plural:"in {} minutes"}},{max:ft*36,value:ft,name:"hour",past:{singular:"an hour ago",plural:"{} hours ago"},future:{singular:"in an hour",plural:"in {} hours"}},{max:q*10,value:q,name:"day",past:{singular:"yesterday",plural:"{} days ago"},future:{singular:"tomorrow",plural:"in {} days"}},{max:kt*6,value:kt,name:"week",past:{singular:"last week",plural:"{} weeks ago"},future:{singular:"in a week",plural:"in {} weeks"}},{max:St*18,value:St,name:"month",past:{singular:"last month",plural:"{} months ago"},future:{singular:"in a month",plural:"in {} months"}},{max:1/0,value:nn,name:"year",past:{singular:"last year",plural:"{} years ago"},future:{singular:"in a year",plural:"in {} years"}}];function Pt(t,e,n,o){const r=Math.round(t/e);return r<=1?n:o.replace("{}",r.toLocaleString(void 0,{maximumFractionDigits:0,minimumFractionDigits:0}))}function ee(t){const e=Math.abs(t);if(e<et)return t<0?"just now":"in a moment";for(const n of on)if(e<n.max)return t<0?Pt(e,n.value,n.past.singular,n.past.plural):Pt(e,n.value,n.future.singular,n.future.plural);throw new Error("unreachable")}const rn=(t,e)=>{const n=e!=null?u.Signal.is(e)?e.derive():u.makeProp(e):u.makeProp(new Date),o=u.makeComputedOf(t,n)((i,s)=>{const c=i.getTime()-s.getTime();return ee(c)}),r=u.Prop.is(n)?setInterval(()=>n.set(new Date),5e3):void 0;return o.onDispose(()=>{r!=null&&clearInterval(r),n.dispose()}),o};exports.Anchor=Nt;exports.AsyncResultView=Ht;exports.AutoFocus=ue;exports.AutoSelect=fe;exports.ElementSize=Ze;exports.HTMLTitle=he;exports.HiddenWhenEmpty=me;exports.InViewport=$t;exports.LocationProviderMarker=Dt;exports.PopOver=Ge;exports.ProvideAppearance=le;exports.ProvideLocation=ie;exports.ResultView=Gt;exports.Router=en;exports.SelectOnFocus=Qe;exports.UseAppearance=ae;exports.UseLocation=mt;exports.WhenInViewport=ge;exports.WindowSize=tn;exports._checkExtensionCondition=Ft;exports._getExtension=Ct;exports._makeRouteMatcher=te;exports._parseRouteSegments=Zt;exports.appearanceMarker=ht;exports.areLocationsEqual=se;exports.handleAnchorClick=Wt;exports.locationFromURL=Mt;exports.makeRelativeTime=rn;exports.matchesRoute=Qt;exports.setLocationFromUrl=Vt;exports.timeDiffToString=ee;exports.urlFromLocation=ce;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@tempots/dom"),Ct=t=>{const e=t.split("/").pop();if(e==null||e.startsWith("."))return;const n=e.split(".")||[];return n.length>1?"."+n.pop():void 0},Ft=(t,e)=>{const n=Ct(e);return n!=null&&(t.length===0||!t.some(o=>n==o))},re=(t,e,n,o)=>{let r=t.target;for(;r!=null&&!(r instanceof HTMLAnchorElement);)r=r.parentElement;if(r==null)return!0;const i=r;if(t.button!==0||t.ctrlKey||t.metaKey||i.target!=="_self"&&i.target!==""||i.getAttribute("download")!=null)return!0;const{pathname:s,search:c,hash:a}=i;if(o){const l=s+c+a,m=i.getAttribute("href");if(!(m!=null&&m.startsWith("#"))&&m!==l)return!0}return e?!1:Ft(n,s)},Wt=(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=>{re(o,e.ignoreUrlWithExtension??!0,n,e.ignoreExternalUrl??!0)||t()&&o.preventDefault()}},Dt=u.makeProviderMark("LocationProvider"),ie=t=>u.Fragment(u.OnBrowserCtx(e=>u.Async(Promise.resolve().then(()=>require("./browser-location-D36kVbd7.cjs")).then(n=>n.ProvideBrowserLocation),n=>n(t))(e)),u.OnHeadlessCtx(e=>u.Async(Promise.resolve().then(()=>require("./headless-location-8Va85S-Q.cjs")).then(n=>n.ProvideHeadlessLocation),n=>n(e.container.currentURL,t))(e))),mt=t=>u.UseProvider(Dt,e=>n=>{const o=u.makeProp(e.value,e.equals);e.feedProp(o),o.on(e.set);const r=u.renderableOfTNode(t(o))(n);return i=>{o.dispose(),r(i)}}),se=(t,e)=>t.pathname===e.pathname&&JSON.stringify(t.search)===JSON.stringify(e.search)&&t.hash===e.hash,Mt=(t,e)=>{var i;const n=new URL(t,e??((i=u.getWindow())==null?void 0:i.location.toString())),o=Object.fromEntries(n.searchParams.entries());let r=n.hash;return r.startsWith("#")&&(r=r.substring(1)),{pathname:n.pathname,search:o,hash:r===""?void 0:r}},Vt=(t,e)=>{const n=Mt(e);return t.set(n),t},ce=t=>{const n=new URLSearchParams(t.search).toString(),o=t.hash;return`${t.pathname}${n?`?${n}`:""}${o?`#${o}`:""}`},Nt=(t,...e)=>{if(typeof t=="string"||u.Signal.is(t))return Nt({href:t},...e);const{href:n,...o}=t;return mt(r=>u.html.a(u.on.click(Wt(()=>(Vt(r,u.Value.get(n)),!0),o)),u.attr.href(n),...e))},ht=u.makeProviderMark("Appearance"),le=t=>{const e=u.getWindow(),n=e!=null&&e.matchMedia!=null&&e.matchMedia("(prefers-color-scheme: dark)").matches,o=u.makeProp(n?"dark":"light"),r=s=>{o.set(s.matches?"dark":"light")},i=e!=null&&e.matchMedia!=null?e.matchMedia("(prefers-color-scheme: dark)"):void 0;return i==null||i.addEventListener("change",r),u.Fragment(u.WithProvider(ht,o,t),u.OnDispose(()=>i==null?void 0:i.removeEventListener("change",r)))},ae=t=>u.UseProvider(ht,t),Ht=(t,e)=>{if(typeof e=="function")return Ht(t,{success:e});const n=e.failure??(s=>u.Fragment(u.OnDispose(s.on(console.error)),s.map(c=>`Error: ${c}`))),o=e.success,r=e.loading??(()=>u.Empty),i=e.notAsked??(()=>u.Empty);return u.OneOfType(u.Value.toSignal(t),{AsyncSuccess:s=>o(s.$.value),AsyncFailure:s=>n(s.$.error),Loading:s=>r(s.$.previousValue??u.makeSignal(void 0)),NotAsked:i})},ue=(t=10)=>u.OnElement(e=>{const n=setTimeout(()=>{e==null||e.focus()},t);return()=>clearTimeout(n)}),fe=(t=10)=>u.OnElement(e=>{const n=setTimeout(()=>{e==null||e.select()},t);return()=>clearTimeout(n)}),me=u.OnElement(t=>{const e=t.style.getPropertyValue(":empty");return t.style.setProperty(":empty","display:none"),n=>{n&&t.style.setProperty(":empty",e)}}),he=t=>u.Portal("head > title",u.attr.innerText(t)),de={partial:{root:null,rootMargin:"0px",threshold:0},full:{root:null,rootMargin:"0px",threshold:1}},J={partial:new Map,full:new Map},I={partial:null,full:null};function pe(t){return I[t]==null&&(I[t]=new IntersectionObserver(e=>{e.forEach(n=>{const o=J[t].get(n.target);o==null||o.set(n.isIntersecting)})},de[t])),I[t]}const $t=(t,e)=>{const n=u.makeProp(!1);return u.Fragment(u.OnElement(o=>{const r=typeof IntersectionObserver<"u"?pe(t):null;return J[t].set(o,n),r==null||r.observe(o),()=>{var i;n.dispose(),r==null||r.unobserve(o),J[t].delete(o),J[t].size===0&&((i=I[t])==null||i.disconnect(),I[t]=null)}}),u.renderableOfTNode(e(n)))},ge=(t,e,n)=>$t(t,o=>u.When(o,e,n??u.Empty)),G=Math.min,W=Math.max,Q=Math.round,X=Math.floor,L=t=>({x:t,y:t}),ye={left:"right",right:"left",bottom:"top",top:"bottom"},we={start:"end",end:"start"};function At(t,e,n){return W(t,G(e,n))}function nt(t,e){return typeof t=="function"?t(e):t}function D(t){return t.split("-")[0]}function ot(t){return t.split("-")[1]}function zt(t){return t==="x"?"y":"x"}function Bt(t){return t==="y"?"height":"width"}function $(t){return["top","bottom"].includes(D(t))?"y":"x"}function Ut(t){return zt($(t))}function xe(t,e,n){n===void 0&&(n=!1);const o=ot(t),r=Ut(t),i=Bt(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(s=Z(s)),[s,Z(s)]}function ve(t){const e=Z(t);return[at(t),e,at(e)]}function at(t){return t.replace(/start|end/g,e=>we[e])}function be(t,e,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?r:o:e?o:r;case"left":case"right":return e?i:s;default:return[]}}function Ae(t,e,n,o){const r=ot(t);let i=be(D(t),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),e&&(i=i.concat(i.map(at)))),i}function Z(t){return t.replace(/left|right|bottom|top/g,e=>ye[e])}function Ee(t){return{top:0,right:0,bottom:0,left:0,...t}}function Oe(t){return typeof t!="number"?Ee(t):{top:t,right:t,bottom:t,left:t}}function tt(t){const{x:e,y:n,width:o,height:r}=t;return{width:o,height:r,top:n,left:e,right:e+o,bottom:n+r,x:e,y:n}}function Et(t,e,n){let{reference:o,floating:r}=t;const i=$(e),s=Ut(e),c=Bt(s),a=D(e),l=i==="y",m=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,d=o[c]/2-r[c]/2;let h;switch(a){case"top":h={x:m,y:o.y-r.height};break;case"bottom":h={x:m,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:f};break;case"left":h={x:o.x-r.width,y:f};break;default:h={x:o.x,y:o.y}}switch(ot(e)){case"start":h[s]-=d*(n&&l?-1:1);break;case"end":h[s]+=d*(n&&l?-1:1);break}return h}const Re=async(t,e,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,c=i.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(e));let l=await s.getElementRects({reference:t,floating:e,strategy:r}),{x:m,y:f}=Et(l,o,a),d=o,h={},g=0;for(let y=0;y<c.length;y++){const{name:w,fn:p}=c[y],{x,y:v,data:A,reset:b}=await p({x:m,y:f,initialPlacement:o,placement:d,strategy:r,middlewareData:h,rects:l,platform:s,elements:{reference:t,floating:e}});m=x??m,f=v??f,h={...h,[w]:{...h[w],...A}},b&&g<=50&&(g++,typeof b=="object"&&(b.placement&&(d=b.placement),b.rects&&(l=b.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:r}):b.rects),{x:m,y:f}=Et(l,d,a)),y=-1)}return{x:m,y:f,placement:d,strategy:r,middlewareData:h}};async function _t(t,e){var n;e===void 0&&(e={});const{x:o,y:r,platform:i,rects:s,elements:c,strategy:a}=t,{boundary:l="clippingAncestors",rootBoundary:m="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=nt(e,t),g=Oe(h),w=c[d?f==="floating"?"reference":"floating":f],p=tt(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:l,rootBoundary:m,strategy:a})),x=f==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.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=tt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:v,strategy:a}):x);return{top:(p.top-b.top+g.top)/A.y,bottom:(b.bottom-p.bottom+g.bottom)/A.y,left:(p.left-b.left+g.left)/A.x,right:(b.right-p.right+g.right)/A.x}}const Le=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:c,platform:a,elements:l}=e,{mainAxis:m=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...w}=nt(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const p=D(r),x=$(c),v=D(c)===c,A=await(a.isRTL==null?void 0:a.isRTL(l.floating)),b=d||(v||!y?[Z(c)]:ve(c)),V=g!=="none";!d&&V&&b.push(...Ae(c,y,g,A));const ne=[c,...b],ct=await _t(e,w),K=[];let U=((o=i.flip)==null?void 0:o.overflows)||[];if(m&&K.push(ct[p]),f){const F=xe(r,s,A);K.push(ct[F[0]],ct[F[1]])}if(U=[...U,{placement:r,overflows:K}],!K.every(F=>F<=0)){var wt,xt;const F=(((wt=i.flip)==null?void 0:wt.index)||0)+1,bt=ne[F];if(bt)return{data:{index:F,overflows:U},reset:{placement:bt}};let _=(xt=U.filter(N=>N.overflows[0]<=0).sort((N,S)=>N.overflows[1]-S.overflows[1])[0])==null?void 0:xt.placement;if(!_)switch(h){case"bestFit":{var vt;const N=(vt=U.filter(S=>{if(V){const P=$(S.placement);return P===x||P==="y"}return!0}).map(S=>[S.placement,S.overflows.filter(P=>P>0).reduce((P,oe)=>P+oe,0)]).sort((S,P)=>S[1]-P[1])[0])==null?void 0:vt[0];N&&(_=N);break}case"initialPlacement":_=c;break}if(r!==_)return{reset:{placement:_}}}return{}}}};async function Te(t,e){const{placement:n,platform:o,elements:r}=t,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=D(n),c=ot(n),a=$(n)==="y",l=["left","top"].includes(s)?-1:1,m=i&&a?-1:1,f=nt(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&typeof g=="number"&&(h=c==="end"?g*-1:g),a?{x:h*m,y:d*l}:{x:d*l,y:h*m}}const ke=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:r,y:i,placement:s,middlewareData:c}=e,a=await Te(e,t);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+a.x,y:i+a.y,data:{...a,placement:s}}}}},Se=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:r}=e,{mainAxis:i=!0,crossAxis:s=!1,limiter:c={fn:w=>{let{x:p,y:x}=w;return{x:p,y:x}}},...a}=nt(t,e),l={x:n,y:o},m=await _t(e,a),f=$(D(r)),d=zt(f);let h=l[d],g=l[f];if(i){const w=d==="y"?"top":"left",p=d==="y"?"bottom":"right",x=h+m[w],v=h-m[p];h=At(x,h,v)}if(s){const w=f==="y"?"top":"left",p=f==="y"?"bottom":"right",x=g+m[w],v=g-m[p];g=At(x,g,v)}const y=c.fn({...e,[d]:h,[f]:g});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[d]:i,[f]:s}}}}}};function rt(){return typeof window<"u"}function B(t){return It(t)?(t.nodeName||"").toLowerCase():"#document"}function E(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function k(t){var e;return(e=(It(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function It(t){return rt()?t instanceof Node||t instanceof E(t).Node:!1}function O(t){return rt()?t instanceof Element||t instanceof E(t).Element:!1}function T(t){return rt()?t instanceof HTMLElement||t instanceof E(t).HTMLElement:!1}function Ot(t){return!rt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof E(t).ShadowRoot}function Y(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=R(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(r)}function Pe(t){return["table","td","th"].includes(B(t))}function it(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function dt(t){const e=pt(),n=O(t)?R(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Ce(t){let e=C(t);for(;T(e)&&!z(e);){if(dt(e))return e;if(it(e))return null;e=C(e)}return null}function pt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function z(t){return["html","body","#document"].includes(B(t))}function R(t){return E(t).getComputedStyle(t)}function st(t){return O(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function C(t){if(B(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Ot(t)&&t.host||k(t);return Ot(e)?e.host:e}function jt(t){const e=C(t);return z(e)?t.ownerDocument?t.ownerDocument.body:t.body:T(e)&&Y(e)?e:jt(e)}function j(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=jt(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),s=E(r);if(i){const c=ut(s);return e.concat(s,s.visualViewport||[],Y(r)?r:[],c&&n?j(c):[])}return e.concat(r,j(r,[],n))}function ut(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function qt(t){const e=R(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=T(t),i=r?t.offsetWidth:n,s=r?t.offsetHeight:o,c=Q(n)!==i||Q(o)!==s;return c&&(n=i,o=s),{width:n,height:o,$:c}}function gt(t){return O(t)?t:t.contextElement}function H(t){const e=gt(t);if(!T(e))return L(1);const n=e.getBoundingClientRect(),{width:o,height:r,$:i}=qt(e);let s=(i?Q(n.width):n.width)/o,c=(i?Q(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const Fe=L(0);function Yt(t){const e=E(t);return!pt()||!e.visualViewport?Fe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function We(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==E(t)?!1:e}function M(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=gt(t);let s=L(1);e&&(o?O(o)&&(s=H(o)):s=H(t));const c=We(i,n,o)?Yt(i):L(0);let a=(r.left+c.x)/s.x,l=(r.top+c.y)/s.y,m=r.width/s.x,f=r.height/s.y;if(i){const d=E(i),h=o&&O(o)?E(o):o;let g=d,y=ut(g);for(;y&&o&&h!==g;){const w=H(y),p=y.getBoundingClientRect(),x=R(y),v=p.left+(y.clientLeft+parseFloat(x.paddingLeft))*w.x,A=p.top+(y.clientTop+parseFloat(x.paddingTop))*w.y;a*=w.x,l*=w.y,m*=w.x,f*=w.y,a+=v,l+=A,g=E(y),y=ut(g)}}return tt({width:m,height:f,x:a,y:l})}function yt(t,e){const n=st(t).scrollLeft;return e?e.left+n:M(k(t)).left+n}function Kt(t,e,n){n===void 0&&(n=!1);const o=t.getBoundingClientRect(),r=o.left+e.scrollLeft-(n?0:yt(t,o)),i=o.top+e.scrollTop;return{x:r,y:i}}function De(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t;const i=r==="fixed",s=k(o),c=e?it(e.floating):!1;if(o===s||c&&i)return n;let a={scrollLeft:0,scrollTop:0},l=L(1);const m=L(0),f=T(o);if((f||!f&&!i)&&((B(o)!=="body"||Y(s))&&(a=st(o)),T(o))){const h=M(o);l=H(o),m.x=h.x+o.clientLeft,m.y=h.y+o.clientTop}const d=s&&!f&&!i?Kt(s,a,!0):L(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-a.scrollLeft*l.x+m.x+d.x,y:n.y*l.y-a.scrollTop*l.y+m.y+d.y}}function Me(t){return Array.from(t.getClientRects())}function Ve(t){const e=k(t),n=st(t),o=t.ownerDocument.body,r=W(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),i=W(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+yt(t);const c=-n.scrollTop;return R(o).direction==="rtl"&&(s+=W(e.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:c}}function Ne(t,e){const n=E(t),o=k(t),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,c=0,a=0;if(r){i=r.width,s=r.height;const l=pt();(!l||l&&e==="fixed")&&(c=r.offsetLeft,a=r.offsetTop)}return{width:i,height:s,x:c,y:a}}function He(t,e){const n=M(t,!0,e==="fixed"),o=n.top+t.clientTop,r=n.left+t.clientLeft,i=T(t)?H(t):L(1),s=t.clientWidth*i.x,c=t.clientHeight*i.y,a=r*i.x,l=o*i.y;return{width:s,height:c,x:a,y:l}}function Rt(t,e,n){let o;if(e==="viewport")o=Ne(t,n);else if(e==="document")o=Ve(k(t));else if(O(e))o=He(e,n);else{const r=Yt(t);o={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return tt(o)}function Xt(t,e){const n=C(t);return n===e||!O(n)||z(n)?!1:R(n).position==="fixed"||Xt(n,e)}function $e(t,e){const n=e.get(t);if(n)return n;let o=j(t,[],!1).filter(c=>O(c)&&B(c)!=="body"),r=null;const i=R(t).position==="fixed";let s=i?C(t):t;for(;O(s)&&!z(s);){const c=R(s),a=dt(s);!a&&c.position==="fixed"&&(r=null),(i?!a&&!r:!a&&c.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||Y(s)&&!a&&Xt(t,s))?o=o.filter(m=>m!==s):r=c,s=C(s)}return e.set(t,o),o}function ze(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t;const s=[...n==="clippingAncestors"?it(e)?[]:$e(e,this._c):[].concat(n),o],c=s[0],a=s.reduce((l,m)=>{const f=Rt(e,m,r);return l.top=W(f.top,l.top),l.right=G(f.right,l.right),l.bottom=G(f.bottom,l.bottom),l.left=W(f.left,l.left),l},Rt(e,c,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Be(t){const{width:e,height:n}=qt(t);return{width:e,height:n}}function Ue(t,e,n){const o=T(e),r=k(e),i=n==="fixed",s=M(t,!0,i,e);let c={scrollLeft:0,scrollTop:0};const a=L(0);if(o||!o&&!i)if((B(e)!=="body"||Y(r))&&(c=st(e)),o){const d=M(e,!0,i,e);a.x=d.x+e.clientLeft,a.y=d.y+e.clientTop}else r&&(a.x=yt(r));const l=r&&!o&&!i?Kt(r,c):L(0),m=s.left+c.scrollLeft-a.x-l.x,f=s.top+c.scrollTop-a.y-l.y;return{x:m,y:f,width:s.width,height:s.height}}function lt(t){return R(t).position==="static"}function Lt(t,e){if(!T(t)||R(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return k(t)===n&&(n=n.ownerDocument.body),n}function Jt(t,e){const n=E(t);if(it(t))return n;if(!T(t)){let r=C(t);for(;r&&!z(r);){if(O(r)&&!lt(r))return r;r=C(r)}return n}let o=Lt(t,e);for(;o&&Pe(o)&&lt(o);)o=Lt(o,e);return o&&z(o)&&lt(o)&&!dt(o)?n:o||Ce(t)||n}const _e=async function(t){const e=this.getOffsetParent||Jt,n=this.getDimensions,o=await n(t.floating);return{reference:Ue(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Ie(t){return R(t).direction==="rtl"}const je={convertOffsetParentRelativeRectToViewportRelativeRect:De,getDocumentElement:k,getClippingRect:ze,getOffsetParent:Jt,getElementRects:_e,getClientRects:Me,getDimensions:Be,getScale:H,isElement:O,isRTL:Ie};function qe(t,e){let n=null,o;const r=k(t);function i(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,a){c===void 0&&(c=!1),a===void 0&&(a=1),i();const{left:l,top:m,width:f,height:d}=t.getBoundingClientRect();if(c||e(),!f||!d)return;const h=X(m),g=X(r.clientWidth-(l+f)),y=X(r.clientHeight-(m+d)),w=X(l),x={rootMargin:-h+"px "+-g+"px "+-y+"px "+-w+"px",threshold:W(0,G(1,a))||1};let v=!0;function A(b){const V=b[0].intersectionRatio;if(V!==a){if(!v)return s();V?s(!1,V):o=setTimeout(()=>{s(!1,1e-7)},1e3)}v=!1}try{n=new IntersectionObserver(A,{...x,root:r.ownerDocument})}catch{n=new IntersectionObserver(A,x)}n.observe(t)}return s(!0),i}function Ye(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,l=gt(t),m=r||i?[...l?j(l):[],...j(e)]:[];m.forEach(p=>{r&&p.addEventListener("scroll",n,{passive:!0}),i&&p.addEventListener("resize",n)});const f=l&&c?qe(l,n):null;let d=-1,h=null;s&&(h=new ResizeObserver(p=>{let[x]=p;x&&x.target===l&&h&&(h.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var v;(v=h)==null||v.observe(e)})),n()}),l&&!a&&h.observe(l),h.observe(e));let g,y=a?M(t):null;a&&w();function w(){const p=M(t);y&&(p.x!==y.x||p.y!==y.y||p.width!==y.width||p.height!==y.height)&&n(),y=p,g=requestAnimationFrame(w)}return n(),()=>{var p;m.forEach(x=>{r&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),f==null||f(),(p=h)==null||p.disconnect(),h=null,a&&cancelAnimationFrame(g)}}const Ke=ke,Xe=Se,Tt=Le,Je=(t,e,n)=>{const o=new Map,r={platform:je,...n},i={...r.platform,_c:o};return Re(t,e,{...r,platform:i})},Ge=({content:t,open:e,placement:n,offset:{mainAxis:o,crossAxis:r}={mainAxis:0,crossAxis:0}})=>u.OnBrowserCtx(i=>{const s=u.Value.toSignal(e),c=i.element;return u.LazyWhen(s,()=>u.Portal("body",u.html.div(u.OnElement(a=>{const l=a;return l.style.position="absolute",Ye(c,l,()=>{Je(c,l,{placement:n,strategy:"absolute",middleware:[Tt(),Ke({mainAxis:o,crossAxis:r}),Xe(),Tt()]}).then(({x:m,y:f})=>{l.style.top=`${f}px`,l.style.left=`${m}px`})})}),t())))(i)}),Gt=(t,e)=>{if(typeof e=="function")return Gt(t,{success:e});const n=e.failure??(r=>u.Fragment(u.OnDispose(r.on(console.error)),r.map(i=>`Error: ${i}`))),o=e.success;return u.OneOfType(u.Value.toSignal(t),{Success:r=>o(r.$.value),Failure:r=>n(r.$.error)})},Qe=()=>u.on.focus(t=>{var e;return(e=t.target)==null?void 0:e.select()}),Ze=t=>u.OnBrowserCtx(e=>{const{element:n}=e,o=u.makeProp({width:n.clientWidth,height:n.clientHeight}),r=u.renderableOfTNode(t(o))(e),i=()=>{o.set({width:n.clientWidth,height:n.clientHeight})};let s;return typeof ResizeObserver=="function"&&(s=new ResizeObserver(i),s.observe(n)),c=>{s==null||s.disconnect(),r(c)}}),tn=t=>e=>{const n=u.getWindow(),o=u.makeProp({width:(n==null?void 0:n.innerWidth)??0,height:(n==null?void 0:n.innerHeight)??0}),r=u.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),s=>{n==null||n.removeEventListener("resize",i),r(s)}},Qt=(t,e)=>{const n=e.split("/").filter(r=>r!==""),o={};for(let r=0;r<t.length;r++){const i=t[r],s=n[r];if(!s&&i.type!=="catch-all")return null;if(i.type==="literal"){if(i.value!==s)return null}else if(i.type==="param")o[i.name]=s;else if(i.type==="catch-all")return{params:o,path:e}}return n.length!==t.length?null:{params:o,path:e}},Zt=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!==""),te=t=>{const e=t.map(n=>{const o=Zt(n);return{route:n,segments:o}});return function(o){for(const{segments:r,route:i}of e){const s=Qt(r,o);if(s)return{...s,route:i}}return null}},en=t=>{const e=te(Object.keys(t));return mt(n=>{const o=n.map(r=>{const i=e(r.pathname);if(i==null)throw console.error("No route found for",r),new Error("No route found");return{params:i.params,route:i.route,path:i.path,search:r.search,hash:r.hash}});return u.OneOfTuple(o.map(r=>[r.route,r]),t)})},et=60*1e3,ft=60*et,q=24*ft,kt=7*q,St=30*q,nn=365*q,on=[{max:et*90,value:et,name:"minute",past:{singular:"a minute ago",plural:"{} minutes ago"},future:{singular:"in a minute",plural:"in {} minutes"}},{max:ft*36,value:ft,name:"hour",past:{singular:"an hour ago",plural:"{} hours ago"},future:{singular:"in an hour",plural:"in {} hours"}},{max:q*10,value:q,name:"day",past:{singular:"yesterday",plural:"{} days ago"},future:{singular:"tomorrow",plural:"in {} days"}},{max:kt*6,value:kt,name:"week",past:{singular:"last week",plural:"{} weeks ago"},future:{singular:"in a week",plural:"in {} weeks"}},{max:St*18,value:St,name:"month",past:{singular:"last month",plural:"{} months ago"},future:{singular:"in a month",plural:"in {} months"}},{max:1/0,value:nn,name:"year",past:{singular:"last year",plural:"{} years ago"},future:{singular:"in a year",plural:"in {} years"}}];function Pt(t,e,n,o){const r=Math.round(t/e);return r<=1?n:o.replace("{}",r.toLocaleString(void 0,{maximumFractionDigits:0,minimumFractionDigits:0}))}function ee(t){const e=Math.abs(t);if(e<et)return t<0?"just now":"in a moment";for(const n of on)if(e<n.max)return t<0?Pt(e,n.value,n.past.singular,n.past.plural):Pt(e,n.value,n.future.singular,n.future.plural);throw new Error("unreachable")}const rn=(t,e)=>{const n=e!=null?u.Signal.is(e)?e.derive():u.makeProp(e):u.makeProp(new Date),o=u.makeComputedOf(t,n)((i,s)=>{const c=i.getTime()-s.getTime();return ee(c)}),r=u.Prop.is(n)?setInterval(()=>n.set(new Date),5e3):void 0;return o.onDispose(()=>{r!=null&&clearInterval(r),n.dispose()}),o};exports.Anchor=Nt;exports.AsyncResultView=Ht;exports.AutoFocus=ue;exports.AutoSelect=fe;exports.ElementSize=Ze;exports.HTMLTitle=he;exports.HiddenWhenEmpty=me;exports.InViewport=$t;exports.LocationProviderMarker=Dt;exports.PopOver=Ge;exports.ProvideAppearance=le;exports.ProvideLocation=ie;exports.ResultView=Gt;exports.Router=en;exports.SelectOnFocus=Qe;exports.UseAppearance=ae;exports.UseLocation=mt;exports.WhenInViewport=ge;exports.WindowSize=tn;exports._checkExtensionCondition=Ft;exports._getExtension=Ct;exports._makeRouteMatcher=te;exports._parseRouteSegments=Zt;exports.appearanceMarker=ht;exports.areLocationsEqual=se;exports.handleAnchorClick=Wt;exports.locationFromURL=Mt;exports.makeRelativeTime=rn;exports.matchesRoute=Qt;exports.setLocationFromUrl=Vt;exports.timeDiffToString=ee;exports.urlFromLocation=ce;
package/index.js CHANGED
@@ -1,13 +1,13 @@
1
- import { makeProviderMark as $t, Fragment as q, OnBrowserCtx as yt, Async as St, OnHeadlessCtx as le, UseProvider as Ht, makeProp as W, renderableOfTNode as rt, getWindow as wt, Signal as zt, html as Bt, on as Ut, Value as it, attr as It, WithProvider as ae, OnDispose as xt, Empty as dt, OneOfType as _t, makeSignal as ue, OnElement as K, Portal as jt, When as Yt, OneOfTuple as fe, makeComputedOf as he, Prop as de } from "@tempots/dom";
2
- const me = (t) => {
1
+ import { makeProviderMark as $t, Fragment as q, OnBrowserCtx as yt, Async as St, OnHeadlessCtx as ce, UseProvider as Ht, makeProp as D, renderableOfTNode as rt, getWindow as wt, Signal as zt, html as Bt, on as Ut, Value as it, attr as It, WithProvider as le, OnDispose as xt, Empty as dt, OneOfType as _t, makeSignal as ae, OnElement as K, Portal as jt, When as ue, LazyWhen as fe, OneOfTuple as he, makeComputedOf as de, Prop as me } from "@tempots/dom";
2
+ const pe = (t) => {
3
3
  const e = t.split("/").pop();
4
4
  if (e == null || e.startsWith(".")) return;
5
5
  const n = e.split(".") || [];
6
6
  return n.length > 1 ? "." + n.pop() : void 0;
7
- }, pe = (t, e) => {
8
- const n = me(e);
7
+ }, ge = (t, e) => {
8
+ const n = pe(e);
9
9
  return n != null && (t.length === 0 || !t.some((o) => n == o));
10
- }, ge = (t, e, n, o) => {
10
+ }, ye = (t, e, n, o) => {
11
11
  let r = t.target;
12
12
  for (; r != null && !(r instanceof HTMLAnchorElement); )
13
13
  r = r.parentElement;
@@ -22,8 +22,8 @@ const me = (t) => {
22
22
  if (!(f != null && f.startsWith("#")) && f !== l)
23
23
  return !0;
24
24
  }
25
- return e ? !1 : pe(n, s);
26
- }, ye = (t, e = {
25
+ return e ? !1 : ge(n, s);
26
+ }, we = (t, e = {
27
27
  ignoreUrlWithExtension: !0,
28
28
  allowedExtensions: [],
29
29
  ignoreExternalUrl: !0
@@ -32,30 +32,30 @@ const me = (t) => {
32
32
  (o) => o.startsWith(".") ? o : "." + o
33
33
  ) : [];
34
34
  return (o) => {
35
- ge(
35
+ ye(
36
36
  o,
37
37
  e.ignoreUrlWithExtension ?? !0,
38
38
  n,
39
39
  e.ignoreExternalUrl ?? !0
40
40
  ) || t() && o.preventDefault();
41
41
  };
42
- }, we = $t("LocationProvider"), pn = (t) => q(
42
+ }, xe = $t("LocationProvider"), gn = (t) => q(
43
43
  yt((e) => St(
44
44
  import("./browser-location-12vUH3Kv.js").then((n) => n.ProvideBrowserLocation),
45
45
  (n) => n(t)
46
46
  )(e)),
47
- le((e) => St(
47
+ ce((e) => St(
48
48
  import("./headless-location-Ba_ht5ZQ.js").then((n) => n.ProvideHeadlessLocation),
49
49
  (n) => n(e.container.currentURL, t)
50
50
  )(e))
51
- ), qt = (t) => Ht(we, (e) => (n) => {
52
- const o = W(e.value, e.equals);
51
+ ), Yt = (t) => Ht(xe, (e) => (n) => {
52
+ const o = D(e.value, e.equals);
53
53
  e.feedProp(o), o.on(e.set);
54
54
  const r = rt(t(o))(n);
55
55
  return (i) => {
56
56
  o.dispose(), r(i);
57
57
  };
58
- }), gn = (t, e) => t.pathname === e.pathname && JSON.stringify(t.search) === JSON.stringify(e.search) && t.hash === e.hash, xe = (t, e) => {
58
+ }), yn = (t, e) => t.pathname === e.pathname && JSON.stringify(t.search) === JSON.stringify(e.search) && t.hash === e.hash, ve = (t, e) => {
59
59
  var i;
60
60
  const n = new URL(t, e ?? ((i = wt()) == null ? void 0 : i.location.toString())), o = Object.fromEntries(n.searchParams.entries());
61
61
  let r = n.hash;
@@ -64,34 +64,34 @@ const me = (t) => {
64
64
  search: o,
65
65
  hash: r === "" ? void 0 : r
66
66
  };
67
- }, ve = (t, e) => {
68
- const n = xe(e);
67
+ }, be = (t, e) => {
68
+ const n = ve(e);
69
69
  return t.set(n), t;
70
- }, yn = (t) => {
70
+ }, wn = (t) => {
71
71
  const n = new URLSearchParams(t.search).toString(), o = t.hash;
72
72
  return `${t.pathname}${n ? `?${n}` : ""}${o ? `#${o}` : ""}`;
73
- }, be = (t, ...e) => {
73
+ }, Ae = (t, ...e) => {
74
74
  if (typeof t == "string" || zt.is(t))
75
- return be({ href: t }, ...e);
75
+ return Ae({ href: t }, ...e);
76
76
  const { href: n, ...o } = t;
77
- return qt((r) => Bt.a(
77
+ return Yt((r) => Bt.a(
78
78
  Ut.click(
79
- ye(() => (ve(r, it.get(n)), !0), o)
79
+ we(() => (be(r, it.get(n)), !0), o)
80
80
  ),
81
81
  It.href(n),
82
82
  ...e
83
83
  ));
84
- }, Kt = $t("Appearance"), wn = (t) => {
85
- const e = wt(), n = e != null && e.matchMedia != null && e.matchMedia("(prefers-color-scheme: dark)").matches, o = W(n ? "dark" : "light"), r = (s) => {
84
+ }, qt = $t("Appearance"), xn = (t) => {
85
+ const e = wt(), n = e != null && e.matchMedia != null && e.matchMedia("(prefers-color-scheme: dark)").matches, o = D(n ? "dark" : "light"), r = (s) => {
86
86
  o.set(s.matches ? "dark" : "light");
87
87
  }, i = e != null && e.matchMedia != null ? e.matchMedia("(prefers-color-scheme: dark)") : void 0;
88
88
  return i == null || i.addEventListener("change", r), q(
89
- ae(Kt, o, t),
89
+ le(qt, o, t),
90
90
  xt(() => i == null ? void 0 : i.removeEventListener("change", r))
91
91
  );
92
- }, xn = (t) => Ht(Kt, t), Ae = (t, e) => {
92
+ }, vn = (t) => Ht(qt, t), Ee = (t, e) => {
93
93
  if (typeof e == "function")
94
- return Ae(t, { success: e });
94
+ return Ee(t, { success: e });
95
95
  const n = e.failure ?? ((s) => q(
96
96
  xt(s.on(console.error)),
97
97
  s.map((c) => `Error: ${c}`)
@@ -99,25 +99,25 @@ const me = (t) => {
99
99
  return _t(it.toSignal(t), {
100
100
  AsyncSuccess: (s) => o(s.$.value),
101
101
  AsyncFailure: (s) => n(s.$.error),
102
- Loading: (s) => r(s.$.previousValue ?? ue(void 0)),
102
+ Loading: (s) => r(s.$.previousValue ?? ae(void 0)),
103
103
  NotAsked: i
104
104
  });
105
- }, vn = (t = 10) => K((e) => {
105
+ }, bn = (t = 10) => K((e) => {
106
106
  const n = setTimeout(() => {
107
107
  e == null || e.focus();
108
108
  }, t);
109
109
  return () => clearTimeout(n);
110
- }), bn = (t = 10) => K((e) => {
110
+ }), An = (t = 10) => K((e) => {
111
111
  const n = setTimeout(() => {
112
112
  e == null || e.select();
113
113
  }, t);
114
114
  return () => clearTimeout(n);
115
- }), An = K((t) => {
115
+ }), En = K((t) => {
116
116
  const e = t.style.getPropertyValue(":empty");
117
117
  return t.style.setProperty(":empty", "display:none"), (n) => {
118
118
  n && t.style.setProperty(":empty", e);
119
119
  };
120
- }), En = (t) => jt("head > title", It.innerText(t)), Ee = {
120
+ }), Rn = (t) => jt("head > title", It.innerText(t)), Re = {
121
121
  partial: {
122
122
  root: null,
123
123
  rootMargin: "0px",
@@ -135,19 +135,19 @@ const me = (t) => {
135
135
  partial: null,
136
136
  full: null
137
137
  };
138
- function Re(t) {
138
+ function Oe(t) {
139
139
  return _[t] == null && (_[t] = new IntersectionObserver((e) => {
140
140
  e.forEach((n) => {
141
141
  const o = Q[t].get(n.target);
142
142
  o == null || o.set(n.isIntersecting);
143
143
  });
144
- }, Ee[t])), _[t];
144
+ }, Re[t])), _[t];
145
145
  }
146
- const Oe = (t, e) => {
147
- const n = W(!1);
146
+ const Le = (t, e) => {
147
+ const n = D(!1);
148
148
  return q(
149
149
  K((o) => {
150
- const r = typeof IntersectionObserver < "u" ? Re(t) : null;
150
+ const r = typeof IntersectionObserver < "u" ? Oe(t) : null;
151
151
  return Q[t].set(o, n), r == null || r.observe(o), () => {
152
152
  var i;
153
153
  n.dispose(), r == null || r.unobserve(o), Q[t].delete(o), Q[t].size === 0 && ((i = _[t]) == null || i.disconnect(), _[t] = null);
@@ -155,20 +155,20 @@ const Oe = (t, e) => {
155
155
  }),
156
156
  rt(e(n))
157
157
  );
158
- }, Rn = (t, e, n) => Oe(t, (o) => Yt(o, e, n ?? dt)), Z = Math.min, D = Math.max, tt = Math.round, G = Math.floor, O = (t) => ({
158
+ }, On = (t, e, n) => Le(t, (o) => ue(o, e, n ?? dt)), Z = Math.min, W = Math.max, tt = Math.round, G = Math.floor, O = (t) => ({
159
159
  x: t,
160
160
  y: t
161
- }), Le = {
161
+ }), Te = {
162
162
  left: "right",
163
163
  right: "left",
164
164
  bottom: "top",
165
165
  top: "bottom"
166
- }, Te = {
166
+ }, Se = {
167
167
  start: "end",
168
168
  end: "start"
169
169
  };
170
170
  function Ct(t, e, n) {
171
- return D(t, Z(e, n));
171
+ return W(t, Z(e, n));
172
172
  }
173
173
  function st(t, e) {
174
174
  return typeof t == "function" ? t(e) : t;
@@ -179,32 +179,32 @@ function F(t) {
179
179
  function ct(t) {
180
180
  return t.split("-")[1];
181
181
  }
182
- function Xt(t) {
182
+ function Kt(t) {
183
183
  return t === "x" ? "y" : "x";
184
184
  }
185
- function Jt(t) {
185
+ function Xt(t) {
186
186
  return t === "y" ? "height" : "width";
187
187
  }
188
188
  function H(t) {
189
189
  return ["top", "bottom"].includes(F(t)) ? "y" : "x";
190
190
  }
191
- function Gt(t) {
192
- return Xt(H(t));
191
+ function Jt(t) {
192
+ return Kt(H(t));
193
193
  }
194
- function Se(t, e, n) {
194
+ function Ce(t, e, n) {
195
195
  n === void 0 && (n = !1);
196
- const o = ct(t), r = Gt(t), i = Jt(r);
196
+ const o = ct(t), r = Jt(t), i = Xt(r);
197
197
  let s = r === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
198
198
  return e.reference[i] > e.floating[i] && (s = et(s)), [s, et(s)];
199
199
  }
200
- function Ce(t) {
200
+ function ke(t) {
201
201
  const e = et(t);
202
202
  return [mt(t), e, mt(e)];
203
203
  }
204
204
  function mt(t) {
205
- return t.replace(/start|end/g, (e) => Te[e]);
205
+ return t.replace(/start|end/g, (e) => Se[e]);
206
206
  }
207
- function ke(t, e, n) {
207
+ function Pe(t, e, n) {
208
208
  const o = ["left", "right"], r = ["right", "left"], i = ["top", "bottom"], s = ["bottom", "top"];
209
209
  switch (t) {
210
210
  case "top":
@@ -217,13 +217,13 @@ function ke(t, e, n) {
217
217
  return [];
218
218
  }
219
219
  }
220
- function Pe(t, e, n, o) {
220
+ function We(t, e, n, o) {
221
221
  const r = ct(t);
222
- let i = ke(F(t), n === "start", o);
222
+ let i = Pe(F(t), n === "start", o);
223
223
  return r && (i = i.map((s) => s + "-" + r), e && (i = i.concat(i.map(mt)))), i;
224
224
  }
225
225
  function et(t) {
226
- return t.replace(/left|right|bottom|top/g, (e) => Le[e]);
226
+ return t.replace(/left|right|bottom|top/g, (e) => Te[e]);
227
227
  }
228
228
  function De(t) {
229
229
  return {
@@ -234,7 +234,7 @@ function De(t) {
234
234
  ...t
235
235
  };
236
236
  }
237
- function We(t) {
237
+ function Fe(t) {
238
238
  return typeof t != "number" ? De(t) : {
239
239
  top: t,
240
240
  right: t,
@@ -265,7 +265,7 @@ function kt(t, e, n) {
265
265
  reference: o,
266
266
  floating: r
267
267
  } = t;
268
- const i = H(e), s = Gt(e), c = Jt(s), a = F(e), l = i === "y", f = o.x + o.width / 2 - r.width / 2, u = o.y + o.height / 2 - r.height / 2, d = o[c] / 2 - r[c] / 2;
268
+ const i = H(e), s = Jt(e), c = Xt(s), a = F(e), l = i === "y", f = o.x + o.width / 2 - r.width / 2, u = o.y + o.height / 2 - r.height / 2, d = o[c] / 2 - r[c] / 2;
269
269
  let h;
270
270
  switch (a) {
271
271
  case "top":
@@ -308,7 +308,7 @@ function kt(t, e, n) {
308
308
  }
309
309
  return h;
310
310
  }
311
- const Fe = async (t, e, n) => {
311
+ const Me = async (t, e, n) => {
312
312
  const {
313
313
  placement: o = "bottom",
314
314
  strategy: r = "absolute",
@@ -369,7 +369,7 @@ const Fe = async (t, e, n) => {
369
369
  middlewareData: h
370
370
  };
371
371
  };
372
- async function Qt(t, e) {
372
+ async function Gt(t, e) {
373
373
  var n;
374
374
  e === void 0 && (e = {});
375
375
  const {
@@ -385,7 +385,7 @@ async function Qt(t, e) {
385
385
  elementContext: u = "floating",
386
386
  altBoundary: d = !1,
387
387
  padding: h = 0
388
- } = st(e, t), p = We(h), y = c[d ? u === "floating" ? "reference" : "floating" : u], m = nt(await i.getClippingRect({
388
+ } = st(e, t), p = Fe(h), y = c[d ? u === "floating" ? "reference" : "floating" : u], m = nt(await i.getClippingRect({
389
389
  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)),
390
390
  boundary: l,
391
391
  rootBoundary: f,
@@ -414,7 +414,7 @@ async function Qt(t, e) {
414
414
  right: (v.right - m.right + p.right) / b.x
415
415
  };
416
416
  }
417
- const Me = function(t) {
417
+ const Ne = function(t) {
418
418
  return t === void 0 && (t = {}), {
419
419
  name: "flip",
420
420
  options: t,
@@ -438,12 +438,12 @@ const Me = function(t) {
438
438
  } = st(t, e);
439
439
  if ((n = i.arrow) != null && n.alignmentOffset)
440
440
  return {};
441
- const m = F(r), w = H(c), x = F(c) === c, b = await (a.isRTL == null ? void 0 : a.isRTL(l.floating)), v = d || (x || !g ? [et(c)] : Ce(c)), N = p !== "none";
442
- !d && N && v.push(...Pe(c, g, p, b));
443
- const se = [c, ...v], ft = await Qt(e, y), J = [];
441
+ const m = F(r), w = H(c), x = F(c) === c, b = await (a.isRTL == null ? void 0 : a.isRTL(l.floating)), v = d || (x || !g ? [et(c)] : ke(c)), N = p !== "none";
442
+ !d && N && v.push(...We(c, g, p, b));
443
+ const ie = [c, ...v], ft = await Gt(e, y), J = [];
444
444
  let U = ((o = i.flip) == null ? void 0 : o.overflows) || [];
445
445
  if (f && J.push(ft[m]), u) {
446
- const P = Se(r, s, b);
446
+ const P = Ce(r, s, b);
447
447
  J.push(ft[P[0]], ft[P[1]]);
448
448
  }
449
449
  if (U = [...U, {
@@ -451,7 +451,7 @@ const Me = function(t) {
451
451
  overflows: J
452
452
  }], !J.every((P) => P <= 0)) {
453
453
  var Rt, Ot;
454
- const P = (((Rt = i.flip) == null ? void 0 : Rt.index) || 0) + 1, Tt = se[P];
454
+ const P = (((Rt = i.flip) == null ? void 0 : Rt.index) || 0) + 1, Tt = ie[P];
455
455
  if (Tt)
456
456
  return {
457
457
  data: {
@@ -475,7 +475,7 @@ const Me = function(t) {
475
475
  C === "y";
476
476
  }
477
477
  return !0;
478
- }).map((S) => [S.placement, S.overflows.filter((C) => C > 0).reduce((C, ce) => C + ce, 0)]).sort((S, C) => S[1] - C[1])[0]) == null ? void 0 : Lt[0];
478
+ }).map((S) => [S.placement, S.overflows.filter((C) => C > 0).reduce((C, se) => C + se, 0)]).sort((S, C) => S[1] - C[1])[0]) == null ? void 0 : Lt[0];
479
479
  V && (I = V);
480
480
  break;
481
481
  }
@@ -494,7 +494,7 @@ const Me = function(t) {
494
494
  }
495
495
  };
496
496
  };
497
- async function Ne(t, e) {
497
+ async function Ve(t, e) {
498
498
  const {
499
499
  placement: n,
500
500
  platform: o,
@@ -521,7 +521,7 @@ async function Ne(t, e) {
521
521
  y: h * f
522
522
  };
523
523
  }
524
- const Ve = function(t) {
524
+ const $e = function(t) {
525
525
  return t === void 0 && (t = 0), {
526
526
  name: "offset",
527
527
  options: t,
@@ -532,7 +532,7 @@ const Ve = function(t) {
532
532
  y: i,
533
533
  placement: s,
534
534
  middlewareData: c
535
- } = e, a = await Ne(e, t);
535
+ } = e, a = await Ve(e, t);
536
536
  return s === ((n = c.offset) == null ? void 0 : n.placement) && (o = c.arrow) != null && o.alignmentOffset ? {} : {
537
537
  x: r + a.x,
538
538
  y: i + a.y,
@@ -543,7 +543,7 @@ const Ve = function(t) {
543
543
  };
544
544
  }
545
545
  };
546
- }, $e = function(t) {
546
+ }, He = function(t) {
547
547
  return t === void 0 && (t = {}), {
548
548
  name: "shift",
549
549
  options: t,
@@ -571,7 +571,7 @@ const Ve = function(t) {
571
571
  } = st(t, e), l = {
572
572
  x: n,
573
573
  y: o
574
- }, f = await Qt(e, a), u = H(F(r)), d = Xt(u);
574
+ }, f = await Gt(e, a), u = H(F(r)), d = Kt(u);
575
575
  let h = l[d], p = l[u];
576
576
  if (i) {
577
577
  const y = d === "y" ? "top" : "left", m = d === "y" ? "bottom" : "right", w = h + f[y], x = h - f[m];
@@ -604,7 +604,7 @@ function lt() {
604
604
  return typeof window < "u";
605
605
  }
606
606
  function B(t) {
607
- return Zt(t) ? (t.nodeName || "").toLowerCase() : "#document";
607
+ return Qt(t) ? (t.nodeName || "").toLowerCase() : "#document";
608
608
  }
609
609
  function A(t) {
610
610
  var e;
@@ -612,9 +612,9 @@ function A(t) {
612
612
  }
613
613
  function T(t) {
614
614
  var e;
615
- return (e = (Zt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
615
+ return (e = (Qt(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
616
616
  }
617
- function Zt(t) {
617
+ function Qt(t) {
618
618
  return lt() ? t instanceof Node || t instanceof A(t).Node : !1;
619
619
  }
620
620
  function E(t) {
@@ -635,7 +635,7 @@ function X(t) {
635
635
  } = R(t);
636
636
  return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !["inline", "contents"].includes(r);
637
637
  }
638
- function He(t) {
638
+ function ze(t) {
639
639
  return ["table", "td", "th"].includes(B(t));
640
640
  }
641
641
  function at(t) {
@@ -651,7 +651,7 @@ function vt(t) {
651
651
  const e = bt(), n = E(t) ? R(t) : t;
652
652
  return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((o) => (n.willChange || "").includes(o)) || ["paint", "layout", "strict", "content"].some((o) => (n.contain || "").includes(o));
653
653
  }
654
- function ze(t) {
654
+ function Be(t) {
655
655
  let e = k(t);
656
656
  for (; L(e) && !z(e); ) {
657
657
  if (vt(e))
@@ -692,14 +692,14 @@ function k(t) {
692
692
  );
693
693
  return Pt(e) ? e.host : e;
694
694
  }
695
- function te(t) {
695
+ function Zt(t) {
696
696
  const e = k(t);
697
- return z(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : L(e) && X(e) ? e : te(e);
697
+ return z(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : L(e) && X(e) ? e : Zt(e);
698
698
  }
699
699
  function j(t, e, n) {
700
700
  var o;
701
701
  e === void 0 && (e = []), n === void 0 && (n = !0);
702
- const r = te(t), i = r === ((o = t.ownerDocument) == null ? void 0 : o.body), s = A(r);
702
+ const r = Zt(t), i = r === ((o = t.ownerDocument) == null ? void 0 : o.body), s = A(r);
703
703
  if (i) {
704
704
  const c = pt(s);
705
705
  return e.concat(s, s.visualViewport || [], X(r) ? r : [], c && n ? j(c) : []);
@@ -709,7 +709,7 @@ function j(t, e, n) {
709
709
  function pt(t) {
710
710
  return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
711
711
  }
712
- function ee(t) {
712
+ function te(t) {
713
713
  const e = R(t);
714
714
  let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
715
715
  const r = L(t), i = r ? t.offsetWidth : n, s = r ? t.offsetHeight : o, c = tt(n) !== i || tt(o) !== s;
@@ -730,22 +730,22 @@ function $(t) {
730
730
  width: o,
731
731
  height: r,
732
732
  $: i
733
- } = ee(e);
733
+ } = te(e);
734
734
  let s = (i ? tt(n.width) : n.width) / o, c = (i ? tt(n.height) : n.height) / r;
735
735
  return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
736
736
  x: s,
737
737
  y: c
738
738
  };
739
739
  }
740
- const Be = /* @__PURE__ */ O(0);
741
- function ne(t) {
740
+ const Ue = /* @__PURE__ */ O(0);
741
+ function ee(t) {
742
742
  const e = A(t);
743
- return !bt() || !e.visualViewport ? Be : {
743
+ return !bt() || !e.visualViewport ? Ue : {
744
744
  x: e.visualViewport.offsetLeft,
745
745
  y: e.visualViewport.offsetTop
746
746
  };
747
747
  }
748
- function Ue(t, e, n) {
748
+ function Ie(t, e, n) {
749
749
  return e === void 0 && (e = !1), !n || e && n !== A(t) ? !1 : e;
750
750
  }
751
751
  function M(t, e, n, o) {
@@ -753,7 +753,7 @@ function M(t, e, n, o) {
753
753
  const r = t.getBoundingClientRect(), i = At(t);
754
754
  let s = O(1);
755
755
  e && (o ? E(o) && (s = $(o)) : s = $(t));
756
- const c = Ue(i, n, o) ? ne(i) : O(0);
756
+ const c = Ie(i, n, o) ? ee(i) : O(0);
757
757
  let a = (r.left + c.x) / s.x, l = (r.top + c.y) / s.y, f = r.width / s.x, u = r.height / s.y;
758
758
  if (i) {
759
759
  const d = A(i), h = o && E(o) ? A(o) : o;
@@ -774,7 +774,7 @@ function Et(t, e) {
774
774
  const n = ut(t).scrollLeft;
775
775
  return e ? e.left + n : M(T(t)).left + n;
776
776
  }
777
- function oe(t, e, n) {
777
+ function ne(t, e, n) {
778
778
  n === void 0 && (n = !1);
779
779
  const o = t.getBoundingClientRect(), r = o.left + e.scrollLeft - (n ? 0 : (
780
780
  // RTL <body> scrollbar.
@@ -785,7 +785,7 @@ function oe(t, e, n) {
785
785
  y: i
786
786
  };
787
787
  }
788
- function Ie(t) {
788
+ function _e(t) {
789
789
  let {
790
790
  elements: e,
791
791
  rect: n,
@@ -804,7 +804,7 @@ function Ie(t) {
804
804
  const h = M(o);
805
805
  l = $(o), f.x = h.x + o.clientLeft, f.y = h.y + o.clientTop;
806
806
  }
807
- const d = s && !u && !i ? oe(s, a, !0) : O(0);
807
+ const d = s && !u && !i ? ne(s, a, !0) : O(0);
808
808
  return {
809
809
  width: n.width * l.x,
810
810
  height: n.height * l.y,
@@ -812,21 +812,21 @@ function Ie(t) {
812
812
  y: n.y * l.y - a.scrollTop * l.y + f.y + d.y
813
813
  };
814
814
  }
815
- function _e(t) {
815
+ function je(t) {
816
816
  return Array.from(t.getClientRects());
817
817
  }
818
- function je(t) {
819
- const e = T(t), n = ut(t), o = t.ownerDocument.body, r = D(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), i = D(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
818
+ function Ye(t) {
819
+ const e = T(t), n = ut(t), o = t.ownerDocument.body, r = W(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), i = W(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
820
820
  let s = -n.scrollLeft + Et(t);
821
821
  const c = -n.scrollTop;
822
- return R(o).direction === "rtl" && (s += D(e.clientWidth, o.clientWidth) - r), {
822
+ return R(o).direction === "rtl" && (s += W(e.clientWidth, o.clientWidth) - r), {
823
823
  width: r,
824
824
  height: i,
825
825
  x: s,
826
826
  y: c
827
827
  };
828
828
  }
829
- function Ye(t, e) {
829
+ function qe(t, e) {
830
830
  const n = A(t), o = T(t), r = n.visualViewport;
831
831
  let i = o.clientWidth, s = o.clientHeight, c = 0, a = 0;
832
832
  if (r) {
@@ -841,7 +841,7 @@ function Ye(t, e) {
841
841
  y: a
842
842
  };
843
843
  }
844
- function qe(t, e) {
844
+ function Ke(t, e) {
845
845
  const n = M(t, !0, e === "fixed"), o = n.top + t.clientTop, r = n.left + t.clientLeft, i = L(t) ? $(t) : O(1), s = t.clientWidth * i.x, c = t.clientHeight * i.y, a = r * i.x, l = o * i.y;
846
846
  return {
847
847
  width: s,
@@ -850,16 +850,16 @@ function qe(t, e) {
850
850
  y: l
851
851
  };
852
852
  }
853
- function Dt(t, e, n) {
853
+ function Wt(t, e, n) {
854
854
  let o;
855
855
  if (e === "viewport")
856
- o = Ye(t, n);
856
+ o = qe(t, n);
857
857
  else if (e === "document")
858
- o = je(T(t));
858
+ o = Ye(T(t));
859
859
  else if (E(e))
860
- o = qe(e, n);
860
+ o = Ke(e, n);
861
861
  else {
862
- const r = ne(t);
862
+ const r = ee(t);
863
863
  o = {
864
864
  x: e.x - r.x,
865
865
  y: e.y - r.y,
@@ -869,11 +869,11 @@ function Dt(t, e, n) {
869
869
  }
870
870
  return nt(o);
871
871
  }
872
- function re(t, e) {
872
+ function oe(t, e) {
873
873
  const n = k(t);
874
- return n === e || !E(n) || z(n) ? !1 : R(n).position === "fixed" || re(n, e);
874
+ return n === e || !E(n) || z(n) ? !1 : R(n).position === "fixed" || oe(n, e);
875
875
  }
876
- function Ke(t, e) {
876
+ function Xe(t, e) {
877
877
  const n = e.get(t);
878
878
  if (n)
879
879
  return n;
@@ -882,21 +882,21 @@ function Ke(t, e) {
882
882
  let s = i ? k(t) : t;
883
883
  for (; E(s) && !z(s); ) {
884
884
  const c = R(s), a = vt(s);
885
- !a && c.position === "fixed" && (r = null), (i ? !a && !r : !a && c.position === "static" && !!r && ["absolute", "fixed"].includes(r.position) || X(s) && !a && re(t, s)) ? o = o.filter((f) => f !== s) : r = c, s = k(s);
885
+ !a && c.position === "fixed" && (r = null), (i ? !a && !r : !a && c.position === "static" && !!r && ["absolute", "fixed"].includes(r.position) || X(s) && !a && oe(t, s)) ? o = o.filter((f) => f !== s) : r = c, s = k(s);
886
886
  }
887
887
  return e.set(t, o), o;
888
888
  }
889
- function Xe(t) {
889
+ function Je(t) {
890
890
  let {
891
891
  element: e,
892
892
  boundary: n,
893
893
  rootBoundary: o,
894
894
  strategy: r
895
895
  } = t;
896
- const s = [...n === "clippingAncestors" ? at(e) ? [] : Ke(e, this._c) : [].concat(n), o], c = s[0], a = s.reduce((l, f) => {
897
- const u = Dt(e, f, r);
898
- return l.top = D(u.top, l.top), l.right = Z(u.right, l.right), l.bottom = Z(u.bottom, l.bottom), l.left = D(u.left, l.left), l;
899
- }, Dt(e, c, r));
896
+ const s = [...n === "clippingAncestors" ? at(e) ? [] : Xe(e, this._c) : [].concat(n), o], c = s[0], a = s.reduce((l, f) => {
897
+ const u = Wt(e, f, r);
898
+ return l.top = W(u.top, l.top), l.right = Z(u.right, l.right), l.bottom = Z(u.bottom, l.bottom), l.left = W(u.left, l.left), l;
899
+ }, Wt(e, c, r));
900
900
  return {
901
901
  width: a.right - a.left,
902
902
  height: a.bottom - a.top,
@@ -904,17 +904,17 @@ function Xe(t) {
904
904
  y: a.top
905
905
  };
906
906
  }
907
- function Je(t) {
907
+ function Ge(t) {
908
908
  const {
909
909
  width: e,
910
910
  height: n
911
- } = ee(t);
911
+ } = te(t);
912
912
  return {
913
913
  width: e,
914
914
  height: n
915
915
  };
916
916
  }
917
- function Ge(t, e, n) {
917
+ function Qe(t, e, n) {
918
918
  const o = L(e), r = T(e), i = n === "fixed", s = M(t, !0, i, e);
919
919
  let c = {
920
920
  scrollLeft: 0,
@@ -926,7 +926,7 @@ function Ge(t, e, n) {
926
926
  const d = M(e, !0, i, e);
927
927
  a.x = d.x + e.clientLeft, a.y = d.y + e.clientTop;
928
928
  } else r && (a.x = Et(r));
929
- const l = r && !o && !i ? oe(r, c) : O(0), f = s.left + c.scrollLeft - a.x - l.x, u = s.top + c.scrollTop - a.y - l.y;
929
+ const l = r && !o && !i ? ne(r, c) : O(0), f = s.left + c.scrollLeft - a.x - l.x, u = s.top + c.scrollTop - a.y - l.y;
930
930
  return {
931
931
  x: f,
932
932
  y: u,
@@ -937,7 +937,7 @@ function Ge(t, e, n) {
937
937
  function ht(t) {
938
938
  return R(t).position === "static";
939
939
  }
940
- function Wt(t, e) {
940
+ function Dt(t, e) {
941
941
  if (!L(t) || R(t).position === "fixed")
942
942
  return null;
943
943
  if (e)
@@ -945,7 +945,7 @@ function Wt(t, e) {
945
945
  let n = t.offsetParent;
946
946
  return T(t) === n && (n = n.ownerDocument.body), n;
947
947
  }
948
- function ie(t, e) {
948
+ function re(t, e) {
949
949
  const n = A(t);
950
950
  if (at(t))
951
951
  return n;
@@ -958,15 +958,15 @@ function ie(t, e) {
958
958
  }
959
959
  return n;
960
960
  }
961
- let o = Wt(t, e);
962
- for (; o && He(o) && ht(o); )
963
- o = Wt(o, e);
964
- return o && z(o) && ht(o) && !vt(o) ? n : o || ze(t) || n;
961
+ let o = Dt(t, e);
962
+ for (; o && ze(o) && ht(o); )
963
+ o = Dt(o, e);
964
+ return o && z(o) && ht(o) && !vt(o) ? n : o || Be(t) || n;
965
965
  }
966
- const Qe = async function(t) {
967
- const e = this.getOffsetParent || ie, n = this.getDimensions, o = await n(t.floating);
966
+ const Ze = async function(t) {
967
+ const e = this.getOffsetParent || re, n = this.getDimensions, o = await n(t.floating);
968
968
  return {
969
- reference: Ge(t.reference, await e(t.floating), t.strategy),
969
+ reference: Qe(t.reference, await e(t.floating), t.strategy),
970
970
  floating: {
971
971
  x: 0,
972
972
  y: 0,
@@ -975,22 +975,22 @@ const Qe = async function(t) {
975
975
  }
976
976
  };
977
977
  };
978
- function Ze(t) {
978
+ function tn(t) {
979
979
  return R(t).direction === "rtl";
980
980
  }
981
- const tn = {
982
- convertOffsetParentRelativeRectToViewportRelativeRect: Ie,
981
+ const en = {
982
+ convertOffsetParentRelativeRectToViewportRelativeRect: _e,
983
983
  getDocumentElement: T,
984
- getClippingRect: Xe,
985
- getOffsetParent: ie,
986
- getElementRects: Qe,
987
- getClientRects: _e,
988
- getDimensions: Je,
984
+ getClippingRect: Je,
985
+ getOffsetParent: re,
986
+ getElementRects: Ze,
987
+ getClientRects: je,
988
+ getDimensions: Ge,
989
989
  getScale: $,
990
990
  isElement: E,
991
- isRTL: Ze
991
+ isRTL: tn
992
992
  };
993
- function en(t, e) {
993
+ function nn(t, e) {
994
994
  let n = null, o;
995
995
  const r = T(t);
996
996
  function i() {
@@ -1009,7 +1009,7 @@ function en(t, e) {
1009
1009
  return;
1010
1010
  const h = G(f), p = G(r.clientWidth - (l + u)), g = G(r.clientHeight - (f + d)), y = G(l), w = {
1011
1011
  rootMargin: -h + "px " + -p + "px " + -g + "px " + -y + "px",
1012
- threshold: D(0, Z(1, a)) || 1
1012
+ threshold: W(0, Z(1, a)) || 1
1013
1013
  };
1014
1014
  let x = !0;
1015
1015
  function b(v) {
@@ -1036,7 +1036,7 @@ function en(t, e) {
1036
1036
  }
1037
1037
  return s(!0), i;
1038
1038
  }
1039
- function nn(t, e, n, o) {
1039
+ function on(t, e, n, o) {
1040
1040
  o === void 0 && (o = {});
1041
1041
  const {
1042
1042
  ancestorScroll: r = !0,
@@ -1050,7 +1050,7 @@ function nn(t, e, n, o) {
1050
1050
  passive: !0
1051
1051
  }), i && m.addEventListener("resize", n);
1052
1052
  });
1053
- const u = l && c ? en(l, n) : null;
1053
+ const u = l && c ? nn(l, n) : null;
1054
1054
  let d = -1, h = null;
1055
1055
  s && (h = new ResizeObserver((m) => {
1056
1056
  let [w] = m;
@@ -1072,40 +1072,40 @@ function nn(t, e, n, o) {
1072
1072
  }), u == null || u(), (m = h) == null || m.disconnect(), h = null, a && cancelAnimationFrame(p);
1073
1073
  };
1074
1074
  }
1075
- const on = Ve, rn = $e, Ft = Me, sn = (t, e, n) => {
1075
+ const rn = $e, sn = He, Ft = Ne, cn = (t, e, n) => {
1076
1076
  const o = /* @__PURE__ */ new Map(), r = {
1077
- platform: tn,
1077
+ platform: en,
1078
1078
  ...n
1079
1079
  }, i = {
1080
1080
  ...r.platform,
1081
1081
  _c: o
1082
1082
  };
1083
- return Fe(t, e, {
1083
+ return Me(t, e, {
1084
1084
  ...r,
1085
1085
  platform: i
1086
1086
  });
1087
- }, On = ({
1087
+ }, Ln = ({
1088
1088
  content: t,
1089
1089
  open: e,
1090
1090
  placement: n,
1091
1091
  offset: { mainAxis: o, crossAxis: r } = { mainAxis: 0, crossAxis: 0 }
1092
1092
  }) => yt((i) => {
1093
1093
  const s = it.toSignal(e), c = i.element;
1094
- return Yt(
1094
+ return fe(
1095
1095
  s,
1096
- jt(
1096
+ () => jt(
1097
1097
  "body",
1098
1098
  Bt.div(
1099
1099
  K((a) => {
1100
1100
  const l = a;
1101
- return l.style.position = "absolute", nn(c, l, () => {
1102
- sn(c, l, {
1101
+ return l.style.position = "absolute", on(c, l, () => {
1102
+ cn(c, l, {
1103
1103
  placement: n,
1104
1104
  strategy: "absolute",
1105
1105
  middleware: [
1106
1106
  Ft(),
1107
- on({ mainAxis: o, crossAxis: r }),
1108
- rn(),
1107
+ rn({ mainAxis: o, crossAxis: r }),
1108
+ sn(),
1109
1109
  Ft()
1110
1110
  ]
1111
1111
  }).then(({ x: f, y: u }) => {
@@ -1117,9 +1117,9 @@ const on = Ve, rn = $e, Ft = Me, sn = (t, e, n) => {
1117
1117
  )
1118
1118
  )
1119
1119
  )(i);
1120
- }), cn = (t, e) => {
1120
+ }), ln = (t, e) => {
1121
1121
  if (typeof e == "function")
1122
- return cn(t, { success: e });
1122
+ return ln(t, { success: e });
1123
1123
  const n = e.failure ?? ((r) => q(
1124
1124
  xt(r.on(console.error)),
1125
1125
  r.map((i) => `Error: ${i}`)
@@ -1128,11 +1128,11 @@ const on = Ve, rn = $e, Ft = Me, sn = (t, e, n) => {
1128
1128
  Success: (r) => o(r.$.value),
1129
1129
  Failure: (r) => n(r.$.error)
1130
1130
  });
1131
- }, Ln = () => Ut.focus((t) => {
1131
+ }, Tn = () => Ut.focus((t) => {
1132
1132
  var e;
1133
1133
  return (e = t.target) == null ? void 0 : e.select();
1134
- }), Tn = (t) => yt((e) => {
1135
- const { element: n } = e, o = W({
1134
+ }), Sn = (t) => yt((e) => {
1135
+ const { element: n } = e, o = D({
1136
1136
  width: n.clientWidth,
1137
1137
  height: n.clientHeight
1138
1138
  }), r = rt(t(o))(e), i = () => {
@@ -1142,8 +1142,8 @@ const on = Ve, rn = $e, Ft = Me, sn = (t, e, n) => {
1142
1142
  return typeof ResizeObserver == "function" && (s = new ResizeObserver(i), s.observe(n)), (c) => {
1143
1143
  s == null || s.disconnect(), r(c);
1144
1144
  };
1145
- }), Sn = (t) => (e) => {
1146
- const n = wt(), o = W({
1145
+ }), Cn = (t) => (e) => {
1146
+ const n = wt(), o = D({
1147
1147
  width: (n == null ? void 0 : n.innerWidth) ?? 0,
1148
1148
  height: (n == null ? void 0 : n.innerHeight) ?? 0
1149
1149
  }), r = rt(t(o))(e), i = () => {
@@ -1155,7 +1155,7 @@ const on = Ve, rn = $e, Ft = Me, sn = (t, e, n) => {
1155
1155
  return n == null || n.addEventListener("resize", i), (s) => {
1156
1156
  n == null || n.removeEventListener("resize", i), r(s);
1157
1157
  };
1158
- }, ln = (t, e) => {
1158
+ }, an = (t, e) => {
1159
1159
  const n = e.split("/").filter((r) => r !== ""), o = {};
1160
1160
  for (let r = 0; r < t.length; r++) {
1161
1161
  const i = t[r], s = n[r];
@@ -1170,22 +1170,22 @@ const on = Ve, rn = $e, Ft = Me, sn = (t, e, n) => {
1170
1170
  return { params: o, path: e };
1171
1171
  }
1172
1172
  return n.length !== t.length ? null : { params: o, path: e };
1173
- }, an = (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 !== ""), un = (t) => {
1173
+ }, un = (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 !== ""), fn = (t) => {
1174
1174
  const e = t.map((n) => {
1175
- const o = an(n);
1175
+ const o = un(n);
1176
1176
  return { route: n, segments: o };
1177
1177
  });
1178
1178
  return function(o) {
1179
1179
  for (const { segments: r, route: i } of e) {
1180
- const s = ln(r, o);
1180
+ const s = an(r, o);
1181
1181
  if (s)
1182
1182
  return { ...s, route: i };
1183
1183
  }
1184
1184
  return null;
1185
1185
  };
1186
- }, Cn = (t) => {
1187
- const e = un(Object.keys(t));
1188
- return qt((n) => {
1186
+ }, kn = (t) => {
1187
+ const e = fn(Object.keys(t));
1188
+ return Yt((n) => {
1189
1189
  const o = n.map((r) => {
1190
1190
  const i = e(r.pathname);
1191
1191
  if (i == null)
@@ -1198,13 +1198,13 @@ const on = Ve, rn = $e, Ft = Me, sn = (t, e, n) => {
1198
1198
  hash: r.hash
1199
1199
  };
1200
1200
  });
1201
- return fe(
1201
+ return he(
1202
1202
  o.map((r) => [r.route, r]),
1203
1203
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1204
1204
  t
1205
1205
  );
1206
1206
  });
1207
- }, ot = 60 * 1e3, gt = 60 * ot, Y = 24 * gt, Mt = 7 * Y, Nt = 30 * Y, fn = 365 * Y, hn = [
1207
+ }, ot = 60 * 1e3, gt = 60 * ot, Y = 24 * gt, Mt = 7 * Y, Nt = 30 * Y, hn = 365 * Y, dn = [
1208
1208
  {
1209
1209
  max: ot * 90,
1210
1210
  value: ot,
@@ -1242,7 +1242,7 @@ const on = Ve, rn = $e, Ft = Me, sn = (t, e, n) => {
1242
1242
  },
1243
1243
  {
1244
1244
  max: 1 / 0,
1245
- value: fn,
1245
+ value: hn,
1246
1246
  name: "year",
1247
1247
  past: { singular: "last year", plural: "{} years ago" },
1248
1248
  future: { singular: "in a year", plural: "in {} years" }
@@ -1258,58 +1258,58 @@ function Vt(t, e, n, o) {
1258
1258
  })
1259
1259
  );
1260
1260
  }
1261
- function dn(t) {
1261
+ function mn(t) {
1262
1262
  const e = Math.abs(t);
1263
1263
  if (e < ot)
1264
1264
  return t < 0 ? "just now" : "in a moment";
1265
- for (const n of hn)
1265
+ for (const n of dn)
1266
1266
  if (e < n.max)
1267
1267
  return t < 0 ? Vt(e, n.value, n.past.singular, n.past.plural) : Vt(e, n.value, n.future.singular, n.future.plural);
1268
1268
  throw new Error("unreachable");
1269
1269
  }
1270
- const kn = (t, e) => {
1271
- const n = e != null ? zt.is(e) ? e.derive() : W(e) : W(/* @__PURE__ */ new Date()), o = he(
1270
+ const Pn = (t, e) => {
1271
+ const n = e != null ? zt.is(e) ? e.derive() : D(e) : D(/* @__PURE__ */ new Date()), o = de(
1272
1272
  t,
1273
1273
  n
1274
1274
  )((i, s) => {
1275
1275
  const c = i.getTime() - s.getTime();
1276
- return dn(c);
1277
- }), r = de.is(n) ? setInterval(() => n.set(/* @__PURE__ */ new Date()), 5e3) : void 0;
1276
+ return mn(c);
1277
+ }), r = me.is(n) ? setInterval(() => n.set(/* @__PURE__ */ new Date()), 5e3) : void 0;
1278
1278
  return o.onDispose(() => {
1279
1279
  r != null && clearInterval(r), n.dispose();
1280
1280
  }), o;
1281
1281
  };
1282
1282
  export {
1283
- be as Anchor,
1284
- Ae as AsyncResultView,
1285
- vn as AutoFocus,
1286
- bn as AutoSelect,
1287
- Tn as ElementSize,
1288
- En as HTMLTitle,
1289
- An as HiddenWhenEmpty,
1290
- Oe as InViewport,
1291
- we as LocationProviderMarker,
1292
- On as PopOver,
1293
- wn as ProvideAppearance,
1294
- pn as ProvideLocation,
1295
- cn as ResultView,
1296
- Cn as Router,
1297
- Ln as SelectOnFocus,
1298
- xn as UseAppearance,
1299
- qt as UseLocation,
1300
- Rn as WhenInViewport,
1301
- Sn as WindowSize,
1302
- pe as _checkExtensionCondition,
1303
- me as _getExtension,
1304
- un as _makeRouteMatcher,
1305
- an as _parseRouteSegments,
1306
- Kt as appearanceMarker,
1307
- gn as areLocationsEqual,
1308
- ye as handleAnchorClick,
1309
- xe as locationFromURL,
1310
- kn as makeRelativeTime,
1311
- ln as matchesRoute,
1312
- ve as setLocationFromUrl,
1313
- dn as timeDiffToString,
1314
- yn as urlFromLocation
1283
+ Ae as Anchor,
1284
+ Ee as AsyncResultView,
1285
+ bn as AutoFocus,
1286
+ An as AutoSelect,
1287
+ Sn as ElementSize,
1288
+ Rn as HTMLTitle,
1289
+ En as HiddenWhenEmpty,
1290
+ Le as InViewport,
1291
+ xe as LocationProviderMarker,
1292
+ Ln as PopOver,
1293
+ xn as ProvideAppearance,
1294
+ gn as ProvideLocation,
1295
+ ln as ResultView,
1296
+ kn as Router,
1297
+ Tn as SelectOnFocus,
1298
+ vn as UseAppearance,
1299
+ Yt as UseLocation,
1300
+ On as WhenInViewport,
1301
+ Cn as WindowSize,
1302
+ ge as _checkExtensionCondition,
1303
+ pe as _getExtension,
1304
+ fn as _makeRouteMatcher,
1305
+ un as _parseRouteSegments,
1306
+ qt as appearanceMarker,
1307
+ yn as areLocationsEqual,
1308
+ we as handleAnchorClick,
1309
+ ve as locationFromURL,
1310
+ Pn as makeRelativeTime,
1311
+ an as matchesRoute,
1312
+ be as setLocationFromUrl,
1313
+ mn as timeDiffToString,
1314
+ wn as urlFromLocation
1315
1315
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tempots/ui",
3
- "version": "0.23.0-next.14",
3
+ "version": "0.23.0-next.16",
4
4
  "type": "module",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
@@ -40,6 +40,6 @@
40
40
  "@floating-ui/dom": "^1.6.7"
41
41
  },
42
42
  "peerDependencies": {
43
- "@tempots/std": "0.16.0"
43
+ "@tempots/std": "0.16.1"
44
44
  }
45
45
  }