blue-web 1.36.3 → 1.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkblue_web=self.webpackChunkblue_web||[]).push([[701],{701(t,e,n){n.r(e),n.d(e,{prepareVariables:()=>U,presentSheet:()=>gt});var o=n(340),i=n(214);function r(t){return t.towardMore?!t.atLargest&&t.expandOnScroll?"sheet":"scroll":t.scrollAtStart?"sheet":"scroll"}function s(t){const{extent:e,velocity:n,candidates:o}=t;if(Math.abs(n)<t.minFlingVelocity)return a(o,e);const i=e+function(t,e){return t*e/(1-e)}(n,t.rate),r=function(t,e,n){if(n>0)return t.findIndex(t=>t>e+.5);for(let n=t.length-1;n>=0;n--)if(t[n]<e-.5)return n;return-1}(o,e,Math.sign(n));let s=a(o,i);return(n>0?o[s]<=e+.5:o[s]>=e-.5)&&-1!==r&&(s=r),t.skipSnapPoints||-1===r||(s=n>0?Math.min(s,r):Math.max(s,r)),s}function a(t,e){let n=0;for(let o=1;o<t.length;o++)Math.abs(t[o]-e)<Math.abs(t[n]-e)&&(n=o);return n}function c(t,e,n=.55){return t<=0?0:(1-1/(t*n/e+1))*e}function l(t,e,n=.55){return t<=0?0:(1/(1-Math.min(t/e,.999999))-1)*e/n}function u(t,e,n,o){const i=2*Math.PI/(1e3*t),r=e;return Math.abs(r-1)<1e-6?function(t,e,n){const o=n+t*e;return{position:n=>Math.exp(-t*n)*(e+o*n),velocity:n=>Math.exp(-t*n)*(o-t*(e+o*n))}}(i,n,o):r<1?function(t,e,n,o){const i=e*t,r=t*Math.sqrt(1-e*e),s=(o+i*n)/r;return{position:t=>Math.exp(-i*t)*(n*Math.cos(r*t)+s*Math.sin(r*t)),velocity:t=>{const e=Math.cos(r*t),o=Math.sin(r*t);return Math.exp(-i*t)*((s*r-i*n)*e-(n*r+i*s)*o)}}}(i,r,n,o):function(t,e,n,o){const i=Math.sqrt(e*e-1),r=-t*(e+i),s=-t*(e-i),a=(o-r*n)/(s-r),c=n-a;return{position:t=>a*Math.exp(s*t)+c*Math.exp(r*t),velocity:t=>a*s*Math.exp(s*t)+c*r*Math.exp(r*t)}}(i,r,n,o)}function p(t,{positionTolerance:e=.5,velocityTolerance:n=.02,step:o=1,limit:i=1e4}={}){for(let r=0;r<=i;r+=o)if(Math.abs(t.position(r))<=e&&Math.abs(t.velocity(r))<=n)return r;return i}function d(t,e,n,o,i=1e3/120){const r=n-e;if(Math.abs(r)<1e-6)return"linear";const s=[];for(let e=0;e<o;e+=i)s.push(f(1+t.position(e)/r));return s.push("1"),`linear(${s.join(", ")})`}function f(t){return String(Math.round(1e4*t)/1e4)}var m=[];function h(t,e){return{phase:"idle",extent:t,restingIndex:e}}function g(t,e,n){switch(e.type){case"down":return function(t,e,n){const o="mouse"===e.pointer?n.physics.mouseSlop:n.physics.touchSlop;if("idle"===t.phase&&t.restingIndex>=0)return{state:{...t,phase:"pending",originX:e.x,originY:e.y,slop:o},effects:m};if("settling"!==t.phase)return{state:t,effects:m};const{extent:i}=x(t,e.time);return{state:{phase:"dragging",extent:i,restingIndex:t.restingIndex,anchorY:e.y,anchorExtent:w(i,n),lastY:e.y,isScrollingContent:!1},effects:[{type:"move",extent:i}]}}(t,e,n);case"move":return function(t,e,n){return"pending"===t.phase?function(t,e,n){const o=e.x-t.originX,i=e.y-t.originY;if(Math.max(Math.abs(o),Math.abs(i))<t.slop)return{state:t,effects:m};if(Math.abs(o)>Math.abs(i))return{state:h(t.extent,t.restingIndex),effects:m};const r=n.contentScroll?.claim(t,e,i<0,n);if(r)return{state:r,effects:m};const s={...y(t,t.originY+Math.sign(i)*t.slop),lastY:e.y},a=b(s.anchorExtent+(s.anchorY-e.y),n);return{state:{...s,extent:a},effects:[{type:"move",extent:a}]}}(t,e,n):"scrolling"===t.phase&&n.contentScroll?n.contentScroll.move(t,e):"dragging"===t.phase?function(t,e,n){const o=t.lastY-e.y,i=t.isScrollingContent?{anchorY:t.lastY,anchorExtent:t.extent}:t,r=i.anchorExtent+(i.anchorY-e.y),s=n.contentScroll?.drag(t,e,o,r,n);if(s)return s;const a=b(r,n);return{state:{...t,anchorY:i.anchorY,anchorExtent:i.anchorExtent,extent:a,lastY:e.y,isScrollingContent:!1},effects:[{type:"move",extent:a}]}}(t,e,n):{state:t,effects:m}}(t,e,n);case"up":return function(t,e,n){if("pending"===t.phase||"scrolling"===t.phase)return{state:h(t.extent,t.restingIndex),effects:m};if("dragging"!==t.phase)return{state:t,effects:m};const o=n.contentScroll?.release(t,e,n);if(o)return o;const i=-e.velocity*function(t,e){const{coefficient:n,dimension:o}=M(e),i=S(e),r=e.snapPoints[0].extent,s=t>i?t-i:!e.dismissible&&t<r?r-t:0;return s<=0?1:function(t,e,n=.55){if(t<=0)return 1;const o=t*n/e+1;return n/(o*o)}(l(s,o,n),o,n)}(t.extent,n),r=[0,...P(n)],a=n.physics,c={candidates:r,rate:a.projectionRate,minFlingVelocity:a.minFlingVelocity,skipSnapPoints:a.skipSnapPoints},u=s({...c,extent:t.extent,velocity:i}),p={motion:{extent:t.extent,velocity:i},time:e.time,reason:"swipe"};if(n.dismissible)return v(t,n,u>0?{...p,targetIndex:u-1}:{...p,targetIndex:-1,outcome:{type:"dismiss",reason:"swipe"}});const d=t.anchorExtent+(t.anchorY-t.lastY),f=0===s({...c,extent:d,velocity:-e.velocity}),g=Math.max(0,u-1);return v(t,n,f?{...p,targetIndex:0,outcome:{type:"attempt-dismiss",reason:"swipe"}}:{...p,targetIndex:g})}(t,e,n);case"settled":return function(t){return"settling"!==t.phase?{state:t,effects:m}:{state:h(t.to,t.targetIndex),effects:m}}(t);case"rest":return function(t,e,n){if(e.extent<1&&n.dismissible)return{state:h(0,-1),effects:[{type:"dismiss",reason:"swipe"}]};const o=a(P(n),e.extent),i=o===t.restingIndex?[]:[{type:"snap",id:n.snapPoints[o].id,reason:"swipe"}];return{state:h(e.extent,o),effects:i}}(t,e,n);case"snap-to":return function(t,e,n){const o=n.snapPoints.findIndex(t=>t.id===e.id);return-1===o||"dragging"===t.phase?{state:t,effects:m}:v(t,n,{targetIndex:o,motion:x(t,e.time),time:e.time,reason:e.reason})}(t,e,n);case"nudge":return function(t,e,n){return"idle"!==t.phase||t.restingIndex<0?{state:t,effects:m}:v(t,n,{targetIndex:t.restingIndex,motion:{extent:t.extent,velocity:-1},time:e.time,reason:"imperative"})}(t,e,n);case"close":return v(t,n,{targetIndex:-1,motion:x(t,e.time),time:e.time,reason:"imperative",outcome:{type:"dismiss",reason:"imperative"}})}}function x(t,e){if("settling"!==t.phase)return{extent:t.extent,velocity:0};const n=u(t.response,t.dampingRatio,t.from-t.to,t.velocity),o=Math.max(0,e-t.startTime);return{extent:t.to+n.position(o),velocity:n.velocity(o)}}function y(t,e){return{phase:"dragging",extent:t.extent,restingIndex:t.restingIndex,anchorY:e,anchorExtent:t.extent,lastY:e,isScrollingContent:!1}}function v(t,e,n){const{targetIndex:o,motion:i,time:r,reason:s}=n,a=e.physics,c=o<0?0:e.snapPoints[o].extent,l=Math.abs(i.velocity)>=a.minFlingVelocity?a.momentumDampingRatio:a.dampingRatio,u={phase:"settling",extent:i.extent,restingIndex:t.restingIndex,targetIndex:o,from:i.extent,to:c,velocity:i.velocity,response:a.response,dampingRatio:l,startTime:r},p=[{type:"settle",from:i.extent,to:c,velocity:i.velocity,response:a.response,dampingRatio:l}];return o>=0&&o!==t.restingIndex&&p.push({type:"snap",id:e.snapPoints[o].id,reason:s}),n.outcome&&p.push(n.outcome),{state:u,effects:p}}function b(t,e){const n=S(e),{coefficient:o,dimension:i}=M(e);if(t>n)return n+c(t-n,i,o);if(e.dismissible)return Math.max(0,t);const r=e.snapPoints[0].extent;return t<r?r-c(r-t,i,o):t}function w(t,e){const n=S(e),{coefficient:o,dimension:i}=M(e);if(t>n)return n+l(t-n,i,o);const r=e.snapPoints[0].extent;return!e.dismissible&&t<r?r-l(r-t,i,o):t}function M(t){return{coefficient:t.physics.rubberBand,dimension:t.physics.rubberBandDimension??t.dimension}}function S(t){return t.snapPoints[t.snapPoints.length-1].extent}function P(t){return t.snapPoints.map(t=>t.extent)}var E=[],T={claim(t,e,n,o){if(e.scroll)return"scroll"===r({towardMore:n,scrollAtStart:e.scroll.atStart,atLargest:t.extent>=S(o)-.5,expandOnScroll:o.expandOnScroll})?{phase:"scrolling",extent:t.extent,restingIndex:t.restingIndex,lastY:e.y}:void 0},move:(t,e)=>e.y>t.lastY&&e.scroll?.atStart?{state:y(t,e.y),effects:E}:{state:{...t,lastY:e.y},effects:E},drag(t,e,n,o,i){const r=e.scroll;if(!r)return;if(t.isScrollingContent&&(n>0?!r.atEnd:!r.atStart)){const o=[{type:"scroll",delta:n}];return{state:{...t,lastY:e.y},effects:o}}const s=S(i);if(!(n>0&&o>s&&t.extent<=s)||r.atEnd)return;const a=[{type:"scroll",delta:o-s}];return t.extent!==s&&a.unshift({type:"move",extent:s}),{state:{...t,extent:s,anchorY:e.y,anchorExtent:s,lastY:e.y,isScrollingContent:!0},effects:a}},release(t,e,n){if(!t.isScrollingContent)return;const o=n.snapPoints.length-1,i=[{type:"fling-scroll",velocity:-e.velocity}];return t.restingIndex!==o&&i.push({type:"snap",id:n.snapPoints[o].id,reason:"swipe"}),{state:h(t.extent,o),effects:i}}},I={ios:{response:.34,dampingRatio:1,momentumDampingRatio:.88,projectionRate:.99,minFlingVelocity:.5,skipSnapPoints:!0,rubberBand:1.9,rubberBandDimension:24,touchSlop:8,mouseSlop:4,dim:.2,velocityHorizon:70}};function k(t){return String(t)}function A(t,e){if("number"==typeof t)return t<=1?t*e.container:t;if("content"===t)return e.content;const n=parseFloat(t);return t.endsWith("rem")?n*e.rootFontSize:t.endsWith("%")?n/100*e.container:t.endsWith("px")?n:NaN}function C(t,e){if(null==e)return-1;const n=String(e);return t.findIndex(t=>t.ids.includes(n))}var D=n(393),Y=n(748);function R(t,e){return function(t,e=!1){return"start"===t?e?"right":"left":"end"===t?e?"left":"right":t}(t,("start"===t||"end"===t)&&(0,Y.V8)(e))}var V=t=>"bottom"===t||"top"===t,F=t=>"bottom"===t||"right"===t?1:-1;function L(t,e,n,o){const i=V(t);return o.y=(i?n:e)*F(t),o.x=i?e:n,o}function O(t,e){const n=Math.round(e*F(t)*100)/100+"px";return V(t)?`0 ${n}`:`${n} 0`}function z(t,e,n){const o=e.ownerDocument.defaultView;if(!(o&&t instanceof Element&&e.contains(t)))return null;const i=V(n);for(let n=t;n&&n!==e.parentElement;n=n.parentElement){if(!((i?n.scrollHeight>n.clientHeight+1:n.scrollWidth>n.clientWidth+1)&&n instanceof HTMLElement))continue;const t=i?o.getComputedStyle(n).overflowY:o.getComputedStyle(n).overflowX;if(/auto|scroll/.test(t))return n}return null}function H(t,e,n){if(V(e))t.scrollTop+="bottom"===e?n:-n;else{const o="right"===e?n:-n;t.scrollLeft+=(0,Y.V8)(t)?-o:o}}function W(t,e){t.requestAnimationFrame(()=>t.requestAnimationFrame(e))}function B(t){return"bottom"===t?-120:-32}function $(t,e){const n=[];for(let o=0;o<t.duration;o+=1e3/60)n.push(e(t.extentAt(o)));return n.push(e(t.extentAt(t.duration))),n}function j(t,e){const n=Object.entries(e).map(([e,n])=>(0,i.eC)(t,e,n));return()=>n.forEach(t=>t())}var X=t=>Math.max(0,Math.min(1,t)),q=1e3/60,N=["--drawer-progress","--drawer-dim","--drawer-expand","--drawer-stack"],_=new WeakSet;function Q(t){const e=t.defaultView?.CSS;if(!_.has(t)&&e?.registerProperty){_.add(t);for(const t of N)try{e.registerProperty({name:t,syntax:"<number>",inherits:!1,initialValue:"0"})}catch{}}}function U(){"undefined"==typeof document||_.has(document)||(0,i.Uc)(()=>Q(document))}var Z=()=>"undefined"!=typeof CSS&&CSS.supports("animation-timing-function","linear(0, 1)"),G=t=>Math.round(1e4*t)/1e4;var J={pseudoElement:"::backdrop"};function K(t){return`linear(${t.map(G).join(", ")})`}var tt=t=>t;function et(t){return t.startsWith("--")?t:t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}var nt={horizon:70,staleAfter:40,maxSpeed:8,capacity:20};function ot(t,e,n,o){let i=0,r=0;const s=o-n;for(let a=n;a<o;a++)i+=t[a]/s,r+=e[a]/s;let a=0,c=0;for(let s=n;s<o;s++){const n=t[s]-i;a+=n*(e[s]-r),c+=n*n}return c>0?a/c:0}var it=new WeakSet,rt=t=>it.has(t);var st=.998;function at(t){const{sheet:e}=t,n=e.ownerDocument,i=n.defaultView??window;let s=h(0,-1),c=0,l=null,f=0,m=0,x=null,y=null,v=null,b=null,w=null,M=null,S=null,P=!1,E=!1,T=null,I=null,k=null;const A={x:0,y:0},C=function(t={}){const{horizon:e,staleAfter:n,maxSpeed:o,capacity:i}={...nt,...t},r=new Float64Array(i),s=new Float64Array(i),a=new Float64Array(i),c=new Float64Array(i);let l=0,u=-1;return{add:function(t,e){l>0&&t<=r[u]||(u=(u+1)%i,r[u]=t,s[u]=e,l=Math.min(l+1,i))},velocity:function(t){if(l<2)return 0;const p=r[u];if(t-p>n)return 0;let d=0;for(let t=l-1;t>=0;t--){const n=(u-t+i)%i;p-r[n]>e||(a[d]=r[n],c[d]=s[n],d++)}const f=function(t,e,n=0,o=t.length){const i=o-n;if(i<2)return 0;const r=t[o-1];if(i<4)return ot(t,e,n,o);let s=0,a=0,c=0,l=0,u=0,p=0,d=0,f=0;for(let i=n;i<o;i++){const n=t[i]-r,o=e[i],m=n*n;s+=1,a+=n,c+=m,l+=m*n,u+=m*m,p+=o,d+=o*n,f+=o*m}const m=s*(c*u-l*l)-a*(a*u-l*c)+c*(a*l-c*c);return Math.abs(m)<1e-9?ot(t,e,n,o):(s*(d*u-l*f)-p*(a*u-l*c)+c*(a*f-d*c))/m}(a,c,0,d);return Math.max(-o,Math.min(o,f))},reset:function(){l=0,u=-1}}}({horizon:t.config().physics.velocityHorizon}),D=[(0,o.on)(n,"touchstart",function(e){const n=null!==T&&rt(T);if(T=null,M||e.touches.length>1||v||n)return;if(!t.owns(e.target)||Q(e.target))return;const o=e.changedTouches[0];M={id:o.identifier,originX:o.clientX,originY:o.clientY},b=null,C.reset(),L(t.side(),o.clientX,o.clientY,A),C.add(e.timeStamp,A.y),B({type:"down",time:e.timeStamp,x:A.x,y:A.y,pointer:"touch"},e)},{capture:!0,passive:!0}),(0,o.on)(n,"touchmove",function(e){const n=J(e.changedTouches);if(!n)return;L(t.side(),n.clientX,n.clientY,A),C.add(e.timeStamp,A.y);const o="dragging"===s.phase,i=U(e.target);if(B({type:"move",time:e.timeStamp,x:A.x,y:A.y,scroll:i},e),"pending"===s.phase)return function(e,n,o){if(!e.cancelable||!M)return;const i=L(t.side(),M.originX,M.originY,{x:0,y:0});if(Math.abs(A.y-i.y)<Math.abs(A.x-i.x))return;const s=t.config().snapPoints.at(-1)?.extent??0;"sheet"===(o?r({towardMore:A.y<i.y,scrollAtStart:o.atStart,atLargest:c>=s-.5,expandOnScroll:t.config().expandOnScroll}):"sheet")&&e.preventDefault()}(e,0,i);"dragging"===s.phase&&(e.cancelable?e.preventDefault():!o&&w&&(w.style.overscrollBehavior="none"))},{capture:!0,passive:!1}),(0,o.on)(n,"touchend",G,{capture:!0,passive:!0}),(0,o.on)(n,"touchcancel",G,{capture:!0,passive:!0}),(0,o.on)(e,"pointerdown",function(e){if(T=e,"touch"===e.pointerType||0!==e.button||null!==S||v)return;const i=e.target;if(!t.owns(i)||Q(i)||!(i instanceof Element)||!t.canMouseDrag(i))return;S=e.pointerId,E=!1,k="settling"===s.phase&&s.targetIndex>=0?I:null,b=null,C.reset(),L(t.side(),e.clientX,e.clientY,A),C.add(e.timeStamp,A.y),K=[(0,o.on)(n,"pointermove",tt,{capture:!0}),(0,o.on)(n,"pointerup",et,{capture:!0}),(0,o.on)(n,"pointercancel",et,{capture:!0})];const r="pen"===e.pointerType?"pen":"mouse";B({type:"down",time:e.timeStamp,x:A.x,y:A.y,pointer:r},e)})];let R=!1;function F(n){R||(e.style.translate=O(t.side(),t.size()-n),c=n)}function B(e,n){if(R)return;const o=g(s,e,t.config());s=o.state;const i="time"in e?e.time:performance.now();for(const t of o.effects)j(t,i,n);const r="dragging"===s.phase;r!==P&&(P=r,t.onDragChange(P))}function j(n,o,i){switch(n.type){case"move":return void(x?(X(),F(n.extent),t.onFrame(n.extent)):(l=n.extent,N()));case"settle":return function(n,o){X(),l=null;const i=t.closedExtent(),r=n.from<=0?i:n.from,s=n.to<=0?i:n.to,a=t.reducedMotion()&&(r===i||s===i),c=t.reducedMotion()?function(t,e,n){const o=n?150:200;return{duration:o,easing:"cubic-bezier(0.33, 1, 0.68, 1)",extentAt:n=>t+(e-t)*(1-(1-Math.min(1,n/o))**3)}}(r,s,a):function(t,e,n){const o=u(n.response,n.dampingRatio,t-e,n.velocity),i=p(o);return{duration:i,easing:d(o,t,e,i),extentAt:t=>e+o.position(t)}}(r,s,n);if(F(a?Math.max(s,0):s),Math.abs(s-r)<.5&&0===n.velocity||0===c.duration)return q();const f=t.size(),m=t.side();x=a?e.animate({opacity:r===i?[0,1]:[1,0]},{duration:c.duration,fill:"both"}):Math.abs(s-r)<1||!Z()?e.animate({translate:$(c,t=>O(m,f-t))},{duration:c.duration,fill:"backwards"}):e.animate({translate:[O(m,f-r),O(m,f-s)]},{duration:c.duration,easing:c.easing,fill:"backwards"}),a&&(y=x);const h=x;x.onfinish=()=>{x===h&&q()},x.startTime=o,t.onMotion({type:"settle",extentAt:c.extentAt,startTime:o,duration:c.duration})}(n,o);case"scroll":return f+=n.delta,N();case"fling-scroll":return w&&(b={velocity:n.velocity,startTime:o,startScroll:0,area:w}),N();case"snap":return I=n.id,t.onSnap(n.id,n.reason,i);case"dismiss":if("swipe"!==n.reason)return;return v="swipe",t.onDismiss(i);case"attempt-dismiss":return t.onDismissAttempt(i)}}function X(){x?.cancel(),x=null,y&&(y.cancel(),y=null)}function q(){if(X(),B({type:"settled"}),"idle"===s.phase){if(s.restingIndex<0)return v=null,I=null,t.onRest(null);I=t.config().snapPoints[s.restingIndex].id,t.onRest(I)}}function N(){m||=i.requestAnimationFrame(_)}function _(e){m=0,f&&w&&(H(w,t.side(),f),f=0),b&&function(e){if(!b)return;const n=Math.max(0,e-b.startTime),o=b.velocity*(st**n-1)/Math.log(st);H(b.area,t.side(),o-b.startScroll),b.startScroll=o,Math.abs(b.velocity*st**n)<.01?b=null:N()}(e),null!==l&&(F(l),l=null,t.onFrame(c))}function Q(t){return t instanceof Element&&null!==t.closest('input, textarea, select, [contenteditable]:not([contenteditable="false"]), [data-drawer-no-drag]')}function U(n){const o=function(t,e,n){const o=z(t,e,n);if(!o)return null;const{start:i,end:r}=function(t,e){const{position:n,max:o}=function(t,e){if(V(e)){const n=t.scrollHeight-t.clientHeight;return{position:"bottom"===e?t.scrollTop:n-t.scrollTop,max:n}}const n=t.scrollWidth-t.clientWidth,o=Math.abs(t.scrollLeft),i=(0,Y.V8)(t)?n-o:o;return{position:"right"===e?i:n-i,max:n}}(t,e);return{start:n<=.5,end:n>=o-1}}(o,n);return{atStart:i,atEnd:r,area:o}}(n,e,t.side());return w=o?.area??null,o&&{atStart:o.atStart,atEnd:o.atEnd}}function G(t){if(!J(t.changedTouches))return;M=null,w&&w.style.removeProperty("overscroll-behavior");const e="touchcancel"===t.type?0:C.velocity(t.timeStamp);B({type:"up",time:t.timeStamp,velocity:e},t)}function J(t){if(!M)return null;for(let e=0;e<t.length;e++)if(t[e].identifier===M.id)return t[e];return null}let K=[];function tt(o){if(o.pointerId!==S)return;if(T&&rt(T))return it(o,0,k);const i=o.getCoalescedEvents?.();for(const e of i?.length?i:[o])C.add(e.timeStamp,L(t.side(),e.clientX,e.clientY,A).y);if(L(t.side(),o.clientX,o.clientY,A),B({type:"move",time:o.timeStamp,x:A.x,y:A.y,scroll:U(o.target)},o),"dragging"===s.phase&&!E){E=!0,n.getSelection()?.removeAllRanges(),e.style.userSelect="none";try{e.setPointerCapture(o.pointerId)}catch{}}}function et(t){if(t.pointerId===S)return T&&rt(T)?it(t,0,k):void it(t,"pointercancel"===t.type?0:C.velocity(t.timeStamp))}function it(o,i,r=null){S=null,T=null,K.forEach(t=>t()),K=[],e.style.removeProperty("user-select");const a=o.timeStamp,c=t.config().snapPoints.findIndex(t=>t.id===r);null!==r&&c>=0?(s=h(s.extent,c),B({type:"snap-to",time:a,id:r,reason:"imperative"})):B({type:"up",time:a,velocity:i},o),E&&function(t,e=!1,n){const o=t.defaultView??window,i=t=>void 0===n||!("pointerId"in t)||t.pointerId===n,r=e=>{i(e)&&(e.preventDefault(),e.stopPropagation(),t.removeEventListener("click",r,!0))},s=()=>{t.removeEventListener("click",r,!0),t.removeEventListener("pointerdown",a,!0),t.removeEventListener("pointerup",c,!0),t.removeEventListener("pointercancel",c,!0)},a=t=>i(t)&&s(),c=t=>i(t)&&o.setTimeout(s);if(t.addEventListener("click",r,!0),t.addEventListener("pointerdown",a,!0),!e)return o.setTimeout(s);t.addEventListener("pointerup",c,!0),t.addEventListener("pointercancel",c,!0)}(n)}return{open(e,n){v=null,I=e,X();const o=t.config().snapPoints.findIndex(t=>t.id===e);if(!n&&o>=0)return s=h(t.config().snapPoints[o].extent,o),F(s.extent),t.onRest(e);s=h(0,-1),F(t.closedExtent()),B({type:"snap-to",time:performance.now()+1e3,id:e,reason:"imperative"});const r=x;r&&W(i,e=>{x===r&&"settling"===s.phase&&(r.startTime=e,s={...s,startTime:e},t.onMotionStart(e))})},close(){const t=v;v="close",t||B({type:"close",time:performance.now()})},snapTo(t,e){"close"!==v&&(v=null,B({type:"snap-to",time:performance.now(),id:t,reason:e}))},nudge(){v||t.reducedMotion()||B({type:"nudge",time:performance.now()})},relayout(e,n){const o=t.config().snapPoints;if(v||null===I||"dragging"===s.phase||"pending"===s.phase)return F(c);const i=o.findIndex(t=>t.id===I),r=o.findIndex(t=>t.id===n),l=i>=0?i:r>=0?r:a(o.map(t=>t.extent),c),{id:u,extent:p}=o[l];if("idle"===s.phase&&(s=h(c,i),e||Math.abs(p-c)<.5)){if(s=h(p,l),F(p),!e)return;return u!==I&&j({type:"snap",id:u,reason:"content-resize"},performance.now()),t.onRest(u)}B({type:"snap-to",time:performance.now(),id:u,reason:"content-resize"})},target:()=>v?null:I,isMoving:()=>"idle"!==s.phase,destroy(){R=!0,X(),m&&i.cancelAnimationFrame(m),D.forEach(t=>t()),K.forEach(t=>t()),P&&t.onDragChange(!1);for(const t of["translate","user-select","opacity"])e.style.removeProperty(t)}}}var ct=t=>!t.closest('a[href], button, label, summary, [role="button"], [role="link"], [role="slider"], [tabindex]:not([tabindex="-1"])'),lt=()=>{},ut=new WeakSet,pt=new WeakMap,dt={duration:250,easing:"cubic-bezier(0.38, 0.7, 0.125, 1)"};function ft(t,e){const n=function(t){return{side:()=>"bottom",snapPoints:()=>["content"],snapPoint:()=>null,dismissible:()=>!0,modalAbove:()=>{},driver:()=>"auto",expandOnScroll:()=>!0,physics:()=>{},backdrop:()=>{},hostBackdrop:!1,outlets:()=>[],parent:()=>{},themeColor:()=>!1,preventEdgeSwipe:()=>!1,canMouseDrag:ct,onSnap:lt,onRest:lt,onDismissAttempt:lt,onDragChange:lt,onLayout:lt,...(e=t,Object.fromEntries(Object.entries(e).filter(([,t])=>void 0!==t)))};var e}(e),{host:i}=n,r=t.ownerDocument,s=r.defaultView??window,c=s.matchMedia?.("(prefers-reduced-motion: reduce)");let l,f,m,x=R(n.side(),t),y=[],v=0,b=I.ios;const w={snapPoints:[],dimension:0,dismissible:!0,expandOnScroll:!0,physics:b,contentScroll:T},M="bottom"===x&&function(t,e){const n=e.driver();return"auto"!==n?"scroll-snap"===n:void 0===e.modalAbove()&&e.expandOnScroll()&&!!t.matchMedia?.("(hover: none) and (pointer: coarse)").matches}(s,n);ut.add(t);const S=[mt(i,x,t),ht(t)];let P=[];const E=function(t){Q(t.sheet.ownerDocument);let e=[1],n=-1,o=[];const i=new Map,r={dim:0,progress:0,expand:0};let s;function a(t,o=r){return o.dim=G(function(t,e,n=-1){const o=n<0?0:e[n],i=n<0?e[0]:e[n+1];return void 0===i||i<=o?t>o?1:0:X((t-o)/(i-o))}(t,e,n)),o.progress=G(function(t,e){const n=e[e.length-1];return n>0?X(t/n):0}(t,e)),o.expand=G(function(t,e){const n=e[e.length-1],o=e.length>1?e[e.length-2]:0;return n<=o?t>=n?1:0:X((t-o)/(n-o))}(t,e)),o}let c=!1;function l(e,{rest:n=!1}={}){if(!c){x(),a(e),u(r.dim),f(t.sheet,r),d(r.progress);for(const e of t.outlets())f(e.el,r),e.keyframes&&m(e,r.expand,n);n&&t.themeColor?.(r.dim)}}function u(e){const n=t.backdrop();n&&(n.style.opacity=String(e));const o=p();o&&(o.currentTime=1e3*e)}function p(){return!t.dimmed||s||(s=t.dimmed.animate({opacity:[0,1]},{...J,duration:1e3,fill:"both"}),s.pause(),s.currentTime=0),s}function d(e){const n=t.ancestors();for(let t=0;t<n.length;t++)n[t].style.setProperty("--drawer-stack",String(t+e))}function f(t,{dim:e,progress:n,expand:o}){t.style.setProperty("--drawer-progress",String(n)),t.style.setProperty("--drawer-dim",String(e)),t.style.setProperty("--drawer-expand",String(o))}function m(t,e,n){let o=i.get(t.el);o||(o=t.el.animate(tt(t.keyframes),{duration:1e3,fill:"both"}),o.pause(),i.set(t.el,o)),o.currentTime=1e3*e,n&&(o.commitStyles?.(),o.cancel(),i.delete(t.el))}function h(e){if(c)return;if(x(),y(),!Z())return l("settle"===e.type?e.extentAt(e.duration):0,{rest:!0});const n=function(t){const e={dim:[],progress:[],expand:[]},n={dim:0,progress:0,expand:0},o="settle"===t.type?Math.max(2,Math.ceil(t.duration/q)+1):61;for(let i=0;i<o;i++){const r=i/(o-1);a("settle"===t.type?t.extentAt(Math.min(t.duration,i*q)):t.extentAt(r),n),e.dim.push(n.dim),e.progress.push(n.progress),e.expand.push(n.expand)}return e}(e);p();const i="settle"===e.type?{duration:Math.max(1,e.duration),fill:"both"}:{timeline:e.timeline,fill:"both"},r=(t,n,r,s)=>{const a=t.animate(n,{...i,...s,easing:K(r)});"settle"===e.type&&(a.startTime=e.startTime),o.push(a)},s=t.backdrop();s&&r(s,{opacity:[0,1]},n.dim),t.dimmed&&r(t.dimmed,{opacity:[0,1]},n.dim,J),g(t.sheet,n,r),t.ancestors().forEach((t,e)=>r(t,{"--drawer-stack":[e,e+1]},n.progress));for(const e of t.outlets())g(e.el,n,r),e.keyframes&&r(e.el,tt(e.keyframes),n.expand);if("settle"!==e.type)return;!function(e){const n=a(e,{dim:0,progress:0,expand:0});u(n.dim),f(t.sheet,n),d(n.progress);for(const e of t.outlets())if(f(e.el,n),e.keyframes)for(const[t,o]of Object.entries(e.keyframes)){const i=o[n.expand>=.5?o.length-1:0];e.el.style.setProperty(et(t),String(i))}t.themeColor?.(n.dim)}(e.extentAt(e.duration));const m=o;m[0]&&(m[0].onfinish=()=>o===m&&x())}function g(t,e,n){n(t,{"--drawer-progress":[0,1]},e.progress),n(t,{"--drawer-dim":[0,1]},e.dim),n(t,{"--drawer-expand":[0,1]},e.expand)}function x(){if(o.length){for(const t of o)t.cancel();o=[]}}function y(){for(const t of i.values())t.cancel();i.clear()}return{configure:function(t){e=t.snapExtents.length?t.snapExtents:[1],n=t.undimmedIndex},compute:a,apply:l,play:h,sync:function(t){for(const e of o)e.startTime=t},follow:h,stop:x,destroy:function(){c=!0,x(),y(),t.backdrop()?.style.removeProperty("opacity"),s?.cancel();for(const e of N.slice(0,3))t.sheet.style.removeProperty(e);for(const e of t.outlets()){for(const t of N.slice(0,3))e.el.style.removeProperty(t);for(const t of Object.keys(e.keyframes??{}))e.el.style.removeProperty(et(t))}}}}({sheet:t,backdrop:n.backdrop,dimmed:n.hostBackdrop?i:void 0,outlets:n.outlets,ancestors:()=>P,themeColor:t=>f?.write(t)});function F(){const t=n.physics();return t!==l&&(l=t,b=t?{...I.ios,...t}:I.ios),w.physics=b,w.dismissible=n.dismissible(),w.expandOnScroll=n.expandOnScroll(),w}function L(){const e=R(n.side(),t);e!==x&&(x=e,S[0](),S[0]=mt(i,x,t));const o=(V(x)?i.clientHeight:i.clientWidth)-(M?120:0);v=function(t,e){return V(e)?t.offsetHeight:t.offsetWidth}(t,x);const a=parseFloat(s.getComputedStyle(r.documentElement).fontSize)||16,c=function(t,e){const n=t.map((t,n)=>({value:t,index:n,extent:Math.min(A(t,e),e.content)})).filter(t=>t.extent>0).sort((t,e)=>t.extent-e.extent||t.index-e.index),o=[];for(const t of n){const e=k(t.value),n=o[o.length-1];n&&t.extent-n.extent<1?(n.ids.push(e),t.index>n.index&&Object.assign(n,{id:e,value:t.value,index:t.index}),n.extent=Math.max(n.extent,t.extent)):o.push({id:e,value:t.value,extent:Math.round(100*t.extent)/100,ids:[e],index:t.index})}return o.map(({index:t,...e})=>e)}(n.snapPoints(),{container:o,content:v,rootFontSize:a});c.length||c.push({id:"content",value:"content",extent:v,ids:["content"]});const l=o!==w.dimension||c.length!==y.length||c.some((t,e)=>t.id!==y[e].id||Math.abs(t.extent-y[e].extent)>=.5);return y=c,w.dimension=o,w.snapPoints=y.map(({id:t,extent:e})=>({id:t,extent:e})),E.configure({snapExtents:w.snapPoints.map(t=>t.extent),undimmedIndex:C(y,n.modalAbove())}),l&&function(){if(!U)return n.onLayout({side:x,snapPoints:y});queueMicrotask(()=>O||n.onLayout({side:x,snapPoints:y}))}(),l}let O=!1;const H=t=>null===t?null:y.find(e=>e.id===t)?.value??null,_={sheet:t,host:i,side:()=>x,config:F,size:()=>v,closedExtent:()=>B(x),reducedMotion:()=>!!c?.matches,owns:e=>function(t){for(let e=t instanceof Element?t:null;e;){if(ut.has(e))return e;const t=e.getRootNode();e=e.parentElement??(t instanceof ShadowRoot?t.host:null)}return null}(e)===t,canMouseDrag:n.canMouseDrag,onSnap:(t,e,o)=>{const i=H(t);null!==i&&n.onSnap(i,e,o)},onRest(t){if(O)return;const e=y.find(e=>e.id===t);E.apply(e?.extent??B(x),{rest:!0}),n.onRest(H(t)),ft&&null!==t&&gt(),ft=!1},onDismiss:n.onDismiss,onDismissAttempt:n.onDismissAttempt,onDragChange:n.onDragChange,isInteractive:t=>yt.isInteractiveAt(H(t)),onFrame:t=>O||E.apply(t),onMotion:t=>O||E.play(t),onMotionStart:t=>O||E.sync(t)};let U=!0;L(),F();const nt=M?function(t){const{sheet:e,host:n}=t,i=e.ownerDocument,r=i.defaultView??window;let s=h(0,-1),c=0,l=[],f=null,m=!1,x=!1,y=!1,v=null,b=0,w=0,M=null;const S=new Map;let P=null;const E=j(n,{inset:"0 0 calc(var(--keyboard-inset, 0px) - 120px) 0",display:"block","overflow-y":"scroll","overflow-x":"hidden","scroll-snap-type":"y mandatory","scrollbar-width":"none","overscroll-behavior":"contain","pointer-events":"auto"}),T=j(e,{position:"absolute",left:"0",right:"0"}),I="onscrollend"in n,k=r.ScrollTimeline,A=[(0,o.on)(n,"scroll",function(){f||v||(P&&m&&Math.abs(n.scrollTop-P.offsetTop)>1&&B(),m&&!y&&z(!0),k||(w||=r.requestAnimationFrame(L)),r.clearTimeout(b),I||m||(b=r.setTimeout(H,120)))},{passive:!0}),...I?[(0,o.on)(n,"scrollend",H)]:[],(0,o.on)(n,"touchstart",()=>{m=!0,x=!1,f&&!v&&function(){if(!f)return;const t=Math.max(0,f.extentAt(performance.now()-f.startTime)-c);q(),P=F(t,"start"),n.append(P),n.scrollTop=t,L(),_()}()},{passive:!0}),(0,o.on)(n,"touchend",O,{passive:!0}),(0,o.on)(n,"touchcancel",O,{passive:!0})],C=new IntersectionObserver(function(e){e[e.length-1].isIntersecting||f||v||null===M||!t.config().dismissible||(v="swipe",M=null,t.onDismiss())},{root:n,rootMargin:"0px 0px -1px 0px",threshold:0});C.observe(e);const D=()=>t.config().snapPoints.at(-1)?.extent??0,Y=()=>D()+24-c,R=()=>Math.min(n.scrollTop+c,D());function V(){const o=t.config();c=o.dismissible?-120:o.snapPoints[0].extent,e.style.top=t.config().dimension-c+"px";for(const t of l)t.remove();const i=o.snapPoints.map(t=>t.extent),r=o.dismissible?[c,...i]:i;l=r.map(t=>F(t-c,"start")),l.push(F(Y()+n.clientHeight-1,"none")),n.append(...l);for(const t of S.keys())e.contains(t)||S.delete(t);for(const t of function(t){const e=t.ownerDocument.defaultView??window;return Array.from(t.querySelectorAll("*")).filter(t=>/auto|scroll/.test(e.getComputedStyle(t).overflowY))}(e))S.has(t)||S.set(t,[t.style.getPropertyValue("overflow-y"),t.style.getPropertyPriority("overflow-y")])}function F(t,e){const n=i.createElement("div");return n.setAttribute("aria-hidden","true"),n.style.cssText=`position:absolute;left:0;width:1px;height:1px;top:${t}px;scroll-snap-align:${e};pointer-events:none`,n}function L(){w=0,t.onFrame(R())}function O(){if(m=!1,z(!1),P){B();const e=t.config().snapPoints,n=a(e.map(t=>t.extent),R());return Q(e[n].id,"swipe")}!t.config().dismissible&&n.scrollTop<-2&&t.onDismissAttempt(),!x&&I||(b=r.setTimeout(H,120)),x=!1}function z(e){y!==e&&(y=e,t.onDragChange(e))}function H(){if(m)return void(x=!0);if(f||v)return;const e=t.config(),n=g(s,{type:"rest",extent:R()},e);s=n.state;for(const e of n.effects)"snap"===e.type&&(M=e.id,t.onSnap(e.id,e.reason));s.restingIndex>=0&&N(e.snapPoints[s.restingIndex].id)}function B(){P?.remove(),P=null}function X(o,i,r,s){q();const a=t.config().physics,l=u(a.response,a.dampingRatio,i-o,0),m=Math.max(1,p(l)),h=Math.max(c,o);n.scrollTop=h-c;const g=t=>o+l.position(Math.max(0,t)),x=Math.abs(o-i)<.5,y=!x&&!Z(),v=e.animate({translate:y?$({duration:m,extentAt:g},t=>`0 ${h-t}px`):[`0 ${h-i}px`,`0 ${h-o}px`]},{duration:m,easing:x||y?"linear":d(l,i,o,m),fill:"both"});v.startTime=r,f={animation:v,to:o,extentAt:g,startTime:r},t.onMotion({type:"settle",extentAt:g,startTime:r,duration:m}),v.onfinish=()=>{f?.animation===v&&(f=null,s(),v.cancel())}}function q(){f?.animation.cancel(),f=null}function N(e){const o=t.config(),i=o.snapPoints.findIndex(t=>t.id===e);s=h(o.snapPoints[i].extent,i),M=e,n.style.pointerEvents=t.isInteractive(e)?"none":"auto";const r=i===o.snapPoints.length-1;for(const[t,[e,n]]of S)r?t.style.setProperty("overflow-y",e,n):t.style.overflowY="hidden";t.onRest(e),_()}function _(){if(!k)return;const e=Y(),o=new k({source:n,axis:"block"});t.onMotion({type:"timeline",timeline:o,extentAt:t=>Math.min(D(),t*e+c)})}function Q(e,n){const o=t.config().snapPoints.find(t=>t.id===e);if(!o||"close"===v)return;v=null,e!==M&&(M=e,t.onSnap(e,n));const i=f?f.extentAt(performance.now()-f.startTime):R();X(o.extent,i,performance.now(),()=>N(e))}return{open(e,o){v=null,M=e,V();const i=t.config().snapPoints.find(t=>t.id===e);if(!i)return;if(!o)return n.scrollTop=i.extent-c,N(e);X(i.extent,-120,performance.now()+1e3,()=>N(e));const s=f;W(r,e=>{s&&f===s&&(s.animation.startTime=e,s.startTime=e,t.onMotionStart(e))})},close(){const e=v;v="close",e||(M=null,X(-120,f?f.extentAt(performance.now()-f.startTime):R(),performance.now(),()=>t.onRest(null)))},snapTo:Q,nudge(){if(v||t.reducedMotion()||null===M)return;const e=t.config().snapPoints.find(t=>t.id===M);e&&X(e.extent,e.extent-20,performance.now(),()=>N(e.id))},relayout(e,o){if(v||m)return;const i=t.config().snapPoints,r=i.findIndex(t=>t.id===M),s=i.findIndex(t=>t.id===o),l=r>=0?r:s>=0?s:a(i.map(t=>t.extent),R()),u=c;V();const p=i[l];if(p.id!==M&&(M=p.id,t.onSnap(p.id,"content-resize")),f){const t=f,e=performance.now();return void(t.to===p.extent&&c===u||(X(p.extent,t.extentAt(e-t.startTime),Math.max(e,t.startTime),()=>N(p.id)),f=Object.assign(t,f)))}n.scrollTop=p.extent-c,N(p.id)},target:()=>v?null:M,isMoving:()=>!!f||y,destroy(){q(),B(),r.clearTimeout(b),w&&r.cancelAnimationFrame(w),C.disconnect(),A.forEach(t=>t());for(const t of l)t.remove();for(const[t,[e,n]]of S)t.style.setProperty("overflow-y",e,n);y&&t.onDragChange(!1),e.style.removeProperty("top"),T(),E()}}}(_):at(_);t.setAttribute("data-driver",M?"scroll-snap":"pointer"),U=!1;const ot=new ResizeObserver(()=>{xt(!1)});ot.observe(t),ot.observe(i);let it=0,rt=s.visualViewport?.height,st=null;const pt=[(0,D.NQ)(i,{before:()=>it=t.getBoundingClientRect().top,after:function(){xt(!0),gt();const e=s.visualViewport?.height;if(e===rt)return;rt=e,st?.cancel(),st=null;const n=it-t.getBoundingClientRect().top;Math.abs(n)<1||c?.matches||(st=i.animate({translate:[`0 ${n}px`,"0 0"]},dt))}}),...n.preventEdgeSwipe()?[(0,o.on)(r,"touchstart",function(t){if(!t.cancelable)return;const e=t.touches[0];if(!e||e.clientX>24&&e.clientX<s.innerWidth-24)return;const o=t.target;o&&(i.contains(o)||n.backdrop()?.contains(o))&&t.preventDefault()},{capture:!0,passive:!1})]:[],...(0,Y.un)()?[(0,o.on)(r,"touchend",function(e){const n=e.target;(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)&&t.contains(n)&&n!==r.activeElement&&!nt.isMoving()&&e.cancelable&&(e.preventDefault(),n.focus({preventScroll:!0}))},{capture:!0,passive:!1})]:[],(0,o.on)(t,"focusin",function(){nt.isMoving()?ft=!0:gt()})];let ft=!1;function gt(){const e=r.activeElement;if(!(e instanceof HTMLElement&&t.contains(e)&&e!==t))return;const n=z(e,t,"bottom");if(!n)return;const o=s.visualViewport,i=Math.min(n.getBoundingClientRect().bottom,o?o.offsetTop+o.height:s.innerHeight),{top:a,bottom:l}=e.getBoundingClientRect(),u=n.getBoundingClientRect().top,p=l+16>i?l+16-i:a-16<u?a-16-u:0;p&&n.scrollBy({top:p,behavior:c?.matches?"instant":"smooth"})}function xt(t){L()&&nt.relayout(t,y[C(y,n.snapPoint())]?.id)}const yt={element:t,parent:n.parent,open(t){if(O)return;P=[];for(let t=n.parent();t;t=t.parent())P.push(t.element);L(),F(),n.themeColor()&&(f??=function(t,e){const n=Array.from(t.querySelectorAll('meta[name="theme-color"]')),o=n.map(t=>t.content),i=o.map(e=>function(t){const e=/^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)/.exec(t);return e?[e[1],e[2],e[3]].map(Number):null}(function(t,e){const n=t.createElement("span");n.style.color=e,n.style.display="none",t.body.append(n);const o=t.defaultView?.getComputedStyle(n).color??e;return n.remove(),o}(t,e)));let r=-1;return{write:function(t){const s=Math.round(t*e*100)/100;s!==r&&(r=s,n.forEach((t,e)=>{const n=i[e];n&&(t.content=s?`rgb(${n.map(t=>Math.round(t*(1-s))).join(" ")})`:o[e])}))},restore:function(){n.forEach((t,e)=>t.content=o[e]),r=-1}}}(r,b.dim)),t&&E.apply(B(x)),m?.();const e=n.backdrop();m=e&&j(e,{"will-change":"opacity"}),nt.open(function(t){const e=C(y,t);return y[e>=0?e:0]?.id}(n.snapPoint()),t)},close:()=>O||nt.close(),snapTo(t,e){const n=C(y,t);n>=0&&y[n].id!==nt.target()&&nt.snapTo(y[n].id,e)},nudge:()=>nt.nudge(),snapPoints:()=>y,target:()=>H(nt.target()),isInteractiveAt:t=>function(t,e,n){const o=C(t,n),i=C(t,e);return o>=0&&i>=0&&i<=o}(y,t,n.modalAbove()),refresh(){xt(!1)},destroy(){O=!0,ot.disconnect(),st?.cancel(),pt.forEach(t=>t()),nt.destroy(),E.destroy(),m?.(),f?.restore(),S.forEach(t=>t()),t.removeAttribute("data-driver"),ut.delete(t)}};return yt}function mt(t,e,n){const o=V(e),i="rtl"===n.ownerDocument.defaultView?.getComputedStyle(t).direction;return j(t,{position:"fixed",inset:"0 0 var(--keyboard-inset, 0px) 0",width:"auto",height:"auto","max-width":"none","max-height":"none",margin:"0",padding:"0",border:"0",background:"transparent",color:"inherit",overflow:"visible",display:"flex","flex-direction":o?"column":"row","justify-content":"bottom"===e||"right"===e!==i?"flex-end":"flex-start","pointer-events":"none"})}function ht(t){return j(t,{"pointer-events":"auto","overscroll-behavior":"contain","will-change":"translate"})}function gt(t,e,n){if(n.drillIn)return function(t,e,n){let o;const r=e.bind(t,{...n,position:void 0,inline:!0,onShow(){const[e,r]=n.drillIn();return e&&(o=function(t,e){const n=[],o=t=>{for(const r of Array.from(t.children))e.includes(r)||(e.some(t=>t&&r.contains(t))?o(r):r instanceof HTMLElement&&n.push((0,i.eC)(r,"display","none")))};return o(t),()=>n.forEach(t=>t())}(e,[t,r])),()=>o?.()},onClose(){o?.(),o=(0,i.eC)(t,"display","none")}});return()=>{r(),o?.()}}(t,e,n);const r=t.parentElement;if(!r)return;let s;return function(t){const e=t.getAttribute("data-slot");e&&(0,i.Vg)(t.ownerDocument,`ui-sdk-sheet-${e}`,`@layer ui-sdk { :where([data-slot="${e}"])::backdrop { background: var(--sheet-backdrop, rgb(0 0 0 / 0.2)); pointer-events: auto } }`)}(r),e.bind(t,{...n,position:void 0,host:()=>r,onShow(i){const a=function(t,e,n,i,r){let s=null;const a=function(t){for(let e=t.parent;e;e=e.parent){const t=pt.get(e);if(t)return t}}(r),c=!i.backdrop?.(),l=ft(t,{host:e,snapPoints:()=>i.snapPoints??["content"],snapPoint:()=>s,backdrop:i.backdrop,hostBackdrop:c,dismissible:i.dismissible,onDismissAttempt:i.onDismissAttempt,parent:()=>a?.(),onSnap:t=>s=t,onDismiss(t){n.requestClose("swipe",t),requestAnimationFrame(()=>{const t=s??l.snapPoints()[0]?.value;r.active()&&void 0!==t&&l.snapTo(t,"imperative")})}});pt.set(r,()=>l),i.onSheet?.(l);const u=(0,o.on)(t,"focusin",t=>{const e=l.snapPoints().at(-1);e&&l.snapPoints().length>1&&t.target.matches("input, textarea")&&l.snapTo(e.value,"imperative")}),p=c?getComputedStyle(t).getPropertyValue("--sheet-backdrop"):"transparent";return p&&e.style.setProperty("--sheet-backdrop",p),r.active()&&l.open("initial"!==n.opener()),{sheet:l,hide(){u(),pt.delete(r),l.destroy(),i.onSheet?.(void 0),e.style.removeProperty("--sheet-backdrop")}}}(t,r,e,n,i);return s=a.sheet,()=>{a.hide(),s=void 0}},onClose:()=>s?.close()})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkblue_web=self.webpackChunkblue_web||[]).push([[776],{776(e,t,i){i.d(t,{announce:()=>s});var n=new WeakMap,r={};function s(e,{priority:t="polite",doc:i=("undefined"==typeof document?void 0:document)}={}){if(!e)return;if(!i?.body)return;const s=function(e,t){let i=n.get(e);i||n.set(e,i={});const r=i[t];if(r?.isConnected)return r;const s=e.createElement("div");return s.setAttribute("role","assertive"===t?"alert":"status"),s.setAttribute("aria-live",t),s.setAttribute("aria-atomic","true"),s.setAttribute("data-ui-sdk-announcer","assertive"===t?"assertive":""),s.style.cssText="position:fixed;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap",e.body.append(s),i[t]=s,s}(i,t);s.textContent="",clearTimeout(r[t]),r[t]=setTimeout(()=>{s.textContent=e},100)}}}]);
@@ -1,59 +1,50 @@
1
- export function init(actionsElement) {
2
- let menu = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
3
- let collapseMenu = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
4
- const targetElement = actionsElement.parentElement || actionsElement;
5
- if (!menu) menu = actionsElement.querySelector(".blue-actions-menu");
6
- if (!collapseMenu) collapseMenu = actionsElement.querySelector(".blue-actions-collapse-menu");
7
- function updateActions() {
8
- // reset
9
- for (const item of menu.children) {
10
- ;
11
- item.style.display = "none";
12
- }
13
- for (const item of collapseMenu.children) {
14
- ;
15
- item.style.display = "";
16
- item.classList.add("blue-actions-collapse-visible");
17
- }
18
- let i = 0;
19
- for (const item of menu.children) {
20
- ;
21
- item.style.display = "";
22
- collapseMenu.children[i].style.display = "none";
23
- collapseMenu.children[i].classList.remove("blue-actions-collapse-visible");
24
- if (targetElement.scrollWidth > targetElement.clientWidth) {
25
- ;
26
- item.style.display = "none";
27
- collapseMenu.children[i].style.display = "";
28
- collapseMenu.children[i].classList.add("blue-actions-collapse-visible");
29
- break;
30
- }
31
- i++;
32
- }
33
- }
34
- updateActions();
35
- const callback = () => {
36
- requestAnimationFrame(updateActions);
37
- };
38
- const resizeObserver = new ResizeObserver(callback);
39
- resizeObserver.observe(targetElement);
40
- const mutationObserver = new MutationObserver(callback);
41
- mutationObserver.observe(targetElement, {
42
- attributes: false,
43
- childList: true,
44
- subtree: true
45
- });
46
- return {
47
- updateActions,
48
- resizeObserver,
49
- mutationObserver,
50
- destroy() {
51
- resizeObserver.disconnect();
52
- mutationObserver.disconnect();
53
- }
54
- };
1
+ // src/js/actions.ts
2
+ function init(actionsElement, menu = void 0, collapseMenu = void 0) {
3
+ const targetElement = actionsElement.parentElement || actionsElement;
4
+ if (!menu) menu = actionsElement.querySelector(".blue-actions-menu");
5
+ if (!collapseMenu) collapseMenu = actionsElement.querySelector(".blue-actions-collapse-menu");
6
+ function updateActions() {
7
+ for (const item of menu.children) item.style.display = "none";
8
+ for (const item of collapseMenu.children) {
9
+ item.style.display = "";
10
+ item.classList.add("blue-actions-collapse-visible");
11
+ }
12
+ let i = 0;
13
+ for (const item of menu.children) {
14
+ item.style.display = "";
15
+ collapseMenu.children[i].style.display = "none";
16
+ collapseMenu.children[i].classList.remove("blue-actions-collapse-visible");
17
+ if (targetElement.scrollWidth > targetElement.clientWidth) {
18
+ item.style.display = "none";
19
+ collapseMenu.children[i].style.display = "";
20
+ collapseMenu.children[i].classList.add("blue-actions-collapse-visible");
21
+ break;
22
+ }
23
+ i++;
24
+ }
25
+ }
26
+ updateActions();
27
+ const callback = () => {
28
+ requestAnimationFrame(updateActions);
29
+ };
30
+ const resizeObserver = new ResizeObserver(callback);
31
+ resizeObserver.observe(targetElement);
32
+ const mutationObserver = new MutationObserver(callback);
33
+ mutationObserver.observe(targetElement, {
34
+ attributes: false,
35
+ childList: true,
36
+ subtree: true
37
+ });
38
+ return {
39
+ updateActions,
40
+ resizeObserver,
41
+ mutationObserver,
42
+ destroy() {
43
+ resizeObserver.disconnect();
44
+ mutationObserver.disconnect();
45
+ }
46
+ };
55
47
  }
56
48
  window.blueWeb = window.blueWeb || {};
57
- window.blueWeb.actions = {
58
- init
59
- };
49
+ window.blueWeb.actions = { init };
50
+ export { init };
@@ -1,37 +1,31 @@
1
- export const getStored = () => localStorage.getItem("blue-web-color-mode");
2
- export const getPreferred = () => {
3
- const stored = getStored();
4
- if (stored) {
5
- return stored;
6
- }
7
- return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
1
+ // src/js/color-mode.ts
2
+ var getStored = () => localStorage.getItem("blue-web-color-mode");
3
+ var getPreferred = () => {
4
+ const stored = getStored();
5
+ if (stored) return stored;
6
+ return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
8
7
  };
9
- export const set = colorMode => {
10
- if (colorMode === "auto") {
11
- localStorage.removeItem("blue-web-color-mode");
12
- } else {
13
- localStorage.setItem("blue-web-color-mode", colorMode);
14
- }
15
- init();
8
+ var set = (colorMode) => {
9
+ if (colorMode === "auto") localStorage.removeItem("blue-web-color-mode");
10
+ else localStorage.setItem("blue-web-color-mode", colorMode);
11
+ init();
16
12
  };
17
- export const init = () => {
18
- const colorMode = getPreferred();
19
- if (colorMode === "auto" && window.matchMedia("(prefers-color-scheme: dark)").matches) {
20
- document.documentElement.setAttribute("data-bs-theme", "dark");
21
- } else {
22
- document.documentElement.setAttribute("data-bs-theme", colorMode);
23
- }
13
+ var init = () => {
14
+ const colorMode = getPreferred();
15
+ if (colorMode === "auto" && window.matchMedia("(prefers-color-scheme: dark)").matches) document.documentElement.setAttribute("data-bs-theme", "dark");
16
+ else document.documentElement.setAttribute("data-bs-theme", colorMode);
24
17
  };
25
- const onMatchMediaChange = () => {
26
- localStorage.removeItem("blue-web-color-mode");
27
- init();
18
+ var onMatchMediaChange = () => {
19
+ localStorage.removeItem("blue-web-color-mode");
20
+ init();
28
21
  };
29
22
  window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", onMatchMediaChange);
30
23
  init();
31
24
  window.blueWeb = window.blueWeb || {};
32
25
  window.blueWeb.colorMode = {
33
- getStored,
34
- getPreferred,
35
- set,
36
- init
37
- };
26
+ getStored,
27
+ getPreferred,
28
+ set,
29
+ init
30
+ };
31
+ export { getPreferred, getStored, init, set };
package/dist/js/dialog.js CHANGED
@@ -1,72 +1,90 @@
1
1
  import { guid } from "./utils.js";
2
2
  import { getPhrase } from "./shared.js";
3
- export async function ask(text) {
4
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
5
- return await dialog("ask", text, options);
3
+ // src/js/dialog.ts
4
+ async function ask(text, options = {}) {
5
+ return await dialog("ask", text, options);
6
6
  }
7
- export async function tell(text) {
8
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
9
- await dialog("tell", text, options);
7
+ async function tell(text, options = {}) {
8
+ await dialog("tell", text, options);
10
9
  }
11
- export async function verify(text) {
12
- let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
13
- return (await dialog("verify", text, options)) === true;
10
+ async function verify(text, options = {}) {
11
+ return await dialog("verify", text, options) === true;
14
12
  }
15
- async function dialog(dialogType, text) {
16
- let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
17
- let _ref = typeof options === "string" ? JSON.parse(options) : options,
18
- _ref$title = _ref.title,
19
- title = _ref$title === void 0 ? getPhrase(dialogType === "verify" ? "Confirm" : dialogType === "ask" ? "Question" : "Message") : _ref$title,
20
- _ref$icon = _ref.icon,
21
- icon = _ref$icon === void 0 ? undefined : _ref$icon,
22
- _ref$switchPrimaryBtn = _ref.switchPrimaryBtn,
23
- switchPrimaryBtn = _ref$switchPrimaryBtn === void 0 ? false : _ref$switchPrimaryBtn,
24
- _ref$acceptBtnText = _ref.acceptBtnText,
25
- acceptBtnText = _ref$acceptBtnText === void 0 ? "OK" : _ref$acceptBtnText,
26
- _ref$cancelBtnText = _ref.cancelBtnText,
27
- cancelBtnText = _ref$cancelBtnText === void 0 ? getPhrase("Cancel") : _ref$cancelBtnText,
28
- _ref$inputType = _ref.inputType,
29
- inputType = _ref$inputType === void 0 ? "text" : _ref$inputType,
30
- defaultValue = _ref.defaultValue,
31
- id = _ref.id;
32
- const _id = id || guid();
33
- const addToDom = () => {
34
- document.body.insertAdjacentHTML("beforeend", /* HTML */"<dialog class=\"blue-modal modal\" id=\"".concat(_id, "\" aria-labelledby=\"").concat(_id, "-label\">\n <div class=\"modal-dialog\">\n <div class=\"modal-content\">\n <form>\n <div class=\"modal-header\">\n ").concat(icon ? /* html */"<div class=\"me-2\">".concat(icon, "</div>") : "", "\n <h1 class=\"modal-title fs-5\" id=\"").concat(_id, "-label\">").concat(title, "</h1>\n </div>\n <div class=\"modal-body\">\n ").concat(dialogType === "ask" ? /* HTML */"<label for=\"".concat(_id, "-input\" class=\"blue-label\">").concat(text, "</label>\n <input\n type=\"").concat(inputType, "\"\n ").concat(defaultValue !== undefined ? " value=\"".concat(defaultValue, "\"") : "", "\n id=\"").concat(_id, "-input\"\n class=\"form-control\"\n />") : text, "\n </div>\n <div class=\"modal-footer\">\n ").concat(dialogType === "verify" || dialogType === "ask" ? /* HTML */"<button\n type=\"button\"\n class=\"btn ".concat(switchPrimaryBtn ? "btn-primary" : "blue-btn-plain-primary", "\"\n onclick=\"document.getElementById('").concat(_id, "').close()\"\n >\n ").concat(cancelBtnText, "\n </button>") : "", "\n <button\n type=\"submit\"\n class=\"btn ").concat(switchPrimaryBtn ? "blue-btn-plain-primary" : "btn-primary", "\"\n >\n ").concat(acceptBtnText, "\n </button>\n </div>\n </form>\n </div>\n </div>\n\n <form method=\"dialog\" class=\"blue-modal-backdrop\">\n <button>").concat(cancelBtnText, "</button>\n </form>\n </dialog>"));
35
- };
36
- if (!document.getElementById(_id)) {
37
- addToDom();
38
- }
39
- return new Promise(resolve => {
40
- var _modalEl$querySelecto;
41
- const modalEl = document.getElementById(_id);
42
- const removeFromDom = () => {
43
- const modalEl = document.getElementById(_id);
44
- if (modalEl) {
45
- modalEl.remove();
46
- }
47
- };
48
- const onHidden = () => {
49
- removeFromDom();
50
- resolve(false);
51
- };
52
- modalEl === null || modalEl === void 0 || modalEl.showModal();
53
- modalEl === null || modalEl === void 0 || modalEl.addEventListener("close", onHidden);
54
- modalEl === null || modalEl === void 0 || (_modalEl$querySelecto = modalEl.querySelector(".modal-content > form")) === null || _modalEl$querySelecto === void 0 || _modalEl$querySelecto.addEventListener("submit", e => {
55
- e.preventDefault();
56
- if (dialogType === "ask") {
57
- modalEl.close();
58
- removeFromDom();
59
- resolve((modalEl === null || modalEl === void 0 ? void 0 : modalEl.querySelector("input")).value || "");
60
- }
61
- modalEl.close();
62
- removeFromDom();
63
- resolve(true);
64
- });
65
- });
13
+ async function dialog(dialogType, text, options = {}) {
14
+ let { title = getPhrase(dialogType === "verify" ? "Confirm" : dialogType === "ask" ? "Question" : "Message"), icon = void 0, switchPrimaryBtn = false, acceptBtnText = "OK", cancelBtnText = getPhrase("Cancel"), inputType = "text", defaultValue, id } = typeof options === "string" ? JSON.parse(options) : options;
15
+ const _id = id || guid();
16
+ const addToDom = () => {
17
+ document.body.insertAdjacentHTML("beforeend", `<dialog class="blue-modal modal" id="${_id}" aria-labelledby="${_id}-label">
18
+ <div class="modal-dialog">
19
+ <div class="modal-content">
20
+ <form>
21
+ <div class="modal-header">
22
+ ${icon ? `<div class="me-2">${icon}</div>` : ""}
23
+ <h1 class="modal-title fs-5" id="${_id}-label">${title}</h1>
24
+ </div>
25
+ <div class="modal-body">
26
+ ${dialogType === "ask" ? `<label for="${_id}-input" class="blue-label">${text}</label>
27
+ <input
28
+ type="${inputType}"
29
+ ${defaultValue !== void 0 ? ` value="${defaultValue}"` : ""}
30
+ id="${_id}-input"
31
+ class="form-control"
32
+ />` : text}
33
+ </div>
34
+ <div class="modal-footer">
35
+ ${dialogType === "verify" || dialogType === "ask" ? `<button
36
+ type="button"
37
+ class="btn ${switchPrimaryBtn ? "btn-primary" : "blue-btn-plain-primary"}"
38
+ onclick="document.getElementById('${_id}').close()"
39
+ >
40
+ ${cancelBtnText}
41
+ </button>` : ""}
42
+ <button
43
+ type="submit"
44
+ class="btn ${switchPrimaryBtn ? "blue-btn-plain-primary" : "btn-primary"}"
45
+ >
46
+ ${acceptBtnText}
47
+ </button>
48
+ </div>
49
+ </form>
50
+ </div>
51
+ </div>
52
+
53
+ <form method="dialog" class="blue-modal-backdrop">
54
+ <button>${cancelBtnText}</button>
55
+ </form>
56
+ </dialog>`);
57
+ };
58
+ if (!document.getElementById(_id)) addToDom();
59
+ return new Promise((resolve) => {
60
+ const modalEl = document.getElementById(_id);
61
+ const removeFromDom = () => {
62
+ const modalEl = document.getElementById(_id);
63
+ if (modalEl) modalEl.remove();
64
+ };
65
+ const onHidden = () => {
66
+ removeFromDom();
67
+ resolve(false);
68
+ };
69
+ modalEl?.showModal();
70
+ modalEl?.addEventListener("close", onHidden);
71
+ modalEl?.querySelector(".modal-content > form")?.addEventListener("submit", (e) => {
72
+ e.preventDefault();
73
+ if (dialogType === "ask") {
74
+ modalEl.close();
75
+ removeFromDom();
76
+ resolve((modalEl?.querySelector("input")).value || "");
77
+ }
78
+ modalEl.close();
79
+ removeFromDom();
80
+ resolve(true);
81
+ });
82
+ });
66
83
  }
67
84
  window.blueWeb = window.blueWeb || {};
68
85
  window.blueWeb.dialog = {
69
- ask,
70
- tell,
71
- verify
72
- };
86
+ ask,
87
+ tell,
88
+ verify
89
+ };
90
+ export { ask, tell, verify };
@@ -1,56 +1,53 @@
1
+ // src/js/edit-view.ts
1
2
  /**
2
- * EditView is a Custom Element that displays a edit view of its content and allows the user to confirm or dismiss the changes.
3
- */
4
- export class EditView extends HTMLElement {
5
- connectedCallback() {
6
- this.render();
7
- }
8
- disconnectedCallback() {
9
- if (this.confirmTimeout) {
10
- clearTimeout(this.confirmTimeout);
11
- }
12
- }
13
- render() {
14
- const root = document.createElement("form");
15
- root.style.position = "relative";
16
- const children = Array.from(this.childNodes);
17
- this.appendChild(root);
18
- children.forEach(child => root.appendChild(child));
19
- root.addEventListener("submit", this.onSubmit.bind(this));
20
- root.addEventListener("keydown", this.onKeydown.bind(this));
21
- root.addEventListener("focusout", this.onFocusout.bind(this));
22
- }
23
- onSubmit(e) {
24
- e.preventDefault();
25
- this.confirm();
26
- }
27
- onKeydown(e) {
28
- if (e.key === "Esc" || e.key === "Escape") {
29
- this.dismiss();
30
- }
31
- }
32
- onFocusout(e) {
33
- if (!this.contains(e.relatedTarget)) {
34
- if (this.confirmTimeout) {
35
- clearTimeout(this.confirmTimeout);
36
- }
37
- this.confirmTimeout = setTimeout(() => {
38
- this.confirm();
39
- this.confirmTimeout = null;
40
- }, 500);
41
- }
42
- }
43
- confirm() {
44
- this.dispatchEvent(new CustomEvent("Confirm", {
45
- bubbles: true,
46
- composed: true
47
- }));
48
- }
49
- dismiss() {
50
- this.dispatchEvent(new CustomEvent("Dismiss", {
51
- bubbles: true,
52
- composed: true
53
- }));
54
- }
55
- }
56
- customElements.define("edit-view", EditView);
3
+ * EditView is a Custom Element that displays a edit view of its content and allows the user to confirm or dismiss the changes.
4
+ */
5
+ var EditView = class extends HTMLElement {
6
+ confirmTimeout;
7
+ connectedCallback() {
8
+ this.render();
9
+ }
10
+ disconnectedCallback() {
11
+ if (this.confirmTimeout) clearTimeout(this.confirmTimeout);
12
+ }
13
+ render() {
14
+ const root = document.createElement("form");
15
+ root.style.position = "relative";
16
+ const children = Array.from(this.childNodes);
17
+ this.appendChild(root);
18
+ children.forEach((child) => root.appendChild(child));
19
+ root.addEventListener("submit", this.onSubmit.bind(this));
20
+ root.addEventListener("keydown", this.onKeydown.bind(this));
21
+ root.addEventListener("focusout", this.onFocusout.bind(this));
22
+ }
23
+ onSubmit(e) {
24
+ e.preventDefault();
25
+ this.confirm();
26
+ }
27
+ onKeydown(e) {
28
+ if (e.key === "Esc" || e.key === "Escape") this.dismiss();
29
+ }
30
+ onFocusout(e) {
31
+ if (!this.contains(e.relatedTarget)) {
32
+ if (this.confirmTimeout) clearTimeout(this.confirmTimeout);
33
+ this.confirmTimeout = setTimeout(() => {
34
+ this.confirm();
35
+ this.confirmTimeout = null;
36
+ }, 500);
37
+ }
38
+ }
39
+ confirm() {
40
+ this.dispatchEvent(new CustomEvent("Confirm", {
41
+ bubbles: true,
42
+ composed: true
43
+ }));
44
+ }
45
+ dismiss() {
46
+ this.dispatchEvent(new CustomEvent("Dismiss", {
47
+ bubbles: true,
48
+ composed: true
49
+ }));
50
+ }
51
+ };
52
+ customElements.define("edit-view", EditView);
53
+ export { EditView };