@mmlogic/components 0.5.1 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/dist/cjs/cell-renderer-7KX9Qbml.js +983 -0
  2. package/dist/cjs/{client-layout-RZ3Ix-4a.js → client-layout-CqVuJumR.js} +9 -0
  3. package/dist/cjs/{index-DzRfoAPz.js → index-DVbdkYO3.js} +468 -6
  4. package/dist/cjs/index.cjs.js +4 -1
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/mosterdcomponents.cjs.js +2 -2
  7. package/dist/cjs/{mrd-boolean-field_23.cjs.entry.js → mrd-boolean-field_25.cjs.entry.js} +3017 -951
  8. package/dist/cjs/mrd-merge-view.cjs.entry.js +273 -0
  9. package/dist/collection/collection-manifest.json +3 -0
  10. package/dist/collection/components/documents/mrd-document-view/mrd-document-view.js +7 -8
  11. package/dist/collection/components/email/mrd-email-view/mrd-email-view.css +126 -0
  12. package/dist/collection/components/email/mrd-email-view/mrd-email-view.js +247 -0
  13. package/dist/collection/components/fields/file-upload-common.js +23 -7
  14. package/dist/collection/components/fields/mrd-boolean-field/mrd-boolean-field.js +1 -1
  15. package/dist/collection/components/fields/mrd-currency-field/mrd-currency-field.js +1 -1
  16. package/dist/collection/components/fields/mrd-date-field/mrd-date-field.js +1 -1
  17. package/dist/collection/components/fields/mrd-datetime-field/mrd-datetime-field.js +1 -1
  18. package/dist/collection/components/fields/mrd-email-field/mrd-email-field.js +1 -1
  19. package/dist/collection/components/fields/mrd-file-field/mrd-file-field.css +20 -1
  20. package/dist/collection/components/fields/mrd-file-field/mrd-file-field.js +108 -47
  21. package/dist/collection/components/fields/mrd-image-field/mrd-image-field.css +44 -0
  22. package/dist/collection/components/fields/mrd-image-field/mrd-image-field.js +126 -58
  23. package/dist/collection/components/fields/mrd-longtext-field/mrd-longtext-field.js +1 -1
  24. package/dist/collection/components/fields/mrd-number-field/mrd-number-field.js +1 -1
  25. package/dist/collection/components/fields/mrd-secret-field/mrd-secret-field.js +2 -2
  26. package/dist/collection/components/fields/mrd-text-field/mrd-text-field.js +1 -1
  27. package/dist/collection/components/fields/mrd-textarea-field/mrd-textarea-field.js +9 -5
  28. package/dist/collection/components/fields/mrd-time-field/mrd-time-field.js +1 -1
  29. package/dist/collection/components/form/mrd-field/mrd-field.js +5 -5
  30. package/dist/collection/components/form/mrd-form/mrd-form.js +55 -6
  31. package/dist/collection/components/invoice/mrd-invoice-view/mrd-invoice-view.css +145 -0
  32. package/dist/collection/components/invoice/mrd-invoice-view/mrd-invoice-view.js +281 -0
  33. package/dist/collection/components/layout/mrd-layout-section/field-value.js +5 -1
  34. package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.css +10 -0
  35. package/dist/collection/components/layout/mrd-layout-section/mrd-layout-section.js +38 -8
  36. package/dist/collection/components/merge/mrd-merge-view/merge-diff.js +99 -0
  37. package/dist/collection/components/merge/mrd-merge-view/merge-parts.js +44 -0
  38. package/dist/collection/components/merge/mrd-merge-view/mrd-merge-view.css +244 -0
  39. package/dist/collection/components/merge/mrd-merge-view/mrd-merge-view.js +397 -0
  40. package/dist/collection/dev/api.js +41 -2
  41. package/dist/collection/dev/app.js +135 -17
  42. package/dist/collection/dev/example-data.js +126 -2
  43. package/dist/collection/types/client-layout.js +6 -0
  44. package/dist/collection/utils/cell-renderer.js +6 -1
  45. package/dist/collection/utils/document-attachments.js +27 -14
  46. package/dist/collection/utils/i18n.js +224 -0
  47. package/dist/components/cell-renderer.js +1 -0
  48. package/dist/components/client-layout.js +1 -1
  49. package/dist/components/document-attachments.js +1 -1
  50. package/dist/components/file-upload-common.js +1 -1
  51. package/dist/components/format.js +1 -1
  52. package/dist/components/i18n.js +1 -1
  53. package/dist/components/index.js +1 -1
  54. package/dist/components/mrd-boolean-field2.js +1 -1
  55. package/dist/components/mrd-currency-field2.js +1 -1
  56. package/dist/components/mrd-date-field2.js +1 -1
  57. package/dist/components/mrd-datetime-field2.js +1 -1
  58. package/dist/components/mrd-document-view2.js +1 -1
  59. package/dist/components/mrd-email-field2.js +1 -1
  60. package/dist/components/mrd-email-view.d.ts +11 -0
  61. package/dist/components/mrd-email-view.js +1 -0
  62. package/dist/components/mrd-email-view2.js +1 -0
  63. package/dist/components/mrd-field2.js +1 -1
  64. package/dist/components/mrd-file-field2.js +1 -1
  65. package/dist/components/mrd-form.js +1 -1
  66. package/dist/components/mrd-image-field2.js +1 -1
  67. package/dist/components/mrd-invoice-view.d.ts +11 -0
  68. package/dist/components/mrd-invoice-view.js +1 -0
  69. package/dist/components/mrd-invoice-view2.js +1 -0
  70. package/dist/components/mrd-layout-section.js +1 -1
  71. package/dist/components/mrd-longtext-field2.js +1 -1
  72. package/dist/components/mrd-merge-view.d.ts +11 -0
  73. package/dist/components/mrd-merge-view.js +1 -0
  74. package/dist/components/mrd-number-field2.js +1 -1
  75. package/dist/components/mrd-secret-field2.js +1 -1
  76. package/dist/components/mrd-table2.js +1 -1
  77. package/dist/components/mrd-text-field2.js +1 -1
  78. package/dist/components/mrd-textarea-field2.js +1 -1
  79. package/dist/components/mrd-time-field2.js +1 -1
  80. package/dist/components/purify.es.js +2 -0
  81. package/dist/esm/cell-renderer-DIsNX9D7.js +974 -0
  82. package/dist/esm/{client-layout-DCOAAH92.js → client-layout-Bc42CfJB.js} +7 -1
  83. package/dist/esm/{index-DiSe6vjv.js → index-CDiBvvJU.js} +468 -6
  84. package/dist/esm/index.js +1 -1
  85. package/dist/esm/loader.js +3 -3
  86. package/dist/esm/mosterdcomponents.js +3 -3
  87. package/dist/esm/{mrd-boolean-field_23.entry.js → mrd-boolean-field_25.entry.js} +2949 -885
  88. package/dist/esm/mrd-merge-view.entry.js +271 -0
  89. package/dist/mosterdcomponents/index.esm.js +1 -1
  90. package/dist/mosterdcomponents/mosterdcomponents.esm.js +1 -1
  91. package/dist/mosterdcomponents/p-4e061416.entry.js +1 -0
  92. package/dist/mosterdcomponents/p-910ebfee.entry.js +3 -0
  93. package/dist/mosterdcomponents/{p-DCOAAH92.js → p-Bc42CfJB.js} +1 -1
  94. package/dist/mosterdcomponents/p-CDiBvvJU.js +2 -0
  95. package/dist/mosterdcomponents/p-Ce2QDq0t.js +1 -0
  96. package/dist/types/components/documents/mrd-document-view/mrd-document-view.d.ts +2 -2
  97. package/dist/types/components/email/mrd-email-view/mrd-email-view.d.ts +52 -0
  98. package/dist/types/components/fields/file-upload-common.d.ts +19 -1
  99. package/dist/types/components/fields/mrd-file-field/mrd-file-field.d.ts +24 -10
  100. package/dist/types/components/fields/mrd-image-field/mrd-image-field.d.ts +27 -11
  101. package/dist/types/components/fields/mrd-textarea-field/mrd-textarea-field.d.ts +1 -0
  102. package/dist/types/components/form/mrd-form/mrd-form.d.ts +16 -1
  103. package/dist/types/components/invoice/mrd-invoice-view/mrd-invoice-view.d.ts +60 -0
  104. package/dist/types/components/layout/mrd-layout-section/mrd-layout-section.d.ts +13 -0
  105. package/dist/types/components/merge/mrd-merge-view/merge-diff.d.ts +43 -0
  106. package/dist/types/components/merge/mrd-merge-view/merge-parts.d.ts +37 -0
  107. package/dist/types/components/merge/mrd-merge-view/mrd-merge-view.d.ts +68 -0
  108. package/dist/types/components.d.ts +445 -19
  109. package/dist/types/types/client-layout.d.ts +6 -0
  110. package/dist/types/utils/document-attachments.d.ts +12 -5
  111. package/package.json +2 -1
  112. package/dist/mosterdcomponents/p-DiSe6vjv.js +0 -2
  113. package/dist/mosterdcomponents/p-cdecc698.entry.js +0 -1
