@trustme24/flext 1.10.1 → 1.10.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/dist/index.css CHANGED
@@ -1,2 +1,2 @@
1
- /*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */
2
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-blue-500:oklch(62.3% .214 259.815);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.static{position:static}.text-blue-500{color:var(--color-blue-500)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}
1
+ /*! tailwindcss v4.2.0 | MIT License | https://tailwindcss.com */
2
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-blue-500:oklch(62.3% .214 259.815);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.static{position:static}.text-blue-500{color:var(--color-blue-500)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}
package/dist/index.js CHANGED
@@ -564,3 +564,4 @@ ${u.join(`
564
564
  }
565
565
  `;var Fi=yn(ua(),1),Kf=Pc({presets:[ed(),Jo()],preflights:[{getCSS:()=>nd}],theme:{}}),Tr=10,qi="string",Jf=Yf.default,Mr=class extends Fi.default.Visitor{data=[];match=()=>!0;constructor(e){super(),e&&this.setMatchHandler(e)}onCollect(e){this.match(e)&&this.data.push(e)}setMatchHandler(e){return this.match=e,this}setAst(e){return this.accept(e),this}collect(e){return this.data=[],this.setAst(e),this.data}},da=class extends Mr{CommentStatement(e){return this.onCollect(e.value),super.CommentStatement(e)}},fa=class extends Mr{ContentStatement(e){return this.onCollect(e.value),super.ContentStatement(e)}},ha=class extends Mr{PathExpression(e){let r=e.original,n=i=>r===i;return n("if")||n("unless")||n("each")||n("with")?super.PathExpression(e):(this.onCollect(e.original),super.PathExpression(e))}},pa=class extends da{match=pn.macro},ma=class extends fa{match=pn.htmlH1Somewhere};function pe(t,...e){return e.includes(t)}function Vi(t,e){return t.hasOwnProperty(e)}function et(t){return!pe(t,null,void 0)}function $e(t){return et(t)&&!isNaN(Number(t))}function ji(t){return typeof t=="object"&&t!==null}function I(t){return ji(t)?JSON.stringify(t):typeof t=="string"?`'${t}'`:String(t)}function va(t){return Fi.default.parse(t)}function Bi(t){return Fi.default.compile(t)}function Wi(t,e={},r={}){return t(e,{helpers:r})}async function ka(t,e={},r={}){let n=r?.helpers??{},i=!!(r?.doGenerateGlobalStyles??!0),o=await Kf,s=Wi(t,e,n),{css:a}=await o.generate(s,{preflights:i});return a}function Xf(t){return[...new Set(t)]}function Qf(t){let e=new ha().collect(t);return Xf(e)}function Ri(t,e=Tr){if(e<=0)throw new ft("Flext: Unable to get the model: The model is too deep");let[r,...n]=t?.split(".")??[],i={name:r};return n?.length>0&&(i.$=[Ri(n?.join(".")||"",e-1)]),i}function eh(t,e=Tr){let n={name:"root",$:[Ri(t,e)]};return n.addPath=(i,o=Tr)=>{let s=Ri(i,o),a=n,l=s;for(let c=0;c<99;c++){if(!l)return;let d=a?.$??[],u=null;for(let p of d)l?.name===p?.name&&(u=p);if(!u){a.$=[...d,l];return}let[h]=l.$??[];a=u,l=h??null}},n}function xa(t){let[e,...r]=Qf(t),n=eh(e);for(let i of r){let o=s=>i.startsWith(s);o(".")||o("/")||o("@")||o("this")||n.addPath(i)}return n}function Ui(t,e,r={},n=Tr){if(n<=0)throw new ft("Flext: Unable to get data model: The data model is too deep");let i=O=>e?.find(T=>T?.name===O)??null,o=r?.fieldName??t?.name??null,s=i(o),a=s?.order??null,l=t?.$??[],c=l?.length?"object":s?.type??qi,d=t?.name??null,u=s?.label??null,h=s?.hint??null,p=s?.min??null,g=s?.max??null,b=s?.minLength??null,x=s?.maxLength??null,v=s?.options??null,k=s?.isRequired??null,S=[];for(let O of l){let T=O?.name??null;S.push(Ui(O,e,{fieldName:o+"."+T},n-1))}let y=S.sort((O,T)=>{let A=O?.extra?.fieldName??null,U=i(A)??{},V=U?.order??null,We=U?.extra?.absoluteOrder??null,ut=T?.extra?.fieldName??null,Ue=i(ut)??{},le=Ue?.order??null,gn=Ue?.extra?.absoluteOrder??null;return Ii(V,le)!==0?Ii(V,le):Ii(We,gn)}),$=S?.length&&S.every(O=>O?.isRequired),M=et(k)?k:$;return{type:c,name:d,label:u,hint:h,min:p,max:g,minLength:b,maxLength:x,order:a,options:v,isRequired:M,extra:{fieldName:o},$:y}}function th(t){let e=s=>t?.match(s)??null,r=s=>{let a=s?.groups?.value??null;return{name:s?.groups?.name??a,value:a}},n=e(De.macroParam),i=e(De.macroNamedParam),o=e(De.macroSimpleParam);return n?r(n):i?r(i):o?r(o):null}function rh(t,e=!0){let r=t?.match(De.macroParams)??[],n=[];for(let i of r){let o=th(i);if(o)n.push(o);else if(e)throw new Ge("Flext: Unable to parse the macros: Bad token: "+I(i))}return n}function wa(t,e=!0){let r=new pa().collect(t),n=[];for(let i of r){let o=i?.trim()?.match(De.macro)??null;if(!o){if(e)throw new Ge("Flext: Unable to parse the macros: Bad macro: "+I(i));return null}let s=o?.groups?.name??null,a=o?.groups?.params??null,l=rh(a,e);n.push({name:s,params:l})}return n}function Sa(t,e=!0){let r=new ma().collect(t),n=[];for(let i of r){let o=i?.trim()?.match(De.htmlH1Somewhere)??null;if(!o){if(e)throw new Ge("Flext: Unable to parse H1: Bad HTML: "+I(i));return null}for(let s of o)n.push(String(s))}return n}function Hi(t,e,r=Tr){if(r<=0)throw new ft("Flext: Unable to verify the data: The data model is too deep");let n=[],i=a=>!pe(a,"",null,void 0),o=a=>String(a).length,s=(a,l)=>{n.push(new Gt(a,l))};for(let a of e){let l=a?.extra?.fieldName??null,c=l??a?.name??"Unknown",d=t[a.name]??null;if(!i(d)&&a?.isRequired){s(`Field '${c}' is required (${I(d)} is passed)`,l);continue}if(pe(a?.type,"number","date")&&i(a?.min)&&i(d)&&a?.min>d){s(`'${c}' field value is less than the range (${I(d)} is passed, the minimum is ${I(a?.min)})`,l);continue}if(pe(a?.type,"number","date")&&i(a?.max)&&i(d)&&a?.max<d){s(`'${c}' field value is greater than the range (${I(d)} is passed, the maximum is ${I(a?.max)})`,l);continue}if(!pe(a?.type,"object","array","mixed")&&i(a?.minLength)&&i(d)&&a?.minLength>o(d)){s(`'${c}' field value is shorter than the range (${I(d)} is passed, the minimum is ${I(a?.minLength)})`,l);continue}if(!pe(a?.type,"object","array","mixed")&&i(a?.maxLength)&&i(d)&&a?.maxLength<o(d)){s(`'${c}' field value is longer than the range (${I(d)} is passed, the maximum is ${I(a?.maxLength)})`,l);continue}if(pe(a?.type,"string")&&$e(a?.min)&&i(d)&&Number(a?.min)>o(d)){s(`'${c}' field value is shorter than the range (${I(d)} is passed, the minimum is ${I(a?.min)})`,l);continue}if(pe(a?.type,"string")&&$e(a?.max)&&i(d)&&Number(a?.max)<o(d)){s(`'${c}' field value is longer than the range (${I(d)} is passed, the maximum is ${I(a?.max)})`,l);continue}n.push(...Hi(d??{},a.$,r-1))}return n}function Gi(t){return String(t??"")}function hn(t){return pe(t,null,void 0)?null:Gi(t)}function mn(t,e=!0){let r=ji(t)&&t instanceof Date,n=typeof t=="string"&&De.dbDateStr.test(t),i=(a,l=!0)=>{let c=new Date(a);if(isNaN(c.getTime())&&l)throw new Ge("Flext: Unable to get date: The date is invalid: "+I(a));return isNaN(c.getTime())?null:c},o=(a,l=!0)=>{let[c,d,u]=a?.split("-")?.map(Number)??[];if(c&&d&&u)return F.fromtypes.Object({year:c,month:d,day:u}).toJSDate();if(l)throw new se("Flext: Unable to get date: The date is invalid: "+I(a));return null},s=(a,l=!0)=>{let c=F.fromISO(a);if(c.isValid)return c.toJSDate();if(l)throw new Ge("Flext: Unable to get date: The date is invalid: "+I(a));return null};return r?t:$e(t)?i(t,e):n?o(t,e):s(t,e)}function $a(t){let e=Jf(String(t)).trim(),r=(n,i="")=>e=e.replace(n,i);return r(`
566
566
  `," "),r(/\s{2,}/mg," "),r(/[^\p{L}\d\s]/mgu),e.trim()}function nh(t){let e=t,r=(n,i="")=>e=e.replace(n,i);return r("["),r("]"),e.trim()}function ga(t){return $e(t)||ji(t)&&t instanceof Date?t:null}function ba(t){return $e(t)?t:null}function ih(t){return et(t)?Number(t):null}function Ea(t){if(typeof t!="string")try{return JSON.parse(t)}catch{return t??null}else return t??null}function _a(...t){return t.reduce((e,r)=>Number(e)+Number(r),0)}function ya(t,e){return!!String(e).trim().match(t)}function Ii(t,e){return!et(t)&&!et(e)?0:et(t)?et(e)?t-e:-1:1}function Ca(t){return(t?.params??[]).map(r=>r?.value??null)}function Oa(t){let e=t?.name??null,r=t?.params??[],[n,...i]=r,o=y=>{let $=i?.find(M=>M?.name===y)??null;return $&&$?.value?$?.value??null:$&&$?.name?!0:null},s=Gi(o("type")??qi),a=hn(n?.value),l=hn(o("label")),c=hn(o("descr")),d=hn(o("hint")),u=ga(o("min")),h=ga(o("max")),p=ba(o("minLength")),g=ba(o("maxLength")),b=ih(o("order")),x=Ea(o("value")),v=!!o("required");if(!a)throw new se("Unable to get field: The 'name' param is not set: "+I(a));let k=nh(a);return{type:s,name:k,label:l,descr:c,hint:d,min:u,max:h,minLength:p,maxLength:g,order:b,value:x,isRequired:v,extra:{macroName:e}}}function Ta(t){let e=t?.params??[],[r,...n]=e,i=h=>{let p=n?.find(g=>g?.name===h)??null;return p&&p?.value?p?.value??null:p&&p?.name?!0:null},o=Gi(i("type")??qi),s=r?.value??null,a=i("for")??null,l=i("label")??null,c=i("descr")??null,d=Ea(i("value")),u=!!i("disabled");if(!s)throw new se("Unable to get field option: The 'name' param is not set: "+I(s));if(!a)throw new se(`Unable to get field option '${s}': The 'for' param is not set: `+I(s));return{type:o,name:s,fieldName:a,label:l,descr:c,value:d,isDisabled:u}}function Ma(t,e){let r=n=>t?.filter(i=>i?.fieldName===n)??[];for(let n of e)r(n.name)?.length&&(n.options=r(n.name))}function Pa(t){for(let[e,r]of t.entries())r?.extra?r.extra.absoluteOrder=e:r.extra={absoluteOrder:e}}function te(t={}){return{helpers:t?.helpers??null}}var De=class{static dbDateStr=/^\d+-\d+-\d+$/;static macro=/^@(?<name>.+?) (?<params>.+)$/;static macroParams=/(?<param>".+?")|(?<namedParam>[a-zA-Z0-9]+=".+?")|(?<simplaeParam>[a-zA-Z0-9]+)/gm;static macroParam=/^"(?<value>.+)"$/;static macroNamedParam=/^(?<name>.+)="(?<value>.+)"$/;static macroSimpleParam=/^(?<name>[a-zA-Z]+)$/;static htmlH1Somewhere=/\<h1.*?\>(?<value>.*)\<\/h1.*?\>/gs},pn=class{static macro(e){return ya(De.macro,e)}static htmlH1Somewhere(e){return ya(De.htmlH1Somewhere,e)}};var za={};Qi(za,{array:()=>sh,cond:()=>ah,date:()=>lh,match:()=>uh,math:()=>ph,media:()=>gh,number:()=>Bh,put:()=>Uh,string:()=>Hh});function Zi(t){let e=t?.args??[],[r,n,i]=e,o=(s,a)=>{let l=a?.split(".")??[],c=[];for(let d of s){let u=d;for(let h of l)u=u[h];c.push(u)}return c};switch(r){case"destruct":return o(n,i);case"check":return Array.isArray(n);default:return r}}function Qk(t){let e=t?.args??[],[r,n]=e;return Zi({...t,args:["destruct",r,n]})}function e3(t){let e=t?.args??[],[r]=e;return Zi({...t,args:["check",r]})}var sh=te({helpers:{op:Zi,destruct:Qk,check:e3,__default:Zi}});function ct(t){let e=t?.args??[],r=t?.namedArgs??{},[n,i,o,...s]=e,{soft:a}=r;if(n==="not")return!i;if(a)switch(i){case"equal":return n==o;case"notEqual":return n!=o;default:throw new ge("Condition: Unknown operation: "+I(i))}let l=(...d)=>d.reduce((u,h)=>u&&h),c=(...d)=>d.reduce((u,h)=>u||h);switch(i){case"equal":return n===o;case"notEqual":return n!==o;case"and":return l(n,o,...s);case"or":return c(n,o,...s);case"greater":return Number(n)>Number(o);case"less":return Number(n)<Number(o);default:throw new ge("Condition: Unknown operation: "+I(i))}}function t3(t){let e=t?.args??[],[r]=e;return ct({...t,args:["not",r]})}function r3(t){let e=t?.args??[],[r,n]=e;return ct({...t,args:[r,"equal",n]})}function n3(t){let e=t?.args??[],[r,n]=e;return ct({...t,args:[r,"notEqual",n]})}function i3(t){let e=t?.args??[],[r,...n]=e;return ct({...t,args:[r,"and",...n]})}function o3(t){let e=t?.args??[],[r,...n]=e;return ct({...t,args:[r,"or",...n]})}function s3(t){let e=t?.args??[],[r,n]=e;return ct({...t,args:[r,"greater",n]})}function a3(t){let e=t?.args??[],[r,n]=e;return ct({...t,args:[r,"less",n]})}var ah=te({helpers:{op:ct,not:t3,equal:r3,notEqual:n3,and:i3,or:o3,greater:s3,less:a3,__default:ct}});function me(t){let e=t?.flext??{},r=t?.args??[],n=t?.namedArgs??{},[i,o]=r,{padding:s,genitive:a,timeZone:l,lang:c}=n;if(!i)return null;let d=F.local();i!=="now"&&(d=F.fromJSDate(mn(i))),(l||e?.timeZone)&&(d=d.setZone(l??e?.timeZone)),(c||e?.lang)&&(d=d.setLocale(c??e?.lang));let u=(h,p=2)=>String(h||"").padStart(Number(p),"0");if(et(s))switch(o){case"seconds":return u(d.second,s);case"minutes":return u(d.minute,s);case"hours":return u(d.hour,s);case"day":return u(d.day,s);case"month":return u(d.month,s);case"year":return u(d.year,4);default:throw new ge(`Date: Operation ${I(o)} is not compatible with argument 'padding'`)}if(a){if(o==="monthText")return d.toLocaleString({day:"numeric",month:"long"}).replace(/[^\p{L}]/gu,"").toLowerCase();throw new ge(`Date: Operation ${I(o)} is not compatible with argument 'genitive'`)}switch(o){case"seconds":return d.second;case"minutes":return d.minute;case"hours":return d.hour;case"day":return d.day;case"month":return d.month;case"monthText":return d.toLocaleString({month:"long"}).toLowerCase();case"year":return d.year;case"format":return d.toLocaleString();case"text":return d.toLocaleString({day:"numeric",month:"long",year:"numeric"});case"unix":return d.toMillis();case"iso":return d.toISOTime();default:return d}}function l3(t){return me({...t,args:["now"]})}function c3(t){let e=t?.args??[],[r]=e,n=t?.namedArgs??{},i=n?.padding??2;return me({...t,args:[r,"seconds"],namedArgs:{...n,padding:i}})}function u3(t){let e=t?.args??[],[r]=e,n=t?.namedArgs??{},i=n?.padding??2;return me({...t,args:[r,"minutes"],namedArgs:{...n,padding:i}})}function d3(t){let e=t?.args??[],[r]=e,n=t?.namedArgs??{},i=n?.padding??2;return me({...t,args:[r,"hours"],namedArgs:{...n,padding:i}})}function f3(t){let e=t?.args??[],[r]=e,n=t?.namedArgs??{},i=n?.padding??2;return me({...t,args:[r,"day"],namedArgs:{...n,padding:i}})}function h3(t){let e=t?.args??[],[r]=e,n=t?.namedArgs??{},i=n?.padding??2;return me({...t,args:[r,"month"],namedArgs:{...n,padding:i}})}function p3(t){let e=t?.args??[],[r]=e,n=t?.namedArgs??{},i=!n?.nominative;return me({...t,args:[r,"monthText"],namedArgs:{...n,genitive:i}})}function m3(t){let e=t?.args??[],[r]=e,n=t?.namedArgs??{},i=n?.padding??2;return me({...t,args:[r,"year"],namedArgs:{...n,padding:i}})}function Na(t){let e=t?.args??[],[r]=e;return me({...t,args:[r,"format"]})}function g3(t){let e=t?.args??[],[r]=e;return me({...t,args:[r,"text"]})}function b3(t){let e=t?.args??[],[r]=e;return me({...t,args:[r,"unix"]})}function y3(t){let e=t?.args??[],[r]=e;return me({...t,args:[r,"iso"]})}var lh=te({helpers:{op:me,now:l3,seconds:c3,minutes:u3,hours:d3,day:f3,month:h3,monthText:p3,year:m3,format:Na,text:g3,unix:b3,iso:y3,__default:me}});function v3(t){let e=t?.args??[],[r]=e,n=t?.self??null,i=t?.getContent??null;return n.__flext_match_value=r,n.__flext_match_isCompleted=!1,i()}function ch(t){let e=t?.args??[],r=t?.self??null,n=r.__flext_match_value??null,i=t?.getContent??null;if(!r.__flext_match_isCompleted){for(let o of e)if(n===o)return r.__flext_match_isCompleted=!0,i()}return""}function k3(t){let r=(t?.self??null).__flext_match_value??null;return ch({...t,args:[r]})}var uh=te({helpers:{case:ch,fallback:k3,__default:v3}});function Ee(t){let e=t?.args??[],[r,n,i,...o]=e,s=(...l)=>{let[c,...d]=l,u=Math[c]??null;if(u)return u(...d);throw new ge("Math: Unknown operation: "+I(c))},a=(...l)=>{let c=[];for(let d of l)if($e(d))c.push(d);else if(Array.isArray(d)&&d.every($e))c.push(...d);else throw new se("Math: Unable to sum: The given arguments are not numbers: "+I(l));return c};switch(n){case"plus":case"sum":return _a(...a(r,i||0,...o));case"minus":return Number(r)-Number(i||0);case"multiply":return Number(r)*Number(i||1);case"divide":return Number(r)/Number(i||1);case"intDivide":return Number(r)%Number(i||1);case"power":return Number(r)**Number(i||1);default:return s(...e)}}function x3(t){let e=t?.args??[],[r,n,...i]=e;return Ee({...t,args:[r,"plus",n,...i]})}function w3(t){let e=t?.args??[],[r,n,...i]=e;return Ee({...t,args:[r,"sum",n,...i]})}function S3(t){let e=t?.args??[],[r,n]=e;return Ee({...t,args:[r,"minus",n]})}function dh(t){let e=t?.args??[],[r,n]=e;return Ee({...t,args:[r,"multiply",n]})}function fh(t){let e=t?.args??[],[r,n]=e;return Ee({...t,args:[r,"divide",n]})}function $3(t){let e=t?.args??[],[r,n]=e;return Ee({...t,args:[r,"intDivide",n]})}function hh(t){let e=t?.args??[],[r,n]=e;return Ee({...t,args:[r,"power",n]})}function E3(t){let e=t?.args??[],[r,n]=e,i=(o,s)=>Ee({...t,args:[o,s]});if(!n)return i("round",r);switch(n){case"floor":return i("floor",r);case"ceil":return i("ceil",r);case"trunc":return i("trunc",r);default:throw new ge("Math: Unknown operation: "+I(n))}}function _3(t){let e=t?.args??[],[r]=e;return Ee({...t,args:["sqrt",r]})}function C3(t){let e=t?.args??[],[r]=e;return Ee({...t,args:["cbrt",r]})}function O3(t){let e=t?.args??[],[r]=e;return Ee({...t,args:["abs",r]})}var ph=te({helpers:{op:Ee,plus:x3,sum:w3,minus:S3,mul:dh,multiply:dh,div:fh,divide:fh,intDivide:$3,pow:hh,power:hh,round:E3,sqrt:_3,cbrt:C3,abs:O3,__default:Ee}});function mh(t){let e=t?.flext??{},r=t?.args??[],[n]=r,o=(e?.assets??{})[n]??null;if(o)return URL.createObjectURL(o);throw new ht(`Media: Unable to get the asset: Asset '${n}' does not exist`)}var gh=te({helpers:{url:mh,__default:mh}});var jh=yn(Fh(),1);var qh={useLongScale:!1,baseSeparator:" ",unitSeparator:" ",base:{"0":"\u043D\u04E9\u043B","1":"\u0431\u0456\u0440","2":"\u0435\u043A\u0456","3":"\u04AF\u0448","4":"\u0442\u04E9\u0440\u0442","5":"\u0431\u0435\u0441","6":"\u0430\u043B\u0442\u044B","7":"\u0436\u0435\u0442\u0456","8":"\u0441\u0435\u0433\u0456\u0437","9":"\u0442\u043E\u0493\u044B\u0437","10":"\u043E\u043D","11":"\u043E\u043D \u0431\u0456\u0440","12":"\u043E\u043D \u0435\u043A\u0456","13":"\u043E\u043D \u04AF\u0448","14":"\u043E\u043D \u0442\u04E9\u0440\u0442","15":"\u043E\u043D \u0431\u0435\u0441","16":"\u043E\u043D \u0430\u043B\u0442\u044B","17":"\u043E\u043D \u0436\u0435\u0442\u0456","18":"\u043E\u043D \u0441\u0435\u0433\u0456\u0437","19":"\u043E\u043D \u0442\u043E\u0493\u044B\u0437","20":"\u0436\u0438\u044B\u0440\u043C\u0430","30":"\u043E\u0442\u044B\u0437","40":"\u049B\u044B\u0440\u044B\u049B","50":"\u0435\u043B\u0443","60":"\u0430\u043B\u043F\u044B\u0441","70":"\u0436\u0435\u0442\u043F\u0456\u0441","80":"\u0441\u0435\u043A\u0441\u0435\u043D","90":"\u0442\u043E\u049B\u0441\u0430\u043D","100":"\u0436\u04AF\u0437","200":"\u0435\u043A\u0456 \u0436\u04AF\u0437","300":"\u04AF\u0448 \u0436\u04AF\u0437","400":"\u0442\u04E9\u0440\u0442 \u0436\u04AF\u0437","500":"\u0431\u0435\u0441 \u0436\u04AF\u0437","600":"\u0430\u043B\u0442\u044B \u0436\u04AF\u0437","700":"\u0436\u0435\u0442\u0456 \u0436\u04AF\u0437","800":"\u0441\u0435\u0433\u0456\u0437 \u0436\u04AF\u0437","900":"\u0442\u043E\u0493\u044B\u0437 \u0436\u04AF\u0437"},alternativeBase:{},units:[{useBaseInstead:!0,useBaseException:[]},{singular:"\u043C\u044B\u04A3",plural:"\u043C\u044B\u04A3"},{singular:"\u043C\u0438\u043B\u043B\u0438\u043E\u043D",plural:"\u043C\u0438\u043B\u043B\u0438\u043E\u043D"},{singular:"\u043C\u0438\u043B\u043B\u0438\u0430\u0440\u0434",plural:"\u043C\u0438\u043B\u043B\u0438\u0430\u0440\u0434"},{singular:"\u0442\u0440\u0438\u043B\u043B\u0438\u043E\u043D",plural:"\u0442\u0440\u0438\u043B\u043B\u0438\u043E\u043D"},{singular:"\u043A\u0432\u0430\u0434\u0440\u0438\u043B\u043B\u0438\u043E\u043D",plural:"\u043A\u0432\u0430\u0434\u0440\u0438\u043B\u043B\u0438\u043E\u043D"},{singular:"\u043A\u0432\u0438\u043D\u0442\u0438\u043B\u043B\u0438\u043E\u043D",plural:"\u043A\u0432\u0438\u043D\u0442\u0438\u043B\u043B\u0438\u043E\u043D"},{singular:"\u0441\u0435\u043A\u0441\u0442\u0438\u043B\u043B\u0438\u043E\u043D",plural:"\u0441\u0435\u043A\u0441\u0442\u0438\u043B\u043B\u0438\u043E\u043D"},{singular:"\u0441\u0435\u043F\u0442\u0438\u043B\u043B\u0438\u043E\u043D",plural:"\u0441\u0435\u043F\u0442\u0438\u043B\u043B\u0438\u043E\u043D"},{singular:"\u043E\u043A\u0442\u0438\u043B\u043B\u0438\u043E\u043D",plural:"\u043E\u043A\u0442\u0438\u043B\u043B\u0438\u043E\u043D"},{singular:"\u043D\u043E\u043D\u0438\u043B\u043B\u0438\u043E\u043D",plural:"\u043D\u043E\u043D\u0438\u043B\u043B\u0438\u043E\u043D"},{singular:"\u0434\u0435\u0446\u0438\u043B\u043B\u0438\u043E\u043D",plural:"\u0434\u0435\u0446\u0438\u043B\u043B\u0438\u043E\u043D"}],unitExceptions:{"1000":"\u043C\u044B\u04A3"}};var Vh={"ar-EG":"ar","az-AZ":"az","en-IN":"enIndian","en-GB":"uk","en-US":"en",eo:"eo","es-ES":"es","fr-FR":"fr","id-ID":"id","pt-BR":"pt","pt-PT":"ptPT","ru-RU":"ru","tr-TR":"tr","vi-VN":"vi"};var K3="en",J3={"kk-KZ":qh};function Yi(t){let e=t?.flext??{},r=t?.args??[],n=t?.namedArgs??{},[i,o]=r,{lang:s,strict:a}=n,l=d=>Vh[d]??J3[d]??null,c=l(s)??l(e?.lang)??K3;switch(i){case"text":return(0,jh.default)(Number(o),{lang:c});case"check":return a?typeof o=="number":$e(o);default:return Number(i)}}function X3(t){let e=t?.args??[],[r]=e;return String(Yi({...t,args:["text",r]}))}function Q3(t){let e=t?.args??[],[r]=e;return Yi({...t,args:["check",r]})}var Bh=te({helpers:{op:Yi,text:X3,check:Q3,__default:Yi}});var Da=yn(ua(),1);var e4="text-blue-500";function Wh(t){let e=t?.args??[],[r,n]=e,i=mn(r,!1);return i&&!$e(r)&&!pe(r,!0,!1)?Na(i):r??n??""}function t4(t){let r=(t?.namedArgs??{})?.color??e4;return r?new Da.SafeString(`<span class="${r}">${Wh(t)}</span>`):new Da.SafeString(t)}var Uh=te({helpers:{noColor:Wh,__default:t4}});function Ki(t){let e=t?.args??[],[r,n]=e;switch(r){case"json":return JSON.parse(n);case"check":return typeof n=="string";default:return r}}function r4(t){let e=t?.args??[],[r]=e;return Ki({...t,args:["json",r]})}function n4(t){let e=t?.args??[],[r]=e;return Ki({...t,args:["check",r]})}var Hh=te({helpers:{op:Ki,json:r4,check:n4,__default:Ki}});var i4="__default",Ia=10,Ra=class{onGetProcessed=o4;onGetAst=va;constructor(e=null,r={},n={}){e&&this.setTemplate(e),this.setData({...this.data,...r}),this.setHelpers({...this.helpers,...n})}setTemplate(e){this.data={},this.helpers={};let r=this.onGetProcessed(e);return this.ast=this.onGetAst(r),this}setData(e){return this.data=e,this}setHelpers(e){return this.helpers=e,this}addHelper(e,r){return this.helpers[e]=r,this}setOnGetProcessed(e){return this.onGetProcessed=e,this}setOnGetAst(e){return this.onGetAst=e,this}getHtml(e,r){let n=Bi(this.ast);if(!n)throw new se("Flext: Unable to get HTML: No template");return Wi(n,e??this.data,r??this.helpers)}async getCss(e,r={}){let n=Bi(this.ast),i=r?.helpers??{},o={...this.helpers,...i};if(!n)throw new se("Flext: Unable to get CSS: No template");return await ka(n,e??this.data,{...r,helpers:o})}get html(){return this.getHtml()}},Fa=class extends Ra{onGetTitle=Sa;onGetMacro=wa;constructor(e=null,r={},n={}){super(null,r,n),e&&this.setTemplate(e),this.setData({...this.data,...r}),this.setHelpers({...this.helpers,...n})}useModule(...e){for(let r of e)this.addModule(r,za[r]);return this}setTemplate(e){super.setTemplate(e);let[r]=this.onGetTitle(this.ast),n=this.onGetMacro(this.ast),i=(...k)=>n?.filter(S=>pe(S?.name,...k))??null,o=k=>{let[S]=i(k),[y]=S?.params??[];return y?.value??null},s=o("v"),a=o("lang"),l=o("title"),c=o("timeZone"),d=i("use"),u=o("lineHeight"),h=i("option"),p=i("group","field"),g=h?.map(Ta)??null,b=p?.map(Oa)??[];Ma(g,b),Pa(b);let x=b.filter(k=>k?.extra?.macroName==="group");for(let k of x)k.type="object";s&&this.setVersion(s),a&&this.setLang(a),(l||r)&&this.setTitle(l??$a(r)),c&&this.setTimeZone(c),u&&this.setLineHeight(Number(u)),b&&b?.length&&this.setFields(b);let v=d.map(Ca).flat();return this.useModule(...v),this}setVersion(e){return this.version=e,this}setLang(e){return this.lang=e,this}setTitle(e){return this.title=e,this}setTimeZone(e){return this.timeZone=e,this}setLineHeight(e){return this.lineHeight=e,this}setAssets(e){return this.assets=e,this}addAsset(e,r){return this.assets[e]=r,this}setFields(e){return this.fields=e,this}addModule(e,r){let n=r?.helpers??{};for(let i in n){if(!Vi(n,i))continue;let o=n[i],s=i===i4,a=this,l=function(...c){let d=c?.slice(0,-1)??[],u=c[c.length-1]??{},h=u?.hash??{},p=this;return o({flext:a,args:d,options:u,namedArgs:h,self:p,getContent:()=>u?.fn(p)??null})};s?this.addHelper(e,l):this.addHelper(e+":"+i,l)}return this}setOnGetTitle(e){return this.onGetTitle=e,this}setOnGetMacro(e){return this.onGetMacro=e,this}getDataModel(e=Ia){let r=a=>{for(let l in this.helpers)if(Vi(this.helpers,l)){if(a?.name===l)return!0}else continue;return!1},n=a=>!r(a),i=a=>Ui(a,this.fields,{},e);return(xa(this.ast)?.$??[]).filter(n).map(i)}getValidationErrors(e,r=Ia){return Hi(e??this.data,this.model,r)}getIsValid(e,r=Ia){return!this.getValidationErrors(e??this.data,r)?.length}get model(){return this.getDataModel()}get validationErrors(){return this.getValidationErrors()}get errors(){return this.validationErrors}get isValid(){return this.getIsValid()}};function o4(t){return t}var qw=Fa;export{se as BaseError,Ht as BaseThrowable,Ge as BaseWarning,i4 as DEFAULT_HELPER_NAME,Ia as DEFAULT_MODEL_DEPTH,Fa as Flext,ft as PotentialLoopError,Ra as SimpleFlext,Gt as TemplateDataValidationError,ht as TemplateError,ge as TemplateSyntaxError,qw as default,o4 as defaultGetProcessed,ja as errors,oh as lib,za as modules,Qh as types};
567
+ //# sourceMappingURL=index.js.map