@golemui/gui-lit 0.14.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/{button.element-ATNRRDN3.js → button.element-DxwYDdu6.js} +49 -45
- package/{currency.element-C7SZkoPP.js → currency.element-ybKzwXEh.js} +11 -10
- package/{date-input-e0k3oBof.js → date-input-D_Swskk4.js} +5 -5
- package/{date-picker.element-D6v6aHR5.js → date-picker.element-CP2_u_ZE.js} +1 -1
- package/{date.element-COU_mEUt.js → date.element-p6aB6OGd.js} +1 -1
- package/{dropdown.element-DCUI5Y7I.js → dropdown.element-8OaBgk7F.js} +1 -0
- package/index.js +271 -279
- package/index.umd.cjs +268 -195
- package/lib/components/range-date-picker.element.d.ts +3 -0
- package/lib/components/tags.element.d.ts +17 -0
- package/{markdown.element-CT1JOOM3.js → markdown.element-1IF3G5KX.js} +1 -0
- package/{number.element-HaXEg_7U.js → number.element-zgd4L5hn.js} +7 -6
- package/package.json +6 -6
- package/{password.element-B4-0SCe4.js → password.element-BT65mDsp.js} +1 -0
- package/pills-D0yyi-op.js +323 -0
- package/range-calendar-CZGBBOzO.js +258 -0
- package/{range-calendar.element-C-4qqRGK.js → range-calendar.element-DQZXvd-L.js} +1 -1
- package/range-date-input-CcPYH7P3.js +398 -0
- package/{range-date-input.element-D3xRMAaY.js → range-date-input.element-v71P-oUp.js} +1 -1
- package/{range-date-picker.element-Vgj3tFlQ.js → range-date-picker.element-CA-KcQhA.js} +60 -51
- package/{select.element-DuGZjlZY.js → select.element-CjWqp9dd.js} +1 -1
- package/tags.element-ed1_51GA.js +365 -0
- package/{textarea.element-C8yx2u0o.js → textarea.element-BTJLqnnI.js} +6 -5
- package/{textinput.element-DKuplF1A.js → textinput.element-zI0iG-Cq.js} +4 -3
- package/range-calendar-qpakwAba.js +0 -326
- package/range-date-input-DFnvo-KK.js +0 -507
package/index.umd.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
(function(S,ke){typeof exports=="object"&&typeof module<"u"?ke(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/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/unsafe-html.js"],ke):(S=typeof globalThis<"u"?globalThis:S||self,ke(S["gui-lit"]={},S.core,S.guiShared,S.lit$1,S.lit,S.decorators_js,S.context,S.rxjs,S.classMap_js,S.repeat_js,S.live_js,S.styleMap_js,S.ifDefined_js,S.unsafeHtml_js))})(this,(function(S,ke,qa,y,d,o,D,Si,$,Q,Oi,qt,Bt,Ba){"use strict";const xi={LAYOUTS:"LAYOUTS",DISPLAYS:"DISPLAYS"};function Za(e){return function(t,i=()=>!0){return{kind:"leaf",selectorType:e,matcher:i,config:t}}}const _t=new Map;function Ei(e,t){if(_t.has(e))throw new Error(`Item type "${e}" is already registered.`);_t.set(e,t)}function Ct(e){const t=_t.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 Pi(e){return _t.has(e)}function C(e){const t=l=>{if(!e.sensibleDefaults)return{};let u={...e.sensibleDefaults.base};for(const p of l){const c=p.config;for(const h of e.sensibleDefaults.fields){const f=h;c[f]!=null&&(u={...u,[f]:c[f]})}}return u},i=(l,u)=>e.sensibleDefaults?e.sensibleDefaults.apply(l,u):l,n=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:n,...e.afterMerge?{afterMerge:e.afterMerge}:{},...e.buildCustomWidget?{buildCustomWidget:e.buildCustomWidget}:{},...e.getChildren?{getChildren:e.getChildren}:{}};Ei(e.itemType,a);const s=Za(e.itemType);return{gsl:s,gslByUid:(l,u)=>s(u,(p=>p.uid===l))}}function Va(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 G(e,t){return e.label!=null||t.suppressAutomaticLabels||!e.path?e:{...e,label:Va(e.path)}}function Se(e,t){return e.placeholder!=null||t.suppressAutomaticPlaceholders||!e.path?e:{...e,placeholder:e.path}}const Ua=(e,t)=>({type:"ITEMS",itemType:xi.DISPLAYS,items:[{render:e}],tags:[]}),Ii={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"]),ACTIONS:new Set(["ACTIONS","CUSTOM_ACTION"]),DISPLAYS:new Set(["DISPLAYS","ALERTS","CUSTOM_DISPLAY"]),LAYOUTS:new Set(["LAYOUTS","TABS","ACCORDION","CUSTOM_LAYOUT"])};function Wa(e,t){const i=Ii[e];return i?i.has(t):e===t}class Ga{resolve(t,i){const n=[];for(const s of i)s.kind==="aggregated"?this.collectFromAggregated(s,t,n):this.collectFromLeaf(s,t,n);const a=this.rollUpSensibleDefaults(n);return{leafSelectors:n,sensibleDefaults:a}}collectFromAggregated(t,i,n){if(t.matcher(i))for(const a of t.children)this.collectFromLeaf(a,i,n)}collectFromLeaf(t,i,n){Wa(t.selectorType,i.itemType??"")&&t.matcher(i)&&n.push(t)}rollUpSensibleDefaults(t){const i=new Map,n=(s,r)=>{const l=i.get(s)??[];l.push(r),i.set(s,l)};for(const s of t){const r=Ii[s.selectorType];if(r)for(const l of r)n(l,s);else n(s.selectorType,s)}const a={};for(const[s,r]of i)Pi(s)&&(a[s]=Ct(s).rollUpSensibleDefaults(r));return a}}const Ha=new Ga;class Ya{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 n={...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?n[a]=this.deepMerge(t[a],i[a]):n[a]=i[a]);return n}}const Ka=new Ya;class Ja{constructor(t){this.objectUtils=t}merge(t,i,n){let a={},s=null;typeof t=="function"&&(s=t);const r=this.collectDecorators(n);for(const p of r){if(s!=null){s=this.composeRuntimeFunctions(s,p);continue}if(typeof p=="function"){const c=p({...a,...typeof t=="function"?{}:t});if(typeof c=="function"){s=this.createPromotedFunction(a,t,c,i,n);continue}a=this.objectUtils.deepMerge(a,c)}else a=this.objectUtils.deepMerge(a,p)}if(s!=null)return{kind:"dynamic",fn:this.wrapWithSensibleDefaults(s,a,i,n)};const l=this.objectUtils.deepMerge(t,a);return{kind:"static",def:this.applySensibleDefaults({...l},i,n)}}collectDecorators(t){const i=[];for(const n of t.leafSelectors){const a=n.config;a.override!=null&&i.push(a.override)}return i}applySensibleDefaults(t,i,n){if(!Pi(i))return t;const a=n.sensibleDefaults[i]??{};return Ct(i).applySensibleDefaults(t,a)}createPromotedFunction(t,i,n,a,s){return r=>{const l=n(r);let u=this.objectUtils.deepMerge(t,l);return u=this.objectUtils.deepMerge(u,i),this.applySensibleDefaults(u,a,s)}}wrapWithSensibleDefaults(t,i,n,a){return s=>{let r=t(s);return Object.keys(i).length>0&&(r=this.objectUtils.deepMerge(i,r)),this.applySensibleDefaults(r,n,a)}}composeRuntimeFunctions(t,i){return typeof i=="function"?n=>{const a=t(n),s=i(a);return typeof s=="function"?s(n):this.objectUtils.deepMerge(s,a)}:n=>{const a=t(n);return this.objectUtils.deepMerge(a,i)}}}const Xa=new Ja(Ka);class Qa{mapToWidget(t,i){if(t.kind==="dynamic"){const n=t.fn;return(a=>{const s=n(a);return this.mapStaticDef(s,i)})}return this.mapStaticDef(t.def,i)}mapStaticDef(t,i){const n=Ct(i).mapToWidget(t);return this.applyBaseWidgetFields(n,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 ja=new Qa;class en{normalizeSelectors(t){const i=Array.isArray(t)?t:[t],n=[],a=[];for(const s of i)s.kind==="leaf"?a.push(s):n.push(s);return a.length>0&&n.unshift({kind:"aggregated",matcher:()=>!0,children:a}),n}extractFormConfig(){return{suppressAutomaticStack:!1,onSubmit:t=>console.log("Form submitted:",t)}}}const tn=new en,Ai={onLoad:"load",onChange:"change",onFilter:"filter",onBlur:"blur"},an=Object.keys(Ai);class nn{extractOnClickFromMergeResult(t,i,n,a){if(t.kind==="dynamic"){const l=t.fn;return{kind:"dynamic",fn:p=>{const c=l(p);return this.wireOnClick(c,i,n,a)}}}const s=t.def;return{kind:"static",def:this.wireOnClick(s,i,n,a)}}wireOnClick(t,i,n,a){const s=t.uid==="#submit"||t.onClick==="submit",r=s?"#submit":a.next(),l=s?"submit":r,u=t.onClick,c=(typeof u=="function"?u:void 0)??(s?n.onSubmit:void 0);if(c){i.set(l,g=>c(g.data));const{onClick:h,...f}=t;return{...f,uid:r,on:{click:l}}}if(s){const{onClick:h,...f}=t;return{...f,uid:r,on:{click:"submit"}}}if(typeof u=="string"){const{onClick:h,...f}=t;return{...f,uid:r,on:{click:u}}}return{...t,uid:r}}wireInputLayoutEvents(t,i,n){if(t.kind==="dynamic"){const s=t.fn;return{kind:"dynamic",fn:l=>{const u=s(l);return this.wireEventProperties(u,i,n)}}}return{kind:"static",def:this.wireEventProperties(t.def,i,n)}}wireEventProperties(t,i,n){const a={...t.on||{}};let s=!1;const r={...t};for(const l of an){const u=t[l];if(u==null)continue;const p=Ai[l];if(typeof u=="function"){const c=n.next();i.set(c,u),a[p]=c,s=!0}else typeof u=="string"&&(a[p]=u,s=!0);delete r[l]}return s&&(r.on=a),r}}const Zt=new nn,sn={input:new Set(["disabled","readonly","label","validator","size"]),action:new Set(["disabled","label","size"]),layout:new Set(["size"]),display:new Set([])},Ti={onChange:"change",onLoad:"load",onFilter:"filter",onClick:"click"};class rn{extractFromMergeResult(t,i){const n={};for(const l of i){const u=l.targetState,p=l.config,c=p.override&&typeof p.override!="function"?p.override:p;n[u]={...n[u]||{},...c}}if(t.kind==="dynamic"){const l=t.fn;return{cleanedResult:{kind:"dynamic",fn:p=>{const c=l(p),{states:h,...f}=c;return f}},stateData:{stateOverrides:n}}}const{states:a,...s}=t.def,r={};for(const[l,u]of Object.entries(n))r[l]={...u};if(a)for(const[l,u]of Object.entries(a))r[l]={...r[l]||{},...u};return{cleanedResult:{kind:"static",def:s},stateData:{stateOverrides:r}}}applyToWidget(t,i,n,a){const{stateOverrides:s}=i;if(Object.keys(s).length===0)return t;const r={...t},l=t.kind,u=sn[l]||new Set;t.props&&(r.props={...t.props}),t.on&&(r.on={...t.on});for(const[p,c]of Object.entries(s))for(const[h,f]of Object.entries(c))h==="visible"?this.applyVisibility(r,p,f):Ti[h]?this.applyStateEvent(r,p,h,f,n,a):u.has(h)?r[`${h}.${p}`]=f:(r.props||(r.props={}),r.props[`${h}.${p}`]=f);return r}hasStateData(t){return Object.keys(t.stateOverrides).length>0}applyVisibility(t,i,n){if(n){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,n,a,s,r){const l=Ti[n];if(t.on||(t.on={}),typeof a=="function"){const u=r.next();s.set(u,a),t.on[`${l}.${i}`]=u}else typeof a=="string"&&(t.on[`${l}.${i}`]=a)}}const on=new rn;function ln(){let e=0;return{next:()=>`event_${e++}`}}class dn{constructor(t,i,n,a,s){this.resolver=t,this.merger=i,this.mapper=n,this.eventWiring=a,this.stateExpansion=s}walkAndMap(t,i,n){const a=new Map,s=ln(),r={value:0},l=new Set;return{widgets:this.walkItems(t,i,a,n,s,r,l),eventRegistry:a}}walkItems(t,i,n,a,s,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,n,a,s,r,l))})}processItem(t,i,n,a,s,r,l,u,p){const c=i,h=Ct(i),f=h.parseEntry(t),g=this.buildBaseDef(f),_=this.buildDecoratorForMatching(g,c,n),T=this.resolver.resolve(_,a),Fa=T.leafSelectors.filter(re=>re.targetState!=null),Ra={leafSelectors:T.leafSelectors.filter(re=>re.targetState==null),sensibleDefaults:T.sensibleDefaults};let Ze=this.merger.merge(g,c,Ra);h.afterMerge&&(Ze=h.afterMerge(Ze,{eventRegistry:s,formConfig:r,eventIdGenerator:l})),Ze=this.eventWiring.wireInputLayoutEvents(Ze,s,l);const{cleanedResult:Na,stateData:Ci}=this.stateExpansion.extractFromMergeResult(Ze,Fa);let Ce;if(h.buildCustomWidget){const re=this.buildCustomWidgetContext(f.children,a,s,r,l,u,p);Ce=this.buildCustomWidget(h,Na,re)}else Ce=this.mapper.mapToWidget(Na,c);if(typeof Ce!="function"){const re=Ce;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(Ci))if(typeof Ce=="function"){const re=Ce;Ce=(Uu=>{const Wu=re(Uu);return this.stateExpansion.applyToWidget(Wu,Ci,s,l)})}else Ce=this.stateExpansion.applyToWidget(Ce,Ci,s,l);return Ce}buildCustomWidgetContext(t,i,n,a,s,r,l){return{children:t,mapStaticDef:(u,p)=>this.mapper.mapStaticDef(u,p),walkChildren:u=>this.walkItems(u,i,n,a,s,r,l)}}buildCustomWidget(t,i,n){return t.buildCustomWidget(i,n)}buildBaseDef(t){const i=t.baseDef;return typeof i=="function"?n=>{const s=i(n??{});return t.path!=null?{...s,path:t.path}:s}:t.path!=null?{...i,path:t.path}:i}buildDecoratorForMatching(t,i,n){if(typeof t=="function")return{itemType:i,tags:[...n]};const a=[...n,..."tags"in t&&t.tags?t.tags:[]],s="uid"in t?t.uid:void 0,r="type"in t?t.type:void 0;return{itemType:i,tags:a,uid:s,type:r}}}function Z(e){const{uid:t,path:i,label:n,disabled:a,readonly:s,defaultValue:r,tags:l,type:u,size:p,onLoad:c,onChange:h,onFilter:f,on:g,states:_,include:T,exclude:Fa,validator:Ra,...Ze}=e;return Ze}function te(e,t){return typeof e=="function"?e:{type:t,...e??{}}}function un(e){switch(e.type){case"text":return cn(e);case"number":return hn(e);case"boolean":return pn(e);default:throw new Error(`Unsupported field type "${e.type}"`)}}function pn(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:te(e.validator,"boolean")}:{},props:t}}function cn(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:te(e.validator,"string")}}function hn(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:te(e.validator,"number")}}C({itemType:"INPUTS",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>{let i=G(e,t);return i=Se(i,t),i}},mapToWidget:un});function mn(e){const{uid:t,label:i,disabled:n,on:a,onClick:s,data:r,type:l,tags:u,size:p,include:c,exclude:h,states:f,...g}=e;return{uid:t??"",kind:"action",type:"button",disabled:n,label:i,...a!=null?{on:a}:{},props:g}}C({itemType:"ACTIONS",entryShape:"bare",mapToWidget:mn,afterMerge:(e,t)=>Zt.extractOnClickFromMergeResult(e,t.eventRegistry,t.formConfig,t.eventIdGenerator)});function yn(e){const{uid:t,widgetName:i,tags:n,size:a,onChange:s,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 fn(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"LAYOUTS"),children:i};const n=e.fn;return(a=>{const s=n(a);return{...t.mapStaticDef(s,"LAYOUTS"),children:i}})}function gn(e){return e.children}C({itemType:"LAYOUTS",entryShape:"compound",mapToWidget:yn,buildCustomWidget:fn,getChildren:gn});function Dn(e){return{uid:"",kind:"display",type:"renderer",props:{render:e.render}}}function bn(e,t){if(e.kind==="static"){const n=e.def;return(a=>({uid:"",kind:"display",type:"renderer",...n.include!=null?{include:n.include}:{},...n.exclude!=null?{exclude:n.exclude}:{},props:{render:n.render(a??{})}}))}const i=e.fn;return(n=>{const a=i(n);return{uid:"",kind:"display",type:"renderer",...a.include!=null?{include:a.include}:{},...a.exclude!=null?{exclude:a.exclude}:{},props:{render:a.render(n??{})}}})}C({itemType:"DISPLAYS",entryShape:"bare",mapToWidget:Dn,buildCustomWidget:bn}),C({itemType:"CALENDAR",entryShape:"bare",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>G(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:te(e.validator,"string")}:{},props:Z(e)})}),C({itemType:"TEXTAREA",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Se(G(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:te(e.validator,"string")}:{},props:Z(e)})}),C({itemType:"PASSWORD",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Se(G(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:te(e.validator,"string")}:{},props:Z(e)})}),C({itemType:"CHECKBOX",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>G(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:te(e.validator,"boolean")}:{},props:Z(e)})}),C({itemType:"DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>G(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:te(e.validator,"string")}:{},props:Z(e)})}),C({itemType:"CURRENCY",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Se(G(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:te(e.validator,"number")}:{},props:Z(e)})}),C({itemType:"RANGE_CALENDAR",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>G(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:te(e.validator,"array")}:{},props:Z(e)})}),C({itemType:"SELECT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Se(G(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:"RADIOGROUP",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>G(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)})});function vn(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 wn(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"TABS"),children:i};const n=e.fn;return(a=>{const s=n(a);return{...t.mapStaticDef(s,"TABS"),children:i}})}function $n(e){return e.children}C({itemType:"TABS",entryShape:"compound",mapToWidget:vn,buildCustomWidget:wn,getChildren:$n}),C({itemType:"LIST",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>G(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:"ALERTS",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"alert",props:{text:e.text,...e.level!=null?{level:e.level}:{}}})}),C({itemType:"DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Se(G(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:te(e.validator,"string")}:{},props:Z(e)})}),C({itemType:"DROPDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Se(G(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)})});function kn(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 _n(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"ACCORDION"),children:i};const n=e.fn;return(a=>{const s=n(a);return{...t.mapStaticDef(s,"ACCORDION"),children:i}})}function Cn(e){return e.children}C({itemType:"ACCORDION",entryShape:"compound",mapToWidget:kn,buildCustomWidget:_n,getChildren:Cn});function Sn(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 On(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:te(e.validator,"array")}:{},props:{...Sn(e),template:{kind:"layout",type:"flex",children:[],props:{direction:"column"}}}}}function Vt(e,t){for(const i of e){if(typeof i=="function")continue;const n=i;typeof n.path=="string"&&n.path&&(n.path=t+n.path),"children"in n&&Array.isArray(n.children)&&Vt(n.children,t);const a=n.props;a?.template?.children&&Array.isArray(a.template.children)&&Vt(a.template.children,t)}}function xn(e,t){const i=t.walkChildren(t.children??[]),n=e.kind==="static"?e.def.path??"":e.fn({})?.path??"";n&&Vt(i,n+".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 s=e.fn;return(r=>{const l=s(r),u=t.mapStaticDef(l,"REPEATER");return{...u,props:{...u.props,template:a}}})}function En(e){return{baseDef:e.def,path:e.key,children:e.children}}function Pn(e){return e.children}Ei("REPEATER",{parseEntry:En,rollUpSensibleDefaults:()=>({}),applySensibleDefaults:e=>e,mapToWidget:On,buildCustomWidget:xn,getChildren:Pn}),C({itemType:"MARKDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Se(G(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:te(e.validator,"string")}:{},props:Z(e)})}),C({itemType:"RANGE_DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>G(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:te(e.validator,"array")}:{},props:Z(e)})}),C({itemType:"RANGE_DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Se(G(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:te(e.validator,"array")}:{},props:Z(e)})}),C({itemType:"CUSTOM_DISPLAY",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:e.customType,props:e.props??{}})}),C({itemType:"CUSTOM_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>G(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:n,on:a,onClick:s,data:r,customType:l,tags:u,size:p,include:c,exclude:h,states:f,props:g,..._}=e;return{uid:t??"",kind:"action",type:e.customType,label:i,disabled:n,...a!=null?{on:a}:{},props:{...g,..._}}},afterMerge:(e,t)=>Zt.extractOnClickFromMergeResult(e,t.eventRegistry,t.formConfig,t.eventIdGenerator)});function In(e){return{uid:e.uid??"",kind:"layout",type:e.customType,props:e.props??{},children:[]}}function An(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"CUSTOM_LAYOUT"),children:i};const n=e.fn;return(a=>{const s=n(a);return{...t.mapStaticDef(s,"CUSTOM_LAYOUT"),children:i}})}function Tn(e){return e.children}C({itemType:"CUSTOM_LAYOUT",entryShape:"compound",mapToWidget:In,buildCustomWidget:An,getChildren:Tn});class Ln{constructor(t,i){this.selectorNormalizer=t,this.walker=i}processDxFacade(t,i=[],n){const{defs:a,gslSelectors:s,formConfig:r}=this.prepareForm(t,i,n),{widgets:l,eventRegistry:u}=this.walker.walkAndMap(a,s,r),p=l[0];return this.buildResult({form:p},u,r)}prepareForm(t,i,n){const s=(Array.isArray(t)?[...t]:[t]).map(u=>typeof u=="function"?Ua(u):u),r=this.selectorNormalizer.normalizeSelectors(i),l={...this.selectorNormalizer.extractFormConfig(),...n};if(!l.suppressAutomaticStack){const u={def:{uid:"#root",direction:"column",widgetName:"flex"},children:s};return{defs:[{type:"ITEMS",itemType:xi.LAYOUTS,items:[u],tags:[]}],gslSelectors:r,formConfig:l}}return{defs:s,gslSelectors:r,formConfig:l}}convertStateNames(t){const i={};for(const[n,a]of Object.entries(t))i[n.replace(/\$/g,":")]=a;return i}buildResult(t,i,n){n.states&&Object.keys(n.states).length>0&&(t={...t,states:this.convertStateNames(n.states)});const a={form:t};return i.size>0&&(a.events=s=>{const r=i.get(s.name);if(r){const l=p=>{if(p&&typeof p=="object"&&"path"in p&&!("type"in p)){const{path:c,...h}=p;for(const[f,g]of Object.entries(h))s.callback({type:"OVERRIDE_WIDGET_PROP",payload:{path:c,prop:f,value:g}})}else s.callback(p)},u={...s,callback:l,update:l};r(u)}}),n.dependencies&&(a.dependencies=n.dependencies),n.widgetLoaders&&(a.widgetLoaders=n.widgetLoaders),n.validateOn&&(a.validateOn=n.validateOn),n.itemRenderers&&(a.itemRenderers=n.itemRenderers),a}}const Mn=new dn(Ha,Xa,ja,Zt,on),zn=new Ln(tn,Mn);function Fn(e){return typeof e=="function"?!0:Array.isArray(e)?e.length===0||e.every(Li):Li(e)}function Li(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"}const Mi=Object.freeze({}),Rn=Object.freeze({}),zi=new WeakMap;function Ut(e,t){return e==null?t:typeof e=="object"?e:{}}function Nn(e,t,i){if(!Fn(e))return{formDef:e};const n=Ut(e,Mi),a=Ut(t,Mi),s=Ut(i,Rn);let r=zi.get(n);r||(r=new WeakMap,zi.set(n,r));let l=r.get(a);l||(l=new WeakMap,r.set(a,l));const u=l.get(s);if(u)return u;const p=zn.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(s,c),c}function qn(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}function m(e,t,i){function n(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 h=0;h<c.length;h++){const f=c[h];f in l||(l[f]=p[f].bind(l))}}const a=i?.Parent??Object;class s extends a{}Object.defineProperty(s,"name",{value:e});function r(l){var u;const p=i?.Parent?new s:this;n(p,l),(u=p._zod).deferred??(u.deferred=[]);for(const c of p._zod.deferred)c();return p}return Object.defineProperty(r,"init",{value:n}),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 Ve extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Fi extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Bn={};function Te(e){return Bn}function Wt(e,t){return typeof t=="bigint"?t.toString():t}function Gt(e){return e==null}function Ht(e){const t=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(t,i)}const Ri=Symbol("evaluating");function k(e,t,i){let n;Object.defineProperty(e,t,{get(){if(n!==Ri)return n===void 0&&(n=Ri,n=i()),n},set(a){Object.defineProperty(e,t,{value:a})},configurable:!0})}function Zn(...e){const t={};for(const i of e){const n=Object.getOwnPropertyDescriptors(i);Object.assign(t,n)}return Object.defineProperties({},t)}function Vn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Ni="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function qi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Yt(e){if(qi(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const i=t.prototype;return!(qi(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function Bi(e){return Yt(e)?{...e}:Array.isArray(e)?[...e]:e}function Kt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Zi(e,t,i){const n=new e._zod.constr(t??e._zod.def);return(!t||i?.parent)&&(n._zod.parent=e),n}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 Un={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 Ue(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 Wn(e,t){return t.map(i=>{var n;return(n=i).path??(n.path=[]),i.path.unshift(e),i})}function St(e){return typeof e=="string"?e:e?.message}function Le(e,t,i){const n={...e,path:e.path??[]};if(!e.message){const a=St(e.inst?._zod.def?.error?.(e))??St(t?.error?.(e))??St(i.customError?.(e))??St(i.localeError?.(e))??"Invalid input";n.message=a}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function Jt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Xe(...e){const[t,i,n]=e;return typeof t=="string"?{message:t,code:"custom",input:i,inst:n}:{...t}}const Vi=(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,Wt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ui=m("$ZodError",Vi),Ot=m("$ZodError",Vi,{Parent:Error});function Gn(e,t=i=>i.message){const i={},n=[];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))):n.push(t(a));return{formErrors:n,fieldErrors:i}}function Hn(e,t=i=>i.message){const i={_errors:[]},n=a=>{for(const s of a.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(r=>n({issues:r}));else if(s.code==="invalid_key")n({issues:s.issues});else if(s.code==="invalid_element")n({issues:s.issues});else if(s.path.length===0)i._errors.push(t(s));else{let r=i,l=0;for(;l<s.path.length;){const u=s.path[l];l===s.path.length-1?(r[u]=r[u]||{_errors:[]},r[u]._errors.push(t(s))):r[u]=r[u]||{_errors:[]},r=r[u],l++}}};return n(e),i}const xt=e=>(t,i,n,a)=>{const s=n?Object.assign(n,{async:!1}):{async:!1},r=t._zod.run({value:i,issues:[]},s);if(r instanceof Promise)throw new Ve;if(r.issues.length){const l=new(a?.Err??e)(r.issues.map(u=>Le(u,s,Te())));throw Ni(l,a?.callee),l}return r.value},Yn=xt(Ot),Et=e=>async(t,i,n,a)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let r=t._zod.run({value:i,issues:[]},s);if(r instanceof Promise&&(r=await r),r.issues.length){const l=new(a?.Err??e)(r.issues.map(u=>Le(u,s,Te())));throw Ni(l,a?.callee),l}return r.value},Kn=Et(Ot),Pt=e=>(t,i,n)=>{const a=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:i,issues:[]},a);if(s instanceof Promise)throw new Ve;return s.issues.length?{success:!1,error:new(e??Ui)(s.issues.map(r=>Le(r,a,Te())))}:{success:!0,data:s.value}},Wi=Pt(Ot),It=e=>async(t,i,n)=>{const a=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:i,issues:[]},a);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(r=>Le(r,a,Te())))}:{success:!0,data:s.value}},Gi=It(Ot),Jn=e=>(t,i,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return xt(e)(t,i,a)},Xn=e=>(t,i,n)=>xt(e)(t,i,n),Qn=e=>async(t,i,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Et(e)(t,i,a)},jn=e=>async(t,i,n)=>Et(e)(t,i,n),es=e=>(t,i,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Pt(e)(t,i,a)},ts=e=>(t,i,n)=>Pt(e)(t,i,n),is=e=>async(t,i,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return It(e)(t,i,a)},as=e=>async(t,i,n)=>It(e)(t,i,n),ns=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Hi=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)$/,ss=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,rs=/^(?:(?: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])$/,os=/^(([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}|:))$/,ls=/^(?=.{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])?)*\.?$/,Yi="(?:(?:\\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])))",ds=new RegExp(`^${Yi}$`);function Ki(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 us(e){return new RegExp(`^${Ki(e)}$`)}function ps(e){const t=Ki({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${i.join("|")})`;return new RegExp(`^${Yi}T(?:${n})$`)}const cs=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},hs=/^-?\d+$/,ms=/^-?\d+(?:\.\d+)?$/,ys=/^(?:true|false)$/i,fs=/^[^A-Z]*$/,gs=/^[^a-z]*$/,he=m("$ZodCheck",(e,t)=>{var i;e._zod??(e._zod={}),e._zod.def=t,(i=e._zod).onattach??(i.onattach=[])}),Ji={number:"number",bigint:"bigint",object:"date"},Ds=m("$ZodCheckLessThan",(e,t)=>{he.init(e,t);const i=Ji[typeof t.value];e._zod.onattach.push(n=>{const a=n._zod.bag,s=(t.inclusive?a.maximum:a.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?a.maximum=t.value:a.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:i,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),bs=m("$ZodCheckGreaterThan",(e,t)=>{he.init(e,t);const i=Ji[typeof t.value];e._zod.onattach.push(n=>{const a=n._zod.bag,s=(t.inclusive?a.minimum:a.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?a.minimum=t.value:a.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:i,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),vs=m("$ZodCheckNumberFormat",(e,t)=>{he.init(e,t),t.format=t.format||"float64";const i=t.format?.includes("int"),n=i?"int":"number",[a,s]=Un[t.format];e._zod.onattach.push(r=>{const l=r._zod.bag;l.format=t.format,l.minimum=a,l.maximum=s,i&&(l.pattern=hs)}),e._zod.check=r=>{const l=r.value;if(i){if(!Number.isInteger(l)){r.issues.push({expected:n,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:n,inclusive:!0,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:n,inclusive:!0,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>s&&r.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),ws=m("$ZodCheckMaxLength",(e,t)=>{var i;he.init(e,t),(i=e._zod.def).when??(i.when=n=>{const a=n.value;return!Gt(a)&&a.length!==void 0}),e._zod.onattach.push(n=>{const a=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<a&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const a=n.value;if(a.length<=t.maximum)return;const r=Jt(a);n.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),$s=m("$ZodCheckMinLength",(e,t)=>{var i;he.init(e,t),(i=e._zod.def).when??(i.when=n=>{const a=n.value;return!Gt(a)&&a.length!==void 0}),e._zod.onattach.push(n=>{const a=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>a&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const a=n.value;if(a.length>=t.minimum)return;const r=Jt(a);n.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),ks=m("$ZodCheckLengthEquals",(e,t)=>{var i;he.init(e,t),(i=e._zod.def).when??(i.when=n=>{const a=n.value;return!Gt(a)&&a.length!==void 0}),e._zod.onattach.push(n=>{const a=n._zod.bag;a.minimum=t.length,a.maximum=t.length,a.length=t.length}),e._zod.check=n=>{const a=n.value,s=a.length;if(s===t.length)return;const r=Jt(a),l=s>t.length;n.issues.push({origin:r,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),At=m("$ZodCheckStringFormat",(e,t)=>{var i,n;he.init(e,t),e._zod.onattach.push(a=>{const s=a._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=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})}):(n=e._zod).check??(n.check=()=>{})}),_s=m("$ZodCheckRegex",(e,t)=>{At.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})}}),Cs=m("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=fs),At.init(e,t)}),Ss=m("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=gs),At.init(e,t)}),Os=m("$ZodCheckIncludes",(e,t)=>{he.init(e,t);const i=Kt(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${i}`:i);t.pattern=n,e._zod.onattach.push(a=>{const s=a._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),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})}}),xs=m("$ZodCheckStartsWith",(e,t)=>{he.init(e,t);const i=new RegExp(`^${Kt(t.prefix)}.*`);t.pattern??(t.pattern=i),e._zod.onattach.push(n=>{const a=n._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(i)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Es=m("$ZodCheckEndsWith",(e,t)=>{he.init(e,t);const i=new RegExp(`.*${Kt(t.suffix)}$`);t.pattern??(t.pattern=i),e._zod.onattach.push(n=>{const a=n._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(i)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Ps=m("$ZodCheckOverwrite",(e,t)=>{he.init(e,t),e._zod.check=i=>{i.value=t.tx(i.value)}}),Is={major:4,minor:3,patch:6},F=m("$ZodType",(e,t)=>{var i;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Is;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const a of n)for(const s of a._zod.onattach)s(e);if(n.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=Ue(r),c;for(const h of l){if(h._zod.def.when){if(!h._zod.def.when(r))continue}else if(p)continue;const f=r.issues.length,g=h._zod.check(r);if(g instanceof Promise&&u?.async===!1)throw new Ve;if(c||g instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await g,r.issues.length!==f&&(p||(p=Ue(r,f)))});else{if(r.issues.length===f)continue;p||(p=Ue(r,f))}}return c?c.then(()=>r):r},s=(r,l,u)=>{if(Ue(r))return r.aborted=!0,r;const p=a(l,n,u);if(p instanceof Promise){if(u.async===!1)throw new Ve;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=>s(c,r,l)):s(p,r,l)}const u=e._zod.parse(r,l);if(u instanceof Promise){if(l.async===!1)throw new Ve;return u.then(p=>a(p,n,l))}return a(u,n,l)}}k(e,"~standard",()=>({validate:a=>{try{const s=Wi(e,a);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return Gi(e,a).then(r=>r.success?{value:r.data}:{issues:r.error?.issues})}},vendor:"zod",version:1}))}),Xt=m("$ZodString",(e,t)=>{F.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??cs(e._zod.bag),e._zod.parse=(i,n)=>{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}}),ye=m("$ZodStringFormat",(e,t)=>{At.init(e,t),Xt.init(e,t)}),As=m("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Hi(n))}else t.pattern??(t.pattern=Hi());ye.init(e,t)}),Ts=m("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ss),ye.init(e,t)}),Ls=m("$ZodURL",(e,t)=>{ye.init(e,t),e._zod.check=i=>{try{const n=i.value.trim(),a=new URL(n);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=n;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!t.abort})}}}),Ms=m("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ps(t)),ye.init(e,t)}),zs=m("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ds),ye.init(e,t)}),Fs=m("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=us(t)),ye.init(e,t)}),Rs=m("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ns),ye.init(e,t)}),Ns=m("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=rs),ye.init(e,t),e._zod.bag.format="ipv4"}),qs=m("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=os),ye.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})}}}),Bs=m("$ZodCustomStringFormat",(e,t)=>{ye.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})}}),Xi=m("$ZodNumber",(e,t)=>{F.init(e,t),e._zod.pattern=e._zod.bag.pattern??ms,e._zod.parse=(i,n)=>{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 s=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,...s?{received:s}:{}}),i}}),Zs=m("$ZodNumberFormat",(e,t)=>{vs.init(e,t),Xi.init(e,t)}),Vs=m("$ZodBoolean",(e,t)=>{F.init(e,t),e._zod.pattern=ys,e._zod.parse=(i,n)=>{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}}),Us=m("$ZodAny",(e,t)=>{F.init(e,t),e._zod.parse=i=>i});function Qi(e,t,i){e.issues.length&&t.issues.push(...Wn(i,e.issues)),t.value[i]=e.value}const ji=m("$ZodArray",(e,t)=>{F.init(e,t),e._zod.parse=(i,n)=>{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 s=[];for(let r=0;r<a.length;r++){const l=a[r],u=t.element._zod.run({value:l,issues:[]},n);u instanceof Promise?s.push(u.then(p=>Qi(p,i,r))):Qi(u,i,r)}return s.length?Promise.all(s).then(()=>i):i}});function ea(e,t,i,n){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const a=e.filter(s=>!Ue(s));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(s=>s.issues.map(r=>Le(r,n,Te())))}),t)}const Ws=m("$ZodUnion",(e,t)=>{F.init(e,t),k(e._zod,"optin",()=>t.options.some(a=>a._zod.optin==="optional")?"optional":void 0),k(e._zod,"optout",()=>t.options.some(a=>a._zod.optout==="optional")?"optional":void 0),k(e._zod,"values",()=>{if(t.options.every(a=>a._zod.values))return new Set(t.options.flatMap(a=>Array.from(a._zod.values)))}),k(e._zod,"pattern",()=>{if(t.options.every(a=>a._zod.pattern)){const a=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${a.map(s=>Ht(s.source)).join("|")})$`)}});const i=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(a,s)=>{if(i)return n(a,s);let r=!1;const l=[];for(const u of t.options){const p=u._zod.run({value:a.value,issues:[]},s);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=>ea(u,a,e,s)):ea(l,a,e,s)}}),Gs=m("$ZodIntersection",(e,t)=>{F.init(e,t),e._zod.parse=(i,n)=>{const a=i.value,s=t.left._zod.run({value:a,issues:[]},n),r=t.right._zod.run({value:a,issues:[]},n);return s instanceof Promise||r instanceof Promise?Promise.all([s,r]).then(([u,p])=>ta(i,u,p)):ta(i,s,r)}});function Qt(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(Yt(e)&&Yt(t)){const i=Object.keys(t),n=Object.keys(e).filter(s=>i.indexOf(s)!==-1),a={...e,...t};for(const s of n){const r=Qt(e[s],t[s]);if(!r.valid)return{valid:!1,mergeErrorPath:[s,...r.mergeErrorPath]};a[s]=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 n=0;n<e.length;n++){const a=e[n],s=t[n],r=Qt(a,s);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i.push(r.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function ta(e,t,i){const n=new Map;let a;for(const l of t.issues)if(l.code==="unrecognized_keys"){a??(a=l);for(const u of l.keys)n.has(u)||n.set(u,{}),n.get(u).l=!0}else e.issues.push(l);for(const l of i.issues)if(l.code==="unrecognized_keys")for(const u of l.keys)n.has(u)||n.set(u,{}),n.get(u).r=!0;else e.issues.push(l);const s=[...n].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(s.length&&a&&e.issues.push({...a,keys:s}),Ue(e))return e;const r=Qt(t.value,i.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const Hs=m("$ZodTransform",(e,t)=>{F.init(e,t),e._zod.parse=(i,n)=>{if(n.direction==="backward")throw new Fi(e.constructor.name);const a=t.transform(i.value,i);if(n.async)return(a instanceof Promise?a:Promise.resolve(a)).then(r=>(i.value=r,i));if(a instanceof Promise)throw new Ve;return i.value=a,i}});function ia(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const jt=m("$ZodOptional",(e,t)=>{F.init(e,t),e._zod.optin="optional",e._zod.optout="optional",k(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),k(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${Ht(i.source)})?$`):void 0}),e._zod.parse=(i,n)=>{if(t.innerType._zod.optin==="optional"){const a=t.innerType._zod.run(i,n);return a instanceof Promise?a.then(s=>ia(s,i.value)):ia(a,i.value)}return i.value===void 0?i:t.innerType._zod.run(i,n)}}),Ys=m("$ZodExactOptional",(e,t)=>{jt.init(e,t),k(e._zod,"values",()=>t.innerType._zod.values),k(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(i,n)=>t.innerType._zod.run(i,n)}),Ks=m("$ZodNullable",(e,t)=>{F.init(e,t),k(e._zod,"optin",()=>t.innerType._zod.optin),k(e._zod,"optout",()=>t.innerType._zod.optout),k(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${Ht(i.source)}|null)$`):void 0}),k(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(i,n)=>i.value===null?i:t.innerType._zod.run(i,n)}),Js=m("$ZodDefault",(e,t)=>{F.init(e,t),e._zod.optin="optional",k(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,n)=>{if(n.direction==="backward")return t.innerType._zod.run(i,n);if(i.value===void 0)return i.value=t.defaultValue,i;const a=t.innerType._zod.run(i,n);return a instanceof Promise?a.then(s=>aa(s,t)):aa(a,t)}});function aa(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Xs=m("$ZodPrefault",(e,t)=>{F.init(e,t),e._zod.optin="optional",k(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,n)=>(n.direction==="backward"||i.value===void 0&&(i.value=t.defaultValue),t.innerType._zod.run(i,n))}),Qs=m("$ZodNonOptional",(e,t)=>{F.init(e,t),k(e._zod,"values",()=>{const i=t.innerType._zod.values;return i?new Set([...i].filter(n=>n!==void 0)):void 0}),e._zod.parse=(i,n)=>{const a=t.innerType._zod.run(i,n);return a instanceof Promise?a.then(s=>na(s,e)):na(a,e)}});function na(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 js=m("$ZodCatch",(e,t)=>{F.init(e,t),k(e._zod,"optin",()=>t.innerType._zod.optin),k(e._zod,"optout",()=>t.innerType._zod.optout),k(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,n)=>{if(n.direction==="backward")return t.innerType._zod.run(i,n);const a=t.innerType._zod.run(i,n);return a instanceof Promise?a.then(s=>(i.value=s.value,s.issues.length&&(i.value=t.catchValue({...i,error:{issues:s.issues.map(r=>Le(r,n,Te()))},input:i.value}),i.issues=[]),i)):(i.value=a.value,a.issues.length&&(i.value=t.catchValue({...i,error:{issues:a.issues.map(s=>Le(s,n,Te()))},input:i.value}),i.issues=[]),i)}}),er=m("$ZodPipe",(e,t)=>{F.init(e,t),k(e._zod,"values",()=>t.in._zod.values),k(e._zod,"optin",()=>t.in._zod.optin),k(e._zod,"optout",()=>t.out._zod.optout),k(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(i,n)=>{if(n.direction==="backward"){const s=t.out._zod.run(i,n);return s instanceof Promise?s.then(r=>Tt(r,t.in,n)):Tt(s,t.in,n)}const a=t.in._zod.run(i,n);return a instanceof Promise?a.then(s=>Tt(s,t.out,n)):Tt(a,t.out,n)}});function Tt(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),k(e._zod,"propValues",()=>t.innerType._zod.propValues),k(e._zod,"values",()=>t.innerType._zod.values),k(e._zod,"optin",()=>t.innerType?._zod?.optin),k(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(i,n)=>{if(n.direction==="backward")return t.innerType._zod.run(i,n);const a=t.innerType._zod.run(i,n);return a instanceof Promise?a.then(sa):sa(a)}});function sa(e){return e.value=Object.freeze(e.value),e}const ra=m("$ZodCustom",(e,t)=>{he.init(e,t),F.init(e,t),e._zod.parse=(i,n)=>i,e._zod.check=i=>{const n=i.value,a=t.fn(n);if(a instanceof Promise)return a.then(s=>oa(s,i,n,e));oa(a,i,n,e)}});function oa(e,t,i,n){if(!e){const a={code:"custom",input:i,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(a.params=n._zod.def.params),t.issues.push(Xe(a))}}var la;class ir{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...i){const n=i[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const i=this._map.get(t);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(t),this}get(t){const i=t._zod.parent;if(i){const n={...this.get(i)??{}};delete n.id;const a={...n,...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}(la=globalThis).__zod_globalRegistry??(la.__zod_globalRegistry=ar());const Qe=globalThis.__zod_globalRegistry;function nr(e,t){return new e({type:"string",...v(t)})}function sr(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 Dr(e,t){return new Ds({check:"less_than",...v(t),value:e,inclusive:!0})}function br(e,t){return new bs({check:"greater_than",...v(t),value:e,inclusive:!0})}function Lt(e,t){return new ws({check:"max_length",...v(t),maximum:e})}function We(e,t){return new $s({check:"min_length",...v(t),minimum:e})}function da(e,t){return new ks({check:"length_equals",...v(t),length:e})}function ua(e,t){return new _s({check:"string_format",format:"regex",...v(t),pattern:e})}function vr(e){return new Cs({check:"string_format",format:"lowercase",...v(e)})}function wr(e){return new Ss({check:"string_format",format:"uppercase",...v(e)})}function $r(e,t){return new Os({check:"string_format",format:"includes",...v(t),includes:e})}function kr(e,t){return new xs({check:"string_format",format:"starts_with",...v(t),prefix:e})}function _r(e,t){return new Es({check:"string_format",format:"ends_with",...v(t),suffix:e})}function Ge(e){return new Ps({check:"overwrite",tx:e})}function Cr(e){return Ge(t=>t.normalize(e))}function Sr(){return Ge(e=>e.trim())}function Or(){return Ge(e=>e.toLowerCase())}function xr(){return Ge(e=>e.toUpperCase())}function Er(){return Ge(e=>Vn(e))}function Pr(e,t,i){return new e({type:"array",element:t,...v(i)})}function pa(e,t,i){return new e({type:"custom",check:"custom",fn:t,...v(i)})}function ca(e){const t=Ir(i=>(i.addIssue=n=>{if(typeof n=="string")i.issues.push(Xe(n,i.value,t._zod.def));else{const a=n;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(Xe(a))}},e(i.value,i)));return t}function Ir(e,t){const i=new he({check:"custom",...v(t)});return i._zod.check=e,i}function Ar(e,t,i,n={}){const a=v(n),s={...v(n),check:"string_format",type:"string",format:t,fn:typeof i=="function"?i:l=>i.test(l),...a};return i instanceof RegExp&&(s.pattern=i),new e(s)}function ha(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Qe,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function ie(e,t,i={path:[],schemaPath:[]}){var n;const a=e._zod.def,s=t.seen.get(e);if(s)return s.count++,i.schemaPath.includes(e)&&(s.cycle=i.path),s.schema;const r={schema:{},count:1,cycle:void 0,path:i.path};t.seen.set(e,r);const l=e._zod.toJSONSchema?.();if(l)r.schema=l;else{const c={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,r.schema,c);else{const f=r.schema,g=t.processors[a.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);g(e,t,f,c)}const h=e._zod.parent;h&&(r.ref||(r.ref=h),ie(h,t,c),t.seen.get(h).isParent=!0)}const u=t.metadataRegistry.get(e);return u&&Object.assign(r.schema,u),t.io==="input"&&ae(e)&&(delete r.schema.examples,delete r.schema.default),t.io==="input"&&r.schema._prefault&&((n=r.schema).default??(n.default=r.schema._prefault)),delete r.schema._prefault,t.seen.get(e).schema}function ma(e,t){const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const r of e.seen.entries()){const l=e.metadataRegistry.get(r[0])?.id;if(l){const u=n.get(l);if(u&&u!==r[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(l,r[0])}}const a=r=>{const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const h=e.external.registry.get(r[0])?.id,f=e.external.uri??(_=>_);if(h)return{ref:f(h)};const g=r[1].defId??r[1].schema.id??`schema${e.counter++}`;return r[1].defId=g,{defId:g,ref:`${f("__shared")}#/${l}/${g}`}}if(r[1]===i)return{ref:"#"};const p=`#/${l}/`,c=r[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:p+c}},s=r=>{if(r[1].schema.$ref)return;const l=r[1],{ref:u,defId:p}=a(r);l.def={...l.schema},p&&(l.defId=p);const c=l.schema;for(const h in c)delete c[h];c.$ref=u};if(e.cycles==="throw")for(const r of e.seen.entries()){const l=r[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/<root>
|
|
1
|
+
(function(C,Se){typeof exports=="object"&&typeof module<"u"?Se(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"],Se):(C=typeof globalThis<"u"?globalThis:C||self,Se(C["gui-lit"]={},C.core,C.guiShared,C.lit$1,C.lit,C.decorators_js,C.context,C.rxjs,C.classMap_js,C.repeat_js,C.live_js,C.styleMap_js,C.ifDefined_js,C.repeat_js$1,C.unsafeHtml_js))})(this,(function(C,Se,Ha,y,d,o,b,Ai,$,fe,Ti,et,Gt,Li,Ya){"use strict";const Mi={LAYOUTS:"LAYOUTS",DISPLAYS:"DISPLAYS"};function Ka(e){return function(t,i=()=>!0){return{kind:"leaf",selectorType:e,matcher:i,config:t}}}const Et=new Map;function Ri(e,t){if(Et.has(e))throw new Error(`Item type "${e}" is already registered.`);Et.set(e,t)}function Pt(e){const t=Et.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 zi(e){return Et.has(e)}function S(e){const t=l=>{if(!e.sensibleDefaults)return{};let u={...e.sensibleDefaults.base};for(const p of l){const c=p.config;for(const h of e.sensibleDefaults.fields){const f=h;c[f]!=null&&(u={...u,[f]:c[f]})}}return u},i=(l,u)=>e.sensibleDefaults?e.sensibleDefaults.apply(l,u):l,n=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:n,...e.afterMerge?{afterMerge:e.afterMerge}:{},...e.buildCustomWidget?{buildCustomWidget:e.buildCustomWidget}:{},...e.getChildren?{getChildren:e.getChildren}:{}};Ri(e.itemType,a);const s=Ka(e.itemType);return{gsl:s,gslByUid:(l,u)=>s(u,(p=>p.uid===l))}}function Ja(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 Y(e,t){return e.label!=null||t.suppressAutomaticLabels||!e.path?e:{...e,label:Ja(e.path)}}function Pe(e,t){return e.placeholder!=null||t.suppressAutomaticPlaceholders||!e.path?e:{...e,placeholder:e.path}}const Xa=(e,t)=>({type:"ITEMS",itemType:Mi.DISPLAYS,items:[{render:e}],tags:[]}),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","CUSTOM_DISPLAY"]),LAYOUTS:new Set(["LAYOUTS","TABS","ACCORDION","CUSTOM_LAYOUT"])};function Qa(e,t){const i=Fi[e];return i?i.has(t):e===t}class ja{resolve(t,i){const n=[];for(const s of i)s.kind==="aggregated"?this.collectFromAggregated(s,t,n):this.collectFromLeaf(s,t,n);const a=this.rollUpSensibleDefaults(n);return{leafSelectors:n,sensibleDefaults:a}}collectFromAggregated(t,i,n){if(t.matcher(i))for(const a of t.children)this.collectFromLeaf(a,i,n)}collectFromLeaf(t,i,n){Qa(t.selectorType,i.itemType??"")&&t.matcher(i)&&n.push(t)}rollUpSensibleDefaults(t){const i=new Map,n=(s,r)=>{const l=i.get(s)??[];l.push(r),i.set(s,l)};for(const s of t){const r=Fi[s.selectorType];if(r)for(const l of r)n(l,s);else n(s.selectorType,s)}const a={};for(const[s,r]of i)zi(s)&&(a[s]=Pt(s).rollUpSensibleDefaults(r));return a}}const en=new ja;class tn{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 n={...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?n[a]=this.deepMerge(t[a],i[a]):n[a]=i[a]);return n}}const an=new tn;class nn{constructor(t){this.objectUtils=t}merge(t,i,n){let a={},s=null;typeof t=="function"&&(s=t);const r=this.collectDecorators(n);for(const p of r){if(s!=null){s=this.composeRuntimeFunctions(s,p);continue}if(typeof p=="function"){const c=p({...a,...typeof t=="function"?{}:t});if(typeof c=="function"){s=this.createPromotedFunction(a,t,c,i,n);continue}a=this.objectUtils.deepMerge(a,c)}else a=this.objectUtils.deepMerge(a,p)}if(s!=null)return{kind:"dynamic",fn:this.wrapWithSensibleDefaults(s,a,i,n)};const l=this.objectUtils.deepMerge(t,a);return{kind:"static",def:this.applySensibleDefaults({...l},i,n)}}collectDecorators(t){const i=[];for(const n of t.leafSelectors){const a=n.config;a.override!=null&&i.push(a.override)}return i}applySensibleDefaults(t,i,n){if(!zi(i))return t;const a=n.sensibleDefaults[i]??{};return Pt(i).applySensibleDefaults(t,a)}createPromotedFunction(t,i,n,a,s){return r=>{const l=n(r);let u=this.objectUtils.deepMerge(t,l);return u=this.objectUtils.deepMerge(u,i),this.applySensibleDefaults(u,a,s)}}wrapWithSensibleDefaults(t,i,n,a){return s=>{let r=t(s);return Object.keys(i).length>0&&(r=this.objectUtils.deepMerge(i,r)),this.applySensibleDefaults(r,n,a)}}composeRuntimeFunctions(t,i){return typeof i=="function"?n=>{const a=t(n),s=i(a);return typeof s=="function"?s(n):this.objectUtils.deepMerge(s,a)}:n=>{const a=t(n);return this.objectUtils.deepMerge(a,i)}}}const sn=new nn(an);class rn{mapToWidget(t,i){if(t.kind==="dynamic"){const n=t.fn;return(a=>{const s=n(a);return this.mapStaticDef(s,i)})}return this.mapStaticDef(t.def,i)}mapStaticDef(t,i){const n=Pt(i).mapToWidget(t);return this.applyBaseWidgetFields(n,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 on=new rn;class ln{normalizeSelectors(t){const i=Array.isArray(t)?t:[t],n=[],a=[];for(const s of i)s.kind==="leaf"?a.push(s):n.push(s);return a.length>0&&n.unshift({kind:"aggregated",matcher:()=>!0,children:a}),n}extractFormConfig(){return{suppressAutomaticStack:!1}}}const dn=new ln,Ni={onLoad:"load",onChange:"change",onFilter:"filter",onBlur:"blur"},un=Object.keys(Ni);class pn{extractOnClickFromMergeResult(t,i,n){if(t.kind==="dynamic"){const r=t.fn;return{kind:"dynamic",fn:u=>{const p=r(u);return this.wireOnClick(p,i,n)}}}const a=t.def;return{kind:"static",def:this.wireOnClick(a,i,n)}}wireOnClick(t,i,n){const a=n.next(),s=t.onClick;if(typeof s=="function"){const{onClick:r,...l}=t,u=s(void 0);return typeof u=="string"?{...l,uid:a,on:{click:u}}:(i.set(a,p=>s(p.data)),{...l,uid:a,on:{click:a}})}return{...t,uid:a}}wireInputLayoutEvents(t,i,n){if(t.kind==="dynamic"){const s=t.fn;return{kind:"dynamic",fn:l=>{const u=s(l);return this.wireEventProperties(u,i,n)}}}return{kind:"static",def:this.wireEventProperties(t.def,i,n)}}wireEventProperties(t,i,n){const a={...t.on||{}};let s=!1;const r={...t};for(const l of un){const u=t[l];if(u==null)continue;const p=Ni[l];if(typeof u=="function"){const c=n.next();i.set(c,u),a[p]=c,s=!0}else typeof u=="string"&&(a[p]=u,s=!0);delete r[l]}return s&&(r.on=a),r}}const Ht=new pn,cn={input:new Set(["disabled","readonly","label","validator","size"]),action:new Set(["disabled","label","size"]),layout:new Set(["size"]),display:new Set([])},qi={onChange:"change",onLoad:"load",onFilter:"filter",onClick:"click"};class hn{extractFromMergeResult(t,i){const n={};for(const l of i){const u=l.targetState,p=l.config,c=p.override&&typeof p.override!="function"?p.override:p;n[u]={...n[u]||{},...c}}if(t.kind==="dynamic"){const l=t.fn;return{cleanedResult:{kind:"dynamic",fn:p=>{const c=l(p),{states:h,...f}=c;return f}},stateData:{stateOverrides:n}}}const{states:a,...s}=t.def,r={};for(const[l,u]of Object.entries(n))r[l]={...u};if(a)for(const[l,u]of Object.entries(a))r[l]={...r[l]||{},...u};return{cleanedResult:{kind:"static",def:s},stateData:{stateOverrides:r}}}applyToWidget(t,i,n,a){const{stateOverrides:s}=i;if(Object.keys(s).length===0)return t;const r={...t},l=t.kind,u=cn[l]||new Set;t.props&&(r.props={...t.props}),t.on&&(r.on={...t.on});for(const[p,c]of Object.entries(s))for(const[h,f]of Object.entries(c))h==="visible"?this.applyVisibility(r,p,f):qi[h]?this.applyStateEvent(r,p,h,f,n,a):u.has(h)?r[`${h}.${p}`]=f:(r.props||(r.props={}),r.props[`${h}.${p}`]=f);return r}hasStateData(t){return Object.keys(t.stateOverrides).length>0}applyVisibility(t,i,n){if(n){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,n,a,s,r){const l=qi[n];if(t.on||(t.on={}),typeof a=="function"){const u=r.next();s.set(u,a),t.on[`${l}.${i}`]=u}else typeof a=="string"&&(t.on[`${l}.${i}`]=a)}}const mn=new hn;function yn(){let e=0;return{next:()=>`event_${e++}`}}class fn{constructor(t,i,n,a,s){this.resolver=t,this.merger=i,this.mapper=n,this.eventWiring=a,this.stateExpansion=s}walkAndMap(t,i,n){const a=new Map,s=yn(),r={value:0},l=new Set;return{widgets:this.walkItems(t,i,a,n,s,r,l),eventRegistry:a}}walkItems(t,i,n,a,s,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,n,a,s,r,l))})}processItem(t,i,n,a,s,r,l,u,p){const c=i,h=Pt(i),f=h.parseEntry(t),g=this.buildBaseDef(f),k=this.buildDecoratorForMatching(g,c,n),I=this.resolver.resolve(k,a),Ua=I.leafSelectors.filter(ue=>ue.targetState!=null),Wa={leafSelectors:I.leafSelectors.filter(ue=>ue.targetState==null),sensibleDefaults:I.sensibleDefaults};let Ge=this.merger.merge(g,c,Wa);h.afterMerge&&(Ge=h.afterMerge(Ge,{eventRegistry:s,formConfig:r,eventIdGenerator:l})),Ge=this.eventWiring.wireInputLayoutEvents(Ge,s,l);const{cleanedResult:Ga,stateData:Ii}=this.stateExpansion.extractFromMergeResult(Ge,Ua);let Ee;if(h.buildCustomWidget){const ue=this.buildCustomWidgetContext(f.children,a,s,r,l,u,p);Ee=this.buildCustomWidget(h,Ga,ue)}else Ee=this.mapper.mapToWidget(Ga,c);if(typeof Ee!="function"){const ue=Ee;ue.uid||(ue.path&&!p.has(ue.path)?(ue.uid=ue.path,p.add(ue.path)):ue.uid=`dx_${u.value++}`)}if(this.stateExpansion.hasStateData(Ii))if(typeof Ee=="function"){const ue=Ee;Ee=(sp=>{const rp=ue(sp);return this.stateExpansion.applyToWidget(rp,Ii,s,l)})}else Ee=this.stateExpansion.applyToWidget(Ee,Ii,s,l);return Ee}buildCustomWidgetContext(t,i,n,a,s,r,l){return{children:t,mapStaticDef:(u,p)=>this.mapper.mapStaticDef(u,p),walkChildren:u=>this.walkItems(u,i,n,a,s,r,l)}}buildCustomWidget(t,i,n){return t.buildCustomWidget(i,n)}buildBaseDef(t){const i=t.baseDef;return typeof i=="function"?n=>{const s=i(n??{});return t.path!=null?{...s,path:t.path}:s}:t.path!=null?{...i,path:t.path}:i}buildDecoratorForMatching(t,i,n){if(typeof t=="function")return{itemType:i,tags:[...n]};const a=[...n,..."tags"in t&&t.tags?t.tags:[]],s="uid"in t?t.uid:void 0,r="type"in t?t.type:void 0;return{itemType:i,tags:a,uid:s,type:r}}}function W(e){const{uid:t,path:i,label:n,disabled:a,readonly:s,defaultValue:r,tags:l,type:u,size:p,onLoad:c,onChange:h,onFilter:f,on:g,states:k,include:I,exclude:Ua,validator:Wa,...Ge}=e;return Ge}function ae(e,t){return typeof e=="function"?e:{type:t,...e??{}}}function gn(e){switch(e.type){case"text":return Dn(e);case"number":return vn(e);case"boolean":return bn(e);default:throw new Error(`Unsupported field type "${e.type}"`)}}function bn(e){const t=W(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:ae(e.validator,"boolean")}:{},props:t}}function Dn(e){const t=W(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:ae(e.validator,"string")}}function vn(e){const t=W(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:ae(e.validator,"number")}}S({itemType:"INPUTS",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>{let i=Y(e,t);return i=Pe(i,t),i}},mapToWidget:gn});function wn(e){const{uid:t,label:i,actionType:n,disabled:a,on:s,onClick:r,data:l,type:u,tags:p,size:c,include:h,exclude:f,states:g,...k}=e;return{uid:t??"",kind:"action",type:"button",disabled:a,actionType:n,label:i,...s!=null?{on:s}:{},props:k}}S({itemType:"ACTIONS",entryShape:"bare",mapToWidget:wn,afterMerge:(e,t)=>Ht.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)});function $n(e){const{uid:t,widgetName:i,tags:n,size:a,onChange:s,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 kn(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"LAYOUTS"),children:i};const n=e.fn;return(a=>{const s=n(a);return{...t.mapStaticDef(s,"LAYOUTS"),children:i}})}function _n(e){return e.children}S({itemType:"LAYOUTS",entryShape:"compound",mapToWidget:$n,buildCustomWidget:kn,getChildren:_n});function Cn(e){return{uid:"",kind:"display",type:"renderer",props:{render:e.render}}}function Sn(e,t){if(e.kind==="static"){const n=e.def;return(a=>({uid:"",kind:"display",type:"renderer",...n.include!=null?{include:n.include}:{},...n.exclude!=null?{exclude:n.exclude}:{},props:{render:n.render(a??{})}}))}const i=e.fn;return(n=>{const a=i(n);return{uid:"",kind:"display",type:"renderer",...a.include!=null?{include:a.include}:{},...a.exclude!=null?{exclude:a.exclude}:{},props:{render:a.render(n??{})}}})}S({itemType:"DISPLAYS",entryShape:"bare",mapToWidget:Cn,buildCustomWidget:Sn}),S({itemType:"CALENDAR",entryShape:"bare",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>Y(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:ae(e.validator,"string")}:{},props:W(e)})}),S({itemType:"TEXTAREA",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Pe(Y(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:ae(e.validator,"string")}:{},props:W(e)})}),S({itemType:"PASSWORD",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Pe(Y(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:ae(e.validator,"string")}:{},props:W(e)})}),S({itemType:"CHECKBOX",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>Y(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:ae(e.validator,"boolean")}:{},props:W(e)})}),S({itemType:"DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>Y(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:ae(e.validator,"string")}:{},props:W(e)})}),S({itemType:"CURRENCY",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Pe(Y(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:ae(e.validator,"number")}:{},props:W(e)})}),S({itemType:"RANGE_CALENDAR",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>Y(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:ae(e.validator,"array")}:{},props:W(e)})}),S({itemType:"SELECT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Pe(Y(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:W(e)})}),S({itemType:"RADIOGROUP",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>Y(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:W(e)})});function On(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 xn(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"TABS"),children:i};const n=e.fn;return(a=>{const s=n(a);return{...t.mapStaticDef(s,"TABS"),children:i}})}function En(e){return e.children}S({itemType:"TABS",entryShape:"compound",mapToWidget:On,buildCustomWidget:xn,getChildren:En}),S({itemType:"LIST",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>Y(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:W(e)})}),S({itemType:"ALERTS",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"alert",props:{text:e.text,...e.level!=null?{level:e.level}:{}}})}),S({itemType:"DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Pe(Y(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:ae(e.validator,"string")}:{},props:W(e)})}),S({itemType:"DROPDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Pe(Y(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:W(e)})});function Pn(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 In(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"ACCORDION"),children:i};const n=e.fn;return(a=>{const s=n(a);return{...t.mapStaticDef(s,"ACCORDION"),children:i}})}function An(e){return e.children}S({itemType:"ACCORDION",entryShape:"compound",mapToWidget:Pn,buildCustomWidget:In,getChildren:An});function Tn(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 Ln(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:ae(e.validator,"array")}:{},props:{...Tn(e),template:{kind:"layout",type:"flex",children:[],props:{direction:"column"}}}}}function Yt(e,t){for(const i of e){if(typeof i=="function")continue;const n=i;typeof n.path=="string"&&n.path&&(n.path=t+n.path),"children"in n&&Array.isArray(n.children)&&Yt(n.children,t);const a=n.props;a?.template?.children&&Array.isArray(a.template.children)&&Yt(a.template.children,t)}}function Mn(e,t){const i=t.walkChildren(t.children??[]),n=e.kind==="static"?e.def.path??"":e.fn({})?.path??"";n&&Yt(i,n+".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 s=e.fn;return(r=>{const l=s(r),u=t.mapStaticDef(l,"REPEATER");return{...u,props:{...u.props,template:a}}})}function Rn(e){return{baseDef:e.def,path:e.key,children:e.children}}function zn(e){return e.children}Ri("REPEATER",{parseEntry:Rn,rollUpSensibleDefaults:()=>({}),applySensibleDefaults:e=>e,mapToWidget:Ln,buildCustomWidget:Mn,getChildren:zn}),S({itemType:"MARKDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Pe(Y(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:ae(e.validator,"string")}:{},props:W(e)})}),S({itemType:"RANGE_DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>Y(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:ae(e.validator,"array")}:{},props:W(e)})}),S({itemType:"RANGE_DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>Pe(Y(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:ae(e.validator,"array")}:{},props:W(e)})}),S({itemType:"CUSTOM_DISPLAY",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:e.customType,props:e.props??{}})}),S({itemType:"CUSTOM_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>Y(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??{}})}),S({itemType:"CUSTOM_ACTION",entryShape:"bare",mapToWidget:e=>{const{uid:t,label:i,disabled:n,on:a,onClick:s,data:r,customType:l,tags:u,size:p,include:c,exclude:h,states:f,props:g,...k}=e;return{uid:t??"",kind:"action",type:e.customType,label:i,disabled:n,...a!=null?{on:a}:{},props:{...g,...k}}},afterMerge:(e,t)=>Ht.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)});function Fn(e){return{uid:e.uid??"",kind:"layout",type:e.customType,props:e.props??{},children:[]}}function Nn(e,t){const i=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"CUSTOM_LAYOUT"),children:i};const n=e.fn;return(a=>{const s=n(a);return{...t.mapStaticDef(s,"CUSTOM_LAYOUT"),children:i}})}function qn(e){return e.children}S({itemType:"CUSTOM_LAYOUT",entryShape:"compound",mapToWidget:Fn,buildCustomWidget:Nn,getChildren:qn});class Bn{constructor(t,i){this.selectorNormalizer=t,this.walker=i}processDxFacade(t,i=[],n){const{defs:a,gslSelectors:s,formConfig:r}=this.prepareForm(t,i,n),{widgets:l,eventRegistry:u}=this.walker.walkAndMap(a,s,r),p=l[0];return this.buildResult({form:p},u,r)}prepareForm(t,i,n){const s=(Array.isArray(t)?[...t]:[t]).map(u=>typeof u=="function"?Xa(u):u),r=this.selectorNormalizer.normalizeSelectors(i),l={...this.selectorNormalizer.extractFormConfig(),...n};if(!l.suppressAutomaticStack){const u={def:{uid:"#root",direction:"column",widgetName:"flex"},children:s};return{defs:[{type:"ITEMS",itemType:Mi.LAYOUTS,items:[u],tags:[]}],gslSelectors:r,formConfig:l}}return{defs:s,gslSelectors:r,formConfig:l}}convertStateNames(t){const i={};for(const[n,a]of Object.entries(t))i[n.replace(/\$/g,":")]=a;return i}buildResult(t,i,n){n.states&&Object.keys(n.states).length>0&&(t={...t,states:this.convertStateNames(n.states)});const a={form:t};return i.size>0&&(a.events=s=>{const r=i.get(s.name);if(r){const l=p=>{if(p&&typeof p=="object"&&"path"in p&&!("type"in p)){const{path:c,...h}=p;for(const[f,g]of Object.entries(h))s.callback({type:"OVERRIDE_WIDGET_PROP",payload:{path:c,prop:f,value:g}})}else s.callback(p)},u={...s,callback:l,update:l};r(u)}}),n.dependencies&&(a.dependencies=n.dependencies),n.widgetLoaders&&(a.widgetLoaders=n.widgetLoaders),n.validateOn&&(a.validateOn=n.validateOn),n.itemRenderers&&(a.itemRenderers=n.itemRenderers),a}}const Zn=new fn(en,sn,on,Ht,mn),Vn=new Bn(dn,Zn);function Un(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"}const Zi=Object.freeze({}),Wn=Object.freeze({}),Vi=new WeakMap;function Kt(e,t){return e==null?t:typeof e=="object"?e:{}}function Gn(e,t,i){if(!Un(e))return{formDef:e};const n=Kt(e,Zi),a=Kt(t,Zi),s=Kt(i,Wn);let r=Vi.get(n);r||(r=new WeakMap,Vi.set(n,r));let l=r.get(a);l||(l=new WeakMap,r.set(a,l));const u=l.get(s);if(u)return u;const p=Vn.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(s,c),c}function Hn(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}function m(e,t,i){function n(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 h=0;h<c.length;h++){const f=c[h];f in l||(l[f]=p[f].bind(l))}}const a=i?.Parent??Object;class s extends a{}Object.defineProperty(s,"name",{value:e});function r(l){var u;const p=i?.Parent?new s:this;n(p,l),(u=p._zod).deferred??(u.deferred=[]);for(const c of p._zod.deferred)c();return p}return Object.defineProperty(r,"init",{value:n}),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 He extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ui extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Yn={};function Fe(e){return Yn}function Jt(e,t){return typeof t=="bigint"?t.toString():t}function Xt(e){return e==null}function Qt(e){const t=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(t,i)}const Wi=Symbol("evaluating");function _(e,t,i){let n;Object.defineProperty(e,t,{get(){if(n!==Wi)return n===void 0&&(n=Wi,n=i()),n},set(a){Object.defineProperty(e,t,{value:a})},configurable:!0})}function Kn(...e){const t={};for(const i of e){const n=Object.getOwnPropertyDescriptors(i);Object.assign(t,n)}return Object.defineProperties({},t)}function Jn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Gi="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Hi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function jt(e){if(Hi(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const i=t.prototype;return!(Hi(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function Yi(e){return jt(e)?{...e}:Array.isArray(e)?[...e]:e}function ei(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ki(e,t,i){const n=new e._zod.constr(t??e._zod.def);return(!t||i?.parent)&&(n._zod.parent=e),n}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 Xn={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 Ye(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 Qn(e,t){return t.map(i=>{var n;return(n=i).path??(n.path=[]),i.path.unshift(e),i})}function It(e){return typeof e=="string"?e:e?.message}function Ne(e,t,i){const n={...e,path:e.path??[]};if(!e.message){const a=It(e.inst?._zod.def?.error?.(e))??It(t?.error?.(e))??It(i.customError?.(e))??It(i.localeError?.(e))??"Invalid input";n.message=a}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function ti(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function tt(...e){const[t,i,n]=e;return typeof t=="string"?{message:t,code:"custom",input:i,inst:n}:{...t}}const Ji=(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,Jt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Xi=m("$ZodError",Ji),At=m("$ZodError",Ji,{Parent:Error});function jn(e,t=i=>i.message){const i={},n=[];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))):n.push(t(a));return{formErrors:n,fieldErrors:i}}function es(e,t=i=>i.message){const i={_errors:[]},n=a=>{for(const s of a.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(r=>n({issues:r}));else if(s.code==="invalid_key")n({issues:s.issues});else if(s.code==="invalid_element")n({issues:s.issues});else if(s.path.length===0)i._errors.push(t(s));else{let r=i,l=0;for(;l<s.path.length;){const u=s.path[l];l===s.path.length-1?(r[u]=r[u]||{_errors:[]},r[u]._errors.push(t(s))):r[u]=r[u]||{_errors:[]},r=r[u],l++}}};return n(e),i}const Tt=e=>(t,i,n,a)=>{const s=n?Object.assign(n,{async:!1}):{async:!1},r=t._zod.run({value:i,issues:[]},s);if(r instanceof Promise)throw new He;if(r.issues.length){const l=new(a?.Err??e)(r.issues.map(u=>Ne(u,s,Fe())));throw Gi(l,a?.callee),l}return r.value},ts=Tt(At),Lt=e=>async(t,i,n,a)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let r=t._zod.run({value:i,issues:[]},s);if(r instanceof Promise&&(r=await r),r.issues.length){const l=new(a?.Err??e)(r.issues.map(u=>Ne(u,s,Fe())));throw Gi(l,a?.callee),l}return r.value},is=Lt(At),Mt=e=>(t,i,n)=>{const a=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:i,issues:[]},a);if(s instanceof Promise)throw new He;return s.issues.length?{success:!1,error:new(e??Xi)(s.issues.map(r=>Ne(r,a,Fe())))}:{success:!0,data:s.value}},Qi=Mt(At),Rt=e=>async(t,i,n)=>{const a=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:i,issues:[]},a);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(r=>Ne(r,a,Fe())))}:{success:!0,data:s.value}},ji=Rt(At),as=e=>(t,i,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Tt(e)(t,i,a)},ns=e=>(t,i,n)=>Tt(e)(t,i,n),ss=e=>async(t,i,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Lt(e)(t,i,a)},rs=e=>async(t,i,n)=>Lt(e)(t,i,n),os=e=>(t,i,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Mt(e)(t,i,a)},ls=e=>(t,i,n)=>Mt(e)(t,i,n),ds=e=>async(t,i,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Rt(e)(t,i,a)},us=e=>async(t,i,n)=>Rt(e)(t,i,n),ps=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ea=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)$/,cs=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,hs=/^(?:(?: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])$/,ms=/^(([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}|:))$/,ys=/^(?=.{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])?)*\.?$/,ta="(?:(?:\\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])))",fs=new RegExp(`^${ta}$`);function ia(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 gs(e){return new RegExp(`^${ia(e)}$`)}function bs(e){const t=ia({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${i.join("|")})`;return new RegExp(`^${ta}T(?:${n})$`)}const Ds=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},vs=/^-?\d+$/,ws=/^-?\d+(?:\.\d+)?$/,$s=/^(?:true|false)$/i,ks=/^[^A-Z]*$/,_s=/^[^a-z]*$/,ge=m("$ZodCheck",(e,t)=>{var i;e._zod??(e._zod={}),e._zod.def=t,(i=e._zod).onattach??(i.onattach=[])}),aa={number:"number",bigint:"bigint",object:"date"},Cs=m("$ZodCheckLessThan",(e,t)=>{ge.init(e,t);const i=aa[typeof t.value];e._zod.onattach.push(n=>{const a=n._zod.bag,s=(t.inclusive?a.maximum:a.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?a.maximum=t.value:a.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:i,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ss=m("$ZodCheckGreaterThan",(e,t)=>{ge.init(e,t);const i=aa[typeof t.value];e._zod.onattach.push(n=>{const a=n._zod.bag,s=(t.inclusive?a.minimum:a.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?a.minimum=t.value:a.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:i,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Os=m("$ZodCheckNumberFormat",(e,t)=>{ge.init(e,t),t.format=t.format||"float64";const i=t.format?.includes("int"),n=i?"int":"number",[a,s]=Xn[t.format];e._zod.onattach.push(r=>{const l=r._zod.bag;l.format=t.format,l.minimum=a,l.maximum=s,i&&(l.pattern=vs)}),e._zod.check=r=>{const l=r.value;if(i){if(!Number.isInteger(l)){r.issues.push({expected:n,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:n,inclusive:!0,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:n,inclusive:!0,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>s&&r.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),xs=m("$ZodCheckMaxLength",(e,t)=>{var i;ge.init(e,t),(i=e._zod.def).when??(i.when=n=>{const a=n.value;return!Xt(a)&&a.length!==void 0}),e._zod.onattach.push(n=>{const a=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<a&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const a=n.value;if(a.length<=t.maximum)return;const r=ti(a);n.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),Es=m("$ZodCheckMinLength",(e,t)=>{var i;ge.init(e,t),(i=e._zod.def).when??(i.when=n=>{const a=n.value;return!Xt(a)&&a.length!==void 0}),e._zod.onattach.push(n=>{const a=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>a&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const a=n.value;if(a.length>=t.minimum)return;const r=ti(a);n.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),Ps=m("$ZodCheckLengthEquals",(e,t)=>{var i;ge.init(e,t),(i=e._zod.def).when??(i.when=n=>{const a=n.value;return!Xt(a)&&a.length!==void 0}),e._zod.onattach.push(n=>{const a=n._zod.bag;a.minimum=t.length,a.maximum=t.length,a.length=t.length}),e._zod.check=n=>{const a=n.value,s=a.length;if(s===t.length)return;const r=ti(a),l=s>t.length;n.issues.push({origin:r,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),zt=m("$ZodCheckStringFormat",(e,t)=>{var i,n;ge.init(e,t),e._zod.onattach.push(a=>{const s=a._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=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})}):(n=e._zod).check??(n.check=()=>{})}),Is=m("$ZodCheckRegex",(e,t)=>{zt.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})}}),As=m("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ks),zt.init(e,t)}),Ts=m("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=_s),zt.init(e,t)}),Ls=m("$ZodCheckIncludes",(e,t)=>{ge.init(e,t);const i=ei(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${i}`:i);t.pattern=n,e._zod.onattach.push(a=>{const s=a._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),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})}}),Ms=m("$ZodCheckStartsWith",(e,t)=>{ge.init(e,t);const i=new RegExp(`^${ei(t.prefix)}.*`);t.pattern??(t.pattern=i),e._zod.onattach.push(n=>{const a=n._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(i)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Rs=m("$ZodCheckEndsWith",(e,t)=>{ge.init(e,t);const i=new RegExp(`.*${ei(t.suffix)}$`);t.pattern??(t.pattern=i),e._zod.onattach.push(n=>{const a=n._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(i)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),zs=m("$ZodCheckOverwrite",(e,t)=>{ge.init(e,t),e._zod.check=i=>{i.value=t.tx(i.value)}}),Fs={major:4,minor:3,patch:6},z=m("$ZodType",(e,t)=>{var i;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Fs;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const a of n)for(const s of a._zod.onattach)s(e);if(n.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=Ye(r),c;for(const h of l){if(h._zod.def.when){if(!h._zod.def.when(r))continue}else if(p)continue;const f=r.issues.length,g=h._zod.check(r);if(g instanceof Promise&&u?.async===!1)throw new He;if(c||g instanceof Promise)c=(c??Promise.resolve()).then(async()=>{await g,r.issues.length!==f&&(p||(p=Ye(r,f)))});else{if(r.issues.length===f)continue;p||(p=Ye(r,f))}}return c?c.then(()=>r):r},s=(r,l,u)=>{if(Ye(r))return r.aborted=!0,r;const p=a(l,n,u);if(p instanceof Promise){if(u.async===!1)throw new He;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=>s(c,r,l)):s(p,r,l)}const u=e._zod.parse(r,l);if(u instanceof Promise){if(l.async===!1)throw new He;return u.then(p=>a(p,n,l))}return a(u,n,l)}}_(e,"~standard",()=>({validate:a=>{try{const s=Qi(e,a);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return ji(e,a).then(r=>r.success?{value:r.data}:{issues:r.error?.issues})}},vendor:"zod",version:1}))}),ii=m("$ZodString",(e,t)=>{z.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ds(e._zod.bag),e._zod.parse=(i,n)=>{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}}),De=m("$ZodStringFormat",(e,t)=>{zt.init(e,t),ii.init(e,t)}),Ns=m("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ea(n))}else t.pattern??(t.pattern=ea());De.init(e,t)}),qs=m("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=cs),De.init(e,t)}),Bs=m("$ZodURL",(e,t)=>{De.init(e,t),e._zod.check=i=>{try{const n=i.value.trim(),a=new URL(n);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=n;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!t.abort})}}}),Zs=m("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=bs(t)),De.init(e,t)}),Vs=m("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=fs),De.init(e,t)}),Us=m("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=gs(t)),De.init(e,t)}),Ws=m("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ps),De.init(e,t)}),Gs=m("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=hs),De.init(e,t),e._zod.bag.format="ipv4"}),Hs=m("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ms),De.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})}}}),Ys=m("$ZodCustomStringFormat",(e,t)=>{De.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})}}),na=m("$ZodNumber",(e,t)=>{z.init(e,t),e._zod.pattern=e._zod.bag.pattern??ws,e._zod.parse=(i,n)=>{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 s=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,...s?{received:s}:{}}),i}}),Ks=m("$ZodNumberFormat",(e,t)=>{Os.init(e,t),na.init(e,t)}),Js=m("$ZodBoolean",(e,t)=>{z.init(e,t),e._zod.pattern=$s,e._zod.parse=(i,n)=>{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}}),Xs=m("$ZodAny",(e,t)=>{z.init(e,t),e._zod.parse=i=>i});function sa(e,t,i){e.issues.length&&t.issues.push(...Qn(i,e.issues)),t.value[i]=e.value}const ra=m("$ZodArray",(e,t)=>{z.init(e,t),e._zod.parse=(i,n)=>{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 s=[];for(let r=0;r<a.length;r++){const l=a[r],u=t.element._zod.run({value:l,issues:[]},n);u instanceof Promise?s.push(u.then(p=>sa(p,i,r))):sa(u,i,r)}return s.length?Promise.all(s).then(()=>i):i}});function oa(e,t,i,n){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const a=e.filter(s=>!Ye(s));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(s=>s.issues.map(r=>Ne(r,n,Fe())))}),t)}const Qs=m("$ZodUnion",(e,t)=>{z.init(e,t),_(e._zod,"optin",()=>t.options.some(a=>a._zod.optin==="optional")?"optional":void 0),_(e._zod,"optout",()=>t.options.some(a=>a._zod.optout==="optional")?"optional":void 0),_(e._zod,"values",()=>{if(t.options.every(a=>a._zod.values))return new Set(t.options.flatMap(a=>Array.from(a._zod.values)))}),_(e._zod,"pattern",()=>{if(t.options.every(a=>a._zod.pattern)){const a=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${a.map(s=>Qt(s.source)).join("|")})$`)}});const i=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(a,s)=>{if(i)return n(a,s);let r=!1;const l=[];for(const u of t.options){const p=u._zod.run({value:a.value,issues:[]},s);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=>oa(u,a,e,s)):oa(l,a,e,s)}}),js=m("$ZodIntersection",(e,t)=>{z.init(e,t),e._zod.parse=(i,n)=>{const a=i.value,s=t.left._zod.run({value:a,issues:[]},n),r=t.right._zod.run({value:a,issues:[]},n);return s instanceof Promise||r instanceof Promise?Promise.all([s,r]).then(([u,p])=>la(i,u,p)):la(i,s,r)}});function ai(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(jt(e)&&jt(t)){const i=Object.keys(t),n=Object.keys(e).filter(s=>i.indexOf(s)!==-1),a={...e,...t};for(const s of n){const r=ai(e[s],t[s]);if(!r.valid)return{valid:!1,mergeErrorPath:[s,...r.mergeErrorPath]};a[s]=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 n=0;n<e.length;n++){const a=e[n],s=t[n],r=ai(a,s);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i.push(r.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function la(e,t,i){const n=new Map;let a;for(const l of t.issues)if(l.code==="unrecognized_keys"){a??(a=l);for(const u of l.keys)n.has(u)||n.set(u,{}),n.get(u).l=!0}else e.issues.push(l);for(const l of i.issues)if(l.code==="unrecognized_keys")for(const u of l.keys)n.has(u)||n.set(u,{}),n.get(u).r=!0;else e.issues.push(l);const s=[...n].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(s.length&&a&&e.issues.push({...a,keys:s}),Ye(e))return e;const r=ai(t.value,i.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const er=m("$ZodTransform",(e,t)=>{z.init(e,t),e._zod.parse=(i,n)=>{if(n.direction==="backward")throw new Ui(e.constructor.name);const a=t.transform(i.value,i);if(n.async)return(a instanceof Promise?a:Promise.resolve(a)).then(r=>(i.value=r,i));if(a instanceof Promise)throw new He;return i.value=a,i}});function da(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const ni=m("$ZodOptional",(e,t)=>{z.init(e,t),e._zod.optin="optional",e._zod.optout="optional",_(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),_(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${Qt(i.source)})?$`):void 0}),e._zod.parse=(i,n)=>{if(t.innerType._zod.optin==="optional"){const a=t.innerType._zod.run(i,n);return a instanceof Promise?a.then(s=>da(s,i.value)):da(a,i.value)}return i.value===void 0?i:t.innerType._zod.run(i,n)}}),tr=m("$ZodExactOptional",(e,t)=>{ni.init(e,t),_(e._zod,"values",()=>t.innerType._zod.values),_(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(i,n)=>t.innerType._zod.run(i,n)}),ir=m("$ZodNullable",(e,t)=>{z.init(e,t),_(e._zod,"optin",()=>t.innerType._zod.optin),_(e._zod,"optout",()=>t.innerType._zod.optout),_(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${Qt(i.source)}|null)$`):void 0}),_(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(i,n)=>i.value===null?i:t.innerType._zod.run(i,n)}),ar=m("$ZodDefault",(e,t)=>{z.init(e,t),e._zod.optin="optional",_(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,n)=>{if(n.direction==="backward")return t.innerType._zod.run(i,n);if(i.value===void 0)return i.value=t.defaultValue,i;const a=t.innerType._zod.run(i,n);return a instanceof Promise?a.then(s=>ua(s,t)):ua(a,t)}});function ua(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const nr=m("$ZodPrefault",(e,t)=>{z.init(e,t),e._zod.optin="optional",_(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,n)=>(n.direction==="backward"||i.value===void 0&&(i.value=t.defaultValue),t.innerType._zod.run(i,n))}),sr=m("$ZodNonOptional",(e,t)=>{z.init(e,t),_(e._zod,"values",()=>{const i=t.innerType._zod.values;return i?new Set([...i].filter(n=>n!==void 0)):void 0}),e._zod.parse=(i,n)=>{const a=t.innerType._zod.run(i,n);return a instanceof Promise?a.then(s=>pa(s,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 rr=m("$ZodCatch",(e,t)=>{z.init(e,t),_(e._zod,"optin",()=>t.innerType._zod.optin),_(e._zod,"optout",()=>t.innerType._zod.optout),_(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,n)=>{if(n.direction==="backward")return t.innerType._zod.run(i,n);const a=t.innerType._zod.run(i,n);return a instanceof Promise?a.then(s=>(i.value=s.value,s.issues.length&&(i.value=t.catchValue({...i,error:{issues:s.issues.map(r=>Ne(r,n,Fe()))},input:i.value}),i.issues=[]),i)):(i.value=a.value,a.issues.length&&(i.value=t.catchValue({...i,error:{issues:a.issues.map(s=>Ne(s,n,Fe()))},input:i.value}),i.issues=[]),i)}}),or=m("$ZodPipe",(e,t)=>{z.init(e,t),_(e._zod,"values",()=>t.in._zod.values),_(e._zod,"optin",()=>t.in._zod.optin),_(e._zod,"optout",()=>t.out._zod.optout),_(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(i,n)=>{if(n.direction==="backward"){const s=t.out._zod.run(i,n);return s instanceof Promise?s.then(r=>Ft(r,t.in,n)):Ft(s,t.in,n)}const a=t.in._zod.run(i,n);return a instanceof Promise?a.then(s=>Ft(s,t.out,n)):Ft(a,t.out,n)}});function Ft(e,t,i){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},i)}const lr=m("$ZodReadonly",(e,t)=>{z.init(e,t),_(e._zod,"propValues",()=>t.innerType._zod.propValues),_(e._zod,"values",()=>t.innerType._zod.values),_(e._zod,"optin",()=>t.innerType?._zod?.optin),_(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(i,n)=>{if(n.direction==="backward")return t.innerType._zod.run(i,n);const a=t.innerType._zod.run(i,n);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)=>{ge.init(e,t),z.init(e,t),e._zod.parse=(i,n)=>i,e._zod.check=i=>{const n=i.value,a=t.fn(n);if(a instanceof Promise)return a.then(s=>ma(s,i,n,e));ma(a,i,n,e)}});function ma(e,t,i,n){if(!e){const a={code:"custom",input:i,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(a.params=n._zod.def.params),t.issues.push(tt(a))}}var ya;class dr{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...i){const n=i[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const i=this._map.get(t);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(t),this}get(t){const i=t._zod.parent;if(i){const n={...this.get(i)??{}};delete n.id;const a={...n,...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 ur(){return new dr}(ya=globalThis).__zod_globalRegistry??(ya.__zod_globalRegistry=ur());const it=globalThis.__zod_globalRegistry;function pr(e,t){return new e({type:"string",...v(t)})}function cr(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...v(t)})}function hr(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...v(t)})}function mr(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...v(t)})}function yr(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...v(t)})}function fr(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...v(t)})}function gr(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...v(t)})}function br(e,t){return new e({type:"string",format:"date",check:"string_format",...v(t)})}function Dr(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...v(t)})}function vr(e,t){return new e({type:"string",format:"duration",check:"string_format",...v(t)})}function wr(e,t){return new e({type:"number",checks:[],...v(t)})}function $r(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...v(t)})}function kr(e,t){return new e({type:"boolean",...v(t)})}function _r(e){return new e({type:"any"})}function Cr(e,t){return new Cs({check:"less_than",...v(t),value:e,inclusive:!0})}function Sr(e,t){return new Ss({check:"greater_than",...v(t),value:e,inclusive:!0})}function Nt(e,t){return new xs({check:"max_length",...v(t),maximum:e})}function Ke(e,t){return new Es({check:"min_length",...v(t),minimum:e})}function fa(e,t){return new Ps({check:"length_equals",...v(t),length:e})}function ga(e,t){return new Is({check:"string_format",format:"regex",...v(t),pattern:e})}function Or(e){return new As({check:"string_format",format:"lowercase",...v(e)})}function xr(e){return new Ts({check:"string_format",format:"uppercase",...v(e)})}function Er(e,t){return new Ls({check:"string_format",format:"includes",...v(t),includes:e})}function Pr(e,t){return new Ms({check:"string_format",format:"starts_with",...v(t),prefix:e})}function Ir(e,t){return new Rs({check:"string_format",format:"ends_with",...v(t),suffix:e})}function Je(e){return new zs({check:"overwrite",tx:e})}function Ar(e){return Je(t=>t.normalize(e))}function Tr(){return Je(e=>e.trim())}function Lr(){return Je(e=>e.toLowerCase())}function Mr(){return Je(e=>e.toUpperCase())}function Rr(){return Je(e=>Jn(e))}function zr(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=Fr(i=>(i.addIssue=n=>{if(typeof n=="string")i.issues.push(tt(n,i.value,t._zod.def));else{const a=n;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(tt(a))}},e(i.value,i)));return t}function Fr(e,t){const i=new ge({check:"custom",...v(t)});return i._zod.check=e,i}function Nr(e,t,i,n={}){const a=v(n),s={...v(n),check:"string_format",type:"string",format:t,fn:typeof i=="function"?i:l=>i.test(l),...a};return i instanceof RegExp&&(s.pattern=i),new e(s)}function va(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??it,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function ne(e,t,i={path:[],schemaPath:[]}){var n;const a=e._zod.def,s=t.seen.get(e);if(s)return s.count++,i.schemaPath.includes(e)&&(s.cycle=i.path),s.schema;const r={schema:{},count:1,cycle:void 0,path:i.path};t.seen.set(e,r);const l=e._zod.toJSONSchema?.();if(l)r.schema=l;else{const c={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,r.schema,c);else{const f=r.schema,g=t.processors[a.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);g(e,t,f,c)}const h=e._zod.parent;h&&(r.ref||(r.ref=h),ne(h,t,c),t.seen.get(h).isParent=!0)}const u=t.metadataRegistry.get(e);return u&&Object.assign(r.schema,u),t.io==="input"&&se(e)&&(delete r.schema.examples,delete r.schema.default),t.io==="input"&&r.schema._prefault&&((n=r.schema).default??(n.default=r.schema._prefault)),delete r.schema._prefault,t.seen.get(e).schema}function wa(e,t){const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const r of e.seen.entries()){const l=e.metadataRegistry.get(r[0])?.id;if(l){const u=n.get(l);if(u&&u!==r[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(l,r[0])}}const a=r=>{const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const h=e.external.registry.get(r[0])?.id,f=e.external.uri??(k=>k);if(h)return{ref:f(h)};const g=r[1].defId??r[1].schema.id??`schema${e.counter++}`;return r[1].defId=g,{defId:g,ref:`${f("__shared")}#/${l}/${g}`}}if(r[1]===i)return{ref:"#"};const p=`#/${l}/`,c=r[1].schema.id??`__schema${e.counter++}`;return{defId:c,ref:p+c}},s=r=>{if(r[1].schema.$ref)return;const l=r[1],{ref:u,defId:p}=a(r);l.def={...l.schema},p&&(l.defId=p);const c=l.schema;for(const h in c)delete c[h];c.$ref=u};if(e.cycles==="throw")for(const r of e.seen.entries()){const l=r[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/<root>
|
|
2
2
|
|
|
3
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const r of e.seen.entries()){const l=r[1];if(t===r[0]){s(r);continue}if(e.external){const p=e.external.registry.get(r[0])?.id;if(t!==r[0]&&p){s(r);continue}}if(e.metadataRegistry.get(r[0])?.id){s(r);continue}if(l.cycle){s(r);continue}if(l.count>1&&e.reused==="ref"){s(r);continue}}}function ya(e,t){const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=r=>{const l=e.seen.get(r);if(l.ref===null)return;const u=l.def??l.schema,p={...u},c=l.ref;if(l.ref=null,c){n(c);const f=e.seen.get(c),g=f.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(g)):Object.assign(u,g),Object.assign(u,p),r._zod.parent===c)for(const T in u)T==="$ref"||T==="allOf"||T in p||delete u[T];if(g.$ref&&f.def)for(const T in u)T==="$ref"||T==="allOf"||T in f.def&&JSON.stringify(u[T])===JSON.stringify(f.def[T])&&delete u[T]}const h=r._zod.parent;if(h&&h!==c){n(h);const f=e.seen.get(h);if(f?.schema.$ref&&(u.$ref=f.schema.$ref,f.def))for(const g in u)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(u[g])===JSON.stringify(f.def[g])&&delete u[g]}e.override({zodSchema:r,jsonSchema:u,path:l.path??[]})};for(const r of[...e.seen.entries()].reverse())n(r[0]);const a={};if(e.target==="draft-2020-12"?a.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?a.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?a.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const r=e.external.registry.get(t)?.id;if(!r)throw new Error("Schema is missing an `id` property");a.$id=e.external.uri(r)}Object.assign(a,i.def??i.schema);const s=e.external?.defs??{};for(const r of e.seen.entries()){const l=r[1];l.def&&l.defId&&(s[l.defId]=l.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?a.$defs=s:a.definitions=s);try{const r=JSON.parse(JSON.stringify(a));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:Mt(t,"input",e.processors),output:Mt(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch{throw new Error("Error converting schema to JSON.")}}function ae(e,t){const i=t??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return ae(n.element,i);if(n.type==="set")return ae(n.valueType,i);if(n.type==="lazy")return ae(n.getter(),i);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return ae(n.innerType,i);if(n.type==="intersection")return ae(n.left,i)||ae(n.right,i);if(n.type==="record"||n.type==="map")return ae(n.keyType,i)||ae(n.valueType,i);if(n.type==="pipe")return ae(n.in,i)||ae(n.out,i);if(n.type==="object"){for(const a in n.shape)if(ae(n.shape[a],i))return!0;return!1}if(n.type==="union"){for(const a of n.options)if(ae(a,i))return!0;return!1}if(n.type==="tuple"){for(const a of n.items)if(ae(a,i))return!0;return!!(n.rest&&ae(n.rest,i))}return!1}const Tr=(e,t={})=>i=>{const n=ha({...i,processors:t});return ie(e,n),ma(n,e),ya(n,e)},Mt=(e,t,i={})=>n=>{const{libraryOptions:a,target:s}=n??{},r=ha({...a??{},target:s,io:t,processors:i});return ie(e,r),ma(r,e),ya(r,e)},Lr={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Mr=(e,t,i,n)=>{const a=i;a.type="string";const{minimum:s,maximum:r,format:l,patterns:u,contentEncoding:p}=e._zod.bag;if(typeof s=="number"&&(a.minLength=s),typeof r=="number"&&(a.maxLength=r),l&&(a.format=Lr[l]??l,a.format===""&&delete a.format,l==="time"&&delete a.format),p&&(a.contentEncoding=p),u&&u.size>0){const c=[...u];c.length===1?a.pattern=c[0].source:c.length>1&&(a.allOf=[...c.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},zr=(e,t,i,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Fr=(e,t,i,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Rr=(e,t,i,n)=>{const a=i,s=e._zod.def,{minimum:r,maximum:l}=e._zod.bag;typeof r=="number"&&(a.minItems=r),typeof l=="number"&&(a.maxItems=l),a.type="array",a.items=ie(s.element,t,{...n,path:[...n.path,"items"]})},Nr=(e,t,i,n)=>{const a=e._zod.def,s=a.inclusive===!1,r=a.options.map((l,u)=>ie(l,t,{...n,path:[...n.path,s?"oneOf":"anyOf",u]}));s?i.oneOf=r:i.anyOf=r},qr=(e,t,i,n)=>{const a=e._zod.def,s=ie(a.left,t,{...n,path:[...n.path,"allOf",0]}),r=ie(a.right,t,{...n,path:[...n.path,"allOf",1]}),l=p=>"allOf"in p&&Object.keys(p).length===1,u=[...l(s)?s.allOf:[s],...l(r)?r.allOf:[r]];i.allOf=u},Br=(e,t,i,n)=>{const a=e._zod.def,s=ie(a.innerType,t,n),r=t.seen.get(e);t.target==="openapi-3.0"?(r.ref=a.innerType,i.nullable=!0):i.anyOf=[s,{type:"null"}]},Zr=(e,t,i,n)=>{const a=e._zod.def;ie(a.innerType,t,n);const s=t.seen.get(e);s.ref=a.innerType},Vr=(e,t,i,n)=>{const a=e._zod.def;ie(a.innerType,t,n);const s=t.seen.get(e);s.ref=a.innerType,i.default=JSON.parse(JSON.stringify(a.defaultValue))},Ur=(e,t,i,n)=>{const a=e._zod.def;ie(a.innerType,t,n);const s=t.seen.get(e);s.ref=a.innerType,t.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(a.defaultValue)))},Wr=(e,t,i,n)=>{const a=e._zod.def;ie(a.innerType,t,n);const s=t.seen.get(e);s.ref=a.innerType;let r;try{r=a.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=r},Gr=(e,t,i,n)=>{const a=e._zod.def,s=t.io==="input"?a.in._zod.def.type==="transform"?a.out:a.in:a.out;ie(s,t,n);const r=t.seen.get(e);r.ref=s},Hr=(e,t,i,n)=>{const a=e._zod.def;ie(a.innerType,t,n);const s=t.seen.get(e);s.ref=a.innerType,i.readOnly=!0},fa=(e,t,i,n)=>{const a=e._zod.def;ie(a.innerType,t,n);const s=t.seen.get(e);s.ref=a.innerType},Yr=m("ZodISODateTime",(e,t)=>{Ms.init(e,t),zt.init(e,t)});function Kr(e){return ur(Yr,e)}const Jr=m("ZodISODate",(e,t)=>{zs.init(e,t),zt.init(e,t)});function Xr(e){return pr(Jr,e)}const Qr=m("ZodISOTime",(e,t)=>{Fs.init(e,t),zt.init(e,t)});function jr(e){return cr(Qr,e)}const eo=m("ZodISODuration",(e,t)=>{Rs.init(e,t),zt.init(e,t)});function to(e){return hr(eo,e)}const fe=m("ZodError",(e,t)=>{Ui.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>Hn(e,i)},flatten:{value:i=>Gn(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,Wt,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,Wt,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),io=xt(fe),ao=Et(fe),no=Pt(fe),so=It(fe),ro=Jn(fe),oo=Xn(fe),lo=Qn(fe),uo=jn(fe),po=es(fe),co=ts(fe),ho=is(fe),mo=as(fe),ne=m("ZodType",(e,t)=>(F.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Mt(e,"input"),output:Mt(e,"output")}}),e.toJSONSchema=Tr(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...i)=>e.clone(Zn(t,{checks:[...t.checks??[],...i.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(i,n)=>Zi(e,i,n),e.brand=()=>e,e.register=((i,n)=>(i.add(e,n),e)),e.parse=(i,n)=>io(e,i,n,{callee:e.parse}),e.safeParse=(i,n)=>no(e,i,n),e.parseAsync=async(i,n)=>ao(e,i,n,{callee:e.parseAsync}),e.safeParseAsync=async(i,n)=>so(e,i,n),e.spa=e.safeParseAsync,e.encode=(i,n)=>ro(e,i,n),e.decode=(i,n)=>oo(e,i,n),e.encodeAsync=async(i,n)=>lo(e,i,n),e.decodeAsync=async(i,n)=>uo(e,i,n),e.safeEncode=(i,n)=>po(e,i,n),e.safeDecode=(i,n)=>co(e,i,n),e.safeEncodeAsync=async(i,n)=>ho(e,i,n),e.safeDecodeAsync=async(i,n)=>mo(e,i,n),e.refine=(i,n)=>e.check(qo(i,n)),e.superRefine=i=>e.check(Bo(i)),e.overwrite=i=>e.check(Ge(i)),e.optional=()=>ga(e),e.exactOptional=()=>So(e),e.nullable=()=>Da(e),e.nullish=()=>ga(Da(e)),e.nonoptional=i=>To(e,i),e.array=()=>go(e),e.or=i=>bo([e,i]),e.and=i=>wo(e,i),e.transform=i=>ba(e,ko(i)),e.default=i=>Eo(e,i),e.prefault=i=>Io(e,i),e.catch=i=>Mo(e,i),e.pipe=i=>ba(e,i),e.readonly=()=>Ro(e),e.describe=i=>{const n=e.clone();return Qe.add(n,{description:i}),n},Object.defineProperty(e,"description",{get(){return Qe.get(e)?.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return Qe.get(e);const n=e.clone();return Qe.add(n,i[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=i=>i(e),e)),yo=m("_ZodString",(e,t)=>{Xt.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Mr(e,n,a);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...n)=>e.check(ua(...n)),e.includes=(...n)=>e.check($r(...n)),e.startsWith=(...n)=>e.check(kr(...n)),e.endsWith=(...n)=>e.check(_r(...n)),e.min=(...n)=>e.check(We(...n)),e.max=(...n)=>e.check(Lt(...n)),e.length=(...n)=>e.check(da(...n)),e.nonempty=(...n)=>e.check(We(1,...n)),e.lowercase=n=>e.check(vr(n)),e.uppercase=n=>e.check(wr(n)),e.trim=()=>e.check(Sr()),e.normalize=(...n)=>e.check(Cr(...n)),e.toLowerCase=()=>e.check(Or()),e.toUpperCase=()=>e.check(xr()),e.slugify=()=>e.check(Er())}),zt=m("ZodStringFormat",(e,t)=>{ye.init(e,t),yo.init(e,t)}),fo=m("ZodArray",(e,t)=>{ji.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Rr(e,i,n,a),e.element=t.element,e.min=(i,n)=>e.check(We(i,n)),e.nonempty=i=>e.check(We(1,i)),e.max=(i,n)=>e.check(Lt(i,n)),e.length=(i,n)=>e.check(da(i,n)),e.unwrap=()=>e.element});function go(e,t){return Pr(fo,e,t)}const Do=m("ZodUnion",(e,t)=>{Ws.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Nr(e,i,n,a),e.options=t.options});function bo(e,t){return new Do({type:"union",options:e,...v(t)})}const vo=m("ZodIntersection",(e,t)=>{Gs.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(i,n,a)=>qr(e,i,n,a)});function wo(e,t){return new vo({type:"intersection",left:e,right:t})}const $o=m("ZodTransform",(e,t)=>{Hs.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Fr(e,i),e._zod.parse=(i,n)=>{if(n.direction==="backward")throw new Fi(e.constructor.name);i.addIssue=s=>{if(typeof s=="string")i.issues.push(Xe(s,i.value,t));else{const r=s;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=i.value),r.inst??(r.inst=e),i.issues.push(Xe(r))}};const a=t.transform(i.value,i);return a instanceof Promise?a.then(s=>(i.value=s,i)):(i.value=a,i)}});function ko(e){return new $o({type:"transform",transform:e})}const _o=m("ZodOptional",(e,t)=>{jt.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(i,n,a)=>fa(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function ga(e){return new _o({type:"optional",innerType:e})}const Co=m("ZodExactOptional",(e,t)=>{Ys.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(i,n,a)=>fa(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function So(e){return new Co({type:"optional",innerType:e})}const Oo=m("ZodNullable",(e,t)=>{Ks.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Br(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function Da(e){return new Oo({type:"nullable",innerType:e})}const xo=m("ZodDefault",(e,t)=>{Js.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Vr(e,i,n,a),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Eo(e,t){return new xo({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Bi(t)}})}const Po=m("ZodPrefault",(e,t)=>{Xs.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Ur(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function Io(e,t){return new Po({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Bi(t)}})}const Ao=m("ZodNonOptional",(e,t)=>{Qs.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Zr(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function To(e,t){return new Ao({type:"nonoptional",innerType:e,...v(t)})}const Lo=m("ZodCatch",(e,t)=>{js.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Wr(e,i,n,a),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Mo(e,t){return new Lo({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const zo=m("ZodPipe",(e,t)=>{er.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Gr(e,i,n,a),e.in=t.in,e.out=t.out});function ba(e,t){return new zo({type:"pipe",in:e,out:t})}const Fo=m("ZodReadonly",(e,t)=>{tr.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Hr(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function Ro(e){return new Fo({type:"readonly",innerType:e})}const No=m("ZodCustom",(e,t)=>{ra.init(e,t),ne.init(e,t),e._zod.processJSONSchema=(i,n,a)=>zr(e,i)});function qo(e,t={}){return pa(No,e,t)}function Bo(e){return ca(e)}const Me=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,n)=>Yn(e,i,n,{callee:e.parse}),e.safeParse=(i,n)=>Wi(e,i,n),e.parseAsync=async(i,n)=>Kn(e,i,n,{callee:e.parseAsync}),e.safeParseAsync=async(i,n)=>Gi(e,i,n),e.check=(...i)=>e.clone({...t,checks:[...t.checks??[],...i.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(i,n)=>Zi(e,i,n),e.brand=()=>e,e.register=((i,n)=>(i.add(e,n),e)),e.apply=i=>i(e)}),va=m("ZodMiniString",(e,t)=>{Xt.init(e,t),Me.init(e,t)});function wa(e){return nr(va,e)}const He=m("ZodMiniStringFormat",(e,t)=>{ye.init(e,t),va.init(e,t)}),Zo=m("ZodMiniEmail",(e,t)=>{Ts.init(e,t),He.init(e,t)});function Vo(e){return sr(Zo,e)}const Uo=m("ZodMiniUUID",(e,t)=>{As.init(e,t),He.init(e,t)});function Wo(e){return rr(Uo,e)}const Go=m("ZodMiniURL",(e,t)=>{Ls.init(e,t),He.init(e,t)});function Ho(e){return or(Go,e)}const Yo=m("ZodMiniIPv4",(e,t)=>{Ns.init(e,t),He.init(e,t)});function Ko(e){return lr(Yo,e)}const Jo=m("ZodMiniIPv6",(e,t)=>{qs.init(e,t),He.init(e,t)});function Xo(e){return dr(Jo,e)}const Qo=m("ZodMiniCustomStringFormat",(e,t)=>{Bs.init(e,t),He.init(e,t)});function jo(e){return Ar(Qo,"hostname",ls,e)}const $a=m("ZodMiniNumber",(e,t)=>{Xi.init(e,t),Me.init(e,t)});function ka(e){return mr($a,e)}const el=m("ZodMiniNumberFormat",(e,t)=>{Zs.init(e,t),$a.init(e,t)});function tl(e){return yr(el,e)}const il=m("ZodMiniBoolean",(e,t)=>{Vs.init(e,t),Me.init(e,t)});function _a(e){return fr(il,e)}const al=m("ZodMiniAny",(e,t)=>{Us.init(e,t),Me.init(e,t)});function ei(){return gr(al)}const nl=m("ZodMiniArray",(e,t)=>{ji.init(e,t),Me.init(e,t)});function Ca(e,t){return new nl({type:"array",element:e,...v(t)})}const sl=m("ZodMiniOptional",(e,t)=>{jt.init(e,t),Me.init(e,t)});function rl(e){return new sl({type:"optional",innerType:e})}const ol=m("ZodMiniCustom",(e,t)=>{ra.init(e,t),Me.init(e,t)});function H(e,t={}){return pa(ol,e,t)}function Sa(e){return ca(e)}const ti={email:{schema:Vo()},hostname:{schema:jo()},ipv4:{schema:Ko()},ipv6:{schema:Xo()},url:{schema:Ho()},uuid:{schema:Wo()},date:{schema:Xr()},time:{schema:jr()},"date-time":{schema:Kr()},duration:{schema:to()}},ll=Object.keys(ti),dl=e=>(t,i)=>{switch(t.type){case"string":return ul(t,i);case"integer":case"number":return cl(t,i);case"boolean":return hl(t,i);case"array":return ml(t,i);case"custom":{if(!e)throw new Error('Validator type "custom" requires a customValidators object, but it was not supplied.');return yl(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 ul(e,t){return je(e,i=>{const n=E(i.messages?.invalid,t);let a=n?wa(n):wa();if(i.required===!0){const s=E(i.messages?.required,t)??"This field is required";a=a.check(H(r=>r.length>0,{error:s}))}if(typeof i.minLength=="number"){const s=E(i.messages?.minLength,t),r=i.minLength;a=a.check(s?H(l=>l.length>=r,{error:s}):We(r))}if(typeof i.maxLength=="number"){const s=E(i.messages?.maxLength,t),r=i.maxLength;a=a.check(s?H(l=>l.length<=r,{error:s}):Lt(r))}if(typeof i.pattern=="string"){const s=E(i.messages?.pattern,t),r=new RegExp(i.pattern);a=a.check(s?H(l=>r.test(l),{error:s}):ua(r))}if(i.enum){const s=i.enum,r=E(i.messages?.enum,t);a=a.check(H(l=>s.includes(l),r?{error:r}:void 0))}if(i.const!==void 0){const s=E(i.messages?.const,t);a=a.check(H(r=>r===i.const,s?{error:s}:void 0))}if(i.format!==void 0)if(ll.includes(i.format)){const s=E(i.messages?.format,t);a=a.check(s?Sa((r,l)=>{const u=ke.standardValidate(ti[i.format].schema,r);ke.isStandardValidateSuccess(u)||l.addIssue({code:"custom",path:[],message:s})}):ti[i.format].schema)}else console.error(`The string validation format "${i.format}" is not supported`);return a})}const pl=(e,t)=>{if(t===0)return!1;const i=e/t;return Math.abs(i-Math.round(i))<1e-10};function cl(e,t){return je(e,i=>{const n=E(i.messages?.invalid,t);let a=n?ka(n):ka();if(i.type==="integer"&&(a=a.check(tl())),i.minimum!==void 0){const s=E(i.messages?.minimum,t),r=i.minimum;a=a.check(s?H(l=>l>=r,{error:s}):br(r))}if(i.maximum!==void 0){const s=E(i.messages?.maximum,t),r=i.maximum;a=a.check(s?H(l=>l<=r,{error:s}):Dr(r))}if(i.exclusiveMinimum!==void 0){const s=E(i.messages?.exclusiveMinimum,t),r=i.exclusiveMinimum;a=a.check(H(l=>l>r,s?{error:s}:void 0))}if(i.exclusiveMaximum!==void 0){const s=E(i.messages?.exclusiveMaximum,t),r=i.exclusiveMaximum;a=a.check(H(l=>l<r,s?{error:s}:void 0))}if(i.multipleOf!==void 0){const s=E(i.messages?.multipleOf,t),r=i.multipleOf;a=a.check(H(l=>pl(l,r),s?{error:s}:void 0))}if(i.enum){const s=i.enum,r=E(i.messages?.enum,t);a=a.check(H(l=>s.includes(l),r?{error:r}:void 0))}if(i.const!==void 0){const s=E(i.messages?.const,t);a=a.check(H(r=>r===i.const,s?{error:s}:void 0))}return a})}function hl(e,t){return je(e,i=>{const n=E(i.messages?.invalid,t);let a=n?_a(n):_a();if(i.const!==void 0){const s=E(i.messages?.const,t);a=a.check(H(r=>r===i.const,s?{error:s}:void 0))}return a})}function ml(e,t){return je(e,i=>{const n=E(i.messages?.invalid,t);let a=n?Ca(ei(),n):Ca(ei());if(i.required===!0){const s=E(i.messages?.required,t)??"This field is required";a=a.check(H(r=>r.length>0,{error:s}))}if(typeof i.minItems=="number"){const s=E(i.messages?.minItems,t),r=i.minItems;a=a.check(s?H(l=>l.length>=r,{error:s}):We(r))}if(typeof i.maxItems=="number"){const s=E(i.messages?.maxItems,t),r=i.maxItems;a=a.check(s?H(l=>l.length<=r,{error:s}):Lt(r))}return a})}function yl(e,t){return je(e,i=>{let n=ei();return ke.filterTap(Object.keys(i),a=>a!=="type"&&a!=="required",a=>{const s=i[a],r=t[a],l=r(s);n=n.check(Sa((u,p)=>{const c=ke.standardValidate(l,u);if(!ke.isStandardValidateSuccess(c)){const h=c.issues[0];p.addIssue({code:"custom",path:[],message:h?.message||`Validation failed for ${a}`})}}))}),n})}function je(e,t){const i=t(e);return e.required?i:rl(i)}const Oa={button:async()=>(await Promise.resolve().then(()=>$l)).ButtonElement,calendar:async()=>(await Promise.resolve().then(()=>Al)).CalendarElement,rangeCalendar:async()=>(await Promise.resolve().then(()=>Fl)).RangeCalendarElement,rangeDateInput:async()=>(await Promise.resolve().then(()=>Zl)).RangeDateInputElement,rangeDatePicker:async()=>(await Promise.resolve().then(()=>Wl)).RangeDatePickerElement,currency:async()=>(await Promise.resolve().then(()=>Jl)).CurrencyElement,dateInput:async()=>(await Promise.resolve().then(()=>td)).DateElement,datePicker:async()=>(await Promise.resolve().then(()=>nd)).DatePickerElement,dropdown:async()=>(await Promise.resolve().then(()=>Dd)).DropdownElement,list:async()=>(await Promise.resolve().then(()=>wd)).ListElement,markdown:async()=>(await Promise.resolve().then(()=>xd)).MarkdownElement,password:async()=>(await Promise.resolve().then(()=>Td)).PasswordElement,textinput:async()=>(await Promise.resolve().then(()=>Rd)).TextinputElement,textarea:async()=>(await Promise.resolve().then(()=>Vd)).TextareaElement,toggle:async()=>(await Promise.resolve().then(()=>Yd)).ToggleElement,checkbox:async()=>(await Promise.resolve().then(()=>jd)).CheckboxElement,number:async()=>(await Promise.resolve().then(()=>nu)).NumberElement,radiogroup:async()=>(await Promise.resolve().then(()=>cu)).RadiogroupElement,select:async()=>(await Promise.resolve().then(()=>gu)).SelectElement,repeater:async()=>(await Promise.resolve().then(()=>$u)).RepeaterElement,flex:async()=>(await Promise.resolve().then(()=>Cu)).FlexElement,grid:async()=>(await Promise.resolve().then(()=>xu)).GridElement,tabs:async()=>(await Promise.resolve().then(()=>Iu)).TabsElement,accordion:async()=>(await Promise.resolve().then(()=>Lu)).AccordionElement,alert:async()=>(await Promise.resolve().then(()=>Fu)).AlertElement,markdownText:async()=>(await Promise.resolve().then(()=>qu)).MarkdownTextElement,renderer:async()=>(await Promise.resolve().then(()=>Vu)).RendererElement};var fl=Object.defineProperty,gl=Object.getOwnPropertyDescriptor,Ft=(e,t,i,n)=>{for(var a=n>1?void 0:n?gl(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&fl(t,i,a),a};S.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=Nn(t.formDef,t.formSelectors,t.formConfig),n={formDef:i.formDef,widgetLoaders:{...Oa,...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=dl({...t.customValidators??{}}),s=i.formEvent,r=s?l=>s(l.detail):void 0;return d.html`
|
|
3
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const r of e.seen.entries()){const l=r[1];if(t===r[0]){s(r);continue}if(e.external){const p=e.external.registry.get(r[0])?.id;if(t!==r[0]&&p){s(r);continue}}if(e.metadataRegistry.get(r[0])?.id){s(r);continue}if(l.cycle){s(r);continue}if(l.count>1&&e.reused==="ref"){s(r);continue}}}function $a(e,t){const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=r=>{const l=e.seen.get(r);if(l.ref===null)return;const u=l.def??l.schema,p={...u},c=l.ref;if(l.ref=null,c){n(c);const f=e.seen.get(c),g=f.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(g)):Object.assign(u,g),Object.assign(u,p),r._zod.parent===c)for(const I in u)I==="$ref"||I==="allOf"||I in p||delete u[I];if(g.$ref&&f.def)for(const I in u)I==="$ref"||I==="allOf"||I in f.def&&JSON.stringify(u[I])===JSON.stringify(f.def[I])&&delete u[I]}const h=r._zod.parent;if(h&&h!==c){n(h);const f=e.seen.get(h);if(f?.schema.$ref&&(u.$ref=f.schema.$ref,f.def))for(const g in u)g==="$ref"||g==="allOf"||g in f.def&&JSON.stringify(u[g])===JSON.stringify(f.def[g])&&delete u[g]}e.override({zodSchema:r,jsonSchema:u,path:l.path??[]})};for(const r of[...e.seen.entries()].reverse())n(r[0]);const a={};if(e.target==="draft-2020-12"?a.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?a.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?a.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const r=e.external.registry.get(t)?.id;if(!r)throw new Error("Schema is missing an `id` property");a.$id=e.external.uri(r)}Object.assign(a,i.def??i.schema);const s=e.external?.defs??{};for(const r of e.seen.entries()){const l=r[1];l.def&&l.defId&&(s[l.defId]=l.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?a.$defs=s:a.definitions=s);try{const r=JSON.parse(JSON.stringify(a));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:qt(t,"input",e.processors),output:qt(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch{throw new Error("Error converting schema to JSON.")}}function se(e,t){const i=t??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return se(n.element,i);if(n.type==="set")return se(n.valueType,i);if(n.type==="lazy")return se(n.getter(),i);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return se(n.innerType,i);if(n.type==="intersection")return se(n.left,i)||se(n.right,i);if(n.type==="record"||n.type==="map")return se(n.keyType,i)||se(n.valueType,i);if(n.type==="pipe")return se(n.in,i)||se(n.out,i);if(n.type==="object"){for(const a in n.shape)if(se(n.shape[a],i))return!0;return!1}if(n.type==="union"){for(const a of n.options)if(se(a,i))return!0;return!1}if(n.type==="tuple"){for(const a of n.items)if(se(a,i))return!0;return!!(n.rest&&se(n.rest,i))}return!1}const qr=(e,t={})=>i=>{const n=va({...i,processors:t});return ne(e,n),wa(n,e),$a(n,e)},qt=(e,t,i={})=>n=>{const{libraryOptions:a,target:s}=n??{},r=va({...a??{},target:s,io:t,processors:i});return ne(e,r),wa(r,e),$a(r,e)},Br={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Zr=(e,t,i,n)=>{const a=i;a.type="string";const{minimum:s,maximum:r,format:l,patterns:u,contentEncoding:p}=e._zod.bag;if(typeof s=="number"&&(a.minLength=s),typeof r=="number"&&(a.maxLength=r),l&&(a.format=Br[l]??l,a.format===""&&delete a.format,l==="time"&&delete a.format),p&&(a.contentEncoding=p),u&&u.size>0){const c=[...u];c.length===1?a.pattern=c[0].source:c.length>1&&(a.allOf=[...c.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},Vr=(e,t,i,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Ur=(e,t,i,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Wr=(e,t,i,n)=>{const a=i,s=e._zod.def,{minimum:r,maximum:l}=e._zod.bag;typeof r=="number"&&(a.minItems=r),typeof l=="number"&&(a.maxItems=l),a.type="array",a.items=ne(s.element,t,{...n,path:[...n.path,"items"]})},Gr=(e,t,i,n)=>{const a=e._zod.def,s=a.inclusive===!1,r=a.options.map((l,u)=>ne(l,t,{...n,path:[...n.path,s?"oneOf":"anyOf",u]}));s?i.oneOf=r:i.anyOf=r},Hr=(e,t,i,n)=>{const a=e._zod.def,s=ne(a.left,t,{...n,path:[...n.path,"allOf",0]}),r=ne(a.right,t,{...n,path:[...n.path,"allOf",1]}),l=p=>"allOf"in p&&Object.keys(p).length===1,u=[...l(s)?s.allOf:[s],...l(r)?r.allOf:[r]];i.allOf=u},Yr=(e,t,i,n)=>{const a=e._zod.def,s=ne(a.innerType,t,n),r=t.seen.get(e);t.target==="openapi-3.0"?(r.ref=a.innerType,i.nullable=!0):i.anyOf=[s,{type:"null"}]},Kr=(e,t,i,n)=>{const a=e._zod.def;ne(a.innerType,t,n);const s=t.seen.get(e);s.ref=a.innerType},Jr=(e,t,i,n)=>{const a=e._zod.def;ne(a.innerType,t,n);const s=t.seen.get(e);s.ref=a.innerType,i.default=JSON.parse(JSON.stringify(a.defaultValue))},Xr=(e,t,i,n)=>{const a=e._zod.def;ne(a.innerType,t,n);const s=t.seen.get(e);s.ref=a.innerType,t.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(a.defaultValue)))},Qr=(e,t,i,n)=>{const a=e._zod.def;ne(a.innerType,t,n);const s=t.seen.get(e);s.ref=a.innerType;let r;try{r=a.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=r},jr=(e,t,i,n)=>{const a=e._zod.def,s=t.io==="input"?a.in._zod.def.type==="transform"?a.out:a.in:a.out;ne(s,t,n);const r=t.seen.get(e);r.ref=s},eo=(e,t,i,n)=>{const a=e._zod.def;ne(a.innerType,t,n);const s=t.seen.get(e);s.ref=a.innerType,i.readOnly=!0},ka=(e,t,i,n)=>{const a=e._zod.def;ne(a.innerType,t,n);const s=t.seen.get(e);s.ref=a.innerType},to=m("ZodISODateTime",(e,t)=>{Zs.init(e,t),Bt.init(e,t)});function io(e){return gr(to,e)}const ao=m("ZodISODate",(e,t)=>{Vs.init(e,t),Bt.init(e,t)});function no(e){return br(ao,e)}const so=m("ZodISOTime",(e,t)=>{Us.init(e,t),Bt.init(e,t)});function ro(e){return Dr(so,e)}const oo=m("ZodISODuration",(e,t)=>{Ws.init(e,t),Bt.init(e,t)});function lo(e){return vr(oo,e)}const ve=m("ZodError",(e,t)=>{Xi.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>es(e,i)},flatten:{value:i=>jn(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,Jt,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,Jt,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),uo=Tt(ve),po=Lt(ve),co=Mt(ve),ho=Rt(ve),mo=as(ve),yo=ns(ve),fo=ss(ve),go=rs(ve),bo=os(ve),Do=ls(ve),vo=ds(ve),wo=us(ve),re=m("ZodType",(e,t)=>(z.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:qt(e,"input"),output:qt(e,"output")}}),e.toJSONSchema=qr(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...i)=>e.clone(Kn(t,{checks:[...t.checks??[],...i.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(i,n)=>Ki(e,i,n),e.brand=()=>e,e.register=((i,n)=>(i.add(e,n),e)),e.parse=(i,n)=>uo(e,i,n,{callee:e.parse}),e.safeParse=(i,n)=>co(e,i,n),e.parseAsync=async(i,n)=>po(e,i,n,{callee:e.parseAsync}),e.safeParseAsync=async(i,n)=>ho(e,i,n),e.spa=e.safeParseAsync,e.encode=(i,n)=>mo(e,i,n),e.decode=(i,n)=>yo(e,i,n),e.encodeAsync=async(i,n)=>fo(e,i,n),e.decodeAsync=async(i,n)=>go(e,i,n),e.safeEncode=(i,n)=>bo(e,i,n),e.safeDecode=(i,n)=>Do(e,i,n),e.safeEncodeAsync=async(i,n)=>vo(e,i,n),e.safeDecodeAsync=async(i,n)=>wo(e,i,n),e.refine=(i,n)=>e.check(Ho(i,n)),e.superRefine=i=>e.check(Yo(i)),e.overwrite=i=>e.check(Je(i)),e.optional=()=>_a(e),e.exactOptional=()=>To(e),e.nullable=()=>Ca(e),e.nullish=()=>_a(Ca(e)),e.nonoptional=i=>qo(e,i),e.array=()=>_o(e),e.or=i=>So([e,i]),e.and=i=>xo(e,i),e.transform=i=>Sa(e,Po(i)),e.default=i=>Ro(e,i),e.prefault=i=>Fo(e,i),e.catch=i=>Zo(e,i),e.pipe=i=>Sa(e,i),e.readonly=()=>Wo(e),e.describe=i=>{const n=e.clone();return it.add(n,{description:i}),n},Object.defineProperty(e,"description",{get(){return it.get(e)?.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return it.get(e);const n=e.clone();return it.add(n,i[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=i=>i(e),e)),$o=m("_ZodString",(e,t)=>{ii.init(e,t),re.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Zr(e,n,a);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...n)=>e.check(ga(...n)),e.includes=(...n)=>e.check(Er(...n)),e.startsWith=(...n)=>e.check(Pr(...n)),e.endsWith=(...n)=>e.check(Ir(...n)),e.min=(...n)=>e.check(Ke(...n)),e.max=(...n)=>e.check(Nt(...n)),e.length=(...n)=>e.check(fa(...n)),e.nonempty=(...n)=>e.check(Ke(1,...n)),e.lowercase=n=>e.check(Or(n)),e.uppercase=n=>e.check(xr(n)),e.trim=()=>e.check(Tr()),e.normalize=(...n)=>e.check(Ar(...n)),e.toLowerCase=()=>e.check(Lr()),e.toUpperCase=()=>e.check(Mr()),e.slugify=()=>e.check(Rr())}),Bt=m("ZodStringFormat",(e,t)=>{De.init(e,t),$o.init(e,t)}),ko=m("ZodArray",(e,t)=>{ra.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Wr(e,i,n,a),e.element=t.element,e.min=(i,n)=>e.check(Ke(i,n)),e.nonempty=i=>e.check(Ke(1,i)),e.max=(i,n)=>e.check(Nt(i,n)),e.length=(i,n)=>e.check(fa(i,n)),e.unwrap=()=>e.element});function _o(e,t){return zr(ko,e,t)}const Co=m("ZodUnion",(e,t)=>{Qs.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Gr(e,i,n,a),e.options=t.options});function So(e,t){return new Co({type:"union",options:e,...v(t)})}const Oo=m("ZodIntersection",(e,t)=>{js.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Hr(e,i,n,a)});function xo(e,t){return new Oo({type:"intersection",left:e,right:t})}const Eo=m("ZodTransform",(e,t)=>{er.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Ur(e,i),e._zod.parse=(i,n)=>{if(n.direction==="backward")throw new Ui(e.constructor.name);i.addIssue=s=>{if(typeof s=="string")i.issues.push(tt(s,i.value,t));else{const r=s;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=i.value),r.inst??(r.inst=e),i.issues.push(tt(r))}};const a=t.transform(i.value,i);return a instanceof Promise?a.then(s=>(i.value=s,i)):(i.value=a,i)}});function Po(e){return new Eo({type:"transform",transform:e})}const Io=m("ZodOptional",(e,t)=>{ni.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,a)=>ka(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function _a(e){return new Io({type:"optional",innerType:e})}const Ao=m("ZodExactOptional",(e,t)=>{tr.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,a)=>ka(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function To(e){return new Ao({type:"optional",innerType:e})}const Lo=m("ZodNullable",(e,t)=>{ir.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Yr(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function Ca(e){return new Lo({type:"nullable",innerType:e})}const Mo=m("ZodDefault",(e,t)=>{ar.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Jr(e,i,n,a),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ro(e,t){return new Mo({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Yi(t)}})}const zo=m("ZodPrefault",(e,t)=>{nr.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Xr(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function Fo(e,t){return new zo({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Yi(t)}})}const No=m("ZodNonOptional",(e,t)=>{sr.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Kr(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function qo(e,t){return new No({type:"nonoptional",innerType:e,...v(t)})}const Bo=m("ZodCatch",(e,t)=>{rr.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Qr(e,i,n,a),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Zo(e,t){return new Bo({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Vo=m("ZodPipe",(e,t)=>{or.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,a)=>jr(e,i,n,a),e.in=t.in,e.out=t.out});function Sa(e,t){return new Vo({type:"pipe",in:e,out:t})}const Uo=m("ZodReadonly",(e,t)=>{lr.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,a)=>eo(e,i,n,a),e.unwrap=()=>e._zod.def.innerType});function Wo(e){return new Uo({type:"readonly",innerType:e})}const Go=m("ZodCustom",(e,t)=>{ha.init(e,t),re.init(e,t),e._zod.processJSONSchema=(i,n,a)=>Vr(e,i)});function Ho(e,t={}){return ba(Go,e,t)}function Yo(e){return Da(e)}const qe=m("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");z.init(e,t),e.def=t,e.type=t.type,e.parse=(i,n)=>ts(e,i,n,{callee:e.parse}),e.safeParse=(i,n)=>Qi(e,i,n),e.parseAsync=async(i,n)=>is(e,i,n,{callee:e.parseAsync}),e.safeParseAsync=async(i,n)=>ji(e,i,n),e.check=(...i)=>e.clone({...t,checks:[...t.checks??[],...i.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(i,n)=>Ki(e,i,n),e.brand=()=>e,e.register=((i,n)=>(i.add(e,n),e)),e.apply=i=>i(e)}),Oa=m("ZodMiniString",(e,t)=>{ii.init(e,t),qe.init(e,t)});function xa(e){return pr(Oa,e)}const Xe=m("ZodMiniStringFormat",(e,t)=>{De.init(e,t),Oa.init(e,t)}),Ko=m("ZodMiniEmail",(e,t)=>{qs.init(e,t),Xe.init(e,t)});function Jo(e){return cr(Ko,e)}const Xo=m("ZodMiniUUID",(e,t)=>{Ns.init(e,t),Xe.init(e,t)});function Qo(e){return hr(Xo,e)}const jo=m("ZodMiniURL",(e,t)=>{Bs.init(e,t),Xe.init(e,t)});function el(e){return mr(jo,e)}const tl=m("ZodMiniIPv4",(e,t)=>{Gs.init(e,t),Xe.init(e,t)});function il(e){return yr(tl,e)}const al=m("ZodMiniIPv6",(e,t)=>{Hs.init(e,t),Xe.init(e,t)});function nl(e){return fr(al,e)}const sl=m("ZodMiniCustomStringFormat",(e,t)=>{Ys.init(e,t),Xe.init(e,t)});function rl(e){return Nr(sl,"hostname",ys,e)}const Ea=m("ZodMiniNumber",(e,t)=>{na.init(e,t),qe.init(e,t)});function Pa(e){return wr(Ea,e)}const ol=m("ZodMiniNumberFormat",(e,t)=>{Ks.init(e,t),Ea.init(e,t)});function ll(e){return $r(ol,e)}const dl=m("ZodMiniBoolean",(e,t)=>{Js.init(e,t),qe.init(e,t)});function Ia(e){return kr(dl,e)}const ul=m("ZodMiniAny",(e,t)=>{Xs.init(e,t),qe.init(e,t)});function si(){return _r(ul)}const pl=m("ZodMiniArray",(e,t)=>{ra.init(e,t),qe.init(e,t)});function Aa(e,t){return new pl({type:"array",element:e,...v(t)})}const cl=m("ZodMiniOptional",(e,t)=>{ni.init(e,t),qe.init(e,t)});function hl(e){return new cl({type:"optional",innerType:e})}const ml=m("ZodMiniCustom",(e,t)=>{ha.init(e,t),qe.init(e,t)});function K(e,t={}){return ba(ml,e,t)}function Ta(e){return Da(e)}const ri={email:{schema:Jo()},hostname:{schema:rl()},ipv4:{schema:il()},ipv6:{schema:nl()},url:{schema:el()},uuid:{schema:Qo()},date:{schema:no()},time:{schema:ro()},"date-time":{schema:io()},duration:{schema:lo()}},yl=Object.keys(ri),fl=e=>(t,i)=>{switch(t.type){case"string":return gl(t,i);case"integer":case"number":return Dl(t,i);case"boolean":return vl(t,i);case"array":return wl(t,i);case"custom":{if(!e)throw new Error('Validator type "custom" requires a customValidators object, but it was not supplied.');return $l(t,e)}}};function x(e,t){if(e!==void 0)return typeof e=="string"?e:t?.translate(e.key,e.params,e.default)??e.default}function gl(e,t){return at(e,i=>{const n=x(i.messages?.invalid,t);let a=n?xa(n):xa();if(i.required===!0){const s=x(i.messages?.required,t)??"This field is required";a=a.check(K(r=>r.length>0,{error:s}))}if(typeof i.minLength=="number"){const s=x(i.messages?.minLength,t),r=i.minLength;a=a.check(s?K(l=>l.length>=r,{error:s}):Ke(r))}if(typeof i.maxLength=="number"){const s=x(i.messages?.maxLength,t),r=i.maxLength;a=a.check(s?K(l=>l.length<=r,{error:s}):Nt(r))}if(typeof i.pattern=="string"){const s=x(i.messages?.pattern,t),r=new RegExp(i.pattern);a=a.check(s?K(l=>r.test(l),{error:s}):ga(r))}if(i.enum){const s=i.enum,r=x(i.messages?.enum,t);a=a.check(K(l=>s.includes(l),r?{error:r}:void 0))}if(i.const!==void 0){const s=x(i.messages?.const,t);a=a.check(K(r=>r===i.const,s?{error:s}:void 0))}if(i.format!==void 0)if(yl.includes(i.format)){const s=x(i.messages?.format,t);a=a.check(s?Ta((r,l)=>{const u=Se.standardValidate(ri[i.format].schema,r);Se.isStandardValidateSuccess(u)||l.addIssue({code:"custom",path:[],message:s})}):ri[i.format].schema)}else console.error(`The string validation format "${i.format}" is not supported`);return a})}const bl=(e,t)=>{if(t===0)return!1;const i=e/t;return Math.abs(i-Math.round(i))<1e-10};function Dl(e,t){return at(e,i=>{const n=x(i.messages?.invalid,t);let a=n?Pa(n):Pa();if(i.type==="integer"&&(a=a.check(ll())),i.minimum!==void 0){const s=x(i.messages?.minimum,t),r=i.minimum;a=a.check(s?K(l=>l>=r,{error:s}):Sr(r))}if(i.maximum!==void 0){const s=x(i.messages?.maximum,t),r=i.maximum;a=a.check(s?K(l=>l<=r,{error:s}):Cr(r))}if(i.exclusiveMinimum!==void 0){const s=x(i.messages?.exclusiveMinimum,t),r=i.exclusiveMinimum;a=a.check(K(l=>l>r,s?{error:s}:void 0))}if(i.exclusiveMaximum!==void 0){const s=x(i.messages?.exclusiveMaximum,t),r=i.exclusiveMaximum;a=a.check(K(l=>l<r,s?{error:s}:void 0))}if(i.multipleOf!==void 0){const s=x(i.messages?.multipleOf,t),r=i.multipleOf;a=a.check(K(l=>bl(l,r),s?{error:s}:void 0))}if(i.enum){const s=i.enum,r=x(i.messages?.enum,t);a=a.check(K(l=>s.includes(l),r?{error:r}:void 0))}if(i.const!==void 0){const s=x(i.messages?.const,t);a=a.check(K(r=>r===i.const,s?{error:s}:void 0))}return a})}function vl(e,t){return at(e,i=>{const n=x(i.messages?.invalid,t);let a=n?Ia(n):Ia();if(i.const!==void 0){const s=x(i.messages?.const,t);a=a.check(K(r=>r===i.const,s?{error:s}:void 0))}return a})}function wl(e,t){return at(e,i=>{const n=x(i.messages?.invalid,t);let a=n?Aa(si(),n):Aa(si());if(i.required===!0){const s=x(i.messages?.required,t)??"This field is required";a=a.check(K(r=>r.length>0,{error:s}))}if(typeof i.minItems=="number"){const s=x(i.messages?.minItems,t),r=i.minItems;a=a.check(s?K(l=>l.length>=r,{error:s}):Ke(r))}if(typeof i.maxItems=="number"){const s=x(i.messages?.maxItems,t),r=i.maxItems;a=a.check(s?K(l=>l.length<=r,{error:s}):Nt(r))}return a})}function $l(e,t){return at(e,i=>{let n=si();return Se.filterTap(Object.keys(i),a=>a!=="type"&&a!=="required",a=>{const s=i[a],r=t[a],l=r(s);n=n.check(Ta((u,p)=>{const c=Se.standardValidate(l,u);if(!Se.isStandardValidateSuccess(c)){const h=c.issues[0];p.addIssue({code:"custom",path:[],message:h?.message||`Validation failed for ${a}`})}}))}),n})}function at(e,t){const i=t(e);return e.required?i:hl(i)}const La={button:async()=>(await Promise.resolve().then(()=>El)).ButtonElement,calendar:async()=>(await Promise.resolve().then(()=>Nl)).CalendarElement,rangeCalendar:async()=>(await Promise.resolve().then(()=>Gl)).RangeCalendarElement,rangeDateInput:async()=>(await Promise.resolve().then(()=>Xl)).RangeDateInputElement,rangeDatePicker:async()=>(await Promise.resolve().then(()=>ed)).RangeDatePickerElement,currency:async()=>(await Promise.resolve().then(()=>sd)).CurrencyElement,dateInput:async()=>(await Promise.resolve().then(()=>ud)).DateElement,datePicker:async()=>(await Promise.resolve().then(()=>hd)).DatePickerElement,dropdown:async()=>(await Promise.resolve().then(()=>Od)).DropdownElement,list:async()=>(await Promise.resolve().then(()=>Pd)).ListElement,markdown:async()=>(await Promise.resolve().then(()=>zd)).MarkdownElement,password:async()=>(await Promise.resolve().then(()=>Zd)).PasswordElement,textinput:async()=>(await Promise.resolve().then(()=>Hd)).TextinputElement,textarea:async()=>(await Promise.resolve().then(()=>Qd)).TextareaElement,toggle:async()=>(await Promise.resolve().then(()=>au)).ToggleElement,checkbox:async()=>(await Promise.resolve().then(()=>lu)).CheckboxElement,number:async()=>(await Promise.resolve().then(()=>hu)).NumberElement,radiogroup:async()=>(await Promise.resolve().then(()=>wu)).RadiogroupElement,select:async()=>(await Promise.resolve().then(()=>Su)).SelectElement,tags:async()=>(await Promise.resolve().then(()=>Au)).TagsElement,repeater:async()=>(await Promise.resolve().then(()=>zu)).RepeaterElement,flex:async()=>(await Promise.resolve().then(()=>qu)).FlexElement,grid:async()=>(await Promise.resolve().then(()=>Vu)).GridElement,tabs:async()=>(await Promise.resolve().then(()=>Gu)).TabsElement,accordion:async()=>(await Promise.resolve().then(()=>Ku)).AccordionElement,alert:async()=>(await Promise.resolve().then(()=>Qu)).AlertElement,markdownText:async()=>(await Promise.resolve().then(()=>tp)).MarkdownTextElement,renderer:async()=>(await Promise.resolve().then(()=>np)).RendererElement};var kl=Object.defineProperty,_l=Object.getOwnPropertyDescriptor,Zt=(e,t,i,n)=>{for(var a=n>1?void 0:n?_l(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&kl(t,i,a),a};C.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=Gn(t.formDef,t.formSelectors,t.formConfig),n={formDef:i.formDef,widgetLoaders:{...La,...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=fl({...t.customValidators??{}}),s=i.formEvent,r=s?l=>s(l.detail):void 0;return d.html`
|
|
4
4
|
<gui-core-form
|
|
5
5
|
.config=${n}
|
|
6
6
|
.validators=${a}
|
|
7
7
|
.autocomplete=${this.autocomplete}
|
|
8
8
|
@formEvent=${r}
|
|
9
9
|
></gui-core-form>
|
|
10
|
-
`}},
|
|
10
|
+
`}},Zt([o.property({attribute:!1})],C.FormElement.prototype,"config",2),Zt([o.property({type:String})],C.FormElement.prototype,"autocomplete",2),Zt([o.query("gui-core-form")],C.FormElement.prototype,"coreForm",2),C.FormElement=Zt([o.customElement("gui-form")],C.FormElement);var Cl=Object.defineProperty,Sl=Object.getOwnPropertyDescriptor,Me=(e,t,i,n)=>{for(var a=n>1?void 0:n?Sl(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Cl(t,i,a),a};let Oe=class extends d.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"}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"},n=e?d.html`<span class="gui-widget-icon gui-button-icon ${e}" data-icon=${e}></span>`:d.nothing;return d.html`
|
|
11
11
|
<div class="gui-widget">
|
|
12
12
|
<button
|
|
13
|
-
type
|
|
13
|
+
type=${this.actionType??"button"}
|
|
14
14
|
tabindex="0"
|
|
15
15
|
id=${this.uid}
|
|
16
16
|
class=${$.classMap(i)}
|
|
@@ -22,9 +22,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
22
22
|
${t==="right"?n:d.nothing}
|
|
23
23
|
</button>
|
|
24
24
|
</div>
|
|
25
|
-
`}};
|
|
25
|
+
`}};Me([o.property({type:String})],Oe.prototype,"uid",2),Me([o.property({type:String})],Oe.prototype,"label",2),Me([o.property({type:Boolean})],Oe.prototype,"disabled",2),Me([o.property({type:String})],Oe.prototype,"icon",2),Me([o.property({type:String})],Oe.prototype,"variant",2),Me([o.property({type:String})],Oe.prototype,"iconPosition",2),Me([o.property({type:String})],Oe.prototype,"actionType",2),Oe=Me([o.customElement("gui-button")],Oe),typeof customElements<"u"&&!customElements.get("gui-button")&&customElements.define("gui-button",Oe);var Ol=Object.defineProperty,xl=Object.getOwnPropertyDescriptor,oi=(e,t,i,n)=>{for(var a=n>1?void 0:n?xl(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Ol(t,i,a),a};let nt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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 d.html`
|
|
26
26
|
<gui-button
|
|
27
27
|
.uid=${this.widget.uid}
|
|
28
|
+
.actionType=${this.adapter.templateData.actionType??"button"}
|
|
28
29
|
.label=${this.adapter.templateData.label}
|
|
29
30
|
?disabled=${this.adapter.templateData.disabled===!0}
|
|
30
31
|
.variant=${this.adapter.templateData.variant}
|
|
@@ -32,26 +33,26 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
32
33
|
.iconPosition=${this.adapter.templateData.iconPosition}
|
|
33
34
|
@click=${()=>this.adapter.click()}
|
|
34
35
|
></gui-button>
|
|
35
|
-
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};ii([D.consume({context:y.formContext}),o.property({attribute:!1})],et.prototype,"formContext",2),ii([D.provide({context:y.actionContext})],et.prototype,"adapter",2),et=ii([o.customElement("gui-button-interactive")],et);const $l=Object.freeze(Object.defineProperty({__proto__:null,get ButtonElement(){return et}},Symbol.toStringTag,{value:"Module"})),kl={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 xe(e){const t=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return`${t}-${i}-${n}`}function xa(e){return tt(e,new Date)}function tt(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function _l(e){const t=[0,1,2,3,4,5,6],i=e%7;return[...t.slice(i),...t.slice(0,i)]}function Ea(e){const t=kl[e??"en"]||{firstDay:0};return _l(t.firstDay)}function Cl(e){const t=new Intl.DateTimeFormat(e,{weekday:"narrow"}),i=new Date(2025,10,30);return Ea(e).map(n=>{const a=new Date(i);return a.setDate(i.getDate()+n),t.format(a)})}function Fe(e,t,i){for(let n=0;n<i;n++){const a=new Date(t.getFullYear(),t.getMonth()+n,1);if(e.getMonth()===a.getMonth()&&e.getFullYear()===a.getFullYear())return!0}return!1}function Sl(e,t,i="long"){return new Intl.DateTimeFormat(e,{month:i,year:"numeric"}).formatToParts(t).filter(a=>a.type==="month"||a.type==="year")}function Pa(e,t){const i=e||"en-US",s=new Intl.DateTimeFormat(i,{day:"numeric"}).formatToParts(t).find(r=>r.type==="day");return s?s.value:t.getDate().toString()}function ai(e,t){const i=xe(e),n=xe(t);return i===n?{start:i}:{start:i,end:n}}function Ia(e){return e.length?e.map(n=>({start:new Date(n.start).getTime(),end:new Date(n.end??n.start).getTime()})).sort((n,a)=>n.start-a.start).reduce((n,a)=>{const s=n[n.length-1];if(s){const r=new Date(s.end);if(r.setDate(r.getDate()+1),a.start<=r.getTime())return s.end=Math.max(s.end,a.end),n}return[...n,a]},[]).map(n=>ai(new Date(n.start),new Date(n.end))):[]}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:n,templateData:a}=this.getState(),{touched:s,errors:r,readonly:l,disabled:u,hint:p}=a,c=s&&r&&r.length>0;ke.filterTap(i,h=>!!h,h=>{const f=(g,_)=>{_?h.setAttribute(g,_):h.removeAttribute(g)};f("aria-describedby",p?`${n}_hint`:null),f("aria-invalid",c?"true":null),f("aria-errormessage",c?`${n}_errors`:null),f("aria-readonly",u||l?"true":null)})}}const le=(e,t,i=!1,n=void 0,a=!0)=>a?t.label?d.html`<label
|
|
36
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};oi([b.consume({context:y.formContext}),o.property({attribute:!1})],nt.prototype,"formContext",2),oi([b.provide({context:y.actionContext})],nt.prototype,"adapter",2),nt=oi([o.customElement("gui-button-interactive")],nt);const El=Object.freeze(Object.defineProperty({__proto__:null,get ButtonElement(){return nt}},Symbol.toStringTag,{value:"Module"})),Pl={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 Ie(e){const t=e.getFullYear(),i=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return`${t}-${i}-${n}`}function Ma(e){return st(e,new Date)}function st(e,t){return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}function Il(e){const t=[0,1,2,3,4,5,6],i=e%7;return[...t.slice(i),...t.slice(0,i)]}function Ra(e){const t=Pl[e??"en"]||{firstDay:0};return Il(t.firstDay)}function Al(e){const t=new Intl.DateTimeFormat(e,{weekday:"narrow"}),i=new Date(2025,10,30);return Ra(e).map(n=>{const a=new Date(i);return a.setDate(i.getDate()+n),t.format(a)})}function Be(e,t,i){for(let n=0;n<i;n++){const a=new Date(t.getFullYear(),t.getMonth()+n,1);if(e.getMonth()===a.getMonth()&&e.getFullYear()===a.getFullYear())return!0}return!1}function Tl(e,t,i="long"){return new Intl.DateTimeFormat(e,{month:i,year:"numeric"}).formatToParts(t).filter(a=>a.type==="month"||a.type==="year")}function za(e,t){const i=e||"en-US",s=new Intl.DateTimeFormat(i,{day:"numeric"}).formatToParts(t).find(r=>r.type==="day");return s?s.value:t.getDate().toString()}function li(e,t){const i=Ie(e),n=Ie(t);return i===n?{start:i}:{start:i,end:n}}function Fa(e){return e.length?e.map(n=>({start:new Date(n.start).getTime(),end:new Date(n.end??n.start).getTime()})).sort((n,a)=>n.start-a.start).reduce((n,a)=>{const s=n[n.length-1];if(s){const r=new Date(s.end);if(r.setDate(r.getDate()+1),a.start<=r.getTime())return s.end=Math.max(s.end,a.end),n}return[...n,a]},[]).map(n=>li(new Date(n.start),new Date(n.end))):[]}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:n,templateData:a}=this.getState(),{touched:s,errors:r,readonly:l,disabled:u,hint:p}=a,c=s&&r&&r.length>0;Se.filterTap(i,h=>!!h,h=>{const f=(g,k)=>{k?h.setAttribute(g,k):h.removeAttribute(g)};f("aria-describedby",p?`${n}_hint`:null),f("aria-invalid",c?"true":null),f("aria-errormessage",c?`${n}_errors`:null),f("aria-readonly",u||l?"true":null)})}}const le=(e,t,i=!1,n=void 0,a=!0)=>a?t.label?d.html`<label
|
|
36
37
|
class="gui-label"
|
|
37
38
|
for=${e}
|
|
38
39
|
data-cy=${`${e}_label`}
|
|
39
40
|
id=${n?`${e}_${n}_label`:`${e}_label`}
|
|
40
41
|
>
|
|
41
|
-
${t.label+(t.required?" *":"")} ${
|
|
42
|
-
${i?
|
|
42
|
+
${t.label+(t.required?" *":"")} ${Na(e,t)}
|
|
43
|
+
${i?F(e,t):d.nothing}
|
|
43
44
|
</label>`:d.nothing:t.label?d.html`<span
|
|
44
45
|
class="gui-label"
|
|
45
46
|
data-cy=${`${e}_label`}
|
|
46
47
|
id=${n?`${e}_${n}_label`:`${e}_label`}
|
|
47
48
|
>
|
|
48
|
-
${t.label+(t.required?" *":"")} ${
|
|
49
|
-
${i?
|
|
50
|
-
</span>`:d.nothing,
|
|
49
|
+
${t.label+(t.required?" *":"")} ${Na(e,t)}
|
|
50
|
+
${i?F(e,t):d.nothing}
|
|
51
|
+
</span>`:d.nothing,Na=(e,t)=>t.hint?d.html`<div class="gui-widget-hint" id=${`${e}_hint`}>${t.hint}</div>`:d.html``,Ze=(e,t)=>{const i={[`gui-${e}--icon`]:!1,[`gui-${e}--icon-right`]:!1};if(t.icon){i[`gui-${e}--icon`]=!0;const n={"gui-widget-icon":!0,[t.icon]:!0};return{widgetClasses:i,html:d.html`<span class=${$.classMap(n)} data-icon=${t.icon}></span>`}}else return{widgetClasses:i,html:d.html``}},F=(e,t)=>{const i=t.touched&&t.errors&&t.errors.length>0;return d.html`${i?d.html`<ul class="gui-validator" id=${`${e}_errors`} data-cy=${`${e}_validator-errors`}>
|
|
51
52
|
${t.errors?.map(n=>d.html`<li class="gui-validator__error" role="alert" data-cy=${`${e}_validator-error`}>
|
|
52
53
|
${n}
|
|
53
54
|
</li>`)}
|
|
54
|
-
</ul>`:""}`};var
|
|
55
|
+
</ul>`:""}`};var Ll=Object.defineProperty,E=(e,t,i,n)=>{for(var a=void 0,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=r(t,i,a)||a);return a&&Ll(t,i,a),a};class O extends d.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._currentDate=new Date,this._yearSelectorOpen=!1,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}})})}renderAboveCalendar(){return d.nothing}render(){const t={uid:this.uid,label:this.label,hint:this.hint,errors:this.errors,touched:this.touched,required:this.required},i=Array.from({length:this.numberOfMonths??1},(n,a)=>a);return d.html`
|
|
55
56
|
${this.label?le(this.uid,t,!1,"calendar"):d.nothing}
|
|
56
57
|
|
|
57
58
|
<div class="gui-widget" @focusout=${this.onFocusOut}>
|
|
@@ -99,25 +100,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
99
100
|
</div>
|
|
100
101
|
</div>
|
|
101
102
|
|
|
102
|
-
${this.errors?.length?
|
|
103
|
-
`}renderMonthPanel(t){const i=this.getDaysInMonth(t),n=this.chunkDays(i),a=
|
|
103
|
+
${this.errors?.length?F(this.uid,t):d.nothing}
|
|
104
|
+
`}renderMonthPanel(t){const i=this.getDaysInMonth(t),n=this.chunkDays(i),a=Al(this.localeId),s=new Date(this._currentDate);return s.setDate(1),s.setMonth(s.getMonth()+t),d.html`
|
|
104
105
|
<div class="gui-calendar__panel">
|
|
105
106
|
${this.renderHeader(s)}
|
|
106
107
|
${this._yearSelectorOpen&&t===0?this.renderYearGrid():d.html`
|
|
107
108
|
<div class="gui-calendar__days-grid" role="grid">
|
|
108
109
|
<div role="row" class="gui-calendar__rows">
|
|
109
|
-
${
|
|
110
|
+
${fe.repeat(a,(r,l)=>l,r=>d.html`<span class="gui-calendar__weekday" role="gridcell">${r}</span>`)}
|
|
110
111
|
</div>
|
|
111
112
|
|
|
112
|
-
${
|
|
113
|
+
${fe.repeat(n,r=>d.html`
|
|
113
114
|
<div role="row" class="gui-calendar__rows">
|
|
114
|
-
${
|
|
115
|
+
${fe.repeat(r,l=>l.date.toISOString(),l=>this.renderDay(l))}
|
|
115
116
|
</div>
|
|
116
117
|
`)}
|
|
117
118
|
</div>
|
|
118
119
|
`}
|
|
119
120
|
</div>
|
|
120
|
-
`}renderHeader(t){const i=
|
|
121
|
+
`}renderHeader(t){const i=Tl(this.localeId,t,this.monthFormat);return d.html`
|
|
121
122
|
<header class="gui-calendar__header">
|
|
122
123
|
<h2>
|
|
123
124
|
${i.map(n=>n.type==="year"?d.html`<button
|
|
@@ -169,7 +170,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
169
170
|
</div>
|
|
170
171
|
`)}
|
|
171
172
|
</div>
|
|
172
|
-
`}chunkYears(t){const i=[];for(let n=0;n<t.length;n+=4)i.push(t.slice(n,n+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 n=this._currentDate;this._currentDate=new Date(t,n.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 n=t.getBoundingClientRect(),a=i.getBoundingClientRect(),s=t.scrollTop+(a.top-n.top)-n.height/2+a.height/2;t.scrollTop=Math.max(0,s)}}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 n=Array.from(this.querySelectorAll(".gui-calendar__year-button")),a=n.indexOf(i),s=window.getComputedStyle(this).direction==="rtl";let r=0;switch(t.key){case"ArrowLeft":r=s?1:-1;break;case"ArrowRight":r=s?-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<n.length&&n[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)")),s=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(s,l,a);let p=!1;if(u<0)if(this.canGoPrev())this.prevMonth(),p=!0;else{a.find(h=>!this.isButtonDisabled(h))?.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)")),h=Array.from(this.querySelectorAll(".gui-calendar__panel"));let f;if(u<0)f=h[0].querySelectorAll(".gui-calendar__day-button:not(.other-month)").length+u;else{const
|
|
173
|
+
`}chunkYears(t){const i=[];for(let n=0;n<t.length;n+=4)i.push(t.slice(n,n+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 n=this._currentDate;this._currentDate=new Date(t,n.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 n=t.getBoundingClientRect(),a=i.getBoundingClientRect(),s=t.scrollTop+(a.top-n.top)-n.height/2+a.height/2;t.scrollTop=Math.max(0,s)}}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 n=Array.from(this.querySelectorAll(".gui-calendar__year-button")),a=n.indexOf(i),s=window.getComputedStyle(this).direction==="rtl";let r=0;switch(t.key){case"ArrowLeft":r=s?1:-1;break;case"ArrowRight":r=s?-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<n.length&&n[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)")),s=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(s,l,a);let p=!1;if(u<0)if(this.canGoPrev())this.prevMonth(),p=!0;else{a.find(h=>!this.isButtonDisabled(h))?.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)")),h=Array.from(this.querySelectorAll(".gui-calendar__panel"));let f;if(u<0)f=h[0].querySelectorAll(".gui-calendar__day-button:not(.other-month)").length+u;else{const k=h[h.length-1].querySelectorAll(".gui-calendar__day-button:not(.other-month)").length;f=c.length-k+(u-a.length)}if(this.isButtonDisabled(c[f])){const g=this.findNextFocusableIndex(f,l,c);if(g<0||g>=c.length){const k=c.findIndex(I=>!this.isButtonDisabled(I));k>-1&&c[k].focus()}else c[g]?.focus()}else{const g=Math.max(0,Math.min(f,c.length-1));c[g]?.focus()}}else a[u]?.focus()}chunkDays(t){const i=[];for(let n=0;n<t.length;n+=7)i.push(t.slice(n,n+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=Ie(t);if(this.minDate&&i<this.minDate||this.maxDate&&i>this.maxDate)return!0;if(this.disabledRanges&&this.disabledRanges.length>0)for(const n of this.disabledRanges){const a=n.start.split("T")[0],s=n.end?n.end.split("T")[0]:a;if(i>=a&&i<=s)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(),n=this._currentDate.getMonth()+t,a=new Date(i,n,1),s=a.getDay(),r=Ra(this.localeId)[0],l=(s-r+7)%7,u=new Date(a);u.setDate(a.getDate()-l);const p=[];for(let c=0;c<42;c++){const h=new Date(u);h.setDate(u.getDate()+c),p.push(h)}return p}findNextFocusableIndex(t,i,n){let a=t+i;for(;a>=0&&a<n.length;){const s=n[a];if(!this.isButtonDisabled(s))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 Ie(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 Ie(i)<=this.maxDate}}E([o.property({type:String})],O.prototype,"uid"),E([o.property({type:String})],O.prototype,"label"),E([o.property({type:String})],O.prototype,"hint"),E([o.property({type:String,attribute:"locale-id"})],O.prototype,"localeId"),E([o.property({type:Array})],O.prototype,"errors"),E([o.property({type:Boolean})],O.prototype,"touched"),E([o.property({type:Boolean})],O.prototype,"required"),E([o.property({type:Boolean})],O.prototype,"disabled"),E([o.property({type:Boolean,attribute:"readonly"})],O.prototype,"readOnly"),E([o.property({type:String,attribute:"prev-month-icon"})],O.prototype,"prevMonthIcon"),E([o.property({type:String,attribute:"next-month-icon"})],O.prototype,"nextMonthIcon"),E([o.property({type:String,attribute:"prev-month-aria-label"})],O.prototype,"prevMonthAriaLabel"),E([o.property({type:String,attribute:"next-month-aria-label"})],O.prototype,"nextMonthAriaLabel"),E([o.property({type:String})],O.prototype,"dayFormat"),E([o.property({type:String})],O.prototype,"weekdayFormat"),E([o.property({type:String})],O.prototype,"monthFormat"),E([o.property({type:String})],O.prototype,"minDate"),E([o.property({type:String})],O.prototype,"maxDate"),E([o.property({type:Array})],O.prototype,"disabledRanges"),E([o.property({type:Number})],O.prototype,"numberOfMonths"),E([o.state()],O.prototype,"_currentDate"),E([o.state()],O.prototype,"_yearSelectorOpen");var Ml=Object.defineProperty,Rl=Object.getOwnPropertyDescriptor,qa=(e,t,i,n)=>{for(var a=n>1?void 0:n?Rl(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Ml(t,i,a),a};let Vt=class extends O{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())&&!Be(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`
|
|
173
174
|
<button
|
|
174
175
|
type="button"
|
|
175
176
|
role="gridcell"
|
|
@@ -183,7 +184,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
183
184
|
>
|
|
184
185
|
${e.dayLabel}
|
|
185
186
|
</button>
|
|
186
|
-
`}getDaysInMonth(e){const t=new Date(this._currentDate);t.setDate(1),t.setMonth(t.getMonth()+e);const i=this.generateDateGrid(e),n=t.getMonth();let a=i.map(s=>{const r=s.getMonth()===n,l=this.isDisabled(s),u=!!this.value&&
|
|
187
|
+
`}getDaysInMonth(e){const t=new Date(this._currentDate);t.setDate(1),t.setMonth(t.getMonth()+e);const i=this.generateDateGrid(e),n=t.getMonth();let a=i.map(s=>{const r=s.getMonth()===n,l=this.isDisabled(s),u=!!this.value&&st(s,new Date(this.value)),p=Ma(s),c=(u||p)&&r;return{date:s,dayLabel:za(this.localeId,s),isCurrentMonth:r,isToday:p,isDisabled:l,isSelected:u,isFocusable:c}});for(let s=0;s<2;s++)a.slice(-7).every(l=>!l.isCurrentMonth)&&(a=a.slice(0,-7));if(e===0&&!a.some(s=>s.isFocusable)){const s=this.value?new Date(this.value):new Date;if(!Be(s,this._currentDate,this.numberOfMonths??1)){const r=a.find(l=>l.isCurrentMonth&&!l.isDisabled);r&&(r.isFocusable=!0)}}return a}selectDate(e){if(!e.isCurrentMonth||e.isDisabled||this.disabled||this.readOnly)return;const t=Ie(e.date);this.value=t,this.dispatchEvent(new CustomEvent("change",{detail:{value:t},bubbles:!0,composed:!0}))}};qa([o.property({type:String})],Vt.prototype,"value",2),Vt=qa([o.customElement("gui-calendar")],Vt),typeof customElements<"u"&&!customElements.get("gui-calendar")&&customElements.define("gui-calendar",Vt);var zl=Object.defineProperty,Fl=Object.getOwnPropertyDescriptor,di=(e,t,i,n)=>{for(var a=n>1?void 0:n?Fl(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&zl(t,i,a),a};let rt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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(),d.html`
|
|
187
188
|
<gui-calendar
|
|
188
189
|
.uid=${this.widget.uid}
|
|
189
190
|
.label=${this.adapter.templateData.label}
|
|
@@ -209,7 +210,76 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
209
210
|
@change=${this.valueChanged}
|
|
210
211
|
@blur=${()=>this.adapter.onBlur()}
|
|
211
212
|
></gui-calendar>
|
|
212
|
-
`}valueChanged(e){const t=e?.target;this.adapter.valueChanged(t.value)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
213
|
+
`}valueChanged(e){const t=e?.target;this.adapter.valueChanged(t.value)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};di([b.consume({context:y.formContext}),o.property({attribute:!1})],rt.prototype,"formContext",2),di([b.provide({context:y.inputContext})],rt.prototype,"adapter",2),rt=di([o.customElement("gui-calendar-input")],rt);const Nl=Object.freeze(Object.defineProperty({__proto__:null,get CalendarElement(){return rt}},Symbol.toStringTag,{value:"Module"}));function Ut(e,t,i){if(!e)throw new TypeError("The element provided to the IntersectionObserver must exist");const n=new IntersectionObserver(a=>{a.forEach(s=>{t(s.isIntersecting)})},i);return n.observe(e),n}var ql=Object.defineProperty,Bl=Object.getOwnPropertyDescriptor,pe=(e,t,i,n)=>{for(var a=n>1?void 0:n?Bl(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&ql(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"),n=e.composedPath()[0];!t?.contains(n)&&!i?.contains(n)&&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 n=Math.max(0,Math.min(t,i-1));this.focusPillAt(n)}}disconnectedCallback(){super.disconnectedCallback(),this.disconnectObservers(),this.removeOutsideListeners()}render(){const e=this.items.length;return e===0?d.nothing:d.html`
|
|
214
|
+
${this.renderStrip()}
|
|
215
|
+
${this.bubble?this.renderCompact(e):d.nothing}
|
|
216
|
+
${this.bubble&&this._showDropdown?this.renderDropdown():d.nothing}
|
|
217
|
+
`}renderStrip(){return d.html`
|
|
218
|
+
<div
|
|
219
|
+
class=${$.classMap({"gui-pills__strip-wrapper":!0,"gui-pills--start-shadow":!this._isStartVisible,"gui-pills--end-shadow":!this._isEndVisible})}
|
|
220
|
+
>
|
|
221
|
+
<div class="gui-pills__strip" role="list" tabindex="-1">
|
|
222
|
+
<span class="gui-sentinel gui-sentinel__start"></span>
|
|
223
|
+
${Li.repeat(this.items,e=>e.key,(e,t)=>this.renderPill(e,t,!1))}
|
|
224
|
+
<span class="gui-sentinel gui-sentinel__end"></span>
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
`}renderCompact(e){return d.html`
|
|
228
|
+
<div class="gui-pills__compact">
|
|
229
|
+
<button
|
|
230
|
+
type="button"
|
|
231
|
+
class="gui-pills__count"
|
|
232
|
+
aria-label=${this.compactAriaLabel??`${e} items`}
|
|
233
|
+
aria-expanded=${this._showDropdown}
|
|
234
|
+
?disabled=${this.disabled||this.readOnly}
|
|
235
|
+
@click=${t=>{t.stopPropagation(),this.toggleDropdown()}}
|
|
236
|
+
>
|
|
237
|
+
${e}
|
|
238
|
+
</button>
|
|
239
|
+
</div>
|
|
240
|
+
`}renderDropdown(){return d.html`
|
|
241
|
+
<div class="gui-pills__dropdown" role="list">
|
|
242
|
+
${Li.repeat(this.items,e=>`dd-${e.key}`,(e,t)=>this.renderPill(e,t,!0))}
|
|
243
|
+
</div>
|
|
244
|
+
`}renderPill(e,t,i){const n=e.ariaLabel??`${this.removeAriaLabel}: ${e.label}`,a=this.clickable&&!this.disabled&&!this.readOnly;return d.html`
|
|
245
|
+
<div
|
|
246
|
+
class=${$.classMap({"gui-pills__pill":!0,"gui-pills__pill--clickable":a})}
|
|
247
|
+
role="listitem"
|
|
248
|
+
data-key=${e.key}
|
|
249
|
+
data-index=${t}
|
|
250
|
+
data-in-dropdown=${i}
|
|
251
|
+
tabindex=${this.tabbable&&!this.disabled&&!this.readOnly?0:-1}
|
|
252
|
+
aria-label=${n}
|
|
253
|
+
@click=${s=>this.onPillClick(s,e)}
|
|
254
|
+
@focus=${this.handlePillFocus}
|
|
255
|
+
@keydown=${s=>this.onPillKeydown(s,e,t)}
|
|
256
|
+
>
|
|
257
|
+
<span class="gui-pills__pill-text">${e.label}</span>
|
|
258
|
+
${this.removable?this.renderRemoveButton(e):d.nothing}
|
|
259
|
+
</div>
|
|
260
|
+
`}renderRemoveButton(e){return d.html`
|
|
261
|
+
<button
|
|
262
|
+
type="button"
|
|
263
|
+
class="gui-pills__pill-remove"
|
|
264
|
+
tabindex="-1"
|
|
265
|
+
aria-hidden="true"
|
|
266
|
+
?disabled=${this.disabled||this.readOnly}
|
|
267
|
+
@click=${t=>{t.stopPropagation(),this.emitRemove(e.key,this.items.indexOf(e))}}
|
|
268
|
+
>
|
|
269
|
+
${this.removeIcon?d.html`<span class=${`gui-widget-icon ${this.removeIcon}`} data-icon=${this.removeIcon}></span>`:d.html`<svg
|
|
270
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
271
|
+
width="16"
|
|
272
|
+
height="16"
|
|
273
|
+
viewBox="0 0 256 256"
|
|
274
|
+
fill="currentColor"
|
|
275
|
+
aria-hidden="true"
|
|
276
|
+
>
|
|
277
|
+
<path
|
|
278
|
+
d="M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"
|
|
279
|
+
></path>
|
|
280
|
+
</svg>`}
|
|
281
|
+
</button>
|
|
282
|
+
`}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 n=this._showDropdown,a=n?"ArrowUp":"ArrowLeft",s=n?"ArrowDown":"ArrowRight";if(e.key===a){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"&&n){e.preventDefault(),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 n=Math.max(0,Math.min(e,i.length-1));i[n].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=Ut(e,i=>this._isStartVisible=i)),t&&!this.endObserver&&(this.endObserver=Ut(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}};pe([o.property({type:Array})],ee.prototype,"items",2),pe([o.property({type:Boolean})],ee.prototype,"clickable",2),pe([o.property({type:Boolean})],ee.prototype,"removable",2),pe([o.property({type:Boolean})],ee.prototype,"bubble",2),pe([o.property({type:Boolean})],ee.prototype,"tabbable",2),pe([o.property({type:Boolean})],ee.prototype,"disabled",2),pe([o.property({type:Boolean,attribute:"readonly"})],ee.prototype,"readOnly",2),pe([o.property({type:String,attribute:"remove-aria-label"})],ee.prototype,"removeAriaLabel",2),pe([o.property({type:String,attribute:"remove-icon"})],ee.prototype,"removeIcon",2),pe([o.property({type:String,attribute:"compact-aria-label"})],ee.prototype,"compactAriaLabel",2),pe([o.state()],ee.prototype,"_isStartVisible",2),pe([o.state()],ee.prototype,"_isEndVisible",2),pe([o.state()],ee.prototype,"_showDropdown",2),ee=pe([o.customElement("gui-pills")],ee),typeof customElements<"u"&&!customElements.get("gui-pills")&&customElements.define("gui-pills",ee);var Zl=Object.defineProperty,Vl=Object.getOwnPropertyDescriptor,Re=(e,t,i,n)=>{for(var a=n>1?void 0:n?Vl(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Zl(t,i,a),a};let xe=class extends O{constructor(){super(...arguments),this.value=[],this.focusDate=void 0,this.hidePills=!1,this.removePillAriaLabel=void 0,this._anchorDate=null,this._nextDate=null,this._isSelecting=!1,this._skipValueNavigation=!1,this.onPillRemoveEvent=e=>{if(this.disabled||this.readOnly)return;const i=this.getSortedPills().find(a=>`${a.start}-${a.end??a.start}`===e.detail.key);if(!i)return;const n=(this.value??[]).filter(a=>!(a.start===i.start&&(a.end??null)===(i.end??null)));this.value=n,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))},this.onPillClickEvent=e=>{const i=this.getSortedPills().find(n=>`${n.start}-${n.end??n.start}`===e.detail.key);i&&this.navigateToDate(i.start)}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}willUpdate(e){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}];if(t.length>0&&t[0].start){const i=new Date(t[0].start);!isNaN(i.getTime())&&!Be(i,this._currentDate,this.numberOfMonths??1)&&(this._currentDate=i)}}}if(e.has("focusDate")&&this.focusDate){const t=new Date(this.focusDate);isNaN(t.getTime())||(Be(t,this._currentDate,this.numberOfMonths??1)||(this._currentDate=t),this.focusDate=void 0)}}renderDay(e){const t={"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,"is-anchor":e.isAnchor,"is-selecting":e.isSelecting,disabled:e.isDisabled};return d.html`
|
|
213
283
|
<button
|
|
214
284
|
type="button"
|
|
215
285
|
role="gridcell"
|
|
@@ -225,48 +295,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
225
295
|
>
|
|
226
296
|
${e.dayLabel}
|
|
227
297
|
</button>
|
|
228
|
-
`}getDaysInMonth(e){const t=new Date(this._currentDate);t.setDate(1),t.setMonth(t.getMonth()+e);const i=this.generateDateGrid(e),n=t.getMonth();let a=i.map(s=>{const r=s.getMonth()===n,l=this.isDisabled(s),u=
|
|
229
|
-
<
|
|
230
|
-
class
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
tabindex="0"
|
|
243
|
-
aria-label="${this.removePillAriaLabel??"Remove date"} ${a}"
|
|
244
|
-
@click=${()=>this.navigateToDate(e.start)}
|
|
245
|
-
@keydown=${s=>this.handlePillKeydown(s,t)}
|
|
246
|
-
>
|
|
247
|
-
<span class="gui-range-calendar__pill-text">${a}</span>
|
|
248
|
-
<button
|
|
249
|
-
type="button"
|
|
250
|
-
class="gui-range-calendar__pill-remove"
|
|
251
|
-
tabindex="-1"
|
|
252
|
-
?disabled=${this.disabled||this.readOnly}
|
|
253
|
-
@click=${s=>{s.stopPropagation(),this.removePill(t)}}
|
|
254
|
-
>
|
|
255
|
-
<svg
|
|
256
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
257
|
-
width="16"
|
|
258
|
-
height="16"
|
|
259
|
-
viewBox="0 0 256 256"
|
|
260
|
-
fill="currentColor"
|
|
261
|
-
aria-hidden="true"
|
|
262
|
-
>
|
|
263
|
-
<path
|
|
264
|
-
d="M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"
|
|
265
|
-
></path>
|
|
266
|
-
</svg>
|
|
267
|
-
</button>
|
|
268
|
-
</div>
|
|
269
|
-
`}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())}removePill(e){if(this.disabled||this.readOnly)return;const t=this.getSortedPills();t.splice(e,1),this.value=[...t],this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))}handlePillKeydown(e,t){if(e.key==="Delete"||e.key==="Backspace"){e.preventDefault(),this.removePill(t);return}if(e.key==="Enter"){e.preventDefault();const i=this.getSortedPills();i[t]&&this.navigateToDate(i[t].start);return}if(e.key==="ArrowLeft"||e.key==="ArrowRight"){e.preventDefault();const i=this.querySelectorAll(".gui-range-calendar__pills .gui-range-calendar__pill"),n=e.key==="ArrowLeft"?t-1:t+1;n>=0&&n<i.length&&i[n].focus()}}navigateToDate(e){const t=new Date(e);!isNaN(t.getTime())&&!Fe(t,this._currentDate,this.numberOfMonths??1)&&(this._currentDate=t)}setupObservers(){const e=this.querySelector(".gui-sentinel__start"),t=this.querySelector(".gui-sentinel__end");e&&!this.startObserver&&(this.startObserver=Ye(e,i=>this._isStartVisible=i)),t&&!this.endObserver&&(this.endObserver=Ye(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}};_e([o.property({type:Array})],ge.prototype,"value",2),_e([o.property({type:String})],ge.prototype,"focusDate",2),_e([o.property({type:Boolean})],ge.prototype,"hidePills",2),_e([o.property({type:String})],ge.prototype,"removePillAriaLabel",2),_e([o.state()],ge.prototype,"_anchorDate",2),_e([o.state()],ge.prototype,"_nextDate",2),_e([o.state()],ge.prototype,"_isSelecting",2),_e([o.state()],ge.prototype,"_isStartVisible",2),_e([o.state()],ge.prototype,"_isEndVisible",2),ge=_e([o.customElement("gui-range-calendar")],ge),typeof customElements<"u"&&!customElements.get("gui-range-calendar")&&customElements.define("gui-range-calendar",ge);var Ml=Object.defineProperty,zl=Object.getOwnPropertyDescriptor,si=(e,t,i,n)=>{for(var a=n>1?void 0:n?zl(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Ml(t,i,a),a};let at=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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(),d.html`
|
|
298
|
+
`}getDaysInMonth(e){const t=new Date(this._currentDate);t.setDate(1),t.setMonth(t.getMonth()+e);const i=this.generateDateGrid(e),n=t.getMonth();let a=i.map(s=>{const r=s.getMonth()===n,l=this.isDisabled(s),u=Ma(s),{isRangeStart:p,isRangeEnd:c,isInRange:h,isSelecting:f}=this.checkDateStatus(s),g=u||p,k=this._anchorDate?st(s,this._anchorDate):!1;return{date:s,dayLabel:za(this.localeId,s),isCurrentMonth:r,isToday:u,isRangeStart:p,isRangeEnd:c,isInRange:h,isDisabled:l,isOneDayRange:p&&c,isAnchor:k,isFocusable:g,isSelecting:f&&r}});for(let s=0;s<2;s++)a.slice(-7).every(l=>!l.isCurrentMonth)&&(a=a.slice(0,-7));if(e===0&&!a.some(s=>s.isFocusable)){const s=this.numberOfMonths??1,r=Be(new Date,this._currentDate,s),l=this.value?.some(u=>Be(new Date(u.start),this._currentDate,s))??!1;if(!r&&!l){const u=a.find(p=>p.isCurrentMonth&&!p.isDisabled);u&&(u.isFocusable=!0)}}return a}checkDateStatus(e){let t=!1,i=!1,n=!1,a=!1;if(this._isSelecting&&this._nextDate&&this._anchorDate){const s=this._nextDate.date,r=new Date(this._anchorDate);s.getTime()>r.getTime()?a=e.getTime()>=r.getTime()&&e.getTime()<=s.getTime():a=e.getTime()>=s.getTime()&&e.getTime()<=r.getTime()}if(this.value&&Array.isArray(this.value))for(const s of this.value){const r=new Date(s.start);if(st(e,r)&&(t=!0,i=!s.end),s.end){const l=new Date(s.end);st(e,l)&&(i=!0);const u=e.getTime(),p=r.getTime(),c=l.getTime();u>p&&u<c&&(n=!0)}}return{isRangeStart:t,isRangeEnd:i,isInRange:n,isSelecting:a}}selectDate(e,t=null){if(!e.isCurrentMonth||this.disabled||this.readOnly)return;const i=e.date;if(!this._anchorDate){this._isSelecting=!0,this._anchorDate=i;return}let n=this._anchorDate,a=i;i<n&&(n=i,a=this._anchorDate);const s=this.calculateValidRanges(n,a),r=[...this.value||[],...s];this._skipValueNavigation=!0,this.value=Fa(r),this._isSelecting=!1,this._nextDate=null,this._anchorDate=null,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))}calculateValidRanges(e,t){const i=[],n=new Date(e),a=new Date(t);n.setHours(0,0,0,0),a.setHours(0,0,0,0);let s=null;for(;n<=a;){if(!this.isDisabled(n))s||(s=new Date(n));else if(s){const l=new Date(n);l.setDate(n.getDate()-1),i.push(li(s,l)),s=null}n.setDate(n.getDate()+1)}return s&&i.push(li(s,t)),i}onMouseOver(e){this._isSelecting&&(this._nextDate=e)}renderAboveCalendar(){if(this.hidePills)return d.nothing;const e=this.getSortedPills();if(e.length===0)return d.nothing;const t=e.map(i=>{const n=this.formatDateForDisplay(i.start),a=i.end?this.formatDateForDisplay(i.end):n,s=`${n} - ${a}`;return{key:`${i.start}-${i.end??i.start}`,label:s,ariaLabel:`${this.removePillAriaLabel??"Remove date"} ${s}`}});return d.html`
|
|
299
|
+
<gui-pills
|
|
300
|
+
class="gui-range-calendar__pills"
|
|
301
|
+
.items=${t}
|
|
302
|
+
.removable=${!0}
|
|
303
|
+
.clickable=${!0}
|
|
304
|
+
.bubble=${!1}
|
|
305
|
+
?disabled=${this.disabled}
|
|
306
|
+
?readonly=${this.readOnly}
|
|
307
|
+
.removeAriaLabel=${this.removePillAriaLabel??"Remove date"}
|
|
308
|
+
@pillremove=${this.onPillRemoveEvent}
|
|
309
|
+
@pillclick=${this.onPillClickEvent}
|
|
310
|
+
></gui-pills>
|
|
311
|
+
`}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())}navigateToDate(e){const t=new Date(e);!isNaN(t.getTime())&&!Be(t,this._currentDate,this.numberOfMonths??1)&&(this._currentDate=t)}};Re([o.property({type:Array})],xe.prototype,"value",2),Re([o.property({type:String})],xe.prototype,"focusDate",2),Re([o.property({type:Boolean})],xe.prototype,"hidePills",2),Re([o.property({type:String})],xe.prototype,"removePillAriaLabel",2),Re([o.state()],xe.prototype,"_anchorDate",2),Re([o.state()],xe.prototype,"_nextDate",2),Re([o.state()],xe.prototype,"_isSelecting",2),xe=Re([o.customElement("gui-range-calendar")],xe),typeof customElements<"u"&&!customElements.get("gui-range-calendar")&&customElements.define("gui-range-calendar",xe);var Ul=Object.defineProperty,Wl=Object.getOwnPropertyDescriptor,ui=(e,t,i,n)=>{for(var a=n>1?void 0:n?Wl(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Ul(t,i,a),a};let ot=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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(),d.html`
|
|
270
312
|
<gui-range-calendar
|
|
271
313
|
.uid=${this.widget.uid}
|
|
272
314
|
.label=${this.adapter.templateData.label}
|
|
@@ -294,36 +336,31 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
294
336
|
@change=${this.valueChanged}
|
|
295
337
|
@blur=${()=>this.adapter.onBlur()}
|
|
296
338
|
></gui-range-calendar>
|
|
297
|
-
`}valueChanged(e){const t=e?.target;this.adapter.valueChanged(t.value)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
339
|
+
`}valueChanged(e){const t=e?.target;this.adapter.valueChanged(t.value)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};ui([b.consume({context:y.formContext}),o.property({attribute:!1})],ot.prototype,"formContext",2),ui([b.provide({context:y.inputContext})],ot.prototype,"adapter",2),ot=ui([o.customElement("gui-range-calendar-input")],ot);const Gl=Object.freeze(Object.defineProperty({__proto__:null,get RangeCalendarElement(){return ot}},Symbol.toStringTag,{value:"Module"}));var Hl=Object.defineProperty,Yl=Object.getOwnPropertyDescriptor,N=(e,t,i,n)=>{for(var a=n>1?void 0:n?Yl(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Hl(t,i,a),a};let A=class extends d.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.value=[],this.hint=void 0,this.icon="",this.removePillAriaLabel=void 0,this.startDateAriaLabel=void 0,this.endDateAriaLabel=void 0,this.separator=void 0,this._startDate={day:"",month:"",year:""},this._endDate={day:"",month:"",year:""},this.MIN_DAY=1,this.MAX_DAY=31,this.MAX_VALID_DAY=(e,t)=>e===2?new Date(t,1,29).getDate()===29||!t?29:28:e===4||e===6||e===9||e===11?30:31,this.MIN_MONTH=1,this.MAX_MONTH=12,this.MIN_YEAR=1e3,this.MAX_YEAR=9999,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(".gui-range-date-input"),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=this.getSortedPills(),i=t.findIndex(s=>`${s.start}-${s.end??s.start}`===e.detail.key);if(i<0)return;const n=t[i],a=(this.value??[]).filter(s=>!(s.start===n.start&&(s.end??null)===(n.end??null)));this.value=a,this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),a.length===0&&requestAnimationFrame(()=>{this.querySelector(".gui-range-date-input__field input")?.focus()})},this.onPillClickEvent=e=>{const i=this.getSortedPills().find(n=>`${n.start}-${n.end??n.start}`===e.detail.key);i&&this.onPillClick(i)}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-field")}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=new Intl.DateTimeFormat(this.localeId??"en",{year:"numeric",month:"numeric",day:"numeric"}).formatToParts(new Date),n=this.getSortedPills().map(s=>{const r=this.formatDateForDisplay(s.start),l=s.end?this.formatDateForDisplay(s.end):r,u=`${r} - ${l}`;return{key:`${s.start}-${s.end??s.start}`,label:u,ariaLabel:`${this.removePillAriaLabel??"Remove date"} ${u}`}}),a={"gui-widget-icon":!0,[this.icon]:!!this.icon};return d.html`
|
|
298
340
|
${this.label?le(this.uid,e,!1,void 0,!1):d.nothing}
|
|
299
341
|
|
|
300
342
|
<div class="gui-widget">
|
|
301
343
|
<div
|
|
302
|
-
class="gui-range-date-input ${this.icon?"gui-range-date-input--icon":""}"
|
|
344
|
+
class="gui-widget-input gui-range-date-input ${this.icon?"gui-range-date-input--icon":""}"
|
|
303
345
|
role="group"
|
|
304
346
|
aria-label=${this.label??"Date range input"}
|
|
305
347
|
>
|
|
306
|
-
${this.icon?d.html`<span class=${$.classMap(
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
@click=${this.togglePillsList}
|
|
323
|
-
>
|
|
324
|
-
${i.length}
|
|
325
|
-
</button>
|
|
326
|
-
</div>`:d.nothing}
|
|
348
|
+
${this.icon?d.html`<span class=${$.classMap(a)} data-icon=${this.icon}></span>`:d.nothing}
|
|
349
|
+
|
|
350
|
+
<gui-pills
|
|
351
|
+
class="gui-range-date-input__pills"
|
|
352
|
+
style=${et.styleMap(n.length?{}:{"min-width":0})}
|
|
353
|
+
.items=${n}
|
|
354
|
+
.removable=${!0}
|
|
355
|
+
.clickable=${!0}
|
|
356
|
+
.bubble=${!0}
|
|
357
|
+
?disabled=${this.disabled}
|
|
358
|
+
?readonly=${this.readOnly}
|
|
359
|
+
.removeAriaLabel=${this.removePillAriaLabel??"Remove date"}
|
|
360
|
+
.compactAriaLabel=${`${n.length} date ranges`}
|
|
361
|
+
@pillremove=${this.onPillRemoveEvent}
|
|
362
|
+
@pillclick=${this.onPillClickEvent}
|
|
363
|
+
></gui-pills>
|
|
327
364
|
|
|
328
365
|
<div class="gui-range-date-input__inputs">
|
|
329
366
|
<div
|
|
@@ -345,45 +382,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
345
382
|
</div>
|
|
346
383
|
</div>
|
|
347
384
|
</div>
|
|
348
|
-
${this._showPillsList&&i.length>0?d.html`<div class="gui-range-date-input__pills-dropdown" role="list">
|
|
349
|
-
${Q.repeat(i,a=>`${a.start}-${a.end??a.start}`,(a,s)=>this.renderPill(a,s))}
|
|
350
|
-
</div>`:d.nothing}
|
|
351
|
-
</div>
|
|
352
385
|
|
|
353
|
-
|
|
354
|
-
`}renderPill(e,t){const i=this.formatDateForDisplay(e.start),n=e.end?this.formatDateForDisplay(e.end):i,a=`${i} - ${n}`;return d.html`
|
|
355
|
-
<div
|
|
356
|
-
class="gui-range-date-input__pill"
|
|
357
|
-
role="listitem"
|
|
358
|
-
tabindex="0"
|
|
359
|
-
aria-label="${this.removePillAriaLabel??"Remove date"} ${a}"
|
|
360
|
-
@click=${()=>this.onPillClick(e)}
|
|
361
|
-
@focus=${this.handlePillFocus}
|
|
362
|
-
@keydown=${s=>this.handlePillKeydown(s,t)}
|
|
363
|
-
>
|
|
364
|
-
<span class="gui-range-date-input__pill-text">${a}</span>
|
|
365
|
-
<button
|
|
366
|
-
type="button"
|
|
367
|
-
class="gui-range-date-input__pill-remove"
|
|
368
|
-
tabindex="-1"
|
|
369
|
-
?disabled=${this.disabled||this.readOnly}
|
|
370
|
-
@click=${()=>this.removePill(t)}
|
|
371
|
-
>
|
|
372
|
-
<svg
|
|
373
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
374
|
-
width="16"
|
|
375
|
-
height="16"
|
|
376
|
-
viewBox="0 0 256 256"
|
|
377
|
-
fill="currentColor"
|
|
378
|
-
aria-hidden="true"
|
|
379
|
-
>
|
|
380
|
-
<path
|
|
381
|
-
d="M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"
|
|
382
|
-
></path>
|
|
383
|
-
</svg>
|
|
384
|
-
</button>
|
|
386
|
+
${this.showErrors&&this.errors?.length?F(this.uid,e):d.nothing}
|
|
385
387
|
</div>
|
|
386
|
-
`}renderDateInputs(e,t){const i=e==="start"?this._startDate:this._endDate;return
|
|
388
|
+
`}renderDateInputs(e,t){const i=e==="start"?this._startDate:this._endDate;return fe.repeat(t,n=>`${e}-${n.type}`,(n,a)=>{const s=e==="start"&&a===0?0:-1;switch(n.type){case"day":return this.renderInput(e,"day","dd",2,s,i.day);case"month":return this.renderInput(e,"month","mm",2,s,i.month);case"year":return this.renderInput(e,"year","yyyy",4,s,i.year);case"literal":return d.html`<span class="gui-range-date-input__separator">${n.value}</span>`;default:return""}})}renderInput(e,t,i,n,a,s){return d.html`
|
|
387
389
|
<div class="gui-range-date-input__touch-target">
|
|
388
390
|
<input
|
|
389
391
|
type="text"
|
|
@@ -398,7 +400,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
398
400
|
?disabled=${this.disabled}
|
|
399
401
|
?readonly=${this.readOnly}
|
|
400
402
|
autocomplete="off"
|
|
401
|
-
.value=${
|
|
403
|
+
.value=${Ti.live(s)}
|
|
402
404
|
@keydown=${this.handleKeyDown}
|
|
403
405
|
@keyup=${r=>this.handleKeyUp(r,e,t)}
|
|
404
406
|
@focus=${this.handleFocus}
|
|
@@ -407,7 +409,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
407
409
|
/>
|
|
408
410
|
<div class="gui-range-date-input__visual-underline"></div>
|
|
409
411
|
</div>
|
|
410
|
-
`}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())}
|
|
412
|
+
`}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 n=window.getComputedStyle(this).direction==="rtl",a=e.target,s=this.getGroupInputs(t),r=s.indexOf(a);if(a.value.length===a.maxLength&&/^[0-9]$/.test(e.key))if(r===s.length-1){if(t==="start"){const l=this.getGroupInputs("end");l.length>0&&l[0].focus()}}else s[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=n?r+1:r-1;if(l>=0&&l<s.length)s[l].focus(),s[l].select();else{const u=n?"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=n?r-1:r+1;if(l>=0&&l<s.length)s[l].focus(),s[l].select();else{const u=n?"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 n=e.target,a=parseInt(n.value,10);if(!isNaN(a)&&a>0){const s=i==="year"?4:2;n.value=a.toString().padStart(s,"0")}this.dispatchEvent(new CustomEvent("blur"))}getGroupInputs(e){return Array.from(this.querySelectorAll(`input[data-group="${e}"]`))}setDatePartValue(e,t,i){const n=e==="start"?this._startDate:this._endDate,a=t==="year"?4:2;t==="day"&&(n.day=i.toString().padStart(a,"0")),t==="month"&&(n.month=i.toString().padStart(a,"0")),t==="year"&&(n.year=i.toString().padStart(a,"0")),e==="start"?this._startDate={...n}:this._endDate={...n}}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),n=parseInt(e.day,10);if(isNaN(t)||isNaN(i)||isNaN(n)||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)),n=Math.max(this.MIN_DAY,Math.min(this.MAX_DAY,n));const a=this.MAX_VALID_DAY(i,t);return n>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,n)}tryCreatePill(){const e=this.validateDateParts(this._startDate),t=this.validateDateParts(this._endDate);if(!e||!t)return;let i=e,n=t;t.getTime()<e.getTime()&&(i=t,n=e);const a=Ie(i),s=Ie(n),r=a===s?{start:a}:{start:a,end:s},l=this.value?[...this.value]:[];l.push(r),this.value=Fa(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})],A.prototype,"uid",2),N([o.property({type:String})],A.prototype,"label",2),N([o.property({type:String,attribute:"locale-id"})],A.prototype,"localeId",2),N([o.property({type:Array})],A.prototype,"errors",2),N([o.property({type:Boolean})],A.prototype,"showErrors",2),N([o.property({type:Boolean})],A.prototype,"touched",2),N([o.property({type:Boolean})],A.prototype,"required",2),N([o.property({type:Boolean})],A.prototype,"disabled",2),N([o.property({type:Boolean,attribute:"readonly"})],A.prototype,"readOnly",2),N([o.property({type:Array})],A.prototype,"value",2),N([o.property({type:String})],A.prototype,"hint",2),N([o.property({type:String})],A.prototype,"icon",2),N([o.property({type:String})],A.prototype,"removePillAriaLabel",2),N([o.property({type:String})],A.prototype,"startDateAriaLabel",2),N([o.property({type:String})],A.prototype,"endDateAriaLabel",2),N([o.property({type:String})],A.prototype,"separator",2),N([o.state()],A.prototype,"_startDate",2),N([o.state()],A.prototype,"_endDate",2),A=N([o.customElement("gui-range-date")],A),typeof customElements<"u"&&!customElements.get("gui-range-date")&&customElements.define("gui-range-date",A);var Kl=Object.defineProperty,Jl=Object.getOwnPropertyDescriptor,pi=(e,t,i,n)=>{for(var a=n>1?void 0:n?Jl(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Kl(t,i,a),a};let lt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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`
|
|
411
413
|
<gui-range-date
|
|
412
414
|
.uid=${this.widget.uid}
|
|
413
415
|
.label=${this.adapter.templateData.label}
|
|
@@ -427,7 +429,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
427
429
|
@change=${this.valueChanged}
|
|
428
430
|
@inputError=${this.onInputError}
|
|
429
431
|
></gui-range-date>
|
|
430
|
-
`}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())}};
|
|
432
|
+
`}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())}};pi([b.consume({context:y.formContext}),o.property({attribute:!1})],lt.prototype,"formContext",2),pi([b.provide({context:y.inputContext})],lt.prototype,"adapter",2),lt=pi([o.customElement("gui-range-date-input")],lt);const Xl=Object.freeze(Object.defineProperty({__proto__:null,get RangeDateInputElement(){return lt}},Symbol.toStringTag,{value:"Module"}));var Ql=Object.defineProperty,jl=Object.getOwnPropertyDescriptor,Ve=(e,t,i,n)=>{for(var a=n>1?void 0:n?jl(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Ql(t,i,a),a};let Ae=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.isCalendarOpen=!1,this.focusDate=void 0,this.subscriptions=[],this._ignoreNextFocusOut=!1,this.onFocusOut=e=>{if(this._ignoreNextFocusOut){this._ignoreNextFocusOut=!1;return}if(!this.isCalendarOpen)return;const t=e.relatedTarget;t&&this.contains(t)||this.closeCalendar()},this.onDocumentClick=e=>{if(!this.isCalendarOpen)return;const t=e.composedPath(),i=this.dateInput&&t.includes(this.dateInput),n=this.calendarInput&&t.includes(this.calendarInput);!i&&!n&&this.closeCalendar()},this.onDropdownToggle=e=>{e.detail?.open&&this.isCalendarOpen&&this.closeCalendar()}}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.addEventListener("focusout",this.onFocusOut),this.addEventListener("dropdowntoggle",this.onDropdownToggle),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=Ze("datePicker",this.adapter.templateData),t=this.isCalendarOpen?d.html`<gui-range-calendar
|
|
431
433
|
id="calendar-input"
|
|
432
434
|
.uid=${this.widget.uid}
|
|
433
435
|
.hint=${this.adapter.templateData.hint}
|
|
@@ -497,8 +499,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
497
499
|
${t}
|
|
498
500
|
</div>
|
|
499
501
|
|
|
500
|
-
${
|
|
501
|
-
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onBlurCalendar(){this.adapter.onBlur(),this.closeCalendar()}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}onPillClick(e){this.focusDate=e.detail.range.start,this.openCalendar()}onKeyUp(e){const t=e;t.target===t.currentTarget&&(t?.key==="Enter"||t?.key===" ")&&(this.isCalendarOpen
|
|
502
|
+
${F(this.widget.uid,this.adapter.templateData)}
|
|
503
|
+
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onBlurCalendar(){this.adapter.onBlur(),this.closeCalendar()}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}onPillClick(e){this.focusDate=e.detail.range.start,this.openCalendar()}onKeyUp(e){const t=e;t.target===t.currentTarget&&(t?.key==="Enter"||t?.key===" ")&&(this.isCalendarOpen?this.closeCalendar():this.openCalendar())}toggleCalendar(e){const t=e.target,i=t.closest(".gui-range-date-input__part"),n=t.closest("gui-range-calendar");i||n?this.openCalendar():this.isCalendarOpen?this.closeCalendar():this.openCalendar()}openCalendar(){!!this.querySelector(".gui-pills__dropdown")&&(this._ignoreNextFocusOut=!0),this.closePillsDropdown(),this.isCalendarOpen||(this.isCalendarOpen=!0,this.requestUpdate())}closeCalendar(){this.isCalendarOpen=!1,this.requestUpdate()}closePillsDropdown(){this.querySelector("gui-pills")?.closeDropdown?.()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.onDocumentClick),this.removeEventListener("focusout",this.onFocusOut),this.removeEventListener("dropdowntoggle",this.onDropdownToggle),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Ve([b.consume({context:y.formContext}),o.property({attribute:!1})],Ae.prototype,"formContext",2),Ve([b.provide({context:y.inputContext})],Ae.prototype,"adapter",2),Ve([o.query("#date-input")],Ae.prototype,"dateInput",2),Ve([o.query("#calendar-input")],Ae.prototype,"calendarInput",2),Ve([o.state()],Ae.prototype,"isCalendarOpen",2),Ve([o.state()],Ae.prototype,"focusDate",2),Ae=Ve([o.customElement("gui-range-date-picker-input")],Ae);const ed=Object.freeze(Object.defineProperty({__proto__:null,get RangeDatePickerElement(){return Ae}},Symbol.toStringTag,{value:"Module"}));var td=Object.defineProperty,id=Object.getOwnPropertyDescriptor,M=(e,t,i,n)=>{for(var a=n>1?void 0:n?id(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&td(t,i,a),a};let P=class extends d.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=Ze("currency",e),i={"gui-widget-input":!0,"gui-currency--icon":!!this.icon};return d.html`
|
|
502
504
|
${le(this.uid,e)}
|
|
503
505
|
|
|
504
506
|
<div class="gui-widget">
|
|
@@ -527,8 +529,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
527
529
|
${t.html}
|
|
528
530
|
</div>
|
|
529
531
|
|
|
530
|
-
${
|
|
531
|
-
`}handleInput(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.displayValue=this.formatCurrency(t.valueAsNumber),this.dispatchEvent(new CustomEvent("input",{detail:{value:t.valueAsNumber},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{return new Intl.NumberFormat(this.localeId??"en",{style:"currency",currency:this.currency??"USD",maximumFractionDigits:this.maximumFractionDigits??Math.max(this.minimumFractionDigits??2,2),minimumFractionDigits:this.minimumFractionDigits??2}).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)||"."}}};M([o.property({type:String})],
|
|
532
|
+
${F(this.uid,e)}
|
|
533
|
+
`}handleInput(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.displayValue=this.formatCurrency(t.valueAsNumber),this.dispatchEvent(new CustomEvent("input",{detail:{value:t.valueAsNumber},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{return new Intl.NumberFormat(this.localeId??"en",{style:"currency",currency:this.currency??"USD",maximumFractionDigits:this.maximumFractionDigits??Math.max(this.minimumFractionDigits??2,2),minimumFractionDigits:this.minimumFractionDigits??2}).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)||"."}}};M([o.property({type:String})],P.prototype,"uid",2),M([o.property({type:String})],P.prototype,"label",2),M([o.property({type:String,attribute:"locale-id"})],P.prototype,"localeId",2),M([o.property({type:Array})],P.prototype,"errors",2),M([o.property({type:Boolean})],P.prototype,"touched",2),M([o.property({type:Boolean})],P.prototype,"required",2),M([o.property({type:Boolean})],P.prototype,"disabled",2),M([o.property({type:Boolean,attribute:"readonly"})],P.prototype,"readOnly",2),M([o.property({type:String})],P.prototype,"value",2),M([o.property({type:String})],P.prototype,"currency",2),M([o.property({type:String})],P.prototype,"step",2),M([o.property({type:String})],P.prototype,"maximumFractionDigits",2),M([o.property({type:String})],P.prototype,"minimumFractionDigits",2),M([o.property({type:String})],P.prototype,"hint",2),M([o.property({type:String})],P.prototype,"icon",2),M([o.property({type:String})],P.prototype,"placeholder",2),M([o.property({type:String})],P.prototype,"autocomplete",2),M([o.state()],P.prototype,"displayValue",2),M([o.query("input")],P.prototype,"inputElement",2),P=M([o.customElement("gui-currency")],P),typeof customElements<"u"&&!customElements.get("gui-currency")&&customElements.define("gui-currency",P);var ad=Object.defineProperty,nd=Object.getOwnPropertyDescriptor,ci=(e,t,i,n)=>{for(var a=n>1?void 0:n?nd(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&ad(t,i,a),a};let dt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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(),d.html`
|
|
532
534
|
<gui-currency
|
|
533
535
|
.uid=${this.widget.uid}
|
|
534
536
|
.label=${this.adapter.templateData.label}
|
|
@@ -550,17 +552,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
550
552
|
@input=${this.valueChanged}
|
|
551
553
|
@blur=${()=>this.adapter.onBlur()}
|
|
552
554
|
></gui-currency>
|
|
553
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
555
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};ci([b.consume({context:y.formContext}),o.property({attribute:!1})],dt.prototype,"formContext",2),ci([b.provide({context:y.inputContext})],dt.prototype,"adapter",2),dt=ci([o.customElement("gui-currency-input")],dt);const sd=Object.freeze(Object.defineProperty({__proto__:null,get CurrencyElement(){return dt}},Symbol.toStringTag,{value:"Module"}));var rd=Object.defineProperty,od=Object.getOwnPropertyDescriptor,te=(e,t,i,n)=>{for(var a=n>1?void 0:n?od(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&rd(t,i,a),a};let G=class extends d.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.value=void 0,this.icon="",this.hint=void 0,this._day="",this._month="",this._year="",this.MIN_DAY=1,this.MAX_DAY=31,this.MAX_VALID_DAY=(e,t)=>e===2?new Date(t,1,29).getDate()===29||!t?29:28:e===4||e===6||e===9||e===11?30:31,this.MIN_MONTH=1,this.MAX_MONTH=12,this.MIN_YEAR=1e3,this.MAX_YEAR=9999,this.ariaController=new oe(this,{getTargets:()=>this.querySelectorAll(".gui-date-input"),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")&&this.parseValue(this.value??"")}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=new Intl.DateTimeFormat(this.localeId??"en",{year:"numeric",month:"numeric",day:"numeric"}).formatToParts(new Date),i={"gui-widget-icon":!0,[this.icon]:!0};return d.html`
|
|
554
556
|
${this.label?le(this.uid,e):d.nothing}
|
|
555
557
|
|
|
556
558
|
<div class="gui-widget">
|
|
557
|
-
<div class="gui-date-input ${this.icon?"gui-calendar--icon":""}" role="group">
|
|
558
|
-
${
|
|
559
|
+
<div class="gui-widget-input gui-date-input ${this.icon?"gui-calendar--icon":""}" role="group">
|
|
560
|
+
${fe.repeat(t,n=>n.type,(n,a)=>{const s=a===0?0:-1;switch(n.type){case"day":return this.renderInput("day","dd",2,s,this._day);case"month":return this.renderInput("month","mm",2,s,this._month);case"year":return this.renderInput("year","yyyy",4,s,this._year);case"literal":return d.html`<span class="gui-date-input__separator">${n.value}</span>`;default:return""}})}
|
|
559
561
|
</div>
|
|
560
562
|
${this.icon?d.html`<span class=${$.classMap(i)} data-icon=${this.icon}></span>`:d.nothing}
|
|
561
563
|
</div>
|
|
562
564
|
|
|
563
|
-
${this.showErrors&&this.errors?.length?
|
|
565
|
+
${this.showErrors&&this.errors?.length?F(this.uid,e):d.nothing}
|
|
564
566
|
`}renderInput(e,t,i,n,a){return d.html`
|
|
565
567
|
<div class="gui-date-input__touch-target">
|
|
566
568
|
<input
|
|
@@ -575,7 +577,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
575
577
|
?disabled=${this.disabled}
|
|
576
578
|
?readonly=${this.readOnly}
|
|
577
579
|
autocomplete="off"
|
|
578
|
-
.value=${
|
|
580
|
+
.value=${Ti.live(a)}
|
|
579
581
|
@keydown=${this.handleKeyDown}
|
|
580
582
|
@keyup=${s=>this.handleKeyUp(s,e)}
|
|
581
583
|
@focus=${this.handleFocus}
|
|
@@ -584,7 +586,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
584
586
|
/>
|
|
585
587
|
<div class="gui-date-input__visual-underline"></div>
|
|
586
588
|
</div>
|
|
587
|
-
`}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",n=e.target,a=Array.from(this.querySelectorAll("input")),s=a.indexOf(n);switch(n.value.length===n.maxLength&&/^[0-9]$/.test(e.key)&&(s===a.length-1?a[0].focus():a[s+1].focus()),e.key){case"ArrowUp":{const r=isNaN(parseInt(n.value,10)+1)?1:parseInt(n.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")),n.select(),this.validateAndEmit();break}case"ArrowDown":{const r=isNaN(parseInt(n.value,10)-1)?1:parseInt(n.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")),n.select(),this.validateAndEmit();break}case"ArrowLeft":{const r=i?s+1:s-1;r>=0&&r<a.length&&(a[r].focus(),a[r].select());break}case"ArrowRight":{const r=i?s-1:s+1;r>=0&&r<a.length&&(a[r].focus(),a[r].select());break}}}handleChange(e,t){if(e.stopImmediatePropagation(),this.readOnly)return;const n=e.target.value.replace(/[^0-9]/g,"");switch(t){case"day":this._day=n;break;case"month":this._month=n;break;case"year":this._year=n;break}this.validateAndEmit()}handleBlur(e,t){const i=e.target,n=parseInt(i.value,10);if(!isNaN(n)&&n>0){const a=t==="year"?4:2;i.value=n.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 n=!isNaN(e)&&String(e).length===4,a=!isNaN(t)&&t>0;if(!isNaN(i)&&i>0&&a&&n){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=
|
|
589
|
+
`}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",n=e.target,a=Array.from(this.querySelectorAll("input")),s=a.indexOf(n);switch(n.value.length===n.maxLength&&/^[0-9]$/.test(e.key)&&(s===a.length-1?a[0].focus():a[s+1].focus()),e.key){case"ArrowUp":{const r=isNaN(parseInt(n.value,10)+1)?1:parseInt(n.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")),n.select(),this.validateAndEmit();break}case"ArrowDown":{const r=isNaN(parseInt(n.value,10)-1)?1:parseInt(n.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")),n.select(),this.validateAndEmit();break}case"ArrowLeft":{const r=i?s+1:s-1;r>=0&&r<a.length&&(a[r].focus(),a[r].select());break}case"ArrowRight":{const r=i?s-1:s+1;r>=0&&r<a.length&&(a[r].focus(),a[r].select());break}}}handleChange(e,t){if(e.stopImmediatePropagation(),this.readOnly)return;const n=e.target.value.replace(/[^0-9]/g,"");switch(t){case"day":this._day=n;break;case"month":this._month=n;break;case"year":this._year=n;break}this.validateAndEmit()}handleBlur(e,t){const i=e.target,n=parseInt(i.value,10);if(!isNaN(n)&&n>0){const a=t==="year"?4:2;i.value=n.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 n=!isNaN(e)&&String(e).length===4,a=!isNaN(t)&&t>0;if(!isNaN(i)&&i>0&&a&&n){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=Ie(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 ld=Object.defineProperty,dd=Object.getOwnPropertyDescriptor,hi=(e,t,i,n)=>{for(var a=n>1?void 0:n?dd(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&ld(t,i,a),a};let ut=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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=Ze("date",this.adapter.templateData);return d.html`
|
|
588
590
|
<gui-date
|
|
589
591
|
class=${$.classMap(e.widgetClasses)}
|
|
590
592
|
.uid=${this.widget.uid}
|
|
@@ -602,7 +604,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
602
604
|
@blur=${()=>this.adapter.onBlur()}
|
|
603
605
|
@change=${this.valueChanged}
|
|
604
606
|
></gui-date>
|
|
605
|
-
`}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())}};
|
|
607
|
+
`}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())}};hi([b.consume({context:y.formContext}),o.property({attribute:!1})],ut.prototype,"formContext",2),hi([b.provide({context:y.inputContext})],ut.prototype,"adapter",2),ut=hi([o.customElement("gui-date-input")],ut);const ud=Object.freeze(Object.defineProperty({__proto__:null,get DateElement(){return ut}},Symbol.toStringTag,{value:"Module"}));var pd=Object.defineProperty,cd=Object.getOwnPropertyDescriptor,Qe=(e,t,i,n)=>{for(var a=n>1?void 0:n?cd(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&pd(t,i,a),a};let ze=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.isCalendarOpen=!1,this.subscriptions=[],this.onFocusOut=e=>{if(!this.isCalendarOpen)return;const t=e.relatedTarget;t&&this.contains(t)||this.closeCalendar()},this.onDocumentClick=e=>{if(!this.isCalendarOpen)return;const t=e.composedPath(),i=this.dateInput&&t.includes(this.dateInput),n=this.calendarInput&&t.includes(this.calendarInput);!i&&!n&&this.closeCalendar()}}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.addEventListener("focusout",this.onFocusOut),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=Ze("datePicker",this.adapter.templateData),t=this.isCalendarOpen?d.html`<gui-calendar
|
|
606
608
|
id="calendar-input"
|
|
607
609
|
.uid=${this.widget.uid}
|
|
608
610
|
.hint=${this.adapter.templateData.hint}
|
|
@@ -665,8 +667,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
665
667
|
${t}
|
|
666
668
|
</div>
|
|
667
669
|
|
|
668
|
-
${
|
|
669
|
-
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onBlurCalendar(){this.adapter.onBlur(),this.closeCalendar()}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}onKeyUp(e){const t=e;t.target===t.currentTarget&&(t?.key==="Enter"||t?.key===" ")&&(this.isCalendarOpen=!this.isCalendarOpen,this.requestUpdate())}toggleCalendar(e){const t=e.target,i=t.closest(".gui-date-input__part"),n=t.closest("gui-calendar");i||n?this.openCalendar():(this.isCalendarOpen=!this.isCalendarOpen,this.requestUpdate())}openCalendar(){this.isCalendarOpen||(this.isCalendarOpen=!0,this.requestUpdate())}closeCalendar(){this.isCalendarOpen=!1,this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.onDocumentClick),this.removeEventListener("focusout",this.onFocusOut),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
670
|
+
${F(this.widget.uid,this.adapter.templateData)}
|
|
671
|
+
`}valueChanged(e){this.adapter.injectValidationIssues(null),this.adapter.valueChanged(e.detail.value)}onBlurCalendar(){this.adapter.onBlur(),this.closeCalendar()}onInputError(e){this.adapter.injectValidationIssues([e.detail.message])}onKeyUp(e){const t=e;t.target===t.currentTarget&&(t?.key==="Enter"||t?.key===" ")&&(this.isCalendarOpen=!this.isCalendarOpen,this.requestUpdate())}toggleCalendar(e){const t=e.target,i=t.closest(".gui-date-input__part"),n=t.closest("gui-calendar");i||n?this.openCalendar():(this.isCalendarOpen=!this.isCalendarOpen,this.requestUpdate())}openCalendar(){this.isCalendarOpen||(this.isCalendarOpen=!0,this.requestUpdate())}closeCalendar(){this.isCalendarOpen=!1,this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.onDocumentClick),this.removeEventListener("focusout",this.onFocusOut),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Qe([b.consume({context:y.formContext}),o.property({attribute:!1})],ze.prototype,"formContext",2),Qe([b.provide({context:y.inputContext})],ze.prototype,"adapter",2),Qe([o.query("#date-input")],ze.prototype,"dateInput",2),Qe([o.query("#calendar-input")],ze.prototype,"calendarInput",2),Qe([o.state()],ze.prototype,"isCalendarOpen",2),ze=Qe([o.customElement("gui-date-picker-input")],ze);const hd=Object.freeze(Object.defineProperty({__proto__:null,get DatePickerElement(){return ze}},Symbol.toStringTag,{value:"Module"})),Ba=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 d.html`
|
|
670
672
|
<div
|
|
671
673
|
role="option"
|
|
672
674
|
class=${$.classMap(t)}
|
|
@@ -675,7 +677,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
675
677
|
>
|
|
676
678
|
${e.template}
|
|
677
679
|
</div>
|
|
678
|
-
`};var
|
|
680
|
+
`};var md=Object.defineProperty,yd=Object.getOwnPropertyDescriptor,_e=(e,t,i,n)=>{for(var a=n>1?void 0:n?yd(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&md(t,i,a),a};let be=class extends d.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(),d.html`${le(this.uid,{label:this.label,hint:this.hint,required:this.required,errors:this.errors,touched:this.touched},!1,void 0,this.native)}`}};_e([o.property({type:Object})],be.prototype,"targetElement",2),_e([o.property({type:String})],be.prototype,"uid",2),_e([o.property({type:String})],be.prototype,"label",2),_e([o.property({type:String})],be.prototype,"hint",2),_e([o.property({type:Boolean})],be.prototype,"required",2),_e([o.property({type:Array})],be.prototype,"errors",2),_e([o.property({type:Boolean})],be.prototype,"disabled",2),_e([o.property({type:Boolean,attribute:"readonly"})],be.prototype,"readOnly",2),_e([o.property({type:Boolean})],be.prototype,"touched",2),_e([o.property({type:Boolean})],be.prototype,"native",2),be=_e([o.customElement("gui-label")],be),typeof customElements<"u"&&!customElements.get("gui-label")&&customElements.define("gui-label",be);const fd=e=>e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"template")&&Object.prototype.hasOwnProperty.call(e,"value");function gd(e){const t=typeof e;return t==="string"||t==="number"}const bd=(e,{valueField:t})=>{if(e===null||typeof e!="object")return!1;const i=e,n=t??"value";return!!Object.prototype.hasOwnProperty.call(i,n)};function Dd(e,{valueField:t}){if(e===null||typeof e!="object")throw new Error("Provided value is not an object");const i=e,n=t??"value",a=Object.prototype.hasOwnProperty.call(i,n)?n:void 0;if(!a)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");return{template:s,value:a?s[a]:""}}}const vd=(e,t)=>{if(Array.isArray(e)&&e.length>0&&!fd(e[0])){if(gd(e[0]))return e.map(i=>({template:i,value:i}));if(bd(e[0],t)){const i=Dd(e[0],t);return e.map(i)}else throw new Error("Invalid list item shape")}return e};var wd=Object.defineProperty,$d=Object.getOwnPropertyDescriptor,H=(e,t,i,n)=>{for(var a=n>1?void 0:n?$d(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&wd(t,i,a),a};let R=class extends d.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:n}=this.calculateRange(),a=this._focusedIndex>=0?`${this.uid}-item-${this._focusedIndex}`:void 0;return d.html`
|
|
679
681
|
<div
|
|
680
682
|
role="listbox"
|
|
681
683
|
id=${this.uid}
|
|
@@ -704,7 +706,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
704
706
|
<slot></slot>
|
|
705
707
|
</div>
|
|
706
708
|
</div>
|
|
707
|
-
`}focus(e){this.viewportElement?this.viewportElement.focus(e):super.focus(e)}focusItemAtIndex(e){this._focusedIndex=e}scrollToSelectedIndex(){const e=this.items.findIndex(t=>(this.valueField?t[this.valueField]:t)===this.value);this.scrollToIndex(e)}onKeyDown(e){if(this.disabled||this.readOnly)return;const t=this.itemHeight??40,i=Math.ceil(this._viewportHeight/t),n=this.items.length-1;let a=!1;switch(e.key){case"ArrowDown":this.setFocusedIndex(Math.min(this._focusedIndex+1,n)),a=!0;break;case"ArrowUp":this.setFocusedIndex(Math.max(this._focusedIndex-1,0)),a=!0;break;case"PageDown":this.setFocusedIndex(Math.min(this._focusedIndex+i,n)),a=!0;break;case"PageUp":this.setFocusedIndex(Math.max(this._focusedIndex-i,0)),a=!0;break;case"Home":this.setFocusedIndex(0),a=!0;break;case"End":this.setFocusedIndex(n),a=!0;break;case"Enter":case" ":{const s=this.items[this._focusedIndex],r=s!=null;this._focusedIndex>=0&&r&&this.selectItem(this.items[this._focusedIndex]),a=!0;break}}a&&e.preventDefault()}onFocus(){if(!this.value||!this.items.length)return;const e=this.items.findIndex(t=>(this.valueField?t[this.valueField]:t)===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,n=e*t,a=n+t,s=this.viewportElement.scrollTop,r=s+i;n<s?this.viewportElement.scrollTop=n:a>r&&(this.viewportElement.scrollTop=a-i)}selectItem(e){this.dispatchEvent(new CustomEvent("change",{detail:{value:this.valueField?e[this.valueField]:e},bubbles:!0,composed:!0}))}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=
|
|
709
|
+
`}focus(e){this.viewportElement?this.viewportElement.focus(e):super.focus(e)}focusItemAtIndex(e){this._focusedIndex=e}scrollToSelectedIndex(){const e=this.items.findIndex(t=>(this.valueField?t[this.valueField]:t)===this.value);this.scrollToIndex(e)}onKeyDown(e){if(this.disabled||this.readOnly)return;const t=this.itemHeight??40,i=Math.ceil(this._viewportHeight/t),n=this.items.length-1;let a=!1;switch(e.key){case"ArrowDown":this.setFocusedIndex(Math.min(this._focusedIndex+1,n)),a=!0;break;case"ArrowUp":this.setFocusedIndex(Math.max(this._focusedIndex-1,0)),a=!0;break;case"PageDown":this.setFocusedIndex(Math.min(this._focusedIndex+i,n)),a=!0;break;case"PageUp":this.setFocusedIndex(Math.max(this._focusedIndex-i,0)),a=!0;break;case"Home":this.setFocusedIndex(0),a=!0;break;case"End":this.setFocusedIndex(n),a=!0;break;case"Enter":case" ":{const s=this.items[this._focusedIndex],r=s!=null;this._focusedIndex>=0&&r&&this.selectItem(this.items[this._focusedIndex]),a=!0;break}}a&&e.preventDefault()}onFocus(){if(!this.value||!this.items.length)return;const e=this.items.findIndex(t=>(this.valueField?t[this.valueField]:t)===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,n=e*t,a=n+t,s=this.viewportElement.scrollTop,r=s+i;n<s?this.viewportElement.scrollTop=n:a>r&&(this.viewportElement.scrollTop=a-i)}selectItem(e){this.dispatchEvent(new CustomEvent("change",{detail:{value:this.valueField?e[this.valueField]:e},bubbles:!0,composed:!0}))}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=vd(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),n=Math.floor(this._scrollTop/e),a=Math.max(0,n-this.buffer),s=Math.min(t,n+i+this.buffer),r=a*e;return{startIndex:a,endIndex:s,offsetY:r}}};H([o.property({type:String})],R.prototype,"uid",2),H([o.property({type:Boolean})],R.prototype,"touched",2),H([o.property({type:Boolean})],R.prototype,"required",2),H([o.property({type:Boolean})],R.prototype,"disabled",2),H([o.property({type:Boolean,attribute:"readonly"})],R.prototype,"readOnly",2),H([o.property({type:String})],R.prototype,"value",2),H([o.property({type:String})],R.prototype,"valueField",2),H([o.property({type:String})],R.prototype,"label",2),H([o.property({type:String})],R.prototype,"hint",2),H([o.property({type:Array})],R.prototype,"items",2),H([o.property({type:Number})],R.prototype,"itemHeight",2),H([o.property({type:Number})],R.prototype,"height",2),H([o.state()],R.prototype,"_items",2),H([o.state()],R.prototype,"_scrollTop",2),H([o.state()],R.prototype,"_viewportHeight",2),H([o.state()],R.prototype,"_focusedIndex",2),H([o.query(".gui-list__scroll-viewport")],R.prototype,"viewportElement",2),R=H([o.customElement("gui-list")],R),typeof customElements<"u"&&!customElements.get("gui-list")&&customElements.define("gui-list",R);var kd=Object.defineProperty,_d=Object.getOwnPropertyDescriptor,Wt=(e,t,i,n)=>{for(var a=n>1?void 0:n?_d(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&kd(t,i,a),a};let je=class extends d.LitElement{constructor(){super(...arguments),this.uid=void 0,this.errors=[],this.touched=!1}createRenderRoot(){return this}render(){return super.render(),d.html`${F(this.uid,{touched:this.touched,errors:this.errors})}`}};Wt([o.property({type:String})],je.prototype,"uid",2),Wt([o.property({type:Array})],je.prototype,"errors",2),Wt([o.property({type:Boolean})],je.prototype,"touched",2),je=Wt([o.customElement("gui-errors")],je),typeof customElements<"u"&&!customElements.get("gui-errors")&&customElements.define("gui-errors",je);var Cd=Object.defineProperty,Sd=Object.getOwnPropertyDescriptor,we=(e,t,i,n)=>{for(var a=n>1?void 0:n?Sd(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Cd(t,i,a),a};let ce=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.InputWidgetAdapter,this.debouncer=new Ai.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.onDocumentClick=e=>{if(!this._isListVisible)return;const t=e.composedPath(),i=this._inputRef&&t.includes(this._inputRef),n=this._listRef&&t.includes(this._listRef);!i&&!n&&(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(Ai.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(n=>n.value===this.adapter.templateData.value);i&&(this._selectedItem=i)}}_onFocusChange(e){this._focusedIndex=e.detail.index}_onClickItem(e,t){if(this.adapter.templateData.readonly)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 n=t.searchFields??[t.labelField,t.valueField].filter(l=>!!l),a=n.length>0,r=(t.items||[]).filter(l=>{const u=Object.keys(l);if(!u.length)return l.toString().toLowerCase().includes(e.toLowerCase());const c=(h,f)=>h||l[f].toString().toLowerCase().includes(e.toLowerCase());return a?u.filter(h=>n.includes(h)).reduce(c,!1):u.reduce(c,!1)});this._filteredItems=[...r]}else this._isFiltering=!1,this._filteredItems=[...t.items]}async _onFocus(){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),n=this.adapter.getItemRenderer(e.itemRenderer,Ba),s=this._selectedItem?.template!==null&&typeof this._selectedItem?.template=="object"?e.labelField??"label":null,r=s?this._selectedItem?.template[s]:this._selectedItem?.template,l=!!this.widget.on?.filter;return d.html`
|
|
708
710
|
<gui-label
|
|
709
711
|
.targetElement=${[this._listRef,this._inputRef]}
|
|
710
712
|
.uid=${this.widget.uid}
|
|
@@ -721,6 +723,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
721
723
|
type="text"
|
|
722
724
|
id=${this.widget.uid}
|
|
723
725
|
data-cy=${`${this.widget.uid}_textinput`}
|
|
726
|
+
class="gui-widget-input"
|
|
724
727
|
.value=${r??e.value??""}
|
|
725
728
|
?required=${e.validator?.required}
|
|
726
729
|
?disabled=${e.disabled}
|
|
@@ -761,7 +764,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
761
764
|
@blur=${this._onBlur}
|
|
762
765
|
@change=${this._onValueChange}
|
|
763
766
|
>
|
|
764
|
-
${i.map((u,p)=>{const c=this._range.start+p,h=e.value===u.value,f=this._focusedIndex===c,g=e.labelField??"label",
|
|
767
|
+
${i.map((u,p)=>{const c=this._range.start+p,h=e.value===u.value,f=this._focusedIndex===c,g=e.labelField??"label",I=u.template!==null&&typeof u.template=="object"&&g&&!e.itemRenderer?u.template[g]:u.template;return d.html`
|
|
765
768
|
<div
|
|
766
769
|
role="option"
|
|
767
770
|
tabindex="-1"
|
|
@@ -771,7 +774,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
771
774
|
aria-selected=${h?"true":"false"}
|
|
772
775
|
@click=${()=>this._onClickItem(u,c)}
|
|
773
776
|
>
|
|
774
|
-
${n({template:
|
|
777
|
+
${n({template:I,value:u.value,index:c,selected:h,disabled:!!e.disabled,focused:f})}
|
|
775
778
|
</div>
|
|
776
779
|
`})}
|
|
777
780
|
</gui-list>
|
|
@@ -782,7 +785,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
782
785
|
.errors=${e.errors}
|
|
783
786
|
.touched=${e.touched}
|
|
784
787
|
></gui-errors>`:d.nothing}
|
|
785
|
-
`}};
|
|
788
|
+
`}};we([b.consume({context:y.formContext}),o.property({attribute:!1})],ce.prototype,"formContext",2),we([b.provide({context:y.inputContext})],ce.prototype,"adapter",2),we([o.state()],ce.prototype,"_range",2),we([o.state()],ce.prototype,"_filteredItems",2),we([o.state()],ce.prototype,"_listItems",2),we([o.state()],ce.prototype,"_focusedIndex",2),we([o.state()],ce.prototype,"_isFiltering",2),we([o.state()],ce.prototype,"_isListVisible",2),we([o.state()],ce.prototype,"_selectedItem",2),we([o.query("input")],ce.prototype,"_inputRef",2),we([o.query("gui-list")],ce.prototype,"_listRef",2),ce=we([o.customElement("gui-dropdown-input")],ce);const Od=Object.freeze(Object.defineProperty({__proto__:null,get DropdownElement(){return ce}},Symbol.toStringTag,{value:"Module"}));var xd=Object.defineProperty,Ed=Object.getOwnPropertyDescriptor,Ue=(e,t,i,n)=>{for(var a=n>1?void 0:n?Ed(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&xd(t,i,a),a};let Te=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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),n=this.adapter.getItemRenderer(e.itemRenderer,Ba);return d.html`
|
|
786
789
|
<gui-label
|
|
787
790
|
.targetElement=${this._guiListRef}
|
|
788
791
|
.uid=${this.widget.uid}
|
|
@@ -836,7 +839,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
836
839
|
.errors=${e.errors}
|
|
837
840
|
.touched=${e.touched}
|
|
838
841
|
></gui-errors>`:d.nothing}
|
|
839
|
-
`}_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)}};
|
|
842
|
+
`}_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)}};Ue([b.consume({context:y.formContext}),o.property({attribute:!1})],Te.prototype,"formContext",2),Ue([b.provide({context:y.inputContext})],Te.prototype,"adapter",2),Ue([o.state()],Te.prototype,"_range",2),Ue([o.state()],Te.prototype,"_listItems",2),Ue([o.state()],Te.prototype,"_focusedIndex",2),Ue([o.query("gui-list")],Te.prototype,"_guiListRef",2),Te=Ue([o.customElement("gui-list-input")],Te);const Pd=Object.freeze(Object.defineProperty({__proto__:null,get ListElement(){return Te}},Symbol.toStringTag,{value:"Module"}));var Id=Object.defineProperty,Ad=Object.getOwnPropertyDescriptor,mi=(e,t,i,n)=>{for(var a=n>1?void 0:n?Ad(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Id(t,i,a),a};let pt=class extends d.LitElement{constructor(){super(...arguments),this.md=void 0,this.dependencies=void 0}createRenderRoot(){return this}render(){return d.html`${Ya.unsafeHTML(this.dependencies?.markdown?.parse(this.md??""))}`}};mi([o.property({type:String})],pt.prototype,"md",2),mi([o.property({type:Object})],pt.prototype,"dependencies",2),pt=mi([o.customElement("gui-markdown-text")],pt),typeof customElements<"u"&&!customElements.get("gui-markdown-text")&&customElements.define("gui-markdown-text",pt);var Td=Object.defineProperty,Ld=Object.getOwnPropertyDescriptor,w=(e,t,i,n)=>{for(var a=n>1?void 0:n?Ld(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Td(t,i,a),a};let D=class extends d.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=d.html``;if(e.counterMode&&e.maxLength){const a={"gui-markdown--counter":!0,"gui-markdown--counter__error":(e.value?.length??0)>e.maxLength},s=e.counterMode==="current"?d.html`<span>${e.value?.length??0}</span>`:d.html`<span>${e.maxLength-(e.value?.length??0)}</span>`;i=d.html`<div class=${$.classMap(a)}>
|
|
840
843
|
${s}
|
|
841
844
|
<span> / ${e.maxLength}</span>
|
|
842
845
|
</div>`}const n={"min-height":`${e.minimumHeight}px`};return d.html`
|
|
@@ -871,13 +874,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
871
874
|
</ul>
|
|
872
875
|
</nav>
|
|
873
876
|
<textarea
|
|
874
|
-
id=${
|
|
877
|
+
id=${Gt.ifDefined(this.uid)}
|
|
875
878
|
class=${$.classMap(t)}
|
|
876
|
-
style=${
|
|
879
|
+
style=${et.styleMap(n)}
|
|
877
880
|
?required=${e.required}
|
|
878
881
|
?disabled=${e.disabled}
|
|
879
882
|
?readonly=${e.readonly}
|
|
880
|
-
placeholder=${
|
|
883
|
+
placeholder=${Gt.ifDefined(e.placeholder)}
|
|
881
884
|
autocomplete=${this.autocomplete||d.nothing}
|
|
882
885
|
.value=${this.value||""}
|
|
883
886
|
@input=${this.valueChanged}
|
|
@@ -888,7 +891,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
888
891
|
|
|
889
892
|
${this.splitViewActive?d.html`
|
|
890
893
|
<section
|
|
891
|
-
data-cy=${
|
|
894
|
+
data-cy=${Gt.ifDefined(this.uid?`${this.uid}_markdown`:d.nothing)}
|
|
892
895
|
class="gui-markdown__preview"
|
|
893
896
|
>
|
|
894
897
|
<gui-markdown-text
|
|
@@ -900,7 +903,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
900
903
|
</div>
|
|
901
904
|
|
|
902
905
|
<div class="gui-markdown--validation">
|
|
903
|
-
<div>${
|
|
906
|
+
<div>${F(this.uid,e)}</div>
|
|
904
907
|
${i}
|
|
905
908
|
</div>
|
|
906
909
|
`}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),n=parseFloat(t.paddingBottom),a=i+n;e.style.height="auto",e.style.height=`${Math.max(this.minimumHeight??120,e.scrollHeight-a)}px`}splitView(){this.splitViewActive=!this.splitViewActive}renderToolbarItem(e){switch(e){case"H":return d.html`<li>
|
|
@@ -1029,7 +1032,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1029
1032
|
`,t-1)+1,n=e.indexOf(`
|
|
1030
1033
|
`,t),a=e.substring(i,n===-1?e.length:n),s=t-i,r=/\[[^\]]*\]\([^)]*\)/g;let l;for(;(l=r.exec(a))!==null;)if(s>=l.index&&s<=l.index+l[0].length)return!0;return!1}applyFormat(e,t="",i=""){return()=>{const n=this.querySelector(`textarea[id="${this.uid}"]`);if(n){if(i&&this.activeFormats[i])this.removeFormat(n,e,t,i);else{const{selectionStart:a,selectionEnd:s,value:r}=n,l=r.substring(a,s),u=r.substring(0,a),p=r.substring(s);n.value=`${u}${e}${l}${t}${p}`,n.selectionStart=a+e.length,n.selectionEnd=a+e.length+l.length}n.focus(),n.dispatchEvent(new Event("input",{bubbles:!0})),this.detectFormats()}}}removeFormat(e,t,i,n){const{selectionStart:a,value:s}=e,r=s.lastIndexOf(`
|
|
1031
1034
|
`,a-1)+1,l=s.indexOf(`
|
|
1032
|
-
`,a),u=s.substring(r,l===-1?s.length:l);if(i)if(n==="link"){const p=a-r,c=/\[([^\]]*)\]\([^)]*\)/g;let h;for(;(h=c.exec(u))!==null;)if(p>=h.index&&p<=h.index+h[0].length){const f=h[1],g=r+h.index,
|
|
1035
|
+
`,a),u=s.substring(r,l===-1?s.length:l);if(i)if(n==="link"){const p=a-r,c=/\[([^\]]*)\]\([^)]*\)/g;let h;for(;(h=c.exec(u))!==null;)if(p>=h.index&&p<=h.index+h[0].length){const f=h[1],g=r+h.index,k=g+h[0].length;e.value=`${s.substring(0,g)}${f}${s.substring(k)}`,e.selectionStart=g,e.selectionEnd=g+f.length;break}}else{const p=a-r;let c=0;for(;c<u.length;){const h=u.indexOf(t,c);if(h===-1)break;const f=u.indexOf(i,h+t.length);if(f===-1)break;if(p>=h&&p<=f+i.length){const g=u.substring(h+t.length,f),k=r+h,I=r+f+i.length;e.value=`${s.substring(0,k)}${g}${s.substring(I)}`,e.selectionStart=k,e.selectionEnd=k+g.length;break}c=f+i.length}}else{let p=t;if(n==="heading"){const g=u.match(/^#{1,6}\s/);g&&(p=g[0])}else if(n==="orderedList"){const g=u.match(/^\d+\.\s/);g&&(p=g[0])}const c=s.substring(0,r),h=u.substring(p.length),f=s.substring(l===-1?s.length:l);e.value=`${c}${h}${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 Md=Object.defineProperty,Rd=Object.getOwnPropertyDescriptor,yi=(e,t,i,n)=>{for(var a=n>1?void 0:n?Rd(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Md(t,i,a),a};let ct=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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`
|
|
1033
1036
|
<gui-markdown
|
|
1034
1037
|
.uid=${this.widget.uid}
|
|
1035
1038
|
.label=${this.adapter.templateData.label}
|
|
@@ -1052,7 +1055,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1052
1055
|
@input=${this.valueChanged}
|
|
1053
1056
|
@blur=${()=>this.adapter.onBlur()}
|
|
1054
1057
|
></gui-markdown>
|
|
1055
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
1058
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};yi([b.consume({context:y.formContext}),o.property({attribute:!1})],ct.prototype,"formContext",2),yi([b.provide({context:y.inputContext})],ct.prototype,"adapter",2),ct=yi([o.customElement("gui-markdown-input")],ct);const zd=Object.freeze(Object.defineProperty({__proto__:null,get MarkdownElement(){return ct}},Symbol.toStringTag,{value:"Module"}));var Fd=Object.defineProperty,Nd=Object.getOwnPropertyDescriptor,q=(e,t,i,n)=>{for(var a=n>1?void 0:n?Nd(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Fd(t,i,a),a};let T=class extends d.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=Ze("password",e),i={"gui-widget-input":!0,"gui-password--icon":!!this.icon};return d.html`
|
|
1056
1059
|
${le(this.uid,e)}
|
|
1057
1060
|
|
|
1058
1061
|
<div class="gui-widget">
|
|
@@ -1084,8 +1087,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1084
1087
|
</button>
|
|
1085
1088
|
</div>
|
|
1086
1089
|
|
|
1087
|
-
${
|
|
1088
|
-
`}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}))}};
|
|
1090
|
+
${F(this.uid,e)}
|
|
1091
|
+
`}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}))}};q([o.property({type:String})],T.prototype,"uid",2),q([o.property({type:String})],T.prototype,"label",2),q([o.property({type:String,attribute:"locale-id"})],T.prototype,"localeId",2),q([o.property({type:Array})],T.prototype,"errors",2),q([o.property({type:Boolean})],T.prototype,"touched",2),q([o.property({type:Boolean})],T.prototype,"required",2),q([o.property({type:Boolean})],T.prototype,"disabled",2),q([o.property({type:Boolean,attribute:"readonly"})],T.prototype,"readOnly",2),q([o.property({type:String})],T.prototype,"value",2),q([o.property({type:String})],T.prototype,"hint",2),q([o.property({type:String})],T.prototype,"icon",2),q([o.property({type:String})],T.prototype,"placeholder",2),q([o.property({type:String})],T.prototype,"autocomplete",2),q([o.property({type:String})],T.prototype,"showPasswordIcon",2),q([o.property({type:String})],T.prototype,"hidePasswordIcon",2),q([o.property({type:String})],T.prototype,"showPasswordLabel",2),q([o.property({type:String})],T.prototype,"hidePasswordLabel",2),q([o.state()],T.prototype,"showPassword",2),T=q([o.customElement("gui-password")],T),typeof customElements<"u"&&!customElements.get("gui-password")&&customElements.define("gui-password",T);var qd=Object.defineProperty,Bd=Object.getOwnPropertyDescriptor,fi=(e,t,i,n)=>{for(var a=n>1?void 0:n?Bd(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&qd(t,i,a),a};let ht=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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(),d.html`
|
|
1089
1092
|
<gui-password
|
|
1090
1093
|
.uid=${this.widget.uid}
|
|
1091
1094
|
.label=${this.adapter.templateData.label}
|
|
@@ -1106,7 +1109,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1106
1109
|
@input=${this.valueChanged}
|
|
1107
1110
|
@blur=${()=>this.adapter.onBlur()}
|
|
1108
1111
|
></gui-password>
|
|
1109
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
1112
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};fi([b.consume({context:y.formContext}),o.property({attribute:!1})],ht.prototype,"formContext",2),fi([b.provide({context:y.inputContext})],ht.prototype,"adapter",2),ht=fi([o.customElement("gui-password-input")],ht);const Zd=Object.freeze(Object.defineProperty({__proto__:null,get PasswordElement(){return ht}},Symbol.toStringTag,{value:"Module"}));var Vd=Object.defineProperty,Ud=Object.getOwnPropertyDescriptor,he=(e,t,i,n)=>{for(var a=n>1?void 0:n?Ud(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Vd(t,i,a),a};let ie=class extends d.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=Ze("textinput",e),i={"gui-widget-input":!0,"gui-textinput--icon":!!this.icon};return d.html`
|
|
1110
1113
|
${le(this.uid,e)}
|
|
1111
1114
|
|
|
1112
1115
|
<div class="gui-widget">
|
|
@@ -1127,8 +1130,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1127
1130
|
${t.html}
|
|
1128
1131
|
</div>
|
|
1129
1132
|
|
|
1130
|
-
${
|
|
1131
|
-
`}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}))}};
|
|
1133
|
+
${F(this.uid,e)}
|
|
1134
|
+
`}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.value},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};he([o.property({type:String})],ie.prototype,"uid",2),he([o.property({type:String})],ie.prototype,"label",2),he([o.property({type:String,attribute:"locale-id"})],ie.prototype,"localeId",2),he([o.property({type:Array})],ie.prototype,"errors",2),he([o.property({type:Boolean})],ie.prototype,"touched",2),he([o.property({type:Boolean})],ie.prototype,"required",2),he([o.property({type:Boolean})],ie.prototype,"disabled",2),he([o.property({type:Boolean,attribute:"readonly"})],ie.prototype,"readOnly",2),he([o.property({type:String})],ie.prototype,"value",2),he([o.property({type:String})],ie.prototype,"hint",2),he([o.property({type:String})],ie.prototype,"icon",2),he([o.property({type:String})],ie.prototype,"placeholder",2),he([o.property({type:String})],ie.prototype,"autocomplete",2),ie=he([o.customElement("gui-textinput")],ie),typeof customElements<"u"&&!customElements.get("gui-textinput")&&customElements.define("gui-textinput",ie);var Wd=Object.defineProperty,Gd=Object.getOwnPropertyDescriptor,gi=(e,t,i,n)=>{for(var a=n>1?void 0:n?Gd(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Wd(t,i,a),a};let mt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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(),d.html`
|
|
1132
1135
|
<gui-textinput
|
|
1133
1136
|
.uid=${this.widget.uid}
|
|
1134
1137
|
.label=${this.adapter.templateData.label}
|
|
@@ -1145,7 +1148,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1145
1148
|
@input=${this.valueChanged}
|
|
1146
1149
|
@blur=${()=>this.adapter.onBlur()}
|
|
1147
1150
|
></gui-textinput>
|
|
1148
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
1151
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};gi([b.consume({context:y.formContext}),o.property({attribute:!1})],mt.prototype,"formContext",2),gi([b.provide({context:y.inputContext})],mt.prototype,"adapter",2),mt=gi([o.customElement("gui-textinput-input")],mt);const Hd=Object.freeze(Object.defineProperty({__proto__:null,get TextinputElement(){return mt}},Symbol.toStringTag,{value:"Module"}));var Yd=Object.defineProperty,Kd=Object.getOwnPropertyDescriptor,J=(e,t,i,n)=>{for(var a=n>1?void 0:n?Kd(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Yd(t,i,a),a};let B=class extends d.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=d.html``;if(e.counterMode&&e.maxLength){const a={"gui-textarea--counter":!0,"gui-textarea--counter__error":(e.value?.length??0)>e.maxLength},s=e.counterMode==="current"?d.html`<span>${e.value?.length??0}</span>`:d.html`<span>${e.maxLength-(e.value?.length??0)}</span>`;t=d.html`<div class=${$.classMap(a)}>
|
|
1149
1152
|
${s}
|
|
1150
1153
|
<span> / ${e.maxLength}</span>
|
|
1151
1154
|
</div>`}const i={height:`${e.minimumHeight}px`,"min-height":`${e.minimumHeight}px`},n=this.querySelector(`textarea[id="${this.uid}"]`);if(this.autoGrow&&n){const a=window.getComputedStyle(n),s=parseFloat(a.paddingTop),r=parseFloat(a.paddingBottom),l=s+r;n.style.height="auto",i.height=`${Math.max(this.minimumHeight??120,n.scrollHeight-l)}px`}return d.html`
|
|
@@ -1155,7 +1158,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1155
1158
|
<textarea
|
|
1156
1159
|
id=${this.uid}
|
|
1157
1160
|
data-cy=${`${this.uid}_textarea`}
|
|
1158
|
-
|
|
1161
|
+
class="gui-widget-input"
|
|
1162
|
+
style=${et.styleMap(i)}
|
|
1159
1163
|
?required=${e.required}
|
|
1160
1164
|
?disabled=${e.disabled}
|
|
1161
1165
|
?readonly=${e.readonly}
|
|
@@ -1167,10 +1171,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1167
1171
|
</div>
|
|
1168
1172
|
|
|
1169
1173
|
<div class="gui-textarea--validation">
|
|
1170
|
-
<div>${
|
|
1174
|
+
<div>${F(this.uid,e)}</div>
|
|
1171
1175
|
${t}
|
|
1172
1176
|
</div>
|
|
1173
|
-
`}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}))}};
|
|
1177
|
+
`}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}))}};J([o.property({type:String})],B.prototype,"uid",2),J([o.property({type:String})],B.prototype,"label",2),J([o.property({type:String,attribute:"locale-id"})],B.prototype,"localeId",2),J([o.property({type:Array})],B.prototype,"errors",2),J([o.property({type:Boolean})],B.prototype,"touched",2),J([o.property({type:Boolean})],B.prototype,"required",2),J([o.property({type:Boolean})],B.prototype,"disabled",2),J([o.property({type:Boolean,attribute:"readonly"})],B.prototype,"readOnly",2),J([o.property({type:String})],B.prototype,"value",2),J([o.property({type:String})],B.prototype,"hint",2),J([o.property({type:String})],B.prototype,"placeholder",2),J([o.property({type:String})],B.prototype,"autocomplete",2),J([o.property({type:String,attribute:"countermode"})],B.prototype,"counterMode",2),J([o.property({type:Number,attribute:"minimumheight"})],B.prototype,"minimumHeight",2),J([o.property({type:Boolean,attribute:"autogrow"})],B.prototype,"autoGrow",2),J([o.property({type:Number,attribute:"maxlength"})],B.prototype,"maxLength",2),B=J([o.customElement("gui-textarea")],B),typeof customElements<"u"&&!customElements.get("gui-textarea")&&customElements.define("gui-textarea",B);var Jd=Object.defineProperty,Xd=Object.getOwnPropertyDescriptor,bi=(e,t,i,n)=>{for(var a=n>1?void 0:n?Xd(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Jd(t,i,a),a};let yt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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(),d.html`
|
|
1174
1178
|
<gui-textarea
|
|
1175
1179
|
.uid=${this.widget.uid}
|
|
1176
1180
|
.label=${this.adapter.templateData.label}
|
|
@@ -1190,7 +1194,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1190
1194
|
@input=${this.valueChanged}
|
|
1191
1195
|
@blur=${()=>this.adapter.onBlur()}
|
|
1192
1196
|
></gui-textarea>
|
|
1193
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
1197
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};bi([b.consume({context:y.formContext}),o.property({attribute:!1})],yt.prototype,"formContext",2),bi([b.provide({context:y.inputContext})],yt.prototype,"adapter",2),yt=bi([o.customElement("gui-textarea-input")],yt);const Qd=Object.freeze(Object.defineProperty({__proto__:null,get TextareaElement(){return yt}},Symbol.toStringTag,{value:"Module"}));var jd=Object.defineProperty,eu=Object.getOwnPropertyDescriptor,$e=(e,t,i,n)=>{for(var a=n>1?void 0:n?eu(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&jd(t,i,a),a};let me=class extends d.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"),d.html`
|
|
1194
1198
|
<label
|
|
1195
1199
|
class="gui-label"
|
|
1196
1200
|
for=${this.uid}
|
|
@@ -1219,9 +1223,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1219
1223
|
</label>
|
|
1220
1224
|
|
|
1221
1225
|
<div class="gui-widget-hint" id=${`${e.uid}_hint`}>
|
|
1222
|
-
${e.hint??d.nothing} ${
|
|
1226
|
+
${e.hint??d.nothing} ${F(this.uid,e)}
|
|
1223
1227
|
</div>
|
|
1224
|
-
`}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}))}}
|
|
1228
|
+
`}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}))}};$e([o.property({type:String})],me.prototype,"uid",2),$e([o.property({type:String})],me.prototype,"label",2),$e([o.property({type:String,attribute:"locale-id"})],me.prototype,"localeId",2),$e([o.property({type:Array})],me.prototype,"errors",2),$e([o.property({type:Boolean})],me.prototype,"touched",2),$e([o.property({type:Boolean})],me.prototype,"required",2),$e([o.property({type:Boolean})],me.prototype,"disabled",2),$e([o.property({type:Boolean,attribute:"readonly"})],me.prototype,"readOnly",2),$e([o.property({type:String})],me.prototype,"value",2),$e([o.property({type:String})],me.prototype,"hint",2),$e([o.property({type:String})],me.prototype,"togglePosition",2),me=$e([o.customElement("gui-toggle")],me),typeof customElements<"u"&&!customElements.get("gui-toggle")&&customElements.define("gui-toggle",me);var tu=Object.defineProperty,iu=Object.getOwnPropertyDescriptor,Di=(e,t,i,n)=>{for(var a=n>1?void 0:n?iu(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&tu(t,i,a),a};let ft=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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(),d.html`
|
|
1225
1229
|
<gui-toggle
|
|
1226
1230
|
.uid=${this.widget.uid}
|
|
1227
1231
|
.label=${this.adapter.templateData.label}
|
|
@@ -1236,7 +1240,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1236
1240
|
@change=${this.valueChanged}
|
|
1237
1241
|
@blur=${()=>this.adapter.onBlur()}
|
|
1238
1242
|
></gui-toggle>
|
|
1239
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
1243
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Di([b.consume({context:y.formContext}),o.property({attribute:!1})],ft.prototype,"formContext",2),Di([b.provide({context:y.inputContext})],ft.prototype,"adapter",2),ft=Di([o.customElement("gui-toggle-input")],ft);const au=Object.freeze(Object.defineProperty({__proto__:null,get ToggleElement(){return ft}},Symbol.toStringTag,{value:"Module"}));var nu=Object.defineProperty,su=Object.getOwnPropertyDescriptor,ke=(e,t,i,n)=>{for(var a=n>1?void 0:n?su(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&nu(t,i,a),a};let ye=class extends d.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"),d.html`
|
|
1240
1244
|
<label
|
|
1241
1245
|
class="gui-label"
|
|
1242
1246
|
for=${this.uid}
|
|
@@ -1263,9 +1267,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1263
1267
|
</label>
|
|
1264
1268
|
|
|
1265
1269
|
<div class="gui-widget-hint" id=${`${e.uid}_hint`}>
|
|
1266
|
-
${e.hint??d.nothing} ${
|
|
1270
|
+
${e.hint??d.nothing} ${F(this.uid,e)}
|
|
1267
1271
|
</div>
|
|
1268
|
-
`}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}))}};
|
|
1272
|
+
`}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}))}};ke([o.property({type:String})],ye.prototype,"uid",2),ke([o.property({type:String})],ye.prototype,"label",2),ke([o.property({type:String,attribute:"locale-id"})],ye.prototype,"localeId",2),ke([o.property({type:Array})],ye.prototype,"errors",2),ke([o.property({type:Boolean})],ye.prototype,"touched",2),ke([o.property({type:Boolean})],ye.prototype,"required",2),ke([o.property({type:Boolean})],ye.prototype,"disabled",2),ke([o.property({type:Boolean,attribute:"readonly"})],ye.prototype,"readOnly",2),ke([o.property({type:String})],ye.prototype,"value",2),ke([o.property({type:String})],ye.prototype,"hint",2),ke([o.property({type:String})],ye.prototype,"checkboxPosition",2),ye=ke([o.customElement("gui-checkbox")],ye),typeof customElements<"u"&&!customElements.get("gui-checkbox")&&customElements.define("gui-checkbox",ye);var ru=Object.defineProperty,ou=Object.getOwnPropertyDescriptor,vi=(e,t,i,n)=>{for(var a=n>1?void 0:n?ou(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&ru(t,i,a),a};let gt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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(),d.html`
|
|
1269
1273
|
<gui-checkbox
|
|
1270
1274
|
.uid=${this.widget.uid}
|
|
1271
1275
|
.label=${this.adapter.templateData.label}
|
|
@@ -1280,7 +1284,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1280
1284
|
@change=${this.valueChanged}
|
|
1281
1285
|
@blur=${()=>this.adapter.onBlur()}
|
|
1282
1286
|
></gui-checkbox>
|
|
1283
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
1287
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};vi([b.consume({context:y.formContext}),o.property({attribute:!1})],gt.prototype,"formContext",2),vi([b.provide({context:y.inputContext})],gt.prototype,"adapter",2),gt=vi([o.customElement("gui-checkbox-input")],gt);const lu=Object.freeze(Object.defineProperty({__proto__:null,get CheckboxElement(){return gt}},Symbol.toStringTag,{value:"Module"}));var du=Object.defineProperty,uu=Object.getOwnPropertyDescriptor,X=(e,t,i,n)=>{for(var a=n>1?void 0:n?uu(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&du(t,i,a),a};let Z=class extends d.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 n=Math.max(23,e.scrollWidth);t.width=`${n}px`,t.maxWidth=`${n}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 d.html`
|
|
1284
1288
|
${le(this.uid,i)}
|
|
1285
1289
|
|
|
1286
1290
|
<div class="gui-widget">
|
|
@@ -1299,7 +1303,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1299
1303
|
inputmode="decimal"
|
|
1300
1304
|
id=${this.uid}
|
|
1301
1305
|
data-cy=${`${this.uid}_number`}
|
|
1302
|
-
|
|
1306
|
+
class="gui-widget-input"
|
|
1307
|
+
style=${et.styleMap(t)}
|
|
1303
1308
|
value=${this.value}
|
|
1304
1309
|
?required=${this.required}
|
|
1305
1310
|
?disabled=${this.disabled}
|
|
@@ -1323,8 +1328,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1323
1328
|
</button>
|
|
1324
1329
|
</div>
|
|
1325
1330
|
|
|
1326
|
-
${
|
|
1327
|
-
`}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 t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.valueAsNumber},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};
|
|
1331
|
+
${F(this.uid,i)}
|
|
1332
|
+
`}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 t=e.target;this.dispatchEvent(new CustomEvent("input",{detail:{value:t.valueAsNumber},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};X([o.property({type:String})],Z.prototype,"uid",2),X([o.property({type:String})],Z.prototype,"label",2),X([o.property({type:String})],Z.prototype,"hint",2),X([o.property({type:String,attribute:"locale-id"})],Z.prototype,"localeId",2),X([o.property({type:Array})],Z.prototype,"errors",2),X([o.property({type:Boolean})],Z.prototype,"touched",2),X([o.property({type:Boolean})],Z.prototype,"required",2),X([o.property({type:Boolean})],Z.prototype,"disabled",2),X([o.property({type:Boolean,attribute:"readonly"})],Z.prototype,"readOnly",2),X([o.property({type:Number})],Z.prototype,"value",2),X([o.property({type:Number})],Z.prototype,"step",2),X([o.property({type:String})],Z.prototype,"placeholder",2),X([o.property({type:String})],Z.prototype,"autocomplete",2),X([o.property({type:Number})],Z.prototype,"minimum",2),X([o.property({type:Number})],Z.prototype,"maximum",2),X([o.property({type:Number})],Z.prototype,"autoGrow",2),Z=X([o.customElement("gui-number")],Z),typeof customElements<"u"&&!customElements.get("gui-number")&&customElements.define("gui-number",Z);var pu=Object.defineProperty,cu=Object.getOwnPropertyDescriptor,wi=(e,t,i,n)=>{for(var a=n>1?void 0:n?cu(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&pu(t,i,a),a};let bt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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(),d.html`
|
|
1328
1333
|
<gui-number
|
|
1329
1334
|
.uid=${this.widget.uid}
|
|
1330
1335
|
.label=${this.adapter.templateData.label}
|
|
@@ -1344,8 +1349,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1344
1349
|
@input=${this.valueChanged}
|
|
1345
1350
|
@blur=${()=>this.adapter.onBlur()}
|
|
1346
1351
|
></gui-number>
|
|
1347
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
1348
|
-
${
|
|
1352
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};wi([b.consume({context:y.formContext}),o.property({attribute:!1})],bt.prototype,"formContext",2),wi([b.provide({context:y.inputContext})],bt.prototype,"adapter",2),bt=wi([o.customElement("gui-number-input")],bt);const hu=Object.freeze(Object.defineProperty({__proto__:null,get NumberElement(){return bt}},Symbol.toStringTag,{value:"Module"}));function mu(e){const t=typeof e;return t==="string"||t==="number"}function Za(e,t){return t.find(i=>i.value.toString()===e)?.value}const Va=(e,t)=>{if(Array.isArray(e)&&e.length>0&&!Ha.isOption(e[0])){if(mu(e[0]))return e.map(i=>({label:i.toString(),value:i}));if(yu(e[0],t)){const i=fu(e[0],t);return e.map(i)}else throw new Error("Invalid option shape")}return e},yu=(e,{labelField:t,valueField:i})=>{if(e===null||typeof e!="object")return!1;const n=e,a=t?Object.prototype.hasOwnProperty.call(n,t):!1,s=i?Object.prototype.hasOwnProperty.call(n,i):!1;return t&&!a?!1:!(i&&!s)};function fu(e,{labelField:t,valueField:i}){if(e===null||typeof e!="object")throw new Error("Provided value is not an object");const n=e,a=t&&Object.prototype.hasOwnProperty.call(n,t)?t:void 0,s=i&&Object.prototype.hasOwnProperty.call(n,i)?i:void 0;if(!a&&!s)throw new Error("Neither labelField nor valueField exists on the object");return r=>{if(r===null||typeof r!="object")throw new Error("Item is not an object");const l=r;return{label:a?l[a]:"",value:s?l[s]:""}}}var gu=Object.defineProperty,bu=Object.getOwnPropertyDescriptor,de=(e,t,i,n)=>{for(var a=n>1?void 0:n?bu(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&gu(t,i,a),a};let Q=class extends d.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=Va(this.options,{labelField:this.labelField,valueField:this.valueField});const t=this.value;this.hasMatchingValue=this.options?.length?this.options.find(({value:n})=>n===t)!==void 0:!1;const i=this.optionsLoading?d.html`<span>Loading...</span>`:d.html`
|
|
1353
|
+
${fe.repeat(this.options||[],n=>n?.value,(n,a)=>{const s=this.hasMatchingValue&&n.value===e.value,r=!this.hasMatchingValue&&a===0,l=s||r;return d.html`<label for=${`${this.uid}_${a}`}>
|
|
1349
1354
|
<input
|
|
1350
1355
|
type="radio"
|
|
1351
1356
|
tabindex=${l?"0":"-1"}
|
|
@@ -1374,8 +1379,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1374
1379
|
${i}
|
|
1375
1380
|
</div>
|
|
1376
1381
|
|
|
1377
|
-
${
|
|
1378
|
-
`}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:
|
|
1382
|
+
${F(this.uid,e)}
|
|
1383
|
+
`}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:Za(t.value,this.options)},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};de([o.property({type:String})],Q.prototype,"uid",2),de([o.property({type:String})],Q.prototype,"label",2),de([o.property({type:String,attribute:"locale-id"})],Q.prototype,"localeId",2),de([o.property({type:Array})],Q.prototype,"errors",2),de([o.property({type:Boolean})],Q.prototype,"touched",2),de([o.property({type:Boolean})],Q.prototype,"required",2),de([o.property({type:Boolean})],Q.prototype,"disabled",2),de([o.property({type:Boolean,attribute:"readonly"})],Q.prototype,"readOnly",2),de([o.property({type:String})],Q.prototype,"value",2),de([o.property({type:String})],Q.prototype,"hint",2),de([o.property({type:String})],Q.prototype,"options",2),de([o.property({type:String})],Q.prototype,"labelField",2),de([o.property({type:String})],Q.prototype,"valueField",2),de([o.property({type:String})],Q.prototype,"direction",2),Q=de([o.customElement("gui-radiogroup")],Q),typeof customElements<"u"&&!customElements.get("gui-radiogroup")&&customElements.define("gui-radiogroup",Q);var Du=Object.defineProperty,vu=Object.getOwnPropertyDescriptor,$i=(e,t,i,n)=>{for(var a=n>1?void 0:n?vu(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Du(t,i,a),a};let Dt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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(),d.html`
|
|
1379
1384
|
<gui-radiogroup
|
|
1380
1385
|
.uid=${this.widget.uid}
|
|
1381
1386
|
.label=${this.adapter.templateData.label}
|
|
@@ -1393,11 +1398,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1393
1398
|
@change=${this.valueChanged}
|
|
1394
1399
|
@blur=${()=>this.adapter.onBlur()}
|
|
1395
1400
|
></gui-radiogroup>
|
|
1396
|
-
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}
|
|
1401
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};$i([b.consume({context:y.formContext}),o.property({attribute:!1})],Dt.prototype,"formContext",2),$i([b.provide({context:y.inputContext})],Dt.prototype,"adapter",2),Dt=$i([o.customElement("gui-radiogroup-input")],Dt);const wu=Object.freeze(Object.defineProperty({__proto__:null,get RadiogroupElement(){return Dt}},Symbol.toStringTag,{value:"Module"}));var $u=Object.defineProperty,ku=Object.getOwnPropertyDescriptor,j=(e,t,i,n)=>{for(var a=n>1?void 0:n?ku(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&$u(t,i,a),a};let V=class extends d.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.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=Ze("select",e);this.options=Va(this.options,{labelField:this.labelField,valueField:this.valueField}),this.hasMatchingValue=this.options?.length?this.options.find(({value:n})=>n===this.value)!==void 0:!1;const i=this.optionsLoading?d.html`<span>Loading...</span>`:d.html`
|
|
1397
1402
|
<option value="" disabled selected=${this.hasMatchingValue?d.nothing:""}>
|
|
1398
1403
|
${this.placeholder??"Select an option"}
|
|
1399
1404
|
</option>
|
|
1400
|
-
${
|
|
1405
|
+
${fe.repeat(this.options||[],n=>n?.value,n=>d.html`<option
|
|
1401
1406
|
value=${n.value}
|
|
1402
1407
|
selected=${this.hasMatchingValue&&n.value===this.value?"":d.nothing}
|
|
1403
1408
|
>
|
|
@@ -1411,7 +1416,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1411
1416
|
id=${this.uid}
|
|
1412
1417
|
tabindex="0"
|
|
1413
1418
|
data-cy=${`${this.uid}_select`}
|
|
1414
|
-
class=${$.classMap(t.widgetClasses)}
|
|
1419
|
+
class=${$.classMap({"gui-widget-input":!0,...t.widgetClasses})}
|
|
1415
1420
|
?required=${e.required}
|
|
1416
1421
|
?disabled=${e.disabled||e.readonly}
|
|
1417
1422
|
autocomplete=${this.autocomplete||d.nothing}
|
|
@@ -1429,8 +1434,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1429
1434
|
${t.html}
|
|
1430
1435
|
</div>
|
|
1431
1436
|
|
|
1432
|
-
${
|
|
1433
|
-
`}updated(e){e.has("value")&&!this.hasMatchingValue&&this.value&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:`Invalid selection: '${this.value}' is not a valid option.`},bubbles:!0}))}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:
|
|
1437
|
+
${F(this.uid,e)}
|
|
1438
|
+
`}updated(e){e.has("value")&&!this.hasMatchingValue&&this.value&&this.dispatchEvent(new CustomEvent("inputError",{detail:{message:`Invalid selection: '${this.value}' is not a valid option.`},bubbles:!0}))}valueChanged(e){if(e.stopPropagation(),!this.readOnly){const t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{value:Za(t.value,this.options)},bubbles:!0,composed:!0}))}}onBlur(){this.dispatchEvent(new CustomEvent("blur",{bubbles:!0,composed:!0}))}};j([o.property({type:String})],V.prototype,"uid",2),j([o.property({type:String})],V.prototype,"label",2),j([o.property({type:String,attribute:"locale-id"})],V.prototype,"localeId",2),j([o.property({type:Array})],V.prototype,"errors",2),j([o.property({type:Boolean})],V.prototype,"touched",2),j([o.property({type:Boolean})],V.prototype,"required",2),j([o.property({type:Boolean})],V.prototype,"disabled",2),j([o.property({type:Boolean,attribute:"readonly"})],V.prototype,"readOnly",2),j([o.property({type:String})],V.prototype,"value",2),j([o.property({type:String})],V.prototype,"hint",2),j([o.property({type:String})],V.prototype,"icon",2),j([o.property({type:String})],V.prototype,"autocomplete",2),j([o.property({type:String})],V.prototype,"options",2),j([o.property({type:String})],V.prototype,"placeholder",2),j([o.property({type:String})],V.prototype,"labelField",2),j([o.property({type:String})],V.prototype,"valueField",2),V=j([o.customElement("gui-select")],V),typeof customElements<"u"&&!customElements.get("gui-select")&&customElements.define("gui-select",V);var _u=Object.defineProperty,Cu=Object.getOwnPropertyDescriptor,ki=(e,t,i,n)=>{for(var a=n>1?void 0:n?Cu(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&_u(t,i,a),a};let vt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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(),d.html`
|
|
1434
1439
|
<gui-select
|
|
1435
1440
|
.uid=${this.widget.uid}
|
|
1436
1441
|
.label=${this.adapter.templateData.label}
|
|
@@ -1451,7 +1456,75 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1451
1456
|
@inputError=${this.onInputError}
|
|
1452
1457
|
@blur=${()=>this.adapter.onBlur()}
|
|
1453
1458
|
></gui-select>
|
|
1454
|
-
`}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())}};
|
|
1459
|
+
`}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())}};ki([b.consume({context:y.formContext}),o.property({attribute:!1})],vt.prototype,"formContext",2),ki([b.provide({context:y.inputContext})],vt.prototype,"adapter",2),vt=ki([o.customElement("gui-select-input")],vt);const Su=Object.freeze(Object.defineProperty({__proto__:null,get SelectElement(){return vt}},Symbol.toStringTag,{value:"Module"}));var Ou=Object.defineProperty,xu=Object.getOwnPropertyDescriptor,U=(e,t,i,n)=>{for(var a=n>1?void 0:n?xu(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Ou(t,i,a),a};const Eu=["Enter",",","Tab","blur"];let L=class extends d.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((a,s)=>this.pillKey(a,s)===e.detail.key);if(i<0)return;const n=t.filter((a,s)=>s!==i);this.emitChange(n),n.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:Eu}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},n=e.map((a,s)=>({key:this.pillKey(a,s),label:a}));return d.html`
|
|
1460
|
+
${this.label?le(this.uid,t,!1,void 0,!1):d.nothing}
|
|
1461
|
+
|
|
1462
|
+
<div class="gui-widget">
|
|
1463
|
+
<div
|
|
1464
|
+
class=${$.classMap({"gui-widget-input":!0,"gui-tags-input":!0,"gui-tags-input--icon":!!this.icon})}
|
|
1465
|
+
role="group"
|
|
1466
|
+
aria-label=${this.label??"Tags input"}
|
|
1467
|
+
>
|
|
1468
|
+
${this.icon?d.html`<span class=${$.classMap(i)} data-icon=${this.icon}></span>`:d.nothing}
|
|
1469
|
+
|
|
1470
|
+
<gui-pills
|
|
1471
|
+
class="gui-tags__pills"
|
|
1472
|
+
style=${et.styleMap(n.length?{}:{"min-width":0})}
|
|
1473
|
+
.items=${n}
|
|
1474
|
+
.removable=${!0}
|
|
1475
|
+
.clickable=${!1}
|
|
1476
|
+
.bubble=${!0}
|
|
1477
|
+
.tabbable=${!1}
|
|
1478
|
+
?disabled=${this.disabled}
|
|
1479
|
+
?readonly=${this.readOnly}
|
|
1480
|
+
.removeAriaLabel=${this.getRemoveAriaLabel()}
|
|
1481
|
+
.removeIcon=${this.removeIcon}
|
|
1482
|
+
.compactAriaLabel=${`${e.length} tags`}
|
|
1483
|
+
@pillremove=${this.onPillRemove}
|
|
1484
|
+
@pillkeydown=${this.onPillKeydown}
|
|
1485
|
+
></gui-pills>
|
|
1486
|
+
|
|
1487
|
+
<input
|
|
1488
|
+
type="text"
|
|
1489
|
+
id=${this.uid}
|
|
1490
|
+
data-cy=${`${this.uid}_tags-input`}
|
|
1491
|
+
class="gui-tags__input"
|
|
1492
|
+
?disabled=${this.disabled}
|
|
1493
|
+
?readonly=${this.readOnly}
|
|
1494
|
+
placeholder=${this.placeholder||d.nothing}
|
|
1495
|
+
@keydown=${this.onInputKeydown}
|
|
1496
|
+
@blur=${this.onInputBlur}
|
|
1497
|
+
@paste=${this.onPaste}
|
|
1498
|
+
@change=${a=>a.stopPropagation()}
|
|
1499
|
+
/>
|
|
1500
|
+
</div>
|
|
1501
|
+
|
|
1502
|
+
${F(this.uid,t)}
|
|
1503
|
+
</div>
|
|
1504
|
+
`}onInputKeydown(e){if(this.disabled||this.readOnly)return;const t=e.target,i=this.getSeparators(),n=t.value,a=t.selectionStart===0&&t.selectionEnd===0;if(e.key==="Enter"&&i.includes("Enter")){e.preventDefault(),this.commitDraft(n)&&(t.value="");return}if(e.key===","&&i.includes(",")){e.preventDefault(),this.commitDraft(n)&&(t.value="");return}if(e.key==="Tab"&&i.includes("Tab")&&n.length>0){this.commitDraft(n)&&(t.value="");return}if(e.key==="Escape"){e.preventDefault(),t.value="";return}const s=this.getValue(),r=this.isCompactMode();if(e.key==="ArrowDown"&&r&&s.length>0){e.preventDefault(),this.enterPillList(0);return}if(e.key==="ArrowLeft"&&!r&&a&&s.length>0){e.preventDefault(),this.enterPillList(s.length-1);return}if(e.key==="Backspace"&&n===""&&s.length>0){e.preventDefault(),this.enterPillList(s.length-1);return}}onInputBlur(e){const t=e.target,i=this.getSeparators(),n=t.value;n.length>0&&i.includes("blur")&&!this.disabled&&!this.readOnly&&this.commitDraft(n)&&(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 n=this.getSeparators().filter(c=>c!=="Enter"&&c!=="Tab"&&c!=="blur");if(n.length===0)return;const a=new RegExp(`[${n.map(c=>c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("")}
|
|
1505
|
+
]`);if(!a.test(t))return;e.preventDefault();const s=e.target instanceof HTMLInputElement?e.target:null,l=((s?.value??"")+t).split(a),u=l.slice(0,-1),p=l[l.length-1]??"";this.commitDraftBatch(u)&&s&&(s.value=p)}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 n of e){const a=this.trim?n.trim():n;if(a.length!==0&&!(this.allowDuplicates===!1&&i.includes(a))){if(this.limit!==void 0&&i.length>=this.limit)break;i.push(a)}}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))}};U([o.property({type:String})],L.prototype,"uid",2),U([o.property({type:String})],L.prototype,"label",2),U([o.property({type:String,attribute:"locale-id"})],L.prototype,"localeId",2),U([o.property({type:Array})],L.prototype,"errors",2),U([o.property({type:Boolean})],L.prototype,"touched",2),U([o.property({type:Boolean})],L.prototype,"required",2),U([o.property({type:Boolean})],L.prototype,"disabled",2),U([o.property({type:Boolean,attribute:"readonly"})],L.prototype,"readOnly",2),U([o.property({type:Array})],L.prototype,"value",2),U([o.property({type:String})],L.prototype,"hint",2),U([o.property({type:String})],L.prototype,"placeholder",2),U([o.property({type:String})],L.prototype,"icon",2),U([o.property({type:Array})],L.prototype,"separators",2),U([o.property({type:Boolean})],L.prototype,"allowDuplicates",2),U([o.property({type:Boolean})],L.prototype,"trim",2),U([o.property({type:Number})],L.prototype,"limit",2),U([o.property({type:String,attribute:"remove-aria-label"})],L.prototype,"removeAriaLabel",2),U([o.property({type:String,attribute:"remove-icon"})],L.prototype,"removeIcon",2),L=U([o.customElement("gui-tags")],L),typeof customElements<"u"&&!customElements.get("gui-tags")&&customElements.define("gui-tags",L);var Pu=Object.defineProperty,Iu=Object.getOwnPropertyDescriptor,_i=(e,t,i,n)=>{for(var a=n>1?void 0:n?Iu(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Pu(t,i,a),a};let wt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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(),d.html`
|
|
1506
|
+
<gui-tags
|
|
1507
|
+
.uid=${this.widget.uid}
|
|
1508
|
+
.label=${this.adapter.templateData.label}
|
|
1509
|
+
.hint=${this.adapter.templateData.hint}
|
|
1510
|
+
.errors=${this.adapter.templateData.errors}
|
|
1511
|
+
?touched=${this.adapter.templateData.touched}
|
|
1512
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
1513
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
1514
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
1515
|
+
.value=${this.adapter.templateData.value}
|
|
1516
|
+
.placeholder=${this.adapter.templateData.placeholder}
|
|
1517
|
+
.icon=${this.adapter.templateData.icon}
|
|
1518
|
+
.separators=${this.adapter.templateData.separators}
|
|
1519
|
+
.allowDuplicates=${this.adapter.templateData.allowDuplicates??!0}
|
|
1520
|
+
.trim=${this.adapter.templateData.trim??!0}
|
|
1521
|
+
.limit=${this.adapter.templateData.limit}
|
|
1522
|
+
.removeAriaLabel=${this.adapter.templateData.removeAriaLabel}
|
|
1523
|
+
.removeIcon=${this.adapter.templateData.removeIcon}
|
|
1524
|
+
@change=${this.valueChanged}
|
|
1525
|
+
@blur=${()=>this.adapter.onBlur()}
|
|
1526
|
+
></gui-tags>
|
|
1527
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};_i([b.consume({context:y.formContext}),o.property({attribute:!1})],wt.prototype,"formContext",2),_i([b.provide({context:y.inputContext})],wt.prototype,"adapter",2),wt=_i([o.customElement("gui-tags-input")],wt);const Au=Object.freeze(Object.defineProperty({__proto__:null,get TagsElement(){return wt}},Symbol.toStringTag,{value:"Module"}));var Tu=Object.defineProperty,Lu=Object.getOwnPropertyDescriptor,$t=(e,t,i,n)=>{for(var a=n>1?void 0:n?Lu(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Tu(t,i,a),a};let Mu=0;const Ru=()=>Mu++;let We=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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 d.html`
|
|
1455
1528
|
<div
|
|
1456
1529
|
id=${this.widget.uid}
|
|
1457
1530
|
class=${`gui-repeater__main-card gui-repeater__card ${this.isFocused?"gui-repeater__card--focused":""}`}
|
|
@@ -1467,7 +1540,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1467
1540
|
.required=${e.validator?.required}
|
|
1468
1541
|
.native=${!1}
|
|
1469
1542
|
></gui-label>
|
|
1470
|
-
${e.value?
|
|
1543
|
+
${e.value?fe.repeat(e.value,i=>Hn(i,Ru),(i,n)=>d.html`
|
|
1471
1544
|
<div class="gui-repeater__card">
|
|
1472
1545
|
<div class="gui-repeater__card-header">
|
|
1473
1546
|
${e.title?d.html`<span class="gui-repeater__card-title"
|
|
@@ -1512,24 +1585,24 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1512
1585
|
.errors=${e.errors}
|
|
1513
1586
|
.touched=${e.touched}
|
|
1514
1587
|
></gui-errors>`:d.nothing}
|
|
1515
|
-
`}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,n)=>e!==n);"structuredClone"in window?this.adapter.valueChanged(structuredClone(t)):this.adapter.valueChanged(JSON.parse(JSON.stringify(t))),this.requestUpdate()}}
|
|
1588
|
+
`}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,n)=>e!==n);"structuredClone"in window?this.adapter.valueChanged(structuredClone(t)):this.adapter.valueChanged(JSON.parse(JSON.stringify(t))),this.requestUpdate()}};$t([b.consume({context:y.formContext}),o.property({attribute:!1})],We.prototype,"formContext",2),$t([b.provide({context:y.inputContext})],We.prototype,"adapter",2),$t([o.state()],We.prototype,"isFocused",2),$t([o.query(".gui-repeater__main-card")],We.prototype,"_repeaterRef",2),We=$t([o.customElement("gui-repeater-input")],We);const zu=Object.freeze(Object.defineProperty({__proto__:null,get RepeaterElement(){return We}},Symbol.toStringTag,{value:"Module"}));var Fu=Object.defineProperty,Nu=Object.getOwnPropertyDescriptor,Ci=(e,t,i,n)=>{for(var a=n>1?void 0:n?Nu(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Fu(t,i,a),a};let kt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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 d.html`
|
|
1516
1589
|
<div
|
|
1517
1590
|
class=${$.classMap(e)}
|
|
1518
1591
|
id=${this.widget?.uid}
|
|
1519
1592
|
style=${this.adapter.templateData.gap?`gap: ${this.adapter.templateData.gap}px`:""}
|
|
1520
1593
|
>
|
|
1521
|
-
${
|
|
1594
|
+
${fe.repeat(this.adapter.templateData.children||[],t=>t?.uid,t=>d.html`<gui-widget .widget=${t}></gui-widget>`)}
|
|
1522
1595
|
</div>
|
|
1523
|
-
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
1596
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Ci([b.consume({context:y.formContext}),o.property({attribute:!1})],kt.prototype,"formContext",2),Ci([b.provide({context:y.layoutContext})],kt.prototype,"adapter",2),kt=Ci([o.customElement("gui-flex-layout")],kt);const qu=Object.freeze(Object.defineProperty({__proto__:null,get FlexElement(){return kt}},Symbol.toStringTag,{value:"Module"}));var Bu=Object.defineProperty,Zu=Object.getOwnPropertyDescriptor,Si=(e,t,i,n)=>{for(var a=n>1?void 0:n?Zu(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Bu(t,i,a),a};let _t=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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,n={"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"},a=[];return this.adapter.templateData.columnGap!==void 0&&a.push(`column-gap: ${this.adapter.templateData.columnGap}px`),this.adapter.templateData.rowGap!==void 0&&a.push(`row-gap: ${this.adapter.templateData.rowGap}px`),d.html`
|
|
1524
1597
|
<div class=${$.classMap(n)} id=${this.widget?.uid} style=${a.join("; ")}>
|
|
1525
|
-
${
|
|
1598
|
+
${fe.repeat(this.adapter.templateData.children||[],s=>s?.uid,s=>d.html`<div class="gui-grid__cell" style="grid-column: span ${s.size||1}">
|
|
1526
1599
|
<gui-widget .widget=${s}></gui-widget>
|
|
1527
1600
|
</div>`)}
|
|
1528
1601
|
</div>
|
|
1529
|
-
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
1602
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Si([b.consume({context:y.formContext}),o.property({attribute:!1})],_t.prototype,"formContext",2),Si([b.provide({context:y.layoutContext})],_t.prototype,"adapter",2),_t=Si([o.customElement("gui-grid-layout")],_t);const Vu=Object.freeze(Object.defineProperty({__proto__:null,get GridElement(){return _t}},Symbol.toStringTag,{value:"Module"}));var Uu=Object.defineProperty,Wu=Object.getOwnPropertyDescriptor,Le=(e,t,i,n)=>{for(var a=n>1?void 0:n?Wu(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Uu(t,i,a),a};let Ce=class extends d.LitElement{constructor(){super(...arguments),this.activeTab="",this.adapter=new y.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=Ut(this.startSentinel,n=>this.isStartVisible=n),this.endObserver=Ut(this.endSentinel,n=>this.isEndVisible=n);const i=this.widget.props.tabs.findIndex(n=>n.uid===this.activeTab);this.tabButtons[i].scrollIntoView({block:"nearest",inline:"nearest"})}render(){if(!this.adapter.templateData)return d.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 d.html`<nav class=${$.classMap(t)} id=${this.widget.uid}>
|
|
1530
1603
|
<ul role="tablist">
|
|
1531
1604
|
<li role="presentation" id="start-sentinel" class="gui-sentinel"></li>
|
|
1532
|
-
${this.adapter.templateData.tabs?
|
|
1605
|
+
${this.adapter.templateData.tabs?fe.repeat(this.adapter.templateData.tabs,(i,n)=>d.html`
|
|
1533
1606
|
<li role="presentation">
|
|
1534
1607
|
<button
|
|
1535
1608
|
type="button"
|
|
@@ -1551,7 +1624,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1551
1624
|
<li role="presentation" id="end-sentinel" class="gui-sentinel gui-sentinel__end"></li>
|
|
1552
1625
|
</ul>
|
|
1553
1626
|
</nav>
|
|
1554
|
-
${
|
|
1627
|
+
${fe.repeat(e,i=>i?.uid,(i,n)=>d.html`<section
|
|
1555
1628
|
role="tabpanel"
|
|
1556
1629
|
data-cy=${`tabpanel_${this.widget.uid}_${n}`}
|
|
1557
1630
|
id=${`tabpanel_${this.widget.uid}_${n}`}
|
|
@@ -1559,9 +1632,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1559
1632
|
aria-labelledby=${`tab_${this.widget.uid}_${n}`}
|
|
1560
1633
|
>
|
|
1561
1634
|
<gui-widget .widget=${i}></gui-widget>
|
|
1562
|
-
</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),n=Array.from(this.tabButtons),a=window.getComputedStyle(this).direction==="rtl";switch(e.key){case"ArrowLeft":{const s=i+(a?1:-1);s>=0&&s<t.length&&(this.activeTab=t[s].uid,n[s].focus());break}case"ArrowRight":{const s=i+(a?-1:1);s>=0&&s<t.length&&(this.activeTab=t[s].uid,n[s].focus());break}case"Home":this.activeTab=t[0].uid,n[0].focus();break;case"End":this.activeTab=t[t.length-1].uid,n[t.length-1].focus();break;default:return}}};
|
|
1635
|
+
</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),n=Array.from(this.tabButtons),a=window.getComputedStyle(this).direction==="rtl";switch(e.key){case"ArrowLeft":{const s=i+(a?1:-1);s>=0&&s<t.length&&(this.activeTab=t[s].uid,n[s].focus());break}case"ArrowRight":{const s=i+(a?-1:1);s>=0&&s<t.length&&(this.activeTab=t[s].uid,n[s].focus());break}case"Home":this.activeTab=t[0].uid,n[0].focus();break;case"End":this.activeTab=t[t.length-1].uid,n[t.length-1].focus();break;default:return}}};Le([o.query("#start-sentinel")],Ce.prototype,"startSentinel",2),Le([o.query("#end-sentinel")],Ce.prototype,"endSentinel",2),Le([o.state()],Ce.prototype,"isStartVisible",2),Le([o.state()],Ce.prototype,"isEndVisible",2),Le([o.queryAll('button[role="tab"]')],Ce.prototype,"tabButtons",2),Le([o.property({type:String})],Ce.prototype,"activeTab",2),Le([b.consume({context:y.formContext}),o.property({attribute:!1})],Ce.prototype,"formContext",2),Le([b.provide({context:y.layoutContext})],Ce.prototype,"adapter",2),Ce=Le([o.customElement("gui-tabs-layout")],Ce);const Gu=Object.freeze(Object.defineProperty({__proto__:null,get TabsElement(){return Ce}},Symbol.toStringTag,{value:"Module"}));var Hu=Object.defineProperty,Yu=Object.getOwnPropertyDescriptor,Oi=(e,t,i,n)=>{for(var a=n>1?void 0:n?Yu(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Hu(t,i,a),a};let Ct=class extends d.LitElement{constructor(){super(...arguments),this.activeSections={},this.adapter=new y.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?d.html`
|
|
1563
1636
|
<div class="gui-widget" id=${this.widget.uid}>
|
|
1564
|
-
${this.adapter.templateData.sections?
|
|
1637
|
+
${this.adapter.templateData.sections?fe.repeat(this.adapter.templateData.sections,e=>e.uid,e=>{const t=this.activeSections[e.uid]||this.adapter.templateData.renderMode!=="activeOnly"?d.html`<section
|
|
1565
1638
|
class="gui-widget"
|
|
1566
1639
|
role="region"
|
|
1567
1640
|
id=${`accordion_section_${e.uid}`}
|
|
@@ -1595,7 +1668,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1595
1668
|
${t}
|
|
1596
1669
|
</div>`}):d.nothing}
|
|
1597
1670
|
</div>
|
|
1598
|
-
`:d.html``}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
1671
|
+
`:d.html``}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Oi([b.consume({context:y.formContext}),o.property({attribute:!1})],Ct.prototype,"formContext",2),Oi([b.provide({context:y.layoutContext})],Ct.prototype,"adapter",2),Ct=Oi([o.customElement("gui-accordion-layout")],Ct);const Ku=Object.freeze(Object.defineProperty({__proto__:null,get AccordionElement(){return Ct}},Symbol.toStringTag,{value:"Module"}));var Ju=Object.defineProperty,Xu=Object.getOwnPropertyDescriptor,xi=(e,t,i,n)=>{for(var a=n>1?void 0:n?Xu(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&Ju(t,i,a),a};let St=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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 d.html`
|
|
1599
1672
|
<div class="gui-widget" id=${this.widget.uid}>
|
|
1600
1673
|
<div
|
|
1601
1674
|
role="alert"
|
|
@@ -1604,13 +1677,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
1604
1677
|
${this.adapter.templateData.text}
|
|
1605
1678
|
</div>
|
|
1606
1679
|
</div>
|
|
1607
|
-
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}}
|
|
1680
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};xi([b.consume({context:y.formContext}),o.property({attribute:!1})],St.prototype,"formContext",2),xi([b.provide({context:y.displayWidgetContext})],St.prototype,"adapter",2),St=xi([o.customElement("gui-alert-display")],St);const Qu=Object.freeze(Object.defineProperty({__proto__:null,get AlertElement(){return St}},Symbol.toStringTag,{value:"Module"}));var ju=Object.defineProperty,ep=Object.getOwnPropertyDescriptor,Ei=(e,t,i,n)=>{for(var a=n>1?void 0:n?ep(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&ju(t,i,a),a};let Ot=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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 d.html`
|
|
1608
1681
|
<div class="gui-widget" id=${this.widget.uid}>
|
|
1609
1682
|
<gui-markdown-text
|
|
1610
1683
|
.md=${this.adapter.templateData.md}
|
|
1611
1684
|
.dependencies=${this.adapter.templateData.deps}
|
|
1612
1685
|
></gui-markdown-text>
|
|
1613
1686
|
</div>
|
|
1614
|
-
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
1687
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Ei([b.consume({context:y.formContext}),o.property({attribute:!1})],Ot.prototype,"formContext",2),Ei([b.provide({context:y.displayWidgetContext})],Ot.prototype,"adapter",2),Ot=Ei([o.customElement("gui-markdown-text-display")],Ot);const tp=Object.freeze(Object.defineProperty({__proto__:null,get MarkdownTextElement(){return Ot}},Symbol.toStringTag,{value:"Module"}));var ip=Object.defineProperty,ap=Object.getOwnPropertyDescriptor,Pi=(e,t,i,n)=>{for(var a=n>1?void 0:n?ap(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(a=(n?r(t,i,a):r(a))||a);return n&&a&&ip(t,i,a),a};let xt=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new y.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 d.html`
|
|
1615
1688
|
<div class="gui-widget" id=${this.widget.uid}>${this.adapter.templateData.render}</div>
|
|
1616
|
-
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};
|
|
1689
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Pi([b.consume({context:y.formContext}),o.property({attribute:!1})],xt.prototype,"formContext",2),Pi([b.provide({context:y.displayWidgetContext})],xt.prototype,"adapter",2),xt=Pi([o.customElement("gui-renderer-component")],xt);const np=Object.freeze(Object.defineProperty({__proto__:null,get RendererElement(){return xt}},Symbol.toStringTag,{value:"Module"}));C.widgetLoaders=La,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})}));
|