@golemui/gui-lit 1.1.0 → 1.1.1-rc.1

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 (60) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/{button.element-3a7rRHbA.js → button.element-CJay43iR.js} +16 -13
  3. package/{calendar-BuJgwvZx.js → calendar-D31xNsxx.js} +72 -59
  4. package/{calendar.element-M5MPJmap.js → calendar.element-BhFrCsns.js} +22 -20
  5. package/{checkbox.element-CVskoXEc.js → checkbox.element-DAAVB651.js} +49 -49
  6. package/{currency.element-CfFrAtrr.js → currency.element-D8A2ObpM.js} +11 -10
  7. package/{date-Bj9mI3GU.js → date-DBuYpvcO.js} +35 -27
  8. package/{date-input-cJDkNnVw.js → date-input-DLiMreSS.js} +64 -44
  9. package/date-picker.element-DeUQtbLg.js +357 -0
  10. package/{date-time-calendar-BzRfkLKU.js → date-time-calendar-DzU-FtVl.js} +89 -76
  11. package/{date-time-calendar.element-DC4NK0y1.js → date-time-calendar.element-BLBcVsFu.js} +13 -11
  12. package/{date-time-input-BXxsfuyZ.js → date-time-input-DZaz2heD.js} +75 -43
  13. package/{date-time-picker.element-Dy-8cb-_.js → date-time-picker.element-BUbLdV6i.js} +125 -65
  14. package/{date-time.element-Bv4XdzMi.js → date-time.element-B5onfSBG.js} +31 -25
  15. package/{date.element-Consgsbb.js → date.element-BsKhLrEc.js} +22 -19
  16. package/{day-status-0-hJHrI7.js → day-status-CsWStVQV.js} +153 -129
  17. package/{dropdown.element-WsD61Qel.js → dropdown.element-CXpMwJsU.js} +19 -13
  18. package/{errors-QjKhr6mA.js → errors-Byb2dIhK.js} +3 -2
  19. package/index.js +2933 -2336
  20. package/index.umd.cjs +798 -405
  21. package/{list-CrLIL4by.js → list-D730tmGN.js} +115 -116
  22. package/{list.element-DV82YxnJ.js → list.element-eo3DIOrp.js} +2 -2
  23. package/{markdown.element-p-kC47D7.js → markdown.element-FbtwdnAv.js} +310 -218
  24. package/{number.element-CBr47IiY.js → number.element-BEpOCzXy.js} +76 -61
  25. package/package.json +9 -6
  26. package/{part-templates-Db871PS3.js → part-templates-VORbpgs2.js} +132 -118
  27. package/{password.element-n-R9RbkB.js → password.element-CBaB8h5b.js} +19 -17
  28. package/{pill-ranges-DCqDmpkk.js → pill-ranges-DpvWwP-3.js} +12 -12
  29. package/{pills-Be1UrLgq.js → pills-BDMO2NiR.js} +80 -58
  30. package/popup.controller-B33OvX_y.js +86 -0
  31. package/{radiogroup.element-CeQn623u.js → radiogroup.element-KWzBx8mx.js} +55 -51
  32. package/{range-calendar-CKPYeSGt.js → range-calendar-DO_woqcF.js} +101 -87
  33. package/{range-calendar.element-D6KYq18B.js → range-calendar.element-DHLZhpnj.js} +15 -13
  34. package/{range-date-input-D--AqBMv.js → range-date-input-Br7XqQPK.js} +90 -71
  35. package/{range-date-input.element-D4nIXJbw.js → range-date-input.element-BdD4SlB4.js} +15 -12
  36. package/{range-date-picker.element-dhxPAAE6.js → range-date-picker.element-DWRHiAoC.js} +97 -49
  37. package/{range-date-time-calendar-yksWrR7b.js → range-date-time-calendar-B3EMgN1E.js} +150 -136
  38. package/{range-date-time-calendar.element-C00aDefZ.js → range-date-time-calendar.element-Coea6RF4.js} +9 -7
  39. package/{range-date-time-input-B37TUoM3.js → range-date-time-input-Cu-T_nuC.js} +125 -94
  40. package/{range-date-time-input.element-DUnbv4ed.js → range-date-time-input.element-Cti44iuW.js} +31 -25
  41. package/{range-date-time-picker.element-Cbps6s_G.js → range-date-time-picker.element-CDN2RL1y.js} +107 -47
  42. package/{range-time-input-3lhqR1Ku.js → range-time-input-BP9ZL9O8.js} +85 -66
  43. package/{range-time-input.element-dU2iBdmJ.js → range-time-input.element-B7wtHJoQ.js} +14 -11
  44. package/{range-time-picker.element-v6nQsIPw.js → range-time-picker.element-CPIAiQPC.js} +92 -51
  45. package/{repeater.element-CtNgB4F5.js → repeater.element-BM1Keckd.js} +1 -1
  46. package/{select.element-C0V-Bv3L.js → select.element-eepcXTpL.js} +84 -78
  47. package/{tabs.element-BvAyI71N.js → tabs.element-CvcIA8P3.js} +1 -0
  48. package/{tags.element-DvwEpxpK.js → tags.element-CPHgotb0.js} +21 -14
  49. package/templates-Dmr34nwp.js +88 -0
  50. package/{textarea.element-HThYqdR_.js → textarea.element-CiNEy9uq.js} +8 -7
  51. package/{textinput.element-CkXNzMUg.js → textinput.element-AL2Nr768.js} +10 -9
  52. package/{time-input-BOhlBGJZ.js → time-input-5dkSm8UW.js} +67 -47
  53. package/{time-list-Czo48bZm.js → time-list-DLcq8BAp.js} +1 -1
  54. package/{time-picker-bFJ63ky8.js → time-picker-g337F8d0.js} +89 -51
  55. package/{time-picker.element-CYZVXgRS.js → time-picker.element-DLihegjg.js} +23 -19
  56. package/{time.element-fK3oLi49.js → time.element-BneqgMlQ.js} +22 -19
  57. package/{toggle.element-C1kCw5H8.js → toggle.element-Cz91CRdp.js} +44 -43
  58. package/date-picker.element-va_-LGZD.js +0 -312
  59. package/popup.controller-eUDxE6jD.js +0 -71
  60. package/templates-Dk1jxLwS.js +0 -75
package/index.umd.cjs CHANGED
@@ -1,4 +1,6 @@
1
- (function(X,ot){typeof exports=="object"&&typeof module<"u"?ot(exports,require("@golemui/core"),require("@golemui/gui-shared"),require("@golemui/lit"),require("lit"),require("lit/decorators.js"),require("@lit/context"),require("rxjs"),require("lit/directives/class-map.js"),require("lit-html/directives/style-map.js"),require("lit-html/directives/repeat.js"),require("lit/directives/if-defined.js"),require("lit/directives/live.js"),require("lit/directives/repeat.js"),require("lit/directives/unsafe-html.js")):typeof define=="function"&&define.amd?define(["exports","@golemui/core","@golemui/gui-shared","@golemui/lit","lit","lit/decorators.js","@lit/context","rxjs","lit/directives/class-map.js","lit-html/directives/style-map.js","lit-html/directives/repeat.js","lit/directives/if-defined.js","lit/directives/live.js","lit/directives/repeat.js","lit/directives/unsafe-html.js"],ot):(X=typeof globalThis<"u"?globalThis:X||self,ot(X["gui-lit"]={},X.core,null,X.lit$1,X.lit,X.decorators_js,X.context,X.rxjs,X.classMap_js,X.styleMap_js,X.repeat_js,X.ifDefined_js,X.live_js,X.repeat_js$1,X.unsafeHtml_js))})(this,(function(X,ot,Mc,m,l,n,b,dr,w,bt,qe,aa,an,hr,rn){"use strict";const mr={LAYOUTS:"LAYOUTS",DISPLAYS:"DISPLAYS"};function sn(e){return function(t,i=()=>!0){return{kind:"leaf",selectorType:e,matcher:i,config:t}}}function J(e,t){return typeof e=="function"?e:{type:t,...e??{}}}const nn=(e,t)=>({type:"ITEMS",itemType:mr.DISPLAYS,items:[{render:e}],tags:t??[]}),ki=new Map;function cr(e,t){if(ki.has(e))throw new Error(`Item type "${e}" is already registered.`);ki.set(e,t)}function _i(e){const t=ki.get(e);if(!t)throw new Error(`No handler registered for item type "${e}". Did you forget to import the registration module?`);return t}function yr(e){return ki.has(e)}function C(e){const t=u=>{if(!e.sensibleDefaults)return{};let p={...e.sensibleDefaults.base};for(const d of u){const h=d.config;for(const c of e.sensibleDefaults.fields){const g=c;h[g]!=null&&(p={...p,[g]:h[g]})}}return p},i=(u,p)=>e.sensibleDefaults?e.sensibleDefaults.apply(u,p):u,a=u=>{switch(e.entryShape){case"bare":return{baseDef:u};case"keyed":{const p=u;return{baseDef:p.def,path:p.key}}case"compound":{const p=u;return{baseDef:p.def,children:p.children}}}},r={rollUpSensibleDefaults:t,applySensibleDefaults:i,mapToWidget:e.mapToWidget,parseEntry:a,...e.afterMerge?{afterMerge:e.afterMerge}:{},...e.buildCustomWidget?{buildCustomWidget:e.buildCustomWidget}:{},...e.getChildren?{getChildren:e.getChildren}:{}};cr(e.itemType,r);const s=sn(e.itemType);return{gsl:s,gslByUid:(u,p)=>s(p,(d=>d.uid===u))}}function z(e){const{uid:t,path:i,label:a,disabled:r,readonly:s,defaultValue:o,tags:u,type:p,size:d,onLoad:h,onChange:c,onFilter:g,on:f,states:S,include:Ee,exclude:Be,validator:at,...gt}=e;return gt}function on(e){return e?e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()):""}function U(e,t){return e.label!=null||t.suppressAutomaticLabels||!e.path?e:{...e,label:on(e.path)}}function Je(e,t){return e.placeholder!=null||t.suppressAutomaticPlaceholders||!e.path?e:{...e,placeholder:e.path}}function ln(e){switch(e.type){case"text":return pn(e);case"number":return dn(e);case"boolean":return un(e);default:throw new Error(`Unsupported field type "${e.type}"`)}}function un(e){const t=z(e);return{uid:e.uid??"",kind:"input",type:"toggle",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"boolean")}:{},props:t}}function pn(e){const t=z(e);return{uid:e.uid??"",kind:"input",type:"textinput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},props:{placeholder:t.placeholder??"",...t},validator:J(e.validator,"string")}}function dn(e){const t=z(e);return{uid:e.uid??"",kind:"input",type:"number",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},props:{placeholder:t.placeholder??"",...t},validator:J(e.validator,"number")}}C({itemType:"INPUTS",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>{let i=U(e,t);return i=Je(i,t),i}},mapToWidget:ln}),C({itemType:"SELECT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Je(U(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"select",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:z(e)})}),C({itemType:"DROPDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Je(U(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dropdown",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:z(e)})}),C({itemType:"RADIOGROUP",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>U(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"radiogroup",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:z(e)})}),C({itemType:"CHECKBOX",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>U(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"checkbox",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"boolean")}:{},props:z(e)})}),C({itemType:"TEXTAREA",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Je(U(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"textarea",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"string")}:{},props:z(e)})}),C({itemType:"PASSWORD",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Je(U(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"password",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"string")}:{},props:z(e)})}),C({itemType:"CURRENCY",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Je(U(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"currency",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"number")}:{},props:z(e)})}),C({itemType:"MARKDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Je(U(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"markdown",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"string")}:{},props:z(e)})}),C({itemType:"LIST",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>U(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"list",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:z(e)})}),C({itemType:"CALENDAR",entryShape:"bare",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>U(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"calendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"string")}:{},props:z(e)})}),C({itemType:"DATE_TIME_CALENDAR",entryShape:"bare",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>U(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateTimeCalendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"string")}:{},props:z(e)})}),C({itemType:"DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>U(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"string")}:{},props:z(e)})}),C({itemType:"DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Je(U(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"datePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"string")}:{},props:z(e)})}),C({itemType:"DATE_TIME_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Je(U(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateTimePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"string")}:{},props:z(e)})}),C({itemType:"RANGE_CALENDAR",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>U(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeCalendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"array")}:{},props:z(e)})}),C({itemType:"RANGE_DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>U(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"array")}:{},props:z(e)})}),C({itemType:"RANGE_DATE_TIME_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>U(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateTimeInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"array")}:{},props:z(e)})}),C({itemType:"RANGE_DATE_TIME_CALENDAR",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>U(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateTimeCalendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"array")}:{},props:z(e)})}),C({itemType:"RANGE_DATE_TIME_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>U(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateTimePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"array")}:{},props:z(e)})}),C({itemType:"RANGE_TIME_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>U(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeTimeInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"array")}:{},props:z(e)})}),C({itemType:"TIME_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>U(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"timeInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"string")}:{},props:z(e)})}),C({itemType:"TIME_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Je(U(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"timePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"string")}:{},props:z(e)})}),C({itemType:"DATE_TIME_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>U(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateTimeInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"string")}:{},props:z(e)})}),C({itemType:"RANGE_DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Je(U(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDatePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"array")}:{},props:z(e)})}),C({itemType:"RANGE_TIME_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>U(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeTimePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"array")}:{},props:z(e)})});function hn(e){const t={};return e.addLabel!=null&&(t.addLabel=e.addLabel),e.removeLabel!=null&&(t.removeLabel=e.removeLabel),e.limit!=null&&(t.limit=e.limit),e.title!=null&&(t.title=e.title),e.addButtonIcon!=null&&(t.addButtonIcon=e.addButtonIcon),e.removeButtonIcon!=null&&(t.removeButtonIcon=e.removeButtonIcon),t}function mn(e){return{uid:e.uid??"",kind:"input",type:"repeater",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"array")}:{},props:{...hn(e),template:{kind:"layout",type:"flex",children:[],props:{direction:"column"}}}}}function ra(e,t){for(const i of e){if(typeof i=="function")continue;const a=i;typeof a.path=="string"&&a.path&&!a.path.startsWith(t)&&(a.path=t+a.path),"children"in a&&Array.isArray(a.children)&&ra(a.children,t);const r=a.props;r?.template?.children&&Array.isArray(r.template.children)&&ra(r.template.children,t)}}function cn(e,t){const i=t.walkChildren(t.children??[]),a=e.kind==="static"?e.def.path??"":e.fn({})?.path??"";a&&ra(i,a+".items.");const r={kind:"layout",type:"flex",uid:"",children:i,props:{direction:"column"}};if(e.kind==="static"){const o=t.mapStaticDef(e.def,"REPEATER");return{...o,props:{...o.props,template:r}}}const s=e.fn;return(o=>{const u=s(o),p=t.mapStaticDef(u,"REPEATER");return{...p,props:{...p.props,template:r}}})}function yn(e){return{baseDef:e.def,path:e.key,children:e.children}}function gn(e){return e.children}cr("REPEATER",{parseEntry:yn,rollUpSensibleDefaults:()=>({}),applySensibleDefaults:e=>e,mapToWidget:mn,buildCustomWidget:cn,getChildren:gn});const gr={onLoad:"load",onChange:"change",onFilter:"filter",onBlur:"blur"},bn=Object.keys(gr);function br(e){if(e.length>0)return null;try{const t=e();return typeof t=="string"?t:null}catch{return null}}class fn{extractOnClickFromMergeResult(t,i,a){if(t.kind==="dynamic"){const o=t.fn;return{kind:"dynamic",fn:p=>{const d=o(p);return this.wireOnClick(d,i,a)}}}const r=t.def;return{kind:"static",def:this.wireOnClick(r,i,a)}}wireOnClick(t,i,a){const r=a.next(),s=t.onClick;if(typeof s=="function"){const{onClick:o,...u}=t,p=s(void 0);return typeof p=="string"?{...u,uid:r,on:{click:p}}:(i.set(r,d=>s(d.data)),{...u,uid:r,on:{click:r}})}return{...t,uid:r}}wireInputLayoutEvents(t,i,a){if(t.kind==="dynamic"){const s=t.fn;return{kind:"dynamic",fn:u=>{const p=s(u);return this.wireEventProperties(p,i,a)}}}return{kind:"static",def:this.wireEventProperties(t.def,i,a)}}wireEventProperties(t,i,a){const r={...t.on||{}};let s=!1;const o={...t};for(const u of bn){const p=t[u];if(p==null)continue;const d=gr[u];if(typeof p=="function"){const h=br(p);if(h!=null)r[d]=h;else{const c=a.next();i.set(c,p),r[d]=c}s=!0}else typeof p=="string"&&(r[d]=p,s=!0);delete o[u]}return s&&(o.on=r),o}}const sa=new fn;function vn(e){const{uid:t,label:i,actionType:a,disabled:r,on:s,onClick:o,data:u,type:p,tags:d,size:h,include:c,exclude:g,states:f,...S}=e;return{uid:t??"",kind:"action",type:"button",disabled:r,actionType:a,label:i,...s!=null?{on:s}:{},props:S}}C({itemType:"ACTIONS",entryShape:"bare",mapToWidget:vn,afterMerge:(e,t)=>sa.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)});function Dn(e){const{uid:t,widgetName:i,tags:a,size:r,onChange:s,include:o,exclude:u,...p}=e,{on:d,...h}=p;return{uid:t??"",kind:"layout",type:i??"flex",props:{direction:h.direction??"column",...h},children:[]}}function wn(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"LAYOUTS"),children:i};const a=e.fn;return(r=>{const s=a(r);return{...t.mapStaticDef(s,"LAYOUTS"),children:i}})}function $n(e){return e.children}C({itemType:"LAYOUTS",entryShape:"compound",mapToWidget:Dn,buildCustomWidget:wn,getChildren:$n});function na(e){return{errors:void 0,touched:void 0,translate:void 0,...e??{},$form:e?.$form??{}}}function kn(e){return{uid:"",kind:"display",type:"renderer",props:{render:e.render}}}function _n(e,t){if(e.kind==="static"){const a=e.def;return(r=>({uid:"",kind:"display",type:"renderer",...a.include!=null?{include:a.include}:{},...a.exclude!=null?{exclude:a.exclude}:{},props:{render:a.render(na(r))}}))}const i=e.fn;return(a=>{const r=i(a);return{uid:"",kind:"display",type:"renderer",...r.include!=null?{include:r.include}:{},...r.exclude!=null?{exclude:r.exclude}:{},props:{render:r.render(na(a))}}})}C({itemType:"DISPLAYS",entryShape:"bare",mapToWidget:kn,buildCustomWidget:_n}),C({itemType:"ALERTS",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"alert",props:{text:e.text,...e.level!=null?{level:e.level}:{}}})}),C({itemType:"MARKDOWN_TEXTS",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"markdownText",props:{md:e.md}})});function Tn(e){return{uid:e.uid??"",kind:"layout",type:"tabs",props:{tabs:e.tabs,renderMode:e.renderMode??"all",...e.defaultOpen!=null?{defaultOpen:e.defaultOpen}:{}},children:[]}}function Sn(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"TABS"),children:i};const a=e.fn;return(r=>{const s=a(r);return{...t.mapStaticDef(s,"TABS"),children:i}})}function Cn(e){return e.children}C({itemType:"TABS",entryShape:"compound",mapToWidget:Tn,buildCustomWidget:Sn,getChildren:Cn});function xn(e){return{uid:e.uid??"",kind:"layout",type:"accordion",props:{sections:e.sections,renderMode:e.renderMode??"all",...e.singleOpen!=null?{singleOpen:e.singleOpen}:{},...e.defaultOpen!=null?{defaultOpen:e.defaultOpen}:{}},children:[]}}function En(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"ACCORDION"),children:i};const a=e.fn;return(r=>{const s=a(r);return{...t.mapStaticDef(s,"ACCORDION"),children:i}})}function Mn(e){return e.children}C({itemType:"ACCORDION",entryShape:"compound",mapToWidget:xn,buildCustomWidget:En,getChildren:Mn}),C({itemType:"CUSTOM_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>U(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:e.customType,path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.defaultValue!=null?{defaultValue:e.defaultValue}:{},...e.validator!=null?{validator:e.validator}:{},props:e.props??{}})}),C({itemType:"CUSTOM_ACTION",entryShape:"bare",mapToWidget:e=>{const{uid:t,label:i,disabled:a,on:r,onClick:s,data:o,customType:u,tags:p,size:d,include:h,exclude:c,states:g,props:f,...S}=e;return{uid:t??"",kind:"action",type:e.customType,label:i,disabled:a,...r!=null?{on:r}:{},props:{...f,...S}}},afterMerge:(e,t)=>sa.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)}),C({itemType:"CUSTOM_DISPLAY",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:e.customType,props:e.props??{}})});function Pn(e){return{uid:e.uid??"",kind:"layout",type:e.customType,props:e.props??{},children:[]}}function In(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"CUSTOM_LAYOUT"),children:i};const a=e.fn;return(r=>{const s=a(r);return{...t.mapStaticDef(s,"CUSTOM_LAYOUT"),children:i}})}function On(e){return e.children}C({itemType:"CUSTOM_LAYOUT",entryShape:"compound",mapToWidget:Pn,buildCustomWidget:In,getChildren:On}),C({itemType:"TAGS",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Je(U(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"tags",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:J(e.validator,"array")}:{},props:z(e)})});const fr={INPUTS:new Set(["INPUTS","TEXTAREA","PASSWORD","SELECT","DROPDOWN","RADIOGROUP","CHECKBOX","CALENDAR","DATE_TIME_CALENDAR","DATE_TIME_PICKER","DATE_INPUT","DATE_PICKER","RANGE_CALENDAR","RANGE_DATE_INPUT","RANGE_DATE_TIME_INPUT","RANGE_DATE_TIME_CALENDAR","RANGE_DATE_TIME_PICKER","RANGE_TIME_INPUT","RANGE_DATE_PICKER","RANGE_TIME_PICKER","TIME_INPUT","TIME_PICKER","DATE_TIME_INPUT","CURRENCY","MARKDOWN","LIST","CUSTOM_INPUT","REPEATER","TAGS"]),ACTIONS:new Set(["ACTIONS","CUSTOM_ACTION"]),DISPLAYS:new Set(["DISPLAYS","ALERTS","MARKDOWN_TEXTS","CUSTOM_DISPLAY"]),LAYOUTS:new Set(["LAYOUTS","TABS","ACCORDION","CUSTOM_LAYOUT"])};function An(e,t){const i=fr[e];return i?i.has(t):e===t}class Ln{resolve(t,i){const a=[];for(const s of i)s.kind==="aggregated"?this.collectFromAggregated(s,t,a):this.collectFromLeaf(s,t,a);const r=this.rollUpSensibleDefaults(a);return{leafSelectors:a,sensibleDefaults:r}}collectFromAggregated(t,i,a){if(t.matcher(i))for(const r of t.children)this.collectFromLeaf(r,i,a)}collectFromLeaf(t,i,a){An(t.selectorType,i.itemType??"")&&t.matcher(i)&&a.push(t)}rollUpSensibleDefaults(t){const i=new Map,a=(s,o)=>{const u=i.get(s)??[];u.push(o),i.set(s,u)};for(const s of t){const o=fr[s.selectorType];if(o)for(const u of o)a(u,s);else a(s.selectorType,s)}const r={};for(const[s,o]of i)yr(s)&&(r[s]=_i(s).rollUpSensibleDefaults(o));return r}}const Rn=new Ln;class Fn{deepMerge(t,i){if(i==null)return t;if(t==null||typeof t!="object"||typeof i!="object"||Array.isArray(t)||Array.isArray(i))return i;const a={...t};for(const r in i)Object.prototype.hasOwnProperty.call(i,r)&&(typeof i[r]=="object"&&!Array.isArray(i[r])&&i[r]!==null&&typeof t[r]=="object"&&!Array.isArray(t[r])&&t[r]!==null?a[r]=this.deepMerge(t[r],i[r]):a[r]=i[r]);return a}}const Bn=new Fn;class qn{constructor(t){this.objectUtils=t}merge(t,i,a){let r={},s=null;typeof t=="function"&&(s=t);const o=this.collectDecorators(a);for(const d of o){if(s!=null){s=this.composeRuntimeFunctions(s,d);continue}if(typeof d=="function"){const h=d({...r,...typeof t=="function"?{}:t});if(typeof h=="function"){s=this.createPromotedFunction(r,t,h,i,a);continue}r=this.objectUtils.deepMerge(r,h)}else r=this.objectUtils.deepMerge(r,d)}if(s!=null)return{kind:"dynamic",fn:this.wrapWithSensibleDefaults(s,r,i,a)};const u=this.objectUtils.deepMerge(t,r);return{kind:"static",def:this.applySensibleDefaults({...u},i,a)}}collectDecorators(t){const i=[];for(const a of t.leafSelectors){const r=a.config;r.override!=null&&i.push(r.override)}return i}applySensibleDefaults(t,i,a){if(!yr(i))return t;const r=a.sensibleDefaults[i]??{};return _i(i).applySensibleDefaults(t,r)}createPromotedFunction(t,i,a,r,s){return o=>{const u=a(o);let p=this.objectUtils.deepMerge(t,u);return p=this.objectUtils.deepMerge(p,i),this.applySensibleDefaults(p,r,s)}}wrapWithSensibleDefaults(t,i,a,r){return s=>{let o=t(s);return Object.keys(i).length>0&&(o=this.objectUtils.deepMerge(i,o)),this.applySensibleDefaults(o,a,r)}}composeRuntimeFunctions(t,i){return typeof i=="function"?a=>{const r=t(a),s=i(r);return typeof s=="function"?s(a):this.objectUtils.deepMerge(s,r)}:a=>{const r=t(a);return this.objectUtils.deepMerge(r,i)}}}const Nn=new qn(Bn);class zn{mapToWidget(t,i){if(t.kind==="dynamic"){const a=t.fn;return(r=>{const s=a(r);return this.mapStaticDef(s,i)})}return this.mapStaticDef(t.def,i)}mapStaticDef(t,i){const a=_i(i).mapToWidget(t);return this.applyBaseWidgetFields(a,t)}applyBaseWidgetFields(t,i){return i.size!=null&&(t.size=i.size),i.defaultValue!=null&&t.kind==="input"&&(t.defaultValue=i.defaultValue),i.on!=null&&(t.on=i.on),i.include!=null&&(t.include=i.include),i.exclude!=null&&(t.exclude=i.exclude),t}}const Vn=new zn;class Gn{normalizeSelectors(t){const i=Array.isArray(t)?t:[t],a=[],r=[];for(const s of i)s.kind==="leaf"?r.push(s):a.push(s);return r.length>0&&a.unshift({kind:"aggregated",matcher:()=>!0,children:r}),a}extractFormConfig(){return{suppressAutomaticStack:!1}}}const Un=new Gn,Zn={input:new Set(["disabled","readonly","label","validator","size"]),action:new Set(["disabled","label","size"]),layout:new Set(["size"]),display:new Set([])},vr={onChange:"change",onLoad:"load",onFilter:"filter",onClick:"click"};class Hn{extractFromMergeResult(t,i){const a={};for(const u of i){const p=u.targetState,d=u.config,h=d.override&&typeof d.override!="function"?d.override:d;a[p]={...a[p]||{},...h}}if(t.kind==="dynamic"){const u=t.fn;return{cleanedResult:{kind:"dynamic",fn:d=>{const h=u(d),{states:c,...g}=h;return g}},stateData:{stateOverrides:a}}}const{states:r,...s}=t.def,o={};for(const[u,p]of Object.entries(a))o[u]={...p};if(r)for(const[u,p]of Object.entries(r))o[u]={...o[u]||{},...p};return{cleanedResult:{kind:"static",def:s},stateData:{stateOverrides:o}}}applyToWidget(t,i,a,r){const{stateOverrides:s}=i;if(Object.keys(s).length===0)return t;const o={...t},u=t.kind,p=Zn[u]||new Set;t.props&&(o.props={...t.props}),t.on&&(o.on={...t.on});for(const[d,h]of Object.entries(s))for(const[c,g]of Object.entries(h))c==="visible"?this.applyVisibility(o,d,g):vr[c]?this.applyStateEvent(o,d,c,g,a,r):p.has(c)?o[`${c}.${d}`]=g:(o.props||(o.props={}),o.props[`${c}.${d}`]=g);return o}hasStateData(t){return Object.keys(t.stateOverrides).length>0}applyVisibility(t,i,a){if(a){const r=t.include?.in||[];t.include={...t.include||{},in:[...r,i]}}else{const r=t.exclude?.from||[];t.exclude={...t.exclude||{},from:[...r,i]}}}applyStateEvent(t,i,a,r,s,o){const u=vr[a];if(t.on||(t.on={}),typeof r=="function"){const p=br(r);if(p!=null)t.on[`${u}.${i}`]=p;else{const d=o.next();s.set(d,r),t.on[`${u}.${i}`]=d}}else typeof r=="string"&&(t.on[`${u}.${i}`]=r)}}const Wn=new Hn;function Yn(){let e=0;return{next:()=>`event_${e++}`}}class Kn{constructor(t,i,a,r,s){this.resolver=t,this.merger=i,this.mapper=a,this.eventWiring=r,this.stateExpansion=s}walkAndMap(t,i,a){const r=new Map,s=Yn(),o={value:0},u=new Set;return{widgets:this.walkItems(t,i,r,a,s,o,u),eventRegistry:r}}walkItems(t,i,a,r,s,o,u){return t.flatMap(p=>{if(p.type!=="ITEMS")throw new Error("Unexpected gui shortcut type");return p.items.map(d=>this.processItem(d,p.itemType,p.tags,i,a,r,s,o,u))})}processItem(t,i,a,r,s,o,u,p,d){const h=i,c=_i(i),g=c.parseEntry(t),f=this.buildBaseDef(g),S=this.buildDecoratorForMatching(f,h,a),Ee=this.resolver.resolve(S,r),Be=Ee.leafSelectors.filter(ze=>ze.targetState!=null),at={leafSelectors:Ee.leafSelectors.filter(ze=>ze.targetState==null),sensibleDefaults:Ee.sensibleDefaults};let gt=this.merger.merge(f,h,at);c.afterMerge&&(gt=c.afterMerge(gt,{eventRegistry:s,formConfig:o,eventIdGenerator:u})),gt=this.eventWiring.wireInputLayoutEvents(gt,s,u);const{cleanedResult:tn,stateData:pr}=this.stateExpansion.extractFromMergeResult(gt,Be);let ut;if(c.buildCustomWidget){const ze=this.buildCustomWidgetContext(g.children,r,s,o,u,p,d);ut=this.buildCustomWidget(c,tn,ze)}else ut=this.mapper.mapToWidget(tn,h);if(typeof ut!="function"){const ze=ut;ze.uid||(ze.path&&!d.has(ze.path)?(ze.uid=ze.path,d.add(ze.path)):ze.uid=`dx_${p.value++}`)}if(this.stateExpansion.hasStateData(pr))if(typeof ut=="function"){const ze=ut;ut=(xc=>{const Ec=ze(xc);return this.stateExpansion.applyToWidget(Ec,pr,s,u)})}else ut=this.stateExpansion.applyToWidget(ut,pr,s,u);return ut}buildCustomWidgetContext(t,i,a,r,s,o,u){return{children:t,mapStaticDef:(p,d)=>this.mapper.mapStaticDef(p,d),walkChildren:p=>this.walkItems(p,i,a,r,s,o,u)}}buildCustomWidget(t,i,a){return t.buildCustomWidget(i,a)}buildBaseDef(t){const i=t.baseDef;return typeof i=="function"?a=>{const r=na(a),s=i(r);return t.path!=null?{...s,path:t.path}:s}:t.path!=null?{...i,path:t.path}:i}buildDecoratorForMatching(t,i,a){if(typeof t=="function")return{itemType:i,tags:[...a]};const r=[...a,..."tags"in t&&t.tags?t.tags:[]],s="uid"in t?t.uid:void 0,o="type"in t?t.type:void 0;return{itemType:i,tags:r,uid:s,type:o}}}class Xn{constructor(t,i){this.selectorNormalizer=t,this.walker=i}processDxFacade(t,i=[],a){const{defs:r,gslSelectors:s,formConfig:o}=this.prepareForm(t,i,a),{widgets:u,eventRegistry:p}=this.walker.walkAndMap(r,s,o),d=u[0];return this.buildResult({form:d},p,o)}prepareForm(t,i,a){const s=(Array.isArray(t)?[...t]:[t]).map(p=>typeof p=="function"?nn(p):p),o=this.selectorNormalizer.normalizeSelectors(i),u={...this.selectorNormalizer.extractFormConfig(),...a};if(!u.suppressAutomaticStack){const p={def:{uid:"#root",direction:"column",widgetName:"flex"},children:s};return{defs:[{type:"ITEMS",itemType:mr.LAYOUTS,items:[p],tags:[]}],gslSelectors:o,formConfig:u}}return{defs:s,gslSelectors:o,formConfig:u}}convertStateNames(t){const i={};for(const[a,r]of Object.entries(t))i[a.replace(/\$/g,":")]=r;return i}buildResult(t,i,a){a.states&&Object.keys(a.states).length>0&&(t={...t,states:this.convertStateNames(a.states)});const r={form:t};return i.size>0&&(r.events=s=>{const o=i.get(s.name);if(o){const u=d=>{if(d&&typeof d=="object"&&"path"in d&&!("type"in d)){const{path:h,...c}=d;for(const[g,f]of Object.entries(c))s.callback({type:"OVERRIDE_WIDGET_PROP",payload:{path:h,prop:g,value:f}})}else s.callback(d)},p={...s,callback:u,update:u};o(p)}}),a.dependencies&&(r.dependencies=a.dependencies),a.functions&&(r.functions=a.functions),a.widgetLoaders&&(r.widgetLoaders=a.widgetLoaders),a.validateOn&&(r.validateOn=a.validateOn),a.itemRenderers&&(r.itemRenderers=a.itemRenderers),r}}const Jn=new Kn(Rn,Nn,Vn,sa,Wn),Qn=new Xn(Un,Jn);function Dr(e){return typeof e=="function"?!0:Array.isArray(e)?e.length===0||e.every(wr):wr(e)}function wr(e){if(typeof e=="function")return!0;if(e===null||typeof e!="object")return!1;const t=e;return t.type==="ITEMS"&&typeof t.itemType=="string"}function jn(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e.form;if(Dr(t))throw new Error("[GolemUI] The gui.* form definition was wrapped in an extra `{ form: ... }` object, so its fields were never resolved. Pass the gui.* array DIRECTLY as formDef (`config={{ formDef: form }}`) and put any named `states` in `formConfig`: `config={{ formDef: form, formConfig: { states } }}`. Do NOT wrap them as a `{ form: [...] }` object.")}const $r=Object.freeze({}),eo=Object.freeze({}),kr=new WeakMap;function oa(e,t){return e==null?t:typeof e=="object"?e:{}}function to(e,t,i){if(!Dr(e))return jn(e),{formDef:e};const a=oa(e,$r),r=oa(t,$r),s=oa(i,eo);let o=kr.get(a);o||(o=new WeakMap,kr.set(a,o));let u=o.get(r);u||(u=new WeakMap,o.set(r,u));const p=u.get(s);if(p)return p;const d=Qn.processDxFacade(e,t,i),h={formDef:d.form,formEvent:d.events,dependencies:d.dependencies,functions:d.functions,widgetLoaders:d.widgetLoaders,validateOn:d.validateOn,itemRenderers:d.itemRenderers};return u.set(s,h),h}function y(e,t,i){function a(u,p){if(u._zod||Object.defineProperty(u,"_zod",{value:{def:p,constr:o,traits:new Set},enumerable:!1}),u._zod.traits.has(e))return;u._zod.traits.add(e),t(u,p);const d=o.prototype,h=Object.keys(d);for(let c=0;c<h.length;c++){const g=h[c];g in u||(u[g]=d[g].bind(u))}}const r=i?.Parent??Object;class s extends r{}Object.defineProperty(s,"name",{value:e});function o(u){var p;const d=i?.Parent?new s:this;a(d,u),(p=d._zod).deferred??(p.deferred=[]);for(const h of d._zod.deferred)h();return d}return Object.defineProperty(o,"init",{value:a}),Object.defineProperty(o,Symbol.hasInstance,{value:u=>i?.Parent&&u instanceof i.Parent?!0:u?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class _t extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class _r extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const io={};function ft(e){return io}function la(e,t){return typeof t=="bigint"?t.toString():t}function ua(e){return e==null}function pa(e){const t=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(t,i)}const Tr=Symbol("evaluating");function ie(e,t,i){let a;Object.defineProperty(e,t,{get(){if(a!==Tr)return a===void 0&&(a=Tr,a=i()),a},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function ao(...e){const t={};for(const i of e){const a=Object.getOwnPropertyDescriptors(i);Object.assign(t,a)}return Object.defineProperties({},t)}function ro(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Sr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Cr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function da(e){if(Cr(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const i=t.prototype;return!(Cr(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function xr(e){return da(e)?{...e}:Array.isArray(e)?[...e]:e}function ha(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Er(e,t,i){const a=new e._zod.constr(t??e._zod.def);return(!t||i?.parent)&&(a._zod.parent=e),a}function L(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}const so={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Tt(e,t=0){if(e.aborted===!0)return!0;for(let i=t;i<e.issues.length;i++)if(e.issues[i]?.continue!==!0)return!0;return!1}function no(e,t){return t.map(i=>{var a;return(a=i).path??(a.path=[]),i.path.unshift(e),i})}function Ti(e){return typeof e=="string"?e:e?.message}function vt(e,t,i){const a={...e,path:e.path??[]};if(!e.message){const r=Ti(e.inst?._zod.def?.error?.(e))??Ti(t?.error?.(e))??Ti(i.customError?.(e))??Ti(i.localeError?.(e))??"Invalid input";a.message=r}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function ma(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ot(...e){const[t,i,a]=e;return typeof t=="string"?{message:t,code:"custom",input:i,inst:a}:{...t}}const Mr=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,la,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Pr=y("$ZodError",Mr),Si=y("$ZodError",Mr,{Parent:Error});function oo(e,t=i=>i.message){const i={},a=[];for(const r of e.issues)r.path.length>0?(i[r.path[0]]=i[r.path[0]]||[],i[r.path[0]].push(t(r))):a.push(t(r));return{formErrors:a,fieldErrors:i}}function lo(e,t=i=>i.message){const i={_errors:[]},a=r=>{for(const s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(o=>a({issues:o}));else if(s.code==="invalid_key")a({issues:s.issues});else if(s.code==="invalid_element")a({issues:s.issues});else if(s.path.length===0)i._errors.push(t(s));else{let o=i,u=0;for(;u<s.path.length;){const p=s.path[u];u===s.path.length-1?(o[p]=o[p]||{_errors:[]},o[p]._errors.push(t(s))):o[p]=o[p]||{_errors:[]},o=o[p],u++}}};return a(e),i}const Ci=e=>(t,i,a,r)=>{const s=a?Object.assign(a,{async:!1}):{async:!1},o=t._zod.run({value:i,issues:[]},s);if(o instanceof Promise)throw new _t;if(o.issues.length){const u=new(r?.Err??e)(o.issues.map(p=>vt(p,s,ft())));throw Sr(u,r?.callee),u}return o.value},uo=Ci(Si),xi=e=>async(t,i,a,r)=>{const s=a?Object.assign(a,{async:!0}):{async:!0};let o=t._zod.run({value:i,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){const u=new(r?.Err??e)(o.issues.map(p=>vt(p,s,ft())));throw Sr(u,r?.callee),u}return o.value},po=xi(Si),Ei=e=>(t,i,a)=>{const r=a?{...a,async:!1}:{async:!1},s=t._zod.run({value:i,issues:[]},r);if(s instanceof Promise)throw new _t;return s.issues.length?{success:!1,error:new(e??Pr)(s.issues.map(o=>vt(o,r,ft())))}:{success:!0,data:s.value}},Ir=Ei(Si),Mi=e=>async(t,i,a)=>{const r=a?Object.assign(a,{async:!0}):{async:!0};let s=t._zod.run({value:i,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(o=>vt(o,r,ft())))}:{success:!0,data:s.value}},Or=Mi(Si),ho=e=>(t,i,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Ci(e)(t,i,r)},mo=e=>(t,i,a)=>Ci(e)(t,i,a),co=e=>async(t,i,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return xi(e)(t,i,r)},yo=e=>async(t,i,a)=>xi(e)(t,i,a),go=e=>(t,i,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Ei(e)(t,i,r)},bo=e=>(t,i,a)=>Ei(e)(t,i,a),fo=e=>async(t,i,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Mi(e)(t,i,r)},vo=e=>async(t,i,a)=>Mi(e)(t,i,a),Do=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ar=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,wo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,$o=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ko=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,_o=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Lr="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",To=new RegExp(`^${Lr}$`);function Rr(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function So(e){return new RegExp(`^${Rr(e)}$`)}function Co(e){const t=Rr({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${i.join("|")})`;return new RegExp(`^${Lr}T(?:${a})$`)}const xo=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Eo=/^-?\d+$/,Mo=/^-?\d+(?:\.\d+)?/,Po=/^(?:true|false)$/i,Io=/^[^A-Z]*$/,Oo=/^[^a-z]*$/,Ye=y("$ZodCheck",(e,t)=>{var i;e._zod??(e._zod={}),e._zod.def=t,(i=e._zod).onattach??(i.onattach=[])}),Fr={number:"number",bigint:"bigint",object:"date"},Ao=y("$ZodCheckLessThan",(e,t)=>{Ye.init(e,t);const i=Fr[typeof t.value];e._zod.onattach.push(a=>{const r=a._zod.bag,s=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:i,code:"too_big",maximum:t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Lo=y("$ZodCheckGreaterThan",(e,t)=>{Ye.init(e,t);const i=Fr[typeof t.value];e._zod.onattach.push(a=>{const r=a._zod.bag,s=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:i,code:"too_small",minimum:t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ro=y("$ZodCheckNumberFormat",(e,t)=>{Ye.init(e,t),t.format=t.format||"float64";const i=t.format?.includes("int"),a=i?"int":"number",[r,s]=so[t.format];e._zod.onattach.push(o=>{const u=o._zod.bag;u.format=t.format,u.minimum=r,u.maximum=s,i&&(u.pattern=Eo)}),e._zod.check=o=>{const u=o.value;if(i){if(!Number.isInteger(u)){o.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?o.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,continue:!t.abort}):o.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,continue:!t.abort});return}}u<r&&o.issues.push({origin:"number",input:u,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),u>s&&o.issues.push({origin:"number",input:u,code:"too_big",maximum:s,inst:e})}}),Fo=y("$ZodCheckMaxLength",(e,t)=>{var i;Ye.init(e,t),(i=e._zod.def).when??(i.when=a=>{const r=a.value;return!ua(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const r=a.value;if(r.length<=t.maximum)return;const o=ma(r);a.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Bo=y("$ZodCheckMinLength",(e,t)=>{var i;Ye.init(e,t),(i=e._zod.def).when??(i.when=a=>{const r=a.value;return!ua(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const r=a.value;if(r.length>=t.minimum)return;const o=ma(r);a.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),qo=y("$ZodCheckLengthEquals",(e,t)=>{var i;Ye.init(e,t),(i=e._zod.def).when??(i.when=a=>{const r=a.value;return!ua(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=a=>{const r=a.value,s=r.length;if(s===t.length)return;const o=ma(r),u=s>t.length;a.issues.push({origin:o,...u?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),Pi=y("$ZodCheckStringFormat",(e,t)=>{var i,a;Ye.init(e,t),e._zod.onattach.push(r=>{const s=r._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(i=e._zod).check??(i.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),No=y("$ZodCheckRegex",(e,t)=>{Pi.init(e,t),e._zod.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),zo=y("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Io),Pi.init(e,t)}),Vo=y("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Oo),Pi.init(e,t)}),Go=y("$ZodCheckIncludes",(e,t)=>{Ye.init(e,t);const i=ha(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${i}`:i);t.pattern=a,e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(a)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),Uo=y("$ZodCheckStartsWith",(e,t)=>{Ye.init(e,t);const i=new RegExp(`^${ha(t.prefix)}.*`);t.pattern??(t.pattern=i),e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(i)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),Zo=y("$ZodCheckEndsWith",(e,t)=>{Ye.init(e,t);const i=new RegExp(`.*${ha(t.suffix)}$`);t.pattern??(t.pattern=i),e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(i)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),Ho=y("$ZodCheckOverwrite",(e,t)=>{Ye.init(e,t),e._zod.check=i=>{i.value=t.tx(i.value)}}),Wo={major:4,minor:1,patch:13},fe=y("$ZodType",(e,t)=>{var i;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Wo;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const r of a)for(const s of r._zod.onattach)s(e);if(a.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const r=(o,u,p)=>{let d=Tt(o),h;for(const c of u){if(c._zod.def.when){if(!c._zod.def.when(o))continue}else if(d)continue;const g=o.issues.length,f=c._zod.check(o);if(f instanceof Promise&&p?.async===!1)throw new _t;if(h||f instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await f,o.issues.length!==g&&(d||(d=Tt(o,g)))});else{if(o.issues.length===g)continue;d||(d=Tt(o,g))}}return h?h.then(()=>o):o},s=(o,u,p)=>{if(Tt(o))return o.aborted=!0,o;const d=r(u,a,p);if(d instanceof Promise){if(p.async===!1)throw new _t;return d.then(h=>e._zod.parse(h,p))}return e._zod.parse(d,p)};e._zod.run=(o,u)=>{if(u.skipChecks)return e._zod.parse(o,u);if(u.direction==="backward"){const d=e._zod.parse({value:o.value,issues:[]},{...u,skipChecks:!0});return d instanceof Promise?d.then(h=>s(h,o,u)):s(d,o,u)}const p=e._zod.parse(o,u);if(p instanceof Promise){if(u.async===!1)throw new _t;return p.then(d=>r(d,a,u))}return r(p,a,u)}}e["~standard"]={validate:r=>{try{const s=Ir(e,r);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Or(e,r).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}}),ca=y("$ZodString",(e,t)=>{fe.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??xo(e._zod.bag),e._zod.parse=(i,a)=>{if(t.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),Qe=y("$ZodStringFormat",(e,t)=>{Pi.init(e,t),ca.init(e,t)}),Yo=y("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ar(a))}else t.pattern??(t.pattern=Ar());Qe.init(e,t)}),Ko=y("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=wo),Qe.init(e,t)}),Xo=y("$ZodURL",(e,t)=>{Qe.init(e,t),e._zod.check=i=>{try{const a=i.value.trim(),r=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:i.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:i.value,inst:e,continue:!t.abort})),t.normalize?i.value=r.href:i.value=a;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!t.abort})}}}),Jo=y("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Co(t)),Qe.init(e,t)}),Qo=y("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=To),Qe.init(e,t)}),jo=y("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=So(t)),Qe.init(e,t)}),el=y("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Do),Qe.init(e,t)}),tl=y("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=$o),Qe.init(e,t),e._zod.bag.format="ipv4"}),il=y("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ko),Qe.init(e,t),e._zod.bag.format="ipv6",e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!t.abort})}}}),al=y("$ZodCustomStringFormat",(e,t)=>{Qe.init(e,t),e._zod.check=i=>{t.fn(i.value)||i.issues.push({code:"invalid_format",format:t.format,input:i.value,inst:e,continue:!t.abort})}}),Br=y("$ZodNumber",(e,t)=>{fe.init(e,t),e._zod.pattern=e._zod.bag.pattern??Mo,e._zod.parse=(i,a)=>{if(t.coerce)try{i.value=Number(i.value)}catch{}const r=i.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return i;const s=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...s?{received:s}:{}}),i}}),rl=y("$ZodNumberFormat",(e,t)=>{Ro.init(e,t),Br.init(e,t)}),sl=y("$ZodBoolean",(e,t)=>{fe.init(e,t),e._zod.pattern=Po,e._zod.parse=(i,a)=>{if(t.coerce)try{i.value=!!i.value}catch{}const r=i.value;return typeof r=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),i}}),nl=y("$ZodAny",(e,t)=>{fe.init(e,t),e._zod.parse=i=>i});function qr(e,t,i){e.issues.length&&t.issues.push(...no(i,e.issues)),t.value[i]=e.value}const Nr=y("$ZodArray",(e,t)=>{fe.init(e,t),e._zod.parse=(i,a)=>{const r=i.value;if(!Array.isArray(r))return i.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),i;i.value=Array(r.length);const s=[];for(let o=0;o<r.length;o++){const u=r[o],p=t.element._zod.run({value:u,issues:[]},a);p instanceof Promise?s.push(p.then(d=>qr(d,i,o))):qr(p,i,o)}return s.length?Promise.all(s).then(()=>i):i}});function zr(e,t,i,a){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const r=e.filter(s=>!Tt(s));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:i,errors:e.map(s=>s.issues.map(o=>vt(o,a,ft())))}),t)}const ol=y("$ZodUnion",(e,t)=>{fe.init(e,t),ie(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),ie(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),ie(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),ie(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${r.map(s=>pa(s.source)).join("|")})$`)}});const i=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(r,s)=>{if(i)return a(r,s);let o=!1;const u=[];for(const p of t.options){const d=p._zod.run({value:r.value,issues:[]},s);if(d instanceof Promise)u.push(d),o=!0;else{if(d.issues.length===0)return d;u.push(d)}}return o?Promise.all(u).then(p=>zr(p,r,e,s)):zr(u,r,e,s)}}),ll=y("$ZodIntersection",(e,t)=>{fe.init(e,t),e._zod.parse=(i,a)=>{const r=i.value,s=t.left._zod.run({value:r,issues:[]},a),o=t.right._zod.run({value:r,issues:[]},a);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([p,d])=>Vr(i,p,d)):Vr(i,s,o)}});function ya(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(da(e)&&da(t)){const i=Object.keys(t),a=Object.keys(e).filter(s=>i.indexOf(s)!==-1),r={...e,...t};for(const s of a){const o=ya(e[s],t[s]);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};r[s]=o.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let a=0;a<e.length;a++){const r=e[a],s=t[a],o=ya(r,s);if(!o.valid)return{valid:!1,mergeErrorPath:[a,...o.mergeErrorPath]};i.push(o.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function Vr(e,t,i){if(t.issues.length&&e.issues.push(...t.issues),i.issues.length&&e.issues.push(...i.issues),Tt(e))return e;const a=ya(t.value,i.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const ul=y("$ZodTransform",(e,t)=>{fe.init(e,t),e._zod.parse=(i,a)=>{if(a.direction==="backward")throw new _r(e.constructor.name);const r=t.transform(i.value,i);if(a.async)return(r instanceof Promise?r:Promise.resolve(r)).then(o=>(i.value=o,i));if(r instanceof Promise)throw new _t;return i.value=r,i}});function Gr(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Ur=y("$ZodOptional",(e,t)=>{fe.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ie(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ie(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${pa(i.source)})?$`):void 0}),e._zod.parse=(i,a)=>{if(t.innerType._zod.optin==="optional"){const r=t.innerType._zod.run(i,a);return r instanceof Promise?r.then(s=>Gr(s,i.value)):Gr(r,i.value)}return i.value===void 0?i:t.innerType._zod.run(i,a)}}),pl=y("$ZodNullable",(e,t)=>{fe.init(e,t),ie(e._zod,"optin",()=>t.innerType._zod.optin),ie(e._zod,"optout",()=>t.innerType._zod.optout),ie(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${pa(i.source)}|null)$`):void 0}),ie(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(i,a)=>i.value===null?i:t.innerType._zod.run(i,a)}),dl=y("$ZodDefault",(e,t)=>{fe.init(e,t),e._zod.optin="optional",ie(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,a)=>{if(a.direction==="backward")return t.innerType._zod.run(i,a);if(i.value===void 0)return i.value=t.defaultValue,i;const r=t.innerType._zod.run(i,a);return r instanceof Promise?r.then(s=>Zr(s,t)):Zr(r,t)}});function Zr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const hl=y("$ZodPrefault",(e,t)=>{fe.init(e,t),e._zod.optin="optional",ie(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,a)=>(a.direction==="backward"||i.value===void 0&&(i.value=t.defaultValue),t.innerType._zod.run(i,a))}),ml=y("$ZodNonOptional",(e,t)=>{fe.init(e,t),ie(e._zod,"values",()=>{const i=t.innerType._zod.values;return i?new Set([...i].filter(a=>a!==void 0)):void 0}),e._zod.parse=(i,a)=>{const r=t.innerType._zod.run(i,a);return r instanceof Promise?r.then(s=>Hr(s,e)):Hr(r,e)}});function Hr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const cl=y("$ZodCatch",(e,t)=>{fe.init(e,t),ie(e._zod,"optin",()=>t.innerType._zod.optin),ie(e._zod,"optout",()=>t.innerType._zod.optout),ie(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,a)=>{if(a.direction==="backward")return t.innerType._zod.run(i,a);const r=t.innerType._zod.run(i,a);return r instanceof Promise?r.then(s=>(i.value=s.value,s.issues.length&&(i.value=t.catchValue({...i,error:{issues:s.issues.map(o=>vt(o,a,ft()))},input:i.value}),i.issues=[]),i)):(i.value=r.value,r.issues.length&&(i.value=t.catchValue({...i,error:{issues:r.issues.map(s=>vt(s,a,ft()))},input:i.value}),i.issues=[]),i)}}),yl=y("$ZodPipe",(e,t)=>{fe.init(e,t),ie(e._zod,"values",()=>t.in._zod.values),ie(e._zod,"optin",()=>t.in._zod.optin),ie(e._zod,"optout",()=>t.out._zod.optout),ie(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(i,a)=>{if(a.direction==="backward"){const s=t.out._zod.run(i,a);return s instanceof Promise?s.then(o=>Ii(o,t.in,a)):Ii(s,t.in,a)}const r=t.in._zod.run(i,a);return r instanceof Promise?r.then(s=>Ii(s,t.out,a)):Ii(r,t.out,a)}});function Ii(e,t,i){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},i)}const gl=y("$ZodReadonly",(e,t)=>{fe.init(e,t),ie(e._zod,"propValues",()=>t.innerType._zod.propValues),ie(e._zod,"values",()=>t.innerType._zod.values),ie(e._zod,"optin",()=>t.innerType?._zod?.optin),ie(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(i,a)=>{if(a.direction==="backward")return t.innerType._zod.run(i,a);const r=t.innerType._zod.run(i,a);return r instanceof Promise?r.then(Wr):Wr(r)}});function Wr(e){return e.value=Object.freeze(e.value),e}const Yr=y("$ZodCustom",(e,t)=>{Ye.init(e,t),fe.init(e,t),e._zod.parse=(i,a)=>i,e._zod.check=i=>{const a=i.value,r=t.fn(a);if(r instanceof Promise)return r.then(s=>Kr(s,i,a,e));Kr(r,i,a,e)}});function Kr(e,t,i,a){if(!e){const r={code:"custom",input:i,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(r.params=a._zod.def.params),t.issues.push(Ot(r))}}var Xr;class bl{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...i){const a=i[0];if(this._map.set(t,a),a&&typeof a=="object"&&"id"in a){if(this._idmap.has(a.id))throw new Error(`ID ${a.id} already exists in the registry`);this._idmap.set(a.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const i=this._map.get(t);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(t),this}get(t){const i=t._zod.parent;if(i){const a={...this.get(i)??{}};delete a.id;const r={...a,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function fl(){return new bl}(Xr=globalThis).__zod_globalRegistry??(Xr.__zod_globalRegistry=fl());const Oi=globalThis.__zod_globalRegistry;function vl(e,t){return new e({type:"string",...L(t)})}function Dl(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...L(t)})}function wl(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...L(t)})}function $l(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...L(t)})}function kl(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...L(t)})}function _l(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...L(t)})}function Tl(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...L(t)})}function Sl(e,t){return new e({type:"string",format:"date",check:"string_format",...L(t)})}function Cl(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...L(t)})}function xl(e,t){return new e({type:"string",format:"duration",check:"string_format",...L(t)})}function El(e,t){return new e({type:"number",checks:[],...L(t)})}function Ml(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...L(t)})}function Pl(e,t){return new e({type:"boolean",...L(t)})}function Il(e){return new e({type:"any"})}function Ol(e,t){return new Ao({check:"less_than",...L(t),value:e,inclusive:!0})}function Al(e,t){return new Lo({check:"greater_than",...L(t),value:e,inclusive:!0})}function Ai(e,t){return new Fo({check:"max_length",...L(t),maximum:e})}function St(e,t){return new Bo({check:"min_length",...L(t),minimum:e})}function Jr(e,t){return new qo({check:"length_equals",...L(t),length:e})}function Qr(e,t){return new No({check:"string_format",format:"regex",...L(t),pattern:e})}function Ll(e){return new zo({check:"string_format",format:"lowercase",...L(e)})}function Rl(e){return new Vo({check:"string_format",format:"uppercase",...L(e)})}function Fl(e,t){return new Go({check:"string_format",format:"includes",...L(t),includes:e})}function Bl(e,t){return new Uo({check:"string_format",format:"starts_with",...L(t),prefix:e})}function ql(e,t){return new Zo({check:"string_format",format:"ends_with",...L(t),suffix:e})}function Ct(e){return new Ho({check:"overwrite",tx:e})}function Nl(e){return Ct(t=>t.normalize(e))}function zl(){return Ct(e=>e.trim())}function Vl(){return Ct(e=>e.toLowerCase())}function Gl(){return Ct(e=>e.toUpperCase())}function Ul(){return Ct(e=>ro(e))}function Zl(e,t,i){return new e({type:"array",element:t,...L(i)})}function jr(e,t,i){return new e({type:"custom",check:"custom",fn:t,...L(i)})}function es(e){const t=Hl(i=>(i.addIssue=a=>{if(typeof a=="string")i.issues.push(Ot(a,i.value,t._zod.def));else{const r=a;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=i.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),i.issues.push(Ot(r))}},e(i.value,i)));return t}function Hl(e,t){const i=new Ye({check:"custom",...L(t)});return i._zod.check=e,i}function Wl(e,t,i,a={}){const r=L(a),s={...L(a),check:"string_format",type:"string",format:t,fn:typeof i=="function"?i:u=>i.test(u),...r};return i instanceof RegExp&&(s.pattern=i),new e(s)}const Yl=y("ZodISODateTime",(e,t)=>{Jo.init(e,t),Li.init(e,t)});function Kl(e){return Tl(Yl,e)}const Xl=y("ZodISODate",(e,t)=>{Qo.init(e,t),Li.init(e,t)});function Jl(e){return Sl(Xl,e)}const Ql=y("ZodISOTime",(e,t)=>{jo.init(e,t),Li.init(e,t)});function jl(e){return Cl(Ql,e)}const eu=y("ZodISODuration",(e,t)=>{el.init(e,t),Li.init(e,t)});function tu(e){return xl(eu,e)}const je=y("ZodError",(e,t)=>{Pr.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>lo(e,i)},flatten:{value:i=>oo(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,la,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,la,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),iu=Ci(je),au=xi(je),ru=Ei(je),su=Mi(je),nu=ho(je),ou=mo(je),lu=co(je),uu=yo(je),pu=go(je),du=bo(je),hu=fo(je),mu=vo(je),Ve=y("ZodType",(e,t)=>(fe.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...i)=>e.clone(ao(t,{checks:[...t.checks??[],...i.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]})),e.clone=(i,a)=>Er(e,i,a),e.brand=()=>e,e.register=((i,a)=>(i.add(e,a),e)),e.parse=(i,a)=>iu(e,i,a,{callee:e.parse}),e.safeParse=(i,a)=>ru(e,i,a),e.parseAsync=async(i,a)=>au(e,i,a,{callee:e.parseAsync}),e.safeParseAsync=async(i,a)=>su(e,i,a),e.spa=e.safeParseAsync,e.encode=(i,a)=>nu(e,i,a),e.decode=(i,a)=>ou(e,i,a),e.encodeAsync=async(i,a)=>lu(e,i,a),e.decodeAsync=async(i,a)=>uu(e,i,a),e.safeEncode=(i,a)=>pu(e,i,a),e.safeDecode=(i,a)=>du(e,i,a),e.safeEncodeAsync=async(i,a)=>hu(e,i,a),e.safeDecodeAsync=async(i,a)=>mu(e,i,a),e.refine=(i,a)=>e.check(Fu(i,a)),e.superRefine=i=>e.check(Bu(i)),e.overwrite=i=>e.check(Ct(i)),e.optional=()=>ts(e),e.nullable=()=>is(e),e.nullish=()=>ts(is(e)),e.nonoptional=i=>Mu(e,i),e.array=()=>gu(e),e.or=i=>fu([e,i]),e.and=i=>Du(e,i),e.transform=i=>as(e,$u(i)),e.default=i=>Su(e,i),e.prefault=i=>xu(e,i),e.catch=i=>Iu(e,i),e.pipe=i=>as(e,i),e.readonly=()=>Lu(e),e.describe=i=>{const a=e.clone();return Oi.add(a,{description:i}),a},Object.defineProperty(e,"description",{get(){return Oi.get(e)?.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return Oi.get(e);const a=e.clone();return Oi.add(a,i[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),cu=y("_ZodString",(e,t)=>{ca.init(e,t),Ve.init(e,t);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...a)=>e.check(Qr(...a)),e.includes=(...a)=>e.check(Fl(...a)),e.startsWith=(...a)=>e.check(Bl(...a)),e.endsWith=(...a)=>e.check(ql(...a)),e.min=(...a)=>e.check(St(...a)),e.max=(...a)=>e.check(Ai(...a)),e.length=(...a)=>e.check(Jr(...a)),e.nonempty=(...a)=>e.check(St(1,...a)),e.lowercase=a=>e.check(Ll(a)),e.uppercase=a=>e.check(Rl(a)),e.trim=()=>e.check(zl()),e.normalize=(...a)=>e.check(Nl(...a)),e.toLowerCase=()=>e.check(Vl()),e.toUpperCase=()=>e.check(Gl()),e.slugify=()=>e.check(Ul())}),Li=y("ZodStringFormat",(e,t)=>{Qe.init(e,t),cu.init(e,t)}),yu=y("ZodArray",(e,t)=>{Nr.init(e,t),Ve.init(e,t),e.element=t.element,e.min=(i,a)=>e.check(St(i,a)),e.nonempty=i=>e.check(St(1,i)),e.max=(i,a)=>e.check(Ai(i,a)),e.length=(i,a)=>e.check(Jr(i,a)),e.unwrap=()=>e.element});function gu(e,t){return Zl(yu,e,t)}const bu=y("ZodUnion",(e,t)=>{ol.init(e,t),Ve.init(e,t),e.options=t.options});function fu(e,t){return new bu({type:"union",options:e,...L(t)})}const vu=y("ZodIntersection",(e,t)=>{ll.init(e,t),Ve.init(e,t)});function Du(e,t){return new vu({type:"intersection",left:e,right:t})}const wu=y("ZodTransform",(e,t)=>{ul.init(e,t),Ve.init(e,t),e._zod.parse=(i,a)=>{if(a.direction==="backward")throw new _r(e.constructor.name);i.addIssue=s=>{if(typeof s=="string")i.issues.push(Ot(s,i.value,t));else{const o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=i.value),o.inst??(o.inst=e),i.issues.push(Ot(o))}};const r=t.transform(i.value,i);return r instanceof Promise?r.then(s=>(i.value=s,i)):(i.value=r,i)}});function $u(e){return new wu({type:"transform",transform:e})}const ku=y("ZodOptional",(e,t)=>{Ur.init(e,t),Ve.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ts(e){return new ku({type:"optional",innerType:e})}const _u=y("ZodNullable",(e,t)=>{pl.init(e,t),Ve.init(e,t),e.unwrap=()=>e._zod.def.innerType});function is(e){return new _u({type:"nullable",innerType:e})}const Tu=y("ZodDefault",(e,t)=>{dl.init(e,t),Ve.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Su(e,t){return new Tu({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():xr(t)}})}const Cu=y("ZodPrefault",(e,t)=>{hl.init(e,t),Ve.init(e,t),e.unwrap=()=>e._zod.def.innerType});function xu(e,t){return new Cu({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():xr(t)}})}const Eu=y("ZodNonOptional",(e,t)=>{ml.init(e,t),Ve.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Mu(e,t){return new Eu({type:"nonoptional",innerType:e,...L(t)})}const Pu=y("ZodCatch",(e,t)=>{cl.init(e,t),Ve.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Iu(e,t){return new Pu({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Ou=y("ZodPipe",(e,t)=>{yl.init(e,t),Ve.init(e,t),e.in=t.in,e.out=t.out});function as(e,t){return new Ou({type:"pipe",in:e,out:t})}const Au=y("ZodReadonly",(e,t)=>{gl.init(e,t),Ve.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Lu(e){return new Au({type:"readonly",innerType:e})}const Ru=y("ZodCustom",(e,t)=>{Yr.init(e,t),Ve.init(e,t)});function Fu(e,t={}){return jr(Ru,e,t)}function Bu(e){return es(e)}const Dt=y("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");fe.init(e,t),e.def=t,e.type=t.type,e.parse=(i,a)=>uo(e,i,a,{callee:e.parse}),e.safeParse=(i,a)=>Ir(e,i,a),e.parseAsync=async(i,a)=>po(e,i,a,{callee:e.parseAsync}),e.safeParseAsync=async(i,a)=>Or(e,i,a),e.check=(...i)=>e.clone({...t,checks:[...t.checks??[],...i.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),e.clone=(i,a)=>Er(e,i,a),e.brand=()=>e,e.register=((i,a)=>(i.add(e,a),e))}),rs=y("ZodMiniString",(e,t)=>{ca.init(e,t),Dt.init(e,t)});function ss(e){return vl(rs,e)}const xt=y("ZodMiniStringFormat",(e,t)=>{Qe.init(e,t),rs.init(e,t)}),qu=y("ZodMiniEmail",(e,t)=>{Ko.init(e,t),xt.init(e,t)});function Nu(e){return Dl(qu,e)}const zu=y("ZodMiniUUID",(e,t)=>{Yo.init(e,t),xt.init(e,t)});function Vu(e){return wl(zu,e)}const Gu=y("ZodMiniURL",(e,t)=>{Xo.init(e,t),xt.init(e,t)});function Uu(e){return $l(Gu,e)}const Zu=y("ZodMiniIPv4",(e,t)=>{tl.init(e,t),xt.init(e,t)});function Hu(e){return kl(Zu,e)}const Wu=y("ZodMiniIPv6",(e,t)=>{il.init(e,t),xt.init(e,t)});function Yu(e){return _l(Wu,e)}const Ku=y("ZodMiniCustomStringFormat",(e,t)=>{al.init(e,t),xt.init(e,t)});function Xu(e){return Wl(Ku,"hostname",_o,e)}const ns=y("ZodMiniNumber",(e,t)=>{Br.init(e,t),Dt.init(e,t)});function os(e){return El(ns,e)}const Ju=y("ZodMiniNumberFormat",(e,t)=>{rl.init(e,t),ns.init(e,t)});function Qu(e){return Ml(Ju,e)}const ju=y("ZodMiniBoolean",(e,t)=>{sl.init(e,t),Dt.init(e,t)});function ls(e){return Pl(ju,e)}const ep=y("ZodMiniAny",(e,t)=>{nl.init(e,t),Dt.init(e,t)});function ga(){return Il(ep)}const tp=y("ZodMiniArray",(e,t)=>{Nr.init(e,t),Dt.init(e,t)});function us(e,t){return new tp({type:"array",element:e,...L(t)})}const ip=y("ZodMiniOptional",(e,t)=>{Ur.init(e,t),Dt.init(e,t)});function ap(e){return new ip({type:"optional",innerType:e})}const rp=y("ZodMiniCustom",(e,t)=>{Yr.init(e,t),Dt.init(e,t)});function Me(e,t={}){return jr(rp,e,t)}function ps(e){return es(e)}const ba={email:{schema:Nu()},hostname:{schema:Xu()},ipv4:{schema:Hu()},ipv6:{schema:Yu()},url:{schema:Uu()},uuid:{schema:Vu()},date:{schema:Jl()},time:{schema:jl()},"date-time":{schema:Kl({local:!0,offset:!0})},duration:{schema:tu()}},sp=Object.keys(ba),np=e=>(t,i)=>{switch(t.type){case"string":return op(t,i);case"integer":case"number":return up(t,i);case"boolean":return pp(t,i);case"array":return dp(t,i);case"custom":{if(!e)throw new Error('Validator type "custom" requires a customValidators object, but it was not supplied.');return hp(t,e)}}};function ne(e,t){if(e!==void 0)return typeof e=="string"?e:t?.translate(e.key,e.params,e.default)??e.default}function op(e,t){return At(e,i=>{const a=ne(i.messages?.invalid,t);let r=a?ss(a):ss();if(i.required===!0){const s=ne(i.messages?.required,t)??"This field is required";r=r.check(Me(o=>o.length>0,{error:s}))}if(typeof i.minLength=="number"){const s=ne(i.messages?.minLength,t),o=i.minLength;r=r.check(s?Me(u=>u.length>=o,{error:s}):St(o))}if(typeof i.maxLength=="number"){const s=ne(i.messages?.maxLength,t),o=i.maxLength;r=r.check(s?Me(u=>u.length<=o,{error:s}):Ai(o))}if(typeof i.pattern=="string"){const s=ne(i.messages?.pattern,t),o=new RegExp(i.pattern);r=r.check(s?Me(u=>o.test(u),{error:s}):Qr(o))}if(i.enum){const s=i.enum,o=ne(i.messages?.enum,t);r=r.check(Me(u=>s.includes(u),o?{error:o}:void 0))}if(i.const!==void 0){const s=ne(i.messages?.const,t);r=r.check(Me(o=>o===i.const,s?{error:s}:void 0))}if(i.format!==void 0)if(sp.includes(i.format)){const s=ne(i.messages?.format,t);r=r.check(s?ps((o,u)=>{const p=ot.standardValidate(ba[i.format].schema,o);ot.isStandardValidateSuccess(p)||u.addIssue({code:"custom",path:[],message:s})}):ba[i.format].schema)}else console.error(`The string validation format "${i.format}" is not supported`);return r})}const lp=(e,t)=>{if(t===0)return!1;const i=e/t;return Math.abs(i-Math.round(i))<1e-10};function up(e,t){return At(e,i=>{const a=ne(i.messages?.invalid,t);let r=a?os(a):os();if(i.type==="integer"&&(r=r.check(Qu())),i.minimum!==void 0){const s=ne(i.messages?.minimum,t),o=i.minimum;r=r.check(s?Me(u=>u>=o,{error:s}):Al(o))}if(i.maximum!==void 0){const s=ne(i.messages?.maximum,t),o=i.maximum;r=r.check(s?Me(u=>u<=o,{error:s}):Ol(o))}if(i.exclusiveMinimum!==void 0){const s=ne(i.messages?.exclusiveMinimum,t),o=i.exclusiveMinimum;r=r.check(Me(u=>u>o,s?{error:s}:void 0))}if(i.exclusiveMaximum!==void 0){const s=ne(i.messages?.exclusiveMaximum,t),o=i.exclusiveMaximum;r=r.check(Me(u=>u<o,s?{error:s}:void 0))}if(i.multipleOf!==void 0){const s=ne(i.messages?.multipleOf,t),o=i.multipleOf;r=r.check(Me(u=>lp(u,o),s?{error:s}:void 0))}if(i.enum){const s=i.enum,o=ne(i.messages?.enum,t);r=r.check(Me(u=>s.includes(u),o?{error:o}:void 0))}if(i.const!==void 0){const s=ne(i.messages?.const,t);r=r.check(Me(o=>o===i.const,s?{error:s}:void 0))}return r})}function pp(e,t){return At(e,i=>{const a=ne(i.messages?.invalid,t);let r=a?ls(a):ls();if(i.const!==void 0){const s=ne(i.messages?.const,t);r=r.check(Me(o=>o===i.const,s?{error:s}:void 0))}return r})}function dp(e,t){return At(e,i=>{const a=ne(i.messages?.invalid,t);let r=a?us(ga(),a):us(ga());if(i.required===!0){const s=ne(i.messages?.required,t)??"This field is required";r=r.check(Me(o=>o.length>0,{error:s}))}if(typeof i.minItems=="number"){const s=ne(i.messages?.minItems,t),o=i.minItems;r=r.check(s?Me(u=>u.length>=o,{error:s}):St(o))}if(typeof i.maxItems=="number"){const s=ne(i.messages?.maxItems,t),o=i.maxItems;r=r.check(s?Me(u=>u.length<=o,{error:s}):Ai(o))}return r})}function hp(e,t){return At(e,i=>{let a=ga();return ot.filterTap(Object.keys(i),r=>r!=="type"&&r!=="required",r=>{const s=i[r],o=t[r],u=o(s);a=a.check(ps((p,d)=>{const h=ot.standardValidate(u,p);if(!ot.isStandardValidateSuccess(h)){const c=h.issues[0];d.addIssue({code:"custom",path:[],message:c?.message||`Validation failed for ${r}`})}}))}),a})}function At(e,t){const i=t(e);return e.required?i:ap(i)}const mp=e=>e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"label")&&Object.prototype.hasOwnProperty.call(e,"value");function cp(e,t){if(e!=null&&typeof e=="object"&&"__rid"in e)return e.__rid;const i=t();return Object.defineProperty(e,"__rid",{value:i,enumerable:!1,configurable:!1}),i}const ds={button:async()=>(await Promise.resolve().then(()=>wp)).ButtonElement,calendar:async()=>(await Promise.resolve().then(()=>Up)).CalendarElement,dateTimeCalendar:async()=>(await Promise.resolve().then(()=>gd)).DateTimeCalendarElement,rangeCalendar:async()=>(await Promise.resolve().then(()=>kd)).RangeCalendarElement,rangeDateInput:async()=>(await Promise.resolve().then(()=>Ed)).RangeDateInputElement,rangeTimeInput:async()=>(await Promise.resolve().then(()=>Ad)).RangeTimeInputElement,rangeDateTimeInput:async()=>(await Promise.resolve().then(()=>qd)).RangeDateTimeInputElement,rangeDateTimeCalendar:async()=>(await Promise.resolve().then(()=>Ud)).RangeDateTimeCalendarElement,rangeDateTimePicker:async()=>(await Promise.resolve().then(()=>Kd)).RangeDateTimePickerElement,rangeDatePicker:async()=>(await Promise.resolve().then(()=>eh)).RangeDatePickerElement,rangeTimePicker:async()=>(await Promise.resolve().then(()=>sh)).RangeTimePickerElement,currency:async()=>(await Promise.resolve().then(()=>ph)).CurrencyElement,dateInput:async()=>(await Promise.resolve().then(()=>yh)).DateElement,datePicker:async()=>(await Promise.resolve().then(()=>Dh)).DatePickerElement,dateTimePicker:async()=>(await Promise.resolve().then(()=>Ch)).DateTimePickerElement,dropdown:async()=>(await Promise.resolve().then(()=>zh)).DropdownElement,list:async()=>(await Promise.resolve().then(()=>Uh)).ListElement,markdown:async()=>(await Promise.resolve().then(()=>Jh)).MarkdownElement,password:async()=>(await Promise.resolve().then(()=>im)).PasswordElement,textinput:async()=>(await Promise.resolve().then(()=>om)).TextinputElement,timeInput:async()=>(await Promise.resolve().then(()=>pm)).TimeElement,timePicker:async()=>(await Promise.resolve().then(()=>mm)).TimePickerElement,dateTimeInput:async()=>(await Promise.resolve().then(()=>gm)).DateTimeElement,textarea:async()=>(await Promise.resolve().then(()=>wm)).TextareaElement,toggle:async()=>(await Promise.resolve().then(()=>Sm)).ToggleElement,checkbox:async()=>(await Promise.resolve().then(()=>Pm)).CheckboxElement,number:async()=>(await Promise.resolve().then(()=>Rm)).NumberElement,radiogroup:async()=>(await Promise.resolve().then(()=>Um)).RadiogroupElement,select:async()=>(await Promise.resolve().then(()=>Km)).SelectElement,tags:async()=>(await Promise.resolve().then(()=>tc)).TagsElement,repeater:async()=>(await Promise.resolve().then(()=>nc)).RepeaterElement,flex:async()=>(await Promise.resolve().then(()=>uc)).FlexElement,grid:async()=>(await Promise.resolve().then(()=>hc)).GridElement,tabs:async()=>(await Promise.resolve().then(()=>yc)).TabsElement,accordion:async()=>(await Promise.resolve().then(()=>fc)).AccordionElement,alert:async()=>(await Promise.resolve().then(()=>wc)).AlertElement,markdownText:async()=>(await Promise.resolve().then(()=>_c)).MarkdownTextElement,renderer:async()=>(await Promise.resolve().then(()=>Cc)).RendererElement};var yp=Object.defineProperty,gp=Object.getOwnPropertyDescriptor,Lt=(e,t,i,a)=>{for(var r=a>1?void 0:a?gp(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&yp(t,i,r),r};X.FormElement=class extends l.LitElement{constructor(){super(...arguments),this.autocomplete=void 0}setData(t){this.coreForm?.setData(t)}setMeta(t){this.coreForm?.setMeta(t)}createRenderRoot(){return this}render(){const t=this.config,i=to(t.formDef,t.formSelectors,t.formConfig),a={formDef:i.formDef,widgetLoaders:{...ds,...i.widgetLoaders,...t.customWidgetLoaders??{}},dependencies:{...i.dependencies??{},...t.dependencies??{}},functions:{...i.functions??{},...t.functions??{}},validateOn:t.validateOn??i.validateOn??"eager",itemRenderers:{...i.itemRenderers??{},...t.itemRenderers??{}},localization:t.localization,middlewares:t.middlewares??[],data:t.data,meta:t.meta,formName:t.formName},r=np({...t.customValidators??{}}),s=i.formEvent,o=s?u=>s(u.detail):void 0;return l.html`
1
+ (function(te,dt){typeof exports=="object"&&typeof module<"u"?dt(exports,require("@golemui/core"),require("@golemui/gui-shared"),require("@golemui/lit"),require("lit"),require("lit/decorators.js"),require("@lit/context"),require("rxjs"),require("lit/directives/class-map.js"),require("lit-html/directives/style-map.js"),require("lit-html/directives/repeat.js"),require("lit/directives/if-defined.js"),require("lit/directives/live.js"),require("lit/directives/repeat.js"),require("lit/directives/unsafe-html.js")):typeof define=="function"&&define.amd?define(["exports","@golemui/core","@golemui/gui-shared","@golemui/lit","lit","lit/decorators.js","@lit/context","rxjs","lit/directives/class-map.js","lit-html/directives/style-map.js","lit-html/directives/repeat.js","lit/directives/if-defined.js","lit/directives/live.js","lit/directives/repeat.js","lit/directives/unsafe-html.js"],dt):(te=typeof globalThis<"u"?globalThis:te||self,dt(te["gui-lit"]={},te.core,null,te.lit$1,te.lit,te.decorators_js,te.context,te.rxjs,te.classMap_js,te.styleMap_js,te.repeat_js,te.ifDefined_js,te.live_js,te.repeat_js$1,te.unsafeHtml_js))})(this,(function(te,dt,Ny,m,l,n,f,es,T,vt,Ne,la,Jn,ts,Xn){"use strict";function is(e){return function(t,i=()=>!0){return{kind:"leaf",selectorType:e,matcher:i,config:t}}}const as={LAYOUTS:"LAYOUTS",DISPLAYS:"DISPLAYS"};class Qn{constructor(){this.handlerByItemType=new Map,this.kindByItemType=new Map}registerItemType(t,i,a){if(this.handlerByItemType.has(t))throw new Error(`Item type "${t}" is already registered.`);this.handlerByItemType.set(t,i),a&&this.kindByItemType.set(t,a)}getItemTypeKind(t){return this.kindByItemType.get(t)}getRegisteredItemTypes(){return[...this.handlerByItemType.keys()]}getItemTypesOfKind(t){const i=[];for(const[a,r]of this.kindByItemType)r===t&&i.push(a);return i}getItemTypeHandler(t){const i=this.handlerByItemType.get(t);if(!i)throw new Error(`No handler registered for item type "${t}". Did you forget to import the registration module?`);return i}hasItemTypeHandler(t){return this.handlerByItemType.has(t)}}function jn(){return new Qn}function O(e){const t=d=>{if(!e.sensibleDefaults)return{};let p={...e.sensibleDefaults.base};for(const u of d){const h=u.config;for(const c of e.sensibleDefaults.fields){const y=c;h[y]!=null&&(p={...p,[y]:h[y]})}}return p},i=(d,p)=>e.sensibleDefaults?e.sensibleDefaults.apply(d,p):d,a=d=>{switch(e.entryShape){case"bare":return{baseDef:d};case"keyed":{const p=d;return{baseDef:p.def,path:p.key}}case"compound":{const p=d;return{baseDef:p.def,children:p.children}}}},r={rollUpSensibleDefaults:t,applySensibleDefaults:i,mapToWidget:e.mapToWidget,parseEntry:a,...e.afterMerge?{afterMerge:e.afterMerge}:{},...e.buildCustomWidget?{buildCustomWidget:e.buildCustomWidget}:{},...e.getChildren?{getChildren:e.getChildren}:{}},s=is(e.itemType),o=(d,p)=>s(p,(u=>u.uid===d));return{itemType:e.itemType,kind:e.kind,handler:r,gsl:s,gslByUid:o}}function eo(e,t){e.registerItemType(t.itemType,t.handler,t.kind)}function J(e){const{uid:t,path:i,label:a,disabled:r,readonly:s,defaultValue:o,tags:d,type:p,size:u,onLoad:h,onChange:c,onFilter:y,on:g,states:_,include:x,exclude:Ae,validator:st,...ft}=e;return ft}function ie(e,t){return typeof e=="function"?e:{type:t,...e??{}}}function to(e){return e?e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()):""}function X(e,t){return e.label!=null||t.suppressAutomaticLabels||!e.path?e:{...e,label:to(e.path)}}function je(e,t){return e.placeholder!=null||t.suppressAutomaticPlaceholders||!e.path?e:{...e,placeholder:e.path}}function da(e){return{errors:void 0,touched:void 0,translate:void 0,...e??{},$form:e?.$form??{}}}const rs={INPUTS:"input",ACTIONS:"action",DISPLAYS:"display",LAYOUTS:"layout"};class io{constructor(t){this.registry=t}resolve(t,i){const a=[];for(const s of i)s.kind==="aggregated"?this.collectFromAggregated(s,t,a):this.collectFromLeaf(s,t,a);const r=this.rollUpSensibleDefaults(a);return{leafSelectors:a,sensibleDefaults:r}}selectorMatchesItemType(t,i){const a=rs[t];return a?this.registry.getItemTypeKind(i)===a:t===i}collectFromAggregated(t,i,a){if(t.matcher(i))for(const r of t.children)this.collectFromLeaf(r,i,a)}collectFromLeaf(t,i,a){this.selectorMatchesItemType(t.selectorType,i.itemType??"")&&t.matcher(i)&&a.push(t)}rollUpSensibleDefaults(t){const i=new Map,a=(s,o)=>{const d=i.get(s)??[];d.push(o),i.set(s,d)};for(const s of t){const o=rs[s.selectorType];if(o)for(const d of this.registry.getItemTypesOfKind(o))a(d,s);else a(s.selectorType,s)}const r={};for(const[s,o]of i)this.registry.hasItemTypeHandler(s)&&(r[s]=this.registry.getItemTypeHandler(s).rollUpSensibleDefaults(o));return r}}class ao{deepMerge(t,i){if(i==null)return t;if(t==null||typeof t!="object"||typeof i!="object"||Array.isArray(t)||Array.isArray(i))return i;const a={...t};for(const r in i)Object.prototype.hasOwnProperty.call(i,r)&&(typeof i[r]=="object"&&!Array.isArray(i[r])&&i[r]!==null&&typeof t[r]=="object"&&!Array.isArray(t[r])&&t[r]!==null?a[r]=this.deepMerge(t[r],i[r]):a[r]=i[r]);return a}}const ro=new ao;class so{constructor(t,i){this.objectUtils=t,this.registry=i}merge(t,i,a){let r={},s=null;typeof t=="function"&&(s=t);const o=this.collectDecorators(a);for(const u of o){if(s!=null){s=this.composeRuntimeFunctions(s,u);continue}if(typeof u=="function"){const h=u({...r,...typeof t=="function"?{}:t});if(typeof h=="function"){s=this.createPromotedFunction(r,t,h,i,a);continue}r=this.objectUtils.deepMerge(r,h)}else r=this.objectUtils.deepMerge(r,u)}if(s!=null)return{kind:"dynamic",fn:this.wrapWithSensibleDefaults(s,r,i,a)};const d=this.objectUtils.deepMerge(t,r);return{kind:"static",def:this.applySensibleDefaults({...d},i,a)}}collectDecorators(t){const i=[];for(const a of t.leafSelectors){const r=a.config;r.override!=null&&i.push(r.override)}return i}applySensibleDefaults(t,i,a){if(!this.registry.hasItemTypeHandler(i))return t;const r=a.sensibleDefaults[i]??{};return this.registry.getItemTypeHandler(i).applySensibleDefaults(t,r)}createPromotedFunction(t,i,a,r,s){return o=>{const d=a(o);let p=this.objectUtils.deepMerge(t,d);return p=this.objectUtils.deepMerge(p,i),this.applySensibleDefaults(p,r,s)}}wrapWithSensibleDefaults(t,i,a,r){return s=>{let o=t(s);return Object.keys(i).length>0&&(o=this.objectUtils.deepMerge(i,o)),this.applySensibleDefaults(o,a,r)}}composeRuntimeFunctions(t,i){return typeof i=="function"?a=>{const r=t(a),s=i(r);return typeof s=="function"?s(a):this.objectUtils.deepMerge(s,r)}:a=>{const r=t(a);return this.objectUtils.deepMerge(r,i)}}}class no{constructor(t){this.registry=t}mapToWidget(t,i){if(t.kind==="dynamic"){const a=t.fn;return(r=>{const s=a(r);return this.mapStaticDef(s,i)})}return this.mapStaticDef(t.def,i)}mapStaticDef(t,i){const a=this.registry.getItemTypeHandler(i).mapToWidget(t);return this.applyBaseWidgetFields(a,t)}applyBaseWidgetFields(t,i){return i.size!=null&&(t.size=i.size),i.defaultValue!=null&&t.kind==="input"&&(t.defaultValue=i.defaultValue),i.on!=null&&(t.on=i.on),i.include!=null&&(t.include=i.include),i.exclude!=null&&(t.exclude=i.exclude),t}}const ss={onLoad:"load",onChange:"change",onFilter:"filter",onBlur:"blur"},oo=Object.keys(ss);function ns(e){if(e.length>0)return null;try{const t=e();return typeof t=="string"?t:null}catch{return null}}class lo{extractOnClickFromMergeResult(t,i,a){if(t.kind==="dynamic"){const o=t.fn;return{kind:"dynamic",fn:p=>{const u=o(p);return this.wireOnClick(u,i,a)}}}const r=t.def;return{kind:"static",def:this.wireOnClick(r,i,a)}}wireOnClick(t,i,a){const r=a.next(),s=t.onClick;if(typeof s=="function"){const{onClick:o,...d}=t,p=s(void 0);return typeof p=="string"?{...d,uid:r,on:{click:p}}:(i.set(r,u=>s(u.data)),{...d,uid:r,on:{click:r}})}return{...t,uid:r}}wireInputLayoutEvents(t,i,a){if(t.kind==="dynamic"){const s=t.fn;return{kind:"dynamic",fn:d=>{const p=s(d);return this.wireEventProperties(p,i,a)}}}return{kind:"static",def:this.wireEventProperties(t.def,i,a)}}wireEventProperties(t,i,a){const r={...t.on||{}};let s=!1;const o={...t};for(const d of oo){const p=t[d];if(p==null)continue;const u=ss[d];if(typeof p=="function"){const h=ns(p);if(h!=null)r[u]=h;else{const c=a.next();i.set(c,p),r[u]=c}s=!0}else typeof p=="string"&&(r[u]=p,s=!0);delete o[d]}return s&&(o.on=r),o}}const pa=new lo,po={input:new Set(["disabled","readonly","label","validator","size"]),action:new Set(["disabled","label","size"]),layout:new Set(["size"]),display:new Set([])},os={onChange:"change",onLoad:"load",onFilter:"filter",onClick:"click"};class uo{extractFromMergeResult(t,i){const a={};for(const d of i){const p=d.targetState,u=d.config,h=u.override&&typeof u.override!="function"?u.override:u;a[p]={...a[p]||{},...h}}if(t.kind==="dynamic"){const d=t.fn;return{cleanedResult:{kind:"dynamic",fn:u=>{const h=d(u),{states:c,...y}=h;return y}},stateData:{stateOverrides:a}}}const{states:r,...s}=t.def,o={};for(const[d,p]of Object.entries(a))o[d]={...p};if(r)for(const[d,p]of Object.entries(r))o[d]={...o[d]||{},...p};return{cleanedResult:{kind:"static",def:s},stateData:{stateOverrides:o}}}applyToWidget(t,i,a,r){const{stateOverrides:s}=i;if(Object.keys(s).length===0)return t;const o={...t},d=t.kind,p=po[d]||new Set;t.props&&(o.props={...t.props}),t.on&&(o.on={...t.on});for(const[u,h]of Object.entries(s))for(const[c,y]of Object.entries(h))c==="visible"?this.applyVisibility(o,u,y):os[c]?this.applyStateEvent(o,u,c,y,a,r):p.has(c)?o[`${c}.${u}`]=y:(o.props||(o.props={}),o.props[`${c}.${u}`]=y);return o}hasStateData(t){return Object.keys(t.stateOverrides).length>0}applyVisibility(t,i,a){if(a){const r=t.include?.in||[];t.include={...t.include||{},in:[...r,i]}}else{const r=t.exclude?.from||[];t.exclude={...t.exclude||{},from:[...r,i]}}}applyStateEvent(t,i,a,r,s,o){const d=os[a];if(t.on||(t.on={}),typeof r=="function"){const p=ns(r);if(p!=null)t.on[`${d}.${i}`]=p;else{const u=o.next();s.set(u,r),t.on[`${d}.${i}`]=u}}else typeof r=="string"&&(t.on[`${d}.${i}`]=r)}}const ho=new uo;function co(){let e=0;return{next:()=>`event_${e++}`}}class mo{constructor(t,i,a,r,s,o){this.registry=t,this.resolver=i,this.merger=a,this.mapper=r,this.eventWiring=s,this.stateExpansion=o}walkAndMap(t,i,a){const r=new Map,s=co(),o={value:0},d=new Set;return{widgets:this.walkItems(t,i,r,a,s,o,d),eventRegistry:r}}walkItems(t,i,a,r,s,o,d){return t.flatMap(p=>{if(p.type!=="ITEMS")throw new Error("Unexpected gui shortcut type");return p.items.map(u=>this.processItem(u,p.itemType,p.tags,i,a,r,s,o,d))})}processItem(t,i,a,r,s,o,d,p,u){const h=i,c=this.registry.getItemTypeHandler(i),y=c.parseEntry(t),g=this.buildBaseDef(y),_=this.buildDecoratorForMatching(g,h,a),x=this.resolver.resolve(_,r),Ae=x.leafSelectors.filter(Ze=>Ze.targetState!=null),st={leafSelectors:x.leafSelectors.filter(Ze=>Ze.targetState==null),sensibleDefaults:x.sensibleDefaults};let ft=this.merger.merge(g,h,st);c.afterMerge&&(ft=c.afterMerge(ft,{eventRegistry:s,formConfig:o,eventIdGenerator:d})),ft=this.eventWiring.wireInputLayoutEvents(ft,s,d);const{cleanedResult:Kn,stateData:jr}=this.stateExpansion.extractFromMergeResult(ft,Ae);let ut;if(c.buildCustomWidget){const Ze=this.buildCustomWidgetContext(y.children,r,s,o,d,p,u);ut=this.buildCustomWidget(c,Kn,Ze)}else ut=this.mapper.mapToWidget(Kn,h);if(typeof ut!="function"){const Ze=ut;Ze.uid||(Ze.path&&!u.has(Ze.path)?(Ze.uid=Ze.path,u.add(Ze.path)):Ze.uid=`dx_${p.value++}`)}if(this.stateExpansion.hasStateData(jr))if(typeof ut=="function"){const Ze=ut;ut=(By=>{const qy=Ze(By);return this.stateExpansion.applyToWidget(qy,jr,s,d)})}else ut=this.stateExpansion.applyToWidget(ut,jr,s,d);return ut}buildCustomWidgetContext(t,i,a,r,s,o,d){return{children:t,mapStaticDef:(p,u)=>this.mapper.mapStaticDef(p,u),walkChildren:p=>this.walkItems(p,i,a,r,s,o,d)}}buildCustomWidget(t,i,a){return t.buildCustomWidget(i,a)}buildBaseDef(t){const i=t.baseDef;return typeof i=="function"?a=>{const r=da(a),s=i(r);return t.path!=null?{...s,path:t.path}:s}:t.path!=null?{...i,path:t.path}:i}buildDecoratorForMatching(t,i,a){if(typeof t=="function")return{itemType:i,tags:[...a]};const r=[...a,..."tags"in t&&t.tags?t.tags:[]],s="uid"in t?t.uid:void 0,o="type"in t?t.type:void 0;return{itemType:i,tags:r,uid:s,type:o}}}class yo{normalizeSelectors(t){const i=Array.isArray(t)?t:[t],a=[],r=[];for(const s of i)s.kind==="leaf"?r.push(s):a.push(s);return r.length>0&&a.unshift({kind:"aggregated",matcher:()=>!0,children:r}),a}extractFormConfig(){return{suppressAutomaticStack:!1}}}class go{constructor(t,i,a){this.selectorNormalizer=t,this.walker=i,this.adapter=a}processDxFacade(t,i=[],a){const{defs:r,gslSelectors:s,formConfig:o}=this.prepareForm(t,i,a),{widgets:d,eventRegistry:p}=this.walker.walkAndMap(r,s,o),u=d[0];return this.buildResult({form:u},p,o)}prepareForm(t,i,a){const s=(Array.isArray(t)?[...t]:[t]).map(p=>typeof p=="function"?this.adapter.bareItemToWidget(p):p),o=this.selectorNormalizer.normalizeSelectors(i),d={...this.selectorNormalizer.extractFormConfig(),...a};return d.suppressAutomaticStack?{defs:s,gslSelectors:o,formConfig:d}:{defs:[this.adapter.rootEntry(s)],gslSelectors:o,formConfig:d}}convertStateNames(t){const i={};for(const[a,r]of Object.entries(t))i[a.replace(/\$/g,":")]=r;return i}buildResult(t,i,a){a.states&&Object.keys(a.states).length>0&&(t={...t,states:this.convertStateNames(a.states)});const r={form:t};return i.size>0&&(r.events=s=>{const o=i.get(s.name);if(o){const d=u=>{if(u&&typeof u=="object"&&"path"in u&&!("type"in u)){const{path:h,...c}=u;for(const[y,g]of Object.entries(c))s.callback({type:"OVERRIDE_WIDGET_PROP",payload:{path:h,prop:y,value:g}})}else s.callback(u)},p={...s,callback:d,update:d};o(p)}}),a.dependencies&&(r.dependencies=a.dependencies),a.functions&&(r.functions=a.functions),a.widgetLoaders&&(r.widgetLoaders=a.widgetLoaders),a.validateOn&&(r.validateOn=a.validateOn),a.itemRenderers&&(r.itemRenderers=a.itemRenderers),r}}function bo(e){const{registry:t,adapter:i}=e,a=new mo(t,new io(t),new so(ro,t),new no(t),pa,ho);return new go(new yo,a,i)}function ls(e){return typeof e=="function"?!0:Array.isArray(e)?e.length===0||e.every(ds):ds(e)}function ds(e){if(typeof e=="function")return!0;if(e===null||typeof e!="object")return!1;const t=e;return t.type==="ITEMS"&&typeof t.itemType=="string"}function fo(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e.form;if(ls(t))throw new Error("[GolemUI] The gui.* form definition was wrapped in an extra `{ form: ... }` object, so its fields were never resolved. Pass the gui.* array DIRECTLY as formDef (`config={{ formDef: form }}`) and put any named `states` in `formConfig`: `config={{ formDef: form, formConfig: { states } }}`. Do NOT wrap them as a `{ form: [...] }` object.")}function vo(e){const t=Object.freeze({}),i=Object.freeze({}),a=new WeakMap;function r(s,o){return s==null?o:typeof s=="object"?s:{}}return function(o,d,p){if(!ls(o))return fo(o),{formDef:o};const u=r(o,t),h=r(d,t),c=r(p,i);let y=a.get(u);y||(y=new WeakMap,a.set(u,y));let g=y.get(h);g||(g=new WeakMap,y.set(h,g));const _=g.get(c);if(_)return _;const x=e.processDxFacade(o,d,p),Ae={formDef:x.form,formEvent:x.events,dependencies:x.dependencies,functions:x.functions,widgetLoaders:x.widgetLoaders,validateOn:x.validateOn,itemRenderers:x.itemRenderers};return g.set(c,Ae),Ae}}const Do=(e,t)=>({type:"ITEMS",itemType:as.DISPLAYS,items:[{render:e}],tags:t??[]});function wo(e){switch(e.type){case"text":return ko(e);case"number":return So(e);case"boolean":return $o(e);default:throw new Error(`Unsupported field type "${e.type}"`)}}function $o(e){const t=J(e);return{uid:e.uid??"",kind:"input",type:"toggle",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"boolean")}:{},props:t}}function ko(e){const t=J(e);return{uid:e.uid??"",kind:"input",type:"textinput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},props:{placeholder:t.placeholder??"",...t},validator:ie(e.validator,"string")}}function So(e){const t=J(e);return{uid:e.uid??"",kind:"input",type:"number",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},props:{placeholder:t.placeholder??"",...t},validator:ie(e.validator,"number")}}const ua=O({itemType:"INPUTS",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>{let i=X(e,t);return i=je(i,t),i}},mapToWidget:wo});ua.gsl,ua.gslByUid;const ha=O({itemType:"SELECT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>je(X(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"select",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:J(e)})});ha.gsl,ha.gslByUid;const ca=O({itemType:"DROPDOWN",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>je(X(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dropdown",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:J(e)})});ca.gsl,ca.gslByUid;const ma=O({itemType:"RADIOGROUP",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"radiogroup",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:J(e)})});ma.gsl,ma.gslByUid;const ya=O({itemType:"CHECKBOX",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"checkbox",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"boolean")}:{},props:J(e)})});ya.gsl,ya.gslByUid;const ga=O({itemType:"TEXTAREA",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>je(X(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"textarea",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"string")}:{},props:J(e)})});ga.gsl,ga.gslByUid;const ba=O({itemType:"PASSWORD",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>je(X(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"password",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"string")}:{},props:J(e)})});ba.gsl,ba.gslByUid;const fa=O({itemType:"CURRENCY",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>je(X(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"currency",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"number")}:{},props:J(e)})});fa.gsl,fa.gslByUid;const va=O({itemType:"MARKDOWN",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>je(X(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"markdown",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"string")}:{},props:J(e)})});va.gsl,va.gslByUid;const Da=O({itemType:"LIST",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"list",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:J(e)})});Da.gsl,Da.gslByUid;const wa=O({itemType:"CALENDAR",kind:"input",entryShape:"bare",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"calendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"string")}:{},props:J(e)})});wa.gsl,wa.gslByUid;const $a=O({itemType:"DATE_TIME_CALENDAR",kind:"input",entryShape:"bare",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateTimeCalendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"string")}:{},props:J(e)})});$a.gsl,$a.gslByUid;const ka=O({itemType:"DATE_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"string")}:{},props:J(e)})});ka.gsl,ka.gslByUid;const Sa=O({itemType:"DATE_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>je(X(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"datePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"string")}:{},props:J(e)})});Sa.gsl,Sa.gslByUid;const Ta=O({itemType:"DATE_TIME_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>je(X(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateTimePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"string")}:{},props:J(e)})});Ta.gsl,Ta.gslByUid;const _a=O({itemType:"RANGE_CALENDAR",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeCalendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"array")}:{},props:J(e)})});_a.gsl,_a.gslByUid;const Aa=O({itemType:"RANGE_DATE_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"array")}:{},props:J(e)})});Aa.gsl,Aa.gslByUid;const Ca=O({itemType:"RANGE_DATE_TIME_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateTimeInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"array")}:{},props:J(e)})});Ca.gsl,Ca.gslByUid;const La=O({itemType:"RANGE_DATE_TIME_CALENDAR",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateTimeCalendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"array")}:{},props:J(e)})});La.gsl,La.gslByUid;const xa=O({itemType:"RANGE_DATE_TIME_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateTimePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"array")}:{},props:J(e)})});xa.gsl,xa.gslByUid;const Ea=O({itemType:"RANGE_TIME_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeTimeInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"array")}:{},props:J(e)})});Ea.gsl,Ea.gslByUid;const Pa=O({itemType:"TIME_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"timeInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"string")}:{},props:J(e)})});Pa.gsl,Pa.gslByUid;const Oa=O({itemType:"TIME_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>je(X(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"timePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"string")}:{},props:J(e)})});Oa.gsl,Oa.gslByUid;const Ia=O({itemType:"DATE_TIME_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateTimeInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"string")}:{},props:J(e)})});Ia.gsl,Ia.gslByUid;const Ma=O({itemType:"RANGE_DATE_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>je(X(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDatePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"array")}:{},props:J(e)})});Ma.gsl,Ma.gslByUid;const Ra=O({itemType:"RANGE_TIME_PICKER",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeTimePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"array")}:{},props:J(e)})});Ra.gsl,Ra.gslByUid;function To(e){const t={};return e.addLabel!=null&&(t.addLabel=e.addLabel),e.removeLabel!=null&&(t.removeLabel=e.removeLabel),e.limit!=null&&(t.limit=e.limit),e.title!=null&&(t.title=e.title),e.addButtonIcon!=null&&(t.addButtonIcon=e.addButtonIcon),e.removeButtonIcon!=null&&(t.removeButtonIcon=e.removeButtonIcon),t}function _o(e){return{uid:e.uid??"",kind:"input",type:"repeater",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"array")}:{},props:{...To(e),template:{kind:"layout",type:"flex",children:[],props:{direction:"column"}}}}}function Fa(e,t){for(const i of e){if(typeof i=="function")continue;const a=i;typeof a.path=="string"&&a.path&&!a.path.startsWith(t)&&(a.path=t+a.path),"children"in a&&Array.isArray(a.children)&&Fa(a.children,t);const r=a.props;r?.template?.children&&Array.isArray(r.template.children)&&Fa(r.template.children,t)}}function Ao(e,t){const i=t.walkChildren(t.children??[]),a=e.kind==="static"?e.def.path??"":e.fn({})?.path??"";a&&Fa(i,a+".items.");const r={kind:"layout",type:"flex",uid:"",children:i,props:{direction:"column"}};if(e.kind==="static"){const o=t.mapStaticDef(e.def,"REPEATER");return{...o,props:{...o.props,template:r}}}const s=e.fn;return(o=>{const d=s(o),p=t.mapStaticDef(d,"REPEATER");return{...p,props:{...p.props,template:r}}})}function Co(e){return{baseDef:e.def,path:e.key,children:e.children}}function Lo(e){return e.children}const xo={parseEntry:Co,rollUpSensibleDefaults:()=>({}),applySensibleDefaults:e=>e,mapToWidget:_o,buildCustomWidget:Ao,getChildren:Lo},ps=is("REPEATER"),Eo={itemType:"REPEATER",kind:"input",handler:xo,gsl:ps,gslByUid:(e,t)=>ps(t,(i=>i.uid===e))};function Po(e){const{uid:t,label:i,actionType:a,disabled:r,on:s,onClick:o,data:d,type:p,tags:u,size:h,include:c,exclude:y,states:g,..._}=e;return{uid:t??"",kind:"action",type:"button",disabled:r,actionType:a,label:i,...s!=null?{on:s}:{},props:_}}const Ba=O({itemType:"ACTIONS",kind:"action",entryShape:"bare",mapToWidget:Po,afterMerge:(e,t)=>pa.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)});Ba.gsl,Ba.gslByUid;function Oo(e){const{uid:t,widgetName:i,tags:a,size:r,onChange:s,include:o,exclude:d,...p}=e,{on:u,...h}=p;return{uid:t??"",kind:"layout",type:i??"flex",props:{direction:h.direction??"column",...h},children:[]}}function Io(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"LAYOUTS"),children:i};const a=e.fn;return(r=>{const s=a(r);return{...t.mapStaticDef(s,"LAYOUTS"),children:i}})}function Mo(e){return e.children}const qa=O({itemType:"LAYOUTS",kind:"layout",entryShape:"compound",mapToWidget:Oo,buildCustomWidget:Io,getChildren:Mo});qa.gsl,qa.gslByUid;function Ro(e){return{uid:"",kind:"display",type:"renderer",props:{render:e.render}}}function Fo(e,t){if(e.kind==="static"){const a=e.def;return(r=>({uid:"",kind:"display",type:"renderer",...a.include!=null?{include:a.include}:{},...a.exclude!=null?{exclude:a.exclude}:{},props:{render:a.render(da(r))}}))}const i=e.fn;return(a=>{const r=i(a);return{uid:"",kind:"display",type:"renderer",...r.include!=null?{include:r.include}:{},...r.exclude!=null?{exclude:r.exclude}:{},props:{render:r.render(da(a))}}})}const Na=O({itemType:"DISPLAYS",kind:"display",entryShape:"bare",mapToWidget:Ro,buildCustomWidget:Fo});Na.gsl,Na.gslByUid;const za=O({itemType:"ALERTS",kind:"display",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"alert",props:{text:e.text,...e.level!=null?{level:e.level}:{}}})});za.gsl,za.gslByUid;const Ga=O({itemType:"MARKDOWN_TEXTS",kind:"display",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"markdownText",props:{md:e.md}})});Ga.gsl,Ga.gslByUid;function Bo(e){return{uid:e.uid??"",kind:"layout",type:"tabs",props:{tabs:e.tabs,renderMode:e.renderMode??"all",...e.defaultOpen!=null?{defaultOpen:e.defaultOpen}:{}},children:[]}}function qo(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"TABS"),children:i};const a=e.fn;return(r=>{const s=a(r);return{...t.mapStaticDef(s,"TABS"),children:i}})}function No(e){return e.children}const Va=O({itemType:"TABS",kind:"layout",entryShape:"compound",mapToWidget:Bo,buildCustomWidget:qo,getChildren:No});Va.gsl,Va.gslByUid;function zo(e){return{uid:e.uid??"",kind:"layout",type:"accordion",props:{sections:e.sections,renderMode:e.renderMode??"all",...e.singleOpen!=null?{singleOpen:e.singleOpen}:{},...e.defaultOpen!=null?{defaultOpen:e.defaultOpen}:{}},children:[]}}function Go(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"ACCORDION"),children:i};const a=e.fn;return(r=>{const s=a(r);return{...t.mapStaticDef(s,"ACCORDION"),children:i}})}function Vo(e){return e.children}const Ua=O({itemType:"ACCORDION",kind:"layout",entryShape:"compound",mapToWidget:zo,buildCustomWidget:Go,getChildren:Vo});Ua.gsl,Ua.gslByUid;const Za=O({itemType:"CUSTOM_INPUT",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>X(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:e.customType,path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.defaultValue!=null?{defaultValue:e.defaultValue}:{},...e.validator!=null?{validator:e.validator}:{},props:e.props??{}})});Za.gsl,Za.gslByUid;const Ya=O({itemType:"CUSTOM_ACTION",kind:"action",entryShape:"bare",mapToWidget:e=>{const{uid:t,label:i,disabled:a,on:r,onClick:s,data:o,customType:d,tags:p,size:u,include:h,exclude:c,states:y,props:g,..._}=e;return{uid:t??"",kind:"action",type:e.customType,label:i,disabled:a,...r!=null?{on:r}:{},props:{...g,..._}}},afterMerge:(e,t)=>pa.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)});Ya.gsl,Ya.gslByUid;const Ha=O({itemType:"CUSTOM_DISPLAY",kind:"display",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:e.customType,props:e.props??{}})});Ha.gsl,Ha.gslByUid;function Uo(e){return{uid:e.uid??"",kind:"layout",type:e.customType,props:e.props??{},children:[]}}function Zo(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"CUSTOM_LAYOUT"),children:i};const a=e.fn;return(r=>{const s=a(r);return{...t.mapStaticDef(s,"CUSTOM_LAYOUT"),children:i}})}function Yo(e){return e.children}const Wa=O({itemType:"CUSTOM_LAYOUT",kind:"layout",entryShape:"compound",mapToWidget:Uo,buildCustomWidget:Zo,getChildren:Yo});Wa.gsl,Wa.gslByUid;const Ka=O({itemType:"TAGS",kind:"input",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>je(X(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"tags",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:ie(e.validator,"array")}:{},props:J(e)})});Ka.gsl,Ka.gslByUid;const Ho=[ua,Ba,qa,Na,wa,$a,Ta,ga,ba,ya,ka,Pa,Oa,Ia,fa,_a,ha,ma,Va,Da,Ka,za,Ga,Sa,ca,Ua,Eo,va,Aa,Ea,Ca,La,xa,Ma,Ra,Ha,Za,Ya,Wa],us=jn();for(const e of Ho)eo(us,e);const Wo=bo({registry:us,adapter:{bareItemToWidget:e=>Do(e),rootEntry:e=>{const t={def:{uid:"#root",direction:"column",widgetName:"flex"},children:e};return{type:"ITEMS",itemType:as.LAYOUTS,items:[t],tags:[]}}}}),Ko=vo(Wo);function b(e,t,i){function a(d,p){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:p,constr:o,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,p);const u=o.prototype,h=Object.keys(u);for(let c=0;c<h.length;c++){const y=h[c];y in d||(d[y]=u[y].bind(d))}}const r=i?.Parent??Object;class s extends r{}Object.defineProperty(s,"name",{value:e});function o(d){var p;const u=i?.Parent?new s:this;a(u,d),(p=u._zod).deferred??(p.deferred=[]);for(const h of u._zod.deferred)h();return u}return Object.defineProperty(o,"init",{value:a}),Object.defineProperty(o,Symbol.hasInstance,{value:d=>i?.Parent&&d instanceof i.Parent?!0:d?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class At extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class hs extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Jo={};function Dt(e){return Jo}function Ja(e,t){return typeof t=="bigint"?t.toString():t}function Xa(e){return e==null}function Qa(e){const t=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(t,i)}const cs=Symbol("evaluating");function Q(e,t,i){let a;Object.defineProperty(e,t,{get(){if(a!==cs)return a===void 0&&(a=cs,a=i()),a},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Xo(...e){const t={};for(const i of e){const a=Object.getOwnPropertyDescriptors(i);Object.assign(t,a)}return Object.defineProperties({},t)}function Qo(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ms="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ys(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ja(e){if(ys(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const i=t.prototype;return!(ys(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function gs(e){return ja(e)?{...e}:Array.isArray(e)?[...e]:e}function er(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function bs(e,t,i){const a=new e._zod.constr(t??e._zod.def);return(!t||i?.parent)&&(a._zod.parent=e),a}function z(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}const jo={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ct(e,t=0){if(e.aborted===!0)return!0;for(let i=t;i<e.issues.length;i++)if(e.issues[i]?.continue!==!0)return!0;return!1}function el(e,t){return t.map(i=>{var a;return(a=i).path??(a.path=[]),i.path.unshift(e),i})}function Ai(e){return typeof e=="string"?e:e?.message}function wt(e,t,i){const a={...e,path:e.path??[]};if(!e.message){const r=Ai(e.inst?._zod.def?.error?.(e))??Ai(t?.error?.(e))??Ai(i.customError?.(e))??Ai(i.localeError?.(e))??"Invalid input";a.message=r}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function tr(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Rt(...e){const[t,i,a]=e;return typeof t=="string"?{message:t,code:"custom",input:i,inst:a}:{...t}}const fs=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ja,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},vs=b("$ZodError",fs),Ci=b("$ZodError",fs,{Parent:Error});function tl(e,t=i=>i.message){const i={},a=[];for(const r of e.issues)r.path.length>0?(i[r.path[0]]=i[r.path[0]]||[],i[r.path[0]].push(t(r))):a.push(t(r));return{formErrors:a,fieldErrors:i}}function il(e,t=i=>i.message){const i={_errors:[]},a=r=>{for(const s of r.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(o=>a({issues:o}));else if(s.code==="invalid_key")a({issues:s.issues});else if(s.code==="invalid_element")a({issues:s.issues});else if(s.path.length===0)i._errors.push(t(s));else{let o=i,d=0;for(;d<s.path.length;){const p=s.path[d];d===s.path.length-1?(o[p]=o[p]||{_errors:[]},o[p]._errors.push(t(s))):o[p]=o[p]||{_errors:[]},o=o[p],d++}}};return a(e),i}const Li=e=>(t,i,a,r)=>{const s=a?Object.assign(a,{async:!1}):{async:!1},o=t._zod.run({value:i,issues:[]},s);if(o instanceof Promise)throw new At;if(o.issues.length){const d=new(r?.Err??e)(o.issues.map(p=>wt(p,s,Dt())));throw ms(d,r?.callee),d}return o.value},al=Li(Ci),xi=e=>async(t,i,a,r)=>{const s=a?Object.assign(a,{async:!0}):{async:!0};let o=t._zod.run({value:i,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){const d=new(r?.Err??e)(o.issues.map(p=>wt(p,s,Dt())));throw ms(d,r?.callee),d}return o.value},rl=xi(Ci),Ei=e=>(t,i,a)=>{const r=a?{...a,async:!1}:{async:!1},s=t._zod.run({value:i,issues:[]},r);if(s instanceof Promise)throw new At;return s.issues.length?{success:!1,error:new(e??vs)(s.issues.map(o=>wt(o,r,Dt())))}:{success:!0,data:s.value}},Ds=Ei(Ci),Pi=e=>async(t,i,a)=>{const r=a?Object.assign(a,{async:!0}):{async:!0};let s=t._zod.run({value:i,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(o=>wt(o,r,Dt())))}:{success:!0,data:s.value}},ws=Pi(Ci),sl=e=>(t,i,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Li(e)(t,i,r)},nl=e=>(t,i,a)=>Li(e)(t,i,a),ol=e=>async(t,i,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return xi(e)(t,i,r)},ll=e=>async(t,i,a)=>xi(e)(t,i,a),dl=e=>(t,i,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Ei(e)(t,i,r)},pl=e=>(t,i,a)=>Ei(e)(t,i,a),ul=e=>async(t,i,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Pi(e)(t,i,r)},hl=e=>async(t,i,a)=>Pi(e)(t,i,a),cl=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,$s=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,ml=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,yl=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gl=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,bl=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,ks="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",fl=new RegExp(`^${ks}$`);function Ss(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function vl(e){return new RegExp(`^${Ss(e)}$`)}function Dl(e){const t=Ss({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${i.join("|")})`;return new RegExp(`^${ks}T(?:${a})$`)}const wl=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},$l=/^-?\d+$/,kl=/^-?\d+(?:\.\d+)?$/,Sl=/^(?:true|false)$/i,Tl=/^[^A-Z]*$/,_l=/^[^a-z]*$/,Je=b("$ZodCheck",(e,t)=>{var i;e._zod??(e._zod={}),e._zod.def=t,(i=e._zod).onattach??(i.onattach=[])}),Ts={number:"number",bigint:"bigint",object:"date"},Al=b("$ZodCheckLessThan",(e,t)=>{Je.init(e,t);const i=Ts[typeof t.value];e._zod.onattach.push(a=>{const r=a._zod.bag,s=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:i,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Cl=b("$ZodCheckGreaterThan",(e,t)=>{Je.init(e,t);const i=Ts[typeof t.value];e._zod.onattach.push(a=>{const r=a._zod.bag,s=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:i,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ll=b("$ZodCheckNumberFormat",(e,t)=>{Je.init(e,t),t.format=t.format||"float64";const i=t.format?.includes("int"),a=i?"int":"number",[r,s]=jo[t.format];e._zod.onattach.push(o=>{const d=o._zod.bag;d.format=t.format,d.minimum=r,d.maximum=s,i&&(d.pattern=$l)}),e._zod.check=o=>{const d=o.value;if(i){if(!Number.isInteger(d)){o.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:d,inst:e});return}if(!Number.isSafeInteger(d)){d>0?o.issues.push({input:d,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):o.issues.push({input:d,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort});return}}d<r&&o.issues.push({origin:"number",input:d,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),d>s&&o.issues.push({origin:"number",input:d,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),xl=b("$ZodCheckMaxLength",(e,t)=>{var i;Je.init(e,t),(i=e._zod.def).when??(i.when=a=>{const r=a.value;return!Xa(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const r=a.value;if(r.length<=t.maximum)return;const o=tr(r);a.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),El=b("$ZodCheckMinLength",(e,t)=>{var i;Je.init(e,t),(i=e._zod.def).when??(i.when=a=>{const r=a.value;return!Xa(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const r=a.value;if(r.length>=t.minimum)return;const o=tr(r);a.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Pl=b("$ZodCheckLengthEquals",(e,t)=>{var i;Je.init(e,t),(i=e._zod.def).when??(i.when=a=>{const r=a.value;return!Xa(r)&&r.length!==void 0}),e._zod.onattach.push(a=>{const r=a._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=a=>{const r=a.value,s=r.length;if(s===t.length)return;const o=tr(r),d=s>t.length;a.issues.push({origin:o,...d?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),Oi=b("$ZodCheckStringFormat",(e,t)=>{var i,a;Je.init(e,t),e._zod.onattach.push(r=>{const s=r._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(i=e._zod).check??(i.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),Ol=b("$ZodCheckRegex",(e,t)=>{Oi.init(e,t),e._zod.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Il=b("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Tl),Oi.init(e,t)}),Ml=b("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=_l),Oi.init(e,t)}),Rl=b("$ZodCheckIncludes",(e,t)=>{Je.init(e,t);const i=er(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${i}`:i);t.pattern=a,e._zod.onattach.push(r=>{const s=r._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(a)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),Fl=b("$ZodCheckStartsWith",(e,t)=>{Je.init(e,t);const i=new RegExp(`^${er(t.prefix)}.*`);t.pattern??(t.pattern=i),e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(i)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),Bl=b("$ZodCheckEndsWith",(e,t)=>{Je.init(e,t);const i=new RegExp(`.*${er(t.suffix)}$`);t.pattern??(t.pattern=i),e._zod.onattach.push(a=>{const r=a._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(i)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),ql=b("$ZodCheckOverwrite",(e,t)=>{Je.init(e,t),e._zod.check=i=>{i.value=t.tx(i.value)}}),Nl={major:4,minor:3,patch:6},$e=b("$ZodType",(e,t)=>{var i;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Nl;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const r of a)for(const s of r._zod.onattach)s(e);if(a.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const r=(o,d,p)=>{let u=Ct(o),h;for(const c of d){if(c._zod.def.when){if(!c._zod.def.when(o))continue}else if(u)continue;const y=o.issues.length,g=c._zod.check(o);if(g instanceof Promise&&p?.async===!1)throw new At;if(h||g instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await g,o.issues.length!==y&&(u||(u=Ct(o,y)))});else{if(o.issues.length===y)continue;u||(u=Ct(o,y))}}return h?h.then(()=>o):o},s=(o,d,p)=>{if(Ct(o))return o.aborted=!0,o;const u=r(d,a,p);if(u instanceof Promise){if(p.async===!1)throw new At;return u.then(h=>e._zod.parse(h,p))}return e._zod.parse(u,p)};e._zod.run=(o,d)=>{if(d.skipChecks)return e._zod.parse(o,d);if(d.direction==="backward"){const u=e._zod.parse({value:o.value,issues:[]},{...d,skipChecks:!0});return u instanceof Promise?u.then(h=>s(h,o,d)):s(u,o,d)}const p=e._zod.parse(o,d);if(p instanceof Promise){if(d.async===!1)throw new At;return p.then(u=>r(u,a,d))}return r(p,a,d)}}Q(e,"~standard",()=>({validate:r=>{try{const s=Ds(e,r);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return ws(e,r).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),ir=b("$ZodString",(e,t)=>{$e.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??wl(e._zod.bag),e._zod.parse=(i,a)=>{if(t.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),et=b("$ZodStringFormat",(e,t)=>{Oi.init(e,t),ir.init(e,t)}),zl=b("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=$s(a))}else t.pattern??(t.pattern=$s());et.init(e,t)}),Gl=b("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ml),et.init(e,t)}),Vl=b("$ZodURL",(e,t)=>{et.init(e,t),e._zod.check=i=>{try{const a=i.value.trim(),r=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:i.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:i.value,inst:e,continue:!t.abort})),t.normalize?i.value=r.href:i.value=a;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!t.abort})}}}),Ul=b("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Dl(t)),et.init(e,t)}),Zl=b("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=fl),et.init(e,t)}),Yl=b("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=vl(t)),et.init(e,t)}),Hl=b("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=cl),et.init(e,t)}),Wl=b("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=yl),et.init(e,t),e._zod.bag.format="ipv4"}),Kl=b("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=gl),et.init(e,t),e._zod.bag.format="ipv6",e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!t.abort})}}}),Jl=b("$ZodCustomStringFormat",(e,t)=>{et.init(e,t),e._zod.check=i=>{t.fn(i.value)||i.issues.push({code:"invalid_format",format:t.format,input:i.value,inst:e,continue:!t.abort})}}),_s=b("$ZodNumber",(e,t)=>{$e.init(e,t),e._zod.pattern=e._zod.bag.pattern??kl,e._zod.parse=(i,a)=>{if(t.coerce)try{i.value=Number(i.value)}catch{}const r=i.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return i;const s=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...s?{received:s}:{}}),i}}),Xl=b("$ZodNumberFormat",(e,t)=>{Ll.init(e,t),_s.init(e,t)}),Ql=b("$ZodBoolean",(e,t)=>{$e.init(e,t),e._zod.pattern=Sl,e._zod.parse=(i,a)=>{if(t.coerce)try{i.value=!!i.value}catch{}const r=i.value;return typeof r=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),i}}),jl=b("$ZodAny",(e,t)=>{$e.init(e,t),e._zod.parse=i=>i});function As(e,t,i){e.issues.length&&t.issues.push(...el(i,e.issues)),t.value[i]=e.value}const Cs=b("$ZodArray",(e,t)=>{$e.init(e,t),e._zod.parse=(i,a)=>{const r=i.value;if(!Array.isArray(r))return i.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),i;i.value=Array(r.length);const s=[];for(let o=0;o<r.length;o++){const d=r[o],p=t.element._zod.run({value:d,issues:[]},a);p instanceof Promise?s.push(p.then(u=>As(u,i,o))):As(p,i,o)}return s.length?Promise.all(s).then(()=>i):i}});function Ls(e,t,i,a){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const r=e.filter(s=>!Ct(s));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:i,errors:e.map(s=>s.issues.map(o=>wt(o,a,Dt())))}),t)}const ed=b("$ZodUnion",(e,t)=>{$e.init(e,t),Q(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Q(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Q(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),Q(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${r.map(s=>Qa(s.source)).join("|")})$`)}});const i=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(r,s)=>{if(i)return a(r,s);let o=!1;const d=[];for(const p of t.options){const u=p._zod.run({value:r.value,issues:[]},s);if(u instanceof Promise)d.push(u),o=!0;else{if(u.issues.length===0)return u;d.push(u)}}return o?Promise.all(d).then(p=>Ls(p,r,e,s)):Ls(d,r,e,s)}}),td=b("$ZodIntersection",(e,t)=>{$e.init(e,t),e._zod.parse=(i,a)=>{const r=i.value,s=t.left._zod.run({value:r,issues:[]},a),o=t.right._zod.run({value:r,issues:[]},a);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([p,u])=>xs(i,p,u)):xs(i,s,o)}});function ar(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ja(e)&&ja(t)){const i=Object.keys(t),a=Object.keys(e).filter(s=>i.indexOf(s)!==-1),r={...e,...t};for(const s of a){const o=ar(e[s],t[s]);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};r[s]=o.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let a=0;a<e.length;a++){const r=e[a],s=t[a],o=ar(r,s);if(!o.valid)return{valid:!1,mergeErrorPath:[a,...o.mergeErrorPath]};i.push(o.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function xs(e,t,i){const a=new Map;let r;for(const d of t.issues)if(d.code==="unrecognized_keys"){r??(r=d);for(const p of d.keys)a.has(p)||a.set(p,{}),a.get(p).l=!0}else e.issues.push(d);for(const d of i.issues)if(d.code==="unrecognized_keys")for(const p of d.keys)a.has(p)||a.set(p,{}),a.get(p).r=!0;else e.issues.push(d);const s=[...a].filter(([,d])=>d.l&&d.r).map(([d])=>d);if(s.length&&r&&e.issues.push({...r,keys:s}),Ct(e))return e;const o=ar(t.value,i.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const id=b("$ZodTransform",(e,t)=>{$e.init(e,t),e._zod.parse=(i,a)=>{if(a.direction==="backward")throw new hs(e.constructor.name);const r=t.transform(i.value,i);if(a.async)return(r instanceof Promise?r:Promise.resolve(r)).then(o=>(i.value=o,i));if(r instanceof Promise)throw new At;return i.value=r,i}});function Es(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const rr=b("$ZodOptional",(e,t)=>{$e.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Q(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${Qa(i.source)})?$`):void 0}),e._zod.parse=(i,a)=>{if(t.innerType._zod.optin==="optional"){const r=t.innerType._zod.run(i,a);return r instanceof Promise?r.then(s=>Es(s,i.value)):Es(r,i.value)}return i.value===void 0?i:t.innerType._zod.run(i,a)}}),ad=b("$ZodExactOptional",(e,t)=>{rr.init(e,t),Q(e._zod,"values",()=>t.innerType._zod.values),Q(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(i,a)=>t.innerType._zod.run(i,a)}),rd=b("$ZodNullable",(e,t)=>{$e.init(e,t),Q(e._zod,"optin",()=>t.innerType._zod.optin),Q(e._zod,"optout",()=>t.innerType._zod.optout),Q(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${Qa(i.source)}|null)$`):void 0}),Q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(i,a)=>i.value===null?i:t.innerType._zod.run(i,a)}),sd=b("$ZodDefault",(e,t)=>{$e.init(e,t),e._zod.optin="optional",Q(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,a)=>{if(a.direction==="backward")return t.innerType._zod.run(i,a);if(i.value===void 0)return i.value=t.defaultValue,i;const r=t.innerType._zod.run(i,a);return r instanceof Promise?r.then(s=>Ps(s,t)):Ps(r,t)}});function Ps(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const nd=b("$ZodPrefault",(e,t)=>{$e.init(e,t),e._zod.optin="optional",Q(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,a)=>(a.direction==="backward"||i.value===void 0&&(i.value=t.defaultValue),t.innerType._zod.run(i,a))}),od=b("$ZodNonOptional",(e,t)=>{$e.init(e,t),Q(e._zod,"values",()=>{const i=t.innerType._zod.values;return i?new Set([...i].filter(a=>a!==void 0)):void 0}),e._zod.parse=(i,a)=>{const r=t.innerType._zod.run(i,a);return r instanceof Promise?r.then(s=>Os(s,e)):Os(r,e)}});function Os(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const ld=b("$ZodCatch",(e,t)=>{$e.init(e,t),Q(e._zod,"optin",()=>t.innerType._zod.optin),Q(e._zod,"optout",()=>t.innerType._zod.optout),Q(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,a)=>{if(a.direction==="backward")return t.innerType._zod.run(i,a);const r=t.innerType._zod.run(i,a);return r instanceof Promise?r.then(s=>(i.value=s.value,s.issues.length&&(i.value=t.catchValue({...i,error:{issues:s.issues.map(o=>wt(o,a,Dt()))},input:i.value}),i.issues=[]),i)):(i.value=r.value,r.issues.length&&(i.value=t.catchValue({...i,error:{issues:r.issues.map(s=>wt(s,a,Dt()))},input:i.value}),i.issues=[]),i)}}),dd=b("$ZodPipe",(e,t)=>{$e.init(e,t),Q(e._zod,"values",()=>t.in._zod.values),Q(e._zod,"optin",()=>t.in._zod.optin),Q(e._zod,"optout",()=>t.out._zod.optout),Q(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(i,a)=>{if(a.direction==="backward"){const s=t.out._zod.run(i,a);return s instanceof Promise?s.then(o=>Ii(o,t.in,a)):Ii(s,t.in,a)}const r=t.in._zod.run(i,a);return r instanceof Promise?r.then(s=>Ii(s,t.out,a)):Ii(r,t.out,a)}});function Ii(e,t,i){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},i)}const pd=b("$ZodReadonly",(e,t)=>{$e.init(e,t),Q(e._zod,"propValues",()=>t.innerType._zod.propValues),Q(e._zod,"values",()=>t.innerType._zod.values),Q(e._zod,"optin",()=>t.innerType?._zod?.optin),Q(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(i,a)=>{if(a.direction==="backward")return t.innerType._zod.run(i,a);const r=t.innerType._zod.run(i,a);return r instanceof Promise?r.then(Is):Is(r)}});function Is(e){return e.value=Object.freeze(e.value),e}const Ms=b("$ZodCustom",(e,t)=>{Je.init(e,t),$e.init(e,t),e._zod.parse=(i,a)=>i,e._zod.check=i=>{const a=i.value,r=t.fn(a);if(r instanceof Promise)return r.then(s=>Rs(s,i,a,e));Rs(r,i,a,e)}});function Rs(e,t,i,a){if(!e){const r={code:"custom",input:i,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(r.params=a._zod.def.params),t.issues.push(Rt(r))}}var Fs;class ud{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...i){const a=i[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const i=this._map.get(t);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(t),this}get(t){const i=t._zod.parent;if(i){const a={...this.get(i)??{}};delete a.id;const r={...a,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function hd(){return new ud}(Fs=globalThis).__zod_globalRegistry??(Fs.__zod_globalRegistry=hd());const Ft=globalThis.__zod_globalRegistry;function cd(e,t){return new e({type:"string",...z(t)})}function md(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...z(t)})}function yd(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...z(t)})}function gd(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...z(t)})}function bd(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...z(t)})}function fd(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...z(t)})}function vd(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...z(t)})}function Dd(e,t){return new e({type:"string",format:"date",check:"string_format",...z(t)})}function wd(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...z(t)})}function $d(e,t){return new e({type:"string",format:"duration",check:"string_format",...z(t)})}function kd(e,t){return new e({type:"number",checks:[],...z(t)})}function Sd(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...z(t)})}function Td(e,t){return new e({type:"boolean",...z(t)})}function _d(e){return new e({type:"any"})}function Ad(e,t){return new Al({check:"less_than",...z(t),value:e,inclusive:!0})}function Cd(e,t){return new Cl({check:"greater_than",...z(t),value:e,inclusive:!0})}function Mi(e,t){return new xl({check:"max_length",...z(t),maximum:e})}function Lt(e,t){return new El({check:"min_length",...z(t),minimum:e})}function Bs(e,t){return new Pl({check:"length_equals",...z(t),length:e})}function qs(e,t){return new Ol({check:"string_format",format:"regex",...z(t),pattern:e})}function Ld(e){return new Il({check:"string_format",format:"lowercase",...z(e)})}function xd(e){return new Ml({check:"string_format",format:"uppercase",...z(e)})}function Ed(e,t){return new Rl({check:"string_format",format:"includes",...z(t),includes:e})}function Pd(e,t){return new Fl({check:"string_format",format:"starts_with",...z(t),prefix:e})}function Od(e,t){return new Bl({check:"string_format",format:"ends_with",...z(t),suffix:e})}function xt(e){return new ql({check:"overwrite",tx:e})}function Id(e){return xt(t=>t.normalize(e))}function Md(){return xt(e=>e.trim())}function Rd(){return xt(e=>e.toLowerCase())}function Fd(){return xt(e=>e.toUpperCase())}function Bd(){return xt(e=>Qo(e))}function qd(e,t,i){return new e({type:"array",element:t,...z(i)})}function Ns(e,t,i){return new e({type:"custom",check:"custom",fn:t,...z(i)})}function zs(e){const t=Nd(i=>(i.addIssue=a=>{if(typeof a=="string")i.issues.push(Rt(a,i.value,t._zod.def));else{const r=a;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=i.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),i.issues.push(Rt(r))}},e(i.value,i)));return t}function Nd(e,t){const i=new Je({check:"custom",...z(t)});return i._zod.check=e,i}function zd(e,t,i,a={}){const r=z(a),s={...z(a),check:"string_format",type:"string",format:t,fn:typeof i=="function"?i:d=>i.test(d),...r};return i instanceof RegExp&&(s.pattern=i),new e(s)}function Gs(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Ft,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function ze(e,t,i={path:[],schemaPath:[]}){var a;const r=e._zod.def,s=t.seen.get(e);if(s)return s.count++,i.schemaPath.includes(e)&&(s.cycle=i.path),s.schema;const o={schema:{},count:1,cycle:void 0,path:i.path};t.seen.set(e,o);const d=e._zod.toJSONSchema?.();if(d)o.schema=d;else{const h={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,h);else{const y=o.schema,g=t.processors[r.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);g(e,t,y,h)}const c=e._zod.parent;c&&(o.ref||(o.ref=c),ze(c,t,h),t.seen.get(c).isParent=!0)}const p=t.metadataRegistry.get(e);return p&&Object.assign(o.schema,p),t.io==="input"&&Ge(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((a=o.schema).default??(a.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Vs(e,t){const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const o of e.seen.entries()){const d=e.metadataRegistry.get(o[0])?.id;if(d){const p=a.get(d);if(p&&p!==o[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(d,o[0])}}const r=o=>{const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const c=e.external.registry.get(o[0])?.id,y=e.external.uri??(_=>_);if(c)return{ref:y(c)};const g=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=g,{defId:g,ref:`${y("__shared")}#/${d}/${g}`}}if(o[1]===i)return{ref:"#"};const u=`#/${d}/`,h=o[1].schema.id??`__schema${e.counter++}`;return{defId:h,ref:u+h}},s=o=>{if(o[1].schema.$ref)return;const d=o[1],{ref:p,defId:u}=r(o);d.def={...d.schema},u&&(d.defId=u);const h=d.schema;for(const c in h)delete h[c];h.$ref=p};if(e.cycles==="throw")for(const o of e.seen.entries()){const d=o[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
2
+
3
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const d=o[1];if(t===o[0]){s(o);continue}if(e.external){const u=e.external.registry.get(o[0])?.id;if(t!==o[0]&&u){s(o);continue}}if(e.metadataRegistry.get(o[0])?.id){s(o);continue}if(d.cycle){s(o);continue}if(d.count>1&&e.reused==="ref"){s(o);continue}}}function Us(e,t){const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=o=>{const d=e.seen.get(o);if(d.ref===null)return;const p=d.def??d.schema,u={...p},h=d.ref;if(d.ref=null,h){a(h);const y=e.seen.get(h),g=y.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(g)):Object.assign(p,g),Object.assign(p,u),o._zod.parent===h)for(const x in p)x==="$ref"||x==="allOf"||x in u||delete p[x];if(g.$ref&&y.def)for(const x in p)x==="$ref"||x==="allOf"||x in y.def&&JSON.stringify(p[x])===JSON.stringify(y.def[x])&&delete p[x]}const c=o._zod.parent;if(c&&c!==h){a(c);const y=e.seen.get(c);if(y?.schema.$ref&&(p.$ref=y.schema.$ref,y.def))for(const g in p)g==="$ref"||g==="allOf"||g in y.def&&JSON.stringify(p[g])===JSON.stringify(y.def[g])&&delete p[g]}e.override({zodSchema:o,jsonSchema:p,path:d.path??[]})};for(const o of[...e.seen.entries()].reverse())a(o[0]);const r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const o=e.external.registry.get(t)?.id;if(!o)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(o)}Object.assign(r,i.def??i.schema);const s=e.external?.defs??{};for(const o of e.seen.entries()){const d=o[1];d.def&&d.defId&&(s[d.defId]=d.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?r.$defs=s:r.definitions=s);try{const o=JSON.parse(JSON.stringify(r));return Object.defineProperty(o,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ri(t,"input",e.processors),output:Ri(t,"output",e.processors)}},enumerable:!1,writable:!1}),o}catch{throw new Error("Error converting schema to JSON.")}}function Ge(e,t){const i=t??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return Ge(a.element,i);if(a.type==="set")return Ge(a.valueType,i);if(a.type==="lazy")return Ge(a.getter(),i);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return Ge(a.innerType,i);if(a.type==="intersection")return Ge(a.left,i)||Ge(a.right,i);if(a.type==="record"||a.type==="map")return Ge(a.keyType,i)||Ge(a.valueType,i);if(a.type==="pipe")return Ge(a.in,i)||Ge(a.out,i);if(a.type==="object"){for(const r in a.shape)if(Ge(a.shape[r],i))return!0;return!1}if(a.type==="union"){for(const r of a.options)if(Ge(r,i))return!0;return!1}if(a.type==="tuple"){for(const r of a.items)if(Ge(r,i))return!0;return!!(a.rest&&Ge(a.rest,i))}return!1}const Gd=(e,t={})=>i=>{const a=Gs({...i,processors:t});return ze(e,a),Vs(a,e),Us(a,e)},Ri=(e,t,i={})=>a=>{const{libraryOptions:r,target:s}=a??{},o=Gs({...r??{},target:s,io:t,processors:i});return ze(e,o),Vs(o,e),Us(o,e)},Vd={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ud=(e,t,i,a)=>{const r=i;r.type="string";const{minimum:s,maximum:o,format:d,patterns:p,contentEncoding:u}=e._zod.bag;if(typeof s=="number"&&(r.minLength=s),typeof o=="number"&&(r.maxLength=o),d&&(r.format=Vd[d]??d,r.format===""&&delete r.format,d==="time"&&delete r.format),u&&(r.contentEncoding=u),p&&p.size>0){const h=[...p];h.length===1?r.pattern=h[0].source:h.length>1&&(r.allOf=[...h.map(c=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:c.source}))])}},Zd=(e,t,i,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Yd=(e,t,i,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Hd=(e,t,i,a)=>{const r=i,s=e._zod.def,{minimum:o,maximum:d}=e._zod.bag;typeof o=="number"&&(r.minItems=o),typeof d=="number"&&(r.maxItems=d),r.type="array",r.items=ze(s.element,t,{...a,path:[...a.path,"items"]})},Wd=(e,t,i,a)=>{const r=e._zod.def,s=r.inclusive===!1,o=r.options.map((d,p)=>ze(d,t,{...a,path:[...a.path,s?"oneOf":"anyOf",p]}));s?i.oneOf=o:i.anyOf=o},Kd=(e,t,i,a)=>{const r=e._zod.def,s=ze(r.left,t,{...a,path:[...a.path,"allOf",0]}),o=ze(r.right,t,{...a,path:[...a.path,"allOf",1]}),d=u=>"allOf"in u&&Object.keys(u).length===1,p=[...d(s)?s.allOf:[s],...d(o)?o.allOf:[o]];i.allOf=p},Jd=(e,t,i,a)=>{const r=e._zod.def,s=ze(r.innerType,t,a),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=r.innerType,i.nullable=!0):i.anyOf=[s,{type:"null"}]},Xd=(e,t,i,a)=>{const r=e._zod.def;ze(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType},Qd=(e,t,i,a)=>{const r=e._zod.def;ze(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType,i.default=JSON.parse(JSON.stringify(r.defaultValue))},jd=(e,t,i,a)=>{const r=e._zod.def;ze(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType,t.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},ep=(e,t,i,a)=>{const r=e._zod.def;ze(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType;let o;try{o=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=o},tp=(e,t,i,a)=>{const r=e._zod.def,s=t.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;ze(s,t,a);const o=t.seen.get(e);o.ref=s},ip=(e,t,i,a)=>{const r=e._zod.def;ze(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType,i.readOnly=!0},Zs=(e,t,i,a)=>{const r=e._zod.def;ze(r.innerType,t,a);const s=t.seen.get(e);s.ref=r.innerType},ap=b("ZodISODateTime",(e,t)=>{Ul.init(e,t),Fi.init(e,t)});function rp(e){return vd(ap,e)}const sp=b("ZodISODate",(e,t)=>{Zl.init(e,t),Fi.init(e,t)});function np(e){return Dd(sp,e)}const op=b("ZodISOTime",(e,t)=>{Yl.init(e,t),Fi.init(e,t)});function lp(e){return wd(op,e)}const dp=b("ZodISODuration",(e,t)=>{Hl.init(e,t),Fi.init(e,t)});function pp(e){return $d(dp,e)}const tt=b("ZodError",(e,t)=>{vs.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>il(e,i)},flatten:{value:i=>tl(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,Ja,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,Ja,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),up=Li(tt),hp=xi(tt),cp=Ei(tt),mp=Pi(tt),yp=sl(tt),gp=nl(tt),bp=ol(tt),fp=ll(tt),vp=dl(tt),Dp=pl(tt),wp=ul(tt),$p=hl(tt),Ve=b("ZodType",(e,t)=>($e.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Ri(e,"input"),output:Ri(e,"output")}}),e.toJSONSchema=Gd(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...i)=>e.clone(Xo(t,{checks:[...t.checks??[],...i.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(i,a)=>bs(e,i,a),e.brand=()=>e,e.register=((i,a)=>(i.add(e,a),e)),e.parse=(i,a)=>up(e,i,a,{callee:e.parse}),e.safeParse=(i,a)=>cp(e,i,a),e.parseAsync=async(i,a)=>hp(e,i,a,{callee:e.parseAsync}),e.safeParseAsync=async(i,a)=>mp(e,i,a),e.spa=e.safeParseAsync,e.encode=(i,a)=>yp(e,i,a),e.decode=(i,a)=>gp(e,i,a),e.encodeAsync=async(i,a)=>bp(e,i,a),e.decodeAsync=async(i,a)=>fp(e,i,a),e.safeEncode=(i,a)=>vp(e,i,a),e.safeDecode=(i,a)=>Dp(e,i,a),e.safeEncodeAsync=async(i,a)=>wp(e,i,a),e.safeDecodeAsync=async(i,a)=>$p(e,i,a),e.refine=(i,a)=>e.check(Wp(i,a)),e.superRefine=i=>e.check(Kp(i)),e.overwrite=i=>e.check(xt(i)),e.optional=()=>Ys(e),e.exactOptional=()=>Ip(e),e.nullable=()=>Hs(e),e.nullish=()=>Ys(Hs(e)),e.nonoptional=i=>zp(e,i),e.array=()=>Tp(e),e.or=i=>Ap([e,i]),e.and=i=>Lp(e,i),e.transform=i=>Ws(e,Ep(i)),e.default=i=>Fp(e,i),e.prefault=i=>qp(e,i),e.catch=i=>Vp(e,i),e.pipe=i=>Ws(e,i),e.readonly=()=>Yp(e),e.describe=i=>{const a=e.clone();return Ft.add(a,{description:i}),a},Object.defineProperty(e,"description",{get(){return Ft.get(e)?.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return Ft.get(e);const a=e.clone();return Ft.add(a,i[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=i=>i(e),e)),kp=b("_ZodString",(e,t)=>{ir.init(e,t),Ve.init(e,t),e._zod.processJSONSchema=(a,r,s)=>Ud(e,a,r);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...a)=>e.check(qs(...a)),e.includes=(...a)=>e.check(Ed(...a)),e.startsWith=(...a)=>e.check(Pd(...a)),e.endsWith=(...a)=>e.check(Od(...a)),e.min=(...a)=>e.check(Lt(...a)),e.max=(...a)=>e.check(Mi(...a)),e.length=(...a)=>e.check(Bs(...a)),e.nonempty=(...a)=>e.check(Lt(1,...a)),e.lowercase=a=>e.check(Ld(a)),e.uppercase=a=>e.check(xd(a)),e.trim=()=>e.check(Md()),e.normalize=(...a)=>e.check(Id(...a)),e.toLowerCase=()=>e.check(Rd()),e.toUpperCase=()=>e.check(Fd()),e.slugify=()=>e.check(Bd())}),Fi=b("ZodStringFormat",(e,t)=>{et.init(e,t),kp.init(e,t)}),Sp=b("ZodArray",(e,t)=>{Cs.init(e,t),Ve.init(e,t),e._zod.processJSONSchema=(i,a,r)=>Hd(e,i,a,r),e.element=t.element,e.min=(i,a)=>e.check(Lt(i,a)),e.nonempty=i=>e.check(Lt(1,i)),e.max=(i,a)=>e.check(Mi(i,a)),e.length=(i,a)=>e.check(Bs(i,a)),e.unwrap=()=>e.element});function Tp(e,t){return qd(Sp,e,t)}const _p=b("ZodUnion",(e,t)=>{ed.init(e,t),Ve.init(e,t),e._zod.processJSONSchema=(i,a,r)=>Wd(e,i,a,r),e.options=t.options});function Ap(e,t){return new _p({type:"union",options:e,...z(t)})}const Cp=b("ZodIntersection",(e,t)=>{td.init(e,t),Ve.init(e,t),e._zod.processJSONSchema=(i,a,r)=>Kd(e,i,a,r)});function Lp(e,t){return new Cp({type:"intersection",left:e,right:t})}const xp=b("ZodTransform",(e,t)=>{id.init(e,t),Ve.init(e,t),e._zod.processJSONSchema=(i,a,r)=>Yd(e,i),e._zod.parse=(i,a)=>{if(a.direction==="backward")throw new hs(e.constructor.name);i.addIssue=s=>{if(typeof s=="string")i.issues.push(Rt(s,i.value,t));else{const o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=i.value),o.inst??(o.inst=e),i.issues.push(Rt(o))}};const r=t.transform(i.value,i);return r instanceof Promise?r.then(s=>(i.value=s,i)):(i.value=r,i)}});function Ep(e){return new xp({type:"transform",transform:e})}const Pp=b("ZodOptional",(e,t)=>{rr.init(e,t),Ve.init(e,t),e._zod.processJSONSchema=(i,a,r)=>Zs(e,i,a,r),e.unwrap=()=>e._zod.def.innerType});function Ys(e){return new Pp({type:"optional",innerType:e})}const Op=b("ZodExactOptional",(e,t)=>{ad.init(e,t),Ve.init(e,t),e._zod.processJSONSchema=(i,a,r)=>Zs(e,i,a,r),e.unwrap=()=>e._zod.def.innerType});function Ip(e){return new Op({type:"optional",innerType:e})}const Mp=b("ZodNullable",(e,t)=>{rd.init(e,t),Ve.init(e,t),e._zod.processJSONSchema=(i,a,r)=>Jd(e,i,a,r),e.unwrap=()=>e._zod.def.innerType});function Hs(e){return new Mp({type:"nullable",innerType:e})}const Rp=b("ZodDefault",(e,t)=>{sd.init(e,t),Ve.init(e,t),e._zod.processJSONSchema=(i,a,r)=>Qd(e,i,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Fp(e,t){return new Rp({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():gs(t)}})}const Bp=b("ZodPrefault",(e,t)=>{nd.init(e,t),Ve.init(e,t),e._zod.processJSONSchema=(i,a,r)=>jd(e,i,a,r),e.unwrap=()=>e._zod.def.innerType});function qp(e,t){return new Bp({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():gs(t)}})}const Np=b("ZodNonOptional",(e,t)=>{od.init(e,t),Ve.init(e,t),e._zod.processJSONSchema=(i,a,r)=>Xd(e,i,a,r),e.unwrap=()=>e._zod.def.innerType});function zp(e,t){return new Np({type:"nonoptional",innerType:e,...z(t)})}const Gp=b("ZodCatch",(e,t)=>{ld.init(e,t),Ve.init(e,t),e._zod.processJSONSchema=(i,a,r)=>ep(e,i,a,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Vp(e,t){return new Gp({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Up=b("ZodPipe",(e,t)=>{dd.init(e,t),Ve.init(e,t),e._zod.processJSONSchema=(i,a,r)=>tp(e,i,a,r),e.in=t.in,e.out=t.out});function Ws(e,t){return new Up({type:"pipe",in:e,out:t})}const Zp=b("ZodReadonly",(e,t)=>{pd.init(e,t),Ve.init(e,t),e._zod.processJSONSchema=(i,a,r)=>ip(e,i,a,r),e.unwrap=()=>e._zod.def.innerType});function Yp(e){return new Zp({type:"readonly",innerType:e})}const Hp=b("ZodCustom",(e,t)=>{Ms.init(e,t),Ve.init(e,t),e._zod.processJSONSchema=(i,a,r)=>Zd(e,i)});function Wp(e,t={}){return Ns(Hp,e,t)}function Kp(e){return zs(e)}const $t=b("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");$e.init(e,t),e.def=t,e.type=t.type,e.parse=(i,a)=>al(e,i,a,{callee:e.parse}),e.safeParse=(i,a)=>Ds(e,i,a),e.parseAsync=async(i,a)=>rl(e,i,a,{callee:e.parseAsync}),e.safeParseAsync=async(i,a)=>ws(e,i,a),e.check=(...i)=>e.clone({...t,checks:[...t.checks??[],...i.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]},{parent:!0}),e.with=e.check,e.clone=(i,a)=>bs(e,i,a),e.brand=()=>e,e.register=((i,a)=>(i.add(e,a),e)),e.apply=i=>i(e)}),Ks=b("ZodMiniString",(e,t)=>{ir.init(e,t),$t.init(e,t)});function Js(e){return cd(Ks,e)}const Et=b("ZodMiniStringFormat",(e,t)=>{et.init(e,t),Ks.init(e,t)}),Jp=b("ZodMiniEmail",(e,t)=>{Gl.init(e,t),Et.init(e,t)});function Xp(e){return md(Jp,e)}const Qp=b("ZodMiniUUID",(e,t)=>{zl.init(e,t),Et.init(e,t)});function jp(e){return yd(Qp,e)}const eu=b("ZodMiniURL",(e,t)=>{Vl.init(e,t),Et.init(e,t)});function tu(e){return gd(eu,e)}const iu=b("ZodMiniIPv4",(e,t)=>{Wl.init(e,t),Et.init(e,t)});function au(e){return bd(iu,e)}const ru=b("ZodMiniIPv6",(e,t)=>{Kl.init(e,t),Et.init(e,t)});function su(e){return fd(ru,e)}const nu=b("ZodMiniCustomStringFormat",(e,t)=>{Jl.init(e,t),Et.init(e,t)});function ou(e){return zd(nu,"hostname",bl,e)}const Xs=b("ZodMiniNumber",(e,t)=>{_s.init(e,t),$t.init(e,t)});function Qs(e){return kd(Xs,e)}const lu=b("ZodMiniNumberFormat",(e,t)=>{Xl.init(e,t),Xs.init(e,t)});function du(e){return Sd(lu,e)}const pu=b("ZodMiniBoolean",(e,t)=>{Ql.init(e,t),$t.init(e,t)});function js(e){return Td(pu,e)}const uu=b("ZodMiniAny",(e,t)=>{jl.init(e,t),$t.init(e,t)});function sr(){return _d(uu)}const hu=b("ZodMiniArray",(e,t)=>{Cs.init(e,t),$t.init(e,t)});function en(e,t){return new hu({type:"array",element:e,...z(t)})}const cu=b("ZodMiniOptional",(e,t)=>{rr.init(e,t),$t.init(e,t)});function mu(e){return new cu({type:"optional",innerType:e})}const yu=b("ZodMiniCustom",(e,t)=>{Ms.init(e,t),$t.init(e,t)});function Pe(e,t={}){return Ns(yu,e,t)}function tn(e){return zs(e)}const nr={email:{schema:Xp()},hostname:{schema:ou()},ipv4:{schema:au()},ipv6:{schema:su()},url:{schema:tu()},uuid:{schema:jp()},date:{schema:np()},time:{schema:lp()},"date-time":{schema:rp({local:!0,offset:!0})},duration:{schema:pp()}},an=Object.keys(nr),gu=e=>(t,i)=>{switch(t.type){case"string":return bu(t,i);case"integer":case"number":return vu(t,i);case"boolean":return Du(t,i);case"array":return wu(t,i);case"custom":{if(!e)throw new Error('Validator type "custom" requires a customValidators object, but it was not supplied.');return $u(t,e)}default:{const a=t;throw new Error(`Unknown validator config: ${JSON.stringify(a)}. The "type" property must be one of: "string", "number", "integer", "boolean", "array", "custom".`)}}};function ue(e,t){if(e!==void 0)return typeof e=="string"?e:t?.translate(e.key,e.params,e.default)??e.default}function bu(e,t){return Bt(e,i=>{const a=ue(i.messages?.invalid,t);let r=a?Js(a):Js();if(i.required===!0){const s=ue(i.messages?.required,t)??"This field is required";r=r.check(Pe(o=>o.length>0,{error:s}))}if(typeof i.minLength=="number"){const s=ue(i.messages?.minLength,t),o=i.minLength;r=r.check(s?Pe(d=>d.length>=o,{error:s}):Lt(o))}if(typeof i.maxLength=="number"){const s=ue(i.messages?.maxLength,t),o=i.maxLength;r=r.check(s?Pe(d=>d.length<=o,{error:s}):Mi(o))}if(typeof i.pattern=="string"){const s=ue(i.messages?.pattern,t),o=new RegExp(i.pattern);r=r.check(s?Pe(d=>o.test(d),{error:s}):qs(o))}if(i.enum){const s=i.enum,o=ue(i.messages?.enum,t);r=r.check(Pe(d=>s.includes(d),o?{error:o}:void 0))}if(i.const!==void 0){const s=ue(i.messages?.const,t);r=r.check(Pe(o=>o===i.const,s?{error:s}:void 0))}if(i.format!==void 0)if(an.includes(i.format)){const s=ue(i.messages?.format,t);r=r.check(s?tn((o,d)=>{const p=dt.standardValidate(nr[i.format].schema,o);dt.isStandardValidateSuccess(p)||d.addIssue({code:"custom",path:[],message:s})}):nr[i.format].schema)}else throw new Error(`Unknown string validation format: ${JSON.stringify(i.format)}. The "format" property must be one of: ${an.map(s=>`"${s}"`).join(", ")}.`);return r})}const fu=(e,t)=>{if(t===0)return!1;const i=e/t;return Math.abs(i-Math.round(i))<1e-10};function vu(e,t){return Bt(e,i=>{const a=ue(i.messages?.invalid,t);let r=a?Qs(a):Qs();if(i.type==="integer"&&(r=r.check(du())),i.minimum!==void 0){const s=ue(i.messages?.minimum,t),o=i.minimum;r=r.check(s?Pe(d=>d>=o,{error:s}):Cd(o))}if(i.maximum!==void 0){const s=ue(i.messages?.maximum,t),o=i.maximum;r=r.check(s?Pe(d=>d<=o,{error:s}):Ad(o))}if(i.exclusiveMinimum!==void 0){const s=ue(i.messages?.exclusiveMinimum,t),o=i.exclusiveMinimum;r=r.check(Pe(d=>d>o,s?{error:s}:void 0))}if(i.exclusiveMaximum!==void 0){const s=ue(i.messages?.exclusiveMaximum,t),o=i.exclusiveMaximum;r=r.check(Pe(d=>d<o,s?{error:s}:void 0))}if(i.multipleOf!==void 0){const s=ue(i.messages?.multipleOf,t),o=i.multipleOf;r=r.check(Pe(d=>fu(d,o),s?{error:s}:void 0))}if(i.enum){const s=i.enum,o=ue(i.messages?.enum,t);r=r.check(Pe(d=>s.includes(d),o?{error:o}:void 0))}if(i.const!==void 0){const s=ue(i.messages?.const,t);r=r.check(Pe(o=>o===i.const,s?{error:s}:void 0))}return r})}function Du(e,t){return Bt(e,i=>{const a=ue(i.messages?.invalid,t);let r=a?js(a):js();if(i.const!==void 0){const s=ue(i.messages?.const,t);r=r.check(Pe(o=>o===i.const,s?{error:s}:void 0))}return r})}function wu(e,t){return Bt(e,i=>{const a=ue(i.messages?.invalid,t);let r=a?en(sr(),a):en(sr());if(i.required===!0){const s=ue(i.messages?.required,t)??"This field is required";r=r.check(Pe(o=>o.length>0,{error:s}))}if(typeof i.minItems=="number"){const s=ue(i.messages?.minItems,t),o=i.minItems;r=r.check(s?Pe(d=>d.length>=o,{error:s}):Lt(o))}if(typeof i.maxItems=="number"){const s=ue(i.messages?.maxItems,t),o=i.maxItems;r=r.check(s?Pe(d=>d.length<=o,{error:s}):Mi(o))}return r})}function $u(e,t){return Bt(e,i=>{let a=sr();return dt.filterTap(Object.keys(i),r=>r!=="type"&&r!=="required",r=>{const s=i[r],o=t[r];if(!o){const p=Object.keys(t).map(u=>`"${u}"`).join(", ");throw new Error(`Unknown custom validator rule "${r}". Registered rules: ${p||"(none)"}.`)}const d=o(s);a=a.check(tn((p,u)=>{const h=dt.standardValidate(d,p);if(!dt.isStandardValidateSuccess(h)){const c=h.issues[0];u.addIssue({code:"custom",path:[],message:c?.message||`Validation failed for ${r}`})}}))}),a})}function Bt(e,t){const i=t(e);return e.required?i:mu(i)}const ku=e=>e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"label")&&Object.prototype.hasOwnProperty.call(e,"value");function Su(e,t){if(e!=null&&typeof e=="object"&&"__rid"in e)return e.__rid;const i=t();return Object.defineProperty(e,"__rid",{value:i,enumerable:!1,configurable:!1}),i}const rn={button:async()=>(await Promise.resolve().then(()=>Eu)).ButtonElement,calendar:async()=>(await Promise.resolve().then(()=>eh)).CalendarElement,dateTimeCalendar:async()=>(await Promise.resolve().then(()=>_h)).DateTimeCalendarElement,rangeCalendar:async()=>(await Promise.resolve().then(()=>Oh)).RangeCalendarElement,rangeDateInput:async()=>(await Promise.resolve().then(()=>qh)).RangeDateInputElement,rangeTimeInput:async()=>(await Promise.resolve().then(()=>Uh)).RangeTimeInputElement,rangeDateTimeInput:async()=>(await Promise.resolve().then(()=>Kh)).RangeDateTimeInputElement,rangeDateTimeCalendar:async()=>(await Promise.resolve().then(()=>ec)).RangeDateTimeCalendarElement,rangeDateTimePicker:async()=>(await Promise.resolve().then(()=>sc)).RangeDateTimePickerElement,rangeDatePicker:async()=>(await Promise.resolve().then(()=>pc)).RangeDatePickerElement,rangeTimePicker:async()=>(await Promise.resolve().then(()=>yc)).RangeTimePickerElement,currency:async()=>(await Promise.resolve().then(()=>Dc)).CurrencyElement,dateInput:async()=>(await Promise.resolve().then(()=>Tc)).DateElement,datePicker:async()=>(await Promise.resolve().then(()=>xc)).DatePickerElement,dateTimePicker:async()=>(await Promise.resolve().then(()=>Fc)).DateTimePickerElement,dropdown:async()=>(await Promise.resolve().then(()=>Xc)).DropdownElement,list:async()=>(await Promise.resolve().then(()=>em)).ListElement,markdown:async()=>(await Promise.resolve().then(()=>om)).MarkdownElement,password:async()=>(await Promise.resolve().then(()=>hm)).PasswordElement,textinput:async()=>(await Promise.resolve().then(()=>bm)).TextinputElement,timeInput:async()=>(await Promise.resolve().then(()=>Dm)).TimeElement,timePicker:async()=>(await Promise.resolve().then(()=>km)).TimePickerElement,dateTimeInput:async()=>(await Promise.resolve().then(()=>_m)).DateTimeElement,textarea:async()=>(await Promise.resolve().then(()=>Em)).TextareaElement,toggle:async()=>(await Promise.resolve().then(()=>Rm)).ToggleElement,checkbox:async()=>(await Promise.resolve().then(()=>zm)).CheckboxElement,number:async()=>(await Promise.resolve().then(()=>Ym)).NumberElement,radiogroup:async()=>(await Promise.resolve().then(()=>ey)).RadiogroupElement,select:async()=>(await Promise.resolve().then(()=>sy)).SelectElement,tags:async()=>(await Promise.resolve().then(()=>uy)).TagsElement,repeater:async()=>(await Promise.resolve().then(()=>gy)).RepeaterElement,flex:async()=>(await Promise.resolve().then(()=>vy)).FlexElement,grid:async()=>(await Promise.resolve().then(()=>$y)).GridElement,tabs:async()=>(await Promise.resolve().then(()=>Ty)).TabsElement,accordion:async()=>(await Promise.resolve().then(()=>Cy)).AccordionElement,alert:async()=>(await Promise.resolve().then(()=>Ey)).AlertElement,markdownText:async()=>(await Promise.resolve().then(()=>Iy)).MarkdownTextElement,renderer:async()=>(await Promise.resolve().then(()=>Fy)).RendererElement};var Tu=Object.defineProperty,_u=Object.getOwnPropertyDescriptor,qt=(e,t,i,a)=>{for(var r=a>1?void 0:a?_u(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Tu(t,i,r),r};te.FormElement=class extends l.LitElement{constructor(){super(...arguments),this.autocomplete=void 0}setData(t){this.coreForm?.setData(t)}setMeta(t){this.coreForm?.setMeta(t)}createRenderRoot(){return this}render(){const t=this.config,i=Ko(t.formDef,t.formSelectors,t.formConfig),a={formDef:i.formDef,widgetLoaders:{...rn,...i.widgetLoaders,...t.customWidgetLoaders??{}},dependencies:{...i.dependencies??{},...t.dependencies??{}},functions:{...i.functions??{},...t.functions??{}},validateOn:t.validateOn??i.validateOn??"eager",itemRenderers:{...i.itemRenderers??{},...t.itemRenderers??{}},localization:t.localization,middlewares:t.middlewares??[],data:t.data,meta:t.meta,formName:t.formName},r=gu({...t.customValidators??{}}),s=i.formEvent,o=s?d=>s(d.detail):void 0;return l.html`
2
4
  <gui-core-form
3
5
  .config=${a}
4
6
  .validators=${r}
@@ -6,13 +8,16 @@
6
8
  .formHealthBoundary=${this.formHealthBoundary}
7
9
  @formEvent=${o}
8
10
  ></gui-core-form>
9
- `}},Lt([n.property({attribute:!1})],X.FormElement.prototype,"config",2),Lt([n.property({type:String})],X.FormElement.prototype,"autocomplete",2),Lt([n.property({attribute:!1})],X.FormElement.prototype,"formHealthBoundary",2),Lt([n.query("gui-core-form")],X.FormElement.prototype,"coreForm",2),X.FormElement=Lt([n.customElement("gui-form")],X.FormElement);var bp=Object.defineProperty,fp=Object.getOwnPropertyDescriptor,pt=(e,t,i,a)=>{for(var r=a>1?void 0:a?fp(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&bp(t,i,r),r};let rt=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.disabled=!1,this.icon=void 0,this.variant="filled",this.iconPosition="left",this.actionType="button",this.invalid=!1}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){const e=this.icon,t=this.iconPosition||"left",i={"gui-button-with-icon":!!e,[`gui-button-icon-${t}`]:!0,"gui-button--outlined":this.variant==="outlined","gui-button--link":this.variant==="link","gui-button--invalid":this.invalid&&this.actionType==="submit"},a=e?l.html`<span class="gui-widget-icon gui-button-icon ${e}" data-icon=${e}></span>`:l.nothing;return l.html`
11
+ `}},qt([n.property({attribute:!1})],te.FormElement.prototype,"config",2),qt([n.property({type:String})],te.FormElement.prototype,"autocomplete",2),qt([n.property({attribute:!1})],te.FormElement.prototype,"formHealthBoundary",2),qt([n.query("gui-core-form")],te.FormElement.prototype,"coreForm",2),te.FormElement=qt([n.customElement("gui-form")],te.FormElement);var Au=Object.defineProperty,Cu=Object.getOwnPropertyDescriptor,ht=(e,t,i,a)=>{for(var r=a>1?void 0:a?Cu(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Au(t,i,r),r};let nt=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.disabled=!1,this.icon=void 0,this.variant="filled",this.iconPosition="left",this.actionType="button",this.invalid=!1}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){const e=this.icon,t=this.iconPosition||"left",i={"gui-button-with-icon":!!e,[`gui-button-icon-${t}`]:!0,"gui-button--outlined":this.variant==="outlined","gui-button--link":this.variant==="link","gui-button--invalid":this.invalid&&this.actionType==="submit"},a=e?l.html`<span
12
+ class="gui-widget-icon gui-button-icon ${e}"
13
+ data-icon=${e}
14
+ aria-hidden="true"
15
+ ></span>`:l.nothing;return l.html`
10
16
  <div class="gui-widget">
11
17
  <button
12
18
  type=${this.actionType??"button"}
13
- tabindex="0"
14
19
  id=${this.uid}
15
- class=${w.classMap(i)}
20
+ class=${T.classMap(i)}
16
21
  data-cy=${`${this.uid}_button`}
17
22
  ?disabled=${this.disabled}
18
23
  >
@@ -21,7 +26,7 @@
21
26
  ${t==="right"?a:l.nothing}
22
27
  </button>
23
28
  </div>
24
- `}};pt([n.property({type:String})],rt.prototype,"uid",2),pt([n.property({type:String})],rt.prototype,"label",2),pt([n.property({type:Boolean})],rt.prototype,"disabled",2),pt([n.property({type:String})],rt.prototype,"icon",2),pt([n.property({type:String})],rt.prototype,"variant",2),pt([n.property({type:String})],rt.prototype,"iconPosition",2),pt([n.property({type:String})],rt.prototype,"actionType",2),pt([n.property({type:Boolean})],rt.prototype,"invalid",2),rt=pt([n.customElement("gui-button")],rt),typeof customElements<"u"&&!customElements.get("gui-button")&&customElements.define("gui-button",rt);var vp=Object.defineProperty,Dp=Object.getOwnPropertyDescriptor,fa=(e,t,i,a)=>{for(var r=a>1?void 0:a?Dp(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&vp(t,i,r),r};let Rt=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.ActionWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-button","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return l.html`
29
+ `}};ht([n.property({type:String})],nt.prototype,"uid",2),ht([n.property({type:String})],nt.prototype,"label",2),ht([n.property({type:Boolean})],nt.prototype,"disabled",2),ht([n.property({type:String})],nt.prototype,"icon",2),ht([n.property({type:String})],nt.prototype,"variant",2),ht([n.property({type:String})],nt.prototype,"iconPosition",2),ht([n.property({type:String})],nt.prototype,"actionType",2),ht([n.property({type:Boolean})],nt.prototype,"invalid",2),nt=ht([n.customElement("gui-button")],nt),typeof customElements<"u"&&!customElements.get("gui-button")&&customElements.define("gui-button",nt);var Lu=Object.defineProperty,xu=Object.getOwnPropertyDescriptor,or=(e,t,i,a)=>{for(var r=a>1?void 0:a?xu(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Lu(t,i,r),r};let Nt=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.ActionWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-button","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return l.html`
25
30
  <gui-button
26
31
  .uid=${this.widget.uid}
27
32
  .actionType=${this.adapter.templateData.actionType??"button"}
@@ -33,64 +38,78 @@
33
38
  .iconPosition=${this.adapter.templateData.iconPosition}
34
39
  @click=${()=>this.adapter.click()}
35
40
  ></gui-button>
36
- `}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};fa([b.consume({context:m.formContext}),n.property({attribute:!1})],Rt.prototype,"formContext",2),fa([b.provide({context:m.actionContext})],Rt.prototype,"adapter",2),Rt=fa([n.customElement("gui-button-interactive")],Rt);const wp=Object.freeze(Object.defineProperty({__proto__:null,get ButtonElement(){return Rt}},Symbol.toStringTag,{value:"Module"}));class oe{constructor(t,i){t.addController(this),this.getTargets=i.getTargets,this.getState=i.getState}hostConnected(){}hostUpdated(){const t=this.getTargets();if(!t)return;let i=[];t instanceof NodeList?i=Array.from(t):Array.isArray(t)?i=t:i=[t];const{uid:a,templateData:r}=this.getState(),{touched:s,errors:o,readonly:u,disabled:p,hint:d}=r,h=s&&o&&o.length>0;ot.filterTap(i,c=>!!c,c=>{const g=(f,S)=>{S?c.setAttribute(f,S):c.removeAttribute(f)};g("aria-describedby",d?`${a}_hint`:null),g("aria-invalid",h?"true":null),g("aria-errormessage",h?`${a}_errors`:null),g("aria-readonly",p||u?"true":null)})}}function Ri(e,t,i,a,r={}){const{includeStart:s=!1,outOfBounds:o="index"}=r;let u=s?e:e+t;for(;u>=0&&u<i;){if(!a(u))return u;u+=t}return o==="index"?u:-1}function va(e,t){const{columns:i,isRTL:a,pageSize:r}=t;switch(e){case"ArrowUp":return{kind:"delta",delta:-i};case"ArrowDown":return{kind:"delta",delta:i};case"ArrowLeft":return i===1?{kind:"none"}:{kind:"delta",delta:a?1:-1};case"ArrowRight":return i===1?{kind:"none"}:{kind:"delta",delta:a?-1:1};case"PageUp":return r===void 0?{kind:"none"}:{kind:"delta",delta:-r};case"PageDown":return r===void 0?{kind:"none"}:{kind:"delta",delta:r};case"Home":return{kind:"edge",edge:"first"};case"End":return{kind:"edge",edge:"last"};default:return{kind:"none"}}}function $p(e,t,i){return Math.max(1,Math.floor((e??300)/(t||40)))*(i||1)}function Da(e,t){const i=[];for(let a=0;a<e.length;a+=t)i.push(e.slice(a,a+t));return i}const Fi=".gui-calendar__day-button:not(.other-month)",kp=".gui-calendar__panel",_p="gui-calendar__year-button",Tp=".gui-calendar__year-button",hs=".gui-calendar__year-button.current",Sp=".gui-calendar__year-grid",ms=".gui-calendar__year-selector",Cp='.gui-calendar__day-button[tabindex="0"]';class Bi{constructor(t,i){this.handleDayKeydown=async a=>{if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(a.key)&&a.key!==" "&&a.key!=="Enter")return;const s=a.target,o=Array.from(this.host.querySelectorAll(Fi)),u=o.indexOf(s),p=window.getComputedStyle(this.host).direction==="rtl";if(a.key===" "||a.key==="Enter"){a.preventDefault(),this.options.onActivateDay(s.dataset.date??"",a);return}const d=va(a.key,{columns:7,isRTL:p});if(d.kind!=="delta")return;const h=d.delta;a.preventDefault();const c=Ri(u,h,o.length,f=>this.isButtonDisabled(o[f]));let g=!1;if(c<0)if(this.options.canGoPrev())this.options.goPrev(),g=!0;else{o.find(S=>!this.isButtonDisabled(S))?.focus();return}else if(c>=o.length)if(this.options.canGoNext())this.options.goNext(),g=!0;else{[...o].reverse().find(Ee=>!this.isButtonDisabled(Ee))?.focus();return}if(g){await this.host.updateComplete;const f=Array.from(this.host.querySelectorAll(Fi)),S=Array.from(this.host.querySelectorAll(kp));let Ee;if(c<0)Ee=S[0].querySelectorAll(Fi).length+c;else{const at=S[S.length-1].querySelectorAll(Fi).length;Ee=f.length-at+(c-o.length)}if(this.isButtonDisabled(f[Ee])){const Be=Ri(Ee,h,f.length,at=>this.isButtonDisabled(f[at]));if(Be<0||Be>=f.length){const at=f.findIndex(gt=>!this.isButtonDisabled(gt));at>-1&&f[at].focus()}else f[Be]?.focus()}else{const Be=Math.max(0,Math.min(Ee,f.length-1));f[Be]?.focus()}}else o[c]?.focus()},this.handleYearKeydown=a=>{const r=a.target;if(!r.classList.contains(_p))return;const s=Array.from(this.host.querySelectorAll(Tp)),o=s.indexOf(r),u=window.getComputedStyle(this.host).direction==="rtl";if(a.key==="Enter"||a.key===" "){a.preventDefault();const h=parseInt(r.dataset.year??"",10);isNaN(h)||this.selectYear(h);return}if(a.key==="Escape"){a.preventDefault(),a.stopPropagation(),this.host.querySelector(ms)?.focus(),this.options.onCloseYearGrid();return}const p=va(a.key,{columns:4,isRTL:u});if(p.kind!=="delta")return;a.preventDefault();const d=o+p.delta;d>=0&&d<s.length&&s[d].focus()},this.onPrevMonthClick=()=>{this.options.goPrev(),this.keepNavFocusInside("prev","next")},this.onNextMonthClick=()=>{this.options.goNext(),this.keepNavFocusInside("next","prev")},this.host=t,this.options=i,t.addController(this)}hostConnected(){}selectYear(t){this.host.querySelector(ms)?.focus(),this.options.onSelectYear(t),this.host.updateComplete.then(()=>{this.host.querySelector(Cp)?.focus()})}onYearGridToggled(){this.options.isYearGridOpen()&&this.host.updateComplete.then(()=>{this.scrollToCurrentYear(),this.focusCurrentYearButton()})}scrollToCurrentYear(){const t=this.host.querySelector(Sp),i=this.host.querySelector(hs);if(t&&i){const a=t.getBoundingClientRect(),r=i.getBoundingClientRect(),s=t.scrollTop+(r.top-a.top)-a.height/2+r.height/2;t.scrollTop=Math.max(0,s)}}focusCurrentYearButton(){this.host.querySelector(hs)?.focus()}async keepNavFocusInside(t,i){await this.host.updateComplete;const a=this.host.querySelector(`.gui-calendar__month-button--${t}`);if(!a||!a.disabled)return;(this.host.querySelector(`.gui-calendar__month-button--${i}:not([disabled])`)??this.host.querySelector(".gui-calendar__day-button:not([disabled])"))?.focus()}isButtonDisabled(t){return t?t.hasAttribute("disabled"):!0}}class Ft{constructor(t,i){this.onFocusOut=a=>{this.handleFocusOut(a)},t.addController(this),this.host=t,this.options=i}handleFocusOut(t){this.isInside(t.relatedTarget)||(this._rafId!==void 0&&cancelAnimationFrame(this._rafId),this._rafId=requestAnimationFrame(()=>{this._rafId=void 0,this.isInside(document.activeElement)||this.options.onLeave()}))}cancelPendingLeave(){this._rafId!==void 0&&(cancelAnimationFrame(this._rafId),this._rafId=void 0)}isInside(t){return!!t&&this.host.contains(t)}hostDisconnected(){this.cancelPendingLeave()}}const cs={aa:{firstDay:7,weekend:[6,7],minimalDays:1},"aa-DJ":{firstDay:6,weekend:[6,7],minimalDays:1},"aa-ER":{firstDay:1,weekend:[6,7],minimalDays:1},ab:{firstDay:1,weekend:[6,7],minimalDays:1},af:{firstDay:7,weekend:[6,7],minimalDays:1},"af-NA":{firstDay:1,weekend:[6,7],minimalDays:1},agq:{firstDay:1,weekend:[6,7],minimalDays:1},ak:{firstDay:1,weekend:[6,7],minimalDays:1},am:{firstDay:7,weekend:[6,7],minimalDays:1},an:{firstDay:1,weekend:[6,7],minimalDays:4},ann:{firstDay:1,weekend:[6,7],minimalDays:1},apc:{firstDay:6,weekend:[5,6],minimalDays:1},ar:{firstDay:6,weekend:[5,6],minimalDays:1},"ar-AE":{firstDay:6,weekend:[6,7],minimalDays:1},"ar-BH":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-DJ":{firstDay:6,weekend:[6,7],minimalDays:1},"ar-DZ":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-EG":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-EH":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-ER":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-IL":{firstDay:7,weekend:[5,6],minimalDays:1},"ar-IQ":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-JO":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-KM":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-KW":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-LB":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-LY":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-MA":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-MR":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-OM":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-PS":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-QA":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-SA":{firstDay:7,weekend:[5,6],minimalDays:1},"ar-SD":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-SO":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-SS":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-SY":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-TD":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-TN":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-YE":{firstDay:7,weekend:[5,6],minimalDays:1},arn:{firstDay:1,weekend:[6,7],minimalDays:1},as:{firstDay:7,weekend:[7],minimalDays:1},asa:{firstDay:1,weekend:[6,7],minimalDays:1},ast:{firstDay:1,weekend:[6,7],minimalDays:4},az:{firstDay:1,weekend:[6,7],minimalDays:1},"az-Arab":{firstDay:6,weekend:[5],minimalDays:1},"az-Arab-IQ":{firstDay:6,weekend:[5,6],minimalDays:1},"az-Arab-TR":{firstDay:1,weekend:[6,7],minimalDays:1},"az-Cyrl":{firstDay:1,weekend:[6,7],minimalDays:1},"az-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},ba:{firstDay:1,weekend:[6,7],minimalDays:4},bal:{firstDay:7,weekend:[6,7],minimalDays:1},"bal-Arab":{firstDay:7,weekend:[6,7],minimalDays:1},"bal-Latn":{firstDay:7,weekend:[6,7],minimalDays:1},bas:{firstDay:1,weekend:[6,7],minimalDays:1},be:{firstDay:1,weekend:[6,7],minimalDays:1},"be-tarask":{firstDay:1,weekend:[6,7],minimalDays:1},bem:{firstDay:1,weekend:[6,7],minimalDays:1},bew:{firstDay:7,weekend:[6,7],minimalDays:1},bez:{firstDay:1,weekend:[6,7],minimalDays:1},bg:{firstDay:1,weekend:[6,7],minimalDays:4},bgc:{firstDay:7,weekend:[7],minimalDays:1},bgn:{firstDay:7,weekend:[6,7],minimalDays:1},"bgn-AE":{firstDay:6,weekend:[6,7],minimalDays:1},"bgn-AF":{firstDay:6,weekend:[4,5],minimalDays:1},"bgn-IR":{firstDay:6,weekend:[5],minimalDays:1},"bgn-OM":{firstDay:6,weekend:[5,6],minimalDays:1},bho:{firstDay:7,weekend:[7],minimalDays:1},blo:{firstDay:1,weekend:[6,7],minimalDays:1},blt:{firstDay:1,weekend:[6,7],minimalDays:1},bm:{firstDay:1,weekend:[6,7],minimalDays:1},"bm-Nkoo":{firstDay:1,weekend:[6,7],minimalDays:1},bn:{firstDay:7,weekend:[6,7],minimalDays:1},"bn-IN":{firstDay:7,weekend:[7],minimalDays:1},bo:{firstDay:1,weekend:[6,7],minimalDays:1},"bo-IN":{firstDay:7,weekend:[7],minimalDays:1},br:{firstDay:1,weekend:[6,7],minimalDays:4},brx:{firstDay:7,weekend:[7],minimalDays:1},bs:{firstDay:1,weekend:[6,7],minimalDays:1},"bs-Cyrl":{firstDay:1,weekend:[6,7],minimalDays:1},"bs-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},bss:{firstDay:1,weekend:[6,7],minimalDays:1},byn:{firstDay:1,weekend:[6,7],minimalDays:1},ca:{firstDay:1,weekend:[6,7],minimalDays:4},"ca-AD":{firstDay:1,weekend:[6,7],minimalDays:4},"ca-ES-valencia":{firstDay:1,weekend:[6,7],minimalDays:4},"ca-FR":{firstDay:1,weekend:[6,7],minimalDays:4},"ca-IT":{firstDay:1,weekend:[6,7],minimalDays:4},cad:{firstDay:7,weekend:[6,7],minimalDays:1},cch:{firstDay:1,weekend:[6,7],minimalDays:1},ccp:{firstDay:7,weekend:[6,7],minimalDays:1},"ccp-IN":{firstDay:7,weekend:[7],minimalDays:1},ce:{firstDay:1,weekend:[6,7],minimalDays:4},ceb:{firstDay:7,weekend:[6,7],minimalDays:1},cgg:{firstDay:1,weekend:[7],minimalDays:1},cho:{firstDay:7,weekend:[6,7],minimalDays:1},chr:{firstDay:7,weekend:[6,7],minimalDays:1},cic:{firstDay:7,weekend:[6,7],minimalDays:1},ckb:{firstDay:6,weekend:[5,6],minimalDays:1},"ckb-IR":{firstDay:6,weekend:[5],minimalDays:1},co:{firstDay:1,weekend:[6,7],minimalDays:4},cs:{firstDay:1,weekend:[6,7],minimalDays:4},csw:{firstDay:7,weekend:[6,7],minimalDays:1},cu:{firstDay:1,weekend:[6,7],minimalDays:4},cv:{firstDay:1,weekend:[6,7],minimalDays:4},cy:{firstDay:1,weekend:[6,7],minimalDays:4},da:{firstDay:1,weekend:[6,7],minimalDays:4},"da-GL":{firstDay:1,weekend:[6,7],minimalDays:1},dav:{firstDay:7,weekend:[6,7],minimalDays:1},de:{firstDay:1,weekend:[6,7],minimalDays:4},"de-AT":{firstDay:1,weekend:[6,7],minimalDays:4},"de-BE":{firstDay:1,weekend:[6,7],minimalDays:4},"de-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"de-IT":{firstDay:1,weekend:[6,7],minimalDays:4},"de-LI":{firstDay:1,weekend:[6,7],minimalDays:4},"de-LU":{firstDay:1,weekend:[6,7],minimalDays:4},dje:{firstDay:1,weekend:[6,7],minimalDays:1},doi:{firstDay:7,weekend:[7],minimalDays:1},dsb:{firstDay:1,weekend:[6,7],minimalDays:4},dua:{firstDay:1,weekend:[6,7],minimalDays:1},dv:{firstDay:5,weekend:[6,7],minimalDays:1},dyo:{firstDay:1,weekend:[6,7],minimalDays:1},dz:{firstDay:7,weekend:[6,7],minimalDays:1},ebu:{firstDay:7,weekend:[6,7],minimalDays:1},ee:{firstDay:1,weekend:[6,7],minimalDays:1},"ee-TG":{firstDay:1,weekend:[6,7],minimalDays:1},el:{firstDay:1,weekend:[6,7],minimalDays:4},"el-CY":{firstDay:1,weekend:[6,7],minimalDays:1},"el-polyton":{firstDay:1,weekend:[6,7],minimalDays:4},en:{firstDay:7,weekend:[6,7],minimalDays:1},"en-001":{firstDay:1,weekend:[6,7],minimalDays:1},"en-150":{firstDay:1,weekend:[6,7],minimalDays:1},"en-AE":{firstDay:6,weekend:[6,7],minimalDays:1},"en-AG":{firstDay:7,weekend:[6,7],minimalDays:1},"en-AI":{firstDay:1,weekend:[6,7],minimalDays:1},"en-AS":{firstDay:7,weekend:[6,7],minimalDays:1},"en-AT":{firstDay:1,weekend:[6,7],minimalDays:4},"en-AU":{firstDay:1,weekend:[6,7],minimalDays:1},"en-BB":{firstDay:1,weekend:[6,7],minimalDays:1},"en-BE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-BI":{firstDay:1,weekend:[6,7],minimalDays:1},"en-BM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-BS":{firstDay:7,weekend:[6,7],minimalDays:1},"en-BW":{firstDay:7,weekend:[6,7],minimalDays:1},"en-BZ":{firstDay:7,weekend:[6,7],minimalDays:1},"en-CA":{firstDay:7,weekend:[6,7],minimalDays:1},"en-CC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"en-CK":{firstDay:1,weekend:[6,7],minimalDays:1},"en-CM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-CX":{firstDay:1,weekend:[6,7],minimalDays:1},"en-CY":{firstDay:1,weekend:[6,7],minimalDays:1},"en-DE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-DG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-DK":{firstDay:1,weekend:[6,7],minimalDays:4},"en-DM":{firstDay:7,weekend:[6,7],minimalDays:1},"en-Dsrt":{firstDay:7,weekend:[6,7],minimalDays:1},"en-ER":{firstDay:1,weekend:[6,7],minimalDays:1},"en-FI":{firstDay:1,weekend:[6,7],minimalDays:4},"en-FJ":{firstDay:1,weekend:[6,7],minimalDays:4},"en-FK":{firstDay:1,weekend:[6,7],minimalDays:1},"en-FM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-GB":{firstDay:1,weekend:[6,7],minimalDays:4},"en-GD":{firstDay:1,weekend:[6,7],minimalDays:1},"en-GG":{firstDay:1,weekend:[6,7],minimalDays:4},"en-GH":{firstDay:1,weekend:[6,7],minimalDays:1},"en-GI":{firstDay:1,weekend:[6,7],minimalDays:4},"en-GM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-GU":{firstDay:7,weekend:[6,7],minimalDays:1},"en-GY":{firstDay:1,weekend:[6,7],minimalDays:1},"en-HK":{firstDay:7,weekend:[6,7],minimalDays:1},"en-ID":{firstDay:7,weekend:[6,7],minimalDays:1},"en-IE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-IL":{firstDay:7,weekend:[5,6],minimalDays:1},"en-IM":{firstDay:1,weekend:[6,7],minimalDays:4},"en-IN":{firstDay:7,weekend:[7],minimalDays:1},"en-IO":{firstDay:1,weekend:[6,7],minimalDays:1},"en-JE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-JM":{firstDay:7,weekend:[6,7],minimalDays:1},"en-KE":{firstDay:7,weekend:[6,7],minimalDays:1},"en-KI":{firstDay:1,weekend:[6,7],minimalDays:1},"en-KN":{firstDay:1,weekend:[6,7],minimalDays:1},"en-KY":{firstDay:1,weekend:[6,7],minimalDays:1},"en-LC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-LR":{firstDay:1,weekend:[6,7],minimalDays:1},"en-LS":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MH":{firstDay:7,weekend:[6,7],minimalDays:1},"en-MO":{firstDay:7,weekend:[6,7],minimalDays:1},"en-MP":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MS":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MT":{firstDay:7,weekend:[6,7],minimalDays:1},"en-MU":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MV":{firstDay:5,weekend:[6,7],minimalDays:1},"en-MW":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MY":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NA":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NF":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NL":{firstDay:1,weekend:[6,7],minimalDays:4},"en-NR":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NU":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NZ":{firstDay:1,weekend:[6,7],minimalDays:1},"en-PG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-PH":{firstDay:7,weekend:[6,7],minimalDays:1},"en-PK":{firstDay:7,weekend:[6,7],minimalDays:1},"en-PN":{firstDay:1,weekend:[6,7],minimalDays:1},"en-PR":{firstDay:7,weekend:[6,7],minimalDays:1},"en-PW":{firstDay:1,weekend:[6,7],minimalDays:1},"en-RW":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SB":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SD":{firstDay:6,weekend:[5,6],minimalDays:1},"en-SE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-SG":{firstDay:7,weekend:[6,7],minimalDays:1},"en-SH":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SI":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SL":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SS":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SX":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SZ":{firstDay:1,weekend:[6,7],minimalDays:1},"en-Shaw":{firstDay:1,weekend:[6,7],minimalDays:4},"en-TC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-TK":{firstDay:1,weekend:[6,7],minimalDays:1},"en-TO":{firstDay:1,weekend:[6,7],minimalDays:1},"en-TT":{firstDay:7,weekend:[6,7],minimalDays:1},"en-TV":{firstDay:1,weekend:[6,7],minimalDays:1},"en-TZ":{firstDay:1,weekend:[6,7],minimalDays:1},"en-UG":{firstDay:1,weekend:[7],minimalDays:1},"en-UM":{firstDay:7,weekend:[6,7],minimalDays:1},"en-VC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-VG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-VI":{firstDay:7,weekend:[6,7],minimalDays:1},"en-VU":{firstDay:1,weekend:[6,7],minimalDays:1},"en-WS":{firstDay:7,weekend:[6,7],minimalDays:1},"en-ZA":{firstDay:7,weekend:[6,7],minimalDays:1},"en-ZM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-ZW":{firstDay:7,weekend:[6,7],minimalDays:1},eo:{firstDay:1,weekend:[6,7],minimalDays:1},es:{firstDay:1,weekend:[6,7],minimalDays:4},"es-419":{firstDay:1,weekend:[6,7],minimalDays:1},"es-AR":{firstDay:1,weekend:[6,7],minimalDays:1},"es-BO":{firstDay:1,weekend:[6,7],minimalDays:1},"es-BR":{firstDay:7,weekend:[6,7],minimalDays:1},"es-BZ":{firstDay:7,weekend:[6,7],minimalDays:1},"es-CL":{firstDay:1,weekend:[6,7],minimalDays:1},"es-CO":{firstDay:7,weekend:[6,7],minimalDays:1},"es-CR":{firstDay:1,weekend:[6,7],minimalDays:1},"es-CU":{firstDay:1,weekend:[6,7],minimalDays:1},"es-DO":{firstDay:7,weekend:[6,7],minimalDays:1},"es-EA":{firstDay:1,weekend:[6,7],minimalDays:1},"es-EC":{firstDay:1,weekend:[6,7],minimalDays:1},"es-GQ":{firstDay:1,weekend:[6,7],minimalDays:1},"es-GT":{firstDay:7,weekend:[6,7],minimalDays:1},"es-HN":{firstDay:7,weekend:[6,7],minimalDays:1},"es-IC":{firstDay:1,weekend:[6,7],minimalDays:1},"es-MX":{firstDay:7,weekend:[6,7],minimalDays:1},"es-NI":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PA":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PE":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PH":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PR":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PY":{firstDay:7,weekend:[6,7],minimalDays:1},"es-SV":{firstDay:7,weekend:[6,7],minimalDays:1},"es-US":{firstDay:7,weekend:[6,7],minimalDays:1},"es-UY":{firstDay:1,weekend:[6,7],minimalDays:1},"es-VE":{firstDay:7,weekend:[6,7],minimalDays:1},et:{firstDay:1,weekend:[6,7],minimalDays:4},eu:{firstDay:1,weekend:[6,7],minimalDays:4},ewo:{firstDay:1,weekend:[6,7],minimalDays:1},fa:{firstDay:6,weekend:[5],minimalDays:1},"fa-AF":{firstDay:6,weekend:[4,5],minimalDays:1},ff:{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-BF":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-CM":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-GH":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-GM":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-GW":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-LR":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-MR":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-NE":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-NG":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-SL":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-SN":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-BF":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-CM":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-GH":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-GM":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-GN":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-GW":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-LR":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-MR":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-NE":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-NG":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-SL":{firstDay:1,weekend:[6,7],minimalDays:1},fi:{firstDay:1,weekend:[6,7],minimalDays:4},fil:{firstDay:7,weekend:[6,7],minimalDays:1},fo:{firstDay:1,weekend:[6,7],minimalDays:4},"fo-DK":{firstDay:1,weekend:[6,7],minimalDays:4},fr:{firstDay:1,weekend:[6,7],minimalDays:4},"fr-BE":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-BF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-BI":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-BJ":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-BL":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CA":{firstDay:7,weekend:[6,7],minimalDays:1},"fr-CD":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CG":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-CI":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CM":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-DJ":{firstDay:6,weekend:[6,7],minimalDays:1},"fr-DZ":{firstDay:6,weekend:[5,6],minimalDays:1},"fr-GA":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-GF":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-GN":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-GP":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-GQ":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-HT":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-KM":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-LU":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-MA":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-MC":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-MF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-MG":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-ML":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-MQ":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-MR":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-MU":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-NC":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-NE":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-PF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-PM":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-RE":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-RW":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-SC":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-SN":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-SY":{firstDay:6,weekend:[5,6],minimalDays:1},"fr-TD":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-TG":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-TN":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-VU":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-WF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-YT":{firstDay:1,weekend:[6,7],minimalDays:1},frr:{firstDay:1,weekend:[6,7],minimalDays:4},fur:{firstDay:1,weekend:[6,7],minimalDays:4},fy:{firstDay:1,weekend:[6,7],minimalDays:4},ga:{firstDay:1,weekend:[6,7],minimalDays:4},"ga-GB":{firstDay:1,weekend:[6,7],minimalDays:4},gaa:{firstDay:1,weekend:[6,7],minimalDays:1},gd:{firstDay:1,weekend:[6,7],minimalDays:4},gez:{firstDay:7,weekend:[6,7],minimalDays:1},"gez-ER":{firstDay:1,weekend:[6,7],minimalDays:1},gl:{firstDay:1,weekend:[6,7],minimalDays:4},gn:{firstDay:7,weekend:[6,7],minimalDays:1},gsw:{firstDay:1,weekend:[6,7],minimalDays:4},"gsw-FR":{firstDay:1,weekend:[6,7],minimalDays:4},"gsw-LI":{firstDay:1,weekend:[6,7],minimalDays:4},gu:{firstDay:7,weekend:[7],minimalDays:1},guz:{firstDay:7,weekend:[6,7],minimalDays:1},gv:{firstDay:1,weekend:[6,7],minimalDays:4},ha:{firstDay:1,weekend:[6,7],minimalDays:1},"ha-Arab":{firstDay:1,weekend:[6,7],minimalDays:1},"ha-Arab-SD":{firstDay:6,weekend:[5,6],minimalDays:1},"ha-GH":{firstDay:1,weekend:[6,7],minimalDays:1},"ha-NE":{firstDay:1,weekend:[6,7],minimalDays:1},haw:{firstDay:7,weekend:[6,7],minimalDays:1},he:{firstDay:7,weekend:[5,6],minimalDays:1},hi:{firstDay:7,weekend:[7],minimalDays:1},"hi-Latn":{firstDay:7,weekend:[7],minimalDays:1},hnj:{firstDay:7,weekend:[6,7],minimalDays:1},"hnj-Hmnp":{firstDay:7,weekend:[6,7],minimalDays:1},hr:{firstDay:1,weekend:[6,7],minimalDays:1},"hr-BA":{firstDay:1,weekend:[6,7],minimalDays:1},hsb:{firstDay:1,weekend:[6,7],minimalDays:4},hu:{firstDay:1,weekend:[6,7],minimalDays:4},hy:{firstDay:1,weekend:[6,7],minimalDays:1},ia:{firstDay:1,weekend:[6,7],minimalDays:1},id:{firstDay:7,weekend:[6,7],minimalDays:1},ie:{firstDay:1,weekend:[6,7],minimalDays:4},ig:{firstDay:1,weekend:[6,7],minimalDays:1},ii:{firstDay:1,weekend:[6,7],minimalDays:1},io:{firstDay:1,weekend:[6,7],minimalDays:1},is:{firstDay:1,weekend:[6,7],minimalDays:4},it:{firstDay:1,weekend:[6,7],minimalDays:4},"it-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"it-SM":{firstDay:1,weekend:[6,7],minimalDays:4},"it-VA":{firstDay:1,weekend:[6,7],minimalDays:4},iu:{firstDay:7,weekend:[6,7],minimalDays:1},"iu-Latn":{firstDay:7,weekend:[6,7],minimalDays:1},ja:{firstDay:7,weekend:[6,7],minimalDays:1},jbo:{firstDay:1,weekend:[6,7],minimalDays:1},jgo:{firstDay:1,weekend:[6,7],minimalDays:1},jmc:{firstDay:1,weekend:[6,7],minimalDays:1},jv:{firstDay:7,weekend:[6,7],minimalDays:1},ka:{firstDay:1,weekend:[6,7],minimalDays:1},kab:{firstDay:6,weekend:[5,6],minimalDays:1},kaj:{firstDay:1,weekend:[6,7],minimalDays:1},kam:{firstDay:7,weekend:[6,7],minimalDays:1},kcg:{firstDay:1,weekend:[6,7],minimalDays:1},kde:{firstDay:1,weekend:[6,7],minimalDays:1},kea:{firstDay:1,weekend:[6,7],minimalDays:1},ken:{firstDay:1,weekend:[6,7],minimalDays:1},kgp:{firstDay:7,weekend:[6,7],minimalDays:1},khq:{firstDay:1,weekend:[6,7],minimalDays:1},ki:{firstDay:7,weekend:[6,7],minimalDays:1},kk:{firstDay:1,weekend:[6,7],minimalDays:1},kkj:{firstDay:1,weekend:[6,7],minimalDays:1},kl:{firstDay:1,weekend:[6,7],minimalDays:1},kln:{firstDay:7,weekend:[6,7],minimalDays:1},km:{firstDay:7,weekend:[6,7],minimalDays:1},kn:{firstDay:7,weekend:[7],minimalDays:1},ko:{firstDay:7,weekend:[6,7],minimalDays:1},"ko-CN":{firstDay:1,weekend:[6,7],minimalDays:1},"ko-KP":{firstDay:1,weekend:[6,7],minimalDays:1},kok:{firstDay:7,weekend:[7],minimalDays:1},kpe:{firstDay:1,weekend:[6,7],minimalDays:1},"kpe-GN":{firstDay:1,weekend:[6,7],minimalDays:1},ks:{firstDay:7,weekend:[7],minimalDays:1},"ks-Arab":{firstDay:7,weekend:[7],minimalDays:1},"ks-Deva":{firstDay:7,weekend:[7],minimalDays:1},ksb:{firstDay:1,weekend:[6,7],minimalDays:1},ksf:{firstDay:1,weekend:[6,7],minimalDays:1},ksh:{firstDay:1,weekend:[6,7],minimalDays:4},ku:{firstDay:1,weekend:[6,7],minimalDays:1},kw:{firstDay:1,weekend:[6,7],minimalDays:4},kxv:{firstDay:7,weekend:[7],minimalDays:1},"kxv-Deva":{firstDay:7,weekend:[7],minimalDays:1},"kxv-Latn":{firstDay:7,weekend:[7],minimalDays:1},"kxv-Orya":{firstDay:7,weekend:[7],minimalDays:1},"kxv-Telu":{firstDay:7,weekend:[7],minimalDays:1},ky:{firstDay:1,weekend:[6,7],minimalDays:1},la:{firstDay:1,weekend:[6,7],minimalDays:4},lag:{firstDay:1,weekend:[6,7],minimalDays:1},lb:{firstDay:1,weekend:[6,7],minimalDays:4},lg:{firstDay:1,weekend:[7],minimalDays:1},lij:{firstDay:1,weekend:[6,7],minimalDays:4},lkt:{firstDay:7,weekend:[6,7],minimalDays:1},lmo:{firstDay:1,weekend:[6,7],minimalDays:4},ln:{firstDay:1,weekend:[6,7],minimalDays:1},"ln-AO":{firstDay:1,weekend:[6,7],minimalDays:1},"ln-CF":{firstDay:1,weekend:[6,7],minimalDays:1},"ln-CG":{firstDay:1,weekend:[6,7],minimalDays:1},lo:{firstDay:7,weekend:[6,7],minimalDays:1},lrc:{firstDay:6,weekend:[5],minimalDays:1},"lrc-IQ":{firstDay:6,weekend:[5,6],minimalDays:1},lt:{firstDay:1,weekend:[6,7],minimalDays:4},lu:{firstDay:1,weekend:[6,7],minimalDays:1},luo:{firstDay:7,weekend:[6,7],minimalDays:1},luy:{firstDay:7,weekend:[6,7],minimalDays:1},lv:{firstDay:1,weekend:[6,7],minimalDays:1},mai:{firstDay:7,weekend:[7],minimalDays:1},mas:{firstDay:7,weekend:[6,7],minimalDays:1},"mas-TZ":{firstDay:1,weekend:[6,7],minimalDays:1},mdf:{firstDay:1,weekend:[6,7],minimalDays:4},mer:{firstDay:7,weekend:[6,7],minimalDays:1},mfe:{firstDay:1,weekend:[6,7],minimalDays:1},mg:{firstDay:1,weekend:[6,7],minimalDays:1},mgh:{firstDay:7,weekend:[6,7],minimalDays:1},mgo:{firstDay:1,weekend:[6,7],minimalDays:1},mi:{firstDay:1,weekend:[6,7],minimalDays:1},mic:{firstDay:7,weekend:[6,7],minimalDays:1},mk:{firstDay:1,weekend:[6,7],minimalDays:1},ml:{firstDay:7,weekend:[7],minimalDays:1},mn:{firstDay:1,weekend:[6,7],minimalDays:1},"mn-Mong":{firstDay:1,weekend:[6,7],minimalDays:1},"mn-Mong-MN":{firstDay:1,weekend:[6,7],minimalDays:1},mni:{firstDay:7,weekend:[7],minimalDays:1},"mni-Beng":{firstDay:7,weekend:[7],minimalDays:1},"mni-Mtei":{firstDay:7,weekend:[7],minimalDays:1},moh:{firstDay:7,weekend:[6,7],minimalDays:1},mr:{firstDay:7,weekend:[7],minimalDays:1},ms:{firstDay:1,weekend:[6,7],minimalDays:1},"ms-Arab":{firstDay:1,weekend:[6,7],minimalDays:1},"ms-Arab-BN":{firstDay:1,weekend:[6,7],minimalDays:1},"ms-BN":{firstDay:1,weekend:[6,7],minimalDays:1},"ms-ID":{firstDay:7,weekend:[6,7],minimalDays:1},"ms-SG":{firstDay:7,weekend:[6,7],minimalDays:1},mt:{firstDay:7,weekend:[6,7],minimalDays:1},mua:{firstDay:1,weekend:[6,7],minimalDays:1},mus:{firstDay:7,weekend:[6,7],minimalDays:1},my:{firstDay:7,weekend:[6,7],minimalDays:1},myv:{firstDay:1,weekend:[6,7],minimalDays:4},mzn:{firstDay:6,weekend:[5],minimalDays:1},naq:{firstDay:1,weekend:[6,7],minimalDays:1},nb:{firstDay:1,weekend:[6,7],minimalDays:4},"nb-SJ":{firstDay:1,weekend:[6,7],minimalDays:4},nd:{firstDay:7,weekend:[6,7],minimalDays:1},nds:{firstDay:1,weekend:[6,7],minimalDays:4},"nds-NL":{firstDay:1,weekend:[6,7],minimalDays:4},ne:{firstDay:7,weekend:[6,7],minimalDays:1},"ne-IN":{firstDay:7,weekend:[7],minimalDays:1},nl:{firstDay:1,weekend:[6,7],minimalDays:4},"nl-AW":{firstDay:1,weekend:[6,7],minimalDays:1},"nl-BE":{firstDay:1,weekend:[6,7],minimalDays:4},"nl-BQ":{firstDay:1,weekend:[6,7],minimalDays:1},"nl-CW":{firstDay:1,weekend:[6,7],minimalDays:1},"nl-SR":{firstDay:1,weekend:[6,7],minimalDays:1},"nl-SX":{firstDay:1,weekend:[6,7],minimalDays:1},nmg:{firstDay:1,weekend:[6,7],minimalDays:1},nn:{firstDay:1,weekend:[6,7],minimalDays:4},nnh:{firstDay:1,weekend:[6,7],minimalDays:1},no:{firstDay:1,weekend:[6,7],minimalDays:4},nqo:{firstDay:1,weekend:[6,7],minimalDays:1},nr:{firstDay:7,weekend:[6,7],minimalDays:1},nso:{firstDay:7,weekend:[6,7],minimalDays:1},nus:{firstDay:1,weekend:[6,7],minimalDays:1},nv:{firstDay:7,weekend:[6,7],minimalDays:1},ny:{firstDay:1,weekend:[6,7],minimalDays:1},nyn:{firstDay:1,weekend:[7],minimalDays:1},oc:{firstDay:1,weekend:[6,7],minimalDays:4},"oc-ES":{firstDay:1,weekend:[6,7],minimalDays:4},om:{firstDay:7,weekend:[6,7],minimalDays:1},"om-KE":{firstDay:7,weekend:[6,7],minimalDays:1},or:{firstDay:7,weekend:[7],minimalDays:1},os:{firstDay:1,weekend:[6,7],minimalDays:1},"os-RU":{firstDay:1,weekend:[6,7],minimalDays:4},osa:{firstDay:7,weekend:[6,7],minimalDays:1},pa:{firstDay:7,weekend:[7],minimalDays:1},"pa-Arab":{firstDay:7,weekend:[6,7],minimalDays:1},"pa-Guru":{firstDay:7,weekend:[7],minimalDays:1},pap:{firstDay:1,weekend:[6,7],minimalDays:1},"pap-AW":{firstDay:1,weekend:[6,7],minimalDays:1},pcm:{firstDay:1,weekend:[6,7],minimalDays:1},pis:{firstDay:1,weekend:[6,7],minimalDays:1},pl:{firstDay:1,weekend:[6,7],minimalDays:4},prg:{firstDay:1,weekend:[6,7],minimalDays:4},ps:{firstDay:6,weekend:[4,5],minimalDays:1},"ps-PK":{firstDay:7,weekend:[6,7],minimalDays:1},pt:{firstDay:7,weekend:[6,7],minimalDays:1},"pt-AO":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"pt-CV":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-GQ":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-GW":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-LU":{firstDay:1,weekend:[6,7],minimalDays:4},"pt-MO":{firstDay:7,weekend:[6,7],minimalDays:1},"pt-MZ":{firstDay:7,weekend:[6,7],minimalDays:1},"pt-PT":{firstDay:7,weekend:[6,7],minimalDays:4},"pt-ST":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-TL":{firstDay:1,weekend:[6,7],minimalDays:1},qu:{firstDay:7,weekend:[6,7],minimalDays:1},"qu-BO":{firstDay:1,weekend:[6,7],minimalDays:1},"qu-EC":{firstDay:1,weekend:[6,7],minimalDays:1},quc:{firstDay:7,weekend:[6,7],minimalDays:1},raj:{firstDay:7,weekend:[7],minimalDays:1},rhg:{firstDay:7,weekend:[6,7],minimalDays:1},"rhg-Rohg":{firstDay:7,weekend:[6,7],minimalDays:1},"rhg-Rohg-BD":{firstDay:7,weekend:[6,7],minimalDays:1},rif:{firstDay:1,weekend:[6,7],minimalDays:1},rm:{firstDay:1,weekend:[6,7],minimalDays:4},rn:{firstDay:1,weekend:[6,7],minimalDays:1},ro:{firstDay:1,weekend:[6,7],minimalDays:1},"ro-MD":{firstDay:1,weekend:[6,7],minimalDays:1},rof:{firstDay:1,weekend:[6,7],minimalDays:1},ru:{firstDay:1,weekend:[6,7],minimalDays:4},"ru-BY":{firstDay:1,weekend:[6,7],minimalDays:1},"ru-KG":{firstDay:1,weekend:[6,7],minimalDays:1},"ru-KZ":{firstDay:1,weekend:[6,7],minimalDays:1},"ru-MD":{firstDay:1,weekend:[6,7],minimalDays:1},"ru-UA":{firstDay:1,weekend:[6,7],minimalDays:1},rw:{firstDay:1,weekend:[6,7],minimalDays:1},rwk:{firstDay:1,weekend:[6,7],minimalDays:1},sa:{firstDay:7,weekend:[7],minimalDays:1},sah:{firstDay:1,weekend:[6,7],minimalDays:4},saq:{firstDay:7,weekend:[6,7],minimalDays:1},sat:{firstDay:7,weekend:[7],minimalDays:1},"sat-Deva":{firstDay:7,weekend:[7],minimalDays:1},"sat-Olck":{firstDay:7,weekend:[7],minimalDays:1},sbp:{firstDay:1,weekend:[6,7],minimalDays:1},sc:{firstDay:1,weekend:[6,7],minimalDays:4},scn:{firstDay:1,weekend:[6,7],minimalDays:4},sd:{firstDay:7,weekend:[6,7],minimalDays:1},"sd-Arab":{firstDay:7,weekend:[6,7],minimalDays:1},"sd-Deva":{firstDay:7,weekend:[7],minimalDays:1},sdh:{firstDay:6,weekend:[5],minimalDays:1},"sdh-IQ":{firstDay:6,weekend:[5,6],minimalDays:1},se:{firstDay:1,weekend:[6,7],minimalDays:4},"se-FI":{firstDay:1,weekend:[6,7],minimalDays:4},"se-SE":{firstDay:1,weekend:[6,7],minimalDays:4},seh:{firstDay:7,weekend:[6,7],minimalDays:1},ses:{firstDay:1,weekend:[6,7],minimalDays:1},sg:{firstDay:1,weekend:[6,7],minimalDays:1},shi:{firstDay:1,weekend:[6,7],minimalDays:1},"shi-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},"shi-Tfng":{firstDay:1,weekend:[6,7],minimalDays:1},shn:{firstDay:7,weekend:[6,7],minimalDays:1},"shn-TH":{firstDay:7,weekend:[6,7],minimalDays:1},si:{firstDay:1,weekend:[6,7],minimalDays:1},sid:{firstDay:7,weekend:[6,7],minimalDays:1},sk:{firstDay:1,weekend:[6,7],minimalDays:4},skr:{firstDay:7,weekend:[6,7],minimalDays:1},sl:{firstDay:1,weekend:[6,7],minimalDays:1},sma:{firstDay:1,weekend:[6,7],minimalDays:4},"sma-NO":{firstDay:1,weekend:[6,7],minimalDays:4},smj:{firstDay:1,weekend:[6,7],minimalDays:4},"smj-NO":{firstDay:1,weekend:[6,7],minimalDays:4},smn:{firstDay:1,weekend:[6,7],minimalDays:4},sms:{firstDay:1,weekend:[6,7],minimalDays:4},sn:{firstDay:7,weekend:[6,7],minimalDays:1},so:{firstDay:1,weekend:[6,7],minimalDays:1},"so-DJ":{firstDay:6,weekend:[6,7],minimalDays:1},"so-ET":{firstDay:7,weekend:[6,7],minimalDays:1},"so-KE":{firstDay:7,weekend:[6,7],minimalDays:1},sq:{firstDay:1,weekend:[6,7],minimalDays:1},"sq-MK":{firstDay:1,weekend:[6,7],minimalDays:1},"sq-XK":{firstDay:1,weekend:[6,7],minimalDays:1},sr:{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Cyrl":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Cyrl-BA":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Cyrl-ME":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Cyrl-XK":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Latn-BA":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Latn-ME":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Latn-XK":{firstDay:1,weekend:[6,7],minimalDays:1},ss:{firstDay:7,weekend:[6,7],minimalDays:1},"ss-SZ":{firstDay:1,weekend:[6,7],minimalDays:1},ssy:{firstDay:1,weekend:[6,7],minimalDays:1},st:{firstDay:7,weekend:[6,7],minimalDays:1},"st-LS":{firstDay:1,weekend:[6,7],minimalDays:1},su:{firstDay:7,weekend:[6,7],minimalDays:1},"su-Latn":{firstDay:7,weekend:[6,7],minimalDays:1},sv:{firstDay:1,weekend:[6,7],minimalDays:4},"sv-AX":{firstDay:1,weekend:[6,7],minimalDays:4},"sv-FI":{firstDay:1,weekend:[6,7],minimalDays:4},sw:{firstDay:1,weekend:[6,7],minimalDays:1},"sw-CD":{firstDay:1,weekend:[6,7],minimalDays:1},"sw-KE":{firstDay:7,weekend:[6,7],minimalDays:1},"sw-UG":{firstDay:1,weekend:[7],minimalDays:1},syr:{firstDay:6,weekend:[5,6],minimalDays:1},"syr-SY":{firstDay:6,weekend:[5,6],minimalDays:1},szl:{firstDay:1,weekend:[6,7],minimalDays:4},ta:{firstDay:7,weekend:[7],minimalDays:1},"ta-LK":{firstDay:1,weekend:[6,7],minimalDays:1},"ta-MY":{firstDay:1,weekend:[6,7],minimalDays:1},"ta-SG":{firstDay:7,weekend:[6,7],minimalDays:1},te:{firstDay:7,weekend:[7],minimalDays:1},teo:{firstDay:1,weekend:[7],minimalDays:1},"teo-KE":{firstDay:7,weekend:[6,7],minimalDays:1},tg:{firstDay:1,weekend:[6,7],minimalDays:1},th:{firstDay:7,weekend:[6,7],minimalDays:1},ti:{firstDay:7,weekend:[6,7],minimalDays:1},"ti-ER":{firstDay:1,weekend:[6,7],minimalDays:1},tig:{firstDay:1,weekend:[6,7],minimalDays:1},tk:{firstDay:1,weekend:[6,7],minimalDays:1},tn:{firstDay:7,weekend:[6,7],minimalDays:1},"tn-BW":{firstDay:7,weekend:[6,7],minimalDays:1},to:{firstDay:1,weekend:[6,7],minimalDays:1},tok:{firstDay:1,weekend:[6,7],minimalDays:1},tpi:{firstDay:1,weekend:[6,7],minimalDays:1},tr:{firstDay:1,weekend:[6,7],minimalDays:1},"tr-CY":{firstDay:1,weekend:[6,7],minimalDays:1},trv:{firstDay:7,weekend:[6,7],minimalDays:1},trw:{firstDay:7,weekend:[6,7],minimalDays:1},ts:{firstDay:7,weekend:[6,7],minimalDays:1},tt:{firstDay:1,weekend:[6,7],minimalDays:4},twq:{firstDay:1,weekend:[6,7],minimalDays:1},tyv:{firstDay:1,weekend:[6,7],minimalDays:4},tzm:{firstDay:1,weekend:[6,7],minimalDays:1},ug:{firstDay:1,weekend:[6,7],minimalDays:1},uk:{firstDay:1,weekend:[6,7],minimalDays:1},und:{firstDay:7,weekend:[6,7],minimalDays:1},ur:{firstDay:7,weekend:[6,7],minimalDays:1},"ur-IN":{firstDay:7,weekend:[7],minimalDays:1},uz:{firstDay:1,weekend:[6,7],minimalDays:1},"uz-Arab":{firstDay:6,weekend:[4,5],minimalDays:1},"uz-Cyrl":{firstDay:1,weekend:[6,7],minimalDays:1},"uz-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},vai:{firstDay:1,weekend:[6,7],minimalDays:1},"vai-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},"vai-Vaii":{firstDay:1,weekend:[6,7],minimalDays:1},ve:{firstDay:7,weekend:[6,7],minimalDays:1},vec:{firstDay:1,weekend:[6,7],minimalDays:4},vi:{firstDay:1,weekend:[6,7],minimalDays:1},vmw:{firstDay:7,weekend:[6,7],minimalDays:1},vo:{firstDay:1,weekend:[6,7],minimalDays:1},vun:{firstDay:1,weekend:[6,7],minimalDays:1},wa:{firstDay:1,weekend:[6,7],minimalDays:4},wae:{firstDay:1,weekend:[6,7],minimalDays:4},wal:{firstDay:7,weekend:[6,7],minimalDays:1},wbp:{firstDay:1,weekend:[6,7],minimalDays:1},wo:{firstDay:1,weekend:[6,7],minimalDays:1},xh:{firstDay:7,weekend:[6,7],minimalDays:1},xnr:{firstDay:7,weekend:[7],minimalDays:1},xog:{firstDay:1,weekend:[7],minimalDays:1},yav:{firstDay:1,weekend:[6,7],minimalDays:1},yi:{firstDay:1,weekend:[6,7],minimalDays:1},yo:{firstDay:1,weekend:[6,7],minimalDays:1},"yo-BJ":{firstDay:1,weekend:[6,7],minimalDays:1},yrl:{firstDay:7,weekend:[6,7],minimalDays:1},"yrl-CO":{firstDay:7,weekend:[6,7],minimalDays:1},"yrl-VE":{firstDay:7,weekend:[6,7],minimalDays:1},yue:{firstDay:7,weekend:[6,7],minimalDays:1},"yue-Hans":{firstDay:1,weekend:[6,7],minimalDays:1},"yue-Hant":{firstDay:7,weekend:[6,7],minimalDays:1},za:{firstDay:1,weekend:[6,7],minimalDays:1},zgh:{firstDay:1,weekend:[6,7],minimalDays:1},zh:{firstDay:1,weekend:[6,7],minimalDays:1},"zh-Hans":{firstDay:1,weekend:[6,7],minimalDays:1},"zh-Hans-HK":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hans-MO":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hans-SG":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hant":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hant-HK":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hant-MO":{firstDay:7,weekend:[6,7],minimalDays:1},zu:{firstDay:7,weekend:[6,7],minimalDays:1}},ys="Invalid date: day is greater than the maximum valid day for the month and year.",xp="Invalid date: date is before the minimum allowed date.",Ep="Invalid date: date is after the maximum allowed date.",wt="Invalid date: date is within a disabled range.",gs="Invalid time: time is before the minimum allowed time.",bs="Invalid time: time is after the maximum allowed time.",Mp="Invalid range: end time must be after start time.",qi="Invalid time: time is within a disabled range.",Pp="Invalid date-time: date-time is before the minimum allowed date-time.",Ip="Invalid date-time: date-time is after the maximum allowed date-time.";function Q(e){const t=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return`${t}-${i}-${a}`}function j(e){const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);return t?new Date(Number(t[1]),Number(t[2])-1,Number(t[3])):new Date(e)}function Ni(e,t,i,a){const r=e.split("T")[0];if(t&&r<t.split("T")[0]||i&&r>i.split("T")[0])return!0;if(a&&a.length>0)for(const s of a){const o=s.start.split("T")[0],u=s.end?s.end.split("T")[0]:o;if(r>=o&&r<=u)return!0}return!1}function Bt(e,t,i,a,r){const s=e.split("T")[0];return t&&s<t.split("T")[0]?r?.minDateMessage??xp:i&&s>i.split("T")[0]?r?.maxDateMessage??Ep:Ni(s,void 0,void 0,a)?r?.disabledDateRangeMessage??wt:null}function fs(e,t,i,a,r){const s=j(e),o=j(t);if(isNaN(s.getTime())||isNaN(o.getTime()))return!1;const u=new Date(s);u.setHours(0,0,0,0);const p=new Date(o);for(p.setHours(0,0,0,0);u<=p;){if(Ni(Q(u),a,r,i))return!0;u.setDate(u.getDate()+1)}return!1}function vs(e){return new Intl.DateTimeFormat(e??"en",{year:"numeric",month:"numeric",day:"numeric"}).formatToParts(new Date)}function Ds(e,t){return e===2?new Date(t,1,29).getDate()===29||!t?29:28:e===4||e===6||e===9||e===11?30:31}function wa(e){return dt(e,new Date)}function dt(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function Op(e){const t=[0,1,2,3,4,5,6],i=e%7;return[...t.slice(i),...t.slice(0,i)]}function ws(e){const t=e??"en",i=cs[t]||cs[t.split("-")[0]]||{firstDay:0};return Op(i.firstDay)}function Ap(e){const t=new Intl.DateTimeFormat(e,{weekday:"narrow"}),i=new Date(2025,10,30);return ws(e).map(a=>{const r=new Date(i);return r.setDate(i.getDate()+a),t.format(r)})}function $a(e,t,i){for(let a=0;a<i;a++){const r=new Date(t.getFullYear(),t.getMonth()+a,1);if(e.getMonth()===r.getMonth()&&e.getFullYear()===r.getFullYear())return!0}return!1}function Lp(e,t,i="long"){return new Intl.DateTimeFormat(e,{month:i,year:"numeric"}).formatToParts(t).filter(r=>r.type==="month"||r.type==="year")}function ka(e,t){const i=e||"en-US",s=new Intl.DateTimeFormat(i,{day:"numeric"}).formatToParts(t).find(o=>o.type==="day");return s?s.value:t.getDate().toString()}function $s(e,t){const i=Q(e),a=Q(t);return i===a?{start:i}:{start:i,end:a}}function ks(e){return e.length?e.map(a=>({start:j(a.start).getTime(),end:j(a.end??a.start).getTime()})).sort((a,r)=>a.start-r.start).reduce((a,r)=>{const s=a[a.length-1];if(s){const o=new Date(s.end);if(o.setDate(o.getDate()+1),r.start<=o.getTime())return s.end=Math.max(s.end,r.end),a}return[...a,r]},[]).map(a=>$s(new Date(a.start),new Date(a.end))):[]}class zi{constructor(t,i){this._currentDate=new Date,this._yearSelectorOpen=!1,this.host=t,this.options=i,t.addController(this)}hostConnected(){}get currentDate(){return this._currentDate}set currentDate(t){Object.is(t,this._currentDate)||(this._currentDate=t,this.host.requestUpdate())}get yearSelectorOpen(){return this._yearSelectorOpen}set yearSelectorOpen(t){Object.is(t,this._yearSelectorOpen)||(this._yearSelectorOpen=t,this.host.requestUpdate())}prevMonth(){const t=this._currentDate;this.currentDate=new Date(t.getFullYear(),t.getMonth()-1,1)}nextMonth(){const t=this._currentDate;this.currentDate=new Date(t.getFullYear(),t.getMonth()+1,1)}canGoPrev(){const t=this.options.getMinDate();if(!t)return!0;const i=new Date(this._currentDate.getFullYear(),this._currentDate.getMonth(),0);return Q(i)>=t}canGoNext(){const t=this.options.getMaxDate();if(!t)return!0;const i=(this.options.getNumberOfMonths()??1)-1,a=new Date(this._currentDate.getFullYear(),this._currentDate.getMonth()+i+1,1);return Q(a)<=t}get effectiveMinYear(){const t=this.options.getMinDate();return t?j(t).getFullYear():1900}get effectiveMaxYear(){const t=this.options.getMaxDate();return t?j(t).getFullYear():2099}get yearList(){const t=[];for(let i=this.effectiveMinYear;i<=this.effectiveMaxYear;i++)t.push(i);return t}toggleYearSelector(){this.yearSelectorOpen=!this._yearSelectorOpen,this.options.onYearSelectorToggled?.()}selectYear(t){this.currentDate=new Date(t,this._currentDate.getMonth(),1),this.yearSelectorOpen=!1}closeYearSelector(){this.yearSelectorOpen=!1}navigateToDate(t){!isNaN(t.getTime())&&!$a(t,this._currentDate,this.options.getNumberOfMonths()??1)&&(this.currentDate=t)}isDisabled(t){return Ni(Q(t),this.options.getMinDate(),this.options.getMaxDate(),this.options.getDisabledRanges())}}const se=(e,t,i=!1,a=void 0,r=!0)=>r?t.label?l.html`<label
41
+ `}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};or([f.consume({context:m.formContext}),n.property({attribute:!1})],Nt.prototype,"formContext",2),or([f.provide({context:m.actionContext})],Nt.prototype,"adapter",2),Nt=or([n.customElement("gui-button-interactive")],Nt);const Eu=Object.freeze(Object.defineProperty({__proto__:null,get ButtonElement(){return Nt}},Symbol.toStringTag,{value:"Module"}));class he{constructor(t,i){t.addController(this),this.getTargets=i.getTargets,this.getState=i.getState}hostConnected(){}hostUpdated(){const t=this.getTargets();if(!t)return;let i=[];t instanceof NodeList?i=Array.from(t):Array.isArray(t)?i=t:i=[t];const{uid:a,templateData:r}=this.getState(),{touched:s,errors:o,readonly:d,disabled:p,hint:u,required:h}=r,c=s&&o&&o.length>0;dt.filterTap(i,y=>!!y,y=>{const g=(_,x)=>{x?y.setAttribute(_,x):y.removeAttribute(_)};g("aria-describedby",u?`${a}_hint`:null),g("aria-invalid",c?"true":null),g("aria-errormessage",c?`${a}_errors`:null),g("aria-readonly",d?"true":null),g("aria-disabled",p?"true":null),g("aria-required",h?"true":null)})}}function Bi(e,t,i,a,r={}){const{includeStart:s=!1,outOfBounds:o="index"}=r;let d=s?e:e+t;for(;d>=0&&d<i;){if(!a(d))return d;d+=t}return o==="index"?d:-1}function lr(e,t){const{columns:i,isRTL:a,pageSize:r}=t;switch(e){case"ArrowUp":return{kind:"delta",delta:-i};case"ArrowDown":return{kind:"delta",delta:i};case"ArrowLeft":return i===1?{kind:"none"}:{kind:"delta",delta:a?1:-1};case"ArrowRight":return i===1?{kind:"none"}:{kind:"delta",delta:a?-1:1};case"PageUp":return r===void 0?{kind:"none"}:{kind:"delta",delta:-r};case"PageDown":return r===void 0?{kind:"none"}:{kind:"delta",delta:r};case"Home":return{kind:"edge",edge:"first"};case"End":return{kind:"edge",edge:"last"};default:return{kind:"none"}}}function Pu(e,t,i){return Math.max(1,Math.floor((e??300)/(t||40)))*(i||1)}function dr(e,t){const i=[];for(let a=0;a<e.length;a+=t)i.push(e.slice(a,a+t));return i}const qi=".gui-calendar__day-button:not(.other-month)",Ou=".gui-calendar__panel",Iu="gui-calendar__year-button",Mu=".gui-calendar__year-button",sn=".gui-calendar__year-button.current",Ru=".gui-calendar__year-grid",nn=".gui-calendar__year-selector",Fu='.gui-calendar__day-button[tabindex="0"]';class Ni{constructor(t,i){this.handleDayKeydown=async a=>{if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(a.key)&&a.key!==" "&&a.key!=="Enter")return;const s=a.target,o=Array.from(this.host.querySelectorAll(qi)),d=o.indexOf(s),p=window.getComputedStyle(this.host).direction==="rtl";if(a.key===" "||a.key==="Enter"){a.preventDefault(),this.options.onActivateDay(s.dataset.date??"",a);return}const u=lr(a.key,{columns:7,isRTL:p});if(u.kind!=="delta")return;const h=u.delta;a.preventDefault();const c=Bi(d,h,o.length,g=>this.isButtonDisabled(o[g]));let y=!1;if(c<0)if(this.options.canGoPrev())this.options.goPrev(),y=!0;else{o.find(_=>!this.isButtonDisabled(_))?.focus();return}else if(c>=o.length)if(this.options.canGoNext())this.options.goNext(),y=!0;else{[...o].reverse().find(x=>!this.isButtonDisabled(x))?.focus();return}if(y){await this.host.updateComplete;const g=Array.from(this.host.querySelectorAll(qi)),_=Array.from(this.host.querySelectorAll(Ou));let x;if(c<0)x=_[0].querySelectorAll(qi).length+c;else{const st=_[_.length-1].querySelectorAll(qi).length;x=g.length-st+(c-o.length)}if(this.isButtonDisabled(g[x])){const Ae=Bi(x,h,g.length,st=>this.isButtonDisabled(g[st]));if(Ae<0||Ae>=g.length){const st=g.findIndex(ft=>!this.isButtonDisabled(ft));st>-1&&g[st].focus()}else g[Ae]?.focus()}else{const Ae=Math.max(0,Math.min(x,g.length-1));g[Ae]?.focus()}}else o[c]?.focus()},this.handleYearKeydown=a=>{const r=a.target;if(!r.classList.contains(Iu))return;const s=Array.from(this.host.querySelectorAll(Mu)),o=s.indexOf(r),d=window.getComputedStyle(this.host).direction==="rtl";if(a.key==="Enter"||a.key===" "){a.preventDefault();const h=parseInt(r.dataset.year??"",10);isNaN(h)||this.selectYear(h);return}if(a.key==="Escape"){a.preventDefault(),a.stopPropagation(),this.host.querySelector(nn)?.focus(),this.options.onCloseYearGrid();return}const p=lr(a.key,{columns:4,isRTL:d});if(p.kind!=="delta")return;a.preventDefault();const u=o+p.delta;u>=0&&u<s.length&&s[u].focus()},this.onPrevMonthClick=()=>{this.options.goPrev(),this.keepNavFocusInside("prev","next")},this.onNextMonthClick=()=>{this.options.goNext(),this.keepNavFocusInside("next","prev")},this.host=t,this.options=i,t.addController(this)}hostConnected(){}selectYear(t){this.host.querySelector(nn)?.focus(),this.options.onSelectYear(t),this.host.updateComplete.then(()=>{this.host.querySelector(Fu)?.focus()})}onYearGridToggled(){this.options.isYearGridOpen()&&this.host.updateComplete.then(()=>{this.scrollToCurrentYear(),this.focusCurrentYearButton()})}scrollToCurrentYear(){const t=this.host.querySelector(Ru),i=this.host.querySelector(sn);if(t&&i){const a=t.getBoundingClientRect(),r=i.getBoundingClientRect(),s=t.scrollTop+(r.top-a.top)-a.height/2+r.height/2;t.scrollTop=Math.max(0,s)}}focusCurrentYearButton(){this.host.querySelector(sn)?.focus()}async keepNavFocusInside(t,i){await this.host.updateComplete;const a=this.host.querySelector(`.gui-calendar__month-button--${t}`);if(!a||!a.disabled)return;(this.host.querySelector(`.gui-calendar__month-button--${i}:not([disabled])`)??this.host.querySelector('.gui-calendar__day-button:not([disabled]):not([aria-disabled="true"])'))?.focus()}isButtonDisabled(t){return t?t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true":!0}}class zt{constructor(t,i){this.onFocusOut=a=>{this.handleFocusOut(a)},t.addController(this),this.host=t,this.options=i}handleFocusOut(t){this.isInside(t.relatedTarget)||(this._rafId!==void 0&&cancelAnimationFrame(this._rafId),this._rafId=requestAnimationFrame(()=>{this._rafId=void 0,this.isInside(document.activeElement)||this.options.onLeave()}))}cancelPendingLeave(){this._rafId!==void 0&&(cancelAnimationFrame(this._rafId),this._rafId=void 0)}isInside(t){return!!t&&this.host.contains(t)}hostDisconnected(){this.cancelPendingLeave()}}const on={aa:{firstDay:7,weekend:[6,7],minimalDays:1},"aa-DJ":{firstDay:6,weekend:[6,7],minimalDays:1},"aa-ER":{firstDay:1,weekend:[6,7],minimalDays:1},ab:{firstDay:1,weekend:[6,7],minimalDays:1},af:{firstDay:7,weekend:[6,7],minimalDays:1},"af-NA":{firstDay:1,weekend:[6,7],minimalDays:1},agq:{firstDay:1,weekend:[6,7],minimalDays:1},ak:{firstDay:1,weekend:[6,7],minimalDays:1},am:{firstDay:7,weekend:[6,7],minimalDays:1},an:{firstDay:1,weekend:[6,7],minimalDays:4},ann:{firstDay:1,weekend:[6,7],minimalDays:1},apc:{firstDay:6,weekend:[5,6],minimalDays:1},ar:{firstDay:6,weekend:[5,6],minimalDays:1},"ar-AE":{firstDay:6,weekend:[6,7],minimalDays:1},"ar-BH":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-DJ":{firstDay:6,weekend:[6,7],minimalDays:1},"ar-DZ":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-EG":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-EH":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-ER":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-IL":{firstDay:7,weekend:[5,6],minimalDays:1},"ar-IQ":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-JO":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-KM":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-KW":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-LB":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-LY":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-MA":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-MR":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-OM":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-PS":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-QA":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-SA":{firstDay:7,weekend:[5,6],minimalDays:1},"ar-SD":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-SO":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-SS":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-SY":{firstDay:6,weekend:[5,6],minimalDays:1},"ar-TD":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-TN":{firstDay:1,weekend:[6,7],minimalDays:1},"ar-YE":{firstDay:7,weekend:[5,6],minimalDays:1},arn:{firstDay:1,weekend:[6,7],minimalDays:1},as:{firstDay:7,weekend:[7],minimalDays:1},asa:{firstDay:1,weekend:[6,7],minimalDays:1},ast:{firstDay:1,weekend:[6,7],minimalDays:4},az:{firstDay:1,weekend:[6,7],minimalDays:1},"az-Arab":{firstDay:6,weekend:[5],minimalDays:1},"az-Arab-IQ":{firstDay:6,weekend:[5,6],minimalDays:1},"az-Arab-TR":{firstDay:1,weekend:[6,7],minimalDays:1},"az-Cyrl":{firstDay:1,weekend:[6,7],minimalDays:1},"az-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},ba:{firstDay:1,weekend:[6,7],minimalDays:4},bal:{firstDay:7,weekend:[6,7],minimalDays:1},"bal-Arab":{firstDay:7,weekend:[6,7],minimalDays:1},"bal-Latn":{firstDay:7,weekend:[6,7],minimalDays:1},bas:{firstDay:1,weekend:[6,7],minimalDays:1},be:{firstDay:1,weekend:[6,7],minimalDays:1},"be-tarask":{firstDay:1,weekend:[6,7],minimalDays:1},bem:{firstDay:1,weekend:[6,7],minimalDays:1},bew:{firstDay:7,weekend:[6,7],minimalDays:1},bez:{firstDay:1,weekend:[6,7],minimalDays:1},bg:{firstDay:1,weekend:[6,7],minimalDays:4},bgc:{firstDay:7,weekend:[7],minimalDays:1},bgn:{firstDay:7,weekend:[6,7],minimalDays:1},"bgn-AE":{firstDay:6,weekend:[6,7],minimalDays:1},"bgn-AF":{firstDay:6,weekend:[4,5],minimalDays:1},"bgn-IR":{firstDay:6,weekend:[5],minimalDays:1},"bgn-OM":{firstDay:6,weekend:[5,6],minimalDays:1},bho:{firstDay:7,weekend:[7],minimalDays:1},blo:{firstDay:1,weekend:[6,7],minimalDays:1},blt:{firstDay:1,weekend:[6,7],minimalDays:1},bm:{firstDay:1,weekend:[6,7],minimalDays:1},"bm-Nkoo":{firstDay:1,weekend:[6,7],minimalDays:1},bn:{firstDay:7,weekend:[6,7],minimalDays:1},"bn-IN":{firstDay:7,weekend:[7],minimalDays:1},bo:{firstDay:1,weekend:[6,7],minimalDays:1},"bo-IN":{firstDay:7,weekend:[7],minimalDays:1},br:{firstDay:1,weekend:[6,7],minimalDays:4},brx:{firstDay:7,weekend:[7],minimalDays:1},bs:{firstDay:1,weekend:[6,7],minimalDays:1},"bs-Cyrl":{firstDay:1,weekend:[6,7],minimalDays:1},"bs-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},bss:{firstDay:1,weekend:[6,7],minimalDays:1},byn:{firstDay:1,weekend:[6,7],minimalDays:1},ca:{firstDay:1,weekend:[6,7],minimalDays:4},"ca-AD":{firstDay:1,weekend:[6,7],minimalDays:4},"ca-ES-valencia":{firstDay:1,weekend:[6,7],minimalDays:4},"ca-FR":{firstDay:1,weekend:[6,7],minimalDays:4},"ca-IT":{firstDay:1,weekend:[6,7],minimalDays:4},cad:{firstDay:7,weekend:[6,7],minimalDays:1},cch:{firstDay:1,weekend:[6,7],minimalDays:1},ccp:{firstDay:7,weekend:[6,7],minimalDays:1},"ccp-IN":{firstDay:7,weekend:[7],minimalDays:1},ce:{firstDay:1,weekend:[6,7],minimalDays:4},ceb:{firstDay:7,weekend:[6,7],minimalDays:1},cgg:{firstDay:1,weekend:[7],minimalDays:1},cho:{firstDay:7,weekend:[6,7],minimalDays:1},chr:{firstDay:7,weekend:[6,7],minimalDays:1},cic:{firstDay:7,weekend:[6,7],minimalDays:1},ckb:{firstDay:6,weekend:[5,6],minimalDays:1},"ckb-IR":{firstDay:6,weekend:[5],minimalDays:1},co:{firstDay:1,weekend:[6,7],minimalDays:4},cs:{firstDay:1,weekend:[6,7],minimalDays:4},csw:{firstDay:7,weekend:[6,7],minimalDays:1},cu:{firstDay:1,weekend:[6,7],minimalDays:4},cv:{firstDay:1,weekend:[6,7],minimalDays:4},cy:{firstDay:1,weekend:[6,7],minimalDays:4},da:{firstDay:1,weekend:[6,7],minimalDays:4},"da-GL":{firstDay:1,weekend:[6,7],minimalDays:1},dav:{firstDay:7,weekend:[6,7],minimalDays:1},de:{firstDay:1,weekend:[6,7],minimalDays:4},"de-AT":{firstDay:1,weekend:[6,7],minimalDays:4},"de-BE":{firstDay:1,weekend:[6,7],minimalDays:4},"de-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"de-IT":{firstDay:1,weekend:[6,7],minimalDays:4},"de-LI":{firstDay:1,weekend:[6,7],minimalDays:4},"de-LU":{firstDay:1,weekend:[6,7],minimalDays:4},dje:{firstDay:1,weekend:[6,7],minimalDays:1},doi:{firstDay:7,weekend:[7],minimalDays:1},dsb:{firstDay:1,weekend:[6,7],minimalDays:4},dua:{firstDay:1,weekend:[6,7],minimalDays:1},dv:{firstDay:5,weekend:[6,7],minimalDays:1},dyo:{firstDay:1,weekend:[6,7],minimalDays:1},dz:{firstDay:7,weekend:[6,7],minimalDays:1},ebu:{firstDay:7,weekend:[6,7],minimalDays:1},ee:{firstDay:1,weekend:[6,7],minimalDays:1},"ee-TG":{firstDay:1,weekend:[6,7],minimalDays:1},el:{firstDay:1,weekend:[6,7],minimalDays:4},"el-CY":{firstDay:1,weekend:[6,7],minimalDays:1},"el-polyton":{firstDay:1,weekend:[6,7],minimalDays:4},en:{firstDay:7,weekend:[6,7],minimalDays:1},"en-001":{firstDay:1,weekend:[6,7],minimalDays:1},"en-150":{firstDay:1,weekend:[6,7],minimalDays:1},"en-AE":{firstDay:6,weekend:[6,7],minimalDays:1},"en-AG":{firstDay:7,weekend:[6,7],minimalDays:1},"en-AI":{firstDay:1,weekend:[6,7],minimalDays:1},"en-AS":{firstDay:7,weekend:[6,7],minimalDays:1},"en-AT":{firstDay:1,weekend:[6,7],minimalDays:4},"en-AU":{firstDay:1,weekend:[6,7],minimalDays:1},"en-BB":{firstDay:1,weekend:[6,7],minimalDays:1},"en-BE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-BI":{firstDay:1,weekend:[6,7],minimalDays:1},"en-BM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-BS":{firstDay:7,weekend:[6,7],minimalDays:1},"en-BW":{firstDay:7,weekend:[6,7],minimalDays:1},"en-BZ":{firstDay:7,weekend:[6,7],minimalDays:1},"en-CA":{firstDay:7,weekend:[6,7],minimalDays:1},"en-CC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"en-CK":{firstDay:1,weekend:[6,7],minimalDays:1},"en-CM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-CX":{firstDay:1,weekend:[6,7],minimalDays:1},"en-CY":{firstDay:1,weekend:[6,7],minimalDays:1},"en-DE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-DG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-DK":{firstDay:1,weekend:[6,7],minimalDays:4},"en-DM":{firstDay:7,weekend:[6,7],minimalDays:1},"en-Dsrt":{firstDay:7,weekend:[6,7],minimalDays:1},"en-ER":{firstDay:1,weekend:[6,7],minimalDays:1},"en-FI":{firstDay:1,weekend:[6,7],minimalDays:4},"en-FJ":{firstDay:1,weekend:[6,7],minimalDays:4},"en-FK":{firstDay:1,weekend:[6,7],minimalDays:1},"en-FM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-GB":{firstDay:1,weekend:[6,7],minimalDays:4},"en-GD":{firstDay:1,weekend:[6,7],minimalDays:1},"en-GG":{firstDay:1,weekend:[6,7],minimalDays:4},"en-GH":{firstDay:1,weekend:[6,7],minimalDays:1},"en-GI":{firstDay:1,weekend:[6,7],minimalDays:4},"en-GM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-GU":{firstDay:7,weekend:[6,7],minimalDays:1},"en-GY":{firstDay:1,weekend:[6,7],minimalDays:1},"en-HK":{firstDay:7,weekend:[6,7],minimalDays:1},"en-ID":{firstDay:7,weekend:[6,7],minimalDays:1},"en-IE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-IL":{firstDay:7,weekend:[5,6],minimalDays:1},"en-IM":{firstDay:1,weekend:[6,7],minimalDays:4},"en-IN":{firstDay:7,weekend:[7],minimalDays:1},"en-IO":{firstDay:1,weekend:[6,7],minimalDays:1},"en-JE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-JM":{firstDay:7,weekend:[6,7],minimalDays:1},"en-KE":{firstDay:7,weekend:[6,7],minimalDays:1},"en-KI":{firstDay:1,weekend:[6,7],minimalDays:1},"en-KN":{firstDay:1,weekend:[6,7],minimalDays:1},"en-KY":{firstDay:1,weekend:[6,7],minimalDays:1},"en-LC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-LR":{firstDay:1,weekend:[6,7],minimalDays:1},"en-LS":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MH":{firstDay:7,weekend:[6,7],minimalDays:1},"en-MO":{firstDay:7,weekend:[6,7],minimalDays:1},"en-MP":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MS":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MT":{firstDay:7,weekend:[6,7],minimalDays:1},"en-MU":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MV":{firstDay:5,weekend:[6,7],minimalDays:1},"en-MW":{firstDay:1,weekend:[6,7],minimalDays:1},"en-MY":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NA":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NF":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NL":{firstDay:1,weekend:[6,7],minimalDays:4},"en-NR":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NU":{firstDay:1,weekend:[6,7],minimalDays:1},"en-NZ":{firstDay:1,weekend:[6,7],minimalDays:1},"en-PG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-PH":{firstDay:7,weekend:[6,7],minimalDays:1},"en-PK":{firstDay:7,weekend:[6,7],minimalDays:1},"en-PN":{firstDay:1,weekend:[6,7],minimalDays:1},"en-PR":{firstDay:7,weekend:[6,7],minimalDays:1},"en-PW":{firstDay:1,weekend:[6,7],minimalDays:1},"en-RW":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SB":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SD":{firstDay:6,weekend:[5,6],minimalDays:1},"en-SE":{firstDay:1,weekend:[6,7],minimalDays:4},"en-SG":{firstDay:7,weekend:[6,7],minimalDays:1},"en-SH":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SI":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SL":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SS":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SX":{firstDay:1,weekend:[6,7],minimalDays:1},"en-SZ":{firstDay:1,weekend:[6,7],minimalDays:1},"en-Shaw":{firstDay:1,weekend:[6,7],minimalDays:4},"en-TC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-TK":{firstDay:1,weekend:[6,7],minimalDays:1},"en-TO":{firstDay:1,weekend:[6,7],minimalDays:1},"en-TT":{firstDay:7,weekend:[6,7],minimalDays:1},"en-TV":{firstDay:1,weekend:[6,7],minimalDays:1},"en-TZ":{firstDay:1,weekend:[6,7],minimalDays:1},"en-UG":{firstDay:1,weekend:[7],minimalDays:1},"en-UM":{firstDay:7,weekend:[6,7],minimalDays:1},"en-VC":{firstDay:1,weekend:[6,7],minimalDays:1},"en-VG":{firstDay:1,weekend:[6,7],minimalDays:1},"en-VI":{firstDay:7,weekend:[6,7],minimalDays:1},"en-VU":{firstDay:1,weekend:[6,7],minimalDays:1},"en-WS":{firstDay:7,weekend:[6,7],minimalDays:1},"en-ZA":{firstDay:7,weekend:[6,7],minimalDays:1},"en-ZM":{firstDay:1,weekend:[6,7],minimalDays:1},"en-ZW":{firstDay:7,weekend:[6,7],minimalDays:1},eo:{firstDay:1,weekend:[6,7],minimalDays:1},es:{firstDay:1,weekend:[6,7],minimalDays:4},"es-419":{firstDay:1,weekend:[6,7],minimalDays:1},"es-AR":{firstDay:1,weekend:[6,7],minimalDays:1},"es-BO":{firstDay:1,weekend:[6,7],minimalDays:1},"es-BR":{firstDay:7,weekend:[6,7],minimalDays:1},"es-BZ":{firstDay:7,weekend:[6,7],minimalDays:1},"es-CL":{firstDay:1,weekend:[6,7],minimalDays:1},"es-CO":{firstDay:7,weekend:[6,7],minimalDays:1},"es-CR":{firstDay:1,weekend:[6,7],minimalDays:1},"es-CU":{firstDay:1,weekend:[6,7],minimalDays:1},"es-DO":{firstDay:7,weekend:[6,7],minimalDays:1},"es-EA":{firstDay:1,weekend:[6,7],minimalDays:1},"es-EC":{firstDay:1,weekend:[6,7],minimalDays:1},"es-GQ":{firstDay:1,weekend:[6,7],minimalDays:1},"es-GT":{firstDay:7,weekend:[6,7],minimalDays:1},"es-HN":{firstDay:7,weekend:[6,7],minimalDays:1},"es-IC":{firstDay:1,weekend:[6,7],minimalDays:1},"es-MX":{firstDay:7,weekend:[6,7],minimalDays:1},"es-NI":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PA":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PE":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PH":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PR":{firstDay:7,weekend:[6,7],minimalDays:1},"es-PY":{firstDay:7,weekend:[6,7],minimalDays:1},"es-SV":{firstDay:7,weekend:[6,7],minimalDays:1},"es-US":{firstDay:7,weekend:[6,7],minimalDays:1},"es-UY":{firstDay:1,weekend:[6,7],minimalDays:1},"es-VE":{firstDay:7,weekend:[6,7],minimalDays:1},et:{firstDay:1,weekend:[6,7],minimalDays:4},eu:{firstDay:1,weekend:[6,7],minimalDays:4},ewo:{firstDay:1,weekend:[6,7],minimalDays:1},fa:{firstDay:6,weekend:[5],minimalDays:1},"fa-AF":{firstDay:6,weekend:[4,5],minimalDays:1},ff:{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-BF":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-CM":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-GH":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-GM":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-GW":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-LR":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-MR":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-NE":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-NG":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-SL":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Adlm-SN":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-BF":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-CM":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-GH":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-GM":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-GN":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-GW":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-LR":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-MR":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-NE":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-NG":{firstDay:1,weekend:[6,7],minimalDays:1},"ff-Latn-SL":{firstDay:1,weekend:[6,7],minimalDays:1},fi:{firstDay:1,weekend:[6,7],minimalDays:4},fil:{firstDay:7,weekend:[6,7],minimalDays:1},fo:{firstDay:1,weekend:[6,7],minimalDays:4},"fo-DK":{firstDay:1,weekend:[6,7],minimalDays:4},fr:{firstDay:1,weekend:[6,7],minimalDays:4},"fr-BE":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-BF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-BI":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-BJ":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-BL":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CA":{firstDay:7,weekend:[6,7],minimalDays:1},"fr-CD":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CG":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-CI":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-CM":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-DJ":{firstDay:6,weekend:[6,7],minimalDays:1},"fr-DZ":{firstDay:6,weekend:[5,6],minimalDays:1},"fr-GA":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-GF":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-GN":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-GP":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-GQ":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-HT":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-KM":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-LU":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-MA":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-MC":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-MF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-MG":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-ML":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-MQ":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-MR":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-MU":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-NC":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-NE":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-PF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-PM":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-RE":{firstDay:1,weekend:[6,7],minimalDays:4},"fr-RW":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-SC":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-SN":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-SY":{firstDay:6,weekend:[5,6],minimalDays:1},"fr-TD":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-TG":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-TN":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-VU":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-WF":{firstDay:1,weekend:[6,7],minimalDays:1},"fr-YT":{firstDay:1,weekend:[6,7],minimalDays:1},frr:{firstDay:1,weekend:[6,7],minimalDays:4},fur:{firstDay:1,weekend:[6,7],minimalDays:4},fy:{firstDay:1,weekend:[6,7],minimalDays:4},ga:{firstDay:1,weekend:[6,7],minimalDays:4},"ga-GB":{firstDay:1,weekend:[6,7],minimalDays:4},gaa:{firstDay:1,weekend:[6,7],minimalDays:1},gd:{firstDay:1,weekend:[6,7],minimalDays:4},gez:{firstDay:7,weekend:[6,7],minimalDays:1},"gez-ER":{firstDay:1,weekend:[6,7],minimalDays:1},gl:{firstDay:1,weekend:[6,7],minimalDays:4},gn:{firstDay:7,weekend:[6,7],minimalDays:1},gsw:{firstDay:1,weekend:[6,7],minimalDays:4},"gsw-FR":{firstDay:1,weekend:[6,7],minimalDays:4},"gsw-LI":{firstDay:1,weekend:[6,7],minimalDays:4},gu:{firstDay:7,weekend:[7],minimalDays:1},guz:{firstDay:7,weekend:[6,7],minimalDays:1},gv:{firstDay:1,weekend:[6,7],minimalDays:4},ha:{firstDay:1,weekend:[6,7],minimalDays:1},"ha-Arab":{firstDay:1,weekend:[6,7],minimalDays:1},"ha-Arab-SD":{firstDay:6,weekend:[5,6],minimalDays:1},"ha-GH":{firstDay:1,weekend:[6,7],minimalDays:1},"ha-NE":{firstDay:1,weekend:[6,7],minimalDays:1},haw:{firstDay:7,weekend:[6,7],minimalDays:1},he:{firstDay:7,weekend:[5,6],minimalDays:1},hi:{firstDay:7,weekend:[7],minimalDays:1},"hi-Latn":{firstDay:7,weekend:[7],minimalDays:1},hnj:{firstDay:7,weekend:[6,7],minimalDays:1},"hnj-Hmnp":{firstDay:7,weekend:[6,7],minimalDays:1},hr:{firstDay:1,weekend:[6,7],minimalDays:1},"hr-BA":{firstDay:1,weekend:[6,7],minimalDays:1},hsb:{firstDay:1,weekend:[6,7],minimalDays:4},hu:{firstDay:1,weekend:[6,7],minimalDays:4},hy:{firstDay:1,weekend:[6,7],minimalDays:1},ia:{firstDay:1,weekend:[6,7],minimalDays:1},id:{firstDay:7,weekend:[6,7],minimalDays:1},ie:{firstDay:1,weekend:[6,7],minimalDays:4},ig:{firstDay:1,weekend:[6,7],minimalDays:1},ii:{firstDay:1,weekend:[6,7],minimalDays:1},io:{firstDay:1,weekend:[6,7],minimalDays:1},is:{firstDay:1,weekend:[6,7],minimalDays:4},it:{firstDay:1,weekend:[6,7],minimalDays:4},"it-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"it-SM":{firstDay:1,weekend:[6,7],minimalDays:4},"it-VA":{firstDay:1,weekend:[6,7],minimalDays:4},iu:{firstDay:7,weekend:[6,7],minimalDays:1},"iu-Latn":{firstDay:7,weekend:[6,7],minimalDays:1},ja:{firstDay:7,weekend:[6,7],minimalDays:1},jbo:{firstDay:1,weekend:[6,7],minimalDays:1},jgo:{firstDay:1,weekend:[6,7],minimalDays:1},jmc:{firstDay:1,weekend:[6,7],minimalDays:1},jv:{firstDay:7,weekend:[6,7],minimalDays:1},ka:{firstDay:1,weekend:[6,7],minimalDays:1},kab:{firstDay:6,weekend:[5,6],minimalDays:1},kaj:{firstDay:1,weekend:[6,7],minimalDays:1},kam:{firstDay:7,weekend:[6,7],minimalDays:1},kcg:{firstDay:1,weekend:[6,7],minimalDays:1},kde:{firstDay:1,weekend:[6,7],minimalDays:1},kea:{firstDay:1,weekend:[6,7],minimalDays:1},ken:{firstDay:1,weekend:[6,7],minimalDays:1},kgp:{firstDay:7,weekend:[6,7],minimalDays:1},khq:{firstDay:1,weekend:[6,7],minimalDays:1},ki:{firstDay:7,weekend:[6,7],minimalDays:1},kk:{firstDay:1,weekend:[6,7],minimalDays:1},kkj:{firstDay:1,weekend:[6,7],minimalDays:1},kl:{firstDay:1,weekend:[6,7],minimalDays:1},kln:{firstDay:7,weekend:[6,7],minimalDays:1},km:{firstDay:7,weekend:[6,7],minimalDays:1},kn:{firstDay:7,weekend:[7],minimalDays:1},ko:{firstDay:7,weekend:[6,7],minimalDays:1},"ko-CN":{firstDay:1,weekend:[6,7],minimalDays:1},"ko-KP":{firstDay:1,weekend:[6,7],minimalDays:1},kok:{firstDay:7,weekend:[7],minimalDays:1},kpe:{firstDay:1,weekend:[6,7],minimalDays:1},"kpe-GN":{firstDay:1,weekend:[6,7],minimalDays:1},ks:{firstDay:7,weekend:[7],minimalDays:1},"ks-Arab":{firstDay:7,weekend:[7],minimalDays:1},"ks-Deva":{firstDay:7,weekend:[7],minimalDays:1},ksb:{firstDay:1,weekend:[6,7],minimalDays:1},ksf:{firstDay:1,weekend:[6,7],minimalDays:1},ksh:{firstDay:1,weekend:[6,7],minimalDays:4},ku:{firstDay:1,weekend:[6,7],minimalDays:1},kw:{firstDay:1,weekend:[6,7],minimalDays:4},kxv:{firstDay:7,weekend:[7],minimalDays:1},"kxv-Deva":{firstDay:7,weekend:[7],minimalDays:1},"kxv-Latn":{firstDay:7,weekend:[7],minimalDays:1},"kxv-Orya":{firstDay:7,weekend:[7],minimalDays:1},"kxv-Telu":{firstDay:7,weekend:[7],minimalDays:1},ky:{firstDay:1,weekend:[6,7],minimalDays:1},la:{firstDay:1,weekend:[6,7],minimalDays:4},lag:{firstDay:1,weekend:[6,7],minimalDays:1},lb:{firstDay:1,weekend:[6,7],minimalDays:4},lg:{firstDay:1,weekend:[7],minimalDays:1},lij:{firstDay:1,weekend:[6,7],minimalDays:4},lkt:{firstDay:7,weekend:[6,7],minimalDays:1},lmo:{firstDay:1,weekend:[6,7],minimalDays:4},ln:{firstDay:1,weekend:[6,7],minimalDays:1},"ln-AO":{firstDay:1,weekend:[6,7],minimalDays:1},"ln-CF":{firstDay:1,weekend:[6,7],minimalDays:1},"ln-CG":{firstDay:1,weekend:[6,7],minimalDays:1},lo:{firstDay:7,weekend:[6,7],minimalDays:1},lrc:{firstDay:6,weekend:[5],minimalDays:1},"lrc-IQ":{firstDay:6,weekend:[5,6],minimalDays:1},lt:{firstDay:1,weekend:[6,7],minimalDays:4},lu:{firstDay:1,weekend:[6,7],minimalDays:1},luo:{firstDay:7,weekend:[6,7],minimalDays:1},luy:{firstDay:7,weekend:[6,7],minimalDays:1},lv:{firstDay:1,weekend:[6,7],minimalDays:1},mai:{firstDay:7,weekend:[7],minimalDays:1},mas:{firstDay:7,weekend:[6,7],minimalDays:1},"mas-TZ":{firstDay:1,weekend:[6,7],minimalDays:1},mdf:{firstDay:1,weekend:[6,7],minimalDays:4},mer:{firstDay:7,weekend:[6,7],minimalDays:1},mfe:{firstDay:1,weekend:[6,7],minimalDays:1},mg:{firstDay:1,weekend:[6,7],minimalDays:1},mgh:{firstDay:7,weekend:[6,7],minimalDays:1},mgo:{firstDay:1,weekend:[6,7],minimalDays:1},mi:{firstDay:1,weekend:[6,7],minimalDays:1},mic:{firstDay:7,weekend:[6,7],minimalDays:1},mk:{firstDay:1,weekend:[6,7],minimalDays:1},ml:{firstDay:7,weekend:[7],minimalDays:1},mn:{firstDay:1,weekend:[6,7],minimalDays:1},"mn-Mong":{firstDay:1,weekend:[6,7],minimalDays:1},"mn-Mong-MN":{firstDay:1,weekend:[6,7],minimalDays:1},mni:{firstDay:7,weekend:[7],minimalDays:1},"mni-Beng":{firstDay:7,weekend:[7],minimalDays:1},"mni-Mtei":{firstDay:7,weekend:[7],minimalDays:1},moh:{firstDay:7,weekend:[6,7],minimalDays:1},mr:{firstDay:7,weekend:[7],minimalDays:1},ms:{firstDay:1,weekend:[6,7],minimalDays:1},"ms-Arab":{firstDay:1,weekend:[6,7],minimalDays:1},"ms-Arab-BN":{firstDay:1,weekend:[6,7],minimalDays:1},"ms-BN":{firstDay:1,weekend:[6,7],minimalDays:1},"ms-ID":{firstDay:7,weekend:[6,7],minimalDays:1},"ms-SG":{firstDay:7,weekend:[6,7],minimalDays:1},mt:{firstDay:7,weekend:[6,7],minimalDays:1},mua:{firstDay:1,weekend:[6,7],minimalDays:1},mus:{firstDay:7,weekend:[6,7],minimalDays:1},my:{firstDay:7,weekend:[6,7],minimalDays:1},myv:{firstDay:1,weekend:[6,7],minimalDays:4},mzn:{firstDay:6,weekend:[5],minimalDays:1},naq:{firstDay:1,weekend:[6,7],minimalDays:1},nb:{firstDay:1,weekend:[6,7],minimalDays:4},"nb-SJ":{firstDay:1,weekend:[6,7],minimalDays:4},nd:{firstDay:7,weekend:[6,7],minimalDays:1},nds:{firstDay:1,weekend:[6,7],minimalDays:4},"nds-NL":{firstDay:1,weekend:[6,7],minimalDays:4},ne:{firstDay:7,weekend:[6,7],minimalDays:1},"ne-IN":{firstDay:7,weekend:[7],minimalDays:1},nl:{firstDay:1,weekend:[6,7],minimalDays:4},"nl-AW":{firstDay:1,weekend:[6,7],minimalDays:1},"nl-BE":{firstDay:1,weekend:[6,7],minimalDays:4},"nl-BQ":{firstDay:1,weekend:[6,7],minimalDays:1},"nl-CW":{firstDay:1,weekend:[6,7],minimalDays:1},"nl-SR":{firstDay:1,weekend:[6,7],minimalDays:1},"nl-SX":{firstDay:1,weekend:[6,7],minimalDays:1},nmg:{firstDay:1,weekend:[6,7],minimalDays:1},nn:{firstDay:1,weekend:[6,7],minimalDays:4},nnh:{firstDay:1,weekend:[6,7],minimalDays:1},no:{firstDay:1,weekend:[6,7],minimalDays:4},nqo:{firstDay:1,weekend:[6,7],minimalDays:1},nr:{firstDay:7,weekend:[6,7],minimalDays:1},nso:{firstDay:7,weekend:[6,7],minimalDays:1},nus:{firstDay:1,weekend:[6,7],minimalDays:1},nv:{firstDay:7,weekend:[6,7],minimalDays:1},ny:{firstDay:1,weekend:[6,7],minimalDays:1},nyn:{firstDay:1,weekend:[7],minimalDays:1},oc:{firstDay:1,weekend:[6,7],minimalDays:4},"oc-ES":{firstDay:1,weekend:[6,7],minimalDays:4},om:{firstDay:7,weekend:[6,7],minimalDays:1},"om-KE":{firstDay:7,weekend:[6,7],minimalDays:1},or:{firstDay:7,weekend:[7],minimalDays:1},os:{firstDay:1,weekend:[6,7],minimalDays:1},"os-RU":{firstDay:1,weekend:[6,7],minimalDays:4},osa:{firstDay:7,weekend:[6,7],minimalDays:1},pa:{firstDay:7,weekend:[7],minimalDays:1},"pa-Arab":{firstDay:7,weekend:[6,7],minimalDays:1},"pa-Guru":{firstDay:7,weekend:[7],minimalDays:1},pap:{firstDay:1,weekend:[6,7],minimalDays:1},"pap-AW":{firstDay:1,weekend:[6,7],minimalDays:1},pcm:{firstDay:1,weekend:[6,7],minimalDays:1},pis:{firstDay:1,weekend:[6,7],minimalDays:1},pl:{firstDay:1,weekend:[6,7],minimalDays:4},prg:{firstDay:1,weekend:[6,7],minimalDays:4},ps:{firstDay:6,weekend:[4,5],minimalDays:1},"ps-PK":{firstDay:7,weekend:[6,7],minimalDays:1},pt:{firstDay:7,weekend:[6,7],minimalDays:1},"pt-AO":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-CH":{firstDay:1,weekend:[6,7],minimalDays:4},"pt-CV":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-GQ":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-GW":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-LU":{firstDay:1,weekend:[6,7],minimalDays:4},"pt-MO":{firstDay:7,weekend:[6,7],minimalDays:1},"pt-MZ":{firstDay:7,weekend:[6,7],minimalDays:1},"pt-PT":{firstDay:7,weekend:[6,7],minimalDays:4},"pt-ST":{firstDay:1,weekend:[6,7],minimalDays:1},"pt-TL":{firstDay:1,weekend:[6,7],minimalDays:1},qu:{firstDay:7,weekend:[6,7],minimalDays:1},"qu-BO":{firstDay:1,weekend:[6,7],minimalDays:1},"qu-EC":{firstDay:1,weekend:[6,7],minimalDays:1},quc:{firstDay:7,weekend:[6,7],minimalDays:1},raj:{firstDay:7,weekend:[7],minimalDays:1},rhg:{firstDay:7,weekend:[6,7],minimalDays:1},"rhg-Rohg":{firstDay:7,weekend:[6,7],minimalDays:1},"rhg-Rohg-BD":{firstDay:7,weekend:[6,7],minimalDays:1},rif:{firstDay:1,weekend:[6,7],minimalDays:1},rm:{firstDay:1,weekend:[6,7],minimalDays:4},rn:{firstDay:1,weekend:[6,7],minimalDays:1},ro:{firstDay:1,weekend:[6,7],minimalDays:1},"ro-MD":{firstDay:1,weekend:[6,7],minimalDays:1},rof:{firstDay:1,weekend:[6,7],minimalDays:1},ru:{firstDay:1,weekend:[6,7],minimalDays:4},"ru-BY":{firstDay:1,weekend:[6,7],minimalDays:1},"ru-KG":{firstDay:1,weekend:[6,7],minimalDays:1},"ru-KZ":{firstDay:1,weekend:[6,7],minimalDays:1},"ru-MD":{firstDay:1,weekend:[6,7],minimalDays:1},"ru-UA":{firstDay:1,weekend:[6,7],minimalDays:1},rw:{firstDay:1,weekend:[6,7],minimalDays:1},rwk:{firstDay:1,weekend:[6,7],minimalDays:1},sa:{firstDay:7,weekend:[7],minimalDays:1},sah:{firstDay:1,weekend:[6,7],minimalDays:4},saq:{firstDay:7,weekend:[6,7],minimalDays:1},sat:{firstDay:7,weekend:[7],minimalDays:1},"sat-Deva":{firstDay:7,weekend:[7],minimalDays:1},"sat-Olck":{firstDay:7,weekend:[7],minimalDays:1},sbp:{firstDay:1,weekend:[6,7],minimalDays:1},sc:{firstDay:1,weekend:[6,7],minimalDays:4},scn:{firstDay:1,weekend:[6,7],minimalDays:4},sd:{firstDay:7,weekend:[6,7],minimalDays:1},"sd-Arab":{firstDay:7,weekend:[6,7],minimalDays:1},"sd-Deva":{firstDay:7,weekend:[7],minimalDays:1},sdh:{firstDay:6,weekend:[5],minimalDays:1},"sdh-IQ":{firstDay:6,weekend:[5,6],minimalDays:1},se:{firstDay:1,weekend:[6,7],minimalDays:4},"se-FI":{firstDay:1,weekend:[6,7],minimalDays:4},"se-SE":{firstDay:1,weekend:[6,7],minimalDays:4},seh:{firstDay:7,weekend:[6,7],minimalDays:1},ses:{firstDay:1,weekend:[6,7],minimalDays:1},sg:{firstDay:1,weekend:[6,7],minimalDays:1},shi:{firstDay:1,weekend:[6,7],minimalDays:1},"shi-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},"shi-Tfng":{firstDay:1,weekend:[6,7],minimalDays:1},shn:{firstDay:7,weekend:[6,7],minimalDays:1},"shn-TH":{firstDay:7,weekend:[6,7],minimalDays:1},si:{firstDay:1,weekend:[6,7],minimalDays:1},sid:{firstDay:7,weekend:[6,7],minimalDays:1},sk:{firstDay:1,weekend:[6,7],minimalDays:4},skr:{firstDay:7,weekend:[6,7],minimalDays:1},sl:{firstDay:1,weekend:[6,7],minimalDays:1},sma:{firstDay:1,weekend:[6,7],minimalDays:4},"sma-NO":{firstDay:1,weekend:[6,7],minimalDays:4},smj:{firstDay:1,weekend:[6,7],minimalDays:4},"smj-NO":{firstDay:1,weekend:[6,7],minimalDays:4},smn:{firstDay:1,weekend:[6,7],minimalDays:4},sms:{firstDay:1,weekend:[6,7],minimalDays:4},sn:{firstDay:7,weekend:[6,7],minimalDays:1},so:{firstDay:1,weekend:[6,7],minimalDays:1},"so-DJ":{firstDay:6,weekend:[6,7],minimalDays:1},"so-ET":{firstDay:7,weekend:[6,7],minimalDays:1},"so-KE":{firstDay:7,weekend:[6,7],minimalDays:1},sq:{firstDay:1,weekend:[6,7],minimalDays:1},"sq-MK":{firstDay:1,weekend:[6,7],minimalDays:1},"sq-XK":{firstDay:1,weekend:[6,7],minimalDays:1},sr:{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Cyrl":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Cyrl-BA":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Cyrl-ME":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Cyrl-XK":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Latn-BA":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Latn-ME":{firstDay:1,weekend:[6,7],minimalDays:1},"sr-Latn-XK":{firstDay:1,weekend:[6,7],minimalDays:1},ss:{firstDay:7,weekend:[6,7],minimalDays:1},"ss-SZ":{firstDay:1,weekend:[6,7],minimalDays:1},ssy:{firstDay:1,weekend:[6,7],minimalDays:1},st:{firstDay:7,weekend:[6,7],minimalDays:1},"st-LS":{firstDay:1,weekend:[6,7],minimalDays:1},su:{firstDay:7,weekend:[6,7],minimalDays:1},"su-Latn":{firstDay:7,weekend:[6,7],minimalDays:1},sv:{firstDay:1,weekend:[6,7],minimalDays:4},"sv-AX":{firstDay:1,weekend:[6,7],minimalDays:4},"sv-FI":{firstDay:1,weekend:[6,7],minimalDays:4},sw:{firstDay:1,weekend:[6,7],minimalDays:1},"sw-CD":{firstDay:1,weekend:[6,7],minimalDays:1},"sw-KE":{firstDay:7,weekend:[6,7],minimalDays:1},"sw-UG":{firstDay:1,weekend:[7],minimalDays:1},syr:{firstDay:6,weekend:[5,6],minimalDays:1},"syr-SY":{firstDay:6,weekend:[5,6],minimalDays:1},szl:{firstDay:1,weekend:[6,7],minimalDays:4},ta:{firstDay:7,weekend:[7],minimalDays:1},"ta-LK":{firstDay:1,weekend:[6,7],minimalDays:1},"ta-MY":{firstDay:1,weekend:[6,7],minimalDays:1},"ta-SG":{firstDay:7,weekend:[6,7],minimalDays:1},te:{firstDay:7,weekend:[7],minimalDays:1},teo:{firstDay:1,weekend:[7],minimalDays:1},"teo-KE":{firstDay:7,weekend:[6,7],minimalDays:1},tg:{firstDay:1,weekend:[6,7],minimalDays:1},th:{firstDay:7,weekend:[6,7],minimalDays:1},ti:{firstDay:7,weekend:[6,7],minimalDays:1},"ti-ER":{firstDay:1,weekend:[6,7],minimalDays:1},tig:{firstDay:1,weekend:[6,7],minimalDays:1},tk:{firstDay:1,weekend:[6,7],minimalDays:1},tn:{firstDay:7,weekend:[6,7],minimalDays:1},"tn-BW":{firstDay:7,weekend:[6,7],minimalDays:1},to:{firstDay:1,weekend:[6,7],minimalDays:1},tok:{firstDay:1,weekend:[6,7],minimalDays:1},tpi:{firstDay:1,weekend:[6,7],minimalDays:1},tr:{firstDay:1,weekend:[6,7],minimalDays:1},"tr-CY":{firstDay:1,weekend:[6,7],minimalDays:1},trv:{firstDay:7,weekend:[6,7],minimalDays:1},trw:{firstDay:7,weekend:[6,7],minimalDays:1},ts:{firstDay:7,weekend:[6,7],minimalDays:1},tt:{firstDay:1,weekend:[6,7],minimalDays:4},twq:{firstDay:1,weekend:[6,7],minimalDays:1},tyv:{firstDay:1,weekend:[6,7],minimalDays:4},tzm:{firstDay:1,weekend:[6,7],minimalDays:1},ug:{firstDay:1,weekend:[6,7],minimalDays:1},uk:{firstDay:1,weekend:[6,7],minimalDays:1},und:{firstDay:7,weekend:[6,7],minimalDays:1},ur:{firstDay:7,weekend:[6,7],minimalDays:1},"ur-IN":{firstDay:7,weekend:[7],minimalDays:1},uz:{firstDay:1,weekend:[6,7],minimalDays:1},"uz-Arab":{firstDay:6,weekend:[4,5],minimalDays:1},"uz-Cyrl":{firstDay:1,weekend:[6,7],minimalDays:1},"uz-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},vai:{firstDay:1,weekend:[6,7],minimalDays:1},"vai-Latn":{firstDay:1,weekend:[6,7],minimalDays:1},"vai-Vaii":{firstDay:1,weekend:[6,7],minimalDays:1},ve:{firstDay:7,weekend:[6,7],minimalDays:1},vec:{firstDay:1,weekend:[6,7],minimalDays:4},vi:{firstDay:1,weekend:[6,7],minimalDays:1},vmw:{firstDay:7,weekend:[6,7],minimalDays:1},vo:{firstDay:1,weekend:[6,7],minimalDays:1},vun:{firstDay:1,weekend:[6,7],minimalDays:1},wa:{firstDay:1,weekend:[6,7],minimalDays:4},wae:{firstDay:1,weekend:[6,7],minimalDays:4},wal:{firstDay:7,weekend:[6,7],minimalDays:1},wbp:{firstDay:1,weekend:[6,7],minimalDays:1},wo:{firstDay:1,weekend:[6,7],minimalDays:1},xh:{firstDay:7,weekend:[6,7],minimalDays:1},xnr:{firstDay:7,weekend:[7],minimalDays:1},xog:{firstDay:1,weekend:[7],minimalDays:1},yav:{firstDay:1,weekend:[6,7],minimalDays:1},yi:{firstDay:1,weekend:[6,7],minimalDays:1},yo:{firstDay:1,weekend:[6,7],minimalDays:1},"yo-BJ":{firstDay:1,weekend:[6,7],minimalDays:1},yrl:{firstDay:7,weekend:[6,7],minimalDays:1},"yrl-CO":{firstDay:7,weekend:[6,7],minimalDays:1},"yrl-VE":{firstDay:7,weekend:[6,7],minimalDays:1},yue:{firstDay:7,weekend:[6,7],minimalDays:1},"yue-Hans":{firstDay:1,weekend:[6,7],minimalDays:1},"yue-Hant":{firstDay:7,weekend:[6,7],minimalDays:1},za:{firstDay:1,weekend:[6,7],minimalDays:1},zgh:{firstDay:1,weekend:[6,7],minimalDays:1},zh:{firstDay:1,weekend:[6,7],minimalDays:1},"zh-Hans":{firstDay:1,weekend:[6,7],minimalDays:1},"zh-Hans-HK":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hans-MO":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hans-SG":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hant":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hant-HK":{firstDay:7,weekend:[6,7],minimalDays:1},"zh-Hant-MO":{firstDay:7,weekend:[6,7],minimalDays:1},zu:{firstDay:7,weekend:[6,7],minimalDays:1}},ln="Invalid date: day is greater than the maximum valid day for the month and year.",Bu="Invalid date: date is before the minimum allowed date.",qu="Invalid date: date is after the maximum allowed date.",kt="Invalid date: date is within a disabled range.",dn="Invalid time: time is before the minimum allowed time.",pn="Invalid time: time is after the maximum allowed time.",Nu="Invalid range: end time must be after start time.",zi="Invalid time: time is within a disabled range.",zu="Invalid date-time: date-time is before the minimum allowed date-time.",Gu="Invalid date-time: date-time is after the maximum allowed date-time.";function ae(e){const t=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return`${t}-${i}-${a}`}function re(e){const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);return t?new Date(Number(t[1]),Number(t[2])-1,Number(t[3])):new Date(e)}function Gi(e,t,i,a){const r=e.split("T")[0];if(t&&r<t.split("T")[0]||i&&r>i.split("T")[0])return!0;if(a&&a.length>0)for(const s of a){const o=s.start.split("T")[0],d=s.end?s.end.split("T")[0]:o;if(r>=o&&r<=d)return!0}return!1}function Gt(e,t,i,a,r){const s=e.split("T")[0];return t&&s<t.split("T")[0]?r?.minDateMessage??Bu:i&&s>i.split("T")[0]?r?.maxDateMessage??qu:Gi(s,void 0,void 0,a)?r?.disabledDateRangeMessage??kt:null}function un(e,t,i,a,r){const s=re(e),o=re(t);if(isNaN(s.getTime())||isNaN(o.getTime()))return!1;const d=new Date(s);d.setHours(0,0,0,0);const p=new Date(o);for(p.setHours(0,0,0,0);d<=p;){if(Gi(ae(d),a,r,i))return!0;d.setDate(d.getDate()+1)}return!1}function hn(e){return new Intl.DateTimeFormat(e??"en",{year:"numeric",month:"numeric",day:"numeric"}).formatToParts(new Date)}function cn(e,t){return e===2?new Date(t,1,29).getDate()===29||!t?29:28:e===4||e===6||e===9||e===11?30:31}function pr(e){return ct(e,new Date)}function ct(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function Vu(e){const t=[0,1,2,3,4,5,6],i=e%7;return[...t.slice(i),...t.slice(0,i)]}function mn(e){const t=e??"en",i=on[t]||on[t.split("-")[0]]||{firstDay:0};return Vu(i.firstDay)}function Uu(e){const t=new Intl.DateTimeFormat(e,{weekday:"narrow"}),i=new Date(2025,10,30);return mn(e).map(a=>{const r=new Date(i);return r.setDate(i.getDate()+a),t.format(r)})}function yn(e,t){return new Intl.DateTimeFormat(e,{month:"long",year:"numeric"}).format(t)}function Vi(e,t){return new Intl.DateTimeFormat(e,{dateStyle:"full"}).format(t)}function ur(e,t,i){for(let a=0;a<i;a++){const r=new Date(t.getFullYear(),t.getMonth()+a,1);if(e.getMonth()===r.getMonth()&&e.getFullYear()===r.getFullYear())return!0}return!1}function Zu(e,t,i="long"){return new Intl.DateTimeFormat(e,{month:i,year:"numeric"}).formatToParts(t).filter(r=>r.type==="month"||r.type==="year")}function hr(e,t){const i=e||"en-US",s=new Intl.DateTimeFormat(i,{day:"numeric"}).formatToParts(t).find(o=>o.type==="day");return s?s.value:t.getDate().toString()}function gn(e,t){const i=ae(e),a=ae(t);return i===a?{start:i}:{start:i,end:a}}function bn(e){return e.length?e.map(a=>({start:re(a.start).getTime(),end:re(a.end??a.start).getTime()})).sort((a,r)=>a.start-r.start).reduce((a,r)=>{const s=a[a.length-1];if(s){const o=new Date(s.end);if(o.setDate(o.getDate()+1),r.start<=o.getTime())return s.end=Math.max(s.end,r.end),a}return[...a,r]},[]).map(a=>gn(new Date(a.start),new Date(a.end))):[]}class Ui{constructor(t,i){this._currentDate=new Date,this._yearSelectorOpen=!1,this.host=t,this.options=i,t.addController(this)}hostConnected(){}get currentDate(){return this._currentDate}set currentDate(t){Object.is(t,this._currentDate)||(this._currentDate=t,this.host.requestUpdate())}get yearSelectorOpen(){return this._yearSelectorOpen}set yearSelectorOpen(t){Object.is(t,this._yearSelectorOpen)||(this._yearSelectorOpen=t,this.host.requestUpdate())}prevMonth(){const t=this._currentDate;this.currentDate=new Date(t.getFullYear(),t.getMonth()-1,1)}nextMonth(){const t=this._currentDate;this.currentDate=new Date(t.getFullYear(),t.getMonth()+1,1)}canGoPrev(){const t=this.options.getMinDate();if(!t)return!0;const i=new Date(this._currentDate.getFullYear(),this._currentDate.getMonth(),0);return ae(i)>=t}canGoNext(){const t=this.options.getMaxDate();if(!t)return!0;const i=(this.options.getNumberOfMonths()??1)-1,a=new Date(this._currentDate.getFullYear(),this._currentDate.getMonth()+i+1,1);return ae(a)<=t}get effectiveMinYear(){const t=this.options.getMinDate();return t?re(t).getFullYear():1900}get effectiveMaxYear(){const t=this.options.getMaxDate();return t?re(t).getFullYear():2099}get yearList(){const t=[];for(let i=this.effectiveMinYear;i<=this.effectiveMaxYear;i++)t.push(i);return t}toggleYearSelector(){this.yearSelectorOpen=!this._yearSelectorOpen,this.options.onYearSelectorToggled?.()}selectYear(t){this.currentDate=new Date(t,this._currentDate.getMonth(),1),this.yearSelectorOpen=!1}closeYearSelector(){this.yearSelectorOpen=!1}navigateToDate(t){!isNaN(t.getTime())&&!ur(t,this._currentDate,this.options.getNumberOfMonths()??1)&&(this.currentDate=t)}isDisabled(t){return Gi(ae(t),this.options.getMinDate(),this.options.getMaxDate(),this.options.getDisabledRanges())}}const Zi=e=>e?l.html`<span aria-hidden="true"> *</span>`:l.nothing,le=(e,t,i=!1,a=void 0,r=!0)=>r?t.label?l.html`<label
37
42
  class="gui-label"
38
43
  for=${e}
39
44
  data-cy=${`${e}_label`}
40
45
  id=${a?`${e}_${a}_label`:`${e}_label`}
41
46
  >
42
- ${t.label+(t.required?" *":"")} ${_s(e,t)}
43
- ${i?W(e,t):l.nothing}
47
+ ${t.label}${Zi(t.required)}
48
+ ${fn(e,t)} ${i?j(e,t):l.nothing}
44
49
  </label>`:l.nothing:t.label?l.html`<span
45
50
  class="gui-label"
46
51
  data-cy=${`${e}_label`}
47
52
  id=${a?`${e}_${a}_label`:`${e}_label`}
48
53
  >
49
- ${t.label+(t.required?" *":"")} ${_s(e,t)}
50
- ${i?W(e,t):l.nothing}
51
- </span>`:l.nothing,_s=(e,t)=>t.hint?l.html`<div class="gui-widget-hint" id=${`${e}_hint`}>${t.hint}</div>`:l.html``,Ke=(e,t)=>{const i={[`gui-${e}--icon`]:!1,[`gui-${e}--icon-right`]:!1};if(t.icon){i[`gui-${e}--icon`]=!0;const a={"gui-widget-icon":!0,[t.icon]:!0};return{widgetClasses:i,html:l.html`<span class=${w.classMap(a)} data-icon=${t.icon}></span>`}}else return{widgetClasses:i,html:l.html``}},W=(e,t)=>{const i=t.touched&&t.errors&&t.errors.length>0;return l.html`${i?l.html`<ul class="gui-validator" id=${`${e}_errors`} data-cy=${`${e}_validator-errors`}>
52
- ${t.errors?.map(a=>l.html`<li class="gui-validator__error" role="alert" data-cy=${`${e}_validator-error`}>
53
- ${a}
54
- </li>`)}
55
- </ul>`:""}`};function Vi(e){const t={uid:e.uid,label:e.label,hint:e.hint,errors:e.errors,touched:e.touched,required:e.required},i=Array.from({length:e.numberOfMonths??1},(a,r)=>r);return l.html`
56
- ${e.label?se(e.uid,t,!1,"calendar"):l.nothing}
54
+ ${t.label}${Zi(t.required)}
55
+ ${fn(e,t)} ${i?j(e,t):l.nothing}
56
+ </span>`:l.nothing,fn=(e,t)=>t.hint?l.html`<div class="gui-widget-hint" id=${`${e}_hint`}>${t.hint}</div>`:l.html``,Xe=(e,t)=>{const i={[`gui-${e}--icon`]:!1,[`gui-${e}--icon-right`]:!1};if(t.icon){i[`gui-${e}--icon`]=!0;const a={"gui-widget-icon":!0,[t.icon]:!0};return{widgetClasses:i,html:l.html`<span
57
+ class=${T.classMap(a)}
58
+ data-icon=${t.icon}
59
+ aria-hidden="true"
60
+ ></span>`}}else return{widgetClasses:i,html:l.html``}},j=(e,t)=>{const i=t.touched&&t.errors&&t.errors.length>0,a={"gui-validator":!0,"gui-validator--empty":!i};return l.html`<ul
61
+ class=${T.classMap(a)}
62
+ id=${`${e}_errors`}
63
+ role="alert"
64
+ data-cy=${i?`${e}_validator-errors`:l.nothing}
65
+ >
66
+ ${i?t.errors?.map(r=>l.html`<li class="gui-validator__error" data-cy=${`${e}_validator-error`}>
67
+ ${r}
68
+ </li>`):l.nothing}
69
+ </ul>`};function cr(e,t){const i=new Date(e);return i.setDate(1),i.setMonth(i.getMonth()+t),i}function Yi(e){const t={uid:e.uid,label:e.label,hint:e.hint,errors:e.errors,touched:e.touched,required:e.required},i=Array.from({length:e.numberOfMonths??1},(r,s)=>s),a=i.map(r=>yn(e.localeId,cr(e.currentDate,r))).join(", ");return l.html`
70
+ ${e.label?le(e.uid,t,!1,"calendar"):l.nothing}
57
71
 
58
72
  <div class="gui-widget" @focusout=${e.onFocusOut}>
59
73
  <div
60
- id=${e.uid}
74
+ id=${`${e.uid}_calendar`}
61
75
  class="gui-calendar-input"
62
76
  role="group"
63
77
  aria-labelledby=${e.label?`${e.uid}_calendar_label`:l.nothing}
64
- ?aria-disabled=${e.disabled}
78
+ aria-disabled=${e.disabled?"true":l.nothing}
65
79
  >
80
+ <div class="gui-visually-hidden" aria-live="polite">${a}</div>
66
81
  ${e.renderAboveCalendar()}
67
82
  <div class="gui-calendar__container">
68
- ${Ts("prev",{icon:e.prevMonthIcon,ariaLabel:e.prevMonthAriaLabel,disabled:!e.canGoPrev,onClick:e.onPrevMonthClick})}
83
+ ${vn("prev",{icon:e.prevMonthIcon,ariaLabel:e.prevMonthAriaLabel,disabled:!e.canGoPrev,onClick:e.onPrevMonthClick})}
69
84
 
70
85
  <div class="gui-calendar__months-grid">
71
- ${i.map(a=>e.renderMonthPanel(a))}
86
+ ${i.map(r=>e.renderMonthPanel(r))}
72
87
  </div>
73
88
 
74
- ${Ts("next",{icon:e.nextMonthIcon,ariaLabel:e.nextMonthAriaLabel,disabled:!e.canGoNext,onClick:e.onNextMonthClick})}
89
+ ${vn("next",{icon:e.nextMonthIcon,ariaLabel:e.nextMonthAriaLabel,disabled:!e.canGoNext,onClick:e.onNextMonthClick})}
75
90
  </div>
76
91
  </div>
77
92
  </div>
78
93
 
79
- ${e.errors?.length?W(e.uid,t):l.nothing}
80
- `}function Ts(e,t){return e==="prev"?l.html`
94
+ ${e.errors?.length?j(e.uid,t):l.nothing}
95
+ `}function vn(e,t){return e==="prev"?l.html`
81
96
  <button
82
97
  type="button"
83
- tabindex="0"
84
98
  class="gui-button gui-calendar__month-button gui-calendar__month-button--prev"
85
99
  ?disabled=${t.disabled}
86
100
  @click=${t.onClick}
87
101
  aria-label=${t.ariaLabel??"Previous month"}
88
102
  >
89
- ${t.icon?l.html`<span class=${`gui-widget-icon ${t.icon}`} data-icon=${t.icon}></span>`:l.html`<svg
103
+ ${t.icon?l.html`<span
104
+ class=${`gui-widget-icon ${t.icon}`}
105
+ data-icon=${t.icon}
106
+ aria-hidden="true"
107
+ ></span>`:l.html`<svg
90
108
  xmlns="http://www.w3.org/2000/svg"
91
109
  width="16"
92
110
  height="16"
93
111
  viewBox="0 0 256 256"
112
+ aria-hidden="true"
94
113
  >
95
114
  <path
96
115
  d="M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"
@@ -100,33 +119,41 @@
100
119
  `:l.html`
101
120
  <button
102
121
  type="button"
103
- tabindex="0"
104
122
  class="gui-button gui-calendar__month-button gui-calendar__month-button--next"
105
123
  ?disabled=${t.disabled}
106
124
  @click=${t.onClick}
107
125
  aria-label=${t.ariaLabel??"Next month"}
108
126
  >
109
- ${t.icon?l.html`<span class=${`gui-widget-icon ${t.icon}`} data-icon=${t.icon}></span>`:l.html`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256">
127
+ ${t.icon?l.html`<span
128
+ class=${`gui-widget-icon ${t.icon}`}
129
+ data-icon=${t.icon}
130
+ aria-hidden="true"
131
+ ></span>`:l.html`<svg
132
+ xmlns="http://www.w3.org/2000/svg"
133
+ width="16"
134
+ height="16"
135
+ viewBox="0 0 256 256"
136
+ aria-hidden="true"
137
+ >
110
138
  <path
111
139
  d="M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"
112
140
  ></path>
113
141
  </svg>`}
114
142
  </button>
115
- `}function Rp(e){const t=new Date(e.currentDate);return t.setDate(1),t.setMonth(t.getMonth()+e.offset),l.html`
143
+ `}function Yu(e){const t=cr(e.currentDate,e.offset);return l.html`
116
144
  <div class="gui-calendar__panel">
117
145
  ${e.renderHeader(t)} ${e.renderBelowHeader(e.offset)}
118
146
  ${e.renderPanelBody(e.offset)}
119
147
  </div>
120
- `}function Gi(e){return Rp({currentDate:e.currentDate,offset:e.offset,renderHeader:t=>Fp(t,{localeId:e.localeId,monthFormat:e.monthFormat,yearSelectorOpen:e.yearSelectorOpen,onToggleYearSelector:e.onToggleYearSelector}),renderBelowHeader:e.renderBelowHeader??(()=>l.nothing),renderPanelBody:e.renderPanelBody})}function Ui(e){return e.yearSelectorOpen&&e.offset===0?qp({years:e.years,currentYear:e.currentYear,onSelectYear:e.onSelectYear,onKeydown:e.onYearKeydown}):Bp(Da(e.getDays(e.offset),7),Ap(e.localeId),t=>e.renderDay(t))}function Fp(e,t){const i=Lp(t.localeId,e,t.monthFormat);return l.html`
148
+ `}function Hi(e){return Yu({currentDate:e.currentDate,offset:e.offset,renderHeader:t=>Hu(t,{localeId:e.localeId,monthFormat:e.monthFormat,yearSelectorOpen:e.yearSelectorOpen,selectYearAriaLabel:e.selectYearAriaLabel,onToggleYearSelector:e.onToggleYearSelector}),renderBelowHeader:e.renderBelowHeader??(()=>l.nothing),renderPanelBody:e.renderPanelBody})}function Wi(e){return e.yearSelectorOpen&&e.offset===0?Ku({years:e.years,currentYear:e.currentYear,onSelectYear:e.onSelectYear,onKeydown:e.onYearKeydown,ariaLabel:e.yearGridAriaLabel}):Wu(dr(e.getDays(e.offset),7),Uu(e.localeId),t=>e.renderDay(t),yn(e.localeId,cr(e.currentDate,e.offset)))}function Hu(e,t){const i=Zu(t.localeId,e,t.monthFormat);return l.html`
121
149
  <header class="gui-calendar__header">
122
150
  <h2>
123
151
  ${i.map(a=>a.type==="year"?l.html`<button
124
152
  type="button"
125
- tabindex="0"
126
153
  class="gui-calendar__year-selector"
127
154
  @click=${t.onToggleYearSelector}
128
155
  aria-expanded=${t.yearSelectorOpen}
129
- aria-label="Select year"
156
+ aria-label=${`${t.selectYearAriaLabel??"Select year"}, ${a.value}`}
130
157
  >
131
158
  <span class="gui-calendar__year-value">${a.value}</span>
132
159
  <span class="gui-calendar__year-arrow" aria-hidden="true">
@@ -144,26 +171,26 @@
144
171
  </button>`:l.html`<span class="gui-calendar__month-name">${a.value}</span>`)}
145
172
  </h2>
146
173
  </header>
147
- `}function Bp(e,t,i){return l.html`
148
- <div class="gui-calendar__days-grid" role="grid">
174
+ `}function Wu(e,t,i,a){return l.html`
175
+ <div class="gui-calendar__days-grid" role="grid" aria-label=${a??l.nothing}>
149
176
  <div role="row" class="gui-calendar__rows">
150
- ${qe.repeat(t,(a,r)=>r,a=>l.html`<span class="gui-calendar__weekday" role="gridcell">${a}</span>`)}
177
+ ${Ne.repeat(t,(r,s)=>s,r=>l.html`<span class="gui-calendar__weekday" role="columnheader">${r}</span>`)}
151
178
  </div>
152
179
 
153
- ${qe.repeat(e,a=>l.html`
180
+ ${Ne.repeat(e,r=>l.html`
154
181
  <div role="row" class="gui-calendar__rows">
155
- ${qe.repeat(a,r=>r.date.toISOString(),r=>i(r))}
182
+ ${Ne.repeat(r,s=>s.date.toISOString(),s=>i(s))}
156
183
  </div>
157
184
  `)}
158
185
  </div>
159
- `}function qp(e){const t=e.currentYear;return l.html`
186
+ `}function Ku(e){const t=e.currentYear;return l.html`
160
187
  <div
161
188
  class="gui-calendar__year-grid"
162
189
  role="grid"
163
- aria-label="Year selection"
190
+ aria-label=${e.ariaLabel??"Year selection"}
164
191
  @keydown=${e.onKeydown}
165
192
  >
166
- ${Da(e.years,4).map(i=>l.html`
193
+ ${dr(e.years,4).map(i=>l.html`
167
194
  <div role="row" class="gui-calendar__year-row">
168
195
  ${i.map(a=>l.html`
169
196
  <button
@@ -181,21 +208,24 @@
181
208
  </div>
182
209
  `)}
183
210
  </div>
184
- `}function Zi(e,t){const i=e.getTime();let a=!1,r=!1,s=!1,o=!1,u=!1,p=!1,d=!1,h=!1;if(t.selectedISO&&(a=dt(e,j(t.selectedISO))),t.invalidRange){const c=t.invalidRange.start,g=t.invalidRange.end;p=dt(e,c),d=dt(e,g),i>c.getTime()&&i<g.getTime()&&(h=!0)}if(t.selectingSpan&&(u=i>=t.selectingSpan.start.getTime()&&i<=t.selectingSpan.end.getTime()),t.ranges)for(const c of t.ranges)dt(e,c.start)&&(r=!0,s=!c.end),c.end&&(dt(e,c.end)&&(s=!0),i>c.start.getTime()&&i<c.end.getTime()&&(o=!0));if(t.workingRange){const{start:c,end:g}=t.workingRange;dt(e,c)&&(r=!0),dt(e,g)&&(s=!0),i>c.getTime()&&i<g.getTime()&&(o=!0)}return{isSelected:a,isRangeStart:r,isRangeEnd:s,isInRange:o,isOneDayRange:r&&s,isAnchor:t.anchor?dt(e,t.anchor):!1,isSelecting:u,isInvalidStart:p,isInvalidEnd:d,isInvalidInRange:h}}function Hi(e){const{currentDate:t,offset:i=0,localeId:a,numberOfMonths:r=1}=e,s=new Date(t.getFullYear(),t.getMonth()+i,1),o=s.getMonth(),u=s.getDay(),p=ws(a)[0],d=(u-p+7)%7,h=new Date(s);h.setDate(s.getDate()-d);let c=[];for(let g=0;g<42;g++){const f=new Date(h);f.setDate(h.getDate()+g),c.push(e.toDay({date:f,dayLabel:ka(a,f),isCurrentMonth:f.getMonth()===o,isToday:wa(f),isDisabled:e.isDisabled(f)}))}for(let g=0;g<2;g++)c.slice(-7).every(S=>!S.isCurrentMonth)&&(c=c.slice(0,-7));if(i===0&&!c.some(g=>g.isFocusable)&&!(e.focusFallbackDates??[]).some(f=>$a(f,t,r))){const f=c.find(S=>S.isCurrentMonth&&!S.isDisabled);f&&(f.isFocusable=!0)}return c}var Np=Object.defineProperty,zp=Object.getOwnPropertyDescriptor,le=(e,t,i,a)=>{for(var r=a>1?void 0:a?zp(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Np(t,i,r),r};let ae=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.localeId=void 0,this.errors=[],this.touched=void 0,this.required=!1,this.disabled=!1,this.readOnly=!1,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel="",this.nextMonthAriaLabel="",this.dayFormat="numeric",this.weekdayFormat="narrow",this.monthFormat="long",this.minDate=void 0,this.maxDate=void 0,this.disabledRanges=void 0,this.numberOfMonths=1,this.value=void 0,this._nav=new zi(this,{getMinDate:()=>this.minDate,getMaxDate:()=>this.maxDate,getNumberOfMonths:()=>this.numberOfMonths,getDisabledRanges:()=>this.disabledRanges,onYearSelectorToggled:()=>this._keyboard.onYearGridToggled()}),this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(".gui-calendar-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})}),this._keyboard=new Bi(this,{canGoPrev:()=>this._nav.canGoPrev(),canGoNext:()=>this._nav.canGoNext(),goPrev:()=>this._nav.prevMonth(),goNext:()=>this._nav.nextMonth(),onActivateDay:e=>{const t=j(e);this.selectDate({date:t,dayLabel:ka(this.localeId,t),isCurrentMonth:!0,isToday:wa(t),isSelected:!1,isFocusable:!0,isDisabled:!1})},onSelectYear:e=>this._nav.selectYear(e),onCloseYearGrid:()=>this._nav.closeYearSelector(),isYearGridOpen:()=>this._nav.yearSelectorOpen}),this._focusLeave=new Ft(this,{onLeave:()=>{this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}})}get _currentDate(){return this._nav.currentDate}set _currentDate(e){this._nav.currentDate=e}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){e.has("value")&&this.value&&this._nav.navigateToDate(j(this.value))}render(){return Vi({uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,numberOfMonths:this.numberOfMonths,prevMonthIcon:this.prevMonthIcon,nextMonthIcon:this.nextMonthIcon,prevMonthAriaLabel:this.prevMonthAriaLabel,nextMonthAriaLabel:this.nextMonthAriaLabel,canGoPrev:this._nav.canGoPrev(),canGoNext:this._nav.canGoNext(),onPrevMonthClick:this._keyboard.onPrevMonthClick,onNextMonthClick:this._keyboard.onNextMonthClick,onFocusOut:this._focusLeave.onFocusOut,renderAboveCalendar:()=>l.nothing,renderMonthPanel:e=>Gi({currentDate:this._nav.currentDate,offset:e,localeId:this.localeId,monthFormat:this.monthFormat,yearSelectorOpen:this._nav.yearSelectorOpen,onToggleYearSelector:()=>this._nav.toggleYearSelector(),renderPanelBody:t=>this.renderPanelBody(t)})})}renderPanelBody(e){return Ui({offset:e,yearSelectorOpen:this._nav.yearSelectorOpen,years:this._nav.yearList,currentYear:this._nav.currentDate.getFullYear(),onSelectYear:t=>this._keyboard.selectYear(t),onYearKeydown:this._keyboard.handleYearKeydown,localeId:this.localeId,getDays:t=>this.getDaysInMonth(t),renderDay:t=>this.renderDay(t)})}renderDay(e){const t={"gui-calendar__day-button":!0,today:e.isToday,selected:e.isSelected,disabled:e.isDisabled,"other-month":!e.isCurrentMonth};return l.html`
211
+ `}function Ki(e,t){const i=e.getTime();let a=!1,r=!1,s=!1,o=!1,d=!1,p=!1,u=!1,h=!1;if(t.selectedISO&&(a=ct(e,re(t.selectedISO))),t.invalidRange){const c=t.invalidRange.start,y=t.invalidRange.end;p=ct(e,c),u=ct(e,y),i>c.getTime()&&i<y.getTime()&&(h=!0)}if(t.selectingSpan&&(d=i>=t.selectingSpan.start.getTime()&&i<=t.selectingSpan.end.getTime()),t.ranges)for(const c of t.ranges)ct(e,c.start)&&(r=!0,s=!c.end),c.end&&(ct(e,c.end)&&(s=!0),i>c.start.getTime()&&i<c.end.getTime()&&(o=!0));if(t.workingRange){const{start:c,end:y}=t.workingRange;ct(e,c)&&(r=!0),ct(e,y)&&(s=!0),i>c.getTime()&&i<y.getTime()&&(o=!0)}return{isSelected:a,isRangeStart:r,isRangeEnd:s,isInRange:o,isOneDayRange:r&&s,isAnchor:t.anchor?ct(e,t.anchor):!1,isSelecting:d,isInvalidStart:p,isInvalidEnd:u,isInvalidInRange:h}}function Ji(e){const{currentDate:t,offset:i=0,localeId:a,numberOfMonths:r=1}=e,s=new Date(t.getFullYear(),t.getMonth()+i,1),o=s.getMonth(),d=s.getDay(),p=mn(a)[0],u=(d-p+7)%7,h=new Date(s);h.setDate(s.getDate()-u);let c=[];for(let y=0;y<42;y++){const g=new Date(h);g.setDate(h.getDate()+y),c.push(e.toDay({date:g,dayLabel:hr(a,g),isCurrentMonth:g.getMonth()===o,isToday:pr(g),isDisabled:e.isDisabled(g)}))}for(let y=0;y<2;y++)c.slice(-7).every(_=>!_.isCurrentMonth)&&(c=c.slice(0,-7));if(i===0&&!c.some(y=>y.isFocusable)&&!(e.focusFallbackDates??[]).some(g=>ur(g,t,r))){const g=c.find(_=>_.isCurrentMonth&&!_.isDisabled);g&&(g.isFocusable=!0)}return c}var Ju=Object.defineProperty,Xu=Object.getOwnPropertyDescriptor,ne=(e,t,i,a)=>{for(var r=a>1?void 0:a?Xu(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Ju(t,i,r),r};let se=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.localeId=void 0,this.errors=[],this.touched=void 0,this.required=!1,this.disabled=!1,this.readOnly=!1,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel="",this.nextMonthAriaLabel="",this.selectYearAriaLabel=void 0,this.yearGridAriaLabel=void 0,this.dayFormat="numeric",this.weekdayFormat="narrow",this.monthFormat="long",this.minDate=void 0,this.maxDate=void 0,this.disabledRanges=void 0,this.numberOfMonths=1,this.value=void 0,this._nav=new Ui(this,{getMinDate:()=>this.minDate,getMaxDate:()=>this.maxDate,getNumberOfMonths:()=>this.numberOfMonths,getDisabledRanges:()=>this.disabledRanges,onYearSelectorToggled:()=>this._keyboard.onYearGridToggled()}),this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(".gui-calendar-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})}),this._keyboard=new Ni(this,{canGoPrev:()=>this._nav.canGoPrev(),canGoNext:()=>this._nav.canGoNext(),goPrev:()=>this._nav.prevMonth(),goNext:()=>this._nav.nextMonth(),onActivateDay:e=>{const t=re(e);this.selectDate({date:t,dayLabel:hr(this.localeId,t),isCurrentMonth:!0,isToday:pr(t),isSelected:!1,isFocusable:!0,isDisabled:this.isDisabled(t)})},onSelectYear:e=>this._nav.selectYear(e),onCloseYearGrid:()=>this._nav.closeYearSelector(),isYearGridOpen:()=>this._nav.yearSelectorOpen}),this._focusLeave=new zt(this,{onLeave:()=>{this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}})}get _currentDate(){return this._nav.currentDate}set _currentDate(e){this._nav.currentDate=e}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){e.has("value")&&this.value&&this._nav.navigateToDate(re(this.value))}render(){return Yi({uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,numberOfMonths:this.numberOfMonths,localeId:this.localeId,currentDate:this._nav.currentDate,prevMonthIcon:this.prevMonthIcon,nextMonthIcon:this.nextMonthIcon,prevMonthAriaLabel:this.prevMonthAriaLabel,nextMonthAriaLabel:this.nextMonthAriaLabel,canGoPrev:this._nav.canGoPrev(),canGoNext:this._nav.canGoNext(),onPrevMonthClick:this._keyboard.onPrevMonthClick,onNextMonthClick:this._keyboard.onNextMonthClick,onFocusOut:this._focusLeave.onFocusOut,renderAboveCalendar:()=>l.nothing,renderMonthPanel:e=>Hi({currentDate:this._nav.currentDate,offset:e,localeId:this.localeId,monthFormat:this.monthFormat,yearSelectorOpen:this._nav.yearSelectorOpen,selectYearAriaLabel:this.selectYearAriaLabel,onToggleYearSelector:()=>this._nav.toggleYearSelector(),renderPanelBody:t=>this.renderPanelBody(t)})})}renderPanelBody(e){return Wi({offset:e,yearSelectorOpen:this._nav.yearSelectorOpen,years:this._nav.yearList,currentYear:this._nav.currentDate.getFullYear(),onSelectYear:t=>this._keyboard.selectYear(t),onYearKeydown:this._keyboard.handleYearKeydown,localeId:this.localeId,currentDate:this._nav.currentDate,yearGridAriaLabel:this.yearGridAriaLabel,getDays:t=>this.getDaysInMonth(t),renderDay:t=>this.renderDay(t)})}renderDay(e){const t={"gui-calendar__day-button":!0,today:e.isToday,selected:e.isSelected,disabled:e.isDisabled,"other-month":!e.isCurrentMonth};return l.html`
185
212
  <button
186
213
  type="button"
187
214
  role="gridcell"
188
- class=${w.classMap(t)}
215
+ class=${T.classMap(t)}
189
216
  tabindex=${e.isFocusable?0:-1}
190
- ?disabled=${!e.isCurrentMonth||e.isDisabled}
191
- data-date=${Q(e.date)}
217
+ ?disabled=${!e.isCurrentMonth}
218
+ aria-disabled=${e.isCurrentMonth&&e.isDisabled?"true":l.nothing}
219
+ aria-label=${Vi(this.localeId,e.date)}
220
+ aria-current=${e.isToday?"date":l.nothing}
221
+ data-date=${ae(e.date)}
192
222
  @click=${()=>this.selectDate(e)}
193
223
  @keydown=${i=>this._keyboard.handleDayKeydown(i)}
194
224
  aria-selected=${e.isSelected}
195
225
  >
196
226
  ${e.dayLabel}
197
227
  </button>
198
- `}getDaysInMonth(e){const t=this.value;return Hi({currentDate:this._currentDate,offset:e,localeId:this.localeId,numberOfMonths:this.numberOfMonths??1,isDisabled:i=>this.isDisabled(i),toDay:i=>{const a=Zi(i.date,{selectedISO:t}).isSelected;return{date:i.date,dayLabel:i.dayLabel,isCurrentMonth:i.isCurrentMonth,isToday:i.isToday,isDisabled:i.isDisabled,isSelected:a,isFocusable:(a||i.isToday)&&i.isCurrentMonth}},focusFallbackDates:[t?j(t):new Date]})}selectDate(e){if(!e.isCurrentMonth||e.isDisabled||this.disabled||this.readOnly)return;const t=Q(e.date);this.value=t,this.dispatchEvent(new CustomEvent("change",{detail:{value:t},bubbles:!0,composed:!0}))}isDisabled(e){return this._nav.isDisabled(e)}};le([n.property({type:String})],ae.prototype,"uid",2),le([n.property({type:String})],ae.prototype,"label",2),le([n.property({type:String})],ae.prototype,"hint",2),le([n.property({type:String,attribute:"locale-id"})],ae.prototype,"localeId",2),le([n.property({type:Array})],ae.prototype,"errors",2),le([n.property({type:Boolean})],ae.prototype,"touched",2),le([n.property({type:Boolean})],ae.prototype,"required",2),le([n.property({type:Boolean})],ae.prototype,"disabled",2),le([n.property({type:Boolean,attribute:"readonly"})],ae.prototype,"readOnly",2),le([n.property({type:String,attribute:"prev-month-icon"})],ae.prototype,"prevMonthIcon",2),le([n.property({type:String,attribute:"next-month-icon"})],ae.prototype,"nextMonthIcon",2),le([n.property({type:String,attribute:"prev-month-aria-label"})],ae.prototype,"prevMonthAriaLabel",2),le([n.property({type:String,attribute:"next-month-aria-label"})],ae.prototype,"nextMonthAriaLabel",2),le([n.property({type:String})],ae.prototype,"dayFormat",2),le([n.property({type:String})],ae.prototype,"weekdayFormat",2),le([n.property({type:String})],ae.prototype,"monthFormat",2),le([n.property({type:String})],ae.prototype,"minDate",2),le([n.property({type:String})],ae.prototype,"maxDate",2),le([n.property({type:Array})],ae.prototype,"disabledRanges",2),le([n.property({type:Number})],ae.prototype,"numberOfMonths",2),le([n.property({type:String})],ae.prototype,"value",2),ae=le([n.customElement("gui-calendar")],ae),typeof customElements<"u"&&!customElements.get("gui-calendar")&&customElements.define("gui-calendar",ae);var Vp=Object.defineProperty,Gp=Object.getOwnPropertyDescriptor,_a=(e,t,i,a)=>{for(var r=a>1?void 0:a?Gp(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Vp(t,i,r),r};let qt=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-calendar","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
228
+ `}getDaysInMonth(e){const t=this.value;return Ji({currentDate:this._currentDate,offset:e,localeId:this.localeId,numberOfMonths:this.numberOfMonths??1,isDisabled:i=>this.isDisabled(i),toDay:i=>{const a=Ki(i.date,{selectedISO:t}).isSelected;return{date:i.date,dayLabel:i.dayLabel,isCurrentMonth:i.isCurrentMonth,isToday:i.isToday,isDisabled:i.isDisabled,isSelected:a,isFocusable:(a||i.isToday)&&i.isCurrentMonth}},focusFallbackDates:[t?re(t):new Date]})}selectDate(e){if(!e.isCurrentMonth||e.isDisabled||this.disabled||this.readOnly)return;const t=ae(e.date);this.value=t,this.dispatchEvent(new CustomEvent("change",{detail:{value:t},bubbles:!0,composed:!0}))}isDisabled(e){return this._nav.isDisabled(e)}};ne([n.property({type:String})],se.prototype,"uid",2),ne([n.property({type:String})],se.prototype,"label",2),ne([n.property({type:String})],se.prototype,"hint",2),ne([n.property({type:String,attribute:"locale-id"})],se.prototype,"localeId",2),ne([n.property({type:Array})],se.prototype,"errors",2),ne([n.property({type:Boolean})],se.prototype,"touched",2),ne([n.property({type:Boolean})],se.prototype,"required",2),ne([n.property({type:Boolean})],se.prototype,"disabled",2),ne([n.property({type:Boolean,attribute:"readonly"})],se.prototype,"readOnly",2),ne([n.property({type:String,attribute:"prev-month-icon"})],se.prototype,"prevMonthIcon",2),ne([n.property({type:String,attribute:"next-month-icon"})],se.prototype,"nextMonthIcon",2),ne([n.property({type:String,attribute:"prev-month-aria-label"})],se.prototype,"prevMonthAriaLabel",2),ne([n.property({type:String,attribute:"next-month-aria-label"})],se.prototype,"nextMonthAriaLabel",2),ne([n.property({type:String,attribute:"select-year-aria-label"})],se.prototype,"selectYearAriaLabel",2),ne([n.property({type:String,attribute:"year-grid-aria-label"})],se.prototype,"yearGridAriaLabel",2),ne([n.property({type:String})],se.prototype,"dayFormat",2),ne([n.property({type:String})],se.prototype,"weekdayFormat",2),ne([n.property({type:String})],se.prototype,"monthFormat",2),ne([n.property({type:String})],se.prototype,"minDate",2),ne([n.property({type:String})],se.prototype,"maxDate",2),ne([n.property({type:Array})],se.prototype,"disabledRanges",2),ne([n.property({type:Number})],se.prototype,"numberOfMonths",2),ne([n.property({type:String})],se.prototype,"value",2),se=ne([n.customElement("gui-calendar")],se),typeof customElements<"u"&&!customElements.get("gui-calendar")&&customElements.define("gui-calendar",se);var Qu=Object.defineProperty,ju=Object.getOwnPropertyDescriptor,mr=(e,t,i,a)=>{for(var r=a>1?void 0:a?ju(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Qu(t,i,r),r};let Vt=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-calendar","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
199
229
  <gui-calendar
200
230
  .uid=${this.widget.uid}
201
231
  .label=${this.adapter.templateData.label}
@@ -210,6 +240,8 @@
210
240
  .nextMonthIcon=${this.adapter.templateData.nextMonthIcon}
211
241
  .prevMonthAriaLabel=${this.adapter.templateData.prevMonthAriaLabel}
212
242
  .nextMonthAriaLabel=${this.adapter.templateData.nextMonthAriaLabel}
243
+ .selectYearAriaLabel=${this.adapter.templateData.selectYearAriaLabel}
244
+ .yearGridAriaLabel=${this.adapter.templateData.yearGridAriaLabel}
213
245
  .dayFormat=${this.adapter.templateData.dayFormat}
214
246
  .weekdayFormat=${this.adapter.templateData.weekdayFormat}
215
247
  .monthFormat=${this.adapter.templateData.monthFormat}
@@ -221,37 +253,41 @@
221
253
  @change=${this.valueChanged}
222
254
  @blur=${()=>this.adapter.onBlur()}
223
255
  ></gui-calendar>
224
- `}valueChanged(e){const t=e?.target;this.adapter.valueChanged(t.value)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};_a([b.consume({context:m.formContext}),n.property({attribute:!1})],qt.prototype,"formContext",2),_a([b.provide({context:m.inputContext})],qt.prototype,"adapter",2),qt=_a([n.customElement("gui-calendar-input")],qt);const Up=Object.freeze(Object.defineProperty({__proto__:null,get CalendarElement(){return qt}},Symbol.toStringTag,{value:"Module"})),Ss=new Date(2025,0,15,9,5,0);function Wi(e,t){if(t==="12"||t==="24")return t;const{hourCycle:i}=new Intl.DateTimeFormat(e??"en",{hour:"numeric"}).resolvedOptions();return i==="h11"||i==="h12"?"12":"24"}function Cs(e,t){return new Intl.DateTimeFormat(e??"en",{hour:"numeric",minute:"numeric",hourCycle:t==="12"?"h12":"h23"}).formatToParts(Ss)}function xs(e,t){return new Intl.DateTimeFormat(e??"en",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",hourCycle:t==="12"?"h12":"h23"}).formatToParts(Ss)}function Zp(e){const t=new Intl.DateTimeFormat(e??"en",{hour:"numeric",hourCycle:"h12"}),i=a=>t.formatToParts(new Date(2025,0,15,a,0,0)).find(r=>r.type==="dayPeriod")?.value??"";return{am:i(9)||"AM",pm:i(21)||"PM"}}function Ta(e){const t=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0"),r=String(e.getHours()).padStart(2,"0"),s=String(e.getMinutes()).padStart(2,"0"),o=String(e.getSeconds()).padStart(2,"0");return`${t}-${i}-${a}T${r}:${s}:${o}`}function ht(e){const t=String(e.getHours()).padStart(2,"0"),i=String(e.getMinutes()).padStart(2,"0"),a=String(e.getSeconds()).padStart(2,"0");return`${t}:${i}:${a}`}function Yi(e){const t=/^([01]\d|2[0-3]):([0-5]\d)(?::([0-5]\d))?$/.exec(e);return t?{hours:Number(t[1]),minutes:Number(t[2]),seconds:Number(t[3]??0)}:null}function Y(e){const t=/^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/.exec(e);return t?new Date(Number(t[1]),Number(t[2])-1,Number(t[3]),Number(t[4]??0),Number(t[5]??0),Number(t[6]??0)):new Date(e)}const Hp="No available times";function Ae(e,t){const i=s=>s.length===5?`${s}:00`:s,a=i(e),r=i(t);return a<r?-1:a>r?1:0}function Es(e,t){const i=Yi(e);if(!i)return;const a=i.hours*60+i.minutes+(t||30);if(!(a>=1440))return ht(new Date(1970,0,1,Math.floor(a/60),a%60,0))}function Ms(e,t){if(!e?.length)return[];const i=j(t).getDay();return e.filter(a=>(a.date==null||a.date===t)&&(a.weekdays==null||a.weekdays.includes(i))).map(({start:a,end:r})=>({start:a,end:r}))}function Ki(e,t){return t?.length?t.some(i=>Ae(e,i.start)>=0&&Ae(e,i.end??i.start)<=0):!1}function Ps(e,t,i){if(!i?.length)return!1;const a=t??e;return i.some(r=>{const s=r.end??r.start;return Ae(e,s)<=0&&Ae(r.start,a)<=0})}function Is(e){return e.length===5?`${e}:00`:e}function Wp(e){if(!e.length)return[];const t=e.map(a=>({start:Is(a.start),end:Is(a.end??a.start)})).sort((a,r)=>Ae(a.start,r.start)),i=[];for(const a of t){const r=i[i.length-1];r&&Ae(a.start,r.end)<=0?Ae(a.end,r.end)>0&&(r.end=a.end):i.push({...a})}return i}function Os(e,t){return Y(e).getTime()<=Y(t).getTime()?{start:e,end:t}:{start:t,end:e}}function As(e){if(!e.length)return[];const t=e.map(a=>({start:Y(a.start).getTime(),end:Y(a.end??a.start).getTime()})).sort((a,r)=>a.start-r.start),i=[];for(const a of t){const r=i[i.length-1];r&&a.start<=r.end?a.end>r.end&&(r.end=a.end):i.push({start:a.start,end:a.end})}return i.map(a=>({start:Ta(new Date(a.start)),end:Ta(new Date(a.end))}))}function Ls(e,t){if(!t?.length)return!1;const i=Y(e.start).getTime(),a=Y(e.end??e.start).getTime();return t.some(r=>{const s=Y(r.start).getTime(),o=Y(r.end??r.start).getTime();return i<o&&s<a})}function Yp(e,t){if(!t?.length)return!1;const i=Y(`${e}T00:00:00`).getTime(),a=Y(`${e}T23:59:59`).getTime();return t.some(r=>{const s=Y(r.start).getTime(),o=Y(r.end??r.start).getTime();return s<=i&&o>=a})}function Sa(e,t){if(!e?.length)return[];const i=Y(`${t}T00:00:00`).getTime(),a=Y(`${t}T23:59:59`).getTime(),r=[];for(const s of e){const o=Y(s.start).getTime(),u=Y(s.end??s.start).getTime();if(u<i||o>a)continue;const p=o<=i?"00:00:00":ht(new Date(o)),d=u>=a?"23:59:59":ht(new Date(u));r.push({start:p,end:d})}return r}function Rs(e){const t=e.minuteStep||30,i=Yi(e.minTime??"")??{hours:0,minutes:0,seconds:0},a=ht(new Date(1970,0,1,i.hours,i.minutes,i.seconds)),r=e.maxTime??"23:59:59",s=[];for(let o=i.hours*60+i.minutes;o<1440;o+=t){const u=ht(new Date(1970,0,1,Math.floor(o/60),o%60,0));if(Ae(u,r)>0)break;Ae(u,a)<0||s.push({value:u,disabled:Ki(u,e.disabledRanges)})}return s}function Xi(e,t,i){const a=Yi(e);return a?new Intl.DateTimeFormat(t??"en",{hour:"numeric",minute:"numeric",hourCycle:i==="12"?"h12":"h23"}).format(new Date(2025,0,15,a.hours,a.minutes,a.seconds)):e}function Ca(e,t,i){const a=Y(e);return isNaN(a.getTime())?e:new Intl.DateTimeFormat(t??"en",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:i==="12"}).format(a)}function Fs(e,t,i,a){const r=Y(e).getTime();if(isNaN(r))return null;if(t){const s=Y(t);if(!isNaN(s.getTime())&&r<s.getTime())return a?.minDateTimeMessage??Pp}if(i){const s=Y(i);if(!isNaN(s.getTime())&&r>s.getTime())return a?.maxDateTimeMessage??Ip}return null}function Bs(e,t){const i=e%12;return t==="pm"?i+12:i}function Kp(e){const t=e>=12?"pm":"am";return{hour12:e%12===0?12:e%12,period:t}}function xa(){return{day:{type:"day",kind:"numeric",maxLength:2,min:1,max:31,placeholder:"dd"},month:{type:"month",kind:"numeric",maxLength:2,min:1,max:12,placeholder:"mm"},year:{type:"year",kind:"numeric",maxLength:4,min:1e3,max:9999,placeholder:"yyyy"}}}function Xp(e,t,i){return{hour:e==="12"?{type:"hour",kind:"numeric",maxLength:2,min:1,max:12,placeholder:"hh"}:{type:"hour",kind:"numeric",maxLength:2,min:0,max:23,placeholder:"hh",incrementFallback:0},minute:{type:"minute",kind:"numeric",maxLength:2,min:0,max:59,placeholder:"mm",step:t,incrementFallback:0,wrap:!0},dayPeriod:{type:"dayPeriod",kind:"dayPeriod",maxLength:8,min:0,max:0,placeholder:i}}}function qs(e,t,i){return e[t]?.[i]??""}function Ns(e,t,i,a){return{...e,[t]:{...e[t],[i]:a}}}function Jp(e,t){return{...e,[t]:{}}}function Qp(e,t,i){if(i!=="12")return e;let a=e;for(const r of t)qs(a,r,"dayPeriod")||(a=Ns(a,r,"dayPeriod","am"));return a}function jp(e,t){if(isNaN(t))return{value:t};if(!e)return{value:t};const i=Math.max(e.min,Math.min(e.max,t));return i===t?{value:t}:{value:i,writeBack:i.toString().padStart(e.maxLength??2,"0")}}function lt(e,t,i,a){const r=parseInt(e[i]??"",10),{value:s,writeBack:o}=jp(t[i],r);return o!==void 0&&(a[i]=o),s}function zs(e,t){const i={},a=lt(e,t.descriptors,"year",i),r=lt(e,t.descriptors,"month",i),s=lt(e,t.descriptors,"day",i),o=!isNaN(a)&&String(a).length===4,u=!isNaN(r)&&r>0,p=!isNaN(s)&&s>0;if(!(o&&u&&p))return{result:{kind:"incomplete"},writeBacks:i};if(s>Ds(r,a))return{result:{kind:"invalid",message:t.invalidDateMessage??ys},writeBacks:i};const d=new Date(a,r-1,s);return{result:{kind:"valid",iso:Q(d),instant:d},writeBacks:i}}function Vs(e,t){const i=t.hourFormat==="12",a={},r=lt(e,t.descriptors,"hour",a),s=lt(e,t.descriptors,"minute",a),o=e.dayPeriod??"";if(isNaN(r)||isNaN(s))return{result:{kind:"incomplete"},writeBacks:a};if(i&&o!=="am"&&o!=="pm")return{result:{kind:"incomplete"},writeBacks:a};const u=i?Bs(r,o):r,p=new Date(1970,0,1,u,s,0);return{result:{kind:"valid",iso:ht(p),instant:p},writeBacks:a}}function Gs(e,t){const i=t.hourFormat==="12",a={},r=lt(e,t.descriptors,"year",a),s=lt(e,t.descriptors,"month",a),o=lt(e,t.descriptors,"day",a),u=lt(e,t.descriptors,"hour",a),p=lt(e,t.descriptors,"minute",a),d=e.dayPeriod??"",h=!isNaN(r)&&String(r).length===4,c=!isNaN(s)&&s>0,g=!isNaN(o)&&o>0,f=!isNaN(u),S=!isNaN(p);if(!(h&&c&&g&&f&&S&&(!i||d==="am"||d==="pm")))return{result:{kind:"incomplete"},writeBacks:a};if(o>Ds(s,r))return{result:{kind:"invalid",message:t.invalidDateMessage??ys},writeBacks:a};const Be=i?Bs(u,d):u,at=new Date(r,s-1,o,Be,p,0);return{result:{kind:"valid",iso:Ta(at),instant:at},writeBacks:a}}function Ea(e,t){return t.minTime&&Ae(e,t.minTime)<0?t.minTimeMessage??gs:t.maxTime&&Ae(e,t.maxTime)>0?t.maxTimeMessage??bs:null}const ed=["Backspace","Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Delete","Enter"];function Us(e){return/^[0-9]$/.test(e)}function td(e,t){return ed.includes(e.key)||e.ctrlKey||e.metaKey||t?!1:!Us(e.key)}function id(e,t,i){const a=e?.step??1,r=e?.incrementFallback??1,s=i==="up"?a:-a,o=parseInt(t,10);let u;if(isNaN(o))u=r;else if(u=o+s,e?.wrap){const p=e.max-e.min+1;u=((u-e.min)%p+p)%p+e.min}else e&&(u=Math.max(e.min,Math.min(e.max,u)));return u.toString().padStart(e?.maxLength??2,"0")}const Zs=new Map;function Ji(e,t,i,a=!1){const r=i||1,s=`${e??""}|${t??""}|${r}|${a?"dt":"t"}`,o=Zs.get(s);if(o)return o;const u=Wi(e,t),p=Zp(e),d=Xp(u,r,p.am),h=a?{...xa(),...d}:d,c={effectiveHourFormat:u,dayPeriodLabels:p,descriptors:h};return Zs.set(s,c),c}class Et{constructor(t,i){this._values={},this._hasSurfacedInputError=!1,this.getPartDisplay=(a,r)=>{const s=this.getPart(a,r);if(r==="dayPeriod"&&(s==="am"||s==="pm")){const o=this.options.getDayPeriodLabels?.();if(o)return o[s]}return s},this.handleKeyDown=(a,r,s)=>{a.key==="Enter"&&this.options.onEnter&&(a.preventDefault(),a.target instanceof HTMLInputElement&&this.setPart(r,s,a.target.value.replace(/[^0-9]/g,""))),td(a,this.options.isReadonly())&&a.preventDefault()},this.handleDayPeriodKeyDown=a=>{(a.key==="ArrowUp"||a.key==="ArrowDown")&&a.preventDefault(),a.key==="Enter"&&a.preventDefault()},this.handleFocus=a=>{this.host.dispatchEvent(new CustomEvent("focus",{detail:a}))},this.handleKeyUp=(a,r,s)=>{if(this.options.isReadonly())return;const o=window.getComputedStyle(this.host).direction==="rtl",u=a.target,p=u,d=this.getGroupInputs(r),h=d.indexOf(u),c=this.options.getDescriptor(s);switch(u instanceof HTMLInputElement&&p.value.length===p.maxLength&&Us(a.key)&&(h===d.length-1?this.autoAdvanceFromGroupEnd(r):d[h+1].focus()),a.key){case"Enter":{this.options.onEnter?.(a,r);break}case"ArrowUp":case"ArrowDown":{if(c?.kind==="dayPeriod"){this.toggleDayPeriod(r,s);break}const g=id(c,p.value,a.key==="ArrowUp"?"up":"down");this.setPart(r,s,g),this.selectPart(u),this.options.commitGroup(r);break}case"ArrowLeft":case"ArrowRight":{const g=[...d].sort((Ee,Be)=>Ee.getBoundingClientRect().left-Be.getBoundingClientRect().left),f=g.indexOf(u),S=a.key==="ArrowRight"?f+1:f-1;S>=0&&S<g.length?(g[S].focus(),this.selectPart(g[S])):this.navigatePastGroupEdge(a.key,r,o);break}}},this.handleChange=(a,r,s)=>{if(a.stopImmediatePropagation(),this.options.isReadonly()||this.options.getDescriptor(s)?.kind==="dayPeriod")return;const p=a.target.value.replace(/[^0-9]/g,"");this.setPart(r,s,p),this.options.commitGroup(r)},this.handleBlur=(a,r,s)=>{const o=this.options.getDescriptor(s);if(o?.kind!=="dayPeriod"){const u=a.target,p=parseInt(u.value,10);!isNaN(p)&&(p>0||o?.min===0)?u.value=p.toString().padStart(o?.maxLength??2,"0"):this.options.onEmptyPartBlur()}this.host.dispatchEvent(new CustomEvent("blur"))},this.toggleDayPeriod=(a,r)=>{if(this.options.isReadonly()||this.options.isDisabled())return;const s=this.getPart(a,r);this.setPart(a,r,s==="am"?"pm":"am"),this.options.commitGroup(a)},this.host=t,this.options=i,t.addController(this)}hostConnected(){}get values(){return this._values}getPart(t,i){return qs(this._values,t,i)}setPart(t,i,a){this._values=Ns(this._values,t,i,a),this.host.requestUpdate()}clearGroup(t){this._values=Jp(this._values,t),this.host.requestUpdate()}applyWriteBacks(t,i){for(const[a,r]of Object.entries(i))r!==void 0&&this.setPart(t,a,r)}seedDayPeriods(t=this.options.groups){this.seedWith(t,this.options.getHourFormat?.()??"24")}seedWith(t,i){const a=Qp(this._values,t,i);a!==this._values&&(this._values=a,this.host.requestUpdate())}setGroupFromISO(t,i,a,r){const s=r??this.options.getHourFormat?.()??"24";if(!i){this.clearGroup(t),a!=="date"&&this.seedWith([t],s);return}if(a==="date"){const u=j(i);if(isNaN(u.getTime()))return;this.setPart(t,"year",String(u.getFullYear()).padStart(4,"0")),this.setPart(t,"month",String(u.getMonth()+1).padStart(2,"0")),this.setPart(t,"day",String(u.getDate()).padStart(2,"0"));return}if(a==="time"){let u=Yi(i);if(!u){const p=Y(i);if(isNaN(p.getTime()))return;u={hours:p.getHours(),minutes:p.getMinutes(),seconds:p.getSeconds()}}this.writeTimeParts(t,u.hours,u.minutes,s);return}const o=Y(i);isNaN(o.getTime())||(this.setPart(t,"day",String(o.getDate()).padStart(2,"0")),this.setPart(t,"month",String(o.getMonth()+1).padStart(2,"0")),this.setPart(t,"year",String(o.getFullYear()).padStart(4,"0")),this.writeTimeParts(t,o.getHours(),o.getMinutes(),s))}writeTimeParts(t,i,a,r){if(r==="12"){const{hour12:s,period:o}=Kp(i);this.setPart(t,"hour",s.toString().padStart(2,"0")),this.setPart(t,"dayPeriod",o)}else this.setPart(t,"hour",i.toString().padStart(2,"0"));this.setPart(t,"minute",a.toString().padStart(2,"0"))}getGroupInputs(t){return this.options.groups.length>1?Array.from(this.host.querySelectorAll(`[data-group="${t}"]`)):Array.from(this.host.querySelectorAll(`.${this.options.blockClass}__part`))}selectPart(t){t instanceof HTMLInputElement&&t.select()}focusFirst(t){requestAnimationFrame(()=>{this.getGroupInputs(t)[0]?.focus()})}autoAdvanceFromGroupEnd(t){const i=this.options.groups;if(i.length>1){const a=i[i.indexOf(t)+1];a!==void 0&&this.getGroupInputs(a)[0]?.focus();return}this.getGroupInputs(t)[0]?.focus()}navigatePastGroupEdge(t,i,a){const r=this.options.groups;if(r.length<=1)return;const s=r[0],o=r[r.length-1];if(t==="ArrowLeft"){const u=a?o:s;if(i!==u){const p=this.getGroupInputs(u),d=p[p.length-1];d&&(d.focus(),this.selectPart(d))}}else{const u=a?s:o;if(i!==u){const p=this.getGroupInputs(u);p[0]&&(p[0].focus(),this.selectPart(p[0]))}}}get hasSurfacedInputError(){return this._hasSurfacedInputError}surfaceInputError(t){this._hasSurfacedInputError=!0,this.options.onInputErrorSurfaced?.(t)}clearSurfacedInputError(t){this._hasSurfacedInputError&&(this._hasSurfacedInputError=!1,this.options.onSurfacedErrorCleared?.(t))}resetSurfacedInputError(){this._hasSurfacedInputError=!1}}const ad=(e,t)=>l.html`<span class="${t}__separator">${e.value}</span>`;function mt(e,t,i){const a=t.formatParts,r=t.groups.length>1,s=h=>r?`${e}-${h.type}`:h.type,o=(h,c)=>{if(h.type==="literal")return ad(h,t.blockClass);const g=t.getDescriptor(h.type);if(!g)return"";const f=e===t.groups[0]&&c===0?0:-1;return rd(e,g,f,t,i)},u=h=>h.type==="hour"||h.type==="minute"||h.type==="second",p=a.findIndex(u);if(p===-1)return qe.repeat(a,s,o);let d=a.length-1;for(;!u(a[d]);)d--;return l.html`
225
- ${qe.repeat(a.slice(0,p),s,o)}
256
+ `}valueChanged(e){const t=e?.target;this.adapter.valueChanged(t.value)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};mr([f.consume({context:m.formContext}),n.property({attribute:!1})],Vt.prototype,"formContext",2),mr([f.provide({context:m.inputContext})],Vt.prototype,"adapter",2),Vt=mr([n.customElement("gui-calendar-input")],Vt);const eh=Object.freeze(Object.defineProperty({__proto__:null,get CalendarElement(){return Vt}},Symbol.toStringTag,{value:"Module"})),Dn=new Date(2025,0,15,9,5,0);function Xi(e,t){if(t==="12"||t==="24")return t;const{hourCycle:i}=new Intl.DateTimeFormat(e??"en",{hour:"numeric"}).resolvedOptions();return i==="h11"||i==="h12"?"12":"24"}function wn(e,t){return new Intl.DateTimeFormat(e??"en",{hour:"numeric",minute:"numeric",hourCycle:t==="12"?"h12":"h23"}).formatToParts(Dn)}function $n(e,t){return new Intl.DateTimeFormat(e??"en",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",hourCycle:t==="12"?"h12":"h23"}).formatToParts(Dn)}function th(e){const t=new Intl.DateTimeFormat(e??"en",{hour:"numeric",hourCycle:"h12"}),i=a=>t.formatToParts(new Date(2025,0,15,a,0,0)).find(r=>r.type==="dayPeriod")?.value??"";return{am:i(9)||"AM",pm:i(21)||"PM"}}function yr(e){const t=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0"),r=String(e.getHours()).padStart(2,"0"),s=String(e.getMinutes()).padStart(2,"0"),o=String(e.getSeconds()).padStart(2,"0");return`${t}-${i}-${a}T${r}:${s}:${o}`}function mt(e){const t=String(e.getHours()).padStart(2,"0"),i=String(e.getMinutes()).padStart(2,"0"),a=String(e.getSeconds()).padStart(2,"0");return`${t}:${i}:${a}`}function Qi(e){const t=/^([01]\d|2[0-3]):([0-5]\d)(?::([0-5]\d))?$/.exec(e);return t?{hours:Number(t[1]),minutes:Number(t[2]),seconds:Number(t[3]??0)}:null}function ee(e){const t=/^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2}))?)?$/.exec(e);return t?new Date(Number(t[1]),Number(t[2])-1,Number(t[3]),Number(t[4]??0),Number(t[5]??0),Number(t[6]??0)):new Date(e)}const ih="No available times";function Re(e,t){const i=s=>s.length===5?`${s}:00`:s,a=i(e),r=i(t);return a<r?-1:a>r?1:0}function kn(e,t){const i=Qi(e);if(!i)return;const a=i.hours*60+i.minutes+(t||30);if(!(a>=1440))return mt(new Date(1970,0,1,Math.floor(a/60),a%60,0))}function Sn(e,t){if(!e?.length)return[];const i=re(t).getDay();return e.filter(a=>(a.date==null||a.date===t)&&(a.weekdays==null||a.weekdays.includes(i))).map(({start:a,end:r})=>({start:a,end:r}))}function ji(e,t){return t?.length?t.some(i=>Re(e,i.start)>=0&&Re(e,i.end??i.start)<=0):!1}function Tn(e,t,i){if(!i?.length)return!1;const a=t??e;return i.some(r=>{const s=r.end??r.start;return Re(e,s)<=0&&Re(r.start,a)<=0})}function _n(e){return e.length===5?`${e}:00`:e}function ah(e){if(!e.length)return[];const t=e.map(a=>({start:_n(a.start),end:_n(a.end??a.start)})).sort((a,r)=>Re(a.start,r.start)),i=[];for(const a of t){const r=i[i.length-1];r&&Re(a.start,r.end)<=0?Re(a.end,r.end)>0&&(r.end=a.end):i.push({...a})}return i}function An(e,t){return ee(e).getTime()<=ee(t).getTime()?{start:e,end:t}:{start:t,end:e}}function Cn(e){if(!e.length)return[];const t=e.map(a=>({start:ee(a.start).getTime(),end:ee(a.end??a.start).getTime()})).sort((a,r)=>a.start-r.start),i=[];for(const a of t){const r=i[i.length-1];r&&a.start<=r.end?a.end>r.end&&(r.end=a.end):i.push({start:a.start,end:a.end})}return i.map(a=>({start:yr(new Date(a.start)),end:yr(new Date(a.end))}))}function Ln(e,t){if(!t?.length)return!1;const i=ee(e.start).getTime(),a=ee(e.end??e.start).getTime();return t.some(r=>{const s=ee(r.start).getTime(),o=ee(r.end??r.start).getTime();return i<o&&s<a})}function rh(e,t){if(!t?.length)return!1;const i=ee(`${e}T00:00:00`).getTime(),a=ee(`${e}T23:59:59`).getTime();return t.some(r=>{const s=ee(r.start).getTime(),o=ee(r.end??r.start).getTime();return s<=i&&o>=a})}function gr(e,t){if(!e?.length)return[];const i=ee(`${t}T00:00:00`).getTime(),a=ee(`${t}T23:59:59`).getTime(),r=[];for(const s of e){const o=ee(s.start).getTime(),d=ee(s.end??s.start).getTime();if(d<i||o>a)continue;const p=o<=i?"00:00:00":mt(new Date(o)),u=d>=a?"23:59:59":mt(new Date(d));r.push({start:p,end:u})}return r}function xn(e){const t=e.minuteStep||30,i=Qi(e.minTime??"")??{hours:0,minutes:0,seconds:0},a=mt(new Date(1970,0,1,i.hours,i.minutes,i.seconds)),r=e.maxTime??"23:59:59",s=[];for(let o=i.hours*60+i.minutes;o<1440;o+=t){const d=mt(new Date(1970,0,1,Math.floor(o/60),o%60,0));if(Re(d,r)>0)break;Re(d,a)<0||s.push({value:d,disabled:ji(d,e.disabledRanges)})}return s}function ea(e,t,i){const a=Qi(e);return a?new Intl.DateTimeFormat(t??"en",{hour:"numeric",minute:"numeric",hourCycle:i==="12"?"h12":"h23"}).format(new Date(2025,0,15,a.hours,a.minutes,a.seconds)):e}function br(e,t,i){const a=ee(e);return isNaN(a.getTime())?e:new Intl.DateTimeFormat(t??"en",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:i==="12"}).format(a)}function En(e,t,i,a){const r=ee(e).getTime();if(isNaN(r))return null;if(t){const s=ee(t);if(!isNaN(s.getTime())&&r<s.getTime())return a?.minDateTimeMessage??zu}if(i){const s=ee(i);if(!isNaN(s.getTime())&&r>s.getTime())return a?.maxDateTimeMessage??Gu}return null}function Pn(e,t){const i=e%12;return t==="pm"?i+12:i}function sh(e){const t=e>=12?"pm":"am";return{hour12:e%12===0?12:e%12,period:t}}const St={day:"Day",month:"Month",year:"Year",hour:"Hour",minute:"Minute",second:"Second",dayPeriod:"AM/PM"};function fr(){return{day:{type:"day",kind:"numeric",maxLength:2,min:1,max:31,placeholder:"dd"},month:{type:"month",kind:"numeric",maxLength:2,min:1,max:12,placeholder:"mm"},year:{type:"year",kind:"numeric",maxLength:4,min:1e3,max:9999,placeholder:"yyyy"}}}function nh(e,t,i){return{hour:e==="12"?{type:"hour",kind:"numeric",maxLength:2,min:1,max:12,placeholder:"hh"}:{type:"hour",kind:"numeric",maxLength:2,min:0,max:23,placeholder:"hh",incrementFallback:0},minute:{type:"minute",kind:"numeric",maxLength:2,min:0,max:59,placeholder:"mm",step:t,incrementFallback:0,wrap:!0},dayPeriod:{type:"dayPeriod",kind:"dayPeriod",maxLength:8,min:0,max:0,placeholder:i}}}function On(e,t,i){return e[t]?.[i]??""}function In(e,t,i,a){return{...e,[t]:{...e[t],[i]:a}}}function oh(e,t){return{...e,[t]:{}}}function lh(e,t,i){if(i!=="12")return e;let a=e;for(const r of t)On(a,r,"dayPeriod")||(a=In(a,r,"dayPeriod","am"));return a}function dh(e,t){if(isNaN(t))return{value:t};if(!e)return{value:t};const i=Math.max(e.min,Math.min(e.max,t));return i===t?{value:t}:{value:i,writeBack:i.toString().padStart(e.maxLength??2,"0")}}function pt(e,t,i,a){const r=parseInt(e[i]??"",10),{value:s,writeBack:o}=dh(t[i],r);return o!==void 0&&(a[i]=o),s}function Mn(e,t){const i={},a=pt(e,t.descriptors,"year",i),r=pt(e,t.descriptors,"month",i),s=pt(e,t.descriptors,"day",i),o=!isNaN(a)&&String(a).length===4,d=!isNaN(r)&&r>0,p=!isNaN(s)&&s>0;if(!(o&&d&&p))return{result:{kind:"incomplete"},writeBacks:i};if(s>cn(r,a))return{result:{kind:"invalid",message:t.invalidDateMessage??ln},writeBacks:i};const u=new Date(a,r-1,s);return{result:{kind:"valid",iso:ae(u),instant:u},writeBacks:i}}function Rn(e,t){const i=t.hourFormat==="12",a={},r=pt(e,t.descriptors,"hour",a),s=pt(e,t.descriptors,"minute",a),o=e.dayPeriod??"";if(isNaN(r)||isNaN(s))return{result:{kind:"incomplete"},writeBacks:a};if(i&&o!=="am"&&o!=="pm")return{result:{kind:"incomplete"},writeBacks:a};const d=i?Pn(r,o):r,p=new Date(1970,0,1,d,s,0);return{result:{kind:"valid",iso:mt(p),instant:p},writeBacks:a}}function Fn(e,t){const i=t.hourFormat==="12",a={},r=pt(e,t.descriptors,"year",a),s=pt(e,t.descriptors,"month",a),o=pt(e,t.descriptors,"day",a),d=pt(e,t.descriptors,"hour",a),p=pt(e,t.descriptors,"minute",a),u=e.dayPeriod??"",h=!isNaN(r)&&String(r).length===4,c=!isNaN(s)&&s>0,y=!isNaN(o)&&o>0,g=!isNaN(d),_=!isNaN(p);if(!(h&&c&&y&&g&&_&&(!i||u==="am"||u==="pm")))return{result:{kind:"incomplete"},writeBacks:a};if(o>cn(s,r))return{result:{kind:"invalid",message:t.invalidDateMessage??ln},writeBacks:a};const Ae=i?Pn(d,u):d,st=new Date(r,s-1,o,Ae,p,0);return{result:{kind:"valid",iso:yr(st),instant:st},writeBacks:a}}function ta(e,t){return t.minTime&&Re(e,t.minTime)<0?t.minTimeMessage??dn:t.maxTime&&Re(e,t.maxTime)>0?t.maxTimeMessage??pn:null}const ph=["Backspace","Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Delete","Enter"];function Bn(e){return/^[0-9]$/.test(e)}function uh(e,t){return ph.includes(e.key)||e.ctrlKey||e.metaKey||t?!1:!Bn(e.key)}function hh(e,t,i){const a=e?.step??1,r=e?.incrementFallback??1,s=i==="up"?a:-a,o=parseInt(t,10);let d;if(isNaN(o))d=r;else if(d=o+s,e?.wrap){const p=e.max-e.min+1;d=((d-e.min)%p+p)%p+e.min}else e&&(d=Math.max(e.min,Math.min(e.max,d)));return d.toString().padStart(e?.maxLength??2,"0")}const qn=new Map;function ia(e,t,i,a=!1){const r=i||1,s=`${e??""}|${t??""}|${r}|${a?"dt":"t"}`,o=qn.get(s);if(o)return o;const d=Xi(e,t),p=th(e),u=nh(d,r,p.am),h=a?{...fr(),...u}:u,c={effectiveHourFormat:d,dayPeriodLabels:p,descriptors:h};return qn.set(s,c),c}class Pt{constructor(t,i){this._values={},this._hasSurfacedInputError=!1,this.getPartDisplay=(a,r)=>{const s=this.getPart(a,r);if(r==="dayPeriod"&&(s==="am"||s==="pm")){const o=this.options.getDayPeriodLabels?.();if(o)return o[s]}return s},this.handleKeyDown=(a,r,s)=>{a.key==="Enter"&&this.options.onEnter&&(a.preventDefault(),a.target instanceof HTMLInputElement&&this.setPart(r,s,a.target.value.replace(/[^0-9]/g,""))),uh(a,this.options.isReadonly())&&a.preventDefault()},this.handleDayPeriodKeyDown=a=>{(a.key==="ArrowUp"||a.key==="ArrowDown")&&a.preventDefault(),a.key==="Enter"&&a.preventDefault()},this.handleFocus=a=>{this.host.dispatchEvent(new CustomEvent("focus",{detail:a}))},this.handleKeyUp=(a,r,s)=>{if(this.options.isReadonly())return;const o=window.getComputedStyle(this.host).direction==="rtl",d=a.target,p=d,u=this.getGroupInputs(r),h=u.indexOf(d),c=this.options.getDescriptor(s);switch(d instanceof HTMLInputElement&&p.value.length===p.maxLength&&Bn(a.key)&&(h===u.length-1?this.autoAdvanceFromGroupEnd(r):u[h+1].focus()),a.key){case"Enter":{this.options.onEnter?.(a,r);break}case"ArrowUp":case"ArrowDown":{if(c?.kind==="dayPeriod"){this.toggleDayPeriod(r,s);break}const y=hh(c,p.value,a.key==="ArrowUp"?"up":"down");this.setPart(r,s,y),this.selectPart(d),this.options.commitGroup(r);break}case"ArrowLeft":case"ArrowRight":{const y=[...u].sort((x,Ae)=>x.getBoundingClientRect().left-Ae.getBoundingClientRect().left),g=y.indexOf(d),_=a.key==="ArrowRight"?g+1:g-1;_>=0&&_<y.length?(y[_].focus(),this.selectPart(y[_])):this.navigatePastGroupEdge(a.key,r,o);break}}},this.handleChange=(a,r,s)=>{if(a.stopImmediatePropagation(),this.options.isReadonly()||this.options.getDescriptor(s)?.kind==="dayPeriod")return;const p=a.target.value.replace(/[^0-9]/g,"");this.setPart(r,s,p),this.options.commitGroup(r)},this.handleBlur=(a,r,s)=>{const o=this.options.getDescriptor(s);if(o?.kind!=="dayPeriod"){const d=a.target,p=parseInt(d.value,10);!isNaN(p)&&(p>0||o?.min===0)?d.value=p.toString().padStart(o?.maxLength??2,"0"):this.options.onEmptyPartBlur()}this.host.dispatchEvent(new CustomEvent("blur"))},this.toggleDayPeriod=(a,r)=>{if(this.options.isReadonly()||this.options.isDisabled())return;const s=this.getPart(a,r);this.setPart(a,r,s==="am"?"pm":"am"),this.options.commitGroup(a)},this.host=t,this.options=i,t.addController(this)}hostConnected(){}get values(){return this._values}getPart(t,i){return On(this._values,t,i)}setPart(t,i,a){this._values=In(this._values,t,i,a),this.host.requestUpdate()}clearGroup(t){this._values=oh(this._values,t),this.host.requestUpdate()}applyWriteBacks(t,i){for(const[a,r]of Object.entries(i))r!==void 0&&this.setPart(t,a,r)}seedDayPeriods(t=this.options.groups){this.seedWith(t,this.options.getHourFormat?.()??"24")}seedWith(t,i){const a=lh(this._values,t,i);a!==this._values&&(this._values=a,this.host.requestUpdate())}setGroupFromISO(t,i,a,r){const s=r??this.options.getHourFormat?.()??"24";if(!i){this.clearGroup(t),a!=="date"&&this.seedWith([t],s);return}if(a==="date"){const d=re(i);if(isNaN(d.getTime()))return;this.setPart(t,"year",String(d.getFullYear()).padStart(4,"0")),this.setPart(t,"month",String(d.getMonth()+1).padStart(2,"0")),this.setPart(t,"day",String(d.getDate()).padStart(2,"0"));return}if(a==="time"){let d=Qi(i);if(!d){const p=ee(i);if(isNaN(p.getTime()))return;d={hours:p.getHours(),minutes:p.getMinutes(),seconds:p.getSeconds()}}this.writeTimeParts(t,d.hours,d.minutes,s);return}const o=ee(i);isNaN(o.getTime())||(this.setPart(t,"day",String(o.getDate()).padStart(2,"0")),this.setPart(t,"month",String(o.getMonth()+1).padStart(2,"0")),this.setPart(t,"year",String(o.getFullYear()).padStart(4,"0")),this.writeTimeParts(t,o.getHours(),o.getMinutes(),s))}writeTimeParts(t,i,a,r){if(r==="12"){const{hour12:s,period:o}=sh(i);this.setPart(t,"hour",s.toString().padStart(2,"0")),this.setPart(t,"dayPeriod",o)}else this.setPart(t,"hour",i.toString().padStart(2,"0"));this.setPart(t,"minute",a.toString().padStart(2,"0"))}getGroupInputs(t){return this.options.groups.length>1?Array.from(this.host.querySelectorAll(`[data-group="${t}"]`)):Array.from(this.host.querySelectorAll(`.${this.options.blockClass}__part`))}selectPart(t){t instanceof HTMLInputElement&&t.select()}focusFirst(t){requestAnimationFrame(()=>{this.getGroupInputs(t)[0]?.focus()})}autoAdvanceFromGroupEnd(t){const i=this.options.groups;if(i.length>1){const a=i[i.indexOf(t)+1];a!==void 0&&this.getGroupInputs(a)[0]?.focus();return}this.getGroupInputs(t)[0]?.focus()}navigatePastGroupEdge(t,i,a){const r=this.options.groups;if(r.length<=1)return;const s=r[0],o=r[r.length-1];if(t==="ArrowLeft"){const d=a?o:s;if(i!==d){const p=this.getGroupInputs(d),u=p[p.length-1];u&&(u.focus(),this.selectPart(u))}}else{const d=a?s:o;if(i!==d){const p=this.getGroupInputs(d);p[0]&&(p[0].focus(),this.selectPart(p[0]))}}}get hasSurfacedInputError(){return this._hasSurfacedInputError}surfaceInputError(t){this._hasSurfacedInputError=!0,this.options.onInputErrorSurfaced?.(t)}clearSurfacedInputError(t){this._hasSurfacedInputError&&(this._hasSurfacedInputError=!1,this.options.onSurfacedErrorCleared?.(t))}resetSurfacedInputError(){this._hasSurfacedInputError=!1}}const ch=(e,t)=>l.html`<span class="${t}__separator">${e.value}</span>`;function yt(e,t,i){const a=t.formatParts,r=t.groups.length>1,s=h=>r?`${e}-${h.type}`:h.type,o=(h,c)=>{if(h.type==="literal")return ch(h,t.blockClass);const y=t.getDescriptor(h.type);if(!y)return"";const g=e===t.groups[0]&&c===0?0:-1;return mh(e,y,g,t,i)},d=h=>h.type==="hour"||h.type==="minute"||h.type==="second",p=a.findIndex(d);if(p===-1)return Ne.repeat(a,s,o);let u=a.length-1;for(;!d(a[u]);)u--;return l.html`
257
+ ${Ne.repeat(a.slice(0,p),s,o)}
226
258
  <div class="gui-parts__time-cluster ${t.blockClass}__time-cluster" dir="ltr">
227
- ${qe.repeat(a.slice(p,d+1),s,(h,c)=>o(h,p+c))}
259
+ ${Ne.repeat(a.slice(p,u+1),s,(h,c)=>o(h,p+c))}
228
260
  </div>
229
- ${qe.repeat(a.slice(d+1),s,(h,c)=>o(h,d+1+c))}
230
- `}function rd(e,t,i,a,r){const s=a.blockClass,o=t.type;if(t.kind==="dayPeriod")return sd(e,t,i,a,r);const u=o==="year"?`gui-parts__year ${s}__year`:"";return l.html`
261
+ ${Ne.repeat(a.slice(u+1),s,(h,c)=>o(h,u+1+c))}
262
+ `}function mh(e,t,i,a,r){const s=a.blockClass,o=t.type;if(t.kind==="dayPeriod")return yh(e,t,i,a,r);const d=o==="year"?`gui-parts__year ${s}__year`:"",p=a.getDisplayValue(e,o),u=parseInt(p,10);return l.html`
231
263
  <div class="gui-parts__touch-target ${s}__touch-target">
232
264
  <input
233
265
  type="text"
234
266
  inputmode="numeric"
235
- class="gui-parts__part ${s}__part ${u}"
267
+ role="spinbutton"
268
+ class="gui-parts__part ${s}__part ${d}"
236
269
  data-type=${o}
237
270
  data-group=${a.groups.length>1?e:l.nothing}
238
271
  maxlength=${t.maxLength}
239
272
  placeholder=${t.placeholder}
240
273
  tabindex=${i}
241
- ?required=${a.required}
274
+ aria-label=${a.getPartAriaLabel?.(e,o)??St[o]}
275
+ aria-valuemin=${t.min}
276
+ aria-valuemax=${t.max}
277
+ aria-valuenow=${isNaN(u)?l.nothing:u}
242
278
  ?disabled=${a.disabled}
243
279
  ?readonly=${a.partsReadonly}
244
280
  autocomplete="off"
245
- .value=${an.live(a.getDisplayValue(e,o))}
246
- @keydown=${p=>r.handleKeyDown(p,e,o)}
247
- @keyup=${p=>r.handleKeyUp(p,e,o)}
281
+ .value=${Jn.live(a.getDisplayValue(e,o))}
282
+ @keydown=${h=>r.handleKeyDown(h,e,o)}
283
+ @keyup=${h=>r.handleKeyUp(h,e,o)}
248
284
  @focus=${r.handleFocus}
249
- @blur=${p=>r.handleBlur(p,e,o)}
250
- @change=${p=>r.handleChange(p,e,o)}
285
+ @blur=${h=>r.handleBlur(h,e,o)}
286
+ @change=${h=>r.handleChange(h,e,o)}
251
287
  />
252
288
  <div class="gui-parts__visual-underline ${s}__visual-underline"></div>
253
289
  </div>
254
- `}function sd(e,t,i,a,r){const s=a.blockClass,o=t.type;return l.html`
290
+ `}function yh(e,t,i,a,r){const s=a.blockClass,o=t.type;return l.html`
255
291
  <div class="gui-parts__touch-target ${s}__touch-target">
256
292
  <button
257
293
  type="button"
@@ -263,33 +299,39 @@
263
299
  aria-label=${a.dayPeriodAriaLabel??"AM/PM"}
264
300
  @click=${()=>r.toggleDayPeriod(e,o)}
265
301
  @keydown=${r.handleDayPeriodKeyDown}
266
- @keyup=${u=>r.handleKeyUp(u,e,o)}
302
+ @keyup=${d=>r.handleKeyUp(d,e,o)}
267
303
  @focus=${r.handleFocus}
268
- @blur=${u=>r.handleBlur(u,e,o)}
304
+ @blur=${d=>r.handleBlur(d,e,o)}
269
305
  >
270
306
  ${a.getDisplayValue(e,o)}
271
307
  </button>
272
308
  <div class="gui-parts__visual-underline ${s}__visual-underline"></div>
273
309
  </div>
274
- `}var nd=Object.defineProperty,od=Object.getOwnPropertyDescriptor,ve=(e,t,i,a)=>{for(var r=a>1?void 0:a?od(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&nd(t,i,r),r};let pe=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.icon="",this.hint=void 0,this.value=void 0,this.hourFormat=void 0,this.minuteStep=1,this.minTime=void 0,this.maxTime=void 0,this.minTimeMessage=void 0,this.maxTimeMessage=void 0,this.inputBlockClass="gui-time-input",this.groups=["default"],this._parts=new Et(this,{blockClass:this.inputBlockClass,groups:this.groups,getDescriptor:e=>this.getPartDescriptor(e),commitGroup:e=>this.validateAndEmit(e),isReadonly:()=>!!this.readOnly,isDisabled:()=>!!this.disabled,onEmptyPartBlur:()=>this.dispatchEvent(new CustomEvent("change",{detail:{value:null},bubbles:!0})),getHourFormat:()=>this.timeLocaleData.effectiveHourFormat,getDayPeriodLabels:()=>this.timeLocaleData.dayPeriodLabels}),this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`.${this.inputBlockClass}`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}get timeLocaleData(){return Ji(this.localeId,this.hourFormat,this.minuteStep)}getPartDescriptor(e){return this.timeLocaleData.descriptors[e]}willUpdate(e){(!this.hasUpdated||e.has("value")||e.has("hourFormat")||e.has("localeId"))&&this._parts.setGroupFromISO("default",this.value??"","time",this.timeLocaleData.effectiveHourFormat)}render(){const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,icon:this.icon,hint:this.hint},t={blockClass:this.inputBlockClass,groups:this.groups,formatParts:Cs(this.localeId,this.timeLocaleData.effectiveHourFormat),getDescriptor:a=>this.getPartDescriptor(a),getDisplayValue:this._parts.getPartDisplay,required:this.required,disabled:this.disabled,partsReadonly:!!this.readOnly},i={"gui-widget-icon":!0,[this.icon]:!0};return l.html`
275
- ${this.label?se(this.uid,e):l.nothing}
310
+ `}var gh=Object.defineProperty,bh=Object.getOwnPropertyDescriptor,ce=(e,t,i,a)=>{for(var r=a>1?void 0:a?bh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&gh(t,i,r),r};let oe=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.icon="",this.hint=void 0,this.hourAriaLabel=void 0,this.minuteAriaLabel=void 0,this.dayPeriodAriaLabel=void 0,this.value=void 0,this.hourFormat=void 0,this.minuteStep=1,this.minTime=void 0,this.maxTime=void 0,this.minTimeMessage=void 0,this.maxTimeMessage=void 0,this.inputBlockClass="gui-time-input",this.groups=["default"],this._parts=new Pt(this,{blockClass:this.inputBlockClass,groups:this.groups,getDescriptor:e=>this.getPartDescriptor(e),commitGroup:e=>this.validateAndEmit(e),isReadonly:()=>!!this.readOnly,isDisabled:()=>!!this.disabled,onEmptyPartBlur:()=>this.dispatchEvent(new CustomEvent("change",{detail:{value:null},bubbles:!0})),getHourFormat:()=>this.timeLocaleData.effectiveHourFormat,getDayPeriodLabels:()=>this.timeLocaleData.dayPeriodLabels}),this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`.${this.inputBlockClass}`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}get timeLocaleData(){return ia(this.localeId,this.hourFormat,this.minuteStep)}getPartDescriptor(e){return this.timeLocaleData.descriptors[e]}willUpdate(e){(!this.hasUpdated||e.has("value")||e.has("hourFormat")||e.has("localeId"))&&this._parts.setGroupFromISO("default",this.value??"","time",this.timeLocaleData.effectiveHourFormat)}render(){const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,icon:this.icon,hint:this.hint},t={blockClass:this.inputBlockClass,groups:this.groups,formatParts:wn(this.localeId,this.timeLocaleData.effectiveHourFormat),getDescriptor:a=>this.getPartDescriptor(a),getDisplayValue:this._parts.getPartDisplay,getPartAriaLabel:(a,r)=>({hour:this.hourAriaLabel,minute:this.minuteAriaLabel})[r]??St[r],dayPeriodAriaLabel:this.dayPeriodAriaLabel,disabled:this.disabled,partsReadonly:!!this.readOnly},i={"gui-widget-icon":!0,[this.icon]:!0};return l.html`
311
+ ${this.label?le(this.uid,e,!1,void 0,!1):l.nothing}
276
312
 
277
313
  <div class="gui-widget">
278
314
  <div
315
+ id=${this.uid}
279
316
  class="gui-widget-input gui-parts gui-parts-ring gui-time-input ${this.icon?"gui-calendar--icon":""}"
280
317
  role="group"
318
+ aria-labelledby=${`${this.uid}_label`}
281
319
  >
282
- ${mt("default",t,this._parts)}
320
+ ${yt("default",t,this._parts)}
283
321
  </div>
284
- ${this.icon?l.html`<span class=${w.classMap(i)} data-icon=${this.icon}></span>`:l.nothing}
322
+ ${this.icon?l.html`<span
323
+ class=${T.classMap(i)}
324
+ data-icon=${this.icon}
325
+ aria-hidden="true"
326
+ ></span>`:l.nothing}
285
327
  </div>
286
328
 
287
- ${this.showErrors&&this.errors?.length?W(this.uid,e):l.nothing}
288
- `}validateAndEmit(e){const{effectiveHourFormat:t,descriptors:i}=this.timeLocaleData,{result:a,writeBacks:r}=Vs(this._parts.values[e]??{},{hourFormat:t,descriptors:i});if(this._parts.applyWriteBacks(e,r),a.kind!=="valid"){this.requestUpdate();return}const s=Ea(a.iso,{minTime:this.minTime,maxTime:this.maxTime,minTimeMessage:this.minTimeMessage,maxTimeMessage:this.maxTimeMessage});if(s){this.dispatchEvent(new CustomEvent("change",{detail:{value:a.iso},bubbles:!0})),this.dispatchEvent(new CustomEvent("inputError",{detail:{message:s},bubbles:!0})),this.requestUpdate();return}this.value=a.iso,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0})),this.requestUpdate()}};ve([n.property({type:String})],pe.prototype,"uid",2),ve([n.property({type:String})],pe.prototype,"label",2),ve([n.property({type:String,attribute:"locale-id"})],pe.prototype,"localeId",2),ve([n.property({type:Array})],pe.prototype,"errors",2),ve([n.property({type:Boolean})],pe.prototype,"showErrors",2),ve([n.property({type:Boolean})],pe.prototype,"touched",2),ve([n.property({type:Boolean})],pe.prototype,"required",2),ve([n.property({type:Boolean})],pe.prototype,"disabled",2),ve([n.property({type:Boolean,attribute:"readonly"})],pe.prototype,"readOnly",2),ve([n.property({type:String})],pe.prototype,"icon",2),ve([n.property({type:String})],pe.prototype,"hint",2),ve([n.property({type:String})],pe.prototype,"value",2),ve([n.property({type:String,attribute:"hour-format"})],pe.prototype,"hourFormat",2),ve([n.property({type:Number,attribute:"minute-step"})],pe.prototype,"minuteStep",2),ve([n.property({type:String,attribute:"min-time"})],pe.prototype,"minTime",2),ve([n.property({type:String,attribute:"max-time"})],pe.prototype,"maxTime",2),ve([n.property({type:String,attribute:"min-time-message"})],pe.prototype,"minTimeMessage",2),ve([n.property({type:String,attribute:"max-time-message"})],pe.prototype,"maxTimeMessage",2),pe=ve([n.customElement("gui-time")],pe),typeof customElements<"u"&&!customElements.get("gui-time")&&customElements.define("gui-time",pe);var ld=Object.defineProperty,ud=Object.getOwnPropertyDescriptor,Le=(e,t,i,a)=>{for(var r=a>1?void 0:a?ud(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&ld(t,i,r),r};let _e=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.value=void 0,this.label=void 0,this.minTime=void 0,this.maxTime=void 0,this.minuteStep=void 0,this.disabledRanges=void 0,this.localeId=void 0,this.hourFormat=void 0,this.disabled=!1,this.readOnly=!1,this.height=void 0,this.itemHeight=void 0,this.columns=void 0,this.noAvailableTimesMessage=void 0}createRenderRoot(){return this}get effectiveColumns(){return this.columns||1}get timeOptions(){const e=Wi(this.localeId,this.hourFormat),t=[this.localeId,e,this.minTime,this.maxTime,this.minuteStep,JSON.stringify(this.disabledRanges??null)].join("|");return this._optionsCache?.key!==t&&(this._optionsCache={key:t,options:Rs({minTime:this.minTime,maxTime:this.maxTime,minuteStep:this.minuteStep,disabledRanges:this.disabledRanges}).map(i=>({...i,template:Xi(i.value,this.localeId,e)}))}),this._optionsCache.options}isSelected(e){return this.value!=null&&Ae(e.value,this.value)===0}get rovingIndex(){const e=this.timeOptions,t=e.findIndex(i=>this.isSelected(i)&&!i.disabled);return t!==-1?t:e.findIndex(i=>!i.disabled)}scrollToSelectedValue(){const e=this.querySelector(".gui-time-list__viewport"),t=this.querySelector(".gui-time-list__option--selected")??this.querySelector(".gui-time-list__option");if(e&&t){const i=e.getBoundingClientRect(),a=t.getBoundingClientRect(),r=e.scrollTop+(a.top-i.top)-i.height/2+a.height/2;e.scrollTop=Math.max(0,r)}}focusSelectedOption(){this.querySelector('.gui-time-list__option[tabindex="0"]')?.focus()}selectOption(e,t){t.stopPropagation(),!(this.disabled||this.readOnly||e.disabled)&&(this.value=e.value,this.dispatchEvent(new CustomEvent("change",{detail:{value:e.value},bubbles:!0,composed:!0})))}onKeyDown(e){const t=e.target;if(!t.classList.contains("gui-time-list__option"))return;const i=Array.from(this.querySelectorAll(".gui-time-list__option")),a=i.indexOf(t),r=this.effectiveColumns,s=window.getComputedStyle(this).direction==="rtl",o=c=>this.timeOptions[c].disabled;if(e.key==="Enter"||e.key===" "){e.preventDefault();const c=this.timeOptions[a];c&&this.selectOption(c,e);return}const u=va(e.key,{columns:r,isRTL:s,pageSize:$p(this.height,this.itemHeight,r)});if(u.kind==="none")return;if(e.preventDefault(),u.kind==="edge"){const c=u.edge==="first"?0:i.length-1,g=Ri(c,u.edge==="first"?1:-1,this.timeOptions.length,o,{includeStart:!0,outOfBounds:"none"});g!==-1&&i[g].focus();return}const p=u.delta,d=Math.min(Math.max(a+p,0),i.length-1);if(d===a)return;const h=Ri(d,p>0?1:-1,this.timeOptions.length,o,{includeStart:!0,outOfBounds:"none"});h!==-1&&h!==a&&i[h].focus()}renderOption(e,t,i){const a=this.isSelected(e),r={"gui-time-list__option":!0,"gui-time-list__option--selected":a};return l.html`
329
+ ${this.showErrors&&this.errors?.length?j(this.uid,e):l.nothing}
330
+ `}validateAndEmit(e){const{effectiveHourFormat:t,descriptors:i}=this.timeLocaleData,{result:a,writeBacks:r}=Rn(this._parts.values[e]??{},{hourFormat:t,descriptors:i});if(this._parts.applyWriteBacks(e,r),a.kind!=="valid"){this.requestUpdate();return}const s=ta(a.iso,{minTime:this.minTime,maxTime:this.maxTime,minTimeMessage:this.minTimeMessage,maxTimeMessage:this.maxTimeMessage});if(s){this.dispatchEvent(new CustomEvent("change",{detail:{value:a.iso},bubbles:!0})),this.dispatchEvent(new CustomEvent("inputError",{detail:{message:s},bubbles:!0})),this.requestUpdate();return}this.value=a.iso,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0})),this.requestUpdate()}};ce([n.property({type:String})],oe.prototype,"uid",2),ce([n.property({type:String})],oe.prototype,"label",2),ce([n.property({type:String,attribute:"locale-id"})],oe.prototype,"localeId",2),ce([n.property({type:Array})],oe.prototype,"errors",2),ce([n.property({type:Boolean})],oe.prototype,"showErrors",2),ce([n.property({type:Boolean})],oe.prototype,"touched",2),ce([n.property({type:Boolean})],oe.prototype,"required",2),ce([n.property({type:Boolean})],oe.prototype,"disabled",2),ce([n.property({type:Boolean,attribute:"readonly"})],oe.prototype,"readOnly",2),ce([n.property({type:String})],oe.prototype,"icon",2),ce([n.property({type:String})],oe.prototype,"hint",2),ce([n.property({type:String})],oe.prototype,"hourAriaLabel",2),ce([n.property({type:String})],oe.prototype,"minuteAriaLabel",2),ce([n.property({type:String})],oe.prototype,"dayPeriodAriaLabel",2),ce([n.property({type:String})],oe.prototype,"value",2),ce([n.property({type:String,attribute:"hour-format"})],oe.prototype,"hourFormat",2),ce([n.property({type:Number,attribute:"minute-step"})],oe.prototype,"minuteStep",2),ce([n.property({type:String,attribute:"min-time"})],oe.prototype,"minTime",2),ce([n.property({type:String,attribute:"max-time"})],oe.prototype,"maxTime",2),ce([n.property({type:String,attribute:"min-time-message"})],oe.prototype,"minTimeMessage",2),ce([n.property({type:String,attribute:"max-time-message"})],oe.prototype,"maxTimeMessage",2),oe=ce([n.customElement("gui-time")],oe),typeof customElements<"u"&&!customElements.get("gui-time")&&customElements.define("gui-time",oe);var fh=Object.defineProperty,vh=Object.getOwnPropertyDescriptor,Fe=(e,t,i,a)=>{for(var r=a>1?void 0:a?vh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&fh(t,i,r),r};let Ce=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.value=void 0,this.label=void 0,this.minTime=void 0,this.maxTime=void 0,this.minuteStep=void 0,this.disabledRanges=void 0,this.localeId=void 0,this.hourFormat=void 0,this.disabled=!1,this.readOnly=!1,this.height=void 0,this.itemHeight=void 0,this.columns=void 0,this.noAvailableTimesMessage=void 0}createRenderRoot(){return this}get effectiveColumns(){return this.columns||1}get timeOptions(){const e=Xi(this.localeId,this.hourFormat),t=[this.localeId,e,this.minTime,this.maxTime,this.minuteStep,JSON.stringify(this.disabledRanges??null)].join("|");return this._optionsCache?.key!==t&&(this._optionsCache={key:t,options:xn({minTime:this.minTime,maxTime:this.maxTime,minuteStep:this.minuteStep,disabledRanges:this.disabledRanges}).map(i=>({...i,template:ea(i.value,this.localeId,e)}))}),this._optionsCache.options}isSelected(e){return this.value!=null&&Re(e.value,this.value)===0}get rovingIndex(){const e=this.timeOptions,t=e.findIndex(i=>this.isSelected(i)&&!i.disabled);return t!==-1?t:e.findIndex(i=>!i.disabled)}scrollToSelectedValue(){const e=this.querySelector(".gui-time-list__viewport"),t=this.querySelector(".gui-time-list__option--selected")??this.querySelector(".gui-time-list__option");if(e&&t){const i=e.getBoundingClientRect(),a=t.getBoundingClientRect(),r=e.scrollTop+(a.top-i.top)-i.height/2+a.height/2;e.scrollTop=Math.max(0,r)}}focusSelectedOption(){this.querySelector('.gui-time-list__option[tabindex="0"]')?.focus()}selectOption(e,t){t.stopPropagation(),!(this.disabled||this.readOnly||e.disabled)&&(this.value=e.value,this.dispatchEvent(new CustomEvent("change",{detail:{value:e.value},bubbles:!0,composed:!0})))}onKeyDown(e){const t=e.target;if(!t.classList.contains("gui-time-list__option"))return;const i=Array.from(this.querySelectorAll(".gui-time-list__option")),a=i.indexOf(t),r=this.effectiveColumns,s=window.getComputedStyle(this).direction==="rtl",o=c=>this.timeOptions[c].disabled;if(e.key==="Enter"||e.key===" "){e.preventDefault();const c=this.timeOptions[a];c&&this.selectOption(c,e);return}const d=lr(e.key,{columns:r,isRTL:s,pageSize:Pu(this.height,this.itemHeight,r)});if(d.kind==="none")return;if(e.preventDefault(),d.kind==="edge"){const c=d.edge==="first"?0:i.length-1,y=Bi(c,d.edge==="first"?1:-1,this.timeOptions.length,o,{includeStart:!0,outOfBounds:"none"});y!==-1&&i[y].focus();return}const p=d.delta,u=Math.min(Math.max(a+p,0),i.length-1);if(u===a)return;const h=Bi(u,p>0?1:-1,this.timeOptions.length,o,{includeStart:!0,outOfBounds:"none"});h!==-1&&h!==a&&i[h].focus()}renderOption(e,t,i){const a=this.isSelected(e),r={"gui-time-list__option":!0,"gui-time-list__option--selected":a};return l.html`
289
331
  <button
290
332
  type="button"
291
333
  role=${i}
292
- class=${w.classMap(r)}
334
+ class=${T.classMap(r)}
293
335
  tabindex=${t===this.rovingIndex?0:-1}
294
336
  ?disabled=${e.disabled||this.disabled}
295
337
  data-value=${e.value}
@@ -300,7 +342,7 @@
300
342
  ${e.template}
301
343
  </button>
302
344
  `}render(){const e=this.timeOptions;if(e.length===0)return l.html`<div class="gui-time-list__empty">
303
- ${this.noAvailableTimesMessage??Hp}
345
+ ${this.noAvailableTimesMessage??ih}
304
346
  </div>`;const t=this.effectiveColumns,i=`--gui-time-list-height: ${this.height??300}px; --gui-time-list-item-height: ${this.itemHeight||40}px; --gui-time-list-columns: ${t};`;if(t===1)return l.html`
305
347
  <div
306
348
  class="gui-time-list__viewport"
@@ -311,7 +353,7 @@
311
353
  >
312
354
  ${e.map((r,s)=>this.renderOption(r,s,"option"))}
313
355
  </div>
314
- `;const a=Da(e,t);return l.html`
356
+ `;const a=dr(e,t);return l.html`
315
357
  <div
316
358
  class="gui-time-list__viewport gui-time-list__viewport--grid"
317
359
  role="grid"
@@ -321,25 +363,17 @@
321
363
  >
322
364
  ${a.map((r,s)=>l.html`
323
365
  <div role="row" class="gui-time-list__row">
324
- ${r.map((o,u)=>this.renderOption(o,s*t+u,"gridcell"))}
366
+ ${r.map((o,d)=>this.renderOption(o,s*t+d,"gridcell"))}
325
367
  </div>
326
368
  `)}
327
369
  </div>
328
- `}};Le([n.property({type:String})],_e.prototype,"uid",2),Le([n.property({type:String})],_e.prototype,"value",2),Le([n.property({type:String})],_e.prototype,"label",2),Le([n.property({type:String,attribute:"min-time"})],_e.prototype,"minTime",2),Le([n.property({type:String,attribute:"max-time"})],_e.prototype,"maxTime",2),Le([n.property({type:Number,attribute:"minute-step"})],_e.prototype,"minuteStep",2),Le([n.property({type:Array,attribute:"disabled-ranges"})],_e.prototype,"disabledRanges",2),Le([n.property({type:String,attribute:"locale-id"})],_e.prototype,"localeId",2),Le([n.property({type:String,attribute:"hour-format"})],_e.prototype,"hourFormat",2),Le([n.property({type:Boolean})],_e.prototype,"disabled",2),Le([n.property({type:Boolean,attribute:"readonly"})],_e.prototype,"readOnly",2),Le([n.property({type:Number})],_e.prototype,"height",2),Le([n.property({type:Number,attribute:"item-height"})],_e.prototype,"itemHeight",2),Le([n.property({type:Number})],_e.prototype,"columns",2),Le([n.property({type:String,attribute:"no-available-times-message"})],_e.prototype,"noAvailableTimesMessage",2),_e=Le([n.customElement("gui-time-list")],_e),typeof customElements<"u"&&!customElements.get("gui-time-list")&&customElements.define("gui-time-list",_e);class Mt{constructor(t,i){this._open=!1,this._restoringFocus=!1,this._suppressNextFocusOut=!1,this.show=()=>{this.options.isDisabled()||this._restoringFocus||(this.options.beforeOpen?.(this),this.setOpen(!0))},this.close=()=>{this.setOpen(!1)},this.toggle=()=>{this.options.isDisabled()||(this.options.keyToggleMode==="toggle"?this.setOpen(!this._open):this._open?this.close():this.show())},this.onAnchorClick=a=>{if(this.options.isDisabled())return;const r=a.target,s=this.options.clickIntent(r);if(s!=="ignore"){if(s==="open"){this.show();return}this.toggle()}},this.onAnchorKeyUp=a=>{this.options.isDisabled()||a.target===a.currentTarget&&(a.key==="Enter"||a.key===" ")&&this.toggle()},this.onAnchorKeyDown=a=>this.options.isDisabled()?!1:a.key==="Escape"&&this._open?(a.preventDefault(),a.stopPropagation(),this.restoreFocusToInput(),this.close(),!0):!1,this.onDocumentClick=a=>{if(!this._open)return;const r=a.composedPath();this.options.getInteriorElements().some(o=>!!o&&r.includes(o))||this.close()},this.onHostFocusOut=a=>{if(this._suppressNextFocusOut){this._suppressNextFocusOut=!1;return}this._open&&this.focusLeave.handleFocusOut(a)},this.host=t,this.options=i,this.focusLeave=new Ft(t,{onLeave:()=>this.close()}),t.addController(this)}get open(){return this._open}suppressNextFocusOut(){this._suppressNextFocusOut=!0}setOpen(t){this._open!==t&&(this._open=t,this.host.requestUpdate(),this.options.onOpenChanged?.(t))}restoreFocusToInput(){const t=this.host.querySelector(this.options.focusRestoreSelector);t&&(this._restoringFocus=!0,t.focus(),setTimeout(()=>{this._restoringFocus=!1}))}hostConnected(){document.addEventListener("click",this.onDocumentClick),this.host.addEventListener("focusout",this.onHostFocusOut)}hostDisconnected(){document.removeEventListener("click",this.onDocumentClick),this.host.removeEventListener("focusout",this.onHostFocusOut)}}var pd=Object.defineProperty,dd=Object.getOwnPropertyDescriptor,Z=(e,t,i,a)=>{for(var r=a>1?void 0:a?dd(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&pd(t,i,r),r};let q=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.icon="",this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.localeId=void 0,this.value=void 0,this.hourFormat=void 0,this.minuteStep=void 0,this.minTime=void 0,this.maxTime=void 0,this.disabledRanges=void 0,this.allowCustomTime=!1,this.height=void 0,this.itemHeight=void 0,this.columns=void 0,this.minTimeMessage=void 0,this.maxTimeMessage=void 0,this.disabledRangeMessage=void 0,this.noAvailableTimesMessage=void 0,this._popup=new Mt(this,{getInteriorElements:()=>[this._timeRef,this._listRef],focusRestoreSelector:"gui-time input, gui-time button",isDisabled:()=>!!this.disabled,clickIntent:e=>e.closest(".gui-time-list__option")?"ignore":e.closest("gui-time")||e.closest("gui-time-list")?"open":"toggle",keyToggleMode:"openClose",onOpenChanged:e=>{this.dispatchListToggle(e),e&&this.updateComplete.then(()=>this._listRef?.scrollToSelectedValue())}}),this.onKeyDown=e=>{if(this._popup.onAnchorKeyDown(e))return;if(e.key==="Enter"&&e.target.closest("gui-time")){this._popup.open&&this._popup.close(),this.commitValue(this.value,!0);return}this.allowCustomTime||this.readOnly||this.disabled||e.key!=="ArrowDown"&&e.key!=="ArrowUp"||!e.target.closest("gui-time")||(e.preventDefault(),this.selectAdjacentOption(e.key==="ArrowDown"?1:-1))}}createRenderRoot(){return this}updated(e){e.has("value")&&this._listRef&&this._listRef.value!==this.value&&(this._listRef.value=this.value)}render(){const e=Ke("timePicker",{icon:this.icon});return l.html`
329
- ${se(this.uid??"",{label:this.label,hint:this.hint,required:this.required})}
370
+ `}};Fe([n.property({type:String})],Ce.prototype,"uid",2),Fe([n.property({type:String})],Ce.prototype,"value",2),Fe([n.property({type:String})],Ce.prototype,"label",2),Fe([n.property({type:String,attribute:"min-time"})],Ce.prototype,"minTime",2),Fe([n.property({type:String,attribute:"max-time"})],Ce.prototype,"maxTime",2),Fe([n.property({type:Number,attribute:"minute-step"})],Ce.prototype,"minuteStep",2),Fe([n.property({type:Array,attribute:"disabled-ranges"})],Ce.prototype,"disabledRanges",2),Fe([n.property({type:String,attribute:"locale-id"})],Ce.prototype,"localeId",2),Fe([n.property({type:String,attribute:"hour-format"})],Ce.prototype,"hourFormat",2),Fe([n.property({type:Boolean})],Ce.prototype,"disabled",2),Fe([n.property({type:Boolean,attribute:"readonly"})],Ce.prototype,"readOnly",2),Fe([n.property({type:Number})],Ce.prototype,"height",2),Fe([n.property({type:Number,attribute:"item-height"})],Ce.prototype,"itemHeight",2),Fe([n.property({type:Number})],Ce.prototype,"columns",2),Fe([n.property({type:String,attribute:"no-available-times-message"})],Ce.prototype,"noAvailableTimesMessage",2),Ce=Fe([n.customElement("gui-time-list")],Ce),typeof customElements<"u"&&!customElements.get("gui-time-list")&&customElements.define("gui-time-list",Ce);class Ot{constructor(t,i){this._open=!1,this._restoringFocus=!1,this._suppressNextFocusOut=!1,this._pointerDownInside=!1,this._pointerDownTarget=null,this.show=()=>{this.options.isDisabled()||this._restoringFocus||(this.options.beforeOpen?.(this),this.setOpen(!0))},this.close=()=>{this.setOpen(!1)},this.openAndFocus=()=>{this.show(),!(!this._open||!this.options.focusPopupSelector)&&Promise.resolve(this.host.updateComplete).then(()=>{this.host.querySelector(this.options.focusPopupSelector)?.focus()})},this.toggle=()=>{this.options.isDisabled()||(this.options.keyToggleMode==="toggle"?this.setOpen(!this._open):this._open?this.close():this.show())},this.onAnchorClick=a=>{if(this.options.isDisabled())return;const r=this._pointerDownTarget??a.target,s=this.options.clickIntent(r);if(s!=="ignore"){if(s==="open"){this.show();return}this.toggle()}},this.onAnchorKeyDown=a=>this.options.isDisabled()?!1:a.key==="Escape"&&this._open?(a.preventDefault(),a.stopPropagation(),this.restoreFocusToInput(),this.close(),!0):!1,this.onDocumentClick=a=>{if(!this._open)return;!a.composedPath().includes(this.host)&&!this._pointerDownInside&&this.close()},this.onDocumentPointerDown=a=>{const r=a.composedPath();this._pointerDownInside=r.includes(this.host),this._pointerDownTarget=r[0]??null},this.onDocumentKeyDown=a=>{a.key!=="Tab"&&a.key!=="Escape"||(this._pointerDownInside=!1,this._pointerDownTarget=null)},this.closeOnFocusLeave=()=>{this._pointerDownInside||this.close()},this.onHostFocusOut=a=>{if(this._suppressNextFocusOut){this._suppressNextFocusOut=!1;return}if(!this._open)return;const r=a.relatedTarget;this._pointerDownInside&&(!r||r.contains(this.host))||this.focusLeave.handleFocusOut(a)},this.host=t,this.options=i,this.focusLeave=new zt(t,{onLeave:()=>{this.close()}}),t.addController(this)}get open(){return this._open}suppressNextFocusOut(){this._suppressNextFocusOut=!0}setOpen(t){this._open!==t&&(this._open=t,this.host.requestUpdate(),this.options.onOpenChanged?.(t))}restoreFocusToInput(){const t=this.host.querySelector(this.options.focusRestoreSelector);t&&(this._restoringFocus=!0,t.focus(),setTimeout(()=>{this._restoringFocus=!1}))}hostUpdated(){this._open&&this.options.isDisabled()&&this.close()}hostConnected(){document.addEventListener("click",this.onDocumentClick),document.addEventListener("pointerdown",this.onDocumentPointerDown,!0),document.addEventListener("keydown",this.onDocumentKeyDown,!0),this.host.addEventListener("focusout",this.onHostFocusOut)}hostDisconnected(){document.removeEventListener("click",this.onDocumentClick),document.removeEventListener("pointerdown",this.onDocumentPointerDown,!0),document.removeEventListener("keydown",this.onDocumentKeyDown,!0),this.host.removeEventListener("focusout",this.onHostFocusOut)}}var Dh=Object.defineProperty,wh=Object.getOwnPropertyDescriptor,Y=(e,t,i,a)=>{for(var r=a>1?void 0:a?wh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Dh(t,i,r),r};let q=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.icon="",this.toggleAriaLabel=void 0,this.hourAriaLabel=void 0,this.minuteAriaLabel=void 0,this.dayPeriodAriaLabel=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.localeId=void 0,this.value=void 0,this.hourFormat=void 0,this.minuteStep=void 0,this.minTime=void 0,this.maxTime=void 0,this.disabledRanges=void 0,this.allowCustomTime=!1,this.height=void 0,this.itemHeight=void 0,this.columns=void 0,this.minTimeMessage=void 0,this.maxTimeMessage=void 0,this.disabledRangeMessage=void 0,this.noAvailableTimesMessage=void 0,this._popup=new Ot(this,{focusRestoreSelector:"gui-time input, gui-time button",focusPopupSelector:'.gui-time-list__option[tabindex="0"]',isDisabled:()=>!!this.disabled,clickIntent:e=>e.closest(".gui-time-list__option")?"ignore":e.closest("gui-time")||e.closest("gui-time-list")?"open":"toggle",keyToggleMode:"openClose",onOpenChanged:e=>{this.dispatchListToggle(e),e&&this.updateComplete.then(()=>this._listRef?.scrollToSelectedValue())}}),this.onToggleClick=e=>{e.stopPropagation(),this._popup.open?this._popup.close():this._popup.openAndFocus()},this.onKeyDown=e=>{if(this._popup.onAnchorKeyDown(e))return;if(e.key==="Enter"&&e.target.closest("gui-time")){this._popup.open&&this._popup.close(),this.commitValue(this.value,!0);return}this.allowCustomTime||this.readOnly||this.disabled||e.key!=="ArrowDown"&&e.key!=="ArrowUp"||!e.target.closest("gui-time")||(e.preventDefault(),this.selectAdjacentOption(e.key==="ArrowDown"?1:-1))}}createRenderRoot(){return this}updated(e){e.has("value")&&this._listRef&&this._listRef.value!==this.value&&(this._listRef.value=this.value)}render(){const e=Xe("timePicker",{icon:this.icon});return l.html`
371
+ ${le(this.uid??"",{label:this.label,hint:this.hint,required:this.required},!1,void 0,!1)}
330
372
 
331
- <div
332
- role="button"
333
- tabindex="-1"
334
- class="gui-widget"
335
- aria-expanded=${this._popup.open}
336
- @keyup=${this._popup.onAnchorKeyUp}
337
- @keydown=${this.onKeyDown}
338
- @click=${this._popup.onAnchorClick}
339
- >
373
+ <div class="gui-widget" @keydown=${this.onKeyDown} @click=${this._popup.onAnchorClick}>
340
374
  <gui-time
341
375
  id="time-input"
342
- class=${w.classMap(e.widgetClasses)}
376
+ class=${T.classMap(e.widgetClasses)}
343
377
  .uid=${this.uid}
344
378
  .hint=${this.hint}
345
379
  .showErrors=${!1}
@@ -355,20 +389,42 @@
355
389
  .minuteStep=${this.minuteStep}
356
390
  .minTime=${this.minTime}
357
391
  .maxTime=${this.maxTime}
392
+ .hourAriaLabel=${this.hourAriaLabel}
393
+ .minuteAriaLabel=${this.minuteAriaLabel}
394
+ .dayPeriodAriaLabel=${this.dayPeriodAriaLabel}
358
395
  .minTimeMessage=${this.minTimeMessage}
359
396
  .maxTimeMessage=${this.maxTimeMessage}
360
397
  @blur=${this.onTimeBlur}
361
398
  @focus=${this._popup.show}
362
399
  @change=${this.onTimeChange}
363
400
  ></gui-time>
364
- <span class="gui-time-picker__arrow"
365
- ><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256">
401
+ <button
402
+ type="button"
403
+ class="gui-time-picker__arrow"
404
+ aria-label=${this.toggleAriaLabel??"Show time list"}
405
+ aria-haspopup="dialog"
406
+ aria-expanded=${this._popup.open?"true":"false"}
407
+ aria-controls=${`${this.uid}_popup`}
408
+ ?disabled=${this.disabled}
409
+ @click=${this.onToggleClick}
410
+ >
411
+ <svg
412
+ xmlns="http://www.w3.org/2000/svg"
413
+ width="16"
414
+ height="16"
415
+ viewBox="0 0 256 256"
416
+ aria-hidden="true"
417
+ >
366
418
  <path
367
419
  d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
368
- ></path></svg
369
- ></span>
420
+ ></path>
421
+ </svg>
422
+ </button>
370
423
 
371
424
  <gui-time-list
425
+ id=${`${this.uid}_popup`}
426
+ role="dialog"
427
+ aria-label=${this.label??"Time list"}
372
428
  .uid=${this.uid}
373
429
  .value=${this.value}
374
430
  .label=${this.label}
@@ -388,8 +444,8 @@
388
444
  ></gui-time-list>
389
445
  </div>
390
446
 
391
- ${this.showErrors?W(this.uid??"",{errors:this.errors,touched:this.touched}):""}
392
- `}onTimeChange(e){e.stopPropagation(),this.commitValue(e.detail.value)}onTimeBlur(){this.dispatchEvent(new CustomEvent("blur"))}onListChange(e){e.stopPropagation(),this.commitValue(e.detail.value,!0),this._popup.restoreFocusToInput(),this._popup.close()}commitValue(e,t=!1){this.value=e??void 0;const i=this.validateBounds(this.value);this.dispatchEvent(new CustomEvent("change",{detail:{value:e??null,commit:t},bubbles:!0,composed:!0})),i&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:i},bubbles:!0,composed:!0}))}validateBounds(e){return e&&Ki(e,this.disabledRanges)?this.disabledRangeMessage??qi:null}selectAdjacentOption(e){const t=Rs({minTime:this.minTime,maxTime:this.maxTime,minuteStep:this.minuteStep,disabledRanges:this.disabledRanges});if(!t.length)return;const i=t.findIndex(r=>r.value===this.value);let a=i===-1?e===1?0:t.length-1:i+e;for(;a>=0&&a<t.length&&t[a].disabled;)a+=e;a<0||a>=t.length||(this.commitValue(t[a].value),this._popup.show(),this.updateComplete.then(()=>this._listRef?.scrollToSelectedValue()))}closeList(){this._popup.close()}dispatchListToggle(e){this.dispatchEvent(new CustomEvent("listtoggle",{detail:{open:e},bubbles:!0,composed:!0}))}};Z([n.property({type:String})],q.prototype,"uid",2),Z([n.property({type:String})],q.prototype,"label",2),Z([n.property({type:String})],q.prototype,"hint",2),Z([n.property({type:String})],q.prototype,"icon",2),Z([n.property({type:Array})],q.prototype,"errors",2),Z([n.property({type:Boolean})],q.prototype,"showErrors",2),Z([n.property({type:Boolean})],q.prototype,"touched",2),Z([n.property({type:Boolean})],q.prototype,"required",2),Z([n.property({type:Boolean})],q.prototype,"disabled",2),Z([n.property({type:Boolean,attribute:"readonly"})],q.prototype,"readOnly",2),Z([n.property({type:String,attribute:"locale-id"})],q.prototype,"localeId",2),Z([n.property({type:String})],q.prototype,"value",2),Z([n.property({type:String,attribute:"hour-format"})],q.prototype,"hourFormat",2),Z([n.property({type:Number,attribute:"minute-step"})],q.prototype,"minuteStep",2),Z([n.property({type:String,attribute:"min-time"})],q.prototype,"minTime",2),Z([n.property({type:String,attribute:"max-time"})],q.prototype,"maxTime",2),Z([n.property({type:Array,attribute:"disabled-ranges"})],q.prototype,"disabledRanges",2),Z([n.property({type:Boolean,attribute:"allow-custom-time"})],q.prototype,"allowCustomTime",2),Z([n.property({type:Number})],q.prototype,"height",2),Z([n.property({type:Number,attribute:"item-height"})],q.prototype,"itemHeight",2),Z([n.property({type:Number})],q.prototype,"columns",2),Z([n.property({type:String,attribute:"min-time-message"})],q.prototype,"minTimeMessage",2),Z([n.property({type:String,attribute:"max-time-message"})],q.prototype,"maxTimeMessage",2),Z([n.property({type:String,attribute:"disabled-range-message"})],q.prototype,"disabledRangeMessage",2),Z([n.property({type:String,attribute:"no-available-times-message"})],q.prototype,"noAvailableTimesMessage",2),Z([n.query("gui-time")],q.prototype,"_timeRef",2),Z([n.query("gui-time-list")],q.prototype,"_listRef",2),q=Z([n.customElement("gui-time-picker")],q),typeof customElements<"u"&&!customElements.get("gui-time-picker")&&customElements.define("gui-time-picker",q);var hd=Object.defineProperty,md=Object.getOwnPropertyDescriptor,O=(e,t,i,a)=>{for(var r=a>1?void 0:a?md(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&hd(t,i,r),r};let M=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.localeId=void 0,this.errors=[],this.touched=void 0,this.required=!1,this.disabled=!1,this.readOnly=!1,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel="",this.nextMonthAriaLabel="",this.dayFormat="numeric",this.weekdayFormat="narrow",this.monthFormat="long",this.minDate=void 0,this.maxDate=void 0,this.disabledRanges=void 0,this.numberOfMonths=1,this.value=void 0,this.hourFormat=void 0,this.minuteStep=void 0,this.minTime=void 0,this.maxTime=void 0,this.disabledTimeRanges=void 0,this.minTimeMessage=void 0,this.maxTimeMessage=void 0,this.disabledTimeRangeMessage=void 0,this.noAvailableTimesMessage=void 0,this.allowCustomTime=!1,this._selectedDate=void 0,this._selectedTime=void 0,this._timeGridOpen=!1,this._internalValueChange=!1,this._nav=new zi(this,{getMinDate:()=>this.minDate,getMaxDate:()=>this.maxDate,getNumberOfMonths:()=>this.numberOfMonths,getDisabledRanges:()=>this.disabledRanges,onYearSelectorToggled:()=>this._keyboard.onYearGridToggled()}),this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(".gui-calendar-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})}),this._keyboard=new Bi(this,{canGoPrev:()=>this._nav.canGoPrev(),canGoNext:()=>this._nav.canGoNext(),goPrev:()=>this._nav.prevMonth(),goNext:()=>this._nav.nextMonth(),onActivateDay:e=>{const t=j(e);this.selectDate({date:t,dayLabel:ka(this.localeId,t),isCurrentMonth:!0,isToday:wa(t),isSelected:!1,isFocusable:!0,isDisabled:!1})},onSelectYear:e=>this._nav.selectYear(e),onCloseYearGrid:()=>this._nav.closeYearSelector(),isYearGridOpen:()=>this._nav.yearSelectorOpen}),this._focusLeave=new Ft(this,{onLeave:()=>{this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}})}get resolvedTimeRanges(){return this._selectedDate?Ms(this.disabledTimeRanges,this._selectedDate):[]}get timePicker(){return this.querySelector("gui-time-picker")}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){if(e.has("value")){if(this._internalValueChange){this._internalValueChange=!1;return}if(this.value){const t=Y(this.value);isNaN(t.getTime())||(this._selectedDate=Q(t),this._selectedTime=ht(t),$a(t,this._nav.currentDate,this.numberOfMonths??1)||(this._nav.currentDate=t))}else this._selectedTime&&(this._selectedDate=void 0,this._selectedTime=void 0)}}setValueInternal(e){this._internalValueChange=!0,this.value=e}emitChange(e,t=!1){this.dispatchEvent(new CustomEvent("change",{detail:{value:e,commit:t},bubbles:!0,composed:!0}))}selectDate(e){if(!e.isCurrentMonth||e.isDisabled||this.disabled||this.readOnly)return;const t=Q(e.date);t!==this._selectedDate&&(this._selectedDate=t,this._selectedTime=void 0,this.value&&(this.setValueInternal(void 0),this.emitChange(null)))}commitTime(e,t=!1){this._selectedDate&&(this._selectedTime=e,this.setValueInternal(`${this._selectedDate}T${e}`),this.emitChange(this.value,t))}onTimePickerChange(e){e.stopPropagation();const t=e.detail.value,i=e.detail.commit===!0;if(!t){this._selectedTime=void 0,this.value&&(this.setValueInternal(void 0),this.emitChange(null));return}this.commitTime(t,i)}onListToggle(e){e.stopPropagation();const{open:t}=e.detail;if(t&&this.readOnly){this.timePicker?.closeList();return}this._timeGridOpen=t,t&&(this._nav.yearSelectorOpen=!1)}toggleYearSelector(){this.timePicker?.closeList(),this._nav.toggleYearSelector()}render(){return Vi({uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,numberOfMonths:this.numberOfMonths,prevMonthIcon:this.prevMonthIcon,nextMonthIcon:this.nextMonthIcon,prevMonthAriaLabel:this.prevMonthAriaLabel,nextMonthAriaLabel:this.nextMonthAriaLabel,canGoPrev:this._nav.canGoPrev(),canGoNext:this._nav.canGoNext(),onPrevMonthClick:this._keyboard.onPrevMonthClick,onNextMonthClick:this._keyboard.onNextMonthClick,onFocusOut:this._focusLeave.onFocusOut,renderAboveCalendar:()=>l.nothing,renderMonthPanel:e=>Gi({currentDate:this._nav.currentDate,offset:e,localeId:this.localeId,monthFormat:this.monthFormat,yearSelectorOpen:this._nav.yearSelectorOpen,onToggleYearSelector:()=>this.toggleYearSelector(),renderBelowHeader:t=>this.renderBelowHeader(t),renderPanelBody:t=>this.renderPanelBody(t)})})}renderBelowHeader(e){return e!==0?l.nothing:l.html`
447
+ ${this.showErrors?j(this.uid??"",{errors:this.errors,touched:this.touched}):""}
448
+ `}onTimeChange(e){e.stopPropagation(),this.commitValue(e.detail.value)}onTimeBlur(){this.dispatchEvent(new CustomEvent("blur"))}onListChange(e){e.stopPropagation(),this.commitValue(e.detail.value,!0),this._popup.restoreFocusToInput(),this._popup.close()}commitValue(e,t=!1){this.value=e??void 0;const i=this.validateBounds(this.value);this.dispatchEvent(new CustomEvent("change",{detail:{value:e??null,commit:t},bubbles:!0,composed:!0})),i&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:i},bubbles:!0,composed:!0}))}validateBounds(e){if(!e)return null;const t=ta(e,{minTime:this.minTime,maxTime:this.maxTime,minTimeMessage:this.minTimeMessage,maxTimeMessage:this.maxTimeMessage});return t||(ji(e,this.disabledRanges)?this.disabledRangeMessage??zi:null)}selectAdjacentOption(e){const t=xn({minTime:this.minTime,maxTime:this.maxTime,minuteStep:this.minuteStep,disabledRanges:this.disabledRanges});if(!t.length)return;const i=t.findIndex(r=>r.value===this.value);let a=i===-1?e===1?0:t.length-1:i+e;for(;a>=0&&a<t.length&&t[a].disabled;)a+=e;a<0||a>=t.length||(this.commitValue(t[a].value),this._popup.show(),this.updateComplete.then(()=>this._listRef?.scrollToSelectedValue()))}closeList(){this._popup.close()}dispatchListToggle(e){this.dispatchEvent(new CustomEvent("listtoggle",{detail:{open:e},bubbles:!0,composed:!0}))}};Y([n.property({type:String})],q.prototype,"uid",2),Y([n.property({type:String})],q.prototype,"label",2),Y([n.property({type:String})],q.prototype,"hint",2),Y([n.property({type:String})],q.prototype,"icon",2),Y([n.property({type:String,attribute:"toggle-aria-label"})],q.prototype,"toggleAriaLabel",2),Y([n.property({type:String})],q.prototype,"hourAriaLabel",2),Y([n.property({type:String})],q.prototype,"minuteAriaLabel",2),Y([n.property({type:String})],q.prototype,"dayPeriodAriaLabel",2),Y([n.property({type:Array})],q.prototype,"errors",2),Y([n.property({type:Boolean})],q.prototype,"showErrors",2),Y([n.property({type:Boolean})],q.prototype,"touched",2),Y([n.property({type:Boolean})],q.prototype,"required",2),Y([n.property({type:Boolean})],q.prototype,"disabled",2),Y([n.property({type:Boolean,attribute:"readonly"})],q.prototype,"readOnly",2),Y([n.property({type:String,attribute:"locale-id"})],q.prototype,"localeId",2),Y([n.property({type:String})],q.prototype,"value",2),Y([n.property({type:String,attribute:"hour-format"})],q.prototype,"hourFormat",2),Y([n.property({type:Number,attribute:"minute-step"})],q.prototype,"minuteStep",2),Y([n.property({type:String,attribute:"min-time"})],q.prototype,"minTime",2),Y([n.property({type:String,attribute:"max-time"})],q.prototype,"maxTime",2),Y([n.property({type:Array,attribute:"disabled-ranges"})],q.prototype,"disabledRanges",2),Y([n.property({type:Boolean,attribute:"allow-custom-time"})],q.prototype,"allowCustomTime",2),Y([n.property({type:Number})],q.prototype,"height",2),Y([n.property({type:Number,attribute:"item-height"})],q.prototype,"itemHeight",2),Y([n.property({type:Number})],q.prototype,"columns",2),Y([n.property({type:String,attribute:"min-time-message"})],q.prototype,"minTimeMessage",2),Y([n.property({type:String,attribute:"max-time-message"})],q.prototype,"maxTimeMessage",2),Y([n.property({type:String,attribute:"disabled-range-message"})],q.prototype,"disabledRangeMessage",2),Y([n.property({type:String,attribute:"no-available-times-message"})],q.prototype,"noAvailableTimesMessage",2),Y([n.query("gui-time-list")],q.prototype,"_listRef",2),q=Y([n.customElement("gui-time-picker")],q),typeof customElements<"u"&&!customElements.get("gui-time-picker")&&customElements.define("gui-time-picker",q);var $h=Object.defineProperty,kh=Object.getOwnPropertyDescriptor,I=(e,t,i,a)=>{for(var r=a>1?void 0:a?kh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&$h(t,i,r),r};let E=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.localeId=void 0,this.errors=[],this.touched=void 0,this.required=!1,this.disabled=!1,this.readOnly=!1,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel="",this.nextMonthAriaLabel="",this.selectYearAriaLabel=void 0,this.yearGridAriaLabel=void 0,this.dayFormat="numeric",this.weekdayFormat="narrow",this.monthFormat="long",this.minDate=void 0,this.maxDate=void 0,this.disabledRanges=void 0,this.numberOfMonths=1,this.value=void 0,this.hourFormat=void 0,this.minuteStep=void 0,this.minTime=void 0,this.maxTime=void 0,this.disabledTimeRanges=void 0,this.minTimeMessage=void 0,this.maxTimeMessage=void 0,this.disabledTimeRangeMessage=void 0,this.noAvailableTimesMessage=void 0,this.allowCustomTime=!1,this._selectedDate=void 0,this._selectedTime=void 0,this._timeGridOpen=!1,this._internalValueChange=!1,this._nav=new Ui(this,{getMinDate:()=>this.minDate,getMaxDate:()=>this.maxDate,getNumberOfMonths:()=>this.numberOfMonths,getDisabledRanges:()=>this.disabledRanges,onYearSelectorToggled:()=>this._keyboard.onYearGridToggled()}),this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(".gui-calendar-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})}),this._keyboard=new Ni(this,{canGoPrev:()=>this._nav.canGoPrev(),canGoNext:()=>this._nav.canGoNext(),goPrev:()=>this._nav.prevMonth(),goNext:()=>this._nav.nextMonth(),onActivateDay:e=>{const t=re(e);this.selectDate({date:t,dayLabel:hr(this.localeId,t),isCurrentMonth:!0,isToday:pr(t),isSelected:!1,isFocusable:!0,isDisabled:this.isDisabled(t)})},onSelectYear:e=>this._nav.selectYear(e),onCloseYearGrid:()=>this._nav.closeYearSelector(),isYearGridOpen:()=>this._nav.yearSelectorOpen}),this._focusLeave=new zt(this,{onLeave:()=>{this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}})}get resolvedTimeRanges(){return this._selectedDate?Sn(this.disabledTimeRanges,this._selectedDate):[]}get timePicker(){return this.querySelector("gui-time-picker")}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){if(e.has("value")){if(this._internalValueChange){this._internalValueChange=!1;return}if(this.value){const t=ee(this.value);isNaN(t.getTime())||(this._selectedDate=ae(t),this._selectedTime=mt(t),ur(t,this._nav.currentDate,this.numberOfMonths??1)||(this._nav.currentDate=t))}else this._selectedTime&&(this._selectedDate=void 0,this._selectedTime=void 0)}}setValueInternal(e){this._internalValueChange=!0,this.value=e}emitChange(e,t=!1){this.dispatchEvent(new CustomEvent("change",{detail:{value:e,commit:t},bubbles:!0,composed:!0}))}selectDate(e){if(!e.isCurrentMonth||e.isDisabled||this.disabled||this.readOnly)return;const t=ae(e.date);t!==this._selectedDate&&(this._selectedDate=t,this._selectedTime=void 0,this.value&&(this.setValueInternal(void 0),this.emitChange(null)))}commitTime(e,t=!1){this._selectedDate&&(this._selectedTime=e,this.setValueInternal(`${this._selectedDate}T${e}`),this.emitChange(this.value,t))}onTimePickerChange(e){e.stopPropagation();const t=e.detail.value,i=e.detail.commit===!0;if(!t){this._selectedTime=void 0,this.value&&(this.setValueInternal(void 0),this.emitChange(null));return}this.commitTime(t,i)}onListToggle(e){e.stopPropagation();const{open:t}=e.detail;if(t&&this.readOnly){this.timePicker?.closeList();return}this._timeGridOpen=t,t&&(this._nav.yearSelectorOpen=!1)}toggleYearSelector(){this.timePicker?.closeList(),this._nav.toggleYearSelector()}render(){return Yi({uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,numberOfMonths:this.numberOfMonths,localeId:this.localeId,currentDate:this._nav.currentDate,prevMonthIcon:this.prevMonthIcon,nextMonthIcon:this.nextMonthIcon,prevMonthAriaLabel:this.prevMonthAriaLabel,nextMonthAriaLabel:this.nextMonthAriaLabel,canGoPrev:this._nav.canGoPrev(),canGoNext:this._nav.canGoNext(),onPrevMonthClick:this._keyboard.onPrevMonthClick,onNextMonthClick:this._keyboard.onNextMonthClick,onFocusOut:this._focusLeave.onFocusOut,renderAboveCalendar:()=>l.nothing,renderMonthPanel:e=>Hi({currentDate:this._nav.currentDate,offset:e,localeId:this.localeId,monthFormat:this.monthFormat,yearSelectorOpen:this._nav.yearSelectorOpen,selectYearAriaLabel:this.selectYearAriaLabel,onToggleYearSelector:()=>this.toggleYearSelector(),renderBelowHeader:t=>this.renderBelowHeader(t),renderPanelBody:t=>this.renderPanelBody(t)})})}renderBelowHeader(e){return e!==0?l.nothing:l.html`
393
449
  <div class="gui-calendar__time-input-row">
394
450
  <gui-time-picker
395
451
  class="gui-time-picker gui-field"
@@ -415,21 +471,24 @@
415
471
  @listtoggle=${this.onListToggle}
416
472
  ></gui-time-picker>
417
473
  </div>
418
- `}renderPanelBody(e){return this._timeGridOpen&&!this._nav.yearSelectorOpen&&e===0?l.html``:Ui({offset:e,yearSelectorOpen:this._nav.yearSelectorOpen,years:this._nav.yearList,currentYear:this._nav.currentDate.getFullYear(),onSelectYear:t=>this._keyboard.selectYear(t),onYearKeydown:this._keyboard.handleYearKeydown,localeId:this.localeId,getDays:t=>this.getDaysInMonth(t),renderDay:t=>this.renderDay(t)})}renderDay(e){const t={"gui-calendar__day-button":!0,today:e.isToday,selected:e.isSelected,disabled:e.isDisabled,"other-month":!e.isCurrentMonth};return l.html`
474
+ `}renderPanelBody(e){return this._timeGridOpen&&!this._nav.yearSelectorOpen&&e===0?l.html``:Wi({offset:e,yearSelectorOpen:this._nav.yearSelectorOpen,years:this._nav.yearList,currentYear:this._nav.currentDate.getFullYear(),onSelectYear:t=>this._keyboard.selectYear(t),onYearKeydown:this._keyboard.handleYearKeydown,localeId:this.localeId,currentDate:this._nav.currentDate,yearGridAriaLabel:this.yearGridAriaLabel,getDays:t=>this.getDaysInMonth(t),renderDay:t=>this.renderDay(t)})}renderDay(e){const t={"gui-calendar__day-button":!0,today:e.isToday,selected:e.isSelected,disabled:e.isDisabled,"other-month":!e.isCurrentMonth};return l.html`
419
475
  <button
420
476
  type="button"
421
477
  role="gridcell"
422
- class=${w.classMap(t)}
478
+ class=${T.classMap(t)}
423
479
  tabindex=${e.isFocusable?0:-1}
424
- ?disabled=${!e.isCurrentMonth||e.isDisabled}
425
- data-date=${Q(e.date)}
480
+ ?disabled=${!e.isCurrentMonth}
481
+ aria-disabled=${e.isCurrentMonth&&e.isDisabled?"true":l.nothing}
482
+ aria-label=${Vi(this.localeId,e.date)}
483
+ aria-current=${e.isToday?"date":l.nothing}
484
+ data-date=${ae(e.date)}
426
485
  @click=${()=>this.selectDate(e)}
427
486
  @keydown=${i=>this._keyboard.handleDayKeydown(i)}
428
487
  aria-selected=${e.isSelected}
429
488
  >
430
489
  ${e.dayLabel}
431
490
  </button>
432
- `}getDaysInMonth(e){const t=this._selectedDate;return Hi({currentDate:this._nav.currentDate,offset:e,localeId:this.localeId,numberOfMonths:this.numberOfMonths??1,isDisabled:i=>this.isDisabled(i),toDay:i=>{const a=Zi(i.date,{selectedISO:t}).isSelected;return{date:i.date,dayLabel:i.dayLabel,isCurrentMonth:i.isCurrentMonth,isToday:i.isToday,isDisabled:i.isDisabled,isSelected:a,isFocusable:(a||i.isToday)&&i.isCurrentMonth}},focusFallbackDates:[t?j(t):new Date]})}isDisabled(e){return this._nav.isDisabled(e)}};O([n.property({type:String})],M.prototype,"uid",2),O([n.property({type:String})],M.prototype,"label",2),O([n.property({type:String})],M.prototype,"hint",2),O([n.property({type:String,attribute:"locale-id"})],M.prototype,"localeId",2),O([n.property({type:Array})],M.prototype,"errors",2),O([n.property({type:Boolean})],M.prototype,"touched",2),O([n.property({type:Boolean})],M.prototype,"required",2),O([n.property({type:Boolean})],M.prototype,"disabled",2),O([n.property({type:Boolean,attribute:"readonly"})],M.prototype,"readOnly",2),O([n.property({type:String,attribute:"prev-month-icon"})],M.prototype,"prevMonthIcon",2),O([n.property({type:String,attribute:"next-month-icon"})],M.prototype,"nextMonthIcon",2),O([n.property({type:String,attribute:"prev-month-aria-label"})],M.prototype,"prevMonthAriaLabel",2),O([n.property({type:String,attribute:"next-month-aria-label"})],M.prototype,"nextMonthAriaLabel",2),O([n.property({type:String})],M.prototype,"dayFormat",2),O([n.property({type:String})],M.prototype,"weekdayFormat",2),O([n.property({type:String})],M.prototype,"monthFormat",2),O([n.property({type:String})],M.prototype,"minDate",2),O([n.property({type:String})],M.prototype,"maxDate",2),O([n.property({type:Array})],M.prototype,"disabledRanges",2),O([n.property({type:Number})],M.prototype,"numberOfMonths",2),O([n.property({type:String})],M.prototype,"value",2),O([n.property({type:String,attribute:"hour-format"})],M.prototype,"hourFormat",2),O([n.property({type:Number,attribute:"minute-step"})],M.prototype,"minuteStep",2),O([n.property({type:String,attribute:"min-time"})],M.prototype,"minTime",2),O([n.property({type:String,attribute:"max-time"})],M.prototype,"maxTime",2),O([n.property({type:Array,attribute:"disabled-time-ranges"})],M.prototype,"disabledTimeRanges",2),O([n.property({type:String,attribute:"min-time-message"})],M.prototype,"minTimeMessage",2),O([n.property({type:String,attribute:"max-time-message"})],M.prototype,"maxTimeMessage",2),O([n.property({type:String,attribute:"disabled-time-range-message"})],M.prototype,"disabledTimeRangeMessage",2),O([n.property({type:String,attribute:"no-available-times-message"})],M.prototype,"noAvailableTimesMessage",2),O([n.property({type:Boolean,attribute:"allow-custom-time"})],M.prototype,"allowCustomTime",2),O([n.state()],M.prototype,"_selectedDate",2),O([n.state()],M.prototype,"_selectedTime",2),O([n.state()],M.prototype,"_timeGridOpen",2),M=O([n.customElement("gui-date-time-calendar")],M),typeof customElements<"u"&&!customElements.get("gui-date-time-calendar")&&customElements.define("gui-date-time-calendar",M);var cd=Object.defineProperty,yd=Object.getOwnPropertyDescriptor,Ma=(e,t,i,a)=>{for(var r=a>1?void 0:a?yd(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&cd(t,i,r),r};let Nt=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-date-time-calendar","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=this.adapter.templateData;return l.html`
491
+ `}getDaysInMonth(e){const t=this._selectedDate;return Ji({currentDate:this._nav.currentDate,offset:e,localeId:this.localeId,numberOfMonths:this.numberOfMonths??1,isDisabled:i=>this.isDisabled(i),toDay:i=>{const a=Ki(i.date,{selectedISO:t}).isSelected;return{date:i.date,dayLabel:i.dayLabel,isCurrentMonth:i.isCurrentMonth,isToday:i.isToday,isDisabled:i.isDisabled,isSelected:a,isFocusable:(a||i.isToday)&&i.isCurrentMonth}},focusFallbackDates:[t?re(t):new Date]})}isDisabled(e){return this._nav.isDisabled(e)}};I([n.property({type:String})],E.prototype,"uid",2),I([n.property({type:String})],E.prototype,"label",2),I([n.property({type:String})],E.prototype,"hint",2),I([n.property({type:String,attribute:"locale-id"})],E.prototype,"localeId",2),I([n.property({type:Array})],E.prototype,"errors",2),I([n.property({type:Boolean})],E.prototype,"touched",2),I([n.property({type:Boolean})],E.prototype,"required",2),I([n.property({type:Boolean})],E.prototype,"disabled",2),I([n.property({type:Boolean,attribute:"readonly"})],E.prototype,"readOnly",2),I([n.property({type:String,attribute:"prev-month-icon"})],E.prototype,"prevMonthIcon",2),I([n.property({type:String,attribute:"next-month-icon"})],E.prototype,"nextMonthIcon",2),I([n.property({type:String,attribute:"prev-month-aria-label"})],E.prototype,"prevMonthAriaLabel",2),I([n.property({type:String,attribute:"next-month-aria-label"})],E.prototype,"nextMonthAriaLabel",2),I([n.property({type:String,attribute:"select-year-aria-label"})],E.prototype,"selectYearAriaLabel",2),I([n.property({type:String,attribute:"year-grid-aria-label"})],E.prototype,"yearGridAriaLabel",2),I([n.property({type:String})],E.prototype,"dayFormat",2),I([n.property({type:String})],E.prototype,"weekdayFormat",2),I([n.property({type:String})],E.prototype,"monthFormat",2),I([n.property({type:String})],E.prototype,"minDate",2),I([n.property({type:String})],E.prototype,"maxDate",2),I([n.property({type:Array})],E.prototype,"disabledRanges",2),I([n.property({type:Number})],E.prototype,"numberOfMonths",2),I([n.property({type:String})],E.prototype,"value",2),I([n.property({type:String,attribute:"hour-format"})],E.prototype,"hourFormat",2),I([n.property({type:Number,attribute:"minute-step"})],E.prototype,"minuteStep",2),I([n.property({type:String,attribute:"min-time"})],E.prototype,"minTime",2),I([n.property({type:String,attribute:"max-time"})],E.prototype,"maxTime",2),I([n.property({type:Array,attribute:"disabled-time-ranges"})],E.prototype,"disabledTimeRanges",2),I([n.property({type:String,attribute:"min-time-message"})],E.prototype,"minTimeMessage",2),I([n.property({type:String,attribute:"max-time-message"})],E.prototype,"maxTimeMessage",2),I([n.property({type:String,attribute:"disabled-time-range-message"})],E.prototype,"disabledTimeRangeMessage",2),I([n.property({type:String,attribute:"no-available-times-message"})],E.prototype,"noAvailableTimesMessage",2),I([n.property({type:Boolean,attribute:"allow-custom-time"})],E.prototype,"allowCustomTime",2),I([n.state()],E.prototype,"_selectedDate",2),I([n.state()],E.prototype,"_selectedTime",2),I([n.state()],E.prototype,"_timeGridOpen",2),E=I([n.customElement("gui-date-time-calendar")],E),typeof customElements<"u"&&!customElements.get("gui-date-time-calendar")&&customElements.define("gui-date-time-calendar",E);var Sh=Object.defineProperty,Th=Object.getOwnPropertyDescriptor,vr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Th(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Sh(t,i,r),r};let Ut=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-date-time-calendar","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=this.adapter.templateData;return l.html`
433
492
  <gui-date-time-calendar
434
493
  .uid=${this.widget.uid}
435
494
  .label=${e.label}
@@ -444,6 +503,8 @@
444
503
  .nextMonthIcon=${e.nextMonthIcon}
445
504
  .prevMonthAriaLabel=${e.prevMonthAriaLabel}
446
505
  .nextMonthAriaLabel=${e.nextMonthAriaLabel}
506
+ .selectYearAriaLabel=${e.selectYearAriaLabel}
507
+ .yearGridAriaLabel=${e.yearGridAriaLabel}
447
508
  .dayFormat=${e.dayFormat}
448
509
  .weekdayFormat=${e.weekdayFormat}
449
510
  .monthFormat=${e.monthFormat}
@@ -466,26 +527,33 @@
466
527
  @inputError=${this.onInputError}
467
528
  @blur=${()=>this.adapter.onBlur()}
468
529
  ></gui-date-time-calendar>
469
- `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Ma([b.consume({context:m.formContext}),n.property({attribute:!1})],Nt.prototype,"formContext",2),Ma([b.provide({context:m.inputContext})],Nt.prototype,"adapter",2),Nt=Ma([n.customElement("gui-date-time-calendar-input")],Nt);const gd=Object.freeze(Object.defineProperty({__proto__:null,get DateTimeCalendarElement(){return Nt}},Symbol.toStringTag,{value:"Module"}));function Hs(e){return`${e.start}-${e.end??e.start}`}function zt(e,t){return!e||!Array.isArray(e)?[]:[...e].sort((i,a)=>t(i.start,a.start))}function Pt(e,t){return e.find(i=>Hs(i)===t)}function Vt(e,t){const i=e??[],a=Pt(i,t);if(!a)return null;const r=i.filter(s=>!(s.start===a.start&&(s.end??null)===(a.end??null)));return{removed:a,next:r}}function Ws(e,t){const i=j(e);return isNaN(i.getTime())?e:new Intl.DateTimeFormat(t??"en",{year:"numeric",month:"2-digit",day:"2-digit"}).format(i)}function Qi(e,t){const i=t(e.start),a=e.end?t(e.end):i;return`${i} - ${a}`}function Gt(e,t,i){return e.map(a=>{const r=t(a);return{key:Hs(a),label:r,ariaLabel:`${i} ${r}`}})}function ji(){return{anchor:null,hover:null,selecting:!1}}function ea(e,t){switch(t.type){case"pick":{if(!e.anchor)return{state:{anchor:t.date,hover:e.hover,selecting:!0}};let i=e.anchor,a=t.date;return t.date<i&&(i=t.date,a=e.anchor),{state:ji(),commit:{start:i,end:a}}}case"hover":return e.selecting?{state:{...e,hover:t.date}}:{state:e};case"reset":return{state:ji()}}}function Ys(e){return!e.selecting||!e.hover||!e.anchor?null:e.hover.getTime()>e.anchor.getTime()?{start:e.anchor,end:e.hover}:{start:e.hover,end:e.anchor}}function ta(e,t,i){if(!e)throw new TypeError("The element provided to the IntersectionObserver must exist");const a=new IntersectionObserver(r=>{r.forEach(s=>{t(s.isIntersecting)})},i);return a.observe(e),a}var bd=Object.defineProperty,fd=Object.getOwnPropertyDescriptor,Ge=(e,t,i,a)=>{for(var r=a>1?void 0:a?fd(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&bd(t,i,r),r};let Re=class extends l.LitElement{constructor(){super(...arguments),this.items=[],this.clickable=!1,this.removable=!0,this.bubble=!0,this.tabbable=!0,this.disabled=!1,this.readOnly=!1,this.removeAriaLabel="Remove",this._isStartVisible=!0,this._isEndVisible=!0,this._showDropdown=!1,this._pendingFocusIndex=null,this.handlePillFocus=e=>{e.target.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},this.toggleDropdown=()=>{this._showDropdown?this.closeDropdown():this.openDropdown()},this.handleOutsideInteraction=e=>{const t=this.querySelector(".gui-pills__compact"),i=this.querySelector(".gui-pills__dropdown"),a=e.composedPath()[0];!t?.contains(a)&&!i?.contains(a)&&this.closeDropdown()}}createRenderRoot(){return this}updated(e){if(super.updated(e),this.setupObservers(),this._pendingFocusIndex!==null&&e.has("items")){const t=this._pendingFocusIndex;this._pendingFocusIndex=null;const i=this.items.length;if(i===0){this._showDropdown&&this.closeDropdown();return}const a=Math.max(0,Math.min(t,i-1));this.focusPillAt(a)}}disconnectedCallback(){super.disconnectedCallback(),this.disconnectObservers(),this.removeOutsideListeners()}render(){const e=this.items.length;return e===0?l.nothing:l.html`
530
+ `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};vr([f.consume({context:m.formContext}),n.property({attribute:!1})],Ut.prototype,"formContext",2),vr([f.provide({context:m.inputContext})],Ut.prototype,"adapter",2),Ut=vr([n.customElement("gui-date-time-calendar-input")],Ut);const _h=Object.freeze(Object.defineProperty({__proto__:null,get DateTimeCalendarElement(){return Ut}},Symbol.toStringTag,{value:"Module"}));function Nn(e){return`${e.start}-${e.end??e.start}`}function Zt(e,t){return!e||!Array.isArray(e)?[]:[...e].sort((i,a)=>t(i.start,a.start))}function It(e,t){return e.find(i=>Nn(i)===t)}function Yt(e,t){const i=e??[],a=It(i,t);if(!a)return null;const r=i.filter(s=>!(s.start===a.start&&(s.end??null)===(a.end??null)));return{removed:a,next:r}}function zn(e,t){const i=re(e);return isNaN(i.getTime())?e:new Intl.DateTimeFormat(t??"en",{year:"numeric",month:"2-digit",day:"2-digit"}).format(i)}function aa(e,t){const i=t(e.start),a=e.end?t(e.end):i;return`${i} - ${a}`}function Ht(e,t){return e.map(i=>{const a=t(i);return{key:Nn(i),label:a,ariaLabel:a}})}function ra(){return{anchor:null,hover:null,selecting:!1}}function sa(e,t){switch(t.type){case"pick":{if(!e.anchor)return{state:{anchor:t.date,hover:e.hover,selecting:!0}};let i=e.anchor,a=t.date;return t.date<i&&(i=t.date,a=e.anchor),{state:ra(),commit:{start:i,end:a}}}case"hover":return e.selecting?{state:{...e,hover:t.date}}:{state:e};case"reset":return{state:ra()}}}function Gn(e){return!e.selecting||!e.hover||!e.anchor?null:e.hover.getTime()>e.anchor.getTime()?{start:e.anchor,end:e.hover}:{start:e.hover,end:e.anchor}}function na(e,t,i){if(!e)throw new TypeError("The element provided to the IntersectionObserver must exist");const a=new IntersectionObserver(r=>{r.forEach(s=>{t(s.isIntersecting)})},i);return a.observe(e),a}var Ah=Object.defineProperty,Ch=Object.getOwnPropertyDescriptor,Be=(e,t,i,a)=>{for(var r=a>1?void 0:a?Ch(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Ah(t,i,r),r};let Le=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.items=[],this.clickable=!1,this.removable=!0,this.bubble=!0,this.tabbable=!0,this.disabled=!1,this.readOnly=!1,this.removeAriaLabel="Remove",this.toolbarAriaLabel="Selected items",this._isStartVisible=!0,this._isEndVisible=!0,this._showDropdown=!1,this._pendingFocusIndex=null,this.handlePillFocus=e=>{e.target.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},this.toggleDropdown=()=>{this._showDropdown?this.closeDropdown():this.openDropdown()},this.handleOutsideInteraction=e=>{const t=this.querySelector(".gui-pills__compact"),i=this.querySelector(".gui-pills__dropdown"),a=e.composedPath()[0];!t?.contains(a)&&!i?.contains(a)&&this.closeDropdown()}}createRenderRoot(){return this}updated(e){if(super.updated(e),this.setupObservers(),this._pendingFocusIndex!==null&&e.has("items")){const t=this._pendingFocusIndex;this._pendingFocusIndex=null;const i=this.items.length;if(i===0){this._showDropdown&&this.closeDropdown();return}const a=Math.max(0,Math.min(t,i-1));this.focusPillAt(a)}}disconnectedCallback(){super.disconnectedCallback(),this.disconnectObservers(),this.removeOutsideListeners()}render(){const e=this.items.length;return e===0?l.nothing:l.html`
470
531
  ${this.renderStrip()} ${this.bubble?this.renderCompact(e):l.nothing}
471
532
  ${this.bubble&&this._showDropdown?this.renderDropdown():l.nothing}
472
533
  `}renderStrip(){return l.html`
473
534
  <div
474
- class=${w.classMap({"gui-pills__strip-wrapper":!0,"gui-pills--start-shadow":!this._isStartVisible,"gui-pills--end-shadow":!this._isEndVisible})}
535
+ class=${T.classMap({"gui-pills__strip-wrapper":!0,"gui-pills--start-shadow":!this._isStartVisible,"gui-pills--end-shadow":!this._isEndVisible})}
475
536
  >
476
- <div class="gui-pills__strip" role="list" tabindex="-1">
537
+ <div
538
+ class="gui-pills__strip"
539
+ role="toolbar"
540
+ aria-label=${this.toolbarAriaLabel}
541
+ tabindex="-1"
542
+ >
477
543
  <span class="gui-sentinel gui-sentinel__start"></span>
478
- ${hr.repeat(this.items,e=>e.key,(e,t)=>this.renderPill(e,t,!1))}
544
+ ${ts.repeat(this.items,e=>e.key,(e,t)=>this.renderPill(e,t,!1))}
479
545
  <span class="gui-sentinel gui-sentinel__end"></span>
480
546
  </div>
481
547
  </div>
482
- `}renderCompact(e){return l.html`
548
+ `}get dropdownId(){return this.uid?`${this.uid}_pills_dropdown`:void 0}renderCompact(e){return l.html`
483
549
  <div class="gui-pills__compact">
484
550
  <button
485
551
  type="button"
486
552
  class="gui-pills__count"
487
553
  aria-label=${this.compactAriaLabel??`${e} items`}
554
+ aria-haspopup="true"
488
555
  aria-expanded=${this._showDropdown}
556
+ aria-controls=${this.dropdownId??l.nothing}
489
557
  ?disabled=${this.disabled||this.readOnly}
490
558
  @click=${t=>{t.stopPropagation(),this.toggleDropdown()}}
491
559
  >
@@ -493,38 +561,44 @@
493
561
  </button>
494
562
  </div>
495
563
  `}renderDropdown(){return l.html`
496
- <div class="gui-pills__dropdown" role="list">
497
- ${hr.repeat(this.items,e=>`dd-${e.key}`,(e,t)=>this.renderPill(e,t,!0))}
498
- </div>
499
- `}renderPill(e,t,i){const a=e.ariaLabel??`${this.removeAriaLabel}: ${e.label}`,r=this.clickable&&!this.disabled&&!this.readOnly;return l.html`
500
564
  <div
501
- class=${w.classMap({"gui-pills__pill":!0,"gui-pills__pill--clickable":r})}
502
- role="listitem"
565
+ id=${this.dropdownId??l.nothing}
566
+ class="gui-pills__dropdown"
567
+ role="toolbar"
568
+ aria-orientation="vertical"
569
+ aria-label=${this.toolbarAriaLabel}
570
+ >
571
+ ${ts.repeat(this.items,e=>`dd-${e.key}`,(e,t)=>this.renderPill(e,t,!0))}
572
+ </div>
573
+ `}renderPill(e,t,i){const a=this.clickable&&!this.disabled&&!this.readOnly;return l.html`
574
+ <button
575
+ type="button"
576
+ class=${T.classMap({"gui-pills__pill":!0,"gui-pills__pill--clickable":a})}
503
577
  data-key=${e.key}
504
578
  data-index=${t}
505
579
  data-in-dropdown=${i}
506
580
  tabindex=${this.tabbable&&!this.disabled&&!this.readOnly?0:-1}
507
- aria-label=${a}
508
- @click=${s=>this.onPillClick(s,e)}
581
+ ?disabled=${this.disabled||this.readOnly}
582
+ aria-label=${e.ariaLabel??e.label}
583
+ aria-description=${this.removable&&!this.disabled&&!this.readOnly?this.removeAriaLabel:l.nothing}
584
+ @click=${r=>this.onPillClick(r,e)}
509
585
  @focus=${this.handlePillFocus}
510
- @keydown=${s=>this.onPillKeydown(s,e,t)}
586
+ @keydown=${r=>this.onPillKeydown(r,e,t)}
511
587
  >
512
588
  <span class="gui-pills__pill-text">${e.label}</span>
513
589
  ${this.removable?this.renderRemoveButton(e):l.nothing}
514
- </div>
590
+ </button>
515
591
  `}renderRemoveButton(e){return l.html`
516
- <button
517
- type="button"
592
+ <span
518
593
  class="gui-pills__pill-remove"
519
- tabindex="-1"
520
594
  aria-hidden="true"
521
- ?disabled=${this.disabled||this.readOnly}
522
595
  @mousedown=${t=>{t.stopPropagation(),t.preventDefault()}}
523
596
  @click=${t=>{t.stopPropagation(),this.emitRemove(e.key,this.items.indexOf(e))}}
524
597
  >
525
598
  ${this.removeIcon?l.html`<span
526
599
  class=${`gui-widget-icon ${this.removeIcon}`}
527
600
  data-icon=${this.removeIcon}
601
+ aria-hidden="true"
528
602
  ></span>`:l.html`<svg
529
603
  xmlns="http://www.w3.org/2000/svg"
530
604
  width="16"
@@ -537,15 +611,18 @@
537
611
  d="M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"
538
612
  ></path>
539
613
  </svg>`}
540
- </button>
541
- `}onPillClick(e,t){!this.clickable||this.disabled||this.readOnly||(e.stopPropagation(),this.dispatchEvent(new CustomEvent("pillclick",{detail:{key:t.key},bubbles:!0,composed:!0})))}onPillKeydown(e,t,i){if(this.disabled||this.readOnly){this.emitKeydown(t.key,e);return}if(this.removable&&(e.key==="Delete"||e.key==="Backspace")){e.preventDefault(),e.stopPropagation(),this.emitRemove(t.key,i);return}if((e.key==="Enter"||e.key===" ")&&this.clickable){e.preventDefault(),this.dispatchEvent(new CustomEvent("pillclick",{detail:{key:t.key},bubbles:!0,composed:!0}));return}const a=this._showDropdown,r=a?"ArrowUp":"ArrowLeft",s=a?"ArrowDown":"ArrowRight";if(e.key===r){i>0?(e.preventDefault(),this.focusPillAt(i-1)):this.emitKeydown(t.key,e);return}if(e.key===s){i<this.items.length-1?(e.preventDefault(),this.focusPillAt(i+1)):this.emitKeydown(t.key,e);return}if(e.key==="Home"){e.preventDefault(),this.focusPillAt(0);return}if(e.key==="End"){e.preventDefault(),this.focusPillAt(this.items.length-1);return}if(e.key==="Escape"&&a){e.preventDefault(),e.stopPropagation(),this.closeDropdown();return}this.emitKeydown(t.key,e)}emitRemove(e,t){this._pendingFocusIndex=t,this.dispatchEvent(new CustomEvent("pillremove",{detail:{key:e},bubbles:!0,composed:!0}))}emitKeydown(e,t){this.dispatchEvent(new CustomEvent("pillkeydown",{detail:{key:e,event:t},bubbles:!0,composed:!0}))}focusPillAt(e){requestAnimationFrame(()=>{const t=this._showDropdown?".gui-pills__dropdown .gui-pills__pill":".gui-pills__strip .gui-pills__pill",i=this.querySelectorAll(t);if(i.length===0)return;const a=Math.max(0,Math.min(e,i.length-1));i[a].focus()})}openDropdown(){!this.bubble||this.disabled||this.readOnly||this._showDropdown||(this._showDropdown=!0,this.dispatchEvent(new CustomEvent("dropdowntoggle",{detail:{open:!0},bubbles:!0,composed:!0})),requestAnimationFrame(()=>{this.addOutsideListeners(),this.querySelector(".gui-pills__dropdown .gui-pills__pill")?.focus()}))}closeDropdown(){this._showDropdown&&(this._showDropdown=!1,this.removeOutsideListeners(),this.dispatchEvent(new CustomEvent("dropdowntoggle",{detail:{open:!1},bubbles:!0,composed:!0})))}addOutsideListeners(){document.addEventListener("pointerdown",this.handleOutsideInteraction),document.addEventListener("focusin",this.handleOutsideInteraction)}removeOutsideListeners(){document.removeEventListener("pointerdown",this.handleOutsideInteraction),document.removeEventListener("focusin",this.handleOutsideInteraction)}setupObservers(){const e=this.querySelector(".gui-sentinel__start"),t=this.querySelector(".gui-sentinel__end");e&&!this.startObserver&&(this.startObserver=ta(e,i=>this._isStartVisible=i)),t&&!this.endObserver&&(this.endObserver=ta(t,i=>this._isEndVisible=i)),!e&&this.startObserver&&(this.startObserver.disconnect(),this.startObserver=void 0,this._isStartVisible=!0),!t&&this.endObserver&&(this.endObserver.disconnect(),this.endObserver=void 0,this._isEndVisible=!0)}disconnectObservers(){this.startObserver?.disconnect(),this.endObserver?.disconnect(),this.startObserver=void 0,this.endObserver=void 0}};Ge([n.property({type:Array})],Re.prototype,"items",2),Ge([n.property({type:Boolean})],Re.prototype,"clickable",2),Ge([n.property({type:Boolean})],Re.prototype,"removable",2),Ge([n.property({type:Boolean})],Re.prototype,"bubble",2),Ge([n.property({type:Boolean})],Re.prototype,"tabbable",2),Ge([n.property({type:Boolean})],Re.prototype,"disabled",2),Ge([n.property({type:Boolean,attribute:"readonly"})],Re.prototype,"readOnly",2),Ge([n.property({type:String,attribute:"remove-aria-label"})],Re.prototype,"removeAriaLabel",2),Ge([n.property({type:String,attribute:"remove-icon"})],Re.prototype,"removeIcon",2),Ge([n.property({type:String,attribute:"compact-aria-label"})],Re.prototype,"compactAriaLabel",2),Ge([n.state()],Re.prototype,"_isStartVisible",2),Ge([n.state()],Re.prototype,"_isEndVisible",2),Ge([n.state()],Re.prototype,"_showDropdown",2),Re=Ge([n.customElement("gui-pills")],Re),typeof customElements<"u"&&!customElements.get("gui-pills")&&customElements.define("gui-pills",Re);var vd=Object.defineProperty,Dd=Object.getOwnPropertyDescriptor,V=(e,t,i,a)=>{for(var r=a>1?void 0:a?Dd(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&vd(t,i,r),r};let F=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.localeId=void 0,this.errors=[],this.touched=void 0,this.required=!1,this.disabled=!1,this.readOnly=!1,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel="",this.nextMonthAriaLabel="",this.dayFormat="numeric",this.weekdayFormat="narrow",this.monthFormat="long",this.minDate=void 0,this.maxDate=void 0,this.disabledRanges=void 0,this.numberOfMonths=1,this.value=[],this.focusDate=void 0,this.hidePills=!1,this.removePillAriaLabel=void 0,this.disabledDateRangeMessage=void 0,this.invalidRange=null,this._selection=ji(),this._invalidRange=null,this._skipValueNavigation=!1,this._nav=new zi(this,{getMinDate:()=>this.minDate,getMaxDate:()=>this.maxDate,getNumberOfMonths:()=>this.numberOfMonths,getDisabledRanges:()=>this.disabledRanges,onYearSelectorToggled:()=>this._keyboard.onYearGridToggled()}),this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(".gui-calendar-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})}),this._keyboard=new Bi(this,{canGoPrev:()=>this._nav.canGoPrev(),canGoNext:()=>this._nav.canGoNext(),goPrev:()=>this._nav.prevMonth(),goNext:()=>this._nav.nextMonth(),onActivateDay:(e,t)=>this.selectDate(this.activationDay(e),t),onSelectYear:e=>this._nav.selectYear(e),onCloseYearGrid:()=>this._nav.closeYearSelector(),isYearGridOpen:()=>this._nav.yearSelectorOpen}),this._focusLeave=new Ft(this,{onLeave:()=>this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}),this.onPillRemoveEvent=e=>{if(this.disabled||this.readOnly)return;const t=Vt(this.value,e.detail.key);t&&(this.value=t.next,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})))},this.onPillClickEvent=e=>{const t=Pt(this.getSortedPills(),e.detail.key);t&&this.navigateToDate(t.start)}}get _currentDate(){return this._nav.currentDate}set _currentDate(e){this._nav.currentDate=e}parseEndpoint(e){return j(e)}endpointDay(e){return j(e)}formatPillLabel(e){return Qi(e,t=>Ws(t,this.localeId))}renderDayContent(e){return l.html`${e.dayLabel}`}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){if(e.has("invalidRange"))if(this.invalidRange){const t=this.endpointDay(this.invalidRange.start),i=this.endpointDay(this.invalidRange.end);this._invalidRange=isNaN(t.getTime())||isNaN(i.getTime())?null:{start:t,end:i}}else this._invalidRange=null;if(e.has("value")&&!e.has("focusDate")){if(this._skipValueNavigation)this._skipValueNavigation=!1;else if(this.value){const t=Array.isArray(this.value)?this.value:[{start:this.value}];t.length>0&&t[0].start&&this._nav.navigateToDate(this.endpointDay(t[0].start))}}if(e.has("focusDate")&&this.focusDate){const t=j(this.focusDate);isNaN(t.getTime())||(this._nav.navigateToDate(t),this.focusDate=void 0)}}render(){return Vi({uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,numberOfMonths:this.numberOfMonths,prevMonthIcon:this.prevMonthIcon,nextMonthIcon:this.nextMonthIcon,prevMonthAriaLabel:this.prevMonthAriaLabel,nextMonthAriaLabel:this.nextMonthAriaLabel,canGoPrev:this._nav.canGoPrev(),canGoNext:this._nav.canGoNext(),onPrevMonthClick:this._keyboard.onPrevMonthClick,onNextMonthClick:this._keyboard.onNextMonthClick,onFocusOut:this._focusLeave.onFocusOut,renderAboveCalendar:()=>this.renderAboveCalendar(),renderMonthPanel:e=>Gi({currentDate:this._nav.currentDate,offset:e,localeId:this.localeId,monthFormat:this.monthFormat,yearSelectorOpen:this._nav.yearSelectorOpen,onToggleYearSelector:()=>this.toggleYearSelector(),renderBelowHeader:t=>this.renderBelowHeader(t),renderPanelBody:t=>this.renderPanelBody(t)})})}renderBelowHeader(e){return l.nothing}renderPanelBody(e){return Ui({offset:e,yearSelectorOpen:this._nav.yearSelectorOpen,years:this._nav.yearList,currentYear:this._nav.currentDate.getFullYear(),onSelectYear:t=>this._keyboard.selectYear(t),onYearKeydown:this._keyboard.handleYearKeydown,localeId:this.localeId,getDays:t=>this.getDaysInMonth(t),renderDay:t=>this.renderDay(t)})}toggleYearSelector(){this._nav.toggleYearSelector()}isDisabled(e){return this._nav.isDisabled(e)}activationDay(e){return{date:j(e),isCurrentMonth:!0,isDisabled:!1,isFocusable:!0,dayLabel:"",isToday:!1,isRangeStart:!1,isRangeEnd:!1,isInRange:!1,isOneDayRange:!1,isAnchor:!1,isSelecting:!1,isInvalidStart:!1,isInvalidEnd:!1,isInvalidInRange:!1}}renderDay(e){const t=e.isInvalidStart&&e.isInvalidEnd,i={"gui-calendar__day-button":!0,today:e.isToday,"other-month":!e.isCurrentMonth,"range-start":e.isRangeStart&&!e.isOneDayRange,"range-end":e.isRangeEnd&&!e.isOneDayRange,selected:e.isOneDayRange,"in-range":e.isInRange,"invalid-range-start":e.isInvalidStart&&!t,"invalid-range-end":e.isInvalidEnd&&!t,"invalid-range-single":t,"invalid-in-range":e.isInvalidInRange,"is-anchor":e.isAnchor,"is-selecting":e.isSelecting,disabled:e.isDisabled};return l.html`
614
+ </span>
615
+ `}onPillClick(e,t){!this.clickable||this.disabled||this.readOnly||(e.stopPropagation(),this.dispatchEvent(new CustomEvent("pillclick",{detail:{key:t.key},bubbles:!0,composed:!0})))}onPillKeydown(e,t,i){if(this.disabled||this.readOnly){this.emitKeydown(t.key,e);return}if(this.removable&&(e.key==="Delete"||e.key==="Backspace")){e.preventDefault(),e.stopPropagation(),this.emitRemove(t.key,i);return}if((e.key==="Enter"||e.key===" ")&&this.clickable){e.preventDefault(),this.dispatchEvent(new CustomEvent("pillclick",{detail:{key:t.key},bubbles:!0,composed:!0}));return}const a=this._showDropdown,r=a?"ArrowUp":"ArrowLeft",s=a?"ArrowDown":"ArrowRight";if(e.key===r){i>0?(e.preventDefault(),this.focusPillAt(i-1)):this.emitKeydown(t.key,e);return}if(e.key===s){i<this.items.length-1?(e.preventDefault(),this.focusPillAt(i+1)):this.emitKeydown(t.key,e);return}if(e.key==="Home"){e.preventDefault(),this.focusPillAt(0);return}if(e.key==="End"){e.preventDefault(),this.focusPillAt(this.items.length-1);return}if(e.key==="Escape"&&a){e.preventDefault(),e.stopPropagation(),this.closeDropdown();return}this.emitKeydown(t.key,e)}emitRemove(e,t){this._pendingFocusIndex=t,this.dispatchEvent(new CustomEvent("pillremove",{detail:{key:e},bubbles:!0,composed:!0}))}emitKeydown(e,t){this.dispatchEvent(new CustomEvent("pillkeydown",{detail:{key:e,event:t},bubbles:!0,composed:!0}))}focusPillAt(e){requestAnimationFrame(()=>{const t=this._showDropdown?".gui-pills__dropdown .gui-pills__pill":".gui-pills__strip .gui-pills__pill",i=this.querySelectorAll(t);if(i.length===0)return;const a=Math.max(0,Math.min(e,i.length-1));i[a].focus()})}openDropdown(){!this.bubble||this.disabled||this.readOnly||this._showDropdown||(this._showDropdown=!0,this.dispatchEvent(new CustomEvent("dropdowntoggle",{detail:{open:!0},bubbles:!0,composed:!0})),requestAnimationFrame(()=>{this.addOutsideListeners(),this.querySelector(".gui-pills__dropdown .gui-pills__pill")?.focus()}))}closeDropdown(){this._showDropdown&&(this._showDropdown=!1,this.removeOutsideListeners(),this.dispatchEvent(new CustomEvent("dropdowntoggle",{detail:{open:!1},bubbles:!0,composed:!0})))}addOutsideListeners(){document.addEventListener("pointerdown",this.handleOutsideInteraction),document.addEventListener("focusin",this.handleOutsideInteraction)}removeOutsideListeners(){document.removeEventListener("pointerdown",this.handleOutsideInteraction),document.removeEventListener("focusin",this.handleOutsideInteraction)}setupObservers(){const e=this.querySelector(".gui-sentinel__start"),t=this.querySelector(".gui-sentinel__end");e&&!this.startObserver&&(this.startObserver=na(e,i=>this._isStartVisible=i)),t&&!this.endObserver&&(this.endObserver=na(t,i=>this._isEndVisible=i)),!e&&this.startObserver&&(this.startObserver.disconnect(),this.startObserver=void 0,this._isStartVisible=!0),!t&&this.endObserver&&(this.endObserver.disconnect(),this.endObserver=void 0,this._isEndVisible=!0)}disconnectObservers(){this.startObserver?.disconnect(),this.endObserver?.disconnect(),this.startObserver=void 0,this.endObserver=void 0}};Be([n.property({type:String})],Le.prototype,"uid",2),Be([n.property({type:Array})],Le.prototype,"items",2),Be([n.property({type:Boolean})],Le.prototype,"clickable",2),Be([n.property({type:Boolean})],Le.prototype,"removable",2),Be([n.property({type:Boolean})],Le.prototype,"bubble",2),Be([n.property({type:Boolean})],Le.prototype,"tabbable",2),Be([n.property({type:Boolean})],Le.prototype,"disabled",2),Be([n.property({type:Boolean,attribute:"readonly"})],Le.prototype,"readOnly",2),Be([n.property({type:String,attribute:"remove-aria-label"})],Le.prototype,"removeAriaLabel",2),Be([n.property({type:String,attribute:"remove-icon"})],Le.prototype,"removeIcon",2),Be([n.property({type:String,attribute:"compact-aria-label"})],Le.prototype,"compactAriaLabel",2),Be([n.property({type:String,attribute:"toolbar-aria-label"})],Le.prototype,"toolbarAriaLabel",2),Be([n.state()],Le.prototype,"_isStartVisible",2),Be([n.state()],Le.prototype,"_isEndVisible",2),Be([n.state()],Le.prototype,"_showDropdown",2),Le=Be([n.customElement("gui-pills")],Le),typeof customElements<"u"&&!customElements.get("gui-pills")&&customElements.define("gui-pills",Le);var Lh=Object.defineProperty,xh=Object.getOwnPropertyDescriptor,H=(e,t,i,a)=>{for(var r=a>1?void 0:a?xh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Lh(t,i,r),r};let N=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.localeId=void 0,this.errors=[],this.touched=void 0,this.required=!1,this.disabled=!1,this.readOnly=!1,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel="",this.nextMonthAriaLabel="",this.selectYearAriaLabel=void 0,this.yearGridAriaLabel=void 0,this.dayFormat="numeric",this.weekdayFormat="narrow",this.monthFormat="long",this.minDate=void 0,this.maxDate=void 0,this.disabledRanges=void 0,this.numberOfMonths=1,this.value=[],this.focusDate=void 0,this.hidePills=!1,this.removePillAriaLabel=void 0,this.disabledDateRangeMessage=void 0,this.invalidRange=null,this._selection=ra(),this._invalidRange=null,this._skipValueNavigation=!1,this._nav=new Ui(this,{getMinDate:()=>this.minDate,getMaxDate:()=>this.maxDate,getNumberOfMonths:()=>this.numberOfMonths,getDisabledRanges:()=>this.disabledRanges,onYearSelectorToggled:()=>this._keyboard.onYearGridToggled()}),this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(".gui-calendar-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})}),this._keyboard=new Ni(this,{canGoPrev:()=>this._nav.canGoPrev(),canGoNext:()=>this._nav.canGoNext(),goPrev:()=>this._nav.prevMonth(),goNext:()=>this._nav.nextMonth(),onActivateDay:(e,t)=>this.selectDate(this.activationDay(e),t),onSelectYear:e=>this._nav.selectYear(e),onCloseYearGrid:()=>this._nav.closeYearSelector(),isYearGridOpen:()=>this._nav.yearSelectorOpen}),this._focusLeave=new zt(this,{onLeave:()=>this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}),this.onPillRemoveEvent=e=>{if(this.disabled||this.readOnly)return;const t=Yt(this.value,e.detail.key);t&&(this.value=t.next,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})))},this.onPillClickEvent=e=>{const t=It(this.getSortedPills(),e.detail.key);t&&this.navigateToDate(t.start)}}get _currentDate(){return this._nav.currentDate}set _currentDate(e){this._nav.currentDate=e}parseEndpoint(e){return re(e)}endpointDay(e){return re(e)}formatPillLabel(e){return aa(e,t=>zn(t,this.localeId))}renderDayContent(e){return l.html`${e.dayLabel}`}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){if(e.has("invalidRange"))if(this.invalidRange){const t=this.endpointDay(this.invalidRange.start),i=this.endpointDay(this.invalidRange.end);this._invalidRange=isNaN(t.getTime())||isNaN(i.getTime())?null:{start:t,end:i}}else this._invalidRange=null;if(e.has("value")&&!e.has("focusDate")){if(this._skipValueNavigation)this._skipValueNavigation=!1;else if(this.value){const t=Array.isArray(this.value)?this.value:[{start:this.value}];t.length>0&&t[0].start&&this._nav.navigateToDate(this.endpointDay(t[0].start))}}if(e.has("focusDate")&&this.focusDate){const t=re(this.focusDate);isNaN(t.getTime())||(this._nav.navigateToDate(t),this.focusDate=void 0)}}render(){return Yi({uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,numberOfMonths:this.numberOfMonths,localeId:this.localeId,currentDate:this._nav.currentDate,prevMonthIcon:this.prevMonthIcon,nextMonthIcon:this.nextMonthIcon,prevMonthAriaLabel:this.prevMonthAriaLabel,nextMonthAriaLabel:this.nextMonthAriaLabel,canGoPrev:this._nav.canGoPrev(),canGoNext:this._nav.canGoNext(),onPrevMonthClick:this._keyboard.onPrevMonthClick,onNextMonthClick:this._keyboard.onNextMonthClick,onFocusOut:this._focusLeave.onFocusOut,renderAboveCalendar:()=>this.renderAboveCalendar(),renderMonthPanel:e=>Hi({currentDate:this._nav.currentDate,offset:e,localeId:this.localeId,monthFormat:this.monthFormat,yearSelectorOpen:this._nav.yearSelectorOpen,selectYearAriaLabel:this.selectYearAriaLabel,onToggleYearSelector:()=>this.toggleYearSelector(),renderBelowHeader:t=>this.renderBelowHeader(t),renderPanelBody:t=>this.renderPanelBody(t)})})}renderBelowHeader(e){return l.nothing}renderPanelBody(e){return Wi({offset:e,yearSelectorOpen:this._nav.yearSelectorOpen,years:this._nav.yearList,currentYear:this._nav.currentDate.getFullYear(),onSelectYear:t=>this._keyboard.selectYear(t),onYearKeydown:this._keyboard.handleYearKeydown,localeId:this.localeId,currentDate:this._nav.currentDate,yearGridAriaLabel:this.yearGridAriaLabel,getDays:t=>this.getDaysInMonth(t),renderDay:t=>this.renderDay(t)})}toggleYearSelector(){this._nav.toggleYearSelector()}isDisabled(e){return this._nav.isDisabled(e)}activationDay(e){const t=re(e);return{date:t,isCurrentMonth:!0,isDisabled:this.isDisabled(t),isFocusable:!0,dayLabel:"",isToday:!1,isRangeStart:!1,isRangeEnd:!1,isInRange:!1,isOneDayRange:!1,isAnchor:!1,isSelecting:!1,isInvalidStart:!1,isInvalidEnd:!1,isInvalidInRange:!1}}renderDay(e){const t=e.isInvalidStart&&e.isInvalidEnd,i={"gui-calendar__day-button":!0,today:e.isToday,"other-month":!e.isCurrentMonth,"range-start":e.isRangeStart&&!e.isOneDayRange,"range-end":e.isRangeEnd&&!e.isOneDayRange,selected:e.isOneDayRange,"in-range":e.isInRange,"invalid-range-start":e.isInvalidStart&&!t,"invalid-range-end":e.isInvalidEnd&&!t,"invalid-range-single":t,"invalid-in-range":e.isInvalidInRange,"is-anchor":e.isAnchor,"is-selecting":e.isSelecting,disabled:e.isDisabled};return l.html`
542
616
  <button
543
617
  type="button"
544
618
  role="gridcell"
545
- class=${w.classMap(i)}
619
+ class=${T.classMap(i)}
546
620
  tabindex=${e.isFocusable?0:-1}
547
- ?disabled=${!e.isCurrentMonth||e.isDisabled}
548
- data-date=${Q(e.date)}
621
+ ?disabled=${!e.isCurrentMonth}
622
+ aria-disabled=${e.isCurrentMonth&&e.isDisabled?"true":l.nothing}
623
+ aria-label=${Vi(this.localeId,e.date)}
624
+ aria-current=${e.isToday?"date":l.nothing}
625
+ data-date=${ae(e.date)}
549
626
  @click=${a=>this.selectDate(e,a)}
550
627
  @mouseover=${()=>this.onMouseOver(e)}
551
628
  @focus=${()=>this.onMouseOver(e)}
@@ -554,9 +631,11 @@
554
631
  >
555
632
  ${this.renderDayContent(e)}
556
633
  </button>
557
- `}getDaysInMonth(e){const t=(this.value??[]).map(a=>({start:this.endpointDay(a.start),end:a.end?this.endpointDay(a.end):void 0})),i=Ys(this._selection);return Hi({currentDate:this._currentDate,offset:e,localeId:this.localeId,numberOfMonths:this.numberOfMonths??1,isDisabled:a=>this.isDisabled(a),toDay:a=>{const r=Zi(a.date,{ranges:t,anchor:this._selection.anchor,selectingSpan:i,invalidRange:this._invalidRange});return{date:a.date,dayLabel:a.dayLabel,isCurrentMonth:a.isCurrentMonth,isToday:a.isToday,isRangeStart:r.isRangeStart,isRangeEnd:r.isRangeEnd,isInRange:r.isInRange,isInvalidStart:r.isInvalidStart&&a.isCurrentMonth,isInvalidEnd:r.isInvalidEnd&&a.isCurrentMonth,isInvalidInRange:r.isInvalidInRange&&a.isCurrentMonth,isDisabled:a.isDisabled,isOneDayRange:r.isOneDayRange,isAnchor:r.isAnchor,isFocusable:a.isToday||r.isRangeStart,isSelecting:r.isSelecting&&a.isCurrentMonth}},focusFallbackDates:[new Date,...(this.value??[]).map(a=>this.endpointDay(a.start))]})}selectDate(e,t=null){if(!e.isCurrentMonth||this.disabled||this.readOnly)return;const{state:i,commit:a}=ea(this._selection,{type:"pick",date:e.date});if(this._selection=i,!a){this._invalidRange=null;return}if(fs(Q(a.start),Q(a.end),this.disabledRanges,this.minDate,this.maxDate)){this._invalidRange={start:a.start,end:a.end},this.dispatchEvent(new CustomEvent("inputError",{detail:{message:this.disabledDateRangeMessage??wt,range:{start:Q(a.start),end:Q(a.end)}},bubbles:!0,composed:!0})),this.requestUpdate();return}this._invalidRange=null,this._skipValueNavigation=!0,this.value=ks([...this.value||[],$s(a.start,a.end)]),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))}onMouseOver(e){this._selection=ea(this._selection,{type:"hover",date:e.date}).state}renderAboveCalendar(){if(this.hidePills)return l.nothing;const e=this.getSortedPills();if(e.length===0)return l.nothing;const t=Gt(e,i=>this.formatPillLabel(i),this.removePillAriaLabel??"Remove date");return l.html`
634
+ `}getDaysInMonth(e){const t=(this.value??[]).map(a=>({start:this.endpointDay(a.start),end:a.end?this.endpointDay(a.end):void 0})),i=Gn(this._selection);return Ji({currentDate:this._currentDate,offset:e,localeId:this.localeId,numberOfMonths:this.numberOfMonths??1,isDisabled:a=>this.isDisabled(a),toDay:a=>{const r=Ki(a.date,{ranges:t,anchor:this._selection.anchor,selectingSpan:i,invalidRange:this._invalidRange});return{date:a.date,dayLabel:a.dayLabel,isCurrentMonth:a.isCurrentMonth,isToday:a.isToday,isRangeStart:r.isRangeStart,isRangeEnd:r.isRangeEnd,isInRange:r.isInRange,isInvalidStart:r.isInvalidStart&&a.isCurrentMonth,isInvalidEnd:r.isInvalidEnd&&a.isCurrentMonth,isInvalidInRange:r.isInvalidInRange&&a.isCurrentMonth,isDisabled:a.isDisabled,isOneDayRange:r.isOneDayRange,isAnchor:r.isAnchor,isFocusable:a.isToday||r.isRangeStart,isSelecting:r.isSelecting&&a.isCurrentMonth}},focusFallbackDates:[new Date,...(this.value??[]).map(a=>this.endpointDay(a.start))]})}selectDate(e,t=null){if(!e.isCurrentMonth||e.isDisabled||this.disabled||this.readOnly)return;const{state:i,commit:a}=sa(this._selection,{type:"pick",date:e.date});if(this._selection=i,!a){this._invalidRange=null;return}if(un(ae(a.start),ae(a.end),this.disabledRanges,this.minDate,this.maxDate)){this._invalidRange={start:a.start,end:a.end},this.dispatchEvent(new CustomEvent("inputError",{detail:{message:this.disabledDateRangeMessage??kt,range:{start:ae(a.start),end:ae(a.end)}},bubbles:!0,composed:!0})),this.requestUpdate();return}this._invalidRange=null,this._skipValueNavigation=!0,this.value=bn([...this.value||[],gn(a.start,a.end)]),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))}onMouseOver(e){e.isDisabled||(this._selection=sa(this._selection,{type:"hover",date:e.date}).state)}renderAboveCalendar(){if(this.hidePills)return l.nothing;const e=this.getSortedPills();if(e.length===0)return l.nothing;const t=Ht(e,i=>this.formatPillLabel(i));return l.html`
558
635
  <gui-pills
559
636
  class="gui-range-calendar__pills"
637
+ .uid=${this.uid}
638
+ .toolbarAriaLabel=${"Selected date ranges"}
560
639
  .items=${t}
561
640
  .removable=${!0}
562
641
  .clickable=${!0}
@@ -567,7 +646,7 @@
567
646
  @pillremove=${this.onPillRemoveEvent}
568
647
  @pillclick=${this.onPillClickEvent}
569
648
  ></gui-pills>
570
- `}getSortedPills(){return zt(this.value,(e,t)=>this.parseEndpoint(e).getTime()-this.parseEndpoint(t).getTime())}navigateToDate(e){this._nav.navigateToDate(this.endpointDay(e))}};V([n.property({type:String})],F.prototype,"uid",2),V([n.property({type:String})],F.prototype,"label",2),V([n.property({type:String})],F.prototype,"hint",2),V([n.property({type:String,attribute:"locale-id"})],F.prototype,"localeId",2),V([n.property({type:Array})],F.prototype,"errors",2),V([n.property({type:Boolean})],F.prototype,"touched",2),V([n.property({type:Boolean})],F.prototype,"required",2),V([n.property({type:Boolean})],F.prototype,"disabled",2),V([n.property({type:Boolean,attribute:"readonly"})],F.prototype,"readOnly",2),V([n.property({type:String,attribute:"prev-month-icon"})],F.prototype,"prevMonthIcon",2),V([n.property({type:String,attribute:"next-month-icon"})],F.prototype,"nextMonthIcon",2),V([n.property({type:String,attribute:"prev-month-aria-label"})],F.prototype,"prevMonthAriaLabel",2),V([n.property({type:String,attribute:"next-month-aria-label"})],F.prototype,"nextMonthAriaLabel",2),V([n.property({type:String})],F.prototype,"dayFormat",2),V([n.property({type:String})],F.prototype,"weekdayFormat",2),V([n.property({type:String})],F.prototype,"monthFormat",2),V([n.property({type:String})],F.prototype,"minDate",2),V([n.property({type:String})],F.prototype,"maxDate",2),V([n.property({type:Array})],F.prototype,"disabledRanges",2),V([n.property({type:Number})],F.prototype,"numberOfMonths",2),V([n.property({type:Array})],F.prototype,"value",2),V([n.property({type:String})],F.prototype,"focusDate",2),V([n.property({type:Boolean})],F.prototype,"hidePills",2),V([n.property({type:String})],F.prototype,"removePillAriaLabel",2),V([n.property({type:String,attribute:"disabled-date-range-message"})],F.prototype,"disabledDateRangeMessage",2),V([n.property({attribute:!1})],F.prototype,"invalidRange",2),V([n.state()],F.prototype,"_selection",2),V([n.state()],F.prototype,"_invalidRange",2),F=V([n.customElement("gui-range-calendar")],F),typeof customElements<"u"&&!customElements.get("gui-range-calendar")&&customElements.define("gui-range-calendar",F);var wd=Object.defineProperty,$d=Object.getOwnPropertyDescriptor,Pa=(e,t,i,a)=>{for(var r=a>1?void 0:a?$d(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&wd(t,i,r),r};let Ut=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-calendar","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
649
+ `}getSortedPills(){return Zt(this.value,(e,t)=>this.parseEndpoint(e).getTime()-this.parseEndpoint(t).getTime())}navigateToDate(e){this._nav.navigateToDate(this.endpointDay(e))}};H([n.property({type:String})],N.prototype,"uid",2),H([n.property({type:String})],N.prototype,"label",2),H([n.property({type:String})],N.prototype,"hint",2),H([n.property({type:String,attribute:"locale-id"})],N.prototype,"localeId",2),H([n.property({type:Array})],N.prototype,"errors",2),H([n.property({type:Boolean})],N.prototype,"touched",2),H([n.property({type:Boolean})],N.prototype,"required",2),H([n.property({type:Boolean})],N.prototype,"disabled",2),H([n.property({type:Boolean,attribute:"readonly"})],N.prototype,"readOnly",2),H([n.property({type:String,attribute:"prev-month-icon"})],N.prototype,"prevMonthIcon",2),H([n.property({type:String,attribute:"next-month-icon"})],N.prototype,"nextMonthIcon",2),H([n.property({type:String,attribute:"prev-month-aria-label"})],N.prototype,"prevMonthAriaLabel",2),H([n.property({type:String,attribute:"next-month-aria-label"})],N.prototype,"nextMonthAriaLabel",2),H([n.property({type:String,attribute:"select-year-aria-label"})],N.prototype,"selectYearAriaLabel",2),H([n.property({type:String,attribute:"year-grid-aria-label"})],N.prototype,"yearGridAriaLabel",2),H([n.property({type:String})],N.prototype,"dayFormat",2),H([n.property({type:String})],N.prototype,"weekdayFormat",2),H([n.property({type:String})],N.prototype,"monthFormat",2),H([n.property({type:String})],N.prototype,"minDate",2),H([n.property({type:String})],N.prototype,"maxDate",2),H([n.property({type:Array})],N.prototype,"disabledRanges",2),H([n.property({type:Number})],N.prototype,"numberOfMonths",2),H([n.property({type:Array})],N.prototype,"value",2),H([n.property({type:String})],N.prototype,"focusDate",2),H([n.property({type:Boolean})],N.prototype,"hidePills",2),H([n.property({type:String})],N.prototype,"removePillAriaLabel",2),H([n.property({type:String,attribute:"disabled-date-range-message"})],N.prototype,"disabledDateRangeMessage",2),H([n.property({attribute:!1})],N.prototype,"invalidRange",2),H([n.state()],N.prototype,"_selection",2),H([n.state()],N.prototype,"_invalidRange",2),N=H([n.customElement("gui-range-calendar")],N),typeof customElements<"u"&&!customElements.get("gui-range-calendar")&&customElements.define("gui-range-calendar",N);var Eh=Object.defineProperty,Ph=Object.getOwnPropertyDescriptor,Dr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Ph(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Eh(t,i,r),r};let Wt=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-calendar","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
571
650
  <gui-range-calendar
572
651
  .uid=${this.widget.uid}
573
652
  .label=${this.adapter.templateData.label}
@@ -582,6 +661,8 @@
582
661
  .nextMonthIcon=${this.adapter.templateData.nextMonthIcon}
583
662
  .prevMonthAriaLabel=${this.adapter.templateData.prevMonthAriaLabel}
584
663
  .nextMonthAriaLabel=${this.adapter.templateData.nextMonthAriaLabel}
664
+ .selectYearAriaLabel=${this.adapter.templateData.selectYearAriaLabel}
665
+ .yearGridAriaLabel=${this.adapter.templateData.yearGridAriaLabel}
585
666
  .dayFormat=${this.adapter.templateData.dayFormat}
586
667
  .weekdayFormat=${this.adapter.templateData.weekdayFormat}
587
668
  .monthFormat=${this.adapter.templateData.monthFormat}
@@ -597,8 +678,8 @@
597
678
  @inputError=${this.onInputError}
598
679
  @blur=${()=>this.adapter.onBlur()}
599
680
  ></gui-range-calendar>
600
- `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message]),this.adapter.onBlur()}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Pa([b.consume({context:m.formContext}),n.property({attribute:!1})],Ut.prototype,"formContext",2),Pa([b.provide({context:m.inputContext})],Ut.prototype,"adapter",2),Ut=Pa([n.customElement("gui-range-calendar-input")],Ut);const kd=Object.freeze(Object.defineProperty({__proto__:null,get RangeCalendarElement(){return Ut}},Symbol.toStringTag,{value:"Module"}));function _d(e,t,i){return i(t,e)<0?{start:t,end:e}:{start:e,end:t}}function Ia(e,t,i,a){if(e.kind==="invalid")return{kind:"invalid",message:e.message};if(t.kind==="invalid")return{kind:"invalid",message:t.message};if(e.kind!=="valid"||t.kind!=="valid")return{kind:"incomplete"};const r=a.order?a.order(e.value,t.value):{start:e.value,end:t.value},s=a.validate?.(r)??null;return s!==null?{kind:"invalid",message:s}:{kind:"commit",value:a.merge([...i??[],a.toRange(r)])}}var Td=Object.defineProperty,Sd=Object.getOwnPropertyDescriptor,Te=(e,t,i,a)=>{for(var r=a>1?void 0:a?Sd(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Td(t,i,r),r};let me=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.icon="",this.hint=void 0,this.value=[],this.invalidDateMessage=void 0,this.removePillAriaLabel=void 0,this.startDateAriaLabel=void 0,this.endDateAriaLabel=void 0,this.separator=void 0,this.inputBlockClass="gui-range-date-input",this.groups=["start","end"],this.partDescriptors=xa(),this._validationTriggered=!1,this._parts=new Et(this,{blockClass:this.inputBlockClass,groups:this.groups,getDescriptor:e=>this.getPartDescriptor(e),commitGroup:()=>{this._validationTriggered?this.revalidate():this.syncParts()},isReadonly:()=>!!this.readOnly,isDisabled:()=>!!this.disabled,onEmptyPartBlur:()=>{},onEnter:()=>{if(this.tryCreatePill(),this.value&&this.value.length>0){const e=this.value[this.value.length-1];this.onPillClick(e)}},onInputErrorSurfaced:e=>this.dispatchEvent(new CustomEvent("inputError",{detail:{message:e},bubbles:!0})),onSurfacedErrorCleared:e=>this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}),this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`.${this.inputBlockClass}`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})}),this.onPillRemoveEvent=e=>{if(this.disabled||this.readOnly)return;const t=Vt(this.value,e.detail.key);t&&(this.value=t.next,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),t.next.length===0&&requestAnimationFrame(()=>{this.querySelector(".gui-range-date-input__field input")?.focus()}))},this.onPillClickEvent=e=>{const t=Pt(this.getSortedPills(),e.detail.key);t&&this.onPillClick(t)}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}getPartDescriptor(e){return this.partDescriptors[e]}render(){const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint},t={blockClass:this.inputBlockClass,groups:this.groups,formatParts:vs(this.localeId),getDescriptor:r=>this.getPartDescriptor(r),getDisplayValue:this._parts.getPartDisplay,required:this.required,disabled:this.disabled,partsReadonly:!!this.readOnly},i=Gt(this.getSortedPills(),r=>Qi(r,s=>Ws(s,this.localeId)),this.removePillAriaLabel??"Remove date"),a={"gui-widget-icon":!0,[this.icon]:!!this.icon};return l.html`
601
- ${this.label?se(this.uid,e,!1,void 0,!1):l.nothing}
681
+ `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message]),this.adapter.onBlur()}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Dr([f.consume({context:m.formContext}),n.property({attribute:!1})],Wt.prototype,"formContext",2),Dr([f.provide({context:m.inputContext})],Wt.prototype,"adapter",2),Wt=Dr([n.customElement("gui-range-calendar-input")],Wt);const Oh=Object.freeze(Object.defineProperty({__proto__:null,get RangeCalendarElement(){return Wt}},Symbol.toStringTag,{value:"Module"}));function Ih(e,t,i){return i(t,e)<0?{start:t,end:e}:{start:e,end:t}}function wr(e,t,i,a){if(e.kind==="invalid")return{kind:"invalid",message:e.message};if(t.kind==="invalid")return{kind:"invalid",message:t.message};if(e.kind!=="valid"||t.kind!=="valid")return{kind:"incomplete"};const r=a.order?a.order(e.value,t.value):{start:e.value,end:t.value},s=a.validate?.(r)??null;return s!==null?{kind:"invalid",message:s}:{kind:"commit",value:a.merge([...i??[],a.toRange(r)])}}var Mh=Object.defineProperty,Rh=Object.getOwnPropertyDescriptor,ye=(e,t,i,a)=>{for(var r=a>1?void 0:a?Rh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Mh(t,i,r),r};let de=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.icon="",this.hint=void 0,this.dayAriaLabel=void 0,this.monthAriaLabel=void 0,this.yearAriaLabel=void 0,this.value=[],this.invalidDateMessage=void 0,this.removePillAriaLabel=void 0,this.startDateAriaLabel=void 0,this.endDateAriaLabel=void 0,this.separator=void 0,this.inputBlockClass="gui-range-date-input",this.groups=["start","end"],this.partDescriptors=fr(),this._validationTriggered=!1,this._parts=new Pt(this,{blockClass:this.inputBlockClass,groups:this.groups,getDescriptor:e=>this.getPartDescriptor(e),commitGroup:()=>{this._validationTriggered?this.revalidate():this.syncParts()},isReadonly:()=>!!this.readOnly,isDisabled:()=>!!this.disabled,onEmptyPartBlur:()=>{},onEnter:()=>{if(this.tryCreatePill(),this.value&&this.value.length>0){const e=this.value[this.value.length-1];this.onPillClick(e)}},onInputErrorSurfaced:e=>this.dispatchEvent(new CustomEvent("inputError",{detail:{message:e},bubbles:!0})),onSurfacedErrorCleared:e=>this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}),this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`.${this.inputBlockClass}`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})}),this.onPillRemoveEvent=e=>{if(this.disabled||this.readOnly)return;const t=Yt(this.value,e.detail.key);t&&(this.value=t.next,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),t.next.length===0&&requestAnimationFrame(()=>{this.querySelector(".gui-range-date-input__field input")?.focus()}))},this.onPillClickEvent=e=>{const t=It(this.getSortedPills(),e.detail.key);t&&this.onPillClick(t)}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}getPartDescriptor(e){return this.partDescriptors[e]}render(){const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint},t={blockClass:this.inputBlockClass,groups:this.groups,formatParts:hn(this.localeId),getDescriptor:r=>this.getPartDescriptor(r),getDisplayValue:this._parts.getPartDisplay,getPartAriaLabel:(r,s)=>({day:this.dayAriaLabel,month:this.monthAriaLabel,year:this.yearAriaLabel})[s]??St[s],disabled:this.disabled,partsReadonly:!!this.readOnly},i=Ht(this.getSortedPills(),r=>aa(r,s=>zn(s,this.localeId))),a={"gui-widget-icon":!0,[this.icon]:!!this.icon};return l.html`
682
+ ${this.label?le(this.uid,e,!1,void 0,!1):l.nothing}
602
683
 
603
684
  <div class="gui-widget">
604
685
  <div
@@ -606,11 +687,17 @@
606
687
  role="group"
607
688
  aria-label=${this.label??"Date range input"}
608
689
  >
609
- ${this.icon?l.html`<span class=${w.classMap(a)} data-icon=${this.icon}></span>`:l.nothing}
690
+ ${this.icon?l.html`<span
691
+ class=${T.classMap(a)}
692
+ data-icon=${this.icon}
693
+ aria-hidden="true"
694
+ ></span>`:l.nothing}
610
695
 
611
696
  <gui-pills
612
697
  class="gui-range-date-input__pills"
613
- style=${bt.styleMap(i.length?{}:{"min-width":0})}
698
+ style=${vt.styleMap(i.length?{}:{"min-width":0})}
699
+ .uid=${this.uid}
700
+ .toolbarAriaLabel=${"Selected date ranges"}
614
701
  .items=${i}
615
702
  .removable=${!0}
616
703
  .clickable=${!0}
@@ -629,7 +716,7 @@
629
716
  role="group"
630
717
  aria-label=${this.startDateAriaLabel??"Start date"}
631
718
  >
632
- ${mt("start",t,this._parts)}
719
+ ${yt("start",t,this._parts)}
633
720
  </div>
634
721
 
635
722
  <span class="gui-range-date-input__separator">${this.separator??"-"}</span>
@@ -639,14 +726,14 @@
639
726
  role="group"
640
727
  aria-label=${this.endDateAriaLabel??"End date"}
641
728
  >
642
- ${mt("end",t,this._parts)}
729
+ ${yt("end",t,this._parts)}
643
730
  </div>
644
731
  </div>
645
732
  </div>
646
733
 
647
- ${this.showErrors&&this.errors?.length?W(this.uid,e):l.nothing}
734
+ ${this.showErrors&&this.errors?.length?j(this.uid,e):l.nothing}
648
735
  </div>
649
- `}getSortedPills(){return zt(this.value,(e,t)=>j(e).getTime()-j(t).getTime())}onPillClick(e){this.dispatchEvent(new CustomEvent("pillClick",{detail:{range:e},bubbles:!0,composed:!0}))}validateDateParts(e){const{result:t,writeBacks:i}=zs(this._parts.values[e]??{},{descriptors:this.partDescriptors,invalidDateMessage:this.invalidDateMessage});return this._parts.applyWriteBacks(e,i),t.kind==="invalid"?{kind:"invalid",message:t.message}:t.kind==="valid"&&t.instant?{kind:"valid",value:t.instant}:{kind:"incomplete"}}syncParts(){return{start:this.validateDateParts("start"),end:this.validateDateParts("end")}}evaluateRange(){const{start:e,end:t}=this.syncParts(),i=Ia(e,t,this.value,{order:(a,r)=>_d(a,r,(s,o)=>s.getTime()-o.getTime()),toRange:({start:a,end:r})=>{const s=Q(a),o=Q(r);return s===o?{start:s}:{start:s,end:o}},merge:ks});return i.kind==="invalid"&&this._parts.surfaceInputError(i.message),i.kind==="incomplete"&&this._parts.clearSurfacedInputError(this.value??[]),i}revalidate(){this.evaluateRange().kind==="commit"&&this._parts.clearSurfacedInputError(this.value??[])}tryCreatePill(){this._validationTriggered=!0;const e=this.evaluateRange();e.kind==="commit"&&(this.value=e.value,this._validationTriggered=!1,this._parts.clearGroup("start"),this._parts.clearGroup("end"),this._parts.resetSurfacedInputError(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),this._parts.focusFirst("start"),this.requestUpdate())}showRange(e,t){this._parts.setGroupFromISO("start",e,"date"),this._parts.setGroupFromISO("end",t,"date")}clearRangeInputs(){this._parts.clearGroup("start"),this._parts.clearGroup("end")}};Te([n.property({type:String})],me.prototype,"uid",2),Te([n.property({type:String})],me.prototype,"label",2),Te([n.property({type:String,attribute:"locale-id"})],me.prototype,"localeId",2),Te([n.property({type:Array})],me.prototype,"errors",2),Te([n.property({type:Boolean})],me.prototype,"showErrors",2),Te([n.property({type:Boolean})],me.prototype,"touched",2),Te([n.property({type:Boolean})],me.prototype,"required",2),Te([n.property({type:Boolean})],me.prototype,"disabled",2),Te([n.property({type:Boolean,attribute:"readonly"})],me.prototype,"readOnly",2),Te([n.property({type:String})],me.prototype,"icon",2),Te([n.property({type:String})],me.prototype,"hint",2),Te([n.property({type:Array})],me.prototype,"value",2),Te([n.property({type:String,attribute:"invalid-date-message"})],me.prototype,"invalidDateMessage",2),Te([n.property({type:String})],me.prototype,"removePillAriaLabel",2),Te([n.property({type:String})],me.prototype,"startDateAriaLabel",2),Te([n.property({type:String})],me.prototype,"endDateAriaLabel",2),Te([n.property({type:String})],me.prototype,"separator",2),me=Te([n.customElement("gui-range-date")],me),typeof customElements<"u"&&!customElements.get("gui-range-date")&&customElements.define("gui-range-date",me);var Cd=Object.defineProperty,xd=Object.getOwnPropertyDescriptor,Oa=(e,t,i,a)=>{for(var r=a>1?void 0:a?xd(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Cd(t,i,r),r};let Zt=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-range-date","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
736
+ `}getSortedPills(){return Zt(this.value,(e,t)=>re(e).getTime()-re(t).getTime())}onPillClick(e){this.dispatchEvent(new CustomEvent("pillClick",{detail:{range:e},bubbles:!0,composed:!0}))}validateDateParts(e){const{result:t,writeBacks:i}=Mn(this._parts.values[e]??{},{descriptors:this.partDescriptors,invalidDateMessage:this.invalidDateMessage});return this._parts.applyWriteBacks(e,i),t.kind==="invalid"?{kind:"invalid",message:t.message}:t.kind==="valid"&&t.instant?{kind:"valid",value:t.instant}:{kind:"incomplete"}}syncParts(){return{start:this.validateDateParts("start"),end:this.validateDateParts("end")}}evaluateRange(){const{start:e,end:t}=this.syncParts(),i=wr(e,t,this.value,{order:(a,r)=>Ih(a,r,(s,o)=>s.getTime()-o.getTime()),toRange:({start:a,end:r})=>{const s=ae(a),o=ae(r);return s===o?{start:s}:{start:s,end:o}},merge:bn});return i.kind==="invalid"&&this._parts.surfaceInputError(i.message),i.kind==="incomplete"&&this._parts.clearSurfacedInputError(this.value??[]),i}revalidate(){this.evaluateRange().kind==="commit"&&this._parts.clearSurfacedInputError(this.value??[])}tryCreatePill(){this._validationTriggered=!0;const e=this.evaluateRange();e.kind==="commit"&&(this.value=e.value,this._validationTriggered=!1,this._parts.clearGroup("start"),this._parts.clearGroup("end"),this._parts.resetSurfacedInputError(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),this._parts.focusFirst("start"),this.requestUpdate())}showRange(e,t){this._parts.setGroupFromISO("start",e,"date"),this._parts.setGroupFromISO("end",t,"date")}clearRangeInputs(){this._parts.clearGroup("start"),this._parts.clearGroup("end")}};ye([n.property({type:String})],de.prototype,"uid",2),ye([n.property({type:String})],de.prototype,"label",2),ye([n.property({type:String,attribute:"locale-id"})],de.prototype,"localeId",2),ye([n.property({type:Array})],de.prototype,"errors",2),ye([n.property({type:Boolean})],de.prototype,"showErrors",2),ye([n.property({type:Boolean})],de.prototype,"touched",2),ye([n.property({type:Boolean})],de.prototype,"required",2),ye([n.property({type:Boolean})],de.prototype,"disabled",2),ye([n.property({type:Boolean,attribute:"readonly"})],de.prototype,"readOnly",2),ye([n.property({type:String})],de.prototype,"icon",2),ye([n.property({type:String})],de.prototype,"hint",2),ye([n.property({type:String})],de.prototype,"dayAriaLabel",2),ye([n.property({type:String})],de.prototype,"monthAriaLabel",2),ye([n.property({type:String})],de.prototype,"yearAriaLabel",2),ye([n.property({type:Array})],de.prototype,"value",2),ye([n.property({type:String,attribute:"invalid-date-message"})],de.prototype,"invalidDateMessage",2),ye([n.property({type:String})],de.prototype,"removePillAriaLabel",2),ye([n.property({type:String})],de.prototype,"startDateAriaLabel",2),ye([n.property({type:String})],de.prototype,"endDateAriaLabel",2),ye([n.property({type:String})],de.prototype,"separator",2),de=ye([n.customElement("gui-range-date")],de),typeof customElements<"u"&&!customElements.get("gui-range-date")&&customElements.define("gui-range-date",de);var Fh=Object.defineProperty,Bh=Object.getOwnPropertyDescriptor,$r=(e,t,i,a)=>{for(var r=a>1?void 0:a?Bh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Fh(t,i,r),r};let Kt=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-range-date","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
650
737
  <gui-range-date
651
738
  .uid=${this.widget.uid}
652
739
  .label=${this.adapter.templateData.label}
@@ -659,6 +746,9 @@
659
746
  ?readonly=${this.adapter.templateData.readonly}
660
747
  .value=${this.adapter.templateData.value}
661
748
  .localeId=${this.adapter.templateData.lang}
749
+ .dayAriaLabel=${this.adapter.templateData.dayAriaLabel}
750
+ .monthAriaLabel=${this.adapter.templateData.monthAriaLabel}
751
+ .yearAriaLabel=${this.adapter.templateData.yearAriaLabel}
662
752
  .invalidDateMessage=${this.adapter.templateData.invalidDateMessage}
663
753
  .separator=${this.adapter.templateData.separator}
664
754
  .removePillAriaLabel=${this.adapter.templateData.removePillAriaLabel}
@@ -667,8 +757,8 @@
667
757
  @change=${this.valueChanged}
668
758
  @inputError=${this.onInputError}
669
759
  ></gui-range-date>
670
- `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Oa([b.consume({context:m.formContext}),n.property({attribute:!1})],Zt.prototype,"formContext",2),Oa([b.provide({context:m.inputContext})],Zt.prototype,"adapter",2),Zt=Oa([n.customElement("gui-range-date-input")],Zt);const Ed=Object.freeze(Object.defineProperty({__proto__:null,get RangeDateInputElement(){return Zt}},Symbol.toStringTag,{value:"Module"}));var Md=Object.defineProperty,Pd=Object.getOwnPropertyDescriptor,K=(e,t,i,a)=>{for(var r=a>1?void 0:a?Pd(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Md(t,i,r),r};let G=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.icon="",this.hint=void 0,this.hourFormat=void 0,this.minuteStep=1,this.minTime=void 0,this.maxTime=void 0,this.minTimeMessage=void 0,this.maxTimeMessage=void 0,this.value=[],this.rangeOrderMessage=void 0,this.removePillAriaLabel=void 0,this.startTimeAriaLabel=void 0,this.endTimeAriaLabel=void 0,this.separator=void 0,this.allowCustomTime=void 0,this.disabledRanges=void 0,this.disabledRangeMessage=void 0,this.inputBlockClass="gui-range-time-input",this.groups=["start","end"],this._validationTriggered=!1,this._parts=new Et(this,{blockClass:this.inputBlockClass,groups:this.groups,getDescriptor:e=>this.getPartDescriptor(e),commitGroup:()=>{this._validationTriggered?this.revalidate():this.syncParts()},onInputErrorSurfaced:e=>this.dispatchEvent(new CustomEvent("inputError",{detail:{message:e},bubbles:!0})),onSurfacedErrorCleared:e=>this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0})),isReadonly:()=>!!this.readOnly||this.allowCustomTime===!1,isDisabled:()=>!!this.disabled,onEmptyPartBlur:()=>{},onEnter:()=>{this.tryCreatePill(),this.value&&this.value.length>0&&this.onPillClick(this.value[this.value.length-1])},getHourFormat:()=>this.timeLocaleData.effectiveHourFormat,getDayPeriodLabels:()=>this.timeLocaleData.dayPeriodLabels}),this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`.${this.inputBlockClass}`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})}),this.onPillRemoveEvent=e=>{if(this.disabled||this.readOnly)return;const t=Vt(this.value,e.detail.key);t&&(this.value=t.next,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),t.next.length===0&&requestAnimationFrame(()=>{this.querySelector(".gui-range-time-input__field input")?.focus()}))},this.onPillClickEvent=e=>{const t=Pt(this.getSortedPills(),e.detail.key);t&&this.onPillClick(t)}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}get timeLocaleData(){return Ji(this.localeId,this.hourFormat,this.minuteStep)}getPartDescriptor(e){return this.timeLocaleData.descriptors[e]}willUpdate(e){(!this.hasUpdated||e.has("hourFormat")||e.has("localeId"))&&this._parts.seedDayPeriods()}render(){const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint},t={blockClass:this.inputBlockClass,groups:this.groups,formatParts:Cs(this.localeId,this.timeLocaleData.effectiveHourFormat),getDescriptor:r=>this.getPartDescriptor(r),getDisplayValue:this._parts.getPartDisplay,required:this.required,disabled:this.disabled,partsReadonly:!!this.readOnly||this.allowCustomTime===!1},i=Gt(this.getSortedPills(),r=>Qi(r,s=>this.formatTimeForDisplay(s)),this.removePillAriaLabel??"Remove time"),a={"gui-widget-icon":!0,[this.icon]:!!this.icon};return l.html`
671
- ${this.label?se(this.uid,e,!1,void 0,!1):l.nothing}
760
+ `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};$r([f.consume({context:m.formContext}),n.property({attribute:!1})],Kt.prototype,"formContext",2),$r([f.provide({context:m.inputContext})],Kt.prototype,"adapter",2),Kt=$r([n.customElement("gui-range-date-input")],Kt);const qh=Object.freeze(Object.defineProperty({__proto__:null,get RangeDateInputElement(){return Kt}},Symbol.toStringTag,{value:"Module"}));var Nh=Object.defineProperty,zh=Object.getOwnPropertyDescriptor,W=(e,t,i,a)=>{for(var r=a>1?void 0:a?zh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Nh(t,i,r),r};let G=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.icon="",this.hint=void 0,this.hourAriaLabel=void 0,this.minuteAriaLabel=void 0,this.dayPeriodAriaLabel=void 0,this.hourFormat=void 0,this.minuteStep=1,this.minTime=void 0,this.maxTime=void 0,this.minTimeMessage=void 0,this.maxTimeMessage=void 0,this.value=[],this.rangeOrderMessage=void 0,this.removePillAriaLabel=void 0,this.startTimeAriaLabel=void 0,this.endTimeAriaLabel=void 0,this.separator=void 0,this.allowCustomTime=void 0,this.disabledRanges=void 0,this.disabledRangeMessage=void 0,this.inputBlockClass="gui-range-time-input",this.groups=["start","end"],this._validationTriggered=!1,this._parts=new Pt(this,{blockClass:this.inputBlockClass,groups:this.groups,getDescriptor:e=>this.getPartDescriptor(e),commitGroup:()=>{this._validationTriggered?this.revalidate():this.syncParts()},onInputErrorSurfaced:e=>this.dispatchEvent(new CustomEvent("inputError",{detail:{message:e},bubbles:!0})),onSurfacedErrorCleared:e=>this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0})),isReadonly:()=>!!this.readOnly||this.allowCustomTime===!1,isDisabled:()=>!!this.disabled,onEmptyPartBlur:()=>{},onEnter:()=>{this.tryCreatePill(),this.value&&this.value.length>0&&this.onPillClick(this.value[this.value.length-1])},getHourFormat:()=>this.timeLocaleData.effectiveHourFormat,getDayPeriodLabels:()=>this.timeLocaleData.dayPeriodLabels}),this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`.${this.inputBlockClass}`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})}),this.onPillRemoveEvent=e=>{if(this.disabled||this.readOnly)return;const t=Yt(this.value,e.detail.key);t&&(this.value=t.next,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),t.next.length===0&&requestAnimationFrame(()=>{this.querySelector(".gui-range-time-input__field input")?.focus()}))},this.onPillClickEvent=e=>{const t=It(this.getSortedPills(),e.detail.key);t&&this.onPillClick(t)}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}get timeLocaleData(){return ia(this.localeId,this.hourFormat,this.minuteStep)}getPartDescriptor(e){return this.timeLocaleData.descriptors[e]}willUpdate(e){(!this.hasUpdated||e.has("hourFormat")||e.has("localeId"))&&this._parts.seedDayPeriods()}render(){const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint},t={blockClass:this.inputBlockClass,groups:this.groups,formatParts:wn(this.localeId,this.timeLocaleData.effectiveHourFormat),getDescriptor:r=>this.getPartDescriptor(r),getDisplayValue:this._parts.getPartDisplay,getPartAriaLabel:(r,s)=>({hour:this.hourAriaLabel,minute:this.minuteAriaLabel})[s]??St[s],dayPeriodAriaLabel:this.dayPeriodAriaLabel,disabled:this.disabled,partsReadonly:!!this.readOnly||this.allowCustomTime===!1},i=Ht(this.getSortedPills(),r=>aa(r,s=>this.formatTimeForDisplay(s))),a={"gui-widget-icon":!0,[this.icon]:!!this.icon};return l.html`
761
+ ${this.label?le(this.uid,e,!1,void 0,!1):l.nothing}
672
762
 
673
763
  <div class="gui-widget">
674
764
  <div
@@ -676,11 +766,17 @@
676
766
  role="group"
677
767
  aria-label=${this.label??"Time range input"}
678
768
  >
679
- ${this.icon?l.html`<span class=${w.classMap(a)} data-icon=${this.icon}></span>`:l.nothing}
769
+ ${this.icon?l.html`<span
770
+ class=${T.classMap(a)}
771
+ data-icon=${this.icon}
772
+ aria-hidden="true"
773
+ ></span>`:l.nothing}
680
774
 
681
775
  <gui-pills
682
776
  class="gui-range-time-input__pills"
683
- style=${bt.styleMap(i.length?{}:{"min-width":0})}
777
+ style=${vt.styleMap(i.length?{}:{"min-width":0})}
778
+ .uid=${this.uid}
779
+ .toolbarAriaLabel=${"Selected time ranges"}
684
780
  .items=${i}
685
781
  .removable=${!0}
686
782
  .clickable=${!0}
@@ -699,7 +795,7 @@
699
795
  role="group"
700
796
  aria-label=${this.startTimeAriaLabel??"Start time"}
701
797
  >
702
- ${mt("start",t,this._parts)}
798
+ ${yt("start",t,this._parts)}
703
799
  </div>
704
800
 
705
801
  <span class="gui-range-time-input__separator">${this.separator??"-"}</span>
@@ -709,14 +805,14 @@
709
805
  role="group"
710
806
  aria-label=${this.endTimeAriaLabel??"End time"}
711
807
  >
712
- ${mt("end",t,this._parts)}
808
+ ${yt("end",t,this._parts)}
713
809
  </div>
714
810
  </div>
715
811
  </div>
716
812
 
717
- ${this.showErrors&&this.errors?.length?W(this.uid,e):l.nothing}
813
+ ${this.showErrors&&this.errors?.length?j(this.uid,e):l.nothing}
718
814
  </div>
719
- `}onPillClick(e){this.dispatchEvent(new CustomEvent("pillClick",{detail:{range:e},bubbles:!0,composed:!0}))}formatTimeForDisplay(e){return Xi(e,this.localeId,this.timeLocaleData.effectiveHourFormat)}getSortedPills(){return zt(this.value,Ae)}validateTimeParts(e){const{effectiveHourFormat:t,descriptors:i}=this.timeLocaleData,{result:a,writeBacks:r}=Vs(this._parts.values[e]??{},{hourFormat:t,descriptors:i});if(this._parts.applyWriteBacks(e,r),a.kind!=="valid")return{kind:"incomplete"};const s=Ea(a.iso,{minTime:this.minTime,maxTime:this.maxTime,minTimeMessage:this.minTimeMessage,maxTimeMessage:this.maxTimeMessage});return s?{kind:"invalid",message:s}:{kind:"valid",value:a.iso}}fillGroup(e,t){this._parts.setGroupFromISO(e,t,"time",this.timeLocaleData.effectiveHourFormat),this.requestUpdate()}commitFromParts(){return this.tryCreatePill()}syncParts(){const e=this.validateTimeParts("start"),t=this.validateTimeParts("end"),i=a=>a.kind==="valid"?a.value:null;return this.dispatchEvent(new CustomEvent("partsChange",{detail:{start:i(e),end:i(t)},bubbles:!0,composed:!0})),{start:e,end:t}}evaluateRange(){const{start:e,end:t}=this.syncParts(),i=Ia(e,t,this.value,{validate:a=>Ae(a.end,a.start)<=0?this.rangeOrderMessage??Mp:Ps(a.start,a.end,this.disabledRanges)?this.disabledRangeMessage??qi:null,toRange:a=>({start:a.start,end:a.end}),merge:Wp});return i.kind==="incomplete"&&this._parts.clearSurfacedInputError(this.value??[]),i.kind==="invalid"&&this._parts.surfaceInputError(i.message),i}revalidate(){this.evaluateRange().kind==="commit"&&this._parts.clearSurfacedInputError(this.value??[])}tryCreatePill(){this._validationTriggered=!0;const e=this.evaluateRange();return e.kind!=="commit"?!1:(this.value=e.value,this._validationTriggered=!1,this._parts.clearGroup("start"),this._parts.clearGroup("end"),this._parts.seedDayPeriods(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),this._parts.focusFirst("start"),this.requestUpdate(),!0)}};K([n.property({type:String})],G.prototype,"uid",2),K([n.property({type:String})],G.prototype,"label",2),K([n.property({type:String,attribute:"locale-id"})],G.prototype,"localeId",2),K([n.property({type:Array})],G.prototype,"errors",2),K([n.property({type:Boolean})],G.prototype,"showErrors",2),K([n.property({type:Boolean})],G.prototype,"touched",2),K([n.property({type:Boolean})],G.prototype,"required",2),K([n.property({type:Boolean})],G.prototype,"disabled",2),K([n.property({type:Boolean,attribute:"readonly"})],G.prototype,"readOnly",2),K([n.property({type:String})],G.prototype,"icon",2),K([n.property({type:String})],G.prototype,"hint",2),K([n.property({type:String,attribute:"hour-format"})],G.prototype,"hourFormat",2),K([n.property({type:Number,attribute:"minute-step"})],G.prototype,"minuteStep",2),K([n.property({type:String,attribute:"min-time"})],G.prototype,"minTime",2),K([n.property({type:String,attribute:"max-time"})],G.prototype,"maxTime",2),K([n.property({type:String,attribute:"min-time-message"})],G.prototype,"minTimeMessage",2),K([n.property({type:String,attribute:"max-time-message"})],G.prototype,"maxTimeMessage",2),K([n.property({type:Array})],G.prototype,"value",2),K([n.property({type:String,attribute:"range-order-message"})],G.prototype,"rangeOrderMessage",2),K([n.property({type:String})],G.prototype,"removePillAriaLabel",2),K([n.property({type:String})],G.prototype,"startTimeAriaLabel",2),K([n.property({type:String})],G.prototype,"endTimeAriaLabel",2),K([n.property({type:String})],G.prototype,"separator",2),K([n.property({type:Boolean,attribute:"allow-custom-time"})],G.prototype,"allowCustomTime",2),K([n.property({type:Array,attribute:"disabled-ranges"})],G.prototype,"disabledRanges",2),K([n.property({type:String,attribute:"disabled-range-message"})],G.prototype,"disabledRangeMessage",2),G=K([n.customElement("gui-range-time")],G),typeof customElements<"u"&&!customElements.get("gui-range-time")&&customElements.define("gui-range-time",G);var Id=Object.defineProperty,Od=Object.getOwnPropertyDescriptor,Aa=(e,t,i,a)=>{for(var r=a>1?void 0:a?Od(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Id(t,i,r),r};let Ht=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-range-time","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
815
+ `}onPillClick(e){this.dispatchEvent(new CustomEvent("pillClick",{detail:{range:e},bubbles:!0,composed:!0}))}formatTimeForDisplay(e){return ea(e,this.localeId,this.timeLocaleData.effectiveHourFormat)}getSortedPills(){return Zt(this.value,Re)}validateTimeParts(e){const{effectiveHourFormat:t,descriptors:i}=this.timeLocaleData,{result:a,writeBacks:r}=Rn(this._parts.values[e]??{},{hourFormat:t,descriptors:i});if(this._parts.applyWriteBacks(e,r),a.kind!=="valid")return{kind:"incomplete"};const s=ta(a.iso,{minTime:this.minTime,maxTime:this.maxTime,minTimeMessage:this.minTimeMessage,maxTimeMessage:this.maxTimeMessage});return s?{kind:"invalid",message:s}:{kind:"valid",value:a.iso}}fillGroup(e,t){this._parts.setGroupFromISO(e,t,"time",this.timeLocaleData.effectiveHourFormat),this.requestUpdate()}commitFromParts(){return this.tryCreatePill()}syncParts(){const e=this.validateTimeParts("start"),t=this.validateTimeParts("end"),i=a=>a.kind==="valid"?a.value:null;return this.dispatchEvent(new CustomEvent("partsChange",{detail:{start:i(e),end:i(t)},bubbles:!0,composed:!0})),{start:e,end:t}}evaluateRange(){const{start:e,end:t}=this.syncParts(),i=wr(e,t,this.value,{validate:a=>Re(a.end,a.start)<=0?this.rangeOrderMessage??Nu:Tn(a.start,a.end,this.disabledRanges)?this.disabledRangeMessage??zi:null,toRange:a=>({start:a.start,end:a.end}),merge:ah});return i.kind==="incomplete"&&this._parts.clearSurfacedInputError(this.value??[]),i.kind==="invalid"&&this._parts.surfaceInputError(i.message),i}revalidate(){this.evaluateRange().kind==="commit"&&this._parts.clearSurfacedInputError(this.value??[])}tryCreatePill(){this._validationTriggered=!0;const e=this.evaluateRange();return e.kind!=="commit"?!1:(this.value=e.value,this._validationTriggered=!1,this._parts.clearGroup("start"),this._parts.clearGroup("end"),this._parts.seedDayPeriods(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),this._parts.focusFirst("start"),this.requestUpdate(),!0)}};W([n.property({type:String})],G.prototype,"uid",2),W([n.property({type:String})],G.prototype,"label",2),W([n.property({type:String,attribute:"locale-id"})],G.prototype,"localeId",2),W([n.property({type:Array})],G.prototype,"errors",2),W([n.property({type:Boolean})],G.prototype,"showErrors",2),W([n.property({type:Boolean})],G.prototype,"touched",2),W([n.property({type:Boolean})],G.prototype,"required",2),W([n.property({type:Boolean})],G.prototype,"disabled",2),W([n.property({type:Boolean,attribute:"readonly"})],G.prototype,"readOnly",2),W([n.property({type:String})],G.prototype,"icon",2),W([n.property({type:String})],G.prototype,"hint",2),W([n.property({type:String})],G.prototype,"hourAriaLabel",2),W([n.property({type:String})],G.prototype,"minuteAriaLabel",2),W([n.property({type:String})],G.prototype,"dayPeriodAriaLabel",2),W([n.property({type:String,attribute:"hour-format"})],G.prototype,"hourFormat",2),W([n.property({type:Number,attribute:"minute-step"})],G.prototype,"minuteStep",2),W([n.property({type:String,attribute:"min-time"})],G.prototype,"minTime",2),W([n.property({type:String,attribute:"max-time"})],G.prototype,"maxTime",2),W([n.property({type:String,attribute:"min-time-message"})],G.prototype,"minTimeMessage",2),W([n.property({type:String,attribute:"max-time-message"})],G.prototype,"maxTimeMessage",2),W([n.property({type:Array})],G.prototype,"value",2),W([n.property({type:String,attribute:"range-order-message"})],G.prototype,"rangeOrderMessage",2),W([n.property({type:String})],G.prototype,"removePillAriaLabel",2),W([n.property({type:String})],G.prototype,"startTimeAriaLabel",2),W([n.property({type:String})],G.prototype,"endTimeAriaLabel",2),W([n.property({type:String})],G.prototype,"separator",2),W([n.property({type:Boolean,attribute:"allow-custom-time"})],G.prototype,"allowCustomTime",2),W([n.property({type:Array,attribute:"disabled-ranges"})],G.prototype,"disabledRanges",2),W([n.property({type:String,attribute:"disabled-range-message"})],G.prototype,"disabledRangeMessage",2),G=W([n.customElement("gui-range-time")],G),typeof customElements<"u"&&!customElements.get("gui-range-time")&&customElements.define("gui-range-time",G);var Gh=Object.defineProperty,Vh=Object.getOwnPropertyDescriptor,kr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Vh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Gh(t,i,r),r};let Jt=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-range-time","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
720
816
  <gui-range-time
721
817
  .uid=${this.widget.uid}
722
818
  .label=${this.adapter.templateData.label}
@@ -729,6 +825,9 @@
729
825
  ?readonly=${this.adapter.templateData.readonly}
730
826
  .value=${this.adapter.templateData.value}
731
827
  .localeId=${this.adapter.templateData.lang}
828
+ .hourAriaLabel=${this.adapter.templateData.hourAriaLabel}
829
+ .minuteAriaLabel=${this.adapter.templateData.minuteAriaLabel}
830
+ .dayPeriodAriaLabel=${this.adapter.templateData.dayPeriodAriaLabel}
732
831
  .separator=${this.adapter.templateData.separator}
733
832
  .removePillAriaLabel=${this.adapter.templateData.removePillAriaLabel}
734
833
  .startTimeAriaLabel=${this.adapter.templateData.startTimeAriaLabel}
@@ -743,8 +842,8 @@
743
842
  @change=${this.valueChanged}
744
843
  @inputError=${this.onInputError}
745
844
  ></gui-range-time>
746
- `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Aa([b.consume({context:m.formContext}),n.property({attribute:!1})],Ht.prototype,"formContext",2),Aa([b.provide({context:m.inputContext})],Ht.prototype,"adapter",2),Ht=Aa([n.customElement("gui-range-time-input")],Ht);const Ad=Object.freeze(Object.defineProperty({__proto__:null,get RangeTimeInputElement(){return Ht}},Symbol.toStringTag,{value:"Module"}));var Ld=Object.defineProperty,Rd=Object.getOwnPropertyDescriptor,ee=(e,t,i,a)=>{for(var r=a>1?void 0:a?Rd(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Ld(t,i,r),r};let H=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.icon="",this.hint=void 0,this.hourFormat=void 0,this.minuteStep=1,this.invalidDateMessage=void 0,this.value=[],this.removePillAriaLabel=void 0,this.startDateTimeAriaLabel=void 0,this.endDateTimeAriaLabel=void 0,this.separator=void 0,this.minDateTime=void 0,this.maxDateTime=void 0,this.minDateTimeMessage=void 0,this.maxDateTimeMessage=void 0,this.disabledRanges=void 0,this.disabledRangeMessage=void 0,this.inputBlockClass="gui-range-date-time-input",this.groups=["start","end"],this._validationTriggered=!1,this._parts=new Et(this,{blockClass:this.inputBlockClass,groups:this.groups,getDescriptor:e=>this.getPartDescriptor(e),commitGroup:()=>{this._validationTriggered?this.revalidate():this.syncParts()},isReadonly:()=>!!this.readOnly,isDisabled:()=>!!this.disabled,onEmptyPartBlur:()=>{},onEnter:()=>{this.tryCreatePill(),this.value&&this.value.length>0&&this.onPillClick(this.value[this.value.length-1])},getHourFormat:()=>this.localeData.effectiveHourFormat,getDayPeriodLabels:()=>this.localeData.dayPeriodLabels,onInputErrorSurfaced:e=>this.dispatchEvent(new CustomEvent("inputError",{detail:{message:e},bubbles:!0})),onSurfacedErrorCleared:e=>this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}),this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`.${this.inputBlockClass}`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})}),this.onPillRemoveEvent=e=>{if(this.disabled||this.readOnly)return;const t=Vt(this.value,e.detail.key);t&&(this.value=t.next,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),t.next.length===0&&requestAnimationFrame(()=>{this.querySelector(".gui-range-date-time-input__field input")?.focus()}))},this.onPillClickEvent=e=>{const t=Pt(this.getSortedPills(),e.detail.key);t&&this.onPillClick(t)}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}get localeData(){return Ji(this.localeId,this.hourFormat,this.minuteStep,!0)}getPartDescriptor(e){return this.localeData.descriptors[e]}willUpdate(e){(!this.hasUpdated||e.has("hourFormat")||e.has("localeId"))&&this._parts.seedDayPeriods()}render(){const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint},t={blockClass:this.inputBlockClass,groups:this.groups,formatParts:xs(this.localeId,this.localeData.effectiveHourFormat),getDescriptor:r=>this.getPartDescriptor(r),getDisplayValue:this._parts.getPartDisplay,required:this.required,disabled:this.disabled,partsReadonly:!!this.readOnly},i=Gt(this.getSortedPills(),r=>Qi(r,s=>this.formatDateTimeForDisplay(s)),this.removePillAriaLabel??"Remove date-time"),a={"gui-widget-icon":!0,[this.icon]:!!this.icon};return l.html`
747
- ${this.label?se(this.uid,e,!1,void 0,!1):l.nothing}
845
+ `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};kr([f.consume({context:m.formContext}),n.property({attribute:!1})],Jt.prototype,"formContext",2),kr([f.provide({context:m.inputContext})],Jt.prototype,"adapter",2),Jt=kr([n.customElement("gui-range-time-input")],Jt);const Uh=Object.freeze(Object.defineProperty({__proto__:null,get RangeTimeInputElement(){return Jt}},Symbol.toStringTag,{value:"Module"}));var Zh=Object.defineProperty,Yh=Object.getOwnPropertyDescriptor,V=(e,t,i,a)=>{for(var r=a>1?void 0:a?Yh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Zh(t,i,r),r};let R=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.icon="",this.hint=void 0,this.dayAriaLabel=void 0,this.monthAriaLabel=void 0,this.yearAriaLabel=void 0,this.hourAriaLabel=void 0,this.minuteAriaLabel=void 0,this.dayPeriodAriaLabel=void 0,this.hourFormat=void 0,this.minuteStep=1,this.invalidDateMessage=void 0,this.value=[],this.removePillAriaLabel=void 0,this.startDateTimeAriaLabel=void 0,this.endDateTimeAriaLabel=void 0,this.separator=void 0,this.minDateTime=void 0,this.maxDateTime=void 0,this.minDateTimeMessage=void 0,this.maxDateTimeMessage=void 0,this.disabledRanges=void 0,this.disabledRangeMessage=void 0,this.inputBlockClass="gui-range-date-time-input",this.groups=["start","end"],this._validationTriggered=!1,this._parts=new Pt(this,{blockClass:this.inputBlockClass,groups:this.groups,getDescriptor:e=>this.getPartDescriptor(e),commitGroup:()=>{this._validationTriggered?this.revalidate():this.syncParts()},isReadonly:()=>!!this.readOnly,isDisabled:()=>!!this.disabled,onEmptyPartBlur:()=>{},onEnter:()=>{this.tryCreatePill(),this.value&&this.value.length>0&&this.onPillClick(this.value[this.value.length-1])},getHourFormat:()=>this.localeData.effectiveHourFormat,getDayPeriodLabels:()=>this.localeData.dayPeriodLabels,onInputErrorSurfaced:e=>this.dispatchEvent(new CustomEvent("inputError",{detail:{message:e},bubbles:!0})),onSurfacedErrorCleared:e=>this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}),this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`.${this.inputBlockClass}`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})}),this.onPillRemoveEvent=e=>{if(this.disabled||this.readOnly)return;const t=Yt(this.value,e.detail.key);t&&(this.value=t.next,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),t.next.length===0&&requestAnimationFrame(()=>{this.querySelector(".gui-range-date-time-input__field input")?.focus()}))},this.onPillClickEvent=e=>{const t=It(this.getSortedPills(),e.detail.key);t&&this.onPillClick(t)}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}get localeData(){return ia(this.localeId,this.hourFormat,this.minuteStep,!0)}getPartDescriptor(e){return this.localeData.descriptors[e]}willUpdate(e){(!this.hasUpdated||e.has("hourFormat")||e.has("localeId"))&&this._parts.seedDayPeriods()}render(){const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint},t={blockClass:this.inputBlockClass,groups:this.groups,formatParts:$n(this.localeId,this.localeData.effectiveHourFormat),getDescriptor:r=>this.getPartDescriptor(r),getDisplayValue:this._parts.getPartDisplay,getPartAriaLabel:(r,s)=>({day:this.dayAriaLabel,month:this.monthAriaLabel,year:this.yearAriaLabel,hour:this.hourAriaLabel,minute:this.minuteAriaLabel})[s]??St[s],dayPeriodAriaLabel:this.dayPeriodAriaLabel,disabled:this.disabled,partsReadonly:!!this.readOnly},i=Ht(this.getSortedPills(),r=>aa(r,s=>this.formatDateTimeForDisplay(s))),a={"gui-widget-icon":!0,[this.icon]:!!this.icon};return l.html`
846
+ ${this.label?le(this.uid,e,!1,void 0,!1):l.nothing}
748
847
 
749
848
  <div class="gui-widget">
750
849
  <div
@@ -752,11 +851,17 @@
752
851
  role="group"
753
852
  aria-label=${this.label??"Date-time range input"}
754
853
  >
755
- ${this.icon?l.html`<span class=${w.classMap(a)} data-icon=${this.icon}></span>`:l.nothing}
854
+ ${this.icon?l.html`<span
855
+ class=${T.classMap(a)}
856
+ data-icon=${this.icon}
857
+ aria-hidden="true"
858
+ ></span>`:l.nothing}
756
859
 
757
860
  <gui-pills
758
861
  class="gui-range-date-time-input__pills"
759
- style=${bt.styleMap(i.length?{}:{"min-width":0})}
862
+ style=${vt.styleMap(i.length?{}:{"min-width":0})}
863
+ .uid=${this.uid}
864
+ .toolbarAriaLabel=${"Selected date-time ranges"}
760
865
  .items=${i}
761
866
  .removable=${!0}
762
867
  .clickable=${!0}
@@ -775,7 +880,7 @@
775
880
  role="group"
776
881
  aria-label=${this.startDateTimeAriaLabel??"Start date-time"}
777
882
  >
778
- ${mt("start",t,this._parts)}
883
+ ${yt("start",t,this._parts)}
779
884
  </div>
780
885
 
781
886
  <span class="gui-range-date-time-input__separator">${this.separator??"-"}</span>
@@ -785,14 +890,14 @@
785
890
  role="group"
786
891
  aria-label=${this.endDateTimeAriaLabel??"End date-time"}
787
892
  >
788
- ${mt("end",t,this._parts)}
893
+ ${yt("end",t,this._parts)}
789
894
  </div>
790
895
  </div>
791
896
  </div>
792
897
 
793
- ${this.showErrors&&this.errors?.length?W(this.uid,e):l.nothing}
898
+ ${this.showErrors&&this.errors?.length?j(this.uid,e):l.nothing}
794
899
  </div>
795
- `}onPillClick(e){this.dispatchEvent(new CustomEvent("pillClick",{detail:{range:e},bubbles:!0,composed:!0}))}formatDateTimeForDisplay(e){return Ca(e,this.localeId,this.localeData.effectiveHourFormat)}getSortedPills(){return zt(this.value,(e,t)=>Y(e).getTime()-Y(t).getTime())}validateDateTimeParts(e){const{effectiveHourFormat:t,descriptors:i}=this.localeData,{result:a,writeBacks:r}=Gs(this._parts.values[e]??{},{hourFormat:t,descriptors:i,invalidDateMessage:this.invalidDateMessage});if(this._parts.applyWriteBacks(e,r),a.kind==="incomplete")return{kind:"incomplete"};if(a.kind==="invalid")return{kind:"invalid",message:a.message};const s=Fs(a.iso,this.minDateTime,this.maxDateTime,{minDateTimeMessage:this.minDateTimeMessage,maxDateTimeMessage:this.maxDateTimeMessage});return s?{kind:"invalid",message:s}:{kind:"valid",value:a.iso}}syncParts(){return{start:this.validateDateTimeParts("start"),end:this.validateDateTimeParts("end")}}evaluateRange(){const{start:e,end:t}=this.syncParts(),i=Ia(e,t,this.value,{order:(a,r)=>{const s=Os(a,r);return{start:s.start,end:s.end}},validate:a=>Ls({start:a.start,end:a.end},this.disabledRanges)?this.disabledRangeMessage??wt:null,toRange:a=>({start:a.start,end:a.end}),merge:As});return i.kind==="invalid"&&this._parts.surfaceInputError(i.message),i.kind==="incomplete"&&this._parts.clearSurfacedInputError(this.value??[]),i}revalidate(){this.evaluateRange().kind==="commit"&&this._parts.clearSurfacedInputError(this.value??[])}tryCreatePill(){this._validationTriggered=!0;const e=this.evaluateRange();e.kind==="commit"&&(this.value=e.value,this._validationTriggered=!1,this._parts.clearGroup("start"),this._parts.clearGroup("end"),this._parts.seedDayPeriods(),this._parts.resetSurfacedInputError(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),this._parts.focusFirst("start"),this.requestUpdate())}};ee([n.property({type:String})],H.prototype,"uid",2),ee([n.property({type:String})],H.prototype,"label",2),ee([n.property({type:String,attribute:"locale-id"})],H.prototype,"localeId",2),ee([n.property({type:Array})],H.prototype,"errors",2),ee([n.property({type:Boolean})],H.prototype,"showErrors",2),ee([n.property({type:Boolean})],H.prototype,"touched",2),ee([n.property({type:Boolean})],H.prototype,"required",2),ee([n.property({type:Boolean})],H.prototype,"disabled",2),ee([n.property({type:Boolean,attribute:"readonly"})],H.prototype,"readOnly",2),ee([n.property({type:String})],H.prototype,"icon",2),ee([n.property({type:String})],H.prototype,"hint",2),ee([n.property({type:String,attribute:"hour-format"})],H.prototype,"hourFormat",2),ee([n.property({type:Number,attribute:"minute-step"})],H.prototype,"minuteStep",2),ee([n.property({type:String,attribute:"invalid-date-message"})],H.prototype,"invalidDateMessage",2),ee([n.property({type:Array})],H.prototype,"value",2),ee([n.property({type:String})],H.prototype,"removePillAriaLabel",2),ee([n.property({type:String})],H.prototype,"startDateTimeAriaLabel",2),ee([n.property({type:String})],H.prototype,"endDateTimeAriaLabel",2),ee([n.property({type:String})],H.prototype,"separator",2),ee([n.property({type:String,attribute:"min-date-time"})],H.prototype,"minDateTime",2),ee([n.property({type:String,attribute:"max-date-time"})],H.prototype,"maxDateTime",2),ee([n.property({type:String,attribute:"min-date-time-message"})],H.prototype,"minDateTimeMessage",2),ee([n.property({type:String,attribute:"max-date-time-message"})],H.prototype,"maxDateTimeMessage",2),ee([n.property({type:Array,attribute:"disabled-ranges"})],H.prototype,"disabledRanges",2),ee([n.property({type:String,attribute:"disabled-range-message"})],H.prototype,"disabledRangeMessage",2),H=ee([n.customElement("gui-range-date-time")],H),typeof customElements<"u"&&!customElements.get("gui-range-date-time")&&customElements.define("gui-range-date-time",H);var Fd=Object.defineProperty,Bd=Object.getOwnPropertyDescriptor,La=(e,t,i,a)=>{for(var r=a>1?void 0:a?Bd(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Fd(t,i,r),r};let Wt=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-range-date-time","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
900
+ `}onPillClick(e){this.dispatchEvent(new CustomEvent("pillClick",{detail:{range:e},bubbles:!0,composed:!0}))}formatDateTimeForDisplay(e){return br(e,this.localeId,this.localeData.effectiveHourFormat)}getSortedPills(){return Zt(this.value,(e,t)=>ee(e).getTime()-ee(t).getTime())}validateDateTimeParts(e){const{effectiveHourFormat:t,descriptors:i}=this.localeData,{result:a,writeBacks:r}=Fn(this._parts.values[e]??{},{hourFormat:t,descriptors:i,invalidDateMessage:this.invalidDateMessage});if(this._parts.applyWriteBacks(e,r),a.kind==="incomplete")return{kind:"incomplete"};if(a.kind==="invalid")return{kind:"invalid",message:a.message};const s=En(a.iso,this.minDateTime,this.maxDateTime,{minDateTimeMessage:this.minDateTimeMessage,maxDateTimeMessage:this.maxDateTimeMessage});return s?{kind:"invalid",message:s}:{kind:"valid",value:a.iso}}syncParts(){return{start:this.validateDateTimeParts("start"),end:this.validateDateTimeParts("end")}}evaluateRange(){const{start:e,end:t}=this.syncParts(),i=wr(e,t,this.value,{order:(a,r)=>{const s=An(a,r);return{start:s.start,end:s.end}},validate:a=>Ln({start:a.start,end:a.end},this.disabledRanges)?this.disabledRangeMessage??kt:null,toRange:a=>({start:a.start,end:a.end}),merge:Cn});return i.kind==="invalid"&&this._parts.surfaceInputError(i.message),i.kind==="incomplete"&&this._parts.clearSurfacedInputError(this.value??[]),i}revalidate(){this.evaluateRange().kind==="commit"&&this._parts.clearSurfacedInputError(this.value??[])}tryCreatePill(){this._validationTriggered=!0;const e=this.evaluateRange();e.kind==="commit"&&(this.value=e.value,this._validationTriggered=!1,this._parts.clearGroup("start"),this._parts.clearGroup("end"),this._parts.seedDayPeriods(),this._parts.resetSurfacedInputError(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),this._parts.focusFirst("start"),this.requestUpdate())}};V([n.property({type:String})],R.prototype,"uid",2),V([n.property({type:String})],R.prototype,"label",2),V([n.property({type:String,attribute:"locale-id"})],R.prototype,"localeId",2),V([n.property({type:Array})],R.prototype,"errors",2),V([n.property({type:Boolean})],R.prototype,"showErrors",2),V([n.property({type:Boolean})],R.prototype,"touched",2),V([n.property({type:Boolean})],R.prototype,"required",2),V([n.property({type:Boolean})],R.prototype,"disabled",2),V([n.property({type:Boolean,attribute:"readonly"})],R.prototype,"readOnly",2),V([n.property({type:String})],R.prototype,"icon",2),V([n.property({type:String})],R.prototype,"hint",2),V([n.property({type:String})],R.prototype,"dayAriaLabel",2),V([n.property({type:String})],R.prototype,"monthAriaLabel",2),V([n.property({type:String})],R.prototype,"yearAriaLabel",2),V([n.property({type:String})],R.prototype,"hourAriaLabel",2),V([n.property({type:String})],R.prototype,"minuteAriaLabel",2),V([n.property({type:String})],R.prototype,"dayPeriodAriaLabel",2),V([n.property({type:String,attribute:"hour-format"})],R.prototype,"hourFormat",2),V([n.property({type:Number,attribute:"minute-step"})],R.prototype,"minuteStep",2),V([n.property({type:String,attribute:"invalid-date-message"})],R.prototype,"invalidDateMessage",2),V([n.property({type:Array})],R.prototype,"value",2),V([n.property({type:String})],R.prototype,"removePillAriaLabel",2),V([n.property({type:String})],R.prototype,"startDateTimeAriaLabel",2),V([n.property({type:String})],R.prototype,"endDateTimeAriaLabel",2),V([n.property({type:String})],R.prototype,"separator",2),V([n.property({type:String,attribute:"min-date-time"})],R.prototype,"minDateTime",2),V([n.property({type:String,attribute:"max-date-time"})],R.prototype,"maxDateTime",2),V([n.property({type:String,attribute:"min-date-time-message"})],R.prototype,"minDateTimeMessage",2),V([n.property({type:String,attribute:"max-date-time-message"})],R.prototype,"maxDateTimeMessage",2),V([n.property({type:Array,attribute:"disabled-ranges"})],R.prototype,"disabledRanges",2),V([n.property({type:String,attribute:"disabled-range-message"})],R.prototype,"disabledRangeMessage",2),R=V([n.customElement("gui-range-date-time")],R),typeof customElements<"u"&&!customElements.get("gui-range-date-time")&&customElements.define("gui-range-date-time",R);var Hh=Object.defineProperty,Wh=Object.getOwnPropertyDescriptor,Sr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Wh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Hh(t,i,r),r};let Xt=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-range-date-time","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
796
901
  <gui-range-date-time
797
902
  .uid=${this.widget.uid}
798
903
  .label=${this.adapter.templateData.label}
@@ -805,6 +910,12 @@
805
910
  ?readonly=${this.adapter.templateData.readonly}
806
911
  .value=${this.adapter.templateData.value}
807
912
  .localeId=${this.adapter.templateData.lang}
913
+ .dayAriaLabel=${this.adapter.templateData.dayAriaLabel}
914
+ .monthAriaLabel=${this.adapter.templateData.monthAriaLabel}
915
+ .yearAriaLabel=${this.adapter.templateData.yearAriaLabel}
916
+ .hourAriaLabel=${this.adapter.templateData.hourAriaLabel}
917
+ .minuteAriaLabel=${this.adapter.templateData.minuteAriaLabel}
918
+ .dayPeriodAriaLabel=${this.adapter.templateData.dayPeriodAriaLabel}
808
919
  .separator=${this.adapter.templateData.separator}
809
920
  .removePillAriaLabel=${this.adapter.templateData.removePillAriaLabel}
810
921
  .startDateTimeAriaLabel=${this.adapter.templateData.startDateTimeAriaLabel}
@@ -819,10 +930,10 @@
819
930
  @change=${this.valueChanged}
820
931
  @inputError=${this.onInputError}
821
932
  ></gui-range-date-time>
822
- `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};La([b.consume({context:m.formContext}),n.property({attribute:!1})],Wt.prototype,"formContext",2),La([b.provide({context:m.inputContext})],Wt.prototype,"adapter",2),Wt=La([n.customElement("gui-range-date-time-input")],Wt);const qd=Object.freeze(Object.defineProperty({__proto__:null,get RangeDateTimeInputElement(){return Wt}},Symbol.toStringTag,{value:"Module"}));var Nd=Object.defineProperty,zd=Object.getOwnPropertyDescriptor,D=(e,t,i,a)=>{for(var r=a>1?void 0:a?zd(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Nd(t,i,r),r};let v=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.localeId=void 0,this.errors=[],this.touched=void 0,this.required=!1,this.disabled=!1,this.readOnly=!1,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel="",this.nextMonthAriaLabel="",this.dayFormat="numeric",this.weekdayFormat="narrow",this.monthFormat="long",this.minDate=void 0,this.maxDate=void 0,this.disabledRanges=void 0,this.numberOfMonths=1,this.value=[],this.focusDate=void 0,this.hidePills=!1,this.removePillAriaLabel=void 0,this.disabledDateRangeMessage=void 0,this.invalidRange=null,this.hourFormat=void 0,this.minuteStep=void 0,this.allowCustomTime=!1,this.startTimeLabel=void 0,this.endTimeLabel=void 0,this.minDateTime=void 0,this.maxDateTime=void 0,this.minDateTimeMessage=void 0,this.maxDateTimeMessage=void 0,this.disabledRangeMessage=void 0,this.noAvailableTimesMessage=void 0,this.dayCountAriaLabel=void 0,this.disabledDayCountAriaLabel=void 0,this._selection=ji(),this._invalidRange=null,this._workingDateStart=void 0,this._workingDateEnd=void 0,this._workingTimeIn=void 0,this._workingTimeOut=void 0,this._openList=null,this._skipValueNavigation=!1,this._nav=new zi(this,{getMinDate:()=>this.minDate,getMaxDate:()=>this.maxDate,getNumberOfMonths:()=>this.numberOfMonths,getDisabledRanges:()=>this.disabledRanges,onYearSelectorToggled:()=>this._keyboard.onYearGridToggled()}),this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(".gui-calendar-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})}),this._keyboard=new Bi(this,{canGoPrev:()=>this._nav.canGoPrev(),canGoNext:()=>this._nav.canGoNext(),goPrev:()=>this._nav.prevMonth(),goNext:()=>this._nav.nextMonth(),onActivateDay:(e,t)=>this.selectDate(this.activationDay(e),t),onSelectYear:e=>this._nav.selectYear(e),onCloseYearGrid:()=>this._nav.closeYearSelector(),isYearGridOpen:()=>this._nav.yearSelectorOpen}),this._focusLeave=new Ft(this,{onLeave:()=>this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}),this.onPillRemoveEvent=e=>{if(this.disabled||this.readOnly)return;const t=Vt(this.value,e.detail.key);t&&(this.value=t.next,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})))},this.onPillClickEvent=e=>{const t=Pt(this.getSortedPills(),e.detail.key);t&&this.navigateToDate(t.start)}}get _currentDate(){return this._nav.currentDate}set _currentDate(e){this._nav.currentDate=e}get _yearSelectorOpen(){return this._nav.yearSelectorOpen}set _yearSelectorOpen(e){this._nav.yearSelectorOpen=e}parseEndpoint(e){return Y(e)}endpointDay(e){return j(e.split("T")[0])}formatPillLabel(e){const t=Wi(this.localeId,this.hourFormat),i=Ca(e.start,this.localeId,t),a=e.end?Ca(e.end,this.localeId,t):i;return`${i} - ${a}`}get workingRange(){if(!(!this._workingDateStart||!this._workingDateEnd))return{start:j(this._workingDateStart),end:j(this._workingDateEnd)}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){if((!this.hasUpdated||e.has("minDateTime")||e.has("maxDateTime"))&&(this.minDate=this.minDateTime?this.minDateTime.split("T")[0]:void 0,this.maxDate=this.maxDateTime?this.maxDateTime.split("T")[0]:void 0),e.has("invalidRange"))if(this.invalidRange){const t=this.endpointDay(this.invalidRange.start),i=this.endpointDay(this.invalidRange.end);this._invalidRange=isNaN(t.getTime())||isNaN(i.getTime())?null:{start:t,end:i}}else this._invalidRange=null;if(e.has("value")&&!e.has("focusDate")){if(this._skipValueNavigation)this._skipValueNavigation=!1;else if(this.value){const t=Array.isArray(this.value)?this.value:[{start:this.value}];t.length>0&&t[0].start&&this._nav.navigateToDate(this.endpointDay(t[0].start))}}if(e.has("focusDate")&&this.focusDate){const t=j(this.focusDate);isNaN(t.getTime())||(this._nav.navigateToDate(t),this.focusDate=void 0)}}render(){return Vi({uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,numberOfMonths:this.numberOfMonths,prevMonthIcon:this.prevMonthIcon,nextMonthIcon:this.nextMonthIcon,prevMonthAriaLabel:this.prevMonthAriaLabel,nextMonthAriaLabel:this.nextMonthAriaLabel,canGoPrev:this._nav.canGoPrev(),canGoNext:this._nav.canGoNext(),onPrevMonthClick:this._keyboard.onPrevMonthClick,onNextMonthClick:this._keyboard.onNextMonthClick,onFocusOut:this._focusLeave.onFocusOut,renderAboveCalendar:()=>this.renderAboveCalendar(),renderMonthPanel:e=>Gi({currentDate:this._nav.currentDate,offset:e,localeId:this.localeId,monthFormat:this.monthFormat,yearSelectorOpen:this._nav.yearSelectorOpen,onToggleYearSelector:()=>this.toggleYearSelector(),renderBelowHeader:t=>this.renderBelowHeader(t),renderPanelBody:t=>this.renderPanelBody(t)})})}renderBelowHeader(e){if(e!==0)return l.nothing;const t=!this.disabled&&!!this._workingDateStart,i=!this.disabled&&!!this._workingTimeIn,a=this.startListBounds,r=this.endListBounds,s={"gui-range-date-time-calendar__time-row":!0,"is-list-open":this._openList!==null};return l.html`
823
- <div class=${w.classMap(s)}>
933
+ `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Sr([f.consume({context:m.formContext}),n.property({attribute:!1})],Xt.prototype,"formContext",2),Sr([f.provide({context:m.inputContext})],Xt.prototype,"adapter",2),Xt=Sr([n.customElement("gui-range-date-time-input")],Xt);const Kh=Object.freeze(Object.defineProperty({__proto__:null,get RangeDateTimeInputElement(){return Xt}},Symbol.toStringTag,{value:"Module"}));var Jh=Object.defineProperty,Xh=Object.getOwnPropertyDescriptor,$=(e,t,i,a)=>{for(var r=a>1?void 0:a?Xh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Jh(t,i,r),r};let D=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.localeId=void 0,this.errors=[],this.touched=void 0,this.required=!1,this.disabled=!1,this.readOnly=!1,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel="",this.nextMonthAriaLabel="",this.selectYearAriaLabel=void 0,this.yearGridAriaLabel=void 0,this.dayFormat="numeric",this.weekdayFormat="narrow",this.monthFormat="long",this.minDate=void 0,this.maxDate=void 0,this.disabledRanges=void 0,this.numberOfMonths=1,this.value=[],this.focusDate=void 0,this.hidePills=!1,this.removePillAriaLabel=void 0,this.disabledDateRangeMessage=void 0,this.invalidRange=null,this.hourFormat=void 0,this.minuteStep=void 0,this.allowCustomTime=!1,this.startTimeLabel=void 0,this.endTimeLabel=void 0,this.minDateTime=void 0,this.maxDateTime=void 0,this.minDateTimeMessage=void 0,this.maxDateTimeMessage=void 0,this.disabledRangeMessage=void 0,this.noAvailableTimesMessage=void 0,this.dayCountAriaLabel=void 0,this.disabledDayCountAriaLabel=void 0,this._selection=ra(),this._invalidRange=null,this._workingDateStart=void 0,this._workingDateEnd=void 0,this._workingTimeIn=void 0,this._workingTimeOut=void 0,this._openList=null,this._skipValueNavigation=!1,this._nav=new Ui(this,{getMinDate:()=>this.minDate,getMaxDate:()=>this.maxDate,getNumberOfMonths:()=>this.numberOfMonths,getDisabledRanges:()=>this.disabledRanges,onYearSelectorToggled:()=>this._keyboard.onYearGridToggled()}),this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(".gui-calendar-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})}),this._keyboard=new Ni(this,{canGoPrev:()=>this._nav.canGoPrev(),canGoNext:()=>this._nav.canGoNext(),goPrev:()=>this._nav.prevMonth(),goNext:()=>this._nav.nextMonth(),onActivateDay:(e,t)=>this.selectDate(this.activationDay(e),t),onSelectYear:e=>this._nav.selectYear(e),onCloseYearGrid:()=>this._nav.closeYearSelector(),isYearGridOpen:()=>this._nav.yearSelectorOpen}),this._focusLeave=new zt(this,{onLeave:()=>this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}),this.onPillRemoveEvent=e=>{if(this.disabled||this.readOnly)return;const t=Yt(this.value,e.detail.key);t&&(this.value=t.next,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})))},this.onPillClickEvent=e=>{const t=It(this.getSortedPills(),e.detail.key);t&&this.navigateToDate(t.start)}}get _currentDate(){return this._nav.currentDate}set _currentDate(e){this._nav.currentDate=e}get _yearSelectorOpen(){return this._nav.yearSelectorOpen}set _yearSelectorOpen(e){this._nav.yearSelectorOpen=e}parseEndpoint(e){return ee(e)}endpointDay(e){return re(e.split("T")[0])}formatPillLabel(e){const t=Xi(this.localeId,this.hourFormat),i=br(e.start,this.localeId,t),a=e.end?br(e.end,this.localeId,t):i;return`${i} - ${a}`}get workingRange(){if(!(!this._workingDateStart||!this._workingDateEnd))return{start:re(this._workingDateStart),end:re(this._workingDateEnd)}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){if((!this.hasUpdated||e.has("minDateTime")||e.has("maxDateTime"))&&(this.minDate=this.minDateTime?this.minDateTime.split("T")[0]:void 0,this.maxDate=this.maxDateTime?this.maxDateTime.split("T")[0]:void 0),e.has("invalidRange"))if(this.invalidRange){const t=this.endpointDay(this.invalidRange.start),i=this.endpointDay(this.invalidRange.end);this._invalidRange=isNaN(t.getTime())||isNaN(i.getTime())?null:{start:t,end:i}}else this._invalidRange=null;if(e.has("value")&&!e.has("focusDate")){if(this._skipValueNavigation)this._skipValueNavigation=!1;else if(this.value){const t=Array.isArray(this.value)?this.value:[{start:this.value}];t.length>0&&t[0].start&&this._nav.navigateToDate(this.endpointDay(t[0].start))}}if(e.has("focusDate")&&this.focusDate){const t=re(this.focusDate);isNaN(t.getTime())||(this._nav.navigateToDate(t),this.focusDate=void 0)}}render(){return Yi({uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,numberOfMonths:this.numberOfMonths,localeId:this.localeId,currentDate:this._nav.currentDate,prevMonthIcon:this.prevMonthIcon,nextMonthIcon:this.nextMonthIcon,prevMonthAriaLabel:this.prevMonthAriaLabel,nextMonthAriaLabel:this.nextMonthAriaLabel,canGoPrev:this._nav.canGoPrev(),canGoNext:this._nav.canGoNext(),onPrevMonthClick:this._keyboard.onPrevMonthClick,onNextMonthClick:this._keyboard.onNextMonthClick,onFocusOut:this._focusLeave.onFocusOut,renderAboveCalendar:()=>this.renderAboveCalendar(),renderMonthPanel:e=>Hi({currentDate:this._nav.currentDate,offset:e,localeId:this.localeId,monthFormat:this.monthFormat,yearSelectorOpen:this._nav.yearSelectorOpen,selectYearAriaLabel:this.selectYearAriaLabel,onToggleYearSelector:()=>this.toggleYearSelector(),renderBelowHeader:t=>this.renderBelowHeader(t),renderPanelBody:t=>this.renderPanelBody(t)})})}renderBelowHeader(e){if(e!==0)return l.nothing;const t=!this.disabled&&!!this._workingDateStart,i=!this.disabled&&!!this._workingTimeIn,a=this.startListBounds,r=this.endListBounds,s={"gui-range-date-time-calendar__time-row":!0,"is-list-open":this._openList!==null};return l.html`
934
+ <div class=${T.classMap(s)}>
824
935
  <div
825
- class=${w.classMap({"gui-range-date-time-calendar__time-column":!0,"is-open":this._openList==="start"})}
936
+ class=${T.classMap({"gui-range-date-time-calendar__time-column":!0,"is-open":this._openList==="start"})}
826
937
  >
827
938
  <gui-time-picker
828
939
  class="gui-time-picker gui-field gui-range-date-time-calendar__start"
@@ -849,7 +960,7 @@
849
960
  </div>
850
961
 
851
962
  <div
852
- class=${w.classMap({"gui-range-date-time-calendar__time-column":!0,"is-open":this._openList==="end"})}
963
+ class=${T.classMap({"gui-range-date-time-calendar__time-column":!0,"is-open":this._openList==="end"})}
853
964
  >
854
965
  <gui-time-picker
855
966
  class="gui-time-picker gui-field gui-range-date-time-calendar__end"
@@ -875,14 +986,17 @@
875
986
  ></gui-time-picker>
876
987
  </div>
877
988
  </div>
878
- `}renderPanelBody(e){return this._openList&&!this._yearSelectorOpen&&e===0?l.html``:Ui({offset:e,yearSelectorOpen:this._nav.yearSelectorOpen,years:this._nav.yearList,currentYear:this._nav.currentDate.getFullYear(),onSelectYear:t=>this._keyboard.selectYear(t),onYearKeydown:this._keyboard.handleYearKeydown,localeId:this.localeId,getDays:t=>this.getDaysInMonth(t),renderDay:t=>this.renderDay(t)})}toggleYearSelector(){this.startPicker?.closeList(),this.endPicker?.closeList(),this._nav.toggleYearSelector()}isDisabled(e){const t=Q(e);return Ni(t,this.minDate,this.maxDate)?!0:Yp(t,this.disabledRanges)}activationDay(e){return{date:j(e),isCurrentMonth:!0,isDisabled:!1,isFocusable:!0,dayLabel:"",isToday:!1,isRangeStart:!1,isRangeEnd:!1,isInRange:!1,isOneDayRange:!1,isAnchor:!1,isSelecting:!1,isInvalidStart:!1,isInvalidEnd:!1,isInvalidInRange:!1}}renderDay(e){const t=e.isInvalidStart&&e.isInvalidEnd,i={"gui-calendar__day-button":!0,today:e.isToday,"other-month":!e.isCurrentMonth,"range-start":e.isRangeStart&&!e.isOneDayRange,"range-end":e.isRangeEnd&&!e.isOneDayRange,selected:e.isOneDayRange,"in-range":e.isInRange,"invalid-range-start":e.isInvalidStart&&!t,"invalid-range-end":e.isInvalidEnd&&!t,"invalid-range-single":t,"invalid-in-range":e.isInvalidInRange,"is-anchor":e.isAnchor,"is-selecting":e.isSelecting,disabled:e.isDisabled};return l.html`
989
+ `}renderPanelBody(e){return this._openList&&!this._yearSelectorOpen&&e===0?l.html``:Wi({offset:e,yearSelectorOpen:this._nav.yearSelectorOpen,years:this._nav.yearList,currentYear:this._nav.currentDate.getFullYear(),onSelectYear:t=>this._keyboard.selectYear(t),onYearKeydown:this._keyboard.handleYearKeydown,localeId:this.localeId,currentDate:this._nav.currentDate,yearGridAriaLabel:this.yearGridAriaLabel,getDays:t=>this.getDaysInMonth(t),renderDay:t=>this.renderDay(t)})}toggleYearSelector(){this.startPicker?.closeList(),this.endPicker?.closeList(),this._nav.toggleYearSelector()}isDisabled(e){const t=ae(e);return Gi(t,this.minDate,this.maxDate)?!0:rh(t,this.disabledRanges)}activationDay(e){const t=re(e);return{date:t,isCurrentMonth:!0,isDisabled:this.isDisabled(t),isFocusable:!0,dayLabel:"",isToday:!1,isRangeStart:!1,isRangeEnd:!1,isInRange:!1,isOneDayRange:!1,isAnchor:!1,isSelecting:!1,isInvalidStart:!1,isInvalidEnd:!1,isInvalidInRange:!1}}renderDay(e){const t=e.isInvalidStart&&e.isInvalidEnd,i={"gui-calendar__day-button":!0,today:e.isToday,"other-month":!e.isCurrentMonth,"range-start":e.isRangeStart&&!e.isOneDayRange,"range-end":e.isRangeEnd&&!e.isOneDayRange,selected:e.isOneDayRange,"in-range":e.isInRange,"invalid-range-start":e.isInvalidStart&&!t,"invalid-range-end":e.isInvalidEnd&&!t,"invalid-range-single":t,"invalid-in-range":e.isInvalidInRange,"is-anchor":e.isAnchor,"is-selecting":e.isSelecting,disabled:e.isDisabled};return l.html`
879
990
  <button
880
991
  type="button"
881
992
  role="gridcell"
882
- class=${w.classMap(i)}
993
+ class=${T.classMap(i)}
883
994
  tabindex=${e.isFocusable?0:-1}
884
- ?disabled=${!e.isCurrentMonth||e.isDisabled}
885
- data-date=${Q(e.date)}
995
+ ?disabled=${!e.isCurrentMonth}
996
+ aria-disabled=${e.isCurrentMonth&&e.isDisabled?"true":l.nothing}
997
+ aria-label=${Vi(this.localeId,e.date)}
998
+ aria-current=${e.isToday?"date":l.nothing}
999
+ data-date=${ae(e.date)}
886
1000
  @click=${a=>this.selectDate(e,a)}
887
1001
  @mouseover=${()=>this.onMouseOver(e)}
888
1002
  @focus=${()=>this.onMouseOver(e)}
@@ -891,15 +1005,17 @@
891
1005
  >
892
1006
  ${this.renderDayContent(e)}
893
1007
  </button>
894
- `}getDaysInMonth(e){const t=(this.value??[]).map(a=>({start:this.endpointDay(a.start),end:a.end?this.endpointDay(a.end):void 0})),i=Ys(this._selection);return Hi({currentDate:this._currentDate,offset:e,localeId:this.localeId,numberOfMonths:this.numberOfMonths??1,isDisabled:a=>this.isDisabled(a),toDay:a=>{const r=Zi(a.date,{ranges:t,workingRange:this.workingRange,anchor:this._selection.anchor,selectingSpan:i,invalidRange:this._invalidRange});return{date:a.date,dayLabel:a.dayLabel,isCurrentMonth:a.isCurrentMonth,isToday:a.isToday,isRangeStart:r.isRangeStart,isRangeEnd:r.isRangeEnd,isInRange:r.isInRange,isInvalidStart:r.isInvalidStart&&a.isCurrentMonth,isInvalidEnd:r.isInvalidEnd&&a.isCurrentMonth,isInvalidInRange:r.isInvalidInRange&&a.isCurrentMonth,isDisabled:a.isDisabled,isOneDayRange:r.isOneDayRange,isAnchor:r.isAnchor,isFocusable:a.isToday||r.isRangeStart,isSelecting:r.isSelecting&&a.isCurrentMonth}},focusFallbackDates:[new Date,...(this.value??[]).map(a=>this.endpointDay(a.start))]})}selectDate(e,t=null){if(!e.isCurrentMonth||this.disabled||this.readOnly)return;const{state:i,commit:a}=ea(this._selection,{type:"pick",date:e.date});if(this._selection=i,!a){this.resetWorking(),this._invalidRange=null;return}if(this.spanCoversBlockedDay(a.start,a.end)){this._invalidRange={start:a.start,end:a.end},this.emitInputError(this.disabledRangeMessage??wt),this.requestUpdate();return}this._invalidRange=null,this._workingDateStart=Q(a.start),this._workingDateEnd=Q(a.end),this._workingTimeIn=void 0,this._workingTimeOut=void 0}spanCoversBlockedDay(e,t){const i=new Date(e);i.setHours(0,0,0,0);const a=new Date(t);for(a.setHours(0,0,0,0);i<=a;){if(this.isDisabled(i))return!0;i.setDate(i.getDate()+1)}return!1}onMouseOver(e){this._selection=ea(this._selection,{type:"hover",date:e.date}).state}onStartTimeChange(e){if(e.stopPropagation(),e.detail.commit!==!0)return;const t=e.detail.value;if(!t||!this._workingDateStart){this._workingTimeIn=void 0,this._workingTimeOut=void 0;return}const i=this.timeError(t,this._workingDateStart,this.resolvedStartTimeRanges);if(i){this._workingTimeIn=void 0,this._workingTimeOut=void 0,this.emitInputError(i);return}this._workingTimeIn=t,this._workingTimeOut=void 0}onEndTimeChange(e){if(e.stopPropagation(),e.detail.commit!==!0)return;const t=e.detail.value;if(!t){this._workingTimeOut=void 0;return}if(!this._workingTimeIn||!this._workingDateStart||!this._workingDateEnd)return;const i=this.timeError(t,this._workingDateEnd,this.resolvedEndTimeRanges);if(i){this._workingTimeOut=t,this.emitInputError(i);return}const a=Os(`${this._workingDateStart}T${this._workingTimeIn}`,`${this._workingDateEnd}T${t}`);if(Ls(a,this.disabledRanges)){this._workingTimeOut=t,this.emitInputError(this.disabledRangeMessage??wt);return}this._skipValueNavigation=!0,this.value=As([...this.value??[],a]),this.resetWorking(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))}timeError(e,t,i){const a=Fs(`${t}T${e}`,this.minDateTime,this.maxDateTime,{minDateTimeMessage:this.minDateTimeMessage,maxDateTimeMessage:this.maxDateTimeMessage});return a||(Ki(e,i)?this.disabledRangeMessage??wt:null)}resetWorking(){this._workingDateStart=void 0,this._workingDateEnd=void 0,this._workingTimeIn=void 0,this._workingTimeOut=void 0,this._openList=null,this.resetPicker(this.startPicker),this.resetPicker(this.endPicker)}resetPicker(e){e&&(e.value=void 0,e.closeList())}emitInputError(e){this.dispatchEvent(new CustomEvent("inputError",{detail:{message:e},bubbles:!0,composed:!0}))}get startPicker(){return this.querySelector("gui-time-picker.gui-range-date-time-calendar__start")}get endPicker(){return this.querySelector("gui-time-picker.gui-range-date-time-calendar__end")}pickerFor(e){return e==="start"?this.startPicker:this.endPicker}onListToggle(e,t){e.stopPropagation();const{open:i}=e.detail;if(i&&this.readOnly){this.pickerFor(t)?.closeList();return}i?(this.pickerFor(t==="start"?"end":"start")?.closeList(),this._openList=t,this._yearSelectorOpen=!1):this._openList===t&&(this._openList=null)}get resolvedStartTimeRanges(){return this._workingDateStart?Sa(this.disabledRanges,this._workingDateStart):[]}get resolvedEndTimeRanges(){return this._workingDateEnd?Sa(this.disabledRanges,this._workingDateEnd):[]}dayClampedBounds(e){const t={};return this.minDateTime&&e===this.minDateTime.split("T")[0]&&(t.minTime=this.minDateTime.split("T")[1]),this.maxDateTime&&e===this.maxDateTime.split("T")[0]&&(t.maxTime=this.maxDateTime.split("T")[1]),t}get startListBounds(){return this._workingDateStart?this.dayClampedBounds(this._workingDateStart):{}}get endListBounds(){if(!this._workingDateEnd)return{};const e=this.dayClampedBounds(this._workingDateEnd);if(this._workingDateEnd!==this._workingDateStart||!this._workingTimeIn)return e;const t=Es(this._workingTimeIn,this.minuteStep);return t?{minTime:t,maxTime:e.maxTime}:{minTime:"23:59:59",maxTime:"00:00:00"}}renderDayContent(e){const t=this.renderRangeCountBadge(e),i=this.renderDisabledSlotsBadge(e);return t===l.nothing&&i===l.nothing?l.html`${e.dayLabel}`:l.html`${e.dayLabel}<span class="gui-range-date-time-calendar__badges"
1008
+ `}getDaysInMonth(e){const t=(this.value??[]).map(a=>({start:this.endpointDay(a.start),end:a.end?this.endpointDay(a.end):void 0})),i=Gn(this._selection);return Ji({currentDate:this._currentDate,offset:e,localeId:this.localeId,numberOfMonths:this.numberOfMonths??1,isDisabled:a=>this.isDisabled(a),toDay:a=>{const r=Ki(a.date,{ranges:t,workingRange:this.workingRange,anchor:this._selection.anchor,selectingSpan:i,invalidRange:this._invalidRange});return{date:a.date,dayLabel:a.dayLabel,isCurrentMonth:a.isCurrentMonth,isToday:a.isToday,isRangeStart:r.isRangeStart,isRangeEnd:r.isRangeEnd,isInRange:r.isInRange,isInvalidStart:r.isInvalidStart&&a.isCurrentMonth,isInvalidEnd:r.isInvalidEnd&&a.isCurrentMonth,isInvalidInRange:r.isInvalidInRange&&a.isCurrentMonth,isDisabled:a.isDisabled,isOneDayRange:r.isOneDayRange,isAnchor:r.isAnchor,isFocusable:a.isToday||r.isRangeStart,isSelecting:r.isSelecting&&a.isCurrentMonth}},focusFallbackDates:[new Date,...(this.value??[]).map(a=>this.endpointDay(a.start))]})}selectDate(e,t=null){if(!e.isCurrentMonth||e.isDisabled||this.disabled||this.readOnly)return;const{state:i,commit:a}=sa(this._selection,{type:"pick",date:e.date});if(this._selection=i,!a){this.resetWorking(),this._invalidRange=null;return}if(this.spanCoversBlockedDay(a.start,a.end)){this._invalidRange={start:a.start,end:a.end},this.emitInputError(this.disabledRangeMessage??kt),this.requestUpdate();return}this._invalidRange=null,this._workingDateStart=ae(a.start),this._workingDateEnd=ae(a.end),this._workingTimeIn=void 0,this._workingTimeOut=void 0}spanCoversBlockedDay(e,t){const i=new Date(e);i.setHours(0,0,0,0);const a=new Date(t);for(a.setHours(0,0,0,0);i<=a;){if(this.isDisabled(i))return!0;i.setDate(i.getDate()+1)}return!1}onMouseOver(e){e.isDisabled||(this._selection=sa(this._selection,{type:"hover",date:e.date}).state)}onStartTimeChange(e){if(e.stopPropagation(),e.detail.commit!==!0)return;const t=e.detail.value;if(!t||!this._workingDateStart){this._workingTimeIn=void 0,this._workingTimeOut=void 0;return}const i=this.timeError(t,this._workingDateStart,this.resolvedStartTimeRanges);if(i){this._workingTimeIn=void 0,this._workingTimeOut=void 0,this.emitInputError(i);return}this._workingTimeIn=t,this._workingTimeOut=void 0}onEndTimeChange(e){if(e.stopPropagation(),e.detail.commit!==!0)return;const t=e.detail.value;if(!t){this._workingTimeOut=void 0;return}if(!this._workingTimeIn||!this._workingDateStart||!this._workingDateEnd)return;const i=this.timeError(t,this._workingDateEnd,this.resolvedEndTimeRanges);if(i){this._workingTimeOut=t,this.emitInputError(i);return}const a=An(`${this._workingDateStart}T${this._workingTimeIn}`,`${this._workingDateEnd}T${t}`);if(Ln(a,this.disabledRanges)){this._workingTimeOut=t,this.emitInputError(this.disabledRangeMessage??kt);return}this._skipValueNavigation=!0,this.value=Cn([...this.value??[],a]),this.resetWorking(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))}timeError(e,t,i){const a=En(`${t}T${e}`,this.minDateTime,this.maxDateTime,{minDateTimeMessage:this.minDateTimeMessage,maxDateTimeMessage:this.maxDateTimeMessage});return a||(ji(e,i)?this.disabledRangeMessage??kt:null)}resetWorking(){this._workingDateStart=void 0,this._workingDateEnd=void 0,this._workingTimeIn=void 0,this._workingTimeOut=void 0,this._openList=null,this.resetPicker(this.startPicker),this.resetPicker(this.endPicker)}resetPicker(e){e&&(e.value=void 0,e.closeList())}emitInputError(e){this.dispatchEvent(new CustomEvent("inputError",{detail:{message:e},bubbles:!0,composed:!0}))}get startPicker(){return this.querySelector("gui-time-picker.gui-range-date-time-calendar__start")}get endPicker(){return this.querySelector("gui-time-picker.gui-range-date-time-calendar__end")}pickerFor(e){return e==="start"?this.startPicker:this.endPicker}onListToggle(e,t){e.stopPropagation();const{open:i}=e.detail;if(i&&this.readOnly){this.pickerFor(t)?.closeList();return}i?(this.pickerFor(t==="start"?"end":"start")?.closeList(),this._openList=t,this._yearSelectorOpen=!1):this._openList===t&&(this._openList=null)}get resolvedStartTimeRanges(){return this._workingDateStart?gr(this.disabledRanges,this._workingDateStart):[]}get resolvedEndTimeRanges(){return this._workingDateEnd?gr(this.disabledRanges,this._workingDateEnd):[]}dayClampedBounds(e){const t={};return this.minDateTime&&e===this.minDateTime.split("T")[0]&&(t.minTime=this.minDateTime.split("T")[1]),this.maxDateTime&&e===this.maxDateTime.split("T")[0]&&(t.maxTime=this.maxDateTime.split("T")[1]),t}get startListBounds(){return this._workingDateStart?this.dayClampedBounds(this._workingDateStart):{}}get endListBounds(){if(!this._workingDateEnd)return{};const e=this.dayClampedBounds(this._workingDateEnd);if(this._workingDateEnd!==this._workingDateStart||!this._workingTimeIn)return e;const t=kn(this._workingTimeIn,this.minuteStep);return t?{minTime:t,maxTime:e.maxTime}:{minTime:"23:59:59",maxTime:"00:00:00"}}renderDayContent(e){const t=this.renderRangeCountBadge(e),i=this.renderDisabledSlotsBadge(e);return t===l.nothing&&i===l.nothing?l.html`${e.dayLabel}`:l.html`${e.dayLabel}<span class="gui-range-date-time-calendar__badges"
895
1009
  >${t}${i}</span
896
1010
  >`}renderBadge(e,t,i,a){return l.html`<span class="gui-range-date-time-calendar__${e}" aria-label=${i}
897
1011
  >${t}</span
898
1012
  ><span class="gui-range-date-time-calendar__badge-tooltip" aria-hidden="true"
899
1013
  >${a.map(r=>l.html`<span>${r}</span>`)}</span
900
- >`}renderRangeCountBadge(e){if(!e.isCurrentMonth)return l.nothing;const t=this.rangesOnDay(e.date);if(t.length<=1)return l.nothing;const i=t.map(r=>this.formatPillLabel(r)),a=`${(this.dayCountAriaLabel??"{count} ranges").replace("{count}",String(t.length))}: ${i.join(", ")}`;return this.renderBadge("day-count",t.length,a,i)}renderDisabledSlotsBadge(e){if(!e.isCurrentMonth||e.isDisabled)return l.nothing;const t=Sa(this.disabledRanges,Q(e.date));if(!t.length)return l.nothing;const i=Wi(this.localeId,this.hourFormat),a=t.map(s=>`${Xi(s.start,this.localeId,i)} – ${Xi(s.end,this.localeId,i)}`),r=`${(this.disabledDayCountAriaLabel??"{count} disabled ranges").replace("{count}",String(t.length))}: ${a.join(", ")}`;return this.renderBadge("disabled-count",t.length,r,a)}rangesOnDay(e){if(!this.value?.length)return[];const t=Q(e);return this.value.filter(i=>{const a=i.start.split("T")[0],r=(i.end??i.start).split("T")[0];return t>=a&&t<=r})}renderAboveCalendar(){if(this.hidePills)return l.nothing;const e=this.getSortedPills();if(e.length===0)return l.nothing;const t=Gt(e,i=>this.formatPillLabel(i),this.removePillAriaLabel??"Remove date");return l.html`
1014
+ >`}renderRangeCountBadge(e){if(!e.isCurrentMonth)return l.nothing;const t=this.rangesOnDay(e.date);if(t.length<=1)return l.nothing;const i=t.map(r=>this.formatPillLabel(r)),a=`${(this.dayCountAriaLabel??"{count} ranges").replace("{count}",String(t.length))}: ${i.join(", ")}`;return this.renderBadge("day-count",t.length,a,i)}renderDisabledSlotsBadge(e){if(!e.isCurrentMonth||e.isDisabled)return l.nothing;const t=gr(this.disabledRanges,ae(e.date));if(!t.length)return l.nothing;const i=Xi(this.localeId,this.hourFormat),a=t.map(s=>`${ea(s.start,this.localeId,i)} – ${ea(s.end,this.localeId,i)}`),r=`${(this.disabledDayCountAriaLabel??"{count} disabled ranges").replace("{count}",String(t.length))}: ${a.join(", ")}`;return this.renderBadge("disabled-count",t.length,r,a)}rangesOnDay(e){if(!this.value?.length)return[];const t=ae(e);return this.value.filter(i=>{const a=i.start.split("T")[0],r=(i.end??i.start).split("T")[0];return t>=a&&t<=r})}renderAboveCalendar(){if(this.hidePills)return l.nothing;const e=this.getSortedPills();if(e.length===0)return l.nothing;const t=Ht(e,i=>this.formatPillLabel(i));return l.html`
901
1015
  <gui-pills
902
1016
  class="gui-range-calendar__pills"
1017
+ .uid=${this.uid}
1018
+ .toolbarAriaLabel=${"Selected date-time ranges"}
903
1019
  .items=${t}
904
1020
  .removable=${!0}
905
1021
  .clickable=${!0}
@@ -910,7 +1026,7 @@
910
1026
  @pillremove=${this.onPillRemoveEvent}
911
1027
  @pillclick=${this.onPillClickEvent}
912
1028
  ></gui-pills>
913
- `}getSortedPills(){return zt(this.value,(e,t)=>this.parseEndpoint(e).getTime()-this.parseEndpoint(t).getTime())}navigateToDate(e){this._nav.navigateToDate(this.endpointDay(e))}};D([n.property({type:String})],v.prototype,"uid",2),D([n.property({type:String})],v.prototype,"label",2),D([n.property({type:String})],v.prototype,"hint",2),D([n.property({type:String,attribute:"locale-id"})],v.prototype,"localeId",2),D([n.property({type:Array})],v.prototype,"errors",2),D([n.property({type:Boolean})],v.prototype,"touched",2),D([n.property({type:Boolean})],v.prototype,"required",2),D([n.property({type:Boolean})],v.prototype,"disabled",2),D([n.property({type:Boolean,attribute:"readonly"})],v.prototype,"readOnly",2),D([n.property({type:String,attribute:"prev-month-icon"})],v.prototype,"prevMonthIcon",2),D([n.property({type:String,attribute:"next-month-icon"})],v.prototype,"nextMonthIcon",2),D([n.property({type:String,attribute:"prev-month-aria-label"})],v.prototype,"prevMonthAriaLabel",2),D([n.property({type:String,attribute:"next-month-aria-label"})],v.prototype,"nextMonthAriaLabel",2),D([n.property({type:String})],v.prototype,"dayFormat",2),D([n.property({type:String})],v.prototype,"weekdayFormat",2),D([n.property({type:String})],v.prototype,"monthFormat",2),D([n.property({type:String})],v.prototype,"minDate",2),D([n.property({type:String})],v.prototype,"maxDate",2),D([n.property({type:Array,attribute:"disabled-ranges"})],v.prototype,"disabledRanges",2),D([n.property({type:Number})],v.prototype,"numberOfMonths",2),D([n.property({type:Array})],v.prototype,"value",2),D([n.property({type:String})],v.prototype,"focusDate",2),D([n.property({type:Boolean})],v.prototype,"hidePills",2),D([n.property({type:String})],v.prototype,"removePillAriaLabel",2),D([n.property({type:String,attribute:"disabled-date-range-message"})],v.prototype,"disabledDateRangeMessage",2),D([n.property({attribute:!1})],v.prototype,"invalidRange",2),D([n.property({type:String,attribute:"hour-format"})],v.prototype,"hourFormat",2),D([n.property({type:Number,attribute:"minute-step"})],v.prototype,"minuteStep",2),D([n.property({type:Boolean,attribute:"allow-custom-time"})],v.prototype,"allowCustomTime",2),D([n.property({type:String,attribute:"start-time-label"})],v.prototype,"startTimeLabel",2),D([n.property({type:String,attribute:"end-time-label"})],v.prototype,"endTimeLabel",2),D([n.property({type:String,attribute:"min-date-time"})],v.prototype,"minDateTime",2),D([n.property({type:String,attribute:"max-date-time"})],v.prototype,"maxDateTime",2),D([n.property({type:String,attribute:"min-date-time-message"})],v.prototype,"minDateTimeMessage",2),D([n.property({type:String,attribute:"max-date-time-message"})],v.prototype,"maxDateTimeMessage",2),D([n.property({type:String,attribute:"disabled-range-message"})],v.prototype,"disabledRangeMessage",2),D([n.property({type:String,attribute:"no-available-times-message"})],v.prototype,"noAvailableTimesMessage",2),D([n.property({type:String,attribute:"day-count-aria-label"})],v.prototype,"dayCountAriaLabel",2),D([n.property({type:String,attribute:"disabled-day-count-aria-label"})],v.prototype,"disabledDayCountAriaLabel",2),D([n.state()],v.prototype,"_selection",2),D([n.state()],v.prototype,"_invalidRange",2),D([n.state()],v.prototype,"_workingDateStart",2),D([n.state()],v.prototype,"_workingDateEnd",2),D([n.state()],v.prototype,"_workingTimeIn",2),D([n.state()],v.prototype,"_workingTimeOut",2),D([n.state()],v.prototype,"_openList",2),v=D([n.customElement("gui-range-date-time-calendar")],v),typeof customElements<"u"&&!customElements.get("gui-range-date-time-calendar")&&customElements.define("gui-range-date-time-calendar",v);var Vd=Object.defineProperty,Gd=Object.getOwnPropertyDescriptor,Ra=(e,t,i,a)=>{for(var r=a>1?void 0:a?Gd(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Vd(t,i,r),r};let Yt=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-range-date-time-calendar","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=this.adapter.templateData;return l.html`
1029
+ `}getSortedPills(){return Zt(this.value,(e,t)=>this.parseEndpoint(e).getTime()-this.parseEndpoint(t).getTime())}navigateToDate(e){this._nav.navigateToDate(this.endpointDay(e))}};$([n.property({type:String})],D.prototype,"uid",2),$([n.property({type:String})],D.prototype,"label",2),$([n.property({type:String})],D.prototype,"hint",2),$([n.property({type:String,attribute:"locale-id"})],D.prototype,"localeId",2),$([n.property({type:Array})],D.prototype,"errors",2),$([n.property({type:Boolean})],D.prototype,"touched",2),$([n.property({type:Boolean})],D.prototype,"required",2),$([n.property({type:Boolean})],D.prototype,"disabled",2),$([n.property({type:Boolean,attribute:"readonly"})],D.prototype,"readOnly",2),$([n.property({type:String,attribute:"prev-month-icon"})],D.prototype,"prevMonthIcon",2),$([n.property({type:String,attribute:"next-month-icon"})],D.prototype,"nextMonthIcon",2),$([n.property({type:String,attribute:"prev-month-aria-label"})],D.prototype,"prevMonthAriaLabel",2),$([n.property({type:String,attribute:"next-month-aria-label"})],D.prototype,"nextMonthAriaLabel",2),$([n.property({type:String,attribute:"select-year-aria-label"})],D.prototype,"selectYearAriaLabel",2),$([n.property({type:String,attribute:"year-grid-aria-label"})],D.prototype,"yearGridAriaLabel",2),$([n.property({type:String})],D.prototype,"dayFormat",2),$([n.property({type:String})],D.prototype,"weekdayFormat",2),$([n.property({type:String})],D.prototype,"monthFormat",2),$([n.property({type:String})],D.prototype,"minDate",2),$([n.property({type:String})],D.prototype,"maxDate",2),$([n.property({type:Array,attribute:"disabled-ranges"})],D.prototype,"disabledRanges",2),$([n.property({type:Number})],D.prototype,"numberOfMonths",2),$([n.property({type:Array})],D.prototype,"value",2),$([n.property({type:String})],D.prototype,"focusDate",2),$([n.property({type:Boolean})],D.prototype,"hidePills",2),$([n.property({type:String})],D.prototype,"removePillAriaLabel",2),$([n.property({type:String,attribute:"disabled-date-range-message"})],D.prototype,"disabledDateRangeMessage",2),$([n.property({attribute:!1})],D.prototype,"invalidRange",2),$([n.property({type:String,attribute:"hour-format"})],D.prototype,"hourFormat",2),$([n.property({type:Number,attribute:"minute-step"})],D.prototype,"minuteStep",2),$([n.property({type:Boolean,attribute:"allow-custom-time"})],D.prototype,"allowCustomTime",2),$([n.property({type:String,attribute:"start-time-label"})],D.prototype,"startTimeLabel",2),$([n.property({type:String,attribute:"end-time-label"})],D.prototype,"endTimeLabel",2),$([n.property({type:String,attribute:"min-date-time"})],D.prototype,"minDateTime",2),$([n.property({type:String,attribute:"max-date-time"})],D.prototype,"maxDateTime",2),$([n.property({type:String,attribute:"min-date-time-message"})],D.prototype,"minDateTimeMessage",2),$([n.property({type:String,attribute:"max-date-time-message"})],D.prototype,"maxDateTimeMessage",2),$([n.property({type:String,attribute:"disabled-range-message"})],D.prototype,"disabledRangeMessage",2),$([n.property({type:String,attribute:"no-available-times-message"})],D.prototype,"noAvailableTimesMessage",2),$([n.property({type:String,attribute:"day-count-aria-label"})],D.prototype,"dayCountAriaLabel",2),$([n.property({type:String,attribute:"disabled-day-count-aria-label"})],D.prototype,"disabledDayCountAriaLabel",2),$([n.state()],D.prototype,"_selection",2),$([n.state()],D.prototype,"_invalidRange",2),$([n.state()],D.prototype,"_workingDateStart",2),$([n.state()],D.prototype,"_workingDateEnd",2),$([n.state()],D.prototype,"_workingTimeIn",2),$([n.state()],D.prototype,"_workingTimeOut",2),$([n.state()],D.prototype,"_openList",2),D=$([n.customElement("gui-range-date-time-calendar")],D),typeof customElements<"u"&&!customElements.get("gui-range-date-time-calendar")&&customElements.define("gui-range-date-time-calendar",D);var Qh=Object.defineProperty,jh=Object.getOwnPropertyDescriptor,Tr=(e,t,i,a)=>{for(var r=a>1?void 0:a?jh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Qh(t,i,r),r};let Qt=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-range-date-time-calendar","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=this.adapter.templateData;return l.html`
914
1030
  <gui-range-date-time-calendar
915
1031
  .uid=${this.widget.uid}
916
1032
  .label=${e.label}
@@ -925,6 +1041,8 @@
925
1041
  .nextMonthIcon=${e.nextMonthIcon}
926
1042
  .prevMonthAriaLabel=${e.prevMonthAriaLabel}
927
1043
  .nextMonthAriaLabel=${e.nextMonthAriaLabel}
1044
+ .selectYearAriaLabel=${e.selectYearAriaLabel}
1045
+ .yearGridAriaLabel=${e.yearGridAriaLabel}
928
1046
  .dayFormat=${e.dayFormat}
929
1047
  .weekdayFormat=${e.weekdayFormat}
930
1048
  .monthFormat=${e.monthFormat}
@@ -949,8 +1067,10 @@
949
1067
  @inputError=${this.onInputError}
950
1068
  @blur=${()=>this.adapter.onBlur()}
951
1069
  ></gui-range-date-time-calendar>
952
- `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message]),this.adapter.onBlur()}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Ra([b.consume({context:m.formContext}),n.property({attribute:!1})],Yt.prototype,"formContext",2),Ra([b.provide({context:m.inputContext})],Yt.prototype,"adapter",2),Yt=Ra([n.customElement("gui-range-date-time-calendar-input")],Yt);const Ud=Object.freeze(Object.defineProperty({__proto__:null,get RangeDateTimeCalendarElement(){return Yt}},Symbol.toStringTag,{value:"Module"}));var Zd=Object.defineProperty,Hd=Object.getOwnPropertyDescriptor,k=(e,t,i,a)=>{for(var r=a>1?void 0:a?Hd(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Zd(t,i,r),r};let $=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.icon="",this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.localeId=void 0,this.value=[],this.separator=void 0,this.removePillAriaLabel=void 0,this.startDateTimeAriaLabel=void 0,this.endDateTimeAriaLabel=void 0,this.invalidDateMessage=void 0,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel=void 0,this.nextMonthAriaLabel=void 0,this.dayFormat=void 0,this.weekdayFormat=void 0,this.monthFormat=void 0,this.numberOfMonths=void 0,this.hourFormat=void 0,this.minuteStep=void 0,this.allowCustomTime=!1,this.startTimeLabel=void 0,this.endTimeLabel=void 0,this.minDateTime=void 0,this.maxDateTime=void 0,this.minDateTimeMessage=void 0,this.maxDateTimeMessage=void 0,this.disabledRanges=void 0,this.disabledRangeMessage=void 0,this.noAvailableTimesMessage=void 0,this.dayCountAriaLabel=void 0,this.disabledDayCountAriaLabel=void 0,this._focusDate=void 0,this._popup=new Mt(this,{getInteriorElements:()=>[this._dateRef,this._calendarRef],focusRestoreSelector:"gui-range-date-time input",isDisabled:()=>!!this.disabled,clickIntent:e=>e.closest(".gui-calendar__day-button")||e.closest(".gui-time-list__option")||e.closest("gui-time-picker")?"ignore":e.closest(".gui-range-date-time-input__field")||e.closest("gui-range-date-time-calendar")?"open":"toggle",keyToggleMode:"openClose",beforeOpen:e=>{this.querySelector(".gui-pills__dropdown")&&e.suppressNextFocusOut(),this.closePillsDropdown()},onOpenChanged:e=>{e||(this._focusDate=void 0)}}),this.onDropdownToggle=e=>{e.detail?.open&&this._popup.open&&this._popup.close()}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("dropdowntoggle",this.onDropdownToggle)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("dropdowntoggle",this.onDropdownToggle)}render(){const e=Ke("datePicker",{icon:this.icon}),t=this._popup.open?l.html`<gui-range-date-time-calendar
953
- id="calendar-input"
1070
+ `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message]),this.adapter.onBlur()}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Tr([f.consume({context:m.formContext}),n.property({attribute:!1})],Qt.prototype,"formContext",2),Tr([f.provide({context:m.inputContext})],Qt.prototype,"adapter",2),Qt=Tr([n.customElement("gui-range-date-time-calendar-input")],Qt);const ec=Object.freeze(Object.defineProperty({__proto__:null,get RangeDateTimeCalendarElement(){return Qt}},Symbol.toStringTag,{value:"Module"}));var tc=Object.defineProperty,ic=Object.getOwnPropertyDescriptor,w=(e,t,i,a)=>{for(var r=a>1?void 0:a?ic(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&tc(t,i,r),r};let v=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.icon="",this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.localeId=void 0,this.value=[],this.toggleAriaLabel=void 0,this.dayAriaLabel=void 0,this.monthAriaLabel=void 0,this.yearAriaLabel=void 0,this.hourAriaLabel=void 0,this.minuteAriaLabel=void 0,this.dayPeriodAriaLabel=void 0,this.separator=void 0,this.removePillAriaLabel=void 0,this.startDateTimeAriaLabel=void 0,this.endDateTimeAriaLabel=void 0,this.invalidDateMessage=void 0,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel=void 0,this.nextMonthAriaLabel=void 0,this.selectYearAriaLabel=void 0,this.yearGridAriaLabel=void 0,this.dayFormat=void 0,this.weekdayFormat=void 0,this.monthFormat=void 0,this.numberOfMonths=void 0,this.hourFormat=void 0,this.minuteStep=void 0,this.allowCustomTime=!1,this.startTimeLabel=void 0,this.endTimeLabel=void 0,this.minDateTime=void 0,this.maxDateTime=void 0,this.minDateTimeMessage=void 0,this.maxDateTimeMessage=void 0,this.disabledRanges=void 0,this.disabledRangeMessage=void 0,this.noAvailableTimesMessage=void 0,this.dayCountAriaLabel=void 0,this.disabledDayCountAriaLabel=void 0,this._focusDate=void 0,this._popup=new Ot(this,{focusRestoreSelector:"gui-range-date-time input",focusPopupSelector:'.gui-calendar__day-button[tabindex="0"]',isDisabled:()=>!!this.disabled,clickIntent:e=>e.closest(".gui-calendar__day-button")||e.closest(".gui-time-list__option")||e.closest("gui-time-picker")?"ignore":e.closest(".gui-range-date-time-input__field")||e.closest("gui-range-date-time-calendar")?"open":"toggle",keyToggleMode:"openClose",beforeOpen:e=>{this.querySelector(".gui-pills__dropdown")&&e.suppressNextFocusOut(),this.closePillsDropdown()},onOpenChanged:e=>{e||(this._focusDate=void 0)}}),this.onDropdownToggle=e=>{e.detail?.open&&this._popup.open&&this._popup.close()},this.onToggleClick=e=>{e.stopPropagation(),this._popup.open?this._popup.close():this._popup.openAndFocus()}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("dropdowntoggle",this.onDropdownToggle)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("dropdowntoggle",this.onDropdownToggle)}render(){const e=Xe("datePicker",{icon:this.icon}),t=this._popup.open?l.html`<gui-range-date-time-calendar
1071
+ id=${`${this.uid}_popup`}
1072
+ role="dialog"
1073
+ aria-label=${this.label??"Calendar"}
954
1074
  .uid=${this.uid}
955
1075
  .hint=${this.hint}
956
1076
  ?touched=${this.touched}
@@ -965,6 +1085,8 @@
965
1085
  .nextMonthIcon=${this.nextMonthIcon}
966
1086
  .prevMonthAriaLabel=${this.prevMonthAriaLabel}
967
1087
  .nextMonthAriaLabel=${this.nextMonthAriaLabel}
1088
+ .selectYearAriaLabel=${this.selectYearAriaLabel}
1089
+ .yearGridAriaLabel=${this.yearGridAriaLabel}
968
1090
  .dayFormat=${this.dayFormat}
969
1091
  .weekdayFormat=${this.weekdayFormat}
970
1092
  .monthFormat=${this.monthFormat}
@@ -987,20 +1109,16 @@
987
1109
  @change=${this.onCalendarChange}
988
1110
  @inputError=${this.onCalendarInputError}
989
1111
  ></gui-range-date-time-calendar>`:l.nothing;return l.html`
990
- ${se(this.uid??"",{label:this.label,hint:this.hint,required:this.required})}
1112
+ ${le(this.uid??"",{label:this.label,hint:this.hint,required:this.required},!1,void 0,!1)}
991
1113
 
992
1114
  <div
993
- role="button"
994
- tabindex="-1"
995
1115
  class="gui-widget"
996
- aria-expanded=${this._popup.open}
997
- @keyup=${this._popup.onAnchorKeyUp}
998
1116
  @keydown=${this._popup.onAnchorKeyDown}
999
1117
  @click=${this._popup.onAnchorClick}
1000
1118
  >
1001
1119
  <gui-range-date-time
1002
1120
  id="date-input"
1003
- class=${w.classMap(e.widgetClasses)}
1121
+ class=${T.classMap(e.widgetClasses)}
1004
1122
  .uid=${this.uid}
1005
1123
  .hint=${this.hint}
1006
1124
  .showErrors=${!1}
@@ -1018,6 +1136,12 @@
1018
1136
  .removePillAriaLabel=${this.removePillAriaLabel}
1019
1137
  .startDateTimeAriaLabel=${this.startDateTimeAriaLabel}
1020
1138
  .endDateTimeAriaLabel=${this.endDateTimeAriaLabel}
1139
+ .dayAriaLabel=${this.dayAriaLabel}
1140
+ .monthAriaLabel=${this.monthAriaLabel}
1141
+ .yearAriaLabel=${this.yearAriaLabel}
1142
+ .hourAriaLabel=${this.hourAriaLabel}
1143
+ .minuteAriaLabel=${this.minuteAriaLabel}
1144
+ .dayPeriodAriaLabel=${this.dayPeriodAriaLabel}
1021
1145
  .invalidDateMessage=${this.invalidDateMessage}
1022
1146
  .minDateTime=${this.minDateTime}
1023
1147
  .maxDateTime=${this.maxDateTime}
@@ -1030,18 +1154,34 @@
1030
1154
  @change=${this.onDateChange}
1031
1155
  @pillClick=${this.onPillClick}
1032
1156
  ></gui-range-date-time>
1033
- <span class="gui-range-date-time-picker__arrow"
1034
- ><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256">
1157
+ <button
1158
+ type="button"
1159
+ class="gui-range-date-time-picker__arrow"
1160
+ aria-label=${this.toggleAriaLabel??"Show calendar"}
1161
+ aria-haspopup="dialog"
1162
+ aria-expanded=${this._popup.open?"true":"false"}
1163
+ aria-controls=${`${this.uid}_popup`}
1164
+ ?disabled=${this.disabled}
1165
+ @click=${this.onToggleClick}
1166
+ >
1167
+ <svg
1168
+ xmlns="http://www.w3.org/2000/svg"
1169
+ width="16"
1170
+ height="16"
1171
+ viewBox="0 0 256 256"
1172
+ aria-hidden="true"
1173
+ >
1035
1174
  <path
1036
1175
  d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
1037
- ></path></svg
1038
- ></span>
1176
+ ></path>
1177
+ </svg>
1178
+ </button>
1039
1179
 
1040
1180
  ${t}
1041
1181
  </div>
1042
1182
 
1043
- ${this.showErrors?W(this.uid??"",{errors:this.errors,touched:this.touched}):""}
1044
- `}onDateChange(e){e.stopPropagation(),this.commitValue(e.detail.value)}onDateBlur(){this.dispatchEvent(new CustomEvent("blur"))}onCalendarChange(e){if(!this._popup.open){e.stopPropagation();return}e.stopPropagation(),this.commitValue(e.detail.value),this._popup.suppressNextFocusOut(),requestAnimationFrame(()=>{if(!this._popup.open)return;this.querySelector('gui-range-date-time-calendar .gui-calendar__day-button[tabindex="0"]')?.focus()})}onCalendarInputError(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("inputError",{detail:e.detail,bubbles:!0,composed:!0}))}commitValue(e){this.value=e??void 0,this.dispatchEvent(new CustomEvent("change",{detail:{value:e??null},bubbles:!0,composed:!0}))}onCalendarBlur(){this._popup.close()}onPillClick(e){this._focusDate=e.detail.range.start,this._popup.show()}closePillsDropdown(){this.querySelector("gui-pills")?.closeDropdown?.()}};k([n.property({type:String})],$.prototype,"uid",2),k([n.property({type:String})],$.prototype,"label",2),k([n.property({type:String})],$.prototype,"hint",2),k([n.property({type:String})],$.prototype,"icon",2),k([n.property({type:Array})],$.prototype,"errors",2),k([n.property({type:Boolean})],$.prototype,"showErrors",2),k([n.property({type:Boolean})],$.prototype,"touched",2),k([n.property({type:Boolean})],$.prototype,"required",2),k([n.property({type:Boolean})],$.prototype,"disabled",2),k([n.property({type:Boolean,attribute:"readonly"})],$.prototype,"readOnly",2),k([n.property({type:String,attribute:"locale-id"})],$.prototype,"localeId",2),k([n.property({type:Array})],$.prototype,"value",2),k([n.property({type:String})],$.prototype,"separator",2),k([n.property({type:String,attribute:"remove-pill-aria-label"})],$.prototype,"removePillAriaLabel",2),k([n.property({type:String,attribute:"start-date-time-aria-label"})],$.prototype,"startDateTimeAriaLabel",2),k([n.property({type:String,attribute:"end-date-time-aria-label"})],$.prototype,"endDateTimeAriaLabel",2),k([n.property({type:String,attribute:"invalid-date-message"})],$.prototype,"invalidDateMessage",2),k([n.property({type:String,attribute:"prev-month-icon"})],$.prototype,"prevMonthIcon",2),k([n.property({type:String,attribute:"next-month-icon"})],$.prototype,"nextMonthIcon",2),k([n.property({type:String,attribute:"prev-month-aria-label"})],$.prototype,"prevMonthAriaLabel",2),k([n.property({type:String,attribute:"next-month-aria-label"})],$.prototype,"nextMonthAriaLabel",2),k([n.property({type:String,attribute:"day-format"})],$.prototype,"dayFormat",2),k([n.property({type:String,attribute:"weekday-format"})],$.prototype,"weekdayFormat",2),k([n.property({type:String,attribute:"month-format"})],$.prototype,"monthFormat",2),k([n.property({type:Number,attribute:"number-of-months"})],$.prototype,"numberOfMonths",2),k([n.property({type:String,attribute:"hour-format"})],$.prototype,"hourFormat",2),k([n.property({type:Number,attribute:"minute-step"})],$.prototype,"minuteStep",2),k([n.property({type:Boolean,attribute:"allow-custom-time"})],$.prototype,"allowCustomTime",2),k([n.property({type:String,attribute:"start-time-label"})],$.prototype,"startTimeLabel",2),k([n.property({type:String,attribute:"end-time-label"})],$.prototype,"endTimeLabel",2),k([n.property({type:String,attribute:"min-date-time"})],$.prototype,"minDateTime",2),k([n.property({type:String,attribute:"max-date-time"})],$.prototype,"maxDateTime",2),k([n.property({type:String,attribute:"min-date-time-message"})],$.prototype,"minDateTimeMessage",2),k([n.property({type:String,attribute:"max-date-time-message"})],$.prototype,"maxDateTimeMessage",2),k([n.property({type:Array,attribute:"disabled-ranges"})],$.prototype,"disabledRanges",2),k([n.property({type:String,attribute:"disabled-range-message"})],$.prototype,"disabledRangeMessage",2),k([n.property({type:String,attribute:"no-available-times-message"})],$.prototype,"noAvailableTimesMessage",2),k([n.property({type:String,attribute:"day-count-aria-label"})],$.prototype,"dayCountAriaLabel",2),k([n.property({type:String,attribute:"disabled-day-count-aria-label"})],$.prototype,"disabledDayCountAriaLabel",2),k([n.query("#date-input")],$.prototype,"_dateRef",2),k([n.query("#calendar-input")],$.prototype,"_calendarRef",2),k([n.state()],$.prototype,"_focusDate",2),$=k([n.customElement("gui-range-date-time-picker")],$),typeof customElements<"u"&&!customElements.get("gui-range-date-time-picker")&&customElements.define("gui-range-date-time-picker",$);var Wd=Object.defineProperty,Yd=Object.getOwnPropertyDescriptor,Fa=(e,t,i,a)=>{for(var r=a>1?void 0:a?Yd(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Wd(t,i,r),r};let Kt=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-range-date-time-picker","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=this.adapter.templateData;return l.html`
1183
+ ${this.showErrors?j(this.uid??"",{errors:this.errors,touched:this.touched}):""}
1184
+ `}onDateChange(e){e.stopPropagation(),this.commitValue(e.detail.value)}onDateBlur(){this.dispatchEvent(new CustomEvent("blur"))}onCalendarChange(e){if(!this._popup.open){e.stopPropagation();return}e.stopPropagation(),this.commitValue(e.detail.value),this._popup.suppressNextFocusOut(),requestAnimationFrame(()=>{if(!this._popup.open)return;this.querySelector('gui-range-date-time-calendar .gui-calendar__day-button[tabindex="0"]')?.focus()})}onCalendarInputError(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("inputError",{detail:e.detail,bubbles:!0,composed:!0}))}commitValue(e){this.value=e??void 0,this.dispatchEvent(new CustomEvent("change",{detail:{value:e??null},bubbles:!0,composed:!0}))}onCalendarBlur(){this._popup.closeOnFocusLeave()}onPillClick(e){this._focusDate=e.detail.range.start,this._popup.show()}closePillsDropdown(){this.querySelector("gui-pills")?.closeDropdown?.()}};w([n.property({type:String})],v.prototype,"uid",2),w([n.property({type:String})],v.prototype,"label",2),w([n.property({type:String})],v.prototype,"hint",2),w([n.property({type:String})],v.prototype,"icon",2),w([n.property({type:Array})],v.prototype,"errors",2),w([n.property({type:Boolean})],v.prototype,"showErrors",2),w([n.property({type:Boolean})],v.prototype,"touched",2),w([n.property({type:Boolean})],v.prototype,"required",2),w([n.property({type:Boolean})],v.prototype,"disabled",2),w([n.property({type:Boolean,attribute:"readonly"})],v.prototype,"readOnly",2),w([n.property({type:String,attribute:"locale-id"})],v.prototype,"localeId",2),w([n.property({type:Array})],v.prototype,"value",2),w([n.property({type:String,attribute:"toggle-aria-label"})],v.prototype,"toggleAriaLabel",2),w([n.property({type:String})],v.prototype,"dayAriaLabel",2),w([n.property({type:String})],v.prototype,"monthAriaLabel",2),w([n.property({type:String})],v.prototype,"yearAriaLabel",2),w([n.property({type:String})],v.prototype,"hourAriaLabel",2),w([n.property({type:String})],v.prototype,"minuteAriaLabel",2),w([n.property({type:String})],v.prototype,"dayPeriodAriaLabel",2),w([n.property({type:String})],v.prototype,"separator",2),w([n.property({type:String,attribute:"remove-pill-aria-label"})],v.prototype,"removePillAriaLabel",2),w([n.property({type:String,attribute:"start-date-time-aria-label"})],v.prototype,"startDateTimeAriaLabel",2),w([n.property({type:String,attribute:"end-date-time-aria-label"})],v.prototype,"endDateTimeAriaLabel",2),w([n.property({type:String,attribute:"invalid-date-message"})],v.prototype,"invalidDateMessage",2),w([n.property({type:String,attribute:"prev-month-icon"})],v.prototype,"prevMonthIcon",2),w([n.property({type:String,attribute:"next-month-icon"})],v.prototype,"nextMonthIcon",2),w([n.property({type:String,attribute:"prev-month-aria-label"})],v.prototype,"prevMonthAriaLabel",2),w([n.property({type:String,attribute:"next-month-aria-label"})],v.prototype,"nextMonthAriaLabel",2),w([n.property({type:String,attribute:"select-year-aria-label"})],v.prototype,"selectYearAriaLabel",2),w([n.property({type:String,attribute:"year-grid-aria-label"})],v.prototype,"yearGridAriaLabel",2),w([n.property({type:String,attribute:"day-format"})],v.prototype,"dayFormat",2),w([n.property({type:String,attribute:"weekday-format"})],v.prototype,"weekdayFormat",2),w([n.property({type:String,attribute:"month-format"})],v.prototype,"monthFormat",2),w([n.property({type:Number,attribute:"number-of-months"})],v.prototype,"numberOfMonths",2),w([n.property({type:String,attribute:"hour-format"})],v.prototype,"hourFormat",2),w([n.property({type:Number,attribute:"minute-step"})],v.prototype,"minuteStep",2),w([n.property({type:Boolean,attribute:"allow-custom-time"})],v.prototype,"allowCustomTime",2),w([n.property({type:String,attribute:"start-time-label"})],v.prototype,"startTimeLabel",2),w([n.property({type:String,attribute:"end-time-label"})],v.prototype,"endTimeLabel",2),w([n.property({type:String,attribute:"min-date-time"})],v.prototype,"minDateTime",2),w([n.property({type:String,attribute:"max-date-time"})],v.prototype,"maxDateTime",2),w([n.property({type:String,attribute:"min-date-time-message"})],v.prototype,"minDateTimeMessage",2),w([n.property({type:String,attribute:"max-date-time-message"})],v.prototype,"maxDateTimeMessage",2),w([n.property({type:Array,attribute:"disabled-ranges"})],v.prototype,"disabledRanges",2),w([n.property({type:String,attribute:"disabled-range-message"})],v.prototype,"disabledRangeMessage",2),w([n.property({type:String,attribute:"no-available-times-message"})],v.prototype,"noAvailableTimesMessage",2),w([n.property({type:String,attribute:"day-count-aria-label"})],v.prototype,"dayCountAriaLabel",2),w([n.property({type:String,attribute:"disabled-day-count-aria-label"})],v.prototype,"disabledDayCountAriaLabel",2),w([n.state()],v.prototype,"_focusDate",2),v=w([n.customElement("gui-range-date-time-picker")],v),typeof customElements<"u"&&!customElements.get("gui-range-date-time-picker")&&customElements.define("gui-range-date-time-picker",v);var ac=Object.defineProperty,rc=Object.getOwnPropertyDescriptor,_r=(e,t,i,a)=>{for(var r=a>1?void 0:a?rc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&ac(t,i,r),r};let jt=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-range-date-time-picker","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=this.adapter.templateData;return l.html`
1045
1185
  <gui-range-date-time-picker
1046
1186
  .uid=${this.widget.uid}
1047
1187
  .label=${e.label}
@@ -1062,11 +1202,20 @@
1062
1202
  .nextMonthIcon=${e.nextMonthIcon}
1063
1203
  .prevMonthAriaLabel=${e.prevMonthAriaLabel}
1064
1204
  .nextMonthAriaLabel=${e.nextMonthAriaLabel}
1205
+ .selectYearAriaLabel=${e.selectYearAriaLabel}
1206
+ .yearGridAriaLabel=${e.yearGridAriaLabel}
1065
1207
  .dayFormat=${e.dayFormat}
1066
1208
  .weekdayFormat=${e.weekdayFormat}
1067
1209
  .monthFormat=${e.monthFormat}
1068
1210
  .numberOfMonths=${e.numberOfMonths}
1069
1211
  .localeId=${e.lang}
1212
+ .toggleAriaLabel=${e.toggleAriaLabel}
1213
+ .dayAriaLabel=${e.dayAriaLabel}
1214
+ .monthAriaLabel=${e.monthAriaLabel}
1215
+ .yearAriaLabel=${e.yearAriaLabel}
1216
+ .hourAriaLabel=${e.hourAriaLabel}
1217
+ .minuteAriaLabel=${e.minuteAriaLabel}
1218
+ .dayPeriodAriaLabel=${e.dayPeriodAriaLabel}
1070
1219
  .hourFormat=${e.hourFormat}
1071
1220
  .minuteStep=${e.minuteStep}
1072
1221
  ?allow-custom-time=${e.allowCustomTime}
@@ -1085,8 +1234,10 @@
1085
1234
  @inputError=${this.onInputError}
1086
1235
  @blur=${()=>this.adapter.onBlur()}
1087
1236
  ></gui-range-date-time-picker>
1088
- `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message]),this.adapter.onBlur()}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Fa([b.consume({context:m.formContext}),n.property({attribute:!1})],Kt.prototype,"formContext",2),Fa([b.provide({context:m.inputContext})],Kt.prototype,"adapter",2),Kt=Fa([n.customElement("gui-range-date-time-picker-input")],Kt);const Kd=Object.freeze(Object.defineProperty({__proto__:null,get RangeDateTimePickerElement(){return Kt}},Symbol.toStringTag,{value:"Module"}));var Xd=Object.defineProperty,Jd=Object.getOwnPropertyDescriptor,P=(e,t,i,a)=>{for(var r=a>1?void 0:a?Jd(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Xd(t,i,r),r};let x=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.icon="",this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.localeId=void 0,this.value=[],this.separator=void 0,this.removePillAriaLabel=void 0,this.startDateAriaLabel=void 0,this.endDateAriaLabel=void 0,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel=void 0,this.nextMonthAriaLabel=void 0,this.dayFormat=void 0,this.weekdayFormat=void 0,this.monthFormat=void 0,this.minDate=void 0,this.maxDate=void 0,this.disabledRanges=void 0,this.numberOfMonths=void 0,this.invalidDateMessage=void 0,this.minDateMessage=void 0,this.maxDateMessage=void 0,this.disabledDateRangeMessage=void 0,this._focusDate=void 0,this._invalidRange=null,this._popup=new Mt(this,{getInteriorElements:()=>[this._dateRef,this._calendarRef],focusRestoreSelector:"gui-range-date input",isDisabled:()=>!!this.disabled,clickIntent:e=>e.closest(".gui-range-date-input__part")||e.closest("gui-range-calendar")?"open":"toggle",keyToggleMode:"openClose",beforeOpen:e=>{this.querySelector(".gui-pills__dropdown")&&e.suppressNextFocusOut(),this.closePillsDropdown()}}),this.onDropdownToggle=e=>{e.detail?.open&&this._popup.open&&this._popup.close()}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("dropdowntoggle",this.onDropdownToggle)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("dropdowntoggle",this.onDropdownToggle)}render(){const e=Ke("datePicker",{icon:this.icon}),t=this._popup.open?l.html`<gui-range-calendar
1089
- id="calendar-input"
1237
+ `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message]),this.adapter.onBlur()}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};_r([f.consume({context:m.formContext}),n.property({attribute:!1})],jt.prototype,"formContext",2),_r([f.provide({context:m.inputContext})],jt.prototype,"adapter",2),jt=_r([n.customElement("gui-range-date-time-picker-input")],jt);const sc=Object.freeze(Object.defineProperty({__proto__:null,get RangeDateTimePickerElement(){return jt}},Symbol.toStringTag,{value:"Module"}));var nc=Object.defineProperty,oc=Object.getOwnPropertyDescriptor,C=(e,t,i,a)=>{for(var r=a>1?void 0:a?oc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&nc(t,i,r),r};let A=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.icon="",this.toggleAriaLabel=void 0,this.dayAriaLabel=void 0,this.monthAriaLabel=void 0,this.yearAriaLabel=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.localeId=void 0,this.value=[],this.separator=void 0,this.removePillAriaLabel=void 0,this.startDateAriaLabel=void 0,this.endDateAriaLabel=void 0,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel=void 0,this.nextMonthAriaLabel=void 0,this.selectYearAriaLabel=void 0,this.yearGridAriaLabel=void 0,this.dayFormat=void 0,this.weekdayFormat=void 0,this.monthFormat=void 0,this.minDate=void 0,this.maxDate=void 0,this.disabledRanges=void 0,this.numberOfMonths=void 0,this.invalidDateMessage=void 0,this.minDateMessage=void 0,this.maxDateMessage=void 0,this.disabledDateRangeMessage=void 0,this._focusDate=void 0,this._invalidRange=null,this._popup=new Ot(this,{focusRestoreSelector:"gui-range-date input",focusPopupSelector:'.gui-calendar__day-button[tabindex="0"]',isDisabled:()=>!!this.disabled,clickIntent:e=>e.closest(".gui-range-date-input__part")||e.closest("gui-range-calendar")?"open":"toggle",keyToggleMode:"openClose",beforeOpen:e=>{this.querySelector(".gui-pills__dropdown")&&e.suppressNextFocusOut(),this.closePillsDropdown()}}),this.onDropdownToggle=e=>{e.detail?.open&&this._popup.open&&this._popup.close()},this.onToggleClick=e=>{e.stopPropagation(),this._popup.open?this._popup.close():this._popup.openAndFocus()}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("dropdowntoggle",this.onDropdownToggle)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("dropdowntoggle",this.onDropdownToggle)}render(){const e=Xe("datePicker",{icon:this.icon}),t=this._popup.open?l.html`<gui-range-calendar
1238
+ id=${`${this.uid}_popup`}
1239
+ role="dialog"
1240
+ aria-label=${this.label??"Calendar"}
1090
1241
  .uid=${this.uid}
1091
1242
  .hint=${this.hint}
1092
1243
  ?touched=${this.touched}
@@ -1099,6 +1250,8 @@
1099
1250
  .nextMonthIcon=${this.nextMonthIcon}
1100
1251
  .prevMonthAriaLabel=${this.prevMonthAriaLabel}
1101
1252
  .nextMonthAriaLabel=${this.nextMonthAriaLabel}
1253
+ .selectYearAriaLabel=${this.selectYearAriaLabel}
1254
+ .yearGridAriaLabel=${this.yearGridAriaLabel}
1102
1255
  .dayFormat=${this.dayFormat}
1103
1256
  .weekdayFormat=${this.weekdayFormat}
1104
1257
  .monthFormat=${this.monthFormat}
@@ -1114,20 +1267,16 @@
1114
1267
  @change=${this.onCalendarChange}
1115
1268
  @inputError=${this.onCalendarInputError}
1116
1269
  ></gui-range-calendar>`:l.nothing;return l.html`
1117
- ${se(this.uid??"",{label:this.label,hint:this.hint,required:this.required})}
1270
+ ${le(this.uid??"",{label:this.label,hint:this.hint,required:this.required},!1,void 0,!1)}
1118
1271
 
1119
1272
  <div
1120
- role="button"
1121
- tabindex="-1"
1122
1273
  class="gui-widget"
1123
- aria-expanded=${this._popup.open}
1124
- @keyup=${this._popup.onAnchorKeyUp}
1125
1274
  @keydown=${this._popup.onAnchorKeyDown}
1126
1275
  @click=${this._popup.onAnchorClick}
1127
1276
  >
1128
1277
  <gui-range-date
1129
1278
  id="date-input"
1130
- class=${w.classMap(e.widgetClasses)}
1279
+ class=${T.classMap(e.widgetClasses)}
1131
1280
  .uid=${this.uid}
1132
1281
  .hint=${this.hint}
1133
1282
  .showErrors=${!1}
@@ -1143,24 +1292,43 @@
1143
1292
  .removePillAriaLabel=${this.removePillAriaLabel}
1144
1293
  .startDateAriaLabel=${this.startDateAriaLabel}
1145
1294
  .endDateAriaLabel=${this.endDateAriaLabel}
1295
+ .dayAriaLabel=${this.dayAriaLabel}
1296
+ .monthAriaLabel=${this.monthAriaLabel}
1297
+ .yearAriaLabel=${this.yearAriaLabel}
1146
1298
  .invalidDateMessage=${this.invalidDateMessage}
1147
1299
  @blur=${this.onDateBlur}
1148
1300
  @focus=${this._popup.show}
1149
1301
  @change=${this.onDateChange}
1150
1302
  @pillClick=${this.onPillClick}
1151
1303
  ></gui-range-date>
1152
- <span class="gui-range-date-picker__arrow"
1153
- ><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256">
1304
+ <button
1305
+ type="button"
1306
+ class="gui-range-date-picker__arrow"
1307
+ aria-label=${this.toggleAriaLabel??"Show calendar"}
1308
+ aria-haspopup="dialog"
1309
+ aria-expanded=${this._popup.open?"true":"false"}
1310
+ aria-controls=${`${this.uid}_popup`}
1311
+ ?disabled=${this.disabled}
1312
+ @click=${this.onToggleClick}
1313
+ >
1314
+ <svg
1315
+ xmlns="http://www.w3.org/2000/svg"
1316
+ width="16"
1317
+ height="16"
1318
+ viewBox="0 0 256 256"
1319
+ aria-hidden="true"
1320
+ >
1154
1321
  <path
1155
1322
  d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
1156
- ></path></svg
1157
- ></span>
1323
+ ></path>
1324
+ </svg>
1325
+ </button>
1158
1326
 
1159
1327
  ${t}
1160
1328
  </div>
1161
1329
 
1162
- ${this.showErrors?W(this.uid??"",{errors:this.errors,touched:this.touched}):""}
1163
- `}onDateChange(e){e.stopPropagation();const t=e.detail.value;for(const i of t??[]){const a=this.rangeError(i);if(a){this.rejectTypedRange(i,a);return}}this.commitValue(t)}rangeError(e){const t=e.start,i=e.end??e.start;if(fs(t,i,this.disabledRanges))return this.disabledDateRangeMessage??wt;const a={minDateMessage:this.minDateMessage,maxDateMessage:this.maxDateMessage};for(const r of[t,i]){const s=Bt(r,this.minDate,this.maxDate,void 0,a);if(s)return s}return null}rejectTypedRange(e,t){const i=e.start,a=e.end??e.start;this._invalidRange={start:i,end:a};const r=this._dateRef;r&&(r.value=this.value??[],r.showRange(i,a)),this.dispatchEvent(new CustomEvent("inputError",{detail:{message:t},bubbles:!0,composed:!0}))}onDateBlur(){this.dispatchEvent(new CustomEvent("blur"))}onCalendarChange(e){e.stopPropagation(),this._dateRef?.clearRangeInputs(),this.commitValue(e.detail.value)}onCalendarInputError(e){const t=e.detail?.range;t&&(this._invalidRange=t,this._dateRef?.showRange(t.start,t.end))}commitValue(e){this.value=e??void 0,this._invalidRange=null,this.dispatchEvent(new CustomEvent("change",{detail:{value:e??null},bubbles:!0,composed:!0}))}onCalendarBlur(){this._popup.close()}onPillClick(e){this._focusDate=e.detail.range.start,this._popup.show()}closePillsDropdown(){this.querySelector("gui-pills")?.closeDropdown?.()}};P([n.property({type:String})],x.prototype,"uid",2),P([n.property({type:String})],x.prototype,"label",2),P([n.property({type:String})],x.prototype,"hint",2),P([n.property({type:String})],x.prototype,"icon",2),P([n.property({type:Array})],x.prototype,"errors",2),P([n.property({type:Boolean})],x.prototype,"showErrors",2),P([n.property({type:Boolean})],x.prototype,"touched",2),P([n.property({type:Boolean})],x.prototype,"required",2),P([n.property({type:Boolean})],x.prototype,"disabled",2),P([n.property({type:Boolean,attribute:"readonly"})],x.prototype,"readOnly",2),P([n.property({type:String,attribute:"locale-id"})],x.prototype,"localeId",2),P([n.property({type:Array})],x.prototype,"value",2),P([n.property({type:String})],x.prototype,"separator",2),P([n.property({type:String,attribute:"remove-pill-aria-label"})],x.prototype,"removePillAriaLabel",2),P([n.property({type:String,attribute:"start-date-aria-label"})],x.prototype,"startDateAriaLabel",2),P([n.property({type:String,attribute:"end-date-aria-label"})],x.prototype,"endDateAriaLabel",2),P([n.property({type:String,attribute:"prev-month-icon"})],x.prototype,"prevMonthIcon",2),P([n.property({type:String,attribute:"next-month-icon"})],x.prototype,"nextMonthIcon",2),P([n.property({type:String,attribute:"prev-month-aria-label"})],x.prototype,"prevMonthAriaLabel",2),P([n.property({type:String,attribute:"next-month-aria-label"})],x.prototype,"nextMonthAriaLabel",2),P([n.property({type:String,attribute:"day-format"})],x.prototype,"dayFormat",2),P([n.property({type:String,attribute:"weekday-format"})],x.prototype,"weekdayFormat",2),P([n.property({type:String,attribute:"month-format"})],x.prototype,"monthFormat",2),P([n.property({type:String,attribute:"min-date"})],x.prototype,"minDate",2),P([n.property({type:String,attribute:"max-date"})],x.prototype,"maxDate",2),P([n.property({type:Array,attribute:"disabled-ranges"})],x.prototype,"disabledRanges",2),P([n.property({type:Number,attribute:"number-of-months"})],x.prototype,"numberOfMonths",2),P([n.property({type:String,attribute:"invalid-date-message"})],x.prototype,"invalidDateMessage",2),P([n.property({type:String,attribute:"min-date-message"})],x.prototype,"minDateMessage",2),P([n.property({type:String,attribute:"max-date-message"})],x.prototype,"maxDateMessage",2),P([n.property({type:String,attribute:"disabled-date-range-message"})],x.prototype,"disabledDateRangeMessage",2),P([n.query("#date-input")],x.prototype,"_dateRef",2),P([n.query("#calendar-input")],x.prototype,"_calendarRef",2),P([n.state()],x.prototype,"_focusDate",2),P([n.state()],x.prototype,"_invalidRange",2),x=P([n.customElement("gui-range-date-picker")],x),typeof customElements<"u"&&!customElements.get("gui-range-date-picker")&&customElements.define("gui-range-date-picker",x);var Qd=Object.defineProperty,jd=Object.getOwnPropertyDescriptor,Ba=(e,t,i,a)=>{for(var r=a>1?void 0:a?jd(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Qd(t,i,r),r};let Xt=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-range-date-picker","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=this.adapter.templateData;return l.html`
1330
+ ${this.showErrors?j(this.uid??"",{errors:this.errors,touched:this.touched}):""}
1331
+ `}onDateChange(e){e.stopPropagation();const t=e.detail.value;for(const i of t??[]){const a=this.rangeError(i);if(a){this.rejectTypedRange(i,a);return}}this.commitValue(t)}rangeError(e){const t=e.start,i=e.end??e.start;if(un(t,i,this.disabledRanges))return this.disabledDateRangeMessage??kt;const a={minDateMessage:this.minDateMessage,maxDateMessage:this.maxDateMessage};for(const r of[t,i]){const s=Gt(r,this.minDate,this.maxDate,void 0,a);if(s)return s}return null}rejectTypedRange(e,t){const i=e.start,a=e.end??e.start;this._invalidRange={start:i,end:a};const r=this._dateRef;r&&(r.value=this.value??[],r.showRange(i,a)),this.dispatchEvent(new CustomEvent("inputError",{detail:{message:t},bubbles:!0,composed:!0}))}onDateBlur(){this.dispatchEvent(new CustomEvent("blur"))}onCalendarChange(e){e.stopPropagation(),this._dateRef?.clearRangeInputs(),this.commitValue(e.detail.value)}onCalendarInputError(e){const t=e.detail?.range;t&&(this._invalidRange=t,this._dateRef?.showRange(t.start,t.end))}commitValue(e){this.value=e??void 0,this._invalidRange=null,this.dispatchEvent(new CustomEvent("change",{detail:{value:e??null},bubbles:!0,composed:!0}))}onCalendarBlur(){this._popup.closeOnFocusLeave()}onPillClick(e){this._focusDate=e.detail.range.start,this._popup.show()}closePillsDropdown(){this.querySelector("gui-pills")?.closeDropdown?.()}};C([n.property({type:String})],A.prototype,"uid",2),C([n.property({type:String})],A.prototype,"label",2),C([n.property({type:String})],A.prototype,"hint",2),C([n.property({type:String})],A.prototype,"icon",2),C([n.property({type:String,attribute:"toggle-aria-label"})],A.prototype,"toggleAriaLabel",2),C([n.property({type:String})],A.prototype,"dayAriaLabel",2),C([n.property({type:String})],A.prototype,"monthAriaLabel",2),C([n.property({type:String})],A.prototype,"yearAriaLabel",2),C([n.property({type:Array})],A.prototype,"errors",2),C([n.property({type:Boolean})],A.prototype,"showErrors",2),C([n.property({type:Boolean})],A.prototype,"touched",2),C([n.property({type:Boolean})],A.prototype,"required",2),C([n.property({type:Boolean})],A.prototype,"disabled",2),C([n.property({type:Boolean,attribute:"readonly"})],A.prototype,"readOnly",2),C([n.property({type:String,attribute:"locale-id"})],A.prototype,"localeId",2),C([n.property({type:Array})],A.prototype,"value",2),C([n.property({type:String})],A.prototype,"separator",2),C([n.property({type:String,attribute:"remove-pill-aria-label"})],A.prototype,"removePillAriaLabel",2),C([n.property({type:String,attribute:"start-date-aria-label"})],A.prototype,"startDateAriaLabel",2),C([n.property({type:String,attribute:"end-date-aria-label"})],A.prototype,"endDateAriaLabel",2),C([n.property({type:String,attribute:"prev-month-icon"})],A.prototype,"prevMonthIcon",2),C([n.property({type:String,attribute:"next-month-icon"})],A.prototype,"nextMonthIcon",2),C([n.property({type:String,attribute:"prev-month-aria-label"})],A.prototype,"prevMonthAriaLabel",2),C([n.property({type:String,attribute:"next-month-aria-label"})],A.prototype,"nextMonthAriaLabel",2),C([n.property({type:String,attribute:"select-year-aria-label"})],A.prototype,"selectYearAriaLabel",2),C([n.property({type:String,attribute:"year-grid-aria-label"})],A.prototype,"yearGridAriaLabel",2),C([n.property({type:String,attribute:"day-format"})],A.prototype,"dayFormat",2),C([n.property({type:String,attribute:"weekday-format"})],A.prototype,"weekdayFormat",2),C([n.property({type:String,attribute:"month-format"})],A.prototype,"monthFormat",2),C([n.property({type:String,attribute:"min-date"})],A.prototype,"minDate",2),C([n.property({type:String,attribute:"max-date"})],A.prototype,"maxDate",2),C([n.property({type:Array,attribute:"disabled-ranges"})],A.prototype,"disabledRanges",2),C([n.property({type:Number,attribute:"number-of-months"})],A.prototype,"numberOfMonths",2),C([n.property({type:String,attribute:"invalid-date-message"})],A.prototype,"invalidDateMessage",2),C([n.property({type:String,attribute:"min-date-message"})],A.prototype,"minDateMessage",2),C([n.property({type:String,attribute:"max-date-message"})],A.prototype,"maxDateMessage",2),C([n.property({type:String,attribute:"disabled-date-range-message"})],A.prototype,"disabledDateRangeMessage",2),C([n.query("#date-input")],A.prototype,"_dateRef",2),C([n.state()],A.prototype,"_focusDate",2),C([n.state()],A.prototype,"_invalidRange",2),A=C([n.customElement("gui-range-date-picker")],A),typeof customElements<"u"&&!customElements.get("gui-range-date-picker")&&customElements.define("gui-range-date-picker",A);var lc=Object.defineProperty,dc=Object.getOwnPropertyDescriptor,Ar=(e,t,i,a)=>{for(var r=a>1?void 0:a?dc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&lc(t,i,r),r};let ei=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-range-date-picker","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=this.adapter.templateData;return l.html`
1164
1332
  <gui-range-date-picker
1165
1333
  .uid=${this.widget.uid}
1166
1334
  .label=${e.label}
@@ -1173,6 +1341,10 @@
1173
1341
  .value=${e.value}
1174
1342
  .icon=${e.icon}
1175
1343
  .localeId=${e.lang}
1344
+ .toggleAriaLabel=${e.toggleAriaLabel}
1345
+ .dayAriaLabel=${e.dayAriaLabel}
1346
+ .monthAriaLabel=${e.monthAriaLabel}
1347
+ .yearAriaLabel=${e.yearAriaLabel}
1176
1348
  .separator=${e.separator}
1177
1349
  .removePillAriaLabel=${e.removePillAriaLabel}
1178
1350
  .startDateAriaLabel=${e.startDateAriaLabel}
@@ -1181,6 +1353,8 @@
1181
1353
  .nextMonthIcon=${e.nextMonthIcon}
1182
1354
  .prevMonthAriaLabel=${e.prevMonthAriaLabel}
1183
1355
  .nextMonthAriaLabel=${e.nextMonthAriaLabel}
1356
+ .selectYearAriaLabel=${e.selectYearAriaLabel}
1357
+ .yearGridAriaLabel=${e.yearGridAriaLabel}
1184
1358
  .dayFormat=${e.dayFormat}
1185
1359
  .weekdayFormat=${e.weekdayFormat}
1186
1360
  .monthFormat=${e.monthFormat}
@@ -1196,7 +1370,12 @@
1196
1370
  @blur=${()=>this.adapter.onBlur()}
1197
1371
  @change=${this.valueChanged}
1198
1372
  ></gui-range-date-picker>
1199
- `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message]),this.adapter.onBlur()}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Ba([b.consume({context:m.formContext}),n.property({attribute:!1})],Xt.prototype,"formContext",2),Ba([b.provide({context:m.inputContext})],Xt.prototype,"adapter",2),Xt=Ba([n.customElement("gui-range-date-picker-input")],Xt);const eh=Object.freeze(Object.defineProperty({__proto__:null,get RangeDatePickerElement(){return Xt}},Symbol.toStringTag,{value:"Module"}));var th=Object.defineProperty,ih=Object.getOwnPropertyDescriptor,I=(e,t,i,a)=>{for(var r=a>1?void 0:a?ih(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&th(t,i,r),r};let E=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.icon="",this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.localeId=void 0,this.value=[],this.separator=void 0,this.removePillAriaLabel=void 0,this.startTimeAriaLabel=void 0,this.endTimeAriaLabel=void 0,this.startTimeLabel=void 0,this.endTimeLabel=void 0,this.hourFormat=void 0,this.minuteStep=void 0,this.minTime=void 0,this.maxTime=void 0,this.disabledRanges=void 0,this.allowCustomTime=!1,this.height=void 0,this.itemHeight=void 0,this.minTimeMessage=void 0,this.maxTimeMessage=void 0,this.rangeOrderMessage=void 0,this.disabledRangeMessage=void 0,this.noAvailableTimesMessage=void 0,this._workingIn=void 0,this._workingOut=void 0,this._popup=new Mt(this,{getInteriorElements:()=>[this._inputRef,this._panelRef],focusRestoreSelector:"gui-range-time input, gui-range-time button",isDisabled:()=>!!this.disabled,clickIntent:e=>e.closest(".gui-time-list__option")?"ignore":e.closest(".gui-range-time-input__part")||e.closest(".gui-range-time-picker__panel")?"open":"toggle",keyToggleMode:"openClose",beforeOpen:e=>{this.querySelector(".gui-pills__dropdown")&&e.suppressNextFocusOut(),this.closePillsDropdown()},onOpenChanged:e=>{e||(this._workingIn=void 0,this._workingOut=void 0)}}),this.onDropdownToggle=e=>{e.detail?.open&&this._popup.open&&this._popup.close()}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("dropdowntoggle",this.onDropdownToggle)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("dropdowntoggle",this.onDropdownToggle)}get outListBounds(){if(!this._workingIn)return{minTime:this.minTime,maxTime:this.maxTime};const e=Es(this._workingIn,this.minuteStep);return e?{minTime:e,maxTime:this.maxTime}:{minTime:"23:59:59",maxTime:"00:00:00"}}render(){const e=Ke("rangeTimePicker",{icon:this.icon}),t=this.outListBounds,i=this.startTimeLabel??"Start time",a=this.endTimeLabel??"End time",r=this._popup.open?l.html`<div class="gui-range-time-picker__panel" id="list-panel" role="group">
1373
+ `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message]),this.adapter.onBlur()}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Ar([f.consume({context:m.formContext}),n.property({attribute:!1})],ei.prototype,"formContext",2),Ar([f.provide({context:m.inputContext})],ei.prototype,"adapter",2),ei=Ar([n.customElement("gui-range-date-picker-input")],ei);const pc=Object.freeze(Object.defineProperty({__proto__:null,get RangeDatePickerElement(){return ei}},Symbol.toStringTag,{value:"Module"}));var uc=Object.defineProperty,hc=Object.getOwnPropertyDescriptor,P=(e,t,i,a)=>{for(var r=a>1?void 0:a?hc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&uc(t,i,r),r};let L=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.icon="",this.toggleAriaLabel=void 0,this.hourAriaLabel=void 0,this.minuteAriaLabel=void 0,this.dayPeriodAriaLabel=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.localeId=void 0,this.value=[],this.separator=void 0,this.removePillAriaLabel=void 0,this.startTimeAriaLabel=void 0,this.endTimeAriaLabel=void 0,this.startTimeLabel=void 0,this.endTimeLabel=void 0,this.hourFormat=void 0,this.minuteStep=void 0,this.minTime=void 0,this.maxTime=void 0,this.disabledRanges=void 0,this.allowCustomTime=!1,this.height=void 0,this.itemHeight=void 0,this.minTimeMessage=void 0,this.maxTimeMessage=void 0,this.rangeOrderMessage=void 0,this.disabledRangeMessage=void 0,this.noAvailableTimesMessage=void 0,this._workingIn=void 0,this._workingOut=void 0,this._popup=new Ot(this,{focusRestoreSelector:"gui-range-time input, gui-range-time button",focusPopupSelector:'.gui-time-list__option[tabindex="0"]',isDisabled:()=>!!this.disabled,clickIntent:e=>e.closest(".gui-time-list__option")?"ignore":e.closest(".gui-range-time-input__part")||e.closest(".gui-range-time-picker__panel")?"open":"toggle",keyToggleMode:"openClose",beforeOpen:e=>{this.querySelector(".gui-pills__dropdown")&&e.suppressNextFocusOut(),this.closePillsDropdown()},onOpenChanged:e=>{e||(this._workingIn=void 0,this._workingOut=void 0)}}),this.onDropdownToggle=e=>{e.detail?.open&&this._popup.open&&this._popup.close()},this.onToggleClick=e=>{e.stopPropagation(),this._popup.open?this._popup.close():this._popup.openAndFocus()}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("dropdowntoggle",this.onDropdownToggle)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("dropdowntoggle",this.onDropdownToggle)}get outListBounds(){if(!this._workingIn)return{minTime:this.minTime,maxTime:this.maxTime};const e=kn(this._workingIn,this.minuteStep);return e?{minTime:e,maxTime:this.maxTime}:{minTime:"23:59:59",maxTime:"00:00:00"}}render(){const e=Xe("rangeTimePicker",{icon:this.icon}),t=this.outListBounds,i=this.startTimeLabel??"Start time",a=this.endTimeLabel??"End time",r=this._popup.open?l.html`<div
1374
+ class="gui-range-time-picker__panel"
1375
+ id=${`${this.uid}_popup`}
1376
+ role="dialog"
1377
+ aria-label=${this.label??"Time list"}
1378
+ >
1200
1379
  <div class="gui-range-time-picker__column">
1201
1380
  <span class="gui-range-time-picker__column-label">${i}</span>
1202
1381
  <gui-time-list
@@ -1240,20 +1419,16 @@
1240
1419
  ></gui-time-list>
1241
1420
  </div>
1242
1421
  </div>`:l.nothing;return l.html`
1243
- ${se(this.uid??"",{label:this.label,hint:this.hint,required:this.required})}
1422
+ ${le(this.uid??"",{label:this.label,hint:this.hint,required:this.required},!1,void 0,!1)}
1244
1423
 
1245
1424
  <div
1246
- role="button"
1247
- tabindex="-1"
1248
1425
  class="gui-widget"
1249
- aria-expanded=${this._popup.open}
1250
- @keyup=${this._popup.onAnchorKeyUp}
1251
1426
  @keydown=${this._popup.onAnchorKeyDown}
1252
1427
  @click=${this._popup.onAnchorClick}
1253
1428
  >
1254
1429
  <gui-range-time
1255
1430
  id="time-input"
1256
- class=${w.classMap(e.widgetClasses)}
1431
+ class=${T.classMap(e.widgetClasses)}
1257
1432
  .uid=${this.uid}
1258
1433
  .hint=${this.hint}
1259
1434
  .showErrors=${!1}
@@ -1279,24 +1454,43 @@
1279
1454
  .removePillAriaLabel=${this.removePillAriaLabel}
1280
1455
  .startTimeAriaLabel=${this.startTimeAriaLabel}
1281
1456
  .endTimeAriaLabel=${this.endTimeAriaLabel}
1457
+ .hourAriaLabel=${this.hourAriaLabel}
1458
+ .minuteAriaLabel=${this.minuteAriaLabel}
1459
+ .dayPeriodAriaLabel=${this.dayPeriodAriaLabel}
1282
1460
  @blur=${this.onInputBlur}
1283
1461
  @focus=${this._popup.show}
1284
1462
  @change=${this.onInputChange}
1285
1463
  @partsChange=${this.onPartsChange}
1286
1464
  @pillClick=${this.onPillClick}
1287
1465
  ></gui-range-time>
1288
- <span class="gui-range-time-picker__arrow"
1289
- ><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256">
1466
+ <button
1467
+ type="button"
1468
+ class="gui-range-time-picker__arrow"
1469
+ aria-label=${this.toggleAriaLabel??"Show time list"}
1470
+ aria-haspopup="dialog"
1471
+ aria-expanded=${this._popup.open?"true":"false"}
1472
+ aria-controls=${`${this.uid}_popup`}
1473
+ ?disabled=${this.disabled}
1474
+ @click=${this.onToggleClick}
1475
+ >
1476
+ <svg
1477
+ xmlns="http://www.w3.org/2000/svg"
1478
+ width="16"
1479
+ height="16"
1480
+ viewBox="0 0 256 256"
1481
+ aria-hidden="true"
1482
+ >
1290
1483
  <path
1291
1484
  d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
1292
- ></path></svg
1293
- ></span>
1485
+ ></path>
1486
+ </svg>
1487
+ </button>
1294
1488
 
1295
1489
  ${r}
1296
1490
  </div>
1297
1491
 
1298
- ${this.showErrors?W(this.uid??"",{errors:this.errors,touched:this.touched}):""}
1299
- `}onInputChange(e){e.stopPropagation(),this._workingIn=void 0,this._workingOut=void 0,this.commitValue(e.detail.value)}onPartsChange(e){e.stopPropagation(),this._workingIn=e.detail.start??void 0,this._workingOut=e.detail.end??void 0}onInputBlur(){this.dispatchEvent(new CustomEvent("blur"))}onInListChange(e){e.stopPropagation();const t=e.detail.value;this._workingIn=t??void 0,this._workingOut=void 0,t&&this._inputRef?.fillGroup("start",t)}onOutListChange(e){e.stopPropagation();const t=e.detail.value;if(!this._workingIn||!t||!this._inputRef)return;this._inputRef.fillGroup("end",t),this._inputRef.commitFromParts()?(this._workingIn=void 0,this._workingOut=void 0,this.updateComplete.then(()=>{this._inListRef()?.scrollToSelectedValue?.()})):(this._popup.close(),this.dispatchEvent(new CustomEvent("blur")))}_inListRef(){return this.querySelector(".gui-range-time-picker__column:first-child gui-time-list")}commitValue(e){this.value=e??void 0;const t=this.validateBounds(this.value);this.dispatchEvent(new CustomEvent("change",{detail:{value:e??null},bubbles:!0,composed:!0})),t&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:t},bubbles:!0,composed:!0}))}validateBounds(e){if(!e||e.length===0)return null;for(const t of e){for(const i of[t.start,t.end])if(i){if(this.minTime&&Ae(i,this.minTime)<0)return this.minTimeMessage??gs;if(this.maxTime&&Ae(i,this.maxTime)>0)return this.maxTimeMessage??bs}if(Ps(t.start,t.end,this.disabledRanges))return this.disabledRangeMessage??qi}return null}onPillClick(){this._popup.show()}closePillsDropdown(){this.querySelector("gui-pills")?.closeDropdown?.()}};I([n.property({type:String})],E.prototype,"uid",2),I([n.property({type:String})],E.prototype,"label",2),I([n.property({type:String})],E.prototype,"hint",2),I([n.property({type:String})],E.prototype,"icon",2),I([n.property({type:Array})],E.prototype,"errors",2),I([n.property({type:Boolean})],E.prototype,"showErrors",2),I([n.property({type:Boolean})],E.prototype,"touched",2),I([n.property({type:Boolean})],E.prototype,"required",2),I([n.property({type:Boolean})],E.prototype,"disabled",2),I([n.property({type:Boolean,attribute:"readonly"})],E.prototype,"readOnly",2),I([n.property({type:String,attribute:"locale-id"})],E.prototype,"localeId",2),I([n.property({type:Array})],E.prototype,"value",2),I([n.property({type:String})],E.prototype,"separator",2),I([n.property({type:String,attribute:"remove-pill-aria-label"})],E.prototype,"removePillAriaLabel",2),I([n.property({type:String,attribute:"start-time-aria-label"})],E.prototype,"startTimeAriaLabel",2),I([n.property({type:String,attribute:"end-time-aria-label"})],E.prototype,"endTimeAriaLabel",2),I([n.property({type:String,attribute:"start-time-label"})],E.prototype,"startTimeLabel",2),I([n.property({type:String,attribute:"end-time-label"})],E.prototype,"endTimeLabel",2),I([n.property({type:String,attribute:"hour-format"})],E.prototype,"hourFormat",2),I([n.property({type:Number,attribute:"minute-step"})],E.prototype,"minuteStep",2),I([n.property({type:String,attribute:"min-time"})],E.prototype,"minTime",2),I([n.property({type:String,attribute:"max-time"})],E.prototype,"maxTime",2),I([n.property({type:Array,attribute:"disabled-ranges"})],E.prototype,"disabledRanges",2),I([n.property({type:Boolean,attribute:"allow-custom-time"})],E.prototype,"allowCustomTime",2),I([n.property({type:Number})],E.prototype,"height",2),I([n.property({type:Number,attribute:"item-height"})],E.prototype,"itemHeight",2),I([n.property({type:String,attribute:"min-time-message"})],E.prototype,"minTimeMessage",2),I([n.property({type:String,attribute:"max-time-message"})],E.prototype,"maxTimeMessage",2),I([n.property({type:String,attribute:"range-order-message"})],E.prototype,"rangeOrderMessage",2),I([n.property({type:String,attribute:"disabled-range-message"})],E.prototype,"disabledRangeMessage",2),I([n.property({type:String,attribute:"no-available-times-message"})],E.prototype,"noAvailableTimesMessage",2),I([n.query("#time-input")],E.prototype,"_inputRef",2),I([n.query("#list-panel")],E.prototype,"_panelRef",2),I([n.state()],E.prototype,"_workingIn",2),I([n.state()],E.prototype,"_workingOut",2),E=I([n.customElement("gui-range-time-picker")],E),typeof customElements<"u"&&!customElements.get("gui-range-time-picker")&&customElements.define("gui-range-time-picker",E);var ah=Object.defineProperty,rh=Object.getOwnPropertyDescriptor,qa=(e,t,i,a)=>{for(var r=a>1?void 0:a?rh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&ah(t,i,r),r};let Jt=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-range-time-picker","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=this.adapter.templateData;return l.html`
1492
+ ${this.showErrors?j(this.uid??"",{errors:this.errors,touched:this.touched}):""}
1493
+ `}onInputChange(e){e.stopPropagation(),this._workingIn=void 0,this._workingOut=void 0,this.commitValue(e.detail.value)}onPartsChange(e){e.stopPropagation(),this._workingIn=e.detail.start??void 0,this._workingOut=e.detail.end??void 0}onInputBlur(){this.dispatchEvent(new CustomEvent("blur"))}onInListChange(e){e.stopPropagation();const t=e.detail.value;this._workingIn=t??void 0,this._workingOut=void 0,t&&this._inputRef?.fillGroup("start",t)}onOutListChange(e){e.stopPropagation();const t=e.detail.value;if(!this._workingIn||!t||!this._inputRef)return;this._inputRef.fillGroup("end",t),this._inputRef.commitFromParts()?(this._workingIn=void 0,this._workingOut=void 0,this.updateComplete.then(()=>{this._inListRef()?.scrollToSelectedValue?.()})):(this._popup.close(),this.dispatchEvent(new CustomEvent("blur")))}_inListRef(){return this.querySelector(".gui-range-time-picker__column:first-child gui-time-list")}commitValue(e){this.value=e??void 0;const t=this.validateBounds(this.value);this.dispatchEvent(new CustomEvent("change",{detail:{value:e??null},bubbles:!0,composed:!0})),t&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:t},bubbles:!0,composed:!0}))}validateBounds(e){if(!e||e.length===0)return null;for(const t of e){for(const i of[t.start,t.end])if(i){if(this.minTime&&Re(i,this.minTime)<0)return this.minTimeMessage??dn;if(this.maxTime&&Re(i,this.maxTime)>0)return this.maxTimeMessage??pn}if(Tn(t.start,t.end,this.disabledRanges))return this.disabledRangeMessage??zi}return null}onPillClick(){this._popup.show()}closePillsDropdown(){this.querySelector("gui-pills")?.closeDropdown?.()}};P([n.property({type:String})],L.prototype,"uid",2),P([n.property({type:String})],L.prototype,"label",2),P([n.property({type:String})],L.prototype,"hint",2),P([n.property({type:String})],L.prototype,"icon",2),P([n.property({type:String,attribute:"toggle-aria-label"})],L.prototype,"toggleAriaLabel",2),P([n.property({type:String})],L.prototype,"hourAriaLabel",2),P([n.property({type:String})],L.prototype,"minuteAriaLabel",2),P([n.property({type:String})],L.prototype,"dayPeriodAriaLabel",2),P([n.property({type:Array})],L.prototype,"errors",2),P([n.property({type:Boolean})],L.prototype,"showErrors",2),P([n.property({type:Boolean})],L.prototype,"touched",2),P([n.property({type:Boolean})],L.prototype,"required",2),P([n.property({type:Boolean})],L.prototype,"disabled",2),P([n.property({type:Boolean,attribute:"readonly"})],L.prototype,"readOnly",2),P([n.property({type:String,attribute:"locale-id"})],L.prototype,"localeId",2),P([n.property({type:Array})],L.prototype,"value",2),P([n.property({type:String})],L.prototype,"separator",2),P([n.property({type:String,attribute:"remove-pill-aria-label"})],L.prototype,"removePillAriaLabel",2),P([n.property({type:String,attribute:"start-time-aria-label"})],L.prototype,"startTimeAriaLabel",2),P([n.property({type:String,attribute:"end-time-aria-label"})],L.prototype,"endTimeAriaLabel",2),P([n.property({type:String,attribute:"start-time-label"})],L.prototype,"startTimeLabel",2),P([n.property({type:String,attribute:"end-time-label"})],L.prototype,"endTimeLabel",2),P([n.property({type:String,attribute:"hour-format"})],L.prototype,"hourFormat",2),P([n.property({type:Number,attribute:"minute-step"})],L.prototype,"minuteStep",2),P([n.property({type:String,attribute:"min-time"})],L.prototype,"minTime",2),P([n.property({type:String,attribute:"max-time"})],L.prototype,"maxTime",2),P([n.property({type:Array,attribute:"disabled-ranges"})],L.prototype,"disabledRanges",2),P([n.property({type:Boolean,attribute:"allow-custom-time"})],L.prototype,"allowCustomTime",2),P([n.property({type:Number})],L.prototype,"height",2),P([n.property({type:Number,attribute:"item-height"})],L.prototype,"itemHeight",2),P([n.property({type:String,attribute:"min-time-message"})],L.prototype,"minTimeMessage",2),P([n.property({type:String,attribute:"max-time-message"})],L.prototype,"maxTimeMessage",2),P([n.property({type:String,attribute:"range-order-message"})],L.prototype,"rangeOrderMessage",2),P([n.property({type:String,attribute:"disabled-range-message"})],L.prototype,"disabledRangeMessage",2),P([n.property({type:String,attribute:"no-available-times-message"})],L.prototype,"noAvailableTimesMessage",2),P([n.query("#time-input")],L.prototype,"_inputRef",2),P([n.state()],L.prototype,"_workingIn",2),P([n.state()],L.prototype,"_workingOut",2),L=P([n.customElement("gui-range-time-picker")],L),typeof customElements<"u"&&!customElements.get("gui-range-time-picker")&&customElements.define("gui-range-time-picker",L);var cc=Object.defineProperty,mc=Object.getOwnPropertyDescriptor,Cr=(e,t,i,a)=>{for(var r=a>1?void 0:a?mc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&cc(t,i,r),r};let ti=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-range-time-picker","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=this.adapter.templateData;return l.html`
1300
1494
  <gui-range-time-picker
1301
1495
  .uid=${this.widget.uid}
1302
1496
  .label=${e.label}
@@ -1309,6 +1503,10 @@
1309
1503
  .value=${e.value}
1310
1504
  .icon=${e.icon}
1311
1505
  .localeId=${e.lang}
1506
+ .toggleAriaLabel=${e.toggleAriaLabel}
1507
+ .hourAriaLabel=${e.hourAriaLabel}
1508
+ .minuteAriaLabel=${e.minuteAriaLabel}
1509
+ .dayPeriodAriaLabel=${e.dayPeriodAriaLabel}
1312
1510
  .separator=${e.separator}
1313
1511
  .removePillAriaLabel=${e.removePillAriaLabel}
1314
1512
  .startTimeAriaLabel=${e.startTimeAriaLabel}
@@ -1332,8 +1530,8 @@
1332
1530
  @blur=${()=>this.adapter.onBlur()}
1333
1531
  @change=${this.valueChanged}
1334
1532
  ></gui-range-time-picker>
1335
- `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};qa([b.consume({context:m.formContext}),n.property({attribute:!1})],Jt.prototype,"formContext",2),qa([b.provide({context:m.inputContext})],Jt.prototype,"adapter",2),Jt=qa([n.customElement("gui-range-time-picker-input")],Jt);const sh=Object.freeze(Object.defineProperty({__proto__:null,get RangeTimePickerElement(){return Jt}},Symbol.toStringTag,{value:"Module"})),Ks=/^[0-9.,eE+-]+$/;function Xs(e){const t=e.data??e.dataTransfer?.getData("text");t&&(Ks.test(t)||e.preventDefault())}function Js(e){e.ctrlKey||e.metaKey||e.altKey||e.isComposing||e.key.length===1&&(Ks.test(e.key)||e.preventDefault())}var nh=Object.defineProperty,oh=Object.getOwnPropertyDescriptor,ce=(e,t,i,a)=>{for(var r=a>1?void 0:a?oh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&nh(t,i,r),r};let ue=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId=void 0,this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.currency=void 0,this.step=void 0,this.maximumFractionDigits=void 0,this.minimumFractionDigits=void 0,this.hint=void 0,this.icon=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){e.has("value")&&document.activeElement!==this.inputElement&&(this.displayValue=this.formatCurrency(this.value))}render(){super.render();const e={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,currency:this.currency,maximumFractionDigits:this.maximumFractionDigits,minimumFractionDigits:this.minimumFractionDigits,icon:this.icon,placeholder:this.placeholder,autocomplete:this.autocomplete};this.displayValue=this.formatCurrency(this.value);const t=Ke("currency",e),i={"gui-widget-input":!0,"gui-currency--icon":!!this.icon};return l.html`
1336
- ${se(this.uid,e)}
1533
+ `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Cr([f.consume({context:m.formContext}),n.property({attribute:!1})],ti.prototype,"formContext",2),Cr([f.provide({context:m.inputContext})],ti.prototype,"adapter",2),ti=Cr([n.customElement("gui-range-time-picker-input")],ti);const yc=Object.freeze(Object.defineProperty({__proto__:null,get RangeTimePickerElement(){return ti}},Symbol.toStringTag,{value:"Module"})),Vn=/^[0-9.,eE+-]+$/;function Un(e){const t=e.data??e.dataTransfer?.getData("text");t&&(Vn.test(t)||e.preventDefault())}function Zn(e){e.ctrlKey||e.metaKey||e.altKey||e.isComposing||e.key.length===1&&(Vn.test(e.key)||e.preventDefault())}var gc=Object.defineProperty,bc=Object.getOwnPropertyDescriptor,ve=(e,t,i,a)=>{for(var r=a>1?void 0:a?bc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&gc(t,i,r),r};let me=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId=void 0,this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.currency=void 0,this.step=void 0,this.maximumFractionDigits=void 0,this.minimumFractionDigits=void 0,this.hint=void 0,this.icon=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){e.has("value")&&document.activeElement!==this.inputElement&&(this.displayValue=this.formatCurrency(this.value))}render(){super.render();const e={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,currency:this.currency,maximumFractionDigits:this.maximumFractionDigits,minimumFractionDigits:this.minimumFractionDigits,icon:this.icon,placeholder:this.placeholder,autocomplete:this.autocomplete};this.displayValue=this.formatCurrency(this.value);const t=Xe("currency",e),i={"gui-widget-input":!0,"gui-currency--icon":!!this.icon};return l.html`
1534
+ ${le(this.uid,e)}
1337
1535
 
1338
1536
  <div class="gui-widget">
1339
1537
  <input
@@ -1341,30 +1539,30 @@
1341
1539
  inputmode="decimal"
1342
1540
  id=${this.uid}
1343
1541
  data-cy=${`${this.uid}_currency`}
1344
- class=${w.classMap(i)}
1542
+ class=${T.classMap(i)}
1345
1543
  step=${this.step&&this.step>0?this.step:l.nothing}
1346
1544
  .value=${this.value??""}
1347
- ?required=${this.disabled}
1545
+ ?required=${this.required}
1348
1546
  ?disabled=${this.disabled}
1349
1547
  ?readonly=${this.readOnly}
1350
1548
  placeholder=${this.placeholder||l.nothing}
1351
1549
  autocomplete=${this.autocomplete||l.nothing}
1352
1550
  @input=${this.handleInput}
1353
- @beforeinput=${Xs}
1354
- @keydown=${Js}
1551
+ @beforeinput=${Un}
1552
+ @keydown=${Zn}
1355
1553
  @focus=${this.handleFocus}
1356
1554
  @blur=${this.handleBlur}
1357
1555
  />
1358
- ${this.displayValue?l.html`<label
1359
- for=${this.uid}
1556
+ ${this.displayValue?l.html`<span
1557
+ aria-hidden="true"
1360
1558
  class="gui-currency__format-value ${this.icon?"gui-currency__format-value--icon":""}"
1361
- >${this.displayValue}</label
1559
+ >${this.displayValue}</span
1362
1560
  >`:l.nothing}
1363
1561
  ${t.html}
1364
1562
  </div>
1365
1563
 
1366
- ${W(this.uid,e)}
1367
- `}handleInput(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.displayValue=this.formatCurrency(t.valueAsNumber);const i=t.valueAsNumber;this.dispatchEvent(new CustomEvent("input",{detail:{value:Number.isNaN(i)?void 0:i},bubbles:!0,composed:!0}))}}handleFocus(){this.displayValue=this.formatCurrency(this.value)}handleBlur(){this.displayValue=this.formatCurrency(this.value),this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}formatCurrency(e){if(e===""||e===void 0||e===null||isNaN(e))return"";try{const t=this.maximumFractionDigits??Math.max(this.minimumFractionDigits??2,2),i=Math.min(this.minimumFractionDigits??2,t);return new Intl.NumberFormat(this.localeId??"en",{style:"currency",currency:this.currency??"USD",maximumFractionDigits:t,minimumFractionDigits:i}).format(e)}catch(t){return console.warn("Invalid locale or currency",t),e.toString()}}get separators(){const e=new Intl.NumberFormat(this.localeId??"en").format(1111.1);return{group:e.replace(/1/g,"").replace(/\d/g,"")[0]||",",decimal:e.replace(/1/g,"").replace(/\d/g,"").slice(-1)||"."}}};ce([n.property({type:String})],ue.prototype,"uid",2),ce([n.property({type:String})],ue.prototype,"label",2),ce([n.property({type:String,attribute:"locale-id"})],ue.prototype,"localeId",2),ce([n.property({type:Array})],ue.prototype,"errors",2),ce([n.property({type:Boolean})],ue.prototype,"touched",2),ce([n.property({type:Boolean})],ue.prototype,"required",2),ce([n.property({type:Boolean})],ue.prototype,"disabled",2),ce([n.property({type:Boolean,attribute:"readonly"})],ue.prototype,"readOnly",2),ce([n.property({type:String})],ue.prototype,"value",2),ce([n.property({type:String})],ue.prototype,"currency",2),ce([n.property({type:String})],ue.prototype,"step",2),ce([n.property({type:String})],ue.prototype,"maximumFractionDigits",2),ce([n.property({type:String})],ue.prototype,"minimumFractionDigits",2),ce([n.property({type:String})],ue.prototype,"hint",2),ce([n.property({type:String})],ue.prototype,"icon",2),ce([n.property({type:String})],ue.prototype,"placeholder",2),ce([n.property({type:String})],ue.prototype,"autocomplete",2),ce([n.state()],ue.prototype,"displayValue",2),ce([n.query("input")],ue.prototype,"inputElement",2),ue=ce([n.customElement("gui-currency")],ue),typeof customElements<"u"&&!customElements.get("gui-currency")&&customElements.define("gui-currency",ue);var lh=Object.defineProperty,uh=Object.getOwnPropertyDescriptor,Na=(e,t,i,a)=>{for(var r=a>1?void 0:a?uh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&lh(t,i,r),r};let Qt=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-currency","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
1564
+ ${j(this.uid,e)}
1565
+ `}handleInput(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.displayValue=this.formatCurrency(t.valueAsNumber);const i=t.valueAsNumber;this.dispatchEvent(new CustomEvent("input",{detail:{value:Number.isNaN(i)?void 0:i},bubbles:!0,composed:!0}))}}handleFocus(){this.displayValue=this.formatCurrency(this.value)}handleBlur(){this.displayValue=this.formatCurrency(this.value),this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}formatCurrency(e){if(e===""||e===void 0||e===null||isNaN(e))return"";try{const t=this.maximumFractionDigits??Math.max(this.minimumFractionDigits??2,2),i=Math.min(this.minimumFractionDigits??2,t);return new Intl.NumberFormat(this.localeId??"en",{style:"currency",currency:this.currency??"USD",maximumFractionDigits:t,minimumFractionDigits:i}).format(e)}catch(t){return console.warn("Invalid locale or currency",t),e.toString()}}get separators(){const e=new Intl.NumberFormat(this.localeId??"en").format(1111.1);return{group:e.replace(/1/g,"").replace(/\d/g,"")[0]||",",decimal:e.replace(/1/g,"").replace(/\d/g,"").slice(-1)||"."}}};ve([n.property({type:String})],me.prototype,"uid",2),ve([n.property({type:String})],me.prototype,"label",2),ve([n.property({type:String,attribute:"locale-id"})],me.prototype,"localeId",2),ve([n.property({type:Array})],me.prototype,"errors",2),ve([n.property({type:Boolean})],me.prototype,"touched",2),ve([n.property({type:Boolean})],me.prototype,"required",2),ve([n.property({type:Boolean})],me.prototype,"disabled",2),ve([n.property({type:Boolean,attribute:"readonly"})],me.prototype,"readOnly",2),ve([n.property({type:String})],me.prototype,"value",2),ve([n.property({type:String})],me.prototype,"currency",2),ve([n.property({type:String})],me.prototype,"step",2),ve([n.property({type:String})],me.prototype,"maximumFractionDigits",2),ve([n.property({type:String})],me.prototype,"minimumFractionDigits",2),ve([n.property({type:String})],me.prototype,"hint",2),ve([n.property({type:String})],me.prototype,"icon",2),ve([n.property({type:String})],me.prototype,"placeholder",2),ve([n.property({type:String})],me.prototype,"autocomplete",2),ve([n.state()],me.prototype,"displayValue",2),ve([n.query("input")],me.prototype,"inputElement",2),me=ve([n.customElement("gui-currency")],me),typeof customElements<"u"&&!customElements.get("gui-currency")&&customElements.define("gui-currency",me);var fc=Object.defineProperty,vc=Object.getOwnPropertyDescriptor,Lr=(e,t,i,a)=>{for(var r=a>1?void 0:a?vc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&fc(t,i,r),r};let ii=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-currency","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
1368
1566
  <gui-currency
1369
1567
  .uid=${this.widget.uid}
1370
1568
  .label=${this.adapter.templateData.label}
@@ -1386,23 +1584,29 @@
1386
1584
  @input=${this.valueChanged}
1387
1585
  @blur=${()=>this.adapter.onBlur()}
1388
1586
  ></gui-currency>
1389
- `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Na([b.consume({context:m.formContext}),n.property({attribute:!1})],Qt.prototype,"formContext",2),Na([b.provide({context:m.inputContext})],Qt.prototype,"adapter",2),Qt=Na([n.customElement("gui-currency-input")],Qt);const ph=Object.freeze(Object.defineProperty({__proto__:null,get CurrencyElement(){return Qt}},Symbol.toStringTag,{value:"Module"}));var dh=Object.defineProperty,hh=Object.getOwnPropertyDescriptor,Se=(e,t,i,a)=>{for(var r=a>1?void 0:a?hh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&dh(t,i,r),r};let ye=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.icon="",this.hint=void 0,this.value=void 0,this.invalidDateMessage=void 0,this.minDate=void 0,this.maxDate=void 0,this.minDateMessage=void 0,this.maxDateMessage=void 0,this.inputBlockClass="gui-date-input",this.groups=["default"],this.partDescriptors=xa(),this._parts=new Et(this,{blockClass:this.inputBlockClass,groups:this.groups,getDescriptor:e=>this.getPartDescriptor(e),commitGroup:e=>this.validateAndEmit(e),isReadonly:()=>!!this.readOnly,isDisabled:()=>!!this.disabled,onEmptyPartBlur:()=>this.dispatchEvent(new CustomEvent("change",{detail:{value:null},bubbles:!0}))}),this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`.${this.inputBlockClass}`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}getPartDescriptor(e){return this.partDescriptors[e]}willUpdate(e){e.has("value")&&this._parts.setGroupFromISO("default",this.value??"","date")}render(){const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,icon:this.icon,hint:this.hint},t={blockClass:this.inputBlockClass,groups:this.groups,formatParts:vs(this.localeId),getDescriptor:a=>this.getPartDescriptor(a),getDisplayValue:this._parts.getPartDisplay,required:this.required,disabled:this.disabled,partsReadonly:!!this.readOnly},i={"gui-widget-icon":!0,[this.icon]:!0};return l.html`
1390
- ${this.label?se(this.uid,e):l.nothing}
1587
+ `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Lr([f.consume({context:m.formContext}),n.property({attribute:!1})],ii.prototype,"formContext",2),Lr([f.provide({context:m.inputContext})],ii.prototype,"adapter",2),ii=Lr([n.customElement("gui-currency-input")],ii);const Dc=Object.freeze(Object.defineProperty({__proto__:null,get CurrencyElement(){return ii}},Symbol.toStringTag,{value:"Module"}));var wc=Object.defineProperty,$c=Object.getOwnPropertyDescriptor,ge=(e,t,i,a)=>{for(var r=a>1?void 0:a?$c(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&wc(t,i,r),r};let pe=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.icon="",this.hint=void 0,this.dayAriaLabel=void 0,this.monthAriaLabel=void 0,this.yearAriaLabel=void 0,this.value=void 0,this.invalidDateMessage=void 0,this.minDate=void 0,this.maxDate=void 0,this.minDateMessage=void 0,this.maxDateMessage=void 0,this.inputBlockClass="gui-date-input",this.groups=["default"],this.partDescriptors=fr(),this._parts=new Pt(this,{blockClass:this.inputBlockClass,groups:this.groups,getDescriptor:e=>this.getPartDescriptor(e),commitGroup:e=>this.validateAndEmit(e),isReadonly:()=>!!this.readOnly,isDisabled:()=>!!this.disabled,onEmptyPartBlur:()=>this.dispatchEvent(new CustomEvent("change",{detail:{value:null},bubbles:!0}))}),this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`.${this.inputBlockClass}`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}getPartDescriptor(e){return this.partDescriptors[e]}willUpdate(e){e.has("value")&&this._parts.setGroupFromISO("default",this.value??"","date")}render(){const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,icon:this.icon,hint:this.hint},t={blockClass:this.inputBlockClass,groups:this.groups,formatParts:hn(this.localeId),getDescriptor:a=>this.getPartDescriptor(a),getDisplayValue:this._parts.getPartDisplay,getPartAriaLabel:(a,r)=>({day:this.dayAriaLabel,month:this.monthAriaLabel,year:this.yearAriaLabel})[r]??St[r],disabled:this.disabled,partsReadonly:!!this.readOnly},i={"gui-widget-icon":!0,[this.icon]:!0};return l.html`
1588
+ ${this.label?le(this.uid,e,!1,void 0,!1):l.nothing}
1391
1589
 
1392
1590
  <div class="gui-widget">
1393
1591
  <div
1592
+ id=${this.uid}
1394
1593
  class="gui-widget-input gui-parts gui-parts-ring gui-date-input ${this.icon?"gui-calendar--icon":""}"
1395
1594
  role="group"
1595
+ aria-labelledby=${`${this.uid}_label`}
1396
1596
  >
1397
- ${mt("default",t,this._parts)}
1597
+ ${yt("default",t,this._parts)}
1398
1598
  </div>
1399
- ${this.icon?l.html`<span class=${w.classMap(i)} data-icon=${this.icon}></span>`:l.nothing}
1599
+ ${this.icon?l.html`<span
1600
+ class=${T.classMap(i)}
1601
+ data-icon=${this.icon}
1602
+ aria-hidden="true"
1603
+ ></span>`:l.nothing}
1400
1604
  </div>
1401
1605
 
1402
- ${this.showErrors&&this.errors?.length?W(this.uid,e):l.nothing}
1403
- `}validateAndEmit(e){const{result:t,writeBacks:i}=zs(this._parts.values[e]??{},{descriptors:this.partDescriptors,invalidDateMessage:this.invalidDateMessage});if(this._parts.applyWriteBacks(e,i),t.kind==="invalid")this.dispatchEvent(new CustomEvent("inputError",{detail:{message:t.message},bubbles:!0}));else if(t.kind==="valid"){const a=Bt(t.iso,this.minDate,this.maxDate,void 0,{minDateMessage:this.minDateMessage,maxDateMessage:this.maxDateMessage});if(a){this.dispatchEvent(new CustomEvent("change",{detail:{value:t.iso},bubbles:!0})),this.dispatchEvent(new CustomEvent("inputError",{detail:{message:a},bubbles:!0})),this.requestUpdate();return}this.value=t.iso,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0}))}this.requestUpdate()}};Se([n.property({type:String})],ye.prototype,"uid",2),Se([n.property({type:String})],ye.prototype,"label",2),Se([n.property({type:String,attribute:"locale-id"})],ye.prototype,"localeId",2),Se([n.property({type:Array})],ye.prototype,"errors",2),Se([n.property({type:Boolean})],ye.prototype,"showErrors",2),Se([n.property({type:Boolean})],ye.prototype,"touched",2),Se([n.property({type:Boolean})],ye.prototype,"required",2),Se([n.property({type:Boolean})],ye.prototype,"disabled",2),Se([n.property({type:Boolean,attribute:"readonly"})],ye.prototype,"readOnly",2),Se([n.property({type:String})],ye.prototype,"icon",2),Se([n.property({type:String})],ye.prototype,"hint",2),Se([n.property({type:String})],ye.prototype,"value",2),Se([n.property({type:String,attribute:"invalid-date-message"})],ye.prototype,"invalidDateMessage",2),Se([n.property({type:String,attribute:"min-date"})],ye.prototype,"minDate",2),Se([n.property({type:String,attribute:"max-date"})],ye.prototype,"maxDate",2),Se([n.property({type:String,attribute:"min-date-message"})],ye.prototype,"minDateMessage",2),Se([n.property({type:String,attribute:"max-date-message"})],ye.prototype,"maxDateMessage",2),ye=Se([n.customElement("gui-date")],ye),typeof customElements<"u"&&!customElements.get("gui-date")&&customElements.define("gui-date",ye);var mh=Object.defineProperty,ch=Object.getOwnPropertyDescriptor,za=(e,t,i,a)=>{for(var r=a>1?void 0:a?ch(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&mh(t,i,r),r};let jt=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-date","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=Ke("date",this.adapter.templateData);return l.html`
1606
+ ${this.showErrors&&this.errors?.length?j(this.uid,e):l.nothing}
1607
+ `}validateAndEmit(e){const{result:t,writeBacks:i}=Mn(this._parts.values[e]??{},{descriptors:this.partDescriptors,invalidDateMessage:this.invalidDateMessage});if(this._parts.applyWriteBacks(e,i),t.kind==="invalid")this.dispatchEvent(new CustomEvent("inputError",{detail:{message:t.message},bubbles:!0}));else if(t.kind==="valid"){const a=Gt(t.iso,this.minDate,this.maxDate,void 0,{minDateMessage:this.minDateMessage,maxDateMessage:this.maxDateMessage});if(a){this.dispatchEvent(new CustomEvent("change",{detail:{value:t.iso},bubbles:!0})),this.dispatchEvent(new CustomEvent("inputError",{detail:{message:a},bubbles:!0})),this.requestUpdate();return}this.value=t.iso,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0}))}this.requestUpdate()}};ge([n.property({type:String})],pe.prototype,"uid",2),ge([n.property({type:String})],pe.prototype,"label",2),ge([n.property({type:String,attribute:"locale-id"})],pe.prototype,"localeId",2),ge([n.property({type:Array})],pe.prototype,"errors",2),ge([n.property({type:Boolean})],pe.prototype,"showErrors",2),ge([n.property({type:Boolean})],pe.prototype,"touched",2),ge([n.property({type:Boolean})],pe.prototype,"required",2),ge([n.property({type:Boolean})],pe.prototype,"disabled",2),ge([n.property({type:Boolean,attribute:"readonly"})],pe.prototype,"readOnly",2),ge([n.property({type:String})],pe.prototype,"icon",2),ge([n.property({type:String})],pe.prototype,"hint",2),ge([n.property({type:String})],pe.prototype,"dayAriaLabel",2),ge([n.property({type:String})],pe.prototype,"monthAriaLabel",2),ge([n.property({type:String})],pe.prototype,"yearAriaLabel",2),ge([n.property({type:String})],pe.prototype,"value",2),ge([n.property({type:String,attribute:"invalid-date-message"})],pe.prototype,"invalidDateMessage",2),ge([n.property({type:String,attribute:"min-date"})],pe.prototype,"minDate",2),ge([n.property({type:String,attribute:"max-date"})],pe.prototype,"maxDate",2),ge([n.property({type:String,attribute:"min-date-message"})],pe.prototype,"minDateMessage",2),ge([n.property({type:String,attribute:"max-date-message"})],pe.prototype,"maxDateMessage",2),pe=ge([n.customElement("gui-date")],pe),typeof customElements<"u"&&!customElements.get("gui-date")&&customElements.define("gui-date",pe);var kc=Object.defineProperty,Sc=Object.getOwnPropertyDescriptor,xr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Sc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&kc(t,i,r),r};let ai=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-date","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=Xe("date",this.adapter.templateData);return l.html`
1404
1608
  <gui-date
1405
- class=${w.classMap(e.widgetClasses)}
1609
+ class=${T.classMap(e.widgetClasses)}
1406
1610
  .uid=${this.widget.uid}
1407
1611
  .label=${this.adapter.templateData.label}
1408
1612
  .hint=${this.adapter.templateData.hint}
@@ -1414,6 +1618,9 @@
1414
1618
  .value=${this.adapter.templateData.value}
1415
1619
  .icon=${this.adapter.templateData.icon}
1416
1620
  .localeId=${this.adapter.templateData.lang}
1621
+ .dayAriaLabel=${this.adapter.templateData.dayAriaLabel}
1622
+ .monthAriaLabel=${this.adapter.templateData.monthAriaLabel}
1623
+ .yearAriaLabel=${this.adapter.templateData.yearAriaLabel}
1417
1624
  .invalidDateMessage=${this.adapter.templateData.invalidDateMessage}
1418
1625
  .minDate=${this.adapter.templateData.minDate}
1419
1626
  .maxDate=${this.adapter.templateData.maxDate}
@@ -1423,8 +1630,10 @@
1423
1630
  @blur=${()=>this.adapter.onBlur()}
1424
1631
  @change=${this.valueChanged}
1425
1632
  ></gui-date>
1426
- `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};za([b.consume({context:m.formContext}),n.property({attribute:!1})],jt.prototype,"formContext",2),za([b.provide({context:m.inputContext})],jt.prototype,"adapter",2),jt=za([n.customElement("gui-date-input")],jt);const yh=Object.freeze(Object.defineProperty({__proto__:null,get DateElement(){return jt}},Symbol.toStringTag,{value:"Module"}));var gh=Object.defineProperty,bh=Object.getOwnPropertyDescriptor,N=(e,t,i,a)=>{for(var r=a>1?void 0:a?bh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&gh(t,i,r),r};let R=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.icon="",this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.localeId=void 0,this.value=void 0,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel=void 0,this.nextMonthAriaLabel=void 0,this.dayFormat=void 0,this.weekdayFormat=void 0,this.monthFormat=void 0,this.minDate=void 0,this.maxDate=void 0,this.disabledRanges=void 0,this.numberOfMonths=void 0,this.invalidDateMessage=void 0,this.minDateMessage=void 0,this.maxDateMessage=void 0,this.disabledDateRangeMessage=void 0,this._popup=new Mt(this,{getInteriorElements:()=>[this._dateRef,this._calendarRef],focusRestoreSelector:"gui-date input",isDisabled:()=>!!this.disabled,clickIntent:e=>e.closest(".gui-calendar__day-button")?"ignore":e.closest(".gui-date-input__part")||e.closest("gui-calendar")?"open":"toggle",keyToggleMode:"toggle"})}createRenderRoot(){return this}render(){const e=Ke("datePicker",{icon:this.icon}),t=this._popup.open?l.html`<gui-calendar
1427
- id="calendar-input"
1633
+ `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};xr([f.consume({context:m.formContext}),n.property({attribute:!1})],ai.prototype,"formContext",2),xr([f.provide({context:m.inputContext})],ai.prototype,"adapter",2),ai=xr([n.customElement("gui-date-input")],ai);const Tc=Object.freeze(Object.defineProperty({__proto__:null,get DateElement(){return ai}},Symbol.toStringTag,{value:"Module"}));var _c=Object.defineProperty,Ac=Object.getOwnPropertyDescriptor,F=(e,t,i,a)=>{for(var r=a>1?void 0:a?Ac(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&_c(t,i,r),r};let M=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.icon="",this.toggleAriaLabel=void 0,this.dayAriaLabel=void 0,this.monthAriaLabel=void 0,this.yearAriaLabel=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.localeId=void 0,this.value=void 0,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel=void 0,this.nextMonthAriaLabel=void 0,this.selectYearAriaLabel=void 0,this.yearGridAriaLabel=void 0,this.dayFormat=void 0,this.weekdayFormat=void 0,this.monthFormat=void 0,this.minDate=void 0,this.maxDate=void 0,this.disabledRanges=void 0,this.numberOfMonths=void 0,this.invalidDateMessage=void 0,this.minDateMessage=void 0,this.maxDateMessage=void 0,this.disabledDateRangeMessage=void 0,this._popup=new Ot(this,{focusRestoreSelector:"gui-date input",focusPopupSelector:'.gui-calendar__day-button[tabindex="0"]',isDisabled:()=>!!this.disabled,clickIntent:e=>e.closest(".gui-calendar__day-button")?"ignore":e.closest(".gui-date-input__part")||e.closest("gui-calendar")?"open":"toggle",keyToggleMode:"toggle"}),this.onToggleClick=e=>{e.stopPropagation(),this._popup.open?this._popup.close():this._popup.openAndFocus()}}createRenderRoot(){return this}render(){const e=Xe("datePicker",{icon:this.icon}),t=this._popup.open?l.html`<gui-calendar
1634
+ id=${`${this.uid}_popup`}
1635
+ role="dialog"
1636
+ aria-label=${this.label??"Calendar"}
1428
1637
  .uid=${this.uid}
1429
1638
  .hint=${this.hint}
1430
1639
  ?touched=${this.touched}
@@ -1436,6 +1645,8 @@
1436
1645
  .nextMonthIcon=${this.nextMonthIcon}
1437
1646
  .prevMonthAriaLabel=${this.prevMonthAriaLabel}
1438
1647
  .nextMonthAriaLabel=${this.nextMonthAriaLabel}
1648
+ .selectYearAriaLabel=${this.selectYearAriaLabel}
1649
+ .yearGridAriaLabel=${this.yearGridAriaLabel}
1439
1650
  .dayFormat=${this.dayFormat}
1440
1651
  .weekdayFormat=${this.weekdayFormat}
1441
1652
  .monthFormat=${this.monthFormat}
@@ -1447,20 +1658,16 @@
1447
1658
  @blur=${this.onCalendarBlur}
1448
1659
  @change=${this.onCalendarChange}
1449
1660
  ></gui-calendar>`:l.nothing;return l.html`
1450
- ${se(this.uid??"",{label:this.label,hint:this.hint,required:this.required})}
1661
+ ${le(this.uid??"",{label:this.label,hint:this.hint,required:this.required},!1,void 0,!1)}
1451
1662
 
1452
1663
  <div
1453
- role="button"
1454
- tabindex="-1"
1455
1664
  class="gui-widget"
1456
- aria-expanded=${this._popup.open}
1457
- @keyup=${this._popup.onAnchorKeyUp}
1458
1665
  @keydown=${this._popup.onAnchorKeyDown}
1459
1666
  @click=${this._popup.onAnchorClick}
1460
1667
  >
1461
1668
  <gui-date
1462
1669
  id="date-input"
1463
- class=${w.classMap(e.widgetClasses)}
1670
+ class=${T.classMap(e.widgetClasses)}
1464
1671
  .uid=${this.uid}
1465
1672
  .hint=${this.hint}
1466
1673
  .showErrors=${!1}
@@ -1472,23 +1679,42 @@
1472
1679
  .value=${this.value}
1473
1680
  .icon=${this.icon}
1474
1681
  .localeId=${this.localeId}
1682
+ .dayAriaLabel=${this.dayAriaLabel}
1683
+ .monthAriaLabel=${this.monthAriaLabel}
1684
+ .yearAriaLabel=${this.yearAriaLabel}
1475
1685
  .invalidDateMessage=${this.invalidDateMessage}
1476
1686
  @blur=${this.onDateBlur}
1477
1687
  @focus=${this._popup.show}
1478
1688
  @change=${this.onDateChange}
1479
1689
  ></gui-date>
1480
- <span class="gui-date-picker__arrow"
1481
- ><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256">
1690
+ <button
1691
+ type="button"
1692
+ class="gui-date-picker__arrow"
1693
+ aria-label=${this.toggleAriaLabel??"Show calendar"}
1694
+ aria-haspopup="dialog"
1695
+ aria-expanded=${this._popup.open?"true":"false"}
1696
+ aria-controls=${`${this.uid}_popup`}
1697
+ ?disabled=${this.disabled}
1698
+ @click=${this.onToggleClick}
1699
+ >
1700
+ <svg
1701
+ xmlns="http://www.w3.org/2000/svg"
1702
+ width="16"
1703
+ height="16"
1704
+ viewBox="0 0 256 256"
1705
+ aria-hidden="true"
1706
+ >
1482
1707
  <path
1483
1708
  d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
1484
- ></path></svg
1485
- ></span>
1709
+ ></path>
1710
+ </svg>
1711
+ </button>
1486
1712
 
1487
1713
  ${t}
1488
1714
  </div>
1489
1715
 
1490
- ${this.showErrors?W(this.uid??"",{errors:this.errors,touched:this.touched}):""}
1491
- `}onDateChange(e){e.stopPropagation(),this.commitValue(e.detail.value)}onDateBlur(){this.dispatchEvent(new CustomEvent("blur"))}onCalendarChange(e){e.stopPropagation(),this.commitValue(e.detail.value),this._popup.close()}commitValue(e){this.value=e??void 0;const t=this.validateBounds(this.value);this.dispatchEvent(new CustomEvent("change",{detail:{value:e??null},bubbles:!0,composed:!0})),t&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:t},bubbles:!0,composed:!0}))}validateBounds(e){return e?Bt(e,this.minDate,this.maxDate,this.disabledRanges,{minDateMessage:this.minDateMessage,maxDateMessage:this.maxDateMessage,disabledDateRangeMessage:this.disabledDateRangeMessage}):null}onCalendarBlur(){this._popup.close()}};N([n.property({type:String})],R.prototype,"uid",2),N([n.property({type:String})],R.prototype,"label",2),N([n.property({type:String})],R.prototype,"hint",2),N([n.property({type:String})],R.prototype,"icon",2),N([n.property({type:Array})],R.prototype,"errors",2),N([n.property({type:Boolean})],R.prototype,"showErrors",2),N([n.property({type:Boolean})],R.prototype,"touched",2),N([n.property({type:Boolean})],R.prototype,"required",2),N([n.property({type:Boolean})],R.prototype,"disabled",2),N([n.property({type:Boolean,attribute:"readonly"})],R.prototype,"readOnly",2),N([n.property({type:String,attribute:"locale-id"})],R.prototype,"localeId",2),N([n.property({type:String})],R.prototype,"value",2),N([n.property({type:String,attribute:"prev-month-icon"})],R.prototype,"prevMonthIcon",2),N([n.property({type:String,attribute:"next-month-icon"})],R.prototype,"nextMonthIcon",2),N([n.property({type:String,attribute:"prev-month-aria-label"})],R.prototype,"prevMonthAriaLabel",2),N([n.property({type:String,attribute:"next-month-aria-label"})],R.prototype,"nextMonthAriaLabel",2),N([n.property({type:String,attribute:"day-format"})],R.prototype,"dayFormat",2),N([n.property({type:String,attribute:"weekday-format"})],R.prototype,"weekdayFormat",2),N([n.property({type:String,attribute:"month-format"})],R.prototype,"monthFormat",2),N([n.property({type:String,attribute:"min-date"})],R.prototype,"minDate",2),N([n.property({type:String,attribute:"max-date"})],R.prototype,"maxDate",2),N([n.property({type:Array,attribute:"disabled-ranges"})],R.prototype,"disabledRanges",2),N([n.property({type:Number,attribute:"number-of-months"})],R.prototype,"numberOfMonths",2),N([n.property({type:String,attribute:"invalid-date-message"})],R.prototype,"invalidDateMessage",2),N([n.property({type:String,attribute:"min-date-message"})],R.prototype,"minDateMessage",2),N([n.property({type:String,attribute:"max-date-message"})],R.prototype,"maxDateMessage",2),N([n.property({type:String,attribute:"disabled-date-range-message"})],R.prototype,"disabledDateRangeMessage",2),N([n.query("#date-input")],R.prototype,"_dateRef",2),N([n.query("#calendar-input")],R.prototype,"_calendarRef",2),R=N([n.customElement("gui-date-picker")],R),typeof customElements<"u"&&!customElements.get("gui-date-picker")&&customElements.define("gui-date-picker",R);var fh=Object.defineProperty,vh=Object.getOwnPropertyDescriptor,Va=(e,t,i,a)=>{for(var r=a>1?void 0:a?vh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&fh(t,i,r),r};let ei=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-date-picker","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=this.adapter.templateData;return l.html`
1716
+ ${this.showErrors?j(this.uid??"",{errors:this.errors,touched:this.touched}):""}
1717
+ `}onDateChange(e){e.stopPropagation(),this.commitValue(e.detail.value)}onDateBlur(){this.dispatchEvent(new CustomEvent("blur"))}onCalendarChange(e){e.stopPropagation(),this.commitValue(e.detail.value),this._popup.close()}commitValue(e){this.value=e??void 0;const t=this.validateBounds(this.value);this.dispatchEvent(new CustomEvent("change",{detail:{value:e??null},bubbles:!0,composed:!0})),t&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:t},bubbles:!0,composed:!0}))}validateBounds(e){return e?Gt(e,this.minDate,this.maxDate,this.disabledRanges,{minDateMessage:this.minDateMessage,maxDateMessage:this.maxDateMessage,disabledDateRangeMessage:this.disabledDateRangeMessage}):null}onCalendarBlur(){this._popup.closeOnFocusLeave()}};F([n.property({type:String})],M.prototype,"uid",2),F([n.property({type:String})],M.prototype,"label",2),F([n.property({type:String})],M.prototype,"hint",2),F([n.property({type:String})],M.prototype,"icon",2),F([n.property({type:String,attribute:"toggle-aria-label"})],M.prototype,"toggleAriaLabel",2),F([n.property({type:String})],M.prototype,"dayAriaLabel",2),F([n.property({type:String})],M.prototype,"monthAriaLabel",2),F([n.property({type:String})],M.prototype,"yearAriaLabel",2),F([n.property({type:Array})],M.prototype,"errors",2),F([n.property({type:Boolean})],M.prototype,"showErrors",2),F([n.property({type:Boolean})],M.prototype,"touched",2),F([n.property({type:Boolean})],M.prototype,"required",2),F([n.property({type:Boolean})],M.prototype,"disabled",2),F([n.property({type:Boolean,attribute:"readonly"})],M.prototype,"readOnly",2),F([n.property({type:String,attribute:"locale-id"})],M.prototype,"localeId",2),F([n.property({type:String})],M.prototype,"value",2),F([n.property({type:String,attribute:"prev-month-icon"})],M.prototype,"prevMonthIcon",2),F([n.property({type:String,attribute:"next-month-icon"})],M.prototype,"nextMonthIcon",2),F([n.property({type:String,attribute:"prev-month-aria-label"})],M.prototype,"prevMonthAriaLabel",2),F([n.property({type:String,attribute:"next-month-aria-label"})],M.prototype,"nextMonthAriaLabel",2),F([n.property({type:String,attribute:"select-year-aria-label"})],M.prototype,"selectYearAriaLabel",2),F([n.property({type:String,attribute:"year-grid-aria-label"})],M.prototype,"yearGridAriaLabel",2),F([n.property({type:String,attribute:"day-format"})],M.prototype,"dayFormat",2),F([n.property({type:String,attribute:"weekday-format"})],M.prototype,"weekdayFormat",2),F([n.property({type:String,attribute:"month-format"})],M.prototype,"monthFormat",2),F([n.property({type:String,attribute:"min-date"})],M.prototype,"minDate",2),F([n.property({type:String,attribute:"max-date"})],M.prototype,"maxDate",2),F([n.property({type:Array,attribute:"disabled-ranges"})],M.prototype,"disabledRanges",2),F([n.property({type:Number,attribute:"number-of-months"})],M.prototype,"numberOfMonths",2),F([n.property({type:String,attribute:"invalid-date-message"})],M.prototype,"invalidDateMessage",2),F([n.property({type:String,attribute:"min-date-message"})],M.prototype,"minDateMessage",2),F([n.property({type:String,attribute:"max-date-message"})],M.prototype,"maxDateMessage",2),F([n.property({type:String,attribute:"disabled-date-range-message"})],M.prototype,"disabledDateRangeMessage",2),M=F([n.customElement("gui-date-picker")],M),typeof customElements<"u"&&!customElements.get("gui-date-picker")&&customElements.define("gui-date-picker",M);var Cc=Object.defineProperty,Lc=Object.getOwnPropertyDescriptor,Er=(e,t,i,a)=>{for(var r=a>1?void 0:a?Lc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Cc(t,i,r),r};let ri=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-date-picker","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=this.adapter.templateData;return l.html`
1492
1718
  <gui-date-picker
1493
1719
  .uid=${this.widget.uid}
1494
1720
  .label=${e.label}
@@ -1501,10 +1727,16 @@
1501
1727
  .value=${e.value}
1502
1728
  .icon=${e.icon}
1503
1729
  .localeId=${e.lang}
1730
+ .toggleAriaLabel=${e.toggleAriaLabel}
1731
+ .dayAriaLabel=${e.dayAriaLabel}
1732
+ .monthAriaLabel=${e.monthAriaLabel}
1733
+ .yearAriaLabel=${e.yearAriaLabel}
1504
1734
  .prevMonthIcon=${e.prevMonthIcon}
1505
1735
  .nextMonthIcon=${e.nextMonthIcon}
1506
1736
  .prevMonthAriaLabel=${e.prevMonthAriaLabel}
1507
1737
  .nextMonthAriaLabel=${e.nextMonthAriaLabel}
1738
+ .selectYearAriaLabel=${e.selectYearAriaLabel}
1739
+ .yearGridAriaLabel=${e.yearGridAriaLabel}
1508
1740
  .dayFormat=${e.dayFormat}
1509
1741
  .weekdayFormat=${e.weekdayFormat}
1510
1742
  .monthFormat=${e.monthFormat}
@@ -1520,22 +1752,30 @@
1520
1752
  @blur=${()=>this.adapter.onBlur()}
1521
1753
  @change=${this.valueChanged}
1522
1754
  ></gui-date-picker>
1523
- `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Va([b.consume({context:m.formContext}),n.property({attribute:!1})],ei.prototype,"formContext",2),Va([b.provide({context:m.inputContext})],ei.prototype,"adapter",2),ei=Va([n.customElement("gui-date-picker-input")],ei);const Dh=Object.freeze(Object.defineProperty({__proto__:null,get DatePickerElement(){return ei}},Symbol.toStringTag,{value:"Module"}));var wh=Object.defineProperty,$h=Object.getOwnPropertyDescriptor,re=(e,t,i,a)=>{for(var r=a>1?void 0:a?$h(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&wh(t,i,r),r};let te=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.icon="",this.hint=void 0,this.hourFormat=void 0,this.minuteStep=1,this.invalidDateMessage=void 0,this.value=void 0,this.minDate=void 0,this.maxDate=void 0,this.minTime=void 0,this.maxTime=void 0,this.minDateMessage=void 0,this.maxDateMessage=void 0,this.minTimeMessage=void 0,this.maxTimeMessage=void 0,this.inputBlockClass="gui-date-time-input",this.groups=["default"],this._parts=new Et(this,{blockClass:this.inputBlockClass,groups:this.groups,getDescriptor:e=>this.getPartDescriptor(e),commitGroup:e=>this.validateAndEmit(e),isReadonly:()=>!!this.readOnly,isDisabled:()=>!!this.disabled,onEmptyPartBlur:()=>this.dispatchEvent(new CustomEvent("change",{detail:{value:null},bubbles:!0})),getHourFormat:()=>this.localeData.effectiveHourFormat,getDayPeriodLabels:()=>this.localeData.dayPeriodLabels}),this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`.${this.inputBlockClass}`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}get localeData(){return Ji(this.localeId,this.hourFormat,this.minuteStep,!0)}getPartDescriptor(e){return this.localeData.descriptors[e]}boundsError(e,t){return Bt(e,this.minDate,this.maxDate,void 0,{minDateMessage:this.minDateMessage,maxDateMessage:this.maxDateMessage})??Ea(ht(t),{minTime:this.minTime,maxTime:this.maxTime,minTimeMessage:this.minTimeMessage,maxTimeMessage:this.maxTimeMessage})}willUpdate(e){(!this.hasUpdated||e.has("value")||e.has("hourFormat")||e.has("localeId"))&&this._parts.setGroupFromISO("default",this.value??"","dateTime",this.localeData.effectiveHourFormat)}render(){const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,icon:this.icon,hint:this.hint},t={blockClass:this.inputBlockClass,groups:this.groups,formatParts:xs(this.localeId,this.localeData.effectiveHourFormat),getDescriptor:a=>this.getPartDescriptor(a),getDisplayValue:this._parts.getPartDisplay,required:this.required,disabled:this.disabled,partsReadonly:!!this.readOnly},i={"gui-widget-icon":!0,[this.icon]:!0};return l.html`
1524
- ${this.label?se(this.uid,e):l.nothing}
1755
+ `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Er([f.consume({context:m.formContext}),n.property({attribute:!1})],ri.prototype,"formContext",2),Er([f.provide({context:m.inputContext})],ri.prototype,"adapter",2),ri=Er([n.customElement("gui-date-picker-input")],ri);const xc=Object.freeze(Object.defineProperty({__proto__:null,get DatePickerElement(){return ri}},Symbol.toStringTag,{value:"Module"}));var Ec=Object.defineProperty,Pc=Object.getOwnPropertyDescriptor,K=(e,t,i,a)=>{for(var r=a>1?void 0:a?Pc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Ec(t,i,r),r};let U=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.icon="",this.hint=void 0,this.dayAriaLabel=void 0,this.monthAriaLabel=void 0,this.yearAriaLabel=void 0,this.hourAriaLabel=void 0,this.minuteAriaLabel=void 0,this.dayPeriodAriaLabel=void 0,this.hourFormat=void 0,this.minuteStep=1,this.invalidDateMessage=void 0,this.value=void 0,this.minDate=void 0,this.maxDate=void 0,this.minTime=void 0,this.maxTime=void 0,this.minDateMessage=void 0,this.maxDateMessage=void 0,this.minTimeMessage=void 0,this.maxTimeMessage=void 0,this.inputBlockClass="gui-date-time-input",this.groups=["default"],this._parts=new Pt(this,{blockClass:this.inputBlockClass,groups:this.groups,getDescriptor:e=>this.getPartDescriptor(e),commitGroup:e=>this.validateAndEmit(e),isReadonly:()=>!!this.readOnly,isDisabled:()=>!!this.disabled,onEmptyPartBlur:()=>this.dispatchEvent(new CustomEvent("change",{detail:{value:null},bubbles:!0})),getHourFormat:()=>this.localeData.effectiveHourFormat,getDayPeriodLabels:()=>this.localeData.dayPeriodLabels}),this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`.${this.inputBlockClass}`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}get localeData(){return ia(this.localeId,this.hourFormat,this.minuteStep,!0)}getPartDescriptor(e){return this.localeData.descriptors[e]}boundsError(e,t){return Gt(e,this.minDate,this.maxDate,void 0,{minDateMessage:this.minDateMessage,maxDateMessage:this.maxDateMessage})??ta(mt(t),{minTime:this.minTime,maxTime:this.maxTime,minTimeMessage:this.minTimeMessage,maxTimeMessage:this.maxTimeMessage})}willUpdate(e){(!this.hasUpdated||e.has("value")||e.has("hourFormat")||e.has("localeId"))&&this._parts.setGroupFromISO("default",this.value??"","dateTime",this.localeData.effectiveHourFormat)}render(){const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,icon:this.icon,hint:this.hint},t={blockClass:this.inputBlockClass,groups:this.groups,formatParts:$n(this.localeId,this.localeData.effectiveHourFormat),getDescriptor:a=>this.getPartDescriptor(a),getDisplayValue:this._parts.getPartDisplay,getPartAriaLabel:(a,r)=>({day:this.dayAriaLabel,month:this.monthAriaLabel,year:this.yearAriaLabel,hour:this.hourAriaLabel,minute:this.minuteAriaLabel})[r]??St[r],dayPeriodAriaLabel:this.dayPeriodAriaLabel,disabled:this.disabled,partsReadonly:!!this.readOnly},i={"gui-widget-icon":!0,[this.icon]:!0};return l.html`
1756
+ ${this.label?le(this.uid,e,!1,void 0,!1):l.nothing}
1525
1757
 
1526
1758
  <div class="gui-widget">
1527
1759
  <div
1760
+ id=${this.uid}
1528
1761
  class="gui-widget-input gui-parts gui-parts-ring gui-date-time-input ${this.icon?"gui-calendar--icon":""}"
1529
1762
  role="group"
1763
+ aria-labelledby=${`${this.uid}_label`}
1530
1764
  >
1531
- ${mt("default",t,this._parts)}
1765
+ ${yt("default",t,this._parts)}
1532
1766
  </div>
1533
- ${this.icon?l.html`<span class=${w.classMap(i)} data-icon=${this.icon}></span>`:l.nothing}
1767
+ ${this.icon?l.html`<span
1768
+ class=${T.classMap(i)}
1769
+ data-icon=${this.icon}
1770
+ aria-hidden="true"
1771
+ ></span>`:l.nothing}
1534
1772
  </div>
1535
1773
 
1536
- ${this.showErrors&&this.errors?.length?W(this.uid,e):l.nothing}
1537
- `}validateAndEmit(e){const{effectiveHourFormat:t,descriptors:i}=this.localeData,{result:a,writeBacks:r}=Gs(this._parts.values[e]??{},{hourFormat:t,descriptors:i,invalidDateMessage:this.invalidDateMessage});if(this._parts.applyWriteBacks(e,r),a.kind==="incomplete"){this.requestUpdate();return}if(a.kind==="invalid"){this.dispatchEvent(new CustomEvent("inputError",{detail:{message:a.message},bubbles:!0})),this.requestUpdate();return}const s=this.boundsError(a.iso,a.instant);if(s){this.dispatchEvent(new CustomEvent("change",{detail:{value:a.iso},bubbles:!0})),this.dispatchEvent(new CustomEvent("inputError",{detail:{message:s},bubbles:!0})),this.requestUpdate();return}this.value=a.iso,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0})),this.requestUpdate()}};re([n.property({type:String})],te.prototype,"uid",2),re([n.property({type:String})],te.prototype,"label",2),re([n.property({type:String,attribute:"locale-id"})],te.prototype,"localeId",2),re([n.property({type:Array})],te.prototype,"errors",2),re([n.property({type:Boolean})],te.prototype,"showErrors",2),re([n.property({type:Boolean})],te.prototype,"touched",2),re([n.property({type:Boolean})],te.prototype,"required",2),re([n.property({type:Boolean})],te.prototype,"disabled",2),re([n.property({type:Boolean,attribute:"readonly"})],te.prototype,"readOnly",2),re([n.property({type:String})],te.prototype,"icon",2),re([n.property({type:String})],te.prototype,"hint",2),re([n.property({type:String,attribute:"hour-format"})],te.prototype,"hourFormat",2),re([n.property({type:Number,attribute:"minute-step"})],te.prototype,"minuteStep",2),re([n.property({type:String,attribute:"invalid-date-message"})],te.prototype,"invalidDateMessage",2),re([n.property({type:String})],te.prototype,"value",2),re([n.property({type:String,attribute:"min-date"})],te.prototype,"minDate",2),re([n.property({type:String,attribute:"max-date"})],te.prototype,"maxDate",2),re([n.property({type:String,attribute:"min-time"})],te.prototype,"minTime",2),re([n.property({type:String,attribute:"max-time"})],te.prototype,"maxTime",2),re([n.property({type:String,attribute:"min-date-message"})],te.prototype,"minDateMessage",2),re([n.property({type:String,attribute:"max-date-message"})],te.prototype,"maxDateMessage",2),re([n.property({type:String,attribute:"min-time-message"})],te.prototype,"minTimeMessage",2),re([n.property({type:String,attribute:"max-time-message"})],te.prototype,"maxTimeMessage",2),te=re([n.customElement("gui-date-time")],te),typeof customElements<"u"&&!customElements.get("gui-date-time")&&customElements.define("gui-date-time",te);var kh=Object.defineProperty,_h=Object.getOwnPropertyDescriptor,T=(e,t,i,a)=>{for(var r=a>1?void 0:a?_h(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&kh(t,i,r),r};let _=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.icon="",this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.localeId=void 0,this.value=void 0,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel=void 0,this.nextMonthAriaLabel=void 0,this.dayFormat=void 0,this.weekdayFormat=void 0,this.monthFormat=void 0,this.minDate=void 0,this.maxDate=void 0,this.disabledRanges=void 0,this.numberOfMonths=void 0,this.hourFormat=void 0,this.minuteStep=void 0,this.minTime=void 0,this.maxTime=void 0,this.disabledTimeRanges=void 0,this.allowCustomTime=!1,this.invalidDateMessage=void 0,this.minDateMessage=void 0,this.maxDateMessage=void 0,this.disabledDateRangeMessage=void 0,this.minTimeMessage=void 0,this.maxTimeMessage=void 0,this.disabledTimeRangeMessage=void 0,this.noAvailableTimesMessage=void 0,this._popup=new Mt(this,{getInteriorElements:()=>[this._dateRef,this._calendarRef],focusRestoreSelector:"gui-date-time input",isDisabled:()=>!!this.disabled,clickIntent:e=>e.closest(".gui-calendar__day-button")||e.closest(".gui-time-list__option")?"ignore":e.closest(".gui-date-time-input__part")||e.closest("gui-date-time-calendar")?"open":"toggle",keyToggleMode:"toggle"})}createRenderRoot(){return this}render(){const e=Ke("datePicker",{icon:this.icon}),t=this._popup.open?l.html`<gui-date-time-calendar
1538
- id="calendar-input"
1774
+ ${this.showErrors&&this.errors?.length?j(this.uid,e):l.nothing}
1775
+ `}validateAndEmit(e){const{effectiveHourFormat:t,descriptors:i}=this.localeData,{result:a,writeBacks:r}=Fn(this._parts.values[e]??{},{hourFormat:t,descriptors:i,invalidDateMessage:this.invalidDateMessage});if(this._parts.applyWriteBacks(e,r),a.kind==="incomplete"){this.requestUpdate();return}if(a.kind==="invalid"){this.dispatchEvent(new CustomEvent("inputError",{detail:{message:a.message},bubbles:!0})),this.requestUpdate();return}const s=this.boundsError(a.iso,a.instant);if(s){this.dispatchEvent(new CustomEvent("change",{detail:{value:a.iso},bubbles:!0})),this.dispatchEvent(new CustomEvent("inputError",{detail:{message:s},bubbles:!0})),this.requestUpdate();return}this.value=a.iso,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0})),this.requestUpdate()}};K([n.property({type:String})],U.prototype,"uid",2),K([n.property({type:String})],U.prototype,"label",2),K([n.property({type:String,attribute:"locale-id"})],U.prototype,"localeId",2),K([n.property({type:Array})],U.prototype,"errors",2),K([n.property({type:Boolean})],U.prototype,"showErrors",2),K([n.property({type:Boolean})],U.prototype,"touched",2),K([n.property({type:Boolean})],U.prototype,"required",2),K([n.property({type:Boolean})],U.prototype,"disabled",2),K([n.property({type:Boolean,attribute:"readonly"})],U.prototype,"readOnly",2),K([n.property({type:String})],U.prototype,"icon",2),K([n.property({type:String})],U.prototype,"hint",2),K([n.property({type:String})],U.prototype,"dayAriaLabel",2),K([n.property({type:String})],U.prototype,"monthAriaLabel",2),K([n.property({type:String})],U.prototype,"yearAriaLabel",2),K([n.property({type:String})],U.prototype,"hourAriaLabel",2),K([n.property({type:String})],U.prototype,"minuteAriaLabel",2),K([n.property({type:String})],U.prototype,"dayPeriodAriaLabel",2),K([n.property({type:String,attribute:"hour-format"})],U.prototype,"hourFormat",2),K([n.property({type:Number,attribute:"minute-step"})],U.prototype,"minuteStep",2),K([n.property({type:String,attribute:"invalid-date-message"})],U.prototype,"invalidDateMessage",2),K([n.property({type:String})],U.prototype,"value",2),K([n.property({type:String,attribute:"min-date"})],U.prototype,"minDate",2),K([n.property({type:String,attribute:"max-date"})],U.prototype,"maxDate",2),K([n.property({type:String,attribute:"min-time"})],U.prototype,"minTime",2),K([n.property({type:String,attribute:"max-time"})],U.prototype,"maxTime",2),K([n.property({type:String,attribute:"min-date-message"})],U.prototype,"minDateMessage",2),K([n.property({type:String,attribute:"max-date-message"})],U.prototype,"maxDateMessage",2),K([n.property({type:String,attribute:"min-time-message"})],U.prototype,"minTimeMessage",2),K([n.property({type:String,attribute:"max-time-message"})],U.prototype,"maxTimeMessage",2),U=K([n.customElement("gui-date-time")],U),typeof customElements<"u"&&!customElements.get("gui-date-time")&&customElements.define("gui-date-time",U);var Oc=Object.defineProperty,Ic=Object.getOwnPropertyDescriptor,S=(e,t,i,a)=>{for(var r=a>1?void 0:a?Ic(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Oc(t,i,r),r};let k=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.icon="",this.toggleAriaLabel=void 0,this.dayAriaLabel=void 0,this.monthAriaLabel=void 0,this.yearAriaLabel=void 0,this.hourAriaLabel=void 0,this.minuteAriaLabel=void 0,this.dayPeriodAriaLabel=void 0,this.errors=[],this.showErrors=!0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.localeId=void 0,this.value=void 0,this.prevMonthIcon="",this.nextMonthIcon="",this.prevMonthAriaLabel=void 0,this.nextMonthAriaLabel=void 0,this.selectYearAriaLabel=void 0,this.yearGridAriaLabel=void 0,this.dayFormat=void 0,this.weekdayFormat=void 0,this.monthFormat=void 0,this.minDate=void 0,this.maxDate=void 0,this.disabledRanges=void 0,this.numberOfMonths=void 0,this.hourFormat=void 0,this.minuteStep=void 0,this.minTime=void 0,this.maxTime=void 0,this.disabledTimeRanges=void 0,this.allowCustomTime=!1,this.invalidDateMessage=void 0,this.minDateMessage=void 0,this.maxDateMessage=void 0,this.disabledDateRangeMessage=void 0,this.minTimeMessage=void 0,this.maxTimeMessage=void 0,this.disabledTimeRangeMessage=void 0,this.noAvailableTimesMessage=void 0,this._popup=new Ot(this,{focusRestoreSelector:"gui-date-time input",focusPopupSelector:'.gui-calendar__day-button[tabindex="0"]',isDisabled:()=>!!this.disabled,clickIntent:e=>e.closest(".gui-calendar__day-button")||e.closest(".gui-time-list__option")?"ignore":e.closest(".gui-date-time-input__part")||e.closest("gui-date-time-calendar")?"open":"toggle",keyToggleMode:"toggle"}),this.onToggleClick=e=>{e.stopPropagation(),this._popup.open?this._popup.close():this._popup.openAndFocus()}}createRenderRoot(){return this}render(){const e=Xe("datePicker",{icon:this.icon}),t=this._popup.open?l.html`<gui-date-time-calendar
1776
+ id=${`${this.uid}_popup`}
1777
+ role="dialog"
1778
+ aria-label=${this.label??"Calendar"}
1539
1779
  .uid=${this.uid}
1540
1780
  .hint=${this.hint}
1541
1781
  ?touched=${this.touched}
@@ -1547,6 +1787,8 @@
1547
1787
  .nextMonthIcon=${this.nextMonthIcon}
1548
1788
  .prevMonthAriaLabel=${this.prevMonthAriaLabel}
1549
1789
  .nextMonthAriaLabel=${this.nextMonthAriaLabel}
1790
+ .selectYearAriaLabel=${this.selectYearAriaLabel}
1791
+ .yearGridAriaLabel=${this.yearGridAriaLabel}
1550
1792
  .dayFormat=${this.dayFormat}
1551
1793
  .weekdayFormat=${this.weekdayFormat}
1552
1794
  .monthFormat=${this.monthFormat}
@@ -1568,20 +1810,16 @@
1568
1810
  @blur=${this.onCalendarBlur}
1569
1811
  @change=${this.onCalendarChange}
1570
1812
  ></gui-date-time-calendar>`:l.nothing;return l.html`
1571
- ${se(this.uid??"",{label:this.label,hint:this.hint,required:this.required})}
1813
+ ${le(this.uid??"",{label:this.label,hint:this.hint,required:this.required},!1,void 0,!1)}
1572
1814
 
1573
1815
  <div
1574
- role="button"
1575
- tabindex="-1"
1576
1816
  class="gui-widget"
1577
- aria-expanded=${this._popup.open}
1578
- @keyup=${this._popup.onAnchorKeyUp}
1579
1817
  @keydown=${this._popup.onAnchorKeyDown}
1580
1818
  @click=${this._popup.onAnchorClick}
1581
1819
  >
1582
1820
  <gui-date-time
1583
1821
  id="date-input"
1584
- class=${w.classMap(e.widgetClasses)}
1822
+ class=${T.classMap(e.widgetClasses)}
1585
1823
  .uid=${this.uid}
1586
1824
  .hint=${this.hint}
1587
1825
  .showErrors=${!1}
@@ -1597,6 +1835,12 @@
1597
1835
  .minuteStep=${this.minuteStep}
1598
1836
  .minTime=${this.minTime}
1599
1837
  .maxTime=${this.maxTime}
1838
+ .dayAriaLabel=${this.dayAriaLabel}
1839
+ .monthAriaLabel=${this.monthAriaLabel}
1840
+ .yearAriaLabel=${this.yearAriaLabel}
1841
+ .hourAriaLabel=${this.hourAriaLabel}
1842
+ .minuteAriaLabel=${this.minuteAriaLabel}
1843
+ .dayPeriodAriaLabel=${this.dayPeriodAriaLabel}
1600
1844
  .invalidDateMessage=${this.invalidDateMessage}
1601
1845
  .minTimeMessage=${this.minTimeMessage}
1602
1846
  .maxTimeMessage=${this.maxTimeMessage}
@@ -1604,18 +1848,34 @@
1604
1848
  @focus=${this._popup.show}
1605
1849
  @change=${this.onDateChange}
1606
1850
  ></gui-date-time>
1607
- <span class="gui-date-time-picker__arrow"
1608
- ><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256">
1851
+ <button
1852
+ type="button"
1853
+ class="gui-date-time-picker__arrow"
1854
+ aria-label=${this.toggleAriaLabel??"Show calendar"}
1855
+ aria-haspopup="dialog"
1856
+ aria-expanded=${this._popup.open?"true":"false"}
1857
+ aria-controls=${`${this.uid}_popup`}
1858
+ ?disabled=${this.disabled}
1859
+ @click=${this.onToggleClick}
1860
+ >
1861
+ <svg
1862
+ xmlns="http://www.w3.org/2000/svg"
1863
+ width="16"
1864
+ height="16"
1865
+ viewBox="0 0 256 256"
1866
+ aria-hidden="true"
1867
+ >
1609
1868
  <path
1610
1869
  d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
1611
- ></path></svg
1612
- ></span>
1870
+ ></path>
1871
+ </svg>
1872
+ </button>
1613
1873
 
1614
1874
  ${t}
1615
1875
  </div>
1616
1876
 
1617
- ${this.showErrors?W(this.uid??"",{errors:this.errors,touched:this.touched}):""}
1618
- `}onDateChange(e){e.stopPropagation(),this.commitValue(e.detail.value)}onDateBlur(){this.dispatchEvent(new CustomEvent("blur"))}onCalendarChange(e){if(!this._popup.open){e.stopPropagation();return}e.stopPropagation(),this.commitValue(e.detail.value),e.detail.value&&e.detail.commit&&this._popup.close()}commitValue(e){this.value=e??void 0;const t=this.validateBounds(this.value);this.dispatchEvent(new CustomEvent("change",{detail:{value:e??null},bubbles:!0,composed:!0})),t&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:t},bubbles:!0,composed:!0}))}validateBounds(e){if(!e)return null;const t=Y(e);if(isNaN(t.getTime()))return null;const i=Q(t),a=Bt(i,this.minDate,this.maxDate,this.disabledRanges,{minDateMessage:this.minDateMessage,maxDateMessage:this.maxDateMessage,disabledDateRangeMessage:this.disabledDateRangeMessage});if(a)return a;const r=Ms(this.disabledTimeRanges,i);return Ki(ht(t),r)?this.disabledTimeRangeMessage??qi:null}onCalendarBlur(){this._popup.close()}};T([n.property({type:String})],_.prototype,"uid",2),T([n.property({type:String})],_.prototype,"label",2),T([n.property({type:String})],_.prototype,"hint",2),T([n.property({type:String})],_.prototype,"icon",2),T([n.property({type:Array})],_.prototype,"errors",2),T([n.property({type:Boolean})],_.prototype,"showErrors",2),T([n.property({type:Boolean})],_.prototype,"touched",2),T([n.property({type:Boolean})],_.prototype,"required",2),T([n.property({type:Boolean})],_.prototype,"disabled",2),T([n.property({type:Boolean,attribute:"readonly"})],_.prototype,"readOnly",2),T([n.property({type:String,attribute:"locale-id"})],_.prototype,"localeId",2),T([n.property({type:String})],_.prototype,"value",2),T([n.property({type:String,attribute:"prev-month-icon"})],_.prototype,"prevMonthIcon",2),T([n.property({type:String,attribute:"next-month-icon"})],_.prototype,"nextMonthIcon",2),T([n.property({type:String,attribute:"prev-month-aria-label"})],_.prototype,"prevMonthAriaLabel",2),T([n.property({type:String,attribute:"next-month-aria-label"})],_.prototype,"nextMonthAriaLabel",2),T([n.property({type:String,attribute:"day-format"})],_.prototype,"dayFormat",2),T([n.property({type:String,attribute:"weekday-format"})],_.prototype,"weekdayFormat",2),T([n.property({type:String,attribute:"month-format"})],_.prototype,"monthFormat",2),T([n.property({type:String,attribute:"min-date"})],_.prototype,"minDate",2),T([n.property({type:String,attribute:"max-date"})],_.prototype,"maxDate",2),T([n.property({type:Array,attribute:"disabled-ranges"})],_.prototype,"disabledRanges",2),T([n.property({type:Number,attribute:"number-of-months"})],_.prototype,"numberOfMonths",2),T([n.property({type:String,attribute:"hour-format"})],_.prototype,"hourFormat",2),T([n.property({type:Number,attribute:"minute-step"})],_.prototype,"minuteStep",2),T([n.property({type:String,attribute:"min-time"})],_.prototype,"minTime",2),T([n.property({type:String,attribute:"max-time"})],_.prototype,"maxTime",2),T([n.property({type:Array,attribute:"disabled-time-ranges"})],_.prototype,"disabledTimeRanges",2),T([n.property({type:Boolean,attribute:"allow-custom-time"})],_.prototype,"allowCustomTime",2),T([n.property({type:String,attribute:"invalid-date-message"})],_.prototype,"invalidDateMessage",2),T([n.property({type:String,attribute:"min-date-message"})],_.prototype,"minDateMessage",2),T([n.property({type:String,attribute:"max-date-message"})],_.prototype,"maxDateMessage",2),T([n.property({type:String,attribute:"disabled-date-range-message"})],_.prototype,"disabledDateRangeMessage",2),T([n.property({type:String,attribute:"min-time-message"})],_.prototype,"minTimeMessage",2),T([n.property({type:String,attribute:"max-time-message"})],_.prototype,"maxTimeMessage",2),T([n.property({type:String,attribute:"disabled-time-range-message"})],_.prototype,"disabledTimeRangeMessage",2),T([n.property({type:String,attribute:"no-available-times-message"})],_.prototype,"noAvailableTimesMessage",2),T([n.query("#date-input")],_.prototype,"_dateRef",2),T([n.query("#calendar-input")],_.prototype,"_calendarRef",2),_=T([n.customElement("gui-date-time-picker")],_),typeof customElements<"u"&&!customElements.get("gui-date-time-picker")&&customElements.define("gui-date-time-picker",_);var Th=Object.defineProperty,Sh=Object.getOwnPropertyDescriptor,Ga=(e,t,i,a)=>{for(var r=a>1?void 0:a?Sh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Th(t,i,r),r};let ti=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-date-time-picker","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=this.adapter.templateData;return l.html`
1877
+ ${this.showErrors?j(this.uid??"",{errors:this.errors,touched:this.touched}):""}
1878
+ `}onDateChange(e){e.stopPropagation(),this.commitValue(e.detail.value)}onDateBlur(){this.dispatchEvent(new CustomEvent("blur"))}onCalendarChange(e){if(!this._popup.open){e.stopPropagation();return}e.stopPropagation(),this.commitValue(e.detail.value),e.detail.value&&e.detail.commit&&this._popup.close()}commitValue(e){this.value=e??void 0;const t=this.validateBounds(this.value);this.dispatchEvent(new CustomEvent("change",{detail:{value:e??null},bubbles:!0,composed:!0})),t&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:t},bubbles:!0,composed:!0}))}validateBounds(e){if(!e)return null;const t=ee(e);if(isNaN(t.getTime()))return null;const i=ae(t),a=Gt(i,this.minDate,this.maxDate,this.disabledRanges,{minDateMessage:this.minDateMessage,maxDateMessage:this.maxDateMessage,disabledDateRangeMessage:this.disabledDateRangeMessage});if(a)return a;const r=Sn(this.disabledTimeRanges,i);return ji(mt(t),r)?this.disabledTimeRangeMessage??zi:null}onCalendarBlur(){this._popup.closeOnFocusLeave()}};S([n.property({type:String})],k.prototype,"uid",2),S([n.property({type:String})],k.prototype,"label",2),S([n.property({type:String})],k.prototype,"hint",2),S([n.property({type:String})],k.prototype,"icon",2),S([n.property({type:String,attribute:"toggle-aria-label"})],k.prototype,"toggleAriaLabel",2),S([n.property({type:String})],k.prototype,"dayAriaLabel",2),S([n.property({type:String})],k.prototype,"monthAriaLabel",2),S([n.property({type:String})],k.prototype,"yearAriaLabel",2),S([n.property({type:String})],k.prototype,"hourAriaLabel",2),S([n.property({type:String})],k.prototype,"minuteAriaLabel",2),S([n.property({type:String})],k.prototype,"dayPeriodAriaLabel",2),S([n.property({type:Array})],k.prototype,"errors",2),S([n.property({type:Boolean})],k.prototype,"showErrors",2),S([n.property({type:Boolean})],k.prototype,"touched",2),S([n.property({type:Boolean})],k.prototype,"required",2),S([n.property({type:Boolean})],k.prototype,"disabled",2),S([n.property({type:Boolean,attribute:"readonly"})],k.prototype,"readOnly",2),S([n.property({type:String,attribute:"locale-id"})],k.prototype,"localeId",2),S([n.property({type:String})],k.prototype,"value",2),S([n.property({type:String,attribute:"prev-month-icon"})],k.prototype,"prevMonthIcon",2),S([n.property({type:String,attribute:"next-month-icon"})],k.prototype,"nextMonthIcon",2),S([n.property({type:String,attribute:"prev-month-aria-label"})],k.prototype,"prevMonthAriaLabel",2),S([n.property({type:String,attribute:"next-month-aria-label"})],k.prototype,"nextMonthAriaLabel",2),S([n.property({type:String,attribute:"select-year-aria-label"})],k.prototype,"selectYearAriaLabel",2),S([n.property({type:String,attribute:"year-grid-aria-label"})],k.prototype,"yearGridAriaLabel",2),S([n.property({type:String,attribute:"day-format"})],k.prototype,"dayFormat",2),S([n.property({type:String,attribute:"weekday-format"})],k.prototype,"weekdayFormat",2),S([n.property({type:String,attribute:"month-format"})],k.prototype,"monthFormat",2),S([n.property({type:String,attribute:"min-date"})],k.prototype,"minDate",2),S([n.property({type:String,attribute:"max-date"})],k.prototype,"maxDate",2),S([n.property({type:Array,attribute:"disabled-ranges"})],k.prototype,"disabledRanges",2),S([n.property({type:Number,attribute:"number-of-months"})],k.prototype,"numberOfMonths",2),S([n.property({type:String,attribute:"hour-format"})],k.prototype,"hourFormat",2),S([n.property({type:Number,attribute:"minute-step"})],k.prototype,"minuteStep",2),S([n.property({type:String,attribute:"min-time"})],k.prototype,"minTime",2),S([n.property({type:String,attribute:"max-time"})],k.prototype,"maxTime",2),S([n.property({type:Array,attribute:"disabled-time-ranges"})],k.prototype,"disabledTimeRanges",2),S([n.property({type:Boolean,attribute:"allow-custom-time"})],k.prototype,"allowCustomTime",2),S([n.property({type:String,attribute:"invalid-date-message"})],k.prototype,"invalidDateMessage",2),S([n.property({type:String,attribute:"min-date-message"})],k.prototype,"minDateMessage",2),S([n.property({type:String,attribute:"max-date-message"})],k.prototype,"maxDateMessage",2),S([n.property({type:String,attribute:"disabled-date-range-message"})],k.prototype,"disabledDateRangeMessage",2),S([n.property({type:String,attribute:"min-time-message"})],k.prototype,"minTimeMessage",2),S([n.property({type:String,attribute:"max-time-message"})],k.prototype,"maxTimeMessage",2),S([n.property({type:String,attribute:"disabled-time-range-message"})],k.prototype,"disabledTimeRangeMessage",2),S([n.property({type:String,attribute:"no-available-times-message"})],k.prototype,"noAvailableTimesMessage",2),k=S([n.customElement("gui-date-time-picker")],k),typeof customElements<"u"&&!customElements.get("gui-date-time-picker")&&customElements.define("gui-date-time-picker",k);var Mc=Object.defineProperty,Rc=Object.getOwnPropertyDescriptor,Pr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Rc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Mc(t,i,r),r};let si=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-date-time-picker","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=this.adapter.templateData;return l.html`
1619
1879
  <gui-date-time-picker
1620
1880
  .uid=${this.widget.uid}
1621
1881
  .label=${e.label}
@@ -1628,10 +1888,19 @@
1628
1888
  .value=${e.value}
1629
1889
  .icon=${e.icon}
1630
1890
  .localeId=${e.lang}
1891
+ .toggleAriaLabel=${e.toggleAriaLabel}
1892
+ .dayAriaLabel=${e.dayAriaLabel}
1893
+ .monthAriaLabel=${e.monthAriaLabel}
1894
+ .yearAriaLabel=${e.yearAriaLabel}
1895
+ .hourAriaLabel=${e.hourAriaLabel}
1896
+ .minuteAriaLabel=${e.minuteAriaLabel}
1897
+ .dayPeriodAriaLabel=${e.dayPeriodAriaLabel}
1631
1898
  .prevMonthIcon=${e.prevMonthIcon}
1632
1899
  .nextMonthIcon=${e.nextMonthIcon}
1633
1900
  .prevMonthAriaLabel=${e.prevMonthAriaLabel}
1634
1901
  .nextMonthAriaLabel=${e.nextMonthAriaLabel}
1902
+ .selectYearAriaLabel=${e.selectYearAriaLabel}
1903
+ .yearGridAriaLabel=${e.yearGridAriaLabel}
1635
1904
  .dayFormat=${e.dayFormat}
1636
1905
  .weekdayFormat=${e.weekdayFormat}
1637
1906
  .monthFormat=${e.monthFormat}
@@ -1657,31 +1926,20 @@
1657
1926
  @blur=${()=>this.adapter.onBlur()}
1658
1927
  @change=${this.valueChanged}
1659
1928
  ></gui-date-time-picker>
1660
- `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Ga([b.consume({context:m.formContext}),n.property({attribute:!1})],ti.prototype,"formContext",2),Ga([b.provide({context:m.inputContext})],ti.prototype,"adapter",2),ti=Ga([n.customElement("gui-date-time-picker-input")],ti);const Ch=Object.freeze(Object.defineProperty({__proto__:null,get DateTimePickerElement(){return ti}},Symbol.toStringTag,{value:"Module"})),Qs=e=>{const t={"gui-list__item":!0,"gui-list__item-selected":!!e.selected,"gui-list__item-focused":!!e.focused,"gui-list__item-disabled":!!e.disabled};return l.html`
1929
+ `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Pr([f.consume({context:m.formContext}),n.property({attribute:!1})],si.prototype,"formContext",2),Pr([f.provide({context:m.inputContext})],si.prototype,"adapter",2),si=Pr([n.customElement("gui-date-time-picker-input")],si);const Fc=Object.freeze(Object.defineProperty({__proto__:null,get DateTimePickerElement(){return si}},Symbol.toStringTag,{value:"Module"})),Yn=e=>{const t={"gui-list__item":!0,"gui-list__item-selected":!!e.selected,"gui-list__item-focused":!!e.focused,"gui-list__item-disabled":!!e.disabled};return l.html`
1661
1930
  <div
1662
1931
  role="option"
1663
- class=${w.classMap(t)}
1932
+ class=${T.classMap(t)}
1664
1933
  aria-selected=${e.selected?"true":"false"}
1665
1934
  aria-disabled=${e.disabled?"true":"false"}
1666
1935
  >
1667
1936
  ${e.template}
1668
1937
  </div>
1669
- `};var xh=Object.defineProperty,Eh=Object.getOwnPropertyDescriptor,st=(e,t,i,a)=>{for(var r=a>1?void 0:a?Eh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&xh(t,i,r),r};let Xe=class extends l.LitElement{constructor(){super(...arguments),this.targetElement=void 0,this.uid=void 0,this.label=void 0,this.hint=void 0,this.required=void 0,this.errors=[],this.disabled=!1,this.readOnly=!1,this.touched=!1,this.native=!0,this.ariaController=new oe(this,{getTargets:()=>Array.isArray(this.targetElement)?[...this.targetElement]:[this.targetElement],getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}render(){return super.render(),l.html`${se(this.uid,{label:this.label,hint:this.hint,required:this.required,errors:this.errors,touched:this.touched},!1,void 0,this.native)}`}};st([n.property({type:Object})],Xe.prototype,"targetElement",2),st([n.property({type:String})],Xe.prototype,"uid",2),st([n.property({type:String})],Xe.prototype,"label",2),st([n.property({type:String})],Xe.prototype,"hint",2),st([n.property({type:Boolean})],Xe.prototype,"required",2),st([n.property({type:Array})],Xe.prototype,"errors",2),st([n.property({type:Boolean})],Xe.prototype,"disabled",2),st([n.property({type:Boolean,attribute:"readonly"})],Xe.prototype,"readOnly",2),st([n.property({type:Boolean})],Xe.prototype,"touched",2),st([n.property({type:Boolean})],Xe.prototype,"native",2),Xe=st([n.customElement("gui-label")],Xe),typeof customElements<"u"&&!customElements.get("gui-label")&&customElements.define("gui-label",Xe);const Mh=e=>e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"template")&&Object.prototype.hasOwnProperty.call(e,"value");function Ph(e){const t=typeof e;return t==="string"||t==="number"}const Ih=(e,{valueField:t})=>{if(e===null||typeof e!="object")return!1;const i=e,a=t??"value";return!!Object.prototype.hasOwnProperty.call(i,a)};function Oh(e,{valueField:t}){if(e===null||typeof e!="object")throw new Error("Provided value is not an object");const i=e,a=t??"value",r=Object.prototype.hasOwnProperty.call(i,a)?a:void 0;if(!r)throw new Error("No valueField exists on the object");return s=>{if(s===null||typeof s!="object")throw new Error("Item is not an object");const o=s;return{template:s,value:r?o[r]:"",...typeof o.disabled=="boolean"?{disabled:o.disabled}:{}}}}const Ah=(e,t)=>{if(Array.isArray(e)&&e.length>0&&!Mh(e[0])){if(Ph(e[0]))return e.map(i=>({template:i,value:i}));if(Ih(e[0],t)){const i=Oh(e[0],t);return e.map(i)}else throw new Error("Invalid list item shape")}return e};var Lh=Object.defineProperty,Rh=Object.getOwnPropertyDescriptor,Ce=(e,t,i,a)=>{for(var r=a>1?void 0:a?Rh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Lh(t,i,r),r};let ge=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.valueField=void 0,this.label=void 0,this.hint=void 0,this.items=[],this.itemHeight=void 0,this.height=void 0,this._items=[],this._scrollTop=0,this._viewportHeight=0,this._focusedIndex=-1,this.buffer=5}willUpdate(e){super.willUpdate(e),e.has("items")&&this.updateItems(),(e.has("items")||e.has("_scrollTop")||e.has("height"))&&this.emitRangeChange()}firstUpdated(){this.measureViewport(),new ResizeObserver(()=>this.measureViewport()).observe(this.viewportElement)}render(){const e=this.height??300,t=this.itemHeight??40,i=(this.items?.length??0)*t,{offsetY:a}=this.calculateRange(),r=this._focusedIndex>=0?`${this.uid}-item-${this._focusedIndex}`:void 0;return l.html`
1938
+ `};var Bc=Object.defineProperty,qc=Object.getOwnPropertyDescriptor,ot=(e,t,i,a)=>{for(var r=a>1?void 0:a?qc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Bc(t,i,r),r};let Qe=class extends l.LitElement{constructor(){super(...arguments),this.targetElement=void 0,this.uid=void 0,this.label=void 0,this.hint=void 0,this.required=void 0,this.errors=[],this.disabled=!1,this.readOnly=!1,this.touched=!1,this.native=!0,this.ariaController=new he(this,{getTargets:()=>Array.isArray(this.targetElement)?[...this.targetElement]:[this.targetElement],getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})})}createRenderRoot(){return this}render(){return super.render(),l.html`${le(this.uid,{label:this.label,hint:this.hint,required:this.required,errors:this.errors,touched:this.touched},!1,void 0,this.native)}`}};ot([n.property({type:Object})],Qe.prototype,"targetElement",2),ot([n.property({type:String})],Qe.prototype,"uid",2),ot([n.property({type:String})],Qe.prototype,"label",2),ot([n.property({type:String})],Qe.prototype,"hint",2),ot([n.property({type:Boolean})],Qe.prototype,"required",2),ot([n.property({type:Array})],Qe.prototype,"errors",2),ot([n.property({type:Boolean})],Qe.prototype,"disabled",2),ot([n.property({type:Boolean,attribute:"readonly"})],Qe.prototype,"readOnly",2),ot([n.property({type:Boolean})],Qe.prototype,"touched",2),ot([n.property({type:Boolean})],Qe.prototype,"native",2),Qe=ot([n.customElement("gui-label")],Qe),typeof customElements<"u"&&!customElements.get("gui-label")&&customElements.define("gui-label",Qe);const Nc=e=>e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"template")&&Object.prototype.hasOwnProperty.call(e,"value");function zc(e){const t=typeof e;return t==="string"||t==="number"}const Gc=(e,{valueField:t})=>{if(e===null||typeof e!="object")return!1;const i=e,a=t??"value";return!!Object.prototype.hasOwnProperty.call(i,a)};function Vc(e,{valueField:t}){if(e===null||typeof e!="object")throw new Error("Provided value is not an object");const i=e,a=t??"value",r=Object.prototype.hasOwnProperty.call(i,a)?a:void 0;if(!r)throw new Error("No valueField exists on the object");return s=>{if(s===null||typeof s!="object")throw new Error("Item is not an object");const o=s;return{template:s,value:r?o[r]:"",...typeof o.disabled=="boolean"?{disabled:o.disabled}:{}}}}const Uc=(e,t)=>{if(Array.isArray(e)&&e.length>0&&!Nc(e[0])){if(zc(e[0]))return e.map(i=>({template:i,value:i}));if(Gc(e[0],t)){const i=Vc(e[0],t);return e.map(i)}else throw new Error("Invalid list item shape")}return e};var Zc=Object.defineProperty,Yc=Object.getOwnPropertyDescriptor,xe=(e,t,i,a)=>{for(var r=a>1?void 0:a?Yc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Zc(t,i,r),r};let De=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.valueField=void 0,this.label=void 0,this.hint=void 0,this.items=[],this.itemHeight=void 0,this.height=void 0,this._items=[],this._scrollTop=0,this._viewportHeight=0,this._focusedIndex=-1,this.buffer=5,this.onKeyDown=e=>{if(this.disabled||this.readOnly)return;const t=this.itemHeight??40,i=Math.ceil(this._viewportHeight/t),a=this.items.length-1;let r=!1;switch(e.key){case"ArrowDown":this.setFocusedIndex(this.findEnabledIndex(Math.min(this._focusedIndex+1,a),1)),r=!0;break;case"ArrowUp":this.setFocusedIndex(this.findEnabledIndex(Math.max(this._focusedIndex-1,0),-1)),r=!0;break;case"PageDown":this.setFocusedIndex(this.findEnabledIndex(Math.min(this._focusedIndex+i,a),1)),r=!0;break;case"PageUp":this.setFocusedIndex(this.findEnabledIndex(Math.max(this._focusedIndex-i,0),-1)),r=!0;break;case"Home":this.setFocusedIndex(this.findEnabledIndex(0,1)),r=!0;break;case"End":this.setFocusedIndex(this.findEnabledIndex(a,-1)),r=!0;break;case"Enter":case" ":{const s=this._items[this._focusedIndex];this._focusedIndex>=0&&s!=null&&!s.disabled&&this.selectItem(s),r=!0;break}}r&&e.preventDefault()},this.onFocus=()=>{if(!this.value||!this.items.length)return;const e=this._items.findIndex(t=>t.value===this.value);this._focusedIndex=e,this.scrollToIndex(e),this.dispatchEvent(new CustomEvent("gui-focus-change",{detail:{index:e},bubbles:!0,composed:!0}))},this.onFocusOut=e=>{e.relatedTarget&&this.contains(e.relatedTarget)||(this._focusedIndex=-1,this.dispatchEvent(new CustomEvent("gui-focus-change",{detail:{index:-1},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0})))}}willUpdate(e){super.willUpdate(e),e.has("items")&&this.updateItems(),(e.has("items")||e.has("_scrollTop")||e.has("height"))&&this.emitRangeChange(),this.syncHostAria()}syncHostAria(){this.setAttribute("role","listbox"),this.tabIndex=this.disabled?-1:0;const e=(t,i)=>{i===null?this.removeAttribute(t):this.setAttribute(t,i)};e("aria-required",this.required?"true":null),e("aria-disabled",this.disabled||this.readOnly?"true":null),e("aria-activedescendant",this._focusedIndex>=0?`${this.uid}-item-${this._focusedIndex}`:null),e("aria-label",this.label??null),e("aria-description",this.hint??null)}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this.onKeyDown),this.addEventListener("focus",this.onFocus),this.addEventListener("focusout",this.onFocusOut)}firstUpdated(){this.measureViewport(),new ResizeObserver(()=>this.measureViewport()).observe(this.viewportElement)}render(){const e=this.height??300,t=this.itemHeight??40,i=(this.items?.length??0)*t,{offsetY:a}=this.calculateRange();return l.html`
1670
1939
  <div
1671
- role="listbox"
1672
- id=${this.uid}
1673
- tabindex=${this.disabled?-1:0}
1674
1940
  class="gui-list__scroll-viewport"
1675
1941
  style="max-height: ${e}px; min-height: 40px; overflow-y: auto; position: relative; display: block;"
1676
1942
  @scroll="${this.onScroll}"
1677
- @keydown="${this.onKeyDown}"
1678
- @focus="${this.onFocus}"
1679
- @focusout="${this.onFocusOut}"
1680
- aria-required=${this.required?"true":l.nothing}
1681
- aria-disabled=${this.disabled||this.readOnly?"true":l.nothing}
1682
- aria-activedescendant="${r??l.nothing}"
1683
- aria-label=${this.label??l.nothing}
1684
- aria-description=${this.hint??l.nothing}
1685
1943
  >
1686
1944
  <div
1687
1945
  class="gui-list__spacer"
@@ -1695,7 +1953,7 @@
1695
1953
  <slot></slot>
1696
1954
  </div>
1697
1955
  </div>
1698
- `}focus(e){this.viewportElement?this.viewportElement.focus(e):super.focus(e)}focusItemAtIndex(e){this._focusedIndex=e}scrollToSelectedIndex(){const e=this._items.findIndex(t=>t.value===this.value);this.scrollToIndex(e)}onKeyDown(e){if(this.disabled||this.readOnly)return;const t=this.itemHeight??40,i=Math.ceil(this._viewportHeight/t),a=this.items.length-1;let r=!1;switch(e.key){case"ArrowDown":this.setFocusedIndex(this.findEnabledIndex(Math.min(this._focusedIndex+1,a),1)),r=!0;break;case"ArrowUp":this.setFocusedIndex(this.findEnabledIndex(Math.max(this._focusedIndex-1,0),-1)),r=!0;break;case"PageDown":this.setFocusedIndex(this.findEnabledIndex(Math.min(this._focusedIndex+i,a),1)),r=!0;break;case"PageUp":this.setFocusedIndex(this.findEnabledIndex(Math.max(this._focusedIndex-i,0),-1)),r=!0;break;case"Home":this.setFocusedIndex(this.findEnabledIndex(0,1)),r=!0;break;case"End":this.setFocusedIndex(this.findEnabledIndex(a,-1)),r=!0;break;case"Enter":case" ":{const s=this._items[this._focusedIndex];this._focusedIndex>=0&&s!=null&&!s.disabled&&this.selectItem(s),r=!0;break}}r&&e.preventDefault()}onFocus(){if(!this.value||!this.items.length)return;const e=this._items.findIndex(t=>t.value===this.value);this._focusedIndex=e,this.scrollToIndex(e),this.dispatchEvent(new CustomEvent("gui-focus-change",{detail:{index:e},bubbles:!0,composed:!0}))}onFocusOut(e){e.relatedTarget&&this.contains(e.relatedTarget)||(this._focusedIndex=-1,this.dispatchEvent(new CustomEvent("gui-focus-change",{detail:{index:-1},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0})))}scrollToIndex(e){const t=this.itemHeight??40,i=this.height??300,a=e*t,r=a+t,s=this.viewportElement.scrollTop,o=s+i;a<s?this.viewportElement.scrollTop=a:r>o&&(this.viewportElement.scrollTop=r-i)}selectItem(e){this.dispatchEvent(new CustomEvent("change",{detail:{value:e.value},bubbles:!0,composed:!0}))}findEnabledIndex(e,t){for(let i=e;i>=0&&i<this._items.length;i+=t)if(!this._items[i]?.disabled)return i;return-1}setFocusedIndex(e){e<0||e>=this.items.length||(this._focusedIndex=e,this.scrollToIndex(e),this.dispatchEvent(new CustomEvent("gui-focus-change",{detail:{index:e},bubbles:!0,composed:!0})))}updateItems(){this._items=Ah(this.items,{valueField:this.valueField}),this.dispatchEvent(new CustomEvent("gui-update-items",{detail:this._items,bubbles:!0,composed:!0}))}emitRangeChange(){const{startIndex:e,endIndex:t}=this.calculateRange();this.dispatchEvent(new CustomEvent("gui-range-change",{detail:{startIndex:e,endIndex:t},bubbles:!0,composed:!0}))}measureViewport(){this.viewportElement&&(this._viewportHeight=this.viewportElement.offsetHeight,this.emitRangeChange())}onScroll(e){const t=e.target;this._scrollTop=t.scrollTop}calculateRange(){const e=this.itemHeight??40,t=this.items?.length??0,i=Math.ceil(this._viewportHeight/e),a=Math.floor(this._scrollTop/e),r=Math.max(0,a-this.buffer),s=Math.min(t,a+i+this.buffer),o=r*e;return{startIndex:r,endIndex:s,offsetY:o}}};Ce([n.property({type:String})],ge.prototype,"uid",2),Ce([n.property({type:Boolean})],ge.prototype,"touched",2),Ce([n.property({type:Boolean})],ge.prototype,"required",2),Ce([n.property({type:Boolean})],ge.prototype,"disabled",2),Ce([n.property({type:Boolean,attribute:"readonly"})],ge.prototype,"readOnly",2),Ce([n.property({type:String})],ge.prototype,"value",2),Ce([n.property({type:String})],ge.prototype,"valueField",2),Ce([n.property({type:String})],ge.prototype,"label",2),Ce([n.property({type:String})],ge.prototype,"hint",2),Ce([n.property({type:Array})],ge.prototype,"items",2),Ce([n.property({type:Number})],ge.prototype,"itemHeight",2),Ce([n.property({type:Number})],ge.prototype,"height",2),Ce([n.state()],ge.prototype,"_items",2),Ce([n.state()],ge.prototype,"_scrollTop",2),Ce([n.state()],ge.prototype,"_viewportHeight",2),Ce([n.state()],ge.prototype,"_focusedIndex",2),Ce([n.query(".gui-list__scroll-viewport")],ge.prototype,"viewportElement",2),ge=Ce([n.customElement("gui-list")],ge),typeof customElements<"u"&&!customElements.get("gui-list")&&customElements.define("gui-list",ge);var Fh=Object.defineProperty,Bh=Object.getOwnPropertyDescriptor,ia=(e,t,i,a)=>{for(var r=a>1?void 0:a?Bh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Fh(t,i,r),r};let It=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.errors=[],this.touched=!1}createRenderRoot(){return this}render(){return super.render(),l.html`${W(this.uid,{touched:this.touched,errors:this.errors})}`}};ia([n.property({type:String})],It.prototype,"uid",2),ia([n.property({type:Array})],It.prototype,"errors",2),ia([n.property({type:Boolean})],It.prototype,"touched",2),It=ia([n.customElement("gui-errors")],It),typeof customElements<"u"&&!customElements.get("gui-errors")&&customElements.define("gui-errors",It);var qh=Object.defineProperty,Nh=Object.getOwnPropertyDescriptor,et=(e,t,i,a)=>{for(var r=a>1?void 0:a?Nh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&qh(t,i,r),r};let Ue=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.debouncer=new dr.Subject,this.subscriptions=[],this._range={start:0,end:10},this._filteredItems=[],this._listItems=[],this._focusedIndex=-1,this._isFiltering=!1,this._isListVisible=!1,this._selectedItem=void 0,this._ignoreNextFocus=!1,this.onDocumentClick=e=>{if(!this._isListVisible)return;const t=e.composedPath(),i=this._inputRef&&t.includes(this._inputRef),a=this._listRef&&t.includes(this._listRef);!i&&!a&&(this._isListVisible=!1)}}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onDocumentClick),this.classList.add("gui-dropdown","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this._filteredItems=this.adapter.templateData.items,this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>{const e=this.adapter.templateData;e.items&&this._listItems?.length===0&&this._filteredItems?.length===0&&(this._filteredItems=e.items,this._listItems=e.items),this.requestUpdate()}),this.debouncer.pipe(dr.debounceTime(this.adapter.templateData.inputDebounce??500)).subscribe(e=>{this._filterItems(e)}))}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}_onRangeChange(e){this._range={start:e.detail.startIndex,end:e.detail.endIndex}}_onUpdateItems(e){const t=e.detail||[];if(this._listItems=t,!this._selectedItem&&this.adapter.templateData.value!=null){const i=t.find(a=>a.value===this.adapter.templateData.value);i&&(this._selectedItem=i)}}_onFocusChange(e){this._focusedIndex=e.detail.index}_onClickItem(e,t){if(this.adapter.templateData.readonly||e.disabled)return;const i=this.adapter.templateData;this.adapter.valueChanged(e.value),this.adapter.filterChanged(""),this._focusedIndex=t,this._selectedItem=e,this._isFiltering=!1,this._isListVisible=!1,this._listRef&&(this._listRef.focusItemAtIndex(t),this._inputRef.value=i.valueField?e.template[i.valueField]:e.template)}_onValueChange(e){const t=e.detail.value;this.adapter.valueChanged(t),this.adapter.filterChanged(""),this._selectedItem=this._listItems.find(i=>i.value===t),this._isFiltering=!1,this._isListVisible=!1}async _onKeyDown(e){switch(e.key){case"ArrowDown":e.preventDefault(),this._isListVisible=!0,await this.updateComplete,this._listRef.focus(),this._listRef.scrollToSelectedIndex();break;case"Enter":this._inputRef.value||(this.adapter.valueChanged(null),this._isListVisible=!1,this._isFiltering=!1);break}}_onInput(e){const t=e.target.value;this.debouncer.next(t)}_filterItems(e){const t=this.adapter.templateData,i=!!this.widget.on?.filter;if(this.adapter.filterChanged(e),e&&!i){this._isFiltering=!0,this._isListVisible=!0;const a=t.searchFields??[t.labelField,t.valueField].filter(u=>!!u),r=a.length>0,o=(t.items||[]).filter(u=>{if(u===null||typeof u!="object")return u!=null&&u.toString().toLowerCase().includes(e.toLowerCase());const d=Object.keys(u),h=(c,g)=>c||u[g].toString().toLowerCase().includes(e.toLowerCase());return r?d.filter(c=>a.includes(c)).reduce(h,!1):d.reduce(h,!1)});this._filteredItems=[...o]}else this._isFiltering=!1,this._filteredItems=[...t.items]}_onWidgetKeyDown(e){e.key!=="Escape"||!this._isListVisible||(e.preventDefault(),e.stopPropagation(),this._isListVisible=!1,this._isFiltering=!1,this._ignoreNextFocus=!0,this._inputRef?.focus(),setTimeout(()=>{this._ignoreNextFocus=!1}))}async _onFocus(){this._ignoreNextFocus||(this._isListVisible=!0,await this.updateComplete,this._listRef.scrollToSelectedIndex())}_onFocusOutInput(e){const t=e.relatedTarget;t&&this.contains(t)||(this.adapter.onBlur(),this._isListVisible=!1,this._isFiltering=!1)}_onBlur(){this.adapter.onBlur(),this._isListVisible=!1,this._isFiltering=!1}render(){const e=this.adapter.templateData,t=e.touched&&e.errors&&e.errors.length>0,i=this._listItems.slice(this._range.start,this._range.end),a=this.adapter.getItemRenderer(e.itemRenderer,Qs),s=this._selectedItem?.template!==null&&typeof this._selectedItem?.template=="object"?e.labelField??"label":null,o=s?this._selectedItem?.template[s]:this._selectedItem?.template,u=!!this.widget.on?.filter;return l.html`
1956
+ `}focusItemAtIndex(e){this._focusedIndex=e}scrollToSelectedIndex(){const e=this._items.findIndex(t=>t.value===this.value);this.scrollToIndex(e)}scrollToIndex(e){const t=this.itemHeight??40,i=this.height??300,a=e*t,r=a+t,s=this.viewportElement.scrollTop,o=s+i;a<s?this.viewportElement.scrollTop=a:r>o&&(this.viewportElement.scrollTop=r-i)}selectItem(e){this.dispatchEvent(new CustomEvent("change",{detail:{value:e.value},bubbles:!0,composed:!0}))}findEnabledIndex(e,t){for(let i=e;i>=0&&i<this._items.length;i+=t)if(!this._items[i]?.disabled)return i;return-1}setFocusedIndex(e){e<0||e>=this.items.length||(this._focusedIndex=e,this.scrollToIndex(e),this.dispatchEvent(new CustomEvent("gui-focus-change",{detail:{index:e},bubbles:!0,composed:!0})))}updateItems(){this._items=Uc(this.items,{valueField:this.valueField}),this.dispatchEvent(new CustomEvent("gui-update-items",{detail:this._items,bubbles:!0,composed:!0}))}emitRangeChange(){const{startIndex:e,endIndex:t}=this.calculateRange();this.dispatchEvent(new CustomEvent("gui-range-change",{detail:{startIndex:e,endIndex:t},bubbles:!0,composed:!0}))}measureViewport(){this.viewportElement&&(this._viewportHeight=this.viewportElement.offsetHeight,this.emitRangeChange())}onScroll(e){const t=e.target;this._scrollTop=t.scrollTop}calculateRange(){const e=this.itemHeight??40,t=this.items?.length??0,i=Math.ceil(this._viewportHeight/e),a=Math.floor(this._scrollTop/e),r=Math.max(0,a-this.buffer),s=Math.min(t,a+i+this.buffer),o=r*e;return{startIndex:r,endIndex:s,offsetY:o}}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.onKeyDown),this.removeEventListener("focus",this.onFocus),this.removeEventListener("focusout",this.onFocusOut)}};xe([n.property({type:String})],De.prototype,"uid",2),xe([n.property({type:Boolean})],De.prototype,"touched",2),xe([n.property({type:Boolean})],De.prototype,"required",2),xe([n.property({type:Boolean})],De.prototype,"disabled",2),xe([n.property({type:Boolean,attribute:"readonly"})],De.prototype,"readOnly",2),xe([n.property({type:String})],De.prototype,"value",2),xe([n.property({type:String})],De.prototype,"valueField",2),xe([n.property({type:String})],De.prototype,"label",2),xe([n.property({type:String})],De.prototype,"hint",2),xe([n.property({type:Array})],De.prototype,"items",2),xe([n.property({type:Number})],De.prototype,"itemHeight",2),xe([n.property({type:Number})],De.prototype,"height",2),xe([n.state()],De.prototype,"_items",2),xe([n.state()],De.prototype,"_scrollTop",2),xe([n.state()],De.prototype,"_viewportHeight",2),xe([n.state()],De.prototype,"_focusedIndex",2),xe([n.query(".gui-list__scroll-viewport")],De.prototype,"viewportElement",2),De=xe([n.customElement("gui-list")],De),typeof customElements<"u"&&!customElements.get("gui-list")&&customElements.define("gui-list",De);var Hc=Object.defineProperty,Wc=Object.getOwnPropertyDescriptor,oa=(e,t,i,a)=>{for(var r=a>1?void 0:a?Wc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Hc(t,i,r),r};let Mt=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.errors=[],this.touched=!1}createRenderRoot(){return this}render(){return super.render(),l.html`${j(this.uid,{touched:this.touched,errors:this.errors})}`}};oa([n.property({type:String})],Mt.prototype,"uid",2),oa([n.property({type:Array})],Mt.prototype,"errors",2),oa([n.property({type:Boolean})],Mt.prototype,"touched",2),Mt=oa([n.customElement("gui-errors")],Mt),typeof customElements<"u"&&!customElements.get("gui-errors")&&customElements.define("gui-errors",Mt);var Kc=Object.defineProperty,Jc=Object.getOwnPropertyDescriptor,it=(e,t,i,a)=>{for(var r=a>1?void 0:a?Jc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Kc(t,i,r),r};let Ye=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.debouncer=new es.Subject,this.subscriptions=[],this._range={start:0,end:10},this._filteredItems=[],this._listItems=[],this._focusedIndex=-1,this._isFiltering=!1,this._isListVisible=!1,this._selectedItem=void 0,this._ignoreNextFocus=!1,this.onDocumentClick=e=>{if(!this._isListVisible)return;const t=e.composedPath(),i=this._inputRef&&t.includes(this._inputRef),a=this._listRef&&t.includes(this._listRef);!i&&!a&&(this._isListVisible=!1)}}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onDocumentClick),this.classList.add("gui-dropdown","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this._filteredItems=this.adapter.templateData.items,this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>{const e=this.adapter.templateData;e.items&&this._listItems?.length===0&&this._filteredItems?.length===0&&(this._filteredItems=e.items,this._listItems=e.items),this.requestUpdate()}),this.debouncer.pipe(es.debounceTime(this.adapter.templateData.inputDebounce??500)).subscribe(e=>{this._filterItems(e)}))}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}_onRangeChange(e){this._range={start:e.detail.startIndex,end:e.detail.endIndex}}_onUpdateItems(e){const t=e.detail||[];if(this._listItems=t,!this._selectedItem&&this.adapter.templateData.value!=null){const i=t.find(a=>a.value===this.adapter.templateData.value);i&&(this._selectedItem=i)}}_onFocusChange(e){this._focusedIndex=e.detail.index}_onClickItem(e,t){if(this.adapter.templateData.readonly||e.disabled)return;const i=this.adapter.templateData;this.adapter.valueChanged(e.value),this.adapter.filterChanged(""),this._focusedIndex=t,this._selectedItem=e,this._isFiltering=!1,this._isListVisible=!1,this._listRef&&(this._listRef.focusItemAtIndex(t),this._inputRef.value=i.valueField?e.template[i.valueField]:e.template)}_onValueChange(e){const t=e.detail.value;this.adapter.valueChanged(t),this.adapter.filterChanged(""),this._selectedItem=this._listItems.find(i=>i.value===t),this._isFiltering=!1,this._isListVisible=!1}async _onKeyDown(e){switch(e.key){case"ArrowDown":e.preventDefault(),this._isListVisible=!0,await this.updateComplete,this._listRef.focus(),this._listRef.scrollToSelectedIndex();break;case"Enter":this._inputRef.value||(this.adapter.valueChanged(null),this._isListVisible=!1,this._isFiltering=!1);break}}_onInput(e){const t=e.target.value;this.debouncer.next(t)}_filterItems(e){const t=this.adapter.templateData,i=!!this.widget.on?.filter;if(this.adapter.filterChanged(e),e&&!i){this._isFiltering=!0,this._isListVisible=!0;const a=t.searchFields??[t.labelField,t.valueField].filter(d=>!!d),r=a.length>0,o=(t.items||[]).filter(d=>{if(d===null||typeof d!="object")return d!=null&&d.toString().toLowerCase().includes(e.toLowerCase());const u=Object.keys(d),h=(c,y)=>c||d[y].toString().toLowerCase().includes(e.toLowerCase());return r?u.filter(c=>a.includes(c)).reduce(h,!1):u.reduce(h,!1)});this._filteredItems=[...o]}else this._isFiltering=!1,this._filteredItems=[...t.items]}_onWidgetKeyDown(e){e.key!=="Escape"||!this._isListVisible||(e.preventDefault(),e.stopPropagation(),this._isListVisible=!1,this._isFiltering=!1,this._ignoreNextFocus=!0,this._inputRef?.focus(),setTimeout(()=>{this._ignoreNextFocus=!1}))}async _onFocus(){this._ignoreNextFocus||(this._isListVisible=!0,await this.updateComplete,this._listRef.scrollToSelectedIndex())}_onFocusOutInput(e){const t=e.relatedTarget;t&&this.contains(t)||(this.adapter.onBlur(),this._isListVisible=!1,this._isFiltering=!1)}_onBlur(){this.adapter.onBlur(),this._isListVisible=!1,this._isFiltering=!1}render(){const e=this.adapter.templateData,t=e.touched&&e.errors&&e.errors.length>0,i=this._listItems.slice(this._range.start,this._range.end),a=this.adapter.getItemRenderer(e.itemRenderer,Yn),s=this._selectedItem?.template!==null&&typeof this._selectedItem?.template=="object"?e.labelField??"label":null,o=s?this._selectedItem?.template[s]:this._selectedItem?.template,d=!!this.widget.on?.filter;return l.html`
1699
1957
  <gui-label
1700
1958
  .targetElement=${[this._listRef,this._inputRef]}
1701
1959
  .uid=${this.widget.uid}
@@ -1707,13 +1965,10 @@
1707
1965
  .native=${!1}
1708
1966
  ></gui-label>
1709
1967
 
1710
- <div
1711
- class="gui-widget"
1712
- aria-expanded=${this._isListVisible}
1713
- @keydown=${this._onWidgetKeyDown}
1714
- >
1968
+ <div class="gui-widget" @keydown=${this._onWidgetKeyDown}>
1715
1969
  <input
1716
1970
  type="text"
1971
+ role="combobox"
1717
1972
  id=${this.widget.uid}
1718
1973
  data-cy=${`${this.widget.uid}_textinput`}
1719
1974
  class="gui-widget-input"
@@ -1727,22 +1982,31 @@
1727
1982
  @input=${this._onInput}
1728
1983
  @focusout=${this._onFocusOutInput}
1729
1984
  @focus=${this._onFocus}
1985
+ aria-expanded=${this._isListVisible?"true":"false"}
1986
+ aria-controls=${`${this.widget.uid}-list`}
1987
+ aria-autocomplete="list"
1730
1988
  aria-labelledby=${e.label?`${this.widget.uid}_label`:l.nothing}
1731
1989
  aria-describedby=${e.hint?`${this.widget.uid}_hint`:l.nothing}
1732
1990
  />
1733
1991
  <span class="gui-dropdown__arrow"
1734
- ><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256">
1992
+ ><svg
1993
+ xmlns="http://www.w3.org/2000/svg"
1994
+ width="16"
1995
+ height="16"
1996
+ viewBox="0 0 256 256"
1997
+ aria-hidden="true"
1998
+ >
1735
1999
  <path
1736
2000
  d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
1737
2001
  ></path></svg
1738
2002
  ></span>
1739
2003
 
1740
2004
  <gui-list
1741
- id=${this.widget.uid}
2005
+ id=${`${this.widget.uid}-list`}
1742
2006
  .uid=${this.widget.uid}
1743
2007
  .value=${e.value??""}
1744
2008
  .valueField=${e.valueField}
1745
- .items=${this._isFiltering&&!u?this._filteredItems:e.items}
2009
+ .items=${this._isFiltering&&!d?this._filteredItems:e.items}
1746
2010
  .itemHeight=${e.itemHeight}
1747
2011
  .height=${e.height}
1748
2012
  ?required=${e.validator?.required}
@@ -1757,7 +2021,7 @@
1757
2021
  @blur=${this._onBlur}
1758
2022
  @change=${this._onValueChange}
1759
2023
  >
1760
- ${i.map((p,d)=>{const h=this._range.start+d,c=e.value===p.value,g=this._focusedIndex===h,f=!!e.disabled||!!p.disabled,S=e.labelField??"label",Be=p.template!==null&&typeof p.template=="object"&&S&&!e.itemRenderer?p.template[S]:p.template;return l.html`
2024
+ ${i.map((p,u)=>{const h=this._range.start+u,c=e.value===p.value,y=this._focusedIndex===h,g=!!e.disabled||!!p.disabled,_=e.labelField??"label",Ae=p.template!==null&&typeof p.template=="object"&&_&&!e.itemRenderer?p.template[_]:p.template;return l.html`
1761
2025
  <div
1762
2026
  role="option"
1763
2027
  tabindex="-1"
@@ -1765,10 +2029,10 @@
1765
2029
  id="${this.widget.uid}-item-${h}"
1766
2030
  style="height: ${e.itemHeight||40}px"
1767
2031
  aria-selected=${c?"true":"false"}
1768
- aria-disabled=${f?"true":"false"}
2032
+ aria-disabled=${g?"true":"false"}
1769
2033
  @click=${()=>this._onClickItem(p,h)}
1770
2034
  >
1771
- ${a({template:Be,value:p.value,index:h,selected:c,disabled:f,focused:g})}
2035
+ ${a({template:Ae,value:p.value,index:h,selected:c,disabled:g,focused:y})}
1772
2036
  </div>
1773
2037
  `})}
1774
2038
  </gui-list>
@@ -1779,7 +2043,7 @@
1779
2043
  .errors=${e.errors}
1780
2044
  .touched=${e.touched}
1781
2045
  ></gui-errors>`:l.nothing}
1782
- `}};et([b.consume({context:m.formContext}),n.property({attribute:!1})],Ue.prototype,"formContext",2),et([b.provide({context:m.inputContext})],Ue.prototype,"adapter",2),et([n.state()],Ue.prototype,"_range",2),et([n.state()],Ue.prototype,"_filteredItems",2),et([n.state()],Ue.prototype,"_listItems",2),et([n.state()],Ue.prototype,"_focusedIndex",2),et([n.state()],Ue.prototype,"_isFiltering",2),et([n.state()],Ue.prototype,"_isListVisible",2),et([n.state()],Ue.prototype,"_selectedItem",2),et([n.query("input")],Ue.prototype,"_inputRef",2),et([n.query("gui-list")],Ue.prototype,"_listRef",2),Ue=et([n.customElement("gui-dropdown-input")],Ue);const zh=Object.freeze(Object.defineProperty({__proto__:null,get DropdownElement(){return Ue}},Symbol.toStringTag,{value:"Module"}));var Vh=Object.defineProperty,Gh=Object.getOwnPropertyDescriptor,$t=(e,t,i,a)=>{for(var r=a>1?void 0:a?Gh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Vh(t,i,r),r};let ct=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[],this._range={start:0,end:10},this._listItems=[],this._focusedIndex=-1}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-list","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>{const e=this.adapter.templateData;e.items&&this._listItems.length===0&&(this._listItems=e.items),this.requestUpdate()}))}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}render(){const e=this.adapter.templateData,t=e.touched&&e.errors&&e.errors.length>0,i=this._listItems.slice(this._range.start,this._range.end),a=this.adapter.getItemRenderer(e.itemRenderer,Qs);return l.html`
2046
+ `}};it([f.consume({context:m.formContext}),n.property({attribute:!1})],Ye.prototype,"formContext",2),it([f.provide({context:m.inputContext})],Ye.prototype,"adapter",2),it([n.state()],Ye.prototype,"_range",2),it([n.state()],Ye.prototype,"_filteredItems",2),it([n.state()],Ye.prototype,"_listItems",2),it([n.state()],Ye.prototype,"_focusedIndex",2),it([n.state()],Ye.prototype,"_isFiltering",2),it([n.state()],Ye.prototype,"_isListVisible",2),it([n.state()],Ye.prototype,"_selectedItem",2),it([n.query("input")],Ye.prototype,"_inputRef",2),it([n.query("gui-list")],Ye.prototype,"_listRef",2),Ye=it([n.customElement("gui-dropdown-input")],Ye);const Xc=Object.freeze(Object.defineProperty({__proto__:null,get DropdownElement(){return Ye}},Symbol.toStringTag,{value:"Module"}));var Qc=Object.defineProperty,jc=Object.getOwnPropertyDescriptor,Tt=(e,t,i,a)=>{for(var r=a>1?void 0:a?jc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Qc(t,i,r),r};let gt=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[],this._range={start:0,end:10},this._listItems=[],this._focusedIndex=-1}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-list","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>{const e=this.adapter.templateData;e.items&&this._listItems.length===0&&(this._listItems=e.items),this.requestUpdate()}))}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}render(){const e=this.adapter.templateData,t=e.touched&&e.errors&&e.errors.length>0,i=this._listItems.slice(this._range.start,this._range.end),a=this.adapter.getItemRenderer(e.itemRenderer,Yn);return l.html`
1783
2047
  <gui-label
1784
2048
  .targetElement=${this._guiListRef}
1785
2049
  .uid=${this.widget.uid}
@@ -1811,18 +2075,18 @@
1811
2075
  @blur=${()=>this.adapter.onBlur()}
1812
2076
  @change=${this._valueChanged}
1813
2077
  >
1814
- ${i.map((r,s)=>{const o=this._range.start+s,u=e.value===r.value,p=this._focusedIndex===o,d=!!e.disabled||!!r.disabled,h=e.labelField??"label",g=r.template!==null&&typeof r.template=="object"&&h&&!e.itemRenderer?r.template[h]:r.template;return l.html`
2078
+ ${i.map((r,s)=>{const o=this._range.start+s,d=e.value===r.value,p=this._focusedIndex===o,u=!!e.disabled||!!r.disabled,h=e.labelField??"label",y=r.template!==null&&typeof r.template=="object"&&h&&!e.itemRenderer?r.template[h]:r.template;return l.html`
1815
2079
  <div
1816
2080
  role="option"
1817
2081
  tabindex="-1"
1818
2082
  class="gui-list__item-wrapper"
1819
2083
  id="${this.widget.uid}-item-${o}"
1820
2084
  style="height: ${e.itemHeight||40}px"
1821
- aria-selected=${u?"true":"false"}
1822
- aria-disabled=${d?"true":"false"}
2085
+ aria-selected=${d?"true":"false"}
2086
+ aria-disabled=${u?"true":"false"}
1823
2087
  @click=${()=>this._onClickItem(r,o)}
1824
2088
  >
1825
- ${a({template:g,value:r.value,index:o,selected:u,disabled:d,focused:p})}
2089
+ ${a({template:y,value:r.value,index:o,selected:d,disabled:u,focused:p})}
1826
2090
  </div>
1827
2091
  `})}
1828
2092
  </gui-list>
@@ -1833,23 +2097,29 @@
1833
2097
  .errors=${e.errors}
1834
2098
  .touched=${e.touched}
1835
2099
  ></gui-errors>`:l.nothing}
1836
- `}_onRangeChange(e){this._range={start:e.detail.startIndex,end:e.detail.endIndex}}_onUpdateItems(e){this._listItems=e.detail||[]}_onFocusChange(e){this._focusedIndex=e.detail.index}_onClickItem(e,t){this.adapter.templateData.disabled||e.disabled||(this.adapter.valueChanged(e.value),this._focusedIndex=t,this._guiListRef&&typeof this._guiListRef.focusItemAtIndex=="function"&&this._guiListRef.focusItemAtIndex(t))}_valueChanged(e){this.adapter.templateData.readonly||this.adapter.valueChanged(e.detail.value)}};$t([b.consume({context:m.formContext}),n.property({attribute:!1})],ct.prototype,"formContext",2),$t([b.provide({context:m.inputContext})],ct.prototype,"adapter",2),$t([n.state()],ct.prototype,"_range",2),$t([n.state()],ct.prototype,"_listItems",2),$t([n.state()],ct.prototype,"_focusedIndex",2),$t([n.query("gui-list")],ct.prototype,"_guiListRef",2),ct=$t([n.customElement("gui-list-input")],ct);const Uh=Object.freeze(Object.defineProperty({__proto__:null,get ListElement(){return ct}},Symbol.toStringTag,{value:"Module"}));var Zh=Object.defineProperty,Hh=Object.getOwnPropertyDescriptor,Ua=(e,t,i,a)=>{for(var r=a>1?void 0:a?Hh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Zh(t,i,r),r};let ii=class extends l.LitElement{constructor(){super(...arguments),this.md=void 0,this.dependencies=void 0}createRenderRoot(){return this}render(){return l.html`${rn.unsafeHTML(this.dependencies?.markdown?.parse(this.md??""))}`}};Ua([n.property({type:String})],ii.prototype,"md",2),Ua([n.property({type:Object})],ii.prototype,"dependencies",2),ii=Ua([n.customElement("gui-markdown-text")],ii),typeof customElements<"u"&&!customElements.get("gui-markdown-text")&&customElements.define("gui-markdown-text",ii);var Wh=Object.defineProperty,Yh=Object.getOwnPropertyDescriptor,B=(e,t,i,a)=>{for(var r=a>1?void 0:a?Yh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Wh(t,i,r),r};let A=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.tools=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.minimumHeight=void 0,this.autoGrow=!1,this.defaultOpenPreview=void 0,this.maxLength=void 0,this.headingTitle=void 0,this.boldTitle=void 0,this.italicTitle=void 0,this.strikethroughTitle=void 0,this.quoteTitle=void 0,this.linkTitle=void 0,this.orderedListTitle=void 0,this.unorderedListTitle=void 0,this.splitViewTitle=void 0,this.dependencies=void 0,this.splitViewActive=!1,this.activeFormats={},this.splitViewInitialized=!1,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`textarea[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}updated(){this.recalculateAutoGrow()}willUpdate(e){!this.splitViewInitialized&&e.has("defaultOpenPreview")&&(this.splitViewActive=!!this.defaultOpenPreview,this.splitViewInitialized=!0)}render(){super.render();const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint,placeholder:this.placeholder,counterMode:this.counterMode??"remaining",minimumHeight:this.minimumHeight??120,autoGrow:this.autoGrow??!1,defaultOpenPreview:this.defaultOpenPreview??!1,maxLength:this.maxLength,dependencies:this.dependencies},t={"gui-widget-input":!0,"gui-markdown--icon":!1};let i=l.html``;if(e.counterMode&&e.maxLength){const r={"gui-markdown--counter":!0,"gui-markdown--counter__error":(e.value?.length??0)>e.maxLength},s=e.counterMode==="current"?l.html`<span>${e.value?.length??0}</span>`:l.html`<span>${e.maxLength-(e.value?.length??0)}</span>`;i=l.html`<div class=${w.classMap(r)}>
2100
+ `}_onRangeChange(e){this._range={start:e.detail.startIndex,end:e.detail.endIndex}}_onUpdateItems(e){this._listItems=e.detail||[]}_onFocusChange(e){this._focusedIndex=e.detail.index}_onClickItem(e,t){this.adapter.templateData.disabled||e.disabled||(this.adapter.valueChanged(e.value),this._focusedIndex=t,this._guiListRef&&typeof this._guiListRef.focusItemAtIndex=="function"&&this._guiListRef.focusItemAtIndex(t))}_valueChanged(e){this.adapter.templateData.readonly||this.adapter.valueChanged(e.detail.value)}};Tt([f.consume({context:m.formContext}),n.property({attribute:!1})],gt.prototype,"formContext",2),Tt([f.provide({context:m.inputContext})],gt.prototype,"adapter",2),Tt([n.state()],gt.prototype,"_range",2),Tt([n.state()],gt.prototype,"_listItems",2),Tt([n.state()],gt.prototype,"_focusedIndex",2),Tt([n.query("gui-list")],gt.prototype,"_guiListRef",2),gt=Tt([n.customElement("gui-list-input")],gt);const em=Object.freeze(Object.defineProperty({__proto__:null,get ListElement(){return gt}},Symbol.toStringTag,{value:"Module"}));var tm=Object.defineProperty,im=Object.getOwnPropertyDescriptor,Or=(e,t,i,a)=>{for(var r=a>1?void 0:a?im(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&tm(t,i,r),r};let ni=class extends l.LitElement{constructor(){super(...arguments),this.md=void 0,this.dependencies=void 0}createRenderRoot(){return this}render(){return l.html`${Xn.unsafeHTML(this.dependencies?.markdown?.parse(this.md??""))}`}};Or([n.property({type:String})],ni.prototype,"md",2),Or([n.property({type:Object})],ni.prototype,"dependencies",2),ni=Or([n.customElement("gui-markdown-text")],ni),typeof customElements<"u"&&!customElements.get("gui-markdown-text")&&customElements.define("gui-markdown-text",ni);var am=Object.defineProperty,rm=Object.getOwnPropertyDescriptor,Z=(e,t,i,a)=>{for(var r=a>1?void 0:a?rm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&am(t,i,r),r};let B=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.tools=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.minimumHeight=void 0,this.autoGrow=!1,this.defaultOpenPreview=void 0,this.maxLength=void 0,this.headingTitle=void 0,this.boldTitle=void 0,this.italicTitle=void 0,this.strikethroughTitle=void 0,this.quoteTitle=void 0,this.linkTitle=void 0,this.orderedListTitle=void 0,this.unorderedListTitle=void 0,this.splitViewTitle=void 0,this.toolbarAriaLabel=void 0,this.dependencies=void 0,this.splitViewActive=!1,this.activeFormats={},this.splitViewInitialized=!1,this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`textarea[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}updated(){this.recalculateAutoGrow()}willUpdate(e){!this.splitViewInitialized&&e.has("defaultOpenPreview")&&(this.splitViewActive=!!this.defaultOpenPreview,this.splitViewInitialized=!0)}render(){super.render();const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint,placeholder:this.placeholder,counterMode:this.counterMode??"remaining",minimumHeight:this.minimumHeight??120,autoGrow:this.autoGrow??!1,defaultOpenPreview:this.defaultOpenPreview??!1,maxLength:this.maxLength,dependencies:this.dependencies},t={"gui-widget-input":!0,"gui-markdown--icon":!1};let i=l.html``;if(e.counterMode&&e.maxLength){const r={"gui-markdown--counter":!0,"gui-markdown--counter__error":(e.value?.length??0)>e.maxLength},s=e.counterMode==="current"?l.html`<span>${e.value?.length??0}</span>`:l.html`<span>${e.maxLength-(e.value?.length??0)}</span>`;i=l.html`<div class=${T.classMap(r)}>
1837
2101
  ${s}
1838
2102
  <span> / ${e.maxLength}</span>
1839
2103
  </div>`}const a={"min-height":`${e.minimumHeight}px`};return l.html`
1840
- ${se(this.uid,e)}
2104
+ ${le(this.uid,e)}
1841
2105
 
1842
2106
  <div
1843
- class=${w.classMap({"gui-widget":!0,"gui-markdown--with-preview":this.splitViewActive})}
2107
+ class=${T.classMap({"gui-widget":!0,"gui-markdown--with-preview":this.splitViewActive})}
1844
2108
  >
1845
- <nav class="gui-markdown__toolbar">
1846
- <ul>
2109
+ <nav
2110
+ class="gui-markdown__toolbar"
2111
+ role="toolbar"
2112
+ aria-label=${this.toolbarAriaLabel??"Text formatting"}
2113
+ >
2114
+ <ul role="presentation">
1847
2115
  ${(this.tools??["H","B","I","S","Q","L","|","OL","UL"]).map(r=>this.renderToolbarItem(r))}
1848
- <li>
2116
+ <li role="presentation">
1849
2117
  <button
1850
2118
  type="button"
1851
- tabindex="0"
1852
- class=${w.classMap({"gui-markdown__toolbar-button":!0,"gui-markdown__toolbar-button--active":this.splitViewActive})}
2119
+ class=${T.classMap({"gui-markdown__toolbar-button":!0,"gui-markdown__toolbar-button--active":this.splitViewActive})}
2120
+ ?disabled=${this.disabled}
2121
+ aria-label=${this.splitViewTitle??"Split View"}
2122
+ aria-pressed=${this.splitViewActive?"true":"false"}
1853
2123
  @click=${this.splitView}
1854
2124
  title=${this.splitViewTitle??"Split View"}
1855
2125
  >
@@ -1858,6 +2128,7 @@
1858
2128
  width="20"
1859
2129
  height="20"
1860
2130
  viewBox="0 0 256 256"
2131
+ aria-hidden="true"
1861
2132
  >
1862
2133
  <path
1863
2134
  d="M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40ZM56,56h64V200H56ZM200,200H136V56h64V200Z"
@@ -1870,13 +2141,13 @@
1870
2141
 
1871
2142
  <div class="gui-markdown__container">
1872
2143
  <textarea
1873
- id=${aa.ifDefined(this.uid)}
1874
- class=${w.classMap(t)}
1875
- style=${bt.styleMap(a)}
2144
+ id=${la.ifDefined(this.uid)}
2145
+ class=${T.classMap(t)}
2146
+ style=${vt.styleMap(a)}
1876
2147
  ?required=${e.required}
1877
2148
  ?disabled=${e.disabled}
1878
2149
  ?readonly=${e.readonly}
1879
- placeholder=${aa.ifDefined(e.placeholder)}
2150
+ placeholder=${la.ifDefined(e.placeholder)}
1880
2151
  autocomplete=${this.autocomplete||l.nothing}
1881
2152
  .value=${this.value||""}
1882
2153
  @input=${this.valueChanged}
@@ -1887,9 +2158,9 @@
1887
2158
 
1888
2159
  ${this.splitViewActive?l.html`
1889
2160
  <section
1890
- data-cy=${aa.ifDefined(this.uid?`${this.uid}_markdown`:l.nothing)}
2161
+ data-cy=${la.ifDefined(this.uid?`${this.uid}_markdown`:l.nothing)}
1891
2162
  class="gui-markdown__preview"
1892
- style=${bt.styleMap(a)}
2163
+ style=${vt.styleMap(a)}
1893
2164
  >
1894
2165
  <gui-markdown-text
1895
2166
  .md=${this.value||""}
@@ -1901,136 +2172,206 @@
1901
2172
  </div>
1902
2173
 
1903
2174
  <div class="gui-markdown--validation">
1904
- <div>${W(this.uid,e)}</div>
2175
+ <div>${j(this.uid,e)}</div>
1905
2176
  ${i}
1906
2177
  </div>
1907
- `}recalculateAutoGrow(){if(!this.autoGrow)return;const e=this.querySelector(`textarea[id="${this.uid}"]`);if(!e)return;const t=window.getComputedStyle(e),i=parseFloat(t.paddingTop),a=parseFloat(t.paddingBottom),r=i+a;e.style.height="auto",e.style.height=`${Math.max(this.minimumHeight??120,e.scrollHeight-r)}px`}splitView(){this.splitViewActive=!this.splitViewActive}renderToolbarItem(e){switch(e){case"H":return l.html`<li>
2178
+ `}recalculateAutoGrow(){if(!this.autoGrow)return;const e=this.querySelector(`textarea[id="${this.uid}"]`);if(!e)return;const t=window.getComputedStyle(e),i=parseFloat(t.paddingTop),a=parseFloat(t.paddingBottom),r=i+a;e.style.height="auto",e.style.height=`${Math.max(this.minimumHeight??120,e.scrollHeight-r)}px`}splitView(){this.disabled||(this.splitViewActive=!this.splitViewActive)}renderToolbarItem(e){switch(e){case"H":return l.html`<li role="presentation">
1908
2179
  <button
1909
2180
  type="button"
1910
- tabindex="0"
1911
2181
  class=${this.toolbarBtnClass("heading")}
2182
+ ?disabled=${this.disabled||this.readOnly}
2183
+ aria-label=${this.headingTitle??"Heading"}
2184
+ aria-pressed=${this.activeFormats.heading?"true":"false"}
1912
2185
  @click=${this.applyFormat("# ","","heading")}
1913
2186
  title=${this.headingTitle??"Heading"}
1914
2187
  >
1915
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256">
2188
+ <svg
2189
+ xmlns="http://www.w3.org/2000/svg"
2190
+ width="20"
2191
+ height="20"
2192
+ viewBox="0 0 256 256"
2193
+ aria-hidden="true"
2194
+ >
1916
2195
  <path
1917
2196
  d="M212,56V200a12,12,0,0,1-24,0V140H68v60a12,12,0,0,1-24,0V56a12,12,0,0,1,24,0v60H188V56a12,12,0,0,1,24,0Z"
1918
2197
  ></path>
1919
2198
  </svg>
1920
2199
  </button>
1921
- </li>`;case"B":return l.html`<li>
2200
+ </li>`;case"B":return l.html`<li role="presentation">
1922
2201
  <button
1923
2202
  type="button"
1924
- tabindex="0"
1925
2203
  class=${this.toolbarBtnClass("bold")}
2204
+ ?disabled=${this.disabled||this.readOnly}
2205
+ aria-label=${this.boldTitle??"Bold"}
2206
+ aria-pressed=${this.activeFormats.bold?"true":"false"}
1926
2207
  @click=${this.applyFormat("**","**","bold")}
1927
2208
  title=${this.boldTitle??"Bold"}
1928
2209
  >
1929
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256">
2210
+ <svg
2211
+ xmlns="http://www.w3.org/2000/svg"
2212
+ width="20"
2213
+ height="20"
2214
+ viewBox="0 0 256 256"
2215
+ aria-hidden="true"
2216
+ >
1930
2217
  <path
1931
2218
  d="M185.08,114.46A48,48,0,0,0,148,36H80A12,12,0,0,0,68,48V200a12,12,0,0,0,12,12h80a52,52,0,0,0,25.08-97.54ZM92,60h56a24,24,0,0,1,0,48H92Zm68,128H92V132h68a28,28,0,0,1,0,56Z"
1932
2219
  ></path>
1933
2220
  </svg>
1934
2221
  </button>
1935
- </li>`;case"I":return l.html`<li>
2222
+ </li>`;case"I":return l.html`<li role="presentation">
1936
2223
  <button
1937
2224
  type="button"
1938
- tabindex="0"
1939
2225
  class=${this.toolbarBtnClass("italic")}
2226
+ ?disabled=${this.disabled||this.readOnly}
2227
+ aria-label=${this.italicTitle??"Italic"}
2228
+ aria-pressed=${this.activeFormats.italic?"true":"false"}
1940
2229
  @click=${this.applyFormat("_","_","italic")}
1941
2230
  title=${this.italicTitle??"Italic"}
1942
2231
  >
1943
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256">
2232
+ <svg
2233
+ xmlns="http://www.w3.org/2000/svg"
2234
+ width="20"
2235
+ height="20"
2236
+ viewBox="0 0 256 256"
2237
+ aria-hidden="true"
2238
+ >
1944
2239
  <path
1945
2240
  d="M204,56a12,12,0,0,1-12,12H160.65l-40,120H144a12,12,0,0,1,0,24H64a12,12,0,0,1,0-24H95.35l40-120H112a12,12,0,0,1,0-24h80A12,12,0,0,1,204,56Z"
1946
2241
  ></path>
1947
2242
  </svg>
1948
2243
  </button>
1949
- </li>`;case"S":return l.html`<li>
2244
+ </li>`;case"S":return l.html`<li role="presentation">
1950
2245
  <button
1951
2246
  type="button"
1952
- tabindex="0"
1953
2247
  class=${this.toolbarBtnClass("strikethrough")}
2248
+ ?disabled=${this.disabled||this.readOnly}
2249
+ aria-label=${this.strikethroughTitle??"Strikethrough"}
2250
+ aria-pressed=${this.activeFormats.strikethrough?"true":"false"}
1954
2251
  @click=${this.applyFormat("~~","~~","strikethrough")}
1955
2252
  title=${this.strikethroughTitle??"Strikethrough"}
1956
2253
  >
1957
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256">
2254
+ <svg
2255
+ xmlns="http://www.w3.org/2000/svg"
2256
+ width="20"
2257
+ height="20"
2258
+ viewBox="0 0 256 256"
2259
+ aria-hidden="true"
2260
+ >
1958
2261
  <path
1959
2262
  d="M224,128a8,8,0,0,1-8,8H175.93c9.19,7.11,16.07,17.2,16.07,32,0,13.34-7,25.7-19.75,34.79C160.33,211.31,144.61,216,128,216s-32.33-4.69-44.25-13.21C71,193.7,64,181.34,64,168a8,8,0,0,1,16,0c0,17.35,22,32,48,32s48-14.65,48-32c0-14.85-10.54-23.58-38.77-32H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM76.33,104a8,8,0,0,0,7.61-10.49A17.3,17.3,0,0,1,83.11,88c0-18.24,19.3-32,44.89-32,18.84,0,34.16,7.42,41,19.85a8,8,0,0,0,14-7.7C173.33,50.52,152.77,40,128,40,93.29,40,67.11,60.63,67.11,88a33.73,33.73,0,0,0,1.62,10.49A8,8,0,0,0,76.33,104Z"
1960
2263
  ></path>
1961
2264
  </svg>
1962
2265
  </button>
1963
- </li>`;case"Q":return l.html`<li>
2266
+ </li>`;case"Q":return l.html`<li role="presentation">
1964
2267
  <button
1965
2268
  type="button"
1966
- tabindex="0"
1967
2269
  class=${this.toolbarBtnClass("quote")}
2270
+ ?disabled=${this.disabled||this.readOnly}
2271
+ aria-label=${this.quoteTitle??"Quote"}
2272
+ aria-pressed=${this.activeFormats.quote?"true":"false"}
1968
2273
  @click=${this.applyFormat("> ","","quote")}
1969
2274
  title=${this.quoteTitle??"Quote"}
1970
2275
  >
1971
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256">
2276
+ <svg
2277
+ xmlns="http://www.w3.org/2000/svg"
2278
+ width="20"
2279
+ height="20"
2280
+ viewBox="0 0 256 256"
2281
+ aria-hidden="true"
2282
+ >
1972
2283
  <path
1973
2284
  d="M100,52H40A20,20,0,0,0,20,72v64a20,20,0,0,0,20,20H96v4a28,28,0,0,1-28,28,12,12,0,0,0,0,24,52.06,52.06,0,0,0,52-52V72A20,20,0,0,0,100,52Zm-4,80H44V76H96ZM216,52H156a20,20,0,0,0-20,20v64a20,20,0,0,0,20,20h56v4a28,28,0,0,1-28,28,12,12,0,0,0,0,24,52.06,52.06,0,0,0,52-52V72A20,20,0,0,0,216,52Zm-4,80H160V76h52Z"
1974
2285
  ></path>
1975
2286
  </svg>
1976
2287
  </button>
1977
- </li>`;case"L":return l.html`<li>
2288
+ </li>`;case"L":return l.html`<li role="presentation">
1978
2289
  <button
1979
2290
  type="button"
1980
- tabindex="0"
1981
2291
  class=${this.toolbarBtnClass("link")}
2292
+ ?disabled=${this.disabled||this.readOnly}
2293
+ aria-label=${this.linkTitle??"Link"}
2294
+ aria-pressed=${this.activeFormats.link?"true":"false"}
1982
2295
  @click=${this.applyFormat("[","](url)","link")}
1983
2296
  title=${this.linkTitle??"Link"}
1984
2297
  >
1985
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256">
2298
+ <svg
2299
+ xmlns="http://www.w3.org/2000/svg"
2300
+ width="20"
2301
+ height="20"
2302
+ viewBox="0 0 256 256"
2303
+ aria-hidden="true"
2304
+ >
1986
2305
  <path
1987
2306
  d="M117.18,188.74a12,12,0,0,1,0,17l-5.12,5.12A58.26,58.26,0,0,1,70.6,228h0A58.62,58.62,0,0,1,29.14,127.92L63.89,93.17a58.64,58.64,0,0,1,98.56,28.11,12,12,0,1,1-23.37,5.44,34.65,34.65,0,0,0-58.22-16.58L46.11,144.89A34.62,34.62,0,0,0,70.57,204h0a34.41,34.41,0,0,0,24.49-10.14l5.11-5.12A12,12,0,0,1,117.18,188.74ZM226.83,45.17a58.65,58.65,0,0,0-82.93,0l-5.11,5.11a12,12,0,0,0,17,17l5.12-5.12a34.63,34.63,0,1,1,49,49L175.1,145.86A34.39,34.39,0,0,1,150.61,156h0a34.63,34.63,0,0,1-33.69-26.72,12,12,0,0,0-23.38,5.44A58.64,58.64,0,0,0,150.56,180h.05a58.28,58.28,0,0,0,41.47-17.17l34.75-34.75a58.62,58.62,0,0,0,0-82.91Z"
1988
2307
  ></path>
1989
2308
  </svg>
1990
2309
  </button>
1991
- </li>`;case"OL":return l.html`<li>
2310
+ </li>`;case"OL":return l.html`<li role="presentation">
1992
2311
  <button
1993
2312
  type="button"
1994
- tabindex="0"
1995
2313
  class=${this.toolbarBtnClass("orderedList")}
2314
+ ?disabled=${this.disabled||this.readOnly}
2315
+ aria-label=${this.orderedListTitle??"Ordered List"}
2316
+ aria-pressed=${this.activeFormats.orderedList?"true":"false"}
1996
2317
  @click=${this.applyFormat("1. ","","orderedList")}
1997
2318
  title=${this.orderedListTitle??"Ordered List"}
1998
2319
  >
1999
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256">
2320
+ <svg
2321
+ xmlns="http://www.w3.org/2000/svg"
2322
+ width="20"
2323
+ height="20"
2324
+ viewBox="0 0 256 256"
2325
+ aria-hidden="true"
2326
+ >
2000
2327
  <path
2001
2328
  d="M228,128a12,12,0,0,1-12,12H116a12,12,0,0,1,0-24H216A12,12,0,0,1,228,128ZM116,76H216a12,12,0,0,0,0-24H116a12,12,0,0,0,0,24ZM216,180H116a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24ZM44,59.31V104a12,12,0,0,0,24,0V40A12,12,0,0,0,50.64,29.27l-16,8a12,12,0,0,0,9.36,22Zm39.73,96.86a27.7,27.7,0,0,0-11.2-18.63A28.89,28.89,0,0,0,32.9,143a27.71,27.71,0,0,0-4.17,7.54,12,12,0,0,0,22.55,8.21,4,4,0,0,1,.58-1,4.78,4.78,0,0,1,6.5-.82,3.82,3.82,0,0,1,1.61,2.6,3.63,3.63,0,0,1-.77,2.77l-.13.17L30.39,200.82A12,12,0,0,0,40,220H72a12,12,0,0,0,0-24H64l14.28-19.11A27.48,27.48,0,0,0,83.73,156.17Z"
2002
2329
  ></path>
2003
2330
  </svg>
2004
2331
  </button>
2005
- </li>`;case"UL":return l.html`<li>
2332
+ </li>`;case"UL":return l.html`<li role="presentation">
2006
2333
  <button
2007
2334
  type="button"
2008
- tabindex="0"
2009
2335
  class=${this.toolbarBtnClass("unorderedList")}
2336
+ ?disabled=${this.disabled||this.readOnly}
2337
+ aria-label=${this.unorderedListTitle??"Unordered List"}
2338
+ aria-pressed=${this.activeFormats.unorderedList?"true":"false"}
2010
2339
  @click=${this.applyFormat("- ","","unorderedList")}
2011
2340
  title=${this.unorderedListTitle??"Unordered List"}
2012
2341
  >
2013
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256">
2342
+ <svg
2343
+ xmlns="http://www.w3.org/2000/svg"
2344
+ width="20"
2345
+ height="20"
2346
+ viewBox="0 0 256 256"
2347
+ aria-hidden="true"
2348
+ >
2014
2349
  <path
2015
2350
  d="M76,64A12,12,0,0,1,88,52H216a12,12,0,0,1,0,24H88A12,12,0,0,1,76,64Zm140,52H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24Zm0,64H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24ZM44,112a16,16,0,1,0,16,16A16,16,0,0,0,44,112Zm0-64A16,16,0,1,0,60,64,16,16,0,0,0,44,48Zm0,128a16,16,0,1,0,16,16A16,16,0,0,0,44,176Z"
2016
2351
  ></path>
2017
2352
  </svg>
2018
2353
  </button>
2019
- </li>`;case"|":return l.html`<li>
2354
+ </li>`;case"|":return l.html`<li role="presentation">
2020
2355
  <span class="gui-markdown__toolbar-separator">
2021
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256">
2356
+ <svg
2357
+ xmlns="http://www.w3.org/2000/svg"
2358
+ width="20"
2359
+ height="20"
2360
+ viewBox="0 0 256 256"
2361
+ aria-hidden="true"
2362
+ >
2022
2363
  <path d="M140,24V232a12,12,0,0,1-24,0V24a12,12,0,0,1,24,0Z"></path>
2023
2364
  </svg>
2024
2365
  </span>
2025
- </li>`;default:return l.nothing}}toolbarBtnClass(e){return w.classMap({"gui-markdown__toolbar-button":!0,"gui-markdown__toolbar-button--disabled":this.disabled===!0||this.readOnly===!0,"gui-markdown__toolbar-button--active":!!e&&!!this.activeFormats[e]})}detectFormats(){const e=this.querySelector(`textarea[id="${this.uid}"]`);if(!e)return;const{selectionStart:t,value:i}=e,a=i.lastIndexOf(`
2366
+ </li>`;default:return l.nothing}}toolbarBtnClass(e){return T.classMap({"gui-markdown__toolbar-button":!0,"gui-markdown__toolbar-button--disabled":this.disabled===!0||this.readOnly===!0,"gui-markdown__toolbar-button--active":!!e&&!!this.activeFormats[e]})}detectFormats(){const e=this.querySelector(`textarea[id="${this.uid}"]`);if(!e)return;const{selectionStart:t,value:i}=e,a=i.lastIndexOf(`
2026
2367
  `,t-1)+1,r=i.indexOf(`
2027
2368
  `,t),s=i.substring(a,r===-1?i.length:r);this.activeFormats={heading:/^#{1,6}\s/.test(s),bold:this.isInsideInlineFormat(i,t,"**"),italic:this.isInsideInlineFormat(i,t,"_"),strikethrough:this.isInsideInlineFormat(i,t,"~~"),quote:s.startsWith("> "),link:this.isInsideLink(i,t),orderedList:/^\d+\.\s/.test(s),unorderedList:s.startsWith("- ")}}isInsideInlineFormat(e,t,i){const a=e.lastIndexOf(`
2028
2369
  `,t-1)+1,r=e.indexOf(`
2029
- `,t),s=e.substring(a,r===-1?e.length:r),o=t-a;let u=0;for(;u<s.length;){const p=s.indexOf(i,u);if(p===-1)break;const d=s.indexOf(i,p+i.length);if(d===-1)break;if(o>=p&&o<=d+i.length)return!0;u=d+i.length}return!1}isInsideLink(e,t){const i=e.lastIndexOf(`
2370
+ `,t),s=e.substring(a,r===-1?e.length:r),o=t-a;let d=0;for(;d<s.length;){const p=s.indexOf(i,d);if(p===-1)break;const u=s.indexOf(i,p+i.length);if(u===-1)break;if(o>=p&&o<=u+i.length)return!0;d=u+i.length}return!1}isInsideLink(e,t){const i=e.lastIndexOf(`
2030
2371
  `,t-1)+1,a=e.indexOf(`
2031
- `,t),r=e.substring(i,a===-1?e.length:a),s=t-i,o=/\[[^\]]*\]\([^)]*\)/g;let u;for(;(u=o.exec(r))!==null;)if(s>=u.index&&s<=u.index+u[0].length)return!0;return!1}applyFormat(e,t="",i=""){return()=>{const a=this.querySelector(`textarea[id="${this.uid}"]`);if(a){if(i&&this.activeFormats[i])this.removeFormat(a,e,t,i);else{const{selectionStart:r,selectionEnd:s,value:o}=a,u=o.substring(r,s),p=o.substring(0,r),d=o.substring(s);a.value=`${p}${e}${u}${t}${d}`,a.selectionStart=r+e.length,a.selectionEnd=r+e.length+u.length}a.focus(),a.dispatchEvent(new Event("input",{bubbles:!0})),this.detectFormats()}}}removeFormat(e,t,i,a){const{selectionStart:r,value:s}=e,o=s.lastIndexOf(`
2032
- `,r-1)+1,u=s.indexOf(`
2033
- `,r),p=s.substring(o,u===-1?s.length:u);if(i)if(a==="link"){const d=r-o,h=/\[([^\]]*)\]\([^)]*\)/g;let c;for(;(c=h.exec(p))!==null;)if(d>=c.index&&d<=c.index+c[0].length){const g=c[1],f=o+c.index,S=f+c[0].length;e.value=`${s.substring(0,f)}${g}${s.substring(S)}`,e.selectionStart=f,e.selectionEnd=f+g.length;break}}else{const d=r-o;let h=0;for(;h<p.length;){const c=p.indexOf(t,h);if(c===-1)break;const g=p.indexOf(i,c+t.length);if(g===-1)break;if(d>=c&&d<=g+i.length){const f=p.substring(c+t.length,g),S=o+c,Ee=o+g+i.length;e.value=`${s.substring(0,S)}${f}${s.substring(Ee)}`,e.selectionStart=S,e.selectionEnd=S+f.length;break}h=g+i.length}}else{let d=t;if(a==="heading"){const f=p.match(/^#{1,6}\s/);f&&(d=f[0])}else if(a==="orderedList"){const f=p.match(/^\d+\.\s/);f&&(d=f[0])}const h=s.substring(0,o),c=p.substring(d.length),g=s.substring(u===-1?s.length:u);e.value=`${h}${c}${g}`,e.selectionStart=Math.max(o,r-d.length),e.selectionEnd=e.selectionStart}}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.value},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};B([n.property({type:String})],A.prototype,"uid",2),B([n.property({type:String})],A.prototype,"label",2),B([n.property({type:String,attribute:"locale-id"})],A.prototype,"localeId",2),B([n.property({type:Array})],A.prototype,"errors",2),B([n.property({type:Boolean})],A.prototype,"touched",2),B([n.property({type:Boolean})],A.prototype,"required",2),B([n.property({type:Boolean})],A.prototype,"disabled",2),B([n.property({type:Boolean,attribute:"readonly"})],A.prototype,"readOnly",2),B([n.property({type:String})],A.prototype,"value",2),B([n.property({type:String})],A.prototype,"hint",2),B([n.property({type:Array})],A.prototype,"tools",2),B([n.property({type:String})],A.prototype,"placeholder",2),B([n.property({type:String})],A.prototype,"autocomplete",2),B([n.property({type:String,attribute:"countermode"})],A.prototype,"counterMode",2),B([n.property({type:Number,attribute:"minimumheight"})],A.prototype,"minimumHeight",2),B([n.property({type:Boolean,attribute:"autogrow"})],A.prototype,"autoGrow",2),B([n.property({type:Boolean,attribute:"defaultopenpreview"})],A.prototype,"defaultOpenPreview",2),B([n.property({type:Number,attribute:"maxlength"})],A.prototype,"maxLength",2),B([n.property({type:String})],A.prototype,"headingTitle",2),B([n.property({type:String})],A.prototype,"boldTitle",2),B([n.property({type:String})],A.prototype,"italicTitle",2),B([n.property({type:String})],A.prototype,"strikethroughTitle",2),B([n.property({type:String})],A.prototype,"quoteTitle",2),B([n.property({type:String})],A.prototype,"linkTitle",2),B([n.property({type:String})],A.prototype,"orderedListTitle",2),B([n.property({type:String})],A.prototype,"unorderedListTitle",2),B([n.property({type:String})],A.prototype,"splitViewTitle",2),B([n.property({type:Object})],A.prototype,"dependencies",2),B([n.state()],A.prototype,"splitViewActive",2),B([n.state()],A.prototype,"activeFormats",2),A=B([n.customElement("gui-markdown")],A),typeof customElements<"u"&&!customElements.get("gui-markdown")&&customElements.define("gui-markdown",A);var Kh=Object.defineProperty,Xh=Object.getOwnPropertyDescriptor,Za=(e,t,i,a)=>{for(var r=a>1?void 0:a?Xh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Kh(t,i,r),r};let ai=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-markdown","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
2372
+ `,t),r=e.substring(i,a===-1?e.length:a),s=t-i,o=/\[[^\]]*\]\([^)]*\)/g;let d;for(;(d=o.exec(r))!==null;)if(s>=d.index&&s<=d.index+d[0].length)return!0;return!1}applyFormat(e,t="",i=""){return()=>{if(this.disabled||this.readOnly)return;const a=this.querySelector(`textarea[id="${this.uid}"]`);if(a){if(i&&this.activeFormats[i])this.removeFormat(a,e,t,i);else{const{selectionStart:r,selectionEnd:s,value:o}=a,d=o.substring(r,s),p=o.substring(0,r),u=o.substring(s);a.value=`${p}${e}${d}${t}${u}`,a.selectionStart=r+e.length,a.selectionEnd=r+e.length+d.length}a.focus(),a.dispatchEvent(new Event("input",{bubbles:!0})),this.detectFormats()}}}removeFormat(e,t,i,a){const{selectionStart:r,value:s}=e,o=s.lastIndexOf(`
2373
+ `,r-1)+1,d=s.indexOf(`
2374
+ `,r),p=s.substring(o,d===-1?s.length:d);if(i)if(a==="link"){const u=r-o,h=/\[([^\]]*)\]\([^)]*\)/g;let c;for(;(c=h.exec(p))!==null;)if(u>=c.index&&u<=c.index+c[0].length){const y=c[1],g=o+c.index,_=g+c[0].length;e.value=`${s.substring(0,g)}${y}${s.substring(_)}`,e.selectionStart=g,e.selectionEnd=g+y.length;break}}else{const u=r-o;let h=0;for(;h<p.length;){const c=p.indexOf(t,h);if(c===-1)break;const y=p.indexOf(i,c+t.length);if(y===-1)break;if(u>=c&&u<=y+i.length){const g=p.substring(c+t.length,y),_=o+c,x=o+y+i.length;e.value=`${s.substring(0,_)}${g}${s.substring(x)}`,e.selectionStart=_,e.selectionEnd=_+g.length;break}h=y+i.length}}else{let u=t;if(a==="heading"){const g=p.match(/^#{1,6}\s/);g&&(u=g[0])}else if(a==="orderedList"){const g=p.match(/^\d+\.\s/);g&&(u=g[0])}const h=s.substring(0,o),c=p.substring(u.length),y=s.substring(d===-1?s.length:d);e.value=`${h}${c}${y}`,e.selectionStart=Math.max(o,r-u.length),e.selectionEnd=e.selectionStart}}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.value},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};Z([n.property({type:String})],B.prototype,"uid",2),Z([n.property({type:String})],B.prototype,"label",2),Z([n.property({type:String,attribute:"locale-id"})],B.prototype,"localeId",2),Z([n.property({type:Array})],B.prototype,"errors",2),Z([n.property({type:Boolean})],B.prototype,"touched",2),Z([n.property({type:Boolean})],B.prototype,"required",2),Z([n.property({type:Boolean})],B.prototype,"disabled",2),Z([n.property({type:Boolean,attribute:"readonly"})],B.prototype,"readOnly",2),Z([n.property({type:String})],B.prototype,"value",2),Z([n.property({type:String})],B.prototype,"hint",2),Z([n.property({type:Array})],B.prototype,"tools",2),Z([n.property({type:String})],B.prototype,"placeholder",2),Z([n.property({type:String})],B.prototype,"autocomplete",2),Z([n.property({type:String,attribute:"countermode"})],B.prototype,"counterMode",2),Z([n.property({type:Number,attribute:"minimumheight"})],B.prototype,"minimumHeight",2),Z([n.property({type:Boolean,attribute:"autogrow"})],B.prototype,"autoGrow",2),Z([n.property({type:Boolean,attribute:"defaultopenpreview"})],B.prototype,"defaultOpenPreview",2),Z([n.property({type:Number,attribute:"maxlength"})],B.prototype,"maxLength",2),Z([n.property({type:String})],B.prototype,"headingTitle",2),Z([n.property({type:String})],B.prototype,"boldTitle",2),Z([n.property({type:String})],B.prototype,"italicTitle",2),Z([n.property({type:String})],B.prototype,"strikethroughTitle",2),Z([n.property({type:String})],B.prototype,"quoteTitle",2),Z([n.property({type:String})],B.prototype,"linkTitle",2),Z([n.property({type:String})],B.prototype,"orderedListTitle",2),Z([n.property({type:String})],B.prototype,"unorderedListTitle",2),Z([n.property({type:String})],B.prototype,"splitViewTitle",2),Z([n.property({type:String,attribute:"toolbar-aria-label"})],B.prototype,"toolbarAriaLabel",2),Z([n.property({type:Object})],B.prototype,"dependencies",2),Z([n.state()],B.prototype,"splitViewActive",2),Z([n.state()],B.prototype,"activeFormats",2),B=Z([n.customElement("gui-markdown")],B),typeof customElements<"u"&&!customElements.get("gui-markdown")&&customElements.define("gui-markdown",B);var sm=Object.defineProperty,nm=Object.getOwnPropertyDescriptor,Ir=(e,t,i,a)=>{for(var r=a>1?void 0:a?nm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&sm(t,i,r),r};let oi=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-markdown","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
2034
2375
  <gui-markdown
2035
2376
  .uid=${this.widget.uid}
2036
2377
  .label=${this.adapter.templateData.label}
@@ -2047,23 +2388,33 @@
2047
2388
  .minimumHeight=${this.adapter.templateData.minimumHeight}
2048
2389
  .autoGrow=${this.adapter.templateData.autoGrow}
2049
2390
  .tools=${this.adapter.templateData.tools}
2391
+ .headingTitle=${this.adapter.templateData.headingTitle}
2392
+ .boldTitle=${this.adapter.templateData.boldTitle}
2393
+ .italicTitle=${this.adapter.templateData.italicTitle}
2394
+ .strikethroughTitle=${this.adapter.templateData.strikethroughTitle}
2395
+ .quoteTitle=${this.adapter.templateData.quoteTitle}
2396
+ .linkTitle=${this.adapter.templateData.linkTitle}
2397
+ .orderedListTitle=${this.adapter.templateData.orderedListTitle}
2398
+ .unorderedListTitle=${this.adapter.templateData.unorderedListTitle}
2399
+ .splitViewTitle=${this.adapter.templateData.splitViewTitle}
2400
+ .toolbarAriaLabel=${this.adapter.templateData.toolbarAriaLabel}
2050
2401
  .defaultOpenPreview=${this.adapter.templateData.defaultOpenPreview}
2051
2402
  .maxLength=${this.adapter.templateData.validator?.maxLength}
2052
2403
  .dependencies=${this.adapter.templateData.deps}
2053
2404
  @input=${this.valueChanged}
2054
2405
  @blur=${()=>this.adapter.onBlur()}
2055
2406
  ></gui-markdown>
2056
- `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Za([b.consume({context:m.formContext}),n.property({attribute:!1})],ai.prototype,"formContext",2),Za([b.provide({context:m.inputContext})],ai.prototype,"adapter",2),ai=Za([n.customElement("gui-markdown-input")],ai);const Jh=Object.freeze(Object.defineProperty({__proto__:null,get MarkdownElement(){return ai}},Symbol.toStringTag,{value:"Module"}));var Qh=Object.defineProperty,jh=Object.getOwnPropertyDescriptor,De=(e,t,i,a)=>{for(var r=a>1?void 0:a?jh(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Qh(t,i,r),r};let de=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.icon=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.showPasswordIcon=void 0,this.hidePasswordIcon=void 0,this.showPasswordLabel=void 0,this.hidePasswordLabel=void 0,this.showPassword=!1,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,icon:this.icon,placeholder:this.placeholder,autocomplete:this.autocomplete,showPasswordIcon:this.showPasswordIcon,hidePasswordIcon:this.hidePasswordIcon,showPasswordLabel:this.showPasswordLabel,hidePasswordLabel:this.hidePasswordLabel},t=Ke("password",e),i={"gui-widget-input":!0,"gui-password--icon":!!this.icon};return l.html`
2057
- ${se(this.uid,e)}
2407
+ `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Ir([f.consume({context:m.formContext}),n.property({attribute:!1})],oi.prototype,"formContext",2),Ir([f.provide({context:m.inputContext})],oi.prototype,"adapter",2),oi=Ir([n.customElement("gui-markdown-input")],oi);const om=Object.freeze(Object.defineProperty({__proto__:null,get MarkdownElement(){return oi}},Symbol.toStringTag,{value:"Module"}));var lm=Object.defineProperty,dm=Object.getOwnPropertyDescriptor,ke=(e,t,i,a)=>{for(var r=a>1?void 0:a?dm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&lm(t,i,r),r};let be=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.icon=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.showPasswordIcon=void 0,this.hidePasswordIcon=void 0,this.showPasswordLabel=void 0,this.hidePasswordLabel=void 0,this.showPassword=!1,this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,icon:this.icon,placeholder:this.placeholder,autocomplete:this.autocomplete,showPasswordIcon:this.showPasswordIcon,hidePasswordIcon:this.hidePasswordIcon,showPasswordLabel:this.showPasswordLabel,hidePasswordLabel:this.hidePasswordLabel},t=Xe("password",e),i={"gui-widget-input":!0,"gui-password--icon":!!this.icon};return l.html`
2408
+ ${le(this.uid,e)}
2058
2409
 
2059
2410
  <div class="gui-widget">
2060
2411
  <input
2061
2412
  type=${this.showPassword?"text":"password"}
2062
2413
  id=${this.uid}
2063
2414
  data-cy=${`${this.uid}_password`}
2064
- class=${w.classMap(i)}
2415
+ class=${T.classMap(i)}
2065
2416
  value=${this.value}
2066
- ?required=${this.disabled}
2417
+ ?required=${this.required}
2067
2418
  ?disabled=${this.disabled}
2068
2419
  ?readonly=${this.readOnly}
2069
2420
  placeholder=${this.placeholder||l.nothing}
@@ -2076,17 +2427,18 @@
2076
2427
  class=${`gui-password__toggle gui-widget-icon ${this.showPassword&&e.showPasswordIcon?e.showPasswordIcon:""} ${!this.showPassword&&e.hidePasswordIcon?e.hidePasswordIcon:""}`}
2077
2428
  data-icon=${this.showPassword?e.showPasswordIcon:e.hidePasswordIcon}
2078
2429
  type="button"
2079
- tabindex="-1"
2430
+ ?disabled=${this.disabled}
2431
+ aria-label=${this.showPassword?e.hidePasswordLabel??"Hide password":e.showPasswordLabel??"Show password"}
2080
2432
  @click=${()=>this.showPassword=!this.showPassword}
2081
2433
  >
2082
- ${e.showPasswordIcon||e.hidePasswordIcon?l.nothing:l.html`<span
2434
+ ${e.showPasswordIcon||e.hidePasswordIcon?l.nothing:l.html`<span aria-hidden="true"
2083
2435
  >${this.showPassword?e.hidePasswordLabel??"Hide":e.showPasswordLabel??"Show"}</span
2084
2436
  >`}
2085
2437
  </button>
2086
2438
  </div>
2087
2439
 
2088
- ${W(this.uid,e)}
2089
- `}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.value},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};De([n.property({type:String})],de.prototype,"uid",2),De([n.property({type:String})],de.prototype,"label",2),De([n.property({type:String,attribute:"locale-id"})],de.prototype,"localeId",2),De([n.property({type:Array})],de.prototype,"errors",2),De([n.property({type:Boolean})],de.prototype,"touched",2),De([n.property({type:Boolean})],de.prototype,"required",2),De([n.property({type:Boolean})],de.prototype,"disabled",2),De([n.property({type:Boolean,attribute:"readonly"})],de.prototype,"readOnly",2),De([n.property({type:String})],de.prototype,"value",2),De([n.property({type:String})],de.prototype,"hint",2),De([n.property({type:String})],de.prototype,"icon",2),De([n.property({type:String})],de.prototype,"placeholder",2),De([n.property({type:String})],de.prototype,"autocomplete",2),De([n.property({type:String})],de.prototype,"showPasswordIcon",2),De([n.property({type:String})],de.prototype,"hidePasswordIcon",2),De([n.property({type:String})],de.prototype,"showPasswordLabel",2),De([n.property({type:String})],de.prototype,"hidePasswordLabel",2),De([n.state()],de.prototype,"showPassword",2),de=De([n.customElement("gui-password")],de),typeof customElements<"u"&&!customElements.get("gui-password")&&customElements.define("gui-password",de);var em=Object.defineProperty,tm=Object.getOwnPropertyDescriptor,Ha=(e,t,i,a)=>{for(var r=a>1?void 0:a?tm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&em(t,i,r),r};let ri=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-password","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
2440
+ ${j(this.uid,e)}
2441
+ `}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.value},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};ke([n.property({type:String})],be.prototype,"uid",2),ke([n.property({type:String})],be.prototype,"label",2),ke([n.property({type:String,attribute:"locale-id"})],be.prototype,"localeId",2),ke([n.property({type:Array})],be.prototype,"errors",2),ke([n.property({type:Boolean})],be.prototype,"touched",2),ke([n.property({type:Boolean})],be.prototype,"required",2),ke([n.property({type:Boolean})],be.prototype,"disabled",2),ke([n.property({type:Boolean,attribute:"readonly"})],be.prototype,"readOnly",2),ke([n.property({type:String})],be.prototype,"value",2),ke([n.property({type:String})],be.prototype,"hint",2),ke([n.property({type:String})],be.prototype,"icon",2),ke([n.property({type:String})],be.prototype,"placeholder",2),ke([n.property({type:String})],be.prototype,"autocomplete",2),ke([n.property({type:String})],be.prototype,"showPasswordIcon",2),ke([n.property({type:String})],be.prototype,"hidePasswordIcon",2),ke([n.property({type:String})],be.prototype,"showPasswordLabel",2),ke([n.property({type:String})],be.prototype,"hidePasswordLabel",2),ke([n.state()],be.prototype,"showPassword",2),be=ke([n.customElement("gui-password")],be),typeof customElements<"u"&&!customElements.get("gui-password")&&customElements.define("gui-password",be);var pm=Object.defineProperty,um=Object.getOwnPropertyDescriptor,Mr=(e,t,i,a)=>{for(var r=a>1?void 0:a?um(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&pm(t,i,r),r};let li=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-password","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
2090
2442
  <gui-password
2091
2443
  .uid=${this.widget.uid}
2092
2444
  .label=${this.adapter.templateData.label}
@@ -2107,17 +2459,17 @@
2107
2459
  @input=${this.valueChanged}
2108
2460
  @blur=${()=>this.adapter.onBlur()}
2109
2461
  ></gui-password>
2110
- `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Ha([b.consume({context:m.formContext}),n.property({attribute:!1})],ri.prototype,"formContext",2),Ha([b.provide({context:m.inputContext})],ri.prototype,"adapter",2),ri=Ha([n.customElement("gui-password-input")],ri);const im=Object.freeze(Object.defineProperty({__proto__:null,get PasswordElement(){return ri}},Symbol.toStringTag,{value:"Module"}));var am=Object.defineProperty,rm=Object.getOwnPropertyDescriptor,Ze=(e,t,i,a)=>{for(var r=a>1?void 0:a?rm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&am(t,i,r),r};let Fe=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.icon=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,icon:this.icon,placeholder:this.placeholder,autocomplete:this.autocomplete},t=Ke("textinput",e),i={"gui-widget-input":!0,"gui-textinput--icon":!!this.icon};return l.html`
2111
- ${se(this.uid,e)}
2462
+ `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Mr([f.consume({context:m.formContext}),n.property({attribute:!1})],li.prototype,"formContext",2),Mr([f.provide({context:m.inputContext})],li.prototype,"adapter",2),li=Mr([n.customElement("gui-password-input")],li);const hm=Object.freeze(Object.defineProperty({__proto__:null,get PasswordElement(){return li}},Symbol.toStringTag,{value:"Module"}));var cm=Object.defineProperty,mm=Object.getOwnPropertyDescriptor,He=(e,t,i,a)=>{for(var r=a>1?void 0:a?mm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&cm(t,i,r),r};let qe=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.icon=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,icon:this.icon,placeholder:this.placeholder,autocomplete:this.autocomplete},t=Xe("textinput",e),i={"gui-widget-input":!0,"gui-textinput--icon":!!this.icon};return l.html`
2463
+ ${le(this.uid,e)}
2112
2464
 
2113
2465
  <div class="gui-widget">
2114
2466
  <input
2115
2467
  type="text"
2116
2468
  id=${this.uid}
2117
2469
  data-cy=${`${this.uid}_textinput`}
2118
- class=${w.classMap(i)}
2470
+ class=${T.classMap(i)}
2119
2471
  value=${this.value}
2120
- ?required=${this.disabled}
2472
+ ?required=${this.required}
2121
2473
  ?disabled=${this.disabled}
2122
2474
  ?readonly=${this.readOnly}
2123
2475
  placeholder=${this.placeholder||l.nothing}
@@ -2128,8 +2480,8 @@
2128
2480
  ${t.html}
2129
2481
  </div>
2130
2482
 
2131
- ${W(this.uid,e)}
2132
- `}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.value},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};Ze([n.property({type:String})],Fe.prototype,"uid",2),Ze([n.property({type:String})],Fe.prototype,"label",2),Ze([n.property({type:String,attribute:"locale-id"})],Fe.prototype,"localeId",2),Ze([n.property({type:Array})],Fe.prototype,"errors",2),Ze([n.property({type:Boolean})],Fe.prototype,"touched",2),Ze([n.property({type:Boolean})],Fe.prototype,"required",2),Ze([n.property({type:Boolean})],Fe.prototype,"disabled",2),Ze([n.property({type:Boolean,attribute:"readonly"})],Fe.prototype,"readOnly",2),Ze([n.property({type:String})],Fe.prototype,"value",2),Ze([n.property({type:String})],Fe.prototype,"hint",2),Ze([n.property({type:String})],Fe.prototype,"icon",2),Ze([n.property({type:String})],Fe.prototype,"placeholder",2),Ze([n.property({type:String})],Fe.prototype,"autocomplete",2),Fe=Ze([n.customElement("gui-textinput")],Fe),typeof customElements<"u"&&!customElements.get("gui-textinput")&&customElements.define("gui-textinput",Fe);var sm=Object.defineProperty,nm=Object.getOwnPropertyDescriptor,Wa=(e,t,i,a)=>{for(var r=a>1?void 0:a?nm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&sm(t,i,r),r};let si=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-textinput","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
2483
+ ${j(this.uid,e)}
2484
+ `}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.value},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};He([n.property({type:String})],qe.prototype,"uid",2),He([n.property({type:String})],qe.prototype,"label",2),He([n.property({type:String,attribute:"locale-id"})],qe.prototype,"localeId",2),He([n.property({type:Array})],qe.prototype,"errors",2),He([n.property({type:Boolean})],qe.prototype,"touched",2),He([n.property({type:Boolean})],qe.prototype,"required",2),He([n.property({type:Boolean})],qe.prototype,"disabled",2),He([n.property({type:Boolean,attribute:"readonly"})],qe.prototype,"readOnly",2),He([n.property({type:String})],qe.prototype,"value",2),He([n.property({type:String})],qe.prototype,"hint",2),He([n.property({type:String})],qe.prototype,"icon",2),He([n.property({type:String})],qe.prototype,"placeholder",2),He([n.property({type:String})],qe.prototype,"autocomplete",2),qe=He([n.customElement("gui-textinput")],qe),typeof customElements<"u"&&!customElements.get("gui-textinput")&&customElements.define("gui-textinput",qe);var ym=Object.defineProperty,gm=Object.getOwnPropertyDescriptor,Rr=(e,t,i,a)=>{for(var r=a>1?void 0:a?gm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&ym(t,i,r),r};let di=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-textinput","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
2133
2485
  <gui-textinput
2134
2486
  .uid=${this.widget.uid}
2135
2487
  .label=${this.adapter.templateData.label}
@@ -2146,9 +2498,9 @@
2146
2498
  @input=${this.valueChanged}
2147
2499
  @blur=${()=>this.adapter.onBlur()}
2148
2500
  ></gui-textinput>
2149
- `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Wa([b.consume({context:m.formContext}),n.property({attribute:!1})],si.prototype,"formContext",2),Wa([b.provide({context:m.inputContext})],si.prototype,"adapter",2),si=Wa([n.customElement("gui-textinput-input")],si);const om=Object.freeze(Object.defineProperty({__proto__:null,get TextinputElement(){return si}},Symbol.toStringTag,{value:"Module"}));var lm=Object.defineProperty,um=Object.getOwnPropertyDescriptor,Ya=(e,t,i,a)=>{for(var r=a>1?void 0:a?um(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&lm(t,i,r),r};let ni=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-time","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=Ke("time",this.adapter.templateData);return l.html`
2501
+ `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Rr([f.consume({context:m.formContext}),n.property({attribute:!1})],di.prototype,"formContext",2),Rr([f.provide({context:m.inputContext})],di.prototype,"adapter",2),di=Rr([n.customElement("gui-textinput-input")],di);const bm=Object.freeze(Object.defineProperty({__proto__:null,get TextinputElement(){return di}},Symbol.toStringTag,{value:"Module"}));var fm=Object.defineProperty,vm=Object.getOwnPropertyDescriptor,Fr=(e,t,i,a)=>{for(var r=a>1?void 0:a?vm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&fm(t,i,r),r};let pi=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-time","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=Xe("time",this.adapter.templateData);return l.html`
2150
2502
  <gui-time
2151
- class=${w.classMap(e.widgetClasses)}
2503
+ class=${T.classMap(e.widgetClasses)}
2152
2504
  .uid=${this.widget.uid}
2153
2505
  .label=${this.adapter.templateData.label}
2154
2506
  .hint=${this.adapter.templateData.hint}
@@ -2160,6 +2512,9 @@
2160
2512
  .value=${this.adapter.templateData.value}
2161
2513
  .icon=${this.adapter.templateData.icon}
2162
2514
  .localeId=${this.adapter.templateData.lang}
2515
+ .hourAriaLabel=${this.adapter.templateData.hourAriaLabel}
2516
+ .minuteAriaLabel=${this.adapter.templateData.minuteAriaLabel}
2517
+ .dayPeriodAriaLabel=${this.adapter.templateData.dayPeriodAriaLabel}
2163
2518
  .hourFormat=${this.adapter.templateData.hourFormat}
2164
2519
  .minuteStep=${this.adapter.templateData.minuteStep}
2165
2520
  .minTime=${this.adapter.templateData.minTime}
@@ -2170,7 +2525,7 @@
2170
2525
  @blur=${()=>this.adapter.onBlur()}
2171
2526
  @change=${this.valueChanged}
2172
2527
  ></gui-time>
2173
- `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Ya([b.consume({context:m.formContext}),n.property({attribute:!1})],ni.prototype,"formContext",2),Ya([b.provide({context:m.inputContext})],ni.prototype,"adapter",2),ni=Ya([n.customElement("gui-time-input")],ni);const pm=Object.freeze(Object.defineProperty({__proto__:null,get TimeElement(){return ni}},Symbol.toStringTag,{value:"Module"}));var dm=Object.defineProperty,hm=Object.getOwnPropertyDescriptor,Ka=(e,t,i,a)=>{for(var r=a>1?void 0:a?hm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&dm(t,i,r),r};let oi=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-time-picker","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=this.adapter.templateData;return l.html`
2528
+ `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Fr([f.consume({context:m.formContext}),n.property({attribute:!1})],pi.prototype,"formContext",2),Fr([f.provide({context:m.inputContext})],pi.prototype,"adapter",2),pi=Fr([n.customElement("gui-time-input")],pi);const Dm=Object.freeze(Object.defineProperty({__proto__:null,get TimeElement(){return pi}},Symbol.toStringTag,{value:"Module"}));var wm=Object.defineProperty,$m=Object.getOwnPropertyDescriptor,Br=(e,t,i,a)=>{for(var r=a>1?void 0:a?$m(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&wm(t,i,r),r};let ui=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-time-picker","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=this.adapter.templateData;return l.html`
2174
2529
  <gui-time-picker
2175
2530
  .uid=${this.widget.uid}
2176
2531
  .label=${e.label}
@@ -2183,6 +2538,10 @@
2183
2538
  .value=${e.value}
2184
2539
  .icon=${e.icon}
2185
2540
  .localeId=${e.lang}
2541
+ .toggleAriaLabel=${e.toggleAriaLabel}
2542
+ .hourAriaLabel=${e.hourAriaLabel}
2543
+ .minuteAriaLabel=${e.minuteAriaLabel}
2544
+ .dayPeriodAriaLabel=${e.dayPeriodAriaLabel}
2186
2545
  .hourFormat=${e.hourFormat}
2187
2546
  .minuteStep=${e.minuteStep}
2188
2547
  .minTime=${e.minTime}
@@ -2199,9 +2558,9 @@
2199
2558
  @blur=${()=>this.adapter.onBlur()}
2200
2559
  @change=${this.valueChanged}
2201
2560
  ></gui-time-picker>
2202
- `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Ka([b.consume({context:m.formContext}),n.property({attribute:!1})],oi.prototype,"formContext",2),Ka([b.provide({context:m.inputContext})],oi.prototype,"adapter",2),oi=Ka([n.customElement("gui-time-picker-input")],oi);const mm=Object.freeze(Object.defineProperty({__proto__:null,get TimePickerElement(){return oi}},Symbol.toStringTag,{value:"Module"}));var cm=Object.defineProperty,ym=Object.getOwnPropertyDescriptor,Xa=(e,t,i,a)=>{for(var r=a>1?void 0:a?ym(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&cm(t,i,r),r};let li=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-date-time","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=Ke("date-time",this.adapter.templateData);return l.html`
2561
+ `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Br([f.consume({context:m.formContext}),n.property({attribute:!1})],ui.prototype,"formContext",2),Br([f.provide({context:m.inputContext})],ui.prototype,"adapter",2),ui=Br([n.customElement("gui-time-picker-input")],ui);const km=Object.freeze(Object.defineProperty({__proto__:null,get TimePickerElement(){return ui}},Symbol.toStringTag,{value:"Module"}));var Sm=Object.defineProperty,Tm=Object.getOwnPropertyDescriptor,qr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Tm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Sm(t,i,r),r};let hi=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-date-time","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){super.render();const e=Xe("date-time",this.adapter.templateData);return l.html`
2203
2562
  <gui-date-time
2204
- class=${w.classMap(e.widgetClasses)}
2563
+ class=${T.classMap(e.widgetClasses)}
2205
2564
  .uid=${this.widget.uid}
2206
2565
  .label=${this.adapter.templateData.label}
2207
2566
  .hint=${this.adapter.templateData.hint}
@@ -2213,6 +2572,12 @@
2213
2572
  .value=${this.adapter.templateData.value}
2214
2573
  .icon=${this.adapter.templateData.icon}
2215
2574
  .localeId=${this.adapter.templateData.lang}
2575
+ .dayAriaLabel=${this.adapter.templateData.dayAriaLabel}
2576
+ .monthAriaLabel=${this.adapter.templateData.monthAriaLabel}
2577
+ .yearAriaLabel=${this.adapter.templateData.yearAriaLabel}
2578
+ .hourAriaLabel=${this.adapter.templateData.hourAriaLabel}
2579
+ .minuteAriaLabel=${this.adapter.templateData.minuteAriaLabel}
2580
+ .dayPeriodAriaLabel=${this.adapter.templateData.dayPeriodAriaLabel}
2216
2581
  .invalidDateMessage=${this.adapter.templateData.invalidDateMessage}
2217
2582
  .minDate=${this.adapter.templateData.minDate}
2218
2583
  .maxDate=${this.adapter.templateData.maxDate}
@@ -2228,18 +2593,18 @@
2228
2593
  @blur=${()=>this.adapter.onBlur()}
2229
2594
  @change=${this.valueChanged}
2230
2595
  ></gui-date-time>
2231
- `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Xa([b.consume({context:m.formContext}),n.property({attribute:!1})],li.prototype,"formContext",2),Xa([b.provide({context:m.inputContext})],li.prototype,"adapter",2),li=Xa([n.customElement("gui-date-time-input")],li);const gm=Object.freeze(Object.defineProperty({__proto__:null,get DateTimeElement(){return li}},Symbol.toStringTag,{value:"Module"}));var bm=Object.defineProperty,fm=Object.getOwnPropertyDescriptor,Pe=(e,t,i,a)=>{for(var r=a>1?void 0:a?fm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&bm(t,i,r),r};let we=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.minimumHeight=void 0,this.autoGrow=!1,this.maxLength=void 0,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`textarea[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint,placeholder:this.placeholder,autocomplete:this.autocomplete,counterMode:this.counterMode??"remaining",minimumHeight:this.minimumHeight??120,autoGrow:this.autoGrow??!1,maxLength:this.maxLength};let t=l.html``;if(e.counterMode&&e.maxLength){const r={"gui-textarea--counter":!0,"gui-textarea--counter__error":(e.value?.length??0)>e.maxLength},s=e.counterMode==="current"?l.html`<span>${e.value?.length??0}</span>`:l.html`<span>${e.maxLength-(e.value?.length??0)}</span>`;t=l.html`<div class=${w.classMap(r)}>
2596
+ `}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};qr([f.consume({context:m.formContext}),n.property({attribute:!1})],hi.prototype,"formContext",2),qr([f.provide({context:m.inputContext})],hi.prototype,"adapter",2),hi=qr([n.customElement("gui-date-time-input")],hi);const _m=Object.freeze(Object.defineProperty({__proto__:null,get DateTimeElement(){return hi}},Symbol.toStringTag,{value:"Module"}));var Am=Object.defineProperty,Cm=Object.getOwnPropertyDescriptor,Oe=(e,t,i,a)=>{for(var r=a>1?void 0:a?Cm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Am(t,i,r),r};let Se=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.minimumHeight=void 0,this.autoGrow=!1,this.maxLength=void 0,this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`textarea[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint,placeholder:this.placeholder,autocomplete:this.autocomplete,counterMode:this.counterMode??"remaining",minimumHeight:this.minimumHeight??120,autoGrow:this.autoGrow??!1,maxLength:this.maxLength};let t=l.html``;if(e.counterMode&&e.maxLength){const r={"gui-textarea--counter":!0,"gui-textarea--counter__error":(e.value?.length??0)>e.maxLength},s=e.counterMode==="current"?l.html`<span>${e.value?.length??0}</span>`:l.html`<span>${e.maxLength-(e.value?.length??0)}</span>`;t=l.html`<div class=${T.classMap(r)}>
2232
2597
  ${s}
2233
2598
  <span> / ${e.maxLength}</span>
2234
- </div>`}const i={height:`${e.minimumHeight}px`,"min-height":`${e.minimumHeight}px`},a=this.querySelector(`textarea[id="${this.uid}"]`);if(this.autoGrow&&a){const r=window.getComputedStyle(a),s=parseFloat(r.paddingTop),o=parseFloat(r.paddingBottom),u=s+o;a.style.height="auto",i.height=`${Math.max(this.minimumHeight??120,a.scrollHeight-u)}px`}return l.html`
2235
- ${se(this.uid,e)}
2599
+ </div>`}const i={height:`${e.minimumHeight}px`,"min-height":`${e.minimumHeight}px`},a=this.querySelector(`textarea[id="${this.uid}"]`);if(this.autoGrow&&a){const r=window.getComputedStyle(a),s=parseFloat(r.paddingTop),o=parseFloat(r.paddingBottom),d=s+o;a.style.height="auto",i.height=`${Math.max(this.minimumHeight??120,a.scrollHeight-d)}px`}return l.html`
2600
+ ${le(this.uid,e)}
2236
2601
 
2237
2602
  <div class="gui-widget">
2238
2603
  <textarea
2239
2604
  id=${this.uid}
2240
2605
  data-cy=${`${this.uid}_textarea`}
2241
2606
  class="gui-widget-input"
2242
- style=${bt.styleMap(i)}
2607
+ style=${vt.styleMap(i)}
2243
2608
  ?required=${e.required}
2244
2609
  ?disabled=${e.disabled}
2245
2610
  ?readonly=${e.readonly}
@@ -2252,10 +2617,10 @@
2252
2617
  </div>
2253
2618
 
2254
2619
  <div class="gui-textarea--validation">
2255
- <div>${W(this.uid,e)}</div>
2620
+ <div>${j(this.uid,e)}</div>
2256
2621
  ${t}
2257
2622
  </div>
2258
- `}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.value},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};Pe([n.property({type:String})],we.prototype,"uid",2),Pe([n.property({type:String})],we.prototype,"label",2),Pe([n.property({type:String,attribute:"locale-id"})],we.prototype,"localeId",2),Pe([n.property({type:Array})],we.prototype,"errors",2),Pe([n.property({type:Boolean})],we.prototype,"touched",2),Pe([n.property({type:Boolean})],we.prototype,"required",2),Pe([n.property({type:Boolean})],we.prototype,"disabled",2),Pe([n.property({type:Boolean,attribute:"readonly"})],we.prototype,"readOnly",2),Pe([n.property({type:String})],we.prototype,"value",2),Pe([n.property({type:String})],we.prototype,"hint",2),Pe([n.property({type:String})],we.prototype,"placeholder",2),Pe([n.property({type:String})],we.prototype,"autocomplete",2),Pe([n.property({type:String,attribute:"countermode"})],we.prototype,"counterMode",2),Pe([n.property({type:Number,attribute:"minimumheight"})],we.prototype,"minimumHeight",2),Pe([n.property({type:Boolean,attribute:"autogrow"})],we.prototype,"autoGrow",2),Pe([n.property({type:Number,attribute:"maxlength"})],we.prototype,"maxLength",2),we=Pe([n.customElement("gui-textarea")],we),typeof customElements<"u"&&!customElements.get("gui-textarea")&&customElements.define("gui-textarea",we);var vm=Object.defineProperty,Dm=Object.getOwnPropertyDescriptor,Ja=(e,t,i,a)=>{for(var r=a>1?void 0:a?Dm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&vm(t,i,r),r};let ui=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-textarea","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
2623
+ `}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.value},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};Oe([n.property({type:String})],Se.prototype,"uid",2),Oe([n.property({type:String})],Se.prototype,"label",2),Oe([n.property({type:String,attribute:"locale-id"})],Se.prototype,"localeId",2),Oe([n.property({type:Array})],Se.prototype,"errors",2),Oe([n.property({type:Boolean})],Se.prototype,"touched",2),Oe([n.property({type:Boolean})],Se.prototype,"required",2),Oe([n.property({type:Boolean})],Se.prototype,"disabled",2),Oe([n.property({type:Boolean,attribute:"readonly"})],Se.prototype,"readOnly",2),Oe([n.property({type:String})],Se.prototype,"value",2),Oe([n.property({type:String})],Se.prototype,"hint",2),Oe([n.property({type:String})],Se.prototype,"placeholder",2),Oe([n.property({type:String})],Se.prototype,"autocomplete",2),Oe([n.property({type:String,attribute:"countermode"})],Se.prototype,"counterMode",2),Oe([n.property({type:Number,attribute:"minimumheight"})],Se.prototype,"minimumHeight",2),Oe([n.property({type:Boolean,attribute:"autogrow"})],Se.prototype,"autoGrow",2),Oe([n.property({type:Number,attribute:"maxlength"})],Se.prototype,"maxLength",2),Se=Oe([n.customElement("gui-textarea")],Se),typeof customElements<"u"&&!customElements.get("gui-textarea")&&customElements.define("gui-textarea",Se);var Lm=Object.defineProperty,xm=Object.getOwnPropertyDescriptor,Nr=(e,t,i,a)=>{for(var r=a>1?void 0:a?xm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Lm(t,i,r),r};let ci=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-textarea","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
2259
2624
  <gui-textarea
2260
2625
  .uid=${this.widget.uid}
2261
2626
  .label=${this.adapter.templateData.label}
@@ -2275,7 +2640,7 @@
2275
2640
  @input=${this.valueChanged}
2276
2641
  @blur=${()=>this.adapter.onBlur()}
2277
2642
  ></gui-textarea>
2278
- `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Ja([b.consume({context:m.formContext}),n.property({attribute:!1})],ui.prototype,"formContext",2),Ja([b.provide({context:m.inputContext})],ui.prototype,"adapter",2),ui=Ja([n.customElement("gui-textarea-input")],ui);const wm=Object.freeze(Object.defineProperty({__proto__:null,get TextareaElement(){return ui}},Symbol.toStringTag,{value:"Module"}));var $m=Object.defineProperty,km=Object.getOwnPropertyDescriptor,tt=(e,t,i,a)=>{for(var r=a>1?void 0:a?km(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&$m(t,i,r),r};let He=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.togglePosition="left",this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll('span[role="presentation"]'),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,touched:this.touched,readonly:!1,disabled:!1}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,togglePosition:this.togglePosition};return e.togglePosition==="right"?this.classList.add("gui-toggle--right"):this.classList.contains("gui-toggle--right")&&this.classList.remove("gui-toggle--right"),l.html`
2643
+ `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Nr([f.consume({context:m.formContext}),n.property({attribute:!1})],ci.prototype,"formContext",2),Nr([f.provide({context:m.inputContext})],ci.prototype,"adapter",2),ci=Nr([n.customElement("gui-textarea-input")],ci);const Em=Object.freeze(Object.defineProperty({__proto__:null,get TextareaElement(){return ci}},Symbol.toStringTag,{value:"Module"}));var Pm=Object.defineProperty,Om=Object.getOwnPropertyDescriptor,at=(e,t,i,a)=>{for(var r=a>1?void 0:a?Om(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Pm(t,i,r),r};let We=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.togglePosition="left",this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,touched:this.touched,readonly:!1,disabled:!1,required:this.required}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,togglePosition:this.togglePosition};return e.togglePosition==="right"?this.classList.add("gui-toggle--right"):this.classList.contains("gui-toggle--right")&&this.classList.remove("gui-toggle--right"),l.html`
2279
2644
  <label
2280
2645
  class="gui-label"
2281
2646
  for=${this.uid}
@@ -2285,7 +2650,7 @@
2285
2650
  <div class="gui-widget gui-widget--horizontal gui-toggle--switch">
2286
2651
  <input
2287
2652
  type="checkbox"
2288
- tabindex="0"
2653
+ role="switch"
2289
2654
  id=${this.uid}
2290
2655
  data-cy=${`${this.uid}_toggle`}
2291
2656
  ?checked=${e.value}
@@ -2299,14 +2664,14 @@
2299
2664
  </div>
2300
2665
 
2301
2666
  <span class="gui-label__container">
2302
- ${e.label+(e.required?" *":"")}
2667
+ ${e.label}${Zi(e.required)}
2303
2668
  </span>
2304
2669
  </label>
2305
2670
 
2306
2671
  <div class="gui-widget-hint" id=${`${e.uid}_hint`}>
2307
- ${e.hint??l.nothing} ${W(this.uid,e)}
2672
+ ${e.hint??l.nothing} ${j(this.uid,e)}
2308
2673
  </div>
2309
- `}valueChanged(e){if(e?.stopPropagation(),!this.readOnly){const t=e?.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:t.checked},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};tt([n.property({type:String})],He.prototype,"uid",2),tt([n.property({type:String})],He.prototype,"label",2),tt([n.property({type:String,attribute:"locale-id"})],He.prototype,"localeId",2),tt([n.property({type:Array})],He.prototype,"errors",2),tt([n.property({type:Boolean})],He.prototype,"touched",2),tt([n.property({type:Boolean})],He.prototype,"required",2),tt([n.property({type:Boolean})],He.prototype,"disabled",2),tt([n.property({type:Boolean,attribute:"readonly"})],He.prototype,"readOnly",2),tt([n.property({type:String})],He.prototype,"value",2),tt([n.property({type:String})],He.prototype,"hint",2),tt([n.property({type:String})],He.prototype,"togglePosition",2),He=tt([n.customElement("gui-toggle")],He),typeof customElements<"u"&&!customElements.get("gui-toggle")&&customElements.define("gui-toggle",He);var _m=Object.defineProperty,Tm=Object.getOwnPropertyDescriptor,Qa=(e,t,i,a)=>{for(var r=a>1?void 0:a?Tm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&_m(t,i,r),r};let pi=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-toggle","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
2674
+ `}valueChanged(e){if(e?.stopPropagation(),!this.readOnly){const t=e?.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:t.checked},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};at([n.property({type:String})],We.prototype,"uid",2),at([n.property({type:String})],We.prototype,"label",2),at([n.property({type:String,attribute:"locale-id"})],We.prototype,"localeId",2),at([n.property({type:Array})],We.prototype,"errors",2),at([n.property({type:Boolean})],We.prototype,"touched",2),at([n.property({type:Boolean})],We.prototype,"required",2),at([n.property({type:Boolean})],We.prototype,"disabled",2),at([n.property({type:Boolean,attribute:"readonly"})],We.prototype,"readOnly",2),at([n.property({type:String})],We.prototype,"value",2),at([n.property({type:String})],We.prototype,"hint",2),at([n.property({type:String})],We.prototype,"togglePosition",2),We=at([n.customElement("gui-toggle")],We),typeof customElements<"u"&&!customElements.get("gui-toggle")&&customElements.define("gui-toggle",We);var Im=Object.defineProperty,Mm=Object.getOwnPropertyDescriptor,zr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Mm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Im(t,i,r),r};let mi=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-toggle","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
2310
2675
  <gui-toggle
2311
2676
  .uid=${this.widget.uid}
2312
2677
  .label=${this.adapter.templateData.label}
@@ -2321,7 +2686,7 @@
2321
2686
  @change=${this.valueChanged}
2322
2687
  @blur=${()=>this.adapter.onBlur()}
2323
2688
  ></gui-toggle>
2324
- `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Qa([b.consume({context:m.formContext}),n.property({attribute:!1})],pi.prototype,"formContext",2),Qa([b.provide({context:m.inputContext})],pi.prototype,"adapter",2),pi=Qa([n.customElement("gui-toggle-input")],pi);const Sm=Object.freeze(Object.defineProperty({__proto__:null,get ToggleElement(){return pi}},Symbol.toStringTag,{value:"Module"}));var Cm=Object.defineProperty,xm=Object.getOwnPropertyDescriptor,it=(e,t,i,a)=>{for(var r=a>1?void 0:a?xm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Cm(t,i,r),r};let We=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=void 0,this.required=void 0,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.checkboxPosition="left",this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,touched:this.touched,readonly:!1,disabled:!1}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,checkboxPosition:this.checkboxPosition};return e.checkboxPosition==="right"?this.classList.add("gui-checkbox--right"):this.classList.contains("gui-checkbox--right")&&this.classList.remove("gui-checkbox--right"),l.html`
2689
+ `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};zr([f.consume({context:m.formContext}),n.property({attribute:!1})],mi.prototype,"formContext",2),zr([f.provide({context:m.inputContext})],mi.prototype,"adapter",2),mi=zr([n.customElement("gui-toggle-input")],mi);const Rm=Object.freeze(Object.defineProperty({__proto__:null,get ToggleElement(){return mi}},Symbol.toStringTag,{value:"Module"}));var Fm=Object.defineProperty,Bm=Object.getOwnPropertyDescriptor,rt=(e,t,i,a)=>{for(var r=a>1?void 0:a?Bm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Fm(t,i,r),r};let Ke=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=void 0,this.required=void 0,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.checkboxPosition="left",this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,touched:this.touched,readonly:!1,disabled:!1,required:this.required}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,checkboxPosition:this.checkboxPosition};return e.checkboxPosition==="right"?this.classList.add("gui-checkbox--right"):this.classList.contains("gui-checkbox--right")&&this.classList.remove("gui-checkbox--right"),l.html`
2325
2690
  <label
2326
2691
  class="gui-label"
2327
2692
  for=${this.uid}
@@ -2331,7 +2696,6 @@
2331
2696
  <div class="gui-widget gui-widget--horizontal">
2332
2697
  <input
2333
2698
  type="checkbox"
2334
- tabindex="0"
2335
2699
  id=${this.uid}
2336
2700
  data-cy=${`${this.uid}_checkbox`}
2337
2701
  ?checked=${this.value}
@@ -2343,14 +2707,14 @@
2343
2707
  </div>
2344
2708
 
2345
2709
  <span class="gui-label__container">
2346
- ${e.label+(e.required?" *":"")}
2710
+ ${e.label}${Zi(e.required)}
2347
2711
  </span>
2348
2712
  </label>
2349
2713
 
2350
2714
  <div class="gui-widget-hint" id=${`${e.uid}_hint`}>
2351
- ${e.hint??l.nothing} ${W(this.uid,e)}
2715
+ ${e.hint??l.nothing} ${j(this.uid,e)}
2352
2716
  </div>
2353
- `}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:t.checked},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};it([n.property({type:String})],We.prototype,"uid",2),it([n.property({type:String})],We.prototype,"label",2),it([n.property({type:String,attribute:"locale-id"})],We.prototype,"localeId",2),it([n.property({type:Array})],We.prototype,"errors",2),it([n.property({type:Boolean})],We.prototype,"touched",2),it([n.property({type:Boolean})],We.prototype,"required",2),it([n.property({type:Boolean})],We.prototype,"disabled",2),it([n.property({type:Boolean,attribute:"readonly"})],We.prototype,"readOnly",2),it([n.property({type:String})],We.prototype,"value",2),it([n.property({type:String})],We.prototype,"hint",2),it([n.property({type:String})],We.prototype,"checkboxPosition",2),We=it([n.customElement("gui-checkbox")],We),typeof customElements<"u"&&!customElements.get("gui-checkbox")&&customElements.define("gui-checkbox",We);var Em=Object.defineProperty,Mm=Object.getOwnPropertyDescriptor,ja=(e,t,i,a)=>{for(var r=a>1?void 0:a?Mm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Em(t,i,r),r};let di=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-checkbox","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
2717
+ `}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:t.checked},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};rt([n.property({type:String})],Ke.prototype,"uid",2),rt([n.property({type:String})],Ke.prototype,"label",2),rt([n.property({type:String,attribute:"locale-id"})],Ke.prototype,"localeId",2),rt([n.property({type:Array})],Ke.prototype,"errors",2),rt([n.property({type:Boolean})],Ke.prototype,"touched",2),rt([n.property({type:Boolean})],Ke.prototype,"required",2),rt([n.property({type:Boolean})],Ke.prototype,"disabled",2),rt([n.property({type:Boolean,attribute:"readonly"})],Ke.prototype,"readOnly",2),rt([n.property({type:String})],Ke.prototype,"value",2),rt([n.property({type:String})],Ke.prototype,"hint",2),rt([n.property({type:String})],Ke.prototype,"checkboxPosition",2),Ke=rt([n.customElement("gui-checkbox")],Ke),typeof customElements<"u"&&!customElements.get("gui-checkbox")&&customElements.define("gui-checkbox",Ke);var qm=Object.defineProperty,Nm=Object.getOwnPropertyDescriptor,Gr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Nm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&qm(t,i,r),r};let yi=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-checkbox","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
2354
2718
  <gui-checkbox
2355
2719
  .uid=${this.widget.uid}
2356
2720
  .label=${this.adapter.templateData.label}
@@ -2365,8 +2729,8 @@
2365
2729
  @change=${this.valueChanged}
2366
2730
  @blur=${()=>this.adapter.onBlur()}
2367
2731
  ></gui-checkbox>
2368
- `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};ja([b.consume({context:m.formContext}),n.property({attribute:!1})],di.prototype,"formContext",2),ja([b.provide({context:m.inputContext})],di.prototype,"adapter",2),di=ja([n.customElement("gui-checkbox-input")],di);const Pm=Object.freeze(Object.defineProperty({__proto__:null,get CheckboxElement(){return di}},Symbol.toStringTag,{value:"Module"}));var Im=Object.defineProperty,Om=Object.getOwnPropertyDescriptor,Ie=(e,t,i,a)=>{for(var r=a>1?void 0:a?Om(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Im(t,i,r),r};let $e=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.step=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.minimum=void 0,this.maximum=void 0,this.autoGrow=!1,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e=this.querySelector(`input[id="${this.uid}"]`),t={"min-width":"23px"};if(this.autoGrow)if(e){e.style.width="0px";const a=Math.max(23,e.scrollWidth);t.width=`${a}px`,t.maxWidth=`${a}px`,e.style.width=""}else t.width="47px";const i={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,step:this.step,placeholder:this.placeholder,autocomplete:this.autocomplete};return l.html`
2369
- ${se(this.uid,i)}
2732
+ `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Gr([f.consume({context:m.formContext}),n.property({attribute:!1})],yi.prototype,"formContext",2),Gr([f.provide({context:m.inputContext})],yi.prototype,"adapter",2),yi=Gr([n.customElement("gui-checkbox-input")],yi);const zm=Object.freeze(Object.defineProperty({__proto__:null,get CheckboxElement(){return yi}},Symbol.toStringTag,{value:"Module"}));var Gm=Object.defineProperty,Vm=Object.getOwnPropertyDescriptor,Ie=(e,t,i,a)=>{for(var r=a>1?void 0:a?Vm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Gm(t,i,r),r};let Te=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.hint=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.step=void 0,this.placeholder=void 0,this.autocomplete=void 0,this.minimum=void 0,this.maximum=void 0,this.autoGrow=!1,this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`input[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e=this.querySelector(`input[id="${this.uid}"]`),t={"min-width":"23px"};if(this.autoGrow)if(e){e.style.width="0px";const a=Math.max(23,e.scrollWidth);t.width=`${a}px`,t.maxWidth=`${a}px`,e.style.width=""}else t.width="47px";const i={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,step:this.step,placeholder:this.placeholder,autocomplete:this.autocomplete};return l.html`
2733
+ ${le(this.uid,i)}
2370
2734
 
2371
2735
  <div class="gui-widget">
2372
2736
  <input
@@ -2375,26 +2739,40 @@
2375
2739
  id=${this.uid}
2376
2740
  data-cy=${`${this.uid}_number`}
2377
2741
  class="gui-widget-input"
2378
- style=${bt.styleMap(t)}
2742
+ style=${vt.styleMap(t)}
2379
2743
  value=${this.value}
2380
2744
  ?required=${this.required}
2381
2745
  ?disabled=${this.disabled}
2382
2746
  ?readonly=${this.readOnly}
2383
2747
  step=${typeof this.step=="number"?this.step:l.nothing}
2748
+ min=${Number(this.minimum)?this.minimum:l.nothing}
2749
+ max=${Number(this.maximum)?this.maximum:l.nothing}
2384
2750
  placeholder=${this.placeholder||l.nothing}
2385
2751
  autocomplete=${this.autocomplete||l.nothing}
2386
2752
  @input=${this.valueChanged}
2387
- @beforeinput=${Xs}
2753
+ @beforeinput=${Un}
2388
2754
  @keydown=${this.keyDown}
2389
2755
  @blur=${this.onBlur}
2390
2756
  />
2391
2757
  <span class="gui-number__decoration">
2392
- <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 256 256">
2758
+ <svg
2759
+ xmlns="http://www.w3.org/2000/svg"
2760
+ width="12"
2761
+ height="12"
2762
+ viewBox="0 0 256 256"
2763
+ aria-hidden="true"
2764
+ >
2393
2765
  <path
2394
2766
  d="M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z"
2395
2767
  ></path>
2396
2768
  </svg>
2397
- <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 256 256">
2769
+ <svg
2770
+ xmlns="http://www.w3.org/2000/svg"
2771
+ width="12"
2772
+ height="12"
2773
+ viewBox="0 0 256 256"
2774
+ aria-hidden="true"
2775
+ >
2398
2776
  <path
2399
2777
  d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
2400
2778
  ></path>
@@ -2402,8 +2780,8 @@
2402
2780
  </span>
2403
2781
  </div>
2404
2782
 
2405
- ${W(this.uid,i)}
2406
- `}keyDown(e){switch(e.stopPropagation(),Js(e),e.key){case"ArrowUp":e.preventDefault(),this.plus();break;case"ArrowDown":e.preventDefault(),this.minus();break}}minus(){if(!this.readOnly){const e=this.querySelector(`input[id="${this.uid}"]`),t=typeof this.step=="number"?this.step:1;let i=Number(e.valueAsNumber)||Number(e.valueAsNumber)===0?e.valueAsNumber-t:1;i=Number(this.maximum)?Math.min(i,this.maximum):i,i=Number(this.minimum)?Math.max(i,this.minimum):i,e.valueAsNumber=i,this.value=i,this.dispatchEvent(new CustomEvent("input",{detail:{value:this.value},bubbles:!0,composed:!0}))}}plus(){if(!this.readOnly){const e=this.querySelector(`input[id="${this.uid}"]`),t=typeof this.step=="number"?this.step:1;let i=Number(e.valueAsNumber)||Number(e.valueAsNumber)===0?e.valueAsNumber+t:1;i=Number(this.maximum)?Math.min(i,this.maximum):i,i=Number(this.minimum)?Math.max(i,this.minimum):i,e.valueAsNumber=i,this.value=i,this.dispatchEvent(new CustomEvent("input",{detail:{value:this.value},bubbles:!0,composed:!0}))}}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const i=e.target.valueAsNumber;this.dispatchEvent(new CustomEvent("input",{detail:{value:Number.isNaN(i)?void 0:i},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};Ie([n.property({type:String})],$e.prototype,"uid",2),Ie([n.property({type:String})],$e.prototype,"label",2),Ie([n.property({type:String})],$e.prototype,"hint",2),Ie([n.property({type:String,attribute:"locale-id"})],$e.prototype,"localeId",2),Ie([n.property({type:Array})],$e.prototype,"errors",2),Ie([n.property({type:Boolean})],$e.prototype,"touched",2),Ie([n.property({type:Boolean})],$e.prototype,"required",2),Ie([n.property({type:Boolean})],$e.prototype,"disabled",2),Ie([n.property({type:Boolean,attribute:"readonly"})],$e.prototype,"readOnly",2),Ie([n.property({type:Number})],$e.prototype,"value",2),Ie([n.property({type:Number})],$e.prototype,"step",2),Ie([n.property({type:String})],$e.prototype,"placeholder",2),Ie([n.property({type:String})],$e.prototype,"autocomplete",2),Ie([n.property({type:Number})],$e.prototype,"minimum",2),Ie([n.property({type:Number})],$e.prototype,"maximum",2),Ie([n.property({type:Number})],$e.prototype,"autoGrow",2),$e=Ie([n.customElement("gui-number")],$e),typeof customElements<"u"&&!customElements.get("gui-number")&&customElements.define("gui-number",$e);var Am=Object.defineProperty,Lm=Object.getOwnPropertyDescriptor,er=(e,t,i,a)=>{for(var r=a>1?void 0:a?Lm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Am(t,i,r),r};let hi=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-number","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
2783
+ ${j(this.uid,i)}
2784
+ `}keyDown(e){switch(e.stopPropagation(),Zn(e),e.key){case"ArrowUp":e.preventDefault(),this.plus();break;case"ArrowDown":e.preventDefault(),this.minus();break}}minus(){if(!this.readOnly){const e=this.querySelector(`input[id="${this.uid}"]`),t=typeof this.step=="number"?this.step:1;let i=Number(e.valueAsNumber)||Number(e.valueAsNumber)===0?e.valueAsNumber-t:1;i=Number(this.maximum)?Math.min(i,this.maximum):i,i=Number(this.minimum)?Math.max(i,this.minimum):i,e.valueAsNumber=i,this.value=i,this.dispatchEvent(new CustomEvent("input",{detail:{value:this.value},bubbles:!0,composed:!0}))}}plus(){if(!this.readOnly){const e=this.querySelector(`input[id="${this.uid}"]`),t=typeof this.step=="number"?this.step:1;let i=Number(e.valueAsNumber)||Number(e.valueAsNumber)===0?e.valueAsNumber+t:1;i=Number(this.maximum)?Math.min(i,this.maximum):i,i=Number(this.minimum)?Math.max(i,this.minimum):i,e.valueAsNumber=i,this.value=i,this.dispatchEvent(new CustomEvent("input",{detail:{value:this.value},bubbles:!0,composed:!0}))}}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const i=e.target.valueAsNumber;this.dispatchEvent(new CustomEvent("input",{detail:{value:Number.isNaN(i)?void 0:i},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};Ie([n.property({type:String})],Te.prototype,"uid",2),Ie([n.property({type:String})],Te.prototype,"label",2),Ie([n.property({type:String})],Te.prototype,"hint",2),Ie([n.property({type:String,attribute:"locale-id"})],Te.prototype,"localeId",2),Ie([n.property({type:Array})],Te.prototype,"errors",2),Ie([n.property({type:Boolean})],Te.prototype,"touched",2),Ie([n.property({type:Boolean})],Te.prototype,"required",2),Ie([n.property({type:Boolean})],Te.prototype,"disabled",2),Ie([n.property({type:Boolean,attribute:"readonly"})],Te.prototype,"readOnly",2),Ie([n.property({type:Number})],Te.prototype,"value",2),Ie([n.property({type:Number})],Te.prototype,"step",2),Ie([n.property({type:String})],Te.prototype,"placeholder",2),Ie([n.property({type:String})],Te.prototype,"autocomplete",2),Ie([n.property({type:Number})],Te.prototype,"minimum",2),Ie([n.property({type:Number})],Te.prototype,"maximum",2),Ie([n.property({type:Number})],Te.prototype,"autoGrow",2),Te=Ie([n.customElement("gui-number")],Te),typeof customElements<"u"&&!customElements.get("gui-number")&&customElements.define("gui-number",Te);var Um=Object.defineProperty,Zm=Object.getOwnPropertyDescriptor,Vr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Zm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Um(t,i,r),r};let gi=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-number","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
2407
2785
  <gui-number
2408
2786
  .uid=${this.widget.uid}
2409
2787
  .label=${this.adapter.templateData.label}
@@ -2423,11 +2801,11 @@
2423
2801
  @input=${this.valueChanged}
2424
2802
  @blur=${()=>this.adapter.onBlur()}
2425
2803
  ></gui-number>
2426
- `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};er([b.consume({context:m.formContext}),n.property({attribute:!1})],hi.prototype,"formContext",2),er([b.provide({context:m.inputContext})],hi.prototype,"adapter",2),hi=er([n.customElement("gui-number-input")],hi);const Rm=Object.freeze(Object.defineProperty({__proto__:null,get NumberElement(){return hi}},Symbol.toStringTag,{value:"Module"}));function Fm(e){const t=typeof e;return t==="string"||t==="number"}function js(e,t){return t.find(i=>i.value.toString()===e)?.value}const en=(e,t)=>{if(Array.isArray(e)&&e.length>0&&!mp(e[0])){if(Fm(e[0]))return e.map(i=>({label:i.toString(),value:i}));if(Bm(e[0],t)){const i=qm(e[0],t);return e.map(i)}else throw new Error("Invalid option shape")}return e},Bm=(e,{labelField:t,valueField:i})=>{if(e===null||typeof e!="object")return!1;const a=e,r=t?Object.prototype.hasOwnProperty.call(a,t):!1,s=i?Object.prototype.hasOwnProperty.call(a,i):!1;return t&&!r?!1:!(i&&!s)};function qm(e,{labelField:t,valueField:i}){if(e===null||typeof e!="object")throw new Error("Provided value is not an object");const a=e,r=t&&Object.prototype.hasOwnProperty.call(a,t)?t:void 0,s=i&&Object.prototype.hasOwnProperty.call(a,i)?i:void 0;if(!r&&!s)throw new Error("Neither labelField nor valueField exists on the object");return o=>{if(o===null||typeof o!="object")throw new Error("Item is not an object");const u=o;return{label:r?u[r]:"",value:s?u[s]:""}}}var Nm=Object.defineProperty,zm=Object.getOwnPropertyDescriptor,Ne=(e,t,i,a)=>{for(var r=a>1?void 0:a?zm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Nm(t,i,r),r};let Oe=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.options=[],this.labelField=void 0,this.valueField=void 0,this.direction="column",this.optionsLoading=!1,this.hasMatchingValue=!1,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`input[name="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,touched:this.touched,readonly:!1,disabled:!1}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint,options:this.options,labelField:this.labelField,valueField:this.valueField,direction:this.direction};this.options=en(this.options,{labelField:this.labelField,valueField:this.valueField});const t=this.value;this.hasMatchingValue=this.options?.length?this.options.find(({value:a})=>a===t)!==void 0:!1;const i=this.optionsLoading?l.html`<span>Loading...</span>`:l.html`
2427
- ${qe.repeat(this.options||[],a=>a?.value,(a,r)=>{const s=this.hasMatchingValue&&a.value===e.value,o=!this.hasMatchingValue&&r===0,u=s||o;return l.html`<label for=${`${this.uid}_${r}`}>
2804
+ `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Vr([f.consume({context:m.formContext}),n.property({attribute:!1})],gi.prototype,"formContext",2),Vr([f.provide({context:m.inputContext})],gi.prototype,"adapter",2),gi=Vr([n.customElement("gui-number-input")],gi);const Ym=Object.freeze(Object.defineProperty({__proto__:null,get NumberElement(){return gi}},Symbol.toStringTag,{value:"Module"}));function Hm(e){const t=typeof e;return t==="string"||t==="number"}function Hn(e,t){return t.find(i=>i.value.toString()===e)?.value}const Wn=(e,t)=>{if(Array.isArray(e)&&e.length>0&&!ku(e[0])){if(Hm(e[0]))return e.map(i=>({label:i.toString(),value:i}));if(Wm(e[0],t)){const i=Km(e[0],t);return e.map(i)}else throw new Error("Invalid option shape")}return e},Wm=(e,{labelField:t,valueField:i})=>{if(e===null||typeof e!="object")return!1;const a=e,r=t?Object.prototype.hasOwnProperty.call(a,t):!1,s=i?Object.prototype.hasOwnProperty.call(a,i):!1;return t&&!r?!1:!(i&&!s)};function Km(e,{labelField:t,valueField:i}){if(e===null||typeof e!="object")throw new Error("Provided value is not an object");const a=e,r=t&&Object.prototype.hasOwnProperty.call(a,t)?t:void 0,s=i&&Object.prototype.hasOwnProperty.call(a,i)?i:void 0;if(!r&&!s)throw new Error("Neither labelField nor valueField exists on the object");return o=>{if(o===null||typeof o!="object")throw new Error("Item is not an object");const d=o;return{label:r?d[r]:"",value:s?d[s]:""}}}var Jm=Object.defineProperty,Xm=Object.getOwnPropertyDescriptor,Ue=(e,t,i,a)=>{for(var r=a>1?void 0:a?Xm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Jm(t,i,r),r};let Me=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.options=[],this.labelField=void 0,this.valueField=void 0,this.direction="column",this.optionsLoading=!1,this.hasMatchingValue=!1,this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`input[name="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,touched:this.touched,readonly:!1,disabled:!1,required:this.required}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint,options:this.options,labelField:this.labelField,valueField:this.valueField,direction:this.direction};this.options=Wn(this.options,{labelField:this.labelField,valueField:this.valueField});const t=this.value;this.hasMatchingValue=this.options?.length?this.options.find(({value:a})=>a===t)!==void 0:!1;const i=this.optionsLoading?l.html`<span>Loading...</span>`:l.html`
2805
+ ${Ne.repeat(this.options||[],a=>a?.value,(a,r)=>{const s=this.hasMatchingValue&&a.value===e.value,o=!this.hasMatchingValue&&r===0,d=s||o;return l.html`<label for=${`${this.uid}_${r}`}>
2428
2806
  <input
2429
2807
  type="radio"
2430
- tabindex=${u?"0":"-1"}
2808
+ tabindex=${d?"0":"-1"}
2431
2809
  id=${`${this.uid}_${r}`}
2432
2810
  data-cy=${`${this.uid}_radiogroup_${r}`}
2433
2811
  name=${this.uid}
@@ -2441,7 +2819,7 @@
2441
2819
  ${a.label}
2442
2820
  </label>`})}
2443
2821
  `;return l.html`
2444
- ${se(this.uid,e,!1,void 0,!1)}
2822
+ ${le(this.uid,e,!1,void 0,!1)}
2445
2823
 
2446
2824
  <div
2447
2825
  class="gui-widget${this.direction==="row"?" gui-widget--horizontal":""}"
@@ -2449,12 +2827,15 @@
2449
2827
  id=${this.uid}
2450
2828
  aria-labelledby=${e.label?`${this.uid}_label`:l.nothing}
2451
2829
  aria-describedby=${e.hint?`${this.uid}_hint`:l.nothing}
2830
+ aria-required=${this.required?"true":l.nothing}
2831
+ aria-invalid=${this.touched&&this.errors?.length?"true":l.nothing}
2832
+ aria-errormessage=${this.touched&&this.errors?.length?`${this.uid}_errors`:l.nothing}
2452
2833
  >
2453
2834
  ${i}
2454
2835
  </div>
2455
2836
 
2456
- ${W(this.uid,e)}
2457
- `}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:js(t.value,this.options)},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};Ne([n.property({type:String})],Oe.prototype,"uid",2),Ne([n.property({type:String})],Oe.prototype,"label",2),Ne([n.property({type:String,attribute:"locale-id"})],Oe.prototype,"localeId",2),Ne([n.property({type:Array})],Oe.prototype,"errors",2),Ne([n.property({type:Boolean})],Oe.prototype,"touched",2),Ne([n.property({type:Boolean})],Oe.prototype,"required",2),Ne([n.property({type:Boolean})],Oe.prototype,"disabled",2),Ne([n.property({type:Boolean,attribute:"readonly"})],Oe.prototype,"readOnly",2),Ne([n.property({type:String})],Oe.prototype,"value",2),Ne([n.property({type:String})],Oe.prototype,"hint",2),Ne([n.property({type:Array})],Oe.prototype,"options",2),Ne([n.property({type:String})],Oe.prototype,"labelField",2),Ne([n.property({type:String})],Oe.prototype,"valueField",2),Ne([n.property({type:String})],Oe.prototype,"direction",2),Oe=Ne([n.customElement("gui-radiogroup")],Oe),typeof customElements<"u"&&!customElements.get("gui-radiogroup")&&customElements.define("gui-radiogroup",Oe);var Vm=Object.defineProperty,Gm=Object.getOwnPropertyDescriptor,tr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Gm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Vm(t,i,r),r};let mi=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-radiogroup","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
2837
+ ${j(this.uid,e)}
2838
+ `}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:Hn(t.value,this.options)},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};Ue([n.property({type:String})],Me.prototype,"uid",2),Ue([n.property({type:String})],Me.prototype,"label",2),Ue([n.property({type:String,attribute:"locale-id"})],Me.prototype,"localeId",2),Ue([n.property({type:Array})],Me.prototype,"errors",2),Ue([n.property({type:Boolean})],Me.prototype,"touched",2),Ue([n.property({type:Boolean})],Me.prototype,"required",2),Ue([n.property({type:Boolean})],Me.prototype,"disabled",2),Ue([n.property({type:Boolean,attribute:"readonly"})],Me.prototype,"readOnly",2),Ue([n.property({type:String})],Me.prototype,"value",2),Ue([n.property({type:String})],Me.prototype,"hint",2),Ue([n.property({type:Array})],Me.prototype,"options",2),Ue([n.property({type:String})],Me.prototype,"labelField",2),Ue([n.property({type:String})],Me.prototype,"valueField",2),Ue([n.property({type:String})],Me.prototype,"direction",2),Me=Ue([n.customElement("gui-radiogroup")],Me),typeof customElements<"u"&&!customElements.get("gui-radiogroup")&&customElements.define("gui-radiogroup",Me);var Qm=Object.defineProperty,jm=Object.getOwnPropertyDescriptor,Ur=(e,t,i,a)=>{for(var r=a>1?void 0:a?jm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Qm(t,i,r),r};let bi=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-radiogroup","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
2458
2839
  <gui-radiogroup
2459
2840
  .uid=${this.widget.uid}
2460
2841
  .label=${this.adapter.templateData.label}
@@ -2472,25 +2853,24 @@
2472
2853
  @change=${this.valueChanged}
2473
2854
  @blur=${()=>this.adapter.onBlur()}
2474
2855
  ></gui-radiogroup>
2475
- `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};tr([b.consume({context:m.formContext}),n.property({attribute:!1})],mi.prototype,"formContext",2),tr([b.provide({context:m.inputContext})],mi.prototype,"adapter",2),mi=tr([n.customElement("gui-radiogroup-input")],mi);const Um=Object.freeze(Object.defineProperty({__proto__:null,get RadiogroupElement(){return mi}},Symbol.toStringTag,{value:"Module"}));var Zm=Object.defineProperty,Hm=Object.getOwnPropertyDescriptor,xe=(e,t,i,a)=>{for(var r=a>1?void 0:a?Hm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Zm(t,i,r),r};let be=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.icon=void 0,this.autocomplete=void 0,this.options=[],this.placeholder=void 0,this.invalidOptionMessage=void 0,this.labelField=void 0,this.valueField=void 0,this.optionsLoading=!1,this.hasMatchingValue=!1,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(`select[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint,icon:this.icon,autocomplete:this.autocomplete,options:this.options,placeholder:this.placeholder,labelField:this.labelField,valueField:this.valueField},t=Ke("select",e);this.options=en(this.options,{labelField:this.labelField,valueField:this.valueField}),this.hasMatchingValue=this.options?.length?this.options.find(({value:a})=>a===this.value)!==void 0:!1;const i=this.optionsLoading?l.html`<span>Loading...</span>`:l.html`
2856
+ `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Ur([f.consume({context:m.formContext}),n.property({attribute:!1})],bi.prototype,"formContext",2),Ur([f.provide({context:m.inputContext})],bi.prototype,"adapter",2),bi=Ur([n.customElement("gui-radiogroup-input")],bi);const ey=Object.freeze(Object.defineProperty({__proto__:null,get RadiogroupElement(){return bi}},Symbol.toStringTag,{value:"Module"}));var ty=Object.defineProperty,iy=Object.getOwnPropertyDescriptor,Ee=(e,t,i,a)=>{for(var r=a>1?void 0:a?iy(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&ty(t,i,r),r};let we=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=void 0,this.hint=void 0,this.icon=void 0,this.autocomplete=void 0,this.options=[],this.placeholder=void 0,this.invalidOptionMessage=void 0,this.labelField=void 0,this.valueField=void 0,this.optionsLoading=!1,this.hasMatchingValue=!1,this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(`select[id="${this.uid}"]`),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})})}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}render(){super.render();const e={uid:this.uid,label:this.label,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,value:this.value,hint:this.hint,icon:this.icon,autocomplete:this.autocomplete,options:this.options,placeholder:this.placeholder,labelField:this.labelField,valueField:this.valueField},t=Xe("select",e);this.options=Wn(this.options,{labelField:this.labelField,valueField:this.valueField}),this.hasMatchingValue=this.options?.length?this.options.find(({value:a})=>a===this.value)!==void 0:!1;const i=this.optionsLoading?l.html`<span>Loading...</span>`:l.html`
2476
2857
  <option value="" disabled selected=${this.hasMatchingValue?l.nothing:""}>
2477
2858
  ${this.placeholder??"Select an option"}
2478
2859
  </option>
2479
- ${qe.repeat(this.options||[],a=>a?.value,a=>l.html`<option
2860
+ ${Ne.repeat(this.options||[],a=>a?.value,a=>l.html`<option
2480
2861
  value=${a.value}
2481
2862
  selected=${this.hasMatchingValue&&a.value===this.value?"":l.nothing}
2482
2863
  >
2483
2864
  ${a.label}
2484
2865
  </option>`)}
2485
2866
  `;return l.html`
2486
- ${se(this.uid,e)}
2867
+ ${le(this.uid,e)}
2487
2868
 
2488
2869
  <div class="gui-widget">
2489
2870
  <select
2490
2871
  id=${this.uid}
2491
- tabindex="0"
2492
2872
  data-cy=${`${this.uid}_select`}
2493
- class=${w.classMap({"gui-widget-input":!0,...t.widgetClasses})}
2873
+ class=${T.classMap({"gui-widget-input":!0,...t.widgetClasses})}
2494
2874
  ?required=${e.required}
2495
2875
  ?disabled=${e.disabled||e.readonly}
2496
2876
  autocomplete=${this.autocomplete||l.nothing}
@@ -2500,7 +2880,13 @@
2500
2880
  ${i}
2501
2881
  </select>
2502
2882
  <span class="gui-select__arrow"
2503
- ><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256">
2883
+ ><svg
2884
+ xmlns="http://www.w3.org/2000/svg"
2885
+ width="16"
2886
+ height="16"
2887
+ viewBox="0 0 256 256"
2888
+ aria-hidden="true"
2889
+ >
2504
2890
  <path
2505
2891
  d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
2506
2892
  ></path></svg
@@ -2508,8 +2894,8 @@
2508
2894
  ${t.html}
2509
2895
  </div>
2510
2896
 
2511
- ${W(this.uid,e)}
2512
- `}updated(e){e.has("value")&&!this.hasMatchingValue&&this.value&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:(this.invalidOptionMessage??"Invalid selection: '{value}' is not a valid option.").replace("{value}",String(this.value))},bubbles:!0}))}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:js(t.value,this.options)},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};xe([n.property({type:String})],be.prototype,"uid",2),xe([n.property({type:String})],be.prototype,"label",2),xe([n.property({type:String,attribute:"locale-id"})],be.prototype,"localeId",2),xe([n.property({type:Array})],be.prototype,"errors",2),xe([n.property({type:Boolean})],be.prototype,"touched",2),xe([n.property({type:Boolean})],be.prototype,"required",2),xe([n.property({type:Boolean})],be.prototype,"disabled",2),xe([n.property({type:Boolean,attribute:"readonly"})],be.prototype,"readOnly",2),xe([n.property({type:String})],be.prototype,"value",2),xe([n.property({type:String})],be.prototype,"hint",2),xe([n.property({type:String})],be.prototype,"icon",2),xe([n.property({type:String})],be.prototype,"autocomplete",2),xe([n.property({type:Array})],be.prototype,"options",2),xe([n.property({type:String})],be.prototype,"placeholder",2),xe([n.property({type:String,attribute:"invalid-option-message"})],be.prototype,"invalidOptionMessage",2),xe([n.property({type:String})],be.prototype,"labelField",2),xe([n.property({type:String})],be.prototype,"valueField",2),be=xe([n.customElement("gui-select")],be),typeof customElements<"u"&&!customElements.get("gui-select")&&customElements.define("gui-select",be);var Wm=Object.defineProperty,Ym=Object.getOwnPropertyDescriptor,ir=(e,t,i,a)=>{for(var r=a>1?void 0:a?Ym(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Wm(t,i,r),r};let ci=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-select","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
2897
+ ${j(this.uid,e)}
2898
+ `}updated(e){e.has("value")&&!this.hasMatchingValue&&this.value&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:(this.invalidOptionMessage??"Invalid selection: '{value}' is not a valid option.").replace("{value}",String(this.value))},bubbles:!0}))}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:Hn(t.value,this.options)},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};Ee([n.property({type:String})],we.prototype,"uid",2),Ee([n.property({type:String})],we.prototype,"label",2),Ee([n.property({type:String,attribute:"locale-id"})],we.prototype,"localeId",2),Ee([n.property({type:Array})],we.prototype,"errors",2),Ee([n.property({type:Boolean})],we.prototype,"touched",2),Ee([n.property({type:Boolean})],we.prototype,"required",2),Ee([n.property({type:Boolean})],we.prototype,"disabled",2),Ee([n.property({type:Boolean,attribute:"readonly"})],we.prototype,"readOnly",2),Ee([n.property({type:String})],we.prototype,"value",2),Ee([n.property({type:String})],we.prototype,"hint",2),Ee([n.property({type:String})],we.prototype,"icon",2),Ee([n.property({type:String})],we.prototype,"autocomplete",2),Ee([n.property({type:Array})],we.prototype,"options",2),Ee([n.property({type:String})],we.prototype,"placeholder",2),Ee([n.property({type:String,attribute:"invalid-option-message"})],we.prototype,"invalidOptionMessage",2),Ee([n.property({type:String})],we.prototype,"labelField",2),Ee([n.property({type:String})],we.prototype,"valueField",2),we=Ee([n.customElement("gui-select")],we),typeof customElements<"u"&&!customElements.get("gui-select")&&customElements.define("gui-select",we);var ay=Object.defineProperty,ry=Object.getOwnPropertyDescriptor,Zr=(e,t,i,a)=>{for(var r=a>1?void 0:a?ry(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&ay(t,i,r),r};let fi=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-select","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
2513
2899
  <gui-select
2514
2900
  .uid=${this.widget.uid}
2515
2901
  .label=${this.adapter.templateData.label}
@@ -2531,20 +2917,26 @@
2531
2917
  @inputError=${this.onInputError}
2532
2918
  @blur=${()=>this.adapter.onBlur()}
2533
2919
  ></gui-select>
2534
- `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};ir([b.consume({context:m.formContext}),n.property({attribute:!1})],ci.prototype,"formContext",2),ir([b.provide({context:m.inputContext})],ci.prototype,"adapter",2),ci=ir([n.customElement("gui-select-input")],ci);const Km=Object.freeze(Object.defineProperty({__proto__:null,get SelectElement(){return ci}},Symbol.toStringTag,{value:"Module"}));var Xm=Object.defineProperty,Jm=Object.getOwnPropertyDescriptor,ke=(e,t,i,a)=>{for(var r=a>1?void 0:a?Jm(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Xm(t,i,r),r};const Qm=["Enter",",","Tab","blur"];let he=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=[],this.hint=void 0,this.placeholder=void 0,this.icon=void 0,this.separators=void 0,this.allowDuplicates=!0,this.trim=!0,this.limit=void 0,this.removeAriaLabel=void 0,this.removeIcon=void 0,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(".gui-tags-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched}})}),this.onPillRemove=e=>{if(this.disabled||this.readOnly)return;const t=this.getValue(),i=t.findIndex((r,s)=>this.pillKey(r,s)===e.detail.key);if(i<0)return;const a=t.filter((r,s)=>s!==i);this.emitChange(a),a.length===0&&requestAnimationFrame(()=>this.focusInput())},this.onPillKeydown=e=>{e.detail.event.key==="ArrowRight"&&!this.isDropdownOpen()&&this.focusInput()}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}getSeparators(){return this.separators&&this.separators.length>0?this.separators:Qm}getValue(){return Array.isArray(this.value)?this.value:[]}getRemoveAriaLabel(){return this.removeAriaLabel??"Remove tag"}pillKey(e,t){return`${t}-${e}`}render(){const e=this.getValue(),t={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,placeholder:this.placeholder,icon:this.icon},i={"gui-widget-icon":!0,[this.icon]:!!this.icon},a=e.map((r,s)=>({key:this.pillKey(r,s),label:r}));return l.html`
2535
- ${this.label?se(this.uid,t,!1,void 0,!1):l.nothing}
2920
+ `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Zr([f.consume({context:m.formContext}),n.property({attribute:!1})],fi.prototype,"formContext",2),Zr([f.provide({context:m.inputContext})],fi.prototype,"adapter",2),fi=Zr([n.customElement("gui-select-input")],fi);const sy=Object.freeze(Object.defineProperty({__proto__:null,get SelectElement(){return fi}},Symbol.toStringTag,{value:"Module"}));var ny=Object.defineProperty,oy=Object.getOwnPropertyDescriptor,_e=(e,t,i,a)=>{for(var r=a>1?void 0:a?oy(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&ny(t,i,r),r};const ly=["Enter",",","Tab","blur"];let fe=class extends l.LitElement{constructor(){super(...arguments),this.uid=void 0,this.label=void 0,this.localeId="en",this.errors=[],this.touched=!1,this.required=!1,this.disabled=!1,this.readOnly=!1,this.value=[],this.hint=void 0,this.placeholder=void 0,this.icon=void 0,this.separators=void 0,this.allowDuplicates=!0,this.trim=!0,this.limit=void 0,this.removeAriaLabel=void 0,this.removeIcon=void 0,this.ariaController=new he(this,{getTargets:()=>this.querySelectorAll(".gui-tags-input"),getState:()=>({uid:this.uid,templateData:{hint:this.hint,errors:this.errors,readonly:this.readOnly,disabled:this.disabled,touched:this.touched,required:this.required}})}),this.onPillRemove=e=>{if(this.disabled||this.readOnly)return;const t=this.getValue(),i=t.findIndex((r,s)=>this.pillKey(r,s)===e.detail.key);if(i<0)return;const a=t.filter((r,s)=>s!==i);this.emitChange(a),a.length===0&&requestAnimationFrame(()=>this.focusInput())},this.onPillKeydown=e=>{e.detail.event.key==="ArrowRight"&&!this.isDropdownOpen()&&this.focusInput()}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}getSeparators(){return this.separators&&this.separators.length>0?this.separators:ly}getValue(){return Array.isArray(this.value)?this.value:[]}getRemoveAriaLabel(){return this.removeAriaLabel??"Remove tag"}pillKey(e,t){return`${t}-${e}`}render(){const e=this.getValue(),t={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required,disabled:this.disabled,readonly:this.readOnly,placeholder:this.placeholder,icon:this.icon},i={"gui-widget-icon":!0,[this.icon]:!!this.icon},a=e.map((r,s)=>({key:this.pillKey(r,s),label:r}));return l.html`
2921
+ ${this.label?le(this.uid,t,!1,void 0,!1):l.nothing}
2536
2922
 
2537
2923
  <div class="gui-widget">
2538
2924
  <div
2539
- class=${w.classMap({"gui-widget-input":!0,"gui-tags-input":!0,"gui-tags-input--icon":!!this.icon})}
2925
+ class=${T.classMap({"gui-widget-input":!0,"gui-tags-input":!0,"gui-tags-input--icon":!!this.icon})}
2540
2926
  role="group"
2541
2927
  aria-label=${this.label??"Tags input"}
2542
2928
  >
2543
- ${this.icon?l.html`<span class=${w.classMap(i)} data-icon=${this.icon}></span>`:l.nothing}
2929
+ ${this.icon?l.html`<span
2930
+ class=${T.classMap(i)}
2931
+ data-icon=${this.icon}
2932
+ aria-hidden="true"
2933
+ ></span>`:l.nothing}
2544
2934
 
2545
2935
  <gui-pills
2546
2936
  class="gui-tags__pills"
2547
- style=${bt.styleMap(a.length?{}:{"min-width":0})}
2937
+ style=${vt.styleMap(a.length?{}:{"min-width":0})}
2938
+ .uid=${this.uid}
2939
+ .toolbarAriaLabel=${"Selected tags"}
2548
2940
  .items=${a}
2549
2941
  .removable=${!0}
2550
2942
  .clickable=${!1}
@@ -2574,10 +2966,10 @@
2574
2966
  />
2575
2967
  </div>
2576
2968
 
2577
- ${W(this.uid,t)}
2969
+ ${j(this.uid,t)}
2578
2970
  </div>
2579
2971
  `}onInputKeydown(e){if(this.disabled||this.readOnly)return;const t=e.target,i=this.getSeparators(),a=t.value,r=t.selectionStart===0&&t.selectionEnd===0;if(e.key==="Enter"&&i.includes("Enter")){e.preventDefault(),this.commitDraft(a)&&(t.value="");return}if(e.key===","&&i.includes(",")){e.preventDefault(),this.commitDraft(a)&&(t.value="");return}if(e.key==="Tab"&&i.includes("Tab")&&a.length>0){this.commitDraft(a)&&(t.value="");return}if(e.key==="Escape"){e.preventDefault(),t.value="";return}const s=this.getValue(),o=this.isCompactMode();if(e.key==="ArrowDown"&&o&&s.length>0){e.preventDefault(),this.enterPillList(0);return}if(e.key==="ArrowLeft"&&!o&&r&&s.length>0){e.preventDefault(),this.enterPillList(s.length-1);return}if(e.key==="Backspace"&&a===""&&s.length>0){e.preventDefault(),this.enterPillList(s.length-1);return}}onInputBlur(e){const t=e.target,i=this.getSeparators(),a=t.value;a.length>0&&i.includes("blur")&&!this.disabled&&!this.readOnly&&this.commitDraft(a)&&(t.value=""),this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}onPaste(e){if(this.disabled||this.readOnly)return;const t=e.clipboardData?.getData("text")??"";if(!t)return;const a=this.getSeparators().filter(h=>h!=="Enter"&&h!=="Tab"&&h!=="blur");if(a.length===0)return;const r=new RegExp(`[${a.map(h=>h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("")}
2580
- ]`);if(!r.test(t))return;e.preventDefault();const s=e.target instanceof HTMLInputElement?e.target:null,u=((s?.value??"")+t).split(r),p=u.slice(0,-1),d=u[u.length-1]??"";this.commitDraftBatch(p)&&s&&(s.value=d)}commitDraft(e){const t=this.trim?e.trim():e;if(t.length===0)return!1;const i=this.getValue();return this.allowDuplicates===!1&&i.includes(t)?!0:this.limit!==void 0&&i.length>=this.limit?!1:(this.emitChange([...i,t]),!0)}commitDraftBatch(e){const t=this.getValue(),i=[...t];for(const a of e){const r=this.trim?a.trim():a;if(r.length!==0&&!(this.allowDuplicates===!1&&i.includes(r))){if(this.limit!==void 0&&i.length>=this.limit)break;i.push(r)}}return i.length===t.length?!1:(this.emitChange(i),!0)}emitChange(e){this.value=e,this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}focusInput(){this.querySelector(`input[id="${this.uid}"]`)?.focus()}getPills(){return this.querySelector("gui-pills")}isDropdownOpen(){return!!this.getPills()?.querySelector(".gui-pills__dropdown")}isCompactMode(){const e=this.getPills();if(!e)return!1;const t=e.querySelector(".gui-pills__strip-wrapper");return t?getComputedStyle(t).display==="none":!1}enterPillList(e){const t=this.getPills();t&&(this.isCompactMode()?(t.openDropdown(),requestAnimationFrame(()=>t.focusPillAt(e))):t.focusPillAt(e))}};ke([n.property({type:String})],he.prototype,"uid",2),ke([n.property({type:String})],he.prototype,"label",2),ke([n.property({type:String,attribute:"locale-id"})],he.prototype,"localeId",2),ke([n.property({type:Array})],he.prototype,"errors",2),ke([n.property({type:Boolean})],he.prototype,"touched",2),ke([n.property({type:Boolean})],he.prototype,"required",2),ke([n.property({type:Boolean})],he.prototype,"disabled",2),ke([n.property({type:Boolean,attribute:"readonly"})],he.prototype,"readOnly",2),ke([n.property({type:Array})],he.prototype,"value",2),ke([n.property({type:String})],he.prototype,"hint",2),ke([n.property({type:String})],he.prototype,"placeholder",2),ke([n.property({type:String})],he.prototype,"icon",2),ke([n.property({type:Array})],he.prototype,"separators",2),ke([n.property({type:Boolean})],he.prototype,"allowDuplicates",2),ke([n.property({type:Boolean})],he.prototype,"trim",2),ke([n.property({type:Number})],he.prototype,"limit",2),ke([n.property({type:String,attribute:"remove-aria-label"})],he.prototype,"removeAriaLabel",2),ke([n.property({type:String,attribute:"remove-icon"})],he.prototype,"removeIcon",2),he=ke([n.customElement("gui-tags")],he),typeof customElements<"u"&&!customElements.get("gui-tags")&&customElements.define("gui-tags",he);var jm=Object.defineProperty,ec=Object.getOwnPropertyDescriptor,ar=(e,t,i,a)=>{for(var r=a>1?void 0:a?ec(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&jm(t,i,r),r};let yi=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-tags","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
2972
+ ]`);if(!r.test(t))return;e.preventDefault();const s=e.target instanceof HTMLInputElement?e.target:null,d=((s?.value??"")+t).split(r),p=d.slice(0,-1),u=d[d.length-1]??"";this.commitDraftBatch(p)&&s&&(s.value=u)}commitDraft(e){const t=this.trim?e.trim():e;if(t.length===0)return!1;const i=this.getValue();return this.allowDuplicates===!1&&i.includes(t)?!0:this.limit!==void 0&&i.length>=this.limit?!1:(this.emitChange([...i,t]),!0)}commitDraftBatch(e){const t=this.getValue(),i=[...t];for(const a of e){const r=this.trim?a.trim():a;if(r.length!==0&&!(this.allowDuplicates===!1&&i.includes(r))){if(this.limit!==void 0&&i.length>=this.limit)break;i.push(r)}}return i.length===t.length?!1:(this.emitChange(i),!0)}emitChange(e){this.value=e,this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0}))}focusInput(){this.querySelector(`input[id="${this.uid}"]`)?.focus()}getPills(){return this.querySelector("gui-pills")}isDropdownOpen(){return!!this.getPills()?.querySelector(".gui-pills__dropdown")}isCompactMode(){const e=this.getPills();if(!e)return!1;const t=e.querySelector(".gui-pills__strip-wrapper");return t?getComputedStyle(t).display==="none":!1}enterPillList(e){const t=this.getPills();t&&(this.isCompactMode()?(t.openDropdown(),requestAnimationFrame(()=>t.focusPillAt(e))):t.focusPillAt(e))}};_e([n.property({type:String})],fe.prototype,"uid",2),_e([n.property({type:String})],fe.prototype,"label",2),_e([n.property({type:String,attribute:"locale-id"})],fe.prototype,"localeId",2),_e([n.property({type:Array})],fe.prototype,"errors",2),_e([n.property({type:Boolean})],fe.prototype,"touched",2),_e([n.property({type:Boolean})],fe.prototype,"required",2),_e([n.property({type:Boolean})],fe.prototype,"disabled",2),_e([n.property({type:Boolean,attribute:"readonly"})],fe.prototype,"readOnly",2),_e([n.property({type:Array})],fe.prototype,"value",2),_e([n.property({type:String})],fe.prototype,"hint",2),_e([n.property({type:String})],fe.prototype,"placeholder",2),_e([n.property({type:String})],fe.prototype,"icon",2),_e([n.property({type:Array})],fe.prototype,"separators",2),_e([n.property({type:Boolean})],fe.prototype,"allowDuplicates",2),_e([n.property({type:Boolean})],fe.prototype,"trim",2),_e([n.property({type:Number})],fe.prototype,"limit",2),_e([n.property({type:String,attribute:"remove-aria-label"})],fe.prototype,"removeAriaLabel",2),_e([n.property({type:String,attribute:"remove-icon"})],fe.prototype,"removeIcon",2),fe=_e([n.customElement("gui-tags")],fe),typeof customElements<"u"&&!customElements.get("gui-tags")&&customElements.define("gui-tags",fe);var dy=Object.defineProperty,py=Object.getOwnPropertyDescriptor,Yr=(e,t,i,a)=>{for(var r=a>1?void 0:a?py(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&dy(t,i,r),r};let vi=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-tags","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return super.render(),l.html`
2581
2973
  <gui-tags
2582
2974
  .uid=${this.widget.uid}
2583
2975
  .label=${this.adapter.templateData.label}
@@ -2599,7 +2991,7 @@
2599
2991
  @change=${this.valueChanged}
2600
2992
  @blur=${()=>this.adapter.onBlur()}
2601
2993
  ></gui-tags>
2602
- `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};ar([b.consume({context:m.formContext}),n.property({attribute:!1})],yi.prototype,"formContext",2),ar([b.provide({context:m.inputContext})],yi.prototype,"adapter",2),yi=ar([n.customElement("gui-tags-input")],yi);const tc=Object.freeze(Object.defineProperty({__proto__:null,get TagsElement(){return yi}},Symbol.toStringTag,{value:"Module"}));var ic=Object.defineProperty,ac=Object.getOwnPropertyDescriptor,gi=(e,t,i,a)=>{for(var r=a>1?void 0:a?ac(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&ic(t,i,r),r};let rc=0;const sc=()=>rc++;let kt=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.isFocused=!1,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-repeater","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}onFocusIn(e){e.stopPropagation(),this.isFocused=!0}onFocusOut(e){e.stopPropagation(),this.adapter.onBlur(),this.isFocused=!1}render(){const e=this.adapter.templateData,t=e.touched&&e.errors&&e.errors.length>0;return l.html`
2994
+ `}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Yr([f.consume({context:m.formContext}),n.property({attribute:!1})],vi.prototype,"formContext",2),Yr([f.provide({context:m.inputContext})],vi.prototype,"adapter",2),vi=Yr([n.customElement("gui-tags-input")],vi);const uy=Object.freeze(Object.defineProperty({__proto__:null,get TagsElement(){return vi}},Symbol.toStringTag,{value:"Module"}));var hy=Object.defineProperty,cy=Object.getOwnPropertyDescriptor,Di=(e,t,i,a)=>{for(var r=a>1?void 0:a?cy(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&hy(t,i,r),r};let my=0;const yy=()=>my++;let _t=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.InputWidgetAdapter,this.isFocused=!1,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-repeater","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}onFocusIn(e){e.stopPropagation(),this.isFocused=!0}onFocusOut(e){e.stopPropagation(),this.adapter.onBlur(),this.isFocused=!1}render(){const e=this.adapter.templateData,t=e.touched&&e.errors&&e.errors.length>0;return l.html`
2603
2995
  <div
2604
2996
  id=${this.widget.uid}
2605
2997
  class=${`gui-repeater__main-card gui-repeater__card ${this.isFocused?"gui-repeater__card--focused":""}`}
@@ -2615,7 +3007,7 @@
2615
3007
  .required=${e.validator?.required}
2616
3008
  .native=${!1}
2617
3009
  ></gui-label>
2618
- ${e.value?qe.repeat(e.value,i=>cp(i,sc),(i,a)=>l.html`
3010
+ ${e.value?Ne.repeat(e.value,i=>Su(i,yy),(i,a)=>l.html`
2619
3011
  <div class="gui-repeater__card">
2620
3012
  <div class="gui-repeater__card-header">
2621
3013
  ${e.title?l.html`<span class="gui-repeater__card-title"
@@ -2660,24 +3052,24 @@
2660
3052
  .errors=${e.errors}
2661
3053
  .touched=${e.touched}
2662
3054
  ></gui-errors>`:l.nothing}
2663
- `}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}addItem(){const e=[...this.adapter.templateData.value??[],{}];this.adapter.valueChanged(e),this.requestUpdate()}removeItem(e){const t=(this.adapter.templateData.value??[]).filter((i,a)=>e!==a);"structuredClone"in window?this.adapter.valueChanged(structuredClone(t)):this.adapter.valueChanged(JSON.parse(JSON.stringify(t))),this.requestUpdate()}};gi([b.consume({context:m.formContext}),n.property({attribute:!1})],kt.prototype,"formContext",2),gi([b.provide({context:m.inputContext})],kt.prototype,"adapter",2),gi([n.state()],kt.prototype,"isFocused",2),gi([n.query(".gui-repeater__main-card")],kt.prototype,"_repeaterRef",2),kt=gi([n.customElement("gui-repeater-input")],kt);const nc=Object.freeze(Object.defineProperty({__proto__:null,get RepeaterElement(){return kt}},Symbol.toStringTag,{value:"Module"}));var oc=Object.defineProperty,lc=Object.getOwnPropertyDescriptor,rr=(e,t,i,a)=>{for(var r=a>1?void 0:a?lc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&oc(t,i,r),r};let bi=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.LayoutWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-flex","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){const e={"gui-flex__widget":!0,"gui-flex__widget--row":this.adapter.templateData.direction==="row","gui-flex__widget--row-reverse":this.adapter.templateData.direction==="row-reverse","gui-flex__widget--column":!this.adapter.templateData.direction||this.adapter.templateData.direction==="column","gui-flex__widget--column-reverse":this.adapter.templateData.direction==="column-reverse","gui-flex__widget--justify-center":this.adapter.templateData.justify==="center","gui-flex__widget--justify-start":this.adapter.templateData.justify==="start","gui-flex__widget--justify-end":this.adapter.templateData.justify==="end","gui-flex__widget--justify-stretch":!this.adapter.templateData.justify||this.adapter.templateData.justify==="stretch","gui-flex__widget--align-start":!this.adapter.templateData.align||this.adapter.templateData.align==="start","gui-flex__widget--align-end":this.adapter.templateData.align==="end","gui-flex__widget--align-center":this.adapter.templateData.align==="center","gui-flex__widget--align-space-between":this.adapter.templateData.align==="space-between","gui-flex__widget--align-space-around":this.adapter.templateData.align==="space-around","gui-flex__widget--align-space-evenly":this.adapter.templateData.align==="space-evenly"};return l.html`
3055
+ `}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}addItem(){const e=[...this.adapter.templateData.value??[],{}];this.adapter.valueChanged(e),this.requestUpdate()}removeItem(e){const t=(this.adapter.templateData.value??[]).filter((i,a)=>e!==a);"structuredClone"in window?this.adapter.valueChanged(structuredClone(t)):this.adapter.valueChanged(JSON.parse(JSON.stringify(t))),this.requestUpdate()}};Di([f.consume({context:m.formContext}),n.property({attribute:!1})],_t.prototype,"formContext",2),Di([f.provide({context:m.inputContext})],_t.prototype,"adapter",2),Di([n.state()],_t.prototype,"isFocused",2),Di([n.query(".gui-repeater__main-card")],_t.prototype,"_repeaterRef",2),_t=Di([n.customElement("gui-repeater-input")],_t);const gy=Object.freeze(Object.defineProperty({__proto__:null,get RepeaterElement(){return _t}},Symbol.toStringTag,{value:"Module"}));var by=Object.defineProperty,fy=Object.getOwnPropertyDescriptor,Hr=(e,t,i,a)=>{for(var r=a>1?void 0:a?fy(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&by(t,i,r),r};let wi=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.LayoutWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-flex","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){const e={"gui-flex__widget":!0,"gui-flex__widget--row":this.adapter.templateData.direction==="row","gui-flex__widget--row-reverse":this.adapter.templateData.direction==="row-reverse","gui-flex__widget--column":!this.adapter.templateData.direction||this.adapter.templateData.direction==="column","gui-flex__widget--column-reverse":this.adapter.templateData.direction==="column-reverse","gui-flex__widget--justify-center":this.adapter.templateData.justify==="center","gui-flex__widget--justify-start":this.adapter.templateData.justify==="start","gui-flex__widget--justify-end":this.adapter.templateData.justify==="end","gui-flex__widget--justify-stretch":!this.adapter.templateData.justify||this.adapter.templateData.justify==="stretch","gui-flex__widget--align-start":!this.adapter.templateData.align||this.adapter.templateData.align==="start","gui-flex__widget--align-end":this.adapter.templateData.align==="end","gui-flex__widget--align-center":this.adapter.templateData.align==="center","gui-flex__widget--align-space-between":this.adapter.templateData.align==="space-between","gui-flex__widget--align-space-around":this.adapter.templateData.align==="space-around","gui-flex__widget--align-space-evenly":this.adapter.templateData.align==="space-evenly"};return l.html`
2664
3056
  <div
2665
- class=${w.classMap(e)}
3057
+ class=${T.classMap(e)}
2666
3058
  id=${this.widget?.uid}
2667
3059
  style=${this.adapter.templateData.gap?`gap: ${this.adapter.templateData.gap}px`:""}
2668
3060
  >
2669
- ${qe.repeat(this.adapter.templateData.children||[],t=>t?.uid,t=>l.html`<gui-widget .widget=${t}></gui-widget>`)}
3061
+ ${Ne.repeat(this.adapter.templateData.children||[],t=>t?.uid,t=>l.html`<gui-widget .widget=${t}></gui-widget>`)}
2670
3062
  </div>
2671
- `}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};rr([b.consume({context:m.formContext}),n.property({attribute:!1})],bi.prototype,"formContext",2),rr([b.provide({context:m.layoutContext})],bi.prototype,"adapter",2),bi=rr([n.customElement("gui-flex-layout")],bi);const uc=Object.freeze(Object.defineProperty({__proto__:null,get FlexElement(){return bi}},Symbol.toStringTag,{value:"Module"}));var pc=Object.defineProperty,dc=Object.getOwnPropertyDescriptor,sr=(e,t,i,a)=>{for(var r=a>1?void 0:a?dc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&pc(t,i,r),r};let fi=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.LayoutWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-grid","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){const e=this.adapter.templateData.direction==="column",t=!e,i=this.adapter.templateData.autoFit??!0,a={"gui-grid__widget":!0,"gui-grid__widget--row":t,"gui-grid__widget--row--auto-fit":t&&i,"gui-grid__widget--column":e,"gui-grid__widget--align-center":this.adapter.templateData.align==="center","gui-grid__widget--align-start":this.adapter.templateData.align==="start","gui-grid__widget--align-end":this.adapter.templateData.align==="end","gui-grid__widget--align-space-between":this.adapter.templateData.align==="space-between","gui-grid__widget--align-space-around":this.adapter.templateData.align==="space-around","gui-grid__widget--align-space-evenly":this.adapter.templateData.align==="space-evenly","gui-grid__widget--align-stretch":!this.adapter.templateData.align||this.adapter.templateData.align==="stretch","gui-grid__widget--justify-center":this.adapter.templateData.justify==="center","gui-grid__widget--justify-start":this.adapter.templateData.justify==="start","gui-grid__widget--justify-end":this.adapter.templateData.justify==="end","gui-grid__widget--justify-stretch":this.adapter.templateData.justify==="stretch"},r=[];return this.adapter.templateData.columnGap!==void 0&&r.push(`column-gap: ${this.adapter.templateData.columnGap}px`),this.adapter.templateData.rowGap!==void 0&&r.push(`row-gap: ${this.adapter.templateData.rowGap}px`),l.html`
2672
- <div class=${w.classMap(a)} id=${this.widget?.uid} style=${r.join("; ")}>
2673
- ${qe.repeat(this.adapter.templateData.children||[],s=>s?.uid,s=>l.html`<div class="gui-grid__cell" style="grid-column: span ${s.size||1}">
3063
+ `}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Hr([f.consume({context:m.formContext}),n.property({attribute:!1})],wi.prototype,"formContext",2),Hr([f.provide({context:m.layoutContext})],wi.prototype,"adapter",2),wi=Hr([n.customElement("gui-flex-layout")],wi);const vy=Object.freeze(Object.defineProperty({__proto__:null,get FlexElement(){return wi}},Symbol.toStringTag,{value:"Module"}));var Dy=Object.defineProperty,wy=Object.getOwnPropertyDescriptor,Wr=(e,t,i,a)=>{for(var r=a>1?void 0:a?wy(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Dy(t,i,r),r};let $i=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.LayoutWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-grid","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){const e=this.adapter.templateData.direction==="column",t=!e,i=this.adapter.templateData.autoFit??!0,a={"gui-grid__widget":!0,"gui-grid__widget--row":t,"gui-grid__widget--row--auto-fit":t&&i,"gui-grid__widget--column":e,"gui-grid__widget--align-center":this.adapter.templateData.align==="center","gui-grid__widget--align-start":this.adapter.templateData.align==="start","gui-grid__widget--align-end":this.adapter.templateData.align==="end","gui-grid__widget--align-space-between":this.adapter.templateData.align==="space-between","gui-grid__widget--align-space-around":this.adapter.templateData.align==="space-around","gui-grid__widget--align-space-evenly":this.adapter.templateData.align==="space-evenly","gui-grid__widget--align-stretch":!this.adapter.templateData.align||this.adapter.templateData.align==="stretch","gui-grid__widget--justify-center":this.adapter.templateData.justify==="center","gui-grid__widget--justify-start":this.adapter.templateData.justify==="start","gui-grid__widget--justify-end":this.adapter.templateData.justify==="end","gui-grid__widget--justify-stretch":this.adapter.templateData.justify==="stretch"},r=[];return this.adapter.templateData.columnGap!==void 0&&r.push(`column-gap: ${this.adapter.templateData.columnGap}px`),this.adapter.templateData.rowGap!==void 0&&r.push(`row-gap: ${this.adapter.templateData.rowGap}px`),l.html`
3064
+ <div class=${T.classMap(a)} id=${this.widget?.uid} style=${r.join("; ")}>
3065
+ ${Ne.repeat(this.adapter.templateData.children||[],s=>s?.uid,s=>l.html`<div class="gui-grid__cell" style="grid-column: span ${s.size||1}">
2674
3066
  <gui-widget .widget=${s}></gui-widget>
2675
3067
  </div>`)}
2676
3068
  </div>
2677
- `}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};sr([b.consume({context:m.formContext}),n.property({attribute:!1})],fi.prototype,"formContext",2),sr([b.provide({context:m.layoutContext})],fi.prototype,"adapter",2),fi=sr([n.customElement("gui-grid-layout")],fi);const hc=Object.freeze(Object.defineProperty({__proto__:null,get GridElement(){return fi}},Symbol.toStringTag,{value:"Module"}));var mc=Object.defineProperty,cc=Object.getOwnPropertyDescriptor,yt=(e,t,i,a)=>{for(var r=a>1?void 0:a?cc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&mc(t,i,r),r};let nt=class extends l.LitElement{constructor(){super(...arguments),this.activeTab="",this.adapter=new m.LayoutWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-tabs","gui-field");const e=this.widget.props;this.adapter.context=this.formContext,this.adapter.init(this.widget),this.activeTab=e.defaultOpen??e.tabs[0].uid,this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>{this.requestUpdate()}))}firstUpdated(e){this.startObserver=ta(this.startSentinel,a=>this.isStartVisible=a),this.endObserver=ta(this.endSentinel,a=>this.isEndVisible=a);const i=this.widget.props.tabs.findIndex(a=>a.uid===this.activeTab);this.tabButtons[i].scrollIntoView({block:"nearest",inline:"nearest"})}render(){if(!this.adapter.templateData)return l.html``;const e=this.widget.children.filter(i=>i.uid===this.activeTab||this.adapter.templateData.renderMode!=="activeOnly"),t={"gui-widget":!0,"gui-widget--horizontal":!0,"gui-tabs--start-shadow":!this.isStartVisible,"gui-tabs--end-shadow":!this.isEndVisible};return l.html`<nav class=${w.classMap(t)} id=${this.widget.uid}>
3069
+ `}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Wr([f.consume({context:m.formContext}),n.property({attribute:!1})],$i.prototype,"formContext",2),Wr([f.provide({context:m.layoutContext})],$i.prototype,"adapter",2),$i=Wr([n.customElement("gui-grid-layout")],$i);const $y=Object.freeze(Object.defineProperty({__proto__:null,get GridElement(){return $i}},Symbol.toStringTag,{value:"Module"}));var ky=Object.defineProperty,Sy=Object.getOwnPropertyDescriptor,bt=(e,t,i,a)=>{for(var r=a>1?void 0:a?Sy(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&ky(t,i,r),r};let lt=class extends l.LitElement{constructor(){super(...arguments),this.activeTab="",this.adapter=new m.LayoutWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-tabs","gui-field");const e=this.widget.props;this.adapter.context=this.formContext,this.adapter.init(this.widget),this.activeTab=e.defaultOpen??e.tabs[0].uid,this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>{this.requestUpdate()}))}firstUpdated(e){this.startObserver=na(this.startSentinel,a=>this.isStartVisible=a),this.endObserver=na(this.endSentinel,a=>this.isEndVisible=a);const i=this.widget.props.tabs.findIndex(a=>a.uid===this.activeTab);this.tabButtons[i].scrollIntoView({block:"nearest",inline:"nearest"})}render(){if(!this.adapter.templateData)return l.html``;const e=this.widget.children.filter(i=>i.uid===this.activeTab||this.adapter.templateData.renderMode!=="activeOnly"),t={"gui-widget":!0,"gui-widget--horizontal":!0,"gui-tabs--start-shadow":!this.isStartVisible,"gui-tabs--end-shadow":!this.isEndVisible};return l.html`<nav class=${T.classMap(t)} id=${this.widget.uid}>
2678
3070
  <ul role="tablist">
2679
3071
  <li role="presentation" id="start-sentinel" class="gui-sentinel"></li>
2680
- ${this.adapter.templateData.tabs?qe.repeat(this.adapter.templateData.tabs,(i,a)=>l.html`
3072
+ ${this.adapter.templateData.tabs?Ne.repeat(this.adapter.templateData.tabs,(i,a)=>l.html`
2681
3073
  <li role="presentation">
2682
3074
  <button
2683
3075
  type="button"
@@ -2687,7 +3079,7 @@
2687
3079
  id=${`tab_${this.widget.uid}_${a}`}
2688
3080
  aria-controls=${`tabpanel_${this.widget.uid}_${a}`}
2689
3081
  aria-selected=${i.uid===this.activeTab?"true":"false"}
2690
- class=${w.classMap({active:i.uid===this.activeTab})}
3082
+ class=${T.classMap({active:i.uid===this.activeTab})}
2691
3083
  @click=${()=>this.onClickTab(i.uid)}
2692
3084
  @keydown=${this.onKeyDown}
2693
3085
  @focus=${r=>r.target.scrollIntoView({block:"nearest",inline:"nearest"})}
@@ -2699,17 +3091,18 @@
2699
3091
  <li role="presentation" id="end-sentinel" class="gui-sentinel gui-sentinel__end"></li>
2700
3092
  </ul>
2701
3093
  </nav>
2702
- ${qe.repeat(e,i=>i?.uid,(i,a)=>l.html`<section
3094
+ ${Ne.repeat(e,i=>i?.uid,(i,a)=>l.html`<section
2703
3095
  role="tabpanel"
3096
+ tabindex="0"
2704
3097
  data-cy=${`tabpanel_${this.widget.uid}_${a}`}
2705
3098
  id=${`tabpanel_${this.widget.uid}_${a}`}
2706
3099
  ?hidden=${i.uid!==this.activeTab&&this.adapter.templateData.renderMode!=="activeOnly"}
2707
3100
  aria-labelledby=${`tab_${this.widget.uid}_${a}`}
2708
3101
  >
2709
3102
  <gui-widget .widget=${i}></gui-widget>
2710
- </section>`)}`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe()),this.startObserver?.disconnect(),this.endObserver?.disconnect()}onClickTab(e){this.activeTab=e,this.adapter.change(e),this.requestUpdate()}onKeyDown(e){const t=this.widget.props.tabs,i=t.findIndex(s=>s.uid===this.activeTab),a=Array.from(this.tabButtons),r=window.getComputedStyle(this).direction==="rtl";switch(e.key){case"ArrowLeft":{const s=i+(r?1:-1);s>=0&&s<t.length&&(this.activeTab=t[s].uid,a[s].focus());break}case"ArrowRight":{const s=i+(r?-1:1);s>=0&&s<t.length&&(this.activeTab=t[s].uid,a[s].focus());break}case"Home":this.activeTab=t[0].uid,a[0].focus();break;case"End":this.activeTab=t[t.length-1].uid,a[t.length-1].focus();break;default:return}}};yt([n.query("#start-sentinel")],nt.prototype,"startSentinel",2),yt([n.query("#end-sentinel")],nt.prototype,"endSentinel",2),yt([n.state()],nt.prototype,"isStartVisible",2),yt([n.state()],nt.prototype,"isEndVisible",2),yt([n.queryAll('button[role="tab"]')],nt.prototype,"tabButtons",2),yt([n.property({type:String})],nt.prototype,"activeTab",2),yt([b.consume({context:m.formContext}),n.property({attribute:!1})],nt.prototype,"formContext",2),yt([b.provide({context:m.layoutContext})],nt.prototype,"adapter",2),nt=yt([n.customElement("gui-tabs-layout")],nt);const yc=Object.freeze(Object.defineProperty({__proto__:null,get TabsElement(){return nt}},Symbol.toStringTag,{value:"Module"}));var gc=Object.defineProperty,bc=Object.getOwnPropertyDescriptor,nr=(e,t,i,a)=>{for(var r=a>1?void 0:a?bc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&gc(t,i,r),r};let vi=class extends l.LitElement{constructor(){super(...arguments),this.activeSections={},this.adapter=new m.LayoutWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-accordion","gui-field");const e=this.widget.props;this.adapter.context=this.formContext,this.adapter.init(this.widget),this.activeSections=e.defaultOpen??{},this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}onClickButton(e){this.widget.props.singleOpen&&Object.keys(this.activeSections).filter(i=>i!==e).forEach(i=>{this.activeSections[i]=!1}),this.activeSections[e]=!this.activeSections[e],this.adapter.change(this.activeSections),this.requestUpdate()}getChild(e){return this.widget.children.find(t=>t.uid===e)}render(){return this.adapter.templateData?l.html`
3103
+ </section>`)}`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe()),this.startObserver?.disconnect(),this.endObserver?.disconnect()}onClickTab(e){this.activeTab=e,this.adapter.change(e),this.requestUpdate()}onKeyDown(e){const t=this.widget.props.tabs,i=t.findIndex(s=>s.uid===this.activeTab),a=Array.from(this.tabButtons),r=window.getComputedStyle(this).direction==="rtl";switch(e.key){case"ArrowLeft":{const s=i+(r?1:-1);s>=0&&s<t.length&&(this.activeTab=t[s].uid,a[s].focus());break}case"ArrowRight":{const s=i+(r?-1:1);s>=0&&s<t.length&&(this.activeTab=t[s].uid,a[s].focus());break}case"Home":this.activeTab=t[0].uid,a[0].focus();break;case"End":this.activeTab=t[t.length-1].uid,a[t.length-1].focus();break;default:return}}};bt([n.query("#start-sentinel")],lt.prototype,"startSentinel",2),bt([n.query("#end-sentinel")],lt.prototype,"endSentinel",2),bt([n.state()],lt.prototype,"isStartVisible",2),bt([n.state()],lt.prototype,"isEndVisible",2),bt([n.queryAll('button[role="tab"]')],lt.prototype,"tabButtons",2),bt([n.property({type:String})],lt.prototype,"activeTab",2),bt([f.consume({context:m.formContext}),n.property({attribute:!1})],lt.prototype,"formContext",2),bt([f.provide({context:m.layoutContext})],lt.prototype,"adapter",2),lt=bt([n.customElement("gui-tabs-layout")],lt);const Ty=Object.freeze(Object.defineProperty({__proto__:null,get TabsElement(){return lt}},Symbol.toStringTag,{value:"Module"}));var _y=Object.defineProperty,Ay=Object.getOwnPropertyDescriptor,Kr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Ay(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&_y(t,i,r),r};let ki=class extends l.LitElement{constructor(){super(...arguments),this.activeSections={},this.adapter=new m.LayoutWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-accordion","gui-field");const e=this.widget.props;this.adapter.context=this.formContext,this.adapter.init(this.widget),this.activeSections=e.defaultOpen??{},this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}onClickButton(e){this.widget.props.singleOpen&&Object.keys(this.activeSections).filter(i=>i!==e).forEach(i=>{this.activeSections[i]=!1}),this.activeSections[e]=!this.activeSections[e],this.adapter.change(this.activeSections),this.requestUpdate()}getChild(e){return this.widget.children.find(t=>t.uid===e)}render(){return this.adapter.templateData?l.html`
2711
3104
  <div class="gui-widget" id=${this.widget.uid}>
2712
- ${this.adapter.templateData.sections?qe.repeat(this.adapter.templateData.sections,e=>e.uid,e=>{const t=this.activeSections[e.uid]||this.adapter.templateData.renderMode!=="activeOnly"?l.html`<section
3105
+ ${this.adapter.templateData.sections?Ne.repeat(this.adapter.templateData.sections,e=>e.uid,e=>{const t=this.activeSections[e.uid]||this.adapter.templateData.renderMode!=="activeOnly"?l.html`<section
2713
3106
  class="gui-widget"
2714
3107
  role="region"
2715
3108
  id=${`accordion_section_${e.uid}`}
@@ -2721,7 +3114,7 @@
2721
3114
  <button
2722
3115
  type="button"
2723
3116
  tabindex="0"
2724
- class=${w.classMap({active:this.activeSections[e.uid]})}
3117
+ class=${T.classMap({active:this.activeSections[e.uid]})}
2725
3118
  id=${`accordion_button_${e.uid}`}
2726
3119
  aria-controls=${`accordion_section_${e.uid}`}
2727
3120
  aria-expanded=${this.activeSections[e.uid]?"true":"false"}
@@ -2743,7 +3136,7 @@
2743
3136
  ${t}
2744
3137
  </div>`}):l.nothing}
2745
3138
  </div>
2746
- `:l.html``}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};nr([b.consume({context:m.formContext}),n.property({attribute:!1})],vi.prototype,"formContext",2),nr([b.provide({context:m.layoutContext})],vi.prototype,"adapter",2),vi=nr([n.customElement("gui-accordion-layout")],vi);const fc=Object.freeze(Object.defineProperty({__proto__:null,get AccordionElement(){return vi}},Symbol.toStringTag,{value:"Module"}));var vc=Object.defineProperty,Dc=Object.getOwnPropertyDescriptor,or=(e,t,i,a)=>{for(var r=a>1?void 0:a?Dc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&vc(t,i,r),r};let Di=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.DisplayWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-alert","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return l.html`
3139
+ `:l.html``}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Kr([f.consume({context:m.formContext}),n.property({attribute:!1})],ki.prototype,"formContext",2),Kr([f.provide({context:m.layoutContext})],ki.prototype,"adapter",2),ki=Kr([n.customElement("gui-accordion-layout")],ki);const Cy=Object.freeze(Object.defineProperty({__proto__:null,get AccordionElement(){return ki}},Symbol.toStringTag,{value:"Module"}));var Ly=Object.defineProperty,xy=Object.getOwnPropertyDescriptor,Jr=(e,t,i,a)=>{for(var r=a>1?void 0:a?xy(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Ly(t,i,r),r};let Si=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.DisplayWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-alert","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return l.html`
2747
3140
  <div class="gui-widget" id=${this.widget.uid}>
2748
3141
  <div
2749
3142
  role="alert"
@@ -2752,13 +3145,13 @@
2752
3145
  ${this.adapter.templateData.text}
2753
3146
  </div>
2754
3147
  </div>
2755
- `}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};or([b.consume({context:m.formContext}),n.property({attribute:!1})],Di.prototype,"formContext",2),or([b.provide({context:m.displayWidgetContext})],Di.prototype,"adapter",2),Di=or([n.customElement("gui-alert-display")],Di);const wc=Object.freeze(Object.defineProperty({__proto__:null,get AlertElement(){return Di}},Symbol.toStringTag,{value:"Module"}));var $c=Object.defineProperty,kc=Object.getOwnPropertyDescriptor,lr=(e,t,i,a)=>{for(var r=a>1?void 0:a?kc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&$c(t,i,r),r};let wi=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.DisplayWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-markdown-text","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return l.html`
3148
+ `}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Jr([f.consume({context:m.formContext}),n.property({attribute:!1})],Si.prototype,"formContext",2),Jr([f.provide({context:m.displayWidgetContext})],Si.prototype,"adapter",2),Si=Jr([n.customElement("gui-alert-display")],Si);const Ey=Object.freeze(Object.defineProperty({__proto__:null,get AlertElement(){return Si}},Symbol.toStringTag,{value:"Module"}));var Py=Object.defineProperty,Oy=Object.getOwnPropertyDescriptor,Xr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Oy(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Py(t,i,r),r};let Ti=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.DisplayWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-markdown-text","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return l.html`
2756
3149
  <div class="gui-widget" id=${this.widget.uid}>
2757
3150
  <gui-markdown-text
2758
3151
  .md=${this.adapter.templateData.md}
2759
3152
  .dependencies=${this.adapter.templateData.deps}
2760
3153
  ></gui-markdown-text>
2761
3154
  </div>
2762
- `}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};lr([b.consume({context:m.formContext}),n.property({attribute:!1})],wi.prototype,"formContext",2),lr([b.provide({context:m.displayWidgetContext})],wi.prototype,"adapter",2),wi=lr([n.customElement("gui-markdown-text-display")],wi);const _c=Object.freeze(Object.defineProperty({__proto__:null,get MarkdownTextElement(){return wi}},Symbol.toStringTag,{value:"Module"}));var Tc=Object.defineProperty,Sc=Object.getOwnPropertyDescriptor,ur=(e,t,i,a)=>{for(var r=a>1?void 0:a?Sc(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&Tc(t,i,r),r};let $i=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.DisplayWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-renderer","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return l.html`
3155
+ `}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Xr([f.consume({context:m.formContext}),n.property({attribute:!1})],Ti.prototype,"formContext",2),Xr([f.provide({context:m.displayWidgetContext})],Ti.prototype,"adapter",2),Ti=Xr([n.customElement("gui-markdown-text-display")],Ti);const Iy=Object.freeze(Object.defineProperty({__proto__:null,get MarkdownTextElement(){return Ti}},Symbol.toStringTag,{value:"Module"}));var My=Object.defineProperty,Ry=Object.getOwnPropertyDescriptor,Qr=(e,t,i,a)=>{for(var r=a>1?void 0:a?Ry(t,i):t,s=e.length-1,o;s>=0;s--)(o=e[s])&&(r=(a?o(t,i,r):o(r))||r);return a&&r&&My(t,i,r),r};let _i=class extends l.LitElement{constructor(){super(...arguments),this.adapter=new m.DisplayWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}connectedCallback(){super.connectedCallback(),this.classList.add("gui-renderer","gui-field"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return l.html`
2763
3156
  <div class="gui-widget" id=${this.widget.uid}>${this.adapter.templateData.render}</div>
2764
- `}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};ur([b.consume({context:m.formContext}),n.property({attribute:!1})],$i.prototype,"formContext",2),ur([b.provide({context:m.displayWidgetContext})],$i.prototype,"adapter",2),$i=ur([n.customElement("gui-renderer-component")],$i);const Cc=Object.freeze(Object.defineProperty({__proto__:null,get RendererElement(){return $i}},Symbol.toStringTag,{value:"Module"}));X.widgetLoaders=ds,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})}));
3157
+ `}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Qr([f.consume({context:m.formContext}),n.property({attribute:!1})],_i.prototype,"formContext",2),Qr([f.provide({context:m.displayWidgetContext})],_i.prototype,"adapter",2),_i=Qr([n.customElement("gui-renderer-component")],_i);const Fy=Object.freeze(Object.defineProperty({__proto__:null,get RendererElement(){return _i}},Symbol.toStringTag,{value:"Module"}));te.widgetLoaders=rn,Object.defineProperty(te,Symbol.toStringTag,{value:"Module"})}));