@golemui/gui-lit 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/calendar-BuJgwvZx.js +254 -0
- package/{calendar.element-MubSE1bx.js → calendar.element-M5MPJmap.js} +1 -1
- package/{currency.element-BHXWcOEu.js → currency.element-CfFrAtrr.js} +20 -14
- package/{date-DTYg8sog.js → date-Bj9mI3GU.js} +106 -50
- package/date-input-cJDkNnVw.js +184 -0
- package/date-picker.element-va_-LGZD.js +312 -0
- package/date-time-calendar-BzRfkLKU.js +361 -0
- package/date-time-calendar.element-DC4NK0y1.js +93 -0
- package/date-time-input-BXxsfuyZ.js +214 -0
- package/date-time-picker.element-Dy-8cb-_.js +380 -0
- package/date-time.element-Bv4XdzMi.js +87 -0
- package/{date.element-BtVJSIRk.js → date.element-Consgsbb.js} +32 -27
- package/day-status-0-hJHrI7.js +530 -0
- package/{dropdown.element-DqzC6aXR.js → dropdown.element-WsD61Qel.js} +57 -48
- package/focus-leave.controller-2gV0pQd5.js +73 -0
- package/index.js +1209 -981
- package/index.umd.cjs +1574 -519
- package/lib/components/date-picker.element.d.ts +0 -11
- package/lib/components/date-time-calendar.element.d.ts +18 -0
- package/lib/components/date-time-picker.element.d.ts +18 -0
- package/lib/components/date-time.element.d.ts +18 -0
- package/lib/components/dropdown.element.d.ts +2 -0
- package/lib/components/range-calendar.element.d.ts +2 -1
- package/lib/components/range-date-picker.element.d.ts +0 -15
- package/lib/components/range-date-time-calendar.element.d.ts +18 -0
- package/lib/components/range-date-time-input.element.d.ts +18 -0
- package/lib/components/range-date-time-picker.element.d.ts +18 -0
- package/lib/components/range-time-input.element.d.ts +18 -0
- package/lib/components/range-time-picker.element.d.ts +18 -0
- package/lib/components/time-picker.element.d.ts +18 -0
- package/lib/components/time.element.d.ts +18 -0
- package/{list-D1oKnH89.js → list-CrLIL4by.js} +76 -61
- package/{list.element-Co3V3Cn5.js → list.element-DV82YxnJ.js} +22 -22
- package/{number.element-BhEyoOtc.js → number.element-CBr47IiY.js} +18 -16
- package/numeric-jmOOKz30.js +12 -0
- package/package.json +6 -6
- package/part-templates-Db871PS3.js +677 -0
- package/pill-ranges-DCqDmpkk.js +48 -0
- package/{pills-B66qz_KX.js → pills-Be1UrLgq.js} +4 -1
- package/popup.controller-eUDxE6jD.js +71 -0
- package/range-calendar-CKPYeSGt.js +452 -0
- package/{range-calendar.element-QTE6vGNP.js → range-calendar.element-D6KYq18B.js} +24 -20
- package/range-commit-8-MmYUyo.js +14 -0
- package/range-date-input-D--AqBMv.js +292 -0
- package/{range-date-input.element-Dj29D_OQ.js → range-date-input.element-D4nIXJbw.js} +8 -7
- package/range-date-picker.element-dhxPAAE6.js +386 -0
- package/range-date-time-calendar-yksWrR7b.js +720 -0
- package/range-date-time-calendar.element-C00aDefZ.js +95 -0
- package/range-date-time-input-B37TUoM3.js +322 -0
- package/range-date-time-input.element-DUnbv4ed.js +81 -0
- package/range-date-time-picker.element-Cbps6s_G.js +412 -0
- package/range-selection-CU3hxLJE.js +25 -0
- package/range-time-input-3lhqR1Ku.js +329 -0
- package/range-time-input.element-dU2iBdmJ.js +81 -0
- package/range-time-picker.element-v6nQsIPw.js +429 -0
- package/{select.element-jcDF1h-g.js → select.element-C0V-Bv3L.js} +94 -90
- package/{tags.element-CX3vQL8L.js → tags.element-DvwEpxpK.js} +1 -1
- package/time-input-BOhlBGJZ.js +181 -0
- package/time-list-Czo48bZm.js +217 -0
- package/time-picker-bFJ63ky8.js +261 -0
- package/time-picker.element-CYZVXgRS.js +85 -0
- package/time.element-fK3oLi49.js +82 -0
- package/abstract-calendar-BoqKPRmS.js +0 -545
- package/calendar-DTYKVYc3.js +0 -96
- package/date-input-BeQvyfln.js +0 -268
- package/date-picker.element-DabW_-0-.js +0 -166
- package/range-calendar-9skwbwlB.js +0 -255
- package/range-date-input-Uy8134vi.js +0 -395
- package/range-date-picker.element-CuKIBkIO.js +0 -182
package/index.umd.cjs
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
(function(_,_e){typeof exports=="object"&&typeof module<"u"?_e(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/repeat.js"),require("lit/directives/live.js"),require("lit-html/directives/style-map.js"),require("lit/directives/if-defined.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/repeat.js","lit/directives/live.js","lit-html/directives/style-map.js","lit/directives/if-defined.js","lit/directives/repeat.js","lit/directives/unsafe-html.js"],_e):(_=typeof globalThis<"u"?globalThis:_||self,_e(_["gui-lit"]={},_.core,null,_.lit$1,_.lit,_.decorators_js,_.context,_.rxjs,_.classMap_js,_.repeat_js,_.live_js,_.styleMap_js,_.ifDefined_js,_.repeat_js$1,_.unsafeHtml_js))})(this,(function(_,_e,Nu,h,d,o,g,Ei,$,he,Oi,We,Vt,Pi,Va){"use strict";const Ii={LAYOUTS:"LAYOUTS",DISPLAYS:"DISPLAYS"};function Ua(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 Wa=(e,t)=>({type:"ITEMS",itemType:Ii.DISPLAYS,items:[{render:e}],tags:t??[]}),St=new Map;function Ai(e,t){if(St.has(e))throw new Error(`Item type "${e}" is already registered.`);St.set(e,t)}function Et(e){const t=St.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 Li(e){return St.has(e)}function k(e){const t=l=>{if(!e.sensibleDefaults)return{};let u={...e.sensibleDefaults.base};for(const p of l){const c=p.config;for(const y of e.sensibleDefaults.fields){const f=y;c[f]!=null&&(u={...u,[f]:c[f]})}}return u},i=(l,u)=>e.sensibleDefaults?e.sensibleDefaults.apply(l,u):l,s=l=>{switch(e.entryShape){case"bare":return{baseDef:l};case"keyed":{const u=l;return{baseDef:u.def,path:u.key}}case"compound":{const u=l;return{baseDef:u.def,children:u.children}}}},a={rollUpSensibleDefaults:t,applySensibleDefaults:i,mapToWidget:e.mapToWidget,parseEntry:s,...e.afterMerge?{afterMerge:e.afterMerge}:{},...e.buildCustomWidget?{buildCustomWidget:e.buildCustomWidget}:{},...e.getChildren?{getChildren:e.getChildren}:{}};Ai(e.itemType,a);const n=Ua(e.itemType);return{gsl:n,gslByUid:(l,u)=>n(u,(p=>p.uid===l))}}function R(e){const{uid:t,path:i,label:s,disabled:a,readonly:n,defaultValue:r,tags:l,type:u,size:p,onLoad:c,onChange:y,onFilter:f,on:b,states:C,include:Se,exclude:Ba,validator:qa,...Ue}=e;return Ue}function Ga(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 W(e,t){return e.label!=null||t.suppressAutomaticLabels||!e.path?e:{...e,label:Ga(e.path)}}function Ce(e,t){return e.placeholder!=null||t.suppressAutomaticPlaceholders||!e.path?e:{...e,placeholder:e.path}}function Ha(e){switch(e.type){case"text":return Ka(e);case"number":return Xa(e);case"boolean":return Ya(e);default:throw new Error(`Unsupported field type "${e.type}"`)}}function Ya(e){const t=R(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 Ka(e){const t=R(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 Xa(e){const t=R(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")}}k({itemType:"INPUTS",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>{let i=W(e,t);return i=Ce(i,t),i}},mapToWidget:Ha}),k({itemType:"SELECT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Ce(W(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:R(e)})}),k({itemType:"DROPDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Ce(W(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:R(e)})}),k({itemType:"RADIOGROUP",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>W(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:R(e)})}),k({itemType:"CHECKBOX",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>W(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:R(e)})}),k({itemType:"TEXTAREA",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Ce(W(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:R(e)})}),k({itemType:"PASSWORD",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Ce(W(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:R(e)})}),k({itemType:"CURRENCY",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Ce(W(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:R(e)})}),k({itemType:"MARKDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Ce(W(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:R(e)})}),k({itemType:"LIST",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>W(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:R(e)})}),k({itemType:"CALENDAR",entryShape:"bare",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>W(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:R(e)})}),k({itemType:"DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>W(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:R(e)})}),k({itemType:"DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Ce(W(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:R(e)})}),k({itemType:"RANGE_CALENDAR",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>W(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:R(e)})}),k({itemType:"RANGE_DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>W(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:R(e)})}),k({itemType:"RANGE_DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Ce(W(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:R(e)})});function Ja(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 Qa(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:{...Ja(e),template:{kind:"layout",type:"flex",children:[],props:{direction:"column"}}}}}function Ut(e,t){for(const i of e){if(typeof i=="function")continue;const s=i;typeof s.path=="string"&&s.path&&!s.path.startsWith(t)&&(s.path=t+s.path),"children"in s&&Array.isArray(s.children)&&Ut(s.children,t);const a=s.props;a?.template?.children&&Array.isArray(a.template.children)&&Ut(a.template.children,t)}}function ja(e,t){const i=t.walkChildren(t.children??[]),s=e.kind==="static"?e.def.path??"":e.fn({})?.path??"";s&&Ut(i,s+".items.");const a={kind:"layout",type:"flex",uid:"",children:i,props:{direction:"column"}};if(e.kind==="static"){const r=t.mapStaticDef(e.def,"REPEATER");return{...r,props:{...r.props,template:a}}}const n=e.fn;return(r=>{const l=n(r),u=t.mapStaticDef(l,"REPEATER");return{...u,props:{...u.props,template:a}}})}function es(e){return{baseDef:e.def,path:e.key,children:e.children}}function ts(e){return e.children}Ai("REPEATER",{parseEntry:es,rollUpSensibleDefaults:()=>({}),applySensibleDefaults:e=>e,mapToWidget:Qa,buildCustomWidget:ja,getChildren:ts});const Ti={onLoad:"load",onChange:"change",onFilter:"filter",onBlur:"blur"},is=Object.keys(Ti);function Mi(e){if(e.length>0)return null;try{const t=e();return typeof t=="string"?t:null}catch{return null}}class as{extractOnClickFromMergeResult(t,i,s){if(t.kind==="dynamic"){const r=t.fn;return{kind:"dynamic",fn:u=>{const p=r(u);return this.wireOnClick(p,i,s)}}}const a=t.def;return{kind:"static",def:this.wireOnClick(a,i,s)}}wireOnClick(t,i,s){const a=s.next(),n=t.onClick;if(typeof n=="function"){const{onClick:r,...l}=t,u=n(void 0);return typeof u=="string"?{...l,uid:a,on:{click:u}}:(i.set(a,p=>n(p.data)),{...l,uid:a,on:{click:a}})}return{...t,uid:a}}wireInputLayoutEvents(t,i,s){if(t.kind==="dynamic"){const n=t.fn;return{kind:"dynamic",fn:l=>{const u=n(l);return this.wireEventProperties(u,i,s)}}}return{kind:"static",def:this.wireEventProperties(t.def,i,s)}}wireEventProperties(t,i,s){const a={...t.on||{}};let n=!1;const r={...t};for(const l of is){const u=t[l];if(u==null)continue;const p=Ti[l];if(typeof u=="function"){const c=Mi(u);if(c!=null)a[p]=c;else{const y=s.next();i.set(y,u),a[p]=y}n=!0}else typeof u=="string"&&(a[p]=u,n=!0);delete r[l]}return n&&(r.on=a),r}}const Wt=new as;function ss(e){const{uid:t,label:i,actionType:s,disabled:a,on:n,onClick:r,data:l,type:u,tags:p,size:c,include:y,exclude:f,states:b,...C}=e;return{uid:t??"",kind:"action",type:"button",disabled:a,actionType:s,label:i,...n!=null?{on:n}:{},props:C}}k({itemType:"ACTIONS",entryShape:"bare",mapToWidget:ss,afterMerge:(e,t)=>Wt.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)});function ns(e){const{uid:t,widgetName:i,tags:s,size:a,onChange:n,include:r,exclude:l,...u}=e,{on:p,...c}=u;return{uid:t??"",kind:"layout",type:i??"flex",props:{direction:c.direction??"column",...c},children:[]}}function rs(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"LAYOUTS"),children:i};const s=e.fn;return(a=>{const n=s(a);return{...t.mapStaticDef(n,"LAYOUTS"),children:i}})}function os(e){return e.children}k({itemType:"LAYOUTS",entryShape:"compound",mapToWidget:ns,buildCustomWidget:rs,getChildren:os});function Ri(e){return{errors:void 0,touched:void 0,translate:void 0,...e??{},$form:e?.$form??{}}}function ls(e){return{uid:"",kind:"display",type:"renderer",props:{render:e.render}}}function ds(e,t){if(e.kind==="static"){const s=e.def;return(a=>({uid:"",kind:"display",type:"renderer",...s.include!=null?{include:s.include}:{},...s.exclude!=null?{exclude:s.exclude}:{},props:{render:s.render(Ri(a))}}))}const i=e.fn;return(s=>{const a=i(s);return{uid:"",kind:"display",type:"renderer",...a.include!=null?{include:a.include}:{},...a.exclude!=null?{exclude:a.exclude}:{},props:{render:a.render(Ri(s))}}})}k({itemType:"DISPLAYS",entryShape:"bare",mapToWidget:ls,buildCustomWidget:ds}),k({itemType:"ALERTS",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"alert",props:{text:e.text,...e.level!=null?{level:e.level}:{}}})}),k({itemType:"MARKDOWN_TEXTS",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"markdownText",props:{md:e.md}})});function us(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 ps(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"TABS"),children:i};const s=e.fn;return(a=>{const n=s(a);return{...t.mapStaticDef(n,"TABS"),children:i}})}function cs(e){return e.children}k({itemType:"TABS",entryShape:"compound",mapToWidget:us,buildCustomWidget:ps,getChildren:cs});function hs(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 ms(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"ACCORDION"),children:i};const s=e.fn;return(a=>{const n=s(a);return{...t.mapStaticDef(n,"ACCORDION"),children:i}})}function ys(e){return e.children}k({itemType:"ACCORDION",entryShape:"compound",mapToWidget:hs,buildCustomWidget:ms,getChildren:ys}),k({itemType:"CUSTOM_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>W(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??{}})}),k({itemType:"CUSTOM_ACTION",entryShape:"bare",mapToWidget:e=>{const{uid:t,label:i,disabled:s,on:a,onClick:n,data:r,customType:l,tags:u,size:p,include:c,exclude:y,states:f,props:b,...C}=e;return{uid:t??"",kind:"action",type:e.customType,label:i,disabled:s,...a!=null?{on:a}:{},props:{...b,...C}}},afterMerge:(e,t)=>Wt.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)}),k({itemType:"CUSTOM_DISPLAY",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:e.customType,props:e.props??{}})});function fs(e){return{uid:e.uid??"",kind:"layout",type:e.customType,props:e.props??{},children:[]}}function gs(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"CUSTOM_LAYOUT"),children:i};const s=e.fn;return(a=>{const n=s(a);return{...t.mapStaticDef(n,"CUSTOM_LAYOUT"),children:i}})}function bs(e){return e.children}k({itemType:"CUSTOM_LAYOUT",entryShape:"compound",mapToWidget:fs,buildCustomWidget:gs,getChildren:bs}),k({itemType:"TAGS",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Ce(W(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:R(e)})});const Fi={INPUTS:new Set(["INPUTS","TEXTAREA","PASSWORD","SELECT","DROPDOWN","RADIOGROUP","CHECKBOX","CALENDAR","DATE_INPUT","DATE_PICKER","RANGE_CALENDAR","RANGE_DATE_INPUT","RANGE_DATE_PICKER","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 Ds(e,t){const i=Fi[e];return i?i.has(t):e===t}class vs{resolve(t,i){const s=[];for(const n of i)n.kind==="aggregated"?this.collectFromAggregated(n,t,s):this.collectFromLeaf(n,t,s);const a=this.rollUpSensibleDefaults(s);return{leafSelectors:s,sensibleDefaults:a}}collectFromAggregated(t,i,s){if(t.matcher(i))for(const a of t.children)this.collectFromLeaf(a,i,s)}collectFromLeaf(t,i,s){Ds(t.selectorType,i.itemType??"")&&t.matcher(i)&&s.push(t)}rollUpSensibleDefaults(t){const i=new Map,s=(n,r)=>{const l=i.get(n)??[];l.push(r),i.set(n,l)};for(const n of t){const r=Fi[n.selectorType];if(r)for(const l of r)s(l,n);else s(n.selectorType,n)}const a={};for(const[n,r]of i)Li(n)&&(a[n]=Et(n).rollUpSensibleDefaults(r));return a}}const ws=new vs;class $s{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 s={...t};for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&(typeof i[a]=="object"&&!Array.isArray(i[a])&&i[a]!==null&&typeof t[a]=="object"&&!Array.isArray(t[a])&&t[a]!==null?s[a]=this.deepMerge(t[a],i[a]):s[a]=i[a]);return s}}const ks=new $s;class _s{constructor(t){this.objectUtils=t}merge(t,i,s){let a={},n=null;typeof t=="function"&&(n=t);const r=this.collectDecorators(s);for(const p of r){if(n!=null){n=this.composeRuntimeFunctions(n,p);continue}if(typeof p=="function"){const c=p({...a,...typeof t=="function"?{}:t});if(typeof c=="function"){n=this.createPromotedFunction(a,t,c,i,s);continue}a=this.objectUtils.deepMerge(a,c)}else a=this.objectUtils.deepMerge(a,p)}if(n!=null)return{kind:"dynamic",fn:this.wrapWithSensibleDefaults(n,a,i,s)};const l=this.objectUtils.deepMerge(t,a);return{kind:"static",def:this.applySensibleDefaults({...l},i,s)}}collectDecorators(t){const i=[];for(const s of t.leafSelectors){const a=s.config;a.override!=null&&i.push(a.override)}return i}applySensibleDefaults(t,i,s){if(!Li(i))return t;const a=s.sensibleDefaults[i]??{};return Et(i).applySensibleDefaults(t,a)}createPromotedFunction(t,i,s,a,n){return r=>{const l=s(r);let u=this.objectUtils.deepMerge(t,l);return u=this.objectUtils.deepMerge(u,i),this.applySensibleDefaults(u,a,n)}}wrapWithSensibleDefaults(t,i,s,a){return n=>{let r=t(n);return Object.keys(i).length>0&&(r=this.objectUtils.deepMerge(i,r)),this.applySensibleDefaults(r,s,a)}}composeRuntimeFunctions(t,i){return typeof i=="function"?s=>{const a=t(s),n=i(a);return typeof n=="function"?n(s):this.objectUtils.deepMerge(n,a)}:s=>{const a=t(s);return this.objectUtils.deepMerge(a,i)}}}const Cs=new _s(ks);class xs{mapToWidget(t,i){if(t.kind==="dynamic"){const s=t.fn;return(a=>{const n=s(a);return this.mapStaticDef(n,i)})}return this.mapStaticDef(t.def,i)}mapStaticDef(t,i){const s=Et(i).mapToWidget(t);return this.applyBaseWidgetFields(s,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=new xs;class Es{normalizeSelectors(t){const i=Array.isArray(t)?t:[t],s=[],a=[];for(const n of i)n.kind==="leaf"?a.push(n):s.push(n);return a.length>0&&s.unshift({kind:"aggregated",matcher:()=>!0,children:a}),s}extractFormConfig(){return{suppressAutomaticStack:!1}}}const Os=new Es,Ps={input:new Set(["disabled","readonly","label","validator","size"]),action:new Set(["disabled","label","size"]),layout:new Set(["size"]),display:new Set([])},zi={onChange:"change",onLoad:"load",onFilter:"filter",onClick:"click"};class Is{extractFromMergeResult(t,i){const s={};for(const l of i){const u=l.targetState,p=l.config,c=p.override&&typeof p.override!="function"?p.override:p;s[u]={...s[u]||{},...c}}if(t.kind==="dynamic"){const l=t.fn;return{cleanedResult:{kind:"dynamic",fn:p=>{const c=l(p),{states:y,...f}=c;return f}},stateData:{stateOverrides:s}}}const{states:a,...n}=t.def,r={};for(const[l,u]of Object.entries(s))r[l]={...u};if(a)for(const[l,u]of Object.entries(a))r[l]={...r[l]||{},...u};return{cleanedResult:{kind:"static",def:n},stateData:{stateOverrides:r}}}applyToWidget(t,i,s,a){const{stateOverrides:n}=i;if(Object.keys(n).length===0)return t;const r={...t},l=t.kind,u=Ps[l]||new Set;t.props&&(r.props={...t.props}),t.on&&(r.on={...t.on});for(const[p,c]of Object.entries(n))for(const[y,f]of Object.entries(c))y==="visible"?this.applyVisibility(r,p,f):zi[y]?this.applyStateEvent(r,p,y,f,s,a):u.has(y)?r[`${y}.${p}`]=f:(r.props||(r.props={}),r.props[`${y}.${p}`]=f);return r}hasStateData(t){return Object.keys(t.stateOverrides).length>0}applyVisibility(t,i,s){if(s){const a=t.include?.in||[];t.include={...t.include||{},in:[...a,i]}}else{const a=t.exclude?.from||[];t.exclude={...t.exclude||{},from:[...a,i]}}}applyStateEvent(t,i,s,a,n,r){const l=zi[s];if(t.on||(t.on={}),typeof a=="function"){const u=Mi(a);if(u!=null)t.on[`${l}.${i}`]=u;else{const p=r.next();n.set(p,a),t.on[`${l}.${i}`]=p}}else typeof a=="string"&&(t.on[`${l}.${i}`]=a)}}const As=new Is;function Ls(){let e=0;return{next:()=>`event_${e++}`}}class Ts{constructor(t,i,s,a,n){this.resolver=t,this.merger=i,this.mapper=s,this.eventWiring=a,this.stateExpansion=n}walkAndMap(t,i,s){const a=new Map,n=Ls(),r={value:0},l=new Set;return{widgets:this.walkItems(t,i,a,s,n,r,l),eventRegistry:a}}walkItems(t,i,s,a,n,r,l){return t.flatMap(u=>{if(u.type!=="ITEMS")throw new Error("Unexpected gui shortcut type");return u.items.map(p=>this.processItem(p,u.itemType,u.tags,i,s,a,n,r,l))})}processItem(t,i,s,a,n,r,l,u,p){const c=i,y=Et(i),f=y.parseEntry(t),b=this.buildBaseDef(f),C=this.buildDecoratorForMatching(b,c,s),Se=this.resolver.resolve(C,a),Ba=Se.leafSelectors.filter(re=>re.targetState!=null),qa={leafSelectors:Se.leafSelectors.filter(re=>re.targetState==null),sensibleDefaults:Se.sensibleDefaults};let Ue=this.merger.merge(b,c,qa);y.afterMerge&&(Ue=y.afterMerge(Ue,{eventRegistry:n,formConfig:r,eventIdGenerator:l})),Ue=this.eventWiring.wireInputLayoutEvents(Ue,n,l);const{cleanedResult:Za,stateData:Si}=this.stateExpansion.extractFromMergeResult(Ue,Ba);let Ee;if(y.buildCustomWidget){const re=this.buildCustomWidgetContext(f.children,a,n,r,l,u,p);Ee=this.buildCustomWidget(y,Za,re)}else Ee=this.mapper.mapToWidget(Za,c);if(typeof Ee!="function"){const re=Ee;re.uid||(re.path&&!p.has(re.path)?(re.uid=re.path,p.add(re.path)):re.uid=`dx_${u.value++}`)}if(this.stateExpansion.hasStateData(Si))if(typeof Ee=="function"){const re=Ee;Ee=(Fu=>{const zu=re(Fu);return this.stateExpansion.applyToWidget(zu,Si,n,l)})}else Ee=this.stateExpansion.applyToWidget(Ee,Si,n,l);return Ee}buildCustomWidgetContext(t,i,s,a,n,r,l){return{children:t,mapStaticDef:(u,p)=>this.mapper.mapStaticDef(u,p),walkChildren:u=>this.walkItems(u,i,s,a,n,r,l)}}buildCustomWidget(t,i,s){return t.buildCustomWidget(i,s)}buildBaseDef(t){const i=t.baseDef;return typeof i=="function"?s=>{const n=i(s??{});return t.path!=null?{...n,path:t.path}:n}:t.path!=null?{...i,path:t.path}:i}buildDecoratorForMatching(t,i,s){if(typeof t=="function")return{itemType:i,tags:[...s]};const a=[...s,..."tags"in t&&t.tags?t.tags:[]],n="uid"in t?t.uid:void 0,r="type"in t?t.type:void 0;return{itemType:i,tags:a,uid:n,type:r}}}class Ms{constructor(t,i){this.selectorNormalizer=t,this.walker=i}processDxFacade(t,i=[],s){const{defs:a,gslSelectors:n,formConfig:r}=this.prepareForm(t,i,s),{widgets:l,eventRegistry:u}=this.walker.walkAndMap(a,n,r),p=l[0];return this.buildResult({form:p},u,r)}prepareForm(t,i,s){const n=(Array.isArray(t)?[...t]:[t]).map(u=>typeof u=="function"?Wa(u):u),r=this.selectorNormalizer.normalizeSelectors(i),l={...this.selectorNormalizer.extractFormConfig(),...s};if(!l.suppressAutomaticStack){const u={def:{uid:"#root",direction:"column",widgetName:"flex"},children:n};return{defs:[{type:"ITEMS",itemType:Ii.LAYOUTS,items:[u],tags:[]}],gslSelectors:r,formConfig:l}}return{defs:n,gslSelectors:r,formConfig:l}}convertStateNames(t){const i={};for(const[s,a]of Object.entries(t))i[s.replace(/\$/g,":")]=a;return i}buildResult(t,i,s){s.states&&Object.keys(s.states).length>0&&(t={...t,states:this.convertStateNames(s.states)});const a={form:t};return i.size>0&&(a.events=n=>{const r=i.get(n.name);if(r){const l=p=>{if(p&&typeof p=="object"&&"path"in p&&!("type"in p)){const{path:c,...y}=p;for(const[f,b]of Object.entries(y))n.callback({type:"OVERRIDE_WIDGET_PROP",payload:{path:c,prop:f,value:b}})}else n.callback(p)},u={...n,callback:l,update:l};r(u)}}),s.dependencies&&(a.dependencies=s.dependencies),s.widgetLoaders&&(a.widgetLoaders=s.widgetLoaders),s.validateOn&&(a.validateOn=s.validateOn),s.itemRenderers&&(a.itemRenderers=s.itemRenderers),a}}const Rs=new Ts(ws,Cs,Ss,Wt,As),Fs=new Ms(Os,Rs);function Ni(e){return typeof e=="function"?!0:Array.isArray(e)?e.length===0||e.every(Bi):Bi(e)}function Bi(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 zs(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e.form;if(Ni(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 qi=Object.freeze({}),Ns=Object.freeze({}),Zi=new WeakMap;function Gt(e,t){return e==null?t:typeof e=="object"?e:{}}function Bs(e,t,i){if(!Ni(e))return zs(e),{formDef:e};const s=Gt(e,qi),a=Gt(t,qi),n=Gt(i,Ns);let r=Zi.get(s);r||(r=new WeakMap,Zi.set(s,r));let l=r.get(a);l||(l=new WeakMap,r.set(a,l));const u=l.get(n);if(u)return u;const p=Fs.processDxFacade(e,t,i),c={formDef:p.form,formEvent:p.events,dependencies:p.dependencies,widgetLoaders:p.widgetLoaders,validateOn:p.validateOn,itemRenderers:p.itemRenderers};return l.set(n,c),c}function m(e,t,i){function s(l,u){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:u,constr:r,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,u);const p=r.prototype,c=Object.keys(p);for(let y=0;y<c.length;y++){const f=c[y];f in l||(l[f]=p[f].bind(l))}}const a=i?.Parent??Object;class n extends a{}Object.defineProperty(n,"name",{value:e});function r(l){var u;const p=i?.Parent?new n:this;s(p,l),(u=p._zod).deferred??(u.deferred=[]);for(const c of p._zod.deferred)c();return p}return Object.defineProperty(r,"init",{value:s}),Object.defineProperty(r,Symbol.hasInstance,{value:l=>i?.Parent&&l instanceof i.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(r,"name",{value:e}),r}class Ge extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Vi extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const qs={};function Re(e){return qs}function Ht(e,t){return typeof t=="bigint"?t.toString():t}function Yt(e){return e==null}function Kt(e){const t=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(t,i)}const Ui=Symbol("evaluating");function x(e,t,i){let s;Object.defineProperty(e,t,{get(){if(s!==Ui)return s===void 0&&(s=Ui,s=i()),s},set(a){Object.defineProperty(e,t,{value:a})},configurable:!0})}function Zs(...e){const t={};for(const i of e){const s=Object.getOwnPropertyDescriptors(i);Object.assign(t,s)}return Object.defineProperties({},t)}function Vs(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Wi="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Gi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Xt(e){if(Gi(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const i=t.prototype;return!(Gi(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function Hi(e){return Xt(e)?{...e}:Array.isArray(e)?[...e]:e}function Jt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Yi(e,t,i){const s=new e._zod.constr(t??e._zod.def);return(!t||i?.parent)&&(s._zod.parent=e),s}function v(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 Us={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 He(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 Ws(e,t){return t.map(i=>{var s;return(s=i).path??(s.path=[]),i.path.unshift(e),i})}function Ot(e){return typeof e=="string"?e:e?.message}function Fe(e,t,i){const s={...e,path:e.path??[]};if(!e.message){const a=Ot(e.inst?._zod.def?.error?.(e))??Ot(t?.error?.(e))??Ot(i.customError?.(e))??Ot(i.localeError?.(e))??"Invalid input";s.message=a}return delete s.inst,delete s.continue,t?.reportInput||delete s.input,s}function Qt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function je(...e){const[t,i,s]=e;return typeof t=="string"?{message:t,code:"custom",input:i,inst:s}:{...t}}const Ki=(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,Ht,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Xi=m("$ZodError",Ki),Pt=m("$ZodError",Ki,{Parent:Error});function Gs(e,t=i=>i.message){const i={},s=[];for(const a of e.issues)a.path.length>0?(i[a.path[0]]=i[a.path[0]]||[],i[a.path[0]].push(t(a))):s.push(t(a));return{formErrors:s,fieldErrors:i}}function Hs(e,t=i=>i.message){const i={_errors:[]},s=a=>{for(const n of a.issues)if(n.code==="invalid_union"&&n.errors.length)n.errors.map(r=>s({issues:r}));else if(n.code==="invalid_key")s({issues:n.issues});else if(n.code==="invalid_element")s({issues:n.issues});else if(n.path.length===0)i._errors.push(t(n));else{let r=i,l=0;for(;l<n.path.length;){const u=n.path[l];l===n.path.length-1?(r[u]=r[u]||{_errors:[]},r[u]._errors.push(t(n))):r[u]=r[u]||{_errors:[]},r=r[u],l++}}};return s(e),i}const It=e=>(t,i,s,a)=>{const n=s?Object.assign(s,{async:!1}):{async:!1},r=t._zod.run({value:i,issues:[]},n);if(r instanceof Promise)throw new Ge;if(r.issues.length){const l=new(a?.Err??e)(r.issues.map(u=>Fe(u,n,Re())));throw Wi(l,a?.callee),l}return r.value},Ys=It(Pt),At=e=>async(t,i,s,a)=>{const n=s?Object.assign(s,{async:!0}):{async:!0};let r=t._zod.run({value:i,issues:[]},n);if(r instanceof Promise&&(r=await r),r.issues.length){const l=new(a?.Err??e)(r.issues.map(u=>Fe(u,n,Re())));throw Wi(l,a?.callee),l}return r.value},Ks=At(Pt),Lt=e=>(t,i,s)=>{const a=s?{...s,async:!1}:{async:!1},n=t._zod.run({value:i,issues:[]},a);if(n instanceof Promise)throw new Ge;return n.issues.length?{success:!1,error:new(e??Xi)(n.issues.map(r=>Fe(r,a,Re())))}:{success:!0,data:n.value}},Ji=Lt(Pt),Tt=e=>async(t,i,s)=>{const a=s?Object.assign(s,{async:!0}):{async:!0};let n=t._zod.run({value:i,issues:[]},a);return n instanceof Promise&&(n=await n),n.issues.length?{success:!1,error:new e(n.issues.map(r=>Fe(r,a,Re())))}:{success:!0,data:n.value}},Qi=Tt(Pt),Xs=e=>(t,i,s)=>{const a=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return It(e)(t,i,a)},Js=e=>(t,i,s)=>It(e)(t,i,s),Qs=e=>async(t,i,s)=>{const a=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return At(e)(t,i,a)},js=e=>async(t,i,s)=>At(e)(t,i,s),en=e=>(t,i,s)=>{const a=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Lt(e)(t,i,a)},tn=e=>(t,i,s)=>Lt(e)(t,i,s),an=e=>async(t,i,s)=>{const a=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Tt(e)(t,i,a)},sn=e=>async(t,i,s)=>Tt(e)(t,i,s),nn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ji=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)$/,rn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,on=/^(?:(?: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])$/,ln=/^(([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}|:))$/,dn=/^(?=.{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])?)*\.?$/,ea="(?:(?:\\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])))",un=new RegExp(`^${ea}$`);function ta(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 pn(e){return new RegExp(`^${ta(e)}$`)}function cn(e){const t=ta({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const s=`${t}(?:${i.join("|")})`;return new RegExp(`^${ea}T(?:${s})$`)}const hn=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},mn=/^-?\d+$/,yn=/^-?\d+(?:\.\d+)?/,fn=/^(?:true|false)$/i,gn=/^[^A-Z]*$/,bn=/^[^a-z]*$/,me=m("$ZodCheck",(e,t)=>{var i;e._zod??(e._zod={}),e._zod.def=t,(i=e._zod).onattach??(i.onattach=[])}),ia={number:"number",bigint:"bigint",object:"date"},Dn=m("$ZodCheckLessThan",(e,t)=>{me.init(e,t);const i=ia[typeof t.value];e._zod.onattach.push(s=>{const a=s._zod.bag,n=(t.inclusive?a.maximum:a.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<n&&(t.inclusive?a.maximum=t.value:a.exclusiveMaximum=t.value)}),e._zod.check=s=>{(t.inclusive?s.value<=t.value:s.value<t.value)||s.issues.push({origin:i,code:"too_big",maximum:t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),vn=m("$ZodCheckGreaterThan",(e,t)=>{me.init(e,t);const i=ia[typeof t.value];e._zod.onattach.push(s=>{const a=s._zod.bag,n=(t.inclusive?a.minimum:a.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>n&&(t.inclusive?a.minimum=t.value:a.exclusiveMinimum=t.value)}),e._zod.check=s=>{(t.inclusive?s.value>=t.value:s.value>t.value)||s.issues.push({origin:i,code:"too_small",minimum:t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),wn=m("$ZodCheckNumberFormat",(e,t)=>{me.init(e,t),t.format=t.format||"float64";const i=t.format?.includes("int"),s=i?"int":"number",[a,n]=Us[t.format];e._zod.onattach.push(r=>{const l=r._zod.bag;l.format=t.format,l.minimum=a,l.maximum=n,i&&(l.pattern=mn)}),e._zod.check=r=>{const l=r.value;if(i){if(!Number.isInteger(l)){r.issues.push({expected:s,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?r.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,continue:!t.abort}):r.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,continue:!t.abort});return}}l<a&&r.issues.push({origin:"number",input:l,code:"too_small",minimum:a,inclusive:!0,inst:e,continue:!t.abort}),l>n&&r.issues.push({origin:"number",input:l,code:"too_big",maximum:n,inst:e})}}),$n=m("$ZodCheckMaxLength",(e,t)=>{var i;me.init(e,t),(i=e._zod.def).when??(i.when=s=>{const a=s.value;return!Yt(a)&&a.length!==void 0}),e._zod.onattach.push(s=>{const a=s._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<a&&(s._zod.bag.maximum=t.maximum)}),e._zod.check=s=>{const a=s.value;if(a.length<=t.maximum)return;const r=Qt(a);s.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),kn=m("$ZodCheckMinLength",(e,t)=>{var i;me.init(e,t),(i=e._zod.def).when??(i.when=s=>{const a=s.value;return!Yt(a)&&a.length!==void 0}),e._zod.onattach.push(s=>{const a=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>a&&(s._zod.bag.minimum=t.minimum)}),e._zod.check=s=>{const a=s.value;if(a.length>=t.minimum)return;const r=Qt(a);s.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),_n=m("$ZodCheckLengthEquals",(e,t)=>{var i;me.init(e,t),(i=e._zod.def).when??(i.when=s=>{const a=s.value;return!Yt(a)&&a.length!==void 0}),e._zod.onattach.push(s=>{const a=s._zod.bag;a.minimum=t.length,a.maximum=t.length,a.length=t.length}),e._zod.check=s=>{const a=s.value,n=a.length;if(n===t.length)return;const r=Qt(a),l=n>t.length;s.issues.push({origin:r,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:s.value,inst:e,continue:!t.abort})}}),Mt=m("$ZodCheckStringFormat",(e,t)=>{var i,s;me.init(e,t),e._zod.onattach.push(a=>{const n=a._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(i=e._zod).check??(i.check=a=>{t.pattern.lastIndex=0,!t.pattern.test(a.value)&&a.issues.push({origin:"string",code:"invalid_format",format:t.format,input:a.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(s=e._zod).check??(s.check=()=>{})}),Cn=m("$ZodCheckRegex",(e,t)=>{Mt.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})}}),xn=m("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=gn),Mt.init(e,t)}),Sn=m("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=bn),Mt.init(e,t)}),En=m("$ZodCheckIncludes",(e,t)=>{me.init(e,t);const i=Jt(t.includes),s=new RegExp(typeof t.position=="number"?`^.{${t.position}}${i}`:i);t.pattern=s,e._zod.onattach.push(a=>{const n=a._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(s)}),e._zod.check=a=>{a.value.includes(t.includes,t.position)||a.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:a.value,inst:e,continue:!t.abort})}}),On=m("$ZodCheckStartsWith",(e,t)=>{me.init(e,t);const i=new RegExp(`^${Jt(t.prefix)}.*`);t.pattern??(t.pattern=i),e._zod.onattach.push(s=>{const a=s._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(i)}),e._zod.check=s=>{s.value.startsWith(t.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:s.value,inst:e,continue:!t.abort})}}),Pn=m("$ZodCheckEndsWith",(e,t)=>{me.init(e,t);const i=new RegExp(`.*${Jt(t.suffix)}$`);t.pattern??(t.pattern=i),e._zod.onattach.push(s=>{const a=s._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(i)}),e._zod.check=s=>{s.value.endsWith(t.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:s.value,inst:e,continue:!t.abort})}}),In=m("$ZodCheckOverwrite",(e,t)=>{me.init(e,t),e._zod.check=i=>{i.value=t.tx(i.value)}}),An={major:4,minor:1,patch:13},F=m("$ZodType",(e,t)=>{var i;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=An;const s=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&s.unshift(e);for(const a of s)for(const n of a._zod.onattach)n(e);if(s.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const a=(r,l,u)=>{let p=He(r),c;for(const y of l){if(y._zod.def.when){if(!y._zod.def.when(r))continue}else if(p)continue;const f=r.issues.length,b=y._zod.check(r);if(b instanceof Promise&&u?.async===!1)throw new Ge;if(c||b instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await b,r.issues.length!==f&&(p||(p=He(r,f)))});else{if(r.issues.length===f)continue;p||(p=He(r,f))}}return c?c.then(()=>r):r},n=(r,l,u)=>{if(He(r))return r.aborted=!0,r;const p=a(l,s,u);if(p instanceof Promise){if(u.async===!1)throw new Ge;return p.then(c=>e._zod.parse(c,u))}return e._zod.parse(p,u)};e._zod.run=(r,l)=>{if(l.skipChecks)return e._zod.parse(r,l);if(l.direction==="backward"){const p=e._zod.parse({value:r.value,issues:[]},{...l,skipChecks:!0});return p instanceof Promise?p.then(c=>n(c,r,l)):n(p,r,l)}const u=e._zod.parse(r,l);if(u instanceof Promise){if(l.async===!1)throw new Ge;return u.then(p=>a(p,s,l))}return a(u,s,l)}}e["~standard"]={validate:a=>{try{const n=Ji(e,a);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Qi(e,a).then(r=>r.success?{value:r.data}:{issues:r.error?.issues})}},vendor:"zod",version:1}}),jt=m("$ZodString",(e,t)=>{F.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??hn(e._zod.bag),e._zod.parse=(i,s)=>{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}}),fe=m("$ZodStringFormat",(e,t)=>{Mt.init(e,t),jt.init(e,t)}),Ln=m("$ZodUUID",(e,t)=>{if(t.version){const s={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(s===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ji(s))}else t.pattern??(t.pattern=ji());fe.init(e,t)}),Tn=m("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=rn),fe.init(e,t)}),Mn=m("$ZodURL",(e,t)=>{fe.init(e,t),e._zod.check=i=>{try{const s=i.value.trim(),a=new URL(s);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.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(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.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=a.href:i.value=s;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!t.abort})}}}),Rn=m("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=cn(t)),fe.init(e,t)}),Fn=m("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=un),fe.init(e,t)}),zn=m("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=pn(t)),fe.init(e,t)}),Nn=m("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=nn),fe.init(e,t)}),Bn=m("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=on),fe.init(e,t),e._zod.bag.format="ipv4"}),qn=m("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ln),fe.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})}}}),Zn=m("$ZodCustomStringFormat",(e,t)=>{fe.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})}}),aa=m("$ZodNumber",(e,t)=>{F.init(e,t),e._zod.pattern=e._zod.bag.pattern??yn,e._zod.parse=(i,s)=>{if(t.coerce)try{i.value=Number(i.value)}catch{}const a=i.value;if(typeof a=="number"&&!Number.isNaN(a)&&Number.isFinite(a))return i;const n=typeof a=="number"?Number.isNaN(a)?"NaN":Number.isFinite(a)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:a,inst:e,...n?{received:n}:{}}),i}}),Vn=m("$ZodNumberFormat",(e,t)=>{wn.init(e,t),aa.init(e,t)}),Un=m("$ZodBoolean",(e,t)=>{F.init(e,t),e._zod.pattern=fn,e._zod.parse=(i,s)=>{if(t.coerce)try{i.value=!!i.value}catch{}const a=i.value;return typeof a=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:a,inst:e}),i}}),Wn=m("$ZodAny",(e,t)=>{F.init(e,t),e._zod.parse=i=>i});function sa(e,t,i){e.issues.length&&t.issues.push(...Ws(i,e.issues)),t.value[i]=e.value}const na=m("$ZodArray",(e,t)=>{F.init(e,t),e._zod.parse=(i,s)=>{const a=i.value;if(!Array.isArray(a))return i.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),i;i.value=Array(a.length);const n=[];for(let r=0;r<a.length;r++){const l=a[r],u=t.element._zod.run({value:l,issues:[]},s);u instanceof Promise?n.push(u.then(p=>sa(p,i,r))):sa(u,i,r)}return n.length?Promise.all(n).then(()=>i):i}});function ra(e,t,i,s){for(const n of e)if(n.issues.length===0)return t.value=n.value,t;const a=e.filter(n=>!He(n));return a.length===1?(t.value=a[0].value,a[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:i,errors:e.map(n=>n.issues.map(r=>Fe(r,s,Re())))}),t)}const Gn=m("$ZodUnion",(e,t)=>{F.init(e,t),x(e._zod,"optin",()=>t.options.some(a=>a._zod.optin==="optional")?"optional":void 0),x(e._zod,"optout",()=>t.options.some(a=>a._zod.optout==="optional")?"optional":void 0),x(e._zod,"values",()=>{if(t.options.every(a=>a._zod.values))return new Set(t.options.flatMap(a=>Array.from(a._zod.values)))}),x(e._zod,"pattern",()=>{if(t.options.every(a=>a._zod.pattern)){const a=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${a.map(n=>Kt(n.source)).join("|")})$`)}});const i=t.options.length===1,s=t.options[0]._zod.run;e._zod.parse=(a,n)=>{if(i)return s(a,n);let r=!1;const l=[];for(const u of t.options){const p=u._zod.run({value:a.value,issues:[]},n);if(p instanceof Promise)l.push(p),r=!0;else{if(p.issues.length===0)return p;l.push(p)}}return r?Promise.all(l).then(u=>ra(u,a,e,n)):ra(l,a,e,n)}}),Hn=m("$ZodIntersection",(e,t)=>{F.init(e,t),e._zod.parse=(i,s)=>{const a=i.value,n=t.left._zod.run({value:a,issues:[]},s),r=t.right._zod.run({value:a,issues:[]},s);return n instanceof Promise||r instanceof Promise?Promise.all([n,r]).then(([u,p])=>oa(i,u,p)):oa(i,n,r)}});function ei(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(Xt(e)&&Xt(t)){const i=Object.keys(t),s=Object.keys(e).filter(n=>i.indexOf(n)!==-1),a={...e,...t};for(const n of s){const r=ei(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};a[n]=r.data}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let s=0;s<e.length;s++){const a=e[s],n=t[s],r=ei(a,n);if(!r.valid)return{valid:!1,mergeErrorPath:[s,...r.mergeErrorPath]};i.push(r.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function oa(e,t,i){if(t.issues.length&&e.issues.push(...t.issues),i.issues.length&&e.issues.push(...i.issues),He(e))return e;const s=ei(t.value,i.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const Yn=m("$ZodTransform",(e,t)=>{F.init(e,t),e._zod.parse=(i,s)=>{if(s.direction==="backward")throw new Vi(e.constructor.name);const a=t.transform(i.value,i);if(s.async)return(a instanceof Promise?a:Promise.resolve(a)).then(r=>(i.value=r,i));if(a instanceof Promise)throw new Ge;return i.value=a,i}});function la(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const da=m("$ZodOptional",(e,t)=>{F.init(e,t),e._zod.optin="optional",e._zod.optout="optional",x(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),x(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${Kt(i.source)})?$`):void 0}),e._zod.parse=(i,s)=>{if(t.innerType._zod.optin==="optional"){const a=t.innerType._zod.run(i,s);return a instanceof Promise?a.then(n=>la(n,i.value)):la(a,i.value)}return i.value===void 0?i:t.innerType._zod.run(i,s)}}),Kn=m("$ZodNullable",(e,t)=>{F.init(e,t),x(e._zod,"optin",()=>t.innerType._zod.optin),x(e._zod,"optout",()=>t.innerType._zod.optout),x(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${Kt(i.source)}|null)$`):void 0}),x(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(i,s)=>i.value===null?i:t.innerType._zod.run(i,s)}),Xn=m("$ZodDefault",(e,t)=>{F.init(e,t),e._zod.optin="optional",x(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,s)=>{if(s.direction==="backward")return t.innerType._zod.run(i,s);if(i.value===void 0)return i.value=t.defaultValue,i;const a=t.innerType._zod.run(i,s);return a instanceof Promise?a.then(n=>ua(n,t)):ua(a,t)}});function ua(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Jn=m("$ZodPrefault",(e,t)=>{F.init(e,t),e._zod.optin="optional",x(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,s)=>(s.direction==="backward"||i.value===void 0&&(i.value=t.defaultValue),t.innerType._zod.run(i,s))}),Qn=m("$ZodNonOptional",(e,t)=>{F.init(e,t),x(e._zod,"values",()=>{const i=t.innerType._zod.values;return i?new Set([...i].filter(s=>s!==void 0)):void 0}),e._zod.parse=(i,s)=>{const a=t.innerType._zod.run(i,s);return a instanceof Promise?a.then(n=>pa(n,e)):pa(a,e)}});function pa(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 jn=m("$ZodCatch",(e,t)=>{F.init(e,t),x(e._zod,"optin",()=>t.innerType._zod.optin),x(e._zod,"optout",()=>t.innerType._zod.optout),x(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,s)=>{if(s.direction==="backward")return t.innerType._zod.run(i,s);const a=t.innerType._zod.run(i,s);return a instanceof Promise?a.then(n=>(i.value=n.value,n.issues.length&&(i.value=t.catchValue({...i,error:{issues:n.issues.map(r=>Fe(r,s,Re()))},input:i.value}),i.issues=[]),i)):(i.value=a.value,a.issues.length&&(i.value=t.catchValue({...i,error:{issues:a.issues.map(n=>Fe(n,s,Re()))},input:i.value}),i.issues=[]),i)}}),er=m("$ZodPipe",(e,t)=>{F.init(e,t),x(e._zod,"values",()=>t.in._zod.values),x(e._zod,"optin",()=>t.in._zod.optin),x(e._zod,"optout",()=>t.out._zod.optout),x(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(i,s)=>{if(s.direction==="backward"){const n=t.out._zod.run(i,s);return n instanceof Promise?n.then(r=>Rt(r,t.in,s)):Rt(n,t.in,s)}const a=t.in._zod.run(i,s);return a instanceof Promise?a.then(n=>Rt(n,t.out,s)):Rt(a,t.out,s)}});function Rt(e,t,i){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},i)}const tr=m("$ZodReadonly",(e,t)=>{F.init(e,t),x(e._zod,"propValues",()=>t.innerType._zod.propValues),x(e._zod,"values",()=>t.innerType._zod.values),x(e._zod,"optin",()=>t.innerType?._zod?.optin),x(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(i,s)=>{if(s.direction==="backward")return t.innerType._zod.run(i,s);const a=t.innerType._zod.run(i,s);return a instanceof Promise?a.then(ca):ca(a)}});function ca(e){return e.value=Object.freeze(e.value),e}const ha=m("$ZodCustom",(e,t)=>{me.init(e,t),F.init(e,t),e._zod.parse=(i,s)=>i,e._zod.check=i=>{const s=i.value,a=t.fn(s);if(a instanceof Promise)return a.then(n=>ma(n,i,s,e));ma(a,i,s,e)}});function ma(e,t,i,s){if(!e){const a={code:"custom",input:i,inst:s,path:[...s._zod.def.path??[]],continue:!s._zod.def.abort};s._zod.def.params&&(a.params=s._zod.def.params),t.issues.push(je(a))}}var ya;class ir{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...i){const s=i[0];if(this._map.set(t,s),s&&typeof s=="object"&&"id"in s){if(this._idmap.has(s.id))throw new Error(`ID ${s.id} already exists in the registry`);this._idmap.set(s.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 s={...this.get(i)??{}};delete s.id;const a={...s,...this._map.get(t)};return Object.keys(a).length?a:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function ar(){return new ir}(ya=globalThis).__zod_globalRegistry??(ya.__zod_globalRegistry=ar());const Ft=globalThis.__zod_globalRegistry;function sr(e,t){return new e({type:"string",...v(t)})}function nr(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...v(t)})}function rr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...v(t)})}function or(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...v(t)})}function lr(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...v(t)})}function dr(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...v(t)})}function ur(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...v(t)})}function pr(e,t){return new e({type:"string",format:"date",check:"string_format",...v(t)})}function cr(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...v(t)})}function hr(e,t){return new e({type:"string",format:"duration",check:"string_format",...v(t)})}function mr(e,t){return new e({type:"number",checks:[],...v(t)})}function yr(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...v(t)})}function fr(e,t){return new e({type:"boolean",...v(t)})}function gr(e){return new e({type:"any"})}function br(e,t){return new Dn({check:"less_than",...v(t),value:e,inclusive:!0})}function Dr(e,t){return new vn({check:"greater_than",...v(t),value:e,inclusive:!0})}function zt(e,t){return new $n({check:"max_length",...v(t),maximum:e})}function Ye(e,t){return new kn({check:"min_length",...v(t),minimum:e})}function fa(e,t){return new _n({check:"length_equals",...v(t),length:e})}function ga(e,t){return new Cn({check:"string_format",format:"regex",...v(t),pattern:e})}function vr(e){return new xn({check:"string_format",format:"lowercase",...v(e)})}function wr(e){return new Sn({check:"string_format",format:"uppercase",...v(e)})}function $r(e,t){return new En({check:"string_format",format:"includes",...v(t),includes:e})}function kr(e,t){return new On({check:"string_format",format:"starts_with",...v(t),prefix:e})}function _r(e,t){return new Pn({check:"string_format",format:"ends_with",...v(t),suffix:e})}function Ke(e){return new In({check:"overwrite",tx:e})}function Cr(e){return Ke(t=>t.normalize(e))}function xr(){return Ke(e=>e.trim())}function Sr(){return Ke(e=>e.toLowerCase())}function Er(){return Ke(e=>e.toUpperCase())}function Or(){return Ke(e=>Vs(e))}function Pr(e,t,i){return new e({type:"array",element:t,...v(i)})}function ba(e,t,i){return new e({type:"custom",check:"custom",fn:t,...v(i)})}function Da(e){const t=Ir(i=>(i.addIssue=s=>{if(typeof s=="string")i.issues.push(je(s,i.value,t._zod.def));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=i.value),a.inst??(a.inst=t),a.continue??(a.continue=!t._zod.def.abort),i.issues.push(je(a))}},e(i.value,i)));return t}function Ir(e,t){const i=new me({check:"custom",...v(t)});return i._zod.check=e,i}function Ar(e,t,i,s={}){const a=v(s),n={...v(s),check:"string_format",type:"string",format:t,fn:typeof i=="function"?i:l=>i.test(l),...a};return i instanceof RegExp&&(n.pattern=i),new e(n)}const Lr=m("ZodISODateTime",(e,t)=>{Rn.init(e,t),Nt.init(e,t)});function Tr(e){return ur(Lr,e)}const Mr=m("ZodISODate",(e,t)=>{Fn.init(e,t),Nt.init(e,t)});function Rr(e){return pr(Mr,e)}const Fr=m("ZodISOTime",(e,t)=>{zn.init(e,t),Nt.init(e,t)});function zr(e){return cr(Fr,e)}const Nr=m("ZodISODuration",(e,t)=>{Nn.init(e,t),Nt.init(e,t)});function Br(e){return hr(Nr,e)}const ge=m("ZodError",(e,t)=>{Xi.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>Hs(e,i)},flatten:{value:i=>Gs(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,Ht,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,Ht,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),qr=It(ge),Zr=At(ge),Vr=Lt(ge),Ur=Tt(ge),Wr=Xs(ge),Gr=Js(ge),Hr=Qs(ge),Yr=js(ge),Kr=en(ge),Xr=tn(ge),Jr=an(ge),Qr=sn(ge),oe=m("ZodType",(e,t)=>(F.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...i)=>e.clone(Zs(t,{checks:[...t.checks??[],...i.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]})),e.clone=(i,s)=>Yi(e,i,s),e.brand=()=>e,e.register=((i,s)=>(i.add(e,s),e)),e.parse=(i,s)=>qr(e,i,s,{callee:e.parse}),e.safeParse=(i,s)=>Vr(e,i,s),e.parseAsync=async(i,s)=>Zr(e,i,s,{callee:e.parseAsync}),e.safeParseAsync=async(i,s)=>Ur(e,i,s),e.spa=e.safeParseAsync,e.encode=(i,s)=>Wr(e,i,s),e.decode=(i,s)=>Gr(e,i,s),e.encodeAsync=async(i,s)=>Hr(e,i,s),e.decodeAsync=async(i,s)=>Yr(e,i,s),e.safeEncode=(i,s)=>Kr(e,i,s),e.safeDecode=(i,s)=>Xr(e,i,s),e.safeEncodeAsync=async(i,s)=>Jr(e,i,s),e.safeDecodeAsync=async(i,s)=>Qr(e,i,s),e.refine=(i,s)=>e.check(ko(i,s)),e.superRefine=i=>e.check(_o(i)),e.overwrite=i=>e.check(Ke(i)),e.optional=()=>va(e),e.nullable=()=>wa(e),e.nullish=()=>va(wa(e)),e.nonoptional=i=>fo(e,i),e.array=()=>to(e),e.or=i=>ao([e,i]),e.and=i=>no(e,i),e.transform=i=>$a(e,oo(i)),e.default=i=>co(e,i),e.prefault=i=>mo(e,i),e.catch=i=>bo(e,i),e.pipe=i=>$a(e,i),e.readonly=()=>wo(e),e.describe=i=>{const s=e.clone();return Ft.add(s,{description:i}),s},Object.defineProperty(e,"description",{get(){return Ft.get(e)?.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return Ft.get(e);const s=e.clone();return Ft.add(s,i[0]),s},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),jr=m("_ZodString",(e,t)=>{jt.init(e,t),oe.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=(...s)=>e.check(ga(...s)),e.includes=(...s)=>e.check($r(...s)),e.startsWith=(...s)=>e.check(kr(...s)),e.endsWith=(...s)=>e.check(_r(...s)),e.min=(...s)=>e.check(Ye(...s)),e.max=(...s)=>e.check(zt(...s)),e.length=(...s)=>e.check(fa(...s)),e.nonempty=(...s)=>e.check(Ye(1,...s)),e.lowercase=s=>e.check(vr(s)),e.uppercase=s=>e.check(wr(s)),e.trim=()=>e.check(xr()),e.normalize=(...s)=>e.check(Cr(...s)),e.toLowerCase=()=>e.check(Sr()),e.toUpperCase=()=>e.check(Er()),e.slugify=()=>e.check(Or())}),Nt=m("ZodStringFormat",(e,t)=>{fe.init(e,t),jr.init(e,t)}),eo=m("ZodArray",(e,t)=>{na.init(e,t),oe.init(e,t),e.element=t.element,e.min=(i,s)=>e.check(Ye(i,s)),e.nonempty=i=>e.check(Ye(1,i)),e.max=(i,s)=>e.check(zt(i,s)),e.length=(i,s)=>e.check(fa(i,s)),e.unwrap=()=>e.element});function to(e,t){return Pr(eo,e,t)}const io=m("ZodUnion",(e,t)=>{Gn.init(e,t),oe.init(e,t),e.options=t.options});function ao(e,t){return new io({type:"union",options:e,...v(t)})}const so=m("ZodIntersection",(e,t)=>{Hn.init(e,t),oe.init(e,t)});function no(e,t){return new so({type:"intersection",left:e,right:t})}const ro=m("ZodTransform",(e,t)=>{Yn.init(e,t),oe.init(e,t),e._zod.parse=(i,s)=>{if(s.direction==="backward")throw new Vi(e.constructor.name);i.addIssue=n=>{if(typeof n=="string")i.issues.push(je(n,i.value,t));else{const r=n;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=i.value),r.inst??(r.inst=e),i.issues.push(je(r))}};const a=t.transform(i.value,i);return a instanceof Promise?a.then(n=>(i.value=n,i)):(i.value=a,i)}});function oo(e){return new ro({type:"transform",transform:e})}const lo=m("ZodOptional",(e,t)=>{da.init(e,t),oe.init(e,t),e.unwrap=()=>e._zod.def.innerType});function va(e){return new lo({type:"optional",innerType:e})}const uo=m("ZodNullable",(e,t)=>{Kn.init(e,t),oe.init(e,t),e.unwrap=()=>e._zod.def.innerType});function wa(e){return new uo({type:"nullable",innerType:e})}const po=m("ZodDefault",(e,t)=>{Xn.init(e,t),oe.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function co(e,t){return new po({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Hi(t)}})}const ho=m("ZodPrefault",(e,t)=>{Jn.init(e,t),oe.init(e,t),e.unwrap=()=>e._zod.def.innerType});function mo(e,t){return new ho({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Hi(t)}})}const yo=m("ZodNonOptional",(e,t)=>{Qn.init(e,t),oe.init(e,t),e.unwrap=()=>e._zod.def.innerType});function fo(e,t){return new yo({type:"nonoptional",innerType:e,...v(t)})}const go=m("ZodCatch",(e,t)=>{jn.init(e,t),oe.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function bo(e,t){return new go({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Do=m("ZodPipe",(e,t)=>{er.init(e,t),oe.init(e,t),e.in=t.in,e.out=t.out});function $a(e,t){return new Do({type:"pipe",in:e,out:t})}const vo=m("ZodReadonly",(e,t)=>{tr.init(e,t),oe.init(e,t),e.unwrap=()=>e._zod.def.innerType});function wo(e){return new vo({type:"readonly",innerType:e})}const $o=m("ZodCustom",(e,t)=>{ha.init(e,t),oe.init(e,t)});function ko(e,t={}){return ba($o,e,t)}function _o(e){return Da(e)}const ze=m("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");F.init(e,t),e.def=t,e.type=t.type,e.parse=(i,s)=>Ys(e,i,s,{callee:e.parse}),e.safeParse=(i,s)=>Ji(e,i,s),e.parseAsync=async(i,s)=>Ks(e,i,s,{callee:e.parseAsync}),e.safeParseAsync=async(i,s)=>Qi(e,i,s),e.check=(...i)=>e.clone({...t,checks:[...t.checks??[],...i.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),e.clone=(i,s)=>Yi(e,i,s),e.brand=()=>e,e.register=((i,s)=>(i.add(e,s),e))}),ka=m("ZodMiniString",(e,t)=>{jt.init(e,t),ze.init(e,t)});function _a(e){return sr(ka,e)}const Xe=m("ZodMiniStringFormat",(e,t)=>{fe.init(e,t),ka.init(e,t)}),Co=m("ZodMiniEmail",(e,t)=>{Tn.init(e,t),Xe.init(e,t)});function xo(e){return nr(Co,e)}const So=m("ZodMiniUUID",(e,t)=>{Ln.init(e,t),Xe.init(e,t)});function Eo(e){return rr(So,e)}const Oo=m("ZodMiniURL",(e,t)=>{Mn.init(e,t),Xe.init(e,t)});function Po(e){return or(Oo,e)}const Io=m("ZodMiniIPv4",(e,t)=>{Bn.init(e,t),Xe.init(e,t)});function Ao(e){return lr(Io,e)}const Lo=m("ZodMiniIPv6",(e,t)=>{qn.init(e,t),Xe.init(e,t)});function To(e){return dr(Lo,e)}const Mo=m("ZodMiniCustomStringFormat",(e,t)=>{Zn.init(e,t),Xe.init(e,t)});function Ro(e){return Ar(Mo,"hostname",dn,e)}const Ca=m("ZodMiniNumber",(e,t)=>{aa.init(e,t),ze.init(e,t)});function xa(e){return mr(Ca,e)}const Fo=m("ZodMiniNumberFormat",(e,t)=>{Vn.init(e,t),Ca.init(e,t)});function zo(e){return yr(Fo,e)}const No=m("ZodMiniBoolean",(e,t)=>{Un.init(e,t),ze.init(e,t)});function Sa(e){return fr(No,e)}const Bo=m("ZodMiniAny",(e,t)=>{Wn.init(e,t),ze.init(e,t)});function ti(){return gr(Bo)}const qo=m("ZodMiniArray",(e,t)=>{na.init(e,t),ze.init(e,t)});function Ea(e,t){return new qo({type:"array",element:e,...v(t)})}const Zo=m("ZodMiniOptional",(e,t)=>{da.init(e,t),ze.init(e,t)});function Vo(e){return new Zo({type:"optional",innerType:e})}const Uo=m("ZodMiniCustom",(e,t)=>{ha.init(e,t),ze.init(e,t)});function Y(e,t={}){return ba(Uo,e,t)}function Oa(e){return Da(e)}const ii={email:{schema:xo()},hostname:{schema:Ro()},ipv4:{schema:Ao()},ipv6:{schema:To()},url:{schema:Po()},uuid:{schema:Eo()},date:{schema:Rr()},time:{schema:zr()},"date-time":{schema:Tr()},duration:{schema:Br()}},Wo=Object.keys(ii),Go=e=>(t,i)=>{switch(t.type){case"string":return Ho(t,i);case"integer":case"number":return Ko(t,i);case"boolean":return Xo(t,i);case"array":return Jo(t,i);case"custom":{if(!e)throw new Error('Validator type "custom" requires a customValidators object, but it was not supplied.');return Qo(t,e)}}};function E(e,t){if(e!==void 0)return typeof e=="string"?e:t?.translate(e.key,e.params,e.default)??e.default}function Ho(e,t){return et(e,i=>{const s=E(i.messages?.invalid,t);let a=s?_a(s):_a();if(i.required===!0){const n=E(i.messages?.required,t)??"This field is required";a=a.check(Y(r=>r.length>0,{error:n}))}if(typeof i.minLength=="number"){const n=E(i.messages?.minLength,t),r=i.minLength;a=a.check(n?Y(l=>l.length>=r,{error:n}):Ye(r))}if(typeof i.maxLength=="number"){const n=E(i.messages?.maxLength,t),r=i.maxLength;a=a.check(n?Y(l=>l.length<=r,{error:n}):zt(r))}if(typeof i.pattern=="string"){const n=E(i.messages?.pattern,t),r=new RegExp(i.pattern);a=a.check(n?Y(l=>r.test(l),{error:n}):ga(r))}if(i.enum){const n=i.enum,r=E(i.messages?.enum,t);a=a.check(Y(l=>n.includes(l),r?{error:r}:void 0))}if(i.const!==void 0){const n=E(i.messages?.const,t);a=a.check(Y(r=>r===i.const,n?{error:n}:void 0))}if(i.format!==void 0)if(Wo.includes(i.format)){const n=E(i.messages?.format,t);a=a.check(n?Oa((r,l)=>{const u=_e.standardValidate(ii[i.format].schema,r);_e.isStandardValidateSuccess(u)||l.addIssue({code:"custom",path:[],message:n})}):ii[i.format].schema)}else console.error(`The string validation format "${i.format}" is not supported`);return a})}const Yo=(e,t)=>{if(t===0)return!1;const i=e/t;return Math.abs(i-Math.round(i))<1e-10};function Ko(e,t){return et(e,i=>{const s=E(i.messages?.invalid,t);let a=s?xa(s):xa();if(i.type==="integer"&&(a=a.check(zo())),i.minimum!==void 0){const n=E(i.messages?.minimum,t),r=i.minimum;a=a.check(n?Y(l=>l>=r,{error:n}):Dr(r))}if(i.maximum!==void 0){const n=E(i.messages?.maximum,t),r=i.maximum;a=a.check(n?Y(l=>l<=r,{error:n}):br(r))}if(i.exclusiveMinimum!==void 0){const n=E(i.messages?.exclusiveMinimum,t),r=i.exclusiveMinimum;a=a.check(Y(l=>l>r,n?{error:n}:void 0))}if(i.exclusiveMaximum!==void 0){const n=E(i.messages?.exclusiveMaximum,t),r=i.exclusiveMaximum;a=a.check(Y(l=>l<r,n?{error:n}:void 0))}if(i.multipleOf!==void 0){const n=E(i.messages?.multipleOf,t),r=i.multipleOf;a=a.check(Y(l=>Yo(l,r),n?{error:n}:void 0))}if(i.enum){const n=i.enum,r=E(i.messages?.enum,t);a=a.check(Y(l=>n.includes(l),r?{error:r}:void 0))}if(i.const!==void 0){const n=E(i.messages?.const,t);a=a.check(Y(r=>r===i.const,n?{error:n}:void 0))}return a})}function Xo(e,t){return et(e,i=>{const s=E(i.messages?.invalid,t);let a=s?Sa(s):Sa();if(i.const!==void 0){const n=E(i.messages?.const,t);a=a.check(Y(r=>r===i.const,n?{error:n}:void 0))}return a})}function Jo(e,t){return et(e,i=>{const s=E(i.messages?.invalid,t);let a=s?Ea(ti(),s):Ea(ti());if(i.required===!0){const n=E(i.messages?.required,t)??"This field is required";a=a.check(Y(r=>r.length>0,{error:n}))}if(typeof i.minItems=="number"){const n=E(i.messages?.minItems,t),r=i.minItems;a=a.check(n?Y(l=>l.length>=r,{error:n}):Ye(r))}if(typeof i.maxItems=="number"){const n=E(i.messages?.maxItems,t),r=i.maxItems;a=a.check(n?Y(l=>l.length<=r,{error:n}):zt(r))}return a})}function Qo(e,t){return et(e,i=>{let s=ti();return _e.filterTap(Object.keys(i),a=>a!=="type"&&a!=="required",a=>{const n=i[a],r=t[a],l=r(n);s=s.check(Oa((u,p)=>{const c=_e.standardValidate(l,u);if(!_e.isStandardValidateSuccess(c)){const y=c.issues[0];p.addIssue({code:"custom",path:[],message:y?.message||`Validation failed for ${a}`})}}))}),s})}function et(e,t){const i=t(e);return e.required?i:Vo(i)}const jo=e=>e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"label")&&Object.prototype.hasOwnProperty.call(e,"value");function el(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 Pa={button:async()=>(await Promise.resolve().then(()=>ol)).ButtonElement,calendar:async()=>(await Promise.resolve().then(()=>gl)).CalendarElement,rangeCalendar:async()=>(await Promise.resolve().then(()=>_l)).RangeCalendarElement,rangeDateInput:async()=>(await Promise.resolve().then(()=>Ol)).RangeDateInputElement,rangeDatePicker:async()=>(await Promise.resolve().then(()=>Al)).RangeDatePickerElement,currency:async()=>(await Promise.resolve().then(()=>Fl)).CurrencyElement,dateInput:async()=>(await Promise.resolve().then(()=>Zl)).DateElement,datePicker:async()=>(await Promise.resolve().then(()=>Wl)).DatePickerElement,dropdown:async()=>(await Promise.resolve().then(()=>nd)).DropdownElement,list:async()=>(await Promise.resolve().then(()=>ld)).ListElement,markdown:async()=>(await Promise.resolve().then(()=>yd)).MarkdownElement,password:async()=>(await Promise.resolve().then(()=>vd)).PasswordElement,textinput:async()=>(await Promise.resolve().then(()=>Cd)).TextinputElement,textarea:async()=>(await Promise.resolve().then(()=>Pd)).TextareaElement,toggle:async()=>(await Promise.resolve().then(()=>Md)).ToggleElement,checkbox:async()=>(await Promise.resolve().then(()=>Bd)).CheckboxElement,number:async()=>(await Promise.resolve().then(()=>Wd)).NumberElement,radiogroup:async()=>(await Promise.resolve().then(()=>jd)).RadiogroupElement,select:async()=>(await Promise.resolve().then(()=>su)).SelectElement,tags:async()=>(await Promise.resolve().then(()=>uu)).TagsElement,repeater:async()=>(await Promise.resolve().then(()=>yu)).RepeaterElement,flex:async()=>(await Promise.resolve().then(()=>bu)).FlexElement,grid:async()=>(await Promise.resolve().then(()=>wu)).GridElement,tabs:async()=>(await Promise.resolve().then(()=>_u)).TabsElement,accordion:async()=>(await Promise.resolve().then(()=>Su)).AccordionElement,alert:async()=>(await Promise.resolve().then(()=>Pu)).AlertElement,markdownText:async()=>(await Promise.resolve().then(()=>Lu)).MarkdownTextElement,renderer:async()=>(await Promise.resolve().then(()=>Ru)).RendererElement};var tl=Object.defineProperty,il=Object.getOwnPropertyDescriptor,tt=(e,t,i,s)=>{for(var a=s>1?void 0:s?il(t,i):t,n=e.length-1,r;n>=0;n--)(r=e[n])&&(a=(s?r(t,i,a):r(a))||a);return s&&a&&tl(t,i,a),a};_.FormElement=class extends d.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=Bs(t.formDef,t.formSelectors,t.formConfig),s={formDef:i.formDef,widgetLoaders:{...Pa,...i.widgetLoaders,...t.customWidgetLoaders??{}},dependencies:{...i.dependencies??{},...t.dependencies??{}},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},a=Go({...t.customValidators??{}}),n=i.formEvent,r=n?l=>n(l.detail):void 0;return d.html`
|
|
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`
|
|
2
2
|
<gui-core-form
|
|
3
|
-
.config=${
|
|
4
|
-
.validators=${
|
|
3
|
+
.config=${a}
|
|
4
|
+
.validators=${r}
|
|
5
5
|
.autocomplete=${this.autocomplete}
|
|
6
6
|
.formHealthBoundary=${this.formHealthBoundary}
|
|
7
|
-
@formEvent=${
|
|
7
|
+
@formEvent=${o}
|
|
8
8
|
></gui-core-form>
|
|
9
|
-
`}},
|
|
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`
|
|
10
10
|
<div class="gui-widget">
|
|
11
11
|
<button
|
|
12
12
|
type=${this.actionType??"button"}
|
|
13
13
|
tabindex="0"
|
|
14
14
|
id=${this.uid}
|
|
15
|
-
class=${
|
|
15
|
+
class=${w.classMap(i)}
|
|
16
16
|
data-cy=${`${this.uid}_button`}
|
|
17
17
|
?disabled=${this.disabled}
|
|
18
18
|
>
|
|
19
|
-
${t==="left"?
|
|
20
|
-
${this.label?
|
|
21
|
-
${t==="right"?
|
|
19
|
+
${t==="left"?a:l.nothing}
|
|
20
|
+
${this.label?l.html`<span>${this.label}</span>`:l.nothing}
|
|
21
|
+
${t==="right"?a:l.nothing}
|
|
22
22
|
</button>
|
|
23
23
|
</div>
|
|
24
|
-
`}};
|
|
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`
|
|
25
25
|
<gui-button
|
|
26
26
|
.uid=${this.widget.uid}
|
|
27
27
|
.actionType=${this.adapter.templateData.actionType??"button"}
|
|
@@ -33,176 +33,169 @@
|
|
|
33
33
|
.iconPosition=${this.adapter.templateData.iconPosition}
|
|
34
34
|
@click=${()=>this.adapter.click()}
|
|
35
35
|
></gui-button>
|
|
36
|
-
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};ai([g.consume({context:h.formContext}),o.property({attribute:!1})],it.prototype,"formContext",2),ai([g.provide({context:h.actionContext})],it.prototype,"adapter",2),it=ai([o.customElement("gui-button-interactive")],it);const ol=Object.freeze(Object.defineProperty({__proto__:null,get ButtonElement(){return it}},Symbol.toStringTag,{value:"Module"})),ll={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}};function Pe(e){const t=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),s=String(e.getDate()).padStart(2,"0");return`${t}-${i}-${s}`}function Ia(e){return at(e,new Date)}function at(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function dl(e){const t=[0,1,2,3,4,5,6],i=e%7;return[...t.slice(i),...t.slice(0,i)]}function Aa(e){const t=ll[e??"en"]||{firstDay:0};return dl(t.firstDay)}function ul(e){const t=new Intl.DateTimeFormat(e,{weekday:"narrow"}),i=new Date(2025,10,30);return Aa(e).map(s=>{const a=new Date(i);return a.setDate(i.getDate()+s),t.format(a)})}function Ne(e,t,i){for(let s=0;s<i;s++){const a=new Date(t.getFullYear(),t.getMonth()+s,1);if(e.getMonth()===a.getMonth()&&e.getFullYear()===a.getFullYear())return!0}return!1}function pl(e,t,i="long"){return new Intl.DateTimeFormat(e,{month:i,year:"numeric"}).formatToParts(t).filter(a=>a.type==="month"||a.type==="year")}function La(e,t){const i=e||"en-US",n=new Intl.DateTimeFormat(i,{day:"numeric"}).formatToParts(t).find(r=>r.type==="day");return n?n.value:t.getDate().toString()}function si(e,t){const i=Pe(e),s=Pe(t);return i===s?{start:i}:{start:i,end:s}}function Ta(e){return e.length?e.map(s=>({start:new Date(s.start).getTime(),end:new Date(s.end??s.start).getTime()})).sort((s,a)=>s.start-a.start).reduce((s,a)=>{const n=s[s.length-1];if(n){const r=new Date(n.end);if(r.setDate(r.getDate()+1),a.start<=r.getTime())return n.end=Math.max(n.end,a.end),s}return[...s,a]},[]).map(s=>si(new Date(s.start),new Date(s.end))):[]}class ae{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:s,templateData:a}=this.getState(),{touched:n,errors:r,readonly:l,disabled:u,hint:p}=a,c=n&&r&&r.length>0;_e.filterTap(i,y=>!!y,y=>{const f=(b,C)=>{C?y.setAttribute(b,C):y.removeAttribute(b)};f("aria-describedby",p?`${s}_hint`:null),f("aria-invalid",c?"true":null),f("aria-errormessage",c?`${s}_errors`:null),f("aria-readonly",u||l?"true":null)})}}const se=(e,t,i=!1,s=void 0,a=!0)=>a?t.label?d.html`<label
|
|
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
|
|
37
37
|
class="gui-label"
|
|
38
38
|
for=${e}
|
|
39
39
|
data-cy=${`${e}_label`}
|
|
40
|
-
id=${
|
|
40
|
+
id=${a?`${e}_${a}_label`:`${e}_label`}
|
|
41
41
|
>
|
|
42
|
-
${t.label+(t.required?" *":"")} ${
|
|
43
|
-
${i?
|
|
44
|
-
</label>`:
|
|
42
|
+
${t.label+(t.required?" *":"")} ${_s(e,t)}
|
|
43
|
+
${i?W(e,t):l.nothing}
|
|
44
|
+
</label>`:l.nothing:t.label?l.html`<span
|
|
45
45
|
class="gui-label"
|
|
46
46
|
data-cy=${`${e}_label`}
|
|
47
|
-
id=${
|
|
47
|
+
id=${a?`${e}_${a}_label`:`${e}_label`}
|
|
48
48
|
>
|
|
49
|
-
${t.label+(t.required?" *":"")} ${
|
|
50
|
-
${i?
|
|
51
|
-
</span>`:
|
|
52
|
-
${t.errors?.map(
|
|
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
54
|
</li>`)}
|
|
55
|
-
</ul>`:""}`};
|
|
56
|
-
|
|
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}
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
type="button"
|
|
70
|
-
tabindex="0"
|
|
71
|
-
class="gui-button gui-calendar__month-button gui-calendar__month-button--prev"
|
|
72
|
-
?disabled=${!this.canGoPrev()}
|
|
73
|
-
@click=${this.prevMonth}
|
|
74
|
-
aria-label=${this.prevMonthAriaLabel??"Previous month"}
|
|
75
|
-
>
|
|
76
|
-
${this.prevMonthIcon?d.html`<span
|
|
77
|
-
class=${`gui-widget-icon ${this.prevMonthIcon}`}
|
|
78
|
-
data-icon=${this.prevMonthIcon}
|
|
79
|
-
></span>`:d.html`<svg
|
|
80
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
81
|
-
width="16"
|
|
82
|
-
height="16"
|
|
83
|
-
viewBox="0 0 256 256"
|
|
84
|
-
>
|
|
85
|
-
<path
|
|
86
|
-
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"
|
|
87
|
-
></path>
|
|
88
|
-
</svg>`}
|
|
89
|
-
</button>
|
|
58
|
+
<div class="gui-widget" @focusout=${e.onFocusOut}>
|
|
59
|
+
<div
|
|
60
|
+
id=${e.uid}
|
|
61
|
+
class="gui-calendar-input"
|
|
62
|
+
role="group"
|
|
63
|
+
aria-labelledby=${e.label?`${e.uid}_calendar_label`:l.nothing}
|
|
64
|
+
?aria-disabled=${e.disabled}
|
|
65
|
+
>
|
|
66
|
+
${e.renderAboveCalendar()}
|
|
67
|
+
<div class="gui-calendar__container">
|
|
68
|
+
${Ts("prev",{icon:e.prevMonthIcon,ariaLabel:e.prevMonthAriaLabel,disabled:!e.canGoPrev,onClick:e.onPrevMonthClick})}
|
|
90
69
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
70
|
+
<div class="gui-calendar__months-grid">
|
|
71
|
+
${i.map(a=>e.renderMonthPanel(a))}
|
|
72
|
+
</div>
|
|
94
73
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
74
|
+
${Ts("next",{icon:e.nextMonthIcon,ariaLabel:e.nextMonthAriaLabel,disabled:!e.canGoNext,onClick:e.onNextMonthClick})}
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
${e.errors?.length?W(e.uid,t):l.nothing}
|
|
80
|
+
`}function Ts(e,t){return e==="prev"?l.html`
|
|
81
|
+
<button
|
|
82
|
+
type="button"
|
|
83
|
+
tabindex="0"
|
|
84
|
+
class="gui-button gui-calendar__month-button gui-calendar__month-button--prev"
|
|
85
|
+
?disabled=${t.disabled}
|
|
86
|
+
@click=${t.onClick}
|
|
87
|
+
aria-label=${t.ariaLabel??"Previous month"}
|
|
88
|
+
>
|
|
89
|
+
${t.icon?l.html`<span class=${`gui-widget-icon ${t.icon}`} data-icon=${t.icon}></span>`:l.html`<svg
|
|
90
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
91
|
+
width="16"
|
|
92
|
+
height="16"
|
|
93
|
+
viewBox="0 0 256 256"
|
|
102
94
|
>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
95
|
+
<path
|
|
96
|
+
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"
|
|
97
|
+
></path>
|
|
98
|
+
</svg>`}
|
|
99
|
+
</button>
|
|
100
|
+
`:l.html`
|
|
101
|
+
<button
|
|
102
|
+
type="button"
|
|
103
|
+
tabindex="0"
|
|
104
|
+
class="gui-button gui-calendar__month-button gui-calendar__month-button--next"
|
|
105
|
+
?disabled=${t.disabled}
|
|
106
|
+
@click=${t.onClick}
|
|
107
|
+
aria-label=${t.ariaLabel??"Next month"}
|
|
108
|
+
>
|
|
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">
|
|
110
|
+
<path
|
|
111
|
+
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
|
+
></path>
|
|
113
|
+
</svg>`}
|
|
114
|
+
</button>
|
|
115
|
+
`}function Rp(e){const t=new Date(e.currentDate);return t.setDate(1),t.setMonth(t.getMonth()+e.offset),l.html`
|
|
116
|
+
<div class="gui-calendar__panel">
|
|
117
|
+
${e.renderHeader(t)} ${e.renderBelowHeader(e.offset)}
|
|
118
|
+
${e.renderPanelBody(e.offset)}
|
|
119
|
+
</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`
|
|
121
|
+
<header class="gui-calendar__header">
|
|
122
|
+
<h2>
|
|
123
|
+
${i.map(a=>a.type==="year"?l.html`<button
|
|
124
|
+
type="button"
|
|
125
|
+
tabindex="0"
|
|
126
|
+
class="gui-calendar__year-selector"
|
|
127
|
+
@click=${t.onToggleYearSelector}
|
|
128
|
+
aria-expanded=${t.yearSelectorOpen}
|
|
129
|
+
aria-label="Select year"
|
|
130
|
+
>
|
|
131
|
+
<span class="gui-calendar__year-value">${a.value}</span>
|
|
132
|
+
<span class="gui-calendar__year-arrow" aria-hidden="true">
|
|
133
|
+
<svg
|
|
107
134
|
xmlns="http://www.w3.org/2000/svg"
|
|
108
135
|
width="16"
|
|
109
136
|
height="16"
|
|
110
137
|
viewBox="0 0 256 256"
|
|
111
138
|
>
|
|
112
139
|
<path
|
|
113
|
-
d="
|
|
140
|
+
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"
|
|
114
141
|
></path>
|
|
115
|
-
</svg
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
142
|
+
</svg>
|
|
143
|
+
</span>
|
|
144
|
+
</button>`:l.html`<span class="gui-calendar__month-name">${a.value}</span>`)}
|
|
145
|
+
</h2>
|
|
146
|
+
</header>
|
|
147
|
+
`}function Bp(e,t,i){return l.html`
|
|
148
|
+
<div class="gui-calendar__days-grid" role="grid">
|
|
149
|
+
<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>`)}
|
|
119
151
|
</div>
|
|
120
152
|
|
|
121
|
-
${
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
</div>
|
|
139
|
-
`}renderHeader(t){const i=pl(this.localeId,t,this.monthFormat);return d.html`
|
|
140
|
-
<header class="gui-calendar__header">
|
|
141
|
-
<h2>
|
|
142
|
-
${i.map(s=>s.type==="year"?d.html`<button
|
|
153
|
+
${qe.repeat(e,a=>l.html`
|
|
154
|
+
<div role="row" class="gui-calendar__rows">
|
|
155
|
+
${qe.repeat(a,r=>r.date.toISOString(),r=>i(r))}
|
|
156
|
+
</div>
|
|
157
|
+
`)}
|
|
158
|
+
</div>
|
|
159
|
+
`}function qp(e){const t=e.currentYear;return l.html`
|
|
160
|
+
<div
|
|
161
|
+
class="gui-calendar__year-grid"
|
|
162
|
+
role="grid"
|
|
163
|
+
aria-label="Year selection"
|
|
164
|
+
@keydown=${e.onKeydown}
|
|
165
|
+
>
|
|
166
|
+
${Da(e.years,4).map(i=>l.html`
|
|
167
|
+
<div role="row" class="gui-calendar__year-row">
|
|
168
|
+
${i.map(a=>l.html`
|
|
169
|
+
<button
|
|
143
170
|
type="button"
|
|
144
|
-
|
|
145
|
-
class="gui-calendar__year-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
171
|
+
role="gridcell"
|
|
172
|
+
class="gui-calendar__year-button ${a===t?"current":""}"
|
|
173
|
+
tabindex=${a===t?0:-1}
|
|
174
|
+
data-year=${a}
|
|
175
|
+
@click=${r=>{r.stopPropagation(),e.onSelectYear(a)}}
|
|
176
|
+
aria-selected=${a===t}
|
|
149
177
|
>
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
>
|
|
158
|
-
<path
|
|
159
|
-
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"
|
|
160
|
-
></path>
|
|
161
|
-
</svg>
|
|
162
|
-
</span>
|
|
163
|
-
</button>`:d.html`<span class="gui-calendar__month-name">${s.value}</span>`)}
|
|
164
|
-
</h2>
|
|
165
|
-
</header>
|
|
166
|
-
`}renderYearGrid(){const t=this._currentDate.getFullYear(),i=this._yearList;return d.html`
|
|
167
|
-
<div
|
|
168
|
-
class="gui-calendar__year-grid"
|
|
169
|
-
role="grid"
|
|
170
|
-
aria-label="Year selection"
|
|
171
|
-
@keydown=${this.handleYearKeydown}
|
|
172
|
-
>
|
|
173
|
-
${this.chunkYears(i).map(s=>d.html`
|
|
174
|
-
<div role="row" class="gui-calendar__year-row">
|
|
175
|
-
${s.map(a=>d.html`
|
|
176
|
-
<button
|
|
177
|
-
type="button"
|
|
178
|
-
role="gridcell"
|
|
179
|
-
class="gui-calendar__year-button ${a===t?"current":""}"
|
|
180
|
-
tabindex=${a===t?0:-1}
|
|
181
|
-
data-year=${a}
|
|
182
|
-
@click=${n=>{n.stopPropagation(),this.selectYear(a)}}
|
|
183
|
-
aria-selected=${a===t}
|
|
184
|
-
>
|
|
185
|
-
${a}
|
|
186
|
-
</button>
|
|
187
|
-
`)}
|
|
188
|
-
</div>
|
|
189
|
-
`)}
|
|
190
|
-
</div>
|
|
191
|
-
`}chunkYears(t){const i=[];for(let s=0;s<t.length;s+=4)i.push(t.slice(s,s+4));return i}toggleYearSelector(){this._yearSelectorOpen=!this._yearSelectorOpen,this._yearSelectorOpen&&this.updateComplete.then(()=>{this.scrollToCurrentYear(),this.focusCurrentYearButton()})}selectYear(t){this.querySelector(".gui-calendar__year-selector")?.focus();const s=this._currentDate;this._currentDate=new Date(t,s.getMonth(),1),this._yearSelectorOpen=!1,this.updateComplete.then(()=>{this.querySelector('.gui-calendar__day-button[tabindex="0"]')?.focus()})}scrollToCurrentYear(){const t=this.querySelector(".gui-calendar__year-grid"),i=this.querySelector(".gui-calendar__year-button.current");if(t&&i){const s=t.getBoundingClientRect(),a=i.getBoundingClientRect(),n=t.scrollTop+(a.top-s.top)-s.height/2+a.height/2;t.scrollTop=Math.max(0,n)}}focusCurrentYearButton(){this.querySelector(".gui-calendar__year-button.current")?.focus()}handleYearKeydown(t){const i=t.target;if(!i.classList.contains("gui-calendar__year-button"))return;const s=Array.from(this.querySelectorAll(".gui-calendar__year-button")),a=s.indexOf(i),n=window.getComputedStyle(this).direction==="rtl";let r=0;switch(t.key){case"ArrowLeft":r=n?1:-1;break;case"ArrowRight":r=n?-1:1;break;case"ArrowUp":r=-4;break;case"ArrowDown":r=4;break;case"Enter":case" ":{t.preventDefault();const u=parseInt(i.dataset.year??"",10);isNaN(u)||this.selectYear(u);return}case"Escape":{t.preventDefault(),this.querySelector(".gui-calendar__year-selector")?.focus(),this._yearSelectorOpen=!1;return}default:return}t.preventDefault();const l=a+r;l>=0&&l<s.length&&s[l].focus()}get _effectiveMinYear(){return this.minDate?new Date(this.minDate).getFullYear():1900}get _effectiveMaxYear(){return this.maxDate?new Date(this.maxDate).getFullYear():2099}get _yearList(){const t=[];for(let i=this._effectiveMinYear;i<=this._effectiveMaxYear;i++)t.push(i);return t}async handleKeydown(t,i){if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)&&t.key!==" "&&t.key!=="Enter")return;const a=Array.from(this.querySelectorAll(".gui-calendar__day-button:not(.other-month)")),n=a.indexOf(t.target),r=window.getComputedStyle(this).direction==="rtl";let l=0;switch(t.key){case"ArrowLeft":l=r?1:-1;break;case"ArrowRight":l=r?-1:1;break;case"ArrowUp":l=-7;break;case"ArrowDown":l=7;break;case" ":case"Enter":t.preventDefault(),this.selectDate(i,t);return}t.preventDefault();const u=this.findNextFocusableIndex(n,l,a);let p=!1;if(u<0)if(this.canGoPrev())this.prevMonth(),p=!0;else{a.find(y=>!this.isButtonDisabled(y))?.focus();return}else if(u>=a.length)if(this.canGoNext())this.nextMonth(),p=!0;else{[...a].reverse().find(f=>!this.isButtonDisabled(f))?.focus();return}if(p){await this.updateComplete;const c=Array.from(this.querySelectorAll(".gui-calendar__day-button:not(.other-month)")),y=Array.from(this.querySelectorAll(".gui-calendar__panel"));let f;if(u<0)f=y[0].querySelectorAll(".gui-calendar__day-button:not(.other-month)").length+u;else{const C=y[y.length-1].querySelectorAll(".gui-calendar__day-button:not(.other-month)").length;f=c.length-C+(u-a.length)}if(this.isButtonDisabled(c[f])){const b=this.findNextFocusableIndex(f,l,c);if(b<0||b>=c.length){const C=c.findIndex(Se=>!this.isButtonDisabled(Se));C>-1&&c[C].focus()}else c[b]?.focus()}else{const b=Math.max(0,Math.min(f,c.length-1));c[b]?.focus()}}else a[u]?.focus()}chunkDays(t){const i=[];for(let s=0;s<t.length;s+=7)i.push(t.slice(s,s+7));return i}onFocusOut(t){t.relatedTarget&&this.contains(t.relatedTarget)||(this._blurRafId!==void 0&&cancelAnimationFrame(this._blurRafId),this._blurRafId=requestAnimationFrame(()=>{this._blurRafId=void 0,this.contains(document.activeElement)||this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}))}disconnectedCallback(){super.disconnectedCallback(),this._blurRafId!==void 0&&cancelAnimationFrame(this._blurRafId)}isDisabled(t){const i=Pe(t);if(this.minDate&&i<this.minDate||this.maxDate&&i>this.maxDate)return!0;if(this.disabledRanges&&this.disabledRanges.length>0)for(const s of this.disabledRanges){const a=s.start.split("T")[0],n=s.end?s.end.split("T")[0]:a;if(i>=a&&i<=n)return!0}return!1}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)}generateDateGrid(t=0){const i=this._currentDate.getFullYear(),s=this._currentDate.getMonth()+t,a=new Date(i,s,1),n=a.getDay(),r=Aa(this.localeId)[0],l=(n-r+7)%7,u=new Date(a);u.setDate(a.getDate()-l);const p=[];for(let c=0;c<42;c++){const y=new Date(u);y.setDate(u.getDate()+c),p.push(y)}return p}findNextFocusableIndex(t,i,s){let a=t+i;for(;a>=0&&a<s.length;){const n=s[a];if(!this.isButtonDisabled(n))return a;a+=i}return a}isButtonDisabled(t){return t?t.hasAttribute("disabled"):!0}canGoPrev(){if(!this.minDate)return!0;const t=new Date(this._currentDate.getFullYear(),this._currentDate.getMonth(),0);return Pe(t)>=this.minDate}canGoNext(){if(!this.maxDate)return!0;const t=(this.numberOfMonths??1)-1,i=new Date(this._currentDate.getFullYear(),this._currentDate.getMonth()+t+1,1);return Pe(i)<=this.maxDate}}O([o.property({type:String})],S.prototype,"uid"),O([o.property({type:String})],S.prototype,"label"),O([o.property({type:String})],S.prototype,"hint"),O([o.property({type:String,attribute:"locale-id"})],S.prototype,"localeId"),O([o.property({type:Array})],S.prototype,"errors"),O([o.property({type:Boolean})],S.prototype,"touched"),O([o.property({type:Boolean})],S.prototype,"required"),O([o.property({type:Boolean})],S.prototype,"disabled"),O([o.property({type:Boolean,attribute:"readonly"})],S.prototype,"readOnly"),O([o.property({type:String,attribute:"prev-month-icon"})],S.prototype,"prevMonthIcon"),O([o.property({type:String,attribute:"next-month-icon"})],S.prototype,"nextMonthIcon"),O([o.property({type:String,attribute:"prev-month-aria-label"})],S.prototype,"prevMonthAriaLabel"),O([o.property({type:String,attribute:"next-month-aria-label"})],S.prototype,"nextMonthAriaLabel"),O([o.property({type:String})],S.prototype,"dayFormat"),O([o.property({type:String})],S.prototype,"weekdayFormat"),O([o.property({type:String})],S.prototype,"monthFormat"),O([o.property({type:String})],S.prototype,"minDate"),O([o.property({type:String})],S.prototype,"maxDate"),O([o.property({type:Array})],S.prototype,"disabledRanges"),O([o.property({type:Number})],S.prototype,"numberOfMonths"),O([o.state()],S.prototype,"_currentDate"),O([o.state()],S.prototype,"_yearSelectorOpen");var hl=Object.defineProperty,ml=Object.getOwnPropertyDescriptor,Ra=(e,t,i,s)=>{for(var a=s>1?void 0:s?ml(t,i):t,n=e.length-1,r;n>=0;n--)(r=e[n])&&(a=(s?r(t,i,a):r(a))||a);return s&&a&&hl(t,i,a),a};let Bt=class extends S{constructor(){super(...arguments),this.value=void 0}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){if(e.has("value")&&this.value){const t=new Date(this.value);!isNaN(t.getTime())&&!Ne(t,this._currentDate,this.numberOfMonths??1)&&(this._currentDate=t)}}renderDay(e){const t={"gui-calendar__day-button":!0,today:e.isToday,selected:e.isSelected,disabled:e.isDisabled,"other-month":!e.isCurrentMonth};return d.html`
|
|
178
|
+
${a}
|
|
179
|
+
</button>
|
|
180
|
+
`)}
|
|
181
|
+
</div>
|
|
182
|
+
`)}
|
|
183
|
+
</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`
|
|
192
185
|
<button
|
|
193
186
|
type="button"
|
|
194
187
|
role="gridcell"
|
|
195
|
-
class=${
|
|
188
|
+
class=${w.classMap(t)}
|
|
196
189
|
tabindex=${e.isFocusable?0:-1}
|
|
197
190
|
?disabled=${!e.isCurrentMonth||e.isDisabled}
|
|
198
|
-
data-date=${e.date
|
|
191
|
+
data-date=${Q(e.date)}
|
|
199
192
|
@click=${()=>this.selectDate(e)}
|
|
200
|
-
@keydown=${i=>this.
|
|
193
|
+
@keydown=${i=>this._keyboard.handleDayKeydown(i)}
|
|
201
194
|
aria-selected=${e.isSelected}
|
|
202
195
|
>
|
|
203
196
|
${e.dayLabel}
|
|
204
197
|
</button>
|
|
205
|
-
`}getDaysInMonth(e){const t=
|
|
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`
|
|
206
199
|
<gui-calendar
|
|
207
200
|
.uid=${this.widget.uid}
|
|
208
201
|
.label=${this.adapter.templateData.label}
|
|
@@ -228,20 +221,265 @@
|
|
|
228
221
|
@change=${this.valueChanged}
|
|
229
222
|
@blur=${()=>this.adapter.onBlur()}
|
|
230
223
|
></gui-calendar>
|
|
231
|
-
`}valueChanged(e){const t=e?.target;this.adapter.valueChanged(t.value)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};ni([g.consume({context:h.formContext}),o.property({attribute:!1})],st.prototype,"formContext",2),ni([g.provide({context:h.inputContext})],st.prototype,"adapter",2),st=ni([o.customElement("gui-calendar-input")],st);const gl=Object.freeze(Object.defineProperty({__proto__:null,get CalendarElement(){return st}},Symbol.toStringTag,{value:"Module"}));function qt(e,t,i){if(!e)throw new TypeError("The element provided to the IntersectionObserver must exist");const s=new IntersectionObserver(a=>{a.forEach(n=>{t(n.isIntersecting)})},i);return s.observe(e),s}var bl=Object.defineProperty,Dl=Object.getOwnPropertyDescriptor,le=(e,t,i,s)=>{for(var a=s>1?void 0:s?Dl(t,i):t,n=e.length-1,r;n>=0;n--)(r=e[n])&&(a=(s?r(t,i,a):r(a))||a);return s&&a&&bl(t,i,a),a};let ee=class extends d.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"),s=e.composedPath()[0];!t?.contains(s)&&!i?.contains(s)&&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 s=Math.max(0,Math.min(t,i-1));this.focusPillAt(s)}}disconnectedCallback(){super.disconnectedCallback(),this.disconnectObservers(),this.removeOutsideListeners()}render(){const e=this.items.length;return e===0?d.nothing:d.html`
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
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)}
|
|
226
|
+
<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))}
|
|
228
|
+
</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`
|
|
231
|
+
<div class="gui-parts__touch-target ${s}__touch-target">
|
|
232
|
+
<input
|
|
233
|
+
type="text"
|
|
234
|
+
inputmode="numeric"
|
|
235
|
+
class="gui-parts__part ${s}__part ${u}"
|
|
236
|
+
data-type=${o}
|
|
237
|
+
data-group=${a.groups.length>1?e:l.nothing}
|
|
238
|
+
maxlength=${t.maxLength}
|
|
239
|
+
placeholder=${t.placeholder}
|
|
240
|
+
tabindex=${i}
|
|
241
|
+
?required=${a.required}
|
|
242
|
+
?disabled=${a.disabled}
|
|
243
|
+
?readonly=${a.partsReadonly}
|
|
244
|
+
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)}
|
|
248
|
+
@focus=${r.handleFocus}
|
|
249
|
+
@blur=${p=>r.handleBlur(p,e,o)}
|
|
250
|
+
@change=${p=>r.handleChange(p,e,o)}
|
|
251
|
+
/>
|
|
252
|
+
<div class="gui-parts__visual-underline ${s}__visual-underline"></div>
|
|
253
|
+
</div>
|
|
254
|
+
`}function sd(e,t,i,a,r){const s=a.blockClass,o=t.type;return l.html`
|
|
255
|
+
<div class="gui-parts__touch-target ${s}__touch-target">
|
|
256
|
+
<button
|
|
257
|
+
type="button"
|
|
258
|
+
class="gui-parts__part gui-parts__dayperiod ${s}__part ${s}__dayperiod"
|
|
259
|
+
data-type=${o}
|
|
260
|
+
data-group=${a.groups.length>1?e:l.nothing}
|
|
261
|
+
tabindex=${i}
|
|
262
|
+
?disabled=${a.disabled}
|
|
263
|
+
aria-label=${a.dayPeriodAriaLabel??"AM/PM"}
|
|
264
|
+
@click=${()=>r.toggleDayPeriod(e,o)}
|
|
265
|
+
@keydown=${r.handleDayPeriodKeyDown}
|
|
266
|
+
@keyup=${u=>r.handleKeyUp(u,e,o)}
|
|
267
|
+
@focus=${r.handleFocus}
|
|
268
|
+
@blur=${u=>r.handleBlur(u,e,o)}
|
|
269
|
+
>
|
|
270
|
+
${a.getDisplayValue(e,o)}
|
|
271
|
+
</button>
|
|
272
|
+
<div class="gui-parts__visual-underline ${s}__visual-underline"></div>
|
|
273
|
+
</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}
|
|
276
|
+
|
|
277
|
+
<div class="gui-widget">
|
|
278
|
+
<div
|
|
279
|
+
class="gui-widget-input gui-parts gui-parts-ring gui-time-input ${this.icon?"gui-calendar--icon":""}"
|
|
280
|
+
role="group"
|
|
281
|
+
>
|
|
282
|
+
${mt("default",t,this._parts)}
|
|
283
|
+
</div>
|
|
284
|
+
${this.icon?l.html`<span class=${w.classMap(i)} data-icon=${this.icon}></span>`:l.nothing}
|
|
285
|
+
</div>
|
|
286
|
+
|
|
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`
|
|
289
|
+
<button
|
|
290
|
+
type="button"
|
|
291
|
+
role=${i}
|
|
292
|
+
class=${w.classMap(r)}
|
|
293
|
+
tabindex=${t===this.rovingIndex?0:-1}
|
|
294
|
+
?disabled=${e.disabled||this.disabled}
|
|
295
|
+
data-value=${e.value}
|
|
296
|
+
aria-selected=${a}
|
|
297
|
+
aria-disabled=${e.disabled||this.disabled?"true":"false"}
|
|
298
|
+
@click=${s=>this.selectOption(e,s)}
|
|
299
|
+
>
|
|
300
|
+
${e.template}
|
|
301
|
+
</button>
|
|
302
|
+
`}render(){const e=this.timeOptions;if(e.length===0)return l.html`<div class="gui-time-list__empty">
|
|
303
|
+
${this.noAvailableTimesMessage??Hp}
|
|
304
|
+
</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
|
+
<div
|
|
306
|
+
class="gui-time-list__viewport"
|
|
307
|
+
role="listbox"
|
|
308
|
+
style=${i}
|
|
309
|
+
aria-label=${this.label??l.nothing}
|
|
310
|
+
@keydown=${this.onKeyDown}
|
|
311
|
+
>
|
|
312
|
+
${e.map((r,s)=>this.renderOption(r,s,"option"))}
|
|
313
|
+
</div>
|
|
314
|
+
`;const a=Da(e,t);return l.html`
|
|
235
315
|
<div
|
|
236
|
-
class
|
|
316
|
+
class="gui-time-list__viewport gui-time-list__viewport--grid"
|
|
317
|
+
role="grid"
|
|
318
|
+
style=${i}
|
|
319
|
+
aria-label=${this.label??l.nothing}
|
|
320
|
+
@keydown=${this.onKeyDown}
|
|
321
|
+
>
|
|
322
|
+
${a.map((r,s)=>l.html`
|
|
323
|
+
<div role="row" class="gui-time-list__row">
|
|
324
|
+
${r.map((o,u)=>this.renderOption(o,s*t+u,"gridcell"))}
|
|
325
|
+
</div>
|
|
326
|
+
`)}
|
|
327
|
+
</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})}
|
|
330
|
+
|
|
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
|
+
>
|
|
340
|
+
<gui-time
|
|
341
|
+
id="time-input"
|
|
342
|
+
class=${w.classMap(e.widgetClasses)}
|
|
343
|
+
.uid=${this.uid}
|
|
344
|
+
.hint=${this.hint}
|
|
345
|
+
.showErrors=${!1}
|
|
346
|
+
.errors=${this.errors}
|
|
347
|
+
?touched=${this.touched}
|
|
348
|
+
?required=${this.required}
|
|
349
|
+
?disabled=${this.disabled}
|
|
350
|
+
?readonly=${this.readOnly||!this.allowCustomTime}
|
|
351
|
+
.value=${this.value}
|
|
352
|
+
.icon=${this.icon}
|
|
353
|
+
.localeId=${this.localeId}
|
|
354
|
+
.hourFormat=${this.hourFormat}
|
|
355
|
+
.minuteStep=${this.minuteStep}
|
|
356
|
+
.minTime=${this.minTime}
|
|
357
|
+
.maxTime=${this.maxTime}
|
|
358
|
+
.minTimeMessage=${this.minTimeMessage}
|
|
359
|
+
.maxTimeMessage=${this.maxTimeMessage}
|
|
360
|
+
@blur=${this.onTimeBlur}
|
|
361
|
+
@focus=${this._popup.show}
|
|
362
|
+
@change=${this.onTimeChange}
|
|
363
|
+
></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">
|
|
366
|
+
<path
|
|
367
|
+
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>
|
|
370
|
+
|
|
371
|
+
<gui-time-list
|
|
372
|
+
.uid=${this.uid}
|
|
373
|
+
.value=${this.value}
|
|
374
|
+
.label=${this.label}
|
|
375
|
+
.localeId=${this.localeId}
|
|
376
|
+
.hourFormat=${this.hourFormat}
|
|
377
|
+
.minuteStep=${this.minuteStep}
|
|
378
|
+
.minTime=${this.minTime}
|
|
379
|
+
.maxTime=${this.maxTime}
|
|
380
|
+
.disabledRanges=${this.disabledRanges}
|
|
381
|
+
.height=${this.height}
|
|
382
|
+
.itemHeight=${this.itemHeight}
|
|
383
|
+
.columns=${this.columns}
|
|
384
|
+
.noAvailableTimesMessage=${this.noAvailableTimesMessage}
|
|
385
|
+
?readonly=${this.readOnly}
|
|
386
|
+
?hidden=${!this._popup.open}
|
|
387
|
+
@change=${this.onListChange}
|
|
388
|
+
></gui-time-list>
|
|
389
|
+
</div>
|
|
390
|
+
|
|
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`
|
|
393
|
+
<div class="gui-calendar__time-input-row">
|
|
394
|
+
<gui-time-picker
|
|
395
|
+
class="gui-time-picker gui-field"
|
|
396
|
+
.uid=${this.uid?`${this.uid}-time`:void 0}
|
|
397
|
+
.showErrors=${!1}
|
|
398
|
+
?required=${this.required}
|
|
399
|
+
?disabled=${this.disabled||!this._selectedDate}
|
|
400
|
+
?readonly=${this.readOnly}
|
|
401
|
+
.allowCustomTime=${this.allowCustomTime}
|
|
402
|
+
.value=${this._selectedTime}
|
|
403
|
+
.localeId=${this.localeId}
|
|
404
|
+
.hourFormat=${this.hourFormat}
|
|
405
|
+
.minuteStep=${this.minuteStep}
|
|
406
|
+
.minTime=${this.minTime}
|
|
407
|
+
.maxTime=${this.maxTime}
|
|
408
|
+
.disabledRanges=${this.resolvedTimeRanges}
|
|
409
|
+
.columns=${4}
|
|
410
|
+
.minTimeMessage=${this.minTimeMessage}
|
|
411
|
+
.maxTimeMessage=${this.maxTimeMessage}
|
|
412
|
+
.disabledRangeMessage=${this.disabledTimeRangeMessage}
|
|
413
|
+
.noAvailableTimesMessage=${this.noAvailableTimesMessage}
|
|
414
|
+
@change=${this.onTimePickerChange}
|
|
415
|
+
@listtoggle=${this.onListToggle}
|
|
416
|
+
></gui-time-picker>
|
|
417
|
+
</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`
|
|
419
|
+
<button
|
|
420
|
+
type="button"
|
|
421
|
+
role="gridcell"
|
|
422
|
+
class=${w.classMap(t)}
|
|
423
|
+
tabindex=${e.isFocusable?0:-1}
|
|
424
|
+
?disabled=${!e.isCurrentMonth||e.isDisabled}
|
|
425
|
+
data-date=${Q(e.date)}
|
|
426
|
+
@click=${()=>this.selectDate(e)}
|
|
427
|
+
@keydown=${i=>this._keyboard.handleDayKeydown(i)}
|
|
428
|
+
aria-selected=${e.isSelected}
|
|
429
|
+
>
|
|
430
|
+
${e.dayLabel}
|
|
431
|
+
</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`
|
|
433
|
+
<gui-date-time-calendar
|
|
434
|
+
.uid=${this.widget.uid}
|
|
435
|
+
.label=${e.label}
|
|
436
|
+
.hint=${e.hint}
|
|
437
|
+
.errors=${e.errors}
|
|
438
|
+
?touched=${e.touched}
|
|
439
|
+
?required=${e.validator?.required}
|
|
440
|
+
?disabled=${e.disabled}
|
|
441
|
+
?readonly=${e.readonly}
|
|
442
|
+
.value=${e.value}
|
|
443
|
+
.prevMonthIcon=${e.prevMonthIcon}
|
|
444
|
+
.nextMonthIcon=${e.nextMonthIcon}
|
|
445
|
+
.prevMonthAriaLabel=${e.prevMonthAriaLabel}
|
|
446
|
+
.nextMonthAriaLabel=${e.nextMonthAriaLabel}
|
|
447
|
+
.dayFormat=${e.dayFormat}
|
|
448
|
+
.weekdayFormat=${e.weekdayFormat}
|
|
449
|
+
.monthFormat=${e.monthFormat}
|
|
450
|
+
.minDate=${e.minDate}
|
|
451
|
+
.maxDate=${e.maxDate}
|
|
452
|
+
.disabledRanges=${e.disabledRanges}
|
|
453
|
+
.numberOfMonths=${e.numberOfMonths}
|
|
454
|
+
.localeId=${e.lang}
|
|
455
|
+
.hourFormat=${e.hourFormat}
|
|
456
|
+
.minuteStep=${e.minuteStep}
|
|
457
|
+
.minTime=${e.minTime}
|
|
458
|
+
.maxTime=${e.maxTime}
|
|
459
|
+
.disabledTimeRanges=${e.disabledTimeRanges}
|
|
460
|
+
?allow-custom-time=${e.allowCustomTime}
|
|
461
|
+
.minTimeMessage=${e.minTimeMessage}
|
|
462
|
+
.maxTimeMessage=${e.maxTimeMessage}
|
|
463
|
+
.disabledTimeRangeMessage=${e.disabledTimeRangeMessage}
|
|
464
|
+
.noAvailableTimesMessage=${e.noAvailableTimesMessage}
|
|
465
|
+
@change=${this.valueChanged}
|
|
466
|
+
@inputError=${this.onInputError}
|
|
467
|
+
@blur=${()=>this.adapter.onBlur()}
|
|
468
|
+
></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`
|
|
470
|
+
${this.renderStrip()} ${this.bubble?this.renderCompact(e):l.nothing}
|
|
471
|
+
${this.bubble&&this._showDropdown?this.renderDropdown():l.nothing}
|
|
472
|
+
`}renderStrip(){return l.html`
|
|
473
|
+
<div
|
|
474
|
+
class=${w.classMap({"gui-pills__strip-wrapper":!0,"gui-pills--start-shadow":!this._isStartVisible,"gui-pills--end-shadow":!this._isEndVisible})}
|
|
237
475
|
>
|
|
238
476
|
<div class="gui-pills__strip" role="list" tabindex="-1">
|
|
239
477
|
<span class="gui-sentinel gui-sentinel__start"></span>
|
|
240
|
-
${
|
|
478
|
+
${hr.repeat(this.items,e=>e.key,(e,t)=>this.renderPill(e,t,!1))}
|
|
241
479
|
<span class="gui-sentinel gui-sentinel__end"></span>
|
|
242
480
|
</div>
|
|
243
481
|
</div>
|
|
244
|
-
`}renderCompact(e){return
|
|
482
|
+
`}renderCompact(e){return l.html`
|
|
245
483
|
<div class="gui-pills__compact">
|
|
246
484
|
<button
|
|
247
485
|
type="button"
|
|
@@ -254,39 +492,40 @@
|
|
|
254
492
|
${e}
|
|
255
493
|
</button>
|
|
256
494
|
</div>
|
|
257
|
-
`}renderDropdown(){return
|
|
495
|
+
`}renderDropdown(){return l.html`
|
|
258
496
|
<div class="gui-pills__dropdown" role="list">
|
|
259
|
-
${
|
|
497
|
+
${hr.repeat(this.items,e=>`dd-${e.key}`,(e,t)=>this.renderPill(e,t,!0))}
|
|
260
498
|
</div>
|
|
261
|
-
`}renderPill(e,t,i){const
|
|
499
|
+
`}renderPill(e,t,i){const a=e.ariaLabel??`${this.removeAriaLabel}: ${e.label}`,r=this.clickable&&!this.disabled&&!this.readOnly;return l.html`
|
|
262
500
|
<div
|
|
263
|
-
class=${
|
|
501
|
+
class=${w.classMap({"gui-pills__pill":!0,"gui-pills__pill--clickable":r})}
|
|
264
502
|
role="listitem"
|
|
265
503
|
data-key=${e.key}
|
|
266
504
|
data-index=${t}
|
|
267
505
|
data-in-dropdown=${i}
|
|
268
506
|
tabindex=${this.tabbable&&!this.disabled&&!this.readOnly?0:-1}
|
|
269
|
-
aria-label=${
|
|
270
|
-
@click=${
|
|
507
|
+
aria-label=${a}
|
|
508
|
+
@click=${s=>this.onPillClick(s,e)}
|
|
271
509
|
@focus=${this.handlePillFocus}
|
|
272
|
-
@keydown=${
|
|
510
|
+
@keydown=${s=>this.onPillKeydown(s,e,t)}
|
|
273
511
|
>
|
|
274
512
|
<span class="gui-pills__pill-text">${e.label}</span>
|
|
275
|
-
${this.removable?this.renderRemoveButton(e):
|
|
513
|
+
${this.removable?this.renderRemoveButton(e):l.nothing}
|
|
276
514
|
</div>
|
|
277
|
-
`}renderRemoveButton(e){return
|
|
515
|
+
`}renderRemoveButton(e){return l.html`
|
|
278
516
|
<button
|
|
279
517
|
type="button"
|
|
280
518
|
class="gui-pills__pill-remove"
|
|
281
519
|
tabindex="-1"
|
|
282
520
|
aria-hidden="true"
|
|
283
521
|
?disabled=${this.disabled||this.readOnly}
|
|
522
|
+
@mousedown=${t=>{t.stopPropagation(),t.preventDefault()}}
|
|
284
523
|
@click=${t=>{t.stopPropagation(),this.emitRemove(e.key,this.items.indexOf(e))}}
|
|
285
524
|
>
|
|
286
|
-
${this.removeIcon?
|
|
525
|
+
${this.removeIcon?l.html`<span
|
|
287
526
|
class=${`gui-widget-icon ${this.removeIcon}`}
|
|
288
527
|
data-icon=${this.removeIcon}
|
|
289
|
-
></span>`:
|
|
528
|
+
></span>`:l.html`<svg
|
|
290
529
|
xmlns="http://www.w3.org/2000/svg"
|
|
291
530
|
width="16"
|
|
292
531
|
height="16"
|
|
@@ -299,23 +538,23 @@
|
|
|
299
538
|
></path>
|
|
300
539
|
</svg>`}
|
|
301
540
|
</button>
|
|
302
|
-
`}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
|
|
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`
|
|
303
542
|
<button
|
|
304
543
|
type="button"
|
|
305
544
|
role="gridcell"
|
|
306
|
-
class=${
|
|
545
|
+
class=${w.classMap(i)}
|
|
307
546
|
tabindex=${e.isFocusable?0:-1}
|
|
308
547
|
?disabled=${!e.isCurrentMonth||e.isDisabled}
|
|
309
|
-
data-date=${e.date
|
|
310
|
-
@click=${
|
|
548
|
+
data-date=${Q(e.date)}
|
|
549
|
+
@click=${a=>this.selectDate(e,a)}
|
|
311
550
|
@mouseover=${()=>this.onMouseOver(e)}
|
|
312
551
|
@focus=${()=>this.onMouseOver(e)}
|
|
313
|
-
@keydown=${
|
|
552
|
+
@keydown=${a=>this._keyboard.handleDayKeydown(a)}
|
|
314
553
|
aria-selected=${e.isRangeStart||e.isRangeEnd||e.isInRange?"true":"false"}
|
|
315
554
|
>
|
|
316
|
-
${e
|
|
555
|
+
${this.renderDayContent(e)}
|
|
317
556
|
</button>
|
|
318
|
-
`}getDaysInMonth(e){const t=
|
|
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`
|
|
319
558
|
<gui-pills
|
|
320
559
|
class="gui-range-calendar__pills"
|
|
321
560
|
.items=${t}
|
|
@@ -328,7 +567,7 @@
|
|
|
328
567
|
@pillremove=${this.onPillRemoveEvent}
|
|
329
568
|
@pillclick=${this.onPillClickEvent}
|
|
330
569
|
></gui-pills>
|
|
331
|
-
`}
|
|
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`
|
|
332
571
|
<gui-range-calendar
|
|
333
572
|
.uid=${this.widget.uid}
|
|
334
573
|
.label=${this.adapter.templateData.label}
|
|
@@ -349,87 +588,65 @@
|
|
|
349
588
|
.minDate=${this.adapter.templateData.minDate}
|
|
350
589
|
.maxDate=${this.adapter.templateData.maxDate}
|
|
351
590
|
.disabledRanges=${this.adapter.templateData.disabledRanges}
|
|
591
|
+
.disabledDateRangeMessage=${this.adapter.templateData.disabledDateRangeMessage}
|
|
352
592
|
.numberOfMonths=${this.adapter.templateData.numberOfMonths}
|
|
353
593
|
.hidePills=${!1}
|
|
354
594
|
.removePillAriaLabel=${this.adapter.templateData.removePillAriaLabel}
|
|
355
595
|
.localeId=${this.adapter.templateData.lang}
|
|
356
596
|
@change=${this.valueChanged}
|
|
597
|
+
@inputError=${this.onInputError}
|
|
357
598
|
@blur=${()=>this.adapter.onBlur()}
|
|
358
599
|
></gui-range-calendar>
|
|
359
|
-
`}valueChanged(e){
|
|
360
|
-
${this.label?se(this.uid,e,!1,void 0,!1):
|
|
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}
|
|
361
602
|
|
|
362
603
|
<div class="gui-widget">
|
|
363
604
|
<div
|
|
364
|
-
class="gui-widget-input gui-range-date-input ${this.icon?"gui-range-date-input--icon":""}"
|
|
605
|
+
class="gui-widget-input gui-parts-ring gui-range-date-input ${this.icon?"gui-range-date-input--icon":""}"
|
|
365
606
|
role="group"
|
|
366
607
|
aria-label=${this.label??"Date range input"}
|
|
367
608
|
>
|
|
368
|
-
${this.icon?
|
|
609
|
+
${this.icon?l.html`<span class=${w.classMap(a)} data-icon=${this.icon}></span>`:l.nothing}
|
|
369
610
|
|
|
370
611
|
<gui-pills
|
|
371
612
|
class="gui-range-date-input__pills"
|
|
372
|
-
style=${
|
|
373
|
-
.items=${
|
|
613
|
+
style=${bt.styleMap(i.length?{}:{"min-width":0})}
|
|
614
|
+
.items=${i}
|
|
374
615
|
.removable=${!0}
|
|
375
616
|
.clickable=${!0}
|
|
376
617
|
.bubble=${!0}
|
|
377
618
|
?disabled=${this.disabled}
|
|
378
619
|
?readonly=${this.readOnly}
|
|
379
620
|
.removeAriaLabel=${this.removePillAriaLabel??"Remove date"}
|
|
380
|
-
.compactAriaLabel=${`${
|
|
621
|
+
.compactAriaLabel=${`${i.length} date ranges`}
|
|
381
622
|
@pillremove=${this.onPillRemoveEvent}
|
|
382
623
|
@pillclick=${this.onPillClickEvent}
|
|
383
624
|
></gui-pills>
|
|
384
625
|
|
|
385
626
|
<div class="gui-range-date-input__inputs">
|
|
386
627
|
<div
|
|
387
|
-
class="gui-range-date-input__field"
|
|
628
|
+
class="gui-parts gui-range-date-input__field"
|
|
388
629
|
role="group"
|
|
389
630
|
aria-label=${this.startDateAriaLabel??"Start date"}
|
|
390
631
|
>
|
|
391
|
-
${
|
|
632
|
+
${mt("start",t,this._parts)}
|
|
392
633
|
</div>
|
|
393
634
|
|
|
394
635
|
<span class="gui-range-date-input__separator">${this.separator??"-"}</span>
|
|
395
636
|
|
|
396
637
|
<div
|
|
397
|
-
class="gui-range-date-input__field"
|
|
638
|
+
class="gui-parts gui-range-date-input__field"
|
|
398
639
|
role="group"
|
|
399
640
|
aria-label=${this.endDateAriaLabel??"End date"}
|
|
400
641
|
>
|
|
401
|
-
${
|
|
642
|
+
${mt("end",t,this._parts)}
|
|
402
643
|
</div>
|
|
403
644
|
</div>
|
|
404
645
|
</div>
|
|
405
646
|
|
|
406
|
-
${this.showErrors&&this.errors?.length?
|
|
647
|
+
${this.showErrors&&this.errors?.length?W(this.uid,e):l.nothing}
|
|
407
648
|
</div>
|
|
408
|
-
`}
|
|
409
|
-
<div class="gui-range-date-input__touch-target">
|
|
410
|
-
<input
|
|
411
|
-
type="text"
|
|
412
|
-
inputmode="numeric"
|
|
413
|
-
class="gui-range-date-input__part ${t==="year"?"gui-range-date-input__year":""}"
|
|
414
|
-
data-type=${t}
|
|
415
|
-
data-group=${e}
|
|
416
|
-
maxlength=${s}
|
|
417
|
-
placeholder=${i}
|
|
418
|
-
tabindex=${a}
|
|
419
|
-
?required=${this.required}
|
|
420
|
-
?disabled=${this.disabled}
|
|
421
|
-
?readonly=${this.readOnly}
|
|
422
|
-
autocomplete="off"
|
|
423
|
-
.value=${Oi.live(n)}
|
|
424
|
-
@keydown=${this.handleKeyDown}
|
|
425
|
-
@keyup=${r=>this.handleKeyUp(r,e,t)}
|
|
426
|
-
@focus=${this.handleFocus}
|
|
427
|
-
@blur=${r=>this.handleBlur(r,e,t)}
|
|
428
|
-
@change=${r=>this.handleChange(r,e,t)}
|
|
429
|
-
/>
|
|
430
|
-
<div class="gui-range-date-input__visual-underline"></div>
|
|
431
|
-
</div>
|
|
432
|
-
`}formatDateForDisplay(e){const t=new Date(e);return isNaN(t.getTime())?e:new Intl.DateTimeFormat(this.localeId??"en",{year:"numeric",month:"2-digit",day:"2-digit"}).format(t)}getSortedPills(){return!this.value||!Array.isArray(this.value)?[]:[...this.value].sort((e,t)=>new Date(e.start).getTime()-new Date(t.start).getTime())}onPillClick(e){this.dispatchEvent(new CustomEvent("pillClick",{detail:{range:e},bubbles:!0,composed:!0}))}handleKeyDown(e){["Backspace","Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Delete","Enter"].includes(e.key)||e.ctrlKey||e.metaKey||this.readOnly||/^[0-9]$/.test(e.key)||e.preventDefault()}handleFocus(e){this.dispatchEvent(new CustomEvent("focus",{detail:e}))}handleKeyUp(e,t,i){if(this.readOnly)return;const s=window.getComputedStyle(this).direction==="rtl",a=e.target,n=this.getGroupInputs(t),r=n.indexOf(a);if(a.value.length===a.maxLength&&/^[0-9]$/.test(e.key))if(r===n.length-1){if(t==="start"){const l=this.getGroupInputs("end");l.length>0&&l[0].focus()}}else n[r+1].focus();switch(e.key){case"Enter":{if(this.tryCreatePill(),this.value&&this.value.length>0){const l=this.value[this.value.length-1];this.onPillClick(l)}break}case"ArrowUp":{const l=isNaN(parseInt(a.value,10)+1)?1:parseInt(a.value,10)+1;this.setDatePartValue(t,i,l),a.select(),this.tryCreatePill();break}case"ArrowDown":{const l=isNaN(parseInt(a.value,10)-1)?1:parseInt(a.value,10)-1;this.setDatePartValue(t,i,l),a.select(),this.tryCreatePill();break}case"ArrowLeft":{const l=s?r+1:r-1;if(l>=0&&l<n.length)n[l].focus(),n[l].select();else{const u=s?"end":"start";if(t!==u){const p=this.getGroupInputs(u);if(p.length>0){const c=p[p.length-1];c.focus(),c.select()}}}break}case"ArrowRight":{const l=s?r-1:r+1;if(l>=0&&l<n.length)n[l].focus(),n[l].select();else{const u=s?"start":"end";if(t!==u){const p=this.getGroupInputs(u);p.length>0&&(p[0].focus(),p[0].select())}}break}}}handleChange(e,t,i){if(e.stopImmediatePropagation(),this.readOnly)return;const a=e.target.value.replace(/[^0-9]/g,"");this.updateDatePart(t,i,a),this.tryCreatePill()}handleBlur(e,t,i){const s=e.target,a=parseInt(s.value,10);if(!isNaN(a)&&a>0){const n=i==="year"?4:2;s.value=a.toString().padStart(n,"0")}this.dispatchEvent(new CustomEvent("blur"))}getGroupInputs(e){return Array.from(this.querySelectorAll(`input[data-group="${e}"]`))}setDatePartValue(e,t,i){const s=e==="start"?this._startDate:this._endDate,a=t==="year"?4:2;t==="day"&&(s.day=i.toString().padStart(a,"0")),t==="month"&&(s.month=i.toString().padStart(a,"0")),t==="year"&&(s.year=i.toString().padStart(a,"0")),e==="start"?this._startDate={...s}:this._endDate={...s}}updateDatePart(e,t,i){e==="start"?this._startDate={...this._startDate,[t]:i}:this._endDate={...this._endDate,[t]:i}}validateDateParts(e){let t=parseInt(e.year,10),i=parseInt(e.month,10),s=parseInt(e.day,10);if(isNaN(t)||isNaN(i)||isNaN(s)||String(t).length<4)return null;t=Math.max(this.MIN_YEAR,Math.min(this.MAX_YEAR,t)),i=Math.max(this.MIN_MONTH,Math.min(this.MAX_MONTH,i)),s=Math.max(this.MIN_DAY,Math.min(this.MAX_DAY,s));const a=this.MAX_VALID_DAY(i,t);return s>a?(this.dispatchEvent(new CustomEvent("inputError",{detail:{message:"Invalid date: day is greater than the maximum valid day for the month and year."},bubbles:!0})),null):new Date(t,i-1,s)}tryCreatePill(){const e=this.validateDateParts(this._startDate),t=this.validateDateParts(this._endDate);if(!e||!t)return;let i=e,s=t;t.getTime()<e.getTime()&&(i=t,s=e);const a=Pe(i),n=Pe(s),r=a===n?{start:a}:{start:a,end:n},l=this.value?[...this.value]:[];l.push(r),this.value=Ta(l),this._startDate={day:"",month:"",year:""},this._endDate={day:"",month:"",year:""},this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),requestAnimationFrame(()=>{const u=this.getGroupInputs("start");u.length>0&&u[0].focus()}),this.requestUpdate()}};N([o.property({type:String})],I.prototype,"uid",2),N([o.property({type:String})],I.prototype,"label",2),N([o.property({type:String,attribute:"locale-id"})],I.prototype,"localeId",2),N([o.property({type:Array})],I.prototype,"errors",2),N([o.property({type:Boolean})],I.prototype,"showErrors",2),N([o.property({type:Boolean})],I.prototype,"touched",2),N([o.property({type:Boolean})],I.prototype,"required",2),N([o.property({type:Boolean})],I.prototype,"disabled",2),N([o.property({type:Boolean,attribute:"readonly"})],I.prototype,"readOnly",2),N([o.property({type:Array})],I.prototype,"value",2),N([o.property({type:String})],I.prototype,"hint",2),N([o.property({type:String})],I.prototype,"icon",2),N([o.property({type:String})],I.prototype,"removePillAriaLabel",2),N([o.property({type:String})],I.prototype,"startDateAriaLabel",2),N([o.property({type:String})],I.prototype,"endDateAriaLabel",2),N([o.property({type:String})],I.prototype,"separator",2),N([o.state()],I.prototype,"_startDate",2),N([o.state()],I.prototype,"_endDate",2),I=N([o.customElement("gui-range-date")],I),typeof customElements<"u"&&!customElements.get("gui-range-date")&&customElements.define("gui-range-date",I);var Sl=Object.defineProperty,El=Object.getOwnPropertyDescriptor,oi=(e,t,i,s)=>{for(var a=s>1?void 0:s?El(t,i):t,n=e.length-1,r;n>=0;n--)(r=e[n])&&(a=(s?r(t,i,a):r(a))||a);return s&&a&&Sl(t,i,a),a};let rt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new h.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(),d.html`
|
|
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`
|
|
433
650
|
<gui-range-date
|
|
434
651
|
.uid=${this.widget.uid}
|
|
435
652
|
.label=${this.adapter.templateData.label}
|
|
@@ -442,6 +659,7 @@
|
|
|
442
659
|
?readonly=${this.adapter.templateData.readonly}
|
|
443
660
|
.value=${this.adapter.templateData.value}
|
|
444
661
|
.localeId=${this.adapter.templateData.lang}
|
|
662
|
+
.invalidDateMessage=${this.adapter.templateData.invalidDateMessage}
|
|
445
663
|
.separator=${this.adapter.templateData.separator}
|
|
446
664
|
.removePillAriaLabel=${this.adapter.templateData.removePillAriaLabel}
|
|
447
665
|
.startDateAriaLabel=${this.adapter.templateData.startDateAriaLabel}
|
|
@@ -449,64 +667,486 @@
|
|
|
449
667
|
@change=${this.valueChanged}
|
|
450
668
|
@inputError=${this.onInputError}
|
|
451
669
|
></gui-range-date>
|
|
452
|
-
`}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())}};
|
|
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}
|
|
672
|
+
|
|
673
|
+
<div class="gui-widget">
|
|
674
|
+
<div
|
|
675
|
+
class="gui-widget-input gui-parts-ring gui-range-time-input ${this.icon?"gui-range-time-input--icon":""}"
|
|
676
|
+
role="group"
|
|
677
|
+
aria-label=${this.label??"Time range input"}
|
|
678
|
+
>
|
|
679
|
+
${this.icon?l.html`<span class=${w.classMap(a)} data-icon=${this.icon}></span>`:l.nothing}
|
|
680
|
+
|
|
681
|
+
<gui-pills
|
|
682
|
+
class="gui-range-time-input__pills"
|
|
683
|
+
style=${bt.styleMap(i.length?{}:{"min-width":0})}
|
|
684
|
+
.items=${i}
|
|
685
|
+
.removable=${!0}
|
|
686
|
+
.clickable=${!0}
|
|
687
|
+
.bubble=${!0}
|
|
688
|
+
?disabled=${this.disabled}
|
|
689
|
+
?readonly=${this.readOnly}
|
|
690
|
+
.removeAriaLabel=${this.removePillAriaLabel??"Remove time"}
|
|
691
|
+
.compactAriaLabel=${`${i.length} time ranges`}
|
|
692
|
+
@pillremove=${this.onPillRemoveEvent}
|
|
693
|
+
@pillclick=${this.onPillClickEvent}
|
|
694
|
+
></gui-pills>
|
|
695
|
+
|
|
696
|
+
<div class="gui-range-time-input__inputs">
|
|
697
|
+
<div
|
|
698
|
+
class="gui-parts gui-range-time-input__field"
|
|
699
|
+
role="group"
|
|
700
|
+
aria-label=${this.startTimeAriaLabel??"Start time"}
|
|
701
|
+
>
|
|
702
|
+
${mt("start",t,this._parts)}
|
|
703
|
+
</div>
|
|
704
|
+
|
|
705
|
+
<span class="gui-range-time-input__separator">${this.separator??"-"}</span>
|
|
706
|
+
|
|
707
|
+
<div
|
|
708
|
+
class="gui-parts gui-range-time-input__field"
|
|
709
|
+
role="group"
|
|
710
|
+
aria-label=${this.endTimeAriaLabel??"End time"}
|
|
711
|
+
>
|
|
712
|
+
${mt("end",t,this._parts)}
|
|
713
|
+
</div>
|
|
714
|
+
</div>
|
|
715
|
+
</div>
|
|
716
|
+
|
|
717
|
+
${this.showErrors&&this.errors?.length?W(this.uid,e):l.nothing}
|
|
718
|
+
</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`
|
|
720
|
+
<gui-range-time
|
|
721
|
+
.uid=${this.widget.uid}
|
|
722
|
+
.label=${this.adapter.templateData.label}
|
|
723
|
+
.hint=${this.adapter.templateData.hint}
|
|
724
|
+
.icon=${this.adapter.templateData.icon}
|
|
725
|
+
.errors=${this.adapter.templateData.errors}
|
|
726
|
+
?touched=${this.adapter.templateData.touched}
|
|
727
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
728
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
729
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
730
|
+
.value=${this.adapter.templateData.value}
|
|
731
|
+
.localeId=${this.adapter.templateData.lang}
|
|
732
|
+
.separator=${this.adapter.templateData.separator}
|
|
733
|
+
.removePillAriaLabel=${this.adapter.templateData.removePillAriaLabel}
|
|
734
|
+
.startTimeAriaLabel=${this.adapter.templateData.startTimeAriaLabel}
|
|
735
|
+
.endTimeAriaLabel=${this.adapter.templateData.endTimeAriaLabel}
|
|
736
|
+
.hourFormat=${this.adapter.templateData.hourFormat}
|
|
737
|
+
.minuteStep=${this.adapter.templateData.minuteStep}
|
|
738
|
+
.minTime=${this.adapter.templateData.minTime}
|
|
739
|
+
.maxTime=${this.adapter.templateData.maxTime}
|
|
740
|
+
.minTimeMessage=${this.adapter.templateData.minTimeMessage}
|
|
741
|
+
.maxTimeMessage=${this.adapter.templateData.maxTimeMessage}
|
|
742
|
+
.rangeOrderMessage=${this.adapter.templateData.rangeOrderMessage}
|
|
743
|
+
@change=${this.valueChanged}
|
|
744
|
+
@inputError=${this.onInputError}
|
|
745
|
+
></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}
|
|
748
|
+
|
|
749
|
+
<div class="gui-widget">
|
|
750
|
+
<div
|
|
751
|
+
class="gui-widget-input gui-parts-ring gui-range-date-time-input ${this.icon?"gui-range-date-time-input--icon":""}"
|
|
752
|
+
role="group"
|
|
753
|
+
aria-label=${this.label??"Date-time range input"}
|
|
754
|
+
>
|
|
755
|
+
${this.icon?l.html`<span class=${w.classMap(a)} data-icon=${this.icon}></span>`:l.nothing}
|
|
756
|
+
|
|
757
|
+
<gui-pills
|
|
758
|
+
class="gui-range-date-time-input__pills"
|
|
759
|
+
style=${bt.styleMap(i.length?{}:{"min-width":0})}
|
|
760
|
+
.items=${i}
|
|
761
|
+
.removable=${!0}
|
|
762
|
+
.clickable=${!0}
|
|
763
|
+
.bubble=${!0}
|
|
764
|
+
?disabled=${this.disabled}
|
|
765
|
+
?readonly=${this.readOnly}
|
|
766
|
+
.removeAriaLabel=${this.removePillAriaLabel??"Remove date-time"}
|
|
767
|
+
.compactAriaLabel=${`${i.length} date-time ranges`}
|
|
768
|
+
@pillremove=${this.onPillRemoveEvent}
|
|
769
|
+
@pillclick=${this.onPillClickEvent}
|
|
770
|
+
></gui-pills>
|
|
771
|
+
|
|
772
|
+
<div class="gui-range-date-time-input__inputs">
|
|
773
|
+
<div
|
|
774
|
+
class="gui-parts gui-range-date-time-input__field"
|
|
775
|
+
role="group"
|
|
776
|
+
aria-label=${this.startDateTimeAriaLabel??"Start date-time"}
|
|
777
|
+
>
|
|
778
|
+
${mt("start",t,this._parts)}
|
|
779
|
+
</div>
|
|
780
|
+
|
|
781
|
+
<span class="gui-range-date-time-input__separator">${this.separator??"-"}</span>
|
|
782
|
+
|
|
783
|
+
<div
|
|
784
|
+
class="gui-parts gui-range-date-time-input__field"
|
|
785
|
+
role="group"
|
|
786
|
+
aria-label=${this.endDateTimeAriaLabel??"End date-time"}
|
|
787
|
+
>
|
|
788
|
+
${mt("end",t,this._parts)}
|
|
789
|
+
</div>
|
|
790
|
+
</div>
|
|
791
|
+
</div>
|
|
792
|
+
|
|
793
|
+
${this.showErrors&&this.errors?.length?W(this.uid,e):l.nothing}
|
|
794
|
+
</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`
|
|
796
|
+
<gui-range-date-time
|
|
797
|
+
.uid=${this.widget.uid}
|
|
798
|
+
.label=${this.adapter.templateData.label}
|
|
799
|
+
.hint=${this.adapter.templateData.hint}
|
|
800
|
+
.icon=${this.adapter.templateData.icon}
|
|
801
|
+
.errors=${this.adapter.templateData.errors}
|
|
802
|
+
?touched=${this.adapter.templateData.touched}
|
|
803
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
804
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
805
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
806
|
+
.value=${this.adapter.templateData.value}
|
|
807
|
+
.localeId=${this.adapter.templateData.lang}
|
|
808
|
+
.separator=${this.adapter.templateData.separator}
|
|
809
|
+
.removePillAriaLabel=${this.adapter.templateData.removePillAriaLabel}
|
|
810
|
+
.startDateTimeAriaLabel=${this.adapter.templateData.startDateTimeAriaLabel}
|
|
811
|
+
.endDateTimeAriaLabel=${this.adapter.templateData.endDateTimeAriaLabel}
|
|
812
|
+
.hourFormat=${this.adapter.templateData.hourFormat}
|
|
813
|
+
.minuteStep=${this.adapter.templateData.minuteStep}
|
|
814
|
+
.minDateTime=${this.adapter.templateData.minDateTime}
|
|
815
|
+
.maxDateTime=${this.adapter.templateData.maxDateTime}
|
|
816
|
+
.invalidDateMessage=${this.adapter.templateData.invalidDateMessage}
|
|
817
|
+
.minDateTimeMessage=${this.adapter.templateData.minDateTimeMessage}
|
|
818
|
+
.maxDateTimeMessage=${this.adapter.templateData.maxDateTimeMessage}
|
|
819
|
+
@change=${this.valueChanged}
|
|
820
|
+
@inputError=${this.onInputError}
|
|
821
|
+
></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)}>
|
|
824
|
+
<div
|
|
825
|
+
class=${w.classMap({"gui-range-date-time-calendar__time-column":!0,"is-open":this._openList==="start"})}
|
|
826
|
+
>
|
|
827
|
+
<gui-time-picker
|
|
828
|
+
class="gui-time-picker gui-field gui-range-date-time-calendar__start"
|
|
829
|
+
.uid=${this.uid?`${this.uid}-start-time`:void 0}
|
|
830
|
+
.label=${this.startTimeLabel??"Start time"}
|
|
831
|
+
.showErrors=${!1}
|
|
832
|
+
?required=${this.required}
|
|
833
|
+
?disabled=${!t}
|
|
834
|
+
?readonly=${this.readOnly}
|
|
835
|
+
.allowCustomTime=${this.allowCustomTime}
|
|
836
|
+
.value=${this._workingTimeIn}
|
|
837
|
+
.localeId=${this.localeId}
|
|
838
|
+
.hourFormat=${this.hourFormat}
|
|
839
|
+
.minuteStep=${this.minuteStep}
|
|
840
|
+
.minTime=${a.minTime}
|
|
841
|
+
.maxTime=${a.maxTime}
|
|
842
|
+
.disabledRanges=${this.resolvedStartTimeRanges}
|
|
843
|
+
.columns=${4}
|
|
844
|
+
.disabledRangeMessage=${this.disabledRangeMessage}
|
|
845
|
+
.noAvailableTimesMessage=${this.noAvailableTimesMessage}
|
|
846
|
+
@change=${this.onStartTimeChange}
|
|
847
|
+
@listtoggle=${o=>this.onListToggle(o,"start")}
|
|
848
|
+
></gui-time-picker>
|
|
849
|
+
</div>
|
|
850
|
+
|
|
851
|
+
<div
|
|
852
|
+
class=${w.classMap({"gui-range-date-time-calendar__time-column":!0,"is-open":this._openList==="end"})}
|
|
853
|
+
>
|
|
854
|
+
<gui-time-picker
|
|
855
|
+
class="gui-time-picker gui-field gui-range-date-time-calendar__end"
|
|
856
|
+
.uid=${this.uid?`${this.uid}-end-time`:void 0}
|
|
857
|
+
.label=${this.endTimeLabel??"End time"}
|
|
858
|
+
.showErrors=${!1}
|
|
859
|
+
?required=${this.required}
|
|
860
|
+
?disabled=${!i}
|
|
861
|
+
?readonly=${this.readOnly}
|
|
862
|
+
.allowCustomTime=${this.allowCustomTime}
|
|
863
|
+
.value=${this._workingTimeOut}
|
|
864
|
+
.localeId=${this.localeId}
|
|
865
|
+
.hourFormat=${this.hourFormat}
|
|
866
|
+
.minuteStep=${this.minuteStep}
|
|
867
|
+
.minTime=${r.minTime}
|
|
868
|
+
.maxTime=${r.maxTime}
|
|
869
|
+
.disabledRanges=${this.resolvedEndTimeRanges}
|
|
870
|
+
.columns=${4}
|
|
871
|
+
.disabledRangeMessage=${this.disabledRangeMessage}
|
|
872
|
+
.noAvailableTimesMessage=${this.noAvailableTimesMessage}
|
|
873
|
+
@change=${this.onEndTimeChange}
|
|
874
|
+
@listtoggle=${o=>this.onListToggle(o,"end")}
|
|
875
|
+
></gui-time-picker>
|
|
876
|
+
</div>
|
|
877
|
+
</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`
|
|
879
|
+
<button
|
|
880
|
+
type="button"
|
|
881
|
+
role="gridcell"
|
|
882
|
+
class=${w.classMap(i)}
|
|
883
|
+
tabindex=${e.isFocusable?0:-1}
|
|
884
|
+
?disabled=${!e.isCurrentMonth||e.isDisabled}
|
|
885
|
+
data-date=${Q(e.date)}
|
|
886
|
+
@click=${a=>this.selectDate(e,a)}
|
|
887
|
+
@mouseover=${()=>this.onMouseOver(e)}
|
|
888
|
+
@focus=${()=>this.onMouseOver(e)}
|
|
889
|
+
@keydown=${a=>this._keyboard.handleDayKeydown(a)}
|
|
890
|
+
aria-selected=${e.isRangeStart||e.isRangeEnd||e.isInRange?"true":"false"}
|
|
891
|
+
>
|
|
892
|
+
${this.renderDayContent(e)}
|
|
893
|
+
</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"
|
|
895
|
+
>${t}${i}</span
|
|
896
|
+
>`}renderBadge(e,t,i,a){return l.html`<span class="gui-range-date-time-calendar__${e}" aria-label=${i}
|
|
897
|
+
>${t}</span
|
|
898
|
+
><span class="gui-range-date-time-calendar__badge-tooltip" aria-hidden="true"
|
|
899
|
+
>${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`
|
|
901
|
+
<gui-pills
|
|
902
|
+
class="gui-range-calendar__pills"
|
|
903
|
+
.items=${t}
|
|
904
|
+
.removable=${!0}
|
|
905
|
+
.clickable=${!0}
|
|
906
|
+
.bubble=${!1}
|
|
907
|
+
?disabled=${this.disabled}
|
|
908
|
+
?readonly=${this.readOnly}
|
|
909
|
+
.removeAriaLabel=${this.removePillAriaLabel??"Remove date"}
|
|
910
|
+
@pillremove=${this.onPillRemoveEvent}
|
|
911
|
+
@pillclick=${this.onPillClickEvent}
|
|
912
|
+
></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`
|
|
914
|
+
<gui-range-date-time-calendar
|
|
915
|
+
.uid=${this.widget.uid}
|
|
916
|
+
.label=${e.label}
|
|
917
|
+
.hint=${e.hint}
|
|
918
|
+
.errors=${e.errors}
|
|
919
|
+
?touched=${e.touched}
|
|
920
|
+
?required=${e.validator?.required}
|
|
921
|
+
?disabled=${e.disabled}
|
|
922
|
+
?readonly=${e.readonly}
|
|
923
|
+
.value=${e.value}
|
|
924
|
+
.prevMonthIcon=${e.prevMonthIcon}
|
|
925
|
+
.nextMonthIcon=${e.nextMonthIcon}
|
|
926
|
+
.prevMonthAriaLabel=${e.prevMonthAriaLabel}
|
|
927
|
+
.nextMonthAriaLabel=${e.nextMonthAriaLabel}
|
|
928
|
+
.dayFormat=${e.dayFormat}
|
|
929
|
+
.weekdayFormat=${e.weekdayFormat}
|
|
930
|
+
.monthFormat=${e.monthFormat}
|
|
931
|
+
.numberOfMonths=${e.numberOfMonths}
|
|
932
|
+
.removePillAriaLabel=${e.removePillAriaLabel}
|
|
933
|
+
.localeId=${e.lang}
|
|
934
|
+
.hourFormat=${e.hourFormat}
|
|
935
|
+
.minuteStep=${e.minuteStep}
|
|
936
|
+
?allow-custom-time=${e.allowCustomTime}
|
|
937
|
+
.startTimeLabel=${e.startTimeLabel}
|
|
938
|
+
.endTimeLabel=${e.endTimeLabel}
|
|
939
|
+
.minDateTime=${e.minDateTime}
|
|
940
|
+
.maxDateTime=${e.maxDateTime}
|
|
941
|
+
.disabledRanges=${e.disabledRanges}
|
|
942
|
+
.minDateTimeMessage=${e.minDateTimeMessage}
|
|
943
|
+
.maxDateTimeMessage=${e.maxDateTimeMessage}
|
|
944
|
+
.disabledRangeMessage=${e.disabledRangeMessage}
|
|
945
|
+
.noAvailableTimesMessage=${e.noAvailableTimesMessage}
|
|
946
|
+
.dayCountAriaLabel=${e.dayCountAriaLabel}
|
|
947
|
+
.disabledDayCountAriaLabel=${e.disabledDayCountAriaLabel}
|
|
948
|
+
@change=${this.valueChanged}
|
|
949
|
+
@inputError=${this.onInputError}
|
|
950
|
+
@blur=${()=>this.adapter.onBlur()}
|
|
951
|
+
></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
|
|
453
953
|
id="calendar-input"
|
|
454
|
-
.uid=${this.
|
|
455
|
-
.hint=${this.
|
|
456
|
-
?touched=${this.
|
|
457
|
-
?required=${this.
|
|
458
|
-
?disabled=${this.
|
|
459
|
-
?readonly=${this.
|
|
460
|
-
.value=${this.
|
|
461
|
-
.focusDate=${this.
|
|
462
|
-
.prevMonthIcon=${this.adapter.templateData.prevMonthIcon}
|
|
463
|
-
.nextMonthIcon=${this.adapter.templateData.nextMonthIcon}
|
|
464
|
-
.prevMonthAriaLabel=${this.adapter.templateData.prevMonthAriaLabel}
|
|
465
|
-
.nextMonthAriaLabel=${this.adapter.templateData.nextMonthAriaLabel}
|
|
466
|
-
.dayFormat=${this.adapter.templateData.dayFormat}
|
|
467
|
-
.weekdayFormat=${this.adapter.templateData.weekdayFormat}
|
|
468
|
-
.monthFormat=${this.adapter.templateData.monthFormat}
|
|
469
|
-
.minDate=${this.adapter.templateData.minDate}
|
|
470
|
-
.maxDate=${this.adapter.templateData.maxDate}
|
|
471
|
-
.disabledRanges=${this.adapter.templateData.disabledRanges}
|
|
472
|
-
.numberOfMonths=${this.adapter.templateData.numberOfMonths}
|
|
473
|
-
.localeId=${this.adapter.templateData.lang}
|
|
954
|
+
.uid=${this.uid}
|
|
955
|
+
.hint=${this.hint}
|
|
956
|
+
?touched=${this.touched}
|
|
957
|
+
?required=${this.required}
|
|
958
|
+
?disabled=${this.disabled}
|
|
959
|
+
?readonly=${this.readOnly}
|
|
960
|
+
.value=${this.value}
|
|
961
|
+
.focusDate=${this._focusDate}
|
|
474
962
|
.hidePills=${!0}
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
963
|
+
.localeId=${this.localeId}
|
|
964
|
+
.prevMonthIcon=${this.prevMonthIcon}
|
|
965
|
+
.nextMonthIcon=${this.nextMonthIcon}
|
|
966
|
+
.prevMonthAriaLabel=${this.prevMonthAriaLabel}
|
|
967
|
+
.nextMonthAriaLabel=${this.nextMonthAriaLabel}
|
|
968
|
+
.dayFormat=${this.dayFormat}
|
|
969
|
+
.weekdayFormat=${this.weekdayFormat}
|
|
970
|
+
.monthFormat=${this.monthFormat}
|
|
971
|
+
.numberOfMonths=${this.numberOfMonths}
|
|
972
|
+
.hourFormat=${this.hourFormat}
|
|
973
|
+
.minuteStep=${this.minuteStep}
|
|
974
|
+
.allowCustomTime=${this.allowCustomTime}
|
|
975
|
+
.startTimeLabel=${this.startTimeLabel}
|
|
976
|
+
.endTimeLabel=${this.endTimeLabel}
|
|
977
|
+
.minDateTime=${this.minDateTime}
|
|
978
|
+
.maxDateTime=${this.maxDateTime}
|
|
979
|
+
.minDateTimeMessage=${this.minDateTimeMessage}
|
|
980
|
+
.maxDateTimeMessage=${this.maxDateTimeMessage}
|
|
981
|
+
.disabledRanges=${this.disabledRanges}
|
|
982
|
+
.disabledRangeMessage=${this.disabledRangeMessage}
|
|
983
|
+
.noAvailableTimesMessage=${this.noAvailableTimesMessage}
|
|
984
|
+
.dayCountAriaLabel=${this.dayCountAriaLabel}
|
|
985
|
+
.disabledDayCountAriaLabel=${this.disabledDayCountAriaLabel}
|
|
986
|
+
@blur=${this.onCalendarBlur}
|
|
987
|
+
@change=${this.onCalendarChange}
|
|
988
|
+
@inputError=${this.onCalendarInputError}
|
|
989
|
+
></gui-range-date-time-calendar>`:l.nothing;return l.html`
|
|
990
|
+
${se(this.uid??"",{label:this.label,hint:this.hint,required:this.required})}
|
|
479
991
|
|
|
480
992
|
<div
|
|
481
993
|
role="button"
|
|
482
994
|
tabindex="-1"
|
|
483
995
|
class="gui-widget"
|
|
484
|
-
aria-expanded=${this.
|
|
485
|
-
@keyup=${
|
|
486
|
-
@
|
|
996
|
+
aria-expanded=${this._popup.open}
|
|
997
|
+
@keyup=${this._popup.onAnchorKeyUp}
|
|
998
|
+
@keydown=${this._popup.onAnchorKeyDown}
|
|
999
|
+
@click=${this._popup.onAnchorClick}
|
|
1000
|
+
>
|
|
1001
|
+
<gui-range-date-time
|
|
1002
|
+
id="date-input"
|
|
1003
|
+
class=${w.classMap(e.widgetClasses)}
|
|
1004
|
+
.uid=${this.uid}
|
|
1005
|
+
.hint=${this.hint}
|
|
1006
|
+
.showErrors=${!1}
|
|
1007
|
+
.errors=${this.errors}
|
|
1008
|
+
?touched=${this.touched}
|
|
1009
|
+
?required=${this.required}
|
|
1010
|
+
?disabled=${this.disabled}
|
|
1011
|
+
?readonly=${this.readOnly}
|
|
1012
|
+
.value=${this.value}
|
|
1013
|
+
.icon=${this.icon}
|
|
1014
|
+
.localeId=${this.localeId}
|
|
1015
|
+
.hourFormat=${this.hourFormat}
|
|
1016
|
+
.minuteStep=${this.minuteStep}
|
|
1017
|
+
.separator=${this.separator}
|
|
1018
|
+
.removePillAriaLabel=${this.removePillAriaLabel}
|
|
1019
|
+
.startDateTimeAriaLabel=${this.startDateTimeAriaLabel}
|
|
1020
|
+
.endDateTimeAriaLabel=${this.endDateTimeAriaLabel}
|
|
1021
|
+
.invalidDateMessage=${this.invalidDateMessage}
|
|
1022
|
+
.minDateTime=${this.minDateTime}
|
|
1023
|
+
.maxDateTime=${this.maxDateTime}
|
|
1024
|
+
.minDateTimeMessage=${this.minDateTimeMessage}
|
|
1025
|
+
.maxDateTimeMessage=${this.maxDateTimeMessage}
|
|
1026
|
+
.disabledRanges=${this.disabledRanges}
|
|
1027
|
+
.disabledRangeMessage=${this.disabledRangeMessage}
|
|
1028
|
+
@blur=${this.onDateBlur}
|
|
1029
|
+
@focus=${this._popup.show}
|
|
1030
|
+
@change=${this.onDateChange}
|
|
1031
|
+
@pillClick=${this.onPillClick}
|
|
1032
|
+
></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">
|
|
1035
|
+
<path
|
|
1036
|
+
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>
|
|
1039
|
+
|
|
1040
|
+
${t}
|
|
1041
|
+
</div>
|
|
1042
|
+
|
|
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`
|
|
1045
|
+
<gui-range-date-time-picker
|
|
1046
|
+
.uid=${this.widget.uid}
|
|
1047
|
+
.label=${e.label}
|
|
1048
|
+
.hint=${e.hint}
|
|
1049
|
+
.icon=${e.icon}
|
|
1050
|
+
.errors=${e.errors}
|
|
1051
|
+
?touched=${e.touched}
|
|
1052
|
+
?required=${e.validator?.required}
|
|
1053
|
+
?disabled=${e.disabled}
|
|
1054
|
+
?readonly=${e.readonly}
|
|
1055
|
+
.value=${e.value}
|
|
1056
|
+
.separator=${e.separator}
|
|
1057
|
+
.removePillAriaLabel=${e.removePillAriaLabel}
|
|
1058
|
+
.startDateTimeAriaLabel=${e.startDateTimeAriaLabel}
|
|
1059
|
+
.endDateTimeAriaLabel=${e.endDateTimeAriaLabel}
|
|
1060
|
+
.invalidDateMessage=${e.invalidDateMessage}
|
|
1061
|
+
.prevMonthIcon=${e.prevMonthIcon}
|
|
1062
|
+
.nextMonthIcon=${e.nextMonthIcon}
|
|
1063
|
+
.prevMonthAriaLabel=${e.prevMonthAriaLabel}
|
|
1064
|
+
.nextMonthAriaLabel=${e.nextMonthAriaLabel}
|
|
1065
|
+
.dayFormat=${e.dayFormat}
|
|
1066
|
+
.weekdayFormat=${e.weekdayFormat}
|
|
1067
|
+
.monthFormat=${e.monthFormat}
|
|
1068
|
+
.numberOfMonths=${e.numberOfMonths}
|
|
1069
|
+
.localeId=${e.lang}
|
|
1070
|
+
.hourFormat=${e.hourFormat}
|
|
1071
|
+
.minuteStep=${e.minuteStep}
|
|
1072
|
+
?allow-custom-time=${e.allowCustomTime}
|
|
1073
|
+
.startTimeLabel=${e.startTimeLabel}
|
|
1074
|
+
.endTimeLabel=${e.endTimeLabel}
|
|
1075
|
+
.minDateTime=${e.minDateTime}
|
|
1076
|
+
.maxDateTime=${e.maxDateTime}
|
|
1077
|
+
.disabledRanges=${e.disabledRanges}
|
|
1078
|
+
.minDateTimeMessage=${e.minDateTimeMessage}
|
|
1079
|
+
.maxDateTimeMessage=${e.maxDateTimeMessage}
|
|
1080
|
+
.disabledRangeMessage=${e.disabledRangeMessage}
|
|
1081
|
+
.noAvailableTimesMessage=${e.noAvailableTimesMessage}
|
|
1082
|
+
.dayCountAriaLabel=${e.dayCountAriaLabel}
|
|
1083
|
+
.disabledDayCountAriaLabel=${e.disabledDayCountAriaLabel}
|
|
1084
|
+
@change=${this.valueChanged}
|
|
1085
|
+
@inputError=${this.onInputError}
|
|
1086
|
+
@blur=${()=>this.adapter.onBlur()}
|
|
1087
|
+
></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"
|
|
1090
|
+
.uid=${this.uid}
|
|
1091
|
+
.hint=${this.hint}
|
|
1092
|
+
?touched=${this.touched}
|
|
1093
|
+
?required=${this.required}
|
|
1094
|
+
?disabled=${this.disabled}
|
|
1095
|
+
?readonly=${this.readOnly}
|
|
1096
|
+
.value=${this.value}
|
|
1097
|
+
.focusDate=${this._focusDate}
|
|
1098
|
+
.prevMonthIcon=${this.prevMonthIcon}
|
|
1099
|
+
.nextMonthIcon=${this.nextMonthIcon}
|
|
1100
|
+
.prevMonthAriaLabel=${this.prevMonthAriaLabel}
|
|
1101
|
+
.nextMonthAriaLabel=${this.nextMonthAriaLabel}
|
|
1102
|
+
.dayFormat=${this.dayFormat}
|
|
1103
|
+
.weekdayFormat=${this.weekdayFormat}
|
|
1104
|
+
.monthFormat=${this.monthFormat}
|
|
1105
|
+
.minDate=${this.minDate}
|
|
1106
|
+
.maxDate=${this.maxDate}
|
|
1107
|
+
.disabledRanges=${this.disabledRanges}
|
|
1108
|
+
.disabledDateRangeMessage=${this.disabledDateRangeMessage}
|
|
1109
|
+
.numberOfMonths=${this.numberOfMonths}
|
|
1110
|
+
.localeId=${this.localeId}
|
|
1111
|
+
.hidePills=${!0}
|
|
1112
|
+
.invalidRange=${this._invalidRange}
|
|
1113
|
+
@blur=${this.onCalendarBlur}
|
|
1114
|
+
@change=${this.onCalendarChange}
|
|
1115
|
+
@inputError=${this.onCalendarInputError}
|
|
1116
|
+
></gui-range-calendar>`:l.nothing;return l.html`
|
|
1117
|
+
${se(this.uid??"",{label:this.label,hint:this.hint,required:this.required})}
|
|
1118
|
+
|
|
1119
|
+
<div
|
|
1120
|
+
role="button"
|
|
1121
|
+
tabindex="-1"
|
|
1122
|
+
class="gui-widget"
|
|
1123
|
+
aria-expanded=${this._popup.open}
|
|
1124
|
+
@keyup=${this._popup.onAnchorKeyUp}
|
|
1125
|
+
@keydown=${this._popup.onAnchorKeyDown}
|
|
1126
|
+
@click=${this._popup.onAnchorClick}
|
|
487
1127
|
>
|
|
488
1128
|
<gui-range-date
|
|
489
1129
|
id="date-input"
|
|
490
|
-
class=${
|
|
491
|
-
.uid=${this.
|
|
492
|
-
.hint=${this.
|
|
1130
|
+
class=${w.classMap(e.widgetClasses)}
|
|
1131
|
+
.uid=${this.uid}
|
|
1132
|
+
.hint=${this.hint}
|
|
493
1133
|
.showErrors=${!1}
|
|
494
|
-
.errors=${this.
|
|
495
|
-
?touched=${this.
|
|
496
|
-
?required=${this.
|
|
497
|
-
?disabled=${this.
|
|
498
|
-
?readonly=${this.
|
|
499
|
-
.value=${this.
|
|
500
|
-
.icon=${this.
|
|
501
|
-
.localeId=${this.
|
|
502
|
-
.separator=${this.
|
|
503
|
-
.removePillAriaLabel=${this.
|
|
504
|
-
.startDateAriaLabel=${this.
|
|
505
|
-
.endDateAriaLabel=${this.
|
|
506
|
-
|
|
507
|
-
@blur=${
|
|
508
|
-
@focus=${this.
|
|
509
|
-
@change=${this.
|
|
1134
|
+
.errors=${this.errors}
|
|
1135
|
+
?touched=${this.touched}
|
|
1136
|
+
?required=${this.required}
|
|
1137
|
+
?disabled=${this.disabled}
|
|
1138
|
+
?readonly=${this.readOnly}
|
|
1139
|
+
.value=${this.value}
|
|
1140
|
+
.icon=${this.icon}
|
|
1141
|
+
.localeId=${this.localeId}
|
|
1142
|
+
.separator=${this.separator}
|
|
1143
|
+
.removePillAriaLabel=${this.removePillAriaLabel}
|
|
1144
|
+
.startDateAriaLabel=${this.startDateAriaLabel}
|
|
1145
|
+
.endDateAriaLabel=${this.endDateAriaLabel}
|
|
1146
|
+
.invalidDateMessage=${this.invalidDateMessage}
|
|
1147
|
+
@blur=${this.onDateBlur}
|
|
1148
|
+
@focus=${this._popup.show}
|
|
1149
|
+
@change=${this.onDateChange}
|
|
510
1150
|
@pillClick=${this.onPillClick}
|
|
511
1151
|
></gui-range-date>
|
|
512
1152
|
<span class="gui-range-date-picker__arrow"
|
|
@@ -519,8 +1159,180 @@
|
|
|
519
1159
|
${t}
|
|
520
1160
|
</div>
|
|
521
1161
|
|
|
522
|
-
${
|
|
523
|
-
`}
|
|
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`
|
|
1164
|
+
<gui-range-date-picker
|
|
1165
|
+
.uid=${this.widget.uid}
|
|
1166
|
+
.label=${e.label}
|
|
1167
|
+
.hint=${e.hint}
|
|
1168
|
+
.errors=${e.errors}
|
|
1169
|
+
?touched=${e.touched}
|
|
1170
|
+
?required=${e.validator?.required}
|
|
1171
|
+
?disabled=${e.disabled}
|
|
1172
|
+
?readonly=${e.readonly}
|
|
1173
|
+
.value=${e.value}
|
|
1174
|
+
.icon=${e.icon}
|
|
1175
|
+
.localeId=${e.lang}
|
|
1176
|
+
.separator=${e.separator}
|
|
1177
|
+
.removePillAriaLabel=${e.removePillAriaLabel}
|
|
1178
|
+
.startDateAriaLabel=${e.startDateAriaLabel}
|
|
1179
|
+
.endDateAriaLabel=${e.endDateAriaLabel}
|
|
1180
|
+
.prevMonthIcon=${e.prevMonthIcon}
|
|
1181
|
+
.nextMonthIcon=${e.nextMonthIcon}
|
|
1182
|
+
.prevMonthAriaLabel=${e.prevMonthAriaLabel}
|
|
1183
|
+
.nextMonthAriaLabel=${e.nextMonthAriaLabel}
|
|
1184
|
+
.dayFormat=${e.dayFormat}
|
|
1185
|
+
.weekdayFormat=${e.weekdayFormat}
|
|
1186
|
+
.monthFormat=${e.monthFormat}
|
|
1187
|
+
.minDate=${e.minDate}
|
|
1188
|
+
.maxDate=${e.maxDate}
|
|
1189
|
+
.disabledRanges=${e.disabledRanges}
|
|
1190
|
+
.numberOfMonths=${e.numberOfMonths}
|
|
1191
|
+
.invalidDateMessage=${e.invalidDateMessage}
|
|
1192
|
+
.minDateMessage=${e.minDateMessage}
|
|
1193
|
+
.maxDateMessage=${e.maxDateMessage}
|
|
1194
|
+
.disabledDateRangeMessage=${e.disabledDateRangeMessage}
|
|
1195
|
+
@inputError=${this.onInputError}
|
|
1196
|
+
@blur=${()=>this.adapter.onBlur()}
|
|
1197
|
+
@change=${this.valueChanged}
|
|
1198
|
+
></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">
|
|
1200
|
+
<div class="gui-range-time-picker__column">
|
|
1201
|
+
<span class="gui-range-time-picker__column-label">${i}</span>
|
|
1202
|
+
<gui-time-list
|
|
1203
|
+
class="gui-range-time-picker__list"
|
|
1204
|
+
.uid=${this.uid}
|
|
1205
|
+
.label=${i}
|
|
1206
|
+
.value=${this._workingIn}
|
|
1207
|
+
.localeId=${this.localeId}
|
|
1208
|
+
.hourFormat=${this.hourFormat}
|
|
1209
|
+
.minuteStep=${this.minuteStep}
|
|
1210
|
+
.minTime=${this.minTime}
|
|
1211
|
+
.maxTime=${this.maxTime}
|
|
1212
|
+
.disabledRanges=${this.disabledRanges}
|
|
1213
|
+
.height=${this.height}
|
|
1214
|
+
.itemHeight=${this.itemHeight}
|
|
1215
|
+
.noAvailableTimesMessage=${this.noAvailableTimesMessage}
|
|
1216
|
+
?readonly=${this.readOnly}
|
|
1217
|
+
@change=${this.onInListChange}
|
|
1218
|
+
></gui-time-list>
|
|
1219
|
+
</div>
|
|
1220
|
+
|
|
1221
|
+
<div class="gui-range-time-picker__column">
|
|
1222
|
+
<span class="gui-range-time-picker__column-label">${a}</span>
|
|
1223
|
+
<gui-time-list
|
|
1224
|
+
class="gui-range-time-picker__list"
|
|
1225
|
+
.uid=${this.uid}
|
|
1226
|
+
.label=${a}
|
|
1227
|
+
.value=${this._workingOut}
|
|
1228
|
+
.localeId=${this.localeId}
|
|
1229
|
+
.hourFormat=${this.hourFormat}
|
|
1230
|
+
.minuteStep=${this.minuteStep}
|
|
1231
|
+
.minTime=${t.minTime}
|
|
1232
|
+
.maxTime=${t.maxTime}
|
|
1233
|
+
.disabledRanges=${this.disabledRanges}
|
|
1234
|
+
.height=${this.height}
|
|
1235
|
+
.itemHeight=${this.itemHeight}
|
|
1236
|
+
.noAvailableTimesMessage=${this.noAvailableTimesMessage}
|
|
1237
|
+
?disabled=${!this._workingIn}
|
|
1238
|
+
?readonly=${this.readOnly}
|
|
1239
|
+
@change=${this.onOutListChange}
|
|
1240
|
+
></gui-time-list>
|
|
1241
|
+
</div>
|
|
1242
|
+
</div>`:l.nothing;return l.html`
|
|
1243
|
+
${se(this.uid??"",{label:this.label,hint:this.hint,required:this.required})}
|
|
1244
|
+
|
|
1245
|
+
<div
|
|
1246
|
+
role="button"
|
|
1247
|
+
tabindex="-1"
|
|
1248
|
+
class="gui-widget"
|
|
1249
|
+
aria-expanded=${this._popup.open}
|
|
1250
|
+
@keyup=${this._popup.onAnchorKeyUp}
|
|
1251
|
+
@keydown=${this._popup.onAnchorKeyDown}
|
|
1252
|
+
@click=${this._popup.onAnchorClick}
|
|
1253
|
+
>
|
|
1254
|
+
<gui-range-time
|
|
1255
|
+
id="time-input"
|
|
1256
|
+
class=${w.classMap(e.widgetClasses)}
|
|
1257
|
+
.uid=${this.uid}
|
|
1258
|
+
.hint=${this.hint}
|
|
1259
|
+
.showErrors=${!1}
|
|
1260
|
+
.errors=${this.errors}
|
|
1261
|
+
?touched=${this.touched}
|
|
1262
|
+
?required=${this.required}
|
|
1263
|
+
?disabled=${this.disabled}
|
|
1264
|
+
?readonly=${this.readOnly}
|
|
1265
|
+
.allowCustomTime=${this.allowCustomTime??!1}
|
|
1266
|
+
.value=${this.value}
|
|
1267
|
+
.icon=${this.icon}
|
|
1268
|
+
.localeId=${this.localeId}
|
|
1269
|
+
.separator=${this.separator}
|
|
1270
|
+
.hourFormat=${this.hourFormat}
|
|
1271
|
+
.minuteStep=${this.minuteStep}
|
|
1272
|
+
.minTime=${this.minTime}
|
|
1273
|
+
.maxTime=${this.maxTime}
|
|
1274
|
+
.disabledRanges=${this.disabledRanges}
|
|
1275
|
+
.minTimeMessage=${this.minTimeMessage}
|
|
1276
|
+
.maxTimeMessage=${this.maxTimeMessage}
|
|
1277
|
+
.rangeOrderMessage=${this.rangeOrderMessage}
|
|
1278
|
+
.disabledRangeMessage=${this.disabledRangeMessage}
|
|
1279
|
+
.removePillAriaLabel=${this.removePillAriaLabel}
|
|
1280
|
+
.startTimeAriaLabel=${this.startTimeAriaLabel}
|
|
1281
|
+
.endTimeAriaLabel=${this.endTimeAriaLabel}
|
|
1282
|
+
@blur=${this.onInputBlur}
|
|
1283
|
+
@focus=${this._popup.show}
|
|
1284
|
+
@change=${this.onInputChange}
|
|
1285
|
+
@partsChange=${this.onPartsChange}
|
|
1286
|
+
@pillClick=${this.onPillClick}
|
|
1287
|
+
></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">
|
|
1290
|
+
<path
|
|
1291
|
+
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>
|
|
1294
|
+
|
|
1295
|
+
${r}
|
|
1296
|
+
</div>
|
|
1297
|
+
|
|
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`
|
|
1300
|
+
<gui-range-time-picker
|
|
1301
|
+
.uid=${this.widget.uid}
|
|
1302
|
+
.label=${e.label}
|
|
1303
|
+
.hint=${e.hint}
|
|
1304
|
+
.errors=${e.errors}
|
|
1305
|
+
?touched=${e.touched}
|
|
1306
|
+
?required=${e.validator?.required}
|
|
1307
|
+
?disabled=${e.disabled}
|
|
1308
|
+
?readonly=${e.readonly}
|
|
1309
|
+
.value=${e.value}
|
|
1310
|
+
.icon=${e.icon}
|
|
1311
|
+
.localeId=${e.lang}
|
|
1312
|
+
.separator=${e.separator}
|
|
1313
|
+
.removePillAriaLabel=${e.removePillAriaLabel}
|
|
1314
|
+
.startTimeAriaLabel=${e.startTimeAriaLabel}
|
|
1315
|
+
.endTimeAriaLabel=${e.endTimeAriaLabel}
|
|
1316
|
+
.startTimeLabel=${e.startTimeLabel}
|
|
1317
|
+
.endTimeLabel=${e.endTimeLabel}
|
|
1318
|
+
.hourFormat=${e.hourFormat}
|
|
1319
|
+
.minuteStep=${e.minuteStep}
|
|
1320
|
+
.minTime=${e.minTime}
|
|
1321
|
+
.maxTime=${e.maxTime}
|
|
1322
|
+
.disabledRanges=${e.disabledRanges}
|
|
1323
|
+
?allow-custom-time=${e.allowCustomTime}
|
|
1324
|
+
.height=${e.height}
|
|
1325
|
+
.itemHeight=${e.itemHeight}
|
|
1326
|
+
.minTimeMessage=${e.minTimeMessage}
|
|
1327
|
+
.maxTimeMessage=${e.maxTimeMessage}
|
|
1328
|
+
.rangeOrderMessage=${e.rangeOrderMessage}
|
|
1329
|
+
.disabledRangeMessage=${e.disabledRangeMessage}
|
|
1330
|
+
.noAvailableTimesMessage=${e.noAvailableTimesMessage}
|
|
1331
|
+
@inputError=${this.onInputError}
|
|
1332
|
+
@blur=${()=>this.adapter.onBlur()}
|
|
1333
|
+
@change=${this.valueChanged}
|
|
1334
|
+
></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`
|
|
524
1336
|
${se(this.uid,e)}
|
|
525
1337
|
|
|
526
1338
|
<div class="gui-widget">
|
|
@@ -529,28 +1341,30 @@
|
|
|
529
1341
|
inputmode="decimal"
|
|
530
1342
|
id=${this.uid}
|
|
531
1343
|
data-cy=${`${this.uid}_currency`}
|
|
532
|
-
class=${
|
|
533
|
-
step=${this.step&&this.step>0?this.step:
|
|
1344
|
+
class=${w.classMap(i)}
|
|
1345
|
+
step=${this.step&&this.step>0?this.step:l.nothing}
|
|
534
1346
|
.value=${this.value??""}
|
|
535
1347
|
?required=${this.disabled}
|
|
536
1348
|
?disabled=${this.disabled}
|
|
537
1349
|
?readonly=${this.readOnly}
|
|
538
|
-
placeholder=${this.placeholder||
|
|
539
|
-
autocomplete=${this.autocomplete||
|
|
1350
|
+
placeholder=${this.placeholder||l.nothing}
|
|
1351
|
+
autocomplete=${this.autocomplete||l.nothing}
|
|
540
1352
|
@input=${this.handleInput}
|
|
1353
|
+
@beforeinput=${Xs}
|
|
1354
|
+
@keydown=${Js}
|
|
541
1355
|
@focus=${this.handleFocus}
|
|
542
1356
|
@blur=${this.handleBlur}
|
|
543
1357
|
/>
|
|
544
|
-
${this.displayValue?
|
|
1358
|
+
${this.displayValue?l.html`<label
|
|
545
1359
|
for=${this.uid}
|
|
546
1360
|
class="gui-currency__format-value ${this.icon?"gui-currency__format-value--icon":""}"
|
|
547
1361
|
>${this.displayValue}</label
|
|
548
|
-
>`:
|
|
1362
|
+
>`:l.nothing}
|
|
549
1363
|
${t.html}
|
|
550
1364
|
</div>
|
|
551
1365
|
|
|
552
|
-
${
|
|
553
|
-
`}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)||"."}}};
|
|
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`
|
|
554
1368
|
<gui-currency
|
|
555
1369
|
.uid=${this.widget.uid}
|
|
556
1370
|
.label=${this.adapter.templateData.label}
|
|
@@ -572,46 +1386,23 @@
|
|
|
572
1386
|
@input=${this.valueChanged}
|
|
573
1387
|
@blur=${()=>this.adapter.onBlur()}
|
|
574
1388
|
></gui-currency>
|
|
575
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
576
|
-
${this.label?se(this.uid,e):
|
|
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}
|
|
577
1391
|
|
|
578
1392
|
<div class="gui-widget">
|
|
579
1393
|
<div
|
|
580
|
-
class="gui-widget-input gui-date-input ${this.icon?"gui-calendar--icon":""}"
|
|
1394
|
+
class="gui-widget-input gui-parts gui-parts-ring gui-date-input ${this.icon?"gui-calendar--icon":""}"
|
|
581
1395
|
role="group"
|
|
582
1396
|
>
|
|
583
|
-
${
|
|
1397
|
+
${mt("default",t,this._parts)}
|
|
584
1398
|
</div>
|
|
585
|
-
${this.icon?
|
|
1399
|
+
${this.icon?l.html`<span class=${w.classMap(i)} data-icon=${this.icon}></span>`:l.nothing}
|
|
586
1400
|
</div>
|
|
587
1401
|
|
|
588
|
-
${this.showErrors&&this.errors?.length?
|
|
589
|
-
`}
|
|
590
|
-
<div class="gui-date-input__touch-target">
|
|
591
|
-
<input
|
|
592
|
-
type="text"
|
|
593
|
-
inputmode="numeric"
|
|
594
|
-
class="gui-date-input__part ${e==="year"?"gui-date-input__year":""}"
|
|
595
|
-
data-type=${e}
|
|
596
|
-
maxlength=${i}
|
|
597
|
-
placeholder=${t}
|
|
598
|
-
tabindex=${s}
|
|
599
|
-
?required=${this.required}
|
|
600
|
-
?disabled=${this.disabled}
|
|
601
|
-
?readonly=${this.readOnly}
|
|
602
|
-
autocomplete="off"
|
|
603
|
-
.value=${Oi.live(a)}
|
|
604
|
-
@keydown=${this.handleKeyDown}
|
|
605
|
-
@keyup=${n=>this.handleKeyUp(n,e)}
|
|
606
|
-
@focus=${this.handleFocus}
|
|
607
|
-
@blur=${n=>this.handleBlur(n,e)}
|
|
608
|
-
@change=${n=>this.handleChange(n,e)}
|
|
609
|
-
/>
|
|
610
|
-
<div class="gui-date-input__visual-underline"></div>
|
|
611
|
-
</div>
|
|
612
|
-
`}parseValue(e){if(!e){this._day="",this._month="",this._year="";return}const t=new Date(e);isNaN(t.getTime())||(this._day=t.getDate().toString().padStart(2,"0"),this._month=(t.getMonth()+1).toString().padStart(2,"0"),this._year=t.getFullYear().toString())}handleKeyDown(e){["Backspace","Tab","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Delete","Enter"].includes(e.key)||e.ctrlKey||e.metaKey||this.readOnly||/^[0-9]$/.test(e.key)||e.preventDefault()}handleFocus(e){this.dispatchEvent(new CustomEvent("focus",{detail:e}))}handleKeyUp(e,t){if(this.readOnly)return;const i=window.getComputedStyle(this).direction==="rtl",s=e.target,a=Array.from(this.querySelectorAll("input")),n=a.indexOf(s);switch(s.value.length===s.maxLength&&/^[0-9]$/.test(e.key)&&(n===a.length-1?a[0].focus():a[n+1].focus()),e.key){case"ArrowUp":{const r=isNaN(parseInt(s.value,10)+1)?1:parseInt(s.value,10)+1;t==="year"&&(this._year=r.toString().padStart(4,"0")),t==="month"&&(this._month=r.toString().padStart(2,"0")),t==="day"&&(this._day=r.toString().padStart(2,"0")),s.select(),this.validateAndEmit();break}case"ArrowDown":{const r=isNaN(parseInt(s.value,10)-1)?1:parseInt(s.value,10)-1;t==="year"&&(this._year=r.toString().padStart(4,"0")),t==="month"&&(this._month=r.toString().padStart(2,"0")),t==="day"&&(this._day=r.toString().padStart(2,"0")),s.select(),this.validateAndEmit();break}case"ArrowLeft":{const r=i?n+1:n-1;r>=0&&r<a.length&&(a[r].focus(),a[r].select());break}case"ArrowRight":{const r=i?n-1:n+1;r>=0&&r<a.length&&(a[r].focus(),a[r].select());break}}}handleChange(e,t){if(e.stopImmediatePropagation(),this.readOnly)return;const s=e.target.value.replace(/[^0-9]/g,"");switch(t){case"day":this._day=s;break;case"month":this._month=s;break;case"year":this._year=s;break}this.validateAndEmit()}handleBlur(e,t){const i=e.target,s=parseInt(i.value,10);if(!isNaN(s)&&s>0){const a=t==="year"?4:2;i.value=s.toString().padStart(a,"0")}else this.dispatchEvent(new CustomEvent("change",{detail:{value:null}}));this.dispatchEvent(new CustomEvent("blur"))}validateAndEmit(){let e=parseInt(this._year,10),t=parseInt(this._month,10),i=parseInt(this._day,10);e>this.MAX_YEAR&&(e=this.MAX_YEAR,this._year=e.toString().padStart(4,"0")),e<this.MIN_YEAR&&(e=this.MIN_YEAR,this._year=e.toString().padStart(4,"0")),t>this.MAX_MONTH&&(t=this.MAX_MONTH,this._month=t.toString().padStart(2,"0")),t<this.MIN_MONTH&&(t=this.MIN_MONTH,this._month=t.toString().padStart(2,"0")),i>this.MAX_DAY&&(i=this.MAX_DAY,this._day=i.toString().padStart(2,"0")),i<this.MIN_DAY&&(i=this.MIN_DAY,this._day=i.toString().padStart(2,"0"));const s=!isNaN(e)&&String(e).length===4,a=!isNaN(t)&&t>0;if(!isNaN(i)&&i>0&&a&&s){const r=this.MAX_VALID_DAY(t,e);if(i>r)this.dispatchEvent(new CustomEvent("inputError",{detail:{message:"Invalid date: day is greater than the maximum valid day for the month and year."},bubbles:!0}));else{const l=new Date(e,t-1,i);this.value=Pe(l),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0}))}}this.requestUpdate()}};te([o.property({type:String})],G.prototype,"uid",2),te([o.property({type:String})],G.prototype,"label",2),te([o.property({type:String,attribute:"locale-id"})],G.prototype,"localeId",2),te([o.property({type:Array})],G.prototype,"errors",2),te([o.property({type:Boolean})],G.prototype,"showErrors",2),te([o.property({type:Boolean})],G.prototype,"touched",2),te([o.property({type:Boolean})],G.prototype,"required",2),te([o.property({type:Boolean})],G.prototype,"disabled",2),te([o.property({type:Boolean,attribute:"readonly"})],G.prototype,"readOnly",2),te([o.property({type:String})],G.prototype,"value",2),te([o.property({type:String})],G.prototype,"icon",2),te([o.property({type:String})],G.prototype,"hint",2),te([o.state()],G.prototype,"_day",2),te([o.state()],G.prototype,"_month",2),te([o.state()],G.prototype,"_year",2),G=te([o.customElement("gui-date")],G),typeof customElements<"u"&&!customElements.get("gui-date")&&customElements.define("gui-date",G);var Bl=Object.defineProperty,ql=Object.getOwnPropertyDescriptor,di=(e,t,i,s)=>{for(var a=s>1?void 0:s?ql(t,i):t,n=e.length-1,r;n>=0;n--)(r=e[n])&&(a=(s?r(t,i,a):r(a))||a);return s&&a&&Bl(t,i,a),a};let lt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new h.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=Be("date",this.adapter.templateData);return d.html`
|
|
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`
|
|
613
1404
|
<gui-date
|
|
614
|
-
class=${
|
|
1405
|
+
class=${w.classMap(e.widgetClasses)}
|
|
615
1406
|
.uid=${this.widget.uid}
|
|
616
1407
|
.label=${this.adapter.templateData.label}
|
|
617
1408
|
.hint=${this.adapter.templateData.hint}
|
|
@@ -623,62 +1414,68 @@
|
|
|
623
1414
|
.value=${this.adapter.templateData.value}
|
|
624
1415
|
.icon=${this.adapter.templateData.icon}
|
|
625
1416
|
.localeId=${this.adapter.templateData.lang}
|
|
1417
|
+
.invalidDateMessage=${this.adapter.templateData.invalidDateMessage}
|
|
1418
|
+
.minDate=${this.adapter.templateData.minDate}
|
|
1419
|
+
.maxDate=${this.adapter.templateData.maxDate}
|
|
1420
|
+
.minDateMessage=${this.adapter.templateData.minDateMessage}
|
|
1421
|
+
.maxDateMessage=${this.adapter.templateData.maxDateMessage}
|
|
626
1422
|
@inputError=${this.onInputError}
|
|
627
1423
|
@blur=${()=>this.adapter.onBlur()}
|
|
628
1424
|
@change=${this.valueChanged}
|
|
629
1425
|
></gui-date>
|
|
630
|
-
`}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())}};
|
|
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
|
|
631
1427
|
id="calendar-input"
|
|
632
|
-
.uid=${this.
|
|
633
|
-
.hint=${this.
|
|
634
|
-
?touched=${this.
|
|
635
|
-
?required=${this.
|
|
636
|
-
?disabled=${this.
|
|
637
|
-
?readonly=${this.
|
|
638
|
-
.value=${this.
|
|
639
|
-
.prevMonthIcon=${this.
|
|
640
|
-
.nextMonthIcon=${this.
|
|
641
|
-
.prevMonthAriaLabel=${this.
|
|
642
|
-
.nextMonthAriaLabel=${this.
|
|
643
|
-
.dayFormat=${this.
|
|
644
|
-
.weekdayFormat=${this.
|
|
645
|
-
.monthFormat=${this.
|
|
646
|
-
.minDate=${this.
|
|
647
|
-
.maxDate=${this.
|
|
648
|
-
.disabledRanges=${this.
|
|
649
|
-
.numberOfMonths=${this.
|
|
650
|
-
.localeId=${this.
|
|
651
|
-
@blur=${this.
|
|
1428
|
+
.uid=${this.uid}
|
|
1429
|
+
.hint=${this.hint}
|
|
1430
|
+
?touched=${this.touched}
|
|
1431
|
+
?required=${this.required}
|
|
1432
|
+
?disabled=${this.disabled}
|
|
1433
|
+
?readonly=${this.readOnly}
|
|
1434
|
+
.value=${this.value}
|
|
1435
|
+
.prevMonthIcon=${this.prevMonthIcon}
|
|
1436
|
+
.nextMonthIcon=${this.nextMonthIcon}
|
|
1437
|
+
.prevMonthAriaLabel=${this.prevMonthAriaLabel}
|
|
1438
|
+
.nextMonthAriaLabel=${this.nextMonthAriaLabel}
|
|
1439
|
+
.dayFormat=${this.dayFormat}
|
|
1440
|
+
.weekdayFormat=${this.weekdayFormat}
|
|
1441
|
+
.monthFormat=${this.monthFormat}
|
|
1442
|
+
.minDate=${this.minDate}
|
|
1443
|
+
.maxDate=${this.maxDate}
|
|
1444
|
+
.disabledRanges=${this.disabledRanges}
|
|
1445
|
+
.numberOfMonths=${this.numberOfMonths}
|
|
1446
|
+
.localeId=${this.localeId}
|
|
1447
|
+
@blur=${this.onCalendarBlur}
|
|
652
1448
|
@change=${this.onCalendarChange}
|
|
653
|
-
></gui-calendar>`:
|
|
654
|
-
${se(this.
|
|
1449
|
+
></gui-calendar>`:l.nothing;return l.html`
|
|
1450
|
+
${se(this.uid??"",{label:this.label,hint:this.hint,required:this.required})}
|
|
655
1451
|
|
|
656
1452
|
<div
|
|
657
1453
|
role="button"
|
|
658
1454
|
tabindex="-1"
|
|
659
1455
|
class="gui-widget"
|
|
660
|
-
aria-expanded=${this.
|
|
661
|
-
@keyup=${
|
|
662
|
-
@
|
|
1456
|
+
aria-expanded=${this._popup.open}
|
|
1457
|
+
@keyup=${this._popup.onAnchorKeyUp}
|
|
1458
|
+
@keydown=${this._popup.onAnchorKeyDown}
|
|
1459
|
+
@click=${this._popup.onAnchorClick}
|
|
663
1460
|
>
|
|
664
1461
|
<gui-date
|
|
665
1462
|
id="date-input"
|
|
666
|
-
class=${
|
|
667
|
-
.uid=${this.
|
|
668
|
-
.hint=${this.
|
|
1463
|
+
class=${w.classMap(e.widgetClasses)}
|
|
1464
|
+
.uid=${this.uid}
|
|
1465
|
+
.hint=${this.hint}
|
|
669
1466
|
.showErrors=${!1}
|
|
670
|
-
.errors=${this.
|
|
671
|
-
?touched=${this.
|
|
672
|
-
?required=${this.
|
|
673
|
-
?disabled=${this.
|
|
674
|
-
?readonly=${this.
|
|
675
|
-
.value=${this.
|
|
676
|
-
.icon=${this.
|
|
677
|
-
.localeId=${this.
|
|
678
|
-
|
|
679
|
-
@blur=${
|
|
680
|
-
@focus=${this.
|
|
681
|
-
@change=${this.
|
|
1467
|
+
.errors=${this.errors}
|
|
1468
|
+
?touched=${this.touched}
|
|
1469
|
+
?required=${this.required}
|
|
1470
|
+
?disabled=${this.disabled}
|
|
1471
|
+
?readonly=${this.readOnly}
|
|
1472
|
+
.value=${this.value}
|
|
1473
|
+
.icon=${this.icon}
|
|
1474
|
+
.localeId=${this.localeId}
|
|
1475
|
+
.invalidDateMessage=${this.invalidDateMessage}
|
|
1476
|
+
@blur=${this.onDateBlur}
|
|
1477
|
+
@focus=${this._popup.show}
|
|
1478
|
+
@change=${this.onDateChange}
|
|
682
1479
|
></gui-date>
|
|
683
1480
|
<span class="gui-date-picker__arrow"
|
|
684
1481
|
><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256">
|
|
@@ -690,32 +1487,201 @@
|
|
|
690
1487
|
${t}
|
|
691
1488
|
</div>
|
|
692
1489
|
|
|
693
|
-
${
|
|
694
|
-
`}
|
|
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`
|
|
1492
|
+
<gui-date-picker
|
|
1493
|
+
.uid=${this.widget.uid}
|
|
1494
|
+
.label=${e.label}
|
|
1495
|
+
.hint=${e.hint}
|
|
1496
|
+
.errors=${e.errors}
|
|
1497
|
+
?touched=${e.touched}
|
|
1498
|
+
?required=${e.validator?.required}
|
|
1499
|
+
?disabled=${e.disabled}
|
|
1500
|
+
?readonly=${e.readonly}
|
|
1501
|
+
.value=${e.value}
|
|
1502
|
+
.icon=${e.icon}
|
|
1503
|
+
.localeId=${e.lang}
|
|
1504
|
+
.prevMonthIcon=${e.prevMonthIcon}
|
|
1505
|
+
.nextMonthIcon=${e.nextMonthIcon}
|
|
1506
|
+
.prevMonthAriaLabel=${e.prevMonthAriaLabel}
|
|
1507
|
+
.nextMonthAriaLabel=${e.nextMonthAriaLabel}
|
|
1508
|
+
.dayFormat=${e.dayFormat}
|
|
1509
|
+
.weekdayFormat=${e.weekdayFormat}
|
|
1510
|
+
.monthFormat=${e.monthFormat}
|
|
1511
|
+
.minDate=${e.minDate}
|
|
1512
|
+
.maxDate=${e.maxDate}
|
|
1513
|
+
.disabledRanges=${e.disabledRanges}
|
|
1514
|
+
.numberOfMonths=${e.numberOfMonths}
|
|
1515
|
+
.invalidDateMessage=${e.invalidDateMessage}
|
|
1516
|
+
.minDateMessage=${e.minDateMessage}
|
|
1517
|
+
.maxDateMessage=${e.maxDateMessage}
|
|
1518
|
+
.disabledDateRangeMessage=${e.disabledDateRangeMessage}
|
|
1519
|
+
@inputError=${this.onInputError}
|
|
1520
|
+
@blur=${()=>this.adapter.onBlur()}
|
|
1521
|
+
@change=${this.valueChanged}
|
|
1522
|
+
></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}
|
|
1525
|
+
|
|
1526
|
+
<div class="gui-widget">
|
|
1527
|
+
<div
|
|
1528
|
+
class="gui-widget-input gui-parts gui-parts-ring gui-date-time-input ${this.icon?"gui-calendar--icon":""}"
|
|
1529
|
+
role="group"
|
|
1530
|
+
>
|
|
1531
|
+
${mt("default",t,this._parts)}
|
|
1532
|
+
</div>
|
|
1533
|
+
${this.icon?l.html`<span class=${w.classMap(i)} data-icon=${this.icon}></span>`:l.nothing}
|
|
1534
|
+
</div>
|
|
1535
|
+
|
|
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"
|
|
1539
|
+
.uid=${this.uid}
|
|
1540
|
+
.hint=${this.hint}
|
|
1541
|
+
?touched=${this.touched}
|
|
1542
|
+
?required=${this.required}
|
|
1543
|
+
?disabled=${this.disabled}
|
|
1544
|
+
?readonly=${this.readOnly}
|
|
1545
|
+
.value=${this.value}
|
|
1546
|
+
.prevMonthIcon=${this.prevMonthIcon}
|
|
1547
|
+
.nextMonthIcon=${this.nextMonthIcon}
|
|
1548
|
+
.prevMonthAriaLabel=${this.prevMonthAriaLabel}
|
|
1549
|
+
.nextMonthAriaLabel=${this.nextMonthAriaLabel}
|
|
1550
|
+
.dayFormat=${this.dayFormat}
|
|
1551
|
+
.weekdayFormat=${this.weekdayFormat}
|
|
1552
|
+
.monthFormat=${this.monthFormat}
|
|
1553
|
+
.minDate=${this.minDate}
|
|
1554
|
+
.maxDate=${this.maxDate}
|
|
1555
|
+
.disabledRanges=${this.disabledRanges}
|
|
1556
|
+
.numberOfMonths=${this.numberOfMonths}
|
|
1557
|
+
.localeId=${this.localeId}
|
|
1558
|
+
.hourFormat=${this.hourFormat}
|
|
1559
|
+
.minuteStep=${this.minuteStep}
|
|
1560
|
+
.minTime=${this.minTime}
|
|
1561
|
+
.maxTime=${this.maxTime}
|
|
1562
|
+
.disabledTimeRanges=${this.disabledTimeRanges}
|
|
1563
|
+
.allowCustomTime=${this.allowCustomTime}
|
|
1564
|
+
.minTimeMessage=${this.minTimeMessage}
|
|
1565
|
+
.maxTimeMessage=${this.maxTimeMessage}
|
|
1566
|
+
.disabledTimeRangeMessage=${this.disabledTimeRangeMessage}
|
|
1567
|
+
.noAvailableTimesMessage=${this.noAvailableTimesMessage}
|
|
1568
|
+
@blur=${this.onCalendarBlur}
|
|
1569
|
+
@change=${this.onCalendarChange}
|
|
1570
|
+
></gui-date-time-calendar>`:l.nothing;return l.html`
|
|
1571
|
+
${se(this.uid??"",{label:this.label,hint:this.hint,required:this.required})}
|
|
1572
|
+
|
|
1573
|
+
<div
|
|
1574
|
+
role="button"
|
|
1575
|
+
tabindex="-1"
|
|
1576
|
+
class="gui-widget"
|
|
1577
|
+
aria-expanded=${this._popup.open}
|
|
1578
|
+
@keyup=${this._popup.onAnchorKeyUp}
|
|
1579
|
+
@keydown=${this._popup.onAnchorKeyDown}
|
|
1580
|
+
@click=${this._popup.onAnchorClick}
|
|
1581
|
+
>
|
|
1582
|
+
<gui-date-time
|
|
1583
|
+
id="date-input"
|
|
1584
|
+
class=${w.classMap(e.widgetClasses)}
|
|
1585
|
+
.uid=${this.uid}
|
|
1586
|
+
.hint=${this.hint}
|
|
1587
|
+
.showErrors=${!1}
|
|
1588
|
+
.errors=${this.errors}
|
|
1589
|
+
?touched=${this.touched}
|
|
1590
|
+
?required=${this.required}
|
|
1591
|
+
?disabled=${this.disabled}
|
|
1592
|
+
?readonly=${this.readOnly}
|
|
1593
|
+
.value=${this.value}
|
|
1594
|
+
.icon=${this.icon}
|
|
1595
|
+
.localeId=${this.localeId}
|
|
1596
|
+
.hourFormat=${this.hourFormat}
|
|
1597
|
+
.minuteStep=${this.minuteStep}
|
|
1598
|
+
.minTime=${this.minTime}
|
|
1599
|
+
.maxTime=${this.maxTime}
|
|
1600
|
+
.invalidDateMessage=${this.invalidDateMessage}
|
|
1601
|
+
.minTimeMessage=${this.minTimeMessage}
|
|
1602
|
+
.maxTimeMessage=${this.maxTimeMessage}
|
|
1603
|
+
@blur=${this.onDateBlur}
|
|
1604
|
+
@focus=${this._popup.show}
|
|
1605
|
+
@change=${this.onDateChange}
|
|
1606
|
+
></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">
|
|
1609
|
+
<path
|
|
1610
|
+
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>
|
|
1613
|
+
|
|
1614
|
+
${t}
|
|
1615
|
+
</div>
|
|
1616
|
+
|
|
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`
|
|
1619
|
+
<gui-date-time-picker
|
|
1620
|
+
.uid=${this.widget.uid}
|
|
1621
|
+
.label=${e.label}
|
|
1622
|
+
.hint=${e.hint}
|
|
1623
|
+
.errors=${e.errors}
|
|
1624
|
+
?touched=${e.touched}
|
|
1625
|
+
?required=${e.validator?.required}
|
|
1626
|
+
?disabled=${e.disabled}
|
|
1627
|
+
?readonly=${e.readonly}
|
|
1628
|
+
.value=${e.value}
|
|
1629
|
+
.icon=${e.icon}
|
|
1630
|
+
.localeId=${e.lang}
|
|
1631
|
+
.prevMonthIcon=${e.prevMonthIcon}
|
|
1632
|
+
.nextMonthIcon=${e.nextMonthIcon}
|
|
1633
|
+
.prevMonthAriaLabel=${e.prevMonthAriaLabel}
|
|
1634
|
+
.nextMonthAriaLabel=${e.nextMonthAriaLabel}
|
|
1635
|
+
.dayFormat=${e.dayFormat}
|
|
1636
|
+
.weekdayFormat=${e.weekdayFormat}
|
|
1637
|
+
.monthFormat=${e.monthFormat}
|
|
1638
|
+
.minDate=${e.minDate}
|
|
1639
|
+
.maxDate=${e.maxDate}
|
|
1640
|
+
.disabledRanges=${e.disabledRanges}
|
|
1641
|
+
.numberOfMonths=${e.numberOfMonths}
|
|
1642
|
+
.hourFormat=${e.hourFormat}
|
|
1643
|
+
.minuteStep=${e.minuteStep}
|
|
1644
|
+
.minTime=${e.minTime}
|
|
1645
|
+
.maxTime=${e.maxTime}
|
|
1646
|
+
.disabledTimeRanges=${e.disabledTimeRanges}
|
|
1647
|
+
?allow-custom-time=${e.allowCustomTime}
|
|
1648
|
+
.invalidDateMessage=${e.invalidDateMessage}
|
|
1649
|
+
.minDateMessage=${e.minDateMessage}
|
|
1650
|
+
.maxDateMessage=${e.maxDateMessage}
|
|
1651
|
+
.disabledDateRangeMessage=${e.disabledDateRangeMessage}
|
|
1652
|
+
.minTimeMessage=${e.minTimeMessage}
|
|
1653
|
+
.maxTimeMessage=${e.maxTimeMessage}
|
|
1654
|
+
.disabledTimeRangeMessage=${e.disabledTimeRangeMessage}
|
|
1655
|
+
.noAvailableTimesMessage=${e.noAvailableTimesMessage}
|
|
1656
|
+
@inputError=${this.onInputError}
|
|
1657
|
+
@blur=${()=>this.adapter.onBlur()}
|
|
1658
|
+
@change=${this.valueChanged}
|
|
1659
|
+
></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`
|
|
695
1661
|
<div
|
|
696
1662
|
role="option"
|
|
697
|
-
class=${
|
|
1663
|
+
class=${w.classMap(t)}
|
|
698
1664
|
aria-selected=${e.selected?"true":"false"}
|
|
699
1665
|
aria-disabled=${e.disabled?"true":"false"}
|
|
700
1666
|
>
|
|
701
1667
|
${e.template}
|
|
702
1668
|
</div>
|
|
703
|
-
`};var
|
|
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`
|
|
704
1670
|
<div
|
|
705
1671
|
role="listbox"
|
|
706
1672
|
id=${this.uid}
|
|
707
1673
|
tabindex=${this.disabled?-1:0}
|
|
708
1674
|
class="gui-list__scroll-viewport"
|
|
709
|
-
style="max-height: ${e}px; overflow-y: auto; position: relative; display: block;"
|
|
1675
|
+
style="max-height: ${e}px; min-height: 40px; overflow-y: auto; position: relative; display: block;"
|
|
710
1676
|
@scroll="${this.onScroll}"
|
|
711
1677
|
@keydown="${this.onKeyDown}"
|
|
712
1678
|
@focus="${this.onFocus}"
|
|
713
1679
|
@focusout="${this.onFocusOut}"
|
|
714
|
-
aria-required=${this.required?"true":
|
|
715
|
-
aria-disabled=${this.disabled||this.readOnly?"true":
|
|
716
|
-
aria-activedescendant="${
|
|
717
|
-
aria-label=${this.label??
|
|
718
|
-
aria-description=${this.hint??
|
|
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}
|
|
719
1685
|
>
|
|
720
1686
|
<div
|
|
721
1687
|
class="gui-list__spacer"
|
|
@@ -724,12 +1690,12 @@
|
|
|
724
1690
|
|
|
725
1691
|
<div
|
|
726
1692
|
class="gui-list__content"
|
|
727
|
-
style="transform: translateY(${
|
|
1693
|
+
style="transform: translateY(${a}px); position: absolute; top: 0; left: 0; width: 100%;"
|
|
728
1694
|
>
|
|
729
1695
|
<slot></slot>
|
|
730
1696
|
</div>
|
|
731
1697
|
</div>
|
|
732
|
-
`}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),
|
|
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`
|
|
733
1699
|
<gui-label
|
|
734
1700
|
.targetElement=${[this._listRef,this._inputRef]}
|
|
735
1701
|
.uid=${this.widget.uid}
|
|
@@ -741,24 +1707,28 @@
|
|
|
741
1707
|
.native=${!1}
|
|
742
1708
|
></gui-label>
|
|
743
1709
|
|
|
744
|
-
<div
|
|
1710
|
+
<div
|
|
1711
|
+
class="gui-widget"
|
|
1712
|
+
aria-expanded=${this._isListVisible}
|
|
1713
|
+
@keydown=${this._onWidgetKeyDown}
|
|
1714
|
+
>
|
|
745
1715
|
<input
|
|
746
1716
|
type="text"
|
|
747
1717
|
id=${this.widget.uid}
|
|
748
1718
|
data-cy=${`${this.widget.uid}_textinput`}
|
|
749
1719
|
class="gui-widget-input"
|
|
750
|
-
.value=${
|
|
1720
|
+
.value=${o??e.value??""}
|
|
751
1721
|
?required=${e.validator?.required}
|
|
752
1722
|
?disabled=${e.disabled}
|
|
753
1723
|
?readonly=${e.readonly}
|
|
754
1724
|
placeholder=${e.placeholder??""}
|
|
755
|
-
autocomplete=${e.autocomplete||
|
|
1725
|
+
autocomplete=${e.autocomplete||l.nothing}
|
|
756
1726
|
@keydown=${this._onKeyDown}
|
|
757
1727
|
@input=${this._onInput}
|
|
758
1728
|
@focusout=${this._onFocusOutInput}
|
|
759
1729
|
@focus=${this._onFocus}
|
|
760
|
-
aria-labelledby=${e.label?`${this.widget.uid}_label`:
|
|
761
|
-
aria-describedby=${e.hint?`${this.widget.uid}_hint`:
|
|
1730
|
+
aria-labelledby=${e.label?`${this.widget.uid}_label`:l.nothing}
|
|
1731
|
+
aria-describedby=${e.hint?`${this.widget.uid}_hint`:l.nothing}
|
|
762
1732
|
/>
|
|
763
1733
|
<span class="gui-dropdown__arrow"
|
|
764
1734
|
><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 256 256">
|
|
@@ -772,7 +1742,7 @@
|
|
|
772
1742
|
.uid=${this.widget.uid}
|
|
773
1743
|
.value=${e.value??""}
|
|
774
1744
|
.valueField=${e.valueField}
|
|
775
|
-
.items=${this._isFiltering&&!
|
|
1745
|
+
.items=${this._isFiltering&&!u?this._filteredItems:e.items}
|
|
776
1746
|
.itemHeight=${e.itemHeight}
|
|
777
1747
|
.height=${e.height}
|
|
778
1748
|
?required=${e.validator?.required}
|
|
@@ -787,28 +1757,29 @@
|
|
|
787
1757
|
@blur=${this._onBlur}
|
|
788
1758
|
@change=${this._onValueChange}
|
|
789
1759
|
>
|
|
790
|
-
${i.map((
|
|
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`
|
|
791
1761
|
<div
|
|
792
1762
|
role="option"
|
|
793
1763
|
tabindex="-1"
|
|
794
1764
|
class="gui-list__item-wrapper"
|
|
795
|
-
id="${this.widget.uid}-item-${
|
|
1765
|
+
id="${this.widget.uid}-item-${h}"
|
|
796
1766
|
style="height: ${e.itemHeight||40}px"
|
|
797
|
-
aria-selected=${
|
|
798
|
-
|
|
1767
|
+
aria-selected=${c?"true":"false"}
|
|
1768
|
+
aria-disabled=${f?"true":"false"}
|
|
1769
|
+
@click=${()=>this._onClickItem(p,h)}
|
|
799
1770
|
>
|
|
800
|
-
${
|
|
1771
|
+
${a({template:Be,value:p.value,index:h,selected:c,disabled:f,focused:g})}
|
|
801
1772
|
</div>
|
|
802
1773
|
`})}
|
|
803
1774
|
</gui-list>
|
|
804
1775
|
</div>
|
|
805
1776
|
|
|
806
|
-
${t?
|
|
1777
|
+
${t?l.html`<gui-errors
|
|
807
1778
|
.uid=${this.widget.uid}
|
|
808
1779
|
.errors=${e.errors}
|
|
809
1780
|
.touched=${e.touched}
|
|
810
|
-
></gui-errors>`:
|
|
811
|
-
`}};
|
|
1781
|
+
></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`
|
|
812
1783
|
<gui-label
|
|
813
1784
|
.targetElement=${this._guiListRef}
|
|
814
1785
|
.uid=${this.widget.uid}
|
|
@@ -832,53 +1803,53 @@
|
|
|
832
1803
|
?touched=${e.touched}
|
|
833
1804
|
?disabled=${e.disabled}
|
|
834
1805
|
?readonly=${e.readonly}
|
|
835
|
-
aria-labelledby=${e.label?`${this.widget.uid}_label`:
|
|
836
|
-
aria-describedby=${e.hint?`${this.widget.uid}_hint`:
|
|
1806
|
+
aria-labelledby=${e.label?`${this.widget.uid}_label`:l.nothing}
|
|
1807
|
+
aria-describedby=${e.hint?`${this.widget.uid}_hint`:l.nothing}
|
|
837
1808
|
@gui-range-change=${this._onRangeChange}
|
|
838
1809
|
@gui-update-items=${this._onUpdateItems}
|
|
839
1810
|
@gui-focus-change=${this._onFocusChange}
|
|
840
1811
|
@blur=${()=>this.adapter.onBlur()}
|
|
841
1812
|
@change=${this._valueChanged}
|
|
842
1813
|
>
|
|
843
|
-
${i.map((
|
|
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`
|
|
844
1815
|
<div
|
|
845
1816
|
role="option"
|
|
846
1817
|
tabindex="-1"
|
|
847
1818
|
class="gui-list__item-wrapper"
|
|
848
|
-
id="${this.widget.uid}-item-${
|
|
1819
|
+
id="${this.widget.uid}-item-${o}"
|
|
849
1820
|
style="height: ${e.itemHeight||40}px"
|
|
850
|
-
aria-selected=${
|
|
851
|
-
aria-disabled=${
|
|
852
|
-
@click=${()=>this._onClickItem(
|
|
1821
|
+
aria-selected=${u?"true":"false"}
|
|
1822
|
+
aria-disabled=${d?"true":"false"}
|
|
1823
|
+
@click=${()=>this._onClickItem(r,o)}
|
|
853
1824
|
>
|
|
854
|
-
${
|
|
1825
|
+
${a({template:g,value:r.value,index:o,selected:u,disabled:d,focused:p})}
|
|
855
1826
|
</div>
|
|
856
1827
|
`})}
|
|
857
1828
|
</gui-list>
|
|
858
1829
|
</div>
|
|
859
1830
|
|
|
860
|
-
${t?
|
|
1831
|
+
${t?l.html`<gui-errors
|
|
861
1832
|
.uid=${this.widget.uid}
|
|
862
1833
|
.errors=${e.errors}
|
|
863
1834
|
.touched=${e.touched}
|
|
864
|
-
></gui-errors>`:
|
|
865
|
-
`}_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||(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)}}
|
|
866
|
-
${
|
|
1835
|
+
></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)}>
|
|
1837
|
+
${s}
|
|
867
1838
|
<span> / ${e.maxLength}</span>
|
|
868
|
-
</div>`}const
|
|
1839
|
+
</div>`}const a={"min-height":`${e.minimumHeight}px`};return l.html`
|
|
869
1840
|
${se(this.uid,e)}
|
|
870
1841
|
|
|
871
1842
|
<div
|
|
872
|
-
class=${
|
|
1843
|
+
class=${w.classMap({"gui-widget":!0,"gui-markdown--with-preview":this.splitViewActive})}
|
|
873
1844
|
>
|
|
874
1845
|
<nav class="gui-markdown__toolbar">
|
|
875
1846
|
<ul>
|
|
876
|
-
${(this.tools??["H","B","I","S","Q","L","|","OL","UL"]).map(
|
|
1847
|
+
${(this.tools??["H","B","I","S","Q","L","|","OL","UL"]).map(r=>this.renderToolbarItem(r))}
|
|
877
1848
|
<li>
|
|
878
1849
|
<button
|
|
879
1850
|
type="button"
|
|
880
1851
|
tabindex="0"
|
|
881
|
-
class=${
|
|
1852
|
+
class=${w.classMap({"gui-markdown__toolbar-button":!0,"gui-markdown__toolbar-button--active":this.splitViewActive})}
|
|
882
1853
|
@click=${this.splitView}
|
|
883
1854
|
title=${this.splitViewTitle??"Split View"}
|
|
884
1855
|
>
|
|
@@ -899,14 +1870,14 @@
|
|
|
899
1870
|
|
|
900
1871
|
<div class="gui-markdown__container">
|
|
901
1872
|
<textarea
|
|
902
|
-
id=${
|
|
903
|
-
class=${
|
|
904
|
-
style=${
|
|
1873
|
+
id=${aa.ifDefined(this.uid)}
|
|
1874
|
+
class=${w.classMap(t)}
|
|
1875
|
+
style=${bt.styleMap(a)}
|
|
905
1876
|
?required=${e.required}
|
|
906
1877
|
?disabled=${e.disabled}
|
|
907
1878
|
?readonly=${e.readonly}
|
|
908
|
-
placeholder=${
|
|
909
|
-
autocomplete=${this.autocomplete||
|
|
1879
|
+
placeholder=${aa.ifDefined(e.placeholder)}
|
|
1880
|
+
autocomplete=${this.autocomplete||l.nothing}
|
|
910
1881
|
.value=${this.value||""}
|
|
911
1882
|
@input=${this.valueChanged}
|
|
912
1883
|
@keyup=${this.detectFormats}
|
|
@@ -914,26 +1885,26 @@
|
|
|
914
1885
|
@blur=${this.onBlur}
|
|
915
1886
|
></textarea>
|
|
916
1887
|
|
|
917
|
-
${this.splitViewActive?
|
|
1888
|
+
${this.splitViewActive?l.html`
|
|
918
1889
|
<section
|
|
919
|
-
data-cy=${
|
|
1890
|
+
data-cy=${aa.ifDefined(this.uid?`${this.uid}_markdown`:l.nothing)}
|
|
920
1891
|
class="gui-markdown__preview"
|
|
921
|
-
style=${
|
|
1892
|
+
style=${bt.styleMap(a)}
|
|
922
1893
|
>
|
|
923
1894
|
<gui-markdown-text
|
|
924
1895
|
.md=${this.value||""}
|
|
925
1896
|
.dependencies=${this.dependencies}
|
|
926
1897
|
></gui-markdown-text>
|
|
927
1898
|
</section>
|
|
928
|
-
`:
|
|
1899
|
+
`:l.nothing}
|
|
929
1900
|
</div>
|
|
930
1901
|
</div>
|
|
931
1902
|
|
|
932
1903
|
<div class="gui-markdown--validation">
|
|
933
|
-
<div>${
|
|
1904
|
+
<div>${W(this.uid,e)}</div>
|
|
934
1905
|
${i}
|
|
935
1906
|
</div>
|
|
936
|
-
`}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),
|
|
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>
|
|
937
1908
|
<button
|
|
938
1909
|
type="button"
|
|
939
1910
|
tabindex="0"
|
|
@@ -947,7 +1918,7 @@
|
|
|
947
1918
|
></path>
|
|
948
1919
|
</svg>
|
|
949
1920
|
</button>
|
|
950
|
-
</li>`;case"B":return
|
|
1921
|
+
</li>`;case"B":return l.html`<li>
|
|
951
1922
|
<button
|
|
952
1923
|
type="button"
|
|
953
1924
|
tabindex="0"
|
|
@@ -961,7 +1932,7 @@
|
|
|
961
1932
|
></path>
|
|
962
1933
|
</svg>
|
|
963
1934
|
</button>
|
|
964
|
-
</li>`;case"I":return
|
|
1935
|
+
</li>`;case"I":return l.html`<li>
|
|
965
1936
|
<button
|
|
966
1937
|
type="button"
|
|
967
1938
|
tabindex="0"
|
|
@@ -975,7 +1946,7 @@
|
|
|
975
1946
|
></path>
|
|
976
1947
|
</svg>
|
|
977
1948
|
</button>
|
|
978
|
-
</li>`;case"S":return
|
|
1949
|
+
</li>`;case"S":return l.html`<li>
|
|
979
1950
|
<button
|
|
980
1951
|
type="button"
|
|
981
1952
|
tabindex="0"
|
|
@@ -989,7 +1960,7 @@
|
|
|
989
1960
|
></path>
|
|
990
1961
|
</svg>
|
|
991
1962
|
</button>
|
|
992
|
-
</li>`;case"Q":return
|
|
1963
|
+
</li>`;case"Q":return l.html`<li>
|
|
993
1964
|
<button
|
|
994
1965
|
type="button"
|
|
995
1966
|
tabindex="0"
|
|
@@ -1003,7 +1974,7 @@
|
|
|
1003
1974
|
></path>
|
|
1004
1975
|
</svg>
|
|
1005
1976
|
</button>
|
|
1006
|
-
</li>`;case"L":return
|
|
1977
|
+
</li>`;case"L":return l.html`<li>
|
|
1007
1978
|
<button
|
|
1008
1979
|
type="button"
|
|
1009
1980
|
tabindex="0"
|
|
@@ -1017,7 +1988,7 @@
|
|
|
1017
1988
|
></path>
|
|
1018
1989
|
</svg>
|
|
1019
1990
|
</button>
|
|
1020
|
-
</li>`;case"OL":return
|
|
1991
|
+
</li>`;case"OL":return l.html`<li>
|
|
1021
1992
|
<button
|
|
1022
1993
|
type="button"
|
|
1023
1994
|
tabindex="0"
|
|
@@ -1031,7 +2002,7 @@
|
|
|
1031
2002
|
></path>
|
|
1032
2003
|
</svg>
|
|
1033
2004
|
</button>
|
|
1034
|
-
</li>`;case"UL":return
|
|
2005
|
+
</li>`;case"UL":return l.html`<li>
|
|
1035
2006
|
<button
|
|
1036
2007
|
type="button"
|
|
1037
2008
|
tabindex="0"
|
|
@@ -1045,21 +2016,21 @@
|
|
|
1045
2016
|
></path>
|
|
1046
2017
|
</svg>
|
|
1047
2018
|
</button>
|
|
1048
|
-
</li>`;case"|":return
|
|
2019
|
+
</li>`;case"|":return l.html`<li>
|
|
1049
2020
|
<span class="gui-markdown__toolbar-separator">
|
|
1050
2021
|
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 256 256">
|
|
1051
2022
|
<path d="M140,24V232a12,12,0,0,1-24,0V24a12,12,0,0,1,24,0Z"></path>
|
|
1052
2023
|
</svg>
|
|
1053
2024
|
</span>
|
|
1054
|
-
</li>`;default:return
|
|
1055
|
-
`,t-1)+1,
|
|
1056
|
-
`,t),
|
|
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(`
|
|
2026
|
+
`,t-1)+1,r=i.indexOf(`
|
|
2027
|
+
`,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
|
+
`,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(`
|
|
1057
2030
|
`,t-1)+1,a=e.indexOf(`
|
|
1058
|
-
`,t),
|
|
1059
|
-
`,
|
|
1060
|
-
`,
|
|
1061
|
-
`,a-1)+1,l=n.indexOf(`
|
|
1062
|
-
`,a),u=n.substring(r,l===-1?n.length:l);if(i)if(s==="link"){const p=a-r,c=/\[([^\]]*)\]\([^)]*\)/g;let y;for(;(y=c.exec(u))!==null;)if(p>=y.index&&p<=y.index+y[0].length){const f=y[1],b=r+y.index,C=b+y[0].length;e.value=`${n.substring(0,b)}${f}${n.substring(C)}`,e.selectionStart=b,e.selectionEnd=b+f.length;break}}else{const p=a-r;let c=0;for(;c<u.length;){const y=u.indexOf(t,c);if(y===-1)break;const f=u.indexOf(i,y+t.length);if(f===-1)break;if(p>=y&&p<=f+i.length){const b=u.substring(y+t.length,f),C=r+y,Se=r+f+i.length;e.value=`${n.substring(0,C)}${b}${n.substring(Se)}`,e.selectionStart=C,e.selectionEnd=C+b.length;break}c=f+i.length}}else{let p=t;if(s==="heading"){const b=u.match(/^#{1,6}\s/);b&&(p=b[0])}else if(s==="orderedList"){const b=u.match(/^\d+\.\s/);b&&(p=b[0])}const c=n.substring(0,r),y=u.substring(p.length),f=n.substring(l===-1?n.length:l);e.value=`${c}${y}${f}`,e.selectionStart=Math.max(r,a-p.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}))}};w([o.property({type:String})],D.prototype,"uid",2),w([o.property({type:String})],D.prototype,"label",2),w([o.property({type:String,attribute:"locale-id"})],D.prototype,"localeId",2),w([o.property({type:Array})],D.prototype,"errors",2),w([o.property({type:Boolean})],D.prototype,"touched",2),w([o.property({type:Boolean})],D.prototype,"required",2),w([o.property({type:Boolean})],D.prototype,"disabled",2),w([o.property({type:Boolean,attribute:"readonly"})],D.prototype,"readOnly",2),w([o.property({type:String})],D.prototype,"value",2),w([o.property({type:String})],D.prototype,"hint",2),w([o.property({type:Array})],D.prototype,"tools",2),w([o.property({type:String})],D.prototype,"placeholder",2),w([o.property({type:String})],D.prototype,"autocomplete",2),w([o.property({type:String,attribute:"countermode"})],D.prototype,"counterMode",2),w([o.property({type:Number,attribute:"minimumheight"})],D.prototype,"minimumHeight",2),w([o.property({type:Boolean,attribute:"autogrow"})],D.prototype,"autoGrow",2),w([o.property({type:Boolean,attribute:"defaultopenpreview"})],D.prototype,"defaultOpenPreview",2),w([o.property({type:Number,attribute:"maxlength"})],D.prototype,"maxLength",2),w([o.property({type:String})],D.prototype,"headingTitle",2),w([o.property({type:String})],D.prototype,"boldTitle",2),w([o.property({type:String})],D.prototype,"italicTitle",2),w([o.property({type:String})],D.prototype,"strikethroughTitle",2),w([o.property({type:String})],D.prototype,"quoteTitle",2),w([o.property({type:String})],D.prototype,"linkTitle",2),w([o.property({type:String})],D.prototype,"orderedListTitle",2),w([o.property({type:String})],D.prototype,"unorderedListTitle",2),w([o.property({type:String})],D.prototype,"splitViewTitle",2),w([o.property({type:Object})],D.prototype,"dependencies",2),w([o.state()],D.prototype,"splitViewActive",2),w([o.state()],D.prototype,"activeFormats",2),D=w([o.customElement("gui-markdown")],D),typeof customElements<"u"&&!customElements.get("gui-markdown")&&customElements.define("gui-markdown",D);var hd=Object.defineProperty,md=Object.getOwnPropertyDescriptor,pi=(e,t,i,s)=>{for(var a=s>1?void 0:s?md(t,i):t,n=e.length-1,r;n>=0;n--)(r=e[n])&&(a=(s?r(t,i,a):r(a))||a);return s&&a&&hd(t,i,a),a};let ut=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new h.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(),d.html`
|
|
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`
|
|
1063
2034
|
<gui-markdown
|
|
1064
2035
|
.uid=${this.widget.uid}
|
|
1065
2036
|
.label=${this.adapter.templateData.label}
|
|
@@ -1082,7 +2053,7 @@
|
|
|
1082
2053
|
@input=${this.valueChanged}
|
|
1083
2054
|
@blur=${()=>this.adapter.onBlur()}
|
|
1084
2055
|
></gui-markdown>
|
|
1085
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
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`
|
|
1086
2057
|
${se(this.uid,e)}
|
|
1087
2058
|
|
|
1088
2059
|
<div class="gui-widget">
|
|
@@ -1090,13 +2061,13 @@
|
|
|
1090
2061
|
type=${this.showPassword?"text":"password"}
|
|
1091
2062
|
id=${this.uid}
|
|
1092
2063
|
data-cy=${`${this.uid}_password`}
|
|
1093
|
-
class=${
|
|
2064
|
+
class=${w.classMap(i)}
|
|
1094
2065
|
value=${this.value}
|
|
1095
2066
|
?required=${this.disabled}
|
|
1096
2067
|
?disabled=${this.disabled}
|
|
1097
2068
|
?readonly=${this.readOnly}
|
|
1098
|
-
placeholder=${this.placeholder||
|
|
1099
|
-
autocomplete=${this.autocomplete||
|
|
2069
|
+
placeholder=${this.placeholder||l.nothing}
|
|
2070
|
+
autocomplete=${this.autocomplete||l.nothing}
|
|
1100
2071
|
@input=${this.valueChanged}
|
|
1101
2072
|
@blur=${this.onBlur}
|
|
1102
2073
|
/>
|
|
@@ -1108,14 +2079,14 @@
|
|
|
1108
2079
|
tabindex="-1"
|
|
1109
2080
|
@click=${()=>this.showPassword=!this.showPassword}
|
|
1110
2081
|
>
|
|
1111
|
-
${e.showPasswordIcon||e.hidePasswordIcon?
|
|
2082
|
+
${e.showPasswordIcon||e.hidePasswordIcon?l.nothing:l.html`<span
|
|
1112
2083
|
>${this.showPassword?e.hidePasswordLabel??"Hide":e.showPasswordLabel??"Show"}</span
|
|
1113
2084
|
>`}
|
|
1114
2085
|
</button>
|
|
1115
2086
|
</div>
|
|
1116
2087
|
|
|
1117
|
-
${
|
|
1118
|
-
`}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}))}};
|
|
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`
|
|
1119
2090
|
<gui-password
|
|
1120
2091
|
.uid=${this.widget.uid}
|
|
1121
2092
|
.label=${this.adapter.templateData.label}
|
|
@@ -1136,7 +2107,7 @@
|
|
|
1136
2107
|
@input=${this.valueChanged}
|
|
1137
2108
|
@blur=${()=>this.adapter.onBlur()}
|
|
1138
2109
|
></gui-password>
|
|
1139
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
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`
|
|
1140
2111
|
${se(this.uid,e)}
|
|
1141
2112
|
|
|
1142
2113
|
<div class="gui-widget">
|
|
@@ -1144,21 +2115,21 @@
|
|
|
1144
2115
|
type="text"
|
|
1145
2116
|
id=${this.uid}
|
|
1146
2117
|
data-cy=${`${this.uid}_textinput`}
|
|
1147
|
-
class=${
|
|
2118
|
+
class=${w.classMap(i)}
|
|
1148
2119
|
value=${this.value}
|
|
1149
2120
|
?required=${this.disabled}
|
|
1150
2121
|
?disabled=${this.disabled}
|
|
1151
2122
|
?readonly=${this.readOnly}
|
|
1152
|
-
placeholder=${this.placeholder||
|
|
1153
|
-
autocomplete=${this.autocomplete||
|
|
2123
|
+
placeholder=${this.placeholder||l.nothing}
|
|
2124
|
+
autocomplete=${this.autocomplete||l.nothing}
|
|
1154
2125
|
@input=${this.valueChanged}
|
|
1155
2126
|
@blur=${this.onBlur}
|
|
1156
2127
|
/>
|
|
1157
2128
|
${t.html}
|
|
1158
2129
|
</div>
|
|
1159
2130
|
|
|
1160
|
-
${
|
|
1161
|
-
`}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}))}};
|
|
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`
|
|
1162
2133
|
<gui-textinput
|
|
1163
2134
|
.uid=${this.widget.uid}
|
|
1164
2135
|
.label=${this.adapter.templateData.label}
|
|
@@ -1175,10 +2146,92 @@
|
|
|
1175
2146
|
@input=${this.valueChanged}
|
|
1176
2147
|
@blur=${()=>this.adapter.onBlur()}
|
|
1177
2148
|
></gui-textinput>
|
|
1178
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
1179
|
-
|
|
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`
|
|
2150
|
+
<gui-time
|
|
2151
|
+
class=${w.classMap(e.widgetClasses)}
|
|
2152
|
+
.uid=${this.widget.uid}
|
|
2153
|
+
.label=${this.adapter.templateData.label}
|
|
2154
|
+
.hint=${this.adapter.templateData.hint}
|
|
2155
|
+
.errors=${this.adapter.templateData.errors}
|
|
2156
|
+
?touched=${this.adapter.templateData.touched}
|
|
2157
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
2158
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
2159
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
2160
|
+
.value=${this.adapter.templateData.value}
|
|
2161
|
+
.icon=${this.adapter.templateData.icon}
|
|
2162
|
+
.localeId=${this.adapter.templateData.lang}
|
|
2163
|
+
.hourFormat=${this.adapter.templateData.hourFormat}
|
|
2164
|
+
.minuteStep=${this.adapter.templateData.minuteStep}
|
|
2165
|
+
.minTime=${this.adapter.templateData.minTime}
|
|
2166
|
+
.maxTime=${this.adapter.templateData.maxTime}
|
|
2167
|
+
.minTimeMessage=${this.adapter.templateData.minTimeMessage}
|
|
2168
|
+
.maxTimeMessage=${this.adapter.templateData.maxTimeMessage}
|
|
2169
|
+
@inputError=${this.onInputError}
|
|
2170
|
+
@blur=${()=>this.adapter.onBlur()}
|
|
2171
|
+
@change=${this.valueChanged}
|
|
2172
|
+
></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`
|
|
2174
|
+
<gui-time-picker
|
|
2175
|
+
.uid=${this.widget.uid}
|
|
2176
|
+
.label=${e.label}
|
|
2177
|
+
.hint=${e.hint}
|
|
2178
|
+
.errors=${e.errors}
|
|
2179
|
+
?touched=${e.touched}
|
|
2180
|
+
?required=${e.validator?.required}
|
|
2181
|
+
?disabled=${e.disabled}
|
|
2182
|
+
?readonly=${e.readonly}
|
|
2183
|
+
.value=${e.value}
|
|
2184
|
+
.icon=${e.icon}
|
|
2185
|
+
.localeId=${e.lang}
|
|
2186
|
+
.hourFormat=${e.hourFormat}
|
|
2187
|
+
.minuteStep=${e.minuteStep}
|
|
2188
|
+
.minTime=${e.minTime}
|
|
2189
|
+
.maxTime=${e.maxTime}
|
|
2190
|
+
.disabledRanges=${e.disabledRanges}
|
|
2191
|
+
?allow-custom-time=${e.allowCustomTime}
|
|
2192
|
+
.height=${e.height}
|
|
2193
|
+
.itemHeight=${e.itemHeight}
|
|
2194
|
+
.minTimeMessage=${e.minTimeMessage}
|
|
2195
|
+
.maxTimeMessage=${e.maxTimeMessage}
|
|
2196
|
+
.disabledRangeMessage=${e.disabledRangeMessage}
|
|
2197
|
+
.noAvailableTimesMessage=${e.noAvailableTimesMessage}
|
|
2198
|
+
@inputError=${this.onInputError}
|
|
2199
|
+
@blur=${()=>this.adapter.onBlur()}
|
|
2200
|
+
@change=${this.valueChanged}
|
|
2201
|
+
></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`
|
|
2203
|
+
<gui-date-time
|
|
2204
|
+
class=${w.classMap(e.widgetClasses)}
|
|
2205
|
+
.uid=${this.widget.uid}
|
|
2206
|
+
.label=${this.adapter.templateData.label}
|
|
2207
|
+
.hint=${this.adapter.templateData.hint}
|
|
2208
|
+
.errors=${this.adapter.templateData.errors}
|
|
2209
|
+
?touched=${this.adapter.templateData.touched}
|
|
2210
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
2211
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
2212
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
2213
|
+
.value=${this.adapter.templateData.value}
|
|
2214
|
+
.icon=${this.adapter.templateData.icon}
|
|
2215
|
+
.localeId=${this.adapter.templateData.lang}
|
|
2216
|
+
.invalidDateMessage=${this.adapter.templateData.invalidDateMessage}
|
|
2217
|
+
.minDate=${this.adapter.templateData.minDate}
|
|
2218
|
+
.maxDate=${this.adapter.templateData.maxDate}
|
|
2219
|
+
.minTime=${this.adapter.templateData.minTime}
|
|
2220
|
+
.maxTime=${this.adapter.templateData.maxTime}
|
|
2221
|
+
.minDateMessage=${this.adapter.templateData.minDateMessage}
|
|
2222
|
+
.maxDateMessage=${this.adapter.templateData.maxDateMessage}
|
|
2223
|
+
.minTimeMessage=${this.adapter.templateData.minTimeMessage}
|
|
2224
|
+
.maxTimeMessage=${this.adapter.templateData.maxTimeMessage}
|
|
2225
|
+
.hourFormat=${this.adapter.templateData.hourFormat}
|
|
2226
|
+
.minuteStep=${this.adapter.templateData.minuteStep}
|
|
2227
|
+
@inputError=${this.onInputError}
|
|
2228
|
+
@blur=${()=>this.adapter.onBlur()}
|
|
2229
|
+
@change=${this.valueChanged}
|
|
2230
|
+
></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)}>
|
|
2232
|
+
${s}
|
|
1180
2233
|
<span> / ${e.maxLength}</span>
|
|
1181
|
-
</div>`}const i={height:`${e.minimumHeight}px`,"min-height":`${e.minimumHeight}px`},
|
|
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`
|
|
1182
2235
|
${se(this.uid,e)}
|
|
1183
2236
|
|
|
1184
2237
|
<div class="gui-widget">
|
|
@@ -1186,12 +2239,12 @@
|
|
|
1186
2239
|
id=${this.uid}
|
|
1187
2240
|
data-cy=${`${this.uid}_textarea`}
|
|
1188
2241
|
class="gui-widget-input"
|
|
1189
|
-
style=${
|
|
2242
|
+
style=${bt.styleMap(i)}
|
|
1190
2243
|
?required=${e.required}
|
|
1191
2244
|
?disabled=${e.disabled}
|
|
1192
2245
|
?readonly=${e.readonly}
|
|
1193
|
-
placeholder=${e.placeholder||
|
|
1194
|
-
autocomplete=${this.autocomplete||
|
|
2246
|
+
placeholder=${e.placeholder||l.nothing}
|
|
2247
|
+
autocomplete=${this.autocomplete||l.nothing}
|
|
1195
2248
|
.value=${this.value||""}
|
|
1196
2249
|
@input=${this.valueChanged}
|
|
1197
2250
|
@blur=${this.onBlur}
|
|
@@ -1199,10 +2252,10 @@
|
|
|
1199
2252
|
</div>
|
|
1200
2253
|
|
|
1201
2254
|
<div class="gui-textarea--validation">
|
|
1202
|
-
<div>${
|
|
2255
|
+
<div>${W(this.uid,e)}</div>
|
|
1203
2256
|
${t}
|
|
1204
2257
|
</div>
|
|
1205
|
-
`}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}))}};
|
|
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`
|
|
1206
2259
|
<gui-textarea
|
|
1207
2260
|
.uid=${this.widget.uid}
|
|
1208
2261
|
.label=${this.adapter.templateData.label}
|
|
@@ -1222,7 +2275,7 @@
|
|
|
1222
2275
|
@input=${this.valueChanged}
|
|
1223
2276
|
@blur=${()=>this.adapter.onBlur()}
|
|
1224
2277
|
></gui-textarea>
|
|
1225
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
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`
|
|
1226
2279
|
<label
|
|
1227
2280
|
class="gui-label"
|
|
1228
2281
|
for=${this.uid}
|
|
@@ -1251,9 +2304,9 @@
|
|
|
1251
2304
|
</label>
|
|
1252
2305
|
|
|
1253
2306
|
<div class="gui-widget-hint" id=${`${e.uid}_hint`}>
|
|
1254
|
-
${e.hint??
|
|
2307
|
+
${e.hint??l.nothing} ${W(this.uid,e)}
|
|
1255
2308
|
</div>
|
|
1256
|
-
`}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}))}};
|
|
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`
|
|
1257
2310
|
<gui-toggle
|
|
1258
2311
|
.uid=${this.widget.uid}
|
|
1259
2312
|
.label=${this.adapter.templateData.label}
|
|
@@ -1268,7 +2321,7 @@
|
|
|
1268
2321
|
@change=${this.valueChanged}
|
|
1269
2322
|
@blur=${()=>this.adapter.onBlur()}
|
|
1270
2323
|
></gui-toggle>
|
|
1271
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
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`
|
|
1272
2325
|
<label
|
|
1273
2326
|
class="gui-label"
|
|
1274
2327
|
for=${this.uid}
|
|
@@ -1295,9 +2348,9 @@
|
|
|
1295
2348
|
</label>
|
|
1296
2349
|
|
|
1297
2350
|
<div class="gui-widget-hint" id=${`${e.uid}_hint`}>
|
|
1298
|
-
${e.hint??
|
|
2351
|
+
${e.hint??l.nothing} ${W(this.uid,e)}
|
|
1299
2352
|
</div>
|
|
1300
|
-
`}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}))}};
|
|
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`
|
|
1301
2354
|
<gui-checkbox
|
|
1302
2355
|
.uid=${this.widget.uid}
|
|
1303
2356
|
.label=${this.adapter.templateData.label}
|
|
@@ -1312,7 +2365,7 @@
|
|
|
1312
2365
|
@change=${this.valueChanged}
|
|
1313
2366
|
@blur=${()=>this.adapter.onBlur()}
|
|
1314
2367
|
></gui-checkbox>
|
|
1315
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
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`
|
|
1316
2369
|
${se(this.uid,i)}
|
|
1317
2370
|
|
|
1318
2371
|
<div class="gui-widget">
|
|
@@ -1322,15 +2375,16 @@
|
|
|
1322
2375
|
id=${this.uid}
|
|
1323
2376
|
data-cy=${`${this.uid}_number`}
|
|
1324
2377
|
class="gui-widget-input"
|
|
1325
|
-
style=${
|
|
2378
|
+
style=${bt.styleMap(t)}
|
|
1326
2379
|
value=${this.value}
|
|
1327
2380
|
?required=${this.required}
|
|
1328
2381
|
?disabled=${this.disabled}
|
|
1329
2382
|
?readonly=${this.readOnly}
|
|
1330
|
-
step=${typeof this.step=="number"?this.step:
|
|
1331
|
-
placeholder=${this.placeholder||
|
|
1332
|
-
autocomplete=${this.autocomplete||
|
|
2383
|
+
step=${typeof this.step=="number"?this.step:l.nothing}
|
|
2384
|
+
placeholder=${this.placeholder||l.nothing}
|
|
2385
|
+
autocomplete=${this.autocomplete||l.nothing}
|
|
1333
2386
|
@input=${this.valueChanged}
|
|
2387
|
+
@beforeinput=${Xs}
|
|
1334
2388
|
@keydown=${this.keyDown}
|
|
1335
2389
|
@blur=${this.onBlur}
|
|
1336
2390
|
/>
|
|
@@ -1348,8 +2402,8 @@
|
|
|
1348
2402
|
</span>
|
|
1349
2403
|
</div>
|
|
1350
2404
|
|
|
1351
|
-
${
|
|
1352
|
-
`}keyDown(e){switch(e.stopPropagation(),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}))}};
|
|
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`
|
|
1353
2407
|
<gui-number
|
|
1354
2408
|
.uid=${this.widget.uid}
|
|
1355
2409
|
.label=${this.adapter.templateData.label}
|
|
@@ -1369,38 +2423,38 @@
|
|
|
1369
2423
|
@input=${this.valueChanged}
|
|
1370
2424
|
@blur=${()=>this.adapter.onBlur()}
|
|
1371
2425
|
></gui-number>
|
|
1372
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
1373
|
-
${
|
|
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}`}>
|
|
1374
2428
|
<input
|
|
1375
2429
|
type="radio"
|
|
1376
|
-
tabindex=${
|
|
1377
|
-
id=${`${this.uid}_${
|
|
1378
|
-
data-cy=${`${this.uid}_radiogroup_${
|
|
2430
|
+
tabindex=${u?"0":"-1"}
|
|
2431
|
+
id=${`${this.uid}_${r}`}
|
|
2432
|
+
data-cy=${`${this.uid}_radiogroup_${r}`}
|
|
1379
2433
|
name=${this.uid}
|
|
1380
|
-
value=${
|
|
1381
|
-
?checked=${
|
|
2434
|
+
value=${a.value}
|
|
2435
|
+
?checked=${s}
|
|
1382
2436
|
?required=${e.required}
|
|
1383
2437
|
?disabled=${e.disabled||e.readonly}
|
|
1384
2438
|
@change=${this.valueChanged}
|
|
1385
2439
|
@blur=${this.onBlur}
|
|
1386
2440
|
/>
|
|
1387
|
-
${
|
|
2441
|
+
${a.label}
|
|
1388
2442
|
</label>`})}
|
|
1389
|
-
`;return
|
|
2443
|
+
`;return l.html`
|
|
1390
2444
|
${se(this.uid,e,!1,void 0,!1)}
|
|
1391
2445
|
|
|
1392
2446
|
<div
|
|
1393
2447
|
class="gui-widget${this.direction==="row"?" gui-widget--horizontal":""}"
|
|
1394
2448
|
role="radiogroup"
|
|
1395
2449
|
id=${this.uid}
|
|
1396
|
-
aria-labelledby=${e.label?`${this.uid}_label`:
|
|
1397
|
-
aria-describedby=${e.hint?`${this.uid}_hint`:
|
|
2450
|
+
aria-labelledby=${e.label?`${this.uid}_label`:l.nothing}
|
|
2451
|
+
aria-describedby=${e.hint?`${this.uid}_hint`:l.nothing}
|
|
1398
2452
|
>
|
|
1399
2453
|
${i}
|
|
1400
2454
|
</div>
|
|
1401
2455
|
|
|
1402
|
-
${
|
|
1403
|
-
`}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:
|
|
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`
|
|
1404
2458
|
<gui-radiogroup
|
|
1405
2459
|
.uid=${this.widget.uid}
|
|
1406
2460
|
.label=${this.adapter.templateData.label}
|
|
@@ -1418,17 +2472,17 @@
|
|
|
1418
2472
|
@change=${this.valueChanged}
|
|
1419
2473
|
@blur=${()=>this.adapter.onBlur()}
|
|
1420
2474
|
></gui-radiogroup>
|
|
1421
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
1422
|
-
<option value="" disabled selected=${this.hasMatchingValue?
|
|
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`
|
|
2476
|
+
<option value="" disabled selected=${this.hasMatchingValue?l.nothing:""}>
|
|
1423
2477
|
${this.placeholder??"Select an option"}
|
|
1424
2478
|
</option>
|
|
1425
|
-
${
|
|
1426
|
-
value=${
|
|
1427
|
-
selected=${this.hasMatchingValue&&
|
|
2479
|
+
${qe.repeat(this.options||[],a=>a?.value,a=>l.html`<option
|
|
2480
|
+
value=${a.value}
|
|
2481
|
+
selected=${this.hasMatchingValue&&a.value===this.value?"":l.nothing}
|
|
1428
2482
|
>
|
|
1429
|
-
${
|
|
2483
|
+
${a.label}
|
|
1430
2484
|
</option>`)}
|
|
1431
|
-
`;return
|
|
2485
|
+
`;return l.html`
|
|
1432
2486
|
${se(this.uid,e)}
|
|
1433
2487
|
|
|
1434
2488
|
<div class="gui-widget">
|
|
@@ -1436,10 +2490,10 @@
|
|
|
1436
2490
|
id=${this.uid}
|
|
1437
2491
|
tabindex="0"
|
|
1438
2492
|
data-cy=${`${this.uid}_select`}
|
|
1439
|
-
class=${
|
|
2493
|
+
class=${w.classMap({"gui-widget-input":!0,...t.widgetClasses})}
|
|
1440
2494
|
?required=${e.required}
|
|
1441
2495
|
?disabled=${e.disabled||e.readonly}
|
|
1442
|
-
autocomplete=${this.autocomplete||
|
|
2496
|
+
autocomplete=${this.autocomplete||l.nothing}
|
|
1443
2497
|
@change=${this.valueChanged}
|
|
1444
2498
|
@blur=${this.onBlur}
|
|
1445
2499
|
>
|
|
@@ -1454,8 +2508,8 @@
|
|
|
1454
2508
|
${t.html}
|
|
1455
2509
|
</div>
|
|
1456
2510
|
|
|
1457
|
-
${
|
|
1458
|
-
`}updated(e){e.has("value")&&!this.hasMatchingValue&&this.value&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message
|
|
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`
|
|
1459
2513
|
<gui-select
|
|
1460
2514
|
.uid=${this.widget.uid}
|
|
1461
2515
|
.label=${this.adapter.templateData.label}
|
|
@@ -1472,25 +2526,26 @@
|
|
|
1472
2526
|
.options=${this.adapter.templateData.options}
|
|
1473
2527
|
.labelField=${this.adapter.templateData.labelField}
|
|
1474
2528
|
.valueField=${this.adapter.templateData.valueField}
|
|
2529
|
+
.invalidOptionMessage=${this.adapter.templateData.invalidOptionMessage}
|
|
1475
2530
|
@change=${this.valueChanged}
|
|
1476
2531
|
@inputError=${this.onInputError}
|
|
1477
2532
|
@blur=${()=>this.adapter.onBlur()}
|
|
1478
2533
|
></gui-select>
|
|
1479
|
-
`}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())}};
|
|
1480
|
-
${this.label?se(this.uid,t,!1,void 0,!1):
|
|
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}
|
|
1481
2536
|
|
|
1482
2537
|
<div class="gui-widget">
|
|
1483
2538
|
<div
|
|
1484
|
-
class=${
|
|
2539
|
+
class=${w.classMap({"gui-widget-input":!0,"gui-tags-input":!0,"gui-tags-input--icon":!!this.icon})}
|
|
1485
2540
|
role="group"
|
|
1486
2541
|
aria-label=${this.label??"Tags input"}
|
|
1487
2542
|
>
|
|
1488
|
-
${this.icon?
|
|
2543
|
+
${this.icon?l.html`<span class=${w.classMap(i)} data-icon=${this.icon}></span>`:l.nothing}
|
|
1489
2544
|
|
|
1490
2545
|
<gui-pills
|
|
1491
2546
|
class="gui-tags__pills"
|
|
1492
|
-
style=${
|
|
1493
|
-
.items=${
|
|
2547
|
+
style=${bt.styleMap(a.length?{}:{"min-width":0})}
|
|
2548
|
+
.items=${a}
|
|
1494
2549
|
.removable=${!0}
|
|
1495
2550
|
.clickable=${!1}
|
|
1496
2551
|
.bubble=${!0}
|
|
@@ -1511,18 +2566,18 @@
|
|
|
1511
2566
|
class="gui-tags__input"
|
|
1512
2567
|
?disabled=${this.disabled}
|
|
1513
2568
|
?readonly=${this.readOnly}
|
|
1514
|
-
placeholder=${this.placeholder||
|
|
2569
|
+
placeholder=${this.placeholder||l.nothing}
|
|
1515
2570
|
@keydown=${this.onInputKeydown}
|
|
1516
2571
|
@blur=${this.onInputBlur}
|
|
1517
2572
|
@paste=${this.onPaste}
|
|
1518
|
-
@change=${
|
|
2573
|
+
@change=${r=>r.stopPropagation()}
|
|
1519
2574
|
/>
|
|
1520
2575
|
</div>
|
|
1521
2576
|
|
|
1522
|
-
${
|
|
2577
|
+
${W(this.uid,t)}
|
|
1523
2578
|
</div>
|
|
1524
|
-
`}onInputKeydown(e){if(this.disabled||this.readOnly)return;const t=e.target,i=this.getSeparators(),
|
|
1525
|
-
]`);if(!
|
|
2579
|
+
`}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`
|
|
1526
2581
|
<gui-tags
|
|
1527
2582
|
.uid=${this.widget.uid}
|
|
1528
2583
|
.label=${this.adapter.templateData.label}
|
|
@@ -1544,7 +2599,7 @@
|
|
|
1544
2599
|
@change=${this.valueChanged}
|
|
1545
2600
|
@blur=${()=>this.adapter.onBlur()}
|
|
1546
2601
|
></gui-tags>
|
|
1547
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
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`
|
|
1548
2603
|
<div
|
|
1549
2604
|
id=${this.widget.uid}
|
|
1550
2605
|
class=${`gui-repeater__main-card gui-repeater__card ${this.isFocused?"gui-repeater__card--focused":""}`}
|
|
@@ -1560,31 +2615,31 @@
|
|
|
1560
2615
|
.required=${e.validator?.required}
|
|
1561
2616
|
.native=${!1}
|
|
1562
2617
|
></gui-label>
|
|
1563
|
-
${e.value?
|
|
2618
|
+
${e.value?qe.repeat(e.value,i=>cp(i,sc),(i,a)=>l.html`
|
|
1564
2619
|
<div class="gui-repeater__card">
|
|
1565
2620
|
<div class="gui-repeater__card-header">
|
|
1566
|
-
${e.title?
|
|
1567
|
-
>${e.title} ${
|
|
1568
|
-
>`:
|
|
2621
|
+
${e.title?l.html`<span class="gui-repeater__card-title"
|
|
2622
|
+
>${e.title} ${a+1}</span
|
|
2623
|
+
>`:l.nothing}
|
|
1569
2624
|
<button
|
|
1570
2625
|
type="button"
|
|
1571
2626
|
tabindex="0"
|
|
1572
2627
|
class="gui-button gui-button--sm gui-repeater__remove-btn"
|
|
1573
|
-
@click=${()=>this.removeItem(
|
|
2628
|
+
@click=${()=>this.removeItem(a)}
|
|
1574
2629
|
>
|
|
1575
|
-
${e.removeButtonIcon?
|
|
2630
|
+
${e.removeButtonIcon?l.html`<span
|
|
1576
2631
|
class="gui-widget-icon gui-button-icon ${e.removeButtonIcon}"
|
|
1577
2632
|
data-icon=${e.removeButtonIcon}
|
|
1578
|
-
></span>`:
|
|
2633
|
+
></span>`:l.nothing}
|
|
1579
2634
|
${e.removeLabel??"Remove"}
|
|
1580
2635
|
</button>
|
|
1581
2636
|
</div>
|
|
1582
2637
|
<gui-repeater-widget
|
|
1583
|
-
.repeaterIndex=${
|
|
2638
|
+
.repeaterIndex=${a}
|
|
1584
2639
|
.widget=${e.template}
|
|
1585
2640
|
></gui-repeater-widget>
|
|
1586
2641
|
</div>
|
|
1587
|
-
`):
|
|
2642
|
+
`):l.nothing}
|
|
1588
2643
|
|
|
1589
2644
|
<button
|
|
1590
2645
|
type="button"
|
|
@@ -1593,68 +2648,68 @@
|
|
|
1593
2648
|
@click=${()=>this.addItem()}
|
|
1594
2649
|
?disabled=${!!(e.limit&&e.limit===e.value?.length)}
|
|
1595
2650
|
>
|
|
1596
|
-
${e.addButtonIcon?
|
|
2651
|
+
${e.addButtonIcon?l.html`<span
|
|
1597
2652
|
class="gui-widget-icon gui-button-icon ${e.addButtonIcon}"
|
|
1598
2653
|
data-icon=${e.addButtonIcon}
|
|
1599
|
-
></span>`:
|
|
2654
|
+
></span>`:l.nothing}
|
|
1600
2655
|
${e.addLabel??"Add"}
|
|
1601
2656
|
</button>
|
|
1602
2657
|
</div>
|
|
1603
|
-
${t?
|
|
2658
|
+
${t?l.html`<gui-errors
|
|
1604
2659
|
.uid=${this.widget.uid}
|
|
1605
2660
|
.errors=${e.errors}
|
|
1606
2661
|
.touched=${e.touched}
|
|
1607
|
-
></gui-errors>`:
|
|
1608
|
-
`}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,
|
|
2662
|
+
></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`
|
|
1609
2664
|
<div
|
|
1610
|
-
class=${
|
|
2665
|
+
class=${w.classMap(e)}
|
|
1611
2666
|
id=${this.widget?.uid}
|
|
1612
2667
|
style=${this.adapter.templateData.gap?`gap: ${this.adapter.templateData.gap}px`:""}
|
|
1613
2668
|
>
|
|
1614
|
-
${
|
|
2669
|
+
${qe.repeat(this.adapter.templateData.children||[],t=>t?.uid,t=>l.html`<gui-widget .widget=${t}></gui-widget>`)}
|
|
1615
2670
|
</div>
|
|
1616
|
-
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
1617
|
-
<div class=${
|
|
1618
|
-
${
|
|
1619
|
-
<gui-widget .widget=${
|
|
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}">
|
|
2674
|
+
<gui-widget .widget=${s}></gui-widget>
|
|
1620
2675
|
</div>`)}
|
|
1621
2676
|
</div>
|
|
1622
|
-
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}
|
|
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}>
|
|
1623
2678
|
<ul role="tablist">
|
|
1624
2679
|
<li role="presentation" id="start-sentinel" class="gui-sentinel"></li>
|
|
1625
|
-
${this.adapter.templateData.tabs?
|
|
2680
|
+
${this.adapter.templateData.tabs?qe.repeat(this.adapter.templateData.tabs,(i,a)=>l.html`
|
|
1626
2681
|
<li role="presentation">
|
|
1627
2682
|
<button
|
|
1628
2683
|
type="button"
|
|
1629
2684
|
role="tab"
|
|
1630
2685
|
tabindex=${i.uid===this.activeTab?"0":"-1"}
|
|
1631
|
-
data-cy=${`tab_${this.widget.uid}_${
|
|
1632
|
-
id=${`tab_${this.widget.uid}_${
|
|
1633
|
-
aria-controls=${`tabpanel_${this.widget.uid}_${
|
|
2686
|
+
data-cy=${`tab_${this.widget.uid}_${a}`}
|
|
2687
|
+
id=${`tab_${this.widget.uid}_${a}`}
|
|
2688
|
+
aria-controls=${`tabpanel_${this.widget.uid}_${a}`}
|
|
1634
2689
|
aria-selected=${i.uid===this.activeTab?"true":"false"}
|
|
1635
|
-
class=${
|
|
2690
|
+
class=${w.classMap({active:i.uid===this.activeTab})}
|
|
1636
2691
|
@click=${()=>this.onClickTab(i.uid)}
|
|
1637
2692
|
@keydown=${this.onKeyDown}
|
|
1638
|
-
@focus=${
|
|
2693
|
+
@focus=${r=>r.target.scrollIntoView({block:"nearest",inline:"nearest"})}
|
|
1639
2694
|
>
|
|
1640
2695
|
${i.label}
|
|
1641
2696
|
</button>
|
|
1642
2697
|
</li>
|
|
1643
|
-
`):
|
|
2698
|
+
`):l.nothing}
|
|
1644
2699
|
<li role="presentation" id="end-sentinel" class="gui-sentinel gui-sentinel__end"></li>
|
|
1645
2700
|
</ul>
|
|
1646
2701
|
</nav>
|
|
1647
|
-
${
|
|
2702
|
+
${qe.repeat(e,i=>i?.uid,(i,a)=>l.html`<section
|
|
1648
2703
|
role="tabpanel"
|
|
1649
|
-
data-cy=${`tabpanel_${this.widget.uid}_${
|
|
1650
|
-
id=${`tabpanel_${this.widget.uid}_${
|
|
2704
|
+
data-cy=${`tabpanel_${this.widget.uid}_${a}`}
|
|
2705
|
+
id=${`tabpanel_${this.widget.uid}_${a}`}
|
|
1651
2706
|
?hidden=${i.uid!==this.activeTab&&this.adapter.templateData.renderMode!=="activeOnly"}
|
|
1652
|
-
aria-labelledby=${`tab_${this.widget.uid}_${
|
|
2707
|
+
aria-labelledby=${`tab_${this.widget.uid}_${a}`}
|
|
1653
2708
|
>
|
|
1654
2709
|
<gui-widget .widget=${i}></gui-widget>
|
|
1655
|
-
</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(
|
|
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`
|
|
1656
2711
|
<div class="gui-widget" id=${this.widget.uid}>
|
|
1657
|
-
${this.adapter.templateData.sections?
|
|
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
|
|
1658
2713
|
class="gui-widget"
|
|
1659
2714
|
role="region"
|
|
1660
2715
|
id=${`accordion_section_${e.uid}`}
|
|
@@ -1662,11 +2717,11 @@
|
|
|
1662
2717
|
aria-labelledby=${`accordion_button_${e.uid}`}
|
|
1663
2718
|
>
|
|
1664
2719
|
<gui-widget .widget=${this.getChild(e.uid)}></gui-widget>
|
|
1665
|
-
</section>`:
|
|
2720
|
+
</section>`:l.nothing;return l.html`<div class="gui-accordion__section">
|
|
1666
2721
|
<button
|
|
1667
2722
|
type="button"
|
|
1668
2723
|
tabindex="0"
|
|
1669
|
-
class=${
|
|
2724
|
+
class=${w.classMap({active:this.activeSections[e.uid]})}
|
|
1670
2725
|
id=${`accordion_button_${e.uid}`}
|
|
1671
2726
|
aria-controls=${`accordion_section_${e.uid}`}
|
|
1672
2727
|
aria-expanded=${this.activeSections[e.uid]?"true":"false"}
|
|
@@ -1686,9 +2741,9 @@
|
|
|
1686
2741
|
</button>
|
|
1687
2742
|
|
|
1688
2743
|
${t}
|
|
1689
|
-
</div>`}):
|
|
2744
|
+
</div>`}):l.nothing}
|
|
1690
2745
|
</div>
|
|
1691
|
-
`:
|
|
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`
|
|
1692
2747
|
<div class="gui-widget" id=${this.widget.uid}>
|
|
1693
2748
|
<div
|
|
1694
2749
|
role="alert"
|
|
@@ -1697,13 +2752,13 @@
|
|
|
1697
2752
|
${this.adapter.templateData.text}
|
|
1698
2753
|
</div>
|
|
1699
2754
|
</div>
|
|
1700
|
-
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
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`
|
|
1701
2756
|
<div class="gui-widget" id=${this.widget.uid}>
|
|
1702
2757
|
<gui-markdown-text
|
|
1703
2758
|
.md=${this.adapter.templateData.md}
|
|
1704
2759
|
.dependencies=${this.adapter.templateData.deps}
|
|
1705
2760
|
></gui-markdown-text>
|
|
1706
2761
|
</div>
|
|
1707
|
-
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
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`
|
|
1708
2763
|
<div class="gui-widget" id=${this.widget.uid}>${this.adapter.templateData.render}</div>
|
|
1709
|
-
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
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"})}));
|