@xy-planning-network/trees 0.13.4-dev-1 → 0.13.4-dev-3
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.
package/dist/trees.es.js
CHANGED
|
@@ -6631,12 +6631,12 @@ const cd = {
|
|
|
6631
6631
|
}
|
|
6632
6632
|
g == null || g.clear();
|
|
6633
6633
|
}), { aria: a, errorState: s, inputID: l, isRequired: i, onInvalid: u, validate: c } = gt(n), d = (p) => {
|
|
6634
|
-
o.
|
|
6634
|
+
o.pause(), e.value = p, o.resume();
|
|
6635
6635
|
}, f = Rt("wrapper");
|
|
6636
6636
|
let g = null;
|
|
6637
6637
|
return He(() => {
|
|
6638
6638
|
const p = {
|
|
6639
|
-
allowInput: !
|
|
6639
|
+
allowInput: !n.maxRange,
|
|
6640
6640
|
appendTo: f.value || void 0,
|
|
6641
6641
|
dateFormat: "m-d-Y",
|
|
6642
6642
|
mode: "range",
|
package/dist/trees.umd.js
CHANGED
|
@@ -11,7 +11,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
11
11
|
<span class='flatpickr-weekday'>
|
|
12
12
|
${b.join("</span><span class='flatpickr-weekday'>")}
|
|
13
13
|
</span>
|
|
14
|
-
`}function mt(){e.calendarContainer.classList.add("hasWeeks");const h=z("div","flatpickr-weekwrapper");h.appendChild(z("span","flatpickr-weekday",e.l10n.weekAbbreviation));const b=z("div","flatpickr-weeks");return h.appendChild(b),{weekWrapper:h,weekNumbers:b}}function q(h,b=!0){const x=b?h:h-e.currentMonth;x<0&&e._hidePrevMonthArrow===!0||x>0&&e._hideNextMonthArrow===!0||(e.currentMonth+=x,(e.currentMonth<0||e.currentMonth>11)&&(e.currentYear+=e.currentMonth>11?1:-1,e.currentMonth=(e.currentMonth+12)%12,ne("onYearChange"),J()),G(),ne("onMonthChange"),Zn())}function Ne(h=!0,b=!0){if(e.input.value="",e.altInput!==void 0&&(e.altInput.value=""),e.mobileInput!==void 0&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,b===!0&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),e.config.enableTime===!0){const{hours:x,minutes:k,seconds:V}=Or(e.config);p(x,k,V)}e.redraw(),h&&ne("onChange")}function Oe(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),ne("onClose")}function nt(){e.config!==void 0&&ne("onDestroy");for(let h=e._handlers.length;h--;)e._handlers[h].remove();if(e._handlers=[],e.mobileInput)e.mobileInput.parentNode&&e.mobileInput.parentNode.removeChild(e.mobileInput),e.mobileInput=void 0;else if(e.calendarContainer&&e.calendarContainer.parentNode)if(e.config.static&&e.calendarContainer.parentNode){const h=e.calendarContainer.parentNode;if(h.lastChild&&h.removeChild(h.lastChild),h.parentNode){for(;h.firstChild;)h.parentNode.insertBefore(h.firstChild,h);h.parentNode.removeChild(h)}}else e.calendarContainer.parentNode.removeChild(e.calendarContainer);e.altInput&&(e.input.type="text",e.altInput.parentNode&&e.altInput.parentNode.removeChild(e.altInput),delete e.altInput),e.input&&(e.input.type=e.input._type,e.input.classList.remove("flatpickr-input"),e.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(h=>{try{delete e[h]}catch{}})}function oe(h){return e.config.appendTo&&e.config.appendTo.contains(h)?!0:e.calendarContainer.contains(h)}function rt(h){if(e.isOpen&&!e.config.inline){const b=ve(h),x=oe(b),k=b===e.input||b===e.altInput||e.element.contains(b)||h.path&&h.path.indexOf&&(~h.path.indexOf(e.input)||~h.path.indexOf(e.altInput)),V=h.type==="blur"?k&&h.relatedTarget&&!oe(h.relatedTarget):!k&&!x&&!oe(h.relatedTarget),D=!e.config.ignoredFocusElements.some(M=>M.contains(b));V&&D&&(e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0&&e.input.value!==""&&e.input.value!==void 0&&c(),e.close(),e.config&&e.config.mode==="range"&&e.selectedDates.length===1&&(e.clear(!1),e.redraw()))}}function Kn(h){if(!h||e.config.minDate&&h<e.config.minDate.getFullYear()||e.config.maxDate&&h>e.config.maxDate.getFullYear())return;const b=h,x=e.currentYear!==b;e.currentYear=b||e.currentYear,e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth=Math.min(e.config.maxDate.getMonth(),e.currentMonth):e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()&&(e.currentMonth=Math.max(e.config.minDate.getMonth(),e.currentMonth)),x&&(e.redraw(),ne("onYearChange"),J())}function ht(h,b=!0){var x;const k=e.parseDate(h,void 0,b);if(e.config.minDate&&k&&Te(k,e.config.minDate,b!==void 0?b:!e.minDateHasTime)<0||e.config.maxDate&&k&&Te(k,e.config.maxDate,b!==void 0?b:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(k===void 0)return!1;const V=!!e.config.enable,D=(x=e.config.enable)!==null&&x!==void 0?x:e.config.disable;for(let M=0,v;M<D.length;M++){if(v=D[M],typeof v=="function"&&v(k))return V;if(v instanceof Date&&k!==void 0&&v.getTime()===k.getTime())return V;if(typeof v=="string"){const F=e.parseDate(v,void 0,!0);return F&&F.getTime()===k.getTime()?V:!V}else if(typeof v=="object"&&k!==void 0&&v.from&&v.to&&k.getTime()>=v.from.getTime()&&k.getTime()<=v.to.getTime())return V}return!V}function Gn(h){return e.daysContainer!==void 0?h.className.indexOf("hidden")===-1&&h.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(h):!1}function Fh(h){h.target===e._input&&(e.selectedDates.length>0||e._input.value.length>0)&&!(h.relatedTarget&&oe(h.relatedTarget))&&e.setDate(e._input.value,!0,h.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function jh(h){const b=ve(h),x=e.config.wrap?n.contains(b):b===e._input,k=e.config.allowInput,V=e.isOpen&&(!k||!x),D=e.config.inline&&x&&!k;if(h.keyCode===13&&x){if(k)return e.setDate(e._input.value,!0,b===e.altInput?e.config.altFormat:e.config.dateFormat),b.blur();e.open()}else if(oe(b)||V||D){const M=!!e.timeContainer&&e.timeContainer.contains(b);switch(h.keyCode){case 13:M?(h.preventDefault(),c(),Zr()):si(h);break;case 27:h.preventDefault(),Zr();break;case 8:case 46:x&&!e.config.allowInput&&(h.preventDefault(),e.clear());break;case 37:case 39:if(!M&&!x){if(h.preventDefault(),e.daysContainer!==void 0&&(k===!1||document.activeElement&&Gn(document.activeElement))){const F=h.keyCode===39?1:-1;h.ctrlKey?(h.stopPropagation(),q(F),L(T(1),0)):L(void 0,F)}}else e.hourElement&&e.hourElement.focus();break;case 38:case 40:h.preventDefault();const v=h.keyCode===40?1:-1;e.daysContainer&&b.$i!==void 0||b===e.input||b===e.altInput?h.ctrlKey?(h.stopPropagation(),Kn(e.currentYear-v),L(T(1),0)):M||L(void 0,v*7):b===e.currentYearElement?Kn(e.currentYear-v):e.config.enableTime&&(!M&&e.hourElement&&e.hourElement.focus(),c(h),e._debouncedChange());break;case 9:if(M){const F=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter(X=>X),j=F.indexOf(b);if(j!==-1){const X=F[j+(h.shiftKey?-1:1)];h.preventDefault(),(X||e._input).focus()}}else!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(b)&&h.shiftKey&&(h.preventDefault(),e._input.focus());break}}if(e.amPM!==void 0&&b===e.amPM)switch(h.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0],u(),ot();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],u(),ot();break}(x||oe(b))&&ne("onKeyDown",h)}function Xr(h){if(e.selectedDates.length!==1||h&&(!h.classList.contains("flatpickr-day")||h.classList.contains("flatpickr-disabled")))return;const b=h?h.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),x=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),k=Math.min(b,e.selectedDates[0].getTime()),V=Math.max(b,e.selectedDates[0].getTime());let D=!1,M=0,v=0;for(let F=k;F<V;F+=od.DAY)ht(new Date(F),!0)||(D=D||F>k&&F<V,F<x&&(!M||F>M)?M=F:F>x&&(!v||F<v)&&(v=F));for(let F=0;F<e.config.showMonths;F++){const j=e.daysContainer.children[F];for(let X=0,Re=j.children.length;X<Re;X++){const he=j.children[X],Ge=he.dateObj.getTime(),Qt=M>0&&Ge<M||v>0&&Ge>v;if(Qt){he.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(en=>{he.classList.remove(en)});continue}else if(D&&!Qt)continue;["startRange","inRange","endRange","notAllowed"].forEach(en=>{he.classList.remove(en)}),h!==void 0&&(h.classList.add(b<=e.selectedDates[0].getTime()?"startRange":"endRange"),x<b&&Ge===x?he.classList.add("startRange"):x>b&&Ge===x&&he.classList.add("endRange"),Ge>=M&&(v===0||Ge<=v)&&rd(Ge,x,b)&&he.classList.add("inRange"))}}}function Hh(){e.isOpen&&!e.config.static&&!e.config.inline&&Jn()}function Uh(h,b=e._positionElement){if(e.isMobile===!0){if(h){h.preventDefault();const k=ve(h);k&&k.blur()}e.mobileInput!==void 0&&(e.mobileInput.focus(),e.mobileInput.click()),ne("onOpen");return}else if(e._input.disabled||e.config.inline)return;const x=e.isOpen;e.isOpen=!0,x||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),ne("onOpen"),Jn(b)),e.config.enableTime===!0&&e.config.noCalendar===!0&&e.config.allowInput===!1&&(h===void 0||!e.timeContainer.contains(h.relatedTarget))&&setTimeout(()=>e.hourElement.select(),50)}function ni(h){return b=>{const x=e.config[`_${h}Date`]=e.parseDate(b,e.config.dateFormat),k=e.config[`_${h==="min"?"max":"min"}Date`];x!==void 0&&(e[h==="min"?"minDateHasTime":"maxDateHasTime"]=x.getHours()>0||x.getMinutes()>0||x.getSeconds()>0),e.selectedDates&&(e.selectedDates=e.selectedDates.filter(V=>ht(V)),!e.selectedDates.length&&h==="min"&&f(x),ot()),e.daysContainer&&(ai(),x!==void 0?e.currentYearElement[h]=x.getFullYear().toString():e.currentYearElement.removeAttribute(h),e.currentYearElement.disabled=!!k&&x!==void 0&&k.getFullYear()===x.getFullYear())}}function zh(){const h=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],b=Object.assign(Object.assign({},JSON.parse(JSON.stringify(n.dataset||{}))),r),x={};e.config.parseDate=b.parseDate,e.config.formatDate=b.formatDate,Object.defineProperty(e.config,"enable",{get:()=>e.config._enable,set:D=>{e.config._enable=li(D)}}),Object.defineProperty(e.config,"disable",{get:()=>e.config._disable,set:D=>{e.config._disable=li(D)}});const k=b.mode==="time";if(!b.dateFormat&&(b.enableTime||k)){const D=se.defaultConfig.dateFormat||Vt.dateFormat;x.dateFormat=b.noCalendar||k?"H:i"+(b.enableSeconds?":S":""):D+" H:i"+(b.enableSeconds?":S":"")}if(b.altInput&&(b.enableTime||k)&&!b.altFormat){const D=se.defaultConfig.altFormat||Vt.altFormat;x.altFormat=b.noCalendar||k?"h:i"+(b.enableSeconds?":S K":" K"):D+` h:i${b.enableSeconds?":S":""} K`}Object.defineProperty(e.config,"minDate",{get:()=>e.config._minDate,set:ni("min")}),Object.defineProperty(e.config,"maxDate",{get:()=>e.config._maxDate,set:ni("max")});const V=D=>M=>{e.config[D==="min"?"_minTime":"_maxTime"]=e.parseDate(M,"H:i:S")};Object.defineProperty(e.config,"minTime",{get:()=>e.config._minTime,set:V("min")}),Object.defineProperty(e.config,"maxTime",{get:()=>e.config._maxTime,set:V("max")}),b.mode==="time"&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,x,b);for(let D=0;D<h.length;D++)e.config[h[D]]=e.config[h[D]]===!0||e.config[h[D]]==="true";Tr.filter(D=>e.config[D]!==void 0).forEach(D=>{e.config[D]=Mr(e.config[D]||[]).map(s)}),e.isMobile=!e.config.disableMobile&&!e.config.inline&&e.config.mode==="single"&&!e.config.disable.length&&!e.config.enable&&!e.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(let D=0;D<e.config.plugins.length;D++){const M=e.config.plugins[D](e)||{};for(const v in M)Tr.indexOf(v)>-1?e.config[v]=Mr(M[v]).map(s).concat(e.config[v]):typeof b[v]>"u"&&(e.config[v]=M[v])}b.altInputClass||(e.config.altInputClass=ri().className+" "+e.config.altInputClass),ne("onParseConfig")}function ri(){return e.config.wrap?n.querySelector("[data-input]"):n}function oi(){typeof e.config.locale!="object"&&typeof se.l10ns[e.config.locale]>"u"&&e.config.errorHandler(new Error(`flatpickr: invalid locale ${e.config.locale}`)),e.l10n=Object.assign(Object.assign({},se.l10ns.default),typeof e.config.locale=="object"?e.config.locale:e.config.locale!=="default"?se.l10ns[e.config.locale]:void 0),Pr.K=`(${e.l10n.amPM[0]}|${e.l10n.amPM[1]}|${e.l10n.amPM[0].toLowerCase()}|${e.l10n.amPM[1].toLowerCase()})`,Object.assign(Object.assign({},r),JSON.parse(JSON.stringify(n.dataset||{}))).time_24hr===void 0&&se.defaultConfig.time_24hr===void 0&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=us(e),e.parseDate=Ar({config:e.config,l10n:e.l10n})}function Jn(h){if(typeof e.config.position=="function")return void e.config.position(e,h);if(e.calendarContainer===void 0)return;ne("onPreCalendarPosition");const b=h||e._positionElement,x=Array.prototype.reduce.call(e.calendarContainer.children,(tn,to)=>tn+to.offsetHeight,0),k=e.calendarContainer.offsetWidth,V=e.config.position.split(" "),D=V[0],M=V.length>1?V[1]:null,v=b.getBoundingClientRect(),F=window.innerHeight-v.bottom,j=D==="above"||D!=="below"&&F<x&&v.top>x,X=window.pageYOffset+v.top+(j?-x-2:b.offsetHeight+2);if(ye(e.calendarContainer,"arrowTop",!j),ye(e.calendarContainer,"arrowBottom",j),e.config.inline)return;let Re=window.pageXOffset+v.left,he=!1,Qn=!1;M==="center"?(Re-=(k-v.width)/2,he=!0):M==="right"&&(Re-=k-v.width,Qn=!0),ye(e.calendarContainer,"arrowLeft",!he&&!Qn),ye(e.calendarContainer,"arrowCenter",he),ye(e.calendarContainer,"arrowRight",Qn);const Ge=window.document.body.offsetWidth-(window.pageXOffset+v.right),Qt=Re+k>window.document.body.offsetWidth,en=Ge+k>window.document.body.offsetWidth;if(ye(e.calendarContainer,"rightMost",Qt),!e.config.static)if(e.calendarContainer.style.top=`${X}px`,!Qt)e.calendarContainer.style.left=`${Re}px`,e.calendarContainer.style.right="auto";else if(!en)e.calendarContainer.style.left="auto",e.calendarContainer.style.right=`${Ge}px`;else{const tn=qh();if(tn===void 0)return;const to=window.document.body.offsetWidth,ng=Math.max(0,to/2-k/2),rg=".flatpickr-calendar.centerMost:before",og=".flatpickr-calendar.centerMost:after",ag=tn.cssRules.length,sg=`{left:${v.left}px;right:auto;}`;ye(e.calendarContainer,"rightMost",!1),ye(e.calendarContainer,"centerMost",!0),tn.insertRule(`${rg},${og}${sg}`,ag),e.calendarContainer.style.left=`${ng}px`,e.calendarContainer.style.right="auto"}}function qh(){let h=null;for(let b=0;b<document.styleSheets.length;b++){const x=document.styleSheets[b];try{x.cssRules}catch{continue}h=x;break}return h??Wh()}function Wh(){const h=document.createElement("style");return document.head.appendChild(h),h.sheet}function ai(){e.config.noCalendar||e.isMobile||(J(),Zn(),G())}function Zr(){e._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(e.close,0):e.close()}function si(h){h.preventDefault(),h.stopPropagation();const b=M=>M.classList&&M.classList.contains("flatpickr-day")&&!M.classList.contains("flatpickr-disabled")&&!M.classList.contains("notAllowed"),x=ds(ve(h),b);if(x===void 0)return;const k=x,V=e.latestSelectedDateObj=new Date(k.dateObj.getTime()),D=(V.getMonth()<e.currentMonth||V.getMonth()>e.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";if(e.selectedDateElem=k,e.config.mode==="single")e.selectedDates=[V];else if(e.config.mode==="multiple"){const M=eo(V);M?e.selectedDates.splice(parseInt(M),1):e.selectedDates.push(V)}else e.config.mode==="range"&&(e.selectedDates.length===2&&e.clear(!1,!1),e.latestSelectedDateObj=V,e.selectedDates.push(V),Te(V,e.selectedDates[0],!0)!==0&&e.selectedDates.sort((M,v)=>M.getTime()-v.getTime()));if(u(),D){const M=e.currentYear!==V.getFullYear();e.currentYear=V.getFullYear(),e.currentMonth=V.getMonth(),M&&(ne("onYearChange"),J()),ne("onMonthChange")}if(Zn(),G(),ot(),!D&&e.config.mode!=="range"&&e.config.showMonths===1?H(k):e.selectedDateElem!==void 0&&e.hourElement===void 0&&e.selectedDateElem&&e.selectedDateElem.focus(),e.hourElement!==void 0&&e.hourElement!==void 0&&e.hourElement.focus(),e.config.closeOnSelect){const M=e.config.mode==="single"&&!e.config.enableTime,v=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;(M||v)&&Zr()}y()}const Xn={locale:[oi,de],showMonths:[Me,i,A],minDate:[E],maxDate:[E],clickOpens:[()=>{e.config.clickOpens===!0?(m(e._input,"focus",e.open),m(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function Yh(h,b){if(h!==null&&typeof h=="object"){Object.assign(e.config,h);for(const x in h)Xn[x]!==void 0&&Xn[x].forEach(k=>k())}else e.config[h]=b,Xn[h]!==void 0?Xn[h].forEach(x=>x()):Tr.indexOf(h)>-1&&(e.config[h]=Mr(b));e.redraw(),ot(!0)}function ii(h,b){let x=[];if(h instanceof Array)x=h.map(k=>e.parseDate(k,b));else if(h instanceof Date||typeof h=="number")x=[e.parseDate(h,b)];else if(typeof h=="string")switch(e.config.mode){case"single":case"time":x=[e.parseDate(h,b)];break;case"multiple":x=h.split(e.config.conjunction).map(k=>e.parseDate(k,b));break;case"range":x=h.split(e.l10n.rangeSeparator).map(k=>e.parseDate(k,b));break}else e.config.errorHandler(new Error(`Invalid date supplied: ${JSON.stringify(h)}`));e.selectedDates=e.config.allowInvalidPreload?x:x.filter(k=>k instanceof Date&&ht(k,!1)),e.config.mode==="range"&&e.selectedDates.sort((k,V)=>k.getTime()-V.getTime())}function Kh(h,b=!1,x=e.config.dateFormat){if(h!==0&&!h||h instanceof Array&&h.length===0)return e.clear(b);ii(h,x),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),E(void 0,b),f(),e.selectedDates.length===0&&e.clear(!1),ot(b),b&&ne("onChange")}function li(h){return h.slice().map(b=>typeof b=="string"||typeof b=="number"||b instanceof Date?e.parseDate(b,void 0,!0):b&&typeof b=="object"&&b.from&&b.to?{from:e.parseDate(b.from,void 0),to:e.parseDate(b.to,void 0)}:b).filter(b=>b)}function Gh(){e.selectedDates=[],e.now=e.parseDate(e.config.now)||new Date;const h=e.config.defaultDate||((e.input.nodeName==="INPUT"||e.input.nodeName==="TEXTAREA")&&e.input.placeholder&&e.input.value===e.input.placeholder?null:e.input.value);h&&ii(h,e.config.dateFormat),e._initialDate=e.selectedDates.length>0?e.selectedDates[0]:e.config.minDate&&e.config.minDate.getTime()>e.now.getTime()?e.config.minDate:e.config.maxDate&&e.config.maxDate.getTime()<e.now.getTime()?e.config.maxDate:e.now,e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth(),e.selectedDates.length>0&&(e.latestSelectedDateObj=e.selectedDates[0]),e.config.minTime!==void 0&&(e.config.minTime=e.parseDate(e.config.minTime,"H:i")),e.config.maxTime!==void 0&&(e.config.maxTime=e.parseDate(e.config.maxTime,"H:i")),e.minDateHasTime=!!e.config.minDate&&(e.config.minDate.getHours()>0||e.config.minDate.getMinutes()>0||e.config.minDate.getSeconds()>0),e.maxDateHasTime=!!e.config.maxDate&&(e.config.maxDate.getHours()>0||e.config.maxDate.getMinutes()>0||e.config.maxDate.getSeconds()>0)}function Jh(){if(e.input=ri(),!e.input){e.config.errorHandler(new Error("Invalid input element specified"));return}e.input._type=e.input.type,e.input.type="text",e.input.classList.add("flatpickr-input"),e._input=e.input,e.config.altInput&&(e.altInput=z(e.input.nodeName,e.config.altInputClass),e._input=e.altInput,e.altInput.placeholder=e.input.placeholder,e.altInput.disabled=e.input.disabled,e.altInput.required=e.input.required,e.altInput.tabIndex=e.input.tabIndex,e.altInput.type="text",e.input.setAttribute("type","hidden"),!e.config.static&&e.input.parentNode&&e.input.parentNode.insertBefore(e.altInput,e.input.nextSibling)),e.config.allowInput||e._input.setAttribute("readonly","readonly"),e._positionElement=e.config.positionElement||e._input}function Xh(){const h=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=z("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=h,e.mobileInput.disabled=e.input.disabled,e.mobileInput.required=e.input.required,e.mobileInput.placeholder=e.input.placeholder,e.mobileFormatStr=h==="datetime-local"?"Y-m-d\\TH:i:S":h==="date"?"Y-m-d":"H:i:S",e.selectedDates.length>0&&(e.mobileInput.defaultValue=e.mobileInput.value=e.formatDate(e.selectedDates[0],e.mobileFormatStr)),e.config.minDate&&(e.mobileInput.min=e.formatDate(e.config.minDate,"Y-m-d")),e.config.maxDate&&(e.mobileInput.max=e.formatDate(e.config.maxDate,"Y-m-d")),e.input.getAttribute("step")&&(e.mobileInput.step=String(e.input.getAttribute("step"))),e.input.type="hidden",e.altInput!==void 0&&(e.altInput.type="hidden");try{e.input.parentNode&&e.input.parentNode.insertBefore(e.mobileInput,e.input.nextSibling)}catch{}m(e.mobileInput,"change",b=>{e.setDate(ve(b).value,!1,e.mobileFormatStr),ne("onChange"),ne("onClose")})}function Zh(h){if(e.isOpen===!0)return e.close();e.open(h)}function ne(h,b){if(e.config===void 0)return;const x=e.config[h];if(x!==void 0&&x.length>0)for(let k=0;x[k]&&k<x.length;k++)x[k](e.selectedDates,e.input.value,e,b);h==="onChange"&&(e.input.dispatchEvent(Qr("change")),e.input.dispatchEvent(Qr("input")))}function Qr(h){const b=document.createEvent("Event");return b.initEvent(h,!0,!0),b}function eo(h){for(let b=0;b<e.selectedDates.length;b++)if(Te(e.selectedDates[b],h)===0)return""+b;return!1}function Qh(h){return e.config.mode!=="range"||e.selectedDates.length<2?!1:Te(h,e.selectedDates[0])>=0&&Te(h,e.selectedDates[1])<=0}function Zn(){e.config.noCalendar||e.isMobile||!e.monthNav||(e.yearElements.forEach((h,b)=>{const x=new Date(e.currentYear,e.currentMonth,1);x.setMonth(e.currentMonth+b),e.config.showMonths>1||e.config.monthSelectorType==="static"?e.monthElements[b].textContent=An(x.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" ":e.monthsDropdownContainer.value=x.getMonth().toString(),h.value=x.getFullYear().toString()}),e._hidePrevMonthArrow=e.config.minDate!==void 0&&(e.currentYear===e.config.minDate.getFullYear()?e.currentMonth<=e.config.minDate.getMonth():e.currentYear<e.config.minDate.getFullYear()),e._hideNextMonthArrow=e.config.maxDate!==void 0&&(e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth+1>e.config.maxDate.getMonth():e.currentYear>e.config.maxDate.getFullYear()))}function ci(h){return e.selectedDates.map(b=>e.formatDate(b,h)).filter((b,x,k)=>e.config.mode!=="range"||e.config.enableTime||k.indexOf(b)===x).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function ot(h=!0){e.mobileInput!==void 0&&e.mobileFormatStr&&(e.mobileInput.value=e.latestSelectedDateObj!==void 0?e.formatDate(e.latestSelectedDateObj,e.mobileFormatStr):""),e.input.value=ci(e.config.dateFormat),e.altInput!==void 0&&(e.altInput.value=ci(e.config.altFormat)),h!==!1&&ne("onValueUpdate")}function eg(h){const b=ve(h),x=e.prevMonthNav.contains(b),k=e.nextMonthNav.contains(b);x||k?q(x?-1:1):e.yearElements.indexOf(b)>=0?b.select():b.classList.contains("arrowUp")?e.changeYear(e.currentYear+1):b.classList.contains("arrowDown")&&e.changeYear(e.currentYear-1)}function tg(h){h.preventDefault();const b=h.type==="keydown",x=ve(h),k=x;e.amPM!==void 0&&x===e.amPM&&(e.amPM.textContent=e.l10n.amPM[Ae(e.amPM.textContent===e.l10n.amPM[0])]);const V=parseFloat(k.getAttribute("min")),D=parseFloat(k.getAttribute("max")),M=parseFloat(k.getAttribute("step")),v=parseInt(k.value,10),F=h.delta||(b?h.which===38?1:-1:0);let j=v+M*F;if(typeof k.value<"u"&&k.value.length===2){const X=k===e.hourElement,Re=k===e.minuteElement;j<V?(j=D+j+Ae(!X)+(Ae(X)&&Ae(!e.amPM)),Re&&N(void 0,-1,e.hourElement)):j>D&&(j=k===e.hourElement?j-D-Ae(!e.amPM):V,Re&&N(void 0,1,e.hourElement)),e.amPM&&X&&(M===1?j+v===23:Math.abs(j-v)>M)&&(e.amPM.textContent=e.l10n.amPM[Ae(e.amPM.textContent===e.l10n.amPM[0])]),k.value=De(j)}}return a(),e}function $t(n,r){const e=Array.prototype.slice.call(n).filter(a=>a instanceof HTMLElement),o=[];for(let a=0;a<e.length;a++){const s=e[a];try{if(s.getAttribute("data-fp-omit")!==null)continue;s._flatpickr!==void 0&&(s._flatpickr.destroy(),s._flatpickr=void 0),s._flatpickr=sd(s,r||{}),o.push(s._flatpickr)}catch(i){console.error(i)}}return o.length===1?o[0]:o}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return $t(this,n)},HTMLElement.prototype.flatpickr=function(n){return $t([this],n)});var se=function(n,r){return typeof n=="string"?$t(window.document.querySelectorAll(n),r):n instanceof Node?$t([n],r):$t(n,r)};se.defaultConfig={},se.l10ns={en:Object.assign({},Yt),default:Object.assign({},Yt)},se.localize=n=>{se.l10ns.default=Object.assign(Object.assign({},se.l10ns.default),n)},se.setDefaults=n=>{se.defaultConfig=Object.assign(Object.assign({},se.defaultConfig),n)},se.parseDate=Ar({}),se.formatDate=us({}),se.compareDates=Te,typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return $t(this,n)}),Date.prototype.fp_incr=function(n){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof n=="string"?parseInt(n,10):n))},typeof window<"u"&&(window.flatpickr=se);const id={ref:"wrapper",class:"xy-date-range-picker"},ld=["id","aria-labelledby","aria-describedby","aria-errormessage","placeholder"],On=t.defineComponent({inheritAttrs:!1,__name:"DateRangePicker",props:t.mergeModels(t.mergeDefaults({modelValue:{},maxDate:{},maxRange:{},startDate:{},label:{},help:{},placeholder:{}},{...Le,maxDate:()=>new Date,maxRange:0,placeholder:"mm-dd-yyyy range",startDate:0}),{modelValue:{...Z,default:{maxDate:0,minDate:0}},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const r=n,e=t.useModel(n,"modelValue",{...Z,default:{maxDate:0,minDate:0}});function o(m){return(m==null?void 0:m.maxDate)!==void 0&&(m==null?void 0:m.minDate)!==void 0&&(m==null?void 0:m.minDate)!=0&&(m==null?void 0:m.maxDate)!=0}const a=t.watch(e,()=>{if(o(e.value)){g==null||g.setDate([e.value.minDate*1e3,e.value.maxDate*1e3],!1);return}g==null||g.clear()}),{aria:s,errorState:i,inputID:c,isRequired:l,onInvalid:d,validate:u}=Be(r),f=m=>{a.stop(),e.value=m,a.resume()},p=t.useTemplateRef("wrapper");let g=null;return t.onMounted(()=>{const m={allowInput:!0,appendTo:p.value||void 0,dateFormat:"m-d-Y",mode:"range",maxDate:r.maxDate,minDate:r.startDate,onClose:y=>{y.length===2?f({minDate:y[0].setUTCHours(0,0,0,0)/1e3,maxDate:Math.floor(y[1].setUTCHours(23,59,59,999)/1e3)}):y.length===0&&f({minDate:0,maxDate:0})},static:!0};o(e.value)&&(m.defaultDate=[e.value.minDate*1e3,e.value.maxDate*1e3]),r.maxRange&&(m.onChange=(y,w,E)=>{if(y.length===1){var S=new Date(y[0].getTime()),N=new Date(y[0].getTime());S.setDate(S.getDate()+r.maxRange),N.setDate(N.getDate()-r.maxRange);const P=new Date;S>P&&(S=P),E.set("minDate",N),E.set("maxDate",S)}}),g=se(`#${c.value}`,m)}),(m,y)=>(t.openBlock(),t.createElementBlock("div",id,[t.createVNode(be,{id:t.unref(s).labelledby,class:"mb-2",for:t.unref(c),label:m.label,required:t.unref(l)},null,8,["id","for","label","required"]),t.createElementVNode("input",t.mergeProps({id:t.unref(c),"aria-labelledby":t.unref(s).labelledby,"aria-describedby":t.unref(s).describedby,"aria-errormessage":t.unref(s).errormessage,class:["block w-full rounded-md border-0 py-2 shadow-sm ring-1 ring-inset focus:ring-2 sm:text-sm sm:leading-6","disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-700 disabled:ring-gray-200",t.unref(i)?"text-red-900 ring-red-700 placeholder:text-red-300 focus:ring-red-700":"text-gray-900 ring-gray-300 placeholder:text-gray-400 focus:ring-xy-blue-500"],placeholder:m.placeholder},m.$attrs,{type:"text",onInput:y[0]||(y[0]=(...w)=>t.unref(u)&&t.unref(u)(...w)),onInvalid:y[1]||(y[1]=(...w)=>t.unref(d)&&t.unref(d)(...w))}),null,16,ld),t.createVNode(ce,{id:t.unref(s).describedby,class:"mt-1",text:m.help},null,8,["id","text"]),t.createVNode($e,{id:t.unref(s).errormessage,class:"mt-0.5",text:t.unref(i)},null,8,["id","text"])],512))}}),cd=["id","aria-labelledby","aria-describedby","aria-errormessage"],dd=["textContent"],ud=["value","disabled","textContent"],Rn=t.defineComponent({inheritAttrs:!1,__name:"Select",props:t.mergeModels(t.mergeDefaults({modelValue:{},options:{},label:{},help:{},placeholder:{}},{...Le,placeholder:"Select an option"}),{modelValue:Z,modelModifiers:{}}),emits:["update:modelValue"],setup(n){const r=n,e=t.useModel(n,"modelValue",Z),{aria:o,inputID:a,isRequired:s,validate:i,errorState:c,onInvalid:l}=Be(r);return(d,u)=>(t.openBlock(),t.createElementBlock("div",null,[t.createVNode(be,{id:t.unref(o).labelledby,class:"mb-2",for:t.unref(a),label:d.label,required:t.unref(s)},null,8,["id","for","label","required"]),t.withDirectives(t.createElementVNode("select",t.mergeProps({id:t.unref(a),"onUpdate:modelValue":u[0]||(u[0]=f=>e.value=f),"aria-labelledby":t.unref(o).labelledby,"aria-describedby":t.unref(o).describedby,"aria-errormessage":t.unref(o).errormessage,class:["block w-full rounded-md border-0 py-2 shadow-sm ring-1 ring-inset focus:ring-2 sm:text-sm sm:leading-6 pl-3 pr-10","disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-700 disabled:ring-gray-200 disabled:opacity-100",t.unref(c)?"text-red-900 ring-red-700 placeholder:text-red-300 focus:ring-red-700":"text-gray-900 ring-gray-300 placeholder:text-gray-400 focus:ring-xy-blue-500"]},d.$attrs,{onChange:u[1]||(u[1]=(...f)=>t.unref(i)&&t.unref(i)(...f)),onInvalid:u[2]||(u[2]=(...f)=>t.unref(l)&&t.unref(l)(...f))}),[t.createElementVNode("option",{value:"",disabled:"",selected:"",textContent:t.toDisplayString(d.placeholder)},null,8,dd),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.options,f=>(t.openBlock(),t.createElementBlock("option",{key:f.value,value:f.value,disabled:f.disabled,textContent:t.toDisplayString(f.label)},null,8,ud))),128))],16,cd),[[t.vModelSelect,e.value]]),t.createVNode(ce,{id:t.unref(o).describedby,class:"mt-1",text:d.help},null,8,["id","text"]),t.createVNode($e,{id:t.unref(o).errormessage,class:"mt-0.5",text:t.unref(c)},null,8,["id","text"])]))}}),Rr=t.defineComponent({__name:"DateFilter",props:{dateRange:{},sortDir:{}},emits:["sort-dir-changed","date-range-changed"],setup(n,{emit:r}){const e=n,o=t.ref(e.dateRange),a=t.ref(e.sortDir),s=[{label:"Newest-Oldest",value:"desc"},{label:"Oldest-Newest",value:"asc"}],i=r,c=d=>{(d==="asc"||d==="desc")&&i("sort-dir-changed",d)},l=d=>{d&&i("date-range-changed",d)};return(d,u)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(Rn,{modelValue:a.value,"onUpdate:modelValue":[u[0]||(u[0]=f=>a.value=f),c],options:s},null,8,["modelValue"]),t.createVNode(On,{modelValue:o.value,"onUpdate:modelValue":[u[1]||(u[1]=f=>o.value=f),l],class:"ml-3"},null,8,["modelValue"])],64))}});function vt(n,r="GET",e={}){const o=t.ref(),a=t.shallowRef(),s=t.ref(!1),i=t.ref(!1),c=t.ref(!1),l=t.ref(!1);let d=0,u;const f=()=>{u!==void 0&&u.abort()},p=(g={},m={})=>{d++;const y=d;u=new AbortController,l.value=!1,i.value=!1,c.value=!0;const w={data:["PATCH","patch","POST","post","PUT","put"].includes(r)?g:{},method:r,params:["GET","get"].includes(r)?g:{},signal:u.signal,url:n};return wt(w,{...e,...m}).then(E=>(o.value=E,a.value=void 0,l.value=!1,E),E=>{throw a.value=E,Yo(E)&&(l.value=!0),E}).finally(()=>{y==d&&(i.value=!0,c.value=!1),s.value=!0})};return e!=null&&e.immediate&&e.immediate===!0&&p(),{result:o,error:a,isFinished:i,isLoading:c,isAborted:l,hasFetched:s,abort:f,execute:p}}function fd(n,r={}){return vt(n,"GET",r)}function pd(n,r={}){return vt(n,"DELETE",r)}function md(n,r={}){return vt(n,"PATCH",r)}function hd(n,r={}){return vt(n,"POST",r)}function gd(n,r={}){return vt(n,"PUT",r)}const fs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",bd={CreateIdAttribute:(n=8)=>{let r="";for(let e=0;e<n;e++)r+=fs.charAt(Math.floor(Math.random()*fs.length));return r}};function ps(n={}){const r=t.ref(new Map);let e={removeDelay:1e4,email:""};const o=p=>{e={...e,...p}},a=p=>{r.value.delete(p)},s=p=>{const g=bd.CreateIdAttribute();return r.value.set(g,p),(p.persistent===void 0||!p.persistent)&&setTimeout(()=>a(g),e.removeDelay),g},i=p=>s(p),c=(p,g=!1)=>s({message:p,persistent:g,type:"error"}),l=(p,g=!1)=>s({message:p,persistent:g,type:"info"}),d=(p,g=!1)=>s({message:p,persistent:g,type:"success"}),u=(p,g=!1)=>s({message:p,persistent:g,type:"warning"}),f=(p="",g=!1)=>{const m=p||e.email,y=m?`Whoops! Something went wrong, please reach out to
|
|
14
|
+
`}function mt(){e.calendarContainer.classList.add("hasWeeks");const h=z("div","flatpickr-weekwrapper");h.appendChild(z("span","flatpickr-weekday",e.l10n.weekAbbreviation));const b=z("div","flatpickr-weeks");return h.appendChild(b),{weekWrapper:h,weekNumbers:b}}function q(h,b=!0){const x=b?h:h-e.currentMonth;x<0&&e._hidePrevMonthArrow===!0||x>0&&e._hideNextMonthArrow===!0||(e.currentMonth+=x,(e.currentMonth<0||e.currentMonth>11)&&(e.currentYear+=e.currentMonth>11?1:-1,e.currentMonth=(e.currentMonth+12)%12,ne("onYearChange"),J()),G(),ne("onMonthChange"),Zn())}function Ne(h=!0,b=!0){if(e.input.value="",e.altInput!==void 0&&(e.altInput.value=""),e.mobileInput!==void 0&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,b===!0&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),e.config.enableTime===!0){const{hours:x,minutes:k,seconds:V}=Or(e.config);p(x,k,V)}e.redraw(),h&&ne("onChange")}function Oe(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),ne("onClose")}function nt(){e.config!==void 0&&ne("onDestroy");for(let h=e._handlers.length;h--;)e._handlers[h].remove();if(e._handlers=[],e.mobileInput)e.mobileInput.parentNode&&e.mobileInput.parentNode.removeChild(e.mobileInput),e.mobileInput=void 0;else if(e.calendarContainer&&e.calendarContainer.parentNode)if(e.config.static&&e.calendarContainer.parentNode){const h=e.calendarContainer.parentNode;if(h.lastChild&&h.removeChild(h.lastChild),h.parentNode){for(;h.firstChild;)h.parentNode.insertBefore(h.firstChild,h);h.parentNode.removeChild(h)}}else e.calendarContainer.parentNode.removeChild(e.calendarContainer);e.altInput&&(e.input.type="text",e.altInput.parentNode&&e.altInput.parentNode.removeChild(e.altInput),delete e.altInput),e.input&&(e.input.type=e.input._type,e.input.classList.remove("flatpickr-input"),e.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(h=>{try{delete e[h]}catch{}})}function oe(h){return e.config.appendTo&&e.config.appendTo.contains(h)?!0:e.calendarContainer.contains(h)}function rt(h){if(e.isOpen&&!e.config.inline){const b=ve(h),x=oe(b),k=b===e.input||b===e.altInput||e.element.contains(b)||h.path&&h.path.indexOf&&(~h.path.indexOf(e.input)||~h.path.indexOf(e.altInput)),V=h.type==="blur"?k&&h.relatedTarget&&!oe(h.relatedTarget):!k&&!x&&!oe(h.relatedTarget),D=!e.config.ignoredFocusElements.some(M=>M.contains(b));V&&D&&(e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0&&e.input.value!==""&&e.input.value!==void 0&&c(),e.close(),e.config&&e.config.mode==="range"&&e.selectedDates.length===1&&(e.clear(!1),e.redraw()))}}function Kn(h){if(!h||e.config.minDate&&h<e.config.minDate.getFullYear()||e.config.maxDate&&h>e.config.maxDate.getFullYear())return;const b=h,x=e.currentYear!==b;e.currentYear=b||e.currentYear,e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth=Math.min(e.config.maxDate.getMonth(),e.currentMonth):e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()&&(e.currentMonth=Math.max(e.config.minDate.getMonth(),e.currentMonth)),x&&(e.redraw(),ne("onYearChange"),J())}function ht(h,b=!0){var x;const k=e.parseDate(h,void 0,b);if(e.config.minDate&&k&&Te(k,e.config.minDate,b!==void 0?b:!e.minDateHasTime)<0||e.config.maxDate&&k&&Te(k,e.config.maxDate,b!==void 0?b:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(k===void 0)return!1;const V=!!e.config.enable,D=(x=e.config.enable)!==null&&x!==void 0?x:e.config.disable;for(let M=0,v;M<D.length;M++){if(v=D[M],typeof v=="function"&&v(k))return V;if(v instanceof Date&&k!==void 0&&v.getTime()===k.getTime())return V;if(typeof v=="string"){const F=e.parseDate(v,void 0,!0);return F&&F.getTime()===k.getTime()?V:!V}else if(typeof v=="object"&&k!==void 0&&v.from&&v.to&&k.getTime()>=v.from.getTime()&&k.getTime()<=v.to.getTime())return V}return!V}function Gn(h){return e.daysContainer!==void 0?h.className.indexOf("hidden")===-1&&h.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(h):!1}function Fh(h){h.target===e._input&&(e.selectedDates.length>0||e._input.value.length>0)&&!(h.relatedTarget&&oe(h.relatedTarget))&&e.setDate(e._input.value,!0,h.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function jh(h){const b=ve(h),x=e.config.wrap?n.contains(b):b===e._input,k=e.config.allowInput,V=e.isOpen&&(!k||!x),D=e.config.inline&&x&&!k;if(h.keyCode===13&&x){if(k)return e.setDate(e._input.value,!0,b===e.altInput?e.config.altFormat:e.config.dateFormat),b.blur();e.open()}else if(oe(b)||V||D){const M=!!e.timeContainer&&e.timeContainer.contains(b);switch(h.keyCode){case 13:M?(h.preventDefault(),c(),Zr()):si(h);break;case 27:h.preventDefault(),Zr();break;case 8:case 46:x&&!e.config.allowInput&&(h.preventDefault(),e.clear());break;case 37:case 39:if(!M&&!x){if(h.preventDefault(),e.daysContainer!==void 0&&(k===!1||document.activeElement&&Gn(document.activeElement))){const F=h.keyCode===39?1:-1;h.ctrlKey?(h.stopPropagation(),q(F),L(T(1),0)):L(void 0,F)}}else e.hourElement&&e.hourElement.focus();break;case 38:case 40:h.preventDefault();const v=h.keyCode===40?1:-1;e.daysContainer&&b.$i!==void 0||b===e.input||b===e.altInput?h.ctrlKey?(h.stopPropagation(),Kn(e.currentYear-v),L(T(1),0)):M||L(void 0,v*7):b===e.currentYearElement?Kn(e.currentYear-v):e.config.enableTime&&(!M&&e.hourElement&&e.hourElement.focus(),c(h),e._debouncedChange());break;case 9:if(M){const F=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter(X=>X),j=F.indexOf(b);if(j!==-1){const X=F[j+(h.shiftKey?-1:1)];h.preventDefault(),(X||e._input).focus()}}else!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(b)&&h.shiftKey&&(h.preventDefault(),e._input.focus());break}}if(e.amPM!==void 0&&b===e.amPM)switch(h.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0],u(),ot();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],u(),ot();break}(x||oe(b))&&ne("onKeyDown",h)}function Xr(h){if(e.selectedDates.length!==1||h&&(!h.classList.contains("flatpickr-day")||h.classList.contains("flatpickr-disabled")))return;const b=h?h.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),x=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),k=Math.min(b,e.selectedDates[0].getTime()),V=Math.max(b,e.selectedDates[0].getTime());let D=!1,M=0,v=0;for(let F=k;F<V;F+=od.DAY)ht(new Date(F),!0)||(D=D||F>k&&F<V,F<x&&(!M||F>M)?M=F:F>x&&(!v||F<v)&&(v=F));for(let F=0;F<e.config.showMonths;F++){const j=e.daysContainer.children[F];for(let X=0,Re=j.children.length;X<Re;X++){const he=j.children[X],Ge=he.dateObj.getTime(),Qt=M>0&&Ge<M||v>0&&Ge>v;if(Qt){he.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(en=>{he.classList.remove(en)});continue}else if(D&&!Qt)continue;["startRange","inRange","endRange","notAllowed"].forEach(en=>{he.classList.remove(en)}),h!==void 0&&(h.classList.add(b<=e.selectedDates[0].getTime()?"startRange":"endRange"),x<b&&Ge===x?he.classList.add("startRange"):x>b&&Ge===x&&he.classList.add("endRange"),Ge>=M&&(v===0||Ge<=v)&&rd(Ge,x,b)&&he.classList.add("inRange"))}}}function Hh(){e.isOpen&&!e.config.static&&!e.config.inline&&Jn()}function Uh(h,b=e._positionElement){if(e.isMobile===!0){if(h){h.preventDefault();const k=ve(h);k&&k.blur()}e.mobileInput!==void 0&&(e.mobileInput.focus(),e.mobileInput.click()),ne("onOpen");return}else if(e._input.disabled||e.config.inline)return;const x=e.isOpen;e.isOpen=!0,x||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),ne("onOpen"),Jn(b)),e.config.enableTime===!0&&e.config.noCalendar===!0&&e.config.allowInput===!1&&(h===void 0||!e.timeContainer.contains(h.relatedTarget))&&setTimeout(()=>e.hourElement.select(),50)}function ni(h){return b=>{const x=e.config[`_${h}Date`]=e.parseDate(b,e.config.dateFormat),k=e.config[`_${h==="min"?"max":"min"}Date`];x!==void 0&&(e[h==="min"?"minDateHasTime":"maxDateHasTime"]=x.getHours()>0||x.getMinutes()>0||x.getSeconds()>0),e.selectedDates&&(e.selectedDates=e.selectedDates.filter(V=>ht(V)),!e.selectedDates.length&&h==="min"&&f(x),ot()),e.daysContainer&&(ai(),x!==void 0?e.currentYearElement[h]=x.getFullYear().toString():e.currentYearElement.removeAttribute(h),e.currentYearElement.disabled=!!k&&x!==void 0&&k.getFullYear()===x.getFullYear())}}function zh(){const h=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],b=Object.assign(Object.assign({},JSON.parse(JSON.stringify(n.dataset||{}))),r),x={};e.config.parseDate=b.parseDate,e.config.formatDate=b.formatDate,Object.defineProperty(e.config,"enable",{get:()=>e.config._enable,set:D=>{e.config._enable=li(D)}}),Object.defineProperty(e.config,"disable",{get:()=>e.config._disable,set:D=>{e.config._disable=li(D)}});const k=b.mode==="time";if(!b.dateFormat&&(b.enableTime||k)){const D=se.defaultConfig.dateFormat||Vt.dateFormat;x.dateFormat=b.noCalendar||k?"H:i"+(b.enableSeconds?":S":""):D+" H:i"+(b.enableSeconds?":S":"")}if(b.altInput&&(b.enableTime||k)&&!b.altFormat){const D=se.defaultConfig.altFormat||Vt.altFormat;x.altFormat=b.noCalendar||k?"h:i"+(b.enableSeconds?":S K":" K"):D+` h:i${b.enableSeconds?":S":""} K`}Object.defineProperty(e.config,"minDate",{get:()=>e.config._minDate,set:ni("min")}),Object.defineProperty(e.config,"maxDate",{get:()=>e.config._maxDate,set:ni("max")});const V=D=>M=>{e.config[D==="min"?"_minTime":"_maxTime"]=e.parseDate(M,"H:i:S")};Object.defineProperty(e.config,"minTime",{get:()=>e.config._minTime,set:V("min")}),Object.defineProperty(e.config,"maxTime",{get:()=>e.config._maxTime,set:V("max")}),b.mode==="time"&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,x,b);for(let D=0;D<h.length;D++)e.config[h[D]]=e.config[h[D]]===!0||e.config[h[D]]==="true";Tr.filter(D=>e.config[D]!==void 0).forEach(D=>{e.config[D]=Mr(e.config[D]||[]).map(s)}),e.isMobile=!e.config.disableMobile&&!e.config.inline&&e.config.mode==="single"&&!e.config.disable.length&&!e.config.enable&&!e.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(let D=0;D<e.config.plugins.length;D++){const M=e.config.plugins[D](e)||{};for(const v in M)Tr.indexOf(v)>-1?e.config[v]=Mr(M[v]).map(s).concat(e.config[v]):typeof b[v]>"u"&&(e.config[v]=M[v])}b.altInputClass||(e.config.altInputClass=ri().className+" "+e.config.altInputClass),ne("onParseConfig")}function ri(){return e.config.wrap?n.querySelector("[data-input]"):n}function oi(){typeof e.config.locale!="object"&&typeof se.l10ns[e.config.locale]>"u"&&e.config.errorHandler(new Error(`flatpickr: invalid locale ${e.config.locale}`)),e.l10n=Object.assign(Object.assign({},se.l10ns.default),typeof e.config.locale=="object"?e.config.locale:e.config.locale!=="default"?se.l10ns[e.config.locale]:void 0),Pr.K=`(${e.l10n.amPM[0]}|${e.l10n.amPM[1]}|${e.l10n.amPM[0].toLowerCase()}|${e.l10n.amPM[1].toLowerCase()})`,Object.assign(Object.assign({},r),JSON.parse(JSON.stringify(n.dataset||{}))).time_24hr===void 0&&se.defaultConfig.time_24hr===void 0&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=us(e),e.parseDate=Ar({config:e.config,l10n:e.l10n})}function Jn(h){if(typeof e.config.position=="function")return void e.config.position(e,h);if(e.calendarContainer===void 0)return;ne("onPreCalendarPosition");const b=h||e._positionElement,x=Array.prototype.reduce.call(e.calendarContainer.children,(tn,to)=>tn+to.offsetHeight,0),k=e.calendarContainer.offsetWidth,V=e.config.position.split(" "),D=V[0],M=V.length>1?V[1]:null,v=b.getBoundingClientRect(),F=window.innerHeight-v.bottom,j=D==="above"||D!=="below"&&F<x&&v.top>x,X=window.pageYOffset+v.top+(j?-x-2:b.offsetHeight+2);if(ye(e.calendarContainer,"arrowTop",!j),ye(e.calendarContainer,"arrowBottom",j),e.config.inline)return;let Re=window.pageXOffset+v.left,he=!1,Qn=!1;M==="center"?(Re-=(k-v.width)/2,he=!0):M==="right"&&(Re-=k-v.width,Qn=!0),ye(e.calendarContainer,"arrowLeft",!he&&!Qn),ye(e.calendarContainer,"arrowCenter",he),ye(e.calendarContainer,"arrowRight",Qn);const Ge=window.document.body.offsetWidth-(window.pageXOffset+v.right),Qt=Re+k>window.document.body.offsetWidth,en=Ge+k>window.document.body.offsetWidth;if(ye(e.calendarContainer,"rightMost",Qt),!e.config.static)if(e.calendarContainer.style.top=`${X}px`,!Qt)e.calendarContainer.style.left=`${Re}px`,e.calendarContainer.style.right="auto";else if(!en)e.calendarContainer.style.left="auto",e.calendarContainer.style.right=`${Ge}px`;else{const tn=qh();if(tn===void 0)return;const to=window.document.body.offsetWidth,ng=Math.max(0,to/2-k/2),rg=".flatpickr-calendar.centerMost:before",og=".flatpickr-calendar.centerMost:after",ag=tn.cssRules.length,sg=`{left:${v.left}px;right:auto;}`;ye(e.calendarContainer,"rightMost",!1),ye(e.calendarContainer,"centerMost",!0),tn.insertRule(`${rg},${og}${sg}`,ag),e.calendarContainer.style.left=`${ng}px`,e.calendarContainer.style.right="auto"}}function qh(){let h=null;for(let b=0;b<document.styleSheets.length;b++){const x=document.styleSheets[b];try{x.cssRules}catch{continue}h=x;break}return h??Wh()}function Wh(){const h=document.createElement("style");return document.head.appendChild(h),h.sheet}function ai(){e.config.noCalendar||e.isMobile||(J(),Zn(),G())}function Zr(){e._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(e.close,0):e.close()}function si(h){h.preventDefault(),h.stopPropagation();const b=M=>M.classList&&M.classList.contains("flatpickr-day")&&!M.classList.contains("flatpickr-disabled")&&!M.classList.contains("notAllowed"),x=ds(ve(h),b);if(x===void 0)return;const k=x,V=e.latestSelectedDateObj=new Date(k.dateObj.getTime()),D=(V.getMonth()<e.currentMonth||V.getMonth()>e.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";if(e.selectedDateElem=k,e.config.mode==="single")e.selectedDates=[V];else if(e.config.mode==="multiple"){const M=eo(V);M?e.selectedDates.splice(parseInt(M),1):e.selectedDates.push(V)}else e.config.mode==="range"&&(e.selectedDates.length===2&&e.clear(!1,!1),e.latestSelectedDateObj=V,e.selectedDates.push(V),Te(V,e.selectedDates[0],!0)!==0&&e.selectedDates.sort((M,v)=>M.getTime()-v.getTime()));if(u(),D){const M=e.currentYear!==V.getFullYear();e.currentYear=V.getFullYear(),e.currentMonth=V.getMonth(),M&&(ne("onYearChange"),J()),ne("onMonthChange")}if(Zn(),G(),ot(),!D&&e.config.mode!=="range"&&e.config.showMonths===1?H(k):e.selectedDateElem!==void 0&&e.hourElement===void 0&&e.selectedDateElem&&e.selectedDateElem.focus(),e.hourElement!==void 0&&e.hourElement!==void 0&&e.hourElement.focus(),e.config.closeOnSelect){const M=e.config.mode==="single"&&!e.config.enableTime,v=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;(M||v)&&Zr()}y()}const Xn={locale:[oi,de],showMonths:[Me,i,A],minDate:[E],maxDate:[E],clickOpens:[()=>{e.config.clickOpens===!0?(m(e._input,"focus",e.open),m(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function Yh(h,b){if(h!==null&&typeof h=="object"){Object.assign(e.config,h);for(const x in h)Xn[x]!==void 0&&Xn[x].forEach(k=>k())}else e.config[h]=b,Xn[h]!==void 0?Xn[h].forEach(x=>x()):Tr.indexOf(h)>-1&&(e.config[h]=Mr(b));e.redraw(),ot(!0)}function ii(h,b){let x=[];if(h instanceof Array)x=h.map(k=>e.parseDate(k,b));else if(h instanceof Date||typeof h=="number")x=[e.parseDate(h,b)];else if(typeof h=="string")switch(e.config.mode){case"single":case"time":x=[e.parseDate(h,b)];break;case"multiple":x=h.split(e.config.conjunction).map(k=>e.parseDate(k,b));break;case"range":x=h.split(e.l10n.rangeSeparator).map(k=>e.parseDate(k,b));break}else e.config.errorHandler(new Error(`Invalid date supplied: ${JSON.stringify(h)}`));e.selectedDates=e.config.allowInvalidPreload?x:x.filter(k=>k instanceof Date&&ht(k,!1)),e.config.mode==="range"&&e.selectedDates.sort((k,V)=>k.getTime()-V.getTime())}function Kh(h,b=!1,x=e.config.dateFormat){if(h!==0&&!h||h instanceof Array&&h.length===0)return e.clear(b);ii(h,x),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),E(void 0,b),f(),e.selectedDates.length===0&&e.clear(!1),ot(b),b&&ne("onChange")}function li(h){return h.slice().map(b=>typeof b=="string"||typeof b=="number"||b instanceof Date?e.parseDate(b,void 0,!0):b&&typeof b=="object"&&b.from&&b.to?{from:e.parseDate(b.from,void 0),to:e.parseDate(b.to,void 0)}:b).filter(b=>b)}function Gh(){e.selectedDates=[],e.now=e.parseDate(e.config.now)||new Date;const h=e.config.defaultDate||((e.input.nodeName==="INPUT"||e.input.nodeName==="TEXTAREA")&&e.input.placeholder&&e.input.value===e.input.placeholder?null:e.input.value);h&&ii(h,e.config.dateFormat),e._initialDate=e.selectedDates.length>0?e.selectedDates[0]:e.config.minDate&&e.config.minDate.getTime()>e.now.getTime()?e.config.minDate:e.config.maxDate&&e.config.maxDate.getTime()<e.now.getTime()?e.config.maxDate:e.now,e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth(),e.selectedDates.length>0&&(e.latestSelectedDateObj=e.selectedDates[0]),e.config.minTime!==void 0&&(e.config.minTime=e.parseDate(e.config.minTime,"H:i")),e.config.maxTime!==void 0&&(e.config.maxTime=e.parseDate(e.config.maxTime,"H:i")),e.minDateHasTime=!!e.config.minDate&&(e.config.minDate.getHours()>0||e.config.minDate.getMinutes()>0||e.config.minDate.getSeconds()>0),e.maxDateHasTime=!!e.config.maxDate&&(e.config.maxDate.getHours()>0||e.config.maxDate.getMinutes()>0||e.config.maxDate.getSeconds()>0)}function Jh(){if(e.input=ri(),!e.input){e.config.errorHandler(new Error("Invalid input element specified"));return}e.input._type=e.input.type,e.input.type="text",e.input.classList.add("flatpickr-input"),e._input=e.input,e.config.altInput&&(e.altInput=z(e.input.nodeName,e.config.altInputClass),e._input=e.altInput,e.altInput.placeholder=e.input.placeholder,e.altInput.disabled=e.input.disabled,e.altInput.required=e.input.required,e.altInput.tabIndex=e.input.tabIndex,e.altInput.type="text",e.input.setAttribute("type","hidden"),!e.config.static&&e.input.parentNode&&e.input.parentNode.insertBefore(e.altInput,e.input.nextSibling)),e.config.allowInput||e._input.setAttribute("readonly","readonly"),e._positionElement=e.config.positionElement||e._input}function Xh(){const h=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=z("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=h,e.mobileInput.disabled=e.input.disabled,e.mobileInput.required=e.input.required,e.mobileInput.placeholder=e.input.placeholder,e.mobileFormatStr=h==="datetime-local"?"Y-m-d\\TH:i:S":h==="date"?"Y-m-d":"H:i:S",e.selectedDates.length>0&&(e.mobileInput.defaultValue=e.mobileInput.value=e.formatDate(e.selectedDates[0],e.mobileFormatStr)),e.config.minDate&&(e.mobileInput.min=e.formatDate(e.config.minDate,"Y-m-d")),e.config.maxDate&&(e.mobileInput.max=e.formatDate(e.config.maxDate,"Y-m-d")),e.input.getAttribute("step")&&(e.mobileInput.step=String(e.input.getAttribute("step"))),e.input.type="hidden",e.altInput!==void 0&&(e.altInput.type="hidden");try{e.input.parentNode&&e.input.parentNode.insertBefore(e.mobileInput,e.input.nextSibling)}catch{}m(e.mobileInput,"change",b=>{e.setDate(ve(b).value,!1,e.mobileFormatStr),ne("onChange"),ne("onClose")})}function Zh(h){if(e.isOpen===!0)return e.close();e.open(h)}function ne(h,b){if(e.config===void 0)return;const x=e.config[h];if(x!==void 0&&x.length>0)for(let k=0;x[k]&&k<x.length;k++)x[k](e.selectedDates,e.input.value,e,b);h==="onChange"&&(e.input.dispatchEvent(Qr("change")),e.input.dispatchEvent(Qr("input")))}function Qr(h){const b=document.createEvent("Event");return b.initEvent(h,!0,!0),b}function eo(h){for(let b=0;b<e.selectedDates.length;b++)if(Te(e.selectedDates[b],h)===0)return""+b;return!1}function Qh(h){return e.config.mode!=="range"||e.selectedDates.length<2?!1:Te(h,e.selectedDates[0])>=0&&Te(h,e.selectedDates[1])<=0}function Zn(){e.config.noCalendar||e.isMobile||!e.monthNav||(e.yearElements.forEach((h,b)=>{const x=new Date(e.currentYear,e.currentMonth,1);x.setMonth(e.currentMonth+b),e.config.showMonths>1||e.config.monthSelectorType==="static"?e.monthElements[b].textContent=An(x.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" ":e.monthsDropdownContainer.value=x.getMonth().toString(),h.value=x.getFullYear().toString()}),e._hidePrevMonthArrow=e.config.minDate!==void 0&&(e.currentYear===e.config.minDate.getFullYear()?e.currentMonth<=e.config.minDate.getMonth():e.currentYear<e.config.minDate.getFullYear()),e._hideNextMonthArrow=e.config.maxDate!==void 0&&(e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth+1>e.config.maxDate.getMonth():e.currentYear>e.config.maxDate.getFullYear()))}function ci(h){return e.selectedDates.map(b=>e.formatDate(b,h)).filter((b,x,k)=>e.config.mode!=="range"||e.config.enableTime||k.indexOf(b)===x).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function ot(h=!0){e.mobileInput!==void 0&&e.mobileFormatStr&&(e.mobileInput.value=e.latestSelectedDateObj!==void 0?e.formatDate(e.latestSelectedDateObj,e.mobileFormatStr):""),e.input.value=ci(e.config.dateFormat),e.altInput!==void 0&&(e.altInput.value=ci(e.config.altFormat)),h!==!1&&ne("onValueUpdate")}function eg(h){const b=ve(h),x=e.prevMonthNav.contains(b),k=e.nextMonthNav.contains(b);x||k?q(x?-1:1):e.yearElements.indexOf(b)>=0?b.select():b.classList.contains("arrowUp")?e.changeYear(e.currentYear+1):b.classList.contains("arrowDown")&&e.changeYear(e.currentYear-1)}function tg(h){h.preventDefault();const b=h.type==="keydown",x=ve(h),k=x;e.amPM!==void 0&&x===e.amPM&&(e.amPM.textContent=e.l10n.amPM[Ae(e.amPM.textContent===e.l10n.amPM[0])]);const V=parseFloat(k.getAttribute("min")),D=parseFloat(k.getAttribute("max")),M=parseFloat(k.getAttribute("step")),v=parseInt(k.value,10),F=h.delta||(b?h.which===38?1:-1:0);let j=v+M*F;if(typeof k.value<"u"&&k.value.length===2){const X=k===e.hourElement,Re=k===e.minuteElement;j<V?(j=D+j+Ae(!X)+(Ae(X)&&Ae(!e.amPM)),Re&&N(void 0,-1,e.hourElement)):j>D&&(j=k===e.hourElement?j-D-Ae(!e.amPM):V,Re&&N(void 0,1,e.hourElement)),e.amPM&&X&&(M===1?j+v===23:Math.abs(j-v)>M)&&(e.amPM.textContent=e.l10n.amPM[Ae(e.amPM.textContent===e.l10n.amPM[0])]),k.value=De(j)}}return a(),e}function $t(n,r){const e=Array.prototype.slice.call(n).filter(a=>a instanceof HTMLElement),o=[];for(let a=0;a<e.length;a++){const s=e[a];try{if(s.getAttribute("data-fp-omit")!==null)continue;s._flatpickr!==void 0&&(s._flatpickr.destroy(),s._flatpickr=void 0),s._flatpickr=sd(s,r||{}),o.push(s._flatpickr)}catch(i){console.error(i)}}return o.length===1?o[0]:o}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return $t(this,n)},HTMLElement.prototype.flatpickr=function(n){return $t([this],n)});var se=function(n,r){return typeof n=="string"?$t(window.document.querySelectorAll(n),r):n instanceof Node?$t([n],r):$t(n,r)};se.defaultConfig={},se.l10ns={en:Object.assign({},Yt),default:Object.assign({},Yt)},se.localize=n=>{se.l10ns.default=Object.assign(Object.assign({},se.l10ns.default),n)},se.setDefaults=n=>{se.defaultConfig=Object.assign(Object.assign({},se.defaultConfig),n)},se.parseDate=Ar({}),se.formatDate=us({}),se.compareDates=Te,typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return $t(this,n)}),Date.prototype.fp_incr=function(n){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof n=="string"?parseInt(n,10):n))},typeof window<"u"&&(window.flatpickr=se);const id={ref:"wrapper",class:"xy-date-range-picker"},ld=["id","aria-labelledby","aria-describedby","aria-errormessage","placeholder"],On=t.defineComponent({inheritAttrs:!1,__name:"DateRangePicker",props:t.mergeModels(t.mergeDefaults({modelValue:{},maxDate:{},maxRange:{},startDate:{},label:{},help:{},placeholder:{}},{...Le,maxDate:()=>new Date,maxRange:0,placeholder:"mm-dd-yyyy range",startDate:0}),{modelValue:{...Z,default:{maxDate:0,minDate:0}},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const r=n,e=t.useModel(n,"modelValue",{...Z,default:{maxDate:0,minDate:0}});function o(m){return(m==null?void 0:m.maxDate)!==void 0&&(m==null?void 0:m.minDate)!==void 0&&(m==null?void 0:m.minDate)!=0&&(m==null?void 0:m.maxDate)!=0}const a=t.watch(e,()=>{if(o(e.value)){g==null||g.setDate([e.value.minDate*1e3,e.value.maxDate*1e3],!1);return}g==null||g.clear()}),{aria:s,errorState:i,inputID:c,isRequired:l,onInvalid:d,validate:u}=Be(r),f=m=>{a.pause(),e.value=m,a.resume()},p=t.useTemplateRef("wrapper");let g=null;return t.onMounted(()=>{const m={allowInput:!r.maxRange,appendTo:p.value||void 0,dateFormat:"m-d-Y",mode:"range",maxDate:r.maxDate,minDate:r.startDate,onClose:y=>{y.length===2?f({minDate:y[0].setUTCHours(0,0,0,0)/1e3,maxDate:Math.floor(y[1].setUTCHours(23,59,59,999)/1e3)}):y.length===0&&f({minDate:0,maxDate:0})},static:!0};o(e.value)&&(m.defaultDate=[e.value.minDate*1e3,e.value.maxDate*1e3]),r.maxRange&&(m.onChange=(y,w,E)=>{if(y.length===1){var S=new Date(y[0].getTime()),N=new Date(y[0].getTime());S.setDate(S.getDate()+r.maxRange),N.setDate(N.getDate()-r.maxRange);const P=new Date;S>P&&(S=P),E.set("minDate",N),E.set("maxDate",S)}}),g=se(`#${c.value}`,m)}),(m,y)=>(t.openBlock(),t.createElementBlock("div",id,[t.createVNode(be,{id:t.unref(s).labelledby,class:"mb-2",for:t.unref(c),label:m.label,required:t.unref(l)},null,8,["id","for","label","required"]),t.createElementVNode("input",t.mergeProps({id:t.unref(c),"aria-labelledby":t.unref(s).labelledby,"aria-describedby":t.unref(s).describedby,"aria-errormessage":t.unref(s).errormessage,class:["block w-full rounded-md border-0 py-2 shadow-sm ring-1 ring-inset focus:ring-2 sm:text-sm sm:leading-6","disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-700 disabled:ring-gray-200",t.unref(i)?"text-red-900 ring-red-700 placeholder:text-red-300 focus:ring-red-700":"text-gray-900 ring-gray-300 placeholder:text-gray-400 focus:ring-xy-blue-500"],placeholder:m.placeholder},m.$attrs,{type:"text",onInput:y[0]||(y[0]=(...w)=>t.unref(u)&&t.unref(u)(...w)),onInvalid:y[1]||(y[1]=(...w)=>t.unref(d)&&t.unref(d)(...w))}),null,16,ld),t.createVNode(ce,{id:t.unref(s).describedby,class:"mt-1",text:m.help},null,8,["id","text"]),t.createVNode($e,{id:t.unref(s).errormessage,class:"mt-0.5",text:t.unref(i)},null,8,["id","text"])],512))}}),cd=["id","aria-labelledby","aria-describedby","aria-errormessage"],dd=["textContent"],ud=["value","disabled","textContent"],Rn=t.defineComponent({inheritAttrs:!1,__name:"Select",props:t.mergeModels(t.mergeDefaults({modelValue:{},options:{},label:{},help:{},placeholder:{}},{...Le,placeholder:"Select an option"}),{modelValue:Z,modelModifiers:{}}),emits:["update:modelValue"],setup(n){const r=n,e=t.useModel(n,"modelValue",Z),{aria:o,inputID:a,isRequired:s,validate:i,errorState:c,onInvalid:l}=Be(r);return(d,u)=>(t.openBlock(),t.createElementBlock("div",null,[t.createVNode(be,{id:t.unref(o).labelledby,class:"mb-2",for:t.unref(a),label:d.label,required:t.unref(s)},null,8,["id","for","label","required"]),t.withDirectives(t.createElementVNode("select",t.mergeProps({id:t.unref(a),"onUpdate:modelValue":u[0]||(u[0]=f=>e.value=f),"aria-labelledby":t.unref(o).labelledby,"aria-describedby":t.unref(o).describedby,"aria-errormessage":t.unref(o).errormessage,class:["block w-full rounded-md border-0 py-2 shadow-sm ring-1 ring-inset focus:ring-2 sm:text-sm sm:leading-6 pl-3 pr-10","disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-700 disabled:ring-gray-200 disabled:opacity-100",t.unref(c)?"text-red-900 ring-red-700 placeholder:text-red-300 focus:ring-red-700":"text-gray-900 ring-gray-300 placeholder:text-gray-400 focus:ring-xy-blue-500"]},d.$attrs,{onChange:u[1]||(u[1]=(...f)=>t.unref(i)&&t.unref(i)(...f)),onInvalid:u[2]||(u[2]=(...f)=>t.unref(l)&&t.unref(l)(...f))}),[t.createElementVNode("option",{value:"",disabled:"",selected:"",textContent:t.toDisplayString(d.placeholder)},null,8,dd),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.options,f=>(t.openBlock(),t.createElementBlock("option",{key:f.value,value:f.value,disabled:f.disabled,textContent:t.toDisplayString(f.label)},null,8,ud))),128))],16,cd),[[t.vModelSelect,e.value]]),t.createVNode(ce,{id:t.unref(o).describedby,class:"mt-1",text:d.help},null,8,["id","text"]),t.createVNode($e,{id:t.unref(o).errormessage,class:"mt-0.5",text:t.unref(c)},null,8,["id","text"])]))}}),Rr=t.defineComponent({__name:"DateFilter",props:{dateRange:{},sortDir:{}},emits:["sort-dir-changed","date-range-changed"],setup(n,{emit:r}){const e=n,o=t.ref(e.dateRange),a=t.ref(e.sortDir),s=[{label:"Newest-Oldest",value:"desc"},{label:"Oldest-Newest",value:"asc"}],i=r,c=d=>{(d==="asc"||d==="desc")&&i("sort-dir-changed",d)},l=d=>{d&&i("date-range-changed",d)};return(d,u)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(Rn,{modelValue:a.value,"onUpdate:modelValue":[u[0]||(u[0]=f=>a.value=f),c],options:s},null,8,["modelValue"]),t.createVNode(On,{modelValue:o.value,"onUpdate:modelValue":[u[1]||(u[1]=f=>o.value=f),l],class:"ml-3"},null,8,["modelValue"])],64))}});function vt(n,r="GET",e={}){const o=t.ref(),a=t.shallowRef(),s=t.ref(!1),i=t.ref(!1),c=t.ref(!1),l=t.ref(!1);let d=0,u;const f=()=>{u!==void 0&&u.abort()},p=(g={},m={})=>{d++;const y=d;u=new AbortController,l.value=!1,i.value=!1,c.value=!0;const w={data:["PATCH","patch","POST","post","PUT","put"].includes(r)?g:{},method:r,params:["GET","get"].includes(r)?g:{},signal:u.signal,url:n};return wt(w,{...e,...m}).then(E=>(o.value=E,a.value=void 0,l.value=!1,E),E=>{throw a.value=E,Yo(E)&&(l.value=!0),E}).finally(()=>{y==d&&(i.value=!0,c.value=!1),s.value=!0})};return e!=null&&e.immediate&&e.immediate===!0&&p(),{result:o,error:a,isFinished:i,isLoading:c,isAborted:l,hasFetched:s,abort:f,execute:p}}function fd(n,r={}){return vt(n,"GET",r)}function pd(n,r={}){return vt(n,"DELETE",r)}function md(n,r={}){return vt(n,"PATCH",r)}function hd(n,r={}){return vt(n,"POST",r)}function gd(n,r={}){return vt(n,"PUT",r)}const fs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",bd={CreateIdAttribute:(n=8)=>{let r="";for(let e=0;e<n;e++)r+=fs.charAt(Math.floor(Math.random()*fs.length));return r}};function ps(n={}){const r=t.ref(new Map);let e={removeDelay:1e4,email:""};const o=p=>{e={...e,...p}},a=p=>{r.value.delete(p)},s=p=>{const g=bd.CreateIdAttribute();return r.value.set(g,p),(p.persistent===void 0||!p.persistent)&&setTimeout(()=>a(g),e.removeDelay),g},i=p=>s(p),c=(p,g=!1)=>s({message:p,persistent:g,type:"error"}),l=(p,g=!1)=>s({message:p,persistent:g,type:"info"}),d=(p,g=!1)=>s({message:p,persistent:g,type:"success"}),u=(p,g=!1)=>s({message:p,persistent:g,type:"warning"}),f=(p="",g=!1)=>{const m=p||e.email,y=m?`Whoops! Something went wrong, please reach out to
|
|
15
15
|
<a class="underline text-xy-blue" href="mailto:${m}">${m}</a>
|
|
16
16
|
if the issue persists.`:"Whoops! Something went wrong.";return s({message:y,persistent:g,type:"error"})};return o(n||{}),{flasher:{add:s,remove:a,flash:i,error:c,warning:u,info:l,success:d,genericError:f},flashes:r,configure:o}}const yd=n=>{if(window.Flashes)for(const r of window.Flashes){if(typeof r.type>"u"){const e=r.message.split(": ");n.add({type:e[0],message:e[1]});continue}n.add(r)}};let Ir;function ft(){return Ir===void 0&&(Ir=ps()),Ir}const Lr={error(n,r){ft().flasher.error(n,r)},info(n,r){ft().flasher.info(n,r)},success(n,r){ft().flasher.success(n,r)},warning(n,r){ft().flasher.warning(n,r)},genericError(n,r){ft().flasher.genericError(n,r)}},wd=(n,r)=>{var d;const e=t.ref(n),o={initial:((d=e==null?void 0:e.value[0])==null?void 0:d.value)||"",paramName:(r==null?void 0:r.paramName)||"tab"},a=t.ref(o.initial),s=u=>!!e.value.find(f=>f.value===u),i=u=>a.value===u,l=new URLSearchParams(window.location.search).get(o.paramName);return l&&s(l)&&(a.value=l),t.watch(a,u=>{const f=new URLSearchParams(window.location.search);f.set(o.paramName,u.toString());const p=f.toString()!==""?`?${f.toString()}`:"";window.history.replaceState({tab:u},document.title,`${window.location.pathname}${p}`)}),{activeTab:a,isActiveTab:i,tabs:e}},xd=n=>{const r=t.ref(n);return t.watch(r,e=>{const o=new URLSearchParams(window.location.search);for(const s in e){const i=e[s];if(i==null||i==null){o.delete(s);continue}if(Array.isArray(i)){o.delete(s),i.forEach(c=>{o.append(s,c.toString())});continue}!o.has(s)&&!i||o.set(s,i.toString())}const a=o.toString()!==""?`?${o.toString()}`:"";window.history.replaceState(t.toRaw(e),document.title,`${window.location.pathname}${a}`)},{deep:!0}),r},Ed={class:"px-4 flex items-center justify-between sm:px-0"},Cd={class:"w-0 flex-1 flex"},kd={class:"hidden md:flex"},Dd=["onClick","textContent"],Nd={class:"w-0 flex-1 flex justify-end"},Fr=t.defineComponent({__name:"Paginator",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(n){const r=t.useModel(n,"modelValue"),e=a=>{r.value={...r.value,page:a}},o=t.computed(()=>{const a=[];if(r.value.totalPages<=4){for(let i=0;i<r.value.totalPages;i++)a.push(i+1);return a}if(r.value.totalPages-r.value.page>=3){for(let i=0;i<4;i++)a.push(r.value.page+i);return a}for(let i=0;i<4;i++)a.unshift(r.value.totalPages-i);return a});return(a,s)=>(t.openBlock(),t.createElementBlock("div",Ed,[t.createElementVNode("div",Cd,[t.createElementVNode("a",{href:"#",class:t.normalizeClass(["-mt-px border-t-2 border-transparent pt-4 pr-1 inline-flex items-center text-sm leading-5 font-medium focus:outline-none focus:text-gray-700 focus:border-gray-400",r.value.page==1?"text-gray-500 cursor-not-allowed pointer-events-none":"text-gray-700 hover:text-gray-900 hover:border-gray-300"]),onClick:s[0]||(s[0]=t.withModifiers(i=>e(r.value.page-1),["prevent"]))},s[2]||(s[2]=[t.createElementVNode("svg",{class:"mr-3 h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M7.707 14.707a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l2.293 2.293a1 1 0 010 1.414z","clip-rule":"evenodd"})],-1),t.createTextVNode(" Previous ")]),2)]),t.createElementVNode("div",kd,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.value,i=>(t.openBlock(),t.createElementBlock("a",{key:i,href:"#",class:t.normalizeClass(["-mt-px border-t-2 pt-4 px-4 inline-flex items-center text-sm leading-5 font-medium",r.value.page===i?"border-blue-500 text-blue-600 focus:outline-none focus:text-blue-800 focus:border-blue-700":"border-transparent text-gray-700 hover:text-gray-900 hover:border-gray-300 focus:outline-none focus:text-gray-700 focus:border-gray-400"]),onClick:t.withModifiers(c=>e(i),["prevent"]),textContent:t.toDisplayString(i)},null,10,Dd))),128))]),t.createElementVNode("div",Nd,[t.createElementVNode("a",{href:"#",class:t.normalizeClass(["-mt-px border-t-2 border-transparent pt-4 pl-1 inline-flex items-center text-sm leading-5 font-medium focus:outline-none focus:text-gray-700 focus:border-gray-400",r.value.page>=r.value.totalPages?"text-gray-500 cursor-not-allowed pointer-events-none":"text-gray-700 hover:text-gray-900 hover:border-gray-300"]),onClick:s[1]||(s[1]=t.withModifiers(i=>e(r.value.page+1),["prevent"]))},s[3]||(s[3]=[t.createTextVNode(" Next "),t.createElementVNode("svg",{class:"ml-3 h-5 w-5",fill:"currentColor",viewBox:"0 0 20 20"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)]),2)])]))}}),Sd={key:0,class:"flex"},ms=t.defineComponent({__name:"DetailList",props:{borderless:{type:Boolean,default:!1},defaultSort:{default:"created_at"},defaultSortDir:{default:"desc"},disableDate:{type:Boolean,default:!1},disableNavigation:{type:Boolean,default:!1},perPage:{default:10},url:{}},setup(n,{expose:r}){const e=n,o=t.ref({minDate:0,maxDate:0}),a=t.ref([]),s=t.ref({page:1,perPage:e.perPage,totalItems:0,totalPages:0}),i=t.ref(e.defaultSort),c=t.ref(e.defaultSortDir),l=()=>{const m={maxDate:o.value.maxDate||null,minDate:o.value.minDate||null,page:s.value.page,perPage:s.value.perPage,q:"",sort:i.value,sortDir:c.value};pr.get(e.url,{},m).then(y=>{s.value={page:y.data.page,perPage:y.data.perPage,totalItems:y.data.totalItems,totalPages:y.data.totalPages},a.value=y.data.items},()=>{Lr.genericError()})},d=t.computed(()=>!!a.value.length),u=t.computed(()=>!e.disableDate),f=t.computed(()=>!e.disableNavigation&&d),g={refresh:l,reset:()=>{s.value.page=1,l()}};return t.watch([c,o],()=>{l()}),r(g),l(),(m,y)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass({"mt-4 space-y-2":u.value})},[m.disableDate?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",Sd,[t.createVNode(Rr,{"date-range":o.value,"sort-dir":c.value,onSortDirChanged:y[0]||(y[0]=w=>c.value=w),onDateRangeChanged:y[1]||(y[1]=w=>o.value=w)},null,8,["date-range","sort-dir"])])),d.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["overflow-hidden",{"shadow sm:rounded-md border":!m.borderless}])},[t.createElementVNode("ul",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.value,(w,E)=>(t.openBlock(),t.createElementBlock("li",{key:E,class:t.normalizeClass({"border-t border-gray-200":E>0})},[t.renderSlot(m.$slots,"default",{item:w})],2))),128))])],2)):t.renderSlot(m.$slots,"empty",{key:2},()=>[y[4]||(y[4]=t.createTextVNode(" No items were found! "))]),f.value?(t.openBlock(),t.createBlock(Fr,{key:3,modelValue:s.value,"onUpdate:modelValue":[y[2]||(y[2]=w=>s.value=w),y[3]||(y[3]=w=>l())]},null,8,["modelValue"])):t.createCommentVNode("",!0)],2))}}),_d=["href"],hs=t.defineComponent({__name:"DownloadCell",props:{propsData:{},attribute:{}},setup(n){return(r,e)=>(t.openBlock(),t.createElementBlock("a",{href:r.propsData[r.attribute]},[t.createVNode(t.unref(Cc),{class:"h-6 w-6 group-hover:text-gray-500 transition"})],8,_d))}}),Vd={class:"fixed inset-0 flex flex-col items-end justify-end px-4 py-6 pointer-events-none sm:p-6 z-[45]"},$d={class:"rounded-lg ring-1 ring-black ring-opacity-5 overflow-hidden"},vd={class:"p-4"},Td={class:"flex items-center"},Md={class:"w-0 flex-1 flex justify-between"},Bd=["innerHTML"],Pd={class:"ml-4 shrink-0 flex"},Ad=["onClick"],In=t.defineComponent({__name:"Flash",setup(n){const{flasher:r,flashes:e}=ft(),o=a=>{switch(a){case"warning":return"border-orange-500";case"error":return"border-red-500";case"info":return"border-blue-500";case"success":return"border-green-500"}};return t.onMounted(()=>{yd(r)}),(a,s)=>(t.openBlock(),t.createBlock(t.unref(gr),null,{default:t.withCtx(()=>[t.createElementVNode("div",Vd,[t.createVNode(t.TransitionGroup,{tag:"div",class:"max-w-sm space-y-2 w-full","enter-active-class":"ease-out duration-300","enter-from-class":"translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2","enter-to-class":"translate-y-0 opacity-100 sm:translate-x-0","leave-active-class":"ease-in duration-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(e),([i,c])=>(t.openBlock(),t.createElementBlock("div",{key:c.message,class:t.normalizeClass(["bg-white shadow-lg rounded-lg pointer-events-auto border-t-4 transform z-10",[o(c.type)]])},[t.createElementVNode("div",$d,[t.createElementVNode("div",vd,[t.createElementVNode("div",Td,[t.createElementVNode("div",Md,[t.createElementVNode("p",{class:"w-0 flex-1 text-sm leading-5 font-medium text-gray-900",innerHTML:c.message},null,8,Bd)]),t.createElementVNode("div",Pd,[t.createElementVNode("button",{class:"inline-flex text-gray-400 focus:outline-none focus:text-gray-500 transition ease-in-out duration-150",onClick:l=>t.unref(r).remove(i)},s[0]||(s[0]=[t.createElementVNode("svg",{class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1)]),8,Ad)])])])])],2))),128))]),_:1})])]),_:1}))}});function Od(n,r){return t.openBlock(),t.createBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},[t.createVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])}function Rd(n,r){return t.openBlock(),t.createBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},[t.createVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h7"})])}function Id(n,r){return t.openBlock(),t.createBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},[t.createVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 6h16M4 12h16M4 18h16"})])}function gs(n,r){return t.openBlock(),t.createBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},[t.createVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z"})])}function Gt(n,r){return t.openBlock(),t.createBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},[t.createVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})])}const Ld={class:"flex"},Fd={class:"flex-shrink-0"},jd={class:"ml-2.5"},Hd={key:0,role:"list",class:"list-disc space-y-1 pl-5"},Ud={key:1},zd={key:1,class:"mt-4"},qd={class:"flex flex-col gap-y-1.5 -mx-2 sm:flex-row sm:gap-x-3 sm:items-center"},Wd={key:0},Yd=["href","role"],Kd={key:1},Gd=["href","role"],Jd={key:0,class:"ml-auto pl-3"},Xd={class:"-mx-1.5 -my-1.5"},bs=t.defineComponent({__name:"InlineAlert",props:{btnLink:{default:""},btnText:{default:""},content:{},dismissable:{type:Boolean,default:!1},secondaryBtnLink:{default:""},secondaryBtnText:{default:""},title:{default:""},kind:{}},emits:["close","click","click:secondary"],setup(n,{emit:r}){const e=n,o=r,a=t.ref(!0),s=()=>{a.value=!1,o("close",!0)},i=t.computed(()=>{const l={bgColor:"",btnAction:"",btnClose:"",contentColor:"",iconColor:""};switch(e.kind){case"alert":l.bgColor="bg-red-50",l.btnAction="bg-red-50 text-red-900 hover:bg-red-100 focus:ring-red-600 focus:ring-offset-red-50",l.btnClose="bg-red-50 text-red-600 hover:bg-red-100 focus:ring-red-600 focus:ring-offset-red-50",l.contentColor="text-red-800",l.iconColor="text-red-400";break;case"info":l.bgColor="bg-blue-50",l.btnAction="bg-blue-50 text-blue-900 hover:bg-blue-100 focus:ring-blue-600 focus:ring-offset-blue-50",l.btnClose="bg-blue-50 text-blue-600 hover:bg-blue-100 focus:ring-blue-600 focus:ring-offset-blue-50",l.contentColor="text-blue-800",l.iconColor="text-blue-400";break;case"success":l.bgColor="bg-emerald-50",l.btnAction="bg-emerald-50 text-emerald-900 hover:bg-emerald-100 focus:ring-emerald-600 focus:ring-offset-emerald-50",l.btnClose="bg-emerald-50 text-emerald-600 hover:bg-emerald-100 focus:ring-emerald-600 focus:ring-offset-emerald-50",l.contentColor="text-emerald-800",l.iconColor="text-emerald-400";break;case"warn":l.bgColor="bg-amber-50",l.btnAction="bg-amber-50 text-amber-900 hover:bg-amber-100 focus:ring-amber-600 focus:ring-offset-amber-50",l.btnClose="bg-amber-50 text-amber-600 hover:bg-amber-100 focus:ring-amber-600 focus:ring-offset-amber-50",l.contentColor="text-amber-800",l.iconColor="text-amber-400";break}return l}),c=t.computed(()=>{let l=null;switch(e.kind){case"alert":l=Nc;break;case"info":l=Dc;break;case"success":l=Ba;break;case"warn":l=kc;break}return l});return(l,d)=>a.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["rounded-xy p-4",i.value.bgColor])},[t.createElementVNode("div",Ld,[t.createElementVNode("div",Fd,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(c.value),{class:t.normalizeClass(["h-5 w-5",i.value.iconColor]),"aria-hidden":"true"},null,8,["class"]))]),t.createElementVNode("div",jd,[l.title?(t.openBlock(),t.createElementBlock("h3",{key:0,class:t.normalizeClass(["text-sm leading-snug font-semibold mb-1.5",i.value.contentColor])},t.toDisplayString(l.title),3)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["text-sm",i.value.contentColor])},[Array.isArray(l.content)?(t.openBlock(),t.createElementBlock("ul",Hd,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.content,(u,f)=>(t.openBlock(),t.createElementBlock("li",{key:f},t.toDisplayString(u),1))),128))])):(t.openBlock(),t.createElementBlock("p",Ud,t.toDisplayString(l.content),1))],2),l.btnText||l.secondaryBtnText?(t.openBlock(),t.createElementBlock("div",zd,[t.createElementVNode("div",qd,[l.btnText?(t.openBlock(),t.createElementBlock("div",Wd,[t.createElementVNode("a",{class:t.normalizeClass(["inline-flex rounded-3xl px-2.5 py-1.5 text-sm font-medium focus:outline-none focus:ring-2 focus:ring-offset-2",i.value.btnAction]),href:l.btnLink,role:l.btnLink?"link":"button",onClick:d[0]||(d[0]=u=>l.$emit("click",u))},t.toDisplayString(l.btnText),11,Yd)])):t.createCommentVNode("",!0),l.secondaryBtnText?(t.openBlock(),t.createElementBlock("div",Kd,[t.createElementVNode("a",{class:t.normalizeClass(["inline-flex rounded-3xl px-2.5 py-1.5 text-sm font-medium focus:outline-none focus:ring-2 focus:ring-offset-2",i.value.btnAction]),href:l.secondaryBtnLink,role:l.secondaryBtnLink?"link":"button",onClick:d[1]||(d[1]=u=>l.$emit("click:secondary",u))},t.toDisplayString(l.secondaryBtnText),11,Gd)])):t.createCommentVNode("",!0)])])):t.createCommentVNode("",!0)]),l.dismissable?(t.openBlock(),t.createElementBlock("div",Jd,[t.createElementVNode("div",Xd,[t.createElementVNode("button",{class:t.normalizeClass(["inline-flex rounded-md p-1.5 focus:outline-none focus:ring-2 focus:ring-offset-2",i.value.btnClose]),type:"button",onClick:s},[d[2]||(d[2]=t.createElementVNode("span",{class:"sr-only"},"close",-1)),t.createVNode(t.unref(Gt),{class:"h-4 w-4"})],2)])])):t.createCommentVNode("",!0)])],2)):t.createCommentVNode("",!0)}}),Zd={class:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0"},Qd={class:"block absolute top-0 right-0 pt-4 pr-4 sm:pt-6 sm:pr-8"},eu={class:"px-4 pt-5 pb-4 sm:p-8 sm:pb-6"},tu={class:"mt-3 sm:mt-0 sm:text-left"},nu={class:"mt-2"},ru={key:0,class:"bg-gray-50 flex flex-col gap-3 px-4 py-3 rounded-b-xy shadow-xl sm:py-4 sm:px-8 sm:flex sm:flex-row-reverse sm:rounded-b-xy-lg"},ou=["disabled"],ys=t.defineComponent({__name:"Modal",props:t.mergeModels({destructive:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},wide:{type:Boolean,default:!1},submitText:{default:""},title:{default:""}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:t.mergeModels(["close","submit"],["update:modelValue"]),setup(n,{emit:r}){const e=n,o=t.useModel(n,"modelValue"),a=r,s=()=>{a("submit")},i=t.useSlots(),c=t.computed(()=>e.submitText||i.buttons);return t.watch(o,l=>{l||a("close")}),(l,d)=>(t.openBlock(),t.createBlock(t.unref(Ut),{as:"template",show:o.value},{default:t.withCtx(()=>[t.createVNode(t.unref(En),{as:"div",static:"",class:"fixed z-30 inset-0 overflow-y-auto",open:o.value,onClose:d[3]||(d[3]=u=>o.value=!1)},{default:t.withCtx(()=>[t.createElementVNode("div",Zd,[t.createVNode(t.unref(Je),{as:"template",enter:"ease-out duration-300","enter-from":"opacity-0","enter-to":"opacity-100",leave:"ease-in duration-200","leave-from":"opacity-100","leave-to":"opacity-0"},{default:t.withCtx(()=>[t.createVNode(t.unref(Cn),{class:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"})]),_:1}),d[5]||(d[5]=t.createElementVNode("span",{class:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true"},"",-1)),t.createVNode(t.unref(Je),{as:"template",enter:"ease-out duration-300","enter-from":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to":"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200","leave-from":"opacity-100 translate-y-0 sm:scale-100","leave-to":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["inline-block align-bottom text-left overflow-y-visible transform transition-all w-full sm:my-8 sm:align-middle",l.wide?"sm:max-w-6xl":"sm:max-w-2xl"])},[t.createElementVNode("div",{class:t.normalizeClass(["bg-white rounded-t-xy sm:rounded-t-xy-lg",!c.value&&"rounded-b-xy sm:rounded-b-xy-lg shadow-xl"])},[t.createElementVNode("div",Qd,[t.createElementVNode("button",{type:"button",class:"bg-white rounded-md text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",onClick:d[0]||(d[0]=u=>o.value=!1)},[d[4]||(d[4]=t.createElementVNode("span",{class:"sr-only"},"Close",-1)),t.createVNode(t.unref(Gt),{class:"h-6 w-6","aria-hidden":"true"})])]),t.createElementVNode("div",eu,[t.createElementVNode("div",tu,[t.createVNode(t.unref(wr),{as:"h3",class:"text-center text-lg leading-6 font-medium text-gray-900"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(l.title),1)]),_:1}),t.createElementVNode("div",nu,[t.renderSlot(l.$slots,"default")])])])],2),c.value?(t.openBlock(),t.createElementBlock("div",ru,[l.submitText?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("button",{type:"button",class:t.normalizeClass([l.destructive?"xy-btn-red":"xy-btn"]),disabled:l.disabled,onClick:d[1]||(d[1]=u=>s())},t.toDisplayString(l.submitText),11,ou),t.createElementVNode("button",{type:"button",class:"xy-btn-neutral",onClick:d[2]||(d[2]=u=>o.value=!1)}," Cancel ")],64)):t.createCommentVNode("",!0),t.renderSlot(l.$slots,"buttons")])):t.createCommentVNode("",!0)],2)]),_:3})])]),_:3},8,["open"])]),_:3},8,["show"]))}}),au={class:"aspect-square overflow-hidden"},su={class:"flex justify-center relative"},iu={class:"sr-only"},jr=t.defineComponent({__name:"XYSpinner",setup(n){const r=t.useAttrs();return(e,o)=>{var a,s;return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass((a=t.unref(r))!=null&&a.class?(s=t.unref(r))==null?void 0:s.class:"h-20 w-20"),role:"status"},[t.createElementVNode("div",au,[t.createElementVNode("div",su,[t.createElementVNode("p",iu,[t.renderSlot(e.$slots,"default",{},()=>[o[0]||(o[0]=t.createTextVNode("loading"))])]),o[1]||(o[1]=t.createStaticVNode('<div class="animate-spin-gear drop-shadow-sm"><svg class="h-full w-full text-xy-green-300" viewBox="0 0 129 129" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><polygon id="path-1" points="0.000248076923 0.48676924 128.472837 0.48676924 128.472837 128.800648 0.000248076923 128.800648"></polygon></defs><g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Group-6-Copy-3"><g id="Group-3"><mask id="mask-2" fill="white"><use xlink:href="#path-1"></use></mask><g id="Clip-2"></g><path id="Fill-1" d="M86.3955173,100.279324 C86.3955173,100.279324 79.4778923,106.213874 64.2360462,106.755809 C48.9954404,106.213874 42.0778154,100.279324 42.0778154,100.279324 C11.8756904,81.4963011 25.2309115,49.088357 25.2309115,49.088357 C36.5680269,24.1350542 59.1839596,22.5554236 63.8105942,22.4983139 L63.8105942,22.5043894 C63.8105942,22.5043894 63.9681231,22.4983139 64.2360462,22.4958837 C64.5052096,22.4983139 64.6627385,22.5043894 64.6627385,22.5043894 L64.6627385,22.4983139 C69.2881327,22.5554236 91.9053058,24.1350542 103.241181,49.088357 C103.241181,49.088357 116.596402,81.4963011 86.3955173,100.279324 L86.3955173,100.279324 Z M128.473085,68.8191581 L128.473085,60.4677727 L117.036738,58.80187 L115.10794,49.3726905 L124.970238,43.4186983 L121.675777,35.7307578 L110.49619,38.6214817 L106.161046,32.1486416 L113.220075,23.080347 L107.361738,17.0716753 L97.9645846,23.7437918 L89.14545,17.842049 L91.8693346,6.72144964 L84.04995,3.59378109 L78.2114596,13.4628269 L69.5907865,11.8127205 L67.908825,0.48676924 L64.6627385,0.48676924 L63.8105942,0.48676924 L60.5645077,0.48676924 L58.8813058,11.8127205 L50.2618731,13.4628269 L44.4233827,3.59378109 L36.6039981,6.72144964 L39.3278827,17.842049 L30.5087481,23.7437918 L21.1103538,17.0716753 L15.2520173,23.080347 L22.3122865,32.1486416 L17.9771423,38.6214817 L6.79755577,35.7307578 L3.50185385,43.4186983 L13.3641519,49.3726905 L11.4365942,58.80187 L0.000248076923,60.4677727 L0.000248076923,68.8191581 L11.4365942,70.4850608 L13.1036712,79.0223566 L3.13718077,84.8050196 L6.29644038,92.5488548 L17.5244019,89.8513318 L23.4832096,98.5854738 L16.7466808,107.893143 L22.8134019,113.695248 L31.9699212,106.70356 L38.5067481,110.99651 L35.5881231,122.068505 L43.35045,125.332265 L49.3625942,115.565287 L58.8813058,117.47421 L60.5645077,128.801377 L63.6927577,128.801377 L64.780575,128.801377 L67.908825,128.801377 L69.5907865,117.47421 L79.1107385,115.565287 L85.1228827,125.332265 L92.8852096,122.068505 L89.9665846,110.99651 L96.5034115,106.70356 L105.659931,113.695248 L111.725412,107.893143 L104.988883,98.5854738 L110.94769,89.8513318 L122.175652,92.5488548 L125.334912,84.8050196 L115.369662,79.0223566 L117.035498,70.4850608 L128.473085,68.8191581 Z" fill="currentColor" mask="url(#mask-2)"></path></g></g></g></svg></div><div class="absolute top-0 left-0 right-0 bottom-0 flex justify-center items-center transform scale-50"><svg viewBox="0 0 280 280" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path class="fill-xy-green" d="m17.57,94.37c-3.36,13.54-5.07,28.73-5.07,45.63,0,32.02,6.04,58,18.1,77.95,3.81,4.98,7.46,9.94,10.95,14.66,21.21,23.24,54.01,34.89,98.45,34.89.71,0,1.39-.03,2.09-.03-3.62-46.93-22.27-88.31-54.36-124.11-19.79-22.07-42.96-38.86-70.16-48.99Z"></path><path class="fill-xy-blue" d="m267.5,140c0-85-42.5-127.5-127.5-127.5-55.06,0-92.27,17.86-111.66,53.53,28.32,8.48,56.67,16.85,84.98,25.37,27.05,8.14,54.01,16.55,81.06,24.67,5.45,1.64,7.5,4.76,6.63,10.27-.69,4.35-1.04,8.75-1.57,13.13-4.95,40.77-8.32,81.74-12.43,122.61,53.64-13.88,80.49-54.56,80.49-122.08Z"></path></svg></div>',2))])])],2)}}}),lu={key:0,class:"fixed top-0 left-0 flex flex-col items-center justify-center w-full h-full cursor-not-allowed z-40 bg-gray-50 bg-opacity-60"},cu={class:"mt-2"},Ln=t.defineComponent({__name:"Spinner",setup(n){const{idx:r,loading:e,maxIdx:o,messages:a,msg:s,showMsg:i}=qo(),c=()=>{r.value++,r.value>o.value&&(r.value=0),a.value&&(s.value=a.value[r.value]),i.value=!0},l=()=>{window.setTimeout(()=>{i.value=!1},2500)};return(d,u)=>(t.openBlock(),t.createBlock(t.unref(gr),null,{default:t.withCtx(()=>[t.unref(e)?(t.openBlock(),t.createElementBlock("div",lu,[t.createVNode(jr,{class:"w-32 h-32"}),t.withDirectives(t.createElementVNode("div",cu,[t.createVNode(t.Transition,{appear:"","enter-active-class":"ease-out duration-1000","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"ease-in duration-500","leave-from-class":"opacity-100","leave-to-class":"opacity-0",onAfterEnter:l,onAfterLeave:c},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{class:"container font-medium text-lg leading-snug text-center transition-opacity"},t.toDisplayString(t.unref(s)),513),[[t.vShow,t.unref(i)]])]),_:1})],512),[[t.vShow,t.unref(a)]])])):t.createCommentVNode("",!0)]),_:1}))}}),du={class:"h-screen flex overflow-hidden bg-gray-50"},uu={class:"relative flex-1 flex flex-col max-w-xs w-full pt-5 pb-4 bg-white"},fu={class:"absolute top-0 right-0 -mr-12 pt-2"},pu={class:"shrink-0 flex justify-center px-4"},mu=["src"],hu={class:"mt-5 flex flex-col flex-1 h-0 overflow-y-auto"},gu={class:"flex-1 px-2"},bu={class:"space-y-1"},yu=["href","target"],wu={key:0,class:"mt-auto"},xu={class:"mt-6 px-2"},Eu={class:"hidden lg:flex lg:shrink-0"},Cu={class:"flex flex-col w-64"},ku={class:"flex flex-col grow border-r border-gray-200 pt-5 pb-4 bg-white overflow-y-auto"},Du={class:"flex justify-center shrink-0 px-4"},Nu=["src"],Su={class:"mt-5 grow flex flex-col"},_u={class:"flex-1 px-2 bg-white"},Vu={class:"space-y-1"},$u=["href","target"],vu={key:0,class:"mt-atuo"},Tu={class:"mt-6 px-2"},Mu={class:"flex flex-col w-0 flex-1 overflow-hidden"},Bu={class:"relative z-10 shrink-0 flex h-16 bg-xy-blue shadow"},Pu={class:"flex-1 px-4 flex justify-between"},Au={class:"flex-1 flex"},Ou={class:"flex items-center text-base leading-snug sm:text-2xl text-white"},Ru={class:"ml-4 flex items-center lg:ml-6"},Iu=["href"],Lu={class:"flex-1 relative overflow-y-auto focus:outline-none"},Fu={class:"mx-auto"},ws=t.defineComponent({__name:"SidebarLayout",props:{activeUrl:{default:""},iconUrl:{},navigation:{},userNavigation:{}},setup(n){const r=n,e=t.ref(!1),o=a=>r.activeUrl===a;return(a,s)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",du,[t.createVNode(t.unref(Ut),{as:"template",show:e.value},{default:t.withCtx(()=>[t.createVNode(t.unref(En),{as:"div",static:"",class:"fixed inset-0 flex z-10 lg:hidden",open:e.value,onClose:s[1]||(s[1]=i=>e.value=!1)},{default:t.withCtx(()=>[t.createVNode(t.unref(Je),{as:"template",enter:"transition-opacity ease-linear duration-300","enter-from":"opacity-0","enter-to":"opacity-100",leave:"transition-opacity ease-linear duration-300","leave-from":"opacity-100","leave-to":"opacity-0"},{default:t.withCtx(()=>[t.createVNode(t.unref(Cn),{class:"fixed inset-0 bg-gray-600 bg-opacity-75"})]),_:1}),t.createVNode(t.unref(Je),{as:"template",enter:"transition ease-in-out duration-300 transform","enter-from":"-translate-x-full","enter-to":"translate-x-0",leave:"transition ease-in-out duration-300 transform","leave-from":"translate-x-0","leave-to":"-translate-x-full"},{default:t.withCtx(()=>[t.createElementVNode("div",uu,[t.createVNode(t.unref(Je),{as:"template",enter:"ease-in-out duration-300","enter-from":"opacity-0","enter-to":"opacity-100",leave:"ease-in-out duration-300","leave-from":"opacity-100","leave-to":"opacity-0"},{default:t.withCtx(()=>[t.createElementVNode("div",fu,[t.createElementVNode("button",{class:"ml-1 flex items-center justify-center h-10 w-10 rounded-full focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white",onClick:s[0]||(s[0]=i=>e.value=!1)},[s[3]||(s[3]=t.createElementVNode("span",{class:"sr-only"},"Close sidebar",-1)),t.createVNode(t.unref(Gt),{class:"h-6 w-6 text-white","aria-hidden":"true"})])])]),_:1}),t.createElementVNode("div",pu,[t.createElementVNode("img",{class:"w-auto h-12",src:a.iconUrl,alt:"Logo"},null,8,mu)]),t.createElementVNode("div",hu,[t.createElementVNode("div",gu,[t.renderSlot(a.$slots,"sidebar-nav",{},()=>[t.createElementVNode("nav",bu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.navigation,i=>(t.openBlock(),t.createElementBlock("a",{key:i.name,href:i.url,class:t.normalizeClass([o(i.url)?"bg-gray-100 text-gray-900":"text-gray-700 hover:bg-gray-50 hover:text-gray-900","group flex items-center px-2 py-2 text-base font-semibold rounded-md"]),target:i.openInTab?"_blank":"_self"},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.icon),{class:t.normalizeClass([o(i.url)?"text-gray-600":"text-gray-500 group-hover:text-gray-600","mr-4 h-6 w-6"]),"aria-hidden":"true"},null,8,["class"])),t.createTextVNode(" "+t.toDisplayString(i.name),1)],10,yu))),128))])])]),a.$slots["sidebar-bottom"]?(t.openBlock(),t.createElementBlock("div",wu,[t.createElementVNode("div",xu,[t.renderSlot(a.$slots,"sidebar-bottom")])])):t.createCommentVNode("",!0)])])]),_:3}),s[4]||(s[4]=t.createElementVNode("div",{class:"shrink-0 w-14","aria-hidden":"true"},null,-1))]),_:3},8,["open"])]),_:3},8,["show"]),t.createElementVNode("div",Eu,[t.createElementVNode("div",Cu,[t.createElementVNode("div",ku,[t.createElementVNode("div",Du,[t.createElementVNode("img",{class:"w-auto h-12",src:a.iconUrl,alt:"Logo"},null,8,Nu)]),t.createElementVNode("div",Su,[t.createElementVNode("div",_u,[t.renderSlot(a.$slots,"sidebar-nav",{},()=>[t.createElementVNode("nav",Vu,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.navigation,i=>(t.openBlock(),t.createElementBlock("a",{key:i.name,href:i.url,class:t.normalizeClass([o(i.url)?"bg-gray-100 text-gray-900":"text-gray-800 hover:bg-gray-100 hover:text-gray-900","group flex items-center px-2 py-2 text-sm font-semibold rounded-md"]),target:i.openInTab?"_blank":"_self"},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.icon),{class:t.normalizeClass([o(i.url)?"text-gray-600":"text-gray-400 group-hover:text-gray-600","mr-3 h-6 w-6"]),"aria-hidden":"true"},null,8,["class"])),t.createTextVNode(" "+t.toDisplayString(i.name),1)],10,$u))),128))])])]),a.$slots["sidebar-bottom"]?(t.openBlock(),t.createElementBlock("div",vu,[t.createElementVNode("div",Tu,[t.renderSlot(a.$slots,"sidebar-bottom")])])):t.createCommentVNode("",!0)])])])]),t.createElementVNode("div",Mu,[t.createElementVNode("div",Bu,[t.createElementVNode("button",{class:"px-4 border-r border-gray-200 text-white focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500 lg:hidden",onClick:s[2]||(s[2]=i=>e.value=!0)},[s[5]||(s[5]=t.createElementVNode("span",{class:"sr-only"},"Open sidebar",-1)),t.createVNode(t.unref(Rd),{class:"h-6 w-6","aria-hidden":"true"})]),t.createElementVNode("div",Pu,[t.createElementVNode("div",Au,[t.createElementVNode("h1",Ou,[t.renderSlot(a.$slots,"header")])]),t.createElementVNode("div",Ru,[t.createVNode(t.unref(xr),{as:"div",class:"ml-3 relative"},{default:t.withCtx(()=>[t.createElementVNode("div",null,[t.createVNode(t.unref(Er),{class:"max-w-xs flex items-center text-sm text-white rounded-full hover:bg-blue-900 hover:text-gray-50 focus:outline-none focus:ring focus:text-white"},{default:t.withCtx(()=>[s[6]||(s[6]=t.createElementVNode("span",{class:"sr-only"},"Open user menu",-1)),t.createVNode(t.unref(xc),{class:"h-8 w-8",fill:"currentColor"})]),_:1})]),t.createVNode(t.Transition,{"enter-active-class":"transition ease-out duration-100","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:t.withCtx(()=>[t.createVNode(t.unref(Cr),{class:"origin-top-right absolute right-0 mt-2 w-48 rounded-md shadow-lg py-1 bg-white ring-1 ring-black ring-opacity-5 focus:outline-none"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.userNavigation,i=>(t.openBlock(),t.createBlock(t.unref(kr),{key:i.name},{default:t.withCtx(({active:c})=>[t.createElementVNode("a",{href:i.url,class:t.normalizeClass([c?"bg-gray-100":"","block px-4 py-2 text-sm text-gray-700 font-semibold"])},t.toDisplayString(i.name),11,Iu)]),_:2},1024))),128))]),_:1})]),_:1})]),_:1})])])]),t.createElementVNode("main",Lu,[t.createElementVNode("div",Fu,[t.renderSlot(a.$slots,"default")])])])]),t.createVNode(In),t.createVNode(Ln)],64))}}),Jt=t.defineComponent({__name:"Popover",props:{as:{default:"div"},position:{default:"auto"}},setup(n){const r=n,e=t.useTemplateRef("trigger"),o=t.useTemplateRef("wrapper"),a=t.computed(()=>{const c=[Oc(5),Ic()];return r.position==="auto"&&c.push(Ac()),c}),s=t.computed(()=>{if(r.position!=="auto")return r.position}),{floatingStyles:i}=ss(e,o,{middleware:a,placement:s,strategy:"fixed",whileElementsMounted:ns});return(c,l)=>(t.openBlock(),t.createBlock(t.unref(Ea),{as:c.as,class:"relative"},{default:t.withCtx(({open:d,close:u})=>[t.createVNode(t.unref(ic),{ref:"trigger"},{default:t.withCtx(()=>[t.renderSlot(c.$slots,"button",{open:d,close:u})]),_:2},1536),t.createElementVNode("div",{ref:"wrapper",class:"z-[5]",style:t.normalizeStyle(t.unref(i))},[t.createVNode(t.unref(lc),null,{default:t.withCtx(()=>[t.renderSlot(c.$slots,"default",{open:d,close:u})]),_:2},1024)],4)]),_:3},8,["as"]))}}),ju=(n,r)=>{const e=n.__vccOpts||n;for(const[o,a]of r)e[o]=a;return e},Hu={},Uu={class:"w-full max-w-xs bg-white rounded-xy p-2 border border-gray-100 shadow-md"};function zu(n,r){return t.openBlock(),t.createElementBlock("div",Uu,[t.renderSlot(n.$slots,"default")])}const xs=ju(Hu,[["render",zu]]),qu={class:"absolute inset-0 overflow-hidden"},Wu={class:"fixed inset-y-0 right-0 pl-10 max-w-full flex"},Yu={class:"w-screen max-w-md"},Ku={class:"h-full flex flex-col bg-white shadow-xl overflow-y-scroll"},Gu={class:"py-6 px-4 bg-xy-blue-700 sm:px-6"},Ju={class:"flex items-center justify-between"},Xu={class:"ml-3 h-7 flex items-center"},Zu={class:"mt-1"},Qu=["textContent"],ef={class:"relative flex-1 py-6 px-4 sm:px-6"},Es=t.defineComponent({__name:"Slideover",props:t.mergeModels({header:{},description:{}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:t.mergeModels(["close"],["update:modelValue"]),setup(n,{emit:r}){const e=t.useModel(n,"modelValue"),o=r;return t.watch(e,a=>{a||o("close")}),(a,s)=>(t.openBlock(),t.createBlock(t.unref(Ut),{as:"template",show:e.value},{default:t.withCtx(()=>[t.createVNode(t.unref(En),{as:"div",static:"",class:"fixed inset-0 z-20 overflow-hidden bg-black bg-opacity-50",open:e.value,onClose:s[1]||(s[1]=i=>e.value=!1)},{default:t.withCtx(()=>[t.createElementVNode("div",qu,[t.createVNode(t.unref(Cn),{class:"absolute inset-0"}),t.createElementVNode("div",Wu,[t.createVNode(t.unref(Je),{as:"template",enter:"transform transition ease-in-out duration-500 sm:duration-700","enter-from":"translate-x-full","enter-to":"translate-x-0",leave:"transform transition ease-in-out duration-500 sm:duration-700","leave-from":"translate-x-0","leave-to":"translate-x-full"},{default:t.withCtx(()=>[t.createElementVNode("div",Yu,[t.createElementVNode("div",Ku,[t.createElementVNode("div",Gu,[t.createElementVNode("div",Ju,[t.createVNode(t.unref(wr),{as:"h3",class:"text-white"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(a.header),1)]),_:1}),t.createElementVNode("div",Xu,[t.createElementVNode("button",{class:"bg-xy-blue-600 rounded-md text-gray-50 hover:text-white focus:outline-none focus:ring-2 focus:ring-white",onClick:s[0]||(s[0]=i=>e.value=!1)},[s[2]||(s[2]=t.createElementVNode("span",{class:"sr-only"},"Close panel",-1)),t.createVNode(t.unref(Gt),{class:"h-6 w-6","aria-hidden":"true"})])])]),t.createElementVNode("div",Zu,[t.createElementVNode("p",{class:"text-gray-50 text-base font-medium",textContent:t.toDisplayString(a.description)},null,8,Qu)])]),t.createElementVNode("div",ef,[t.renderSlot(a.$slots,"default")]),t.renderSlot(a.$slots,"footer")])])]),_:3})])])]),_:3},8,["open"])]),_:3},8,["show"]))}}),tf=["onMouseover","onMouseleave"],nf=["onMouseleave"],rf={class:"max-w-xs"},Cs=t.defineComponent({__name:"Tooltip",props:{as:{default:"span"},position:{default:"auto"}},setup(n){var r=!1,e=null;const o=s=>{r=!1,e&&clearTimeout(e),e=setTimeout(()=>{r||s()},100)},a=(s,i)=>{r=!0,!i&&s.target&&s.target.click()};return(s,i)=>(t.openBlock(),t.createBlock(Jt,{position:s.position,as:s.as},{button:t.withCtx(({open:c,close:l})=>[t.createElementVNode("div",{class:"leading-none relative w-4 h-4",onMouseover:d=>a(d,c),onMouseleave:d=>o(l)},[t.createVNode(t.unref(Od)),i[1]||(i[1]=t.createElementVNode("div",{class:"p-5 absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"},null,-1))],40,tf)]),default:t.withCtx(({close:c})=>[t.createElementVNode("div",{class:"sm:min-w-max bg-white rounded-xy px-3.5 py-2.5 border border-gray-100 drop-shadow-md text-xs text-gray-900 leading-snug font-medium",onMouseover:i[0]||(i[0]=t.withModifiers(l=>t.isRef(r)?r.value=!0:r=!0,["prevent"])),onMouseleave:t.withModifiers(l=>o(c),["prevent"])},[t.createElementVNode("div",rf,[t.renderSlot(s.$slots,"default")])],40,nf)]),_:3},8,["position","as"]))}}),of={class:"min-h-screen bg-gray-50"},af={class:"mx-auto px-4 sm:px-6 lg:px-8"},sf={class:"flex justify-between h-16"},lf={class:"flex"},cf={class:"shrink-0 flex items-center"},df=["src"],uf={class:"hidden sm:-my-px sm:ml-6 sm:flex sm:space-x-8"},ff=["href","aria-current"],pf={class:"hidden sm:ml-6 sm:flex sm:items-center"},mf=["href"],hf={class:"-mr-2 flex items-center sm:hidden"},gf={class:"pt-2 pb-3 space-y-1"},bf=["href","aria-current"],yf={class:"pt-4 pb-3 border-t border-gray-200"},wf={class:"flex items-center px-4"},xf={class:"shrink-0"},Ef={class:"ml-3"},Cf=["textContent"],kf=["textContent"],Df={class:"mt-3 space-y-1"},Nf=["href"],Sf={class:"mx-auto sm:px-6 lg:px-8"},_f={class:"px-4 py-8 sm:px-0"},ks=t.defineComponent({__name:"StackedLayout",props:{activeUrl:{default:""},currentUser:{},iconUrl:{},navigation:{},userNavigation:{}},setup(n){const r=n,e=o=>r.activeUrl===o;return(o,a)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",of,[t.createVNode(t.unref(Ql),{as:"nav",class:"bg-white shadow-sm"},{default:t.withCtx(({open:s})=>[t.createElementVNode("div",af,[t.createElementVNode("div",sf,[t.createElementVNode("div",lf,[t.createElementVNode("div",cf,[t.createElementVNode("img",{class:"block h-8 w-auto",src:o.iconUrl,alt:"XY Trees"},null,8,df)]),t.createElementVNode("div",uf,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.navigation,i=>(t.openBlock(),t.createElementBlock("a",{key:i.name,href:i.url,class:t.normalizeClass([e(i.url)?"border-blue-500 text-gray-900":"border-transparent text-gray-700 hover:text-gray-900 hover:border-blue-500","inline-flex items-center px-1 pt-1 border-b-2 text-sm font-semibold"]),"aria-current":e(i.url)?"page":void 0},t.toDisplayString(i.name),11,ff))),128))])]),t.createElementVNode("div",pf,[t.createVNode(t.unref(xr),{as:"div",class:"ml-3 relative"},{default:t.withCtx(()=>[t.createElementVNode("div",null,[t.createVNode(t.unref(Er),{class:"bg-white flex text-sm rounded-full focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"},{default:t.withCtx(()=>[a[0]||(a[0]=t.createElementVNode("span",{class:"sr-only"},"Open user menu",-1)),t.createVNode(t.unref(gs),{class:"text-gray-500 h-8 w-8 rounded-full"})]),_:1})]),t.createVNode(t.Transition,{"enter-active-class":"transition ease-out duration-200","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:t.withCtx(()=>[t.createVNode(t.unref(Cr),{class:"origin-top-right absolute right-0 mt-2 w-48 rounded-md shadow-lg py-1 bg-white ring-1 ring-black ring-opacity-5 focus:outline-none"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.userNavigation,i=>(t.openBlock(),t.createBlock(t.unref(kr),{key:i.name},{default:t.withCtx(({active:c})=>[t.createElementVNode("a",{href:i.url,class:t.normalizeClass([c?"bg-gray-100":"","block px-4 py-2 text-sm text-gray-700 font-semibold"])},t.toDisplayString(i.name),11,mf)]),_:2},1024))),128))]),_:1})]),_:1})]),_:1})]),t.createElementVNode("div",hf,[t.createVNode(t.unref(ec),{class:"bg-white inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"},{default:t.withCtx(()=>[a[1]||(a[1]=t.createElementVNode("span",{class:"sr-only"},"Open main menu",-1)),s?(t.openBlock(),t.createBlock(t.unref(Gt),{key:1,class:"block h-6 w-6","aria-hidden":"true"})):(t.openBlock(),t.createBlock(t.unref(Id),{key:0,class:"block h-6 w-6","aria-hidden":"true"}))]),_:2},1024)])])]),t.createVNode(t.unref(tc),{class:"sm:hidden"},{default:t.withCtx(()=>[t.createElementVNode("div",gf,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.navigation,i=>(t.openBlock(),t.createElementBlock("a",{key:i.name,href:i.url,class:t.normalizeClass([e(i.url)?"bg-blue-50 border-blue-500 text-blue-700":"border-transparent text-gray-700 hover:bg-gray-50 hover:border-gray-300 hover:text-gray-900","block pl-3 pr-4 py-2 border-l-4 text-base font-semibold"]),"aria-current":e(i.url)?"page":void 0},t.toDisplayString(i.name),11,bf))),128))]),t.createElementVNode("div",yf,[t.createElementVNode("div",wf,[t.createElementVNode("div",xf,[t.createVNode(t.unref(gs),{class:"text-gray-500 h-10 w-10 rounded-full"})]),t.createElementVNode("div",Ef,[o.currentUser.name?(t.openBlock(),t.createElementBlock("div",{key:0,class:"text-base font-medium text-gray-800",textContent:t.toDisplayString(o.currentUser.name)},null,8,Cf)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"text-sm font-medium text-gray-500",textContent:t.toDisplayString(o.currentUser.email)},null,8,kf)])]),t.createElementVNode("div",Df,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.userNavigation,i=>(t.openBlock(),t.createElementBlock("a",{key:i.name,href:i.url,class:"block px-4 py-2 text-base font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-100"},t.toDisplayString(i.name),9,Nf))),128))])])]),_:1})]),_:1}),t.renderSlot(o.$slots,"header"),t.createElementVNode("main",null,[t.createElementVNode("div",Sf,[t.createElementVNode("div",_f,[t.renderSlot(o.$slots,"default")])])])]),t.createVNode(In),t.createVNode(Ln)],64))}}),Vf=n=>n==null,$f={clearSelection(){console.warn("clearSelection() was called on a static table, did you mean to use DynamicTable?")},refresh(){console.warn("refresh() was called on a static table, did you mean to use DynamicTable?")},reset(){console.warn("reset() was called on a static table, did you mean to use DynamicTable?")},selectedData:t.computed(()=>[])},Ds=(n,r,e,o=$f)=>{const a=t.ref(r),s=t.ref(n),i=t.ref(e),c=t.computed(()=>i.value.actions.length>0),l=t.computed(()=>a.value.filter(u=>u.show??!0).map(u=>{let f="";switch((u==null?void 0:u.alignment)||"left"){case"left":f="text-left";break;case"right":f="text-right";break;case"center":f="text-center";break}return{...u,alignment:f}})),d=t.computed(()=>s.value.map((u,f)=>({actions:i.value.actions.map(p=>({...p,disabled:typeof p.disabled=="function"?p.disabled.apply(void 0,[u,f]):p.disabled,onClick:()=>p.onClick(u,f,o),show:typeof p.show=="function"?p.show.apply(void 0,[u,f]):p.show})),rowData:u,cells:l.value.map(p=>{const g=typeof p.render=="function"?p.render.apply(void 0,[u,f]):u[p.render],m=(p==null?void 0:p.classNames)||"";return{...p,isComponent:t.isVNode(g),classNames:typeof m=="function"?m.apply(void 0,[u,f]):m,val:g}})})));return{columns:l,hasActions:c,isEmptyCellValue:Vf,rows:d}},vf={key:0,class:"flex items-center space-x-2 justify-end"},Tf={class:"isolate inline-flex rounded-md shadow-sm"},Mf=["disabled","onClick"],Bf={class:"relative inline-flex items-center gap-x-1.5"},Hr=t.defineComponent({__name:"TableActionButtons",props:{actions:{default:()=>[]}},setup(n){const r=n,{actions:e,hasActions:o}=Aa(t.toRef(r,"actions"));return(a,s)=>t.unref(o)?(t.openBlock(),t.createElementBlock("div",vf,[t.createElementVNode("span",Tf,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(e),(i,c)=>(t.openBlock(),t.createElementBlock("button",{key:c,type:"button",class:t.normalizeClass(["group relative inline-flex items-center bg-white px-3 py-2 text-sm font-semibold text-gray-700 ring-1 ring-inset ring-gray-300 hover:bg-gray-50 focus:z-10 disabled:text-gray-400 disabled:cursor-not-allowed",{"rounded-l-md":c===0,"-ml-px":c>0,"rounded-r-md":c===t.unref(e).length-1}]),disabled:i.disabled,onClick:t.withModifiers(i.onClick,["stop"])},[t.createElementVNode("span",Bf,[i.icon?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.icon),{key:0,class:t.normalizeClass(["-ml-0.5 h-4 w-4 group-disabled:text-gray-300",i.label?"text-gray-400":"text-gray-600"]),"aria-hidden":"true"},null,8,["class"])):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(i.label),1)])],10,Mf))),128))])])):t.createCommentVNode("",!0)}}),Pf={class:"flex flex-col"},Af={class:"-my-2 overflow-x-auto sm:-mx-6 lg:-mx-8"},Of={class:"inline-block min-w-full py-2 align-middle sm:px-6 lg:px-8"},Rf={class:"overflow-hidden border-b border-gray-200 shadow sm:rounded-lg"},If={class:"min-w-full divide-y divide-gray-200"},Lf={class:"bg-gray-100"},Ff={key:0,class:"px-6 py-3 text-xs font-medium tracking-wider text-gray-900 uppercase leading-4"},jf={class:"bg-white"},Hf={key:0,class:"px-6 py-2 text-sm text-gray-700 whitespace-nowrap leading-5"},Uf={key:0},zf=["colspan"],Ns=t.defineComponent({__name:"DataTable",props:{tableActions:{default:()=>({type:"dropdown",actions:[]})},tableColumns:{},tableData:{}},setup(n){const r=n,{columns:e,hasActions:o,isEmptyCellValue:a,rows:s}=Ds(t.toRef(r,"tableData"),t.toRef(r,"tableColumns"),t.toRef(r,"tableActions"));return(i,c)=>(t.openBlock(),t.createElementBlock("div",Pf,[t.createElementVNode("div",Af,[t.createElementVNode("div",Of,[t.createElementVNode("div",Rf,[t.createElementVNode("table",If,[t.createElementVNode("thead",Lf,[t.createElementVNode("tr",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(e),(l,d)=>(t.openBlock(),t.createElementBlock("th",{key:d,class:t.normalizeClass(["px-6 py-3 text-xs font-medium tracking-wider text-gray-900 uppercase leading-4",l.alignment])},t.toDisplayString(l.title),3))),128)),t.unref(o)?(t.openBlock(),t.createElementBlock("th",Ff)):t.createCommentVNode("",!0)])]),t.createElementVNode("tbody",jf,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(s),(l,d)=>(t.openBlock(),t.createElementBlock("tr",{key:d,class:"even:bg-gray-50"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.cells,(u,f)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent("td"),{key:f,class:t.normalizeClass(["px-6 py-4 text-sm text-gray-700 whitespace-nowrap leading-5",u.alignment])},{default:t.withCtx(()=>[u.isComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(u.val),{key:0})):(t.openBlock(),t.createElementBlock("span",{key:1,class:t.normalizeClass(u.classNames)},t.toDisplayString(t.unref(a)(u.val)?"-":String(u.val)),3))]),_:2},1032,["class"]))),128)),t.unref(o)?(t.openBlock(),t.createElementBlock("td",Hf,[i.tableActions.type==="dropdown"?(t.openBlock(),t.createBlock(t.unref(Mn),{key:0,actions:l.actions},null,8,["actions"])):(t.openBlock(),t.createBlock(Hr,{key:1,actions:l.actions},null,8,["actions"]))])):t.createCommentVNode("",!0)]))),128)),t.unref(s).length===0?(t.openBlock(),t.createElementBlock("tr",Uf,[t.createElementVNode("td",{colspan:t.unref(e).length+(t.unref(o)?1:0),class:"px-6 py-4 text-sm text-gray-700 whitespace-nowrap leading-5"}," No items were found! ",8,zf)])):t.createCommentVNode("",!0)])])])])])]))}}),qf={class:"flex items-center justify-center space-x-8"},Wf={class:"font-medium"},Yf={class:"flex items-center space-x-5"},Kf={key:0,class:"block w-2.5 h-2.5 bg-xy-green rounded-full hover:bg-green-900 focus:bg-green-900"},Gf={key:1,class:"relative flex items-center justify-center"},Jf={key:2,href:"#",class:"block w-2.5 h-2.5 bg-gray-200 rounded-full hover:bg-gray-400 focus:bg-gray-400"},Xf={key:0,class:"flex shrink-0"},Zf={key:0,class:"inline-flex rounded-md shadow-sm"},Qf=["textContent"],ep={class:"ml-3 inline-flex rounded-md shadow-sm"},tp=["textContent"],Ss=t.defineComponent({__name:"Steps",props:{hideActions:{type:Boolean,default:!1},hidePrevious:{type:Boolean,default:!1},nextText:{default:"Next"},previousText:{default:"Back"},step:{},total:{}},emits:["next","previous"],setup(n,{emit:r}){const e=r,o=()=>{e("next")},a=()=>{e("previous")};return(s,i)=>(t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("nav",qf,[t.createElementVNode("p",Wf,"Step "+t.toDisplayString(s.step)+" of "+t.toDisplayString(s.total),1),t.createElementVNode("ul",Yf,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.total,c=>(t.openBlock(),t.createElementBlock("li",{key:c},[s.step>c?(t.openBlock(),t.createElementBlock("span",Kf)):s.step===c?(t.openBlock(),t.createElementBlock("div",Gf,i[0]||(i[0]=[t.createElementVNode("span",{class:"absolute w-5 h-5 p-px flex"},[t.createElementVNode("span",{class:"w-full h-full rounded-full bg-green-100"})],-1),t.createElementVNode("span",{class:"relative block w-2.5 h-2.5 bg-xy-green rounded-full"},null,-1)]))):(t.openBlock(),t.createElementBlock("span",Jf))]))),128))])]),s.hideActions?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",Xf,[s.hidePrevious?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",Zf,[t.createElementVNode("button",{type:"button",class:"xy-btn-secondary",onClick:a,textContent:t.toDisplayString(s.previousText)},null,8,Qf)])),t.createElementVNode("span",ep,[t.createElementVNode("button",{type:"button",class:"xy-btn",onClick:o,textContent:t.toDisplayString(s.nextText)},null,8,tp)])]))]))}}),np={class:"flex flex-col mb-4 space-y-4 lg:space-y-0 lg:flex-row lg:justify-between"},rp={key:0,class:"w-full max-w-lg lg:max-w-xs"},op={class:"flex items-center gap-x-2"},ap={class:"flex-1"},sp={key:1,class:"w-full max-w-lg lg:max-w-xs"},ip={class:"flex items-center gap-x-2"},lp={class:"flex-1"},cp={class:"relative z-0 min-w-full align-middle border-b border-gray-200 shadow sm:rounded-lg overflow-x-auto"},dp={class:"min-w-full divide-y divide-gray-200"},up={class:"bg-gray-100"},fp={key:0,scope:"col",class:"pl-6 w-4 leading-none"},pp=["checked","indeterminate"],mp=["onClick"],hp={key:0},gp={key:1},bp={key:0,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",class:"h-5 inline"},yp={key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",class:"h-5 inline"},wp={key:2,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",class:"h-5 inline"},xp={key:1,class:"px-6 py-3 text-xs font-medium tracking-wider text-gray-900 uppercase leading-4"},Ep={key:0},Cp={colspan:"100%",class:"px-6 py-2.5 border-t bg-neutral-50"},kp={class:"flex items-center gap-x-3"},Dp={class:"text-sm shrink-0"},Np={class:"font-medium"},Sp={class:"font-medium"},_p={class:"bg-white"},Vp=["onClick"],$p={key:0,class:"pl-6 w-4 leading-none"},vp=["disabled","value"],Tp={key:1,class:"px-6 py-2 text-sm text-gray-700 whitespace-nowrap leading-5"},Mp={key:0},Bp=["colspan"],Pp={key:0,class:"mt-4"},_s=t.defineComponent({__name:"DynamicTable",props:t.mergeModels({tableActions:{default:()=>({type:"dropdown",actions:[]})},tableBulkActions:{default:()=>({actions:[]})},tableColumns:{},tableOptions:{}},{selected:{required:!1,default:[]},selectedModifiers:{}}),emits:t.mergeModels(["click:row"],["update:selected"]),setup(n,{expose:r}){var pt;const e=n,o=()=>{const B={minDate:d.value.minDate||null,maxDate:d.value.maxDate||null,page:u.value.page,perPage:u.value.perPage,sort:c.value,sortDir:l.value,q:f.value};w(),pr.get(e.tableOptions.url,{skipLoader:!1},B).then(A=>{u.value={page:A.data.page,perPage:A.data.perPage,totalItems:A.data.totalItems,totalPages:A.data.totalPages},i.value=A.data.items},()=>{Lr.genericError()})},a=()=>{u.value.page=1,o()},s=()=>{if(m.value.maxRange){const B=new Date,A=B.setDate(B.getDate()-m.value.maxRange),de=new Date;d.value={minDate:Math.floor(A/1e3),maxDate:Math.floor(de.getTime()/1e3)}}},i=t.ref([]),c=t.ref(e.tableOptions.defaultSort?e.tableOptions.defaultSort:""),l=t.ref(e.tableOptions.defaultSortDirection?e.tableOptions.defaultSortDirection:"desc"),d=t.ref({minDate:0,maxDate:0}),u=t.ref({page:1,perPage:((pt=e.tableOptions)==null?void 0:pt.perPage)||10,totalItems:0,totalPages:0}),f=t.ref(""),p=B=>{B&&(u.value.page=1,d.value=B,o())},g=B=>{c.value==B?l.value=l.value==="desc"?"asc":"desc":(c.value=B,l.value="desc"),o()},m=t.computed(()=>typeof e.tableOptions.dateSearch=="object"?e.tableOptions.dateSearch:{}),y=t.computed(()=>!!Me.value.length),w=()=>{E.value=[]},E=t.useModel(n,"selected"),S=t.computed(()=>i.value.filter(B=>E.value.includes(B==null?void 0:B.id))),N=t.computed(()=>E.value.filter(B=>H.value.includes(B))),P=t.computed(()=>e.tableBulkActions.actions.filter(B=>B.show??!0).map(B=>({...B,disabled:E.value.length===0||B.disabled,onClick:()=>B.onClick.apply(void 0,[E.value,S.value,U])}))),I=t.computed(()=>P.value.length>0),H=t.computed(()=>i.value.filter(B=>B.id===void 0?!1:!!(e.tableBulkActions.isSelectable===void 0||e.tableBulkActions.isSelectable(B))).map(B=>B.id)),T=t.computed(()=>N.value.length>0&&N.value.length===H.value.length),me=t.computed(()=>N.value.length>0&&N.value.length<H.value.length),L=B=>{if(B.target.checked){E.value=H.value.map(de=>de);return}w()},U={clearSelection:w,selectedData:S,refresh:o,reset:a},{columns:G,hasActions:J,isEmptyCellValue:re,rows:Me}=Ds(i,t.toRef(e,"tableColumns"),t.toRef(e,"tableActions"),U);return t.watch(()=>e.tableOptions.refreshTrigger,()=>{o()}),t.watch(()=>e.tableOptions.reloadTrigger,()=>{a()}),r(U),s(),o(),(B,A)=>{var mt;const de=t.resolveComponent("BaseInput");return t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",np,[B.tableOptions.search?(t.openBlock(),t.createElementBlock("div",rp,[A[7]||(A[7]=t.createElementVNode("label",{for:"table-search",class:"sr-only"},"Search",-1)),t.createElementVNode("div",op,[A[6]||(A[6]=t.createElementVNode("div",{"aria-hidden":"true",class:"shrink-0 aspect-square rounded-full bg-gray-50 text-gray-400 h-10 w-10 flex items-center justify-center pointer-events-none"},[t.createElementVNode("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20"},[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z","clip-rule":"evenodd"})])],-1)),t.createElementVNode("div",ap,[t.createVNode(de,{id:"table-search",modelValue:f.value,"onUpdate:modelValue":A[0]||(A[0]=q=>f.value=q),modelModifiers:{trim:!0},type:"search",placeholder:"Search",onChange:A[1]||(A[1]=q=>a())},null,8,["modelValue"])])])])):t.createCommentVNode("",!0),B.tableOptions.dateSearch?(t.openBlock(),t.createElementBlock("div",sp,[A[9]||(A[9]=t.createElementVNode("label",{for:"table-date-range",class:"sr-only"},"Date Range",-1)),t.createElementVNode("div",ip,[A[8]||(A[8]=t.createElementVNode("div",{"aria-hidden":"true",class:"shrink-0 aspect-square rounded-full bg-gray-50 text-gray-400 h-10 w-10 flex items-center justify-center pointer-events-none"},[t.createElementVNode("svg",{class:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})])],-1)),t.createElementVNode("div",lp,[t.createVNode(On,t.mergeProps({id:"table-date-range",modelValue:d.value,"onUpdate:modelValue":A[2]||(A[2]=q=>d.value=q)},{...m.value},{"onUpdate:modelValue":p}),null,16,["modelValue"])])])])):t.createCommentVNode("",!0)]),t.createElementVNode("div",cp,[t.createElementVNode("table",dp,[t.createElementVNode("thead",up,[t.createElementVNode("tr",null,[I.value?(t.openBlock(),t.createElementBlock("th",fp,[t.createElementVNode("input",{class:t.normalizeClass(["h-4 w-4 rounded cursor-pointer","disabled:bg-gray-100 disabled:border-gray-200 disabled:cursor-not-allowed disabled:opacity-100","checked:disabled:bg-xy-blue checked:disabled:border-xy-blue checked:disabled:opacity-50","border-gray-300 focus:ring-xy-blue-500"]),checked:T.value,indeterminate:me.value,type:"checkbox",onChange:L},null,40,pp)])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(G),(q,Ne)=>(t.openBlock(),t.createElementBlock("th",{key:Ne,class:t.normalizeClass(["px-6 py-3 text-xs font-medium tracking-wider text-gray-900 uppercase leading-4",q.alignment])},[t.createElementVNode("div",{class:t.normalizeClass(["inline-flex items-center gap-2",{"cursor-pointer":q.sort}]),onClick:t.withModifiers(Oe=>q.sort?g(q.sort):void 0,["prevent"])},[q.title?(t.openBlock(),t.createElementBlock("span",hp,t.toDisplayString(q.title),1)):t.createCommentVNode("",!0),q.sort?(t.openBlock(),t.createElementBlock("span",gp,[c.value!==q.sort?(t.openBlock(),t.createElementBlock("svg",bp,A[10]||(A[10]=[t.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 9l4-4 4 4m0 6l-4 4-4-4"},null,-1)]))):l.value=="desc"?(t.openBlock(),t.createElementBlock("svg",yp,A[11]||(A[11]=[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M14.707 12.707a1 1 0 01-1.414 0L10 9.414l-3.293 3.293a1 1 0 01-1.414-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 010 1.414z","clip-rule":"evenodd"},null,-1)]))):(t.openBlock(),t.createElementBlock("svg",wp,A[12]||(A[12]=[t.createElementVNode("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)])))])):t.createCommentVNode("",!0)],10,mp)],2))),128)),t.unref(J)?(t.openBlock(),t.createElementBlock("th",xp)):t.createCommentVNode("",!0)]),I.value&&E.value.length>0?(t.openBlock(),t.createElementBlock("tr",Ep,[t.createElementVNode("td",Cp,[t.createElementVNode("div",kp,[t.createElementVNode("div",Dp,[A[13]||(A[13]=t.createTextVNode(" Selected ")),t.createElementVNode("span",Np,t.toDisplayString(N.value.length),1),A[14]||(A[14]=t.createTextVNode(" of ")),t.createElementVNode("span",Sp,t.toDisplayString(H.value.length),1)]),t.createVNode(Hr,{actions:P.value},null,8,["actions"])])])])):t.createCommentVNode("",!0)]),t.createElementVNode("tbody",_p,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(Me),(q,Ne)=>{var Oe,nt;return t.openBlock(),t.createElementBlock("tr",{key:Ne,class:"even:bg-gray-50",onClick:oe=>B.$emit("click:row",q.rowData)},[I.value?(t.openBlock(),t.createElementBlock("td",$p,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":A[3]||(A[3]=oe=>E.value=oe),class:t.normalizeClass(["h-4 w-4 rounded cursor-pointer","disabled:bg-gray-100 disabled:border-gray-200 disabled:cursor-not-allowed disabled:opacity-100","checked:disabled:bg-xy-blue checked:disabled:border-xy-blue checked:disabled:opacity-50","border-gray-300 focus:ring-xy-blue-500"]),disabled:!H.value.includes((Oe=q.rowData)==null?void 0:Oe.id),type:"checkbox",value:(nt=q.rowData)==null?void 0:nt.id},null,8,vp),[[t.vModelCheckbox,E.value]])])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(q.cells,(oe,rt)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent("td"),{key:rt,class:t.normalizeClass(["px-6 py-4 text-sm text-gray-700 whitespace-nowrap leading-5",oe.alignment])},{default:t.withCtx(()=>[oe.isComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(oe.val),{key:0})):(t.openBlock(),t.createElementBlock("span",{key:1,class:t.normalizeClass(oe.classNames)},t.toDisplayString(t.unref(re)(oe.val)?"-":String(oe.val)),3))]),_:2},1032,["class"]))),128)),t.unref(J)?(t.openBlock(),t.createElementBlock("td",Tp,[B.tableActions.type==="dropdown"?(t.openBlock(),t.createBlock(t.unref(Mn),{key:0,actions:q.actions},null,8,["actions"])):(t.openBlock(),t.createBlock(Hr,{key:1,actions:q.actions},null,8,["actions"]))])):t.createCommentVNode("",!0)],8,Vp)}),128)),y.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("tr",Mp,[t.createElementVNode("td",{colspan:t.unref(G).length+(t.unref(J)?1:0),class:"px-6 py-4 text-sm text-gray-700 whitespace-nowrap leading-5"}," No items were found! ",8,Bp)]))])])]),y.value?(t.openBlock(),t.createElementBlock("div",Pp,[t.createVNode(t.unref(Ur),{modelValue:u.value,"onUpdate:modelValue":[A[4]||(A[4]=q=>u.value=q),A[5]||(A[5]=q=>o())],"page-options":(mt=B.tableOptions)==null?void 0:mt.pageOptions},null,8,["modelValue","page-options"])])):t.createCommentVNode("",!0)])}}}),Ap={class:"flex flex-col items-center space-y-3.5 sm:flex-row sm:space-y-0 sm:gap-x-3 sm:justify-center"},Op={class:"text-center text-sm text-neutral-700 sm:text-left sm:mr-auto sm:w-1/3"},Rp={class:"font-medium"},Ip={class:"font-medium"},Lp={class:"font-medium"},Fp={class:"flex flex-col items-center space-y-3.5 sm:flex-row sm:space-y-0 sm:gap-x-3 sm:flex-1"},jp={class:"flex gap-3 items-center justify-center shrink-0 md:w-1/2"},Hp=["disabled"],Up={class:"max-w-[50px]"},zp={class:"text-sm"},qp={class:"font-medium"},Wp=["disabled"],Yp={class:"max-w-[150px] sm:ml-auto"},Ur=t.defineComponent({__name:"TablePaginator",props:t.mergeModels({pageOptions:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const r=n,e=t.useModel(n,"modelValue"),o=t.computed({get:()=>e.value.page,set:u=>{e.value={...e.value,page:u}}}),a=t.computed({get:()=>e.value.perPage,set:u=>{e.value={...e.value,page:1,perPage:u}}}),s=t.computed(()=>r.pageOptions?r.pageOptions:[{label:"5 per page",value:5},{label:"10 per page",value:10},{label:"20 per page",value:20},{label:"50 per page",value:50}]),i=It(u=>{u!==null&&u!==o.value&&(o.value=u)},350),c=It(()=>{o.value<=1||(o.value=o.value-1)},250),l=It(()=>{o.value>=e.value.totalPages||(o.value=o.value+1)},250),d=t.computed(()=>{const{page:u,perPage:f,totalItems:p}=e.value;return{start:p>0?(u-1)*f+1:0,end:Math.min(u*f,p)}});return(u,f)=>(t.openBlock(),t.createElementBlock("div",Ap,[t.createElementVNode("p",Op,[f[3]||(f[3]=t.createTextVNode(" Showing ")),t.createElementVNode("span",Rp,t.toDisplayString(d.value.start),1),f[4]||(f[4]=t.createTextVNode(" to ")),t.createElementVNode("span",Ip,t.toDisplayString(d.value.end),1),f[5]||(f[5]=t.createTextVNode(" of ")),t.createElementVNode("span",Lp,t.toDisplayString(e.value.totalItems),1),f[6]||(f[6]=t.createTextVNode(" results "))]),t.createElementVNode("div",Fp,[t.createElementVNode("div",jp,[t.createElementVNode("button",{class:"xy-btn-neutral",disabled:o.value<=1,type:"button",onClick:f[0]||(f[0]=t.withModifiers(p=>o.value--,["prevent"]))},f[7]||(f[7]=[t.createTextVNode(" ← "),t.createElementVNode("span",{class:"sr-only"},"Previous",-1)]),8,Hp),t.createElementVNode("div",Up,[t.createVNode(t.unref(Jr),{"model-value":o.value,min:1,max:e.value.totalPages,type:"number","onUpdate:modelValue":t.unref(i),onKeydown:[t.withKeys(t.withModifiers(t.unref(c),["prevent"]),["down"]),t.withKeys(t.withModifiers(t.unref(l),["prevent"]),["up"])]},null,8,["model-value","max","onUpdate:modelValue","onKeydown"])]),t.createElementVNode("div",zp,[f[8]||(f[8]=t.createTextVNode(" of ")),t.createElementVNode("span",qp,t.toDisplayString(e.value.totalPages),1)]),t.createElementVNode("button",{class:"xy-btn-neutral",disabled:o.value>=e.value.totalPages,type:"button",onClick:f[1]||(f[1]=t.withModifiers(p=>o.value++,["prevent"]))},f[9]||(f[9]=[t.createElementVNode("span",{class:"sr-only"},"Next",-1),t.createTextVNode(" → ")]),8,Wp)]),t.createElementVNode("div",Yp,[t.createVNode(t.unref(Rn),{modelValue:a.value,"onUpdate:modelValue":f[2]||(f[2]=p=>a.value=p),options:s.value},null,8,["modelValue","options"])])])]))}}),Kp={class:"hidden sm:block"},Gp=["onClick","textContent"],Vs=t.defineComponent({__name:"Tabs",props:t.mergeModels({pillDesign:{type:Boolean,default:!1},tabs:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const r=n,e=t.useModel(n,"modelValue"),o=(s,i)=>{let c="";return r.pillDesign?(c="px-12 py-2 font-semibold text-md leading-5 rounded-t-md focus:outline-none ",e.value===s?c=c+"focus:bg-white text-gray-700 bg-white border-b-2 border-blue-500":c=c+"text-gray-700 hover:text-gray-900 focus:text-gray-900 focus:bg-gray-100 border border-gray-200",c):(c="px-1 py-4 text-sm font-semibold border-b-2 whitespace-nowrap leading-5 focus:outline-none ",e.value===s?c=c+"border-blue-500 text-xy-blue focus:text-blue-800 focus:border-blue-700":c=c+"border-transparent text-gray-700 hover:text-gray-900 hover:border-gray-300 focus:text-gray-900 focus:border-gray-300",i&&(c=c+" ml-8"),c)},a=t.computed(()=>!r.pillDesign);return(s,i)=>{const c=t.resolveComponent("Select");return t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",{class:t.normalizeClass(["sm:hidden",{"mb-4":s.pillDesign}])},[i[1]||(i[1]=t.createElementVNode("label",{for:"tabs",class:"sr-only"},"Select a tab",-1)),t.createVNode(c,{modelValue:e.value,"onUpdate:modelValue":i[0]||(i[0]=l=>e.value=l),name:"tabs",options:s.tabs},null,8,["modelValue","options"])],2),t.createElementVNode("div",Kp,[t.createElementVNode("div",{class:t.normalizeClass({"border-b border-gray-200":a.value})},[t.createElementVNode("nav",{class:t.normalizeClass(["flex",[s.pillDesign?"ml-8":"-mb-px"]])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.tabs,(l,d)=>(t.openBlock(),t.createElementBlock("a",{key:d,href:"#",class:t.normalizeClass(o(l.value,d>0)),onClick:t.withModifiers(u=>e.value=l.value,["prevent"]),textContent:t.toDisplayString(l.label)},null,10,Gp))),128))],2)],2)])])}}}),Jp={key:0,class:"sr-only"},Xp={class:"ml-3 mt-0.5"},$s=t.defineComponent({inheritAttrs:!1,__name:"Toggle",props:t.mergeModels({label:{default:""},help:{default:""}},{modelValue:{type:Boolean,...Z},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const r=t.useModel(n,"modelValue",Z),e=t.useAttrs(),o=t.computed(()=>mr(e,"disabled"));return(a,s)=>(t.openBlock(),t.createBlock(t.unref(uc),{as:"div",class:"flex items-start"},{default:t.withCtx(()=>[t.createVNode(t.unref(fc),{modelValue:r.value,"onUpdate:modelValue":s[0]||(s[0]=i=>r.value=i),class:t.normalizeClass([r.value?"bg-xy-blue":"bg-gray-200",o.value?"opacity-75 cursor-not-allowed":"cursor-pointer","relative inline-flex shrink-0 h-6 w-11 border-2 border-transparent rounded-full transition-colors ease-in-out duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-xy-blue-500"]),disabled:o.value},{default:t.withCtx(()=>[a.label?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",Jp,"Use")),t.createElementVNode("span",{"aria-hidden":"true",class:t.normalizeClass([r.value?"translate-x-5":"translate-x-0","pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform ring-0 transition ease-in-out duration-200"])},null,2)]),_:1},8,["modelValue","class","disabled"]),t.createElementVNode("div",Xp,[a.label?(t.openBlock(),t.createBlock(t.unref(pc),{key:0},{default:t.withCtx(()=>[t.createVNode(be,{label:a.label,class:t.normalizeClass(o.value?"cursor-not-allowed":"cursor-pointer")},null,8,["label","class"])]),_:1})):t.createCommentVNode("",!0),a.help?(t.openBlock(),t.createBlock(t.unref(mc),{key:1},{default:t.withCtx(()=>[t.createVNode(ce,{text:a.help},null,8,["text"])]),_:1})):t.createCommentVNode("",!0)])]),_:1}))}}),Zp={"aria-label":"Progress"},Qp={role:"list",class:"flex items-center"},em={class:"absolute inset-0 flex items-center","aria-hidden":"true"},tm=["aria-current"],nm={key:1,class:"h-3 w-3 rounded-full bg-xy-blue","aria-hidden":"true"},rm={class:"sr-only"},om={key:2,class:"sr-only"},vs=t.defineComponent({__name:"ProgressCircles",props:{current:{},steps:{}},setup(n){const r=n,e=t.computed(()=>r.steps.map((o,a)=>{let s;return r.current>a?s="complete":r.current===a?s="current":s="incomplete",{name:o.name,description:(o==null?void 0:o.description)||"",status:s}}));return(o,a)=>(t.openBlock(),t.createElementBlock("nav",Zp,[t.createElementVNode("ol",Qp,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.value,(s,i)=>(t.openBlock(),t.createElementBlock("li",{key:s.name,class:t.normalizeClass([i!==e.value.length-1?"pr-8":"","relative"])},[t.createElementVNode("div",em,[t.createElementVNode("div",{class:t.normalizeClass(["h-0.5 w-full",s.status==="complete"?"bg-xy-blue":"bg-gray-300"])},null,2)]),t.createElementVNode("div",{class:t.normalizeClass({"relative flex h-5 w-5 items-center justify-center rounded-full":!0,"bg-xy-blue":s.status==="complete","border-2 border-indigo-600 bg-white":s.status==="current","border-2 border-gray-300 bg-white":s.status==="incomplete"}),"aria-current":s.status==="current"?!0:void 0},[s.status==="complete"?(t.openBlock(),t.createBlock(t.unref(Pa),{key:0,class:"h-3 w-3 text-white","aria-hidden":"true"})):s.status==="current"?(t.openBlock(),t.createElementBlock("span",nm)):t.createCommentVNode("",!0),t.createElementVNode("span",rm,t.toDisplayString(s.name),1),s.description?(t.openBlock(),t.createElementBlock("span",om,t.toDisplayString(s.description),1)):t.createCommentVNode("",!0)],10,tm)],2))),128))])]))}}),am={"aria-label":"Progress"},sm={role:"list",class:"overflow-hidden"},im=["aria-current"],lm={class:"flex h-9 items-center"},cm={key:1,class:"h-2.5 w-2.5 rounded-full bg-xy-blue"},dm={class:"ml-4 flex min-w-0 flex-col"},um={key:0,class:"text-sm text-gray-600"},Ts=t.defineComponent({__name:"ProgressCirclesLabeled",props:{current:{},steps:{}},setup(n){const r=n,e=t.computed(()=>r.steps.map((o,a)=>{let s;return r.current>a?s="complete":r.current===a?s="current":s="incomplete",{name:o.name,description:(o==null?void 0:o.description)||"",status:s}}));return(o,a)=>(t.openBlock(),t.createElementBlock("div",am,[t.createElementVNode("ol",sm,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.value,(s,i)=>(t.openBlock(),t.createElementBlock("li",{key:i,class:t.normalizeClass([i!==e.value.length-1?"pb-6":"","relative"])},[i!==e.value.length-1?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["absolute left-3 top-3 -ml-px mt-0.5 h-full w-0.5",s.status==="complete"?"bg-xy-blue":"bg-gray-300"]),"aria-hidden":"true"},null,2)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"group relative flex items-start","aria-current":s.status==="current"?!0:void 0},[t.createElementVNode("span",lm,[t.createElementVNode("span",{class:t.normalizeClass({"relative z-10 flex h-6 w-6 items-center justify-center rounded-full":!0,"bg-xy-blue ":s.status==="complete","border-2 border-xy-blue bg-white":s.status==="current","border-2 border-gray-300 bg-white":s.status==="incomplete"})},[s.status==="complete"?(t.openBlock(),t.createBlock(t.unref(Pa),{key:0,class:"h-4 w-4 text-white","aria-hidden":"true"})):s.status==="current"?(t.openBlock(),t.createElementBlock("span",cm)):t.createCommentVNode("",!0)],2)]),t.createElementVNode("span",dm,[t.createElementVNode("span",{class:t.normalizeClass({"text-sm font-bold":!0,"text-gray-800":s.status==="complete","text-xy-blue":s.status==="current","text-gray-600":s.status==="incomplete","mt-2":!s.description})},t.toDisplayString(s.name),3),s.description?(t.openBlock(),t.createElementBlock("span",um,t.toDisplayString(s.description),1)):t.createCommentVNode("",!0)])],8,im)],2))),128))])]))}}),fm=["id","aria-labelledby","aria-describedby","aria-errormessage","placeholder","type"],Ms=t.defineComponent({inheritAttrs:!1,__name:"BaseInput",props:t.mergeModels(t.mergeDefaults({modelValue:{},type:{},label:{},help:{},placeholder:{}},Le),{modelValue:{...Z,set:n=>props.type==="number"?hr(n):n},modelModifiers:{}}),emits:["update:modelValue"],setup(n,{expose:r}){const e=n,o=t.useModel(n,"modelValue",{...Z,set:f=>e.type==="number"?hr(f):f}),a=t.useTemplateRef("input"),{errorState:s,inputID:i,isRequired:c,onInvalid:l,inputValidation:d}=Be(e);r({input:a});const u=t.computed(()=>{switch(e.type){case"number":return{max:Number.MAX_SAFE_INTEGER,min:Number.MIN_SAFE_INTEGER};case"email":return{pattern:Ko};case"tel":return{pattern:Go};case"url":return{pattern:Jo};default:return{}}});return(f,p)=>(t.openBlock(),t.createElementBlock("div",null,[t.createVNode(be,{id:`${t.unref(i)}-label`,class:"mb-2",for:t.unref(i),label:f.label,required:t.unref(c)},null,8,["id","for","label","required"]),t.withDirectives(t.createElementVNode("input",t.mergeProps({id:t.unref(i),ref:"input","onUpdate:modelValue":p[0]||(p[0]=g=>o.value=g),"aria-labelledby":f.label?`${t.unref(i)}-label`:void 0,"aria-describedby":f.help?`${t.unref(i)}-help`:void 0,"aria-errormessage":t.unref(s)?`${t.unref(i)}-error`:void 0,class:["block w-full rounded-md border-0 py-2 shadow-sm ring-1 ring-inset focus:ring-2 sm:text-sm sm:leading-6","disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-700 disabled:ring-gray-200",t.unref(s)?"text-red-900 ring-red-700 placeholder:text-red-300 focus:ring-red-700":"text-gray-900 ring-gray-300 placeholder:text-gray-400 focus:ring-xy-blue-500"],placeholder:f.placeholder,type:f.type},{...u.value,...f.$attrs},{onInput:p[1]||(p[1]=(...g)=>t.unref(d)&&t.unref(d)(...g)),onInvalid:p[2]||(p[2]=(...g)=>t.unref(l)&&t.unref(l)(...g))}),null,16,fm),[[t.vModelDynamic,o.value,void 0,{trim:!0}]]),t.createVNode(ce,{id:`${t.unref(i)}-help`,class:"mt-1",text:f.help},null,8,["id","text"]),t.createVNode($e,{id:`${t.unref(i)}-error`,class:"mt-0.5",text:t.unref(s)},null,8,["id","text"])]))}}),pm={class:"relative flex items-start"},mm={class:"flex items-center h-5"},hm=["id","aria-labelledby","aria-describedby","aria-errormessage","checked"],gm={class:"ml-3"},Bs=t.defineComponent({inheritAttrs:!1,__name:"Checkbox",props:t.mergeModels(t.mergeDefaults({modelValue:{type:[Boolean,null]},label:{},help:{},placeholder:{}},Le),{modelValue:{type:[Boolean,null],...Z},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const r=n,e=t.useModel(n,"modelValue",Z),{aria:o,inputID:a,isDisabled:s,isRequired:i,errorState:c,validate:l,onInvalid:d}=Be(r);return(u,f)=>(t.openBlock(),t.createElementBlock("div",pm,[t.createElementVNode("div",mm,[t.withDirectives(t.createElementVNode("input",t.mergeProps({id:t.unref(a),"onUpdate:modelValue":f[0]||(f[0]=p=>e.value=p),"aria-labelledby":t.unref(o).labelledby,"aria-describedby":t.unref(o).describedby,"aria-errormessage":t.unref(o).errormessage,checked:e.value||void 0,class:["h-4 w-4 rounded text-xy-blue cursor-pointer","disabled:bg-gray-100 disabled:border-gray-200 disabled:cursor-not-allowed disabled:opacity-100","checked:disabled:bg-xy-blue checked:disabled:border-xy-blue checked:disabled:opacity-50",t.unref(c)?"border-red-700 focus:ring-red-700":"border-gray-300 focus:ring-xy-blue-500"],type:"checkbox"},u.$attrs,{onChange:f[1]||(f[1]=(...p)=>t.unref(l)&&t.unref(l)(...p)),onInvalid:f[2]||(f[2]=(...p)=>t.unref(d)&&t.unref(d)(...p))}),null,16,hm),[[t.vModelCheckbox,e.value]])]),t.createElementVNode("div",gm,[t.createVNode(be,{id:t.unref(o).labelledby,for:t.unref(a),label:u.label,class:t.normalizeClass(t.unref(s)?"cursor-not-allowed":"cursor-pointer"),required:t.unref(i)},null,8,["id","for","label","class","required"]),t.createVNode(ce,{id:t.unref(o).describedby,text:u.help},null,8,["id","text"]),t.createVNode($e,{id:t.unref(o).errormessage,class:"mt-0.5",text:t.unref(c)},null,8,["id","text"])])]))}}),bm=["id","aria-labelledby","aria-describedby","aria-errormessage","placeholder"],Ps=t.defineComponent({inheritAttrs:!1,__name:"DateTimeInput",props:t.mergeModels(t.mergeDefaults({modelValue:{},label:{},help:{},placeholder:{}},Le),{modelValue:{...Z,get:n=>n&&Xo(n),set:n=>n&&new Date(n).toISOString()},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const r=n,e=t.useModel(n,"modelValue",{...Z,get:l=>l&&Xo(l),set:l=>l&&new Date(l).toISOString()}),{errorState:o,inputID:a,isRequired:s,onInvalid:i,inputValidation:c}=Be(r);return(l,d)=>(t.openBlock(),t.createElementBlock("div",null,[t.createVNode(be,{id:`${t.unref(a)}-label`,class:"mb-2",for:t.unref(a),label:l.label,required:t.unref(s)},null,8,["id","for","label","required"]),t.withDirectives(t.createElementVNode("input",t.mergeProps({id:t.unref(a),"onUpdate:modelValue":d[0]||(d[0]=u=>e.value=u),"aria-labelledby":l.label?`${t.unref(a)}-label`:void 0,"aria-describedby":l.help?`${t.unref(a)}-help`:void 0,"aria-errormessage":t.unref(o)?`${t.unref(a)}-error`:void 0,class:["block w-full rounded-md border-0 py-2 shadow-sm ring-1 ring-inset focus:ring-2 sm:text-sm sm:leading-6","disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-700 disabled:ring-gray-200",t.unref(o)?"text-red-900 ring-red-700 placeholder:text-red-300 focus:ring-red-700":"text-gray-900 ring-gray-300 placeholder:text-gray-400 focus:ring-xy-blue-500"],placeholder:l.placeholder,type:"datetime-local"},l.$attrs,{onInput:d[1]||(d[1]=(...u)=>t.unref(c)&&t.unref(c)(...u)),onInvalid:d[2]||(d[2]=(...u)=>t.unref(i)&&t.unref(i)(...u))}),null,16,bm),[[t.vModelText,e.value]]),t.createVNode(ce,{id:`${t.unref(a)}-help`,class:"mt-1",text:l.help},null,8,["id","text"]),t.createVNode($e,{id:`${t.unref(a)}-error`,class:"mt-0.5",text:t.unref(o)},null,8,["id","text"])]))}}),ym={key:0,class:"text-red-700/80"},Tt=t.defineComponent({__name:"FieldsetLegend",props:{label:{default:""},required:{type:Boolean,default:!1},tag:{default:"legend"}},setup(n){const r=n,e=t.computed(()=>r.required&&/\*$/gm.exec(r.label)!==null?r.label.substring(0,r.label.length-1):r.label);return(o,a)=>o.label?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.tag),t.mergeProps({key:0,class:"block text-sm leading-6 font-semibold text-gray-800"},o.$attrs),{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.value),1),r.required?(t.openBlock(),t.createElementBlock("span",ym,"*")):t.createCommentVNode("",!0)]),_:1},16)):t.createCommentVNode("",!0)}}),wm=["aria-labelledby","aria-describedby","aria-errormessage"],xm={key:0},Em={class:"flex"},Cm={class:"flex items-center h-5"},km=["id","aria-labelledby","aria-describedby","disabled","value"],Dm={class:"ml-3"},As=t.defineComponent({inheritAttrs:!1,__name:"MultiCheckboxes",props:t.mergeModels(t.mergeDefaults({max:{},min:{},modelValue:{},options:{},label:{},help:{},placeholder:{},columns:{}},Le),{modelValue:{...Z,get:n=>Array.isArray(n)?n:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const r=n,e=t.useModel(n,"modelValue",{...Z,get:g=>Array.isArray(g)?g:[]}),{aria:o,inputID:a,isDisabled:s,errorState:i,validate:c}=Be(r),l=t.computed(()=>r.min||null),d=t.computed(()=>r.max||null),u=t.computed(()=>{var m;const g=((m=e.value)==null?void 0:m.length)||0;return l.value!==null&&g<l.value?`Please select at least ${l.value} of these options.`:d.value!==null&&g>d.value?`Please limit your selection to ${d.value} of these options.`:l.value!==null&&d.value!==null&&(g<l.value||g>d.value)?`Please select between ${l.value} and ${d.value} of these options.`:""}),f=t.useTemplateRef("errorInput"),p=()=>{var g;i.value||(i.value=u.value,(g=f.value)==null||g.setCustomValidity(u.value))};return(g,m)=>(t.openBlock(),t.createElementBlock("fieldset",{class:"relative space-y-6","aria-labelledby":t.unref(o).labelledby,"aria-describedby":t.unref(o).describedby,"aria-errormessage":t.unref(o).errormessage},[g.label?(t.openBlock(),t.createElementBlock("div",xm,[t.createVNode(Tt,{id:t.unref(o).labelledby,label:g.label,required:!!l.value},null,8,["id","label","required"]),g.help?(t.openBlock(),t.createBlock(ce,{key:0,id:t.unref(o).describedby,class:"mt-1",tag:"p",text:g.help},null,8,["id","text"])):t.createCommentVNode("",!0),t.createVNode($e,{id:t.unref(o).errormessage,class:"mt-1",text:t.unref(i)},null,8,["id","text"])])):t.createCommentVNode("",!0),t.createElementVNode("div",Em,[t.createElementVNode("div",{class:t.normalizeClass(["grid gap-y-5",{"sm:grid sm:gap-x-10":g.columns!==void 0,"sm:grid-cols-2":g.columns===2,"sm:grid-cols-3":g.columns===3}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(g.options,(y,w)=>(t.openBlock(),t.createElementBlock("div",{key:y.value,class:"flex items-start"},[t.createElementVNode("div",Cm,[t.withDirectives(t.createElementVNode("input",t.mergeProps({id:`${t.unref(a)}-${w}`,"onUpdate:modelValue":m[0]||(m[0]=E=>e.value=E),"aria-labelledby":`${t.unref(a)}-${w}-label`,"aria-describedby":y.help?`${t.unref(a)}-${w}-help`:void 0,disabled:y.disabled,class:["h-4 w-4 rounded cursor-pointer","disabled:bg-gray-100 disabled:border-gray-200 disabled:cursor-not-allowed disabled:opacity-100","checked:disabled:bg-xy-blue checked:disabled:border-xy-blue checked:disabled:opacity-50",t.unref(i)?"border-red-700 focus:ring-red-700":"border-gray-300 focus:ring-xy-blue-500"],type:"checkbox",value:y.value,ref_for:!0},g.$attrs,{onChange:m[1]||(m[1]=(...E)=>t.unref(c)&&t.unref(c)(...E))}),null,16,km),[[t.vModelCheckbox,e.value]])]),t.createElementVNode("div",Dm,[t.createVNode(be,{id:`${t.unref(a)}-${w}-label`,for:`${t.unref(a)}-${w}`,label:y.label,class:t.normalizeClass(t.unref(s)||y.disabled?"cursor-not-allowed":"cursor-pointer")},null,8,["id","for","label","class"]),t.createVNode(ce,{id:`${t.unref(a)}-${w}-help`,text:y.help},null,8,["id","text"])])]))),128))],2)]),u.value?(t.openBlock(),t.createElementBlock("input",{key:1,ref:"errorInput",required:"",class:"sr-only top-1 left-1","aria-hidden":"",type:"checkbox",onInvalid:p},null,544)):t.createCommentVNode("",!0)],8,wm))}});function Os(n){const{anchorOffset:r=0,focusOffset:e=0}=n.ownerDocument.getSelection()||{},o=Math.min(r,e),a=Math.max(r,e);return[o,a]}function Nm(n,[r,e]){var o,a,s,i;const c=n.ownerDocument,l=c.createRange();l.setStart(n.firstChild||n,Math.min(r,(a=(o=n.textContent)===null||o===void 0?void 0:o.length)!==null&&a!==void 0?a:0)),l.setEnd(n.lastChild||n,Math.min(e,(i=(s=n.textContent)===null||s===void 0?void 0:s.length)!==null&&i!==void 0?i:0));const d=c.getSelection();d&&(d.removeAllRanges(),d.addRange(l))}class Sm{constructor(r){this.element=r,this.maxLength=1/0}get value(){return this.element.innerText.replace(/\n\n$/,`
|
|
17
17
|
`)}set value(r){this.element.innerHTML=r.replace(/\n$/,`
|
package/package.json
CHANGED
|
@@ -43,7 +43,7 @@ function isValidPickerRange(val: any): val is DateRange {
|
|
|
43
43
|
)
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
// NOTE(spk): use watcher.
|
|
46
|
+
// NOTE(spk): use watcher.pause() and watcher.resume() when mutating
|
|
47
47
|
// state inside this component to avoid setting the picker value
|
|
48
48
|
// after the state was mutated by the picker itself
|
|
49
49
|
//
|
|
@@ -65,7 +65,7 @@ const { aria, errorState, inputID, isRequired, onInvalid, validate } =
|
|
|
65
65
|
useInputField(props)
|
|
66
66
|
|
|
67
67
|
const updateModelState = (value: { minDate: number; maxDate: number }) => {
|
|
68
|
-
watcher.
|
|
68
|
+
watcher.pause()
|
|
69
69
|
modelState.value = value
|
|
70
70
|
watcher.resume()
|
|
71
71
|
}
|
|
@@ -76,7 +76,7 @@ let picker: Instance | null = null
|
|
|
76
76
|
|
|
77
77
|
onMounted(() => {
|
|
78
78
|
const opts: flatpickr.Options.Options = {
|
|
79
|
-
allowInput:
|
|
79
|
+
allowInput: !props.maxRange,
|
|
80
80
|
appendTo: wrapperRef.value || undefined,
|
|
81
81
|
dateFormat: "m-d-Y",
|
|
82
82
|
mode: "range",
|