@xplortech/apollo-core 2.4.2 → 2.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{p as e,b as t}from"./p-DhZas3eX.js";export{s as setNonce}from"./p-DhZas3eX.js";import{g as a}from"./p-DQuL1Twl.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((async e=>(await a(),t([["p-812bb0e4",[[0,"xpl-list",{items:[16]}]]],["p-4fab8172",[[0,"xpl-table-header-cell",{icon:[1],sortable:[4],label:[1],type:[1],width:[2],sortDirection:[32]}]]],["p-7b7db57a",[[260,"xpl-accordion",{contentId:[1,"content-id"],header:[1],description:[1],initialExpanded:[4,"initial-expanded"],size:[1],borderType:[1,"border-type"],expanded:[32],parentCheckboxChange:[64]},[[0,"checkboxChange","listenToChangeEvent"]],{initialExpanded:[{watchInitialExpanded:0}]}]]],["p-3b5f8989",[[260,"xpl-application-shell",{withSubnav:[4,"with-subnav"],withUtility:[4,"with-utility"],navWidth:[1,"nav-width"],isNavOpenAtStartup:[4,"is-nav-open-at-startup"],navOpen:[32]},[[0,"navOpen","navToggleHandler"],[0,"navWidth","navWithHandler"],[9,"resize","onWindowResize"]]]]],["p-576ce90f",[[0,"xpl-button-row",{primary:[1],secondary:[1],tertiary:[1]}]]],["p-9853028c",[[260,"xpl-large-card",{link:[4],name:[1],description:[1]}]]],["p-0ac33b3a",[[0,"xpl-calendar",{inputId:[1,"input-id"],dateFormat:[1,"date-format"],max:[8],min:[8],mode:[1],defaultDate:[1,"default-date"],setDate:[64]}]]],["p-b1f4604d",[[260,"xpl-dynamic-table",{selectedItemCount:[32],colCount:[32]},[[8,"deselectAll","listenToDeselectEvent"],[8,"checkboxChange","listenToChangeEvent"]]]]],["p-8c1f73ea",[[260,"xpl-dynamic-table-cell",{disabled:[4]}]]],["p-31461db7",[[260,"xpl-dynamic-table-row",{disabled:[4],selected:[4],isDisabled:[32]}]]],["p-7f8e5cd0",[[0,"xpl-grid"]]],["p-94209785",[[260,"xpl-grid-item",{xs:[2],sm:[2],md:[2],lg:[2]}]]],["p-845eef0d",[[260,"xpl-main-nav",{width:[1]}]]],["p-5ec45742",[[260,"xpl-table-header"]]],["p-be292555",[[0,"xpl-toggle",{checked:[4],description:[1],disabled:[4],heading:[1],label:[1],name:[1],variant:[1],id:[32]}]]],["p-9d65ece7",[[260,"xpl-toolbar",{selectedItemCount:[2,"selected-item-count"]},[[8,"selectedItemCountChange","listenToSelectedItemCountChange"]]]]],["p-23ef2717",[[0,"xpl-pagination",{totalPages:[2,"total-pages"],withPageControl:[4,"with-page-control"],currentPage:[1026,"current-page"],rowsPerPageOptions:[1,"rows-per-page-options"],selectedRowsPerPage:[1026,"selected-rows-per-page"]},null,{currentPage:[{onPageUpdate:0}],selectedRowsPerPage:[{onRowsPerPageUpdate:0}]}],[260,"xpl-tabs",{value:[1],fullWidth:[4,"full-width"],selectedValue:[32],activeBarPosition:[32],isMobileSelectChange:[32]},[[9,"resize","onWindowResize"]],{value:[{updateTabsSelectedState:0}]}],[260,"xpl-slideout",{isOpen:[1540,"is-open"],backdrop:[4],variant:[1],showFooter:[4,"show-footer"]},[[9,"scroll","handleScroll"]],{isOpen:[{watchPropHandler:0}]}],[260,"xpl-modal",{isOpen:[1540,"is-open"],size:[1],variant:[1]},null,{isOpen:[{updateModalState:0}]}],[0,"xpl-choicelist",{choices:[16],description:[1],heading:[1],multi:[4],name:[1],styled:[4],selected:[32]},null,{choices:[{onChoicesPropChange:0}],selected:[{onSelectedChange:0}]}],[260,"xpl-data-card",{link:[4],name:[1],stat:[1],shortStat:[1,"short-stat"],variant:[1],leadingIcon:[4,"leading-icon"],icon:[1],smallStat:[1,"small-stat"],smallStatIcon:[1,"small-stat-icon"],detail:[1],smallStatVariant:[1,"small-stat-variant"],tooltipTextSmallStat:[1,"tooltip-text-small-stat"],tooltipTextStat:[1,"tooltip-text-stat"]},null,{stat:[{watchStat:0}],shortStat:[{watchShortStat:0}]}],[260,"xpl-header-accordion",{contentId:[1,"content-id"],initialExpanded:[4,"initial-expanded"],disabled:[4],selectedCount:[2,"selected-count"],hasCheckbox:[4,"has-checkbox"],expanded:[32],parentChecked:[32],parentIndeterminate:[32]},[[0,"checkboxChange","handleChildCheckboxChange"]],{selectedCount:[{watchSelectedCount:0}]}],[0,"xpl-table",{columns:[16],data:[16],footer:[16],freeze:[4],multiselect:[4],striped:[4],selectedValues:[16],isSortable:[4,"is-sortable"],sortableColumns:[16],areAllSelected:[32],rowData:[32],rowFooterData:[32],hasScrolled:[32],selected:[32],sortTypeArray:[32]},null,{data:[{watchData:0}],footer:[{watchFooterData:0}],columns:[{watchColumns:0}]}],[260,"xpl-toast",{variant:[1],showIcon:[4,"show-icon"],caption:[1],dismissable:[4],timeout:[2]}],[260,"xpl-utility-bar",{navControl:[4,"nav-control"],isNavOpenAtStartup:[4,"is-nav-open-at-startup"],open:[32]}],[260,"xpl-breadcrumb-item"],[260,"xpl-breadcrumbs"],[260,"xpl-content-area",{size:[1]}],[260,"xpl-dashboard"],[260,"xpl-nav-item",{navControl:[4,"nav-control"]}],[0,"xpl-progress",{steps:[1040],currentStep:[1026,"current-step"]}],[260,"xpl-secondary-nav"],[0,"xpl-skeleton",{classNames:[1,"class-names"],fullWidth:[4,"full-width"],height:[1],width:[1],margin:[1],shape:[1],size:[1]}],[260,"xpl-tab",{target:[1],selected:[4]}],[260,"xpl-tab-panel",{target:[1],selected:[4]}],[260,"xpl-avatar",{color:[1],disabled:[4],href:[1],name:[1],size:[1],src:[1],status:[1],target:[1]}],[260,"xpl-badge",{dot:[4],variant:[1]}],[260,"xpl-divider",{tier:[2]}],[260,"xpl-radio",{checked:[4],description:[1],disabled:[4],name:[1],value:[1],required:[4],styled:[4],id:[32]}],[260,"xpl-tooltip",{text:[1],position:[1],hideArrow:[4,"hide-arrow"]}],[260,"xpl-select",{choices:[16],selectIcon:[1,"select-icon"],description:[1],disabled:[4],error:[1],label:[1],mode:[1],name:[1],placeholder:[1],truncate:[4],customDisplayValue:[4,"custom-display-value"],selectedValues:[1,"selected-values"],classNames:[1,"class-names"],active:[32],id:[32],keepFocus:[32],visibleChoices:[32],choicesState:[32],value:[32],dropdownOpenState:[32],reset:[64]},[[8,"click","handleClickEvent"],[8,"keydown","handleKeyDown"],[9,"resize","handleResize"]],{choices:[{onChoicesPropChanged:0}],selectedValues:[{onSelectedValuesPropChanged:0}],choicesState:[{onChoicesStateChanged:0}],value:[{handleValueStateChange:0}],dropdownOpenState:[{onDropdownOpenStateChanged:0}]}],[260,"xpl-input",{_id:[1],description:[1],disabled:[4],error:[1],label:[1],name:[1],required:[4],readonly:[4],value:[1],autocomplete:[1],placeholder:[1],post:[1],pre:[1],max:[8],min:[8],step:[2],multiline:[4],maxCharacterCount:[2,"max-character-count"],dateFormat:[1,"date-format"],timeFormat:[1,"time-format"],allowCustomOption:[4,"allow-custom-option"],mode:[1],accept:[1],multiple:[4],hideTriggerOnSelect:[4,"hide-trigger-on-select"],hideFileNames:[4,"hide-file-names"],hideAcceptText:[4,"hide-accept-text"],hideEyeDropper:[4,"hide-eye-dropper"],type:[1],characterCount:[32],passwordVisible:[32]}],[0,"xpl-input-color",{value:[1],placeholder:[1],disabled:[4],required:[4],hideEyeDropper:[4,"hide-eye-dropper"],hasErrorState:[32],colorValues:[32],eyeDropperSupported:[32],hue:[32]},null,{colorValues:[{valueChanged:0}],hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValuePropChange:0}]}],[260,"xpl-popover",{isOpen:[4,"is-open"],disabled:[4],position:[1],display:[1],isOpenState:[32],actualPosition:[32],updateListener:[32]},null,{isOpen:[{onIsOpenPropChange:0}],isOpenState:[{onIsOpenStateChange:0}]}],[0,"xpl-input-time",{inputId:[1,"input-id"],disabled:[4],name:[1],required:[4],readonly:[4],value:[1537],placeholder:[1],max:[8],min:[8],step:[2],mode:[1],timeFormat:[1,"time-format"],allowCustomOption:[4,"allow-custom-option"],formattedValue:[32],hasErrorState:[32],showOptions:[32],options:[32],amPm:[32]},null,{value:[{onValueChange:0}],hasErrorState:[{onHasErrorStateChanged:0}]}],[0,"xpl-input-date",{inputId:[1,"input-id"],disabled:[4],name:[1],required:[4],readonly:[4],value:[1],placeholder:[1],post:[1],pre:[1],max:[8],min:[8],dateFormat:[1,"date-format"],mode:[1],hasErrorState:[32]},null,{hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValueChanged:0}]}],[260,"xpl-input-file",{disabled:[4],name:[1],_id:[1],accept:[1],multiple:[4],hideTriggerOnSelect:[4,"hide-trigger-on-select"],hideFileNames:[4,"hide-file-names"],hideAcceptText:[4,"hide-accept-text"],files:[32],removeFileByIndex:[64]},null,{files:[{onFilesChange:0}]}],[0,"xpl-backdrop",{relative:[4]}],[260,"xpl-button",{disabled:[4],link:[4],iconOnly:[4,"icon-only"],fullWidth:[4,"full-width"],name:[1],size:[1],type:[1],value:[1],variant:[1],state:[1],form:[1]}],[260,"xpl-checkbox",{checked:[4],description:[1],disabled:[4],indeterminate:[4],name:[1],value:[1],required:[4],styled:[4],dataId:[1,"data-id"],id:[32]}],[260,"xpl-tag"],[260,"xpl-dropdown",{isOpen:[1540,"open"],closeOnSelect:[4,"close-on-select"],mode:[1],options:[1040],anchorToTrigger:[4,"anchor-to-trigger"],selectedValues:[1,"selected-values"],selectOnFocus:[4,"select-on-focus"],triggerId:[1,"trigger-id"],update:[16],handleSelect:[64]},[[11,"scroll","onWindowScroll"],[7,"scroll","onWindowScroll"],[9,"resize","onWindowScroll"]],{selectedValues:[{onSelectedValuesChanged:0}],isOpen:[{onIsOpenStateChange:0}]}],[260,"xpl-dropdown-group",{groupName:[1,"label"],options:[16]}],[260,"xpl-dropdown-heading",{label:[1]}],[260,"xpl-dropdown-option",{isDisabled:[516,"disabled"],label:[1],value:[1],subtitle:[1],isSelected:[4,"selected"]}],[0,"xpl-icon",{icon:[1],size:[2],backgroundColor:[1,"background-color"]}]]]],e))));
1
+ import{p as e,b as t}from"./p-DhZas3eX.js";export{s as setNonce}from"./p-DhZas3eX.js";import{g as a}from"./p-DQuL1Twl.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((async e=>(await a(),t([["p-812bb0e4",[[0,"xpl-list",{items:[16]}]]],["p-4fab8172",[[0,"xpl-table-header-cell",{icon:[1],sortable:[4],label:[1],type:[1],width:[2],sortDirection:[32]}]]],["p-7b7db57a",[[260,"xpl-accordion",{contentId:[1,"content-id"],header:[1],description:[1],initialExpanded:[4,"initial-expanded"],size:[1],borderType:[1,"border-type"],expanded:[32],parentCheckboxChange:[64]},[[0,"checkboxChange","listenToChangeEvent"]],{initialExpanded:[{watchInitialExpanded:0}]}]]],["p-3b5f8989",[[260,"xpl-application-shell",{withSubnav:[4,"with-subnav"],withUtility:[4,"with-utility"],navWidth:[1,"nav-width"],isNavOpenAtStartup:[4,"is-nav-open-at-startup"],navOpen:[32]},[[0,"navOpen","navToggleHandler"],[0,"navWidth","navWithHandler"],[9,"resize","onWindowResize"]]]]],["p-576ce90f",[[0,"xpl-button-row",{primary:[1],secondary:[1],tertiary:[1]}]]],["p-9853028c",[[260,"xpl-large-card",{link:[4],name:[1],description:[1]}]]],["p-0ac33b3a",[[0,"xpl-calendar",{inputId:[1,"input-id"],dateFormat:[1,"date-format"],max:[8],min:[8],mode:[1],defaultDate:[1,"default-date"],setDate:[64]}]]],["p-b1f4604d",[[260,"xpl-dynamic-table",{selectedItemCount:[32],colCount:[32]},[[8,"deselectAll","listenToDeselectEvent"],[8,"checkboxChange","listenToChangeEvent"]]]]],["p-8c1f73ea",[[260,"xpl-dynamic-table-cell",{disabled:[4]}]]],["p-31461db7",[[260,"xpl-dynamic-table-row",{disabled:[4],selected:[4],isDisabled:[32]}]]],["p-7f8e5cd0",[[0,"xpl-grid"]]],["p-94209785",[[260,"xpl-grid-item",{xs:[2],sm:[2],md:[2],lg:[2]}]]],["p-845eef0d",[[260,"xpl-main-nav",{width:[1]}]]],["p-5ec45742",[[260,"xpl-table-header"]]],["p-be292555",[[0,"xpl-toggle",{checked:[4],description:[1],disabled:[4],heading:[1],label:[1],name:[1],variant:[1],id:[32]}]]],["p-9d65ece7",[[260,"xpl-toolbar",{selectedItemCount:[2,"selected-item-count"]},[[8,"selectedItemCountChange","listenToSelectedItemCountChange"]]]]],["p-5c0236db",[[0,"xpl-pagination",{totalPages:[2,"total-pages"],withPageControl:[4,"with-page-control"],currentPage:[1026,"current-page"],rowsPerPageOptions:[1,"rows-per-page-options"],selectedRowsPerPage:[1026,"selected-rows-per-page"]},null,{currentPage:[{onPageUpdate:0}],selectedRowsPerPage:[{onRowsPerPageUpdate:0}]}],[260,"xpl-tabs",{value:[1],fullWidth:[4,"full-width"],selectedValue:[32],activeBarPosition:[32],isMobileSelectChange:[32]},[[9,"resize","onWindowResize"]],{value:[{updateTabsSelectedState:0}]}],[260,"xpl-slideout",{isOpen:[1540,"is-open"],backdrop:[4],variant:[1],showFooter:[4,"show-footer"]},[[9,"scroll","handleScroll"]],{isOpen:[{watchPropHandler:0}]}],[260,"xpl-modal",{isOpen:[1540,"is-open"],size:[1],variant:[1]},null,{isOpen:[{updateModalState:0}]}],[0,"xpl-choicelist",{choices:[16],description:[1],heading:[1],multi:[4],name:[1],styled:[4],selected:[32]},null,{choices:[{onChoicesPropChange:0}],selected:[{onSelectedChange:0}]}],[260,"xpl-data-card",{link:[4],name:[1],stat:[1],shortStat:[1,"short-stat"],variant:[1],leadingIcon:[4,"leading-icon"],icon:[1],smallStat:[1,"small-stat"],smallStatIcon:[1,"small-stat-icon"],detail:[1],smallStatVariant:[1,"small-stat-variant"],tooltipTextSmallStat:[1,"tooltip-text-small-stat"],tooltipTextStat:[1,"tooltip-text-stat"]},null,{stat:[{watchStat:0}],shortStat:[{watchShortStat:0}]}],[260,"xpl-header-accordion",{contentId:[1,"content-id"],initialExpanded:[4,"initial-expanded"],disabled:[4],selectedCount:[2,"selected-count"],hasCheckbox:[4,"has-checkbox"],expanded:[32],parentChecked:[32],parentIndeterminate:[32]},[[0,"checkboxChange","handleChildCheckboxChange"]],{selectedCount:[{watchSelectedCount:0}]}],[0,"xpl-table",{columns:[16],data:[16],footer:[16],freeze:[4],multiselect:[4],striped:[4],selectedValues:[16],isSortable:[4,"is-sortable"],sortableColumns:[16],areAllSelected:[32],rowData:[32],rowFooterData:[32],hasScrolled:[32],selected:[32],sortTypeArray:[32]},null,{data:[{watchData:0}],footer:[{watchFooterData:0}],columns:[{watchColumns:0}]}],[260,"xpl-toast",{variant:[1],showIcon:[4,"show-icon"],caption:[1],dismissable:[4],timeout:[2]}],[260,"xpl-utility-bar",{navControl:[4,"nav-control"],isNavOpenAtStartup:[4,"is-nav-open-at-startup"],open:[32]}],[260,"xpl-breadcrumb-item"],[260,"xpl-breadcrumbs"],[260,"xpl-content-area",{size:[1]}],[260,"xpl-dashboard"],[260,"xpl-nav-item",{navControl:[4,"nav-control"]}],[0,"xpl-progress",{steps:[1040],currentStep:[1026,"current-step"]}],[260,"xpl-secondary-nav"],[0,"xpl-skeleton",{classNames:[1,"class-names"],fullWidth:[4,"full-width"],height:[1],width:[1],margin:[1],shape:[1],size:[1]}],[260,"xpl-tab",{target:[1],selected:[4]}],[260,"xpl-tab-panel",{target:[1],selected:[4]}],[260,"xpl-avatar",{color:[1],disabled:[4],href:[1],name:[1],size:[1],src:[1],status:[1],target:[1]}],[260,"xpl-badge",{dot:[4],variant:[1]}],[260,"xpl-divider",{tier:[2]}],[260,"xpl-radio",{checked:[4],description:[1],disabled:[4],name:[1],value:[1],required:[4],styled:[4],id:[32]}],[260,"xpl-tooltip",{text:[1],position:[1],hideArrow:[4,"hide-arrow"]}],[260,"xpl-select",{choices:[16],selectIcon:[1,"select-icon"],description:[1],disabled:[4],error:[1],label:[1],mode:[1],name:[1],placeholder:[1],truncate:[4],customDisplayValue:[4,"custom-display-value"],selectedValues:[1,"selected-values"],classNames:[1,"class-names"],active:[32],id:[32],keepFocus:[32],visibleChoices:[32],choicesState:[32],value:[32],dropdownOpenState:[32],reset:[64]},[[8,"click","handleClickEvent"],[8,"keydown","handleKeyDown"],[9,"resize","handleResize"]],{choices:[{onChoicesPropChanged:0}],selectedValues:[{onSelectedValuesPropChanged:0}],choicesState:[{onChoicesStateChanged:0}],value:[{handleValueStateChange:0}],dropdownOpenState:[{onDropdownOpenStateChanged:0}]}],[260,"xpl-input",{_id:[1],description:[1],disabled:[4],error:[1],label:[1],name:[1],required:[4],readonly:[4],value:[1],autocomplete:[1],placeholder:[1],post:[1],pre:[1],max:[8],min:[8],step:[2],multiline:[4],maxCharacterCount:[2,"max-character-count"],dateFormat:[1,"date-format"],timeFormat:[1,"time-format"],allowCustomOption:[4,"allow-custom-option"],mode:[1],accept:[1],multiple:[4],hideTriggerOnSelect:[4,"hide-trigger-on-select"],hideFileNames:[4,"hide-file-names"],hideAcceptText:[4,"hide-accept-text"],hideEyeDropper:[4,"hide-eye-dropper"],type:[1],characterCount:[32],passwordVisible:[32]}],[0,"xpl-input-color",{value:[1],placeholder:[1],disabled:[4],required:[4],hideEyeDropper:[4,"hide-eye-dropper"],hasErrorState:[32],colorValues:[32],eyeDropperSupported:[32],hue:[32]},null,{colorValues:[{valueChanged:0}],hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValuePropChange:0}]}],[260,"xpl-popover",{isOpen:[4,"is-open"],disabled:[4],position:[1],display:[1],isOpenState:[32],actualPosition:[32],updateListener:[32]},null,{isOpen:[{onIsOpenPropChange:0}],isOpenState:[{onIsOpenStateChange:0}]}],[0,"xpl-input-time",{inputId:[1,"input-id"],disabled:[4],name:[1],required:[4],readonly:[4],value:[1537],placeholder:[1],max:[8],min:[8],step:[2],mode:[1],timeFormat:[1,"time-format"],allowCustomOption:[4,"allow-custom-option"],formattedValue:[32],hasErrorState:[32],showOptions:[32],options:[32],amPm:[32]},null,{value:[{onValueChange:0}],hasErrorState:[{onHasErrorStateChanged:0}]}],[0,"xpl-input-date",{inputId:[1,"input-id"],disabled:[4],name:[1],required:[4],readonly:[4],value:[1],placeholder:[1],post:[1],pre:[1],max:[8],min:[8],dateFormat:[1,"date-format"],mode:[1],hasErrorState:[32]},null,{hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValueChanged:0}]}],[260,"xpl-input-file",{disabled:[4],name:[1],_id:[1],accept:[1],multiple:[4],hideTriggerOnSelect:[4,"hide-trigger-on-select"],hideFileNames:[4,"hide-file-names"],hideAcceptText:[4,"hide-accept-text"],files:[32],removeFileByIndex:[64]},null,{files:[{onFilesChange:0}]}],[0,"xpl-backdrop",{relative:[4]}],[260,"xpl-button",{disabled:[4],link:[4],iconOnly:[4,"icon-only"],fullWidth:[4,"full-width"],name:[1],size:[1],type:[1],value:[1],variant:[1],state:[1],form:[1]}],[260,"xpl-checkbox",{checked:[4],description:[1],disabled:[4],indeterminate:[4],name:[1],value:[1],required:[4],styled:[4],dataId:[1,"data-id"],id:[32]}],[260,"xpl-tag"],[260,"xpl-dropdown",{isOpen:[1540,"open"],closeOnSelect:[4,"close-on-select"],mode:[1],options:[1040],anchorToTrigger:[4,"anchor-to-trigger"],selectedValues:[1,"selected-values"],selectOnFocus:[4,"select-on-focus"],triggerId:[1,"trigger-id"],update:[16],handleSelect:[64]},[[11,"scroll","onWindowScroll"],[7,"scroll","onWindowScroll"],[9,"resize","onWindowScroll"]],{selectedValues:[{onSelectedValuesChanged:0}],isOpen:[{onIsOpenStateChange:0}]}],[260,"xpl-dropdown-group",{groupName:[1,"label"],options:[16]}],[260,"xpl-dropdown-heading",{label:[1]}],[260,"xpl-dropdown-option",{isDisabled:[516,"disabled"],label:[1],value:[1],subtitle:[1],isSelected:[4,"selected"]}],[0,"xpl-icon",{icon:[1],size:[2],backgroundColor:[1,"background-color"]}]]]],e))));
@@ -3,4 +3,4 @@ import{r as t,h as e,H as a,g as i,c as l,F as h}from"./p-DhZas3eX.js";import{v
3
3
  object-assign
4
4
  (c) Sindre Sorhus
5
5
  @license MIT
6
- */function A(){if(V)return H;V=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;return H=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},a=0;a<10;a++)e["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach((function(t){i[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(t){return!1}}()?Object.assign:function(i,l){for(var h,s,r=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(i),o=1;o<arguments.length;o++){for(var d in h=Object(arguments[o]))e.call(h,d)&&(r[d]=h[d]);if(t){s=t(h);for(var c=0;c<s.length;c++)a.call(h,s[c])&&(r[s[c]]=h[s[c]])}}return r},H}var O=function(){if(Z)return _;Z=1;const t=$,e=A();for(const i of Object.keys(t)){const l=(t,a,l)=>{const h=[],s=e({},a,l);l&&((l.width||l.height)&&(s.width=l.width?l.width:parseInt(l.height)*a.width/a.height,s.height=l.height?l.height:parseInt(l.width)*a.height/a.width),l.class&&(s.class=`octicon octicon-${i} ${l.class}`,s.class.trim()),l["aria-label"]&&(s["aria-label"]=l["aria-label"],s.role="img",delete s["aria-hidden"]));for(const t of Object.keys(s))h.push(`${t}="${s[t]}"`);return h.join(" ").trim()};t[i].symbol=i;for(const e of Object.keys(t[i].heights))t[i].heights[e].options={version:"1.1",width:t[i].heights[e].width,height:parseInt(e),viewBox:`0 0 ${t[i].heights[e].width} ${e}`,class:`octicon octicon-${i}`,"aria-hidden":"true"};t[i].toSVG=function(e={}){const{height:h,width:s}=e,r=a(Object.keys(t[i].heights),h||s||16);return`<svg ${l(t[i],t[i].heights[r].options,e)}>${t[i].heights[r].path}</svg>`}}function a(t,e){return t.map((t=>parseInt(t,10))).reduce(((t,a)=>a<=e?a:t),t[0])}return _=t}(),S=M(O);const j=class{constructor(e){t(this,e)}render(){let t={};if(void 0!==this.size)if("number"==typeof this.size){const e=this.size<=32?this.size:32;t={width:e,height:e}}else console.warn("[Apollo] xpl-icon: size is not a number, the value passed was ignored. Please change value to a number.");let i="xpl-icon__wrapper ";return this.backgroundColor&&(i+=`xpl-icon__wrapper--with-background xpl-icon__wrapper--with-background--${this.backgroundColor}`),e(a,{key:"24576487ab74d82288bd43262d3021f19d12489d"},e("figure",{key:"1b90df03ca412fd56fd868f934a24712d3a19079",class:i},e("span",{key:"e0ebd1ccfb6796190240841035a0a2db8c1bb3f1","aria-label":this.icon,role:"img",class:"xpl-icon",style:{width:`${t.width}px`,height:`${t.height}px`},innerHTML:S[this.icon].toSVG(t)}),e("figcaption",{key:"d3976b8859355ef990e9bffa210b5c005505c308"},this.icon," icon")))}};j.style=".xpl-icon{align-items:center;display:grid;justify-content:center}";const E=class{constructor(e){t(this,e),this.focusEvent=l(this,"focusEvent",7),this.blurEvent=l(this,"blurEvent",7),this.valueChange=l(this,"valueChange",7),this.inputEvent=l(this,"inputEvent",7),this.multiline=!1,this.dateFormat="Y-m-d",this.timeFormat="24h",this.allowCustomOption=!1,this.mode="single",this.accept="",this.multiple=!1,this.hideTriggerOnSelect=!1,this.hideFileNames=!1,this.hideAcceptText=!1,this.type="text",this.valueChanged=t=>{this.valueChange.emit(t.target.value)},this.characterCount=0,this.passwordVisible=!1,this.handleFocus=t=>{this.focusEvent.emit(t)},this.handleBlur=t=>{this.blurEvent.emit(t)},this.handleInput=t=>{this.multiline&&this.updateCharacterCount();const{value:e}=t.target;this.inputEvent.emit(e)}}updateCharacterCount(){this.characterCount=this.input.value.length}componentWillLoad(){null!=this._id&&""!==this._id||(this._id=s()),this.multiline&&void 0!==this.maxCharacterCount&&(this.characterCount=void 0!==this.value?this.value.length:0)}renderInput(){switch(this.type){case"file":return e("xpl-input-file",{accept:this.accept,disabled:this.disabled,hideAcceptText:this.hideAcceptText,hideFileNames:this.hideFileNames,hideTriggerOnSelect:this.hideTriggerOnSelect,multiple:this.multiple,name:this.name,_id:this._id},e("slot",{name:"trigger"}));case"color":return e("xpl-input-color",{disabled:this.disabled,value:this.value,placeholder:this.placeholder,required:this.required,hideEyeDropper:this.hideEyeDropper});case"date":return e("xpl-input-date",{inputId:this._id,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,value:this.value,placeholder:this.placeholder,post:this.post,pre:this.pre,max:this.max,min:this.min,dateFormat:this.dateFormat,mode:this.mode});case"time":return e("xpl-input-time",{inputId:this._id,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,value:this.value,placeholder:this.placeholder,max:this.max,min:this.min,step:this.step,mode:this.mode,timeFormat:this.timeFormat,allowCustomOption:this.allowCustomOption});default:return e("div",{class:"xpl-input-wrapper"},this.pre&&!this.multiline&&e("label",{class:"xpl-input-pre",htmlFor:this._id},this.pre),this.multiline?e("textarea",{disabled:this.disabled,id:this._id,name:this.name,placeholder:this.placeholder,readonly:this.readonly,ref:t=>{this.input=t},required:this.required,onChange:this.valueChanged,onFocus:this.handleFocus,onBlur:this.handleBlur,onInput:this.handleInput},this.value):e("input",{autocomplete:this.autocomplete,disabled:this.disabled,id:this._id,max:this.max,min:this.min,name:this.name,placeholder:this.placeholder,readonly:this.readonly,ref:t=>{this.input=t},required:this.required,step:this.step,type:this.type,value:this.value,onChange:this.valueChanged,onFocus:this.handleFocus,onBlur:this.handleBlur,onInput:this.handleInput}),"password"===this.type&&e("button",{"aria-label":"Toggle password visibility",class:"xpl-input-password",onClick:()=>{this.passwordVisible=!this.passwordVisible},role:"presentation"},e("xpl-icon",{icon:this.passwordVisible?"eye-closed":"eye",size:24})),this.post&&!this.multiline&&e("label",{class:"xpl-input-post",htmlFor:this._id},this.post),this.multiline&&void 0!==this.maxCharacterCount&&e("span",{class:"xpl-input-characters"},this.characterCount,"/",this.maxCharacterCount))}}render(){var t;let i=!1;return void 0!==this.error&&(i=!0),this.multiline&&void 0!==this.maxCharacterCount&&this.characterCount>this.maxCharacterCount&&(i=!0),e(a,{key:"4dca16ca0939ae6365edc9201e00ec6cf76aadfc",class:{"xpl-input":!0,"xpl-input--disabled":this.disabled,"xpl-input--error":i,"xpl-input--readonly":this.readonly,[`xpl-input--${this.type}`]:!0}},this.label&&e("label",{key:"2abed2c330a6cb7fbad8274299a7012b09c22b03",class:"xpl-input-label",htmlFor:this._id},this.label,this.description&&e("small",{key:"4f310894b28354d9540aa73b4e87872632eb9c83"},this.description)),this.renderInput(),(null===(t=this.error)||void 0===t?void 0:t.length)>0&&e("label",{key:"ed5cd40feaa1d9d76d6b569c9b9c51da178d162d",class:"xpl-input-error",htmlFor:this._id},e("xpl-icon",{key:"2e5374ee3a0c5b18d3891a647b52853b0daa7b9c",icon:"alert-circle",size:16}),e("span",{key:"1a9aa0733831e709aa5923c9486049697e7ab20b"},this.error)))}},I=(t,e,a)=>{const i=(a/=100)*(e/=100),l=i*(1-Math.abs(t/60%2-1)),h=a-i;let s=0,r=0,o=0;return t<60?(s=i,r=l,o=0):t<120?(s=l,r=i,o=0):t<180?(s=0,r=i,o=l):t<240?(s=0,r=l,o=i):t<300?(s=l,r=0,o=i):(s=i,r=0,o=l),{r:Math.round(255*(s+h)),g:Math.round(255*(r+h)),b:Math.round(255*(o+h))}},T=(t,e,a)=>[t,e,a].map((t=>t.toString(16).padStart(2,"0"))).join(""),D=t=>{var e,a;if(t.startsWith("#")){if(!/^#([a-fA-F\d]{6})$/.test(t))throw new Error("Only 6-digit hex format supported (e.g. #aabbcc)");const e=t.toLowerCase().slice(1),a=parseInt(e.slice(0,2),16),i=parseInt(e.slice(2,4),16),l=parseInt(e.slice(4,6),16);return{hex:e,r:a,g:i,b:l,a:1}}if(t.startsWith("rgba")||t.startsWith("rgb")){const a=null===(e=t.match(/[\d.]+/g))||void 0===e?void 0:e.map(Number);if(!a||a.length<3)throw new Error("Invalid rgba/rgb format");const[i,l,h,s=1]=a,r=t=>t.toString(16).padStart(2,"0");return{hex:`${r(i)}${r(l)}${r(h)}`.toLowerCase(),r:i,g:l,b:h,a:s}}if(t.startsWith("hsla")||t.startsWith("hsl")){const e=null===(a=t.match(/[\d.]+/g))||void 0===a?void 0:a.map(Number);if(!e||e.length<3)throw new Error("Invalid hsla/hsl format");const[i,l,h,s=1]=e,r=((t,e,a,i)=>{a/=100;const l=e=>(e+t/30)%12,h=(e/=100)*Math.min(a,1-a),s=t=>a-h*Math.max(-1,Math.min(l(t)-3,Math.min(9-l(t),1)));return`rgba(${Math.round(255*s(0))}, ${Math.round(255*s(8))}, ${Math.round(255*s(4))}, ${i})`})(i,l,h,s),[o,d,c]=r.match(/[\d.]+/g).map(Number);return{hex:T(o,d,c).toLowerCase(),r:o,g:d,b:c,a:s}}throw new Error("Unsupported color format")},F=t=>t.a&&1!==t.a?`rgba(${t.r}, ${t.g}, ${t.b}, ${t.a})`:`#${t.hex}`,P={hex:"",r:0,g:0,b:0,a:1},N=class{constructor(e){t(this,e),this.inputChange=l(this,"inputChange",7),this.hasErrorStateChanged=l(this,"hasErrorStateChanged",7),this.placeholder="Select color",this.eyeDropperSupported="EyeDropper"in window,this.colorInputElements={hex:null,r:null,g:null,b:null,a:null,hue:null,slGrid:null,alpha:null},this.handleMove=t=>{const e=this.colorInputElements.slGrid.getBoundingClientRect(),a="touches"in t?t.touches[0].clientY:t.clientY,i=Math.max(0,Math.min(("touches"in t?t.touches[0].clientX:t.clientX)-e.left,e.width)),l=Math.max(0,Math.min(a-e.top,e.height)),h=i/e.width,s=l/e.height,r=I(this.hue,100,100),o=(255*(1-h)+h*r.r)*(1-s),d=(255*(1-h)+h*r.g)*(1-s),c=(255*(1-h)+h*r.b)*(1-s),n={r:Math.round(o),g:Math.round(d),b:Math.round(c),hex:T(Math.round(o),Math.round(d),Math.round(c)),a:this.colorValues.a};this.colorValues=n},this.startDrag=t=>{t.preventDefault(),this.handleMove(t),window.addEventListener("mousemove",this.handleMove),window.addEventListener("mouseup",this.stopDrag),window.addEventListener("touchmove",this.handleMove),window.addEventListener("touchend",this.stopDrag)},this.stopDrag=()=>{window.removeEventListener("mousemove",this.handleMove),window.removeEventListener("mouseup",this.stopDrag),window.removeEventListener("touchmove",this.handleMove),window.removeEventListener("touchend",this.stopDrag)},this.onHexInputChange=t=>{var e;const a=t.detail;if(a){const[t,i,l]=(t=>t?t.match(/\w\w/g).map((t=>parseInt(t,16))):[0,0,0])(a);this.colorValues={hex:a,r:t,g:i,b:l,a:null!==(e=this.colorValues.a)&&void 0!==e?e:1}}else this.colorValues=Object.assign({},P)},this.onRgbaInputChange=(t,e)=>{const a=parseFloat(e.detail);if(Number.isNaN(a))return void(this.hasErrorState=`invalid value from ${t.name}: ${a}`);const i=Object.assign({},this.colorValues);switch(t.name){case"color-r-input":i.r=a;break;case"color-g-input":i.g=a;break;case"color-b-input":i.b=a;break;case"color-a-input":i.a=a;break;default:this.hasErrorState=`unhandled input: ${t.name}`}i.hex=T(i.r,i.g,i.b),this.colorValues=i},this.onSliderInputChange=t=>{const e=parseFloat(t.value);if(Number.isNaN(e))this.hasErrorState=`invalid value from ${t.name}: ${e}`;else switch(t.name){case"color-hue-slider":this.colorValues=D(`hsla(${e}, 100%, 50%, 1)`),this.hue=e;break;case"color-alpha-slider":this.colorValues=Object.assign(Object.assign({},this.colorValues),{a:e});break;default:this.hasErrorState=`unhandled input: ${t.name}`}}}valueChanged(t){this.hasErrorState=this.required&&!t.hex?"required":null,this.inputChange.emit(t.hex?F(t):"")}onHasErrorStateChanged(t){this.hasErrorStateChanged.emit(t)}onValuePropChange(t){this.syncColorFromValue(t)}syncColorFromValue(t){if(t)try{this.colorValues=D(t),this.hue=(()=>{const t=this.colorValues.r/255,e=this.colorValues.g/255,a=this.colorValues.b/255,i=Math.max(t,e,a),l=Math.min(t,e,a),h=i-l;let s=0,r=0;const o=(i+l)/2;if(0!==h){switch(r=h/(1-Math.abs(2*o-1)),i){case t:s=(e-a)/h%6;break;case e:s=(a-t)/h+2;break;case a:s=(t-e)/h+4}s*=60,s<0&&(s+=360)}return{hue:Math.round(s),saturation:Math.round(100*r),lightness:Math.round(100*o)}})().hue}catch(t){this.hasErrorState="invalid color format",this.hue=0}else this.colorValues=Object.assign({},P),this.hasErrorState=null,this.hue=0}componentWillLoad(){this.syncColorFromValue(this.value)}componentDidLoad(){const{r:t,g:e,b:a,a:i,hue:l,alpha:h,hex:s}=this.colorInputElements;s.addEventListener("valueChange",(t=>{this.onHexInputChange(t)})),[t,e,a,i].forEach((t=>{t.addEventListener("valueChange",(e=>{this.onRgbaInputChange(t,e)}))})),[l,h].forEach((t=>{t.addEventListener("input",(()=>{this.onSliderInputChange(t)}))}))}async openEyeDropper(){try{const t=new window.EyeDropper,e=await t.open();this.colorValues=D(e.sRGBHex)}catch(t){this.hasErrorState=`eyedropper cancelled or failed: ${t}`}}render(){const{r:t,g:i,b:l,a:h}=this.colorValues,s=I(this.hue,100,100),{x:r,y:o}=((t,e,a,i)=>{const{s:l,v:h}=((t,e,a,i)=>{t/=255,e/=255,a/=255;const l=Math.max(t,e,a),h=l-Math.min(t,e,a);let s=0;return s=0===h?0:l===t?(e-a)/h%6:l===e?(a-t)/h+2:(t-e)/h+4,s=Math.round(60*s),s<0&&(s+=360),{h:null!=i?i:s,s:0===l?0:h/l,v:l}})(e.r,e.g,e.b,t);return{x:Math.round(l*a),y:Math.round((1-h)*i)}})(this.hue,{r:t,g:i,b:l},288,160),d={left:`${r}px`,top:`${o}px`,background:`rgb(${t}, ${i}, ${l})`};return e(a,{key:"639f311d46bbb46e327ae6b05fe24b47795adbf3",class:"xpl-input-color"},e("xpl-popover",{key:"ad9d6145e4e5ac581c6d22f726050767ff82d861",disabled:this.disabled,display:"menu"},e("div",{key:"219e1754388cfc2ecff25b42b67322e780a1e7d6",slot:"trigger"},e("div",{key:"7beafe5304521d496bf7d7f8f82de01c9b7de00d",class:{"xpl-input-color__display":!0,"xpl-input-color__display--disabled":this.disabled,"xpl-input-color__display--error":!!this.hasErrorState}},e("span",{key:"2caae6b87902c50eb754e93ce939797d619da723",class:"xpl-input-color__color",style:{background:F(this.colorValues)}}),this.colorValues.hex?e("span",{class:"xpl-input-color__value"},F(this.colorValues)):e("span",{class:"xpl-input-color__placeholder"},this.placeholder),this.eyeDropperSupported&&!this.hideEyeDropper&&e("xpl-icon",{key:"8cd0f1e94bf2eaf31ad82a4c8d307badef8046fc",size:20,icon:"eye-droper",class:"xpl-input-color__icon",onClick:t=>{t.stopPropagation(),this.openEyeDropper()}}))),e("div",{key:"8e6add90e733d299cea94559dcbc29dd4e64d9cd",class:"xpl-input-color__menu"},e("div",{key:"a488c9b7ef3ff0cabbbb4bf5a631f209034a2539",class:"xpl-input-color__sl-grid",ref:t=>{this.colorInputElements.slGrid=t},style:{background:["linear-gradient(to top, #000, #0000)","linear-gradient(to right, #fff, #fff0)",`rgb(${s.r} ${s.g} ${s.b})`].join(", ")},onMouseDown:this.startDrag,onTouchStart:this.startDrag},e("div",{key:"542a5cafd651e6b49f813f6eecb46088b0b6f97c",class:"xpl-input-color__sl-thumb",style:d})),e("div",{key:"fd3268874bb0c0bc22c2d2db15dd50c38d3ae70a",class:"xpl-input-color__grid"},e("input",{key:"08ea52b5c2bbc2800b2ad5cca6981813e4578ce5",type:"range",min:"0",max:"360",value:this.hue,class:"xpl-input-color__slider xpl-input-color__hue",name:"color-hue-slider",ref:t=>{this.colorInputElements.hue=t}}),e("input",{key:"1692e362cb1e48446f33e2f82c5988546ad6a6f0",type:"range",min:"0",max:"1",step:"0.01",value:h,class:"xpl-input-color__slider xpl-input-color__alpha",name:"color-alpha-slider",ref:t=>{this.colorInputElements.alpha=t},style:{backgroundImage:[`linear-gradient(to right, rgb(${t} ${i} ${l} / 0) 0%, rgb(${t} ${i} ${l} / 1) 100%)`,"linear-gradient(45deg, #ccc 25%, transparent 25%)","linear-gradient(-45deg, #ccc 25%, transparent 25%)","linear-gradient(45deg, transparent 75%, #ccc 75%)","linear-gradient(-45deg, transparent 75%, #ccc 75%)"].join(", ")}}),e("div",{key:"5de3d1979fbb4c4a2892961fcbd7e6fc2d2723b4",class:"xpl-input-color__preview",style:{background:`rgba(${t}, ${i}, ${l}, ${h})`}})),e("div",{key:"3a660bdbb902bc8bfddb8c423f2462404b0221b8",class:"xpl-input-color__inputs"},Object.entries(this.colorInputElements).filter((([t])=>["hex","r","g","b","a"].includes(t))).map((([t])=>e("xpl-input",{key:t,label:t.toLocaleUpperCase(),name:`color-${t}-input`,placeholder:"hex"===t?"793EF7":"0",value:this.colorValues[t],ref:e=>{this.colorInputElements[t]=e}})))))))}static get watchers(){return{colorValues:[{valueChanged:0}],hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValuePropChange:0}]}}},q=(t=!1)=>`<svg width="8" height="12" viewBox="0 0 8 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="${t?"M0.557948 5.6813L6.06209 0.132167C6.23831 -0.0440556 6.52327 -0.0440556 6.69949 0.132167L7.44187 0.874551C7.61809 1.05077 7.61809 1.33573 7.44187 1.51195L2.99882 6L7.44187 10.488C7.61809 10.6643 7.61809 10.9492 7.44187 11.1254L6.69949 11.8678C6.52327 12.0441 6.23831 12.0441 6.06209 11.8678L0.557948 6.3187C0.381726 6.14248 0.381726 5.85752 0.557948 5.6813Z":"M7.44187 6.3187L1.93773 11.8678C1.76151 12.0441 1.47655 12.0441 1.30033 11.8678L0.557948 11.1254C0.381726 10.9492 0.381726 10.6643 0.557948 10.488L5.001 6L0.557948 1.51195C0.381726 1.33573 0.381726 1.05077 0.557948 0.874551L1.30033 0.132167C1.47655 -0.0440556 1.76151 -0.0440556 1.93773 0.132167L7.44187 5.6813C7.6181 5.85752 7.6181 6.14248 7.44187 6.3187Z"}" /></svg>`,W=class{constructor(e){t(this,e),this.valueChange=l(this,"valueChange",7),this.hasErrorStateChanged=l(this,"hasErrorStateChanged",7),this.rangeSelected=l(this,"rangeSelected",7),this.dateFormat="Y-m-d",this.mode="single",this.valueChanged=t=>{this.valueChange.emit(t.target.value)}}onHasErrorStateChanged(t){this.hasErrorStateChanged.emit(t)}onValueChanged(t){var e;null===(e=this.flatpickrInstance)||void 0===e||e.setDate(t)}componentDidLoad(){this.flatpickrInstance=r(this.input,{allowInput:!0,dateFormat:this.dateFormat,defaultDate:this.value,maxDate:this.max,minDate:this.min,mode:this.mode,nextArrow:q(),prevArrow:q(!0),onClose:t=>{if(this.hasErrorState=t.length<(this.required?"single"===this.mode?1:2:0)?"required":null,2===t.length){const[e,a]=t;this.rangeSelected.emit({start:e,end:a})}}})}render(){return e(a,{key:"6024246dd7a92cc6396c634e8e87d614b1d860e3",class:{"xpl-input-date":!0,[`xpl-input-date--mode-${this.mode}`]:!0,"xpl-input-date--error":!!this.hasErrorState}},e("div",{key:"0c8fe7b8057715618ae040b64ee2ae6506051200",class:"xpl-input-wrapper"},this.pre&&e("label",{key:"d0d1048313962c7381b9fc4e2d07b107d42f86d1",class:"xpl-input-pre",htmlFor:this.inputId},this.pre),e("input",{key:"3daca1a28baf14701e4b7a9761d2ff91be8dcd96",type:"date",id:this.inputId,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,placeholder:this.placeholder,max:this.max,min:this.min,ref:t=>{this.input=t},onChange:t=>{this.valueChanged(t)}}),e("xpl-icon",{key:"82c57c4694c088debfb710e37bd90b5132fa3339",class:"xpl-input-calendar",icon:"calendar-month",size:24}),this.post&&e("label",{key:"553fa633312ed0adf1fd38352f40142e2b48eeaa",class:"xpl-input-post",htmlFor:this.inputId},this.post)))}static get watchers(){return{hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValueChanged:0}]}}},B=class{constructor(e){t(this,e),this.inputChange=l(this,"inputChange",7),this.accept="",this.multiple=!1,this.hideTriggerOnSelect=!1,this.hideFileNames=!1,this.hideAcceptText=!1,this.files=null,this.openFileDialog=()=>{var t;this.disabled||null===(t=this.fileInput)||void 0===t||t.click()},this.handleFileChange=t=>{this.files=Array.from(t.target.files)},this.onRemoveFileByIndex=t=>{this.files=this.files.filter(((e,a)=>a!==t))}}onFilesChange(t){this.inputChange.emit({type:"file",value:t})}async removeFileByIndex(t){this.onRemoveFileByIndex(t)}render(){var t,i;return e(a,{key:"984964735a57f0c1ae83b7a6e9ad548b8b732694",class:{"xpl-input-file":!0,"xpl-input-file--hide-trigger-on-select":this.hideTriggerOnSelect,"xpl-input-file--disabled":this.disabled}},e("span",{key:"20da96646dda47226058869a6a3c188aa602ae7b",class:{"xpl-input-file__trigger-wrapper":!0,"xpl-input-file__trigger-wrapper--hidden":this.hideTriggerOnSelect&&(null===(t=this.files)||void 0===t?void 0:t.length)>0},role:"button",tabIndex:0,onClick:this.openFileDialog},e("slot",{key:"d6355378f46c6a6edd193839e3ff24bd241db9b6",name:"trigger"})),(null===(i=this.files)||void 0===i?void 0:i.length)>0&&!this.hideFileNames&&e("ul",{key:"48a7c3ff9668c7a7ad3e1f719c05f0439db0eb98",class:"xpl-input-file__file-list"},this.files.map(((t,a)=>e("li",{class:"xpl-input-file__file-item"},e("span",{class:"xpl-text-callout"},t.name),e("xpl-icon",{icon:"x-circle",size:24,onClick:t=>{t.preventDefault(),t.stopPropagation(),this.onRemoveFileByIndex(a)},class:"xpl-input-file__remove-icon"}))))),this.accept&&!this.hideAcceptText&&e("span",{key:"81a892b3c7cac161c4fe893b9e627055d43a13c8",class:"xpl-input-file__accept xpl-text-caption"},"Accepted file types: ",this.accept),e("input",{key:"bb3e89c64ae62748b3e4afd5f80fcede37ae7b3a",onChange:this.handleFileChange,type:"file",ref:t=>{this.fileInput=t},hidden:!0,accept:this.accept,multiple:this.multiple,name:this.name}))}get el(){return i(this)}static get watchers(){return{files:[{onFilesChange:0}]}}};function R(t){const[e,a]=t.split(":"),i=Number(e)>=12?"PM":"AM";return[(Number(e)%12||12).toString(),a,i]}const U=class{constructor(e){t(this,e),this.valueChange=l(this,"valueChange",7),this.hasErrorStateChanged=l(this,"hasErrorStateChanged",7),this.max="23:59",this.min="00:00",this.step=30,this.mode="single",this.timeFormat="24h",this.allowCustomOption=!1,this.showOptions=!1,this.options=[],this.handleInput=t=>{var e;const a=null===(e=t.target.value)||void 0===e?void 0:e.replace(/[^0-9:apmAPM]/g,"");this.value=a},this.handleFocus=()=>{this.showOptions=!0},this.handleBlur=()=>{this.value=function(t){if(!t||""===t.trim()||0===t.replace(/[^0-9]/g,"").length)return null;let e=t.trim().toLowerCase();e=e.replace(/(\d)\s+(am|pm)/g,"$1$2"),/^\d{1,2}(am|pm)?$/.test(e)&&(e=e.replace(/(am|pm)?$/,":00$1")),/^\d{1,2}$/.test(e)&&(e=`${e}:00`),/^\d{1,2}:\d{1}$/.test(e)&&(e=`${e}0`);const[a,i]=e.split(":"),l=i.replace(/[^0-9]/g,""),h=e.includes("am");return e.includes("pm")||h?h?`${(Number(a)%12).toString().padStart(2,"0")}:${l}`:`${Number(a)%12+12}:${l}`:`${a.padStart(2,"0")}:${l}`}(this.value)},this.handleClick=()=>{this.showOptions=!0}}onValueChange(t){this.valueChange.emit(t),this.updateState(t)}updateState(t){this.formattedValue=this.formatDisplayedTime(t),this.amPm=this.formatDisplayedAmPm(t),this.validateValue()}formatDisplayedTime(t){if(!t)return"";if("12h"===this.timeFormat&&t.includes(":")){const[e,a]=R(t);return`${e}:${a}`}return t}formatDisplayedAmPm(t){if(!t||"12h"!==this.timeFormat)return"";const[,,e]=R(t);return e}validateValue(){this.hasErrorState=this.value?!this.value.includes(":")||this.value.trim().length<4||this.value.trim().length>5?"Invalid time format, must be HH:MM":this.value<this.min||this.value>this.max?"Out of range":this.allowCustomOption||this.options.some((t=>t.value===this.value))?null:"Invalid option":this.required?"required":null}onHasErrorStateChanged(t){this.hasErrorStateChanged.emit(t)}componentDidLoad(){var t;"range"===this.mode&&console.warn("Range mode is not supported for time inputs at this time."),null===(t=this.dropdown)||void 0===t||t.addEventListener("isOpenChange",(t=>{this.showOptions=t.detail}))}componentWillLoad(){this.options=this.getOptions(),this.value&&this.updateState(this.value)}getOptions(){return function(t,e,a,i){const l=t=>{const[e,a]=t.split(":").map(Number);return 60*e+a},h=l(e.toString()),s=l(a.toString()),r=[];for(let e=h;e<=s;e+=t)r.push((o=e,`${Math.floor(o/60).toString().padStart(2,"0")}:${(o%60).toString().padStart(2,"0")}`));var o;return r.map((t=>({label:"12h"===i?function(t){const[e,a,i]=R(t);return`${e}:${a} ${i}`}(t):t,value:t})))}(this.step,this.min.toString(),this.max.toString(),this.timeFormat).map((({label:t,value:e})=>({label:t,value:e,onClick:()=>{this.value=e,this.showOptions=!1}})))}render(){return e(a,{key:"99b06c895d608dec6226f79f21ceda92225428b7",class:{"xpl-input-time":!0,[`xpl-input-time--mode-${this.mode}`]:!0,"xpl-input-time--error":!!this.hasErrorState}},e("xpl-input",{key:"8cdf996f46d969c243d246fdfe888c22c9c4999b",pre:e("xpl-icon",{class:"xpl-input-time__clock-icon",icon:"clock",size:24}),post:"12h"===this.timeFormat?this.amPm||"AM":null,type:"text",_id:this.inputId,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,placeholder:this.placeholder,max:this.max,min:this.min,onInput:this.handleInput,value:this.formattedValue,onFocusEvent:this.handleFocus,onBlurEvent:this.handleBlur,onClick:this.handleClick}),!this.readonly&&!this.disabled&&e("xpl-dropdown",{key:"5213fcd68da96d726d8b046277233afd6b5b20e8",options:this.options,isOpen:this.showOptions,ref:t=>{this.dropdown=t},class:"xpl-input-time__dropdown"}))}static get watchers(){return{value:[{onValueChange:0}],hasErrorState:[{onHasErrorStateChanged:0}]}}},K=class{constructor(e){t(this,e),this.modalClosed=l(this,"modalClosed",7),this.isOpen=!1,this.size="medium",this.variant="default",this.handleDialogClose=()=>{this.isOpen=!1,this.modalClosed.emit()},this.handleNativeBackdropClick=t=>{const e=this.dialogElement.getBoundingClientRect();(t.clientX<e.left||t.clientX>e.right||t.clientY<e.top||t.clientY>e.bottom)&&this.handleDialogClose()}}componentDidLoad(){this.dialogElement=this.element.querySelector("dialog"),this.updateModalState(),this.dialogElement.addEventListener("cancel",this.handleDialogClose),this.dialogElement.addEventListener("click",this.handleNativeBackdropClick)}disconnectedCallback(){this.dialogElement&&(this.dialogElement.removeEventListener("cancel",this.handleDialogClose),this.dialogElement.removeEventListener("click",this.handleNativeBackdropClick))}updateModalState(){var t,e;this.isOpen?null===(e=null===(t=this.dialogElement)||void 0===t?void 0:t.showModal)||void 0===e||e.call(t):this.dialogElement&&"function"==typeof this.dialogElement.close&&setTimeout((()=>{var t;null===(t=this.dialogElement)||void 0===t||t.close()}),250)}render(){return e(a,{key:"67a2c3914086a75280693b156c5148a5e86395d2",class:"xpl-modal"},this.isOpen&&e("xpl-backdrop",{key:"e99270d95b4a2267d4fd9c7cbee25672b5f90b7d"}),e("dialog",{key:"3493394ff8f93a8a5fb00903d712dd956b886024",class:`xpl-modal__dialog xpl-modal-size--${this.size} xpl-modal--${this.isOpen?"is-open":"is-closed"}`},e("div",{key:"66731b3fc2b562fd9f013de173dcf808b3f3ff1a",class:"xpl-modal__header"},e("div",{key:"b3a712444c7f3607b5f1bf968f46ac83305f6f1a",class:"xpl-modal__title"},"warning"===this.variant&&e("xpl-icon",{key:"d96d5df9527b0b96fa793025af3dca9956c5a946",size:20,icon:"alert-triangle",class:"xpl-modal__alert-icon"}),e("slot",{key:"3d30207ca82fffa6a7c7d7be42b240dc552ab01d",name:"title"}),e("xpl-button",{key:"34e0247f1f0de686233c95e236457dd170e3b050",type:"button",class:"xpl-modal__close-button",iconOnly:!0,size:"sm",variant:"subtle",onClick:this.handleDialogClose},e("xpl-icon",{key:"d14026b3e17070767fef2d798d5e4406c011dc7d",icon:"x"}))),e("div",{key:"cdacbf1e44ca7c8601ebcbfdce2ac5b6fb7d6489",class:"xpl-modal__subtitle"},e("slot",{key:"2ade6726ee27396a0aa570ef2b0c88be0361eb01",name:"subtitle"}))),e("div",{key:"f016a31264ee6874ddd19e9dcbde3b3f8c76d2ea",class:"xpl-modal__body"},e("slot",{key:"ea6016e3c5733a344f1f427ca07267917f66001e",name:"body"})),e("div",{key:"7e43b4317efd765152cdb3ea804e1fe9b0036bc4",class:"xpl-modal__footer"},e("slot",{key:"410d2ce31eccc7d2bb0c48091b165de2f85f6986",name:"tertiary"}),e("slot",{key:"d2d64c8203c8b942385c26adfe283af76c12afb3",name:"secondary"}),e("slot",{key:"3eb401ad94c36a2aa9f380508c438e5b473020d5",name:"primary"}))))}get element(){return i(this)}static get watchers(){return{isOpen:[{updateModalState:0}]}}},G=class{constructor(e){t(this,e),this.navOpen=l(this,"navOpen",7),this.navControl=!1}onNavToggle(){window.innerWidth<=640&&this.navOpen.emit(!1)}render(){return e(a,{key:"8a047443ba48a7812f3804e5639cdd8408f9a647",class:"xpl-nav-item",role:"listitem",onClick:()=>{this.navControl&&this.onNavToggle()}},e("slot",{key:"41012bd7a72ed7929deddb136ac5f2c6b30a4c1f",name:"link"},e("slot",{key:"ce1bb0b1957b5e614fa1ec65cc8973d42bd1dc32",name:"icon"}),e("slot",{key:"d50d2dd931be394e039f1e07651e05e41231627e"})))}},X=class{constructor(e){t(this,e),this.pageChange=l(this,"pageChange",7),this.rowsPerPageChange=l(this,"rowsPerPageChange",7),this.totalPages=1,this.withPageControl=!1,this.currentPage=1,this.rowsPerPageOptions="10,25,50,100,150",this.selectedRowsPerPage=10,this.rowsPerPageSelectRef=null,this.pageSelectRef=null,this.handleNextPage=()=>{this.currentPage<this.totalPages&&(this.currentPage+=1)},this.handlePrevPage=()=>{this.currentPage>1&&(this.currentPage-=1)},this.handlePageChange=t=>{const e=parseInt(t.detail,10);Number.isNaN(e)||(this.currentPage=e)},this.handleRowsChange=t=>{const e=parseInt(t.detail,10);Number.isNaN(e)||(this.selectedRowsPerPage=e)}}get rowsPerPageOptionsArray(){return this.rowsPerPageOptions.split(",").map(Number)}onPageUpdate(t){t<1?this.currentPage=1:t>this.totalPages&&(this.currentPage=this.totalPages),this.pageChange.emit(this.currentPage)}onRowsPerPageUpdate(t){this.rowsPerPageChange.emit(t)}componentDidLoad(){var t,e;null===(t=this.rowsPerPageSelectRef)||void 0===t||t.addEventListener("changeEvent",this.handleRowsChange),null===(e=this.pageSelectRef)||void 0===e||e.addEventListener("changeEvent",this.handlePageChange)}disconnectedCallback(){var t,e;null===(t=this.rowsPerPageSelectRef)||void 0===t||t.removeEventListener("changeEvent",this.handleRowsChange),null===(e=this.pageSelectRef)||void 0===e||e.removeEventListener("changeEvent",this.handlePageChange)}render(){const t=this.currentPage<=1,i=this.currentPage>=this.totalPages;return e(a,{key:"15d277d40eff79d5fb48867b89370759eb9ca8c7",class:`xpl-pagination xpl-pagination__${this.withPageControl?"with":"no"}-page-control`},this.withPageControl&&e("div",{key:"482bbca4e67c513f715573343f4f2d0f0a7281ee",class:"xpl-pagination__rows-per-page"},e("label",{key:"5a6b3a0f06e6b37b3e6f17021417bac5ce866a69",class:"xpl-pagination__rows-label"},"Rows per page:"),e("xpl-select",{key:"295db6e36fcf861ffd4f25550322552c6641084c",class:"xpl-pagination__rows-per-page-select",choices:this.rowsPerPageOptionsArray.map((t=>({label:t.toString(),value:t.toString(),isSelected:t===this.selectedRowsPerPage}))),ref:t=>{this.rowsPerPageSelectRef=t}})),e("div",{key:"87c7b3e4bf11be1668512f325139899496f2dd7a",class:"xpl-pagination__pager"},e("button",{key:"c020001ed61d227b9febd71bb9e411b3eeead985",class:"xpl-pagination__pager-button xpl-pagination__pager-button-prev",disabled:t,onClick:this.handlePrevPage,"aria-label":"Previous Page",tabindex:"0"},e("xpl-icon",{key:"3484457471eb692e3dc140b47f6d8bfd72899fe3",icon:"arrow-left",size:20})),e("xpl-select",{key:"f0897900308b3015db171f6b60382dd537f9dd71",class:"xpl-pagination__page-select",choices:Array.from({length:this.totalPages},((t,e)=>({label:`Page ${e+1}`,value:(e+1).toString(),isSelected:e+1===this.currentPage}))),"custom-display-value":!0,ref:t=>{this.pageSelectRef=t}},e("div",{key:"4c2184875c70ceac615c6efd05ef32f65d777152",slot:"custom-display-value"},`${this.currentPage} of ${this.totalPages}`)),e("button",{key:"91c856b44bf3b752280b36f69a53d4c2ed97da19",class:"xpl-pagination__pager-button xpl-pagination__pager-button-next",disabled:i,onClick:this.handleNextPage,"aria-label":"Next Page",tabindex:"0"},e("xpl-icon",{key:"538a33cbddd6d4e26b782e0a3178018b61f0dec4",icon:"arrow-right",size:20}))))}static get watchers(){return{currentPage:[{onPageUpdate:0}],selectedRowsPerPage:[{onRowsPerPageUpdate:0}]}}};var Y,J,Q=M(function(){if(J)return Y;J=1;var t="Expected a function",e=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,l=/^0o[0-7]+$/i,h=parseInt,s="object"==typeof self&&self&&self.Object===Object&&self,r="object"==typeof z&&z&&z.Object===Object&&z||s||Function("return this")(),o=Object.prototype.toString,d=Math.max,c=Math.min,n=function(){return r.Date.now()};function p(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function C(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==o.call(t)}(t))return NaN;if(p(t)){var s="function"==typeof t.valueOf?t.valueOf():t;t=p(s)?s+"":s}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(e,"");var r=i.test(t);return r||l.test(t)?h(t.slice(2),r?2:8):a.test(t)?NaN:+t}return Y=function(e,a,i){var l=!0,h=!0;if("function"!=typeof e)throw new TypeError(t);return p(i)&&(l="leading"in i?!!i.leading:l,h="trailing"in i?!!i.trailing:h),function(e,a,i){var l,h,s,r,o,f,u=0,b=!1,m=!1,v=!0;if("function"!=typeof e)throw new TypeError(t);function g(t){var a=l,i=h;return l=h=void 0,u=t,r=e.apply(i,a)}function w(t){var e=t-f;return void 0===f||e>=a||e<0||m&&t-u>=s}function y(){var t=n();if(w(t))return k(t);o=setTimeout(y,function(t){var e=a-(t-f);return m?c(e,s-(t-u)):e}(t))}function k(t){return o=void 0,v&&l?g(t):(l=h=void 0,r)}function x(){var t=n(),e=w(t);if(l=arguments,h=this,f=t,e){if(void 0===o)return function(t){return u=t,o=setTimeout(y,a),b?g(t):r}(f);if(m)return o=setTimeout(y,a),g(f)}return void 0===o&&(o=setTimeout(y,a)),r}return a=C(a)||0,p(i)&&(b=!!i.leading,s=(m="maxWait"in i)?d(C(i.maxWait)||0,a):s,v="trailing"in i?!!i.trailing:v),x.cancel=function(){void 0!==o&&clearTimeout(o),u=0,l=f=h=o=void 0},x.flush=function(){return void 0===o?r:k(n())},x}(e,a,{leading:l,maxWait:a,trailing:h})}}());const tt=class{constructor(e){t(this,e),this.isOpenChange=l(this,"isOpenChange",7),this.isOpen=!1,this.disabled=!1,this.position="bottom-middle",this.display="arrow",this.isOpenState=this.isOpen,this.actualPosition=this.position,this.togglePopover=()=>{this.disabled||(this.isOpenState=!this.isOpenState)},this.handleKeyDown=t=>{"Escape"===t.key&&this.isOpenState&&(this.isOpenState=!1)},this.handleClickOutside=({target:t})=>{!this.el.contains(t)&&this.isOpenState&&(this.isOpenState=!1)}}onIsOpenPropChange(t){this.isOpenState=t}onIsOpenStateChange(t){this.updateActualPosition(t),this.isOpenChange.emit(t)}updateActualPosition(t){if(!this.triggerRef||!this.contentRef||!t)return;const e={"top-left":["top-left","bottom-left","top-right","bottom-right","top-middle","bottom-middle"],"bottom-left":["bottom-left","top-left","bottom-right","top-right","bottom-middle","top-middle"],"top-right":["top-right","bottom-right","top-left","bottom-left","top-middle","bottom-middle"],"bottom-right":["bottom-right","top-right","bottom-left","top-left","bottom-middle","top-middle"],"middle-left":["middle-left","middle-right","bottom-left","top-left","bottom-middle","top-middle"],"middle-right":["middle-right","middle-left","bottom-right","top-right","bottom-middle","top-middle"],"top-middle":["top-middle","top-start","top-end","bottom-middle","top-left","top-right"],"bottom-middle":["bottom-middle","bottom-start","bottom-end","top-middle","bottom-left","bottom-right"],"top-start":["top-start","bottom-start","top-end","bottom-end","top-middle","bottom-middle"],"top-end":["top-end","bottom-end","top-start","bottom-start","top-middle","bottom-middle"],"bottom-start":["bottom-start","top-start","bottom-end","top-end","bottom-middle","top-middle"],"bottom-end":["bottom-end","top-end","bottom-start","top-start","bottom-middle","top-middle"]}[this.position].find((t=>{const{top:e,left:a,bottom:i,right:l}=this.triggerRef.getBoundingClientRect(),{width:h,height:s}=this.contentRef.getBoundingClientRect(),{innerWidth:r,innerHeight:o}=window,d=i+s<o,c=e-s>=0,n=a-h>=0,p=l+h<r,C=(e+i)/2,f=t=>t&&C-s/2>=0&&C+s/2<=o,u=(a+l)/2,b=t=>t&&u-h/2>=0&&u+h/2<=r,m=a+h<r,v=l-h>=0;switch(t){case"top-left":return d&&n;case"middle-left":return f(n);case"bottom-left":return c&&n;case"top-right":return d&&p;case"middle-right":return f(p);case"bottom-right":return c&&p;case"top-middle":return b(c);case"bottom-middle":return b(d);case"top-start":return c&&m;case"top-end":return c&&v;case"bottom-start":return d&&m;case"bottom-end":return d&&v;default:return!1}}))||this.position;this.actualPosition=e}connectedCallback(){document.addEventListener("mousedown",this.handleClickOutside.bind(this)),document.addEventListener("keydown",this.handleKeyDown),this.updateListener=Q((()=>{this.updateActualPosition(this.isOpenState)})),["resize","scroll"].forEach((t=>{window.addEventListener(t,this.updateListener,{passive:!0})}))}disconnectedCallback(){document.removeEventListener("mousedown",this.handleClickOutside),document.removeEventListener("keydown",this.handleKeyDown),["resize","scroll"].forEach((t=>{window.removeEventListener(t,this.updateListener)}))}render(){return e(a,{key:"cf6c4f6b028bfdb9d08f6c8ad2b433c38c1a6f9f"},e("div",{key:"778f9a2f3a5626b19f5446c56d89f9bb6b31ca36",class:{"xpl-popover":!0,[`xpl-popover--${this.actualPosition}`]:!0,"xpl-popover--is-open":this.isOpenState}},e("span",{key:"762401eb1e8d30644dfb55e10f4f5f56abff648f",role:"button",tabindex:"0","aria-haspopup":"dialog","aria-expanded":this.isOpenState?"true":"false",onClick:this.togglePopover,ref:t=>{this.triggerRef=t}},e("slot",{key:"c29166383d024f24d6883ff0d4ea85380f849712",name:"trigger"})),"arrow"===this.display&&e("div",{key:"ef7eb85bc764ab403fc4b069a50606da16e3fcdc",class:"xpl-popover__arrow"},e("svg",{key:"32bc234f1dbc9b07b3b3e2b69e5be222bab02a26",width:"17",height:"14",xmlns:"http://www.w3.org/2000/svg"},e("path",{key:"d34ec2d2b3e67459981f29ce21810f1fb6b7ba45",d:"M0 5h15l-7.5 7.5L0 5Z",fill:"white",stroke:"none",class:"arrow-fill"}),e("path",{key:"f251a3f748c9d4eb5d84d6416dd0121b3365000b",d:"M0 5 L7.5 12.5 L15 5",fill:"none",stroke:"black","stroke-width":"1",class:"arrow-stroke"}))),e("div",{key:"02632fb4c284db5eabce50f4c27079ba37e10204",class:{"xpl-popover__content":!0,[`xpl-popover__content--display-${this.display}`]:!0},ref:t=>this.contentRef=t},e("slot",{key:"770df2750d5d4875d38eb52bb26788095ce7292d"}))))}get el(){return i(this)}static get watchers(){return{isOpen:[{onIsOpenPropChange:0}],isOpenState:[{onIsOpenStateChange:0}]}}},et=class{constructor(e){t(this,e),this.currentStep=0}getCircleClass(t){return this.currentStep<t?"":this.currentStep===t?"xpl-progress-step-active":"xpl-progress-step-finished"}render(){return e(a,{key:"573fca634dcf64084cd74f243a52a978c55478d5",class:"xpl-progress"},e("div",{key:"e0bb02b55c6676bed131397188ffa0074dba71ef",class:"xpl-progress-container"},(this.steps||[]).map(((t,a)=>e("div",{class:`xpl-progress-step ${this.getCircleClass(a)}`},e("div",{class:"xpl-progress-step-content"},e("div",{class:"xpl-progress-step-circle"},a+1),e("div",{class:"xpl-progress-step-text"},t)))))))}},at=class{constructor(e){t(this,e),this.radioChange=l(this,"radioChange",7),this.id=s(),this.onChange=t=>{this.radioChange.emit(this.value?this.value:t.target.checked)}}render(){return e(a,{key:"cc375ac47add5a4fddc8744186d1600431cb998d",class:{"xpl-checkbox-radio-container":!0,styled:this.styled,disabled:this.disabled}},e("input",{key:"ccc9a14ec86cf5d455558298f367dd1eb2835399",class:"xpl-radio",type:"radio",checked:this.checked,disabled:this.disabled,id:this.id,name:this.name,required:this.required,onChange:this.onChange,value:this.value}),e("label",{key:"5c0661fded4424d6b758ef55953cfde8da1f2af5",class:{"xpl-label":!0,"xpl-label--disabled":this.disabled},htmlFor:this.id},e("slot",{key:"9e203d6010f049c74294f543c75b091c129a323d"}),this.description&&e("small",{key:"15447fa65dff82fda1cb7981bbf3160b7f526c53",class:{"xpl-description":!0,"xpl-description--disabled":this.disabled}},this.description)))}},it=class{constructor(e){t(this,e)}render(){return e(a,{key:"86273edf300aa07f9d95d602eba079a3e5585d63",class:"xpl-secondary-nav"},e("nav",{key:"1756c028fe605e00683b6fa07e7235a6e18c1f68","aria-label":"Secondary Nav"},e("slot",{key:"74d5e209c31456877c40267d16d4020faac7ca33"})))}};function lt(t){return t.label||t.value}function ht(t){return t.reduce(((t,e)=>[...t,...e.groupName?e.options:[e]]),[])}const st=class{constructor(e){t(this,e),this.selectChange=l(this,"selectChange",7),this.changeEvent=l(this,"changeEvent",7),this.dropdownStateChange=l(this,"dropdownStateChange",7),this.triggerDropdown=l(this,"triggerDropdown",7),this.choices=[],this.selectIcon="chevron-down",this.mode="single",this.truncate=!0,this.active=!1,this.id=s(),this.keepFocus=!1,this.visibleChoices=1/0,this.choicesState=[],this.value=this.calculateValue(),this.dropdownOpenState=!1,this.container=null,this.dropdown=null,this.handleResizeThrottled=Q((()=>{this.maybeTruncateChoices()}),250),this.handleTabKeyDown=t=>{"Tab"===t.key&&(this.keepFocus=!0)},this.handleTagRemove=t=>{const e=e=>(null==t?void 0:t.value)&&e.value===t.value||(null==t?void 0:t.label)&&e.label===t.label;this.choicesState=this.choicesState.map((t=>{var a;return Object.assign(Object.assign({},t),{isSelected:!e(t)&&t.isSelected,options:null===(a=t.options)||void 0===a?void 0:a.map((t=>Object.assign(Object.assign({},t),{isSelected:!e(t)&&t.isSelected})))})}))},this.handleDropdownScroll=t=>{const{scrollTop:e,scrollHeight:a,clientHeight:i}=this.dropdown.querySelector(".xpl-dropdown-list");(0===e&&t.deltaY<0||e+i>=a&&t.deltaY>0)&&t.preventDefault()}}onChoicesPropChanged(t){this.choicesState=this.initializeChoicesState()}onSelectedValuesPropChanged(){this.choicesState=this.initializeChoicesState()}onChoicesStateChanged(){this.update()}handleValueStateChange(t){this.selectChange.emit(t),this.changeEvent.emit("single"===this.mode?t:(null==t?void 0:t.length)?t.split("|"):[]),this.customDisplayValue&&null!==this.container&&(this.container.querySelectorAll(".custom-display-value").forEach((e=>{e.classList.toggle("display-active",t.length>0),e.classList.toggle("display-inactive",0===t.length)})),this.container.querySelectorAll(".placeholder").forEach((e=>{e.classList.toggle("placeholder-hidden",t.length>0)})))}onDropdownOpenStateChanged(t){this.dropdownStateChange.emit(t)}initializeChoicesState(){return this.choices.map((t=>{var e;const a="string"==typeof this.selectedValues?[this.selectedValues]:this.selectedValues;return Object.assign(Object.assign({},t),{isSelected:t.isSelected||(null==a?void 0:a.includes(t.value||t.label)),options:null===(e=t.options)||void 0===e?void 0:e.map((t=>Object.assign(Object.assign({},t),{isSelected:t.isSelected||(null==a?void 0:a.includes(t.value||t.label))})))})}))}maybeTruncateChoices(){var t,e;if("single"===this.mode||!this.truncate)return;const a=null===(t=this.container)||void 0===t?void 0:t.getBoundingClientRect().width;let i=0,l=0;const h=null===(e=ht(this.choicesState))||void 0===e?void 0:e.filter((t=>t.isSelected));if(!h.length)return;const s=h.length;h.forEach(((t,e)=>(l+=function(t){const e=document.createElement("canvas").getContext("2d");return e.font="14px apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif",e.measureText(t).width+44}(lt(h[e])),l>a-140||(i+=1),null))),i>=s&&(i=1/0),i<1&&(i=1),this.visibleChoices=i}closeDropdown(){var t;(null===(t=this.dropdown)||void 0===t?void 0:t.isOpen)&&(this.dropdown.isOpen=!1,this.active=!1)}calculateValue(){const t=ht(this.choicesState).filter((t=>t.isSelected));return t.length?"single"===this.mode?t[0].value||t[0].label:t.map((t=>t.value||t.label)).join("|"):""}update(){this.value=this.calculateValue(),this.maybeTruncateChoices()}renderLabel(){return this.label||this.description?e("label",{class:{"xpl-label":!0,"xpl-label--disabled":this.disabled},htmlFor:this.id},this.label,this.description&&e("small",{class:{"xpl-description":!0,"xpl-description--disabled":this.disabled}},this.description)):null}renderSelectedTags(){let t=0;const a=ht(this.choicesState).filter((t=>t.isSelected));return a.length?a.map(((i,l)=>t>=this.visibleChoices?null:(t+=1,e("xpl-tag",{onClose:()=>this.handleTagRemove(a[l])},lt(a[l]))))):null}renderError(){return void 0===this.error||0===this.error.length?null:e("label",{class:"xpl-input-error",htmlFor:this.id},e("xpl-icon",{icon:"alert-circle"}),this.error)}componentWillLoad(){this.choicesState=this.initializeChoicesState()}handleClickEvent(t){const e=t.target.closest(".xpl-select");null!==e&&e===this.container||this.closeDropdown()}handleKeyDown(t){var e;"Escape"===t.key&&(this.active||(null===(e=this.container)||void 0===e?void 0:e.contains(document.activeElement)))&&this.closeDropdown()}handleResize(){this.handleResizeThrottled()}componentDidLoad(){requestAnimationFrame((()=>{this.maybeTruncateChoices()}))}disconnectedCallback(){var t;null===(t=this.handleResizeThrottled)||void 0===t||t.cancel()}handleDropdownTrigger(){var t;const e=null!==(t=this.dropdown.isOpen)&&void 0!==t&&t,a=!e;this.triggerDropdown.emit({prevState:e,nextState:a}).defaultPrevented||this.disabled||(this.dropdownOpenState=a,this.dropdown.isOpen=a)}async reset(){this.closeDropdown(),this.choicesState=this.choicesState.map((t=>{var e;return Object.assign(Object.assign({},t),{isSelected:!1,options:null===(e=t.options)||void 0===e?void 0:e.map((t=>Object.assign(Object.assign({},t),{isSelected:!1})))})}))}render(){var t,i,l;const s=ht(this.choicesState).filter((t=>t.isSelected)),r=(null===(t=s[0])||void 0===t?void 0:t.label)||(null===(i=s[0])||void 0===i?void 0:i.value),o=s.length>1&&this.visibleChoices<1/0&&this.truncate&&!this.customDisplayValue,d=`+ ${Math.abs(this.choicesState.filter((t=>t.isSelected)).length-this.visibleChoices)} more`;return e(a,{key:"8ffd6b069df2b869abfa22ae5e41731a992abe36",class:{"xpl-select":!0,"xpl-select--disabled":this.disabled,"xpl-select--no-truncate":!this.truncate,[null!==(l=this.classNames)&&void 0!==l?l:""]:!!this.classNames},onKeyDown:this.handleTabKeyDown,ref:t=>{this.container=t}},this.renderLabel(),e("div",{key:"ed959919397c5c2ffc063957188e00a10feeed9a",class:{"xpl-input":!0,"xpl-input--disabled":this.disabled,"xpl-input--error":void 0!==this.error}},e("div",{key:"266e7d99a66d66241ebe1d20375d0a270b8b6399",class:"xpl-input-wrapper"},e("button",{key:"cdb455539afb77ab76f729e8a21419d32c220a75",class:"xpl-select__trigger",disabled:this.disabled,id:this.id,onKeyDown:this.handleTabKeyDown,onClick:t=>{t.preventDefault(),this.handleDropdownTrigger()},type:"button"},e("div",{key:"db9e85fa588af2c35d3de960826c171bc02627af",class:{"xpl-select-value":!0,"xpl-select-value--active":"multi"===this.mode&&this.value.length>0,"has-value":this.value.length>0}},(()=>this.customDisplayValue?e(h,null,e("div",{class:{"custom-display-value":!0,"custom-display-value--inactive":0===this.value.length}},e("slot",{name:"custom-display-value"})),e("span",{class:{"xpl-placeholder--hidden":this.value.length>0}},this.placeholder)):"single"===this.mode?r||this.placeholder:this.value.length>0?this.renderSelectedTags():this.placeholder)(),o&&d),e("xpl-icon",{key:"ef3997f19a4e4bb4de12f826c736ef9afc4bd5c8",class:"xpl-select__chevron-down",icon:this.selectIcon}))),!this.disabled&&e("xpl-dropdown",{key:"df29a0a21c11fa4c9a550a4339c6719793783404",ref:t=>{this.dropdown=t},isOpen:this.dropdownOpenState,options:this.choicesState,selectedValues:this.selectedValues,mode:this.mode,triggerId:this.id,update:(t,{component:e})=>{const{options:a}=e;a&&a.length>0&&(this.choicesState=a)},onIsOpenChange:t=>{this.dropdownOpenState=t.detail},onWheel:this.handleDropdownScroll,anchorToTrigger:!0}),this.renderError()),e("input",{key:"3e7f53a0d8e6d4e8028e1dc38d0e3661b76978f5",type:"hidden",name:this.name,value:this.value}))}static get watchers(){return{choices:[{onChoicesPropChanged:0}],selectedValues:[{onSelectedValuesPropChanged:0}],choicesState:[{onChoicesStateChanged:0}],value:[{handleValueStateChange:0}],dropdownOpenState:[{onDropdownOpenStateChanged:0}]}}},rt=class{constructor(e){t(this,e),this.shape="rectangle",this.size="custom"}render(){return e(a,{key:"018d8ef69972d40fa84fd700ca778862f762b699",class:{"xpl-skeleton":!0,[`xpl-skeleton--shape-${this.shape}`]:!0,[`xpl-skeleton--size-${this.size}`]:!0,[this.classNames]:!!this.classNames,"xpl-skeleton--full-width":this.fullWidth},style:{width:this.width||void 0,height:this.height||void 0,margin:this.margin||void 0}})}},ot=class{constructor(e){t(this,e),this.isOpenChange=l(this,"isOpenChange",7),this.isOpen=!1,this.backdrop=!1,this.variant="default",this.showFooter=!0,this.handleClose=()=>{this.isOpen=!1}}watchPropHandler(t){this.isOpen=t,this.isOpenChange.emit(t)}handleScroll(){const t=this.el.querySelector(".content");t.scrollHeight>t.clientHeight?t.classList.add("has-shadow"):t.classList.remove("has-shadow")}componentDidLoad(){this.handleScroll()}render(){return e(a,{key:"d38f708c91ffd96369e5277b9e4d5c74e52a41d4",class:"xpl-slideout"},this.backdrop&&this.isOpen&&e("xpl-backdrop",{key:"8cfea9e2d270e84783f99db0b12b2749a829ff8a",onClick:this.handleClose}),e("aside",{key:"8b3a24dccbb44c281bad35ab8d2af895bde56d10",class:`slideout slideout--${!this.isOpen&&"closed"}`},e("header",{key:"921acd55e9aedcd5c04d2d6d4f2d26515ec744b8",class:"header"},e("div",{key:"dd434e7a1b5d28aa0833979f8d515df28ad00cc9",class:"title"},e("slot",{key:"9743e88555558ec66e46528b04d6f6391d1bd8df",name:"title"}),e("xpl-button",{key:"7b7b267fa892363d0d25af419bdaa55dd5a362ef",class:"close-button",iconOnly:!0,size:"sm",variant:"subtle",onClick:this.handleClose},e("xpl-icon",{key:"d27bd1de9864fbc6b72f1b71658ece1f5dfeddc9",icon:"x"}))),e("div",{key:"3183410cecb0973d8b7dca3997e1f6c254d28892",class:"subtitle"},e("slot",{key:"6dd1fbcdd15fde802a316053b19566c618f41dd0",name:"subtitle"})),e("div",{key:"b3c4a050275de296b43dc7d9e87bcc082c7f14ec",class:"search"},e("slot",{key:"c6f0ef04a753cb71da97021caa791ded9e2e0533",name:"search"}))),e("xpl-divider",{key:"68301c3540651d6d0dc2e9577d8fc6d2e5e9f536",tier:0,class:"divider top"}),e("article",{key:"eff6e4e81dfe48a9bf2f59d5f5ca09c5f56e6491",class:"content",tabIndex:0},e("slot",{key:"f3f25c5b51ae017cb6f84ea0f1c14329ba429adb",name:"content"})),this.showFooter&&e("footer",{key:"6e94107fefc5e2e24edb21f61b0e4af32c954445"},e("xpl-divider",{key:"89c550dbb352c6b22534edf7ff3a0e8d0513a206",tier:0,class:"divider bottom"}),e("div",{key:"32fe00b37f65ef0b1ba42bf8e7d8f59dfec7aa68",class:"footer"},e("slot",{key:"f42ee4c847be0ab553d039bc0ce50e29e70984fa",name:"tertiary"}),e("slot",{key:"dd6b8757bcd85dd79a084d3ec0bbbfd6629297bb",name:"secondary"}),e("slot",{key:"e6d4fea0d1ebfa7bd71fce313dee34b25f164b0c",name:"primary"})))))}get el(){return i(this)}static get watchers(){return{isOpen:[{watchPropHandler:0}]}}},dt=class{constructor(e){t(this,e),this.tabChange=l(this,"tabChange",7),this.selected=!1,this.handleTabClick=()=>{this.tabChange.emit(this.target)}}render(){return e(a,{key:"3f1eaa197c02b1bb45da97e59a58aeea9f86bc6f",class:{"xpl-tab":!0,"xpl-tab--selected":this.selected}},e("button",{key:"12066216ecbc4fa91c7645b45e4affce20342e4b",onClick:this.handleTabClick,class:"xpl-tab__button",role:"tab","aria-controls":this.target},e("slot",{key:"bbe6f9c862510aa83d4816fc7366e82ac10cf266"})))}},ct=class{constructor(e){t(this,e),this.selected=!1}render(){return e(a,{key:"f22da3feed8a64baae080a1593ea35c68d41f857",class:{"xpl-tab-panel":!0,"xpl-tab-panel--selected":this.selected},role:"tabpanel","aria-labelledby":this.target},e("slot",{key:"88311f1af38490ec1b3ba8aee8f1bb39d58cfd11"}))}},nt=class{constructor(e){t(this,e),this.tableSelect=l(this,"tableSelect",7),this.sortChanged=l(this,"sortChanged",3),this.selectedValues=[],this.isSortable=!1,this.sortableColumns=[],this.areAllSelected=!1,this.hasScrolled=!1,this.sortTypeArray=[],this.selectAllValue=Math.random().toString(36).slice(2),this.selectAll=t=>{const{target:e}=t;if(!(e instanceof HTMLInputElement))return;const{checked:a}=e;this.areAllSelected=a,this.selected=this.selectedValues.length>0?Array.from(this.el.querySelectorAll("tbody td:first-child input")).map((t=>a?null==t?void 0:t.value:a)):this.selected.map((()=>a)),this.onChange()},this.selectOne=(t,e)=>{const{target:a}=t;if(!(a instanceof HTMLInputElement))return;const{checked:i,value:l}=a;this.areAllSelected=!1,this.selected=this.selected.map(((t,a)=>a!==e?t:this.selectedValues.length>0&&i?l:i)),this.onChange()},this.onChange=()=>{this.tableSelect.emit({selected:this.selected,areAllSelected:this.areAllSelected})},this.onScroll=()=>{this.hasScrolled=this.container.scrollLeft>0},this.sortBy=(t,e)=>{const a=(e,a)=>e[t].toLocaleLowerCase()<a[t].toLocaleLowerCase()?-1:e[t].toLocaleLowerCase()>a[t].toLocaleLowerCase()?1:0;switch(e[t]){case"asc":this.rowData.sort(((t,e)=>a(t,e)));break;case"desc":this.rowData.sort(((t,e)=>a(e,t)));break;default:this.rowData=this.data,this.sortTypeArray[t]=null}this.rowData=Array.from(this.rowData),this.render()},this.setData=()=>{this.rowData=void 0!==this.data?Array.from(this.data):[]},this.setFooterData=()=>{this.rowFooterData=void 0!==this.footer?Array.from(this.footer):[]}}handleSort(t,e,a,i){t.preventDefault(),t.stopPropagation(),e&&(this.sortTypeArray=this.sortTypeArray.map(((t,e)=>{if(e!==a)return null;switch(t){case"asc":return"desc";case"desc":return null;default:return"asc"}})),this.sortChanged.emit({colNum:a,colName:i,sortTypeArr:this.sortTypeArray}).defaultPrevented||this.sortBy(a,this.sortTypeArray))}watchData(){this.setData()}watchFooterData(){this.setFooterData()}watchColumns(){this.sortTypeArray=this.columns?this.columns.map((()=>null)):[]}componentWillLoad(){this.areAllSelected=!1,this.setData(),this.setFooterData(),this.selected=new Array(this.rowData.length).fill(!1),this.sortTypeArray=this.columns?this.columns.map((()=>null)):[]}render(){var t;return!this.columns||this.sortTypeArray&&this.sortTypeArray.length===this.columns.length||(this.sortTypeArray=this.columns.map((()=>null))),e(a,{key:"3ac2c96a4d691a8e60a2f0f5732787a4dd43e71e"},e("div",{key:"242225267bf912ae46cf38dd1750dcd66fa627f7",class:"xpl-table-container",onScroll:this.onScroll,ref:t=>{this.container=t}},e("table",{key:"76f22b451b7d09f2843d1afc063f8e287afb419f",class:{"xpl-table":!0,"xpl-table--striped":this.striped,"xpl-table--freeze":this.freeze,"xpl-table--has-scrolled":this.hasScrolled}},this.columns&&e("thead",{key:"be12e8292faf5be828c281e3c7d5396652c7e4b8"},this.columns.map(((t,a)=>{var i;const l=(t=>{switch(t){case"asc":return"arrow-up";case"desc":return"arrow-down";default:return"dash"}})(null===(i=this.sortTypeArray)||void 0===i?void 0:i[a]),h=!(!this.isSortable||!this.sortableColumns[a]);return e("th",null,e("label",{onClick:e=>this.handleSort(e,h,a,t.replace(/ /g,"-").toLowerCase()),class:h?"cursor-pointer":""},this.multiselect&&0===a&&e("input",{checked:this.areAllSelected,id:"__xpl-table-th",indeterminate:!this.areAllSelected&&this.selected.some((t=>t)),onClick:t=>{t.stopPropagation(),this.selectAll(t)},type:"checkbox",value:`select-all-${this.selectAllValue}`}),t,h&&!!this.sortTypeArray[a]&&e("xpl-icon",{icon:l,size:16})))}))),e("tbody",{key:"94c5ad3a68f1cffa73a55bb106e81c8899ddc2c4"},this.rowData.map(((t,a)=>e("tr",{class:this.selected&&this.selected[a]?"xpl-table-row-selected":""},t.map(((t,i)=>e("td",null,this.multiselect&&0===i?e("label",{htmlFor:`__xpl-table-row-${a}`},e("input",{id:`__xpl-table-row-${a}`,checked:!!this.selected[a],type:"checkbox",onChange:t=>this.selectOne(t,a),value:this.selectedValues.length>0?this.selectedValues[a]:`xpl-table-checkbox-${a}`}),e("div",{innerHTML:t})):e("div",{innerHTML:t})))))))),(null===(t=this.rowFooterData)||void 0===t?void 0:t.length)>0&&e("tfoot",{key:"2bcfdfed0e5709f60f4beec7f8f58038899b8b30"},this.rowFooterData.map((t=>e("tr",null,t.map((t=>e("td",null,e("div",{innerHTML:t})))))))))))}get el(){return i(this)}static get watchers(){return{data:[{watchData:0}],footer:[{watchFooterData:0}],columns:[{watchColumns:0}]}}},pt=class{constructor(e){t(this,e),this.tabChange=l(this,"tabChange",7),this.fullWidth=!1,this.selectedValue=this.getDefaultValue(),this.activeBarPosition={left:0,width:0},this.isMobileSelectChange=!1,this.tabHeadings=[],this.tabPanels=[],this.handleTabChange=t=>{this.updateTabsSelectedState(t)}}onWindowResize(){this.updateActiveBarPosition()}getDefaultValue(){var t,e;return this.value||(null===(e=null===(t=this.tabHeadings)||void 0===t?void 0:t[0])||void 0===e?void 0:e.getAttribute("target"))||""}updateActiveBarPosition(){const t=this.tabHeadings.find((t=>t.getAttribute("target")===this.selectedValue));if(!this.headingsContainerRef||!t)return;const e=t.getBoundingClientRect(),a=this.headingsContainerRef.getBoundingClientRect();this.activeBarPosition={left:e.left-a.left,width:e.width}}updateTabsSelectedState(t){this.tabHeadings.forEach((e=>{t===e.getAttribute("target")?e.setAttribute("selected",""):e.removeAttribute("selected")})),this.tabPanels.forEach((e=>{t===e.getAttribute("target")?e.setAttribute("selected",""):e.removeAttribute("selected")})),requestAnimationFrame((()=>{this.selectedValue=t,this.updateActiveBarPosition()}))}collectTabs(){this.tabHeadings=Array.from(this.el.querySelectorAll("xpl-tab")),this.tabPanels=Array.from(this.el.querySelectorAll("xpl-tab-panel")),this.handleTabChange(this.getDefaultValue())}renderChoices(){return this.tabHeadings.map((t=>{var e,a;return{label:Array.from(null!==(a=null===(e=t.querySelector(".xpl-tab__button"))||void 0===e?void 0:e.childNodes)&&void 0!==a?a:[]).filter((t=>t.nodeType===Node.TEXT_NODE)).map((t=>t.textContent.trim())).join(" "),value:t.getAttribute("target")}}))}connectedCallback(){"undefined"!=typeof MutationObserver&&(this.observer=new MutationObserver((()=>{this.collectTabs()})),this.observer.observe(this.el,{childList:!0,subtree:!0}))}disconnectedCallback(){var t;null===(t=this.observer)||void 0===t||t.disconnect()}componentDidLoad(){this.collectTabs()}render(){return e(a,{key:"c6858318e3adea4fb9a5587d16aff2778a69af0d",class:{"xpl-tabs":!0,"xpl-tabs--full-width":this.fullWidth}},e("xpl-select",{key:"f6e67e41dc20da4bd6c3d9d4b60045e0e55c7343",classNames:"xpl-tabs__mobile-select",choices:this.renderChoices(),selectedValues:this.selectedValue,onDropdownStateChange:t=>{t.detail&&(this.isMobileSelectChange=!0)},onChangeEvent:t=>{if(this.isMobileSelectChange){const e=t.detail.toString();this.handleTabChange(e),this.tabChange.emit(e),this.isMobileSelectChange=!1}}}),e("nav",{key:"297eb4c0695adf1bea03de7e6874a0b61e108319",class:"xpl-tabs__headings",role:"tablist",ref:t=>{this.headingsContainerRef=t},onTabChange:t=>{this.isMobileSelectChange=!1,this.handleTabChange(t.detail)}},e("div",{key:"cd60b8acf47bb319bc92852d5f62ba456acee6f0",class:"xpl-tabs__active-bar",style:{transform:`translateX(${this.activeBarPosition.left}px)`,width:`${this.activeBarPosition.width}px`}}),e("slot",{key:"a4b73230bfc7178381780a5136a5c1d820be7d65",name:"heading"})),e("div",{key:"e5d4cf94e1c75dabe73d8a5cc2d00cc97466f1b2",class:"xpl-tabs__panels"},e("slot",{key:"e3d2fbfed0ebc74f2fc41f74574e202e834e2129",name:"panel"})))}get el(){return i(this)}static get watchers(){return{value:[{updateTabsSelectedState:0}]}}},Ct=class{constructor(e){t(this,e),this.close=l(this,"close",7)}render(){return e(a,{key:"4a5d37bbd7458d289bf7ea272bd3f944e5f1f1a8",class:"xpl-tag-container"},e("button",{key:"65701bf44741a791ab8d60db2de0f3308c83df33",class:"xpl-tag",onClick:()=>{this.close.emit()}},e("slot",{key:"bd3a1e0af2dbfbc70e18082a1cd0c02710f6ef26"})),e("button",{key:"13224cc6cc44e1c4ed9515019906ba3217edffd7",class:"xpl-tag__close",onClick:()=>{this.close.emit()}},"×"))}},ft=class{constructor(a){t(this,a),this.variant="neutral",this.showIcon=!0,this.dismissable=!0,this.timeout=8e3,this.handleAnimationEnd=()=>{var t,e;(null===(t=this.el)||void 0===t?void 0:t.classList.contains("xpl-toast--dismissed"))&&(null===(e=this.el)||void 0===e||e.remove())},this.getIcon=()=>{switch(this.variant){case"warning":return e("xpl-icon",{size:24,icon:"alert-hex"});case"success":return e("xpl-icon",{size:24,icon:"check-circle"});default:return e("xpl-icon",{size:24,icon:"comment-alt"})}},this.dismiss=()=>{var t;null===(t=this.el)||void 0===t||t.classList.add("xpl-toast--dismissed")}}componentDidLoad(){this.actionSlot.children.length<1&&setTimeout((()=>{this.dismiss()}),this.timeout)}render(){var t;return e(a,{key:"6a4c1dfe86f62c39db5573a0bb1eef2c14616085",class:`xpl-toast xpl-toast--${this.variant}`,onAnimationEnd:this.handleAnimationEnd},e("div",{key:"282a4c5fc37e538d3359a0c38e7cd30e2a29e311",class:"xpl-toast__left"},this.showIcon&&e("div",{key:"dfb6bb1923f5c9e1b1dae80630cc7977529e834f",class:`xpl-toast__icon xpl-toast__icon--${this.variant}`},this.getIcon()),e("div",{key:"9a1755b484e316be08b89044ae3c55e7a30c3795",class:"xpl-toast__notification"},e("p",{key:"afa9572dcb109c58c6c4045e14b604010da95230",class:"xpl-toast__title"},e("slot",{key:"0b80b8719e79a1e01bcf8ec125db8d9762f1a1d7",name:"title"})),""!==this.caption&&e("p",{key:"7debe4dd50870bc6478a86e7742450f667dfee3a",class:"xpl-toast__caption"},null===(t=this.caption)||void 0===t?void 0:t.substring(0,85)))),e("div",{key:"194104f419162bd4157fb5e8885983ca40467d9c",class:"xpl-toast__action",ref:t=>{this.actionSlot=t}},e("slot",{key:"c63cc79ec725417c4f317dd72511e72b24f8280e",name:"action"})),this.dismissable&&e("div",{key:"3328ad43d7cd4026d5b4488dc2d920031be0ca34",class:"xpl-toast__close"},e("button",{key:"ce3b27ae3c1570806916b3d668678513df5065ed",tabIndex:0,onClick:this.dismiss},e("xpl-icon",{key:"be1a177568f933417b62ce2a2705441d00b3118f",icon:"x"}))))}get el(){return i(this)}},ut=()=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"14"},e("g",{filter:"url(#a)"},e("path",{d:"M0 5h15l-7.5 7.5L0 5Z"})),e("defs",null,e("filter",{id:"a",width:"20",height:"8.171",x:".5",y:"5","color-interpolation-filters":"sRGB",filterUnits:"userSpaceOnUse"},e("feFlood",{"flood-opacity":"0",result:"BackgroundImageFix"}),e("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),e("feOffset",{dy:"1"}),e("feComposite",{in2:"hardAlpha",operator:"out"}),e("feColorMatrix",{values:"0 0 0 0 0.882353 0 0 0 0 0.886275 0 0 0 0 0.909804 0 0 0 1 0"}),e("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_20073_3067"}),e("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_20073_3067",result:"shape"})))),bt=class{constructor(e){t(this,e),this.position="top-middle",this.hideArrow=!1}render(){return e(a,{key:"2a442f9c9c54e8e6f8032b5d6384c84a1fbda0ad"},e("div",{key:"f30932db02af0f1273421b14c5b25840adbc3f58",class:"xpl-tooltip-container"},e("slot",{key:"729aee67e66fb3d281b84a86aeba2d12a8a08340"}),e("div",{key:"9c0f6a237f2a1a11459a311095a2bdf9be4b176d",class:`xpl-tooltip xpl-tooltip--${this.position}`},this.text),!this.hideArrow&&e("div",{key:"3bb6b085ddde321cf3063feba8ff23e785723afd",class:"xpl-tooltip-arrow"},e(ut,{key:"f687c2776a7b9097aec183c5128e9e238e57d26e"}))))}},mt=class{constructor(e){t(this,e),this.navOpen=l(this,"navOpen",7),this.open=!0}onNavToggle(){this.open=!this.open,this.navOpen.emit(this.open)}componentWillLoad(){this.open=void 0!==this.isNavOpenAtStartup?this.isNavOpenAtStartup:this.open}render(){return e(a,{key:"a67e91188d392358df4b052d7e9026cf2f6b9b04"},e("nav",{key:"f51a3c37a1c8ae3d4f4ba8b524fb1f2ff2dd5ea8","aria-label":"utility navigation bar",class:"xpl-utility-bar"},this.navControl?e("div",null,e("button",{class:"xpl-utility-bar__nav-control",onClick:()=>this.onNavToggle()},e("xpl-icon",{class:"xpl-utility-nav__bars",icon:"three-bars"})),e("slot",{name:"aside"})):e("slot",{name:"aside"}),e("slot",{key:"75f581a8455f372b692a9ec190c2f0974b214105",name:"main"})))}};export{o as xpl_avatar,d as xpl_backdrop,c as xpl_badge,n as xpl_breadcrumb_item,p as xpl_breadcrumbs,C as xpl_button,f as xpl_checkbox,u as xpl_choicelist,b as xpl_content_area,m as xpl_dashboard,v as xpl_data_card,g as xpl_divider,w as xpl_dropdown,y as xpl_dropdown_group,k as xpl_dropdown_heading,x as xpl_dropdown_option,L as xpl_header_accordion,j as xpl_icon,E as xpl_input,N as xpl_input_color,W as xpl_input_date,B as xpl_input_file,U as xpl_input_time,K as xpl_modal,G as xpl_nav_item,X as xpl_pagination,tt as xpl_popover,et as xpl_progress,at as xpl_radio,it as xpl_secondary_nav,st as xpl_select,rt as xpl_skeleton,ot as xpl_slideout,dt as xpl_tab,ct as xpl_tab_panel,nt as xpl_table,pt as xpl_tabs,Ct as xpl_tag,ft as xpl_toast,bt as xpl_tooltip,mt as xpl_utility_bar}
6
+ */function A(){if(V)return H;V=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;return H=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},a=0;a<10;a++)e["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach((function(t){i[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(t){return!1}}()?Object.assign:function(i,l){for(var h,s,r=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(i),o=1;o<arguments.length;o++){for(var d in h=Object(arguments[o]))e.call(h,d)&&(r[d]=h[d]);if(t){s=t(h);for(var c=0;c<s.length;c++)a.call(h,s[c])&&(r[s[c]]=h[s[c]])}}return r},H}var O=function(){if(Z)return _;Z=1;const t=$,e=A();for(const i of Object.keys(t)){const l=(t,a,l)=>{const h=[],s=e({},a,l);l&&((l.width||l.height)&&(s.width=l.width?l.width:parseInt(l.height)*a.width/a.height,s.height=l.height?l.height:parseInt(l.width)*a.height/a.width),l.class&&(s.class=`octicon octicon-${i} ${l.class}`,s.class.trim()),l["aria-label"]&&(s["aria-label"]=l["aria-label"],s.role="img",delete s["aria-hidden"]));for(const t of Object.keys(s))h.push(`${t}="${s[t]}"`);return h.join(" ").trim()};t[i].symbol=i;for(const e of Object.keys(t[i].heights))t[i].heights[e].options={version:"1.1",width:t[i].heights[e].width,height:parseInt(e),viewBox:`0 0 ${t[i].heights[e].width} ${e}`,class:`octicon octicon-${i}`,"aria-hidden":"true"};t[i].toSVG=function(e={}){const{height:h,width:s}=e,r=a(Object.keys(t[i].heights),h||s||16);return`<svg ${l(t[i],t[i].heights[r].options,e)}>${t[i].heights[r].path}</svg>`}}function a(t,e){return t.map((t=>parseInt(t,10))).reduce(((t,a)=>a<=e?a:t),t[0])}return _=t}(),S=M(O);const j=class{constructor(e){t(this,e)}render(){let t={};if(void 0!==this.size)if("number"==typeof this.size){const e=this.size<=32?this.size:32;t={width:e,height:e}}else console.warn("[Apollo] xpl-icon: size is not a number, the value passed was ignored. Please change value to a number.");let i="xpl-icon__wrapper ";return this.backgroundColor&&(i+=`xpl-icon__wrapper--with-background xpl-icon__wrapper--with-background--${this.backgroundColor}`),e(a,{key:"24576487ab74d82288bd43262d3021f19d12489d"},e("figure",{key:"1b90df03ca412fd56fd868f934a24712d3a19079",class:i},e("span",{key:"e0ebd1ccfb6796190240841035a0a2db8c1bb3f1","aria-label":this.icon,role:"img",class:"xpl-icon",style:{width:`${t.width}px`,height:`${t.height}px`},innerHTML:S[this.icon].toSVG(t)}),e("figcaption",{key:"d3976b8859355ef990e9bffa210b5c005505c308"},this.icon," icon")))}};j.style=".xpl-icon{align-items:center;display:grid;justify-content:center}";const E=class{constructor(e){t(this,e),this.focusEvent=l(this,"focusEvent",7),this.blurEvent=l(this,"blurEvent",7),this.valueChange=l(this,"valueChange",7),this.inputEvent=l(this,"inputEvent",7),this.multiline=!1,this.dateFormat="Y-m-d",this.timeFormat="24h",this.allowCustomOption=!1,this.mode="single",this.accept="",this.multiple=!1,this.hideTriggerOnSelect=!1,this.hideFileNames=!1,this.hideAcceptText=!1,this.type="text",this.valueChanged=t=>{this.valueChange.emit(t.target.value)},this.characterCount=0,this.passwordVisible=!1,this.handleFocus=t=>{this.focusEvent.emit(t)},this.handleBlur=t=>{this.blurEvent.emit(t)},this.handleInput=t=>{this.multiline&&this.updateCharacterCount();const{value:e}=t.target;this.inputEvent.emit(e)}}updateCharacterCount(){this.characterCount=this.input.value.length}componentWillLoad(){null!=this._id&&""!==this._id||(this._id=s()),this.multiline&&void 0!==this.maxCharacterCount&&(this.characterCount=void 0!==this.value?this.value.length:0)}renderInput(){switch(this.type){case"file":return e("xpl-input-file",{accept:this.accept,disabled:this.disabled,hideAcceptText:this.hideAcceptText,hideFileNames:this.hideFileNames,hideTriggerOnSelect:this.hideTriggerOnSelect,multiple:this.multiple,name:this.name,_id:this._id},e("slot",{name:"trigger"}));case"color":return e("xpl-input-color",{disabled:this.disabled,value:this.value,placeholder:this.placeholder,required:this.required,hideEyeDropper:this.hideEyeDropper});case"date":return e("xpl-input-date",{inputId:this._id,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,value:this.value,placeholder:this.placeholder,post:this.post,pre:this.pre,max:this.max,min:this.min,dateFormat:this.dateFormat,mode:this.mode});case"time":return e("xpl-input-time",{inputId:this._id,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,value:this.value,placeholder:this.placeholder,max:this.max,min:this.min,step:this.step,mode:this.mode,timeFormat:this.timeFormat,allowCustomOption:this.allowCustomOption});default:return e("div",{class:"xpl-input-wrapper"},this.pre&&!this.multiline&&e("label",{class:"xpl-input-pre",htmlFor:this._id},this.pre),this.multiline?e("textarea",{disabled:this.disabled,id:this._id,name:this.name,placeholder:this.placeholder,readonly:this.readonly,ref:t=>{this.input=t},required:this.required,onChange:this.valueChanged,onFocus:this.handleFocus,onBlur:this.handleBlur,onInput:this.handleInput},this.value):e("input",{autocomplete:this.autocomplete,disabled:this.disabled,id:this._id,max:this.max,min:this.min,name:this.name,placeholder:this.placeholder,readonly:this.readonly,ref:t=>{this.input=t},required:this.required,step:this.step,type:this.type,value:this.value,onChange:this.valueChanged,onFocus:this.handleFocus,onBlur:this.handleBlur,onInput:this.handleInput}),"password"===this.type&&e("button",{"aria-label":"Toggle password visibility",class:"xpl-input-password",onClick:()=>{this.passwordVisible=!this.passwordVisible},role:"presentation"},e("xpl-icon",{icon:this.passwordVisible?"eye-closed":"eye",size:24})),this.post&&!this.multiline&&e("label",{class:"xpl-input-post",htmlFor:this._id},this.post),this.multiline&&void 0!==this.maxCharacterCount&&e("span",{class:"xpl-input-characters"},this.characterCount,"/",this.maxCharacterCount))}}render(){var t;let i=!1;return(this.error||this.multiline&&void 0!==this.maxCharacterCount&&this.characterCount>this.maxCharacterCount)&&(i=!0),e(a,{key:"c682985a3d592f9f9902a16013a5d00f40ce5e44",class:{"xpl-input":!0,"xpl-input--disabled":this.disabled,"xpl-input--error":i,"xpl-input--readonly":this.readonly,[`xpl-input--${this.type}`]:!0}},this.label&&e("label",{key:"21d863221e85a255f3dc5e662139b7abc0e72907",class:"xpl-input-label",htmlFor:this._id},this.label,this.description&&e("small",{key:"25d078a667c8b9cbf4d1b5d1f412c3d0e736013a"},this.description)),this.renderInput(),(null===(t=this.error)||void 0===t?void 0:t.length)>0&&e("label",{key:"7e13c1fc18496bdf50cdb2a239c113c182b83f18",class:"xpl-input-error",htmlFor:this._id},e("xpl-icon",{key:"900d641cfcd94d9f6cc85ba34e1e211448c203df",icon:"alert-circle",size:16}),e("span",{key:"74f7868861f5c262038bee3de2faeecc46b2454d"},this.error)))}},I=(t,e,a)=>{const i=(a/=100)*(e/=100),l=i*(1-Math.abs(t/60%2-1)),h=a-i;let s=0,r=0,o=0;return t<60?(s=i,r=l,o=0):t<120?(s=l,r=i,o=0):t<180?(s=0,r=i,o=l):t<240?(s=0,r=l,o=i):t<300?(s=l,r=0,o=i):(s=i,r=0,o=l),{r:Math.round(255*(s+h)),g:Math.round(255*(r+h)),b:Math.round(255*(o+h))}},T=(t,e,a)=>[t,e,a].map((t=>t.toString(16).padStart(2,"0"))).join(""),D=t=>{var e,a;if(t.startsWith("#")){if(!/^#([a-fA-F\d]{6})$/.test(t))throw new Error("Only 6-digit hex format supported (e.g. #aabbcc)");const e=t.toLowerCase().slice(1),a=parseInt(e.slice(0,2),16),i=parseInt(e.slice(2,4),16),l=parseInt(e.slice(4,6),16);return{hex:e,r:a,g:i,b:l,a:1}}if(t.startsWith("rgba")||t.startsWith("rgb")){const a=null===(e=t.match(/[\d.]+/g))||void 0===e?void 0:e.map(Number);if(!a||a.length<3)throw new Error("Invalid rgba/rgb format");const[i,l,h,s=1]=a,r=t=>t.toString(16).padStart(2,"0");return{hex:`${r(i)}${r(l)}${r(h)}`.toLowerCase(),r:i,g:l,b:h,a:s}}if(t.startsWith("hsla")||t.startsWith("hsl")){const e=null===(a=t.match(/[\d.]+/g))||void 0===a?void 0:a.map(Number);if(!e||e.length<3)throw new Error("Invalid hsla/hsl format");const[i,l,h,s=1]=e,r=((t,e,a,i)=>{a/=100;const l=e=>(e+t/30)%12,h=(e/=100)*Math.min(a,1-a),s=t=>a-h*Math.max(-1,Math.min(l(t)-3,Math.min(9-l(t),1)));return`rgba(${Math.round(255*s(0))}, ${Math.round(255*s(8))}, ${Math.round(255*s(4))}, ${i})`})(i,l,h,s),[o,d,c]=r.match(/[\d.]+/g).map(Number);return{hex:T(o,d,c).toLowerCase(),r:o,g:d,b:c,a:s}}throw new Error("Unsupported color format")},F=t=>t.a&&1!==t.a?`rgba(${t.r}, ${t.g}, ${t.b}, ${t.a})`:`#${t.hex}`,P={hex:"",r:0,g:0,b:0,a:1},N=class{constructor(e){t(this,e),this.inputChange=l(this,"inputChange",7),this.hasErrorStateChanged=l(this,"hasErrorStateChanged",7),this.placeholder="Select color",this.eyeDropperSupported="EyeDropper"in window,this.colorInputElements={hex:null,r:null,g:null,b:null,a:null,hue:null,slGrid:null,alpha:null},this.handleMove=t=>{const e=this.colorInputElements.slGrid.getBoundingClientRect(),a="touches"in t?t.touches[0].clientY:t.clientY,i=Math.max(0,Math.min(("touches"in t?t.touches[0].clientX:t.clientX)-e.left,e.width)),l=Math.max(0,Math.min(a-e.top,e.height)),h=i/e.width,s=l/e.height,r=I(this.hue,100,100),o=(255*(1-h)+h*r.r)*(1-s),d=(255*(1-h)+h*r.g)*(1-s),c=(255*(1-h)+h*r.b)*(1-s),n={r:Math.round(o),g:Math.round(d),b:Math.round(c),hex:T(Math.round(o),Math.round(d),Math.round(c)),a:this.colorValues.a};this.colorValues=n},this.startDrag=t=>{t.preventDefault(),this.handleMove(t),window.addEventListener("mousemove",this.handleMove),window.addEventListener("mouseup",this.stopDrag),window.addEventListener("touchmove",this.handleMove),window.addEventListener("touchend",this.stopDrag)},this.stopDrag=()=>{window.removeEventListener("mousemove",this.handleMove),window.removeEventListener("mouseup",this.stopDrag),window.removeEventListener("touchmove",this.handleMove),window.removeEventListener("touchend",this.stopDrag)},this.onHexInputChange=t=>{var e;const a=t.detail;if(a){const[t,i,l]=(t=>t?t.match(/\w\w/g).map((t=>parseInt(t,16))):[0,0,0])(a);this.colorValues={hex:a,r:t,g:i,b:l,a:null!==(e=this.colorValues.a)&&void 0!==e?e:1}}else this.colorValues=Object.assign({},P)},this.onRgbaInputChange=(t,e)=>{const a=parseFloat(e.detail);if(Number.isNaN(a))return void(this.hasErrorState=`invalid value from ${t.name}: ${a}`);const i=Object.assign({},this.colorValues);switch(t.name){case"color-r-input":i.r=a;break;case"color-g-input":i.g=a;break;case"color-b-input":i.b=a;break;case"color-a-input":i.a=a;break;default:this.hasErrorState=`unhandled input: ${t.name}`}i.hex=T(i.r,i.g,i.b),this.colorValues=i},this.onSliderInputChange=t=>{const e=parseFloat(t.value);if(Number.isNaN(e))this.hasErrorState=`invalid value from ${t.name}: ${e}`;else switch(t.name){case"color-hue-slider":this.colorValues=D(`hsla(${e}, 100%, 50%, 1)`),this.hue=e;break;case"color-alpha-slider":this.colorValues=Object.assign(Object.assign({},this.colorValues),{a:e});break;default:this.hasErrorState=`unhandled input: ${t.name}`}}}valueChanged(t){this.hasErrorState=this.required&&!t.hex?"required":null,this.inputChange.emit(t.hex?F(t):"")}onHasErrorStateChanged(t){this.hasErrorStateChanged.emit(t)}onValuePropChange(t){this.syncColorFromValue(t)}syncColorFromValue(t){if(t)try{this.colorValues=D(t),this.hue=(()=>{const t=this.colorValues.r/255,e=this.colorValues.g/255,a=this.colorValues.b/255,i=Math.max(t,e,a),l=Math.min(t,e,a),h=i-l;let s=0,r=0;const o=(i+l)/2;if(0!==h){switch(r=h/(1-Math.abs(2*o-1)),i){case t:s=(e-a)/h%6;break;case e:s=(a-t)/h+2;break;case a:s=(t-e)/h+4}s*=60,s<0&&(s+=360)}return{hue:Math.round(s),saturation:Math.round(100*r),lightness:Math.round(100*o)}})().hue}catch(t){this.hasErrorState="invalid color format",this.hue=0}else this.colorValues=Object.assign({},P),this.hasErrorState=null,this.hue=0}componentWillLoad(){this.syncColorFromValue(this.value)}componentDidLoad(){const{r:t,g:e,b:a,a:i,hue:l,alpha:h,hex:s}=this.colorInputElements;s.addEventListener("valueChange",(t=>{this.onHexInputChange(t)})),[t,e,a,i].forEach((t=>{t.addEventListener("valueChange",(e=>{this.onRgbaInputChange(t,e)}))})),[l,h].forEach((t=>{t.addEventListener("input",(()=>{this.onSliderInputChange(t)}))}))}async openEyeDropper(){try{const t=new window.EyeDropper,e=await t.open();this.colorValues=D(e.sRGBHex)}catch(t){this.hasErrorState=`eyedropper cancelled or failed: ${t}`}}render(){const{r:t,g:i,b:l,a:h}=this.colorValues,s=I(this.hue,100,100),{x:r,y:o}=((t,e,a,i)=>{const{s:l,v:h}=((t,e,a,i)=>{t/=255,e/=255,a/=255;const l=Math.max(t,e,a),h=l-Math.min(t,e,a);let s=0;return s=0===h?0:l===t?(e-a)/h%6:l===e?(a-t)/h+2:(t-e)/h+4,s=Math.round(60*s),s<0&&(s+=360),{h:null!=i?i:s,s:0===l?0:h/l,v:l}})(e.r,e.g,e.b,t);return{x:Math.round(l*a),y:Math.round((1-h)*i)}})(this.hue,{r:t,g:i,b:l},288,160),d={left:`${r}px`,top:`${o}px`,background:`rgb(${t}, ${i}, ${l})`};return e(a,{key:"639f311d46bbb46e327ae6b05fe24b47795adbf3",class:"xpl-input-color"},e("xpl-popover",{key:"ad9d6145e4e5ac581c6d22f726050767ff82d861",disabled:this.disabled,display:"menu"},e("div",{key:"219e1754388cfc2ecff25b42b67322e780a1e7d6",slot:"trigger"},e("div",{key:"7beafe5304521d496bf7d7f8f82de01c9b7de00d",class:{"xpl-input-color__display":!0,"xpl-input-color__display--disabled":this.disabled,"xpl-input-color__display--error":!!this.hasErrorState}},e("span",{key:"2caae6b87902c50eb754e93ce939797d619da723",class:"xpl-input-color__color",style:{background:F(this.colorValues)}}),this.colorValues.hex?e("span",{class:"xpl-input-color__value"},F(this.colorValues)):e("span",{class:"xpl-input-color__placeholder"},this.placeholder),this.eyeDropperSupported&&!this.hideEyeDropper&&e("xpl-icon",{key:"8cd0f1e94bf2eaf31ad82a4c8d307badef8046fc",size:20,icon:"eye-droper",class:"xpl-input-color__icon",onClick:t=>{t.stopPropagation(),this.openEyeDropper()}}))),e("div",{key:"8e6add90e733d299cea94559dcbc29dd4e64d9cd",class:"xpl-input-color__menu"},e("div",{key:"a488c9b7ef3ff0cabbbb4bf5a631f209034a2539",class:"xpl-input-color__sl-grid",ref:t=>{this.colorInputElements.slGrid=t},style:{background:["linear-gradient(to top, #000, #0000)","linear-gradient(to right, #fff, #fff0)",`rgb(${s.r} ${s.g} ${s.b})`].join(", ")},onMouseDown:this.startDrag,onTouchStart:this.startDrag},e("div",{key:"542a5cafd651e6b49f813f6eecb46088b0b6f97c",class:"xpl-input-color__sl-thumb",style:d})),e("div",{key:"fd3268874bb0c0bc22c2d2db15dd50c38d3ae70a",class:"xpl-input-color__grid"},e("input",{key:"08ea52b5c2bbc2800b2ad5cca6981813e4578ce5",type:"range",min:"0",max:"360",value:this.hue,class:"xpl-input-color__slider xpl-input-color__hue",name:"color-hue-slider",ref:t=>{this.colorInputElements.hue=t}}),e("input",{key:"1692e362cb1e48446f33e2f82c5988546ad6a6f0",type:"range",min:"0",max:"1",step:"0.01",value:h,class:"xpl-input-color__slider xpl-input-color__alpha",name:"color-alpha-slider",ref:t=>{this.colorInputElements.alpha=t},style:{backgroundImage:[`linear-gradient(to right, rgb(${t} ${i} ${l} / 0) 0%, rgb(${t} ${i} ${l} / 1) 100%)`,"linear-gradient(45deg, #ccc 25%, transparent 25%)","linear-gradient(-45deg, #ccc 25%, transparent 25%)","linear-gradient(45deg, transparent 75%, #ccc 75%)","linear-gradient(-45deg, transparent 75%, #ccc 75%)"].join(", ")}}),e("div",{key:"5de3d1979fbb4c4a2892961fcbd7e6fc2d2723b4",class:"xpl-input-color__preview",style:{background:`rgba(${t}, ${i}, ${l}, ${h})`}})),e("div",{key:"3a660bdbb902bc8bfddb8c423f2462404b0221b8",class:"xpl-input-color__inputs"},Object.entries(this.colorInputElements).filter((([t])=>["hex","r","g","b","a"].includes(t))).map((([t])=>e("xpl-input",{key:t,label:t.toLocaleUpperCase(),name:`color-${t}-input`,placeholder:"hex"===t?"793EF7":"0",value:this.colorValues[t],ref:e=>{this.colorInputElements[t]=e}})))))))}static get watchers(){return{colorValues:[{valueChanged:0}],hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValuePropChange:0}]}}},q=(t=!1)=>`<svg width="8" height="12" viewBox="0 0 8 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="${t?"M0.557948 5.6813L6.06209 0.132167C6.23831 -0.0440556 6.52327 -0.0440556 6.69949 0.132167L7.44187 0.874551C7.61809 1.05077 7.61809 1.33573 7.44187 1.51195L2.99882 6L7.44187 10.488C7.61809 10.6643 7.61809 10.9492 7.44187 11.1254L6.69949 11.8678C6.52327 12.0441 6.23831 12.0441 6.06209 11.8678L0.557948 6.3187C0.381726 6.14248 0.381726 5.85752 0.557948 5.6813Z":"M7.44187 6.3187L1.93773 11.8678C1.76151 12.0441 1.47655 12.0441 1.30033 11.8678L0.557948 11.1254C0.381726 10.9492 0.381726 10.6643 0.557948 10.488L5.001 6L0.557948 1.51195C0.381726 1.33573 0.381726 1.05077 0.557948 0.874551L1.30033 0.132167C1.47655 -0.0440556 1.76151 -0.0440556 1.93773 0.132167L7.44187 5.6813C7.6181 5.85752 7.6181 6.14248 7.44187 6.3187Z"}" /></svg>`,W=class{constructor(e){t(this,e),this.valueChange=l(this,"valueChange",7),this.hasErrorStateChanged=l(this,"hasErrorStateChanged",7),this.rangeSelected=l(this,"rangeSelected",7),this.dateFormat="Y-m-d",this.mode="single",this.valueChanged=t=>{this.valueChange.emit(t.target.value)}}onHasErrorStateChanged(t){this.hasErrorStateChanged.emit(t)}onValueChanged(t){var e;null===(e=this.flatpickrInstance)||void 0===e||e.setDate(t)}componentDidLoad(){this.flatpickrInstance=r(this.input,{allowInput:!0,dateFormat:this.dateFormat,defaultDate:this.value,maxDate:this.max,minDate:this.min,mode:this.mode,nextArrow:q(),prevArrow:q(!0),onClose:t=>{if(this.hasErrorState=t.length<(this.required?"single"===this.mode?1:2:0)?"required":null,2===t.length){const[e,a]=t;this.rangeSelected.emit({start:e,end:a})}}})}render(){return e(a,{key:"6024246dd7a92cc6396c634e8e87d614b1d860e3",class:{"xpl-input-date":!0,[`xpl-input-date--mode-${this.mode}`]:!0,"xpl-input-date--error":!!this.hasErrorState}},e("div",{key:"0c8fe7b8057715618ae040b64ee2ae6506051200",class:"xpl-input-wrapper"},this.pre&&e("label",{key:"d0d1048313962c7381b9fc4e2d07b107d42f86d1",class:"xpl-input-pre",htmlFor:this.inputId},this.pre),e("input",{key:"3daca1a28baf14701e4b7a9761d2ff91be8dcd96",type:"date",id:this.inputId,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,placeholder:this.placeholder,max:this.max,min:this.min,ref:t=>{this.input=t},onChange:t=>{this.valueChanged(t)}}),e("xpl-icon",{key:"82c57c4694c088debfb710e37bd90b5132fa3339",class:"xpl-input-calendar",icon:"calendar-month",size:24}),this.post&&e("label",{key:"553fa633312ed0adf1fd38352f40142e2b48eeaa",class:"xpl-input-post",htmlFor:this.inputId},this.post)))}static get watchers(){return{hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValueChanged:0}]}}},B=class{constructor(e){t(this,e),this.inputChange=l(this,"inputChange",7),this.accept="",this.multiple=!1,this.hideTriggerOnSelect=!1,this.hideFileNames=!1,this.hideAcceptText=!1,this.files=null,this.openFileDialog=()=>{var t;this.disabled||null===(t=this.fileInput)||void 0===t||t.click()},this.handleFileChange=t=>{this.files=Array.from(t.target.files)},this.onRemoveFileByIndex=t=>{this.files=this.files.filter(((e,a)=>a!==t))}}onFilesChange(t){this.inputChange.emit({type:"file",value:t})}async removeFileByIndex(t){this.onRemoveFileByIndex(t)}render(){var t,i;return e(a,{key:"984964735a57f0c1ae83b7a6e9ad548b8b732694",class:{"xpl-input-file":!0,"xpl-input-file--hide-trigger-on-select":this.hideTriggerOnSelect,"xpl-input-file--disabled":this.disabled}},e("span",{key:"20da96646dda47226058869a6a3c188aa602ae7b",class:{"xpl-input-file__trigger-wrapper":!0,"xpl-input-file__trigger-wrapper--hidden":this.hideTriggerOnSelect&&(null===(t=this.files)||void 0===t?void 0:t.length)>0},role:"button",tabIndex:0,onClick:this.openFileDialog},e("slot",{key:"d6355378f46c6a6edd193839e3ff24bd241db9b6",name:"trigger"})),(null===(i=this.files)||void 0===i?void 0:i.length)>0&&!this.hideFileNames&&e("ul",{key:"48a7c3ff9668c7a7ad3e1f719c05f0439db0eb98",class:"xpl-input-file__file-list"},this.files.map(((t,a)=>e("li",{class:"xpl-input-file__file-item"},e("span",{class:"xpl-text-callout"},t.name),e("xpl-icon",{icon:"x-circle",size:24,onClick:t=>{t.preventDefault(),t.stopPropagation(),this.onRemoveFileByIndex(a)},class:"xpl-input-file__remove-icon"}))))),this.accept&&!this.hideAcceptText&&e("span",{key:"81a892b3c7cac161c4fe893b9e627055d43a13c8",class:"xpl-input-file__accept xpl-text-caption"},"Accepted file types: ",this.accept),e("input",{key:"bb3e89c64ae62748b3e4afd5f80fcede37ae7b3a",onChange:this.handleFileChange,type:"file",ref:t=>{this.fileInput=t},hidden:!0,accept:this.accept,multiple:this.multiple,name:this.name}))}get el(){return i(this)}static get watchers(){return{files:[{onFilesChange:0}]}}};function R(t){const[e,a]=t.split(":"),i=Number(e)>=12?"PM":"AM";return[(Number(e)%12||12).toString(),a,i]}const U=class{constructor(e){t(this,e),this.valueChange=l(this,"valueChange",7),this.hasErrorStateChanged=l(this,"hasErrorStateChanged",7),this.max="23:59",this.min="00:00",this.step=30,this.mode="single",this.timeFormat="24h",this.allowCustomOption=!1,this.showOptions=!1,this.options=[],this.handleInput=t=>{var e;const a=null===(e=t.target.value)||void 0===e?void 0:e.replace(/[^0-9:apmAPM]/g,"");this.value=a},this.handleFocus=()=>{this.showOptions=!0},this.handleBlur=()=>{this.value=function(t){if(!t||""===t.trim()||0===t.replace(/[^0-9]/g,"").length)return null;let e=t.trim().toLowerCase();e=e.replace(/(\d)\s+(am|pm)/g,"$1$2"),/^\d{1,2}(am|pm)?$/.test(e)&&(e=e.replace(/(am|pm)?$/,":00$1")),/^\d{1,2}$/.test(e)&&(e=`${e}:00`),/^\d{1,2}:\d{1}$/.test(e)&&(e=`${e}0`);const[a,i]=e.split(":"),l=i.replace(/[^0-9]/g,""),h=e.includes("am");return e.includes("pm")||h?h?`${(Number(a)%12).toString().padStart(2,"0")}:${l}`:`${Number(a)%12+12}:${l}`:`${a.padStart(2,"0")}:${l}`}(this.value)},this.handleClick=()=>{this.showOptions=!0}}onValueChange(t){this.valueChange.emit(t),this.updateState(t)}updateState(t){this.formattedValue=this.formatDisplayedTime(t),this.amPm=this.formatDisplayedAmPm(t),this.validateValue()}formatDisplayedTime(t){if(!t)return"";if("12h"===this.timeFormat&&t.includes(":")){const[e,a]=R(t);return`${e}:${a}`}return t}formatDisplayedAmPm(t){if(!t||"12h"!==this.timeFormat)return"";const[,,e]=R(t);return e}validateValue(){this.hasErrorState=this.value?!this.value.includes(":")||this.value.trim().length<4||this.value.trim().length>5?"Invalid time format, must be HH:MM":this.value<this.min||this.value>this.max?"Out of range":this.allowCustomOption||this.options.some((t=>t.value===this.value))?null:"Invalid option":this.required?"required":null}onHasErrorStateChanged(t){this.hasErrorStateChanged.emit(t)}componentDidLoad(){var t;"range"===this.mode&&console.warn("Range mode is not supported for time inputs at this time."),null===(t=this.dropdown)||void 0===t||t.addEventListener("isOpenChange",(t=>{this.showOptions=t.detail}))}componentWillLoad(){this.options=this.getOptions(),this.value&&this.updateState(this.value)}getOptions(){return function(t,e,a,i){const l=t=>{const[e,a]=t.split(":").map(Number);return 60*e+a},h=l(e.toString()),s=l(a.toString()),r=[];for(let e=h;e<=s;e+=t)r.push((o=e,`${Math.floor(o/60).toString().padStart(2,"0")}:${(o%60).toString().padStart(2,"0")}`));var o;return r.map((t=>({label:"12h"===i?function(t){const[e,a,i]=R(t);return`${e}:${a} ${i}`}(t):t,value:t})))}(this.step,this.min.toString(),this.max.toString(),this.timeFormat).map((({label:t,value:e})=>({label:t,value:e,onClick:()=>{this.value=e,this.showOptions=!1}})))}render(){return e(a,{key:"99b06c895d608dec6226f79f21ceda92225428b7",class:{"xpl-input-time":!0,[`xpl-input-time--mode-${this.mode}`]:!0,"xpl-input-time--error":!!this.hasErrorState}},e("xpl-input",{key:"8cdf996f46d969c243d246fdfe888c22c9c4999b",pre:e("xpl-icon",{class:"xpl-input-time__clock-icon",icon:"clock",size:24}),post:"12h"===this.timeFormat?this.amPm||"AM":null,type:"text",_id:this.inputId,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,placeholder:this.placeholder,max:this.max,min:this.min,onInput:this.handleInput,value:this.formattedValue,onFocusEvent:this.handleFocus,onBlurEvent:this.handleBlur,onClick:this.handleClick}),!this.readonly&&!this.disabled&&e("xpl-dropdown",{key:"5213fcd68da96d726d8b046277233afd6b5b20e8",options:this.options,isOpen:this.showOptions,ref:t=>{this.dropdown=t},class:"xpl-input-time__dropdown"}))}static get watchers(){return{value:[{onValueChange:0}],hasErrorState:[{onHasErrorStateChanged:0}]}}},K=class{constructor(e){t(this,e),this.modalClosed=l(this,"modalClosed",7),this.isOpen=!1,this.size="medium",this.variant="default",this.handleDialogClose=()=>{this.isOpen=!1,this.modalClosed.emit()},this.handleNativeBackdropClick=t=>{const e=this.dialogElement.getBoundingClientRect();(t.clientX<e.left||t.clientX>e.right||t.clientY<e.top||t.clientY>e.bottom)&&this.handleDialogClose()}}componentDidLoad(){this.dialogElement=this.element.querySelector("dialog"),this.updateModalState(),this.dialogElement.addEventListener("cancel",this.handleDialogClose),this.dialogElement.addEventListener("click",this.handleNativeBackdropClick)}disconnectedCallback(){this.dialogElement&&(this.dialogElement.removeEventListener("cancel",this.handleDialogClose),this.dialogElement.removeEventListener("click",this.handleNativeBackdropClick))}updateModalState(){var t,e;this.isOpen?null===(e=null===(t=this.dialogElement)||void 0===t?void 0:t.showModal)||void 0===e||e.call(t):this.dialogElement&&"function"==typeof this.dialogElement.close&&setTimeout((()=>{var t;null===(t=this.dialogElement)||void 0===t||t.close()}),250)}render(){return e(a,{key:"67a2c3914086a75280693b156c5148a5e86395d2",class:"xpl-modal"},this.isOpen&&e("xpl-backdrop",{key:"e99270d95b4a2267d4fd9c7cbee25672b5f90b7d"}),e("dialog",{key:"3493394ff8f93a8a5fb00903d712dd956b886024",class:`xpl-modal__dialog xpl-modal-size--${this.size} xpl-modal--${this.isOpen?"is-open":"is-closed"}`},e("div",{key:"66731b3fc2b562fd9f013de173dcf808b3f3ff1a",class:"xpl-modal__header"},e("div",{key:"b3a712444c7f3607b5f1bf968f46ac83305f6f1a",class:"xpl-modal__title"},"warning"===this.variant&&e("xpl-icon",{key:"d96d5df9527b0b96fa793025af3dca9956c5a946",size:20,icon:"alert-triangle",class:"xpl-modal__alert-icon"}),e("slot",{key:"3d30207ca82fffa6a7c7d7be42b240dc552ab01d",name:"title"}),e("xpl-button",{key:"34e0247f1f0de686233c95e236457dd170e3b050",type:"button",class:"xpl-modal__close-button",iconOnly:!0,size:"sm",variant:"subtle",onClick:this.handleDialogClose},e("xpl-icon",{key:"d14026b3e17070767fef2d798d5e4406c011dc7d",icon:"x"}))),e("div",{key:"cdacbf1e44ca7c8601ebcbfdce2ac5b6fb7d6489",class:"xpl-modal__subtitle"},e("slot",{key:"2ade6726ee27396a0aa570ef2b0c88be0361eb01",name:"subtitle"}))),e("div",{key:"f016a31264ee6874ddd19e9dcbde3b3f8c76d2ea",class:"xpl-modal__body"},e("slot",{key:"ea6016e3c5733a344f1f427ca07267917f66001e",name:"body"})),e("div",{key:"7e43b4317efd765152cdb3ea804e1fe9b0036bc4",class:"xpl-modal__footer"},e("slot",{key:"410d2ce31eccc7d2bb0c48091b165de2f85f6986",name:"tertiary"}),e("slot",{key:"d2d64c8203c8b942385c26adfe283af76c12afb3",name:"secondary"}),e("slot",{key:"3eb401ad94c36a2aa9f380508c438e5b473020d5",name:"primary"}))))}get element(){return i(this)}static get watchers(){return{isOpen:[{updateModalState:0}]}}},G=class{constructor(e){t(this,e),this.navOpen=l(this,"navOpen",7),this.navControl=!1}onNavToggle(){window.innerWidth<=640&&this.navOpen.emit(!1)}render(){return e(a,{key:"8a047443ba48a7812f3804e5639cdd8408f9a647",class:"xpl-nav-item",role:"listitem",onClick:()=>{this.navControl&&this.onNavToggle()}},e("slot",{key:"41012bd7a72ed7929deddb136ac5f2c6b30a4c1f",name:"link"},e("slot",{key:"ce1bb0b1957b5e614fa1ec65cc8973d42bd1dc32",name:"icon"}),e("slot",{key:"d50d2dd931be394e039f1e07651e05e41231627e"})))}},X=class{constructor(e){t(this,e),this.pageChange=l(this,"pageChange",7),this.rowsPerPageChange=l(this,"rowsPerPageChange",7),this.totalPages=1,this.withPageControl=!1,this.currentPage=1,this.rowsPerPageOptions="10,25,50,100,150",this.selectedRowsPerPage=10,this.rowsPerPageSelectRef=null,this.pageSelectRef=null,this.handleNextPage=()=>{this.currentPage<this.totalPages&&(this.currentPage+=1)},this.handlePrevPage=()=>{this.currentPage>1&&(this.currentPage-=1)},this.handlePageChange=t=>{const e=parseInt(t.detail,10);Number.isNaN(e)||(this.currentPage=e)},this.handleRowsChange=t=>{const e=parseInt(t.detail,10);Number.isNaN(e)||(this.selectedRowsPerPage=e)}}get rowsPerPageOptionsArray(){return this.rowsPerPageOptions.split(",").map(Number)}onPageUpdate(t){t<1?this.currentPage=1:t>this.totalPages&&(this.currentPage=this.totalPages),this.pageChange.emit(this.currentPage)}onRowsPerPageUpdate(t){this.rowsPerPageChange.emit(t)}componentDidLoad(){var t,e;null===(t=this.rowsPerPageSelectRef)||void 0===t||t.addEventListener("changeEvent",this.handleRowsChange),null===(e=this.pageSelectRef)||void 0===e||e.addEventListener("changeEvent",this.handlePageChange)}disconnectedCallback(){var t,e;null===(t=this.rowsPerPageSelectRef)||void 0===t||t.removeEventListener("changeEvent",this.handleRowsChange),null===(e=this.pageSelectRef)||void 0===e||e.removeEventListener("changeEvent",this.handlePageChange)}render(){const t=this.currentPage<=1,i=this.currentPage>=this.totalPages;return e(a,{key:"15d277d40eff79d5fb48867b89370759eb9ca8c7",class:`xpl-pagination xpl-pagination__${this.withPageControl?"with":"no"}-page-control`},this.withPageControl&&e("div",{key:"482bbca4e67c513f715573343f4f2d0f0a7281ee",class:"xpl-pagination__rows-per-page"},e("label",{key:"5a6b3a0f06e6b37b3e6f17021417bac5ce866a69",class:"xpl-pagination__rows-label"},"Rows per page:"),e("xpl-select",{key:"295db6e36fcf861ffd4f25550322552c6641084c",class:"xpl-pagination__rows-per-page-select",choices:this.rowsPerPageOptionsArray.map((t=>({label:t.toString(),value:t.toString(),isSelected:t===this.selectedRowsPerPage}))),ref:t=>{this.rowsPerPageSelectRef=t}})),e("div",{key:"87c7b3e4bf11be1668512f325139899496f2dd7a",class:"xpl-pagination__pager"},e("button",{key:"c020001ed61d227b9febd71bb9e411b3eeead985",class:"xpl-pagination__pager-button xpl-pagination__pager-button-prev",disabled:t,onClick:this.handlePrevPage,"aria-label":"Previous Page",tabindex:"0"},e("xpl-icon",{key:"3484457471eb692e3dc140b47f6d8bfd72899fe3",icon:"arrow-left",size:20})),e("xpl-select",{key:"f0897900308b3015db171f6b60382dd537f9dd71",class:"xpl-pagination__page-select",choices:Array.from({length:this.totalPages},((t,e)=>({label:`Page ${e+1}`,value:(e+1).toString(),isSelected:e+1===this.currentPage}))),"custom-display-value":!0,ref:t=>{this.pageSelectRef=t}},e("div",{key:"4c2184875c70ceac615c6efd05ef32f65d777152",slot:"custom-display-value"},`${this.currentPage} of ${this.totalPages}`)),e("button",{key:"91c856b44bf3b752280b36f69a53d4c2ed97da19",class:"xpl-pagination__pager-button xpl-pagination__pager-button-next",disabled:i,onClick:this.handleNextPage,"aria-label":"Next Page",tabindex:"0"},e("xpl-icon",{key:"538a33cbddd6d4e26b782e0a3178018b61f0dec4",icon:"arrow-right",size:20}))))}static get watchers(){return{currentPage:[{onPageUpdate:0}],selectedRowsPerPage:[{onRowsPerPageUpdate:0}]}}};var Y,J,Q=M(function(){if(J)return Y;J=1;var t="Expected a function",e=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,l=/^0o[0-7]+$/i,h=parseInt,s="object"==typeof self&&self&&self.Object===Object&&self,r="object"==typeof z&&z&&z.Object===Object&&z||s||Function("return this")(),o=Object.prototype.toString,d=Math.max,c=Math.min,n=function(){return r.Date.now()};function p(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function C(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==o.call(t)}(t))return NaN;if(p(t)){var s="function"==typeof t.valueOf?t.valueOf():t;t=p(s)?s+"":s}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(e,"");var r=i.test(t);return r||l.test(t)?h(t.slice(2),r?2:8):a.test(t)?NaN:+t}return Y=function(e,a,i){var l=!0,h=!0;if("function"!=typeof e)throw new TypeError(t);return p(i)&&(l="leading"in i?!!i.leading:l,h="trailing"in i?!!i.trailing:h),function(e,a,i){var l,h,s,r,o,f,u=0,b=!1,m=!1,v=!0;if("function"!=typeof e)throw new TypeError(t);function g(t){var a=l,i=h;return l=h=void 0,u=t,r=e.apply(i,a)}function w(t){var e=t-f;return void 0===f||e>=a||e<0||m&&t-u>=s}function y(){var t=n();if(w(t))return k(t);o=setTimeout(y,function(t){var e=a-(t-f);return m?c(e,s-(t-u)):e}(t))}function k(t){return o=void 0,v&&l?g(t):(l=h=void 0,r)}function x(){var t=n(),e=w(t);if(l=arguments,h=this,f=t,e){if(void 0===o)return function(t){return u=t,o=setTimeout(y,a),b?g(t):r}(f);if(m)return o=setTimeout(y,a),g(f)}return void 0===o&&(o=setTimeout(y,a)),r}return a=C(a)||0,p(i)&&(b=!!i.leading,s=(m="maxWait"in i)?d(C(i.maxWait)||0,a):s,v="trailing"in i?!!i.trailing:v),x.cancel=function(){void 0!==o&&clearTimeout(o),u=0,l=f=h=o=void 0},x.flush=function(){return void 0===o?r:k(n())},x}(e,a,{leading:l,maxWait:a,trailing:h})}}());const tt=class{constructor(e){t(this,e),this.isOpenChange=l(this,"isOpenChange",7),this.isOpen=!1,this.disabled=!1,this.position="bottom-middle",this.display="arrow",this.isOpenState=this.isOpen,this.actualPosition=this.position,this.togglePopover=()=>{this.disabled||(this.isOpenState=!this.isOpenState)},this.handleKeyDown=t=>{"Escape"===t.key&&this.isOpenState&&(this.isOpenState=!1)},this.handleClickOutside=({target:t})=>{!this.el.contains(t)&&this.isOpenState&&(this.isOpenState=!1)}}onIsOpenPropChange(t){this.isOpenState=t}onIsOpenStateChange(t){this.updateActualPosition(t),this.isOpenChange.emit(t)}updateActualPosition(t){if(!this.triggerRef||!this.contentRef||!t)return;const e={"top-left":["top-left","bottom-left","top-right","bottom-right","top-middle","bottom-middle"],"bottom-left":["bottom-left","top-left","bottom-right","top-right","bottom-middle","top-middle"],"top-right":["top-right","bottom-right","top-left","bottom-left","top-middle","bottom-middle"],"bottom-right":["bottom-right","top-right","bottom-left","top-left","bottom-middle","top-middle"],"middle-left":["middle-left","middle-right","bottom-left","top-left","bottom-middle","top-middle"],"middle-right":["middle-right","middle-left","bottom-right","top-right","bottom-middle","top-middle"],"top-middle":["top-middle","top-start","top-end","bottom-middle","top-left","top-right"],"bottom-middle":["bottom-middle","bottom-start","bottom-end","top-middle","bottom-left","bottom-right"],"top-start":["top-start","bottom-start","top-end","bottom-end","top-middle","bottom-middle"],"top-end":["top-end","bottom-end","top-start","bottom-start","top-middle","bottom-middle"],"bottom-start":["bottom-start","top-start","bottom-end","top-end","bottom-middle","top-middle"],"bottom-end":["bottom-end","top-end","bottom-start","top-start","bottom-middle","top-middle"]}[this.position].find((t=>{const{top:e,left:a,bottom:i,right:l}=this.triggerRef.getBoundingClientRect(),{width:h,height:s}=this.contentRef.getBoundingClientRect(),{innerWidth:r,innerHeight:o}=window,d=i+s<o,c=e-s>=0,n=a-h>=0,p=l+h<r,C=(e+i)/2,f=t=>t&&C-s/2>=0&&C+s/2<=o,u=(a+l)/2,b=t=>t&&u-h/2>=0&&u+h/2<=r,m=a+h<r,v=l-h>=0;switch(t){case"top-left":return d&&n;case"middle-left":return f(n);case"bottom-left":return c&&n;case"top-right":return d&&p;case"middle-right":return f(p);case"bottom-right":return c&&p;case"top-middle":return b(c);case"bottom-middle":return b(d);case"top-start":return c&&m;case"top-end":return c&&v;case"bottom-start":return d&&m;case"bottom-end":return d&&v;default:return!1}}))||this.position;this.actualPosition=e}connectedCallback(){document.addEventListener("mousedown",this.handleClickOutside.bind(this)),document.addEventListener("keydown",this.handleKeyDown),this.updateListener=Q((()=>{this.updateActualPosition(this.isOpenState)})),["resize","scroll"].forEach((t=>{window.addEventListener(t,this.updateListener,{passive:!0})}))}disconnectedCallback(){document.removeEventListener("mousedown",this.handleClickOutside),document.removeEventListener("keydown",this.handleKeyDown),["resize","scroll"].forEach((t=>{window.removeEventListener(t,this.updateListener)}))}render(){return e(a,{key:"cf6c4f6b028bfdb9d08f6c8ad2b433c38c1a6f9f"},e("div",{key:"778f9a2f3a5626b19f5446c56d89f9bb6b31ca36",class:{"xpl-popover":!0,[`xpl-popover--${this.actualPosition}`]:!0,"xpl-popover--is-open":this.isOpenState}},e("span",{key:"762401eb1e8d30644dfb55e10f4f5f56abff648f",role:"button",tabindex:"0","aria-haspopup":"dialog","aria-expanded":this.isOpenState?"true":"false",onClick:this.togglePopover,ref:t=>{this.triggerRef=t}},e("slot",{key:"c29166383d024f24d6883ff0d4ea85380f849712",name:"trigger"})),"arrow"===this.display&&e("div",{key:"ef7eb85bc764ab403fc4b069a50606da16e3fcdc",class:"xpl-popover__arrow"},e("svg",{key:"32bc234f1dbc9b07b3b3e2b69e5be222bab02a26",width:"17",height:"14",xmlns:"http://www.w3.org/2000/svg"},e("path",{key:"d34ec2d2b3e67459981f29ce21810f1fb6b7ba45",d:"M0 5h15l-7.5 7.5L0 5Z",fill:"white",stroke:"none",class:"arrow-fill"}),e("path",{key:"f251a3f748c9d4eb5d84d6416dd0121b3365000b",d:"M0 5 L7.5 12.5 L15 5",fill:"none",stroke:"black","stroke-width":"1",class:"arrow-stroke"}))),e("div",{key:"02632fb4c284db5eabce50f4c27079ba37e10204",class:{"xpl-popover__content":!0,[`xpl-popover__content--display-${this.display}`]:!0},ref:t=>this.contentRef=t},e("slot",{key:"770df2750d5d4875d38eb52bb26788095ce7292d"}))))}get el(){return i(this)}static get watchers(){return{isOpen:[{onIsOpenPropChange:0}],isOpenState:[{onIsOpenStateChange:0}]}}},et=class{constructor(e){t(this,e),this.currentStep=0}getCircleClass(t){return this.currentStep<t?"":this.currentStep===t?"xpl-progress-step-active":"xpl-progress-step-finished"}render(){return e(a,{key:"573fca634dcf64084cd74f243a52a978c55478d5",class:"xpl-progress"},e("div",{key:"e0bb02b55c6676bed131397188ffa0074dba71ef",class:"xpl-progress-container"},(this.steps||[]).map(((t,a)=>e("div",{class:`xpl-progress-step ${this.getCircleClass(a)}`},e("div",{class:"xpl-progress-step-content"},e("div",{class:"xpl-progress-step-circle"},a+1),e("div",{class:"xpl-progress-step-text"},t)))))))}},at=class{constructor(e){t(this,e),this.radioChange=l(this,"radioChange",7),this.id=s(),this.onChange=t=>{this.radioChange.emit(this.value?this.value:t.target.checked)}}render(){return e(a,{key:"cc375ac47add5a4fddc8744186d1600431cb998d",class:{"xpl-checkbox-radio-container":!0,styled:this.styled,disabled:this.disabled}},e("input",{key:"ccc9a14ec86cf5d455558298f367dd1eb2835399",class:"xpl-radio",type:"radio",checked:this.checked,disabled:this.disabled,id:this.id,name:this.name,required:this.required,onChange:this.onChange,value:this.value}),e("label",{key:"5c0661fded4424d6b758ef55953cfde8da1f2af5",class:{"xpl-label":!0,"xpl-label--disabled":this.disabled},htmlFor:this.id},e("slot",{key:"9e203d6010f049c74294f543c75b091c129a323d"}),this.description&&e("small",{key:"15447fa65dff82fda1cb7981bbf3160b7f526c53",class:{"xpl-description":!0,"xpl-description--disabled":this.disabled}},this.description)))}},it=class{constructor(e){t(this,e)}render(){return e(a,{key:"86273edf300aa07f9d95d602eba079a3e5585d63",class:"xpl-secondary-nav"},e("nav",{key:"1756c028fe605e00683b6fa07e7235a6e18c1f68","aria-label":"Secondary Nav"},e("slot",{key:"74d5e209c31456877c40267d16d4020faac7ca33"})))}};function lt(t){return t.label||t.value}function ht(t){return t.reduce(((t,e)=>[...t,...e.groupName?e.options:[e]]),[])}const st=class{constructor(e){t(this,e),this.selectChange=l(this,"selectChange",7),this.changeEvent=l(this,"changeEvent",7),this.dropdownStateChange=l(this,"dropdownStateChange",7),this.triggerDropdown=l(this,"triggerDropdown",7),this.choices=[],this.selectIcon="chevron-down",this.mode="single",this.truncate=!0,this.active=!1,this.id=s(),this.keepFocus=!1,this.visibleChoices=1/0,this.choicesState=[],this.value=this.calculateValue(),this.dropdownOpenState=!1,this.container=null,this.dropdown=null,this.handleResizeThrottled=Q((()=>{this.maybeTruncateChoices()}),250),this.handleTabKeyDown=t=>{"Tab"===t.key&&(this.keepFocus=!0)},this.handleTagRemove=t=>{const e=e=>(null==t?void 0:t.value)&&e.value===t.value||(null==t?void 0:t.label)&&e.label===t.label;this.choicesState=this.choicesState.map((t=>{var a;return Object.assign(Object.assign({},t),{isSelected:!e(t)&&t.isSelected,options:null===(a=t.options)||void 0===a?void 0:a.map((t=>Object.assign(Object.assign({},t),{isSelected:!e(t)&&t.isSelected})))})}))},this.handleDropdownScroll=t=>{const{scrollTop:e,scrollHeight:a,clientHeight:i}=this.dropdown.querySelector(".xpl-dropdown-list");(0===e&&t.deltaY<0||e+i>=a&&t.deltaY>0)&&t.preventDefault()}}onChoicesPropChanged(t){this.choicesState=this.initializeChoicesState()}onSelectedValuesPropChanged(){this.choicesState=this.initializeChoicesState()}onChoicesStateChanged(){this.update()}handleValueStateChange(t){this.selectChange.emit(t),this.changeEvent.emit("single"===this.mode?t:(null==t?void 0:t.length)?t.split("|"):[]),this.customDisplayValue&&null!==this.container&&(this.container.querySelectorAll(".custom-display-value").forEach((e=>{e.classList.toggle("display-active",t.length>0),e.classList.toggle("display-inactive",0===t.length)})),this.container.querySelectorAll(".placeholder").forEach((e=>{e.classList.toggle("placeholder-hidden",t.length>0)})))}onDropdownOpenStateChanged(t){this.dropdownStateChange.emit(t)}initializeChoicesState(){return this.choices.map((t=>{var e;const a="string"==typeof this.selectedValues?[this.selectedValues]:this.selectedValues;return Object.assign(Object.assign({},t),{isSelected:t.isSelected||(null==a?void 0:a.includes(t.value||t.label)),options:null===(e=t.options)||void 0===e?void 0:e.map((t=>Object.assign(Object.assign({},t),{isSelected:t.isSelected||(null==a?void 0:a.includes(t.value||t.label))})))})}))}maybeTruncateChoices(){var t,e;if("single"===this.mode||!this.truncate)return;const a=null===(t=this.container)||void 0===t?void 0:t.getBoundingClientRect().width;let i=0,l=0;const h=null===(e=ht(this.choicesState))||void 0===e?void 0:e.filter((t=>t.isSelected));if(!h.length)return;const s=h.length;h.forEach(((t,e)=>(l+=function(t){const e=document.createElement("canvas").getContext("2d");return e.font="14px apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif",e.measureText(t).width+44}(lt(h[e])),l>a-140||(i+=1),null))),i>=s&&(i=1/0),i<1&&(i=1),this.visibleChoices=i}closeDropdown(){var t;(null===(t=this.dropdown)||void 0===t?void 0:t.isOpen)&&(this.dropdown.isOpen=!1,this.active=!1)}calculateValue(){const t=ht(this.choicesState).filter((t=>t.isSelected));return t.length?"single"===this.mode?t[0].value||t[0].label:t.map((t=>t.value||t.label)).join("|"):""}update(){this.value=this.calculateValue(),this.maybeTruncateChoices()}renderLabel(){return this.label||this.description?e("label",{class:{"xpl-label":!0,"xpl-label--disabled":this.disabled},htmlFor:this.id},this.label,this.description&&e("small",{class:{"xpl-description":!0,"xpl-description--disabled":this.disabled}},this.description)):null}renderSelectedTags(){let t=0;const a=ht(this.choicesState).filter((t=>t.isSelected));return a.length?a.map(((i,l)=>t>=this.visibleChoices?null:(t+=1,e("xpl-tag",{onClose:()=>this.handleTagRemove(a[l])},lt(a[l]))))):null}renderError(){return this.error?e("label",{class:"xpl-input-error",htmlFor:this.id},e("xpl-icon",{icon:"alert-circle"}),this.error):null}componentWillLoad(){this.choicesState=this.initializeChoicesState()}handleClickEvent(t){const e=t.target.closest(".xpl-select");null!==e&&e===this.container||this.closeDropdown()}handleKeyDown(t){var e;"Escape"===t.key&&(this.active||(null===(e=this.container)||void 0===e?void 0:e.contains(document.activeElement)))&&this.closeDropdown()}handleResize(){this.handleResizeThrottled()}componentDidLoad(){requestAnimationFrame((()=>{this.maybeTruncateChoices()}))}disconnectedCallback(){var t;null===(t=this.handleResizeThrottled)||void 0===t||t.cancel()}handleDropdownTrigger(){var t;const e=null!==(t=this.dropdown.isOpen)&&void 0!==t&&t,a=!e;this.triggerDropdown.emit({prevState:e,nextState:a}).defaultPrevented||this.disabled||(this.dropdownOpenState=a,this.dropdown.isOpen=a)}async reset(){this.closeDropdown(),this.choicesState=this.choicesState.map((t=>{var e;return Object.assign(Object.assign({},t),{isSelected:!1,options:null===(e=t.options)||void 0===e?void 0:e.map((t=>Object.assign(Object.assign({},t),{isSelected:!1})))})}))}render(){var t,i,l,s;const r=ht(this.choicesState).filter((t=>t.isSelected)),o=(null===(t=r[0])||void 0===t?void 0:t.label)||(null===(i=r[0])||void 0===i?void 0:i.value),d=r.length>1&&this.visibleChoices<1/0&&this.truncate&&!this.customDisplayValue,c=`+ ${Math.abs(this.choicesState.filter((t=>t.isSelected)).length-this.visibleChoices)} more`;return e(a,{key:"dd41611f279bfdf8ca7bf3673ff0e4421c9adbd5",class:{"xpl-select":!0,"xpl-select--disabled":this.disabled,"xpl-select--no-truncate":!this.truncate,[null!==(l=this.classNames)&&void 0!==l?l:""]:!!this.classNames},onKeyDown:this.handleTabKeyDown,ref:t=>{this.container=t}},this.renderLabel(),e("div",{key:"8579aece1497e108177fab248d7dd0bcd4baadf3",class:{"xpl-input":!0,"xpl-input--disabled":this.disabled,"xpl-input--error":(null===(s=this.error)||void 0===s?void 0:s.length)>=0}},e("div",{key:"7a2f274cffcbb2c97acd96244290494568fdbbc9",class:"xpl-input-wrapper"},e("button",{key:"332b3c6a714bb6f30a20f42e129b2f1ef78dda2d",class:"xpl-select__trigger",disabled:this.disabled,id:this.id,onKeyDown:this.handleTabKeyDown,onClick:t=>{t.preventDefault(),this.handleDropdownTrigger()},type:"button"},e("div",{key:"ecb836e8d199e36d455f477fd9be38103b6e2ac6",class:{"xpl-select-value":!0,"xpl-select-value--active":"multi"===this.mode&&this.value.length>0,"has-value":this.value.length>0}},(()=>this.customDisplayValue?e(h,null,e("div",{class:{"custom-display-value":!0,"custom-display-value--inactive":0===this.value.length}},e("slot",{name:"custom-display-value"})),e("span",{class:{"xpl-placeholder--hidden":this.value.length>0}},this.placeholder)):"single"===this.mode?o||this.placeholder:this.value.length>0?this.renderSelectedTags():this.placeholder)(),d&&c),e("xpl-icon",{key:"46d0759da7e730e00d6eb4839ba2eda1e711dd59",class:"xpl-select__chevron-down",icon:this.selectIcon}))),!this.disabled&&e("xpl-dropdown",{key:"4ac71c53ae935940c5de9d4c65034b0bf312da79",ref:t=>{this.dropdown=t},isOpen:this.dropdownOpenState,options:this.choicesState,selectedValues:this.selectedValues,mode:this.mode,triggerId:this.id,update:(t,{component:e})=>{const{options:a}=e;a&&a.length>0&&(this.choicesState=a)},onIsOpenChange:t=>{this.dropdownOpenState=t.detail},onWheel:this.handleDropdownScroll,anchorToTrigger:!0}),this.renderError()),e("input",{key:"d80e5ab1219e98130e4c38264a711839d4d9668f",type:"hidden",name:this.name,value:this.value}))}static get watchers(){return{choices:[{onChoicesPropChanged:0}],selectedValues:[{onSelectedValuesPropChanged:0}],choicesState:[{onChoicesStateChanged:0}],value:[{handleValueStateChange:0}],dropdownOpenState:[{onDropdownOpenStateChanged:0}]}}},rt=class{constructor(e){t(this,e),this.shape="rectangle",this.size="custom"}render(){return e(a,{key:"018d8ef69972d40fa84fd700ca778862f762b699",class:{"xpl-skeleton":!0,[`xpl-skeleton--shape-${this.shape}`]:!0,[`xpl-skeleton--size-${this.size}`]:!0,[this.classNames]:!!this.classNames,"xpl-skeleton--full-width":this.fullWidth},style:{width:this.width||void 0,height:this.height||void 0,margin:this.margin||void 0}})}},ot=class{constructor(e){t(this,e),this.isOpenChange=l(this,"isOpenChange",7),this.isOpen=!1,this.backdrop=!1,this.variant="default",this.showFooter=!0,this.handleClose=()=>{this.isOpen=!1}}watchPropHandler(t){this.isOpen=t,this.isOpenChange.emit(t)}handleScroll(){const t=this.el.querySelector(".content");t.scrollHeight>t.clientHeight?t.classList.add("has-shadow"):t.classList.remove("has-shadow")}componentDidLoad(){this.handleScroll()}render(){return e(a,{key:"d38f708c91ffd96369e5277b9e4d5c74e52a41d4",class:"xpl-slideout"},this.backdrop&&this.isOpen&&e("xpl-backdrop",{key:"8cfea9e2d270e84783f99db0b12b2749a829ff8a",onClick:this.handleClose}),e("aside",{key:"8b3a24dccbb44c281bad35ab8d2af895bde56d10",class:`slideout slideout--${!this.isOpen&&"closed"}`},e("header",{key:"921acd55e9aedcd5c04d2d6d4f2d26515ec744b8",class:"header"},e("div",{key:"dd434e7a1b5d28aa0833979f8d515df28ad00cc9",class:"title"},e("slot",{key:"9743e88555558ec66e46528b04d6f6391d1bd8df",name:"title"}),e("xpl-button",{key:"7b7b267fa892363d0d25af419bdaa55dd5a362ef",class:"close-button",iconOnly:!0,size:"sm",variant:"subtle",onClick:this.handleClose},e("xpl-icon",{key:"d27bd1de9864fbc6b72f1b71658ece1f5dfeddc9",icon:"x"}))),e("div",{key:"3183410cecb0973d8b7dca3997e1f6c254d28892",class:"subtitle"},e("slot",{key:"6dd1fbcdd15fde802a316053b19566c618f41dd0",name:"subtitle"})),e("div",{key:"b3c4a050275de296b43dc7d9e87bcc082c7f14ec",class:"search"},e("slot",{key:"c6f0ef04a753cb71da97021caa791ded9e2e0533",name:"search"}))),e("xpl-divider",{key:"68301c3540651d6d0dc2e9577d8fc6d2e5e9f536",tier:0,class:"divider top"}),e("article",{key:"eff6e4e81dfe48a9bf2f59d5f5ca09c5f56e6491",class:"content",tabIndex:0},e("slot",{key:"f3f25c5b51ae017cb6f84ea0f1c14329ba429adb",name:"content"})),this.showFooter&&e("footer",{key:"6e94107fefc5e2e24edb21f61b0e4af32c954445"},e("xpl-divider",{key:"89c550dbb352c6b22534edf7ff3a0e8d0513a206",tier:0,class:"divider bottom"}),e("div",{key:"32fe00b37f65ef0b1ba42bf8e7d8f59dfec7aa68",class:"footer"},e("slot",{key:"f42ee4c847be0ab553d039bc0ce50e29e70984fa",name:"tertiary"}),e("slot",{key:"dd6b8757bcd85dd79a084d3ec0bbbfd6629297bb",name:"secondary"}),e("slot",{key:"e6d4fea0d1ebfa7bd71fce313dee34b25f164b0c",name:"primary"})))))}get el(){return i(this)}static get watchers(){return{isOpen:[{watchPropHandler:0}]}}},dt=class{constructor(e){t(this,e),this.tabChange=l(this,"tabChange",7),this.selected=!1,this.handleTabClick=()=>{this.tabChange.emit(this.target)}}render(){return e(a,{key:"3f1eaa197c02b1bb45da97e59a58aeea9f86bc6f",class:{"xpl-tab":!0,"xpl-tab--selected":this.selected}},e("button",{key:"12066216ecbc4fa91c7645b45e4affce20342e4b",onClick:this.handleTabClick,class:"xpl-tab__button",role:"tab","aria-controls":this.target},e("slot",{key:"bbe6f9c862510aa83d4816fc7366e82ac10cf266"})))}},ct=class{constructor(e){t(this,e),this.selected=!1}render(){return e(a,{key:"f22da3feed8a64baae080a1593ea35c68d41f857",class:{"xpl-tab-panel":!0,"xpl-tab-panel--selected":this.selected},role:"tabpanel","aria-labelledby":this.target},e("slot",{key:"88311f1af38490ec1b3ba8aee8f1bb39d58cfd11"}))}},nt=class{constructor(e){t(this,e),this.tableSelect=l(this,"tableSelect",7),this.sortChanged=l(this,"sortChanged",3),this.selectedValues=[],this.isSortable=!1,this.sortableColumns=[],this.areAllSelected=!1,this.hasScrolled=!1,this.sortTypeArray=[],this.selectAllValue=Math.random().toString(36).slice(2),this.selectAll=t=>{const{target:e}=t;if(!(e instanceof HTMLInputElement))return;const{checked:a}=e;this.areAllSelected=a,this.selected=this.selectedValues.length>0?Array.from(this.el.querySelectorAll("tbody td:first-child input")).map((t=>a?null==t?void 0:t.value:a)):this.selected.map((()=>a)),this.onChange()},this.selectOne=(t,e)=>{const{target:a}=t;if(!(a instanceof HTMLInputElement))return;const{checked:i,value:l}=a;this.areAllSelected=!1,this.selected=this.selected.map(((t,a)=>a!==e?t:this.selectedValues.length>0&&i?l:i)),this.onChange()},this.onChange=()=>{this.tableSelect.emit({selected:this.selected,areAllSelected:this.areAllSelected})},this.onScroll=()=>{this.hasScrolled=this.container.scrollLeft>0},this.sortBy=(t,e)=>{const a=(e,a)=>e[t].toLocaleLowerCase()<a[t].toLocaleLowerCase()?-1:e[t].toLocaleLowerCase()>a[t].toLocaleLowerCase()?1:0;switch(e[t]){case"asc":this.rowData.sort(((t,e)=>a(t,e)));break;case"desc":this.rowData.sort(((t,e)=>a(e,t)));break;default:this.rowData=this.data,this.sortTypeArray[t]=null}this.rowData=Array.from(this.rowData),this.render()},this.setData=()=>{this.rowData=void 0!==this.data?Array.from(this.data):[]},this.setFooterData=()=>{this.rowFooterData=void 0!==this.footer?Array.from(this.footer):[]}}handleSort(t,e,a,i){t.preventDefault(),t.stopPropagation(),e&&(this.sortTypeArray=this.sortTypeArray.map(((t,e)=>{if(e!==a)return null;switch(t){case"asc":return"desc";case"desc":return null;default:return"asc"}})),this.sortChanged.emit({colNum:a,colName:i,sortTypeArr:this.sortTypeArray}).defaultPrevented||this.sortBy(a,this.sortTypeArray))}watchData(){this.setData()}watchFooterData(){this.setFooterData()}watchColumns(){this.sortTypeArray=this.columns?this.columns.map((()=>null)):[]}componentWillLoad(){this.areAllSelected=!1,this.setData(),this.setFooterData(),this.selected=new Array(this.rowData.length).fill(!1),this.sortTypeArray=this.columns?this.columns.map((()=>null)):[]}render(){var t;return!this.columns||this.sortTypeArray&&this.sortTypeArray.length===this.columns.length||(this.sortTypeArray=this.columns.map((()=>null))),e(a,{key:"3ac2c96a4d691a8e60a2f0f5732787a4dd43e71e"},e("div",{key:"242225267bf912ae46cf38dd1750dcd66fa627f7",class:"xpl-table-container",onScroll:this.onScroll,ref:t=>{this.container=t}},e("table",{key:"76f22b451b7d09f2843d1afc063f8e287afb419f",class:{"xpl-table":!0,"xpl-table--striped":this.striped,"xpl-table--freeze":this.freeze,"xpl-table--has-scrolled":this.hasScrolled}},this.columns&&e("thead",{key:"be12e8292faf5be828c281e3c7d5396652c7e4b8"},this.columns.map(((t,a)=>{var i;const l=(t=>{switch(t){case"asc":return"arrow-up";case"desc":return"arrow-down";default:return"dash"}})(null===(i=this.sortTypeArray)||void 0===i?void 0:i[a]),h=!(!this.isSortable||!this.sortableColumns[a]);return e("th",null,e("label",{onClick:e=>this.handleSort(e,h,a,t.replace(/ /g,"-").toLowerCase()),class:h?"cursor-pointer":""},this.multiselect&&0===a&&e("input",{checked:this.areAllSelected,id:"__xpl-table-th",indeterminate:!this.areAllSelected&&this.selected.some((t=>t)),onClick:t=>{t.stopPropagation(),this.selectAll(t)},type:"checkbox",value:`select-all-${this.selectAllValue}`}),t,h&&!!this.sortTypeArray[a]&&e("xpl-icon",{icon:l,size:16})))}))),e("tbody",{key:"94c5ad3a68f1cffa73a55bb106e81c8899ddc2c4"},this.rowData.map(((t,a)=>e("tr",{class:this.selected&&this.selected[a]?"xpl-table-row-selected":""},t.map(((t,i)=>e("td",null,this.multiselect&&0===i?e("label",{htmlFor:`__xpl-table-row-${a}`},e("input",{id:`__xpl-table-row-${a}`,checked:!!this.selected[a],type:"checkbox",onChange:t=>this.selectOne(t,a),value:this.selectedValues.length>0?this.selectedValues[a]:`xpl-table-checkbox-${a}`}),e("div",{innerHTML:t})):e("div",{innerHTML:t})))))))),(null===(t=this.rowFooterData)||void 0===t?void 0:t.length)>0&&e("tfoot",{key:"2bcfdfed0e5709f60f4beec7f8f58038899b8b30"},this.rowFooterData.map((t=>e("tr",null,t.map((t=>e("td",null,e("div",{innerHTML:t})))))))))))}get el(){return i(this)}static get watchers(){return{data:[{watchData:0}],footer:[{watchFooterData:0}],columns:[{watchColumns:0}]}}},pt=class{constructor(e){t(this,e),this.tabChange=l(this,"tabChange",7),this.fullWidth=!1,this.selectedValue=this.getDefaultValue(),this.activeBarPosition={left:0,width:0},this.isMobileSelectChange=!1,this.tabHeadings=[],this.tabPanels=[],this.handleTabChange=t=>{this.updateTabsSelectedState(t)}}onWindowResize(){this.updateActiveBarPosition()}getDefaultValue(){var t,e;return this.value||(null===(e=null===(t=this.tabHeadings)||void 0===t?void 0:t[0])||void 0===e?void 0:e.getAttribute("target"))||""}updateActiveBarPosition(){const t=this.tabHeadings.find((t=>t.getAttribute("target")===this.selectedValue));if(!this.headingsContainerRef||!t)return;const e=t.getBoundingClientRect(),a=this.headingsContainerRef.getBoundingClientRect();this.activeBarPosition={left:e.left-a.left,width:e.width}}updateTabsSelectedState(t){this.tabHeadings.forEach((e=>{t===e.getAttribute("target")?e.setAttribute("selected",""):e.removeAttribute("selected")})),this.tabPanels.forEach((e=>{t===e.getAttribute("target")?e.setAttribute("selected",""):e.removeAttribute("selected")})),requestAnimationFrame((()=>{this.selectedValue=t,this.updateActiveBarPosition()}))}collectTabs(){this.tabHeadings=Array.from(this.el.querySelectorAll("xpl-tab")),this.tabPanels=Array.from(this.el.querySelectorAll("xpl-tab-panel")),this.handleTabChange(this.getDefaultValue())}renderChoices(){return this.tabHeadings.map((t=>{var e,a;return{label:Array.from(null!==(a=null===(e=t.querySelector(".xpl-tab__button"))||void 0===e?void 0:e.childNodes)&&void 0!==a?a:[]).filter((t=>t.nodeType===Node.TEXT_NODE)).map((t=>t.textContent.trim())).join(" "),value:t.getAttribute("target")}}))}connectedCallback(){"undefined"!=typeof MutationObserver&&(this.observer=new MutationObserver((()=>{this.collectTabs()})),this.observer.observe(this.el,{childList:!0,subtree:!0}))}disconnectedCallback(){var t;null===(t=this.observer)||void 0===t||t.disconnect()}componentDidLoad(){this.collectTabs()}render(){return e(a,{key:"c6858318e3adea4fb9a5587d16aff2778a69af0d",class:{"xpl-tabs":!0,"xpl-tabs--full-width":this.fullWidth}},e("xpl-select",{key:"f6e67e41dc20da4bd6c3d9d4b60045e0e55c7343",classNames:"xpl-tabs__mobile-select",choices:this.renderChoices(),selectedValues:this.selectedValue,onDropdownStateChange:t=>{t.detail&&(this.isMobileSelectChange=!0)},onChangeEvent:t=>{if(this.isMobileSelectChange){const e=t.detail.toString();this.handleTabChange(e),this.tabChange.emit(e),this.isMobileSelectChange=!1}}}),e("nav",{key:"297eb4c0695adf1bea03de7e6874a0b61e108319",class:"xpl-tabs__headings",role:"tablist",ref:t=>{this.headingsContainerRef=t},onTabChange:t=>{this.isMobileSelectChange=!1,this.handleTabChange(t.detail)}},e("div",{key:"cd60b8acf47bb319bc92852d5f62ba456acee6f0",class:"xpl-tabs__active-bar",style:{transform:`translateX(${this.activeBarPosition.left}px)`,width:`${this.activeBarPosition.width}px`}}),e("slot",{key:"a4b73230bfc7178381780a5136a5c1d820be7d65",name:"heading"})),e("div",{key:"e5d4cf94e1c75dabe73d8a5cc2d00cc97466f1b2",class:"xpl-tabs__panels"},e("slot",{key:"e3d2fbfed0ebc74f2fc41f74574e202e834e2129",name:"panel"})))}get el(){return i(this)}static get watchers(){return{value:[{updateTabsSelectedState:0}]}}},Ct=class{constructor(e){t(this,e),this.close=l(this,"close",7)}render(){return e(a,{key:"4a5d37bbd7458d289bf7ea272bd3f944e5f1f1a8",class:"xpl-tag-container"},e("button",{key:"65701bf44741a791ab8d60db2de0f3308c83df33",class:"xpl-tag",onClick:()=>{this.close.emit()}},e("slot",{key:"bd3a1e0af2dbfbc70e18082a1cd0c02710f6ef26"})),e("button",{key:"13224cc6cc44e1c4ed9515019906ba3217edffd7",class:"xpl-tag__close",onClick:()=>{this.close.emit()}},"×"))}},ft=class{constructor(a){t(this,a),this.variant="neutral",this.showIcon=!0,this.dismissable=!0,this.timeout=8e3,this.handleAnimationEnd=()=>{var t,e;(null===(t=this.el)||void 0===t?void 0:t.classList.contains("xpl-toast--dismissed"))&&(null===(e=this.el)||void 0===e||e.remove())},this.getIcon=()=>{switch(this.variant){case"warning":return e("xpl-icon",{size:24,icon:"alert-hex"});case"success":return e("xpl-icon",{size:24,icon:"check-circle"});default:return e("xpl-icon",{size:24,icon:"comment-alt"})}},this.dismiss=()=>{var t;null===(t=this.el)||void 0===t||t.classList.add("xpl-toast--dismissed")}}componentDidLoad(){this.actionSlot.children.length<1&&setTimeout((()=>{this.dismiss()}),this.timeout)}render(){var t;return e(a,{key:"6a4c1dfe86f62c39db5573a0bb1eef2c14616085",class:`xpl-toast xpl-toast--${this.variant}`,onAnimationEnd:this.handleAnimationEnd},e("div",{key:"282a4c5fc37e538d3359a0c38e7cd30e2a29e311",class:"xpl-toast__left"},this.showIcon&&e("div",{key:"dfb6bb1923f5c9e1b1dae80630cc7977529e834f",class:`xpl-toast__icon xpl-toast__icon--${this.variant}`},this.getIcon()),e("div",{key:"9a1755b484e316be08b89044ae3c55e7a30c3795",class:"xpl-toast__notification"},e("p",{key:"afa9572dcb109c58c6c4045e14b604010da95230",class:"xpl-toast__title"},e("slot",{key:"0b80b8719e79a1e01bcf8ec125db8d9762f1a1d7",name:"title"})),""!==this.caption&&e("p",{key:"7debe4dd50870bc6478a86e7742450f667dfee3a",class:"xpl-toast__caption"},null===(t=this.caption)||void 0===t?void 0:t.substring(0,85)))),e("div",{key:"194104f419162bd4157fb5e8885983ca40467d9c",class:"xpl-toast__action",ref:t=>{this.actionSlot=t}},e("slot",{key:"c63cc79ec725417c4f317dd72511e72b24f8280e",name:"action"})),this.dismissable&&e("div",{key:"3328ad43d7cd4026d5b4488dc2d920031be0ca34",class:"xpl-toast__close"},e("button",{key:"ce3b27ae3c1570806916b3d668678513df5065ed",tabIndex:0,onClick:this.dismiss},e("xpl-icon",{key:"be1a177568f933417b62ce2a2705441d00b3118f",icon:"x"}))))}get el(){return i(this)}},ut=()=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17",height:"14"},e("g",{filter:"url(#a)"},e("path",{d:"M0 5h15l-7.5 7.5L0 5Z"})),e("defs",null,e("filter",{id:"a",width:"20",height:"8.171",x:".5",y:"5","color-interpolation-filters":"sRGB",filterUnits:"userSpaceOnUse"},e("feFlood",{"flood-opacity":"0",result:"BackgroundImageFix"}),e("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),e("feOffset",{dy:"1"}),e("feComposite",{in2:"hardAlpha",operator:"out"}),e("feColorMatrix",{values:"0 0 0 0 0.882353 0 0 0 0 0.886275 0 0 0 0 0.909804 0 0 0 1 0"}),e("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_20073_3067"}),e("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_20073_3067",result:"shape"})))),bt=class{constructor(e){t(this,e),this.position="top-middle",this.hideArrow=!1}render(){return e(a,{key:"2a442f9c9c54e8e6f8032b5d6384c84a1fbda0ad"},e("div",{key:"f30932db02af0f1273421b14c5b25840adbc3f58",class:"xpl-tooltip-container"},e("slot",{key:"729aee67e66fb3d281b84a86aeba2d12a8a08340"}),e("div",{key:"9c0f6a237f2a1a11459a311095a2bdf9be4b176d",class:`xpl-tooltip xpl-tooltip--${this.position}`},this.text),!this.hideArrow&&e("div",{key:"3bb6b085ddde321cf3063feba8ff23e785723afd",class:"xpl-tooltip-arrow"},e(ut,{key:"f687c2776a7b9097aec183c5128e9e238e57d26e"}))))}},mt=class{constructor(e){t(this,e),this.navOpen=l(this,"navOpen",7),this.open=!0}onNavToggle(){this.open=!this.open,this.navOpen.emit(this.open)}componentWillLoad(){this.open=void 0!==this.isNavOpenAtStartup?this.isNavOpenAtStartup:this.open}render(){return e(a,{key:"a67e91188d392358df4b052d7e9026cf2f6b9b04"},e("nav",{key:"f51a3c37a1c8ae3d4f4ba8b524fb1f2ff2dd5ea8","aria-label":"utility navigation bar",class:"xpl-utility-bar"},this.navControl?e("div",null,e("button",{class:"xpl-utility-bar__nav-control",onClick:()=>this.onNavToggle()},e("xpl-icon",{class:"xpl-utility-nav__bars",icon:"three-bars"})),e("slot",{name:"aside"})):e("slot",{name:"aside"}),e("slot",{key:"75f581a8455f372b692a9ec190c2f0974b214105",name:"main"})))}};export{o as xpl_avatar,d as xpl_backdrop,c as xpl_badge,n as xpl_breadcrumb_item,p as xpl_breadcrumbs,C as xpl_button,f as xpl_checkbox,u as xpl_choicelist,b as xpl_content_area,m as xpl_dashboard,v as xpl_data_card,g as xpl_divider,w as xpl_dropdown,y as xpl_dropdown_group,k as xpl_dropdown_heading,x as xpl_dropdown_option,L as xpl_header_accordion,j as xpl_icon,E as xpl_input,N as xpl_input_color,W as xpl_input_date,B as xpl_input_file,U as xpl_input_time,K as xpl_modal,G as xpl_nav_item,X as xpl_pagination,tt as xpl_popover,et as xpl_progress,at as xpl_radio,it as xpl_secondary_nav,st as xpl_select,rt as xpl_skeleton,ot as xpl_slideout,dt as xpl_tab,ct as xpl_tab_panel,nt as xpl_table,pt as xpl_tabs,Ct as xpl_tag,ft as xpl_toast,bt as xpl_tooltip,mt as xpl_utility_bar}
@@ -3059,20 +3059,21 @@ const XplInput = class {
3059
3059
  render() {
3060
3060
  var _a;
3061
3061
  let hasError = false;
3062
- if (this.error !== undefined)
3062
+ if (this.error) {
3063
3063
  hasError = true;
3064
- if (this.multiline &&
3064
+ }
3065
+ else if (this.multiline &&
3065
3066
  this.maxCharacterCount !== undefined &&
3066
3067
  this.characterCount > this.maxCharacterCount) {
3067
3068
  hasError = true;
3068
3069
  }
3069
- return (index.h(index.Host, { key: '4dca16ca0939ae6365edc9201e00ec6cf76aadfc', class: {
3070
+ return (index.h(index.Host, { key: 'c682985a3d592f9f9902a16013a5d00f40ce5e44', class: {
3070
3071
  'xpl-input': true,
3071
3072
  'xpl-input--disabled': this.disabled,
3072
3073
  'xpl-input--error': hasError,
3073
3074
  'xpl-input--readonly': this.readonly,
3074
3075
  [`xpl-input--${this.type}`]: true,
3075
- } }, this.label && (index.h("label", { key: '2abed2c330a6cb7fbad8274299a7012b09c22b03', class: "xpl-input-label", htmlFor: this._id }, this.label, this.description && index.h("small", { key: '4f310894b28354d9540aa73b4e87872632eb9c83' }, this.description))), this.renderInput(), ((_a = this.error) === null || _a === void 0 ? void 0 : _a.length) > 0 && (index.h("label", { key: 'ed5cd40feaa1d9d76d6b569c9b9c51da178d162d', class: "xpl-input-error", htmlFor: this._id }, index.h("xpl-icon", { key: '2e5374ee3a0c5b18d3891a647b52853b0daa7b9c', icon: "alert-circle", size: 16 }), index.h("span", { key: '1a9aa0733831e709aa5923c9486049697e7ab20b' }, this.error)))));
3076
+ } }, this.label && (index.h("label", { key: '21d863221e85a255f3dc5e662139b7abc0e72907', class: "xpl-input-label", htmlFor: this._id }, this.label, this.description && index.h("small", { key: '25d078a667c8b9cbf4d1b5d1f412c3d0e736013a' }, this.description))), this.renderInput(), ((_a = this.error) === null || _a === void 0 ? void 0 : _a.length) > 0 && (index.h("label", { key: '7e13c1fc18496bdf50cdb2a239c113c182b83f18', class: "xpl-input-error", htmlFor: this._id }, index.h("xpl-icon", { key: '900d641cfcd94d9f6cc85ba34e1e211448c203df', icon: "alert-circle", size: 16 }), index.h("span", { key: '74f7868861f5c262038bee3de2faeecc46b2454d' }, this.error)))));
3076
3077
  }
3077
3078
  };
3078
3079
 
@@ -4872,7 +4873,7 @@ const XplSelect = class {
4872
4873
  return tags;
4873
4874
  }
4874
4875
  renderError() {
4875
- if (this.error === undefined || this.error.length === 0)
4876
+ if (!this.error)
4876
4877
  return null;
4877
4878
  return (index.h("label", { class: "xpl-input-error", htmlFor: this.id }, index.h("xpl-icon", { icon: "alert-circle" }), this.error));
4878
4879
  }
@@ -4926,7 +4927,7 @@ const XplSelect = class {
4926
4927
  });
4927
4928
  }
