playbook_ui 14.21.0.pre.rc.2 → 14.21.1.pre.alpha.PLAY2140upgraderailsdependency8120

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.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +1 -1
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +116 -49
  4. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +1 -1
  5. data/app/pb_kits/playbook/pb_advanced_table/Context/AdvancedTableContext.tsx +58 -2
  6. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableActions.ts +1 -1
  7. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +16 -4
  8. data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx +7 -3
  9. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +34 -0
  10. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +13 -3
  11. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +7 -1
  12. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +61 -0
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_no_subrows.html.erb +33 -0
  14. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_no_subrows.jsx +0 -1
  15. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows.jsx +57 -0
  16. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pinned_rows_react.md +5 -0
  17. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_scrollbar_none.html.erb +33 -0
  18. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_scrollbar_none.jsx +53 -0
  19. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +6 -2
  20. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +3 -1
  21. data/app/pb_kits/playbook/pb_advanced_table/index.js +2 -0
  22. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_date_display.html.erb +13 -0
  23. data/app/pb_kits/playbook/pb_draggable/context/index.tsx +17 -58
  24. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +12 -3
  25. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_close_on_select.jsx +42 -0
  26. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_close_on_select.md +1 -0
  27. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +2 -0
  28. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +2 -1
  29. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +14 -10
  30. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +26 -15
  31. data/app/pb_kits/playbook/pb_popover/index.ts +9 -4
  32. data/app/pb_kits/playbook/pb_table/styles/_mobile_collapse.scss +1 -1
  33. data/dist/chunks/{_typeahead-CRW6dJbW.js → _typeahead-CoOpeYom.js} +1 -1
  34. data/dist/chunks/_weekday_stacked-BFXALU-0.js +45 -0
  35. data/dist/chunks/lazysizes-DHz07jlL.js +1 -0
  36. data/dist/chunks/{lib-D5R1BjUn.js → lib-D7Va7yqa.js} +1 -1
  37. data/dist/chunks/{pb_form_validation-BZ2AVAi_.js → pb_form_validation-DSkdRDMf.js} +1 -1
  38. data/dist/chunks/vendor.js +1 -1
  39. data/dist/playbook-doc.js +1 -1
  40. data/dist/playbook-rails-react-bindings.js +1 -1
  41. data/dist/playbook-rails.js +1 -1
  42. data/dist/playbook.css +1 -1
  43. data/lib/playbook/version.rb +2 -2
  44. metadata +15 -7
  45. data/dist/chunks/_weekday_stacked-C4d17aYW.js +0 -45
  46. data/dist/chunks/lazysizes-B7xYodB-.js +0 -1
