@watermarkinsights/ripple 3.37.0 → 3.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/dist/cjs/{chartFunctions-4d828b26.js → chartFunctions-5441fbec.js} +1 -1
  2. package/dist/cjs/{functions-0c27162e.js → functions-500629f8.js} +1 -1
  3. package/dist/cjs/{global-a2ca8069.js → global-b0628445.js} +1 -1
  4. package/dist/cjs/{intl-022a42a1.js → intl-821d2be2.js} +1 -1
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/priv-chart-popover.cjs.entry.js +1 -1
  7. package/dist/cjs/priv-datepicker.cjs.entry.js +1 -1
  8. package/dist/cjs/ripple.cjs.js +2 -2
  9. package/dist/cjs/wm-action-menu_2.cjs.entry.js +1 -1
  10. package/dist/cjs/wm-button.cjs.entry.js +1 -1
  11. package/dist/cjs/wm-chart.cjs.entry.js +3 -3
  12. package/dist/cjs/wm-datepicker.cjs.entry.js +1 -1
  13. package/dist/cjs/wm-file.cjs.entry.js +1 -1
  14. package/dist/cjs/wm-input.cjs.entry.js +2 -2
  15. package/dist/cjs/wm-line-chart.cjs.entry.js +3 -3
  16. package/dist/cjs/wm-modal-header.cjs.entry.js +2 -2
  17. package/dist/cjs/wm-modal.cjs.entry.js +2 -2
  18. package/dist/cjs/wm-navigation_3.cjs.entry.js +2 -2
  19. package/dist/cjs/wm-navigator.cjs.entry.js +1 -1
  20. package/dist/cjs/wm-network-uploader.cjs.entry.js +2 -2
  21. package/dist/cjs/wm-option_2.cjs.entry.js +2 -2
  22. package/dist/cjs/wm-pagination.cjs.entry.js +1 -1
  23. package/dist/cjs/wm-progress-indicator_3.cjs.entry.js +2 -2
  24. package/dist/cjs/wm-search.cjs.entry.js +2 -2
  25. package/dist/cjs/wm-snackbar.cjs.entry.js +2 -2
  26. package/dist/cjs/wm-tab-item_3.cjs.entry.js +1 -1
  27. package/dist/cjs/wm-tag-input.cjs.entry.js +2 -2
  28. package/dist/cjs/wm-timepicker.cjs.entry.js +1 -1
  29. package/dist/cjs/wm-toggletip.cjs.entry.js +1 -1
  30. package/dist/cjs/wm-uploader.cjs.entry.js +2 -2
  31. package/dist/collection/collection-manifest.json +1 -1
  32. package/dist/collection/components/wm-modal/wm-modal.css +1 -0
  33. package/dist/collection/components/wm-tag-input/wm-tag-input.js +1 -1
  34. package/dist/esm/{chartFunctions-f4f3252e.js → chartFunctions-73e3dec2.js} +1 -1
  35. package/dist/esm/{functions-d52b728c.js → functions-25f9ef6d.js} +1 -1
  36. package/dist/esm/{global-06801d00.js → global-9d3664e6.js} +1 -1
  37. package/dist/esm/{intl-9809c77c.js → intl-c3678c68.js} +1 -1
  38. package/dist/esm/loader.js +2 -2
  39. package/dist/esm/priv-chart-popover.entry.js +1 -1
  40. package/dist/esm/priv-datepicker.entry.js +1 -1
  41. package/dist/esm/ripple.js +2 -2
  42. package/dist/esm/wm-action-menu_2.entry.js +1 -1
  43. package/dist/esm/wm-button.entry.js +1 -1
  44. package/dist/esm/wm-chart.entry.js +3 -3
  45. package/dist/esm/wm-datepicker.entry.js +1 -1
  46. package/dist/esm/wm-file.entry.js +1 -1
  47. package/dist/esm/wm-input.entry.js +2 -2
  48. package/dist/esm/wm-line-chart.entry.js +3 -3
  49. package/dist/esm/wm-modal-header.entry.js +2 -2
  50. package/dist/esm/wm-modal.entry.js +2 -2
  51. package/dist/esm/wm-navigation_3.entry.js +2 -2
  52. package/dist/esm/wm-navigator.entry.js +1 -1
  53. package/dist/esm/wm-network-uploader.entry.js +2 -2
  54. package/dist/esm/wm-option_2.entry.js +2 -2
  55. package/dist/esm/wm-pagination.entry.js +1 -1
  56. package/dist/esm/wm-progress-indicator_3.entry.js +2 -2
  57. package/dist/esm/wm-search.entry.js +2 -2
  58. package/dist/esm/wm-snackbar.entry.js +2 -2
  59. package/dist/esm/wm-tab-item_3.entry.js +1 -1
  60. package/dist/esm/wm-tag-input.entry.js +2 -2
  61. package/dist/esm/wm-timepicker.entry.js +1 -1
  62. package/dist/esm/wm-toggletip.entry.js +1 -1
  63. package/dist/esm/wm-uploader.entry.js +2 -2
  64. package/dist/esm-es5/{chartFunctions-f4f3252e.js → chartFunctions-73e3dec2.js} +1 -1
  65. package/dist/esm-es5/{functions-d52b728c.js → functions-25f9ef6d.js} +1 -1
  66. package/dist/esm-es5/{global-06801d00.js → global-9d3664e6.js} +1 -1
  67. package/dist/esm-es5/{intl-9809c77c.js → intl-c3678c68.js} +1 -1
  68. package/dist/esm-es5/loader.js +1 -1
  69. package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
  70. package/dist/esm-es5/priv-datepicker.entry.js +1 -1
  71. package/dist/esm-es5/ripple.js +1 -1
  72. package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
  73. package/dist/esm-es5/wm-button.entry.js +1 -1
  74. package/dist/esm-es5/wm-chart.entry.js +1 -1
  75. package/dist/esm-es5/wm-datepicker.entry.js +1 -1
  76. package/dist/esm-es5/wm-file.entry.js +1 -1
  77. package/dist/esm-es5/wm-input.entry.js +1 -1
  78. package/dist/esm-es5/wm-line-chart.entry.js +1 -1
  79. package/dist/esm-es5/wm-modal-header.entry.js +1 -1
  80. package/dist/esm-es5/wm-modal.entry.js +1 -1
  81. package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
  82. package/dist/esm-es5/wm-navigator.entry.js +1 -1
  83. package/dist/esm-es5/wm-network-uploader.entry.js +1 -1
  84. package/dist/esm-es5/wm-option_2.entry.js +1 -1
  85. package/dist/esm-es5/wm-pagination.entry.js +1 -1
  86. package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
  87. package/dist/esm-es5/wm-search.entry.js +1 -1
  88. package/dist/esm-es5/wm-snackbar.entry.js +1 -1
  89. package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
  90. package/dist/esm-es5/wm-tag-input.entry.js +1 -1
  91. package/dist/esm-es5/wm-timepicker.entry.js +1 -1
  92. package/dist/esm-es5/wm-toggletip.entry.js +1 -1
  93. package/dist/esm-es5/wm-uploader.entry.js +1 -1
  94. package/dist/ripple/{p-dd01929e.system.entry.js → p-0259d353.system.entry.js} +1 -1
  95. package/dist/ripple/{p-c1857a16.entry.js → p-0afff679.entry.js} +1 -1
  96. package/dist/ripple/{p-5d592297.system.entry.js → p-0b0f8667.system.entry.js} +1 -1
  97. package/dist/ripple/{p-84e55d9e.entry.js → p-0ed2b6df.entry.js} +1 -1
  98. package/dist/ripple/{p-b982a342.entry.js → p-0ef2737d.entry.js} +1 -1
  99. package/dist/ripple/{p-adf76148.entry.js → p-11b91d75.entry.js} +1 -1
  100. package/dist/ripple/{p-ba31d982.system.js → p-161d5e7c.system.js} +1 -1
  101. package/dist/ripple/{p-24d9f6fe.entry.js → p-1841a3a5.entry.js} +1 -1
  102. package/dist/ripple/{p-8f273c5b.system.entry.js → p-1d62ea4d.system.entry.js} +1 -1
  103. package/dist/ripple/{p-f9539737.system.entry.js → p-2570ec1f.system.entry.js} +1 -1
  104. package/dist/ripple/{p-50623da2.entry.js → p-26985b84.entry.js} +1 -1
  105. package/dist/ripple/{p-20df08be.system.entry.js → p-2d2d30a5.system.entry.js} +1 -1
  106. package/dist/ripple/{p-e882a31f.system.entry.js → p-323e5fff.system.entry.js} +1 -1
  107. package/dist/ripple/{p-5e55eb56.system.js → p-32d973fa.system.js} +1 -1
  108. package/dist/ripple/{p-fbb44f76.system.entry.js → p-426ba254.system.entry.js} +1 -1
  109. package/dist/ripple/{p-cab12cec.system.entry.js → p-45376571.system.entry.js} +1 -1
  110. package/dist/ripple/{p-725c757a.entry.js → p-4a3f88f8.entry.js} +1 -1
  111. package/dist/ripple/{p-c3915cfe.system.entry.js → p-5257b743.system.entry.js} +1 -1
  112. package/dist/ripple/{p-06871476.entry.js → p-56298c7d.entry.js} +1 -1
  113. package/dist/ripple/{p-fea4bc00.entry.js → p-5fbec5ff.entry.js} +1 -1
  114. package/dist/ripple/{p-11763c02.entry.js → p-631a011f.entry.js} +1 -1
  115. package/dist/ripple/{p-364753eb.js → p-653943d0.js} +1 -1
  116. package/dist/ripple/{p-7f722888.entry.js → p-6a2b7449.entry.js} +1 -1
  117. package/dist/ripple/{p-5c1b2132.system.entry.js → p-6ca3c1c0.system.entry.js} +1 -1
  118. package/dist/ripple/{p-9e29176c.entry.js → p-6cef908c.entry.js} +1 -1
  119. package/dist/ripple/{p-3b50511c.system.entry.js → p-6dd460d3.system.entry.js} +1 -1
  120. package/dist/ripple/{p-2ebac749.entry.js → p-73bd2015.entry.js} +1 -1
  121. package/dist/ripple/{p-27efb4d0.system.js → p-7471439a.system.js} +1 -1
  122. package/dist/ripple/{p-d72b00a0.entry.js → p-86bd1f20.entry.js} +1 -1
  123. package/dist/ripple/{p-25c1bd67.system.entry.js → p-8debafc6.system.entry.js} +1 -1
  124. package/dist/ripple/{p-cd7cc5c6.js → p-8e001d5e.js} +1 -1
  125. package/dist/ripple/p-96625959.system.entry.js +1 -0
  126. package/dist/ripple/{p-185c3645.entry.js → p-98488132.entry.js} +1 -1
  127. package/dist/ripple/{p-74a92541.system.entry.js → p-98b6e5da.system.entry.js} +1 -1
  128. package/dist/ripple/{p-fd354e00.system.js → p-9e5a95f9.system.js} +1 -1
  129. package/dist/ripple/{p-39e17683.system.js → p-a0ab477c.system.js} +1 -1
  130. package/dist/ripple/{p-2acf8af1.system.entry.js → p-a6f28b0b.system.entry.js} +1 -1
  131. package/dist/ripple/{p-26031cd0.system.entry.js → p-ae20ba70.system.entry.js} +1 -1
  132. package/dist/ripple/{p-9cb8f41b.entry.js → p-b8580615.entry.js} +1 -1
  133. package/dist/ripple/{p-d8de670a.system.entry.js → p-b91e3f86.system.entry.js} +1 -1
  134. package/dist/ripple/{p-80ca72ff.system.entry.js → p-ba6a3364.system.entry.js} +1 -1
  135. package/dist/ripple/{p-e0f270e2.system.entry.js → p-bbffc0d1.system.entry.js} +1 -1
  136. package/dist/ripple/{p-fcdd9e03.system.entry.js → p-bedd750c.system.entry.js} +1 -1
  137. package/dist/ripple/{p-89bf36c8.system.entry.js → p-ca265cea.system.entry.js} +1 -1
  138. package/dist/ripple/{p-da01c531.entry.js → p-cbe31120.entry.js} +1 -1
  139. package/dist/ripple/{p-42aeb9bb.js → p-d3accb39.js} +1 -1
  140. package/dist/ripple/{p-3ec4ae19.entry.js → p-d3f4e391.entry.js} +1 -1
  141. package/dist/ripple/{p-ae97bf6c.system.entry.js → p-e6038b0f.system.entry.js} +1 -1
  142. package/dist/ripple/{p-697ba13b.entry.js → p-e9a21714.entry.js} +1 -1
  143. package/dist/ripple/{p-ed3e41ed.entry.js → p-e9e2e4c4.entry.js} +1 -1
  144. package/dist/ripple/{p-aae11e37.system.entry.js → p-f0b5cc80.system.entry.js} +1 -1
  145. package/dist/ripple/{p-ff888d78.js → p-f0d87250.js} +1 -1
  146. package/dist/ripple/{p-fd91cd58.entry.js → p-f1fae497.entry.js} +1 -1
  147. package/dist/ripple/{p-53f5e969.system.entry.js → p-f8512877.system.entry.js} +1 -1
  148. package/dist/ripple/{p-4b59b16a.entry.js → p-f8654cb1.entry.js} +1 -1
  149. package/dist/ripple/{p-198f596b.entry.js → p-f8b58321.entry.js} +1 -1
  150. package/dist/ripple/{p-535e7286.entry.js → p-fa641a36.entry.js} +1 -1
  151. package/dist/ripple/ripple.esm.js +1 -1
  152. package/dist/ripple/ripple.js +1 -1
  153. package/package.json +1 -1
  154. package/dist/ripple/p-50be6128.system.entry.js +0 -1
  155. package/dist/types/components/wm-tag-input/wm-tag-input-row/wm-tag-input-row.d.ts +0 -11
  156. package/dist/types/components/wm-tag-input/wm-tag-input.d.ts +0 -138
  157. package/dist/types/components/wm-uploader/wm-network-uploader/wm-network-uploader.d.ts +0 -85
