@pglejzer/datepicker-ui 1.0.0 → 1.1.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.
@@ -1 +1 @@
1
- const e=`dp-ui-`,t=/^(\d{4})-(\d{2})-(\d{2})$/;function n(e){return e%4==0&&e%100!=0||e%400==0}function r(e,t){return t===2?n(e)?29:28:t===4||t===6||t===9||t===11?30:31}function i(e,t,n){let r=t<=2?e-1:e,i=Math.floor(r/400),a=r-i*400,o=t>2?t-3:t+9,s=Math.floor((153*o+2)/5)+n-1,c=a*365+Math.floor(a/4)-Math.floor(a/100)+s;return i*146097+c-719468}function a(e){let t=e+719468,n=Math.floor(t/146097),r=t-n*146097,i=Math.floor((r-Math.floor(r/1460)+Math.floor(r/36524)-Math.floor(r/146096))/365),a=r-(365*i+Math.floor(i/4)-Math.floor(i/100)),o=Math.floor((5*a+2)/153),s=a-Math.floor((153*o+2)/5)+1,c=o<10?o+3:o-9;return{year:i+n*400+ +(c<=2),month:c,day:s}}function o(e){switch((e%7+7)%7){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3;case 4:return 4;case 5:return 5;default:return 6}}function s(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(n)||e<1||e>9999||t<1||t>12?!1:n>=1&&n<=r(e,t)}function c(e,t,n){return s(e,t,n)?{year:e,month:t,day:n}:null}function l(e){return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}}function u(e){let t=new Date(2e3,0,1);return t.setFullYear(e.year,e.month-1,e.day),t.setHours(0,0,0,0),t}function d(e){let n=t.exec(e);return n?c(Number(n[1]),Number(n[2]),Number(n[3])):null}function f(e){return`${String(e.year).padStart(4,`0`)}-${String(e.month).padStart(2,`0`)}-${String(e.day).padStart(2,`0`)}`}function p(e,t){return e.year===t.year?e.month===t.month?e.day-t.day:e.month-t.month:e.year-t.year}function m(e,t){return e===null||t===null?!1:p(e,t)===0}function h(e,t){return a(i(e.year,e.month,e.day)+t)}function g(e,t){return i(t.year,t.month,t.day)-i(e.year,e.month,e.day)}function _(e,t){let n=e.year*12+(e.month-1)+t,r=Math.floor(n/12);return{year:r,month:n-r*12+1}}function v(e,t){return t.year*12+t.month-(e.year*12+e.month)}function y(e){return r(e.year,e.month)}function b(e){return o(i(e.year,e.month,e.day)+4)}function x(){return l(/* @__PURE__ */ new Date)}function S(e){return e===`today`?x():typeof e==`string`?d(e):Number.isNaN(e.getTime())?null:l(e)}function C(e){let t=i(e.year,e.month,e.day),n=(b(e)+6)%7+1,r=t+4-n,o=a(r).year,s=i(o,1,1);return Math.floor((r-s)/7)+1}const w=e=>{let t=e.mode===`range`&&e.presets>0;if(e.surface===`modal`||e.fullscreen||e.precision!==`day`)return{months:1,presets:t?`row`:`none`};let n=336+(e.weekNumbers&&e.mode!==`range`?48:0),r=(e,t)=>e*n+(e-1)*24+24+(t?168:0)+32,i=t&&r(1,!0)<=e.width,a=1;for(let t=2;t<=e.months;t+=1)r(t,i)<=e.width&&(a=t);let o=`none`;return i?o=`column`:t&&(o=`row`),{months:a,presets:o}},T=(e,t,n)=>{if(n!==`day`)return!1;switch(e){case`single`:return t===`modal`;case`range`:return!0;case`multiple`:return!1}},E=e=>{switch(e){case`day`:return`days`;case`month`:return`month-grid`;case`year`:return`year-grid`}},D=(e,t)=>{let n=t!==`modal`;switch(e){case`day`:return`days`;case`month`:return n?`month-menu`:`month-grid`;case`year`:return n?`year-menu`:`year-grid`}},O=(e,t,n,r)=>t?`inline`:e===`auto`?n<600||r<480?`modal`:`docked`:e,k=(e,t,n,r)=>e===`range`&&t===`modal`&&n<r,ee=/* @__PURE__ */ new Set([`/`,`.`,`-`,` `]),te=/[‎‏؜]/g,ne=/^(d{1,2}|M{1,2}|yyyy|yy)([/. -])(d{1,2}|M{1,2}|yyyy|yy)\2(d{1,2}|M{1,2}|yyyy|yy)$/,re=/^(M{1,2}|yyyy|yy)([/. -])(M{1,2}|yyyy|yy)$/,A=/* @__PURE__ */ new Map;function ie(e){return e.startsWith(`d`)?`day`:e.startsWith(`M`)?`month`:`year`}function ae(e){let t=ne.exec(e);if(!t)return null;let n=[t[1],t[3],t[4]],r=n.map(ie);return new Set(r).size===3?{order:r,separator:t.at(2)??`/`,padDay:n.includes(`dd`),padMonth:n.includes(`MM`),yearDigits:n.includes(`yy`)?2:4}:null}function oe(e){let t=re.exec(e);if(!t)return null;let n=[t[1],t[3]],[r,i]=n.map(ie);return r===i?null:{order:r===`month`?[`day`,`month`,`year`]:[`year`,`month`,`day`],separator:t.at(2)??`/`,padDay:!0,padMonth:n.includes(`MM`),yearDigits:n.includes(`yy`)?2:4}}function se(e){return e!==`yyyy`&&e!==`yy`?null:{order:[`month`,`day`,`year`],separator:`/`,padDay:!0,padMonth:!0,yearDigits:e===`yy`?2:4}}function j(e,t){let n=ae(e);if(n!==null||t===`day`)return n;let r=oe(e);return r!==null||t===`month`?r:se(e)}function ce(e,t=`day`){return e===`auto`||j(e.trim(),t)!==null}function le(e){let t={day:`2-digit`,month:`2-digit`,year:`numeric`,numberingSystem:`latn`,timeZone:`UTC`};try{return new Intl.DateTimeFormat(e,t)}catch{return new Intl.DateTimeFormat(`en-US`,t)}}function ue(e){let t=le(e).formatToParts(new Date(Date.UTC(2024,10,22,12))),n=[],r=``;for(let e of t)e.type===`day`||e.type===`month`||e.type===`year`?n.push(e.type):e.type===`literal`&&r===``&&(r=e.value.replace(te,``).trim());return{order:n.length===3?n:[`month`,`day`,`year`],separator:ee.has(r)?r:`/`,padDay:!0,padMonth:!0,yearDigits:4}}function de(e,t,n=`day`){let r=`${e}|${t}|${n}`,i=A.get(r);if(i)return i;let a=(e===`auto`?null:j(e.trim(),n))??ue(t);return A.set(r,a),a}function fe(e,t,n){switch(t){case`day`:return n.padDay?String(e.day).padStart(2,`0`):String(e.day);case`month`:return n.padMonth?String(e.month).padStart(2,`0`):String(e.month);default:return n.yearDigits===2?String(e.year%100).padStart(2,`0`):String(e.year).padStart(4,`0`)}}const pe={day:`dd`,month:`mm`,year:`yyyy`};function me(e){return{day:e.hintDay,month:e.hintMonth,year:e.hintYear}}function he(e,t=pe){return e.order.map(n=>n===`day`?t.day:n===`month`?t.month:e.yearDigits===2?t.year.slice(0,2):t.year).join(e.separator)}function ge(e,t){return t.order.map(n=>fe(e,n,t)).join(t.separator)}function M(){return typeof document<`u`}function N(){return typeof window>`u`}const _e=/[٠-٩۰-۹]/g,ve=/[‎‏؜]/g,P=/[\s./-]+/,F=/^\d+$/,ye=/^\d{8}$/;function be(e){let t=e.charCodeAt(0);return String(t-(t>=1776?1776:1632))}function I(e){return e.replace(ve,``).replace(_e,be).trim()}function xe(e,t){if(ye.test(e)){let n=[],r=0;for(let i of t){let t=i===`year`?4:2;n.push(e.slice(r,r+t)),r+=t}return n}let n=e.split(P).filter(e=>e!==``);return n.length!==3||!n.every(e=>F.test(e))?null:n}function Se(e){let t=I(e).split(P).filter(e=>e!==``);return t.every(e=>F.test(e))?t:null}function L(e){if(e.length===4)return Number(e);if(e.length!==2)return null;let t=2e3+Number(e);return t<=x().year+20?t:1900+Number(e)}function Ce(e,t){let n=xe(I(e),t.order);if(n===null)return null;let r=0,i=0,a=0;for(let[e,o]of t.order.entries()){let t=n[e]??``;if(o===`year`)a=L(t);else if(t.length>2)return null;else o===`day`?r=Number(t):i=Number(t)}return a===null?null:c(a,i,r)}function we(e,t){return e===null?null:typeof e==`string`?M()?t?.querySelector(e)??document.querySelector(e):null:e}function R(e,t,n){let r=document.createElement(e);return t&&(r.className=t),n&&Object.entries(n).forEach(([e,t])=>{r.setAttribute(e,t)}),r}function Te(e,t,n){let r=e.getBoundingClientRect(),i=t.getBoundingClientRect();n===`center`?e.scrollTop+=i.top-r.top-(r.height-i.height)/2:i.top<r.top?e.scrollTop+=i.top-r.top:i.bottom>r.bottom&&(e.scrollTop+=i.bottom-r.bottom)}function Ee(e,t,n){let r=R(`button`,e,{type:`button`});return n?(r.setAttribute(`aria-label`,t),r.innerHTML=n):r.textContent=t,r}const z=`(prefers-color-scheme: dark)`,De=/^(rgba?|color|oklch|oklab|lab|lch)\(([^)]*)\)$/,Oe=/[\s,/]+/,ke=[`class`,`style`,`data-theme`,`data-color-scheme`],B=e=>Math.min(1,Math.max(0,e)),V=e=>{let t=B(e);return t<=.04045?t/12.92:((t+.055)/1.055)**2.4},Ae=(e,t,n)=>.2126*V(e)+.7152*V(t)+.0722*V(n),H=(e,t)=>{if(e===`none`)return 0;let n=parseFloat(e);return e.endsWith(`%`)?n/100*t:n},je=(e,t)=>{let n=+(e===`color`);if(e===`color`&&t[0]!==`srgb`)return null;let r=H(t[n]??``,e===`lab`||e===`lch`?100:1);switch(e){case`rgb`:case`rgba`:case`color`:{let r=e===`color`?1:255,[i=NaN,a=NaN,o=NaN]=[0,1,2].map(e=>H(t[n+e]??``,r)/r);return Ae(i,a,o)}case`oklab`:case`oklch`:return B(r)**3;default:return B((r+16)/116)**3}};function Me(e){let t=e.trim().toLowerCase();if(t===`transparent`)return{luminance:0,alpha:0};let n=De.exec(t),r=n?.[1],i=n?.[2];if(r===void 0||i===void 0)return null;let a=i.split(Oe).filter(e=>e!==``),o=r===`color`?4:3,s=a.length>o?H(a[o],1):1,c=je(r,a);return c===null||Number.isNaN(c)||Number.isNaN(s)?null:{luminance:c,alpha:B(s)}}const Ne=()=>{let e=getComputedStyle(document.documentElement).getPropertyValue(`color-scheme`);return e.includes(`dark`)?e.includes(`light`)?window.matchMedia(z).matches?`dark`:`light`:`dark`:`light`};function Pe(e){if(N()||!M())return`light`;let t=e;for(;t!==null;){let e=Me(getComputedStyle(t).backgroundColor);if(e!==null&&e.alpha>=.5)return e.luminance<.179?`dark`:`light`;t=t.parentElement}return Ne()}function Fe(e){if(N()||!M())return()=>void 0;let t=()=>{e()},n=new MutationObserver(t),r={attributes:!0,attributeFilter:ke};n.observe(document.documentElement,r),n.observe(document.body,r);let i=window.matchMedia(z);return i.addEventListener(`change`,t),()=>{n.disconnect(),i.removeEventListener(`change`,t)}}const U={PAGER_SETTLE:350,DOCKED_HEIGHT:300,SELECT_FILL:150,HEADLINE_FADE:50,RIPPLE:450,SURFACE_ENTER:300,SURFACE_ENTER_FADE:100,SURFACE_ACTIONS_DELAY:150,SURFACE_EXIT:150,SCRIM_ENTER:150,SCRIM_EXIT:200,PANEL_FADE_OUT:100,PANEL_FADE_IN:200,WHEEL_SETTLE:90,VIEW_SWITCH:300,VIEW_SWITCH_FADE_OUT:75,VIEW_SWITCH_FADE_IN:150,REDUCED_FADE:150,SNAP_SCROLL_FALLBACK:700},Ie={DRAG_START_PX:6,COMMIT_FRACTION:.25,FLICK_VELOCITY:.4,VELOCITY_SAMPLES:5,MIN_SAMPLE_SPAN_MS:1},Le={EMPHASIZED:`cubic-bezier(0.2, 0, 0, 1)`,EMPHASIZED_DECELERATE:`cubic-bezier(0.05, 0.7, 0.1, 1)`,EMPHASIZED_ACCELERATE:`cubic-bezier(0.3, 0, 0.8, 0.15)`},W=`--dp-ui-scrollbar-gap`,Re=[`auto`,`scroll`];let G=0,K=[],q=``;const ze=e=>Re.includes(window.getComputedStyle(e).overflowY);function J(e){let{style:t}=e,n=e.clientWidth,r=parseFloat(window.getComputedStyle(e).paddingRight)||0;K.push({element:e,overflow:t.overflow,paddingRight:t.paddingRight}),t.overflow=`hidden`;let i=Math.max(0,e.clientWidth-n);return i>0&&(t.paddingRight=`${String(r+i)}px`),i}function Be(){if(G===0){let{body:e,documentElement:t}=document,n=ze(e)?J(e):0,r=J(t);q=t.style.getPropertyValue(W),t.style.setProperty(W,`${String(Math.max(n,r))}px`)}G+=1}function Ve(){if(G===0||(--G,G>0))return;K.forEach(({element:e,overflow:t,paddingRight:n})=>{e.style.overflow=t,e.style.paddingRight=n});let e=document.documentElement;q?e.style.setProperty(W,q):e.style.removeProperty(W),K=[],q=``}function He(){if(!M())return()=>void 0;Be();let e=!1;return()=>{e||(e=!0,Ve())}}const Ue=e=>{let t=getComputedStyle(e).getPropertyValue(`--dp-ui-motion-surface-exit`).trim();return t.endsWith(`ms`)&&parseFloat(t)===0};function Y(e){if(Ue(e))return Promise.resolve();if(typeof e.getAnimations!=`function`)return new Promise(e=>{setTimeout(e,U.SURFACE_EXIT)});let t=e.getAnimations({subtree:!0});return Promise.allSettled(t.map(e=>e.finished)).then(()=>void 0)}var We=class{root;body;dialog;controller=new AbortController;allowPageScroll;releaseScroll=null;openPromise=null;closePromise=null;pointerStartedOnBackdrop=!1;destroyed=!1;constructor(e){this.allowPageScroll=e.allowPageScroll,this.dialog=R(`dialog`,`dp-ui__dialog`,{"aria-label":e.label}),this.body=R(`div`,`dp-ui__container dp-ui__container--modal`),this.root=this.dialog,this.dialog.appendChild(this.body),e.parent.appendChild(this.dialog);let{signal:t}=this.controller;this.dialog.addEventListener(`cancel`,t=>{t.preventDefault(),!this.closePromise&&e.onCancel(`escape`)},{signal:t}),this.dialog.addEventListener(`pointerdown`,e=>{this.pointerStartedOnBackdrop=e.target===this.dialog},{signal:t}),this.dialog.addEventListener(`click`,t=>{let n=this.pointerStartedOnBackdrop&&t.target===this.dialog;this.pointerStartedOnBackdrop=!1,n&&!this.closePromise&&e.onCancel(`outside`)},{signal:t})}open(){return this.openPromise||(this.openPromise=Promise.resolve(),this.destroyed)||(this.allowPageScroll||(this.releaseScroll=He()),this.dialog.showModal()),this.openPromise}close(){return this.closePromise||=(this.dialog.open&&this.dialog.close(),Y(this.dialog).then(()=>{this.unlock()})),this.closePromise}destroy(){this.destroyed||(this.destroyed=!0,this.controller.abort(),this.unlock(),this.dialog.remove())}unlock(){this.releaseScroll?.(),this.releaseScroll=null}},Ge=class{root;body;constructor(e){this.root=R(`div`,`dp-ui__container dp-ui__container--inline`,{role:`group`,"aria-label":e.label}),this.body=this.root,e.container.appendChild(this.root)}open(){return Promise.resolve()}close(){return Promise.resolve()}destroy(){this.root.remove()}};const X=`anchor-name`,Ke=e=>typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`position-try-fallbacks`,`flip-block`)&&typeof e.showPopover==`function`,qe=e=>`--dp-ui-anchor-${e.replace(/[^\w-]/g,`-`)}`,Je=(e,t,n)=>{let{style:r}=t,i=r.getPropertyValue(X);return r.setProperty(X,n),e.style.setProperty(`--dp-ui-anchor-name`,n),e.setAttribute(`data-positioning`,`anchor`),()=>{i?r.setProperty(X,i):r.removeProperty(X)}},Ye=(e,t,n)=>{let r=t.getBoundingClientRect(),i=e.offsetWidth;return n?r.right-i<0:r.left+i>e.ownerDocument.documentElement.clientWidth},Xe=(e,t)=>{let n=e.getBoundingClientRect().top<t.getBoundingClientRect().top;e.setAttribute(`data-placement`,n?`top`:`bottom`)},Z=(e,t)=>Math.round(e*t)/t;function Ze({anchor:e,contentWidth:t,pickerHeight:n,minHeight:r,layoutWidth:i,viewport:a,tokens:o,request:s,rtl:c,pixelRatio:l}){let{gap:u,minWidth:d,maxWidth:f,edgeMargin:p}=o,{offsetLeft:m,offsetTop:h}=a,g=Z(Math.min(Math.max(e.width,d,t),f,i-2*p),l),_=h+p,v=e.top-u-_,y=h+a.height-p-e.bottom-u,b=(s===`auto`?n<=y||!(n<=v)&&y>=v?`bottom`:`top`:s)===`top`,x=b?v:y,S=x<Math.min(n,r)&&(b?y:v)>x?!b:b,C=S?`top`:`bottom`,w=S?v:y,T=n>w?Math.max(w,0):null,E=T??n,D=S?e.top-u-E:e.bottom+u,O=c?e.right-g:e.left,k=Math.max(Math.min(O,m+a.width-g-p),m+p);return{top:Z(Math.max(D,_),l),left:Z(k,l),width:g,placement:C,availableHeight:T}}const Qe=`--dp-ui-popover-top`,Q=`--dp-ui-popover-left`,$e=`--dp-ui-popover-available-height`,$=(e,t,n)=>{e.style.setProperty(`max-width`,`var(--dp-ui-${t})`);let r=getComputedStyle(e).getPropertyValue(`max-width`),i=r.endsWith(`px`)?parseFloat(r):NaN;return i>=0?i:n},et=e=>{let t=R(`div`);t.style.cssText=`position:absolute;visibility:hidden;pointer-events:none`,e.appendChild(t);let n={gap:$(t,`popover-gap`,4),edgeMargin:$(t,`popover-edge-margin`,4),minHeight:$(t,`popover-min-height`,160)};return t.remove(),n},tt=(e,t,n)=>{let r=null;return{enable:()=>{let{style:t}=e;t.setProperty(`position`,`fixed`),t.setProperty(`margin`,`0`),t.setProperty(`inset`,`auto`),t.setProperty(`top`,`var(${Qe})`),t.setProperty(`left`,`var(${Q})`),e.setAttribute(`data-positioning`,`fallback`)},layout:()=>{r??=et(e);let i=e.ownerDocument.documentElement;e.style.removeProperty($e);let a=t.getBoundingClientRect(),o=e.offsetWidth,{top:s,left:c,placement:l,availableHeight:u}=Ze({anchor:{top:a.top,bottom:a.bottom,left:a.left,right:a.right,width:0},contentWidth:o,pickerHeight:e.offsetHeight,minHeight:r.minHeight,layoutWidth:i.clientWidth,viewport:window.visualViewport??{width:i.clientWidth,height:i.clientHeight,offsetLeft:0,offsetTop:0},tokens:{gap:r.gap,edgeMargin:r.edgeMargin,minWidth:0,maxWidth:o},request:`auto`,rtl:n,pixelRatio:window.devicePixelRatio||1});e.style.setProperty(Qe,`${String(s)}px`),e.style.setProperty(Q,`${String(c)}px`),u!==null&&e.style.setProperty($e,`${String(u)}px`),e.setAttribute(`data-placement`,l)}}},nt=e=>{document.addEventListener(`pointerdown`,t=>{if(e.isIgnored())return;let n=t.composedPath();e.inside.some(e=>n.includes(e))||e.onOutside()},{capture:!0,signal:e.signal})},rt=(e,t,n)=>{let r=new AbortController,{signal:i}=r,a=0,o=()=>{a===0&&(a=requestAnimationFrame(()=>{a=0,i.aborted||n()}))};if(window.addEventListener(`resize`,o,{signal:i}),window.addEventListener(`scroll`,t=>{let{target:n}=t;n instanceof Node&&e.contains(n)||o()},{capture:!0,signal:i}),window.visualViewport?.addEventListener(`resize`,o,{signal:i}),window.visualViewport?.addEventListener(`scroll`,o,{signal:i}),typeof ResizeObserver<`u`){let n=new ResizeObserver(o);n.observe(t),n.observe(e),i.addEventListener(`abort`,()=>{n.disconnect()})}return i.addEventListener(`abort`,()=>{cancelAnimationFrame(a),a=0}),()=>{r.abort()}};var it=class{root;body;anchor;anchorName;rtl;fallback;controller=new AbortController;stopTracking=null;restoreAnchor=null;hasPopover;anchored=!1;openPromise=null;closePromise=null;destroyed=!1;constructor(e){this.anchor=e.anchor,this.rtl=e.rtl,this.anchorName=qe(e.instanceId),this.root=R(`div`,`dp-ui__container dp-ui__container--docked`,{role:`dialog`,"aria-modal":`false`,"aria-label":e.label,"data-placement":`bottom`}),this.body=this.root,this.fallback=tt(this.root,this.anchor,e.rtl),this.hasPopover=typeof this.root.showPopover==`function`,this.hasPopover?this.root.setAttribute(`popover`,`manual`):this.root.style.display=`none`,e.host.appendChild(this.root);let{signal:t}=this.controller;nt({inside:[this.root,this.anchor,...e.inside],signal:t,isIgnored:()=>e.ignoreOutsideClick||this.closePromise!==null,onOutside:()=>{e.onOutside()}}),this.root.addEventListener(`keydown`,t=>{t.key!==`Escape`||t.defaultPrevented||this.closePromise||e.onEscape()},{signal:t})}open(){return this.openPromise||(this.openPromise=Promise.resolve(),this.destroyed)||(this.show(),this.update(),this.stopTracking=rt(this.root,this.anchor,()=>{this.update()})),this.openPromise}close(){return this.closePromise||=(this.endTracking(),this.hide(),Y(this.root)),this.closePromise}destroy(){this.destroyed||(this.destroyed=!0,this.endTracking(),this.controller.abort(),this.restoreAnchor?.(),this.restoreAnchor=null,this.root.remove())}endTracking(){this.stopTracking?.(),this.stopTracking=null}show(){if(!this.hasPopover)this.root.style.removeProperty(`display`),this.enableFallback();else{try{this.root.showPopover()}catch{this.hasPopover=!1,this.root.removeAttribute(`popover`),this.enableFallback();return}Ke(this.root)?(this.restoreAnchor=Je(this.root,this.anchor,this.anchorName),this.anchored=!0):this.enableFallback()}}hide(){if(!this.hasPopover)this.root.style.display=`none`;else try{this.root.hidePopover()}catch{this.root.removeAttribute(`popover`),this.hasPopover=!1,this.root.style.display=`none`}}enableFallback(){this.fallback.enable(),this.anchored=!1}update(){this.anchored&&Ye(this.root,this.anchor,this.rtl)&&this.enableFallback(),this.anchored?Xe(this.root,this.anchor):this.fallback.layout()}};const at=/^\d$/,ot=/* @__PURE__ */ new Set([`/`,`.`,`-`,` `]);function st(e,t){return e===`year`?t.yearDigits:2}function ct(e,t){let{order:n}=t,r=n.map(e=>st(e,t)),i=[``];for(let t of I(e)){let e=i.length-1,a=r[e]??0,o=i[e]??``;if(at.test(t)){if(o.length>=a){if(i.length===n.length)break;i.push(t)}else i[e]=o+t}else ot.has(t)&&o!==``&&(i[e]=o.padStart(a,`0`),i.length<n.length&&i.push(``))}return i.filter(e=>e!==``).join(t.separator)}export{T as A,C as B,ce as C,O as D,k as E,b as F,x as G,u as H,g as I,e as K,y as L,_ as M,p as N,w as O,c as P,d as R,me as S,E as T,f as U,v as V,S as W,Ce as _,Y as a,ge as b,U as c,Ee as d,R as f,L as g,Se as h,We as i,h as j,D as k,Pe as l,Te as m,it as n,Le as o,we as p,Ge as r,Ie as s,ct as t,Fe as u,M as v,de as w,he as x,N as y,m as z};
1
+ const e=`dp-ui-`,t=/^(\d{4})-(\d{2})-(\d{2})$/;function n(e){return e%4==0&&e%100!=0||e%400==0}function r(e,t){return t===2?n(e)?29:28:t===4||t===6||t===9||t===11?30:31}function i(e,t,n){let r=t<=2?e-1:e,i=Math.floor(r/400),a=r-i*400,o=t>2?t-3:t+9,s=Math.floor((153*o+2)/5)+n-1,c=a*365+Math.floor(a/4)-Math.floor(a/100)+s;return i*146097+c-719468}function a(e){let t=e+719468,n=Math.floor(t/146097),r=t-n*146097,i=Math.floor((r-Math.floor(r/1460)+Math.floor(r/36524)-Math.floor(r/146096))/365),a=r-(365*i+Math.floor(i/4)-Math.floor(i/100)),o=Math.floor((5*a+2)/153),s=a-Math.floor((153*o+2)/5)+1,c=o<10?o+3:o-9;return{year:i+n*400+ +(c<=2),month:c,day:s}}function o(e){switch((e%7+7)%7){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3;case 4:return 4;case 5:return 5;default:return 6}}function s(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(n)||e<1||e>9999||t<1||t>12?!1:n>=1&&n<=r(e,t)}function c(e,t,n){return s(e,t,n)?{year:e,month:t,day:n}:null}function l(e){return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}}function u(e){let t=new Date(2e3,0,1);return t.setFullYear(e.year,e.month-1,e.day),t.setHours(0,0,0,0),t}function d(e){let n=t.exec(e);return n?c(Number(n[1]),Number(n[2]),Number(n[3])):null}function f(e){return`${String(e.year).padStart(4,`0`)}-${String(e.month).padStart(2,`0`)}-${String(e.day).padStart(2,`0`)}`}function p(e,t){return e.year===t.year?e.month===t.month?e.day-t.day:e.month-t.month:e.year-t.year}function m(e,t){return e===null||t===null?!1:p(e,t)===0}function h(e,t){return a(i(e.year,e.month,e.day)+t)}function g(e,t){return i(t.year,t.month,t.day)-i(e.year,e.month,e.day)}function _(e,t){let n=e.year*12+(e.month-1)+t,r=Math.floor(n/12);return{year:r,month:n-r*12+1}}function v(e,t){return t.year*12+t.month-(e.year*12+e.month)}function y(e){return r(e.year,e.month)}function b(e){return o(i(e.year,e.month,e.day)+4)}function x(){return l(/* @__PURE__ */ new Date)}function S(e){return e===`today`?x():typeof e==`string`?d(e):Number.isNaN(e.getTime())?null:l(e)}function ee(e){let t=i(e.year,e.month,e.day),n=(b(e)+6)%7+1,r=t+4-n,o=a(r).year,s=i(o,1,1);return Math.floor((r-s)/7)+1}const C={headline:!0,navigation:`menus`,announceSelection:!0},w=e=>{let t=e.mode===`range`&&e.presets>0;if(e.layout!==`docked`||e.precision!==`day`)return{months:1,presets:t?`row`:`none`};let n=336+(e.weekNumbers&&e.mode!==`range`?48:0),r=(e,t)=>e*n+(e-1)*24+24+(t?168:0)+32,i=t&&r(1,!0)<=e.width,a=1;for(let t=2;t<=e.months;t+=1)r(t,i)<=e.width&&(a=t);let o=`none`;return i?o=`column`:t&&(o=`row`),{months:a,presets:o}},te=(e,t,n)=>{if(n!==`day`)return!1;switch(e){case`single`:return t!==`docked`;case`range`:return!0;case`multiple`:return!1}},ne=e=>{switch(e){case`day`:return`days`;case`month`:return`month-grid`;case`year`:return`year-grid`}},re=(e,t)=>{let n=t===`docked`;switch(e){case`day`:return`days`;case`month`:return n?`month-menu`:`month-grid`;case`year`:return n?`year-menu`:`year-grid`}},ie=(e,t,n,r)=>t?`inline`:e===`auto`?n<600||r<480?`modal`:`docked`:e,ae=(e,t,n,r)=>e===`range`&&t===`modal`&&n<r,oe=(e,t,n)=>{let{mode:r,layout:i}=t;return i===`docked`?`docked`:i===`fullscreen`?r===`range`&&e!==`docked`?`fullscreen`:`modal`:e===`modal`?ae(r,e,n,t.fullscreenBelow)?`fullscreen`:`modal`:i===`modal`?`modal`:`docked`},se=(e,t)=>e===`inline`?t:C,ce=(e,t)=>e??t!==`inline`;function le(e){let t=[...e].sort(p);return t.filter((e,n)=>n===0||p(t[n-1],e)!==0)}function T(e){switch(e){case`single`:return{mode:e,date:null};case`range`:return{mode:e,start:null,end:null};default:return{mode:e,dates:[]}}}function E(e){switch(e.mode){case`single`:return e.date?[e.date]:[];case`range`:return[e.start,e.end].filter(e=>e!==null);default:return e.dates}}function ue(e){return E(e).length===0}function de(e){return e.mode!==`range`||e.start===null==(e.end===null)}function fe(e,t){return e===null||t===null?e===t:p(e,t)===0}function pe(e,t){if(e.mode!==t.mode)return!1;let n=E(e),r=E(t);return n.length===r.length?e.mode===`range`&&t.mode===`range`?fe(e.start,t.start)&&fe(e.end,t.end):n.every((e,t)=>p(e,r[t])===0):!1}function me(e,t){return E(e).some(e=>m(e,t))}function he(e,t){return e.mode!==`range`||e.start===null||e.end===null||p(e.start,e.end)>=0?null:m(e.start,t)?`start`:m(e.end,t)?`end`:p(t,e.start)>0&&p(t,e.end)<0?`in-range`:null}function ge(e,t){return e.mode===`range`&&e.start!==null&&e.end===null&&m(e.start,t)?`start`:he(e,t)}function _e(e){return E(e).at(0)??null}const ve=/* @__PURE__ */ new Set([`/`,`.`,`-`,` `]),ye=/[‎‏؜]/g,be=/^(d{1,2}|M{1,2}|yyyy|yy)([/. -])(d{1,2}|M{1,2}|yyyy|yy)\2(d{1,2}|M{1,2}|yyyy|yy)$/,xe=/^(M{1,2}|yyyy|yy)([/. -])(M{1,2}|yyyy|yy)$/,Se=/* @__PURE__ */ new Map;function Ce(e){return e.startsWith(`d`)?`day`:e.startsWith(`M`)?`month`:`year`}function we(e){let t=be.exec(e);if(!t)return null;let n=[t[1],t[3],t[4]],r=n.map(Ce);return new Set(r).size===3?{order:r,separator:t.at(2)??`/`,padDay:n.includes(`dd`),padMonth:n.includes(`MM`),yearDigits:n.includes(`yy`)?2:4}:null}function Te(e){let t=xe.exec(e);if(!t)return null;let n=[t[1],t[3]],[r,i]=n.map(Ce);return r===i?null:{order:r===`month`?[`day`,`month`,`year`]:[`year`,`month`,`day`],separator:t.at(2)??`/`,padDay:!0,padMonth:n.includes(`MM`),yearDigits:n.includes(`yy`)?2:4}}function Ee(e){return e!==`yyyy`&&e!==`yy`?null:{order:[`month`,`day`,`year`],separator:`/`,padDay:!0,padMonth:!0,yearDigits:e===`yy`?2:4}}function De(e,t){let n=we(e);if(n!==null||t===`day`)return n;let r=Te(e);return r!==null||t===`month`?r:Ee(e)}function Oe(e,t=`day`){return e===`auto`||De(e.trim(),t)!==null}function ke(e){let t={day:`2-digit`,month:`2-digit`,year:`numeric`,numberingSystem:`latn`,timeZone:`UTC`};try{return new Intl.DateTimeFormat(e,t)}catch{return new Intl.DateTimeFormat(`en-US`,t)}}function Ae(e){let t=ke(e).formatToParts(new Date(Date.UTC(2024,10,22,12))),n=[],r=``;for(let e of t)e.type===`day`||e.type===`month`||e.type===`year`?n.push(e.type):e.type===`literal`&&r===``&&(r=e.value.replace(ye,``).trim());return{order:n.length===3?n:[`month`,`day`,`year`],separator:ve.has(r)?r:`/`,padDay:!0,padMonth:!0,yearDigits:4}}function je(e,t,n=`day`){let r=`${e}|${t}|${n}`,i=Se.get(r);if(i)return i;let a=(e===`auto`?null:De(e.trim(),n))??Ae(t);return Se.set(r,a),a}function Me(e,t,n){switch(t){case`day`:return n.padDay?String(e.day).padStart(2,`0`):String(e.day);case`month`:return n.padMonth?String(e.month).padStart(2,`0`):String(e.month);default:return n.yearDigits===2?String(e.year%100).padStart(2,`0`):String(e.year).padStart(4,`0`)}}const Ne={day:`dd`,month:`mm`,year:`yyyy`};function Pe(e){return{day:e.hintDay,month:e.hintMonth,year:e.hintYear}}function Fe(e,t=Ne){return e.order.map(n=>n===`day`?t.day:n===`month`?t.month:e.yearDigits===2?t.year.slice(0,2):t.year).join(e.separator)}function D(e,t){return t.order.map(n=>Me(e,n,t)).join(t.separator)}function O(){return typeof document<`u`}function k(){return typeof window>`u`}const Ie=new Set(`AG AS BD BR BS BT BW BZ CA CO DM DO ET GT GU HK HN ID IL IN IS JM JP KE KH KR LA MH MM MO MT MX MZ NI NP PA PE PH PK PR PT PY SA SG SV TH TT TW UM US VE VI WS YE ZA ZW`.split(` `)),Le=new Set(`AF BH DJ DZ EG IQ IR JO KW LY OM QA SD SY`.split(` `)),Re=/* @__PURE__ */ new Set([`MV`]),ze=/* @__PURE__ */ new Map,Be=/* @__PURE__ */ new Map;function Ve(e,t){let n=Be.get(t);if(n)return n.format(e);let r=new Intl.NumberFormat(t,{useGrouping:!1});return Be.set(t,r),r.format(e)}function A(e,t){let n=`${e}|${JSON.stringify(t)}`,r=ze.get(n);if(r)return r;let i=new Intl.DateTimeFormat(e,{...t,timeZone:`UTC`});return ze.set(n,i),i}function j(e,t,n){let r=new Date(Date.UTC(2e3,0,1,12));return r.setUTCFullYear(e,t-1,n),r}function He(e){switch(e){case 0:return 0;case 1:return 1;case 2:return 2;case 3:return 3;case 4:return 4;case 5:return 5;case 6:return 6;default:return null}}function Ue(e){if(!(`getWeekInfo`in e))return null;let t=Reflect.get(e,`getWeekInfo`);if(typeof t!=`function`)return null;let n=Reflect.apply(t,e,[]);if(typeof n!=`object`||!n||!(`firstDay`in n))return null;let r=n.firstDay;return typeof r==`number`?He(r===7?0:r):null}function We(e){return e===void 0?1:Ie.has(e)?0:Le.has(e)?6:Re.has(e)?5:1}function Ge(e){try{let t=new Intl.Locale(e),n=Ue(t);return n===null?We(t.maximize().region):n}catch{return 1}}function Ke(e){try{return Intl.getCanonicalLocales(e).length>0}catch{return!1}}const M=e=>{let t=e?.trim();return!t||!Ke(t)?null:t};function qe(e){let t=M(e);if(t!==null)return t;if(O()){let e=M(document.documentElement.lang);if(e!==null)return e}if(typeof navigator<`u`){let e=M(navigator.language);if(e!==null)return e}return`en-US`}function Je(e,t){let n=A(e,{month:t});return Array.from({length:12},(e,t)=>n.format(j(2024,t+1,1)))}function Ye(e,t){let n=A(e,{weekday:t});return Array.from({length:7},(e,t)=>n.format(j(2024,1,7+t)))}function Xe(e,t){return A(t,{weekday:`short`,month:`short`,day:`numeric`}).format(j(e.year,e.month,e.day))}function Ze(e,t){return A(t,{month:`short`,day:`numeric`}).format(j(e.year,e.month,e.day))}function Qe(e,t,n){return A(n,{month:`short`,day:`numeric`}).formatRange(j(e.year,e.month,e.day),j(t.year,t.month,t.day))}function $e(e,t,n={}){let r={weekday:`long`,month:`long`,day:`numeric`};return A(t,n.year===!1?r:{...r,year:`numeric`}).format(j(e.year,e.month,e.day))}function N(e,t){return A(t,{month:`long`,year:`numeric`}).format(j(e.year,e.month,1))}function et(e,t,n){return e.year===t.year&&e.month===t.month?N(e,n):A(n,{month:`long`,year:`numeric`}).formatRange(j(e.year,e.month,1),j(t.year,t.month,1))}function tt(e,t,n,r){switch(t){case`day`:return r===`headline`?Xe(e,n):$e(e,n);case`month`:return N(e,n);default:return Ve(e.year,n)}}function nt(e,t){switch(t){case`sunday`:return 0;case`monday`:return 1;case`saturday`:return 6;default:return Ge(e)}}const rt=/[٠-٩۰-۹]/g,it=/[‎‏؜]/g,at=/^[‎‏؜]$/,ot=/[\s./-]+/,st=/^\d+$/,ct=/^\d{8}$/;function lt(e){let t=e.charCodeAt(0);return String(t-(t>=1776?1776:1632))}function ut(e){return e.replace(rt,lt)}function P(e){return e.replace(it,``).replace(rt,lt).trim()}function dt(e,t){if(ct.test(e)){let n=[],r=0;for(let i of t){let t=i===`year`?4:2;n.push(e.slice(r,r+t)),r+=t}return n}let n=e.split(ot).filter(e=>e!==``);return n.length!==3||!n.every(e=>st.test(e))?null:n}function ft(e){let t=P(e).split(ot).filter(e=>e!==``);return t.every(e=>st.test(e))?t:null}function pt(e){if(e.length===4)return Number(e);if(e.length!==2)return null;let t=2e3+Number(e);return t<=x().year+20?t:1900+Number(e)}function mt(e,t){let n=dt(P(e),t.order);if(n===null)return null;let r=0,i=0,a=0;for(let[e,o]of t.order.entries()){let t=n[e]??``;if(o===`year`)a=pt(t);else if(t.length>2)return null;else o===`day`?r=Number(t):i=Number(t)}return a===null?null:c(a,i,r)}const ht=/^(\d{4})-(\d{2})$/,gt=/^\d{4}$/;function _t(e,t){switch(t){case`day`:return e;case`month`:return{year:e.year,month:e.month,day:1};default:return{year:e.year,month:1,day:1}}}function F(e,t){let n=f(e);switch(t){case`day`:return n;case`month`:return n.slice(0,7);default:return n.slice(0,4)}}function vt(e,t){let n=d(e);if(n!==null||t===`day`)return n===null?null:_t(n,t);if(t===`month`){let t=ht.exec(e);return t?c(Number(t[1]),Number(t[2]),1):null}return gt.test(e)?c(Number(e),1,1):null}function I(e,t){return{...e,order:e.order.filter(e=>e===`year`||t===`month`&&e===`month`)}}function yt(e,t,n){return n===`day`?D(e,t):D(e,I(t,n))}function bt(e,t,n){return Fe(t===`day`?e:I(e,t),n)}function xt(e,t,n){if(n===`day`)return mt(e,t);let{order:r}=I(t,n),i=ft(e);if(i?.length!==r.length)return null;let a=1,o=null;for(let[e,t]of r.entries()){let n=i[e]??``;if(t===`year`)o=pt(n);else if(n.length>2)return null;else a=Number(n)}return o===null?null:c(o,a,1)}function St(e,t){return e===null?null:typeof e==`string`?O()?t?.querySelector(e)??document.querySelector(e):null:e}function L(e,t,n){let r=document.createElement(e);return t&&(r.className=t),n&&Object.entries(n).forEach(([e,t])=>{r.setAttribute(e,t)}),r}function Ct(e,t,n){let r=e.getBoundingClientRect(),i=t.getBoundingClientRect();n===`center`?e.scrollTop+=i.top-r.top-(r.height-i.height)/2:i.top<r.top?e.scrollTop+=i.top-r.top:i.bottom>r.bottom&&(e.scrollTop+=i.bottom-r.bottom)}function wt(e,t,n){let r=L(`button`,e,{type:`button`});return n?(r.setAttribute(`aria-label`,t),r.innerHTML=n):r.textContent=t,r}const Tt=`dp-ui--pointer`,Et=[`Shift`,`Control`,`Alt`,`Meta`];function Dt(){return k()||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Ot(e){return e?Dt()?`reduced`:`full`:`none`}function kt(e,t){e.textContent=``,e.textContent=t}function At(e){let t=e.ownerDocument,n=()=>{e.classList.add(Tt)},r=t=>{Et.includes(t.key)||e.classList.remove(Tt)};return e.addEventListener(`pointerdown`,n,!0),t.addEventListener(`keydown`,r,!0),()=>{e.removeEventListener(`pointerdown`,n,!0),t.removeEventListener(`keydown`,r,!0)}}const jt=`(prefers-color-scheme: dark)`,Mt=/^(rgba?|color|oklch|oklab|lab|lch)\(([^)]*)\)$/,Nt=/[\s,/]+/,Pt=[`class`,`style`,`data-theme`,`data-color-scheme`],R=e=>Math.min(1,Math.max(0,e)),z=e=>{let t=R(e);return t<=.04045?t/12.92:((t+.055)/1.055)**2.4},Ft=(e,t,n)=>.2126*z(e)+.7152*z(t)+.0722*z(n),B=(e,t)=>{if(e===`none`)return 0;let n=parseFloat(e);return e.endsWith(`%`)?n/100*t:n},It=(e,t)=>{let n=+(e===`color`);if(e===`color`&&t[0]!==`srgb`)return null;let r=B(t[n]??``,e===`lab`||e===`lch`?100:1);switch(e){case`rgb`:case`rgba`:case`color`:{let r=e===`color`?1:255,[i=NaN,a=NaN,o=NaN]=[0,1,2].map(e=>B(t[n+e]??``,r)/r);return Ft(i,a,o)}case`oklab`:case`oklch`:return R(r)**3;default:return R((r+16)/116)**3}};function Lt(e){let t=e.trim().toLowerCase();if(t===`transparent`)return{luminance:0,alpha:0};let n=Mt.exec(t),r=n?.[1],i=n?.[2];if(r===void 0||i===void 0)return null;let a=i.split(Nt).filter(e=>e!==``),o=r===`color`?4:3,s=a.length>o?B(a[o],1):1,c=It(r,a);return c===null||Number.isNaN(c)||Number.isNaN(s)?null:{luminance:c,alpha:R(s)}}const Rt=()=>{let e=getComputedStyle(document.documentElement).getPropertyValue(`color-scheme`);return e.includes(`dark`)?e.includes(`light`)?window.matchMedia(jt).matches?`dark`:`light`:`dark`:`light`};function zt(e){if(k()||!O())return`light`;let t=e;for(;t!==null;){let e=Lt(getComputedStyle(t).backgroundColor);if(e!==null&&e.alpha>=.5)return e.luminance<.179?`dark`:`light`;t=t.parentElement}return Rt()}function Bt(e){if(k()||!O())return()=>void 0;let t=()=>{e()},n=new MutationObserver(t),r={attributes:!0,attributeFilter:Pt};n.observe(document.documentElement,r),n.observe(document.body,r);let i=window.matchMedia(jt);return i.addEventListener(`change`,t),()=>{n.disconnect(),i.removeEventListener(`change`,t)}}const V={PAGER_SETTLE:350,DOCKED_HEIGHT:300,SELECT_FILL:150,HEADLINE_FADE:50,RIPPLE:450,SURFACE_ENTER:300,SURFACE_ENTER_FADE:100,SURFACE_ACTIONS_DELAY:150,SURFACE_EXIT:150,SCRIM_ENTER:150,SCRIM_EXIT:200,PANEL_FADE_OUT:100,PANEL_FADE_IN:200,WHEEL_SETTLE:90,VIEW_SWITCH:300,VIEW_SWITCH_FADE_OUT:75,VIEW_SWITCH_FADE_IN:150,REDUCED_FADE:150,SNAP_SCROLL_FALLBACK:700},H={DRAG_START_PX:6,COMMIT_FRACTION:.25,FLICK_VELOCITY:.4,VELOCITY_SAMPLES:5,MIN_SAMPLE_SPAN_MS:1},Vt={EMPHASIZED:`cubic-bezier(0.2, 0, 0, 1)`,EMPHASIZED_DECELERATE:`cubic-bezier(0.05, 0.7, 0.1, 1)`,EMPHASIZED_ACCELERATE:`cubic-bezier(0.3, 0, 0.8, 0.15)`},Ht=` – `,Ut=/\s*[–—]\s*|\s+-\s+/,Wt=/[,;]/;function Gt(e){let t=e.split(Ut);if(t.length!==2)return null;let[n,r]=t;return[n,r]}function Kt(e,t,n){return E(e).map(e=>yt(e,t,n)).join(e.mode===`range`?Ht:`, `)}function qt(e,t){let n=[];for(let r of e){let e=t(r);if(e===null)return null;n.push(e)}return n}function Jt(e){if(e?.length!==2)return null;let[t,n]=e;return p(t,n)>0?null:{mode:`range`,start:t,end:n}}function Yt(e,t,n,r,i){switch(t){case`single`:{let r=n(e);return r===null?null:{mode:t,date:r}}case`range`:{let t=r(e);return t===null?null:Jt(qt(t,n))}default:{let r=qt(e.split(i).filter(e=>e.trim()!==``),n);return r===null?null:{mode:t,dates:le(r)}}}}function Xt(e,t,n,r){let i=e.trim();return i===``?T(t):Yt(i,t,e=>xt(e.trim(),n,r),Gt,Wt)}function Zt(e,t){return e.mode===`range`?e.start===null||e.end===null?``:`${F(e.start,t)}/${F(e.end,t)}`:E(e).map(e=>F(e,t)).join(`,`)}function Qt(e,t,n){let r=e.trim();return r===``?T(t):Yt(r,t,e=>vt(e.trim(),n),e=>e.split(`/`),/,/)}function $t(e,t){let n=Math.max(e.getBoundingClientRect().height,e.scrollHeight),{top:r,bottom:i}=t.getBoundingClientRect(),a=window.innerHeight-i-8,o=r-8;return n<=Math.max(a,o)}const U={calendar:`<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M200-80q-33 0-56.5-23.5T120-160v-560q0-33 23.5-56.5T200-800h40v-80h80v80h320v-80h80v80h40q33 0 56.5 23.5T840-720v560q0 33-23.5 56.5T760-80H200Zm0-80h560v-400H200v400Zm0-480h560v-80H200v80Zm0 0v-80 80Z"/></svg>`,pencil:`<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M200-200h57l391-391-57-57-391 391v57Zm-80 80v-170l528-527q12-11 26.5-17t30.5-6q16 0 31 6t26 18l55 56q12 11 17.5 26t5.5 30q0 16-5.5 30.5T817-647L290-120H120Zm640-584-56-56 56 56Zm-141 85-28-29 57 57-29-28Z"/></svg>`,arrowDropDown:`<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M480-360 280-560h400L480-360Z"/></svg>`,keyboardArrowLeft:`<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"/></svg>`,keyboardArrowRight:`<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"/></svg>`,close:`<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e3e3e3"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg>`,check:`<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="currentColor"><path d="M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"/></svg>`},en=e=>{let t=t=>`${e.shiftKey}+${t}`;return{previousMonth:{keys:`PageUp`,display:e.pageUpKey},nextMonth:{keys:`PageDown`,display:e.pageDownKey},previousYear:{keys:`Shift+PageUp`,display:t(e.pageUpKey)},nextYear:{keys:`Shift+PageDown`,display:t(e.pageDownKey)},chooseMonth:{keys:`Shift+M`,display:t(`M`)},chooseYear:{keys:`Shift+Y`,display:t(`Y`)}}},tn=(e,t)=>`dp-ui-${e.replace(/[^\w-]/g,`-`)}-${t}`,nn=(e,t,n)=>{n!==void 0&&(e.setAttribute(`title`,`${t} (${n.display})`),e.setAttribute(`aria-keyshortcuts`,n.keys))},rn=(e,t)=>{let n=L(`span`);n.innerHTML=e;let r=n.firstElementChild;return r===null?null:(r.setAttribute(`class`,t),r.setAttribute(`aria-hidden`,`true`),r)},an=(e,t,n,r)=>{let i=wt(`dp-ui__icon-button dp-ui__icon-button--${e}`,t,n);return i.firstElementChild?.setAttribute(`aria-hidden`,`true`),nn(i,t,r),i},on=(e,t,n)=>{let r=L(`button`,`dp-ui__menu-button dp-ui__menu-button--${e}`,{type:`button`,"aria-haspopup":`listbox`,"aria-expanded":`false`,"aria-controls":n.controls});nn(r,n.name,n.shortcut);let i=L(`span`,`dp-ui__menu-button-label`);r.append(i);let a=rn(U.arrowDropDown,`dp-ui__menu-button-icon`);a!==null&&r.append(a);let o=(e,t=e)=>{i.textContent=e,r.setAttribute(`aria-label`,`${n.name}, ${t}`)};return o(t),{button:r,label:i,setText:o}},sn=(e,t)=>wt(`dp-ui__text-button dp-ui__text-button--${e}`,t),cn=(e,t)=>{let n=an(`switch-view`,e.switchToInput,U.pencil);return{button:n,setInputView:r=>{n.innerHTML=r?U.calendar:U.pencil,n.firstElementChild?.setAttribute(`aria-hidden`,`true`),r?n.setAttribute(`aria-controls`,t):n.removeAttribute(`aria-controls`),n.setAttribute(`aria-label`,r?e.switchToCalendar:e.switchToInput)}}},ln=/^\d$/,un=/* @__PURE__ */ new Set([`/`,`.`,`-`,` `]);function dn(e,t){return e===`year`?t.yearDigits:2}function W(e,t){let{order:n}=t,r=n.map(e=>dn(e,t)),i=[``],a=0;for(let t=0;t<e.length;t++){let o=e.charAt(t);if(at.test(o))continue;let s=ut(o),c=i.length-1,l=r[c]??0,u=i[c]??``,d=i.length===n.length;if(ln.test(s)){if(u.length>=l){if(d)break;i.push(s)}else i[c]=u+s;a=t+1}else if(un.has(s)){if(u===``)continue;if(d)break;i[c]=u.padStart(l,`0`),i.push(``),a=t+1}}return{groups:i,end:a}}function fn(e,t){return W(e,t).groups.filter(e=>e!==``).join(t.separator)}function pn(e,t){return W(e,t).end}function mn(e,t){let{groups:n}=W(e,t),r=t.order.at(-1),i=n.at(-1);return r===void 0||i===void 0||n.length!==t.order.length?!1:i.length===dn(r,t)}function hn(e,t){let n=fn(e.value,t);n!==e.value&&(e.value=n,e.setSelectionRange(n.length,n.length))}const G=`dp-ui__pager--dragging`,gn=e=>e instanceof Element&&e.closest(`button`)!==null,_n=(e,t)=>{e.push(t),e.length>H.VELOCITY_SAMPLES&&e.shift()},vn=e=>{let t=e.at(0),n=e.at(-1);return!t||!n?0:(n.x-t.x)/Math.max(H.MIN_SAMPLE_SPAN_MS,n.t-t.t)},yn=(e,t)=>{try{e.setPointerCapture(t)}catch{return}},bn=(e,t)=>{e.hasPointerCapture(t)&&e.releasePointerCapture(t)},xn=(e,t,n)=>{let r=null,i=null,a=t=>{t.controller.abort(),r===t&&(r=null),t.dragging&&(e.classList.remove(G),bn(e,t.pointerId))},o=()=>{i?.abort();let t=new AbortController;i=t,e.addEventListener(`click`,e=>{e.preventDefault(),e.stopPropagation(),t.abort()},{capture:!0,signal:t.signal}),requestAnimationFrame(()=>{t.abort()})},s=t=>{n.onBegin(),t.dragging=!0,t.width=n.pageWidth(),yn(e,t.pointerId),e.classList.add(G)},c=(e,t)=>{if(t.pointerId!==e.pointerId)return;let r=t.clientX-e.startX;if(!e.dragging){if(Math.abs(r)<=H.DRAG_START_PX)return;s(e)}e.lastX=t.clientX,_n(e.samples,{x:t.clientX,t:t.timeStamp}),n.onMove(r,e.width)},l=(e,t,r)=>{t.pointerId===e.pointerId&&(a(e),e.dragging&&(r?n.onAbort():(o(),_n(e.samples,{x:e.lastX,t:t.timeStamp}),n.onRelease({dx:e.lastX-e.startX,velocity:vn(e.samples),width:e.width}))))};e.addEventListener(`pointerdown`,t=>{if(t.button!==0||!t.isPrimary||gn(t.target))return;let i=r;i&&(a(i),i.dragging&&n.onAbort());let o=new AbortController,s={pointerId:t.pointerId,startX:t.clientX,samples:[{x:t.clientX,t:t.timeStamp}],controller:o,lastX:t.clientX,width:0,dragging:!1};r=s;let u=e.ownerDocument,d={signal:o.signal};u.addEventListener(`pointermove`,e=>{c(s,e)},d),u.addEventListener(`pointerup`,e=>{l(s,e,!1)},d),u.addEventListener(`pointercancel`,e=>{l(s,e,!0)},d)},{signal:t});let u=()=>{r&&a(r)};return{isDragging:()=>r?.dragging===!0,cancel:u,dispose:()=>{u(),i?.abort(),i=null}}},Sn=(e,t)=>e.year===t.year&&e.month===t.month,Cn=(e,t,n,r)=>{let i=null,a=e=>{let n=t(e);return n.classList.add(`dp-ui__page`),{key:e,element:n}},o=e=>{i?.forEach((t,n)=>{t.element.toggleAttribute(`inert`,n!==e)})},s=(e,t,n)=>{let i=e[t];if(r(i.key,n))return e;let o=a(n);return i.element.replaceWith(o.element),t===0?[o,e[1],e[2]]:[e[0],e[1],o]};return{show:t=>{let r=[a(n(t,-1)),a(t),a(n(t,1))];e.replaceChildren(...r.map(e=>e.element)),i=r,o(1)},centerKey:()=>i?.[1].key??null,reveal:(e,t)=>{i&&(i=s(i,e,t),o(e))},recenter:e=>{if(!i)return;let t=i[e],r=a(n(t.key,-1)),s=a(n(t.key,1));i.forEach((t,n)=>{n!==e&&t.element.remove()}),t.element.before(r.element),t.element.after(s.element),i=[r,t,s],o(1)},clear:()=>{i=null}}},wn=(e,t,n)=>{if(t<-H.FLICK_VELOCITY)return 1;if(t>H.FLICK_VELOCITY)return-1;let r=n*H.COMMIT_FRACTION;return e<-r?1:e>r?-1:0},Tn=(e,t,n,r)=>{let i=wn(e,t,n);return!r||i===0?i:i===1?-1:1},En=(e,t)=>{let n=null,r=null,i=()=>typeof e.animate==`function`,a=()=>{let e=r;r=null,e?.cancel()},o=()=>{a();let e=n;e&&(n=null,e.complete(),e.animation.cancel())},s=()=>{a();let e=n;n=null,e?.animation.cancel()},c=()=>{let t=e.animate([{opacity:0},{opacity:1}],{duration:V.REDUCED_FADE,easing:`linear`});r=t;let n=()=>{r===t&&(r=null)};t.finished.then(n,n)};return{run:(r,s,l)=>{a();let u=Ot(t);if(r===s||u===`none`||!i()){l();return}if(u===`reduced`){l(),c();return}let d=e.animate([{transform:r},{transform:s}],{duration:V.PAGER_SETTLE,easing:Vt.EMPHASIZED,fill:`forwards`}),f={animation:d,complete:l};n=f,d.finished.then(()=>{n===f&&o()},()=>void 0)},finish:o,cancel:s}},Dn=(e,t)=>Math.min(t,Math.max(-t,e)),On=(e,t)=>e.deltaMode===0?e.deltaX:Math.sign(e.deltaX)*t,kn=(e,t,n)=>{let r=null,i=0,a=()=>{r=null;let e=i;i=0,n.onSettle(e,n.pageWidth())};return e.addEventListener(`wheel`,e=>{if(Math.abs(e.deltaX)<=Math.abs(e.deltaY)||n.isBlocked())return;e.preventDefault();let t=n.pageWidth();r===null?n.onBegin():clearTimeout(r),i-=On(e,t),n.onMove(Dn(i,t),t),r=setTimeout(a,V.WHEEL_SETTLE)},{passive:!1,signal:t}),{cancel:()=>{r!==null&&clearTimeout(r),r=null,i=0}}},An=`dp-ui__pager--swipe`,jn=`--dp-ui-pager-height`;var Mn=class{viewport;options;track;controller=new AbortController;previousTouchAction;strip;animator;drag=null;wheel=null;resizeObserver=null;observedWidth=-1;offset=0;revision=0;constructor(e,t){this.viewport=e,this.options=t,this.previousTouchAction=e.style.touchAction,this.track=L(`div`,`dp-ui__pager-track`),this.strip=Cn(this.track,e=>t.renderPage(e),(e,n)=>t.step(e,n),(e,n)=>t.isSame(e,n)),this.animator=En(this.track,t.animate),e.classList.add(`dp-ui__pager`),e.append(this.track),t.swipe&&this.enableSwipe(),this.observeWidth()}show(e){this.destroyed||(this.revision+=1,this.animator.cancel(),this.cancelGestures(),this.strip.show(e),this.rest(),this.fitHeight(e))}slide(e,t){if(this.destroyed)return;this.finish(),this.cancelGestures();let n=this.strip.centerKey();if(n===null){this.show(e);return}if(this.revision+=1,this.options.isSame(n,e)){this.settle();return}let r=t===1?2:0;this.strip.reveal(r,e),this.fitHeight(e);let i=this.pageWidth(),a=this.transformFor(1,this.offset,i);this.offset=0,this.animator.run(a,this.transformFor(r,0,i),()=>{this.strip.recenter(r),this.rest()})}finish(){this.animator.finish()}destroy(){this.destroyed||(this.controller.abort(),this.resizeObserver?.disconnect(),this.resizeObserver=null,this.cancelGestures(),this.drag?.dispose(),this.animator.cancel(),this.track.remove(),this.strip.clear(),this.viewport.style.removeProperty(jn),this.viewport.classList.remove(An,G),this.options.swipe&&(this.viewport.style.touchAction=this.previousTouchAction))}get destroyed(){return this.controller.signal.aborted}enableSwipe(){let{signal:e}=this.controller;this.viewport.style.touchAction=`pan-y`,this.viewport.classList.add(An),this.drag=xn(this.viewport,e,{pageWidth:()=>this.pageWidth(),onBegin:()=>{this.finish(),this.wheel?.cancel()},onMove:(e,t)=>{this.setOffset(e,t)},onRelease:({dx:e,velocity:t,width:n})=>{this.release(Tn(e,t,n,this.options.rtl),`drag`)},onAbort:()=>{this.settle()}}),this.wheel=kn(this.viewport,e,{pageWidth:()=>this.pageWidth(),isBlocked:()=>this.drag?.isDragging()===!0,onBegin:()=>{this.finish()},onMove:(e,t)=>{this.setOffset(e,t)},onSettle:(e,t)=>{this.release(Tn(e,0,t,this.options.rtl),`wheel`)}})}observeWidth(){this.options.fitHeight===!0&&typeof ResizeObserver<`u`&&(this.resizeObserver=new ResizeObserver(e=>{let t=e.at(-1);if(t===void 0||this.destroyed)return;let n=t.contentRect.width;if(n===this.observedWidth)return;this.observedWidth=n;let r=this.strip.centerKey();r!==null&&this.fitHeight(r)}),this.resizeObserver.observe(this.viewport))}cancelGestures(){this.drag?.cancel(),this.wheel?.cancel()}release(e,t){if(e===0){this.settle();return}let n=this.revision;this.options.onCommit(e,t),this.revision===n&&!this.destroyed&&this.settle()}settle(){this.finish();let e=this.pageWidth(),t=this.transformFor(1,this.offset,e);this.offset=0,this.animator.run(t,this.transformFor(1,0,e),()=>{this.rest()})}fitHeight(e){if(this.options.fitHeight!==!0||this.viewport.hidden)return;let t=this.options.pageHeight?.(e);t!==void 0&&this.viewport.style.setProperty(jn,`${String(t)}px`)}rest(){this.offset=0,this.track.style.removeProperty(`transform`),this.viewport.scrollLeft!==0&&(this.viewport.scrollLeft=0)}setOffset(e,t){this.offset=e,this.track.style.transform=this.transformFor(1,e,t)}transformFor(e,t,n){let r=this.options.rtl?1:-1;return`translateX(${String(r*e*n+t)}px)`}pageWidth(){let e=this.viewport.clientWidth;return e>0?e:360}};const K=`--dp-ui-scrollbar-gap`,Nn=[`auto`,`scroll`];let q=0,J=[],Y=``;const Pn=e=>Nn.includes(window.getComputedStyle(e).overflowY);function Fn(e){let{style:t}=e,n=e.clientWidth,r=parseFloat(window.getComputedStyle(e).paddingRight)||0;J.push({element:e,overflow:t.overflow,paddingRight:t.paddingRight}),t.overflow=`hidden`;let i=Math.max(0,e.clientWidth-n);return i>0&&(t.paddingRight=`${String(r+i)}px`),i}function In(){if(q===0){let{body:e,documentElement:t}=document,n=Pn(e)?Fn(e):0,r=Fn(t);Y=t.style.getPropertyValue(K),t.style.setProperty(K,`${String(Math.max(n,r))}px`)}q+=1}function Ln(){if(q===0||(--q,q>0))return;J.forEach(({element:e,overflow:t,paddingRight:n})=>{e.style.overflow=t,e.style.paddingRight=n});let e=document.documentElement;Y?e.style.setProperty(K,Y):e.style.removeProperty(K),J=[],Y=``}function Rn(){if(!O())return()=>void 0;In();let e=!1;return()=>{e||(e=!0,Ln())}}const zn=e=>{let t=getComputedStyle(e).getPropertyValue(`--dp-ui-motion-surface-exit`).trim();return t.endsWith(`ms`)&&parseFloat(t)===0};function X(e,t,n){n!==void 0&&n!==``?(e.setAttribute(`aria-labelledby`,n),e.removeAttribute(`aria-label`)):(e.setAttribute(`aria-label`,t),e.removeAttribute(`aria-labelledby`))}function Z(e){if(zn(e))return Promise.resolve();if(typeof e.getAnimations!=`function`)return new Promise(e=>{setTimeout(e,V.SURFACE_EXIT)});let t=e.getAnimations({subtree:!0});return Promise.allSettled(t.map(e=>e.finished)).then(()=>void 0)}var Bn=class{root;body;dialog;controller=new AbortController;allowPageScroll;releaseScroll=null;openPromise=null;closePromise=null;pointerStartedOnBackdrop=!1;destroyed=!1;constructor(e){this.allowPageScroll=e.allowPageScroll,this.dialog=L(`dialog`,`dp-ui__dialog`),X(this.dialog,e.label,e.labelledBy),this.body=L(`div`,`dp-ui__container dp-ui__container--modal`),this.root=this.dialog,this.dialog.appendChild(this.body),e.parent.appendChild(this.dialog);let{signal:t}=this.controller;this.dialog.addEventListener(`cancel`,t=>{t.preventDefault(),this.closePromise||e.onCancel(`escape`)},{signal:t}),this.dialog.addEventListener(`pointerdown`,e=>{this.pointerStartedOnBackdrop=e.target===this.dialog},{signal:t}),this.dialog.addEventListener(`click`,t=>{let n=this.pointerStartedOnBackdrop&&t.target===this.dialog;this.pointerStartedOnBackdrop=!1,n&&!this.closePromise&&e.onCancel(`outside`)},{signal:t})}open(){return this.openPromise||(this.openPromise=Promise.resolve(),this.destroyed)||(this.allowPageScroll||(this.releaseScroll=Rn()),this.dialog.showModal()),this.openPromise}close(){return this.closePromise||=(this.dialog.open&&this.dialog.close(),Z(this.dialog).then(()=>{this.unlock()})),this.closePromise}destroy(){this.destroyed||(this.destroyed=!0,this.controller.abort(),this.unlock(),this.dialog.remove())}setLabel(e,t){X(this.dialog,e,t)}unlock(){this.releaseScroll?.(),this.releaseScroll=null}},Vn=class{root;body;constructor(e){this.root=L(`div`,`dp-ui__container dp-ui__container--inline`,{role:`group`}),X(this.root,e.label,e.labelledBy),this.body=this.root,e.container.appendChild(this.root)}open(){return Promise.resolve()}close(){return Promise.resolve()}destroy(){this.root.remove()}setLabel(e,t){X(this.root,e,t)}};const Q=`anchor-name`,Hn=e=>typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`position-try-fallbacks`,`flip-block`)&&typeof e.showPopover==`function`,Un=e=>`--dp-ui-anchor-${e.replace(/[^\w-]/g,`-`)}`,Wn=(e,t,n)=>{let{style:r}=t,i=r.getPropertyValue(Q);return r.setProperty(Q,n),e.style.setProperty(`--dp-ui-anchor-name`,n),e.setAttribute(`data-positioning`,`anchor`),()=>{i?r.setProperty(Q,i):r.removeProperty(Q)}},Gn=e=>{let{left:t,right:n}=e.getBoundingClientRect(),r=e.ownerDocument.documentElement.clientWidth;return t<-.5||n>r+.5},Kn=(e,t)=>{let n=e.getBoundingClientRect().top<t.getBoundingClientRect().top;e.setAttribute(`data-placement`,n?`top`:`bottom`)},qn=(e,t)=>Math.round(e*t)/t;function Jn({anchor:e,contentWidth:t,pickerHeight:n,minHeight:r,layoutWidth:i,viewport:a,tokens:o,request:s,rtl:c,pixelRatio:l}){let{gap:u,minWidth:d,maxWidth:f,edgeMargin:p}=o,{offsetLeft:m,offsetTop:h}=a,g=qn(Math.min(Math.max(e.width,d,t),f,i-2*p),l),_=h+p,v=e.top-u-_,y=h+a.height-p-e.bottom-u,b=(s===`auto`?n<=y||!(n<=v)&&y>=v?`bottom`:`top`:s)===`top`,x=b?v:y,S=x<Math.min(n,r)&&(b?y:v)>x?!b:b,ee=S?`top`:`bottom`,C=S?v:y,w=n>C?Math.max(C,0):null,te=w??n,ne=S?e.top-u-te:e.bottom+u,re=c?e.right-g:e.left,ie=Math.max(Math.min(re,m+a.width-g-p),m+p);return{top:qn(Math.max(ne,_),l),left:qn(ie,l),width:g,placement:ee,availableHeight:w}}const Yn=`--dp-ui-popover-top`,Xn=`--dp-ui-popover-left`,Zn=`--dp-ui-popover-available-height`,$=(e,t,n)=>{e.style.setProperty(`max-width`,`var(--dp-ui-${t})`);let r=getComputedStyle(e).getPropertyValue(`max-width`),i=r.endsWith(`px`)?parseFloat(r):NaN;return i>=0?i:n},Qn=e=>{let t=L(`div`);t.style.cssText=`position:absolute;visibility:hidden;pointer-events:none`,e.appendChild(t);let n={gap:$(t,`popover-gap`,4),edgeMargin:$(t,`popover-edge-margin`,4),minHeight:$(t,`popover-min-height`,160)};return t.remove(),n},$n=(e,t,n)=>{let r=null;return{enable:()=>{let{style:t}=e;t.setProperty(`position`,`fixed`),t.setProperty(`margin`,`0`),t.setProperty(`inset`,`auto`),t.setProperty(`top`,`var(${Yn})`),t.setProperty(`left`,`var(${Xn})`),e.setAttribute(`data-positioning`,`fallback`)},layout:()=>{r??=Qn(e);let i=e.ownerDocument.documentElement;e.style.removeProperty(Zn);let a=t.getBoundingClientRect(),o=e.offsetWidth,{top:s,left:c,placement:l,availableHeight:u}=Jn({anchor:{top:a.top,bottom:a.bottom,left:a.left,right:a.right,width:0},contentWidth:o,pickerHeight:e.offsetHeight,minHeight:r.minHeight,layoutWidth:i.clientWidth,viewport:window.visualViewport??{width:i.clientWidth,height:i.clientHeight,offsetLeft:0,offsetTop:0},tokens:{gap:r.gap,edgeMargin:r.edgeMargin,minWidth:0,maxWidth:o},request:`auto`,rtl:n,pixelRatio:window.devicePixelRatio||1});e.style.setProperty(Yn,`${String(s)}px`),e.style.setProperty(Xn,`${String(c)}px`),u!==null&&e.style.setProperty(Zn,`${String(u)}px`),e.setAttribute(`data-placement`,l)}}},er=e=>{document.addEventListener(`pointerdown`,t=>{if(e.isIgnored())return;let n=t.composedPath();e.inside.some(e=>n.includes(e))||e.onOutside()},{capture:!0,signal:e.signal})},tr=(e,t,n)=>{let r=new AbortController,{signal:i}=r,a=0,o=()=>{a===0&&(a=requestAnimationFrame(()=>{a=0,i.aborted||n()}))};if(window.addEventListener(`resize`,o,{signal:i}),window.addEventListener(`scroll`,t=>{let{target:n}=t;n instanceof Node&&e.contains(n)||o()},{capture:!0,signal:i}),window.visualViewport?.addEventListener(`resize`,o,{signal:i}),window.visualViewport?.addEventListener(`scroll`,o,{signal:i}),typeof ResizeObserver<`u`){let n=new ResizeObserver(o);n.observe(t),n.observe(e),i.addEventListener(`abort`,()=>{n.disconnect()})}return i.addEventListener(`abort`,()=>{cancelAnimationFrame(a),a=0}),()=>{r.abort()}};var nr=class{root;body;anchor;anchorName;fallback;controller=new AbortController;stopTracking=null;restoreAnchor=null;hasPopover;anchored=!1;openPromise=null;closePromise=null;destroyed=!1;constructor(e){this.anchor=e.anchor,this.anchorName=Un(e.instanceId),this.root=L(`div`,`dp-ui__container dp-ui__container--docked`,{role:`dialog`,"aria-modal":`false`,"data-placement":`bottom`}),X(this.root,e.label,e.labelledBy),this.body=this.root,this.fallback=$n(this.root,this.anchor,e.rtl),this.hasPopover=typeof this.root.showPopover==`function`,this.hasPopover?this.root.setAttribute(`popover`,`manual`):this.root.style.display=`none`,e.host.appendChild(this.root);let{signal:t}=this.controller;er({inside:[this.root,this.anchor,...e.inside],signal:t,isIgnored:()=>e.ignoreOutsideClick||this.closePromise!==null,onOutside:()=>{e.onOutside()}}),this.root.addEventListener(`keydown`,t=>{t.key!==`Escape`||t.defaultPrevented||this.closePromise||e.onEscape()},{signal:t})}open(){return this.openPromise||(this.openPromise=Promise.resolve(),this.destroyed)||(this.show(),this.update(),this.stopTracking=tr(this.root,this.anchor,()=>{this.update()})),this.openPromise}close(){return this.closePromise||=(this.endTracking(),this.hide(),Z(this.root)),this.closePromise}destroy(){this.destroyed||(this.destroyed=!0,this.endTracking(),this.controller.abort(),this.restoreAnchor?.(),this.restoreAnchor=null,this.root.remove())}setLabel(e,t){X(this.root,e,t)}endTracking(){this.stopTracking?.(),this.stopTracking=null}show(){if(!this.hasPopover)this.root.style.removeProperty(`display`),this.enableFallback();else{try{this.root.showPopover()}catch{this.hasPopover=!1,this.root.removeAttribute(`popover`),this.enableFallback();return}Hn(this.root)?(this.restoreAnchor=Wn(this.root,this.anchor,this.anchorName),this.anchored=!0):this.enableFallback()}}hide(){if(!this.hasPopover)this.root.style.display=`none`;else try{this.root.hidePopover()}catch{this.root.removeAttribute(`popover`),this.hasPopover=!1,this.root.style.display=`none`}}enableFallback(){this.fallback.enable(),this.anchored=!1}update(){this.anchored&&Gn(this.root)&&this.enableFallback(),this.anchored?Kn(this.root,this.anchor):this.fallback.layout()}};const rr=`dp-ui__container`,ir=/\s+/,ar=/* @__PURE__ */ new WeakMap;function or(e){return e.split(ir).filter(e=>e!==``)}function sr(e,t){e.setAttribute(`data-theme`,t.theme),e.setAttribute(`data-color-scheme`,t.colorScheme),e.classList.remove(...ar.get(e)??[]);let n=or(t.className??``);e.classList.add(...n),ar.set(e,n),(e.classList.contains(rr)?e:e.querySelector(`.${rr}`))?.classList.toggle(`dp-ui__container--rtl`,t.rtl??!1)}export{Je as $,Bt as A,p as At,vt as B,f as Bt,Qt as C,ie as Ct,H as D,te as Dt,Vt as E,re as Et,L as F,d as Ft,$e as G,F as H,x as Ht,St as I,m as It,Ve as J,et as K,Ct as L,ee as Lt,Ot as M,b as Mt,Dt as N,g as Nt,V as O,h as Ot,At as P,y as Pt,Ke as Q,yt as R,v as Rt,Xt as S,ae as St,Gt as T,ce as Tt,P as U,e as Ut,bt as V,S as Vt,mt as W,Ze as X,tt as Y,Qe as Z,en as _,E as _t,Z as a,Fe as at,Ht as b,ne as bt,mn as c,je as ct,hn as d,de as dt,qe as et,an as f,me as ft,tn as g,pe as gt,sn as h,he as ht,Bn as i,D as it,kt as j,c as jt,zt as k,_ as kt,pn as l,_e as lt,cn as m,ge as mt,nr as n,Ye as nt,Mn as o,Pe as ot,on as p,ue as pt,N as q,Vn as r,O as rt,Sn as s,Oe as st,sr as t,nt as tt,fn as u,T as ut,U as v,le as vt,Zt as w,w as wt,Kt as x,se as xt,$t as y,oe as yt,_t as z,u as zt};