4928
4929
  render() {
4929
- var _a, _b, _c;
4930
+ var _a, _b, _c, _d;
4930
4931
  const selectedChoices = flattenChoices(this.choicesState).filter((choice) => choice.isSelected);
4931
4932
  const displayedValue = ((_a = selectedChoices[0]) === null || _a === void 0 ? void 0 : _a.label) || ((_b = selectedChoices[0]) === null || _b === void 0 ? void 0 : _b.value);
4932
4933
  const isTextTruncated = selectedChoices.length > 1 &&
@@ -4934,21 +4935,21 @@ const XplSelect = class {
4934
4935
  this.truncate &&
4935
4936
  !this.customDisplayValue;
4936
4937
  const truncatedText = `+ ${Math.abs(this.choicesState.filter((a) => a.isSelected).length - this.visibleChoices)} more`;
4937
- return (index.h(index.Host, { key: '8ffd6b069df2b869abfa22ae5e41731a992abe36', class: {
4938
+ return (index.h(index.Host, { key: 'dd41611f279bfdf8ca7bf3673ff0e4421c9adbd5', class: {
4938
4939
  'xpl-select': true,
4939
4940
  'xpl-select--disabled': this.disabled,
4940
4941
  'xpl-select--no-truncate': !this.truncate,
4941
4942
  [(_c = this.classNames) !== null && _c !== void 0 ? _c : '']: !!this.classNames,
4942
4943
  }, onKeyDown: this.handleTabKeyDown, ref: (el) => {
4943
4944
  this.container = el;
4944
- } }, this.renderLabel(), index.h("div", { key: 'ed959919397c5c2ffc063957188e00a10feeed9a', class: {
4945
+ } }, this.renderLabel(), index.h("div", { key: '8579aece1497e108177fab248d7dd0bcd4baadf3', class: {
4945
4946
  'xpl-input': true,
4946
4947
  'xpl-input--disabled': this.disabled,
4947
- 'xpl-input--error': this.error !== undefined,
4948
- } }, index.h("div", { key: '266e7d99a66d66241ebe1d20375d0a270b8b6399', class: "xpl-input-wrapper" }, index.h("button", { key: 'cdb455539afb77ab76f729e8a21419d32c220a75', class: "xpl-select__trigger", disabled: this.disabled, id: this.id, onKeyDown: this.handleTabKeyDown, onClick: (e) => {
4948
+ 'xpl-input--error': ((_d = this.error) === null || _d === void 0 ? void 0 : _d.length) >= 0,
4949
+ } }, index.h("div", { key: '7a2f274cffcbb2c97acd96244290494568fdbbc9', class: "xpl-input-wrapper" }, index.h("button", { key: '332b3c6a714bb6f30a20f42e129b2f1ef78dda2d', class: "xpl-select__trigger", disabled: this.disabled, id: this.id, onKeyDown: this.handleTabKeyDown, onClick: (e) => {
4949
4950
  e.preventDefault();
4950
4951
  this.handleDropdownTrigger();
4951
- }, type: "button" }, index.h("div", { key: 'db9e85fa588af2c35d3de960826c171bc02627af', class: {
4952
+ }, type: "button" }, index.h("div", { key: 'ecb836e8d199e36d455f477fd9be38103b6e2ac6', class: {
4952
4953
  'xpl-select-value': true,
4953
4954
  'xpl-select-value--active': this.mode === 'multi' && this.value.length > 0,
4954
4955
  'has-value': this.value.length > 0,
@@ -4968,7 +4969,7 @@ const XplSelect = class {
4968
4969
  return this.renderSelectedTags();
4969
4970
  }
4970
4971
  return this.placeholder;
4971
- })(), isTextTruncated && truncatedText), index.h("xpl-icon", { key: 'ef3997f19a4e4bb4de12f826c736ef9afc4bd5c8', class: "xpl-select__chevron-down", icon: this.selectIcon }))), !this.disabled && (index.h("xpl-dropdown", { key: 'df29a0a21c11fa4c9a550a4339c6719793783404', ref: (el) => {
4972
+ })(), isTextTruncated && truncatedText), index.h("xpl-icon", { key: '46d0759da7e730e00d6eb4839ba2eda1e711dd59', class: "xpl-select__chevron-down", icon: this.selectIcon }))), !this.disabled && (index.h("xpl-dropdown", { key: '4ac71c53ae935940c5de9d4c65034b0bf312da79', ref: (el) => {
4972
4973
  this.dropdown = el;
4973
4974
  }, isOpen: this.dropdownOpenState, options: this.choicesState, selectedValues: this.selectedValues, mode: this.mode, triggerId: this.id, update: (_e, { component }) => {
4974
4975
  const { options } = component;
@@ -4977,7 +4978,7 @@ const XplSelect = class {
4977
4978
  }
4978
4979
  }, onIsOpenChange: (e) => {
4979
4980
  this.dropdownOpenState = e.detail;
4980
- }, onWheel: this.handleDropdownScroll, anchorToTrigger: true })), this.renderError()), index.h("input", { key: '3e7f53a0d8e6d4e8028e1dc38d0e3661b76978f5', type: "hidden", name: this.name, value: this.value })));
4981
+ }, onWheel: this.handleDropdownScroll, anchorToTrigger: true })), this.renderError()), index.h("input", { key: 'd80e5ab1219e98130e4c38264a711839d4d9668f', type: "hidden", name: this.name, value: this.value })));
4981
4982
  }
4982
4983
  static get watchers() { return {
4983
4984
  "choices": [{
@@ -66,9 +66,10 @@ export class XplInput {
66
66
  render() {
67
67
  var _a;
68
68
  let hasError = false;
69
- if (this.error !== undefined)
69
+ if (this.error) {
70
70
  hasError = true;
71
- if (this.multiline &&
71
+ }
72
+ else if (this.multiline &&
72
73
  this.maxCharacterCount !== undefined &&
73
74
  this.characterCount > this.maxCharacterCount) {
74
75
  hasError = true;
@@ -77,13 +78,13 @@ export class XplInput {
77
78
  if (type === 'password' && this.passwordVisible) {
78
79
  type = 'text';
79
80
  }
80
- return (h(Host, { key: '4dca16ca0939ae6365edc9201e00ec6cf76aadfc', class: {
81
+ return (h(Host, { key: 'c682985a3d592f9f9902a16013a5d00f40ce5e44', class: {
81
82
  'xpl-input': true,
82
83
  'xpl-input--disabled': this.disabled,
83
84
  'xpl-input--error': hasError,
84
85
  'xpl-input--readonly': this.readonly,
85
86
  [`xpl-input--${this.type}`]: true,
86
- } }, this.label && (h("label", { key: '2abed2c330a6cb7fbad8274299a7012b09c22b03', class: "xpl-input-label", htmlFor: this._id }, this.label, this.description && h("small", { key: '4f310894b28354d9540aa73b4e87872632eb9c83' }, this.description))), this.renderInput(), ((_a = this.error) === null || _a === void 0 ? void 0 : _a.length) > 0 && (h("label", { key: 'ed5cd40feaa1d9d76d6b569c9b9c51da178d162d', class: "xpl-input-error", htmlFor: this._id }, h("xpl-icon", { key: '2e5374ee3a0c5b18d3891a647b52853b0daa7b9c', icon: "alert-circle", size: 16 }), h("span", { key: '1a9aa0733831e709aa5923c9486049697e7ab20b' }, this.error)))));
87
+ } }, this.label && (h("label", { key: '21d863221e85a255f3dc5e662139b7abc0e72907', class: "xpl-input-label", htmlFor: this._id }, this.label, this.description && h("small", { key: '25d078a667c8b9cbf4d1b5d1f412c3d0e736013a' }, this.description))), this.renderInput(), ((_a = this.error) === null || _a === void 0 ? void 0 : _a.length) > 0 && (h("label", { key: '7e13c1fc18496bdf50cdb2a239c113c182b83f18', class: "xpl-input-error", htmlFor: this._id }, h("xpl-icon", { key: '900d641cfcd94d9f6cc85ba34e1e211448c203df', icon: "alert-circle", size: 16 }), h("span", { key: '74f7868861f5c262038bee3de2faeecc46b2454d' }, this.error)))));
87
88
  }
88
89
  static get is() { return "xpl-input"; }
89
90
  static get properties() {
@@ -160,7 +160,7 @@ export class XplSelect {
160
160
  return tags;
161
161
  }
162
162
  renderError() {
163
- if (this.error === undefined || this.error.length === 0)
163
+ if (!this.error)
164
164
  return null;
165
165
  return (h("label", { class: "xpl-input-error", htmlFor: this.id }, h("xpl-icon", { icon: "alert-circle" }), this.error));
166
166
  }
@@ -214,7 +214,7 @@ export class XplSelect {
214
214
  });
215
215
  }
216
216
  render() {
217
- var _a, _b, _c;
217
+ var _a, _b, _c, _d;
218
218
  const selectedChoices = flattenChoices(this.choicesState).filter((choice) => choice.isSelected);
219
219
  const displayedValue = ((_a = selectedChoices[0]) === null || _a === void 0 ? void 0 : _a.label) || ((_b = selectedChoices[0]) === null || _b === void 0 ? void 0 : _b.value);
220
220
  const isTextTruncated = selectedChoices.length > 1 &&
@@ -222,21 +222,21 @@ export class XplSelect {
222
222
  this.truncate &&
223
223
  !this.customDisplayValue;
224
224
  const truncatedText = `+ ${Math.abs(this.choicesState.filter((a) => a.isSelected).length - this.visibleChoices)} more`;
225
- return (h(Host, { key: '8ffd6b069df2b869abfa22ae5e41731a992abe36', class: {
225
+ return (h(Host, { key: 'dd41611f279bfdf8ca7bf3673ff0e4421c9adbd5', class: {
226
226
  'xpl-select': true,
227
227
  'xpl-select--disabled': this.disabled,
228
228
  'xpl-select--no-truncate': !this.truncate,
229
229
  [(_c = this.classNames) !== null && _c !== void 0 ? _c : '']: !!this.classNames,
230
230
  }, onKeyDown: this.handleTabKeyDown, ref: (el) => {
231
231
  this.container = el;
232
- } }, this.renderLabel(), h("div", { key: 'ed959919397c5c2ffc063957188e00a10feeed9a', class: {
232
+ } }, this.renderLabel(), h("div", { key: '8579aece1497e108177fab248d7dd0bcd4baadf3', class: {
233
233
  'xpl-input': true,
234
234
  'xpl-input--disabled': this.disabled,
235
- 'xpl-input--error': this.error !== undefined,
236
- } }, h("div", { key: '266e7d99a66d66241ebe1d20375d0a270b8b6399', class: "xpl-input-wrapper" }, h("button", { key: 'cdb455539afb77ab76f729e8a21419d32c220a75', class: "xpl-select__trigger", disabled: this.disabled, id: this.id, onKeyDown: this.handleTabKeyDown, onClick: (e) => {
235
+ 'xpl-input--error': ((_d = this.error) === null || _d === void 0 ? void 0 : _d.length) >= 0,
236
+ } }, h("div", { key: '7a2f274cffcbb2c97acd96244290494568fdbbc9', class: "xpl-input-wrapper" }, h("button", { key: '332b3c6a714bb6f30a20f42e129b2f1ef78dda2d', class: "xpl-select__trigger", disabled: this.disabled, id: this.id, onKeyDown: this.handleTabKeyDown, onClick: (e) => {
237
237
  e.preventDefault();
238
238
  this.handleDropdownTrigger();
239
- }, type: "button" }, h("div", { key: 'db9e85fa588af2c35d3de960826c171bc02627af', class: {
239
+ }, type: "button" }, h("div", { key: 'ecb836e8d199e36d455f477fd9be38103b6e2ac6', class: {
240
240
  'xpl-select-value': true,
241
241
  'xpl-select-value--active': this.mode === 'multi' && this.value.length > 0,
242
242
  'has-value': this.value.length > 0,
@@ -256,7 +256,7 @@ export class XplSelect {
256
256
  return this.renderSelectedTags();
257
257
  }
258
258
  return this.placeholder;
259
- })(), isTextTruncated && truncatedText), h("xpl-icon", { key: 'ef3997f19a4e4bb4de12f826c736ef9afc4bd5c8', class: "xpl-select__chevron-down", icon: this.selectIcon }))), !this.disabled && (h("xpl-dropdown", { key: 'df29a0a21c11fa4c9a550a4339c6719793783404', ref: (el) => {
259
+ })(), isTextTruncated && truncatedText), h("xpl-icon", { key: '46d0759da7e730e00d6eb4839ba2eda1e711dd59', class: "xpl-select__chevron-down", icon: this.selectIcon }))), !this.disabled && (h("xpl-dropdown", { key: '4ac71c53ae935940c5de9d4c65034b0bf312da79', ref: (el) => {
260
260
  this.dropdown = el;
261
261
  }, isOpen: this.dropdownOpenState, options: this.choicesState, selectedValues: this.selectedValues, mode: this.mode, triggerId: this.id, update: (_e, { component }) => {
262
262
  const { options } = component;
@@ -265,7 +265,7 @@ export class XplSelect {
265
265
  }
266
266
  }, onIsOpenChange: (e) => {
267
267
  this.dropdownOpenState = e.detail;
268
- }, onWheel: this.handleDropdownScroll, anchorToTrigger: true })), this.renderError()), h("input", { key: '3e7f53a0d8e6d4e8028e1dc38d0e3661b76978f5', type: "hidden", name: this.name, value: this.value })));
268
+ }, onWheel: this.handleDropdownScroll, anchorToTrigger: true })), this.renderError()), h("input", { key: 'd80e5ab1219e98130e4c38264a711839d4d9668f', type: "hidden", name: this.name, value: this.value })));
269
269
  }
270
270
  static get is() { return "xpl-select"; }
271
271
  static get properties() {
@@ -1 +1 @@
1
- import{proxyCustomElement as t,HTMLElement as e,createEvent as i,h as s,Host as a,transformTag as o}from"@stencil/core/internal/client";import{d as r}from"./xpl-dropdown2.js";import{d as n}from"./xpl-dropdown-group2.js";import{d as l}from"./xpl-dropdown-heading2.js";import{d as h}from"./xpl-dropdown-option2.js";import{d as p}from"./xpl-icon2.js";import{d as c}from"./xpl-input-date2.js";import{d}from"./xpl-input-file2.js";import{d as u}from"./xpl-popover2.js";import{v as m}from"./v4.js";const b=(t,e,i)=>{const s=(i/=100)*(e/=100),a=s*(1-Math.abs(t/60%2-1)),o=i-s;let r=0,n=0,l=0;return t<60?(r=s,n=a,l=0):t<120?(r=a,n=s,l=0):t<180?(r=0,n=s,l=a):t<240?(r=0,n=a,l=s):t<300?(r=a,n=0,l=s):(r=s,n=0,l=a),{r:Math.round(255*(r+o)),g:Math.round(255*(n+o)),b:Math.round(255*(l+o))}},x=(t,e,i)=>[t,e,i].map((t=>t.toString(16).padStart(2,"0"))).join(""),f=t=>{var e,i;if(t.startsWith("#")){if(!/^#([a-fA-F\d]{6})$/.test(t))throw new Error("Only 6-digit hex format supported (e.g. #aabbcc)");const e=t.toLowerCase().slice(1),i=parseInt(e.slice(0,2),16),s=parseInt(e.slice(2,4),16),a=parseInt(e.slice(4,6),16);return{hex:e,r:i,g:s,b:a,a:1}}if(t.startsWith("rgba")||t.startsWith("rgb")){const i=null===(e=t.match(/[\d.]+/g))||void 0===e?void 0:e.map(Number);if(!i||i.length<3)throw new Error("Invalid rgba/rgb format");const[s,a,o,r=1]=i,n=t=>t.toString(16).padStart(2,"0");return{hex:`${n(s)}${n(a)}${n(o)}`.toLowerCase(),r:s,g:a,b:o,a:r}}if(t.startsWith("hsla")||t.startsWith("hsl")){const e=null===(i=t.match(/[\d.]+/g))||void 0===i?void 0:i.map(Number);if(!e||e.length<3)throw new Error("Invalid hsla/hsl format");const[s,a,o,r=1]=e,n=((t,e,i,s)=>{i/=100;const a=e=>(e+t/30)%12,o=(e/=100)*Math.min(i,1-i),r=t=>i-o*Math.max(-1,Math.min(a(t)-3,Math.min(9-a(t),1)));return`rgba(${Math.round(255*r(0))}, ${Math.round(255*r(8))}, ${Math.round(255*r(4))}, ${s})`})(s,a,o,r),[l,h,p]=n.match(/[\d.]+/g).map(Number);return{hex:x(l,h,p).toLowerCase(),r:l,g:h,b:p,a:r}}throw new Error("Unsupported color format")},g=t=>t.a&&1!==t.a?`rgba(${t.r}, ${t.g}, ${t.b}, ${t.a})`:`#${t.hex}`;function v(t){const[e,i]=t.split(":"),s=Number(e)>=12?"PM":"AM";return[(Number(e)%12||12).toString(),i,s]}const w=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.valueChange=i(this,"valueChange",7),this.hasErrorStateChanged=i(this,"hasErrorStateChanged",7),this.max="23:59",this.min="00:00",this.step=30,this.mode="single",this.timeFormat="24h",this.allowCustomOption=!1,this.showOptions=!1,this.options=[],this.handleInput=t=>{var e;const i=null===(e=t.target.value)||void 0===e?void 0:e.replace(/[^0-9:apmAPM]/g,"");this.value=i},this.handleFocus=()=>{this.showOptions=!0},this.handleBlur=()=>{this.value=function(t){if(!t||""===t.trim()||0===t.replace(/[^0-9]/g,"").length)return null;let e=t.trim().toLowerCase();e=e.replace(/(\d)\s+(am|pm)/g,"$1$2"),/^\d{1,2}(am|pm)?$/.test(e)&&(e=e.replace(/(am|pm)?$/,":00$1")),/^\d{1,2}$/.test(e)&&(e=`${e}:00`),/^\d{1,2}:\d{1}$/.test(e)&&(e=`${e}0`);const[i,s]=e.split(":"),a=s.replace(/[^0-9]/g,""),o=e.includes("am");return e.includes("pm")||o?o?`${(Number(i)%12).toString().padStart(2,"0")}:${a}`:`${Number(i)%12+12}:${a}`:`${i.padStart(2,"0")}:${a}`}(this.value)},this.handleClick=()=>{this.showOptions=!0}}onValueChange(t){this.valueChange.emit(t),this.updateState(t)}updateState(t){this.formattedValue=this.formatDisplayedTime(t),this.amPm=this.formatDisplayedAmPm(t),this.validateValue()}formatDisplayedTime(t){if(!t)return"";if("12h"===this.timeFormat&&t.includes(":")){const[e,i]=v(t);return`${e}:${i}`}return t}formatDisplayedAmPm(t){if(!t||"12h"!==this.timeFormat)return"";const[,,e]=v(t);return e}validateValue(){this.hasErrorState=this.value?!this.value.includes(":")||this.value.trim().length<4||this.value.trim().length>5?"Invalid time format, must be HH:MM":this.value<this.min||this.value>this.max?"Out of range":this.allowCustomOption||this.options.some((t=>t.value===this.value))?null:"Invalid option":this.required?"required":null}onHasErrorStateChanged(t){this.hasErrorStateChanged.emit(t)}componentDidLoad(){var t;"range"===this.mode&&console.warn("Range mode is not supported for time inputs at this time."),null===(t=this.dropdown)||void 0===t||t.addEventListener("isOpenChange",(t=>{this.showOptions=t.detail}))}componentWillLoad(){this.options=this.getOptions(),this.value&&this.updateState(this.value)}getOptions(){return function(t,e,i,s){const a=t=>{const[e,i]=t.split(":").map(Number);return 60*e+i},o=a(e.toString()),r=a(i.toString()),n=[];for(let e=o;e<=r;e+=t)n.push((l=e,`${Math.floor(l/60).toString().padStart(2,"0")}:${(l%60).toString().padStart(2,"0")}`));var l;return n.map((t=>({label:"12h"===s?function(t){const[e,i,s]=v(t);return`${e}:${i} ${s}`}(t):t,value:t})))}(this.step,this.min.toString(),this.max.toString(),this.timeFormat).map((({label:t,value:e})=>({label:t,value:e,onClick:()=>{this.value=e,this.showOptions=!1}})))}render(){return s(a,{key:"99b06c895d608dec6226f79f21ceda92225428b7",class:{"xpl-input-time":!0,[`xpl-input-time--mode-${this.mode}`]:!0,"xpl-input-time--error":!!this.hasErrorState}},s("xpl-input",{key:"8cdf996f46d969c243d246fdfe888c22c9c4999b",pre:s("xpl-icon",{class:"xpl-input-time__clock-icon",icon:"clock",size:24}),post:"12h"===this.timeFormat?this.amPm||"AM":null,type:"text",_id:this.inputId,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,placeholder:this.placeholder,max:this.max,min:this.min,onInput:this.handleInput,value:this.formattedValue,onFocusEvent:this.handleFocus,onBlurEvent:this.handleBlur,onClick:this.handleClick}),!this.readonly&&!this.disabled&&s("xpl-dropdown",{key:"5213fcd68da96d726d8b046277233afd6b5b20e8",options:this.options,isOpen:this.showOptions,ref:t=>{this.dropdown=t},class:"xpl-input-time__dropdown"}))}static get watchers(){return{value:[{onValueChange:0}],hasErrorState:[{onHasErrorStateChanged:0}]}}},[0,"xpl-input-time",{inputId:[1,"input-id"],disabled:[4],name:[1],required:[4],readonly:[4],value:[1537],placeholder:[1],max:[8],min:[8],step:[2],mode:[1],timeFormat:[1,"time-format"],allowCustomOption:[4,"allow-custom-option"],formattedValue:[32],hasErrorState:[32],showOptions:[32],options:[32],amPm:[32]},void 0,{value:[{onValueChange:0}],hasErrorState:[{onHasErrorStateChanged:0}]}]);function k(){"undefined"!=typeof customElements&&["xpl-input-time","xpl-dropdown","xpl-dropdown-group","xpl-dropdown-heading","xpl-dropdown-option","xpl-icon","xpl-input","xpl-input-color","xpl-input-date","xpl-input-file","xpl-input-time"].forEach((t=>{switch(t){case"xpl-input-time":customElements.get(o(t))||customElements.define(o(t),w);break;case"xpl-dropdown":customElements.get(o(t))||r();break;case"xpl-dropdown-group":customElements.get(o(t))||n();break;case"xpl-dropdown-heading":customElements.get(o(t))||l();break;case"xpl-dropdown-option":customElements.get(o(t))||h();break;case"xpl-icon":customElements.get(o(t))||p();break;case"xpl-input":customElements.get(o(t))||M();break;case"xpl-input-color":customElements.get(o(t))||$();break;case"xpl-input-date":customElements.get(o(t))||c();break;case"xpl-input-file":customElements.get(o(t))||d();break;case"xpl-input-time":customElements.get(o(t))||k()}}))}const y={hex:"",r:0,g:0,b:0,a:1},E=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.inputChange=i(this,"inputChange",7),this.hasErrorStateChanged=i(this,"hasErrorStateChanged",7),this.placeholder="Select color",this.eyeDropperSupported="EyeDropper"in window,this.colorInputElements={hex:null,r:null,g:null,b:null,a:null,hue:null,slGrid:null,alpha:null},this.handleMove=t=>{const e=this.colorInputElements.slGrid.getBoundingClientRect(),i="touches"in t?t.touches[0].clientY:t.clientY,s=Math.max(0,Math.min(("touches"in t?t.touches[0].clientX:t.clientX)-e.left,e.width)),a=Math.max(0,Math.min(i-e.top,e.height)),o=s/e.width,r=a/e.height,n=b(this.hue,100,100),l=(255*(1-o)+o*n.r)*(1-r),h=(255*(1-o)+o*n.g)*(1-r),p=(255*(1-o)+o*n.b)*(1-r),c={r:Math.round(l),g:Math.round(h),b:Math.round(p),hex:x(Math.round(l),Math.round(h),Math.round(p)),a:this.colorValues.a};this.colorValues=c},this.startDrag=t=>{t.preventDefault(),this.handleMove(t),window.addEventListener("mousemove",this.handleMove),window.addEventListener("mouseup",this.stopDrag),window.addEventListener("touchmove",this.handleMove),window.addEventListener("touchend",this.stopDrag)},this.stopDrag=()=>{window.removeEventListener("mousemove",this.handleMove),window.removeEventListener("mouseup",this.stopDrag),window.removeEventListener("touchmove",this.handleMove),window.removeEventListener("touchend",this.stopDrag)},this.onHexInputChange=t=>{var e;const i=t.detail;if(i){const[t,s,a]=(t=>t?t.match(/\w\w/g).map((t=>parseInt(t,16))):[0,0,0])(i);this.colorValues={hex:i,r:t,g:s,b:a,a:null!==(e=this.colorValues.a)&&void 0!==e?e:1}}else this.colorValues=Object.assign({},y)},this.onRgbaInputChange=(t,e)=>{const i=parseFloat(e.detail);if(Number.isNaN(i))return void(this.hasErrorState=`invalid value from ${t.name}: ${i}`);const s=Object.assign({},this.colorValues);switch(t.name){case"color-r-input":s.r=i;break;case"color-g-input":s.g=i;break;case"color-b-input":s.b=i;break;case"color-a-input":s.a=i;break;default:this.hasErrorState=`unhandled input: ${t.name}`}s.hex=x(s.r,s.g,s.b),this.colorValues=s},this.onSliderInputChange=t=>{const e=parseFloat(t.value);if(Number.isNaN(e))this.hasErrorState=`invalid value from ${t.name}: ${e}`;else switch(t.name){case"color-hue-slider":this.colorValues=f(`hsla(${e}, 100%, 50%, 1)`),this.hue=e;break;case"color-alpha-slider":this.colorValues=Object.assign(Object.assign({},this.colorValues),{a:e});break;default:this.hasErrorState=`unhandled input: ${t.name}`}}}valueChanged(t){this.hasErrorState=this.required&&!t.hex?"required":null,this.inputChange.emit(t.hex?g(t):"")}onHasErrorStateChanged(t){this.hasErrorStateChanged.emit(t)}onValuePropChange(t){this.syncColorFromValue(t)}syncColorFromValue(t){if(t)try{this.colorValues=f(t),this.hue=(()=>{const t=this.colorValues.r/255,e=this.colorValues.g/255,i=this.colorValues.b/255,s=Math.max(t,e,i),a=Math.min(t,e,i),o=s-a;let r=0,n=0;const l=(s+a)/2;if(0!==o){switch(n=o/(1-Math.abs(2*l-1)),s){case t:r=(e-i)/o%6;break;case e:r=(i-t)/o+2;break;case i:r=(t-e)/o+4}r*=60,r<0&&(r+=360)}return{hue:Math.round(r),saturation:Math.round(100*n),lightness:Math.round(100*l)}})().hue}catch(t){this.hasErrorState="invalid color format",this.hue=0}else this.colorValues=Object.assign({},y),this.hasErrorState=null,this.hue=0}componentWillLoad(){this.syncColorFromValue(this.value)}componentDidLoad(){const{r:t,g:e,b:i,a:s,hue:a,alpha:o,hex:r}=this.colorInputElements;r.addEventListener("valueChange",(t=>{this.onHexInputChange(t)})),[t,e,i,s].forEach((t=>{t.addEventListener("valueChange",(e=>{this.onRgbaInputChange(t,e)}))})),[a,o].forEach((t=>{t.addEventListener("input",(()=>{this.onSliderInputChange(t)}))}))}async openEyeDropper(){try{const t=new window.EyeDropper,e=await t.open();this.colorValues=f(e.sRGBHex)}catch(t){this.hasErrorState=`eyedropper cancelled or failed: ${t}`}}render(){const{r:t,g:e,b:i,a:o}=this.colorValues,r=b(this.hue,100,100),{x:n,y:l}=((t,e,i,s)=>{const{s:a,v:o}=((t,e,i,s)=>{t/=255,e/=255,i/=255;const a=Math.max(t,e,i),o=a-Math.min(t,e,i);let r=0;return r=0===o?0:a===t?(e-i)/o%6:a===e?(i-t)/o+2:(t-e)/o+4,r=Math.round(60*r),r<0&&(r+=360),{h:null!=s?s:r,s:0===a?0:o/a,v:a}})(e.r,e.g,e.b,t);return{x:Math.round(a*i),y:Math.round((1-o)*s)}})(this.hue,{r:t,g:e,b:i},288,160),h={left:`${n}px`,top:`${l}px`,background:`rgb(${t}, ${e}, ${i})`};return s(a,{key:"639f311d46bbb46e327ae6b05fe24b47795adbf3",class:"xpl-input-color"},s("xpl-popover",{key:"ad9d6145e4e5ac581c6d22f726050767ff82d861",disabled:this.disabled,display:"menu"},s("div",{key:"219e1754388cfc2ecff25b42b67322e780a1e7d6",slot:"trigger"},s("div",{key:"7beafe5304521d496bf7d7f8f82de01c9b7de00d",class:{"xpl-input-color__display":!0,"xpl-input-color__display--disabled":this.disabled,"xpl-input-color__display--error":!!this.hasErrorState}},s("span",{key:"2caae6b87902c50eb754e93ce939797d619da723",class:"xpl-input-color__color",style:{background:g(this.colorValues)}}),this.colorValues.hex?s("span",{class:"xpl-input-color__value"},g(this.colorValues)):s("span",{class:"xpl-input-color__placeholder"},this.placeholder),this.eyeDropperSupported&&!this.hideEyeDropper&&s("xpl-icon",{key:"8cd0f1e94bf2eaf31ad82a4c8d307badef8046fc",size:20,icon:"eye-droper",class:"xpl-input-color__icon",onClick:t=>{t.stopPropagation(),this.openEyeDropper()}}))),s("div",{key:"8e6add90e733d299cea94559dcbc29dd4e64d9cd",class:"xpl-input-color__menu"},s("div",{key:"a488c9b7ef3ff0cabbbb4bf5a631f209034a2539",class:"xpl-input-color__sl-grid",ref:t=>{this.colorInputElements.slGrid=t},style:{background:["linear-gradient(to top, #000, #0000)","linear-gradient(to right, #fff, #fff0)",`rgb(${r.r} ${r.g} ${r.b})`].join(", ")},onMouseDown:this.startDrag,onTouchStart:this.startDrag},s("div",{key:"542a5cafd651e6b49f813f6eecb46088b0b6f97c",class:"xpl-input-color__sl-thumb",style:h})),s("div",{key:"fd3268874bb0c0bc22c2d2db15dd50c38d3ae70a",class:"xpl-input-color__grid"},s("input",{key:"08ea52b5c2bbc2800b2ad5cca6981813e4578ce5",type:"range",min:"0",max:"360",value:this.hue,class:"xpl-input-color__slider xpl-input-color__hue",name:"color-hue-slider",ref:t=>{this.colorInputElements.hue=t}}),s("input",{key:"1692e362cb1e48446f33e2f82c5988546ad6a6f0",type:"range",min:"0",max:"1",step:"0.01",value:o,class:"xpl-input-color__slider xpl-input-color__alpha",name:"color-alpha-slider",ref:t=>{this.colorInputElements.alpha=t},style:{backgroundImage:[`linear-gradient(to right, rgb(${t} ${e} ${i} / 0) 0%, rgb(${t} ${e} ${i} / 1) 100%)`,"linear-gradient(45deg, #ccc 25%, transparent 25%)","linear-gradient(-45deg, #ccc 25%, transparent 25%)","linear-gradient(45deg, transparent 75%, #ccc 75%)","linear-gradient(-45deg, transparent 75%, #ccc 75%)"].join(", ")}}),s("div",{key:"5de3d1979fbb4c4a2892961fcbd7e6fc2d2723b4",class:"xpl-input-color__preview",style:{background:`rgba(${t}, ${e}, ${i}, ${o})`}})),s("div",{key:"3a660bdbb902bc8bfddb8c423f2462404b0221b8",class:"xpl-input-color__inputs"},Object.entries(this.colorInputElements).filter((([t])=>["hex","r","g","b","a"].includes(t))).map((([t])=>s("xpl-input",{key:t,label:t.toLocaleUpperCase(),name:`color-${t}-input`,placeholder:"hex"===t?"793EF7":"0",value:this.colorValues[t],ref:e=>{this.colorInputElements[t]=e}})))))))}static get watchers(){return{colorValues:[{valueChanged:0}],hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValuePropChange:0}]}}},[0,"xpl-input-color",{value:[1],placeholder:[1],disabled:[4],required:[4],hideEyeDropper:[4,"hide-eye-dropper"],hasErrorState:[32],colorValues:[32],eyeDropperSupported:[32],hue:[32]},void 0,{colorValues:[{valueChanged:0}],hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValuePropChange:0}]}]);function $(){"undefined"!=typeof customElements&&["xpl-input-color","xpl-icon","xpl-input","xpl-input-color","xpl-input-date","xpl-input-file","xpl-input-time","xpl-popover"].forEach((t=>{switch(t){case"xpl-input-color":customElements.get(o(t))||customElements.define(o(t),E);break;case"xpl-icon":customElements.get(o(t))||p();break;case"xpl-input":customElements.get(o(t))||M();break;case"xpl-input-color":customElements.get(o(t))||$();break;case"xpl-input-date":customElements.get(o(t))||c();break;case"xpl-input-file":customElements.get(o(t))||d();break;case"xpl-input-time":customElements.get(o(t))||k();break;case"xpl-popover":customElements.get(o(t))||u()}}))}const _=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.focusEvent=i(this,"focusEvent",7),this.blurEvent=i(this,"blurEvent",7),this.valueChange=i(this,"valueChange",7),this.inputEvent=i(this,"inputEvent",7),this.multiline=!1,this.dateFormat="Y-m-d",this.timeFormat="24h",this.allowCustomOption=!1,this.mode="single",this.accept="",this.multiple=!1,this.hideTriggerOnSelect=!1,this.hideFileNames=!1,this.hideAcceptText=!1,this.type="text",this.valueChanged=t=>{this.valueChange.emit(t.target.value)},this.characterCount=0,this.passwordVisible=!1,this.handleFocus=t=>{this.focusEvent.emit(t)},this.handleBlur=t=>{this.blurEvent.emit(t)},this.handleInput=t=>{this.multiline&&this.updateCharacterCount();const{value:e}=t.target;this.inputEvent.emit(e)}}updateCharacterCount(){this.characterCount=this.input.value.length}componentWillLoad(){null!=this._id&&""!==this._id||(this._id=m()),this.multiline&&void 0!==this.maxCharacterCount&&(this.characterCount=void 0!==this.value?this.value.length:0)}renderInput(){switch(this.type){case"file":return s("xpl-input-file",{accept:this.accept,disabled:this.disabled,hideAcceptText:this.hideAcceptText,hideFileNames:this.hideFileNames,hideTriggerOnSelect:this.hideTriggerOnSelect,multiple:this.multiple,name:this.name,_id:this._id},s("slot",{name:"trigger"}));case"color":return s("xpl-input-color",{disabled:this.disabled,value:this.value,placeholder:this.placeholder,required:this.required,hideEyeDropper:this.hideEyeDropper});case"date":return s("xpl-input-date",{inputId:this._id,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,value:this.value,placeholder:this.placeholder,post:this.post,pre:this.pre,max:this.max,min:this.min,dateFormat:this.dateFormat,mode:this.mode});case"time":return s("xpl-input-time",{inputId:this._id,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,value:this.value,placeholder:this.placeholder,max:this.max,min:this.min,step:this.step,mode:this.mode,timeFormat:this.timeFormat,allowCustomOption:this.allowCustomOption});default:return s("div",{class:"xpl-input-wrapper"},this.pre&&!this.multiline&&s("label",{class:"xpl-input-pre",htmlFor:this._id},this.pre),this.multiline?s("textarea",{disabled:this.disabled,id:this._id,name:this.name,placeholder:this.placeholder,readonly:this.readonly,ref:t=>{this.input=t},required:this.required,onChange:this.valueChanged,onFocus:this.handleFocus,onBlur:this.handleBlur,onInput:this.handleInput},this.value):s("input",{autocomplete:this.autocomplete,disabled:this.disabled,id:this._id,max:this.max,min:this.min,name:this.name,placeholder:this.placeholder,readonly:this.readonly,ref:t=>{this.input=t},required:this.required,step:this.step,type:this.type,value:this.value,onChange:this.valueChanged,onFocus:this.handleFocus,onBlur:this.handleBlur,onInput:this.handleInput}),"password"===this.type&&s("button",{"aria-label":"Toggle password visibility",class:"xpl-input-password",onClick:()=>{this.passwordVisible=!this.passwordVisible},role:"presentation"},s("xpl-icon",{icon:this.passwordVisible?"eye-closed":"eye",size:24})),this.post&&!this.multiline&&s("label",{class:"xpl-input-post",htmlFor:this._id},this.post),this.multiline&&void 0!==this.maxCharacterCount&&s("span",{class:"xpl-input-characters"},this.characterCount,"/",this.maxCharacterCount))}}render(){var t;let e=!1;return void 0!==this.error&&(e=!0),this.multiline&&void 0!==this.maxCharacterCount&&this.characterCount>this.maxCharacterCount&&(e=!0),s(a,{key:"4dca16ca0939ae6365edc9201e00ec6cf76aadfc",class:{"xpl-input":!0,"xpl-input--disabled":this.disabled,"xpl-input--error":e,"xpl-input--readonly":this.readonly,[`xpl-input--${this.type}`]:!0}},this.label&&s("label",{key:"2abed2c330a6cb7fbad8274299a7012b09c22b03",class:"xpl-input-label",htmlFor:this._id},this.label,this.description&&s("small",{key:"4f310894b28354d9540aa73b4e87872632eb9c83"},this.description)),this.renderInput(),(null===(t=this.error)||void 0===t?void 0:t.length)>0&&s("label",{key:"ed5cd40feaa1d9d76d6b569c9b9c51da178d162d",class:"xpl-input-error",htmlFor:this._id},s("xpl-icon",{key:"2e5374ee3a0c5b18d3891a647b52853b0daa7b9c",icon:"alert-circle",size:16}),s("span",{key:"1a9aa0733831e709aa5923c9486049697e7ab20b"},this.error)))}},[260,"xpl-input",{_id:[1],description:[1],disabled:[4],error:[1],label:[1],name:[1],required:[4],readonly:[4],value:[1],autocomplete:[1],placeholder:[1],post:[1],pre:[1],max:[8],min:[8],step:[2],multiline:[4],maxCharacterCount:[2,"max-character-count"],dateFormat:[1,"date-format"],timeFormat:[1,"time-format"],allowCustomOption:[4,"allow-custom-option"],mode:[1],accept:[1],multiple:[4],hideTriggerOnSelect:[4,"hide-trigger-on-select"],hideFileNames:[4,"hide-file-names"],hideAcceptText:[4,"hide-accept-text"],hideEyeDropper:[4,"hide-eye-dropper"],type:[1],characterCount:[32],passwordVisible:[32]}]);function M(){"undefined"!=typeof customElements&&["xpl-input","xpl-dropdown","xpl-dropdown-group","xpl-dropdown-heading","xpl-dropdown-option","xpl-icon","xpl-input","xpl-input-color","xpl-input-date","xpl-input-file","xpl-input-time","xpl-popover"].forEach((t=>{switch(t){case"xpl-input":customElements.get(o(t))||customElements.define(o(t),_);break;case"xpl-dropdown":customElements.get(o(t))||r();break;case"xpl-dropdown-group":customElements.get(o(t))||n();break;case"xpl-dropdown-heading":customElements.get(o(t))||l();break;case"xpl-dropdown-option":customElements.get(o(t))||h();break;case"xpl-icon":customElements.get(o(t))||p();break;case"xpl-input":customElements.get(o(t))||M();break;case"xpl-input-color":customElements.get(o(t))||$();break;case"xpl-input-date":customElements.get(o(t))||c();break;case"xpl-input-file":customElements.get(o(t))||d();break;case"xpl-input-time":customElements.get(o(t))||k();break;case"xpl-popover":customElements.get(o(t))||u()}}))}export{_ as X,E as a,$ as b,w as c,M as d,k as e}
1
+ import{proxyCustomElement as t,HTMLElement as e,createEvent as i,h as s,Host as a,transformTag as o}from"@stencil/core/internal/client";import{d as r}from"./xpl-dropdown2.js";import{d as n}from"./xpl-dropdown-group2.js";import{d as l}from"./xpl-dropdown-heading2.js";import{d as h}from"./xpl-dropdown-option2.js";import{d as p}from"./xpl-icon2.js";import{d as c}from"./xpl-input-date2.js";import{d}from"./xpl-input-file2.js";import{d as u}from"./xpl-popover2.js";import{v as m}from"./v4.js";const b=(t,e,i)=>{const s=(i/=100)*(e/=100),a=s*(1-Math.abs(t/60%2-1)),o=i-s;let r=0,n=0,l=0;return t<60?(r=s,n=a,l=0):t<120?(r=a,n=s,l=0):t<180?(r=0,n=s,l=a):t<240?(r=0,n=a,l=s):t<300?(r=a,n=0,l=s):(r=s,n=0,l=a),{r:Math.round(255*(r+o)),g:Math.round(255*(n+o)),b:Math.round(255*(l+o))}},x=(t,e,i)=>[t,e,i].map((t=>t.toString(16).padStart(2,"0"))).join(""),f=t=>{var e,i;if(t.startsWith("#")){if(!/^#([a-fA-F\d]{6})$/.test(t))throw new Error("Only 6-digit hex format supported (e.g. #aabbcc)");const e=t.toLowerCase().slice(1),i=parseInt(e.slice(0,2),16),s=parseInt(e.slice(2,4),16),a=parseInt(e.slice(4,6),16);return{hex:e,r:i,g:s,b:a,a:1}}if(t.startsWith("rgba")||t.startsWith("rgb")){const i=null===(e=t.match(/[\d.]+/g))||void 0===e?void 0:e.map(Number);if(!i||i.length<3)throw new Error("Invalid rgba/rgb format");const[s,a,o,r=1]=i,n=t=>t.toString(16).padStart(2,"0");return{hex:`${n(s)}${n(a)}${n(o)}`.toLowerCase(),r:s,g:a,b:o,a:r}}if(t.startsWith("hsla")||t.startsWith("hsl")){const e=null===(i=t.match(/[\d.]+/g))||void 0===i?void 0:i.map(Number);if(!e||e.length<3)throw new Error("Invalid hsla/hsl format");const[s,a,o,r=1]=e,n=((t,e,i,s)=>{i/=100;const a=e=>(e+t/30)%12,o=(e/=100)*Math.min(i,1-i),r=t=>i-o*Math.max(-1,Math.min(a(t)-3,Math.min(9-a(t),1)));return`rgba(${Math.round(255*r(0))}, ${Math.round(255*r(8))}, ${Math.round(255*r(4))}, ${s})`})(s,a,o,r),[l,h,p]=n.match(/[\d.]+/g).map(Number);return{hex:x(l,h,p).toLowerCase(),r:l,g:h,b:p,a:r}}throw new Error("Unsupported color format")},g=t=>t.a&&1!==t.a?`rgba(${t.r}, ${t.g}, ${t.b}, ${t.a})`:`#${t.hex}`;function v(t){const[e,i]=t.split(":"),s=Number(e)>=12?"PM":"AM";return[(Number(e)%12||12).toString(),i,s]}const w=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.valueChange=i(this,"valueChange",7),this.hasErrorStateChanged=i(this,"hasErrorStateChanged",7),this.max="23:59",this.min="00:00",this.step=30,this.mode="single",this.timeFormat="24h",this.allowCustomOption=!1,this.showOptions=!1,this.options=[],this.handleInput=t=>{var e;const i=null===(e=t.target.value)||void 0===e?void 0:e.replace(/[^0-9:apmAPM]/g,"");this.value=i},this.handleFocus=()=>{this.showOptions=!0},this.handleBlur=()=>{this.value=function(t){if(!t||""===t.trim()||0===t.replace(/[^0-9]/g,"").length)return null;let e=t.trim().toLowerCase();e=e.replace(/(\d)\s+(am|pm)/g,"$1$2"),/^\d{1,2}(am|pm)?$/.test(e)&&(e=e.replace(/(am|pm)?$/,":00$1")),/^\d{1,2}$/.test(e)&&(e=`${e}:00`),/^\d{1,2}:\d{1}$/.test(e)&&(e=`${e}0`);const[i,s]=e.split(":"),a=s.replace(/[^0-9]/g,""),o=e.includes("am");return e.includes("pm")||o?o?`${(Number(i)%12).toString().padStart(2,"0")}:${a}`:`${Number(i)%12+12}:${a}`:`${i.padStart(2,"0")}:${a}`}(this.value)},this.handleClick=()=>{this.showOptions=!0}}onValueChange(t){this.valueChange.emit(t),this.updateState(t)}updateState(t){this.formattedValue=this.formatDisplayedTime(t),this.amPm=this.formatDisplayedAmPm(t),this.validateValue()}formatDisplayedTime(t){if(!t)return"";if("12h"===this.timeFormat&&t.includes(":")){const[e,i]=v(t);return`${e}:${i}`}return t}formatDisplayedAmPm(t){if(!t||"12h"!==this.timeFormat)return"";const[,,e]=v(t);return e}validateValue(){this.hasErrorState=this.value?!this.value.includes(":")||this.value.trim().length<4||this.value.trim().length>5?"Invalid time format, must be HH:MM":this.value<this.min||this.value>this.max?"Out of range":this.allowCustomOption||this.options.some((t=>t.value===this.value))?null:"Invalid option":this.required?"required":null}onHasErrorStateChanged(t){this.hasErrorStateChanged.emit(t)}componentDidLoad(){var t;"range"===this.mode&&console.warn("Range mode is not supported for time inputs at this time."),null===(t=this.dropdown)||void 0===t||t.addEventListener("isOpenChange",(t=>{this.showOptions=t.detail}))}componentWillLoad(){this.options=this.getOptions(),this.value&&this.updateState(this.value)}getOptions(){return function(t,e,i,s){const a=t=>{const[e,i]=t.split(":").map(Number);return 60*e+i},o=a(e.toString()),r=a(i.toString()),n=[];for(let e=o;e<=r;e+=t)n.push((l=e,`${Math.floor(l/60).toString().padStart(2,"0")}:${(l%60).toString().padStart(2,"0")}`));var l;return n.map((t=>({label:"12h"===s?function(t){const[e,i,s]=v(t);return`${e}:${i} ${s}`}(t):t,value:t})))}(this.step,this.min.toString(),this.max.toString(),this.timeFormat).map((({label:t,value:e})=>({label:t,value:e,onClick:()=>{this.value=e,this.showOptions=!1}})))}render(){return s(a,{key:"99b06c895d608dec6226f79f21ceda92225428b7",class:{"xpl-input-time":!0,[`xpl-input-time--mode-${this.mode}`]:!0,"xpl-input-time--error":!!this.hasErrorState}},s("xpl-input",{key:"8cdf996f46d969c243d246fdfe888c22c9c4999b",pre:s("xpl-icon",{class:"xpl-input-time__clock-icon",icon:"clock",size:24}),post:"12h"===this.timeFormat?this.amPm||"AM":null,type:"text",_id:this.inputId,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,placeholder:this.placeholder,max:this.max,min:this.min,onInput:this.handleInput,value:this.formattedValue,onFocusEvent:this.handleFocus,onBlurEvent:this.handleBlur,onClick:this.handleClick}),!this.readonly&&!this.disabled&&s("xpl-dropdown",{key:"5213fcd68da96d726d8b046277233afd6b5b20e8",options:this.options,isOpen:this.showOptions,ref:t=>{this.dropdown=t},class:"xpl-input-time__dropdown"}))}static get watchers(){return{value:[{onValueChange:0}],hasErrorState:[{onHasErrorStateChanged:0}]}}},[0,"xpl-input-time",{inputId:[1,"input-id"],disabled:[4],name:[1],required:[4],readonly:[4],value:[1537],placeholder:[1],max:[8],min:[8],step:[2],mode:[1],timeFormat:[1,"time-format"],allowCustomOption:[4,"allow-custom-option"],formattedValue:[32],hasErrorState:[32],showOptions:[32],options:[32],amPm:[32]},void 0,{value:[{onValueChange:0}],hasErrorState:[{onHasErrorStateChanged:0}]}]);function k(){"undefined"!=typeof customElements&&["xpl-input-time","xpl-dropdown","xpl-dropdown-group","xpl-dropdown-heading","xpl-dropdown-option","xpl-icon","xpl-input","xpl-input-color","xpl-input-date","xpl-input-file","xpl-input-time"].forEach((t=>{switch(t){case"xpl-input-time":customElements.get(o(t))||customElements.define(o(t),w);break;case"xpl-dropdown":customElements.get(o(t))||r();break;case"xpl-dropdown-group":customElements.get(o(t))||n();break;case"xpl-dropdown-heading":customElements.get(o(t))||l();break;case"xpl-dropdown-option":customElements.get(o(t))||h();break;case"xpl-icon":customElements.get(o(t))||p();break;case"xpl-input":customElements.get(o(t))||M();break;case"xpl-input-color":customElements.get(o(t))||$();break;case"xpl-input-date":customElements.get(o(t))||c();break;case"xpl-input-file":customElements.get(o(t))||d();break;case"xpl-input-time":customElements.get(o(t))||k()}}))}const y={hex:"",r:0,g:0,b:0,a:1},E=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.inputChange=i(this,"inputChange",7),this.hasErrorStateChanged=i(this,"hasErrorStateChanged",7),this.placeholder="Select color",this.eyeDropperSupported="EyeDropper"in window,this.colorInputElements={hex:null,r:null,g:null,b:null,a:null,hue:null,slGrid:null,alpha:null},this.handleMove=t=>{const e=this.colorInputElements.slGrid.getBoundingClientRect(),i="touches"in t?t.touches[0].clientY:t.clientY,s=Math.max(0,Math.min(("touches"in t?t.touches[0].clientX:t.clientX)-e.left,e.width)),a=Math.max(0,Math.min(i-e.top,e.height)),o=s/e.width,r=a/e.height,n=b(this.hue,100,100),l=(255*(1-o)+o*n.r)*(1-r),h=(255*(1-o)+o*n.g)*(1-r),p=(255*(1-o)+o*n.b)*(1-r),c={r:Math.round(l),g:Math.round(h),b:Math.round(p),hex:x(Math.round(l),Math.round(h),Math.round(p)),a:this.colorValues.a};this.colorValues=c},this.startDrag=t=>{t.preventDefault(),this.handleMove(t),window.addEventListener("mousemove",this.handleMove),window.addEventListener("mouseup",this.stopDrag),window.addEventListener("touchmove",this.handleMove),window.addEventListener("touchend",this.stopDrag)},this.stopDrag=()=>{window.removeEventListener("mousemove",this.handleMove),window.removeEventListener("mouseup",this.stopDrag),window.removeEventListener("touchmove",this.handleMove),window.removeEventListener("touchend",this.stopDrag)},this.onHexInputChange=t=>{var e;const i=t.detail;if(i){const[t,s,a]=(t=>t?t.match(/\w\w/g).map((t=>parseInt(t,16))):[0,0,0])(i);this.colorValues={hex:i,r:t,g:s,b:a,a:null!==(e=this.colorValues.a)&&void 0!==e?e:1}}else this.colorValues=Object.assign({},y)},this.onRgbaInputChange=(t,e)=>{const i=parseFloat(e.detail);if(Number.isNaN(i))return void(this.hasErrorState=`invalid value from ${t.name}: ${i}`);const s=Object.assign({},this.colorValues);switch(t.name){case"color-r-input":s.r=i;break;case"color-g-input":s.g=i;break;case"color-b-input":s.b=i;break;case"color-a-input":s.a=i;break;default:this.hasErrorState=`unhandled input: ${t.name}`}s.hex=x(s.r,s.g,s.b),this.colorValues=s},this.onSliderInputChange=t=>{const e=parseFloat(t.value);if(Number.isNaN(e))this.hasErrorState=`invalid value from ${t.name}: ${e}`;else switch(t.name){case"color-hue-slider":this.colorValues=f(`hsla(${e}, 100%, 50%, 1)`),this.hue=e;break;case"color-alpha-slider":this.colorValues=Object.assign(Object.assign({},this.colorValues),{a:e});break;default:this.hasErrorState=`unhandled input: ${t.name}`}}}valueChanged(t){this.hasErrorState=this.required&&!t.hex?"required":null,this.inputChange.emit(t.hex?g(t):"")}onHasErrorStateChanged(t){this.hasErrorStateChanged.emit(t)}onValuePropChange(t){this.syncColorFromValue(t)}syncColorFromValue(t){if(t)try{this.colorValues=f(t),this.hue=(()=>{const t=this.colorValues.r/255,e=this.colorValues.g/255,i=this.colorValues.b/255,s=Math.max(t,e,i),a=Math.min(t,e,i),o=s-a;let r=0,n=0;const l=(s+a)/2;if(0!==o){switch(n=o/(1-Math.abs(2*l-1)),s){case t:r=(e-i)/o%6;break;case e:r=(i-t)/o+2;break;case i:r=(t-e)/o+4}r*=60,r<0&&(r+=360)}return{hue:Math.round(r),saturation:Math.round(100*n),lightness:Math.round(100*l)}})().hue}catch(t){this.hasErrorState="invalid color format",this.hue=0}else this.colorValues=Object.assign({},y),this.hasErrorState=null,this.hue=0}componentWillLoad(){this.syncColorFromValue(this.value)}componentDidLoad(){const{r:t,g:e,b:i,a:s,hue:a,alpha:o,hex:r}=this.colorInputElements;r.addEventListener("valueChange",(t=>{this.onHexInputChange(t)})),[t,e,i,s].forEach((t=>{t.addEventListener("valueChange",(e=>{this.onRgbaInputChange(t,e)}))})),[a,o].forEach((t=>{t.addEventListener("input",(()=>{this.onSliderInputChange(t)}))}))}async openEyeDropper(){try{const t=new window.EyeDropper,e=await t.open();this.colorValues=f(e.sRGBHex)}catch(t){this.hasErrorState=`eyedropper cancelled or failed: ${t}`}}render(){const{r:t,g:e,b:i,a:o}=this.colorValues,r=b(this.hue,100,100),{x:n,y:l}=((t,e,i,s)=>{const{s:a,v:o}=((t,e,i,s)=>{t/=255,e/=255,i/=255;const a=Math.max(t,e,i),o=a-Math.min(t,e,i);let r=0;return r=0===o?0:a===t?(e-i)/o%6:a===e?(i-t)/o+2:(t-e)/o+4,r=Math.round(60*r),r<0&&(r+=360),{h:null!=s?s:r,s:0===a?0:o/a,v:a}})(e.r,e.g,e.b,t);return{x:Math.round(a*i),y:Math.round((1-o)*s)}})(this.hue,{r:t,g:e,b:i},288,160),h={left:`${n}px`,top:`${l}px`,background:`rgb(${t}, ${e}, ${i})`};return s(a,{key:"639f311d46bbb46e327ae6b05fe24b47795adbf3",class:"xpl-input-color"},s("xpl-popover",{key:"ad9d6145e4e5ac581c6d22f726050767ff82d861",disabled:this.disabled,display:"menu"},s("div",{key:"219e1754388cfc2ecff25b42b67322e780a1e7d6",slot:"trigger"},s("div",{key:"7beafe5304521d496bf7d7f8f82de01c9b7de00d",class:{"xpl-input-color__display":!0,"xpl-input-color__display--disabled":this.disabled,"xpl-input-color__display--error":!!this.hasErrorState}},s("span",{key:"2caae6b87902c50eb754e93ce939797d619da723",class:"xpl-input-color__color",style:{background:g(this.colorValues)}}),this.colorValues.hex?s("span",{class:"xpl-input-color__value"},g(this.colorValues)):s("span",{class:"xpl-input-color__placeholder"},this.placeholder),this.eyeDropperSupported&&!this.hideEyeDropper&&s("xpl-icon",{key:"8cd0f1e94bf2eaf31ad82a4c8d307badef8046fc",size:20,icon:"eye-droper",class:"xpl-input-color__icon",onClick:t=>{t.stopPropagation(),this.openEyeDropper()}}))),s("div",{key:"8e6add90e733d299cea94559dcbc29dd4e64d9cd",class:"xpl-input-color__menu"},s("div",{key:"a488c9b7ef3ff0cabbbb4bf5a631f209034a2539",class:"xpl-input-color__sl-grid",ref:t=>{this.colorInputElements.slGrid=t},style:{background:["linear-gradient(to top, #000, #0000)","linear-gradient(to right, #fff, #fff0)",`rgb(${r.r} ${r.g} ${r.b})`].join(", ")},onMouseDown:this.startDrag,onTouchStart:this.startDrag},s("div",{key:"542a5cafd651e6b49f813f6eecb46088b0b6f97c",class:"xpl-input-color__sl-thumb",style:h})),s("div",{key:"fd3268874bb0c0bc22c2d2db15dd50c38d3ae70a",class:"xpl-input-color__grid"},s("input",{key:"08ea52b5c2bbc2800b2ad5cca6981813e4578ce5",type:"range",min:"0",max:"360",value:this.hue,class:"xpl-input-color__slider xpl-input-color__hue",name:"color-hue-slider",ref:t=>{this.colorInputElements.hue=t}}),s("input",{key:"1692e362cb1e48446f33e2f82c5988546ad6a6f0",type:"range",min:"0",max:"1",step:"0.01",value:o,class:"xpl-input-color__slider xpl-input-color__alpha",name:"color-alpha-slider",ref:t=>{this.colorInputElements.alpha=t},style:{backgroundImage:[`linear-gradient(to right, rgb(${t} ${e} ${i} / 0) 0%, rgb(${t} ${e} ${i} / 1) 100%)`,"linear-gradient(45deg, #ccc 25%, transparent 25%)","linear-gradient(-45deg, #ccc 25%, transparent 25%)","linear-gradient(45deg, transparent 75%, #ccc 75%)","linear-gradient(-45deg, transparent 75%, #ccc 75%)"].join(", ")}}),s("div",{key:"5de3d1979fbb4c4a2892961fcbd7e6fc2d2723b4",class:"xpl-input-color__preview",style:{background:`rgba(${t}, ${e}, ${i}, ${o})`}})),s("div",{key:"3a660bdbb902bc8bfddb8c423f2462404b0221b8",class:"xpl-input-color__inputs"},Object.entries(this.colorInputElements).filter((([t])=>["hex","r","g","b","a"].includes(t))).map((([t])=>s("xpl-input",{key:t,label:t.toLocaleUpperCase(),name:`color-${t}-input`,placeholder:"hex"===t?"793EF7":"0",value:this.colorValues[t],ref:e=>{this.colorInputElements[t]=e}})))))))}static get watchers(){return{colorValues:[{valueChanged:0}],hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValuePropChange:0}]}}},[0,"xpl-input-color",{value:[1],placeholder:[1],disabled:[4],required:[4],hideEyeDropper:[4,"hide-eye-dropper"],hasErrorState:[32],colorValues:[32],eyeDropperSupported:[32],hue:[32]},void 0,{colorValues:[{valueChanged:0}],hasErrorState:[{onHasErrorStateChanged:0}],value:[{onValuePropChange:0}]}]);function $(){"undefined"!=typeof customElements&&["xpl-input-color","xpl-icon","xpl-input","xpl-input-color","xpl-input-date","xpl-input-file","xpl-input-time","xpl-popover"].forEach((t=>{switch(t){case"xpl-input-color":customElements.get(o(t))||customElements.define(o(t),E);break;case"xpl-icon":customElements.get(o(t))||p();break;case"xpl-input":customElements.get(o(t))||M();break;case"xpl-input-color":customElements.get(o(t))||$();break;case"xpl-input-date":customElements.get(o(t))||c();break;case"xpl-input-file":customElements.get(o(t))||d();break;case"xpl-input-time":customElements.get(o(t))||k();break;case"xpl-popover":customElements.get(o(t))||u()}}))}const _=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.focusEvent=i(this,"focusEvent",7),this.blurEvent=i(this,"blurEvent",7),this.valueChange=i(this,"valueChange",7),this.inputEvent=i(this,"inputEvent",7),this.multiline=!1,this.dateFormat="Y-m-d",this.timeFormat="24h",this.allowCustomOption=!1,this.mode="single",this.accept="",this.multiple=!1,this.hideTriggerOnSelect=!1,this.hideFileNames=!1,this.hideAcceptText=!1,this.type="text",this.valueChanged=t=>{this.valueChange.emit(t.target.value)},this.characterCount=0,this.passwordVisible=!1,this.handleFocus=t=>{this.focusEvent.emit(t)},this.handleBlur=t=>{this.blurEvent.emit(t)},this.handleInput=t=>{this.multiline&&this.updateCharacterCount();const{value:e}=t.target;this.inputEvent.emit(e)}}updateCharacterCount(){this.characterCount=this.input.value.length}componentWillLoad(){null!=this._id&&""!==this._id||(this._id=m()),this.multiline&&void 0!==this.maxCharacterCount&&(this.characterCount=void 0!==this.value?this.value.length:0)}renderInput(){switch(this.type){case"file":return s("xpl-input-file",{accept:this.accept,disabled:this.disabled,hideAcceptText:this.hideAcceptText,hideFileNames:this.hideFileNames,hideTriggerOnSelect:this.hideTriggerOnSelect,multiple:this.multiple,name:this.name,_id:this._id},s("slot",{name:"trigger"}));case"color":return s("xpl-input-color",{disabled:this.disabled,value:this.value,placeholder:this.placeholder,required:this.required,hideEyeDropper:this.hideEyeDropper});case"date":return s("xpl-input-date",{inputId:this._id,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,value:this.value,placeholder:this.placeholder,post:this.post,pre:this.pre,max:this.max,min:this.min,dateFormat:this.dateFormat,mode:this.mode});case"time":return s("xpl-input-time",{inputId:this._id,disabled:this.disabled,name:this.name,required:this.required,readonly:this.readonly,value:this.value,placeholder:this.placeholder,max:this.max,min:this.min,step:this.step,mode:this.mode,timeFormat:this.timeFormat,allowCustomOption:this.allowCustomOption});default:return s("div",{class:"xpl-input-wrapper"},this.pre&&!this.multiline&&s("label",{class:"xpl-input-pre",htmlFor:this._id},this.pre),this.multiline?s("textarea",{disabled:this.disabled,id:this._id,name:this.name,placeholder:this.placeholder,readonly:this.readonly,ref:t=>{this.input=t},required:this.required,onChange:this.valueChanged,onFocus:this.handleFocus,onBlur:this.handleBlur,onInput:this.handleInput},this.value):s("input",{autocomplete:this.autocomplete,disabled:this.disabled,id:this._id,max:this.max,min:this.min,name:this.name,placeholder:this.placeholder,readonly:this.readonly,ref:t=>{this.input=t},required:this.required,step:this.step,type:this.type,value:this.value,onChange:this.valueChanged,onFocus:this.handleFocus,onBlur:this.handleBlur,onInput:this.handleInput}),"password"===this.type&&s("button",{"aria-label":"Toggle password visibility",class:"xpl-input-password",onClick:()=>{this.passwordVisible=!this.passwordVisible},role:"presentation"},s("xpl-icon",{icon:this.passwordVisible?"eye-closed":"eye",size:24})),this.post&&!this.multiline&&s("label",{class:"xpl-input-post",htmlFor:this._id},this.post),this.multiline&&void 0!==this.maxCharacterCount&&s("span",{class:"xpl-input-characters"},this.characterCount,"/",this.maxCharacterCount))}}render(){var t;let e=!1;return(this.error||this.multiline&&void 0!==this.maxCharacterCount&&this.characterCount>this.maxCharacterCount)&&(e=!0),s(a,{key:"c682985a3d592f9f9902a16013a5d00f40ce5e44",class:{"xpl-input":!0,"xpl-input--disabled":this.disabled,"xpl-input--error":e,"xpl-input--readonly":this.readonly,[`xpl-input--${this.type}`]:!0}},this.label&&s("label",{key:"21d863221e85a255f3dc5e662139b7abc0e72907",class:"xpl-input-label",htmlFor:this._id},this.label,this.description&&s("small",{key:"25d078a667c8b9cbf4d1b5d1f412c3d0e736013a"},this.description)),this.renderInput(),(null===(t=this.error)||void 0===t?void 0:t.length)>0&&s("label",{key:"7e13c1fc18496bdf50cdb2a239c113c182b83f18",class:"xpl-input-error",htmlFor:this._id},s("xpl-icon",{key:"900d641cfcd94d9f6cc85ba34e1e211448c203df",icon:"alert-circle",size:16}),s("span",{key:"74f7868861f5c262038bee3de2faeecc46b2454d"},this.error)))}},[260,"xpl-input",{_id:[1],description:[1],disabled:[4],error:[1],label:[1],name:[1],required:[4],readonly:[4],value:[1],autocomplete:[1],placeholder:[1],post:[1],pre:[1],max:[8],min:[8],step:[2],multiline:[4],maxCharacterCount:[2,"max-character-count"],dateFormat:[1,"date-format"],timeFormat:[1,"time-format"],allowCustomOption:[4,"allow-custom-option"],mode:[1],accept:[1],multiple:[4],hideTriggerOnSelect:[4,"hide-trigger-on-select"],hideFileNames:[4,"hide-file-names"],hideAcceptText:[4,"hide-accept-text"],hideEyeDropper:[4,"hide-eye-dropper"],type:[1],characterCount:[32],passwordVisible:[32]}]);function M(){"undefined"!=typeof customElements&&["xpl-input","xpl-dropdown","xpl-dropdown-group","xpl-dropdown-heading","xpl-dropdown-option","xpl-icon","xpl-input","xpl-input-color","xpl-input-date","xpl-input-file","xpl-input-time","xpl-popover"].forEach((t=>{switch(t){case"xpl-input":customElements.get(o(t))||customElements.define(o(t),_);break;case"xpl-dropdown":customElements.get(o(t))||r();break;case"xpl-dropdown-group":customElements.get(o(t))||n();break;case"xpl-dropdown-heading":customElements.get(o(t))||l();break;case"xpl-dropdown-option":customElements.get(o(t))||h();break;case"xpl-icon":customElements.get(o(t))||p();break;case"xpl-input":customElements.get(o(t))||M();break;case"xpl-input-color":customElements.get(o(t))||$();break;case"xpl-input-date":customElements.get(o(t))||c();break;case"xpl-input-file":customElements.get(o(t))||d();break;case"xpl-input-time":customElements.get(o(t))||k();break;case"xpl-popover":customElements.get(o(t))||u()}}))}export{_ as X,E as a,$ as b,w as c,M as d,k as e}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as t,createEvent as s,h as i,Host as l,Fragment as o,transformTag as n}from"@stencil/core/internal/client";import{t as a}from"./index3.js";import{d as h}from"./xpl-dropdown2.js";import{d}from"./xpl-dropdown-group2.js";import{d as c}from"./xpl-dropdown-heading2.js";import{d as r}from"./xpl-dropdown-option2.js";import{d as p}from"./xpl-icon2.js";import{d as u}from"./xpl-tag2.js";import{v}from"./v4.js";function m(e){return e.label||e.value}function b(e){return e.reduce(((e,t)=>[...e,...t.groupName?t.options:[t]]),[])}const g=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.selectChange=s(this,"selectChange",7),this.changeEvent=s(this,"changeEvent",7),this.dropdownStateChange=s(this,"dropdownStateChange",7),this.triggerDropdown=s(this,"triggerDropdown",7),this.choices=[],this.selectIcon="chevron-down",this.mode="single",this.truncate=!0,this.active=!1,this.id=v(),this.keepFocus=!1,this.visibleChoices=1/0,this.choicesState=[],this.value=this.calculateValue(),this.dropdownOpenState=!1,this.container=null,this.dropdown=null,this.handleResizeThrottled=a((()=>{this.maybeTruncateChoices()}),250),this.handleTabKeyDown=e=>{"Tab"===e.key&&(this.keepFocus=!0)},this.handleTagRemove=e=>{const t=t=>(null==e?void 0:e.value)&&t.value===e.value||(null==e?void 0:e.label)&&t.label===e.label;this.choicesState=this.choicesState.map((e=>{var s;return Object.assign(Object.assign({},e),{isSelected:!t(e)&&e.isSelected,options:null===(s=e.options)||void 0===s?void 0:s.map((e=>Object.assign(Object.assign({},e),{isSelected:!t(e)&&e.isSelected})))})}))},this.handleDropdownScroll=e=>{const{scrollTop:t,scrollHeight:s,clientHeight:i}=this.dropdown.querySelector(".xpl-dropdown-list");(0===t&&e.deltaY<0||t+i>=s&&e.deltaY>0)&&e.preventDefault()}}onChoicesPropChanged(e){this.choicesState=this.initializeChoicesState()}onSelectedValuesPropChanged(){this.choicesState=this.initializeChoicesState()}onChoicesStateChanged(){this.update()}handleValueStateChange(e){this.selectChange.emit(e),this.changeEvent.emit("single"===this.mode?e:(null==e?void 0:e.length)?e.split("|"):[]),this.customDisplayValue&&null!==this.container&&(this.container.querySelectorAll(".custom-display-value").forEach((t=>{t.classList.toggle("display-active",e.length>0),t.classList.toggle("display-inactive",0===e.length)})),this.container.querySelectorAll(".placeholder").forEach((t=>{t.classList.toggle("placeholder-hidden",e.length>0)})))}onDropdownOpenStateChanged(e){this.dropdownStateChange.emit(e)}initializeChoicesState(){return this.choices.map((e=>{var t;const s="string"==typeof this.selectedValues?[this.selectedValues]:this.selectedValues;return Object.assign(Object.assign({},e),{isSelected:e.isSelected||(null==s?void 0:s.includes(e.value||e.label)),options:null===(t=e.options)||void 0===t?void 0:t.map((e=>Object.assign(Object.assign({},e),{isSelected:e.isSelected||(null==s?void 0:s.includes(e.value||e.label))})))})}))}maybeTruncateChoices(){var e,t;if("single"===this.mode||!this.truncate)return;const s=null===(e=this.container)||void 0===e?void 0:e.getBoundingClientRect().width;let i=0,l=0;const o=null===(t=b(this.choicesState))||void 0===t?void 0:t.filter((e=>e.isSelected));if(!o.length)return;const n=o.length;o.forEach(((e,t)=>(l+=function(e){const t=document.createElement("canvas").getContext("2d");return t.font="14px apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif",t.measureText(e).width+44}(m(o[t])),l>s-140||(i+=1),null))),i>=n&&(i=1/0),i<1&&(i=1),this.visibleChoices=i}closeDropdown(){var e;(null===(e=this.dropdown)||void 0===e?void 0:e.isOpen)&&(this.dropdown.isOpen=!1,this.active=!1)}calculateValue(){const e=b(this.choicesState).filter((e=>e.isSelected));return e.length?"single"===this.mode?e[0].value||e[0].label:e.map((e=>e.value||e.label)).join("|"):""}update(){this.value=this.calculateValue(),this.maybeTruncateChoices()}renderLabel(){return this.label||this.description?i("label",{class:{"xpl-label":!0,"xpl-label--disabled":this.disabled},htmlFor:this.id},this.label,this.description&&i("small",{class:{"xpl-description":!0,"xpl-description--disabled":this.disabled}},this.description)):null}renderSelectedTags(){let e=0;const t=b(this.choicesState).filter((e=>e.isSelected));return t.length?t.map(((s,l)=>e>=this.visibleChoices?null:(e+=1,i("xpl-tag",{onClose:()=>this.handleTagRemove(t[l])},m(t[l]))))):null}renderError(){return void 0===this.error||0===this.error.length?null:i("label",{class:"xpl-input-error",htmlFor:this.id},i("xpl-icon",{icon:"alert-circle"}),this.error)}componentWillLoad(){this.choicesState=this.initializeChoicesState()}handleClickEvent(e){const t=e.target.closest(".xpl-select");null!==t&&t===this.container||this.closeDropdown()}handleKeyDown(e){var t;"Escape"===e.key&&(this.active||(null===(t=this.container)||void 0===t?void 0:t.contains(document.activeElement)))&&this.closeDropdown()}handleResize(){this.handleResizeThrottled()}componentDidLoad(){requestAnimationFrame((()=>{this.maybeTruncateChoices()}))}disconnectedCallback(){var e;null===(e=this.handleResizeThrottled)||void 0===e||e.cancel()}handleDropdownTrigger(){var e;const t=null!==(e=this.dropdown.isOpen)&&void 0!==e&&e,s=!t;this.triggerDropdown.emit({prevState:t,nextState:s}).defaultPrevented||this.disabled||(this.dropdownOpenState=s,this.dropdown.isOpen=s)}async reset(){this.closeDropdown(),this.choicesState=this.choicesState.map((e=>{var t;return Object.assign(Object.assign({},e),{isSelected:!1,options:null===(t=e.options)||void 0===t?void 0:t.map((e=>Object.assign(Object.assign({},e),{isSelected:!1})))})}))}render(){var e,t,s;const n=b(this.choicesState).filter((e=>e.isSelected)),a=(null===(e=n[0])||void 0===e?void 0:e.label)||(null===(t=n[0])||void 0===t?void 0:t.value),h=n.length>1&&this.visibleChoices<1/0&&this.truncate&&!this.customDisplayValue,d=`+ ${Math.abs(this.choicesState.filter((e=>e.isSelected)).length-this.visibleChoices)} more`;return i(l,{key:"8ffd6b069df2b869abfa22ae5e41731a992abe36",class:{"xpl-select":!0,"xpl-select--disabled":this.disabled,"xpl-select--no-truncate":!this.truncate,[null!==(s=this.classNames)&&void 0!==s?s:""]:!!this.classNames},onKeyDown:this.handleTabKeyDown,ref:e=>{this.container=e}},this.renderLabel(),i("div",{key:"ed959919397c5c2ffc063957188e00a10feeed9a",class:{"xpl-input":!0,"xpl-input--disabled":this.disabled,"xpl-input--error":void 0!==this.error}},i("div",{key:"266e7d99a66d66241ebe1d20375d0a270b8b6399",class:"xpl-input-wrapper"},i("button",{key:"cdb455539afb77ab76f729e8a21419d32c220a75",class:"xpl-select__trigger",disabled:this.disabled,id:this.id,onKeyDown:this.handleTabKeyDown,onClick:e=>{e.preventDefault(),this.handleDropdownTrigger()},type:"button"},i("div",{key:"db9e85fa588af2c35d3de960826c171bc02627af",class:{"xpl-select-value":!0,"xpl-select-value--active":"multi"===this.mode&&this.value.length>0,"has-value":this.value.length>0}},(()=>this.customDisplayValue?i(o,null,i("div",{class:{"custom-display-value":!0,"custom-display-value--inactive":0===this.value.length}},i("slot",{name:"custom-display-value"})),i("span",{class:{"xpl-placeholder--hidden":this.value.length>0}},this.placeholder)):"single"===this.mode?a||this.placeholder:this.value.length>0?this.renderSelectedTags():this.placeholder)(),h&&d),i("xpl-icon",{key:"ef3997f19a4e4bb4de12f826c736ef9afc4bd5c8",class:"xpl-select__chevron-down",icon:this.selectIcon}))),!this.disabled&&i("xpl-dropdown",{key:"df29a0a21c11fa4c9a550a4339c6719793783404",ref:e=>{this.dropdown=e},isOpen:this.dropdownOpenState,options:this.choicesState,selectedValues:this.selectedValues,mode:this.mode,triggerId:this.id,update:(e,{component:t})=>{const{options:s}=t;s&&s.length>0&&(this.choicesState=s)},onIsOpenChange:e=>{this.dropdownOpenState=e.detail},onWheel:this.handleDropdownScroll,anchorToTrigger:!0}),this.renderError()),i("input",{key:"3e7f53a0d8e6d4e8028e1dc38d0e3661b76978f5",type:"hidden",name:this.name,value:this.value}))}static get watchers(){return{choices:[{onChoicesPropChanged:0}],selectedValues:[{onSelectedValuesPropChanged:0}],choicesState:[{onChoicesStateChanged:0}],value:[{handleValueStateChange:0}],dropdownOpenState:[{onDropdownOpenStateChanged:0}]}}},[260,"xpl-select",{choices:[16],selectIcon:[1,"select-icon"],description:[1],disabled:[4],error:[1],label:[1],mode:[1],name:[1],placeholder:[1],truncate:[4],customDisplayValue:[4,"custom-display-value"],selectedValues:[1,"selected-values"],classNames:[1,"class-names"],active:[32],id:[32],keepFocus:[32],visibleChoices:[32],choicesState:[32],value:[32],dropdownOpenState:[32],reset:[64]},[[8,"click","handleClickEvent"],[8,"keydown","handleKeyDown"],[9,"resize","handleResize"]],{choices:[{onChoicesPropChanged:0}],selectedValues:[{onSelectedValuesPropChanged:0}],choicesState:[{onChoicesStateChanged:0}],value:[{handleValueStateChange:0}],dropdownOpenState:[{onDropdownOpenStateChanged:0}]}]);function x(){"undefined"!=typeof customElements&&["xpl-select","xpl-dropdown","xpl-dropdown-group","xpl-dropdown-heading","xpl-dropdown-option","xpl-icon","xpl-tag"].forEach((e=>{switch(e){case"xpl-select":customElements.get(n(e))||customElements.define(n(e),g);break;case"xpl-dropdown":customElements.get(n(e))||h();break;case"xpl-dropdown-group":customElements.get(n(e))||d();break;case"xpl-dropdown-heading":customElements.get(n(e))||c();break;case"xpl-dropdown-option":customElements.get(n(e))||r();break;case"xpl-icon":customElements.get(n(e))||p();break;case"xpl-tag":customElements.get(n(e))||u()}}))}export{g as X,x as d}
1
+ import{proxyCustomElement as e,HTMLElement as t,createEvent as s,h as i,Host as l,Fragment as o,transformTag as n}from"@stencil/core/internal/client";import{t as a}from"./index3.js";import{d}from"./xpl-dropdown2.js";import{d as h}from"./xpl-dropdown-group2.js";import{d as c}from"./xpl-dropdown-heading2.js";import{d as r}from"./xpl-dropdown-option2.js";import{d as p}from"./xpl-icon2.js";import{d as u}from"./xpl-tag2.js";import{v}from"./v4.js";function m(e){return e.label||e.value}function b(e){return e.reduce(((e,t)=>[...e,...t.groupName?t.options:[t]]),[])}const g=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.selectChange=s(this,"selectChange",7),this.changeEvent=s(this,"changeEvent",7),this.dropdownStateChange=s(this,"dropdownStateChange",7),this.triggerDropdown=s(this,"triggerDropdown",7),this.choices=[],this.selectIcon="chevron-down",this.mode="single",this.truncate=!0,this.active=!1,this.id=v(),this.keepFocus=!1,this.visibleChoices=1/0,this.choicesState=[],this.value=this.calculateValue(),this.dropdownOpenState=!1,this.container=null,this.dropdown=null,this.handleResizeThrottled=a((()=>{this.maybeTruncateChoices()}),250),this.handleTabKeyDown=e=>{"Tab"===e.key&&(this.keepFocus=!0)},this.handleTagRemove=e=>{const t=t=>(null==e?void 0:e.value)&&t.value===e.value||(null==e?void 0:e.label)&&t.label===e.label;this.choicesState=this.choicesState.map((e=>{var s;return Object.assign(Object.assign({},e),{isSelected:!t(e)&&e.isSelected,options:null===(s=e.options)||void 0===s?void 0:s.map((e=>Object.assign(Object.assign({},e),{isSelected:!t(e)&&e.isSelected})))})}))},this.handleDropdownScroll=e=>{const{scrollTop:t,scrollHeight:s,clientHeight:i}=this.dropdown.querySelector(".xpl-dropdown-list");(0===t&&e.deltaY<0||t+i>=s&&e.deltaY>0)&&e.preventDefault()}}onChoicesPropChanged(e){this.choicesState=this.initializeChoicesState()}onSelectedValuesPropChanged(){this.choicesState=this.initializeChoicesState()}onChoicesStateChanged(){this.update()}handleValueStateChange(e){this.selectChange.emit(e),this.changeEvent.emit("single"===this.mode?e:(null==e?void 0:e.length)?e.split("|"):[]),this.customDisplayValue&&null!==this.container&&(this.container.querySelectorAll(".custom-display-value").forEach((t=>{t.classList.toggle("display-active",e.length>0),t.classList.toggle("display-inactive",0===e.length)})),this.container.querySelectorAll(".placeholder").forEach((t=>{t.classList.toggle("placeholder-hidden",e.length>0)})))}onDropdownOpenStateChanged(e){this.dropdownStateChange.emit(e)}initializeChoicesState(){return this.choices.map((e=>{var t;const s="string"==typeof this.selectedValues?[this.selectedValues]:this.selectedValues;return Object.assign(Object.assign({},e),{isSelected:e.isSelected||(null==s?void 0:s.includes(e.value||e.label)),options:null===(t=e.options)||void 0===t?void 0:t.map((e=>Object.assign(Object.assign({},e),{isSelected:e.isSelected||(null==s?void 0:s.includes(e.value||e.label))})))})}))}maybeTruncateChoices(){var e,t;if("single"===this.mode||!this.truncate)return;const s=null===(e=this.container)||void 0===e?void 0:e.getBoundingClientRect().width;let i=0,l=0;const o=null===(t=b(this.choicesState))||void 0===t?void 0:t.filter((e=>e.isSelected));if(!o.length)return;const n=o.length;o.forEach(((e,t)=>(l+=function(e){const t=document.createElement("canvas").getContext("2d");return t.font="14px apple-system, system-ui, 'Segoe UI', Arial, Helvetica, Roboto, sans-serif",t.measureText(e).width+44}(m(o[t])),l>s-140||(i+=1),null))),i>=n&&(i=1/0),i<1&&(i=1),this.visibleChoices=i}closeDropdown(){var e;(null===(e=this.dropdown)||void 0===e?void 0:e.isOpen)&&(this.dropdown.isOpen=!1,this.active=!1)}calculateValue(){const e=b(this.choicesState).filter((e=>e.isSelected));return e.length?"single"===this.mode?e[0].value||e[0].label:e.map((e=>e.value||e.label)).join("|"):""}update(){this.value=this.calculateValue(),this.maybeTruncateChoices()}renderLabel(){return this.label||this.description?i("label",{class:{"xpl-label":!0,"xpl-label--disabled":this.disabled},htmlFor:this.id},this.label,this.description&&i("small",{class:{"xpl-description":!0,"xpl-description--disabled":this.disabled}},this.description)):null}renderSelectedTags(){let e=0;const t=b(this.choicesState).filter((e=>e.isSelected));return t.length?t.map(((s,l)=>e>=this.visibleChoices?null:(e+=1,i("xpl-tag",{onClose:()=>this.handleTagRemove(t[l])},m(t[l]))))):null}renderError(){return this.error?i("label",{class:"xpl-input-error",htmlFor:this.id},i("xpl-icon",{icon:"alert-circle"}),this.error):null}componentWillLoad(){this.choicesState=this.initializeChoicesState()}handleClickEvent(e){const t=e.target.closest(".xpl-select");null!==t&&t===this.container||this.closeDropdown()}handleKeyDown(e){var t;"Escape"===e.key&&(this.active||(null===(t=this.container)||void 0===t?void 0:t.contains(document.activeElement)))&&this.closeDropdown()}handleResize(){this.handleResizeThrottled()}componentDidLoad(){requestAnimationFrame((()=>{this.maybeTruncateChoices()}))}disconnectedCallback(){var e;null===(e=this.handleResizeThrottled)||void 0===e||e.cancel()}handleDropdownTrigger(){var e;const t=null!==(e=this.dropdown.isOpen)&&void 0!==e&&e,s=!t;this.triggerDropdown.emit({prevState:t,nextState:s}).defaultPrevented||this.disabled||(this.dropdownOpenState=s,this.dropdown.isOpen=s)}async reset(){this.closeDropdown(),this.choicesState=this.choicesState.map((e=>{var t;return Object.assign(Object.assign({},e),{isSelected:!1,options:null===(t=e.options)||void 0===t?void 0:t.map((e=>Object.assign(Object.assign({},e),{isSelected:!1})))})}))}render(){var e,t,s,n;const a=b(this.choicesState).filter((e=>e.isSelected)),d=(null===(e=a[0])||void 0===e?void 0:e.label)||(null===(t=a[0])||void 0===t?void 0:t.value),h=a.length>1&&this.visibleChoices<1/0&&this.truncate&&!this.customDisplayValue,c=`+ ${Math.abs(this.choicesState.filter((e=>e.isSelected)).length-this.visibleChoices)} more`;return i(l,{key:"dd41611f279bfdf8ca7bf3673ff0e4421c9adbd5",class:{"xpl-select":!0,"xpl-select--disabled":this.disabled,"xpl-select--no-truncate":!this.truncate,[null!==(s=this.classNames)&&void 0!==s?s:""]:!!this.classNames},onKeyDown:this.handleTabKeyDown,ref:e=>{this.container=e}},this.renderLabel(),i("div",{key:"8579aece1497e108177fab248d7dd0bcd4baadf3",class:{"xpl-input":!0,"xpl-input--disabled":this.disabled,"xpl-input--error":(null===(n=this.error)||void 0===n?void 0:n.length)>=0}},i("div",{key:"7a2f274cffcbb2c97acd96244290494568fdbbc9",class:"xpl-input-wrapper"},i("button",{key:"332b3c6a714bb6f30a20f42e129b2f1ef78dda2d",class:"xpl-select__trigger",disabled:this.disabled,id:this.id,onKeyDown:this.handleTabKeyDown,onClick:e=>{e.preventDefault(),this.handleDropdownTrigger()},type:"button"},i("div",{key:"ecb836e8d199e36d455f477fd9be38103b6e2ac6",class:{"xpl-select-value":!0,"xpl-select-value--active":"multi"===this.mode&&this.value.length>0,"has-value":this.value.length>0}},(()=>this.customDisplayValue?i(o,null,i("div",{class:{"custom-display-value":!0,"custom-display-value--inactive":0===this.value.length}},i("slot",{name:"custom-display-value"})),i("span",{class:{"xpl-placeholder--hidden":this.value.length>0}},this.placeholder)):"single"===this.mode?d||this.placeholder:this.value.length>0?this.renderSelectedTags():this.placeholder)(),h&&c),i("xpl-icon",{key:"46d0759da7e730e00d6eb4839ba2eda1e711dd59",class:"xpl-select__chevron-down",icon:this.selectIcon}))),!this.disabled&&i("xpl-dropdown",{key:"4ac71c53ae935940c5de9d4c65034b0bf312da79",ref:e=>{this.dropdown=e},isOpen:this.dropdownOpenState,options:this.choicesState,selectedValues:this.selectedValues,mode:this.mode,triggerId:this.id,update:(e,{component:t})=>{const{options:s}=t;s&&s.length>0&&(this.choicesState=s)},onIsOpenChange:e=>{this.dropdownOpenState=e.detail},onWheel:this.handleDropdownScroll,anchorToTrigger:!0}),this.renderError()),i("input",{key:"d80e5ab1219e98130e4c38264a711839d4d9668f",type:"hidden",name:this.name,value:this.value}))}static get watchers(){return{choices:[{onChoicesPropChanged:0}],selectedValues:[{onSelectedValuesPropChanged:0}],choicesState:[{onChoicesStateChanged:0}],value:[{handleValueStateChange:0}],dropdownOpenState:[{onDropdownOpenStateChanged:0}]}}},[260,"xpl-select",{choices:[16],selectIcon:[1,"select-icon"],description:[1],disabled:[4],error:[1],label:[1],mode:[1],name:[1],placeholder:[1],truncate:[4],customDisplayValue:[4,"custom-display-value"],selectedValues:[1,"selected-values"],classNames:[1,"class-names"],active:[32],id:[32],keepFocus:[32],visibleChoices:[32],choicesState:[32],value:[32],dropdownOpenState:[32],reset:[64]},[[8,"click","handleClickEvent"],[8,"keydown","handleKeyDown"],[9,"resize","handleResize"]],{choices:[{onChoicesPropChanged:0}],selectedValues:[{onSelectedValuesPropChanged:0}],choicesState:[{onChoicesStateChanged:0}],value:[{handleValueStateChange:0}],dropdownOpenState:[{onDropdownOpenStateChanged:0}]}]);function x(){"undefined"!=typeof customElements&&["xpl-select","xpl-dropdown","xpl-dropdown-group","xpl-dropdown-heading","xpl-dropdown-option","xpl-icon","xpl-tag"].forEach((e=>{switch(e){case"xpl-select":customElements.get(n(e))||customElements.define(n(e),g);break;case"xpl-dropdown":customElements.get(n(e))||d();break;case"xpl-dropdown-group":customElements.get(n(e))||h();break;case"xpl-dropdown-heading":customElements.get(n(e))||c();break;case"xpl-dropdown-option":customElements.get(n(e))||r();break;case"xpl-icon":customElements.get(n(e))||p();break;case"xpl-tag":customElements.get(n(e))||u()}}))}export{g as X,x as d}
@@ -3057,20 +3057,21 @@ const XplInput = class {
3057
3057
  render() {
3058
3058
  var _a;
3059
3059
  let hasError = false;
3060
- if (this.error !== undefined)
3060
+ if (this.error) {
3061
3061
  hasError = true;
3062
- if (this.multiline &&
3062
+ }
3063
+ else if (this.multiline &&
3063
3064
  this.maxCharacterCount !== undefined &&
3064
3065
  this.characterCount > this.maxCharacterCount) {
3065
3066
  hasError = true;
3066
3067
  }
3067
- return (h(Host, { key: '4dca16ca0939ae6365edc9201e00ec6cf76aadfc', class: {
3068
+ return (h(Host, { key: 'c682985a3d592f9f9902a16013a5d00f40ce5e44', class: {
3068
3069
  'xpl-input': true,
3069
3070
  'xpl-input--disabled': this.disabled,
3070
3071
  'xpl-input--error': hasError,
3071
3072
  'xpl-input--readonly': this.readonly,
3072
3073
  [`xpl-input--${this.type}`]: true,
3073
- } }, this.label && (h("label", { key: '2abed2c330a6cb7fbad8274299a7012b09c22b03', class: "xpl-input-label", htmlFor: this._id }, this.label, this.description && h("small", { key: '4f310894b28354d9540aa73b4e87872632eb9c83' }, this.description))), this.renderInput(), ((_a = this.error) === null || _a === void 0 ? void 0 : _a.length) > 0 && (h("label", { key: 'ed5cd40feaa1d9d76d6b569c9b9c51da178d162d', class: "xpl-input-error", htmlFor: this._id }, h("xpl-icon", { key: '2e5374ee3a0c5b18d3891a647b52853b0daa7b9c', icon: "alert-circle", size: 16 }), h("span", { key: '1a9aa0733831e709aa5923c9486049697e7ab20b' }, this.error)))));
3074
+ } }, this.label && (h("label", { key: '21d863221e85a255f3dc5e662139b7abc0e72907', class: "xpl-input-label", htmlFor: this._id }, this.label, this.description && h("small", { key: '25d078a667c8b9cbf4d1b5d1f412c3d0e736013a' }, this.description))), this.renderInput(), ((_a = this.error) === null || _a === void 0 ? void 0 : _a.length) > 0 && (h("label", { key: '7e13c1fc18496bdf50cdb2a239c113c182b83f18', class: "xpl-input-error", htmlFor: this._id }, h("xpl-icon", { key: '900d641cfcd94d9f6cc85ba34e1e211448c203df', icon: "alert-circle", size: 16 }), h("span", { key: '74f7868861f5c262038bee3de2faeecc46b2454d' }, this.error)))));
3074
3075
  }
3075
3076
  };
3076
3077
 
@@ -4870,7 +4871,7 @@ const XplSelect = class {
4870
4871
  return tags;
4871
4872
  }
4872
4873
  renderError() {
4873
- if (this.error === undefined || this.error.length === 0)
4874
+ if (!this.error)
4874
4875
  return null;
4875
4876
  return (h("label", { class: "xpl-input-error", htmlFor: this.id }, h("xpl-icon", { icon: "alert-circle" }), this.error));
4876
4877
  }
@@ -4924,7 +4925,7 @@ const XplSelect = class {
4924
4925
  });
4925
4926
  }
4926
4927
  render() {
4927
- var _a, _b, _c;
4928
+ var _a, _b, _c, _d;
4928
4929
  const selectedChoices = flattenChoices(this.choicesState).filter((choice) => choice.isSelected);
4929
4930
  const displayedValue = ((_a = selectedChoices[0]) === null || _a === void 0 ? void 0 : _a.label) || ((_b = selectedChoices[0]) === null || _b === void 0 ? void 0 : _b.value);
4930
4931
  const isTextTruncated = selectedChoices.length > 1 &&
@@ -4932,21 +4933,21 @@ const XplSelect = class {
4932
4933
  this.truncate &&
4933
4934
  !this.customDisplayValue;
4934
4935
  const truncatedText = `+ ${Math.abs(this.choicesState.filter((a) => a.isSelected).length - this.visibleChoices)} more`;
4935
- return (h(Host, { key: '8ffd6b069df2b869abfa22ae5e41731a992abe36', class: {
4936
+ return (h(Host, { key: 'dd41611f279bfdf8ca7bf3673ff0e4421c9adbd5', class: {
4936
4937
  'xpl-select': true,
4937
4938
  'xpl-select--disabled': this.disabled,
4938
4939
  'xpl-select--no-truncate': !this.truncate,
4939
4940
  [(_c = this.classNames) !== null && _c !== void 0 ? _c : '']: !!this.classNames,
4940
4941
  }, onKeyDown: this.handleTabKeyDown, ref: (el) => {
4941
4942
  this.container = el;
4942
- } }, this.renderLabel(), h("div", { key: 'ed959919397c5c2ffc063957188e00a10feeed9a', class: {
4943
+ } }, this.renderLabel(), h("div", { key: '8579aece1497e108177fab248d7dd0bcd4baadf3', class: {
4943
4944
  'xpl-input': true,
4944
4945
  'xpl-input--disabled': this.disabled,
4945
- 'xpl-input--error': this.error !== undefined,
4946
- } }, h("div", { key: '266e7d99a66d66241ebe1d20375d0a270b8b6399', class: "xpl-input-wrapper" }, h("button", { key: 'cdb455539afb77ab76f729e8a21419d32c220a75', class: "xpl-select__trigger", disabled: this.disabled, id: this.id, onKeyDown: this.handleTabKeyDown, onClick: (e) => {
4946
+ 'xpl-input--error': ((_d = this.error) === null || _d === void 0 ? void 0 : _d.length) >= 0,
4947
+ } }, h("div", { key: '7a2f274cffcbb2c97acd96244290494568fdbbc9', class: "xpl-input-wrapper" }, h("button", { key: '332b3c6a714bb6f30a20f42e129b2f1ef78dda2d', class: "xpl-select__trigger", disabled: this.disabled, id: this.id, onKeyDown: this.handleTabKeyDown, onClick: (e) => {
4947
4948
  e.preventDefault();
4948
4949
  this.handleDropdownTrigger();
4949
- }, type: "button" }, h("div", { key: 'db9e85fa588af2c35d3de960826c171bc02627af', class: {
4950
+ }, type: "button" }, h("div", { key: 'ecb836e8d199e36d455f477fd9be38103b6e2ac6', class: {
4950
4951
  'xpl-select-value': true,
4951
4952
  'xpl-select-value--active': this.mode === 'multi' && this.value.length > 0,
4952
4953
  'has-value': this.value.length > 0,
@@ -4966,7 +4967,7 @@ const XplSelect = class {
4966
4967
  return this.renderSelectedTags();
4967
4968
  }
4968
4969
  return this.placeholder;
4969
- })(), isTextTruncated && truncatedText), h("xpl-icon", { key: 'ef3997f19a4e4bb4de12f826c736ef9afc4bd5c8', class: "xpl-select__chevron-down", icon: this.selectIcon }))), !this.disabled && (h("xpl-dropdown", { key: 'df29a0a21c11fa4c9a550a4339c6719793783404', ref: (el) => {
4970
+ })(), isTextTruncated && truncatedText), h("xpl-icon", { key: '46d0759da7e730e00d6eb4839ba2eda1e711dd59', class: "xpl-select__chevron-down", icon: this.selectIcon }))), !this.disabled && (h("xpl-dropdown", { key: '4ac71c53ae935940c5de9d4c65034b0bf312da79', ref: (el) => {
4970
4971
  this.dropdown = el;
4971
4972
  }, isOpen: this.dropdownOpenState, options: this.choicesState, selectedValues: this.selectedValues, mode: this.mode, triggerId: this.id, update: (_e, { component }) => {
4972
4973
  const { options } = component;
@@ -4975,7 +4976,7 @@ const XplSelect = class {
4975
4976
  }
4976
4977
  }, onIsOpenChange: (e) => {
4977
4978
  this.dropdownOpenState = e.detail;
4978
- }, onWheel: this.handleDropdownScroll, anchorToTrigger: true })), this.renderError()), h("input", { key: '3e7f53a0d8e6d4e8028e1dc38d0e3661b76978f5', type: "hidden", name: this.name, value: this.value })));
4979
+ }, onWheel: this.handleDropdownScroll, anchorToTrigger: true })), this.renderError()), h("input", { key: 'd80e5ab1219e98130e4c38264a711839d4d9668f', type: "hidden", name: this.name, value: this.value })));
4979
4980
  }
4980
4981
  static get watchers() { return {
4981
4982
  "choices": [{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xplortech/apollo-core",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/types/components.d.ts",