@@ -1 +1 @@
1
- import{r as e,c as t,f as i,h as o,H as r,g as l}from"./p-b5bedd63.js";import{d as n,i as s,l as a,s as d,h as p}from"./p-ff888d78.js";const c=class{constructor(o){e(this,o),this.wmIntFilePreviewed=t(this,"wmIntFilePreviewed",7),this.wmIntFileDownloaded=t(this,"wmIntFileDownloaded",7),this.wmIntFileDeleted=t(this,"wmIntFileDeleted",7),this.wmFileClearErrorClicked=t(this,"wmFileClearErrorClicked",7),this.isWithinLegacyUploader=!1,this.debouncedResize=n((()=>{this.isCondensed=this.el.clientWidth<500,i(this.el)}),50),this.file=void 0,this.showInfo="time",this.errorMessage=void 0,this.isCondensed=!1}get fileData(){let e=this.file?JSON.parse(this.file):null;return e&&e.progress&&"string"==typeof e.progress&&e.progress.match(/^[0-9]+$/)&&(e.progress=parseInt(e.progress.toString())),e}get isUploading(){return this.fileData&&this.fileData.hasOwnProperty("progress")&&this.fileData.progress<100}get previewButtonTooltip(){return s.formatMessage({id:"file.previewButtonTooltip",defaultMessage:"Preview",description:"Tooltip of a button that triggers a file to be previewed"})}get downloadButtonTooltip(){return s.formatMessage({id:"file.downloadButtonTooltip",defaultMessage:"Download",description:"Tooltip of a button that triggers a file to be downloaded"})}get deleteButtonTooltip(){return s.formatMessage({id:"file.deleteButtonTooltip",defaultMessage:"Delete",description:"Tooltip of a button that triggers a file to be deleted"})}get previewActionMessage(){return s.formatMessage({id:"file.previewAction",defaultMessage:"Preview File",description:"Label of a button that triggers a file to be previewed"})}get downloadActionMessage(){return s.formatMessage({id:"file.downloadAction",defaultMessage:"Download File",description:"Label of a button that triggers a file to be downloaded"})}get deleteActionMessage(){return s.formatMessage({id:"file.deleteAction",defaultMessage:"Delete File",description:"Label of a button that triggers a file to be delete"})}get actionMenuLabel(){return s.formatMessage({id:"file.actionMenuLabel",defaultMessage:"Actions",description:"Label of a button that opens a menu of file actions"})}get clearButtonText(){return s.formatMessage({id:"file.clearErrorText",defaultMessage:"Clear",description:"Text for a button used to clear an error"})}generateClearButtonLabel(e){return s.formatMessage({id:"file.clearErrorLabel",defaultMessage:"Clear {fileName} error",description:"Label for a button used to clear an error, including filename"},{fileName:e})}componentWillLoad(){const e=this.el.getRootNode().host;e&&"WM-UPLOADER"===e.nodeName&&(e.type||e.uploaderType)&&(this.isWithinLegacyUploader=!0),new ResizeObserver((()=>this.debouncedResize())).observe(this.el)}componentDidRender(){const e=this.el.shadowRoot.querySelector(".filename"),t=this.el.shadowRoot.querySelector(".left-group").getBoundingClientRect().left,i=this.el.shadowRoot.querySelector(".right-group"),o=i?i.getBoundingClientRect().left:this.el.shadowRoot.querySelector(".file-wrapper").getBoundingClientRect().right-20;e.textContent=a(e,e.dataset.filename,o-t,7)}previewFile(e){this.wmIntFilePreviewed.emit(e.id)}downloadFile(e){this.wmIntFileDownloaded.emit(e.id)}deleteFile(e){this.wmIntFileDeleted.emit(e.id)}handleFilenameMouseEnter(e,t){e.target.textContent.includes("...")&&d("bottom",e.target,t)}renderFileName(e,t){return o("div",{class:"left-group"},o("div",{class:"name-wrapper"},o("span",{class:"sr-only"},e),o("span",{"aria-hidden":"true",class:"filename","data-filename":e,onMouseEnter:t=>this.handleFilenameMouseEnter(t,e),onMouseLeave:()=>p()}),t&&o("span",{class:"sr-only"},"uploading")))}renderFileInfo(e,t){let i="";return"time"===t&&e.lastUpdated?i=e.lastUpdated:"size"===t&&e.size&&(i=e.size),o("div",{class:"file-info"},i)}renderActionMenu(e){const t=e.fileActions||"download delete",i=o("wm-menuitem",{icon:"f208",onClick:()=>this.previewFile(e)},this.previewActionMessage),r=o("wm-menuitem",{icon:"f1da",onClick:()=>this.downloadFile(e)},this.downloadActionMessage),l=o("wm-menuitem",{icon:"f1c0",onClick:()=>this.deleteFile(e)},this.deleteActionMessage);return o("wm-action-menu",{"action-menu-type":"icon",tooltip:this.actionMenuLabel,"tooltip-position":"bottom","label-for-identical-buttons":`${e.name} ${this.actionMenuLabel}`},t.includes("preview")&&i,t.includes("download")&&r,t.includes("delete")&&l)}renderFileActionButtons(e){const t=e.fileActions||"download delete",i=o("wm-button",{class:"preview-button","button-type":"icononly",tooltip:this.previewButtonTooltip,"tooltip-position":"bottom","label-for-identical-buttons":`preview ${e.name}`,icon:"f208",onClick:()=>this.previewFile(e)}),r=o("wm-button",{class:"download-button","button-type":"icononly",tooltip:this.downloadButtonTooltip,"tooltip-position":"bottom","label-for-identical-buttons":`download ${e.name}`,icon:"f1da",onClick:()=>this.downloadFile(e)}),l=o("wm-button",{class:"delete-button","button-type":"icononly",tooltip:this.deleteButtonTooltip,"tooltip-position":"bottom","label-for-identical-buttons":`delete ${e.name}`,icon:"f1c0",onClick:()=>this.deleteFile(e)});return o("div",{class:"file-controls"},t.includes("preview")&&i,t.includes("download")&&r,t.includes("delete")&&l)}renderFileInProgress(e){const t=e.type?`${e.name}.${e.type}`:e.name;return o("div",{class:"file-wrapper"},o("div",{class:"file --progress"},o("div",{class:"progress",style:{background:`linear-gradient(to right, var(--wmcolor-file-progress) ${e.progress}%, transparent ${e.progress}%)`}}),this.renderFileName(t,this.isUploading)))}renderFileControls(e){const t=e.fileActions&&1===e.fileActions.split(" ").length;return this.isCondensed&&!t?this.renderActionMenu(e):this.renderFileActionButtons(e)}renderFile(e){return o("div",{class:"file-wrapper "+(this.isWithinLegacyUploader||100!==e.progress?"":"checked")},o("div",{class:"file "+(this.errorMessage?"--error":"")},this.renderFileName(e.type?`${e.name}.${e.type}`:e.name,this.isUploading),!this.errorMessage&&o("div",{class:"right-group "+(this.isCondensed?"condensed":"")},"none"!==this.showInfo&&this.renderFileInfo(e,this.showInfo),""!==e.fileActions&&this.renderFileControls(e)),this.errorMessage&&o("wm-button",{"permanently-delete":!0,"button-type":"textonly","label-for-identical-buttons":this.generateClearButtonLabel(e.name),onClick:()=>this.wmFileClearErrorClicked.emit({name:e.name})},this.clearButtonText)),this.errorMessage&&o("div",{class:"error-message"},this.errorMessage))}render(){return o(r,{role:"listitem"},this.isUploading?this.renderFileInProgress(this.fileData):this.renderFile(this.fileData))}static get delegatesFocus(){return!0}get el(){return l(this)}};c.style=':host{--wmcolor-file-background-error:var(--wmcolor-background-error);--wmcolor-file-background:var(--wmcolor-background-readonly);--wmcolor-file-border-error:var(--wmcolor-border-error);--wmcolor-file-border:var(--wmcolor-border);--wmcolor-file-checkmark-icon:var(--wmcolor-positive);--wmcolor-file-progress:var(--wmcolor-progress);display:block;width:100%}.file-wrapper{font-size:0.875rem;position:relative;list-style:none}.file-wrapper .file{min-width:300px;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;height:3.5rem;padding:0 1.25rem;position:relative;background:var(--wmcolor-file-background);border:1px solid var(--wmcolor-file-border);display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center}.file-wrapper .file .filename{display:inline-block;white-space:nowrap}.file-wrapper .file .left-group{overflow:hidden}.file-wrapper .file .right-group{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding-left:5rem;gap:1rem}.file-wrapper .file .right-group.condensed{padding-left:2.5rem}.file-wrapper .file .right-group .file-controls{display:-ms-flexbox;display:flex;gap:1rem}.file-wrapper .file .right-group .file-info{white-space:nowrap}.file-wrapper .file.--error{border:1px solid var(--wmcolor-file-border-error);background-color:var(--wmcolor-file-background-error);height:3.75rem}.file-wrapper.checked .file:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f133";position:absolute;right:-44px;color:var(--wmcolor-file-checkmark-icon);font-size:28px;line-height:1}.name-wrapper{overflow:hidden}.progress{position:absolute;left:0;top:0;right:0;height:8px}.error-message{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;margin-top:0.25rem}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';export{c as wm_file}
1
+ import{r as e,c as t,f as i,h as o,H as r,g as l}from"./p-b5bedd63.js";import{d as n,i as s,l as a,s as d,h as p}from"./p-f0d87250.js";const c=class{constructor(o){e(this,o),this.wmIntFilePreviewed=t(this,"wmIntFilePreviewed",7),this.wmIntFileDownloaded=t(this,"wmIntFileDownloaded",7),this.wmIntFileDeleted=t(this,"wmIntFileDeleted",7),this.wmFileClearErrorClicked=t(this,"wmFileClearErrorClicked",7),this.isWithinLegacyUploader=!1,this.debouncedResize=n((()=>{this.isCondensed=this.el.clientWidth<500,i(this.el)}),50),this.file=void 0,this.showInfo="time",this.errorMessage=void 0,this.isCondensed=!1}get fileData(){let e=this.file?JSON.parse(this.file):null;return e&&e.progress&&"string"==typeof e.progress&&e.progress.match(/^[0-9]+$/)&&(e.progress=parseInt(e.progress.toString())),e}get isUploading(){return this.fileData&&this.fileData.hasOwnProperty("progress")&&this.fileData.progress<100}get previewButtonTooltip(){return s.formatMessage({id:"file.previewButtonTooltip",defaultMessage:"Preview",description:"Tooltip of a button that triggers a file to be previewed"})}get downloadButtonTooltip(){return s.formatMessage({id:"file.downloadButtonTooltip",defaultMessage:"Download",description:"Tooltip of a button that triggers a file to be downloaded"})}get deleteButtonTooltip(){return s.formatMessage({id:"file.deleteButtonTooltip",defaultMessage:"Delete",description:"Tooltip of a button that triggers a file to be deleted"})}get previewActionMessage(){return s.formatMessage({id:"file.previewAction",defaultMessage:"Preview File",description:"Label of a button that triggers a file to be previewed"})}get downloadActionMessage(){return s.formatMessage({id:"file.downloadAction",defaultMessage:"Download File",description:"Label of a button that triggers a file to be downloaded"})}get deleteActionMessage(){return s.formatMessage({id:"file.deleteAction",defaultMessage:"Delete File",description:"Label of a button that triggers a file to be delete"})}get actionMenuLabel(){return s.formatMessage({id:"file.actionMenuLabel",defaultMessage:"Actions",description:"Label of a button that opens a menu of file actions"})}get clearButtonText(){return s.formatMessage({id:"file.clearErrorText",defaultMessage:"Clear",description:"Text for a button used to clear an error"})}generateClearButtonLabel(e){return s.formatMessage({id:"file.clearErrorLabel",defaultMessage:"Clear {fileName} error",description:"Label for a button used to clear an error, including filename"},{fileName:e})}componentWillLoad(){const e=this.el.getRootNode().host;e&&"WM-UPLOADER"===e.nodeName&&(e.type||e.uploaderType)&&(this.isWithinLegacyUploader=!0),new ResizeObserver((()=>this.debouncedResize())).observe(this.el)}componentDidRender(){const e=this.el.shadowRoot.querySelector(".filename"),t=this.el.shadowRoot.querySelector(".left-group").getBoundingClientRect().left,i=this.el.shadowRoot.querySelector(".right-group"),o=i?i.getBoundingClientRect().left:this.el.shadowRoot.querySelector(".file-wrapper").getBoundingClientRect().right-20;e.textContent=a(e,e.dataset.filename,o-t,7)}previewFile(e){this.wmIntFilePreviewed.emit(e.id)}downloadFile(e){this.wmIntFileDownloaded.emit(e.id)}deleteFile(e){this.wmIntFileDeleted.emit(e.id)}handleFilenameMouseEnter(e,t){e.target.textContent.includes("...")&&d("bottom",e.target,t)}renderFileName(e,t){return o("div",{class:"left-group"},o("div",{class:"name-wrapper"},o("span",{class:"sr-only"},e),o("span",{"aria-hidden":"true",class:"filename","data-filename":e,onMouseEnter:t=>this.handleFilenameMouseEnter(t,e),onMouseLeave:()=>p()}),t&&o("span",{class:"sr-only"},"uploading")))}renderFileInfo(e,t){let i="";return"time"===t&&e.lastUpdated?i=e.lastUpdated:"size"===t&&e.size&&(i=e.size),o("div",{class:"file-info"},i)}renderActionMenu(e){const t=e.fileActions||"download delete",i=o("wm-menuitem",{icon:"f208",onClick:()=>this.previewFile(e)},this.previewActionMessage),r=o("wm-menuitem",{icon:"f1da",onClick:()=>this.downloadFile(e)},this.downloadActionMessage),l=o("wm-menuitem",{icon:"f1c0",onClick:()=>this.deleteFile(e)},this.deleteActionMessage);return o("wm-action-menu",{"action-menu-type":"icon",tooltip:this.actionMenuLabel,"tooltip-position":"bottom","label-for-identical-buttons":`${e.name} ${this.actionMenuLabel}`},t.includes("preview")&&i,t.includes("download")&&r,t.includes("delete")&&l)}renderFileActionButtons(e){const t=e.fileActions||"download delete",i=o("wm-button",{class:"preview-button","button-type":"icononly",tooltip:this.previewButtonTooltip,"tooltip-position":"bottom","label-for-identical-buttons":`preview ${e.name}`,icon:"f208",onClick:()=>this.previewFile(e)}),r=o("wm-button",{class:"download-button","button-type":"icononly",tooltip:this.downloadButtonTooltip,"tooltip-position":"bottom","label-for-identical-buttons":`download ${e.name}`,icon:"f1da",onClick:()=>this.downloadFile(e)}),l=o("wm-button",{class:"delete-button","button-type":"icononly",tooltip:this.deleteButtonTooltip,"tooltip-position":"bottom","label-for-identical-buttons":`delete ${e.name}`,icon:"f1c0",onClick:()=>this.deleteFile(e)});return o("div",{class:"file-controls"},t.includes("preview")&&i,t.includes("download")&&r,t.includes("delete")&&l)}renderFileInProgress(e){const t=e.type?`${e.name}.${e.type}`:e.name;return o("div",{class:"file-wrapper"},o("div",{class:"file --progress"},o("div",{class:"progress",style:{background:`linear-gradient(to right, var(--wmcolor-file-progress) ${e.progress}%, transparent ${e.progress}%)`}}),this.renderFileName(t,this.isUploading)))}renderFileControls(e){const t=e.fileActions&&1===e.fileActions.split(" ").length;return this.isCondensed&&!t?this.renderActionMenu(e):this.renderFileActionButtons(e)}renderFile(e){return o("div",{class:"file-wrapper "+(this.isWithinLegacyUploader||100!==e.progress?"":"checked")},o("div",{class:"file "+(this.errorMessage?"--error":"")},this.renderFileName(e.type?`${e.name}.${e.type}`:e.name,this.isUploading),!this.errorMessage&&o("div",{class:"right-group "+(this.isCondensed?"condensed":"")},"none"!==this.showInfo&&this.renderFileInfo(e,this.showInfo),""!==e.fileActions&&this.renderFileControls(e)),this.errorMessage&&o("wm-button",{"permanently-delete":!0,"button-type":"textonly","label-for-identical-buttons":this.generateClearButtonLabel(e.name),onClick:()=>this.wmFileClearErrorClicked.emit({name:e.name})},this.clearButtonText)),this.errorMessage&&o("div",{class:"error-message"},this.errorMessage))}render(){return o(r,{role:"listitem"},this.isUploading?this.renderFileInProgress(this.fileData):this.renderFile(this.fileData))}static get delegatesFocus(){return!0}get el(){return l(this)}};c.style=':host{--wmcolor-file-background-error:var(--wmcolor-background-error);--wmcolor-file-background:var(--wmcolor-background-readonly);--wmcolor-file-border-error:var(--wmcolor-border-error);--wmcolor-file-border:var(--wmcolor-border);--wmcolor-file-checkmark-icon:var(--wmcolor-positive);--wmcolor-file-progress:var(--wmcolor-progress);display:block;width:100%}.file-wrapper{font-size:0.875rem;position:relative;list-style:none}.file-wrapper .file{min-width:300px;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;height:3.5rem;padding:0 1.25rem;position:relative;background:var(--wmcolor-file-background);border:1px solid var(--wmcolor-file-border);display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center}.file-wrapper .file .filename{display:inline-block;white-space:nowrap}.file-wrapper .file .left-group{overflow:hidden}.file-wrapper .file .right-group{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding-left:5rem;gap:1rem}.file-wrapper .file .right-group.condensed{padding-left:2.5rem}.file-wrapper .file .right-group .file-controls{display:-ms-flexbox;display:flex;gap:1rem}.file-wrapper .file .right-group .file-info{white-space:nowrap}.file-wrapper .file.--error{border:1px solid var(--wmcolor-file-border-error);background-color:var(--wmcolor-file-background-error);height:3.75rem}.file-wrapper.checked .file:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f133";position:absolute;right:-44px;color:var(--wmcolor-file-checkmark-icon);font-size:28px;line-height:1}.name-wrapper{overflow:hidden}.progress{position:absolute;left:0;top:0;right:0;height:8px}.error-message{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;margin-top:0.25rem}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';export{c as wm_file}
@@ -1 +1 @@
1
- import{r as t,c as r,h as i,H as s,g as a}from"./p-b5bedd63.js";import{a as o}from"./p-888bec42.js";import{m as e,n,i as h}from"./p-ff888d78.js";import{g as c}from"./p-a6d6eae7.js";const l=class{constructor(i){t(this,i),this.wmNavigatorLogout=r(this,"wmNavigatorLogout",7),this.retrievedInfo=!this.loadFromUserinfo,this.parsedProducts=[],this.openRight=!1,this.userName=void 0,this.email=void 0,this.authType=1,this.connectionName=void 0,this.logoutUrl=void 0,this.products=void 0,this.loadFromUserinfo=!1,this.isOpen=!1,this.isTabbing=!1,this.itemIndexToFocus=0}async componentWillLoad(){this.userName||console.error("wm-navigator: user-name is a required property."),await this.parseData(),this.setFocusIndex()}async parseData(){this.loadFromUserinfo?await c("/platform/navigator/userinfo").then((t=>{this.email=t.email,this.currentProductId=t.current_product_id,this.parsedProducts=this.productKeysToCamelCase(t.products),this.logoutUrl=this.logoutUrl?this.logoutUrl:t.logout_url,this.connectionName=this.connectionName?this.connectionName:t.connection_name,this.email&&this.currentProductId&&(this.retrievedInfo=!0)})).catch((t=>{console.error(t)})):(this.currentProductId=o(this.el),this.products&&(this.parsedProducts="string"==typeof this.products?JSON.parse(this.products):this.products,this.parsedProducts=this.productKeysToCamelCase(this.parsedProducts))),this.parsedProducts.sort(((t,r)=>t.name<r.name?-1:1))}productKeysToCamelCase(t){return t.map((t=>{const r=Object.keys(t);let i={};return r.forEach((r=>{i[e(r)]=t[r]})),i}))}setFocusIndex(){if(this.parsedProducts.length>1){const t=this.getProduct(this.currentProductId);t&&(this.itemIndexToFocus=this.parsedProducts.indexOf(t))}}toggleTabbingOn(){this.isTabbing=!0}toggleTabbingOff(){this.isTabbing=!1}handleKeys(t){switch(t.key){case"Escape":t.preventDefault(),this.closeMenu();break;case"ArrowDown":case"ArrowUp":t.preventDefault(),this.isOpen||(this.itemIndexToFocus=n(this.itemIndexToFocus,t.key,this.navigatorItems.length),this.openMenu())}}handleKeydown(t){const r=t.detail.key,i=t.detail.navItem;switch(r){case"Tab":this.closeMenu();break;case"Enter":case" ":i.click();break;case"ArrowDown":case"ArrowUp":const t=this.itemIndexToFocus;this.itemIndexToFocus=n(this.itemIndexToFocus,r,this.navigatorItems.length),this.focusItem(),this.unfocusItem(t)}}handleClick(t){t.target!==this.el&&!this.el.contains(t.target)&&this.isOpen&&this.closeMenu()}handleButtonClick(){this.isOpen?this.closeMenu():this.openMenu()}openMenu(){if(this.wrapperEl){const t=this.wrapperEl.clientWidth,r=this.el.getBoundingClientRect().left,i=document.documentElement.clientWidth-this.el.getBoundingClientRect().right;this.openRight=t>r&&i>r}this.isOpen=!0,this.focusItem()}closeMenu(){this.isOpen=!1,this.buttonFocusHandler(),this.unfocusItem(this.itemIndexToFocus),this.setFocusIndex()}focusItem(){const t=this.navigatorItems[this.itemIndexToFocus];t.tabIndex=0,t.focused=!0,window.requestAnimationFrame((()=>t.focus()))}unfocusItem(t){const r=this.navigatorItems[t];r.tabIndex=-1,r.focused=!1}buttonFocusHandler(){const t=this.el.shadowRoot.querySelector("priv-navigator-button").shadowRoot.querySelector("button");window.requestAnimationFrame((()=>t.focus()))}renderUserInfo(){return i("div",{class:"user",id:"wm-nav-user","aria-label":h.formatMessage({id:"navigator.userinfoLabel",defaultMessage:"for {name}, email {email}"},{name:this.userName,email:this.email})},i("p",null,this.userName),i("p",null,this.email))}setAltText(){return h.formatMessage(this.parsedProducts.length>1?{id:"navigator.userinfoAndProductNavigator",defaultMessage:"User information and product navigator"}:{id:"navigator.userinfo",defaultMessage:"User information"})}renderHeading(){return i("h2",null,h.formatMessage({id:"navigator.watermarkApps",defaultMessage:"Watermark Apps",description:"Applications made by Watermark Insights"}))}renderList(){return i("ul",{role:"listbox","aria-label":`${h.formatMessage({id:"navigator.WatermarkAppNavigation",defaultMessage:"Watermark App Navigation",description:"list of applications by Watermark Insights"})}`,"aria-describedby":"wm-nav-user"},this.parsedProducts.length>1&&this.renderProductOptions(),this.renderLogoutOption())}renderProductOptions(){return this.parsedProducts.map((t=>{let r,s,a,o;if(r=t.name,s=t.iconUrl,o=this.setProductOnClick(t.id),r&&s)return a=this.currentProductId===t.id,i("priv-navigator-item",{selected:a,id:t.id,onClick:o,role:"option","aria-label":r},i("img",{src:s,alt:r}))}))}setProductOnClick(t){const r=this.getProduct(t);if(this.currentProductId===t)return()=>{};if(r){if(this.loadFromUserinfo||2===this.authType)return()=>window.location.href=r.linkUrl;if(3===this.authType){const t=this.connectionName?`/?connection_name=${this.connectionName}`:"";return()=>window.location.href=r.samlLinkUrl+t}}}renderLogoutOption(){return i("priv-navigator-item",{class:"logout",selected:!(this.parsedProducts.length>1),id:"nav-logout",onClick:this.setLogoutOnclick(),role:"option"},i("span",{class:"logout"},h.formatMessage({id:"navigator.logout",defaultMessage:"Log Out"})))}setLogoutOnclick(){return()=>{this.wmNavigatorLogout.emit(),this.logoutUrl&&(window.location.href=this.logoutUrl)}}get navigatorItems(){return Array.from(this.el.shadowRoot.querySelectorAll("priv-navigator-item"))}getProduct(t){return this.parsedProducts.find((r=>r.id===t))}render(){return this.retrievedInfo?i(s,{class:this.isTabbing?"user-is-tabbing":""},i("priv-navigator-button",{expanded:this.isOpen,altText:this.setAltText(),isTabbing:this.isTabbing}),i("div",{class:`wrapper ${this.isOpen?"":"hide"} ${this.openRight?"right":""}`,ref:t=>this.wrapperEl=t},this.renderUserInfo(),this.parsedProducts.length>1&&this.renderHeading(),this.renderList())):""}static get delegatesFocus(){return!0}get el(){return a(this)}static get watchers(){return{products:["parseData"]}}};l.style=":host{--wmcolor-navigator-background:var(--wmcolor-background);--wmcolor-navigator-header-background:var(--wmcolor-brand-dark);--wmcolor-navigator-header-text:var(--wmcolor-text-ondark);--wmcolor-navigator-item-background-focus:var(--wmcolor-interactive-background-focus);--wmcolor-navigator-item-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-navigator-item-background:var(--wmcolor-background);--wmcolor-navigator-item-border:var(--wmcolor-border);--wmcolor-navigator-item-text:var(--wmcolor-text);--wmcolor-navigator-user-background:var(--wmcolor-background-readonly);min-width:0;position:relative;display:inline-block}:host .wrapper{overflow:auto;font-size:1.125rem;min-width:13.125rem;width:auto;max-height:80vh;text-align:left;position:absolute;z-index:50;top:100%;right:20px;left:auto;background:var(--wmcolor-navigator-background);letter-spacing:normal;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .wrapper .user{background:var(--wmcolor-navigator-user-background);padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper .user p{margin:0}:host .wrapper .user p:first-child{font-weight:700;text-transform:capitalize}:host .wrapper h2{background:var(--wmcolor-navigator-header-background);color:var(--wmcolor-navigator-header-text);font-weight:700;margin:0;padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper [role=listbox]{list-style:none;margin:0;padding-left:0}:host .wrapper.hide{-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0)}:host .wrapper.right{right:auto;left:20px}:host img{-webkit-transform:scale(0.8);transform:scale(0.8);-webkit-transform-origin:left center;transform-origin:left center;display:block}:host .logout{text-align:center;text-transform:capitalize}priv-navigator-item:focus{outline:none}";export{l as wm_navigator}
1
+ import{r as t,c as r,h as i,H as s,g as a}from"./p-b5bedd63.js";import{a as o}from"./p-888bec42.js";import{m as e,n,i as h}from"./p-f0d87250.js";import{g as c}from"./p-a6d6eae7.js";const l=class{constructor(i){t(this,i),this.wmNavigatorLogout=r(this,"wmNavigatorLogout",7),this.retrievedInfo=!this.loadFromUserinfo,this.parsedProducts=[],this.openRight=!1,this.userName=void 0,this.email=void 0,this.authType=1,this.connectionName=void 0,this.logoutUrl=void 0,this.products=void 0,this.loadFromUserinfo=!1,this.isOpen=!1,this.isTabbing=!1,this.itemIndexToFocus=0}async componentWillLoad(){this.userName||console.error("wm-navigator: user-name is a required property."),await this.parseData(),this.setFocusIndex()}async parseData(){this.loadFromUserinfo?await c("/platform/navigator/userinfo").then((t=>{this.email=t.email,this.currentProductId=t.current_product_id,this.parsedProducts=this.productKeysToCamelCase(t.products),this.logoutUrl=this.logoutUrl?this.logoutUrl:t.logout_url,this.connectionName=this.connectionName?this.connectionName:t.connection_name,this.email&&this.currentProductId&&(this.retrievedInfo=!0)})).catch((t=>{console.error(t)})):(this.currentProductId=o(this.el),this.products&&(this.parsedProducts="string"==typeof this.products?JSON.parse(this.products):this.products,this.parsedProducts=this.productKeysToCamelCase(this.parsedProducts))),this.parsedProducts.sort(((t,r)=>t.name<r.name?-1:1))}productKeysToCamelCase(t){return t.map((t=>{const r=Object.keys(t);let i={};return r.forEach((r=>{i[e(r)]=t[r]})),i}))}setFocusIndex(){if(this.parsedProducts.length>1){const t=this.getProduct(this.currentProductId);t&&(this.itemIndexToFocus=this.parsedProducts.indexOf(t))}}toggleTabbingOn(){this.isTabbing=!0}toggleTabbingOff(){this.isTabbing=!1}handleKeys(t){switch(t.key){case"Escape":t.preventDefault(),this.closeMenu();break;case"ArrowDown":case"ArrowUp":t.preventDefault(),this.isOpen||(this.itemIndexToFocus=n(this.itemIndexToFocus,t.key,this.navigatorItems.length),this.openMenu())}}handleKeydown(t){const r=t.detail.key,i=t.detail.navItem;switch(r){case"Tab":this.closeMenu();break;case"Enter":case" ":i.click();break;case"ArrowDown":case"ArrowUp":const t=this.itemIndexToFocus;this.itemIndexToFocus=n(this.itemIndexToFocus,r,this.navigatorItems.length),this.focusItem(),this.unfocusItem(t)}}handleClick(t){t.target!==this.el&&!this.el.contains(t.target)&&this.isOpen&&this.closeMenu()}handleButtonClick(){this.isOpen?this.closeMenu():this.openMenu()}openMenu(){if(this.wrapperEl){const t=this.wrapperEl.clientWidth,r=this.el.getBoundingClientRect().left,i=document.documentElement.clientWidth-this.el.getBoundingClientRect().right;this.openRight=t>r&&i>r}this.isOpen=!0,this.focusItem()}closeMenu(){this.isOpen=!1,this.buttonFocusHandler(),this.unfocusItem(this.itemIndexToFocus),this.setFocusIndex()}focusItem(){const t=this.navigatorItems[this.itemIndexToFocus];t.tabIndex=0,t.focused=!0,window.requestAnimationFrame((()=>t.focus()))}unfocusItem(t){const r=this.navigatorItems[t];r.tabIndex=-1,r.focused=!1}buttonFocusHandler(){const t=this.el.shadowRoot.querySelector("priv-navigator-button").shadowRoot.querySelector("button");window.requestAnimationFrame((()=>t.focus()))}renderUserInfo(){return i("div",{class:"user",id:"wm-nav-user","aria-label":h.formatMessage({id:"navigator.userinfoLabel",defaultMessage:"for {name}, email {email}"},{name:this.userName,email:this.email})},i("p",null,this.userName),i("p",null,this.email))}setAltText(){return h.formatMessage(this.parsedProducts.length>1?{id:"navigator.userinfoAndProductNavigator",defaultMessage:"User information and product navigator"}:{id:"navigator.userinfo",defaultMessage:"User information"})}renderHeading(){return i("h2",null,h.formatMessage({id:"navigator.watermarkApps",defaultMessage:"Watermark Apps",description:"Applications made by Watermark Insights"}))}renderList(){return i("ul",{role:"listbox","aria-label":`${h.formatMessage({id:"navigator.WatermarkAppNavigation",defaultMessage:"Watermark App Navigation",description:"list of applications by Watermark Insights"})}`,"aria-describedby":"wm-nav-user"},this.parsedProducts.length>1&&this.renderProductOptions(),this.renderLogoutOption())}renderProductOptions(){return this.parsedProducts.map((t=>{let r,s,a,o;if(r=t.name,s=t.iconUrl,o=this.setProductOnClick(t.id),r&&s)return a=this.currentProductId===t.id,i("priv-navigator-item",{selected:a,id:t.id,onClick:o,role:"option","aria-label":r},i("img",{src:s,alt:r}))}))}setProductOnClick(t){const r=this.getProduct(t);if(this.currentProductId===t)return()=>{};if(r){if(this.loadFromUserinfo||2===this.authType)return()=>window.location.href=r.linkUrl;if(3===this.authType){const t=this.connectionName?`/?connection_name=${this.connectionName}`:"";return()=>window.location.href=r.samlLinkUrl+t}}}renderLogoutOption(){return i("priv-navigator-item",{class:"logout",selected:!(this.parsedProducts.length>1),id:"nav-logout",onClick:this.setLogoutOnclick(),role:"option"},i("span",{class:"logout"},h.formatMessage({id:"navigator.logout",defaultMessage:"Log Out"})))}setLogoutOnclick(){return()=>{this.wmNavigatorLogout.emit(),this.logoutUrl&&(window.location.href=this.logoutUrl)}}get navigatorItems(){return Array.from(this.el.shadowRoot.querySelectorAll("priv-navigator-item"))}getProduct(t){return this.parsedProducts.find((r=>r.id===t))}render(){return this.retrievedInfo?i(s,{class:this.isTabbing?"user-is-tabbing":""},i("priv-navigator-button",{expanded:this.isOpen,altText:this.setAltText(),isTabbing:this.isTabbing}),i("div",{class:`wrapper ${this.isOpen?"":"hide"} ${this.openRight?"right":""}`,ref:t=>this.wrapperEl=t},this.renderUserInfo(),this.parsedProducts.length>1&&this.renderHeading(),this.renderList())):""}static get delegatesFocus(){return!0}get el(){return a(this)}static get watchers(){return{products:["parseData"]}}};l.style=":host{--wmcolor-navigator-background:var(--wmcolor-background);--wmcolor-navigator-header-background:var(--wmcolor-brand-dark);--wmcolor-navigator-header-text:var(--wmcolor-text-ondark);--wmcolor-navigator-item-background-focus:var(--wmcolor-interactive-background-focus);--wmcolor-navigator-item-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-navigator-item-background:var(--wmcolor-background);--wmcolor-navigator-item-border:var(--wmcolor-border);--wmcolor-navigator-item-text:var(--wmcolor-text);--wmcolor-navigator-user-background:var(--wmcolor-background-readonly);min-width:0;position:relative;display:inline-block}:host .wrapper{overflow:auto;font-size:1.125rem;min-width:13.125rem;width:auto;max-height:80vh;text-align:left;position:absolute;z-index:50;top:100%;right:20px;left:auto;background:var(--wmcolor-navigator-background);letter-spacing:normal;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .wrapper .user{background:var(--wmcolor-navigator-user-background);padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper .user p{margin:0}:host .wrapper .user p:first-child{font-weight:700;text-transform:capitalize}:host .wrapper h2{background:var(--wmcolor-navigator-header-background);color:var(--wmcolor-navigator-header-text);font-weight:700;margin:0;padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper [role=listbox]{list-style:none;margin:0;padding-left:0}:host .wrapper.hide{-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0)}:host .wrapper.right{right:auto;left:20px}:host img{-webkit-transform:scale(0.8);transform:scale(0.8);-webkit-transform-origin:left center;transform-origin:left center;display:block}:host .logout{text-align:center;text-transform:capitalize}priv-navigator-item:focus{outline:none}";export{l as wm_navigator}
@@ -1 +1 @@
1
- import{r as t,c as i,h as o,H as e,g as s}from"./p-b5bedd63.js";import{q as n,g as r,o as a,y as h}from"./p-ff888d78.js";import{g as m}from"./p-888bec42.js";const c=class{constructor(o){t(this,o),this.wmActionMenuLoaded=i(this,"wmActionMenuLoaded",7),this.menuLoaded=i(this,"menuLoaded",7),this.openUp=!1,this.keysSoFar="",this.searchIndex=0,this.keyClear=null,this.isExpanded=!1,this.tooltipPosition=void 0,this.actionMenuType=null,this.buttonType=null,this.buttonText=void 0,this.disabled=!1,this.tooltip=void 0,this.labelForIdenticalButtons=void 0,this.darkMode=void 0}get horizontalPosition(){return this.el&&this.itemsEl&&n(this.el,this.itemsEl.clientWidth)?"right":"left"}get childItems(){return Array.from(this.el.querySelectorAll("wm-menuitem"))}get internalButtonType(){return"icon"===this.tempActionMenuType||"text"===this.tempActionMenuType?this.tempActionMenuType+"only":this.tempActionMenuType}get tempActionMenuType(){return this.actionMenuType||this.buttonType||"icon"}handleClickedItem(){this.close()}handleKeyUp(t){this.moveUp(t.target)}handleKeyDown(t){this.moveDown(t.detail)}handleHomeKey(){this.focusFirstItem()}handleEndKey(){this.focusLastItem()}handleTabKey(){this.isExpanded&&this.close()}handleEscKey(){this.close(),this.wmButtonEl.focus()}handleKey(t){switch(t.key){case"ArrowDown":this.isExpanded||(t.preventDefault(),this.open(),window.requestAnimationFrame((()=>this.focusFirstItem())));break;case"ArrowUp":this.isExpanded||(t.preventDefault(),this.open(),window.requestAnimationFrame((()=>this.focusLastItem())))}}handleMenuitemBlur(t){if(t.detail.relatedTarget!==this.el&&!this.el.contains(t.detail.relatedTarget)){const i=new CustomEvent("blur");i.relatedTarget=t.detail.relatedTarget,this.el.dispatchEvent(i)}}handleButtonBlur(t){(t.relatedTarget===this.el||this.el.contains(t.relatedTarget))&&t.stopPropagation()}componentWillLoad(){this.uid=this.el.id?this.el.id:r(),this.buttonType&&console.warn("wm-action-menu: button-type has been deprecated as of v3.1.0. Please use action-menu-type instead.")}componentDidLoad(){"icon"===this.tempActionMenuType||this.buttonText||console.error("wm-action-menu should have a valid button-text property when action-menu-type is set to 'text' or 'selector'"),"icon"!==this.tempActionMenuType||this.tooltip||console.error("wm-action-menu should have a valid tooltip when action-menu-type is set to 'icon'"),this.wmActionMenuLoaded.emit(),this.menuLoaded.emit()}moveUp(t){const i=this.childItems.indexOf(t);0===i?this.focusLastItem():this.focusItem(this.childItems[i-1])}moveDown(t){const i=this.childItems.indexOf(t);i===this.childItems.length-1?this.focusFirstItem():this.focusItem(this.childItems[i+1])}open(){this.disabled||(this.openUp=a(this.el,this.itemsEl.clientHeight),this.isExpanded=!0,this.itemsEl.classList.remove("hidden"),window.requestAnimationFrame((()=>this.focusFirstItem())))}close(t=!0){this.isExpanded=!1,this.childItems.forEach((t=>t.focused=!1)),window.setTimeout((()=>{this.itemsEl.classList.add("hidden")}),150),window.setTimeout((()=>{!t||"BODY"!==document.activeElement.tagName&&"WM-MENUITEM"!==document.activeElement.tagName||this.wmButtonEl.focus()}),250)}focusItem(t){this.childItems.map((i=>i.focused=i===t)),t.focus&&t.focus()}focusFirstItem(){this.focusItem(this.childItems[0])}focusLastItem(){this.focusItem(this.childItems[this.childItems.length-1])}findAndFocusItem(t){const i=t.detail.toUpperCase();if(this.focusFirstItem(),!this.keysSoFar)for(var o=0;o<this.childItems.length;o++)this.childItems[o]===document.activeElement&&(this.searchIndex=o);this.keysSoFar+=i,this.clearKeysSoFarAfterDelay();var e=this.findMatchInRange(this.childItems,this.searchIndex+1,this.childItems.length);e||(e=this.findMatchInRange(this.childItems,0,this.searchIndex)),e&&this.focusItem(e)}clearKeysSoFarAfterDelay(){this.keyClear&&(window.clearTimeout(this.keyClear),this.keyClear=null),this.keyClear=window.setTimeout(function(){this.keysSoFar="",this.keyClear=null}.bind(this),500)}findMatchInRange(t,i,o){for(var e=i;e<o;e++){var s=t[e].innerText;if(s&&0===s.toUpperCase().indexOf(this.keysSoFar))return t[e]}return null}render(){return o(e,{onBlur:()=>this.close(!1)},o("div",{class:h()},o("wm-button",{"button-type":this.internalButtonType,tooltip:this.tooltip,"custom-background":this.darkMode?"dark":void 0,"label-for-identical-buttons":this.labelForIdenticalButtons,icon:"icon"===this.tempActionMenuType?"f1d9":"",iconSize:"icon"===this.tempActionMenuType?"24px":void 0,id:`menubtn-${this.uid}`,onClick:()=>this.isExpanded?this.close():this.open(),onBlur:t=>this.handleButtonBlur(t),disabled:this.disabled,ref:t=>this.wmButtonEl=t,"tooltip-position":this.tooltipPosition||this.horizontalPosition,"aria-haspopup":"true","aria-expanded":this.isExpanded?"true":"false","aria-controls":`menu-${this.uid}`},this.buttonText),o("div",{class:`dropdown ${this.openUp?"open-up":""} ${this.horizontalPosition} ${this.isExpanded?"open":""} hidden`,id:`menu-${this.uid}`,tabindex:-1,role:"menu",ref:t=>this.itemsEl=t},o("slot",null))))}static get delegatesFocus(){return!0}get el(){return s(this)}};c.style=":host{--wmcolor-actionmenu-background:var(--wmcolor-background);--wmcolor-actionmenu-text:var(--wmcolor-interactive);position:relative;display:inline-block;width:-moz-fit-content;width:-webkit-fit-content;width:fit-content;color:var(--wmcolor-actionmenu-text);font-family:inherit}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host(:focus){outline:none}wm-action-menu:focus{outline:none}.dropdown{position:absolute;padding:0;margin:0.25rem 0;border-radius:3px 3px 3px 3px;min-width:11.4375rem;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;visibility:hidden;-webkit-box-shadow:0 3px 14px 3px rgba(5, 3, 3, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 3px 14px 3px rgba(5, 3, 3, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);background:var(--wmcolor-actionmenu-background);z-index:10;text-align:left;white-space:nowrap}.dropdown:focus{outline:none}.dropdown.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1);visibility:visible}.dropdown.open-up{bottom:2.5rem;top:auto;-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}.dropdown.right{left:0}.dropdown.left{right:0}";const l=class{constructor(o){t(this,o),this.wmMenuitemClicked=i(this,"wmMenuitemClicked",7),this.wmKeyUpPressed=i(this,"wmKeyUpPressed",7),this.wmKeyDownPressed=i(this,"wmKeyDownPressed",7),this.wmEscKeyPressed=i(this,"wmEscKeyPressed",7),this.wmHomeKeyPressed=i(this,"wmHomeKeyPressed",7),this.wmEndKeyPressed=i(this,"wmEndKeyPressed",7),this.wmPageDownItems=i(this,"wmPageDownItems",7),this.wmPageUpItems=i(this,"wmPageUpItems",7),this.wmTabKeyPressed=i(this,"wmTabKeyPressed",7),this.wmLetterPressed=i(this,"wmLetterPressed",7),this.wmMenuitemBlurred=i(this,"wmMenuitemBlurred",7),this.descriptionCharLimit=100,this.disabled=!1,this.focused=!1,this.icon=void 0,this.description=void 0,this.isKeying=!1}toggleKeyingOn(){this.isKeying=!0}toggleKeyingOff(){this.isKeying=!1}handleKeydown(t){const i=t.altKey||t.ctrlKey||t.metaKey,o=/^.$/.test(t.key)&&!i;switch(t.key){case"ArrowUp":t.preventDefault(),this.wmKeyUpPressed.emit(this.el);break;case"ArrowDown":t.preventDefault(),this.wmKeyDownPressed.emit(this.el);break;case"Enter":t.preventDefault(),this.disabled||this.el.click();break;case"Escape":t.preventDefault(),t.stopPropagation(),this.wmEscKeyPressed.emit();break;case"Home":t.preventDefault(),this.wmHomeKeyPressed.emit();break;case"End":t.preventDefault(),this.wmEndKeyPressed.emit();break;case"Tab":this.wmTabKeyPressed.emit();break;default:o&&(t.preventDefault(),this.wmLetterPressed.emit(t.key))}}handleClick(){this.disabled||this.wmMenuitemClicked.emit()}handleBlur(t){this.wmMenuitemBlurred.emit({relatedTarget:t.relatedTarget})}setOnClick(){this.disabled&&this.el.onclick?(this.onClickFunc=this.el.onclick,this.el.onclick=null):!this.disabled&&this.onClickFunc&&(this.el.onclick=this.onClickFunc)}componentWillLoad(){this.icon&&(this.icon=m(this.icon)),this.description&&(this.description.length>this.descriptionCharLimit&&console.error(`wm-menuitem description is above the character limit of ${this.descriptionCharLimit}`),this.icon&&console.error("wm-menuitems with descriptions do not support the use of icons")),this.setOnClick()}componentDidLoad(){this.icon&&(this.iconEl.classList.add("mdi"),this.iconEl.innerHTML=`&#x${this.icon};`)}render(){return o(e,{tabindex:-1,role:"menuitem","aria-disabled":this.disabled?"true":null},o("div",{class:"wrapper "+(this.focused&&this.isKeying?"focus":""),"aria-disabled":this.disabled?"true":null},o("span",{ref:t=>this.iconEl=t}),this.el.textContent,this.description?o("div",{class:"description"},this.description):""))}get el(){return s(this)}static get watchers(){return{disabled:["setOnClick"]}}};l.style=':host{--wmcolor-actionmenu-item-background-hover:var(--wmcolor-option-background-hover);--wmcolor-actionmenu-item-background:var(--wmcolor-option-background);--wmcolor-actionmenu-item-border:var(--wmcolor-option-border);--wmcolor-actionmenu-item-text-description:var(--wmcolor-option-text);--wmcolor-actionmenu-item-text-disabled:var(--wmcolor-option-text-disabled);--wmcolor-actionmenu-item-text:var(--wmcolor-interactive);contain:content;font-family:inherit}:host .wrapper{display:block;min-width:8.75rem;cursor:pointer;padding:1.25rem;border-radius:0px 0px 0px 0px;background:var(--wmcolor-actionmenu-item-background);font-family:inherit;font-weight:500;list-style:none;border-bottom:2px solid var(--wmcolor-actionmenu-item-border);color:var(--wmcolor-actionmenu-item-text);font-weight:700}:host .wrapper:focus,:host .wrapper.focus{outline:none;background:var(--wmcolor-actionmenu-item-background-hover)}:host .wrapper:hover{background:var(--wmcolor-actionmenu-item-background-hover);outline:none}:host .wrapper .description{color:var(--wmcolor-actionmenu-item-text-description);font-size:0.875rem;padding-top:0.5rem;white-space:normal;font-weight:400}:host .wrapper[aria-disabled=true]{font-style:italic;color:var(--wmcolor-actionmenu-text-disabled)}:host .wrapper:not(:last-child){border-bottom:2px solid var(--wmcolor-actionmenu-item-border)}:host ::slotted{font-family:inherit}:host .mdi{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;margin-right:0.625rem;pointer-events:none;font-size:1.12rem}:host(:focus){outline:none;background:var(--wmcolor-actionmenu-item-background-hover)}:host([aria-disabled=true]){pointer-events:none}';export{c as wm_action_menu,l as wm_menuitem}
1
+ import{r as t,c as i,h as o,H as e,g as s}from"./p-b5bedd63.js";import{q as n,g as r,o as a,y as h}from"./p-f0d87250.js";import{g as m}from"./p-888bec42.js";const c=class{constructor(o){t(this,o),this.wmActionMenuLoaded=i(this,"wmActionMenuLoaded",7),this.menuLoaded=i(this,"menuLoaded",7),this.openUp=!1,this.keysSoFar="",this.searchIndex=0,this.keyClear=null,this.isExpanded=!1,this.tooltipPosition=void 0,this.actionMenuType=null,this.buttonType=null,this.buttonText=void 0,this.disabled=!1,this.tooltip=void 0,this.labelForIdenticalButtons=void 0,this.darkMode=void 0}get horizontalPosition(){return this.el&&this.itemsEl&&n(this.el,this.itemsEl.clientWidth)?"right":"left"}get childItems(){return Array.from(this.el.querySelectorAll("wm-menuitem"))}get internalButtonType(){return"icon"===this.tempActionMenuType||"text"===this.tempActionMenuType?this.tempActionMenuType+"only":this.tempActionMenuType}get tempActionMenuType(){return this.actionMenuType||this.buttonType||"icon"}handleClickedItem(){this.close()}handleKeyUp(t){this.moveUp(t.target)}handleKeyDown(t){this.moveDown(t.detail)}handleHomeKey(){this.focusFirstItem()}handleEndKey(){this.focusLastItem()}handleTabKey(){this.isExpanded&&this.close()}handleEscKey(){this.close(),this.wmButtonEl.focus()}handleKey(t){switch(t.key){case"ArrowDown":this.isExpanded||(t.preventDefault(),this.open(),window.requestAnimationFrame((()=>this.focusFirstItem())));break;case"ArrowUp":this.isExpanded||(t.preventDefault(),this.open(),window.requestAnimationFrame((()=>this.focusLastItem())))}}handleMenuitemBlur(t){if(t.detail.relatedTarget!==this.el&&!this.el.contains(t.detail.relatedTarget)){const i=new CustomEvent("blur");i.relatedTarget=t.detail.relatedTarget,this.el.dispatchEvent(i)}}handleButtonBlur(t){(t.relatedTarget===this.el||this.el.contains(t.relatedTarget))&&t.stopPropagation()}componentWillLoad(){this.uid=this.el.id?this.el.id:r(),this.buttonType&&console.warn("wm-action-menu: button-type has been deprecated as of v3.1.0. Please use action-menu-type instead.")}componentDidLoad(){"icon"===this.tempActionMenuType||this.buttonText||console.error("wm-action-menu should have a valid button-text property when action-menu-type is set to 'text' or 'selector'"),"icon"!==this.tempActionMenuType||this.tooltip||console.error("wm-action-menu should have a valid tooltip when action-menu-type is set to 'icon'"),this.wmActionMenuLoaded.emit(),this.menuLoaded.emit()}moveUp(t){const i=this.childItems.indexOf(t);0===i?this.focusLastItem():this.focusItem(this.childItems[i-1])}moveDown(t){const i=this.childItems.indexOf(t);i===this.childItems.length-1?this.focusFirstItem():this.focusItem(this.childItems[i+1])}open(){this.disabled||(this.openUp=a(this.el,this.itemsEl.clientHeight),this.isExpanded=!0,this.itemsEl.classList.remove("hidden"),window.requestAnimationFrame((()=>this.focusFirstItem())))}close(t=!0){this.isExpanded=!1,this.childItems.forEach((t=>t.focused=!1)),window.setTimeout((()=>{this.itemsEl.classList.add("hidden")}),150),window.setTimeout((()=>{!t||"BODY"!==document.activeElement.tagName&&"WM-MENUITEM"!==document.activeElement.tagName||this.wmButtonEl.focus()}),250)}focusItem(t){this.childItems.map((i=>i.focused=i===t)),t.focus&&t.focus()}focusFirstItem(){this.focusItem(this.childItems[0])}focusLastItem(){this.focusItem(this.childItems[this.childItems.length-1])}findAndFocusItem(t){const i=t.detail.toUpperCase();if(this.focusFirstItem(),!this.keysSoFar)for(var o=0;o<this.childItems.length;o++)this.childItems[o]===document.activeElement&&(this.searchIndex=o);this.keysSoFar+=i,this.clearKeysSoFarAfterDelay();var e=this.findMatchInRange(this.childItems,this.searchIndex+1,this.childItems.length);e||(e=this.findMatchInRange(this.childItems,0,this.searchIndex)),e&&this.focusItem(e)}clearKeysSoFarAfterDelay(){this.keyClear&&(window.clearTimeout(this.keyClear),this.keyClear=null),this.keyClear=window.setTimeout(function(){this.keysSoFar="",this.keyClear=null}.bind(this),500)}findMatchInRange(t,i,o){for(var e=i;e<o;e++){var s=t[e].innerText;if(s&&0===s.toUpperCase().indexOf(this.keysSoFar))return t[e]}return null}render(){return o(e,{onBlur:()=>this.close(!1)},o("div",{class:h()},o("wm-button",{"button-type":this.internalButtonType,tooltip:this.tooltip,"custom-background":this.darkMode?"dark":void 0,"label-for-identical-buttons":this.labelForIdenticalButtons,icon:"icon"===this.tempActionMenuType?"f1d9":"",iconSize:"icon"===this.tempActionMenuType?"24px":void 0,id:`menubtn-${this.uid}`,onClick:()=>this.isExpanded?this.close():this.open(),onBlur:t=>this.handleButtonBlur(t),disabled:this.disabled,ref:t=>this.wmButtonEl=t,"tooltip-position":this.tooltipPosition||this.horizontalPosition,"aria-haspopup":"true","aria-expanded":this.isExpanded?"true":"false","aria-controls":`menu-${this.uid}`},this.buttonText),o("div",{class:`dropdown ${this.openUp?"open-up":""} ${this.horizontalPosition} ${this.isExpanded?"open":""} hidden`,id:`menu-${this.uid}`,tabindex:-1,role:"menu",ref:t=>this.itemsEl=t},o("slot",null))))}static get delegatesFocus(){return!0}get el(){return s(this)}};c.style=":host{--wmcolor-actionmenu-background:var(--wmcolor-background);--wmcolor-actionmenu-text:var(--wmcolor-interactive);position:relative;display:inline-block;width:-moz-fit-content;width:-webkit-fit-content;width:fit-content;color:var(--wmcolor-actionmenu-text);font-family:inherit}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host(:focus){outline:none}wm-action-menu:focus{outline:none}.dropdown{position:absolute;padding:0;margin:0.25rem 0;border-radius:3px 3px 3px 3px;min-width:11.4375rem;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;visibility:hidden;-webkit-box-shadow:0 3px 14px 3px rgba(5, 3, 3, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 3px 14px 3px rgba(5, 3, 3, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);background:var(--wmcolor-actionmenu-background);z-index:10;text-align:left;white-space:nowrap}.dropdown:focus{outline:none}.dropdown.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1);visibility:visible}.dropdown.open-up{bottom:2.5rem;top:auto;-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}.dropdown.right{left:0}.dropdown.left{right:0}";const l=class{constructor(o){t(this,o),this.wmMenuitemClicked=i(this,"wmMenuitemClicked",7),this.wmKeyUpPressed=i(this,"wmKeyUpPressed",7),this.wmKeyDownPressed=i(this,"wmKeyDownPressed",7),this.wmEscKeyPressed=i(this,"wmEscKeyPressed",7),this.wmHomeKeyPressed=i(this,"wmHomeKeyPressed",7),this.wmEndKeyPressed=i(this,"wmEndKeyPressed",7),this.wmPageDownItems=i(this,"wmPageDownItems",7),this.wmPageUpItems=i(this,"wmPageUpItems",7),this.wmTabKeyPressed=i(this,"wmTabKeyPressed",7),this.wmLetterPressed=i(this,"wmLetterPressed",7),this.wmMenuitemBlurred=i(this,"wmMenuitemBlurred",7),this.descriptionCharLimit=100,this.disabled=!1,this.focused=!1,this.icon=void 0,this.description=void 0,this.isKeying=!1}toggleKeyingOn(){this.isKeying=!0}toggleKeyingOff(){this.isKeying=!1}handleKeydown(t){const i=t.altKey||t.ctrlKey||t.metaKey,o=/^.$/.test(t.key)&&!i;switch(t.key){case"ArrowUp":t.preventDefault(),this.wmKeyUpPressed.emit(this.el);break;case"ArrowDown":t.preventDefault(),this.wmKeyDownPressed.emit(this.el);break;case"Enter":t.preventDefault(),this.disabled||this.el.click();break;case"Escape":t.preventDefault(),t.stopPropagation(),this.wmEscKeyPressed.emit();break;case"Home":t.preventDefault(),this.wmHomeKeyPressed.emit();break;case"End":t.preventDefault(),this.wmEndKeyPressed.emit();break;case"Tab":this.wmTabKeyPressed.emit();break;default:o&&(t.preventDefault(),this.wmLetterPressed.emit(t.key))}}handleClick(){this.disabled||this.wmMenuitemClicked.emit()}handleBlur(t){this.wmMenuitemBlurred.emit({relatedTarget:t.relatedTarget})}setOnClick(){this.disabled&&this.el.onclick?(this.onClickFunc=this.el.onclick,this.el.onclick=null):!this.disabled&&this.onClickFunc&&(this.el.onclick=this.onClickFunc)}componentWillLoad(){this.icon&&(this.icon=m(this.icon)),this.description&&(this.description.length>this.descriptionCharLimit&&console.error(`wm-menuitem description is above the character limit of ${this.descriptionCharLimit}`),this.icon&&console.error("wm-menuitems with descriptions do not support the use of icons")),this.setOnClick()}componentDidLoad(){this.icon&&(this.iconEl.classList.add("mdi"),this.iconEl.innerHTML=`&#x${this.icon};`)}render(){return o(e,{tabindex:-1,role:"menuitem","aria-disabled":this.disabled?"true":null},o("div",{class:"wrapper "+(this.focused&&this.isKeying?"focus":""),"aria-disabled":this.disabled?"true":null},o("span",{ref:t=>this.iconEl=t}),this.el.textContent,this.description?o("div",{class:"description"},this.description):""))}get el(){return s(this)}static get watchers(){return{disabled:["setOnClick"]}}};l.style=':host{--wmcolor-actionmenu-item-background-hover:var(--wmcolor-option-background-hover);--wmcolor-actionmenu-item-background:var(--wmcolor-option-background);--wmcolor-actionmenu-item-border:var(--wmcolor-option-border);--wmcolor-actionmenu-item-text-description:var(--wmcolor-option-text);--wmcolor-actionmenu-item-text-disabled:var(--wmcolor-option-text-disabled);--wmcolor-actionmenu-item-text:var(--wmcolor-interactive);contain:content;font-family:inherit}:host .wrapper{display:block;min-width:8.75rem;cursor:pointer;padding:1.25rem;border-radius:0px 0px 0px 0px;background:var(--wmcolor-actionmenu-item-background);font-family:inherit;font-weight:500;list-style:none;border-bottom:2px solid var(--wmcolor-actionmenu-item-border);color:var(--wmcolor-actionmenu-item-text);font-weight:700}:host .wrapper:focus,:host .wrapper.focus{outline:none;background:var(--wmcolor-actionmenu-item-background-hover)}:host .wrapper:hover{background:var(--wmcolor-actionmenu-item-background-hover);outline:none}:host .wrapper .description{color:var(--wmcolor-actionmenu-item-text-description);font-size:0.875rem;padding-top:0.5rem;white-space:normal;font-weight:400}:host .wrapper[aria-disabled=true]{font-style:italic;color:var(--wmcolor-actionmenu-text-disabled)}:host .wrapper:not(:last-child){border-bottom:2px solid var(--wmcolor-actionmenu-item-border)}:host ::slotted{font-family:inherit}:host .mdi{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;margin-right:0.625rem;pointer-events:none;font-size:1.12rem}:host(:focus){outline:none;background:var(--wmcolor-actionmenu-item-background-hover)}:host([aria-disabled=true]){pointer-events:none}';export{c as wm_action_menu,l as wm_menuitem}
@@ -1 +1 @@
1
- import{h as t}from"./p-b5bedd63.js";import{i as s,c as i,f as e,e as n,d as a}from"./p-ff888d78.js";const o="#ff5f4e",r="#19a1a9",h="#088000",c="#2e1b46",d="#8b86ca",l="#575195",u="#6b6b6b",g={doughnut:{size:155,colors:[h,u],thickness:.73,padding:25,category:"doughnut"},doughnut0:{size:155,colors:[h,u],thickness:.73,padding:25,category:"doughnut"},doughnut1:{size:130,colors:[d,c,u],thickness:.5,padding:90,category:"doughnut"},doughnut2:{size:130,colors:[r,o,u],thickness:.5,padding:90,category:"doughnut"},doughnut2b:{size:130,colors:[l,r,o,u],thickness:.5,padding:90,category:"doughnut"},doughnut3:{size:130,colors:[d,c,"#0089e4",h,"#ea8500","#d54f41","#146ca9"],thickness:.5,padding:90,category:"doughnut"},bar:{size:350,colors:[h,u],padding:0,category:"stackedBar"},bar1:{size:350,colors:[h,u],padding:0,category:"stackedBar"},bar2:{size:400,colors:[u,l,r,o],padding:0,category:"stackedBar"},bar2b:{size:400,colors:[u,l,c,r,o],padding:0,category:"stackedBar"},bar3:{size:300,colors:["#0d696e",r,"#8e4129",o],padding:0,category:"stackedBar"},bar4:{size:400,colors:[o,r,l],padding:0,category:"stackedBar"},bar5:{size:400,colors:[u,d,c,"#0089e4",h,"#ea8500","#d54f41","#146ca9"],padding:0,category:"stackedBar"},bar6:{size:400,colors:[d],padding:0,category:"simpleBar"},bar7:{size:400,colors:[l,r,o,u],padding:0,category:"simpleBar"}};function p(t){return"percentage"===t||"amount"===t?"show-values":""}const f=s.formatMessage({id:"chart.hiddenValues",defaultMessage:"Values are not shown when too close to each other.",description:"Text displayed when a chart has some values hidden"}),b=s.formatMessage({id:"chart.clickToSeeDetails",defaultMessage:"Click or use arrow keys to see details.",description:"Text displayed, guiding user to interact to see more details."});function m(t){return t>999||t<-999?Math.round(t/100)/10+"K":t}function v(t,s,i){return i?Math.round(100*t/s):Math.round(1e4*t/s)/100}function w(t,s){return 360*t/s}function y(t){return parseFloat((Math.floor(100*t)/100).toFixed(2))}function k(t,s,i,e){var n=y(t+t*s*Math.cos(Math.PI*i/180)),a=y(t+t*s*Math.sin(Math.PI*i/180));return void 0!==e?{x1:n,y1:a,x2:y(t+t*s*Math.cos(Math.PI*e/180)),y2:y(t+t*s*Math.sin(Math.PI*e/180))}:{x:n,y:a}}function x(t,s,i,e,n){var a=y(n/2*t);return`A ${a}, ${a} 0 ${s} ${y(i)}, ${y(e)}`}function $(t,s){const i=t/s,e=10**Math.floor(Math.log10(i)),n=i/e;let a;return a=n>5?10*e:n>3?5*e:n>2?3*e:n>1.5?2*e:n>1?1.5*e:e,a}function M(t){if(this.popoverEl&&this.popoverEl.open&&"Enter"===t.key){const t=this.popoverEl.querySelector("button");t&&t.click()}}function z(t,s){this.popoverEl&&!this.isTabbing&&(s.coords={x:t.clientX,y:t.clientY},D.call(this,s))}function B(t,s){this.popoverEl&&this.isTabbing&&(s.coords=i(t.target),D.call(this,s))}function C(t){switch(t.key){case"ArrowUp":case"ArrowLeft":t.preventDefault(),this.isTabbing=!0,F.call(this);break;case"ArrowRight":case"ArrowDown":t.preventDefault(),this.isTabbing=!0,A.call(this);break;case"Tab":T.call(this);break;case"Escape":this.popoverEl.open=!1,this.userIsNavigating=!1}}function D(t){if(this.popoverEl&&t.title&&t.text){this.popoverEl.popoverTitle=t.title,this.popoverEl.popoverText=t.text,this.popoverEl.buttonText=t.buttonText,this.popoverEl.coords=t.coords,this.popoverEl.sliceRef=t.sliceRef,window.setTimeout((()=>{this.popoverEl&&(this.popoverEl.open=!0)}),30);const s=a((async()=>{this.popoverEl.open=!1}),10);document.addEventListener("scroll",(()=>{s()}));const i=e(this.el);i&&i.addEventListener("scroll",(()=>{s()}))}}function A(){const t=n(document.activeElement),s=(this.sliceEls.indexOf(t)+1)%this.sliceEls.length;S.call(this,s)}function F(){if(this.sliceEls){const t=n(document.activeElement);let s=this.sliceEls.indexOf(t);-1===s?s=0:0===s?s=this.sliceEls.length-1:s-=1,S.call(this,s)}}function S(t){this.sliceEls&&this.el&&(this.userIsNavigating=!0,this.popoverEl&&(this.popoverEl.open=!1),this.componentWrapperEl.tabIndex=-1,this.el.focusable=!1,this.sliceEls.map((t=>{t.tabIndex=-1,t.focusable=!1})),this.sliceEls[t].tabIndex=0,this.sliceEls[t].focusable=!0,this.sliceEls[t].focus(),window.setTimeout((()=>{this.popoverEl&&(this.popoverEl.open=!0)}),10))}function T(){this.sliceEls&&this.sliceEls.map((t=>{t.tabIndex=-1,t.focusable=!1})),this.userIsNavigating=!1,window.setTimeout((()=>{this.componentWrapperEl.tabIndex=0,this.el.focusable=!0,this.popoverEl&&(this.popoverEl.open=!1)}),100)}async function K(t){this.slicesDetails=[];let s=0;const i=Array.from(this.el.children);this.total=i.reduce(((t,s)=>t+parseInt(s.getAttribute("amount")||"0")),0),i.forEach(((i,e)=>{const n=parseInt(i.getAttribute("amount")||"0"),a=v(n,this.total,!0);let o=e;"bar5"===t&&(o=this.notStartedColor?e:e+1),"bar6"===t&&(o=0);const r=g[t].colors[o],h={amount:n,perc:a,legend:i.getAttribute("legend"),color:r||u,offset:s,id:`${this.uid}-${e+1}`,title:i.getAttribute("popover-title"),text:i.getAttribute("popover-text"),buttonText:i.getAttribute("popover-button-text"),sliceRef:i,inSmallCluster:!1};s+=n,this.slicesDetails.push(h)}))}function j(t,s,i){const e=w(s,this.total)-90,n=t/this.total*360;let a=e+n;const o=n>180?"1 1":"0 1",r=n>180?"1 0":"0 0",h=this.chartDetails.size/2,c=this.chartDetails.thickness,d="doughnut0"===i||"doughnut"===i?2.25:3;360===n&&(a-=.01);const l=k(h,1,e+1.5,a),u=k(h,c,e+d,a);return`M ${l.x1}, ${l.y1} `+x(1,o,l.x2,l.y2,this.chartDetails.size)+` L ${u.x2}, ${u.y2} `+x(c,r,u.x1,u.y1,this.chartDetails.size)+" z"}function I(){const i=s.formatMessage({id:"chart.instructions",defaultMessage:"Use arrow keys to browse elements, press Tab to exit.",description:"For screen readers only, instructions on how to interact with the chart component"});return t("div",{id:"chart-instructions"},i)}function W(s){const i=this.chartDetails.size+this.chartDetails.padding,e="doughnut0"===s||"doughnut"===s;let n=e?this.slicesDetails:function(t,s){let i=[...t].sort(((t,s)=>t.amount===s.amount?0:t.amount>s.amount?-1:1)),e=0;return i.forEach(((t,n)=>{const a=i[n===i.length-1?0:n+1],o=v(i[0===n?i.length-1:n-1].amount,s,!0),r=v(a.amount,s,!0);t.offset=e,e+=t.amount,t.inSmallCluster=function(t,s,i,e){let n=s<4&&(t<5||e<5);return 0===s&&i>0&&(e<8||t<8)&&(n=!0),n}(o,t.perc,t.amount,r)})),i}(this.slicesDetails,this.total);return t("div",{class:"chart-wrapper doughnut-wrapper"},t("svg",{width:i+"px",height:i+"px",id:`graphic-${this.uid}`,class:"doughnut-svg"},t("defs",null,t("filter",{id:"wmHoverDropShadow"},t("feGaussianBlur",{stdDeviation:"3"}),t("feOffset",{result:"offsetblur"}),t("feFlood",{"flood-color":"#333"}),t("feComposite",{operator:"in",in2:"offsetblur"}),t("feMerge",null,t("feMergeNode",null),t("feMergeNode",{in:"SourceGraphic"})))),n.map((t=>E.call(this,t,s))),e?t("text",{class:"value",x:"50%",y:"50%","font-size":"1.5rem","font-weight":"500","text-anchor":"middle","dominant-baseline":"middle"},v(n[0].amount,this.total,!0)+"%"):t("g",{transform:`translate(${this.chartDetails.padding/2}, ${this.chartDetails.padding/2})`,"text-anchor":"middle","dominant-baseline":"middle"},n.map((t=>t.amount>0&&!t.inSmallCluster?G.call(this,t):"")))))}function E(s,i){return t("g",{transform:`translate(${this.chartDetails.padding/2}, ${this.chartDetails.padding/2})`},t("path",{id:s.id,class:"segment doughnut-segment",fill:s.amount?s.color:"transparent",d:j.call(this,s.amount,s.offset,i),onClick:t=>z.call(this,t,s),onFocus:t=>B.call(this,t,s),onKeyDown:t=>M.call(this,t),role:"img","aria-label":s.legend}))}function G(s){const i=w(s.offset+s.amount/2,this.total);let{x:e,y:n}=k(this.chartDetails.size/2,1.4,i-90);return t("text",{class:"value",x:e+"px",y:n+"px"},`${s.perc>0?s.perc:"<1"}%`)}function L(s){const i="bar1"===s||"bar"===s;return t("div",{class:"chart-wrapper bar-wrapper"},i?t("div",{class:"single-perc"},v(this.slicesDetails[0].amount,this.total,!0)+"%"):"","bar3"===this.chartType&&this.drawAxis(),t("div",{class:`inner-stacked-bar-wrapper ${p(this.tempValueFormat)}`},i?"":t("div",{class:"values"},this.slicesDetails.map(((t,s)=>this.renderBarText(t,s)))),t("div",{class:"stacked-bar-segments-wrapper"},this.slicesDetails.map(((t,s)=>N.call(this,t,s)))),i?O.call(this):""))}function N(s,i){const e=i!==this.slicesDetails.length-1,n=`calc(${v(s.amount,this.total,!1)}%${e?" - 2px":""})`;return t("div",{class:"segment stacked-bar-segment "+(0===v(s.amount,this.total,!1)?"zero":""),style:{backgroundColor:s.color,width:n},onClick:t=>z.call(this,t,s),onFocus:t=>B.call(this,t,s),onKeyDown:t=>M.call(this,t)},t("span",{class:"sr-only"},s.legend))}function R(s){const i=this.slicesDetails.map((t=>t.amount)).reduce(((t,s)=>t>s?t:s)),e=parseInt(getComputedStyle(this.el).getPropertyValue("--labelWidth"),10);let n=(a=this.el.getBoundingClientRect().width-e-48,Math.round(a/function(t){return function(t){let s=80*(t-300)/600+70;return s<70?70:s>150?150:s}(t)}(a)));var a;let o=$(i,n);const r=Math.floor((n*o-i)/o);n-=r,this.el.style.setProperty("--backgroundSize",100/n+"%"),this.el.style.setProperty("--labelWidth",this.labelWidth),"bar7"!==s||this.showBarLegend||this.el.style.setProperty("--labelWidth","0px");const h=[];this.slicesDetails.forEach((e=>{e.legend&&h.push(function(s,i,e){return t("label",{class:`label${"bar7"!==e||i?"":" hidden"}`},s)}(e.legend,this.showBarLegend,s)),h.push(U.call(this,e,o,n,i))}));const c=[];for(let s=1;s<=n;s++){const i=m(s*o);c.push(t("div",{class:"tick"},t("span",null,i)))}const d="bar6"===s&&this.showGrid&&this.el.getBoundingClientRect().width>300;return t("div",{class:"chart-wrapper simple-bar-wrapper"},t("div",{class:`chart ${p(this.tempValueFormat)}`},d&&t("div",{class:"gridlines"}),t("div",{class:"rows"},h)),d&&t("div",{class:"x-axis","aria-hidden":"true"},t("div",{class:"zero"},t("span",null,"0")),c))}function U(s,i,e,n){const a=v(s.amount,"bar6"===this.currentChartType?i*e:n,!1),o=a?a+"%":"1px",r=m(s.amount);let h="amount"===this.tempValueFormat?r:"";return"bar6"===this.currentChartType&&"percentage"===this.tempValueFormat?h=s.amount+"%":"bar7"===this.currentChartType&&"percentage"===this.tempValueFormat&&(h=(0===this.total?"0":v(s.amount,this.total,!0))+"%"),t("div",{class:"bar segment",style:{backgroundColor:s.color,width:o},onClick:t=>z.call(this,t,s),onFocus:t=>B.call(this,t,s),onKeyDown:t=>M.call(this,t)},t("div",{class:"value"},h))}function V(s){if(this.showLegend){const i=!this.chartDetails.isBar&&this.slicesDetails.reduce(((t,s)=>!!s.inSmallCluster||t),!1);return t("div",{class:"legend-wrapper"},t("div",{class:`legend ${s} ${"bar"===this.mode?"--top":"--bottom"}`,"aria-hidden":"true"},this.slicesDetails.map((t=>{if(t.amount||t.legend)return H({key:t.legend,color:t.color})}))),i&&q())}}function H(s){return t("div",{class:"legend-item"},t("div",{class:"legend-color",style:{backgroundColor:s.color}}),t("div",{class:"legend-text"},s.key))}function O(){if(this.completionMessage)return t("div",{class:"completion-message"},this.completionMessage)}function q(){return t("div",{class:"hidden-values-warning"},f,t("br",null),b)}export{g as a,v as b,L as c,W as d,I as e,V as f,K as g,C as h,O as i,q as j,T as k,H as l,m,$ as n,R as r}
1
+ import{h as t}from"./p-b5bedd63.js";import{i as s,c as i,f as e,e as n,d as a}from"./p-f0d87250.js";const o="#ff5f4e",r="#19a1a9",h="#088000",c="#2e1b46",d="#8b86ca",l="#575195",u="#6b6b6b",g={doughnut:{size:155,colors:[h,u],thickness:.73,padding:25,category:"doughnut"},doughnut0:{size:155,colors:[h,u],thickness:.73,padding:25,category:"doughnut"},doughnut1:{size:130,colors:[d,c,u],thickness:.5,padding:90,category:"doughnut"},doughnut2:{size:130,colors:[r,o,u],thickness:.5,padding:90,category:"doughnut"},doughnut2b:{size:130,colors:[l,r,o,u],thickness:.5,padding:90,category:"doughnut"},doughnut3:{size:130,colors:[d,c,"#0089e4",h,"#ea8500","#d54f41","#146ca9"],thickness:.5,padding:90,category:"doughnut"},bar:{size:350,colors:[h,u],padding:0,category:"stackedBar"},bar1:{size:350,colors:[h,u],padding:0,category:"stackedBar"},bar2:{size:400,colors:[u,l,r,o],padding:0,category:"stackedBar"},bar2b:{size:400,colors:[u,l,c,r,o],padding:0,category:"stackedBar"},bar3:{size:300,colors:["#0d696e",r,"#8e4129",o],padding:0,category:"stackedBar"},bar4:{size:400,colors:[o,r,l],padding:0,category:"stackedBar"},bar5:{size:400,colors:[u,d,c,"#0089e4",h,"#ea8500","#d54f41","#146ca9"],padding:0,category:"stackedBar"},bar6:{size:400,colors:[d],padding:0,category:"simpleBar"},bar7:{size:400,colors:[l,r,o,u],padding:0,category:"simpleBar"}};function p(t){return"percentage"===t||"amount"===t?"show-values":""}const f=s.formatMessage({id:"chart.hiddenValues",defaultMessage:"Values are not shown when too close to each other.",description:"Text displayed when a chart has some values hidden"}),b=s.formatMessage({id:"chart.clickToSeeDetails",defaultMessage:"Click or use arrow keys to see details.",description:"Text displayed, guiding user to interact to see more details."});function m(t){return t>999||t<-999?Math.round(t/100)/10+"K":t}function v(t,s,i){return i?Math.round(100*t/s):Math.round(1e4*t/s)/100}function w(t,s){return 360*t/s}function y(t){return parseFloat((Math.floor(100*t)/100).toFixed(2))}function k(t,s,i,e){var n=y(t+t*s*Math.cos(Math.PI*i/180)),a=y(t+t*s*Math.sin(Math.PI*i/180));return void 0!==e?{x1:n,y1:a,x2:y(t+t*s*Math.cos(Math.PI*e/180)),y2:y(t+t*s*Math.sin(Math.PI*e/180))}:{x:n,y:a}}function x(t,s,i,e,n){var a=y(n/2*t);return`A ${a}, ${a} 0 ${s} ${y(i)}, ${y(e)}`}function $(t,s){const i=t/s,e=10**Math.floor(Math.log10(i)),n=i/e;let a;return a=n>5?10*e:n>3?5*e:n>2?3*e:n>1.5?2*e:n>1?1.5*e:e,a}function M(t){if(this.popoverEl&&this.popoverEl.open&&"Enter"===t.key){const t=this.popoverEl.querySelector("button");t&&t.click()}}function z(t,s){this.popoverEl&&!this.isTabbing&&(s.coords={x:t.clientX,y:t.clientY},D.call(this,s))}function B(t,s){this.popoverEl&&this.isTabbing&&(s.coords=i(t.target),D.call(this,s))}function C(t){switch(t.key){case"ArrowUp":case"ArrowLeft":t.preventDefault(),this.isTabbing=!0,F.call(this);break;case"ArrowRight":case"ArrowDown":t.preventDefault(),this.isTabbing=!0,A.call(this);break;case"Tab":T.call(this);break;case"Escape":this.popoverEl.open=!1,this.userIsNavigating=!1}}function D(t){if(this.popoverEl&&t.title&&t.text){this.popoverEl.popoverTitle=t.title,this.popoverEl.popoverText=t.text,this.popoverEl.buttonText=t.buttonText,this.popoverEl.coords=t.coords,this.popoverEl.sliceRef=t.sliceRef,window.setTimeout((()=>{this.popoverEl&&(this.popoverEl.open=!0)}),30);const s=a((async()=>{this.popoverEl.open=!1}),10);document.addEventListener("scroll",(()=>{s()}));const i=e(this.el);i&&i.addEventListener("scroll",(()=>{s()}))}}function A(){const t=n(document.activeElement),s=(this.sliceEls.indexOf(t)+1)%this.sliceEls.length;S.call(this,s)}function F(){if(this.sliceEls){const t=n(document.activeElement);let s=this.sliceEls.indexOf(t);-1===s?s=0:0===s?s=this.sliceEls.length-1:s-=1,S.call(this,s)}}function S(t){this.sliceEls&&this.el&&(this.userIsNavigating=!0,this.popoverEl&&(this.popoverEl.open=!1),this.componentWrapperEl.tabIndex=-1,this.el.focusable=!1,this.sliceEls.map((t=>{t.tabIndex=-1,t.focusable=!1})),this.sliceEls[t].tabIndex=0,this.sliceEls[t].focusable=!0,this.sliceEls[t].focus(),window.setTimeout((()=>{this.popoverEl&&(this.popoverEl.open=!0)}),10))}function T(){this.sliceEls&&this.sliceEls.map((t=>{t.tabIndex=-1,t.focusable=!1})),this.userIsNavigating=!1,window.setTimeout((()=>{this.componentWrapperEl.tabIndex=0,this.el.focusable=!0,this.popoverEl&&(this.popoverEl.open=!1)}),100)}async function K(t){this.slicesDetails=[];let s=0;const i=Array.from(this.el.children);this.total=i.reduce(((t,s)=>t+parseInt(s.getAttribute("amount")||"0")),0),i.forEach(((i,e)=>{const n=parseInt(i.getAttribute("amount")||"0"),a=v(n,this.total,!0);let o=e;"bar5"===t&&(o=this.notStartedColor?e:e+1),"bar6"===t&&(o=0);const r=g[t].colors[o],h={amount:n,perc:a,legend:i.getAttribute("legend"),color:r||u,offset:s,id:`${this.uid}-${e+1}`,title:i.getAttribute("popover-title"),text:i.getAttribute("popover-text"),buttonText:i.getAttribute("popover-button-text"),sliceRef:i,inSmallCluster:!1};s+=n,this.slicesDetails.push(h)}))}function j(t,s,i){const e=w(s,this.total)-90,n=t/this.total*360;let a=e+n;const o=n>180?"1 1":"0 1",r=n>180?"1 0":"0 0",h=this.chartDetails.size/2,c=this.chartDetails.thickness,d="doughnut0"===i||"doughnut"===i?2.25:3;360===n&&(a-=.01);const l=k(h,1,e+1.5,a),u=k(h,c,e+d,a);return`M ${l.x1}, ${l.y1} `+x(1,o,l.x2,l.y2,this.chartDetails.size)+` L ${u.x2}, ${u.y2} `+x(c,r,u.x1,u.y1,this.chartDetails.size)+" z"}function I(){const i=s.formatMessage({id:"chart.instructions",defaultMessage:"Use arrow keys to browse elements, press Tab to exit.",description:"For screen readers only, instructions on how to interact with the chart component"});return t("div",{id:"chart-instructions"},i)}function W(s){const i=this.chartDetails.size+this.chartDetails.padding,e="doughnut0"===s||"doughnut"===s;let n=e?this.slicesDetails:function(t,s){let i=[...t].sort(((t,s)=>t.amount===s.amount?0:t.amount>s.amount?-1:1)),e=0;return i.forEach(((t,n)=>{const a=i[n===i.length-1?0:n+1],o=v(i[0===n?i.length-1:n-1].amount,s,!0),r=v(a.amount,s,!0);t.offset=e,e+=t.amount,t.inSmallCluster=function(t,s,i,e){let n=s<4&&(t<5||e<5);return 0===s&&i>0&&(e<8||t<8)&&(n=!0),n}(o,t.perc,t.amount,r)})),i}(this.slicesDetails,this.total);return t("div",{class:"chart-wrapper doughnut-wrapper"},t("svg",{width:i+"px",height:i+"px",id:`graphic-${this.uid}`,class:"doughnut-svg"},t("defs",null,t("filter",{id:"wmHoverDropShadow"},t("feGaussianBlur",{stdDeviation:"3"}),t("feOffset",{result:"offsetblur"}),t("feFlood",{"flood-color":"#333"}),t("feComposite",{operator:"in",in2:"offsetblur"}),t("feMerge",null,t("feMergeNode",null),t("feMergeNode",{in:"SourceGraphic"})))),n.map((t=>E.call(this,t,s))),e?t("text",{class:"value",x:"50%",y:"50%","font-size":"1.5rem","font-weight":"500","text-anchor":"middle","dominant-baseline":"middle"},v(n[0].amount,this.total,!0)+"%"):t("g",{transform:`translate(${this.chartDetails.padding/2}, ${this.chartDetails.padding/2})`,"text-anchor":"middle","dominant-baseline":"middle"},n.map((t=>t.amount>0&&!t.inSmallCluster?G.call(this,t):"")))))}function E(s,i){return t("g",{transform:`translate(${this.chartDetails.padding/2}, ${this.chartDetails.padding/2})`},t("path",{id:s.id,class:"segment doughnut-segment",fill:s.amount?s.color:"transparent",d:j.call(this,s.amount,s.offset,i),onClick:t=>z.call(this,t,s),onFocus:t=>B.call(this,t,s),onKeyDown:t=>M.call(this,t),role:"img","aria-label":s.legend}))}function G(s){const i=w(s.offset+s.amount/2,this.total);let{x:e,y:n}=k(this.chartDetails.size/2,1.4,i-90);return t("text",{class:"value",x:e+"px",y:n+"px"},`${s.perc>0?s.perc:"<1"}%`)}function L(s){const i="bar1"===s||"bar"===s;return t("div",{class:"chart-wrapper bar-wrapper"},i?t("div",{class:"single-perc"},v(this.slicesDetails[0].amount,this.total,!0)+"%"):"","bar3"===this.chartType&&this.drawAxis(),t("div",{class:`inner-stacked-bar-wrapper ${p(this.tempValueFormat)}`},i?"":t("div",{class:"values"},this.slicesDetails.map(((t,s)=>this.renderBarText(t,s)))),t("div",{class:"stacked-bar-segments-wrapper"},this.slicesDetails.map(((t,s)=>N.call(this,t,s)))),i?O.call(this):""))}function N(s,i){const e=i!==this.slicesDetails.length-1,n=`calc(${v(s.amount,this.total,!1)}%${e?" - 2px":""})`;return t("div",{class:"segment stacked-bar-segment "+(0===v(s.amount,this.total,!1)?"zero":""),style:{backgroundColor:s.color,width:n},onClick:t=>z.call(this,t,s),onFocus:t=>B.call(this,t,s),onKeyDown:t=>M.call(this,t)},t("span",{class:"sr-only"},s.legend))}function R(s){const i=this.slicesDetails.map((t=>t.amount)).reduce(((t,s)=>t>s?t:s)),e=parseInt(getComputedStyle(this.el).getPropertyValue("--labelWidth"),10);let n=(a=this.el.getBoundingClientRect().width-e-48,Math.round(a/function(t){return function(t){let s=80*(t-300)/600+70;return s<70?70:s>150?150:s}(t)}(a)));var a;let o=$(i,n);const r=Math.floor((n*o-i)/o);n-=r,this.el.style.setProperty("--backgroundSize",100/n+"%"),this.el.style.setProperty("--labelWidth",this.labelWidth),"bar7"!==s||this.showBarLegend||this.el.style.setProperty("--labelWidth","0px");const h=[];this.slicesDetails.forEach((e=>{e.legend&&h.push(function(s,i,e){return t("label",{class:`label${"bar7"!==e||i?"":" hidden"}`},s)}(e.legend,this.showBarLegend,s)),h.push(U.call(this,e,o,n,i))}));const c=[];for(let s=1;s<=n;s++){const i=m(s*o);c.push(t("div",{class:"tick"},t("span",null,i)))}const d="bar6"===s&&this.showGrid&&this.el.getBoundingClientRect().width>300;return t("div",{class:"chart-wrapper simple-bar-wrapper"},t("div",{class:`chart ${p(this.tempValueFormat)}`},d&&t("div",{class:"gridlines"}),t("div",{class:"rows"},h)),d&&t("div",{class:"x-axis","aria-hidden":"true"},t("div",{class:"zero"},t("span",null,"0")),c))}function U(s,i,e,n){const a=v(s.amount,"bar6"===this.currentChartType?i*e:n,!1),o=a?a+"%":"1px",r=m(s.amount);let h="amount"===this.tempValueFormat?r:"";return"bar6"===this.currentChartType&&"percentage"===this.tempValueFormat?h=s.amount+"%":"bar7"===this.currentChartType&&"percentage"===this.tempValueFormat&&(h=(0===this.total?"0":v(s.amount,this.total,!0))+"%"),t("div",{class:"bar segment",style:{backgroundColor:s.color,width:o},onClick:t=>z.call(this,t,s),onFocus:t=>B.call(this,t,s),onKeyDown:t=>M.call(this,t)},t("div",{class:"value"},h))}function V(s){if(this.showLegend){const i=!this.chartDetails.isBar&&this.slicesDetails.reduce(((t,s)=>!!s.inSmallCluster||t),!1);return t("div",{class:"legend-wrapper"},t("div",{class:`legend ${s} ${"bar"===this.mode?"--top":"--bottom"}`,"aria-hidden":"true"},this.slicesDetails.map((t=>{if(t.amount||t.legend)return H({key:t.legend,color:t.color})}))),i&&q())}}function H(s){return t("div",{class:"legend-item"},t("div",{class:"legend-color",style:{backgroundColor:s.color}}),t("div",{class:"legend-text"},s.key))}function O(){if(this.completionMessage)return t("div",{class:"completion-message"},this.completionMessage)}function q(){return t("div",{class:"hidden-values-warning"},f,t("br",null),b)}export{g as a,v as b,L as c,W as d,I as e,V as f,K as g,C as h,O as i,q as j,T as k,H as l,m,$ as n,R as r}
@@ -1 +1 @@
1
- import{r as t,c as a,h as i,g as e}from"./p-b5bedd63.js";import{d as n}from"./p-ff888d78.js";const r=class{constructor(i){t(this,i),this.wmPaginationPageClicked=a(this,"wmPaginationPageClicked",7),this.pageClicked=a(this,"pageClicked",7),this.focusCurrentPage=a(this,"focusCurrentPage",7),this.totalPages=0,this.debouncedResize=n((()=>this.isLargeSize=this.el.clientWidth>500),100),this.getMiddlePageNums=()=>{let t;return t=this.currentPage<4?[2,3,4]:this.currentPage>this.totalPages-3?[this.totalPages-3,this.totalPages-2,this.totalPages-1]:[this.currentPage-1,this.currentPage,this.currentPage+1],t},this.currentPage=1,this.totalItems=void 0,this.itemsPerPage=void 0,this.value=1,this.isLargeSize=window.innerWidth>600,this.isTabbing=!1,this.srAnnouncement=""}toggleTabbingOn(){this.isTabbing=!0}toggleTabbingOff(){this.isTabbing=!1}maintainFocusOnNumberChange(t){window.requestAnimationFrame((()=>{switch(t){case"previous":1===this.currentPage&&this.el.shadowRoot.querySelector("button#wm-1").focus();break;case"next":this.currentPage===this.totalPages&&this.el.shadowRoot.querySelector(`button#wm-${this.totalPages}`).focus();break;case"prev-arrow":1===this.currentPage&&this.el.shadowRoot.querySelector("#next-arw").focus();break;case"next-arrow":this.currentPage===this.totalPages&&this.el.shadowRoot.querySelector("#previous-arw").focus();break;case"page":this.el.shadowRoot.querySelector(`button#wm-${this.currentPage}`).focus();default:return}}))}calculateTotalPages(){this.totalPages=Math.ceil(this.totalItems/this.itemsPerPage)}componentWillLoad(){if(!this.totalItems||!this.itemsPerPage||!this.currentPage)throw new Error("Please check the required attributes");this.calculateTotalPages(),document.body.classList.contains("wmcl-user-is-tabbing")&&this.toggleTabbingOn(),this.el.focus=()=>{this.isLargeSize?this.el.shadowRoot.getElementById(`wm-${this.currentPage}`).focus():1===this.currentPage?this.el.shadowRoot.getElementById("next-arw").focus():this.el.shadowRoot.getElementById("wm-1-arw").focus()},new ResizeObserver((()=>this.debouncedResize())).observe(this.el)}updatePageDisplayed(t){this.value=t,this.wmPaginationPageClicked.emit(),this.pageClicked.emit(),this.srAnnouncement=`Current page, ${this.currentPage}. ${this.getCurrentPagesInView()}`}displayShortPagination(){let t=[];for(let a=1;a<=this.totalPages;a++)t.push(this.displayPageNumber(a));return t}displayLongPagination(){return[this.displayPageNumber(1),this.currentPage>3&&this.displayEllipsis(),...this.getMiddlePageNums().map((t=>this.displayPageNumber(t))),this.currentPage+2<this.totalPages&&this.displayEllipsis(),this.displayPageNumber(this.totalPages)]}displayPageNumber(t){return i("button",{id:`wm-${t}`,class:"paginationbtn",onClick:()=>{this.currentPage=t,this.updatePageDisplayed(t),this.maintainFocusOnNumberChange("page")},value:t,"aria-label":this.currentPage!==t?`Go to page ${t}`:"","aria-current":this.currentPage===t?"page":void 0},t)}displayEllipsis(){return i("span",{class:"ellipsis"},"...")}getCurrentPagesInView(){let t=this.itemsPerPage*this.currentPage;const a=t-this.itemsPerPage+1;return t>this.totalItems&&(t=this.totalItems),"Viewing "+(a===t?`${a}`:`${a}–${t} of ${this.totalItems}`)}renderLarge(){return i("div",{class:"largescreen"},i("div",{class:"pageview"},this.getCurrentPagesInView()),i("div",{class:"pagebtncontainer "+(this.isTabbing?"user-is-tabbing":"")},i("button",{id:"previous",class:"paginationbtn previousbtn",onClick:()=>{this.currentPage=this.currentPage-1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("previous")},disabled:1===this.currentPage,"aria-label":"Go to previous page","aria-controls":"status"},"Previous"),this.totalPages<6?this.displayShortPagination():this.displayLongPagination(),i("button",{id:"next",class:"paginationbtn nextbtn",onClick:()=>{this.currentPage=this.currentPage+1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("next")},disabled:this.currentPage===this.totalPages,"aria-label":"Go to next page","aria-controls":"status"},"Next")))}renderSmall(){return i("div",{class:"smallscreen"},i("div",{class:"pagebtncontainer "+(this.isTabbing?"user-is-tabbing":"")},i("button",{id:"wm-1-arw",class:"paginationbtn",onClick:()=>{this.currentPage=1,this.updatePageDisplayed(1),this.maintainFocusOnNumberChange("prev-arrow")},value:1,"aria-current":1===this.currentPage?"page":void 0,"aria-label":"Go to page 1","aria-controls":"status",disabled:1===this.currentPage},i("svg",{width:"16",height:"12",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M7.41 10.59L2.83 6l4.58-4.59L6 0 0 6l6 6zM15.41 10.59L10.83 6l4.58-4.59L14 0 8 6l6 6z"}))),i("button",{id:"previous-arw",class:"paginationbtn previousbtn",onClick:()=>{this.currentPage-=1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("prev-arrow")},disabled:1===this.currentPage,"aria-label":"Go to previous page"},i("svg",{width:"8",height:"12",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M7.41 10.59L2.83 6l4.58-4.59L6 0 0 6l6 6z"}))),"Page ",this.currentPage," of ",this.totalPages,i("button",{id:"next-arw",class:"paginationbtn nextbtn",onClick:()=>{this.currentPage+=1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("next-arrow")},disabled:this.currentPage===this.totalPages,"aria-label":"Go to next page"},i("svg",{width:"8",height:"12",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M.59 10.59L5.17 6 .59 1.41 2 0l6 6-6 6z"}))),i("button",{id:`wm-${this.totalPages}-arw`,class:"paginationbtn",onClick:()=>{this.currentPage=this.totalPages,this.updatePageDisplayed(this.totalPages),this.maintainFocusOnNumberChange("next-arrow")},value:this.totalPages,"aria-current":this.currentPage===this.totalPages?"page":void 0,"aria-label":`Go to last page, page ${this.totalPages}`,"aria-controls":"status",disabled:this.currentPage===this.totalPages},i("svg",{width:"17",height:"12",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M.59 10.59L5.17 6 .59 1.41 2 0l6 6-6 6zM9.59 10.59L14.17 6 9.59 1.41 11 0l6 6-6 6z"})))))}render(){return this.totalItems>this.itemsPerPage&&i("nav",{"aria-label":`Pagination Navigation. ${this.getCurrentPagesInView()}. Current page, ${this.currentPage}.`},this.isLargeSize?this.renderLarge():this.renderSmall(),i("div",{id:"status",class:"sr-only","aria-live":"polite","aria-relevant":"text","aria-atomic":"true"},this.srAnnouncement))}static get delegatesFocus(){return!0}get el(){return e(this)}static get watchers(){return{totalItems:["calculateTotalPages"],itemsPerPage:["calculateTotalPages"]}}};r.style=':host,wm-pagination{--wmcolor-pagination-arrow-disabled:var(--wmcolor-interactive-disabled);--wmcolor-pagination-arrow:var(--wmcolor-interactive);--wmcolor-pagination-arrow:var(--wmcolor-interactive);--wmcolor-pagination-button-text-disabled:var(--wmcolor-interactive-disabled);--wmcolor-pagination-button-text:var(--wmcolor-interactive);--wmcolor-pagination-current-background-hover:var(--wmcolor-interactive-hover);--wmcolor-pagination-current-background:var(--wmcolor-interactive);--wmcolor-pagination-current-text:var(--wmcolor-interactive-text);--wmcolor-pagination-focus:var(--wmcolor-interactive-focus-textonly);display:block}nav .largescreen,nav .smallscreen{margin-bottom:0.625rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:flex-end;-ms-flex-pack:flex-end;-webkit-justify-content:flex-end;justify-content:flex-end;font-size:0.875rem}nav .largescreen .pageview,nav .smallscreen .pageview{font-size:0.875rem;margin:0 0.625rem}nav .largescreen .paginationbtn,nav .smallscreen .paginationbtn{position:relative;-ms-transition:none;-webkit-transition:none;-moz-transition:none;transition:none;border:none;color:var(--wmcolor-pagination-button-text);background-color:transparent;margin:0;padding:0;height:2.5rem;width:2.5rem;font-family:inherit;letter-spacing:0.3px;font-size:0.875rem;font-weight:500;cursor:pointer;text-transform:none}nav .largescreen .paginationbtn svg *,nav .smallscreen .paginationbtn svg *{fill:var(--wmcolor-pagination-arrow)}nav .largescreen .paginationbtn:hover:not([aria-current=page]):not([disabled]),nav .smallscreen .paginationbtn:hover:not([aria-current=page]):not([disabled]){text-decoration:underline}nav .largescreen .paginationbtn:focus,nav .smallscreen .paginationbtn:focus{outline:none}nav .largescreen .paginationbtn::-moz-focus-inner,nav .smallscreen .paginationbtn::-moz-focus-inner{border:0;outline:none}nav .largescreen .paginationbtn[disabled],nav .smallscreen .paginationbtn[disabled]{color:var(--wmcolor-pagination-button-text-disabled);pointer-events:none}nav .largescreen .paginationbtn[disabled] svg *,nav .smallscreen .paginationbtn[disabled] svg *{fill:var(--wmcolor-pagination-arrow-disabled)}nav .largescreen .previousbtn,nav .smallscreen .previousbtn{margin-right:0.625rem;width:auto !important}nav .largescreen .nextbtn,nav .smallscreen .nextbtn{margin-left:0.625rem;margin-right:0;width:auto !important}nav .largescreen .previousbtn,nav .largescreen .nextbtn,nav .smallscreen .previousbtn,nav .smallscreen .nextbtn{-ms-transition:none;-webkit-transition:none;-moz-transition:none;transition:none}nav .largescreen .ellipsis,nav .smallscreen .ellipsis{display:inline-block;width:2.5rem;text-align:center}nav .largescreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]):before,nav .smallscreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]):before{position:absolute;content:"";height:auto;width:16px;top:0;bottom:0;left:12px;right:0;background:-webkit-gradient(linear, left top, right top, color-stop(66%, var(--wmcolor-pagination-focus)), color-stop(0, transparent)) repeat-x;background:linear-gradient(90deg, var(--wmcolor-pagination-focus) 66%, transparent 0) repeat-x;background-size:6px 2px;background-position:0 2em;border-radius:0;line-height:normal}nav .largescreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).previousbtn:focus:before,nav .smallscreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).previousbtn:focus:before{left:0 !important}nav .largescreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).nextbtn:focus:before,nav .smallscreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).nextbtn:focus:before{left:0 !important}nav .largescreen .pagebtncontainer.user-is-tabbing [aria-current=page]:focus,nav .smallscreen .pagebtncontainer.user-is-tabbing [aria-current=page]:focus{-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus)}nav .largescreen .pagebtncontainer.user-is-tabbing [aria-current=page]:focus::-moz-focus-inner,nav .smallscreen .pagebtncontainer.user-is-tabbing [aria-current=page]:focus::-moz-focus-inner{border:0}nav .largescreen .user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).previousbtn:focus:before{width:56px !important}nav .largescreen .user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).nextbtn:focus:before{width:32px !important}nav .largescreen .paginationbtn[aria-current=page]{-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%;-webkit-box-shadow:0 0 4px 0 rgba(0, 0, 0, 0.14), 0 3px 4px 0 rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);box-shadow:0 0 4px 0 rgba(0, 0, 0, 0.14), 0 3px 4px 0 rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);background:var(--wmcolor-pagination-current-background);color:var(--wmcolor-pagination-current-text)}nav .largescreen .paginationbtn[aria-current=page]:hover{background:var(--wmcolor-pagination-current-background-hover)}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';export{r as wm_pagination}
1
+ import{r as t,c as a,h as i,g as e}from"./p-b5bedd63.js";import{d as n}from"./p-f0d87250.js";const r=class{constructor(i){t(this,i),this.wmPaginationPageClicked=a(this,"wmPaginationPageClicked",7),this.pageClicked=a(this,"pageClicked",7),this.focusCurrentPage=a(this,"focusCurrentPage",7),this.totalPages=0,this.debouncedResize=n((()=>this.isLargeSize=this.el.clientWidth>500),100),this.getMiddlePageNums=()=>{let t;return t=this.currentPage<4?[2,3,4]:this.currentPage>this.totalPages-3?[this.totalPages-3,this.totalPages-2,this.totalPages-1]:[this.currentPage-1,this.currentPage,this.currentPage+1],t},this.currentPage=1,this.totalItems=void 0,this.itemsPerPage=void 0,this.value=1,this.isLargeSize=window.innerWidth>600,this.isTabbing=!1,this.srAnnouncement=""}toggleTabbingOn(){this.isTabbing=!0}toggleTabbingOff(){this.isTabbing=!1}maintainFocusOnNumberChange(t){window.requestAnimationFrame((()=>{switch(t){case"previous":1===this.currentPage&&this.el.shadowRoot.querySelector("button#wm-1").focus();break;case"next":this.currentPage===this.totalPages&&this.el.shadowRoot.querySelector(`button#wm-${this.totalPages}`).focus();break;case"prev-arrow":1===this.currentPage&&this.el.shadowRoot.querySelector("#next-arw").focus();break;case"next-arrow":this.currentPage===this.totalPages&&this.el.shadowRoot.querySelector("#previous-arw").focus();break;case"page":this.el.shadowRoot.querySelector(`button#wm-${this.currentPage}`).focus();default:return}}))}calculateTotalPages(){this.totalPages=Math.ceil(this.totalItems/this.itemsPerPage)}componentWillLoad(){if(!this.totalItems||!this.itemsPerPage||!this.currentPage)throw new Error("Please check the required attributes");this.calculateTotalPages(),document.body.classList.contains("wmcl-user-is-tabbing")&&this.toggleTabbingOn(),this.el.focus=()=>{this.isLargeSize?this.el.shadowRoot.getElementById(`wm-${this.currentPage}`).focus():1===this.currentPage?this.el.shadowRoot.getElementById("next-arw").focus():this.el.shadowRoot.getElementById("wm-1-arw").focus()},new ResizeObserver((()=>this.debouncedResize())).observe(this.el)}updatePageDisplayed(t){this.value=t,this.wmPaginationPageClicked.emit(),this.pageClicked.emit(),this.srAnnouncement=`Current page, ${this.currentPage}. ${this.getCurrentPagesInView()}`}displayShortPagination(){let t=[];for(let a=1;a<=this.totalPages;a++)t.push(this.displayPageNumber(a));return t}displayLongPagination(){return[this.displayPageNumber(1),this.currentPage>3&&this.displayEllipsis(),...this.getMiddlePageNums().map((t=>this.displayPageNumber(t))),this.currentPage+2<this.totalPages&&this.displayEllipsis(),this.displayPageNumber(this.totalPages)]}displayPageNumber(t){return i("button",{id:`wm-${t}`,class:"paginationbtn",onClick:()=>{this.currentPage=t,this.updatePageDisplayed(t),this.maintainFocusOnNumberChange("page")},value:t,"aria-label":this.currentPage!==t?`Go to page ${t}`:"","aria-current":this.currentPage===t?"page":void 0},t)}displayEllipsis(){return i("span",{class:"ellipsis"},"...")}getCurrentPagesInView(){let t=this.itemsPerPage*this.currentPage;const a=t-this.itemsPerPage+1;return t>this.totalItems&&(t=this.totalItems),"Viewing "+(a===t?`${a}`:`${a}–${t} of ${this.totalItems}`)}renderLarge(){return i("div",{class:"largescreen"},i("div",{class:"pageview"},this.getCurrentPagesInView()),i("div",{class:"pagebtncontainer "+(this.isTabbing?"user-is-tabbing":"")},i("button",{id:"previous",class:"paginationbtn previousbtn",onClick:()=>{this.currentPage=this.currentPage-1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("previous")},disabled:1===this.currentPage,"aria-label":"Go to previous page","aria-controls":"status"},"Previous"),this.totalPages<6?this.displayShortPagination():this.displayLongPagination(),i("button",{id:"next",class:"paginationbtn nextbtn",onClick:()=>{this.currentPage=this.currentPage+1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("next")},disabled:this.currentPage===this.totalPages,"aria-label":"Go to next page","aria-controls":"status"},"Next")))}renderSmall(){return i("div",{class:"smallscreen"},i("div",{class:"pagebtncontainer "+(this.isTabbing?"user-is-tabbing":"")},i("button",{id:"wm-1-arw",class:"paginationbtn",onClick:()=>{this.currentPage=1,this.updatePageDisplayed(1),this.maintainFocusOnNumberChange("prev-arrow")},value:1,"aria-current":1===this.currentPage?"page":void 0,"aria-label":"Go to page 1","aria-controls":"status",disabled:1===this.currentPage},i("svg",{width:"16",height:"12",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M7.41 10.59L2.83 6l4.58-4.59L6 0 0 6l6 6zM15.41 10.59L10.83 6l4.58-4.59L14 0 8 6l6 6z"}))),i("button",{id:"previous-arw",class:"paginationbtn previousbtn",onClick:()=>{this.currentPage-=1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("prev-arrow")},disabled:1===this.currentPage,"aria-label":"Go to previous page"},i("svg",{width:"8",height:"12",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M7.41 10.59L2.83 6l4.58-4.59L6 0 0 6l6 6z"}))),"Page ",this.currentPage," of ",this.totalPages,i("button",{id:"next-arw",class:"paginationbtn nextbtn",onClick:()=>{this.currentPage+=1,this.updatePageDisplayed(this.currentPage),this.maintainFocusOnNumberChange("next-arrow")},disabled:this.currentPage===this.totalPages,"aria-label":"Go to next page"},i("svg",{width:"8",height:"12",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M.59 10.59L5.17 6 .59 1.41 2 0l6 6-6 6z"}))),i("button",{id:`wm-${this.totalPages}-arw`,class:"paginationbtn",onClick:()=>{this.currentPage=this.totalPages,this.updatePageDisplayed(this.totalPages),this.maintainFocusOnNumberChange("next-arrow")},value:this.totalPages,"aria-current":this.currentPage===this.totalPages?"page":void 0,"aria-label":`Go to last page, page ${this.totalPages}`,"aria-controls":"status",disabled:this.currentPage===this.totalPages},i("svg",{width:"17",height:"12",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M.59 10.59L5.17 6 .59 1.41 2 0l6 6-6 6zM9.59 10.59L14.17 6 9.59 1.41 11 0l6 6-6 6z"})))))}render(){return this.totalItems>this.itemsPerPage&&i("nav",{"aria-label":`Pagination Navigation. ${this.getCurrentPagesInView()}. Current page, ${this.currentPage}.`},this.isLargeSize?this.renderLarge():this.renderSmall(),i("div",{id:"status",class:"sr-only","aria-live":"polite","aria-relevant":"text","aria-atomic":"true"},this.srAnnouncement))}static get delegatesFocus(){return!0}get el(){return e(this)}static get watchers(){return{totalItems:["calculateTotalPages"],itemsPerPage:["calculateTotalPages"]}}};r.style=':host,wm-pagination{--wmcolor-pagination-arrow-disabled:var(--wmcolor-interactive-disabled);--wmcolor-pagination-arrow:var(--wmcolor-interactive);--wmcolor-pagination-arrow:var(--wmcolor-interactive);--wmcolor-pagination-button-text-disabled:var(--wmcolor-interactive-disabled);--wmcolor-pagination-button-text:var(--wmcolor-interactive);--wmcolor-pagination-current-background-hover:var(--wmcolor-interactive-hover);--wmcolor-pagination-current-background:var(--wmcolor-interactive);--wmcolor-pagination-current-text:var(--wmcolor-interactive-text);--wmcolor-pagination-focus:var(--wmcolor-interactive-focus-textonly);display:block}nav .largescreen,nav .smallscreen{margin-bottom:0.625rem;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:flex-end;-ms-flex-pack:flex-end;-webkit-justify-content:flex-end;justify-content:flex-end;font-size:0.875rem}nav .largescreen .pageview,nav .smallscreen .pageview{font-size:0.875rem;margin:0 0.625rem}nav .largescreen .paginationbtn,nav .smallscreen .paginationbtn{position:relative;-ms-transition:none;-webkit-transition:none;-moz-transition:none;transition:none;border:none;color:var(--wmcolor-pagination-button-text);background-color:transparent;margin:0;padding:0;height:2.5rem;width:2.5rem;font-family:inherit;letter-spacing:0.3px;font-size:0.875rem;font-weight:500;cursor:pointer;text-transform:none}nav .largescreen .paginationbtn svg *,nav .smallscreen .paginationbtn svg *{fill:var(--wmcolor-pagination-arrow)}nav .largescreen .paginationbtn:hover:not([aria-current=page]):not([disabled]),nav .smallscreen .paginationbtn:hover:not([aria-current=page]):not([disabled]){text-decoration:underline}nav .largescreen .paginationbtn:focus,nav .smallscreen .paginationbtn:focus{outline:none}nav .largescreen .paginationbtn::-moz-focus-inner,nav .smallscreen .paginationbtn::-moz-focus-inner{border:0;outline:none}nav .largescreen .paginationbtn[disabled],nav .smallscreen .paginationbtn[disabled]{color:var(--wmcolor-pagination-button-text-disabled);pointer-events:none}nav .largescreen .paginationbtn[disabled] svg *,nav .smallscreen .paginationbtn[disabled] svg *{fill:var(--wmcolor-pagination-arrow-disabled)}nav .largescreen .previousbtn,nav .smallscreen .previousbtn{margin-right:0.625rem;width:auto !important}nav .largescreen .nextbtn,nav .smallscreen .nextbtn{margin-left:0.625rem;margin-right:0;width:auto !important}nav .largescreen .previousbtn,nav .largescreen .nextbtn,nav .smallscreen .previousbtn,nav .smallscreen .nextbtn{-ms-transition:none;-webkit-transition:none;-moz-transition:none;transition:none}nav .largescreen .ellipsis,nav .smallscreen .ellipsis{display:inline-block;width:2.5rem;text-align:center}nav .largescreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]):before,nav .smallscreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]):before{position:absolute;content:"";height:auto;width:16px;top:0;bottom:0;left:12px;right:0;background:-webkit-gradient(linear, left top, right top, color-stop(66%, var(--wmcolor-pagination-focus)), color-stop(0, transparent)) repeat-x;background:linear-gradient(90deg, var(--wmcolor-pagination-focus) 66%, transparent 0) repeat-x;background-size:6px 2px;background-position:0 2em;border-radius:0;line-height:normal}nav .largescreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).previousbtn:focus:before,nav .smallscreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).previousbtn:focus:before{left:0 !important}nav .largescreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).nextbtn:focus:before,nav .smallscreen .pagebtncontainer.user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).nextbtn:focus:before{left:0 !important}nav .largescreen .pagebtncontainer.user-is-tabbing [aria-current=page]:focus,nav .smallscreen .pagebtncontainer.user-is-tabbing [aria-current=page]:focus{-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus)}nav .largescreen .pagebtncontainer.user-is-tabbing [aria-current=page]:focus::-moz-focus-inner,nav .smallscreen .pagebtncontainer.user-is-tabbing [aria-current=page]:focus::-moz-focus-inner{border:0}nav .largescreen .user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).previousbtn:focus:before{width:56px !important}nav .largescreen .user-is-tabbing :focus:not(.-disabled):not([aria-current=page]).nextbtn:focus:before{width:32px !important}nav .largescreen .paginationbtn[aria-current=page]{-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%;-webkit-box-shadow:0 0 4px 0 rgba(0, 0, 0, 0.14), 0 3px 4px 0 rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);box-shadow:0 0 4px 0 rgba(0, 0, 0, 0.14), 0 3px 4px 0 rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);background:var(--wmcolor-pagination-current-background);color:var(--wmcolor-pagination-current-text)}nav .largescreen .paginationbtn[aria-current=page]:hover{background:var(--wmcolor-pagination-current-background-hover)}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';export{r as wm_pagination}
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,i,n){function r(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,o){function a(t){try{l(n.next(t))}catch(t){o(t)}}function s(t){try{l(n["throw"](t))}catch(t){o(t)}}function l(t){t.done?i(t.value):r(t.value).then(a,s)}l((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,r,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return l([t,e])}}function l(s){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(i=0)),i)try{if(n=1,r&&(o=s[0]&2?r["return"]:s[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;if(r=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;r=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(s[0]===6&&i.label<o[1]){i.label=o[1];o=s;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(s);break}if(o[2])i.ops.pop();i.trys.pop();continue}s=e.call(t,i)}catch(t){s=[6,t];r=0}finally{n=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-30bf24f8.system.js","./p-5e55eb56.system.js","./p-ba31d982.system.js","./p-27efb4d0.system.js"],(function(t){"use strict";var e,i,n,r,o,a,s,l,c,h,p,d,u,v,f,g;return{setters:[function(t){e=t.r;i=t.f;n=t.h;r=t.H;o=t.g},function(t){a=t.d;s=t.A;l=t.u;c=t.B;h=t.C;p=t.D},function(t){d=t.m;u=t.n},function(t){v=t.l;f=t.c;g=t.g}],execute:function(){var x=':host{--wmcolor-linechart-currentposition:var(--wmcolor-lavender);--wmcolor-linechart-delta-text-negative:var(--wmcolor-text-negative);--wmcolor-linechart-delta-text-positive:var(--wmcolor-text-positive);--wmcolor-linechart-gridline:var(--wmcolor-chart-gridline);--wmcolor-linechart-highlight-background:var(--wmcolor-background-highlight);--wmcolor-linechart-popover-background:var(--wmcolor-chart-popover-background);display:block;height:500px;width:100%;font-size:14px;overflow-y:visible;overflow-x:auto}:host .component-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:562px;width:100%;height:100%;outline:none}:host .icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;position:relative;color:var(--iconColor);-webkit-transform:var(--translation, unset);transform:var(--translation, unset)}:host .icon:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:var(--icon);padding:0 3px;z-index:1}:host .icon:after{color:white;position:absolute;left:3px;-webkit-transform:scale(180%);transform:scale(180%);display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:var(--icon);z-index:0}:host .legend{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:8px 16px;margin-top:4px;margin-bottom:16px}:host .legend .legend-label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;cursor:default;font-weight:600}:host .legend .legend-label.faded{opacity:0.3}:host .legend .legend-label .icon{margin-right:4px}:host .legend .visibility-toggle{margin-left:4px}:host .chart-wrapper{position:relative;-ms-flex-positive:1;flex-grow:1;display:grid;grid-template-columns:auto auto 1fr;grid-template-rows:1fr auto auto;margin-right:16px}:host .chart-label{font-size:14px;font-weight:600}:host .chart-label.--y-axis{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:var(--labelWidth);align-self:center;margin-right:16px;grid-area:1/1/2/2;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}:host .chart-label.--x-axis{margin-top:16px;text-align:center;grid-area:3/3/4/4}:host .y-intervals{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;grid-area:1/2/2/3;margin-right:4px}:host .y-intervals .y-interval{text-align:right}:host .x-intervals{display:grid;grid-template-columns:var(--columns);grid-area:2/3/3/4;line-height:1;margin-top:4px}:host .x-intervals .x-interval{text-align:center}:host .x-intervals .x-interval:first-child{text-align:left}:host .x-intervals .x-interval:last-child{text-align:right}:host .x-intervals .x-interval.hidden{visibility:hidden}:host .plot-area{position:relative;grid-area:1/3/2/4;background-image:linear-gradient(90deg, var(--wmcolor-linechart-gridline) 1px, transparent 1px);border-bottom:1px solid var(--wmcolor-linechart-gridline);background-size:var(--backgroundSize)}:host .plot-area.right-border{border-right:1px solid var(--wmcolor-linechart-gridline)}:host .line{position:absolute;width:100%;height:100%}:host .line .icon{position:absolute;-webkit-transform:var(--translation);transform:var(--translation);left:var(--xPosition);top:var(--yPosition);z-index:1}:host .line .icon:focus{z-index:2;outline:none}:host .line .icon:focus:before{-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);border-radius:3px}:host .line .icon:focus:before::-moz-focus-inner{border:0}:host .line .line-svg{height:100%;width:100%}:host .line.faded{opacity:0.3}:host .line.focused{z-index:1}:host .line.hidden{visibility:hidden}:host .hover-area-wrapper{position:absolute;width:100%;height:100%;top:0;left:0;display:grid;grid-template-rows:1fr;grid-template-columns:var(--columns)}:host .hover-indicator{-webkit-box-sizing:border-box;box-sizing:border-box;position:absolute;height:100%;width:2px;border:1px solid var(--wmcolor-linechart-currentposition);-webkit-transform:translateX(-50%);transform:translateX(-50%);left:var(--xPosition);grid-column:3/4;grid-row:1/2;pointer-events:none}:host .popover{width:-webkit-max-content;width:-moz-max-content;width:max-content;max-width:400px;background-color:var(--wmcolor-linechart-popover-background);position:absolute;top:var(--topPosition, 0);left:var(--leftPosition, unset);right:var(--rightPosition, unset);padding:16px;border-radius:5px;-webkit-box-shadow:0px 2px 10px 0px rgba(0, 0, 0, 0.09);box-shadow:0px 2px 10px 0px rgba(0, 0, 0, 0.09);-webkit-transform:translateY(-50%);transform:translateY(-50%);line-height:1;z-index:3;grid-column:3/4;grid-row:1/2;pointer-events:none;-webkit-box-sizing:border-box;box-sizing:border-box}:host .popover .title{font-size:16px;font-weight:600}:host .popover .comparison-title{font-style:italic;margin-top:4px}:host .popover .unit{font-size:12px;font-weight:600}:host .popover .unit.--x{margin-left:4px}:host .popover .popover-table{margin-top:16px}:host .popover .popover-table .popover-row{line-height:1}:host .popover .popover-table .popover-row:not(:last-child) td{padding-bottom:8px}:host .popover .popover-table .popover-row .row-label{font-weight:600;padding-right:16px;overflow-wrap:anywhere}:host .popover .popover-table .popover-row .row-label .icon{margin-right:4px}:host .popover .popover-table .popover-row .row-value,:host .popover .popover-table .popover-row .delta{text-align:right;white-space:nowrap}:host .popover .popover-table .popover-row .delta{padding-left:12px;font-weight:600}:host .popover .popover-table .popover-row .delta.--positive{color:var(--wmcolor-linechart-delta-text-positive)}:host .popover .popover-table .popover-row .delta.--negative{color:var(--wmcolor-linechart-delta-text-negative)}:host .highlight{position:absolute;height:100%;background-color:color-mix(in srgb, var(--wmcolor-linechart-highlight-background) 60%, transparent);left:var(--startPercentage);right:var(--endPercentage)}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';var b=t("wm_line_chart",function(){function t(t){var i=this;e(this,t);this.minTickWidth=120;this.popoverData=[];this.focusedDataPoint=[0,0];this.dataPointMatrix=[];this.xIntervals=[];this.displayedXIntervals=[];this.yIntervals=[];this.lineStyles=[{color:"#8b86ca",icon:"f536"},{color:"#2e1b46",icon:"f12f"},{color:"#0089e4",icon:"f763"},{color:"#088000",icon:"f4ce"},{color:"#ea8500",icon:"f70a"},{color:"#d54f41",icon:"f536"},{color:"#146ca9",icon:"f6ff"}];this.debouncedResize=a((function(){return __awaiter(i,void 0,void 0,(function(){return __generator(this,(function(t){this.displayedXIntervals=this.determineDisplayedXIntervals();return[2]}))}))}),100);this.label=undefined;this.description="";this.xAxisLabel=undefined;this.yAxisLabel=undefined;this.lineData=undefined;this.units="null,null";this.labelWidth="120px";this.highlightQualifier="highlighted";this.highlightStart=undefined;this.highlightEnd=undefined;this.visibilityToggles=false;this.showDeltas=false;this.yRange=undefined;this.parsedLineData={};this.displayedPopover=-1;this.focusedLine=-1;this.hiddenLines=[];this.isTabbing=false;this.intervalSkip=0;this.announcement=""}t.prototype.parseData=function(){var t=this;this.parsedLineData=JSON.parse(this.lineData);this.yIntervals=this.calcYIntervals().reverse();this.xIntervals=Object.keys(Object.values(this.parsedLineData)[0]);this.displayedXIntervals=this.determineDisplayedXIntervals();this.dataPointMatrix=Object.entries(this.parsedLineData).map((function(e){return t.buildLineDataPointDetails(e[0],e[1])}));this.popoverData=s(this.dataPointMatrix)};t.prototype.handleIntervalSkip=function(){this.parseData()};Object.defineProperty(t.prototype,"hasPartialInterval",{get:function(){return this.intervalSkip>0&&this.xIntervals.length%2===0},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"parsedUnits",{get:function(){return l(this.units).map((function(t){return t==="null"?null:t}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"visibilityToggleEls",{get:function(){return this.legendEl.querySelectorAll("wm-button")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"lineEls",{get:function(){return this.plotAreaEl.querySelectorAll(".line")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"firstVisibleLineIdx",{get:function(){var t=0;while(this.hiddenLines.includes(t)){t++}return t<this.dataPointMatrix.length?t:-1},enumerable:false,configurable:true});t.prototype.toggleTabbingOn=function(){this.isTabbing=true};t.prototype.toggleTabbingOff=function(){this.isTabbing=false};t.prototype.componentWillLoad=function(){this.parseData()};t.prototype.componentDidLoad=function(){var t=this;var e=new ResizeObserver((function(){return t.debouncedResize()}));e.observe(this.el)};t.prototype.handleVisibilityToggleKeydown=function(t,e){switch(t.key){case"Tab":if(!t.shiftKey&&this.firstVisibleLineIdx!==-1){t.preventDefault();this.announce(this.lineFocusMessage(this.firstVisibleLineIdx));this.focusDataPoint(this.firstVisibleLineIdx,0)}break;case"ArrowUp":case"ArrowLeft":t.preventDefault();var i=c(e,-1,this.dataPointMatrix.length-1);this.visibilityToggleEls[i].focus();break;case"ArrowDown":case"ArrowRight":t.preventDefault();var n=c(e,1,this.dataPointMatrix.length-1);this.visibilityToggleEls[n].focus();break}};t.prototype.handleDataPointKeydown=function(t){var e=this.focusedDataPoint,i=e[0],n=e[1];var r=this.lineEls[i].querySelectorAll(".point").length;var o=this.dataPointMatrix.length;switch(t.key){case"Tab":if(t.shiftKey&&this.visibilityToggles){t.preventDefault();this.visibilityToggleEls[0].focus()}break;case"ArrowUp":t.preventDefault();var a=i;do{a=c(a,-1,o-1)}while(this.hiddenLines.includes(a));this.announce(this.lineFocusMessage(a));this.focusDataPoint(a,n);break;case"ArrowDown":t.preventDefault();var s=i;do{s=c(s,1,o-1)}while(this.hiddenLines.includes(s));this.announce(this.lineFocusMessage(s));this.focusDataPoint(s,n);break;case"ArrowLeft":t.preventDefault();var l=c(n,-1,r-1);this.focusDataPoint(i,l);break;case"ArrowRight":t.preventDefault();var h=c(n,1,r-1);this.focusDataPoint(i,h);break}};t.prototype.announce=function(t){if(this.liveRegionEl.textContent===t){t+=" "}this.announcement=t};t.prototype.lineFocusMessage=function(t){var e=this.dataPointMatrix[t][0].lineLabel;var i=this.dataPointMatrix[t].filter((function(t){return t.yValue!==null})).length;return"".concat(e,", line ").concat(t+1," of ").concat(this.dataPointMatrix.length," with ").concat(i," data points")};t.prototype.focusDataPoint=function(t,e){var i=this.lineEls[t];var n=i.querySelectorAll(".point")[e];var r=this.plotAreaEl.querySelectorAll(".point");r.forEach((function(t){return t.tabIndex=-1}));n.tabIndex=0;n.focus();this.focusedDataPoint=[t,e]};t.prototype.focusDataPointByEl=function(t){var e=parseInt(t.dataset.lineidx);var i=Array.from(t.parentElement.querySelectorAll(".point")).indexOf(t);var n=this.plotAreaEl.querySelectorAll(".point");n.forEach((function(t){return t.tabIndex=-1}));t.tabIndex=0;t.focus();this.focusedDataPoint=[e,i]};t.prototype.calcYIntervals=function(){var t=[];if(this.yRange){t=l(this.yRange).map((function(t){return parseInt(t)}))}else{var e=[];var i=Object.values(this.parsedLineData).flat();i.forEach((function(t){return e.push.apply(e,Object.values(t))}));var n=e.filter((function(t){return t!==null}));var r=Math.min.apply(Math,n);var o=Math.max.apply(Math,n);var a=u(o-r,4);var s=a;while(r%a!==0&&s>0){r--;s--}a=u(o-r,4);var c=r;while(c<=o+a){t.push(c);c+=a}}return t};t.prototype.determineDisplayedXIntervals=function(){var t=this.plotAreaEl&&this.plotAreaEl.clientWidth>0?Math.round(this.plotAreaEl.clientWidth/this.minTickWidth):this.xIntervals.length;var e=h(this.xIntervals,t),i=e.skipInterval,n=e.skippedList;this.intervalSkip=i;return n};t.prototype.buildLineDataPointDetails=function(t,e){var i=this;var n=[];var r=Object.entries(e);var o;r.forEach((function(e,a){var s=e[0],l=e[1];var c=100/(r.length-1)*a;var h=l===null?null:100-p(l,i.yIntervals[i.yIntervals.length-1],i.yIntervals[0]);if(a===0){c+=i.plotAreaEl&&i.plotAreaEl.clientWidth>0?8/i.plotAreaEl.clientWidth*100:1}if(s===i.highlightStart&&!o){o=true}n.push({lineLabel:t,xValue:s,yValue:l,xPositionPercent:c,yPositionPercent:h,highlighted:o});if(s===i.highlightEnd&&o){o=false}}));return n};t.prototype.toggleLineVisibility=function(t){if(this.hiddenLines.includes(t)){this.hiddenLines=this.hiddenLines.filter((function(e){return e!==t}))}else{this.hiddenLines.push(t)}i(this.el)};t.prototype.resetDataPointFocus=function(){this.displayedPopover=-1;var t=this.plotAreaEl.querySelectorAll(".point");t.forEach((function(t){return t.tabIndex=-1}));if(this.firstVisibleLineIdx!==-1){var e=this.lineEls[this.firstVisibleLineIdx];var i=e.querySelectorAll(".point")[0];i.tabIndex=0;this.focusedDataPoint=[this.firstVisibleLineIdx,0]}};t.prototype.calcDelta=function(t,e){var i;if(t.yValue===null||e.yValue===null){i=v.noData}else if(t.yValue==e.yValue){i="0%"}else if(e.yValue==0){i="-"}else{var n=(t.yValue-e.yValue)/e.yValue*100;var r=Math.round(n*100)/100;i="".concat(r>0?"+":"").concat(r,"%")}return i};t.prototype.renderLegend=function(){var t=this;var e=Object.keys(this.parsedLineData);return n("div",{ref:function(e){return t.legendEl=e},class:"legend"},e.map((function(e,i){var r=t.hiddenLines.includes(i);var o=t.focusedLine!==-1&&t.focusedLine!==i;return n("div",{id:"legend-label-".concat(i),class:"legend-label ".concat(o?"faded":""),onMouseEnter:function(){return t.focusedLine=r?-1:i},onMouseLeave:function(){return t.focusedLine=-1}},t.renderIcon(i),e,t.visibilityToggles&&t.renderVisibilityToggle(e,i,r))})))};t.prototype.renderVisibilityToggle=function(t,e,i){var r=this;return n("wm-button",{id:"visibility-button-".concat(e),class:"visibility-toggle","label-for-identical-buttons":"".concat(e===0?"Toggle line visibility list with ".concat(this.dataPointMatrix.length," items"):""," ").concat(i?g.show:g.hide," ").concat(t," toggle ").concat(i?"pressed":""),"button-type":"navigational",tooltip:i?g.show:g.hide,tooltipPosition:"bottom",icon:i?"f209":"f208",onClick:function(){return r.toggleLineVisibility(e)},onKeyDown:function(t){return r.handleVisibilityToggleKeydown(t,e)},onFocus:function(){return r.displayedPopover=-1}})};t.prototype.renderIcon=function(t){var e=this.lineStyles[t],i=e.color,r=e.icon;var o={"--iconColor":i,"--icon":'"\\'.concat(r,'"'),"--translation":t===5?"rotate(180deg)":"unset"};return n("span",{class:"icon",style:o})};t.prototype.renderXIntervals=function(){var t=this;var e={"--columns":".5fr repeat(".concat(this.xIntervals.length-2,", 1fr) .5fr")};return n("div",{class:"x-intervals",style:e},this.xIntervals.map((function(e){return n("span",{class:"x-interval ".concat(t.displayedXIntervals.includes(e)?"":"hidden")},e)})))};t.prototype.renderYIntervals=function(){var t=this;return n("div",{ref:function(e){return t.yIntervalsEl=e},class:"y-intervals"},this.yIntervals.map((function(t){return n("span",{class:"y-interval"},d(t))})))};t.prototype.renderData=function(){var t=this;return this.dataPointMatrix.map((function(e,i){var r=t.focusedLine===i?"focused":"faded";var o=t.hiddenLines.includes(i);return n("div",{class:"line ".concat(t.focusedLine!==-1?r:""," ").concat(o?"hidden":"")},t.renderLines(i),t.renderPoints(i))}))};t.prototype.renderPoints=function(t){var e=this;var i=this.dataPointMatrix[t];return n("div",{class:"line-icons"},i.map((function(r,o){var a=r.lineLabel,s=r.xValue,l=r.yValue,c=r.xPositionPercent,h=r.yPositionPercent,p=r.highlighted;if(l!==null){var d=e.lineStyles[t],u=d.color,f=d.icon;var g=t===0&&o===0?0:undefined;var x={"--icon":'"\\'.concat(f,'"'),"--iconColor":u,"--xPosition":c+"%","--yPosition":h+"%","--translation":t===5?"translate(-50%, -50%) rotate(180deg)":"translate(-50%, -50%)"};var b="".concat(a," ").concat(p?e.highlightQualifier:""," ").concat(e.xAxisLabel," ").concat(s+(e.parsedUnits[0]?e.parsedUnits[0]:""),", ").concat(e.yAxisLabel,": ").concat(l+(e.parsedUnits[1]?e.parsedUnits[1]:""));if(e.showDeltas&&o>0){var y=i[o-1];var m=v.getChangeSince(y.xValue);b+=", ".concat(m," ").concat(e.calcDelta(r,y))}return n("span",{id:"".concat(a,"-").concat(o),role:"img","aria-label":b,tabIndex:g,class:"point icon",style:x,"data-lineidx":t,"data-xvalue":s,onKeyDown:function(t){return e.handleDataPointKeydown(t)},onFocus:function(){return e.displayedPopover=o},onClick:function(t){return e.focusDataPointByEl(t.target)},onMouseEnter:function(){return e.displayedPopover=o}})}})))};t.prototype.renderLines=function(t){var e=this;var i=this.dataPointMatrix[t];return n("svg",{class:"line-svg"},i.map((function(r,o){var a=r.yValue!==null&&o!==i.length-1&&i[o+1].yValue!==null;if(a){var s=e.lineStyles[t].color;var l=r.xPositionPercent,c=r.yPositionPercent;var h=i[o+1],p=h.xPositionPercent,d=h.yPositionPercent;return n("line",{x1:l+"%",y1:c+"%",x2:p+"%",y2:d+"%",stroke:s,"stroke-width":"2px"})}})))};t.prototype.renderHoverAreas=function(){var t=this;var e={"--columns":".5fr repeat(".concat(this.xIntervals.length-2,", 1fr) .5fr")};return n("div",{class:"hover-area-wrapper",style:e,onMouseLeave:function(){return t.displayedPopover=-1}},this.xIntervals.map((function(e,i){return n("div",{onMouseEnter:function(){return t.displayedPopover=i}})})))};t.prototype.renderPopover=function(){var t=this;var e=this.popoverData[this.displayedPopover];var i=e[0].xPositionPercent;var r=e.map((function(t){return t.yPositionPercent})).filter((function(t){return t!==null}));var o=r.reduce((function(t,e){return t+e}),0)/r.length;var a=this.plotAreaEl.querySelector('.point[data-xvalue="'.concat(this.dataPointMatrix[0][this.displayedPopover].xValue,'"]'));var s=this.el.getBoundingClientRect();var l=a.getBoundingClientRect();var c=s.right-l.right;var h=l.left-s.left;var p=c>=(this.popoverEl?Math.min(this.popoverEl.clientWidth,400):400);var d=h>=(this.popoverEl?Math.min(this.popoverEl.clientWidth,400):400);var u=8/this.plotAreaEl.clientWidth*100;var f={"--leftPosition":p?i+u+"%":"unset","--rightPosition":d?100-i+u+"%":"unset","--topPosition":o+"%",transform:"translateY(-50%)"};if(!d&&!p){var g="0px - ".concat(this.labelWidth," - 20px - ").concat(this.yIntervalsEl.clientWidth+"px"," + ").concat(this.el.scrollLeft+"px"," + 2px");f={"--leftPosition":"0%","--topPosition":"0%",maxWidth:Math.min(this.el.clientWidth-2,400)+"px",transform:"translateX(calc(".concat(g,"))")}}return n("div",{ref:function(e){return t.popoverEl=e},class:"popover",style:f},n("div",{class:"title"},e[0].xValue,this.parsedUnits[0]&&n("span",{class:"unit --x"},"(",this.parsedUnits[0],")")),this.showDeltas&&this.displayedPopover>0&&n("div",{class:"comparison-title"},v.getChangeSince(this.popoverData[this.displayedPopover-1][0].xValue)),this.renderPopoverTable())};t.prototype.renderPopoverTable=function(){var t=this;var e=this.popoverData[this.displayedPopover];return n("table",{class:"popover-table"},e.map((function(e,i){if(!t.hiddenLines.includes(i)){var r=e.lineLabel,o=e.yValue;var a=t.displayedPopover>0?t.popoverData[t.displayedPopover-1][i]:null;var s=o!==null?(new Intl.NumberFormat).format(o):null;return n("tr",{class:"popover-row"},n("td",null,t.renderIcon(i)),n("td",{class:"row-label"},r),n("td",{class:"row-value"},o===null?v.noData:s,o!==null&&t.parsedUnits[1]&&n("span",{class:"unit --y"},t.parsedUnits[1])),t.showDeltas&&a&&t.renderDeltas(e,a))}})))};t.prototype.renderDeltas=function(t,e){var i=this.calcDelta(t,e);var r=i.toString()[0]=="+"||i=="-"?"positive":i.toString()[0]=="-"?"negative":"";return e&&n("td",{class:"delta --".concat(r)},i)};t.prototype.renderHoverIndicator=function(){var t=this.dataPointMatrix[0][this.displayedPopover].xPositionPercent;var e={"--xPosition":t+"%"};return n("div",{class:"hover-indicator",style:e})};t.prototype.renderHighlight=function(){var t=this.dataPointMatrix[0][this.xIntervals.indexOf(this.highlightStart)].xPositionPercent;var e=this.highlightEnd?100-this.dataPointMatrix[0][this.xIntervals.indexOf(this.highlightEnd)].xPositionPercent:0;var i={"--startPercentage":t+"%","--endPercentage":e+"%"};return n("div",{class:"highlight",style:i})};t.prototype.render=function(){var t=this;return n(r,{onBlur:function(){return t.resetDataPointFocus()},onMouseLeave:function(){return t.displayedPopover=-1}},n("div",{class:"component-wrapper",role:"application","aria-roledescription":f.interactiveChart,"aria-label":this.label,"aria-describedby":"chart-description"},this.renderLegend(),n("div",{class:"chart-wrapper"},n("div",{class:"chart-label --y-axis",style:{"--labelWidth":this.labelWidth}},this.yAxisLabel,this.parsedUnits[1]&&" (".concat(this.parsedUnits[1],")")),this.renderYIntervals(),n("div",{ref:function(e){return t.plotAreaEl=e},class:"plot-area ".concat(this.hasPartialInterval?"":"right-border"),style:{"--backgroundSize":"".concat(this.dataPointMatrix[0][this.xIntervals.indexOf(this.displayedXIntervals[1])].xPositionPercent,"%")}},this.highlightStart&&this.renderHighlight(),this.renderData(),this.renderHoverAreas()),this.displayedPopover!==-1&&this.renderHoverIndicator(),this.displayedPopover!==-1&&this.renderPopover(),this.renderXIntervals(),n("div",{class:"chart-label --x-axis"},this.xAxisLabel,this.parsedUnits[0]&&" (".concat(this.parsedUnits[0],")"))),n("div",{id:"chart-description",class:"sr-only"},"".concat(v.instructions," ").concat(this.description)),n("div",{ref:function(e){return t.liveRegionEl=e},"aria-live":"polite",class:"sr-only"},this.announcement)))};Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{lineData:["parseData"],intervalSkip:["handleIntervalSkip"]}},enumerable:false,configurable:true});return t}());b.style=x}}}));
1
+ var __awaiter=this&&this.__awaiter||function(t,e,i,n){function r(t){return t instanceof i?t:new i((function(e){e(t)}))}return new(i||(i=Promise))((function(i,o){function a(t){try{l(n.next(t))}catch(t){o(t)}}function s(t){try{l(n["throw"](t))}catch(t){o(t)}}function l(t){t.done?i(t.value):r(t.value).then(a,s)}l((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,r,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return l([t,e])}}function l(s){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(i=0)),i)try{if(n=1,r&&(o=s[0]&2?r["return"]:s[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;if(r=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;r=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(s[0]===6&&i.label<o[1]){i.label=o[1];o=s;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(s);break}if(o[2])i.ops.pop();i.trys.pop();continue}s=e.call(t,i)}catch(t){s=[6,t];r=0}finally{n=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-30bf24f8.system.js","./p-32d973fa.system.js","./p-161d5e7c.system.js","./p-7471439a.system.js"],(function(t){"use strict";var e,i,n,r,o,a,s,l,c,h,p,d,u,v,f,g;return{setters:[function(t){e=t.r;i=t.f;n=t.h;r=t.H;o=t.g},function(t){a=t.d;s=t.A;l=t.u;c=t.B;h=t.C;p=t.D},function(t){d=t.m;u=t.n},function(t){v=t.l;f=t.c;g=t.g}],execute:function(){var x=':host{--wmcolor-linechart-currentposition:var(--wmcolor-lavender);--wmcolor-linechart-delta-text-negative:var(--wmcolor-text-negative);--wmcolor-linechart-delta-text-positive:var(--wmcolor-text-positive);--wmcolor-linechart-gridline:var(--wmcolor-chart-gridline);--wmcolor-linechart-highlight-background:var(--wmcolor-background-highlight);--wmcolor-linechart-popover-background:var(--wmcolor-chart-popover-background);display:block;height:500px;width:100%;font-size:14px;overflow-y:visible;overflow-x:auto}:host .component-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:562px;width:100%;height:100%;outline:none}:host .icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;position:relative;color:var(--iconColor);-webkit-transform:var(--translation, unset);transform:var(--translation, unset)}:host .icon:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:var(--icon);padding:0 3px;z-index:1}:host .icon:after{color:white;position:absolute;left:3px;-webkit-transform:scale(180%);transform:scale(180%);display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:var(--icon);z-index:0}:host .legend{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:8px 16px;margin-top:4px;margin-bottom:16px}:host .legend .legend-label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;cursor:default;font-weight:600}:host .legend .legend-label.faded{opacity:0.3}:host .legend .legend-label .icon{margin-right:4px}:host .legend .visibility-toggle{margin-left:4px}:host .chart-wrapper{position:relative;-ms-flex-positive:1;flex-grow:1;display:grid;grid-template-columns:auto auto 1fr;grid-template-rows:1fr auto auto;margin-right:16px}:host .chart-label{font-size:14px;font-weight:600}:host .chart-label.--y-axis{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:var(--labelWidth);align-self:center;margin-right:16px;grid-area:1/1/2/2;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}:host .chart-label.--x-axis{margin-top:16px;text-align:center;grid-area:3/3/4/4}:host .y-intervals{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;grid-area:1/2/2/3;margin-right:4px}:host .y-intervals .y-interval{text-align:right}:host .x-intervals{display:grid;grid-template-columns:var(--columns);grid-area:2/3/3/4;line-height:1;margin-top:4px}:host .x-intervals .x-interval{text-align:center}:host .x-intervals .x-interval:first-child{text-align:left}:host .x-intervals .x-interval:last-child{text-align:right}:host .x-intervals .x-interval.hidden{visibility:hidden}:host .plot-area{position:relative;grid-area:1/3/2/4;background-image:linear-gradient(90deg, var(--wmcolor-linechart-gridline) 1px, transparent 1px);border-bottom:1px solid var(--wmcolor-linechart-gridline);background-size:var(--backgroundSize)}:host .plot-area.right-border{border-right:1px solid var(--wmcolor-linechart-gridline)}:host .line{position:absolute;width:100%;height:100%}:host .line .icon{position:absolute;-webkit-transform:var(--translation);transform:var(--translation);left:var(--xPosition);top:var(--yPosition);z-index:1}:host .line .icon:focus{z-index:2;outline:none}:host .line .icon:focus:before{-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);border-radius:3px}:host .line .icon:focus:before::-moz-focus-inner{border:0}:host .line .line-svg{height:100%;width:100%}:host .line.faded{opacity:0.3}:host .line.focused{z-index:1}:host .line.hidden{visibility:hidden}:host .hover-area-wrapper{position:absolute;width:100%;height:100%;top:0;left:0;display:grid;grid-template-rows:1fr;grid-template-columns:var(--columns)}:host .hover-indicator{-webkit-box-sizing:border-box;box-sizing:border-box;position:absolute;height:100%;width:2px;border:1px solid var(--wmcolor-linechart-currentposition);-webkit-transform:translateX(-50%);transform:translateX(-50%);left:var(--xPosition);grid-column:3/4;grid-row:1/2;pointer-events:none}:host .popover{width:-webkit-max-content;width:-moz-max-content;width:max-content;max-width:400px;background-color:var(--wmcolor-linechart-popover-background);position:absolute;top:var(--topPosition, 0);left:var(--leftPosition, unset);right:var(--rightPosition, unset);padding:16px;border-radius:5px;-webkit-box-shadow:0px 2px 10px 0px rgba(0, 0, 0, 0.09);box-shadow:0px 2px 10px 0px rgba(0, 0, 0, 0.09);-webkit-transform:translateY(-50%);transform:translateY(-50%);line-height:1;z-index:3;grid-column:3/4;grid-row:1/2;pointer-events:none;-webkit-box-sizing:border-box;box-sizing:border-box}:host .popover .title{font-size:16px;font-weight:600}:host .popover .comparison-title{font-style:italic;margin-top:4px}:host .popover .unit{font-size:12px;font-weight:600}:host .popover .unit.--x{margin-left:4px}:host .popover .popover-table{margin-top:16px}:host .popover .popover-table .popover-row{line-height:1}:host .popover .popover-table .popover-row:not(:last-child) td{padding-bottom:8px}:host .popover .popover-table .popover-row .row-label{font-weight:600;padding-right:16px;overflow-wrap:anywhere}:host .popover .popover-table .popover-row .row-label .icon{margin-right:4px}:host .popover .popover-table .popover-row .row-value,:host .popover .popover-table .popover-row .delta{text-align:right;white-space:nowrap}:host .popover .popover-table .popover-row .delta{padding-left:12px;font-weight:600}:host .popover .popover-table .popover-row .delta.--positive{color:var(--wmcolor-linechart-delta-text-positive)}:host .popover .popover-table .popover-row .delta.--negative{color:var(--wmcolor-linechart-delta-text-negative)}:host .highlight{position:absolute;height:100%;background-color:color-mix(in srgb, var(--wmcolor-linechart-highlight-background) 60%, transparent);left:var(--startPercentage);right:var(--endPercentage)}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';var b=t("wm_line_chart",function(){function t(t){var i=this;e(this,t);this.minTickWidth=120;this.popoverData=[];this.focusedDataPoint=[0,0];this.dataPointMatrix=[];this.xIntervals=[];this.displayedXIntervals=[];this.yIntervals=[];this.lineStyles=[{color:"#8b86ca",icon:"f536"},{color:"#2e1b46",icon:"f12f"},{color:"#0089e4",icon:"f763"},{color:"#088000",icon:"f4ce"},{color:"#ea8500",icon:"f70a"},{color:"#d54f41",icon:"f536"},{color:"#146ca9",icon:"f6ff"}];this.debouncedResize=a((function(){return __awaiter(i,void 0,void 0,(function(){return __generator(this,(function(t){this.displayedXIntervals=this.determineDisplayedXIntervals();return[2]}))}))}),100);this.label=undefined;this.description="";this.xAxisLabel=undefined;this.yAxisLabel=undefined;this.lineData=undefined;this.units="null,null";this.labelWidth="120px";this.highlightQualifier="highlighted";this.highlightStart=undefined;this.highlightEnd=undefined;this.visibilityToggles=false;this.showDeltas=false;this.yRange=undefined;this.parsedLineData={};this.displayedPopover=-1;this.focusedLine=-1;this.hiddenLines=[];this.isTabbing=false;this.intervalSkip=0;this.announcement=""}t.prototype.parseData=function(){var t=this;this.parsedLineData=JSON.parse(this.lineData);this.yIntervals=this.calcYIntervals().reverse();this.xIntervals=Object.keys(Object.values(this.parsedLineData)[0]);this.displayedXIntervals=this.determineDisplayedXIntervals();this.dataPointMatrix=Object.entries(this.parsedLineData).map((function(e){return t.buildLineDataPointDetails(e[0],e[1])}));this.popoverData=s(this.dataPointMatrix)};t.prototype.handleIntervalSkip=function(){this.parseData()};Object.defineProperty(t.prototype,"hasPartialInterval",{get:function(){return this.intervalSkip>0&&this.xIntervals.length%2===0},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"parsedUnits",{get:function(){return l(this.units).map((function(t){return t==="null"?null:t}))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"visibilityToggleEls",{get:function(){return this.legendEl.querySelectorAll("wm-button")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"lineEls",{get:function(){return this.plotAreaEl.querySelectorAll(".line")},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"firstVisibleLineIdx",{get:function(){var t=0;while(this.hiddenLines.includes(t)){t++}return t<this.dataPointMatrix.length?t:-1},enumerable:false,configurable:true});t.prototype.toggleTabbingOn=function(){this.isTabbing=true};t.prototype.toggleTabbingOff=function(){this.isTabbing=false};t.prototype.componentWillLoad=function(){this.parseData()};t.prototype.componentDidLoad=function(){var t=this;var e=new ResizeObserver((function(){return t.debouncedResize()}));e.observe(this.el)};t.prototype.handleVisibilityToggleKeydown=function(t,e){switch(t.key){case"Tab":if(!t.shiftKey&&this.firstVisibleLineIdx!==-1){t.preventDefault();this.announce(this.lineFocusMessage(this.firstVisibleLineIdx));this.focusDataPoint(this.firstVisibleLineIdx,0)}break;case"ArrowUp":case"ArrowLeft":t.preventDefault();var i=c(e,-1,this.dataPointMatrix.length-1);this.visibilityToggleEls[i].focus();break;case"ArrowDown":case"ArrowRight":t.preventDefault();var n=c(e,1,this.dataPointMatrix.length-1);this.visibilityToggleEls[n].focus();break}};t.prototype.handleDataPointKeydown=function(t){var e=this.focusedDataPoint,i=e[0],n=e[1];var r=this.lineEls[i].querySelectorAll(".point").length;var o=this.dataPointMatrix.length;switch(t.key){case"Tab":if(t.shiftKey&&this.visibilityToggles){t.preventDefault();this.visibilityToggleEls[0].focus()}break;case"ArrowUp":t.preventDefault();var a=i;do{a=c(a,-1,o-1)}while(this.hiddenLines.includes(a));this.announce(this.lineFocusMessage(a));this.focusDataPoint(a,n);break;case"ArrowDown":t.preventDefault();var s=i;do{s=c(s,1,o-1)}while(this.hiddenLines.includes(s));this.announce(this.lineFocusMessage(s));this.focusDataPoint(s,n);break;case"ArrowLeft":t.preventDefault();var l=c(n,-1,r-1);this.focusDataPoint(i,l);break;case"ArrowRight":t.preventDefault();var h=c(n,1,r-1);this.focusDataPoint(i,h);break}};t.prototype.announce=function(t){if(this.liveRegionEl.textContent===t){t+=" "}this.announcement=t};t.prototype.lineFocusMessage=function(t){var e=this.dataPointMatrix[t][0].lineLabel;var i=this.dataPointMatrix[t].filter((function(t){return t.yValue!==null})).length;return"".concat(e,", line ").concat(t+1," of ").concat(this.dataPointMatrix.length," with ").concat(i," data points")};t.prototype.focusDataPoint=function(t,e){var i=this.lineEls[t];var n=i.querySelectorAll(".point")[e];var r=this.plotAreaEl.querySelectorAll(".point");r.forEach((function(t){return t.tabIndex=-1}));n.tabIndex=0;n.focus();this.focusedDataPoint=[t,e]};t.prototype.focusDataPointByEl=function(t){var e=parseInt(t.dataset.lineidx);var i=Array.from(t.parentElement.querySelectorAll(".point")).indexOf(t);var n=this.plotAreaEl.querySelectorAll(".point");n.forEach((function(t){return t.tabIndex=-1}));t.tabIndex=0;t.focus();this.focusedDataPoint=[e,i]};t.prototype.calcYIntervals=function(){var t=[];if(this.yRange){t=l(this.yRange).map((function(t){return parseInt(t)}))}else{var e=[];var i=Object.values(this.parsedLineData).flat();i.forEach((function(t){return e.push.apply(e,Object.values(t))}));var n=e.filter((function(t){return t!==null}));var r=Math.min.apply(Math,n);var o=Math.max.apply(Math,n);var a=u(o-r,4);var s=a;while(r%a!==0&&s>0){r--;s--}a=u(o-r,4);var c=r;while(c<=o+a){t.push(c);c+=a}}return t};t.prototype.determineDisplayedXIntervals=function(){var t=this.plotAreaEl&&this.plotAreaEl.clientWidth>0?Math.round(this.plotAreaEl.clientWidth/this.minTickWidth):this.xIntervals.length;var e=h(this.xIntervals,t),i=e.skipInterval,n=e.skippedList;this.intervalSkip=i;return n};t.prototype.buildLineDataPointDetails=function(t,e){var i=this;var n=[];var r=Object.entries(e);var o;r.forEach((function(e,a){var s=e[0],l=e[1];var c=100/(r.length-1)*a;var h=l===null?null:100-p(l,i.yIntervals[i.yIntervals.length-1],i.yIntervals[0]);if(a===0){c+=i.plotAreaEl&&i.plotAreaEl.clientWidth>0?8/i.plotAreaEl.clientWidth*100:1}if(s===i.highlightStart&&!o){o=true}n.push({lineLabel:t,xValue:s,yValue:l,xPositionPercent:c,yPositionPercent:h,highlighted:o});if(s===i.highlightEnd&&o){o=false}}));return n};t.prototype.toggleLineVisibility=function(t){if(this.hiddenLines.includes(t)){this.hiddenLines=this.hiddenLines.filter((function(e){return e!==t}))}else{this.hiddenLines.push(t)}i(this.el)};t.prototype.resetDataPointFocus=function(){this.displayedPopover=-1;var t=this.plotAreaEl.querySelectorAll(".point");t.forEach((function(t){return t.tabIndex=-1}));if(this.firstVisibleLineIdx!==-1){var e=this.lineEls[this.firstVisibleLineIdx];var i=e.querySelectorAll(".point")[0];i.tabIndex=0;this.focusedDataPoint=[this.firstVisibleLineIdx,0]}};t.prototype.calcDelta=function(t,e){var i;if(t.yValue===null||e.yValue===null){i=v.noData}else if(t.yValue==e.yValue){i="0%"}else if(e.yValue==0){i="-"}else{var n=(t.yValue-e.yValue)/e.yValue*100;var r=Math.round(n*100)/100;i="".concat(r>0?"+":"").concat(r,"%")}return i};t.prototype.renderLegend=function(){var t=this;var e=Object.keys(this.parsedLineData);return n("div",{ref:function(e){return t.legendEl=e},class:"legend"},e.map((function(e,i){var r=t.hiddenLines.includes(i);var o=t.focusedLine!==-1&&t.focusedLine!==i;return n("div",{id:"legend-label-".concat(i),class:"legend-label ".concat(o?"faded":""),onMouseEnter:function(){return t.focusedLine=r?-1:i},onMouseLeave:function(){return t.focusedLine=-1}},t.renderIcon(i),e,t.visibilityToggles&&t.renderVisibilityToggle(e,i,r))})))};t.prototype.renderVisibilityToggle=function(t,e,i){var r=this;return n("wm-button",{id:"visibility-button-".concat(e),class:"visibility-toggle","label-for-identical-buttons":"".concat(e===0?"Toggle line visibility list with ".concat(this.dataPointMatrix.length," items"):""," ").concat(i?g.show:g.hide," ").concat(t," toggle ").concat(i?"pressed":""),"button-type":"navigational",tooltip:i?g.show:g.hide,tooltipPosition:"bottom",icon:i?"f209":"f208",onClick:function(){return r.toggleLineVisibility(e)},onKeyDown:function(t){return r.handleVisibilityToggleKeydown(t,e)},onFocus:function(){return r.displayedPopover=-1}})};t.prototype.renderIcon=function(t){var e=this.lineStyles[t],i=e.color,r=e.icon;var o={"--iconColor":i,"--icon":'"\\'.concat(r,'"'),"--translation":t===5?"rotate(180deg)":"unset"};return n("span",{class:"icon",style:o})};t.prototype.renderXIntervals=function(){var t=this;var e={"--columns":".5fr repeat(".concat(this.xIntervals.length-2,", 1fr) .5fr")};return n("div",{class:"x-intervals",style:e},this.xIntervals.map((function(e){return n("span",{class:"x-interval ".concat(t.displayedXIntervals.includes(e)?"":"hidden")},e)})))};t.prototype.renderYIntervals=function(){var t=this;return n("div",{ref:function(e){return t.yIntervalsEl=e},class:"y-intervals"},this.yIntervals.map((function(t){return n("span",{class:"y-interval"},d(t))})))};t.prototype.renderData=function(){var t=this;return this.dataPointMatrix.map((function(e,i){var r=t.focusedLine===i?"focused":"faded";var o=t.hiddenLines.includes(i);return n("div",{class:"line ".concat(t.focusedLine!==-1?r:""," ").concat(o?"hidden":"")},t.renderLines(i),t.renderPoints(i))}))};t.prototype.renderPoints=function(t){var e=this;var i=this.dataPointMatrix[t];return n("div",{class:"line-icons"},i.map((function(r,o){var a=r.lineLabel,s=r.xValue,l=r.yValue,c=r.xPositionPercent,h=r.yPositionPercent,p=r.highlighted;if(l!==null){var d=e.lineStyles[t],u=d.color,f=d.icon;var g=t===0&&o===0?0:undefined;var x={"--icon":'"\\'.concat(f,'"'),"--iconColor":u,"--xPosition":c+"%","--yPosition":h+"%","--translation":t===5?"translate(-50%, -50%) rotate(180deg)":"translate(-50%, -50%)"};var b="".concat(a," ").concat(p?e.highlightQualifier:""," ").concat(e.xAxisLabel," ").concat(s+(e.parsedUnits[0]?e.parsedUnits[0]:""),", ").concat(e.yAxisLabel,": ").concat(l+(e.parsedUnits[1]?e.parsedUnits[1]:""));if(e.showDeltas&&o>0){var y=i[o-1];var m=v.getChangeSince(y.xValue);b+=", ".concat(m," ").concat(e.calcDelta(r,y))}return n("span",{id:"".concat(a,"-").concat(o),role:"img","aria-label":b,tabIndex:g,class:"point icon",style:x,"data-lineidx":t,"data-xvalue":s,onKeyDown:function(t){return e.handleDataPointKeydown(t)},onFocus:function(){return e.displayedPopover=o},onClick:function(t){return e.focusDataPointByEl(t.target)},onMouseEnter:function(){return e.displayedPopover=o}})}})))};t.prototype.renderLines=function(t){var e=this;var i=this.dataPointMatrix[t];return n("svg",{class:"line-svg"},i.map((function(r,o){var a=r.yValue!==null&&o!==i.length-1&&i[o+1].yValue!==null;if(a){var s=e.lineStyles[t].color;var l=r.xPositionPercent,c=r.yPositionPercent;var h=i[o+1],p=h.xPositionPercent,d=h.yPositionPercent;return n("line",{x1:l+"%",y1:c+"%",x2:p+"%",y2:d+"%",stroke:s,"stroke-width":"2px"})}})))};t.prototype.renderHoverAreas=function(){var t=this;var e={"--columns":".5fr repeat(".concat(this.xIntervals.length-2,", 1fr) .5fr")};return n("div",{class:"hover-area-wrapper",style:e,onMouseLeave:function(){return t.displayedPopover=-1}},this.xIntervals.map((function(e,i){return n("div",{onMouseEnter:function(){return t.displayedPopover=i}})})))};t.prototype.renderPopover=function(){var t=this;var e=this.popoverData[this.displayedPopover];var i=e[0].xPositionPercent;var r=e.map((function(t){return t.yPositionPercent})).filter((function(t){return t!==null}));var o=r.reduce((function(t,e){return t+e}),0)/r.length;var a=this.plotAreaEl.querySelector('.point[data-xvalue="'.concat(this.dataPointMatrix[0][this.displayedPopover].xValue,'"]'));var s=this.el.getBoundingClientRect();var l=a.getBoundingClientRect();var c=s.right-l.right;var h=l.left-s.left;var p=c>=(this.popoverEl?Math.min(this.popoverEl.clientWidth,400):400);var d=h>=(this.popoverEl?Math.min(this.popoverEl.clientWidth,400):400);var u=8/this.plotAreaEl.clientWidth*100;var f={"--leftPosition":p?i+u+"%":"unset","--rightPosition":d?100-i+u+"%":"unset","--topPosition":o+"%",transform:"translateY(-50%)"};if(!d&&!p){var g="0px - ".concat(this.labelWidth," - 20px - ").concat(this.yIntervalsEl.clientWidth+"px"," + ").concat(this.el.scrollLeft+"px"," + 2px");f={"--leftPosition":"0%","--topPosition":"0%",maxWidth:Math.min(this.el.clientWidth-2,400)+"px",transform:"translateX(calc(".concat(g,"))")}}return n("div",{ref:function(e){return t.popoverEl=e},class:"popover",style:f},n("div",{class:"title"},e[0].xValue,this.parsedUnits[0]&&n("span",{class:"unit --x"},"(",this.parsedUnits[0],")")),this.showDeltas&&this.displayedPopover>0&&n("div",{class:"comparison-title"},v.getChangeSince(this.popoverData[this.displayedPopover-1][0].xValue)),this.renderPopoverTable())};t.prototype.renderPopoverTable=function(){var t=this;var e=this.popoverData[this.displayedPopover];return n("table",{class:"popover-table"},e.map((function(e,i){if(!t.hiddenLines.includes(i)){var r=e.lineLabel,o=e.yValue;var a=t.displayedPopover>0?t.popoverData[t.displayedPopover-1][i]:null;var s=o!==null?(new Intl.NumberFormat).format(o):null;return n("tr",{class:"popover-row"},n("td",null,t.renderIcon(i)),n("td",{class:"row-label"},r),n("td",{class:"row-value"},o===null?v.noData:s,o!==null&&t.parsedUnits[1]&&n("span",{class:"unit --y"},t.parsedUnits[1])),t.showDeltas&&a&&t.renderDeltas(e,a))}})))};t.prototype.renderDeltas=function(t,e){var i=this.calcDelta(t,e);var r=i.toString()[0]=="+"||i=="-"?"positive":i.toString()[0]=="-"?"negative":"";return e&&n("td",{class:"delta --".concat(r)},i)};t.prototype.renderHoverIndicator=function(){var t=this.dataPointMatrix[0][this.displayedPopover].xPositionPercent;var e={"--xPosition":t+"%"};return n("div",{class:"hover-indicator",style:e})};t.prototype.renderHighlight=function(){var t=this.dataPointMatrix[0][this.xIntervals.indexOf(this.highlightStart)].xPositionPercent;var e=this.highlightEnd?100-this.dataPointMatrix[0][this.xIntervals.indexOf(this.highlightEnd)].xPositionPercent:0;var i={"--startPercentage":t+"%","--endPercentage":e+"%"};return n("div",{class:"highlight",style:i})};t.prototype.render=function(){var t=this;return n(r,{onBlur:function(){return t.resetDataPointFocus()},onMouseLeave:function(){return t.displayedPopover=-1}},n("div",{class:"component-wrapper",role:"application","aria-roledescription":f.interactiveChart,"aria-label":this.label,"aria-describedby":"chart-description"},this.renderLegend(),n("div",{class:"chart-wrapper"},n("div",{class:"chart-label --y-axis",style:{"--labelWidth":this.labelWidth}},this.yAxisLabel,this.parsedUnits[1]&&" (".concat(this.parsedUnits[1],")")),this.renderYIntervals(),n("div",{ref:function(e){return t.plotAreaEl=e},class:"plot-area ".concat(this.hasPartialInterval?"":"right-border"),style:{"--backgroundSize":"".concat(this.dataPointMatrix[0][this.xIntervals.indexOf(this.displayedXIntervals[1])].xPositionPercent,"%")}},this.highlightStart&&this.renderHighlight(),this.renderData(),this.renderHoverAreas()),this.displayedPopover!==-1&&this.renderHoverIndicator(),this.displayedPopover!==-1&&this.renderPopover(),this.renderXIntervals(),n("div",{class:"chart-label --x-axis"},this.xAxisLabel,this.parsedUnits[0]&&" (".concat(this.parsedUnits[0],")"))),n("div",{id:"chart-description",class:"sr-only"},"".concat(v.instructions," ").concat(this.description)),n("div",{ref:function(e){return t.liveRegionEl=e},"aria-live":"polite",class:"sr-only"},this.announcement)))};Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{lineData:["parseData"],intervalSkip:["handleIntervalSkip"]}},enumerable:false,configurable:true});return t}());b.style=x}}}));
@@ -1 +1 @@
1
- import{r as o,c as t,f as e,h as r,H as n,g as i}from"./p-b5bedd63.js";import{g as a,p as s,a as l,d}from"./p-a6d6eae7.js";import{g as b,i as c,x as m}from"./p-ff888d78.js";import{g as u}from"./p-cd7cc5c6.js";const h=class{constructor(e){o(this,e),this.wmNetworkUploaderFilesChanged=t(this,"wmNetworkUploaderFilesChanged",7),this.inputId=b(),this.isTabbing=!1,this.fileList=[],this.inProgressList=[],this.errorList=[],this.notif=void 0,this.snackbar=[],this.numFilesInProgress=void 0,this.getPath=void 0,this.requestUploadPath=void 0,this.uploadPath=void 0,this.requestDownloadPath=void 0,this.deletePath=void 0,this.associatedData=void 0,this.buttonText=void 0,this.emptyStateText=void 0,this.icon=void 0,this.fileTypes="pdf txt log xml doc docx xls xlsx ppt pptx gif jpg jpeg png csv",this.maxSize=100,this.maxFiles=void 0,this.sortBy="date"}toggleTabbingOn(){this.isTabbing=!0}toggleTabbingOff(){this.isTabbing=!1}handleUploadProgress(o){if(this.inProgressList.map((t=>{t.name===o.detail.file_name&&(t.progress=o.detail.progress,e(this.el))})),100===o.detail.progress&&(this.numFilesInProgress-=1),!this.srProgress&&this.numFilesInProgress){const o=this.numFilesInProgress;this.srProgress=setInterval((()=>{const t=this.inProgressList.reduce(((o,t)=>t.progress?o+t.progress:o),0);this.liveRegion&&(this.liveRegion.innerHTML=c.formatMessage({id:"uploader.uploadProgress",defaultMessage:"Upload progress: {percentage}%"},{percentage:Math.floor(t/o)}))}),5e3)}}handleFinishedSnack(o){this.snackbar=this.snackbar.filter((t=>t.id!==o.detail.id))}setMaxSize(){this.maxSize=this.maxSize>100?100:this.maxSize}uploadNotifications(o,t){if(t>0&&0===o){setTimeout((()=>{this.notif=null}),2e4);const o=c.formatMessage({id:"uploader.finishedUploading",defaultMessage:"Finished uploading"});this.notif={id:5,message:o},this.liveRegion&&(this.liveRegion.innerHTML=o),this.numFilesInProgress=null,clearInterval(this.srProgress),e(this.el)}else if(o>0&&o!=t){const t=c.formatMessage({id:"uploader.filesUploading",defaultMessage:"{num, plural, one {1 file uploading} other {# files uploading}}"},{num:o});this.notif={id:6,message:t},this.liveRegion&&(this.liveRegion.innerHTML=t),e(this.el)}}emitFileListEvent(){this.wmNetworkUploaderFilesChanged.emit(this.fileList)}formatDate(o,t,e){const r=Date.parse(o);if(!t.match(/^[a-zA-Z]*(-[a-zA-Z0-9]*)*$/g))return o;try{Intl.getCanonicalLocales(t)}catch(o){t="en-us"}if(r){const o=new Date(r);return`${o.getFullYear()}/${("0"+(o.getMonth()+1)).substr(-2)}/${("0"+o.getDate()).substr(-2)} ${o.toLocaleTimeString([t,"en-us"],{timeZone:e,hour:"numeric",minute:"numeric"})}`}return o}isValidSize(o){return o/1024/1024<=this.maxSize}isDuplicate(o){return this.fileList.find((t=>t.file_name===o))}isEmpty(){return!this.fileList.length&&!this.inProgressList.length&&!this.errorList.length}get isDisabled(){const o=!!this.maxFiles&&this.fileList.length>=this.maxFiles;if(this.notif)1===this.notif.id&&(o||(this.notif=null));else if(o){const o=c.formatMessage({id:"uploader.fileUploadLimitExceeded",defaultMessage:"Upload unsuccessful because file selection would exceed the maximum number of files",description:"Message displayed when trying to upload too many files"});this.notif={id:1,message:o},this.liveRegion&&(this.liveRegion.innerHTML=o)}else this.notif=null;return o||this.numFilesInProgress>0}purgeProgressList(o){this.inProgressList=this.inProgressList.filter((t=>100!==t.progress&&t.name!==o.file_name))}getExistingFiles(){a(this.getPath).then((o=>{o.map((o=>this.purgeProgressList(o))),"name"===this.sortBy&&o.sort(((o,t)=>o.file_name.localeCompare(t.file_name))),this.fileList=o})).catch((o=>{console.error(o)}))}clearErrors(){this.errorList=[],this.notif=null}handleFiles(o){const t=Array.from(o.target.files),r=this.fileTypes.split(" ").join(", ");if(this.maxFiles&&this.fileList.length+t.length>this.maxFiles){const o=c.formatMessage({id:"uploader.fileUploadLimitExceeded",defaultMessage:"Upload unsuccessful because file selection would exceed the maximum number of files",description:"Message displayed when trying to upload too many files"});this.notif={id:2,message:o},this.liveRegion&&(this.liveRegion.innerHTML=o)}else t&&t.map((o=>{if(m(o,this.fileTypes))if(this.isValidSize(o.size))if(this.isDuplicate(o.name)){const t={file_name:o.name,message:c.formatMessage({id:"uploader.duplicateName",defaultMessage:"A file with this name already exists."})};this.errorList.push(t)}else this.inProgressList.push(o);else{const t={file_name:o.name,message:c.formatMessage({id:"uploader.fileTooLarge",defaultMessage:"The selected file is too large. Maximum file size is {size}Mb"},{size:this.maxSize})};this.errorList.push(t)}else{const t={file_name:o.name,message:c.formatMessage({id:"uploader.invalidFileType",defaultMessage:"The file type is invalid. Accepted types: {validTypes}"},{validTypes:r})};this.errorList.push(t)}e(this.el)})),this.inProgressList.length>0&&(this.numFilesInProgress=this.inProgressList.length,this.inProgressList.map(((o,t)=>{this.uploadFile(o,t)})));o.target.value=""}uploadFile(o,t){a(this.requestUploadPath+t.toString()).then((async t=>{const e=JSON.parse(this.associatedData),r=Object.assign(Object.assign({},e),{file_name:o.name,mime_type:o.type,file_path:t.path,document_uuid:t.guid});await s(t.url,o,(t=>{const e=new CustomEvent("wmUploadProgress",{detail:{file_name:o.name,progress:t.lengthComputable&&0!==t.total?t.loaded/t.total*100:0}});this.el.dispatchEvent(e)})),await l(this.uploadPath,r),this.getExistingFiles()})).catch((o=>{this.numFilesInProgress=null,this.inProgressList=[],this.notif={id:3,message:u.genericError},console.error(o)}))}downloadFile(o,t){this.clearErrors(),l(this.requestDownloadPath,{file_path:t,file_uuid:o}).then((o=>{window.location.assign(o.url)})).catch((o=>{console.error(o)}))}deleteFile(o){this.clearErrors(),this.snackbar.push({message:c.formatMessage({id:"uploader.fileDeleted",defaultMessage:"{fileName} was deleted."},{fileName:o.file_name}),id:o.uuid,link:""}),this.fileList=this.fileList.filter((t=>t.uuid!==o.uuid)),d(`${this.deletePath}/${o.uuid}`).catch((t=>{this.notif={id:4,message:c.formatMessage({id:"uploader.fileNotDeleted",defaultMessage:"{fileName} could not be deleted."},{fileName:o.file_name})},this.getExistingFiles(),console.error(t)}))}componentWillLoad(){if(!this.getPath)throw new Error("wm-network-uploader: get-path is a required prop");if(!this.requestUploadPath)throw new Error("wm-network-uploader: request-upload-path is a required prop");if(!this.uploadPath)throw new Error("wm-network-uploader: upload-path is a required prop");if(!this.requestDownloadPath)throw new Error("wm-network-uploader: request-download-path is a required prop");if(!this.deletePath)throw new Error("wm-network-uploader: delete-path is a required prop");if(!this.buttonText)throw new Error("wm-network-uploader: button-text is a required prop");if(!this.emptyStateText)throw new Error("wm-network-uploader: empty-state-text is a required prop");if(!this.associatedData)throw new Error("wm-network-uploader: associated-data is a required prop");this.setMaxSize(),this.clearErrors()}componentDidLoad(){this.getExistingFiles(),document.body.classList.contains("wmcl-user-is-tabbing")&&this.toggleTabbingOn()}uploadButtonOnClick(o){if(this.isDisabled){if(o.preventDefault(),this.liveRegion){const o=!!this.maxFiles&&this.fileList.length>=this.maxFiles;let t="";this.numFilesInProgress>0?t=c.formatMessage({id:"uploader.waitToUpload",defaultMessage:"Please wait for current upload to complete before uploading new files.",description:"Message for screen reader users"}):o&&(t=c.formatMessage({id:"uploader.fileUploadLimitExceeded",defaultMessage:"Upload unsuccessful because file selection would exceed the maximum number of files",description:"Message displayed when trying to upload too many files"})),t&&(this.liveRegion.innerHTML="",new Promise((o=>{setTimeout((()=>{o("")}),500)})).then((()=>this.liveRegion.innerHTML=t)))}}else this.clearErrors()}renderUploadSvg(){return r("svg",{class:"upload-file",width:"91",height:"84",viewBox:"0 0 91 84"},r("path",{transform:"rotate(-180.000000) translate(-452, -255.5)",fill:"#eae8ec",d:"M361,249.681818 L361,197.318182 C361,194.118182 365.555061,191.5 371.122358,191.5 L391.316463,191.5 L391.286495,200.562515 L369.871211,200.600292 L369.885404,200.622146 L369.886423,246.655947 L443.657038,246.840767 L443.657038,200.622146 L421.683537,200.622146 L421.683537,191.5 L441.978865,191.5 C447.546162,191.5 452,194.118182 452,197.318182 L452,249.681818 C452,252.881818 447.546162,255.5 441.978865,255.5 L371.122358,255.5 C365.504449,255.5 361,252.881818 361,249.681818 Z M391.5,207 L406,221 L420.5,207 L409.625,207 L409.625,172 L402.375,172 L402.375,207 L391.5,207 Z"}))}renderIcon(){return this.icon&&r("span",{class:"mdi "+(this.icon&&"f066"===this.icon?"rotate":"")},String.fromCodePoint(parseInt(`0x${this.icon}`)))}renderNotif(){return this.notif?r("span",{class:"notif"},this.notif.message):""}renderUploadButton(o){return r("div",{class:"notif-wrapper"},r("input",{name:this.inputId,id:this.inputId,class:"sr-only",type:"file",multiple:!0,onClick:o=>this.uploadButtonOnClick(o),onChange:o=>this.handleFiles(o)}),r("label",{htmlFor:this.inputId,class:`wm-button ${o}${this.isTabbing?" user-is-tabbing":""}`},this.renderIcon(),this.buttonText),this.renderNotif())}renderWithItems(){return r("div",null,r("div",{class:"header"},r("div",{class:"descr"},r("slot",null)),this.renderUploadButton(this.isDisabled?"disabled":"")),this.renderErrorList(),this.renderInProgressList(),this.renderFileList())}renderEmptyState(){return r("div",null,r("div",{class:"header"},r("div",{class:"descr"},r("slot",null))),r("div",{class:"empty-block"},this.renderUploadSvg(),r("div",{class:"empty-message"},this.emptyStateText),this.renderUploadButton("-primary empty-button")))}renderErrorList(){if(this.errorList.length){if(this.liveRegion){let o=this.errorList.reduce((function(o,t){return o+`${t.file_name}: ${t.message} `}),"");this.liveRegion.innerHTML=o}return r("ul",{class:"error-list"},this.errorList.map((o=>r("li",null,r("div",{class:"file --error"},r("div",{class:"file-info"},r("span",{class:"filename"},o.file_name))),r("div",{class:"error-message"},o.message)))))}}renderInProgressList(){return r("ul",{class:"inprogress-list"},this.inProgressList.map((o=>r("li",null,r("div",{class:"file --progress"},r("div",{class:"progress",style:{background:`linear-gradient(to right, rgba(67, 126, 142, 1) ${o.progress}%, transparent ${o.progress}%)`}}),r("div",{class:"file-info"},r("span",{class:"filename"},o.name," ",r("span",{class:"sr-only"},"uploading"))))))))}renderFile(o){return r("li",null,r("div",{class:"file --saved"},r("div",{class:"file-info"},r("span",{class:"filename"},o.file_name),r("span",{class:"filedate"},this.formatDate(o.updated_at,c.locale,Intl.DateTimeFormat().resolvedOptions().timeZone))),r("div",{class:"file-controls"},r("wm-button",{class:"download-button","button-type":"icononly",tooltip:"download","label-for-identical-buttons":`download ${o.file_name}`,icon:"f1da",onClick:()=>this.downloadFile(o.uuid,o.file_path)}),r("wm-button",{class:"delete-button","button-type":"icononly",tooltip:"remove","label-for-identical-buttons":`remove ${o.file_name}`,icon:"f1c0",onClick:()=>this.deleteFile(o)}))))}renderFileList(){return r("ul",{class:"file-list"},this.fileList.map((o=>this.renderFile(o))))}render(){return r(n,null,this.isEmpty()?this.renderEmptyState():this.renderWithItems(),r("wm-snackbar",{notifications:JSON.stringify(this.snackbar)}),r("div",{ref:o=>this.liveRegion=o,class:"live-region sr-only","aria-live":"assertive","aria-atomic":"true"}))}get el(){return i(this)}static get watchers(){return{maxSize:["setMaxSize"],numFilesInProgress:["uploadNotifications"],fileList:["emitFileListEvent"]}}};h.style=':host .wm-button{-ms-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1), border 500ms cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1), border 500ms cubic-bezier(0.4, 0, 0.2, 1);-moz-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1), border 500ms cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1), border 500ms cubic-bezier(0.4, 0, 0.2, 1);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;border-radius:5px;width:100%;border:2px solid transparent;font-family:inherit;font-size:0.75rem;font-weight:700;min-height:2.75rem;padding:12px 1.3333333333em;cursor:pointer;position:relative;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-decoration:none;text-transform:uppercase;letter-spacing:0.01875rem;overflow-wrap:break-word;-webkit-box-shadow:none;box-shadow:none}@media screen and (min-width: 48rem){:host .wm-button{min-height:3.3333333333em}}:host .wm-button.nowrap{display:inline-block;width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host .wm-button:focus{outline:none;-webkit-box-shadow:none;box-shadow:none}:host .wm-button::-moz-focus-inner{border:0;outline:none}:host .wm-button.user-is-tabbing:focus:not(.-textonly):not(:disabled):not(.disabled):not(.dark){-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus)}:host .wm-button.user-is-tabbing:focus:not(.-textonly):not(:disabled):not(.disabled):not(.dark)::-moz-focus-inner{border:0}:host .wm-button.dark.user-is-tabbing:focus:not(.-textonly):not(:disabled):not(.disabled).dark{-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus-ondark);-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus-ondark);box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus-ondark);outline:none}:host .wm-button:active:not(:disabled):not(.disabled):not(.-textonly):not(.-actionbutton):not(.displayedoption){-ms-transform:scale(0.9, 0.9);-webkit-transform:scale(0.9, 0.9);-moz-transform:scale(0.9, 0.9);transform:scale(0.9, 0.9)}:host .wm-button .mdi{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:host .wm-button:not(.-icononly):not(.-navigational) .mdi{margin-right:0.3125rem;font-size:0.875rem}:host .wm-button[dir=RTL] :not(.-icononly) .mdi{margin-left:0.3125rem;margin-right:0}:host .wm-button.-primary:not(.-textonly){background:var(--wmcolor-button-background-primary);color:var(--wmcolor-button-text-primary)}:host .wm-button.-primary:not(.-textonly):not(:focus){-webkit-box-shadow:0 0 4px 0 rgba(0, 0, 0, 0.14), 0 3px 4px 0 rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);box-shadow:0 0 4px 0 rgba(0, 0, 0, 0.14), 0 3px 4px 0 rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2)}:host .wm-button.-primary:not(.-textonly):hover:not(:disabled):not(.disabled){background:var(--wmcolor-button-background-primary-hover)}:host .wm-button.-primary:not(.-textonly).dark:not(:disabled):not(.disabled){color:var(--wmcolor-button-text-primary-ondark);background:var(--wmcolor-button-background-primary-ondark)}:host .wm-button.-primary:not(.-textonly).dark:not(:disabled):not(.disabled):hover{background:var(--wmcolor-button-background-primary-hover-ondark)}:host .wm-button.-secondary{color:var(--wmcolor-button-text-secondary);border:2px solid var(--wmcolor-button-border-secondary);background:var(--wmcolor-button-background-secondary)}:host .wm-button.-secondary:hover:not(:disabled):not(.disabled){background:var(--wmcolor-button-background-secondary-hover);color:var(--wmcolor-button-text-secondary-hover);border-color:transparent}:host .wm-button.-secondary.dark:not(:disabled):not(.disabled){color:var(--wmcolor-button-text-secondary-ondark);background:var(--wmcolor-button-background-secondary-ondark);border-color:var(--wmcolor-button-border-secondary-ondark)}:host .wm-button.-secondary.dark:not(:disabled):not(.disabled):hover{color:var(--wmcolor-button-text-secondary-hover-ondark);background:var(--wmcolor-button-background-secondary-hover-ondark);border-color:transparent}:host .wm-button.-textonly{color:var(--wmcolor-button-text-textonly);-webkit-box-shadow:none;box-shadow:none;display:inline-block;letter-spacing:0;text-transform:none;text-align:initial;font-size:0.875rem;border:none;background:transparent;padding:0;height:auto;min-height:unset;border-radius:0;line-height:1;overflow-wrap:anywhere}:host .wm-button.-textonly+.-textonly{margin-left:0.3125rem}:host .wm-button.-textonly:focus{outline:none}:host .wm-button.-textonly::-moz-focus-inner{border:0;outline:none}:host .wm-button.-textonly.user-is-tabbing:focus:not(:disabled):not(.disabled) .button-text{background:-webkit-gradient(linear, left top, right top, color-stop(66%, var(--wmcolor-interactive-focus-textonly)), color-stop(0, transparent)) repeat-x;background:linear-gradient(90deg, var(--wmcolor-interactive-focus-textonly) 66%, transparent 0) repeat-x;background-size:6px 3px;background-position:0 1em;border-radius:0;line-height:normal}:host .wm-button.-textonly.user-is-tabbing:focus:not(:disabled):not(.disabled).dark .button-text{background:-webkit-gradient(linear, left top, right top, color-stop(66%, var(--wmcolor-interactive-focus-textonly-ondark)), color-stop(0, transparent)) repeat-x;background:linear-gradient(90deg, var(--wmcolor-interactive-focus-textonly-ondark) 66%, transparent 0) repeat-x;background-size:6px 3px;background-position:0 1em;border-radius:0;line-height:normal}:host .wm-button.-textonly.small{font-size:0.625rem}:host .wm-button.-textonly:hover:not(:disabled):not(.disabled):not(.-permanentlydelete){text-decoration:underline}:host .wm-button.-textonly.dark{color:var(--wmcolor-button-text-textonly-ondark)}:host .wm-button.-textonly.dark:hover:not(:disabled):not(.disabled){text-decoration:underline}:host .wm-button.-textonly.-permanentlydelete{color:var(--wmcolor-button-background-delete)}:host .wm-button.-textonly.-permanentlydelete:hover:not(:disabled):not(.disabled):not(.dark){text-decoration:underline}:host .wm-button.-textonly.-permanentlydelete.dark:not(:disabled):not(.disabled){color:var(--wmcolor-button-text-textonly-ondark)}:host .wm-button.-icononly,:host .wm-button.-navigational{-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%;font-size:1rem;padding:0;height:auto;line-height:1;min-width:2.75rem;min-height:2.75rem;text-align:center;letter-spacing:normal}:host .wm-button.-icononly:not(:focus),:host .wm-button.-navigational:not(:focus){-webkit-box-shadow:none;box-shadow:none}@media screen and (min-width: 48rem){:host .wm-button.-icononly,:host .wm-button.-navigational{min-width:2.5rem;min-height:2.5rem}}:host .wm-button.-icononly .mdi,:host .wm-button.-navigational .mdi{font-size:1.12rem}:host .wm-button.-icononly{border-width:1px !important;color:var(--wmcolor-button-icon-icononly);border-color:var(--wmcolor-button-border-icononly);background-color:var(--wmcolor-button-background-icononly)}:host .wm-button.-icononly:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:host .wm-button.-icononly:hover:not(:disabled):not(.disabled){background:var(--wmcolor-button-background-icononly-hover);color:var(--wmcolor-button-icon-icononly-hover);border-color:transparent}:host .wm-button.-icononly.dark:not(:disabled):not(.disabled){color:var(--wmcolor-button-icon-icononly-ondark);background:var(--wmcolor-button-background-icononly-ondark);border-color:var(--wmcolor-button-border-icononly-ondark)}:host .wm-button.-icononly.dark:not(:disabled):not(.disabled):hover{color:var(--wmcolor-button-icon-icononly-hover-ondark);background:var(--wmcolor-button-background-icononly-hover-ondark);border-color:transparent}:host .wm-button.-navigational{border:none !important;background-color:var(--wmcolor-button-background-navigational)}:host .wm-button.-navigational:not(.dark):not(:disabled):not(.disabled){color:var(--wmcolor-button-icon-navigational)}:host .wm-button.-navigational:not(.dark):not(:disabled):not(.disabled):hover,:host .wm-button.-navigational:not(.dark):not(:disabled):not(.disabled).selected{background-color:var(--wmcolor-button-background-navigational-hover)}:host .wm-button.-navigational:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:host .wm-button.-navigational.dark:not(:disabled):not(.disabled){color:var(--wmcolor-button-icon-navigational-ondark);background:var(--wmcolor-button-background-navigational-ondark)}:host .wm-button.-navigational.dark:not(:disabled):not(.disabled):hover{color:var(--wmcolor-button-icon-navigational-hover-ondark);background:var(--wmcolor-button-background-navigational-hover-ondark)}:host .wm-button.-permanentlydelete:not(.-textonly){background:var(--wmcolor-button-background-delete);border-color:var(--wmcolor-button-background-delete);color:var(--wmcolor-button-text-delete)}:host .wm-button.-permanentlydelete:not(.-textonly):hover:not(:disabled):not(.disabled):not(.dark){background:var(--wmcolor-button-background-delete-hover);border-color:var(--wmcolor-button-background-delete-hover)}:host .wm-button.-permanentlydelete:not(.-textonly).dark:not(:disabled):not(.disabled){background:var(--wmcolor-button-background-delete);border-color:var(--wmcolor-button-background-delete);color:var(--wmcolor-button-text-delete)}:host .wm-button.-permanentlydelete:not(.-textonly).dark:not(:disabled):not(.disabled):hover{background:var(--wmcolor-button-background-delete-hover);border-color:var(--wmcolor-button-background-delete-hover)}:host .wm-button.-pairnegative{background:var(--wmcolor-button-background-negative);border-color:var(--wmcolor-button-background-negative);color:var(--wmcolor-button-text-negative)}:host .wm-button.-pairnegative:hover:not(:disabled):not(.disabled){background:var(--wmcolor-button-background-negative-hover);border-color:var(--wmcolor-button-background-negative-hover)}:host .wm-button.-pairpositive{background:var(--wmcolor-button-background-positive);border-color:var(--wmcolor-button-background-positive);color:var(--wmcolor-button-text-positive)}:host .wm-button.-pairpositive:hover:not(:disabled):not(.disabled){background:var(--wmcolor-button-background-positive-hover);border-color:var(--wmcolor-button-background-positive-hover)}:host .wm-button.-selector,:host .wm-button.-selector-primary{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;display:block;border-radius:3px;height:2.75rem;min-width:11.4375rem;padding:0 1.875rem 0 0.9375rem;line-height:normal;font-family:inherit;font-weight:700;font-size:0.75rem;text-transform:uppercase;letter-spacing:0.01875rem;text-align:left}@media screen and (min-width: 48rem){:host .wm-button.-selector,:host .wm-button.-selector-primary{height:2.5rem}}:host .wm-button.-selector:before,:host .wm-button.-selector-primary:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f140";position:absolute;right:0.5625rem;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);font-size:1.12rem;font-weight:700;pointer-events:none}:host .wm-button.-selector:active,:host .wm-button.-selector-primary:active{-ms-transform:scale(1, 1) !important;-webkit-transform:scale(1, 1) !important;transform:scale(1, 1) !important}:host .wm-button.-selector::-moz-focus-inner,:host .wm-button.-selector-primary::-moz-focus-inner{border:0}:host .wm-button.-selector .overflowcontrol,:host .wm-button.-selector-primary .overflowcontrol{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:visible}:host .wm-button.-selector{background:var(--wmcolor-button-background-selector);color:var(--wmcolor-button-text-selector);border-color:var(--wmcolor-button-border-selector)}:host .wm-button.-selector:hover:not(:disabled):not(.disabled){background:var(--wmcolor-button-background-selector-hover);color:var(--wmcolor-button-text-selector-hover);border-color:transparent}:host .wm-button.-selector.dark:not(:disabled):not(.disabled){color:var(--wmcolor-button-text-selector-ondark);border-color:var(--wmcolor-button-border-selector-ondark);background:var(--wmcolor-button-background-selector-ondark)}:host .wm-button.-selector.dark:not(:disabled):not(.disabled):hover{color:var(--wmcolor-button-text-selector-hover-ondark);background:var(--wmcolor-button-background-selector-hover-ondark);border-color:transparent}:host .wm-button.-selector-primary{background:var(--wmcolor-button-background-selectorprimary);color:var(--wmcolor-button-text-selectorprimary)}:host .wm-button.-selector-primary:hover:not(:disabled):not(.disabled){background:var(--wmcolor-button-background-selectorprimary-hover)}:host .wm-button.-selector-primary.dark:not(:disabled):not(.disabled){color:var(--wmcolor-button-text-selectorprimary-ondark);background:var(--wmcolor-button-background-selectorprimary-ondark)}:host .wm-button.-selector-primary.dark:not(:disabled):not(.disabled):hover{color:var(--wmcolor-button-text-selectorprimary-hover-ondark);background:var(--wmcolor-button-background-selectorprimary-hover-ondark)}:host .wm-button:disabled,:host .wm-button.disabled{cursor:default;pointer-events:none}:host .wm-button:disabled.-secondary:not(.-permanentlydelete),:host .wm-button.disabled.-secondary:not(.-permanentlydelete){-webkit-box-shadow:none;box-shadow:none;border-color:var(--wmcolor-button-border-secondary-disabled);color:var(--wmcolor-button-text-secondary-disabled)}:host .wm-button:disabled.-primary,:host .wm-button.disabled.-primary{background:var(--wmcolor-button-background-primary-disabled);color:var(--wmcolor-button-text-primary-disabled)}:host .wm-button:disabled.-permanentlydelete,:host .wm-button.disabled.-permanentlydelete{background:var(--wmcolor-button-background-delete-disabled);color:var(--wmcolor-button-text-delete-disabled);border-color:var(--wmcolor-button-background-delete-disabled)}:host .wm-button:disabled.-pairnegative,:host .wm-button.disabled.-pairnegative{background:var(--wmcolor-button-background-negative-disabled);border-color:var(--wmcolor-button-background-negative-disabled);color:var(--wmcolor-button-text-negative-disabled)}:host .wm-button:disabled.-pairpositive,:host .wm-button.disabled.-pairpositive{background:var(--wmcolor-button-background-positive-disabled);border-color:var(--wmcolor-button-background-positive-disabled);color:var(--wmcolor-button-text-positive-disabled)}:host .wm-button:disabled.-selector,:host .wm-button.disabled.-selector{color:var(--wmcolor-button-text-selector-disabled);border-color:var(--wmcolor-button-border-selector-disabled)}:host .wm-button:disabled.-selector-primary,:host .wm-button.disabled.-selector-primary{background:var(--wmcolor-button-background-selectorprimary-disabled);color:var(--wmcolor-button-text-selectorprimary-disabled)}:host .wm-button:disabled.-navigational,:host .wm-button.disabled.-navigational{color:var(--wmcolor-button-icon-navigational-disabled)}:host .wm-button:disabled.-icononly,:host .wm-button.disabled.-icononly{color:var(--wmcolor-button-icon-icononly-disabled);border-color:var(--wmcolor-button-border-icononly-disabled)}:host .wm-button:disabled.-textonly,:host .wm-button.disabled.-textonly{color:var(--wmcolor-button-text-textonly-disabled);background:transparent}:host .wm-button:disabled.dark.-icononly,:host .wm-button.disabled.dark.-icononly{background:transparent;color:var(--wmcolor-button-icon-icononly-disabled-ondark);border-color:var(--wmcolor-button-border-icononly-disabled-ondark)}:host .wm-button:disabled.dark.-navigational,:host .wm-button.disabled.dark.-navigational{color:var(--wmcolor-button-icon-navigational-disabled-ondark)}:host .wm-button:disabled.dark.-textonly,:host .wm-button.disabled.dark.-textonly{color:var(--wmcolor-button-text-textonly-disabled-ondark)}:host .wm-button:disabled.dark.-primary,:host .wm-button.disabled.dark.-primary{color:var(--wmcolor-button-text-primary-disabled-ondark);background:var(--wmcolor-button-background-primary-disabled-ondark)}:host .wm-button:disabled.dark.-secondary,:host .wm-button.disabled.dark.-secondary{background:transparent;color:var(--wmcolor-button-text-secondary-disabled-ondark);border-color:var(--wmcolor-button-border-secondary-disabled-ondark)}:host .wm-button:disabled.dark.-selector,:host .wm-button.disabled.dark.-selector{color:var(--wmcolor-button-text-selector-disabled-ondark);border-color:var(--wmcolor-button-border-selector-disabled-ondark);background:var(--wmcolor-button-background-selector-disabled-ondark)}:host .wm-button:disabled.dark.-selector-primary,:host .wm-button.disabled.dark.-selector-primary{color:var(--wmcolor-button-text-selectorprimary-disabled-ondark);background:var(--wmcolor-button-background-selectorprimary-disabled-ondark)}:host .wm-button:disabled.dark.-permanentlydelete:not(.-textonly),:host .wm-button.disabled.dark.-permanentlydelete:not(.-textonly){background:var(--wmcolor-button-background-delete-disabled-ondark);color:var(--wmcolor-button-text-delete-disabled-ondark)}:host a.wm-button,:host label.wm-button{height:auto;padding-top:0.75rem;padding-bottom:0.75rem}:host{width:100%;position:relative}:host[dir=RTL] .mdi{margin-left:0.3125rem;margin-right:0}:host input:focus+.wm-button.user-is-tabbing{-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-uploader-button-focus) !important;-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-uploader-button-focus) !important;box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-uploader-button-focus) !important}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}.header{position:relative;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-wrap:wrap;flex-wrap:wrap}.header .notif-wrapper{-ms-flex-align:end;align-items:flex-end}.notif-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;height:-moz-fit-content;height:-webkit-fit-content;height:fit-content;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.notif-wrapper .notif{font-size:0.875rem;font-style:italic;margin-top:0.25rem}@media (max-width: 60.9375rem){.descr{margin-bottom:0.5rem}.notif-wrapper{margin-bottom:1rem}.header .notif-wrapper{-ms-flex-align:start;align-items:flex-start}}.file-info{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.file-info+.file-controls{-ms-flex:none;flex:none;margin-left:1rem}.empty-block{margin:5rem auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.empty-block .upload-file{margin-bottom:1.875rem}.empty-block .empty-message{font-size:1.5rem;margin-bottom:0.4375rem}.empty-block .notif-wrapper{-ms-flex-pack:center;justify-content:center}.empty-block .notif-wrapper .wm-button{width:auto}ul{list-style:none;padding:0;width:100%}ul li{font-size:0.875rem}ul li .file{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;position:relative;height:3.75rem;padding:0.5rem 1.25rem;background:var(--wmcolor-file-background);border:1px solid var(--wmcolor-file-border);display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center}ul li .file+.file{margin-top:1.25rem}ul li .file .filename{font-weight:500}ul li .file .filedate{margin-left:3.75rem;font-weight:normal;font-style:italic}ul li .file wm-button+wm-button{margin-left:1rem}ul.file-list .file.--saved,ul.inprogress-list .file{margin-bottom:1.625rem}ul .progress{position:absolute;left:0;top:0;right:0;height:8px}ul.error-list li{margin-bottom:1.25rem;color:var(--wmcolor-text-error)}ul.error-list li .file{border:1px solid var(--wmcolor-file-border-error);background-color:var(--wmcolor-file-background-error);height:3.75rem}ul .error-message{padding-top:0.25rem;font-style:italic}';export{h as wm_network_uploader}
1
+ import{r as o,c as t,f as e,h as r,H as n,g as i}from"./p-b5bedd63.js";import{g as a,p as s,a as l,d}from"./p-a6d6eae7.js";import{g as b,i as c,x as m}from"./p-f0d87250.js";import{g as u}from"./p-8e001d5e.js";const h=class{constructor(e){o(this,e),this.wmNetworkUploaderFilesChanged=t(this,"wmNetworkUploaderFilesChanged",7),this.inputId=b(),this.isTabbing=!1,this.fileList=[],this.inProgressList=[],this.errorList=[],this.notif=void 0,this.snackbar=[],this.numFilesInProgress=void 0,this.getPath=void 0,this.requestUploadPath=void 0,this.uploadPath=void 0,this.requestDownloadPath=void 0,this.deletePath=void 0,this.associatedData=void 0,this.buttonText=void 0,this.emptyStateText=void 0,this.icon=void 0,this.fileTypes="pdf txt log xml doc docx xls xlsx ppt pptx gif jpg jpeg png csv",this.maxSize=100,this.maxFiles=void 0,this.sortBy="date"}toggleTabbingOn(){this.isTabbing=!0}toggleTabbingOff(){this.isTabbing=!1}handleUploadProgress(o){if(this.inProgressList.map((t=>{t.name===o.detail.file_name&&(t.progress=o.detail.progress,e(this.el))})),100===o.detail.progress&&(this.numFilesInProgress-=1),!this.srProgress&&this.numFilesInProgress){const o=this.numFilesInProgress;this.srProgress=setInterval((()=>{const t=this.inProgressList.reduce(((o,t)=>t.progress?o+t.progress:o),0);this.liveRegion&&(this.liveRegion.innerHTML=c.formatMessage({id:"uploader.uploadProgress",defaultMessage:"Upload progress: {percentage}%"},{percentage:Math.floor(t/o)}))}),5e3)}}handleFinishedSnack(o){this.snackbar=this.snackbar.filter((t=>t.id!==o.detail.id))}setMaxSize(){this.maxSize=this.maxSize>100?100:this.maxSize}uploadNotifications(o,t){if(t>0&&0===o){setTimeout((()=>{this.notif=null}),2e4);const o=c.formatMessage({id:"uploader.finishedUploading",defaultMessage:"Finished uploading"});this.notif={id:5,message:o},this.liveRegion&&(this.liveRegion.innerHTML=o),this.numFilesInProgress=null,clearInterval(this.srProgress),e(this.el)}else if(o>0&&o!=t){const t=c.formatMessage({id:"uploader.filesUploading",defaultMessage:"{num, plural, one {1 file uploading} other {# files uploading}}"},{num:o});this.notif={id:6,message:t},this.liveRegion&&(this.liveRegion.innerHTML=t),e(this.el)}}emitFileListEvent(){this.wmNetworkUploaderFilesChanged.emit(this.fileList)}formatDate(o,t,e){const r=Date.parse(o);if(!t.match(/^[a-zA-Z]*(-[a-zA-Z0-9]*)*$/g))return o;try{Intl.getCanonicalLocales(t)}catch(o){t="en-us"}if(r){const o=new Date(r);return`${o.getFullYear()}/${("0"+(o.getMonth()+1)).substr(-2)}/${("0"+o.getDate()).substr(-2)} ${o.toLocaleTimeString([t,"en-us"],{timeZone:e,hour:"numeric",minute:"numeric"})}`}return o}isValidSize(o){return o/1024/1024<=this.maxSize}isDuplicate(o){return this.fileList.find((t=>t.file_name===o))}isEmpty(){return!this.fileList.length&&!this.inProgressList.length&&!this.errorList.length}get isDisabled(){const o=!!this.maxFiles&&this.fileList.length>=this.maxFiles;if(this.notif)1===this.notif.id&&(o||(this.notif=null));else if(o){const o=c.formatMessage({id:"uploader.fileUploadLimitExceeded",defaultMessage:"Upload unsuccessful because file selection would exceed the maximum number of files",description:"Message displayed when trying to upload too many files"});this.notif={id:1,message:o},this.liveRegion&&(this.liveRegion.innerHTML=o)}else this.notif=null;return o||this.numFilesInProgress>0}purgeProgressList(o){this.inProgressList=this.inProgressList.filter((t=>100!==t.progress&&t.name!==o.file_name))}getExistingFiles(){a(this.getPath).then((o=>{o.map((o=>this.purgeProgressList(o))),"name"===this.sortBy&&o.sort(((o,t)=>o.file_name.localeCompare(t.file_name))),this.fileList=o})).catch((o=>{console.error(o)}))}clearErrors(){this.errorList=[],this.notif=null}handleFiles(o){const t=Array.from(o.target.files),r=this.fileTypes.split(" ").join(", ");if(this.maxFiles&&this.fileList.length+t.length>this.maxFiles){const o=c.formatMessage({id:"uploader.fileUploadLimitExceeded",defaultMessage:"Upload unsuccessful because file selection would exceed the maximum number of files",description:"Message displayed when trying to upload too many files"});this.notif={id:2,message:o},this.liveRegion&&(this.liveRegion.innerHTML=o)}else t&&t.map((o=>{if(m(o,this.fileTypes))if(this.isValidSize(o.size))if(this.isDuplicate(o.name)){const t={file_name:o.name,message:c.formatMessage({id:"uploader.duplicateName",defaultMessage:"A file with this name already exists."})};this.errorList.push(t)}else this.inProgressList.push(o);else{const t={file_name:o.name,message:c.formatMessage({id:"uploader.fileTooLarge",defaultMessage:"The selected file is too large. Maximum file size is {size}Mb"},{size:this.maxSize})};this.errorList.push(t)}else{const t={file_name:o.name,message:c.formatMessage({id:"uploader.invalidFileType",defaultMessage:"The file type is invalid. Accepted types: {validTypes}"},{validTypes:r})};this.errorList.push(t)}e(this.el)})),this.inProgressList.length>0&&(this.numFilesInProgress=this.inProgressList.length,this.inProgressList.map(((o,t)=>{this.uploadFile(o,t)})));o.target.value=""}uploadFile(o,t){a(this.requestUploadPath+t.toString()).then((async t=>{const e=JSON.parse(this.associatedData),r=Object.assign(Object.assign({},e),{file_name:o.name,mime_type:o.type,file_path:t.path,document_uuid:t.guid});await s(t.url,o,(t=>{const e=new CustomEvent("wmUploadProgress",{detail:{file_name:o.name,progress:t.lengthComputable&&0!==t.total?t.loaded/t.total*100:0}});this.el.dispatchEvent(e)})),await l(this.uploadPath,r),this.getExistingFiles()})).catch((o=>{this.numFilesInProgress=null,this.inProgressList=[],this.notif={id:3,message:u.genericError},console.error(o)}))}downloadFile(o,t){this.clearErrors(),l(this.requestDownloadPath,{file_path:t,file_uuid:o}).then((o=>{window.location.assign(o.url)})).catch((o=>{console.error(o)}))}deleteFile(o){this.clearErrors(),this.snackbar.push({message:c.formatMessage({id:"uploader.fileDeleted",defaultMessage:"{fileName} was deleted."},{fileName:o.file_name}),id:o.uuid,link:""}),this.fileList=this.fileList.filter((t=>t.uuid!==o.uuid)),d(`${this.deletePath}/${o.uuid}`).catch((t=>{this.notif={id:4,message:c.formatMessage({id:"uploader.fileNotDeleted",defaultMessage:"{fileName} could not be deleted."},{fileName:o.file_name})},this.getExistingFiles(),console.error(t)}))}componentWillLoad(){if(!this.getPath)throw new Error("wm-network-uploader: get-path is a required prop");if(!this.requestUploadPath)throw new Error("wm-network-uploader: request-upload-path is a required prop");if(!this.uploadPath)throw new Error("wm-network-uploader: upload-path is a required prop");if(!this.requestDownloadPath)throw new Error("wm-network-uploader: request-download-path is a required prop");if(!this.deletePath)throw new Error("wm-network-uploader: delete-path is a required prop");if(!this.buttonText)throw new Error("wm-network-uploader: button-text is a required prop");if(!this.emptyStateText)throw new Error("wm-network-uploader: empty-state-text is a required prop");if(!this.associatedData)throw new Error("wm-network-uploader: associated-data is a required prop");this.setMaxSize(),this.clearErrors()}componentDidLoad(){this.getExistingFiles(),document.body.classList.contains("wmcl-user-is-tabbing")&&this.toggleTabbingOn()}uploadButtonOnClick(o){if(this.isDisabled){if(o.preventDefault(),this.liveRegion){const o=!!this.maxFiles&&this.fileList.length>=this.maxFiles;let t="";this.numFilesInProgress>0?t=c.formatMessage({id:"uploader.waitToUpload",defaultMessage:"Please wait for current upload to complete before uploading new files.",description:"Message for screen reader users"}):o&&(t=c.formatMessage({id:"uploader.fileUploadLimitExceeded",defaultMessage:"Upload unsuccessful because file selection would exceed the maximum number of files",description:"Message displayed when trying to upload too many files"})),t&&(this.liveRegion.innerHTML="",new Promise((o=>{setTimeout((()=>{o("")}),500)})).then((()=>this.liveRegion.innerHTML=t)))}}else this.clearErrors()}renderUploadSvg(){return r("svg",{class:"upload-file",width:"91",height:"84",viewBox:"0 0 91 84"},r("path",{transform:"rotate(-180.000000) translate(-452, -255.5)",fill:"#eae8ec",d:"M361,249.681818 L361,197.318182 C361,194.118182 365.555061,191.5 371.122358,191.5 L391.316463,191.5 L391.286495,200.562515 L369.871211,200.600292 L369.885404,200.622146 L369.886423,246.655947 L443.657038,246.840767 L443.657038,200.622146 L421.683537,200.622146 L421.683537,191.5 L441.978865,191.5 C447.546162,191.5 452,194.118182 452,197.318182 L452,249.681818 C452,252.881818 447.546162,255.5 441.978865,255.5 L371.122358,255.5 C365.504449,255.5 361,252.881818 361,249.681818 Z M391.5,207 L406,221 L420.5,207 L409.625,207 L409.625,172 L402.375,172 L402.375,207 L391.5,207 Z"}))}renderIcon(){return this.icon&&r("span",{class:"mdi "+(this.icon&&"f066"===this.icon?"rotate":"")},String.fromCodePoint(parseInt(`0x${this.icon}`)))}renderNotif(){return this.notif?r("span",{class:"notif"},this.notif.message):""}renderUploadButton(o){return r("div",{class:"notif-wrapper"},r("input",{name:this.inputId,id:this.inputId,class:"sr-only",type:"file",multiple:!0,onClick:o=>this.uploadButtonOnClick(o),onChange:o=>this.handleFiles(o)}),r("label",{htmlFor:this.inputId,class:`wm-button ${o}${this.isTabbing?" user-is-tabbing":""}`},this.renderIcon(),this.buttonText),this.renderNotif())}renderWithItems(){return r("div",null,r("div",{class:"header"},r("div",{class:"descr"},r("slot",null)),this.renderUploadButton(this.isDisabled?"disabled":"")),this.renderErrorList(),this.renderInProgressList(),this.renderFileList())}renderEmptyState(){return r("div",null,r("div",{class:"header"},r("div",{class:"descr"},r("slot",null))),r("div",{class:"empty-block"},this.renderUploadSvg(),r("div",{class:"empty-message"},this.emptyStateText),this.renderUploadButton("-primary empty-button")))}renderErrorList(){if(this.errorList.length){if(this.liveRegion){let o=this.errorList.reduce((function(o,t){return o+`${t.file_name}: ${t.message} `}),"");this.liveRegion.innerHTML=o}return r("ul",{class:"error-list"},this.errorList.map((o=>r("li",null,r("div",{class:"file --error"},r("div",{class:"file-info"},r("span",{class:"filename"},o.file_name))),r("div",{class:"error-message"},o.message)))))}}renderInProgressList(){return r("ul",{class:"inprogress-list"},this.inProgressList.map((o=>r("li",null,r("div",{class:"file --progress"},r("div",{class:"progress",style:{background:`linear-gradient(to right, rgba(67, 126, 142, 1) ${o.progress}%, transparent ${o.progress}%)`}}),r("div",{class:"file-info"},r("span",{class:"filename"},o.name," ",r("span",{class:"sr-only"},"uploading"))))))))}renderFile(o){return r("li",null,r("div",{class:"file --saved"},r("div",{class:"file-info"},r("span",{class:"filename"},o.file_name),r("span",{class:"filedate"},this.formatDate(o.updated_at,c.locale,Intl.DateTimeFormat().resolvedOptions().timeZone))),r("div",{class:"file-controls"},r("wm-button",{class:"download-button","button-type":"icononly",tooltip:"download","label-for-identical-buttons":`download ${o.file_name}`,icon:"f1da",onClick:()=>this.downloadFile(o.uuid,o.file_path)}),r("wm-button",{class:"delete-button","button-type":"icononly",tooltip:"remove","label-for-identical-buttons":`remove ${o.file_name}`,icon:"f1c0",onClick:()=>this.deleteFile(o)}))))}renderFileList(){return r("ul",{class:"file-list"},this.fileList.map((o=>this.renderFile(o))))}render(){return r(n,null,this.isEmpty()?this.renderEmptyState():this.renderWithItems(),r("wm-snackbar",{notifications:JSON.stringify(this.snackbar)}),r("div",{ref:o=>this.liveRegion=o,class:"live-region sr-only","aria-live":"assertive","aria-atomic":"true"}))}get el(){return i(this)}static get watchers(){return{maxSize:["setMaxSize"],numFilesInProgress:["uploadNotifications"],fileList:["emitFileListEvent"]}}};h.style=':host .wm-button{-ms-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1), border 500ms cubic-bezier(0.4, 0, 0.2, 1);-webkit-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1), border 500ms cubic-bezier(0.4, 0, 0.2, 1);-moz-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1), border 500ms cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1), border 500ms cubic-bezier(0.4, 0, 0.2, 1);-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;border-radius:5px;width:100%;border:2px solid transparent;font-family:inherit;font-size:0.75rem;font-weight:700;min-height:2.75rem;padding:12px 1.3333333333em;cursor:pointer;position:relative;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-decoration:none;text-transform:uppercase;letter-spacing:0.01875rem;overflow-wrap:break-word;-webkit-box-shadow:none;box-shadow:none}@media screen and (min-width: 48rem){:host .wm-button{min-height:3.3333333333em}}:host .wm-button.nowrap{display:inline-block;width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host .wm-button:focus{outline:none;-webkit-box-shadow:none;box-shadow:none}:host .wm-button::-moz-focus-inner{border:0;outline:none}:host .wm-button.user-is-tabbing:focus:not(.-textonly):not(:disabled):not(.disabled):not(.dark){-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus);box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus)}:host .wm-button.user-is-tabbing:focus:not(.-textonly):not(:disabled):not(.disabled):not(.dark)::-moz-focus-inner{border:0}:host .wm-button.dark.user-is-tabbing:focus:not(.-textonly):not(:disabled):not(.disabled).dark{-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus-ondark);-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus-ondark);box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-interactive-focus-ondark);outline:none}:host .wm-button:active:not(:disabled):not(.disabled):not(.-textonly):not(.-actionbutton):not(.displayedoption){-ms-transform:scale(0.9, 0.9);-webkit-transform:scale(0.9, 0.9);-moz-transform:scale(0.9, 0.9);transform:scale(0.9, 0.9)}:host .wm-button .mdi{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:host .wm-button:not(.-icononly):not(.-navigational) .mdi{margin-right:0.3125rem;font-size:0.875rem}:host .wm-button[dir=RTL] :not(.-icononly) .mdi{margin-left:0.3125rem;margin-right:0}:host .wm-button.-primary:not(.-textonly){background:var(--wmcolor-button-background-primary);color:var(--wmcolor-button-text-primary)}:host .wm-button.-primary:not(.-textonly):not(:focus){-webkit-box-shadow:0 0 4px 0 rgba(0, 0, 0, 0.14), 0 3px 4px 0 rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);box-shadow:0 0 4px 0 rgba(0, 0, 0, 0.14), 0 3px 4px 0 rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2)}:host .wm-button.-primary:not(.-textonly):hover:not(:disabled):not(.disabled){background:var(--wmcolor-button-background-primary-hover)}:host .wm-button.-primary:not(.-textonly).dark:not(:disabled):not(.disabled){color:var(--wmcolor-button-text-primary-ondark);background:var(--wmcolor-button-background-primary-ondark)}:host .wm-button.-primary:not(.-textonly).dark:not(:disabled):not(.disabled):hover{background:var(--wmcolor-button-background-primary-hover-ondark)}:host .wm-button.-secondary{color:var(--wmcolor-button-text-secondary);border:2px solid var(--wmcolor-button-border-secondary);background:var(--wmcolor-button-background-secondary)}:host .wm-button.-secondary:hover:not(:disabled):not(.disabled){background:var(--wmcolor-button-background-secondary-hover);color:var(--wmcolor-button-text-secondary-hover);border-color:transparent}:host .wm-button.-secondary.dark:not(:disabled):not(.disabled){color:var(--wmcolor-button-text-secondary-ondark);background:var(--wmcolor-button-background-secondary-ondark);border-color:var(--wmcolor-button-border-secondary-ondark)}:host .wm-button.-secondary.dark:not(:disabled):not(.disabled):hover{color:var(--wmcolor-button-text-secondary-hover-ondark);background:var(--wmcolor-button-background-secondary-hover-ondark);border-color:transparent}:host .wm-button.-textonly{color:var(--wmcolor-button-text-textonly);-webkit-box-shadow:none;box-shadow:none;display:inline-block;letter-spacing:0;text-transform:none;text-align:initial;font-size:0.875rem;border:none;background:transparent;padding:0;height:auto;min-height:unset;border-radius:0;line-height:1;overflow-wrap:anywhere}:host .wm-button.-textonly+.-textonly{margin-left:0.3125rem}:host .wm-button.-textonly:focus{outline:none}:host .wm-button.-textonly::-moz-focus-inner{border:0;outline:none}:host .wm-button.-textonly.user-is-tabbing:focus:not(:disabled):not(.disabled) .button-text{background:-webkit-gradient(linear, left top, right top, color-stop(66%, var(--wmcolor-interactive-focus-textonly)), color-stop(0, transparent)) repeat-x;background:linear-gradient(90deg, var(--wmcolor-interactive-focus-textonly) 66%, transparent 0) repeat-x;background-size:6px 3px;background-position:0 1em;border-radius:0;line-height:normal}:host .wm-button.-textonly.user-is-tabbing:focus:not(:disabled):not(.disabled).dark .button-text{background:-webkit-gradient(linear, left top, right top, color-stop(66%, var(--wmcolor-interactive-focus-textonly-ondark)), color-stop(0, transparent)) repeat-x;background:linear-gradient(90deg, var(--wmcolor-interactive-focus-textonly-ondark) 66%, transparent 0) repeat-x;background-size:6px 3px;background-position:0 1em;border-radius:0;line-height:normal}:host .wm-button.-textonly.small{font-size:0.625rem}:host .wm-button.-textonly:hover:not(:disabled):not(.disabled):not(.-permanentlydelete){text-decoration:underline}:host .wm-button.-textonly.dark{color:var(--wmcolor-button-text-textonly-ondark)}:host .wm-button.-textonly.dark:hover:not(:disabled):not(.disabled){text-decoration:underline}:host .wm-button.-textonly.-permanentlydelete{color:var(--wmcolor-button-background-delete)}:host .wm-button.-textonly.-permanentlydelete:hover:not(:disabled):not(.disabled):not(.dark){text-decoration:underline}:host .wm-button.-textonly.-permanentlydelete.dark:not(:disabled):not(.disabled){color:var(--wmcolor-button-text-textonly-ondark)}:host .wm-button.-icononly,:host .wm-button.-navigational{-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%;font-size:1rem;padding:0;height:auto;line-height:1;min-width:2.75rem;min-height:2.75rem;text-align:center;letter-spacing:normal}:host .wm-button.-icononly:not(:focus),:host .wm-button.-navigational:not(:focus){-webkit-box-shadow:none;box-shadow:none}@media screen and (min-width: 48rem){:host .wm-button.-icononly,:host .wm-button.-navigational{min-width:2.5rem;min-height:2.5rem}}:host .wm-button.-icononly .mdi,:host .wm-button.-navigational .mdi{font-size:1.12rem}:host .wm-button.-icononly{border-width:1px !important;color:var(--wmcolor-button-icon-icononly);border-color:var(--wmcolor-button-border-icononly);background-color:var(--wmcolor-button-background-icononly)}:host .wm-button.-icononly:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:host .wm-button.-icononly:hover:not(:disabled):not(.disabled){background:var(--wmcolor-button-background-icononly-hover);color:var(--wmcolor-button-icon-icononly-hover);border-color:transparent}:host .wm-button.-icononly.dark:not(:disabled):not(.disabled){color:var(--wmcolor-button-icon-icononly-ondark);background:var(--wmcolor-button-background-icononly-ondark);border-color:var(--wmcolor-button-border-icononly-ondark)}:host .wm-button.-icononly.dark:not(:disabled):not(.disabled):hover{color:var(--wmcolor-button-icon-icononly-hover-ondark);background:var(--wmcolor-button-background-icononly-hover-ondark);border-color:transparent}:host .wm-button.-navigational{border:none !important;background-color:var(--wmcolor-button-background-navigational)}:host .wm-button.-navigational:not(.dark):not(:disabled):not(.disabled){color:var(--wmcolor-button-icon-navigational)}:host .wm-button.-navigational:not(.dark):not(:disabled):not(.disabled):hover,:host .wm-button.-navigational:not(.dark):not(:disabled):not(.disabled).selected{background-color:var(--wmcolor-button-background-navigational-hover)}:host .wm-button.-navigational:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}:host .wm-button.-navigational.dark:not(:disabled):not(.disabled){color:var(--wmcolor-button-icon-navigational-ondark);background:var(--wmcolor-button-background-navigational-ondark)}:host .wm-button.-navigational.dark:not(:disabled):not(.disabled):hover{color:var(--wmcolor-button-icon-navigational-hover-ondark);background:var(--wmcolor-button-background-navigational-hover-ondark)}:host .wm-button.-permanentlydelete:not(.-textonly){background:var(--wmcolor-button-background-delete);border-color:var(--wmcolor-button-background-delete);color:var(--wmcolor-button-text-delete)}:host .wm-button.-permanentlydelete:not(.-textonly):hover:not(:disabled):not(.disabled):not(.dark){background:var(--wmcolor-button-background-delete-hover);border-color:var(--wmcolor-button-background-delete-hover)}:host .wm-button.-permanentlydelete:not(.-textonly).dark:not(:disabled):not(.disabled){background:var(--wmcolor-button-background-delete);border-color:var(--wmcolor-button-background-delete);color:var(--wmcolor-button-text-delete)}:host .wm-button.-permanentlydelete:not(.-textonly).dark:not(:disabled):not(.disabled):hover{background:var(--wmcolor-button-background-delete-hover);border-color:var(--wmcolor-button-background-delete-hover)}:host .wm-button.-pairnegative{background:var(--wmcolor-button-background-negative);border-color:var(--wmcolor-button-background-negative);color:var(--wmcolor-button-text-negative)}:host .wm-button.-pairnegative:hover:not(:disabled):not(.disabled){background:var(--wmcolor-button-background-negative-hover);border-color:var(--wmcolor-button-background-negative-hover)}:host .wm-button.-pairpositive{background:var(--wmcolor-button-background-positive);border-color:var(--wmcolor-button-background-positive);color:var(--wmcolor-button-text-positive)}:host .wm-button.-pairpositive:hover:not(:disabled):not(.disabled){background:var(--wmcolor-button-background-positive-hover);border-color:var(--wmcolor-button-background-positive-hover)}:host .wm-button.-selector,:host .wm-button.-selector-primary{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;display:block;border-radius:3px;height:2.75rem;min-width:11.4375rem;padding:0 1.875rem 0 0.9375rem;line-height:normal;font-family:inherit;font-weight:700;font-size:0.75rem;text-transform:uppercase;letter-spacing:0.01875rem;text-align:left}@media screen and (min-width: 48rem){:host .wm-button.-selector,:host .wm-button.-selector-primary{height:2.5rem}}:host .wm-button.-selector:before,:host .wm-button.-selector-primary:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f140";position:absolute;right:0.5625rem;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);font-size:1.12rem;font-weight:700;pointer-events:none}:host .wm-button.-selector:active,:host .wm-button.-selector-primary:active{-ms-transform:scale(1, 1) !important;-webkit-transform:scale(1, 1) !important;transform:scale(1, 1) !important}:host .wm-button.-selector::-moz-focus-inner,:host .wm-button.-selector-primary::-moz-focus-inner{border:0}:host .wm-button.-selector .overflowcontrol,:host .wm-button.-selector-primary .overflowcontrol{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:visible}:host .wm-button.-selector{background:var(--wmcolor-button-background-selector);color:var(--wmcolor-button-text-selector);border-color:var(--wmcolor-button-border-selector)}:host .wm-button.-selector:hover:not(:disabled):not(.disabled){background:var(--wmcolor-button-background-selector-hover);color:var(--wmcolor-button-text-selector-hover);border-color:transparent}:host .wm-button.-selector.dark:not(:disabled):not(.disabled){color:var(--wmcolor-button-text-selector-ondark);border-color:var(--wmcolor-button-border-selector-ondark);background:var(--wmcolor-button-background-selector-ondark)}:host .wm-button.-selector.dark:not(:disabled):not(.disabled):hover{color:var(--wmcolor-button-text-selector-hover-ondark);background:var(--wmcolor-button-background-selector-hover-ondark);border-color:transparent}:host .wm-button.-selector-primary{background:var(--wmcolor-button-background-selectorprimary);color:var(--wmcolor-button-text-selectorprimary)}:host .wm-button.-selector-primary:hover:not(:disabled):not(.disabled){background:var(--wmcolor-button-background-selectorprimary-hover)}:host .wm-button.-selector-primary.dark:not(:disabled):not(.disabled){color:var(--wmcolor-button-text-selectorprimary-ondark);background:var(--wmcolor-button-background-selectorprimary-ondark)}:host .wm-button.-selector-primary.dark:not(:disabled):not(.disabled):hover{color:var(--wmcolor-button-text-selectorprimary-hover-ondark);background:var(--wmcolor-button-background-selectorprimary-hover-ondark)}:host .wm-button:disabled,:host .wm-button.disabled{cursor:default;pointer-events:none}:host .wm-button:disabled.-secondary:not(.-permanentlydelete),:host .wm-button.disabled.-secondary:not(.-permanentlydelete){-webkit-box-shadow:none;box-shadow:none;border-color:var(--wmcolor-button-border-secondary-disabled);color:var(--wmcolor-button-text-secondary-disabled)}:host .wm-button:disabled.-primary,:host .wm-button.disabled.-primary{background:var(--wmcolor-button-background-primary-disabled);color:var(--wmcolor-button-text-primary-disabled)}:host .wm-button:disabled.-permanentlydelete,:host .wm-button.disabled.-permanentlydelete{background:var(--wmcolor-button-background-delete-disabled);color:var(--wmcolor-button-text-delete-disabled);border-color:var(--wmcolor-button-background-delete-disabled)}:host .wm-button:disabled.-pairnegative,:host .wm-button.disabled.-pairnegative{background:var(--wmcolor-button-background-negative-disabled);border-color:var(--wmcolor-button-background-negative-disabled);color:var(--wmcolor-button-text-negative-disabled)}:host .wm-button:disabled.-pairpositive,:host .wm-button.disabled.-pairpositive{background:var(--wmcolor-button-background-positive-disabled);border-color:var(--wmcolor-button-background-positive-disabled);color:var(--wmcolor-button-text-positive-disabled)}:host .wm-button:disabled.-selector,:host .wm-button.disabled.-selector{color:var(--wmcolor-button-text-selector-disabled);border-color:var(--wmcolor-button-border-selector-disabled)}:host .wm-button:disabled.-selector-primary,:host .wm-button.disabled.-selector-primary{background:var(--wmcolor-button-background-selectorprimary-disabled);color:var(--wmcolor-button-text-selectorprimary-disabled)}:host .wm-button:disabled.-navigational,:host .wm-button.disabled.-navigational{color:var(--wmcolor-button-icon-navigational-disabled)}:host .wm-button:disabled.-icononly,:host .wm-button.disabled.-icononly{color:var(--wmcolor-button-icon-icononly-disabled);border-color:var(--wmcolor-button-border-icononly-disabled)}:host .wm-button:disabled.-textonly,:host .wm-button.disabled.-textonly{color:var(--wmcolor-button-text-textonly-disabled);background:transparent}:host .wm-button:disabled.dark.-icononly,:host .wm-button.disabled.dark.-icononly{background:transparent;color:var(--wmcolor-button-icon-icononly-disabled-ondark);border-color:var(--wmcolor-button-border-icononly-disabled-ondark)}:host .wm-button:disabled.dark.-navigational,:host .wm-button.disabled.dark.-navigational{color:var(--wmcolor-button-icon-navigational-disabled-ondark)}:host .wm-button:disabled.dark.-textonly,:host .wm-button.disabled.dark.-textonly{color:var(--wmcolor-button-text-textonly-disabled-ondark)}:host .wm-button:disabled.dark.-primary,:host .wm-button.disabled.dark.-primary{color:var(--wmcolor-button-text-primary-disabled-ondark);background:var(--wmcolor-button-background-primary-disabled-ondark)}:host .wm-button:disabled.dark.-secondary,:host .wm-button.disabled.dark.-secondary{background:transparent;color:var(--wmcolor-button-text-secondary-disabled-ondark);border-color:var(--wmcolor-button-border-secondary-disabled-ondark)}:host .wm-button:disabled.dark.-selector,:host .wm-button.disabled.dark.-selector{color:var(--wmcolor-button-text-selector-disabled-ondark);border-color:var(--wmcolor-button-border-selector-disabled-ondark);background:var(--wmcolor-button-background-selector-disabled-ondark)}:host .wm-button:disabled.dark.-selector-primary,:host .wm-button.disabled.dark.-selector-primary{color:var(--wmcolor-button-text-selectorprimary-disabled-ondark);background:var(--wmcolor-button-background-selectorprimary-disabled-ondark)}:host .wm-button:disabled.dark.-permanentlydelete:not(.-textonly),:host .wm-button.disabled.dark.-permanentlydelete:not(.-textonly){background:var(--wmcolor-button-background-delete-disabled-ondark);color:var(--wmcolor-button-text-delete-disabled-ondark)}:host a.wm-button,:host label.wm-button{height:auto;padding-top:0.75rem;padding-bottom:0.75rem}:host{width:100%;position:relative}:host[dir=RTL] .mdi{margin-left:0.3125rem;margin-right:0}:host input:focus+.wm-button.user-is-tabbing{-webkit-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-uploader-button-focus) !important;-moz-box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-uploader-button-focus) !important;box-shadow:0 2px 2px 0 rgba(244, 243, 246, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.1), 0 0 4px 3px var(--wmcolor-uploader-button-focus) !important}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}.header{position:relative;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-wrap:wrap;flex-wrap:wrap}.header .notif-wrapper{-ms-flex-align:end;align-items:flex-end}.notif-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;height:-moz-fit-content;height:-webkit-fit-content;height:fit-content;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.notif-wrapper .notif{font-size:0.875rem;font-style:italic;margin-top:0.25rem}@media (max-width: 60.9375rem){.descr{margin-bottom:0.5rem}.notif-wrapper{margin-bottom:1rem}.header .notif-wrapper{-ms-flex-align:start;align-items:flex-start}}.file-info{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.file-info+.file-controls{-ms-flex:none;flex:none;margin-left:1rem}.empty-block{margin:5rem auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.empty-block .upload-file{margin-bottom:1.875rem}.empty-block .empty-message{font-size:1.5rem;margin-bottom:0.4375rem}.empty-block .notif-wrapper{-ms-flex-pack:center;justify-content:center}.empty-block .notif-wrapper .wm-button{width:auto}ul{list-style:none;padding:0;width:100%}ul li{font-size:0.875rem}ul li .file{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;position:relative;height:3.75rem;padding:0.5rem 1.25rem;background:var(--wmcolor-file-background);border:1px solid var(--wmcolor-file-border);display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center}ul li .file+.file{margin-top:1.25rem}ul li .file .filename{font-weight:500}ul li .file .filedate{margin-left:3.75rem;font-weight:normal;font-style:italic}ul li .file wm-button+wm-button{margin-left:1rem}ul.file-list .file.--saved,ul.inprogress-list .file{margin-bottom:1.625rem}ul .progress{position:absolute;left:0;top:0;right:0;height:8px}ul.error-list li{margin-bottom:1.25rem;color:var(--wmcolor-text-error)}ul.error-list li .file{border:1px solid var(--wmcolor-file-border-error);background-color:var(--wmcolor-file-background-error);height:3.75rem}ul .error-message{padding-top:0.25rem;font-style:italic}';export{h as wm_network_uploader}