playbook_ui 15.7.0.pre.rc.2 → 15.7.0.pre.rc.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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +16 -4
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.html.erb +23 -14
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range_pattern_rails.md +1 -1
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible.html.erb +71 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible.jsx +57 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible_rails.md +1 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_overflow_visible_react.md +1 -0
- data/app/pb_kits/playbook/pb_dialog/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_dialog/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default_rails.html.erb +7 -5
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_default_dates.html.erb +19 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_rails.html.erb +12 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_rails.md +26 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_range_end_rails.html.erb +19 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_range_end_rails.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers_default_rails.html.erb +30 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers_default_rails.md +3 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers_rails.html.erb +29 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_quickpick_with_date_pickers_rails.md +13 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.html.erb +3 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +5 -0
- data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +4 -0
- data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +39 -5
- data/app/pb_kits/playbook/pb_dropdown/index.js +171 -3
- data/app/pb_kits/playbook/pb_dropdown/quickpick_helper.rb +75 -0
- data/dist/chunks/{_typeahead-CHwm9MTE.js → _typeahead-CbjBmIDu.js} +1 -1
- data/dist/chunks/{lib-Cugvy62C.js → lib-DxDBrGZX.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +18 -4
|
@@ -26,4 +26,4 @@ object-assign
|
|
|
26
26
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
27
27
|
PERFORMANCE OF THIS SOFTWARE.
|
|
28
28
|
***************************************************************************** */
|
|
29
|
-
var __assign2=function(){__assign2=Object.assign||function __assign3(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};return __assign2.apply(this,arguments)};var monthToStr2=function(monthNumber,shorthand,locale){return locale.months[shorthand?"shorthand":"longhand"][monthNumber]};function clearNode2(node){while(node.firstChild)node.removeChild(node.firstChild)}function getEventTarget2(event){try{if(typeof event.composedPath==="function"){var path=event.composedPath();return path[0]}return event.target}catch(error2){return event.target}}var defaultConfig={shorthand:false,dateFormat:"F Y",altFormat:"F Y",theme:"light"};function monthSelectPlugin2(pluginConfig){var config=__assign2(__assign2({},defaultConfig),pluginConfig);return function(fp){fp.config.dateFormat=config.dateFormat;fp.config.altFormat=config.altFormat;var self={monthsContainer:null};function clearUnnecessaryDOMElements(){if(!fp.rContainer)return;clearNode2(fp.rContainer);for(var index=0;index<fp.monthElements.length;index++){var element=fp.monthElements[index];if(!element.parentNode)continue;element.parentNode.removeChild(element)}}function build(){if(!fp.rContainer)return;self.monthsContainer=fp._createElement("div","flatpickr-monthSelect-months");self.monthsContainer.tabIndex=-1;buildMonths();fp.rContainer.appendChild(self.monthsContainer);fp.calendarContainer.classList.add("flatpickr-monthSelect-theme-"+config.theme)}function buildMonths(){if(!self.monthsContainer)return;clearNode2(self.monthsContainer);var frag=document.createDocumentFragment();for(var i=0;i<12;i++){var month=fp.createDay("flatpickr-monthSelect-month",new Date(fp.currentYear,i),0,i);if(month.dateObj.getMonth()===(new Date).getMonth()&&month.dateObj.getFullYear()===(new Date).getFullYear())month.classList.add("today");month.textContent=monthToStr2(i,config.shorthand,fp.l10n);month.addEventListener("click",selectMonth);frag.appendChild(month)}self.monthsContainer.appendChild(frag);if(fp.config.minDate&&fp.currentYear===fp.config.minDate.getFullYear())fp.prevMonthNav.classList.add("flatpickr-disabled");else fp.prevMonthNav.classList.remove("flatpickr-disabled");if(fp.config.maxDate&&fp.currentYear===fp.config.maxDate.getFullYear())fp.nextMonthNav.classList.add("flatpickr-disabled");else fp.nextMonthNav.classList.remove("flatpickr-disabled")}function bindEvents(){fp._bind(fp.prevMonthNav,"click",(function(e){e.preventDefault();e.stopPropagation();fp.changeYear(fp.currentYear-1);selectYear();buildMonths()}));fp._bind(fp.nextMonthNav,"click",(function(e){e.preventDefault();e.stopPropagation();fp.changeYear(fp.currentYear+1);selectYear();buildMonths()}));fp._bind(self.monthsContainer,"mouseover",(function(e){if(fp.config.mode==="range")fp.onMouseOver(getEventTarget2(e),"flatpickr-monthSelect-month")}))}function setCurrentlySelected(){if(!fp.rContainer)return;if(!fp.selectedDates.length)return;var currentlySelected=fp.rContainer.querySelectorAll(".flatpickr-monthSelect-month.selected");for(var index=0;index<currentlySelected.length;index++){currentlySelected[index].classList.remove("selected")}var targetMonth=fp.selectedDates[0].getMonth();var month=fp.rContainer.querySelector(".flatpickr-monthSelect-month:nth-child("+(targetMonth+1)+")");if(month){month.classList.add("selected")}}function selectYear(){var selectedDate=fp.selectedDates[0];if(selectedDate){selectedDate=new Date(selectedDate);selectedDate.setFullYear(fp.currentYear);if(fp.config.minDate&&selectedDate<fp.config.minDate){selectedDate=fp.config.minDate}if(fp.config.maxDate&&selectedDate>fp.config.maxDate){selectedDate=fp.config.maxDate}fp.currentYear=selectedDate.getFullYear()}fp.currentYearElement.value=String(fp.currentYear);if(fp.rContainer){var months2=fp.rContainer.querySelectorAll(".flatpickr-monthSelect-month");months2.forEach((function(month){month.dateObj.setFullYear(fp.currentYear);if(fp.config.minDate&&month.dateObj<fp.config.minDate||fp.config.maxDate&&month.dateObj>fp.config.maxDate){month.classList.add("flatpickr-disabled")}else{month.classList.remove("flatpickr-disabled")}}))}setCurrentlySelected()}function selectMonth(e){e.preventDefault();e.stopPropagation();var eventTarget=getEventTarget2(e);if(!(eventTarget instanceof Element))return;if(eventTarget.classList.contains("flatpickr-disabled"))return;if(eventTarget.classList.contains("notAllowed"))return;setMonth(eventTarget.dateObj);if(fp.config.closeOnSelect){var single=fp.config.mode==="single";var range=fp.config.mode==="range"&&fp.selectedDates.length===2;if(single||range)fp.close()}}function setMonth(date){var selectedDate=new Date(fp.currentYear,date.getMonth(),date.getDate());var selectedDates=[];switch(fp.config.mode){case"single":selectedDates=[selectedDate];break;case"multiple":selectedDates.push(selectedDate);break;case"range":if(fp.selectedDates.length===2){selectedDates=[selectedDate]}else{selectedDates=fp.selectedDates.concat([selectedDate]);selectedDates.sort((function(a,b){return a.getTime()-b.getTime()}))}break}fp.setDate(selectedDates,true);setCurrentlySelected()}var shifts={37:-1,39:1,40:3,38:-3};function onKeyDown(_,__,___,e){var shouldMove=shifts[e.keyCode]!==void 0;if(!shouldMove&&e.keyCode!==13){return}if(!fp.rContainer||!self.monthsContainer)return;var currentlySelected=fp.rContainer.querySelector(".flatpickr-monthSelect-month.selected");var index=Array.prototype.indexOf.call(self.monthsContainer.children,document.activeElement);if(index===-1){var target=currentlySelected||self.monthsContainer.firstElementChild;target.focus();index=target.$i}if(shouldMove){self.monthsContainer.children[(12+index+shifts[e.keyCode])%12].focus()}else if(e.keyCode===13&&self.monthsContainer.contains(document.activeElement)){setMonth(document.activeElement.dateObj)}}function closeHook(){var _a;if(((_a=fp.config)===null||_a===void 0?void 0:_a.mode)==="range"&&fp.selectedDates.length===1)fp.clear(false);if(!fp.selectedDates.length)buildMonths()}function stubCurrentMonth(){config._stubbedCurrentMonth=fp._initialDate.getMonth();fp._initialDate.setMonth(config._stubbedCurrentMonth);fp.currentMonth=config._stubbedCurrentMonth}function unstubCurrentMonth(){if(!config._stubbedCurrentMonth)return;fp._initialDate.setMonth(config._stubbedCurrentMonth);fp.currentMonth=config._stubbedCurrentMonth;delete config._stubbedCurrentMonth}function destroyPluginInstance(){if(self.monthsContainer!==null){var months2=self.monthsContainer.querySelectorAll(".flatpickr-monthSelect-month");for(var index=0;index<months2.length;index++){months2[index].removeEventListener("click",selectMonth)}}}return{onParseConfig:function(){fp.config.enableTime=false},onValueUpdate:setCurrentlySelected,onKeyDown:onKeyDown,onReady:[stubCurrentMonth,clearUnnecessaryDOMElements,build,bindEvents,setCurrentlySelected,function(){fp.config.onClose.push(closeHook);fp.loadedPlugins.push("monthSelect")}],onDestroy:[unstubCurrentMonth,destroyPluginInstance,function(){fp.config.onClose=fp.config.onClose.filter((function(hook){return hook!==closeHook}))}]}}}return monthSelectPlugin2}))})(monthSelect$1);return monthSelect$1.exports}var monthSelectExports=requireMonthSelect();const monthSelectPlugin=getDefaultExportFromCjs(monthSelectExports);var weekSelect$2={exports:{}};var weekSelect$1=weekSelect$2.exports;var hasRequiredWeekSelect;function requireWeekSelect(){if(hasRequiredWeekSelect)return weekSelect$2.exports;hasRequiredWeekSelect=1;(function(module,exports){(function(global,factory){module.exports=factory()})(weekSelect$1,(function(){function getEventTarget2(event){try{if(typeof event.composedPath==="function"){var path=event.composedPath();return path[0]}return event.target}catch(error2){return event.target}}function weekSelectPlugin(){return function(fp){function onDayHover(event){var day=getEventTarget2(event);if(!day.classList.contains("flatpickr-day"))return;var days2=fp.days.childNodes;var dayIndex=day.$i;var dayIndSeven=dayIndex/7;var weekStartDay=days2[7*Math.floor(dayIndSeven)].dateObj;var weekEndDay=days2[7*Math.ceil(dayIndSeven+.01)-1].dateObj;for(var i=days2.length;i--;){var day_1=days2[i];var date=day_1.dateObj;if(date>weekEndDay||date<weekStartDay)day_1.classList.remove("inRange");else day_1.classList.add("inRange")}}function highlightWeek(){var selDate=fp.latestSelectedDateObj;if(selDate!==void 0&&selDate.getMonth()===fp.currentMonth&&selDate.getFullYear()===fp.currentYear){fp.weekStartDay=fp.days.childNodes[7*Math.floor(fp.selectedDateElem.$i/7)].dateObj;fp.weekEndDay=fp.days.childNodes[7*Math.ceil(fp.selectedDateElem.$i/7+.01)-1].dateObj}var days2=fp.days.childNodes;for(var i=days2.length;i--;){var date=days2[i].dateObj;if(date>=fp.weekStartDay&&date<=fp.weekEndDay)days2[i].classList.add("week","selected")}}function clearHover(){var days2=fp.days.childNodes;for(var i=days2.length;i--;)days2[i].classList.remove("inRange")}function onReady(){if(fp.daysContainer!==void 0)fp.daysContainer.addEventListener("mouseover",onDayHover)}function onDestroy(){if(fp.daysContainer!==void 0)fp.daysContainer.removeEventListener("mouseover",onDayHover)}return{onValueUpdate:highlightWeek,onMonthChange:highlightWeek,onYearChange:highlightWeek,onOpen:highlightWeek,onClose:clearHover,onParseConfig:function(){fp.config.mode="single";fp.config.enableTime=false;fp.config.dateFormat=fp.config.dateFormat?fp.config.dateFormat:"\\W\\e\\e\\k #W, Y";fp.config.altFormat=fp.config.altFormat?fp.config.altFormat:"\\W\\e\\e\\k #W, Y"},onReady:[onReady,highlightWeek,function(){fp.loadedPlugins.push("weekSelect")}],onDestroy:onDestroy}}}return weekSelectPlugin}))})(weekSelect$2);return weekSelect$2.exports}var weekSelectExports=requireWeekSelect();const weekSelect=getDefaultExportFromCjs(weekSelectExports);const getTimezoneText=inputDate=>{const tzAbbr=inputDate.toLocaleDateString("en-US",{day:"2-digit",timeZoneName:"short"}).slice(4);const tzText=inputDate.toLocaleDateString("en-US",{day:"2-digit",timeZoneName:"long"}).slice(4);return`${tzAbbr} (${tzText})`};function timeSelectPlugin(props){return function(fp){const generateMeridiemCard=text=>{const selectableCard=document.createElement("div");selectableCard.className="pb_selectable_card_kit_enabled";const cardInput=document.createElement("input"),cardInputId=`datePicker-${fp.element.id}-${text}`;cardInput.className="datePicker-AMPM";cardInput.id=cardInputId;cardInput.name="datepicker-ampm";cardInput.type="radio";cardInput.value=text;const cardLabel=document.createElement("label"),cardLabelBuffer=document.createElement("div");cardLabel.className=`label-${text.toLowerCase()}`;cardLabel.setAttribute("for",cardInputId);cardLabelBuffer.className="buffer";cardLabelBuffer.innerHTML=text;cardLabel.append(cardLabelBuffer);selectableCard.prepend(cardInput);selectableCard.append(cardLabel);return selectableCard};const generateMeridiemToggle=()=>{fp.amPM.style.display="none";const formGroupKit=document.createElement("div");formGroupKit.className="pb_form_group_kit";const amCard=generateMeridiemCard("AM");amCard.addEventListener("click",(()=>{fp.selectedDates[0].setHours(fp.selectedDates[0].getHours()%12+12*0);fp.setDate(fp.selectedDates[0],true)}));const pmCard=generateMeridiemCard("PM");pmCard.addEventListener("click",(()=>{fp.selectedDates[0].setHours(fp.selectedDates[0].getHours()%12+12*1);fp.setDate(fp.selectedDates[0],true)}));formGroupKit.prepend(amCard);formGroupKit.append(pmCard);const meridiemContainer=document.createElement("div");meridiemContainer.className="meridiem";meridiemContainer.append(formGroupKit);fp.timeContainer.append(meridiemContainer)};const getMeridiem=dateObj=>dateObj[0].getHours()<12?"AM":"PM";const updateMeridiemToggle=forceClick=>{if(!fp.selectedDates.length)return;const uncheckedClass="pb_selectable_card_kit_enabled",checkedClass="pb_selectable_card_kit_checked_enabled",pickerAM=document.getElementById(`datePicker-${fp.element.id}-AM`),pickerPM=document.getElementById(`datePicker-${fp.element.id}-PM`),meridiem=getMeridiem(fp.selectedDates);{pickerAM.checked=false;pickerPM.checked=false;pickerPM.checked=meridiem==="PM";pickerAM.checked=meridiem==="AM"}if(meridiem==="PM"){pickerPM.parentElement.className=checkedClass;pickerAM.parentElement.className=uncheckedClass}else if(meridiem==="AM"){pickerAM.parentElement.className=checkedClass;pickerPM.parentElement.className=uncheckedClass}};return{onValueUpdate(){updateMeridiemToggle()},onOpen(){updateMeridiemToggle()},onReady(){const id=fp.input.id;if(!id||!(fp==null?void 0:fp.timeContainer))return;fp.timeContainer.classList.add("pb_time_selection");fp.minuteElement.step="1";if(props.caption){const captionContainer=document.createElement("div");captionContainer.className="pb_caption_kit_md";captionContainer.innerHTML=props==null?void 0:props.caption;fp.timeContainer.prepend(captionContainer)}generateMeridiemToggle();updateMeridiemToggle();if(props.showTimezone){const subcaptionContainer=document.createElement("div");subcaptionContainer.className="pb_caption_kit_xs";subcaptionContainer.innerHTML=getTimezoneText(fp._initialDate);fp.timeContainer.append(subcaptionContainer)}fp.loadedPlugins.push("timeSelectPlugin")}}}}let activeLabel="";const quickPickPlugin=(thisRangesEndToday,customQuickPickDates,defaultDate)=>function(fp){const today=new Date;const yesterday=DateTime.getYesterdayDate(new Date);const thisWeekStartDate=DateTime.getFirstDayOfWeek(new Date);const thisWeekEndDate=thisRangesEndToday?new Date:DateTime.getLastDayOfWeek(new Date);const lastWeekStartDate=DateTime.getPreviousWeekStartDate(new Date);const lastWeekEndDate=DateTime.getPreviousWeekEndDate(new Date);const thisMonthStartDate=DateTime.getMonthStartDate(new Date);const thisMonthEndDate=thisRangesEndToday?new Date:DateTime.getMonthEndDate(new Date);const lastMonthStartDate=DateTime.getPreviousMonthStartDate(new Date);const lastMonthEndDate=DateTime.getPreviousMonthEndDate(new Date);const thisQuarterStartDate=DateTime.getQuarterStartDate(new Date);const thisQuarterEndDate=thisRangesEndToday?new Date:DateTime.getQuarterEndDate(new Date);const lastQuarterStartDate=DateTime.getPreviousQuarterStartDate(new Date);const lastQuarterEndDate=DateTime.getPreviousQuarterEndDate(new Date);const thisYearStartDate=DateTime.getYearStartDate(new Date);const thisYearEndDate=thisRangesEndToday?new Date:DateTime.getYearEndDate(new Date);const lastYearStartDate=DateTime.getPreviousYearStartDate(new Date);const lastYearEndDate=DateTime.getPreviousYearEndDate(new Date);const calculateDateRange=(timePeriod,amount)=>{const endDate=new Date;const startDate=new Date;switch(timePeriod){case"days":startDate.setDate(endDate.getDate()-amount);break;case"weeks":startDate.setDate(endDate.getDate()-amount*7);break;case"months":startDate.setMonth(endDate.getMonth()-amount);break;case"quarters":startDate.setMonth(endDate.getMonth()-amount*3);break;case"years":startDate.setFullYear(endDate.getFullYear()-amount);break;default:throw new Error("Invalid time period")}return[startDate,endDate]};let ranges={Today:[today,today],Yesterday:[yesterday,yesterday],"This week":[thisWeekStartDate,thisWeekEndDate],"This month":[thisMonthStartDate,thisMonthEndDate],"This quarter":[thisQuarterStartDate,thisQuarterEndDate],"This year":[thisYearStartDate,thisYearEndDate],"Last week":[lastWeekStartDate,lastWeekEndDate],"Last month":[lastMonthStartDate,lastMonthEndDate],"Last quarter":[lastQuarterStartDate,lastQuarterEndDate],"Last year":[lastYearStartDate,lastYearEndDate]};if(customQuickPickDates&&Object.keys(customQuickPickDates).length!==0){if(customQuickPickDates.dates.length&&customQuickPickDates.override===false){customQuickPickDates.dates.forEach((item=>{if(Array.isArray(item.value)){ranges[item.label]=item.value.map((dateStr=>new Date(dateStr)))}else{ranges[item.label]=calculateDateRange(item.value.timePeriod,item.value.amount)}}))}else if(customQuickPickDates.dates.length&&customQuickPickDates.override!==false){ranges={};customQuickPickDates.dates.forEach((item=>{if(Array.isArray(item.value)){ranges[item.label]=item.value.map((dateStr=>new Date(dateStr)))}else{ranges[item.label]=calculateDateRange(item.value.timePeriod,item.value.amount)}}))}}const rangesNav=document.createElement("ul");const pluginData={ranges:ranges,rangesNav:rangesNav,rangesButtons:[]};const addRangeButton=label=>{const div2=document.createElement("div");div2.className="nav-item-link";div2.innerHTML=label;pluginData.rangesButtons[label]=div2;const item=document.createElement("li");item.className="nav-item";item.appendChild(pluginData.rangesButtons[label]);pluginData.rangesNav.appendChild(item);return pluginData.rangesButtons[label]};const selectActiveRangeButton=selectedDates=>{const current=pluginData.rangesNav.querySelector(".active");if(current){current.classList.remove("active")}if(selectedDates.length>0&&activeLabel){pluginData.rangesButtons[activeLabel].classList.add("active")}};const isLabelMatchingSelectedDates=selectedDates=>activeLabel&&selectedDates[0].toDateString()===pluginData.ranges[activeLabel][0].toDateString()&&selectedDates[1].toDateString()===pluginData.ranges[activeLabel][1].toDateString();return{onReady(selectedDates){let defaultDateRange;for(const[label,range]of Object.entries(pluginData.ranges)){addRangeButton(label).addEventListener("click",(function(){const start2=new Date(range[0]);const end2=new Date(range[1]);if(!start2){fp.clear()}else{activeLabel=label;fp.setDate([start2,end2],true);fp.close()}}));if(defaultDate){if(label.toLowerCase()===defaultDate.toLowerCase()){activeLabel=label;defaultDateRange=range}}}if(pluginData.rangesNav.children.length>0){fp.calendarContainer.prepend(pluginData.rangesNav);pluginData.rangesNav.classList.add("quick-pick-ul");fp.calendarContainer.classList.add("quick-pick-drop-down");selectActiveRangeButton(selectedDates)}if(defaultDateRange){fp.setDate(defaultDateRange,false);selectActiveRangeButton(defaultDateRange)}},onValueUpdate(selectedDates){selectActiveRangeButton(selectedDates)},onClose(selectedDates){var _a;const originalClear=fp.clear;fp.clear=function(...args){const current=pluginData.rangesNav.querySelector(".active");if(current){current.classList.remove("active")}activeLabel="";return originalClear.apply(this,args)};if(!isLabelMatchingSelectedDates(selectedDates)){(_a=pluginData.rangesButtons[activeLabel])==null?void 0:_a.classList.remove("active");activeLabel=""}if(selectedDates.length===1){fp.setDate([selectedDates[0],selectedDates[0]],true)}if(selectedDates.length<2&&selectedDates.length>0){fp.input.placeholder=fp.formatDate(this.selectedDates[0],fp.config.dateFormat)}}}};const angleDown=getAllIcons().angleDown.string;const getPositionElement=element=>typeof element==="string"?document.querySelectorAll(element)[0]:element;const datePickerHelper=(config,scrollContainer)=>{const noop2=()=>{};const{allowInput:allowInput,closeOnSelect:closeOnSelect=true,customQuickPickDates:customQuickPickDates={override:true,dates:[]},defaultDate:defaultDate,disableDate:disableDate,disableRange:disableRange,disableWeekdays:disableWeekdays,enableTime:enableTime,format:format,maxDate:maxDate,minDate:minDate,mode:mode,onChange:onChange=noop2,onClose:onClose=noop2,pickerId:pickerId,plugins:plugins,position:position="auto",positionElement:positionElement,required:required,selectionType:selectionType,showTimezone:showTimezone,staticPosition:staticPosition=true,thisRangesEndToday:thisRangesEndToday=false,timeCaption:timeCaption="Select Time",timeFormat:timeFormat="at h:i K",yearRange:yearRange,controlsStartId:controlsStartId,controlsEndId:controlsEndId,syncStartWith:syncStartWith,syncEndWith:syncEndWith}=config;const defaultDateGetter=()=>{if(defaultDate===""){return null}else{return defaultDate}};const getMinMaxYears=()=>{const[minYear,maxYear]=yearRange;const extractYear=dateOption=>{if(!dateOption)return null;if(typeof dateOption==="number"){return dateOption}if(typeof dateOption==="string"){const match=dateOption.match(/\b(19|20)\d{2}\b/);return match?parseInt(match[0],10):null}if(dateOption instanceof Date){return dateOption.getFullYear()}return null};const setMinYear2=minDate?extractYear(minDate)??minYear:minYear;const setMaxYear2=maxDate?extractYear(maxDate)??maxYear:maxYear;return{setMinYear:setMinYear2,setMaxYear:setMaxYear2}};const{setMinYear:setMinYear,setMaxYear:setMaxYear}=getMinMaxYears();const getMinMaxDates=()=>{const setMinDate2=minDate||`01/01/${setMinYear}`;const setMaxDate2=maxDate||`12/31/${setMaxYear}`;return{setMinDate:setMinDate2,setMaxDate:setMaxDate2}};const disabledWeekDays=()=>[date=>{const weekdayObj={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6};return date.getDay()===weekdayObj[disableWeekdays[0]]||date.getDay()===weekdayObj[disableWeekdays[1]]||date.getDay()===weekdayObj[disableWeekdays[2]]||date.getDay()===weekdayObj[disableWeekdays[3]]||date.getDay()===weekdayObj[disableWeekdays[4]]||date.getDay()===weekdayObj[disableWeekdays[5]]||date.getDay()===weekdayObj[disableWeekdays[6]]}];const disabledParser=()=>{const disabledArray=[];disableDate&&disableDate.length>0&&disabledArray.push(...disableDate);disableRange&&disableRange.length>0&&disabledArray.push(...disableRange);disableWeekdays&&disableWeekdays.length>0&&disabledArray.push(...disabledWeekDays());return disabledArray};const calendarResizer=()=>{const cal=document.querySelector(`#cal-${pickerId}.open`);const parentInput=cal.parentElement;if((cal==null?void 0:cal.getBoundingClientRect().right)>window.innerWidth){parentInput.style.display="flex";parentInput.style.justifyContent="center"}if(cal.offsetWidth<=parentInput.offsetWidth){parentInput.style.display="";parentInput.style.justifyContent=""}};const positionCalendarIfNeeded=fp=>{const cal=document.querySelector(`#cal-${pickerId}`);if(!cal)return;const inputRect=fp.input.getBoundingClientRect();const h=cal.getBoundingClientRect().height||300;const spaceBelow=window.innerHeight-inputRect.bottom;const spaceAbove=inputRect.top;if(spaceBelow<h+10&&spaceAbove>=h+10){if(staticPosition){cal.style.top="auto";cal.style.bottom="calc(100% + 5px)"}else{cal.style.position="fixed";cal.style.top=`${Math.max(10,inputRect.top-h-5)}px`;cal.style.left=`${inputRect.left}px`}}else if(staticPosition){cal.style.top="";cal.style.bottom=""}else{Object.assign(cal.style,{position:"",top:"",left:"",bottom:"",right:"",transform:""});fp._positionCalendar()}};const setPlugins=(thisRangesEndToday2,customQuickPickDates2)=>{const pluginList=[];if(selectionType==="month"||plugins.length>0){pluginList.push(monthSelectPlugin({shorthand:true,dateFormat:"F Y",altFormat:"F Y"}))}else if(selectionType==="week"){pluginList.push(weekSelect())}else if(selectionType==="quickpick"){pluginList.push(quickPickPlugin(thisRangesEndToday2,customQuickPickDates2,defaultDate))}if(enableTime)pluginList.push(timeSelectPlugin({caption:timeCaption,showTimezone:showTimezone}));return pluginList};const getDateFormat=()=>enableTime?`${format} ${timeFormat}`:format;const initialPicker=document.querySelector(`#${pickerId}`)._flatpickr;const scrollEvent=()=>{initialPicker._positionCalendar()};function attachToScroll(scrollParent){var _a;(_a=document.querySelectorAll(scrollParent)[0])==null?void 0:_a.addEventListener("scroll",scrollEvent,{passive:true})}function detachFromScroll(scrollParent=document.body){var _a;(_a=document.querySelectorAll(scrollParent)[0])==null?void 0:_a.removeEventListener("scroll",scrollEvent)}const yearChangeHook=fp=>{var _a;const yearInput=document.querySelector(`#year-${fp.input.id}`);yearInput.value=(_a=fp.currentYear)==null?void 0:_a.toString()};const handleDatePickerChange=(fp,selectedDates)=>{const inputEl=fp.input;if(inputEl){const inlineDatePickerElem=inputEl.closest(".inline-date-picker");if(inlineDatePickerElem){if(selectedDates&&selectedDates.length>0){inlineDatePickerElem.classList.add("show-angle-down-icon")}else{inlineDatePickerElem.classList.remove("show-angle-down-icon")}}}};let resizeRepositionHandlerRef=null;const{setMinDate:setMinDate,setMaxDate:setMaxDate}=getMinMaxDates();const toDateObject=dateValue=>{if(!dateValue)return null;if(dateValue instanceof Date)return dateValue;if(typeof dateValue==="string"){const parsed=new Date(dateValue);return isNaN(parsed.getTime())?null:parsed}if(typeof dateValue==="number"){return new Date(dateValue)}return null};const formatDateForFlatpickr=dateValue=>{const dateObj=toDateObject(dateValue);if(!dateObj)return null;const year=dateObj.getFullYear();const month=String(dateObj.getMonth()+1).padStart(2,"0");const day=String(dateObj.getDate()).padStart(2,"0");return`${year}-${month}-${day}`};const isDefaultDateBeforeMinDate=(defaultDateValue2,minDateValue)=>{if(!defaultDateValue2||!minDateValue)return false;const defaultDateObj=toDateObject(defaultDateValue2);const minDateObj=toDateObject(minDateValue);if(!defaultDateObj||!minDateObj)return false;const defaultDateOnly=new Date(defaultDateObj.getFullYear(),defaultDateObj.getMonth(),defaultDateObj.getDate());const minDateOnly=new Date(minDateObj.getFullYear(),minDateObj.getMonth(),minDateObj.getDate());return defaultDateOnly<minDateOnly};const isDefaultDateAfterMaxDate=(defaultDateValue2,maxDateValue)=>{if(!defaultDateValue2||!maxDateValue)return false;const defaultDateObj=toDateObject(defaultDateValue2);const maxDateObj=toDateObject(maxDateValue);if(!defaultDateObj||!maxDateObj)return false;const defaultDateOnly=new Date(defaultDateObj.getFullYear(),defaultDateObj.getMonth(),defaultDateObj.getDate());const maxDateOnly=new Date(maxDateObj.getFullYear(),maxDateObj.getMonth(),maxDateObj.getDate());return defaultDateOnly>maxDateOnly};const defaultDateValue=defaultDateGetter();const isBeforeMin=minDate&&isDefaultDateBeforeMinDate(defaultDateValue,setMinDate);const isAfterMax=maxDate&&isDefaultDateAfterMaxDate(defaultDateValue,setMaxDate);const hasOutOfRangeDefault=(isBeforeMin||isAfterMax)&&defaultDateValue;const effectiveMinDate=isBeforeMin&&defaultDateValue&&minDate?formatDateForFlatpickr(defaultDateValue)||setMinDate:setMinDate;const effectiveMaxDate=isAfterMax&&defaultDateValue&&maxDate?formatDateForFlatpickr(defaultDateValue)||setMaxDate:setMaxDate;flatpickr(`#${pickerId}`,{allowInput:allowInput,closeOnSelect:closeOnSelect,disableMobile:true,dateFormat:getDateFormat(),defaultDate:defaultDateGetter(),disable:disabledParser(),enableTime:enableTime,locale:{rangeSeparator:" to "},maxDate:effectiveMaxDate,minDate:effectiveMinDate,mode:mode,nextArrow:'<i class="far fa-angle-right"></i>',onOpen:[(_selectedDates,_dateStr,fp)=>{if(hasOutOfRangeDefault){const dateObj=toDateObject(defaultDateValue);if(dateObj){const inputIsBlank=!fp.input.value||fp.input.value.trim()==="";const noSelection=!fp.selectedDates||fp.selectedDates.length===0;if(inputIsBlank||noSelection){const formattedDate=fp.formatDate(dateObj,getDateFormat());if(formattedDate){fp.input.value=formattedDate}fp.selectedDates=[dateObj];fp.jumpToDate(dateObj);setTimeout((()=>{yearChangeHook(fp)}),0)}}}calendarResizer();if(resizeRepositionHandlerRef){window.removeEventListener("resize",resizeRepositionHandlerRef)}resizeRepositionHandlerRef=()=>{calendarResizer();positionCalendarIfNeeded(fp)};window.addEventListener("resize",resizeRepositionHandlerRef);if(!staticPosition&&scrollContainer)attachToScroll(scrollContainer);positionCalendarIfNeeded(fp)}],onClose:[(selectedDates,dateStr,fp)=>{if(resizeRepositionHandlerRef){window.removeEventListener("resize",resizeRepositionHandlerRef);resizeRepositionHandlerRef=null}if(!staticPosition&&scrollContainer)detachFromScroll(scrollContainer);if(hasOutOfRangeDefault&&(!selectedDates||selectedDates.length===0)){const dateObj=toDateObject(defaultDateValue);if(dateObj&&fp.input){const formattedDate=fp.formatDate(dateObj,getDateFormat());if(formattedDate){setTimeout((()=>{if(fp.input&&(!fp.selectedDates||fp.selectedDates.length===0)){fp.input.value=formattedDate;fp.selectedDates=[dateObj];fp.jumpToDate(dateObj)}}),0)}}}onClose(selectedDates,dateStr)}],onChange:[(selectedDates,dateStr,fp)=>{handleDatePickerChange(fp,selectedDates);yearChangeHook(fp);onChange(dateStr,selectedDates)}],onYearChange:[(_selectedDates,_dateStr,fp)=>{yearChangeHook(fp)}],plugins:setPlugins(thisRangesEndToday,customQuickPickDates),position:position,positionElement:getPositionElement(positionElement),prevArrow:'<i class="far fa-angle-left"></i>',static:staticPosition});const picker=document.querySelector(`#${pickerId}`)._flatpickr;picker.innerContainer.parentElement.id=`cal-${pickerId}`;if((isBeforeMin||isAfterMax)&&defaultDateValue){const dateObj=toDateObject(defaultDateValue);const formattedDate=dateObj?picker.formatDate(dateObj,getDateFormat()):null;setTimeout((()=>{if(!dateObj||!picker.input||!formattedDate)return;picker.setDate(dateObj,false);if(isBeforeMin&&setMinDate&&minDate){picker.set("minDate",setMinDate)}if(isAfterMax&&setMaxDate&&maxDate){picker.set("maxDate",setMaxDate)}picker.input.value=formattedDate;picker.selectedDates=[dateObj];setTimeout((()=>{yearChangeHook(picker)}),0);const restoreOutOfRangeValue=()=>{if(!picker.input)return;const inputIsBlank=!picker.input.value||picker.input.value.trim()==="";const noSelection=!picker.selectedDates||picker.selectedDates.length===0;if(inputIsBlank||noSelection){setTimeout((()=>{if(picker.input&&(!picker.input.value||picker.input.value.trim()==="")){picker.input.value=formattedDate}if(!picker.selectedDates||picker.selectedDates.length===0){picker.selectedDates=[dateObj];if(picker.isOpen){picker.jumpToDate(dateObj);picker.redraw();setTimeout((()=>{yearChangeHook(picker)}),0)}}}),0)}};const originalClear=picker.clear.bind(picker);picker.clear=function(...args){const result=originalClear(...args);setTimeout((()=>restoreOutOfRangeValue()),0);return result};picker.input.addEventListener("input",restoreOutOfRangeValue);picker.config.onClose.push((()=>{restoreOutOfRangeValue()}))}),10)}picker.yearElements[0].parentElement.innerHTML=`<select class="numInput cur-year" type="number" tabIndex="-1" aria-label="Year" id="year-${pickerId}"></select>`;let years="";for(let year=setMaxYear;year>=setMinYear;year--){years+=`<option value="${year}">${year}</option>`}const dropdown=document.querySelector(`#year-${pickerId}`);dropdown.innerHTML=years;dropdown.value=picker.currentYear;dropdown.addEventListener("input",(e=>{picker.changeYear(Number(e.target.value))}));if(picker.input.form){picker.input.form.addEventListener("reset",(()=>{setTimeout((()=>{dropdown.value=picker.currentYear;picker.monthsDropdownContainer.value=picker.currentMonth;if(defaultDate){picker.setDate(defaultDate);yearChangeHook(picker)}}),0)}))}if(selectionType==="quickpick"&&(controlsStartId||controlsEndId)){picker.config.onClose.push((selectedDates=>{var _a,_b;const[start2,end2]=selectedDates;if(controlsStartId){const startPicker=(_a=document.querySelector(`#${controlsStartId}`))==null?void 0:_a._flatpickr;startPicker==null?void 0:startPicker.setDate(start2,true)}if(controlsEndId){const endPicker=(_b=document.querySelector(`#${controlsEndId}`))==null?void 0:_b._flatpickr;endPicker==null?void 0:endPicker.setDate(end2,true)}}))}if(syncStartWith){picker.config.onClose.push((selectedDates=>{var _a;if(selectedDates==null?void 0:selectedDates.length){const element=document.querySelector(`#${syncStartWith}`);if((_a=element==null?void 0:element._dropdownRef)==null?void 0:_a.current){element._dropdownRef.current.clearSelected()}else{const quickpick=element==null?void 0:element._flatpickr;quickpick==null?void 0:quickpick.clear()}}}))}if(syncEndWith){picker.config.onClose.push((selectedDates=>{var _a;if(selectedDates==null?void 0:selectedDates.length){const element=document.querySelector(`#${syncEndWith}`);if((_a=element==null?void 0:element._dropdownRef)==null?void 0:_a.current){element._dropdownRef.current.clearSelected()}else{const quickpick=element==null?void 0:element._flatpickr;quickpick==null?void 0:quickpick.clear()}}}))}dropdown.insertAdjacentHTML("afterend",`<i class="year-dropdown-icon">${angleDown}</i>`);if(picker.monthElements[0].parentElement){return picker.monthElements[0].insertAdjacentHTML("afterend",`<i class="month-dropdown-icon">${angleDown}</i>`)}if(allowInput){picker.input.removeAttribute("readonly")}if(required){picker.input.removeAttribute("readonly");picker.input.addEventListener("keydown",(e=>e.preventDefault()));picker.input.style.caretColor="transparent";picker.input.style.cursor="pointer"}document.querySelector(`#${pickerId}`).parentElement.addEventListener("click",(e=>e.stopPropagation()))};const useDropdown=(initial=true)=>{const[isDropDownClosed,setIsDropDownClosed]=useState(initial);const toggleDropdown=()=>setIsDropDownClosed((prev=>!prev));return[isDropDownClosed,setIsDropDownClosed,toggleDropdown]};class ElementObserver{constructor(matchDelegate,target=document){this.matchDelegate=matchDelegate;this.target=target}get mutationObserver(){return this._mutationObserver=this._mutationObserver||new MutationObserver((mutationList=>this.processMutationList(mutationList)))}start(){this.mutationObserver.observe(this.target,{attributes:true,childList:true,subtree:true});this.catchup()}stop(){this.mutationObserverdisconnect()}catchup(){this.handleAdditions(this.matchDelegate.matches(this.target))}processMutationList(mutationList){for(const mutation of mutationList){if(mutation.type=="attributes"){this.processAttributeChange(mutation.target)}else if(mutation.type=="childList"){this.processRemovedNodes(Array.from(mutation.removedNodes));this.processAddedNodes(Array.from(mutation.addedNodes))}}}processAttributeChange(node){if(node.nodeType!==Node.ELEMENT_NODE)return;const matches=this.matchDelegate.matches(node);if(matches.length===0)return this.matchDelegate.removeMatch(node);this.handleAdditions(matches)}processRemovedNodes(nodes){for(const node of nodes){if(node.nodeType!==Node.ELEMENT_NODE)continue;this.handleRemovals(this.matchDelegate.matches(node))}}processAddedNodes(nodes){for(const node of nodes){if(node.nodeType!==Node.ELEMENT_NODE)continue;this.handleAdditions(this.matchDelegate.matches(node))}}handleRemovals(elements){for(const element of elements)this.matchDelegate.removeMatch(element)}handleAdditions(elements){for(const element of elements)this.matchDelegate.addMatch(element)}}class PbEnhancedElement{constructor(element){this.element=element}static get elements(){return this._elements=this._elements||new Map}static get observer(){return this._observer=this._observer||new ElementObserver(this)}static get selector(){console.warn("Define a static property for selector or redefine the matches function in a subclass.",this);return null}static matches(node){if(!this.selector)return[];const matches=[];if(node.nodeType===Node.ELEMENT_NODE&&node.matches(this.selector))matches.push(node);matches.push(...node.querySelectorAll(this.selector));return matches}static addMatch(element){if(element._pbEnhanced||this.elements.has(element))return;const enhansedElement=new this(element);enhansedElement.connect();this.elements.set(element,enhansedElement);element._pbEnhanced=enhansedElement}static removeMatch(element){if(!this.elements.has(element))return;const enhansedElement=this.elements.get(element);enhansedElement.disconnect();this.elements.delete(element)}static start(){this.observer.start()}static stop(){this.mutationObserver.stop()}connect(){console.warn("Redefine the connect function in a subclass.",this)}disconnect(){}}class PbTextarea extends PbEnhancedElement{static get selector(){return".resize_auto textarea"}onInput(){this.style.height="auto";this.style.height=this.scrollHeight+"px"}connect(){this.element.setAttribute("style","height:"+this.element.scrollHeight+"px;overflow-y:hidden;");this.element.addEventListener("input",this.onInput,false)}}const mapTheme={marker:colors.primary_action,maptiles:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",flyToConfig:{zoom:13,bearing:0,curve:1.42,easing:function(t){return t},essential:true},zoomConfig:{duration:1e3},mapConfig:{style:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",zoom:13,attributionControl:false}};const gaugeTheme={title:{text:"",style:{fontFamily:typography.font_family_base,fontSize:typography.text_larger}},chart:{type:"solidgauge",events:{render(){this.container;const arc=this.container.querySelector("path.gauge-pane");if(arc)arc.setAttribute("stroke-linejoin","round")}}},pane:{size:"90%",startAngle:-100,endAngle:100,background:[{borderWidth:20,innerRadius:"90%",outerRadius:"90%",shape:"arc",className:"gauge-pane",borderColor:colors.border_light,borderRadius:"50%"}]},tooltip:{backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,colors.bg_dark],[1,colors.bg_dark]]},pointFormat:'<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: <b>{point.y}</b>',followPointer:true,shadow:false,borderWidth:0,borderRadius:10,style:{fontFamily:typography.font_family_base,color:colors.text_dk_default,fontWeight:typography.regular,fontSize:typography.text_smaller}},yAxis:{min:0,max:100,lineWidth:0,tickPositions:[]},plotOptions:{solidgauge:{borderColor:colors.data_1,borderWidth:20,color:colors.data_1,radius:90,innerRadius:"90%",y:-26,dataLabels:{borderWidth:0,color:colors.text_lt_default,enabled:true,format:'<span class="fix">{y:,f}</span>',style:{fontFamily:typography.font_family_base,fontWeight:typography.regular,fontSize:typography.heading_2},y:-26}}},credits:{enabled:false}};const circleChartTheme={title:{text:"",style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.bold,fontSize:typography.heading_3}},chart:{type:"pie"},tooltip:{backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,colors.bg_dark],[1,colors.bg_dark]]},pointFormat:'<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: <b>{point.y}</b>',followPointer:true,shadow:false,borderWidth:0,borderRadius:10,style:{fontFamily:typography.font_family_base,color:colors.text_dk_default,fontWeight:typography.regular,fontSize:typography.text_smaller}},plotOptions:{pie:{dataLabels:{enabled:false,connectorShape:"straight",connectorWidth:3,format:"<div>{point.name}</div>",style:{fontFamily:typography.font_family_base,fontSize:typography.text_smaller,color:colors.text_lt_light,fontWeight:typography.regular,textOutline:"2px $white"}},innerSize:"50%",borderColor:"",borderWidth:null,colors:[colors.data_1,colors.data_2,colors.data_3,colors.data_4,colors.data_5,colors.data_6,colors.data_7]}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom",itemStyle:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontWeight:typography.regular,fontSize:typography.text_smaller},itemHoverStyle:{color:colors.text_lt_default},itemHiddenStyle:{color:colors.text_lt_lighter}},credits:{enabled:false}};const lineGraphTheme={title:{text:"",style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.bold,fontSize:typography.heading_3}},subtitle:{text:"",style:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontWeight:typography.regular,fontSize:typography.text_base}},chart:{type:"line"},tooltip:{backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,colors.bg_dark],[1,colors.bg_dark]]},followPointer:true,shadow:false,borderWidth:0,borderRadius:10,style:{fontFamily:typography.font_family_base,color:colors.text_dk_default,fontWeight:typography.regular,fontSize:typography.text_smaller}},plotOptions:{line:{dataLabels:{enabled:false}}},credits:{enabled:false},legend:{enabled:false,itemStyle:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontWeight:typography.regular,fontSize:typography.text_smaller},itemHoverStyle:{color:colors.text_lt_default},itemHiddenStyle:{color:colors.text_lt_lighter}},colors:[colors.data_1,colors.data_2,colors.data_3,colors.data_4,colors.data_5,colors.data_6,colors.data_7],xAxis:{gridLineWidth:0,lineColor:colors.border_light,tickColor:colors.border_light,labels:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}},title:{style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.regular,fontSize:typography.heading_4}}},yAxis:{alternateGridColor:void 0,minorTickInterval:null,gridLineColor:colors.border_light,minorGridLineColor:colors.border_light,lineWidth:0,tickWidth:0,tickPixelInterval:50,labels:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}},title:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}}}};const barGraphTheme={title:{text:"",style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.bold,fontSize:typography.heading_3}},subtitle:{text:"",style:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontWeight:typography.regular,fontSize:typography.text_base}},chart:{type:"column"},tooltip:{backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,colors.bg_dark],[1,colors.bg_dark]]},style:{fontFamily:typography.font_family_base,color:colors.text_dk_default,fontWeight:typography.regular,fontSize:typography.text_smaller}},colors:[colors.data_1,colors.data_2,colors.data_3,colors.data_4,colors.data_5,colors.data_6,colors.data_7],credits:{enabled:false},legend:{enabled:false,itemStyle:{color:colors.text_lt_light,fill:colors.text_lt_light,fontSize:typography.text_smaller}},xAxis:{gridLineWidth:0,lineColor:colors.border_light,tickColor:colors.border_light,labels:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}},title:{style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.regular,fontSize:typography.heading_4}}},yAxis:{alternateGridColor:void 0,minorTickInterval:null,gridLineColor:colors.border_light,minorGridLineColor:colors.border_light,lineWidth:0,tickWidth:0,labels:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}},title:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}}}};const dataColors=[colors.data_1,colors.data_2,colors.data_3,colors.data_4,colors.data_5,colors.data_6,colors.data_7,colors.data_8];const applyCustomSeriesColors=highchart=>{highchart.series.forEach(((item,index)=>{const selectedColor=dataColors[index];item.color=selectedColor;item.data.forEach((dataItem=>{if(dataItem.color){dataItem.color=selectedColor}if(!dataItem.marker)return;if(dataItem.marker.lineColor){dataItem.marker.lineColor=selectedColor}if(dataItem.marker.states.hover!==void 0){dataItem.marker.states.hover.lineColor=selectedColor}if(dataItem.marker.states.select.lineColor){dataItem.marker.states.select.lineColor=selectedColor}}))}))};const adjustAxisStyle=axis=>{axis.minorGridLineColor=colors.slate;axis.minorGridLineWidth=.5;axis.minorGridLineDashStyle="Dash";axis.gridLineWidth=.5;axis.gridLineColor=colors.slate;axis.gridLineDashStyle="Dash";axis.lineColor=colors.sky;axis.labels.style.fontFamily=typography.font_family_base;axis.labels.style.color=colors.charcoal;axis.labels.style.fontWeight=typography.regular;axis.labels.style.fontSize=typography.font_small};const styleAxis=highchart=>{if(Array.isArray(highchart.yAxis)){highchart.yAxis.forEach((item=>{adjustAxisStyle(item)}))}else{adjustAxisStyle(highchart.yAxis)}if(Array.isArray(highchart.xAxis)){highchart.xAxis.forEach((item=>{adjustAxisStyle(item)}))}else{adjustAxisStyle(highchart.xAxis)}};const styleChartContainer=highchart=>{highchart.chart.spacingTop=30;highchart.chart.spacingBottom=40;highchart.chart.spacingLeft=50;highchart.chart.spacingRight=50};const styleLegend=highchart=>{highchart.legend.itemStyle.fontFamily=typography.font_family_base;highchart.legend.itemStyle.color=colors.text_lt_light;highchart.legend.itemStyle.fontWeight=typography.regular;highchart.legend.itemStyle.fontSize=typography.text_smaller};const commonSettings=highchart=>{applyCustomSeriesColors(highchart);styleAxis(highchart);styleChartContainer(highchart);styleLegend(highchart)};const markerStyles=highchart=>{highchart.plotOptions.line.marker.enabled=true;highchart.plotOptions.series.marker.enabled=true;highchart.plotOptions.series.marker.fillColor="white";highchart.plotOptions.series.marker.lineWidth=2};const fixTooltipStyles=()=>{document.getElementById("main-view").setAttribute("style","position: static !important")};const styleDataLabels$1=highchart=>{const series=highchart.plotOptions.series;series.dataLabels.style.fontFamily=typography.font_family_base;series.dataLabels.style.fontSize=typography.text_small;series.dataLabels.style.fontWeight=typography.bold};const pbLineGraph=highchart=>{commonSettings(highchart);styleDataLabels$1(highchart);markerStyles(highchart);fixTooltipStyles()};const sizeColumns=function(highchart){const column=highchart.plotOptions.column;const series=highchart.plotOptions.series;column.borderRadius=0;column.pointPadding=.3;column.groupPadding=0;series.borderWidth=0;series.shadow=false;series.pointPadding=.25;series.groupPadding=0};const styleDataLabels=highchart=>{const series=highchart.plotOptions.series;series.dataLabels.style.fontFamily=typography.font_family_base;series.dataLabels.style.fontSize=typography.text_small;series.dataLabels.style.fontWeight=typography.bold};const barGraphSettings=function(highchart){commonSettings(highchart);sizeColumns(highchart);styleDataLabels(highchart)};const pbIndicator={title:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontSizes:{big:typography.text_large,medium:typography.text_base,small:typography.text_small,micro:typography.text_small}},secondaryTitle:{color:colors.text_lt_light,fontFamily:typography.font_family_base,fontSizes:{big:typography.text_large,medium:typography.text_base,small:typography.text_small,micro:typography.text_small}},value:{fontFamily:typography.font_family_base,color:colors.text_lt_default,fontWeight:typography.lighter,fontSizes:{big:typography.heading_1,medium:typography.heading_1,small:typography.text_base,micro:typography.text_small}},secondaryValue:{fontFamily:typography.font_family_base,fontSizes:{big:typography.text_large,medium:typography.text_base,small:typography.text_small,micro:typography.text_small}}};const POPOVER_OFFSET_Y=[0,20];class PbPopover extends PbEnhancedElement{static get selector(){return"[data-pb-popover-kit]"}moveTooltip(){let container=document.querySelector("body");if(this.appendTo==="parent"){container=this.element.parentElement&&this.element.parentElement}else if(this.appendTo){container=document.querySelector(this.appendTo)}container.appendChild(this.tooltip)}connect(){if(!this.triggerElement||!this.tooltip){console.warn("Popover requires both trigger and tooltip elements to be defined.");return}this.moveTooltip();this.popper=createPopper(this.triggerElement,this.tooltip,{placement:this.position,strategy:"fixed",modifiers:[{name:"offset",options:{offset:this.offset}}]});this.triggerElement.addEventListener("click",(event=>{event.preventDefault();event.stopPropagation();if(!this.tooltip.classList.contains("show")){this.checkCloseTooltip()}setTimeout((()=>{this.toggleTooltip();this.popper.update()}),0)}))}checkCloseTooltip(){document.querySelector("body").addEventListener("click",(({target:target})=>{const isTooltipElement=target.closest(`#${this.tooltipId}`)!==null;const isTriggerElement=target.closest(`#${this.triggerElementId}`)!==null;switch(this.closeOnClick){case"any":if(isTooltipElement||!isTooltipElement&&!isTriggerElement){this.hideTooltip()}break;case"outside":if(!isTooltipElement&&!isTriggerElement){this.hideTooltip()}break;case"inside":if(isTooltipElement){this.hideTooltip()}break}}),true)}hideTooltip(){this.tooltip.classList.remove("show");this.tooltip.classList.add("hide")}toggleTooltip(){this.tooltip.classList.toggle("show");this.tooltip.classList.toggle("hide")}get triggerElement(){return this._triggerElement=this._triggerElement||document.querySelector(`#${this.triggerElementId}`)}get tooltip(){return this._tooltip=this._tooltip||this.element.querySelector(`#${this.tooltipId}`)}get position(){return this.element.dataset.pbPopoverPosition}get triggerElementId(){return this.element.dataset.pbPopoverTriggerElementId}get tooltipId(){return this.element.dataset.pbPopoverTooltipId}get offset(){return this.element.dataset.pbPopoverOffset==="true"?POPOVER_OFFSET_Y:[0,0]}get closeOnClick(){return this.element.dataset.pbPopoverCloseOnClick}get appendTo(){return this.element.dataset.pbPopoverAppendTo}}const TABLE_WRAPPER_SELECTOR="[data-pb-table-wrapper]";const TABLE_COLLAPSIBLE_WRAPPER_SELECTOR="[data-pb-table-collapsible-wrapper]";const TABLE_COLLAPSIBLE_CELL_SELECTOR="[data-pb-table-collapsible-cell-id]";class PbTable extends PbEnhancedElement{constructor(){super(...arguments);this.stickyLeftColumns=[];this.stickyRightColumns=[];this.stickyRightColumnsReversed=[]}static get selector(){return TABLE_WRAPPER_SELECTOR}connect(){if(this.element.classList.contains("table-responsive-collapse")){const headers=[];[].forEach.call(this.element.querySelectorAll("th"),(header=>{const colSpan=header.colSpan;for(let i=0;i<colSpan;i++){headers.push(header.textContent.replace(/\r?\n|\r/,""))}}));[].forEach.call(this.element.querySelectorAll("tbody tr"),(row=>{[].forEach.call(row.cells,((cell,headerIndex)=>{cell.setAttribute("data-title",headers[headerIndex])}))}))}this.initStickyLeftColumns();this.initStickyRightColumns();this.handleCollapsibleClick();this.handleCollapsibleRow()}initStickyLeftColumns(){const table=this.element.querySelector(".sticky-left-column");if(table){const classList=Array.from(table.classList);const stickyColumnClass=classList.find((cls=>cls.startsWith("sticky-left-columns-ids-")));if(stickyColumnClass){this.stickyLeftColumns=stickyColumnClass.replace("sticky-left-columns-ids-","").split("-");if(this.stickyLeftColumns.length>0){setTimeout((()=>{this.handleStickyLeftColumns();window.addEventListener("resize",(()=>this.handleStickyLeftColumns()))}),10)}}}}handleStickyLeftColumns(){let accumulatedWidth=0;this.stickyLeftColumns.forEach(((colId,index)=>{const isLastColumn=index===this.stickyLeftColumns.length-1;const header=this.element.querySelector(`th[data-sticky-id="${colId}"]`);const cells=this.element.querySelectorAll(`td[data-sticky-id="${colId}"]`);if(header){header.classList.add("sticky");header.style.left=`${accumulatedWidth}px`;if(!isLastColumn){header.classList.add("with-border-right");header.classList.remove("sticky-left-shadow")}else{header.classList.remove("with-border-right");header.classList.add("sticky-left-shadow")}accumulatedWidth+=header.offsetWidth}cells.forEach((cell=>{cell.classList.add("sticky");cell.style.left=`${accumulatedWidth-header.offsetWidth}px`;if(!isLastColumn){cell.classList.add("with-border-right");cell.classList.remove("sticky-left-shadow")}else{cell.classList.remove("with-border-right");cell.classList.add("sticky-left-shadow")}}))}))}initStickyRightColumns(){const table=this.element.querySelector(".sticky-right-column");if(table){const classList=Array.from(table.classList);const stickyColumnClass=classList.find((cls=>cls.startsWith("sticky-right-columns-ids-")));if(stickyColumnClass){this.stickyRightColumns=stickyColumnClass.replace("sticky-right-columns-ids-","").split("-");this.stickyRightColumnsReversed=this.stickyRightColumns.reverse();if(this.stickyRightColumns.length>0){setTimeout((()=>{this.handleStickyRightColumns();window.addEventListener("resize",(()=>this.handleStickyRightColumns()))}),10)}}}}handleStickyRightColumns(){let accumulatedWidth=0;this.stickyRightColumnsReversed.forEach(((colId,index)=>{const isLastColumn=index===this.stickyRightColumns.length-1;const header=this.element.querySelector(`th[data-sticky-id="${colId}"]`);const cells=this.element.querySelectorAll(`td[data-sticky-id="${colId}"]`);if(header){header.classList.add("sticky");header.style.right=`${accumulatedWidth}px`;if(!isLastColumn){header.classList.add("with-border-left");header.classList.remove("sticky-right-shadow")}else{header.classList.remove("with-border-right");header.classList.add("sticky-right-shadow")}accumulatedWidth+=header.offsetWidth}cells.forEach((cell=>{cell.classList.add("sticky");cell.style.right=`${accumulatedWidth-header.offsetWidth}px`;if(!isLastColumn){cell.classList.add("with-border-left");cell.classList.remove("sticky-right-shadow")}else{cell.classList.remove("with-border-left");cell.classList.add("sticky-right-shadow")}}))}))}handleCollapsibleClick(){const cells=this.element.querySelectorAll(TABLE_COLLAPSIBLE_CELL_SELECTOR);const collapsibleElements=this.element.querySelectorAll(TABLE_COLLAPSIBLE_WRAPPER_SELECTOR);if(cells.length>0){cells.forEach((cell=>{const cellId=cell.dataset.pbTableCollapsibleCellId;Array.from(cell.children).forEach((child=>{if(child.id===cellId){Array.from(child.children).forEach((svgChild=>{svgChild.id=cellId;Array.from(svgChild.children).forEach((pathChild=>{pathChild.id=cellId}))}))}}));cell.addEventListener("click",(event=>{if(event.target.id){document.dispatchEvent(new CustomEvent(`collapsed-toggle${event.currentTarget.id}`));const toggleElements=this.element.querySelectorAll(`.collapsible_border_toggle${event.currentTarget.id}`);toggleElements.forEach((element=>{element.classList.toggle("no-border");element.classList.toggle("border-active")}))}}))}))}else{collapsibleElements.forEach((collapsibleElement=>{collapsibleElement.addEventListener("click",(event=>{document.dispatchEvent(new CustomEvent(`collapsed-toggle${event.currentTarget.id}`));const toggleElements=this.element.querySelectorAll(`.collapsible_border_toggle${event.currentTarget.id}`);toggleElements.forEach((element=>{element.classList.toggle("no-border");element.classList.toggle("border-active")}))}))}))}}handleCollapsibleRow(){const collapsibleRows=this.element.querySelectorAll(".pb_table_collapsible_row");if(collapsibleRows.length>0){collapsibleRows.forEach((row=>{const previousRow=row.previousElementSibling;if(previousRow&&previousRow.tagName==="TR"){const tdCount=previousRow.querySelectorAll("td").length;const collapsibleTd=row.querySelector("td");if(collapsibleTd){collapsibleTd.colSpan=tdCount}}else{return}}))}}disconnect(){if(this.stickyLeftColumns.length>0){window.removeEventListener("resize",(()=>this.handleStickyLeftColumns()))}if(this.stickyRightColumns.length>0){window.removeEventListener("resize",(()=>this.handleStickyRightColumns()))}}}const min=Math.min;const max=Math.max;const round=Math.round;const floor=Math.floor;const createCoords=v=>({x:v,y:v});function hasWindow(){return typeof window!=="undefined"}function getNodeName(node){if(isNode(node)){return(node.nodeName||"").toLowerCase()}return"#document"}function getWindow(node){var _node$ownerDocument;return(node==null||(_node$ownerDocument=node.ownerDocument)==null?void 0:_node$ownerDocument.defaultView)||window}function getDocumentElement(node){var _ref;return(_ref=(isNode(node)?node.ownerDocument:node.document)||window.document)==null?void 0:_ref.documentElement}function isNode(value){if(!hasWindow()){return false}return value instanceof Node||value instanceof getWindow(value).Node}function isElement(value){if(!hasWindow()){return false}return value instanceof Element||value instanceof getWindow(value).Element}function isHTMLElement(value){if(!hasWindow()){return false}return value instanceof HTMLElement||value instanceof getWindow(value).HTMLElement}function isShadowRoot(value){if(!hasWindow()||typeof ShadowRoot==="undefined"){return false}return value instanceof ShadowRoot||value instanceof getWindow(value).ShadowRoot}function isOverflowElement(element){const{overflow:overflow,overflowX:overflowX,overflowY:overflowY,display:display}=getComputedStyle(element);return/auto|scroll|overlay|hidden|clip/.test(overflow+overflowY+overflowX)&&!["inline","contents"].includes(display)}function isTableElement(element){return["table","td","th"].includes(getNodeName(element))}function isTopLayer(element){return[":popover-open",":modal"].some((selector=>{try{return element.matches(selector)}catch(e){return false}}))}function isContainingBlock(elementOrCss){const webkit=isWebKit();const css=isElement(elementOrCss)?getComputedStyle(elementOrCss):elementOrCss;return["transform","translate","scale","rotate","perspective"].some((value=>css[value]?css[value]!=="none":false))||(css.containerType?css.containerType!=="normal":false)||!webkit&&(css.backdropFilter?css.backdropFilter!=="none":false)||!webkit&&(css.filter?css.filter!=="none":false)||["transform","translate","scale","rotate","perspective","filter"].some((value=>(css.willChange||"").includes(value)))||["paint","layout","strict","content"].some((value=>(css.contain||"").includes(value)))}function getContainingBlock(element){let currentNode=getParentNode(element);while(isHTMLElement(currentNode)&&!isLastTraversableNode(currentNode)){if(isContainingBlock(currentNode)){return currentNode}else if(isTopLayer(currentNode)){return null}currentNode=getParentNode(currentNode)}return null}function isWebKit(){if(typeof CSS==="undefined"||!CSS.supports)return false;return CSS.supports("-webkit-backdrop-filter","none")}function isLastTraversableNode(node){return["html","body","#document"].includes(getNodeName(node))}function getComputedStyle(element){return getWindow(element).getComputedStyle(element)}function getNodeScroll(element){if(isElement(element)){return{scrollLeft:element.scrollLeft,scrollTop:element.scrollTop}}return{scrollLeft:element.scrollX,scrollTop:element.scrollY}}function getParentNode(node){if(getNodeName(node)==="html"){return node}const result=node.assignedSlot||node.parentNode||isShadowRoot(node)&&node.host||getDocumentElement(node);return isShadowRoot(result)?result.host:result}function getNearestOverflowAncestor(node){const parentNode=getParentNode(node);if(isLastTraversableNode(parentNode)){return node.ownerDocument?node.ownerDocument.body:node.body}if(isHTMLElement(parentNode)&&isOverflowElement(parentNode)){return parentNode}return getNearestOverflowAncestor(parentNode)}function getOverflowAncestors(node,list,traverseIframes){var _node$ownerDocument2;if(list===void 0){list=[]}if(traverseIframes===void 0){traverseIframes=true}const scrollableAncestor=getNearestOverflowAncestor(node);const isBody=scrollableAncestor===((_node$ownerDocument2=node.ownerDocument)==null?void 0:_node$ownerDocument2.body);const win=getWindow(scrollableAncestor);if(isBody){const frameElement=getFrameElement(win);return list.concat(win,win.visualViewport||[],isOverflowElement(scrollableAncestor)?scrollableAncestor:[],frameElement&&traverseIframes?getOverflowAncestors(frameElement):[])}return list.concat(scrollableAncestor,getOverflowAncestors(scrollableAncestor,[],traverseIframes))}function getFrameElement(win){return win.parent&&Object.getPrototypeOf(win.parent)?win.frameElement:null}function getCssDimensions(element){const css=getComputedStyle(element);let width=parseFloat(css.width)||0;let height=parseFloat(css.height)||0;const hasOffset=isHTMLElement(element);const offsetWidth=hasOffset?element.offsetWidth:width;const offsetHeight=hasOffset?element.offsetHeight:height;const shouldFallback=round(width)!==offsetWidth||round(height)!==offsetHeight;if(shouldFallback){width=offsetWidth;height=offsetHeight}return{width:width,height:height,$:shouldFallback}}function unwrapElement(element){return!isElement(element)?element.contextElement:element}function getScale(element){const domElement=unwrapElement(element);if(!isHTMLElement(domElement)){return createCoords(1)}const rect=domElement.getBoundingClientRect();const{width:width,height:height,$:$}=getCssDimensions(domElement);let x=($?round(rect.width):rect.width)/width;let y=($?round(rect.height):rect.height)/height;if(!x||!Number.isFinite(x)){x=1}if(!y||!Number.isFinite(y)){y=1}return{x:x,y:y}}const noOffsets=createCoords(0);function getVisualOffsets(element){const win=getWindow(element);if(!isWebKit()||!win.visualViewport){return noOffsets}return{x:win.visualViewport.offsetLeft,y:win.visualViewport.offsetTop}}function shouldAddVisualOffsets(element,isFixed,floatingOffsetParent){if(isFixed===void 0){isFixed=false}if(!floatingOffsetParent||isFixed&&floatingOffsetParent!==getWindow(element)){return false}return isFixed}function getBoundingClientRect(element,includeScale,isFixedStrategy,offsetParent){if(includeScale===void 0){includeScale=false}if(isFixedStrategy===void 0){isFixedStrategy=false}const clientRect=element.getBoundingClientRect();const domElement=unwrapElement(element);let scale=createCoords(1);if(includeScale){if(offsetParent){if(isElement(offsetParent)){scale=getScale(offsetParent)}}else{scale=getScale(element)}}const visualOffsets=shouldAddVisualOffsets(domElement,isFixedStrategy,offsetParent)?getVisualOffsets(domElement):createCoords(0);let x=(clientRect.left+visualOffsets.x)/scale.x;let y=(clientRect.top+visualOffsets.y)/scale.y;let width=clientRect.width/scale.x;let height=clientRect.height/scale.y;if(domElement){const win=getWindow(domElement);const offsetWin=offsetParent&&isElement(offsetParent)?getWindow(offsetParent):offsetParent;let currentWin=win;let currentIFrame=getFrameElement(currentWin);while(currentIFrame&&offsetParent&&offsetWin!==currentWin){const iframeScale=getScale(currentIFrame);const iframeRect=currentIFrame.getBoundingClientRect();const css=getComputedStyle(currentIFrame);const left2=iframeRect.left+(currentIFrame.clientLeft+parseFloat(css.paddingLeft))*iframeScale.x;const top2=iframeRect.top+(currentIFrame.clientTop+parseFloat(css.paddingTop))*iframeScale.y;x*=iframeScale.x;y*=iframeScale.y;width*=iframeScale.x;height*=iframeScale.y;x+=left2;y+=top2;currentWin=getWindow(currentIFrame);currentIFrame=getFrameElement(currentWin)}}return rectToClientRect({width:width,height:height,x:x,y:y})}function getWindowScrollBarX(element,rect){const leftScroll=getNodeScroll(element).scrollLeft;if(!rect){return getBoundingClientRect(getDocumentElement(element)).left+leftScroll}return rect.left+leftScroll}function getHTMLOffset(documentElement,scroll,ignoreScrollbarX){if(ignoreScrollbarX===void 0){ignoreScrollbarX=false}const htmlRect=documentElement.getBoundingClientRect();const x=htmlRect.left+scroll.scrollLeft-(ignoreScrollbarX?0:getWindowScrollBarX(documentElement,htmlRect));const y=htmlRect.top+scroll.scrollTop;return{x:x,y:y}}function convertOffsetParentRelativeRectToViewportRelativeRect(_ref){let{elements:elements,rect:rect,offsetParent:offsetParent,strategy:strategy}=_ref;const isFixed=strategy==="fixed";const documentElement=getDocumentElement(offsetParent);const topLayer=elements?isTopLayer(elements.floating):false;if(offsetParent===documentElement||topLayer&&isFixed){return rect}let scroll={scrollLeft:0,scrollTop:0};let scale=createCoords(1);const offsets=createCoords(0);const isOffsetParentAnElement=isHTMLElement(offsetParent);if(isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed){if(getNodeName(offsetParent)!=="body"||isOverflowElement(documentElement)){scroll=getNodeScroll(offsetParent)}if(isHTMLElement(offsetParent)){const offsetRect=getBoundingClientRect(offsetParent);scale=getScale(offsetParent);offsets.x=offsetRect.x+offsetParent.clientLeft;offsets.y=offsetRect.y+offsetParent.clientTop}}const htmlOffset=documentElement&&!isOffsetParentAnElement&&!isFixed?getHTMLOffset(documentElement,scroll,true):createCoords(0);return{width:rect.width*scale.x,height:rect.height*scale.y,x:rect.x*scale.x-scroll.scrollLeft*scale.x+offsets.x+htmlOffset.x,y:rect.y*scale.y-scroll.scrollTop*scale.y+offsets.y+htmlOffset.y}}function getClientRects(element){return Array.from(element.getClientRects())}function getDocumentRect(element){const html=getDocumentElement(element);const scroll=getNodeScroll(element);const body=element.ownerDocument.body;const width=max(html.scrollWidth,html.clientWidth,body.scrollWidth,body.clientWidth);const height=max(html.scrollHeight,html.clientHeight,body.scrollHeight,body.clientHeight);let x=-scroll.scrollLeft+getWindowScrollBarX(element);const y=-scroll.scrollTop;if(getComputedStyle(body).direction==="rtl"){x+=max(html.clientWidth,body.clientWidth)-width}return{width:width,height:height,x:x,y:y}}function getViewportRect(element,strategy){const win=getWindow(element);const html=getDocumentElement(element);const visualViewport=win.visualViewport;let width=html.clientWidth;let height=html.clientHeight;let x=0;let y=0;if(visualViewport){width=visualViewport.width;height=visualViewport.height;const visualViewportBased=isWebKit();if(!visualViewportBased||visualViewportBased&&strategy==="fixed"){x=visualViewport.offsetLeft;y=visualViewport.offsetTop}}return{width:width,height:height,x:x,y:y}}function getInnerBoundingClientRect(element,strategy){const clientRect=getBoundingClientRect(element,true,strategy==="fixed");const top2=clientRect.top+element.clientTop;const left2=clientRect.left+element.clientLeft;const scale=isHTMLElement(element)?getScale(element):createCoords(1);const width=element.clientWidth*scale.x;const height=element.clientHeight*scale.y;const x=left2*scale.x;const y=top2*scale.y;return{width:width,height:height,x:x,y:y}}function getClientRectFromClippingAncestor(element,clippingAncestor,strategy){let rect;if(clippingAncestor==="viewport"){rect=getViewportRect(element,strategy)}else if(clippingAncestor==="document"){rect=getDocumentRect(getDocumentElement(element))}else if(isElement(clippingAncestor)){rect=getInnerBoundingClientRect(clippingAncestor,strategy)}else{const visualOffsets=getVisualOffsets(element);rect={x:clippingAncestor.x-visualOffsets.x,y:clippingAncestor.y-visualOffsets.y,width:clippingAncestor.width,height:clippingAncestor.height}}return rectToClientRect(rect)}function hasFixedPositionAncestor(element,stopNode){const parentNode=getParentNode(element);if(parentNode===stopNode||!isElement(parentNode)||isLastTraversableNode(parentNode)){return false}return getComputedStyle(parentNode).position==="fixed"||hasFixedPositionAncestor(parentNode,stopNode)}function getClippingElementAncestors(element,cache){const cachedResult=cache.get(element);if(cachedResult){return cachedResult}let result=getOverflowAncestors(element,[],false).filter((el=>isElement(el)&&getNodeName(el)!=="body"));let currentContainingBlockComputedStyle=null;const elementIsFixed=getComputedStyle(element).position==="fixed";let currentNode=elementIsFixed?getParentNode(element):element;while(isElement(currentNode)&&!isLastTraversableNode(currentNode)){const computedStyle=getComputedStyle(currentNode);const currentNodeIsContaining=isContainingBlock(currentNode);if(!currentNodeIsContaining&&computedStyle.position==="fixed"){currentContainingBlockComputedStyle=null}const shouldDropCurrentNode=elementIsFixed?!currentNodeIsContaining&&!currentContainingBlockComputedStyle:!currentNodeIsContaining&&computedStyle.position==="static"&&!!currentContainingBlockComputedStyle&&["absolute","fixed"].includes(currentContainingBlockComputedStyle.position)||isOverflowElement(currentNode)&&!currentNodeIsContaining&&hasFixedPositionAncestor(element,currentNode);if(shouldDropCurrentNode){result=result.filter((ancestor=>ancestor!==currentNode))}else{currentContainingBlockComputedStyle=computedStyle}currentNode=getParentNode(currentNode)}cache.set(element,result);return result}function getClippingRect(_ref){let{element:element,boundary:boundary,rootBoundary:rootBoundary,strategy:strategy}=_ref;const elementClippingAncestors=boundary==="clippingAncestors"?isTopLayer(element)?[]:getClippingElementAncestors(element,this._c):[].concat(boundary);const clippingAncestors=[...elementClippingAncestors,rootBoundary];const firstClippingAncestor=clippingAncestors[0];const clippingRect=clippingAncestors.reduce(((accRect,clippingAncestor)=>{const rect=getClientRectFromClippingAncestor(element,clippingAncestor,strategy);accRect.top=max(rect.top,accRect.top);accRect.right=min(rect.right,accRect.right);accRect.bottom=min(rect.bottom,accRect.bottom);accRect.left=max(rect.left,accRect.left);return accRect}),getClientRectFromClippingAncestor(element,firstClippingAncestor,strategy));return{width:clippingRect.right-clippingRect.left,height:clippingRect.bottom-clippingRect.top,x:clippingRect.left,y:clippingRect.top}}function getDimensions(element){const{width:width,height:height}=getCssDimensions(element);return{width:width,height:height}}function getRectRelativeToOffsetParent(element,offsetParent,strategy){const isOffsetParentAnElement=isHTMLElement(offsetParent);const documentElement=getDocumentElement(offsetParent);const isFixed=strategy==="fixed";const rect=getBoundingClientRect(element,true,isFixed,offsetParent);let scroll={scrollLeft:0,scrollTop:0};const offsets=createCoords(0);if(isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed){if(getNodeName(offsetParent)!=="body"||isOverflowElement(documentElement)){scroll=getNodeScroll(offsetParent)}if(isOffsetParentAnElement){const offsetRect=getBoundingClientRect(offsetParent,true,isFixed,offsetParent);offsets.x=offsetRect.x+offsetParent.clientLeft;offsets.y=offsetRect.y+offsetParent.clientTop}else if(documentElement){offsets.x=getWindowScrollBarX(documentElement)}}const htmlOffset=documentElement&&!isOffsetParentAnElement&&!isFixed?getHTMLOffset(documentElement,scroll):createCoords(0);const x=rect.left+scroll.scrollLeft-offsets.x-htmlOffset.x;const y=rect.top+scroll.scrollTop-offsets.y-htmlOffset.y;return{x:x,y:y,width:rect.width,height:rect.height}}function isStaticPositioned(element){return getComputedStyle(element).position==="static"}function getTrueOffsetParent(element,polyfill){if(!isHTMLElement(element)||getComputedStyle(element).position==="fixed"){return null}if(polyfill){return polyfill(element)}let rawOffsetParent=element.offsetParent;if(getDocumentElement(element)===rawOffsetParent){rawOffsetParent=rawOffsetParent.ownerDocument.body}return rawOffsetParent}function getOffsetParent(element,polyfill){const win=getWindow(element);if(isTopLayer(element)){return win}if(!isHTMLElement(element)){let svgOffsetParent=getParentNode(element);while(svgOffsetParent&&!isLastTraversableNode(svgOffsetParent)){if(isElement(svgOffsetParent)&&!isStaticPositioned(svgOffsetParent)){return svgOffsetParent}svgOffsetParent=getParentNode(svgOffsetParent)}return win}let offsetParent=getTrueOffsetParent(element,polyfill);while(offsetParent&&isTableElement(offsetParent)&&isStaticPositioned(offsetParent)){offsetParent=getTrueOffsetParent(offsetParent,polyfill)}if(offsetParent&&isLastTraversableNode(offsetParent)&&isStaticPositioned(offsetParent)&&!isContainingBlock(offsetParent)){return win}return offsetParent||getContainingBlock(element)||win}const getElementRects=async function(data){const getOffsetParentFn=this.getOffsetParent||getOffsetParent;const getDimensionsFn=this.getDimensions;const floatingDimensions=await getDimensionsFn(data.floating);return{reference:getRectRelativeToOffsetParent(data.reference,await getOffsetParentFn(data.floating),data.strategy),floating:{x:0,y:0,width:floatingDimensions.width,height:floatingDimensions.height}}};function isRTL(element){return getComputedStyle(element).direction==="rtl"}const platform={convertOffsetParentRelativeRectToViewportRelativeRect:convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement:getDocumentElement,getClippingRect:getClippingRect,getOffsetParent:getOffsetParent,getElementRects:getElementRects,getClientRects:getClientRects,getDimensions:getDimensions,getScale:getScale,isElement:isElement,isRTL:isRTL};function rectsAreEqual(a,b){return a.x===b.x&&a.y===b.y&&a.width===b.width&&a.height===b.height}function observeMove(element,onMove){let io=null;let timeoutId;const root=getDocumentElement(element);function cleanup(){var _io;clearTimeout(timeoutId);(_io=io)==null||_io.disconnect();io=null}function refresh(skip,threshold){if(skip===void 0){skip=false}if(threshold===void 0){threshold=1}cleanup();const elementRectForRootMargin=element.getBoundingClientRect();const{left:left2,top:top2,width:width,height:height}=elementRectForRootMargin;if(!skip){onMove()}if(!width||!height){return}const insetTop=floor(top2);const insetRight=floor(root.clientWidth-(left2+width));const insetBottom=floor(root.clientHeight-(top2+height));const insetLeft=floor(left2);const rootMargin=-insetTop+"px "+-insetRight+"px "+-insetBottom+"px "+-insetLeft+"px";const options={rootMargin:rootMargin,threshold:max(0,min(1,threshold))||1};let isFirstUpdate=true;function handleObserve(entries){const ratio=entries[0].intersectionRatio;if(ratio!==threshold){if(!isFirstUpdate){return refresh()}if(!ratio){timeoutId=setTimeout((()=>{refresh(false,1e-7)}),1e3)}else{refresh(false,ratio)}}if(ratio===1&&!rectsAreEqual(elementRectForRootMargin,element.getBoundingClientRect())){refresh()}isFirstUpdate=false}try{io=new IntersectionObserver(handleObserve,{...options,root:root.ownerDocument})}catch(e){io=new IntersectionObserver(handleObserve,options)}io.observe(element)}refresh(true);return cleanup}function autoUpdate(reference2,floating,update,options){if(options===void 0){options={}}const{ancestorScroll:ancestorScroll=true,ancestorResize:ancestorResize=true,elementResize:elementResize=typeof ResizeObserver==="function",layoutShift:layoutShift=typeof IntersectionObserver==="function",animationFrame:animationFrame=false}=options;const referenceEl=unwrapElement(reference2);const ancestors=ancestorScroll||ancestorResize?[...referenceEl?getOverflowAncestors(referenceEl):[],...getOverflowAncestors(floating)]:[];ancestors.forEach((ancestor=>{ancestorScroll&&ancestor.addEventListener("scroll",update,{passive:true});ancestorResize&&ancestor.addEventListener("resize",update)}));const cleanupIo=referenceEl&&layoutShift?observeMove(referenceEl,update):null;let reobserveFrame=-1;let resizeObserver=null;if(elementResize){resizeObserver=new ResizeObserver((_ref=>{let[firstEntry]=_ref;if(firstEntry&&firstEntry.target===referenceEl&&resizeObserver){resizeObserver.unobserve(floating);cancelAnimationFrame(reobserveFrame);reobserveFrame=requestAnimationFrame((()=>{var _resizeObserver;(_resizeObserver=resizeObserver)==null||_resizeObserver.observe(floating)}))}update()}));if(referenceEl&&!animationFrame){resizeObserver.observe(referenceEl)}resizeObserver.observe(floating)}let frameId;let prevRefRect=animationFrame?getBoundingClientRect(reference2):null;if(animationFrame){frameLoop()}function frameLoop(){const nextRefRect=getBoundingClientRect(reference2);if(prevRefRect&&!rectsAreEqual(prevRefRect,nextRefRect)){update()}prevRefRect=nextRefRect;frameId=requestAnimationFrame(frameLoop)}update();return()=>{var _resizeObserver2;ancestors.forEach((ancestor=>{ancestorScroll&&ancestor.removeEventListener("scroll",update);ancestorResize&&ancestor.removeEventListener("resize",update)}));cleanupIo==null||cleanupIo();(_resizeObserver2=resizeObserver)==null||_resizeObserver2.disconnect();resizeObserver=null;if(animationFrame){cancelAnimationFrame(frameId)}}}const offset=offset$1;const shift=shift$1;const flip=flip$1;const arrow=arrow$1;const computePosition=(reference2,floating,options)=>{const cache=new Map;const mergedOptions={platform:platform,...options};const platformWithCache={...mergedOptions.platform,_c:cache};return computePosition$1(reference2,floating,{...mergedOptions,platform:platformWithCache})};const TOOLTIP_OFFSET=20;const TOOLTIP_TIMEOUT=250;const SAFE_ZONE_MARGIN=1;class PbTooltip extends PbEnhancedElement{static get selector(){return"[data-pb-tooltip-kit]"}connect(){if(this.tooltipInteraction){document.addEventListener("mousemove",(e=>{this.lastMouseX=e.clientX;this.lastMouseY=e.clientY}))}this.triggerElements.forEach((trigger=>{const method=this.effectiveTriggerMethod;const interactionEnabled=this.tooltipInteraction;if(method==="click"){trigger.addEventListener("click",(e=>{if(this.useClickToOpen){e.preventDefault();if(this.isTooltipVisible()){this.hideTooltip()}else{this.showTooltip(trigger)}}else{this.showTooltip(trigger)}}))}else{if(!this.useClickToOpen){trigger.addEventListener("mouseenter",(()=>{clearSafeZoneListener(this);clearTimeout(this.mouseleaveTimeout);this.currentTrigger=trigger;const delayOpen=this.delayOpen?parseInt(this.delayOpen):TOOLTIP_TIMEOUT;this.mouseenterTimeout=setTimeout((()=>{this.showTooltip(trigger);if(interactionEnabled){this.checkCloseTooltip(trigger)}}),delayOpen)}));trigger.addEventListener("mouseleave",(()=>{clearTimeout(this.mouseenterTimeout);if(this.delayClose){const delayClose=parseInt(this.delayClose);this.mouseleaveTimeout=setTimeout((()=>{if(interactionEnabled){this.attachSafeZoneListener()}else{this.hideTooltip()}}),delayClose)}else{if(interactionEnabled){this.attachSafeZoneListener()}else{this.hideTooltip()}}}));if(interactionEnabled){this.tooltip.addEventListener("mouseenter",(()=>{clearSafeZoneListener(this)}));this.tooltip.addEventListener("mouseleave",(()=>{this.attachSafeZoneListener()}))}}}}))}isTooltipVisible(){return this.tooltip&&this.tooltip.classList.contains("show")}attachSafeZoneListener(){clearSafeZoneListener(this);this.safeZoneHandler=e=>{if(!this.currentTrigger)return;const triggerRect=this.currentTrigger.getBoundingClientRect();const tooltipRect=this.tooltip.getBoundingClientRect();const safeRect=getSafeZone(triggerRect,tooltipRect,this.position,SAFE_ZONE_MARGIN);if(!isPointInsideRect(e.clientX,e.clientY,safeRect)){this.hideTooltip();clearSafeZoneListener(this)}};document.addEventListener("mousemove",this.safeZoneHandler)}checkCloseTooltip(trigger){document.querySelector("body").addEventListener("click",(({target:target})=>{const isTooltip=target.closest(`#${this.tooltipId}`)===this.tooltip;const isTrigger=target.closest(this.triggerElementSelector)===trigger;if(isTrigger||isTooltip){this.checkCloseTooltip(trigger)}else{this.hideTooltip()}}),{once:true})}showTooltip(trigger){if(this.shouldShowTooltip==="false")return;clearSafeZoneListener(this);this.tooltip.style.opacity="1";this.tooltip.style.visibility="visible";this.tooltip.style.pointerEvents="auto";if(this.cleanup){this.cleanup()}const arrowElement=document.querySelector(`#${this.tooltipId}-arrow`);this.cleanup=autoUpdate(trigger,this.tooltip,(()=>{computePosition(trigger,this.tooltip,{placement:this.position,strategy:"fixed",middleware:[offset({mainAxis:TOOLTIP_OFFSET,crossAxis:0}),flip(),shift(),arrow({element:arrowElement})]}).then((({x:x,y:y,placement:placement,middlewareData:middlewareData})=>{Object.assign(this.tooltip.style,{left:`${x}px`,top:`${y}px`,position:"fixed"});this.tooltip.setAttribute("data-popper-placement",placement);if(arrowElement&&middlewareData.arrow){const{x:arrowX,y:arrowY}=middlewareData.arrow;Object.assign(arrowElement.style,{left:arrowX!=null?`${arrowX}px`:"",top:arrowY!=null?`${arrowY}px`:"",position:"absolute"})}}))}));this.tooltip.classList.add("show");if(this.effectiveTriggerMethod==="click"&&!this.useClickToOpen){clearTimeout(this.autoHideTimeout);this.autoHideTimeout=setTimeout((()=>{this.hideTooltip()}),1e3)}}hideTooltip(){if(!this.tooltip)return;this.tooltip.classList.add("fade_out");setTimeout((()=>{if(this.cleanup){this.cleanup();this.cleanup=null}this.tooltip.classList.remove("show");this.tooltip.classList.remove("fade_out");this.tooltip.style.opacity="0";this.tooltip.style.visibility="hidden";this.tooltip.style.pointerEvents="none";this.tooltip.style.position="";this.tooltip.style.top="";this.tooltip.style.left="";this.tooltip.style.transform=""}),TOOLTIP_TIMEOUT)}get triggerElements(){let triggerEl;if(this.triggerElementId){triggerEl=document.querySelector(`#${this.triggerElementId}`)}else if(this.triggerElementSelector){const selectorIsId=this.triggerElementSelector.indexOf("#")>-1;triggerEl=selectorIsId?document.querySelector(this.triggerElementSelector):document.querySelectorAll(this.triggerElementSelector)}else{triggerEl=this.element}if(!triggerEl){console.error("Tooltip Kit: No valid trigger element found!");return[]}if(triggerEl.length===void 0){triggerEl=[triggerEl]}return triggerEl}get tooltip(){return this._tooltip=this._tooltip||this.element.querySelector(`#${this.tooltipId}`)}get position(){return this.element.dataset.pbTooltipPosition}get triggerElementId(){return this.element.dataset.pbTooltipTriggerElementId}get tooltipId(){return this.element.dataset.pbTooltipTooltipId}get triggerElementSelector(){return this.element.dataset.pbTooltipTriggerElementSelector}get shouldShowTooltip(){return this.element.dataset.pbTooltipShowTooltip}get triggerMethod(){return this.element.dataset.pbTooltipTriggerMethod||"hover"}get useClickToOpen(){return this.element.dataset.pbTooltipUseClickToOpen==="true"}get effectiveTriggerMethod(){return this.useClickToOpen?"click":this.triggerMethod}get tooltipInteraction(){return this.element.dataset.pbTooltipInteraction==="true"}get delayOpen(){return this.element.dataset.pbTooltipDelayOpen}get delayClose(){return this.element.dataset.pbTooltipDelayClose}}function clearSafeZoneListener(context){if(context.safeZoneHandler){document.removeEventListener("mousemove",context.safeZoneHandler);context.safeZoneHandler=null}}function getSafeZone(triggerRect,tooltipRect,placement,margin){let safeRect={};if(placement.startsWith("top")){safeRect.left=triggerRect.left-margin;safeRect.right=triggerRect.right+margin;safeRect.top=tooltipRect.bottom-margin;safeRect.bottom=triggerRect.top+margin}else if(placement.startsWith("bottom")){safeRect.left=triggerRect.left-margin;safeRect.right=triggerRect.right+margin;safeRect.top=triggerRect.bottom-margin;safeRect.bottom=tooltipRect.top+margin}else if(placement.startsWith("left")){safeRect.top=triggerRect.top-margin;safeRect.bottom=triggerRect.bottom+margin;safeRect.left=tooltipRect.right-margin;safeRect.right=triggerRect.left+margin}else if(placement.startsWith("right")){safeRect.top=triggerRect.top-margin;safeRect.bottom=triggerRect.bottom+margin;safeRect.left=triggerRect.right-margin;safeRect.right=tooltipRect.left+margin}else{safeRect={left:triggerRect.left-margin,right:triggerRect.right+margin,top:triggerRect.top-margin,bottom:triggerRect.bottom+margin}}return safeRect}function isPointInsideRect(x,y,rect){return x>=rect.left&&x<=rect.right&&y>=rect.top&&y<=rect.bottom}class PbTypeahead extends PbEnhancedElement{static get selector(){return"[data-pb-typeahead-kit]"}connect(){this.element.addEventListener("keydown",(event=>this.handleKeydown(event)));this.searchInput.addEventListener("focus",(()=>this.debouncedSearch()));this.searchInput.addEventListener("input",(()=>this.debouncedSearch()));this.resultsElement.addEventListener("click",(event=>this.optionSelected(event)));if(this.clearOnContextChange&&this.searchContextElement){this.searchContextElement.addEventListener("change",(()=>{this.searchInputClear();this.resultsCacheClear();this.clearResults()}))}}get optionsByContext(){return this.element.dataset.pbTypeaheadKitOptionsByContext?JSON.parse(this.element.dataset.pbTypeaheadKitOptionsByContext):null}get searchContextElement(){var _a;const selector=this.element.dataset.pbTypeaheadKitSearchContextSelector;if(!selector)return null;const found=((_a=this.element.parentNode)==null?void 0:_a.querySelector(`#${selector}`))||this.element.closest(selector);return found||null}get clearOnContextChange(){return this.element.dataset.pbTypeaheadKitClearOnContextChange==="true"}handleKeydown(event){if(event.key==="ArrowUp"){event.preventDefault();this.focusPreviousOption()}else if(event.key==="ArrowDown"){event.preventDefault();this.focusNextOption()}}search(){if(this.searchTerm.length<parseInt(this.searchTermMinimumLength))return this.clearResults();this.toggleResultsLoadingIndicator(true);this.showResults();const searchTerm=this.searchTerm;const searchContext=this.searchContext;if(this.optionsByContext&&Object.keys(this.optionsByContext).length>0){const contextArray=this.optionsByContext[searchContext]||[];const filteredResults=contextArray.filter((obj=>obj.label&&obj.label.toLowerCase().includes(searchTerm.toLowerCase())));const optionFragments=filteredResults.map((obj=>{const singleOption=document.createDocumentFragment();singleOption.appendChild(document.createTextNode(obj.label));return singleOption}));this.resultsCacheUpdate(searchTerm,searchContext,optionFragments)}else{const search={searchingFor:searchTerm,searchingContext:searchContext,setResults:results=>{this.resultsCacheUpdate(searchTerm,searchContext,results)}};this.element.dispatchEvent(new CustomEvent("pb-typeahead-kit-search",{bubbles:true,detail:search}))}}resultsCacheUpdate(searchTerm,searchContext,results){const searchTermAndContext=this.cacheKeyFor(searchTerm,searchContext);if(this.resultsOptionCache.has(searchTermAndContext))this.resultsOptionCache.delete(searchTermAndContext);if(this.resultsOptionCache.size>32)this.resultsOptionCache.delete(this.resultsOptionCache.keys().next().value);this.resultsOptionCache.set(searchTermAndContext,results);this.showResults()}resultsCacheClear(){this.resultsOptionCache.clear()}get debouncedSearch(){return this._debouncedSearch=this._debouncedSearch||debounce$2(this.search,parseInt(this.searchDebounceTimeout)).bind(this)}showResults(){if(!this.resultsOptionCache.has(this.searchTermAndContext))return;this.toggleResultsLoadingIndicator(false);this.clearResults();for(const result of this.resultsOptionCache.get(this.searchTermAndContext)){this.resultsElement.appendChild(this.newResultOption(result.cloneNode(true)))}for(const result of this.resultsElement.querySelectorAll("[data-result-option-item]")){result.addEventListener("mousedown",(event=>this.optionSelected(event)))}}optionSelected(event){const resultOption=event.target.closest("[data-result-option-item]");if(!resultOption)return;const selectedText=resultOption.textContent.trim();this._validSelection=true;this.removeValidationError();if(this.searchContextElement)this.searchInput.value=selectedText;this.resultsCacheClear();if(!this.searchContextElement)this.searchInputClear();this.clearResults();this.element.dispatchEvent(new CustomEvent("pb-typeahead-kit-result-option-selected",{bubbles:true,detail:{selected:resultOption,typeahead:this}}))}removeValidationError(){const inputWrapper=this.searchInput.closest(".text_input_wrapper");if(inputWrapper){const errorMessage=inputWrapper.querySelector(".pb_body_kit_negative");if(errorMessage){errorMessage.style.display="none"}this.searchInput.classList.remove("error")}}showValidationError(){const inputWrapper=this.searchInput.closest(".text_input_wrapper");if(inputWrapper){const errorMessage=inputWrapper.querySelector(".pb_body_kit_negative");if(errorMessage){errorMessage.style.display="block"}this.searchInput.classList.add("error")}}clearResults(){this.resultsElement.innerHTML=""}newResultOption(content){const resultOption=this.resultOptionTemplate.content.cloneNode(true);resultOption.querySelector('slot[name="content"]').replaceWith(content);return resultOption}focusPreviousOption(){const currentIndex=this.resultOptionItems.indexOf(this.currentSelectedResultOptionItem);const previousIndex=currentIndex-1;const previousOptionItem=this.resultOptionItems[previousIndex]||this.resultOptionItems[this.resultOptionItems.length-1];previousOptionItem.focus()}focusNextOption(){const currentIndex=this.resultOptionItems.indexOf(this.currentSelectedResultOptionItem);const nextIndex=currentIndex+1;const nextOptionItem=this.resultOptionItems[nextIndex]||this.resultOptionItems[0];nextOptionItem.focus()}get resultOptionItems(){return Array.from(this.resultsElement.querySelectorAll("[data-result-option-item]"))}get currentSelectedResultOptionItem(){return document.activeElement.closest("[data-result-option-item]")}get searchInput(){return this._searchInput=this._searchInput||this.element.querySelector('input[type="search"]')}get searchTerm(){return this.searchInput.value}get searchContext(){if(this._searchContext)return this._searchContext;const selector=this.element.dataset.searchContextValueSelector;if(selector)return(this.element.parentNode.querySelector(selector)||this.element.closest(selector)).value;else if(this.searchContextElement){return this.searchContextElement.value}return null}set searchContext(value){this._searchContext=value}get searchTermAndContext(){return this.cacheKeyFor(this.searchTerm,this.searchContext)}cacheKeyFor(searchTerm,searchContext){return[searchTerm,JSON.stringify(searchContext)].join()}searchInputClear(){this.searchInput.value=""}get searchTermMinimumLength(){return this.element.dataset.pbTypeaheadKitSearchTermMinimumLength}get searchDebounceTimeout(){return this.element.dataset.pbTypeaheadKitSearchDebounceTimeout}get resultsElement(){return this._resultsElement=this._resultsElement||this.element.querySelector("[data-pb-typeahead-kit-results]")}get resultOptionTemplate(){return this._resultOptionTemplate=this._resultOptionTemplate||this.element.querySelector("template[data-pb-typeahead-kit-result-option]")}get resultsOptionCache(){return this._resultsOptionCache=this._resultsOptionCache||new Map}get resultsLoadingIndicator(){return this._resultsLoadingIndicator=this._resultsLoadingIndicator||this.element.querySelector("[data-pb-typeahead-kit-loading-indicator]")}toggleResultsLoadingIndicator(visible){let visibilityProperty="0";if(visible)visibilityProperty="1";this.resultsLoadingIndicator.style.opacity=visibilityProperty}}const formHelper=()=>{const loadingForm=document.querySelector(".pb_form_loading");if(loadingForm){loadingForm.addEventListener("submit",(function(event){const submitButton=event["submitter"];const cancelButton=event["target"].querySelector('button[type="reset"]');if(submitButton){let currentClass=submitButton.className;let newClass=currentClass.replace("pb_button_enabled","pb_button_disabled pb_button_loading");let cancelClass=cancelButton?cancelButton.className:"";let newCancelClass=cancelClass.replace("_enabled","_disabled");submitButton.disabled=true;submitButton.className=newClass;if(cancelButton){cancelButton.disabled=true;cancelButton.className=newCancelClass}}}))}};const lightest="1px";const lighter="2px";const light="4px";const normal$1="0";const heavy="5px";const heavier="6px";const heaviest="7px";const border_radius_xs="4px";const border_radius_sm="4px";const border_radius_md="6px";const border_radius_lg="8px";const border_radius_xl="16px";const border_radius_none="0";const border_radius_rounded="1000px";const _border_radius_module={lightest:lightest,lighter:lighter,light:light,normal:normal$1,heavy:heavy,heavier:heavier,heaviest:heaviest,border_radius_xs:border_radius_xs,border_radius_sm:border_radius_sm,border_radius_md:border_radius_md,border_radius_lg:border_radius_lg,border_radius_xl:border_radius_xl,border_radius_none:border_radius_none,border_radius_rounded:border_radius_rounded};const tightest="1";const tighter="1.2";const tight="1.4";const normal="1.5";const loose="1.6";const looser="1.8";const loosest="2";const _line_height_module={tightest:tightest,tighter:tighter,tight:tight,normal:normal,loose:loose,looser:looser,loosest:loosest};const opacity_1="0.1";const opacity_2="0.2";const opacity_3="0.3";const opacity_4="0.4";const opacity_5="0.5";const opacity_6="0.6";const opacity_7="0.7";const opacity_8="0.8";const opacity_9="0.9";const _opacity_module={opacity_1:opacity_1,opacity_2:opacity_2,opacity_3:opacity_3,opacity_4:opacity_4,opacity_5:opacity_5,opacity_6:opacity_6,opacity_7:opacity_7,opacity_8:opacity_8,opacity_9:opacity_9};const zindex_1="100";const zindex_2="100";const zindex_3="100";const zindex_4="100";const zindex_5="100";const zindex_6="100";const zindex_7="100";const zindex_8="100";const zindex_9="100";const _positioning_module={zindex_1:zindex_1,zindex_2:zindex_2,zindex_3:zindex_3,zindex_4:zindex_4,zindex_5:zindex_5,zindex_6:zindex_6,zindex_7:zindex_7,zindex_8:zindex_8,zindex_9:zindex_9};const hover_scale_sm="_scale-module__hover_scale_sm___mttFB";const hover_scale_md="_scale-module__hover_scale_md___ipMVm";const hover_scale_lg="_scale-module__hover_scale_lg___-EkY0";const _scale_module={hover_scale_sm:hover_scale_sm,hover_scale_md:hover_scale_md,hover_scale_lg:hover_scale_lg};const xs="575px";const sm="576px";const md="768px";const lg="992px";const xl="1200px";const _screen_sizes_module={xs:xs,sm:sm,md:md,lg:lg,xl:xl};const shadow_none="0 0 0 0 transparent";const shadow_deep="0 4px 10px 0 rgba(60, 106, 172, 0.16)";const shadow_deeper="0 12px 28px 0 rgba(60, 106, 172, 0.18)";const shadow_deepest="0 30px 38px 4px rgba(60, 106, 172, 0.2), 0 2px 14px 4px rgba(60, 106, 172, 0.1)";const _shadows_module={shadow_none:shadow_none,shadow_deep:shadow_deep,shadow_deeper:shadow_deeper,shadow_deepest:shadow_deepest};const space_xxs="4px";const space_xs="8px";const space_sm="16px";const space_md="24px";const space_lg="32px";const space_xl="40px";const none="0";const _spacing_module={space_xxs:space_xxs,space_xs:space_xs,space_sm:space_sm,space_md:space_md,space_lg:space_lg,space_xl:space_xl,none:none};export{arrow$1 as $,PbPopover as A,PbTable as B,PbTooltip as C,DateTime as D,PbTypeahead as E,formHelper as F,_line_height_module as G,_opacity_module as H,_positioning_module as I,_scale_module as J,_screen_sizes_module as K,_shadows_module as L,_spacing_module as M,typography as N,PbEnhancedElement as O,PbTextarea as P,debounce$2 as Q,ReactDOMServer as R,filter as S,omit as T,get as U,createPopper as V,uniqueId as W,flip$1 as X,offset$1 as Y,shift$1 as Z,_border_radius_module as _,usePBCopy as a,computePosition$1 as a0,createCoords$1 as a1,round$1 as a2,max$1 as a3,min$1 as a4,rectToClientRect as a5,merge as a6,cloneDeep as a7,isString as a8,getAugmentedNamespace as b,getDefaultExportFromCjs as c,datePickerHelper as d,useDropdown as e,find as f,getAllIcons as g,colors as h,isEmpty as i,mapTheme as j,highchartsTheme as k,highchartsDarkTheme as l,map as m,noop as n,omitBy as o,partial as p,gaugeTheme as q,circleChartTheme as r,lineGraphTheme as s,barGraphTheme as t,useCollapsible as u,commonSettings as v,dataColors as w,pbLineGraph as x,barGraphSettings as y,pbIndicator as z};
|
|
29
|
+
var __assign2=function(){__assign2=Object.assign||function __assign3(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)if(Object.prototype.hasOwnProperty.call(s,p))t[p]=s[p]}return t};return __assign2.apply(this,arguments)};var monthToStr2=function(monthNumber,shorthand,locale){return locale.months[shorthand?"shorthand":"longhand"][monthNumber]};function clearNode2(node){while(node.firstChild)node.removeChild(node.firstChild)}function getEventTarget2(event){try{if(typeof event.composedPath==="function"){var path=event.composedPath();return path[0]}return event.target}catch(error2){return event.target}}var defaultConfig={shorthand:false,dateFormat:"F Y",altFormat:"F Y",theme:"light"};function monthSelectPlugin2(pluginConfig){var config=__assign2(__assign2({},defaultConfig),pluginConfig);return function(fp){fp.config.dateFormat=config.dateFormat;fp.config.altFormat=config.altFormat;var self={monthsContainer:null};function clearUnnecessaryDOMElements(){if(!fp.rContainer)return;clearNode2(fp.rContainer);for(var index=0;index<fp.monthElements.length;index++){var element=fp.monthElements[index];if(!element.parentNode)continue;element.parentNode.removeChild(element)}}function build(){if(!fp.rContainer)return;self.monthsContainer=fp._createElement("div","flatpickr-monthSelect-months");self.monthsContainer.tabIndex=-1;buildMonths();fp.rContainer.appendChild(self.monthsContainer);fp.calendarContainer.classList.add("flatpickr-monthSelect-theme-"+config.theme)}function buildMonths(){if(!self.monthsContainer)return;clearNode2(self.monthsContainer);var frag=document.createDocumentFragment();for(var i=0;i<12;i++){var month=fp.createDay("flatpickr-monthSelect-month",new Date(fp.currentYear,i),0,i);if(month.dateObj.getMonth()===(new Date).getMonth()&&month.dateObj.getFullYear()===(new Date).getFullYear())month.classList.add("today");month.textContent=monthToStr2(i,config.shorthand,fp.l10n);month.addEventListener("click",selectMonth);frag.appendChild(month)}self.monthsContainer.appendChild(frag);if(fp.config.minDate&&fp.currentYear===fp.config.minDate.getFullYear())fp.prevMonthNav.classList.add("flatpickr-disabled");else fp.prevMonthNav.classList.remove("flatpickr-disabled");if(fp.config.maxDate&&fp.currentYear===fp.config.maxDate.getFullYear())fp.nextMonthNav.classList.add("flatpickr-disabled");else fp.nextMonthNav.classList.remove("flatpickr-disabled")}function bindEvents(){fp._bind(fp.prevMonthNav,"click",(function(e){e.preventDefault();e.stopPropagation();fp.changeYear(fp.currentYear-1);selectYear();buildMonths()}));fp._bind(fp.nextMonthNav,"click",(function(e){e.preventDefault();e.stopPropagation();fp.changeYear(fp.currentYear+1);selectYear();buildMonths()}));fp._bind(self.monthsContainer,"mouseover",(function(e){if(fp.config.mode==="range")fp.onMouseOver(getEventTarget2(e),"flatpickr-monthSelect-month")}))}function setCurrentlySelected(){if(!fp.rContainer)return;if(!fp.selectedDates.length)return;var currentlySelected=fp.rContainer.querySelectorAll(".flatpickr-monthSelect-month.selected");for(var index=0;index<currentlySelected.length;index++){currentlySelected[index].classList.remove("selected")}var targetMonth=fp.selectedDates[0].getMonth();var month=fp.rContainer.querySelector(".flatpickr-monthSelect-month:nth-child("+(targetMonth+1)+")");if(month){month.classList.add("selected")}}function selectYear(){var selectedDate=fp.selectedDates[0];if(selectedDate){selectedDate=new Date(selectedDate);selectedDate.setFullYear(fp.currentYear);if(fp.config.minDate&&selectedDate<fp.config.minDate){selectedDate=fp.config.minDate}if(fp.config.maxDate&&selectedDate>fp.config.maxDate){selectedDate=fp.config.maxDate}fp.currentYear=selectedDate.getFullYear()}fp.currentYearElement.value=String(fp.currentYear);if(fp.rContainer){var months2=fp.rContainer.querySelectorAll(".flatpickr-monthSelect-month");months2.forEach((function(month){month.dateObj.setFullYear(fp.currentYear);if(fp.config.minDate&&month.dateObj<fp.config.minDate||fp.config.maxDate&&month.dateObj>fp.config.maxDate){month.classList.add("flatpickr-disabled")}else{month.classList.remove("flatpickr-disabled")}}))}setCurrentlySelected()}function selectMonth(e){e.preventDefault();e.stopPropagation();var eventTarget=getEventTarget2(e);if(!(eventTarget instanceof Element))return;if(eventTarget.classList.contains("flatpickr-disabled"))return;if(eventTarget.classList.contains("notAllowed"))return;setMonth(eventTarget.dateObj);if(fp.config.closeOnSelect){var single=fp.config.mode==="single";var range=fp.config.mode==="range"&&fp.selectedDates.length===2;if(single||range)fp.close()}}function setMonth(date){var selectedDate=new Date(fp.currentYear,date.getMonth(),date.getDate());var selectedDates=[];switch(fp.config.mode){case"single":selectedDates=[selectedDate];break;case"multiple":selectedDates.push(selectedDate);break;case"range":if(fp.selectedDates.length===2){selectedDates=[selectedDate]}else{selectedDates=fp.selectedDates.concat([selectedDate]);selectedDates.sort((function(a,b){return a.getTime()-b.getTime()}))}break}fp.setDate(selectedDates,true);setCurrentlySelected()}var shifts={37:-1,39:1,40:3,38:-3};function onKeyDown(_,__,___,e){var shouldMove=shifts[e.keyCode]!==void 0;if(!shouldMove&&e.keyCode!==13){return}if(!fp.rContainer||!self.monthsContainer)return;var currentlySelected=fp.rContainer.querySelector(".flatpickr-monthSelect-month.selected");var index=Array.prototype.indexOf.call(self.monthsContainer.children,document.activeElement);if(index===-1){var target=currentlySelected||self.monthsContainer.firstElementChild;target.focus();index=target.$i}if(shouldMove){self.monthsContainer.children[(12+index+shifts[e.keyCode])%12].focus()}else if(e.keyCode===13&&self.monthsContainer.contains(document.activeElement)){setMonth(document.activeElement.dateObj)}}function closeHook(){var _a;if(((_a=fp.config)===null||_a===void 0?void 0:_a.mode)==="range"&&fp.selectedDates.length===1)fp.clear(false);if(!fp.selectedDates.length)buildMonths()}function stubCurrentMonth(){config._stubbedCurrentMonth=fp._initialDate.getMonth();fp._initialDate.setMonth(config._stubbedCurrentMonth);fp.currentMonth=config._stubbedCurrentMonth}function unstubCurrentMonth(){if(!config._stubbedCurrentMonth)return;fp._initialDate.setMonth(config._stubbedCurrentMonth);fp.currentMonth=config._stubbedCurrentMonth;delete config._stubbedCurrentMonth}function destroyPluginInstance(){if(self.monthsContainer!==null){var months2=self.monthsContainer.querySelectorAll(".flatpickr-monthSelect-month");for(var index=0;index<months2.length;index++){months2[index].removeEventListener("click",selectMonth)}}}return{onParseConfig:function(){fp.config.enableTime=false},onValueUpdate:setCurrentlySelected,onKeyDown:onKeyDown,onReady:[stubCurrentMonth,clearUnnecessaryDOMElements,build,bindEvents,setCurrentlySelected,function(){fp.config.onClose.push(closeHook);fp.loadedPlugins.push("monthSelect")}],onDestroy:[unstubCurrentMonth,destroyPluginInstance,function(){fp.config.onClose=fp.config.onClose.filter((function(hook){return hook!==closeHook}))}]}}}return monthSelectPlugin2}))})(monthSelect$1);return monthSelect$1.exports}var monthSelectExports=requireMonthSelect();const monthSelectPlugin=getDefaultExportFromCjs(monthSelectExports);var weekSelect$2={exports:{}};var weekSelect$1=weekSelect$2.exports;var hasRequiredWeekSelect;function requireWeekSelect(){if(hasRequiredWeekSelect)return weekSelect$2.exports;hasRequiredWeekSelect=1;(function(module,exports){(function(global,factory){module.exports=factory()})(weekSelect$1,(function(){function getEventTarget2(event){try{if(typeof event.composedPath==="function"){var path=event.composedPath();return path[0]}return event.target}catch(error2){return event.target}}function weekSelectPlugin(){return function(fp){function onDayHover(event){var day=getEventTarget2(event);if(!day.classList.contains("flatpickr-day"))return;var days2=fp.days.childNodes;var dayIndex=day.$i;var dayIndSeven=dayIndex/7;var weekStartDay=days2[7*Math.floor(dayIndSeven)].dateObj;var weekEndDay=days2[7*Math.ceil(dayIndSeven+.01)-1].dateObj;for(var i=days2.length;i--;){var day_1=days2[i];var date=day_1.dateObj;if(date>weekEndDay||date<weekStartDay)day_1.classList.remove("inRange");else day_1.classList.add("inRange")}}function highlightWeek(){var selDate=fp.latestSelectedDateObj;if(selDate!==void 0&&selDate.getMonth()===fp.currentMonth&&selDate.getFullYear()===fp.currentYear){fp.weekStartDay=fp.days.childNodes[7*Math.floor(fp.selectedDateElem.$i/7)].dateObj;fp.weekEndDay=fp.days.childNodes[7*Math.ceil(fp.selectedDateElem.$i/7+.01)-1].dateObj}var days2=fp.days.childNodes;for(var i=days2.length;i--;){var date=days2[i].dateObj;if(date>=fp.weekStartDay&&date<=fp.weekEndDay)days2[i].classList.add("week","selected")}}function clearHover(){var days2=fp.days.childNodes;for(var i=days2.length;i--;)days2[i].classList.remove("inRange")}function onReady(){if(fp.daysContainer!==void 0)fp.daysContainer.addEventListener("mouseover",onDayHover)}function onDestroy(){if(fp.daysContainer!==void 0)fp.daysContainer.removeEventListener("mouseover",onDayHover)}return{onValueUpdate:highlightWeek,onMonthChange:highlightWeek,onYearChange:highlightWeek,onOpen:highlightWeek,onClose:clearHover,onParseConfig:function(){fp.config.mode="single";fp.config.enableTime=false;fp.config.dateFormat=fp.config.dateFormat?fp.config.dateFormat:"\\W\\e\\e\\k #W, Y";fp.config.altFormat=fp.config.altFormat?fp.config.altFormat:"\\W\\e\\e\\k #W, Y"},onReady:[onReady,highlightWeek,function(){fp.loadedPlugins.push("weekSelect")}],onDestroy:onDestroy}}}return weekSelectPlugin}))})(weekSelect$2);return weekSelect$2.exports}var weekSelectExports=requireWeekSelect();const weekSelect=getDefaultExportFromCjs(weekSelectExports);const getTimezoneText=inputDate=>{const tzAbbr=inputDate.toLocaleDateString("en-US",{day:"2-digit",timeZoneName:"short"}).slice(4);const tzText=inputDate.toLocaleDateString("en-US",{day:"2-digit",timeZoneName:"long"}).slice(4);return`${tzAbbr} (${tzText})`};function timeSelectPlugin(props){return function(fp){const generateMeridiemCard=text=>{const selectableCard=document.createElement("div");selectableCard.className="pb_selectable_card_kit_enabled";const cardInput=document.createElement("input"),cardInputId=`datePicker-${fp.element.id}-${text}`;cardInput.className="datePicker-AMPM";cardInput.id=cardInputId;cardInput.name="datepicker-ampm";cardInput.type="radio";cardInput.value=text;const cardLabel=document.createElement("label"),cardLabelBuffer=document.createElement("div");cardLabel.className=`label-${text.toLowerCase()}`;cardLabel.setAttribute("for",cardInputId);cardLabelBuffer.className="buffer";cardLabelBuffer.innerHTML=text;cardLabel.append(cardLabelBuffer);selectableCard.prepend(cardInput);selectableCard.append(cardLabel);return selectableCard};const generateMeridiemToggle=()=>{fp.amPM.style.display="none";const formGroupKit=document.createElement("div");formGroupKit.className="pb_form_group_kit";const amCard=generateMeridiemCard("AM");amCard.addEventListener("click",(()=>{fp.selectedDates[0].setHours(fp.selectedDates[0].getHours()%12+12*0);fp.setDate(fp.selectedDates[0],true)}));const pmCard=generateMeridiemCard("PM");pmCard.addEventListener("click",(()=>{fp.selectedDates[0].setHours(fp.selectedDates[0].getHours()%12+12*1);fp.setDate(fp.selectedDates[0],true)}));formGroupKit.prepend(amCard);formGroupKit.append(pmCard);const meridiemContainer=document.createElement("div");meridiemContainer.className="meridiem";meridiemContainer.append(formGroupKit);fp.timeContainer.append(meridiemContainer)};const getMeridiem=dateObj=>dateObj[0].getHours()<12?"AM":"PM";const updateMeridiemToggle=forceClick=>{if(!fp.selectedDates.length)return;const uncheckedClass="pb_selectable_card_kit_enabled",checkedClass="pb_selectable_card_kit_checked_enabled",pickerAM=document.getElementById(`datePicker-${fp.element.id}-AM`),pickerPM=document.getElementById(`datePicker-${fp.element.id}-PM`),meridiem=getMeridiem(fp.selectedDates);{pickerAM.checked=false;pickerPM.checked=false;pickerPM.checked=meridiem==="PM";pickerAM.checked=meridiem==="AM"}if(meridiem==="PM"){pickerPM.parentElement.className=checkedClass;pickerAM.parentElement.className=uncheckedClass}else if(meridiem==="AM"){pickerAM.parentElement.className=checkedClass;pickerPM.parentElement.className=uncheckedClass}};return{onValueUpdate(){updateMeridiemToggle()},onOpen(){updateMeridiemToggle()},onReady(){const id=fp.input.id;if(!id||!(fp==null?void 0:fp.timeContainer))return;fp.timeContainer.classList.add("pb_time_selection");fp.minuteElement.step="1";if(props.caption){const captionContainer=document.createElement("div");captionContainer.className="pb_caption_kit_md";captionContainer.innerHTML=props==null?void 0:props.caption;fp.timeContainer.prepend(captionContainer)}generateMeridiemToggle();updateMeridiemToggle();if(props.showTimezone){const subcaptionContainer=document.createElement("div");subcaptionContainer.className="pb_caption_kit_xs";subcaptionContainer.innerHTML=getTimezoneText(fp._initialDate);fp.timeContainer.append(subcaptionContainer)}fp.loadedPlugins.push("timeSelectPlugin")}}}}let activeLabel="";const quickPickPlugin=(thisRangesEndToday,customQuickPickDates,defaultDate)=>function(fp){const today=new Date;const yesterday=DateTime.getYesterdayDate(new Date);const thisWeekStartDate=DateTime.getFirstDayOfWeek(new Date);const thisWeekEndDate=thisRangesEndToday?new Date:DateTime.getLastDayOfWeek(new Date);const lastWeekStartDate=DateTime.getPreviousWeekStartDate(new Date);const lastWeekEndDate=DateTime.getPreviousWeekEndDate(new Date);const thisMonthStartDate=DateTime.getMonthStartDate(new Date);const thisMonthEndDate=thisRangesEndToday?new Date:DateTime.getMonthEndDate(new Date);const lastMonthStartDate=DateTime.getPreviousMonthStartDate(new Date);const lastMonthEndDate=DateTime.getPreviousMonthEndDate(new Date);const thisQuarterStartDate=DateTime.getQuarterStartDate(new Date);const thisQuarterEndDate=thisRangesEndToday?new Date:DateTime.getQuarterEndDate(new Date);const lastQuarterStartDate=DateTime.getPreviousQuarterStartDate(new Date);const lastQuarterEndDate=DateTime.getPreviousQuarterEndDate(new Date);const thisYearStartDate=DateTime.getYearStartDate(new Date);const thisYearEndDate=thisRangesEndToday?new Date:DateTime.getYearEndDate(new Date);const lastYearStartDate=DateTime.getPreviousYearStartDate(new Date);const lastYearEndDate=DateTime.getPreviousYearEndDate(new Date);const calculateDateRange=(timePeriod,amount)=>{const endDate=new Date;const startDate=new Date;switch(timePeriod){case"days":startDate.setDate(endDate.getDate()-amount);break;case"weeks":startDate.setDate(endDate.getDate()-amount*7);break;case"months":startDate.setMonth(endDate.getMonth()-amount);break;case"quarters":startDate.setMonth(endDate.getMonth()-amount*3);break;case"years":startDate.setFullYear(endDate.getFullYear()-amount);break;default:throw new Error("Invalid time period")}return[startDate,endDate]};let ranges={Today:[today,today],Yesterday:[yesterday,yesterday],"This week":[thisWeekStartDate,thisWeekEndDate],"This month":[thisMonthStartDate,thisMonthEndDate],"This quarter":[thisQuarterStartDate,thisQuarterEndDate],"This year":[thisYearStartDate,thisYearEndDate],"Last week":[lastWeekStartDate,lastWeekEndDate],"Last month":[lastMonthStartDate,lastMonthEndDate],"Last quarter":[lastQuarterStartDate,lastQuarterEndDate],"Last year":[lastYearStartDate,lastYearEndDate]};if(customQuickPickDates&&Object.keys(customQuickPickDates).length!==0){if(customQuickPickDates.dates.length&&customQuickPickDates.override===false){customQuickPickDates.dates.forEach((item=>{if(Array.isArray(item.value)){ranges[item.label]=item.value.map((dateStr=>new Date(dateStr)))}else{ranges[item.label]=calculateDateRange(item.value.timePeriod,item.value.amount)}}))}else if(customQuickPickDates.dates.length&&customQuickPickDates.override!==false){ranges={};customQuickPickDates.dates.forEach((item=>{if(Array.isArray(item.value)){ranges[item.label]=item.value.map((dateStr=>new Date(dateStr)))}else{ranges[item.label]=calculateDateRange(item.value.timePeriod,item.value.amount)}}))}}const rangesNav=document.createElement("ul");const pluginData={ranges:ranges,rangesNav:rangesNav,rangesButtons:[]};const addRangeButton=label=>{const div2=document.createElement("div");div2.className="nav-item-link";div2.innerHTML=label;pluginData.rangesButtons[label]=div2;const item=document.createElement("li");item.className="nav-item";item.appendChild(pluginData.rangesButtons[label]);pluginData.rangesNav.appendChild(item);return pluginData.rangesButtons[label]};const selectActiveRangeButton=selectedDates=>{const current=pluginData.rangesNav.querySelector(".active");if(current){current.classList.remove("active")}if(selectedDates.length>0&&activeLabel){pluginData.rangesButtons[activeLabel].classList.add("active")}};const isLabelMatchingSelectedDates=selectedDates=>activeLabel&&selectedDates[0].toDateString()===pluginData.ranges[activeLabel][0].toDateString()&&selectedDates[1].toDateString()===pluginData.ranges[activeLabel][1].toDateString();return{onReady(selectedDates){let defaultDateRange;for(const[label,range]of Object.entries(pluginData.ranges)){addRangeButton(label).addEventListener("click",(function(){const start2=new Date(range[0]);const end2=new Date(range[1]);if(!start2){fp.clear()}else{activeLabel=label;fp.setDate([start2,end2],true);fp.close()}}));if(defaultDate){if(label.toLowerCase()===defaultDate.toLowerCase()){activeLabel=label;defaultDateRange=range}}}if(pluginData.rangesNav.children.length>0){fp.calendarContainer.prepend(pluginData.rangesNav);pluginData.rangesNav.classList.add("quick-pick-ul");fp.calendarContainer.classList.add("quick-pick-drop-down");selectActiveRangeButton(selectedDates)}if(defaultDateRange){fp.setDate(defaultDateRange,false);selectActiveRangeButton(defaultDateRange)}},onValueUpdate(selectedDates){selectActiveRangeButton(selectedDates)},onClose(selectedDates){var _a;const originalClear=fp.clear;fp.clear=function(...args){const current=pluginData.rangesNav.querySelector(".active");if(current){current.classList.remove("active")}activeLabel="";return originalClear.apply(this,args)};if(!isLabelMatchingSelectedDates(selectedDates)){(_a=pluginData.rangesButtons[activeLabel])==null?void 0:_a.classList.remove("active");activeLabel=""}if(selectedDates.length===1){fp.setDate([selectedDates[0],selectedDates[0]],true)}if(selectedDates.length<2&&selectedDates.length>0){fp.input.placeholder=fp.formatDate(this.selectedDates[0],fp.config.dateFormat)}}}};const angleDown=getAllIcons().angleDown.string;const getPositionElement=element=>typeof element==="string"?document.querySelectorAll(element)[0]:element;const datePickerHelper=(config,scrollContainer)=>{const noop2=()=>{};const{allowInput:allowInput,closeOnSelect:closeOnSelect=true,customQuickPickDates:customQuickPickDates={override:true,dates:[]},defaultDate:defaultDate,disableDate:disableDate,disableRange:disableRange,disableWeekdays:disableWeekdays,enableTime:enableTime,format:format,maxDate:maxDate,minDate:minDate,mode:mode,onChange:onChange=noop2,onClose:onClose=noop2,pickerId:pickerId,plugins:plugins,position:position="auto",positionElement:positionElement,required:required,selectionType:selectionType,showTimezone:showTimezone,staticPosition:staticPosition=true,thisRangesEndToday:thisRangesEndToday=false,timeCaption:timeCaption="Select Time",timeFormat:timeFormat="at h:i K",yearRange:yearRange,controlsStartId:controlsStartId,controlsEndId:controlsEndId,syncStartWith:syncStartWith,syncEndWith:syncEndWith}=config;const defaultDateGetter=()=>{if(defaultDate===""){return null}else{return defaultDate}};const getMinMaxYears=()=>{const[minYear,maxYear]=yearRange;const extractYear=dateOption=>{if(!dateOption)return null;if(typeof dateOption==="number"){return dateOption}if(typeof dateOption==="string"){const match=dateOption.match(/\b(19|20)\d{2}\b/);return match?parseInt(match[0],10):null}if(dateOption instanceof Date){return dateOption.getFullYear()}return null};const setMinYear2=minDate?extractYear(minDate)??minYear:minYear;const setMaxYear2=maxDate?extractYear(maxDate)??maxYear:maxYear;return{setMinYear:setMinYear2,setMaxYear:setMaxYear2}};const{setMinYear:setMinYear,setMaxYear:setMaxYear}=getMinMaxYears();const getMinMaxDates=()=>{const setMinDate2=minDate||`01/01/${setMinYear}`;const setMaxDate2=maxDate||`12/31/${setMaxYear}`;return{setMinDate:setMinDate2,setMaxDate:setMaxDate2}};const disabledWeekDays=()=>[date=>{const weekdayObj={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6};return date.getDay()===weekdayObj[disableWeekdays[0]]||date.getDay()===weekdayObj[disableWeekdays[1]]||date.getDay()===weekdayObj[disableWeekdays[2]]||date.getDay()===weekdayObj[disableWeekdays[3]]||date.getDay()===weekdayObj[disableWeekdays[4]]||date.getDay()===weekdayObj[disableWeekdays[5]]||date.getDay()===weekdayObj[disableWeekdays[6]]}];const disabledParser=()=>{const disabledArray=[];disableDate&&disableDate.length>0&&disabledArray.push(...disableDate);disableRange&&disableRange.length>0&&disabledArray.push(...disableRange);disableWeekdays&&disableWeekdays.length>0&&disabledArray.push(...disabledWeekDays());return disabledArray};const calendarResizer=()=>{const cal=document.querySelector(`#cal-${pickerId}.open`);const parentInput=cal.parentElement;if((cal==null?void 0:cal.getBoundingClientRect().right)>window.innerWidth){parentInput.style.display="flex";parentInput.style.justifyContent="center"}if(cal.offsetWidth<=parentInput.offsetWidth){parentInput.style.display="";parentInput.style.justifyContent=""}};const positionCalendarIfNeeded=fp=>{const cal=document.querySelector(`#cal-${pickerId}`);if(!cal)return;const inputRect=fp.input.getBoundingClientRect();const h=cal.getBoundingClientRect().height||300;const spaceBelow=window.innerHeight-inputRect.bottom;const spaceAbove=inputRect.top;if(spaceBelow<h+10&&spaceAbove>=h+10){if(staticPosition){cal.style.top="auto";cal.style.bottom="calc(100% + 5px)"}else{cal.style.position="fixed";cal.style.top=`${Math.max(10,inputRect.top-h-5)}px`;cal.style.left=`${inputRect.left}px`}}else if(staticPosition){cal.style.top="";cal.style.bottom=""}else{Object.assign(cal.style,{position:"",top:"",left:"",bottom:"",right:"",transform:""});fp._positionCalendar()}};const setPlugins=(thisRangesEndToday2,customQuickPickDates2)=>{const pluginList=[];if(selectionType==="month"||plugins.length>0){pluginList.push(monthSelectPlugin({shorthand:true,dateFormat:"F Y",altFormat:"F Y"}))}else if(selectionType==="week"){pluginList.push(weekSelect())}else if(selectionType==="quickpick"){pluginList.push(quickPickPlugin(thisRangesEndToday2,customQuickPickDates2,defaultDate))}if(enableTime)pluginList.push(timeSelectPlugin({caption:timeCaption,showTimezone:showTimezone}));return pluginList};const getDateFormat=()=>enableTime?`${format} ${timeFormat}`:format;const initialPicker=document.querySelector(`#${pickerId}`)._flatpickr;const scrollEvent=()=>{initialPicker._positionCalendar()};function attachToScroll(scrollParent){var _a;(_a=document.querySelectorAll(scrollParent)[0])==null?void 0:_a.addEventListener("scroll",scrollEvent,{passive:true})}function detachFromScroll(scrollParent=document.body){var _a;(_a=document.querySelectorAll(scrollParent)[0])==null?void 0:_a.removeEventListener("scroll",scrollEvent)}const yearChangeHook=fp=>{var _a;const yearInput=document.querySelector(`#year-${fp.input.id}`);yearInput.value=(_a=fp.currentYear)==null?void 0:_a.toString()};const handleDatePickerChange=(fp,selectedDates)=>{const inputEl=fp.input;if(inputEl){const inlineDatePickerElem=inputEl.closest(".inline-date-picker");if(inlineDatePickerElem){if(selectedDates&&selectedDates.length>0){inlineDatePickerElem.classList.add("show-angle-down-icon")}else{inlineDatePickerElem.classList.remove("show-angle-down-icon")}}}};let resizeRepositionHandlerRef=null;const{setMinDate:setMinDate,setMaxDate:setMaxDate}=getMinMaxDates();const toDateObject=dateValue=>{if(!dateValue)return null;if(dateValue instanceof Date)return dateValue;if(typeof dateValue==="string"){const parsed=new Date(dateValue);return isNaN(parsed.getTime())?null:parsed}if(typeof dateValue==="number"){return new Date(dateValue)}return null};const formatDateForFlatpickr=dateValue=>{const dateObj=toDateObject(dateValue);if(!dateObj)return null;const year=dateObj.getFullYear();const month=String(dateObj.getMonth()+1).padStart(2,"0");const day=String(dateObj.getDate()).padStart(2,"0");return`${year}-${month}-${day}`};const isDefaultDateBeforeMinDate=(defaultDateValue2,minDateValue)=>{if(!defaultDateValue2||!minDateValue)return false;const defaultDateObj=toDateObject(defaultDateValue2);const minDateObj=toDateObject(minDateValue);if(!defaultDateObj||!minDateObj)return false;const defaultDateOnly=new Date(defaultDateObj.getFullYear(),defaultDateObj.getMonth(),defaultDateObj.getDate());const minDateOnly=new Date(minDateObj.getFullYear(),minDateObj.getMonth(),minDateObj.getDate());return defaultDateOnly<minDateOnly};const isDefaultDateAfterMaxDate=(defaultDateValue2,maxDateValue)=>{if(!defaultDateValue2||!maxDateValue)return false;const defaultDateObj=toDateObject(defaultDateValue2);const maxDateObj=toDateObject(maxDateValue);if(!defaultDateObj||!maxDateObj)return false;const defaultDateOnly=new Date(defaultDateObj.getFullYear(),defaultDateObj.getMonth(),defaultDateObj.getDate());const maxDateOnly=new Date(maxDateObj.getFullYear(),maxDateObj.getMonth(),maxDateObj.getDate());return defaultDateOnly>maxDateOnly};const defaultDateValue=defaultDateGetter();const isBeforeMin=minDate&&isDefaultDateBeforeMinDate(defaultDateValue,setMinDate);const isAfterMax=maxDate&&isDefaultDateAfterMaxDate(defaultDateValue,setMaxDate);const hasOutOfRangeDefault=(isBeforeMin||isAfterMax)&&defaultDateValue;const effectiveMinDate=isBeforeMin&&defaultDateValue&&minDate?formatDateForFlatpickr(defaultDateValue)||setMinDate:setMinDate;const effectiveMaxDate=isAfterMax&&defaultDateValue&&maxDate?formatDateForFlatpickr(defaultDateValue)||setMaxDate:setMaxDate;flatpickr(`#${pickerId}`,{allowInput:allowInput,closeOnSelect:closeOnSelect,disableMobile:true,dateFormat:getDateFormat(),defaultDate:defaultDateGetter(),disable:disabledParser(),enableTime:enableTime,locale:{rangeSeparator:" to "},maxDate:effectiveMaxDate,minDate:effectiveMinDate,mode:mode,nextArrow:'<i class="far fa-angle-right"></i>',onOpen:[(_selectedDates,_dateStr,fp)=>{if(hasOutOfRangeDefault){const dateObj=toDateObject(defaultDateValue);if(dateObj){const inputIsBlank=!fp.input.value||fp.input.value.trim()==="";const noSelection=!fp.selectedDates||fp.selectedDates.length===0;if(inputIsBlank||noSelection){const formattedDate=fp.formatDate(dateObj,getDateFormat());if(formattedDate){fp.input.value=formattedDate}fp.selectedDates=[dateObj];fp.jumpToDate(dateObj);setTimeout((()=>{yearChangeHook(fp)}),0)}}}calendarResizer();if(resizeRepositionHandlerRef){window.removeEventListener("resize",resizeRepositionHandlerRef)}resizeRepositionHandlerRef=()=>{calendarResizer();positionCalendarIfNeeded(fp)};window.addEventListener("resize",resizeRepositionHandlerRef);if(!staticPosition&&scrollContainer)attachToScroll(scrollContainer);positionCalendarIfNeeded(fp)}],onClose:[(selectedDates,dateStr,fp)=>{if(resizeRepositionHandlerRef){window.removeEventListener("resize",resizeRepositionHandlerRef);resizeRepositionHandlerRef=null}if(!staticPosition&&scrollContainer)detachFromScroll(scrollContainer);if(hasOutOfRangeDefault&&(!selectedDates||selectedDates.length===0)){const dateObj=toDateObject(defaultDateValue);if(dateObj&&fp.input){const formattedDate=fp.formatDate(dateObj,getDateFormat());if(formattedDate){setTimeout((()=>{if(fp.input&&(!fp.selectedDates||fp.selectedDates.length===0)){fp.input.value=formattedDate;fp.selectedDates=[dateObj];fp.jumpToDate(dateObj)}}),0)}}}onClose(selectedDates,dateStr)}],onChange:[(selectedDates,dateStr,fp)=>{handleDatePickerChange(fp,selectedDates);yearChangeHook(fp);onChange(dateStr,selectedDates)}],onYearChange:[(_selectedDates,_dateStr,fp)=>{yearChangeHook(fp)}],plugins:setPlugins(thisRangesEndToday,customQuickPickDates),position:position,positionElement:getPositionElement(positionElement),prevArrow:'<i class="far fa-angle-left"></i>',static:staticPosition});const picker=document.querySelector(`#${pickerId}`)._flatpickr;picker.innerContainer.parentElement.id=`cal-${pickerId}`;if((isBeforeMin||isAfterMax)&&defaultDateValue){const dateObj=toDateObject(defaultDateValue);const formattedDate=dateObj?picker.formatDate(dateObj,getDateFormat()):null;setTimeout((()=>{if(!dateObj||!picker.input||!formattedDate)return;picker.setDate(dateObj,false);if(isBeforeMin&&setMinDate&&minDate){picker.set("minDate",setMinDate)}if(isAfterMax&&setMaxDate&&maxDate){picker.set("maxDate",setMaxDate)}picker.input.value=formattedDate;picker.selectedDates=[dateObj];setTimeout((()=>{yearChangeHook(picker)}),0);const restoreOutOfRangeValue=()=>{if(!picker.input)return;const inputIsBlank=!picker.input.value||picker.input.value.trim()==="";const noSelection=!picker.selectedDates||picker.selectedDates.length===0;if(inputIsBlank||noSelection){setTimeout((()=>{if(picker.input&&(!picker.input.value||picker.input.value.trim()==="")){picker.input.value=formattedDate}if(!picker.selectedDates||picker.selectedDates.length===0){picker.selectedDates=[dateObj];if(picker.isOpen){picker.jumpToDate(dateObj);picker.redraw();setTimeout((()=>{yearChangeHook(picker)}),0)}}}),0)}};const originalClear=picker.clear.bind(picker);picker.clear=function(...args){const result=originalClear(...args);setTimeout((()=>restoreOutOfRangeValue()),0);return result};picker.input.addEventListener("input",restoreOutOfRangeValue);picker.config.onClose.push((()=>{restoreOutOfRangeValue()}))}),10)}picker.yearElements[0].parentElement.innerHTML=`<select class="numInput cur-year" type="number" tabIndex="-1" aria-label="Year" id="year-${pickerId}"></select>`;let years="";for(let year=setMaxYear;year>=setMinYear;year--){years+=`<option value="${year}">${year}</option>`}const dropdown=document.querySelector(`#year-${pickerId}`);dropdown.innerHTML=years;dropdown.value=picker.currentYear;dropdown.addEventListener("input",(e=>{picker.changeYear(Number(e.target.value))}));if(picker.input.form){picker.input.form.addEventListener("reset",(()=>{setTimeout((()=>{dropdown.value=picker.currentYear;picker.monthsDropdownContainer.value=picker.currentMonth;if(defaultDate){picker.setDate(defaultDate);yearChangeHook(picker)}}),0)}))}if(selectionType==="quickpick"&&(controlsStartId||controlsEndId)){picker.config.onClose.push((selectedDates=>{var _a,_b;const[start2,end2]=selectedDates;if(controlsStartId){const startPicker=(_a=document.querySelector(`#${controlsStartId}`))==null?void 0:_a._flatpickr;startPicker==null?void 0:startPicker.setDate(start2,true)}if(controlsEndId){const endPicker=(_b=document.querySelector(`#${controlsEndId}`))==null?void 0:_b._flatpickr;endPicker==null?void 0:endPicker.setDate(end2,true)}}))}if(syncStartWith){picker.config.onClose.push((selectedDates=>{var _a;if(selectedDates==null?void 0:selectedDates.length){const element=document.querySelector(`#${syncStartWith}`);if((_a=element==null?void 0:element._dropdownRef)==null?void 0:_a.current){element._dropdownRef.current.clearSelected()}else if(element==null?void 0:element._pbDropdownInstance){element._pbDropdownInstance.clearSelected()}else{const quickpick=element==null?void 0:element._flatpickr;quickpick==null?void 0:quickpick.clear()}}}))}if(syncEndWith){picker.config.onClose.push((selectedDates=>{var _a;if(selectedDates==null?void 0:selectedDates.length){const element=document.querySelector(`#${syncEndWith}`);if((_a=element==null?void 0:element._dropdownRef)==null?void 0:_a.current){element._dropdownRef.current.clearSelected()}else if(element==null?void 0:element._pbDropdownInstance){element._pbDropdownInstance.clearSelected()}else{const quickpick=element==null?void 0:element._flatpickr;quickpick==null?void 0:quickpick.clear()}}}))}dropdown.insertAdjacentHTML("afterend",`<i class="year-dropdown-icon">${angleDown}</i>`);if(picker.monthElements[0].parentElement){return picker.monthElements[0].insertAdjacentHTML("afterend",`<i class="month-dropdown-icon">${angleDown}</i>`)}if(allowInput){picker.input.removeAttribute("readonly")}if(required){picker.input.removeAttribute("readonly");picker.input.addEventListener("keydown",(e=>e.preventDefault()));picker.input.style.caretColor="transparent";picker.input.style.cursor="pointer"}document.querySelector(`#${pickerId}`).parentElement.addEventListener("click",(e=>e.stopPropagation()))};const useDropdown=(initial=true)=>{const[isDropDownClosed,setIsDropDownClosed]=useState(initial);const toggleDropdown=()=>setIsDropDownClosed((prev=>!prev));return[isDropDownClosed,setIsDropDownClosed,toggleDropdown]};class ElementObserver{constructor(matchDelegate,target=document){this.matchDelegate=matchDelegate;this.target=target}get mutationObserver(){return this._mutationObserver=this._mutationObserver||new MutationObserver((mutationList=>this.processMutationList(mutationList)))}start(){this.mutationObserver.observe(this.target,{attributes:true,childList:true,subtree:true});this.catchup()}stop(){this.mutationObserverdisconnect()}catchup(){this.handleAdditions(this.matchDelegate.matches(this.target))}processMutationList(mutationList){for(const mutation of mutationList){if(mutation.type=="attributes"){this.processAttributeChange(mutation.target)}else if(mutation.type=="childList"){this.processRemovedNodes(Array.from(mutation.removedNodes));this.processAddedNodes(Array.from(mutation.addedNodes))}}}processAttributeChange(node){if(node.nodeType!==Node.ELEMENT_NODE)return;const matches=this.matchDelegate.matches(node);if(matches.length===0)return this.matchDelegate.removeMatch(node);this.handleAdditions(matches)}processRemovedNodes(nodes){for(const node of nodes){if(node.nodeType!==Node.ELEMENT_NODE)continue;this.handleRemovals(this.matchDelegate.matches(node))}}processAddedNodes(nodes){for(const node of nodes){if(node.nodeType!==Node.ELEMENT_NODE)continue;this.handleAdditions(this.matchDelegate.matches(node))}}handleRemovals(elements){for(const element of elements)this.matchDelegate.removeMatch(element)}handleAdditions(elements){for(const element of elements)this.matchDelegate.addMatch(element)}}class PbEnhancedElement{constructor(element){this.element=element}static get elements(){return this._elements=this._elements||new Map}static get observer(){return this._observer=this._observer||new ElementObserver(this)}static get selector(){console.warn("Define a static property for selector or redefine the matches function in a subclass.",this);return null}static matches(node){if(!this.selector)return[];const matches=[];if(node.nodeType===Node.ELEMENT_NODE&&node.matches(this.selector))matches.push(node);matches.push(...node.querySelectorAll(this.selector));return matches}static addMatch(element){if(element._pbEnhanced||this.elements.has(element))return;const enhansedElement=new this(element);enhansedElement.connect();this.elements.set(element,enhansedElement);element._pbEnhanced=enhansedElement}static removeMatch(element){if(!this.elements.has(element))return;const enhansedElement=this.elements.get(element);enhansedElement.disconnect();this.elements.delete(element)}static start(){this.observer.start()}static stop(){this.mutationObserver.stop()}connect(){console.warn("Redefine the connect function in a subclass.",this)}disconnect(){}}class PbTextarea extends PbEnhancedElement{static get selector(){return".resize_auto textarea"}onInput(){this.style.height="auto";this.style.height=this.scrollHeight+"px"}connect(){this.element.setAttribute("style","height:"+this.element.scrollHeight+"px;overflow-y:hidden;");this.element.addEventListener("input",this.onInput,false)}}const mapTheme={marker:colors.primary_action,maptiles:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",flyToConfig:{zoom:13,bearing:0,curve:1.42,easing:function(t){return t},essential:true},zoomConfig:{duration:1e3},mapConfig:{style:"https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",zoom:13,attributionControl:false}};const gaugeTheme={title:{text:"",style:{fontFamily:typography.font_family_base,fontSize:typography.text_larger}},chart:{type:"solidgauge",events:{render(){this.container;const arc=this.container.querySelector("path.gauge-pane");if(arc)arc.setAttribute("stroke-linejoin","round")}}},pane:{size:"90%",startAngle:-100,endAngle:100,background:[{borderWidth:20,innerRadius:"90%",outerRadius:"90%",shape:"arc",className:"gauge-pane",borderColor:colors.border_light,borderRadius:"50%"}]},tooltip:{backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,colors.bg_dark],[1,colors.bg_dark]]},pointFormat:'<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: <b>{point.y}</b>',followPointer:true,shadow:false,borderWidth:0,borderRadius:10,style:{fontFamily:typography.font_family_base,color:colors.text_dk_default,fontWeight:typography.regular,fontSize:typography.text_smaller}},yAxis:{min:0,max:100,lineWidth:0,tickPositions:[]},plotOptions:{solidgauge:{borderColor:colors.data_1,borderWidth:20,color:colors.data_1,radius:90,innerRadius:"90%",y:-26,dataLabels:{borderWidth:0,color:colors.text_lt_default,enabled:true,format:'<span class="fix">{y:,f}</span>',style:{fontFamily:typography.font_family_base,fontWeight:typography.regular,fontSize:typography.heading_2},y:-26}}},credits:{enabled:false}};const circleChartTheme={title:{text:"",style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.bold,fontSize:typography.heading_3}},chart:{type:"pie"},tooltip:{backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,colors.bg_dark],[1,colors.bg_dark]]},pointFormat:'<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: <b>{point.y}</b>',followPointer:true,shadow:false,borderWidth:0,borderRadius:10,style:{fontFamily:typography.font_family_base,color:colors.text_dk_default,fontWeight:typography.regular,fontSize:typography.text_smaller}},plotOptions:{pie:{dataLabels:{enabled:false,connectorShape:"straight",connectorWidth:3,format:"<div>{point.name}</div>",style:{fontFamily:typography.font_family_base,fontSize:typography.text_smaller,color:colors.text_lt_light,fontWeight:typography.regular,textOutline:"2px $white"}},innerSize:"50%",borderColor:"",borderWidth:null,colors:[colors.data_1,colors.data_2,colors.data_3,colors.data_4,colors.data_5,colors.data_6,colors.data_7]}},legend:{layout:"horizontal",align:"center",verticalAlign:"bottom",itemStyle:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontWeight:typography.regular,fontSize:typography.text_smaller},itemHoverStyle:{color:colors.text_lt_default},itemHiddenStyle:{color:colors.text_lt_lighter}},credits:{enabled:false}};const lineGraphTheme={title:{text:"",style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.bold,fontSize:typography.heading_3}},subtitle:{text:"",style:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontWeight:typography.regular,fontSize:typography.text_base}},chart:{type:"line"},tooltip:{backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,colors.bg_dark],[1,colors.bg_dark]]},followPointer:true,shadow:false,borderWidth:0,borderRadius:10,style:{fontFamily:typography.font_family_base,color:colors.text_dk_default,fontWeight:typography.regular,fontSize:typography.text_smaller}},plotOptions:{line:{dataLabels:{enabled:false}}},credits:{enabled:false},legend:{enabled:false,itemStyle:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontWeight:typography.regular,fontSize:typography.text_smaller},itemHoverStyle:{color:colors.text_lt_default},itemHiddenStyle:{color:colors.text_lt_lighter}},colors:[colors.data_1,colors.data_2,colors.data_3,colors.data_4,colors.data_5,colors.data_6,colors.data_7],xAxis:{gridLineWidth:0,lineColor:colors.border_light,tickColor:colors.border_light,labels:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}},title:{style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.regular,fontSize:typography.heading_4}}},yAxis:{alternateGridColor:void 0,minorTickInterval:null,gridLineColor:colors.border_light,minorGridLineColor:colors.border_light,lineWidth:0,tickWidth:0,tickPixelInterval:50,labels:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}},title:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}}}};const barGraphTheme={title:{text:"",style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.bold,fontSize:typography.heading_3}},subtitle:{text:"",style:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontWeight:typography.regular,fontSize:typography.text_base}},chart:{type:"column"},tooltip:{backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,colors.bg_dark],[1,colors.bg_dark]]},style:{fontFamily:typography.font_family_base,color:colors.text_dk_default,fontWeight:typography.regular,fontSize:typography.text_smaller}},colors:[colors.data_1,colors.data_2,colors.data_3,colors.data_4,colors.data_5,colors.data_6,colors.data_7],credits:{enabled:false},legend:{enabled:false,itemStyle:{color:colors.text_lt_light,fill:colors.text_lt_light,fontSize:typography.text_smaller}},xAxis:{gridLineWidth:0,lineColor:colors.border_light,tickColor:colors.border_light,labels:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}},title:{style:{color:colors.text_lt_default,fontFamily:typography.font_family_base,fontWeight:typography.regular,fontSize:typography.heading_4}}},yAxis:{alternateGridColor:void 0,minorTickInterval:null,gridLineColor:colors.border_light,minorGridLineColor:colors.border_light,lineWidth:0,tickWidth:0,labels:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}},title:{style:{fontFamily:typography.font_family_base,color:colors.text_lt_lighter,fontWeight:typography.bold,fontSize:typography.text_smaller}}}};const dataColors=[colors.data_1,colors.data_2,colors.data_3,colors.data_4,colors.data_5,colors.data_6,colors.data_7,colors.data_8];const applyCustomSeriesColors=highchart=>{highchart.series.forEach(((item,index)=>{const selectedColor=dataColors[index];item.color=selectedColor;item.data.forEach((dataItem=>{if(dataItem.color){dataItem.color=selectedColor}if(!dataItem.marker)return;if(dataItem.marker.lineColor){dataItem.marker.lineColor=selectedColor}if(dataItem.marker.states.hover!==void 0){dataItem.marker.states.hover.lineColor=selectedColor}if(dataItem.marker.states.select.lineColor){dataItem.marker.states.select.lineColor=selectedColor}}))}))};const adjustAxisStyle=axis=>{axis.minorGridLineColor=colors.slate;axis.minorGridLineWidth=.5;axis.minorGridLineDashStyle="Dash";axis.gridLineWidth=.5;axis.gridLineColor=colors.slate;axis.gridLineDashStyle="Dash";axis.lineColor=colors.sky;axis.labels.style.fontFamily=typography.font_family_base;axis.labels.style.color=colors.charcoal;axis.labels.style.fontWeight=typography.regular;axis.labels.style.fontSize=typography.font_small};const styleAxis=highchart=>{if(Array.isArray(highchart.yAxis)){highchart.yAxis.forEach((item=>{adjustAxisStyle(item)}))}else{adjustAxisStyle(highchart.yAxis)}if(Array.isArray(highchart.xAxis)){highchart.xAxis.forEach((item=>{adjustAxisStyle(item)}))}else{adjustAxisStyle(highchart.xAxis)}};const styleChartContainer=highchart=>{highchart.chart.spacingTop=30;highchart.chart.spacingBottom=40;highchart.chart.spacingLeft=50;highchart.chart.spacingRight=50};const styleLegend=highchart=>{highchart.legend.itemStyle.fontFamily=typography.font_family_base;highchart.legend.itemStyle.color=colors.text_lt_light;highchart.legend.itemStyle.fontWeight=typography.regular;highchart.legend.itemStyle.fontSize=typography.text_smaller};const commonSettings=highchart=>{applyCustomSeriesColors(highchart);styleAxis(highchart);styleChartContainer(highchart);styleLegend(highchart)};const markerStyles=highchart=>{highchart.plotOptions.line.marker.enabled=true;highchart.plotOptions.series.marker.enabled=true;highchart.plotOptions.series.marker.fillColor="white";highchart.plotOptions.series.marker.lineWidth=2};const fixTooltipStyles=()=>{document.getElementById("main-view").setAttribute("style","position: static !important")};const styleDataLabels$1=highchart=>{const series=highchart.plotOptions.series;series.dataLabels.style.fontFamily=typography.font_family_base;series.dataLabels.style.fontSize=typography.text_small;series.dataLabels.style.fontWeight=typography.bold};const pbLineGraph=highchart=>{commonSettings(highchart);styleDataLabels$1(highchart);markerStyles(highchart);fixTooltipStyles()};const sizeColumns=function(highchart){const column=highchart.plotOptions.column;const series=highchart.plotOptions.series;column.borderRadius=0;column.pointPadding=.3;column.groupPadding=0;series.borderWidth=0;series.shadow=false;series.pointPadding=.25;series.groupPadding=0};const styleDataLabels=highchart=>{const series=highchart.plotOptions.series;series.dataLabels.style.fontFamily=typography.font_family_base;series.dataLabels.style.fontSize=typography.text_small;series.dataLabels.style.fontWeight=typography.bold};const barGraphSettings=function(highchart){commonSettings(highchart);sizeColumns(highchart);styleDataLabels(highchart)};const pbIndicator={title:{fontFamily:typography.font_family_base,color:colors.text_lt_light,fontSizes:{big:typography.text_large,medium:typography.text_base,small:typography.text_small,micro:typography.text_small}},secondaryTitle:{color:colors.text_lt_light,fontFamily:typography.font_family_base,fontSizes:{big:typography.text_large,medium:typography.text_base,small:typography.text_small,micro:typography.text_small}},value:{fontFamily:typography.font_family_base,color:colors.text_lt_default,fontWeight:typography.lighter,fontSizes:{big:typography.heading_1,medium:typography.heading_1,small:typography.text_base,micro:typography.text_small}},secondaryValue:{fontFamily:typography.font_family_base,fontSizes:{big:typography.text_large,medium:typography.text_base,small:typography.text_small,micro:typography.text_small}}};const POPOVER_OFFSET_Y=[0,20];class PbPopover extends PbEnhancedElement{static get selector(){return"[data-pb-popover-kit]"}moveTooltip(){let container=document.querySelector("body");if(this.appendTo==="parent"){container=this.element.parentElement&&this.element.parentElement}else if(this.appendTo){container=document.querySelector(this.appendTo)}container.appendChild(this.tooltip)}connect(){if(!this.triggerElement||!this.tooltip){console.warn("Popover requires both trigger and tooltip elements to be defined.");return}this.moveTooltip();this.popper=createPopper(this.triggerElement,this.tooltip,{placement:this.position,strategy:"fixed",modifiers:[{name:"offset",options:{offset:this.offset}}]});this.triggerElement.addEventListener("click",(event=>{event.preventDefault();event.stopPropagation();if(!this.tooltip.classList.contains("show")){this.checkCloseTooltip()}setTimeout((()=>{this.toggleTooltip();this.popper.update()}),0)}))}checkCloseTooltip(){document.querySelector("body").addEventListener("click",(({target:target})=>{const isTooltipElement=target.closest(`#${this.tooltipId}`)!==null;const isTriggerElement=target.closest(`#${this.triggerElementId}`)!==null;switch(this.closeOnClick){case"any":if(isTooltipElement||!isTooltipElement&&!isTriggerElement){this.hideTooltip()}break;case"outside":if(!isTooltipElement&&!isTriggerElement){this.hideTooltip()}break;case"inside":if(isTooltipElement){this.hideTooltip()}break}}),true)}hideTooltip(){this.tooltip.classList.remove("show");this.tooltip.classList.add("hide")}toggleTooltip(){this.tooltip.classList.toggle("show");this.tooltip.classList.toggle("hide")}get triggerElement(){return this._triggerElement=this._triggerElement||document.querySelector(`#${this.triggerElementId}`)}get tooltip(){return this._tooltip=this._tooltip||this.element.querySelector(`#${this.tooltipId}`)}get position(){return this.element.dataset.pbPopoverPosition}get triggerElementId(){return this.element.dataset.pbPopoverTriggerElementId}get tooltipId(){return this.element.dataset.pbPopoverTooltipId}get offset(){return this.element.dataset.pbPopoverOffset==="true"?POPOVER_OFFSET_Y:[0,0]}get closeOnClick(){return this.element.dataset.pbPopoverCloseOnClick}get appendTo(){return this.element.dataset.pbPopoverAppendTo}}const TABLE_WRAPPER_SELECTOR="[data-pb-table-wrapper]";const TABLE_COLLAPSIBLE_WRAPPER_SELECTOR="[data-pb-table-collapsible-wrapper]";const TABLE_COLLAPSIBLE_CELL_SELECTOR="[data-pb-table-collapsible-cell-id]";class PbTable extends PbEnhancedElement{constructor(){super(...arguments);this.stickyLeftColumns=[];this.stickyRightColumns=[];this.stickyRightColumnsReversed=[]}static get selector(){return TABLE_WRAPPER_SELECTOR}connect(){if(this.element.classList.contains("table-responsive-collapse")){const headers=[];[].forEach.call(this.element.querySelectorAll("th"),(header=>{const colSpan=header.colSpan;for(let i=0;i<colSpan;i++){headers.push(header.textContent.replace(/\r?\n|\r/,""))}}));[].forEach.call(this.element.querySelectorAll("tbody tr"),(row=>{[].forEach.call(row.cells,((cell,headerIndex)=>{cell.setAttribute("data-title",headers[headerIndex])}))}))}this.initStickyLeftColumns();this.initStickyRightColumns();this.handleCollapsibleClick();this.handleCollapsibleRow()}initStickyLeftColumns(){const table=this.element.querySelector(".sticky-left-column");if(table){const classList=Array.from(table.classList);const stickyColumnClass=classList.find((cls=>cls.startsWith("sticky-left-columns-ids-")));if(stickyColumnClass){this.stickyLeftColumns=stickyColumnClass.replace("sticky-left-columns-ids-","").split("-");if(this.stickyLeftColumns.length>0){setTimeout((()=>{this.handleStickyLeftColumns();window.addEventListener("resize",(()=>this.handleStickyLeftColumns()))}),10)}}}}handleStickyLeftColumns(){let accumulatedWidth=0;this.stickyLeftColumns.forEach(((colId,index)=>{const isLastColumn=index===this.stickyLeftColumns.length-1;const header=this.element.querySelector(`th[data-sticky-id="${colId}"]`);const cells=this.element.querySelectorAll(`td[data-sticky-id="${colId}"]`);if(header){header.classList.add("sticky");header.style.left=`${accumulatedWidth}px`;if(!isLastColumn){header.classList.add("with-border-right");header.classList.remove("sticky-left-shadow")}else{header.classList.remove("with-border-right");header.classList.add("sticky-left-shadow")}accumulatedWidth+=header.offsetWidth}cells.forEach((cell=>{cell.classList.add("sticky");cell.style.left=`${accumulatedWidth-header.offsetWidth}px`;if(!isLastColumn){cell.classList.add("with-border-right");cell.classList.remove("sticky-left-shadow")}else{cell.classList.remove("with-border-right");cell.classList.add("sticky-left-shadow")}}))}))}initStickyRightColumns(){const table=this.element.querySelector(".sticky-right-column");if(table){const classList=Array.from(table.classList);const stickyColumnClass=classList.find((cls=>cls.startsWith("sticky-right-columns-ids-")));if(stickyColumnClass){this.stickyRightColumns=stickyColumnClass.replace("sticky-right-columns-ids-","").split("-");this.stickyRightColumnsReversed=this.stickyRightColumns.reverse();if(this.stickyRightColumns.length>0){setTimeout((()=>{this.handleStickyRightColumns();window.addEventListener("resize",(()=>this.handleStickyRightColumns()))}),10)}}}}handleStickyRightColumns(){let accumulatedWidth=0;this.stickyRightColumnsReversed.forEach(((colId,index)=>{const isLastColumn=index===this.stickyRightColumns.length-1;const header=this.element.querySelector(`th[data-sticky-id="${colId}"]`);const cells=this.element.querySelectorAll(`td[data-sticky-id="${colId}"]`);if(header){header.classList.add("sticky");header.style.right=`${accumulatedWidth}px`;if(!isLastColumn){header.classList.add("with-border-left");header.classList.remove("sticky-right-shadow")}else{header.classList.remove("with-border-right");header.classList.add("sticky-right-shadow")}accumulatedWidth+=header.offsetWidth}cells.forEach((cell=>{cell.classList.add("sticky");cell.style.right=`${accumulatedWidth-header.offsetWidth}px`;if(!isLastColumn){cell.classList.add("with-border-left");cell.classList.remove("sticky-right-shadow")}else{cell.classList.remove("with-border-left");cell.classList.add("sticky-right-shadow")}}))}))}handleCollapsibleClick(){const cells=this.element.querySelectorAll(TABLE_COLLAPSIBLE_CELL_SELECTOR);const collapsibleElements=this.element.querySelectorAll(TABLE_COLLAPSIBLE_WRAPPER_SELECTOR);if(cells.length>0){cells.forEach((cell=>{const cellId=cell.dataset.pbTableCollapsibleCellId;Array.from(cell.children).forEach((child=>{if(child.id===cellId){Array.from(child.children).forEach((svgChild=>{svgChild.id=cellId;Array.from(svgChild.children).forEach((pathChild=>{pathChild.id=cellId}))}))}}));cell.addEventListener("click",(event=>{if(event.target.id){document.dispatchEvent(new CustomEvent(`collapsed-toggle${event.currentTarget.id}`));const toggleElements=this.element.querySelectorAll(`.collapsible_border_toggle${event.currentTarget.id}`);toggleElements.forEach((element=>{element.classList.toggle("no-border");element.classList.toggle("border-active")}))}}))}))}else{collapsibleElements.forEach((collapsibleElement=>{collapsibleElement.addEventListener("click",(event=>{document.dispatchEvent(new CustomEvent(`collapsed-toggle${event.currentTarget.id}`));const toggleElements=this.element.querySelectorAll(`.collapsible_border_toggle${event.currentTarget.id}`);toggleElements.forEach((element=>{element.classList.toggle("no-border");element.classList.toggle("border-active")}))}))}))}}handleCollapsibleRow(){const collapsibleRows=this.element.querySelectorAll(".pb_table_collapsible_row");if(collapsibleRows.length>0){collapsibleRows.forEach((row=>{const previousRow=row.previousElementSibling;if(previousRow&&previousRow.tagName==="TR"){const tdCount=previousRow.querySelectorAll("td").length;const collapsibleTd=row.querySelector("td");if(collapsibleTd){collapsibleTd.colSpan=tdCount}}else{return}}))}}disconnect(){if(this.stickyLeftColumns.length>0){window.removeEventListener("resize",(()=>this.handleStickyLeftColumns()))}if(this.stickyRightColumns.length>0){window.removeEventListener("resize",(()=>this.handleStickyRightColumns()))}}}const min=Math.min;const max=Math.max;const round=Math.round;const floor=Math.floor;const createCoords=v=>({x:v,y:v});function hasWindow(){return typeof window!=="undefined"}function getNodeName(node){if(isNode(node)){return(node.nodeName||"").toLowerCase()}return"#document"}function getWindow(node){var _node$ownerDocument;return(node==null||(_node$ownerDocument=node.ownerDocument)==null?void 0:_node$ownerDocument.defaultView)||window}function getDocumentElement(node){var _ref;return(_ref=(isNode(node)?node.ownerDocument:node.document)||window.document)==null?void 0:_ref.documentElement}function isNode(value){if(!hasWindow()){return false}return value instanceof Node||value instanceof getWindow(value).Node}function isElement(value){if(!hasWindow()){return false}return value instanceof Element||value instanceof getWindow(value).Element}function isHTMLElement(value){if(!hasWindow()){return false}return value instanceof HTMLElement||value instanceof getWindow(value).HTMLElement}function isShadowRoot(value){if(!hasWindow()||typeof ShadowRoot==="undefined"){return false}return value instanceof ShadowRoot||value instanceof getWindow(value).ShadowRoot}function isOverflowElement(element){const{overflow:overflow,overflowX:overflowX,overflowY:overflowY,display:display}=getComputedStyle(element);return/auto|scroll|overlay|hidden|clip/.test(overflow+overflowY+overflowX)&&!["inline","contents"].includes(display)}function isTableElement(element){return["table","td","th"].includes(getNodeName(element))}function isTopLayer(element){return[":popover-open",":modal"].some((selector=>{try{return element.matches(selector)}catch(e){return false}}))}function isContainingBlock(elementOrCss){const webkit=isWebKit();const css=isElement(elementOrCss)?getComputedStyle(elementOrCss):elementOrCss;return["transform","translate","scale","rotate","perspective"].some((value=>css[value]?css[value]!=="none":false))||(css.containerType?css.containerType!=="normal":false)||!webkit&&(css.backdropFilter?css.backdropFilter!=="none":false)||!webkit&&(css.filter?css.filter!=="none":false)||["transform","translate","scale","rotate","perspective","filter"].some((value=>(css.willChange||"").includes(value)))||["paint","layout","strict","content"].some((value=>(css.contain||"").includes(value)))}function getContainingBlock(element){let currentNode=getParentNode(element);while(isHTMLElement(currentNode)&&!isLastTraversableNode(currentNode)){if(isContainingBlock(currentNode)){return currentNode}else if(isTopLayer(currentNode)){return null}currentNode=getParentNode(currentNode)}return null}function isWebKit(){if(typeof CSS==="undefined"||!CSS.supports)return false;return CSS.supports("-webkit-backdrop-filter","none")}function isLastTraversableNode(node){return["html","body","#document"].includes(getNodeName(node))}function getComputedStyle(element){return getWindow(element).getComputedStyle(element)}function getNodeScroll(element){if(isElement(element)){return{scrollLeft:element.scrollLeft,scrollTop:element.scrollTop}}return{scrollLeft:element.scrollX,scrollTop:element.scrollY}}function getParentNode(node){if(getNodeName(node)==="html"){return node}const result=node.assignedSlot||node.parentNode||isShadowRoot(node)&&node.host||getDocumentElement(node);return isShadowRoot(result)?result.host:result}function getNearestOverflowAncestor(node){const parentNode=getParentNode(node);if(isLastTraversableNode(parentNode)){return node.ownerDocument?node.ownerDocument.body:node.body}if(isHTMLElement(parentNode)&&isOverflowElement(parentNode)){return parentNode}return getNearestOverflowAncestor(parentNode)}function getOverflowAncestors(node,list,traverseIframes){var _node$ownerDocument2;if(list===void 0){list=[]}if(traverseIframes===void 0){traverseIframes=true}const scrollableAncestor=getNearestOverflowAncestor(node);const isBody=scrollableAncestor===((_node$ownerDocument2=node.ownerDocument)==null?void 0:_node$ownerDocument2.body);const win=getWindow(scrollableAncestor);if(isBody){const frameElement=getFrameElement(win);return list.concat(win,win.visualViewport||[],isOverflowElement(scrollableAncestor)?scrollableAncestor:[],frameElement&&traverseIframes?getOverflowAncestors(frameElement):[])}return list.concat(scrollableAncestor,getOverflowAncestors(scrollableAncestor,[],traverseIframes))}function getFrameElement(win){return win.parent&&Object.getPrototypeOf(win.parent)?win.frameElement:null}function getCssDimensions(element){const css=getComputedStyle(element);let width=parseFloat(css.width)||0;let height=parseFloat(css.height)||0;const hasOffset=isHTMLElement(element);const offsetWidth=hasOffset?element.offsetWidth:width;const offsetHeight=hasOffset?element.offsetHeight:height;const shouldFallback=round(width)!==offsetWidth||round(height)!==offsetHeight;if(shouldFallback){width=offsetWidth;height=offsetHeight}return{width:width,height:height,$:shouldFallback}}function unwrapElement(element){return!isElement(element)?element.contextElement:element}function getScale(element){const domElement=unwrapElement(element);if(!isHTMLElement(domElement)){return createCoords(1)}const rect=domElement.getBoundingClientRect();const{width:width,height:height,$:$}=getCssDimensions(domElement);let x=($?round(rect.width):rect.width)/width;let y=($?round(rect.height):rect.height)/height;if(!x||!Number.isFinite(x)){x=1}if(!y||!Number.isFinite(y)){y=1}return{x:x,y:y}}const noOffsets=createCoords(0);function getVisualOffsets(element){const win=getWindow(element);if(!isWebKit()||!win.visualViewport){return noOffsets}return{x:win.visualViewport.offsetLeft,y:win.visualViewport.offsetTop}}function shouldAddVisualOffsets(element,isFixed,floatingOffsetParent){if(isFixed===void 0){isFixed=false}if(!floatingOffsetParent||isFixed&&floatingOffsetParent!==getWindow(element)){return false}return isFixed}function getBoundingClientRect(element,includeScale,isFixedStrategy,offsetParent){if(includeScale===void 0){includeScale=false}if(isFixedStrategy===void 0){isFixedStrategy=false}const clientRect=element.getBoundingClientRect();const domElement=unwrapElement(element);let scale=createCoords(1);if(includeScale){if(offsetParent){if(isElement(offsetParent)){scale=getScale(offsetParent)}}else{scale=getScale(element)}}const visualOffsets=shouldAddVisualOffsets(domElement,isFixedStrategy,offsetParent)?getVisualOffsets(domElement):createCoords(0);let x=(clientRect.left+visualOffsets.x)/scale.x;let y=(clientRect.top+visualOffsets.y)/scale.y;let width=clientRect.width/scale.x;let height=clientRect.height/scale.y;if(domElement){const win=getWindow(domElement);const offsetWin=offsetParent&&isElement(offsetParent)?getWindow(offsetParent):offsetParent;let currentWin=win;let currentIFrame=getFrameElement(currentWin);while(currentIFrame&&offsetParent&&offsetWin!==currentWin){const iframeScale=getScale(currentIFrame);const iframeRect=currentIFrame.getBoundingClientRect();const css=getComputedStyle(currentIFrame);const left2=iframeRect.left+(currentIFrame.clientLeft+parseFloat(css.paddingLeft))*iframeScale.x;const top2=iframeRect.top+(currentIFrame.clientTop+parseFloat(css.paddingTop))*iframeScale.y;x*=iframeScale.x;y*=iframeScale.y;width*=iframeScale.x;height*=iframeScale.y;x+=left2;y+=top2;currentWin=getWindow(currentIFrame);currentIFrame=getFrameElement(currentWin)}}return rectToClientRect({width:width,height:height,x:x,y:y})}function getWindowScrollBarX(element,rect){const leftScroll=getNodeScroll(element).scrollLeft;if(!rect){return getBoundingClientRect(getDocumentElement(element)).left+leftScroll}return rect.left+leftScroll}function getHTMLOffset(documentElement,scroll,ignoreScrollbarX){if(ignoreScrollbarX===void 0){ignoreScrollbarX=false}const htmlRect=documentElement.getBoundingClientRect();const x=htmlRect.left+scroll.scrollLeft-(ignoreScrollbarX?0:getWindowScrollBarX(documentElement,htmlRect));const y=htmlRect.top+scroll.scrollTop;return{x:x,y:y}}function convertOffsetParentRelativeRectToViewportRelativeRect(_ref){let{elements:elements,rect:rect,offsetParent:offsetParent,strategy:strategy}=_ref;const isFixed=strategy==="fixed";const documentElement=getDocumentElement(offsetParent);const topLayer=elements?isTopLayer(elements.floating):false;if(offsetParent===documentElement||topLayer&&isFixed){return rect}let scroll={scrollLeft:0,scrollTop:0};let scale=createCoords(1);const offsets=createCoords(0);const isOffsetParentAnElement=isHTMLElement(offsetParent);if(isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed){if(getNodeName(offsetParent)!=="body"||isOverflowElement(documentElement)){scroll=getNodeScroll(offsetParent)}if(isHTMLElement(offsetParent)){const offsetRect=getBoundingClientRect(offsetParent);scale=getScale(offsetParent);offsets.x=offsetRect.x+offsetParent.clientLeft;offsets.y=offsetRect.y+offsetParent.clientTop}}const htmlOffset=documentElement&&!isOffsetParentAnElement&&!isFixed?getHTMLOffset(documentElement,scroll,true):createCoords(0);return{width:rect.width*scale.x,height:rect.height*scale.y,x:rect.x*scale.x-scroll.scrollLeft*scale.x+offsets.x+htmlOffset.x,y:rect.y*scale.y-scroll.scrollTop*scale.y+offsets.y+htmlOffset.y}}function getClientRects(element){return Array.from(element.getClientRects())}function getDocumentRect(element){const html=getDocumentElement(element);const scroll=getNodeScroll(element);const body=element.ownerDocument.body;const width=max(html.scrollWidth,html.clientWidth,body.scrollWidth,body.clientWidth);const height=max(html.scrollHeight,html.clientHeight,body.scrollHeight,body.clientHeight);let x=-scroll.scrollLeft+getWindowScrollBarX(element);const y=-scroll.scrollTop;if(getComputedStyle(body).direction==="rtl"){x+=max(html.clientWidth,body.clientWidth)-width}return{width:width,height:height,x:x,y:y}}function getViewportRect(element,strategy){const win=getWindow(element);const html=getDocumentElement(element);const visualViewport=win.visualViewport;let width=html.clientWidth;let height=html.clientHeight;let x=0;let y=0;if(visualViewport){width=visualViewport.width;height=visualViewport.height;const visualViewportBased=isWebKit();if(!visualViewportBased||visualViewportBased&&strategy==="fixed"){x=visualViewport.offsetLeft;y=visualViewport.offsetTop}}return{width:width,height:height,x:x,y:y}}function getInnerBoundingClientRect(element,strategy){const clientRect=getBoundingClientRect(element,true,strategy==="fixed");const top2=clientRect.top+element.clientTop;const left2=clientRect.left+element.clientLeft;const scale=isHTMLElement(element)?getScale(element):createCoords(1);const width=element.clientWidth*scale.x;const height=element.clientHeight*scale.y;const x=left2*scale.x;const y=top2*scale.y;return{width:width,height:height,x:x,y:y}}function getClientRectFromClippingAncestor(element,clippingAncestor,strategy){let rect;if(clippingAncestor==="viewport"){rect=getViewportRect(element,strategy)}else if(clippingAncestor==="document"){rect=getDocumentRect(getDocumentElement(element))}else if(isElement(clippingAncestor)){rect=getInnerBoundingClientRect(clippingAncestor,strategy)}else{const visualOffsets=getVisualOffsets(element);rect={x:clippingAncestor.x-visualOffsets.x,y:clippingAncestor.y-visualOffsets.y,width:clippingAncestor.width,height:clippingAncestor.height}}return rectToClientRect(rect)}function hasFixedPositionAncestor(element,stopNode){const parentNode=getParentNode(element);if(parentNode===stopNode||!isElement(parentNode)||isLastTraversableNode(parentNode)){return false}return getComputedStyle(parentNode).position==="fixed"||hasFixedPositionAncestor(parentNode,stopNode)}function getClippingElementAncestors(element,cache){const cachedResult=cache.get(element);if(cachedResult){return cachedResult}let result=getOverflowAncestors(element,[],false).filter((el=>isElement(el)&&getNodeName(el)!=="body"));let currentContainingBlockComputedStyle=null;const elementIsFixed=getComputedStyle(element).position==="fixed";let currentNode=elementIsFixed?getParentNode(element):element;while(isElement(currentNode)&&!isLastTraversableNode(currentNode)){const computedStyle=getComputedStyle(currentNode);const currentNodeIsContaining=isContainingBlock(currentNode);if(!currentNodeIsContaining&&computedStyle.position==="fixed"){currentContainingBlockComputedStyle=null}const shouldDropCurrentNode=elementIsFixed?!currentNodeIsContaining&&!currentContainingBlockComputedStyle:!currentNodeIsContaining&&computedStyle.position==="static"&&!!currentContainingBlockComputedStyle&&["absolute","fixed"].includes(currentContainingBlockComputedStyle.position)||isOverflowElement(currentNode)&&!currentNodeIsContaining&&hasFixedPositionAncestor(element,currentNode);if(shouldDropCurrentNode){result=result.filter((ancestor=>ancestor!==currentNode))}else{currentContainingBlockComputedStyle=computedStyle}currentNode=getParentNode(currentNode)}cache.set(element,result);return result}function getClippingRect(_ref){let{element:element,boundary:boundary,rootBoundary:rootBoundary,strategy:strategy}=_ref;const elementClippingAncestors=boundary==="clippingAncestors"?isTopLayer(element)?[]:getClippingElementAncestors(element,this._c):[].concat(boundary);const clippingAncestors=[...elementClippingAncestors,rootBoundary];const firstClippingAncestor=clippingAncestors[0];const clippingRect=clippingAncestors.reduce(((accRect,clippingAncestor)=>{const rect=getClientRectFromClippingAncestor(element,clippingAncestor,strategy);accRect.top=max(rect.top,accRect.top);accRect.right=min(rect.right,accRect.right);accRect.bottom=min(rect.bottom,accRect.bottom);accRect.left=max(rect.left,accRect.left);return accRect}),getClientRectFromClippingAncestor(element,firstClippingAncestor,strategy));return{width:clippingRect.right-clippingRect.left,height:clippingRect.bottom-clippingRect.top,x:clippingRect.left,y:clippingRect.top}}function getDimensions(element){const{width:width,height:height}=getCssDimensions(element);return{width:width,height:height}}function getRectRelativeToOffsetParent(element,offsetParent,strategy){const isOffsetParentAnElement=isHTMLElement(offsetParent);const documentElement=getDocumentElement(offsetParent);const isFixed=strategy==="fixed";const rect=getBoundingClientRect(element,true,isFixed,offsetParent);let scroll={scrollLeft:0,scrollTop:0};const offsets=createCoords(0);if(isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed){if(getNodeName(offsetParent)!=="body"||isOverflowElement(documentElement)){scroll=getNodeScroll(offsetParent)}if(isOffsetParentAnElement){const offsetRect=getBoundingClientRect(offsetParent,true,isFixed,offsetParent);offsets.x=offsetRect.x+offsetParent.clientLeft;offsets.y=offsetRect.y+offsetParent.clientTop}else if(documentElement){offsets.x=getWindowScrollBarX(documentElement)}}const htmlOffset=documentElement&&!isOffsetParentAnElement&&!isFixed?getHTMLOffset(documentElement,scroll):createCoords(0);const x=rect.left+scroll.scrollLeft-offsets.x-htmlOffset.x;const y=rect.top+scroll.scrollTop-offsets.y-htmlOffset.y;return{x:x,y:y,width:rect.width,height:rect.height}}function isStaticPositioned(element){return getComputedStyle(element).position==="static"}function getTrueOffsetParent(element,polyfill){if(!isHTMLElement(element)||getComputedStyle(element).position==="fixed"){return null}if(polyfill){return polyfill(element)}let rawOffsetParent=element.offsetParent;if(getDocumentElement(element)===rawOffsetParent){rawOffsetParent=rawOffsetParent.ownerDocument.body}return rawOffsetParent}function getOffsetParent(element,polyfill){const win=getWindow(element);if(isTopLayer(element)){return win}if(!isHTMLElement(element)){let svgOffsetParent=getParentNode(element);while(svgOffsetParent&&!isLastTraversableNode(svgOffsetParent)){if(isElement(svgOffsetParent)&&!isStaticPositioned(svgOffsetParent)){return svgOffsetParent}svgOffsetParent=getParentNode(svgOffsetParent)}return win}let offsetParent=getTrueOffsetParent(element,polyfill);while(offsetParent&&isTableElement(offsetParent)&&isStaticPositioned(offsetParent)){offsetParent=getTrueOffsetParent(offsetParent,polyfill)}if(offsetParent&&isLastTraversableNode(offsetParent)&&isStaticPositioned(offsetParent)&&!isContainingBlock(offsetParent)){return win}return offsetParent||getContainingBlock(element)||win}const getElementRects=async function(data){const getOffsetParentFn=this.getOffsetParent||getOffsetParent;const getDimensionsFn=this.getDimensions;const floatingDimensions=await getDimensionsFn(data.floating);return{reference:getRectRelativeToOffsetParent(data.reference,await getOffsetParentFn(data.floating),data.strategy),floating:{x:0,y:0,width:floatingDimensions.width,height:floatingDimensions.height}}};function isRTL(element){return getComputedStyle(element).direction==="rtl"}const platform={convertOffsetParentRelativeRectToViewportRelativeRect:convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement:getDocumentElement,getClippingRect:getClippingRect,getOffsetParent:getOffsetParent,getElementRects:getElementRects,getClientRects:getClientRects,getDimensions:getDimensions,getScale:getScale,isElement:isElement,isRTL:isRTL};function rectsAreEqual(a,b){return a.x===b.x&&a.y===b.y&&a.width===b.width&&a.height===b.height}function observeMove(element,onMove){let io=null;let timeoutId;const root=getDocumentElement(element);function cleanup(){var _io;clearTimeout(timeoutId);(_io=io)==null||_io.disconnect();io=null}function refresh(skip,threshold){if(skip===void 0){skip=false}if(threshold===void 0){threshold=1}cleanup();const elementRectForRootMargin=element.getBoundingClientRect();const{left:left2,top:top2,width:width,height:height}=elementRectForRootMargin;if(!skip){onMove()}if(!width||!height){return}const insetTop=floor(top2);const insetRight=floor(root.clientWidth-(left2+width));const insetBottom=floor(root.clientHeight-(top2+height));const insetLeft=floor(left2);const rootMargin=-insetTop+"px "+-insetRight+"px "+-insetBottom+"px "+-insetLeft+"px";const options={rootMargin:rootMargin,threshold:max(0,min(1,threshold))||1};let isFirstUpdate=true;function handleObserve(entries){const ratio=entries[0].intersectionRatio;if(ratio!==threshold){if(!isFirstUpdate){return refresh()}if(!ratio){timeoutId=setTimeout((()=>{refresh(false,1e-7)}),1e3)}else{refresh(false,ratio)}}if(ratio===1&&!rectsAreEqual(elementRectForRootMargin,element.getBoundingClientRect())){refresh()}isFirstUpdate=false}try{io=new IntersectionObserver(handleObserve,{...options,root:root.ownerDocument})}catch(e){io=new IntersectionObserver(handleObserve,options)}io.observe(element)}refresh(true);return cleanup}function autoUpdate(reference2,floating,update,options){if(options===void 0){options={}}const{ancestorScroll:ancestorScroll=true,ancestorResize:ancestorResize=true,elementResize:elementResize=typeof ResizeObserver==="function",layoutShift:layoutShift=typeof IntersectionObserver==="function",animationFrame:animationFrame=false}=options;const referenceEl=unwrapElement(reference2);const ancestors=ancestorScroll||ancestorResize?[...referenceEl?getOverflowAncestors(referenceEl):[],...getOverflowAncestors(floating)]:[];ancestors.forEach((ancestor=>{ancestorScroll&&ancestor.addEventListener("scroll",update,{passive:true});ancestorResize&&ancestor.addEventListener("resize",update)}));const cleanupIo=referenceEl&&layoutShift?observeMove(referenceEl,update):null;let reobserveFrame=-1;let resizeObserver=null;if(elementResize){resizeObserver=new ResizeObserver((_ref=>{let[firstEntry]=_ref;if(firstEntry&&firstEntry.target===referenceEl&&resizeObserver){resizeObserver.unobserve(floating);cancelAnimationFrame(reobserveFrame);reobserveFrame=requestAnimationFrame((()=>{var _resizeObserver;(_resizeObserver=resizeObserver)==null||_resizeObserver.observe(floating)}))}update()}));if(referenceEl&&!animationFrame){resizeObserver.observe(referenceEl)}resizeObserver.observe(floating)}let frameId;let prevRefRect=animationFrame?getBoundingClientRect(reference2):null;if(animationFrame){frameLoop()}function frameLoop(){const nextRefRect=getBoundingClientRect(reference2);if(prevRefRect&&!rectsAreEqual(prevRefRect,nextRefRect)){update()}prevRefRect=nextRefRect;frameId=requestAnimationFrame(frameLoop)}update();return()=>{var _resizeObserver2;ancestors.forEach((ancestor=>{ancestorScroll&&ancestor.removeEventListener("scroll",update);ancestorResize&&ancestor.removeEventListener("resize",update)}));cleanupIo==null||cleanupIo();(_resizeObserver2=resizeObserver)==null||_resizeObserver2.disconnect();resizeObserver=null;if(animationFrame){cancelAnimationFrame(frameId)}}}const offset=offset$1;const shift=shift$1;const flip=flip$1;const arrow=arrow$1;const computePosition=(reference2,floating,options)=>{const cache=new Map;const mergedOptions={platform:platform,...options};const platformWithCache={...mergedOptions.platform,_c:cache};return computePosition$1(reference2,floating,{...mergedOptions,platform:platformWithCache})};const TOOLTIP_OFFSET=20;const TOOLTIP_TIMEOUT=250;const SAFE_ZONE_MARGIN=1;class PbTooltip extends PbEnhancedElement{static get selector(){return"[data-pb-tooltip-kit]"}connect(){if(this.tooltipInteraction){document.addEventListener("mousemove",(e=>{this.lastMouseX=e.clientX;this.lastMouseY=e.clientY}))}this.triggerElements.forEach((trigger=>{const method=this.effectiveTriggerMethod;const interactionEnabled=this.tooltipInteraction;if(method==="click"){trigger.addEventListener("click",(e=>{if(this.useClickToOpen){e.preventDefault();if(this.isTooltipVisible()){this.hideTooltip()}else{this.showTooltip(trigger)}}else{this.showTooltip(trigger)}}))}else{if(!this.useClickToOpen){trigger.addEventListener("mouseenter",(()=>{clearSafeZoneListener(this);clearTimeout(this.mouseleaveTimeout);this.currentTrigger=trigger;const delayOpen=this.delayOpen?parseInt(this.delayOpen):TOOLTIP_TIMEOUT;this.mouseenterTimeout=setTimeout((()=>{this.showTooltip(trigger);if(interactionEnabled){this.checkCloseTooltip(trigger)}}),delayOpen)}));trigger.addEventListener("mouseleave",(()=>{clearTimeout(this.mouseenterTimeout);if(this.delayClose){const delayClose=parseInt(this.delayClose);this.mouseleaveTimeout=setTimeout((()=>{if(interactionEnabled){this.attachSafeZoneListener()}else{this.hideTooltip()}}),delayClose)}else{if(interactionEnabled){this.attachSafeZoneListener()}else{this.hideTooltip()}}}));if(interactionEnabled){this.tooltip.addEventListener("mouseenter",(()=>{clearSafeZoneListener(this)}));this.tooltip.addEventListener("mouseleave",(()=>{this.attachSafeZoneListener()}))}}}}))}isTooltipVisible(){return this.tooltip&&this.tooltip.classList.contains("show")}attachSafeZoneListener(){clearSafeZoneListener(this);this.safeZoneHandler=e=>{if(!this.currentTrigger)return;const triggerRect=this.currentTrigger.getBoundingClientRect();const tooltipRect=this.tooltip.getBoundingClientRect();const safeRect=getSafeZone(triggerRect,tooltipRect,this.position,SAFE_ZONE_MARGIN);if(!isPointInsideRect(e.clientX,e.clientY,safeRect)){this.hideTooltip();clearSafeZoneListener(this)}};document.addEventListener("mousemove",this.safeZoneHandler)}checkCloseTooltip(trigger){document.querySelector("body").addEventListener("click",(({target:target})=>{const isTooltip=target.closest(`#${this.tooltipId}`)===this.tooltip;const isTrigger=target.closest(this.triggerElementSelector)===trigger;if(isTrigger||isTooltip){this.checkCloseTooltip(trigger)}else{this.hideTooltip()}}),{once:true})}showTooltip(trigger){if(this.shouldShowTooltip==="false")return;clearSafeZoneListener(this);this.tooltip.style.opacity="1";this.tooltip.style.visibility="visible";this.tooltip.style.pointerEvents="auto";if(this.cleanup){this.cleanup()}const arrowElement=document.querySelector(`#${this.tooltipId}-arrow`);this.cleanup=autoUpdate(trigger,this.tooltip,(()=>{computePosition(trigger,this.tooltip,{placement:this.position,strategy:"fixed",middleware:[offset({mainAxis:TOOLTIP_OFFSET,crossAxis:0}),flip(),shift(),arrow({element:arrowElement})]}).then((({x:x,y:y,placement:placement,middlewareData:middlewareData})=>{Object.assign(this.tooltip.style,{left:`${x}px`,top:`${y}px`,position:"fixed"});this.tooltip.setAttribute("data-popper-placement",placement);if(arrowElement&&middlewareData.arrow){const{x:arrowX,y:arrowY}=middlewareData.arrow;Object.assign(arrowElement.style,{left:arrowX!=null?`${arrowX}px`:"",top:arrowY!=null?`${arrowY}px`:"",position:"absolute"})}}))}));this.tooltip.classList.add("show");if(this.effectiveTriggerMethod==="click"&&!this.useClickToOpen){clearTimeout(this.autoHideTimeout);this.autoHideTimeout=setTimeout((()=>{this.hideTooltip()}),1e3)}}hideTooltip(){if(!this.tooltip)return;this.tooltip.classList.add("fade_out");setTimeout((()=>{if(this.cleanup){this.cleanup();this.cleanup=null}this.tooltip.classList.remove("show");this.tooltip.classList.remove("fade_out");this.tooltip.style.opacity="0";this.tooltip.style.visibility="hidden";this.tooltip.style.pointerEvents="none";this.tooltip.style.position="";this.tooltip.style.top="";this.tooltip.style.left="";this.tooltip.style.transform=""}),TOOLTIP_TIMEOUT)}get triggerElements(){let triggerEl;if(this.triggerElementId){triggerEl=document.querySelector(`#${this.triggerElementId}`)}else if(this.triggerElementSelector){const selectorIsId=this.triggerElementSelector.indexOf("#")>-1;triggerEl=selectorIsId?document.querySelector(this.triggerElementSelector):document.querySelectorAll(this.triggerElementSelector)}else{triggerEl=this.element}if(!triggerEl){console.error("Tooltip Kit: No valid trigger element found!");return[]}if(triggerEl.length===void 0){triggerEl=[triggerEl]}return triggerEl}get tooltip(){return this._tooltip=this._tooltip||this.element.querySelector(`#${this.tooltipId}`)}get position(){return this.element.dataset.pbTooltipPosition}get triggerElementId(){return this.element.dataset.pbTooltipTriggerElementId}get tooltipId(){return this.element.dataset.pbTooltipTooltipId}get triggerElementSelector(){return this.element.dataset.pbTooltipTriggerElementSelector}get shouldShowTooltip(){return this.element.dataset.pbTooltipShowTooltip}get triggerMethod(){return this.element.dataset.pbTooltipTriggerMethod||"hover"}get useClickToOpen(){return this.element.dataset.pbTooltipUseClickToOpen==="true"}get effectiveTriggerMethod(){return this.useClickToOpen?"click":this.triggerMethod}get tooltipInteraction(){return this.element.dataset.pbTooltipInteraction==="true"}get delayOpen(){return this.element.dataset.pbTooltipDelayOpen}get delayClose(){return this.element.dataset.pbTooltipDelayClose}}function clearSafeZoneListener(context){if(context.safeZoneHandler){document.removeEventListener("mousemove",context.safeZoneHandler);context.safeZoneHandler=null}}function getSafeZone(triggerRect,tooltipRect,placement,margin){let safeRect={};if(placement.startsWith("top")){safeRect.left=triggerRect.left-margin;safeRect.right=triggerRect.right+margin;safeRect.top=tooltipRect.bottom-margin;safeRect.bottom=triggerRect.top+margin}else if(placement.startsWith("bottom")){safeRect.left=triggerRect.left-margin;safeRect.right=triggerRect.right+margin;safeRect.top=triggerRect.bottom-margin;safeRect.bottom=tooltipRect.top+margin}else if(placement.startsWith("left")){safeRect.top=triggerRect.top-margin;safeRect.bottom=triggerRect.bottom+margin;safeRect.left=tooltipRect.right-margin;safeRect.right=triggerRect.left+margin}else if(placement.startsWith("right")){safeRect.top=triggerRect.top-margin;safeRect.bottom=triggerRect.bottom+margin;safeRect.left=triggerRect.right-margin;safeRect.right=tooltipRect.left+margin}else{safeRect={left:triggerRect.left-margin,right:triggerRect.right+margin,top:triggerRect.top-margin,bottom:triggerRect.bottom+margin}}return safeRect}function isPointInsideRect(x,y,rect){return x>=rect.left&&x<=rect.right&&y>=rect.top&&y<=rect.bottom}class PbTypeahead extends PbEnhancedElement{static get selector(){return"[data-pb-typeahead-kit]"}connect(){this.element.addEventListener("keydown",(event=>this.handleKeydown(event)));this.searchInput.addEventListener("focus",(()=>this.debouncedSearch()));this.searchInput.addEventListener("input",(()=>this.debouncedSearch()));this.resultsElement.addEventListener("click",(event=>this.optionSelected(event)));if(this.clearOnContextChange&&this.searchContextElement){this.searchContextElement.addEventListener("change",(()=>{this.searchInputClear();this.resultsCacheClear();this.clearResults()}))}}get optionsByContext(){return this.element.dataset.pbTypeaheadKitOptionsByContext?JSON.parse(this.element.dataset.pbTypeaheadKitOptionsByContext):null}get searchContextElement(){var _a;const selector=this.element.dataset.pbTypeaheadKitSearchContextSelector;if(!selector)return null;const found=((_a=this.element.parentNode)==null?void 0:_a.querySelector(`#${selector}`))||this.element.closest(selector);return found||null}get clearOnContextChange(){return this.element.dataset.pbTypeaheadKitClearOnContextChange==="true"}handleKeydown(event){if(event.key==="ArrowUp"){event.preventDefault();this.focusPreviousOption()}else if(event.key==="ArrowDown"){event.preventDefault();this.focusNextOption()}}search(){if(this.searchTerm.length<parseInt(this.searchTermMinimumLength))return this.clearResults();this.toggleResultsLoadingIndicator(true);this.showResults();const searchTerm=this.searchTerm;const searchContext=this.searchContext;if(this.optionsByContext&&Object.keys(this.optionsByContext).length>0){const contextArray=this.optionsByContext[searchContext]||[];const filteredResults=contextArray.filter((obj=>obj.label&&obj.label.toLowerCase().includes(searchTerm.toLowerCase())));const optionFragments=filteredResults.map((obj=>{const singleOption=document.createDocumentFragment();singleOption.appendChild(document.createTextNode(obj.label));return singleOption}));this.resultsCacheUpdate(searchTerm,searchContext,optionFragments)}else{const search={searchingFor:searchTerm,searchingContext:searchContext,setResults:results=>{this.resultsCacheUpdate(searchTerm,searchContext,results)}};this.element.dispatchEvent(new CustomEvent("pb-typeahead-kit-search",{bubbles:true,detail:search}))}}resultsCacheUpdate(searchTerm,searchContext,results){const searchTermAndContext=this.cacheKeyFor(searchTerm,searchContext);if(this.resultsOptionCache.has(searchTermAndContext))this.resultsOptionCache.delete(searchTermAndContext);if(this.resultsOptionCache.size>32)this.resultsOptionCache.delete(this.resultsOptionCache.keys().next().value);this.resultsOptionCache.set(searchTermAndContext,results);this.showResults()}resultsCacheClear(){this.resultsOptionCache.clear()}get debouncedSearch(){return this._debouncedSearch=this._debouncedSearch||debounce$2(this.search,parseInt(this.searchDebounceTimeout)).bind(this)}showResults(){if(!this.resultsOptionCache.has(this.searchTermAndContext))return;this.toggleResultsLoadingIndicator(false);this.clearResults();for(const result of this.resultsOptionCache.get(this.searchTermAndContext)){this.resultsElement.appendChild(this.newResultOption(result.cloneNode(true)))}for(const result of this.resultsElement.querySelectorAll("[data-result-option-item]")){result.addEventListener("mousedown",(event=>this.optionSelected(event)))}}optionSelected(event){const resultOption=event.target.closest("[data-result-option-item]");if(!resultOption)return;const selectedText=resultOption.textContent.trim();this._validSelection=true;this.removeValidationError();if(this.searchContextElement)this.searchInput.value=selectedText;this.resultsCacheClear();if(!this.searchContextElement)this.searchInputClear();this.clearResults();this.element.dispatchEvent(new CustomEvent("pb-typeahead-kit-result-option-selected",{bubbles:true,detail:{selected:resultOption,typeahead:this}}))}removeValidationError(){const inputWrapper=this.searchInput.closest(".text_input_wrapper");if(inputWrapper){const errorMessage=inputWrapper.querySelector(".pb_body_kit_negative");if(errorMessage){errorMessage.style.display="none"}this.searchInput.classList.remove("error")}}showValidationError(){const inputWrapper=this.searchInput.closest(".text_input_wrapper");if(inputWrapper){const errorMessage=inputWrapper.querySelector(".pb_body_kit_negative");if(errorMessage){errorMessage.style.display="block"}this.searchInput.classList.add("error")}}clearResults(){this.resultsElement.innerHTML=""}newResultOption(content){const resultOption=this.resultOptionTemplate.content.cloneNode(true);resultOption.querySelector('slot[name="content"]').replaceWith(content);return resultOption}focusPreviousOption(){const currentIndex=this.resultOptionItems.indexOf(this.currentSelectedResultOptionItem);const previousIndex=currentIndex-1;const previousOptionItem=this.resultOptionItems[previousIndex]||this.resultOptionItems[this.resultOptionItems.length-1];previousOptionItem.focus()}focusNextOption(){const currentIndex=this.resultOptionItems.indexOf(this.currentSelectedResultOptionItem);const nextIndex=currentIndex+1;const nextOptionItem=this.resultOptionItems[nextIndex]||this.resultOptionItems[0];nextOptionItem.focus()}get resultOptionItems(){return Array.from(this.resultsElement.querySelectorAll("[data-result-option-item]"))}get currentSelectedResultOptionItem(){return document.activeElement.closest("[data-result-option-item]")}get searchInput(){return this._searchInput=this._searchInput||this.element.querySelector('input[type="search"]')}get searchTerm(){return this.searchInput.value}get searchContext(){if(this._searchContext)return this._searchContext;const selector=this.element.dataset.searchContextValueSelector;if(selector)return(this.element.parentNode.querySelector(selector)||this.element.closest(selector)).value;else if(this.searchContextElement){return this.searchContextElement.value}return null}set searchContext(value){this._searchContext=value}get searchTermAndContext(){return this.cacheKeyFor(this.searchTerm,this.searchContext)}cacheKeyFor(searchTerm,searchContext){return[searchTerm,JSON.stringify(searchContext)].join()}searchInputClear(){this.searchInput.value=""}get searchTermMinimumLength(){return this.element.dataset.pbTypeaheadKitSearchTermMinimumLength}get searchDebounceTimeout(){return this.element.dataset.pbTypeaheadKitSearchDebounceTimeout}get resultsElement(){return this._resultsElement=this._resultsElement||this.element.querySelector("[data-pb-typeahead-kit-results]")}get resultOptionTemplate(){return this._resultOptionTemplate=this._resultOptionTemplate||this.element.querySelector("template[data-pb-typeahead-kit-result-option]")}get resultsOptionCache(){return this._resultsOptionCache=this._resultsOptionCache||new Map}get resultsLoadingIndicator(){return this._resultsLoadingIndicator=this._resultsLoadingIndicator||this.element.querySelector("[data-pb-typeahead-kit-loading-indicator]")}toggleResultsLoadingIndicator(visible){let visibilityProperty="0";if(visible)visibilityProperty="1";this.resultsLoadingIndicator.style.opacity=visibilityProperty}}const formHelper=()=>{const loadingForm=document.querySelector(".pb_form_loading");if(loadingForm){loadingForm.addEventListener("submit",(function(event){const submitButton=event["submitter"];const cancelButton=event["target"].querySelector('button[type="reset"]');if(submitButton){let currentClass=submitButton.className;let newClass=currentClass.replace("pb_button_enabled","pb_button_disabled pb_button_loading");let cancelClass=cancelButton?cancelButton.className:"";let newCancelClass=cancelClass.replace("_enabled","_disabled");submitButton.disabled=true;submitButton.className=newClass;if(cancelButton){cancelButton.disabled=true;cancelButton.className=newCancelClass}}}))}};const lightest="1px";const lighter="2px";const light="4px";const normal$1="0";const heavy="5px";const heavier="6px";const heaviest="7px";const border_radius_xs="4px";const border_radius_sm="4px";const border_radius_md="6px";const border_radius_lg="8px";const border_radius_xl="16px";const border_radius_none="0";const border_radius_rounded="1000px";const _border_radius_module={lightest:lightest,lighter:lighter,light:light,normal:normal$1,heavy:heavy,heavier:heavier,heaviest:heaviest,border_radius_xs:border_radius_xs,border_radius_sm:border_radius_sm,border_radius_md:border_radius_md,border_radius_lg:border_radius_lg,border_radius_xl:border_radius_xl,border_radius_none:border_radius_none,border_radius_rounded:border_radius_rounded};const tightest="1";const tighter="1.2";const tight="1.4";const normal="1.5";const loose="1.6";const looser="1.8";const loosest="2";const _line_height_module={tightest:tightest,tighter:tighter,tight:tight,normal:normal,loose:loose,looser:looser,loosest:loosest};const opacity_1="0.1";const opacity_2="0.2";const opacity_3="0.3";const opacity_4="0.4";const opacity_5="0.5";const opacity_6="0.6";const opacity_7="0.7";const opacity_8="0.8";const opacity_9="0.9";const _opacity_module={opacity_1:opacity_1,opacity_2:opacity_2,opacity_3:opacity_3,opacity_4:opacity_4,opacity_5:opacity_5,opacity_6:opacity_6,opacity_7:opacity_7,opacity_8:opacity_8,opacity_9:opacity_9};const zindex_1="100";const zindex_2="100";const zindex_3="100";const zindex_4="100";const zindex_5="100";const zindex_6="100";const zindex_7="100";const zindex_8="100";const zindex_9="100";const _positioning_module={zindex_1:zindex_1,zindex_2:zindex_2,zindex_3:zindex_3,zindex_4:zindex_4,zindex_5:zindex_5,zindex_6:zindex_6,zindex_7:zindex_7,zindex_8:zindex_8,zindex_9:zindex_9};const hover_scale_sm="_scale-module__hover_scale_sm___mttFB";const hover_scale_md="_scale-module__hover_scale_md___ipMVm";const hover_scale_lg="_scale-module__hover_scale_lg___-EkY0";const _scale_module={hover_scale_sm:hover_scale_sm,hover_scale_md:hover_scale_md,hover_scale_lg:hover_scale_lg};const xs="575px";const sm="576px";const md="768px";const lg="992px";const xl="1200px";const _screen_sizes_module={xs:xs,sm:sm,md:md,lg:lg,xl:xl};const shadow_none="0 0 0 0 transparent";const shadow_deep="0 4px 10px 0 rgba(60, 106, 172, 0.16)";const shadow_deeper="0 12px 28px 0 rgba(60, 106, 172, 0.18)";const shadow_deepest="0 30px 38px 4px rgba(60, 106, 172, 0.2), 0 2px 14px 4px rgba(60, 106, 172, 0.1)";const _shadows_module={shadow_none:shadow_none,shadow_deep:shadow_deep,shadow_deeper:shadow_deeper,shadow_deepest:shadow_deepest};const space_xxs="4px";const space_xs="8px";const space_sm="16px";const space_md="24px";const space_lg="32px";const space_xl="40px";const none="0";const _spacing_module={space_xxs:space_xxs,space_xs:space_xs,space_sm:space_sm,space_md:space_md,space_lg:space_lg,space_xl:space_xl,none:none};export{arrow$1 as $,PbPopover as A,PbTable as B,PbTooltip as C,DateTime as D,PbTypeahead as E,formHelper as F,_line_height_module as G,_opacity_module as H,_positioning_module as I,_scale_module as J,_screen_sizes_module as K,_shadows_module as L,_spacing_module as M,typography as N,PbEnhancedElement as O,PbTextarea as P,debounce$2 as Q,ReactDOMServer as R,filter as S,omit as T,get as U,createPopper as V,uniqueId as W,flip$1 as X,offset$1 as Y,shift$1 as Z,_border_radius_module as _,usePBCopy as a,computePosition$1 as a0,createCoords$1 as a1,round$1 as a2,max$1 as a3,min$1 as a4,rectToClientRect as a5,merge as a6,cloneDeep as a7,isString as a8,getAugmentedNamespace as b,getDefaultExportFromCjs as c,datePickerHelper as d,useDropdown as e,find as f,getAllIcons as g,colors as h,isEmpty as i,mapTheme as j,highchartsTheme as k,highchartsDarkTheme as l,map as m,noop as n,omitBy as o,partial as p,gaugeTheme as q,circleChartTheme as r,lineGraphTheme as s,barGraphTheme as t,useCollapsible as u,commonSettings as v,dataColors as w,pbLineGraph as x,barGraphSettings as y,pbIndicator as z};
|