@@ -1 +1 @@
1
- import{proxyCustomElement as r,HTMLElement as e,createEvent as i,h as d,Host as t,transformTag as s}from"@stencil/core/internal/client";import{t as a}from"./i18n.js";import{e as o,v as l,F as m,c as n,a as c}from"./field-helpers.js";import{p as u,a as f}from"./format.js";import{b}from"./client-layout.js";const h=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdChange=i(this,"mrdChange",7),this.mrdBlur=i(this,"mrdBlur",7),this.name="",this.label="",this.value=null,this.placeholder="",this.required=!1,this.disabled=!1,this.locale=navigator.language,this.dataType=b.INTEGER,this.decimalPrecision=2,this.displayValue="",this.error="",this.handleInput=r=>{this.displayValue=r.target.value},this.handleBlur=r=>{const e=r.target.value,i=u(e,this.locale);this.error=!this.required||null!==i&&""!==e?""===e||o(i,this.dataType)?"":a("invalid_number",this.locale):a("required",this.locale),null!==i&&l(e)&&(this.displayValue=this.formatForDisplay(i)),this.mrdChange.emit({name:this.name,value:i}),this.mrdBlur.emit({name:this.name,value:i})},this.handleFocus=()=>{if(null!=this.value){const r=String(this.value);this.displayValue=r}}}componentWillLoad(){null!=this.value&&(this.displayValue=this.formatForDisplay(this.value))}formatForDisplay(r){return this.dataType===b.PERCENTAGE?f(r,this.locale,{minimumFractionDigits:0,maximumFractionDigits:this.decimalPrecision})+"%":f(r,this.locale,this.dataType===b.DECIMAL?{minimumFractionDigits:this.decimalPrecision,maximumFractionDigits:this.decimalPrecision}:{maximumFractionDigits:0})}render(){const r=!!this.error,e=this.dataType===b.PERCENTAGE?"%":"";return d(t,{key:"90cae99b332f9554bc80d4044fce892ae37a48cf"},d("div",{key:"26a9cfcc662eaeb571d17785f10f74269cf78537",class:"mrd-number-field"},d(m,{key:"0d9e70c1591f309ad2875d9e9fe6dbb8aa910323",base:"mrd-number-field",label:this.label,required:this.required}),d("div",{key:"95e9b53fa73c452491f65355915bf04912900ded",class:"mrd-number-field__input-wrapper"},d("input",{key:"1d341c270a21b1a10c51757e90257e48e741abd7",class:n("mrd-number-field",r),type:"text",inputMode:"decimal",name:this.name,value:this.displayValue,placeholder:this.placeholder||(e?`0${e}`:"0"),required:this.required,disabled:this.disabled,onInput:this.handleInput,onBlur:this.handleBlur,onFocus:this.handleFocus})),d(c,{key:"0dba75e0f7355b71bfa71dab16cd1a6fcc36922f",base:"mrd-number-field",error:this.error})))}static get style(){return'.sc-mrd-number-field-h{display:block}.mrd-number-field.sc-mrd-number-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-number-field__label.sc-mrd-number-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-number-field__label--required.sc-mrd-number-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-number-field__input-wrapper.sc-mrd-number-field{position:relative;display:flex;align-items:center}.mrd-number-field__input.sc-mrd-number-field{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);transition:border-color var(--mrd-transition), box-shadow var(--mrd-transition);outline:none;appearance:none;box-sizing:border-box}.mrd-number-field__input.sc-mrd-number-field::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-number-field__input.sc-mrd-number-field:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-number-field__input.sc-mrd-number-field:disabled{background-color:var(--mrd-input-bg-disabled);cursor:not-allowed;opacity:0.7}.mrd-number-field__input--error.sc-mrd-number-field{border-color:var(--mrd-border-color-error)}.mrd-number-field__input--error.sc-mrd-number-field:focus{box-shadow:var(--mrd-shadow-focus-error)}.mrd-number-field__input.sc-mrd-number-field{text-align:right}.mrd-number-field__input.sc-mrd-number-field::placeholder{text-align:left}.mrd-number-field__error.sc-mrd-number-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}'}},[2,"mrd-number-field",{name:[1],label:[1],value:[2],placeholder:[1],required:[4],disabled:[4],locale:[1],dataType:[1,"data-type"],decimalPrecision:[2,"decimal-precision"],displayValue:[32],error:[32]}]);function p(){"undefined"!=typeof customElements&&["mrd-number-field"].forEach((r=>{"mrd-number-field"===r&&(customElements.get(s(r))||customElements.define(s(r),h))}))}export{h as M,p as d}
1
+ import{proxyCustomElement as r,HTMLElement as e,createEvent as i,h as d,Host as t,transformTag as s}from"@stencil/core/internal/client";import{t as o}from"./i18n.js";import{e as a,v as l,F as m,c as n,a as u}from"./field-helpers.js";import{p as c,c as b}from"./format.js";import{b as f}from"./client-layout.js";const h=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdChange=i(this,"mrdChange",7),this.mrdBlur=i(this,"mrdBlur",7),this.name="",this.label="",this.value=null,this.placeholder="",this.required=!1,this.disabled=!1,this.locale=navigator.language,this.dataType=f.INTEGER,this.decimalPrecision=2,this.displayValue="",this.error="",this.handleInput=r=>{this.displayValue=r.target.value},this.handleBlur=r=>{const e=r.target.value,i=c(e,this.locale);this.error=!this.required||null!==i&&""!==e?""===e||a(i,this.dataType)?"":o("invalid_number",this.locale):o("required",this.locale),null!==i&&l(e)&&(this.displayValue=this.formatForDisplay(i)),this.mrdChange.emit({name:this.name,value:i}),this.mrdBlur.emit({name:this.name,value:i})},this.handleFocus=()=>{if(null!=this.value){const r=String(this.value);this.displayValue=r}}}componentWillLoad(){null!=this.value&&(this.displayValue=this.formatForDisplay(this.value))}formatForDisplay(r){return this.dataType===f.PERCENTAGE?b(r,this.locale,{minimumFractionDigits:0,maximumFractionDigits:this.decimalPrecision})+"%":b(r,this.locale,this.dataType===f.DECIMAL?{minimumFractionDigits:this.decimalPrecision,maximumFractionDigits:this.decimalPrecision}:{maximumFractionDigits:0})}render(){const r=!!this.error,e=this.dataType===f.PERCENTAGE?"%":"";return d(t,{key:"5df5c2e16c85cd54944d95b7a8c340ae1a4ddb34"},d("div",{key:"e332bd0190d537c002b14090fa96ec6502e34746",class:"mrd-number-field"},d(m,{key:"e26ae85ef6c6d7935b2d34041a7ee2294da392a4",base:"mrd-number-field",label:this.label,required:this.required}),d("div",{key:"fb1a44a363a36b69124a0092e80b67d41b538c03",class:"mrd-number-field__input-wrapper"},d("input",{key:"175c448177bbd46015fc7f47b98b76e16ee3b743",class:n("mrd-number-field",r),type:"text",inputMode:"decimal",name:this.name,value:this.displayValue,placeholder:this.placeholder||(e?`0${e}`:"0"),required:this.required,disabled:this.disabled,onInput:this.handleInput,onBlur:this.handleBlur,onFocus:this.handleFocus})),d(u,{key:"ecb16ddf655e563f0569e774ab2f2e419f60b0f1",base:"mrd-number-field",error:this.error})))}static get style(){return'.sc-mrd-number-field-h{display:block}.mrd-number-field.sc-mrd-number-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-number-field__label.sc-mrd-number-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-number-field__label--required.sc-mrd-number-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-number-field__input-wrapper.sc-mrd-number-field{position:relative;display:flex;align-items:center}.mrd-number-field__input.sc-mrd-number-field{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);transition:border-color var(--mrd-transition), box-shadow var(--mrd-transition);outline:none;appearance:none;box-sizing:border-box}.mrd-number-field__input.sc-mrd-number-field::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-number-field__input.sc-mrd-number-field:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-number-field__input.sc-mrd-number-field:disabled{background-color:var(--mrd-input-bg-disabled);cursor:not-allowed;opacity:0.7}.mrd-number-field__input--error.sc-mrd-number-field{border-color:var(--mrd-border-color-error)}.mrd-number-field__input--error.sc-mrd-number-field:focus{box-shadow:var(--mrd-shadow-focus-error)}.mrd-number-field__input.sc-mrd-number-field{text-align:right}.mrd-number-field__input.sc-mrd-number-field::placeholder{text-align:left}.mrd-number-field__error.sc-mrd-number-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}'}},[2,"mrd-number-field",{name:[1],label:[1],value:[2],placeholder:[1],required:[4],disabled:[4],locale:[1],dataType:[1,"data-type"],decimalPrecision:[2,"decimal-precision"],displayValue:[32],error:[32]}]);function p(){"undefined"!=typeof customElements&&["mrd-number-field"].forEach((r=>{"mrd-number-field"===r&&(customElements.get(s(r))||customElements.define(s(r),h))}))}export{h as M,p as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as r,HTMLElement as e,createEvent as d,h as s,Host as t,transformTag as i}from"@stencil/core/internal/client";import{r as o,F as a,c as l,a as c}from"./field-helpers.js";const n=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdChange=d(this,"mrdChange",7),this.mrdBlur=d(this,"mrdBlur",7),this.name="",this.label="",this.value="",this.placeholder="",this.required=!1,this.disabled=!1,this.locale=navigator.language,this.error="",this.handleInput=r=>{this.mrdChange.emit({name:this.name,value:r.target.value})},this.handleBlur=r=>{const e=r.target.value;this.error=o(e,this.required,this.locale),this.mrdBlur.emit({name:this.name,value:e})}}render(){return s(t,{key:"9883a87b7fcc840aa4bbe0a3cde163cc58bda65d"},s("div",{key:"3c7ec45d59a1a17863daa39b7c115db5c58815ee",class:"mrd-secret-field"},s(a,{key:"2dda66c7e6d4946661bff5a5a46589a7e17f569a",base:"mrd-secret-field",label:this.label,required:this.required}),this.disabled?s("span",{class:"mrd-secret-field__masked","aria-label":this.label},this.value?"••••••••":""):s("input",{class:l("mrd-secret-field",!!this.error),type:"password",name:this.name,value:this.value,placeholder:this.placeholder,required:this.required,autocomplete:"new-password",onInput:this.handleInput,onBlur:this.handleBlur}),s(c,{key:"ad8f54a7c76c59591fee77e11a12bbd62c392d91",base:"mrd-secret-field",error:this.error})))}static get style(){return'.sc-mrd-secret-field-h{display:block}.mrd-secret-field.sc-mrd-secret-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-secret-field__label.sc-mrd-secret-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-secret-field__label--required.sc-mrd-secret-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-secret-field__input.sc-mrd-secret-field{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);transition:border-color var(--mrd-transition), box-shadow var(--mrd-transition);outline:none;appearance:none;box-sizing:border-box}.mrd-secret-field__input.sc-mrd-secret-field::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-secret-field__input.sc-mrd-secret-field:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-secret-field__input.sc-mrd-secret-field:disabled{background-color:var(--mrd-input-bg-disabled);cursor:not-allowed;opacity:0.7}.mrd-secret-field__input--error.sc-mrd-secret-field{border-color:var(--mrd-border-color-error)}.mrd-secret-field__input--error.sc-mrd-secret-field:focus{box-shadow:var(--mrd-shadow-focus-error)}.mrd-secret-field__error.sc-mrd-secret-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}.mrd-secret-field__masked.sc-mrd-secret-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-label-color);letter-spacing:0.15em;user-select:none;pointer-events:none}'}},[2,"mrd-secret-field",{name:[1],label:[1],value:[1],placeholder:[1],required:[4],disabled:[4],locale:[1],error:[32]}]);function m(){"undefined"!=typeof customElements&&["mrd-secret-field"].forEach((r=>{"mrd-secret-field"===r&&(customElements.get(i(r))||customElements.define(i(r),n))}))}export{n as M,m as d}
1
+ import{proxyCustomElement as r,HTMLElement as e,createEvent as d,h as s,Host as t,transformTag as i}from"@stencil/core/internal/client";import{r as o,F as l,c as a,a as c}from"./field-helpers.js";const n=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdChange=d(this,"mrdChange",7),this.mrdBlur=d(this,"mrdBlur",7),this.name="",this.label="",this.value="",this.placeholder="",this.required=!1,this.disabled=!1,this.locale=navigator.language,this.error="",this.handleInput=r=>{this.mrdChange.emit({name:this.name,value:r.target.value})},this.handleBlur=r=>{const e=r.target.value;this.error=o(e,this.required,this.locale),this.mrdBlur.emit({name:this.name,value:e})}}render(){return s(t,{key:"e06d04fdae34b42441976e21605fe94ad935382e"},s("div",{key:"2889e1eb1b6d0887ae531523a0b9b43c49ef6f99",class:"mrd-secret-field"},s(l,{key:"c40907905292cdef8bb0b8b9b0c03e05650bef37",base:"mrd-secret-field",label:this.label,required:this.required}),this.disabled?s("span",{class:"mrd-secret-field__masked","aria-label":this.label},this.value?"••••••••":""):s("input",{class:a("mrd-secret-field",!!this.error),type:"password",name:this.name,value:this.value,placeholder:this.placeholder,required:this.required,autocomplete:"new-password",onInput:this.handleInput,onBlur:this.handleBlur}),s(c,{key:"6353e4b40566852dbc1994c7c9c409d0d0aa1b37",base:"mrd-secret-field",error:this.error})))}static get style(){return'.sc-mrd-secret-field-h{display:block}.mrd-secret-field.sc-mrd-secret-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-secret-field__label.sc-mrd-secret-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-secret-field__label--required.sc-mrd-secret-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-secret-field__input.sc-mrd-secret-field{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);transition:border-color var(--mrd-transition), box-shadow var(--mrd-transition);outline:none;appearance:none;box-sizing:border-box}.mrd-secret-field__input.sc-mrd-secret-field::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-secret-field__input.sc-mrd-secret-field:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-secret-field__input.sc-mrd-secret-field:disabled{background-color:var(--mrd-input-bg-disabled);cursor:not-allowed;opacity:0.7}.mrd-secret-field__input--error.sc-mrd-secret-field{border-color:var(--mrd-border-color-error)}.mrd-secret-field__input--error.sc-mrd-secret-field:focus{box-shadow:var(--mrd-shadow-focus-error)}.mrd-secret-field__error.sc-mrd-secret-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}.mrd-secret-field__masked.sc-mrd-secret-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-label-color);letter-spacing:0.15em;user-select:none;pointer-events:none}'}},[2,"mrd-secret-field",{name:[1],label:[1],value:[1],placeholder:[1],required:[4],disabled:[4],locale:[1],error:[32]}]);function m(){"undefined"!=typeof customElements&&["mrd-secret-field"].forEach((r=>{"mrd-secret-field"===r&&(customElements.get(i(r))||customElements.define(i(r),n))}))}export{n as M,m as d}
@@ -1 +1 @@
1
- import{h as t,proxyCustomElement as r,HTMLElement as e,createEvent as l,writeTask as i,Host as a,transformTag as o}from"@stencil/core/internal/client";import{t as s}from"./i18n.js";import{a as n,b as d}from"./query-params.js";import{b as c,c as m,f as b,d as h,a as u,e as p}from"./format.js";import{a as _}from"./client-layout.js";const v=new Set(["TEXT","TEXTBLOCK","EMAIL","HYPERLINK"]),f=new Set(["INTEGER","DECIMAL","PERCENTAGE","CURRENCY"]),g=new Set(["DATE","DATETIME","TIME"]),y=new Set(["FILE","IMAGE"]),w=new Set(["LONGTEXT","JSON","FILE","IMAGE"]);function k(t,r){var e,l,i;const a=new URLSearchParams(t);a.delete("page"),a.delete("sort");const o=function(t){var r;const e={sum:[],avg:[],count:[]};for(const l of t){if("FIELD"!==l.type||!l.aggregate)continue;const t=l.aggregate.toLowerCase();t in e&&e[t].push(null!==(r=l.name)&&void 0!==r?r:"")}const l={};return e.sum.length&&(l.sum=e.sum),e.avg.length&&(l.avg=e.avg),e.count.length&&(l.count=e.count),Object.keys(l).length>0?l:null}(r);return(null===(e=null==o?void 0:o.sum)||void 0===e?void 0:e.length)&&a.set("sum",o.sum.join(",")),(null===(l=null==o?void 0:o.avg)||void 0===l?void 0:l.length)&&a.set("avg",o.avg.join(",")),(null===(i=null==o?void 0:o.count)||void 0===i?void 0:i.length)&&a.set("count",o.count.join(",")),a.toString()}function x(t){if(!t)return t;const[r,e,l]=t.split("-").map(Number);return new Date(r,e-1,l).toISOString().replace(/\.\d{3}Z$/,"Z")}function E(t){if(!t)return t;const[r,e,l]=t.split("-").map(Number);return new Date(r,e-1,l+1).toISOString().replace(/\.\d{3}Z$/,"Z")}class C{static render(t,r,e){var l,i,a,o;if(t.type===_.RELATION){const e=null!==(l=t.name)&&void 0!==l?l:"",o=null===(i=null==r?void 0:r._links)||void 0===i?void 0:i[e];return o?Array.isArray(o)?o.map((t=>{var r;return null!==(r=t.name)&&void 0!==r?r:""})).filter(Boolean).join(", "):null!==(a=o.name)&&void 0!==a?a:"":""}if(t.type!==_.FIELD)return"";const s=null!==(o=t.name)&&void 0!==o?o:"",n=t.dataType,d=t.listItems,c=null==r?void 0:r[s];return null==c||""===c?"":(Array.isArray(c)?c:[c]).map((t=>C.renderValue(null!=n?n:"TEXT",t,null!=d?d:[],e))).filter((t=>""!==t)).join(", ")}static renderValue(t,r,e,l){var i,a;switch(t){case"INTEGER":return u(Number(r),l,{maximumFractionDigits:0});case"DECIMAL":return u(Number(r),l);case"PERCENTAGE":return p(Number(r),l);case"CURRENCY":{const{amount:t,currency:e}="object"==typeof r&&null!==r?r:{amount:r,currency:""};return e?h(Number(t),e,l):u(Number(t),l)}case"DATE":return b(r,l);case"DATETIME":return m(r,l);case"TIME":return c(r,l);case"BOOLEAN":return r?"✓":"";case"FILE":case"IMAGE":return"object"==typeof r&&null!==r&&null!==(i=r.fileName)&&void 0!==i?i:"";case"LIST":{const t=e.find((t=>t.key===String(r)));return null!==(a=null==t?void 0:t.label)&&void 0!==a?a:String(r)}case"TEXTBLOCK":{const t=String(r).replace(/<[^>]*>/g,""),e=document.createElement("textarea");return e.innerHTML=t,e.value.trim()}case"LONGTEXT":return String(r).replace(/[\r\n]+/g," ").trim();case"JSON":return("object"==typeof r?JSON.stringify(r):String(r)).replace(/[\r\n]+/g," ").trim();case"SECRET":return r?"••••••••":"";default:return String(r)}}static formatJson(t,r=!1){try{const e="string"==typeof t?JSON.parse(t):t;return(r?JSON.stringify(e):JSON.stringify(e,null,2)).replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g,(t=>{let r="color:#2aa198";return/^"/.test(t)?r=/:$/.test(t)?"color:#881391":"color:#268bd2":/true|false/.test(t)?r="color:#b58900":/null/.test(t)&&(r="color:#dc322f"),`<span style="${r}">${t}</span>`}))}catch(r){return String(t)}}}const z=()=>t("span",{class:"mrd-table__filter-icon","aria-hidden":"true"},t("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor"},t("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"}))),T=({col:r,row:e,locale:l,onDownload:i,onOpenTextblock:a,onOpenJson:o})=>{var n,d,c;const m=null!==(n=r.dataType)&&void 0!==n?n:"",b="FIELD"===r.type&&f.has(m);if("FIELD"===r.type&&("FILE"===m||"IMAGE"===m)){const a=null!==(d=r.name)&&void 0!==d?d:"",o=null==e?void 0:e[a],n=null==o?void 0:o.href,c=null==o?void 0:o.fileName;return t("td",{class:"mrd-table__cell"},n&&c?t("button",{class:"mrd-table__file-btn",title:c,onClick:t=>{t.stopPropagation(),i({href:n,fileName:c})}},t("svg",{class:"mrd-table__file-icon",viewBox:"0 0 24 24","aria-hidden":"true"},t("path",{fill:"currentColor",d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 8l-3-3 1.41-1.41L10 14.17l4.59-4.58L16 11l-6 6z"})),s("download",l)):"")}if("JSON"===m){const i=null!==(c=r.name)&&void 0!==c?c:"",a=i?null==e?void 0:e[i]:void 0;if(null==a||""===a)return t("td",{class:"mrd-table__cell"});const n=C.formatJson(a,!0),d=C.formatJson(a,!1);return t("td",{class:"mrd-table__cell"},t("span",{class:"mrd-table__json-preview",innerHTML:n}),t("button",{class:"mrd-table__textblock-btn",onClick:t=>{t.stopPropagation(),o(d)},"aria-label":s("textblock_show_more",l)},"⋯"))}if("TEXTBLOCK"===m){const i=C.render(r,e,l);if(i.length<=200)return t("td",{class:"mrd-table__cell"},i);const o=i.slice(0,200)+"…";return t("td",{class:"mrd-table__cell"},o,t("button",{class:"mrd-table__textblock-btn",onClick:t=>{t.stopPropagation(),a(i)},"aria-label":s("textblock_show_more",l)},"⋯"))}const h=C.render(r,e,l);return t("td",{class:"mrd-table__cell"+(b?" mrd-table__cell--numeric":"")},h)},S=({columns:r,aggregations:e,locale:l})=>e&&r.some((t=>"FIELD"===t.type&&t.aggregate))?t("tfoot",null,t("tr",{class:"mrd-table__totals-row"},r.map((r=>{var i;const a=function(t,r,e){var l,i;if("FIELD"!==t.type||!t.aggregate||!r)return"";const a=null===(l=r[t.aggregate.toLowerCase()])||void 0===l?void 0:l[null!==(i=t.name)&&void 0!==i?i:""];if(null==a)return"";const o=t.dataType;return"INTEGER"===o?u(a,e,{maximumFractionDigits:0}):"PERCENTAGE"===o?p(a,e):"CURRENCY"===o&&t.currencyCode?h(a,t.currencyCode,e):u(a,e)}(r,e,l),o="FIELD"===r.type&&f.has(null!==(i=r.dataType)&&void 0!==i?i:"");return t("td",{class:"mrd-table__totals-cell"+(o?" mrd-table__totals-cell--numeric":"")},a)})))):null,O=({text:r,locale:e,onClose:l})=>null===r?null:t("div",{class:"mrd-table__modal-backdrop",onClick:l,role:"dialog","aria-modal":"true"},t("div",{class:"mrd-table__modal",onClick:t=>t.stopPropagation()},t("button",{class:"mrd-table__modal-close",onClick:l,"aria-label":s("close",e)},"✕"),t("p",{class:"mrd-table__modal-text"},r))),M=({html:r,locale:e,onClose:l})=>null===r?null:t("div",{class:"mrd-table__modal-backdrop",onClick:l,role:"dialog","aria-modal":"true"},t("div",{class:"mrd-table__modal",onClick:t=>t.stopPropagation()},t("button",{class:"mrd-table__modal-close",onClick:l,"aria-label":s("close",e)},"✕"),t("pre",{class:"mrd-table__modal-json",innerHTML:r}))),N=({locale:r,filterMode:e,filterCount:l,actions:i,views:a,activeViewIdx:o,viewPopoverOpen:n,createPickerOpen:d,createTypes:c,cb:m})=>{var b;const h=i.length>0,u=a.length>1;return t("div",{class:"mrd-table__toolbar"},t("div",{class:"mrd-table__toolbar-left"},t("button",{class:"mrd-table__action mrd-table__action--secondary mrd-table__filter-toggle"+(e?" mrd-table__filter-toggle--active":""),onClick:m.onFilterToggle},t("svg",{class:"mrd-table__action-icon",viewBox:"0 0 24 24","aria-hidden":"true"},t("path",{fill:"currentColor",d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"})),l>0&&t("span",{class:"mrd-table__filter-badge"},l),t("span",{class:"mrd-table__action-tooltip"},s(e?"table_filter_hide":"table_filter",r),l>0?` (${l} ${s("table_filter_active",r)})`:"")),l>0&&t("button",{class:"mrd-table__action mrd-table__action--secondary",onClick:m.onClearAllFilters},t("svg",{class:"mrd-table__action-icon",viewBox:"0 0 24 24","aria-hidden":"true"},t("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),t("span",{class:"mrd-table__action-tooltip"},s("table_filter_clear_all",r)))),u&&t("div",{class:"mrd-table__toolbar-center"},t("div",{class:"mrd-table__view-switcher"},t("button",{class:"mrd-table__view-arrow","aria-label":"Previous view",onClick:()=>m.onViewSwitch((o-1+a.length)%a.length)},"◀"),t("div",{class:"mrd-table__view-title-wrap"},t("button",{class:"mrd-table__view-title",onClick:t=>m.onToggleViewPopover(t)},null===(b=a[o])||void 0===b?void 0:b.label),n&&t("div",{class:"mrd-table__view-popover",onClick:t=>t.stopPropagation()},a.map(((r,e)=>t("button",{key:String(e),class:"mrd-table__view-popover-item"+(e===o?" mrd-table__view-popover-item--active":""),onClick:()=>{e!==o&&m.onViewSwitch(e),m.onCloseViewPopover()}},r.label))))),t("button",{class:"mrd-table__view-arrow","aria-label":"Next view",onClick:()=>m.onViewSwitch((o+1)%a.length)},"▶"))),h&&t("div",{class:"mrd-table__toolbar-right"},i.map((r=>{var e,l;const i="create"===r.action?c:null;return(null==i?void 0:i.length)?t("div",{class:"mrd-table__create-picker-wrap",key:`action-${r.action}`},t("button",{class:`mrd-table__action mrd-table__action--${null!==(e=r.variant)&&void 0!==e?e:"secondary"}`,onClick:m.onToggleCreatePicker},r.icon?t("svg",{class:"mrd-table__action-icon","aria-hidden":"true"},t("use",{href:r.icon})):r.label,t("span",{class:"mrd-table__action-tooltip"},r.label)),d&&t("div",{class:"mrd-table__create-picker"},i.map((r=>t("button",{key:r.type,class:"mrd-table__create-picker-item",onClick:()=>m.onCreate(r.type)},r.label))))):t("button",{key:`action-${r.action}`,class:`mrd-table__action mrd-table__action--${null!==(l=r.variant)&&void 0!==l?l:"secondary"}`,disabled:r.disabled,onClick:()=>m.onAction(r.action)},r.icon?t("svg",{class:"mrd-table__action-icon","aria-hidden":"true"},t("use",{href:r.icon})):r.label,t("span",{class:"mrd-table__action-tooltip"},r.label))}))))},j=({col:r,dataType:e,openFilterCol:l,pendingFilter:i,locale:a,cb:o})=>{var n,d,c,m,b,h;const u=i;if(y.has(e))return t("p",{class:"mrd-table__filter-no-support"},s("filter_no_support",a));if("BOOLEAN"===e){const r=u.operator,e="isEmpty"===r||"isNotEmpty"===r;return t("div",{class:"mrd-table__filter-radio-group"},[{labelKey:"filter_all",value:null},{labelKey:"yes",value:!0},{labelKey:"no",value:!1}].map((r=>t("label",{class:"mrd-table__filter-radio-label"},t("input",{type:"radio",name:`bf-${l}`,checked:!e&&u.value===r.value,onChange:()=>o.onReplacePending(Object.assign(Object.assign({},u),{operator:void 0,value:r.value}))}),s(r.labelKey,a)))),t("label",{class:"mrd-table__filter-radio-label"},t("input",{type:"radio",name:`bf-${l}`,checked:"isEmpty"===r,onChange:()=>o.onReplacePending(Object.assign(Object.assign({},u),{operator:"isEmpty",value:void 0}))}),s("filter_is_empty",a)),t("label",{class:"mrd-table__filter-radio-label"},t("input",{type:"radio",name:`bf-${l}`,checked:"isNotEmpty"===r,onChange:()=>o.onReplacePending(Object.assign(Object.assign({},u),{operator:"isNotEmpty",value:void 0}))}),s("filter_is_not_empty",a)))}if("LIST"===e){const e=null!==(n=r.listItems)&&void 0!==n?n:[],l=null!==(d=u.values)&&void 0!==d?d:[];return t("div",{class:"mrd-table__filter-list"},t("div",{class:"mrd-table__filter-list-controls"},t("button",{class:"mrd-table__filter-list-btn",onClick:()=>o.onReplacePending(Object.assign(Object.assign({},u),{values:e.map((t=>t.key))}))},s("filter_select_all",a)),t("button",{class:"mrd-table__filter-list-btn",onClick:()=>o.onReplacePending(Object.assign(Object.assign({},u),{values:[]}))},s("filter_select_none",a))),e.map((r=>t("label",{class:"mrd-table__filter-checkbox-label"},t("input",{type:"checkbox",checked:l.includes(r.key),onChange:t=>o.onToggleValue(r.key,t.target.checked)}),r.label))))}if(v.has(e)||"RELATION"===e){const r=null!==(c=u.operator)&&void 0!==c?c:"startsWith",e="isEmpty"===r||"isNotEmpty"===r;return t("div",{class:"mrd-table__filter-editor"},t("select",{class:"mrd-table__filter-select",onChange:t=>o.onSetPending("operator",t.target.value)},[{val:"startsWith",labelKey:"filter_starts_with"},{val:"equals",labelKey:"filter_equals"},{val:"isEmpty",labelKey:"filter_is_empty"},{val:"isNotEmpty",labelKey:"filter_is_not_empty"}].map((e=>t("option",{value:e.val,selected:r===e.val},s(e.labelKey,a))))),!e&&t("input",{type:"text",class:"mrd-table__filter-input",value:String(null!==(m=u.value)&&void 0!==m?m:""),placeholder:s("filter_search_value",a),onInput:t=>o.onSetPending("value",t.target.value)}))}if(f.has(e)){const r=u.operator,e="isEmpty"===r||"isNotEmpty"===r,i=!e&&(void 0!==u.from||void 0!==u.to);return t("div",{class:"mrd-table__filter-editor"},t("select",{class:"mrd-table__filter-select",onChange:t=>{const r=t.target.value;o.onReplacePending(Object.assign(Object.assign({},u),"isEmpty"===r||"isNotEmpty"===r?{operator:r,value:void 0,from:void 0,to:void 0}:{operator:void 0}))}},t("option",{value:"",selected:!e},s("filter_has_value",a)),t("option",{value:"isEmpty",selected:"isEmpty"===r},s("filter_is_empty",a)),t("option",{value:"isNotEmpty",selected:"isNotEmpty"===r},s("filter_is_not_empty",a))),!e&&t("div",{class:"mrd-table__filter-editor"},t("div",{class:"mrd-table__filter-radio-group mrd-table__filter-radio-group--inline"},t("label",{class:"mrd-table__filter-radio-label"},t("input",{type:"radio",name:`nm-${l}`,checked:!i,onChange:()=>o.onReplacePending(Object.assign(Object.assign({},u),{from:void 0,to:void 0}))}),s("filter_exact",a)),t("label",{class:"mrd-table__filter-radio-label"},t("input",{type:"radio",name:`nm-${l}`,checked:i,onChange:()=>o.onReplacePending(Object.assign(Object.assign({},u),{value:void 0,from:null,to:null}))}),s("filter_range",a))),i?t("div",{class:"mrd-table__filter-range"},t("input",{type:"number",class:"mrd-table__filter-input",placeholder:s("filter_from",a),value:null!=u.from?String(u.from):"",onInput:t=>o.onSetPending("from",t.target.value)}),t("span",{class:"mrd-table__filter-range-sep"},"–"),t("input",{type:"number",class:"mrd-table__filter-input",placeholder:s("filter_to",a),value:null!=u.to?String(u.to):"",onInput:t=>o.onSetPending("to",t.target.value)})):t("input",{type:"number",class:"mrd-table__filter-input",value:null!=u.value?String(u.value):"",onInput:t=>o.onSetPending("value",t.target.value)})))}if("DATETIME"===e){const r=u.operator,e="isEmpty"===r||"isNotEmpty"===r,i=!e&&(void 0!==u.from||void 0!==u.to);return t("div",{class:"mrd-table__filter-editor"},t("select",{class:"mrd-table__filter-select",onChange:t=>{const r=t.target.value;o.onReplacePending(Object.assign(Object.assign({},u),"isEmpty"===r||"isNotEmpty"===r?{operator:r,value:void 0,from:void 0,to:void 0}:{operator:void 0}))}},t("option",{value:"",selected:!e},s("filter_has_value",a)),t("option",{value:"isEmpty",selected:"isEmpty"===r},s("filter_is_empty",a)),t("option",{value:"isNotEmpty",selected:"isNotEmpty"===r},s("filter_is_not_empty",a))),!e&&t("div",{class:"mrd-table__filter-editor"},t("div",{class:"mrd-table__filter-radio-group mrd-table__filter-radio-group--inline"},t("label",{class:"mrd-table__filter-radio-label"},t("input",{type:"radio",name:`dt-${l}`,checked:!i,onChange:()=>o.onReplacePending(Object.assign(Object.assign({},u),{from:void 0,to:void 0}))}),s("filter_exact",a)),t("label",{class:"mrd-table__filter-radio-label"},t("input",{type:"radio",name:`dt-${l}`,checked:i,onChange:()=>o.onReplacePending(Object.assign(Object.assign({},u),{value:void 0,from:null,to:null}))}),s("filter_range",a))),i?t("div",{class:"mrd-table__filter-range mrd-table__filter-range--stacked"},t("label",{class:"mrd-table__filter-range-label"},s("filter_from",a)),t("input",{type:"date",class:"mrd-table__filter-input",value:null!=u.from?String(u.from):"",onInput:t=>o.onSetPending("from",t.target.value)}),t("label",{class:"mrd-table__filter-range-label"},s("filter_to",a)),t("input",{type:"date",class:"mrd-table__filter-input",value:null!=u.to?String(u.to):"",onInput:t=>o.onSetPending("to",t.target.value)})):t("input",{type:"date",class:"mrd-table__filter-input",value:String(null!==(b=u.value)&&void 0!==b?b:""),onInput:t=>o.onSetPending("value",t.target.value)})))}if(g.has(e)){const r="DATE"===e?"date":"time",i=u.operator,n="isEmpty"===i||"isNotEmpty"===i,d=!n&&(void 0!==u.from||void 0!==u.to);return t("div",{class:"mrd-table__filter-editor"},t("select",{class:"mrd-table__filter-select",onChange:t=>{const r=t.target.value;o.onReplacePending(Object.assign(Object.assign({},u),"isEmpty"===r||"isNotEmpty"===r?{operator:r,value:void 0,from:void 0,to:void 0}:{operator:void 0}))}},t("option",{value:"",selected:!n},s("filter_has_value",a)),t("option",{value:"isEmpty",selected:"isEmpty"===i},s("filter_is_empty",a)),t("option",{value:"isNotEmpty",selected:"isNotEmpty"===i},s("filter_is_not_empty",a))),!n&&t("div",{class:"mrd-table__filter-editor"},t("div",{class:"mrd-table__filter-radio-group mrd-table__filter-radio-group--inline"},t("label",{class:"mrd-table__filter-radio-label"},t("input",{type:"radio",name:`dt-${l}`,checked:!d,onChange:()=>o.onReplacePending(Object.assign(Object.assign({},u),{from:void 0,to:void 0}))}),s("filter_exact",a)),t("label",{class:"mrd-table__filter-radio-label"},t("input",{type:"radio",name:`dt-${l}`,checked:d,onChange:()=>o.onReplacePending(Object.assign(Object.assign({},u),{value:void 0,from:null,to:null}))}),s("filter_range",a))),d?t("div",{class:"mrd-table__filter-range"},t("input",{type:r,class:"mrd-table__filter-input",placeholder:s("filter_from",a),value:null!=u.from?String(u.from):"",onInput:t=>o.onSetPending("from",t.target.value)}),t("input",{type:r,class:"mrd-table__filter-input",placeholder:s("filter_to",a),value:null!=u.to?String(u.to):"",onInput:t=>o.onSetPending("to",t.target.value)})):t("input",{type:r,class:"mrd-table__filter-input",value:String(null!==(h=u.value)&&void 0!==h?h:""),onInput:t=>o.onSetPending("value",t.target.value)})))}return null},I=r=>{var e;const{col:l,openFilterCol:i,popupPos:a,sortField:o,sortDir:n,locale:d,cb:c}=r,m=null!==(e=l.label)&&void 0!==e?e:i,b=o===i;return t("div",{class:"mrd-table__filter-popup",style:{top:`${a.top}px`,left:`${a.left}px`},onClick:t=>t.stopPropagation()},t("div",{class:"mrd-table__filter-popup-header"},t("span",{class:"mrd-table__filter-popup-title"},m),t("button",{class:"mrd-table__filter-close",onClick:c.onClose},"✕")),t("div",{class:"mrd-table__filter-section"},t("div",{class:"mrd-table__filter-section-label"},s("filter_sorting",d)),t("div",{class:"mrd-table__filter-sort-buttons"},t("button",{class:"mrd-table__filter-sort-btn"+(b&&"asc"===n?" mrd-table__filter-sort-btn--active":""),onClick:()=>c.onApplySort("asc")},"▲ ",s("filter_ascending",d)),t("button",{class:"mrd-table__filter-sort-btn"+(b&&"desc"===n?" mrd-table__filter-sort-btn--active":""),onClick:()=>c.onApplySort("desc")},"▼ ",s("filter_descending",d)))),t("div",{class:"mrd-table__filter-divider"}),t("div",{class:"mrd-table__filter-section"},t("div",{class:"mrd-table__filter-section-label"},s("filter_section",d)),t(j,Object.assign({},r))),t("div",{class:"mrd-table__filter-popup-footer"},t("button",{class:"mrd-table__filter-btn mrd-table__filter-btn--clear",onClick:c.onClear},s("filter_clear",d)),t("button",{class:"mrd-table__filter-btn mrd-table__filter-btn--apply",onClick:c.onApply},s("filter_apply",d))))};function P(t,r){return Math.ceil(t/r)}function L(t,r,e){return{firstPage:Math.floor(t/e),lastPage:Math.floor(r/e)}}const A=r(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.mrdLoadPage=l(this,"mrdLoadPage",7),this.mrdPageError=l(this,"mrdPageError",7),this.mrdRowClick=l(this,"mrdRowClick",7),this.mrdAction=l(this,"mrdAction",7),this.mrdDownload=l(this,"mrdDownload",7),this.mrdLoadAggregations=l(this,"mrdLoadAggregations",7),this.pendingPages=new Set,this.debounceTimer=null,this.requestedAt=new Map,this.retryAttempts=new Map,this.staleCheckTimer=null,this.outsideClickHandler=null,this.keydownHandler=null,this.createPickerClickHandler=null,this.viewPopoverClickHandler=null,this.colWidthMeasureScheduled=!1,this.item=null,this.parentId="",this.rows=[],this.locale=navigator.language,this.totalElements=0,this.pageSize=20,this.rowHeight=36,this.tableHeight=500,this.requestTimeoutMs=15e3,this.activeViewIdx=0,this.loadedPages=new Map,this.requestedPages=new Set,this.failedPages=new Set,this.renderStart=0,this.renderEnd=0,this.colWidths=[],this.sortField="",this.sortDir="asc",this.filterMode=!1,this.activeFilters=new Map,this.openFilterCol=null,this.pendingFilter=null,this.popupPos={top:0,left:0},this.createPickerOpen=!1,this.viewPopoverOpen=!1,this.scrollTop=0,this.textblockModal=null,this.jsonModal=null,this.aggregations=null,this.aggregationsTotal=null,this.aggregationsPending=!1,this.minKnownTotal=0,this.handleScroll=t=>{const r=t.currentTarget,{renderStart:e,renderEnd:l}=function(t,r,e,l){const i=Math.floor(t/r),a=Math.min(i+P(e,r),l-1);return{renderStart:Math.max(0,i-10),renderEnd:Math.min(l-1,a+10)}}(r.scrollTop,this.rowHeight,this.tableHeight,this.baseTotal);this.scrollTop=r.scrollTop,this.renderStart=e,this.renderEnd=l,this.requestPagesForWindow(this.renderStart,this.renderEnd)}}totalElementsChanged(t){this.renderEnd=Math.min(this.renderEnd,Math.max(0,t-1))}itemChanged(t){var r,e;this.activeViewIdx=0,this.applyDefaultSort(null!==(e=null===(r=null==t?void 0:t.view)||void 0===r?void 0:r.defaultSort)&&void 0!==e?e:"")}componentWillLoad(){var t,r,e;this.applyDefaultSort(null!==(e=null===(r=null===(t=this.item)||void 0===t?void 0:t.view)||void 0===r?void 0:r.defaultSort)&&void 0!==e?e:"")}componentDidLoad(){this.staleCheckTimer=setInterval((()=>this.checkStalePages()),2e3)}applyDefaultSort(t){const{field:r,dir:e}=function(t){var r;if(!t)return{field:"",dir:"asc"};const e=t.split(",");return{field:e[0].trim(),dir:"desc"===(null===(r=e[1])||void 0===r?void 0:r.trim())?"desc":"asc"}}(t);this.sortField=r,this.sortDir=e}async init(){null!==this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.pendingPages.clear(),this.loadedPages=new Map,this.requestedPages=new Set,this.failedPages=new Set,this.requestedAt.clear(),this.retryAttempts.clear(),this.colWidths=[],this.colWidthMeasureScheduled=!1,this.scrollTop=0,this.renderStart=0,this.renderEnd=this.visibleCount()-1;const t=this.el.querySelector(".mrd-table__scroll");t&&(t.scrollTop=0),this.aggregations=null,this.aggregationsTotal=null,this.aggregationsPending=!0,this.minKnownTotal=0,this.emitLoadPage(0),this.requestedPages=new Set([0])}async setPage(t,r,e){const l=void 0!==e?!e:r.length<this.pageSize;l?(this.renderEnd=Math.min(this.renderEnd,t*this.pageSize+r.length-1),this.minKnownTotal=t*this.pageSize+r.length):this.minKnownTotal=Math.max(this.minKnownTotal,(t+1)*this.pageSize+1);const i=new Map(this.loadedPages);if(i.set(t,r),this.loadedPages=i,this.requestedAt.delete(t),this.retryAttempts.delete(t),this.failedPages.has(t)){const r=new Set(this.failedPages);r.delete(t),this.failedPages=r}if(0===t&&this.aggregationsPending){this.aggregationsPending=!1;const t=this.columns.some((t=>"FIELD"===t.type&&t.aggregate));l&&!t||this.emitLoadAggregations()}}async setAggregations(t){null!=t.total&&(this.aggregationsTotal=t.total),this.aggregations=t}disconnectedCallback(){null!==this.staleCheckTimer&&(clearInterval(this.staleCheckTimer),this.staleCheckTimer=null),this.outsideClickHandler&&(document.removeEventListener("click",this.outsideClickHandler),this.outsideClickHandler=null),this.createPickerClickHandler&&(document.removeEventListener("click",this.createPickerClickHandler),this.createPickerClickHandler=null),this.keydownHandler&&(document.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=null),this.viewPopoverClickHandler&&(document.removeEventListener("click",this.viewPopoverClickHandler),this.viewPopoverClickHandler=null)}componentDidRender(){0===this.colWidths.length&&!this.colWidthMeasureScheduled&&this.loadedPages.size>0&&this.totalElements>0&&(this.colWidthMeasureScheduled=!0,i((()=>{if(this.colWidthMeasureScheduled=!1,0!==this.colWidths.length)return;const t=this.el.querySelectorAll(".mrd-table__header");t.length>0&&(this.colWidths=Array.from(t).map((t=>t.offsetWidth)))})))}visibleCount(){return P(this.tableHeight,this.rowHeight)}sortParam(){return(t=this.sortField)?"desc"===this.sortDir?`${t},desc`:t:"";var t}get allViews(){var t,r,e,l,i,a,o;if(!this.item)return[];const s=this.item;return[{label:null!==(i=null!==(l=null!==(e=null!==(t=s.label)&&void 0!==t?t:null===(r=s.view)||void 0===r?void 0:r.pluralLabel)&&void 0!==e?e:s.dataClass)&&void 0!==l?l:s.relatedClass)&&void 0!==i?i:"",dataClass:null!==(a=s.dataClass)&&void 0!==a?a:s.relatedClass,fromClass:s.fromClass,filterClass:s.filterClass,view:s.view},...(null!==(o=s.alternativeViews)&&void 0!==o?o:[]).map((t=>{var r,e,l,i;return{label:null!==(i=null!==(l=null!==(r=t.label)&&void 0!==r?r:null===(e=t.view)||void 0===e?void 0:e.pluralLabel)&&void 0!==l?l:t.dataClass)&&void 0!==i?i:"",dataClass:t.dataClass,fromClass:t.fromClass,filterClass:t.filterClass,view:t.view}}))]}buildExcelPath(){var t;const r=this.allViews[this.activeViewIdx];return r?"/excel"+d({isRelatedView:"RELATED_VIEW"===(null===(t=this.item)||void 0===t?void 0:t.type),fromClass:r.fromClass,parentId:this.parentId,dataClass:r.dataClass}):""}buildActionDetail(t,r){var e,l,i;if("export"===t)return{action:t,path:this.buildExcelPath(),qs:this.buildQueryParams(0)};if("create"===t){const a=this.allViews[this.activeViewIdx],o="RELATED_VIEW"===(null===(e=this.item)||void 0===e?void 0:e.type)?`/${null!==(l=null==a?void 0:a.fromClass)&&void 0!==l?l:""}/${this.parentId}`:null;return Object.assign({action:t,dataClass:null!==(i=null==a?void 0:a.dataClass)&&void 0!==i?i:"",parentPath:o},r?{basicType:r}:{})}return{action:t}}buildDataPath(){var t;const r=this.allViews[this.activeViewIdx];return r?d({isRelatedView:"RELATED_VIEW"===(null===(t=this.item)||void 0===t?void 0:t.type),fromClass:r.fromClass,parentId:this.parentId,dataClass:r.dataClass}):""}buildQueryParams(t){var r;const e=this.allViews[this.activeViewIdx];return function(t){var r,e;const l=new URLSearchParams;t.page>0&&l.set("page",String(t.page)),t.sort&&l.set("sort",t.sort),t.filterClass&&l.set("type",t.filterClass),n(l,t.viewFilters);for(const i of t.activeFilters)"isEmpty"!==i.operator?"isNotEmpty"!==i.operator?"startsWith"!==i.operator?(null===(e=i.values)||void 0===e?void 0:e.length)?l.set(i.field,i.values.join(",")):(null!=i.value&&l.set(i.field,String(i.value)),null!=i.from&&l.set(i.field+"_from",String(i.from)),null!=i.to&&l.set(i.field+"_to",String(i.to))):l.set(i.field+"_startswith",String(null!==(r=i.value)&&void 0!==r?r:"")):l.set(i.field+"_notempty","true"):l.set(i.field,"");return l.toString()}({page:t,sort:this.sortParam(),filterClass:null==e?void 0:e.filterClass,viewFilters:null===(r=null==e?void 0:e.view)||void 0===r?void 0:r.filter,activeFilters:this.activeFilters.values()})}get columns(){var t,r,e;return null!==(e=null===(r=null===(t=this.allViews[this.activeViewIdx])||void 0===t?void 0:t.view)||void 0===r?void 0:r.values)&&void 0!==e?e:[]}get tableActions(){var t,r;const e=null!==(r=null===(t=this.item)||void 0===t?void 0:t.actions)&&void 0!==r?r:[];return(null!=e?e:[]).reduce(((t,r)=>("NEW"===r&&t.push({action:"create",label:s("table_new_record",this.locale),icon:"assets/sprites.svg#icon-plus",variant:"primary"}),"EXPORT"===r&&t.push({action:"export",label:s("table_export_excel",this.locale),icon:"assets/sprites.svg#icon-file-excel"}),t)),[])}toggleCreatePicker(){this.createPickerOpen?this.closeCreatePicker():(this.createPickerOpen=!0,this.createPickerClickHandler&&document.removeEventListener("click",this.createPickerClickHandler),this.createPickerClickHandler=t=>{const r=this.el.querySelector(".mrd-table__create-picker-wrap");r&&!r.contains(t.target)&&this.closeCreatePicker()},document.addEventListener("click",this.createPickerClickHandler))}closeCreatePicker(){this.createPickerOpen=!1,this.createPickerClickHandler&&(document.removeEventListener("click",this.createPickerClickHandler),this.createPickerClickHandler=null)}colName(t){var r;return null!==(r=t.name)&&void 0!==r?r:""}colDataType(t){var r;return"RELATION"===t.type?"RELATION":null!==(r=t.dataType)&&void 0!==r?r:"TEXT"}isTotalKnown(){return null!=this.aggregationsTotal||function(t,r){for(const e of t.values())if(e.length<r)return!0;return!1}(this.loadedPages,this.pageSize)}get baseTotal(){return null!=this.aggregationsTotal?this.aggregationsTotal:this.totalElements>0?this.totalElements:this.minKnownTotal}emitLoadAggregations(){const t=this.buildQueryParams(0);this.mrdLoadAggregations.emit({path:this.buildDataPath(),qs:t,aggQs:k(t,this.columns)})}resetPages(){null!==this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.pendingPages.clear(),this.loadedPages=new Map,this.requestedPages=new Set,this.failedPages=new Set,this.requestedAt.clear(),this.retryAttempts.clear(),this.colWidths=[],this.colWidthMeasureScheduled=!1,this.scrollTop=0,this.renderStart=0,this.minKnownTotal=0,this.renderEnd=this.visibleCount()-1;const t=this.el.querySelector(".mrd-table__scroll");t&&(t.scrollTop=0)}handleSortClick(t){const r=this.colName(t);this.sortField===r?this.sortDir="asc"===this.sortDir?"desc":"asc":(this.sortField=r,this.sortDir="asc"),this.resetPages(),this.emitPagesForWindow(this.renderStart,this.renderEnd)}applySort(t,r){this.sortField=this.colName(t),this.sortDir=r,this.resetPages(),this.emitPagesForWindow(this.renderStart,this.renderEnd)}emitLoadPage(t){this.mrdLoadPage.emit({page:t,sort:this.sortParam(),path:this.buildDataPath(),qs:this.buildQueryParams(t)}),this.requestedAt.set(t,Date.now())}emitPagesForWindow(t,r){const{firstPage:e,lastPage:l}=L(t,r,this.pageSize),i=new Set(this.requestedPages);let a=!1;for(let t=e;t<=l;t++)this.loadedPages.has(t)||i.has(t)||(i.add(t),this.emitLoadPage(t),a=!0);a&&(this.requestedPages=i)}getRow(t){return function(t,r,e){var l;const i=t.get(Math.floor(r/e));return null!==(l=null==i?void 0:i[r%e])&&void 0!==l?l:null}(this.loadedPages,t,this.pageSize)}requestPagesForWindow(t,r){const{firstPage:e,lastPage:l}=L(t,r,this.pageSize);let i=!1;for(let t=e;t<=l;t++)this.loadedPages.has(t)||this.requestedPages.has(t)||this.pendingPages.has(t)||(this.pendingPages.add(t),i=!0);i&&(null!==this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout((()=>this.flushPendingPages()),150))}flushPendingPages(){if(this.debounceTimer=null,0===this.pendingPages.size)return;const t=new Set(this.requestedPages);let r=!1;for(const e of this.pendingPages){if(this.loadedPages.has(e)||t.has(e))continue;const l=e*this.pageSize;l+this.pageSize-1<this.renderStart||l>this.renderEnd||(t.add(e),this.emitLoadPage(e),r=!0)}this.pendingPages.clear(),r&&(this.requestedPages=t)}checkStalePages(){var t;if(0===this.requestedAt.size)return;const r=function(t,r,e){const l=[];for(const[i,a]of t)r-a>=e&&l.push(i);return l}(this.requestedAt,Date.now(),this.requestTimeoutMs).filter((t=>!this.loadedPages.has(t)));if(0===r.length)return;let e=null;for(const l of r){const r=null!==(t=this.retryAttempts.get(l))&&void 0!==t?t:0;r<3?(this.retryAttempts.set(l,r+1),this.emitLoadPage(l)):(this.requestedAt.delete(l),this.retryAttempts.delete(l),e||(e=new Set(this.failedPages)),e.add(l),this.mrdPageError.emit({page:l}))}e&&(this.failedPages=e)}retryPage(t){const r=new Set(this.failedPages);r.delete(t),this.failedPages=r,this.retryAttempts.delete(t),this.emitLoadPage(t);const e=new Set(this.requestedPages);e.add(t),this.requestedPages=e}handleFilterToggle(){this.filterMode=!this.filterMode,this.filterMode||this.closeFilterPopup()}handleFilterOpen(t,r){r.stopPropagation();const e=r.currentTarget.getBoundingClientRect();let l=e.left;l+280>window.innerWidth-8&&(l=e.right-280),this.popupPos={top:e.bottom+4,left:Math.max(8,l)};const i=this.colName(t),a=this.colDataType(t),o=this.activeFilters.get(i),s=v.has(a)||"RELATION"===a?"startsWith":void 0;this.pendingFilter="DATETIME"===a&&o&&"isEmpty"!==o.operator&&"isNotEmpty"!==o.operator?function(t){const r=Object.assign({},t);return"string"==typeof r.from&&r.from&&(r.from=function(t){if(!t)return t;const r=new Date(t);return isNaN(r.getTime())?t:`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,"0")}-${String(r.getDate()).padStart(2,"0")}`}(r.from)),"string"==typeof r.to&&r.to&&(r.to=function(t){if(!t)return t;const r=new Date(t);return isNaN(r.getTime())?t:(r.setDate(r.getDate()-1),`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,"0")}-${String(r.getDate()).padStart(2,"0")}`)}(r.to)),r.from&&r.to&&r.from===r.to?Object.assign(Object.assign({},r),{value:r.from,from:void 0,to:void 0}):r}(o):o?Object.assign({},o):{field:i,dataType:a,operator:s},this.openFilterCol=i,this.outsideClickHandler&&document.removeEventListener("click",this.outsideClickHandler),this.outsideClickHandler=t=>{const r=this.el.querySelector(".mrd-table__filter-popup");r&&!r.contains(t.target)&&this.closeFilterPopup()},document.addEventListener("click",this.outsideClickHandler)}closeFilterPopup(){this.openFilterCol=null,this.pendingFilter=null,this.outsideClickHandler&&(document.removeEventListener("click",this.outsideClickHandler),this.outsideClickHandler=null)}openTextblockModal(t){this.textblockModal=t,this.keydownHandler&&document.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=t=>{"Escape"===t.key&&this.closeTextblockModal()},document.addEventListener("keydown",this.keydownHandler)}closeTextblockModal(){this.textblockModal=null,this.keydownHandler&&(document.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=null)}openJsonModal(t){this.jsonModal=t,this.keydownHandler&&document.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=t=>{"Escape"===t.key&&this.closeJsonModal()},document.addEventListener("keydown",this.keydownHandler)}closeJsonModal(){this.jsonModal=null,this.keydownHandler&&(document.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=null)}setPending(t,r){this.pendingFilter=Object.assign(Object.assign({},this.pendingFilter),{[t]:r})}togglePendingValue(t,r){var e,l;const i=null!==(l=null===(e=this.pendingFilter)||void 0===e?void 0:e.values)&&void 0!==l?l:[];this.pendingFilter=Object.assign(Object.assign({},this.pendingFilter),{values:r?[...i,t]:i.filter((r=>r!==t))})}applyFilter(){const t=this.pendingFilter;if(!(null==t?void 0:t.field))return void this.closeFilterPopup();const r=function(t){const r=Object.assign({},t);return"DATETIME"===t.dataType&&"isEmpty"!==t.operator&&"isNotEmpty"!==t.operator&&("string"==typeof r.value&&r.value?(r.from=x(r.value),r.to=E(r.value),r.value=void 0):("string"==typeof r.from&&r.from&&(r.from=x(r.from)),"string"==typeof r.to&&r.to&&(r.to=E(r.to)))),r}(t),e=new Map(this.activeFilters);!function(t){return"isEmpty"===t.operator||"isNotEmpty"===t.operator||void 0!==t.values&&t.values.length>0||null!=t.value&&""!==t.value||"boolean"==typeof t.value||null!=t.from&&""!==t.from||null!=t.to&&""!==t.to}(r)?e.delete(r.field):e.set(r.field,r),this.activeFilters=e,this.closeFilterPopup(),this.aggregations=null,this.aggregationsTotal=null,this.aggregationsPending=!0,(this.totalElements>0||this.minKnownTotal>0)&&(this.resetPages(),this.emitPagesForWindow(this.renderStart,this.renderEnd))}clearFilter(){const t=this.openFilterCol,r=new Map(this.activeFilters);t&&r.delete(t),this.activeFilters=r,this.closeFilterPopup(),this.aggregations=null,this.aggregationsTotal=null,this.aggregationsPending=!0,(this.totalElements>0||this.minKnownTotal>0)&&(this.resetPages(),this.emitPagesForWindow(this.renderStart,this.renderEnd))}clearAllFilters(){this.activeFilters=new Map,this.aggregations=null,this.aggregationsTotal=null,this.aggregationsPending=!0,(this.totalElements>0||this.minKnownTotal>0)&&(this.resetPages(),this.emitPagesForWindow(this.renderStart,this.renderEnd))}handleViewSwitch(t){var r,e;const l=this.allViews[t];(null==l?void 0:l.view)&&(this.activeViewIdx=t,this.applyDefaultSort(null!==(e=null===(r=l.view)||void 0===r?void 0:r.defaultSort)&&void 0!==e?e:""),this.activeFilters=new Map,this.init())}toggleViewPopover(t){t.stopPropagation(),this.viewPopoverOpen?this.closeViewPopover():(this.viewPopoverOpen=!0,this.viewPopoverClickHandler=()=>this.closeViewPopover(),document.addEventListener("click",this.viewPopoverClickHandler))}closeViewPopover(){this.viewPopoverOpen=!1,this.viewPopoverClickHandler&&(document.removeEventListener("click",this.viewPopoverClickHandler),this.viewPopoverClickHandler=null)}renderToolbar(){var r;return t(N,{locale:this.locale,filterMode:this.filterMode,filterCount:this.activeFilters.size,actions:this.tableActions,views:this.allViews,activeViewIdx:this.activeViewIdx,viewPopoverOpen:this.viewPopoverOpen,createPickerOpen:this.createPickerOpen,createTypes:null===(r=this.item)||void 0===r?void 0:r.createTypes,cb:{onFilterToggle:()=>this.handleFilterToggle(),onClearAllFilters:()=>this.clearAllFilters(),onViewSwitch:t=>this.handleViewSwitch(t),onToggleViewPopover:t=>this.toggleViewPopover(t),onCloseViewPopover:()=>this.closeViewPopover(),onToggleCreatePicker:()=>this.toggleCreatePicker(),onCreate:t=>{this.mrdAction.emit(this.buildActionDetail("create",t)),this.closeCreatePicker()},onAction:t=>this.mrdAction.emit(this.buildActionDetail(t))}})}renderFilterPopup(){if(!this.openFilterCol||!this.pendingFilter)return null;const r=this.columns.find((t=>this.colName(t)===this.openFilterCol));return r?t(I,{col:r,dataType:this.colDataType(r),openFilterCol:this.openFilterCol,pendingFilter:this.pendingFilter,popupPos:this.popupPos,sortField:this.sortField,sortDir:this.sortDir,locale:this.locale,cb:{onSetPending:(t,r)=>this.setPending(t,r),onReplacePending:t=>this.pendingFilter=t,onToggleValue:(t,r)=>this.togglePendingValue(t,r),onApplySort:t=>this.applySort(r,t),onApply:()=>this.applyFilter(),onClear:()=>this.clearFilter(),onClose:()=>this.closeFilterPopup()}}):null}renderFooter(r,e,l=!0){if(0===this.totalElements&&0===this.loadedPages.size){const e=null!=r?r:0;return 0===e?null:t("div",{class:"mrd-table__footer"},e," ",s("table_of",this.locale)," ",e)}if(!this.loadedPages.has(0))return null;const i=null!=e?e:this.baseTotal,a=Math.min(Math.floor(this.scrollTop/this.rowHeight)+1,i),o=Math.min(Math.ceil((this.scrollTop+this.tableHeight)/this.rowHeight),i),n=l?String(i):"…";return t("div",{class:"mrd-table__footer"},a,"–",o," ",s("table_of",this.locale)," ",n)}renderCell(r,e){return t(T,{col:r,row:e,locale:this.locale,onDownload:t=>this.mrdDownload.emit(t),onOpenTextblock:t=>this.openTextblockModal(t),onOpenJson:t=>this.openJsonModal(t)})}renderTotalsRow(){return t(S,{columns:this.columns,aggregations:this.aggregations,locale:this.locale})}render(){var r,e,l;if(!(null===(r=this.columns)||void 0===r?void 0:r.length))return null;if(0===this.totalElements&&0===this.loadedPages.size)return t(a,null,this.renderToolbar(),t("div",{class:"mrd-table"},t("table",{class:"mrd-table__table"},t("thead",null,t("tr",null,this.columns.map((r=>{var e;const l=this.colName(r),i=this.activeFilters.has(l),a=["mrd-table__header",i?"mrd-table__header--filtered":"",this.filterMode?"mrd-table__header--sortable":""].filter(Boolean).join(" ");return t("th",{class:a,onClick:this.filterMode?t=>this.handleFilterOpen(r,t):void 0},t("span",{class:"mrd-table__header-label"},null!==(e=r.label)&&void 0!==e?e:""),i&&t(z,null))})))),t("tbody",null,null===(e=this.rows)||void 0===e?void 0:e.map(((r,e)=>t("tr",{class:"mrd-table__row mrd-table__row--clickable",style:{background:e%2==0?"":"var(--mrd-color-neutral-100)"},onClick:()=>this.mrdRowClick.emit({row:r})},this.columns.map((t=>this.renderCell(t,r))))))),this.renderTotalsRow()),(!this.rows||0===this.rows.length)&&t("p",{class:"mrd-table__empty"},s("no_results",this.locale))),this.renderFooter(null===(l=this.rows)||void 0===l?void 0:l.length),this.renderFilterPopup(),this.renderTextblockModal(),this.renderJsonModal());const i=function(t,r,e){let l=e;for(const[e,i]of t)i.length<r&&(l=Math.min(l,e*r+i.length));return l}(this.loadedPages,this.pageSize,this.baseTotal),o=Math.min(this.renderEnd,i-1),n=this.columns.length,d=this.renderStart*this.rowHeight,c=Math.max(0,(i-1-o)*this.rowHeight),m=this.colWidths.length>0?{tableLayout:"fixed"}:void 0,b=[];for(let r=this.renderStart;r<=o;r++){const e=this.getRow(r);if(null===e){const e=Math.floor(r/this.pageSize);this.failedPages.has(e)?b.push(t("tr",{class:"mrd-table__row mrd-table__row--failed"},t("td",{class:"mrd-table__cell--failed",colSpan:n},t("button",{type:"button",class:"mrd-table__retry-button",onClick:()=>this.retryPage(e)},s("load_failed_retry",this.locale))))):b.push(t("tr",{class:"mrd-table__row mrd-table__row--loading"},t("td",{class:"mrd-table__cell--placeholder",colSpan:n},t("span",{class:"mrd-table__placeholder-bar"}))))}else b.push(t("tr",{class:"mrd-table__row mrd-table__row--clickable",style:{background:r%2==0?"":"var(--mrd-color-neutral-100)"},onClick:()=>this.mrdRowClick.emit({row:e,listContext:{index:r,sort:this.sortParam(),path:this.buildDataPath(),qs:this.buildQueryParams(0)}})},this.columns.map((t=>this.renderCell(t,e)))))}return t(a,null,this.renderToolbar(),t("div",{class:"mrd-table__scroll",style:{height:`${this.tableHeight}px`},onScroll:this.handleScroll},t("table",{class:"mrd-table__table",style:m},t("thead",null,t("tr",null,this.columns.map(((r,e)=>{var l;const i=this.colName(r),a=this.sortField===i,o=this.activeFilters.has(i),s=!w.has(this.colDataType(r)),n=["mrd-table__header",s?"mrd-table__header--sortable":"",a?`mrd-table__header--sorted-${this.sortDir}`:"",o?"mrd-table__header--filtered":""].filter(Boolean).join(" ");return t("th",{class:n,style:this.colWidths[e]?{width:`${this.colWidths[e]}px`}:void 0,onClick:s?t=>this.filterMode?this.handleFilterOpen(r,t):this.handleSortClick(r):void 0},t("span",{class:"mrd-table__header-label"},null!==(l=r.label)&&void 0!==l?l:""),s&&a&&t("span",{class:"mrd-table__sort-icon","aria-hidden":"true"},"asc"===this.sortDir?"▲":"▼"),s&&!a&&!this.filterMode&&t("span",{class:"mrd-table__sort-icon","aria-hidden":"true"},"⇅"),s&&o&&t(z,null))})))),t("tbody",null,d>0&&t("tr",{class:"mrd-table__spacer",style:{height:`${d}px`}},t("td",{colSpan:n})),b,c>0&&t("tr",{class:"mrd-table__spacer",style:{height:`${c}px`}},t("td",{colSpan:n}))),this.renderTotalsRow())),0===i&&this.loadedPages.has(0)&&t("p",{class:"mrd-table__empty"},s("no_results",this.locale)),i>0&&this.renderFooter(void 0,i,this.isTotalKnown()),this.renderFilterPopup(),this.renderTextblockModal(),this.renderJsonModal())}renderTextblockModal(){return t(O,{text:this.textblockModal,locale:this.locale,onClose:()=>this.closeTextblockModal()})}renderJsonModal(){return t(M,{html:this.jsonModal,locale:this.locale,onClose:()=>this.closeJsonModal()})}get el(){return this}static get watchers(){return{totalElements:[{totalElementsChanged:0}],item:[{itemChanged:0}]}}static get style(){return".sc-mrd-table-h{display:block;width:100%}.mrd-table.sc-mrd-table{overflow-x:auto}.mrd-table__scroll.sc-mrd-table{overflow-y:auto;overflow-x:auto;border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);overflow-anchor:none}.mrd-table__table.sc-mrd-table{width:auto;min-width:100%;border-collapse:collapse;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-900)}.mrd-table__scroll.sc-mrd-table .mrd-table__table.sc-mrd-table{min-width:max-content}.mrd-table__header.sc-mrd-table{position:sticky;top:0;z-index:1;background:var(--mrd-color-white);text-align:left;padding:var(--mrd-space-2) var(--mrd-space-4);border-bottom:2px solid var(--mrd-border-color);color:var(--mrd-color-neutral-600);font-weight:var(--mrd-font-weight-medium);white-space:nowrap;font-size:var(--mrd-font-size-xs);text-transform:uppercase;letter-spacing:0.04em}.mrd-table__header--sortable.sc-mrd-table{cursor:pointer;user-select:none}.mrd-table__header--sortable.sc-mrd-table:hover{background:var(--mrd-color-neutral-50);color:var(--mrd-color-neutral-800)}.mrd-table__header--sorted-asc.sc-mrd-table,.mrd-table__header--sorted-desc.sc-mrd-table{color:var(--mrd-color-primary);border-bottom-color:var(--mrd-color-primary)}.mrd-table__header--filtered.sc-mrd-table{color:var(--mrd-color-primary);border-bottom-color:var(--mrd-color-primary)}.mrd-table__header-label.sc-mrd-table{margin-right:var(--mrd-space-1)}.mrd-table__sort-icon.sc-mrd-table{font-size:0.85rem;opacity:0.4;vertical-align:middle}.mrd-table__header--sorted-asc.sc-mrd-table .mrd-table__sort-icon.sc-mrd-table,.mrd-table__header--sorted-desc.sc-mrd-table .mrd-table__sort-icon.sc-mrd-table{opacity:1;color:var(--mrd-color-primary)}.mrd-table__filter-icon.sc-mrd-table{display:inline-flex;align-items:center;vertical-align:middle;margin-left:var(--mrd-space-1);color:var(--mrd-color-primary)}.mrd-table__row.sc-mrd-table{border-bottom:1px solid var(--mrd-border-color)}.mrd-table__row.sc-mrd-table:hover{background:var(--mrd-color-neutral-200) !important}.mrd-table__row--clickable.sc-mrd-table{cursor:pointer}.mrd-table__row--loading.sc-mrd-table{background:transparent}.mrd-table__row--failed.sc-mrd-table{background:transparent}.mrd-table__spacer.sc-mrd-table{border:none}.mrd-table__spacer.sc-mrd-table td.sc-mrd-table{padding:0;border:none}.mrd-table__cell.sc-mrd-table{padding:var(--mrd-space-2) var(--mrd-space-4);vertical-align:top;white-space:nowrap}.mrd-table__cell--numeric.sc-mrd-table{text-align:right;font-variant-numeric:tabular-nums}.mrd-table__cell--placeholder.sc-mrd-table{padding:var(--mrd-space-2) var(--mrd-space-4);border-bottom:1px solid var(--mrd-border-color)}.mrd-table__cell--failed.sc-mrd-table{padding:var(--mrd-space-2) var(--mrd-space-4);border-bottom:1px solid var(--mrd-border-color)}.mrd-table__placeholder-bar.sc-mrd-table{display:block;height:0.75rem;width:55%;border-radius:var(--mrd-border-radius-sm);background:linear-gradient(90deg, var(--mrd-color-neutral-200) 25%, var(--mrd-color-neutral-100) 50%, var(--mrd-color-neutral-200) 75%);background-size:200% 100%;animation:mrd-shimmer 1.4s ease infinite}.mrd-table__retry-button.sc-mrd-table{border:none;background:none;padding:0;color:var(--mrd-color-danger);font-size:inherit;cursor:pointer;text-decoration:underline}.mrd-table__toolbar.sc-mrd-table{display:flex;align-items:center;justify-content:space-between;padding-bottom:var(--mrd-space-2)}.mrd-table__toolbar-left.sc-mrd-table,.mrd-table__toolbar-right.sc-mrd-table{display:flex;gap:var(--mrd-space-2);align-items:center}.mrd-table__toolbar-center.sc-mrd-table{flex:1;display:flex;justify-content:center;align-items:center;gap:var(--mrd-space-1)}.mrd-table__view-switcher.sc-mrd-table{display:flex;align-items:center;gap:var(--mrd-space-1)}.mrd-table__view-arrow.sc-mrd-table{background:none;border:none;cursor:pointer;padding:0 var(--mrd-space-1);color:var(--mrd-color-neutral-500);font-size:var(--mrd-font-size-xs);line-height:1}.mrd-table__view-arrow.sc-mrd-table:hover{color:var(--mrd-color-neutral-800)}.mrd-table__view-title-wrap.sc-mrd-table{position:relative}.mrd-table__view-title.sc-mrd-table{font-size:var(--mrd-font-size-sm);font-weight:600;color:var(--mrd-color-neutral-800);font-family:var(--mrd-font-family);background:none;border:none;outline:none;cursor:pointer;padding:0 var(--mrd-space-1);max-width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mrd-table__view-title.sc-mrd-table:hover{color:var(--mrd-color-primary)}.mrd-table__view-popover.sc-mrd-table{position:absolute;top:calc(100% + var(--mrd-space-1));left:50%;transform:translateX(-50%);background:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-200);border-radius:var(--mrd-radius-md);box-shadow:var(--mrd-shadow-md);z-index:100;min-width:160px;padding:var(--mrd-space-1) 0}.mrd-table__view-popover-item.sc-mrd-table{display:block;width:100%;text-align:left;background:none;border:none;cursor:pointer;padding:var(--mrd-space-2) var(--mrd-space-3);font-size:var(--mrd-font-size-sm);font-family:var(--mrd-font-family);color:var(--mrd-color-neutral-700);white-space:nowrap}.mrd-table__view-popover-item.sc-mrd-table:hover{background:var(--mrd-color-neutral-50)}.mrd-table__view-popover-item--active.sc-mrd-table{font-weight:600;color:var(--mrd-color-primary)}.mrd-table__action.sc-mrd-table{position:relative;display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0;background:transparent;border:1px solid transparent;border-radius:var(--mrd-border-radius);cursor:pointer;color:var(--mrd-color-neutral-400);transition:background-color 0.15s, border-color 0.15s, color 0.15s}.mrd-table__action.sc-mrd-table:hover{background-color:var(--mrd-color-neutral-100);border-color:var(--mrd-color-neutral-300);color:var(--mrd-color-neutral-700)}.mrd-table__action.sc-mrd-table:hover .mrd-table__action-tooltip.sc-mrd-table{display:block}.mrd-table__action.sc-mrd-table:disabled{opacity:0.4;cursor:not-allowed}.mrd-table__action--primary.sc-mrd-table{color:var(--mrd-color-neutral-500)}.mrd-table__action--primary.sc-mrd-table:hover{background:var(--mrd-color-primary);border-color:var(--mrd-color-primary);color:var(--mrd-color-white)}.mrd-table__action--danger.sc-mrd-table{color:var(--mrd-color-error)}.mrd-table__action--danger.sc-mrd-table:hover{background-color:var(--mrd-color-error-light, #fef2f2);border-color:var(--mrd-color-error)}.mrd-table__action-icon.sc-mrd-table{width:1.25rem;height:1.25rem;pointer-events:none;fill:currentColor}.mrd-table__action-tooltip.sc-mrd-table{display:none;position:absolute;bottom:calc(100% + 6px);right:0;padding:var(--mrd-space-1) var(--mrd-space-2);font-size:var(--mrd-font-size-xs);white-space:nowrap;background:var(--mrd-color-tooltip, #fffce1);color:var(--mrd-color-neutral-900);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-sm, var(--mrd-border-radius));pointer-events:none;z-index:10}.mrd-table__create-picker-wrap.sc-mrd-table{position:relative}.mrd-table__create-picker.sc-mrd-table{position:absolute;right:0;top:calc(100% + 4px);background:var(--mrd-color-white, #fff);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);box-shadow:var(--mrd-shadow-md, 0 4px 12px rgba(0, 0, 0, 0.12));z-index:10;min-width:10rem;padding:var(--mrd-space-1) 0}.mrd-table__create-picker-item.sc-mrd-table{display:block;width:100%;text-align:left;padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:none;cursor:pointer;font-size:var(--mrd-font-size-sm);font-family:var(--mrd-font-family);color:var(--mrd-color-neutral-800)}.mrd-table__create-picker-item.sc-mrd-table:hover{background:var(--mrd-color-neutral-50);color:var(--mrd-color-neutral-900)}.mrd-table__filter-toggle--active.sc-mrd-table{background:var(--mrd-color-primary);border-color:var(--mrd-color-primary);color:var(--mrd-color-white)}.mrd-table__filter-toggle--active.sc-mrd-table:hover{background:var(--mrd-color-primary-dark, var(--mrd-color-primary));border-color:var(--mrd-color-primary-dark, var(--mrd-color-primary));color:var(--mrd-color-white)}.mrd-table__filter-badge.sc-mrd-table{position:absolute;top:-6px;right:-6px;min-width:1.25rem;height:1.25rem;padding:0 3px;background:var(--mrd-color-error, #e53e3e);color:var(--mrd-color-white);border-radius:9999px;font-size:0.65rem;font-weight:var(--mrd-font-weight-medium);line-height:1.25rem;text-align:center;pointer-events:none}.mrd-table__filter-popup.sc-mrd-table{position:fixed;width:280px;background:var(--mrd-color-white);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);box-shadow:var(--mrd-shadow-md, 0 4px 12px rgba(0, 0, 0, 0.12));z-index:var(--mrd-z-dropdown, 200);font-size:var(--mrd-font-size-sm)}.mrd-table__filter-popup-header.sc-mrd-table{display:flex;align-items:center;justify-content:space-between;padding:var(--mrd-space-2) var(--mrd-space-3);border-bottom:1px solid var(--mrd-border-color)}.mrd-table__filter-popup-title.sc-mrd-table{font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800);font-size:var(--mrd-font-size-sm)}.mrd-table__filter-close.sc-mrd-table{background:transparent;border:none;cursor:pointer;color:var(--mrd-color-neutral-500);font-size:0.9rem;padding:2px 4px;border-radius:3px;line-height:1}.mrd-table__filter-close.sc-mrd-table:hover{background:var(--mrd-color-neutral-100);color:var(--mrd-color-neutral-800)}.mrd-table__filter-section.sc-mrd-table{padding:var(--mrd-space-2) var(--mrd-space-3)}.mrd-table__filter-section-label.sc-mrd-table{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-medium);text-transform:uppercase;letter-spacing:0.04em;color:var(--mrd-color-neutral-500);margin-bottom:var(--mrd-space-2)}.mrd-table__filter-sort-buttons.sc-mrd-table{display:flex;gap:var(--mrd-space-2)}.mrd-table__filter-sort-btn.sc-mrd-table{flex:1;padding:var(--mrd-space-1) var(--mrd-space-2);background:transparent;border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);cursor:pointer;font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-700)}.mrd-table__filter-sort-btn.sc-mrd-table:hover{background:var(--mrd-color-neutral-100)}.mrd-table__filter-sort-btn--active.sc-mrd-table{background:var(--mrd-color-primary);border-color:var(--mrd-color-primary);color:var(--mrd-color-white)}.mrd-table__filter-divider.sc-mrd-table{height:1px;background:var(--mrd-border-color);margin:0}.mrd-table__filter-editor.sc-mrd-table{display:flex;flex-direction:column;gap:var(--mrd-space-2)}.mrd-table__filter-select.sc-mrd-table,.mrd-table__filter-input.sc-mrd-table{width:100%;padding:var(--mrd-space-1) var(--mrd-space-2);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-900);background:var(--mrd-color-white);box-sizing:border-box}.mrd-table__filter-select.sc-mrd-table:focus,.mrd-table__filter-input.sc-mrd-table:focus{outline:none;border-color:var(--mrd-color-primary);box-shadow:0 0 0 2px rgba(0, 0, 0, 0.06)}.mrd-table__filter-range.sc-mrd-table{display:flex;align-items:center;gap:var(--mrd-space-1)}.mrd-table__filter-range.sc-mrd-table .mrd-table__filter-input.sc-mrd-table{flex:1;min-width:0}.mrd-table__filter-range--stacked.sc-mrd-table{flex-direction:column;align-items:stretch;gap:var(--mrd-space-2)}.mrd-table__filter-range-sep.sc-mrd-table{color:var(--mrd-color-neutral-400);flex-shrink:0}.mrd-table__filter-range-label.sc-mrd-table{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);margin-bottom:2px}.mrd-table__filter-radio-group.sc-mrd-table{display:flex;flex-direction:column;gap:var(--mrd-space-1)}.mrd-table__filter-radio-group--inline.sc-mrd-table{flex-direction:row;gap:var(--mrd-space-3)}.mrd-table__filter-radio-label.sc-mrd-table{display:flex;align-items:center;gap:var(--mrd-space-1);cursor:pointer;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800)}.mrd-table__filter-list.sc-mrd-table{display:flex;flex-direction:column;gap:var(--mrd-space-1);max-height:180px;overflow-y:auto}.mrd-table__filter-list-controls.sc-mrd-table{display:flex;gap:var(--mrd-space-2);margin-bottom:var(--mrd-space-1)}.mrd-table__filter-list-btn.sc-mrd-table{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-primary);background:transparent;border:none;cursor:pointer;padding:0;text-decoration:underline}.mrd-table__filter-checkbox-label.sc-mrd-table{display:flex;align-items:center;gap:var(--mrd-space-1);cursor:pointer;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800)}.mrd-table__filter-no-support.sc-mrd-table{font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-500);margin:0;font-style:italic}.mrd-table__filter-popup-footer.sc-mrd-table{display:flex;justify-content:flex-end;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-space-3);border-top:1px solid var(--mrd-border-color)}.mrd-table__filter-btn.sc-mrd-table{padding:var(--mrd-space-1) var(--mrd-space-3);border-radius:var(--mrd-border-radius);border:1px solid var(--mrd-border-color);font-size:var(--mrd-font-size-sm);cursor:pointer}.mrd-table__filter-btn--clear.sc-mrd-table{background:transparent;color:var(--mrd-color-neutral-600)}.mrd-table__filter-btn--clear.sc-mrd-table:hover{background:var(--mrd-color-neutral-100)}.mrd-table__filter-btn--apply.sc-mrd-table{background:var(--mrd-color-primary);border-color:var(--mrd-color-primary);color:var(--mrd-color-white)}.mrd-table__filter-btn--apply.sc-mrd-table:hover{background:var(--mrd-color-primary-dark, var(--mrd-color-primary));border-color:var(--mrd-color-primary-dark, var(--mrd-color-primary))}.mrd-table__totals-row.sc-mrd-table{border-top:2px solid var(--mrd-border-color)}.mrd-table__totals-cell.sc-mrd-table{position:sticky;bottom:0;z-index:2;padding:var(--mrd-space-2) var(--mrd-space-4);background:var(--mrd-color-white);font-weight:var(--mrd-font-weight-medium);font-variant-numeric:tabular-nums;white-space:nowrap;border-top:2px solid var(--mrd-border-color)}.mrd-table__totals-cell--numeric.sc-mrd-table{text-align:right}.mrd-table__footer.sc-mrd-table{padding:var(--mrd-space-1) var(--mrd-space-2);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);text-align:right}.mrd-table__empty.sc-mrd-table{padding:var(--mrd-space-4) var(--mrd-space-3);color:var(--mrd-color-neutral-500);font-size:var(--mrd-font-size-sm);text-align:center;margin:0}.mrd-table__file-btn.sc-mrd-table{display:inline-flex;align-items:center;gap:var(--mrd-space-1);background:none;border:none;padding:0;cursor:pointer;color:var(--mrd-color-primary);font-size:var(--mrd-font-size-sm);font-family:inherit;max-width:100%;overflow:hidden}.mrd-table__file-btn.sc-mrd-table:hover{text-decoration:underline;color:var(--mrd-color-primary-dark)}.mrd-table__file-icon.sc-mrd-table{flex-shrink:0;width:1rem;height:1rem}.mrd-table__textblock-btn.sc-mrd-table{display:inline;background:none;border:none;padding:0 0 0 var(--mrd-space-1);cursor:pointer;color:var(--mrd-color-primary);font-size:var(--mrd-font-size-sm);font-family:inherit;line-height:inherit;vertical-align:middle}.mrd-table__textblock-btn.sc-mrd-table:hover{color:var(--mrd-color-primary-dark)}.mrd-table__modal-backdrop.sc-mrd-table{position:fixed;inset:0;background:rgba(0, 0, 0, 0.4);z-index:var(--mrd-z-modal, 300);display:flex;align-items:center;justify-content:center}.mrd-table__modal.sc-mrd-table{background:#fff;border-radius:var(--mrd-radius-md, 0.5rem);padding:var(--mrd-space-6);max-width:min(600px, 90vw);max-height:70vh;overflow-y:auto;position:relative;box-shadow:var(--mrd-shadow-lg)}.mrd-table__modal-close.sc-mrd-table{position:absolute;top:var(--mrd-space-3);right:var(--mrd-space-3);background:none;border:none;cursor:pointer;font-size:1.25rem;line-height:1;color:var(--mrd-color-text-muted, #6b7280);padding:0}.mrd-table__modal-close.sc-mrd-table:hover{color:var(--mrd-color-text, #111827)}.mrd-table__modal-text.sc-mrd-table{margin:0;padding-right:var(--mrd-space-6);white-space:pre-wrap;word-break:break-word;font-size:var(--mrd-font-size-sm);line-height:1.6}.mrd-table__json-preview.sc-mrd-table{font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:inline-block;max-width:calc(100% - 1.5rem);vertical-align:middle}.mrd-table__modal-json.sc-mrd-table{margin:0;padding-right:var(--mrd-space-6);font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);white-space:pre-wrap;word-break:break-word;line-height:1.6;background:none;border:none}@keyframes mrd-shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}"}},[2,"mrd-table",{item:[16],parentId:[1,"parent-id"],rows:[16],locale:[1],totalElements:[2,"total-elements"],pageSize:[2,"page-size"],rowHeight:[2,"row-height"],tableHeight:[2,"table-height"],requestTimeoutMs:[2,"request-timeout-ms"],activeViewIdx:[32],loadedPages:[32],requestedPages:[32],failedPages:[32],renderStart:[32],renderEnd:[32],colWidths:[32],sortField:[32],sortDir:[32],filterMode:[32],activeFilters:[32],openFilterCol:[32],pendingFilter:[32],popupPos:[32],createPickerOpen:[32],viewPopoverOpen:[32],scrollTop:[32],textblockModal:[32],jsonModal:[32],aggregations:[32],aggregationsTotal:[32],minKnownTotal:[32],init:[64],setPage:[64],setAggregations:[64]},void 0,{totalElements:[{totalElementsChanged:0}],item:[{itemChanged:0}]}]);function D(){"undefined"!=typeof customElements&&["mrd-table"].forEach((t=>{"mrd-table"===t&&(customElements.get(o(t))||customElements.define(o(t),A))}))}export{C,A as M,D as d}
1
+ import{h as t,proxyCustomElement as r,HTMLElement as e,createEvent as l,writeTask as i,Host as a,transformTag as o}from"@stencil/core/internal/client";import{t as s}from"./i18n.js";import{a as d,b as n}from"./query-params.js";import{C as c}from"./cell-renderer.js";import{c as m,d as h,b}from"./format.js";const u=new Set(["TEXT","TEXTBLOCK","EMAIL","HYPERLINK"]),p=new Set(["INTEGER","DECIMAL","PERCENTAGE","CURRENCY"]),_=new Set(["DATE","DATETIME","TIME"]),v=new Set(["FILE","IMAGE"]),f=new Set(["LONGTEXT","JSON","FILE","IMAGE"]);function g(t,r){var e,l,i;const a=new URLSearchParams(t);a.delete("page"),a.delete("sort");const o=function(t){var r;const e={sum:[],avg:[],count:[]};for(const l of t){if("FIELD"!==l.type||!l.aggregate)continue;const t=l.aggregate.toLowerCase();t in e&&e[t].push(null!==(r=l.name)&&void 0!==r?r:"")}const l={};return e.sum.length&&(l.sum=e.sum),e.avg.length&&(l.avg=e.avg),e.count.length&&(l.count=e.count),Object.keys(l).length>0?l:null}(r);return(null===(e=null==o?void 0:o.sum)||void 0===e?void 0:e.length)&&a.set("sum",o.sum.join(",")),(null===(l=null==o?void 0:o.avg)||void 0===l?void 0:l.length)&&a.set("avg",o.avg.join(",")),(null===(i=null==o?void 0:o.count)||void 0===i?void 0:i.length)&&a.set("count",o.count.join(",")),a.toString()}function w(t){if(!t)return t;const[r,e,l]=t.split("-").map(Number);return new Date(r,e-1,l).toISOString().replace(/\.\d{3}Z$/,"Z")}function y(t){if(!t)return t;const[r,e,l]=t.split("-").map(Number);return new Date(r,e-1,l+1).toISOString().replace(/\.\d{3}Z$/,"Z")}const k=()=>t("span",{class:"mrd-table__filter-icon","aria-hidden":"true"},t("svg",{viewBox:"0 0 24 24",width:"14",height:"14",fill:"currentColor"},t("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"}))),x=({col:r,row:e,locale:l,onDownload:i,onOpenTextblock:a,onOpenJson:o})=>{var d,n,m;const h=null!==(d=r.dataType)&&void 0!==d?d:"",b="FIELD"===r.type&&p.has(h);if("FIELD"===r.type&&("FILE"===h||"IMAGE"===h)){const a=null!==(n=r.name)&&void 0!==n?n:"",o=null==e?void 0:e[a],d=null==o?void 0:o.href,c=null==o?void 0:o.fileName;return t("td",{class:"mrd-table__cell"},d&&c?t("button",{class:"mrd-table__file-btn",title:c,onClick:t=>{t.stopPropagation(),i({href:d,fileName:c})}},t("svg",{class:"mrd-table__file-icon",viewBox:"0 0 24 24","aria-hidden":"true"},t("path",{fill:"currentColor",d:"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm-1 7V3.5L18.5 9H13zm-3 8l-3-3 1.41-1.41L10 14.17l4.59-4.58L16 11l-6 6z"})),s("download",l)):"")}if("JSON"===h){const i=null!==(m=r.name)&&void 0!==m?m:"",a=i?null==e?void 0:e[i]:void 0;if(null==a||""===a)return t("td",{class:"mrd-table__cell"});const d=c.formatJson(a,!0),n=c.formatJson(a,!1);return t("td",{class:"mrd-table__cell"},t("span",{class:"mrd-table__json-preview",innerHTML:d}),t("button",{class:"mrd-table__textblock-btn",onClick:t=>{t.stopPropagation(),o(n)},"aria-label":s("textblock_show_more",l)},"⋯"))}if("TEXTBLOCK"===h){const i=c.render(r,e,l);if(i.length<=200)return t("td",{class:"mrd-table__cell"},i);const o=i.slice(0,200)+"…";return t("td",{class:"mrd-table__cell"},o,t("button",{class:"mrd-table__textblock-btn",onClick:t=>{t.stopPropagation(),a(i)},"aria-label":s("textblock_show_more",l)},"⋯"))}const u=c.render(r,e,l);return t("td",{class:"mrd-table__cell"+(b?" mrd-table__cell--numeric":"")},u)},E=({columns:r,aggregations:e,locale:l})=>e&&r.some((t=>"FIELD"===t.type&&t.aggregate))?t("tfoot",null,t("tr",{class:"mrd-table__totals-row"},r.map((r=>{var i;const a=function(t,r,e){var l,i;if("FIELD"!==t.type||!t.aggregate||!r)return"";const a=null===(l=r[t.aggregate.toLowerCase()])||void 0===l?void 0:l[null!==(i=t.name)&&void 0!==i?i:""];if(null==a)return"";const o=t.dataType;return"INTEGER"===o?m(a,e,{maximumFractionDigits:0}):"PERCENTAGE"===o?h(a,e):"CURRENCY"===o&&t.currencyCode?b(a,t.currencyCode,e):m(a,e)}(r,e,l),o="FIELD"===r.type&&p.has(null!==(i=r.dataType)&&void 0!==i?i:"");return t("td",{class:"mrd-table__totals-cell"+(o?" mrd-table__totals-cell--numeric":"")},a)})))):null,C=({text:r,locale:e,onClose:l})=>null===r?null:t("div",{class:"mrd-table__modal-backdrop",onClick:l,role:"dialog","aria-modal":"true"},t("div",{class:"mrd-table__modal",onClick:t=>t.stopPropagation()},t("button",{class:"mrd-table__modal-close",onClick:l,"aria-label":s("close",e)},"✕"),t("p",{class:"mrd-table__modal-text"},r))),z=({html:r,locale:e,onClose:l})=>null===r?null:t("div",{class:"mrd-table__modal-backdrop",onClick:l,role:"dialog","aria-modal":"true"},t("div",{class:"mrd-table__modal",onClick:t=>t.stopPropagation()},t("button",{class:"mrd-table__modal-close",onClick:l,"aria-label":s("close",e)},"✕"),t("pre",{class:"mrd-table__modal-json",innerHTML:r}))),T=({locale:r,filterMode:e,filterCount:l,actions:i,views:a,activeViewIdx:o,viewPopoverOpen:d,createPickerOpen:n,createTypes:c,cb:m})=>{var h;const b=i.length>0,u=a.length>1;return t("div",{class:"mrd-table__toolbar"},t("div",{class:"mrd-table__toolbar-left"},t("button",{class:"mrd-table__action mrd-table__action--secondary mrd-table__filter-toggle"+(e?" mrd-table__filter-toggle--active":""),onClick:m.onFilterToggle},t("svg",{class:"mrd-table__action-icon",viewBox:"0 0 24 24","aria-hidden":"true"},t("path",{fill:"currentColor",d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"})),l>0&&t("span",{class:"mrd-table__filter-badge"},l),t("span",{class:"mrd-table__action-tooltip"},s(e?"table_filter_hide":"table_filter",r),l>0?` (${l} ${s("table_filter_active",r)})`:"")),l>0&&t("button",{class:"mrd-table__action mrd-table__action--secondary",onClick:m.onClearAllFilters},t("svg",{class:"mrd-table__action-icon",viewBox:"0 0 24 24","aria-hidden":"true"},t("path",{fill:"currentColor",d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),t("span",{class:"mrd-table__action-tooltip"},s("table_filter_clear_all",r)))),u&&t("div",{class:"mrd-table__toolbar-center"},t("div",{class:"mrd-table__view-switcher"},t("button",{class:"mrd-table__view-arrow","aria-label":"Previous view",onClick:()=>m.onViewSwitch((o-1+a.length)%a.length)},"◀"),t("div",{class:"mrd-table__view-title-wrap"},t("button",{class:"mrd-table__view-title",onClick:t=>m.onToggleViewPopover(t)},null===(h=a[o])||void 0===h?void 0:h.label),d&&t("div",{class:"mrd-table__view-popover",onClick:t=>t.stopPropagation()},a.map(((r,e)=>t("button",{key:String(e),class:"mrd-table__view-popover-item"+(e===o?" mrd-table__view-popover-item--active":""),onClick:()=>{e!==o&&m.onViewSwitch(e),m.onCloseViewPopover()}},r.label))))),t("button",{class:"mrd-table__view-arrow","aria-label":"Next view",onClick:()=>m.onViewSwitch((o+1)%a.length)},"▶"))),b&&t("div",{class:"mrd-table__toolbar-right"},i.map((r=>{var e,l;const i="create"===r.action?c:null;return(null==i?void 0:i.length)?t("div",{class:"mrd-table__create-picker-wrap",key:`action-${r.action}`},t("button",{class:`mrd-table__action mrd-table__action--${null!==(e=r.variant)&&void 0!==e?e:"secondary"}`,onClick:m.onToggleCreatePicker},r.icon?t("svg",{class:"mrd-table__action-icon","aria-hidden":"true"},t("use",{href:r.icon})):r.label,t("span",{class:"mrd-table__action-tooltip"},r.label)),n&&t("div",{class:"mrd-table__create-picker"},i.map((r=>t("button",{key:r.type,class:"mrd-table__create-picker-item",onClick:()=>m.onCreate(r.type)},r.label))))):t("button",{key:`action-${r.action}`,class:`mrd-table__action mrd-table__action--${null!==(l=r.variant)&&void 0!==l?l:"secondary"}`,disabled:r.disabled,onClick:()=>m.onAction(r.action)},r.icon?t("svg",{class:"mrd-table__action-icon","aria-hidden":"true"},t("use",{href:r.icon})):r.label,t("span",{class:"mrd-table__action-tooltip"},r.label))}))))},M=({col:r,dataType:e,openFilterCol:l,pendingFilter:i,locale:a,cb:o})=>{var d,n,c,m,h,b;const f=i;if(v.has(e))return t("p",{class:"mrd-table__filter-no-support"},s("filter_no_support",a));if("BOOLEAN"===e){const r=f.operator,e="isEmpty"===r||"isNotEmpty"===r;return t("div",{class:"mrd-table__filter-radio-group"},[{labelKey:"filter_all",value:null},{labelKey:"yes",value:!0},{labelKey:"no",value:!1}].map((r=>t("label",{class:"mrd-table__filter-radio-label"},t("input",{type:"radio",name:`bf-${l}`,checked:!e&&f.value===r.value,onChange:()=>o.onReplacePending(Object.assign(Object.assign({},f),{operator:void 0,value:r.value}))}),s(r.labelKey,a)))),t("label",{class:"mrd-table__filter-radio-label"},t("input",{type:"radio",name:`bf-${l}`,checked:"isEmpty"===r,onChange:()=>o.onReplacePending(Object.assign(Object.assign({},f),{operator:"isEmpty",value:void 0}))}),s("filter_is_empty",a)),t("label",{class:"mrd-table__filter-radio-label"},t("input",{type:"radio",name:`bf-${l}`,checked:"isNotEmpty"===r,onChange:()=>o.onReplacePending(Object.assign(Object.assign({},f),{operator:"isNotEmpty",value:void 0}))}),s("filter_is_not_empty",a)))}if("LIST"===e){const e=null!==(d=r.listItems)&&void 0!==d?d:[],l=null!==(n=f.values)&&void 0!==n?n:[];return t("div",{class:"mrd-table__filter-list"},t("div",{class:"mrd-table__filter-list-controls"},t("button",{class:"mrd-table__filter-list-btn",onClick:()=>o.onReplacePending(Object.assign(Object.assign({},f),{values:e.map((t=>t.key))}))},s("filter_select_all",a)),t("button",{class:"mrd-table__filter-list-btn",onClick:()=>o.onReplacePending(Object.assign(Object.assign({},f),{values:[]}))},s("filter_select_none",a))),e.map((r=>t("label",{class:"mrd-table__filter-checkbox-label"},t("input",{type:"checkbox",checked:l.includes(r.key),onChange:t=>o.onToggleValue(r.key,t.target.checked)}),r.label))))}if(u.has(e)||"RELATION"===e){const r=null!==(c=f.operator)&&void 0!==c?c:"startsWith",e="isEmpty"===r||"isNotEmpty"===r;return t("div",{class:"mrd-table__filter-editor"},t("select",{class:"mrd-table__filter-select",onChange:t=>o.onSetPending("operator",t.target.value)},[{val:"startsWith",labelKey:"filter_starts_with"},{val:"equals",labelKey:"filter_equals"},{val:"isEmpty",labelKey:"filter_is_empty"},{val:"isNotEmpty",labelKey:"filter_is_not_empty"}].map((e=>t("option",{value:e.val,selected:r===e.val},s(e.labelKey,a))))),!e&&t("input",{type:"text",class:"mrd-table__filter-input",value:String(null!==(m=f.value)&&void 0!==m?m:""),placeholder:s("filter_search_value",a),onInput:t=>o.onSetPending("value",t.target.value)}))}if(p.has(e)){const r=f.operator,e="isEmpty"===r||"isNotEmpty"===r,i=!e&&(void 0!==f.from||void 0!==f.to);return t("div",{class:"mrd-table__filter-editor"},t("select",{class:"mrd-table__filter-select",onChange:t=>{const r=t.target.value;o.onReplacePending(Object.assign(Object.assign({},f),"isEmpty"===r||"isNotEmpty"===r?{operator:r,value:void 0,from:void 0,to:void 0}:{operator:void 0}))}},t("option",{value:"",selected:!e},s("filter_has_value",a)),t("option",{value:"isEmpty",selected:"isEmpty"===r},s("filter_is_empty",a)),t("option",{value:"isNotEmpty",selected:"isNotEmpty"===r},s("filter_is_not_empty",a))),!e&&t("div",{class:"mrd-table__filter-editor"},t("div",{class:"mrd-table__filter-radio-group mrd-table__filter-radio-group--inline"},t("label",{class:"mrd-table__filter-radio-label"},t("input",{type:"radio",name:`nm-${l}`,checked:!i,onChange:()=>o.onReplacePending(Object.assign(Object.assign({},f),{from:void 0,to:void 0}))}),s("filter_exact",a)),t("label",{class:"mrd-table__filter-radio-label"},t("input",{type:"radio",name:`nm-${l}`,checked:i,onChange:()=>o.onReplacePending(Object.assign(Object.assign({},f),{value:void 0,from:null,to:null}))}),s("filter_range",a))),i?t("div",{class:"mrd-table__filter-range"},t("input",{type:"number",class:"mrd-table__filter-input",placeholder:s("filter_from",a),value:null!=f.from?String(f.from):"",onInput:t=>o.onSetPending("from",t.target.value)}),t("span",{class:"mrd-table__filter-range-sep"},"–"),t("input",{type:"number",class:"mrd-table__filter-input",placeholder:s("filter_to",a),value:null!=f.to?String(f.to):"",onInput:t=>o.onSetPending("to",t.target.value)})):t("input",{type:"number",class:"mrd-table__filter-input",value:null!=f.value?String(f.value):"",onInput:t=>o.onSetPending("value",t.target.value)})))}if("DATETIME"===e){const r=f.operator,e="isEmpty"===r||"isNotEmpty"===r,i=!e&&(void 0!==f.from||void 0!==f.to);return t("div",{class:"mrd-table__filter-editor"},t("select",{class:"mrd-table__filter-select",onChange:t=>{const r=t.target.value;o.onReplacePending(Object.assign(Object.assign({},f),"isEmpty"===r||"isNotEmpty"===r?{operator:r,value:void 0,from:void 0,to:void 0}:{operator:void 0}))}},t("option",{value:"",selected:!e},s("filter_has_value",a)),t("option",{value:"isEmpty",selected:"isEmpty"===r},s("filter_is_empty",a)),t("option",{value:"isNotEmpty",selected:"isNotEmpty"===r},s("filter_is_not_empty",a))),!e&&t("div",{class:"mrd-table__filter-editor"},t("div",{class:"mrd-table__filter-radio-group mrd-table__filter-radio-group--inline"},t("label",{class:"mrd-table__filter-radio-label"},t("input",{type:"radio",name:`dt-${l}`,checked:!i,onChange:()=>o.onReplacePending(Object.assign(Object.assign({},f),{from:void 0,to:void 0}))}),s("filter_exact",a)),t("label",{class:"mrd-table__filter-radio-label"},t("input",{type:"radio",name:`dt-${l}`,checked:i,onChange:()=>o.onReplacePending(Object.assign(Object.assign({},f),{value:void 0,from:null,to:null}))}),s("filter_range",a))),i?t("div",{class:"mrd-table__filter-range mrd-table__filter-range--stacked"},t("label",{class:"mrd-table__filter-range-label"},s("filter_from",a)),t("input",{type:"date",class:"mrd-table__filter-input",value:null!=f.from?String(f.from):"",onInput:t=>o.onSetPending("from",t.target.value)}),t("label",{class:"mrd-table__filter-range-label"},s("filter_to",a)),t("input",{type:"date",class:"mrd-table__filter-input",value:null!=f.to?String(f.to):"",onInput:t=>o.onSetPending("to",t.target.value)})):t("input",{type:"date",class:"mrd-table__filter-input",value:String(null!==(h=f.value)&&void 0!==h?h:""),onInput:t=>o.onSetPending("value",t.target.value)})))}if(_.has(e)){const r="DATE"===e?"date":"time",i=f.operator,d="isEmpty"===i||"isNotEmpty"===i,n=!d&&(void 0!==f.from||void 0!==f.to);return t("div",{class:"mrd-table__filter-editor"},t("select",{class:"mrd-table__filter-select",onChange:t=>{const r=t.target.value;o.onReplacePending(Object.assign(Object.assign({},f),"isEmpty"===r||"isNotEmpty"===r?{operator:r,value:void 0,from:void 0,to:void 0}:{operator:void 0}))}},t("option",{value:"",selected:!d},s("filter_has_value",a)),t("option",{value:"isEmpty",selected:"isEmpty"===i},s("filter_is_empty",a)),t("option",{value:"isNotEmpty",selected:"isNotEmpty"===i},s("filter_is_not_empty",a))),!d&&t("div",{class:"mrd-table__filter-editor"},t("div",{class:"mrd-table__filter-radio-group mrd-table__filter-radio-group--inline"},t("label",{class:"mrd-table__filter-radio-label"},t("input",{type:"radio",name:`dt-${l}`,checked:!n,onChange:()=>o.onReplacePending(Object.assign(Object.assign({},f),{from:void 0,to:void 0}))}),s("filter_exact",a)),t("label",{class:"mrd-table__filter-radio-label"},t("input",{type:"radio",name:`dt-${l}`,checked:n,onChange:()=>o.onReplacePending(Object.assign(Object.assign({},f),{value:void 0,from:null,to:null}))}),s("filter_range",a))),n?t("div",{class:"mrd-table__filter-range"},t("input",{type:r,class:"mrd-table__filter-input",placeholder:s("filter_from",a),value:null!=f.from?String(f.from):"",onInput:t=>o.onSetPending("from",t.target.value)}),t("input",{type:r,class:"mrd-table__filter-input",placeholder:s("filter_to",a),value:null!=f.to?String(f.to):"",onInput:t=>o.onSetPending("to",t.target.value)})):t("input",{type:r,class:"mrd-table__filter-input",value:String(null!==(b=f.value)&&void 0!==b?b:""),onInput:t=>o.onSetPending("value",t.target.value)})))}return null},O=r=>{var e;const{col:l,openFilterCol:i,popupPos:a,sortField:o,sortDir:d,locale:n,cb:c}=r,m=null!==(e=l.label)&&void 0!==e?e:i,h=o===i;return t("div",{class:"mrd-table__filter-popup",style:{top:`${a.top}px`,left:`${a.left}px`},onClick:t=>t.stopPropagation()},t("div",{class:"mrd-table__filter-popup-header"},t("span",{class:"mrd-table__filter-popup-title"},m),t("button",{class:"mrd-table__filter-close",onClick:c.onClose},"✕")),t("div",{class:"mrd-table__filter-section"},t("div",{class:"mrd-table__filter-section-label"},s("filter_sorting",n)),t("div",{class:"mrd-table__filter-sort-buttons"},t("button",{class:"mrd-table__filter-sort-btn"+(h&&"asc"===d?" mrd-table__filter-sort-btn--active":""),onClick:()=>c.onApplySort("asc")},"▲ ",s("filter_ascending",n)),t("button",{class:"mrd-table__filter-sort-btn"+(h&&"desc"===d?" mrd-table__filter-sort-btn--active":""),onClick:()=>c.onApplySort("desc")},"▼ ",s("filter_descending",n)))),t("div",{class:"mrd-table__filter-divider"}),t("div",{class:"mrd-table__filter-section"},t("div",{class:"mrd-table__filter-section-label"},s("filter_section",n)),t(M,Object.assign({},r))),t("div",{class:"mrd-table__filter-popup-footer"},t("button",{class:"mrd-table__filter-btn mrd-table__filter-btn--clear",onClick:c.onClear},s("filter_clear",n)),t("button",{class:"mrd-table__filter-btn mrd-table__filter-btn--apply",onClick:c.onApply},s("filter_apply",n))))};function S(t,r){return Math.ceil(t/r)}function j(t,r,e){return{firstPage:Math.floor(t/e),lastPage:Math.floor(r/e)}}const P=r(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.mrdLoadPage=l(this,"mrdLoadPage",7),this.mrdPageError=l(this,"mrdPageError",7),this.mrdRowClick=l(this,"mrdRowClick",7),this.mrdAction=l(this,"mrdAction",7),this.mrdDownload=l(this,"mrdDownload",7),this.mrdLoadAggregations=l(this,"mrdLoadAggregations",7),this.pendingPages=new Set,this.debounceTimer=null,this.requestedAt=new Map,this.retryAttempts=new Map,this.staleCheckTimer=null,this.outsideClickHandler=null,this.keydownHandler=null,this.createPickerClickHandler=null,this.viewPopoverClickHandler=null,this.colWidthMeasureScheduled=!1,this.item=null,this.parentId="",this.rows=[],this.locale=navigator.language,this.totalElements=0,this.pageSize=20,this.rowHeight=36,this.tableHeight=500,this.requestTimeoutMs=15e3,this.activeViewIdx=0,this.loadedPages=new Map,this.requestedPages=new Set,this.failedPages=new Set,this.renderStart=0,this.renderEnd=0,this.colWidths=[],this.sortField="",this.sortDir="asc",this.filterMode=!1,this.activeFilters=new Map,this.openFilterCol=null,this.pendingFilter=null,this.popupPos={top:0,left:0},this.createPickerOpen=!1,this.viewPopoverOpen=!1,this.scrollTop=0,this.textblockModal=null,this.jsonModal=null,this.aggregations=null,this.aggregationsTotal=null,this.aggregationsPending=!1,this.minKnownTotal=0,this.handleScroll=t=>{const r=t.currentTarget,{renderStart:e,renderEnd:l}=function(t,r,e,l){const i=Math.floor(t/r),a=Math.min(i+S(e,r),l-1);return{renderStart:Math.max(0,i-10),renderEnd:Math.min(l-1,a+10)}}(r.scrollTop,this.rowHeight,this.tableHeight,this.baseTotal);this.scrollTop=r.scrollTop,this.renderStart=e,this.renderEnd=l,this.requestPagesForWindow(this.renderStart,this.renderEnd)}}totalElementsChanged(t){this.renderEnd=Math.min(this.renderEnd,Math.max(0,t-1))}itemChanged(t){var r,e;this.activeViewIdx=0,this.applyDefaultSort(null!==(e=null===(r=null==t?void 0:t.view)||void 0===r?void 0:r.defaultSort)&&void 0!==e?e:"")}componentWillLoad(){var t,r,e;this.applyDefaultSort(null!==(e=null===(r=null===(t=this.item)||void 0===t?void 0:t.view)||void 0===r?void 0:r.defaultSort)&&void 0!==e?e:"")}componentDidLoad(){this.staleCheckTimer=setInterval((()=>this.checkStalePages()),2e3)}applyDefaultSort(t){const{field:r,dir:e}=function(t){var r;if(!t)return{field:"",dir:"asc"};const e=t.split(",");return{field:e[0].trim(),dir:"desc"===(null===(r=e[1])||void 0===r?void 0:r.trim())?"desc":"asc"}}(t);this.sortField=r,this.sortDir=e}async init(){null!==this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.pendingPages.clear(),this.loadedPages=new Map,this.requestedPages=new Set,this.failedPages=new Set,this.requestedAt.clear(),this.retryAttempts.clear(),this.colWidths=[],this.colWidthMeasureScheduled=!1,this.scrollTop=0,this.renderStart=0,this.renderEnd=this.visibleCount()-1;const t=this.el.querySelector(".mrd-table__scroll");t&&(t.scrollTop=0),this.aggregations=null,this.aggregationsTotal=null,this.aggregationsPending=!0,this.minKnownTotal=0,this.emitLoadPage(0),this.requestedPages=new Set([0])}async setPage(t,r,e){const l=void 0!==e?!e:r.length<this.pageSize;l?(this.renderEnd=Math.min(this.renderEnd,t*this.pageSize+r.length-1),this.minKnownTotal=t*this.pageSize+r.length):this.minKnownTotal=Math.max(this.minKnownTotal,(t+1)*this.pageSize+1);const i=new Map(this.loadedPages);if(i.set(t,r),this.loadedPages=i,this.requestedAt.delete(t),this.retryAttempts.delete(t),this.failedPages.has(t)){const r=new Set(this.failedPages);r.delete(t),this.failedPages=r}if(0===t&&this.aggregationsPending){this.aggregationsPending=!1;const t=this.columns.some((t=>"FIELD"===t.type&&t.aggregate));l&&!t||this.emitLoadAggregations()}}async setAggregations(t){null!=t.total&&(this.aggregationsTotal=t.total),this.aggregations=t}disconnectedCallback(){null!==this.staleCheckTimer&&(clearInterval(this.staleCheckTimer),this.staleCheckTimer=null),this.outsideClickHandler&&(document.removeEventListener("click",this.outsideClickHandler),this.outsideClickHandler=null),this.createPickerClickHandler&&(document.removeEventListener("click",this.createPickerClickHandler),this.createPickerClickHandler=null),this.keydownHandler&&(document.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=null),this.viewPopoverClickHandler&&(document.removeEventListener("click",this.viewPopoverClickHandler),this.viewPopoverClickHandler=null)}componentDidRender(){0===this.colWidths.length&&!this.colWidthMeasureScheduled&&this.loadedPages.size>0&&this.totalElements>0&&(this.colWidthMeasureScheduled=!0,i((()=>{if(this.colWidthMeasureScheduled=!1,0!==this.colWidths.length)return;const t=this.el.querySelectorAll(".mrd-table__header");t.length>0&&(this.colWidths=Array.from(t).map((t=>t.offsetWidth)))})))}visibleCount(){return S(this.tableHeight,this.rowHeight)}sortParam(){return(t=this.sortField)?"desc"===this.sortDir?`${t},desc`:t:"";var t}get allViews(){var t,r,e,l,i,a,o;if(!this.item)return[];const s=this.item;return[{label:null!==(i=null!==(l=null!==(e=null!==(t=s.label)&&void 0!==t?t:null===(r=s.view)||void 0===r?void 0:r.pluralLabel)&&void 0!==e?e:s.dataClass)&&void 0!==l?l:s.relatedClass)&&void 0!==i?i:"",dataClass:null!==(a=s.dataClass)&&void 0!==a?a:s.relatedClass,fromClass:s.fromClass,filterClass:s.filterClass,view:s.view},...(null!==(o=s.alternativeViews)&&void 0!==o?o:[]).map((t=>{var r,e,l,i;return{label:null!==(i=null!==(l=null!==(r=t.label)&&void 0!==r?r:null===(e=t.view)||void 0===e?void 0:e.pluralLabel)&&void 0!==l?l:t.dataClass)&&void 0!==i?i:"",dataClass:t.dataClass,fromClass:t.fromClass,filterClass:t.filterClass,view:t.view}}))]}buildExcelPath(){var t;const r=this.allViews[this.activeViewIdx];return r?"/excel"+n({isRelatedView:"RELATED_VIEW"===(null===(t=this.item)||void 0===t?void 0:t.type),fromClass:r.fromClass,parentId:this.parentId,dataClass:r.dataClass}):""}buildActionDetail(t,r){var e,l,i;if("export"===t)return{action:t,path:this.buildExcelPath(),qs:this.buildQueryParams(0)};if("create"===t){const a=this.allViews[this.activeViewIdx],o="RELATED_VIEW"===(null===(e=this.item)||void 0===e?void 0:e.type)?`/${null!==(l=null==a?void 0:a.fromClass)&&void 0!==l?l:""}/${this.parentId}`:null;return Object.assign({action:t,dataClass:null!==(i=null==a?void 0:a.dataClass)&&void 0!==i?i:"",parentPath:o},r?{basicType:r}:{})}return{action:t}}buildDataPath(){var t;const r=this.allViews[this.activeViewIdx];return r?n({isRelatedView:"RELATED_VIEW"===(null===(t=this.item)||void 0===t?void 0:t.type),fromClass:r.fromClass,parentId:this.parentId,dataClass:r.dataClass}):""}buildQueryParams(t){var r;const e=this.allViews[this.activeViewIdx];return function(t){var r,e;const l=new URLSearchParams;t.page>0&&l.set("page",String(t.page)),t.sort&&l.set("sort",t.sort),t.filterClass&&l.set("type",t.filterClass),d(l,t.viewFilters);for(const i of t.activeFilters)"isEmpty"!==i.operator?"isNotEmpty"!==i.operator?"startsWith"!==i.operator?(null===(e=i.values)||void 0===e?void 0:e.length)?l.set(i.field,i.values.join(",")):(null!=i.value&&l.set(i.field,String(i.value)),null!=i.from&&l.set(i.field+"_from",String(i.from)),null!=i.to&&l.set(i.field+"_to",String(i.to))):l.set(i.field+"_startswith",String(null!==(r=i.value)&&void 0!==r?r:"")):l.set(i.field+"_notempty","true"):l.set(i.field,"");return l.toString()}({page:t,sort:this.sortParam(),filterClass:null==e?void 0:e.filterClass,viewFilters:null===(r=null==e?void 0:e.view)||void 0===r?void 0:r.filter,activeFilters:this.activeFilters.values()})}get columns(){var t,r,e;return null!==(e=null===(r=null===(t=this.allViews[this.activeViewIdx])||void 0===t?void 0:t.view)||void 0===r?void 0:r.values)&&void 0!==e?e:[]}get tableActions(){var t,r;const e=null!==(r=null===(t=this.item)||void 0===t?void 0:t.actions)&&void 0!==r?r:[];return(null!=e?e:[]).reduce(((t,r)=>("NEW"===r&&t.push({action:"create",label:s("table_new_record",this.locale),icon:"assets/sprites.svg#icon-plus",variant:"primary"}),"EXPORT"===r&&t.push({action:"export",label:s("table_export_excel",this.locale),icon:"assets/sprites.svg#icon-file-excel"}),t)),[])}toggleCreatePicker(){this.createPickerOpen?this.closeCreatePicker():(this.createPickerOpen=!0,this.createPickerClickHandler&&document.removeEventListener("click",this.createPickerClickHandler),this.createPickerClickHandler=t=>{const r=this.el.querySelector(".mrd-table__create-picker-wrap");r&&!r.contains(t.target)&&this.closeCreatePicker()},document.addEventListener("click",this.createPickerClickHandler))}closeCreatePicker(){this.createPickerOpen=!1,this.createPickerClickHandler&&(document.removeEventListener("click",this.createPickerClickHandler),this.createPickerClickHandler=null)}colName(t){var r;return null!==(r=t.name)&&void 0!==r?r:""}colDataType(t){var r;return"RELATION"===t.type?"RELATION":null!==(r=t.dataType)&&void 0!==r?r:"TEXT"}isTotalKnown(){return null!=this.aggregationsTotal||function(t,r){for(const e of t.values())if(e.length<r)return!0;return!1}(this.loadedPages,this.pageSize)}get baseTotal(){return null!=this.aggregationsTotal?this.aggregationsTotal:this.totalElements>0?this.totalElements:this.minKnownTotal}emitLoadAggregations(){const t=this.buildQueryParams(0);this.mrdLoadAggregations.emit({path:this.buildDataPath(),qs:t,aggQs:g(t,this.columns)})}resetPages(){null!==this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null),this.pendingPages.clear(),this.loadedPages=new Map,this.requestedPages=new Set,this.failedPages=new Set,this.requestedAt.clear(),this.retryAttempts.clear(),this.colWidths=[],this.colWidthMeasureScheduled=!1,this.scrollTop=0,this.renderStart=0,this.minKnownTotal=0,this.renderEnd=this.visibleCount()-1;const t=this.el.querySelector(".mrd-table__scroll");t&&(t.scrollTop=0)}handleSortClick(t){const r=this.colName(t);this.sortField===r?this.sortDir="asc"===this.sortDir?"desc":"asc":(this.sortField=r,this.sortDir="asc"),this.resetPages(),this.emitPagesForWindow(this.renderStart,this.renderEnd)}applySort(t,r){this.sortField=this.colName(t),this.sortDir=r,this.resetPages(),this.emitPagesForWindow(this.renderStart,this.renderEnd)}emitLoadPage(t){this.mrdLoadPage.emit({page:t,sort:this.sortParam(),path:this.buildDataPath(),qs:this.buildQueryParams(t)}),this.requestedAt.set(t,Date.now())}emitPagesForWindow(t,r){const{firstPage:e,lastPage:l}=j(t,r,this.pageSize),i=new Set(this.requestedPages);let a=!1;for(let t=e;t<=l;t++)this.loadedPages.has(t)||i.has(t)||(i.add(t),this.emitLoadPage(t),a=!0);a&&(this.requestedPages=i)}getRow(t){return function(t,r,e){var l;const i=t.get(Math.floor(r/e));return null!==(l=null==i?void 0:i[r%e])&&void 0!==l?l:null}(this.loadedPages,t,this.pageSize)}requestPagesForWindow(t,r){const{firstPage:e,lastPage:l}=j(t,r,this.pageSize);let i=!1;for(let t=e;t<=l;t++)this.loadedPages.has(t)||this.requestedPages.has(t)||this.pendingPages.has(t)||(this.pendingPages.add(t),i=!0);i&&(null!==this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout((()=>this.flushPendingPages()),150))}flushPendingPages(){if(this.debounceTimer=null,0===this.pendingPages.size)return;const t=new Set(this.requestedPages);let r=!1;for(const e of this.pendingPages){if(this.loadedPages.has(e)||t.has(e))continue;const l=e*this.pageSize;l+this.pageSize-1<this.renderStart||l>this.renderEnd||(t.add(e),this.emitLoadPage(e),r=!0)}this.pendingPages.clear(),r&&(this.requestedPages=t)}checkStalePages(){var t;if(0===this.requestedAt.size)return;const r=function(t,r,e){const l=[];for(const[i,a]of t)r-a>=e&&l.push(i);return l}(this.requestedAt,Date.now(),this.requestTimeoutMs).filter((t=>!this.loadedPages.has(t)));if(0===r.length)return;let e=null;for(const l of r){const r=null!==(t=this.retryAttempts.get(l))&&void 0!==t?t:0;r<3?(this.retryAttempts.set(l,r+1),this.emitLoadPage(l)):(this.requestedAt.delete(l),this.retryAttempts.delete(l),e||(e=new Set(this.failedPages)),e.add(l),this.mrdPageError.emit({page:l}))}e&&(this.failedPages=e)}retryPage(t){const r=new Set(this.failedPages);r.delete(t),this.failedPages=r,this.retryAttempts.delete(t),this.emitLoadPage(t);const e=new Set(this.requestedPages);e.add(t),this.requestedPages=e}handleFilterToggle(){this.filterMode=!this.filterMode,this.filterMode||this.closeFilterPopup()}handleFilterOpen(t,r){r.stopPropagation();const e=r.currentTarget.getBoundingClientRect();let l=e.left;l+280>window.innerWidth-8&&(l=e.right-280),this.popupPos={top:e.bottom+4,left:Math.max(8,l)};const i=this.colName(t),a=this.colDataType(t),o=this.activeFilters.get(i),s=u.has(a)||"RELATION"===a?"startsWith":void 0;this.pendingFilter="DATETIME"===a&&o&&"isEmpty"!==o.operator&&"isNotEmpty"!==o.operator?function(t){const r=Object.assign({},t);return"string"==typeof r.from&&r.from&&(r.from=function(t){if(!t)return t;const r=new Date(t);return isNaN(r.getTime())?t:`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,"0")}-${String(r.getDate()).padStart(2,"0")}`}(r.from)),"string"==typeof r.to&&r.to&&(r.to=function(t){if(!t)return t;const r=new Date(t);return isNaN(r.getTime())?t:(r.setDate(r.getDate()-1),`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,"0")}-${String(r.getDate()).padStart(2,"0")}`)}(r.to)),r.from&&r.to&&r.from===r.to?Object.assign(Object.assign({},r),{value:r.from,from:void 0,to:void 0}):r}(o):o?Object.assign({},o):{field:i,dataType:a,operator:s},this.openFilterCol=i,this.outsideClickHandler&&document.removeEventListener("click",this.outsideClickHandler),this.outsideClickHandler=t=>{const r=this.el.querySelector(".mrd-table__filter-popup");r&&!r.contains(t.target)&&this.closeFilterPopup()},document.addEventListener("click",this.outsideClickHandler)}closeFilterPopup(){this.openFilterCol=null,this.pendingFilter=null,this.outsideClickHandler&&(document.removeEventListener("click",this.outsideClickHandler),this.outsideClickHandler=null)}openTextblockModal(t){this.textblockModal=t,this.keydownHandler&&document.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=t=>{"Escape"===t.key&&this.closeTextblockModal()},document.addEventListener("keydown",this.keydownHandler)}closeTextblockModal(){this.textblockModal=null,this.keydownHandler&&(document.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=null)}openJsonModal(t){this.jsonModal=t,this.keydownHandler&&document.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=t=>{"Escape"===t.key&&this.closeJsonModal()},document.addEventListener("keydown",this.keydownHandler)}closeJsonModal(){this.jsonModal=null,this.keydownHandler&&(document.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=null)}setPending(t,r){this.pendingFilter=Object.assign(Object.assign({},this.pendingFilter),{[t]:r})}togglePendingValue(t,r){var e,l;const i=null!==(l=null===(e=this.pendingFilter)||void 0===e?void 0:e.values)&&void 0!==l?l:[];this.pendingFilter=Object.assign(Object.assign({},this.pendingFilter),{values:r?[...i,t]:i.filter((r=>r!==t))})}applyFilter(){const t=this.pendingFilter;if(!(null==t?void 0:t.field))return void this.closeFilterPopup();const r=function(t){const r=Object.assign({},t);return"DATETIME"===t.dataType&&"isEmpty"!==t.operator&&"isNotEmpty"!==t.operator&&("string"==typeof r.value&&r.value?(r.from=w(r.value),r.to=y(r.value),r.value=void 0):("string"==typeof r.from&&r.from&&(r.from=w(r.from)),"string"==typeof r.to&&r.to&&(r.to=y(r.to)))),r}(t),e=new Map(this.activeFilters);!function(t){return"isEmpty"===t.operator||"isNotEmpty"===t.operator||void 0!==t.values&&t.values.length>0||null!=t.value&&""!==t.value||"boolean"==typeof t.value||null!=t.from&&""!==t.from||null!=t.to&&""!==t.to}(r)?e.delete(r.field):e.set(r.field,r),this.activeFilters=e,this.closeFilterPopup(),this.aggregations=null,this.aggregationsTotal=null,this.aggregationsPending=!0,(this.totalElements>0||this.minKnownTotal>0)&&(this.resetPages(),this.emitPagesForWindow(this.renderStart,this.renderEnd))}clearFilter(){const t=this.openFilterCol,r=new Map(this.activeFilters);t&&r.delete(t),this.activeFilters=r,this.closeFilterPopup(),this.aggregations=null,this.aggregationsTotal=null,this.aggregationsPending=!0,(this.totalElements>0||this.minKnownTotal>0)&&(this.resetPages(),this.emitPagesForWindow(this.renderStart,this.renderEnd))}clearAllFilters(){this.activeFilters=new Map,this.aggregations=null,this.aggregationsTotal=null,this.aggregationsPending=!0,(this.totalElements>0||this.minKnownTotal>0)&&(this.resetPages(),this.emitPagesForWindow(this.renderStart,this.renderEnd))}handleViewSwitch(t){var r,e;const l=this.allViews[t];(null==l?void 0:l.view)&&(this.activeViewIdx=t,this.applyDefaultSort(null!==(e=null===(r=l.view)||void 0===r?void 0:r.defaultSort)&&void 0!==e?e:""),this.activeFilters=new Map,this.init())}toggleViewPopover(t){t.stopPropagation(),this.viewPopoverOpen?this.closeViewPopover():(this.viewPopoverOpen=!0,this.viewPopoverClickHandler=()=>this.closeViewPopover(),document.addEventListener("click",this.viewPopoverClickHandler))}closeViewPopover(){this.viewPopoverOpen=!1,this.viewPopoverClickHandler&&(document.removeEventListener("click",this.viewPopoverClickHandler),this.viewPopoverClickHandler=null)}renderToolbar(){var r;return t(T,{locale:this.locale,filterMode:this.filterMode,filterCount:this.activeFilters.size,actions:this.tableActions,views:this.allViews,activeViewIdx:this.activeViewIdx,viewPopoverOpen:this.viewPopoverOpen,createPickerOpen:this.createPickerOpen,createTypes:null===(r=this.item)||void 0===r?void 0:r.createTypes,cb:{onFilterToggle:()=>this.handleFilterToggle(),onClearAllFilters:()=>this.clearAllFilters(),onViewSwitch:t=>this.handleViewSwitch(t),onToggleViewPopover:t=>this.toggleViewPopover(t),onCloseViewPopover:()=>this.closeViewPopover(),onToggleCreatePicker:()=>this.toggleCreatePicker(),onCreate:t=>{this.mrdAction.emit(this.buildActionDetail("create",t)),this.closeCreatePicker()},onAction:t=>this.mrdAction.emit(this.buildActionDetail(t))}})}renderFilterPopup(){if(!this.openFilterCol||!this.pendingFilter)return null;const r=this.columns.find((t=>this.colName(t)===this.openFilterCol));return r?t(O,{col:r,dataType:this.colDataType(r),openFilterCol:this.openFilterCol,pendingFilter:this.pendingFilter,popupPos:this.popupPos,sortField:this.sortField,sortDir:this.sortDir,locale:this.locale,cb:{onSetPending:(t,r)=>this.setPending(t,r),onReplacePending:t=>this.pendingFilter=t,onToggleValue:(t,r)=>this.togglePendingValue(t,r),onApplySort:t=>this.applySort(r,t),onApply:()=>this.applyFilter(),onClear:()=>this.clearFilter(),onClose:()=>this.closeFilterPopup()}}):null}renderFooter(r,e,l=!0){if(0===this.totalElements&&0===this.loadedPages.size){const e=null!=r?r:0;return 0===e?null:t("div",{class:"mrd-table__footer"},e," ",s("table_of",this.locale)," ",e)}if(!this.loadedPages.has(0))return null;const i=null!=e?e:this.baseTotal,a=Math.min(Math.floor(this.scrollTop/this.rowHeight)+1,i),o=Math.min(Math.ceil((this.scrollTop+this.tableHeight)/this.rowHeight),i),d=l?String(i):"…";return t("div",{class:"mrd-table__footer"},a,"–",o," ",s("table_of",this.locale)," ",d)}renderCell(r,e){return t(x,{col:r,row:e,locale:this.locale,onDownload:t=>this.mrdDownload.emit(t),onOpenTextblock:t=>this.openTextblockModal(t),onOpenJson:t=>this.openJsonModal(t)})}renderTotalsRow(){return t(E,{columns:this.columns,aggregations:this.aggregations,locale:this.locale})}render(){var r,e,l;if(!(null===(r=this.columns)||void 0===r?void 0:r.length))return null;if(0===this.totalElements&&0===this.loadedPages.size)return t(a,null,this.renderToolbar(),t("div",{class:"mrd-table"},t("table",{class:"mrd-table__table"},t("thead",null,t("tr",null,this.columns.map((r=>{var e;const l=this.colName(r),i=this.activeFilters.has(l),a=["mrd-table__header",i?"mrd-table__header--filtered":"",this.filterMode?"mrd-table__header--sortable":""].filter(Boolean).join(" ");return t("th",{class:a,onClick:this.filterMode?t=>this.handleFilterOpen(r,t):void 0},t("span",{class:"mrd-table__header-label"},null!==(e=r.label)&&void 0!==e?e:""),i&&t(k,null))})))),t("tbody",null,null===(e=this.rows)||void 0===e?void 0:e.map(((r,e)=>t("tr",{class:"mrd-table__row mrd-table__row--clickable",style:{background:e%2==0?"":"var(--mrd-color-neutral-100)"},onClick:()=>this.mrdRowClick.emit({row:r})},this.columns.map((t=>this.renderCell(t,r))))))),this.renderTotalsRow()),(!this.rows||0===this.rows.length)&&t("p",{class:"mrd-table__empty"},s("no_results",this.locale))),this.renderFooter(null===(l=this.rows)||void 0===l?void 0:l.length),this.renderFilterPopup(),this.renderTextblockModal(),this.renderJsonModal());const i=function(t,r,e){let l=e;for(const[e,i]of t)i.length<r&&(l=Math.min(l,e*r+i.length));return l}(this.loadedPages,this.pageSize,this.baseTotal),o=Math.min(this.renderEnd,i-1),d=this.columns.length,n=this.renderStart*this.rowHeight,c=Math.max(0,(i-1-o)*this.rowHeight),m=this.colWidths.length>0?{tableLayout:"fixed"}:void 0,h=[];for(let r=this.renderStart;r<=o;r++){const e=this.getRow(r);if(null===e){const e=Math.floor(r/this.pageSize);this.failedPages.has(e)?h.push(t("tr",{class:"mrd-table__row mrd-table__row--failed"},t("td",{class:"mrd-table__cell--failed",colSpan:d},t("button",{type:"button",class:"mrd-table__retry-button",onClick:()=>this.retryPage(e)},s("load_failed_retry",this.locale))))):h.push(t("tr",{class:"mrd-table__row mrd-table__row--loading"},t("td",{class:"mrd-table__cell--placeholder",colSpan:d},t("span",{class:"mrd-table__placeholder-bar"}))))}else h.push(t("tr",{class:"mrd-table__row mrd-table__row--clickable",style:{background:r%2==0?"":"var(--mrd-color-neutral-100)"},onClick:()=>this.mrdRowClick.emit({row:e,listContext:{index:r,sort:this.sortParam(),path:this.buildDataPath(),qs:this.buildQueryParams(0)}})},this.columns.map((t=>this.renderCell(t,e)))))}return t(a,null,this.renderToolbar(),t("div",{class:"mrd-table__scroll",style:{height:`${this.tableHeight}px`},onScroll:this.handleScroll},t("table",{class:"mrd-table__table",style:m},t("thead",null,t("tr",null,this.columns.map(((r,e)=>{var l;const i=this.colName(r),a=this.sortField===i,o=this.activeFilters.has(i),s=!f.has(this.colDataType(r)),d=["mrd-table__header",s?"mrd-table__header--sortable":"",a?`mrd-table__header--sorted-${this.sortDir}`:"",o?"mrd-table__header--filtered":""].filter(Boolean).join(" ");return t("th",{class:d,style:this.colWidths[e]?{width:`${this.colWidths[e]}px`}:void 0,onClick:s?t=>this.filterMode?this.handleFilterOpen(r,t):this.handleSortClick(r):void 0},t("span",{class:"mrd-table__header-label"},null!==(l=r.label)&&void 0!==l?l:""),s&&a&&t("span",{class:"mrd-table__sort-icon","aria-hidden":"true"},"asc"===this.sortDir?"▲":"▼"),s&&!a&&!this.filterMode&&t("span",{class:"mrd-table__sort-icon","aria-hidden":"true"},"⇅"),s&&o&&t(k,null))})))),t("tbody",null,n>0&&t("tr",{class:"mrd-table__spacer",style:{height:`${n}px`}},t("td",{colSpan:d})),h,c>0&&t("tr",{class:"mrd-table__spacer",style:{height:`${c}px`}},t("td",{colSpan:d}))),this.renderTotalsRow())),0===i&&this.loadedPages.has(0)&&t("p",{class:"mrd-table__empty"},s("no_results",this.locale)),i>0&&this.renderFooter(void 0,i,this.isTotalKnown()),this.renderFilterPopup(),this.renderTextblockModal(),this.renderJsonModal())}renderTextblockModal(){return t(C,{text:this.textblockModal,locale:this.locale,onClose:()=>this.closeTextblockModal()})}renderJsonModal(){return t(z,{html:this.jsonModal,locale:this.locale,onClose:()=>this.closeJsonModal()})}get el(){return this}static get watchers(){return{totalElements:[{totalElementsChanged:0}],item:[{itemChanged:0}]}}static get style(){return".sc-mrd-table-h{display:block;width:100%}.mrd-table.sc-mrd-table{overflow-x:auto}.mrd-table__scroll.sc-mrd-table{overflow-y:auto;overflow-x:auto;border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);overflow-anchor:none}.mrd-table__table.sc-mrd-table{width:auto;min-width:100%;border-collapse:collapse;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-900)}.mrd-table__scroll.sc-mrd-table .mrd-table__table.sc-mrd-table{min-width:max-content}.mrd-table__header.sc-mrd-table{position:sticky;top:0;z-index:1;background:var(--mrd-color-white);text-align:left;padding:var(--mrd-space-2) var(--mrd-space-4);border-bottom:2px solid var(--mrd-border-color);color:var(--mrd-color-neutral-600);font-weight:var(--mrd-font-weight-medium);white-space:nowrap;font-size:var(--mrd-font-size-xs);text-transform:uppercase;letter-spacing:0.04em}.mrd-table__header--sortable.sc-mrd-table{cursor:pointer;user-select:none}.mrd-table__header--sortable.sc-mrd-table:hover{background:var(--mrd-color-neutral-50);color:var(--mrd-color-neutral-800)}.mrd-table__header--sorted-asc.sc-mrd-table,.mrd-table__header--sorted-desc.sc-mrd-table{color:var(--mrd-color-primary);border-bottom-color:var(--mrd-color-primary)}.mrd-table__header--filtered.sc-mrd-table{color:var(--mrd-color-primary);border-bottom-color:var(--mrd-color-primary)}.mrd-table__header-label.sc-mrd-table{margin-right:var(--mrd-space-1)}.mrd-table__sort-icon.sc-mrd-table{font-size:0.85rem;opacity:0.4;vertical-align:middle}.mrd-table__header--sorted-asc.sc-mrd-table .mrd-table__sort-icon.sc-mrd-table,.mrd-table__header--sorted-desc.sc-mrd-table .mrd-table__sort-icon.sc-mrd-table{opacity:1;color:var(--mrd-color-primary)}.mrd-table__filter-icon.sc-mrd-table{display:inline-flex;align-items:center;vertical-align:middle;margin-left:var(--mrd-space-1);color:var(--mrd-color-primary)}.mrd-table__row.sc-mrd-table{border-bottom:1px solid var(--mrd-border-color)}.mrd-table__row.sc-mrd-table:hover{background:var(--mrd-color-neutral-200) !important}.mrd-table__row--clickable.sc-mrd-table{cursor:pointer}.mrd-table__row--loading.sc-mrd-table{background:transparent}.mrd-table__row--failed.sc-mrd-table{background:transparent}.mrd-table__spacer.sc-mrd-table{border:none}.mrd-table__spacer.sc-mrd-table td.sc-mrd-table{padding:0;border:none}.mrd-table__cell.sc-mrd-table{padding:var(--mrd-space-2) var(--mrd-space-4);vertical-align:top;white-space:nowrap}.mrd-table__cell--numeric.sc-mrd-table{text-align:right;font-variant-numeric:tabular-nums}.mrd-table__cell--placeholder.sc-mrd-table{padding:var(--mrd-space-2) var(--mrd-space-4);border-bottom:1px solid var(--mrd-border-color)}.mrd-table__cell--failed.sc-mrd-table{padding:var(--mrd-space-2) var(--mrd-space-4);border-bottom:1px solid var(--mrd-border-color)}.mrd-table__placeholder-bar.sc-mrd-table{display:block;height:0.75rem;width:55%;border-radius:var(--mrd-border-radius-sm);background:linear-gradient(90deg, var(--mrd-color-neutral-200) 25%, var(--mrd-color-neutral-100) 50%, var(--mrd-color-neutral-200) 75%);background-size:200% 100%;animation:mrd-shimmer 1.4s ease infinite}.mrd-table__retry-button.sc-mrd-table{border:none;background:none;padding:0;color:var(--mrd-color-danger);font-size:inherit;cursor:pointer;text-decoration:underline}.mrd-table__toolbar.sc-mrd-table{display:flex;align-items:center;justify-content:space-between;padding-bottom:var(--mrd-space-2)}.mrd-table__toolbar-left.sc-mrd-table,.mrd-table__toolbar-right.sc-mrd-table{display:flex;gap:var(--mrd-space-2);align-items:center}.mrd-table__toolbar-center.sc-mrd-table{flex:1;display:flex;justify-content:center;align-items:center;gap:var(--mrd-space-1)}.mrd-table__view-switcher.sc-mrd-table{display:flex;align-items:center;gap:var(--mrd-space-1)}.mrd-table__view-arrow.sc-mrd-table{background:none;border:none;cursor:pointer;padding:0 var(--mrd-space-1);color:var(--mrd-color-neutral-500);font-size:var(--mrd-font-size-xs);line-height:1}.mrd-table__view-arrow.sc-mrd-table:hover{color:var(--mrd-color-neutral-800)}.mrd-table__view-title-wrap.sc-mrd-table{position:relative}.mrd-table__view-title.sc-mrd-table{font-size:var(--mrd-font-size-sm);font-weight:600;color:var(--mrd-color-neutral-800);font-family:var(--mrd-font-family);background:none;border:none;outline:none;cursor:pointer;padding:0 var(--mrd-space-1);max-width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mrd-table__view-title.sc-mrd-table:hover{color:var(--mrd-color-primary)}.mrd-table__view-popover.sc-mrd-table{position:absolute;top:calc(100% + var(--mrd-space-1));left:50%;transform:translateX(-50%);background:var(--mrd-color-white);border:1px solid var(--mrd-color-neutral-200);border-radius:var(--mrd-radius-md);box-shadow:var(--mrd-shadow-md);z-index:100;min-width:160px;padding:var(--mrd-space-1) 0}.mrd-table__view-popover-item.sc-mrd-table{display:block;width:100%;text-align:left;background:none;border:none;cursor:pointer;padding:var(--mrd-space-2) var(--mrd-space-3);font-size:var(--mrd-font-size-sm);font-family:var(--mrd-font-family);color:var(--mrd-color-neutral-700);white-space:nowrap}.mrd-table__view-popover-item.sc-mrd-table:hover{background:var(--mrd-color-neutral-50)}.mrd-table__view-popover-item--active.sc-mrd-table{font-weight:600;color:var(--mrd-color-primary)}.mrd-table__action.sc-mrd-table{position:relative;display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0;background:transparent;border:1px solid transparent;border-radius:var(--mrd-border-radius);cursor:pointer;color:var(--mrd-color-neutral-400);transition:background-color 0.15s, border-color 0.15s, color 0.15s}.mrd-table__action.sc-mrd-table:hover{background-color:var(--mrd-color-neutral-100);border-color:var(--mrd-color-neutral-300);color:var(--mrd-color-neutral-700)}.mrd-table__action.sc-mrd-table:hover .mrd-table__action-tooltip.sc-mrd-table{display:block}.mrd-table__action.sc-mrd-table:disabled{opacity:0.4;cursor:not-allowed}.mrd-table__action--primary.sc-mrd-table{color:var(--mrd-color-neutral-500)}.mrd-table__action--primary.sc-mrd-table:hover{background:var(--mrd-color-primary);border-color:var(--mrd-color-primary);color:var(--mrd-color-white)}.mrd-table__action--danger.sc-mrd-table{color:var(--mrd-color-error)}.mrd-table__action--danger.sc-mrd-table:hover{background-color:var(--mrd-color-error-light, #fef2f2);border-color:var(--mrd-color-error)}.mrd-table__action-icon.sc-mrd-table{width:1.25rem;height:1.25rem;pointer-events:none;fill:currentColor}.mrd-table__action-tooltip.sc-mrd-table{display:none;position:absolute;bottom:calc(100% + 6px);right:0;padding:var(--mrd-space-1) var(--mrd-space-2);font-size:var(--mrd-font-size-xs);white-space:nowrap;background:var(--mrd-color-tooltip, #fffce1);color:var(--mrd-color-neutral-900);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius-sm, var(--mrd-border-radius));pointer-events:none;z-index:10}.mrd-table__create-picker-wrap.sc-mrd-table{position:relative}.mrd-table__create-picker.sc-mrd-table{position:absolute;right:0;top:calc(100% + 4px);background:var(--mrd-color-white, #fff);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);box-shadow:var(--mrd-shadow-md, 0 4px 12px rgba(0, 0, 0, 0.12));z-index:10;min-width:10rem;padding:var(--mrd-space-1) 0}.mrd-table__create-picker-item.sc-mrd-table{display:block;width:100%;text-align:left;padding:var(--mrd-space-2) var(--mrd-space-3);background:none;border:none;cursor:pointer;font-size:var(--mrd-font-size-sm);font-family:var(--mrd-font-family);color:var(--mrd-color-neutral-800)}.mrd-table__create-picker-item.sc-mrd-table:hover{background:var(--mrd-color-neutral-50);color:var(--mrd-color-neutral-900)}.mrd-table__filter-toggle--active.sc-mrd-table{background:var(--mrd-color-primary);border-color:var(--mrd-color-primary);color:var(--mrd-color-white)}.mrd-table__filter-toggle--active.sc-mrd-table:hover{background:var(--mrd-color-primary-dark, var(--mrd-color-primary));border-color:var(--mrd-color-primary-dark, var(--mrd-color-primary));color:var(--mrd-color-white)}.mrd-table__filter-badge.sc-mrd-table{position:absolute;top:-6px;right:-6px;min-width:1.25rem;height:1.25rem;padding:0 3px;background:var(--mrd-color-error, #e53e3e);color:var(--mrd-color-white);border-radius:9999px;font-size:0.65rem;font-weight:var(--mrd-font-weight-medium);line-height:1.25rem;text-align:center;pointer-events:none}.mrd-table__filter-popup.sc-mrd-table{position:fixed;width:280px;background:var(--mrd-color-white);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);box-shadow:var(--mrd-shadow-md, 0 4px 12px rgba(0, 0, 0, 0.12));z-index:var(--mrd-z-dropdown, 200);font-size:var(--mrd-font-size-sm)}.mrd-table__filter-popup-header.sc-mrd-table{display:flex;align-items:center;justify-content:space-between;padding:var(--mrd-space-2) var(--mrd-space-3);border-bottom:1px solid var(--mrd-border-color)}.mrd-table__filter-popup-title.sc-mrd-table{font-weight:var(--mrd-font-weight-medium);color:var(--mrd-color-neutral-800);font-size:var(--mrd-font-size-sm)}.mrd-table__filter-close.sc-mrd-table{background:transparent;border:none;cursor:pointer;color:var(--mrd-color-neutral-500);font-size:0.9rem;padding:2px 4px;border-radius:3px;line-height:1}.mrd-table__filter-close.sc-mrd-table:hover{background:var(--mrd-color-neutral-100);color:var(--mrd-color-neutral-800)}.mrd-table__filter-section.sc-mrd-table{padding:var(--mrd-space-2) var(--mrd-space-3)}.mrd-table__filter-section-label.sc-mrd-table{font-size:var(--mrd-font-size-xs);font-weight:var(--mrd-font-weight-medium);text-transform:uppercase;letter-spacing:0.04em;color:var(--mrd-color-neutral-500);margin-bottom:var(--mrd-space-2)}.mrd-table__filter-sort-buttons.sc-mrd-table{display:flex;gap:var(--mrd-space-2)}.mrd-table__filter-sort-btn.sc-mrd-table{flex:1;padding:var(--mrd-space-1) var(--mrd-space-2);background:transparent;border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);cursor:pointer;font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-700)}.mrd-table__filter-sort-btn.sc-mrd-table:hover{background:var(--mrd-color-neutral-100)}.mrd-table__filter-sort-btn--active.sc-mrd-table{background:var(--mrd-color-primary);border-color:var(--mrd-color-primary);color:var(--mrd-color-white)}.mrd-table__filter-divider.sc-mrd-table{height:1px;background:var(--mrd-border-color);margin:0}.mrd-table__filter-editor.sc-mrd-table{display:flex;flex-direction:column;gap:var(--mrd-space-2)}.mrd-table__filter-select.sc-mrd-table,.mrd-table__filter-input.sc-mrd-table{width:100%;padding:var(--mrd-space-1) var(--mrd-space-2);border:1px solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-900);background:var(--mrd-color-white);box-sizing:border-box}.mrd-table__filter-select.sc-mrd-table:focus,.mrd-table__filter-input.sc-mrd-table:focus{outline:none;border-color:var(--mrd-color-primary);box-shadow:0 0 0 2px rgba(0, 0, 0, 0.06)}.mrd-table__filter-range.sc-mrd-table{display:flex;align-items:center;gap:var(--mrd-space-1)}.mrd-table__filter-range.sc-mrd-table .mrd-table__filter-input.sc-mrd-table{flex:1;min-width:0}.mrd-table__filter-range--stacked.sc-mrd-table{flex-direction:column;align-items:stretch;gap:var(--mrd-space-2)}.mrd-table__filter-range-sep.sc-mrd-table{color:var(--mrd-color-neutral-400);flex-shrink:0}.mrd-table__filter-range-label.sc-mrd-table{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);margin-bottom:2px}.mrd-table__filter-radio-group.sc-mrd-table{display:flex;flex-direction:column;gap:var(--mrd-space-1)}.mrd-table__filter-radio-group--inline.sc-mrd-table{flex-direction:row;gap:var(--mrd-space-3)}.mrd-table__filter-radio-label.sc-mrd-table{display:flex;align-items:center;gap:var(--mrd-space-1);cursor:pointer;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800)}.mrd-table__filter-list.sc-mrd-table{display:flex;flex-direction:column;gap:var(--mrd-space-1);max-height:180px;overflow-y:auto}.mrd-table__filter-list-controls.sc-mrd-table{display:flex;gap:var(--mrd-space-2);margin-bottom:var(--mrd-space-1)}.mrd-table__filter-list-btn.sc-mrd-table{font-size:var(--mrd-font-size-xs);color:var(--mrd-color-primary);background:transparent;border:none;cursor:pointer;padding:0;text-decoration:underline}.mrd-table__filter-checkbox-label.sc-mrd-table{display:flex;align-items:center;gap:var(--mrd-space-1);cursor:pointer;font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-800)}.mrd-table__filter-no-support.sc-mrd-table{font-size:var(--mrd-font-size-sm);color:var(--mrd-color-neutral-500);margin:0;font-style:italic}.mrd-table__filter-popup-footer.sc-mrd-table{display:flex;justify-content:flex-end;gap:var(--mrd-space-2);padding:var(--mrd-space-2) var(--mrd-space-3);border-top:1px solid var(--mrd-border-color)}.mrd-table__filter-btn.sc-mrd-table{padding:var(--mrd-space-1) var(--mrd-space-3);border-radius:var(--mrd-border-radius);border:1px solid var(--mrd-border-color);font-size:var(--mrd-font-size-sm);cursor:pointer}.mrd-table__filter-btn--clear.sc-mrd-table{background:transparent;color:var(--mrd-color-neutral-600)}.mrd-table__filter-btn--clear.sc-mrd-table:hover{background:var(--mrd-color-neutral-100)}.mrd-table__filter-btn--apply.sc-mrd-table{background:var(--mrd-color-primary);border-color:var(--mrd-color-primary);color:var(--mrd-color-white)}.mrd-table__filter-btn--apply.sc-mrd-table:hover{background:var(--mrd-color-primary-dark, var(--mrd-color-primary));border-color:var(--mrd-color-primary-dark, var(--mrd-color-primary))}.mrd-table__totals-row.sc-mrd-table{border-top:2px solid var(--mrd-border-color)}.mrd-table__totals-cell.sc-mrd-table{position:sticky;bottom:0;z-index:2;padding:var(--mrd-space-2) var(--mrd-space-4);background:var(--mrd-color-white);font-weight:var(--mrd-font-weight-medium);font-variant-numeric:tabular-nums;white-space:nowrap;border-top:2px solid var(--mrd-border-color)}.mrd-table__totals-cell--numeric.sc-mrd-table{text-align:right}.mrd-table__footer.sc-mrd-table{padding:var(--mrd-space-1) var(--mrd-space-2);font-size:var(--mrd-font-size-xs);color:var(--mrd-color-neutral-500);text-align:right}.mrd-table__empty.sc-mrd-table{padding:var(--mrd-space-4) var(--mrd-space-3);color:var(--mrd-color-neutral-500);font-size:var(--mrd-font-size-sm);text-align:center;margin:0}.mrd-table__file-btn.sc-mrd-table{display:inline-flex;align-items:center;gap:var(--mrd-space-1);background:none;border:none;padding:0;cursor:pointer;color:var(--mrd-color-primary);font-size:var(--mrd-font-size-sm);font-family:inherit;max-width:100%;overflow:hidden}.mrd-table__file-btn.sc-mrd-table:hover{text-decoration:underline;color:var(--mrd-color-primary-dark)}.mrd-table__file-icon.sc-mrd-table{flex-shrink:0;width:1rem;height:1rem}.mrd-table__textblock-btn.sc-mrd-table{display:inline;background:none;border:none;padding:0 0 0 var(--mrd-space-1);cursor:pointer;color:var(--mrd-color-primary);font-size:var(--mrd-font-size-sm);font-family:inherit;line-height:inherit;vertical-align:middle}.mrd-table__textblock-btn.sc-mrd-table:hover{color:var(--mrd-color-primary-dark)}.mrd-table__modal-backdrop.sc-mrd-table{position:fixed;inset:0;background:rgba(0, 0, 0, 0.4);z-index:var(--mrd-z-modal, 300);display:flex;align-items:center;justify-content:center}.mrd-table__modal.sc-mrd-table{background:#fff;border-radius:var(--mrd-radius-md, 0.5rem);padding:var(--mrd-space-6);max-width:min(600px, 90vw);max-height:70vh;overflow-y:auto;position:relative;box-shadow:var(--mrd-shadow-lg)}.mrd-table__modal-close.sc-mrd-table{position:absolute;top:var(--mrd-space-3);right:var(--mrd-space-3);background:none;border:none;cursor:pointer;font-size:1.25rem;line-height:1;color:var(--mrd-color-text-muted, #6b7280);padding:0}.mrd-table__modal-close.sc-mrd-table:hover{color:var(--mrd-color-text, #111827)}.mrd-table__modal-text.sc-mrd-table{margin:0;padding-right:var(--mrd-space-6);white-space:pre-wrap;word-break:break-word;font-size:var(--mrd-font-size-sm);line-height:1.6}.mrd-table__json-preview.sc-mrd-table{font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;display:inline-block;max-width:calc(100% - 1.5rem);vertical-align:middle}.mrd-table__modal-json.sc-mrd-table{margin:0;padding-right:var(--mrd-space-6);font-family:var(--mrd-font-family-mono);font-size:var(--mrd-font-size-xs);white-space:pre-wrap;word-break:break-word;line-height:1.6;background:none;border:none}@keyframes mrd-shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}"}},[2,"mrd-table",{item:[16],parentId:[1,"parent-id"],rows:[16],locale:[1],totalElements:[2,"total-elements"],pageSize:[2,"page-size"],rowHeight:[2,"row-height"],tableHeight:[2,"table-height"],requestTimeoutMs:[2,"request-timeout-ms"],activeViewIdx:[32],loadedPages:[32],requestedPages:[32],failedPages:[32],renderStart:[32],renderEnd:[32],colWidths:[32],sortField:[32],sortDir:[32],filterMode:[32],activeFilters:[32],openFilterCol:[32],pendingFilter:[32],popupPos:[32],createPickerOpen:[32],viewPopoverOpen:[32],scrollTop:[32],textblockModal:[32],jsonModal:[32],aggregations:[32],aggregationsTotal:[32],minKnownTotal:[32],init:[64],setPage:[64],setAggregations:[64]},void 0,{totalElements:[{totalElementsChanged:0}],item:[{itemChanged:0}]}]);function I(){"undefined"!=typeof customElements&&["mrd-table"].forEach((t=>{"mrd-table"===t&&(customElements.get(o(t))||customElements.define(o(t),P))}))}export{P as M,I as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as r,HTMLElement as e,createEvent as t,h as d,Host as i,transformTag as o}from"@stencil/core/internal/client";import{r as a,F as l,c as s,a as n}from"./field-helpers.js";const m=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdChange=t(this,"mrdChange",7),this.mrdBlur=t(this,"mrdBlur",7),this.name="",this.label="",this.value="",this.placeholder="",this.required=!1,this.disabled=!1,this.locale=navigator.language,this.error="",this.handleInput=r=>{this.mrdChange.emit({name:this.name,value:r.target.value})},this.handleBlur=r=>{const e=r.target.value;this.error=a(e,this.required,this.locale),this.mrdBlur.emit({name:this.name,value:e})}}render(){return d(i,{key:"d2a6fb5735a3a01887cc467274a0ff9d71312124"},d("div",{key:"7864bf852d43f93ebd0120a3ec1b72e54837d1ba",class:"mrd-text-field"},d(l,{key:"bdad112197b44a643a58dd79c4648e284311199d",base:"mrd-text-field",label:this.label,required:this.required}),d("input",{key:"1d3e1cf3374ea2e5a83794b5110205964fff86e1",class:s("mrd-text-field",!!this.error),type:"text",name:this.name,value:this.value,placeholder:this.placeholder,required:this.required,disabled:this.disabled,onInput:this.handleInput,onBlur:this.handleBlur}),d(n,{key:"bb4ec51de7b6d360fdb3d46dd53e85a5d497bcce",base:"mrd-text-field",error:this.error})))}static get style(){return'.sc-mrd-text-field-h{display:block}.mrd-text-field.sc-mrd-text-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-text-field__label.sc-mrd-text-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-text-field__label--required.sc-mrd-text-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-text-field__input.sc-mrd-text-field{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);transition:border-color var(--mrd-transition), box-shadow var(--mrd-transition);outline:none;appearance:none;box-sizing:border-box}.mrd-text-field__input.sc-mrd-text-field::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-text-field__input.sc-mrd-text-field:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-text-field__input.sc-mrd-text-field:disabled{background-color:var(--mrd-input-bg-disabled);cursor:not-allowed;opacity:0.7}.mrd-text-field__input--error.sc-mrd-text-field{border-color:var(--mrd-border-color-error)}.mrd-text-field__input--error.sc-mrd-text-field:focus{box-shadow:var(--mrd-shadow-focus-error)}.mrd-text-field__error.sc-mrd-text-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}'}},[2,"mrd-text-field",{name:[1],label:[1],value:[1],placeholder:[1],required:[4],disabled:[4],locale:[1],error:[32]}]);function c(){"undefined"!=typeof customElements&&["mrd-text-field"].forEach((r=>{"mrd-text-field"===r&&(customElements.get(o(r))||customElements.define(o(r),m))}))}export{m as M,c as d}
1
+ import{proxyCustomElement as r,HTMLElement as e,createEvent as t,h as d,Host as i,transformTag as o}from"@stencil/core/internal/client";import{r as a,F as l,c as s,a as n}from"./field-helpers.js";const c=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdChange=t(this,"mrdChange",7),this.mrdBlur=t(this,"mrdBlur",7),this.name="",this.label="",this.value="",this.placeholder="",this.required=!1,this.disabled=!1,this.locale=navigator.language,this.error="",this.handleInput=r=>{this.mrdChange.emit({name:this.name,value:r.target.value})},this.handleBlur=r=>{const e=r.target.value;this.error=a(e,this.required,this.locale),this.mrdBlur.emit({name:this.name,value:e})}}render(){return d(i,{key:"3153f0c6f8ab4d9dae93306f7507399aeda75eaf"},d("div",{key:"5d9c28023fdfb5472fc115c66bc3df509506e10f",class:"mrd-text-field"},d(l,{key:"1e21139aae0cc1ae95aa3297271b618a40043e77",base:"mrd-text-field",label:this.label,required:this.required}),d("input",{key:"46f98d5e39bb834075449fac7096b077a1ae7bb3",class:s("mrd-text-field",!!this.error),type:"text",name:this.name,value:this.value,placeholder:this.placeholder,required:this.required,disabled:this.disabled,onInput:this.handleInput,onBlur:this.handleBlur}),d(n,{key:"10b6ddae9cd9f36dc9d7176167d79df8e4102c03",base:"mrd-text-field",error:this.error})))}static get style(){return'.sc-mrd-text-field-h{display:block}.mrd-text-field.sc-mrd-text-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-text-field__label.sc-mrd-text-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-text-field__label--required.sc-mrd-text-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-text-field__input.sc-mrd-text-field{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);transition:border-color var(--mrd-transition), box-shadow var(--mrd-transition);outline:none;appearance:none;box-sizing:border-box}.mrd-text-field__input.sc-mrd-text-field::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-text-field__input.sc-mrd-text-field:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-text-field__input.sc-mrd-text-field:disabled{background-color:var(--mrd-input-bg-disabled);cursor:not-allowed;opacity:0.7}.mrd-text-field__input--error.sc-mrd-text-field{border-color:var(--mrd-border-color-error)}.mrd-text-field__input--error.sc-mrd-text-field:focus{box-shadow:var(--mrd-shadow-focus-error)}.mrd-text-field__error.sc-mrd-text-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}'}},[2,"mrd-text-field",{name:[1],label:[1],value:[1],placeholder:[1],required:[4],disabled:[4],locale:[1],error:[32]}]);function m(){"undefined"!=typeof customElements&&["mrd-text-field"].forEach((r=>{"mrd-text-field"===r&&(customElements.get(o(r))||customElements.define(o(r),c))}))}export{c as M,m as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as e,HTMLElement as r,createEvent as t,h as a,Host as d,transformTag as i}from"@stencil/core/internal/client";import{r as o,F as l,c as s,a as n}from"./field-helpers.js";const m=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost(),this.mrdChange=t(this,"mrdChange",7),this.mrdBlur=t(this,"mrdBlur",7),this.name="",this.label="",this.value="",this.placeholder="",this.required=!1,this.disabled=!1,this.locale=navigator.language,this.error="",this.editorReady=!1}componentDidLoad(){this.initQuill()}async initQuill(){try{const e=(await import("./quill.js")).default;if(this.editorEl=this.el.querySelector(".mrd-textarea-field__editor"),!this.editorEl)return;const r=new e(this.editorEl,{theme:"snow",placeholder:this.placeholder,readOnly:this.disabled,modules:{toolbar:[["bold","italic","underline","strike"],[{list:"ordered"},{list:"bullet"}],[{header:[1,2,3,!1]}],["link"],["clean"]]}});this.value&&r.clipboard.dangerouslyPasteHTML(this.value),r.on("text-change",(()=>{var e,r;const t=null!==(r=null===(e=this.editorEl.querySelector(".ql-editor"))||void 0===e?void 0:e.innerHTML)&&void 0!==r?r:"";this.mrdChange.emit({name:this.name,value:t})})),r.on("selection-change",(e=>{var r,t;if(!e){const e=null!==(t=null===(r=this.editorEl.querySelector(".ql-editor"))||void 0===r?void 0:r.innerHTML)&&void 0!==t?t:"";this.error=o(e,this.required,this.locale),this.mrdBlur.emit({name:this.name,value:e})}})),this.editorReady=!0}catch(e){console.error("Failed to load Quill editor:",e)}}render(){return a(d,{key:"de39890fc23146b880e69be7a8f04c91786ae9c9"},a("div",{key:"0ccc855f3ee44553559a9ea8a70690466789f76d",class:"mrd-textarea-field"},a(l,{key:"2a16dcbeedbba8b5d8d1e8e8c0f021f14813f609",base:"mrd-textarea-field",label:this.label,required:this.required}),a("div",{key:"979ecb0ed163e3f753d75635452eea49d76edf29",class:s("mrd-textarea-field",!!this.error,"container")},a("div",{key:"8ea96a080086b68df55017a1464f6bce502f9a58",class:"mrd-textarea-field__editor"})),a(n,{key:"d6ac1a12f7be3594ed8cdb6d94b304c46dc8285b",base:"mrd-textarea-field",error:this.error})))}get el(){return this}static get style(){return'.sc-mrd-textarea-field-h{display:block}.mrd-textarea-field.sc-mrd-textarea-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-textarea-field__label.sc-mrd-textarea-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-textarea-field__label--required.sc-mrd-textarea-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-textarea-field__error.sc-mrd-textarea-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}.mrd-textarea-field__container.sc-mrd-textarea-field{border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);overflow:hidden;background-color:var(--mrd-input-bg);transition:border-color var(--mrd-transition), box-shadow var(--mrd-transition)}.mrd-textarea-field__container.sc-mrd-textarea-field:focus-within{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-textarea-field__container--error.sc-mrd-textarea-field{border-color:var(--mrd-border-color-error)}.mrd-textarea-field__container--error.sc-mrd-textarea-field:focus-within{box-shadow:var(--mrd-shadow-focus-error)}.mrd-textarea-field__editor.sc-mrd-textarea-field{min-height:150px;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base)}.mrd-textarea-field__editor.sc-mrd-textarea-field .ql-toolbar.sc-mrd-textarea-field{border:none;border-bottom:var(--mrd-border-width) solid var(--mrd-border-color);font-family:var(--mrd-font-family)}.mrd-textarea-field__editor.sc-mrd-textarea-field .ql-container.sc-mrd-textarea-field{border:none;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base)}.mrd-textarea-field__editor.sc-mrd-textarea-field .ql-editor.sc-mrd-textarea-field{min-height:120px;padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x)}.mrd-textarea-field__editor.sc-mrd-textarea-field .ql-editor.ql-blank.sc-mrd-textarea-field::before{color:var(--mrd-input-placeholder-color);font-style:normal}'}},[2,"mrd-textarea-field",{name:[1],label:[1],value:[1],placeholder:[1],required:[4],disabled:[4],locale:[1],error:[32],editorReady:[32]}]);function f(){"undefined"!=typeof customElements&&["mrd-textarea-field"].forEach((e=>{"mrd-textarea-field"===e&&(customElements.get(i(e))||customElements.define(i(e),m))}))}export{m as M,f as d}
1
+ import{proxyCustomElement as e,HTMLElement as r,createEvent as t,h as a,Host as d,transformTag as i}from"@stencil/core/internal/client";import{p as o}from"./purify.es.js";import{r as l,F as s,c as n,a as c}from"./field-helpers.js";const f=e(class extends r{constructor(e){super(),!1!==e&&this.__registerHost(),this.mrdChange=t(this,"mrdChange",7),this.mrdBlur=t(this,"mrdBlur",7),this.name="",this.label="",this.value="",this.placeholder="",this.required=!1,this.disabled=!1,this.locale=navigator.language,this.error="",this.editorReady=!1}componentDidLoad(){this.initQuill()}async initQuill(){try{const e=(await import("./quill.js")).default;if(this.editorEl=this.el.querySelector(".mrd-textarea-field__editor"),!this.editorEl)return;const r=new e(this.editorEl,{theme:"snow",placeholder:this.placeholder,readOnly:this.disabled,modules:{toolbar:[["bold","italic","underline","strike"],[{list:"ordered"},{list:"bullet"}],[{header:[1,2,3,!1]}],["link"],["clean"]]}});this.value&&r.clipboard.dangerouslyPasteHTML(this.value),r.on("text-change",(()=>{const e=this.getSanitizedHtml();this.mrdChange.emit({name:this.name,value:e})})),r.on("selection-change",(e=>{if(!e){const e=this.getSanitizedHtml();this.error=l(e,this.required,this.locale),this.mrdBlur.emit({name:this.name,value:e})}})),this.editorReady=!0}catch(e){console.error("Failed to load Quill editor:",e)}}getSanitizedHtml(){var e,r;const t=null!==(r=null===(e=this.editorEl.querySelector(".ql-editor"))||void 0===e?void 0:e.innerHTML)&&void 0!==r?r:"";return o.sanitize(t)}render(){return a(d,{key:"e132531881f68f373e700617aac8033c8ebccb47"},a("div",{key:"fec0cf56cd7868d3fcd5a4e8a382b2dcdb6e5c50",class:"mrd-textarea-field"},a(s,{key:"333aa2ff57cce9e3178f0c4be4a1df1077884248",base:"mrd-textarea-field",label:this.label,required:this.required}),a("div",{key:"40025207580eb5768981b85aaa0a8ff95fce7234",class:n("mrd-textarea-field",!!this.error,"container")},a("div",{key:"621987b3b2b1d8b4836bff065075ba527a82db81",class:"mrd-textarea-field__editor"})),a(c,{key:"ac2d8de22f008cd1c91842137ccd0cd36eb9ce19",base:"mrd-textarea-field",error:this.error})))}get el(){return this}static get style(){return'.sc-mrd-textarea-field-h{display:block}.mrd-textarea-field.sc-mrd-textarea-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-textarea-field__label.sc-mrd-textarea-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-textarea-field__label--required.sc-mrd-textarea-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-textarea-field__error.sc-mrd-textarea-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}.mrd-textarea-field__container.sc-mrd-textarea-field{border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);overflow:hidden;background-color:var(--mrd-input-bg);transition:border-color var(--mrd-transition), box-shadow var(--mrd-transition)}.mrd-textarea-field__container.sc-mrd-textarea-field:focus-within{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-textarea-field__container--error.sc-mrd-textarea-field{border-color:var(--mrd-border-color-error)}.mrd-textarea-field__container--error.sc-mrd-textarea-field:focus-within{box-shadow:var(--mrd-shadow-focus-error)}.mrd-textarea-field__editor.sc-mrd-textarea-field{min-height:150px;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base)}.mrd-textarea-field__editor.sc-mrd-textarea-field .ql-toolbar.sc-mrd-textarea-field{border:none;border-bottom:var(--mrd-border-width) solid var(--mrd-border-color);font-family:var(--mrd-font-family)}.mrd-textarea-field__editor.sc-mrd-textarea-field .ql-container.sc-mrd-textarea-field{border:none;font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base)}.mrd-textarea-field__editor.sc-mrd-textarea-field .ql-editor.sc-mrd-textarea-field{min-height:120px;padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x)}.mrd-textarea-field__editor.sc-mrd-textarea-field .ql-editor.ql-blank.sc-mrd-textarea-field::before{color:var(--mrd-input-placeholder-color);font-style:normal}'}},[2,"mrd-textarea-field",{name:[1],label:[1],value:[1],placeholder:[1],required:[4],disabled:[4],locale:[1],error:[32],editorReady:[32]}]);function m(){"undefined"!=typeof customElements&&["mrd-textarea-field"].forEach((e=>{"mrd-textarea-field"===e&&(customElements.get(i(e))||customElements.define(i(e),f))}))}export{f as M,m as d}
@@ -1 +1 @@
1
- import{proxyCustomElement as r,HTMLElement as e,createEvent as i,h as d,Host as t,transformTag as o}from"@stencil/core/internal/client";import{r as a,F as m,c as l,a as s}from"./field-helpers.js";const c=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdChange=i(this,"mrdChange",7),this.mrdBlur=i(this,"mrdBlur",7),this.name="",this.label="",this.value="",this.required=!1,this.disabled=!1,this.locale=navigator.language,this.error="",this.handleChange=r=>{const e=r.target.value;this.error=a(e,this.required,this.locale),this.mrdChange.emit({name:this.name,value:e})},this.handleBlur=r=>{this.mrdBlur.emit({name:this.name,value:r.target.value})}}render(){return d(t,{key:"588e298c4f52aa4e65d87bfdc6918282ed97b3ae"},d("div",{key:"eed7332ca78747d4ff8b6c8d06ad4674e1c37e69",class:"mrd-time-field"},d(m,{key:"6383beb79fd05dabdc408256e3326f9637e4c993",base:"mrd-time-field",label:this.label,required:this.required}),d("input",{key:"b372d8b5dd523ee6182fe302450ce904ac17cc3c",class:l("mrd-time-field",!!this.error),type:"time",name:this.name,value:this.value,required:this.required,disabled:this.disabled,onChange:this.handleChange,onBlur:this.handleBlur}),d(s,{key:"7d8ce1e557bf583c0409e8f02893a15fadeab634",base:"mrd-time-field",error:this.error})))}static get style(){return'.sc-mrd-time-field-h{display:block}.mrd-time-field.sc-mrd-time-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-time-field__label.sc-mrd-time-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-time-field__label--required.sc-mrd-time-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-time-field__input.sc-mrd-time-field{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);transition:border-color var(--mrd-transition), box-shadow var(--mrd-transition);outline:none;appearance:none;box-sizing:border-box}.mrd-time-field__input.sc-mrd-time-field::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-time-field__input.sc-mrd-time-field:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-time-field__input.sc-mrd-time-field:disabled{background-color:var(--mrd-input-bg-disabled);cursor:not-allowed;opacity:0.7}.mrd-time-field__input--error.sc-mrd-time-field{border-color:var(--mrd-border-color-error)}.mrd-time-field__input--error.sc-mrd-time-field:focus{box-shadow:var(--mrd-shadow-focus-error)}.mrd-time-field__error.sc-mrd-time-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}.mrd-time-field__input.sc-mrd-time-field{cursor:pointer}'}},[2,"mrd-time-field",{name:[1],label:[1],value:[1],required:[4],disabled:[4],locale:[1],error:[32]}]);function n(){"undefined"!=typeof customElements&&["mrd-time-field"].forEach((r=>{"mrd-time-field"===r&&(customElements.get(o(r))||customElements.define(o(r),c))}))}export{c as M,n as d}
1
+ import{proxyCustomElement as r,HTMLElement as e,createEvent as i,h as d,Host as t,transformTag as o}from"@stencil/core/internal/client";import{r as a,F as m,c as l,a as s}from"./field-helpers.js";const n=r(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.mrdChange=i(this,"mrdChange",7),this.mrdBlur=i(this,"mrdBlur",7),this.name="",this.label="",this.value="",this.required=!1,this.disabled=!1,this.locale=navigator.language,this.error="",this.handleChange=r=>{const e=r.target.value;this.error=a(e,this.required,this.locale),this.mrdChange.emit({name:this.name,value:e})},this.handleBlur=r=>{this.mrdBlur.emit({name:this.name,value:r.target.value})}}render(){return d(t,{key:"d521c654bc7beda71a31542a25198edaaf53b838"},d("div",{key:"084ab16ac8aed952bd0ec50e0430591d4db5bd4b",class:"mrd-time-field"},d(m,{key:"43938ad7c5a9765353f6523d399d4b74cbb9ec6f",base:"mrd-time-field",label:this.label,required:this.required}),d("input",{key:"e46eda620e7a5f1bb3b433a4c051e913675c33f9",class:l("mrd-time-field",!!this.error),type:"time",name:this.name,value:this.value,required:this.required,disabled:this.disabled,onChange:this.handleChange,onBlur:this.handleBlur}),d(s,{key:"34bc1eaa1b969951dffaaacad73af532b6d290fb",base:"mrd-time-field",error:this.error})))}static get style(){return'.sc-mrd-time-field-h{display:block}.mrd-time-field.sc-mrd-time-field{display:flex;flex-direction:column;gap:var(--mrd-space-1);width:100%}.mrd-time-field__label.sc-mrd-time-field{display:block;font-family:var(--mrd-font-family);font-size:var(--mrd-label-font-size);font-weight:var(--mrd-label-font-weight);color:var(--mrd-label-color)}.mrd-time-field__label--required.sc-mrd-time-field::after{content:" *";color:var(--mrd-color-danger)}.mrd-time-field__input.sc-mrd-time-field{display:block;width:100%;height:var(--mrd-input-height);padding:var(--mrd-input-padding-y) var(--mrd-input-padding-x);font-family:var(--mrd-font-family);font-size:var(--mrd-font-size-base);color:var(--mrd-input-color);background-color:var(--mrd-input-bg);border:var(--mrd-border-width) solid var(--mrd-border-color);border-radius:var(--mrd-border-radius);transition:border-color var(--mrd-transition), box-shadow var(--mrd-transition);outline:none;appearance:none;box-sizing:border-box}.mrd-time-field__input.sc-mrd-time-field::placeholder{color:var(--mrd-input-placeholder-color)}.mrd-time-field__input.sc-mrd-time-field:focus{border-color:var(--mrd-border-color-focus);box-shadow:var(--mrd-shadow-focus)}.mrd-time-field__input.sc-mrd-time-field:disabled{background-color:var(--mrd-input-bg-disabled);cursor:not-allowed;opacity:0.7}.mrd-time-field__input--error.sc-mrd-time-field{border-color:var(--mrd-border-color-error)}.mrd-time-field__input--error.sc-mrd-time-field:focus{box-shadow:var(--mrd-shadow-focus-error)}.mrd-time-field__error.sc-mrd-time-field{font-family:var(--mrd-font-family);font-size:var(--mrd-error-font-size);color:var(--mrd-error-color)}.mrd-time-field__input.sc-mrd-time-field{cursor:pointer}'}},[2,"mrd-time-field",{name:[1],label:[1],value:[1],required:[4],disabled:[4],locale:[1],error:[32]}]);function c(){"undefined"!=typeof customElements&&["mrd-time-field"].forEach((r=>{"mrd-time-field"===r&&(customElements.get(o(r))||customElements.define(o(r),n))}))}export{n as M,c as d}
@@ -0,0 +1,2 @@
1
+ /*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */
2
+ function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}const e=Object.entries,n=Object.setPrototypeOf,r=Object.isFrozen,o=Object.getPrototypeOf,i=Object.getOwnPropertyDescriptor;let a=Object.freeze,l=Object.seal,c=Object.create,s="undefined"!=typeof Reflect&&Reflect,u=s.apply,f=s.construct;a||(a=function(t){return t}),l||(l=function(t){return t}),u||(u=function(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return t.apply(e,r)}),f||(f=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return new t(...n)});const p=N(Array.prototype.forEach),m=N(Array.prototype.lastIndexOf),d=N(Array.prototype.pop),h=N(Array.prototype.push),y=N(Array.prototype.splice),g=Array.isArray,b=N(String.prototype.toLowerCase),w=N(String.prototype.toString),v=N(String.prototype.match),x=N(String.prototype.replace),S=N(String.prototype.indexOf),k=N(String.prototype.trim),T=N(Number.prototype.toString),A=N(Boolean.prototype.toString),E="undefined"==typeof BigInt?null:N(BigInt.prototype.toString),O="undefined"==typeof Symbol?null:N(Symbol.prototype.toString),z=N(Object.prototype.hasOwnProperty),D=N(Object.prototype.toString),R=N(RegExp.prototype.test),_=(j=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return f(j,e)});var j;function N(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return u(t,e,r)}}function L(t,e){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:b;if(n&&n(t,null),!g(e))return t;let i=e.length;for(;i--;){let n=e[i];if("string"==typeof n){const t=o(n);t!==n&&(r(e)||(e[i]=t),n=t)}t[n]=!0}return t}function I(t){for(let e=0;e<t.length;e++)z(t,e)||(t[e]=null);return t}function M(n){const r=c(null);for(const l of e(n)){var o=(a=2,function(t){if(Array.isArray(t))return t}(i=l)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e);else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(t){s=!0,o=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}(i,a)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(i,a)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());const e=o[0],c=o[1];z(n,e)&&(r[e]=g(c)?I(c):c&&"object"==typeof c&&c.constructor===Object?M(c):c)}var i,a;return r}function F(t,e){for(;null!==t;){const n=i(t,e);if(n){if(n.get)return N(n.get);if("function"==typeof n.value)return N(n.value)}t=o(t)}return function(){return null}}const C=a(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),B=a(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),P=a(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),U=a(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Y=a(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),G=a(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),q=a(["#text"]),H=a(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),W=a(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),$=a(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),K=a(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),V=l(/{{[\w\W]*|^[\w\W]*}}/g),X=l(/<%[\w\W]*|^[\w\W]*%>/g),J=l(/\${[\w\W]*/g),Q=l(/^data-[\-\w.\u00B7-\uFFFF]+$/),Z=l(/^aria-[\-\w]+$/),tt=l(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),et=l(/^(?:\w+script|data):/i),nt=l(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),rt=l(/^html$/i),ot=l(/^[a-z][.\w]*(-[.\w]+)+$/i),it=l(/<[/\w!]/g),at=l(/<[/\w]/g),lt=l(/<\/no(script|embed|frames)/i),ct=l(/\/>/i),st=function(){return"undefined"==typeof window?null:window},ut=function(t,e,n,r){return z(t,e)&&g(t[e])?L(r.base?M(r.base):{},t[e],r.transform):n};var ft=function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:st();const r=e=>t(e);if(r.version="3.4.12",r.removed=[],!n||!n.document||9!==n.document.nodeType||!n.Element)return r.isSupported=!1,r;let o=n.document;const i=o,s=i.currentScript,u=n.HTMLTemplateElement,f=n.Node,j=n.NodeFilter,N=n.DOMParser,I=n.trustedTypes,ft=n.Element.prototype,pt=F(ft,"cloneNode"),mt=F(ft,"remove"),dt=F(ft,"nextSibling"),ht=F(ft,"childNodes"),yt=F(ft,"parentNode"),gt=F(ft,"shadowRoot"),bt=F(ft,"attributes"),wt=f&&f.prototype?F(f.prototype,"nodeType"):null,vt=f&&f.prototype?F(f.prototype,"nodeName"):null;if("function"==typeof u){const t=o.createElement("template");t.content&&t.content.ownerDocument&&(o=t.content.ownerDocument)}let xt,St,kt="",Tt=!1,At=0;const Et=function(){if(At>0)throw _('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Ot=function(t){Et(),At++;try{return xt.createHTML(t)}finally{At--}},zt=o.implementation,Dt=o.createNodeIterator,Rt=o.createDocumentFragment,_t=o.getElementsByTagName,jt=i.importNode;let Nt={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};r.isSupported="function"==typeof e&&"function"==typeof yt&&zt&&void 0!==zt.createHTMLDocument;const Lt=V,It=X,Mt=J,Ft=Q,Ct=Z,Bt=et,Pt=nt,Ut=ot;let Yt=tt,Gt=null;const qt=L({},[...C,...B,...P,...Y,...q]);let Ht=null;const Wt=L({},[...H,...W,...$,...K]);let $t=Object.seal(c(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Kt=null,Vt=null;const Xt=Object.seal(c(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Jt=!0,Qt=!0,Zt=!1,te=!0,ee=!1,ne=!0,re=!1,oe=!1,ie=null,ae=null,le=!1,ce=!1,se=!1,ue=!1,fe=!0,pe=!1;const me="user-content-";let de=!0,he=!1,ye={},ge=null;const be=L({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let we=null;const ve=L({},["audio","video","img","source","image","track"]);let xe=null;const Se=L({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ke="http://www.w3.org/1998/Math/MathML",Te="http://www.w3.org/2000/svg",Ae="http://www.w3.org/1999/xhtml";let Ee=Ae,Oe=!1,ze=null;const De=L({},[ke,Te,Ae],w),Re=a(["mi","mo","mn","ms","mtext"]);let _e=L({},Re);const je=a(["annotation-xml"]);let Ne=L({},je);const Le=L({},["title","style","font","a","script"]);let Ie=null;const Me=["application/xhtml+xml","text/html"];let Fe=null,Ce=null;const Be=o.createElement("form"),Pe=function(t){return t instanceof RegExp||t instanceof Function},Ue=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Ce&&Ce===t)return;t&&"object"==typeof t||(t={}),t=M(t),Ie=-1===Me.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,Fe="application/xhtml+xml"===Ie?w:b,Gt=ut(t,"ALLOWED_TAGS",qt,{transform:Fe}),Ht=ut(t,"ALLOWED_ATTR",Wt,{transform:Fe}),ze=ut(t,"ALLOWED_NAMESPACES",De,{transform:w}),xe=ut(t,"ADD_URI_SAFE_ATTR",Se,{transform:Fe,base:Se}),we=ut(t,"ADD_DATA_URI_TAGS",ve,{transform:Fe,base:ve}),ge=ut(t,"FORBID_CONTENTS",be,{transform:Fe}),Kt=ut(t,"FORBID_TAGS",M({}),{transform:Fe}),Vt=ut(t,"FORBID_ATTR",M({}),{transform:Fe}),ye=!!z(t,"USE_PROFILES")&&(t.USE_PROFILES&&"object"==typeof t.USE_PROFILES?M(t.USE_PROFILES):t.USE_PROFILES),Jt=!1!==t.ALLOW_ARIA_ATTR,Qt=!1!==t.ALLOW_DATA_ATTR,Zt=t.ALLOW_UNKNOWN_PROTOCOLS||!1,te=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,ee=t.SAFE_FOR_TEMPLATES||!1,ne=!1!==t.SAFE_FOR_XML,re=t.WHOLE_DOCUMENT||!1,ce=t.RETURN_DOM||!1,se=t.RETURN_DOM_FRAGMENT||!1,ue=t.RETURN_TRUSTED_TYPE||!1,le=t.FORCE_BODY||!1,fe=!1!==t.SANITIZE_DOM,pe=t.SANITIZE_NAMED_PROPS||!1,de=!1!==t.KEEP_CONTENT,he=t.IN_PLACE||!1,Yt=function(t){try{return R(t,""),!0}catch(t){return!1}}(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:tt,Ee="string"==typeof t.NAMESPACE?t.NAMESPACE:Ae,_e=z(t,"MATHML_TEXT_INTEGRATION_POINTS")&&t.MATHML_TEXT_INTEGRATION_POINTS&&"object"==typeof t.MATHML_TEXT_INTEGRATION_POINTS?M(t.MATHML_TEXT_INTEGRATION_POINTS):L({},Re),Ne=z(t,"HTML_INTEGRATION_POINTS")&&t.HTML_INTEGRATION_POINTS&&"object"==typeof t.HTML_INTEGRATION_POINTS?M(t.HTML_INTEGRATION_POINTS):L({},je);const e=z(t,"CUSTOM_ELEMENT_HANDLING")&&t.CUSTOM_ELEMENT_HANDLING&&"object"==typeof t.CUSTOM_ELEMENT_HANDLING?M(t.CUSTOM_ELEMENT_HANDLING):c(null);if($t=c(null),z(e,"tagNameCheck")&&Pe(e.tagNameCheck)&&($t.tagNameCheck=e.tagNameCheck),z(e,"attributeNameCheck")&&Pe(e.attributeNameCheck)&&($t.attributeNameCheck=e.attributeNameCheck),z(e,"allowCustomizedBuiltInElements")&&"boolean"==typeof e.allowCustomizedBuiltInElements&&($t.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),l($t),ee&&(Qt=!1),se&&(ce=!0),ye&&(Gt=L({},q),Ht=c(null),!0===ye.html&&(L(Gt,C),L(Ht,H)),!0===ye.svg&&(L(Gt,B),L(Ht,W),L(Ht,K)),!0===ye.svgFilters&&(L(Gt,P),L(Ht,W),L(Ht,K)),!0===ye.mathMl&&(L(Gt,Y),L(Ht,$),L(Ht,K))),Xt.tagCheck=null,Xt.attributeCheck=null,z(t,"ADD_TAGS")&&("function"==typeof t.ADD_TAGS?Xt.tagCheck=t.ADD_TAGS:g(t.ADD_TAGS)&&(Gt===qt&&(Gt=M(Gt)),L(Gt,t.ADD_TAGS,Fe))),z(t,"ADD_ATTR")&&("function"==typeof t.ADD_ATTR?Xt.attributeCheck=t.ADD_ATTR:g(t.ADD_ATTR)&&(Ht===Wt&&(Ht=M(Ht)),L(Ht,t.ADD_ATTR,Fe))),z(t,"ADD_URI_SAFE_ATTR")&&g(t.ADD_URI_SAFE_ATTR)&&L(xe,t.ADD_URI_SAFE_ATTR,Fe),z(t,"FORBID_CONTENTS")&&g(t.FORBID_CONTENTS)&&(ge===be&&(ge=M(ge)),L(ge,t.FORBID_CONTENTS,Fe)),z(t,"ADD_FORBID_CONTENTS")&&g(t.ADD_FORBID_CONTENTS)&&(ge===be&&(ge=M(ge)),L(ge,t.ADD_FORBID_CONTENTS,Fe)),de&&(Gt["#text"]=!0),re&&L(Gt,["html","head","body"]),Gt.table&&(L(Gt,["tbody"]),delete Kt.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw _('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw _('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const e=xt;xt=t.TRUSTED_TYPES_POLICY;try{kt=Ot("")}catch(t){throw xt=e,t}}else null===t.TRUSTED_TYPES_POLICY?(xt=void 0,kt=""):(void 0===xt&&(Tt||(St=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";e&&e.hasAttribute(r)&&(n=e.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return t.createPolicy(o,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(I,s),Tt=!0),xt=St),xt&&"string"==typeof kt&&(kt=Ot("")));a&&a(t),Ce=t},Ye=L({},[...B,...P,...U]),Ge=L({},[...Y,...G]),qe=function(t){h(r.removed,{element:t});try{yt(t).removeChild(t)}catch(e){if(mt(t),!yt(t))throw _("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},He=function(t){Ke(t);const e=ht(t);if(e){const t=[];p(e,(e=>{h(t,e)})),p(t,(t=>{try{mt(t)}catch(t){}}))}const n=bt(t);if(n)for(let e=n.length-1;e>=0;--e){const r=n[e],o=r&&r.name;if("string"==typeof o)try{t.removeAttribute(o)}catch(t){}}},We=function(t,e){try{h(r.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){h(r.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t)if(ce||se)try{qe(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},$e=function(t){const e=bt(t);if(e)for(let n=e.length-1;n>=0;--n){const r=e[n],o=r&&r.name;if("string"==typeof o&&!Ht[Fe(o)])try{t.removeAttribute(o)}catch(t){}}},Ke=function(t){const e=[t];for(;e.length>0;){const t=e.pop();1===(wt?wt(t):t.nodeType)&&$e(t);const n=ht(t);if(n)for(let t=n.length-1;t>=0;--t)e.push(n[t])}},Ve=function(t){let e=null,n=null;if(le)t="<remove></remove>"+t;else{const e=v(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===Ie&&Ee===Ae&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const r=xt?Ot(t):t;if(Ee===Ae)try{e=(new N).parseFromString(r,Ie)}catch(t){}if(!e||!e.documentElement){e=zt.createDocument(Ee,"template",null);try{e.documentElement.innerHTML=Oe?kt:r}catch(t){}}const i=e.body||e.documentElement;return t&&n&&i.insertBefore(o.createTextNode(n),i.childNodes[0]||null),Ee===Ae?_t.call(e,re?"html":"body")[0]:re?e.documentElement:i},Xe=function(t){return Dt.call(t.ownerDocument||t,t,j.SHOW_ELEMENT|j.SHOW_COMMENT|j.SHOW_TEXT|j.SHOW_PROCESSING_INSTRUCTION|j.SHOW_CDATA_SECTION,null)},Je=function(t){return t=x(t,Lt," "),t=x(t,It," "),x(t,Mt," ")},Qe=function(t){var e;t.normalize();const n=Dt.call(t.ownerDocument||t,t,j.SHOW_TEXT|j.SHOW_COMMENT|j.SHOW_CDATA_SECTION|j.SHOW_PROCESSING_INSTRUCTION,null);let r=n.nextNode();for(;r;)r.data=Je(r.data),r=n.nextNode();const o=null===(e=t.querySelectorAll)||void 0===e?void 0:e.call(t,"template");o&&p(o,(t=>{tn(t.content)&&Qe(t.content)}))},Ze=function(t){const e=vt?vt(t):null;return"string"==typeof e&&"form"===Fe(e)&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||t.attributes!==bt(t)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes||t.nodeType!==wt(t)||t.childNodes!==ht(t))},tn=function(t){if(!wt||"object"!=typeof t||null===t)return!1;try{return 11===wt(t)}catch(t){return!1}},en=function(t){if(!wt||"object"!=typeof t||null===t)return!1;try{return"number"==typeof wt(t)}catch(t){return!1}};function nn(t,e,n){0!==t.length&&p(t,(t=>{t.call(r,e,n,Ce)}))}const rn=function(t,e){if(nn(Nt.beforeSanitizeElements,t,null),t!==e&&null===yt(t))return!0;if(Ze(t))return qe(t),!0;const n=Fe(vt?vt(t):t.nodeName);if(nn(Nt.uponSanitizeElement,t,{tagName:n,allowedTags:Gt}),t!==e&&null===yt(t))return!0;if(function(t,e){return!!(ne&&t.hasChildNodes()&&!en(t.firstElementChild)&&R(it,t.textContent)&&R(it,t.innerHTML))||!(!ne||t.namespaceURI!==Ae||"style"!==e||!en(t.firstElementChild))||7===t.nodeType||!(!ne||8!==t.nodeType||!R(at,t.data))}(t,n))return qe(t),!0;if(Kt[n]||!(Xt.tagCheck instanceof Function&&Xt.tagCheck(n))&&!Gt[n]){const e=function(t,e){if(!Kt[e]&&ln(e)){if($t.tagNameCheck instanceof RegExp&&R($t.tagNameCheck,e))return!1;if($t.tagNameCheck instanceof Function&&$t.tagNameCheck(e))return!1}if(de&&!ge[e]){const e=yt(t),n=ht(t);if(n&&e)for(let r=n.length-1;r>=0;--r){const o=he?n[r]:pt(n[r],!0);e.insertBefore(o,dt(t))}}return qe(t),!0}(t,n);return!1===e&&nn(Nt.afterSanitizeElements,t,null),e}if(1===(wt?wt(t):t.nodeType)&&!function(t){let e=yt(t);e&&e.tagName||(e={namespaceURI:Ee,tagName:"template"});const n=b(t.tagName),r=b(e.tagName);return!!ze[t.namespaceURI]&&(t.namespaceURI===Te?function(t,e,n){return e.namespaceURI===Ae?"svg"===t:e.namespaceURI===ke?"svg"===t&&("annotation-xml"===n||_e[n]):Boolean(Ye[t])}(n,e,r):t.namespaceURI===ke?function(t,e,n){return e.namespaceURI===Ae?"math"===t:e.namespaceURI===Te?"math"===t&&Ne[n]:Boolean(Ge[t])}(n,e,r):t.namespaceURI===Ae?function(t,e,n){return!(e.namespaceURI===Te&&!Ne[n])&&!(e.namespaceURI===ke&&!_e[n])&&!Ge[t]&&(Le[t]||!Ye[t])}(n,e,r):!("application/xhtml+xml"!==Ie||!ze[t.namespaceURI]))}(t))return qe(t),!0;if(("noscript"===n||"noembed"===n||"noframes"===n)&&R(lt,t.innerHTML))return qe(t),!0;if(ee&&3===t.nodeType){const e=Je(t.textContent);t.textContent!==e&&(h(r.removed,{element:t.cloneNode()}),t.textContent=e)}return nn(Nt.afterSanitizeElements,t,null),!1},on=function(t,e,n){if(Vt[e])return!1;if(ne&&"patchsrc"===e)return!1;if(ne&&"for"===e&&"label"!==t&&"output"!==t)return!1;if(fe&&("id"===e||"name"===e)&&(n in o||n in Be))return!1;const r=Ht[e]||Xt.attributeCheck instanceof Function&&Xt.attributeCheck(e,t);if(Qt&&R(Ft,e));else if(Jt&&R(Ct,e));else if(r){if(xe[e]);else if(R(Yt,x(n,Pt,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==S(n,"data:")||!we[t])if(Zt&&!R(Bt,x(n,Pt,"")));else if(n)return!1}else if(!(ln(t)&&($t.tagNameCheck instanceof RegExp&&R($t.tagNameCheck,t)||$t.tagNameCheck instanceof Function&&$t.tagNameCheck(t))&&($t.attributeNameCheck instanceof RegExp&&R($t.attributeNameCheck,e)||$t.attributeNameCheck instanceof Function&&$t.attributeNameCheck(e,t))||"is"===e&&$t.allowCustomizedBuiltInElements&&($t.tagNameCheck instanceof RegExp&&R($t.tagNameCheck,n)||$t.tagNameCheck instanceof Function&&$t.tagNameCheck(n))))return!1;return!0},an=L({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ln=function(t){return!an[b(t)]&&R(Ut,t)},cn=function(t,e,n,r){if(xt&&"object"==typeof I&&"function"==typeof I.getAttributeType&&!n)switch(I.getAttributeType(t,e)){case"TrustedHTML":return Ot(r);case"TrustedScriptURL":return function(t){Et(),At++;try{return xt.createScriptURL(t)}finally{At--}}(r)}return r},sn=function(t,e,n,o){try{n?t.setAttributeNS(n,e,o):t.setAttribute(e,o),Ze(t)?qe(t):d(r.removed)}catch(n){We(e,t)}},un=function(t){nn(Nt.beforeSanitizeAttributes,t,null);const e=t.attributes;if(!e||Ze(t))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ht,forceKeepAttr:void 0};let r=e.length;const o=Fe(t.nodeName);for(;r--;){const i=e[r],a=i.name,l=i.namespaceURI,c=i.value,s=Fe(a),u=c;let f="value"===a?u:k(u);n.attrName=s,n.attrValue=f,n.keepAttr=!0,n.forceKeepAttr=void 0,nn(Nt.uponSanitizeAttribute,t,n),f=n.attrValue,!pe||"id"!==s&&"name"!==s||0===S(f,me)||(We(a,t),f=me+f),ne&&R(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)||"attributename"===s&&v(f,"href")?We(a,t):n.forceKeepAttr||(!n.keepAttr||!te&&R(ct,f)?We(a,t):(ee&&(f=Je(f)),on(o,s,f)?(f=cn(o,s,l,f),f!==u&&sn(t,a,l,f)):We(a,t)))}nn(Nt.afterSanitizeAttributes,t,null)},fn=function(t){let e=null;const n=Xe(t);for(nn(Nt.beforeSanitizeShadowDOM,t,null);e=n.nextNode();)if(nn(Nt.uponSanitizeShadowNode,e,null),rn(e,t),un(e),tn(e.content)&&fn(e.content),1===(wt?wt(e):e.nodeType)){const t=gt(e);tn(t)&&(pn(t),fn(t))}nn(Nt.afterSanitizeShadowDOM,t,null)},pn=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const t=e.pop();if(t.shadow){fn(t.shadow);continue}const n=t.node,r=1===(wt?wt(n):n.nodeType),o=ht(n);if(o)for(let t=o.length-1;t>=0;--t)e.push({node:o[t],shadow:null});if(r){const t=vt?vt(n):null;if("string"==typeof t&&"template"===Fe(t)){const t=n.content;tn(t)&&e.push({node:t,shadow:null})}}if(r){const t=gt(n);tn(t)&&e.push({node:null,shadow:t},{node:t,shadow:null})}}};return r.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,o=null,a=null,l=null;if(Oe=!t,Oe&&(t="\x3c!--\x3e"),"string"!=typeof t&&!en(t)&&"string"!=typeof(t=function(t){switch(typeof t){case"string":return t;case"number":return T(t);case"boolean":return A(t);case"bigint":return E?E(t):"0";case"symbol":return O?O(t):"Symbol()";case"undefined":default:return D(t);case"function":case"object":{if(null===t)return D(t);const e=t,n=F(e,"toString");if("function"==typeof n){const t=n(e);return"string"==typeof t?t:D(t)}return D(t)}}}(t)))throw _("dirty is not a string, aborting");if(!r.isSupported)return t;oe?(Gt=ie,Ht=ae):Ue(e),(Nt.uponSanitizeElement.length>0||Nt.uponSanitizeAttribute.length>0)&&(Gt=M(Gt)),Nt.uponSanitizeAttribute.length>0&&(Ht=M(Ht)),r.removed=[];const c=he&&"string"!=typeof t&&en(t);if(c){!function(t){if(!ne)return;const e=[t];for(;e.length>0;){const t=e.pop(),n=wt?wt(t):t.nodeType;if(7===n||8===n&&R(at,t.data)){try{mt(t)}catch(t){}continue}if(1===n){const e=t,n=Fe(vt?vt(t):t.nodeName);try{e.hasAttribute&&e.hasAttribute("patchsrc")&&e.removeAttribute("patchsrc"),e.hasAttribute&&e.hasAttribute("for")&&"label"!==n&&"output"!==n&&e.removeAttribute("for")}catch(t){}}const r=ht(t);if(r)for(let t=r.length-1;t>=0;--t)e.push(r[t])}}(t);const e=vt?vt(t):t.nodeName;if("string"==typeof e){const n=Fe(e);if(!Gt[n]||Kt[n])throw He(t),_("root node is forbidden and cannot be sanitized in-place")}if(Ze(t))throw He(t),_("root node is clobbered and cannot be sanitized in-place");try{pn(t)}catch(e){throw He(t),e}}else if(en(t))n=Ve("\x3c!----\x3e"),o=n.ownerDocument.importNode(t,!0),1===o.nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?n=o:n.appendChild(o),pn(o);else{if(!ce&&!ee&&!re&&-1===t.indexOf("<"))return xt&&ue?Ot(t):t;if(n=Ve(t),!n)return ce?null:ue?kt:""}n&&le&&qe(n.firstChild);const s=c?t:n,u=Xe(s);try{for(;a=u.nextNode();)rn(a,s),un(a),tn(a.content)&&fn(a.content)}catch(e){throw c&&(He(t),p(r.removed,(t=>{t.element&&Ke(t.element)}))),e}if(c)return p(r.removed,(t=>{t.element&&Ke(t.element)})),ee&&Qe(t),t;if(ce){if(ee&&Qe(n),se)for(l=Rt.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(Ht.shadowroot||Ht.shadowrootmode)&&(l=jt.call(i,l,!0)),l}let f=re?n.outerHTML:n.innerHTML;return re&&Gt["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&R(rt,n.ownerDocument.doctype.name)&&(f="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+f),ee&&(f=Je(f)),xt&&ue?Ot(f):f},r.setConfig=function(){Ue(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),oe=!0,ie=Gt,ae=Ht},r.clearConfig=function(){Ce=null,oe=!1,ie=null,ae=null,xt=St,kt=""},r.isValidAttribute=function(t,e,n){Ce||Ue({});const r=Fe(t),o=Fe(e);return on(r,o,n)},r.addHook=function(t,e){"function"==typeof e&&z(Nt,t)&&h(Nt[t],e)},r.removeHook=function(t,e){if(z(Nt,t)){if(void 0!==e){const n=m(Nt[t],e);return-1===n?void 0:y(Nt[t],n,1)[0]}return d(Nt[t])}},r.removeHooks=function(t){z(Nt,t)&&(Nt[t]=[])},r.removeAllHooks=function(){Nt={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},r}();export{ft as p}