@@ -0,0 +1 @@
1
+ var lazysizes={exports:{}};(function(module){(function(window2,factory){var lazySizes=factory(window2,window2.document,Date);window2.lazySizes=lazySizes;if(module.exports){module.exports=lazySizes}})(typeof window!="undefined"?window:{},(function l(window2,document,Date2){var lazysizes2,lazySizesCfg;(function(){var prop;var lazySizesDefaults={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",fastLoadedClass:"ls-is-cached",iframeLoadMode:0,srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:true,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:true,ricTimeout:0,throttleDelay:125};lazySizesCfg=window2.lazySizesConfig||window2.lazysizesConfig||{};for(prop in lazySizesDefaults){if(!(prop in lazySizesCfg)){lazySizesCfg[prop]=lazySizesDefaults[prop]}}})();if(!document||!document.getElementsByClassName){return{init:function(){},cfg:lazySizesCfg,noSupport:true}}var docElem=document.documentElement;var supportPicture=window2.HTMLPictureElement;var _addEventListener="addEventListener";var _getAttribute="getAttribute";var addEventListener=window2[_addEventListener].bind(window2);var setTimeout=window2.setTimeout;var requestAnimationFrame=window2.requestAnimationFrame||setTimeout;var requestIdleCallback=window2.requestIdleCallback;var regPicture=/^picture$/i;var loadEvents=["load","error","lazyincluded","_lazyloaded"];var regClassCache={};var forEach=Array.prototype.forEach;var hasClass=function(ele,cls){if(!regClassCache[cls]){regClassCache[cls]=new RegExp("(\\s|^)"+cls+"(\\s|$)")}return regClassCache[cls].test(ele[_getAttribute]("class")||"")&&regClassCache[cls]};var addClass=function(ele,cls){if(!hasClass(ele,cls)){ele.setAttribute("class",(ele[_getAttribute]("class")||"").trim()+" "+cls)}};var removeClass=function(ele,cls){var reg;if(reg=hasClass(ele,cls)){ele.setAttribute("class",(ele[_getAttribute]("class")||"").replace(reg," "))}};var addRemoveLoadEvents=function(dom,fn,add){var action=add?_addEventListener:"removeEventListener";if(add){addRemoveLoadEvents(dom,fn)}loadEvents.forEach((function(evt){dom[action](evt,fn)}))};var triggerEvent=function(elem,name,detail,noBubbles,noCancelable){var event=document.createEvent("Event");if(!detail){detail={}}detail.instance=lazysizes2;event.initEvent(name,!noBubbles,!noCancelable);event.detail=detail;elem.dispatchEvent(event);return event};var updatePolyfill=function(el,full){var polyfill;if(!supportPicture&&(polyfill=window2.picturefill||lazySizesCfg.pf)){if(full&&full.src&&!el[_getAttribute]("srcset")){el.setAttribute("srcset",full.src)}polyfill({reevaluate:true,elements:[el]})}else if(full&&full.src){el.src=full.src}};var getCSS=function(elem,style){return(getComputedStyle(elem,null)||{})[style]};var getWidth=function(elem,parent,width){width=width||elem.offsetWidth;while(width<lazySizesCfg.minSize&&parent&&!elem._lazysizesWidth){width=parent.offsetWidth;parent=parent.parentNode}return width};var rAF=function(){var running,waiting;var firstFns=[];var secondFns=[];var fns=firstFns;var run=function(){var runFns=fns;fns=firstFns.length?secondFns:firstFns;running=true;waiting=false;while(runFns.length){runFns.shift()()}running=false};var rafBatch=function(fn,queue){if(running&&!queue){fn.apply(this,arguments)}else{fns.push(fn);if(!waiting){waiting=true;(document.hidden?setTimeout:requestAnimationFrame)(run)}}};rafBatch._lsFlush=run;return rafBatch}();var rAFIt=function(fn,simple){return simple?function(){rAF(fn)}:function(){var that=this;var args=arguments;rAF((function(){fn.apply(that,args)}))}};var throttle=function(fn){var running;var lastTime=0;var gDelay=lazySizesCfg.throttleDelay;var rICTimeout=lazySizesCfg.ricTimeout;var run=function(){running=false;lastTime=Date2.now();fn()};var idleCallback=requestIdleCallback&&rICTimeout>49?function(){requestIdleCallback(run,{timeout:rICTimeout});if(rICTimeout!==lazySizesCfg.ricTimeout){rICTimeout=lazySizesCfg.ricTimeout}}:rAFIt((function(){setTimeout(run)}),true);return function(isPriority){var delay;if(isPriority=isPriority===true){rICTimeout=33}if(running){return}running=true;delay=gDelay-(Date2.now()-lastTime);if(delay<0){delay=0}if(isPriority||delay<9){idleCallback()}else{setTimeout(idleCallback,delay)}}};var debounce=function(func){var timeout,timestamp;var wait=99;var run=function(){timeout=null;func()};var later=function(){var last=Date2.now()-timestamp;if(last<wait){setTimeout(later,wait-last)}else{(requestIdleCallback||run)(run)}};return function(){timestamp=Date2.now();if(!timeout){timeout=setTimeout(later,wait)}}};var loader=function(){var preloadElems,isCompleted,resetPreloadingTimer,loadMode,started;var eLvW,elvH,eLtop,eLleft,eLright,eLbottom,isBodyHidden;var regImg=/^img$/i;var regIframe=/^iframe$/i;var supportScroll="onscroll"in window2&&!/(gle|ing)bot/.test(navigator.userAgent);var shrinkExpand=0;var currentExpand=0;var isLoading=0;var lowRuns=-1;var resetPreloading=function(e){isLoading--;if(!e||isLoading<0||!e.target){isLoading=0}};var isVisible=function(elem){if(isBodyHidden==null){isBodyHidden=getCSS(document.body,"visibility")=="hidden"}return isBodyHidden||!(getCSS(elem.parentNode,"visibility")=="hidden"&&getCSS(elem,"visibility")=="hidden")};var isNestedVisible=function(elem,elemExpand){var outerRect;var parent=elem;var visible=isVisible(elem);eLtop-=elemExpand;eLbottom+=elemExpand;eLleft-=elemExpand;eLright+=elemExpand;while(visible&&(parent=parent.offsetParent)&&parent!=document.body&&parent!=docElem){visible=(getCSS(parent,"opacity")||1)>0;if(visible&&getCSS(parent,"overflow")!="visible"){outerRect=parent.getBoundingClientRect();visible=eLright>outerRect.left&&eLleft<outerRect.right&&eLbottom>outerRect.top-1&&eLtop<outerRect.bottom+1}}return visible};var checkElements=function(){var eLlen,i,rect,autoLoadElem,loadedSomething,elemExpand,elemNegativeExpand,elemExpandVal,beforeExpandVal,defaultExpand,preloadExpand,hFac;var lazyloadElems=lazysizes2.elements;if((loadMode=lazySizesCfg.loadMode)&&isLoading<8&&(eLlen=lazyloadElems.length)){i=0;lowRuns++;for(;i<eLlen;i++){if(!lazyloadElems[i]||lazyloadElems[i]._lazyRace){continue}if(!supportScroll||lazysizes2.prematureUnveil&&lazysizes2.prematureUnveil(lazyloadElems[i])){unveilElement(lazyloadElems[i]);continue}if(!(elemExpandVal=lazyloadElems[i][_getAttribute]("data-expand"))||!(elemExpand=elemExpandVal*1)){elemExpand=currentExpand}if(!defaultExpand){defaultExpand=!lazySizesCfg.expand||lazySizesCfg.expand<1?docElem.clientHeight>500&&docElem.clientWidth>500?500:370:lazySizesCfg.expand;lazysizes2._defEx=defaultExpand;preloadExpand=defaultExpand*lazySizesCfg.expFactor;hFac=lazySizesCfg.hFac;isBodyHidden=null;if(currentExpand<preloadExpand&&isLoading<1&&lowRuns>2&&loadMode>2&&!document.hidden){currentExpand=preloadExpand;lowRuns=0}else if(loadMode>1&&lowRuns>1&&isLoading<6){currentExpand=defaultExpand}else{currentExpand=shrinkExpand}}if(beforeExpandVal!==elemExpand){eLvW=innerWidth+elemExpand*hFac;elvH=innerHeight+elemExpand;elemNegativeExpand=elemExpand*-1;beforeExpandVal=elemExpand}rect=lazyloadElems[i].getBoundingClientRect();if((eLbottom=rect.bottom)>=elemNegativeExpand&&(eLtop=rect.top)<=elvH&&(eLright=rect.right)>=elemNegativeExpand*hFac&&(eLleft=rect.left)<=eLvW&&(eLbottom||eLright||eLleft||eLtop)&&(lazySizesCfg.loadHidden||isVisible(lazyloadElems[i]))&&(isCompleted&&isLoading<3&&!elemExpandVal&&(loadMode<3||lowRuns<4)||isNestedVisible(lazyloadElems[i],elemExpand))){unveilElement(lazyloadElems[i]);loadedSomething=true;if(isLoading>9){break}}else if(!loadedSomething&&isCompleted&&!autoLoadElem&&isLoading<4&&lowRuns<4&&loadMode>2&&(preloadElems[0]||lazySizesCfg.preloadAfterLoad)&&(preloadElems[0]||!elemExpandVal&&(eLbottom||eLright||eLleft||eLtop||lazyloadElems[i][_getAttribute](lazySizesCfg.sizesAttr)!="auto"))){autoLoadElem=preloadElems[0]||lazyloadElems[i]}}if(autoLoadElem&&!loadedSomething){unveilElement(autoLoadElem)}}};var throttledCheckElements=throttle(checkElements);var switchLoadingClass=function(e){var elem=e.target;if(elem._lazyCache){delete elem._lazyCache;return}resetPreloading(e);addClass(elem,lazySizesCfg.loadedClass);removeClass(elem,lazySizesCfg.loadingClass);addRemoveLoadEvents(elem,rafSwitchLoadingClass);triggerEvent(elem,"lazyloaded")};var rafedSwitchLoadingClass=rAFIt(switchLoadingClass);var rafSwitchLoadingClass=function(e){rafedSwitchLoadingClass({target:e.target})};var changeIframeSrc=function(elem,src){var loadMode2=elem.getAttribute("data-load-mode")||lazySizesCfg.iframeLoadMode;if(loadMode2==0){elem.contentWindow.location.replace(src)}else if(loadMode2==1){elem.src=src}};var handleSources=function(source){var customMedia;var sourceSrcset=source[_getAttribute](lazySizesCfg.srcsetAttr);if(customMedia=lazySizesCfg.customMedia[source[_getAttribute]("data-media")||source[_getAttribute]("media")]){source.setAttribute("media",customMedia)}if(sourceSrcset){source.setAttribute("srcset",sourceSrcset)}};var lazyUnveil=rAFIt((function(elem,detail,isAuto,sizes,isImg){var src,srcset,parent,isPicture,event,firesLoad;if(!(event=triggerEvent(elem,"lazybeforeunveil",detail)).defaultPrevented){if(sizes){if(isAuto){addClass(elem,lazySizesCfg.autosizesClass)}else{elem.setAttribute("sizes",sizes)}}srcset=elem[_getAttribute](lazySizesCfg.srcsetAttr);src=elem[_getAttribute](lazySizesCfg.srcAttr);if(isImg){parent=elem.parentNode;isPicture=parent&&regPicture.test(parent.nodeName||"")}firesLoad=detail.firesLoad||"src"in elem&&(srcset||src||isPicture);event={target:elem};addClass(elem,lazySizesCfg.loadingClass);if(firesLoad){clearTimeout(resetPreloadingTimer);resetPreloadingTimer=setTimeout(resetPreloading,2500);addRemoveLoadEvents(elem,rafSwitchLoadingClass,true)}if(isPicture){forEach.call(parent.getElementsByTagName("source"),handleSources)}if(srcset){elem.setAttribute("srcset",srcset)}else if(src&&!isPicture){if(regIframe.test(elem.nodeName)){changeIframeSrc(elem,src)}else{elem.src=src}}if(isImg&&(srcset||isPicture)){updatePolyfill(elem,{src:src})}}if(elem._lazyRace){delete elem._lazyRace}removeClass(elem,lazySizesCfg.lazyClass);rAF((function(){var isLoaded=elem.complete&&elem.naturalWidth>1;if(!firesLoad||isLoaded){if(isLoaded){addClass(elem,lazySizesCfg.fastLoadedClass)}switchLoadingClass(event);elem._lazyCache=true;setTimeout((function(){if("_lazyCache"in elem){delete elem._lazyCache}}),9)}if(elem.loading=="lazy"){isLoading--}}),true)}));var unveilElement=function(elem){if(elem._lazyRace){return}var detail;var isImg=regImg.test(elem.nodeName);var sizes=isImg&&(elem[_getAttribute](lazySizesCfg.sizesAttr)||elem[_getAttribute]("sizes"));var isAuto=sizes=="auto";if((isAuto||!isCompleted)&&isImg&&(elem[_getAttribute]("src")||elem.srcset)&&!elem.complete&&!hasClass(elem,lazySizesCfg.errorClass)&&hasClass(elem,lazySizesCfg.lazyClass)){return}detail=triggerEvent(elem,"lazyunveilread").detail;if(isAuto){autoSizer.updateElem(elem,true,elem.offsetWidth)}elem._lazyRace=true;isLoading++;lazyUnveil(elem,detail,isAuto,sizes,isImg)};var afterScroll=debounce((function(){lazySizesCfg.loadMode=3;throttledCheckElements()}));var altLoadmodeScrollListner=function(){if(lazySizesCfg.loadMode==3){lazySizesCfg.loadMode=2}afterScroll()};var onload=function(){if(isCompleted){return}if(Date2.now()-started<999){setTimeout(onload,999);return}isCompleted=true;lazySizesCfg.loadMode=3;throttledCheckElements();addEventListener("scroll",altLoadmodeScrollListner,true)};return{_:function(){started=Date2.now();lazysizes2.elements=document.getElementsByClassName(lazySizesCfg.lazyClass);preloadElems=document.getElementsByClassName(lazySizesCfg.lazyClass+" "+lazySizesCfg.preloadClass);addEventListener("scroll",throttledCheckElements,true);addEventListener("resize",throttledCheckElements,true);addEventListener("pageshow",(function(e){if(e.persisted){var loadingElements=document.querySelectorAll("."+lazySizesCfg.loadingClass);if(loadingElements.length&&loadingElements.forEach){requestAnimationFrame((function(){loadingElements.forEach((function(img){if(img.complete){unveilElement(img)}}))}))}}}));if(window2.MutationObserver){new MutationObserver(throttledCheckElements).observe(docElem,{childList:true,subtree:true,attributes:true})}else{docElem[_addEventListener]("DOMNodeInserted",throttledCheckElements,true);docElem[_addEventListener]("DOMAttrModified",throttledCheckElements,true);setInterval(throttledCheckElements,999)}addEventListener("hashchange",throttledCheckElements,true);["focus","mouseover","click","load","transitionend","animationend"].forEach((function(name){document[_addEventListener](name,throttledCheckElements,true)}));if(/d$|^c/.test(document.readyState)){onload()}else{addEventListener("load",onload);document[_addEventListener]("DOMContentLoaded",throttledCheckElements);setTimeout(onload,2e4)}if(lazysizes2.elements.length){checkElements();rAF._lsFlush()}else{throttledCheckElements()}},checkElems:throttledCheckElements,unveil:unveilElement,_aLSL:altLoadmodeScrollListner}}();var autoSizer=function(){var autosizesElems;var sizeElement=rAFIt((function(elem,parent,event,width){var sources,i,len;elem._lazysizesWidth=width;width+="px";elem.setAttribute("sizes",width);if(regPicture.test(parent.nodeName||"")){sources=parent.getElementsByTagName("source");for(i=0,len=sources.length;i<len;i++){sources[i].setAttribute("sizes",width)}}if(!event.detail.dataAttr){updatePolyfill(elem,event.detail)}}));var getSizeElement=function(elem,dataAttr,width){var event;var parent=elem.parentNode;if(parent){width=getWidth(elem,parent,width);event=triggerEvent(elem,"lazybeforesizes",{width:width,dataAttr:!!dataAttr});if(!event.defaultPrevented){width=event.detail.width;if(width&&width!==elem._lazysizesWidth){sizeElement(elem,parent,event,width)}}}};var updateElementsSizes=function(){var i;var len=autosizesElems.length;if(len){i=0;for(;i<len;i++){getSizeElement(autosizesElems[i])}}};var debouncedUpdateElementsSizes=debounce(updateElementsSizes);return{_:function(){autosizesElems=document.getElementsByClassName(lazySizesCfg.autosizesClass);addEventListener("resize",debouncedUpdateElementsSizes)},checkElems:debouncedUpdateElementsSizes,updateElem:getSizeElement}}();var init=function(){if(!init.i&&document.getElementsByClassName){init.i=true;autoSizer._();loader._()}};setTimeout((function(){if(lazySizesCfg.init){init()}}));lazysizes2={cfg:lazySizesCfg,autoSizer:autoSizer,loader:loader,init:init,uP:updatePolyfill,aC:addClass,rC:removeClass,hC:hasClass,fire:triggerEvent,gW:getWidth,rAF:rAF};return lazysizes2}))})(lazysizes);var lazysizesExports=lazysizes.exports;export{lazysizesExports as l};
@@ -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 p2 in s)if(Object.prototype.hasOwnProperty.call(s,p2))t[p2]=s[p2]}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 self2={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;self2.monthsContainer=fp._createElement("div","flatpickr-monthSelect-months");self2.monthsContainer.tabIndex=-1;buildMonths();fp.rContainer.appendChild(self2.monthsContainer);fp.calendarContainer.classList.add("flatpickr-monthSelect-theme-"+config.theme)}function buildMonths(){if(!self2.monthsContainer)return;clearNode2(self2.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)}self2.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(self2.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||!self2.monthsContainer)return;var currentlySelected=fp.rContainer.querySelector(".flatpickr-monthSelect-month.selected");var index=Array.prototype.indexOf.call(self2.monthsContainer.children,document.activeElement);if(index===-1){var target=currentlySelected||self2.monthsContainer.firstElementChild;target.focus();index=target.$i}if(shouldMove){self2.monthsContainer.children[(12+index+shifts[e.keyCode])%12].focus()}else if(e.keyCode===13&&self2.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(self2.monthsContainer!==null){var months2=self2.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);var monthSelectExports=monthSelect.exports;const monthSelectPlugin=getDefaultExportFromCjs(monthSelectExports);var weekSelect$1={exports:{}};(function(module,exports){(function(global2,factory){module.exports=factory()})(commonjsGlobal,(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$1);var weekSelectExports=weekSelect$1.exports;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 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 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")}}}};flatpickr(`#${pickerId}`,{allowInput:allowInput,closeOnSelect:closeOnSelect,disableMobile:true,dateFormat:getDateFormat(),defaultDate:defaultDateGetter(),disable:disabledParser(),enableTime:enableTime,locale:{rangeSeparator:" to "},maxDate:maxDate,minDate:minDate,mode:mode,nextArrow:'<i class="far fa-angle-right"></i>',onOpen:[()=>{calendarResizer();window.addEventListener("resize",calendarResizer);if(!staticPosition&&scrollContainer)attachToScroll(scrollContainer)}],onClose:[(selectedDates,dateStr)=>{window.removeEventListener("resize",calendarResizer);if(!staticPosition&&scrollContainer)detachFromScroll(scrollContainer);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}`;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=yearRange[1];year>=yearRange[0];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 quickpick=(_a=document.querySelector(`#${syncStartWith}`))==null?void 0:_a._flatpickr;quickpick==null?void 0:quickpick.clear()}}))}if(syncEndWith){picker.config.onClose.push((selectedDates=>{var _a;if(selectedDates==null?void 0:selectedDates.length){const quickpick=(_a=document.querySelector(`#${syncEndWith}`))==null?void 0:_a._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:""},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:""},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},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]}},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},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,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 POPOVER_OFFSET_Y=[0,20];class PbPopover extends PbEnhancedElement{static get selector(){return"[data-pb-popover-kit]"}moveTooltip(){let container;if(this.appendTo==="parent"){container=this.element.parentElement}else if(this.appendTo){container=document.querySelector(this.appendTo)}(container||document.body).appendChild(this.tooltip)}connect(){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[id="${colId}"]`);const cells=this.element.querySelectorAll(`td[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[id="${colId}"]`);const cells=this.element.querySelectorAll(`td[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.triggerMethod;const interactionEnabled=this.tooltipInteraction;if(method==="click"){trigger.addEventListener("click",(()=>{this.showTooltip(trigger)}))}else{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()}))}}}))}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.triggerMethod==="click"){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 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 dialogHelper=()=>{const openTrigger=document.querySelectorAll("[data-open-dialog]");const closeTrigger=document.querySelectorAll("[data-close-dialog]");const dialogs=document.querySelectorAll(".pb_dialog_rails");const loadingButton=document.querySelector('[data-disable-with="Loading"]');if(loadingButton){loadingButton.addEventListener("click",(function(){const okayLoadingButton=document.querySelector('[data-disable-with="Loading"]');const cancelButton=document.querySelector('[data-disable-cancel-with="Loading"]');let currentClass=okayLoadingButton.className;let cancelClass=cancelButton?cancelButton.className:"";let newClass=currentClass.replace("_enabled","_disabled_loading");let newCancelClass=cancelClass.replace("_enabled","_disabled");okayLoadingButton.disabled=true;if(cancelButton)cancelButton.disabled=true;okayLoadingButton.className=newClass;if(cancelButton)cancelButton.className=newCancelClass}))}openTrigger.forEach((open=>{open.addEventListener("click",(()=>{var openTriggerData=open.dataset.openDialog;var targetDialog=document.getElementById(openTriggerData);if(targetDialog.open)return;targetDialog.showModal()}))}));closeTrigger.forEach((close=>{close.addEventListener("click",(()=>{var closeTriggerData=close.dataset.closeDialog;document.getElementById(closeTriggerData).close()}))}));dialogs.forEach((dialogElement=>{dialogElement.addEventListener("mousedown",(event=>{const dialogParentDataset=dialogElement.parentElement.dataset;if(dialogParentDataset.overlayClick==="overlay_close")return;const dialogModal=event.target.getBoundingClientRect();const clickedOutsideDialogModal=event.clientX<dialogModal.left||event.clientX>dialogModal.right||event.clientY<dialogModal.top||event.clientY>dialogModal.bottom;if(clickedOutsideDialogModal){dialogElement.close();event.stopPropagation()}}))}))};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("_enabled","_disabled_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}}}))}};export{get as A,offset$1 as B,shift$1 as C,DateTime as D,flip$1 as E,computePosition$1 as F,arrow$1 as G,createCoords$1 as H,round$1 as I,max$1 as J,min$1 as K,rectToClientRect as L,highchartsTheme as M,merge as N,highchartsDarkTheme as O,PbEnhancedElement as P,getAugmentedNamespace as Q,ReactDOMServer as R,typography as S,cloneDeep as T,isString as U,circleChartTheme as V,gaugeTheme as W,lineGraphTheme as X,mapTheme as Y,datePickerHelper as a,dialogHelper as b,PbPopover as c,debounce$2 as d,PbTooltip as e,formHelper as f,PbTypeahead as g,PbTable as h,PbTextarea as i,getAllIcons as j,usePBCopy as k,useDropdown as l,isEmpty as m,map as n,omitBy as o,partial as p,find as q,noop as r,colors as s,getDefaultExportFromCjs as t,useCollapsible as u,commonjsGlobal as v,filter as w,omit as x,createPopper as y,uniqueId 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 p2 in s)if(Object.prototype.hasOwnProperty.call(s,p2))t[p2]=s[p2]}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 self2={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;self2.monthsContainer=fp._createElement("div","flatpickr-monthSelect-months");self2.monthsContainer.tabIndex=-1;buildMonths();fp.rContainer.appendChild(self2.monthsContainer);fp.calendarContainer.classList.add("flatpickr-monthSelect-theme-"+config.theme)}function buildMonths(){if(!self2.monthsContainer)return;clearNode2(self2.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)}self2.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(self2.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||!self2.monthsContainer)return;var currentlySelected=fp.rContainer.querySelector(".flatpickr-monthSelect-month.selected");var index=Array.prototype.indexOf.call(self2.monthsContainer.children,document.activeElement);if(index===-1){var target=currentlySelected||self2.monthsContainer.firstElementChild;target.focus();index=target.$i}if(shouldMove){self2.monthsContainer.children[(12+index+shifts[e.keyCode])%12].focus()}else if(e.keyCode===13&&self2.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(self2.monthsContainer!==null){var months2=self2.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);var monthSelectExports=monthSelect.exports;const monthSelectPlugin=getDefaultExportFromCjs(monthSelectExports);var weekSelect$1={exports:{}};(function(module,exports){(function(global2,factory){module.exports=factory()})(commonjsGlobal,(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$1);var weekSelectExports=weekSelect$1.exports;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 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 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")}}}};flatpickr(`#${pickerId}`,{allowInput:allowInput,closeOnSelect:closeOnSelect,disableMobile:true,dateFormat:getDateFormat(),defaultDate:defaultDateGetter(),disable:disabledParser(),enableTime:enableTime,locale:{rangeSeparator:" to "},maxDate:maxDate,minDate:minDate,mode:mode,nextArrow:'<i class="far fa-angle-right"></i>',onOpen:[()=>{calendarResizer();window.addEventListener("resize",calendarResizer);if(!staticPosition&&scrollContainer)attachToScroll(scrollContainer)}],onClose:[(selectedDates,dateStr)=>{window.removeEventListener("resize",calendarResizer);if(!staticPosition&&scrollContainer)detachFromScroll(scrollContainer);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}`;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=yearRange[1];year>=yearRange[0];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 quickpick=(_a=document.querySelector(`#${syncStartWith}`))==null?void 0:_a._flatpickr;quickpick==null?void 0:quickpick.clear()}}))}if(syncEndWith){picker.config.onClose.push((selectedDates=>{var _a;if(selectedDates==null?void 0:selectedDates.length){const quickpick=(_a=document.querySelector(`#${syncEndWith}`))==null?void 0:_a._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:""},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:""},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},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]}},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},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,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 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[id="${colId}"]`);const cells=this.element.querySelectorAll(`td[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[id="${colId}"]`);const cells=this.element.querySelectorAll(`td[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.triggerMethod;const interactionEnabled=this.tooltipInteraction;if(method==="click"){trigger.addEventListener("click",(()=>{this.showTooltip(trigger)}))}else{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()}))}}}))}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.triggerMethod==="click"){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 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 dialogHelper=()=>{const openTrigger=document.querySelectorAll("[data-open-dialog]");const closeTrigger=document.querySelectorAll("[data-close-dialog]");const dialogs=document.querySelectorAll(".pb_dialog_rails");const loadingButton=document.querySelector('[data-disable-with="Loading"]');if(loadingButton){loadingButton.addEventListener("click",(function(){const okayLoadingButton=document.querySelector('[data-disable-with="Loading"]');const cancelButton=document.querySelector('[data-disable-cancel-with="Loading"]');let currentClass=okayLoadingButton.className;let cancelClass=cancelButton?cancelButton.className:"";let newClass=currentClass.replace("_enabled","_disabled_loading");let newCancelClass=cancelClass.replace("_enabled","_disabled");okayLoadingButton.disabled=true;if(cancelButton)cancelButton.disabled=true;okayLoadingButton.className=newClass;if(cancelButton)cancelButton.className=newCancelClass}))}openTrigger.forEach((open=>{open.addEventListener("click",(()=>{var openTriggerData=open.dataset.openDialog;var targetDialog=document.getElementById(openTriggerData);if(targetDialog.open)return;targetDialog.showModal()}))}));closeTrigger.forEach((close=>{close.addEventListener("click",(()=>{var closeTriggerData=close.dataset.closeDialog;document.getElementById(closeTriggerData).close()}))}));dialogs.forEach((dialogElement=>{dialogElement.addEventListener("mousedown",(event=>{const dialogParentDataset=dialogElement.parentElement.dataset;if(dialogParentDataset.overlayClick==="overlay_close")return;const dialogModal=event.target.getBoundingClientRect();const clickedOutsideDialogModal=event.clientX<dialogModal.left||event.clientX>dialogModal.right||event.clientY<dialogModal.top||event.clientY>dialogModal.bottom;if(clickedOutsideDialogModal){dialogElement.close();event.stopPropagation()}}))}))};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("_enabled","_disabled_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}}}))}};export{get as A,offset$1 as B,shift$1 as C,DateTime as D,flip$1 as E,computePosition$1 as F,arrow$1 as G,createCoords$1 as H,round$1 as I,max$1 as J,min$1 as K,rectToClientRect as L,highchartsTheme as M,merge as N,highchartsDarkTheme as O,PbEnhancedElement as P,getAugmentedNamespace as Q,ReactDOMServer as R,typography as S,cloneDeep as T,isString as U,circleChartTheme as V,gaugeTheme as W,lineGraphTheme as X,mapTheme as Y,datePickerHelper as a,dialogHelper as b,PbPopover as c,debounce$2 as d,PbTooltip as e,formHelper as f,PbTypeahead as g,PbTable as h,PbTextarea as i,getAllIcons as j,usePBCopy as k,useDropdown as l,isEmpty as m,map as n,omitBy as o,partial as p,find as q,noop as r,colors as s,getDefaultExportFromCjs as t,useCollapsible as u,commonjsGlobal as v,filter as w,omit as x,createPopper as y,uniqueId as z};
@@ -1 +1 @@
1
- import{P as PbEnhancedElement,d as debounce}from"./lib-D5R1BjUn.js";const KIT_SELECTOR='[class^="pb_"][class*="_kit"]';const ERROR_MESSAGE_SELECTOR=".pb_body_kit_negative";const FORM_SELECTOR='form[data-pb-form-validation="true"]';const REQUIRED_FIELDS_SELECTOR="input[required],textarea[required],select[required]";const FIELD_EVENTS=["change","valid","invalid"];class PbFormValidation extends PbEnhancedElement{static get selector(){return FORM_SELECTOR}connect(){this.formValidationFields.forEach((field=>{FIELD_EVENTS.forEach((e=>{field.addEventListener(e,debounce((event=>{this.validateFormField(event)}),250),false)}))}))}validateFormField(event){event.preventDefault();const{target:target}=event;target.setCustomValidity("");const isValid=event.target.validity.valid;if(isValid){this.clearError(target)}else{this.showValidationMessage(target)}}showValidationMessage(target){const{parentElement:parentElement}=target;this.clearError(target);parentElement.closest(KIT_SELECTOR).classList.add("error");const errorMessageContainer=this.errorMessageContainer;if(target.dataset.message)target.setCustomValidity(target.dataset.message);errorMessageContainer.innerHTML=target.validationMessage;parentElement.appendChild(errorMessageContainer)}clearError(target){const{parentElement:parentElement}=target;parentElement.closest(KIT_SELECTOR).classList.remove("error");const errorMessageContainer=parentElement.querySelector(ERROR_MESSAGE_SELECTOR);if(errorMessageContainer)errorMessageContainer.remove()}get errorMessageContainer(){const errorContainer=document.createElement("div");const kitClassName=ERROR_MESSAGE_SELECTOR.replace(/\./,"");errorContainer.classList.add(kitClassName);return errorContainer}get formValidationFields(){return this._formValidationFields=this._formValidationFields||this.element.querySelectorAll(REQUIRED_FIELDS_SELECTOR)}}window.PbFormValidation=PbFormValidation;
1
+ import{P as PbEnhancedElement,d as debounce}from"./lib-D7Va7yqa.js";const KIT_SELECTOR='[class^="pb_"][class*="_kit"]';const ERROR_MESSAGE_SELECTOR=".pb_body_kit_negative";const FORM_SELECTOR='form[data-pb-form-validation="true"]';const REQUIRED_FIELDS_SELECTOR="input[required],textarea[required],select[required]";const FIELD_EVENTS=["change","valid","invalid"];class PbFormValidation extends PbEnhancedElement{static get selector(){return FORM_SELECTOR}connect(){this.formValidationFields.forEach((field=>{FIELD_EVENTS.forEach((e=>{field.addEventListener(e,debounce((event=>{this.validateFormField(event)}),250),false)}))}))}validateFormField(event){event.preventDefault();const{target:target}=event;target.setCustomValidity("");const isValid=event.target.validity.valid;if(isValid){this.clearError(target)}else{this.showValidationMessage(target)}}showValidationMessage(target){const{parentElement:parentElement}=target;this.clearError(target);parentElement.closest(KIT_SELECTOR).classList.add("error");const errorMessageContainer=this.errorMessageContainer;if(target.dataset.message)target.setCustomValidity(target.dataset.message);errorMessageContainer.innerHTML=target.validationMessage;parentElement.appendChild(errorMessageContainer)}clearError(target){const{parentElement:parentElement}=target;parentElement.closest(KIT_SELECTOR).classList.remove("error");const errorMessageContainer=parentElement.querySelector(ERROR_MESSAGE_SELECTOR);if(errorMessageContainer)errorMessageContainer.remove()}get errorMessageContainer(){const errorContainer=document.createElement("div");const kitClassName=ERROR_MESSAGE_SELECTOR.replace(/\./,"");errorContainer.classList.add(kitClassName);return errorContainer}get formValidationFields(){return this._formValidationFields=this._formValidationFields||this.element.querySelectorAll(REQUIRED_FIELDS_SELECTOR)}}window.PbFormValidation=PbFormValidation;
@@ -1 +1 @@
1
- import"./_weekday_stacked-C4d17aYW.js";import"./lazysizes-B7xYodB-.js";import"./_typeahead-CRW6dJbW.js";import"./lib-D5R1BjUn.js";import"react/jsx-runtime";import"react";import"react-dom";import"react-trix";import"trix";import"react-is";
1
+ import"./_weekday_stacked-BFXALU-0.js";import"./lazysizes-DHz07jlL.js";import"./_typeahead-CoOpeYom.js";import"./lib-D7Va7yqa.js";import"react/jsx-runtime";import"react";import"react-dom";import"react-trix";import"trix";import"react-is";