@golemui/gui-lit 0.0.2
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 +529 -0
- package/README.md +7 -0
- package/accordion.element-D1RfC2ew.js +92 -0
- package/alert.element-B4rpyqGV.js +55 -0
- package/button.element-BnUBVNSH.js +58 -0
- package/calendar.element-D7mAbpAa.js +70 -0
- package/checkbox.element--Kc7sWBx.js +65 -0
- package/currency.element-D9dyGRBH.js +71 -0
- package/date-picker.element-Dcs5OpxN.js +136 -0
- package/date.element-na_Uywms.js +74 -0
- package/default-list-item-renderer-DNVEjKSX.js +23 -0
- package/dropdown.element-Cfj40aJz.js +225 -0
- package/flex.element-BSMOum-h.js +65 -0
- package/index.d.ts +2 -0
- package/index.js +2254 -0
- package/index.umd.cjs +535 -0
- package/lib/components/accordion.element.d.ts +21 -0
- package/lib/components/alert.element.d.ts +16 -0
- package/lib/components/button.element.d.ts +15 -0
- package/lib/components/calendar.element.d.ts +16 -0
- package/lib/components/checkbox.element.d.ts +17 -0
- package/lib/components/currency.element.d.ts +17 -0
- package/lib/components/date-picker.element.d.ts +26 -0
- package/lib/components/date.element.d.ts +18 -0
- package/lib/components/default-list-item-renderer.d.ts +2 -0
- package/lib/components/dropdown.element.d.ts +38 -0
- package/lib/components/flex.element.d.ts +16 -0
- package/lib/components/form.element.d.ts +21 -0
- package/lib/components/list.element.d.ts +25 -0
- package/lib/components/number.element.d.ts +17 -0
- package/lib/components/password.element.d.ts +17 -0
- package/lib/components/radiogroup.element.d.ts +17 -0
- package/lib/components/range-calendar.element.d.ts +16 -0
- package/lib/components/renderer.element.d.ts +15 -0
- package/lib/components/repeater.element.d.ts +18 -0
- package/lib/components/select.element.d.ts +18 -0
- package/lib/components/tabs.element.d.ts +27 -0
- package/lib/components/textarea.element.d.ts +17 -0
- package/lib/components/textinput.element.d.ts +17 -0
- package/lib/components/toggle.element.d.ts +17 -0
- package/lib/widget.loaders.d.ts +4 -0
- package/list.element--aj6sNNU.js +138 -0
- package/number.element-Bl5YReaL.js +69 -0
- package/package.json +34 -0
- package/password.element-CKmcH8Gn.js +70 -0
- package/radiogroup.element-Cn1lyyVE.js +67 -0
- package/range-calendar.element-C2YUElqM.js +70 -0
- package/renderer.element-B7AjPqr2.js +43 -0
- package/repeater.element-BfwzCooC.js +83 -0
- package/select.element-LWiqYxzA.js +73 -0
- package/tabs.element-DYg1wAz9.js +158 -0
- package/textarea.element-BXc-rLZE.js +70 -0
- package/textinput.element-x9LYeW8B.js +66 -0
- package/toggle.element-BP4YKWyR.js +65 -0
package/index.umd.cjs
ADDED
|
@@ -0,0 +1,535 @@
|
|
|
1
|
+
(function(_,Z){typeof exports=="object"&&typeof module<"u"?Z(exports,require("@golemui/gui-components"),require("@golemui/core"),require("@golemui/lit"),require("@golemui/gui-shared"),require("lit"),require("lit/decorators.js"),require("@lit/context"),require("lit/directives/class-map.js"),require("rxjs"),require("lit-html/directives/repeat.js"),require("lit-html/directives/if-defined.js")):typeof define=="function"&&define.amd?define(["exports","@golemui/gui-components","@golemui/core","@golemui/lit","@golemui/gui-shared","lit","lit/decorators.js","@lit/context","lit/directives/class-map.js","rxjs","lit-html/directives/repeat.js","lit-html/directives/if-defined.js"],Z):(_=typeof globalThis<"u"?globalThis:_||self,Z(_["gui-lit"]={},_.guiComponents,_.Core,_.Lit,_.guiShared,_.lit,_.decorators_js,_.context,_.classMap_js,_.rxjs,_.repeat_js,_.ifDefined_js))})(this,(function(_,Z,Ee,Xt,st,d,l,f,M,ot,K,Qt){"use strict";function ut(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const ct=ut(Ee),p=ut(Xt),Se={button:async()=>(await Promise.resolve().then(()=>Li)).ButtonElement,calendar:async()=>(await Promise.resolve().then(()=>ji)).CalendarElement,rangeCalendar:async()=>(await Promise.resolve().then(()=>Ui)).RangeCalendarElement,currency:async()=>(await Promise.resolve().then(()=>Ji)).CurrencyElement,dateInput:async()=>(await Promise.resolve().then(()=>Ki)).DateElement,datePicker:async()=>(await Promise.resolve().then(()=>Xi)).DatePickerElement,dropdown:async()=>(await Promise.resolve().then(()=>ts)).DropdownElement,list:async()=>(await Promise.resolve().then(()=>ns)).ListElement,password:async()=>(await Promise.resolve().then(()=>os)).PasswordElement,textinput:async()=>(await Promise.resolve().then(()=>ls)).TextinputElement,textarea:async()=>(await Promise.resolve().then(()=>hs)).TextareaElement,toggle:async()=>(await Promise.resolve().then(()=>gs)).ToggleElement,checkbox:async()=>(await Promise.resolve().then(()=>vs)).CheckboxElement,number:async()=>(await Promise.resolve().then(()=>ws)).NumberElement,radiogroup:async()=>(await Promise.resolve().then(()=>zs)).RadiogroupElement,select:async()=>(await Promise.resolve().then(()=>xs)).SelectElement,repeater:async()=>(await Promise.resolve().then(()=>Is)).RepeaterElement,flex:async()=>(await Promise.resolve().then(()=>Ts)).FlexElement,tabs:async()=>(await Promise.resolve().then(()=>Ls)).TabsElement,accordion:async()=>(await Promise.resolve().then(()=>js)).AccordionElement,alert:async()=>(await Promise.resolve().then(()=>Us)).AlertElement,renderer:async()=>(await Promise.resolve().then(()=>Js)).RendererElement},lt={stringValidator:e=>({type:"string",...e||{}}),booleanValidator:e=>({type:"boolean",...e||{}}),numberValidator:e=>({type:"number",...e||{}}),integerValidator:e=>({type:"integer",...e||{}})};function c(e,t,r){function a(o,u){if(o._zod||Object.defineProperty(o,"_zod",{value:{def:u,constr:i,traits:new Set},enumerable:!1}),o._zod.traits.has(e))return;o._zod.traits.add(e),t(o,u);const h=i.prototype,m=Object.keys(h);for(let b=0;b<m.length;b++){const $=m[b];$ in o||(o[$]=h[$].bind(o))}}const n=r?.Parent??Object;class s extends n{}Object.defineProperty(s,"name",{value:e});function i(o){var u;const h=r?.Parent?new s:this;a(h,o),(u=h._zod).deferred??(u.deferred=[]);for(const m of h._zod.deferred)m();return h}return Object.defineProperty(i,"init",{value:a}),Object.defineProperty(i,Symbol.hasInstance,{value:o=>r?.Parent&&o instanceof r.Parent?!0:o?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class V extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ie extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const er={};function j(e){return er}function ke(e,t){return typeof t=="bigint"?t.toString():t}function Ze(e){return e==null}function Te(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const dt=Symbol("evaluating");function v(e,t,r){let a;Object.defineProperty(e,t,{get(){if(a!==dt)return a===void 0&&(a=dt,a=r()),a},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function tr(...e){const t={};for(const r of e){const a=Object.getOwnPropertyDescriptors(r);Object.assign(t,a)}return Object.defineProperties({},t)}function rr(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const pt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ht(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Re(e){if(ht(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(ht(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function mt(e){return Re(e)?{...e}:Array.isArray(e)?[...e]:e}function Ae(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ft(e,t,r){const a=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(a._zod.parent=e),a}function g(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 ar={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 W(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function nr(e,t){return t.map(r=>{var a;return(a=r).path??(a.path=[]),r.path.unshift(e),r})}function _e(e){return typeof e=="string"?e:e?.message}function N(e,t,r){const a={...e,path:e.path??[]};if(!e.message){const n=_e(e.inst?._zod.def?.error?.(e))??_e(t?.error?.(e))??_e(r.customError?.(e))??_e(r.localeError?.(e))??"Invalid input";a.message=n}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function Le(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function H(...e){const[t,r,a]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:a}:{...t}}const gt=(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,ke,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},bt=c("$ZodError",gt),ve=c("$ZodError",gt,{Parent:Error});function ir(e,t=r=>r.message){const r={},a=[];for(const n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):a.push(t(n));return{formErrors:a,fieldErrors:r}}function sr(e,t=r=>r.message){const r={_errors:[]},a=n=>{for(const s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(i=>a({issues:i}));else if(s.code==="invalid_key")a({issues:s.issues});else if(s.code==="invalid_element")a({issues:s.issues});else if(s.path.length===0)r._errors.push(t(s));else{let i=r,o=0;for(;o<s.path.length;){const u=s.path[o];o===s.path.length-1?(i[u]=i[u]||{_errors:[]},i[u]._errors.push(t(s))):i[u]=i[u]||{_errors:[]},i=i[u],o++}}};return a(e),r}const $e=e=>(t,r,a,n)=>{const s=a?Object.assign(a,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new V;if(i.issues.length){const o=new(n?.Err??e)(i.issues.map(u=>N(u,s,j())));throw pt(o,n?.callee),o}return i.value},or=$e(ve),ye=e=>async(t,r,a,n)=>{const s=a?Object.assign(a,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const o=new(n?.Err??e)(i.issues.map(u=>N(u,s,j())));throw pt(o,n?.callee),o}return i.value},ur=ye(ve),we=e=>(t,r,a)=>{const n=a?{...a,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new V;return s.issues.length?{success:!1,error:new(e??bt)(s.issues.map(i=>N(i,n,j())))}:{success:!0,data:s.value}},_t=we(ve),Ce=e=>async(t,r,a)=>{const n=a?Object.assign(a,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(i=>N(i,n,j())))}:{success:!0,data:s.value}},vt=Ce(ve),cr=e=>(t,r,a)=>{const n=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return $e(e)(t,r,n)},lr=e=>(t,r,a)=>$e(e)(t,r,a),dr=e=>async(t,r,a)=>{const n=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return ye(e)(t,r,n)},pr=e=>async(t,r,a)=>ye(e)(t,r,a),hr=e=>(t,r,a)=>{const n=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return we(e)(t,r,n)},mr=e=>(t,r,a)=>we(e)(t,r,a),fr=e=>async(t,r,a)=>{const n=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return Ce(e)(t,r,n)},gr=e=>async(t,r,a)=>Ce(e)(t,r,a),br=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,$t=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)$/,_r=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,vr=/^(?:(?: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])$/,$r=/^(([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}|:))$/,yr=/^(?=.{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])?)*\.?$/,yt="(?:(?:\\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])))",wr=new RegExp(`^${yt}$`);function wt(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 Cr(e){return new RegExp(`^${wt(e)}$`)}function Dr(e){const t=wt({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${r.join("|")})`;return new RegExp(`^${yt}T(?:${a})$`)}const zr=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Or=/^-?\d+$/,Pr=/^-?\d+(?:\.\d+)?$/,xr=/^(?:true|false)$/i,Er=/^[^A-Z]*$/,Sr=/^[^a-z]*$/,P=c("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Ct={number:"number",bigint:"bigint",object:"date"},Ir=c("$ZodCheckLessThan",(e,t)=>{P.init(e,t);const r=Ct[typeof t.value];e._zod.onattach.push(a=>{const n=a._zod.bag,s=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),kr=c("$ZodCheckGreaterThan",(e,t)=>{P.init(e,t);const r=Ct[typeof t.value];e._zod.onattach.push(a=>{const n=a._zod.bag,s=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Zr=c("$ZodCheckNumberFormat",(e,t)=>{P.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),a=r?"int":"number",[n,s]=ar[t.format];e._zod.onattach.push(i=>{const o=i._zod.bag;o.format=t.format,o.minimum=n,o.maximum=s,r&&(o.pattern=Or)}),e._zod.check=i=>{const o=i.value;if(r){if(!Number.isInteger(o)){i.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:o,inst:e});return}if(!Number.isSafeInteger(o)){o>0?i.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):i.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort});return}}o<n&&i.issues.push({origin:"number",input:o,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),o>s&&i.issues.push({origin:"number",input:o,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),Tr=c("$ZodCheckMaxLength",(e,t)=>{var r;P.init(e,t),(r=e._zod.def).when??(r.when=a=>{const n=a.value;return!Ze(n)&&n.length!==void 0}),e._zod.onattach.push(a=>{const n=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const n=a.value;if(n.length<=t.maximum)return;const i=Le(n);a.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Rr=c("$ZodCheckMinLength",(e,t)=>{var r;P.init(e,t),(r=e._zod.def).when??(r.when=a=>{const n=a.value;return!Ze(n)&&n.length!==void 0}),e._zod.onattach.push(a=>{const n=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const n=a.value;if(n.length>=t.minimum)return;const i=Le(n);a.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Ar=c("$ZodCheckLengthEquals",(e,t)=>{var r;P.init(e,t),(r=e._zod.def).when??(r.when=a=>{const n=a.value;return!Ze(n)&&n.length!==void 0}),e._zod.onattach.push(a=>{const n=a._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=a=>{const n=a.value,s=n.length;if(s===t.length)return;const i=Le(n),o=s>t.length;a.issues.push({origin:i,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),De=c("$ZodCheckStringFormat",(e,t)=>{var r,a;P.init(e,t),e._zod.onattach.push(n=>{const s=n._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),Lr=c("$ZodCheckRegex",(e,t)=>{De.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Fr=c("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Er),De.init(e,t)}),Mr=c("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Sr),De.init(e,t)}),jr=c("$ZodCheckIncludes",(e,t)=>{P.init(e,t);const r=Ae(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=a,e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(a)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Nr=c("$ZodCheckStartsWith",(e,t)=>{P.init(e,t);const r=new RegExp(`^${Ae(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(a=>{const n=a._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),qr=c("$ZodCheckEndsWith",(e,t)=>{P.init(e,t);const r=new RegExp(`.*${Ae(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(a=>{const n=a._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),Ur=c("$ZodCheckOverwrite",(e,t)=>{P.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}}),Vr={major:4,minor:3,patch:6},w=c("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Vr;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const n of a)for(const s of n._zod.onattach)s(e);if(a.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const n=(i,o,u)=>{let h=W(i),m;for(const b of o){if(b._zod.def.when){if(!b._zod.def.when(i))continue}else if(h)continue;const $=i.issues.length,y=b._zod.check(i);if(y instanceof Promise&&u?.async===!1)throw new V;if(m||y instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await y,i.issues.length!==$&&(h||(h=W(i,$)))});else{if(i.issues.length===$)continue;h||(h=W(i,$))}}return m?m.then(()=>i):i},s=(i,o,u)=>{if(W(i))return i.aborted=!0,i;const h=n(o,a,u);if(h instanceof Promise){if(u.async===!1)throw new V;return h.then(m=>e._zod.parse(m,u))}return e._zod.parse(h,u)};e._zod.run=(i,o)=>{if(o.skipChecks)return e._zod.parse(i,o);if(o.direction==="backward"){const h=e._zod.parse({value:i.value,issues:[]},{...o,skipChecks:!0});return h instanceof Promise?h.then(m=>s(m,i,o)):s(h,i,o)}const u=e._zod.parse(i,o);if(u instanceof Promise){if(o.async===!1)throw new V;return u.then(h=>n(h,a,o))}return n(u,a,o)}}v(e,"~standard",()=>({validate:n=>{try{const s=_t(e,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return vt(e,n).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),Fe=c("$ZodString",(e,t)=>{w.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??zr(e._zod.bag),e._zod.parse=(r,a)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),x=c("$ZodStringFormat",(e,t)=>{De.init(e,t),Fe.init(e,t)}),Wr=c("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=$t(a))}else t.pattern??(t.pattern=$t());x.init(e,t)}),Jr=c("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=_r),x.init(e,t)}),Br=c("$ZodURL",(e,t)=>{x.init(e,t),e._zod.check=r=>{try{const a=r.value.trim(),n=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=a;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Gr=c("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Dr(t)),x.init(e,t)}),Kr=c("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=wr),x.init(e,t)}),Hr=c("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Cr(t)),x.init(e,t)}),Yr=c("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=br),x.init(e,t)}),Xr=c("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=vr),x.init(e,t),e._zod.bag.format="ipv4"}),Qr=c("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=$r),x.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),ea=c("$ZodCustomStringFormat",(e,t)=>{x.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Dt=c("$ZodNumber",(e,t)=>{w.init(e,t),e._zod.pattern=e._zod.bag.pattern??Pr,e._zod.parse=(r,a)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;const s=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),r}}),ta=c("$ZodNumberFormat",(e,t)=>{Zr.init(e,t),Dt.init(e,t)}),ra=c("$ZodBoolean",(e,t)=>{w.init(e,t),e._zod.pattern=xr,e._zod.parse=(r,a)=>{if(t.coerce)try{r.value=!!r.value}catch{}const n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),aa=c("$ZodAny",(e,t)=>{w.init(e,t),e._zod.parse=r=>r});function zt(e,t,r){e.issues.length&&t.issues.push(...nr(r,e.issues)),t.value[r]=e.value}const na=c("$ZodArray",(e,t)=>{w.init(e,t),e._zod.parse=(r,a)=>{const n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);const s=[];for(let i=0;i<n.length;i++){const o=n[i],u=t.element._zod.run({value:o,issues:[]},a);u instanceof Promise?s.push(u.then(h=>zt(h,r,i))):zt(u,r,i)}return s.length?Promise.all(s).then(()=>r):r}});function Ot(e,t,r,a){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const n=e.filter(s=>!W(s));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(i=>N(i,a,j())))}),t)}const ia=c("$ZodUnion",(e,t)=>{w.init(e,t),v(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),v(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),v(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),v(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${n.map(s=>Te(s.source)).join("|")})$`)}});const r=t.options.length===1,a=t.options[0]._zod.run;e._zod.parse=(n,s)=>{if(r)return a(n,s);let i=!1;const o=[];for(const u of t.options){const h=u._zod.run({value:n.value,issues:[]},s);if(h instanceof Promise)o.push(h),i=!0;else{if(h.issues.length===0)return h;o.push(h)}}return i?Promise.all(o).then(u=>Ot(u,n,e,s)):Ot(o,n,e,s)}}),sa=c("$ZodIntersection",(e,t)=>{w.init(e,t),e._zod.parse=(r,a)=>{const n=r.value,s=t.left._zod.run({value:n,issues:[]},a),i=t.right._zod.run({value:n,issues:[]},a);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([u,h])=>Pt(r,u,h)):Pt(r,s,i)}});function Me(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(Re(e)&&Re(t)){const r=Object.keys(t),a=Object.keys(e).filter(s=>r.indexOf(s)!==-1),n={...e,...t};for(const s of a){const i=Me(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};n[s]=i.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let a=0;a<e.length;a++){const n=e[a],s=t[a],i=Me(n,s);if(!i.valid)return{valid:!1,mergeErrorPath:[a,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Pt(e,t,r){const a=new Map;let n;for(const o of t.issues)if(o.code==="unrecognized_keys"){n??(n=o);for(const u of o.keys)a.has(u)||a.set(u,{}),a.get(u).l=!0}else e.issues.push(o);for(const o of r.issues)if(o.code==="unrecognized_keys")for(const u of o.keys)a.has(u)||a.set(u,{}),a.get(u).r=!0;else e.issues.push(o);const s=[...a].filter(([,o])=>o.l&&o.r).map(([o])=>o);if(s.length&&n&&e.issues.push({...n,keys:s}),W(e))return e;const i=Me(t.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const oa=c("$ZodTransform",(e,t)=>{w.init(e,t),e._zod.parse=(r,a)=>{if(a.direction==="backward")throw new Ie(e.constructor.name);const n=t.transform(r.value,r);if(a.async)return(n instanceof Promise?n:Promise.resolve(n)).then(i=>(r.value=i,r));if(n instanceof Promise)throw new V;return r.value=n,r}});function xt(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const je=c("$ZodOptional",(e,t)=>{w.init(e,t),e._zod.optin="optional",e._zod.optout="optional",v(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),v(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Te(r.source)})?$`):void 0}),e._zod.parse=(r,a)=>{if(t.innerType._zod.optin==="optional"){const n=t.innerType._zod.run(r,a);return n instanceof Promise?n.then(s=>xt(s,r.value)):xt(n,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,a)}}),ua=c("$ZodExactOptional",(e,t)=>{je.init(e,t),v(e._zod,"values",()=>t.innerType._zod.values),v(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,a)=>t.innerType._zod.run(r,a)}),ca=c("$ZodNullable",(e,t)=>{w.init(e,t),v(e._zod,"optin",()=>t.innerType._zod.optin),v(e._zod,"optout",()=>t.innerType._zod.optout),v(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Te(r.source)}|null)$`):void 0}),v(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,a)=>r.value===null?r:t.innerType._zod.run(r,a)}),la=c("$ZodDefault",(e,t)=>{w.init(e,t),e._zod.optin="optional",v(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,a)=>{if(a.direction==="backward")return t.innerType._zod.run(r,a);if(r.value===void 0)return r.value=t.defaultValue,r;const n=t.innerType._zod.run(r,a);return n instanceof Promise?n.then(s=>Et(s,t)):Et(n,t)}});function Et(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const da=c("$ZodPrefault",(e,t)=>{w.init(e,t),e._zod.optin="optional",v(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,a)=>(a.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,a))}),pa=c("$ZodNonOptional",(e,t)=>{w.init(e,t),v(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(a=>a!==void 0)):void 0}),e._zod.parse=(r,a)=>{const n=t.innerType._zod.run(r,a);return n instanceof Promise?n.then(s=>St(s,e)):St(n,e)}});function St(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 ha=c("$ZodSuccess",(e,t)=>{w.init(e,t),e._zod.parse=(r,a)=>{if(a.direction==="backward")throw new Ie("ZodSuccess");const n=t.innerType._zod.run(r,a);return n instanceof Promise?n.then(s=>(r.value=s.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),ma=c("$ZodCatch",(e,t)=>{w.init(e,t),v(e._zod,"optin",()=>t.innerType._zod.optin),v(e._zod,"optout",()=>t.innerType._zod.optout),v(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,a)=>{if(a.direction==="backward")return t.innerType._zod.run(r,a);const n=t.innerType._zod.run(r,a);return n instanceof Promise?n.then(s=>(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(i=>N(i,a,j()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=t.catchValue({...r,error:{issues:n.issues.map(s=>N(s,a,j()))},input:r.value}),r.issues=[]),r)}}),fa=c("$ZodPipe",(e,t)=>{w.init(e,t),v(e._zod,"values",()=>t.in._zod.values),v(e._zod,"optin",()=>t.in._zod.optin),v(e._zod,"optout",()=>t.out._zod.optout),v(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,a)=>{if(a.direction==="backward"){const s=t.out._zod.run(r,a);return s instanceof Promise?s.then(i=>ze(i,t.in,a)):ze(s,t.in,a)}const n=t.in._zod.run(r,a);return n instanceof Promise?n.then(s=>ze(s,t.out,a)):ze(n,t.out,a)}});function ze(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const ga=c("$ZodReadonly",(e,t)=>{w.init(e,t),v(e._zod,"propValues",()=>t.innerType._zod.propValues),v(e._zod,"values",()=>t.innerType._zod.values),v(e._zod,"optin",()=>t.innerType?._zod?.optin),v(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,a)=>{if(a.direction==="backward")return t.innerType._zod.run(r,a);const n=t.innerType._zod.run(r,a);return n instanceof Promise?n.then(It):It(n)}});function It(e){return e.value=Object.freeze(e.value),e}const kt=c("$ZodCustom",(e,t)=>{P.init(e,t),w.init(e,t),e._zod.parse=(r,a)=>r,e._zod.check=r=>{const a=r.value,n=t.fn(a);if(n instanceof Promise)return n.then(s=>Zt(s,r,a,e));Zt(n,r,a,e)}});function Zt(e,t,r,a){if(!e){const n={code:"custom",input:r,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(n.params=a._zod.def.params),t.issues.push(H(n))}}var Tt;class ba{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const a=r[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const a={...this.get(r)??{}};delete a.id;const n={...a,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function _a(){return new ba}(Tt=globalThis).__zod_globalRegistry??(Tt.__zod_globalRegistry=_a());const Y=globalThis.__zod_globalRegistry;function va(e,t){return new e({type:"string",...g(t)})}function $a(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...g(t)})}function ya(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...g(t)})}function wa(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...g(t)})}function Ca(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...g(t)})}function Da(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...g(t)})}function za(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...g(t)})}function Oa(e,t){return new e({type:"string",format:"date",check:"string_format",...g(t)})}function Pa(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...g(t)})}function xa(e,t){return new e({type:"string",format:"duration",check:"string_format",...g(t)})}function Ea(e,t){return new e({type:"number",checks:[],...g(t)})}function Sa(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...g(t)})}function Ia(e,t){return new e({type:"boolean",...g(t)})}function ka(e){return new e({type:"any"})}function Za(e,t){return new Ir({check:"less_than",...g(t),value:e,inclusive:!0})}function Ta(e,t){return new kr({check:"greater_than",...g(t),value:e,inclusive:!0})}function Ne(e,t){return new Tr({check:"max_length",...g(t),maximum:e})}function X(e,t){return new Rr({check:"min_length",...g(t),minimum:e})}function Rt(e,t){return new Ar({check:"length_equals",...g(t),length:e})}function At(e,t){return new Lr({check:"string_format",format:"regex",...g(t),pattern:e})}function Ra(e){return new Fr({check:"string_format",format:"lowercase",...g(e)})}function Aa(e){return new Mr({check:"string_format",format:"uppercase",...g(e)})}function La(e,t){return new jr({check:"string_format",format:"includes",...g(t),includes:e})}function Fa(e,t){return new Nr({check:"string_format",format:"starts_with",...g(t),prefix:e})}function Ma(e,t){return new qr({check:"string_format",format:"ends_with",...g(t),suffix:e})}function J(e){return new Ur({check:"overwrite",tx:e})}function ja(e){return J(t=>t.normalize(e))}function Na(){return J(e=>e.trim())}function qa(){return J(e=>e.toLowerCase())}function Ua(){return J(e=>e.toUpperCase())}function Va(){return J(e=>rr(e))}function Wa(e,t,r){return new e({type:"array",element:t,...g(r)})}function Lt(e,t,r){return new e({type:"custom",check:"custom",fn:t,...g(r)})}function Ft(e){const t=Ja(r=>(r.addIssue=a=>{if(typeof a=="string")r.issues.push(H(a,r.value,t._zod.def));else{const n=a;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),r.issues.push(H(n))}},e(r.value,r)));return t}function Ja(e,t){const r=new P({check:"custom",...g(t)});return r._zod.check=e,r}function Ba(e,t,r,a={}){const n=g(a),s={...g(a),check:"string_format",type:"string",format:t,fn:typeof r=="function"?r:o=>r.test(o),...n};return r instanceof RegExp&&(s.pattern=r),new e(s)}function Mt(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??Y,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 C(e,t,r={path:[],schemaPath:[]}){var a;const n=e._zod.def,s=t.seen.get(e);if(s)return s.count++,r.schemaPath.includes(e)&&(s.cycle=r.path),s.schema;const i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i);const o=e._zod.toJSONSchema?.();if(o)i.schema=o;else{const m={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,m);else{const $=i.schema,y=t.processors[n.type];if(!y)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);y(e,t,$,m)}const b=e._zod.parent;b&&(i.ref||(i.ref=b),C(b,t,m),t.seen.get(b).isParent=!0)}const u=t.metadataRegistry.get(e);return u&&Object.assign(i.schema,u),t.io==="input"&&D(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&i.schema._prefault&&((a=i.schema).default??(a.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function jt(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const i of e.seen.entries()){const o=e.metadataRegistry.get(i[0])?.id;if(o){const u=a.get(o);if(u&&u!==i[0])throw new Error(`Duplicate schema id "${o}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(o,i[0])}}const n=i=>{const o=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const b=e.external.registry.get(i[0])?.id,$=e.external.uri??(be=>be);if(b)return{ref:$(b)};const y=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=y,{defId:y,ref:`${$("__shared")}#/${o}/${y}`}}if(i[1]===r)return{ref:"#"};const h=`#/${o}/`,m=i[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:h+m}},s=i=>{if(i[1].schema.$ref)return;const o=i[1],{ref:u,defId:h}=n(i);o.def={...o.schema},h&&(o.defId=h);const m=o.schema;for(const b in m)delete m[b];m.$ref=u};if(e.cycles==="throw")for(const i of e.seen.entries()){const o=i[1];if(o.cycle)throw new Error(`Cycle detected: #/${o.cycle?.join("/")}/<root>
|
|
2
|
+
|
|
3
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const o=i[1];if(t===i[0]){s(i);continue}if(e.external){const h=e.external.registry.get(i[0])?.id;if(t!==i[0]&&h){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(o.cycle){s(i);continue}if(o.count>1&&e.reused==="ref"){s(i);continue}}}function Nt(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=i=>{const o=e.seen.get(i);if(o.ref===null)return;const u=o.def??o.schema,h={...u},m=o.ref;if(o.ref=null,m){a(m);const $=e.seen.get(m),y=$.schema;if(y.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(y)):Object.assign(u,y),Object.assign(u,h),i._zod.parent===m)for(const k in u)k==="$ref"||k==="allOf"||k in h||delete u[k];if(y.$ref&&$.def)for(const k in u)k==="$ref"||k==="allOf"||k in $.def&&JSON.stringify(u[k])===JSON.stringify($.def[k])&&delete u[k]}const b=i._zod.parent;if(b&&b!==m){a(b);const $=e.seen.get(b);if($?.schema.$ref&&(u.$ref=$.schema.$ref,$.def))for(const y in u)y==="$ref"||y==="allOf"||y in $.def&&JSON.stringify(u[y])===JSON.stringify($.def[y])&&delete u[y]}e.override({zodSchema:i,jsonSchema:u,path:o.path??[]})};for(const i of[...e.seen.entries()].reverse())a(i[0]);const n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const i=e.external.registry.get(t)?.id;if(!i)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(i)}Object.assign(n,r.def??r.schema);const s=e.external?.defs??{};for(const i of e.seen.entries()){const o=i[1];o.def&&o.defId&&(s[o.defId]=o.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?n.$defs=s:n.definitions=s);try{const i=JSON.parse(JSON.stringify(n));return Object.defineProperty(i,"~standard",{value:{...t["~standard"],jsonSchema:{input:Oe(t,"input",e.processors),output:Oe(t,"output",e.processors)}},enumerable:!1,writable:!1}),i}catch{throw new Error("Error converting schema to JSON.")}}function D(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return D(a.element,r);if(a.type==="set")return D(a.valueType,r);if(a.type==="lazy")return D(a.getter(),r);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return D(a.innerType,r);if(a.type==="intersection")return D(a.left,r)||D(a.right,r);if(a.type==="record"||a.type==="map")return D(a.keyType,r)||D(a.valueType,r);if(a.type==="pipe")return D(a.in,r)||D(a.out,r);if(a.type==="object"){for(const n in a.shape)if(D(a.shape[n],r))return!0;return!1}if(a.type==="union"){for(const n of a.options)if(D(n,r))return!0;return!1}if(a.type==="tuple"){for(const n of a.items)if(D(n,r))return!0;return!!(a.rest&&D(a.rest,r))}return!1}const Ga=(e,t={})=>r=>{const a=Mt({...r,processors:t});return C(e,a),jt(a,e),Nt(a,e)},Oe=(e,t,r={})=>a=>{const{libraryOptions:n,target:s}=a??{},i=Mt({...n??{},target:s,io:t,processors:r});return C(e,i),jt(i,e),Nt(i,e)},Ka={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ha=(e,t,r,a)=>{const n=r;n.type="string";const{minimum:s,maximum:i,format:o,patterns:u,contentEncoding:h}=e._zod.bag;if(typeof s=="number"&&(n.minLength=s),typeof i=="number"&&(n.maxLength=i),o&&(n.format=Ka[o]??o,n.format===""&&delete n.format,o==="time"&&delete n.format),h&&(n.contentEncoding=h),u&&u.size>0){const m=[...u];m.length===1?n.pattern=m[0].source:m.length>1&&(n.allOf=[...m.map(b=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:b.source}))])}},Ya=(e,t,r,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Xa=(e,t,r,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Qa=(e,t,r,a)=>{const n=r,s=e._zod.def,{minimum:i,maximum:o}=e._zod.bag;typeof i=="number"&&(n.minItems=i),typeof o=="number"&&(n.maxItems=o),n.type="array",n.items=C(s.element,t,{...a,path:[...a.path,"items"]})},en=(e,t,r,a)=>{const n=e._zod.def,s=n.inclusive===!1,i=n.options.map((o,u)=>C(o,t,{...a,path:[...a.path,s?"oneOf":"anyOf",u]}));s?r.oneOf=i:r.anyOf=i},tn=(e,t,r,a)=>{const n=e._zod.def,s=C(n.left,t,{...a,path:[...a.path,"allOf",0]}),i=C(n.right,t,{...a,path:[...a.path,"allOf",1]}),o=h=>"allOf"in h&&Object.keys(h).length===1,u=[...o(s)?s.allOf:[s],...o(i)?i.allOf:[i]];r.allOf=u},rn=(e,t,r,a)=>{const n=e._zod.def,s=C(n.innerType,t,a),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=n.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},an=(e,t,r,a)=>{const n=e._zod.def;C(n.innerType,t,a);const s=t.seen.get(e);s.ref=n.innerType},nn=(e,t,r,a)=>{const n=e._zod.def;C(n.innerType,t,a);const s=t.seen.get(e);s.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},sn=(e,t,r,a)=>{const n=e._zod.def;C(n.innerType,t,a);const s=t.seen.get(e);s.ref=n.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},on=(e,t,r,a)=>{const n=e._zod.def;C(n.innerType,t,a);const s=t.seen.get(e);s.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},un=(e,t,r,a)=>{const n=e._zod.def,s=t.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;C(s,t,a);const i=t.seen.get(e);i.ref=s},cn=(e,t,r,a)=>{const n=e._zod.def;C(n.innerType,t,a);const s=t.seen.get(e);s.ref=n.innerType,r.readOnly=!0},qt=(e,t,r,a)=>{const n=e._zod.def;C(n.innerType,t,a);const s=t.seen.get(e);s.ref=n.innerType},ln=c("ZodISODateTime",(e,t)=>{Gr.init(e,t),Pe.init(e,t)});function dn(e){return za(ln,e)}const pn=c("ZodISODate",(e,t)=>{Kr.init(e,t),Pe.init(e,t)});function hn(e){return Oa(pn,e)}const mn=c("ZodISOTime",(e,t)=>{Hr.init(e,t),Pe.init(e,t)});function fn(e){return Pa(mn,e)}const gn=c("ZodISODuration",(e,t)=>{Yr.init(e,t),Pe.init(e,t)});function bn(e){return xa(gn,e)}const E=c("ZodError",(e,t)=>{bt.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>sr(e,r)},flatten:{value:r=>ir(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,ke,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,ke,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),_n=$e(E),vn=ye(E),$n=we(E),yn=Ce(E),wn=cr(E),Cn=lr(E),Dn=dr(E),zn=pr(E),On=hr(E),Pn=mr(E),xn=fr(E),En=gr(E),z=c("ZodType",(e,t)=>(w.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Oe(e,"input"),output:Oe(e,"output")}}),e.toJSONSchema=Ga(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(tr(t,{checks:[...t.checks??[],...r.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]}),{parent:!0}),e.with=e.check,e.clone=(r,a)=>ft(e,r,a),e.brand=()=>e,e.register=((r,a)=>(r.add(e,a),e)),e.parse=(r,a)=>_n(e,r,a,{callee:e.parse}),e.safeParse=(r,a)=>$n(e,r,a),e.parseAsync=async(r,a)=>vn(e,r,a,{callee:e.parseAsync}),e.safeParseAsync=async(r,a)=>yn(e,r,a),e.spa=e.safeParseAsync,e.encode=(r,a)=>wn(e,r,a),e.decode=(r,a)=>Cn(e,r,a),e.encodeAsync=async(r,a)=>Dn(e,r,a),e.decodeAsync=async(r,a)=>zn(e,r,a),e.safeEncode=(r,a)=>On(e,r,a),e.safeDecode=(r,a)=>Pn(e,r,a),e.safeEncodeAsync=async(r,a)=>xn(e,r,a),e.safeDecodeAsync=async(r,a)=>En(e,r,a),e.refine=(r,a)=>e.check(ti(r,a)),e.superRefine=r=>e.check(ri(r)),e.overwrite=r=>e.check(J(r)),e.optional=()=>Ut(e),e.exactOptional=()=>Nn(e),e.nullable=()=>Vt(e),e.nullish=()=>Ut(Vt(e)),e.nonoptional=r=>Gn(e,r),e.array=()=>kn(e),e.or=r=>Tn([e,r]),e.and=r=>An(e,r),e.transform=r=>Wt(e,Fn(r)),e.default=r=>Vn(e,r),e.prefault=r=>Jn(e,r),e.catch=r=>Hn(e,r),e.pipe=r=>Wt(e,r),e.readonly=()=>Qn(e),e.describe=r=>{const a=e.clone();return Y.add(a,{description:r}),a},Object.defineProperty(e,"description",{get(){return Y.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Y.get(e);const a=e.clone();return Y.add(a,r[0]),a},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),Sn=c("_ZodString",(e,t)=>{Fe.init(e,t),z.init(e,t),e._zod.processJSONSchema=(a,n,s)=>Ha(e,a,n);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...a)=>e.check(At(...a)),e.includes=(...a)=>e.check(La(...a)),e.startsWith=(...a)=>e.check(Fa(...a)),e.endsWith=(...a)=>e.check(Ma(...a)),e.min=(...a)=>e.check(X(...a)),e.max=(...a)=>e.check(Ne(...a)),e.length=(...a)=>e.check(Rt(...a)),e.nonempty=(...a)=>e.check(X(1,...a)),e.lowercase=a=>e.check(Ra(a)),e.uppercase=a=>e.check(Aa(a)),e.trim=()=>e.check(Na()),e.normalize=(...a)=>e.check(ja(...a)),e.toLowerCase=()=>e.check(qa()),e.toUpperCase=()=>e.check(Ua()),e.slugify=()=>e.check(Va())}),Pe=c("ZodStringFormat",(e,t)=>{x.init(e,t),Sn.init(e,t)}),In=c("ZodArray",(e,t)=>{na.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,a,n)=>Qa(e,r,a,n),e.element=t.element,e.min=(r,a)=>e.check(X(r,a)),e.nonempty=r=>e.check(X(1,r)),e.max=(r,a)=>e.check(Ne(r,a)),e.length=(r,a)=>e.check(Rt(r,a)),e.unwrap=()=>e.element});function kn(e,t){return Wa(In,e,t)}const Zn=c("ZodUnion",(e,t)=>{ia.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,a,n)=>en(e,r,a,n),e.options=t.options});function Tn(e,t){return new Zn({type:"union",options:e,...g(t)})}const Rn=c("ZodIntersection",(e,t)=>{sa.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,a,n)=>tn(e,r,a,n)});function An(e,t){return new Rn({type:"intersection",left:e,right:t})}const Ln=c("ZodTransform",(e,t)=>{oa.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,a,n)=>Xa(e,r),e._zod.parse=(r,a)=>{if(a.direction==="backward")throw new Ie(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(H(s,r.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(H(i))}};const n=t.transform(r.value,r);return n instanceof Promise?n.then(s=>(r.value=s,r)):(r.value=n,r)}});function Fn(e){return new Ln({type:"transform",transform:e})}const Mn=c("ZodOptional",(e,t)=>{je.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,a,n)=>qt(e,r,a,n),e.unwrap=()=>e._zod.def.innerType});function Ut(e){return new Mn({type:"optional",innerType:e})}const jn=c("ZodExactOptional",(e,t)=>{ua.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,a,n)=>qt(e,r,a,n),e.unwrap=()=>e._zod.def.innerType});function Nn(e){return new jn({type:"optional",innerType:e})}const qn=c("ZodNullable",(e,t)=>{ca.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,a,n)=>rn(e,r,a,n),e.unwrap=()=>e._zod.def.innerType});function Vt(e){return new qn({type:"nullable",innerType:e})}const Un=c("ZodDefault",(e,t)=>{la.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,a,n)=>nn(e,r,a,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Vn(e,t){return new Un({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():mt(t)}})}const Wn=c("ZodPrefault",(e,t)=>{da.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,a,n)=>sn(e,r,a,n),e.unwrap=()=>e._zod.def.innerType});function Jn(e,t){return new Wn({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():mt(t)}})}const Bn=c("ZodNonOptional",(e,t)=>{pa.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,a,n)=>an(e,r,a,n),e.unwrap=()=>e._zod.def.innerType});function Gn(e,t){return new Bn({type:"nonoptional",innerType:e,...g(t)})}const Kn=c("ZodCatch",(e,t)=>{ma.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,a,n)=>on(e,r,a,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Hn(e,t){return new Kn({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Yn=c("ZodPipe",(e,t)=>{fa.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,a,n)=>un(e,r,a,n),e.in=t.in,e.out=t.out});function Wt(e,t){return new Yn({type:"pipe",in:e,out:t})}const Xn=c("ZodReadonly",(e,t)=>{ga.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,a,n)=>cn(e,r,a,n),e.unwrap=()=>e._zod.def.innerType});function Qn(e){return new Xn({type:"readonly",innerType:e})}const ei=c("ZodCustom",(e,t)=>{kt.init(e,t),z.init(e,t),e._zod.processJSONSchema=(r,a,n)=>Ya(e,r)});function ti(e,t={}){return Lt(ei,e,t)}function ri(e){return Ft(e)}const q=c("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");w.init(e,t),e.def=t,e.type=t.type,e.parse=(r,a)=>or(e,r,a,{callee:e.parse}),e.safeParse=(r,a)=>_t(e,r,a),e.parseAsync=async(r,a)=>ur(e,r,a,{callee:e.parseAsync}),e.safeParseAsync=async(r,a)=>vt(e,r,a),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(a=>typeof a=="function"?{_zod:{check:a,def:{check:"custom"},onattach:[]}}:a)]},{parent:!0}),e.with=e.check,e.clone=(r,a)=>ft(e,r,a),e.brand=()=>e,e.register=((r,a)=>(r.add(e,a),e)),e.apply=r=>r(e)}),Jt=c("ZodMiniString",(e,t)=>{Fe.init(e,t),q.init(e,t)});function ai(e){return va(Jt,e)}const B=c("ZodMiniStringFormat",(e,t)=>{x.init(e,t),Jt.init(e,t)}),ni=c("ZodMiniEmail",(e,t)=>{Jr.init(e,t),B.init(e,t)});function ii(e){return $a(ni,e)}const si=c("ZodMiniUUID",(e,t)=>{Wr.init(e,t),B.init(e,t)});function oi(e){return ya(si,e)}const ui=c("ZodMiniURL",(e,t)=>{Br.init(e,t),B.init(e,t)});function ci(e){return wa(ui,e)}const li=c("ZodMiniIPv4",(e,t)=>{Xr.init(e,t),B.init(e,t)});function di(e){return Ca(li,e)}const pi=c("ZodMiniIPv6",(e,t)=>{Qr.init(e,t),B.init(e,t)});function hi(e){return Da(pi,e)}const mi=c("ZodMiniCustomStringFormat",(e,t)=>{ea.init(e,t),B.init(e,t)});function fi(e){return Ba(mi,"hostname",yr,e)}const Bt=c("ZodMiniNumber",(e,t)=>{Dt.init(e,t),q.init(e,t)});function gi(e){return Ea(Bt,e)}const bi=c("ZodMiniNumberFormat",(e,t)=>{ta.init(e,t),Bt.init(e,t)});function _i(e){return Sa(bi,e)}const vi=c("ZodMiniBoolean",(e,t)=>{ra.init(e,t),q.init(e,t)});function $i(e){return Ia(vi,e)}const yi=c("ZodMiniAny",(e,t)=>{aa.init(e,t),q.init(e,t)});function Gt(){return ka(yi)}const wi=c("ZodMiniOptional",(e,t)=>{je.init(e,t),q.init(e,t)});function Ci(e){return new wi({type:"optional",innerType:e})}const Di=c("ZodMiniSuccess",(e,t)=>{ha.init(e,t),q.init(e,t)});function zi(e){return new Di({type:"success",innerType:e})}const Oi=c("ZodMiniCustom",(e,t)=>{kt.init(e,t),q.init(e,t)});function T(e,t={}){return Lt(Oi,e,t)}function Pi(e){return Ft(e)}const Kt={email:{schema:ii()},hostname:{schema:fi()},ipv4:{schema:di()},ipv6:{schema:hi()},url:{schema:ci()},uuid:{schema:oi()},date:{schema:hn()},time:{schema:fn()},"date-time":{schema:dn()},duration:{schema:bn()}},xi=Object.keys(Kt),Ht=e=>t=>{switch(t.type){case"string":return Ei(t);case"integer":case"number":return Si(t);case"boolean":return Ii(t);case"array":return console.warn("TODO: array validator not yet supported"),zi(Gt());case"custom":{if(!e)throw new Error('Validator type "custom" requires a customValidators object, but it was not supplied.');return ki(t,e)}}};function Ei(e){return xe(e,t=>{let r=ai();if(t.required===!0&&(r=r.check(T(a=>a.length>0,{error:"This field is required"}))),typeof t.minLength=="number"&&(r=r.check(X(t.minLength))),typeof t.maxLength=="number"&&(r=r.check(Ne(t.maxLength))),typeof t.pattern=="string"&&(r=r.check(At(new RegExp(t.pattern)))),t.enum){const a=t.enum;r=r.check(T(n=>a.includes(n)))}return t.const!==void 0&&(r=r.check(T(a=>a===t.const))),t.format!==void 0&&(xi.includes(t.format)?r=r.check(Kt[t.format].schema):console.error(`The string validation format "${t.format}" is not supported`)),r})}function Si(e){return xe(e,t=>{let r=gi();if(t.type==="integer"&&(r=r.check(_i())),t.minimum!==void 0&&(r=r.check(Ta(t.minimum))),t.maximum!==void 0&&(r=r.check(Za(t.maximum))),t.exclusiveMinimum!==void 0){const a=t.exclusiveMinimum;r=r.check(T(n=>n>a))}if(t.exclusiveMaximum!==void 0){const a=t.exclusiveMaximum;r=r.check(T(n=>n<a))}if(t.multipleOf!==void 0){const a=t.multipleOf;r=r.check(T(n=>n%a===0))}if(t.enum){const a=t.enum;r=r.check(T(n=>a.includes(n)))}return t.const!==void 0&&(r=r.check(T(a=>a===t.const))),r})}function Ii(e){return xe(e,t=>{let r=$i();return t.const!==void 0&&(r=r.check(T(a=>a===t.const))),r})}function ki(e,t){return xe(e,r=>{let a=Gt();return Object.keys(r).filter(n=>n!=="type"&&n!=="required").forEach(n=>{const s=r[n],i=t[n],o=i(s);a=a.check(Pi((u,h)=>{const m=Ee.standardValidate(o,u);if(!Ee.isStandardValidateSuccess(m)){const b=m.issues[0];h.addIssue({code:"custom",path:[],message:b?.message||`Validation failed for ${n}`})}}))}),a})}function xe(e,t){const r=t(e);return e.required?r:Ci(r)}var Zi=Object.defineProperty,Ti=Object.getOwnPropertyDescriptor,R=(e,t,r,a)=>{for(var n=a>1?void 0:a?Ti(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(n=(a?i(t,r,n):i(n))||n);return a&&n&&Zi(t,r,n),n};_.FormElement=class extends d.LitElement{constructor(){super(...arguments),this.data={},this.widgetLoaders={},this.itemRenderers={},this.validators={},this.middlewares=[],this.validateOn="eager",this.customWidgetLoaders={...Se,...this.widgetLoaders},this.customValidators=Ht({...this.validators}),this.customMiddlewares=[ct.jsonSchemaMiddleware(st.vanillaSchemaToFieldMap(lt)),...this.middlewares]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.customWidgetLoaders={...Se,...this.widgetLoaders},this.customValidators=Ht({...this.validators}),this.customMiddlewares=[ct.jsonSchemaMiddleware(st.vanillaSchemaToFieldMap(lt)),...this.middlewares]}render(){return d.html`
|
|
4
|
+
<gui-core-form
|
|
5
|
+
.formDef=${this.formDef}
|
|
6
|
+
.data=${this.data}
|
|
7
|
+
.widgetLoaders=${this.customWidgetLoaders}
|
|
8
|
+
.itemRenderers=${this.itemRenderers}
|
|
9
|
+
.localization=${this.localization}
|
|
10
|
+
.middlewares=${this.customMiddlewares}
|
|
11
|
+
.validators=${this.customValidators}
|
|
12
|
+
.validateOn=${this.validateOn??"eager"}
|
|
13
|
+
></gui-core-form>
|
|
14
|
+
`}},R([l.property({type:Object})],_.FormElement.prototype,"formDef",2),R([l.property({type:Object})],_.FormElement.prototype,"data",2),R([l.property({type:Object})],_.FormElement.prototype,"widgetLoaders",2),R([l.property({type:Object})],_.FormElement.prototype,"itemRenderers",2),R([l.property({type:Object})],_.FormElement.prototype,"localization",2),R([l.property({type:Object,attribute:!1})],_.FormElement.prototype,"validators",2),R([l.property({type:Array})],_.FormElement.prototype,"middlewares",2),R([l.property({type:String})],_.FormElement.prototype,"validateOn",2),_.FormElement=R([l.customElement("gui-form")],_.FormElement);var Ri=Object.defineProperty,Ai=Object.getOwnPropertyDescriptor,qe=(e,t,r,a)=>{for(var n=a>1?void 0:a?Ai(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(n=(a?i(t,r,n):i(n))||n);return a&&n&&Ri(t,r,n),n};let Q=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new p.ActionWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-button"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}render(){return d.html`
|
|
15
|
+
<div class="gui-widget">
|
|
16
|
+
<button
|
|
17
|
+
type="button"
|
|
18
|
+
id=${this.widget.uid}
|
|
19
|
+
data-cy=${`${this.widget.uid}_button`}
|
|
20
|
+
@click=${()=>this.adapter.click()}
|
|
21
|
+
?disabled=${this.adapter.templateData.disabled===!0}
|
|
22
|
+
>
|
|
23
|
+
${this.adapter.templateData.label}
|
|
24
|
+
</button>
|
|
25
|
+
</div>
|
|
26
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};qe([f.consume({context:p.formContext}),l.property({attribute:!1})],Q.prototype,"formContext",2),qe([f.provide({context:p.actionContext})],Q.prototype,"adapter",2),Q=qe([l.customElement("gui-button-action")],Q);const Li=Object.freeze(Object.defineProperty({__proto__:null,get ButtonElement(){return Q}},Symbol.toStringTag,{value:"Module"}));var Fi=Object.defineProperty,Mi=Object.getOwnPropertyDescriptor,Ue=(e,t,r,a)=>{for(var n=a>1?void 0:a?Mi(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(n=(a?i(t,r,n):i(n))||n);return a&&n&&Fi(t,r,n),n};let ee=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new p.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-calendar"),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`
|
|
27
|
+
<gui-calendar
|
|
28
|
+
.uid=${this.widget.uid}
|
|
29
|
+
.label=${this.adapter.templateData.label}
|
|
30
|
+
.hint=${this.adapter.templateData.hint}
|
|
31
|
+
.errors=${this.adapter.templateData.errors}
|
|
32
|
+
?touched=${this.adapter.templateData.touched}
|
|
33
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
34
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
35
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
36
|
+
.value=${this.adapter.templateData.value}
|
|
37
|
+
.prevMonthIcon=${this.adapter.templateData.prevMonthIcon}
|
|
38
|
+
.nextMonthIcon=${this.adapter.templateData.nextMonthIcon}
|
|
39
|
+
.prevMonthAriaLabel=${this.adapter.templateData.prevMonthAriaLabel}
|
|
40
|
+
.nextMonthAriaLabel=${this.adapter.templateData.nextMonthAriaLabel}
|
|
41
|
+
.dayFormat=${this.adapter.templateData.dayFormat}
|
|
42
|
+
.weekdayFormat=${this.adapter.templateData.weekdayFormat}
|
|
43
|
+
.monthFormat=${this.adapter.templateData.monthFormat}
|
|
44
|
+
.minDate=${this.adapter.templateData.minDate}
|
|
45
|
+
.maxDate=${this.adapter.templateData.maxDate}
|
|
46
|
+
.disabledRanges=${this.adapter.templateData.disabledRanges}
|
|
47
|
+
.numberOfMonths=${this.adapter.templateData.numberOfMonths}
|
|
48
|
+
.localeId=${this.adapter.templateData.lang}
|
|
49
|
+
@change=${this.valueChanged}
|
|
50
|
+
></gui-calendar>
|
|
51
|
+
`}valueChanged(e){const t=e?.target;this.adapter.valueChanged(t.value)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Ue([f.consume({context:p.formContext}),l.property({attribute:!1})],ee.prototype,"formContext",2),Ue([f.provide({context:p.inputContext})],ee.prototype,"adapter",2),ee=Ue([l.customElement("gui-calendar-input")],ee);const ji=Object.freeze(Object.defineProperty({__proto__:null,get CalendarElement(){return ee}},Symbol.toStringTag,{value:"Module"}));var Ni=Object.defineProperty,qi=Object.getOwnPropertyDescriptor,Ve=(e,t,r,a)=>{for(var n=a>1?void 0:a?qi(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(n=(a?i(t,r,n):i(n))||n);return a&&n&&Ni(t,r,n),n};let te=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new p.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-calendar"),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`
|
|
52
|
+
<gui-range-calendar
|
|
53
|
+
.uid=${this.widget.uid}
|
|
54
|
+
.label=${this.adapter.templateData.label}
|
|
55
|
+
.hint=${this.adapter.templateData.hint}
|
|
56
|
+
.errors=${this.adapter.templateData.errors}
|
|
57
|
+
?touched=${this.adapter.templateData.touched}
|
|
58
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
59
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
60
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
61
|
+
.value=${this.adapter.templateData.value}
|
|
62
|
+
.prevMonthIcon=${this.adapter.templateData.prevMonthIcon}
|
|
63
|
+
.nextMonthIcon=${this.adapter.templateData.nextMonthIcon}
|
|
64
|
+
.prevMonthAriaLabel=${this.adapter.templateData.prevMonthAriaLabel}
|
|
65
|
+
.nextMonthAriaLabel=${this.adapter.templateData.nextMonthAriaLabel}
|
|
66
|
+
.dayFormat=${this.adapter.templateData.dayFormat}
|
|
67
|
+
.weekdayFormat=${this.adapter.templateData.weekdayFormat}
|
|
68
|
+
.monthFormat=${this.adapter.templateData.monthFormat}
|
|
69
|
+
.minDate=${this.adapter.templateData.minDate}
|
|
70
|
+
.maxDate=${this.adapter.templateData.maxDate}
|
|
71
|
+
.disabledRanges=${this.adapter.templateData.disabledRanges}
|
|
72
|
+
.numberOfMonths=${this.adapter.templateData.numberOfMonths}
|
|
73
|
+
.localeId=${this.adapter.templateData.lang}
|
|
74
|
+
@change=${this.valueChanged}
|
|
75
|
+
></gui-range-calendar>
|
|
76
|
+
`}valueChanged(e){const t=e?.target;this.adapter.valueChanged(t.value)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Ve([f.consume({context:p.formContext}),l.property({attribute:!1})],te.prototype,"formContext",2),Ve([f.provide({context:p.inputContext})],te.prototype,"adapter",2),te=Ve([l.customElement("gui-range-calendar-input")],te);const Ui=Object.freeze(Object.defineProperty({__proto__:null,get RangeCalendarElement(){return te}},Symbol.toStringTag,{value:"Module"}));var Vi=Object.defineProperty,Wi=Object.getOwnPropertyDescriptor,We=(e,t,r,a)=>{for(var n=a>1?void 0:a?Wi(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(n=(a?i(t,r,n):i(n))||n);return a&&n&&Vi(t,r,n),n};let re=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new p.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-currency"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}render(){return super.render(),d.html`
|
|
77
|
+
<gui-currency
|
|
78
|
+
.uid=${this.widget.uid}
|
|
79
|
+
.label=${this.adapter.templateData.label}
|
|
80
|
+
.hint=${this.adapter.templateData.hint}
|
|
81
|
+
.errors=${this.adapter.templateData.errors}
|
|
82
|
+
?touched=${this.adapter.templateData.touched}
|
|
83
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
84
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
85
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
86
|
+
.value=${this.adapter.templateData.value}
|
|
87
|
+
.currency=${this.adapter.templateData.currency}
|
|
88
|
+
.step=${this.adapter.templateData.step}
|
|
89
|
+
.maximumFractionDigits=${this.adapter.templateData.maximumFractionDigits}
|
|
90
|
+
.minimumFractionDigits=${this.adapter.templateData.minimumFractionDigits}
|
|
91
|
+
.icon=${this.adapter.templateData.icon}
|
|
92
|
+
.placeholder=${this.adapter.templateData.placeholder}
|
|
93
|
+
.localeId=${this.adapter.templateData.lang}
|
|
94
|
+
@input=${this.valueChanged}
|
|
95
|
+
@blur=${()=>this.adapter.onBlur()}
|
|
96
|
+
></gui-currency>
|
|
97
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};We([f.consume({context:p.formContext}),l.property({attribute:!1})],re.prototype,"formContext",2),We([f.provide({context:p.inputContext})],re.prototype,"adapter",2),re=We([l.customElement("gui-currency-input")],re);const Ji=Object.freeze(Object.defineProperty({__proto__:null,get CurrencyElement(){return re}},Symbol.toStringTag,{value:"Module"}));var Bi=Object.defineProperty,Gi=Object.getOwnPropertyDescriptor,Je=(e,t,r,a)=>{for(var n=a>1?void 0:a?Gi(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(n=(a?i(t,r,n):i(n))||n);return a&&n&&Bi(t,r,n),n};let ae=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new p.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-date"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}render(){super.render();const e=Z.addIcon("date",this.adapter.templateData);return d.html`
|
|
98
|
+
<gui-date
|
|
99
|
+
class=${M.classMap(e.widgetClasses)}
|
|
100
|
+
.uid=${this.widget.uid}
|
|
101
|
+
.label=${this.adapter.templateData.label}
|
|
102
|
+
.hint=${this.adapter.templateData.hint}
|
|
103
|
+
.errors=${this.adapter.templateData.errors}
|
|
104
|
+
?touched=${this.adapter.templateData.touched}
|
|
105
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
106
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
107
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
108
|
+
.value=${this.adapter.templateData.value}
|
|
109
|
+
.icon=${this.adapter.templateData.icon}
|
|
110
|
+
.localeId=${this.adapter.templateData.lang}
|
|
111
|
+
@inputError=${this.onInputError}
|
|
112
|
+
@blur=${()=>this.adapter.onBlur()}
|
|
113
|
+
@change=${this.valueChanged}
|
|
114
|
+
></gui-date>
|
|
115
|
+
`}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())}};Je([f.consume({context:p.formContext}),l.property({attribute:!1})],ae.prototype,"formContext",2),Je([f.provide({context:p.inputContext})],ae.prototype,"adapter",2),ae=Je([l.customElement("gui-date-input")],ae);const Ki=Object.freeze(Object.defineProperty({__proto__:null,get DateElement(){return ae}},Symbol.toStringTag,{value:"Module"}));var Hi=Object.defineProperty,Yi=Object.getOwnPropertyDescriptor,G=(e,t,r,a)=>{for(var n=a>1?void 0:a?Yi(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(n=(a?i(t,r,n):i(n))||n);return a&&n&&Hi(t,r,n),n};let F=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new p.InputWidgetAdapter,this.isCalendarOpen=!1,this.subscriptions=[],this.onDocumentClick=e=>{if(!this.isCalendarOpen)return;const t=e.composedPath(),r=this.dateInput&&t.includes(this.dateInput),a=this.calendarInput&&t.includes(this.calendarInput);!r&&!a&&this.closeCalendar()}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onDocumentClick),this.classList.add("gui-date-picker"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}render(){super.render();const e=Z.addIcon("datePicker",this.adapter.templateData),t=this.isCalendarOpen?d.html`<gui-calendar
|
|
116
|
+
id="calendar-input"
|
|
117
|
+
.uid=${this.widget.uid}
|
|
118
|
+
.hint=${this.adapter.templateData.hint}
|
|
119
|
+
?touched=${this.adapter.templateData.touched}
|
|
120
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
121
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
122
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
123
|
+
.value=${this.adapter.templateData.value}
|
|
124
|
+
.prevMonthIcon=${this.adapter.templateData.prevMonthIcon}
|
|
125
|
+
.nextMonthIcon=${this.adapter.templateData.nextMonthIcon}
|
|
126
|
+
.prevMonthAriaLabel=${this.adapter.templateData.prevMonthAriaLabel}
|
|
127
|
+
.nextMonthAriaLabel=${this.adapter.templateData.nextMonthAriaLabel}
|
|
128
|
+
.dayFormat=${this.adapter.templateData.dayFormat}
|
|
129
|
+
.weekdayFormat=${this.adapter.templateData.weekdayFormat}
|
|
130
|
+
.monthFormat=${this.adapter.templateData.monthFormat}
|
|
131
|
+
.localeId=${this.adapter.templateData.lang}
|
|
132
|
+
@blur=${this.onBlurCalendar}
|
|
133
|
+
@change=${this.valueChanged}
|
|
134
|
+
></gui-calendar>`:d.nothing;return d.html`
|
|
135
|
+
${Z.addLabel(this.widget.uid,this.adapter.templateData)}
|
|
136
|
+
|
|
137
|
+
<div
|
|
138
|
+
role="button"
|
|
139
|
+
tabindex="0"
|
|
140
|
+
class="gui-widget"
|
|
141
|
+
aria-expanded=${this.isCalendarOpen}
|
|
142
|
+
@keyup=${()=>this.onKeyUp(event)}
|
|
143
|
+
@click=${()=>this.openCalendar()}
|
|
144
|
+
>
|
|
145
|
+
<gui-date
|
|
146
|
+
id="date-input"
|
|
147
|
+
class=${M.classMap(e.widgetClasses)}
|
|
148
|
+
.uid=${this.widget.uid}
|
|
149
|
+
.hint=${this.adapter.templateData.hint}
|
|
150
|
+
.showErrors=${!1}
|
|
151
|
+
.errors=${this.adapter.templateData.errors}
|
|
152
|
+
?touched=${this.adapter.templateData.touched}
|
|
153
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
154
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
155
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
156
|
+
.value=${this.adapter.templateData.value}
|
|
157
|
+
.icon=${this.adapter.templateData.icon}
|
|
158
|
+
.localeId=${this.adapter.templateData.lang}
|
|
159
|
+
@inputError=${this.onInputError}
|
|
160
|
+
@blur=${()=>this.adapter.onBlur()}
|
|
161
|
+
@focus=${this.openCalendar}
|
|
162
|
+
@change=${this.valueChanged}
|
|
163
|
+
></gui-date>
|
|
164
|
+
|
|
165
|
+
${t}
|
|
166
|
+
</div>
|
|
167
|
+
|
|
168
|
+
${Z.addErrors(this.widget.uid,this.adapter.templateData)}
|
|
169
|
+
`}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?.key==="Enter"||t?.key===" ")&&this.openCalendar()}openCalendar(){this.isCalendarOpen=!0,this.requestUpdate()}closeCalendar(){this.isCalendarOpen=!1,this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.onDocumentClick),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};G([f.consume({context:p.formContext}),l.property({attribute:!1})],F.prototype,"formContext",2),G([f.provide({context:p.inputContext})],F.prototype,"adapter",2),G([l.query("#date-input")],F.prototype,"dateInput",2),G([l.query("#calendar-input")],F.prototype,"calendarInput",2),G([l.state()],F.prototype,"isCalendarOpen",2),F=G([l.customElement("gui-date-picker-input")],F);const Xi=Object.freeze(Object.defineProperty({__proto__:null,get DatePickerElement(){return F}},Symbol.toStringTag,{value:"Module"})),Yt=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`
|
|
170
|
+
<div
|
|
171
|
+
role="option"
|
|
172
|
+
class=${M.classMap(t)}
|
|
173
|
+
aria-selected=${e.selected?"true":"false"}
|
|
174
|
+
aria-disabled=${e.disabled?"true":"false"}
|
|
175
|
+
>
|
|
176
|
+
${e.template}
|
|
177
|
+
</div>
|
|
178
|
+
`};var Qi=Object.defineProperty,es=Object.getOwnPropertyDescriptor,S=(e,t,r,a)=>{for(var n=a>1?void 0:a?es(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(n=(a?i(t,r,n):i(n))||n);return a&&n&&Qi(t,r,n),n};let O=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new p.InputWidgetAdapter,this.debouncer=new ot.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(),r=this._inputRef&&t.includes(this._inputRef),a=this._listRef&&t.includes(this._listRef);!r&&!a&&(this._isListVisible=!1)}}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.onDocumentClick),this.classList.add("gui-dropdown"),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(ot.debounceTime(this.adapter.templateData.inputDebounce??500)).subscribe(e=>{this._filterItems(e)}))}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}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){this._listItems=e.detail||[]}_onFocusChange(e){this._focusedIndex=e.detail.index}_onClickItem(e,t){if(this.adapter.templateData.readonly)return;const r=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=r.valueField?e.template[r.valueField]:e.template)}_onValueChange(e){const t=e.detail.value;this.adapter.valueChanged(t),this.adapter.filterChanged(""),this._selectedItem=this._listItems.find(r=>r.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,r=!!this.widget.on?.filter;if(this.adapter.filterChanged(e),e&&!r){this._isFiltering=!0,this._isListVisible=!0;const a=t.searchFields??[t.labelField,t.valueField].filter(o=>!!o),n=a.length>0,i=(t.items||[]).filter(o=>{const u=Object.keys(o);if(!u.length)return o.toString().toLowerCase().includes(e.toLowerCase());const m=(b,$)=>b||o[$].toString().toLowerCase().includes(e.toLowerCase());return n?u.filter(b=>a.includes(b)).reduce(m,!1):u.reduce(m,!1)});this._filteredItems=[...i]}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=this._listItems.slice(this._range.start,this._range.end),r=this.adapter.getItemRenderer(e.itemRenderer,Yt),a=e.labelField??e.valueField,n=a?this._selectedItem?.template[a]:this._selectedItem?.template,s=!!this.widget.on?.filter;return d.html`
|
|
179
|
+
<gui-label
|
|
180
|
+
.targetElement=${[this._listRef,this._inputRef]}
|
|
181
|
+
.uid=${this.widget.uid}
|
|
182
|
+
.label=${e.label}
|
|
183
|
+
.hint=${e.hint}
|
|
184
|
+
.errors=${e.errors}
|
|
185
|
+
.touched=${e.touched}
|
|
186
|
+
.required=${e.validator?.required}
|
|
187
|
+
.native=${!1}
|
|
188
|
+
></gui-label>
|
|
189
|
+
|
|
190
|
+
<div class="gui-widget">
|
|
191
|
+
<input
|
|
192
|
+
type="text"
|
|
193
|
+
id=${this.widget.uid}
|
|
194
|
+
data-cy=${`${this.widget.uid}_textinput`}
|
|
195
|
+
.value=${n??""}
|
|
196
|
+
?required=${e.validator?.required}
|
|
197
|
+
?disabled=${e.disabled}
|
|
198
|
+
?readonly=${e.readonly}
|
|
199
|
+
placeholder=${e.placeholder??""}
|
|
200
|
+
@keydown=${this._onKeyDown}
|
|
201
|
+
@input=${this._onInput}
|
|
202
|
+
@focusout=${this._onFocusOutInput}
|
|
203
|
+
@focus=${this._onFocus}
|
|
204
|
+
aria-labelledby=${e.label?`${this.widget.uid}_label`:d.nothing}
|
|
205
|
+
aria-describedby=${e.hint?`${this.widget.uid}_hint`:d.nothing}
|
|
206
|
+
/>
|
|
207
|
+
|
|
208
|
+
<gui-list
|
|
209
|
+
id=${this.widget.uid}
|
|
210
|
+
.uid=${this.widget.uid}
|
|
211
|
+
.value=${e.value??""}
|
|
212
|
+
.valueField=${e.valueField}
|
|
213
|
+
.items=${this._isFiltering&&!s?this._filteredItems:e.items}
|
|
214
|
+
.itemHeight=${e.itemHeight}
|
|
215
|
+
.height=${e.height}
|
|
216
|
+
?required=${e.validator?.required}
|
|
217
|
+
?touched=${e.touched}
|
|
218
|
+
?disabled=${e.disabled}
|
|
219
|
+
?readonly=${e.readonly}
|
|
220
|
+
?hidden=${!this._isListVisible}
|
|
221
|
+
@gui-range-change=${this._onRangeChange}
|
|
222
|
+
@gui-update-items=${this._onUpdateItems}
|
|
223
|
+
@gui-focus-change=${this._onFocusChange}
|
|
224
|
+
@focus=${this._onFocus}
|
|
225
|
+
@blur=${this._onBlur}
|
|
226
|
+
@change=${this._onValueChange}
|
|
227
|
+
>
|
|
228
|
+
${t.map((i,o)=>{const u=this._range.start+o,h=e.value===i.value,m=this._focusedIndex===u;return d.html`
|
|
229
|
+
<div
|
|
230
|
+
role="option"
|
|
231
|
+
tabindex="-1"
|
|
232
|
+
class="gui-list__item-wrapper"
|
|
233
|
+
id="${this.widget.uid}-item-${u}"
|
|
234
|
+
style="height: ${e.itemHeight||40}px"
|
|
235
|
+
aria-selected=${h?"true":"false"}
|
|
236
|
+
@click=${()=>this._onClickItem(i,u)}
|
|
237
|
+
>
|
|
238
|
+
${r({template:i.template,value:i.value,index:u,selected:h,disabled:!!e.disabled,focused:m})}
|
|
239
|
+
</div>
|
|
240
|
+
`})}
|
|
241
|
+
</gui-list>
|
|
242
|
+
</div>
|
|
243
|
+
|
|
244
|
+
<gui-errors .errors=${e.errors} .touched=${e.touched}></gui-errors>
|
|
245
|
+
`}};S([f.consume({context:p.formContext}),l.property({attribute:!1})],O.prototype,"formContext",2),S([f.provide({context:p.inputContext})],O.prototype,"adapter",2),S([l.state()],O.prototype,"_range",2),S([l.state()],O.prototype,"_filteredItems",2),S([l.state()],O.prototype,"_listItems",2),S([l.state()],O.prototype,"_focusedIndex",2),S([l.state()],O.prototype,"_isFiltering",2),S([l.state()],O.prototype,"_isListVisible",2),S([l.state()],O.prototype,"_selectedItem",2),S([l.query("input")],O.prototype,"_inputRef",2),S([l.query("gui-list")],O.prototype,"_listRef",2),O=S([l.customElement("gui-dropdown-input")],O);const ts=Object.freeze(Object.defineProperty({__proto__:null,get DropdownElement(){return O}},Symbol.toStringTag,{value:"Module"}));var rs=Object.defineProperty,as=Object.getOwnPropertyDescriptor,U=(e,t,r,a)=>{for(var n=a>1?void 0:a?as(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(n=(a?i(t,r,n):i(n))||n);return a&&n&&rs(t,r,n),n};let A=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new p.InputWidgetAdapter,this.subscriptions=[],this._range={start:0,end:10},this._listItems=[],this._focusedIndex=-1}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-list"),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())}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}render(){const e=this.adapter.templateData,t=this._listItems.slice(this._range.start,this._range.end),r=this.adapter.getItemRenderer(e.itemRenderer,Yt);return d.html`
|
|
246
|
+
<gui-label
|
|
247
|
+
.targetElement=${this._guiListRef}
|
|
248
|
+
.uid=${this.widget.uid}
|
|
249
|
+
.label=${e.label}
|
|
250
|
+
.hint=${e.hint}
|
|
251
|
+
.errors=${e.errors}
|
|
252
|
+
.touched=${e.touched}
|
|
253
|
+
.required=${e.validator?.required}
|
|
254
|
+
.native=${!1}
|
|
255
|
+
></gui-label>
|
|
256
|
+
|
|
257
|
+
<div class="gui-widget">
|
|
258
|
+
<gui-list
|
|
259
|
+
.uid=${this.widget.uid}
|
|
260
|
+
.value=${e.value??""}
|
|
261
|
+
.valueField=${e.valueField}
|
|
262
|
+
.items=${e.items}
|
|
263
|
+
.itemHeight=${e.itemHeight}
|
|
264
|
+
.height=${e.height}
|
|
265
|
+
?required=${e.validator?.required}
|
|
266
|
+
?touched=${e.touched}
|
|
267
|
+
?disabled=${e.disabled}
|
|
268
|
+
?readonly=${e.readonly}
|
|
269
|
+
aria-labelledby=${e.label?`${this.widget.uid}_label`:d.nothing}
|
|
270
|
+
aria-describedby=${e.hint?`${this.widget.uid}_hint`:d.nothing}
|
|
271
|
+
@gui-range-change=${this._onRangeChange}
|
|
272
|
+
@gui-update-items=${this._onUpdateItems}
|
|
273
|
+
@gui-focus-change=${this._onFocusChange}
|
|
274
|
+
@blur=${()=>this.adapter.onBlur()}
|
|
275
|
+
@change=${this._valueChanged}
|
|
276
|
+
>
|
|
277
|
+
${t.map((a,n)=>{const s=this._range.start+n,i=e.value===a.value,o=this._focusedIndex===s;return d.html`
|
|
278
|
+
<div
|
|
279
|
+
role="option"
|
|
280
|
+
tabindex="-1"
|
|
281
|
+
class="gui-list__item-wrapper"
|
|
282
|
+
id="${this.widget.uid}-item-${s}"
|
|
283
|
+
style="height: ${e.itemHeight||40}px"
|
|
284
|
+
aria-selected=${i?"true":"false"}
|
|
285
|
+
aria-disabled=${e.disabled?"true":"false"}
|
|
286
|
+
@click=${()=>this._onClickItem(a,s)}
|
|
287
|
+
>
|
|
288
|
+
${r({template:a.template,value:a.value,index:s,selected:i,disabled:!!e.disabled,focused:o})}
|
|
289
|
+
</div>
|
|
290
|
+
`})}
|
|
291
|
+
</gui-list>
|
|
292
|
+
</div>
|
|
293
|
+
|
|
294
|
+
<gui-errors .errors=${e.errors} .touched=${e.touched}></gui-errors>
|
|
295
|
+
`}_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)}};U([f.consume({context:p.formContext}),l.property({attribute:!1})],A.prototype,"formContext",2),U([f.provide({context:p.inputContext})],A.prototype,"adapter",2),U([l.state()],A.prototype,"_range",2),U([l.state()],A.prototype,"_listItems",2),U([l.state()],A.prototype,"_focusedIndex",2),U([l.query("gui-list")],A.prototype,"_guiListRef",2),A=U([l.customElement("gui-list-input")],A);const ns=Object.freeze(Object.defineProperty({__proto__:null,get ListElement(){return A}},Symbol.toStringTag,{value:"Module"}));var is=Object.defineProperty,ss=Object.getOwnPropertyDescriptor,Be=(e,t,r,a)=>{for(var n=a>1?void 0:a?ss(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(n=(a?i(t,r,n):i(n))||n);return a&&n&&is(t,r,n),n};let ne=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new p.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-password"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}render(){return super.render(),d.html`
|
|
296
|
+
<gui-password
|
|
297
|
+
.uid=${this.widget.uid}
|
|
298
|
+
.label=${this.adapter.templateData.label}
|
|
299
|
+
.hint=${this.adapter.templateData.hint}
|
|
300
|
+
.errors=${this.adapter.templateData.errors}
|
|
301
|
+
?touched=${this.adapter.templateData.touched}
|
|
302
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
303
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
304
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
305
|
+
.value=${this.adapter.templateData.value}
|
|
306
|
+
.icon=${this.adapter.templateData.icon}
|
|
307
|
+
.placeholder=${this.adapter.templateData.placeholder}
|
|
308
|
+
.showPasswordIcon=${this.adapter.templateData.showPasswordIcon}
|
|
309
|
+
.hidePasswordIcon=${this.adapter.templateData.hidePasswordIcon}
|
|
310
|
+
.showPasswordLabel=${this.adapter.templateData.showPasswordLabel}
|
|
311
|
+
.hidePasswordLabel=${this.adapter.templateData.hidePasswordLabel}
|
|
312
|
+
@input=${this.valueChanged}
|
|
313
|
+
@blur=${()=>this.adapter.onBlur()}
|
|
314
|
+
></gui-password>
|
|
315
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Be([f.consume({context:p.formContext}),l.property({attribute:!1})],ne.prototype,"formContext",2),Be([f.provide({context:p.inputContext})],ne.prototype,"adapter",2),ne=Be([l.customElement("gui-password-input")],ne);const os=Object.freeze(Object.defineProperty({__proto__:null,get PasswordElement(){return ne}},Symbol.toStringTag,{value:"Module"}));var us=Object.defineProperty,cs=Object.getOwnPropertyDescriptor,Ge=(e,t,r,a)=>{for(var n=a>1?void 0:a?cs(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(n=(a?i(t,r,n):i(n))||n);return a&&n&&us(t,r,n),n};let ie=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new p.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-textinput"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}render(){return super.render(),d.html`
|
|
316
|
+
<gui-textinput
|
|
317
|
+
.uid=${this.widget.uid}
|
|
318
|
+
.label=${this.adapter.templateData.label}
|
|
319
|
+
.hint=${this.adapter.templateData.hint}
|
|
320
|
+
.errors=${this.adapter.templateData.errors}
|
|
321
|
+
?touched=${this.adapter.templateData.touched}
|
|
322
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
323
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
324
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
325
|
+
.value=${this.adapter.templateData.value}
|
|
326
|
+
.icon=${this.adapter.templateData.icon}
|
|
327
|
+
.placeholder=${this.adapter.templateData.placeholder}
|
|
328
|
+
@input=${this.valueChanged}
|
|
329
|
+
@blur=${()=>this.adapter.onBlur()}
|
|
330
|
+
></gui-textinput>
|
|
331
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Ge([f.consume({context:p.formContext}),l.property({attribute:!1})],ie.prototype,"formContext",2),Ge([f.provide({context:p.inputContext})],ie.prototype,"adapter",2),ie=Ge([l.customElement("gui-textinput-input")],ie);const ls=Object.freeze(Object.defineProperty({__proto__:null,get TextinputElement(){return ie}},Symbol.toStringTag,{value:"Module"}));var ds=Object.defineProperty,ps=Object.getOwnPropertyDescriptor,Ke=(e,t,r,a)=>{for(var n=a>1?void 0:a?ps(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(n=(a?i(t,r,n):i(n))||n);return a&&n&&ds(t,r,n),n};let se=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new p.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-textarea"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}render(){return super.render(),d.html`
|
|
332
|
+
<gui-textarea
|
|
333
|
+
.uid=${this.widget.uid}
|
|
334
|
+
.label=${this.adapter.templateData.label}
|
|
335
|
+
.errors=${this.adapter.templateData.errors}
|
|
336
|
+
?touched=${this.adapter.templateData.touched}
|
|
337
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
338
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
339
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
340
|
+
.value=${this.adapter.templateData.value}
|
|
341
|
+
.hint=${this.adapter.templateData.hint}
|
|
342
|
+
.placeholder=${this.adapter.templateData.placeholder}
|
|
343
|
+
.icon=${this.adapter.templateData.icon}
|
|
344
|
+
.counterMode=${this.adapter.templateData.counterMode}
|
|
345
|
+
.minimumHeight=${this.adapter.templateData.minimumHeight}
|
|
346
|
+
.autoGrow=${this.adapter.templateData.autoGrow}
|
|
347
|
+
.maxLength=${this.adapter.templateData.validator?.maxLength}
|
|
348
|
+
@input=${this.valueChanged}
|
|
349
|
+
@blur=${()=>this.adapter.onBlur()}
|
|
350
|
+
></gui-textarea>
|
|
351
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Ke([f.consume({context:p.formContext}),l.property({attribute:!1})],se.prototype,"formContext",2),Ke([f.provide({context:p.inputContext})],se.prototype,"adapter",2),se=Ke([l.customElement("gui-textarea-input")],se);const hs=Object.freeze(Object.defineProperty({__proto__:null,get TextareaElement(){return se}},Symbol.toStringTag,{value:"Module"}));var ms=Object.defineProperty,fs=Object.getOwnPropertyDescriptor,He=(e,t,r,a)=>{for(var n=a>1?void 0:a?fs(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(n=(a?i(t,r,n):i(n))||n);return a&&n&&ms(t,r,n),n};let oe=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new p.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-toggle"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}render(){return super.render(),d.html`
|
|
352
|
+
<gui-toggle
|
|
353
|
+
.uid=${this.widget.uid}
|
|
354
|
+
.label=${this.adapter.templateData.label}
|
|
355
|
+
.errors=${this.adapter.templateData.errors}
|
|
356
|
+
?touched=${this.adapter.templateData.touched}
|
|
357
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
358
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
359
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
360
|
+
.value=${this.adapter.templateData.value}
|
|
361
|
+
.hint=${this.adapter.templateData.hint}
|
|
362
|
+
.togglePosition=${this.adapter.templateData.togglePosition}
|
|
363
|
+
@change=${this.valueChanged}
|
|
364
|
+
@blur=${()=>this.adapter.onBlur()}
|
|
365
|
+
></gui-toggle>
|
|
366
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};He([f.consume({context:p.formContext}),l.property({attribute:!1})],oe.prototype,"formContext",2),He([f.provide({context:p.inputContext})],oe.prototype,"adapter",2),oe=He([l.customElement("gui-toggle-input")],oe);const gs=Object.freeze(Object.defineProperty({__proto__:null,get ToggleElement(){return oe}},Symbol.toStringTag,{value:"Module"}));var bs=Object.defineProperty,_s=Object.getOwnPropertyDescriptor,Ye=(e,t,r,a)=>{for(var n=a>1?void 0:a?_s(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(n=(a?i(t,r,n):i(n))||n);return a&&n&&bs(t,r,n),n};let ue=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new p.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-checkbox"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}render(){return super.render(),d.html`
|
|
367
|
+
<gui-checkbox
|
|
368
|
+
.uid=${this.widget.uid}
|
|
369
|
+
.label=${this.adapter.templateData.label}
|
|
370
|
+
.errors=${this.adapter.templateData.errors}
|
|
371
|
+
?touched=${this.adapter.templateData.touched}
|
|
372
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
373
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
374
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
375
|
+
.value=${this.adapter.templateData.value}
|
|
376
|
+
.hint=${this.adapter.templateData.hint}
|
|
377
|
+
.checkboxPosition=${this.adapter.templateData.checkboxPosition}
|
|
378
|
+
@change=${this.valueChanged}
|
|
379
|
+
@blur=${()=>this.adapter.onBlur()}
|
|
380
|
+
></gui-checkbox>
|
|
381
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Ye([f.consume({context:p.formContext}),l.property({attribute:!1})],ue.prototype,"formContext",2),Ye([f.provide({context:p.inputContext})],ue.prototype,"adapter",2),ue=Ye([l.customElement("gui-checkbox-input")],ue);const vs=Object.freeze(Object.defineProperty({__proto__:null,get CheckboxElement(){return ue}},Symbol.toStringTag,{value:"Module"}));var $s=Object.defineProperty,ys=Object.getOwnPropertyDescriptor,Xe=(e,t,r,a)=>{for(var n=a>1?void 0:a?ys(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(n=(a?i(t,r,n):i(n))||n);return a&&n&&$s(t,r,n),n};let ce=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new p.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-number"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}render(){return super.render(),d.html`
|
|
382
|
+
<gui-number
|
|
383
|
+
.uid=${this.widget.uid}
|
|
384
|
+
.label=${this.adapter.templateData.label}
|
|
385
|
+
.hint=${this.adapter.templateData.hint}
|
|
386
|
+
.errors=${this.adapter.templateData.errors}
|
|
387
|
+
?touched=${this.adapter.templateData.touched}
|
|
388
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
389
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
390
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
391
|
+
.value=${this.adapter.templateData.value}
|
|
392
|
+
.step=${this.adapter.templateData.step}
|
|
393
|
+
.minimum=${this.adapter.templateData.minimum}
|
|
394
|
+
.maximum=${this.adapter.templateData.maximum}
|
|
395
|
+
.autoGrow=${this.adapter.templateData.autoGrow}
|
|
396
|
+
.placeholder=${this.adapter.templateData.placeholder}
|
|
397
|
+
@input=${this.valueChanged}
|
|
398
|
+
@blur=${()=>this.adapter.onBlur()}
|
|
399
|
+
></gui-number>
|
|
400
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Xe([f.consume({context:p.formContext}),l.property({attribute:!1})],ce.prototype,"formContext",2),Xe([f.provide({context:p.inputContext})],ce.prototype,"adapter",2),ce=Xe([l.customElement("gui-number-input")],ce);const ws=Object.freeze(Object.defineProperty({__proto__:null,get NumberElement(){return ce}},Symbol.toStringTag,{value:"Module"}));var Cs=Object.defineProperty,Ds=Object.getOwnPropertyDescriptor,Qe=(e,t,r,a)=>{for(var n=a>1?void 0:a?Ds(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(n=(a?i(t,r,n):i(n))||n);return a&&n&&Cs(t,r,n),n};let le=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new p.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-radiogroup"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}render(){return super.render(),d.html`
|
|
401
|
+
<gui-radiogroup
|
|
402
|
+
.uid=${this.widget.uid}
|
|
403
|
+
.label=${this.adapter.templateData.label}
|
|
404
|
+
.errors=${this.adapter.templateData.errors}
|
|
405
|
+
?touched=${this.adapter.templateData.touched}
|
|
406
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
407
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
408
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
409
|
+
.value=${this.adapter.templateData.value}
|
|
410
|
+
.hint=${this.adapter.templateData.hint}
|
|
411
|
+
.options=${this.adapter.templateData.options}
|
|
412
|
+
.labelField=${this.adapter.templateData.labelField}
|
|
413
|
+
.valueField=${this.adapter.templateData.valueField}
|
|
414
|
+
@change=${this.valueChanged}
|
|
415
|
+
@blur=${()=>this.adapter.onBlur()}
|
|
416
|
+
></gui-radiogroup>
|
|
417
|
+
`}valueChanged(e){const t=e.detail.value;this.adapter.valueChanged(t)}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};Qe([f.consume({context:p.formContext}),l.property({attribute:!1})],le.prototype,"formContext",2),Qe([f.provide({context:p.inputContext})],le.prototype,"adapter",2),le=Qe([l.customElement("gui-radiogroup-input")],le);const zs=Object.freeze(Object.defineProperty({__proto__:null,get RadiogroupElement(){return le}},Symbol.toStringTag,{value:"Module"}));var Os=Object.defineProperty,Ps=Object.getOwnPropertyDescriptor,et=(e,t,r,a)=>{for(var n=a>1?void 0:a?Ps(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(n=(a?i(t,r,n):i(n))||n);return a&&n&&Os(t,r,n),n};let de=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new p.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-select"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}render(){return super.render(),d.html`
|
|
418
|
+
<gui-select
|
|
419
|
+
.uid=${this.widget.uid}
|
|
420
|
+
.label=${this.adapter.templateData.label}
|
|
421
|
+
.errors=${this.adapter.templateData.errors}
|
|
422
|
+
?touched=${this.adapter.templateData.touched}
|
|
423
|
+
?required=${this.adapter.templateData.validator?.required}
|
|
424
|
+
?disabled=${this.adapter.templateData.disabled}
|
|
425
|
+
?readonly=${this.adapter.templateData.readonly}
|
|
426
|
+
.value=${this.adapter.templateData.value}
|
|
427
|
+
.hint=${this.adapter.templateData.hint}
|
|
428
|
+
.icon=${this.adapter.templateData.icon}
|
|
429
|
+
.placeholder=${this.adapter.templateData.placeholder}
|
|
430
|
+
.options=${this.adapter.templateData.options}
|
|
431
|
+
.labelField=${this.adapter.templateData.labelField}
|
|
432
|
+
.valueField=${this.adapter.templateData.valueField}
|
|
433
|
+
@change=${this.valueChanged}
|
|
434
|
+
@inputError=${this.onInputError}
|
|
435
|
+
@blur=${()=>this.adapter.onBlur()}
|
|
436
|
+
></gui-select>
|
|
437
|
+
`}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())}};et([f.consume({context:p.formContext}),l.property({attribute:!1})],de.prototype,"formContext",2),et([f.provide({context:p.inputContext})],de.prototype,"adapter",2),de=et([l.customElement("gui-select-input")],de);const xs=Object.freeze(Object.defineProperty({__proto__:null,get SelectElement(){return de}},Symbol.toStringTag,{value:"Module"}));var Es=Object.defineProperty,Ss=Object.getOwnPropertyDescriptor,tt=(e,t,r,a)=>{for(var n=a>1?void 0:a?Ss(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(n=(a?i(t,r,n):i(n))||n);return a&&n&&Es(t,r,n),n};let pe=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new p.InputWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-repeater"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}render(){return super.render(),d.html`
|
|
438
|
+
<div id=${this.widget.uid}>
|
|
439
|
+
<h2>${this.adapter.templateData.label}</h2>
|
|
440
|
+
|
|
441
|
+
${this.adapter.templateData.value?K.repeat(this.adapter.templateData.value,e=>e.uid,(e,t)=>d.html`
|
|
442
|
+
<div class="card">
|
|
443
|
+
<gui-repeater-widget
|
|
444
|
+
.repeaterIndex=${t}
|
|
445
|
+
.widget=${this.adapter.templateData.template}
|
|
446
|
+
></gui-repeater-widget>
|
|
447
|
+
<button type="button" class="gui-button" @click=${()=>this.removeItem(t)}>
|
|
448
|
+
${this.adapter.templateData.removeLabel??"Remove"}
|
|
449
|
+
</button>
|
|
450
|
+
</div>
|
|
451
|
+
`):d.nothing}
|
|
452
|
+
|
|
453
|
+
<button
|
|
454
|
+
type="button"
|
|
455
|
+
class="gui-button"
|
|
456
|
+
@click=${()=>this.addItem()}
|
|
457
|
+
?disabled=${!!(this.adapter.templateData.limit&&this.adapter.templateData.limit===this.adapter.templateData.value?.length)}
|
|
458
|
+
>
|
|
459
|
+
${this.adapter.templateData.addLabel??"Add"}
|
|
460
|
+
</button>
|
|
461
|
+
</div>
|
|
462
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}addItem(){this.adapter.valueChanged([...this.adapter.templateData.value??[],{}]),this.requestUpdate()}removeItem(e){const t=[...this.adapter.templateData.value??[]];t.splice(e,1),this.adapter.valueChanged(t),this.requestUpdate()}};tt([f.consume({context:p.formContext}),l.property({attribute:!1})],pe.prototype,"formContext",2),tt([f.provide({context:p.inputContext})],pe.prototype,"adapter",2),pe=tt([l.customElement("gui-repeater-input")],pe);const Is=Object.freeze(Object.defineProperty({__proto__:null,get RepeaterElement(){return pe}},Symbol.toStringTag,{value:"Module"}));var ks=Object.defineProperty,Zs=Object.getOwnPropertyDescriptor,rt=(e,t,r,a)=>{for(var n=a>1?void 0:a?Zs(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(n=(a?i(t,r,n):i(n))||n);return a&&n&&ks(t,r,n),n};let he=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new p.LayoutWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-flex"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}render(){const e={"gui-flex__widget":!0,"gui-flex__widget--horizontal":this.adapter.templateData.direction==="horizontal","gui-flex__widget--align-start":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"};return d.html`
|
|
463
|
+
<div class=${M.classMap(e)} id=${this.widget?.uid}>
|
|
464
|
+
${K.repeat(this.adapter.templateData.children||[],t=>t?.uid,t=>d.html`<gui-widget .widget=${t}></gui-widget>`)}
|
|
465
|
+
</div>
|
|
466
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};rt([f.consume({context:p.formContext}),l.property({attribute:!1})],he.prototype,"formContext",2),rt([f.provide({context:p.layoutContext})],he.prototype,"adapter",2),he=rt([l.customElement("gui-flex-layout")],he);const Ts=Object.freeze(Object.defineProperty({__proto__:null,get FlexElement(){return he}},Symbol.toStringTag,{value:"Module"}));var Rs=Object.defineProperty,As=Object.getOwnPropertyDescriptor,L=(e,t,r,a)=>{for(var n=a>1?void 0:a?As(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(n=(a?i(t,r,n):i(n))||n);return a&&n&&Rs(t,r,n),n};let I=class extends d.LitElement{constructor(){super(...arguments),this.activeTab="",this.adapter=new p.LayoutWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-tabs");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()}))}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}firstUpdated(e){this.startObserver=Z.createIntersectionObserver(this.startSentinel,a=>this.isStartVisible=a),this.endObserver=Z.createIntersectionObserver(this.endSentinel,a=>this.isEndVisible=a);const r=this.widget.props.tabs.findIndex(a=>a.uid===this.activeTab);this.tabButtons[r].scrollIntoView()}render(){if(!this.adapter.templateData)return d.html``;const e=this.widget.children.filter(r=>r.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=${M.classMap(t)} id=${this.widget.uid}>
|
|
467
|
+
<ul role="tablist">
|
|
468
|
+
<li role="presentation" id="start-sentinel" class="gui-sentinel"></li>
|
|
469
|
+
${this.adapter.templateData.tabs?K.repeat(this.adapter.templateData.tabs,(r,a)=>d.html`
|
|
470
|
+
<li role="presentation">
|
|
471
|
+
<button
|
|
472
|
+
type="button"
|
|
473
|
+
role="tab"
|
|
474
|
+
tabindex=${Qt.ifDefined(r.uid===this.activeTab?void 0:-1)}
|
|
475
|
+
data-cy=${`tab_${this.widget.uid}_${a}`}
|
|
476
|
+
id=${`tab_${this.widget.uid}_${a}`}
|
|
477
|
+
aria-controls=${`tabpanel_${this.widget.uid}_${a}`}
|
|
478
|
+
aria-selected=${r.uid===this.activeTab?"true":"false"}
|
|
479
|
+
class=${M.classMap({active:r.uid===this.activeTab})}
|
|
480
|
+
@click=${()=>this.onClickTab(r.uid)}
|
|
481
|
+
@keydown=${this.onKeyDown}
|
|
482
|
+
@focus=${n=>n.target.scrollIntoView()}
|
|
483
|
+
>
|
|
484
|
+
${r.label}
|
|
485
|
+
</button>
|
|
486
|
+
</li>
|
|
487
|
+
`):d.nothing}
|
|
488
|
+
<li role="presentation" id="end-sentinel" class="gui-sentinel"></li>
|
|
489
|
+
</ul>
|
|
490
|
+
</nav>
|
|
491
|
+
${K.repeat(e,r=>r?.uid,(r,a)=>d.html`<section
|
|
492
|
+
role="tabpanel"
|
|
493
|
+
data-cy=${`tabpanel_${this.widget.uid}_${a}`}
|
|
494
|
+
id=${`tabpanel_${this.widget.uid}_${a}`}
|
|
495
|
+
?hidden=${r.uid!==this.activeTab&&this.adapter.templateData.renderMode!=="activeOnly"}
|
|
496
|
+
aria-labelledby=${`tab_${this.widget.uid}_${a}`}
|
|
497
|
+
>
|
|
498
|
+
<gui-widget .widget=${r}></gui-widget>
|
|
499
|
+
</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,r=t.findIndex(s=>s.uid===this.activeTab),a=Array.from(this.tabButtons),n=window.getComputedStyle(this).direction==="rtl";switch(e.key){case"ArrowLeft":{const s=r+(n?1:-1);s>=0&&s<t.length&&(this.activeTab=t[s].uid,a[s].focus());break}case"ArrowRight":{const s=r+(n?-1:1);s>=0&&s<t.length&&(this.activeTab=t[s].uid,a[s].focus());break}case"Home":this.activeTab=t[0].uid,a[0].focus();break;case"End":this.activeTab=t[t.length-1].uid,a[t.length-1].focus();break;default:return}}};L([l.query("#start-sentinel")],I.prototype,"startSentinel",2),L([l.query("#end-sentinel")],I.prototype,"endSentinel",2),L([l.state()],I.prototype,"isStartVisible",2),L([l.state()],I.prototype,"isEndVisible",2),L([l.queryAll('button[role="tab"]')],I.prototype,"tabButtons",2),L([l.property({type:String})],I.prototype,"activeTab",2),L([f.consume({context:p.formContext}),l.property({attribute:!1})],I.prototype,"formContext",2),L([f.provide({context:p.layoutContext})],I.prototype,"adapter",2),I=L([l.customElement("gui-tabs-layout")],I);const Ls=Object.freeze(Object.defineProperty({__proto__:null,get TabsElement(){return I}},Symbol.toStringTag,{value:"Module"}));var Fs=Object.defineProperty,Ms=Object.getOwnPropertyDescriptor,at=(e,t,r,a)=>{for(var n=a>1?void 0:a?Ms(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(n=(a?i(t,r,n):i(n))||n);return a&&n&&Fs(t,r,n),n};let me=class extends d.LitElement{constructor(){super(...arguments),this.activeSections={},this.adapter=new p.LayoutWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-accordion");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(r=>r!==e).forEach(r=>{this.activeSections[r]=!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)}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}render(){return this.adapter.templateData?d.html`
|
|
500
|
+
<div class="gui-widget" id=${this.widget.uid}>
|
|
501
|
+
${this.adapter.templateData.sections?K.repeat(this.adapter.templateData.sections,e=>e.uid,e=>{const t=this.activeSections[e.uid]||this.adapter.templateData.renderMode!=="activeOnly"?d.html`<section
|
|
502
|
+
class="gui-widget"
|
|
503
|
+
role="region"
|
|
504
|
+
id=${`accordion_section_${e.uid}`}
|
|
505
|
+
?hidden=${!this.activeSections[e.uid]&&this.adapter.templateData.renderMode!=="activeOnly"}
|
|
506
|
+
aria-labelledby=${`accordion_button_${e.uid}`}
|
|
507
|
+
>
|
|
508
|
+
<gui-widget .widget=${this.getChild(e.uid)}></gui-widget>
|
|
509
|
+
</section>`:d.nothing;return d.html`<div class="gui-accordion__section">
|
|
510
|
+
<button
|
|
511
|
+
type="button"
|
|
512
|
+
class=${M.classMap({active:this.activeSections[e.uid]})}
|
|
513
|
+
id=${`accordion_button_${e.uid}`}
|
|
514
|
+
aria-controls=${`accordion_section_${e.uid}`}
|
|
515
|
+
aria-expanded=${this.activeSections[e.uid]?"true":"false"}
|
|
516
|
+
@click=${()=>this.onClickButton(e.uid)}
|
|
517
|
+
>
|
|
518
|
+
${e.label}<span class="gui-accordion__icon"></span>
|
|
519
|
+
</button>
|
|
520
|
+
|
|
521
|
+
${t}
|
|
522
|
+
</div>`}):d.nothing}
|
|
523
|
+
</div>
|
|
524
|
+
`:d.html``}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};at([f.consume({context:p.formContext}),l.property({attribute:!1})],me.prototype,"formContext",2),at([f.provide({context:p.layoutContext})],me.prototype,"adapter",2),me=at([l.customElement("gui-accordion-layout")],me);const js=Object.freeze(Object.defineProperty({__proto__:null,get AccordionElement(){return me}},Symbol.toStringTag,{value:"Module"}));var Ns=Object.defineProperty,qs=Object.getOwnPropertyDescriptor,nt=(e,t,r,a)=>{for(var n=a>1?void 0:a?qs(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(n=(a?i(t,r,n):i(n))||n);return a&&n&&Ns(t,r,n),n};let fe=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new p.DisplayWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-alert"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}updated(e){super.updated(e);const t=this.adapter.templateData.size;t?this.style.flex=String(t):this.style.removeProperty("flex")}render(){return d.html`
|
|
525
|
+
<div class="gui-widget" id=${this.widget.uid}>
|
|
526
|
+
<div
|
|
527
|
+
role="alert"
|
|
528
|
+
class="gui-alert-notification gui-alert-notification--${this.adapter.templateData.level||"default"}"
|
|
529
|
+
>
|
|
530
|
+
${this.adapter.templateData.text}
|
|
531
|
+
</div>
|
|
532
|
+
</div>
|
|
533
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};nt([f.consume({context:p.formContext}),l.property({attribute:!1})],fe.prototype,"formContext",2),nt([f.provide({context:p.displayWidgetContext})],fe.prototype,"adapter",2),fe=nt([l.customElement("gui-alert-display")],fe);const Us=Object.freeze(Object.defineProperty({__proto__:null,get AlertElement(){return fe}},Symbol.toStringTag,{value:"Module"}));var Vs=Object.defineProperty,Ws=Object.getOwnPropertyDescriptor,it=(e,t,r,a)=>{for(var n=a>1?void 0:a?Ws(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(n=(a?i(t,r,n):i(n))||n);return a&&n&&Vs(t,r,n),n};let ge=class extends d.LitElement{constructor(){super(...arguments),this.adapter=new p.DisplayWidgetAdapter,this.subscriptions=[]}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.classList.add("gui-renderer"),this.adapter.context=this.formContext,this.adapter.init(this.widget),this.subscriptions.push(this.adapter.templateDataChanged$.subscribe(()=>this.requestUpdate()))}render(){return d.html`
|
|
534
|
+
<div class="gui-widget" id=${this.widget.uid}>${this.adapter.templateData.render}</div>
|
|
535
|
+
`}disconnectedCallback(){super.disconnectedCallback(),this.adapter.destroy(),this.subscriptions.forEach(e=>e.unsubscribe())}};it([f.consume({context:p.formContext}),l.property({attribute:!1})],ge.prototype,"formContext",2),it([f.provide({context:p.displayWidgetContext})],ge.prototype,"adapter",2),ge=it([l.customElement("gui-renderer-component")],ge);const Js=Object.freeze(Object.defineProperty({__proto__:null,get RendererElement(){return ge}},Symbol.toStringTag,{value:"Module"}));_.vanillaWidgetLoaders=Se,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})}));
|