@json-to-office/jto 3.0.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/client/assets/{HomePage-BlzZ7qG4.js → HomePage-tunH4yrJ.js} +4 -4
  3. package/dist/client/assets/{HomePage-BlzZ7qG4.js.map → HomePage-tunH4yrJ.js.map} +1 -1
  4. package/dist/client/assets/{JsonEditorPage-kWuP_kL3.js → JsonEditorPage-BoWB1SW8.js} +3 -3
  5. package/dist/client/assets/{JsonEditorPage-kWuP_kL3.js.map → JsonEditorPage-BoWB1SW8.js.map} +1 -1
  6. package/dist/client/assets/{MonacoPluginProvider-Dbv1PrO2.js → MonacoPluginProvider-CZLdOK0o.js} +5 -5
  7. package/dist/client/assets/{MonacoPluginProvider-Dbv1PrO2.js.map → MonacoPluginProvider-CZLdOK0o.js.map} +1 -1
  8. package/dist/client/assets/{_virtual_jto-plugin-type-libs-B6KyD9RL.js → _virtual_jto-plugin-type-libs-BP6g-o7Z.js} +104 -63
  9. package/dist/client/assets/{_virtual_jto-plugin-type-libs-B6KyD9RL.js.map → _virtual_jto-plugin-type-libs-BP6g-o7Z.js.map} +1 -1
  10. package/dist/client/assets/_virtual_jto-sandbox-runtime-U0ykVFSo.js +2 -0
  11. package/dist/client/assets/_virtual_jto-sandbox-runtime-U0ykVFSo.js.map +1 -0
  12. package/dist/client/assets/{editor-CwEocOY2.js → editor-C6m04j66.js} +2 -2
  13. package/dist/client/assets/{editor-CwEocOY2.js.map → editor-C6m04j66.js.map} +1 -1
  14. package/dist/client/assets/{editor-monaco-json-D_oiidNg.js → editor-monaco-json-DsYufbUM.js} +2 -2
  15. package/dist/client/assets/{editor-monaco-json-D_oiidNg.js.map → editor-monaco-json-DsYufbUM.js.map} +1 -1
  16. package/dist/client/assets/index-B7DLwiJH.js +27 -0
  17. package/dist/client/assets/index-B7DLwiJH.js.map +1 -0
  18. package/dist/client/assets/{index-UheDso2P.js → index-BDoOeKmB.js} +2 -2
  19. package/dist/client/assets/{index-UheDso2P.js.map → index-BDoOeKmB.js.map} +1 -1
  20. package/dist/client/assets/{preview-CWdUATNl.js → preview-CutpTQQJ.js} +2 -2
  21. package/dist/client/assets/{preview-CWdUATNl.js.map → preview-CutpTQQJ.js.map} +1 -1
  22. package/dist/client/assets/{useQualityAnalysis-Cl4QPeOT.js → useQualityAnalysis-k0GXJxAw.js} +2 -2
  23. package/dist/client/assets/{useQualityAnalysis-Cl4QPeOT.js.map → useQualityAnalysis-k0GXJxAw.js.map} +1 -1
  24. package/dist/client/index.html +1 -1
  25. package/dist/client/templates/client-report-blocks.docx.json +779 -17
  26. package/dist/client/templates/media/client-report-blocks/delivery-model.png +0 -0
  27. package/package.json +4 -4
  28. package/dist/client/assets/_virtual_jto-sandbox-runtime-Bzo2M5U7.js +0 -2
  29. package/dist/client/assets/_virtual_jto-sandbox-runtime-Bzo2M5U7.js.map +0 -1
  30. package/dist/client/assets/index-DFJaEoi0.js +0 -27
  31. package/dist/client/assets/index-DFJaEoi0.js.map +0 -1
@@ -1,2 +0,0 @@
1
- const e='"use strict";(()=>{var pb=Object.create;var os=Object.defineProperty;var mb=Object.getOwnPropertyDescriptor;var ub=Object.getOwnPropertyNames;var db=Object.getPrototypeOf,fb=Object.prototype.hasOwnProperty;var hb=(e,t,n)=>t in e?os(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var gb=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),tt=(e,t)=>{for(var n in t)os(e,n,{get:t[n],enumerable:!0})},yb=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ub(t))!fb.call(e,i)&&i!==n&&os(e,i,{get:()=>t[i],enumerable:!(o=mb(t,i))||o.enumerable});return e};var qu=(e,t,n)=>(n=e!=null?pb(db(e)):{},yb(t||!e||!e.__esModule?os(n,"default",{value:e,enumerable:!0}):n,e));var j=(e,t,n)=>hb(e,typeof t!="symbol"?t+"":t,n);var Tp=gb((Cq,th)=>{th.exports={}});var np={};tt(np,{Any:()=>Yt,Argument:()=>wi,Array:()=>Er,AsyncIterator:()=>Nr,Awaited:()=>Ur,BigInt:()=>jr,Boolean:()=>Xn,Capitalize:()=>Vi,Clone:()=>ae,CloneRest:()=>wb,CloneType:()=>dn,Composite:()=>ki,Const:()=>Ri,Constructor:()=>kr,ConstructorParameters:()=>ji,CreateType:()=>y,Date:()=>to,Enum:()=>Fi,Exclude:()=>_r,ExcludeFromMappedResult:()=>_l,ExcludeFromTemplateLiteral:()=>Bl,Extends:()=>Br,ExtendsCheck:()=>Mr,ExtendsFromMappedKey:()=>Ml,ExtendsFromMappedResult:()=>Dl,ExtendsResolverError:()=>xs,ExtendsResult:()=>b,ExtendsUndefinedCheck:()=>Sn,Extract:()=>Vr,ExtractFromMappedResult:()=>Kl,ExtractFromTemplateLiteral:()=>Vl,FormatRegistry:()=>Ft,FromTypes:()=>ko,Function:()=>gt,Hint:()=>We,Increment:()=>Qb,Index:()=>Zt,IndexFromComputed:()=>YO,IndexFromMappedKey:()=>Tl,IndexFromMappedResult:()=>Pl,IndexFromPropertyKey:()=>$l,IndexFromPropertyKeys:()=>Eo,IndexPropertyKeys:()=>Ye,InstanceType:()=>Ui,Instantiate:()=>Bi,Integer:()=>_i,Intersect:()=>Ee,IntersectEvaluated:()=>Ai,Intrinsic:()=>_t,IntrinsicFromMappedKey:()=>zl,IsTemplateLiteralExpressionFinite:()=>On,IsTemplateLiteralFinite:()=>Ti,Iterator:()=>Fr,JavaScriptTypeBuilder:()=>$s,JsonTypeBuilder:()=>Ro,KeyOf:()=>Dr,KeyOfFromMappedResult:()=>El,KeyOfPattern:()=>eo,KeyOfPropertyEntries:()=>Ni,KeyOfPropertyKeys:()=>Ze,KeyOfPropertyKeysToRest:()=>ef,Kind:()=>g,KindGuard:()=>Jt,Literal:()=>F,Lowercase:()=>Ki,Mapped:()=>vi,MappedFunctionReturnType:()=>Yd,MappedKey:()=>bO,MappedResult:()=>q,Module:()=>Wi,Never:()=>N,Not:()=>Hi,Null:()=>ro,Number:()=>Je,Object:()=>K,Omit:()=>er,OmitFromMappedKey:()=>Jl,OmitFromMappedResult:()=>Wl,Optional:()=>ve,OptionalFromMappedResult:()=>Ll,OptionalKind:()=>ke,Parameters:()=>Ji,Partial:()=>Kr,PartialFromMappedResult:()=>Ql,PatternBoolean:()=>us,PatternBooleanExact:()=>eO,PatternNever:()=>_d,PatternNeverExact:()=>bl,PatternNumber:()=>To,PatternNumberExact:()=>Lr,PatternString:()=>ds,PatternStringExact:()=>vr,Pick:()=>tr,PickFromMappedKey:()=>Zl,PickFromMappedResult:()=>Yl,Promise:()=>Qn,Readonly:()=>_e,ReadonlyFromMappedResult:()=>Al,ReadonlyKind:()=>Lt,ReadonlyOptional:()=>ao,Record:()=>co,RecordKey:()=>ql,RecordPattern:()=>Di,RecordValue:()=>Mi,Recursive:()=>Yi,Ref:()=>yt,RegExp:()=>Xi,Required:()=>Gr,RequiredFromMappedResult:()=>ep,Rest:()=>Zi,ReturnType:()=>Qi,SetComplement:()=>hO,SetDistinct:()=>Ol,SetIncludes:()=>fs,SetIntersect:()=>Vd,SetIntersectMany:()=>xl,SetIsSubset:()=>dO,SetUnion:()=>fO,SetUnionMany:()=>Sl,String:()=>je,Symbol:()=>no,TModule:()=>ws,TemplateLiteral:()=>Zn,TemplateLiteralExpressionGenerate:()=>vo,TemplateLiteralFiniteError:()=>hs,TemplateLiteralGenerate:()=>Yn,TemplateLiteralGenerateError:()=>gs,TemplateLiteralParse:()=>Hn,TemplateLiteralParseExact:()=>Jn,TemplateLiteralParserError:()=>Pi,TemplateLiteralPattern:()=>bs,TemplateLiteralPatternError:()=>ys,TemplateLiteralSyntax:()=>Cl,TemplateLiteralToUnion:()=>xn,Transform:()=>ea,TransformDecodeBuilder:()=>Cs,TransformEncodeBuilder:()=>Ps,TransformKind:()=>me,Tuple:()=>Xe,Type:()=>r,TypeBoxError:()=>v,TypeGuard:()=>d,TypeRegistry:()=>Ut,Uint8Array:()=>io,Uncapitalize:()=>Gi,Undefined:()=>oo,Union:()=>V,UnionEvaluated:()=>Xt,Unknown:()=>st,Unsafe:()=>ta,Uppercase:()=>qi,ValueGuard:()=>Me,Void:()=>ra});var Me={};tt(Me,{HasPropertyKey:()=>is,IsArray:()=>xe,IsAsyncIterator:()=>sl,IsBigInt:()=>di,IsBoolean:()=>mr,IsDate:()=>qn,IsFunction:()=>cl,IsIterator:()=>ll,IsNull:()=>pl,IsNumber:()=>rt,IsObject:()=>ee,IsRegExp:()=>fi,IsString:()=>ne,IsSymbol:()=>ml,IsUint8Array:()=>$r,IsUndefined:()=>Se});function is(e,t){return t in e}function sl(e){return ee(e)&&!xe(e)&&!$r(e)&&Symbol.asyncIterator in e}function xe(e){return Array.isArray(e)}function di(e){return typeof e=="bigint"}function mr(e){return typeof e=="boolean"}function qn(e){return e instanceof globalThis.Date}function cl(e){return typeof e=="function"}function ll(e){return ee(e)&&!xe(e)&&!$r(e)&&Symbol.iterator in e}function pl(e){return e===null}function rt(e){return typeof e=="number"}function ee(e){return typeof e=="object"&&e!==null}function fi(e){return e instanceof globalThis.RegExp}function ne(e){return typeof e=="string"}function ml(e){return typeof e=="symbol"}function $r(e){return e instanceof globalThis.Uint8Array}function Se(e){return e===void 0}function bb(e){return e.map(t=>as(t))}function Ob(e){return new Date(e.getTime())}function xb(e){return new Uint8Array(e)}function Sb(e){return new RegExp(e.source,e.flags)}function Ib(e){let t={};for(let n of Object.getOwnPropertyNames(e))t[n]=as(e[n]);for(let n of Object.getOwnPropertySymbols(e))t[n]=as(e[n]);return t}function as(e){return xe(e)?bb(e):qn(e)?Ob(e):$r(e)?xb(e):fi(e)?Sb(e):ee(e)?Ib(e):e}function ae(e){return as(e)}function wb(e){return e.map(t=>dn(t))}function dn(e,t){return t===void 0?ae(e):ae({...t,...e})}function hi(e){return E(e)&&globalThis.Symbol.asyncIterator in e}function gi(e){return E(e)&&globalThis.Symbol.iterator in e}function ss(e){return E(e)&&(globalThis.Object.getPrototypeOf(e)===Object.prototype||globalThis.Object.getPrototypeOf(e)===null)}function Cb(e){return E(e)&&!L(e)&&dr(e.constructor)&&e.constructor.name!=="Object"}function yi(e){return e instanceof globalThis.Promise}function Ke(e){return e instanceof Date&&globalThis.Number.isFinite(e.getTime())}function ul(e){return e instanceof globalThis.Map}function dl(e){return e instanceof globalThis.Set}function Pb(e){return e instanceof globalThis.RegExp}function ht(e){return globalThis.ArrayBuffer.isView(e)}function $b(e){return e instanceof globalThis.Int8Array}function zn(e){return e instanceof globalThis.Uint8Array}function Tb(e){return e instanceof globalThis.Uint8ClampedArray}function Ab(e){return e instanceof globalThis.Int16Array}function Lb(e){return e instanceof globalThis.Uint16Array}function vb(e){return e instanceof globalThis.Int32Array}function Eb(e){return e instanceof globalThis.Uint32Array}function Nb(e){return e instanceof globalThis.Float32Array}function kb(e){return e instanceof globalThis.Float64Array}function Rb(e){return e instanceof globalThis.BigInt64Array}function jb(e){return e instanceof globalThis.BigUint64Array}function T(e,t){return t in e}function E(e){return e!==null&&typeof e=="object"}function L(e){return globalThis.Array.isArray(e)&&!globalThis.ArrayBuffer.isView(e)}function se(e){return e===void 0}function ur(e){return e===null}function Ht(e){return typeof e=="boolean"}function ce(e){return typeof e=="number"}function bi(e){return globalThis.Number.isInteger(e)}function At(e){return typeof e=="bigint"}function Z(e){return typeof e=="string"}function dr(e){return typeof e=="function"}function fr(e){return typeof e=="symbol"}function nt(e){return At(e)||Ht(e)||ur(e)||ce(e)||Z(e)||fr(e)||se(e)}var Ce;(function(e){e.InstanceMode="default",e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1;function t(s,c){return e.ExactOptionalPropertyTypes?c in s:s[c]!==void 0}e.IsExactOptionalProperty=t;function n(s){let c=E(s);return e.AllowArrayObject?c:c&&!L(s)}e.IsObjectLike=n;function o(s){return n(s)&&!(s instanceof Date)&&!(s instanceof Uint8Array)}e.IsRecordLike=o;function i(s){return e.AllowNaN?ce(s):Number.isFinite(s)}e.IsNumberLike=i;function a(s){let c=se(s);return e.AllowNullVoid?c||s===null:c}e.IsVoidLike=a})(Ce||(Ce={}));function Fb(e){return globalThis.Object.freeze(e).map(t=>Oi(t))}function Ub(e){let t={};for(let n of Object.getOwnPropertyNames(e))t[n]=Oi(e[n]);for(let n of Object.getOwnPropertySymbols(e))t[n]=Oi(e[n]);return globalThis.Object.freeze(t)}function Oi(e){return xe(e)?Fb(e):qn(e)?e:$r(e)?e:fi(e)?e:ee(e)?Ub(e):e}function y(e,t){let n=t!==void 0?{...t,...e}:e;switch(Ce.InstanceMode){case"freeze":return Oi(n);case"clone":return ae(n);default:return n}}var v=class extends Error{constructor(t){super(t)}};var Jt={};tt(Jt,{IsAny:()=>cs,IsArgument:()=>ls,IsArray:()=>vt,IsAsyncIterator:()=>fn,IsBigInt:()=>hn,IsBoolean:()=>hr,IsComputed:()=>Et,IsConstructor:()=>Nt,IsDate:()=>zu,IsFunction:()=>kt,IsImport:()=>Db,IsInteger:()=>Rt,IsIntersect:()=>de,IsIterator:()=>gn,IsKind:()=>Ar,IsKindOf:()=>U,IsLiteral:()=>Be,IsLiteralBoolean:()=>Vb,IsLiteralNumber:()=>_b,IsLiteralString:()=>Bb,IsLiteralValue:()=>xi,IsMappedKey:()=>ot,IsMappedResult:()=>le,IsNever:()=>Tr,IsNot:()=>Wu,IsNull:()=>Po,IsNumber:()=>jt,IsObject:()=>be,IsOptional:()=>He,IsPromise:()=>yn,IsProperties:()=>Mb,IsReadonly:()=>Wn,IsRecord:()=>bn,IsRecursive:()=>Kb,IsRef:()=>he,IsRegExp:()=>ps,IsSchema:()=>ue,IsString:()=>gr,IsSymbol:()=>$o,IsTemplateLiteral:()=>it,IsThis:()=>Hu,IsTransform:()=>W,IsTuple:()=>at,IsUint8Array:()=>Ju,IsUndefined:()=>yr,IsUnion:()=>_,IsUnknown:()=>Yu,IsUnsafe:()=>Xu,IsVoid:()=>Zu});var me=Symbol.for("TypeBox.Transform"),Lt=Symbol.for("TypeBox.Readonly"),ke=Symbol.for("TypeBox.Optional"),We=Symbol.for("TypeBox.Hint"),g=Symbol.for("TypeBox.Kind");function Wn(e){return ee(e)&&e[Lt]==="Readonly"}function He(e){return ee(e)&&e[ke]==="Optional"}function cs(e){return U(e,"Any")}function ls(e){return U(e,"Argument")}function vt(e){return U(e,"Array")}function fn(e){return U(e,"AsyncIterator")}function hn(e){return U(e,"BigInt")}function hr(e){return U(e,"Boolean")}function Et(e){return U(e,"Computed")}function Nt(e){return U(e,"Constructor")}function zu(e){return U(e,"Date")}function kt(e){return U(e,"Function")}function Db(e){return U(e,"Import")}function Rt(e){return U(e,"Integer")}function Mb(e){return ee(e)}function de(e){return U(e,"Intersect")}function gn(e){return U(e,"Iterator")}function U(e,t){return ee(e)&&g in e&&e[g]===t}function Bb(e){return Be(e)&&ne(e.const)}function _b(e){return Be(e)&&rt(e.const)}function Vb(e){return Be(e)&&mr(e.const)}function xi(e){return mr(e)||rt(e)||ne(e)}function Be(e){return U(e,"Literal")}function ot(e){return U(e,"MappedKey")}function le(e){return U(e,"MappedResult")}function Tr(e){return U(e,"Never")}function Wu(e){return U(e,"Not")}function Po(e){return U(e,"Null")}function jt(e){return U(e,"Number")}function be(e){return U(e,"Object")}function yn(e){return U(e,"Promise")}function bn(e){return U(e,"Record")}function Kb(e){return ee(e)&&We in e&&e[We]==="Recursive"}function he(e){return U(e,"Ref")}function ps(e){return U(e,"RegExp")}function gr(e){return U(e,"String")}function $o(e){return U(e,"Symbol")}function it(e){return U(e,"TemplateLiteral")}function Hu(e){return U(e,"This")}function W(e){return ee(e)&&me in e}function at(e){return U(e,"Tuple")}function yr(e){return U(e,"Undefined")}function _(e){return U(e,"Union")}function Ju(e){return U(e,"Uint8Array")}function Yu(e){return U(e,"Unknown")}function Xu(e){return U(e,"Unsafe")}function Zu(e){return U(e,"Void")}function Ar(e){return ee(e)&&g in e&&ne(e[g])}function ue(e){return cs(e)||ls(e)||vt(e)||hr(e)||hn(e)||fn(e)||Et(e)||Nt(e)||zu(e)||kt(e)||Rt(e)||de(e)||gn(e)||Be(e)||ot(e)||le(e)||Tr(e)||Wu(e)||Po(e)||jt(e)||be(e)||yn(e)||bn(e)||he(e)||ps(e)||gr(e)||$o(e)||it(e)||Hu(e)||at(e)||yr(e)||_(e)||Ju(e)||Yu(e)||Xu(e)||Zu(e)||Ar(e)}var d={};tt(d,{IsAny:()=>rd,IsArgument:()=>nd,IsArray:()=>od,IsAsyncIterator:()=>id,IsBigInt:()=>ad,IsBoolean:()=>sd,IsComputed:()=>cd,IsConstructor:()=>ld,IsDate:()=>pd,IsFunction:()=>md,IsImport:()=>Jb,IsInteger:()=>ud,IsIntersect:()=>dd,IsIterator:()=>fd,IsKind:()=>Bd,IsKindOf:()=>D,IsLiteral:()=>Ii,IsLiteralBoolean:()=>Yb,IsLiteralNumber:()=>gd,IsLiteralString:()=>hd,IsLiteralValue:()=>yd,IsMappedKey:()=>bd,IsMappedResult:()=>Od,IsNever:()=>xd,IsNot:()=>Sd,IsNull:()=>Id,IsNumber:()=>wd,IsObject:()=>Cd,IsOptional:()=>Hb,IsPromise:()=>Pd,IsProperties:()=>ms,IsReadonly:()=>Wb,IsRecord:()=>$d,IsRecursive:()=>Xb,IsRef:()=>Td,IsRegExp:()=>Ad,IsSchema:()=>Re,IsString:()=>Ld,IsSymbol:()=>vd,IsTemplateLiteral:()=>Ed,IsThis:()=>Nd,IsTransform:()=>kd,IsTuple:()=>Rd,IsUint8Array:()=>Fd,IsUndefined:()=>jd,IsUnion:()=>yl,IsUnionLiteral:()=>Zb,IsUnknown:()=>Ud,IsUnsafe:()=>Dd,IsVoid:()=>Md,TypeGuardUnknownTypeError:()=>fl});var fl=class extends v{},Gb=["Argument","Any","Array","AsyncIterator","BigInt","Boolean","Computed","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function Qu(e){try{return new RegExp(e),!0}catch{return!1}}function hl(e){if(!ne(e))return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n>=7&&n<=13||n===27||n===127)return!1}return!0}function ed(e){return gl(e)||Re(e)}function Si(e){return Se(e)||di(e)}function oe(e){return Se(e)||rt(e)}function gl(e){return Se(e)||mr(e)}function te(e){return Se(e)||ne(e)}function qb(e){return Se(e)||ne(e)&&hl(e)&&Qu(e)}function zb(e){return Se(e)||ne(e)&&hl(e)}function td(e){return Se(e)||Re(e)}function Wb(e){return ee(e)&&e[Lt]==="Readonly"}function Hb(e){return ee(e)&&e[ke]==="Optional"}function rd(e){return D(e,"Any")&&te(e.$id)}function nd(e){return D(e,"Argument")&&rt(e.index)}function od(e){return D(e,"Array")&&e.type==="array"&&te(e.$id)&&Re(e.items)&&oe(e.minItems)&&oe(e.maxItems)&&gl(e.uniqueItems)&&td(e.contains)&&oe(e.minContains)&&oe(e.maxContains)}function id(e){return D(e,"AsyncIterator")&&e.type==="AsyncIterator"&&te(e.$id)&&Re(e.items)}function ad(e){return D(e,"BigInt")&&e.type==="bigint"&&te(e.$id)&&Si(e.exclusiveMaximum)&&Si(e.exclusiveMinimum)&&Si(e.maximum)&&Si(e.minimum)&&Si(e.multipleOf)}function sd(e){return D(e,"Boolean")&&e.type==="boolean"&&te(e.$id)}function cd(e){return D(e,"Computed")&&ne(e.target)&&xe(e.parameters)&&e.parameters.every(t=>Re(t))}function ld(e){return D(e,"Constructor")&&e.type==="Constructor"&&te(e.$id)&&xe(e.parameters)&&e.parameters.every(t=>Re(t))&&Re(e.returns)}function pd(e){return D(e,"Date")&&e.type==="Date"&&te(e.$id)&&oe(e.exclusiveMaximumTimestamp)&&oe(e.exclusiveMinimumTimestamp)&&oe(e.maximumTimestamp)&&oe(e.minimumTimestamp)&&oe(e.multipleOfTimestamp)}function md(e){return D(e,"Function")&&e.type==="Function"&&te(e.$id)&&xe(e.parameters)&&e.parameters.every(t=>Re(t))&&Re(e.returns)}function Jb(e){return D(e,"Import")&&is(e,"$defs")&&ee(e.$defs)&&ms(e.$defs)&&is(e,"$ref")&&ne(e.$ref)&&e.$ref in e.$defs}function ud(e){return D(e,"Integer")&&e.type==="integer"&&te(e.$id)&&oe(e.exclusiveMaximum)&&oe(e.exclusiveMinimum)&&oe(e.maximum)&&oe(e.minimum)&&oe(e.multipleOf)}function ms(e){return ee(e)&&Object.entries(e).every(([t,n])=>hl(t)&&Re(n))}function dd(e){return D(e,"Intersect")&&!(ne(e.type)&&e.type!=="object")&&xe(e.allOf)&&e.allOf.every(t=>Re(t)&&!kd(t))&&te(e.type)&&(gl(e.unevaluatedProperties)||td(e.unevaluatedProperties))&&te(e.$id)}function fd(e){return D(e,"Iterator")&&e.type==="Iterator"&&te(e.$id)&&Re(e.items)}function D(e,t){return ee(e)&&g in e&&e[g]===t}function hd(e){return Ii(e)&&ne(e.const)}function gd(e){return Ii(e)&&rt(e.const)}function Yb(e){return Ii(e)&&mr(e.const)}function Ii(e){return D(e,"Literal")&&te(e.$id)&&yd(e.const)}function yd(e){return mr(e)||rt(e)||ne(e)}function bd(e){return D(e,"MappedKey")&&xe(e.keys)&&e.keys.every(t=>rt(t)||ne(t))}function Od(e){return D(e,"MappedResult")&&ms(e.properties)}function xd(e){return D(e,"Never")&&ee(e.not)&&Object.getOwnPropertyNames(e.not).length===0}function Sd(e){return D(e,"Not")&&Re(e.not)}function Id(e){return D(e,"Null")&&e.type==="null"&&te(e.$id)}function wd(e){return D(e,"Number")&&e.type==="number"&&te(e.$id)&&oe(e.exclusiveMaximum)&&oe(e.exclusiveMinimum)&&oe(e.maximum)&&oe(e.minimum)&&oe(e.multipleOf)}function Cd(e){return D(e,"Object")&&e.type==="object"&&te(e.$id)&&ms(e.properties)&&ed(e.additionalProperties)&&oe(e.minProperties)&&oe(e.maxProperties)}function Pd(e){return D(e,"Promise")&&e.type==="Promise"&&te(e.$id)&&Re(e.item)}function $d(e){return D(e,"Record")&&e.type==="object"&&te(e.$id)&&ed(e.additionalProperties)&&ee(e.patternProperties)&&(t=>{let n=Object.getOwnPropertyNames(t.patternProperties);return n.length===1&&Qu(n[0])&&ee(t.patternProperties)&&Re(t.patternProperties[n[0]])})(e)}function Xb(e){return ee(e)&&We in e&&e[We]==="Recursive"}function Td(e){return D(e,"Ref")&&te(e.$id)&&ne(e.$ref)}function Ad(e){return D(e,"RegExp")&&te(e.$id)&&ne(e.source)&&ne(e.flags)&&oe(e.maxLength)&&oe(e.minLength)}function Ld(e){return D(e,"String")&&e.type==="string"&&te(e.$id)&&oe(e.minLength)&&oe(e.maxLength)&&qb(e.pattern)&&zb(e.format)}function vd(e){return D(e,"Symbol")&&e.type==="symbol"&&te(e.$id)}function Ed(e){return D(e,"TemplateLiteral")&&e.type==="string"&&ne(e.pattern)&&e.pattern[0]==="^"&&e.pattern[e.pattern.length-1]==="$"}function Nd(e){return D(e,"This")&&te(e.$id)&&ne(e.$ref)}function kd(e){return ee(e)&&me in e}function Rd(e){return D(e,"Tuple")&&e.type==="array"&&te(e.$id)&&rt(e.minItems)&&rt(e.maxItems)&&e.minItems===e.maxItems&&(Se(e.items)&&Se(e.additionalItems)&&e.minItems===0||xe(e.items)&&e.items.every(t=>Re(t)))}function jd(e){return D(e,"Undefined")&&e.type==="undefined"&&te(e.$id)}function Zb(e){return yl(e)&&e.anyOf.every(t=>hd(t)||gd(t))}function yl(e){return D(e,"Union")&&te(e.$id)&&ee(e)&&xe(e.anyOf)&&e.anyOf.every(t=>Re(t))}function Fd(e){return D(e,"Uint8Array")&&e.type==="Uint8Array"&&te(e.$id)&&oe(e.minByteLength)&&oe(e.maxByteLength)}function Ud(e){return D(e,"Unknown")&&te(e.$id)}function Dd(e){return D(e,"Unsafe")}function Md(e){return D(e,"Void")&&e.type==="void"&&te(e.$id)}function Bd(e){return ee(e)&&g in e&&ne(e[g])&&!Gb.includes(e[g])}function Re(e){return ee(e)&&(rd(e)||nd(e)||od(e)||sd(e)||ad(e)||id(e)||cd(e)||ld(e)||pd(e)||md(e)||ud(e)||dd(e)||fd(e)||Ii(e)||bd(e)||Od(e)||xd(e)||Sd(e)||Id(e)||wd(e)||Cd(e)||Pd(e)||$d(e)||Td(e)||Ad(e)||Ld(e)||vd(e)||Ed(e)||Nd(e)||Rd(e)||jd(e)||yl(e)||Fd(e)||Ud(e)||Dd(e)||Md(e)||Bd(e))}function Qb(e){return(parseInt(e)+1).toString()}var us="(true|false)",To="(0|[1-9][0-9]*)",ds="(.*)",_d="(?!.*)",eO=`^${us}$`,Lr=`^${To}$`,vr=`^${ds}$`,bl=`^${_d}$`;var Ft={};tt(Ft,{Clear:()=>rO,Delete:()=>nO,Entries:()=>tO,Get:()=>aO,Has:()=>oO,Set:()=>iO});var Ao=new Map;function tO(){return new Map(Ao)}function rO(){return Ao.clear()}function nO(e){return Ao.delete(e)}function oO(e){return Ao.has(e)}function iO(e,t){Ao.set(e,t)}function aO(e){return Ao.get(e)}var Ut={};tt(Ut,{Clear:()=>cO,Delete:()=>lO,Entries:()=>sO,Get:()=>uO,Has:()=>pO,Set:()=>mO});var Lo=new Map;function sO(){return new Map(Lo)}function cO(){return Lo.clear()}function lO(e){return Lo.delete(e)}function pO(e){return Lo.has(e)}function mO(e,t){Lo.set(e,t)}function uO(e){return Lo.get(e)}function fs(e,t){return e.includes(t)}function dO(e,t){return e.every(n=>fs(t,n))}function Ol(e){return[...new Set(e)]}function Vd(e,t){return e.filter(n=>t.includes(n))}function fO(e,t){return[...e,...t]}function hO(e,t){return e.filter(n=>!t.includes(n))}function gO(e,t){return e.reduce((n,o)=>Vd(n,o),t)}function xl(e){return e.length===1?e[0]:e.length>1?gO(e.slice(1),e[0]):[]}function Sl(e){let t=[];for(let n of e)t.push(...n);return t}function Yt(e){return y({[g]:"Any"},e)}function Er(e,t){return y({[g]:"Array",type:"array",items:e},t)}function wi(e){return y({[g]:"Argument",index:e})}function Nr(e,t){return y({[g]:"AsyncIterator",type:"AsyncIterator",items:e},t)}function ie(e,t,n){return y({[g]:"Computed",target:e,parameters:t},n)}function yO(e,t){let{[t]:n,...o}=e;return o}function ge(e,t){return t.reduce((n,o)=>yO(n,o),e)}function N(e){return y({[g]:"Never",not:{}},e)}function bO(e){return y({[g]:"MappedKey",keys:e})}function q(e){return y({[g]:"MappedResult",properties:e})}function kr(e,t,n){return y({[g]:"Constructor",type:"Constructor",parameters:e,returns:t},n)}function gt(e,t,n){return y({[g]:"Function",type:"Function",parameters:e,returns:t},n)}function Ci(e,t){return y({[g]:"Union",anyOf:e},t)}function OO(e){return e.some(t=>He(t))}function Kd(e){return e.map(t=>He(t)?xO(t):t)}function xO(e){return ge(e,[ke])}function SO(e,t){return OO(e)?ve(Ci(Kd(e),t)):Ci(Kd(e),t)}function Xt(e,t){return e.length===1?y(e[0],t):e.length===0?N(t):SO(e,t)}function V(e,t){return e.length===0?N(t):e.length===1?y(e[0],t):Ci(e,t)}var Pi=class extends v{};function IO(e){return e.replace(/\\\\\\$/g,"$").replace(/\\\\\\*/g,"*").replace(/\\\\\\^/g,"^").replace(/\\\\\\|/g,"|").replace(/\\\\\\(/g,"(").replace(/\\\\\\)/g,")")}function Il(e,t,n){return e[t]===n&&e.charCodeAt(t-1)!==92}function Rr(e,t){return Il(e,t,"(")}function $i(e,t){return Il(e,t,")")}function Gd(e,t){return Il(e,t,"|")}function wO(e){if(!(Rr(e,0)&&$i(e,e.length-1)))return!1;let t=0;for(let n=0;n<e.length;n++)if(Rr(e,n)&&(t+=1),$i(e,n)&&(t-=1),t===0&&n!==e.length-1)return!1;return!0}function CO(e){return e.slice(1,e.length-1)}function PO(e){let t=0;for(let n=0;n<e.length;n++)if(Rr(e,n)&&(t+=1),$i(e,n)&&(t-=1),Gd(e,n)&&t===0)return!0;return!1}function $O(e){for(let t=0;t<e.length;t++)if(Rr(e,t))return!0;return!1}function TO(e){let[t,n]=[0,0],o=[];for(let a=0;a<e.length;a++)if(Rr(e,a)&&(t+=1),$i(e,a)&&(t-=1),Gd(e,a)&&t===0){let s=e.slice(n,a);s.length>0&&o.push(Hn(s)),n=a+1}let i=e.slice(n);return i.length>0&&o.push(Hn(i)),o.length===0?{type:"const",const:""}:o.length===1?o[0]:{type:"or",expr:o}}function AO(e){function t(i,a){if(!Rr(i,a))throw new Pi("TemplateLiteralParser: Index must point to open parens");let s=0;for(let c=a;c<i.length;c++)if(Rr(i,c)&&(s+=1),$i(i,c)&&(s-=1),s===0)return[a,c];throw new Pi("TemplateLiteralParser: Unclosed group parens in expression")}function n(i,a){for(let s=a;s<i.length;s++)if(Rr(i,s))return[a,s];return[a,i.length]}let o=[];for(let i=0;i<e.length;i++)if(Rr(e,i)){let[a,s]=t(e,i),c=e.slice(a,s+1);o.push(Hn(c)),i=s}else{let[a,s]=n(e,i),c=e.slice(a,s);c.length>0&&o.push(Hn(c)),i=s-1}return o.length===0?{type:"const",const:""}:o.length===1?o[0]:{type:"and",expr:o}}function Hn(e){return wO(e)?Hn(CO(e)):PO(e)?TO(e):$O(e)?AO(e):{type:"const",const:IO(e)}}function Jn(e){return Hn(e.slice(1,e.length-1))}var hs=class extends v{};function LO(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="0"&&e.expr[1].type==="const"&&e.expr[1].const==="[1-9][0-9]*"}function vO(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="true"&&e.expr[1].type==="const"&&e.expr[1].const==="false"}function EO(e){return e.type==="const"&&e.const===".*"}function On(e){return LO(e)||EO(e)?!1:vO(e)?!0:e.type==="and"?e.expr.every(t=>On(t)):e.type==="or"?e.expr.every(t=>On(t)):e.type==="const"?!0:(()=>{throw new hs("Unknown expression type")})()}function Ti(e){let t=Jn(e.pattern);return On(t)}var gs=class extends v{};function*qd(e){if(e.length===1)return yield*e[0];for(let t of e[0])for(let n of qd(e.slice(1)))yield`${t}${n}`}function*NO(e){return yield*qd(e.expr.map(t=>[...vo(t)]))}function*kO(e){for(let t of e.expr)yield*vo(t)}function*RO(e){return yield e.const}function*vo(e){return e.type==="and"?yield*NO(e):e.type==="or"?yield*kO(e):e.type==="const"?yield*RO(e):(()=>{throw new gs("Unknown expression")})()}function Yn(e){let t=Jn(e.pattern);return On(t)?[...vo(t)]:[]}function F(e,t){return y({[g]:"Literal",const:e,type:typeof e},t)}function Xn(e){return y({[g]:"Boolean",type:"boolean"},e)}function jr(e){return y({[g]:"BigInt",type:"bigint"},e)}function Je(e){return y({[g]:"Number",type:"number"},e)}function je(e){return y({[g]:"String",type:"string"},e)}function*jO(e){let t=e.trim().replace(/"|\'/g,"");return t==="boolean"?yield Xn():t==="number"?yield Je():t==="bigint"?yield jr():t==="string"?yield je():yield(()=>{let n=t.split("|").map(o=>F(o.trim()));return n.length===0?N():n.length===1?n[0]:Xt(n)})()}function*FO(e){if(e[1]!=="{"){let t=F("$"),n=wl(e.slice(1));return yield*[t,...n]}for(let t=2;t<e.length;t++)if(e[t]==="}"){let n=jO(e.slice(2,t)),o=wl(e.slice(t+1));return yield*[...n,...o]}yield F(e)}function*wl(e){for(let t=0;t<e.length;t++)if(e[t]==="$"){let n=F(e.slice(0,t)),o=FO(e.slice(t));return yield*[n,...o]}yield F(e)}function Cl(e){return[...wl(e)]}var ys=class extends v{};function UO(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function zd(e,t){return it(e)?e.pattern.slice(1,e.pattern.length-1):_(e)?`(${e.anyOf.map(n=>zd(n,t)).join("|")})`:jt(e)?`${t}${To}`:Rt(e)?`${t}${To}`:hn(e)?`${t}${To}`:gr(e)?`${t}${ds}`:Be(e)?`${t}${UO(e.const.toString())}`:hr(e)?`${t}${us}`:(()=>{throw new ys(`Unexpected Kind \'${e[g]}\'`)})()}function bs(e){return`^${e.map(t=>zd(t,"")).join("")}$`}function xn(e){let n=Yn(e).map(o=>F(o));return Xt(n)}function Zn(e,t){let n=ne(e)?bs(Cl(e)):bs(e);return y({[g]:"TemplateLiteral",type:"string",pattern:n},t)}function DO(e){return Yn(e).map(n=>n.toString())}function MO(e){let t=[];for(let n of e)t.push(...Ye(n));return t}function BO(e){return[e.toString()]}function Ye(e){return[...new Set(it(e)?DO(e):_(e)?MO(e.anyOf):Be(e)?BO(e.const):jt(e)?["[number]"]:Rt(e)?["[number]"]:[])]}function _O(e,t,n){let o={};for(let i of Object.getOwnPropertyNames(t))o[i]=Zt(e,Ye(t[i]),n);return o}function VO(e,t,n){return _O(e,t.properties,n)}function Pl(e,t,n){let o=VO(e,t,n);return q(o)}function Hd(e,t){return e.map(n=>$l(n,t))}function KO(e){return e.filter(t=>!Tr(t))}function GO(e,t){return Ai(KO(Hd(e,t)))}function qO(e){return e.some(t=>Tr(t))?[]:e}function zO(e,t){return Xt(qO(Hd(e,t)))}function WO(e,t){return t in e?e[t]:t==="[number]"?Xt(e):N()}function HO(e,t){return t==="[number]"?e:N()}function JO(e,t){return t in e?e[t]:N()}function $l(e,t){return de(e)?GO(e.allOf,t):_(e)?zO(e.anyOf,t):at(e)?WO(e.items??[],t):vt(e)?HO(e.items,t):be(e)?JO(e.properties,t):N()}function Eo(e,t){return t.map(n=>$l(e,n))}function Wd(e,t){return Xt(Eo(e,t))}function YO(e,t){return ie("Index",[e,t])}function Zt(e,t,n){if(he(e)||he(t)){let o="Index types using Ref parameters require both Type and Key to be of TSchema";if(!ue(e)||!ue(t))throw new v(o);return ie("Index",[e,t])}return le(t)?Pl(e,t,n):ot(t)?Tl(e,t,n):y(ue(t)?Wd(e,Ye(t)):Wd(e,t),n)}function XO(e,t,n){return{[t]:Zt(e,[t],ae(n))}}function ZO(e,t,n){return t.reduce((o,i)=>({...o,...XO(e,i,n)}),{})}function QO(e,t,n){return ZO(e,t.keys,n)}function Tl(e,t,n){let o=QO(e,t,n);return q(o)}function Fr(e,t){return y({[g]:"Iterator",type:"Iterator",items:e},t)}function ex(e){let t=[];for(let n in e)He(e[n])||t.push(n);return t}function tx(e,t){let n=ex(e),o=n.length>0?{[g]:"Object",type:"object",properties:e,required:n}:{[g]:"Object",type:"object",properties:e};return y(o,t)}var K=tx;function Qn(e,t){return y({[g]:"Promise",type:"Promise",item:e},t)}function rx(e){return y(ge(e,[Lt]))}function nx(e){return y({...e,[Lt]:"Readonly"})}function ox(e,t){return t===!1?rx(e):nx(e)}function _e(e,t){let n=t??!0;return le(e)?Al(e,n):ox(e,n)}function ix(e,t){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=_e(e[o],t);return n}function ax(e,t){return ix(e.properties,t)}function Al(e,t){let n=ax(e,t);return q(n)}function Xe(e,t){return y(e.length>0?{[g]:"Tuple",type:"array",items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[g]:"Tuple",type:"array",minItems:e.length,maxItems:e.length},t)}function Jd(e,t){return e in t?Dt(e,t[e]):q(t)}function sx(e){return{[e]:F(e)}}function cx(e){let t={};for(let n of e)t[n]=F(n);return t}function lx(e,t){return fs(t,e)?sx(e):cx(t)}function px(e,t){let n=lx(e,t);return Jd(e,n)}function Li(e,t){return t.map(n=>Dt(e,n))}function mx(e,t){let n={};for(let o of globalThis.Object.getOwnPropertyNames(t))n[o]=Dt(e,t[o]);return n}function Dt(e,t){let n={...t};return He(t)?ve(Dt(e,ge(t,[ke]))):Wn(t)?_e(Dt(e,ge(t,[Lt]))):le(t)?Jd(e,t.properties):ot(t)?px(e,t.keys):Nt(t)?kr(Li(e,t.parameters),Dt(e,t.returns),n):kt(t)?gt(Li(e,t.parameters),Dt(e,t.returns),n):fn(t)?Nr(Dt(e,t.items),n):gn(t)?Fr(Dt(e,t.items),n):de(t)?Ee(Li(e,t.allOf),n):_(t)?V(Li(e,t.anyOf),n):at(t)?Xe(Li(e,t.items??[]),n):be(t)?K(mx(e,t.properties),n):vt(t)?Er(Dt(e,t.items),n):yn(t)?Qn(Dt(e,t.item),n):t}function Yd(e,t){let n={};for(let o of e)n[o]=Dt(o,t);return n}function vi(e,t,n){let o=ue(e)?Ye(e):e,i=t({[g]:"MappedKey",keys:o}),a=Yd(o,i);return K(a,n)}function ux(e){return y(ge(e,[ke]))}function dx(e){return y({...e,[ke]:"Optional"})}function fx(e,t){return t===!1?ux(e):dx(e)}function ve(e,t){let n=t??!0;return le(e)?Ll(e,n):fx(e,n)}function hx(e,t){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=ve(e[o],t);return n}function gx(e,t){return hx(e.properties,t)}function Ll(e,t){let n=gx(e,t);return q(n)}function Ei(e,t={}){let n=e.every(i=>be(i)),o=ue(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return y(t.unevaluatedProperties===!1||ue(t.unevaluatedProperties)||n?{...o,[g]:"Intersect",type:"object",allOf:e}:{...o,[g]:"Intersect",allOf:e},t)}function yx(e){return e.every(t=>He(t))}function bx(e){return ge(e,[ke])}function Xd(e){return e.map(t=>He(t)?bx(t):t)}function Ox(e,t){return yx(e)?ve(Ei(Xd(e),t)):Ei(Xd(e),t)}function Ai(e,t={}){if(e.length===1)return y(e[0],t);if(e.length===0)return N(t);if(e.some(n=>W(n)))throw new Error("Cannot intersect transform types");return Ox(e,t)}function Ee(e,t){if(e.length===1)return y(e[0],t);if(e.length===0)return N(t);if(e.some(n=>W(n)))throw new Error("Cannot intersect transform types");return Ei(e,t)}function yt(...e){let[t,n]=typeof e[0]=="string"?[e[0],e[1]]:[e[0].$id,e[1]];if(typeof t!="string")throw new v("Ref: $ref must be a string");return y({[g]:"Ref",$ref:t},n)}function xx(e,t){return ie("Awaited",[ie(e,t)])}function Sx(e){return ie("Awaited",[yt(e)])}function Ix(e){return Ee(Zd(e))}function wx(e){return V(Zd(e))}function Cx(e){return Ur(e)}function Zd(e){return e.map(t=>Ur(t))}function Ur(e,t){return y(Et(e)?xx(e.target,e.parameters):de(e)?Ix(e.allOf):_(e)?wx(e.anyOf):yn(e)?Cx(e.item):he(e)?Sx(e.$ref):e,t)}function Qd(e){let t=[];for(let n of e)t.push(Ze(n));return t}function Px(e){let t=Qd(e);return Sl(t)}function $x(e){let t=Qd(e);return xl(t)}function Tx(e){return e.map((t,n)=>n.toString())}function Ax(e){return["[number]"]}function Lx(e){return globalThis.Object.getOwnPropertyNames(e)}function vx(e){return vl?globalThis.Object.getOwnPropertyNames(e).map(n=>n[0]==="^"&&n[n.length-1]==="$"?n.slice(1,n.length-1):n):[]}function Ze(e){return de(e)?Px(e.allOf):_(e)?$x(e.anyOf):at(e)?Tx(e.items??[]):vt(e)?Ax(e.items):be(e)?Lx(e.properties):bn(e)?vx(e.patternProperties):[]}var vl=!1;function eo(e){vl=!0;let t=Ze(e);return vl=!1,`^(${t.map(o=>`(${o})`).join("|")})$`}function Ex(e,t){return ie("KeyOf",[ie(e,t)])}function Nx(e){return ie("KeyOf",[yt(e)])}function kx(e,t){let n=Ze(e),o=ef(n),i=Xt(o);return y(i,t)}function ef(e){return e.map(t=>t==="[number]"?Je():F(t))}function Dr(e,t){return Et(e)?Ex(e.target,e.parameters):he(e)?Nx(e.$ref):le(e)?El(e,t):kx(e,t)}function Rx(e,t){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=Dr(e[o],ae(t));return n}function jx(e,t){return Rx(e.properties,t)}function El(e,t){let n=jx(e,t);return q(n)}function Ni(e){let t=Ze(e),n=Eo(e,t);return t.map((o,i)=>[t[i],n[i]])}function Fx(e){let t=[];for(let n of e)t.push(...Ze(n));return Ol(t)}function Ux(e){return e.filter(t=>!Tr(t))}function Dx(e,t){let n=[];for(let o of e)n.push(...Eo(o,[t]));return Ux(n)}function Mx(e,t){let n={};for(let o of t)n[o]=Ai(Dx(e,o));return n}function ki(e,t){let n=Fx(e),o=Mx(e,n);return K(o,t)}function to(e){return y({[g]:"Date",type:"Date"},e)}function ro(e){return y({[g]:"Null",type:"null"},e)}function no(e){return y({[g]:"Symbol",type:"symbol"},e)}function oo(e){return y({[g]:"Undefined",type:"undefined"},e)}function io(e){return y({[g]:"Uint8Array",type:"Uint8Array"},e)}function st(e){return y({[g]:"Unknown"},e)}function Bx(e){return e.map(t=>Nl(t,!1))}function _x(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=_e(Nl(e[n],!1));return t}function Os(e,t){return t===!0?e:_e(e)}function Nl(e,t){return sl(e)?Os(Yt(),t):ll(e)?Os(Yt(),t):xe(e)?_e(Xe(Bx(e))):$r(e)?io():qn(e)?to():ee(e)?Os(K(_x(e)),t):cl(e)?Os(gt([],st()),t):Se(e)?oo():pl(e)?ro():ml(e)?no():di(e)?jr():rt(e)?F(e):mr(e)?F(e):ne(e)?F(e):K({})}function Ri(e,t){return y(Nl(e,!0),t)}function ji(e,t){return Nt(e)?Xe(e.parameters,t):N(t)}function Fi(e,t){if(Se(e))throw new Error("Enum undefined or empty");let n=globalThis.Object.getOwnPropertyNames(e).filter(a=>isNaN(a)).map(a=>e[a]),i=[...new Set(n)].map(a=>F(a));return V(i,{...t,[We]:"Enum"})}var xs=class extends v{},b;(function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"})(b||(b={}));function Mt(e){return e===b.False?e:b.True}function No(e){throw new xs(e)}function Pe(e){return d.IsNever(e)||d.IsIntersect(e)||d.IsUnion(e)||d.IsUnknown(e)||d.IsAny(e)}function $e(e,t){return d.IsNever(t)?cf(e,t):d.IsIntersect(t)?Ss(e,t):d.IsUnion(t)?Ul(e,t):d.IsUnknown(t)?uf(e,t):d.IsAny(t)?Fl(e,t):No("StructuralRight")}function Fl(e,t){return b.True}function Vx(e,t){return d.IsIntersect(t)?Ss(e,t):d.IsUnion(t)&&t.anyOf.some(n=>d.IsAny(n)||d.IsUnknown(n))?b.True:d.IsUnion(t)?b.Union:d.IsUnknown(t)||d.IsAny(t)?b.True:b.Union}function Kx(e,t){return d.IsUnknown(e)?b.False:d.IsAny(e)?b.Union:d.IsNever(e)?b.True:b.False}function Gx(e,t){return d.IsObject(t)&&Is(t)?b.True:Pe(t)?$e(e,t):d.IsArray(t)?Mt(re(e.items,t.items)):b.False}function qx(e,t){return Pe(t)?$e(e,t):d.IsAsyncIterator(t)?Mt(re(e.items,t.items)):b.False}function zx(e,t){return Pe(t)?$e(e,t):d.IsObject(t)?Ge(e,t):d.IsRecord(t)?Bt(e,t):d.IsBigInt(t)?b.True:b.False}function af(e,t){return d.IsLiteralBoolean(e)||d.IsBoolean(e)?b.True:b.False}function Wx(e,t){return Pe(t)?$e(e,t):d.IsObject(t)?Ge(e,t):d.IsRecord(t)?Bt(e,t):d.IsBoolean(t)?b.True:b.False}function Hx(e,t){return Pe(t)?$e(e,t):d.IsObject(t)?Ge(e,t):d.IsConstructor(t)?e.parameters.length>t.parameters.length?b.False:e.parameters.every((n,o)=>Mt(re(t.parameters[o],n))===b.True)?Mt(re(e.returns,t.returns)):b.False:b.False}function Jx(e,t){return Pe(t)?$e(e,t):d.IsObject(t)?Ge(e,t):d.IsRecord(t)?Bt(e,t):d.IsDate(t)?b.True:b.False}function Yx(e,t){return Pe(t)?$e(e,t):d.IsObject(t)?Ge(e,t):d.IsFunction(t)?e.parameters.length>t.parameters.length?b.False:e.parameters.every((n,o)=>Mt(re(t.parameters[o],n))===b.True)?Mt(re(e.returns,t.returns)):b.False:b.False}function sf(e,t){return d.IsLiteral(e)&&Me.IsNumber(e.const)||d.IsNumber(e)||d.IsInteger(e)?b.True:b.False}function Xx(e,t){return d.IsInteger(t)||d.IsNumber(t)?b.True:Pe(t)?$e(e,t):d.IsObject(t)?Ge(e,t):d.IsRecord(t)?Bt(e,t):b.False}function Ss(e,t){return t.allOf.every(n=>re(e,n)===b.True)?b.True:b.False}function Zx(e,t){return e.allOf.some(n=>re(n,t)===b.True)?b.True:b.False}function Qx(e,t){return Pe(t)?$e(e,t):d.IsIterator(t)?Mt(re(e.items,t.items)):b.False}function eS(e,t){return d.IsLiteral(t)&&t.const===e.const?b.True:Pe(t)?$e(e,t):d.IsObject(t)?Ge(e,t):d.IsRecord(t)?Bt(e,t):d.IsString(t)?mf(e,t):d.IsNumber(t)?lf(e,t):d.IsInteger(t)?sf(e,t):d.IsBoolean(t)?af(e,t):b.False}function cf(e,t){return b.False}function tS(e,t){return b.True}function tf(e){let[t,n]=[e,0];for(;d.IsNot(t);)t=t.not,n+=1;return n%2===0?t:st()}function rS(e,t){return d.IsNot(e)?re(tf(e),t):d.IsNot(t)?re(e,tf(t)):No("Invalid fallthrough for Not")}function nS(e,t){return Pe(t)?$e(e,t):d.IsObject(t)?Ge(e,t):d.IsRecord(t)?Bt(e,t):d.IsNull(t)?b.True:b.False}function lf(e,t){return d.IsLiteralNumber(e)||d.IsNumber(e)||d.IsInteger(e)?b.True:b.False}function oS(e,t){return Pe(t)?$e(e,t):d.IsObject(t)?Ge(e,t):d.IsRecord(t)?Bt(e,t):d.IsInteger(t)||d.IsNumber(t)?b.True:b.False}function ct(e,t){return Object.getOwnPropertyNames(e.properties).length===t}function rf(e){return Is(e)}function nf(e){return ct(e,0)||ct(e,1)&&"description"in e.properties&&d.IsUnion(e.properties.description)&&e.properties.description.anyOf.length===2&&(d.IsString(e.properties.description.anyOf[0])&&d.IsUndefined(e.properties.description.anyOf[1])||d.IsString(e.properties.description.anyOf[1])&&d.IsUndefined(e.properties.description.anyOf[0]))}function kl(e){return ct(e,0)}function of(e){return ct(e,0)}function iS(e){return ct(e,0)}function aS(e){return ct(e,0)}function sS(e){return Is(e)}function cS(e){let t=Je();return ct(e,0)||ct(e,1)&&"length"in e.properties&&Mt(re(e.properties.length,t))===b.True}function lS(e){return ct(e,0)}function Is(e){let t=Je();return ct(e,0)||ct(e,1)&&"length"in e.properties&&Mt(re(e.properties.length,t))===b.True}function pS(e){let t=gt([Yt()],Yt());return ct(e,0)||ct(e,1)&&"then"in e.properties&&Mt(re(e.properties.then,t))===b.True}function pf(e,t){return re(e,t)===b.False||d.IsOptional(e)&&!d.IsOptional(t)?b.False:b.True}function Ge(e,t){return d.IsUnknown(e)?b.False:d.IsAny(e)?b.Union:d.IsNever(e)||d.IsLiteralString(e)&&rf(t)||d.IsLiteralNumber(e)&&kl(t)||d.IsLiteralBoolean(e)&&of(t)||d.IsSymbol(e)&&nf(t)||d.IsBigInt(e)&&iS(t)||d.IsString(e)&&rf(t)||d.IsSymbol(e)&&nf(t)||d.IsNumber(e)&&kl(t)||d.IsInteger(e)&&kl(t)||d.IsBoolean(e)&&of(t)||d.IsUint8Array(e)&&sS(t)||d.IsDate(e)&&aS(t)||d.IsConstructor(e)&&lS(t)||d.IsFunction(e)&&cS(t)?b.True:d.IsRecord(e)&&d.IsString(Rl(e))?t[We]==="Record"?b.True:b.False:d.IsRecord(e)&&d.IsNumber(Rl(e))?ct(t,0)?b.True:b.False:b.False}function mS(e,t){return Pe(t)?$e(e,t):d.IsRecord(t)?Bt(e,t):d.IsObject(t)?(()=>{for(let n of Object.getOwnPropertyNames(t.properties)){if(!(n in e.properties)&&!d.IsOptional(t.properties[n]))return b.False;if(d.IsOptional(t.properties[n]))return b.True;if(pf(e.properties[n],t.properties[n])===b.False)return b.False}return b.True})():b.False}function uS(e,t){return Pe(t)?$e(e,t):d.IsObject(t)&&pS(t)?b.True:d.IsPromise(t)?Mt(re(e.item,t.item)):b.False}function Rl(e){return Lr in e.patternProperties?Je():vr in e.patternProperties?je():No("Unknown record key pattern")}function jl(e){return Lr in e.patternProperties?e.patternProperties[Lr]:vr in e.patternProperties?e.patternProperties[vr]:No("Unable to get record value schema")}function Bt(e,t){let[n,o]=[Rl(t),jl(t)];return d.IsLiteralString(e)&&d.IsNumber(n)&&Mt(re(e,o))===b.True?b.True:d.IsUint8Array(e)&&d.IsNumber(n)||d.IsString(e)&&d.IsNumber(n)||d.IsArray(e)&&d.IsNumber(n)?re(e,o):d.IsObject(e)?(()=>{for(let i of Object.getOwnPropertyNames(e.properties))if(pf(o,e.properties[i])===b.False)return b.False;return b.True})():b.False}function dS(e,t){return Pe(t)?$e(e,t):d.IsObject(t)?Ge(e,t):d.IsRecord(t)?re(jl(e),jl(t)):b.False}function fS(e,t){let n=d.IsRegExp(e)?je():e,o=d.IsRegExp(t)?je():t;return re(n,o)}function mf(e,t){return d.IsLiteral(e)&&Me.IsString(e.const)||d.IsString(e)?b.True:b.False}function hS(e,t){return Pe(t)?$e(e,t):d.IsObject(t)?Ge(e,t):d.IsRecord(t)?Bt(e,t):d.IsString(t)?b.True:b.False}function gS(e,t){return Pe(t)?$e(e,t):d.IsObject(t)?Ge(e,t):d.IsRecord(t)?Bt(e,t):d.IsSymbol(t)?b.True:b.False}function yS(e,t){return d.IsTemplateLiteral(e)?re(xn(e),t):d.IsTemplateLiteral(t)?re(e,xn(t)):No("Invalid fallthrough for TemplateLiteral")}function bS(e,t){return d.IsArray(t)&&e.items!==void 0&&e.items.every(n=>re(n,t.items)===b.True)}function OS(e,t){return d.IsNever(e)?b.True:d.IsUnknown(e)?b.False:d.IsAny(e)?b.Union:b.False}function xS(e,t){return Pe(t)?$e(e,t):d.IsObject(t)&&Is(t)||d.IsArray(t)&&bS(e,t)?b.True:d.IsTuple(t)?Me.IsUndefined(e.items)&&!Me.IsUndefined(t.items)||!Me.IsUndefined(e.items)&&Me.IsUndefined(t.items)?b.False:Me.IsUndefined(e.items)&&!Me.IsUndefined(t.items)||e.items.every((n,o)=>re(n,t.items[o])===b.True)?b.True:b.False:b.False}function SS(e,t){return Pe(t)?$e(e,t):d.IsObject(t)?Ge(e,t):d.IsRecord(t)?Bt(e,t):d.IsUint8Array(t)?b.True:b.False}function IS(e,t){return Pe(t)?$e(e,t):d.IsObject(t)?Ge(e,t):d.IsRecord(t)?Bt(e,t):d.IsVoid(t)?PS(e,t):d.IsUndefined(t)?b.True:b.False}function Ul(e,t){return t.anyOf.some(n=>re(e,n)===b.True)?b.True:b.False}function wS(e,t){return e.anyOf.every(n=>re(n,t)===b.True)?b.True:b.False}function uf(e,t){return b.True}function CS(e,t){return d.IsNever(t)?cf(e,t):d.IsIntersect(t)?Ss(e,t):d.IsUnion(t)?Ul(e,t):d.IsAny(t)?Fl(e,t):d.IsString(t)?mf(e,t):d.IsNumber(t)?lf(e,t):d.IsInteger(t)?sf(e,t):d.IsBoolean(t)?af(e,t):d.IsArray(t)?Kx(e,t):d.IsTuple(t)?OS(e,t):d.IsObject(t)?Ge(e,t):d.IsUnknown(t)?b.True:b.False}function PS(e,t){return d.IsUndefined(e)||d.IsUndefined(e)?b.True:b.False}function $S(e,t){return d.IsIntersect(t)?Ss(e,t):d.IsUnion(t)?Ul(e,t):d.IsUnknown(t)?uf(e,t):d.IsAny(t)?Fl(e,t):d.IsObject(t)?Ge(e,t):d.IsVoid(t)?b.True:b.False}function re(e,t){return d.IsTemplateLiteral(e)||d.IsTemplateLiteral(t)?yS(e,t):d.IsRegExp(e)||d.IsRegExp(t)?fS(e,t):d.IsNot(e)||d.IsNot(t)?rS(e,t):d.IsAny(e)?Vx(e,t):d.IsArray(e)?Gx(e,t):d.IsBigInt(e)?zx(e,t):d.IsBoolean(e)?Wx(e,t):d.IsAsyncIterator(e)?qx(e,t):d.IsConstructor(e)?Hx(e,t):d.IsDate(e)?Jx(e,t):d.IsFunction(e)?Yx(e,t):d.IsInteger(e)?Xx(e,t):d.IsIntersect(e)?Zx(e,t):d.IsIterator(e)?Qx(e,t):d.IsLiteral(e)?eS(e,t):d.IsNever(e)?tS(e,t):d.IsNull(e)?nS(e,t):d.IsNumber(e)?oS(e,t):d.IsObject(e)?mS(e,t):d.IsRecord(e)?dS(e,t):d.IsString(e)?hS(e,t):d.IsSymbol(e)?gS(e,t):d.IsTuple(e)?xS(e,t):d.IsPromise(e)?uS(e,t):d.IsUint8Array(e)?SS(e,t):d.IsUndefined(e)?IS(e,t):d.IsUnion(e)?wS(e,t):d.IsUnknown(e)?CS(e,t):d.IsVoid(e)?$S(e,t):No(`Unknown left type operand \'${e[g]}\'`)}function Mr(e,t){return re(e,t)}function TS(e,t,n,o,i){let a={};for(let s of globalThis.Object.getOwnPropertyNames(e))a[s]=Br(e[s],t,n,o,ae(i));return a}function AS(e,t,n,o,i){return TS(e.properties,t,n,o,i)}function Dl(e,t,n,o,i){let a=AS(e,t,n,o,i);return q(a)}function LS(e,t,n,o){let i=Mr(e,t);return i===b.Union?V([n,o]):i===b.True?n:o}function Br(e,t,n,o,i){return le(e)?Dl(e,t,n,o,i):ot(e)?y(Ml(e,t,n,o,i)):y(LS(e,t,n,o),i)}function vS(e,t,n,o,i){return{[e]:Br(F(e),t,n,o,ae(i))}}function ES(e,t,n,o,i){return e.reduce((a,s)=>({...a,...vS(s,t,n,o,i)}),{})}function NS(e,t,n,o,i){return ES(e.keys,t,n,o,i)}function Ml(e,t,n,o,i){let a=NS(e,t,n,o,i);return q(a)}function kS(e){return e.allOf.every(t=>Sn(t))}function RS(e){return e.anyOf.some(t=>Sn(t))}function jS(e){return!Sn(e.not)}function Sn(e){return e[g]==="Intersect"?kS(e):e[g]==="Union"?RS(e):e[g]==="Not"?jS(e):e[g]==="Undefined"}function Bl(e,t){return _r(xn(e),t)}function FS(e,t){let n=e.filter(o=>Mr(o,t)===b.False);return n.length===1?n[0]:V(n)}function _r(e,t,n={}){return it(e)?y(Bl(e,t),n):le(e)?y(_l(e,t),n):y(_(e)?FS(e.anyOf,t):Mr(e,t)!==b.False?N():e,n)}function US(e,t){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=_r(e[o],t);return n}function DS(e,t){return US(e.properties,t)}function _l(e,t){let n=DS(e,t);return q(n)}function Vl(e,t){return Vr(xn(e),t)}function MS(e,t){let n=e.filter(o=>Mr(o,t)!==b.False);return n.length===1?n[0]:V(n)}function Vr(e,t,n){return it(e)?y(Vl(e,t),n):le(e)?y(Kl(e,t),n):y(_(e)?MS(e.anyOf,t):Mr(e,t)!==b.False?e:N(),n)}function BS(e,t){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=Vr(e[o],t);return n}function _S(e,t){return BS(e.properties,t)}function Kl(e,t){let n=_S(e,t);return q(n)}function Ui(e,t){return Nt(e)?y(e.returns,t):N(t)}function ao(e){return _e(ve(e))}function so(e,t,n){return y({[g]:"Record",type:"object",patternProperties:{[e]:t}},n)}function Gl(e,t,n){let o={};for(let i of e)o[i]=t;return K(o,{...n,[We]:"Record"})}function VS(e,t,n){return Ti(e)?Gl(Ye(e),t,n):so(e.pattern,t,n)}function KS(e,t,n){return Gl(Ye(V(e)),t,n)}function GS(e,t,n){return Gl([e.toString()],t,n)}function qS(e,t,n){return so(e.source,t,n)}function zS(e,t,n){let o=Se(e.pattern)?vr:e.pattern;return so(o,t,n)}function WS(e,t,n){return so(vr,t,n)}function HS(e,t,n){return so(bl,t,n)}function JS(e,t,n){return K({true:t,false:t},n)}function YS(e,t,n){return so(Lr,t,n)}function XS(e,t,n){return so(Lr,t,n)}function co(e,t,n={}){return _(e)?KS(e.anyOf,t,n):it(e)?VS(e,t,n):Be(e)?GS(e.const,t,n):hr(e)?JS(e,t,n):Rt(e)?YS(e,t,n):jt(e)?XS(e,t,n):ps(e)?qS(e,t,n):gr(e)?zS(e,t,n):cs(e)?WS(e,t,n):Tr(e)?HS(e,t,n):N(n)}function Di(e){return globalThis.Object.getOwnPropertyNames(e.patternProperties)[0]}function ql(e){let t=Di(e);return t===vr?je():t===Lr?Je():je({pattern:t})}function Mi(e){return e.patternProperties[Di(e)]}function ZS(e,t){return t.parameters=ko(e,t.parameters),t.returns=Qt(e,t.returns),t}function QS(e,t){return t.parameters=ko(e,t.parameters),t.returns=Qt(e,t.returns),t}function eI(e,t){return t.allOf=ko(e,t.allOf),t}function tI(e,t){return t.anyOf=ko(e,t.anyOf),t}function rI(e,t){return Se(t.items)||(t.items=ko(e,t.items)),t}function nI(e,t){return t.items=Qt(e,t.items),t}function oI(e,t){return t.items=Qt(e,t.items),t}function iI(e,t){return t.items=Qt(e,t.items),t}function aI(e,t){return t.item=Qt(e,t.item),t}function sI(e,t){let n=mI(e,t.properties);return{...t,...K(n)}}function cI(e,t){let n=Qt(e,ql(t)),o=Qt(e,Mi(t)),i=co(n,o);return{...t,...i}}function lI(e,t){return t.index in e?e[t.index]:st()}function pI(e,t){let n=Wn(t),o=He(t),i=Qt(e,t);return n&&o?ao(i):n&&!o?_e(i):!n&&o?ve(i):i}function mI(e,t){return globalThis.Object.getOwnPropertyNames(t).reduce((n,o)=>({...n,[o]:pI(e,t[o])}),{})}function ko(e,t){return t.map(n=>Qt(e,n))}function Qt(e,t){return Nt(t)?ZS(e,t):kt(t)?QS(e,t):de(t)?eI(e,t):_(t)?tI(e,t):at(t)?rI(e,t):vt(t)?nI(e,t):fn(t)?oI(e,t):gn(t)?iI(e,t):yn(t)?aI(e,t):be(t)?sI(e,t):bn(t)?cI(e,t):ls(t)?lI(e,t):t}function Bi(e,t){return Qt(t,dn(e))}function _i(e){return y({[g]:"Integer",type:"integer"},e)}function uI(e,t,n){return{[e]:_t(F(e),t,ae(n))}}function dI(e,t,n){return e.reduce((i,a)=>({...i,...uI(a,t,n)}),{})}function fI(e,t,n){return dI(e.keys,t,n)}function zl(e,t,n){let o=fI(e,t,n);return q(o)}function hI(e){let[t,n]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),n].join("")}function gI(e){let[t,n]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),n].join("")}function yI(e){return e.toUpperCase()}function bI(e){return e.toLowerCase()}function OI(e,t,n){let o=Jn(e.pattern);if(!On(o))return{...e,pattern:df(e.pattern,t)};let s=[...vo(o)].map(p=>F(p)),c=ff(s,t),l=V(c);return Zn([l],n)}function df(e,t){return typeof e=="string"?t==="Uncapitalize"?hI(e):t==="Capitalize"?gI(e):t==="Uppercase"?yI(e):t==="Lowercase"?bI(e):e:e.toString()}function ff(e,t){return e.map(n=>_t(n,t))}function _t(e,t,n={}){return ot(e)?zl(e,t,n):it(e)?OI(e,t,n):_(e)?V(ff(e.anyOf,t),n):Be(e)?F(df(e.const,t),n):y(e,n)}function Vi(e,t={}){return _t(e,"Capitalize",t)}function Ki(e,t={}){return _t(e,"Lowercase",t)}function Gi(e,t={}){return _t(e,"Uncapitalize",t)}function qi(e,t={}){return _t(e,"Uppercase",t)}function xI(e,t,n){let o={};for(let i of globalThis.Object.getOwnPropertyNames(e))o[i]=er(e[i],t,ae(n));return o}function SI(e,t,n){return xI(e.properties,t,n)}function Wl(e,t,n){let o=SI(e,t,n);return q(o)}function II(e,t){return e.map(n=>Hl(n,t))}function wI(e,t){return e.map(n=>Hl(n,t))}function CI(e,t){let{[t]:n,...o}=e;return o}function PI(e,t){return t.reduce((n,o)=>CI(n,o),e)}function $I(e,t){let n=ge(e,[me,"$id","required","properties"]),o=PI(e.properties,t);return K(o,n)}function TI(e){let t=e.reduce((n,o)=>xi(o)?[...n,F(o)]:n,[]);return V(t)}function Hl(e,t){return de(e)?Ee(II(e.allOf,t)):_(e)?V(wI(e.anyOf,t)):be(e)?$I(e,t):K({})}function er(e,t,n){let o=xe(t)?TI(t):t,i=ue(t)?Ye(t):t,a=he(e),s=he(t);return le(e)?Wl(e,i,n):ot(t)?Jl(e,t,n):a&&s?ie("Omit",[e,o],n):!a&&s?ie("Omit",[e,o],n):a&&!s?ie("Omit",[e,o],n):y({...Hl(e,i),...n})}function AI(e,t,n){return{[t]:er(e,[t],ae(n))}}function LI(e,t,n){return t.reduce((o,i)=>({...o,...AI(e,i,n)}),{})}function vI(e,t,n){return LI(e,t.keys,n)}function Jl(e,t,n){let o=vI(e,t,n);return q(o)}function EI(e,t,n){let o={};for(let i of globalThis.Object.getOwnPropertyNames(e))o[i]=tr(e[i],t,ae(n));return o}function NI(e,t,n){return EI(e.properties,t,n)}function Yl(e,t,n){let o=NI(e,t,n);return q(o)}function kI(e,t){return e.map(n=>Xl(n,t))}function RI(e,t){return e.map(n=>Xl(n,t))}function jI(e,t){let n={};for(let o of t)o in e&&(n[o]=e[o]);return n}function FI(e,t){let n=ge(e,[me,"$id","required","properties"]),o=jI(e.properties,t);return K(o,n)}function UI(e){let t=e.reduce((n,o)=>xi(o)?[...n,F(o)]:n,[]);return V(t)}function Xl(e,t){return de(e)?Ee(kI(e.allOf,t)):_(e)?V(RI(e.anyOf,t)):be(e)?FI(e,t):K({})}function tr(e,t,n){let o=xe(t)?UI(t):t,i=ue(t)?Ye(t):t,a=he(e),s=he(t);return le(e)?Yl(e,i,n):ot(t)?Zl(e,t,n):a&&s?ie("Pick",[e,o],n):!a&&s?ie("Pick",[e,o],n):a&&!s?ie("Pick",[e,o],n):y({...Xl(e,i),...n})}function DI(e,t,n){return{[t]:tr(e,[t],ae(n))}}function MI(e,t,n){return t.reduce((o,i)=>({...o,...DI(e,i,n)}),{})}function BI(e,t,n){return MI(e,t.keys,n)}function Zl(e,t,n){let o=BI(e,t,n);return q(o)}function _I(e,t){return ie("Partial",[ie(e,t)])}function VI(e){return ie("Partial",[yt(e)])}function KI(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=ve(e[n]);return t}function GI(e){let t=ge(e,[me,"$id","required","properties"]),n=KI(e.properties);return K(n,t)}function hf(e){return e.map(t=>gf(t))}function gf(e){return Et(e)?_I(e.target,e.parameters):he(e)?VI(e.$ref):de(e)?Ee(hf(e.allOf)):_(e)?V(hf(e.anyOf)):be(e)?GI(e):hn(e)||hr(e)||Rt(e)||Be(e)||Po(e)||jt(e)||gr(e)||$o(e)||yr(e)?e:K({})}function Kr(e,t){return le(e)?Ql(e,t):y({...gf(e),...t})}function qI(e,t){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=Kr(e[o],ae(t));return n}function zI(e,t){return qI(e.properties,t)}function Ql(e,t){let n=zI(e,t);return q(n)}function WI(e,t){return ie("Required",[ie(e,t)])}function HI(e){return ie("Required",[yt(e)])}function JI(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=ge(e[n],[ke]);return t}function YI(e){let t=ge(e,[me,"$id","required","properties"]),n=JI(e.properties);return K(n,t)}function yf(e){return e.map(t=>bf(t))}function bf(e){return Et(e)?WI(e.target,e.parameters):he(e)?HI(e.$ref):de(e)?Ee(yf(e.allOf)):_(e)?V(yf(e.anyOf)):be(e)?YI(e):hn(e)||hr(e)||Rt(e)||Be(e)||Po(e)||jt(e)||gr(e)||$o(e)||yr(e)?e:K({})}function Gr(e,t){return le(e)?ep(e,t):y({...bf(e),...t})}function XI(e,t){let n={};for(let o of globalThis.Object.getOwnPropertyNames(e))n[o]=Gr(e[o],t);return n}function ZI(e,t){return XI(e.properties,t)}function ep(e,t){let n=ZI(e,t);return q(n)}function QI(e,t){return t.map(n=>he(n)?tp(e,n.$ref):bt(e,n))}function tp(e,t){return t in e?he(e[t])?tp(e,e[t].$ref):bt(e,e[t]):N()}function e0(e){return Ur(e[0])}function t0(e){return Zt(e[0],e[1])}function r0(e){return Dr(e[0])}function n0(e){return Kr(e[0])}function o0(e){return er(e[0],e[1])}function i0(e){return tr(e[0],e[1])}function a0(e){return Gr(e[0])}function s0(e,t,n){let o=QI(e,n);return t==="Awaited"?e0(o):t==="Index"?t0(o):t==="KeyOf"?r0(o):t==="Partial"?n0(o):t==="Omit"?o0(o):t==="Pick"?i0(o):t==="Required"?a0(o):N()}function c0(e,t){return Er(bt(e,t))}function l0(e,t){return Nr(bt(e,t))}function p0(e,t,n){return kr(zi(e,t),bt(e,n))}function m0(e,t,n){return gt(zi(e,t),bt(e,n))}function u0(e,t){return Ee(zi(e,t))}function d0(e,t){return Fr(bt(e,t))}function f0(e,t){return K(globalThis.Object.keys(t).reduce((n,o)=>({...n,[o]:bt(e,t[o])}),{}))}function h0(e,t){let[n,o]=[bt(e,Mi(t)),Di(t)],i=dn(t);return i.patternProperties[o]=n,i}function g0(e,t){return he(t)?{...tp(e,t.$ref),[me]:t[me]}:t}function y0(e,t){return Xe(zi(e,t))}function b0(e,t){return V(zi(e,t))}function zi(e,t){return t.map(n=>bt(e,n))}function bt(e,t){return He(t)?y(bt(e,ge(t,[ke])),t):Wn(t)?y(bt(e,ge(t,[Lt])),t):W(t)?y(g0(e,t),t):vt(t)?y(c0(e,t.items),t):fn(t)?y(l0(e,t.items),t):Et(t)?y(s0(e,t.target,t.parameters)):Nt(t)?y(p0(e,t.parameters,t.returns),t):kt(t)?y(m0(e,t.parameters,t.returns),t):de(t)?y(u0(e,t.allOf),t):gn(t)?y(d0(e,t.items),t):be(t)?y(f0(e,t.properties),t):bn(t)?y(h0(e,t)):at(t)?y(y0(e,t.items||[]),t):_(t)?y(b0(e,t.anyOf),t):t}function O0(e,t){return t in e?bt(e,e[t]):N()}function Of(e){return globalThis.Object.getOwnPropertyNames(e).reduce((t,n)=>({...t,[n]:O0(e,n)}),{})}var ws=class{constructor(t){let n=Of(t),o=this.WithIdentifiers(n);this.$defs=o}Import(t,n){let o={...this.$defs,[t]:y(this.$defs[t],n)};return y({[g]:"Import",$defs:o,$ref:t})}WithIdentifiers(t){return globalThis.Object.getOwnPropertyNames(t).reduce((n,o)=>({...n,[o]:{...t[o],$id:o}}),{})}};function Wi(e){return new ws(e)}function Hi(e,t){return y({[g]:"Not",not:e},t)}function Ji(e,t){return kt(e)?Xe(e.parameters,t):N()}var x0=0;function Yi(e,t={}){Se(t.$id)&&(t.$id=`T${x0++}`);let n=dn(e({[g]:"This",$ref:`${t.$id}`}));return n.$id=t.$id,y({[We]:"Recursive",...n},t)}function Xi(e,t){let n=ne(e)?new globalThis.RegExp(e):e;return y({[g]:"RegExp",type:"RegExp",source:n.source,flags:n.flags},t)}function S0(e){return de(e)?e.allOf:_(e)?e.anyOf:at(e)?e.items??[]:[]}function Zi(e){return S0(e)}function Qi(e,t){return kt(e)?y(e.returns,t):N(t)}var Cs=class{constructor(t){this.schema=t}Decode(t){return new Ps(this.schema,t)}},Ps=class{constructor(t,n){this.schema=t,this.decode=n}EncodeTransform(t,n){let a={Encode:s=>n[me].Encode(t(s)),Decode:s=>this.decode(n[me].Decode(s))};return{...n,[me]:a}}EncodeSchema(t,n){let o={Decode:this.decode,Encode:t};return{...n,[me]:o}}Encode(t){return W(this.schema)?this.EncodeTransform(t,this.schema):this.EncodeSchema(t,this.schema)}};function ea(e){return new Cs(e)}function ta(e={}){return y({[g]:e[g]??"Unsafe"},e)}function ra(e){return y({[g]:"Void",type:"void"},e)}var Ro=class{ReadonlyOptional(t){return ao(t)}Readonly(t,n){return _e(t,n??!0)}Optional(t,n){return ve(t,n??!0)}Any(t){return Yt(t)}Array(t,n){return Er(t,n)}Boolean(t){return Xn(t)}Capitalize(t,n){return Vi(t,n)}Composite(t,n){return ki(t,n)}Const(t,n){return Ri(t,n)}Enum(t,n){return Fi(t,n)}Exclude(t,n,o){return _r(t,n,o)}Extends(t,n,o,i,a){return Br(t,n,o,i,a)}Extract(t,n,o){return Vr(t,n,o)}Index(t,n,o){return Zt(t,n,o)}Integer(t){return _i(t)}Intersect(t,n){return Ee(t,n)}KeyOf(t,n){return Dr(t,n)}Literal(t,n){return F(t,n)}Lowercase(t,n){return Ki(t,n)}Mapped(t,n,o){return vi(t,n,o)}Module(t){return Wi(t)}Never(t){return N(t)}Not(t,n){return Hi(t,n)}Null(t){return ro(t)}Number(t){return Je(t)}Object(t,n){return K(t,n)}Omit(t,n,o){return er(t,n,o)}Partial(t,n){return Kr(t,n)}Pick(t,n,o){return tr(t,n,o)}Record(t,n,o){return co(t,n,o)}Recursive(t,n){return Yi(t,n)}Ref(...t){return yt(t[0],t[1])}Required(t,n){return Gr(t,n)}Rest(t){return Zi(t)}String(t){return je(t)}TemplateLiteral(t,n){return Zn(t,n)}Transform(t){return ea(t)}Tuple(t,n){return Xe(t,n)}Uncapitalize(t,n){return Gi(t,n)}Union(t,n){return V(t,n)}Unknown(t){return st(t)}Unsafe(t){return ta(t)}Uppercase(t,n){return qi(t,n)}};var rp={};tt(rp,{Any:()=>Yt,Argument:()=>wi,Array:()=>Er,AsyncIterator:()=>Nr,Awaited:()=>Ur,BigInt:()=>jr,Boolean:()=>Xn,Capitalize:()=>Vi,Composite:()=>ki,Const:()=>Ri,Constructor:()=>kr,ConstructorParameters:()=>ji,Date:()=>to,Enum:()=>Fi,Exclude:()=>_r,Extends:()=>Br,Extract:()=>Vr,Function:()=>gt,Index:()=>Zt,InstanceType:()=>Ui,Instantiate:()=>Bi,Integer:()=>_i,Intersect:()=>Ee,Iterator:()=>Fr,KeyOf:()=>Dr,Literal:()=>F,Lowercase:()=>Ki,Mapped:()=>vi,Module:()=>Wi,Never:()=>N,Not:()=>Hi,Null:()=>ro,Number:()=>Je,Object:()=>K,Omit:()=>er,Optional:()=>ve,Parameters:()=>Ji,Partial:()=>Kr,Pick:()=>tr,Promise:()=>Qn,Readonly:()=>_e,ReadonlyOptional:()=>ao,Record:()=>co,Recursive:()=>Yi,Ref:()=>yt,RegExp:()=>Xi,Required:()=>Gr,Rest:()=>Zi,ReturnType:()=>Qi,String:()=>je,Symbol:()=>no,TemplateLiteral:()=>Zn,Transform:()=>ea,Tuple:()=>Xe,Uint8Array:()=>io,Uncapitalize:()=>Gi,Undefined:()=>oo,Union:()=>V,Unknown:()=>st,Unsafe:()=>ta,Uppercase:()=>qi,Void:()=>ra});var $s=class extends Ro{Argument(t){return wi(t)}AsyncIterator(t,n){return Nr(t,n)}Awaited(t,n){return Ur(t,n)}BigInt(t){return jr(t)}ConstructorParameters(t,n){return ji(t,n)}Constructor(t,n,o){return kr(t,n,o)}Date(t={}){return to(t)}Function(t,n,o){return gt(t,n,o)}InstanceType(t,n){return Ui(t,n)}Instantiate(t,n){return Bi(t,n)}Iterator(t,n){return Fr(t,n)}Parameters(t,n){return Ji(t,n)}Promise(t,n){return Qn(t,n)}RegExp(t,n){return Xi(t,n)}ReturnType(t,n){return Qi(t,n)}Symbol(t){return no(t)}Undefined(t){return oo(t)}Uint8Array(t){return io(t)}Void(t){return ra(t)}};var r=rp;var bp={};tt(bp,{Assert:()=>na,AssertError:()=>vs,Cast:()=>Uo,Check:()=>k,Clean:()=>ia,Clone:()=>z,Convert:()=>ca,Create:()=>Vt,Decode:()=>cp,Default:()=>da,Delete:()=>Uf,Diff:()=>mp,Edit:()=>pp,Encode:()=>dp,Equal:()=>Cn,HasPropertyKey:()=>T,HasTransform:()=>wn,Hash:()=>lo,Insert:()=>jf,IsArray:()=>L,IsAsyncIterator:()=>hi,IsBigInt:()=>At,IsBigInt64Array:()=>Rb,IsBigUint64Array:()=>jb,IsBoolean:()=>Ht,IsDate:()=>Ke,IsFloat32Array:()=>Nb,IsFloat64Array:()=>kb,IsFunction:()=>dr,IsInstanceObject:()=>Cb,IsInt16Array:()=>Ab,IsInt32Array:()=>vb,IsInt8Array:()=>$b,IsInteger:()=>bi,IsIterator:()=>gi,IsMap:()=>ul,IsNull:()=>ur,IsNumber:()=>ce,IsObject:()=>E,IsPromise:()=>yi,IsRegExp:()=>Pb,IsSet:()=>dl,IsStandardObject:()=>ss,IsString:()=>Z,IsSymbol:()=>fr,IsTypedArray:()=>ht,IsUint16Array:()=>Lb,IsUint32Array:()=>Eb,IsUint8Array:()=>zn,IsUint8ClampedArray:()=>Tb,IsUndefined:()=>se,IsValueType:()=>nt,Mutate:()=>hp,Parse:()=>yp,ParseDefault:()=>gp,ParseError:()=>ya,ParseRegistry:()=>Ms,Patch:()=>up,TransformDecode:()=>pa,TransformDecodeCheckError:()=>la,TransformDecodeError:()=>Ns,TransformEncode:()=>ua,TransformEncodeCheckError:()=>ma,TransformEncodeError:()=>ks,Update:()=>Ff,Value:()=>$,ValueCastError:()=>oa,ValueCheckUnknownTypeError:()=>As,ValueCreateError:()=>lt,ValueDiffError:()=>ha,ValueErrorIterator:()=>br,ValueErrorType:()=>h,ValueHashError:()=>Ts,ValueMutateError:()=>ga,ValuePointer:()=>Kt});function I0(e){switch(e.errorType){case h.ArrayContains:return"Expected array to contain at least one matching value";case h.ArrayMaxContains:return`Expected array to contain no more than ${e.schema.maxContains} matching values`;case h.ArrayMinContains:return`Expected array to contain at least ${e.schema.minContains} matching values`;case h.ArrayMaxItems:return`Expected array length to be less or equal to ${e.schema.maxItems}`;case h.ArrayMinItems:return`Expected array length to be greater or equal to ${e.schema.minItems}`;case h.ArrayUniqueItems:return"Expected array elements to be unique";case h.Array:return"Expected array";case h.AsyncIterator:return"Expected AsyncIterator";case h.BigIntExclusiveMaximum:return`Expected bigint to be less than ${e.schema.exclusiveMaximum}`;case h.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${e.schema.exclusiveMinimum}`;case h.BigIntMaximum:return`Expected bigint to be less or equal to ${e.schema.maximum}`;case h.BigIntMinimum:return`Expected bigint to be greater or equal to ${e.schema.minimum}`;case h.BigIntMultipleOf:return`Expected bigint to be a multiple of ${e.schema.multipleOf}`;case h.BigInt:return"Expected bigint";case h.Boolean:return"Expected boolean";case h.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${e.schema.exclusiveMinimumTimestamp}`;case h.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${e.schema.exclusiveMaximumTimestamp}`;case h.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${e.schema.minimumTimestamp}`;case h.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${e.schema.maximumTimestamp}`;case h.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${e.schema.multipleOfTimestamp}`;case h.Date:return"Expected Date";case h.Function:return"Expected function";case h.IntegerExclusiveMaximum:return`Expected integer to be less than ${e.schema.exclusiveMaximum}`;case h.IntegerExclusiveMinimum:return`Expected integer to be greater than ${e.schema.exclusiveMinimum}`;case h.IntegerMaximum:return`Expected integer to be less or equal to ${e.schema.maximum}`;case h.IntegerMinimum:return`Expected integer to be greater or equal to ${e.schema.minimum}`;case h.IntegerMultipleOf:return`Expected integer to be a multiple of ${e.schema.multipleOf}`;case h.Integer:return"Expected integer";case h.IntersectUnevaluatedProperties:return"Unexpected property";case h.Intersect:return"Expected all values to match";case h.Iterator:return"Expected Iterator";case h.Literal:return`Expected ${typeof e.schema.const=="string"?`\'${e.schema.const}\'`:e.schema.const}`;case h.Never:return"Never";case h.Not:return"Value should not match";case h.Null:return"Expected null";case h.NumberExclusiveMaximum:return`Expected number to be less than ${e.schema.exclusiveMaximum}`;case h.NumberExclusiveMinimum:return`Expected number to be greater than ${e.schema.exclusiveMinimum}`;case h.NumberMaximum:return`Expected number to be less or equal to ${e.schema.maximum}`;case h.NumberMinimum:return`Expected number to be greater or equal to ${e.schema.minimum}`;case h.NumberMultipleOf:return`Expected number to be a multiple of ${e.schema.multipleOf}`;case h.Number:return"Expected number";case h.Object:return"Expected object";case h.ObjectAdditionalProperties:return"Unexpected property";case h.ObjectMaxProperties:return`Expected object to have no more than ${e.schema.maxProperties} properties`;case h.ObjectMinProperties:return`Expected object to have at least ${e.schema.minProperties} properties`;case h.ObjectRequiredProperty:return"Expected required property";case h.Promise:return"Expected Promise";case h.RegExp:return"Expected string to match regular expression";case h.StringFormatUnknown:return`Unknown format \'${e.schema.format}\'`;case h.StringFormat:return`Expected string to match \'${e.schema.format}\' format`;case h.StringMaxLength:return`Expected string length less or equal to ${e.schema.maxLength}`;case h.StringMinLength:return`Expected string length greater or equal to ${e.schema.minLength}`;case h.StringPattern:return`Expected string to match \'${e.schema.pattern}\'`;case h.String:return"Expected string";case h.Symbol:return"Expected symbol";case h.TupleLength:return`Expected tuple to have ${e.schema.maxItems||0} elements`;case h.Tuple:return"Expected tuple";case h.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${e.schema.maxByteLength}`;case h.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${e.schema.minByteLength}`;case h.Uint8Array:return"Expected Uint8Array";case h.Undefined:return"Expected undefined";case h.Union:return"Expected union value";case h.Void:return"Expected void";case h.Kind:return`Expected kind \'${e.schema[g]}\'`;default:return"Unknown error type"}}var w0=I0;function xf(){return w0}var op=class extends v{constructor(t){super(`Unable to dereference schema with $id \'${t.$ref}\'`),this.schema=t}};function C0(e,t){let n=t.find(o=>o.$id===e.$ref);if(n===void 0)throw new op(e);return J(n,t)}function Fe(e,t){return!Z(e.$id)||t.some(n=>n.$id===e.$id)||t.push(e),t}function J(e,t){return e[g]==="This"||e[g]==="Ref"?C0(e,t):e}var Ts=class extends v{constructor(t){super("Unable to hash value"),this.value=t}},Ot;(function(e){e[e.Undefined=0]="Undefined",e[e.Null=1]="Null",e[e.Boolean=2]="Boolean",e[e.Number=3]="Number",e[e.String=4]="String",e[e.Object=5]="Object",e[e.Array=6]="Array",e[e.Date=7]="Date",e[e.Uint8Array=8]="Uint8Array",e[e.Symbol=9]="Symbol",e[e.BigInt=10]="BigInt"})(Ot||(Ot={}));var jo=BigInt("14695981039346656037"),[P0,$0]=[BigInt("1099511628211"),BigInt("18446744073709551616")],T0=Array.from({length:256}).map((e,t)=>BigInt(t)),Sf=new Float64Array(1),If=new DataView(Sf.buffer),wf=new Uint8Array(Sf.buffer);function*A0(e){let t=e===0?1:Math.ceil(Math.floor(Math.log2(e)+1)/8);for(let n=0;n<t;n++)yield e>>8*(t-1-n)&255}function L0(e){qe(Ot.Array);for(let t of e)Fo(t)}function v0(e){qe(Ot.Boolean),qe(e?1:0)}function E0(e){qe(Ot.BigInt),If.setBigInt64(0,e);for(let t of wf)qe(t)}function N0(e){qe(Ot.Date),Fo(e.getTime())}function k0(e){qe(Ot.Null)}function R0(e){qe(Ot.Number),If.setFloat64(0,e);for(let t of wf)qe(t)}function j0(e){qe(Ot.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())Fo(t),Fo(e[t])}function F0(e){qe(Ot.String);for(let t=0;t<e.length;t++)for(let n of A0(e.charCodeAt(t)))qe(n)}function U0(e){qe(Ot.Symbol),Fo(e.description)}function D0(e){qe(Ot.Uint8Array);for(let t=0;t<e.length;t++)qe(e[t])}function M0(e){return qe(Ot.Undefined)}function Fo(e){if(L(e))return L0(e);if(Ht(e))return v0(e);if(At(e))return E0(e);if(Ke(e))return N0(e);if(ur(e))return k0(e);if(ce(e))return R0(e);if(E(e))return j0(e);if(Z(e))return F0(e);if(fr(e))return U0(e);if(zn(e))return D0(e);if(se(e))return M0(e);throw new Ts(e)}function qe(e){jo=jo^T0[e],jo=jo*P0%$0}function lo(e){return jo=BigInt("14695981039346656037"),Fo(e),jo}var As=class extends v{constructor(t){super("Unknown type"),this.schema=t}};function B0(e){return e[g]==="Any"||e[g]==="Unknown"}function M(e){return e!==void 0}function _0(e,t,n){return!0}function V0(e,t,n){return!0}function K0(e,t,n){if(!L(n)||M(e.minItems)&&!(n.length>=e.minItems)||M(e.maxItems)&&!(n.length<=e.maxItems)||!n.every(a=>Ue(e.items,t,a))||e.uniqueItems===!0&&!function(){let a=new Set;for(let s of n){let c=lo(s);if(a.has(c))return!1;a.add(c)}return!0}())return!1;if(!(M(e.contains)||ce(e.minContains)||ce(e.maxContains)))return!0;let o=M(e.contains)?e.contains:N(),i=n.reduce((a,s)=>Ue(o,t,s)?a+1:a,0);return!(i===0||ce(e.minContains)&&i<e.minContains||ce(e.maxContains)&&i>e.maxContains)}function G0(e,t,n){return hi(n)}function q0(e,t,n){return!(!At(n)||M(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||M(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||M(e.maximum)&&!(n<=e.maximum)||M(e.minimum)&&!(n>=e.minimum)||M(e.multipleOf)&&n%e.multipleOf!==BigInt(0))}function z0(e,t,n){return Ht(n)}function W0(e,t,n){return Ue(e.returns,t,n.prototype)}function H0(e,t,n){return!(!Ke(n)||M(e.exclusiveMaximumTimestamp)&&!(n.getTime()<e.exclusiveMaximumTimestamp)||M(e.exclusiveMinimumTimestamp)&&!(n.getTime()>e.exclusiveMinimumTimestamp)||M(e.maximumTimestamp)&&!(n.getTime()<=e.maximumTimestamp)||M(e.minimumTimestamp)&&!(n.getTime()>=e.minimumTimestamp)||M(e.multipleOfTimestamp)&&n.getTime()%e.multipleOfTimestamp!==0)}function J0(e,t,n){return dr(n)}function Y0(e,t,n){let o=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return Ue(i,[...t,...o],n)}function X0(e,t,n){return!(!bi(n)||M(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||M(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||M(e.maximum)&&!(n<=e.maximum)||M(e.minimum)&&!(n>=e.minimum)||M(e.multipleOf)&&n%e.multipleOf!==0)}function Z0(e,t,n){let o=e.allOf.every(i=>Ue(i,t,n));if(e.unevaluatedProperties===!1){let i=new RegExp(eo(e)),a=Object.getOwnPropertyNames(n).every(s=>i.test(s));return o&&a}else if(ue(e.unevaluatedProperties)){let i=new RegExp(eo(e)),a=Object.getOwnPropertyNames(n).every(s=>i.test(s)||Ue(e.unevaluatedProperties,t,n[s]));return o&&a}else return o}function Q0(e,t,n){return gi(n)}function ew(e,t,n){return n===e.const}function tw(e,t,n){return!1}function rw(e,t,n){return!Ue(e.not,t,n)}function nw(e,t,n){return ur(n)}function ow(e,t,n){return!(!Ce.IsNumberLike(n)||M(e.exclusiveMaximum)&&!(n<e.exclusiveMaximum)||M(e.exclusiveMinimum)&&!(n>e.exclusiveMinimum)||M(e.minimum)&&!(n>=e.minimum)||M(e.maximum)&&!(n<=e.maximum)||M(e.multipleOf)&&n%e.multipleOf!==0)}function iw(e,t,n){if(!Ce.IsObjectLike(n)||M(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)||M(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties))return!1;let o=Object.getOwnPropertyNames(e.properties);for(let i of o){let a=e.properties[i];if(e.required&&e.required.includes(i)){if(!Ue(a,t,n[i])||(Sn(a)||B0(a))&&!(i in n))return!1}else if(Ce.IsExactOptionalProperty(n,i)&&!Ue(a,t,n[i]))return!1}if(e.additionalProperties===!1){let i=Object.getOwnPropertyNames(n);return e.required&&e.required.length===o.length&&i.length===o.length?!0:i.every(a=>o.includes(a))}else return typeof e.additionalProperties=="object"?Object.getOwnPropertyNames(n).every(a=>o.includes(a)||Ue(e.additionalProperties,t,n[a])):!0}function aw(e,t,n){return yi(n)}function sw(e,t,n){if(!Ce.IsRecordLike(n)||M(e.minProperties)&&!(Object.getOwnPropertyNames(n).length>=e.minProperties)||M(e.maxProperties)&&!(Object.getOwnPropertyNames(n).length<=e.maxProperties))return!1;let[o,i]=Object.entries(e.patternProperties)[0],a=new RegExp(o),s=Object.entries(n).every(([p,m])=>a.test(p)?Ue(i,t,m):!0),c=typeof e.additionalProperties=="object"?Object.entries(n).every(([p,m])=>a.test(p)?!0:Ue(e.additionalProperties,t,m)):!0,l=e.additionalProperties===!1?Object.getOwnPropertyNames(n).every(p=>a.test(p)):!0;return s&&c&&l}function cw(e,t,n){return Ue(J(e,t),t,n)}function lw(e,t,n){let o=new RegExp(e.source,e.flags);return M(e.minLength)&&!(n.length>=e.minLength)||M(e.maxLength)&&!(n.length<=e.maxLength)?!1:o.test(n)}function pw(e,t,n){return!Z(n)||M(e.minLength)&&!(n.length>=e.minLength)||M(e.maxLength)&&!(n.length<=e.maxLength)||M(e.pattern)&&!new RegExp(e.pattern).test(n)?!1:M(e.format)?Ft.Has(e.format)?Ft.Get(e.format)(n):!1:!0}function mw(e,t,n){return fr(n)}function uw(e,t,n){return Z(n)&&new RegExp(e.pattern).test(n)}function dw(e,t,n){return Ue(J(e,t),t,n)}function fw(e,t,n){if(!L(n)||e.items===void 0&&n.length!==0||n.length!==e.maxItems)return!1;if(!e.items)return!0;for(let o=0;o<e.items.length;o++)if(!Ue(e.items[o],t,n[o]))return!1;return!0}function hw(e,t,n){return se(n)}function gw(e,t,n){return e.anyOf.some(o=>Ue(o,t,n))}function yw(e,t,n){return!(!zn(n)||M(e.maxByteLength)&&!(n.length<=e.maxByteLength)||M(e.minByteLength)&&!(n.length>=e.minByteLength))}function bw(e,t,n){return!0}function Ow(e,t,n){return Ce.IsVoidLike(n)}function xw(e,t,n){return Ut.Has(e[g])?Ut.Get(e[g])(e,n):!1}function Ue(e,t,n){let o=M(e.$id)?Fe(e,t):t,i=e;switch(i[g]){case"Any":return _0(i,o,n);case"Argument":return V0(i,o,n);case"Array":return K0(i,o,n);case"AsyncIterator":return G0(i,o,n);case"BigInt":return q0(i,o,n);case"Boolean":return z0(i,o,n);case"Constructor":return W0(i,o,n);case"Date":return H0(i,o,n);case"Function":return J0(i,o,n);case"Import":return Y0(i,o,n);case"Integer":return X0(i,o,n);case"Intersect":return Z0(i,o,n);case"Iterator":return Q0(i,o,n);case"Literal":return ew(i,o,n);case"Never":return tw(i,o,n);case"Not":return rw(i,o,n);case"Null":return nw(i,o,n);case"Number":return ow(i,o,n);case"Object":return iw(i,o,n);case"Promise":return aw(i,o,n);case"Record":return sw(i,o,n);case"Ref":return cw(i,o,n);case"RegExp":return lw(i,o,n);case"String":return pw(i,o,n);case"Symbol":return mw(i,o,n);case"TemplateLiteral":return uw(i,o,n);case"This":return dw(i,o,n);case"Tuple":return fw(i,o,n);case"Undefined":return hw(i,o,n);case"Union":return gw(i,o,n);case"Uint8Array":return yw(i,o,n);case"Unknown":return bw(i,o,n);case"Void":return Ow(i,o,n);default:if(!Ut.Has(i[g]))throw new As(i);return xw(i,o,n)}}function k(...e){return e.length===3?Ue(e[0],e[1],e[2]):Ue(e[0],[],e[1])}var h;(function(e){e[e.ArrayContains=0]="ArrayContains",e[e.ArrayMaxContains=1]="ArrayMaxContains",e[e.ArrayMaxItems=2]="ArrayMaxItems",e[e.ArrayMinContains=3]="ArrayMinContains",e[e.ArrayMinItems=4]="ArrayMinItems",e[e.ArrayUniqueItems=5]="ArrayUniqueItems",e[e.Array=6]="Array",e[e.AsyncIterator=7]="AsyncIterator",e[e.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",e[e.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",e[e.BigIntMaximum=10]="BigIntMaximum",e[e.BigIntMinimum=11]="BigIntMinimum",e[e.BigIntMultipleOf=12]="BigIntMultipleOf",e[e.BigInt=13]="BigInt",e[e.Boolean=14]="Boolean",e[e.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",e[e.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",e[e.DateMaximumTimestamp=17]="DateMaximumTimestamp",e[e.DateMinimumTimestamp=18]="DateMinimumTimestamp",e[e.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",e[e.Date=20]="Date",e[e.Function=21]="Function",e[e.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",e[e.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",e[e.IntegerMaximum=24]="IntegerMaximum",e[e.IntegerMinimum=25]="IntegerMinimum",e[e.IntegerMultipleOf=26]="IntegerMultipleOf",e[e.Integer=27]="Integer",e[e.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",e[e.Intersect=29]="Intersect",e[e.Iterator=30]="Iterator",e[e.Kind=31]="Kind",e[e.Literal=32]="Literal",e[e.Never=33]="Never",e[e.Not=34]="Not",e[e.Null=35]="Null",e[e.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",e[e.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",e[e.NumberMaximum=38]="NumberMaximum",e[e.NumberMinimum=39]="NumberMinimum",e[e.NumberMultipleOf=40]="NumberMultipleOf",e[e.Number=41]="Number",e[e.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",e[e.ObjectMaxProperties=43]="ObjectMaxProperties",e[e.ObjectMinProperties=44]="ObjectMinProperties",e[e.ObjectRequiredProperty=45]="ObjectRequiredProperty",e[e.Object=46]="Object",e[e.Promise=47]="Promise",e[e.RegExp=48]="RegExp",e[e.StringFormatUnknown=49]="StringFormatUnknown",e[e.StringFormat=50]="StringFormat",e[e.StringMaxLength=51]="StringMaxLength",e[e.StringMinLength=52]="StringMinLength",e[e.StringPattern=53]="StringPattern",e[e.String=54]="String",e[e.Symbol=55]="Symbol",e[e.TupleLength=56]="TupleLength",e[e.Tuple=57]="Tuple",e[e.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",e[e.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",e[e.Uint8Array=60]="Uint8Array",e[e.Undefined=61]="Undefined",e[e.Union=62]="Union",e[e.Void=63]="Void"})(h||(h={}));var ip=class extends v{constructor(t){super("Unknown type"),this.schema=t}};function qr(e){return e.replace(/~/g,"~0").replace(/\\//g,"~1")}function B(e){return e!==void 0}var br=class{constructor(t){this.iterator=t}[Symbol.iterator](){return this.iterator}First(){let t=this.iterator.next();return t.done?void 0:t.value}};function w(e,t,n,o,i=[]){return{type:e,schema:t,path:n,value:o,message:xf()({errorType:e,path:n,schema:t,value:o,errors:i}),errors:i}}function*Sw(e,t,n,o){}function*Iw(e,t,n,o){}function*ww(e,t,n,o){if(!L(o))return yield w(h.Array,e,n,o);B(e.minItems)&&!(o.length>=e.minItems)&&(yield w(h.ArrayMinItems,e,n,o)),B(e.maxItems)&&!(o.length<=e.maxItems)&&(yield w(h.ArrayMaxItems,e,n,o));for(let s=0;s<o.length;s++)yield*De(e.items,t,`${n}/${s}`,o[s]);if(e.uniqueItems===!0&&!function(){let s=new Set;for(let c of o){let l=lo(c);if(s.has(l))return!1;s.add(l)}return!0}()&&(yield w(h.ArrayUniqueItems,e,n,o)),!(B(e.contains)||B(e.minContains)||B(e.maxContains)))return;let i=B(e.contains)?e.contains:N(),a=o.reduce((s,c,l)=>De(i,t,`${n}${l}`,c).next().done===!0?s+1:s,0);a===0&&(yield w(h.ArrayContains,e,n,o)),ce(e.minContains)&&a<e.minContains&&(yield w(h.ArrayMinContains,e,n,o)),ce(e.maxContains)&&a>e.maxContains&&(yield w(h.ArrayMaxContains,e,n,o))}function*Cw(e,t,n,o){hi(o)||(yield w(h.AsyncIterator,e,n,o))}function*Pw(e,t,n,o){if(!At(o))return yield w(h.BigInt,e,n,o);B(e.exclusiveMaximum)&&!(o<e.exclusiveMaximum)&&(yield w(h.BigIntExclusiveMaximum,e,n,o)),B(e.exclusiveMinimum)&&!(o>e.exclusiveMinimum)&&(yield w(h.BigIntExclusiveMinimum,e,n,o)),B(e.maximum)&&!(o<=e.maximum)&&(yield w(h.BigIntMaximum,e,n,o)),B(e.minimum)&&!(o>=e.minimum)&&(yield w(h.BigIntMinimum,e,n,o)),B(e.multipleOf)&&o%e.multipleOf!==BigInt(0)&&(yield w(h.BigIntMultipleOf,e,n,o))}function*$w(e,t,n,o){Ht(o)||(yield w(h.Boolean,e,n,o))}function*Tw(e,t,n,o){yield*De(e.returns,t,n,o.prototype)}function*Aw(e,t,n,o){if(!Ke(o))return yield w(h.Date,e,n,o);B(e.exclusiveMaximumTimestamp)&&!(o.getTime()<e.exclusiveMaximumTimestamp)&&(yield w(h.DateExclusiveMaximumTimestamp,e,n,o)),B(e.exclusiveMinimumTimestamp)&&!(o.getTime()>e.exclusiveMinimumTimestamp)&&(yield w(h.DateExclusiveMinimumTimestamp,e,n,o)),B(e.maximumTimestamp)&&!(o.getTime()<=e.maximumTimestamp)&&(yield w(h.DateMaximumTimestamp,e,n,o)),B(e.minimumTimestamp)&&!(o.getTime()>=e.minimumTimestamp)&&(yield w(h.DateMinimumTimestamp,e,n,o)),B(e.multipleOfTimestamp)&&o.getTime()%e.multipleOfTimestamp!==0&&(yield w(h.DateMultipleOfTimestamp,e,n,o))}function*Lw(e,t,n,o){dr(o)||(yield w(h.Function,e,n,o))}function*vw(e,t,n,o){let i=globalThis.Object.values(e.$defs),a=e.$defs[e.$ref];yield*De(a,[...t,...i],n,o)}function*Ew(e,t,n,o){if(!bi(o))return yield w(h.Integer,e,n,o);B(e.exclusiveMaximum)&&!(o<e.exclusiveMaximum)&&(yield w(h.IntegerExclusiveMaximum,e,n,o)),B(e.exclusiveMinimum)&&!(o>e.exclusiveMinimum)&&(yield w(h.IntegerExclusiveMinimum,e,n,o)),B(e.maximum)&&!(o<=e.maximum)&&(yield w(h.IntegerMaximum,e,n,o)),B(e.minimum)&&!(o>=e.minimum)&&(yield w(h.IntegerMinimum,e,n,o)),B(e.multipleOf)&&o%e.multipleOf!==0&&(yield w(h.IntegerMultipleOf,e,n,o))}function*Nw(e,t,n,o){let i=!1;for(let a of e.allOf)for(let s of De(a,t,n,o))i=!0,yield s;if(i)return yield w(h.Intersect,e,n,o);if(e.unevaluatedProperties===!1){let a=new RegExp(eo(e));for(let s of Object.getOwnPropertyNames(o))a.test(s)||(yield w(h.IntersectUnevaluatedProperties,e,`${n}/${s}`,o))}if(typeof e.unevaluatedProperties=="object"){let a=new RegExp(eo(e));for(let s of Object.getOwnPropertyNames(o))if(!a.test(s)){let c=De(e.unevaluatedProperties,t,`${n}/${s}`,o[s]).next();c.done||(yield c.value)}}}function*kw(e,t,n,o){gi(o)||(yield w(h.Iterator,e,n,o))}function*Rw(e,t,n,o){o!==e.const&&(yield w(h.Literal,e,n,o))}function*jw(e,t,n,o){yield w(h.Never,e,n,o)}function*Fw(e,t,n,o){De(e.not,t,n,o).next().done===!0&&(yield w(h.Not,e,n,o))}function*Uw(e,t,n,o){ur(o)||(yield w(h.Null,e,n,o))}function*Dw(e,t,n,o){if(!Ce.IsNumberLike(o))return yield w(h.Number,e,n,o);B(e.exclusiveMaximum)&&!(o<e.exclusiveMaximum)&&(yield w(h.NumberExclusiveMaximum,e,n,o)),B(e.exclusiveMinimum)&&!(o>e.exclusiveMinimum)&&(yield w(h.NumberExclusiveMinimum,e,n,o)),B(e.maximum)&&!(o<=e.maximum)&&(yield w(h.NumberMaximum,e,n,o)),B(e.minimum)&&!(o>=e.minimum)&&(yield w(h.NumberMinimum,e,n,o)),B(e.multipleOf)&&o%e.multipleOf!==0&&(yield w(h.NumberMultipleOf,e,n,o))}function*Mw(e,t,n,o){if(!Ce.IsObjectLike(o))return yield w(h.Object,e,n,o);B(e.minProperties)&&!(Object.getOwnPropertyNames(o).length>=e.minProperties)&&(yield w(h.ObjectMinProperties,e,n,o)),B(e.maxProperties)&&!(Object.getOwnPropertyNames(o).length<=e.maxProperties)&&(yield w(h.ObjectMaxProperties,e,n,o));let i=Array.isArray(e.required)?e.required:[],a=Object.getOwnPropertyNames(e.properties),s=Object.getOwnPropertyNames(o);for(let c of i)s.includes(c)||(yield w(h.ObjectRequiredProperty,e.properties[c],`${n}/${qr(c)}`,void 0));if(e.additionalProperties===!1)for(let c of s)a.includes(c)||(yield w(h.ObjectAdditionalProperties,e,`${n}/${qr(c)}`,o[c]));if(typeof e.additionalProperties=="object")for(let c of s)a.includes(c)||(yield*De(e.additionalProperties,t,`${n}/${qr(c)}`,o[c]));for(let c of a){let l=e.properties[c];e.required&&e.required.includes(c)?(yield*De(l,t,`${n}/${qr(c)}`,o[c]),Sn(e)&&!(c in o)&&(yield w(h.ObjectRequiredProperty,l,`${n}/${qr(c)}`,void 0))):Ce.IsExactOptionalProperty(o,c)&&(yield*De(l,t,`${n}/${qr(c)}`,o[c]))}}function*Bw(e,t,n,o){yi(o)||(yield w(h.Promise,e,n,o))}function*_w(e,t,n,o){if(!Ce.IsRecordLike(o))return yield w(h.Object,e,n,o);B(e.minProperties)&&!(Object.getOwnPropertyNames(o).length>=e.minProperties)&&(yield w(h.ObjectMinProperties,e,n,o)),B(e.maxProperties)&&!(Object.getOwnPropertyNames(o).length<=e.maxProperties)&&(yield w(h.ObjectMaxProperties,e,n,o));let[i,a]=Object.entries(e.patternProperties)[0],s=new RegExp(i);for(let[c,l]of Object.entries(o))s.test(c)&&(yield*De(a,t,`${n}/${qr(c)}`,l));if(typeof e.additionalProperties=="object")for(let[c,l]of Object.entries(o))s.test(c)||(yield*De(e.additionalProperties,t,`${n}/${qr(c)}`,l));if(e.additionalProperties===!1){for(let[c,l]of Object.entries(o))if(!s.test(c))return yield w(h.ObjectAdditionalProperties,e,`${n}/${qr(c)}`,l)}}function*Vw(e,t,n,o){yield*De(J(e,t),t,n,o)}function*Kw(e,t,n,o){if(!Z(o))return yield w(h.String,e,n,o);if(B(e.minLength)&&!(o.length>=e.minLength)&&(yield w(h.StringMinLength,e,n,o)),B(e.maxLength)&&!(o.length<=e.maxLength)&&(yield w(h.StringMaxLength,e,n,o)),!new RegExp(e.source,e.flags).test(o))return yield w(h.RegExp,e,n,o)}function*Gw(e,t,n,o){if(!Z(o))return yield w(h.String,e,n,o);B(e.minLength)&&!(o.length>=e.minLength)&&(yield w(h.StringMinLength,e,n,o)),B(e.maxLength)&&!(o.length<=e.maxLength)&&(yield w(h.StringMaxLength,e,n,o)),Z(e.pattern)&&(new RegExp(e.pattern).test(o)||(yield w(h.StringPattern,e,n,o))),Z(e.format)&&(Ft.Has(e.format)?Ft.Get(e.format)(o)||(yield w(h.StringFormat,e,n,o)):yield w(h.StringFormatUnknown,e,n,o))}function*qw(e,t,n,o){fr(o)||(yield w(h.Symbol,e,n,o))}function*zw(e,t,n,o){if(!Z(o))return yield w(h.String,e,n,o);new RegExp(e.pattern).test(o)||(yield w(h.StringPattern,e,n,o))}function*Ww(e,t,n,o){yield*De(J(e,t),t,n,o)}function*Hw(e,t,n,o){if(!L(o))return yield w(h.Tuple,e,n,o);if(e.items===void 0&&o.length!==0)return yield w(h.TupleLength,e,n,o);if(o.length!==e.maxItems)return yield w(h.TupleLength,e,n,o);if(e.items)for(let i=0;i<e.items.length;i++)yield*De(e.items[i],t,`${n}/${i}`,o[i])}function*Jw(e,t,n,o){se(o)||(yield w(h.Undefined,e,n,o))}function*Yw(e,t,n,o){if(k(e,t,o))return;let i=e.anyOf.map(a=>new br(De(a,t,n,o)));yield w(h.Union,e,n,o,i)}function*Xw(e,t,n,o){if(!zn(o))return yield w(h.Uint8Array,e,n,o);B(e.maxByteLength)&&!(o.length<=e.maxByteLength)&&(yield w(h.Uint8ArrayMaxByteLength,e,n,o)),B(e.minByteLength)&&!(o.length>=e.minByteLength)&&(yield w(h.Uint8ArrayMinByteLength,e,n,o))}function*Zw(e,t,n,o){}function*Qw(e,t,n,o){Ce.IsVoidLike(o)||(yield w(h.Void,e,n,o))}function*eC(e,t,n,o){Ut.Get(e[g])(e,o)||(yield w(h.Kind,e,n,o))}function*De(e,t,n,o){let i=B(e.$id)?[...t,e]:t,a=e;switch(a[g]){case"Any":return yield*Sw(a,i,n,o);case"Argument":return yield*Iw(a,i,n,o);case"Array":return yield*ww(a,i,n,o);case"AsyncIterator":return yield*Cw(a,i,n,o);case"BigInt":return yield*Pw(a,i,n,o);case"Boolean":return yield*$w(a,i,n,o);case"Constructor":return yield*Tw(a,i,n,o);case"Date":return yield*Aw(a,i,n,o);case"Function":return yield*Lw(a,i,n,o);case"Import":return yield*vw(a,i,n,o);case"Integer":return yield*Ew(a,i,n,o);case"Intersect":return yield*Nw(a,i,n,o);case"Iterator":return yield*kw(a,i,n,o);case"Literal":return yield*Rw(a,i,n,o);case"Never":return yield*jw(a,i,n,o);case"Not":return yield*Fw(a,i,n,o);case"Null":return yield*Uw(a,i,n,o);case"Number":return yield*Dw(a,i,n,o);case"Object":return yield*Mw(a,i,n,o);case"Promise":return yield*Bw(a,i,n,o);case"Record":return yield*_w(a,i,n,o);case"Ref":return yield*Vw(a,i,n,o);case"RegExp":return yield*Kw(a,i,n,o);case"String":return yield*Gw(a,i,n,o);case"Symbol":return yield*qw(a,i,n,o);case"TemplateLiteral":return yield*zw(a,i,n,o);case"This":return yield*Ww(a,i,n,o);case"Tuple":return yield*Hw(a,i,n,o);case"Undefined":return yield*Jw(a,i,n,o);case"Union":return yield*Yw(a,i,n,o);case"Uint8Array":return yield*Xw(a,i,n,o);case"Unknown":return yield*Zw(a,i,n,o);case"Void":return yield*Qw(a,i,n,o);default:if(!Ut.Has(a[g]))throw new ip(e);return yield*eC(a,i,n,o)}}function In(...e){let t=e.length===3?De(e[0],e[1],"",e[2]):De(e[0],[],"",e[1]);return new br(t)}var tC=function(e,t,n,o,i){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n},Pf=function(e,t,n,o){if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?o:n==="a"?o.call(e):o?o.value:t.get(e)},ap,Ls,$f,vs=class extends v{constructor(t){let n=t.First();super(n===void 0?"Invalid Value":n.message),ap.add(this),Ls.set(this,void 0),tC(this,Ls,t,"f"),this.error=n}Errors(){return new br(Pf(this,ap,"m",$f).call(this))}};Ls=new WeakMap,ap=new WeakSet,$f=function*(){this.error&&(yield this.error),yield*Pf(this,Ls,"f")};function Cf(e,t,n){if(!k(e,t,n))throw new vs(In(e,t,n))}function na(...e){return e.length===3?Cf(e[0],e[1],e[2]):Cf(e[0],[],e[1])}function rC(e){let t={};for(let n of Object.getOwnPropertyNames(e))t[n]=z(e[n]);for(let n of Object.getOwnPropertySymbols(e))t[n]=z(e[n]);return t}function nC(e){return e.map(t=>z(t))}function oC(e){return e.slice()}function iC(e){return new Map(z([...e.entries()]))}function aC(e){return new Set(z([...e.entries()]))}function sC(e){return new Date(e.toISOString())}function z(e){if(L(e))return nC(e);if(Ke(e))return sC(e);if(ht(e))return oC(e);if(ul(e))return iC(e);if(dl(e))return aC(e);if(E(e))return rC(e);if(nt(e))return e;throw new Error("ValueClone: Unable to clone value")}var lt=class extends v{constructor(t,n){super(n),this.schema=t}};function H(e){return dr(e)?e():z(e)}function cC(e,t){return T(e,"default")?H(e.default):{}}function lC(e,t){return{}}function pC(e,t){if(e.uniqueItems===!0&&!T(e,"default"))throw new lt(e,"Array with the uniqueItems constraint requires a default value");if("contains"in e&&!T(e,"default"))throw new lt(e,"Array with the contains constraint requires a default value");return"default"in e?H(e.default):e.minItems!==void 0?Array.from({length:e.minItems}).map(n=>xt(e.items,t)):[]}function mC(e,t){return T(e,"default")?H(e.default):async function*(){}()}function uC(e,t){return T(e,"default")?H(e.default):BigInt(0)}function dC(e,t){return T(e,"default")?H(e.default):!1}function fC(e,t){if(T(e,"default"))return H(e.default);{let n=xt(e.returns,t);return typeof n=="object"&&!Array.isArray(n)?class{constructor(){for(let[o,i]of Object.entries(n)){let a=this;a[o]=i}}}:class{}}}function hC(e,t){return T(e,"default")?H(e.default):e.minimumTimestamp!==void 0?new Date(e.minimumTimestamp):new Date}function gC(e,t){return T(e,"default")?H(e.default):()=>xt(e.returns,t)}function yC(e,t){let n=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return xt(o,[...t,...n])}function bC(e,t){return T(e,"default")?H(e.default):e.minimum!==void 0?e.minimum:0}function OC(e,t){if(T(e,"default"))return H(e.default);{let n=e.allOf.reduce((o,i)=>{let a=xt(i,t);return typeof a=="object"?{...o,...a}:a},{});if(!k(e,t,n))throw new lt(e,"Intersect produced invalid value. Consider using a default value.");return n}}function xC(e,t){return T(e,"default")?H(e.default):function*(){}()}function SC(e,t){return T(e,"default")?H(e.default):e.const}function IC(e,t){if(T(e,"default"))return H(e.default);throw new lt(e,"Never types cannot be created. Consider using a default value.")}function wC(e,t){if(T(e,"default"))return H(e.default);throw new lt(e,"Not types must have a default value")}function CC(e,t){return T(e,"default")?H(e.default):null}function PC(e,t){return T(e,"default")?H(e.default):e.minimum!==void 0?e.minimum:0}function $C(e,t){if(T(e,"default"))return H(e.default);{let n=new Set(e.required),o={};for(let[i,a]of Object.entries(e.properties))n.has(i)&&(o[i]=xt(a,t));return o}}function TC(e,t){return T(e,"default")?H(e.default):Promise.resolve(xt(e.item,t))}function AC(e,t){return T(e,"default")?H(e.default):{}}function LC(e,t){return T(e,"default")?H(e.default):xt(J(e,t),t)}function vC(e,t){if(T(e,"default"))return H(e.default);throw new lt(e,"RegExp types cannot be created. Consider using a default value.")}function EC(e,t){if(e.pattern!==void 0){if(T(e,"default"))return H(e.default);throw new lt(e,"String types with patterns must specify a default value")}else if(e.format!==void 0){if(T(e,"default"))return H(e.default);throw new lt(e,"String types with formats must specify a default value")}else return T(e,"default")?H(e.default):e.minLength!==void 0?Array.from({length:e.minLength}).map(()=>" ").join(""):""}function NC(e,t){return T(e,"default")?H(e.default):"value"in e?Symbol.for(e.value):Symbol()}function kC(e,t){if(T(e,"default"))return H(e.default);if(!Ti(e))throw new lt(e,"Can only create template literals that produce a finite variants. Consider using a default value.");return Yn(e)[0]}function RC(e,t){if(Tf++>VC)throw new lt(e,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return T(e,"default")?H(e.default):xt(J(e,t),t)}function jC(e,t){return T(e,"default")?H(e.default):e.items===void 0?[]:Array.from({length:e.minItems}).map((n,o)=>xt(e.items[o],t))}function FC(e,t){if(T(e,"default"))return H(e.default)}function UC(e,t){if(T(e,"default"))return H(e.default);if(e.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return xt(e.anyOf[0],t)}function DC(e,t){return T(e,"default")?H(e.default):e.minByteLength!==void 0?new Uint8Array(e.minByteLength):new Uint8Array(0)}function MC(e,t){return T(e,"default")?H(e.default):{}}function BC(e,t){if(T(e,"default"))return H(e.default)}function _C(e,t){if(T(e,"default"))return H(e.default);throw new Error("User defined types must specify a default value")}function xt(e,t){let n=Fe(e,t),o=e;switch(o[g]){case"Any":return cC(o,n);case"Argument":return lC(o,n);case"Array":return pC(o,n);case"AsyncIterator":return mC(o,n);case"BigInt":return uC(o,n);case"Boolean":return dC(o,n);case"Constructor":return fC(o,n);case"Date":return hC(o,n);case"Function":return gC(o,n);case"Import":return yC(o,n);case"Integer":return bC(o,n);case"Intersect":return OC(o,n);case"Iterator":return xC(o,n);case"Literal":return SC(o,n);case"Never":return IC(o,n);case"Not":return wC(o,n);case"Null":return CC(o,n);case"Number":return PC(o,n);case"Object":return $C(o,n);case"Promise":return TC(o,n);case"Record":return AC(o,n);case"Ref":return LC(o,n);case"RegExp":return vC(o,n);case"String":return EC(o,n);case"Symbol":return NC(o,n);case"TemplateLiteral":return kC(o,n);case"This":return RC(o,n);case"Tuple":return jC(o,n);case"Undefined":return FC(o,n);case"Union":return UC(o,n);case"Uint8Array":return DC(o,n);case"Unknown":return MC(o,n);case"Void":return BC(o,n);default:if(!Ut.Has(o[g]))throw new lt(o,"Unknown type");return _C(o,n)}}var VC=512,Tf=0;function Vt(...e){return Tf=0,e.length===2?xt(e[0],e[1]):xt(e[0],[])}var oa=class extends v{constructor(t,n){super(n),this.schema=t}};function Af(e,t,n){if(e[g]==="Object"&&typeof n=="object"&&!ur(n)){let o=e,i=Object.getOwnPropertyNames(n),a=Object.entries(o.properties),[s,c]=[1/a.length,a.length];return a.reduce((l,[p,m])=>{let u=m[g]==="Literal"&&m.const===n[p]?c:0,f=k(m,t,n[p])?s:0,x=i.includes(p)?s:0;return l+(u+f+x)},0)}else if(e[g]==="Union"){let i=e.anyOf.map(a=>J(a,t)).map(a=>Af(a,t,n));return Math.max(...i)}else return k(e,t,n)?1:0}function KC(e,t,n){let o=e.anyOf.map(s=>J(s,t)),[i,a]=[o[0],0];for(let s of o){let c=Af(s,t,n);c>a&&(i=s,a=c)}return i}function GC(e,t,n){if("default"in e)return typeof n=="function"?e.default:z(e.default);{let o=KC(e,t,n);return Uo(o,t,n)}}function qC(e,t,n){return k(e,t,n)?z(n):Vt(e,t)}function zC(e,t,n){return k(e,t,n)?n:Vt(e,t)}function WC(e,t,n){if(k(e,t,n))return z(n);let o=L(n)?z(n):Vt(e,t),i=ce(e.minItems)&&o.length<e.minItems?[...o,...Array.from({length:e.minItems-o.length},()=>null)]:o,s=(ce(e.maxItems)&&i.length>e.maxItems?i.slice(0,e.maxItems):i).map(l=>rr(e.items,t,l));if(e.uniqueItems!==!0)return s;let c=[...new Set(s)];if(!k(e,t,c))throw new oa(e,"Array cast produced invalid data due to uniqueItems constraint");return c}function HC(e,t,n){if(k(e,t,n))return Vt(e,t);let o=new Set(e.returns.required||[]),i=function(){};for(let[a,s]of Object.entries(e.returns.properties))!o.has(a)&&n.prototype[a]===void 0||(i.prototype[a]=rr(s,t,n.prototype[a]));return i}function JC(e,t,n){let o=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return rr(i,[...t,...o],n)}function Lf(e,t){return E(e)&&!E(t)||!E(e)&&E(t)?e:!E(e)||!E(t)?t:globalThis.Object.getOwnPropertyNames(e).reduce((n,o)=>{let i=o in t?Lf(e[o],t[o]):e[o];return{...n,[o]:i}},{})}function YC(e,t,n){if(k(e,t,n))return n;let o=Vt(e,t),i=Lf(o,n);return k(e,t,i)?i:o}function XC(e,t,n){throw new oa(e,"Never types cannot be cast")}function ZC(e,t,n){if(k(e,t,n))return n;if(n===null||typeof n!="object")return Vt(e,t);let o=new Set(e.required||[]),i={};for(let[a,s]of Object.entries(e.properties))!o.has(a)&&n[a]===void 0||(i[a]=rr(s,t,n[a]));if(typeof e.additionalProperties=="object"){let a=Object.getOwnPropertyNames(e.properties);for(let s of Object.getOwnPropertyNames(n))a.includes(s)||(i[s]=rr(e.additionalProperties,t,n[s]))}return i}function QC(e,t,n){if(k(e,t,n))return z(n);if(n===null||typeof n!="object"||Array.isArray(n)||n instanceof Date)return Vt(e,t);let o=Object.getOwnPropertyNames(e.patternProperties)[0],i=e.patternProperties[o],a={};for(let[s,c]of Object.entries(n))a[s]=rr(i,t,c);return a}function eP(e,t,n){return rr(J(e,t),t,n)}function tP(e,t,n){return rr(J(e,t),t,n)}function rP(e,t,n){return k(e,t,n)?z(n):L(n)?e.items===void 0?[]:e.items.map((o,i)=>rr(o,t,n[i])):Vt(e,t)}function nP(e,t,n){return k(e,t,n)?z(n):GC(e,t,n)}function rr(e,t,n){let o=Z(e.$id)?Fe(e,t):t,i=e;switch(e[g]){case"Array":return WC(i,o,n);case"Constructor":return HC(i,o,n);case"Import":return JC(i,o,n);case"Intersect":return YC(i,o,n);case"Never":return XC(i,o,n);case"Object":return ZC(i,o,n);case"Record":return QC(i,o,n);case"Ref":return eP(i,o,n);case"This":return tP(i,o,n);case"Tuple":return rP(i,o,n);case"Union":return nP(i,o,n);case"Date":case"Symbol":case"Uint8Array":return qC(e,t,n);default:return zC(i,o,n)}}function Uo(...e){return e.length===3?rr(e[0],e[1],e[2]):rr(e[0],[],e[1])}function oP(e){return Ar(e)&&e[g]!=="Unsafe"}function iP(e,t,n){return L(n)?n.map(o=>pt(e.items,t,o)):n}function aP(e,t,n){let o=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return pt(i,[...t,...o],n)}function sP(e,t,n){let o=e.unevaluatedProperties,a=e.allOf.map(c=>pt(c,t,z(n))).reduce((c,l)=>E(l)?{...c,...l}:l,{});if(!E(n)||!E(a)||!Ar(o))return a;let s=Ze(e);for(let c of Object.getOwnPropertyNames(n))s.includes(c)||k(o,t,n[c])&&(a[c]=pt(o,t,n[c]));return a}function cP(e,t,n){if(!E(n)||L(n))return n;let o=e.additionalProperties;for(let i of Object.getOwnPropertyNames(n)){if(T(e.properties,i)){n[i]=pt(e.properties[i],t,n[i]);continue}if(Ar(o)&&k(o,t,n[i])){n[i]=pt(o,t,n[i]);continue}delete n[i]}return n}function lP(e,t,n){if(!E(n))return n;let o=e.additionalProperties,i=Object.getOwnPropertyNames(n),[a,s]=Object.entries(e.patternProperties)[0],c=new RegExp(a);for(let l of i){if(c.test(l)){n[l]=pt(s,t,n[l]);continue}if(Ar(o)&&k(o,t,n[l])){n[l]=pt(o,t,n[l]);continue}delete n[l]}return n}function pP(e,t,n){return pt(J(e,t),t,n)}function mP(e,t,n){return pt(J(e,t),t,n)}function uP(e,t,n){if(!L(n))return n;if(se(e.items))return[];let o=Math.min(n.length,e.items.length);for(let i=0;i<o;i++)n[i]=pt(e.items[i],t,n[i]);return n.length>o?n.slice(0,o):n}function dP(e,t,n){for(let o of e.anyOf)if(oP(o)&&k(o,t,n))return pt(o,t,n);return n}function pt(e,t,n){let o=Z(e.$id)?Fe(e,t):t,i=e;switch(i[g]){case"Array":return iP(i,o,n);case"Import":return aP(i,o,n);case"Intersect":return sP(i,o,n);case"Object":return cP(i,o,n);case"Record":return lP(i,o,n);case"Ref":return pP(i,o,n);case"This":return mP(i,o,n);case"Tuple":return uP(i,o,n);case"Union":return dP(i,o,n);default:return n}}function ia(...e){return e.length===3?pt(e[0],e[1],e[2]):pt(e[0],[],e[1])}function Es(e){return Z(e)&&!isNaN(e)&&!isNaN(parseFloat(e))}function fP(e){return At(e)||Ht(e)||ce(e)}function aa(e){return e===!0||ce(e)&&e===1||At(e)&&e===BigInt("1")||Z(e)&&(e.toLowerCase()==="true"||e==="1")}function sa(e){return e===!1||ce(e)&&(e===0||Object.is(e,-0))||At(e)&&e===BigInt("0")||Z(e)&&(e.toLowerCase()==="false"||e==="0"||e==="-0")}function hP(e){return Z(e)&&/^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i.test(e)}function gP(e){return Z(e)&&/^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)?$/i.test(e)}function yP(e){return Z(e)&&/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\dt(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i.test(e)}function bP(e){return Z(e)&&/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\dt(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)?$/i.test(e)}function OP(e){return Z(e)&&/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/i.test(e)}function xP(e,t){let n=Ef(e);return n===t?n:e}function SP(e,t){let n=Nf(e);return n===t?n:e}function IP(e,t){let n=vf(e);return n===t?n:e}function wP(e,t){return Z(e.const)?xP(t,e.const):ce(e.const)?SP(t,e.const):Ht(e.const)?IP(t,e.const):t}function vf(e){return aa(e)?!0:sa(e)?!1:e}function CP(e){let t=n=>n.split(".")[0];return Es(e)?BigInt(t(e)):ce(e)?BigInt(Math.trunc(e)):sa(e)?BigInt(0):aa(e)?BigInt(1):e}function Ef(e){return fr(e)&&e.description!==void 0?e.description.toString():fP(e)?e.toString():e}function Nf(e){return Es(e)?parseFloat(e):aa(e)?1:sa(e)?0:e}function PP(e){return Es(e)?parseInt(e):ce(e)?Math.trunc(e):aa(e)?1:sa(e)?0:e}function $P(e){return Z(e)&&e.toLowerCase()==="null"?null:e}function TP(e){return Z(e)&&e==="undefined"?void 0:e}function AP(e){return Ke(e)?e:ce(e)?new Date(e):aa(e)?new Date(1):sa(e)?new Date(0):Es(e)?new Date(parseInt(e)):gP(e)?new Date(`1970-01-01T${e}.000Z`):hP(e)?new Date(`1970-01-01T${e}`):bP(e)?new Date(`${e}.000Z`):yP(e)?new Date(e):OP(e)?new Date(`${e}T00:00:00.000Z`):e}function LP(e,t,n){return(L(n)?n:[n]).map(i=>nr(e.items,t,i))}function vP(e,t,n){return CP(n)}function EP(e,t,n){return vf(n)}function NP(e,t,n){return AP(n)}function kP(e,t,n){let o=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return nr(i,[...t,...o],n)}function RP(e,t,n){return PP(n)}function jP(e,t,n){return e.allOf.reduce((o,i)=>nr(i,t,o),n)}function FP(e,t,n){return wP(e,n)}function UP(e,t,n){return $P(n)}function DP(e,t,n){return Nf(n)}function MP(e,t,n){if(!E(n))return n;for(let o of Object.getOwnPropertyNames(e.properties))T(n,o)&&(n[o]=nr(e.properties[o],t,n[o]));return n}function BP(e,t,n){if(!E(n))return n;let i=Object.getOwnPropertyNames(e.patternProperties)[0],a=e.patternProperties[i];for(let[s,c]of Object.entries(n))n[s]=nr(a,t,c);return n}function _P(e,t,n){return nr(J(e,t),t,n)}function VP(e,t,n){return Ef(n)}function KP(e,t,n){return Z(n)||ce(n)?Symbol(n):n}function GP(e,t,n){return nr(J(e,t),t,n)}function qP(e,t,n){return L(n)&&!se(e.items)?n.map((i,a)=>a<e.items.length?nr(e.items[a],t,i):i):n}function zP(e,t,n){return TP(n)}function WP(e,t,n){for(let o of e.anyOf)if(k(o,t,n))return n;for(let o of e.anyOf){let i=nr(o,t,z(n));if(k(o,t,i))return i}return n}function nr(e,t,n){let o=Fe(e,t),i=e;switch(e[g]){case"Array":return LP(i,o,n);case"BigInt":return vP(i,o,n);case"Boolean":return EP(i,o,n);case"Date":return NP(i,o,n);case"Import":return kP(i,o,n);case"Integer":return RP(i,o,n);case"Intersect":return jP(i,o,n);case"Literal":return FP(i,o,n);case"Null":return UP(i,o,n);case"Number":return DP(i,o,n);case"Object":return MP(i,o,n);case"Record":return BP(i,o,n);case"Ref":return _P(i,o,n);case"String":return VP(i,o,n);case"Symbol":return KP(i,o,n);case"This":return GP(i,o,n);case"Tuple":return qP(i,o,n);case"Undefined":return zP(i,o,n);case"Union":return WP(i,o,n);default:return n}}function ca(...e){return e.length===3?nr(e[0],e[1],e[2]):nr(e[0],[],e[1])}var la=class extends v{constructor(t,n,o){super("Unable to decode value as it does not match the expected schema"),this.schema=t,this.value=n,this.error=o}},Ns=class extends v{constructor(t,n,o,i){super(i instanceof Error?i.message:"Unknown error"),this.schema=t,this.path=n,this.value=o,this.error=i}};function fe(e,t,n){try{return W(e)?e[me].Decode(n):n}catch(o){throw new Ns(e,t,n,o)}}function HP(e,t,n,o){return L(o)?fe(e,n,o.map((i,a)=>or(e.items,t,`${n}/${a}`,i))):fe(e,n,o)}function JP(e,t,n,o){if(!E(o)||nt(o))return fe(e,n,o);let i=Ni(e),a=i.map(m=>m[0]),s={...o};for(let[m,u]of i)m in s&&(s[m]=or(u,t,`${n}/${m}`,s[m]));if(!W(e.unevaluatedProperties))return fe(e,n,s);let c=Object.getOwnPropertyNames(s),l=e.unevaluatedProperties,p={...s};for(let m of c)a.includes(m)||(p[m]=fe(l,`${n}/${m}`,p[m]));return fe(e,n,p)}function YP(e,t,n,o){let i=globalThis.Object.values(e.$defs),a=e.$defs[e.$ref],s=or(a,[...t,...i],n,o);return fe(e,n,s)}function XP(e,t,n,o){return fe(e,n,or(e.not,t,n,o))}function ZP(e,t,n,o){if(!E(o))return fe(e,n,o);let i=Ze(e),a={...o};for(let p of i)T(a,p)&&(se(a[p])&&(!yr(e.properties[p])||Ce.IsExactOptionalProperty(a,p))||(a[p]=or(e.properties[p],t,`${n}/${p}`,a[p])));if(!ue(e.additionalProperties))return fe(e,n,a);let s=Object.getOwnPropertyNames(a),c=e.additionalProperties,l={...a};for(let p of s)i.includes(p)||(l[p]=fe(c,`${n}/${p}`,l[p]));return fe(e,n,l)}function QP(e,t,n,o){if(!E(o))return fe(e,n,o);let i=Object.getOwnPropertyNames(e.patternProperties)[0],a=new RegExp(i),s={...o};for(let m of Object.getOwnPropertyNames(o))a.test(m)&&(s[m]=or(e.patternProperties[i],t,`${n}/${m}`,s[m]));if(!ue(e.additionalProperties))return fe(e,n,s);let c=Object.getOwnPropertyNames(s),l=e.additionalProperties,p={...s};for(let m of c)a.test(m)||(p[m]=fe(l,`${n}/${m}`,p[m]));return fe(e,n,p)}function e$(e,t,n,o){let i=J(e,t);return fe(e,n,or(i,t,n,o))}function t$(e,t,n,o){let i=J(e,t);return fe(e,n,or(i,t,n,o))}function r$(e,t,n,o){return L(o)&&L(e.items)?fe(e,n,e.items.map((i,a)=>or(i,t,`${n}/${a}`,o[a]))):fe(e,n,o)}function n$(e,t,n,o){for(let i of e.anyOf){if(!k(i,t,o))continue;let a=or(i,t,n,o);return fe(e,n,a)}return fe(e,n,o)}function or(e,t,n,o){let i=Fe(e,t),a=e;switch(e[g]){case"Array":return HP(a,i,n,o);case"Import":return YP(a,i,n,o);case"Intersect":return JP(a,i,n,o);case"Not":return XP(a,i,n,o);case"Object":return ZP(a,i,n,o);case"Record":return QP(a,i,n,o);case"Ref":return e$(a,i,n,o);case"Symbol":return fe(a,n,o);case"This":return t$(a,i,n,o);case"Tuple":return r$(a,i,n,o);case"Union":return n$(a,i,n,o);default:return fe(a,n,o)}}function pa(e,t,n){return or(e,t,"",n)}var ma=class extends v{constructor(t,n,o){super("The encoded value does not match the expected schema"),this.schema=t,this.value=n,this.error=o}},ks=class extends v{constructor(t,n,o,i){super(`${i instanceof Error?i.message:"Unknown error"}`),this.schema=t,this.path=n,this.value=o,this.error=i}};function Ve(e,t,n){try{return W(e)?e[me].Encode(n):n}catch(o){throw new ks(e,t,n,o)}}function o$(e,t,n,o){let i=Ve(e,n,o);return L(i)?i.map((a,s)=>ir(e.items,t,`${n}/${s}`,a)):i}function i$(e,t,n,o){let i=globalThis.Object.values(e.$defs),a=e.$defs[e.$ref],s=Ve(e,n,o);return ir(a,[...t,...i],n,s)}function a$(e,t,n,o){let i=Ve(e,n,o);if(!E(o)||nt(o))return i;let a=Ni(e),s=a.map(u=>u[0]),c={...i};for(let[u,f]of a)u in c&&(c[u]=ir(f,t,`${n}/${u}`,c[u]));if(!W(e.unevaluatedProperties))return c;let l=Object.getOwnPropertyNames(c),p=e.unevaluatedProperties,m={...c};for(let u of l)s.includes(u)||(m[u]=Ve(p,`${n}/${u}`,m[u]));return m}function s$(e,t,n,o){return Ve(e.not,n,Ve(e,n,o))}function c$(e,t,n,o){let i=Ve(e,n,o);if(!E(i))return i;let a=Ze(e),s={...i};for(let m of a)T(s,m)&&(se(s[m])&&(!yr(e.properties[m])||Ce.IsExactOptionalProperty(s,m))||(s[m]=ir(e.properties[m],t,`${n}/${m}`,s[m])));if(!ue(e.additionalProperties))return s;let c=Object.getOwnPropertyNames(s),l=e.additionalProperties,p={...s};for(let m of c)a.includes(m)||(p[m]=Ve(l,`${n}/${m}`,p[m]));return p}function l$(e,t,n,o){let i=Ve(e,n,o);if(!E(o))return i;let a=Object.getOwnPropertyNames(e.patternProperties)[0],s=new RegExp(a),c={...i};for(let u of Object.getOwnPropertyNames(o))s.test(u)&&(c[u]=ir(e.patternProperties[a],t,`${n}/${u}`,c[u]));if(!ue(e.additionalProperties))return c;let l=Object.getOwnPropertyNames(c),p=e.additionalProperties,m={...c};for(let u of l)s.test(u)||(m[u]=Ve(p,`${n}/${u}`,m[u]));return m}function p$(e,t,n,o){let i=J(e,t),a=ir(i,t,n,o);return Ve(e,n,a)}function m$(e,t,n,o){let i=J(e,t),a=ir(i,t,n,o);return Ve(e,n,a)}function u$(e,t,n,o){let i=Ve(e,n,o);return L(e.items)?e.items.map((a,s)=>ir(a,t,`${n}/${s}`,i[s])):[]}function d$(e,t,n,o){for(let i of e.anyOf){if(!k(i,t,o))continue;let a=ir(i,t,n,o);return Ve(e,n,a)}for(let i of e.anyOf){let a=ir(i,t,n,o);if(k(e,t,a))return Ve(e,n,a)}return Ve(e,n,o)}function ir(e,t,n,o){let i=Fe(e,t),a=e;switch(e[g]){case"Array":return o$(a,i,n,o);case"Import":return i$(a,i,n,o);case"Intersect":return a$(a,i,n,o);case"Not":return s$(a,i,n,o);case"Object":return c$(a,i,n,o);case"Record":return l$(a,i,n,o);case"Ref":return p$(a,i,n,o);case"This":return m$(a,i,n,o);case"Tuple":return u$(a,i,n,o);case"Union":return d$(a,i,n,o);default:return Ve(a,n,o)}}function ua(e,t,n){return ir(e,t,"",n)}function f$(e,t){return W(e)||Ne(e.items,t)}function h$(e,t){return W(e)||Ne(e.items,t)}function g$(e,t){return W(e)||Ne(e.returns,t)||e.parameters.some(n=>Ne(n,t))}function y$(e,t){return W(e)||Ne(e.returns,t)||e.parameters.some(n=>Ne(n,t))}function b$(e,t){return W(e)||W(e.unevaluatedProperties)||e.allOf.some(n=>Ne(n,t))}function O$(e,t){let n=globalThis.Object.getOwnPropertyNames(e.$defs).reduce((i,a)=>[...i,e.$defs[a]],[]),o=e.$defs[e.$ref];return W(e)||Ne(o,[...n,...t])}function x$(e,t){return W(e)||Ne(e.items,t)}function S$(e,t){return W(e)||Ne(e.not,t)}function I$(e,t){return W(e)||Object.values(e.properties).some(n=>Ne(n,t))||ue(e.additionalProperties)&&Ne(e.additionalProperties,t)}function w$(e,t){return W(e)||Ne(e.item,t)}function C$(e,t){let n=Object.getOwnPropertyNames(e.patternProperties)[0],o=e.patternProperties[n];return W(e)||Ne(o,t)||ue(e.additionalProperties)&&W(e.additionalProperties)}function P$(e,t){return W(e)?!0:Ne(J(e,t),t)}function $$(e,t){return W(e)?!0:Ne(J(e,t),t)}function T$(e,t){return W(e)||!se(e.items)&&e.items.some(n=>Ne(n,t))}function A$(e,t){return W(e)||e.anyOf.some(n=>Ne(n,t))}function Ne(e,t){let n=Fe(e,t),o=e;if(e.$id&&sp.has(e.$id))return!1;switch(e.$id&&sp.add(e.$id),e[g]){case"Array":return f$(o,n);case"AsyncIterator":return h$(o,n);case"Constructor":return g$(o,n);case"Function":return y$(o,n);case"Import":return O$(o,n);case"Intersect":return b$(o,n);case"Iterator":return x$(o,n);case"Not":return S$(o,n);case"Object":return I$(o,n);case"Promise":return w$(o,n);case"Record":return C$(o,n);case"Ref":return P$(o,n);case"This":return $$(o,n);case"Tuple":return T$(o,n);case"Union":return A$(o,n);default:return W(e)}}var sp=new Set;function wn(e,t){return sp.clear(),Ne(e,t)}function cp(...e){let[t,n,o]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]];if(!k(t,n,o))throw new la(t,o,In(t,n,o).First());return wn(t,n)?pa(t,n,o):o}function zr(e,t){let n=T(e,"default")?e.default:void 0,o=dr(n)?n():z(n);return se(t)?o:E(t)&&E(o)?Object.assign(o,t):t}function lp(e){return Ar(e)&&"default"in e}function L$(e,t,n){if(L(n)){for(let i=0;i<n.length;i++)n[i]=Qe(e.items,t,n[i]);return n}let o=zr(e,n);if(!L(o))return o;for(let i=0;i<o.length;i++)o[i]=Qe(e.items,t,o[i]);return o}function v$(e,t,n){return Ke(n)?n:zr(e,n)}function E$(e,t,n){let o=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return Qe(i,[...t,...o],n)}function N$(e,t,n){let o=zr(e,n);return e.allOf.reduce((i,a)=>{let s=Qe(a,t,o);return E(s)?{...i,...s}:s},{})}function k$(e,t,n){let o=zr(e,n);if(!E(o))return o;let i=Object.getOwnPropertyNames(e.properties);for(let a of i){let s=Qe(e.properties[a],t,o[a]);se(s)||(o[a]=Qe(e.properties[a],t,o[a]))}if(!lp(e.additionalProperties))return o;for(let a of Object.getOwnPropertyNames(o))i.includes(a)||(o[a]=Qe(e.additionalProperties,t,o[a]));return o}function R$(e,t,n){let o=zr(e,n);if(!E(o))return o;let i=e.additionalProperties,[a,s]=Object.entries(e.patternProperties)[0],c=new RegExp(a);for(let l of Object.getOwnPropertyNames(o))c.test(l)&&lp(s)&&(o[l]=Qe(s,t,o[l]));if(!lp(i))return o;for(let l of Object.getOwnPropertyNames(o))c.test(l)||(o[l]=Qe(i,t,o[l]));return o}function j$(e,t,n){return Qe(J(e,t),t,zr(e,n))}function F$(e,t,n){return Qe(J(e,t),t,n)}function U$(e,t,n){let o=zr(e,n);if(!L(o)||se(e.items))return o;let[i,a]=[e.items,Math.max(e.items.length,o.length)];for(let s=0;s<a;s++)s<i.length&&(o[s]=Qe(i[s],t,o[s]));return o}function D$(e,t,n){let o=zr(e,n);for(let i of e.anyOf){let a=Qe(i,t,z(o));if(k(i,t,a))return a}return o}function Qe(e,t,n){let o=Fe(e,t),i=e;switch(i[g]){case"Array":return L$(i,o,n);case"Date":return v$(i,o,n);case"Import":return E$(i,o,n);case"Intersect":return N$(i,o,n);case"Object":return k$(i,o,n);case"Record":return R$(i,o,n);case"Ref":return j$(i,o,n);case"This":return F$(i,o,n);case"Tuple":return U$(i,o,n);case"Union":return D$(i,o,n);default:return zr(i,n)}}function da(...e){return e.length===3?Qe(e[0],e[1],e[2]):Qe(e[0],[],e[1])}var Kt={};tt(Kt,{Delete:()=>B$,Format:()=>fa,Get:()=>V$,Has:()=>_$,Set:()=>M$,ValuePointerRootDeleteError:()=>js,ValuePointerRootSetError:()=>Rs});var Rs=class extends v{constructor(t,n,o){super("Cannot set root value"),this.value=t,this.path=n,this.update=o}},js=class extends v{constructor(t,n){super("Cannot delete root value"),this.value=t,this.path=n}};function kf(e){return e.indexOf("~")===-1?e:e.replace(/~1/g,"/").replace(/~0/g,"~")}function*fa(e){if(e==="")return;let[t,n]=[0,0];for(let o=0;o<e.length;o++)e.charAt(o)==="/"?(o===0||(n=o,yield kf(e.slice(t,n))),t=o+1):n=o;yield kf(e.slice(t))}function M$(e,t,n){if(t==="")throw new Rs(e,t,n);let[o,i,a]=[null,e,""];for(let s of fa(t))i[s]===void 0&&(i[s]={}),o=i,i=i[s],a=s;o[a]=n}function B$(e,t){if(t==="")throw new js(e,t);let[n,o,i]=[null,e,""];for(let a of fa(t)){if(o[a]===void 0||o[a]===null)return;n=o,o=o[a],i=a}if(Array.isArray(n)){let a=parseInt(i);n.splice(a,1)}else delete n[i]}function _$(e,t){if(t==="")return!0;let[n,o,i]=[null,e,""];for(let a of fa(t)){if(o[a]===void 0)return!1;n=o,o=o[a],i=a}return Object.getOwnPropertyNames(n).includes(i)}function V$(e,t){if(t==="")return e;let n=e;for(let o of fa(t)){if(n[o]===void 0)return;n=n[o]}return n}function K$(e,t){if(!E(t))return!1;let n=[...Object.keys(e),...Object.getOwnPropertySymbols(e)],o=[...Object.keys(t),...Object.getOwnPropertySymbols(t)];return n.length!==o.length?!1:n.every(i=>Cn(e[i],t[i]))}function G$(e,t){return Ke(t)&&e.getTime()===t.getTime()}function q$(e,t){return!L(t)||e.length!==t.length?!1:e.every((n,o)=>Cn(n,t[o]))}function z$(e,t){return!ht(t)||e.length!==t.length||Object.getPrototypeOf(e).constructor.name!==Object.getPrototypeOf(t).constructor.name?!1:e.every((n,o)=>Cn(n,t[o]))}function W$(e,t){return e===t}function Cn(e,t){if(Ke(e))return G$(e,t);if(ht(e))return z$(e,t);if(L(e))return q$(e,t);if(E(e))return K$(e,t);if(nt(e))return W$(e,t);throw new Error("ValueEquals: Unable to compare value")}var jf=K({type:F("insert"),path:je(),value:st()}),Ff=K({type:F("update"),path:je(),value:st()}),Uf=K({type:F("delete"),path:je()}),pp=V([jf,Ff,Uf]),ha=class extends v{constructor(t,n){super(n),this.value=t}};function Fs(e,t){return{type:"update",path:e,value:t}}function Df(e,t){return{type:"insert",path:e,value:t}}function Mf(e){return{type:"delete",path:e}}function Rf(e){if(globalThis.Object.getOwnPropertySymbols(e).length>0)throw new ha(e,"Cannot diff objects with symbols")}function*H$(e,t,n){if(Rf(t),Rf(n),!ss(n))return yield Fs(e,n);let o=globalThis.Object.getOwnPropertyNames(t),i=globalThis.Object.getOwnPropertyNames(n);for(let a of i)T(t,a)||(yield Df(`${e}/${a}`,n[a]));for(let a of o)T(n,a)&&(Cn(t,n)||(yield*Us(`${e}/${a}`,t[a],n[a])));for(let a of o)T(n,a)||(yield Mf(`${e}/${a}`))}function*J$(e,t,n){if(!L(n))return yield Fs(e,n);for(let o=0;o<Math.min(t.length,n.length);o++)yield*Us(`${e}/${o}`,t[o],n[o]);for(let o=0;o<n.length;o++)o<t.length||(yield Df(`${e}/${o}`,n[o]));for(let o=t.length-1;o>=0;o--)o<n.length||(yield Mf(`${e}/${o}`))}function*Y$(e,t,n){if(!ht(n)||t.length!==n.length||globalThis.Object.getPrototypeOf(t).constructor.name!==globalThis.Object.getPrototypeOf(n).constructor.name)return yield Fs(e,n);for(let o=0;o<Math.min(t.length,n.length);o++)yield*Us(`${e}/${o}`,t[o],n[o])}function*X$(e,t,n){t!==n&&(yield Fs(e,n))}function*Us(e,t,n){if(ss(t))return yield*H$(e,t,n);if(L(t))return yield*J$(e,t,n);if(ht(t))return yield*Y$(e,t,n);if(nt(t))return yield*X$(e,t,n);throw new ha(t,"Unable to diff value")}function mp(e,t){return[...Us("",e,t)]}function Z$(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}function Q$(e){return e.length===0}function up(e,t){if(Z$(t))return z(t[0].value);if(Q$(t))return z(e);let n=z(e);for(let o of t)switch(o.type){case"insert":{Kt.Set(n,o.path,o.value);break}case"update":{Kt.Set(n,o.path,o.value);break}case"delete":{Kt.Delete(n,o.path);break}}return n}function dp(...e){let[t,n,o]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]],i=wn(t,n)?ua(t,n,o):o;if(!k(t,n,i))throw new ma(t,i,In(t,n,i).First());return i}function Ds(e){return E(e)&&!L(e)}var ga=class extends v{constructor(t){super(t)}};function eT(e,t,n,o){if(!Ds(n))Kt.Set(e,t,z(o));else{let i=Object.getOwnPropertyNames(n),a=Object.getOwnPropertyNames(o);for(let s of i)a.includes(s)||delete n[s];for(let s of a)i.includes(s)||(n[s]=null);for(let s of a)fp(e,`${t}/${s}`,n[s],o[s])}}function tT(e,t,n,o){if(!L(n))Kt.Set(e,t,z(o));else{for(let i=0;i<o.length;i++)fp(e,`${t}/${i}`,n[i],o[i]);n.splice(o.length)}}function rT(e,t,n,o){if(ht(n)&&n.length===o.length)for(let i=0;i<n.length;i++)n[i]=o[i];else Kt.Set(e,t,z(o))}function nT(e,t,n,o){n!==o&&Kt.Set(e,t,o)}function fp(e,t,n,o){if(L(o))return tT(e,t,n,o);if(ht(o))return rT(e,t,n,o);if(Ds(o))return eT(e,t,n,o);if(nt(o))return nT(e,t,n,o)}function Bf(e){return ht(e)||nt(e)}function oT(e,t){return Ds(e)&&L(t)||L(e)&&Ds(t)}function hp(e,t){if(Bf(e)||Bf(t))throw new ga("Only object and array types can be mutated at the root level");if(oT(e,t))throw new ga("Cannot assign due type mismatch of assignable values");fp(e,"",e,t)}var ya=class extends v{constructor(t){super(t)}},Ms;(function(e){let t=new Map([["Assert",(a,s,c)=>(na(a,s,c),c)],["Cast",(a,s,c)=>Uo(a,s,c)],["Clean",(a,s,c)=>ia(a,s,c)],["Clone",(a,s,c)=>z(c)],["Convert",(a,s,c)=>ca(a,s,c)],["Decode",(a,s,c)=>wn(a,s)?pa(a,s,c):c],["Default",(a,s,c)=>da(a,s,c)],["Encode",(a,s,c)=>wn(a,s)?ua(a,s,c):c]]);function n(a){t.delete(a)}e.Delete=n;function o(a,s){t.set(a,s)}e.Set=o;function i(a){return t.get(a)}e.Get=i})(Ms||(Ms={}));var gp=["Clone","Clean","Default","Convert","Assert","Decode"];function iT(e,t,n,o){return e.reduce((i,a)=>{let s=Ms.Get(a);if(se(s))throw new ya(`Unable to find Parse operation \'${a}\'`);return s(t,n,i)},o)}function yp(...e){let[t,n,o,i]=e.length===4?[e[0],e[1],e[2],e[3]]:e.length===3?L(e[0])?[e[0],e[1],[],e[2]]:[gp,e[0],e[1],e[2]]:e.length===2?[gp,e[0],[],e[1]]:(()=>{throw new ya("Invalid Arguments")})();return iT(t,n,o,i)}var $={};tt($,{Assert:()=>na,Cast:()=>Uo,Check:()=>k,Clean:()=>ia,Clone:()=>z,Convert:()=>ca,Create:()=>Vt,Decode:()=>cp,Default:()=>da,Diff:()=>mp,Edit:()=>pp,Encode:()=>dp,Equal:()=>Cn,Errors:()=>In,Hash:()=>lo,Mutate:()=>hp,Parse:()=>yp,Patch:()=>up,ValueErrorIterator:()=>br});var tm={};tt(tm,{BLOCK_SLOT_PLACEMENT_PROPS:()=>Yp,BLOCK_SLOT_ROLES:()=>Eh,BlockDefinitionsSchema:()=>Yr,BlockEvaluationError:()=>Ta,BlockInvocationPropsSchema:()=>jn,BlockSlotSchema:()=>Nh,CANVASES:()=>nh,ChromeSchema:()=>Fp,ComponentValidationError:()=>go,DEFAULT_CHART_THEME_COLORS:()=>wA,DEFAULT_ERROR_CONFIG:()=>Pn,DEFAULT_VISUAL_DPI:()=>Aa,DesignSpacingSchema:()=>jp,DesignSystemProperties:()=>Nn,DesignSystemSchema:()=>oh,DuplicateComponentError:()=>_o,ERROR_EMOJIS:()=>mo,FONT_URL_ALLOWLIST:()=>Ip,FeatureRequirementCollector:()=>Zf,FontFamilyNameSchema:()=>zt,FontRegistry:()=>hA,FontRegistryEntrySchema:()=>vp,FontRegistrySchema:()=>Ir,FontSourceSchema:()=>Lp,JsonBlockDefinitionSchema:()=>kh,JsonBlockEvaluator:()=>kA,MAX_RASTERIZE_BATCH_SLIDES:()=>WT,MAX_RASTERIZE_FONTS:()=>qT,MAX_RASTERIZE_FONT_BYTES:()=>zT,MAX_VISUAL_DPI:()=>va,MIN_VISUAL_DPI:()=>La,MotifSchema:()=>Up,POINTS_PER_PIXEL_96DPI:()=>Ah,POPULAR_GOOGLE_FONTS:()=>Ch,PaletteSchema:()=>Np,RENDERER_DEPENDENCY_MISSING:()=>zs,ROLE_SCALE_STEPS:()=>Dp,RendererRegistry:()=>eh,SAFE_FONTS:()=>Zs,TYPE_ROLES:()=>Go,TextCaseSchema:()=>bo,TypeRoleNameSchema:()=>Ep,TypeRoleSchema:()=>It,TypeRolesSchema:()=>kp,TypographySchema:()=>Rp,UPSTREAM_OVERRIDES:()=>Ph,UnknownPreservedComponentError:()=>Ks,UnsupportedRendererFeatureError:()=>Cp,WEIGHT_LABELS:()=>Ih,applyDocumentBlocksToSchema:()=>VA,applyExportMode:()=>IA,applyFontSubstitution:()=>Hp,assertNever:()=>Wf,assertRendererSupports:()=>Qf,blockDependencies:()=>Mh,blockInvocationExample:()=>Vh,blockInvocationPropsSchema:()=>Dh,blockPointerKey:()=>Oe,blockReferencesFromDocument:()=>KA,blockSlotBudgets:()=>jA,blockSlotEditorSchema:()=>cc,blockSlotFacts:()=>jh,blockSlotJsonSchema:()=>sc,blockSlotMarkdown:()=>Fh,blockSlotRoles:()=>FA,blockSlotsEditorSchema:()=>Uh,blockSlotsJsonSchema:()=>Qp,blockValueAt:()=>Rn,blockWordCount:()=>Xp,buildDefaultSubstitutionMap:()=>Th,calculatePosition:()=>Do,capsFormatting:()=>ah,chartFamilyResolver:()=>TA,chartFontFaceCss:()=>vh,chartPointsPerPixel:()=>CA,clampVisualDpi:()=>GT,clearComponentNamesCache:()=>Oa,collectFontNamesFromDocx:()=>HT,collectFontNamesFromPptx:()=>JT,compareSemver:()=>fo,composeBlocksWithPlugins:()=>_A,convertToJsonSchema:()=>Hs,createBlockAuthoringSchema:()=>Ea,createComponent:()=>Bo,createComponentSchema:()=>Vo,createComponentSchemaObject:()=>Js,createErrorConfig:()=>Sr,createJsonParseError:()=>uo,createVersion:()=>Mo,cssFontFamily:()=>Lh,defaultSubstituteFor:()=>$h,designCanvas:()=>ih,designColors:()=>Mp,detectFontFormat:()=>Wr,diagnoseUnsupportedFeatures:()=>$p,documentBlockMetadata:()=>RA,documentFontRegistry:()=>XT,exportSchemaToFile:()=>Ko,extractStandardComponentNames:()=>po,fetchGoogleFontSources:()=>wh,fixSchemaReferences:()=>vn,formatErrorMessage:()=>Or,formatErrorSummary:()=>Jr,getLiteralValue:()=>St,getObjectSchemaPropertyNames:()=>xr,getSchemaMetadata:()=>xa,getUpstreamOverride:()=>OA,getValidationSummary:()=>qs,groupErrorsByPath:()=>Sa,isAllowedFontUrl:()=>_s,isBlockRecord:()=>Y,isLiteralSchema:()=>Hr,isObjectSchema:()=>Gt,isSafeFont:()=>yo,isUnionSchema:()=>ba,isValidSemver:()=>An,isValidationSuccess:()=>Gs,latestVersion:()=>mt,mergeFontRegistries:()=>ZT,mergeWithDefaults:()=>GA,parseSemver:()=>Tn,partitionDiagnostics:()=>Xf,readBlockDefinitions:()=>Xr,rendererError:()=>Pp,rendererWarning:()=>Yf,resolveBlockSlot:()=>pc,resolveComponentVersion:()=>ho,resolveDesignColor:()=>Bp,resolveTypeRoles:()=>sh,restructureNameDiscriminatedUnions:()=>Ia,rewriteFontFamilyName:()=>xp,synthesizeFamilyName:()=>tA,themeFontRegistry:()=>Sh,toAuthoredBlockPointer:()=>wr,transformValueError:()=>$n,transformValueErrors:()=>et,unionBranches:()=>Ws,validateBlockDefinitions:()=>mc,validateBlockInvocations:()=>Ho,validateCustomComponentProps:()=>Ln,validateDesignColors:()=>ch,validateFontReferences:()=>eA,withChartFontFaceCss:()=>vA,withChartTypography:()=>AA});var aT=new Set([1,4,6,16]),sT=2981146554;function _f(e){let t=0,n=e.length,o=n-n%4;for(let i=0;i<o;i+=4)t=t+e.readUInt32BE(i)>>>0;if(o<n){let i=0,a=n-o;a>=1&&(i|=e[o]<<24),a>=2&&(i|=e[o+1]<<16),a>=3&&(i|=e[o+2]<<8),t=t+i>>>0}return t>>>0}function cT(e,t){if(e.platformID===1)return Buffer.from(t,"ascii");let n=Buffer.alloc(t.length*2);for(let o=0;o<t.length;o+=1)n.writeUInt16BE(t.charCodeAt(o),o*2);return n}function lT(e){let t=e.length,n=6+t*12,o=0;for(let s of e)o+=s.bytes.length;let i=Buffer.alloc(n+o);i.writeUInt16BE(0,0),i.writeUInt16BE(t,2),i.writeUInt16BE(n,4);let a=0;for(let s=0;s<t;s+=1){let c=e[s],l=6+s*12;i.writeUInt16BE(c.platformID,l),i.writeUInt16BE(c.encodingID,l+2),i.writeUInt16BE(c.languageID,l+4),i.writeUInt16BE(c.nameID,l+6),i.writeUInt16BE(c.bytes.length,l+8),i.writeUInt16BE(a,l+10),c.bytes.copy(i,n+a),a+=c.bytes.length}return i}function pT(e,t){if(e.length<12)return e;let n=e.readUInt32BE(0);if(!(n===65536||n===1330926671||n===1953658213||n===1954115633))return e;let i=e.readUInt16BE(4);if(i===0||e.length<12+i*16)return e;let a=[];for(let I=0;I<i;I+=1){let R=12+I*16,G=e.toString("ascii",R,R+4),ze=e.readUInt32BE(R+4),Te=e.readUInt32BE(R+8),Ae=e.readUInt32BE(R+12);if(Te+Ae>e.length)return e;a.push({tag:G,checksum:ze,offset:0,originalOffset:Te,data:e.slice(Te,Te+Ae)})}let s=a.findIndex(I=>I.tag==="name");if(s===-1)return e;let c=a[s].data;if(c.length<6||c.readUInt16BE(0)!==0)return e;let l=c.readUInt16BE(2),p=c.readUInt16BE(4);if(c.length<6+l*12)return e;let m=[];for(let I=0;I<l;I+=1){let R=6+I*12,G=c.readUInt16BE(R),ze=c.readUInt16BE(R+2),Te=c.readUInt16BE(R+4),Ae=c.readUInt16BE(R+6),P=c.readUInt16BE(R+8),Q=c.readUInt16BE(R+10),Ie=c.slice(p+Q,p+Q+P);m.push({platformID:G,encodingID:ze,languageID:Te,nameID:Ae,bytes:Ie})}let u=[];for(let I of m){let R=t(I);R.action!=="drop"&&(R.action==="set"&&(I.bytes=cT(I,R.value)),u.push(I))}m.length=0,m.push(...u);let f=lT(m);a[s]={...a[s],data:f,checksum:_f(f)},a.sort((I,R)=>I.originalOffset-R.originalOffset);let x=12+a.length*16;for(let I of a)x=x+3&-4,I.offset=x,x+=I.data.length;let S=x+3&-4,C=Buffer.alloc(S);e.copy(C,0,0,12),C.writeUInt16BE(a.length,4);let O=[...a].sort((I,R)=>I.tag<R.tag?-1:I.tag>R.tag?1:0);for(let I=0;I<O.length;I+=1){let R=O[I],G=12+I*16;C.write(R.tag,G,4,"ascii"),C.writeUInt32BE(R.checksum,G+4),C.writeUInt32BE(R.offset,G+8),C.writeUInt32BE(R.data.length,G+12)}for(let I of a)I.data.copy(C,I.offset);let A=a.find(I=>I.tag==="head");if(A&&A.data.length>=12){C.writeUInt32BE(0,A.offset+8);let I=_f(C),R=sT-I>>>0;C.writeUInt32BE(R,A.offset+8)}return C}function mT(e,t){if(e.length<12)return null;let n=e.readUInt16BE(4);for(let o=0;o<n;o+=1){let i=12+o*16;if(i+16>e.length)return null;if(e.toString("ascii",i,i+4)===t)return{offset:e.readUInt32BE(i+8),length:e.readUInt32BE(i+12)}}return null}function Bs(e,t){let n=mT(e,"name");if(!n)return[];let o=n.offset;if(o+6>e.length)return[];let i=Math.min(o+n.length,e.length),a=e.readUInt16BE(o+2),s=o+e.readUInt16BE(o+4),c=Math.min(s,i),l=[];for(let p=0;p<a;p+=1){let m=o+6+p*12;if(m+12>c)break;let u=e.readUInt16BE(m),f=e.readUInt16BE(m+6);if(t&&!t.has(f))continue;let x=e.readUInt16BE(m+8),S=e.readUInt16BE(m+10),C=s+S;if(C+x>i)continue;let O=e.slice(C,C+x),A;if(u===1)A=O.toString("ascii");else{let I=Buffer.from(O);I.length%2===0&&I.swap16(),A=I.toString("utf16le")}l.push({platformID:u,nameID:f,value:A})}return l}function Op(e){let t=[];for(let n of Bs(e,uT)){let o=n.value.trim();o.length>0&&!t.includes(o)&&t.push(o)}return t}var uT=new Set([1,16]);function dT(e,t){return e?t?"Bold Italic":"Bold":t?"Italic":"Regular"}function xp(e,t,n){let o=n&&n!=="Regular"?n:"",i=o?`${t} ${o}`:t,a=/[[\\](){}<>/%]/g,s=/^[\\x00-\\x7f]*$/.test(i),c=p=>p.replace(/\\s+/g,"").replace(a,"").replace(/[^\\x21-\\x7e]/g,""),l=o?`${c(t)}-${c(o)}`:c(t);return pT(e,p=>aT.has(p.nameID)?p.platformID===1&&!s?{action:"drop"}:p.nameID===6?{action:"set",value:l}:p.nameID===4?{action:"set",value:i}:{action:"set",value:t}:{action:"keep"})}var fT={100:"Thin",200:"ExtraLight",300:"Light",400:"Regular",500:"Medium",600:"SemiBold",700:"Bold",800:"ExtraBold",900:"Black"};function Sp(e,t){let n=fT[e];return n?{typographic:t?`${n} Italic`:n,legacy:dT(e>=600,t)}:null}var Ip=["fonts.gstatic.com","fonts.googleapis.com","cdn.jsdelivr.net"];function _s(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol!=="https:"?!1:Ip.includes(t.hostname.toLowerCase())}function Wr(e){if(e.length<4)return"unknown";let t=e[0],n=e[1],o=e[2],i=e[3];return t===0&&n===1&&o===0&&i===0||t===116&&n===114&&o===117&&i===101||t===116&&n===121&&o===112&&i===49?"ttf":t===79&&n===84&&o===84&&i===79?"otf":t===119&&n===79&&o===70&&i===70?"woff":t===119&&n===79&&o===70&&i===50?"woff2":e.length>=36&&e[34]===76&&e[35]===80?"eot":t===128&&n===1||e.length>=14&&e.slice(0,14).toString("ascii")==="%!PS-AdobeFont"?"pfb":"unknown"}var Vs=new Map;function ba(e){return"anyOf"in e&&Array.isArray(e.anyOf)}function Gt(e){return e.type==="object"&&"properties"in e}function Hr(e){return"const"in e}function xr(e){return Gt(e)?Object.keys(e.properties):[]}function St(e){if(Hr(e))return e.const}function po(e){if(Vs.has(e))return Vs.get(e);let t=[];if("anyOf"in e&&Array.isArray(e.anyOf)){for(let n of e.anyOf)if(Gt(n)){let o=n.properties?.name;if(o&&Hr(o)){let i=St(o);typeof i=="string"&&t.push(i)}}}else if(Gt(e)){let n=e.properties?.name??e.properties?.type;if(n&&Hr(n)){let o=St(n);typeof o=="string"&&t.push(o)}}return Vs.set(e,t),t}function Oa(){Vs.clear()}function xa(e){let t={};return"type"in e&&(t.type=String(e.type)),Gt(e)&&(t.properties=xr(e)),Hr(e)&&(t.literal=St(e)),t}function Vf(){return typeof process>"u"||!process.env?!1:!!(process.env.CI||process.env.GITHUB_ACTIONS||process.env.GITLAB_CI)}function hT(){return typeof process>"u"||process.env?.NO_COLOR?!1:process.env?.FORCE_COLOR||process.stdout?.isTTY?!0:!Vf()}var Pn={includeEmojis:!Vf(),verbosity:"normal",includeSuggestions:!0,includePath:!0,maxMessageLength:0,includeDocLinks:!1,colorSupport:hT()};function Sr(e){return{...Pn,...e}}var mo={ERROR:"\\u274C",WARNING:"\\u26A0\\uFE0F",FIX:"\\u{1F527}",INFO:"\\u2139\\uFE0F",SUCCESS:"\\u2705"};function Or(e,t){return t.maxMessageLength>0&&e.length>t.maxMessageLength?e.substring(0,t.maxMessageLength)+"...":e}function gT(e,t){let n=String(e.type||""),o=e.path||"root";return n==="62"||n==="union"?yT(e):e.message?.includes("additionalProperties")?bT(e):e.message?.includes("Required property")?OT(e):n==="string"||n==="number"||n==="boolean"||n==="array"||n==="object"?xT(e):n==="literal"?ST(e):n==="pattern"||n==="RegExp"?IT(e):`At ${o}: ${e.message}`}function yT(e){let t=e.path||"root",n=e.value;if(t==="root"||t==="/"||t==="/jsonDefinition"){if(n&&typeof n=="object"){if("name"in n)return`Invalid component configuration for \'${n.name}\'. Check that all required fields are present.`;if("children"in n&&Array.isArray(n.children))return"Document is missing required \'name\' field."}return"Invalid document structure. Check required fields."}return t.includes("/children/")?n&&typeof n=="object"&&"name"in n?`Invalid component configuration for type \'${n.name}\'. Check that all required fields are present and correctly formatted.`:\'Invalid component structure. Each component must have a "name" field and valid configuration.\':`Value at ${t} doesn\'t match any of the expected formats. Check the structure and required fields.`}function bT(e){let t=e.path||"root",n=e.value;if(typeof n=="object"&&n!==null){let o=e.schema;if(o&&Gt(o)){let i=xr(o),s=Object.keys(n).filter(c=>!i.includes(c));if(s.length>0)return`Unknown properties at ${t}: ${s.join(", ")}. Allowed properties are: ${i.join(", ")}`}}return`Additional properties not allowed at ${t}. Check for typos or unsupported fields.`}function OT(e){let t=e.path||"root",n=e.message?.match(/Required property \'([^\']+)\'/);return n?`Missing required field \'${n[1]}\' at ${t}. This field is mandatory.`:`Missing required property at ${t}. Check that all mandatory fields are present.`}function xT(e){let t=e.path||"root",n=String(e.type),o=Array.isArray(e.value)?"array":typeof e.value;return t.includes("alignment")?`Invalid alignment value at ${t}. Expected one of: left, center, right, justify`:t.includes("color")?`Invalid color value at ${t}. Use hex format (#RRGGBB), rgb(r,g,b), or a named color`:t.includes("fontSize")||t.includes("size")?`Invalid size value at ${t}. Expected a number (in points)`:t.includes("margin")||t.includes("padding")||t.includes("spacing")?`Invalid spacing value at ${t}. Expected a number or spacing object with top/bottom/left/right`:`Type mismatch at ${t}: Expected ${n} but got ${o}`}function ST(e){let t=e.path||"root",n=e.schema?JSON.stringify(St(e.schema)):"specific value",o=JSON.stringify(e.value);return`Invalid value at ${t}: Expected exactly ${n} but got ${o}`}function IT(e){let t=e.path||"root";return t.includes("email")?`Invalid email format at ${t}. Use format: user@example.com`:t.includes("url")||t.includes("link")?`Invalid URL format at ${t}. Use format: https://example.com`:t.includes("date")?`Invalid date format at ${t}. Use ISO format: YYYY-MM-DD`:`Value at ${t} doesn\'t match the required pattern`}function $n(e,t,n){let o=Sr(n),i=gT(e,o),a={path:e.path||"root",message:Or(i||e.message,o),code:String(e.type||"validation_error"),value:e.value};if(o.includeSuggestions){let s=wT(e,o);s&&(a.suggestion=Or(s,o))}if(t&&e.path){let s=Do(t,e.path);s&&(a.line=s.line,a.column=s.column)}return a}function et(e,t){let n=t?.maxErrors??Number.MAX_SAFE_INTEGER,o=[],i=new Set;for(let a of e){if(o.length>=n)break;let s=`${a.path}:${a.type}`;i.has(s)||(i.add(s),o.push($n(a,t?.jsonString,void 0)))}return o}function Do(e,t){try{let n=t.split("/").filter(Boolean);if(n.length===0)return{line:1,column:1};let i=`"${n[n.length-1]}"`,a=e.indexOf(i);if(a===-1)return{line:1,column:1};let c=e.substring(0,a).split(`\n`),l=c.length,p=c[c.length-1].length+1;return{line:l,column:p}}catch{return null}}function wT(e,t){let{type:n,path:o}=e,i=String(n);if(i==="62"||i==="union")return o==="root"||o==="/"?\'Ensure the document has proper structure with a root "name" field\':o?.includes("/children/")?\'Check that the component has a valid "name" and all required fields\':"Review the structure and ensure all required fields are present with correct types";if(e.message?.includes("additionalProperties"))return"Remove any unknown or unsupported fields.";if(e.message?.includes("Required property"))return"Add the missing required field to fix this error";if(i==="string")return o?.includes("color")?"Use a valid color format (hex: #RRGGBB, rgb: rgb(r,g,b), or named color)":"Provide a text string value";if(i==="number")return"Provide a numeric value";if(i==="boolean")return"Use true or false (without quotes)";if(i==="array")return"Provide an array of values using square brackets []";if(i==="object")return"Provide an object with key-value pairs using curly braces {}";if(i==="literal")return`Use exactly this value: ${e.schema?JSON.stringify(St(e.schema)):"specific value"}`}function Jr(e){if(e.length===0)return"No errors";if(e.length===1)return e[0].message;let t=e.slice(0,3).map(n=>`${n.path}: ${n.message}`).join(", ");return e.length>3?`${t} and ${e.length-3} more...`:t}function Sa(e){let t=new Map;for(let n of e){let o=n.path||"root",i=t.get(o)||[];i.push(n),t.set(o,i)}return t}function uo(e,t){let n=e.message.match(/position (\\d+)/),o=n?parseInt(n[1],10):0,i=1,a=1;if(o>0){let s=t.substring(0,o).split(`\n`);i=s.length,a=s[s.length-1].length+1}return{path:"root",message:`JSON Parse Error: ${e.message}`,code:"json_parse_error",line:i,column:a,suggestion:"Check for missing commas, quotes, or brackets"}}var Kf=/^(\\d+)\\.(\\d+)\\.(\\d+)$/;function An(e){return Kf.test(e)}function Tn(e){let t=e.match(Kf);if(!t)throw new Error(`Invalid semver: "${e}". Expected format: major.minor.patch`);return{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3])}}function fo(e,t){let n=Tn(e),o=Tn(t);return n.major-o.major||n.minor-o.minor||n.patch-o.patch}function mt(e){if(e.length===0)throw new Error("Cannot determine latest version from empty array");return e.reduce((t,n)=>fo(n,t)>0?n:t)}function Mo(e){return e}function Bo(e){if(!e.name)throw new Error("Component name is required");if(!e.versions||typeof e.versions!="object")throw new Error(`Component "${e.name}" requires a versions map`);let t=Object.keys(e.versions);if(t.length===0)throw new Error(`Component "${e.name}" must have at least one version`);for(let n of t){if(!An(n))throw new Error(`Component "${e.name}": invalid semver key "${n}". Expected format: major.minor.patch`);let o=e.versions[n];if(!o.propsSchema)throw new Error(`Component "${e.name}" version "${n}" requires a propsSchema`);if(!o.render||typeof o.render!="function")throw new Error(`Component "${e.name}" version "${n}" requires a render function`)}return e}function ho(e,t,n){let o=Object.keys(t);if(n){let a=t[n];if(!a)throw new Error(`Component "${e}" does not have version "${n}". Available versions: ${o.join(", ")}`);return a}let i=mt(o);return t[i]}var _o=class Gf extends Error{constructor(n){super(`Cannot register component "${n}": a component with this name is already registered. Component names must be unique within a document generator.`);j(this,"componentName");j(this,"code","DUPLICATE_COMPONENT");this.name="DuplicateComponentError",this.componentName=n,Error.captureStackTrace&&Error.captureStackTrace(this,Gf)}},Ks=class qf extends Error{constructor(n,o){let i=n.map(s=>`"${s}"`).join(", "),a=o.length?o.map(s=>`"${s}"`).join(", "):"(none)";super(`preserveCustomComponents lists unregistered component name(s): ${i}. Registered components: ${a}.`);j(this,"unknownNames");j(this,"registeredNames");j(this,"code","UNKNOWN_PRESERVED_COMPONENT");this.name="UnknownPreservedComponentError",this.unknownNames=[...n],this.registeredNames=[...o],Error.captureStackTrace&&Error.captureStackTrace(this,qf)}},go=class extends Error{constructor(t,n){let o=n!==void 0?`\nProps: ${JSON.stringify(n,null,2)}`:"",i=`Document validation failed:\n${t.map(a=>` ${a.path}: ${a.message}`).join(`\n`)}${o}`;super(i);j(this,"errors");j(this,"props");this.name="ComponentValidationError",this.errors=t,this.props=n}};function wp(e,t,n){try{let o=$.Clone(t);if(n?.applyDefaults&&(o=$.Default(e,o)),n?.clean&&(o=$.Clean(e,o)),!$.Check(e,o)){let i=[...$.Errors(e,o)];return{valid:!1,errors:et(i,{jsonString:n?.jsonString,maxErrors:n?.maxErrors||100})}}return{valid:!0,data:o}}catch(o){return{valid:!1,errors:[{path:"root",message:o instanceof Error?o.message:"Unknown validation error",code:"validation_exception"}]}}}function Ln(e,t,n){let o=n?.componentName??"custom";try{let i=wp(e,t,{...n,clean:n?.clean??!0,applyDefaults:n?.applyDefaults??!0});return{...i,success:i.valid,data:i.data,componentName:o,isCustomComponent:!0}}catch(i){return{valid:!1,success:!1,errors:[{path:"props",message:i instanceof Error?i.message:"Unknown validation error",code:"validation_exception"}],componentName:o,isCustomComponent:!0}}}function Gs(e){return e.valid===!0&&e.data!==void 0}function qs(e){return e.valid?"Validation successful":!e.errors||e.errors.length===0?"Validation failed with unknown error":Jr(e.errors)}function Wf(e,t){let n=CT(e);throw new Error(t?`Unhandled variant in ${t}: ${n}`:`Unhandled variant: ${n}`)}function CT(e){if(e===null||typeof e!="object")return String(e);let t=e.kind,n=e.type;if(typeof t=="string")return`kind="${t}"`;if(typeof n=="string")return`type="${n}"`;try{return JSON.stringify(e)}catch{return Object.prototype.toString.call(e)}}var Cp=class Hf extends Error{constructor(n){let{format:o,rendererId:i,diagnostics:a}=n,s=zf(a.map(l=>l.feature)),c=zf(a.map(l=>l.path));super($T(o,i,a,s));j(this,"code","UNSUPPORTED_RENDERER_FEATURE");j(this,"format");j(this,"rendererId");j(this,"features");j(this,"paths");j(this,"diagnostics");this.name="UnsupportedRendererFeatureError",this.format=o,this.rendererId=i,this.features=s,this.paths=c,this.diagnostics=[...a],Error.captureStackTrace&&Error.captureStackTrace(this,Hf)}},PT=class Jf extends Error{constructor(n,o,i){let a=i.map(s=>`"${s}"`).join(", ");super(`Unknown ${n} renderer "${o}". Available renderers: ${a}.`);j(this,"code","UNKNOWN_RENDERER");j(this,"format");j(this,"rendererId");j(this,"availableIds");this.name="UnknownRendererError",this.format=n,this.rendererId=o,this.availableIds=[...i],Error.captureStackTrace&&Error.captureStackTrace(this,Jf)}};function zf(e){return[...new Set(e)]}function $T(e,t,n,o){let i=o.map(s=>`"${s}"`).join(", "),a=n.map(s=>` - ${s.feature} at ${s.path}: ${s.message}`);return`The "${t}" ${e} renderer does not support ${o.length} required feature(s): ${i}.\n${a.join(`\n`)}`}function Pp(e,t,n){return{feature:e,path:t,severity:"error",message:n}}function Yf(e,t,n){return{feature:e,path:t,severity:"warning",message:n}}function Xf(e){let t=[],n=[];for(let o of e)o.severity==="error"?t.push(o):n.push(o);return{errors:t,warnings:n}}var Zf=class{constructor(){j(this,"requirements",[]);j(this,"seen",new Set)}require(e,t,n){let o=`${e}\\0${t}`;this.seen.has(o)||(this.seen.add(o),this.requirements.push(n===void 0?{feature:e,path:t}:{feature:e,path:t,detail:n}))}list(){return this.requirements}features(){return[...new Set(this.requirements.map(e=>e.feature))]}isEmpty(){return this.requirements.length===0}};function $p(e,t,n){let o=[];for(let i of e)t.has(i.feature)||o.push(Pp(i.feature,i.path,TT(i,n)));return o}function TT(e,t){let n=`the "${t}" renderer cannot express "${e.feature}"`;return e.detail?`${n} (${e.detail})`:n}function Qf(e,t){let n=$p(e,t.capabilities,t.id);if(n.length!==0)throw new Cp({format:t.format,rendererId:t.id,diagnostics:n})}var eh=class{constructor(e,t){j(this,"renderers",new Map);j(this,"statusCache");this.format=e,this.defaultId=t}register(e,t){this.renderers.set(e,t),this.statusCache=void 0}ids(){return[...this.renderers.keys()]}getDefaultId(){return this.defaultId}has(e){return this.renderers.has(e)}async resolve(e){let t=e??this.defaultId,n=this.renderers.get(t);if(!n)throw new PT(this.format,t,this.ids());try{return await n()}catch(o){throw AT(o,this.format,t)}}statuses(){return this.statusCache??(this.statusCache=this.probeStatuses()),this.statusCache}async probeStatuses(){return Promise.all(this.ids().map(async e=>{let t={id:e,default:e===this.defaultId};try{return await this.resolve(e),{...t,available:!0}}catch(n){let i=n instanceof Error&&n.name===zs&&n instanceof Error?n.packageName:void 0;return{...t,available:!1,reason:n instanceof Error?n.message:String(n),...i?{installHint:`pnpm add ${i}`}:{}}}}))}};function AT(e,t,n){let o=e instanceof Error?e.message:String(e);if(!/Cannot find (?:module|package)|ERR_MODULE_NOT_FOUND|Failed to resolve/i.test(o))return e instanceof Error?e:new Error(o);let a=LT(o),s=a??`the "${n}" backend`,c=new Error(`The "${n}" ${t} renderer requires ${s}, which is not installed. Install it with: pnpm add ${s}\nOriginal error: ${o}`);return c.name=zs,a&&(c.packageName=a),c}var zs="RendererDependencyMissingError";function LT(e){return(/Cannot find (?:module|package) [\'"]([^\'"]+)[\'"]/.exec(e)??/Failed to resolve (?:module|import)[: ]+[\'"]?([^\'"\\s]+)/.exec(e))?.[1]}var vT="Sheet1";var Oq=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><sheets><sheet name="${vT}" sheetId="1" r:id="rId1"/></sheets></workbook>`;function rh(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e.properties?.name;return typeof t?.const=="string"?t.const:void 0}function ET(e){return typeof e.properties?.version?.const=="string"}function NT(e){return Array.isArray(e.required)&&e.required.includes("name")}function kT(e){let t=new Map;for(let n of e){let o=rh(n),i=t.get(o);i?i.push(n):t.set(o,[n])}return t}function RT(e,t){let n=t.find(o=>!ET(o)&&typeof o.description=="string")??t.find(o=>typeof o.description=="string");return{const:e,type:"string",...n?{description:n.description}:{}}}function Ia(e){let t=new WeakSet;function n(o){if(typeof o!="object"||o===null||t.has(o))return;if(t.add(o),Array.isArray(o)){o.forEach(n);return}let i=o,a=i.anyOf,c=Array.isArray(a)&&a.length>=2&&a.every(l=>rh(l)!==void 0&&NT(l))&&i.properties===void 0&&i.allOf===void 0&&i.if===void 0&&i.required===void 0&&i.additionalProperties===void 0&&(i.type===void 0||i.type==="object")?kT(a):void 0;c&&c.size>=2&&(i.type="object",i.required=["name"],i.properties={name:{description:"Component or registered plugin to render.",anyOf:[...c.entries()].map(([l,p])=>RT(l,p))}},i.allOf=[...c.entries()].map(([l,p])=>({if:{properties:{name:{const:l}},required:["name"]},then:p.length===1?p[0]:{anyOf:p}})),delete i.anyOf);for(let l of Object.values(i))n(l)}n(e)}function Ws(e){if(typeof e!="object"||e===null)return[];let t=e;return Array.isArray(t.anyOf)?t.anyOf.filter(n=>typeof n=="object"&&n!==null):Array.isArray(t.allOf)?t.allOf.flatMap(n=>{let o=n?.then;if(typeof o!="object"||o===null)return[];let i=o.anyOf;return Array.isArray(i)?i.filter(a=>typeof a=="object"&&a!==null):[o]}):[]}function Ap(e,t,n){if(!(typeof e!="object"||e===null)){if(Array.isArray(e)){e.forEach(o=>{typeof o=="object"&&o!==null&&Ap(o,t,n)});return}e.$ref===t&&(e.$ref=n);for(let o of Object.values(e))typeof o=="object"&&o!==null&&Ap(o,t,n)}}function vn(e,t="ComponentDefinition"){let n=new Set(Object.keys(e.definitions??{})),o=s=>{let c=n.has(s)?s:t;return n.has(c)?`#/definitions/${c}`:void 0},i=s=>typeof s=="string"&&(/^T\\d+$/.test(s)||s===t||n.has(s));function a(s,c=""){if(!(typeof s!="object"||s===null))for(let[l,p]of Object.entries(s)){let m=c?`${c}.${l}`:l;if(p&&typeof p=="object"){let u=p;if(u.type==="array"&&u.items&&Object.keys(u.items).length===0&&n.has(t)&&(u.items={$ref:`#/definitions/${t}`}),u.type==="array"&&u.items&&typeof u.items=="object"&&"$ref"in u.items&&i(u.items.$ref)){let f=u.items.$ref,x=o(f);u.items=x?{$ref:x}:{}}if(i(u.$ref)){let f=o(u.$ref);f?u.$ref=f:delete u.$ref}if(l==="$id"&&i(p)&&m!==`definitions.${p}.$id`){delete s[l];continue}a(p,m)}}}a(e)}function Hs(e,t={}){let{$schema:n="http://json-schema.org/draft-07/schema#",$id:o,title:i,description:a,definitions:s={},enrich:c}=t,l=JSON.parse(JSON.stringify(e));if(l.$id&&typeof l.$id=="string"&&/^T\\d+$/.test(l.$id)){let f=l.$id;delete l.$id,Ap(l,f,"#")}let p={...s};function m(f,x=""){if(!(typeof f!="object"||f===null)){for(let[S,C]of Object.entries(f))if(C&&typeof C=="object"){let O=C;if(O.$id&&typeof O.$id=="string"){let A=O.$id;if(x!==`definitions.${A}`){let{$id:I,...R}=O;p[A]=R,f[S]={$ref:`#/definitions/${A}`},m(R,`definitions.${A}`);continue}}m(C,x?`${x}.${S}`:S)}}}m(l);let u={$schema:n};return o&&(u.$id=o),Object.assign(u,l),u.$schema=n,o&&(u.$id=o),i!==void 0&&(u.title=i),a!==void 0&&(u.description=a),Object.keys(p).length>0&&(u.definitions=p),vn(u),c?.(u),Ia(u),u}function Vo(e,t,n,o,i="ComponentDefinition"){let a={$schema:"http://json-schema.org/draft-07/schema#",$id:`${e}.schema.json`,title:t.title,description:t.description,type:"object",required:["name","props"],properties:{name:{type:"string",const:e,description:`Component name identifier (must be "${e}")`},id:{type:"string",description:"Optional unique identifier for the component"},props:JSON.parse(JSON.stringify(t.schema))}};return n.includes(e)&&(a.properties.children={type:"array",description:"Children within this container",items:{$ref:`#/definitions/${i}`}},o&&(a.definitions={[i]:JSON.parse(JSON.stringify(o))})),vn(a,i),a.additionalProperties=!1,a}async function Ko(e,t,n={}){let{prettyPrint:o=!0}=n,i=o?JSON.stringify(e,null,2):JSON.stringify(e);await(await Promise.resolve().then(()=>qu(Tp(),1))).writeFile(t,i,"utf-8")}function Js(e,t){let n={name:r.Literal(e.name),id:r.Optional(r.String()),enabled:r.Optional(r.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true."}))};return e.special?.hasSchemaField&&(n.$schema=r.Optional(r.String({format:"uri"}))),n.props=e.propsSchema,e.hasChildren&&t&&(n.children=r.Optional(r.Array(t))),r.Object(n,{additionalProperties:!1})}var Zs=["Arial","Calibri","Cambria","Consolas","Courier New","Georgia","Segoe UI","Tahoma","Times New Roman","Trebuchet MS","Verdana","Helvetica","Helvetica Neue","Menlo","Monaco"];function yo(e){let t=e.toLowerCase();return Zs.some(n=>n.toLowerCase()===t)}var zt=r.String({description:"Font family name. Prefer a SAFE_FONTS entry (Arial, Calibri, Cambria, Consolas, Courier New, Georgia, Segoe UI, Tahoma, Times New Roman, Trebuchet MS, Verdana, Helvetica, Helvetica Neue, Menlo, Monaco) for zero-setup rendering. For any other font, register it in props.fontRegistry[] and reference it here by family. Unregistered non-safe names render with a host fallback.",examples:["Arial","Calibri","Georgia","Inter","Roboto"]}),wa=r.Number({minimum:100,maximum:900,description:"OpenType weight (100 thin ... 900 black). Default 400."}),Qs=r.Boolean({description:"Whether this source is italic. Default false."}),jT=r.Object({kind:r.Literal("safe"),family:r.String({description:"A SAFE_FONTS name \\u2014 installed with Office."})},{additionalProperties:!1,description:"Office-installed font \\u2014 no embedding"}),FT=r.Object({kind:r.Literal("google"),family:r.String({description:\'Exact Google Fonts family name (e.g. "Inter").\'}),weights:r.Optional(r.Array(wa,{description:"Weights to fetch. Default [400, 700]."})),italics:r.Optional(r.Boolean({description:"Include italic variants. Default false."}))},{additionalProperties:!1,description:"Google Fonts \\u2014 auto-fetched and embedded"}),UT=r.Object({kind:r.Literal("file"),path:r.String({description:"Path to a .ttf/.otf file. Relative paths are resolved against the JSON document file."}),weight:r.Optional(wa),italic:r.Optional(Qs)},{additionalProperties:!1,description:"Local font file to embed"}),DT=r.Object({kind:r.Literal("url"),url:r.String({description:"HTTPS URL of a TTF or OTF file."}),weight:r.Optional(wa),italic:r.Optional(Qs)},{additionalProperties:!1,description:"Direct TTF/OTF URL (non-Google CDN)"}),MT=r.Object({kind:r.Literal("variable"),url:r.String({description:"HTTPS URL of a variable TTF (`fvar` axis table required)."}),weight:wa,italic:r.Optional(Qs),axes:r.Optional(r.Record(r.String(),r.Number(),{description:"Additional axis pin values (e.g. `{ ital: 1, opsz: 14 }`) merged on top of the derived `wght` pin. Uncommon \\u2014 the `weight` field is usually enough."}))},{additionalProperties:!1,description:"Variable-font instancer. The fetcher pins `wght` to `weight` (plus any `axes` overrides) and emits a clean static TTF, bypassing upstream distributions that collapse multiple static weights onto the same glyph geometry."}),BT=r.Object({kind:r.Literal("data"),data:r.String({description:"Base64-encoded TTF/OTF or data: URL (data:font/ttf;base64,...). Makes the JSON self-contained at the cost of size."}),weight:r.Optional(wa),italic:r.Optional(Qs)},{additionalProperties:!1,description:"Inline base64 font \\u2014 portable"}),Lp=r.Union([jT,FT,UT,BT,DT,MT],{description:\'A single font variant source. Use kind:"safe" for installed fonts, kind:"google" for Google Fonts, kind:"file" for local files, kind:"data" for base64, kind:"url" for direct HTTPS TTF/OTF URLs, kind:"variable" to instance a variable TTF at a specific weight.\'}),_T=r.Union([r.Literal("sans"),r.Literal("serif"),r.Literal("mono"),r.Literal("display"),r.Literal("handwriting")],{description:"Broad category used for fallback selection"}),vp=r.Object({id:r.String({description:\'Registry key. By convention, match the display family name ("Inter", "Roboto Slab").\'}),family:r.String({description:"Display family used in font.family / fontFace / theme.fonts.*. Usually identical to id."}),category:r.Optional(_T),sources:r.Array(Lp,{minItems:1,description:"One or more weight/style variants. List at least a regular (weight 400, italic false)."})},{additionalProperties:!1,description:"A font registered for this document. Referenced by family from font.family, fontFace, and theme.fonts.*."}),Ir=r.Array(vp,{description:"Document-scoped font registry. Every non-safe font used in this document must be registered here."}),Go=["eyebrow","display","stat","quote","label","footer","tableHeader","tableCell","chartLabel","tracker","source"],Ep=r.Union(Go.map(e=>r.Literal(e))),nh=["a4","letter","wide169","standard43"],bo=r.Union([r.Literal("none"),r.Literal("upper"),r.Literal("smallCaps")]),qt=r.String({pattern:"^(#?[0-9A-Fa-f]{6}|[a-zA-Z][a-zA-Z0-9]*)$",description:"Six-digit hex or a theme color/palette token. References must resolve without cycles."}),Np=r.Object({rule:r.Optional(qt),textMuted:r.Optional(qt),onPrimary:r.Optional(qt),surfaceInverse:r.Optional(qt),positive:r.Optional(qt),negative:r.Optional(qt),chart:r.Optional(r.Array(qt,{minItems:1,maxItems:12}))},{additionalProperties:!1}),It=r.Object({face:r.Optional(r.Union([r.Literal("heading"),r.Literal("body"),r.Literal("mono"),r.Literal("light")])),weight:r.Optional(r.Integer({minimum:100,maximum:900})),size:r.Optional(r.Number({minimum:5,maximum:200,description:"Explicit size in points; takes precedence over the canvas scale."})),lineHeight:r.Optional(r.Number({minimum:.5,maximum:3})),tracking:r.Optional(r.Number({description:"Tracking in hundredths of an em."})),case:r.Optional(bo),color:r.Optional(qt),spaceBefore:r.Optional(r.Number({minimum:0})),spaceAfter:r.Optional(r.Number({minimum:0}))},{additionalProperties:!1}),kp=r.Object({eyebrow:r.Optional(It),display:r.Optional(It),stat:r.Optional(It),quote:r.Optional(It),label:r.Optional(It),footer:r.Optional(It),tableHeader:r.Optional(It),tableCell:r.Optional(It),chartLabel:r.Optional(It),tracker:r.Optional(It),source:r.Optional(It)},{additionalProperties:!1}),Ys=r.Object({base:r.Number({minimum:5,maximum:200}),ratio:r.Optional(r.Number({minimum:1,maximum:2})),baselinePt:r.Optional(r.Number({exclusiveMinimum:0,maximum:24}))},{additionalProperties:!1}),Rp=r.Object({roles:r.Optional(kp),scale:r.Optional(r.Object({a4:r.Optional(Ys),letter:r.Optional(Ys),wide169:r.Optional(Ys),standard43:r.Optional(Ys)},{additionalProperties:!1}))},{additionalProperties:!1}),Xs=r.Object({safeAreaIn:r.Optional(r.Number({minimum:0})),gutterIn:r.Optional(r.Number({minimum:0})),columns:r.Optional(r.Integer({minimum:1,maximum:100})),rows:r.Optional(r.Integer({minimum:1,maximum:100}))},{additionalProperties:!1}),jp=r.Object({basePt:r.Optional(r.Number({exclusiveMinimum:0})),blockGap:r.Optional(r.Object({tight:r.Optional(r.Number({minimum:0})),normal:r.Optional(r.Number({minimum:0})),loose:r.Optional(r.Number({minimum:0}))},{additionalProperties:!1})),canvas:r.Optional(r.Object({a4:r.Optional(Xs),letter:r.Optional(Xs),wide169:r.Optional(Xs),standard43:r.Optional(Xs)},{additionalProperties:!1}))},{additionalProperties:!1}),En=r.Object({type:r.Optional(Ep),color:r.Optional(qt),fill:r.Optional(qt),rule:r.Optional(r.Object({weightPt:r.Optional(r.Number({minimum:0})),color:r.Optional(qt)},{additionalProperties:!1})),padPt:r.Optional(r.Number({minimum:0})),alignment:r.Optional(r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right")]))},{additionalProperties:!1}),Fp=r.Object({runningHead:r.Optional(En),tracker:r.Optional(En),actionTitle:r.Optional(En),keyTakeaways:r.Optional(En),sourceLine:r.Optional(En),confidentialFooter:r.Optional(En),logoSlot:r.Optional(En),cover:r.Optional(En)},{additionalProperties:!1,description:"Visual recipes; consumers land in #361. No automatic content or presence requirements."}),Up=r.Object({kind:r.Union([r.Literal("none"),r.Literal("rule"),r.Literal("corner"),r.Literal("band")]),color:r.Optional(qt),weightPt:r.Optional(r.Number({minimum:0})),placement:r.Optional(r.Union([r.Literal("top"),r.Literal("bottom"),r.Literal("left"),r.Literal("right"),r.Literal("topLeft"),r.Literal("topRight"),r.Literal("bottomLeft"),r.Literal("bottomRight")]))},{additionalProperties:!1,description:"At most one motif. Rendering consumers land in #361."}),Nn={palette:r.Optional(Np),typography:r.Optional(Rp),spacing:r.Optional(jp),chrome:r.Optional(Fp),motif:r.Optional(Up)},oh=r.Object(Nn,{additionalProperties:!1});function ih(e,t){if(e==="docx")return t==="LETTER"?"letter":"a4";let n=typeof t=="object"?t.width/t.height:4/3;return Math.abs(n-16/9)<Math.abs(n-4/3)?"wide169":"standard43"}var Dp={display:4,stat:3,quote:1,tableHeader:0,tableCell:0,label:-1,eyebrow:-1,chartLabel:-1,tracker:-1,footer:-2,source:-2};function VT(e,t){if(t===0)return e.base;let n=e.baselinePt??4,o=e.base*(e.ratio??1.25)**t;return Math.max(5,Math.min(200,Math.round(o/n)*n))}function KT(e){let t={};for(let[n,o]of Object.entries(e??{}))typeof o=="string"&&(t[n]=o);return t}function ah(e){return e==="upper"?{allCaps:!0}:{smallCaps:e==="smallCaps"}}function sh(e,t,n){let o=e.typography?.scale?.[t],i={};for(let a of Go){let s=e.typography?.roles?.[a];s&&(i[a]={...s,size:s.size??(o?VT(o,Dp[a]):n)})}return i}function Mp(e,t){return{...e,...KT(t)}}function Bp(e,t){let n=new Set,o=e;for(;o!==void 0&&!n.has(o);)if(!o.startsWith("#")&&Object.hasOwn(t,o))n.add(o),o=t[o];else return/^#?[0-9a-f]{6}$/i.test(o)?o.replace(/^#/,""):void 0}function ch(e,t){let n=Mp(t,e.palette),o=Object.entries(e.palette??{}).flatMap(([i,a])=>Array.isArray(a)?a.map((s,c)=>[`palette.${i}[${c}]`,s]):[[`palette.${i}`,a]]);for(let[i,a]of Object.entries(e.typography?.roles??{}))a.color&&o.push([`typography.roles.${i}.color`,a.color]);for(let[i,a]of o)if(a&&!Bp(a,n))throw new Error(`Unresolvable theme color at ${i}: "${a}" (unknown token or cycle)`)}var Aa=200,La=36,va=600;function GT(e){return typeof e!="number"||!Number.isFinite(e)?Aa:Math.min(va,Math.max(La,Math.round(e)))}var qT=32,zT=8*1024*1024,WT=32,yh=new Set(["family","fontFace","titleFontFace","legendFontFace","dataLabelFontFace","catAxisLabelFontFace","valAxisLabelFontFace"]),bh=new Set(["heading","body","mono","light"]),Oh=new Set(["fontRegistry"]);function Wp(e,t,n){if(e!=null){if(typeof e=="string"){if(n&&(yh.has(n)||bh.has(n))){let o=e.trim();o.length>0&&t.add(o)}return}if(Array.isArray(e)){for(let o of e)Wp(o,t,n);return}if(typeof e=="object"){let o=e.fonts;if(n==="theme"&&o&&typeof o=="object"){for(let[i,a]of Object.entries(o))if(typeof a=="string"){let s=a.trim();s.length>0&&t.add(s)}else if(a&&typeof a=="object"){let s=a.family;typeof s=="string"&&s.trim().length>0&&t.add(s.trim())}}for(let[i,a]of Object.entries(e))Oh.has(i)||Wp(a,t,i)}}}function Wo(e){let t=new Set;return Wp(e,t),t}var HT=Wo,JT=Wo;function YT(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.id=="string"&&typeof t.family=="string"&&Array.isArray(t.sources)}function xh(e,t){if(!e||typeof e!="object")return[];let n=e[t];return Array.isArray(n)?n.filter(YT):[]}function XT(e){return!e||typeof e!="object"?[]:xh(e.props,"fontRegistry")}function Sh(e){return xh(e,"fontRegistry")}function ZT(...e){let t=[];for(let n of e)for(let o of n??[]){let i=o.family.toLowerCase(),a=o.id.toLowerCase();for(let s=t.length-1;s>=0;s--)t[s].family.toLowerCase()===i&&t[s].id.toLowerCase()===a&&t.splice(s,1);t.push(o)}return t}function QT(e){let t=new Set;for(let n of e??[])t.add(n.family.toLowerCase()),t.add(n.id.toLowerCase());return t}function eA(e){let t=QT(e.registeredEntries),n=[],o=[],i=[];for(let a of e.referencedNames){if(yo(a)||t.has(a.toLowerCase())){n.push(a);continue}o.push(a),i.push({code:"FONT_UNRESOLVED",family:a,message:`Font "${a}" is not a SAFE_FONTS entry and is not registered via fonts.extraEntries. It will render with a host fallback on machines lacking the font. Safe fonts: ${Zs.join(", ")}.`})}return{resolved:n,unresolved:o,warnings:i}}var Ih={100:"Thin",200:"ExtraLight",300:"Light",400:"Regular",500:"Medium",600:"SemiBold",700:"Bold",800:"ExtraBold",900:"Black"};function tA(e,t,n){if(t==null)return{family:e,bold:!1,italic:n,nonCanonicalWeight:!1};if(t===400)return{family:e,bold:!1,italic:n,nonCanonicalWeight:!1};if(t===700)return{family:e,bold:!0,italic:n,nonCanonicalWeight:!1};let o=Ih[t];if(!o)return{family:e,bold:t>=600,italic:n,nonCanonicalWeight:!0};let i=n?` ${o} Italic`:` ${o}`;return{family:`${e}${i}`,bold:!1,italic:!1,nonCanonicalWeight:!1}}var ec=5*1024*1024;function rA(e){let t=e.data.trim(),n;if(t.startsWith("data:")){let s=t.indexOf(",");if(s<0)throw new Error("Invalid data URL: no payload separator");if(!t.slice(5,s).includes(";base64"))throw new Error("Data URL must be base64-encoded");n=t.slice(s+1)}else n=t;if(Math.floor(n.length*3/4)>ec)throw new Error(`Font data payload exceeds ${ec} byte limit`);let i=Buffer.from(n,"base64");if(i.length===0)throw new Error("Decoded font buffer is empty");if(i.length>ec)throw new Error(`Font data payload exceeds ${ec} byte limit`);let a=Wr(i);if(a==="unknown")throw new Error("Decoded font buffer is not a recognized font (expected TTF/OTF/WOFF/WOFF2)");return{data:i,weight:e.weight??400,italic:e.italic??!1,format:a}}var nA="Mozilla/4.0";async function lh(e,t){let n=new AbortController,o=setTimeout(()=>n.abort(),t.timeoutMs??5e3);try{return await(t.fetcher??fetch)(e,{headers:t.headers,signal:n.signal})}finally{clearTimeout(o)}}function oA(e,t,n){let o=encodeURIComponent(e).replace(/%20/g,"+"),i=[...t].sort((s,c)=>s-c);if(n){let s=i.flatMap(c=>[`0,${c}`,`1,${c}`]).join(";");return`https://fonts.googleapis.com/css2?family=${o}:ital,wght@${s}&display=swap`}let a=i.join(";");return`https://fonts.googleapis.com/css2?family=${o}:wght@${a}&display=swap`}function iA(e){let t=[],n=/@font-face\\s*\\{([^}]*)\\}/g,o;for(;(o=n.exec(e))!==null;){let i=o[1],a=i.match(/src:\\s*url\\((https:\\/\\/fonts\\.gstatic\\.com\\/[^)]+\\.ttf)\\)/);if(!a)continue;let s=i.match(/font-weight:\\s*(\\d+)/),c=i.match(/font-style:\\s*italic/);t.push({weight:s?parseInt(s[1],10):400,italic:!!c,ttfUrl:a[1]})}return t}function ph(e,t,n){return`google|${e}|${t}|${n?"i":"r"}`}async function wh(e){let t=e.weights?.length?e.weights:[400,700],n=e.italics??!1,o=[],i=[],a=[];for(let m of t)a.push({weight:m,italic:!1}),n&&a.push({weight:m,italic:!0});let s=[];for(let m of a){let u=ph(e.family,m.weight,m.italic),f=e.memoryCache?.get(u);if(f){i.push({data:f,weight:m.weight,italic:m.italic,format:Wr(f)});continue}let x=await e.diskCache?.get(u);if(x){e.memoryCache?.set(u,x),i.push({data:x,weight:m.weight,italic:m.italic,format:Wr(x)});continue}s.push(m)}if(s.length===0)return{sources:i,warnings:o};let c=s.some(m=>m.italic),l=oA(e.family,Array.from(new Set(s.map(m=>m.weight))),c),p;try{let m=await lh(l,{headers:{"User-Agent":nA},timeoutMs:e.fetchTimeoutMs,fetcher:e.fetcher});if(!m.ok)return o.push(`Google Fonts CSS fetch for "${e.family}" returned ${m.status}`),{sources:i,warnings:o};let u=await m.text();p=iA(u)}catch(m){return o.push(`Google Fonts CSS fetch for "${e.family}" failed: ${m.message}`),{sources:i,warnings:o}}for(let m of s){let u=p.find(f=>f.weight===m.weight&&f.italic===m.italic);if(!u){o.push(`Google Fonts "${e.family}" missing weight ${m.weight}${m.italic?" italic":""}`);continue}try{let f=await lh(u.ttfUrl,{timeoutMs:e.fetchTimeoutMs,fetcher:e.fetcher});if(!f.ok){o.push(`Google Fonts TTF fetch for "${e.family}" ${m.weight} returned ${f.status}`);continue}let x=await f.arrayBuffer(),S=Buffer.from(x),C=ph(e.family,m.weight,m.italic);e.memoryCache?.set(C,S),await e.diskCache?.set(C,S),i.push({data:S,weight:m.weight,italic:m.italic,format:Wr(S)})}catch(f){o.push(`Google Fonts TTF fetch for "${e.family}" ${m.weight} failed: ${f.message}`)}}return{sources:i,warnings:o}}function aA(e,t,n){return`url|${e}|${t}|${n?"i":"r"}`}async function sA(e){if(!_s(e.url))return{warnings:[`URL font fetch rejected (host not in allowlist or non-HTTPS): ${e.url}`]};let t=aA(e.url,e.weight,e.italic),n=e.memoryCache?.get(t);if(n)return{source:{data:n,weight:e.weight,italic:e.italic,format:Wr(n)},warnings:[]};let o=await e.diskCache?.get(t);if(o)return e.memoryCache?.set(t,o),{source:{data:o,weight:e.weight,italic:e.italic,format:Wr(o)},warnings:[]};let i=new AbortController,a=setTimeout(()=>i.abort(),e.fetchTimeoutMs??1e4);try{let s=e.fetcher??fetch,c=await s(e.url,{signal:i.signal,redirect:"manual"}),l=0;for(;c.status>=300&&c.status<400&&c.status!==304;){let x=c.headers.get("location");if(!x)return{warnings:[`URL font fetch "${e.url}" ${c.status} with no Location header`]};let S=new URL(x,e.url).toString();if(!_s(S))return{warnings:[`URL font fetch "${e.url}" redirected to disallowed host: ${S}`]};if(++l>3)return{warnings:[`URL font fetch "${e.url}" too many redirects`]};c=await s(S,{signal:i.signal,redirect:"manual"})}if(!c.ok)return{warnings:[`URL font fetch "${e.url}" returned ${c.status}`]};let p=await c.arrayBuffer(),m=Buffer.from(p),u=Wr(m);if(u==="unknown"||m.length<512)return{warnings:[`URL font fetch "${e.url}" returned ${m.length} bytes of ${u} \\u2014 not a TTF/OTF. Skipping.`]};let f=m;return e.memoryCache?.set(t,f),await e.diskCache?.set(t,f),{source:{data:f,weight:e.weight,italic:e.italic,format:u},warnings:[]}}catch(s){return{warnings:[`URL font fetch "${e.url}" failed: ${s.message}`]}}finally{clearTimeout(a)}}var mh=12,uh=16;function cA(e,t){if(e.length<mh)return null;let n=e.readUInt32BE(0);if(n!==65536&&n!==1330926671)return null;let o=e.readUInt16BE(4);for(let i=0;i<o;i++){let a=mh+i*uh;if(a+uh>e.length)return null;if(e.toString("ascii",a,a+4)===t)return{off:e.readUInt32BE(a+8),len:e.readUInt32BE(a+12)}}return null}function lA(e){let t=cA(e,"OS/2");return!t||t.off+6>e.length?null:e.readUInt16BE(t.off+4)}function pA(e,t,n,o){let i=[],a=lA(e);a!=null&&a!==t&&i.push({code:"WEIGHT_CLASS_MISMATCH",message:`Font "${o}" weight ${t}: OS/2.usWeightClass reports ${a}. Likely a defective redistribution \\u2014 consider adding an upstream override.`});let s=Op(e);s.length>0&&!s.includes(o.trim())&&i.push({code:"FAMILY_MISMATCH",message:`Font "${o}" weight ${t}${n?" italic":""}: name table declares ${s.map(u=>`"${u}"`).join(" / ")}, not "${o}". Referencing runs will not resolve this face.`});let c=Sp(t,n);if(!c)return i;let l=c.typographic,p=c.legacy,m=Bs(e,new Set([2,17]));for(let u of m)u.nameID===17&&u.value!==l&&i.push({code:"SUBFAMILY_MISMATCH",message:`Font "${o}" weight ${t}${n?" italic":""}: name record (platform ${u.platformID}) nameID 17 = "${u.value}", expected "${l}".`}),u.nameID===2&&u.value!==p&&i.push({code:"LEGACY_SUBFAMILY_MISMATCH",message:`Font "${o}" weight ${t}${n?" italic":""}: name record (platform ${u.platformID}) nameID 2 = "${u.value}", expected "${p}".`});return i}var mA=new Set([65536,1330926671,1953658213,1954115633]),_p=12,dh=16;function uA(e,t,n,o){let i=`Font "${o}" weight ${t}${n?" italic":""}`,a=f=>({code:"FONT_UNREADABLE",message:`${i}: ${f} The face will not resolve; text referencing it renders in a fallback.`});if(e.length<_p)return a(`${e.length} bytes is shorter than an sfnt header \\u2014 the download is truncated or empty.`);let s=e.readUInt32BE(0);if(!mA.has(s))return a(`sfnt version 0x${s.toString(16).padStart(8,"0")} is neither TrueType nor OpenType.`);let c=e.readUInt16BE(4);if(c===0)return a("its table directory is empty.");let l=_p+c*dh;if(l>e.length)return a(`its directory claims ${c} tables (${l} bytes) but the file is ${e.length} bytes \\u2014 truncated.`);let p=new Set;for(let f=0;f<c;f+=1){let x=_p+f*dh,S=e.toString("ascii",x,x+4),C=e.readUInt32BE(x+8),O=e.readUInt32BE(x+12);if(C+O>e.length)return a(`its "${S}" table runs to byte ${C+O} but the file is ${e.length} bytes \\u2014 truncated.`);p.add(S)}for(let f of["name","head"])if(!p.has(f))return a(`it has no "${f}" table.`);let m=p.has("glyf")&&p.has("loca"),u=p.has("CFF ")||p.has("CFF2");return!m&&!u?a(\'it carries no glyph outlines (neither "glyf" + "loca" nor "CFF ").\'):Bs(e).length===0?a(\'its "name" table carries no readable records.\'):null}var dA=class{constructor(e={}){j(this,"store",new Map);j(this,"bytes",0);j(this,"maxBytes");this.maxBytes=e.maxBytes??20*1024*1024}get(e){let t=this.store.get(e);if(t)return this.store.delete(e),this.store.set(e,t),t}set(e,t){let n=this.store.get(e);for(n&&(this.bytes-=n.byteLength),this.store.set(e,t),this.bytes+=t.byteLength;this.bytes>this.maxBytes&&this.store.size>0;){let o=this.store.keys().next().value;if(!o)break;let i=this.store.get(o);this.store.delete(o),i&&(this.bytes-=i.byteLength)}}size(){return this.store.size}};function fA(e,t){if(e.format!=="ttf"&&e.format!=="otf")return e;let n=Op(e.data);if(n.length===0||n.includes(t))return e;let o=Sp(e.weight,e.italic)?.legacy;return{...e,data:xp(e.data,t,o)}}var hA=class{constructor(e={}){j(this,"index");j(this,"cache");j(this,"opts");j(this,"memoryCache");j(this,"diskCache");j(this,"fileLoader");j(this,"variableLoader");this.opts=e.opts??{},this.index=new Map,this.cache=new Map,this.memoryCache=new dA,this.diskCache=e.diskCache,this.fileLoader=e.fileLoader,this.variableLoader=e.variableLoader;for(let t of this.opts.extraEntries??[])this.addEntry(t)}addEntry(e){this.index.set(e.family.toLowerCase(),e),this.index.set(e.id.toLowerCase(),e)}async resolveMany(e){let t=[];for(let n of e)t.push(await this.resolve(n));return t}async resolve(e){let t=e.toLowerCase(),n=this.cache.get(t);if(n)return n;let o=this.index.get(t),i;return o?i=await this.materializeEntry(o):yo(e)?i={family:e,sources:[],warnings:[]}:i={family:e,sources:[],warnings:[`Font "${e}" is not registered and not in SAFE_FONTS; will rely on host fallback.`]},this.cache.set(t,i),i}async materializeEntry(e){let t=[],n=[];for(let o of e.sources)try{let i=await this.materializeSource(o,n);for(let a of i){let s=a.format==="ttf"||a.format==="otf",c=s?uA(a.data,a.weight,a.italic,e.family):null;if(c){n.push(`[${c.code}] ${c.message}`),t.push(a);continue}let l=fA(a,e.family);if(s)for(let p of pA(l.data,l.weight,l.italic,e.family))n.push(`[FONT_METADATA_DEFECT:${p.code}] ${p.message}`);t.push(l)}}catch(i){n.push(`Font "${e.family}" source (${o.kind}) failed: ${i.message}`)}return{family:e.family,sources:t,warnings:n}}async materializeSource(e,t){switch(e.kind){case"safe":return[];case"file":return this.fileLoader?[await this.fileLoader({path:e.path,weight:e.weight,italic:e.italic,baseDir:this.opts.baseDir})]:(t.push(`kind:"file" source for "${e.path}" requires a fileLoader (Node-only); skipping.`),[]);case"data":return[rA({data:e.data,weight:e.weight,italic:e.italic})];case"google":{let n=this.opts.googleFonts;if(n?.enabled===!1)return t.push(`Google Fonts fetch disabled \\u2014 skipping "${e.family}".`),[];let{sources:o,warnings:i}=await wh({family:e.family,weights:e.weights??[400,700],italics:e.italics??!1,memoryCache:this.memoryCache,diskCache:this.diskCache,fetchTimeoutMs:n?.fetchTimeoutMs});return t.push(...i),o}case"url":{let n=this.opts.googleFonts,{source:o,warnings:i}=await sA({url:e.url,weight:e.weight??400,italic:e.italic??!1,memoryCache:this.memoryCache,diskCache:this.diskCache,fetchTimeoutMs:n?.fetchTimeoutMs});return i&&t.push(...i),o?[o]:[]}case"variable":{if(!this.variableLoader)return t.push(`kind:"variable" source for "${e.url}" requires a variableLoader (Node-only); skipping.`),[];let n=this.opts.googleFonts,{source:o,warnings:i}=await this.variableLoader({url:e.url,weight:e.weight,italic:e.italic??!1,axes:e.axes,memoryCache:this.memoryCache,diskCache:this.diskCache,fetchTimeoutMs:n?.fetchTimeoutMs});return i&&t.push(...i),o?[o]:[]}default:throw new Error(`Unknown font source kind: ${e.kind}`)}}},Ch=[{family:"Inter",category:"sans",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!1},{family:"Roboto",category:"sans",weights:[100,300,400,500,700,900],hasItalic:!0},{family:"Open Sans",category:"sans",weights:[300,400,500,600,700,800],hasItalic:!0},{family:"Lato",category:"sans",weights:[100,300,400,700,900],hasItalic:!0},{family:"Montserrat",category:"sans",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Poppins",category:"sans",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Work Sans",category:"sans",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Nunito",category:"sans",weights:[200,300,400,500,600,700,800,900],hasItalic:!0},{family:"DM Sans",category:"sans",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Rubik",category:"sans",weights:[300,400,500,600,700,800,900],hasItalic:!0},{family:"Source Sans 3",category:"sans",weights:[200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Manrope",category:"sans",weights:[200,300,400,500,600,700,800],hasItalic:!1},{family:"Plus Jakarta Sans",category:"sans",weights:[200,300,400,500,600,700,800],hasItalic:!0},{family:"IBM Plex Sans",category:"sans",weights:[100,200,300,400,500,600,700],hasItalic:!0},{family:"Archivo",category:"sans",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Geist",category:"sans",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Space Grotesk",category:"sans",weights:[300,400,500,600,700],hasItalic:!1},{family:"Playfair Display",category:"serif",weights:[400,500,600,700,800,900],hasItalic:!0},{family:"Merriweather",category:"serif",weights:[300,400,700,900],hasItalic:!0},{family:"Lora",category:"serif",weights:[400,500,600,700],hasItalic:!0},{family:"Source Serif 4",category:"serif",weights:[200,300,400,500,600,700,800,900],hasItalic:!0},{family:"DM Serif Display",category:"serif",weights:[400],hasItalic:!0},{family:"Crimson Pro",category:"serif",weights:[200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Cormorant Garamond",category:"serif",weights:[300,400,500,600,700],hasItalic:!0},{family:"JetBrains Mono",category:"mono",weights:[100,200,300,400,500,600,700,800],hasItalic:!0},{family:"Fira Code",category:"mono",weights:[300,400,500,600,700],hasItalic:!1},{family:"IBM Plex Mono",category:"mono",weights:[100,200,300,400,500,600,700],hasItalic:!0},{family:"Source Code Pro",category:"mono",weights:[200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Space Mono",category:"mono",weights:[400,700],hasItalic:!0},{family:"Geist Mono",category:"mono",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Bebas Neue",category:"display",weights:[400],hasItalic:!1},{family:"Abril Fatface",category:"display",weights:[400],hasItalic:!1},{family:"Archivo Black",category:"display",weights:[400],hasItalic:!1},{family:"Oswald",category:"display",weights:[200,300,400,500,600,700],hasItalic:!1},{family:"Caveat",category:"handwriting",weights:[400,500,600,700],hasItalic:!1},{family:"Pacifico",category:"handwriting",weights:[400],hasItalic:!1}],gA="https://cdn.jsdelivr.net/gh/rsms/inter@v4.1/docs/font-files/InterVariable.ttf",yA="https://cdn.jsdelivr.net/gh/rsms/inter@v4.1/docs/font-files/InterVariable-Italic.woff2";function bA(){let e=[100,200,300,400,500,600,700,800,900],t=e.map(o=>({kind:"variable",url:gA,weight:o,italic:!1})),n=e.map(o=>({kind:"variable",url:yA,weight:o,italic:!0}));return[...t,...n]}var Ph={inter:{reason:"Google\'s static Inter Thin/ExtraLight both carry usWeightClass=250 and near-identical glyph outlines (xAvgCharWidth differs by 1.8%); instancing the upstream variable font per weight produces properly distinct statics.",variants:bA()}};function OA(e){return Ph[e.toLowerCase()]}function Hp(e,t){let n=new Map,o=ic(e,t,n),i=[];for(let[a,s]of n)i.push({from:a,to:s});return{doc:o,substitutions:i}}function ic(e,t,n,o){if(e==null)return e;if(typeof e=="string")return o&&(yh.has(o)||bh.has(o))?Vp(e,t,n):e;if(Array.isArray(e))return e.map(i=>ic(i,t,n,o));if(typeof e=="object"){let i={};for(let[a,s]of Object.entries(e)){if(Oh.has(a)){i[a]=s;continue}if(o==="theme"&&a==="fonts"&&s&&typeof s=="object"){let c={};for(let[l,p]of Object.entries(s))if(typeof p=="string")c[l]=Vp(p,t,n);else if(p&&typeof p=="object"){let m=p.family;c[l]=typeof m=="string"?{...p,family:Vp(m,t,n)}:ic(p,t,n,l)}else c[l]=p;i[a]=c;continue}i[a]=ic(s,t,n,a)}return i}return e}function Vp(e,t,n){let o=e.trim();if(o.length===0||yo(o))return e;let i=o.toLowerCase();for(let[a,s]of Object.entries(t))if(a.toLowerCase()===i)return n.set(o,s),s;return e}var xA={Inter:"Calibri",Roboto:"Calibri","Open Sans":"Calibri",Lato:"Calibri","Source Sans 3":"Calibri","Source Sans Pro":"Calibri","IBM Plex Sans":"Calibri",Archivo:"Calibri",Geist:"Calibri","Space Grotesk":"Calibri","Work Sans":"Calibri",Manrope:"Calibri",Nunito:"Calibri","Nunito Sans":"Calibri",Poppins:"Calibri",Montserrat:"Calibri","Playfair Display":"Georgia",Merriweather:"Georgia","Source Serif 4":"Cambria","Source Serif Pro":"Cambria","IBM Plex Serif":"Cambria","Crimson Pro":"Cambria",Lora:"Georgia","PT Serif":"Georgia","Cormorant Garamond":"Cambria","JetBrains Mono":"Consolas","Fira Code":"Consolas","IBM Plex Mono":"Consolas","Source Code Pro":"Consolas","Roboto Mono":"Consolas","Geist Mono":"Consolas"},SA={sans:"Calibri",serif:"Georgia",mono:"Consolas",display:"Georgia",handwriting:"Segoe UI"};function $h(e){let t=e.trim();for(let[o,i]of Object.entries(xA))if(o.toLowerCase()===t.toLowerCase())return i;let n=Ch.find(o=>o.family.toLowerCase()===t.toLowerCase());if(n){let o=SA[n.category];if(o)return o}return"Calibri"}function Th(e){let t={};for(let n of e){let o=n.trim();o.length!==0&&(yo(o)||t[o]||(t[o]=$h(o)))}return t}function IA(e){if((e.fonts?.mode??"custom")==="custom"){if(!e.fonts)return{doc:e.doc,theme:e.theme,warnings:[]};let m=[...new Set([...Wo(e.doc),...Wo(e.theme)])].filter(f=>!yo(f.trim())),u=m.length>0?[{code:"FONT_MODE_CUSTOM",message:`Export mode "custom": non-safe font references (${m.join(", ")}) kept as-is. Recipients need these fonts installed locally; Word falls back to a generic substitute otherwise.`}]:[];return{doc:e.doc,theme:e.theme,warnings:u}}let n=new Set([...Wo(e.doc),...Wo(e.theme)]),i={...Th(n),...e.fonts?.substitution??{}},a=Hp(e.doc,i),s=Hp(e.theme,i),c=new Map;for(let p of a.substitutions)c.set(p.from,p.to);for(let p of s.substitutions)c.set(p.from,p.to);let l=[];if(c.size>0){let p=[...c].map(([m,u])=>`${m} \\u2192 ${u}`).join(", ");l.push({code:"FONT_MODE_SUBSTITUTED",message:`Export mode "substitute": rewrote non-safe families to safe equivalents \\u2014 ${p}. No fonts embedded; document renders identically on every machine.`})}return{doc:a.doc,theme:s.doc,warnings:l}}var wA=["primary","secondary","accent","accent4","accent5","accent6"],Ah=.75;function CA(e,t){return!Number.isFinite(e)||e<=0||t===void 0||!Number.isFinite(t)||t<=0?Ah:t/e}var PA=new Set(["georgia","times new roman","cambria"]),$A=new Set(["consolas","courier new","menlo","monaco"]);function Lh(e,t){let n=t==="serif"?"serif":t==="mono"?"monospace":t==="handwriting"?"cursive":t===void 0&&PA.has(e.toLowerCase())?"serif":t===void 0&&$A.has(e.toLowerCase())?"monospace":"sans-serif";return`"${e.replace(/["\\\\]/g,"\\\\$&")}", ${n}`}function TA(e){let t=new Map(Sh(e).map(n=>[n.family.toLowerCase(),n.category]));return n=>Lh(n,t.get(n.toLowerCase()))}function Ca(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ar(e,t){if(e!==void 0&&!Ca(e))return e;let n=Ca(e)?{...e}:{};for(let[o,i]of Object.entries(t)){if(i===void 0)continue;let a=n[o];a===void 0?n[o]=Ca(i)?ar(void 0,i):i:Ca(a)&&Ca(i)&&(n[o]=ar(a,i))}return n}function fh(e,t){return Array.isArray(e)?e.map(n=>ar(n,t)):ar(e,t)}function hh(e){return e===void 0?void 0:String(e)}function AA(e,t,n){let o=m=>`${Math.round(m/n*10)/10}px`,i=o(t.labelPt),a=o(t.sourcePt),s={fontSize:i,color:t.mutedColor},c={fontSize:a,color:t.mutedColor},l={fontSize:i,color:t.textColor,fontWeight:hh(t.labelWeight)},p={labels:{style:s},title:{style:s}};return{...e,chart:ar(e.chart,{style:{fontFamily:t.bodyFamily}}),title:ar(e.title,{style:{fontFamily:t.headingFamily,fontSize:o(t.titlePt),fontWeight:hh(t.titleWeight),color:t.textColor}}),subtitle:ar(e.subtitle,{style:s}),caption:ar(e.caption,{style:c}),xAxis:fh(e.xAxis,p),yAxis:fh(e.yAxis,p),legend:ar(e.legend,{itemStyle:l}),plotOptions:ar(e.plotOptions,{series:{dataLabels:{style:l}}}),credits:ar(e.credits,{style:c})}}var LA={ttf:{mime:"font/ttf",format:"truetype"},otf:{mime:"font/otf",format:"opentype"},woff:{mime:"font/woff",format:"woff"},woff2:{mime:"font/woff2",format:"woff2"}};function vh(e,t){let n=new Set(t.map(o=>o.toLowerCase()));return e.filter(o=>n.has(o.family.toLowerCase())).map(o=>{let{mime:i,format:a}=LA[o.format??"ttf"];return`@font-face{font-family:"${o.family.replace(/["\\\\]/g,"\\\\$&")}";font-weight:${o.weight};font-style:${o.italic?"italic":"normal"};src:url(data:${i};base64,${o.data}) format("${a}")}`}).join(`\n`)}function vA(e,t,n){let o=vh(t,n);if(!o)return e;let i=e.resources?.css;return{...e,resources:{...e.resources,css:i?`${o}\n${i}`:o}}}var Eh=["actionTitle","takeaway","source","tracker","footer"],Nh=r.Recursive(e=>r.Object({type:r.Union(["string","number","integer","boolean","object","array","component"].map(t=>r.Literal(t)),{description:"Content type accepted by this slot. Use component for a document component or registered plugin."}),description:r.Optional(r.String({description:"Explain this slot\\u2019s content and purpose to authors."})),required:r.Optional(r.Boolean({description:"Require a value when no default is provided. Defaults to false."})),default:r.Optional(r.Unknown({description:"Value used when the caller omits this slot. Must satisfy the slot\\u2019s type and constraints."})),enum:r.Optional(r.Array(r.Union([r.String(),r.Number(),r.Boolean()]),{minItems:1,description:"Allowed scalar values for this slot."})),minItems:r.Optional(r.Integer({minimum:0,description:"Minimum number of array entries, inclusive."})),maxItems:r.Optional(r.Integer({minimum:0,description:"Maximum number of array entries, inclusive."})),minLength:r.Optional(r.Integer({minimum:0,description:"Minimum string length in characters, inclusive."})),maxLength:r.Optional(r.Integer({minimum:0,description:"Maximum string length in characters, inclusive."})),minimum:r.Optional(r.Number({description:"Minimum numeric value, inclusive."})),maximum:r.Optional(r.Number({description:"Maximum numeric value, inclusive."})),maxWords:r.Optional(r.Integer({minimum:1,description:"Maximum whitespace-separated word count. Exceeding it fails validation."})),oneLine:r.Optional(r.Boolean({description:"Reject newline characters in string values. Does not prevent visual line wrapping."})),items:r.Optional({...e,description:"Slot type and constraints for each array entry."}),properties:r.Optional(r.Record(r.String(),e,{description:"Named child slots accepted by an object slot. Undeclared properties are rejected."})),role:r.Optional(r.Union(Eh.map(t=>r.Literal(t)),{description:"Content role for quality profiles: actionTitle, takeaway, source, tracker or footer. A profile may require or measure it; the theme only styles it."}))},{additionalProperties:!1}),{$id:"BlockSlot"}),kh=r.Unsafe(r.Object({description:r.Optional(r.String({description:"Describe what this reusable block renders and when to use it."})),slots:r.Record(r.String(),Nh,{description:"Named inputs and their types, defaults and constraints. Use an empty object for a block with no inputs."}),body:r.Array(r.Unknown(),{description:"Components and binding directives expanded in order when this block is invoked."}),section:r.Optional(r.Object({tracker:r.Optional(r.Unknown({description:"Section tracker value or binding, available to headers and footers through $context at /section/tracker."})),header:r.Optional(r.Array(r.Unknown(),{description:"Header component templates. Explicit header settings on the section take precedence."})),footer:r.Optional(r.Array(r.Unknown(),{description:"Footer component templates. Explicit footer settings on the section take precedence."})),pageBreak:r.Optional(r.Boolean({description:"Start the containing section on a new page. An explicit section pageBreak setting takes precedence."})),scope:r.Optional(r.Union([r.Literal("section"),r.Literal("following")],{description:"Apply header/footer templates to this section only, or inherit them in following sections. Defaults to section."}))},{additionalProperties:!1,description:"DOCX section tracker, header/footer templates and page-break behavior. Place this block at the section boundary."})),slide:r.Optional(r.Object({background:r.Optional(r.Unknown({description:"Slide background (color, gradient or image) or a binding. A background the slide states itself takes precedence."})),grid:r.Optional(r.Unknown({description:"Grid configuration merged over the presentation grid when resolving grid placements in this block\\u2019s body."})),notes:r.Optional(r.Unknown({description:"Speaker notes or a binding. Notes the slide states itself take precedence."}))},{additionalProperties:!1,description:"PPTX slide background, grid and notes supplied by this block. Invoke the block as a direct child of a slide."}))},{additionalProperties:!1})),Yr=r.Record(r.String({pattern:"^[a-zA-Z][a-zA-Z0-9_-]*$"}),kh,{description:"Document-local JSON block definitions. Names are not built into the engine."}),jn=r.Object({ref:r.String({minLength:1,description:"Name in this document\\u2019s props.blocks."}),slots:r.Optional(r.Record(r.String(),r.Unknown(),{description:"Input values keyed by the slot names declared in the referenced block definition."}))},{additionalProperties:!1});function sc(e){let{oneLine:t,properties:n,items:o,role:i,...a}=e;return delete a.required,delete a.maxWords,e.type==="component"?{type:"object",properties:{name:{type:"string"}},required:["name"],description:e.description}:{...a,...t&&{pattern:"^[^\\\\r\\\\n]*$"},...o&&{items:sc(o)},...n&&{properties:Object.fromEntries(Object.entries(n).map(([s,c])=>[s,sc(c)])),required:Object.entries(n).filter(([,s])=>s.required&&s.default===void 0).map(([s])=>s),additionalProperties:!1}}}var Jp={$slot:{keys:["$slot","default","props"],result:"dynamic"},$item:{keys:["$item","default","props"],result:"dynamic"},$theme:{keys:["$theme","default"],result:"dynamic"},$context:{keys:["$context","default"],result:"dynamic"},$count:{keys:["$count"],result:"number"},$if:{keys:["$if","then","else"],result:"dynamic"},$each:{keys:["$each","template"],result:"array"},$join:{keys:["$join","separator","keepEmpty"],result:"string"},$measure:{keys:["$measure","fraction","unit"],result:"number"}},Ta=class extends Error{constructor(e){super(e.map(t=>`${t.path}: ${t.message}`).join(`\n`)),this.issues=e,this.name="BlockEvaluationError"}},Y=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Oe=e=>e.replace(/~/g,"~0").replace(/\\//g,"~1"),wt=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function Rn(e,t){if(t==="")return e;if(!t.startsWith("/"))return;let n=e;for(let o of t.slice(1).split("/")){let i=o.replace(/~1/g,"/").replace(/~0/g,"~");if(!Y(n)&&!Array.isArray(n)||!wt(n,i))return;n=n[i]}return n}function wr(e,t){let n;for(let o of Object.keys(e))(t===o||t.startsWith(`${o}/`))&&(n===void 0||o.length>n.length)&&(n=o);return n===void 0?t:`${e[n]}${t.slice(n.length)}`}var Yp=["x","y","w","h","position","grid","gridConfig","direction","gap","weights","alignment","spacing"],Xp=e=>e.trim()===""?0:e.trim().split(/\\s+/).length,Kp=e=>e!=null&&e!==""&&e!==!1&&(!Array.isArray(e)||e.length>0),kn=(e,t,n)=>{throw new Ta([{path:e,code:t,message:n}])};function pc(e,t,n,o){let i=t===void 0&&e.default!==void 0?structuredClone(e.default):t;if(i===void 0){e.required&&o.push({path:n,code:"block_required_slot",message:"Required block slot is missing."});return}if(!(e.type==="array"?Array.isArray(i):e.type==="component"?Y(i)&&typeof i.name=="string":e.type==="object"?Y(i):e.type==="integer"?typeof i=="number"&&Number.isInteger(i):typeof i===e.type&&(typeof i!="number"||Number.isFinite(i))))return o.push({path:n,code:"block_slot_type",message:`Expected ${e.type}.`}),i;let s=c=>o.push({path:n,code:"block_slot_budget",message:c});if(e.enum&&!e.enum.includes(i)&&s("Value is not one of the declared choices."),typeof i=="string"&&(e.oneLine&&/[\\r\\n]/.test(i)&&s("Slot must contain one line."),e.minLength!==void 0&&i.length<e.minLength&&s(`Minimum length is ${e.minLength}.`),e.maxLength!==void 0&&i.length>e.maxLength&&s(`Maximum length is ${e.maxLength}.`),e.maxWords!==void 0&&Xp(i)>e.maxWords&&s(`Maximum word count is ${e.maxWords}.`)),typeof i=="number"&&(e.minimum!==void 0&&i<e.minimum&&s(`Minimum value is ${e.minimum}.`),e.maximum!==void 0&&i>e.maximum&&s(`Maximum value is ${e.maximum}.`)),Array.isArray(i))return e.minItems!==void 0&&i.length<e.minItems&&s(`Minimum item count is ${e.minItems}.`),e.maxItems!==void 0&&i.length>e.maxItems&&s(`Maximum item count is ${e.maxItems}.`),e.items?i.map((c,l)=>pc(e.items,c,`${n}/${l}`,o)):i;if(e.type==="component"&&Y(i)){let c=(l,p,m=0)=>{if(m>64){o.push({path:p,code:"block_expansion_limit",message:"Component slot exceeds 64 levels."});return}if(Array.isArray(l)){l.forEach((f,x)=>c(f,`${p}/${x}`,m+1));return}if(!Y(l))return;let u=typeof l.name=="string"&&Y(l.props)?l.props:{};for(let f of Yp)wt(u,f)&&o.push({path:`${p}/props/${f}`,code:"block_slot_placement",message:"Block placement belongs in the definition, not in a component slot."});for(let[f,x]of Object.entries(l))c(x,`${p}/${Oe(f)}`,m+1)};c(i,n)}return e.type==="object"&&Y(i)&&e.properties?Zp(e.properties,i,n,o):i}function Zp(e,t,n,o){let i={};for(let a of Object.keys(t))wt(e,a)||o.push({path:`${n}/${Oe(a)}`,code:"block_unknown_slot",message:`Unknown slot \'${a}\'. Expected: ${Object.keys(e).join(", ")}.`});for(let[a,s]of Object.entries(e)){let c=pc(s,wt(t,a)?t[a]:void 0,`${n}/${Oe(a)}`,o);c!==void 0&&Object.defineProperty(i,a,{value:c,enumerable:!0,writable:!0,configurable:!0})}return i}var EA=Object.fromEntries(Object.entries(Jp).map(([e,t])=>[e,t.keys]));function NA(e,t){let n={type:"object",properties:e};for(let o of t.slice(1).split("/")){let i=o.replace(/~1/g,"/").replace(/~0/g,"~");if(n?.type==="object"){if(!n.properties)return{type:"object"};n=wt(n.properties,i)?n.properties[i]:void 0}else if(n?.type==="array"&&/^(0|[1-9]\\d*)$/.test(i))n=n.items??{type:"object"};else return n?.type==="component"?{type:"object"}:void 0}return n}function Pa(e,t,n,o,i=!1,a=0){if(a>64){o.push({path:t,code:"block_depth",message:"Definition exceeds 64 levels."});return}if(Array.isArray(e)){e.forEach((c,l)=>Pa(c,`${t}/${l}`,n,o,i,a+1));return}if(!Y(e))return;let s=Object.keys(e).filter(c=>c.startsWith("$"));if(s.length){let c=s[0],l=EA[c];if(!l||s.length!==1||Object.keys(e).some(p=>!l.includes(p))){o.push({path:t,code:"block_invalid_binding",message:"Unknown or malformed block directive."});return}if(["$slot","$item","$theme","$context","$if","$each","$count"].includes(c)){let p=e[c];if(typeof p!="string"||p!==""&&!p.startsWith("/"))o.push({path:t,code:"block_invalid_binding",message:"Bindings use JSON Pointers, e.g. /title."});else if(["$slot","$if","$each","$count"].includes(c)){let m=NA(n,p);m?["$each","$count"].includes(c)&&m.type!=="array"&&o.push({path:t,code:"block_invalid_binding",message:`${c} requires an array slot.`}):o.push({path:t,code:"block_unknown_binding",message:`No slot field \'${p}\' is declared.`})}c==="$item"&&!i&&o.push({path:t,code:"block_invalid_binding",message:"$item is only available inside $each."}),(c==="$slot"||c==="$item")&&wt(e,"props")&&!Y(e.props)&&o.push({path:`${t}/props`,code:"block_invalid_binding",message:"props must be an object of component props merged beneath a component-slot value."})}c==="$join"&&e.keepEmpty!==void 0&&typeof e.keepEmpty!="boolean"&&o.push({path:t,code:"block_invalid_binding",message:"keepEmpty must be boolean."}),c==="$if"&&!wt(e,"then")&&o.push({path:t,code:"block_invalid_binding",message:"$if requires then."}),c==="$each"&&(!wt(e,"template")||Array.isArray(e.template))&&o.push({path:t,code:"block_invalid_binding",message:"$each requires one template value; use a group for multiple flow children."}),c==="$join"&&(!Array.isArray(e.$join)||e.separator!==void 0&&typeof e.separator!="string")&&o.push({path:t,code:"block_invalid_binding",message:"$join requires an array and an optional string separator."}),c==="$measure"&&(!["width","height"].includes(String(e.$measure))||!["pt","twip","in"].includes(String(e.unit??"pt"))||e.fraction!==void 0&&(typeof e.fraction!="number"||e.fraction<0||e.fraction>1))&&o.push({path:t,code:"block_invalid_binding",message:"$measure requires width/height, pt/twip/in and a fraction between 0 and 1."})}for(let[c,l]of Object.entries(e))c.startsWith("$")&&c!=="$join"||Pa(l,`${t}/${Oe(c)}`,n,o,i||wt(e,"$each"),a+1)}function Xr(e){return(Y(e)&&Y(e.props)?e.props.blocks:void 0)??{}}function mc(e,t,n=[]){if(!$.Check(Yr,e))return[...$.Errors(Yr,e)].slice(0,100).map(i=>({path:`/props/blocks${i.path}`,code:"block_invalid_definition",message:i.message}));let o=[];for(let[i,a]of Object.entries(e)){let s=`/props/blocks/${Oe(i)}`;n.includes(i)&&o.push({path:s,code:"block_name_collision",message:`Block \'${i}\' conflicts with a registered component.`}),t!=="docx"&&a.section&&o.push({path:`${s}/section`,code:"block_format",message:"Section effects are DOCX-only."}),t!=="pptx"&&a.slide&&o.push({path:`${s}/slide`,code:"block_format",message:"Slide effects are PPTX-only."});let c=(l,p)=>{l.default!==void 0&&pc(l,l.default,`${p}/default`,o);for(let[m,u]of[["minItems","maxItems"],["minLength","maxLength"],["minimum","maximum"]])l[m]!==void 0&&l[u]!==void 0&&l[m]>l[u]&&o.push({path:p,code:"block_invalid_definition",message:`${m} exceeds ${u}.`});l.items&&c(l.items,`${p}/items`);for(let[m,u]of Object.entries(l.properties??{}))c(u,`${p}/properties/${Oe(m)}`)};for(let[l,p]of Object.entries(a.slots))c(p,`${s}/slots/${Oe(l)}`);Pa(a.body,`${s}/body`,a.slots,o),a.section&&Pa(a.section,`${s}/section`,a.slots,o),a.slide&&Pa(a.slide,`${s}/slide`,a.slots,o)}return o}function Ho(e,t,n,o=[]){let i=mc(t,n,o);if(i.length)return i;let a=(s,c)=>{if(Array.isArray(s)){s.forEach((l,p)=>a(l,`${c}/${p}`));return}if(!(!Y(s)||s.enabled===!1)){if(s.name==="block"&&Y(s.props)&&typeof s.props.ref=="string"){let l=wt(t,s.props.ref)?t[s.props.ref]:void 0;l?((s.props.slots===void 0||Y(s.props.slots))&&Zp(l.slots,s.props.slots??{},`${c}/props/slots`,i),l.section&&!/^\\/children\\/\\d+\\/children\\/\\d+$/.test(c)&&i.push({path:c,code:"invalid_placement",message:"A block with section effects must be a direct child of a top-level section."}),l.slide&&!/^\\/children\\/\\d+\\/children\\/\\d+$/.test(c)&&i.push({path:c,code:"invalid_placement",message:"A block with slide effects must be a direct child of a slide."})):i.push({path:`${c}/props/ref`,code:"block_unknown_reference",message:`Block \'${s.props.ref}\' is not defined in this document.`})}for(let[l,p]of Object.entries(s))c==="/props"&&l==="blocks"||a(p,`${c}/${Oe(l)}`)}};return a(e,""),i}var kA=class{constructor(e,t){j(this,"sourceMap",{});j(this,"blocks",[]);j(this,"nodes",0);this.definitions=e,this.options=t;let n=mc(e,t.format,t.reservedNames);if(n.length)throw new Ta(n)}guard(e,t){(t>64||++this.nodes>5e4)&&kn(e,"block_expansion_limit","Block expansion exceeds the depth/node limit (64/50000).")}evaluate(e,t,n,o,i=0){if(this.guard(t.source,i),this.sourceMap[n]=t.source,Array.isArray(e)){let s=[];return e.forEach((c,l)=>{let p=this.evaluate(c,t,`${n}/${s.length}`,`${o}/${l}`,i+1);if(p!==void 0)if(Y(c)&&("$if"in c||"$each"in c)&&Array.isArray(p)){let m=`${n}/${s.length}`,u=Object.entries(this.sourceMap).filter(([f])=>f.startsWith(`${m}/`));for(let[f]of u)delete this.sourceMap[f];for(let[f,x]of u){let S=f.slice(m.length+1),[C,...O]=S.split("/");this.sourceMap[`${n}/${s.length+Number(C)}${O.length?"/"+O.join("/"):""}`]=x}s.push(...p)}else s.push(p)}),s}if(!Y(e))return e;if("$slot"in e||"$item"in e||"$theme"in e||"$context"in e){let s=["$slot","$item","$theme","$context"].find(u=>u in e),c=e[s],l=s==="$slot"?t.slots:s==="$item"?t.item:s==="$theme"?this.options.theme:t.context,p=Rn(l,c);s==="$slot"&&(this.sourceMap[n]=t.slotSources?wr(t.slotSources,c):`${t.source}/props/slots${c}`),s==="$item"&&(this.sourceMap[n]=`${t.itemSource??t.source}${c}`),s==="$context"&&(this.sourceMap[n]=wr(t.contextSources??{},c)===c?t.source:wr(t.contextSources??{},c));let m=p!==void 0?structuredClone(p):void 0;if(m===void 0&&wt(e,"default")&&(m=this.evaluate(e.default,t,n,`${o}/default`,i+1)),m===void 0&&s==="$theme")return kn(o,"block_unknown_theme_binding",`Theme value \'${c}\' is missing; declare a fallback or use an existing token.`);if((s==="$slot"||s==="$item")&&wt(e,"props")&&Y(m)&&typeof m.name=="string"){let u=this.sourceMap[n],f=this.evaluate(e.props,t,`${n}/props`,`${o}/props`,i+1),x=Y(m.props)?m.props:{};for(let S of Object.keys(x)){let C=`${n}/props/${Oe(S)}`;for(let O of Object.keys(this.sourceMap))(O===C||O.startsWith(`${C}/`))&&delete this.sourceMap[O];this.sourceMap[C]=`${u}/props/${Oe(S)}`}m={...m,props:{...Y(f)?f:{},...x}}}return m}if("$if"in e)return this.evaluate(Kp(Rn(t.slots,e.$if))?e.then:e.else,t,n,o,i+1);if("$count"in e){let s=Rn(t.slots,e.$count);return Array.isArray(s)?s.length:kn(`${t.source}/props/slots${e.$count}`,"block_slot_type","$count requires an array slot.")}if("$each"in e){let s=Rn(t.slots,e.$each);if(!Array.isArray(s))return kn(`${t.source}/props/slots${e.$each}`,"block_slot_type","$each requires an array slot.");let c=[];return s.forEach((l,p)=>{let m=`${n}/${c.length}`,u=this.evaluate(e.template,{...t,item:l,itemSource:t.slotSources?wr(t.slotSources,`${e.$each}/${p}`):`${t.source}/props/slots${e.$each}/${p}`},m,`${o}/template`,i+1);if(u!==void 0)c.push(u);else for(let f of Object.keys(this.sourceMap))(f===m||f.startsWith(`${m}/`))&&delete this.sourceMap[f]}),c}if("$join"in e){let s=e.$join.map((l,p)=>this.evaluate(l,t,`${n}/${p}`,`${o}/$join/${p}`,i+1)),c=s.findIndex(Kp);return c>=0&&(this.sourceMap[n]=this.sourceMap[`${n}/${c}`]),(e.keepEmpty===!0?s:s.filter(Kp)).map(l=>String(l??"")).join(String(e.separator??""))}if("$measure"in e)return this.options.measure?this.options.measure(e.$measure,e.unit??"pt",t.context)*Number(e.fraction??1):kn(o,"block_unsupported_operation","This format does not support $measure.");let a={};for(let[s,c]of Object.entries(e)){let l=this.evaluate(c,t,`${n}/${Oe(s)}`,`${o}/${Oe(s)}`,i+1);l!==void 0&&Object.defineProperty(a,s,{value:l,enumerable:!0,configurable:!0,writable:!0})}return a}expand(e,t="",n=0){if(this.guard(t,n),Array.isArray(e))return e.map((i,a)=>this.expand(i,`${t}/${a}`,n+1));if(!Y(e))return e;if(e.name==="block"&&e.enabled!==!1){if(!Y(e.props)||typeof e.props.ref!="string")return kn(t,"block_invalid_invocation","A block requires props.ref and optional props.slots.");if(Object.keys(e.props).some(f=>!["ref","slots"].includes(f))||e.props.slots!==void 0&&!Y(e.props.slots))return kn(t,"block_invalid_invocation","Block props accept only ref and an object of slots.");let i=wt(this.definitions,e.props.ref)?this.definitions[e.props.ref]:void 0;if(!i)return kn(`${t}/props/ref`,"block_unknown_reference",`Block \'${e.props.ref}\' is not defined in this document.`);let a=[],s=wr(this.sourceMap,t),c=`${t}/props/slots`,l=Zp(i.slots,e.props.slots??{},c,a);if(a.length)throw new Ta(a.map(f=>({...f,path:wr(this.sourceMap,f.path)})));let p=Object.fromEntries([["",wr(this.sourceMap,c)],...Object.entries(this.sourceMap).filter(([f])=>f.startsWith(`${c}/`)).map(([f,x])=>[f.slice(c.length),x])]),m={slots:l,slotSources:p,source:s,definition:`/props/blocks/${Oe(e.props.ref)}`,context:this.options.contextAt?.(t)??this.options.context??{},contextSources:this.options.contextSources};i.section&&this.options.onSection?.({settings:i.section,environment:m,path:t}),i.slide&&this.options.onSlide?.({settings:i.slide,environment:m,path:t}),this.blocks.push(s);let u=this.evaluate(i.body,m,`${t}/children`,`${m.definition}/body`,n+1);return{name:"group",...e.id!==void 0&&{id:e.id},children:this.expand(u,`${t}/children`,n+1)}}if(e.enabled===!1)return{...e};let o={...e};for(let[i,a]of Object.entries(e))t==="/props"&&i==="blocks"||Object.defineProperty(o,i,{value:this.expand(a,`${t}/${Oe(i)}`,n+1),enumerable:!0,configurable:!0,writable:!0});return o}};function Qp(e){return{type:"object",additionalProperties:!1,properties:Object.fromEntries(Object.entries(e.slots).map(([t,n])=>[t,sc(n)])),required:Object.entries(e.slots).filter(([,t])=>t.required&&t.default===void 0).map(([t])=>t)}}function RA(e){let t=Xr(e);if(!$.Check(Yr,t))return{definitions:[],invocations:[],invalidDefinitions:!0};let n=[],o=(i,a)=>{if(Array.isArray(i)){i.forEach((s,c)=>o(s,`${a}/${c}`));return}if(Y(i)){i.name==="block"&&Y(i.props)&&typeof i.props.ref=="string"&&n.push({ref:i.props.ref,path:a,slotsPath:`${a}/props/slots`,defined:Object.prototype.hasOwnProperty.call(t,i.props.ref)});for(let[s,c]of Object.entries(i))a==="/props"&&s==="blocks"||o(c,`${a}/${Oe(s)}`)}};return o(e,""),{definitions:Object.entries(t).map(([i,a])=>({name:i,definitionPointer:`/props/blocks/${Oe(i)}`,definition:a,slotsSchema:Qp(a)})),invocations:n,invalidDefinitions:!1}}function Rh(e,t,n){let o=Xr(e);for(let i of t){let a=Rn(e,i);if(!Y(a)||!Y(a.props)||typeof a.props.ref!="string")continue;let s=a.props.ref,c=o[s];if(!c)continue;let l=(p,m,u,f)=>{if(n(s,p,m,u,f),Y(m)&&p.properties)for(let[x,S]of Object.entries(p.properties))l(S,Rn(m,`/${Oe(x)}`),`${u}/${Oe(x)}`,`${f}.${x}`);Array.isArray(m)&&p.items&&m.forEach((x,S)=>l(p.items,x,`${u}/${S}`,f))};for(let[p,m]of Object.entries(c.slots)){let u=Rn(a.props.slots,`/${Oe(p)}`);l(m,u===void 0&&m.default!==void 0?m.default:u,`${i}/props/slots/${Oe(p)}`,p)}}}function jA(e,t){let n=[];return Rh(e,t,(o,i,a,s,c)=>{typeof a=="string"&&i.maxWords!==void 0&&n.push({block:o,slot:c,path:s,words:Xp(a),maxWords:i.maxWords})}),n}function FA(e,t){let n=[];return Rh(e,t,(o,i,a,s,c)=>{i.role&&n.push({block:o,invocation:s.replace(/\\/props\\/slots\\/.*$/,""),slot:c,role:i.role,path:s,value:a})}),n}var Gp=["null","boolean","number","string","array","object"],qo=(e,t)=>new Set([...e].filter(n=>t.has(n))),UA=e=>new Set(e.flatMap(t=>[...t])),gh=e=>e===null?"null":Array.isArray(e)?"array":typeof e;function $a(e,t,n=new Set){if(e===!1)return new Set;if(e===!0||n.has(e))return new Set(Gp);let o=e.not;if(o===!0||o&&typeof o=="object"&&Object.keys(o).length===0)return new Set;let i=new Set(n).add(e),a=new Set(Gp);if(e.type){let s=Array.isArray(e.type)?e.type:[e.type];a=qo(a,new Set(Gp.filter(c=>s.includes(c)||c==="number"&&s.includes("integer"))))}if(Object.hasOwn(e,"const")&&(a=qo(a,new Set([gh(e.const)]))),Array.isArray(e.enum)&&(a=qo(a,new Set(e.enum.map(gh)))),typeof e.$ref=="string"){let s=t(e.$ref);s!==void 0&&(a=qo(a,$a(s,t,i)))}for(let s of["anyOf","oneOf"])Array.isArray(e[s])&&(a=qo(a,UA(e[s].map(c=>$a(c,t,i)))));if(Array.isArray(e.allOf))for(let s of e.allOf)a=qo(a,$a(s,t,i));if(o&&typeof o=="object"&&o.type&&Object.keys(o).every(s=>["type","description","title","$comment"].includes(s))){let s=(Array.isArray(o.type)?o.type:[o.type]).filter(c=>c!=="integer");a=new Set([...a].filter(c=>!s.includes(c)))}return a}function ac(e,t,n=new Set){if(e===!1)return!1;if(e===!0||n.has(e))return{};let o=new Set(n).add(e),i=[];if(typeof e.$ref=="string"){let a=t(e.$ref);a!==void 0&&i.push(ac(a,t,o))}e.items!==void 0&&i.push(Array.isArray(e.items)?{anyOf:[...e.items,...e.additionalItems===!1?[]:[e.additionalItems??{}]]}:e.items);for(let a of["anyOf","oneOf"])Array.isArray(e[a])&&i.push({anyOf:e[a].filter(s=>$a(s,t).has("array")).map(s=>ac(s,t,o))});return Array.isArray(e.allOf)&&i.push(...e.allOf.map(a=>ac(a,t,o))),i.length===0?{}:i.length===1?i[0]:{allOf:i}}var zo=(e,t)=>({type:"object",properties:e,required:t,additionalProperties:!1}),tc=e=>({type:"string",pattern:"^(|/.*)$",description:e}),DA=e=>({$slot:"Read a named input slot by JSON Pointer, e.g. /title or /client/name.",$item:"Read the current $each entry by JSON Pointer. Use an empty string for the whole entry or /title for a property.",$theme:"Read the active theme by JSON Pointer, e.g. /colors/primary. A missing value requires a default.",$context:e==="pptx"?"Read deck or slide context by JSON Pointer, e.g. /document/title, /slide/width or /slide/index.":"Read document or section context by JSON Pointer, e.g. /document/title or /section/tracker."}),MA=e=>e==="pptx"?{axis:"Measure the slide canvas width or height, in the unit given.",unit:"Measurement unit: points, twentieths of a point, or inches. Defaults to pt; use in for frame coordinates."}:{axis:"Measure the usable page width or height after margins, using the containing section\\u2019s page settings.",unit:"Measurement unit: points, twentieths of a point, or inches. Defaults to pt."},rc=(e,t)=>({...typeof e=="boolean"?{allOf:[e]}:e,description:t}),qp=e=>typeof e=="boolean"?{}:{...e.description&&{description:e.description},...e.markdownDescription&&{markdownDescription:e.markdownDescription}},BA=e=>({type:"object",required:[e]}),nc=Object.keys(Jp);function Ea(e,t,n=[],o="docx"){let i=`BlockTemplate_${t}`,a=DA(o),s=MA(o),c=`${i}_Body`,l=P=>({$ref:`#/definitions/${P}`});if(e[c])return l(c);let p={...e},m=p[t];p[t]={...m,anyOf:(m.anyOf??[m]).filter(P=>!n.includes(P.properties?.name?.const))};let u=P=>{if(!P.startsWith("#/definitions/"))return;let Q=p;for(let Ie of P.slice(14).split("/")){let Le=Ie.replace(/~1/g,"/").replace(/~0/g,"~");if(!Q||typeof Q!="object"||!Object.hasOwn(Q,Le))return;Q=Q[Le]}return typeof Q=="boolean"||Q&&typeof Q=="object"?Q:void 0},f=new Map,x=new Map,S=0,C=l(t),O=new Map,A=P=>{let Q=JSON.stringify(P),Ie=O.get(Q);return Ie||(Ie=`${i}_Shared${S++}`,O.set(Q,Ie),e[Ie]=P),l(Ie)},I=Object.fromEntries(nc.map(P=>[P,A(BA(P))])),R=A({anyOf:Object.values(I)}),G=[...new Set(["",...nc.flatMap(P=>Array.from({length:P.length-1},(Q,Ie)=>P.slice(0,Ie+1)))])],ze=A({type:"object",propertyNames:{pattern:`^(?:${G.map(P=>P.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")).join("|")})$`}});function Te(P){if(typeof P=="boolean")return P;let Q=JSON.stringify(P),Ie=x.get(Q);if(Ie)return{...l(Ie),...qp(P)};let Le=`${i}_Literal${S++}`;x.set(Q,Le),e[Le]={};let ft={...P};if(typeof P.$ref=="string"){let pe=u(P.$ref);if(pe!==void 0){let we=Te(pe);typeof we=="object"?ft.$ref=we.$ref:(delete ft.$ref,we||(ft.not={}))}}P.properties&&(ft.properties=Object.fromEntries(Object.entries(P.properties).map(([pe,we])=>[pe,["name","version"].includes(pe)&&typeof we=="object"&&typeof we.const=="string"?we:Ae(we)]))),P.patternProperties&&(ft.patternProperties=Object.fromEntries(Object.entries(P.patternProperties).map(([pe,we])=>[pe,Ae(we)]))),P.items!==void 0&&(ft.items=Array.isArray(P.items)?P.items.map(pe=>Ae(pe,!0)):Ae(P.items,!0));for(let pe of["additionalProperties","additionalItems"])typeof P[pe]=="object"&&(ft[pe]=Ae(P[pe],pe==="additionalItems"));for(let pe of["anyOf","oneOf","allOf"])Array.isArray(P[pe])&&(ft[pe]=P[pe].map(we=>{let Wt=Te(we);return typeof we=="object"&&typeof we.properties?.name?.const=="string"&&typeof Wt=="object"&&Wt.$ref?e[Wt.$ref.slice(14)]:Wt}));for(let pe of["then","else"])P[pe]!==void 0&&(ft[pe]=Te(P[pe]));return e[Le]=ft,{...l(Le),...qp(P)}}function Ae(P,Q=!1){if(P===!1)return!1;let Ie=qp(P),Le=typeof P=="object"?{...P}:P;typeof Le=="object"&&(delete Le.description,delete Le.markdownDescription);let ft=`${Q?"sequence":"value"}:${JSON.stringify(Le)}`,pe=f.get(ft);if(pe)return{...l(pe),...Ie};let we=`${i}_Value${S++}`;f.set(ft,we),e[we]={};let Wt=l(we),Vu=$a(Le,u);if(Vu.size===0)return e[we]={allOf:[Te(Le)]},Wt;let Ku=()=>Q?Ae(Le):Wt,Gu=()=>Q?{anyOf:[Wt,{type:"array",items:Wt}]}:Wt,lb=()=>Q?Ku():Ae(ac(Le,u)),pr={};for(let ye of nc){let Gn=Jp[ye].result;if(!(Gn!=="dynamic"&&!Vu.has(Gn)&&!(Q&&Gn==="array")))switch(ye){case"$slot":case"$item":case"$theme":case"$context":pr[ye]=zo({[ye]:tc(a[ye]),default:rc(Ku(),"Fallback value or binding used only when the referenced value is missing. Null, false and empty values do not trigger it."),...ye==="$slot"||ye==="$item"?{props:{type:"object",description:"Component props merged beneath a component-slot value. Put placement (x, y, w, h, grid) and styling defaults here; the slot content may override styling but never placement."}}:{}},[ye]);break;case"$if":pr[ye]=zo({$if:tc("Test a slot by JSON Pointer, e.g. /subtitle. Missing, null, false, empty text and empty arrays select else; zero selects then."),then:rc(Gu(),"Value or components to emit when the slot tested by $if is present."),else:rc(Gu(),"Value or components to emit otherwise. Omit to produce no output.")},["$if","then"]);break;case"$each":pr[ye]=zo({$each:tc("Repeat template for each entry in an array slot, e.g. /items. Read the current entry with $item."),template:rc(lb(),"One template evaluated per array entry. Use $item for the current entry and a group for multiple components.")},["$each","template"]);break;case"$count":pr[ye]=zo({$count:tc("Return the number of entries in an array slot, e.g. /items.")},["$count"]);break;case"$join":pr[ye]=zo({$join:{type:"array",items:Ae({}),description:"Evaluate these values or bindings and join them as text. Empty values are skipped unless keepEmpty is true."},separator:{type:"string",description:"Text inserted between joined values. Defaults to an empty string."},keepEmpty:{type:"boolean",description:"Keep missing, null, false, empty text and empty arrays in the join. Defaults to false."}},["$join"]);break;case"$measure":pr[ye]=zo({$measure:{enum:["width","height"],description:s.axis},fraction:{type:"number",minimum:0,maximum:1,description:"Fraction of the measured dimension, from 0 to 1. Defaults to 1."},unit:{enum:["pt","twip","in"],description:s.unit}},["$measure"]);break;default:{let al=ye;throw new Error(`Missing authoring schema for directive ${al}`)}}}return e[we]={allOf:[{if:R,then:{allOf:nc.map(ye=>({if:I[ye],then:pr[ye]?A({...pr[ye],properties:Object.fromEntries(Object.entries(pr[ye].properties).map(([Gn,al])=>[Gn,A(al)]))}):!1}))},else:Te(Le)},{if:ze,then:{properties:Object.fromEntries(Object.entries(pr).map(([ye,Gn])=>[ye,A(Gn.properties[ye])]))}}]},{...Wt,...Ie}}return e[c]=Ae(C,!0),l(c)}async function _A(e,t,n){let o=n.preserve??new Set,i=0,a=async(s,c,l)=>{if(l>64||++i>1e5)throw new Ta([{path:wr(e.sourceMap,c),code:"block_expansion_limit",message:"Combined plugin/block expansion exceeds depth/node limits (64/100000)."}]);if(Array.isArray(s)){let u=[];for(let f=0;f<s.length;f++)u.push(await a(s[f],`${c}/${f}`,l+1));return{standard:u.map(f=>f.standard),preserved:u.map(f=>f.preserved)}}if(!Y(s)||s.enabled===!1)return{standard:s,preserved:s};if(s.name==="block")return a(e.expand(s,c,l),c,l+1);let p={...s},m={...s};for(let[u,f]of Object.entries(s)){if(c==="/props"&&u==="blocks")continue;let x=await a(f,`${c}/${u}`,l+1);Object.defineProperty(p,u,{value:x.standard,enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(m,u,{value:x.preserved,enumerable:!0,configurable:!0,writable:!0})}if(typeof s.name=="string"&&n.plugins.has(s.name)){let u=wr(e.sourceMap,c),f=await n.render(p,u);e.sourceMap[`${c}/children`]=u;let x=await a(f,`${c}/children`,l+1);return{standard:{name:"group",children:x.standard},preserved:o.has(s.name)?s:{name:"group",children:x.preserved}}}return{standard:p,preserved:m}};return a(t,"",0)}var em=e=>JSON.parse(JSON.stringify(e));function zp(e,t,n){if(e!==void 0&&t!==void 0)return e===t?`${e} ${n}`:`${e}\\u2013${t} ${n}`;if(e!==void 0)return`at least ${e} ${n}`;if(t!==void 0)return`at most ${t} ${n}`}function jh(e){let t=[];e.required&&e.default===void 0&&t.push("Required"),e.default!==void 0&&t.push(`Default: \\`${JSON.stringify(e.default)}\\``),e.type==="component"&&t.push("A component; placement stays in the definition"),e.enum&&t.push(`One of ${e.enum.map(a=>`\\`${JSON.stringify(a)}\\``).join(", ")}`);let n=zp(e.minLength,e.maxLength,"characters");n&&t.push(n),e.maxWords!==void 0&&t.push(`at most ${e.maxWords} words`),e.oneLine&&t.push("one line");let o=zp(e.minimum,e.maximum,"");o&&t.push(o.trim());let i=zp(e.minItems,e.maxItems,"entries");return i&&t.push(i),e.role&&t.push(`Role: ${e.role}`),t}function Fh(e){return[e.description,jh(e).join(" \\xB7 ")].filter(Boolean).join(`\n\n`)}function cc(e,t){let n;if(e.type==="component")n=t?{allOf:[t,{properties:{props:{propertyNames:{not:{enum:[...Yp]},errorMessage:"Block placement belongs in the definition, not in a component slot."}}}}]}:{type:"object",properties:{name:{type:"string"}},required:["name"]};else{let{oneLine:i,properties:a,items:s,...c}=e;for(let l of["role","required","maxWords","description"])delete c[l];n={...c},i&&(n.pattern="^[^\\\\r\\\\n]*$"),s&&(n.items=cc(s,t)),a&&(n.properties=Object.fromEntries(Object.entries(a).map(([l,p])=>[l,cc(p,t)])),n.required=Object.entries(a).filter(([,l])=>l.required&&l.default===void 0).map(([l])=>l),n.additionalProperties=!1)}e.description&&(n.description=e.description);let o=Fh(e);return o&&(n.markdownDescription=o),n}function Uh(e,t){return{type:"object",additionalProperties:!1,description:"Input values keyed by the slot names declared in the referenced block definition.",properties:Object.fromEntries(Object.entries(e.slots).map(([n,o])=>[n,cc(o,t)])),required:Object.entries(e.slots).filter(([,n])=>n.required&&n.default===void 0).map(([n])=>n)}}function Dh(e,t){let n=Object.keys(e),o={type:"object",additionalProperties:!1,required:["ref"],properties:{ref:{type:"string",minLength:1,description:"Name in this document\\u2019s props.blocks.",...n.length&&{anyOf:n.map(i=>({const:i,type:"string",description:e[i].description??`Block "${i}", defined in this document.`}))}},slots:{type:"object",description:"Input values keyed by the slot names declared in the referenced block definition."}}};return n.length&&(o.allOf=n.map(i=>({if:{properties:{ref:{const:i}},required:["ref"]},then:{properties:{slots:Uh(e[i],t)}}}))),o}function VA(e,t,n){for(let o of n){let i=e.definitions?.[o.name];if(!i)continue;let a=Dh(t,o.componentRef),s=new Set,c=l=>{if(!l||typeof l!="object"||s.has(l))return;if(s.add(l),Array.isArray(l)){l.forEach(c);return}let p=l;if(p.properties?.name?.const==="block"&&p.properties.props){p.properties.props=em(a);return}for(let[m,u]of Object.entries(p))m!=="$ref"&&c(u)};c(i)}}function lc(e,t){if(Array.isArray(e)){e.forEach(n=>lc(n,t));return}if(Y(e)){e.name==="block"&&Y(e.props)&&typeof e.props.ref=="string"&&t(e.props.ref,e);for(let n of Object.values(e))lc(n,t)}}function Mh(e,t){let n=[],o=new Set([t]),i=a=>{let s=Object.prototype.hasOwnProperty.call(e,a)?e[a]:void 0;s&&lc([s.body,s.section,s.slide],c=>{o.has(c)||(o.add(c),Object.prototype.hasOwnProperty.call(e,c)&&(i(c),n.push(c)))})};return i(t),n}function Bh(e,t,n){if(e.default!==void 0)return em(e.default);if(e.enum?.length)return e.enum[0];switch(e.type){case"string":return t;case"number":case"integer":{let o=e.minimum??0;return e.maximum!==void 0&&e.maximum<o?e.maximum:o}case"boolean":return!0;case"array":{let o=Math.min(Math.max(3,e.minItems??0),e.maxItems??Number.POSITIVE_INFINITY),i=e.items??{type:"string"};return Array.from({length:o},(a,s)=>Bh(i,`${t} ${s+1}`,n))}case"object":return _h(e.properties??{},n);case"component":return n==="docx"?{name:"paragraph",props:{text:t}}:{name:"text",props:{text:t}};default:return t}}function _h(e,t){return Object.fromEntries(Object.entries(e).filter(([,n])=>n.required&&n.default===void 0||n.role).map(([n,o])=>[n,Bh(o,n,t)]))}function Vh(e,t,n){let o;if(Y(n.document)){let i=Object.fromEntries(Object.entries(n.document).filter(([a])=>a!=="props"));lc(i,(a,s)=>{if(o||a!==e)return;let c=s.props;o={name:"block",props:{ref:a,...Y(c.slots)&&{slots:em(c.slots)}}}})}return o??{name:"block",props:{ref:e,slots:_h(t.slots,n.format)}}}function KA(e,t){let n=Xr(e);return!$.Check(Yr,n)||mc(n,t.format).length>0?[]:Object.entries(n).map(([o,i])=>({name:o,format:t.format,template:t.template,definitionPointer:`/props/blocks/${Oe(o)}`,description:i.description??"",definition:i,slotsSchema:Qp(i),example:Vh(o,i,{document:e,format:t.format}),dependencies:Mh(n,o)}))}function oc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Kh(e,t){let n={...e};return oc(e)&&oc(t)&&Object.keys(t).forEach(o=>{oc(t[o])?!(o in e)||!oc(e[o])?n[o]=t[o]:n[o]=Kh(e[o],t[o]):n[o]=t[o]}),n}function GA(e,t){return Kh(t,e)}var rm={};tt(rm,{ComponentValidationError:()=>go,DuplicateComponentError:()=>_o,UnknownPreservedComponentError:()=>Ks,createComponent:()=>Bo,createVersion:()=>Mo,getValidationSummary:()=>qs,isValidationSuccess:()=>Gs,resolveComponentVersion:()=>ho,validateAgainstSchema:()=>wp,validateCustomComponentProps:()=>Ln});var fu={};tt(fu,{AlignmentSchema:()=>Zr,BASE_SCHEMA_METADATA:()=>Eg,BaseComponentPropsSchema:()=>Hh,BlockInvocationPropsSchema:()=>jn,BorderSchema:()=>zh,COMPONENT_METADATA:()=>vg,ChartPropsSchema:()=>Bm,ColumnsPropsSchema:()=>ln,CommentReplySchema:()=>Am,CommentSchema:()=>ti,ComponentDefinitionSchema:()=>dt,CustomComponentDefinitionSchema:()=>Pr,DEFAULT_DOCX_RENDERER_ID:()=>qa,DEFAULT_ERROR_CONFIG:()=>Pn,DOCX_RENDERER_IDS:()=>Cr,DividerPropsSchema:()=>Dm,ERROR_EMOJIS:()=>mo,ERROR_TEMPLATES:()=>Jg,EndnotesSchema:()=>vm,FootnotesSchema:()=>Lm,GenerateDocumentRequestSchema:()=>dy,GenerateDocumentResponseSchema:()=>hy,GroupPropsSchema:()=>jm,HeadingLevelSchema:()=>dc,HeadingPropsSchema:()=>rn,HighchartsPropsSchema:()=>Mm,ImagePropsSchema:()=>on,IndentSchema:()=>Un,JSON_SCHEMA_URLS:()=>by,JsonComponentDefinitionSchema:()=>yy,JsonDocumentParser:()=>uu,JsonParsingError:()=>li,JsonValidationError:()=>pi,JustifiedAlignmentSchema:()=>ka,LineSpacingSchema:()=>Ra,ListMarkerFontSchema:()=>km,ListPropsSchema:()=>pn,MarginsSchema:()=>qh,NATIVE_RENDER_MODE:()=>Cc,NATIVE_VISUAL_ELEMENT_NAMES:()=>og,NativeVisualCanvasSchema:()=>bm,NativeVisualElementSchema:()=>ym,NativeVisualImagePropsSchema:()=>gm,NativeVisualShapePropsSchema:()=>hm,NativeVisualTextPropsSchema:()=>fm,NoteSchema:()=>Tc,NumberingSchema:()=>Wh,ParagraphIndentSchema:()=>ja,ParagraphPropsSchema:()=>nn,ReportPropsSchema:()=>mn,RevisionMarkSchema:()=>Tm,RevisionSchema:()=>ei,RevisionSegmentSchema:()=>$m,SHARED_DOCX_VERSION:()=>sE,STANDARD_COMPONENTS:()=>Ty,STANDARD_COMPONENTS_REGISTRY:()=>ut,STANDARD_COMPONENTS_SET:()=>zv,SectionPropsSchema:()=>cn,SpacingSchema:()=>Ct,StandardComponentDefinitionSchema:()=>kc,StatisticPropsSchema:()=>an,THEME_SCHEMA_METADATA:()=>Ng,TabStopLeaderSchema:()=>sm,TabStopSchema:()=>cm,TabStopTypeSchema:()=>am,TabStopsSchema:()=>fc,TablePropsSchema:()=>sn,TextBoxPropsSchema:()=>Fm,TextSpaceAfterComponentSchema:()=>Vm,TextSpaceAfterPropsSchema:()=>_m,ThemeConfigSchema:()=>ni,ThemeOverridesSchema:()=>vc,TocPropsSchema:()=>Um,ValidateDocumentRequestSchema:()=>fy,ValidateDocumentResponseSchema:()=>gy,VisualCanvasBackgroundSchema:()=>Om,VisualCanvasSchema:()=>xm,VisualNativePropsSchema:()=>Im,VisualPropsSchema:()=>wc,VisualRasterPropsSchema:()=>Sm,calculatePosition:()=>Do,clearComponentNamesCache:()=>Oa,collectDocxRendererErrors:()=>$c,collectIndentConflicts:()=>Jm,collectNoteRevisionConflicts:()=>Ym,collectTextBoxShapeConflicts:()=>Xm,compareSemver:()=>fo,componentValidator:()=>ai,comprehensiveValidateDocument:()=>Qm,convertDocxToJsonSchema:()=>Tg,convertToJsonSchema:()=>Tg,createComponentSchema:()=>Vo,createComponentValidator:()=>_c,createDocumentValidator:()=>Fc,createDocxComponentSchema:()=>Ag,createErrorConfig:()=>Sr,createJsonParseError:()=>uo,createJsonValidator:()=>Bg,createMinimalTheme:()=>wg,createThemeValidator:()=>Bc,createValidatedComponent:()=>Gv,createValidator:()=>Mg,deepValidateDocument:()=>Zm,diffDocuments:()=>vv,diffWords:()=>Hc,documentValidator:()=>ii,docxComponentDefinitionName:()=>tn,docxDocumentBlockTargets:()=>cg,exportDocxSchemaToFile:()=>Lg,exportSchemaToFile:()=>Ko,extractStandardComponentNames:()=>po,fixDocxSchemaReferences:()=>Nc,fixSchemaReferences:()=>vn,formatErrorMessage:()=>Or,formatErrorReport:()=>Za,formatErrorSummary:()=>Jr,formatValidationError:()=>Bv,formatValidationErrorStrings:()=>_v,formatValidationErrors:()=>kv,generateUnifiedDocumentSchema:()=>kg,getAllStandardComponentNames:()=>Cg,getErrorSummary:()=>$y,getLiteralValue:()=>St,getObjectSchemaPropertyNames:()=>xr,getSchemaMetadata:()=>xa,getStandardComponent:()=>za,getThemeName:()=>Zg,getValidationContext:()=>Mv,getValidationErrors:()=>Fv,getValidationSummary:()=>Vg,groupErrorsByPath:()=>Sa,hasCriticalErrors:()=>Qa,isColumnsComponent:()=>Jv,isColumnsProps:()=>iy,isCustomComponentProps:()=>py,isHeadingComponent:()=>Yv,isHeadingProps:()=>ny,isHighchartsComponent:()=>oE,isImageComponent:()=>Zv,isImageProps:()=>ay,isListComponent:()=>rE,isListProps:()=>ly,isLiteralSchema:()=>Hr,isNativeVisualProps:()=>ag,isObjectSchema:()=>Gt,isParagraphComponent:()=>Xv,isParagraphProps:()=>oy,isReportComponent:()=>Wv,isReportProps:()=>ty,isSectionComponent:()=>Hv,isSectionProps:()=>ry,isStandardComponentName:()=>ci,isStatisticComponent:()=>eE,isStatisticProps:()=>sy,isTableComponent:()=>tE,isTableProps:()=>cy,isTextBoxComponent:()=>Qv,isTextSpaceAfterComponent:()=>aE,isThemeConfig:()=>Qg,isTocComponent:()=>nE,isUnionSchema:()=>ba,isValidComponent:()=>qv,isValidDocument:()=>qg,isValidSemver:()=>An,isValidTheme:()=>Xg,isValidThemeConfig:()=>Ig,isValidThemeJson:()=>Xg,isValidationSuccess:()=>_g,isVisualComponent:()=>iE,latestVersion:()=>mt,parseJsonComponent:()=>Ev,parseJsonWithLineNumbers:()=>Nv,parseSemver:()=>Tn,safeValidateComponentDefinition:()=>jv,safeValidateComponentProps:()=>Rv,sharedCreateComponentSchemaObject:()=>Js,strictComponentValidator:()=>Dc,strictDocumentValidator:()=>Wa,strictThemeValidator:()=>Uc,stripMarkdown:()=>Ya,themeValidator:()=>Ha,transformAndValidate:()=>Kv,transformDocxValueError:()=>Wm,transformDocxValueErrors:()=>Hm,transformValueError:()=>$n,transformValueErrors:()=>et,validate:()=>my,validateAgainstSchema:()=>Pt,validateBatch:()=>Ug,validateComponent:()=>Xc,validateComponentDefinition:()=>du,validateComponentProps:()=>si,validateComponents:()=>Vv,validateCustomComponentProps:()=>nu,validateDocument:()=>Rc,validateDocumentWithSchema:()=>Hg,validateJson:()=>oi,validateJsonComponent:()=>jc,validateJsonComponentDoc:()=>Wg,validateJsonDocument:()=>jc,validateStrict:()=>uy,validateTheme:()=>Mc,validateThemeJson:()=>eu,validateThemeWithEnhancement:()=>tu,validateWithEnhancement:()=>Dg});var X=r.String({pattern:"^(#[0-9A-Fa-f]{6}|[a-zA-Z][a-zA-Z0-9]*)$",description:\'Hex color with # prefix (e.g. "#000000") or theme color name\'}),nm=r.String({pattern:"^(transparent|#[0-9A-Fa-f]{6}|[a-zA-Z][a-zA-Z0-9]*)$",description:\'Hex color with # prefix, theme color name, or "transparent"\'}),om=r.String({pattern:"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$",description:\'BCP-47 language tag for spell/grammar checking (e.g. "en-US", "fr-FR", "de-DE")\',examples:["en-US","fr-FR","de-DE","it-IT","es-ES"]}),im=r.Boolean({description:"Disable spell/grammar checking for this text (e.g. code snippets or identifiers)"}),Na=r.Array(r.String({minLength:1}),{description:"Words that should never be flagged as misspelled (whole-word, case-insensitive). E.g. brand names or technical terms.",examples:[["Wiseair","json-to-office","pptx"]]}),uc=r.Object({case:r.Optional(bo),size:r.Optional(r.Number({minimum:8,maximum:120})),color:r.Optional(X),bold:r.Optional(r.Boolean()),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Per-run weight (100\\u2013900). Any integer accepted; renderer picks the closest embedded variant via CSS font-matching. `bold: true` is shorthand for `fontWeight: 700`; if both are set, `fontWeight` wins."})),italic:r.Optional(r.Boolean()),underline:r.Optional(r.Boolean()),lineSpacing:r.Optional(r.Object({type:r.Union([r.Literal("single"),r.Literal("atLeast"),r.Literal("exactly"),r.Literal("double"),r.Literal("multiple")],{description:"`single`/`double` ignore `value`; `multiple` scales single spacing by it; `atLeast` is a floor the line grows past; `exactly` pins an absolute box the glyphs are clipped to."}),value:r.Optional(r.Number({minimum:0,description:"Points for `exactly` and `atLeast`, a factor of single spacing for `multiple`. Unlike `size` this has no floor \\u2014 an empty spacer paragraph legitimately pins a fraction of a point \\u2014 so an `exactly` box too small for the text it holds is reported as W_QUALITY_LINE_BOX_COLLAPSE instead."}))},{additionalProperties:!1})),spacing:r.Optional(r.Object({before:r.Optional(r.Number({minimum:0})),after:r.Optional(r.Number({minimum:0}))},{additionalProperties:!1})),characterSpacing:r.Optional(r.Object({type:r.Union([r.Literal("condensed"),r.Literal("expanded")]),value:r.Number()},{additionalProperties:!1})),scale:r.Optional(r.Number({minimum:1,maximum:600,description:"Character width scaling in percent (w:w). 100 is normal; values below compress glyphs, above expand them (e.g. 55, 115)."}))},{additionalProperties:!1}),Fn=r.Object({family:zt,...uc.properties},{description:"Font definition with family and optional formatting properties",additionalProperties:!1});var Zr=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right")],{description:"Text alignment options"}),ka=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("justify")],{description:"Text alignment options including justify"}),dc=r.Union([r.Literal(1),r.Literal(2),r.Literal(3),r.Literal(4),r.Literal(5),r.Literal(6)],{description:"Heading level (1-6)"}),Ct=r.Object({before:r.Optional(r.Number({minimum:0,description:"Spacing before element in points"})),after:r.Optional(r.Number({minimum:0,description:"Spacing after element in points"}))},{description:"Spacing configuration",additionalProperties:!1}),Gh=r.Object({before:r.Optional(r.Number({minimum:0,description:"Spacing before list in points"})),after:r.Optional(r.Number({minimum:0,description:"Spacing after list in points"})),item:r.Optional(r.Number({minimum:0,description:"Spacing between list items in points"}))},{description:"List spacing configuration with item spacing",additionalProperties:!1}),qh=r.Object({top:r.Optional(r.Number({minimum:0})),bottom:r.Optional(r.Number({minimum:0})),left:r.Optional(r.Number({minimum:0})),right:r.Optional(r.Number({minimum:0}))},{description:"Margin configuration",additionalProperties:!1}),zh=r.Object({style:r.Optional(r.Union([r.Literal("solid"),r.Literal("dashed"),r.Literal("dotted"),r.Literal("double"),r.Literal("none")])),width:r.Optional(r.Number({minimum:0})),color:r.Optional(X)},{description:"Border configuration",additionalProperties:!1}),Ra=r.Object({type:r.Union([r.Literal("single"),r.Literal("atLeast"),r.Literal("exactly"),r.Literal("double"),r.Literal("multiple")],{description:"`single`/`double` ignore `value`; `multiple` scales single spacing by it; `atLeast` is a floor the line grows past; `exactly` pins an absolute box the glyphs are clipped to."}),value:r.Optional(r.Number({minimum:0,description:"Points for `exactly` and `atLeast`, a factor of single spacing for `multiple`. `exactly` has no floor of its own \\u2014 an empty spacer paragraph legitimately pins a fraction of a point \\u2014 so a box smaller than the text it holds is accepted here and clips it."}))},{description:"Line spacing configuration",additionalProperties:!1}),Un=r.Object({left:r.Optional(r.Number({minimum:0,description:"Left indentation in points. Omit to inherit the per-level default of 36pt (half an inch) per level."})),hanging:r.Optional(r.Number({minimum:0,description:"Hanging indent in points \\u2014 how far the marker sits left of the text. Omit for the 18pt default."}))},{description:"Indentation configuration, in points",additionalProperties:!1}),ja=r.Object({left:r.Optional(r.Number({description:"Left indentation in twips (1/20 of a point)"})),right:r.Optional(r.Number({description:"Right indentation in twips (1/20 of a point)"})),hanging:r.Optional(r.Number({minimum:0,description:"Hanging indent in twips: first line stays at the left indent, following lines are indented. Mutually exclusive with firstLine."})),firstLine:r.Optional(r.Number({minimum:0,description:"First-line indent in twips: only the first line is indented. Mutually exclusive with hanging."}))},{description:"Paragraph indentation (w:ind) in twips. Use either hanging or firstLine, not both.",additionalProperties:!1}),am=r.Union([r.Literal("left"),r.Literal("right"),r.Literal("center"),r.Literal("decimal"),r.Literal("bar")],{description:"Tab stop alignment type"}),sm=r.Union([r.Literal("dot"),r.Literal("hyphen"),r.Literal("underscore"),r.Literal("middleDot"),r.Literal("none")],{description:"Leader character filling the space before the tab stop"}),cm=r.Object({type:am,position:r.Number({minimum:0,description:"Tab stop position in twips (1/20 of a point)"}),leader:r.Optional(sm)},{description:"Tab stop definition (w:tab in w:tabs)",additionalProperties:!1});var fc=r.Array(cm,{description:"Tab stops for the paragraph. Tab characters (\\\\t) in the text jump to these positions."}),qA=r.Union([r.Literal("character"),r.Literal("column"),r.Literal("margin"),r.Literal("page"),r.Literal("text")],{description:"Horizontal position relative to"}),zA=r.Union([r.Literal("margin"),r.Literal("page"),r.Literal("paragraph"),r.Literal("line"),r.Literal("text")],{description:"Vertical position relative to"}),WA=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("inside"),r.Literal("outside")],{description:"Horizontal alignment"}),HA=r.Union([r.Literal("top"),r.Literal("center"),r.Literal("bottom"),r.Literal("inside"),r.Literal("outside")],{description:"Vertical alignment"}),JA=r.Union([r.Literal("none"),r.Literal("square"),r.Literal("topAndBottom"),r.Literal("around"),r.Literal("tight"),r.Literal("through")],{description:"Text wrapping type"}),YA=r.Union([r.Literal("bothSides"),r.Literal("left"),r.Literal("right"),r.Literal("largest")],{description:"Text wrapping side"}),Oo=r.Object({horizontalPosition:r.Optional(r.Object({relative:r.Optional(qA),align:r.Optional(WA),offset:r.Optional(r.Union([r.Number({description:"Horizontal offset in twips (1/20 of a point)"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Horizontal offset as percentage (e.g., "50%") relative to page or margin width\'})]))},{description:"Horizontal positioning (use either align or offset, not both)",additionalProperties:!1})),verticalPosition:r.Optional(r.Object({relative:r.Optional(zA),align:r.Optional(HA),offset:r.Optional(r.Union([r.Number({description:"Vertical offset in twips (1/20 of a point)"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Vertical offset as percentage (e.g., "50%") relative to page or margin height\'})]))},{description:"Vertical positioning (use either align or offset, not both)",additionalProperties:!1})),wrap:r.Optional(r.Object({type:JA,side:r.Optional(YA),margins:r.Optional(r.Object({top:r.Optional(r.Union([r.Number({description:"Top margin in twips"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Top margin as percentage of page height"})])),bottom:r.Optional(r.Union([r.Number({description:"Bottom margin in twips"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Bottom margin as percentage of page height"})])),left:r.Optional(r.Union([r.Number({description:"Left margin in twips"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Left margin as percentage of page width"})])),right:r.Optional(r.Union([r.Number({description:"Right margin in twips"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Right margin as percentage of page width"})]))},{description:"Distance from text margins",additionalProperties:!1}))},{description:"Text wrapping configuration",additionalProperties:!1})),allowOverlap:r.Optional(r.Boolean({description:"Allow element to overlap with other elements"})),behindDocument:r.Optional(r.Boolean({description:"Place element behind document text"})),lockAnchor:r.Optional(r.Boolean({description:"Lock the anchor position"})),layoutInCell:r.Optional(r.Boolean({description:"Layout element within table cell"})),zIndex:r.Optional(r.Number({minimum:0,description:"Z-order for overlapping elements (must be non-negative)"})),rotation:r.Optional(r.Number({description:"Rotation angle in degrees"})),visibility:r.Optional(r.Union([r.Literal("hidden"),r.Literal("inherit")],{description:"Visibility of the floating element"}))},{description:"Floating element properties",additionalProperties:!1}),Wh=r.Object({start:r.Optional(r.Number({minimum:1})),style:r.Optional(r.Union([r.Literal("decimal"),r.Literal("lowerLetter"),r.Literal("upperLetter"),r.Literal("lowerRoman"),r.Literal("upperRoman")])),separator:r.Optional(r.String())},{description:"Numbering configuration for lists",additionalProperties:!1}),XA={},Hh=r.Object(XA,{description:"Base component props",additionalProperties:!0});var ZA=r.String({pattern:"^#?[0-9A-Fa-f]{6}$",description:"Hex color (e.g. #FF0000)"}),gc=["primary","secondary","accent","background","text","text2","background2","accent4","accent5","accent6"],yc=["accent1","accent2","accent3","tx1","tx2","bg1","bg2"],Dn=r.Union([ZA,...gc.map(e=>r.Literal(e)),...yc.map(e=>r.Literal(e))],{description:"Hex color or semantic theme color name"}),Yo=["title","subtitle","heading1","heading2","heading3","body","caption",...Go],Fa=r.Union(Yo.map(e=>r.Literal(e)),{description:"Predefined style name"}),Ua=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right")],{description:"Horizontal alignment options"}),xo=r.Union([r.Literal("top"),r.Literal("middle"),r.Literal("bottom")],{description:"Vertical alignment options"}),Xo=r.Object({type:r.Optional(r.Union([r.Literal("outer"),r.Literal("inner")],{description:"Shadow type"})),color:r.Optional(Dn),blur:r.Optional(r.Number({description:"Shadow blur radius in points"})),offset:r.Optional(r.Number({description:"Shadow offset in points"})),angle:r.Optional(r.Number({description:"Shadow angle in degrees"})),opacity:r.Optional(r.Number({minimum:0,maximum:1,description:"Shadow opacity (0-1)"}))},{description:"Shadow configuration",additionalProperties:!1}),en=r.Object({column:r.Number({minimum:0,description:"Starting column (0-indexed)"}),row:r.Number({minimum:0,description:"Starting row (0-indexed)"}),columnSpan:r.Optional(r.Number({minimum:1,description:"Number of columns to span (default: 1)"})),rowSpan:r.Optional(r.Number({minimum:1,description:"Number of rows to span (default: 1)"}))},{additionalProperties:!1,description:"Grid-based positioning"}),bc=r.Object({text:r.String({description:"Run text content"}),color:r.Optional(r.String({description:"Run color (hex without # or semantic theme name)"})),bold:r.Optional(r.Boolean({description:"Bold run"})),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Per-run weight (100\\u2013900). Overrides `bold` when set \\u2014 renderer picks the closest embedded variant via CSS font-matching."})),italic:r.Optional(r.Boolean({description:"Italic run"})),underline:r.Optional(r.Union([r.Boolean({description:"Simple underline toggle"}),r.Object({style:r.Optional(r.Union([r.Literal("sng"),r.Literal("dbl"),r.Literal("dash"),r.Literal("dotted")])),color:r.Optional(r.String({description:"Underline color (hex)"}))},{additionalProperties:!1})])),strike:r.Optional(r.Boolean({description:"Strikethrough run"})),fontSize:r.Optional(r.Number({minimum:1,description:"Run font size in points"})),fontFace:r.Optional(r.String({description:"Run font family"})),superscript:r.Optional(r.Boolean({description:"Render run as superscript"})),subscript:r.Optional(r.Boolean({description:"Render run as subscript"})),charSpacing:r.Optional(r.Number({description:"Character spacing in points"})),breakLine:r.Optional(r.Boolean({description:"Insert line break after this run"}))},{description:"A styled text run. Run options override component-level defaults.",additionalProperties:!1}),Da=r.Object({text:r.Optional(r.String({description:"Text content to display. Mutually exclusive with `runs` \\u2014 set exactly one of the two."})),runs:r.Optional(r.Array(bc,{minItems:1,description:"Rich text runs with per-run styling, rendered as one text block. Mutually exclusive with `text` \\u2014 set exactly one of the two. Component-level props (align, valign, fill, lineSpacing, position\\u2026) still apply to the whole block."})),x:r.Optional(r.Union([r.Number({description:"X position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:r.Optional(r.Union([r.Number({description:"Y position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:r.Optional(r.Union([r.Number({description:"Width in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:r.Optional(r.Union([r.Number({description:"Height in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),fit:r.Optional(r.Object({maxLines:r.Optional(r.Integer({minimum:1,description:"Lines the text may occupy, estimated with the width model at the effective font size."})),shrink:r.Optional(r.Array(r.Number({minimum:1}),{minItems:1,description:"Readable font sizes to try in order when the text exceeds maxLines or the box height. The first that fits is used."}))},{additionalProperties:!1,description:"Bounded fit: estimate the lines at the effective size, step down only through the declared readable sizes, and fail generation with text_fit_overflow when nothing fits. Without maxLines the box height bounds the text; without shrink the text must fit as sized."})),fontSize:r.Optional(r.Number({minimum:1,description:"Font size in points"})),fontFace:r.Optional(zt),color:r.Optional(r.String({description:\'Text color (hex without #, e.g., "FF0000")\'})),bold:r.Optional(r.Boolean({description:"Bold text"})),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Per-run weight (100\\u2013900). Renderer picks the closest embedded variant via CSS font-matching and references it through a synthetic family alias. Overrides `bold` when set."})),italic:r.Optional(r.Boolean({description:"Italic text"})),underline:r.Optional(r.Union([r.Boolean({description:"Simple underline toggle"}),r.Object({style:r.Optional(r.Union([r.Literal("sng"),r.Literal("dbl"),r.Literal("dash"),r.Literal("dotted")])),color:r.Optional(r.String({description:"Underline color (hex)"}))},{additionalProperties:!1})])),strike:r.Optional(r.Boolean({description:"Strikethrough text"})),language:r.Optional(r.String({pattern:"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$",description:\'Language tag (BCP-47, e.g. "en-US", "fr-FR") for spell-checking this text. Overrides the presentation default.\',examples:["en-US","fr-FR","de-DE","it-IT","es-ES"]})),align:r.Optional(Ua),valign:r.Optional(xo),breakLine:r.Optional(r.Boolean({description:"Add line break after text"})),bullet:r.Optional(r.Union([r.Boolean({description:"Enable default bullet"}),r.Object({type:r.Optional(r.Union([r.Literal("bullet"),r.Literal("number")])),style:r.Optional(r.String({description:"Bullet character or style"})),startAt:r.Optional(r.Number({description:"Starting number for numbered lists"}))},{additionalProperties:!1})])),margin:r.Optional(r.Union([r.Number({description:"Margin in points (all sides)"}),r.Array(r.Number(),{description:"Margins as [top, right, bottom, left] in points",minItems:4,maxItems:4})])),rotate:r.Optional(r.Number({description:"Rotation angle in degrees"})),shadow:r.Optional(Xo),fill:r.Optional(r.Object({color:r.String({description:"Fill color (hex without #)"}),transparency:r.Optional(r.Number({minimum:0,maximum:100,description:"Fill transparency (0-100)"}))},{additionalProperties:!1})),hyperlink:r.Optional(r.Object({url:r.Optional(r.String({description:"Hyperlink URL"})),slide:r.Optional(r.Number({description:"Slide number to link to"})),tooltip:r.Optional(r.String({description:"Hyperlink tooltip"}))},{additionalProperties:!1})),lineSpacing:r.Optional(r.Number({description:"Line spacing in points"})),lineSpacingMultiple:r.Optional(r.Number({minimum:.1,maximum:10,description:"Line spacing as a multiple of the font size (e.g. 0.9 = 90%). Takes precedence over lineSpacing."})),charSpacing:r.Optional(r.Number({description:"Character spacing in points (positive = wider, negative = tighter)"})),paraSpaceBefore:r.Optional(r.Number({description:"Space before paragraph in points"})),paraSpaceAfter:r.Optional(r.Number({description:"Space after paragraph in points"})),grid:r.Optional(en),style:r.Optional(Fa)},{description:"Text component props",additionalProperties:!1}),Ma=r.Object({path:r.Optional(r.String({description:"Image file path or URL (mutually exclusive with base64 and svg)"})),base64:r.Optional(r.String({description:"Base64-encoded image data in data URI format (mutually exclusive with path and svg)"})),svg:r.Optional(r.String({description:\'Raw inline SVG markup, e.g. "<svg xmlns=\\\\"http://www.w3.org/2000/svg\\\\" viewBox=\\\\"0 0 24 24\\\\">...</svg>" (mutually exclusive with path and base64). Wrapped into an image/svg+xml data URI and embedded as a vector (PowerPoint 2016+); intrinsic size taken from the SVG viewBox/width/height when w/h omitted.\'})),x:r.Optional(r.Union([r.Number({description:"X position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:r.Optional(r.Union([r.Number({description:"Y position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:r.Optional(r.Union([r.Number({description:"Width in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:r.Optional(r.Union([r.Number({description:"Height in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),sizing:r.Optional(r.Object({type:r.Union([r.Literal("contain"),r.Literal("cover"),r.Literal("crop")],{description:"Image sizing strategy"}),w:r.Optional(r.Number({description:"Target width in inches"})),h:r.Optional(r.Number({description:"Target height in inches"}))},{description:"Image sizing options",additionalProperties:!1})),rotate:r.Optional(r.Number({description:"Rotation angle in degrees"})),rounding:r.Optional(r.Boolean({description:"Apply rounded corners to image"})),shadow:r.Optional(Xo),hyperlink:r.Optional(r.Object({url:r.Optional(r.String({description:"Hyperlink URL"})),slide:r.Optional(r.Number({description:"Slide number to link to"})),tooltip:r.Optional(r.String({description:"Hyperlink tooltip"}))},{additionalProperties:!1})),alt:r.Optional(r.String({description:"Alternative text for accessibility"})),grid:r.Optional(en)},{description:"PPTX image component props",additionalProperties:!1}),Zo=r.Union([r.Literal("rect"),r.Literal("roundRect"),r.Literal("ellipse"),r.Literal("triangle"),r.Literal("diamond"),r.Literal("pentagon"),r.Literal("hexagon"),r.Literal("star5"),r.Literal("star6"),r.Literal("line"),r.Literal("arc"),r.Literal("pie"),r.Literal("blockArc"),r.Literal("chord"),r.Literal("arrow"),r.Literal("chevron"),r.Literal("cloud"),r.Literal("heart"),r.Literal("lightning")],{description:"Shape type"}),Yh=r.Object({text:r.String(),fontSize:r.Optional(r.Number({minimum:1})),fontFace:r.Optional(r.String()),color:r.Optional(r.String({description:"Segment color (hex without # or semantic name)"})),bold:r.Optional(r.Boolean()),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900})),italic:r.Optional(r.Boolean()),breakLine:r.Optional(r.Boolean({description:"Insert line break after this segment"})),spaceBefore:r.Optional(r.Number({minimum:0,description:"Space before paragraph in points"})),spaceAfter:r.Optional(r.Number({minimum:0,description:"Space after paragraph in points"})),charSpacing:r.Optional(r.Number({description:"Character spacing in points"}))},{additionalProperties:!1}),Oc=["pct5","pct10","pct20","pct25","pct30","pct40","pct50","pct60","pct70","pct75","pct80","pct90","horz","vert","ltHorz","ltVert","dkHorz","dkVert","narHorz","narVert","dashHorz","dashVert","cross","dnDiag","upDiag","ltDnDiag","ltUpDiag","dkDnDiag","dkUpDiag","wdDnDiag","wdUpDiag","dashDnDiag","dashUpDiag","diagCross","smCheck","lgCheck","smGrid","lgGrid","dotGrid","smConfetti","lgConfetti","horzBrick","diagBrick","solidDmnd","openDmnd","dotDmnd","plaid","sphere","weave","divot","shingle","wave","trellis","zigZag"],xc=r.Object({color:r.String({description:"Stop color (hex without # or semantic theme name)"}),pos:r.Number({minimum:0,maximum:100,description:"Stop position along the gradient (0-100)"}),transparency:r.Optional(r.Number({minimum:0,maximum:100,description:"Stop transparency (0-100)"}))},{additionalProperties:!1,description:"Gradient color stop"}),Qo=r.Object({type:r.Union([r.Literal("linear"),r.Literal("radial")],{description:"Gradient type"}),angle:r.Optional(r.Number({minimum:0,maximum:360,description:"Gradient angle in degrees for linear gradients (0 = left\\u2192right, 90 = top\\u2192bottom). Default: 0."})),stops:r.Array(xc,{minItems:2,description:"Gradient color stops (at least 2)"}),focus:r.Optional(r.Union([r.Literal("center"),r.Literal("topLeft"),r.Literal("topRight"),r.Literal("bottomLeft"),r.Literal("bottomRight")],{description:\'Focus point for radial gradients (default: "center")\'}))},{additionalProperties:!1,description:"Gradient fill configuration"}),Sc=r.Object({preset:r.Union(Oc.map(e=>r.Literal(e)),{description:"OOXML pattern preset name (a:pattFill prst value)"}),foreground:r.String({description:"Pattern foreground color (hex without # or semantic name)"}),background:r.String({description:"Pattern background color (hex without # or semantic name)"})},{additionalProperties:!1,description:"Pattern fill configuration"}),Ba=r.Object({type:Zo,x:r.Optional(r.Union([r.Number({description:"X position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:r.Optional(r.Union([r.Number({description:"Y position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:r.Optional(r.Union([r.Number({description:"Width in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:r.Optional(r.Union([r.Number({description:"Height in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),fill:r.Optional(r.Object({color:r.Optional(r.String({description:"Fill color (hex without #)"})),transparency:r.Optional(r.Number({minimum:0,maximum:100,description:"Fill transparency (0-100)"})),gradient:r.Optional(Qo),pattern:r.Optional(Sc)},{additionalProperties:!1})),line:r.Optional(r.Object({color:r.Optional(r.String({description:"Line color (hex without #)"})),width:r.Optional(r.Number({minimum:0,description:"Line width in points"})),dashType:r.Optional(r.Union([r.Literal("solid"),r.Literal("dash"),r.Literal("dot"),r.Literal("dashDot")]))},{additionalProperties:!1})),text:r.Optional(r.Union([r.String({description:"Plain text"}),r.Array(Yh,{description:"Rich text segments with per-segment formatting"})],{description:"Text content inside the shape"})),fontSize:r.Optional(r.Number({minimum:1,description:"Font size for shape text"})),fontFace:r.Optional(r.String({description:"Font family for shape text"})),fontColor:r.Optional(r.String({description:"Font color for shape text (hex without #)"})),charSpacing:r.Optional(r.Number({description:"Character spacing in points for shape text"})),bold:r.Optional(r.Boolean({description:"Bold shape text"})),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Per-shape weight (100\\u2013900). Overrides `bold` when set."})),italic:r.Optional(r.Boolean({description:"Italic shape text"})),align:r.Optional(Ua),valign:r.Optional(xo),rotate:r.Optional(r.Number({description:"Rotation angle in degrees"})),angleRange:r.Optional(r.Array(r.Number(),{minItems:2,maxItems:2,description:"Shape arc [start, end] angles in degrees (arc/pie/blockArc/chord shapes)"})),flipH:r.Optional(r.Boolean({description:"Flip shape horizontally"})),flipV:r.Optional(r.Boolean({description:"Flip shape vertically"})),shadow:r.Optional(Xo),rectRadius:r.Optional(r.Number({minimum:0,description:"Corner radius for roundRect shape in inches"})),grid:r.Optional(en),style:r.Optional(Fa)},{description:"Shape component props",additionalProperties:!1}),QA=r.Union([r.String({description:"Simple text cell"}),r.Object({text:r.String({description:"Cell text content"}),color:r.Optional(r.String({description:"Text color (hex without #)"})),fill:r.Optional(r.String({description:"Cell background color (hex without #)"})),fontSize:r.Optional(r.Number({description:"Font size in points"})),fontFace:r.Optional(r.String({description:"Font family"})),bold:r.Optional(r.Boolean({description:"Bold text"})),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Per-cell weight (100\\u2013900). Overrides `bold` when set."})),italic:r.Optional(r.Boolean({description:"Italic text"})),align:r.Optional(Ua),valign:r.Optional(xo),colspan:r.Optional(r.Number({minimum:1,description:"Column span"})),rowspan:r.Optional(r.Number({minimum:1,description:"Row span"})),margin:r.Optional(r.Union([r.Number({description:"Margin in points (all sides)"}),r.Array(r.Number(),{minItems:4,maxItems:4})]))},{additionalProperties:!1})]),_a=r.Object({rows:r.Array(r.Array(QA,{description:"Row of cells"}),{description:"Table rows (array of arrays)",minItems:1}),x:r.Optional(r.Union([r.Number({description:"X position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:r.Optional(r.Union([r.Number({description:"Y position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:r.Optional(r.Union([r.Number({description:"Width in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:r.Optional(r.Union([r.Number({description:"Height in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),colW:r.Optional(r.Union([r.Number({description:"Uniform column width in inches"}),r.Array(r.Number(),{description:"Individual column widths in inches"})])),rowH:r.Optional(r.Union([r.Number({description:"Uniform row height in inches"}),r.Array(r.Number(),{description:"Individual row heights in inches"})])),border:r.Optional(r.Object({type:r.Optional(r.Union([r.Literal("solid"),r.Literal("dash"),r.Literal("dot"),r.Literal("none")])),pt:r.Optional(r.Number({minimum:0,description:"Border width in points"})),color:r.Optional(r.String({description:"Border color (hex without #)"}))},{additionalProperties:!1})),fill:r.Optional(r.String({description:"Table background color (hex without #)"})),fontSize:r.Optional(r.Number({minimum:1,description:"Default font size for all cells"})),fontFace:r.Optional(r.String({description:"Default font family for all cells"})),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Default weight for all cells (100\\u2013900). Same sub-family aliasing as the per-cell `fontWeight`; a cell that sets its own `fontWeight` or `bold` opts out."})),color:r.Optional(r.String({description:"Default text color for all cells (hex without #)"})),align:r.Optional(Ua),valign:r.Optional(xo),headerRow:r.Optional(r.Boolean({description:"Style the first row as a header \\u2014 bold, on the theme\'s secondary background. Cells that state their own `bold`, `fill` or `color` keep it. Unlike the DOCX table, which declares its headers structurally, a PPTX table is rows of cells and the first one is a header only because you say so."})),autoPage:r.Optional(r.Boolean({description:"Auto-paginate table across multiple slides when content overflows"})),autoPageRepeatHeader:r.Optional(r.Boolean({description:"Repeat first row as header on each auto-paged slide"})),margin:r.Optional(r.Union([r.Number({description:"Cell margin in points (all sides)"}),r.Array(r.Number(),{minItems:4,maxItems:4})])),borderRadius:r.Optional(r.Number({minimum:0,description:"Rounded corner radius in inches. Renders a roundRect shape behind the table."})),grid:r.Optional(en)},{description:"PPTX table component props",additionalProperties:!1}),Va=r.Object({options:r.Intersect([r.Record(r.String(),r.Unknown()),r.Object({chart:r.Object({width:r.Number(),height:r.Number()})})]),scale:r.Optional(r.Number()),serverUrl:r.Optional(r.String({description:"Highcharts Export Server URL (default: http://localhost:7801)"})),resources:r.Optional(r.Object({css:r.Optional(r.String()),js:r.Optional(r.String()),files:r.Optional(r.Array(r.String()))})),x:r.Optional(r.Union([r.Number({description:"X position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:r.Optional(r.Union([r.Number({description:"Y position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:r.Optional(r.Union([r.Number({description:"Width in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:r.Optional(r.Union([r.Number({description:"Height in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),grid:r.Optional(en)},{description:"PPTX Highcharts component props",additionalProperties:!1}),hc=(e,t)=>r.Union([r.Number({description:e}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:t})]),eL=r.Union([r.Literal("area"),r.Literal("bar"),r.Literal("bar3D"),r.Literal("bubble"),r.Literal("doughnut"),r.Literal("line"),r.Literal("pie"),r.Literal("radar"),r.Literal("scatter")],{description:"Chart type"}),tL=r.Object({name:r.Optional(r.String({description:"Series name"})),labels:r.Optional(r.Array(r.String(),{description:"Category labels. Needed on every series, not just the first, and the same length as `values`; a series without both `labels` and `values` drops the whole chart."})),values:r.Optional(r.Array(r.Number(),{description:"Data values, one per label. Needed on every series \\u2014 see `labels`."})),sizes:r.Optional(r.Array(r.Number(),{description:"Bubble sizes (bubble charts only)"}))},{additionalProperties:!1}),Jh=r.Object({style:r.Optional(r.Union([r.Literal("solid"),r.Literal("dash"),r.Literal("dot"),r.Literal("none")],{description:"Grid line style"})),size:r.Optional(r.Number({minimum:0,description:"Grid line width (points)"})),color:r.Optional(r.String({description:"Grid line color (hex or semantic)"}))},{additionalProperties:!1,description:"Axis grid line styling"}),Ka=r.Object({type:eL,data:r.Array(tL,{description:"Chart data series",minItems:1}),showLegend:r.Optional(r.Boolean({description:"Show chart legend"})),showTitle:r.Optional(r.Boolean({description:"Show chart title"})),showValue:r.Optional(r.Boolean({description:"Show data values"})),showPercent:r.Optional(r.Boolean({description:"Show percentages (pie/doughnut)"})),showLabel:r.Optional(r.Boolean({description:"Show category labels on data points"})),showSerName:r.Optional(r.Boolean({description:"Show series name on data points"})),title:r.Optional(r.String({description:"Chart title text"})),titleFontSize:r.Optional(r.Number({description:"Title font size (points)"})),titleColor:r.Optional(r.String({description:"Title color (hex or semantic)"})),titleFontFace:r.Optional(r.String({description:"Title font face"})),titleFontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Title weight (100\\u2013900). Rendered as a sub-family alias \\u2014 see `dataLabelFontWeight`."})),chartColors:r.Optional(r.Array(r.String(),{description:"Series colors (hex or semantic theme names). Defaults to theme palette."})),dataBorder:r.Optional(r.Object({pt:r.Number({minimum:0,description:"Border width (points)"}),color:r.String({description:"Border color (hex or semantic)"})},{additionalProperties:!1,description:"Outline on data elements (bars, slices, areas)"})),legendPos:r.Optional(r.Union([r.Literal("b"),r.Literal("l"),r.Literal("r"),r.Literal("t"),r.Literal("tr")],{description:"Legend position"})),legendFontSize:r.Optional(r.Number({description:"Legend font size"})),legendFontFace:r.Optional(r.String({description:"Legend font face"})),legendFontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Legend weight (100\\u2013900). Rendered as a sub-family alias \\u2014 see `dataLabelFontWeight`. PowerPoint gives the legend no bold toggle, so 400 and 700 both render Regular (700 warns)."})),legendColor:r.Optional(r.String({description:"Legend text color"})),catAxisTitle:r.Optional(r.String({description:"Category axis title"})),catAxisHidden:r.Optional(r.Boolean({description:"Hide category axis"})),catAxisLabelRotate:r.Optional(r.Number({description:"Category axis label rotation (degrees)"})),catAxisLabelFontSize:r.Optional(r.Number({description:"Category axis label font size"})),catAxisLabelColor:r.Optional(r.String({description:"Category axis label color (hex or semantic)"})),catAxisLabelFontFace:r.Optional(r.String({description:"Category axis label font face"})),catAxisLabelFontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Category axis label weight (100\\u2013900). Rendered as a sub-family alias \\u2014 see `dataLabelFontWeight`."})),catGridLine:r.Optional(Jh),valAxisTitle:r.Optional(r.String({description:"Value axis title"})),valAxisHidden:r.Optional(r.Boolean({description:"Hide value axis"})),valAxisMinVal:r.Optional(r.Number({description:"Value axis minimum"})),valAxisMaxVal:r.Optional(r.Number({description:"Value axis maximum"})),valAxisLabelFormatCode:r.Optional(r.String({description:\'Value axis label format (e.g. "$0.00", "#%")\'})),valAxisMajorUnit:r.Optional(r.Number({description:"Value axis major unit / tick interval"})),valAxisLabelColor:r.Optional(r.String({description:"Value axis label color (hex or semantic)"})),valAxisLabelFontFace:r.Optional(r.String({description:"Value axis label font face"})),valAxisLabelFontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Value axis label weight (100\\u2013900). Rendered as a sub-family alias \\u2014 see `dataLabelFontWeight`."})),valAxisLabelFontSize:r.Optional(r.Number({description:"Value axis label font size"})),valGridLine:r.Optional(Jh),catAxisLineShow:r.Optional(r.Boolean({description:"Show the category axis line"})),valAxisLineShow:r.Optional(r.Boolean({description:"Show the value axis line"})),barDir:r.Optional(r.Union([r.Literal("bar"),r.Literal("col")],{description:\'Bar direction: "bar" (horizontal) or "col" (vertical, default)\'})),barGrouping:r.Optional(r.Union([r.Literal("clustered"),r.Literal("stacked"),r.Literal("percentStacked")],{description:"Bar grouping style"})),barGapWidthPct:r.Optional(r.Number({minimum:0,maximum:500,description:"Bar gap width (0-500%)"})),barOverlapPct:r.Optional(r.Number({minimum:-100,maximum:100,description:"Overlap between series bars (-100 to 100%). 100 = fully overlapped, negative = gap."})),lineSmooth:r.Optional(r.Boolean({description:"Smooth lines"})),lineDataSymbol:r.Optional(r.Union([r.Literal("circle"),r.Literal("dash"),r.Literal("diamond"),r.Literal("dot"),r.Literal("none"),r.Literal("square"),r.Literal("triangle")],{description:"Line data point marker symbol"})),lineSize:r.Optional(r.Number({description:"Line width (points)"})),lineDataSymbolSize:r.Optional(r.Number({minimum:2,maximum:72,description:"Line data point marker size (points)"})),firstSliceAng:r.Optional(r.Number({minimum:0,maximum:359,description:"Angle of first slice (degrees)"})),holeSize:r.Optional(r.Number({minimum:10,maximum:90,description:"Doughnut hole size (%)"})),radarStyle:r.Optional(r.Union([r.Literal("standard"),r.Literal("marker"),r.Literal("filled")],{description:"Radar chart style"})),dataLabelColor:r.Optional(r.String({description:"Data label text color"})),dataLabelFontSize:r.Optional(r.Number({description:"Data label font size"})),dataLabelFontFace:r.Optional(r.String({description:"Data label font face"})),dataLabelFontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:\'Data label weight (100\\u2013900); overrides `dataLabelFontBold`. PowerPoint chart labels carry no numeric weight, so a non-RIBBI weight renders by rewriting the font face to the matching sub-family ("Inter" at 300 \\u2192 "Inter Light") \\u2014 400 and 700 stay on the family and use the bold toggle. Falls back to the theme body font when the sibling font face is unset.\'})),dataLabelFontBold:r.Optional(r.Boolean({description:"Bold data labels"})),dataLabelPosition:r.Optional(r.Union([r.Literal("b"),r.Literal("bestFit"),r.Literal("ctr"),r.Literal("l"),r.Literal("r"),r.Literal("t"),r.Literal("inEnd"),r.Literal("outEnd")],{description:"Data label position"})),x:r.Optional(hc("X position in inches","X as percentage")),y:r.Optional(hc("Y position in inches","Y as percentage")),w:r.Optional(hc("Width in inches","Width as percentage")),h:r.Optional(hc("Height in inches","Height as percentage")),grid:r.Optional(en)},{description:"Native PowerPoint chart component props",additionalProperties:!1});function So(e){if(e.propsRequired!==void 0)return e.propsRequired;let t=e.propsSchema;return t.type!=="object"||(t.required?.length??0)>0}var Qr=[{name:"text",propsSchema:Da,hasChildren:!1,category:"content",propsRequired:!0,description:"Text element - displays text with formatting, positioning and styling options. Prefer the named `style` values (title, heading1, body\\u2026) and theme color tokens over raw fontSize/hex \\u2014 a theme swap must restyle the deck without editing every node."},{name:"image",propsSchema:Ma,hasChildren:!1,category:"content",propsRequired:!0,description:"Image element - displays images from file path, URL, or base64 data."},{name:"shape",propsSchema:Ba,hasChildren:!1,category:"content",description:"Shape element - draws geometric shapes with optional text, fill, and line styling."},{name:"table",propsSchema:_a,hasChildren:!1,category:"content",description:"Table element, declared ROW-MAJOR: `props.rows[][]`, an array of rows, each an array of cells, with no structural header \\u2014 `headerRow: true` styles the first row as one. Note the DOCX `table` is the other way round \\u2014 columns each carrying their own header and cells \\u2014 so a table cannot be moved between the formats unchanged."},{name:"highcharts",propsSchema:Va,hasChildren:!1,category:"content",description:"Highcharts element - renders charts via Highcharts Export Server."},{name:"chart",propsSchema:Ka,hasChildren:!1,category:"content",description:"Native PowerPoint chart - editable, scalable, no external server needed. Always set series colors (theme-derived, one accent per series) \\u2014 the auto-palette reads as default Office."}];function Jo(e){return r.Object({name:r.Literal(e.name),id:r.Optional(r.String()),enabled:r.Optional(r.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true."})),props:So(e)?e.propsSchema:r.Optional(e.propsSchema)},{additionalProperties:!1,description:e.description})}var Ga=r.Union([Jo(Qr[0]),Jo(Qr[1]),Jo(Qr[2]),Jo(Qr[3]),Jo(Qr[4]),Jo(Qr[5])],{$id:"PptxSlideContent",discriminator:{propertyName:"name"},description:"A single PPTX slide content element (text, image, shape, table, highcharts, or chart)."});var Mn=r.String({pattern:"^(#?[0-9A-Fa-f]{6}|[a-zA-Z][a-zA-Z0-9]*)$",description:\'Hex colour ("#0F172A" or "0F172A") or a docx theme colour name (e.g. "primary")\'}),rL="^-?\\\\d+(\\\\.\\\\d+)?%$",nL="^\\\\d+(\\\\.\\\\d+)?%$",Xh=r.Union([r.Number({description:"Inches from the canvas origin"}),r.String({pattern:rL,description:\'Percentage of the canvas extent on this axis, e.g. "25%"\'})],{description:"Position in inches (number) or as a canvas percentage"}),Zh=r.Union([r.Number({minimum:0,description:"Size in inches"}),r.String({pattern:nL,description:\'Percentage of the canvas extent on this axis, e.g. "50%"\'})],{description:"Size in inches (number) or as a canvas percentage"}),dm={x:r.Optional(Xh),y:r.Optional(Xh),w:r.Optional(Zh),h:r.Optional(Zh),rotate:r.Optional(r.Number({description:"Clockwise rotation in degrees"}))},Qh=r.Union([r.Boolean({description:"Single underline in the text colour"}),r.Object({style:r.Optional(r.Union([r.Literal("sng"),r.Literal("dbl"),r.Literal("dash"),r.Literal("dotted")],{description:\'Underline style (default "sng")\'})),color:r.Optional(Mn)},{additionalProperties:!1})],{description:"Underline: true for a single line, or a style/colour object"}),Ic={fontFace:r.Optional(r.String({description:"Font family name"})),fontSize:r.Optional(r.Number({minimum:1,description:"Font size in points"})),bold:r.Optional(r.Boolean()),italic:r.Optional(r.Boolean())},oL=r.Object({text:r.String({description:"Run text"}),color:r.Optional(Mn),...Ic,underline:r.Optional(Qh),strike:r.Optional(r.Boolean({description:"Strikethrough"})),breakLine:r.Optional(r.Boolean({description:"Start a new line after this run"}))},{additionalProperties:!1,description:"A formatted run inside a native visual text element"}),iL=r.Object({text:r.String({description:"Segment text"}),color:r.Optional(Mn),...Ic,breakLine:r.Optional(r.Boolean({description:"Start a new line after this segment"}))},{additionalProperties:!1,description:"A formatted segment of a native visual shape\\u2019s text"}),eg=r.Object({color:r.Optional(Mn),transparency:r.Optional(r.Number({minimum:0,maximum:100,description:"Fill transparency, 0 (opaque) to 100 (invisible)"}))},{additionalProperties:!1,description:"Solid fill. Omit the whole property for no fill; gradients and patterns are raster-only."}),aL=r.Object({color:r.Optional(Mn),width:r.Optional(r.Number({minimum:0,description:"Outline width in points"})),dashType:r.Optional(r.Union([r.Literal("solid"),r.Literal("dash"),r.Literal("dot"),r.Literal("dashDot")],{description:\'Outline dash pattern (default "solid")\'}))},{additionalProperties:!1,description:"Shape outline"}),tg=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("justify")],{description:"Horizontal text alignment"}),rg=r.Union([r.Literal("top"),r.Literal("middle"),r.Literal("bottom")],{description:"Vertical text anchoring inside the box"}),ng=r.Union([r.Number({minimum:0,description:"Inset on every side, in points"}),r.Array(r.Number({minimum:0}),{minItems:4,maxItems:4,description:"Insets as [top, right, bottom, left], in points"})],{description:"Text insets in points"}),fm=r.Object({text:r.Optional(r.String({description:"Plain text content"})),runs:r.Optional(r.Array(oL,{minItems:1,description:\'Formatted runs, as an alternative to "text"\'})),...dm,color:r.Optional(Mn),...Ic,underline:r.Optional(Qh),strike:r.Optional(r.Boolean({description:"Strikethrough"})),align:r.Optional(tg),valign:r.Optional(rg),margin:r.Optional(ng),fill:r.Optional(eg)},{additionalProperties:!1,description:"Native visual text element \\u2014 becomes a Word text box (wps:wsp) inside the drawing group"}),hm=r.Object({type:Zo,...dm,fill:r.Optional(eg),line:r.Optional(aL),text:r.Optional(r.Union([r.String(),r.Array(iL,{minItems:1})],{description:"Text drawn inside the shape"})),...Ic,fontColor:r.Optional(Mn),align:r.Optional(tg),valign:r.Optional(rg),margin:r.Optional(ng),flipH:r.Optional(r.Boolean({description:"Mirror horizontally"})),flipV:r.Optional(r.Boolean({description:"Mirror vertically"}))},{additionalProperties:!1,description:"Native visual shape element \\u2014 becomes a preset-geometry shape (wps:wsp) inside the drawing group"}),gm=r.Object({path:r.Optional(r.String({description:"File path or http(s) URL"})),base64:r.Optional(r.String({description:"Base64 data URI"})),svg:r.Optional(r.String({description:"Raw SVG markup"})),...dm,sizing:r.Optional(r.Object({type:r.Union([r.Literal("contain"),r.Literal("cover"),r.Literal("crop")],{description:"How the image fills its box"}),w:r.Optional(r.Number({minimum:0,description:\'Box width in inches; overrides the element\\u2019s own "w"\'})),h:r.Optional(r.Number({minimum:0,description:\'Box height in inches; overrides the element\\u2019s own "h"\'}))},{additionalProperties:!1,description:\'How the image fills its box. "w"/"h" state the box itself, taking precedence over the element\\u2019s "w"/"h", as they do in raster mode.\'})),alt:r.Optional(r.String({description:"Alternative text for accessibility"}))},{additionalProperties:!1,description:"Native visual image element \\u2014 becomes a native picture inside the drawing group"}),og=["text","shape","image"];function lm(e,t,n){return r.Object({name:r.Literal(e),id:r.Optional(r.String()),enabled:r.Optional(r.Boolean({default:!0,description:"When false, this element is filtered out and not drawn. Defaults to true."})),props:t},{additionalProperties:!1,description:n})}var ym=r.Union([lm("text",fm,"Text element - a native Word text box drawn on the visual canvas."),lm("shape",hm,"Shape element - a native preset-geometry shape, optionally holding text."),lm("image",gm,"Image element - a native picture; an SVG stays vector.")],{$id:"DocxNativeVisualContent",discriminator:{propertyName:"name"},description:"A single native visual element (text, shape, or image)."}),bm=r.Object({width:r.Number({minimum:.1,description:"Canvas width in inches"}),height:r.Number({minimum:.1,description:"Canvas height in inches"}),background:r.Optional(r.Object({color:r.Optional(Mn),image:r.Optional(r.Object({path:r.Optional(r.String()),base64:r.Optional(r.String())},{additionalProperties:!1}))},{additionalProperties:!1,description:"Canvas background. A colour becomes the bottom-most rectangle; an image becomes the bottom-most picture."}))},{additionalProperties:!1,description:"Drawing canvas for a native visual"}),Om=r.Object({color:r.Optional(r.String({description:\'Background color (hex like "#FFFFFF" or a theme color name)\'})),image:r.Optional(r.Object({path:r.Optional(r.String()),base64:r.Optional(r.String())},{additionalProperties:!1}))},{additionalProperties:!1}),xm=r.Object({width:r.Number({minimum:.1,description:"Canvas width in inches (pptx slideWidth)"}),height:r.Number({minimum:.1,description:"Canvas height in inches (pptx slideHeight)"}),theme:r.Optional(r.String({description:"pptx theme name applied to the slide"})),background:r.Optional(Om)},{description:"pptx canvas definition for the visual",additionalProperties:!1}),ig={width:r.Optional(r.Union([r.Number({minimum:1,description:"Rendered width in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Rendered width as percentage (e.g. "90%")\'})],{description:"Rendered width in the document, in pixels (number) or percentage string. Defaults to the canvas physical size."})),height:r.Optional(r.Union([r.Number({minimum:1,description:"Rendered height in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Rendered height as percentage (e.g. "90%")\'})])),alignment:r.Optional(Zr),caption:r.Optional(r.String({description:"Caption (supports rich text with **bold**, *italic*, ***both***)"})),alt:r.Optional(r.String({description:"Alternative text for accessibility"})),spacing:r.Optional(Ct),floating:r.Optional(Oo),keepNext:r.Optional(r.Boolean({description:"Keep paragraph with next paragraph on same page"})),keepLines:r.Optional(r.Boolean({description:"Keep all lines of paragraph together on same page"}))},Sm=r.Object({renderMode:r.Optional(r.Literal("raster",{description:"Render as a rasterized pptx slide (the default when omitted)."})),canvas:xm,elements:r.Optional(r.Array(Ga,{description:"pptx slide content elements (text, image, shape, table, highcharts, chart), positioned with x/y/w/h in inches"})),dpi:r.Optional(r.Number({minimum:La,maximum:va,default:Aa,description:`Raster resolution in DPI (default ${Aa}, range ${La}-${va}). Higher = sharper + larger.`})),serverUrl:r.Optional(r.String({description:"Rasterization service URL override (default from services.pptx)"})),...ig},{$id:"DocxVisualRasterProps",description:"Visual component props (pptx-rendered graphic)",additionalProperties:!1}),Im=r.Object({renderMode:r.Literal("native",{description:\'Draw natively as a Word DrawingML group. Requires the "office-open" renderer.\'}),canvas:bm,elements:r.Optional(r.Array(ym,{description:"Native drawing elements (text, shape, image), positioned with x/y/w/h in inches or canvas percentages"})),...ig},{$id:"DocxVisualNativeProps",description:\'Visual component props (native Word drawing group; requires renderer "office-open")\',additionalProperties:!1}),wc=r.Union([Sm,Im],{description:"Visual component props \\u2014 rasterized pptx slide (default) or a native Word drawing group"}),Cc="native";function ag(e){return!!e&&e.renderMode===Cc}var Cr=["docxjs","office-open"],qa="docxjs",sL=new Set(["text","shape","image"]);function tn(e){return`ComponentDefinition_${e}`}function Pc(e,t,n){let o=um(t);return mm(o,tn(n)),e==="visual"&&n!=="office-open"?lL(o)??o:(n==="office-open"&&pm(o),o)}function $c(e){if(!e||typeof e!="object"||Array.isArray(e))return[];let t=e,n=t.renderer??qa;if(!Cr.includes(n))return[{path:"/renderer",message:`Invalid renderer "${String(n)}". Expected "docxjs" or "office-open".`,code:"invalid_value"}];let o=[],i=n==="office-open",a=(s,c)=>{if(Array.isArray(s)){s.forEach((p,m)=>a(p,`${c}/${m}`));return}if(!s||typeof s!="object")return;let l=s;if(i){let p=l.comment;if(p&&typeof p=="object"&&!Array.isArray(p)){let m=p;for(let u of["replies","resolved"])m[u]!==void 0&&o.push({path:`${c}/comment/${u}`,message:\'The "office-open" renderer does not support comment threads.\',code:"unsupported_renderer_feature"})}}l.name==="visual"&&cL(l,`${c}`,i,o),l.name==="chart"&&!i&&o.push({path:`${c}/name`,message:`Only the "office-open" renderer draws a native chart. Set the document\'s "renderer" to "office-open", or use "highcharts" to render one as an image.`,code:"unsupported_renderer_feature"});for(let[p,m]of Object.entries(l))p!=="renderer"&&a(m,`${c}/${p}`)};return a(t,""),o}function cL(e,t,n,o){let i=e.props;if(!i||typeof i!="object"||Array.isArray(i))return;let a=i;if(a.renderMode!==Cc)return;if(!n){o.push({path:`${t}/props/renderMode`,message:`Only the "office-open" renderer draws a native visual. Set the document\'s "renderer" to "office-open", or drop "renderMode" to rasterize.`,code:"unsupported_renderer_feature"});return}let s=a.elements;Array.isArray(s)&&s.forEach((c,l)=>{if(!c||typeof c!="object"||Array.isArray(c))return;let p=c.name;typeof p!="string"||sL.has(p)||o.push({path:`${t}/props/elements/${l}/name`,message:`A native visual cannot draw "${p}". Native mode holds "text", "shape" and "image"; use renderMode "raster" for anything else.`,code:"unsupported_renderer_feature"})})}function lL(e){let t=e.anyOf;return Array.isArray(t)&&t.length>0?t[0]:void 0}function pm(e){if(Array.isArray(e)){e.forEach(pm);return}if(!e||typeof e!="object")return;let t=e,n=t.properties;if(n?.text&&n?.author&&(n.replies||n.resolved)&&typeof t.description=="string"&&t.description.includes("Word review comment")){delete n.replies,delete n.resolved;let o=t.required;o&&(t.required=o.filter(i=>i!=="replies"&&i!=="resolved"))}for(let o of Reflect.ownKeys(t))pm(t[o])}function mm(e,t){if(Array.isArray(e)){e.forEach(o=>mm(o,t));return}if(!e||typeof e!="object")return;let n=e;n.type==="array"&&n.items&&typeof n.items=="object"&&Object.keys(n.items).length===0&&n.items[g]==="Any"&&(n.items={$ref:t});for(let o of Reflect.ownKeys(n))mm(n[o],t)}function um(e){if(Array.isArray(e))return e.map(um);if(!e||typeof e!="object")return e;let t=Object.create(Object.getPrototypeOf(e));for(let n of Reflect.ownKeys(e))t[n]=um(e[n]);return t}function sg(e){let t=e.definitions??{},n=new Map;for(let i of Cr){let a=tn(i);t[a]&&n.set(i,Ea(t,a,["docx","section"]))}let o=i=>{if(!i||typeof i!="object")return;if(Array.isArray(i)){i.forEach(o);return}let a=i;if(a.properties?.name?.const==="docx"){let s=n.get(a.properties.renderer?.const),c=a.properties.props?.properties?.blocks?.patternProperties;if(s&&c)for(let l of Object.values(c)){l.properties.body.items=s;for(let p of["header","footer"])l.properties.section.properties[p].items=s}}Object.values(a).forEach(o)};o(e)}function cg(e){let t=e.definitions??{};return Cr.filter(n=>t[tn(n)]).map(n=>{let o=tn(n);return{name:o,componentRef:{$ref:`#/definitions/${o}`}}})}var $m=r.Object({type:r.Union([r.Literal("equal"),r.Literal("insert"),r.Literal("delete")],{description:"Segment kind: \'equal\' renders as normal text, \'insert\' as a tracked insertion, \'delete\' as a tracked deletion"}),text:r.String({description:"Literal text of this segment (rendered without markdown)"})},{description:"A contiguous run of text sharing one revision state",additionalProperties:!1}),ei=r.Object({author:r.Optional(r.String({description:\'Revision author shown in Word (default: "json-to-office")\'})),date:r.Optional(r.String({format:"date-time",description:"Revision timestamp (ISO 8601). Defaults to the Unix epoch for deterministic output"})),segments:r.Array($m,{minItems:1,description:"Ordered text segments; concatenating equal+insert segments yields the new text, equal+delete the old text"})},{description:"Tracked-change data: renders the component text as native Word revisions (accept/reject in Word)",additionalProperties:!1}),Tm=r.Object({type:r.Union([r.Literal("insert"),r.Literal("delete")],{description:"Whether the element was inserted or deleted"}),author:r.Optional(r.String({description:\'Revision author shown in Word (default: "json-to-office")\'})),date:r.Optional(r.String({format:"date-time",description:"Revision timestamp (ISO 8601). Defaults to the Unix epoch for deterministic output"}))},{description:"Structural tracked change: the element itself was inserted or deleted",additionalProperties:!1}),pg={text:r.String({minLength:1,description:"Comment body. Newlines split it into separate paragraphs in the comment pane."}),author:r.Optional(r.String({description:\'Comment author shown in Word (default: "json-to-office")\'})),initials:r.Optional(r.String({description:"Author initials shown on the comment bubble (derived from the author when omitted)"})),date:r.Optional(r.String({format:"date-time",description:"Comment timestamp (ISO 8601). Defaults to the Unix epoch for deterministic output"}))},Am=r.Object(pg,{description:"A reply within a comment thread",additionalProperties:!1}),ti=r.Object({...pg,replies:r.Optional(r.Array(Am,{minItems:1,description:"Replies, in order. They anchor to the same text and Word shows them as one thread."})),resolved:r.Optional(r.Boolean({description:"Mark the whole thread resolved (w15:done). Word writes the thread state only when the document contains at least one reply."}))},{description:"A Word review comment anchored to this component\'s text",additionalProperties:!1}),rn=r.Object({text:r.String({description:"Heading text (required)"}),level:r.Optional(dc),font:r.Optional(r.Partial(Fn)),language:r.Optional(om),noProof:r.Optional(im),noProofWords:r.Optional(Na),alignment:r.Optional(ka),spacing:r.Optional(Ct),indent:r.Optional(ja),lineSpacing:r.Optional(r.Union([r.Number({minimum:0}),Ra],{description:"A bare number is a multiple of single spacing. Takes precedence over `font.lineSpacing`. An `exactly` box smaller than the heading it holds is reported as W_QUALITY_LINE_BOX_COLLAPSE."})),pageBreak:r.Optional(r.Boolean({description:"Insert page break before heading"})),columnBreak:r.Optional(r.Boolean({description:"Insert column break before heading"})),numbering:r.Optional(r.Boolean({description:"Number this heading with the document\'s multilevel heading numbering (1., 1.1., 1.1.1.). Set globally via componentDefaults.heading.numbering; false opts a single heading out."})),keepNext:r.Optional(r.Boolean({description:"Keep heading with next paragraph on same page"})),keepLines:r.Optional(r.Boolean({description:"Keep all lines of heading together on same page"})),revision:r.Optional(ei),comment:r.Optional(ti)},{description:"Heading component props",additionalProperties:!1}),Tc=r.Object({id:r.String({minLength:1,pattern:"^[^\\\\]\\\\s]+$",description:\'Marker id referenced from the text as `[^id]`. Any characters except whitespace and "]".\'}),text:r.String({minLength:1,description:"Note body. Newlines split it into separate paragraphs where the note is placed."})},{description:"A note body bound to an inline `[^id]` marker",additionalProperties:!1}),Lm=r.Array(Tc,{description:"Footnote bodies for `[^id]` markers in this paragraph, placed at the foot of the page. An unreferenced body is not emitted.",minItems:1}),vm=r.Array(Tc,{description:"Endnote bodies for `[^id]` markers in this paragraph, collected at the end of the document. An unreferenced body is not emitted.",minItems:1}),pL=r.Union([r.Literal("around"),r.Literal("none"),r.Literal("notBeside"),r.Literal("through"),r.Literal("tight"),r.Literal("auto")],{description:"Frame text wrapping type"}),lg=r.Union([r.Literal("margin"),r.Literal("page"),r.Literal("text")],{description:"Frame anchor type"}),mL=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("inside"),r.Literal("outside")],{description:"Frame horizontal alignment"}),uL=r.Union([r.Literal("top"),r.Literal("center"),r.Literal("bottom"),r.Literal("inside"),r.Literal("outside")],{description:"Frame vertical alignment"}),dL=r.Object({horizontalPosition:r.Optional(r.Object({relative:r.Optional(lg),align:r.Optional(mL),offset:r.Optional(r.Union([r.Number({description:"Horizontal offset in twips (1/20 of a point)"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Horizontal offset as percentage (e.g., "50%") relative to page or margin width\'})]))},{description:"Horizontal positioning (use either align or offset, not both)",additionalProperties:!1})),verticalPosition:r.Optional(r.Object({relative:r.Optional(lg),align:r.Optional(uL),offset:r.Optional(r.Union([r.Number({description:"Vertical offset in twips (1/20 of a point)"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Vertical offset as percentage (e.g., "50%") relative to page or margin height\'})]))},{description:"Vertical positioning (use either align or offset, not both)",additionalProperties:!1})),wrap:r.Optional(r.Object({type:pL},{description:"Text wrapping configuration",additionalProperties:!1})),lockAnchor:r.Optional(r.Boolean({description:"Lock the anchor position"})),width:r.Optional(r.Number({minimum:1,description:"Frame width in twips (DXA units)"})),height:r.Optional(r.Number({minimum:1,description:"Frame height in twips (DXA units)"}))},{description:"Floating text frame properties",additionalProperties:!1}),fL=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("justify")],{description:"Paragraph text alignment"}),nn=r.Object({text:r.String({description:"Text content (required)"}),font:r.Optional(r.Partial(Fn)),themeStyle:r.Optional(r.String()),language:r.Optional(om),noProof:r.Optional(im),noProofWords:r.Optional(Na),boldColor:r.Optional(X),spacing:r.Optional(Ct),alignment:r.Optional(fL),indent:r.Optional(ja),tabStops:r.Optional(fc),pageBreak:r.Optional(r.Boolean({description:"Insert page break before paragraph"})),columnBreak:r.Optional(r.Boolean({description:"Insert column break before paragraph"})),floating:r.Optional(dL),keepNext:r.Optional(r.Boolean({description:"Keep paragraph with next paragraph on same page"})),keepLines:r.Optional(r.Boolean({description:"Keep all lines of paragraph together on same page"})),id:r.Optional(r.String({description:"Unique identifier for internal linking (bookmark anchor)"})),revision:r.Optional(ei),comment:r.Optional(ti),footnotes:r.Optional(Lm),endnotes:r.Optional(vm)},{description:"Paragraph component props (font nested for theme consistency; no flat font properties)",additionalProperties:!1}),on=r.Object({path:r.Optional(r.String({description:"Image source URL or file path (mutually exclusive with base64 and svg)"})),base64:r.Optional(r.String({description:\'Base64-encoded image data in data URI format (e.g., "data:image/png;base64,iVBORw0KGgo...") (mutually exclusive with path and svg)\'})),svg:r.Optional(r.String({description:\'Raw inline SVG markup, e.g. "<svg xmlns=\\\\"http://www.w3.org/2000/svg\\\\" viewBox=\\\\"0 0 24 24\\\\">...</svg>" (mutually exclusive with path and base64). Renders as a vector image (Word 2016+); intrinsic size taken from the SVG viewBox/width/height when width/height omitted.\'})),alt:r.Optional(r.String({description:"Alternative text for accessibility"})),width:r.Optional(r.Union([r.Number({minimum:1,description:"Image width in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Image width as percentage (e.g., "90%") relative to widthRelativeTo (defaults to content width)\'})],{description:\'Image width in pixels (number) or as percentage string (e.g., "90%")\',default:"100%"})),height:r.Optional(r.Union([r.Number({minimum:1,description:"Image height in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Image height as percentage (e.g., "90%") relative to heightRelativeTo (defaults to content height)\'})],{description:\'Image height in pixels (number) or as percentage string (e.g., "90%")\'})),widthRelativeTo:r.Optional(r.Union([r.Literal("content"),r.Literal("page")],{description:"Reference for width percentages: content (page width minus margins) or page (full page width)",default:"content"})),heightRelativeTo:r.Optional(r.Union([r.Literal("content"),r.Literal("page")],{description:"Reference for height percentages: content (page height minus margins) or page (full page height)",default:"content"})),alignment:r.Optional(Zr),caption:r.Optional(r.String({description:"Image caption (supports rich text with **bold**, *italic*, ***both***)"})),spacing:r.Optional(Ct),floating:r.Optional(Oo),keepNext:r.Optional(r.Boolean({description:"Keep paragraph with next paragraph on same page"})),keepLines:r.Optional(r.Boolean({description:"Keep all lines of paragraph together on same page"}))},{description:"Image component props",additionalProperties:!1}),an=r.Object({number:r.String({description:"Statistic number/value (required)"}),description:r.String({description:"Statistic description (required)"}),unit:r.Optional(r.String({description:"Unit of measurement"})),format:r.Optional(r.String({description:"Number format pattern"})),trend:r.Optional(r.Union([r.Literal("up"),r.Literal("down"),r.Literal("neutral")])),trendValue:r.Optional(r.Union([r.String(),r.Number()])),alignment:r.Optional(Zr),spacing:r.Optional(Ct),size:r.Optional(r.Union([r.Literal("small"),r.Literal("medium"),r.Literal("large")]))},{description:"Statistic component props",additionalProperties:!1}),hL=r.Recursive(e=>r.Union([r.String(),r.Object({name:r.String(),props:r.Object({},{additionalProperties:!0}),children:r.Optional(r.Array(e))},{additionalProperties:!1})])),mg=r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("justify")],{description:"Horizontal text alignment"}),ug=r.Union([r.Literal("top"),r.Literal("middle"),r.Literal("bottom")],{description:"Vertical cell alignment"}),dg=r.Object({family:r.Optional(r.String({description:"Font family name"})),size:r.Optional(r.Number({minimum:0,description:"Font size in points"})),bold:r.Optional(r.Boolean({description:"Bold text"})),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900,description:"Per-cell weight (100\\u2013900). Overrides `bold` when set."})),italic:r.Optional(r.Boolean({description:"Italic text"})),underline:r.Optional(r.Boolean({description:"Underlined text"})),lineSpacing:r.Optional(r.Object({...Ra.properties},{description:"Line spacing of the cell\'s paragraph. Overrides the theme\'s tableCell style; `exactly` gives dense, fixed-height rows.",additionalProperties:!1}))},{additionalProperties:!1}),Cm=r.Union([r.String({description:"Border color for all sides (hex without #)"}),r.Object({bottom:r.Optional(r.String({description:"Bottom border color (hex without #)"})),top:r.Optional(r.String({description:"Top border color (hex without #)"})),right:r.Optional(r.String({description:"Right border color (hex without #)"})),left:r.Optional(r.String({description:"Left border color (hex without #)"}))},{additionalProperties:!1})]),Pm=r.Union([r.Number({minimum:0,description:"Border size for all sides in points"}),r.Object({bottom:r.Optional(r.Number({minimum:0,description:"Bottom border size in points"})),top:r.Optional(r.Number({minimum:0,description:"Top border size in points"})),right:r.Optional(r.Number({minimum:0,description:"Right border size in points"})),left:r.Optional(r.Number({minimum:0,description:"Left border size in points"}))},{additionalProperties:!1})]),gL=r.Union([r.Boolean({description:"Hide all borders when true. A side named in a cell/column per-side borderColor or borderSize keeps its border"}),r.Object({bottom:r.Optional(r.Boolean({description:"Hide bottom border"})),top:r.Optional(r.Boolean({description:"Hide top border"})),right:r.Optional(r.Boolean({description:"Hide right border"})),left:r.Optional(r.Boolean({description:"Hide left border"})),insideHorizontal:r.Optional(r.Boolean({description:"Hide horizontal borders between rows"})),insideVertical:r.Optional(r.Boolean({description:"Hide vertical borders between columns"}))},{description:"Selectively hide specific borders",additionalProperties:!1})]),fg=r.Union([r.Number({minimum:0,description:"Padding for all sides in points"}),r.Object({bottom:r.Optional(r.Number({minimum:0,description:"Bottom padding in points"})),top:r.Optional(r.Number({minimum:0,description:"Top padding in points"})),right:r.Optional(r.Number({minimum:0,description:"Right padding in points"})),left:r.Optional(r.Number({minimum:0,description:"Left padding in points"}))},{additionalProperties:!1})]),wm=r.Object({color:r.Optional(X),backgroundColor:r.Optional(nm),horizontalAlignment:r.Optional(mg),verticalAlignment:r.Optional(ug),font:r.Optional(dg),borderColor:r.Optional(Cm),borderSize:r.Optional(Pm),padding:r.Optional(fg),height:r.Optional(r.Number({minimum:0,description:"Cell height in points"}))},{additionalProperties:!1});function Em(e){let t=r.Union([r.String(),e]),n={color:r.Optional(X),backgroundColor:r.Optional(nm),horizontalAlignment:r.Optional(mg),verticalAlignment:r.Optional(ug),font:r.Optional(dg),borderColor:r.Optional(Cm),borderSize:r.Optional(Pm),padding:r.Optional(fg),height:r.Optional(r.Number({minimum:0,description:"Cell height in points"})),comment:r.Optional(ti),revision:r.Optional(ei)},o=r.Object({...n,content:r.Optional(t)},{additionalProperties:!1}),i=r.Object({...n,content:r.Optional(t)},{additionalProperties:!1}),a=r.Object({width:r.Optional(r.Union([r.Number({minimum:0,description:"Column width in points. When set on some columns, remaining columns will automatically share the leftover table space equally. Leave undefined to distribute space evenly among unspecified columns."}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Column width as percentage of available width (e.g., "40%")\'})])),cellDefaults:r.Optional(wm),header:r.Optional(o),cells:r.Optional(r.Array(i))},{additionalProperties:!1});return r.Object({borderColor:r.Optional(Cm),borderSize:r.Optional(Pm),hideBorders:r.Optional(gL),cellDefaults:r.Optional(wm),headerCellDefaults:r.Optional(wm),width:r.Optional(r.Number({minimum:0,maximum:100,description:"Table width in percentage (0-100)"})),columns:r.Array(a,{description:"Table columns with headers and cells",minItems:1}),rows:r.Optional(r.Array(r.Object({revision:r.Optional(Tm),cantSplit:r.Optional(r.Boolean({description:"Keep this row on one page"})),tableHeader:r.Optional(r.Boolean({description:"Repeat this row as a header on each page"}))},{additionalProperties:!1}),{description:"Row-parallel properties, indexed like `columns[].cells`. The model is column-major, so anything that belongs to a whole row lives here."})),keepInOnePage:r.Optional(r.Boolean({description:"Keep table rows together on the same page by setting keepNext on all paragraphs"})),keepNext:r.Optional(r.Boolean({description:"Set keepNext on the last row to keep it connected to the next element. Works independently of keepInOnePage. Defaults to false."})),repeatHeaderOnPageBreak:r.Optional(r.Boolean({description:"Repeat the header row on each page when the table spans multiple pages. Defaults to true.",default:!0}))},{description:"Table component props with column-based structure",additionalProperties:!1})}var sn=Em(hL),Nm=e=>r.Object({meta:r.Optional(r.Object({title:r.Optional(r.String({description:"Authoring label for this section, shown in editors and outlines. Never rendered \\u2014 add a heading child for a visible title."}))},{additionalProperties:!1,description:"Authoring metadata; has no effect on the document."})),header:r.Optional(r.Union([r.Array(e||r.Any(),{description:"Section header components"}),r.Literal("linkToPrevious",{description:"Link header to previous section"})])),footer:r.Optional(r.Union([r.Array(e||r.Any(),{description:"Section footer components"}),r.Literal("linkToPrevious",{description:"Link footer to previous section"})])),pageBreak:r.Optional(r.Boolean({description:"Insert page break before section",default:!0})),spacing:r.Optional(Ct),page:r.Optional(r.Object({size:r.Optional(r.Union([r.Literal("A4"),r.Literal("A3"),r.Literal("LETTER"),r.Literal("LEGAL"),r.Object({width:r.Number({minimum:0}),height:r.Number({minimum:0})})])),margins:r.Optional(r.Object({top:r.Optional(r.Number({minimum:0})),bottom:r.Optional(r.Number({minimum:0})),left:r.Optional(r.Number({minimum:0})),right:r.Optional(r.Number({minimum:0})),header:r.Optional(r.Number({minimum:0})),footer:r.Optional(r.Number({minimum:0})),gutter:r.Optional(r.Number({minimum:0}))},{additionalProperties:!1}))},{description:"Page configuration override for this section (overrides theme page settings)",additionalProperties:!1}))},{description:"Section component props",additionalProperties:!1}),cn=Nm(),yL=r.Object({width:r.Optional(r.Union([r.Number({minimum:1,description:"Column width in points"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Column width as percentage of available width (e.g., "30%")\'}),r.Literal("auto",{description:"Auto width: consume remaining space after fixed widths and gaps"})])),gap:r.Optional(r.Union([r.Number({minimum:0,description:"Gap after this column in points"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Gap after this column as percentage of available width (e.g., "5%")\'})]))},{additionalProperties:!1}),ln=r.Object({columns:r.Union([r.Number({minimum:1,description:"Number of equal-width columns (converter will normalize to array)"}),r.Array(yL,{minItems:1,description:"List of columns in order; width and gap can be points, percentages, or auto width"})]),gap:r.Optional(r.Union([r.Number({minimum:0,description:"Default gap applied after each column except the last (points)"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Default gap applied after each column except the last as percentage of available width (e.g., "5%")\'})]))},{description:"Columns component props",additionalProperties:!1}),hg=r.Union([r.Literal("decimal"),r.Literal("upperRoman"),r.Literal("lowerRoman"),r.Literal("upperLetter"),r.Literal("lowerLetter"),r.Literal("bullet"),r.Literal("ordinal"),r.Literal("cardinalText"),r.Literal("ordinalText"),r.Literal("hex"),r.Literal("chicago"),r.Literal("ideographDigital"),r.Literal("japaneseCounting"),r.Literal("aiueo"),r.Literal("iroha"),r.Literal("decimalFullWidth"),r.Literal("decimalHalfWidth"),r.Literal("japaneseLegal"),r.Literal("japaneseDigitalTenThousand"),r.Literal("decimalEnclosedCircle"),r.Literal("decimalFullWidth2"),r.Literal("aiueoFullWidth"),r.Literal("irohaFullWidth"),r.Literal("decimalZero"),r.Literal("ganada"),r.Literal("chosung"),r.Literal("decimalEnclosedFullstop"),r.Literal("decimalEnclosedParen"),r.Literal("decimalEnclosedCircleChinese"),r.Literal("ideographEnclosedCircle"),r.Literal("ideographTraditional"),r.Literal("ideographZodiac"),r.Literal("ideographZodiacTraditional"),r.Literal("taiwaneseCounting"),r.Literal("ideographLegalTraditional"),r.Literal("taiwaneseCountingThousand"),r.Literal("taiwaneseDigital"),r.Literal("chineseCounting"),r.Literal("chineseLegalSimplified"),r.Literal("chineseCountingThousand"),r.Literal("koreanDigital"),r.Literal("koreanCounting"),r.Literal("koreanLegal"),r.Literal("koreanDigital2"),r.Literal("vietnameseCounting"),r.Literal("russianLower"),r.Literal("russianUpper"),r.Literal("none"),r.Literal("numberInDash"),r.Literal("hebrew1"),r.Literal("hebrew2"),r.Literal("arabicAlpha"),r.Literal("arabicAbjad"),r.Literal("hindiVowels"),r.Literal("hindiConsonants"),r.Literal("hindiNumbers"),r.Literal("hindiCounting"),r.Literal("thaiLetters"),r.Literal("thaiNumbers"),r.Literal("thaiCounting")],{description:"Number or bullet format for list levels"}),km=r.Object({family:r.Optional(r.String({description:"Font family name"})),size:r.Optional(r.Number({minimum:1,description:"Marker size in points"})),color:r.Optional(X),bold:r.Optional(r.Boolean({description:"Bold marker"})),italic:r.Optional(r.Boolean({description:"Italic marker"})),underline:r.Optional(r.Boolean({description:"Underlined marker"}))},{description:"Styling for the number/bullet glyph only. The list text is unaffected.",additionalProperties:!1}),bL=r.Object({level:r.Number({minimum:0,maximum:8,description:"Nesting level (0 = root, 1 = first sublevel, etc.)"}),format:r.Optional(hg),text:r.Optional(r.String({description:\'Number format string (e.g., "%1." for "1.", "%1)" for "1)", custom bullet character for bullet format)\'})),alignment:r.Optional(r.Union([r.Literal("start"),r.Literal("end"),r.Literal("left"),r.Literal("right"),r.Literal("center")],{description:"Alignment of the numbering/bullet"})),indent:r.Optional(Un),start:r.Optional(r.Number({minimum:1,description:"Starting number for this level (default: 1)"})),font:r.Optional(km)},{description:"Configuration for a single list level",additionalProperties:!1}),pn=r.Object({items:r.Array(r.Union([r.String(),r.Object({text:r.String(),level:r.Optional(r.Number({minimum:0,maximum:8,description:"Nesting level for this item"})),id:r.Optional(r.String({description:"Bookmark id for this item, targetable by internal links (#id) and cross-references ([@id])"})),revision:r.Optional(ei)},{additionalProperties:!1})]),{description:"List items (required)",minItems:1}),reference:r.Optional(r.String({description:"Unique reference ID for this numbering configuration (auto-generated if not provided)"})),levels:r.Optional(r.Array(bL,{description:"Configuration for each nesting level",minItems:1,maxItems:9})),format:r.Optional(r.Union([hg,r.Literal("numbered"),r.Literal("none")],{description:"Format for level 0 (simplified option when levels not specified)"})),bullet:r.Optional(r.String({description:"Custom bullet character (simplified option when levels not specified)"})),start:r.Optional(r.Number({minimum:1,description:"Starting number for level 0. Applies whether or not `levels` is given; a `start` on the level itself wins."})),spacing:r.Optional(Gh),alignment:r.Optional(ka),indent:r.Optional(r.Union([r.Number({minimum:0}),Un])),comment:r.Optional(ti)},{description:"List component props",additionalProperties:!1}),Rm=["revision","comment","footnotes","endnotes"],OL=r.Partial(r.Omit(rn,Rm)),xL=r.Partial(r.Omit(nn,Rm)),SL=r.Partial(on),IL=r.Partial(an),wL=r.Partial(r.Omit(sn,["rows"])),CL=r.Partial(cn),PL=r.Partial(ln),$L=r.Partial(r.Omit(pn,Rm)),Ac=r.Object({heading:r.Optional(OL),paragraph:r.Optional(xL),image:r.Optional(SL),statistic:r.Optional(IL),table:r.Optional(wL),section:r.Optional(CL),columns:r.Optional(PL),list:r.Optional($L)},{additionalProperties:!0});var TL=r.Object({top:r.Number({minimum:0}),bottom:r.Number({minimum:0}),left:r.Number({minimum:0}),right:r.Number({minimum:0}),header:r.Number({minimum:0}),footer:r.Number({minimum:0}),gutter:r.Number({minimum:0})},{additionalProperties:!1,description:"Document margin configuration"}),G6=r.Object({width:r.Number({minimum:0}),height:r.Number({minimum:0})},{additionalProperties:!1,description:"Page dimensions in twips"}),AL=r.Object({size:r.Union([r.Literal("A4"),r.Literal("A3"),r.Literal("LETTER"),r.Literal("LEGAL"),r.Object({width:r.Number({minimum:0}),height:r.Number({minimum:0})},{additionalProperties:!1})],{description:"Standard page size or custom dimensions"}),margins:TL},{description:"Page configuration including dimensions and margins",additionalProperties:!1}),gg=r.Object({heading:Fn,body:Fn,mono:Fn,light:Fn},{additionalProperties:!1,description:"Font definitions for different text types"}),LL=r.Union([r.Literal("single"),r.Literal("dashDotStroked"),r.Literal("dashed"),r.Literal("dashSmallGap"),r.Literal("dotDash"),r.Literal("dotDotDash"),r.Literal("dotted"),r.Literal("double"),r.Literal("doubleWave"),r.Literal("inset"),r.Literal("nil"),r.Literal("none"),r.Literal("outset"),r.Literal("thick"),r.Literal("thickThinLargeGap"),r.Literal("thickThinMediumGap"),r.Literal("thickThinSmallGap"),r.Literal("thinThickLargeGap"),r.Literal("thinThickMediumGap"),r.Literal("thinThickSmallGap"),r.Literal("thinThickThinLargeGap"),r.Literal("thinThickThinMediumGap"),r.Literal("thinThickThinSmallGap"),r.Literal("threeDEmboss"),r.Literal("threeDEngrave"),r.Literal("triple"),r.Literal("wave")],{description:"Paragraph border style"}),yg={style:LL,size:r.Number({minimum:0,description:"Width in eighths of a point (docx sz)"}),color:X,space:r.Optional(r.Number({minimum:0,description:"Space between text and border in points"}))},Lc=r.Object(yg,{additionalProperties:!1,description:"Paragraph border side definition"}),vL=r.Object(yg,{additionalProperties:!1,description:"Rule drawn between consecutive paragraphs sharing this border set (w:between), in place of their adjoining bottom and top edges"}),bg=r.Object({top:r.Optional(Lc),bottom:r.Optional(Lc),left:r.Optional(Lc),right:r.Optional(Lc),between:r.Optional(vL)},{additionalProperties:!1,description:"Paragraph borders (per side, plus the between-paragraph rule)"}),Og=r.Optional(r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("justify")])),sr=r.Object({font:r.Optional(r.Union([r.Literal("heading"),r.Literal("body"),r.Literal("mono"),r.Literal("light")])),...uc.properties,alignment:Og,priority:r.Optional(r.Number()),baseStyle:r.Optional(r.String()),followingStyle:r.Optional(r.String()),widowControl:r.Optional(r.Boolean()),keepNext:r.Optional(r.Boolean()),keepLinesTogether:r.Optional(r.Boolean()),outlineLevel:r.Optional(r.Number()),borders:r.Optional(bg),indent:r.Optional(Un)},{additionalProperties:!1}),EL=r.Union([r.Literal("dot"),r.Literal("hyphen"),r.Literal("middleDot"),r.Literal("none"),r.Literal("underscore")],{description:"Tab leader style: dot (dotted), hyphen (dashed), middleDot, none (blank), or underscore"}),NL=r.Union([r.Literal("left"),r.Literal("right"),r.Literal("center"),r.Literal("bar"),r.Literal("clear"),r.Literal("decimal"),r.Literal("end"),r.Literal("num"),r.Literal("start")],{description:"Tab stop alignment type"}),kL=r.Object({type:NL,position:r.Union([r.Number({description:"Tab stop position in twips (1/1440 inch). Common: 9026 for right-aligned at page margin"}),r.Literal("max",{description:"Use maximum position (TabStopPosition.MAX = 9026 twips)"})]),leader:r.Optional(EL)},{description:"Tab stop configuration with position, alignment, and optional leader",additionalProperties:!1}),ri=r.Object({font:r.Optional(r.Union([r.Literal("heading"),r.Literal("body"),r.Literal("mono"),r.Literal("light")])),...uc.properties,alignment:Og,tabStops:r.Optional(r.Array(kL,{description:"Tab stops for TOC entries. Use right-aligned tab with leader to create dotted lines to page numbers.",default:[{type:"right",position:"max",leader:"none"}]})),priority:r.Optional(r.Number()),followingStyle:r.Optional(r.String()),widowControl:r.Optional(r.Boolean()),keepNext:r.Optional(r.Boolean()),keepLinesTogether:r.Optional(r.Boolean()),outlineLevel:r.Optional(r.Number()),borders:r.Optional(bg),indent:r.Optional(Un)},{additionalProperties:!1}),xg=r.Object({normal:r.Optional(sr),heading1:r.Optional(sr),heading2:r.Optional(sr),heading3:r.Optional(sr),heading4:r.Optional(sr),heading5:r.Optional(sr),heading6:r.Optional(sr),title:r.Optional(sr),subtitle:r.Optional(sr),TOC1:r.Optional(ri),TOC2:r.Optional(ri),TOC3:r.Optional(ri),TOC4:r.Optional(ri),TOC5:r.Optional(ri),TOC6:r.Optional(ri)},{additionalProperties:sr,description:"Style definitions supporting predefined styles (normal, heading1..6, title, subtitle), TOC entry styles (TOC1..TOC6), and arbitrary custom styles."}),q6=r.Object({level:r.Union([r.Literal(1),r.Literal(2),r.Literal(3),r.Literal(4),r.Literal(5),r.Literal(6)]),...sr.properties},{additionalProperties:!1}),Sg=r.Object({primary:X,secondary:X,accent:X,text:X,background:X,border:X,textPrimary:X,textSecondary:X,textMuted:X,borderPrimary:X,borderSecondary:X,backgroundPrimary:X,backgroundSecondary:X,accent4:r.Optional(X),accent5:r.Optional(X),accent6:r.Optional(X)},{additionalProperties:!1}),vc=r.Object({...Nn,colors:r.Optional(r.Partial(Sg)),fonts:r.Optional(r.Partial(gg)),styles:r.Optional(xg)},{additionalProperties:!1,description:"Partial theme deep-merged over the resolved named theme: define or override palette tokens, font roles, and named styles in-document."}),ni=r.Object({...Nn,$schema:r.Optional(r.String()),name:r.String(),displayName:r.String(),description:r.String(),version:r.String(),colors:Sg,fonts:gg,fontRegistry:r.Optional(Ir),page:AL,styles:r.Optional(xg),componentDefaults:r.Optional(Ac),noProofWords:r.Optional(r.Array(r.String({minLength:1}),{description:"Words that should never be flagged as misspelled (whole-word, case-insensitive)."}))},{additionalProperties:!1,description:"Theme configuration"});function Ig(e){return $.Check(ni,e)}function wg(e="minimal-theme"){return{name:e,displayName:e.split(/[-_\\s]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")||e,description:"A minimal theme with basic styling",version:"1.0.0",colors:{primary:"#2563EB",secondary:"#64748B",accent:"#F8FAFC",text:"#334155",background:"#FFFFFF",border:"#E2E8F0",textPrimary:"#334155",textSecondary:"#64748B",textMuted:"#94A3B8",borderPrimary:"#CBD5E1",borderSecondary:"#E2E8F0",backgroundPrimary:"#FFFFFF",backgroundSecondary:"#F8FAFC"},fonts:{heading:{family:"Arial",size:14},body:{family:"Arial",size:11},mono:{family:"Courier New",size:10},light:{family:"Arial",size:10}},page:{size:"A4",margins:{top:1440,bottom:1440,left:1440,right:1440,header:720,footer:720,gutter:0}},styles:{normal:{font:"body",size:11,color:"#334155",alignment:"left",lineSpacing:{type:"multiple",value:1.15},spacing:{after:8}}}}}var jm=r.Object({},{additionalProperties:!1}),RL=e=>r.Object({blocks:r.Optional(Yr),theme:r.Optional(r.String({description:\'Theme name to apply (default: "minimal"). Built-ins: consulting (the house style), minimal, devportal, vermilion.\',examples:["consulting","minimal","devportal","vermilion"],default:"minimal"})),themeOverrides:r.Optional(vc),fontRegistry:r.Optional(Ir),componentDefaults:r.Optional(Ac),language:r.Optional(r.String({pattern:"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$",description:`Default document language (BCP-47 tag, e.g. "en-US"). Sets Word\'s default proofing/spell-check language; individual components can override it locally.`,examples:["en-US","fr-FR","de-DE","it-IT","es-ES"]})),noProofWords:r.Optional(Na),trackRevisions:r.Optional(r.Boolean({description:"Open the document in track-changes mode: Word marks any further edits as revisions. Set automatically on redline documents produced by the diff engine"})),metadata:r.Optional(r.Object({title:r.Optional(r.String({description:"Document title",examples:["Annual Report 2024","Technical Documentation"]})),subtitle:r.Optional(r.String({description:"Document subtitle"})),description:r.Optional(r.String()),author:r.Optional(r.String()),company:r.Optional(r.String({description:"Company name, written to docProps/custom.xml (Word has no core-property slot for it)"})),date:r.Optional(r.String({description:"Document date used by {DATE}/{DATETIME} placeholders (defaults to the generation timestamp)"})),version:r.Optional(r.String({description:"Document version, written to docProps/custom.xml",examples:["1.0","2024.3"]})),tags:r.Optional(r.Array(r.String()))},{description:"Document metadata (title, author, company, version, etc.). Package timestamps (dcterms:created/modified) are not part of this object: they come from the `generatedAt` generation option so repeated builds stay byte-identical.",additionalProperties:!1}))},{description:"Report component props",additionalProperties:!1}),mn=RL(),Fm=r.Object({width:r.Optional(r.Union([r.Number({minimum:1,description:"Text box width in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Text box width as percentage (e.g., "50%") relative to content width\'})],{description:\'Text box width in pixels (number) or as percentage string (e.g., "50%")\'})),height:r.Optional(r.Union([r.Number({minimum:1,description:"Text box height in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Text box height as percentage (e.g., "50%") relative to content height\'})],{description:\'Text box height in pixels (number) or as percentage string (e.g., "50%")\'})),renderAs:r.Optional(r.Union([r.Literal("table"),r.Literal("shape")],{description:"Rendering strategy. \'table\' (default): borderless one-cell table \\u2014 height auto-fits content, per-side borders and percentage widths resolve in Word. \'shape\': native Word text box (WPS shape) \\u2014 real wrap modes and z-order, but requires explicit width and height (no autofit), a single uniform border, and eagerly-resolved percentage sizes."})),floating:r.Optional(Oo),style:r.Optional(r.Object({padding:r.Optional(r.Object({top:r.Optional(r.Number({minimum:0})),right:r.Optional(r.Number({minimum:0})),bottom:r.Optional(r.Number({minimum:0})),left:r.Optional(r.Number({minimum:0}))},{additionalProperties:!1})),border:r.Optional(r.Object({top:r.Optional(r.Object({style:r.Optional(r.Union([r.Literal("solid"),r.Literal("dashed"),r.Literal("dotted"),r.Literal("double"),r.Literal("none")])),width:r.Optional(r.Number({minimum:0})),color:r.Optional(X)},{additionalProperties:!1})),right:r.Optional(r.Object({style:r.Optional(r.Union([r.Literal("solid"),r.Literal("dashed"),r.Literal("dotted"),r.Literal("double"),r.Literal("none")])),width:r.Optional(r.Number({minimum:0})),color:r.Optional(X)},{additionalProperties:!1})),bottom:r.Optional(r.Object({style:r.Optional(r.Union([r.Literal("solid"),r.Literal("dashed"),r.Literal("dotted"),r.Literal("double"),r.Literal("none")])),width:r.Optional(r.Number({minimum:0})),color:r.Optional(X)},{additionalProperties:!1})),left:r.Optional(r.Object({style:r.Optional(r.Union([r.Literal("solid"),r.Literal("dashed"),r.Literal("dotted"),r.Literal("double"),r.Literal("none")])),width:r.Optional(r.Number({minimum:0})),color:r.Optional(X)},{additionalProperties:!1}))},{additionalProperties:!1})),shading:r.Optional(r.Object({fill:r.Optional(X)},{additionalProperties:!1}))},{additionalProperties:!1}))},{additionalProperties:!1,allOf:[{if:{properties:{renderAs:{const:"shape"}},required:["renderAs"]},then:{required:["width","height"],properties:{style:{properties:{border:{properties:Object.fromEntries(["top","right","bottom","left"].map(e=>[e,{properties:{style:{enum:["solid","none"]}}}]))}}}}}}]}),jL=r.Union([r.Literal("numeric"),r.Literal("bullet"),r.Literal("none")],{description:"TOC numbering style \\u2014 accepted but not applied (Word TOC fields carry no numbering switch); setting it logs a warning during generation"}),FL=r.Union([r.Literal("document"),r.Literal("section")],{description:"TOC scope: document-wide or section-only"}),UL=r.Object({styleId:r.String({description:"Custom style ID matching a key in theme.styles"}),level:r.Number({minimum:1,maximum:6,description:"TOC level (1-6) to assign to this style"})},{description:"Mapping of custom style to TOC level",additionalProperties:!1}),az=r.Object({from:r.Optional(r.Number({minimum:1,maximum:6,default:1,description:"Starting heading level (1-6). Defaults to 1 if not specified."})),to:r.Optional(r.Number({minimum:1,maximum:6,default:3,description:"Ending heading level (1-6). Defaults to 3 if not specified."}))},{description:\'Range of heading levels to include in TOC. Specify at least one of "from" or "to".\',additionalProperties:!1}),Um=r.Object({pageBreak:r.Optional(r.Boolean({description:"Insert page break before TOC block"})),depth:r.Optional(r.Object({from:r.Optional(r.Number({minimum:1,maximum:6,default:1,description:"Starting heading level (1-6). Defaults to 1 if not specified."})),to:r.Optional(r.Number({minimum:1,maximum:6,default:3,description:"Ending heading level (1-6). Defaults to 3 if not specified."}))},{description:\'Range of heading levels to include in TOC. Specify "from", "to", or both. Defaults: from=1, to=3\',additionalProperties:!1,default:{to:3}})),pageNumbersDepth:r.Optional(r.Object({from:r.Optional(r.Number({minimum:1,maximum:6,default:1,description:"Starting heading level (1-6). Defaults to 1 if not specified."})),to:r.Optional(r.Number({minimum:1,maximum:6,default:3,description:"Ending heading level (1-6). Defaults to 3 if not specified."}))},{description:\'Range of heading levels to show page numbers. Specify "from", "to", or both. When specified, page numbers are hidden for entries outside this range.\',additionalProperties:!1})),numberingStyle:r.Optional(jL),title:r.Optional(r.String({description:"TOC heading title"})),includePageNumbers:r.Optional(r.Boolean({default:!0,description:"Show page numbers next to entries"})),numberSeparator:r.Optional(r.Boolean({default:!0,description:\'Use tab separator between entry and page number. True applies "\\\\t" (default), false applies " "\'})),scope:r.Optional(r.Union([FL,r.Literal("auto")],{default:"auto",description:\'TOC scope: "document" for entire document, "section" for parent section only, "auto" for automatic detection (section if inside section, otherwise document)\'})),styles:r.Optional(r.Array(UL,{description:"Custom style mappings for TOC entries. Maps custom theme styles to TOC levels."}))},{description:"Table of Contents component props",additionalProperties:!1}),Dm=r.Object({thickness:r.Optional(r.Number({minimum:.25,maximum:12,description:"Line weight in points (default 1). OOXML measures a border in eighths of a point and Word stops at 12pt, so this is the whole usable range."})),color:r.Optional(X),style:r.Optional(r.Union([r.Literal("solid"),r.Literal("dashed"),r.Literal("dotted"),r.Literal("double")],{description:\'Line style (default "solid"). `double` draws two lines and is measured per line, so it reads about twice as tall as its thickness.\'})),width:r.Optional(r.Union([r.Number({minimum:1,description:"Divider width in points"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Divider width as a percentage of the text measure (e.g. "40%")\'})],{description:"How far the line runs (default: the full text measure). A percentage or a point width is turned into paragraph indents, resolved against the theme page \\u2014 so a partial divider inside a column or a re-margined section is measured against the page, while the default full-measure divider is exact everywhere."})),alignment:r.Optional(r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right")],{description:\'Which end of the measure a partial divider sits at (default "left"). Ignored at full width.\'})),spacing:r.Optional(Ct)},{description:"Horizontal divider \\u2014 a thin line across the measure, drawn as a Word paragraph border so it stays editable in Word.",additionalProperties:!1}),Mm=r.Object({options:r.Intersect([r.Record(r.String(),r.Unknown()),r.Object({chart:r.Object({width:r.Number(),height:r.Number()})})]),scale:r.Optional(r.Number()),resources:r.Optional(r.Object({css:r.Optional(r.String()),js:r.Optional(r.String()),files:r.Optional(r.Array(r.String()))})),serverUrl:r.Optional(r.String({description:"Highcharts Export Server URL (default: http://localhost:7801)"})),width:r.Optional(r.Union([r.Number({minimum:1,description:"Image width in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Image width as percentage (e.g., "90%") relative to content width\'})],{description:\'Rendered image width in pixels (number) or as percentage string (e.g., "90%")\'})),height:r.Optional(r.Union([r.Number({minimum:1,description:"Image height in pixels"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Image height as percentage (e.g., "90%") relative to content height\'})],{description:\'Rendered image height in pixels (number) or as percentage string (e.g., "90%")\'}))}),DL=r.Union([r.Literal("area"),r.Literal("bar"),r.Literal("column"),r.Literal("doughnut"),r.Literal("line"),r.Literal("pie"),r.Literal("radar"),r.Literal("scatter")],{description:"Chart type"}),ML=r.Object({name:r.Optional(r.String({description:"Series name"})),labels:r.Optional(r.Array(r.String(),{description:"Category labels. Needed on every series, not just the first, and the same length as `values`; a series without both `labels` and `values` drops the whole chart."})),values:r.Optional(r.Array(r.Number(),{description:"Data values, one per label. Needed on every series \\u2014 see `labels`."}))},{additionalProperties:!1}),Bm=r.Object({type:DL,data:r.Array(ML,{description:"Chart data series",minItems:1}),title:r.Optional(r.String({description:"Chart title text"})),showTitle:r.Optional(r.Boolean({description:"Show the chart title. Defaults to true when `title` is set."})),showLegend:r.Optional(r.Boolean({description:"Show chart legend"})),legendPos:r.Optional(r.Union([r.Literal("b"),r.Literal("l"),r.Literal("r"),r.Literal("t"),r.Literal("tr")],{description:"Legend position"})),chartColors:r.Optional(r.Array(r.String(),{description:"Series colors (hex or semantic theme names). Defaults to the theme palette."})),catAxisTitle:r.Optional(r.String({description:"Category axis title"})),valAxisTitle:r.Optional(r.String({description:"Value axis title"})),width:r.Optional(r.Number({minimum:0,exclusiveMinimum:0,description:"Chart width in inches. Defaults to the content width."})),height:r.Optional(r.Number({minimum:0,exclusiveMinimum:0,description:"Chart height in inches. Defaults to 3."})),alignment:r.Optional(Zr),caption:r.Optional(r.String({description:"Chart caption (supports rich text with **bold**, *italic*, ***both***)"})),alt:r.Optional(r.String({description:"Alternative text for accessibility"})),spacing:r.Optional(Ct),floating:r.Optional(Oo),keepNext:r.Optional(r.Boolean({description:"Keep paragraph with next paragraph on same page"})),keepLines:r.Optional(r.Boolean({description:"Keep all lines of paragraph together on same page"}))},{description:\'Native Word chart - editable, scalable, no export server needed. Requires renderer "office-open".\',additionalProperties:!1}),ut=[{name:"docx",propsSchema:mn,hasChildren:!0,allowedChildren:["section"],category:"container",description:"Main document container - defines the overall document structure. Required as the root component.",special:{hasSchemaField:!0}},{name:"section",propsSchema:cn,createPropsSchema:Nm,embeddedComponents:[{path:["header"],arity:"component-array",reportStructure:!0},{path:["footer"],arity:"component-array",reportStructure:!0}],hasChildren:!0,allowedChildren:["block","group","heading","paragraph","image","statistic","table","list","toc","divider","highcharts","chart","visual","columns","text-box"],category:"container",description:"Section container - groups related content with optional title. Use for organizing document structure."},{name:"columns",propsSchema:ln,hasChildren:!0,allowedChildren:["block","group","heading","paragraph","image","statistic","table","list","toc","divider","highcharts","chart","visual","text-box"],category:"layout",description:"Multi-column layout - arranges content in 2-4 columns. Great for side-by-side content."},{name:"text-box",propsSchema:Fm,hasChildren:!0,allowedChildren:["heading","paragraph","image","divider"],category:"layout",description:"Floating text container - allows positioning text anywhere on the page with absolute or relative positioning."},{name:"heading",propsSchema:rn,hasChildren:!1,category:"content",description:"Heading text - supports levels 1-6 for document hierarchy. Level 1 is largest. Never skip a level going down (1 \\u2192 3): the gap breaks the document outline."},{name:"paragraph",propsSchema:nn,hasChildren:!1,category:"content",description:"Paragraph text - supports formatting like bold, italic, and color. Main content element."},{name:"image",propsSchema:on,hasChildren:!1,category:"content",description:"Image element - displays images with optional caption. Supports various formats."},{name:"statistic",propsSchema:an,hasChildren:!1,category:"content",description:"Statistic display - shows a number with description. Perfect for KPIs and metrics."},{name:"block",propsSchema:jn,hasChildren:!1,category:"content",description:"Invoke a JSON block defined in this document\\u2019s props.blocks. Fill its named slots; no block names are built into the engine."},{name:"group",propsSchema:jm,hasChildren:!0,allowedChildren:["group","block","heading","paragraph","image","statistic","table","list","toc","divider","highcharts","chart","visual","columns","text-box"],category:"container",description:"Transparent group of flow components; also the inspectable result of block expansion."},{name:"table",propsSchema:sn,createPropsSchema:Em,embeddedComponents:[{path:["columns","*","header","content"],arity:"component",reportStructure:!1},{path:["columns","*","cells","*","content"],arity:"component",reportStructure:!1}],hasChildren:!1,category:"content",description:"Data table, declared COLUMN-MAJOR: `props.columns[]`, each with its own `header` and its own `cells[]` running down the column. Note the PPTX `table` is the other way round \\u2014 rows of cells \\u2014 so a table cannot be moved between the formats unchanged. Fixed column widths are points and must fit the page; leave some columns unsized so they share the leftover space."},{name:"list",propsSchema:pn,hasChildren:!1,category:"content",description:"List element - bulleted or numbered list items. Supports nested lists."},{name:"toc",propsSchema:Um,hasChildren:!1,category:"content",description:"Table of contents - automatically generates TOC from document headings. Supports depth ranges and custom styles."},{name:"divider",propsSchema:Dm,hasChildren:!1,category:"content",description:"Horizontal divider - a thin line across the measure, for separating sections. Drawn as a Word paragraph border, so it stays a real Word object. Use this rather than collapsing a paragraph\'s line spacing to fake one."},{name:"highcharts",propsSchema:Mm,hasChildren:!1,category:"content",description:"Chart component powered by Highcharts - render line, bar, pie, heatmap, and more with rich options."},{name:"chart",propsSchema:Bm,hasChildren:!1,renderers:["office-open"],category:"content",description:\'Native Word chart - editable, scalable, no export server needed. Requires renderer "office-open".\'},{name:"visual",propsSchema:wc,hasChildren:!1,category:"content",description:\'Free-canvas graphic for infographics, diagrams and layered compositions the document flow cannot express. Rasterized from a pptx slide by default; renderMode "native" draws it as an editable Word drawing group (renderer "office-open").\'}];function za(e){return ut.find(t=>t.name===e)}function Cg(){return ut.map(e=>e.name)}function Pg(){return ut.filter(e=>e.hasChildren)}function BL(e){let t=e;return t.type!=="object"||(t.required?.length??0)>0}function Io(e,t,n,o){let i={name:r.Literal(e.name),id:r.Optional(r.String()),enabled:r.Optional(r.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true. Useful for conditional component inclusion."}))};e.special?.hasSchemaField&&(i.$schema=r.Optional(r.String({format:"uri"})),i.renderer=o?o.requireDiscriminator?r.Literal(o.renderer,{description:"Renderer backend for this document"}):r.Optional(r.Literal(o.renderer,{description:\'Renderer backend. Omitted defaults to "docxjs".\'})):r.Optional(r.Union(Cr.map(c=>r.Literal(c)),{description:\'Renderer backend. Omitted defaults to "docxjs".\'})));let a=e.createPropsSchema&&n?e.createPropsSchema(n):e.propsSchema,s=o?Pc(e.name,a,o.renderer):a;return i.props=BL(s)?s:r.Optional(s),e.hasChildren&&t&&(i.children=e.special?.hasSchemaField?r.Array(t):r.Optional(r.Array(t))),r.Object(i,{additionalProperties:!1,description:e.description})}function $g(e){return ut.map(t=>Io(t,e))}function Ec(e,t=[],n){let o=p=>!n||!p.renderers||p.renderers.includes(n.renderer),i=new Map;for(let p of ut)o(p)&&(p.hasChildren||i.set(p.name,Io(p,void 0,e,n)));let a=ut.filter(p=>p.hasChildren&&o(p)),s=new Map,c=[...a];for(;c.length>0;){let p=c.length;for(let m=c.length-1;m>=0;m--){let u=c[m];if(u.name==="group"){let O=r.Intersect([e,r.Object({name:r.Union([...u.allowedChildren.map(A=>r.Literal(A)),...t.map(A=>A.properties.name)])})]);s.set(u.name,Io(u,O,e,n)),c.splice(m,1);continue}if(!u.allowedChildren){s.set(u.name,Io(u,e,e,n)),c.splice(m,1);continue}if(!u.allowedChildren.filter(O=>a.some(A=>A.name===O)).every(O=>s.has(O)))continue;let S=[...u.allowedChildren.map(O=>s.get(O)??i.get(O)).filter(O=>O!==void 0),...t],C=S.length===1?S[0]:r.Union(S);s.set(u.name,Io(u,C,e,n)),c.splice(m,1)}if(c.length===p)throw new Error(`Circular allowedChildren among: ${c.map(m=>m.name).join(", ")}`)}let l=new Map([...s,...i]);return{schemas:[...l.values()],byName:l}}function Nc(e,t="ComponentDefinition"){let n=new Set(Object.keys(e.definitions??{})),o=s=>{let c=n.has(s)?s:t;return n.has(c)?`#/definitions/${c}`:void 0},i=s=>typeof s=="string"&&(/^T\\d+$/.test(s)||s===t||n.has(s));function a(s,c=""){if(!(typeof s!="object"||s===null))for(let[l,p]of Object.entries(s)){let m=c?`${c}.${l}`:l;if(p&&typeof p=="object"){let u=p;if(u.type==="array"&&u.items&&Object.keys(u.items).length===0&&n.has(t)&&(u.items={$ref:`#/definitions/${t}`}),u.type==="array"&&u.items&&typeof u.items=="object"&&"$ref"in u.items&&i(u.items.$ref)){let f=o(u.items.$ref);u.items=f?{$ref:f}:{}}if(i(u.$ref)){let f=o(u.$ref);f?u.$ref=f:delete u.$ref}if(l==="$id"&&i(p)&&m!==`definitions.${p}.$id`){delete s[l];continue}a(p,m)}}}a(e)}function Tg(e,t={}){let{$schema:n="http://json-schema.org/draft-07/schema#",$id:o,title:i,description:a,definitions:s={}}=t,c=JSON.parse(JSON.stringify(e)),l={...s};function p(u,f=""){if(!(typeof u!="object"||u===null)){for(let[x,S]of Object.entries(u))if(S&&typeof S=="object"){let C=S;if(C.$id&&typeof C.$id=="string"){let O=C.$id;if(f!==`definitions.${O}`){let{$id:A,...I}=C;l[O]=I,u[x]={$ref:`#/definitions/${O}`},p(I,`definitions.${O}`);continue}}p(S,f?`${f}.${x}`:x)}}}p(c);let m={$schema:n};return o&&(m.$id=o),Object.assign(m,c),i!==void 0&&(m.title=i),a!==void 0&&(m.description=a),Object.keys(l).length>0&&(m.definitions=l),Nc(m),sg(m),Ia(m),m}function Ag(e,t,n,o="ComponentDefinition"){let i={$schema:"http://json-schema.org/draft-07/schema#",$id:`${e}.schema.json`,title:t.title,description:t.description,type:"object",required:["name","props"],properties:{name:{type:"string",const:e,description:`Component name identifier (must be "${e}")`},id:{type:"string",description:"Optional unique identifier for the component"},props:JSON.parse(JSON.stringify(t.schema))}};if(Pg().map(s=>s.name).includes(e)&&(i.properties.children={type:"array",description:"Children within this container",items:{$ref:`#/definitions/${o}`}},n&&(i.definitions={[o]:JSON.parse(JSON.stringify(n))})),t.enhanceForRichContent&&e==="table"){let s=i;s.definitions||(s.definitions={}),n&&(s.definitions[o]=JSON.parse(JSON.stringify(n)));let l=i.properties.props;if(l?.properties&&typeof l.properties=="object"&&l.properties!==null){let m=l.properties.rows;if(m?.items&&typeof m.items=="object"&&m.items!==null){let f=m.items.items;if(f?.anyOf&&Array.isArray(f.anyOf)){let x=`#/definitions/${o}`;f.anyOf.some(C=>C.$ref===x)||f.anyOf.push({description:"Rich content cell with component (e.g., image, paragraph)",$ref:x})}}}}return Nc(i,o),i.additionalProperties=!1,i}async function Lg(e,t,n={}){let{prettyPrint:o=!0}=n,i=o?JSON.stringify(e,null,2):JSON.stringify(e);await(await Promise.resolve().then(()=>qu(Tp(),1))).writeFile(t,i,"utf-8")}var vg={report:{title:"Report Component",description:"Top-level report container component with document-wide settings"},section:{title:"Section Component",description:"Section container for organizing document content"},columns:{title:"Columns Component",description:"Multi-column layout container"},heading:{title:"Heading Component",description:"Heading text with configurable levels and styling"},paragraph:{title:"Paragraph Component",description:"Rich paragraph text content with formatting options"},"text-box":{title:"Text Box Component",description:"Inline or floating container that groups text and image components with shared positioning"},image:{title:"Image Component",description:"Image content with positioning and sizing options"},statistic:{title:"Statistic Component",description:"Statistical display with value and label"},table:{title:"Table Component",description:"Tabular data display with headers and rows",enhanceForRichContent:!0},list:{title:"List Component",description:"Ordered or unordered list with nested items"},highcharts:{title:"Highcharts Component",description:"Charts powered by Highcharts (line, bar, pie, heatmap, etc.) with rich configuration"},visual:{title:"Visual Component",description:\'Free-canvas graphic: a rasterized pptx slide, or a native Word drawing group with renderMode "native"\'}},Eg={alignment:{title:"Alignment",description:"Text alignment options"},"base-component":{title:"Base Component Props",description:"Common props for all components"},border:{title:"Border",description:"Border styling configuration"},spacing:{title:"Spacing",description:"Spacing configuration for before and after elements"},margins:{title:"Margins",description:"Margin configuration for all sides"},indent:{title:"Indent",description:"Indentation configuration"},"line-spacing":{title:"Line Spacing",description:"Line height and spacing configuration"},"heading-level":{title:"Heading Level",description:"Heading level from 1 to 6"},numbering:{title:"Numbering",description:"Numbering configuration for ordered lists"},"justified-alignment":{title:"Justified Alignment",description:"Justified text alignment options"}},Ng={theme:{title:"Theme Configuration",description:"JSON theme configuration for document styling and appearance"}};function kg(e={}){return r.Union(Cr.map(t=>_L(e,t,t!==qa)),{description:"Document definition, discriminated by the optional renderer field. Omitted renderer means docxjs."})}function _L(e,t,n){let{includeStandardComponents:o=!0,customComponents:i=[],title:a="JSON Report Definition",description:s="JSON report definition with TypeBox schemas"}=e,c=[],l=[],p=tn(t),m=r.Recursive(f=>{let x=[];for(let I of i)if(I.versionedProps&&I.versionedProps.length>0){let R=I.versionedProps,G=mt(R.map(P=>P.version));for(let P of R){let Q=P.description||I.description,Ie={name:r.Literal(I.name),id:r.Optional(r.String()),version:Q?r.Literal(P.version,{description:Q}):r.Literal(P.version),props:P.propsSchema};P.hasChildren&&(Ie.children=r.Optional(r.Array(f)));let Le=P.description?`${I.name} v${P.version} \\u2014 ${P.description}`:I.description?`${I.name} v${P.version} \\u2014 ${I.description}`:`${I.name} v${P.version}`;x.push(r.Object(Ie,{additionalProperties:!1,description:Le}))}let ze=R.find(P=>P.version===G),Te={name:r.Literal(I.name),id:r.Optional(r.String()),props:ze.propsSchema};ze.hasChildren&&(Te.children=r.Optional(r.Array(f)));let Ae=ze.description?`${I.name} (latest: v${G}) \\u2014 ${ze.description}`:I.description?`${I.name} (latest: v${G}) \\u2014 ${I.description}`:`${I.name} (latest: v${G})`;x.push(r.Object(Te,{additionalProperties:!1,description:Ae}))}else{let R=!!I.hasChildren,G={name:r.Literal(I.name),id:r.Optional(r.String()),props:I.propsSchema};R&&(G.children=r.Optional(r.Array(f))),x.push(r.Object(G,{additionalProperties:!1,...I.description?{description:I.description}:{}}))}let{schemas:S,byName:C}=o?Ec(f,x,{renderer:t,requireDiscriminator:n}):{schemas:[],byName:new Map};c=["section",...za("section")?.allowedChildren??[]].map(I=>C.get(I)).filter(I=>I!==void 0),l=x;let A=[...S,...x];if(A.length===0)return r.Any();if(A.length===1)return A[0];{let I=i.length>0?"Component definition with discriminated union including custom components":"Component definition with discriminated union";return r.Union(A,{discriminator:{propertyName:"name"},description:I})}},{$id:p}),u=za("docx");if(!u)throw new Error("Docx root component not found in registry");if(c.length===0)throw new Error("Root child schemas not found in narrowed standard schemas");return r.Object({name:r.Literal("docx"),id:r.Optional(r.String()),$schema:r.Optional(r.String({format:"uri"})),renderer:n?r.Literal(t,{description:"Renderer backend for this document"}):r.Optional(r.Literal(t,{description:\'Renderer backend. Omitted defaults to "docxjs".\'})),props:r.Optional(Pc(u.name,u.propsSchema,t)),children:r.Array(r.Union([...c,...l],{discriminator:{propertyName:"name"}}))},{additionalProperties:!1,title:a,description:s,definitions:{[p]:m}})}var kc=r.Union([...$g(r.Any())],{discriminator:{propertyName:"name"},description:"Standard component definition with discriminated union"}),dt=r.Recursive(e=>r.Union([...Ec(e).schemas],{discriminator:{propertyName:"name"},description:"Component definition with discriminated union"}));var _m=r.Object({content:r.String({description:"Text content (required)"}),spaceAfter:r.Optional(r.Number({minimum:0,description:"Spacing after text in points"})),fontSize:r.Optional(r.Number({minimum:1})),fontFamily:r.Optional(r.String()),bold:r.Optional(r.Boolean()),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900})),italic:r.Optional(r.Boolean()),underline:r.Optional(r.Boolean()),color:r.Optional(r.String({pattern:"^#[0-9A-Fa-f]{6}$"})),alignment:r.Optional(r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("justify")]))}),Vm=r.Object({name:r.Literal("text-space-after"),id:r.Optional(r.String()),props:_m}),Pr=Vm;function VL(e,t){let n=String(e.type||""),o=e.path||"root";return n==="62"||n==="union"?KL(e):e.message?.includes("additionalProperties")?GL(e):e.message?.includes("Required property")?qL(e):n==="string"||n==="number"||n==="boolean"||n==="array"||n==="object"?zL(e):n==="literal"?WL(e):n==="pattern"||n==="RegExp"?HL(e):`At ${o}: ${e.message}`}function KL(e){let t=e.path||"root",n=e.value;if(t==="root"||t==="/"||t==="/jsonDefinition"){if(n&&typeof n=="object"){if("name"in n){let i=n.name;return i==="docx"?"Document structure appears valid but contains invalid component configurations. Check each component for errors.":`Unknown document name \'${i}\'. Expected \'docx\'.`}let o=n;if("children"in n&&Array.isArray(o.children))return`Document is missing required \'name\' field. Add "name": "docx" at the root level.`;if("name"in n||"styles"in n)return"This appears to be a theme configuration. Use --type theme or ensure proper document structure."}return\'Invalid document structure. Expected a document with name="docx" or a theme configuration.\'}return t.includes("/children/")?n&&typeof n=="object"&&"name"in n?`Invalid component configuration for type \'${n.name}\'. Check that all required fields are present and correctly formatted.`:\'Invalid component structure. Each component must have a "name" field and valid configuration.\':`Value at ${t} doesn\'t match any of the expected formats. Check the structure and required fields.`}function GL(e){let t=e.path||"root",n=e.value;if(typeof n=="object"&&n!==null){let o=e.schema;if(o&&Gt(o)){let i=xr(o),s=Object.keys(n).filter(c=>!i.includes(c));if(s.length>0)return`Unknown properties at ${t}: ${s.join(", ")}. Allowed properties are: ${i.join(", ")}`}}return`Additional properties not allowed at ${t}. Check for typos or unsupported fields.`}function qL(e){let t=e.path||"root",n=e.message?.match(/Required property \'([^\']+)\'/);return n?`Missing required field \'${n[1]}\' at ${t}. This field is mandatory for this configuration.`:`Missing required property at ${t}. Check that all mandatory fields are present.`}function zL(e){let t=e.path||"root",n=String(e.type),o=Array.isArray(e.value)?"array":typeof e.value;return t.includes("alignment")?`Invalid alignment value at ${t}. Expected one of: left, center, right, justify`:t.includes("color")?`Invalid color value at ${t}. Use hex format (#RRGGBB), rgb(r,g,b), or a named color`:t.includes("fontSize")||t.includes("size")?`Invalid size value at ${t}. Expected a number (in points)`:t.includes("margin")||t.includes("padding")||t.includes("spacing")?`Invalid spacing value at ${t}. Expected a number or spacing object with top/bottom/left/right`:`Type mismatch at ${t}: Expected ${n} but got ${o}`}function WL(e){let t=e.path||"root",n=e.schema?JSON.stringify(St(e.schema)):"specific value",o=JSON.stringify(e.value);return`Invalid value at ${t}: Expected exactly ${n} but got ${o}`}function HL(e){let t=e.path||"root";return t.includes("email")?`Invalid email format at ${t}. Use format: user@example.com`:t.includes("url")||t.includes("link")?`Invalid URL format at ${t}. Use format: https://example.com`:t.includes("date")?`Invalid date format at ${t}. Use ISO format: YYYY-MM-DD`:t.includes("phone")?`Invalid phone number format at ${t}`:`Value at ${t} doesn\'t match the required pattern`}function Wm(e,t,n){let o=Sr(n),i=VL(e,o),a={path:e.path||"root",message:Or(i||e.message,o),code:String(e.type||"validation_error"),value:e.value};if(o.includeSuggestions){let s=YL(e,o);s&&(a.suggestion=Or(s,o))}if(t&&e.path){let s=JL(t,e.path);s&&(a.line=s.line,a.column=s.column)}return a}function Hm(e,t){let n=t?.maxErrors??Number.MAX_SAFE_INTEGER,o=[],i=new Set;for(let a of e){if(o.length>=n)break;let s=`${a.path}:${a.type}`;i.has(s)||(i.add(s),o.push(Wm(a,t?.jsonString,void 0)))}return o}function JL(e,t){try{let n=t.split("/").filter(Boolean);if(n.length===0)return{line:1,column:1};let i=`"${n[n.length-1]}"`,a=e.indexOf(i);if(a===-1)return{line:1,column:1};let c=e.substring(0,a).split(`\n`),l=c.length,p=c[c.length-1].length+1;return{line:l,column:p}}catch{return null}}function YL(e,t){let{type:n,path:o,value:i}=e,a=String(n);if(a==="62"||a==="union"){if(o==="root"||o==="/"){if(i&&typeof i=="object"){if(!("name"in i)){let s=\'Add a "name" field with value "docx" for documents\';return t.includeEmojis?`${mo.FIX} ${s}`:s}if("props"in i&&typeof i.props=="object")return`Review the props section for unsupported fields. Allowed fields: ${xr(mn).join(", ")}`}return\'Ensure the document has proper structure: { "name": "docx", "props": {...}, "children": [...] }\'}return o?.includes("/children/")?\'Check that the component has a valid "name" and all required fields for that component type\':"Review the structure and ensure all required fields are present with correct types"}if(e.message?.includes("additionalProperties"))return"Remove any unknown or unsupported fields. Check documentation for allowed properties.";if(e.message?.includes("Required property"))return"Add the missing required field to fix this error";if(a==="string")return o?.includes("alignment")?"Use one of: left, center, right, justify":o?.includes("color")?"Use a valid color format (hex: #RRGGBB, rgb: rgb(r,g,b), or named color)":"Provide a text string value";if(a==="number")return o?.includes("fontSize")||o?.includes("size")?"Use a number in points (e.g., 12, 14, 16)":o?.includes("margin")||o?.includes("padding")?"Use a number for spacing in points":"Provide a numeric value";if(a==="boolean")return"Use true or false (without quotes)";if(a==="array")return o?.includes("children")?\'Provide an array of component objects, each with a "name" field\':"Provide an array/list of values using square brackets []";if(a==="object")return"Provide an object with key-value pairs using curly braces {}";if(a==="literal")return`Use exactly this value: ${e.schema?JSON.stringify(St(e.schema)):"specific value"}`;if(a==="pattern"||a==="RegExp")return o?.includes("email")?"Use valid email format: user@example.com":o?.includes("url")?"Use valid URL format: https://example.com":o?.includes("date")?"Use ISO date format: YYYY-MM-DD":"Ensure the value matches the required format";if(o?.includes("name")||o?.includes("type"))return"Use a valid component name: docx, section, columns, heading, paragraph, image, statistic, table, list, toc, text-box, highcharts, or visual"}var XL=Object.fromEntries([...ut.map(e=>[e.name,e.propsSchema]),["custom",Pr]]),ZL=new Map(ut.filter(e=>(e.embeddedComponents?.length??0)>0).map(e=>[e.name,e.embeddedComponents])),Km=new Set(ut.filter(e=>!!e.special?.hasSchemaField).map(e=>e.name)),QL=new Map(ut.map(e=>[e.name,new Set(["name","id","enabled","props",...e.hasChildren?["children"]:[],...e.special?.hasSchemaField?["$schema","renderer"]:[]])])),ev={id:"string",enabled:"boolean",$schema:"string",renderer:"string"};function jg(e,t,n,o){let i=typeof e.name=="string"?QL.get(e.name):void 0;if(i)for(let a of Object.keys(e)){if(!i.has(a)){if(n.allowUnknownFields)continue;o.push({path:`${t}/${a}`,message:`Unknown key "${a}" on component "${e.name}". Allowed keys: ${[...i].join(", ")}.`,code:"unknown_key"});continue}let s=ev[a];s&&typeof e[a]!==s&&o.push({path:`${t}/${a}`,message:`Key "${a}" on component "${e.name}" must be a ${s}.`,code:"invalid_type"})}}var tv=["path","base64","svg"];function rv(e){if(!e||typeof e!="object")return[];let t=e;return tv.filter(n=>{let o=t[n];return typeof o=="string"&&o.trim().length>0})}function nv(e){let t=[],n=(o,i)=>{if(Array.isArray(o)){o.forEach((a,s)=>n(a,`${i}/${s}`));return}if(!(!o||typeof o!="object")){if(o.name==="image"){let a=rv(o.props);a.length>1&&t.push({path:`${i}/props`,message:`Image component accepts only one source, but found ${a.map(s=>`"${s}"`).join(", ")}. Use exactly one of "path", "base64", or "svg".`,code:"mutually_exclusive"})}for(let a of Object.keys(o))n(o[a],`${i}/${a}`)}};return n(e,""),t}var ov=new Set(["paragraph","heading"]);function Jm(e){let t=[],n=(o,i)=>{if(Array.isArray(o)){o.forEach((a,s)=>n(a,`${i}/${s}`));return}if(!(!o||typeof o!="object")){if(ov.has(o.name)){let a=o.props?.indent;a&&typeof a=="object"&&a.hanging!==void 0&&a.firstLine!==void 0&&t.push({path:`${i}/props/indent`,message:\'Indent accepts either "hanging" or "firstLine", not both. Use exactly one of the two.\',code:"mutually_exclusive"})}for(let a of Object.keys(o))n(o[a],`${i}/${a}`)}};return n(e,""),t}function Ym(e){let t=[],n=(o,i)=>{if(Array.isArray(o)){o.forEach((s,c)=>n(s,`${i}/${c}`));return}if(!o||typeof o!="object")return;let a=[];if(o.name==="paragraph"&&o.props?.revision)for(let s of["footnotes","endnotes"])a.push({notes:o.props[s],path:`${i}/props/${s}`});if(o.revision&&o.content?.name==="paragraph")for(let s of["footnotes","endnotes"])a.push({notes:o.content.props?.[s],path:`${i}/content/props/${s}`});for(let{notes:s,path:c}of a)if(Array.isArray(s)&&s.length>0){let l=c.endsWith("endnotes")?"endnotes":"footnotes";t.push({path:c,message:`"revision" and "${l}" cannot apply to the same text. Tracked-change text renders literally, so note markers inside it are not resolved and the note bodies would be dropped. Move the notes to text without a revision.`,code:"mutually_exclusive"})}for(let s of Object.keys(o))n(o[s],`${i}/${s}`)};return n(e,""),t}var iv=new Set(["dashed","dotted","double"]);function Xm(e){let t=[],n=(o,i)=>{if(Array.isArray(o)){o.forEach((a,s)=>n(a,`${i}/${s}`));return}if(!(!o||typeof o!="object")){if(o.name==="text-box"&&o.props?.renderAs==="shape"){let a=["width","height"].filter(c=>o.props[c]===void 0);a.length>0&&t.push({path:`${i}/props/${a[0]}`,message:`A text-box with renderAs "shape" requires ${a.join(" and ")}: a shape has no autofit, so its size cannot be derived from its content. Give it an explicit size, or use renderAs "table", which grows to fit.`,code:"required"});let s=o.props.style?.border;if(s&&typeof s=="object")for(let c of["top","right","bottom","left"]){let l=s[c]?.style;typeof l=="string"&&iv.has(l)&&t.push({path:`${i}/props/style/border/${c}/style`,message:`A text-box with renderAs "shape" cannot draw a "${l}" border: a shape outline carries no dash pattern. Use "solid", or use renderAs "table", which draws every border style.`,code:"unsupported_value"})}}for(let a of Object.keys(o))n(o[a],`${i}/${a}`)}};return n(e,""),t}function Zm(e,t={}){let n=[];if(!e||typeof e!="object")return n.push({path:"root",message:"Document must be an object",code:"invalid_type"}),n;if(!e.name)n.push({path:"/name",message:\'Missing required field "name"\',code:"required_property"});else if(!Km.has(e.name)){let o=[...Km].map(i=>`"${i}"`).join(", ");n.push({path:"/name",message:`Invalid name "${e.name}". Expected ${o}`,code:"invalid_value"})}if(jg(e,"",t,n),Km.has(e.name)&&"props"in e){let o=qm(e.name,e.props,"/props",t);n.push(...o)}return e.children?Array.isArray(e.children)||n.push({path:"/children",message:\'Field "children" must be an array\',code:"invalid_type"}):n.push({path:"/children",message:\'Missing required field "children"\',code:"required_property"}),Fg(e,"",t,n),n}function Fg(e,t,n,o){if(!e||typeof e!="object")return;let i=(s,c,l)=>{if(!s||typeof s!="object"){l&&o.push({path:c,message:"Component must be an object",code:"invalid_type"});return}if(typeof s.name!="string"||s.name.length===0){l&&o.push({path:`${c}/name`,message:\'Component missing required field "name"\',code:"required_property"});return}n.knownCustomNames?.has(s.name)||(jg(s,c,n,o),"props"in s?o.push(...qm(s.name,s.props,`${c}/props`,n)):s.name!=="custom"&&o.push(...qm(s.name,{},`${c}/props`,n)),Fg(s,c,n,o))},a=typeof e.name=="string"?ZL.get(e.name):void 0;if(a&&e.props&&typeof e.props=="object")for(let s of a)Gm(e.props,s.path,`${t}/props`,(c,l)=>{s.arity==="component-array"?Array.isArray(c)&&c.forEach((p,m)=>i(p,`${l}/${m}`,s.reportStructure)):c&&typeof c=="object"&&!Array.isArray(c)&&i(c,l,s.reportStructure)});Array.isArray(e.children)?e.children.forEach((s,c)=>i(s,`${t}/children/${c}`,!0)):e.children!=null&&t!==""&&o.push({path:`${t}/children`,message:\'Field "children" must be an array\',code:"invalid_type"})}function Gm(e,t,n,o){if(t.length===0){o(e,n);return}if(!e||typeof e!="object")return;let[i,...a]=t;if(i==="*"){if(!Array.isArray(e))return;e.forEach((s,c)=>Gm(s,a,`${n}/${c}`,o));return}Gm(e[i],a,`${n}/${i}`,o)}function qm(e,t,n,o={}){let i=[],a=XL[e];if(!a)return i.push({path:n.replace(/\\/props$/,"/name"),message:`Unknown component "${e}"`,code:"unknown_component"}),i;let s=av(a,t),c=o.allowUnknownFields?$.Clean(s,$.Clone(t)):t;if(!$.Check(s,c)){let l=[...$.Errors(s,c)];Hm(l,{maxErrors:100}).forEach(m=>{let u=m.path==="root"?n:`${n}${m.path.startsWith("/")?m.path:"/"+m.path}`;i.push({...m,path:u})})}return i}function av(e,t){let n=e.anyOf;if(!Array.isArray(n)||n.length===0)return e;let o=n.filter(c=>sv(c,t));if(o.length===1)return o[0];let i=o.length>1?o:n,a=i[0],s=Number.POSITIVE_INFINITY;for(let c of i){let l=[...$.Errors(c,t)].length;l<s&&(s=l,a=c)}return a}function sv(e,t){let n=e.properties;if(!n)return!1;let o=new Set(e.required??[]),i=t??{};for(let[a,s]of Object.entries(n)){let c=s.const;if(c===void 0)continue;if(!(i[a]!==void 0)){if(o.has(a))return!1;continue}if(i[a]!==c)return!1}return!0}function Qm(e,t=[],n={}){let o=Zm(e,n),i=t.filter(a=>!cv(a));return lv([...i,...o])}function cv(e){if(!(!e.path||e.path==="root"||e.path==="/"))return!1;let n=e.message||"";return/invalid component configurations?/i.test(n)||/invalid document structure/i.test(n)}function lv(e){let t=new Set,n=[];for(let o of e){let i=`${o.path}:${o.message}`;t.has(i)||(t.add(i),n.push(o))}return n}function Pt(e,t,n){try{if(!$.Check(e,t)){let i=[...$.Errors(e,t)];return{valid:!1,errors:et(i,{jsonString:n?.jsonString,maxErrors:n?.maxErrors||100})}}let o=t;return n?.clean&&(o=$.Clean(e,$.Clone(o))),n?.applyDefaults&&(o=$.Default(e,o)),{valid:!0,data:o}}catch(o){return{valid:!1,errors:[{path:"root",message:o instanceof Error?o.message:"Unknown validation error",code:"validation_exception"}]}}}function oi(e,t,n){if(typeof t=="string"){if(!t.trim())return{valid:!1,errors:[{path:"root",message:"Input must be a non-empty string",code:"empty_input"}],isJsonError:!0};let i;try{i=JSON.parse(t)}catch(s){return s instanceof Error?{valid:!1,errors:[uo(s,t)],isJsonError:!0}:{valid:!1,errors:[{path:"root",message:"Failed to parse JSON",code:"json_parse_error"}],isJsonError:!0}}return{...Pt(e,i,{...n,jsonString:t,calculatePosition:!0}),parsed:i,isJsonError:!1}}return{...Pt(e,t,n),parsed:t,isJsonError:!1}}function Ug(e,t,n){let o=[],i=[],a=!1;for(let s=0;s<t.length;s++){let c=Pt(e,t[s],n);if(c.valid&&c.data)o.push(c.data);else if(a=!0,c.errors){let l=c.errors.map(p=>({...p,path:`[${s}]${p.path?"/"+p.path:""}`}));i.push(...l)}if(n?.maxErrors&&i.length>=n.maxErrors)break}return a?{valid:!1,errors:i.slice(0,n?.maxErrors)}:{valid:!0,data:o}}function Dg(e,t,n,o){let i=Pt(e,t,o);return!i.valid&&i.errors&&(i.errors=n(i.errors)),i}function Mg(e,t){return(n,o)=>Pt(e,n,{...t,...o})}function Bg(e,t){return(n,o)=>oi(e,n,{...t,...o})}function _g(e){return e.valid===!0&&e.data!==void 0}function Vg(e){return e.valid?"Validation successful":!e.errors||e.errors.length===0?"Validation failed with unknown error":Jr(e.errors)}var pv=dt,mv=[{why:"image source mutual-exclusivity",collect:nv},{why:"indent hanging/firstLine mutual-exclusivity",collect:Jm},{why:"notes on a revised paragraph",collect:Ym},{why:"a text box asking for a shape rendering a shape cannot give it",collect:Xm},{why:"renderer profile compatibility",collect:$c}];function Kg(e){return mv.flatMap(({collect:t})=>t(e))}function zm(e,t){if(Array.isArray(e))return e.some(o=>zm(o,t));if(!e||typeof e!="object")return!1;let n=e;return typeof n.name=="string"&&t.has(n.name)?!0:Object.values(n).some(o=>zm(o,t))}var Rg;function uv(){return Rg??(Rg=r.Recursive(e=>r.Union(ut.map(t=>Io(t,e,e))))),Rg}function dv(e,t,n){return n?.allowUnknownFields===!0||n?.knownCustomNames!==void 0&&n.knownCustomNames.size>0&&zm(e,n.knownCustomNames)||$.Check(uv(),e)?{valid:!0,errors:[]}:{valid:!1,errors:[...t.length>0?t:[{path:"root",message:"Document does not match the \'docx\' document schema.",code:"invalid_document"}],{path:"root",message:\'The document was rejected by the whole-document schema, but deep validation could not localize the fault. Common causes: an unknown key next to "name", "props" or "children" on some component, or a value at a position the schema does not declare.\',code:"unlocalized_schema_error"}]}}function Gg(e,t,n){let o=Qm(e,t,{allowUnknownFields:n?.allowUnknownFields,knownCustomNames:n?.knownCustomNames});return o.length===0?dv(e,t,n):{valid:!1,errors:o}}function Rc(e,t){let n=Pt(dt,e,t),o=n.errors||[],i=n.valid;!n.valid&&e&&({valid:i,errors:o}=Gg(e,n.errors||[],t));let a=[...Kg(e),...Ho(e,Xr(e),"docx",[...t?.knownCustomNames??[]])];a.length>0&&(o=[...o,...a],i=!1);let s=n.data??(i?e:void 0),c={...n,valid:i,documentType:"docx",errors:o,data:s};if(i){let l=s;if(l&&l.children&&Array.isArray(l.children)){let p=l.children.some(m=>!zg(m.name));c.hasCustomComponents=p}}return c}function jc(e,t){let n=oi(pv,e,t),o=n.errors||[],i=n.valid;!n.valid&&n.parsed&&({valid:i,errors:o}=Gg(n.parsed,n.errors||[],t));let a=[...Kg(n.parsed),...Ho(n.parsed,Xr(n.parsed),"docx",[...t?.knownCustomNames??[]])];a.length>0&&(o=[...o,...a],i=!1);let s=n.data??(i?n.parsed:void 0),c={...n,valid:i,documentType:"docx",errors:o,data:s};if(i){let l=s;if(l&&l.children&&Array.isArray(l.children)){let p=l.children.some(m=>!zg(m.name));c.hasCustomComponents=p}}return c}function qg(e){return e.valid===!0&&e.data!==void 0}function fv(){return po(kc)}function zg(e){return fv().includes(e)}function Fc(e){return{validate:(t,n)=>Rc(t,{...e,...n}),validateJson:(t,n)=>jc(t,{...e,...n})}}var ii=Fc({clean:!0,applyDefaults:!0,maxErrors:100}),Wa=Fc({clean:!1,applyDefaults:!1,maxErrors:100}),Wg=jc,Hg=Rc;function hv(){return{includeEmojis:!Yg(),verbosity:"normal",includeSuggestions:!0,includePath:!0,maxMessageLength:0,includeDocLinks:!1,colorSupport:gv()}}var zz=hv(),Jg={UNION_NO_MATCH:"Value doesn\'t match any of the expected formats",TYPE_MISMATCH:"Expected {expected} but got {actual}",MISSING_REQUIRED:"Missing required field \'{field}\'",UNKNOWN_PROPERTY:"Unknown property \'{property}\'",INVALID_FORMAT:"Invalid {type} format",PATTERN_MISMATCH:"Value doesn\'t match the required pattern"};function Yg(){return typeof process>"u"||!process.env?!1:!!(process.env.CI||process.env.CONTINUOUS_INTEGRATION||process.env.GITHUB_ACTIONS||process.env.GITLAB_CI||process.env.CIRCLECI||process.env.TRAVIS||process.env.JENKINS_URL)}function gv(){return typeof process>"u"||process.env?.NO_COLOR?!1:process.env?.FORCE_COLOR||process.stdout?.isTTY?!0:!Yg()}function Mc(e,t){if(typeof e=="string")return{valid:!0,themeName:e};let n=Pt(ni,e,t),o={...n};if(n.valid&&n.data){let i=n.data;i.name&&(o.themeName=i.name)}return o}function eu(e,t){let n=oi(ni,e,t),o={...n};if(n.valid&&n.data){let i=n.data;typeof i=="object"&&!i.$schema&&(i.$schema="./json-schemas/theme.schema.json"),i.name&&(o.themeName=i.name)}return o}function tu(e,t){let n=Mc(e,t);return!n.valid&&n.errors&&(n.errors=n.errors.map(o=>(o.path.includes("colors")&&!o.suggestion&&(o.suggestion="Colors must be valid hex, rgb, or named colors"),o.path.includes("fonts")&&!o.suggestion&&(o.suggestion="Fonts must include size and family properties"),o.path.includes("headings")&&!o.suggestion&&(o.suggestion="Headings must be an array of 6 style definitions"),o))),n}function Xg(e){return e.valid===!0&&e.data!==void 0}function Bc(e){return{validate:(t,n)=>Mc(t,{...e,...n}),validateJson:(t,n)=>eu(t,{...e,...n}),validateWithEnhancement:(t,n)=>tu(t,{...e,...n})}}var Ha=Bc({clean:!0,applyDefaults:!0}),Uc=Bc({clean:!1,applyDefaults:!1,maxErrors:10});function Zg(e){if(typeof e=="string")return e;if(typeof e=="object"&&e!==null&&"name"in e){let t=e;if(typeof t.name=="string")return t.name}}function Qg(e){if(!e||typeof e!="object")return!1;let t=e;return!!(t.colors&&t.fonts)}var ey={report:mn,section:cn,heading:rn,paragraph:nn,columns:ln,image:on,statistic:an,table:sn,list:pn,custom:Pr};function si(e,t,n){let o=ey[e];if(!o){let a=Pt(Pr,t,n);return{...a,success:a.valid,componentName:e,isCustomComponent:!0}}let i=Pt(o,t,n);return{...i,success:i.valid,componentName:e,isCustomComponent:e==="custom"}}function ru(e,t){let n=Pt(dt,e,t),o={...n};if(n.valid&&n.data){let i=n.data;o.componentName=i.name,o.isCustomComponent=!ci(i.name)}return o}function nu(e,t,n){return Ln(e,t,n)}function ci(e){return e in ey}function ty(e){return $.Check(mn,e)}function ry(e){return $.Check(cn,e)}function ny(e){return $.Check(rn,e)}function oy(e){return $.Check(nn,e)}function iy(e){return $.Check(ln,e)}function ay(e){return $.Check(on,e)}function sy(e){return $.Check(an,e)}function cy(e){return $.Check(sn,e)}function ly(e){return $.Check(pn,e)}function py(e){return $.Check(Pr,e)}function _c(e){return{validate:(t,n,o)=>ci(t)?si(t,n,{...e,...o}):si("custom",n,{...e,...o}),validateDefinition:(t,n)=>ru(t,{...e,...n}),validateCustom:(t,n,o)=>nu(t,n,{...e,...o})}}var ai=_c({clean:!0,applyDefaults:!0}),Dc=_c({clean:!1,applyDefaults:!1,maxErrors:10}),my={document:e=>ii.validate(e),jsonDocument:e=>ii.validateJson(e),theme:e=>Ha.validate(e),jsonTheme:e=>Ha.validateJson(e),component:(e,t)=>ai.validate(e,t),componentDefinition:e=>ai.validateDefinition(e),components:e=>e.map(t=>ai.validate(t.name,t.props)),isDocument:e=>ii.validate(e).valid,isTheme:e=>Ha.validate(e).valid,isComponent:(e,t)=>ai.validate(e,t).valid},uy={document:e=>Wa.validate(e),jsonDocument:e=>Wa.validateJson(e),theme:e=>Uc.validate(e),jsonTheme:e=>Uc.validateJson(e),component:(e,t)=>Dc.validate(e,t),componentDefinition:e=>Dc.validateDefinition(e)};var dy=r.Object({definition:dt,format:r.Optional(r.Union([r.Literal("docx"),r.Literal("pdf"),r.Literal("html")])),options:r.Optional(r.Object({includeMetadata:r.Optional(r.Boolean()),includeComments:r.Optional(r.Boolean({deprecated:!0,description:"Deprecated and ignored. Comments are authored per component via the `comment` prop."})),trackChanges:r.Optional(r.Boolean())},{additionalProperties:!0}))},{additionalProperties:!1,description:"Document generation request"}),fy=r.Object({definition:r.Unknown(),strict:r.Optional(r.Boolean())},{additionalProperties:!1,description:"Document validation request"}),hy=r.Object({success:r.Boolean(),documentId:r.Optional(r.String()),downloadUrl:r.Optional(r.String()),error:r.Optional(r.String()),metadata:r.Optional(r.Object({pageCount:r.Optional(r.Number()),wordCount:r.Optional(r.Number()),generatedAt:r.Optional(r.String({format:"date-time"}))},{additionalProperties:!0}))},{additionalProperties:!1,description:"Document generation response"}),gy=r.Object({valid:r.Boolean(),errors:r.Array(r.Object({path:r.String(),message:r.String(),code:r.Optional(r.String())})),warnings:r.Optional(r.Array(r.Object({path:r.String(),message:r.String(),code:r.Optional(r.String())})))},{additionalProperties:!1,description:"Document validation response"});var yy=dt,by={report:"./json-schemas/components/report.schema.json",section:"./json-schemas/components/section.schema.json",columns:"./json-schemas/components/columns.schema.json",heading:"./json-schemas/components/heading.schema.json",paragraph:"./json-schemas/components/paragraph.schema.json",image:"./json-schemas/components/image.schema.json",statistic:"./json-schemas/components/statistic.schema.json",table:"./json-schemas/components/table.schema.json",header:"./json-schemas/components/header.schema.json",footer:"./json-schemas/components/footer.schema.json",list:"./json-schemas/components/list.schema.json",alignment:"./json-schemas/base/alignment.schema.json",baseComponent:"./json-schemas/base/base-component.schema.json",border:"./json-schemas/base/border.schema.json",spacing:"./json-schemas/base/spacing.schema.json",margins:"./json-schemas/base/margins.schema.json",index:"./json-schemas/index.schema.json"};var yv=1e6;function Oy(e){return e?e.split(/(\\s+)/).filter(t=>t.length>0):[]}function Vc(e){let t=[];for(let n of e){if(!n.text)continue;let o=t[t.length-1];o&&o.type===n.type?o.text+=n.text:t.push({...n})}return t}function bv(e){let t=[];for(let i=0;i<e.length;i++){let a=e[i];if(a.type==="equal"&&/^\\s+$/.test(a.text)){let s=t[t.length-1],c=e[i+1];if(s&&s.type!=="equal"&&c&&c.type!=="equal"){t.push({type:"delete",text:a.text},{type:"insert",text:a.text});continue}}t.push({...a})}let n=[],o=0;for(;o<t.length;){if(t[o].type==="equal"){n.push(t[o]),o++;continue}let i="",a="";for(;o<t.length&&t[o].type!=="equal";)t[o].type==="delete"?i+=t[o].text:a+=t[o].text,o++;i&&n.push({type:"delete",text:i}),a&&n.push({type:"insert",text:a})}return Vc(n)}function Hc(e,t){if(e===t)return e?[{type:"equal",text:e}]:[];let n=Oy(e),o=Oy(t);if(n.length===0)return Vc([{type:"insert",text:t}]);if(o.length===0)return Vc([{type:"delete",text:e}]);if(n.length*o.length>yv)return Vc([{type:"delete",text:e},{type:"insert",text:t}]);let i=n.length,a=o.length,s=Array.from({length:i+1},()=>new Int32Array(a+1));for(let m=i-1;m>=0;m--)for(let u=a-1;u>=0;u--)s[m][u]=n[m]===o[u]?s[m+1][u+1]+1:Math.max(s[m+1][u],s[m][u+1]);let c=[],l=0,p=0;for(;l<i&&p<a;)n[l]===o[p]?(c.push({type:"equal",text:n[l]}),l++,p++):s[l+1][p]>=s[l][p+1]?(c.push({type:"delete",text:n[l]}),l++):(c.push({type:"insert",text:o[p]}),p++);for(;l<i;)c.push({type:"delete",text:n[l]}),l++;for(;p<a;)c.push({type:"insert",text:o[p]}),p++;return bv(c)}function Ya(e){return e.replace(/\\[([^\\]]+)\\]\\(([^)]+)\\)/g,"$1").replace(/(\\*\\*\\*|___)([\\s\\S]*?)\\1|(\\*\\*|__)([\\s\\S]*?)\\3|(\\*|_)([\\s\\S]*?)\\5/g,(t,n,o,i,a,s,c)=>o??a??c??"")}var lu=new Set(["paragraph","heading"]);function cr(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Bn(e,t){return{...e.author&&{author:e.author},...e.date&&{date:e.date},segments:t}}function Ja(e){let t=e.props?.text;return typeof t=="string"?t.normalize("NFC"):""}function Kc(e){return Ya(Ja(e))}var Ov=/\\{[^}]+\\}/;function Gc(e){return e.enabled!==!1}function es(e,t,n,o){e.some(i=>i.type!=="equal"&&Ov.test(i.text))&&o.summary.untracked.push({path:t,kind:"modified",component:n,detail:"placeholder (e.g. {DATE}) inside inserted/deleted text renders literally in the redline"})}function _n(e,...t){let n={...e||{}};for(let o of t)delete n[o];return n}var xv=4e6;function pu(e,t,n){let o=e.map(n),i=t.map(n),a=0;for(;a<e.length&&a<t.length&&o[a]===i[a];)a++;let s=e.length,c=t.length;for(;s>a&&c>a&&o[s-1]===i[c-1];)s--,c--;let l=[];for(let O=0;O<a;O++)l.push({op:"equal",oldItem:e[O],newItem:t[O]});let p=[];for(let O=0;O<e.length-s;O++)p.push({op:"equal",oldItem:e[s+O],newItem:t[c+O]});let m=s-a,u=c-a,f=[];if(m*u>xv){for(let O=0;O<m;O++)f.push({op:"delete",oldItem:e[a+O]});for(let O=0;O<u;O++)f.push({op:"insert",newItem:t[a+O]});return[...l,...f,...p]}let x=Array.from({length:m+1},()=>new Int32Array(u+1));for(let O=m-1;O>=0;O--)for(let A=u-1;A>=0;A--)x[O][A]=o[a+O]===i[a+A]?x[O+1][A+1]+1:Math.max(x[O+1][A],x[O][A+1]);let S=0,C=0;for(;S<m&&C<u;)o[a+S]===i[a+C]?(f.push({op:"equal",oldItem:e[a+S],newItem:t[a+C]}),S++,C++):x[S+1][C]>=x[S][C+1]?(f.push({op:"delete",oldItem:e[a+S]}),S++):(f.push({op:"insert",newItem:t[a+C]}),C++);for(;S<m;)f.push({op:"delete",oldItem:e[a+S++]});for(;C<u;)f.push({op:"insert",newItem:t[a+C++]});return[...l,...f,...p]}function mu(e,t,n){let o=new Array(e.length).fill(!1),i=new Array(t.length).fill(-1),a=0;for(let p=0;p<t.length;p++)for(let m=a;m<e.length;m++)if(!o[m]&&n(e[m],t[p])){o[m]=!0,i[p]=m,a=m+1;break}let s=[],c=[],l=0;for(let p=0;p<t.length;p++){let m=i[p];if(m>=0){for(;l<m;)o[l]||s.push({kind:"deleted",oldItem:e[l]}),l++;l=m+1,s.push({kind:"paired",oldItem:e[m],newItem:t[p]}),c.push({oldItem:e[m],newItem:t[p]})}else s.push({kind:"inserted",newItem:t[p]})}for(let p=l;p<e.length;p++)o[p]||s.push({kind:"deleted",oldItem:e[p]});return{pairs:c,plan:s}}function Sv(e,t,n,o){let i=Kc(e),a=Kc(t),s=!cr(_n(e.props,"text","revision","comment"),_n(t.props,"text","revision","comment"));if(s&&o.summary.untracked.push({path:n,kind:"modified",component:t.name,detail:"formatting/props changed (not expressible as a tracked change); new version rendered"}),i===a)return Ja(e)!==Ja(t)?o.summary.untracked.push({path:n,kind:"modified",component:t.name,detail:"inline formatting or link target changed (markdown-only); new version rendered without a tracked change"}):s||o.summary.unchangedBlocks++,t;o.summary.tracked.modified++;let c=Hc(i,a);return es(c,n,t.name,o),(Ja(e)!==i||Ja(t)!==a)&&o.summary.untracked.push({path:n,kind:"modified",component:t.name,detail:"inline formatting or links flattened to plain text in the redline (revision segments render literally)"}),{...t,props:{...Jc(t,n,o),text:a,revision:Bn(o,c)}}}function Jc(e,t,n){let o={...e.props??{}},i=["footnotes","endnotes"].filter(a=>{let s=o[a];return Array.isArray(s)&&s.length>0});if(i.length===0)return o;for(let a of i)delete o[a];return n.summary.untracked.push({path:t,kind:"modified",component:e.name,detail:`${i.join(" and ")} dropped from a tracked-change paragraph (note markers do not resolve inside revision text); the note bodies are not in the redline`}),o}function Iv(e,t,n){n.summary.tracked.inserted++;let o=Kc(e),i=[{type:"insert",text:o}];return es(i,t,e.name,n),{...e,props:{...Jc(e,t,n),text:o,revision:Bn(n,i)}}}function wv(e,t,n){n.summary.tracked.deleted++;let i=[{type:"delete",text:Kc(e)}];return es(i,t,e.name,n),{...e,props:{...Jc(e,t,n),text:"",revision:Bn(n,i)}}}function ou(e){return(e.props?.items||[]).map(n=>{let o=typeof n=="string"?n:n.text,i=typeof n=="string"?0:n.level||0;return{raw:o,text:Ya(o.normalize("NFC")),level:i}})}function Cv(e,t,n,o){let i=!cr(_n(e.props,"items"),_n(t.props,"items"));i&&o.summary.untracked.push({path:n,kind:"modified",component:"list",detail:"list configuration changed (format/levels/spacing); new version rendered"});let a=ou(e),s=ou(t),c=f=>f.map(x=>({text:x.text,level:x.level}));if(cr(c(a),c(s)))return cr(a.map(f=>f.raw),s.map(f=>f.raw))?i||o.summary.unchangedBlocks++:o.summary.untracked.push({path:n,kind:"modified",component:"list",detail:"inline formatting or link target changed in list items (markdown-only); new version rendered without a tracked change"}),t;let l=pu(a,s,f=>`${f.level}:${f.text}`),p=[],m=!1,u=0;for(;u<l.length;){let f=l[u];if(f.op==="equal"){p.push({text:f.newItem.raw,level:f.newItem.level}),u++;continue}let x=[],S=[];for(;u<l.length&&l[u].op!=="equal";){let O=l[u];O.op==="delete"?x.push(O.oldItem):O.op==="insert"&&S.push(O.newItem),u++}let{plan:C}=mu(x,S,(O,A)=>O.level===A.level);for(let O of C)if(m=!0,O.kind==="paired"){let A=Hc(O.oldItem.text,O.newItem.text);es(A,n,"list",o),p.push({text:O.newItem.text,level:O.newItem.level,revision:Bn(o,A)})}else O.kind==="inserted"?p.push({text:O.newItem.text,level:O.newItem.level,revision:Bn(o,[{type:"insert",text:O.newItem.text}])}):p.push({text:"",level:O.oldItem.level,revision:Bn(o,[{type:"delete",text:O.oldItem.text}])})}return m&&o.summary.tracked.modified++,{...t,props:{...t.props,items:p}}}function Sy(e,t,n){t==="insert"?n.summary.tracked.inserted++:n.summary.tracked.deleted++;let o=ou(e).map(i=>({text:t==="insert"?i.text:"",level:i.level,revision:Bn(n,[{type:t,text:i.text}])}));return{...e,props:{...e.props,items:o}}}function iu(e){if(!e)return"";let t=e.content;if(typeof t=="string")return Ya(t.normalize("NFC"));if(t&&typeof t=="object"){let o=t.props?.text;if(typeof o=="string")return Ya(o.normalize("NFC"))}return""}function au(e){if(!e)return"";let t=e.content;if(typeof t=="string")return t.normalize("NFC");if(t&&typeof t=="object"){let n=t.props?.text;if(typeof n=="string")return n.normalize("NFC")}return""}function xy(e){if(!e)return!0;let t=e.content;return t===void 0||typeof t=="string"?!0:typeof t=="object"&&t.name==="paragraph"}function su(e){let t=e.props?.columns??[],n=t.reduce((i,a)=>Math.max(i,a.cells?.length??0),0),o=e.props?.rows??[];return Array.from({length:n},(i,a)=>{let s=t.map(c=>c.cells?.[a]);return{cells:s,key:s.map(iu).join("\\0"),rawKey:s.map(au).join("\\0"),rowProps:o[a]}})}function Iy(e,t,n){let o=e.props?.columns??[],i=t.map((a,s)=>({...a.rowProps??{},...n[s]}));return{...e,props:{...e.props,columns:o.map((a,s)=>({...a,cells:t.map(c=>c.cells[s]??{content:""})})),...i.some(a=>Object.keys(a).length>0)&&{rows:i}}}}function qc(e){return Array.isArray(e.props?.columns)&&!e.props?.headers}function Pv(e,t,n,o,i,a){let s=Hc(n,o);es(s,i,"table",a),(au(t)!==n||au(e)!==o)&&a.summary.untracked.push({path:i,kind:"modified",component:"table",detail:"inline formatting or links flattened to plain text in a table cell (revision segments render literally)"});let c=e??{content:""};return{...c,content:$v(c.content,o,i,a),revision:Bn(a,s)}}function $v(e,t,n,o){if(!e||typeof e!="object")return t;let i=e;return{...i,props:{...Jc(i,n,o),text:t}}}function Tv(e,t,n,o){let i=su(e),a=su(t),s=e.props?.columns??[],c=t.props?.columns??[];if(s.length!==c.length)return o.summary.untracked.push({path:n,kind:"modified",component:"table",detail:"table column count changed (columns are not expressible as a tracked change); new version rendered"}),t;let l=!cr(_n(e.props,"columns","rows"),_n(t.props,"columns","rows"));l&&o.summary.untracked.push({path:n,kind:"modified",component:"table",detail:"table configuration changed (borders/widths/defaults); new version rendered"});let p=!cr(s.map(O=>O.header),c.map(O=>O.header));if(p&&o.summary.untracked.push({path:n,kind:"modified",component:"table",detail:"table header row changed (headers are not row content); new version rendered"}),cr(i.map(O=>O.key),a.map(O=>O.key)))return cr(i.map(O=>O.rawKey),a.map(O=>O.rawKey))?!l&&!p&&cr(i,a)&&o.summary.unchangedBlocks++:o.summary.untracked.push({path:n,kind:"modified",component:"table",detail:"inline formatting or link target changed in table cells (markdown-only); new version rendered without a tracked change"}),t;let m=pu(i,a,O=>O.key),u=[],f=[],x=!1,S=(O,A)=>{u.push(O),f.push(A)},C=0;for(;C<m.length;){let O=m[C];if(O.op==="equal"){S(O.newItem,{}),C++;continue}let A=[],I=[];for(;C<m.length&&m[C].op!=="equal";){let G=m[C];G.op==="delete"?A.push(G.oldItem):G.op==="insert"&&I.push(G.newItem),C++}let{plan:R}=mu(A,I,(G,ze)=>G.cells.length===ze.cells.length&&G.cells.every(xy)&&ze.cells.every(xy));for(let G of R)if(x=!0,G.kind==="paired"){let ze=G.newItem.cells.map((Te,Ae)=>{let P=iu(G.oldItem.cells[Ae]),Q=iu(Te);return P===Q?Te??{content:""}:Pv(Te,G.oldItem.cells[Ae],P,Q,n,o)});S({...G.newItem,cells:ze},{})}else G.kind==="inserted"?(o.summary.tracked.inserted++,S(G.newItem,{revision:cu(o,"insert")})):(o.summary.tracked.deleted++,S(G.oldItem,{revision:cu(o,"delete")}))}return x&&o.summary.tracked.modified++,Iy(t,u,f)}function wy(e,t,n){t==="insert"?n.summary.tracked.inserted++:n.summary.tracked.deleted++;let o=su(e);return Iy(e,o,o.map(()=>({revision:cu(n,t)})))}function cu(e,t){return{type:t,...e.author&&{author:e.author},...e.date&&{date:e.date}}}function zc(e){return Array.isArray(e.children)}function Av(e,t){return e.name===t.name}function Lv(e,t,n,o){let i=Gc(e),a=Gc(t);return!i&&!a?(o.summary.unchangedBlocks++,t):!i&&a?Cy(t,n,o):i&&!a?Py(e,n,o)??t:lu.has(t.name)?Sv(e,t,n,o):t.name==="list"?Cv(e,t,n,o):t.name==="table"&&qc(e)&&qc(t)?Tv(e,t,n,o):zc(t)||zc(e)?(!cr(e.props,t.props)&&o.summary.untracked.push({path:n,kind:"modified",component:t.name,detail:"container props changed; new version rendered"}),{...t,children:Yc(e.children||[],t.children||[],`${n}/children`,o)}):(o.summary.untracked.push({path:n,kind:"modified",component:t.name,detail:`"${t.name}" changed (no native tracked-change support); new version rendered`}),t)}function Cy(e,t,n){return Gc(e)?lu.has(e.name)?Iv(e,t,n):e.name==="list"?Sy(e,"insert",n):e.name==="table"&&qc(e)?wy(e,"insert",n):zc(e)?(typeof e.props?.title=="string"&&n.summary.untracked.push({path:t,kind:"inserted",component:e.name,detail:`"${e.name}" title rendered without insertion mark (titles are props, not text blocks)`}),{...e,children:Yc([],e.children||[],`${t}/children`,n)}):(n.summary.untracked.push({path:t,kind:"inserted",component:e.name,detail:`"${e.name}" added (rendered, but not marked as a tracked insertion)`}),e):e}function Py(e,t,n){if(!Gc(e))return null;if(lu.has(e.name))return wv(e,t,n);if(e.name==="list")return Sy(e,"delete",n);if(e.name==="table"&&qc(e))return wy(e,"delete",n);if(zc(e)){typeof e.props?.title=="string"&&n.summary.untracked.push({path:t,kind:"deleted",component:e.name,detail:`"${e.name}" title still rendered without deletion mark (titles are props, not text blocks)`});let o=Yc(e.children||[],[],`${t}/children`,n);return{...e,children:o}}return n.summary.untracked.push({path:t,kind:"deleted",component:e.name,detail:`"${e.name}" removed (dropped from the redline; Word cannot mark it as a tracked deletion)`}),null}function Yc(e,t,n,o){let i=pu(e,t,l=>JSON.stringify(l)),a=[],s=0,c=0;for(;s<i.length;){let l=i[s];if(l.op==="equal"){o.summary.unchangedBlocks++,a.push(l.newItem),s++,c++;continue}let p=[],m=[];for(;s<i.length&&i[s].op!=="equal";){let f=i[s];f.op==="delete"?p.push(f.oldItem):f.op==="insert"&&m.push(f.newItem),s++}let{plan:u}=mu(p,m,Av);for(let f of u)if(f.kind==="paired")a.push(Lv(f.oldItem,f.newItem,`${n}/${c}`,o)),c++;else if(f.kind==="inserted")a.push(Cy(f.newItem,`${n}/${c}`,o)),c++;else{let x=Py(f.oldItem,`${n}/${c}`,o);x&&a.push(x)}}return a}function vv(e,t,n={}){if(!e||e.name!=="docx")throw new Error(\'Old document: top-level component must be "docx"\');if(!t||t.name!=="docx")throw new Error(\'New document: top-level component must be "docx"\');let o={tracked:{modified:0,inserted:0,deleted:0},untracked:[],unchangedBlocks:0,notes:[]},i={author:n.author,date:n.date,summary:o};!cr(_n(e.props,"trackRevisions"),_n(t.props,"trackRevisions"))&&o.untracked.push({path:"/props",kind:"modified",component:"docx",detail:"document props changed (theme/metadata/defaults); new version used"});let s=Yc(e.children||[],t.children||[],"/children",i);return o.tracked.deleted>0&&o.notes.push(`${o.tracked.deleted} fully deleted block(s): accepting all changes leaves an empty paragraph behind (OOXML paragraph-mark deletion is not supported by the renderer)`),{document:{...t,props:{...t.props,trackRevisions:!0},children:s},summary:o}}Ft.Set("uri",e=>{try{return new URL(e),!0}catch{return e.includes(".json")||e.includes("/")||e.includes("\\\\")?!0:/^https?:\\/\\/.+/.test(e)}});Ft.Set("date-time",e=>/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?Z?$/.test(e)&&!isNaN(Date.parse(e)));var uu=class{constructor(){j(this,"schema",dt)}parse(e){let t;if(typeof e=="string")try{t=JSON.parse(e)}catch(n){throw new li("Invalid JSON syntax",this.extractJSONSyntaxError(n,e))}else t=e;if(typeof t!="object"||t===null||!("name"in t)||t.name!=="docx")throw new pi(\'Invalid document structure: Document must be a docx component with name="docx"\',[{path:"name",message:\'Document must be a docx component with name="docx"\',code:"INVALID_STRUCTURE"}]);if(!$.Check(this.schema,t)){let n=[...$.Errors(this.schema,t)];throw new pi("JSON validation failed",this.formatTypeBoxErrors(n,typeof e=="string"?e:JSON.stringify(e,null,2)))}return t}validate(e){try{return this.parse(e),{valid:!0,errors:[],warnings:[]}}catch(t){return t instanceof li||t instanceof pi?{valid:!1,errors:t.validationErrors,warnings:[]}:{valid:!1,errors:[{path:"",message:t instanceof Error?t.message:"Unknown validation error",code:"UNEXPECTED_ERROR"}],warnings:[]}}}parseWithLineNumbers(e){let t=e.split(`\n`);try{return this.parse(e)}catch(n){if(n instanceof li||n instanceof pi){let o=n.validationErrors.map(i=>({...i,...this.findLineNumber(i.path,e,t)}));throw n instanceof li?new li(n.message,o):new pi(n.message,o)}throw n}}extractJSONSyntaxError(e,t){let n=e.message,o=n.match(/position\\s+(\\d+)/i)||n.match(/at\\s+(\\d+)/i)||n.match(/character\\s+(\\d+)/i),i=0,a=0;if(o){let s=parseInt(o[1],10),c=t.substring(0,s).split(`\n`);i=c.length,a=c[c.length-1].length+1}return[{path:"",message:`JSON syntax error: ${n}`,code:"JSON_SYNTAX_ERROR",line:i||void 0,column:a||void 0,suggestions:["Check for missing commas, brackets, or quotes","Validate JSON syntax using a JSON validator","Ensure all strings are properly quoted"]}]}formatTypeBoxErrors(e,t){return e.map(n=>{let o=n.path||"",i=this.findLineNumber(o,t);return{path:o,message:this.formatTypeBoxErrorMessage(n),code:this.getErrorCode(n),line:i.line,column:i.column,suggestions:this.generateSuggestions(n)}})}formatTypeBoxErrorMessage(e){let t=e.path?`at "${e.path}"`:"",n=e.message;return n.includes("Expected")?`${n} ${t}`:n.includes("Required property")?`${n} ${t}`:n.includes("Unexpected property")?`${n} ${t}`:n.includes("minimum")?`Value is too small ${t}. ${n}`:n.includes("maximum")?`Value is too big ${t}. ${n}`:`${n} ${t}`}getErrorCode(e){let t=String(e.type||"VALIDATION_ERROR").toUpperCase(),n=e.path?e.path.replace(/\\//g,"_").toUpperCase():"";return n?`${t}_${n}`:t}generateSuggestions(e){let t=[],n=e.message;if(n.includes("Expected string"))t.push("Ensure the value is wrapped in quotes");else if(n.includes("Expected number"))t.push("Remove quotes around numeric values");else if(n.includes("Expected array"))t.push("Use square brackets [] for arrays");else if(n.includes("Expected object"))t.push("Use curly braces {} for objects");else if(n.includes("Expected literal")){let o=n.match(/Expected literal (.+)/);o&&t.push(`Use the exact value: ${o[1]}`)}else if(n.includes("Unexpected property"))t.push("Remove unknown properties or check spelling"),t.push("Refer to the JSON schema documentation for valid properties");else if(n.includes("Expected union")){t.push("Check that the value matches one of the allowed formats");let o=e.path??"";(/\\/children\\/\\d+$/.test(o)||o.endsWith("/name"))&&t.push("Verify the component name is spelled correctly")}else if(n.includes("minimum")){let o=n.match(/minimum.*?(\\d+)/);o&&(n.includes("Array")?t.push(`Array must have at least ${o[1]} items`):t.push(`Value must be at least ${o[1]}`))}else n.includes("format")&&n.includes("uri")&&t.push("Ensure the URL is valid and starts with http:// or https://");return t.length===0&&(t.push("Check the JSON schema documentation for valid values"),t.push("Verify the property name and value format")),t}findLineNumber(e,t,n){if(!e)return{};let o=n||t.split(`\n`),i=e.split(".");for(let a=0;a<o.length;a++){let s=o[a],c=i[i.length-1];if(s.includes(`"${c}"`)){let l=s.indexOf(`"${c}"`)+1;return{line:a+1,column:l}}}return{}}},li=class extends Error{constructor(t,n){super(t);j(this,"validationErrors");this.name="JsonParsingError",this.validationErrors=n}},pi=class extends Error{constructor(t,n){super(t);j(this,"validationErrors");this.name="JsonValidationError",this.validationErrors=n}};function Ev(e){return new uu().parse(e)}function Nv(e){return new uu().parseWithLineNumbers(e)}function kv(e){return Array.isArray(e)?e.map(t=>{if(typeof t=="string")return t;let n=t.path?`${t.path}: `:"",o=t.message||"Validation error";return`${n}${o}`}):[]}function Rv(e,t){let n=ci(e)?e:"custom",o=si(n,t);return o.valid?{success:!0,data:o.data}:{success:!1,error:o.errors||[]}}function jv(e){let t=ru(e);return t.valid?{success:!0,data:t.data}:{success:!1,error:t.errors||[]}}function Fv(e,t){let n=t&&ci(t)?t:"custom",o=si(n,e);return o.valid?[]:(o.errors||[]).map(i=>i.path?`${i.path}: ${i.message}`:i.message)}function Uv(e){let t=e.path||"root",n=e.message,o,i,a,s;if(n.includes("Expected")){let c=n.match(/Expected (.+) but received (.+)/);c&&(i=c[1],a=c[2],o=Dv(i,a))}if(n.includes("Required property")){let c=n.match(/Required property \'(.+)\'/);c&&(n=`Missing required field: ${c[1]}`,o=`Add the required field: ${c[1]}`)}if(n.includes("Unexpected property")){let c=n.match(/Unexpected property \'(.+)\'/);c&&(n=`Unknown property: ${c[1]}`,o=`Remove the unknown property: ${c[1]}`)}if(n.includes("Expected union")&&(n="Value does not match any of the expected types",o="Check the documentation for valid format options"),n.includes("Expected literal")){let c=n.match(/Expected literal (.+)/);c&&(i=c[1],n=`Expected value: ${i}`,o=`Use the exact value: ${i}`)}if(n.includes("String length")){let c=n.match(/minimum length of (\\d+)/),l=n.match(/maximum length of (\\d+)/);c?(n=`String must be at least ${c[1]} characters long`,o=`Add more characters to meet the minimum length of ${c[1]}`):l&&(n=`String must be at most ${l[1]} characters long`,o=`Reduce to ${l[1]} characters or less`)}if(n.includes("Expected number")){let c=n.match(/minimum value of ([\\d.]+)/),l=n.match(/maximum value of ([\\d.]+)/);c?(n=`Number must be greater than or equal to ${c[1]}`,o=`Use a value of ${c[1]} or higher`):l&&(n=`Number must be less than or equal to ${l[1]}`,o=`Use a value of ${l[1]} or lower`)}if(n.includes("Array length")){let c=n.match(/minimum length of (\\d+)/),l=n.match(/maximum length of (\\d+)/);c?(n=`Array must have at least ${c[1]} items`,o=`Add more items to meet the minimum of ${c[1]}`):l&&(n=`Array must have at most ${l[1]} items`,o=`Remove items to meet the maximum of ${l[1]}`)}return n.includes("format")&&(n.includes("email")?(n="Invalid email address format",o="Use a valid email format like user@example.com"):n.includes("uri")||n.includes("url")?(n="Invalid URL format",o="Use a valid URL format like https://example.com"):n.includes("date-time")&&(n="Invalid date-time format",o="Use ISO 8601 format like 2024-01-01T00:00:00Z")),n.includes("pattern")&&(n="String does not match the required pattern",o="Check the format requirements for this field"),{path:t,message:n,code:String(e.type||"validation_error"),suggestion:o,expected:i,received:a,options:s}}function Dv(e,t){if(e==="number"&&t==="string")return"Remove quotes or convert the string to a number";if(e==="string"&&t==="number")return"Add quotes or convert the number to a string";if(e==="boolean")return"Use true or false (without quotes)";if(e==="array"&&t==="object")return"Use square brackets [] for arrays instead of curly braces {}";if(e==="object"&&t==="array")return"Use curly braces {} for objects instead of square brackets []";if(t==="null"||t==="undefined")return`Provide a valid ${e} value or mark the field as optional`}function Vn(e){return e.map(Uv)}function Xa(e){return Vn(e).map(t=>{let n=`${t.path}: ${t.message}`;return t.suggestion&&(n+=` (Suggestion: ${t.suggestion})`),n})}function $y(e){let t=new Map;for(let n of Vn(e)){let o=t.get(n.path)||[];o.push(n),t.set(n.path,o)}return t}function Za(e){let t=Vn(e),n=$y(e),o=`Validation failed with ${t.length} error${t.length>1?"s":""}:\n\n`;for(let[i,a]of n){o+=`\\u{1F4CD} ${i}:\n`;for(let s of a)o+=` \\u274C ${s.message}\n`,s.suggestion&&(o+=` \\u{1F4A1} ${s.suggestion}\n`),s.expected&&s.received&&(o+=` \\u{1F4CB} Expected: ${s.expected}, Received: ${s.received}\n`),s.options&&(o+=` \\u{1F4CB} Valid options: ${s.options.join(", ")}\n`);o+=`\n`}return o}function Qa(e){return e.some(t=>!!(t.message.includes("Required property")||t.path.includes("name")&&t.message.includes("Expected literal")||t.message.includes("Expected union")||t.message.includes("Never")))}function Mv(e){if(!e||e==="root")return"document root";let t=e.split(".");if(t.includes("children")){let n=t.indexOf("children");if(t.length>n+1)return`component at index ${t[n+1]}`}return t.includes("props")?"props section":t.includes("theme")?"theme configuration":t.join(" > ")}var Bv=Vn,_v=Xa,Wc={report:mn,section:cn,heading:rn,paragraph:nn,columns:ln,image:on,statistic:an,table:sn,list:pn};function Xc(e,t,n){let o=Wc[e];if(!o){if($.Check(Pr,t))return{success:!0,data:t};let s=[...$.Errors(Pr,t)];return{success:!1,errors:Vn(s),errorStrings:Xa(s),report:n?.includeReport?Za(s):void 0,hasCriticalErrors:n?.checkCritical?Qa(s):void 0}}if($.Check(o,t))return{success:!0,data:t};let i=[...$.Errors(o,t)];return{success:!1,errors:Vn(i),errorStrings:Xa(i),report:n?.includeReport?Za(i):void 0,hasCriticalErrors:n?.checkCritical?Qa(i):void 0}}function du(e,t){let n=t?.maxDepth??10,o=t?.currentDepth??0;if(o>n)return{success:!1,errors:[{path:"children",message:`Maximum nesting depth (${n}) exceeded`,code:"custom",suggestion:"Reduce the nesting level of components"}],errorStrings:[`Maximum nesting depth (${n}) exceeded`],hasCriticalErrors:!0};if($.Check(dt,e)){let s=e,c=[];if(s.children&&Array.isArray(s.children))for(let l=0;l<s.children.length;l++){let p=du(s.children[l],{...t,currentDepth:o+1});if(!p.success){let m=p.errors?.map(u=>({...u,path:`children[${l}].${u.path}`}));return{success:!1,errors:m,errorStrings:m?.map(u=>`${u.path}: ${u.message}`),report:t?.includeReport?`Validation failed in nested component at index ${l}:\n${p.report}`:void 0,hasCriticalErrors:p.hasCriticalErrors}}p.warnings&&c.push(...p.warnings.map(m=>`children[${l}]: ${m}`))}return{success:!0,data:e,warnings:c.length>0?c:void 0}}let i=[...$.Errors(dt,e)];return{success:!1,errors:Vn(i),errorStrings:Xa(i),report:t?.includeReport?Za(i):void 0,hasCriticalErrors:t?.checkCritical?Qa(i):void 0}}function Vv(e,t){let n=[],o=0;for(let{name:s,props:c}of e){let l=s in Wc?Xc(s,c,t):du(c,t);if(n.push(l),l.hasCriticalErrors&&o++,!l.success&&t?.stopOnFirst)break}let i=n.filter(s=>s.success).length,a=n.length-i;return{success:a===0,results:n,summary:{total:n.length,valid:i,invalid:a,criticalErrors:o}}}function Kv(e,t,n){try{let o=n?n(t):t;return Xc(e,o,{includeReport:!0,checkCritical:!0})}catch(o){return{success:!1,errors:[{path:"root",message:`Transformation failed: ${o instanceof Error?o.message:String(o)}`,code:"custom"}],errorStrings:[`Transformation failed: ${o instanceof Error?o.message:String(o)}`],hasCriticalErrors:!0}}}function Gv(e,t){let n=Wc[e];if(!n)return{success:!1,errors:[{path:"name",message:`Unknown component name: ${e}`,code:"custom",suggestion:`Use one of: ${Object.keys(Wc).join(", ")}`}],errorStrings:[`Unknown component name: ${e}`],hasCriticalErrors:!0};if($.Check(n,t))return{success:!0,data:t};let o=[...$.Errors(n,t)];return{success:!1,errors:Vn(o),errorStrings:Xa(o),report:Za(o),hasCriticalErrors:Qa(o)}}function qv(e,t){return Xc(e,t).success}var Ty=["chart","columns","divider","heading","highcharts","image","list","paragraph","docx","section","statistic","table","text-box","toc","visual","block","group"],zv=new Set(Ty);function Wv(e){return e.name==="docx"}function Hv(e){return e.name==="section"}function Jv(e){return e.name==="columns"}function Yv(e){return e.name==="heading"}function Xv(e){return e.name==="paragraph"}function Zv(e){return e.name==="image"}function Qv(e){return e.name==="text-box"}function eE(e){return e.name==="statistic"}function tE(e){return e.name==="table"}function rE(e){return e.name==="list"}function nE(e){return e.name==="toc"}function oE(e){return e.name==="highcharts"}function iE(e){return e.name==="visual"}function aE(e){return e.name==="text-space-after"}var sE="1.0.0";var ju={};tt(ju,{ChartComponentDefaultsSchema:()=>xu,ColorValueSchema:()=>Dn,DEFAULT_ERROR_CONFIG:()=>Pn,DEFAULT_PPTX_RENDERER_ID:()=>un,GradientFillSchema:()=>Qo,GradientStopSchema:()=>xc,HighchartsComponentDefaultsSchema:()=>Ou,ImageComponentDefaultsSchema:()=>gu,PATTERN_FILL_PRESETS:()=>Oc,PPTX_BASE_SCHEMA_METADATA:()=>qy,PPTX_COMPONENT_METADATA:()=>Gy,PPTX_JSON_SCHEMA_URLS:()=>_y,PPTX_RENDERER_IDS:()=>$t,PPTX_SHARED_VERSION:()=>IE,PPTX_STANDARD_COMPONENTS_REGISTRY:()=>Tt,PatternFillSchema:()=>Sc,PositionSchema:()=>Ny,PptxChartPropsSchema:()=>Ka,PptxComponentDefaultsSchema:()=>mi,PptxComponentDefinitionSchema:()=>rl,PptxHighchartsPropsSchema:()=>Va,PptxImagePropsSchema:()=>Ma,PptxJsonComponentDefinitionSchema:()=>By,PptxSlideContentSchema:()=>Ga,PptxStandardComponentDefinitionSchema:()=>My,PptxTablePropsSchema:()=>_a,PresentationPropsSchema:()=>Pu,SEMANTIC_COLOR_ALIASES:()=>yc,SEMANTIC_COLOR_NAMES:()=>gc,STYLE_NAMES:()=>Yo,ShadowSchema:()=>Xo,ShapeComponentDefaultsSchema:()=>yu,ShapePropsSchema:()=>Ba,ShapeTypeSchema:()=>Zo,SlideBackgroundSchema:()=>$u,SlidePropsSchema:()=>Au,StyleNameSchema:()=>Fa,TableComponentDefaultsSchema:()=>bu,TextComponentDefaultsSchema:()=>hu,TextPropsSchema:()=>Da,TextRunSchema:()=>bc,TextStyleSchema:()=>Iu,ThemeConfigSchema:()=>wo,TransitionSchema:()=>Tu,VerticalAlignmentSchema:()=>xo,addPptxBlockAuthoringSchemas:()=>nl,collectImageSourceConflicts:()=>Wy,collectPptxRendererErrors:()=>Cu,collectTextContentConflicts:()=>Hy,compareSemver:()=>fo,comprehensiveValidatePresentation:()=>Zy,convertToJsonSchema:()=>Ky,createAllPptxComponentSchemas:()=>el,createComponentSchema:()=>Vo,createErrorConfig:()=>Sr,createPptxComponentSchemaObject:()=>Co,deepValidatePresentation:()=>Xy,dispatchPptxRootByRenderer:()=>ol,exportSchemaToFile:()=>Ko,fixSchemaReferences:()=>vn,generateUnifiedDocumentSchema:()=>Dy,getAllPptxComponentNames:()=>ky,getPptxComponentsByCategory:()=>Ry,getPptxContainerComponents:()=>jy,getPptxContentComponents:()=>Fy,getPptxStandardComponent:()=>ui,isPptxStandardComponent:()=>Uy,isValidSemver:()=>An,isValidThemeConfig:()=>Ay,latestVersion:()=>mt,parseSemver:()=>Tn,pptxComponentDefinitionName:()=>Kn,pptxComponentRequiresProps:()=>So,preparePptxDocumentBlockTargets:()=>Vy,presentImageSources:()=>zy,transformValueError:()=>$n,transformValueErrors:()=>et,validate:()=>xE,validateJsonPptxTheme:()=>Ru,validateJsonPresentationDocument:()=>ku,validatePptxTheme:()=>rs,validatePresentationDocument:()=>ts,validateStrict:()=>SE});var hu=r.Partial(Da),gu=r.Partial(Ma),yu=r.Partial(Ba),bu=r.Partial(_a),Ou=r.Partial(Va),xu=r.Partial(Ka),mi=r.Object({text:r.Optional(hu),image:r.Optional(gu),shape:r.Optional(yu),table:r.Optional(bu),highcharts:r.Optional(Ou),chart:r.Optional(xu)},{additionalProperties:!0});var cE=r.Union([r.Number({description:"Margin in inches (all sides)"}),r.Object({top:r.Number({description:"Top margin in inches"}),right:r.Number({description:"Right margin in inches"}),bottom:r.Number({description:"Bottom margin in inches"}),left:r.Number({description:"Left margin in inches"})},{additionalProperties:!1})],{description:"Slide margins in inches"}),lE=r.Union([r.Number({description:"Gutter in inches (both axes)"}),r.Object({column:r.Number({description:"Column gutter in inches"}),row:r.Number({description:"Row gutter in inches"})},{additionalProperties:!1})],{description:"Gaps between grid tracks in inches"}),Su=r.Object({columns:r.Optional(r.Number({minimum:1,description:"Number of columns (default: 12)"})),rows:r.Optional(r.Number({minimum:1,description:"Number of rows (default: 6)"})),margin:r.Optional(cE),gutter:r.Optional(lE)},{additionalProperties:!1,description:"Grid layout configuration"}),lr=r.String({pattern:"^#?[0-9A-Fa-f]{6}$",description:"Hex color (e.g. #FF0000)"}),Iu=r.Object({fontSize:r.Optional(r.Number()),fontFace:r.Optional(zt),fontColor:r.Optional(Dn),bold:r.Optional(r.Boolean()),fontWeight:r.Optional(r.Integer({minimum:100,maximum:900})),italic:r.Optional(r.Boolean()),align:r.Optional(r.Union([r.Literal("left"),r.Literal("center"),r.Literal("right"),r.Literal("justify")])),lineSpacing:r.Optional(r.Number()),charSpacing:r.Optional(r.Number()),paraSpaceAfter:r.Optional(r.Number()),paraSpaceBefore:r.Optional(r.Number()),case:r.Optional(bo)},{additionalProperties:!1,description:"Text style preset"}),wo=r.Object({...Nn,displayName:r.Optional(r.String()),description:r.Optional(r.String()),version:r.Optional(r.String()),name:r.String({description:"Theme name"}),colors:r.Object({primary:lr,secondary:lr,accent:lr,background:lr,text:lr,text2:r.Optional(lr),background2:r.Optional(lr),accent4:r.Optional(lr),accent5:r.Optional(lr),accent6:r.Optional(lr)},{additionalProperties:!1,description:"Theme color palette (10-slot scheme)"}),fonts:r.Object({heading:zt,body:zt,mono:r.Optional(zt),light:r.Optional(zt)},{additionalProperties:!1,description:"Font families"}),fontRegistry:r.Optional(Ir),defaults:r.Object({fontSize:r.Number({description:"Default font size in points"}),fontColor:lr},{additionalProperties:!1,description:"Default text styling"}),styles:r.Optional(r.Partial(r.Object(Object.fromEntries(Yo.map(e=>[e,Iu]))),{additionalProperties:!1,description:"Named text style presets"})),componentDefaults:r.Optional(mi)},{additionalProperties:!1,description:"Presentation theme configuration"});function Ay(e){return $.Check(wo,e)}var $t=["pptxgenjs","office-open"],un="pptxgenjs";function Kn(e){return`PptxComponentDefinition_${e}`}function Ly(e,t,n){let o=wu(t),i=Zc(o);if(n==="pptxgenjs")return e==="slide"&&delete i?.transition,o;switch(e){case"image":for(let a of["svg","sizing","rotate","rounding","hyperlink"])delete i?.[a];break;case"shape":delete i?.flipV;break;case"table":for(let a of["autoPage","autoPageRepeatHeader","margin","borderRadius"])delete i?.[a];pE(o);break}return vy(o),o}function Cu(e){if(!e||typeof e!="object"||Array.isArray(e))return[];let t=e,n=t.renderer??un;if(!$t.includes(n))return[{path:"/renderer",message:`Invalid renderer "${String(n)}". Expected "pptxgenjs" or "office-open".`,code:"invalid_value"}];let o=[],i=(s,c)=>{o.push({path:s,message:`The "${n}" renderer does not support ${c}.`,code:"unsupported_renderer_feature"})},a=(s,c)=>{if(Array.isArray(s)){s.forEach((p,m)=>a(p,`${c}/${m}`));return}if(!s||typeof s!="object")return;let l=s.props;if(n==="pptxgenjs")s.name==="slide"&&l?.transition!==void 0&&i(`${c}/props/transition`,"slide transitions");else{if(s.name==="chart"&&l?.type==="bubble"&&i(`${c}/props/type`,"bubble charts"),s.name==="image"){let p={svg:"SVG images",sizing:"image cropping",rotate:"image transforms",rounding:"image rounding",hyperlink:"element hyperlinks"};for(let[m,u]of Object.entries(p))l?.[m]!==void 0&&i(`${c}/props/${m}`,u)}if(s.name==="shape"&&l?.flipV!==void 0&&i(`${c}/props/flipV`,"vertical flipping"),s.name==="table"){let p={autoPage:"table auto-pagination",autoPageRepeatHeader:"table auto-pagination",margin:"table insets",borderRadius:"rounded table corners"};for(let[m,u]of Object.entries(p))l?.[m]!==void 0&&i(`${c}/props/${m}`,u);Array.isArray(l?.rows)&&l.rows.forEach((m,u)=>{Array.isArray(m)&&m.forEach((f,x)=>{if(!(!f||typeof f!="object"))for(let[S,C]of[["colspan","merged table cells"],["rowspan","merged table cells"],["margin","table insets"]])f[S]!==void 0&&i(`${c}/props/rows/${u}/${x}/${S}`,C)})})}}for(let[p,m]of Object.entries(s))p!=="renderer"&&a(m,`${c}/${p}`)};return a(t,""),o}function pE(e){let o=Zc(e)?.rows?.items?.items?.anyOf;if(Array.isArray(o))for(let i of o){let a=Zc(i);a?.text&&(delete a.colspan,delete a.rowspan,delete a.margin,vy(i))}}function Zc(e){if(!(!e||typeof e!="object"))return e.properties}function vy(e){let t=Zc(e),n=e.required;if(!t||!n)return;let o=n.filter(i=>i in t);o.length>0?e.required=o:delete e.required}function wu(e){if(Array.isArray(e))return e.map(wu);if(!e||typeof e!="object")return e;let t=Object.create(Object.getPrototypeOf(e));for(let n of Reflect.ownKeys(e))t[n]=wu(e[n]);return t}var Qc=(e,t)=>r.Union([r.Number({description:e}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:t})]),mE=r.Object({x:r.Optional(Qc("Frame left edge in inches, relative to the enclosing frame or slide","Frame left edge as a percentage of the enclosing width")),y:r.Optional(Qc("Frame top edge in inches, relative to the enclosing frame or slide","Frame top edge as a percentage of the enclosing height")),w:r.Optional(Qc("Frame width in inches","Frame width as a percentage of the enclosing width")),h:r.Optional(Qc("Frame height in inches","Frame height as a percentage of the enclosing height")),grid:r.Optional(en),gridConfig:r.Optional(r.Object({...Su.properties},{additionalProperties:!1,description:"Grid used for grid placements of this group\\u2019s descendants, merged over the enclosing grid field by field. Inside a frame the grid spans the frame."})),direction:r.Optional(r.Union([r.Literal("row"),r.Literal("column")],{description:"Distribute the children into cells along this axis: equal cells, or weighted by `weights`. Each child fills its cell unless it states its own offsets; an omitted optional child simply redistributes the rest."})),gap:r.Optional(r.Number({minimum:0,description:"Space between distributed cells, in inches. Default 0."})),weights:r.Optional(r.Array(r.Number({exclusiveMinimum:0}),{minItems:1,description:"Relative cell sizes in child order (e.g. [1.1, 1] for a 1.1 : 1 split). Missing entries count as 1."}))},{additionalProperties:!1,description:"Transparent group. Without a frame, a plain sequence of slide content; with `x`/`y`/`w`/`h` or `grid`, a frame its children position within (numbers are offsets in inches, percentages are fractions of the frame, omitted values fill it); with `direction`, a row or column that distributes its children into cells."}),Pu=r.Object({title:r.Optional(r.String({description:"Presentation title metadata"})),author:r.Optional(r.String({description:"Presentation author metadata"})),subject:r.Optional(r.String({description:"Presentation subject metadata"})),company:r.Optional(r.String({description:"Company name metadata"})),theme:r.Optional(r.Union([r.String({description:\'Theme name to apply (default: "default"). Built-ins: consulting (the house style), default, dark, minimal.\',examples:["consulting","default","dark","minimal"],default:"default"}),wo],{description:\'Theme to apply: a built-in/custom theme name (default: "default"), or an inline theme config object so the document stays self-contained\'})),fontRegistry:r.Optional(Ir),slideWidth:r.Optional(r.Number({description:"Slide width in inches (default: 10)",default:10})),slideHeight:r.Optional(r.Number({description:"Slide height in inches (default: 7.5)",default:7.5})),rtlMode:r.Optional(r.Boolean({description:"Right-to-left text direction"})),language:r.Optional(r.String({pattern:"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$",description:\'Default presentation language (BCP-47 tag, e.g. "en-US"). Sets the spell-check language for all text; individual text components can override it.\',examples:["en-US","fr-FR","de-DE","it-IT","es-ES"]})),pageNumberFormat:r.Optional(r.Union([r.Literal("9"),r.Literal("09")],{description:\'Format for {PAGE_NUMBER} placeholders: "9" = bare number (default), "09" = zero-padded\',default:"9"})),componentDefaults:r.Optional(mi),grid:r.Optional(Su),blocks:r.Optional(Yr)},{description:"Presentation container props",additionalProperties:!1}),Ny=r.Object({x:r.Optional(r.Union([r.Number({description:"X position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'X position as percentage (e.g., "10%")\'})])),y:r.Optional(r.Union([r.Number({description:"Y position in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Y position as percentage (e.g., "10%")\'})])),w:r.Optional(r.Union([r.Number({description:"Width in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Width as percentage (e.g., "80%")\'})])),h:r.Optional(r.Union([r.Number({description:"Height in inches"}),r.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Height as percentage (e.g., "20%")\'})]))},{description:"Position and size in inches or percentages",additionalProperties:!1}),$u=r.Object({color:r.Optional(Dn),gradient:r.Optional(Qo),image:r.Optional(r.Object({path:r.Optional(r.String({description:"Image file path or URL"})),base64:r.Optional(r.String({description:"Base64-encoded image data"}))},{description:"Background image",additionalProperties:!1}))},{description:"Slide background configuration",additionalProperties:!1}),Tu=r.Object({type:r.Optional(r.Union([r.Literal("fade"),r.Literal("push"),r.Literal("wipe"),r.Literal("zoom"),r.Literal("none")],{description:"Transition effect type"})),speed:r.Optional(r.Union([r.Literal("slow"),r.Literal("medium"),r.Literal("fast")],{description:"Transition speed"}))},{description:"Slide transition configuration",additionalProperties:!1}),Au=r.Object({meta:r.Optional(r.Object({title:r.Optional(r.String({description:"Authoring label for this slide, shown in editors and outlines. Never rendered \\u2014 slide content is unaffected."}))},{additionalProperties:!1,description:"Authoring metadata; has no effect on the presentation."})),background:r.Optional($u),transition:r.Optional(Tu),notes:r.Optional(r.String({description:"Speaker notes for this slide"})),hidden:r.Optional(r.Boolean({description:"Hide this slide from presentation"}))},{description:"Slide container props",additionalProperties:!1}),Ey=[...Qr.map(({name:e})=>e),"block","group"],Tt=[{name:"pptx",propsSchema:Pu,hasChildren:!0,allowedChildren:["slide"],category:"container",propsRequired:!0,description:"Main presentation container - defines the overall presentation structure. Required as the root component. Always declare `slideWidth`/`slideHeight` (13.333 \\xD7 7.5 for 16:9) \\u2014 omitted, the renderer silently falls back to 4:3 and 16:9 content leaves a dead strip.",special:{hasSchemaField:!0}},{name:"slide",propsSchema:Au,hasChildren:!0,allowedChildren:Ey,category:"container",description:"Slide container - groups content elements on a single slide. One idea per slide: past roughly 40 words of body text, split the content across more slides."},{name:"group",propsSchema:mE,hasChildren:!0,allowedChildren:Ey,category:"layout",description:"Transparent group of slide content; also the inspectable result of block expansion. Give it a frame (x/y/w/h or grid) to position children within it, and a direction to distribute them into equal or weighted cells."},{name:"block",propsSchema:jn,hasChildren:!1,category:"layout",description:"Invoke a JSON block defined in this document\\u2019s props.blocks. Fill its named slots; no block names are built into the engine and no coordinates are accepted here."},...Qr];function ui(e){return Tt.find(t=>t.name===e)}function ky(){return Tt.map(e=>e.name)}function Ry(e){return Tt.filter(t=>t.category===e)}function jy(){return Tt.filter(e=>e.hasChildren)}function Fy(){return Tt.filter(e=>!e.hasChildren)}function Uy(e){return Tt.some(t=>t.name===e)}function Co(e,t,n){let o={name:r.Literal(e.name),id:r.Optional(r.String()),enabled:r.Optional(r.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true."}))};return e.special?.hasSchemaField&&(o.$schema=r.Optional(r.String({format:"uri"})),o.renderer=n?n.requireDiscriminator?r.Literal(n.renderer,{description:"Renderer backend for this presentation"}):r.Optional(r.Literal(n.renderer,{description:\'Renderer backend. Omitted defaults to "pptxgenjs".\'})):r.Optional(r.Union($t.map(i=>r.Literal(i)),{description:\'Renderer backend. Omitted defaults to "pptxgenjs".\'}))),o.props=n?Ly(e.name,e.propsSchema,n.renderer):e.propsSchema,e.hasChildren&&t&&(o.children=r.Optional(r.Array(t))),So(e)||(o.props=r.Optional(o.props)),r.Object(o,{additionalProperties:!1,description:e.description})}function el(e){return Tt.map(t=>Co(t,e))}function tl(e,t=[],n){let o=new Map;for(let c of Tt)c.hasChildren||o.set(c.name,Co(c,void 0,n));let i=Tt.filter(c=>c.hasChildren),a=new Map,s=[...i];for(;s.length>0;){let c=s.length;for(let l=s.length-1;l>=0;l--){let p=s[l];if(p.name==="group"){let S=r.Intersect([e,r.Object({name:r.Union([...p.allowedChildren.map(C=>r.Literal(C)),...t.map(C=>C.properties?.name??r.String())])})]);a.set(p.name,Co(p,S,n)),s.splice(l,1);continue}if(!p.allowedChildren){a.set(p.name,Co(p,e,n)),s.splice(l,1);continue}if(!p.allowedChildren.filter(S=>i.some(C=>C.name===S)).every(S=>a.has(S)))continue;let f=[...p.allowedChildren.map(S=>a.get(S)??o.get(S)).filter(S=>S!==void 0),...t],x=f.length===1?f[0]:r.Union(f);a.set(p.name,Co(p,x,n)),s.splice(l,1)}if(s.length===c)throw new Error(`Circular allowedChildren among: ${s.map(l=>l.name).join(", ")}`)}return[...a.values(),...o.values()]}function uE(e,t,n,o){let i={name:r.Literal(e.name),id:r.Optional(r.String()),enabled:r.Optional(r.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true."})),version:o?r.Optional(r.Literal(t.version)):r.Literal(t.version),props:t.propsSchema};return t.hasChildren&&(i.children=r.Optional(r.Array(n))),r.Object(i,{additionalProperties:!1,description:t.description??e.name})}function Dy(e={}){let{customComponents:t=[]}=e,n=$t.map(o=>dE(t,o,o!==un));return r.Union(n,{description:"Presentation definition, discriminated by the optional renderer field. Omitted renderer means pptxgenjs."})}function dE(e,t,n){return r.Recursive(o=>{let i=[];for(let c of e)if(c.versions.length>0){let l=mt(c.versions.map(m=>m.version)),p=c.versions.map(m=>uE(c,m,o,m.version===l));i.push(...p)}let s=[...tl(o,i,{renderer:t,requireDiscriminator:n}),...i];return s.length===0?r.Object({}):r.Union(s)},{$id:Kn(t)})}var My=r.Union([...el(r.Any())],{discriminator:{propertyName:"name"},description:"Standard PPTX component definition with discriminated union"}),rl=r.Recursive(e=>r.Union([...tl(e)],{discriminator:{propertyName:"name"},description:"PPTX component definition with discriminated union"}));var By=rl,_y={presentation:"./json-schemas/components/presentation.schema.json",slide:"./json-schemas/components/slide.schema.json",text:"./json-schemas/components/text.schema.json",image:"./json-schemas/components/image.schema.json",shape:"./json-schemas/components/shape.schema.json",table:"./json-schemas/components/table.schema.json",index:"./json-schemas/index.schema.json"};function nl(e){let t=e.definitions??{},n=new Map;for(let i of $t){let a=Kn(i);t[a]&&n.set(i,Ea(t,a,["pptx","slide"],"pptx"))}let o=i=>{if(!i||typeof i!="object")return;if(Array.isArray(i)){i.forEach(o);return}let a=i;if(a.properties?.name?.const==="pptx"){let s=n.get(a.properties.renderer?.const),c=a.properties.props?.properties?.blocks?.patternProperties;if(s&&c)for(let l of Object.values(c))l.properties.body.items=s}Object.values(a).forEach(o)};o(e)}function ol(e){let t=e.anyOf;if(!Array.isArray(t))return;let n=new Map;for(let a of $t){let s=`#/definitions/${Kn(a)}`,c=t.find(l=>l&&l.$ref===s);c&&n.set(a,c)}if(n.size!==t.length||!n.has(un))return;let o=a=>({properties:{renderer:{const:a}},required:["renderer"]}),i=$t.filter(a=>a!==un&&n.has(a));delete e.anyOf,e.type="object",e.properties={renderer:{description:\'Renderer backend. Omitted defaults to "pptxgenjs".\',anyOf:$t.filter(a=>n.has(a)).map(a=>({const:a,type:"string"}))}},e.allOf=[...i.map(a=>({if:o(a),then:n.get(a)})),{if:{not:{anyOf:i.map(o)}},then:n.get(un)}]}function Vy(e){let t=e.definitions??{},n=[];for(let o of $t){let i=Kn(o),a=t[i];if(!a)continue;let s=`PptxSlotContent_${o}`;if(!t[s]){let p=Ws(a).find(m=>m.properties?.name?.const==="slide")?.properties?.children?.items;p&&(t[s]=JSON.parse(JSON.stringify(p)))}if(!t[s]){n.push({name:i});continue}let c={$ref:`#/definitions/${s}`};n.push({name:i,componentRef:c},{name:s,componentRef:c})}return n}function Ky(e,t={}){return Hs(e,{...t,enrich:n=>{nl(n),ol(n)}})}var Gy={presentation:{title:"Presentation Component",description:"Top-level presentation container with metadata and settings"},slide:{title:"Slide Component",description:"Slide container for organizing content elements"},text:{title:"Text Component",description:"Text element with formatting and positioning"},image:{title:"Image Component",description:"Image element with sizing and positioning"},shape:{title:"Shape Component",description:"Geometric shape with optional text and styling"},table:{title:"Table Component",description:"Tabular data display with rows and columns"}},qy={position:{title:"Position",description:"Position and size in inches or percentages"},"slide-background":{title:"Slide Background",description:"Slide background configuration"},transition:{title:"Transition",description:"Slide transition effect configuration"},shadow:{title:"Shadow",description:"Shadow configuration for elements"}};var fE=["path","base64","svg"];function zy(e){if(!e||typeof e!="object")return[];let t=e;return fE.filter(n=>{let o=t[n];return typeof o=="string"&&o.trim().length>0})}function Wy(e){let t=[],n=(o,i)=>{if(Array.isArray(o)){o.forEach((a,s)=>n(a,`${i}/${s}`));return}if(!(!o||typeof o!="object")){if(o.name==="image"){let a=zy(o.props);a.length>1&&t.push({path:`${i}/props`,message:`Image component accepts only one source, but found ${a.map(s=>`"${s}"`).join(", ")}. Use exactly one of "path", "base64", or "svg".`,code:"mutually_exclusive"})}for(let a of Object.keys(o))n(o[a],`${i}/${a}`)}};return n(e,""),t}function Hy(e){let t=[],n=(o,i,a)=>{if(Array.isArray(o)){o.forEach((s,c)=>n(s,`${i}/${c}`,a));return}if(!(!o||typeof o!="object")){if(!a&&o.name==="text"&&o.props&&typeof o.props=="object"){let s=typeof o.props.text=="string",c=Array.isArray(o.props.runs);s&&c?t.push({path:`${i}/props`,message:\'Text component accepts either "text" or "runs", not both. Use exactly one of the two.\',code:"mutually_exclusive"}):!s&&!c&&t.push({path:`${i}/props`,message:\'Text component requires content: set either "text" or "runs".\',code:"required_property"})}for(let s of Object.keys(o))n(o[s],`${i}/${s}`,a||i==="/props"&&s==="blocks")}};return n(e,"",!1),t}var hE=Object.fromEntries(Tt.map(e=>[e.name,e.propsSchema])),Lu=new Set(Tt.filter(e=>!!e.special?.hasSchemaField).map(e=>e.name)),Nu=new Set(["name","id","enabled","props","children"]),gE=new Set([...Nu,"version"]),Jy=new Set([...Nu,"$schema"]);Jy.add("renderer");var yE={id:"string",enabled:"boolean",$schema:"string",version:"string"};function Yy(e,t,n,o,i){for(let a of Object.keys(e)){if(!n.has(a)){i.push({path:`${t}/${a}`,message:`Unknown field "${a}" on ${o}`,code:"unknown_field"});continue}let s=yE[a];s&&typeof e[a]!==s&&i.push({path:`${t}/${a}`,message:`Field "${a}" on ${o} must be a ${s}`,code:"invalid_type"})}}function Xy(e,t={}){let n=[];if(!e||typeof e!="object")return n.push({path:"root",message:"Presentation must be an object",code:"invalid_type"}),n;if(!e.name)n.push({path:"/name",message:\'Missing required field "name"\',code:"required_property"});else if(!Lu.has(e.name)){let i=[...Lu].map(a=>`"${a}"`).join(", ");n.push({path:"/name",message:`Invalid name "${e.name}". Expected ${i}`,code:"invalid_value"})}Yy(e,"",Jy,"the root component",n);let o=ui(e.name);return"props"in e?Lu.has(e.name)&&n.push(...Eu(e.name,e.props,"/props",t)):(!o||So(o))&&n.push({path:"/props",message:\'Missing required field "props"\',code:"required_property"}),e.children?Array.isArray(e.children)||n.push({path:"/children",message:\'Field "children" must be an array\',code:"invalid_type"}):n.push({path:"/children",message:\'Missing required field "children"\',code:"required_property"}),vu(e,"",t,n),n}function vu(e,t,n,o){if(!e||typeof e!="object")return;let i=(c,l)=>{if(!c||typeof c!="object"||Array.isArray(c)){o.push({path:l,message:"Component must be an object",code:"invalid_type"});return}if(typeof c.name!="string"||c.name.length===0){o.push({path:`${l}/name`,message:\'Component missing required field "name"\',code:"required_property"});return}let p=n.knownCustomNames?.has(c.name)??!1;if(Yy(c,l,p?gE:Nu,`component "${c.name}"`,o),p){"props"in c||o.push({path:`${l}/props`,message:`Component "${c.name}" is missing required field "props"`,code:"required_property",suggestion:`Add a "props" object holding the content "${c.name}" renders.`}),vu(c,l,n,o);return}let u=ui(c.name),f=`${l}/props`;if("props"in c)o.push(...Eu(c.name,c.props,f,n));else if(u&&So(u)){let x=u.propsSchema.required??[];o.push({path:f,message:`Component "${c.name}" is missing required field "props"`,code:"required_property",suggestion:x.length>0?`Add "props" carrying ${x.map(S=>`"${S}"`).join(", ")}.`:`Add a "props" object holding the content "${c.name}" renders.`})}else o.push(...Eu(c.name,{},f,n));if(u&&!u.hasChildren&&c.children!=null){o.push({path:`${l}/children`,message:`Component "${c.name}" does not accept children`,code:"invalid_value"});return}vu(c,l,n,o)},a=ui(e.name),s=(c,l)=>{if(a?.allowedChildren&&c&&typeof c=="object"&&typeof c.name=="string"&&ui(c.name)&&!a.allowedChildren.includes(c.name)){let p=a.allowedChildren.map(m=>`"${m}"`).join(", ");o.push({path:`${l}/name`,message:`Component "${c.name}" is not allowed inside "${e.name}". Expected ${p}`,code:"invalid_value"})}};Array.isArray(e.children)?e.children.forEach((c,l)=>{let p=`${t}/children/${l}`;s(c,p),i(c,p)}):e.children!=null&&t!==""&&o.push({path:`${t}/children`,message:\'Field "children" must be an array\',code:"invalid_type"})}function Eu(e,t,n,o={}){let i=[],a=hE[e];if(!a)return i.push({path:n.replace(/\\/props$/,"/name"),message:`Unknown component "${e}"`,code:"unknown_component"}),i;let s=t;if(o.allowUnknownFields&&(s=$.Clean(a,$.Clone(s))),!$.Check(a,s)){let c=[...$.Errors(a,s)];et(c,{maxErrors:100}).forEach(p=>{let m=p.path==="root"?n:`${n}${p.path.startsWith("/")?p.path:"/"+p.path}`;i.push({...p,path:m})})}return i}function Zy(e,t=[],n={}){let o=Xy(e,n),i=t.filter(a=>!bE(a));return OE([...i,...o])}function bE(e){if(!(!e.path||e.path==="root"||e.path==="/"))return!1;let n=e.message||"";return/invalid component configurations?/i.test(n)||/invalid document structure/i.test(n)}function OE(e){let t=new Set,n=[];for(let o of e){let i=`${o.path}:${o.message}`;t.has(i)||(t.add(i),n.push(o))}return n}function Qy(e){if(typeof e!="string")return{parsed:e};try{return{parsed:JSON.parse(e)}}catch(t){return{error:{path:"root",message:`Invalid JSON: ${t?.message??String(t)}`,code:"json_parse_error"}}}}function ts(e,t={}){let n=Zy(e,[],t);n.push(...Wy(e)),n.push(...Hy(e)),n.push(...Cu(e)),n.push(...Ho(e,Xr(e),"pptx",[...t.knownCustomNames??[]]));let o=n.length===0;return{valid:o,errors:n,documentType:"pptx",data:o?e:void 0}}function ku(e,t={}){let{parsed:n,error:o}=Qy(e);return o?{valid:!1,errors:[o],documentType:"pptx"}:ts(n,t)}function rs(e){if($.Check(wo,e))return{valid:!0,errors:[],data:e};let t=[...$.Errors(wo,e)];return{valid:!1,errors:et(t,{maxErrors:100})}}function Ru(e){let{parsed:t,error:n}=Qy(e);return n?{valid:!1,errors:[n]}:rs(t)}var xE={document:e=>ts(e),jsonDocument:e=>ku(e),theme:e=>rs(e),jsonTheme:e=>Ru(e),isDocument:e=>ts(e).valid,isTheme:e=>rs(e).valid},SE={document:e=>ts(e),jsonDocument:e=>ku(e),theme:e=>rs(e),jsonTheme:e=>Ru(e)},IE="1.0.0";function eb(e,t){let n={exports:{}},o=a=>{if(Object.prototype.hasOwnProperty.call(t,a))return t[a];throw new Error(`Module "${a}" is not available in the playground sandbox. Available modules: ${Object.keys(t).join(", ")}`)};return new Function("require","module","exports",e)(o,n,n.exports),n.exports}function Fu(e){if(!e||typeof e!="object")return!1;let t=e;if(typeof t.name!="string"||t.name.length===0||!t.versions||typeof t.versions!="object")return!1;let n=Object.values(t.versions);return n.length>0&&n.some(o=>!!o&&typeof o=="object"&&!!o.propsSchema&&typeof o.propsSchema=="object"&&typeof o.render=="function")}function tb(e){if(Fu(e.default))return e.default;let t=Object.entries(e).filter(([n])=>n.endsWith("Component")||n.endsWith("component")||n.endsWith("Module")||n.endsWith("module"));for(let[,n]of t)if(Fu(n))return n;for(let n of Object.values(e))if(Fu(n))return n;return null}var wE=/^\\d+\\.\\d+\\.\\d+$/;function rb(e,t,n){let o=[];for(let[i,a]of Object.entries(e.versions)){if(!wE.test(i))throw new Error(`Component "${e.name}": invalid semver key "${i}". Expected format: major.minor.patch`);if(!a||typeof a!="object"||!a.propsSchema)throw new Error(`Component "${e.name}" version "${i}" requires a propsSchema`);if(typeof a.render!="function")throw new Error(`Component "${e.name}" version "${i}" requires a render function`);let s;try{s=JSON.parse(JSON.stringify(a.propsSchema))}catch(c){throw new Error(`Component "${e.name}" version "${i}": propsSchema is not serializable (${c instanceof Error?c.message:String(c)})`)}o.push({version:i,propsSchema:s,hasChildren:a.hasChildren===!0,...typeof a.description=="string"?{description:a.description}:{}})}if(o.length===0)throw new Error(`Component "${e.name}" must have at least one version`);return{name:e.name,format:t,versions:o,latest:mt(o.map(i=>i.version)),examples:n}}function nb(e,t,n){return`import type { TSchema } from \'@sinclair/typebox\';\nimport type { ${t}, ${n} } from \'${e}\';\nimport type {\n RenderContext as SharedRenderContext,\n RenderFunction as SharedRenderFunction,\n ComponentVersion as SharedComponentVersion,\n ComponentVersionMap as SharedComponentVersionMap,\n CustomComponent as SharedCustomComponent,\n} from \'@json-to-office/shared/plugin\';\n\n/** The resolved theme handed to \\`render\\`. */\nexport type ThemeConfig = ${n};\n\nexport type RenderContext<T> = SharedRenderContext<T, ${n}>;\n\nexport type RenderFunction<\n TProps,\n TComponentDefinition = ${t},\n> = SharedRenderFunction<TProps, TComponentDefinition, ${n}>;\n\nexport type ComponentVersion<\n TComponentDefinition = ${t},\n TPropsSchema extends TSchema = TSchema,\n> = SharedComponentVersion<TComponentDefinition, TPropsSchema, ${n}>;\n\nexport type ComponentVersionMap<TComponentDefinition = ${t}> =\n SharedComponentVersionMap<TComponentDefinition, ${n}>;\n\nexport type CustomComponent<\n TComponentDefinition = ${t},\n TVersions extends\n ComponentVersionMap<TComponentDefinition> = ComponentVersionMap<TComponentDefinition>,\n TName extends string = string,\n> = SharedCustomComponent<TComponentDefinition, TVersions, TName>;\n\n/** Create one semver version entry with full type inference for its props. */\nexport declare function createVersion<\n TPropsSchema extends TSchema,\n TComponentDefinition = ${t},\n>(\n version: ComponentVersion<TComponentDefinition, TPropsSchema>\n): ComponentVersion<TComponentDefinition, TPropsSchema>;\n\n/** Create a custom component with semver-keyed versions. */\nexport declare function createComponent<\n TComponentDefinition = ${t},\n TVersions extends\n ComponentVersionMap<TComponentDefinition> = ComponentVersionMap<TComponentDefinition>,\n TName extends string = string,\n>(\n component: CustomComponent<TComponentDefinition, TVersions, TName>\n): CustomComponent<TComponentDefinition, TVersions, TName>;\n\nexport {\n resolveComponentVersion,\n ComponentValidationError,\n DuplicateComponentError,\n} from \'@json-to-office/shared/plugin\';\nexport type { ${t}, ${n} } from \'${e}\';\n`}var Uu=nb("@json-to-office/shared-docx","ComponentDefinition","ThemeConfigJson"),Du=nb("@json-to-office/shared-pptx","PptxComponentDefinition","ThemeConfigJson");function il(e,t){return JSON.stringify({name:e,version:"0.0.0-playground",types:"index.d.ts",exports:{".":{types:"./index.d.ts"},...t?{"./plugin":{types:"./plugin/index.d.ts"}}:{}}},null,2)}var BH={"node_modules/@json-to-office/core-docx/package.json":il("@json-to-office/core-docx",!0),"node_modules/@json-to-office/core-docx/index.d.ts":Uu,"node_modules/@json-to-office/core-docx/plugin/index.d.ts":Uu,"node_modules/@json-to-office/json-to-docx/package.json":il("@json-to-office/json-to-docx",!1),"node_modules/@json-to-office/json-to-docx/index.d.ts":Uu,"node_modules/@json-to-office/core-pptx/package.json":il("@json-to-office/core-pptx",!0),"node_modules/@json-to-office/core-pptx/index.d.ts":Du,"node_modules/@json-to-office/core-pptx/plugin/index.d.ts":Du,"node_modules/@json-to-office/json-to-pptx/package.json":il("@json-to-office/json-to-pptx",!1),"node_modules/@json-to-office/json-to-pptx/index.d.ts":Du},ob=["@json-to-office/core-docx","@json-to-office/core-docx/plugin","@json-to-office/json-to-docx","@json-to-office/core-pptx","@json-to-office/core-pptx/plugin","@json-to-office/json-to-pptx"];var Mu="[plugin-network-off]";var Bu=globalThis,_u=Bu.postMessage.bind(Bu),CE={createComponent:Bo,createVersion:Mo,resolveComponentVersion:ho,ComponentValidationError:go,DuplicateComponentError:_o},PE={"@sinclair/typebox":np,"@sinclair/typebox/value":bp,"@json-to-office/shared":tm,"@json-to-office/shared/plugin":rm,"@json-to-office/shared-docx":fu,"@json-to-office/shared-pptx":ju,...Object.fromEntries(ob.map(e=>[e,CE]))},$E=["importScripts","Worker","SharedWorker","indexedDB","caches","BroadcastChannel","FileSystemHandle","FileSystemFileHandle","FileSystemDirectoryHandle","showOpenFilePicker","showSaveFilePicker","showDirectoryPicker","close"],TE=["fetch","XMLHttpRequest","WebSocket","EventSource","WebTransport"];function ib(e,t){let n=globalThis;for(;n&&n!==Object.prototype;){if(Object.prototype.hasOwnProperty.call(n,e))try{delete n[e]}catch{}n=Object.getPrototypeOf(n)}try{Object.defineProperty(globalThis,e,{value:t,configurable:!1,writable:!1})}catch{}}function ab(e){let t=`${Mu} ${e} is not available: Network is off for this plugin. Turn on Network in the plugin header and list the hosts it may call.`;return new Proxy(function(){},{apply(){throw new Error(t)},construct(){throw new Error(t)},get(n,o){if(o==="name")return e;throw new Error(t)}})}function AE(e){let t=globalThis.fetch;if(typeof t!="function")return;let n=e.length>0?`This plugin may call: ${e.join(", ")}.`:"This plugin has Network on but no hosts listed, so it may call nothing.",o=async(...i)=>{try{return await t.apply(globalThis,i)}catch(a){let s=String(i[0]instanceof Request?i[0].url:i[0]);throw new Error(`${Mu} fetch("${s}") was refused. ${n} Add the host under Network in the plugin header to allow it.`,{cause:a})}};try{Object.defineProperty(globalThis,"fetch",{value:o,configurable:!1,writable:!1})}catch{}}var sb=!1;function LE(e,t){if(sb)return;sb=!0;for(let o of $E)ib(o);let n=globalThis.navigator;if(n)for(let o of["storage","locks","serviceWorker"])try{Object.defineProperty(n,o,{value:void 0})}catch{}if(!e){for(let o of TE)ib(o,ab(o));if(n)try{Object.defineProperty(n,"sendBeacon",{value:ab("navigator.sendBeacon")})}catch{}return}AE(t)}var cb=5*1024*1024,ns=null;function vE(e,t){let n=t instanceof Error?t.message:String(t),o={id:e,type:"error",message:n,...t instanceof Error&&t.stack?{stack:t.stack}:{}};_u(o)}async function EE(e){if(e.type==="load"){LE(e.allowNetwork,e.networkOrigins??[]);let t=eb(e.js,PE),n=tb(t);if(!n)throw new Error(\'No component export found. Export the result of createComponent() as the default export or under a name ending in "Component".\');ns=n;let o=rb(n,e.format,e.examples),i={id:e.id,type:"loaded",metadata:o};_u(i);return}if(e.type==="render"){if(!ns)throw new Error("Plugin is not loaded");let t=ho(ns.name,ns.versions,e.version),n=Ln(t.propsSchema,e.props,{componentName:ns.name});if(!n.valid)throw new go(n.errors??[],e.props);let o=[],i=(m,u)=>{o.push({message:m,...u?{context:u}:{}})},a=await t.render({props:n.data,theme:e.theme,addWarning:i,children:e.children}),s=Array.isArray(a)?a:[a],c=JSON.stringify(s);if(c.length>cb)throw new Error(`render() returned ${Math.round(c.length/1024/1024)} MB of components; the limit is ${cb/1024/1024} MB.`);let l=JSON.parse(c),p={id:e.id,type:"rendered",components:l,warnings:o};_u(p);return}}Bu.addEventListener("message",e=>{let t=e.data;!t||typeof t!="object"||typeof t.id!="number"||EE(t).catch(n=>vE(t.id,n))});})();\n';export{e as default};
2
- //# sourceMappingURL=_virtual_jto-sandbox-runtime-Bzo2M5U7.js.map