stimulus_plumbers 0.4.8 → 0.4.9
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +7 -9
- data/app/assets/javascripts/stimulus-plumbers/controllers.manifest.json +331 -20
- data/app/assets/javascripts/stimulus-plumbers/index.es.js +493 -226
- data/app/assets/javascripts/stimulus-plumbers/index.es.js.map +1 -1
- data/app/assets/javascripts/stimulus-plumbers/index.umd.js +1 -1
- data/app/assets/javascripts/stimulus-plumbers/index.umd.js.map +1 -1
- data/app/assets/stylesheets/stimulus_plumbers/tokens.css +58 -53
- data/docs/architecture.md +0 -2
- data/docs/component/avatar.md +1 -0
- data/docs/component/button.md +1 -0
- data/docs/component/calendar.md +7 -16
- data/docs/component/checklist.md +153 -0
- data/docs/component/icon.md +7 -5
- data/docs/component/indicator.md +55 -0
- data/docs/component/list.md +2 -3
- data/docs/component/ordered_list.md +118 -0
- data/docs/component/plumber.md +21 -0
- data/docs/component/popover.md +1 -2
- data/docs/component/progress.md +65 -0
- data/docs/component/timeline.md +47 -12
- data/docs/guide.md +12 -0
- data/lib/generators/stimulus_plumbers/install/install_generator.rb +16 -12
- data/lib/stimulus_plumbers/components/button.rb +1 -0
- data/lib/stimulus_plumbers/components/checklist/item/slots.rb +13 -0
- data/lib/stimulus_plumbers/components/checklist/item.rb +64 -0
- data/lib/stimulus_plumbers/components/checklist.rb +50 -0
- data/lib/stimulus_plumbers/components/combobox/typeahead.rb +1 -0
- data/lib/stimulus_plumbers/components/icon.rb +2 -2
- data/lib/stimulus_plumbers/components/indicator.rb +30 -0
- data/lib/stimulus_plumbers/components/link.rb +1 -0
- data/lib/stimulus_plumbers/components/ordered_list/item/slots.rb +13 -0
- data/lib/stimulus_plumbers/components/ordered_list/item.rb +129 -0
- data/lib/stimulus_plumbers/components/ordered_list.rb +24 -0
- data/lib/stimulus_plumbers/components/progress_bar.rb +48 -0
- data/lib/stimulus_plumbers/components/progress_meter.rb +37 -0
- data/lib/stimulus_plumbers/components/progress_ring.rb +40 -0
- data/lib/stimulus_plumbers/components/timeline/event.rb +2 -1
- data/lib/stimulus_plumbers/components/timeline/group.rb +5 -3
- data/lib/stimulus_plumbers/form/fields/inputs/password.rb +1 -0
- data/lib/stimulus_plumbers/form/fields/inputs/search.rb +1 -0
- data/lib/stimulus_plumbers/generators/css_entrypoint.rb +15 -9
- data/lib/stimulus_plumbers/generators/tokens_directive.rb +6 -2
- data/lib/stimulus_plumbers/helpers/avatar_helper.rb +1 -7
- data/lib/stimulus_plumbers/helpers/button_helper.rb +1 -7
- data/lib/stimulus_plumbers/helpers/calendar_helper.rb +2 -9
- data/lib/stimulus_plumbers/helpers/calendar_turbo_helper.rb +3 -6
- data/lib/stimulus_plumbers/helpers/checklist_helper.rb +11 -0
- data/lib/stimulus_plumbers/helpers/indicator_helper.rb +11 -0
- data/lib/stimulus_plumbers/helpers/ordered_list_helper.rb +11 -0
- data/lib/stimulus_plumbers/helpers/popover_helper.rb +1 -7
- data/lib/stimulus_plumbers/helpers/progress_helper.rb +21 -0
- data/lib/stimulus_plumbers/helpers.rb +8 -0
- data/lib/stimulus_plumbers/themes/base.rb +4 -0
- data/lib/stimulus_plumbers/themes/schema/icon.rb +21 -4
- data/lib/stimulus_plumbers/themes/schema/indicator/ranges.rb +14 -0
- data/lib/stimulus_plumbers/themes/schema.rb +39 -3
- data/lib/stimulus_plumbers/version.rb +1 -1
- data/lib/stimulus_plumbers.rb +10 -0
- data/vendor/ARIA.md +22 -2
- data/vendor/component/manifest.json +212 -0
- data/vendor/controller/docs/calendar.md +4 -7
- data/vendor/controller/docs/checklist.md +45 -0
- data/vendor/controller/docs/combobox.md +1 -31
- data/vendor/controller/docs/input-clearable.md +1 -4
- data/vendor/controller/docs/input-formatter.md +1 -2
- data/vendor/controller/docs/modal.md +1 -4
- data/vendor/controller/docs/popover.md +1 -3
- data/vendor/controller/docs/progress.md +82 -0
- data/vendor/controller/docs/reorderable.md +82 -0
- data/vendor/controller/docs/visibility.md +31 -0
- data/vendor/controller/manifest.json +331 -20
- metadata +25 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@hotwired/stimulus`)):typeof define==`function`&&define.amd?define([`exports`,`@hotwired/stimulus`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.StimulusPlumbersControllers={},e.Stimulus))})(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var n=[`a[href]`,`area[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`,`audio[controls]`,`video[controls]`,`[contenteditable]:not([contenteditable="false"])`].join(`,`);function r(e){return Array.from(e.querySelectorAll(n)).filter(e=>i(e))}function i(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}function a(e){let t=r(e);return t.length>0?(t[0].focus(),!0):!1}var o=class{constructor(e,t={}){this.container=e,this.previouslyFocused=null,this.options=t,this.isActive=!1}activate(){this.isActive||(this.previouslyFocused=document.activeElement,this.isActive=!0,this.options.initialFocus?this.options.initialFocus.focus():a(this.container),this.container.addEventListener(`keydown`,this.handleKeyDown))}deactivate(){if(!this.isActive)return;this.isActive=!1,this.container.removeEventListener(`keydown`,this.handleKeyDown);let e=this.options.returnFocus||this.previouslyFocused;e&&i(e)&&e.focus(),typeof this.options.onDeactivate==`function`&&this.options.onDeactivate()}handleKeyDown=e=>{if(e.key===`Escape`&&this.options.escapeDeactivates){e.preventDefault(),this.deactivate();return}if(e.key!==`Tab`)return;let t=r(this.container);if(t.length===0)return;let n=t[0],i=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),i.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),n.focus())}};function s(e,t){return e.key===t}function c(e){return e.key===`Enter`||e.key===` `}function l(e){return[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`].includes(e.key)}function u(e){e.preventDefault(),e.stopPropagation()}var d=class{constructor(e,t={}){this.items=Array.from(e),this.currentIndex=t.initialIndex??0,this.orientation=t.orientation??`both`,this.wrap=t.wrap??!0,this._handleKeyDown=this._handleKeyDown.bind(this),this._handleClick=this._handleClick.bind(this)}activate(){return this.updateTabIndex(),this.items.forEach(e=>{e.addEventListener(`keydown`,this._handleKeyDown),e.addEventListener(`click`,this._handleClick)}),this}deactivate(){this.items.forEach(e=>{e.removeEventListener(`keydown`,this._handleKeyDown),e.removeEventListener(`click`,this._handleClick)})}updateItems(e){this.deactivate(),this.items=Array.from(e),this.currentIndex=Math.min(this.currentIndex,Math.max(0,this.items.length-1)),this.activate()}setCurrentIndex(e){e>=0&&e<this.items.length&&(this.currentIndex=e,this.updateTabIndex(),this.items[e].focus())}updateTabIndex(){this.items.forEach((e,t)=>{e.tabIndex=t===this.currentIndex?0:-1})}_handleClick(e){let t=this.items.indexOf(e.currentTarget);t!==-1&&(this.currentIndex=t,this.updateTabIndex())}_handleKeyDown(e){let t=this.items.indexOf(e.currentTarget);t!==-1&&t!==this.currentIndex&&(this.currentIndex=t,this.updateTabIndex());let n=this.orientation===`horizontal`?[]:[`ArrowUp`,`ArrowDown`],r=this.orientation===`vertical`?[]:[`ArrowLeft`,`ArrowRight`];if(![...n,...r,`Home`,`End`].includes(e.key))return;e.preventDefault();let i=t===-1?this.currentIndex:t,a;switch(e.key){case`ArrowDown`:case`ArrowRight`:a=this.wrap?(i+1)%this.items.length:Math.min(i+1,this.items.length-1);break;case`ArrowUp`:case`ArrowLeft`:a=this.wrap?(i-1+this.items.length)%this.items.length:Math.max(i-1,0);break;case`Home`:a=0;break;case`End`:a=this.items.length-1;break}this.setCurrentIndex(a)}},f=class{constructor(e,t={}){this.listbox=e,this.itemSelector=t.itemSelector??`[role="option"]:not([aria-disabled="true"]):not([hidden])`,this.wrap=t.wrap??!1,this.orientation=t.orientation??`vertical`}get selectedItem(){return this.listbox.querySelector(`${this.itemSelector}[aria-selected="true"]`)??null}get currentIndex(){return Array.from(this.listbox.querySelectorAll(this.itemSelector)).indexOf(this.selectedItem)}_selectItem(e){Array.from(this.listbox.querySelectorAll(this.itemSelector)).forEach(e=>e.setAttribute(`aria-selected`,`false`)),e.setAttribute(`aria-selected`,`true`),e.scrollIntoView({block:`nearest`})}step(e){let t=Array.from(this.listbox.querySelectorAll(this.itemSelector));if(!t.length)return;let n=this.listbox.querySelector(`${this.itemSelector}[aria-selected="true"]`),r=t.indexOf(n),i;i=e>0?this.wrap?t[(r+1)%t.length]:t[Math.min(r+1,t.length-1)]:this.wrap?t[(r-1+t.length)%t.length]:t[Math.max(r-1,0)],!(!i||i===n)&&this._selectItem(i)}handleKeyDown(e){let t=this.orientation===`horizontal`?[]:[`ArrowUp`,`ArrowDown`],n=this.orientation===`vertical`?[]:[`ArrowLeft`,`ArrowRight`];if(![...t,...n,`Home`,`End`,`Enter`,` `].includes(e.key))return;e.preventDefault();let r=Array.from(this.listbox.querySelectorAll(this.itemSelector));switch(e.key){case`ArrowDown`:case`ArrowRight`:this.step(1);break;case`ArrowUp`:case`ArrowLeft`:this.step(-1);break;case`Home`:r.length&&this._selectItem(r[0]);break;case`End`:r.length&&this._selectItem(r[r.length-1]);break;case`Enter`:case` `:this.listbox.querySelector(`${this.itemSelector}[aria-selected="true"]`)?.click();break}}},p=(e,t,n)=>{let r=document.querySelector(`[data-live-region="${e}"]`);return r||(r=document.createElement(`div`),r.className=`sr-only`,r.dataset.liveRegion=e,r.setAttribute(`aria-live`,e),r.setAttribute(`aria-atomic`,t.toString()),r.setAttribute(`aria-relevant`,n),document.body.appendChild(r)),r};function m(e,t={}){let{politeness:n=`polite`,atomic:r=!0,relevant:i=`additions text`}=t,a=p(n,r,i);a.textContent=``,setTimeout(()=>{a.textContent=e},100)}var h=(e=`a11y`)=>`${e}-${Math.random().toString(36).substr(2,9)}`,ee=(e,t=`element`)=>e.id||=h(t),g=(e,t,n)=>{e.setAttribute(t,n.toString())},_=(e,t)=>g(e,`aria-expanded`,t),v=(e,t)=>g(e,`aria-pressed`,t),te=(e,t)=>g(e,`aria-checked`,t),y=(e,t)=>t?e.setAttribute(`hidden`,``):e.removeAttribute(`hidden`);function ne(e,t){g(e,`aria-disabled`,t),t?e.setAttribute(`tabindex`,`-1`):e.removeAttribute(`tabindex`)}var b={menu:`menu`,listbox:`listbox`,tree:`tree`,grid:`grid`,dialog:`dialog`},x=(e,t,n)=>{Object.entries(t).forEach(([t,r])=>{e.setAttribute(t,r),n[t]=r})},S=(e,t,n)=>n||!e.hasAttribute(t);function C({trigger:e,target:t,role:n=null,override:r=!1}){let i={trigger:{},target:{}};if(!e||!t)return i;let a={},o={};if(n&&S(t,`role`,r)&&(o.role=n),t.id&&(S(e,`aria-controls`,r)&&(a[`aria-controls`]=t.id),n===`tooltip`&&S(e,`aria-describedby`,r)&&(a[`aria-describedby`]=t.id)),n&&S(e,`aria-haspopup`,r)){let e=b[n]||`true`;e&&(a[`aria-haspopup`]=e)}return x(t,o,i.target),x(e,a,i.trigger),i}var w=(e,t)=>{t.forEach(t=>{e.hasAttribute(t)&&e.removeAttribute(t)})};function re({trigger:e,target:t,attributes:n=null}){!e||!t||(w(e,n||[`aria-controls`,`aria-haspopup`,`aria-describedby`]),(!n||n.includes(`role`))&&w(t,[`role`]))}var T=class{constructor(){this._abortController=null,this._timer=null}schedule(e,t){clearTimeout(this._timer),this._timer=setTimeout(e,t)}async request(e,t={}){this._abortController?.abort(),this._abortController=new AbortController;let n=await fetch(e,{...t,signal:this._abortController.signal});if(!n.ok)throw Error(`${n.status}`);return n}cancel(){clearTimeout(this._timer),this._abortController?.abort()}};function ie(e,t){let n=0;for(let r=0;r<t.length&&n<e.length;r++)t[r]===e[n]&&n++;return n===e.length}function ae(e,t){return t.includes(e)}function oe(e,t){return t.startsWith(e)}function se(e){return e===`contains`?ae:e===`prefix`?oe:ie}function ce(e,t){return t===`textContent`?e.textContent?.trim().toLowerCase()??``:(e.getAttribute(t)??``).toLowerCase()}function E(e,t,n={}){let{strategy:r=`fuzzy`,matcher:i,fields:a=[`textContent`]}=n,o=typeof i==`function`?i:se(r),s=t.toLowerCase(),c=0;return e.querySelectorAll(`[role="option"]`).forEach(e=>{let t=a.some(t=>o(s,ce(e,t)));e.hidden=!t,t&&c++}),c}var D={get top(){return`bottom`},get bottom(){return`top`},get left(){return`right`},get right(){return`left`}};function O({x:e,y:t,width:n,height:r}){return{x:e,y:t,width:n,height:r,left:e,right:e+n,top:t,bottom:t+r}}function k(){return O({x:0,y:0,width:window.innerWidth||document.documentElement.clientWidth,height:window.innerHeight||document.documentElement.clientHeight})}function le(e){if(!(e instanceof HTMLElement))return!1;let t=k(),n=e.getBoundingClientRect(),r=n.top<=t.height&&n.top+n.height>0,i=n.left<=t.width&&n.left+n.width>0;return r&&i}var A={get visibleOnly(){return!0},hiddenClass:null},ue={element:null,visible:null,dispatch:!0,prefix:``},j=class{constructor(e,t={}){this.controller=e;let{element:n,visible:r,dispatch:i,prefix:a}=Object.assign({},ue,t);this.element=n||e.element,this.visibleOnly=typeof r==`boolean`?r:A.visibleOnly,this.visibleCallback=typeof r==`string`?r:null,this.notify=!!i,this.prefix=typeof a==`string`&&a?a:e.identifier}get visible(){return this.element instanceof HTMLElement?this.visibleOnly?le(this.element)&&this.isVisible(this.element):!0:!1}isVisible(e){if(this.visibleCallback){let t=this.findCallback(this.visibleCallback);if(typeof t==`function`)return t(e)}return e instanceof HTMLElement?!e.hasAttribute(`hidden`):!1}dispatch(e,{target:t=null,prefix:n=null,detail:r=null}={}){if(this.notify)return this.controller.dispatch(e,{target:t||this.element,prefix:n||this.prefix,detail:r})}findCallback(e){if(typeof e!=`string`)return;let t=this,n=e.split(`.`).reduce((e,t)=>e&&e[t],t.controller);if(typeof n==`function`)return n.bind(t.controller);let r=e.split(`.`).reduce((e,t)=>e&&e[t],t);if(typeof r==`function`)return r.bind(t)}async awaitCallback(e,...t){if(typeof e==`string`&&(e=this.findCallback(e)),typeof e==`function`){let n=e(...t);return n instanceof Promise?await n:n}}},de={normalize(e){return typeof e==`string`?e:``},validate(){return!0}};function fe(e){let t=0,n=!1;for(let r=e.length-1;r>=0;r--){let i=parseInt(e[r],10);n&&(i*=2,i>9&&(i-=9)),t+=i,n=!n}return t%10==0}var pe=/\D/g,me=/^\d{13,19}$/,he=/(.{4})(?=.)/g,ge={normalize(e){return typeof e==`string`?e.replace(pe,``):``},validate(e){return typeof e!=`string`||!me.test(e)?!1:fe(e)},format(e){return typeof e==`string`?e.replace(he,`$1 `):``}},_e={1:10},M=/\D/g,ve=/^\+\d{7,15}$/,ye={normalize(e){if(typeof e!=`string`)return``;let t=e.trimStart().startsWith(`+`),n=e.replace(M,``);return t?`+${n}`:n},validate(e){if(typeof e!=`string`)return!1;if(ve.test(e))return!0;let t=e.replace(M,``);return Object.values(_e).includes(t.length)},format(e){if(typeof e!=`string`)return``;let t=e.replace(M,``);for(let[e,n]of Object.entries(_e)){if(t.length===n)return`(${t.slice(0,3)}) ${t.slice(3,6)}-${t.slice(6)}`;let r=n+e.length;if(t.length===r&&t.startsWith(e)){let n=t.slice(e.length);return`+${e} (${n.slice(0,3)}) ${n.slice(3,6)}-${n.slice(6)}`}}return e}},be=/[^\d.,-]/g,xe=/^-?\d+(\.\d+)?$/,Se={normalize(e){if(typeof e!=`string`)return``;let t=e.replace(be,``);if(!t)return``;let n=t.lastIndexOf(`,`),r=t.lastIndexOf(`.`);return n>-1&&r>-1?n>r?t.replace(/\./g,``).replace(`,`,`.`):t.replace(/,/g,``):n>-1?t.slice(n+1).length<=2?t.replace(`,`,`.`):t.replace(/,/g,``):t},validate(e){return typeof e==`string`?xe.test(e):!1},format(e,t={}){if(typeof e!=`string`)return``;let n=parseFloat(e);if(isNaN(n))return e;let r=t.locale||`en-US`,i=t.currency||`USD`,a=t.fractionDigits===void 0?{}:{minimumFractionDigits:t.fractionDigits,maximumFractionDigits:t.fractionDigits};try{return new Intl.NumberFormat(r,{style:`currency`,currency:i,...a}).format(n)}catch{return e}}},N=/^\d{4}-\d{2}-\d{2}$/,Ce=/^(\d{1,4})[/\-.](\d{1,2})[/\-.](\d{1,4})$/,we=/\D/g,P={normalize(e){if(typeof e!=`string`)return``;let t=e.trim();if(N.test(t))return t;let n=t.match(Ce);if(n){let[,e,t,r]=n;if(e.length===4)return`${e}-${t.padStart(2,`0`)}-${r.padStart(2,`0`)}`;if(r.length===4)return`${r}-${e.padStart(2,`0`)}-${t.padStart(2,`0`)}`}let r=t.replace(we,``);if(r.length===8){let e=parseInt(r.slice(0,4),10);return e>=1e3&&e<=9999?`${r.slice(0,4)}-${r.slice(4,6)}-${r.slice(6,8)}`:`${r.slice(4,8)}-${r.slice(0,2)}-${r.slice(2,4)}`}return t},validate(e){if(typeof e!=`string`)return!1;let t=P.normalize(e);if(!N.test(t))return!1;let n=new Date(`${t}T00:00:00Z`);return!isNaN(n.getTime())&&n.toISOString().startsWith(t)},format(e,t={}){if(typeof e!=`string`)return``;let n=new Date(`${e}T00:00:00Z`);if(isNaN(n.getTime()))return e;let r=t.locale||`en-US`;try{return new Intl.DateTimeFormat(r,{year:t.year||`numeric`,month:t.month||`2-digit`,day:t.day||`2-digit`,timeZone:t.timeZone||`UTC`}).format(n)}catch{return e}}},Te=/^([01]?\d|2[0-3]):([0-5]\d)$/,F={normalize(e){if(typeof e!=`string`)return``;let t=e.trim();if(Te.test(t)){let[e,n]=t.split(`:`);return`${String(parseInt(e,10)).padStart(2,`0`)}:${n}`}let n=t.match(/^(\d{1,2}):(\d{2})\s*(AM|PM)$/i);if(n){let e=parseInt(n[1],10),t=n[2];return e=n[3].toUpperCase()===`AM`?e===12?0:e:e===12?12:e+12,e>23||parseInt(t,10)>59?``:`${String(e).padStart(2,`0`)}:${t}`}return``},validate(e){return F.normalize(e)!==``},format(e,t={}){if(typeof e!=`string`)return``;let n=e.match(/^(\d{2}):(\d{2})$/);if(!n)return e;let r=parseInt(n[1],10),i=n[2];if(t.format===`h24`)return`${String(r).padStart(2,`0`)}:${i}`;let a=r<12?`AM`:`PM`;return`${r%12||12}:${i} ${a}`}},I={PLAIN:`plain`,CREDIT_CARD:`creditCard`,PHONE:`phone`,CURRENCY:`currency`,DATE:`date`,TIME:`time`},L=new Map([[I.PLAIN,de],[I.CREDIT_CARD,ge],[I.PHONE,ye],[I.CURRENCY,Se],[I.DATE,P],[I.TIME,F]]),R={type:I.PLAIN,options:{}},z=class extends j{static register(e,t){L.set(e,t)}constructor(e,t={}){super(e,t),this.type=t.type??R.type,this.options=t.options??R.options,this.enhance()}enhance(){let e=this,t=L.get(e.type)??L.get(I.PLAIN),n={normalize:n=>t.normalize?.(n,e.options)??(typeof n==`string`?n:``),validate:n=>t.validate?.(n,e.options)??!0,format:n=>t.format?.(n,e.options)??(typeof n==`string`?n:``),mask:n=>t.mask?.(n,e.options)??null,maskable:()=>typeof t.mask==`function`};Object.defineProperty(this.controller,`formatter`,{get(){return n},configurable:!0})}},B=(e,t)=>new z(e,t),Ee=/^\d{4}-\d{2}-\d{2}$/;function V(e){return e instanceof Date&&!isNaN(e)}function H(...e){if(e.length===0)throw`Missing values to parse as date`;if(e.length===1){let t=e[0];if(!t)return;if(typeof t==`string`&&Ee.test(t)){let[e,n,r]=t.split(`-`).map(Number),i=new Date(e,n-1,r);if(V(i))return i}else{let e=new Date(t);if(V(e))return e}}else{let t=new Date(...e);if(V(t))return t}}var U=7,De=12,W=10,G={locales:[`default`],today:``,day:null,month:null,year:null,since:null,till:null,disabledDates:[],disabledWeekdays:[],disabledDays:[],disabledMonths:[],disabledYears:[],firstDayOfWeek:0,onNavigated:`navigated`},Oe=class extends j{constructor(e,t={}){super(e,t);let n=Object.assign({},G,t),{onNavigated:r,since:i,till:a,firstDayOfWeek:o}=n;this.onNavigated=r,this.since=H(i),this.till=H(a),this.firstDayOfWeek=0<=o&&o<7?o:G.firstDayOfWeek;let{disabledDates:s,disabledWeekdays:c,disabledDays:l,disabledMonths:u,disabledYears:d}=n;this.disabledDates=Array.isArray(s)?s:[],this.disabledWeekdays=Array.isArray(c)?c:[],this.disabledDays=Array.isArray(l)?l:[],this.disabledMonths=Array.isArray(u)?u:[],this.disabledYears=Array.isArray(d)?d:[];let{today:f,day:p,month:m,year:h}=n;this.now=H(f)||new Date,typeof h==`number`&&typeof m==`number`&&typeof p==`number`?this.current=H(h,m,p):this.current=this.now,this.build(),this.enhance()}build(){this.daysOfWeek=this.buildDaysOfWeek(),this.daysOfMonth=this.buildDaysOfMonth(),this.monthsOfYear=this.buildMonthsOfYear(),this.yearsOfDecade=this.buildYearsOfDecade()}buildDaysOfWeek(){let e=new Intl.DateTimeFormat(this.localesValue,{weekday:`long`}),t=new Intl.DateTimeFormat(this.localesValue,{weekday:`short`}),n=new Date(`2024-10-06`),r=[];for(let i=this.firstDayOfWeek,a=i+7;i<a;i++){let a=new Date(n);a.setDate(n.getDate()+i),r.push({date:a,value:a.getDay(),long:e.format(a),short:t.format(a)})}return r}buildDaysOfMonth(){let e=this.month,t=this.year,n=[],r=e=>({current:this.month===e.getMonth()&&this.year===e.getFullYear(),date:e,value:e.getDate(),month:e.getMonth(),year:e.getFullYear(),iso:e.toISOString()}),i=new Date(t,e).getDay(),a=this.firstDayOfWeek-i;for(let i=a>0?a-7:a;i<0;i++){let a=new Date(t,e,i+1);n.push(r(a))}let o=new Date(t,e+1,0).getDate();for(let i=1;i<=o;i++){let a=new Date(t,e,i);n.push(r(a))}let s=n.length%U,c=s===0?0:U-s;for(let i=1;i<=c;i++){let a=new Date(t,e+1,i);n.push(r(a))}return n}buildMonthsOfYear(){let e=new Intl.DateTimeFormat(this.localesValue,{month:`long`}),t=new Intl.DateTimeFormat(this.localesValue,{month:`short`}),n=new Intl.DateTimeFormat(this.localesValue,{month:`numeric`}),r=[];for(let i=0;i<De;i++){let a=new Date(this.year,i),o=new Date(this.year,i,1),s=new Date(this.year,i+1,0),c=t.format(a),l=e.format(a),u=this.since&&s<this.since||this.till&&o>this.till,d=this.disabledMonths.some(e=>i==e||c===e||l===e);r.push({date:a,value:a.getMonth(),long:l,short:c,numeric:n.format(a),disabled:u||d})}return r}buildYearsOfDecade(){let e=Math.floor(this.year/W)*W,t=[];for(let n=e-1;n<=e+W;n++){let r=n<e||n>e+W-1,i=this.since&&n<this.since.getFullYear()||this.till&&n>this.till.getFullYear(),a=this.disabledYears.some(e=>n==e);t.push({value:n,current:n===this.year,disabled:r||i||a})}return t}get today(){return this.now}set today(e){if(!V(e))return;let t=this.month??e.getMonth(),n=this.year??e.getFullYear(),r=t==e.getMonth()&&n==e.getFullYear()?e.getDate():1;this.now=new Date(n,t,r)}get current(){return typeof this.year==`number`&&typeof this.month==`number`&&typeof this.day==`number`?H(this.year,this.month,this.day):null}set current(e){V(e)&&(this.day=e.getDate(),this.month=e.getMonth(),this.year=e.getFullYear())}navigate=async e=>{if(!V(e))return;let t=this.current,n=e.toISOString(),r=t.toISOString();this.dispatch(`navigate`,{detail:{from:r,to:n}}),this.current=e,this.build(),await this.awaitCallback(this.onNavigated,{from:r,to:n}),this.dispatch(`navigated`,{detail:{from:r,to:n}})};step=async(e,t)=>{if(t===0)return;let n=this.current;switch(e){case`year`:n.setFullYear(n.getFullYear()+t);break;case`month`:n.setMonth(n.getMonth()+t);break;case`day`:n.setDate(n.getDate()+t);break;default:return}await this.navigate(n)};isDisabled=e=>{if(!V(e))return!1;if(this.disabledDates.length){let t=e.getTime();for(let e of this.disabledDates)if(t===new Date(e).getTime())return!0}if(this.disabledWeekdays.length){let t=e.getDay(),n=this.daysOfWeek,r=n.findIndex(e=>e.value===t);if(r>=0){let e=n[r];for(let t of this.disabledWeekdays)if(e.value==t||e.short===t||e.long===t)return!0}}if(this.disabledDays.length){let t=e.getDate();for(let e of this.disabledDays)if(t==e)return!0}if(this.disabledMonths.length){let t=e.getMonth(),n=this.monthsOfYear,r=n.findIndex(e=>e.value===t);if(r>=0){let e=n[r];for(let t of this.disabledMonths)if(e.value==t||e.short===t||e.long===t)return!0}}if(this.disabledYears.length){let t=e.getFullYear();for(let e of this.disabledYears)if(t==e)return!0}return!1};isWithinRange=e=>{if(!V(e))return!1;let t=!0;return this.since&&(t&&=e>=this.since),this.till&&(t&&=e<=this.till),t};enhance(){let e=this;Object.assign(this.controller,{get calendar(){return{get today(){return e.today},get current(){return e.current},get day(){return e.day},get month(){return e.month},get year(){return e.year},get since(){return e.since},get till(){return e.till},get firstDayOfWeek(){return e.firstDayOfWeek},get disabledDates(){return e.disabledDates},get disabledWeekdays(){return e.disabledWeekdays},get disabledDays(){return e.disabledDays},get disabledMonths(){return e.disabledMonths},get disabledYears(){return e.disabledYears},get daysOfWeek(){return e.daysOfWeek},get daysOfMonth(){return e.daysOfMonth},get monthsOfYear(){return e.monthsOfYear},get yearsOfDecade(){return e.yearsOfDecade},navigate:async t=>await e.navigate(t),step:async(t,n)=>await e.step(t,n),isDisabled:t=>e.isDisabled(t),isWithinRange:t=>e.isWithinRange(t)}}})}},K=(e,t)=>new Oe(e,t),ke=class extends j{constructor(e,t={}){super(e,t),this.handle=this.handle.bind(this),this.onSelect=t.onSelect||null}attach(){this.element.addEventListener(`click`,this.handle)}detach(){this.element.removeEventListener(`click`,this.handle)}handle(e){if(!(e.target instanceof HTMLElement))return;e.preventDefault();let t=e.target instanceof HTMLTimeElement?e.target.parentElement:e.target;if(t.disabled||t.getAttribute(`aria-disabled`)===`true`)return;let n=e.target instanceof HTMLTimeElement?e.target:e.target.querySelector(`time`);if(!n)return;let r=H(n.dateTime);if(!r)return;this.dispatch(`selecting`,{target:t});let i=r.toISOString();this.onSelect?this.awaitCallback(this.onSelect,i):this.dispatch(`selected`,{detail:{epoch:r.getTime(),iso:i}})}},Ae=class extends j{constructor(e,t={}){super(e,t),this.handle=this.handle.bind(this)}attach(){this.element.addEventListener(`click`,this.handle)}detach(){this.element.removeEventListener(`click`,this.handle)}handle(e){let t=e.target.closest(`button[data-month]`);if(!t||t.disabled||t.getAttribute(`aria-disabled`)===`true`)return;e.preventDefault();let n=parseInt(t.dataset.month,10);isNaN(n)||this.dispatch(`selected`,{detail:{month:n}})}},je=class extends j{constructor(e,t={}){super(e,t),this.handle=this.handle.bind(this)}attach(){this.element.addEventListener(`click`,this.handle)}detach(){this.element.removeEventListener(`click`,this.handle)}handle(e){let t=e.target.closest(`button[data-year]`);if(!t||t.disabled||t.getAttribute(`aria-disabled`)===`true`)return;e.preventDefault();let n=parseInt(t.dataset.year,10);isNaN(n)||this.dispatch(`selected`,{detail:{year:n}})}},q=(e,t)=>new ke(e,t),J=(e,t)=>new Ae(e,t),Y=(e,t)=>new je(e,t),X={content:null,url:``,reload:`never`,stale:3600,onLoad:`canLoad`,onLoaded:`contentLoaded`},Me=class extends j{constructor(e,t={}){super(e,t);let n=Object.assign({},X,t),{content:r,url:i,reload:a,stale:o}=n;this.content=r,this.url=i,this.reload=typeof a==`string`?a:X.reload,this.stale=typeof o==`number`?o:X.stale;let{onLoad:s,onLoaded:c}=n;this.onLoad=s,this.onLoaded=c,this._requestor=new T,this.enhance()}get reloadable(){switch(this.reload){case`never`:return!1;case`always`:return!0;default:{let e=H(this.loadedAt);return e&&new Date-e>this.stale*1e3}}}contentLoadable=({url:e})=>!!e;contentLoader=async()=>``;remoteContentLoader=async e=>(await this._requestor.request(e)).text();load=async()=>{if(this.loadedAt&&!this.reloadable)return;let e=this.findCallback(this.onLoad),t=await this.awaitCallback(e||this.contentLoadable,{url:this.url});if(this.dispatch(`load`,{detail:{url:this.url}}),!t)return;this.dispatch(`loading`,{detail:{url:this.url}});let n=this.url?await this.remoteContentLoader(this.url):await this.contentLoader();n&&(await this.awaitCallback(this.onLoaded,{url:this.url,content:n}),this.loadedAt=new Date().getTime(),this.dispatch(`loaded`,{detail:{url:this.url,content:n}}))};enhance(){let e=this;Object.assign(this.controller,{load:e.load.bind(e)})}},Ne=(e,t)=>new Me(e,t),Z=class extends j{observe(e){this._handler=e,this.events.forEach(t=>window.addEventListener(t,e,!0))}unobserve(){this._handler&&this.events.forEach(e=>window.removeEventListener(e,this._handler,!0))}enhance(){let e=this,t=this.controller.disconnect?.bind(this.controller)||(()=>{});this.controller.disconnect=()=>{e.unobserve(),t()}}},Pe={trigger:null,events:[`click`],onDismissed:`dismissed`},Fe=class extends Z{constructor(e,t={}){super(e,t);let{trigger:n,events:r,onDismissed:i}=Object.assign({},Pe,t);this.onDismissed=i,this.trigger=n||this.element,this.events=r,this.enhance(),this.observe(this.dismiss)}dismiss=async e=>{let{target:t}=e;t instanceof HTMLElement&&(this.element.contains(t)||this.visible&&(this.dispatch(`dismiss`),await this.awaitCallback(this.onDismissed,{target:this.trigger}),this.dispatch(`dismissed`)))}},Q=(e,t)=>new Fe(e,t),Ie={anchor:null,events:[`click`],placement:`bottom`,alignment:`start`,onFlipped:`flipped`,ariaRole:null,respectMotion:!0},Le=class extends Z{constructor(e,t={}){super(e,t);let{anchor:n,events:r,placement:i,alignment:a,onFlipped:o,ariaRole:s,respectMotion:c}=Object.assign({},Ie,t);this.anchor=n,this.events=r,this.placement=i,this.alignment=a,this.onFlipped=o,this.ariaRole=s,this.respectMotion=c,this.prefersReducedMotion=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,this.anchor&&this.element&&C({trigger:this.anchor,target:this.element,role:this.ariaRole}),this.enhance(),this.observe(this.flip)}flip=async()=>{if(!this.visible)return;this.dispatch(`flip`),window.getComputedStyle(this.element).position!=`absolute`&&(this.element.style.position=`absolute`);let e=this.flippedRect(this.anchor.getBoundingClientRect(),this.element.getBoundingClientRect());this.element.style.transition=this.respectMotion&&this.prefersReducedMotion?`none`:``;for(let[t,n]of Object.entries(e))this.element.style[t]=n;await this.awaitCallback(this.onFlipped,{target:this.element,placement:e}),this.dispatch(`flipped`,{detail:{placement:e}})};flippedRect(e,t){let n=this.quadrumRect(e,k()),r=[this.placement,D[this.placement]],i={};for(;!Object.keys(i).length&&r.length>0;){let a=r.shift();if(!this.biggerRectThan(n[a],t))continue;let o=this.quadrumPlacement(e,a,t),s=this.quadrumAlignment(e,a,o);i.top=`${s.top+window.scrollY}px`,i.left=`${s.left+window.scrollX}px`}return Object.keys(i).length||(i.top=``,i.left=``),i}quadrumRect(e,t){return{left:O({x:t.x,y:t.y,width:e.x-t.x,height:t.height}),right:O({x:e.x+e.width,y:t.y,width:t.width-(e.x+e.width),height:t.height}),top:O({x:t.x,y:t.y,width:t.width,height:e.y-t.y}),bottom:O({x:t.x,y:e.y+e.height,width:t.width,height:t.height-(e.y+e.height)})}}quadrumPlacement(e,t,n){switch(t){case`top`:return O({x:n.x,y:e.y-n.height,width:n.width,height:n.height});case`bottom`:return O({x:n.x,y:e.y+e.height,width:n.width,height:n.height});case`left`:return O({x:e.x-n.width,y:n.y,width:n.width,height:n.height});case`right`:return O({x:e.x+e.width,y:n.y,width:n.width,height:n.height});default:throw`Unable place at the quadrum, ${t}`}}quadrumAlignment(e,t,n){switch(t){case`top`:case`bottom`:{let t=e.x;return this.alignment===`center`?t=e.x+e.width/2-n.width/2:this.alignment===`end`&&(t=e.x+e.width-n.width),O({x:t,y:n.y,width:n.width,height:n.height})}case`left`:case`right`:{let t=e.y;return this.alignment===`center`?t=e.y+e.height/2-n.height/2:this.alignment===`end`&&(t=e.y+e.height-n.height),O({x:n.x,y:t,width:n.width,height:n.height})}default:throw`Unable align at the quadrum, ${t}`}}biggerRectThan(e,t){return e.height>=t.height&&e.width>=t.width}enhance(){super.enhance(),this.controller.flip=this.flip}},Re=(e,t)=>new Le(e,t),ze={events:[`resize`],boundaries:[`top`,`left`,`right`],onShifted:`shifted`,respectMotion:!0},Be=class extends Z{constructor(e,t={}){super(e,t);let{onShifted:n,events:r,boundaries:i,respectMotion:a}=Object.assign({},ze,t);this.onShifted=n,this.events=r,this.boundaries=i,this.respectMotion=a,this.prefersReducedMotion=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,this.enhance(),this.observe(this.shift)}shift=async()=>{if(!this.visible)return;this.dispatch(`shift`);let e=this.overflowRect(this.element.getBoundingClientRect(),this.elementTranslations(this.element)),t=e.left||e.right||0,n=e.top||e.bottom||0;this.element.style.transition=this.respectMotion&&this.prefersReducedMotion?`none`:``,this.element.style.transform=`translate(${t}px, ${n}px)`,await this.awaitCallback(this.onShifted,e),this.dispatch(`shifted`,{detail:e})};overflowRect(e,t){let n={},r=k(),i=O({x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height});for(let e of this.boundaries){let t=this.directionDistance(i,e,r),a=D[e];t<0?i[a]+t>=r[a]&&!n[a]&&(n[e]=t):n[e]=``}return n}directionDistance(e,t,n){switch(t){case`top`:case`left`:return e[t]-n[t];case`bottom`:case`right`:return n[t]-e[t];default:throw`Invalid direction to calcuate distance, ${t}`}}elementTranslations(e){let t=window.getComputedStyle(e),n=t.transform||t.webkitTransform||t.mozTransform;if(n===`none`||n===void 0)return{x:0,y:0};let r=n.includes(`3d`)?`3d`:`2d`,i=n.match(/matrix.*\((.+)\)/)[1].split(`, `);return r===`2d`?{x:Number(i[4]),y:Number(i[5])}:{x:0,y:0}}enhance(){super.enhance(),this.controller.shift=this.shift}},Ve=(e,t)=>new Be(e,t),He={visibility:`visibility`,onShown:`shown`,onHidden:`hidden`},Ue=class extends j{constructor(e,t={}){let{visibility:n,onShown:r,onHidden:i,activator:a}=Object.assign({},He,t),o=typeof n==`string`?n:He.namespace,s=typeof t.visible==`string`?t.visible:`isVisible`;(typeof t.visible!=`boolean`||t.visible)&&(t.visible=`${o}.${s}`),super(e,t),this.visibility=o,this.visibilityResolver=s,this.onShown=r,this.onHidden=i,this.activator=a instanceof HTMLElement?a:null,this.enhance(),this.element instanceof HTMLElement&&this.activate(this.isVisible(this.element))}isVisible(e){if(!(e instanceof HTMLElement))return!1;let t=A.hiddenClass;return t?!e.classList.contains(t):!e.hasAttribute(`hidden`)}toggle(e,t){if(!(e instanceof HTMLElement))return;let n=A.hiddenClass;n?t?e.classList.remove(n):e.classList.add(n):y(e,!t)}activate(e){this.activator&&_(this.activator,e)}async show(){!(this.element instanceof HTMLElement)||this.isVisible(this.element)||(this.dispatch(`show`),this.toggle(this.element,!0),this.activate(!0),await this.awaitCallback(this.onShown,{target:this.element}),this.dispatch(`shown`))}async hide(){!(this.element instanceof HTMLElement)||!this.isVisible(this.element)||(this.dispatch(`hide`),this.toggle(this.element,!1),this.activate(!1),await this.awaitCallback(this.onHidden,{target:this.element}),this.dispatch(`hidden`))}enhance(){let e=this,t={show:e.show.bind(e),hide:e.hide.bind(e)};Object.defineProperty(t,`visible`,{get(){return e.isVisible(e.element)}}),Object.defineProperty(t,this.visibilityResolver,{value:e.isVisible.bind(e)}),Object.defineProperty(this.controller,this.visibility,{get(){return t}})}},We=(e,t)=>new Ue(e,t),Ge=4,Ke=class extends t.Controller{static targets=[`grid`];static values={current:Number,today:{type:String,default:``},selected:{type:String,default:``},since:{type:String,default:``},till:{type:String,default:``}};initialize(){this.selector=Y(this),K(this,{today:this.todayValue,year:this.currentValue||void 0,since:this.sinceValue||null,till:this.tillValue||null})}connect(){this.selector.attach(),this.navigated()}disconnect(){this.selector.detach()}currentValueChanged(){!this.calendar||!this.hasCurrentValue||this.calendar.navigate(this.currentDate)}selectedValueChanged(){if(!this.hasGridTarget)return;let e=H(this.selectedValue),t=e?e.getFullYear():null;this.gridTarget.querySelectorAll(`button[data-year]`).forEach(e=>{let n=parseInt(e.dataset.year,10);e.setAttribute(`aria-selected`,n===t?`true`:`false`)})}navigate(e){this.currentValue=e.getFullYear()}step(e,t){return this.calendar.step(e,t)}navigated(){this.drawGrid()}get currentDate(){return new Date(this.currentValue,0,1)}drawGrid(){if(!this.hasGridTarget)return;let{yearsOfDecade:e}=this.calendar,t=this.calendar.today.getFullYear(),n=H(this.selectedValue),r=n?n.getFullYear():null,i=[];for(let n of e){let e=document.createElement(`button`);e.type=`button`,e.textContent=n.value,e.dataset.year=n.value,e.setAttribute(`role`,`gridcell`),e.setAttribute(`aria-selected`,n.value===r?`true`:`false`),n.value===t&&e.setAttribute(`aria-current`,`year`),n.disabled&&e.setAttribute(`aria-disabled`,`true`),i.push(e)}let a=document.createElement(`div`);a.setAttribute(`role`,`rowgroup`);for(let e=0;e<i.length;e+=Ge){let t=document.createElement(`div`);t.setAttribute(`role`,`row`);for(let n of i.slice(e,e+Ge))t.appendChild(n);a.appendChild(t)}this.gridTarget.replaceChildren(a)}},qe=class extends t.Controller{initialize(){this.selector=Y(this)}connect(){this.selector.attach()}disconnect(){this.selector.detach()}},Je=class extends t.Controller{static targets=[`daysOfWeek`,`daysOfMonth`];static classes=[`dayOfWeek`,`dayOfMonth`,`dayOfOtherMonth`,`row`];static values={year:Number,month:Number,today:{type:String,default:``},selected:{type:String,default:``},since:{type:String,default:``},till:{type:String,default:``},locales:{type:Array,default:[`default`]},weekdayFormat:{type:String,default:`short`},dayFormat:{type:String,default:`numeric`},daysOfOtherMonth:{type:Boolean,default:!1}};initialize(){this.selector=q(this,{onSelect:`select`}),K(this,{today:this.todayValue,since:this.sinceValue||null,till:this.tillValue||null})}connect(){this.selector.attach(),this.navigated()}disconnect(){this.selector.detach()}yearValueChanged(){!this.calendar||!this.hasYearValue||this._scheduleNavigate()}monthValueChanged(){!this.calendar||!this.hasYearValue||this._scheduleNavigate()}_scheduleNavigate(){this._navigatePending||(this._navigatePending=!0,queueMicrotask(async()=>{this._navigatePending=!1,await this.calendar.navigate(this.currentDate),this.navigated()}))}selectedValueChanged(){if(!this.hasDaysOfMonthTarget||(this.daysOfMonthTarget.querySelectorAll(`[aria-selected]`).forEach(e=>{e.setAttribute(`aria-selected`,`false`)}),!this.selectedValue))return;let e=H(this.selectedValue);if(!e)return;let t=this.daysOfMonthTarget.querySelector(`time[datetime="${e.toISOString()}"]`);t&&t.closest(`[aria-selected]`)?.setAttribute(`aria-selected`,`true`)}navigate(e){this.yearValue=e.getFullYear(),this.monthValue=e.getMonth()}step(e,t){return this.calendar.step(e,t)}select(e){let t=H(e);t&&(this.selectedValue=e,(t.getMonth()!==this.calendar.month||t.getFullYear()!==this.calendar.year)&&this.calendar.navigate(t),this.dispatch(`selected`,{detail:{epoch:t.getTime(),iso:e}}))}navigated(){this.drawDaysOfWeek(),this.drawDaysOfMonth(),this.selectedValueChanged()}get currentDate(){return new Date(this.yearValue,this.monthValue,1)}createDayElement(e,{selectable:t=!1,disabled:n=!1}={}){let r=document.createElement(t?`button`:`div`);return r.tabIndex=-1,e?r.textContent=e:r.setAttribute(`aria-hidden`,`true`),n&&(r instanceof HTMLButtonElement?r.disabled=!0:r.setAttribute(`aria-disabled`,`true`)),r}drawDaysOfWeek(){if(!this.hasDaysOfWeekTarget)return;let e=new Intl.DateTimeFormat(this.localesValue,{weekday:this.weekdayFormatValue}),t=[];for(let n of this.calendar.daysOfWeek){let r=this.createDayElement(e.format(n.date));r.setAttribute(`role`,`columnheader`),r.title=n.long,this.hasDayOfWeekClass&&r.classList.add(...this.dayOfWeekClasses),t.push(r)}let n=document.createElement(`div`);n.setAttribute(`role`,`row`),this.hasRowClass&&n.classList.add(...this.rowClasses),n.replaceChildren(...t),this.daysOfWeekTarget.replaceChildren(n)}drawDaysOfMonth(){if(!this.hasDaysOfMonthTarget)return;let e=this.calendar.today,t=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),n=[];for(let e of this.calendar.daysOfMonth){let r=this.calendar.isDisabled(e.date)||!this.calendar.isWithinRange(e.date),i=!e.current&&this.daysOfOtherMonthValue&&!r,a=e.current||this.daysOfOtherMonthValue?e.value:``,o=this.createDayElement(a,{selectable:e.current||i,disabled:e.current?r:!i});t===e.date.getTime()&&o.setAttribute(`aria-current`,`date`),(e.current||this.daysOfOtherMonthValue)&&o.setAttribute(`aria-selected`,``),!e.current&&this.daysOfOtherMonthValue&&this.hasDayOfOtherMonthClass?o.classList.add(...this.dayOfOtherMonthClasses):this.hasDayOfMonthClass&&o.classList.add(...this.dayOfMonthClasses);let s=document.createElement(`time`);s.dateTime=e.iso,o.appendChild(s),n.push(o)}let r=[];for(let e=0;e<n.length;e+=7){let t=document.createElement(`div`);t.setAttribute(`role`,`row`),this.hasRowClass&&t.classList.add(...this.rowClasses);for(let r of n.slice(e,e+7))r.setAttribute(`role`,`gridcell`),t.appendChild(r);r.push(t)}this.daysOfMonthTarget.replaceChildren(...r)}},Ye=class extends t.Controller{initialize(){this.selector=q(this)}connect(){this.selector.attach()}disconnect(){this.selector.detach()}},Xe=4,Ze=class extends t.Controller{static targets=[`grid`];static values={current:Number,today:{type:String,default:``},selected:{type:String,default:``},since:{type:String,default:``},till:{type:String,default:``},locales:{type:Array,default:[`default`]},monthFormat:{type:String,default:`short`}};initialize(){this.selector=J(this),K(this,{today:this.todayValue,year:this.currentValue||void 0,since:this.sinceValue||null,till:this.tillValue||null})}connect(){this.selector.attach(),this.navigated()}disconnect(){this.selector.detach()}currentValueChanged(){!this.calendar||!this.hasCurrentValue||this.calendar.navigate(this.currentDate)}selectedValueChanged(){if(!this.hasGridTarget)return;let e=H(this.selectedValue);this.gridTarget.querySelectorAll(`button[data-month]`).forEach(t=>{let n=parseInt(t.dataset.month,10)-1;t.setAttribute(`aria-selected`,e&&e.getMonth()===n?`true`:`false`)})}navigate(e){this.currentValue=e.getFullYear()}step(e,t){return this.calendar.step(e,t)}navigated(){this.drawGrid()}get currentDate(){return new Date(this.currentValue,0,1)}drawGrid(){if(!this.hasGridTarget)return;let{year:e,monthsOfYear:t}=this.calendar,n=this.calendar.today,r=H(this.selectedValue),i=[],a=new Intl.DateTimeFormat(this.localesValue,{month:this.monthFormatValue});for(let o of t){let t=document.createElement(`button`);t.type=`button`,t.textContent=a.format(o.date),t.dataset.month=o.value+1,t.setAttribute(`role`,`gridcell`);let s=r&&r.getMonth()===o.value;t.setAttribute(`aria-selected`,s?`true`:`false`),o.value===n.getMonth()&&e===n.getFullYear()&&t.setAttribute(`aria-current`,`month`),o.disabled&&t.setAttribute(`aria-disabled`,`true`),i.push(t)}let o=document.createElement(`div`);o.setAttribute(`role`,`rowgroup`);for(let e=0;e<i.length;e+=Xe){let t=document.createElement(`div`);t.setAttribute(`role`,`row`);for(let n of i.slice(e,e+Xe))t.appendChild(n);o.appendChild(t)}this.gridTarget.replaceChildren(o)}},Qe=class extends t.Controller{initialize(){this.selector=J(this)}connect(){this.selector.attach()}disconnect(){this.selector.detach()}},$e=class extends t.Controller{static targets=[`source`];static values={contentType:{type:String,default:`text/plain`}};onPaste(e){let t=e.clipboardData?.getData(this.contentTypeValue)??``,n=Array.from(e.clipboardData?.types??[]);e.preventDefault(),this.dispatch(`pasted`,{detail:{text:t,types:n},bubbles:!0})}async copy(e){let t=e.params?.text??(this.hasSourceTarget?this.sourceTarget.value??this.sourceTarget.textContent??``:``);try{await navigator.clipboard.writeText(t),this.dispatch(`copied`,{detail:{text:t},bubbles:!0})}catch(e){this.dispatch(`copy-failed`,{detail:{error:e},bubbles:!0})}}},$=[`month`,`year`,`decade`],et=class extends t.Controller{static targets=[`previous`,`next`,`day`,`month`,`year`,`viewTitle`];static outlets=[`calendar-month`,`calendar-year`,`calendar-decade`];static values={date:String,view:{type:String,default:`month`},locales:{type:Array,default:[`default`]},dayFormat:{type:String,default:`numeric`},monthFormat:{type:String,default:`long`},yearFormat:{type:String,default:`numeric`}};initialize(){this.previous=this.previous.bind(this),this.next=this.next.bind(this)}async calendarMonthOutletConnected(){if(this.dateValue){let e=H(this.dateValue);e&&await this.calendarMonthOutlet.calendar.navigate(e)}this.draw()}onDaySelect(e){this.dateValue=e.detail.iso,this.draw(),this.dispatch(`selected`,{detail:{value:e.detail.iso},bubbles:!0})}zoomOut(){let e=$.indexOf(this.viewValue);e<$.length-1&&(this.viewValue=$[e+1],this.draw())}async onMonthSelect(e){let{month:t}=e.detail;if(!this.hasCalendarMonthOutlet)return;let{year:n}=this.calendarMonthOutlet.calendar;await this.calendarMonthOutlet.calendar.navigate(new Date(n,t-1,1)),this.viewValue=`month`,this.draw()}async onYearSelect(e){let{year:t}=e.detail;if(!this.hasCalendarMonthOutlet)return;let{month:n}=this.calendarMonthOutlet.calendar;await this.calendarMonthOutlet.calendar.navigate(new Date(t,n,1)),this.hasCalendarYearOutlet&&this.calendarYearOutlet.navigate(this.calendarMonthOutlet.calendar.current),this.viewValue=`year`,this.draw()}previousTargetConnected(e){e.addEventListener(`click`,this.previous)}previousTargetDisconnected(e){e.removeEventListener(`click`,this.previous)}async previous(){await this.calendarMonthOutlet.calendar.step(...this.stepArgs(-1)),this.syncOutletValues(),this.draw()}nextTargetConnected(e){e.addEventListener(`click`,this.next)}nextTargetDisconnected(e){e.removeEventListener(`click`,this.next)}async next(){await this.calendarMonthOutlet.calendar.step(...this.stepArgs(1)),this.syncOutletValues(),this.draw()}draw(){this.drawDay(),this.drawMonth(),this.drawYear(),this.drawViewTitle(),this.drawView()}drawDay(){if(!this.hasDayTarget||!this.hasCalendarMonthOutlet)return;let{year:e,month:t,day:n}=this.calendarMonthOutlet.calendar;this.dayTarget.textContent=new Intl.DateTimeFormat(this.localesValue,{day:this.dayFormatValue}).format(new Date(e,t,n))}drawMonth(){if(!this.hasMonthTarget||!this.hasCalendarMonthOutlet)return;let{year:e,month:t}=this.calendarMonthOutlet.calendar;this.monthTarget.textContent=new Intl.DateTimeFormat(this.localesValue,{month:this.monthFormatValue}).format(new Date(e,t))}drawYear(){if(!this.hasYearTarget||!this.hasCalendarMonthOutlet)return;let{year:e}=this.calendarMonthOutlet.calendar;this.yearTarget.textContent=new Intl.DateTimeFormat(this.localesValue,{year:this.yearFormatValue}).format(new Date(e,0))}drawViewTitle(){if(!this.hasViewTitleTarget||!this.hasCalendarMonthOutlet)return;let{year:e,month:t}=this.calendarMonthOutlet.calendar;this.viewTitleTarget.textContent=this.viewTitleLabel(e,t)}syncOutletValues(){if(!this.hasCalendarMonthOutlet)return;let{current:e}=this.calendarMonthOutlet.calendar;e&&(this.hasCalendarYearOutlet&&this.calendarYearOutlet.navigate(e),this.hasCalendarDecadeOutlet&&this.calendarDecadeOutlet.navigate(e))}stepArgs(e){return this.viewValue===`year`?[`year`,e]:this.viewValue===`decade`?[`year`,e*10]:[`month`,e]}viewTitleLabel(e,t){if(this.viewValue===`year`)return String(e);if(this.viewValue===`decade`){let t=Math.floor(e/10)*10;return`${t}–${t+9}`}return new Intl.DateTimeFormat(this.localesValue,{month:`long`,year:`numeric`}).format(new Date(e,t))}drawView(){let e=this.viewValue===`month`,t=this.viewValue===`year`,n=this.viewValue===`decade`;if(this.hasCalendarMonthOutlet){let t=this.calendarMonthOutlet;t.hasDaysOfWeekTarget&&(t.daysOfWeekTarget.hidden=!e),t.hasDaysOfMonthTarget&&(t.daysOfMonthTarget.hidden=!e)}this.hasCalendarYearOutlet&&(this.calendarYearOutletElement.hidden=!t),this.hasCalendarDecadeOutlet&&(this.calendarDecadeOutletElement.hidden=!n)}},tt=class extends t.Controller{static targets=[`listbox`,`loading`,`empty`];static values={url:{type:String,default:``},field:{type:String,default:`q`},delay:{type:Number,default:300}};initialize(){this._requestor=new T}connect(){this.hasListboxTarget&&(this.listboxNav=new f(this.listboxTarget))}disconnect(){this._requestor.cancel()}onSelect(e){let t=e.target.closest(`[role="option"]`);!t||t.getAttribute(`aria-disabled`)===`true`||this.select(t.dataset.value??``)}select(e){let t=this.listboxTarget.querySelectorAll(`[role="option"]`);t.forEach(e=>e.setAttribute(`aria-selected`,`false`));let n=[...t].find(t=>t.dataset.value===e);n&&n.setAttribute(`aria-selected`,`true`),this.dispatch(`selected`,{detail:{value:e},bubbles:!0})}onNavigate(e){this.listboxNav?.handleKeyDown(e)}filter(e){if(this.urlValue){let t=new URL(this.urlValue,window.location.href);t.searchParams.set(this.fieldValue,e),this.setLoading(!0),this._requestor.schedule(()=>this._requestor.request(t).then(e=>e.text()).then(e=>{this.listboxTarget.innerHTML=e,this.setEmpty(this.listboxTarget.querySelectorAll(`[role="option"]`).length===0)}).catch(e=>{e.name!==`AbortError`&&console.error(`[combobox-dropdown] fetch failed`,e)}).finally(()=>this.setLoading(!1)),this.delayValue)}else{let t=E(this.listboxTarget,e);this.setEmpty(t===0)}}showAll(){this.listboxTarget.querySelectorAll(`[role="option"]`).forEach(e=>e.hidden=!1),this.setEmpty(!1)}setLoading(e){this.hasLoadingTarget&&(this.loadingTarget.hidden=!e)}setEmpty(e){this.hasEmptyTarget&&(this.emptyTarget.hidden=!e)}},nt=class extends t.Controller{static targets=[`hour`,`minute`,`period`];connect(){this.select(this.toH24())}onSelect(e){let t=e.target.closest(`[role="option"]`);t&&(t.closest(`[role="listbox"]`).querySelectorAll(`[role="option"]`).forEach(e=>e.setAttribute(`aria-selected`,`false`)),t.setAttribute(`aria-selected`,`true`),this.select(this.toH24()))}select(e){e&&this.dispatch(`selected`,{detail:{value:e},bubbles:!0})}onNavigate(e){[`ArrowUp`,`ArrowDown`].includes(e.key)&&(e.preventDefault(),this.step(e.currentTarget,e.key===`ArrowDown`?1:-1))}step(e,t){let n=[...e.querySelectorAll(`[role="option"]`)],r=e.querySelector(`[aria-selected="true"]`),i=n.indexOf(r),a=t>0?n[Math.min(i+1,n.length-1)]:n[Math.max(i-1,0)];!a||a===r||(n.forEach(e=>e.setAttribute(`aria-selected`,`false`)),a.setAttribute(`aria-selected`,`true`),a.scrollIntoView({block:`nearest`}),this.select(this.toH24()))}toH24(){let e=this.selectedValue(this.hourTarget),t=this.selectedValue(this.minuteTarget);if(!e||!t)return null;if(!this.hasPeriodTarget)return`${e}:${t}`;let n=this.selectedValue(this.periodTarget),r=parseInt(e,10);return r=n===`AM`?r===12?0:r:r===12?12:r+12,`${String(r).padStart(2,`0`)}:${t}`}selectedValue(e){return e?.querySelector(`[aria-selected="true"]`)?.dataset.value??null}},rt=class extends t.Controller{static targets=[`trigger`];connect(){Q(this,{trigger:this.hasTriggerTarget?this.triggerTarget:null})}},it=class extends t.Controller{static targets=[`anchor`,`reference`];static values={placement:{type:String,default:`bottom`},alignment:{type:String,default:`start`},role:{type:String,default:`tooltip`}};connect(){if(!this.hasReferenceTarget){console.error(`FlipperController requires a reference target. Add data-flipper-target="reference" to your element.`);return}if(!this.hasAnchorTarget){console.error(`FlipperController requires an anchor target. Add data-flipper-target="anchor" to your element.`);return}Re(this,{element:this.referenceTarget,anchor:this.anchorTarget,placement:this.placementValue,alignment:this.alignmentValue,ariaRole:this.roleValue})}},at=class extends t.Controller{static targets=[`trigger`,`input`];static values={value:String,minLength:{type:Number,default:1}};static outlets=[`combobox-dropdown`];onSelect(e){e.detail?.value!==void 0&&(this.valueValue=e.detail.value)}onInput(e){if(e.target!==this.triggerTarget)return;let t=e.target.value.trim();if(t.length<this.minLengthValue){this.hasComboboxDropdownOutlet&&this.comboboxDropdownOutlet.showAll();return}this.hasComboboxDropdownOutlet&&this.comboboxDropdownOutlet.filter(t)}valueValueChanged(e){this.hasInputTarget&&(this.inputTarget.value=e),this.dispatch(`changed`,{detail:{value:e}})}},ot=class extends t.Controller{static targets=[`input`,`toggle`];static values={format:{type:String,default:`plain`},options:{type:Object,default:{}},revealed:{type:Boolean,default:!1}};connect(){B(this,{type:this.formatValue,options:this.optionsValue}),this.format(this.readValue()),this.drawToggle()}formatValueChanged(){this.formatter&&(B(this,{type:this.formatValue,options:this.optionsValue}),this.format(this.readValue()),this.drawToggle())}optionsValueChanged(){this.formatter&&(B(this,{type:this.formatValue,options:this.optionsValue}),this.format(this.readValue()))}revealedValueChanged(){this.formatter&&(this.format(this.readValue()),this.drawToggle())}onChange(e){this.format(e?.detail?.value??``)}format(e){this.formatter&&this.onFormatting(e)}toggle(){!this.formatter.maskable()&&this.formatValue!==`password`||(this.revealedValue=!this.revealedValue)}onPaste(e){let t=e.detail?.text??``;if(!this.formatter||!t)return;let n=this.formatter.normalize(t);this.formatter.validate(n)&&this.format(n)}drawToggle(){if(!this.hasToggleTarget)return;let e=this.formatter?.maskable()||this.formatValue===`password`;this.toggleTarget.hidden=!e,e&&v(this.toggleTarget,this.revealedValue)}readValue(){return this.hasInputTarget?this.inputTarget instanceof HTMLInputElement?this.inputTarget.value:this.inputTarget.textContent:``}onFormatting(e){if(!this.formatter)return;if(this.formatValue===`password`){this.hasInputTarget&&(this.inputTarget.type=this.revealedValue?`text`:`password`);return}let t=this.formatter.normalize(e),n=this.revealedValue||!this.formatter.maskable()?this.formatter.format(t):this.formatter.mask(t);this.hasInputTarget&&(this.inputTarget instanceof HTMLInputElement?this.inputTarget.value=n:this.inputTarget.textContent=n),this.dispatch(`formatted`,{detail:{value:n}})}},st=class extends t.Controller{static targets=[`input`,`clear`];initialize(){this.onInput=this.draw.bind(this),this.onEscape=this.handleEscape.bind(this)}connect(){this.draw()}inputTargetConnected(e){e.addEventListener(`input`,this.onInput),e.addEventListener(`keydown`,this.onEscape)}inputTargetDisconnected(e){e.removeEventListener(`input`,this.onInput),e.removeEventListener(`keydown`,this.onEscape)}clear(){this.hasInputTarget&&(this.inputTarget.value=``,this.draw(),this.inputTarget.focus(),this.inputTarget.dispatchEvent(new Event(`input`,{bubbles:!0})))}draw(){!this.hasInputTarget||!this.hasClearTarget||(this.clearTarget.hidden=this.inputTarget.value.length===0)}handleEscape(e){e.key===`Escape`&&this.inputTarget.value!==``&&(e.preventDefault(),this.clear())}},ct=class extends t.Controller{static targets=[`modal`,`overlay`];initialize(){this.onCancel=this.close.bind(this)}connect(){this.hasModalTarget||console.error(`ModalController requires a modal target. Add data-modal-target="modal" to your element.`)}modalTargetConnected(e){this.isNativeDialog=e instanceof HTMLDialogElement,this.isNativeDialog?(e.addEventListener(`cancel`,this.onCancel),e.addEventListener(`click`,this.onBackdropClick)):(this.focusTrap=new o(e,{escapeDeactivates:!0,onDeactivate:()=>this.close()}),Q(this,{element:e}))}modalTargetDisconnected(e){this.isNativeDialog&&(e.removeEventListener(`cancel`,this.onCancel),e.removeEventListener(`click`,this.onBackdropClick))}dismissed=()=>{this.close()};open(e){if(e&&e.preventDefault(),this.hasModalTarget){if(this.isNativeDialog)this.previouslyFocused=document.activeElement,this.modalTarget.showModal();else{let e=this.hasOverlayTarget?this.overlayTarget:this.modalTarget;e.hidden=!1,document.body.style.overflow=`hidden`,this.focusTrap&&this.focusTrap.activate()}m(`Modal opened`)}}close(e){if(e&&e.preventDefault(),this.hasModalTarget){if(this.isNativeDialog)this.modalTarget.close(),this.previouslyFocused&&this.previouslyFocused.isConnected&&setTimeout(()=>{this.previouslyFocused.focus()},0);else{let e=this.hasOverlayTarget?this.overlayTarget:this.modalTarget;e.hidden=!0,document.body.style.overflow=``,this.focusTrap&&this.focusTrap.deactivate()}m(`Modal closed`)}}onBackdropClick=e=>{let t=this.modalTarget.getBoundingClientRect();(e.clientY<t.top||e.clientY>t.bottom||e.clientX<t.left||e.clientX>t.right)&&this.close()}},lt=class extends t.Controller{static targets=[`content`];connect(){Ve(this,{element:this.hasContentTarget?this.contentTarget:null})}},ut=class extends t.Controller{static targets=[`trigger`,`panel`,`template`,`loader`];static classes=[`hidden`];static values={url:String,loadedAt:String,reload:{type:String,default:`never`},staleAfter:{type:Number,default:3600},closeOnSelect:{type:Boolean,default:!0},announceOpen:{type:String,default:`Panel opened`},announceClose:{type:String,default:`Panel closed`}};connect(){Ne(this,{element:this.hasPanelTarget?this.panelTarget:null,url:this.hasUrlValue?this.urlValue:null}),this.hasPanelTarget&&(We(this,{element:this.panelTarget,activator:this.hasTriggerTarget?this.triggerTarget:null}),Q(this)),this.hasLoaderTarget&&We(this,{element:this.loaderTarget,visibility:`contentLoaderVisibility`})}async dismissed(){await this.close()}async open(){this.hasPanelTarget&&await this.visibility.show()}async close(){this.hasPanelTarget&&await this.visibility.hide()}async toggle(){this.visibility?.visible?await this.close():await this.open()}async closeOnSelect(){this.closeOnSelectValue&&await this.close()}async shown(){await this.load(),this.hasPanelTarget&&a(this.panelTarget),m(this.announceOpenValue)}async hidden(){this.hasTriggerTarget&&this.triggerTarget.focus(),m(this.announceCloseValue)}canLoad(){return this.hasPanelTarget&&this.panelTarget.tagName.toLowerCase()===`turbo-frame`?(this.hasUrlValue&&this.panelTarget.setAttribute(`src`,this.urlValue),!1):!0}async contentLoading(){this.hasLoaderTarget&&await this.contentLoaderVisibility.show()}async contentLoaded({content:e}){this.hasPanelTarget&&this.panelTarget.replaceChildren(this.getContentNode(e)),this.hasLoaderTarget&&await this.contentLoaderVisibility.hide()}getContentNode(e){if(typeof e==`string`){let t=document.createElement(`template`);return t.innerHTML=e,document.importNode(t.content,!0)}return document.importNode(e,!0)}contentLoader(){if(this.hasTemplateTarget)return this.templateTarget instanceof HTMLTemplateElement?this.templateTarget.content:this.templateTarget.innerHTML}},dt=class extends t.Controller{static targets=[`trigger`,`detail`,`time`];static values={dateFormat:{type:Object,default:{}}};connect(){this.rovingTabIndex=new d(this.triggerTargets,{orientation:`vertical`}),this.rovingTabIndex.activate()}disconnect(){this.rovingTabIndex?.deactivate(),this.rovingTabIndex=null}toggle(e){let t=e.currentTarget;t.getAttribute(`aria-expanded`)===`true`?this.collapseItem(t):this.expandItem(t)}expand(e){this.expandItem(e.currentTarget)}collapse(e){this.collapseItem(e.currentTarget)}expandItem(e){let t=this.detailTargets.find(t=>t.id===e.getAttribute(`aria-controls`))??null;this.dispatch(`expand`,{detail:{trigger:e,detail:t}}),_(e,!0),t&&(y(t,!1),m(`${e.textContent.trim()} expanded`)),this.dispatch(`expanded`,{detail:{trigger:e,detail:t}})}collapseItem(e){let t=this.detailTargets.find(t=>t.id===e.getAttribute(`aria-controls`))??null;this.dispatch(`collapse`,{detail:{trigger:e,detail:t}}),_(e,!1),t&&(y(t,!0),m(`${e.textContent.trim()} collapsed`)),this.dispatch(`collapsed`,{detail:{trigger:e,detail:t}})}triggerTargetConnected(e){e.hasAttribute(`aria-expanded`)||e.setAttribute(`aria-expanded`,`false`),this.rovingTabIndex?.updateItems(this.triggerTargets)}triggerTargetDisconnected(){this.rovingTabIndex?.updateItems(this.triggerTargets)}timeTargetConnected(e){if(!Object.keys(this.dateFormatValue).length||e.textContent.trim())return;let t=P.format(e.getAttribute(`datetime`),this.dateFormatValue);t&&(e.textContent=t)}};e.ARIA_HASPOPUP_VALUES=b,e.CalendarDecadeController=Ke,e.CalendarDecadeSelectorController=qe,e.CalendarMonthController=Je,e.CalendarMonthSelectorController=Ye,e.CalendarYearController=Ze,e.CalendarYearSelectorController=Qe,e.ClipboardController=$e,e.ComboboxDateController=et,e.ComboboxDropdownController=tt,e.ComboboxTimeController=nt,e.DismisserController=rt,e.FOCUSABLE_SELECTOR=n,e.FORMATTER_TYPES=I,e.FlipperController=it,e.FocusTrap=o,e.Formatter=z,e.InputClearableController=st,e.InputComboboxController=at,e.InputFormatterController=ot,e.ListboxNavigation=f,e.ModalController=ct,e.PannerController=lt,e.PopoverController=ut,e.Requestor=T,e.RovingTabIndex=d,e.TimelineController=dt,e.announce=m,e.connectTriggerToTarget=C,e.disconnectTriggerFromTarget=re,e.ensureId=ee,e.filterOptions=E,e.focusFirst=a,e.fuzzyMatcher=ie,e.generateId=h,e.getFocusableElements=r,e.isActivationKey=c,e.isArrowKey=l,e.isKey=s,e.isVisible=i,e.preventDefault=u,e.setAriaState=g,e.setChecked=te,e.setDisabled=ne,e.setExpanded=_,e.setHidden=y,e.setPressed=v});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@hotwired/stimulus")):typeof define==`function`&&define.amd?define([`exports`,`@hotwired/stimulus`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.StimulusPlumbersControllers={},e.Stimulus))})(this,function(e,t){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var n=[`a[href]`,`area[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`,`audio[controls]`,`video[controls]`,`[contenteditable]:not([contenteditable="false"])`].join(`,`);function r(e){return Array.from(e.querySelectorAll(n)).filter(e=>i(e))}function i(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}function a(e){let t=r(e);return t.length>0?(t[0].focus(),!0):!1}var o=class{constructor(e,t={}){this.container=e,this.previouslyFocused=null,this.options=t,this.isActive=!1}activate(){this.isActive||(this.previouslyFocused=document.activeElement,this.isActive=!0,this.options.initialFocus?this.options.initialFocus.focus():a(this.container),this.container.addEventListener(`keydown`,this.handleKeyDown))}deactivate(){if(!this.isActive)return;this.isActive=!1,this.container.removeEventListener(`keydown`,this.handleKeyDown);let e=this.options.returnFocus||this.previouslyFocused;e&&i(e)&&e.focus(),typeof this.options.onDeactivate==`function`&&this.options.onDeactivate()}handleKeyDown=e=>{if(e.key===`Escape`&&this.options.escapeDeactivates){e.preventDefault(),this.deactivate();return}if(e.key!==`Tab`)return;let t=r(this.container);if(t.length===0)return;let n=t[0],i=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),i.focus()):!e.shiftKey&&document.activeElement===i&&(e.preventDefault(),n.focus())}};function s(e,t){return e.key===t}function c(e){return e.key===`Enter`||e.key===` `}function l(e){return[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`].includes(e.key)}function u(e){e.preventDefault(),e.stopPropagation()}var d={Alt:`altKey`,Control:`ctrlKey`,Shift:`shiftKey`,Meta:`metaKey`},f=class{constructor(e,t={}){this.items=Array.from(e),this.currentIndex=t.initialIndex??0,this.orientation=t.orientation??`both`,this.wrap=t.wrap??!0,this.ignoreModifierKeys=t.ignoreModifierKeys??Object.keys(d),this._handleKeyDown=this._handleKeyDown.bind(this),this._handleClick=this._handleClick.bind(this)}activate(){return this.updateTabIndex(),this.items.forEach(e=>{e.addEventListener(`keydown`,this._handleKeyDown),e.addEventListener(`click`,this._handleClick)}),this}deactivate(){this.items.forEach(e=>{e.removeEventListener(`keydown`,this._handleKeyDown),e.removeEventListener(`click`,this._handleClick)})}updateItems(e){this.deactivate(),this.items=Array.from(e),this.currentIndex=Math.min(this.currentIndex,Math.max(0,this.items.length-1)),this.activate()}setCurrentIndex(e){e>=0&&e<this.items.length&&(this.currentIndex=e,this.updateTabIndex(),this.items[e].focus())}updateTabIndex(){this.items.forEach((e,t)=>{e.tabIndex=t===this.currentIndex?0:-1})}_handleClick(e){let t=this.items.indexOf(e.currentTarget);t!==-1&&(this.currentIndex=t,this.updateTabIndex())}_handleKeyDown(e){if(this.ignoreModifierKeys.some(t=>e[d[t]]))return;let t=this.items.indexOf(e.currentTarget);t!==-1&&t!==this.currentIndex&&(this.currentIndex=t,this.updateTabIndex());let n=this.orientation===`horizontal`?[]:[`ArrowUp`,`ArrowDown`],r=this.orientation===`vertical`?[]:[`ArrowLeft`,`ArrowRight`];if(![...n,...r,`Home`,`End`].includes(e.key))return;e.preventDefault();let i=t===-1?this.currentIndex:t,a;switch(e.key){case`ArrowDown`:case`ArrowRight`:a=this.wrap?(i+1)%this.items.length:Math.min(i+1,this.items.length-1);break;case`ArrowUp`:case`ArrowLeft`:a=this.wrap?(i-1+this.items.length)%this.items.length:Math.max(i-1,0);break;case`Home`:a=0;break;case`End`:a=this.items.length-1;break}this.setCurrentIndex(a)}},p=class{constructor(e,t={}){this.listbox=e,this.itemSelector=t.itemSelector??`[role="option"]:not([aria-disabled="true"]):not([hidden])`,this.wrap=t.wrap??!1,this.orientation=t.orientation??`vertical`}get selectedItem(){return this.listbox.querySelector(`${this.itemSelector}[aria-selected="true"]`)??null}get currentIndex(){return Array.from(this.listbox.querySelectorAll(this.itemSelector)).indexOf(this.selectedItem)}_selectItem(e){Array.from(this.listbox.querySelectorAll(this.itemSelector)).forEach(e=>e.setAttribute(`aria-selected`,`false`)),e.setAttribute(`aria-selected`,`true`),e.scrollIntoView({block:`nearest`})}step(e){let t=Array.from(this.listbox.querySelectorAll(this.itemSelector));if(!t.length)return;let n=this.listbox.querySelector(`${this.itemSelector}[aria-selected="true"]`),r=t.indexOf(n),i;i=e>0?this.wrap?t[(r+1)%t.length]:t[Math.min(r+1,t.length-1)]:this.wrap?t[(r-1+t.length)%t.length]:t[Math.max(r-1,0)],!(!i||i===n)&&this._selectItem(i)}handleKeyDown(e){let t=this.orientation===`horizontal`?[]:[`ArrowUp`,`ArrowDown`],n=this.orientation===`vertical`?[]:[`ArrowLeft`,`ArrowRight`];if(![...t,...n,`Home`,`End`,`Enter`,` `].includes(e.key))return;e.preventDefault();let r=Array.from(this.listbox.querySelectorAll(this.itemSelector));switch(e.key){case`ArrowDown`:case`ArrowRight`:this.step(1);break;case`ArrowUp`:case`ArrowLeft`:this.step(-1);break;case`Home`:r.length&&this._selectItem(r[0]);break;case`End`:r.length&&this._selectItem(r[r.length-1]);break;case`Enter`:case` `:this.listbox.querySelector(`${this.itemSelector}[aria-selected="true"]`)?.click();break}}},m=(e,t,n)=>{let r=document.querySelector(`[data-live-region="${e}"]`);return r||(r=document.createElement(`div`),r.className=`sr-only`,r.dataset.liveRegion=e,r.setAttribute(`aria-live`,e),r.setAttribute(`aria-atomic`,t.toString()),r.setAttribute(`aria-relevant`,n),document.body.appendChild(r)),r};function h(e,t={}){let{politeness:n=`polite`,atomic:r=!0,relevant:i=`additions text`}=t,a=m(n,r,i);a.textContent=``,setTimeout(()=>{a.textContent=e},100)}var ee=(e=`a11y`)=>`${e}-${Math.random().toString(36).substr(2,9)}`,te=(e,t=`element`)=>e.id||=ee(t),g=(e,t,n)=>{e.setAttribute(t,n.toString())},_=(e,t)=>g(e,`aria-expanded`,t),v=e=>e.getAttribute(`aria-expanded`)===`true`,ne=(e,t)=>g(e,`aria-pressed`,t),re=(e,t)=>g(e,`aria-checked`,t),y=(e,t)=>g(e,`aria-selected`,t),b=(e,t)=>t?e.setAttribute(`aria-current`,t):e.removeAttribute(`aria-current`),x=(e,t)=>t?e.setAttribute(`hidden`,``):e.removeAttribute(`hidden`),ie=(e,t)=>g(e,`aria-hidden`,t),S=(e,t)=>g(e,`aria-disabled`,t),ae=e=>e.getAttribute(`aria-disabled`)===`true`;function oe(e,t){g(e,`aria-disabled`,t),t?e.setAttribute(`tabindex`,`-1`):e.removeAttribute(`tabindex`)}var C=(e,t)=>g(e,`aria-valuemin`,t),w=(e,t)=>g(e,`aria-valuemax`,t),T=(e,t)=>t==null?e.removeAttribute(`aria-valuenow`):g(e,`aria-valuenow`,t),E={menu:`menu`,listbox:`listbox`,tree:`tree`,grid:`grid`,dialog:`dialog`},D=(e,t,n)=>{Object.entries(t).forEach(([t,r])=>{e.setAttribute(t,r),n[t]=r})},O=(e,t,n)=>n||!e.hasAttribute(t);function se({trigger:e,target:t,role:n=null,override:r=!1}){let i={trigger:{},target:{}};if(!e||!t)return i;let a={},o={};if(n&&O(t,`role`,r)&&(o.role=n),t.id&&(O(e,`aria-controls`,r)&&(a[`aria-controls`]=t.id),n===`tooltip`&&O(e,`aria-describedby`,r)&&(a[`aria-describedby`]=t.id)),n&&O(e,`aria-haspopup`,r)){let e=E[n]||`true`;e&&(a[`aria-haspopup`]=e)}return D(t,o,i.target),D(e,a,i.trigger),i}var ce=(e,t)=>{t.forEach(t=>{e.hasAttribute(t)&&e.removeAttribute(t)})};function le({trigger:e,target:t,attributes:n=null}){!e||!t||(ce(e,n||[`aria-controls`,`aria-haspopup`,`aria-describedby`]),(!n||n.includes(`role`))&&ce(t,[`role`]))}var k=class{constructor(){this._abortController=null,this._timer=null}schedule(e,t){clearTimeout(this._timer),this._timer=setTimeout(e,t)}async request(e,t={}){this._abortController?.abort(),this._abortController=new AbortController;let n=await fetch(e,{...t,signal:this._abortController.signal});if(!n.ok)throw Error(`${n.status}`);return n}cancel(){clearTimeout(this._timer),this._abortController?.abort()}};function ue(e,t){let n=0;for(let r=0;r<t.length&&n<e.length;r++)t[r]===e[n]&&n++;return n===e.length}function de(e,t){return t.includes(e)}function fe(e,t){return t.startsWith(e)}function pe(e){return e===`contains`?de:e===`prefix`?fe:ue}function me(e,t){return t===`textContent`?e.textContent?.trim().toLowerCase()??``:(e.getAttribute(t)??``).toLowerCase()}function he(e,t,n={}){let{strategy:r=`fuzzy`,matcher:i,fields:a=[`textContent`]}=n,o=typeof i==`function`?i:pe(r),s=t.toLowerCase(),c=0;return e.querySelectorAll(`[role="option"]`).forEach(e=>{let t=a.some(t=>o(s,me(e,t)));e.hidden=!t,t&&c++}),c}var ge={get top(){return`bottom`},get bottom(){return`top`},get left(){return`right`},get right(){return`left`}};function A({x:e,y:t,width:n,height:r}){return{x:e,y:t,width:n,height:r,left:e,right:e+n,top:t,bottom:t+r}}function _e(e,t=`vertical`){return t===`horizontal`?e.left+e.width/2:e.top+e.height/2}function j(){return A({x:0,y:0,width:window.innerWidth||document.documentElement.clientWidth,height:window.innerHeight||document.documentElement.clientHeight})}function ve(e){if(!(e instanceof HTMLElement))return!1;let t=j(),n=e.getBoundingClientRect(),r=n.top<=t.height&&n.top+n.height>0,i=n.left<=t.width&&n.left+n.width>0;return r&&i}var M={get visibleOnly(){return!0},hiddenClass:null},ye={element:null,visible:null,dispatch:!0,prefix:``},N=class{constructor(e,t={}){this.controller=e;let{element:n,visible:r,dispatch:i,prefix:a}=Object.assign({},ye,t);this.element=n||e.element,this.visibleOnly=typeof r==`boolean`?r:M.visibleOnly,this.visibleCallback=typeof r==`string`?r:null,this.notify=!!i,this.prefix=typeof a==`string`&&a?a:e.identifier}get visible(){return this.element instanceof HTMLElement?!this.visibleOnly||ve(this.element)&&this.isVisible(this.element):!1}isVisible(e){if(this.visibleCallback){let t=this.findCallback(this.visibleCallback);if(typeof t==`function`)return t(e)}return e instanceof HTMLElement&&!e.hasAttribute(`hidden`)}dispatch(e,{target:t=null,prefix:n=null,detail:r=null}={}){if(this.notify)return this.controller.dispatch(e,{target:t||this.element,prefix:n||this.prefix,detail:r})}findCallback(e){if(typeof e!=`string`)return;let t=this,n=e.split(`.`).reduce((e,t)=>e&&e[t],t.controller);if(typeof n==`function`)return n.bind(t.controller);let r=e.split(`.`).reduce((e,t)=>e&&e[t],t);if(typeof r==`function`)return r.bind(t)}async awaitCallback(e,...t){if(typeof e==`string`&&(e=this.findCallback(e)),typeof e==`function`){let n=e(...t);return n instanceof Promise?await n:n}}},be={normalize(e){return typeof e==`string`?e:``},validate(){return!0}};function xe(e){let t=0,n=!1;for(let r=e.length-1;r>=0;r--){let i=parseInt(e[r],10);n&&(i*=2,i>9&&(i-=9)),t+=i,n=!n}return t%10==0}var Se=/\D/g,Ce=/^\d{13,19}$/,we=/(.{4})(?=.)/g,Te={normalize(e){return typeof e==`string`?e.replace(Se,``):``},validate(e){return typeof e!=`string`||!Ce.test(e)?!1:xe(e)},format(e){return typeof e==`string`?e.replace(we,`$1 `):``}},P={1:10},F=/\D/g,Ee=/^\+\d{7,15}$/,De={normalize(e){if(typeof e!=`string`)return``;let t=e.trimStart().startsWith(`+`),n=e.replace(F,``);return t?`+${n}`:n},validate(e){if(typeof e!=`string`)return!1;if(Ee.test(e))return!0;let t=e.replace(F,``);return Object.values(P).includes(t.length)},format(e){if(typeof e!=`string`)return``;let t=e.replace(F,``);for(let[e,n]of Object.entries(P)){if(t.length===n)return`(${t.slice(0,3)}) ${t.slice(3,6)}-${t.slice(6)}`;let r=n+e.length;if(t.length===r&&t.startsWith(e)){let n=t.slice(e.length);return`+${e} (${n.slice(0,3)}) ${n.slice(3,6)}-${n.slice(6)}`}}return e}},Oe=/[^\d.,-]/g,ke=/^-?\d+(\.\d+)?$/,Ae={normalize(e){if(typeof e!=`string`)return``;let t=e.replace(Oe,``);if(!t)return``;let n=t.lastIndexOf(`,`),r=t.lastIndexOf(`.`);return n>-1&&r>-1?n>r?t.replace(/\./g,``).replace(`,`,`.`):t.replace(/,/g,``):n>-1?t.slice(n+1).length<=2?t.replace(`,`,`.`):t.replace(/,/g,``):t},validate(e){return typeof e==`string`&&ke.test(e)},format(e,t={}){if(typeof e!=`string`)return``;let n=parseFloat(e);if(isNaN(n))return e;let r=t.locale||`en-US`,i=t.currency||`USD`,a=t.fractionDigits===void 0?{}:{minimumFractionDigits:t.fractionDigits,maximumFractionDigits:t.fractionDigits};try{return new Intl.NumberFormat(r,{style:`currency`,currency:i,...a}).format(n)}catch{return e}}},I=/^\d{4}-\d{2}-\d{2}$/,je=/^(\d{1,4})[/\-.](\d{1,2})[/\-.](\d{1,4})$/,Me=/\D/g,L={normalize(e){if(typeof e!=`string`)return``;let t=e.trim();if(I.test(t))return t;let n=t.match(je);if(n){let[,e,t,r]=n;if(e.length===4)return`${e}-${t.padStart(2,`0`)}-${r.padStart(2,`0`)}`;if(r.length===4)return`${r}-${e.padStart(2,`0`)}-${t.padStart(2,`0`)}`}let r=t.replace(Me,``);if(r.length===8){let e=parseInt(r.slice(0,4),10);return e>=1e3&&e<=9999?`${r.slice(0,4)}-${r.slice(4,6)}-${r.slice(6,8)}`:`${r.slice(4,8)}-${r.slice(0,2)}-${r.slice(2,4)}`}return t},validate(e){if(typeof e!=`string`)return!1;let t=L.normalize(e);if(!I.test(t))return!1;let n=new Date(`${t}T00:00:00Z`);return!isNaN(n.getTime())&&n.toISOString().startsWith(t)},format(e,t={}){if(typeof e!=`string`)return``;let n=new Date(`${e}T00:00:00Z`);if(isNaN(n.getTime()))return e;let r=t.locale||`en-US`;try{return new Intl.DateTimeFormat(r,{year:t.year||`numeric`,month:t.month||`2-digit`,day:t.day||`2-digit`,timeZone:t.timeZone||`UTC`}).format(n)}catch{return e}}},Ne=/^([01]?\d|2[0-3]):([0-5]\d)$/,R={normalize(e){if(typeof e!=`string`)return``;let t=e.trim();if(Ne.test(t)){let[e,n]=t.split(`:`);return`${String(parseInt(e,10)).padStart(2,`0`)}:${n}`}let n=t.match(/^(\d{1,2}):(\d{2})\s*(AM|PM)$/i);if(n){let e=parseInt(n[1],10),t=n[2];return e=n[3].toUpperCase()===`AM`?e===12?0:e:e===12?12:e+12,e>23||parseInt(t,10)>59?``:`${String(e).padStart(2,`0`)}:${t}`}return``},validate(e){return R.normalize(e)!==``},format(e,t={}){if(typeof e!=`string`)return``;let n=e.match(/^(\d{2}):(\d{2})$/);if(!n)return e;let r=parseInt(n[1],10),i=n[2];if(t.format===`h24`)return`${String(r).padStart(2,`0`)}:${i}`;let a=r<12?`AM`:`PM`;return`${r%12||12}:${i} ${a}`}},z={PLAIN:`plain`,CREDIT_CARD:`creditCard`,PHONE:`phone`,CURRENCY:`currency`,DATE:`date`,TIME:`time`},B=new Map([[z.PLAIN,be],[z.CREDIT_CARD,Te],[z.PHONE,De],[z.CURRENCY,Ae],[z.DATE,L],[z.TIME,R]]),V={type:z.PLAIN,options:{}},H=class extends N{static register(e,t){B.set(e,t)}constructor(e,t={}){super(e,t),this.type=t.type??V.type,this.options=t.options??V.options,this.enhance()}enhance(){let e=this,t=B.get(e.type)??B.get(z.PLAIN),n={normalize:n=>t.normalize?.(n,e.options)??(typeof n==`string`?n:``),validate:n=>t.validate?.(n,e.options)??!0,format:n=>t.format?.(n,e.options)??(typeof n==`string`?n:``),mask:n=>t.mask?.(n,e.options)??null,maskable:()=>typeof t.mask==`function`};Object.defineProperty(this.controller,"formatter",{get(){return n},configurable:!0})}},U=(e,t)=>new H(e,t),Pe=/^\d{4}-\d{2}-\d{2}$/;function W(e){return e instanceof Date&&!isNaN(e)}function G(...e){if(e.length===0)throw`Missing values to parse as date`;if(e.length===1){let t=e[0];if(!t)return;if(typeof t==`string`&&Pe.test(t)){let[e,n,r]=t.split(`-`).map(Number),i=new Date(e,n-1,r);if(W(i))return i}else{let e=new Date(t);if(W(e))return e}}else{let t=new Date(...e);if(W(t))return t}}var Fe=7,Ie=12,K=10,Le={locales:[`default`],today:``,day:null,month:null,year:null,since:null,till:null,disabledDates:[],disabledWeekdays:[],disabledDays:[],disabledMonths:[],disabledYears:[],firstDayOfWeek:0,onNavigated:`navigated`},Re=class extends N{constructor(e,t={}){super(e,t);let n=Object.assign({},Le,t),{onNavigated:r,since:i,till:a,firstDayOfWeek:o}=n;this.onNavigated=r,this.since=G(i),this.till=G(a),this.firstDayOfWeek=0<=o&&o<7?o:Le.firstDayOfWeek;let{disabledDates:s,disabledWeekdays:c,disabledDays:l,disabledMonths:u,disabledYears:d}=n;this.disabledDates=Array.isArray(s)?s:[],this.disabledWeekdays=Array.isArray(c)?c:[],this.disabledDays=Array.isArray(l)?l:[],this.disabledMonths=Array.isArray(u)?u:[],this.disabledYears=Array.isArray(d)?d:[];let{today:f,day:p,month:m,year:h}=n;this.now=G(f)||new Date,typeof h==`number`&&typeof m==`number`&&typeof p==`number`?this.current=G(h,m,p):this.current=this.now,this.build(),this.enhance()}build(){this.daysOfWeek=this.buildDaysOfWeek(),this.daysOfMonth=this.buildDaysOfMonth(),this.monthsOfYear=this.buildMonthsOfYear(),this.yearsOfDecade=this.buildYearsOfDecade()}buildDaysOfWeek(){let e=new Intl.DateTimeFormat(this.localesValue,{weekday:`long`}),t=new Intl.DateTimeFormat(this.localesValue,{weekday:`short`}),n=new Date(`2024-10-06`),r=[];for(let i=this.firstDayOfWeek,a=i+7;i<a;i++){let a=new Date(n);a.setDate(n.getDate()+i),r.push({date:a,value:a.getDay(),long:e.format(a),short:t.format(a)})}return r}buildDaysOfMonth(){let e=this.month,t=this.year,n=[],r=e=>({current:this.month===e.getMonth()&&this.year===e.getFullYear(),date:e,value:e.getDate(),month:e.getMonth(),year:e.getFullYear(),iso:e.toISOString()}),i=new Date(t,e).getDay(),a=this.firstDayOfWeek-i;for(let i=a>0?a-7:a;i<0;i++){let a=new Date(t,e,i+1);n.push(r(a))}let o=new Date(t,e+1,0).getDate();for(let i=1;i<=o;i++){let a=new Date(t,e,i);n.push(r(a))}let s=n.length%Fe,c=s===0?0:Fe-s;for(let i=1;i<=c;i++){let a=new Date(t,e+1,i);n.push(r(a))}return n}buildMonthsOfYear(){let e=new Intl.DateTimeFormat(this.localesValue,{month:`long`}),t=new Intl.DateTimeFormat(this.localesValue,{month:`short`}),n=new Intl.DateTimeFormat(this.localesValue,{month:`numeric`}),r=[];for(let i=0;i<Ie;i++){let a=new Date(this.year,i),o=new Date(this.year,i,1),s=new Date(this.year,i+1,0),c=t.format(a),l=e.format(a),u=this.since&&s<this.since||this.till&&o>this.till,d=this.disabledMonths.some(e=>i==e||c===e||l===e);r.push({date:a,value:a.getMonth(),long:l,short:c,numeric:n.format(a),disabled:u||d})}return r}buildYearsOfDecade(){let e=Math.floor(this.year/K)*K,t=[];for(let n=e-1;n<=e+K;n++){let r=n<e||n>e+K-1,i=this.since&&n<this.since.getFullYear()||this.till&&n>this.till.getFullYear(),a=this.disabledYears.some(e=>n==e);t.push({value:n,current:n===this.year,disabled:r||i||a})}return t}get today(){return this.now}set today(e){if(!W(e))return;let t=this.month??e.getMonth(),n=this.year??e.getFullYear(),r=t==e.getMonth()&&n==e.getFullYear()?e.getDate():1;this.now=new Date(n,t,r)}get current(){return typeof this.year==`number`&&typeof this.month==`number`&&typeof this.day==`number`?G(this.year,this.month,this.day):null}set current(e){W(e)&&(this.day=e.getDate(),this.month=e.getMonth(),this.year=e.getFullYear())}navigate=async e=>{if(!W(e))return;let t=this.current,n=e.toISOString(),r=t.toISOString();this.dispatch(`navigate`,{detail:{from:r,to:n}}),this.current=e,this.build(),await this.awaitCallback(this.onNavigated,{from:r,to:n}),this.dispatch(`navigated`,{detail:{from:r,to:n}})};step=async(e,t)=>{if(t===0)return;let n=this.current;switch(e){case`year`:n.setFullYear(n.getFullYear()+t);break;case`month`:n.setMonth(n.getMonth()+t);break;case`day`:n.setDate(n.getDate()+t);break;default:return}await this.navigate(n)};isDisabled=e=>{if(!W(e))return!1;if(this.disabledDates.length){let t=e.getTime();for(let e of this.disabledDates)if(t===new Date(e).getTime())return!0}if(this.disabledWeekdays.length){let t=e.getDay(),n=this.daysOfWeek,r=n.findIndex(e=>e.value===t);if(r>=0){let e=n[r];for(let t of this.disabledWeekdays)if(e.value==t||e.short===t||e.long===t)return!0}}if(this.disabledDays.length){let t=e.getDate();for(let e of this.disabledDays)if(t==e)return!0}if(this.disabledMonths.length){let t=e.getMonth(),n=this.monthsOfYear,r=n.findIndex(e=>e.value===t);if(r>=0){let e=n[r];for(let t of this.disabledMonths)if(e.value==t||e.short===t||e.long===t)return!0}}if(this.disabledYears.length){let t=e.getFullYear();for(let e of this.disabledYears)if(t==e)return!0}return!1};isWithinRange=e=>{if(!W(e))return!1;let t=!0;return this.since&&(t&&=e>=this.since),this.till&&(t&&=e<=this.till),t};enhance(){let e=this;Object.assign(this.controller,{get calendar(){return{get today(){return e.today},get current(){return e.current},get day(){return e.day},get month(){return e.month},get year(){return e.year},get since(){return e.since},get till(){return e.till},get firstDayOfWeek(){return e.firstDayOfWeek},get disabledDates(){return e.disabledDates},get disabledWeekdays(){return e.disabledWeekdays},get disabledDays(){return e.disabledDays},get disabledMonths(){return e.disabledMonths},get disabledYears(){return e.disabledYears},get daysOfWeek(){return e.daysOfWeek},get daysOfMonth(){return e.daysOfMonth},get monthsOfYear(){return e.monthsOfYear},get yearsOfDecade(){return e.yearsOfDecade},navigate:async t=>await e.navigate(t),step:async(t,n)=>await e.step(t,n),isDisabled:t=>e.isDisabled(t),isWithinRange:t=>e.isWithinRange(t)}}})}},q=(e,t)=>new Re(e,t),ze=class extends N{constructor(e,t={}){super(e,t),this.handle=this.handle.bind(this),this.onSelect=t.onSelect||null}attach(){this.element.addEventListener(`click`,this.handle)}detach(){this.element.removeEventListener(`click`,this.handle)}handle(e){if(!(e.target instanceof HTMLElement))return;e.preventDefault();let t=e.target instanceof HTMLTimeElement?e.target.parentElement:e.target;if(t.disabled||t.getAttribute(`aria-disabled`)===`true`)return;let n=e.target instanceof HTMLTimeElement?e.target:e.target.querySelector(`time`);if(!n)return;let r=G(n.dateTime);if(!r)return;this.dispatch(`selecting`,{target:t});let i=r.toISOString();this.onSelect?this.awaitCallback(this.onSelect,i):this.dispatch(`selected`,{detail:{epoch:r.getTime(),iso:i}})}},Be=class extends N{constructor(e,t={}){super(e,t),this.handle=this.handle.bind(this)}attach(){this.element.addEventListener(`click`,this.handle)}detach(){this.element.removeEventListener(`click`,this.handle)}handle(e){let t=e.target.closest(`button[data-month]`);if(!t||t.disabled||t.getAttribute(`aria-disabled`)===`true`)return;e.preventDefault();let n=parseInt(t.dataset.month,10);isNaN(n)||this.dispatch(`selected`,{detail:{month:n}})}},Ve=class extends N{constructor(e,t={}){super(e,t),this.handle=this.handle.bind(this)}attach(){this.element.addEventListener(`click`,this.handle)}detach(){this.element.removeEventListener(`click`,this.handle)}handle(e){let t=e.target.closest(`button[data-year]`);if(!t||t.disabled||t.getAttribute(`aria-disabled`)===`true`)return;e.preventDefault();let n=parseInt(t.dataset.year,10);isNaN(n)||this.dispatch(`selected`,{detail:{year:n}})}},He=(e,t)=>new ze(e,t),Ue=(e,t)=>new Be(e,t),We=(e,t)=>new Ve(e,t),J={content:null,url:``,reload:`never`,stale:3600,onLoad:`canLoad`,onLoaded:`contentLoaded`},Ge=class extends N{constructor(e,t={}){super(e,t);let n=Object.assign({},J,t),{content:r,url:i,reload:a,stale:o}=n;this.content=r,this.url=i,this.reload=typeof a==`string`?a:J.reload,this.stale=typeof o==`number`?o:J.stale;let{onLoad:s,onLoaded:c}=n;this.onLoad=s,this.onLoaded=c,this._requestor=new k,this.enhance()}get reloadable(){switch(this.reload){case`never`:return!1;case`always`:return!0;default:{let e=G(this.loadedAt);return e&&new Date-e>this.stale*1e3}}}contentLoadable=({url:e})=>!!e;contentLoader=async()=>``;remoteContentLoader=async e=>(await this._requestor.request(e)).text();load=async()=>{if(this.loadedAt&&!this.reloadable)return;let e=this.findCallback(this.onLoad),t=await this.awaitCallback(e||this.contentLoadable,{url:this.url});if(this.dispatch(`load`,{detail:{url:this.url}}),!t)return;this.dispatch(`loading`,{detail:{url:this.url}});let n=this.url?await this.remoteContentLoader(this.url):await this.contentLoader();n&&(await this.awaitCallback(this.onLoaded,{url:this.url,content:n}),this.loadedAt=new Date().getTime(),this.dispatch(`loaded`,{detail:{url:this.url,content:n}}))};enhance(){let e=this;Object.assign(this.controller,{load:e.load.bind(e)})}},Ke=(e,t)=>new Ge(e,t),Y=class extends N{observe(e){this._handler=e,this.events.forEach(t=>window.addEventListener(t,e,!0))}unobserve(){this._handler&&this.events.forEach(e=>window.removeEventListener(e,this._handler,!0))}enhance(){let e=this,t=this.controller.disconnect?.bind(this.controller)||(()=>{});this.controller.disconnect=()=>{e.unobserve(),t()}}},qe={trigger:null,events:[`click`],onDismissed:`dismissed`},Je=class extends Y{constructor(e,t={}){super(e,t);let{trigger:n,events:r,onDismissed:i}=Object.assign({},qe,t);this.onDismissed=i,this.trigger=n||this.element,this.events=r,this.enhance(),this.observe(this.dismiss)}dismiss=async e=>{let{target:t}=e;t instanceof HTMLElement&&(this.element.contains(t)||this.visible&&(this.dispatch(`dismiss`),await this.awaitCallback(this.onDismissed,{target:this.trigger}),this.dispatch(`dismissed`)))}},X=(e,t)=>new Je(e,t),Ye={anchor:null,events:[`click`],placement:`bottom`,alignment:`start`,onFlipped:`flipped`,ariaRole:null,respectMotion:!0},Xe=class extends Y{constructor(e,t={}){super(e,t);let{anchor:n,events:r,placement:i,alignment:a,onFlipped:o,ariaRole:s,respectMotion:c}=Object.assign({},Ye,t);this.anchor=n,this.events=r,this.placement=i,this.alignment=a,this.onFlipped=o,this.ariaRole=s,this.respectMotion=c,this.prefersReducedMotion=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,this.anchor&&this.element&&se({trigger:this.anchor,target:this.element,role:this.ariaRole}),this.enhance(),this.observe(this.flip)}flip=async()=>{if(!this.visible)return;this.dispatch(`flip`),window.getComputedStyle(this.element).position!=`absolute`&&(this.element.style.position=`absolute`);let e=this.flippedRect(this.anchor.getBoundingClientRect(),this.element.getBoundingClientRect());this.element.style.transition=this.respectMotion&&this.prefersReducedMotion?`none`:``;for(let[t,n]of Object.entries(e))this.element.style[t]=n;await this.awaitCallback(this.onFlipped,{target:this.element,placement:e}),this.dispatch(`flipped`,{detail:{placement:e}})};flippedRect(e,t){let n=this.quadrumRect(e,j()),r=[this.placement,ge[this.placement]],i={};for(;!Object.keys(i).length&&r.length>0;){let a=r.shift();if(!this.biggerRectThan(n[a],t))continue;let o=this.quadrumPlacement(e,a,t),s=this.quadrumAlignment(e,a,o);i.top=`${s.top+window.scrollY}px`,i.left=`${s.left+window.scrollX}px`}return Object.keys(i).length||(i.top=``,i.left=``),i}quadrumRect(e,t){return{left:A({x:t.x,y:t.y,width:e.x-t.x,height:t.height}),right:A({x:e.x+e.width,y:t.y,width:t.width-(e.x+e.width),height:t.height}),top:A({x:t.x,y:t.y,width:t.width,height:e.y-t.y}),bottom:A({x:t.x,y:e.y+e.height,width:t.width,height:t.height-(e.y+e.height)})}}quadrumPlacement(e,t,n){switch(t){case`top`:return A({x:n.x,y:e.y-n.height,width:n.width,height:n.height});case`bottom`:return A({x:n.x,y:e.y+e.height,width:n.width,height:n.height});case`left`:return A({x:e.x-n.width,y:n.y,width:n.width,height:n.height});case`right`:return A({x:e.x+e.width,y:n.y,width:n.width,height:n.height});default:throw`Unable place at the quadrum, ${t}`}}quadrumAlignment(e,t,n){switch(t){case`top`:case`bottom`:{let t=e.x;return this.alignment===`center`?t=e.x+e.width/2-n.width/2:this.alignment===`end`&&(t=e.x+e.width-n.width),A({x:t,y:n.y,width:n.width,height:n.height})}case`left`:case`right`:{let t=e.y;return this.alignment===`center`?t=e.y+e.height/2-n.height/2:this.alignment===`end`&&(t=e.y+e.height-n.height),A({x:n.x,y:t,width:n.width,height:n.height})}default:throw`Unable align at the quadrum, ${t}`}}biggerRectThan(e,t){return e.height>=t.height&&e.width>=t.width}enhance(){super.enhance(),this.controller.flip=this.flip}},Ze=(e,t)=>new Xe(e,t),Qe={moveKey:`Alt`,onMoved:null,orientation:`vertical`},$e={vertical:{back:`ArrowUp`,forward:`ArrowDown`},horizontal:{back:`ArrowLeft`,forward:`ArrowRight`}},et=class extends N{constructor(e,t={}){super(e,t);let{moveKey:n,onMoved:r,orientation:i}=Object.assign({},Qe,t);this.moveKey=d[n]?n:Qe.moveKey,this.onMoved=r,this.orientation=i,this.draggingItem=null,this.onKeydown=this.onKeydown.bind(this)}get items(){return this.controller.itemTargets}attachItem(e){e.addEventListener(`keydown`,this.onKeydown)}detachItem(e){e.removeEventListener(`keydown`,this.onKeydown)}attachItems(e){e.forEach(e=>this.attachItem(e))}detachItems(e){e.forEach(e=>this.detachItem(e))}resolveMoveKeys(e){let{back:t,forward:n}=$e[this.orientation];return this.orientation===`horizontal`&&getComputedStyle(e).direction===`rtl`?{back:n,forward:t}:{back:t,forward:n}}onKeydown(e){if(!this.controller.editingValue||e.repeat)return;let t=e.currentTarget,{back:n,forward:r}=this.resolveMoveKeys(t);if(e.key!==n&&e.key!==r||!e[d[this.moveKey]])return;let i=this.items,a=i.indexOf(t),o=e.key===n?a-1:a+1;o<0||o>=i.length||(e.preventDefault(),e.key===n?i[o].before(t):i[o].after(t),this.dispatch(`reordered`,{detail:{itemIds:this.orderedIds()}}),this.awaitCallback(this.onMoved,t),h(`Moved to position ${this.items.indexOf(t)+1} of ${this.items.length}`))}orderedIds(){return this.items.filter(e=>e.id).map(e=>e.id)}startDrag(e,t,n){this.draggingItem=e,t.setPointerCapture(n)}drag(e){if(!this.draggingItem)return;let t=this.orientation===`horizontal`?e.clientX:e.clientY,n=this.items,r=n.indexOf(this.draggingItem),i=n[r-1];if(i&&t<this.midpointOf(i)){i.before(this.draggingItem);return}let a=n[r+1];a&&t>this.midpointOf(a)&&a.after(this.draggingItem)}endDrag(e,t){if(!this.draggingItem)return null;e.releasePointerCapture(t);let n=this.draggingItem;return this.draggingItem=null,this.dispatch(`reordered`,{detail:{itemIds:this.orderedIds()}}),n}midpointOf(e){return _e(e.getBoundingClientRect(),this.orientation)}},tt=(e,t)=>new et(e,t),nt={events:[`resize`],boundaries:[`top`,`left`,`right`],onShifted:`shifted`,respectMotion:!0},rt=class extends Y{constructor(e,t={}){super(e,t);let{onShifted:n,events:r,boundaries:i,respectMotion:a}=Object.assign({},nt,t);this.onShifted=n,this.events=r,this.boundaries=i,this.respectMotion=a,this.prefersReducedMotion=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,this.enhance(),this.observe(this.shift)}shift=async()=>{if(!this.visible)return;this.dispatch(`shift`);let e=this.overflowRect(this.element.getBoundingClientRect(),this.elementTranslations(this.element)),t=e.left||e.right||0,n=e.top||e.bottom||0;this.element.style.transition=this.respectMotion&&this.prefersReducedMotion?`none`:``,this.element.style.transform=`translate(${t}px, ${n}px)`,await this.awaitCallback(this.onShifted,e),this.dispatch(`shifted`,{detail:e})};overflowRect(e,t){let n={},r=j(),i=A({x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height});for(let e of this.boundaries){let t=this.directionDistance(i,e,r),a=ge[e];t<0?i[a]+t>=r[a]&&!n[a]&&(n[e]=t):n[e]=``}return n}directionDistance(e,t,n){switch(t){case`top`:case`left`:return e[t]-n[t];case`bottom`:case`right`:return n[t]-e[t];default:throw`Invalid direction to calcuate distance, ${t}`}}elementTranslations(e){let t=window.getComputedStyle(e),n=t.transform||t.webkitTransform||t.mozTransform;if(n===`none`||n===void 0)return{x:0,y:0};let r=n.includes(`3d`)?`3d`:`2d`,i=n.match(/matrix.*\((.+)\)/)[1].split(`, `);return r===`2d`?{x:Number(i[4]),y:Number(i[5])}:{x:0,y:0}}enhance(){super.enhance(),this.controller.shift=this.shift}},it=(e,t)=>new rt(e,t),at={visibility:`visibility`,onShown:`shown`,onHidden:`hidden`},ot=class extends N{constructor(e,t={}){let{visibility:n,onShown:r,onHidden:i,activator:a}=Object.assign({},at,t),o=typeof n==`string`?n:at.namespace,s=typeof t.visible==`string`?t.visible:`isVisible`;(typeof t.visible!=`boolean`||t.visible)&&(t.visible=`${o}.${s}`),super(e,t),this.visibility=o,this.visibilityResolver=s,this.onShown=r,this.onHidden=i,this.activator=a instanceof HTMLElement?a:null,this.enhance(),this.element instanceof HTMLElement&&this.activate(this.isVisible(this.element))}isVisible(e){if(!(e instanceof HTMLElement))return!1;let t=M.hiddenClass;return t?!e.classList.contains(t):!e.hasAttribute(`hidden`)}toggle(e,t){if(!(e instanceof HTMLElement))return;let n=M.hiddenClass;n?t?e.classList.remove(n):e.classList.add(n):x(e,!t)}activate(e){this.activator&&_(this.activator,e)}async show(){!(this.element instanceof HTMLElement)||this.isVisible(this.element)||(this.dispatch(`show`),this.toggle(this.element,!0),this.activate(!0),await this.awaitCallback(this.onShown,{target:this.element}),this.dispatch(`shown`))}async hide(){!(this.element instanceof HTMLElement)||!this.isVisible(this.element)||(this.dispatch(`hide`),this.toggle(this.element,!1),this.activate(!1),await this.awaitCallback(this.onHidden,{target:this.element}),this.dispatch(`hidden`))}enhance(){let e=this,t={show:e.show.bind(e),hide:e.hide.bind(e)};Object.defineProperty(t,"visible",{get(){return e.isVisible(e.element)}}),Object.defineProperty(t,this.visibilityResolver,{value:e.isVisible.bind(e)}),Object.defineProperty(this.controller,this.visibility,{get(){return t}})}},Z=(e,t)=>new ot(e,t),st=4,ct=class extends t.Controller{static targets=[`grid`];static values={current:Number,today:{type:String,default:``},selected:{type:String,default:``},since:{type:String,default:``},till:{type:String,default:``}};initialize(){this.selector=We(this),q(this,{today:this.todayValue,year:this.currentValue||void 0,since:this.sinceValue||null,till:this.tillValue||null})}connect(){this.selector.attach(),this.navigated()}disconnect(){this.selector.detach()}currentValueChanged(){!this.calendar||!this.hasCurrentValue||this.calendar.navigate(this.currentDate)}selectedValueChanged(){if(!this.hasGridTarget)return;let e=G(this.selectedValue),t=e?e.getFullYear():null;this.gridTarget.querySelectorAll(`button[data-year]`).forEach(e=>{y(e,parseInt(e.dataset.year,10)===t)})}navigate(e){this.currentValue=e.getFullYear()}step(e,t){return this.calendar.step(e,t)}navigated(){this.drawGrid()}get currentDate(){return new Date(this.currentValue,0,1)}drawGrid(){if(!this.hasGridTarget)return;let{yearsOfDecade:e}=this.calendar,t=this.calendar.today.getFullYear(),n=G(this.selectedValue),r=n?n.getFullYear():null,i=[];for(let n of e){let e=document.createElement(`button`);e.type=`button`,e.textContent=n.value,e.dataset.year=n.value,e.setAttribute(`role`,`gridcell`),y(e,n.value===r),n.value===t&&b(e,`year`),n.disabled&&S(e,!0),i.push(e)}let a=document.createElement(`div`);a.setAttribute(`role`,`rowgroup`);for(let e=0;e<i.length;e+=st){let t=document.createElement(`div`);t.setAttribute(`role`,`row`);for(let n of i.slice(e,e+st))t.appendChild(n);a.appendChild(t)}this.gridTarget.replaceChildren(a)}},lt=class extends t.Controller{initialize(){this.selector=We(this)}connect(){this.selector.attach()}disconnect(){this.selector.detach()}},ut=class extends t.Controller{static targets=[`daysOfWeek`,`daysOfMonth`];static classes=[`dayOfWeek`,`dayOfMonth`,`dayOfOtherMonth`,`row`];static values={year:Number,month:Number,today:{type:String,default:``},selected:{type:String,default:``},since:{type:String,default:``},till:{type:String,default:``},locales:{type:Array,default:[`default`]},weekdayFormat:{type:String,default:`short`},dayFormat:{type:String,default:`numeric`},daysOfOtherMonth:{type:Boolean,default:!1}};initialize(){this.selector=He(this,{onSelect:`select`}),q(this,{today:this.todayValue,since:this.sinceValue||null,till:this.tillValue||null})}connect(){this.selector.attach(),this.navigated()}disconnect(){this.selector.detach()}yearValueChanged(){!this.calendar||!this.hasYearValue||this._scheduleNavigate()}monthValueChanged(){!this.calendar||!this.hasYearValue||this._scheduleNavigate()}_scheduleNavigate(){this._navigatePending||(this._navigatePending=!0,queueMicrotask(async()=>{this._navigatePending=!1,await this.calendar.navigate(this.currentDate),this.navigated()}))}selectedValueChanged(){if(!this.hasDaysOfMonthTarget||(this.daysOfMonthTarget.querySelectorAll(`[aria-selected]`).forEach(e=>{y(e,!1)}),!this.selectedValue))return;let e=G(this.selectedValue);if(!e)return;let t=this.daysOfMonthTarget.querySelector(`time[datetime="${e.toISOString()}"]`);if(t){let e=t.closest(`[aria-selected]`);e&&y(e,!0)}}navigate(e){this.yearValue=e.getFullYear(),this.monthValue=e.getMonth()}step(e,t){return this.calendar.step(e,t)}select(e){let t=G(e);t&&(this.selectedValue=e,(t.getMonth()!==this.calendar.month||t.getFullYear()!==this.calendar.year)&&this.calendar.navigate(t),this.dispatch(`selected`,{detail:{epoch:t.getTime(),iso:e}}))}navigated(){this.drawDaysOfWeek(),this.drawDaysOfMonth(),this.selectedValueChanged()}get currentDate(){return new Date(this.yearValue,this.monthValue,1)}createDayElement(e,{selectable:t=!1,disabled:n=!1}={}){let r=document.createElement(t?`button`:`div`);return r.tabIndex=-1,e?r.textContent=e:ie(r,!0),n&&(r instanceof HTMLButtonElement?r.disabled=!0:S(r,!0)),r}drawDaysOfWeek(){if(!this.hasDaysOfWeekTarget)return;let e=new Intl.DateTimeFormat(this.localesValue,{weekday:this.weekdayFormatValue}),t=[];for(let n of this.calendar.daysOfWeek){let r=this.createDayElement(e.format(n.date));r.setAttribute(`role`,`columnheader`),r.title=n.long,this.hasDayOfWeekClass&&r.classList.add(...this.dayOfWeekClasses),t.push(r)}let n=document.createElement(`div`);n.setAttribute(`role`,`row`),this.hasRowClass&&n.classList.add(...this.rowClasses),n.replaceChildren(...t),this.daysOfWeekTarget.replaceChildren(n)}drawDaysOfMonth(){if(!this.hasDaysOfMonthTarget)return;let e=this.calendar.today,t=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),n=[];for(let e of this.calendar.daysOfMonth){let r=this.calendar.isDisabled(e.date)||!this.calendar.isWithinRange(e.date),i=!e.current&&this.daysOfOtherMonthValue&&!r,a=e.current||this.daysOfOtherMonthValue?e.value:``,o=this.createDayElement(a,{selectable:e.current||i,disabled:e.current?r:!i});t===e.date.getTime()&&b(o,`date`),(e.current||this.daysOfOtherMonthValue)&&o.setAttribute(`aria-selected`,``),!e.current&&this.daysOfOtherMonthValue&&this.hasDayOfOtherMonthClass?o.classList.add(...this.dayOfOtherMonthClasses):this.hasDayOfMonthClass&&o.classList.add(...this.dayOfMonthClasses);let s=document.createElement(`time`);s.dateTime=e.iso,o.appendChild(s),n.push(o)}let r=[];for(let e=0;e<n.length;e+=7){let t=document.createElement(`div`);t.setAttribute(`role`,`row`),this.hasRowClass&&t.classList.add(...this.rowClasses);for(let r of n.slice(e,e+7))r.setAttribute(`role`,`gridcell`),t.appendChild(r);r.push(t)}this.daysOfMonthTarget.replaceChildren(...r)}},dt=class extends t.Controller{initialize(){this.selector=He(this)}connect(){this.selector.attach()}disconnect(){this.selector.detach()}},Q=4,ft=class extends t.Controller{static targets=[`grid`];static values={current:Number,today:{type:String,default:``},selected:{type:String,default:``},since:{type:String,default:``},till:{type:String,default:``},locales:{type:Array,default:[`default`]},monthFormat:{type:String,default:`short`}};initialize(){this.selector=Ue(this),q(this,{today:this.todayValue,year:this.currentValue||void 0,since:this.sinceValue||null,till:this.tillValue||null})}connect(){this.selector.attach(),this.navigated()}disconnect(){this.selector.detach()}currentValueChanged(){!this.calendar||!this.hasCurrentValue||this.calendar.navigate(this.currentDate)}selectedValueChanged(){if(!this.hasGridTarget)return;let e=G(this.selectedValue);this.gridTarget.querySelectorAll(`button[data-month]`).forEach(t=>{let n=parseInt(t.dataset.month,10)-1;y(t,!!e&&e.getMonth()===n)})}navigate(e){this.currentValue=e.getFullYear()}step(e,t){return this.calendar.step(e,t)}navigated(){this.drawGrid()}get currentDate(){return new Date(this.currentValue,0,1)}drawGrid(){if(!this.hasGridTarget)return;let{year:e,monthsOfYear:t}=this.calendar,n=this.calendar.today,r=G(this.selectedValue),i=[],a=new Intl.DateTimeFormat(this.localesValue,{month:this.monthFormatValue});for(let o of t){let t=document.createElement(`button`);t.type=`button`,t.textContent=a.format(o.date),t.dataset.month=o.value+1,t.setAttribute(`role`,`gridcell`),y(t,!!r&&r.getMonth()===o.value),o.value===n.getMonth()&&e===n.getFullYear()&&b(t,`month`),o.disabled&&S(t,!0),i.push(t)}let o=document.createElement(`div`);o.setAttribute(`role`,`rowgroup`);for(let e=0;e<i.length;e+=Q){let t=document.createElement(`div`);t.setAttribute(`role`,`row`);for(let n of i.slice(e,e+Q))t.appendChild(n);o.appendChild(t)}this.gridTarget.replaceChildren(o)}},pt=class extends t.Controller{initialize(){this.selector=Ue(this)}connect(){this.selector.attach()}disconnect(){this.selector.detach()}},mt=class extends t.Controller{static targets=[`master`,`item`];connect(){this.recompute()}onChange(e){e.target===this.masterTarget&&this.toggleAll(this.masterTarget.checked),this.recompute()}toggleAll(e){this.enabledItems().forEach(t=>{t.checked=e})}recompute(){let e=this.enabledItems(),t=e.filter(e=>e.checked).length;this.masterTarget.checked=e.length>0&&t===e.length,this.masterTarget.indeterminate=t>0&&t<e.length}enabledItems(){return this.itemTargets.filter(e=>!e.disabled)}},ht=class extends t.Controller{static targets=[`source`];static values={contentType:{type:String,default:`text/plain`}};onPaste(e){let t=e.clipboardData?.getData(this.contentTypeValue)??``,n=Array.from(e.clipboardData?.types??[]);e.preventDefault(),this.dispatch(`pasted`,{detail:{text:t,types:n},bubbles:!0})}async copy(e){let t=e.params?.text??(this.hasSourceTarget?this.sourceTarget.value??this.sourceTarget.textContent??``:``);try{await navigator.clipboard.writeText(t),this.dispatch(`copied`,{detail:{text:t},bubbles:!0})}catch(e){this.dispatch(`copy-failed`,{detail:{error:e},bubbles:!0})}}},$=[`month`,`year`,`decade`],gt=class extends t.Controller{static targets=[`previous`,`next`,`day`,`month`,`year`,`viewTitle`];static outlets=[`calendar-month`,`calendar-year`,`calendar-decade`];static values={date:String,view:{type:String,default:`month`},locales:{type:Array,default:[`default`]},dayFormat:{type:String,default:`numeric`},monthFormat:{type:String,default:`long`},yearFormat:{type:String,default:`numeric`}};initialize(){this.previous=this.previous.bind(this),this.next=this.next.bind(this)}async calendarMonthOutletConnected(){if(this.dateValue){let e=G(this.dateValue);e&&await this.calendarMonthOutlet.calendar.navigate(e)}this.draw()}onDaySelect(e){this.dateValue=e.detail.iso,this.draw(),this.dispatch(`selected`,{detail:{value:e.detail.iso},bubbles:!0})}zoomOut(){let e=$.indexOf(this.viewValue);e<$.length-1&&(this.viewValue=$[e+1],this.draw())}async onMonthSelect(e){let{month:t}=e.detail;if(!this.hasCalendarMonthOutlet)return;let{year:n}=this.calendarMonthOutlet.calendar;await this.calendarMonthOutlet.calendar.navigate(new Date(n,t-1,1)),this.viewValue=`month`,this.draw()}async onYearSelect(e){let{year:t}=e.detail;if(!this.hasCalendarMonthOutlet)return;let{month:n}=this.calendarMonthOutlet.calendar;await this.calendarMonthOutlet.calendar.navigate(new Date(t,n,1)),this.hasCalendarYearOutlet&&this.calendarYearOutlet.navigate(this.calendarMonthOutlet.calendar.current),this.viewValue=`year`,this.draw()}previousTargetConnected(e){e.addEventListener(`click`,this.previous)}previousTargetDisconnected(e){e.removeEventListener(`click`,this.previous)}async previous(){await this.calendarMonthOutlet.calendar.step(...this.stepArgs(-1)),this.syncOutletValues(),this.draw()}nextTargetConnected(e){e.addEventListener(`click`,this.next)}nextTargetDisconnected(e){e.removeEventListener(`click`,this.next)}async next(){await this.calendarMonthOutlet.calendar.step(...this.stepArgs(1)),this.syncOutletValues(),this.draw()}draw(){this.drawDay(),this.drawMonth(),this.drawYear(),this.drawViewTitle(),this.drawView()}drawDay(){if(!this.hasDayTarget||!this.hasCalendarMonthOutlet)return;let{year:e,month:t,day:n}=this.calendarMonthOutlet.calendar;this.dayTarget.textContent=new Intl.DateTimeFormat(this.localesValue,{day:this.dayFormatValue}).format(new Date(e,t,n))}drawMonth(){if(!this.hasMonthTarget||!this.hasCalendarMonthOutlet)return;let{year:e,month:t}=this.calendarMonthOutlet.calendar;this.monthTarget.textContent=new Intl.DateTimeFormat(this.localesValue,{month:this.monthFormatValue}).format(new Date(e,t))}drawYear(){if(!this.hasYearTarget||!this.hasCalendarMonthOutlet)return;let{year:e}=this.calendarMonthOutlet.calendar;this.yearTarget.textContent=new Intl.DateTimeFormat(this.localesValue,{year:this.yearFormatValue}).format(new Date(e,0))}drawViewTitle(){if(!this.hasViewTitleTarget||!this.hasCalendarMonthOutlet)return;let{year:e,month:t}=this.calendarMonthOutlet.calendar;this.viewTitleTarget.textContent=this.viewTitleLabel(e,t)}syncOutletValues(){if(!this.hasCalendarMonthOutlet)return;let{current:e}=this.calendarMonthOutlet.calendar;e&&(this.hasCalendarYearOutlet&&this.calendarYearOutlet.navigate(e),this.hasCalendarDecadeOutlet&&this.calendarDecadeOutlet.navigate(e))}stepArgs(e){return this.viewValue===`year`?[`year`,e]:this.viewValue===`decade`?[`year`,e*10]:[`month`,e]}viewTitleLabel(e,t){if(this.viewValue===`year`)return String(e);if(this.viewValue===`decade`){let t=Math.floor(e/10)*10;return`${t}–${t+9}`}return new Intl.DateTimeFormat(this.localesValue,{month:`long`,year:`numeric`}).format(new Date(e,t))}drawView(){let e=this.viewValue===`month`,t=this.viewValue===`year`,n=this.viewValue===`decade`;if(this.hasCalendarMonthOutlet){let t=this.calendarMonthOutlet;t.hasDaysOfWeekTarget&&(t.daysOfWeekTarget.hidden=!e),t.hasDaysOfMonthTarget&&(t.daysOfMonthTarget.hidden=!e)}this.hasCalendarYearOutlet&&(this.calendarYearOutletElement.hidden=!t),this.hasCalendarDecadeOutlet&&(this.calendarDecadeOutletElement.hidden=!n)}},_t=class extends t.Controller{static targets=[`listbox`,`loading`,`empty`];static values={url:{type:String,default:``},field:{type:String,default:`q`},delay:{type:Number,default:300}};initialize(){this._requestor=new k}connect(){this.hasListboxTarget&&(this.listboxNav=new p(this.listboxTarget))}disconnect(){this._requestor.cancel()}onSelect(e){let t=e.target.closest(`[role="option"]`);!t||ae(t)||this.select(t.dataset.value??``)}select(e){let t=this.listboxTarget.querySelectorAll(`[role="option"]`);t.forEach(e=>y(e,!1));let n=[...t].find(t=>t.dataset.value===e);n&&y(n,!0),this.dispatch(`selected`,{detail:{value:e},bubbles:!0})}onNavigate(e){this.listboxNav?.handleKeyDown(e)}filter(e){if(this.urlValue){let t=new URL(this.urlValue,window.location.href);t.searchParams.set(this.fieldValue,e),this.setLoading(!0),this._requestor.schedule(()=>this._requestor.request(t).then(e=>e.text()).then(e=>{this.listboxTarget.innerHTML=e,this.setEmpty(this.listboxTarget.querySelectorAll(`[role="option"]`).length===0)}).catch(e=>{e.name!==`AbortError`&&console.error(`[combobox-dropdown] fetch failed`,e)}).finally(()=>this.setLoading(!1)),this.delayValue)}else{let t=he(this.listboxTarget,e);this.setEmpty(t===0)}}showAll(){this.listboxTarget.querySelectorAll(`[role="option"]`).forEach(e=>e.hidden=!1),this.setEmpty(!1)}setLoading(e){this.hasLoadingTarget&&(this.loadingTarget.hidden=!e)}setEmpty(e){this.hasEmptyTarget&&(this.emptyTarget.hidden=!e)}},vt=class extends t.Controller{static targets=[`hour`,`minute`,`period`];connect(){this.select(this.toH24())}onSelect(e){let t=e.target.closest(`[role="option"]`);t&&(t.closest(`[role="listbox"]`).querySelectorAll(`[role="option"]`).forEach(e=>y(e,!1)),y(t,!0),this.select(this.toH24()))}select(e){e&&this.dispatch(`selected`,{detail:{value:e},bubbles:!0})}onNavigate(e){[`ArrowUp`,`ArrowDown`].includes(e.key)&&(e.preventDefault(),this.step(e.currentTarget,e.key===`ArrowDown`?1:-1))}step(e,t){let n=[...e.querySelectorAll(`[role="option"]`)],r=e.querySelector(`[aria-selected="true"]`),i=n.indexOf(r),a=t>0?n[Math.min(i+1,n.length-1)]:n[Math.max(i-1,0)];!a||a===r||(n.forEach(e=>y(e,!1)),y(a,!0),a.scrollIntoView({block:`nearest`}),this.select(this.toH24()))}toH24(){let e=this.selectedValue(this.hourTarget),t=this.selectedValue(this.minuteTarget);if(!e||!t)return null;if(!this.hasPeriodTarget)return`${e}:${t}`;let n=this.selectedValue(this.periodTarget),r=parseInt(e,10);return r=n===`AM`?r===12?0:r:r===12?12:r+12,`${String(r).padStart(2,`0`)}:${t}`}selectedValue(e){return e?.querySelector(`[aria-selected="true"]`)?.dataset.value??null}},yt=class extends t.Controller{static targets=[`trigger`];connect(){X(this,{trigger:this.hasTriggerTarget?this.triggerTarget:null})}},bt=class extends t.Controller{static targets=[`anchor`,`reference`];static values={placement:{type:String,default:`bottom`},alignment:{type:String,default:`start`},role:{type:String,default:`tooltip`}};connect(){if(!this.hasReferenceTarget){console.error(`FlipperController requires a reference target. Add data-flipper-target="reference" to your element.`);return}if(!this.hasAnchorTarget){console.error(`FlipperController requires an anchor target. Add data-flipper-target="anchor" to your element.`);return}Ze(this,{element:this.referenceTarget,anchor:this.anchorTarget,placement:this.placementValue,alignment:this.alignmentValue,ariaRole:this.roleValue})}},xt=class extends t.Controller{static targets=[`trigger`,`input`];static values={value:String,minLength:{type:Number,default:1}};static outlets=[`combobox-dropdown`];onSelect(e){e.detail?.value!==void 0&&(this.valueValue=e.detail.value)}onInput(e){if(e.target!==this.triggerTarget)return;let t=e.target.value.trim();if(t.length<this.minLengthValue){this.hasComboboxDropdownOutlet&&this.comboboxDropdownOutlet.showAll();return}this.hasComboboxDropdownOutlet&&this.comboboxDropdownOutlet.filter(t)}valueValueChanged(e){this.hasInputTarget&&(this.inputTarget.value=e),this.dispatch(`changed`,{detail:{value:e}})}},St=class extends t.Controller{static targets=[`input`,`toggle`];static values={format:{type:String,default:`plain`},options:{type:Object,default:{}},revealed:{type:Boolean,default:!1}};connect(){U(this,{type:this.formatValue,options:this.optionsValue}),this.format(this.readValue()),this.drawToggle()}formatValueChanged(){this.formatter&&(U(this,{type:this.formatValue,options:this.optionsValue}),this.format(this.readValue()),this.drawToggle())}optionsValueChanged(){this.formatter&&(U(this,{type:this.formatValue,options:this.optionsValue}),this.format(this.readValue()))}revealedValueChanged(){this.formatter&&(this.format(this.readValue()),this.drawToggle())}onChange(e){this.format(e?.detail?.value??``)}format(e){this.formatter&&this.onFormatting(e)}toggle(){!this.formatter.maskable()&&this.formatValue!==`password`||(this.revealedValue=!this.revealedValue)}onPaste(e){let t=e.detail?.text??``;if(!this.formatter||!t)return;let n=this.formatter.normalize(t);this.formatter.validate(n)&&this.format(n)}drawToggle(){if(!this.hasToggleTarget)return;let e=this.formatter?.maskable()||this.formatValue===`password`;this.toggleTarget.hidden=!e,e&&ne(this.toggleTarget,this.revealedValue)}readValue(){return this.hasInputTarget?this.inputTarget instanceof HTMLInputElement?this.inputTarget.value:this.inputTarget.textContent:``}onFormatting(e){if(!this.formatter)return;if(this.formatValue===`password`){this.hasInputTarget&&(this.inputTarget.type=this.revealedValue?`text`:`password`);return}let t=this.formatter.normalize(e),n=this.revealedValue||!this.formatter.maskable()?this.formatter.format(t):this.formatter.mask(t);this.hasInputTarget&&(this.inputTarget instanceof HTMLInputElement?this.inputTarget.value=n:this.inputTarget.textContent=n),this.dispatch(`formatted`,{detail:{value:n}})}},Ct=class extends t.Controller{static targets=[`input`,`clear`];initialize(){this.onInput=this.draw.bind(this),this.onEscape=this.handleEscape.bind(this)}connect(){this.draw()}inputTargetConnected(e){e.addEventListener(`input`,this.onInput),e.addEventListener(`keydown`,this.onEscape)}inputTargetDisconnected(e){e.removeEventListener(`input`,this.onInput),e.removeEventListener(`keydown`,this.onEscape)}clear(){this.hasInputTarget&&(this.inputTarget.value=``,this.draw(),this.inputTarget.focus(),this.inputTarget.dispatchEvent(new Event(`input`,{bubbles:!0})))}draw(){!this.hasInputTarget||!this.hasClearTarget||(this.clearTarget.hidden=this.inputTarget.value.length===0)}handleEscape(e){e.key===`Escape`&&this.inputTarget.value!==``&&(e.preventDefault(),this.clear())}},wt=class extends t.Controller{static targets=[`modal`,`overlay`];initialize(){this.onCancel=this.close.bind(this)}connect(){this.hasModalTarget||console.error(`ModalController requires a modal target. Add data-modal-target="modal" to your element.`)}modalTargetConnected(e){this.isNativeDialog=e instanceof HTMLDialogElement,this.isNativeDialog?(e.addEventListener(`cancel`,this.onCancel),e.addEventListener(`click`,this.onBackdropClick)):(this.focusTrap=new o(e,{escapeDeactivates:!0,onDeactivate:()=>this.close()}),X(this,{element:e}))}modalTargetDisconnected(e){this.isNativeDialog&&(e.removeEventListener(`cancel`,this.onCancel),e.removeEventListener(`click`,this.onBackdropClick))}dismissed=()=>{this.close()};open(e){if(e&&e.preventDefault(),this.hasModalTarget){if(this.isNativeDialog)this.previouslyFocused=document.activeElement,this.modalTarget.showModal();else{let e=this.hasOverlayTarget?this.overlayTarget:this.modalTarget;e.hidden=!1,document.body.style.overflow=`hidden`,this.focusTrap&&this.focusTrap.activate()}h(`Modal opened`)}}close(e){if(e&&e.preventDefault(),this.hasModalTarget){if(this.isNativeDialog)this.modalTarget.close(),this.previouslyFocused&&this.previouslyFocused.isConnected&&setTimeout(()=>{this.previouslyFocused.focus()},0);else{let e=this.hasOverlayTarget?this.overlayTarget:this.modalTarget;e.hidden=!0,document.body.style.overflow=``,this.focusTrap&&this.focusTrap.deactivate()}h(`Modal closed`)}}onBackdropClick=e=>{let t=this.modalTarget.getBoundingClientRect();(e.clientY<t.top||e.clientY>t.bottom||e.clientX<t.left||e.clientX>t.right)&&this.close()}},Tt=class extends t.Controller{static targets=[`content`];connect(){it(this,{element:this.hasContentTarget?this.contentTarget:null})}},Et=class extends t.Controller{static targets=[`trigger`,`panel`,`template`,`loader`];static values={url:String,loadedAt:String,reload:{type:String,default:`never`},staleAfter:{type:Number,default:3600},closeOnSelect:{type:Boolean,default:!0},announceOpen:{type:String,default:`Panel opened`},announceClose:{type:String,default:`Panel closed`}};connect(){Ke(this,{element:this.hasPanelTarget?this.panelTarget:null,url:this.hasUrlValue?this.urlValue:null}),this.hasPanelTarget&&(Z(this,{element:this.panelTarget,activator:this.hasTriggerTarget?this.triggerTarget:null}),X(this)),this.hasLoaderTarget&&Z(this,{element:this.loaderTarget,visibility:`contentLoaderVisibility`})}async dismissed(){await this.close()}async open(){this.hasPanelTarget&&await this.visibility.show()}async close(){this.hasPanelTarget&&await this.visibility.hide()}async toggle(){this.visibility?.visible?await this.close():await this.open()}async closeOnSelect(){this.closeOnSelectValue&&await this.close()}async shown(){await this.load(),this.hasPanelTarget&&a(this.panelTarget),h(this.announceOpenValue)}async hidden(){this.hasTriggerTarget&&this.triggerTarget.focus(),h(this.announceCloseValue)}canLoad(){return this.hasPanelTarget&&this.panelTarget.tagName.toLowerCase()===`turbo-frame`?(this.hasUrlValue&&this.panelTarget.setAttribute(`src`,this.urlValue),!1):!0}async contentLoading(){this.hasLoaderTarget&&await this.contentLoaderVisibility.show()}async contentLoaded({content:e}){this.hasPanelTarget&&this.panelTarget.replaceChildren(this.getContentNode(e)),this.hasLoaderTarget&&await this.contentLoaderVisibility.hide()}getContentNode(e){if(typeof e==`string`){let t=document.createElement(`template`);return t.innerHTML=e,document.importNode(t.content,!0)}return document.importNode(e,!0)}contentLoader(){if(this.hasTemplateTarget)return this.templateTarget instanceof HTMLTemplateElement?this.templateTarget.content:this.templateTarget.innerHTML}},Dt=class extends t.Controller{static targets=[`fill`,`meter`];static values={variant:{type:String,default:`bar`},current:{type:Number,default:0},min:{type:Number,default:0},max:{type:Number,default:100},optimum:Number,low:Number,high:Number,indeterminate:{type:Boolean,default:!1},indeterminateFraction:{type:Number,default:.25}};connect(){this.variantValue===`ring`&&this.hasFillTarget&&this.setCircumference(this.fillTarget),this.render()}setValue(e){this.currentValue=this.clamp(e),this.render(),this.dispatch(`changed`,{detail:{value:this.currentValue,min:this.minValue,max:this.maxValue}})}currentValueChanged(){this.render()}clamp(e){return Math.min(this.maxValue,Math.max(this.minValue,e))}render(){switch(this.variantValue){case`meter`:return this.renderMeter();case`ring`:case`bar`:return C(this.element,this.minValue),w(this.element,this.maxValue),T(this.element,this.indeterminateValue?null:this.currentValue),this.element.classList.toggle(`sp-progress-indeterminate`,this.indeterminateValue),this.variantValue===`ring`?this.renderRing():this.renderBar();default:return}}percent(){let e=this.maxValue-this.minValue;return e<=0?0:(this.currentValue-this.minValue)/e*100}renderBar(){if(this.hasFillTarget){if(this.indeterminateValue){this.fillTarget.style.width=`${this.indeterminateFractionValue*100}%`;return}this.fillTarget.style.width=`${this.percent()}%`}}renderRing(){if(this.hasFillTarget){if(this.circumference??this.setCircumference(this.fillTarget),this.indeterminateValue){let e=this.circumference*this.indeterminateFractionValue;this.fillTarget.style.strokeDasharray=`${e} ${this.circumference-e}`;return}this.fillTarget.style.strokeDasharray=`${this.circumference}`,this.fillTarget.style.strokeDashoffset=`${this.circumference*(1-this.percent()/100)}`}}setCircumference(e){let t=parseFloat(e.getAttribute(`r`));this.circumference=2*Math.PI*t}renderMeter(){if(!this.hasMeterTarget||!(this.meterTarget instanceof HTMLMeterElement))return;let e=this.meterTarget;e.value=this.currentValue,e.min=this.minValue,e.max=this.maxValue,this.hasLowValue&&(e.low=this.lowValue),this.hasHighValue&&(e.high=this.highValue),this.hasOptimumValue&&(e.optimum=this.optimumValue)}},Ot=class extends t.Controller{static targets=[`item`,`handle`,`trigger`];static values={moveKey:{type:String,default:`Alt`},editing:{type:Boolean,default:!1},orientation:{type:String,default:`vertical`}};connect(){this.reorderable=tt(this,{moveKey:this.moveKeyValue,orientation:this.orientationValue,onMoved:`moved`}),this.reorderable.attachItems(this.itemTargets),this.rovingTabIndex=new f(this.itemTargets,{orientation:this.orientationValue}),this.rovingTabIndex.activate()}disconnect(){this.reorderable.detachItems(this.itemTargets),this.rovingTabIndex?.deactivate(),this.rovingTabIndex=null}itemTargetConnected(e){this.reorderable?.attachItem(e),this.rovingTabIndex?.updateItems(this.itemTargets)}itemTargetDisconnected(e){this.reorderable?.detachItem(e),this.rovingTabIndex?.updateItems(this.itemTargets)}editingValueChanged(e){this.triggerTargets.forEach(t=>oe(t,e))}toggleEditing(){this.editingValue=!this.editingValue}enterEditing(){this.editingValue=!0}exitEditing(){this.editingValue=!1}onPointerDown(e){if(!this.editingValue)return;let t=e.currentTarget.closest(`[data-reorderable-target~="item"]`);t&&this.reorderable.startDrag(t,e.currentTarget,e.pointerId)}onPointerMove(e){this.editingValue&&this.reorderable.drag(e)}onPointerUp(e){this.editingValue&&(this.reorderable.endDrag(e.currentTarget,e.pointerId),this.rovingTabIndex?.updateItems(this.itemTargets))}moved(e){this.rovingTabIndex?.updateItems(this.itemTargets),this.rovingTabIndex.setCurrentIndex(this.itemTargets.indexOf(e))}},kt=class extends t.Controller{static targets=[`trigger`,`detail`,`time`];static values={dateFormat:{type:Object,default:{}}};connect(){this.rovingTabIndex=new f(this.triggerTargets,{orientation:`vertical`}),this.rovingTabIndex.activate()}disconnect(){this.rovingTabIndex?.deactivate(),this.rovingTabIndex=null}toggle(e){let t=e.currentTarget;v(t)?this.collapseItem(t):this.expandItem(t)}expand(e){this.expandItem(e.currentTarget)}collapse(e){this.collapseItem(e.currentTarget)}expandItem(e){let t=this.detailTargets.find(t=>t.id===e.getAttribute(`aria-controls`))??null;this.dispatch(`expand`,{detail:{trigger:e,detail:t}}),_(e,!0),t&&(x(t,!1),h(`${e.textContent.trim()} expanded`)),this.dispatch(`expanded`,{detail:{trigger:e,detail:t}})}collapseItem(e){let t=this.detailTargets.find(t=>t.id===e.getAttribute(`aria-controls`))??null;this.dispatch(`collapse`,{detail:{trigger:e,detail:t}}),_(e,!1),t&&(x(t,!0),h(`${e.textContent.trim()} collapsed`)),this.dispatch(`collapsed`,{detail:{trigger:e,detail:t}})}triggerTargetConnected(e){e.hasAttribute(`aria-expanded`)||_(e,!1),this.rovingTabIndex?.updateItems(this.triggerTargets)}triggerTargetDisconnected(){this.rovingTabIndex?.updateItems(this.triggerTargets)}timeTargetConnected(e){if(!Object.keys(this.dateFormatValue).length||e.textContent.trim())return;let t=L.format(e.getAttribute(`datetime`),this.dateFormatValue);t&&(e.textContent=t)}},At=class extends t.Controller{static targets=[`content`];connect(){X(this)}contentTargetConnected(e){it(this,{element:e}),Z(this,{element:e})}async dismissed(){this.hasContentTarget&&await this.visibility.hide()}async toggle(){this.hasContentTarget&&(this.visibility.visible?await this.visibility.hide():(await this.visibility.show(),this.shift(this.contentTarget)))}};e.ARIA_HASPOPUP_VALUES=E,e.CalendarDecadeController=ct,e.CalendarDecadeSelectorController=lt,e.CalendarMonthController=ut,e.CalendarMonthSelectorController=dt,e.CalendarYearController=ft,e.CalendarYearSelectorController=pt,e.ChecklistController=mt,e.ClipboardController=ht,e.ComboboxDateController=gt,e.ComboboxDropdownController=_t,e.ComboboxTimeController=vt,e.DismisserController=yt,e.FOCUSABLE_SELECTOR=n,e.FORMATTER_TYPES=z,e.FlipperController=bt,e.FocusTrap=o,e.Formatter=H,e.InputClearableController=Ct,e.InputComboboxController=xt,e.InputFormatterController=St,e.ListboxNavigation=p,e.MODIFIER_KEYS=d,e.ModalController=wt,e.PannerController=Tt,e.PopoverController=Et,e.ProgressController=Dt,e.ReorderableController=Ot,e.Requestor=k,e.RovingTabIndex=f,e.TimelineController=kt,e.VisibilityController=At,e.announce=h,e.connectTriggerToTarget=se,e.disconnectTriggerFromTarget=le,e.ensureId=te,e.filterOptions=he,e.focusFirst=a,e.fuzzyMatcher=ue,e.generateId=ee,e.getFocusableElements=r,e.isActivationKey=c,e.isAriaDisabled=ae,e.isArrowKey=l,e.isExpanded=v,e.isKey=s,e.isVisible=i,e.preventDefault=u,e.setAriaDisabled=S,e.setAriaHidden=ie,e.setAriaState=g,e.setChecked=re,e.setCurrent=b,e.setDisabled=oe,e.setExpanded=_,e.setHidden=x,e.setPressed=ne,e.setSelected=y,e.setValueMax=w,e.setValueMin=C,e.setValueNow=T});
|
|
2
2
|
//# sourceMappingURL=index.umd.js.map
|