@reformer/builder 3.0.0-beta.6 → 3.0.0-beta.8

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 (200) hide show
  1. package/README.md +32 -198
  2. package/bin/reformer-builder.d.mts +7 -9
  3. package/bin/reformer-builder.mjs +43 -54
  4. package/dist/assets/css/index-CHjtwIsF.css +1 -0
  5. package/dist/assets/css/monaco-runtime-Ch4loDnq.css +1 -0
  6. package/dist/assets/i18n/en-uNov8AYL.js +1 -0
  7. package/dist/assets/i18n/ru-BNkTKaU6.js +1 -0
  8. package/dist/assets/js/index-C4LjLCAZ.js +57 -0
  9. package/dist/assets/monaco/html-DT-eqvPn.js +1 -0
  10. package/dist/assets/monaco/javascript-CIJHG94Q.js +1 -0
  11. package/dist/assets/monaco/jsonMode-rEmNPnut.js +12 -0
  12. package/dist/assets/monaco/monaco-runtime-Dqtu7Dpv.js +924 -0
  13. package/dist/assets/monaco/typescript-Bp6doald.js +1 -0
  14. package/dist/assets/monaco/xml-D8D5UF1F.js +1 -0
  15. package/dist/assets/monaco/yaml-DsiyZy1w.js +1 -0
  16. package/dist/assets/plugins/ai-CFoGZBd-.js +178 -0
  17. package/dist/assets/{byok-D0ncJaTq.js → plugins/ai-byok-a7JlkizL.js} +55 -55
  18. package/dist/assets/plugins/ai-knowledge-docs-BcbN7Ar1.js +1 -0
  19. package/dist/assets/plugins/ai-knowledge-index-CncxmxEf.js +1 -0
  20. package/dist/assets/plugins/codegen-DPh2ynzq.js +520 -0
  21. package/dist/assets/{MarkdownPreview-DXY3eJ1Z.js → plugins/editor-markdown-MarkdownPreview-CjVpNIV5.js} +20 -20
  22. package/dist/assets/plugins/editor-markdown-McTrLzET.js +2 -0
  23. package/dist/assets/plugins/editor-monaco-7BM478IS.js +14 -0
  24. package/dist/assets/plugins/editor-schema-DOoRcy16.js +4 -0
  25. package/dist/assets/plugins/files-WhQya3nC.js +2 -0
  26. package/dist/assets/plugins/plain-4ISpXJVh.js +78 -0
  27. package/dist/assets/plugins/plugin-manager-Ek0Ph0Jj.js +1 -0
  28. package/dist/assets/plugins/preview-BSh_puVw.js +1 -0
  29. package/dist/assets/plugins/preview-runtime-B8NzDg53.js +3 -0
  30. package/dist/assets/plugins/templates-BE9B0S3J.js +2 -0
  31. package/dist/assets/vendor/ajv-N5zGp_lm.js +8 -0
  32. package/dist/assets/vendor/calendar-base-BW48REpD-BYc4qqRC.js +1 -0
  33. package/dist/assets/vendor/carousel-BDyy29mt.js +1 -0
  34. package/dist/assets/vendor/chart-Cbp9J5YJ.js +52 -0
  35. package/dist/assets/vendor/collapsible-base-DZxAKbAF-DtQ4867U.js +1 -0
  36. package/dist/assets/vendor/drawer-BdLrIIeu.js +3 -0
  37. package/dist/assets/vendor/highlight.js/common-B96EybDa.js +5 -0
  38. package/dist/assets/vendor/index-BTAoX623.js +6 -0
  39. package/dist/assets/vendor/index-D8ACoUqy.js +51 -0
  40. package/dist/assets/vendor/input-otp-BoPlZ6dt.js +20 -0
  41. package/dist/assets/vendor/lucide-react/arrow-left-BlVPt6Ag.js +1 -0
  42. package/dist/assets/vendor/lucide-react/arrow-right-I5ntlq0-.js +1 -0
  43. package/dist/assets/vendor/lucide-react/calendar-L-57WZlQ.js +1 -0
  44. package/dist/assets/vendor/lucide-react/eye-DVTIIHcH.js +1 -0
  45. package/dist/assets/vendor/lucide-react/file-code-corner-DUfMS_yi.js +1 -0
  46. package/dist/assets/vendor/lucide-react/folder-tree-COyCkaDl.js +1 -0
  47. package/dist/assets/vendor/lucide-react/minus-zJRYKuAo.js +1 -0
  48. package/dist/assets/vendor/lucide-react/plus-B0WG2JcM.js +1 -0
  49. package/dist/assets/vendor/lucide-react/rotate-ccw-BSYk0mux.js +1 -0
  50. package/dist/assets/vendor/lucide-react/wrench-mybFdWHD.js +1 -0
  51. package/dist/assets/vendor/message-base-B5jT1FuY-BvDKjuSs.js +1 -0
  52. package/dist/assets/vendor/message-scroller-B2tlOtxT.js +1 -0
  53. package/dist/assets/vendor/reformer-builder-stack-reformer/node-token-VfZdCqcs.js +1 -0
  54. package/dist/assets/vendor/reformer-builder-stack-reformer/paths-DeGLVPUt.js +1 -0
  55. package/dist/assets/vendor/reformer-builder-stack-reformer/rules-CQSVDlmo.js +1 -0
  56. package/dist/assets/vendor/reformer-builder-stack-reformer/selectors-CjNSFsK9.js +1 -0
  57. package/dist/assets/vendor/reformer-builder-toolkit/marker-DiOaKX-e.js +4 -0
  58. package/dist/assets/vendor/reformer-builder-toolkit/naming-9aaM0Wbc.js +1 -0
  59. package/dist/assets/vendor/reformer-cdk/define-steps-CyGUrx9p-vcI1WbRz.js +1 -0
  60. package/dist/assets/vendor/reformer-cdk/file-upload-D8FOieMN.js +1 -0
  61. package/dist/assets/vendor/reformer-cdk/form-array-DlFEb40E.js +1 -0
  62. package/dist/assets/vendor/reformer-cdk/form-wizard-DDLs_-Ya.js +1 -0
  63. package/dist/assets/vendor/reformer-cdk/index-CeCSv2Go.js +1 -0
  64. package/dist/assets/vendor/reformer-cdk/list-DkqJWU70.js +1 -0
  65. package/dist/assets/vendor/reformer-form-registry/index-DflpiFcm.js +1 -0
  66. package/dist/assets/vendor/reformer-form-registry/loader-BK2c_fCA-BtIEWzon.js +2 -0
  67. package/dist/assets/vendor/reformer-form-registry/react-BiEQRau3.js +1 -0
  68. package/dist/assets/vendor/reformer-form-registry/storage-BbhnRE7V.js +1 -0
  69. package/dist/assets/vendor/reformer-form-registry/types-DoMH_n1U-BSN9tyeo.js +1 -0
  70. package/dist/assets/vendor/reformer-renderer-json/validate-DXzHWMfT.js +8 -0
  71. package/dist/assets/vendor/reformer-ui-kit/alert-base-WOl_V-qI-2ZIfaT1o.js +1 -0
  72. package/dist/assets/vendor/reformer-ui-kit/calendar-Bm2DDJDU.js +1 -0
  73. package/dist/assets/vendor/reformer-ui-kit/calendar-base.props-CqesU7CZ-tpDaVQbq.js +1 -0
  74. package/dist/assets/vendor/reformer-ui-kit/combobox-Dm4bFCVg.js +1 -0
  75. package/dist/assets/vendor/reformer-ui-kit/combobox-tree.props-BEQhnapq-DQmsBcYk.js +1 -0
  76. package/dist/assets/vendor/reformer-ui-kit/component-catalog-BEv0Zf-R.js +1 -0
  77. package/dist/assets/vendor/reformer-ui-kit/date-picker-CkVXt6Uh.js +1 -0
  78. package/dist/assets/vendor/reformer-ui-kit/date-picker-base.props-WBloFrDq-QhVYMCMG.js +1 -0
  79. package/dist/assets/vendor/reformer-ui-kit/input-otp-base.props-D1xRJiuO-DBKxHsz1.js +1 -0
  80. package/dist/assets/vendor/reformer-ui-kit/meta-YyKXxsBK.js +1 -0
  81. package/dist/assets/vendor/reformer-ui-kit/sidebar-CMzt3bAb.js +1 -0
  82. package/dist/assets/vendor/reformer-ui-kit/skeleton-base-C-lIzi0D-BjmjAmE9.js +1 -0
  83. package/dist/assets/vendor/reformer-ui-kit/toggle-group-multi.props-7kNpujN6-jLENMOcN.js +1 -0
  84. package/dist/assets/vendor/reformer-ui-kit/tree-node-schema-xHyN0QCr-CLbM_Aw_.js +1 -0
  85. package/dist/assets/vendor/render-DutGx1TC.js +46 -0
  86. package/dist/assets/vendor/sheet-base-Bdh947IC-CH2UsjIt.js +1 -0
  87. package/dist/assets/{typescript-BuFxP6n6.js → vendor/typescript/typescript-BejA4q8A.js} +1 -1
  88. package/dist/index.html +4 -4
  89. package/package.json +19 -18
  90. package/runtime-config.schema.json +32 -53
  91. package/dist/assets/App-DRJnHAjE.js +0 -1137
  92. package/dist/assets/BootError-CiPUX-Tr.js +0 -1
  93. package/dist/assets/ChatPanel-CnU7eT8N.js +0 -82
  94. package/dist/assets/CodeEditor-Wv0NRzV8.js +0 -1
  95. package/dist/assets/RawJsonEditor-c354H_pY.js +0 -1
  96. package/dist/assets/abap-DLDM7-KI.js +0 -1
  97. package/dist/assets/apex-DNDY2TF8.js +0 -1
  98. package/dist/assets/azcli-Y6nb8tq_.js +0 -1
  99. package/dist/assets/bat-BwHxbl9M.js +0 -1
  100. package/dist/assets/bicep-CFznDFnq.js +0 -2
  101. package/dist/assets/boot-5_JU0zay.js +0 -2
  102. package/dist/assets/cameligo-Bf6VGUru.js +0 -1
  103. package/dist/assets/clojure-Dnu-v4kV.js +0 -1
  104. package/dist/assets/coffee-Bd8akH9Z.js +0 -1
  105. package/dist/assets/cpp-BbWJElDN.js +0 -1
  106. package/dist/assets/csharp-Co3qMtFm.js +0 -1
  107. package/dist/assets/csp-D-4FJmMZ.js +0 -1
  108. package/dist/assets/cypher-cTPe9QuQ.js +0 -1
  109. package/dist/assets/dart-BOtBlQCF.js +0 -1
  110. package/dist/assets/dockerfile-BG73LgW2.js +0 -1
  111. package/dist/assets/ecl-BEgZUVRK.js +0 -1
  112. package/dist/assets/editor-BzOv8av-.css +0 -1
  113. package/dist/assets/editor.api-CMCnIB-P.js +0 -865
  114. package/dist/assets/elixir-BkW5O-1t.js +0 -1
  115. package/dist/assets/flow9-BeJ5waoc.js +0 -1
  116. package/dist/assets/freemarker2-C645vQBx.js +0 -3
  117. package/dist/assets/fsharp-PahG7c26.js +0 -1
  118. package/dist/assets/go-acbASCJo.js +0 -1
  119. package/dist/assets/graphql-BxJiqAUM.js +0 -1
  120. package/dist/assets/handlebars-B5DnoJkq.js +0 -1
  121. package/dist/assets/hcl-DtV1sZF8.js +0 -1
  122. package/dist/assets/html-TNLrm0oH.js +0 -1
  123. package/dist/assets/index--0tYkbnz.js +0 -3
  124. package/dist/assets/index-BKc-soqk.css +0 -1
  125. package/dist/assets/index-BLGbxQaR.js +0 -104
  126. package/dist/assets/index-Bb-H-IRh.js +0 -1
  127. package/dist/assets/index-BivFj4xA.js +0 -10
  128. package/dist/assets/index-C_YSTVSM.js +0 -68
  129. package/dist/assets/index-Crsub4wy.js +0 -5028
  130. package/dist/assets/index-D2vdVqoN.js +0 -11
  131. package/dist/assets/index-DBBur3Kg.js +0 -4709
  132. package/dist/assets/index-DzAasWzr.css +0 -1
  133. package/dist/assets/ini-Kd9XrMLS.js +0 -1
  134. package/dist/assets/java-CXBNlu9o.js +0 -1
  135. package/dist/assets/javascript-YmJoSFNK.js +0 -1
  136. package/dist/assets/jsonMode-BgHFRVOe.css +0 -1
  137. package/dist/assets/jsonMode-CUyarZ9Q.js +0 -70
  138. package/dist/assets/julia-cl7-CwDS.js +0 -1
  139. package/dist/assets/kotlin-s7OhZKlX.js +0 -1
  140. package/dist/assets/less-9HpZscsL.js +0 -2
  141. package/dist/assets/lexon-OrD6JF1K.js +0 -1
  142. package/dist/assets/liquid-CsrVJLkL.js +0 -1
  143. package/dist/assets/load-DahhU28W.js +0 -11
  144. package/dist/assets/lua-Cyyb5UIc.js +0 -1
  145. package/dist/assets/m3-B8OfTtLu.js +0 -1
  146. package/dist/assets/mdx-DDXJg3VI.js +0 -1
  147. package/dist/assets/mips-CiqrrVzr.js +0 -1
  148. package/dist/assets/monaco-languages-CfiXabIS.js +0 -2
  149. package/dist/assets/monaco-setup-DPehMZ7o.js +0 -12
  150. package/dist/assets/msdax-DmeGPVcC.js +0 -1
  151. package/dist/assets/mysql-C_tMU-Nz.js +0 -1
  152. package/dist/assets/objective-c-BDtDVThU.js +0 -1
  153. package/dist/assets/pascal-vHIfCaH5.js +0 -1
  154. package/dist/assets/pascaligo-DtZ0uQbO.js +0 -1
  155. package/dist/assets/perl-Ub6l9XKa.js +0 -1
  156. package/dist/assets/pgsql-BlNEE0v7.js +0 -1
  157. package/dist/assets/php-BBUBE1dy.js +0 -1
  158. package/dist/assets/pla-DSh2-awV.js +0 -1
  159. package/dist/assets/postiats-CocnycG-.js +0 -1
  160. package/dist/assets/powerquery-tScXyioY.js +0 -1
  161. package/dist/assets/powershell-COWaemsV.js +0 -1
  162. package/dist/assets/protobuf-Brw8urJB.js +0 -2
  163. package/dist/assets/pug-8SOpv6rk.js +0 -1
  164. package/dist/assets/python-DpnOD9VM.js +0 -1
  165. package/dist/assets/qsharp-Bw9ernYp.js +0 -1
  166. package/dist/assets/r-j7ic8hl3.js +0 -1
  167. package/dist/assets/razor-BsF1GcFZ.js +0 -1
  168. package/dist/assets/redis-Bu5POkcn.js +0 -1
  169. package/dist/assets/redshift-Bs9aos_-.js +0 -1
  170. package/dist/assets/reformer-ui-kit-11-Bml4F8Os.js +0 -1
  171. package/dist/assets/reformer-ui-kit-BWUaVvO0.js +0 -1
  172. package/dist/assets/restructuredtext-CqXO7rUv.js +0 -1
  173. package/dist/assets/ruby-zBfavPgS.js +0 -1
  174. package/dist/assets/rust-BzKRNQWT.js +0 -1
  175. package/dist/assets/sb-BBc9UKZt.js +0 -1
  176. package/dist/assets/scala-D9hQfWCl.js +0 -1
  177. package/dist/assets/scheme-BPhDTwHR.js +0 -1
  178. package/dist/assets/scss-CBJaRo0y.js +0 -3
  179. package/dist/assets/shell-DiJ1NA_G.js +0 -1
  180. package/dist/assets/solidity-Db0IVjzk.js +0 -1
  181. package/dist/assets/sophia-CnS9iZB_.js +0 -1
  182. package/dist/assets/sparql-CJmd_6j2.js +0 -1
  183. package/dist/assets/sql-ClhHkBeG.js +0 -1
  184. package/dist/assets/st-CHwy0fLd.js +0 -1
  185. package/dist/assets/swift-CnmFD0ga.js +0 -1
  186. package/dist/assets/systemverilog-Bs9z6M-B.js +0 -1
  187. package/dist/assets/tcl-Dm6ycUr_.js +0 -1
  188. package/dist/assets/twig-Csy3S7wG.js +0 -1
  189. package/dist/assets/typescript-D7ER-DvA.js +0 -1
  190. package/dist/assets/typespec-Btyra-wh.js +0 -1
  191. package/dist/assets/useFormField-BLbvmpme-CM4hze15.js +0 -1
  192. package/dist/assets/vb-Db0cS2oM.js +0 -1
  193. package/dist/assets/wgsl-BTesnYfV.js +0 -298
  194. package/dist/assets/xml-5MzZ4-DY.js +0 -1
  195. package/dist/assets/yaml-Ch0E2rII.js +0 -1
  196. /package/dist/assets/{codicon-Brq4_Ui5.ttf → fonts/codicon-Brq4_Ui5.ttf} +0 -0
  197. /package/dist/assets/{css-DdJfP1eB.js → monaco/css-DdJfP1eB.js} +0 -0
  198. /package/dist/assets/{editor.worker-CRaYpIdo.js → monaco/editor.worker-CRaYpIdo.js} +0 -0
  199. /package/dist/assets/{json.worker-C5PEkLU0.js → monaco/json.worker-C5PEkLU0.js} +0 -0
  200. /package/dist/assets/{markdown-BFxVWTOG.js → monaco/markdown-BFxVWTOG.js} +0 -0
@@ -0,0 +1,3 @@
1
+ import{cX as Re,b7 as Pe,b8 as Te,b9 as Fe,b6 as $,d4 as Me,ct as $e,Z as c,Y as d,d5 as De,d6 as Ie,b4 as ue,d7 as _e,a3 as Le,a0 as Ve,ad as Be,cv as ze,bR as G,d8 as de,a2 as fe,d9 as me,da as pe,db as Ue,cg as Ge,dc as Ke,cr as Ye,c5 as He,cC as Je,cb as We,cp as Xe,dd as qe,de as Qe,aL as he,aw as D,aS as I,aK as O,bz as Ze,cV as et,co as tt,df as rt,cm as nt}from"../js/index-C4LjLCAZ.js";import{t as ot,d as st,e as it,E as at,N as ct}from"../vendor/reformer-builder-stack-reformer/node-token-VfZdCqcs.js";import{c as lt,m as ut,s as dt,a as ft,i as mt}from"../vendor/reformer-builder-stack-reformer/paths-DeGLVPUt.js";function ge(e,t){const r=Re.createRoot(e);return r.render(t),{dispose(){r.unmount()}}}function ve(e,t){for(let r=e;r!==null;r=r.parentElement){const n=typeof r.className=="string"?r.className:"",o=ot(n);if(o!==null){const s=st(o);if(s!==null)return s}if(r===t)break}return null}const pt="space-y-3 mt-2";function _(e,t,r={}){const n=Me(t),o=typeof e?.className=="string"?e.className:"",s=r.arrayDefault===!0&&o===""?pt:"",i=n===void 0?"":it(n),a=[o,s,i,r.empty===!0?at:""].filter(l=>l!=="").join(" ");return a===""?e:{...e,className:a}}function E(e){if(Pe(e)){const t=e;return{...t,componentProps:_(t.componentProps,e,{arrayDefault:t.component===void 0}),item:{$template:E(t.item.$template)}}}if(Te(e)){const t=e,r={...t,componentProps:_(t.componentProps,e)};return t.wrapper&&(r.wrapper=E(t.wrapper)),r}if(Fe(e)){const t=e,r=t.componentProps?.steps,n=Array.isArray(r)&&r.some($),o=(Array.isArray(t.children)?t.children.length:0)+(n?1:0),s={...t,componentProps:_(t.componentProps,e,{empty:o===0})};return n&&(s.componentProps={...s.componentProps,steps:r.map(i=>$(i)?E(i):i)}),Array.isArray(t.children)&&(s.children=t.children.map(i=>$(i)?E(i):i)),s}return e}function ht(e){return{...e,root:E(e.root)}}function gt(e,t){return`запрос ${e} ${t} не описан в фикстуре: правило не нашлось, а ходить в сеть из превью нельзя — добавьте его в fixture.http`}function vt(e,t,r){return e.method!==void 0&&e.method.toUpperCase()!==t.toUpperCase()?!1:typeof e.url=="string"?r.includes(e.url):e.url.test(r)}function bt(e,t){const r=t?.method??e?.method??"GET",n=typeof e=="string"?e:e?.url??String(e);return{method:r,url:n}}function yt(e,t=xt){return(async(r,n)=>{const{method:o,url:s}=bt(r,n),i=e.find(v=>vt(v,o,s));if(i===void 0)throw new Error(gt(o,s));const{status:a=200,json:l,text:u,headers:m,delayMs:f}=i.respond;f!==void 0&&f>0&&await t(f);const p=l!==void 0?JSON.stringify(l):u??"";return new Response(p,{status:a,headers:{...l!==void 0?{"content-type":"application/json"}:{},...m}})})}const xt=e=>new Promise(t=>setTimeout(t,e));function Nt(e){return typeof e=="number"?e:typeof e=="string"?Date.parse(e):Number.NaN}function jt(e){return new Proxy(Date,{construct:(t,r)=>r.length===0?new t(e):Reflect.construct(t,r),get:(t,r,n)=>r==="now"?()=>e:Reflect.get(t,r,n)})}function Et(e){const t=typeof e=="number"?[e]:e;let r=0;const n=Object.create(Math);return n.random=()=>{if(t.length===0)return 0;const o=t[r%t.length];return r+=1,o},n}function St(e){if(e===null)return q;const t={};e.http!==void 0&&(t.fetch=yt(e.http));const r=e.clock;if(r!==void 0){const n=Nt(r.now);Number.isNaN(n)||(t.Date=jt(n)),r.random!==void 0&&(t.Math=Et(r.random))}return Object.keys(t).length===0?q:t}const q=Object.freeze({});function Q(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function U(e,t){const r={...e};for(const[n,o]of Object.entries(t)){const s=r[n];r[n]=Q(s)&&Q(o)?U(s,o):o}return r}function kt(e,t,r){let n=e.model;t!==void 0&&(n=U(n,t)),r?.model!==void 0&&(n=U(n,r.model));const o={...e.dataSources};return r?.dataSources!==void 0&&Object.assign(o,r.dataSources),{model:n,dataSources:o}}const Z="fixture";function ee(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function be(e,t){if(t===void 0)return e;const r={};for(const[n,o]of Object.entries(e)){if(!Object.hasOwn(t,n)){r[n]=o;continue}const s=t[n];ee(o)&&ee(s)?r[n]=be(o,s):Array.isArray(o)&&Array.isArray(s)||wt(o,s)?r[n]=s:r[n]=o}return r}function wt(e,t){return e===null||t===null?e===t:Array.isArray(e)!==Array.isArray(t)?!1:typeof e==typeof t}function Ct(e){return typeof e=="function"?!0:typeof e=="object"&&e!==null&&"$$typeof"in e}function Ot(e){return e.role!=="array"&&!e.name.startsWith("$html(")}function At(e,t){const r=t[$e(e)];return Ct(r)?r:void 0}function Rt(e,t){return t.unresolvedReason.get(e.name)??(e.compoundParent===void 0?void 0:t.unresolvedReason.get(e.compoundParent))??`не резолвится в ${t.package}`}function Pt(e,t,r){const n=r.previewPolicy.get(e.name)??(e.compoundParent===void 0?void 0:r.previewPolicy.get(e.compoundParent));if(n?.mode==="limited")return{policy:"limited",reason:n.reason??"предпросмотр ограничен"};const o=At(e,t);return o!==void 0?{policy:"live",component:o}:{policy:"limited",reason:Rt(e,r)}}function Tt(e,t){return{FormField:t[e.infra.fieldWrapper],AsyncBoundary:t[e.infra.asyncBoundary],List:t[e.infra.list]}}const Ft=["__selfManagedChildren","reformerNeedsControl","reformerLayout"];function Mt(e){function t({children:r,className:n}){return c.jsxs("div",{className:`rounded-md border border-dashed border-amber-400/60 bg-amber-50/40 p-3 text-xs dark:bg-amber-950/20 ${n??""}`,children:[c.jsx("span",{className:"font-mono text-amber-700 dark:text-amber-400",children:e}),c.jsx("span",{className:"text-muted-foreground ml-2",children:"— компонента нет в каталоге кита"}),r===void 0?null:c.jsx("div",{className:"mt-2",children:r})]})}return t.displayName=`Unknown(${e})`,t}function te(e,t){function r({children:n,className:o}){return c.jsxs("div",{className:`border-border bg-muted/30 text-muted-foreground rounded-md border border-dashed p-3 text-xs ${o??""}`,children:[c.jsx("span",{className:"text-foreground font-mono",children:e}),c.jsxs("span",{className:"ml-2",children:["— предпросмотр ограничен",t===void 0?"":` (${t})`]}),n===void 0?null:c.jsx("div",{className:"mt-2",children:n})]})}return r.displayName=`Limited(${e})`,r}class $t extends d.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}render(){const{error:t}=this.state;return t===null?this.props.children:c.jsxs("div",{className:`border-destructive/50 bg-destructive/5 text-destructive rounded-md border border-dashed p-3 text-xs ${this.props.className??""}`,children:[c.jsx("span",{className:"font-mono font-semibold",children:this.props.name}),c.jsx("span",{className:"ml-2 opacity-80",children:"— компонент упал при рендере"}),c.jsx("div",{className:"mt-1 font-mono text-[11px] opacity-70",children:t.message})]})}}function re(e,t){const r=e;function n(i){return c.jsx($t,{name:t,className:i.className,children:c.jsx(r,{...i})})}n.displayName=`Isolated(${t})`;const o=e,s=n;for(const i of Ft){const a=o[i];a!==void 0&&(s[i]=a)}return n}function Dt(e){const{catalog:t,descriptor:r,namespace:n}=e,o={},s=Tt(r,n);for(const i of Ie){const a=s[i];o[i]=re(a??te(i,`нет в ${r.package}`),i)}for(const i of t){if(!Ot(i))continue;const a=Pt(i,n,r);o[i.name]=re(a.policy==="live"?a.component:te(i.name,a.reason),i.name)}return o}function It(e,t){return ue(e).components.filter(r=>!t.has(r))}function _t(e,t,r,n={},o){const s=lt(t);for(const a of s.functionLike){const l=r[a];e.dataSource(a,typeof l=="function"?l:(u,m=0)=>`#${m+1}`)}for(const a of s.optionLike)e.dataSource(a,r[a]??ut(a));for(const a of s.scalarLike)e.dataSource(a,r[a]??"значение");const i=ue(t);for(const a of i.fns)e.fn(a,n[a]??(()=>""));i.locales.length>0&&e.locale(o??(a=>a))}function Lt(e){const t=Dt(e),r=new Set(Object.keys(t)),n=It(e.schema,r);return De(o=>{for(const[s,i]of Object.entries(t))o.component(s,i);o.component(_e,t.FormField);for(const s of n)o.component(s,Mt(s));_t(o,e.schema,e.dataSources,e.fns,e.locale)})}const A=e=>e instanceof Error?e.message:String(e);function ye(e){const t=[];let r;try{r=ht(e.schema)}catch(i){return{schema:null,form:null,registry:null,problems:[{file:"",phase:"schema",message:A(i)}]}}const n=kt(e.mock??dt(r),e.initialOverride,e.fixture??null),o=be(n.model,e.carry);let s;try{s=Lt({schema:r,catalog:e.catalog,descriptor:e.descriptor,namespace:e.namespace,dataSources:n.dataSources,fns:e.fixture?.fns,locale:e.fixture?.locale})}catch(i){return{schema:r,form:null,registry:null,problems:[{file:"",phase:"render",message:A(i)}]}}if(e.extraRegistry!==void 0)try{s=Le(s,e.extraRegistry)}catch(i){t.push({file:"registry.ts",phase:"evaluate",message:A(i)})}try{const i=Ve({schema:r,registry:s,initial:o,behavior:e.behavior,validation:e.validation,renderBehavior:e.renderBehavior});return{schema:r,form:i,registry:s,problems:t}}catch(i){return t.push({file:"",phase:"render",message:A(i)}),{schema:r,form:null,registry:s,problems:t}}}const Vt="outline: 2px solid var(--color-ring, #6366f1); outline-offset: 2px;";function xe({selection:e}){const t=e.filter(n=>Be.test(n));if(t.length===0)return null;const r=t.map(n=>`.${ct}${n} { ${Vt} }`).join(`
2
+ `);return c.jsx("style",{children:r})}function N({title:e,detail:t,tone:r="neutral"}){const n=r==="warning"?"border-amber-400/60":"border-border";return c.jsx("div",{className:"flex h-full items-center justify-center p-6",children:c.jsxs("div",{className:`max-w-sm rounded-md border border-dashed ${n} p-4 text-center`,children:[c.jsx("div",{className:"text-foreground text-[13px] font-medium",children:e}),t===void 0?null:c.jsx("div",{className:"text-muted-foreground mt-1 text-[12px]",children:t})]})})}function Ne(e){const t=d.useCallback(n=>{const o=e.onDidChangeSchema(n);return()=>{o.dispose()}},[e]),r=d.useCallback(()=>{const n=e.schema();return ze(n)?n:null},[e]);return d.useSyncExternalStore(t,r,r)}function je(e){const t=d.useCallback(n=>{const o=e.onDidChangeSelection(n);return()=>{o.dispose()}},[e]),r=d.useCallback(()=>e.selection(),[e]);return d.useSyncExternalStore(t,r,r)}function Ee(e){const[t,r]=d.useState(0);return d.useEffect(()=>{const n=e.onDidChangeKit(()=>{r(o=>o+1)});return()=>{n.dispose()}},[e]),t}function Bt(e){const[t,r]=d.useState(0);return d.useEffect(()=>{const n=e.onDidChangeFiles?.(()=>{r(o=>o+1)});return()=>{n?.dispose()}},[e]),t}const S="__preview-entry__.js";function zt(e){if(e.includes(S))throw new Error(`в каталоге формы уже есть «${S}»: имя синтетической точки входа занято`);return["var modules = {};","var errors = [];","function describe(error) {"," return error && error.message ? String(error.message) : String(error);","}","function rangeOf(error) {"," var findings = error && error.cause && error.cause.findings;"," if (!Array.isArray(findings)) return undefined;"," for (var i = 0; i < findings.length; i += 1) {"," var range = findings[i] && findings[i].range;"," if (range && typeof range.start === 'number' && typeof range.end === 'number') {"," return { start: range.start, end: range.end };"," }"," }"," return undefined;","}","function failure(file, error) {"," var out = { file: file, message: describe(error) };"," if (error && typeof error.file === 'string' && error.file !== '') out.file = error.file;"," if (error && (error.phase === 'resolve' || error.phase === 'transpile' || error.phase === 'evaluate')) {"," out.phase = error.phase;"," }"," var range = rangeOf(error);"," if (range !== undefined) out.range = range;"," return out;","}",...e.map(r=>{const n=JSON.stringify(`./${r}`),o=JSON.stringify(r);return`try { modules[${o}] = require(${n}); } catch (error) { errors.push(failure(${o}, error)); }`}),"module.exports = { modules: modules, errors: errors };",""].join(`
3
+ `)}function Ut(e){if(e===null||typeof e!="object")return null;const t=e;return typeof t.modules!="object"||t.modules===null||!Array.isArray(t.errors)?null:{modules:t.modules,errors:t.errors}}const Gt=Object.freeze({modules:new Map,problems:Object.freeze([])}),L=e=>e instanceof Error?e.message:String(e);async function Kt(e,t,r={}){const n=[...e.keys()];if(n.length===0)return Gt;let o;try{o=new Map(e),o.set(S,zt(n))}catch(u){return{modules:new Map,problems:[j("","resolve",L(u))]}}let s;try{s=await t.prepare?.(o)}catch(u){return{modules:new Map,problems:[j("","transpile",`движок транспиляции не готов: ${L(u)}`)]}}let i;try{i=await t.load(o,S,{ready:s?.ready,overrides:r.overrides,ambient:r.ambient})}catch(u){return{modules:new Map,problems:[j("","evaluate",L(u))]}}s!==void 0&&i.compiled!==void 0&&i.compiled.size>0&&s.commit(i.compiled).catch(u=>{console.warn("[preview] кэш сборки не записался",u)});const a=i.errors.map(Ht),l=Ut(i.entry);if(l===null)return a.length===0&&a.push(j(S,"evaluate","точка входа не отдала модулей")),{modules:new Map,problems:a};for(const u of l.errors){const m={...j(u.file,u.phase??"evaluate",K(u.file,u.message)),...u.range===void 0?{}:{range:u.range}};a.some(f=>Yt(f,m))||a.push(m)}return{modules:new Map(Object.entries(l.modules)),problems:a}}function Yt(e,t){return e.file===t.file&&e.phase===t.phase&&e.message===t.message}function j(e,t,r){return{file:e,phase:t,message:r}}function K(e,t){const r=`${e}: `;return e!==""&&t.startsWith(r)?t.slice(r.length):t}function Ht(e){return{file:e.file,phase:e.phase,message:K(e.file,e.message),...e.range===void 0?{}:{range:e.range}}}const V=Object.freeze({fixture:null,path:null,problems:[]}),ne=e=>e instanceof Error?e.message:String(e);function Jt(e){return typeof e=="object"&&e!==null?e:null}async function Wt(e,t,r,n){const o=e.resolveFromRoot;if(t===void 0||o===void 0)return V;const s=ft(n);if(s===null)return V;const i=o(r,s);let a;try{a=await e.readText(i)}catch{return V}let l;try{l=await t.prepare?.(new Map([[s,a]]))}catch(p){return{fixture:null,path:s,problems:[R(s,"transpile",ne(p),i)]}}let u;try{u=await t.load(new Map([[s,a]]),s,{ready:l?.ready})}catch(p){return{fixture:null,path:s,problems:[R(s,"evaluate",ne(p),i)]}}l!==void 0&&u.compiled!==void 0&&u.compiled.size>0&&l.commit(u.compiled).catch(()=>{});const m=u.errors.map(p=>({...R(p.file,p.phase,K(p.file,p.message),i),...p.range===void 0?{}:{range:p.range}})),f=u.entry?.[Z];return f===void 0?(m.length===0&&m.push(R(s,"evaluate",`фикстура не экспортирует «${Z}» — форма её не увидит`,i)),{fixture:null,path:s,problems:m}):{fixture:Jt(f),path:s,problems:m}}function R(e,t,r,n){return{file:e,phase:t,message:r,resource:n}}const Xt=["model.ts","model.tsx"],oe=["validation.ts"],qt=["form.behavior.ts","form-behavior.ts","behavior.ts"],B=["renderer.behavior.ts","render-behavior.ts","ui.ts"],Qt=["registry.ts","registry.tsx"];function y(e,t,r){for(const n of t){const o=e.get(n);if(o===null||typeof o!="object")continue;const s=o[r];if(s!==void 0)return s}}const z=e=>typeof e=="function",Y=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Zt=["schema","steps","extras","strategy"];function er(e){return Y(e)&&Zt.some(t=>t in e)}function tr(e,t){if(e!==void 0)return er(e)?e:Y(t)?{schema:e,...t}:e}function rr(e){const t={},r=y(e,Xt,"initialFormModel");Y(r)&&(t.initial=r);const n=tr(y(e,oe,"formValidation"),y(e,oe,"validationOptions"));n!==void 0&&(t.validation=n);const o=y(e,qt,"formBehavior");o!==void 0&&(t.behavior=o);const s=y(e,B,"formRenderBehavior"),i=y(e,B,"createRenderBehavior")??y(e,B,"createJsonRenderBehavior");if(z(i))t.renderBehavior=i;else if(z(s)){const l=s;t.renderBehavior=()=>l}const a=y(e,Qt,"createRegistry");return z(a)&&(t.createRegistry=a),t}function nr(e){const t=[];return e.initial!==void 0&&t.push("model"),e.validation!==void 0&&t.push("validation"),e.behavior!==void 0&&t.push("behavior"),e.renderBehavior!==void 0&&t.push("renderBehavior"),e.createRegistry!==void 0&&t.push("registry"),t}const or=/\.tsx?$/,sr=/\.d\.tsx?$/,ir=/\.(test|spec)\.tsx?$/,ar=new Set(["index.ts","index.tsx"]);function cr(e){return!or.test(e)||sr.test(e)||ir.test(e)||mt(e)?!1:!ar.has(e)}function lr(e){return e.filter(t=>t.kind==="file"&&cr(t.name))}const se=e=>e instanceof Error?e.message:String(e);async function ur(e,t){let r;try{r=await e.siblings(t)}catch(i){return{files:new Map,resources:new Map,problems:[{file:"",phase:"resolve",message:se(i)}]}}const n=new Map,o=new Map,s=[];return await Promise.all(lr(r).map(async i=>{o.set(i.name,i.id);try{n.set(i.name,await e.readText(i.id))}catch(a){s.push({file:i.name,phase:"resolve",message:se(a),resource:i.id})}})),{files:n,resources:o,problems:s}}function dr(e,t){return e.map(r=>{if(r.resource!==void 0||r.file==="")return r;const n=t.get(r.file);return n===void 0?r:{...r,resource:n}})}const Se="preview.compiling",fr=Object.freeze({});function mr(){return me({components:[]})}const ie=Object.freeze({contract:null,registry:void 0,fixture:null,applied:[],problems:[],pending:!0}),pr=Object.freeze({contract:{},registry:void 0,fixture:null,applied:[],problems:[],pending:!1});function hr({ctx:e,host:t}){const r=t.useTranslate(),n=Ne(e),o=je(e),s=Ee(t),i=Bt(t),a=d.useRef(null),[l,u]=d.useState(ie),m=d.useRef(null),f=t.modules,p=e.doc.id,v=t.documentOf(p)?.ref.path??"",H=e.mock(),k=d.useMemo(()=>({catalog:t.catalog(),descriptor:t.kit()??mr(),namespace:t.kitNamespace()??fr}),[t,s]);d.useEffect(()=>{if(f===void 0){u(pr);return}let h=!1;return u(g=>g.contract===null?ie:g),(async()=>{const g=await Wt(t,f,p,v),w={overrides:g.fixture?.modules===void 0?void 0:new Map(Object.entries(g.fixture.modules)),ambient:St(g.fixture)},x=await ur(t,p),J=await Kt(x.files,f,w);if(h)return;const C=rr(J.modules),W=[...g.problems,...x.problems,...J.problems];let X;if(C.createRegistry!==void 0)try{X=C.createRegistry()}catch(M){W.push({file:"registry.ts",phase:"evaluate",message:M instanceof Error?M.message:String(M)})}u({contract:C,registry:X,fixture:g.fixture,applied:nr(C),problems:dr(W,x.resources),pending:!1})})(),()=>{h=!0}},[t,p,v,f,i]);const b=d.useMemo(()=>{const h=l.contract;if(n===null||h===null)return null;const g=m.current?.model.get()??e.values();return ye({schema:n,catalog:k.catalog,descriptor:k.descriptor,namespace:k.namespace,mock:H,fixture:l.fixture,extraRegistry:l.registry,initialOverride:h.initial,behavior:h.behavior,validation:h.validation,renderBehavior:h.renderBehavior,carry:g})},[n,k,H,l,e]);d.useEffect(()=>(m.current=b?.form??null,e.publishForm?.(b?.form??null),()=>{e.publishForm?.(null)}),[b,e]),d.useEffect(()=>()=>{const h=m.current;h!==null&&e.keepValues(h.model.get())},[e]);const F=d.useMemo(()=>[...l.problems,...b?.problems??[]],[l.problems,b]);d.useEffect(()=>{e.report(Se,F)},[e,F]);const Ae=d.useCallback(h=>{const g=a.current;if(g===null)return;const w=h.target;if(w.closest('[data-slot="scroll-area-scrollbar"]')!==null)return;const x=ve(w,g);e.select(x===null?[]:[x])},[e]);return f===void 0?c.jsx(N,{tone:"warning",title:r("empty.no-loader"),detail:r("empty.no-loader.detail")}):n===null?c.jsx(N,{title:r("empty.no-schema"),detail:r("empty.no-schema.detail")}):l.pending?c.jsx(N,{title:r("empty.compiling")}):b===null||b.form===null?c.jsx(N,{tone:"warning",title:r("empty.build-failed"),detail:F[0]?.message}):c.jsx("div",{className:"flex h-full flex-col",children:c.jsx(G,{ref:a,className:"min-h-0 flex-1",onClick:Ae,children:c.jsxs("div",{className:"p-4",children:[c.jsx(xe,{selection:o}),c.jsx(de,{settings:{registry:b.form.registry},children:c.jsx(fe,{form:b.form})})]})})})}function gr(e,t){return{id:Se,title:()=>t("surface.compiling"),applies:pe,capabilities:{interactive:!0,hitTest:!0,dragSource:!1,executesCode:!0,sameRealm:!0},mount(r,n){return ge(r,d.createElement(hr,{ctx:n,host:e}))}}}const vr=Ue.id,br=Ge({id:"reformer.kit.catalog",version:"1.1.0"}),yr=Object.freeze([]),xr=Object.freeze([]),P=Object.freeze({dispose:()=>{}}),Nr=Object.freeze({activeResource:()=>null,onDidChange:()=>P});function jr(e){const t=()=>e.services.get(Xe),r=()=>e.services.get(He),n=()=>e.services.get(br),o=e.services.get(Ke);function s(){return We(e.i18n)}function i(){return Je(t()??Nr)}return{useTranslate:s,useActiveDocument:i,documentOf(a){const l=t()?.documentOf(a)??null;if(l===null)return null;const u=e.services.get(Ye)?.handleOf(a)??null;return{id:l.id,ref:l.ref,kind:l.kind,...u!==null?{providerId:u.document.providerId}:{},getText:()=>l.getText(),model:()=>u!==null&&u.document.getSyncState()==="synced"?u.document.getModel():void 0,onDidChangeContent:m=>l.onDidChangeContent(m)}},sourceOf:a=>{const l=r();return l===void 0?null:{executesCode:l.executesCode(a)}},catalog:()=>n()?.catalog()??yr,kit:()=>n()?.descriptor()??null,kitNamespace:()=>n()?.namespace?.()??null,onDidChangeKit(a){const l=n(),u=l?.onDidChange(a)??P,m=l?.onDidLoadNamespace?.(a)??P;return{dispose(){u.dispose(),m.dispose()}}},siblings:async a=>{const l=r();return l===void 0?xr:l.list(l.parentOf(a))},readText:async a=>{const l=await r()?.readText(a)??null;if(l===null)throw new Error(`не читается: ${a}`);return l},resolveFromRoot:(a,l)=>{const u=r();if(u===void 0)throw new Error(`рабочей области нет: ${l}`);return u.fromRoot(a,l)},onDidChangeFiles:a=>r()?.onDidChange(a)??P,...o!==void 0?{modules:o}:{}}}const Er={"empty.build-failed":"Could not build the form","empty.compiling":"Compiling sidecars…","empty.no-loader":"Execution unavailable","empty.no-loader.detail":"Composition gave the preview no module loader, so sidecars are not executed.","empty.no-schema":"Schema does not parse","empty.no-schema.detail":"The buffer holds what you typed; the preview will render once the text is a schema.","surface.compiling":"With code","surface.runtime":"Runtime","model.title":"Model","model.empty":"No form right now: values appear once it builds","model.raw":"Raw write","model.raw.hint":"no change event, no touched — like data from the backend","model.copy":"Copy model","model.reset":"reset","model.disable":"disable","model.enable":"enable"},Sr={"empty.build-failed":"Форму собрать не удалось","empty.compiling":"Компилируем сайдкары…","empty.no-loader":"Исполнение недоступно","empty.no-loader.detail":"Композиция не дала превью загрузчик модулей, поэтому сайдкары не исполняются.","empty.no-schema":"Схема не разбирается","empty.no-schema.detail":"Буфер держит то, что напечатано; превью покажет форму, как только текст станет схемой.","surface.compiling":"С кодом","surface.runtime":"Рантайм","model.title":"Модель","model.empty":"Формы сейчас нет: соберётся — покажем значения","model.raw":"Сырая запись","model.raw.hint":"без события изменения и без touched — как данные с бэкенда","model.copy":"Копировать модель","model.reset":"сбросить","model.disable":"выключить","model.enable":"включить"},kr=Object.freeze({ru:Sr,en:Er}),ke="preview.runtime",wr=Object.freeze({});function Cr(){return me({components:[]})}function Or({ctx:e,host:t}){const r=t.useTranslate(),n=Ne(e),o=je(e),s=Ee(t),i=d.useRef(null),a=d.useRef(null),l=d.useMemo(()=>{if(n===null)return null;const m=a.current?.model.get()??e.values();return ye({schema:n,catalog:t.catalog(),descriptor:t.kit()??Cr(),namespace:t.kitNamespace()??wr,mock:e.mock(),carry:m})},[n,t,e,s]);d.useEffect(()=>(a.current=l?.form??null,e.publishForm?.(l?.form??null),()=>{e.publishForm?.(null)}),[l,e]),d.useEffect(()=>()=>{const m=a.current;m!==null&&e.keepValues(m.model.get())},[e]),d.useEffect(()=>{e.report(ke,l?.problems??[])},[e,l]);const u=d.useCallback(m=>{const f=i.current;if(f===null)return;const p=m.target;if(p.closest('[data-slot="scroll-area-scrollbar"]')!==null)return;const v=ve(p,f);e.select(v===null?[]:[v])},[e]);if(n===null)return c.jsx(N,{title:r("empty.no-schema"),detail:r("empty.no-schema.detail")});if(l===null||l.form===null){const m=l?.problems[0];return c.jsx(N,{tone:"warning",title:r("empty.build-failed"),detail:m?.message})}return c.jsx(G,{ref:i,className:"h-full",onClick:u,children:c.jsxs("div",{className:"p-4",children:[c.jsx(xe,{selection:o}),c.jsx(de,{settings:{registry:l.form.registry},children:c.jsx(fe,{form:l.form})})]})})}function Ar(e,t){return{id:ke,title:()=>t("surface.runtime"),applies:pe,capabilities:{interactive:!0,hitTest:!0,dragSource:!1,executesCode:!1,sameRealm:!0},mount(r,n){return ge(r,d.createElement(Or,{ctx:n,host:e}))}}}function ae(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function we(e,t="",r=0){if(!ae(e))return[];const n=[];for(const[o,s]of Object.entries(e)){const i=t===""?o:`${t}.${o}`;if(Array.isArray(s)){n.push({path:i,value:s,kind:"array",depth:r});continue}if(ae(s)){n.push({path:i,value:s,kind:"group",depth:r}),n.push(...we(s,i,r+1));continue}n.push({path:i,value:s,kind:"leaf",depth:r})}return n}function Ce(e,t){const r=e;return typeof r?.signalAt=="function"?r.signalAt(t):void 0}function T(e,t){const r=Ce(e,t);return r==null?null:Qe(r)??null}function Oe(e,t){const r=T(e,t);if(r===null)return null;const n=Ce(e,t);return{touched:r.touched?.value===!0,dirty:r.dirty?.value===!0,disabled:r.disabled?.value===!0,errors:(r.errors?.value??[]).map(o=>o.message??o.code??"ошибка"),derived:n===void 0?!1:qe(n),updateOn:r.getUpdateOn?.()??"change"}}function Rr(e,t,r,n={}){const o=Oe(e,t);if(o===null)return"no-node";if(o.derived)return"derived";const s=T(e,t);return typeof s?.setValue!="function"?"read-only":(s.setValue(r,n.raw===!0?{emitEvent:!1}:void 0),n.raw!==!0&&s.markAsTouched?.(),null)}function Pr(e,t){const r=T(e,t);return typeof r?.resetToInitial!="function"?!1:(r.resetToInitial(),!0)}function Tr(e,t,r){const n=T(e,t),o=r?n?.disable:n?.enable;return typeof o!="function"?!1:(o.call(n),!0)}function ce(e){const t=e;return typeof t?.get=="function"?t.get():void 0}const le="preview.model";function Fr(e){const[t,r]=d.useState(0);return d.useEffect(()=>{const n=e?.$;if(typeof n?.subscribe!="function")return;const o=n.subscribe(()=>r(s=>s+1));return()=>{o()}},[e]),t}function Mr(e){if(e===null)return"null";if(e===void 0)return"—";if(typeof e=="string")return e===""?'""':e;const t=JSON.stringify(e);return t.length>60?`${t.slice(0,60)}…`:t}function $r({row:e,state:t,onWrite:r}){const n=t?.derived===!0;return typeof e.value=="boolean"?c.jsx(he,{checked:e.value,disabled:n,onCheckedChange:o=>r(o===!0)}):typeof e.value=="number"?c.jsx(I,{type:"number",className:"h-6 w-32 text-xs",disabled:n,defaultValue:String(e.value),onBlur:o=>{const s=o.currentTarget.value;r(s===""?null:Number(s))}}):e.kind==="leaf"?c.jsx(I,{className:"h-6 w-48 text-xs",disabled:n,defaultValue:e.value===null?"":String(e.value),onBlur:o=>r(o.currentTarget.value)}):c.jsx(I,{className:"h-6 w-64 font-mono text-xs",disabled:n||e.kind==="group",defaultValue:JSON.stringify(e.value),onBlur:o=>{try{r(JSON.parse(o.currentTarget.value))}catch{}}})}function Dr({state:e}){return e===null?null:c.jsxs(c.Fragment,{children:[e.derived?c.jsx(O,{variant:"outline",children:"compute"}):null,e.disabled?c.jsx(O,{variant:"outline",children:"disabled"}):null,e.touched?c.jsx(O,{variant:"outline",children:"touched"}):null,e.errors.map(t=>c.jsx(O,{variant:"destructive",children:t},t))]})}function Ir({host:e,live:t}){const r=e.useTranslate(),n=e.useActiveDocument(),[o,s]=d.useState(!1),a=_r(t(),n)?.model??null,l=Fr(a),u=d.useMemo(()=>a===null?[]:we(ce(a)),[a,l]),m=d.useCallback((f,p)=>{a!==null&&Rr(a,f,p,{raw:o})},[a,o]);return a===null?c.jsx("div",{className:"text-muted-foreground p-3 text-xs",children:r("model.empty")}):c.jsxs("div",{className:"flex h-full flex-col",children:[c.jsxs("div",{className:"border-border flex items-center gap-2 border-b px-3 py-1 text-[11px]",children:[c.jsxs("label",{className:"flex items-center gap-1",children:[c.jsx(he,{checked:o,onCheckedChange:f=>s(f===!0)}),r("model.raw")]}),c.jsx("span",{className:"text-muted-foreground",children:r("model.raw.hint")}),c.jsx(D,{size:"sm",variant:"ghost",className:"ml-auto h-6",onClick:()=>{navigator.clipboard?.writeText(JSON.stringify(ce(a),null,2))},children:r("model.copy")})]}),c.jsx(G,{className:"min-h-0 flex-1",children:c.jsx("table",{className:"w-full text-xs",children:c.jsx("tbody",{children:u.map(f=>{const p=Oe(a,f.path);return c.jsxs("tr",{className:"border-border/50 border-b",children:[c.jsx("td",{className:"py-1 pr-2 font-mono",style:{paddingLeft:8+f.depth*12},children:f.path}),c.jsx("td",{className:"py-1 pr-2",children:f.kind==="group"?c.jsx("span",{className:"text-muted-foreground",children:Mr(f.value)}):c.jsx($r,{row:f,state:p,onWrite:v=>m(f.path,v)})}),c.jsx("td",{className:"flex flex-wrap items-center gap-1 py-1 pr-2",children:c.jsx(Dr,{state:p})}),c.jsx("td",{className:"py-1 pr-2 text-right",children:p===null?null:c.jsxs(c.Fragment,{children:[c.jsx(D,{size:"sm",variant:"ghost",className:"h-5 px-1",onClick:()=>Pr(a,f.path),children:r("model.reset")}),c.jsx(D,{size:"sm",variant:"ghost",className:"h-5 px-1",onClick:()=>Tr(a,f.path,!p.disabled),children:p.disabled?r("model.enable"):r("model.disable")})]})})]},f.path)})})})})]})}function _r(e,t){const[,r]=d.useState(0);return d.useEffect(()=>{if(e===void 0||t===null)return;const n=e.onDidChangeForm(t,()=>r(o=>o+1));return()=>{n.dispose()}},[e,t]),e===void 0||t===null?null:e.formOf(t)}function Lr(e,t){return[Ar(e,t),gr(e,t)]}function Ur(e={}){return Ze({id:vr,activate(t){for(const[o,s]of Object.entries(kr))t.i18n.contribute(o,s);const r=(o,s)=>t.i18n.t(o,s),n=e.host??jr(t);t.subscriptions.push(t.extensions.contribute(et,{id:le,slot:"panel.bottom",titleKey:"model.title",when:o=>o.activeResourceKind===rt,order:30,Body:()=>d.createElement(Ir,{host:n,live:()=>t.services.get(tt)})},{id:le}));for(const o of Lr(n,r))t.subscriptions.push(t.extensions.contribute(nt,o,{id:o.id}))}})}export{Se as COMPILING_SURFACE_ID,br as KitCapability,le as MODEL_PANEL_ID,kr as PREVIEW_RUNTIME_MESSAGES,vr as PREVIEW_RUNTIME_PLUGIN_ID,ke as RUNTIME_SURFACE_ID,Lr as builtinSurfaces,Ur as createPreviewRuntimePlugin,jr as previewHostFromContext};
@@ -0,0 +1,2 @@
1
+ import{cu as Ce,cv as _e,bM as te,cw as F,bJ as ne,bK as re,bI as De,cx as Re,cy as ue,cz as Ae,cA as $e,cg as de,cp as Pe,c5 as Le,cB as Me,cC as ze,cb as qe,Z as s,aT as Ke,aU as Ue,aw as N,aV as Be,cD as Ve,cE as We,Y as p,cF as z,cG as q,cH as K,cI as P,aS as me,cJ as Ge,cK as Xe,cL as Je,cM as Ye,cN as Ze,cO as fe,aL as He,cP as U,cQ as Qe,cR as et,bT as tt,bX as nt,bU as rt,bV as ot,cS as at,cT as L,cU as it,bz as st,c3 as lt,c2 as ct,c7 as ut,cV as dt}from"../js/index-C4LjLCAZ.js";import{t as mt}from"../vendor/reformer-builder-toolkit/naming-9aaM0Wbc.js";import{b as ft,p as pt,e as ht}from"../vendor/index-D8ACoUqy.js";import{r as oe}from"../vendor/render-DutGx1TC.js";import{F as gt,s as vt}from"../vendor/reformer-builder-stack-reformer/paths-DeGLVPUt.js";import{R as yt,F as xt,L as bt}from"../vendor/lucide-react/rotate-ccw-BSYk0mux.js";import{o as jt,u as wt}from"../vendor/reformer-ui-kit/alert-base-WOl_V-qI-2ZIfaT1o.js";import{i as Tt,s as kt,r as St}from"../vendor/collapsible-base-DZxAKbAF-DtQ4867U.js";import"../vendor/reformer-builder-stack-reformer/rules-CQSVDlmo.js";const C="template.json",Nt="1.0";function pe(e){return typeof e.save=="function"}function B(e){return typeof e.update=="function"}function V(e){return typeof e.remove=="function"}const Et=Object.freeze({id:"templates.store"}),S=Ce.id,W={pascal:"__FormName__",camel:"__formName__",kebab:"__form-name__",snake:"__form_name__"},G=["pascal","camel","snake","kebab"];function X(e){const t=mt(e).match(/[A-Z]+(?![a-z])|[A-Z][a-z0-9]*|[a-z0-9]+/g);return t===null?[]:t.map(r=>r.toLowerCase())}const ae=e=>e.charAt(0).toUpperCase()+e.slice(1);function I(e,t){const r=X(e);if(r.length===0)return"";switch(t){case"pascal":return r.map(ae).join("");case"camel":return r[0]+r.slice(1).map(ae).join("");case"snake":return r.join("_");default:return r.join("-")}}function J(e){return{pascal:I(e,"pascal"),camel:I(e,"camel"),kebab:I(e,"kebab"),snake:I(e,"snake")}}function It(e){return I(e,"kebab")==="form-name"}function Ot(e){const t=J(e),r=new Set,n=[];for(const o of G){const a=t[o];a===""||r.has(a)||(r.add(a),n.push({value:a,token:W[o]}))}return n.sort((o,a)=>a.value.length-o.value.length)}function _(e,t){if(X(t).length===0||I(t,"kebab").length<2||It(t))return e;let n=e;for(const{value:o,token:a}of Ot(t))n=n.split(o).join(a);return n}function ie(e,t){const r=J(t);if(r.kebab==="")return e;let n=e;for(const o of G)n=n.split(W[o]).join(r[o]);return n}function Ft(e){return X(e).length>0}function Gn(e){return G.some(t=>e.includes(W[t]))}function Ct(e,t,r={}){const n=J(t),o=r.kit??null,a=o===null?null:ye(e.files);return{name:t,pascal:n.pascal,camel:n.camel,kebab:n.kebab,snake:n.snake,template:{id:e.id,name:e.name},form:a===null||o===null?null:ft(pt({schema:a.schema,formName:t,kit:o}))}}function _t(e,t,r){const n=`template:${e.id}:${t.path}`;return{...t,path:oe(`${n}:path`,t.path,r),content:oe(n,t.content,r)}}const Dt=[".ts",".tsx",".js",".jsx",".mjs",".cjs",".json",".jsonc",".css",".scss",".less",".html",".md",".mdx",".txt",".yml",".yaml",".svg",".graphql",".env"];function he(e){const t=e.slice(e.lastIndexOf("/")+1),r=t.lastIndexOf(".");return r<=0?!0:Dt.includes(t.slice(r).toLowerCase())}function Rt(e){const t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t)}function ge(e){if(e.length===0)return"";let t=null;for(const r of e){const n=Rt(r).split("/").filter(Boolean);if(t===null){t=n;continue}let o=0;for(;o<t.length&&o<n.length&&t[o]===n[o];)o+=1;t=t.slice(0,o)}return(t??[]).join("/")}function Xn(e){const t=ge(e);if(t!=="")return t.slice(t.lastIndexOf("/")+1);const r=e[0];if(r===void 0)return"";const n=r.slice(r.lastIndexOf("/")+1),o=n.indexOf(".");return o===-1?n:n.slice(0,o)}function At(e,t){const r=ge(e.map(i=>i.path)),n=r===""?0:r.length+1,o=new Set,a=[];for(const i of e){const l=_(i.path.slice(n),t);l===""||o.has(l)||(o.add(l),a.push({path:l,content:_(i.content,t)}))}return a}function $t(e){const t=e.trim().toLowerCase().replace(/[\\/:*?"<>|]+/g,"").replace(/[\s_]+/g,"-").replace(/-{2,}/g,"-").replace(/^[-.]+|[-.]+$/g,"");return t===""?"template":t}function ve(e,t){const r=new Set(e);if(t===void 0)return r;const n=[...r];for(;n.length>0;){const o=n.pop();for(const a of t[o]??[])r.has(a)||(r.add(a),n.push(a))}return r}function Pt(e,t,r,n={}){const o=ve(t,e.requires),a=e.files.filter(l=>o.has(l.path));if(e.engine!=="eta")return a.map(l=>({...l,path:ie(l.path,r),content:ie(l.content,r)}));const i=Ct(e,r,{kit:n.kit??null});return a.map(l=>_t(e,l,i))}function ye(e){for(const t of e)if(t.path.endsWith(".json"))try{const r=JSON.parse(t.content);if(_e(r))return{file:t,schema:r}}catch{}return null}const b=(e,t)=>({ok:!1,messageKey:e,...t===void 0?{}:{params:t}}),A=(e,t)=>({ok:!0,messageKey:e,...t===void 0?{}:{params:t}});function D(e){return e instanceof Error?e.message:String(e)}async function Lt(e,t){if(e.invalidate!==void 0)for(const r of new Set(t.map(n=>e.parentOf(n))))try{await e.invalidate(r)}catch(n){console.warn(`[templates] уровень «${r}» не перечитан`,n)}}const Mt=new Set(["node_modules","dist","build","coverage",".git",".next",".turbo",".vite"]),zt=300,qt=6;async function Kt(e,t,r=zt){const n=[{id:t,path:""}];let o=n.slice();for(let a=0;a<qt&&o.length>0&&n.length<r;a+=1){const i=[];for(const l of o){if(n.length>=r)break;let c;try{c=await e.list(l.id)}catch{continue}for(const u of c){if(u.kind!=="directory"||Mt.has(u.name))continue;const d={id:u.id,path:l.path===""?u.name:`${l.path}/${u.name}`};if(i.push(d),n.push(d),n.length>=r)break}}o=i}return n.sort((a,i)=>a.path.localeCompare(i.path))}async function xe(e,t,r){let n;try{n=await e.list(t)}catch{return{files:[],skipped:0}}const o=[];let a=0;for(const i of n){const l=r===""?i.name:`${r}/${i.name}`;if(i.kind==="directory"){const u=await xe(e,i.id,l);o.push(...u.files),a+=u.skipped;continue}if(!he(l)){a+=1;continue}const c=await e.readText(i.id);c!==null&&o.push({path:l,content:c})}return{files:o,skipped:a}}async function Ut(e,t,r,n){if(!pe(t))return b("error.store-read-only");const o=n.name.trim();if(o==="")return b("error.no-name");try{const{files:a,skipped:i}=await xe(e,r,"");if(a.length===0)return b("error.nothing-to-save");const l=(n.baseName??"").trim()||r.slice(r.lastIndexOf("/")+1),c={id:$t(o),name:o,description:n.description?.trim()||void 0,source:t.source,files:At(a,l),createdAt:new Date().toISOString()},u=await t.save(c,l);return A("result.created",{name:u.name,count:u.files.length,skipped:i})}catch(a){return b("error.create-failed",{message:D(a)})}}function Bt(e){return e.filter(t=>(t.scope??"form")==="form")}function Vt(e){return e.filter(t=>t.scope==="fixture")}async function be(e,t,r,n,o){const a=r.trim();if(a==="")return{...b("error.no-form-name"),openId:null};const i=e.sourceOf(t);if(i===null||!i.write)return{...b("error.read-only"),openId:null};const l=e.kit();let c;try{c=Pt(n,o,a,{kit:l===null?null:{kit:l,catalog:e.catalog()}})}catch(u){return{...b("error.template-failed",{message:D(u)}),openId:null}}if(c.length===0)return{...b("error.nothing-picked"),openId:null};try{let u=a;for(let y=2;await e.exists(e.resolve(t,u));y+=1)u=`${a}-${y}`;const d=e.resolve(t,u),h=ye(c),v=[];let g=null;for(const y of Bt(c)){const x=e.resolve(d,...y.path.split("/"));await e.writeText(x,y.content),v.push(x),h!==null&&y.path===h.file.path&&(g=x)}for(const y of Vt(c)){const x=e.resolve(d,...y.path.split("/"));await e.writeText(x,y.content),v.push(x)}const w=await e.save?.(v);return await Lt(e,[d,...v]),w===!1?{...b("error.save-failed"),openId:null}:{...A("result.generated",{folder:u,template:n.name}),openId:g}}catch(u){return{...b("error.generate-failed",{message:D(u)}),openId:null}}}async function Wt(e,t,r){const n=r.trim();if(n==="")return b("error.no-name");if(!B(e))return b("error.store-read-only");try{return await e.update({...t,name:n}),A("result.renamed",{name:n})}catch(o){return b("error.rename-failed",{message:D(o)})}}async function Gt(e,t){if(!V(e))return b("error.no-remove");try{return await e.remove(t.id),A("result.removed",{name:t.name})}catch(r){return b("error.remove-failed",{message:D(r)})}}async function je(e){const t=[];for(const r of e)if(r.available())try{t.push(...await r.list())}catch(n){console.warn(`[templates] хранилище «${r.source}» не отдало список`,n)}return t}const Xt=["builtin","project","local"];function Y(e,t){return e.find(r=>r.source===t)??null}const we="templates.createFromDirectory",Te="templates.generateIntoDirectory",se="resource/context/templates";function le(e){if(typeof e!="object"||e===null)return null;const t=e.dir;return typeof t=="string"?t:null}function Jt(e){if(typeof e!="object"||e===null)return null;const t=e.templateId;return typeof t=="string"&&t!==""?t:null}const ke=Object.freeze([]);function Yt(e,t=je){let r=ke;const n=new Set;return{list:()=>r,refresh:()=>{t(e()).then(o=>{r=o;for(const a of n)a()})},onDidChange:o=>(n.add(o),{dispose:()=>{n.delete(o)}})}}function ce(e){return e.find(t=>pe(t))??null}function Zt(e,t){return[{id:we,titleKey:"command.createFromDirectory",enabled:()=>e.prompt!=null&&ce(e.stores())!==null,async run(r){const n=le(r),o=ce(e.stores());if(n===null||o===null||e.prompt==null)return!1;const a=await e.prompt.input({titleKey:"menu.createTemplate.title",descriptionKey:"menu.createTemplate.description",labelKey:"menu.createTemplate.label",validate:l=>te(l)===null?null:"menu.createTemplate.invalid",pluginId:S});if(a===null)return!1;const i=await Ut(e.host,o,n,{name:a});return i.ok?e.notifications?.success(F(S,"notify.created")):e.notifications?.error(F(S,"notify.failed")),t?.refresh(),i.ok}},{id:Te,titleKey:"command.generateIntoDirectory",enabled:()=>e.prompt!=null,async run(r){const n=le(r),o=Jt(r);if(n===null||o===null||e.prompt==null)return!1;const a=(t?.list()??ke).find(c=>c.id===o);if(a===void 0)return e.notifications?.error(F(S,"notify.gone")),t?.refresh(),!1;const i=await e.prompt.input({titleKey:"menu.createForm.title",descriptionKey:"menu.createForm.description",labelKey:"form.name",confirmKey:"action.generate",validate:c=>te(c)===null?null:"form.name.invalid",pluginId:S});if(i===null)return!1;const l=await be(e.host,n,i,a,a.files.map(c=>c.path));return l.ok?e.notifications?.success(F(S,"notify.generated")):e.notifications?.error(F(S,"notify.generate-failed")),l.ok&&l.openId!==null&&e.host.openResource?.(l.openId),l.ok}}]}function Ht(e){const t=ne(r=>r.ref===null||r.ref.kind==="directory");return[{id:"templates.context.generateSubmenu",value:{kind:"submenu",menu:re,submenu:se,titleKey:"menu.createForm",group:"5_templates",enabledWhen:t,onDidChange:e===void 0?void 0:r=>e.onDidChange(r)}},{id:"templates.context.templates",value:{kind:"dynamic",menu:se,items:(r,n)=>{const o=Re(n);return o===null||e===void 0?[]:e.list().map(a=>({id:a.id,command:Te,args:{dir:o.dir,templateId:a.id},title:a.name}))},onDidChange:e===void 0?void 0:r=>e.onDidChange(r)}},{id:"templates.context.createFromDirectory",value:{kind:"item",menu:re,command:we,group:"5_templates",order:10,when:ne(r=>r.ref?.kind==="directory"),argsOf:De(r=>({dir:r.ref?.id}))}}]}const Qt={"action.cancel":"Cancel","action.generate":"Create form","action.refresh":"Refresh","action.remove":"Delete","action.rename":"Rename","action.save-as-template":"Save directory as template","command.createFromDirectory":"Create a template from this directory…","command.generateIntoDirectory":"Create a form from a template in this directory…","command.refresh":"Reload form templates","dialog.generate.description":"Files of the “{name}” template will land in a new form directory.","dialog.generate.folder":"Form directory","dialog.generate.folder.hint":"The form directory appears inside the selected one.","dialog.generate.folder.loading":"Reading project directories…","dialog.generate.folder.root":"Project root","dialog.generate.no-project":"No project is open — there is nowhere to create the form.","dialog.generate.target":"Directory: {path}","dialog.generate.title":"Create a form from a template","dialog.remove.description.local":"“{name}” will be deleted from the browser local storage.","dialog.remove.description.project":"“{name}” will be deleted together with its directory in the project.","dialog.remove.title":"Delete the template?","dialog.rename.description":"Only the displayed name changes — the template directory stays as it is.","dialog.rename.title":"Rename the template","empty.no-document":"No open document","empty.no-document.detail":"A form from a template is created next to the open file.","empty.none":"No templates","empty.none.detail":"Built-in ones appear once a kit is active; project ones once a project is open.","error.create-failed":"Could not create the template: {message}","error.generate-failed":"Could not create the form: {message}","error.no-form-name":"Enter a form name.","error.no-name":"Enter a template name.","error.no-remove":"Deleting is unavailable: the workspace cannot remove resources.","error.nothing-picked":"No files selected.","error.nothing-to-save":"Nothing to save: the directory has no text files.","error.read-only":"The source refuses writes — there is nowhere to create the form.","error.remove-failed":"Could not delete: {message}","error.rename-failed":"Could not rename: {message}","error.save-failed":"The form files could not be sent to the project — it stayed a working copy only.","error.store-read-only":"This store does not accept writes.","error.template-failed":"Template failed: {message}","files.picked":"Files ({picked} of {total})","form.name":"Form name","form.name.invalid":"Letters or digits are required: file, component and import names are derived from it.","form.name.placeholder":"for example: user-profile","group.builtin":"Built-in","group.local":"Local","group.project":"Project","menu.createForm":"Create a form from a template","menu.createForm.description":"The template files go into a new form directory inside the chosen one.","menu.createForm.title":"Form from a template","menu.createTemplate.description":"The directory files become a template; the form name in paths and texts is replaced with a placeholder.","menu.createTemplate.invalid":"This name will not work as a template directory","menu.createTemplate.label":"Template name","menu.createTemplate.title":"Template from a directory","menu.generate":"Create a form…","menu.rename":"Rename…","panel.title":"Form templates","result.created":"Template “{name}” saved (files: {count}, binaries skipped: {skipped})","result.generated":"Form “{folder}” created from template “{template}”","result.removed":"Template “{name}” deleted","result.renamed":"Template renamed to “{name}”","save.name":"Template name","save.target":"Save to","source.builtin":"built-in","source.local":"local","source.project":"project","template.files":"Files: {count}","notify.created":"The template has been saved.","notify.failed":"The template was not saved. See the templates panel for details.","notify.generate-failed":"The form was not created. See the templates panel for details.","notify.generated":"The form has been created from the template.","notify.gone":"That template is gone — the list has been refreshed."},en={"action.cancel":"Отмена","action.generate":"Создать форму","action.refresh":"Обновить","action.remove":"Удалить","action.rename":"Переименовать","action.save-as-template":"Сохранить каталог как шаблон","command.createFromDirectory":"Создать шаблон из каталога…","command.generateIntoDirectory":"Создать форму по шаблону в каталоге…","command.refresh":"Перечитать шаблоны форм","dialog.generate.description":"Файлы шаблона «{name}» лягут в новый каталог формы.","dialog.generate.folder":"Каталог формы","dialog.generate.folder.hint":"Каталог формы появится внутри выбранного.","dialog.generate.folder.loading":"Читаем каталоги проекта…","dialog.generate.folder.root":"Корень проекта","dialog.generate.no-project":"Проект не открыт — создавать форму негде.","dialog.generate.target":"Каталог: {path}","dialog.generate.title":"Создать форму по шаблону","dialog.remove.description.local":"«{name}» будет удалён из локального хранилища браузера.","dialog.remove.description.project":"«{name}» будет удалён вместе с каталогом в проекте.","dialog.remove.title":"Удалить шаблон?","dialog.rename.description":"Меняется только отображаемое имя — каталог шаблона остаётся прежним.","dialog.rename.title":"Переименовать шаблон","empty.no-document":"Нет открытого документа","empty.no-document.detail":"Форма по шаблону создаётся рядом с открытым файлом.","empty.none":"Шаблонов нет","empty.none.detail":"Встроенные появятся, когда выбран кит; проектные — когда открыт проект.","error.create-failed":"Не удалось создать шаблон: {message}","error.generate-failed":"Не удалось создать форму: {message}","error.no-form-name":"Укажите имя формы.","error.no-name":"Укажите имя шаблона.","error.no-remove":"Удаление недоступно: рабочая область не умеет удалять ресурсы.","error.nothing-picked":"Не выбрано ни одного файла.","error.nothing-to-save":"Сохранять нечего: в каталоге нет текстовых файлов.","error.read-only":"Источник не принимает запись — создавать форму некуда.","error.remove-failed":"Не удалось удалить: {message}","error.rename-failed":"Не удалось переименовать: {message}","error.save-failed":"Файлы формы не удалось отправить в проект — она осталась только в рабочей копии.","error.store-read-only":"Это хранилище не принимает запись.","error.template-failed":"Шаблон не отработал: {message}","files.picked":"Файлы ({picked} из {total})","form.name":"Имя формы","form.name.invalid":"Нужны буквы или цифры: из имени выводятся имена файлов, компонентов и импорты.","form.name.placeholder":"например: user-profile","group.builtin":"Встроенные","group.local":"Локальные","group.project":"Проект","menu.createForm":"Создать форму из шаблона","menu.createForm.description":"Файлы шаблона лягут в новый каталог формы внутри выбранного.","menu.createForm.title":"Форма по шаблону","menu.createTemplate.description":"Файлы каталога станут шаблоном; имя формы в путях и текстах заменится подстановкой.","menu.createTemplate.invalid":"Такое имя не годится для каталога шаблона","menu.createTemplate.label":"Название шаблона","menu.createTemplate.title":"Шаблон из каталога","menu.generate":"Создать форму…","menu.rename":"Переименовать…","panel.title":"Шаблоны форм","result.created":"Шаблон «{name}» сохранён (файлов: {count}, пропущено бинарных: {skipped})","result.generated":"Форма «{folder}» создана по шаблону «{template}»","result.removed":"Шаблон «{name}» удалён","result.renamed":"Шаблон переименован в «{name}»","save.name":"Имя шаблона","save.target":"Куда сохранить","source.builtin":"встроенный","source.local":"локальный","source.project":"проект","template.files":"Файлов: {count}","notify.created":"Шаблон сохранён.","notify.failed":"Шаблон не сохранён. Подробности — на панели шаблонов.","notify.generate-failed":"Форму создать не удалось. Подробности — на панели шаблонов.","notify.generated":"Форма создана по шаблону.","notify.gone":"Шаблона больше нет — список обновлён."},tn=Object.freeze({ru:en,en:Qt});function nn(){const e=new Set;return{request:()=>{for(const t of[...e])t()},subscribe:t=>(e.add(t),{dispose:()=>{e.delete(t)}})}}const R="sample",rn="builtin-simple-form",on="builtin-wizard-form",M="index.tsx",an=new Set(["README.md"]);function T(e,t,r,n={}){const o=Ae(e);return{...o,value:`$model(${t})`,componentProps:{...o.componentProps,label:r,...n}}}const Z="CITY_LIST";function sn(){const e=ue(),t=e.root;return t.children=[T("Input","lastName","Фамилия",{required:!0}),T("Input","firstName","Имя",{required:!0}),T("Input","fullName","Полное имя",{readOnly:!0}),T("Select","city","Город",{options:`$dataSource(${Z})`}),T("Input","email","Электронная почта",{required:!0})],e}function Se(){return{validation:[{target:"lastName",rules:["required"]},{target:"firstName",rules:["required"]},{target:"email",rules:["required","email"]}],behavior:[{kind:"computeFrom",target:"fullName",sources:["lastName","firstName"],expr:'[lastName, firstName].filter(Boolean).join(" ")'}],render:[{kind:"hideWhen",selector:"full-name",condition:"!form.lastName.value.value || !form.firstName.value.value"}]}}function ln(){const e=ue(),t=e.root,r=(n,o)=>({...$e(n),children:[...o]});return t.children=[{component:"$component(Wizard)",componentProps:{steps:[r("Данные",[T("Input","lastName","Фамилия",{required:!0}),T("Input","firstName","Имя",{required:!0}),T("Input","fullName","Полное имя",{readOnly:!0})]),r("Контакты",[T("Select","city","Город",{options:`$dataSource(${Z})`}),T("Input","email","Электронная почта",{required:!0})])]}}],e}const cn=Se;function Ne(){return{model:{city:"msk"},dataSources:{[Z]:[{value:"msk",label:"Москва"},{value:"spb",label:"Санкт-Петербург"},{value:"nsk",label:"Новосибирск"}]}}}function un(e){const t=Ne(),r=vt(e);return{model:{...r.model,...t.model},dataSources:{...r.dataSources,...t.dataSources}}}const dn=[{id:rn,name:"Простая форма",description:"Готовая к проверке: обязательные поля, вычисляемое «Полное имя», список городов и фикстура.",schema:sn,rules:Se},{id:on,name:"Пошаговая форма",description:"То же в два шага, плюс шим визарда под активный кит.",schema:ln,rules:cn}];function mn(e){if(e.find(n=>n.path===M)===void 0)return{};const r=e.filter(n=>(n.scope??"form")==="form").map(n=>n.path).filter(n=>n!==M&&!an.has(n));return{[M]:r}}function fn(e){return{source:"builtin",available:()=>e.ready?.()??e.print!==void 0,async list(){const t=e.print;if(t===void 0)return[];const r=[];for(const n of dn)try{const o=n.schema(),i=(await t(o,R,{rules:n.rules(),mock:un(o)})).map(l=>({path:_(l.path,R),content:_(l.content,R)}));i.push({path:gt,content:_(ht(o,Ne()),R),scope:"fixture"}),r.push({id:n.id,name:n.name,description:n.description,source:"builtin",files:i,requires:mn(i)})}catch(o){console.warn(`[templates] встроенный шаблон «${n.id}» не напечатался`,o)}return r}}}const pn=de({id:"reformer.kit.catalog",version:"1.0.0"}),Ee=de({id:"reformer.codegen.printer",version:"1.0.0"}),hn=Object.freeze([]);function gn(e){return async(t,r,n)=>{const o=e.services.get(Ee);return o===void 0?[]:o.print(t,r,n)}}function vn(e,t={}){const r=e.services.require(Pe),n=e.services.require(Le),o=()=>e.services.get(pn);return{useTranslate:function(){return qe(e.i18n)},useActiveDocument:function(){return ze(r)},refOf:a=>r.documentOf(a)?.ref??null,projectRoot:n.projectRoot,parentOf:n.parentOf,resolve:n.resolve,list:n.list,exists:n.exists,readText:n.readText,invalidate:n.refresh,writeText:(a,i)=>r.writeText(a,i),sourceOf:a=>r.hasProject()?{write:n.canWrite(a)}:null,openResource:a=>{r.open(a,{preview:!1}).catch(i=>{console.error(`[templates] открыть «${a}» не удалось`,i)})},catalog:()=>o()?.catalog()??hn,kit:()=>o()?.descriptor()??null,onDidChangeKit:a=>o()?.onDidChange(a)??{dispose:()=>{}},save:async a=>await e.services.get(Me)?.save(a)??!1,...t}}function yn(e){return gn(e)}function xn(e){return e.services.get(Ee)!==void 0}function bn(e){if(e===null||typeof e!="object")return!1;const t=e;return typeof t.id=="string"&&Array.isArray(t.files)}function jn(e){if(e===void 0)return{source:"local",available:()=>!1,list:async()=>[]};const t=async()=>{try{const r=await e.keys(),n=[];for(const o of r){const a=await e.get(o);bn(a)&&n.push({...a,id:o,source:"local"})}return n}catch(r){return console.warn("[templates] локальные шаблоны недоступны",r),[]}};return{source:"local",available:()=>!0,list:t,async save(r){const n=new Set((await t()).map(i=>i.id));let o=r.id;for(let i=2;n.has(o);i+=1)o=`${r.id}-${i}`;const a={...r,id:o,source:"local"};return await e.put(o,a),a},async update(r){await e.put(r.id,r)},async remove(r){await e.remove(r)}}}const wn=".ui_builder/templates";function Tn(e){try{const t=JSON.parse(e);return t!==null&&typeof t=="object"?t:{}}catch{return{}}}async function Ie(e,t,r=""){let n;try{n=await e.list(t)}catch{return[]}const o=[];for(const a of n){const i=r===""?a.name:`${r}/${a.name}`;a.kind==="directory"?o.push(...await Ie(e,a.id,i)):o.push(i)}return o}function kn(e){const t=()=>{const i=e.projectRoot();return i===null?null:e.resolve(i,...wn.split("/"))},r=async(i,l)=>{const c=await Ie(e,i);if(c.length===0)return null;let u={};if(c.includes(C)){const h=await e.readText(e.resolve(i,C));h!==null&&(u=Tn(h))}const d=[];for(const h of c){if(h===C||!he(h))continue;const v=await e.readText(e.resolve(i,...h.split("/")));v!==null&&d.push({path:h,content:v})}return d.length===0?null:{id:l,name:u.name?.trim()??l,description:u.description,source:"project",files:d,requires:u.requires,createdAt:u.createdAt,...u.engine==="eta"?{engine:"eta"}:{}}},n=(i,l)=>{const c={version:Nt,name:i.name,description:i.description,baseName:l,createdAt:i.createdAt,requires:i.requires,engine:i.engine};return`${JSON.stringify(c,null,2)}
2
+ `},o=async(i,l)=>{let c=l,u=2;for(;await e.exists(e.resolve(i,c));)c=`${l}-${u}`,u+=1;return c},a={source:"project",available:()=>e.projectRoot()!==null,async list(){const i=t();if(i===null)return[];let l;try{l=await e.list(i)}catch{return[]}const c=[];for(const u of l)if(u.kind==="directory")try{const d=await r(u.id,u.name);d!==null&&c.push(d)}catch(d){console.warn(`[templates] шаблон «${u.name}» не прочитан`,d)}return c},async save(i,l){const c=t();if(c===null)throw new Error("проект не открыт: каталог шаблонов неизвестен");const u=await o(c,i.id),d=e.resolve(c,u),h=[],v=e.resolve(d,C);await e.writeText(v,n(i,l)),h.push(v);for(const g of i.files){const w=e.resolve(d,...g.path.split("/"));await e.writeText(w,g.content),h.push(w)}return await e.save?.(h),await e.invalidate?.(c).catch(()=>{}),{...i,id:u,source:"project"}},async update(i){const l=t();if(l===null)throw new Error("проект не открыт: каталог шаблонов неизвестен");const c=e.resolve(l,i.id,C);await e.writeText(c,n(i)),await e.save?.([c])}};if(e.remove!==void 0){const i=e.remove.bind(e);a.remove=async l=>{const c=t();if(c===null)throw new Error("проект не открыт: каталог шаблонов неизвестен");await i(e.resolve(c,l)),await e.invalidate?.(c).catch(()=>{})}}return a}function Sn({host:e,refresh:t}){const n=e.useTranslate()("action.refresh");return s.jsxs(Ke,{children:[s.jsx(Ue,{asChild:!0,children:s.jsx(N,{variant:"ghost",size:"icon","aria-label":n,"data-testid":"button-refresh",className:"size-6",onClick:()=>t.request(),children:s.jsx(yt,{"aria-hidden":"true",className:"size-3.5"})})}),s.jsx(Be,{children:n})]})}function Nn({dialog:e,host:t,documentId:r,stores:n,t:o,onClose:a,onDone:i}){return e===null?null:s.jsx(Ve,{open:!0,onOpenChange:l=>{l||a()},children:s.jsx(We,{className:"max-w-md",children:e.kind==="generate"?s.jsx(En,{template:e.template,host:t,documentId:r,t:o,onClose:a,onDone:i},`generate:${e.template.source}:${e.template.id}`):e.kind==="rename"?s.jsx(In,{template:e.template,stores:n,t:o,onClose:a,onDone:i},`rename:${e.template.source}:${e.template.id}`):s.jsx(On,{template:e.template,stores:n,t:o,onClose:a,onDone:i})})})}function En({template:e,host:t,documentId:r,t:n,onClose:o,onDone:a}){const[i,l]=p.useState(""),[c,u]=p.useState(!1),[d,h]=p.useState(()=>new Set(e.files.map(m=>m.path))),[v,g]=p.useState([]),[w,y]=p.useState(null),x=t.projectRoot(),E=r===null?x:t.parentOf(r);p.useEffect(()=>{if(x===null)return;let m=!0;return Kt(t,x).then(k=>{m&&(g(k),y($=>$??E??x))}),()=>{m=!1}},[t,x,E]);const f=v.some(m=>m.id===(w??E))?w??E:x,j=v,O=Ft(i),Q=O&&d.size>0&&f!==null,Oe=m=>{const k=new Set(d);if(k.has(m)){k.delete(m);for(const[$,Fe]of Object.entries(e.requires??{}))Fe.includes(m)&&k.delete($);h(k);return}k.add(m),h(ve(k,e.requires))},ee=()=>{!Q||f===null||(be(t,f,i,e,d).then(m=>{a(m),m.ok&&m.openId!==null&&t.openResource?.(m.openId)}),o())};return s.jsxs(s.Fragment,{children:[s.jsxs(z,{children:[s.jsx(q,{children:n("dialog.generate.title")}),s.jsx(K,{children:n("dialog.generate.description",{name:e.name})})]}),s.jsxs("div",{className:"min-w-0 space-y-3 py-1",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(P,{htmlFor:"templates-form-name",children:n("form.name")}),s.jsx(me,{id:"templates-form-name","data-testid":"input-formName",autoFocus:!0,value:i,placeholder:n("form.name.placeholder"),onChange:m=>l(m.target.value),onKeyDown:m=>{m.key==="Enter"&&(m.preventDefault(),ee())}}),i.trim()!==""&&!O?s.jsx("p",{className:"text-destructive text-[11px]",children:n("form.name.invalid")}):null]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(P,{htmlFor:"templates-form-folder",children:n("dialog.generate.folder")}),x===null?s.jsx("p",{className:"text-muted-foreground text-[11px]",children:n("dialog.generate.no-project")}):s.jsxs(Ge,{value:f??"",onValueChange:m=>y(m),children:[s.jsx(Xe,{id:"templates-form-folder",size:"sm","data-testid":"select-folder",className:"w-full",children:s.jsx(Je,{placeholder:n("dialog.generate.folder.loading")})}),s.jsx(Ye,{children:j.map(m=>s.jsx(Ze,{value:m.id,children:m.path===""?n("dialog.generate.folder.root"):m.path},m.id))})]}),s.jsx("p",{className:"text-muted-foreground text-[11px]",children:n("dialog.generate.folder.hint")})]}),s.jsxs(Tt,{open:c,onOpenChange:u,className:"min-w-0 space-y-1.5",children:[s.jsxs(kt,{className:"flex w-full items-center gap-1 text-left",children:[s.jsx(fe,{"aria-hidden":"true",className:c?"text-muted-foreground size-3.5 flex-none rotate-90 transition-transform":"text-muted-foreground size-3.5 flex-none transition-transform"}),s.jsx(P,{className:"cursor-pointer",children:n("files.picked",{picked:d.size,total:e.files.length})})]}),s.jsx(St,{children:s.jsx("div",{className:"border-border max-h-52 space-y-2 overflow-y-auto rounded-md border p-2",children:e.files.map(m=>s.jsxs("label",{className:"flex min-w-0 cursor-pointer items-center gap-2 text-sm",children:[s.jsx(He,{className:"flex-none",checked:d.has(m.path),onCheckedChange:()=>Oe(m.path)}),s.jsx("span",{className:"min-w-0 truncate",children:e.labels?.[m.path]??m.path})]},m.path))})})]})]}),s.jsxs(U,{children:[s.jsx(N,{variant:"outline",onClick:o,children:n("action.cancel")}),s.jsx(N,{"data-testid":"button-generate",disabled:!Q,onClick:ee,children:n("action.generate")})]})]})}function In({template:e,stores:t,t:r,onClose:n,onDone:o}){const[a,i]=p.useState(e.name),l=p.useMemo(()=>Y(t(),e.source),[t,e.source]),c=a.trim()!==""&&l!==null&&B(l),u=()=>{!c||l===null||(Wt(l,e,a).then(o),n())};return s.jsxs(s.Fragment,{children:[s.jsxs(z,{children:[s.jsx(q,{children:r("dialog.rename.title")}),s.jsx(K,{children:r("dialog.rename.description")})]}),s.jsx(me,{autoFocus:!0,"data-testid":"input-templateName",value:a,onChange:d=>i(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),u())}}),s.jsxs(U,{children:[s.jsx(N,{variant:"outline",onClick:n,children:r("action.cancel")}),s.jsx(N,{disabled:!c,onClick:u,children:r("action.rename")})]})]})}function On({template:e,stores:t,t:r,onClose:n,onDone:o}){const a=p.useMemo(()=>Y(t(),e.source),[t,e.source]),i=a!==null&&V(a);return s.jsxs(s.Fragment,{children:[s.jsxs(z,{children:[s.jsx(q,{children:r("dialog.remove.title")}),s.jsx(K,{children:r(e.source==="project"?"dialog.remove.description.project":"dialog.remove.description.local",{name:e.name})})]}),s.jsxs(U,{children:[s.jsx(N,{variant:"outline",onClick:n,children:r("action.cancel")}),s.jsx(N,{variant:"destructive","data-testid":"button-remove",disabled:!i,onClick:()=>{a!==null&&(Gt(a,e).then(o),n())},children:r("action.remove")})]})]})}function Fn({host:e,stores:t,refresh:r}){const n=e.useTranslate(),o=e.useActiveDocument(),[a,i]=p.useState([]),[l,c]=p.useState(null),[u,d]=p.useState({}),[h,v]=p.useState(null),[g,w]=p.useState(null),y=p.useCallback(()=>{je(t()).then(i)},[t]);p.useEffect(()=>{y();const f=e.onDidChangeKit(y),j=r?.subscribe(y)??null;return()=>{f.dispose(),j?.dispose()}},[e,r,y]);const x=p.useMemo(()=>Xt.map(f=>[f,a.filter(j=>j.source===f)]).filter(([,f])=>f.length>0),[a]),E=p.useCallback(f=>{const j=Y(t(),f);return{renamable:j!==null&&B(j),removable:j!==null&&V(j)}},[t]),H=p.useCallback(f=>{w(f),y()},[y]);return s.jsxs("div",{className:"flex w-full min-w-0 flex-col",children:[g===null?null:s.jsx(jt,{variant:g.ok?"default":"destructive",className:"rounded-none border-x-0",children:s.jsx(wt,{className:"text-[11px]",children:n(g.messageKey,g.params)})}),s.jsx("div",{className:"w-full py-1",children:x.length===0?s.jsxs("div",{className:"text-muted-foreground px-3 py-3 text-[11px] leading-relaxed",children:[s.jsx("div",{className:"text-foreground text-[12px] font-medium",children:n("empty.none")}),s.jsx("div",{className:"mt-1",children:n("empty.none.detail")})]}):x.map(([f,j])=>s.jsx(Cn,{source:f,templates:j,open:u[f]!==!0,selected:l,abilities:E(f),t:n,onToggle:()=>d(O=>({...O,[f]:O[f]!==!0})),onSelect:c,onCommand:v},f))}),s.jsx(Nn,{dialog:h,host:e,documentId:o,stores:t,t:n,onClose:()=>v(null),onDone:H})]})}function Cn({source:e,templates:t,open:r,selected:n,abilities:o,t:a,onToggle:i,onSelect:l,onCommand:c}){return s.jsxs("div",{className:"border-border border-b last:border-b-0",children:[s.jsxs(N,{variant:"ghost",size:"sm","aria-expanded":r,"data-testid":`template-group-${e}`,className:"text-muted-foreground hover:text-foreground h-7 w-full justify-start gap-1.5 rounded-none px-3 text-[10px] font-semibold tracking-wider uppercase",onClick:i,children:[s.jsx(fe,{"aria-hidden":"true",className:r?"size-3 flex-none rotate-90":"size-3 flex-none"}),s.jsx("span",{className:"min-w-0 flex-1 truncate text-left",children:a(`group.${e}`)}),s.jsx("span",{className:"text-muted-foreground/50 flex-none font-mono text-[10px] font-normal",children:t.length})]}),r?s.jsx("div",{className:"flex flex-col px-1 pb-1.5",children:t.map(u=>s.jsx(_n,{template:u,active:u.id===n,abilities:o,t:a,onSelect:l,onCommand:c},`${e}:${u.id}`))}):null]})}function _n({template:e,active:t,abilities:r,t:n,onSelect:o,onCommand:a}){const i=()=>a({kind:"generate",template:e});return s.jsxs(Qe,{children:[s.jsx(et,{asChild:!0,children:s.jsxs(tt,{size:"sm",role:"button",tabIndex:0,"aria-pressed":t,"data-testid":`template-row-${e.source}-${e.id}`,title:`${e.description??e.name} · ${n("template.files",{count:e.files.length})}`,className:t?"bg-accent text-accent-foreground h-6 cursor-pointer gap-1.5 rounded-md border-0 px-2 py-0 text-[12px]":"hover:bg-accent/50 h-6 cursor-pointer gap-1.5 rounded-md border-0 px-2 py-0 text-[12px]",onClick:()=>{o(e.id),i()},onKeyDown:l=>{l.key!=="Enter"&&l.key!==" "||(l.preventDefault(),o(e.id),i())},children:[s.jsx(nt,{className:"size-3.5 shrink-0",children:s.jsx(xt,{"aria-hidden":"true",className:"text-primary size-3.5"})}),s.jsx(rt,{className:"min-w-0 gap-0",children:s.jsx(ot,{className:"truncate text-[12px] font-normal",children:e.name})})]})}),s.jsxs(at,{className:"w-52",children:[s.jsx(L,{onClick:i,children:n("menu.generate")}),r.renamable||r.removable?s.jsx(it,{}):null,r.renamable?s.jsx(L,{onClick:()=>a({kind:"rename",template:e}),children:n("menu.rename")}):null,r.removable?s.jsx(L,{className:"text-destructive focus:text-destructive",onClick:()=>a({kind:"remove",template:e}),children:n("action.remove")}):null]})]})}const Dn="templates.panel",Rn="panel.left",An=()=>p.createElement(bt,{className:"size-4"}),$n=()=>!0;function Pn(e,t,r,n){return{id:Dn,slot:r,titleKey:"panel.title",icon:An,when:$n,order:30,Body:()=>p.createElement(Fn,{host:e,stores:t,refresh:n}),Actions:()=>p.createElement(Sn,{host:e,refresh:n})}}function Jn(e={}){const t=e.storePoint??Et,r=e.slot??Rn;return st({id:S,activate(n){const o=e.host??vn(n,e.gaps);for(const[g,w]of Object.entries(tn))n.i18n.contribute(g,w);const a=fn({print:e.print??yn(n),...e.print===void 0?{ready:()=>xn(n)}:{}}),i=kn(o),l=jn(o.local);n.subscriptions.push(n.extensions.contribute(t,a,{id:"templates.store.builtin",order:10}),n.extensions.contribute(t,i,{id:"templates.store.project",order:20}),n.extensions.contribute(t,l,{id:"templates.store.local",order:30}));const c=()=>n.extensions.get(t).map(g=>g.value),u={host:o,stores:c,prompt:n.services.get(ct)??null,notifications:n.services.get(lt)??null},d=Yt(c);d.refresh(),n.subscriptions.push(o.onDidChangeKit(()=>{d.refresh()}));for(const g of Zt(u,d))n.subscriptions.push(n.commands.register(g));for(const g of Ht(d))n.subscriptions.push(n.extensions.contribute(ut,g.value,{id:g.id}));const h=nn(),v=Pn(o,c,r,h);n.subscriptions.push(n.extensions.contribute(dt,v,{id:v.id}))}})}export{R as BUILTIN_BASE_NAME,Rn as DEFAULT_TEMPLATES_SLOT,rn as SIMPLE_TEMPLATE_ID,Xt as SOURCE_ORDER,wn as TEMPLATES_DIR,tn as TEMPLATES_MESSAGES,Dn as TEMPLATES_PANEL_ID,S as TEMPLATES_PLUGIN_ID,C as TEMPLATE_MANIFEST,Nt as TEMPLATE_MANIFEST_VERSION,W as TOKENS,Et as TemplateStorePoint,on as WIZARD_TEMPLATE_ID,At as buildTemplateFiles,Ct as buildTemplateView,V as canRemove,pe as canSave,B as canUpdate,ge as commonDirPrefix,fn as createBuiltinStore,jn as createLocalStore,kn as createProjectStore,Ut as createTemplateFromDirectory,Jn as createTemplatesPlugin,nn as createTemplatesRefresh,ye as formSchemaFileOf,be as generateFormFromTemplate,xn as hasPrinter,Gn as hasTokens,he as isTextFile,je as listTemplates,ie as materialize,Pt as materializeFiles,J as nameVariants,$n as panelVisible,Gt as removeTemplate,Wt as renameTemplate,_t as renderTemplateFile,ve as resolvePicked,X as splitWords,Y as storeOf,Xn as suggestBaseName,$t as templateSlug,Pn as templatesPanel,yn as templatesPrinter,vn as templatesWorkspace,I as toCase,_ as tokenize};
@@ -0,0 +1,8 @@
1
+ import{bE as an}from"../js/index-C4LjLCAZ.js";function on(e,n){for(var S=0;S<n.length;S++){const d=n[S];if(typeof d!="string"&&!Array.isArray(d)){for(const b in d)if(b!=="default"&&!(b in e)){const s=Object.getOwnPropertyDescriptor(d,b);s&&Object.defineProperty(e,b,s.get?s:{enumerable:!0,get:()=>d[b]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var ke={exports:{}},bt={},he={},ge={},Et={},St={},Pt={},Dt;function ht(){return Dt||(Dt=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class n{}e._CodeOrName=n,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class S extends n{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=S;class d extends n{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((o,h)=>`${o}${h}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((o,h)=>(h instanceof S&&(o[h.str]=(o[h.str]||0)+1),o),{})}}e._Code=d,e.nil=new d("");function b(i,...t){const o=[i[0]];let h=0;for(;h<t.length;)l(o,t[h]),o.push(i[++h]);return new d(o)}e._=b;const s=new d("+");function f(i,...t){const o=[y(i[0])];let h=0;for(;h<t.length;)o.push(s),l(o,t[h]),o.push(s,y(i[++h]));return m(o),new d(o)}e.str=f;function l(i,t){t instanceof d?i.push(...t._items):t instanceof S?i.push(t):i.push(P(t))}e.addCodeArg=l;function m(i){let t=1;for(;t<i.length-1;){if(i[t]===s){const o=$(i[t-1],i[t+1]);if(o!==void 0){i.splice(t-1,3,o);continue}i[t++]="+"}t++}}function $(i,t){if(t==='""')return i;if(i==='""')return t;if(typeof i=="string")return t instanceof S||i[i.length-1]!=='"'?void 0:typeof t!="string"?`${i.slice(0,-1)}${t}"`:t[0]==='"'?i.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(i instanceof S))return`"${i}${t.slice(1)}`}function _(i,t){return t.emptyStr()?i:i.emptyStr()?t:f`${i}${t}`}e.strConcat=_;function P(i){return typeof i=="number"||typeof i=="boolean"||i===null?i:y(Array.isArray(i)?i.join(","):i)}function v(i){return new d(y(i))}e.stringify=v;function y(i){return JSON.stringify(i).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=y;function p(i){return typeof i=="string"&&e.IDENTIFIER.test(i)?new d(`.${i}`):b`[${i}]`}e.getProperty=p;function w(i){if(typeof i=="string"&&e.IDENTIFIER.test(i))return new d(`${i}`);throw new Error(`CodeGen: invalid export name: ${i}, use explicit $id name mapping`)}e.getEsmExportName=w;function a(i){return new d(i.toString())}e.regexpCode=a})(Pt)),Pt}var Nt={},Vt;function Ut(){return Vt||(Vt=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const n=ht();class S extends Error{constructor($){super(`CodeGen: "code" for ${$} not defined`),this.value=$.value}}var d;(function(m){m[m.Started=0]="Started",m[m.Completed=1]="Completed"})(d||(e.UsedValueState=d={})),e.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class b{constructor({prefixes:$,parent:_}={}){this._names={},this._prefixes=$,this._parent=_}toName($){return $ instanceof n.Name?$:this.name($)}name($){return new n.Name(this._newName($))}_newName($){const _=this._names[$]||this._nameGroup($);return`${$}${_.index++}`}_nameGroup($){var _,P;if(!((P=(_=this._parent)===null||_===void 0?void 0:_._prefixes)===null||P===void 0)&&P.has($)||this._prefixes&&!this._prefixes.has($))throw new Error(`CodeGen: prefix "${$}" is not allowed in this scope`);return this._names[$]={prefix:$,index:0}}}e.Scope=b;class s extends n.Name{constructor($,_){super(_),this.prefix=$}setValue($,{property:_,itemIndex:P}){this.value=$,this.scopePath=(0,n._)`.${new n.Name(_)}[${P}]`}}e.ValueScopeName=s;const f=(0,n._)`\n`;class l extends b{constructor($){super($),this._values={},this._scope=$.scope,this.opts={...$,_n:$.lines?f:n.nil}}get(){return this._scope}name($){return new s($,this._newName($))}value($,_){var P;if(_.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const v=this.toName($),{prefix:y}=v,p=(P=_.key)!==null&&P!==void 0?P:_.ref;let w=this._values[y];if(w){const t=w.get(p);if(t)return t}else w=this._values[y]=new Map;w.set(p,v);const a=this._scope[y]||(this._scope[y]=[]),i=a.length;return a[i]=_.ref,v.setValue(_,{property:y,itemIndex:i}),v}getValue($,_){const P=this._values[$];if(P)return P.get(_)}scopeRefs($,_=this._values){return this._reduceValues(_,P=>{if(P.scopePath===void 0)throw new Error(`CodeGen: name "${P}" has no value`);return(0,n._)`${$}${P.scopePath}`})}scopeCode($=this._values,_,P){return this._reduceValues($,v=>{if(v.value===void 0)throw new Error(`CodeGen: name "${v}" has no value`);return v.value.code},_,P)}_reduceValues($,_,P={},v){let y=n.nil;for(const p in $){const w=$[p];if(!w)continue;const a=P[p]=P[p]||new Map;w.forEach(i=>{if(a.has(i))return;a.set(i,d.Started);let t=_(i);if(t){const o=this.opts.es5?e.varKinds.var:e.varKinds.const;y=(0,n._)`${y}${o} ${i} = ${t};${this.opts._n}`}else if(t=v?.(i))y=(0,n._)`${y}${t}${this.opts._n}`;else throw new S(i);a.set(i,d.Completed)})}return y}}e.ValueScope=l})(Nt)),Nt}var zt;function J(){return zt||(zt=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const n=ht(),S=Ut();var d=ht();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return d.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return d.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return d.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return d.Name}});var b=Ut();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return b.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return b.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return b.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return b.varKinds}}),e.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class s{optimizeNodes(){return this}optimizeNames(u,E){return this}}class f extends s{constructor(u,E,I){super(),this.varKind=u,this.name=E,this.rhs=I}render({es5:u,_n:E}){const I=u?S.varKinds.var:this.varKind,U=this.rhs===void 0?"":` = ${this.rhs}`;return`${I} ${this.name}${U};`+E}optimizeNames(u,E){if(u[this.name.str])return this.rhs&&(this.rhs=B(this.rhs,u,E)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class l extends s{constructor(u,E,I){super(),this.lhs=u,this.rhs=E,this.sideEffects=I}render({_n:u}){return`${this.lhs} = ${this.rhs};`+u}optimizeNames(u,E){if(!(this.lhs instanceof n.Name&&!u[this.lhs.str]&&!this.sideEffects))return this.rhs=B(this.rhs,u,E),this}get names(){const u=this.lhs instanceof n.Name?{}:{...this.lhs.names};return K(u,this.rhs)}}class m extends l{constructor(u,E,I,U){super(u,I,U),this.op=E}render({_n:u}){return`${this.lhs} ${this.op}= ${this.rhs};`+u}}class $ extends s{constructor(u){super(),this.label=u,this.names={}}render({_n:u}){return`${this.label}:`+u}}class _ extends s{constructor(u){super(),this.label=u,this.names={}}render({_n:u}){return`break${this.label?` ${this.label}`:""};`+u}}class P extends s{constructor(u){super(),this.error=u}render({_n:u}){return`throw ${this.error};`+u}get names(){return this.error.names}}class v extends s{constructor(u){super(),this.code=u}render({_n:u}){return`${this.code};`+u}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(u,E){return this.code=B(this.code,u,E),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class y extends s{constructor(u=[]){super(),this.nodes=u}render(u){return this.nodes.reduce((E,I)=>E+I.render(u),"")}optimizeNodes(){const{nodes:u}=this;let E=u.length;for(;E--;){const I=u[E].optimizeNodes();Array.isArray(I)?u.splice(E,1,...I):I?u[E]=I:u.splice(E,1)}return u.length>0?this:void 0}optimizeNames(u,E){const{nodes:I}=this;let U=I.length;for(;U--;){const F=I[U];F.optimizeNames(u,E)||(x(u,F.names),I.splice(U,1))}return I.length>0?this:void 0}get names(){return this.nodes.reduce((u,E)=>L(u,E.names),{})}}class p extends y{render(u){return"{"+u._n+super.render(u)+"}"+u._n}}class w extends y{}class a extends p{}a.kind="else";class i extends p{constructor(u,E){super(E),this.condition=u}render(u){let E=`if(${this.condition})`+super.render(u);return this.else&&(E+="else "+this.else.render(u)),E}optimizeNodes(){super.optimizeNodes();const u=this.condition;if(u===!0)return this.nodes;let E=this.else;if(E){const I=E.optimizeNodes();E=this.else=Array.isArray(I)?new a(I):I}if(E)return u===!1?E instanceof i?E:E.nodes:this.nodes.length?this:new i(de(u),E instanceof i?[E]:E.nodes);if(!(u===!1||!this.nodes.length))return this}optimizeNames(u,E){var I;if(this.else=(I=this.else)===null||I===void 0?void 0:I.optimizeNames(u,E),!!(super.optimizeNames(u,E)||this.else))return this.condition=B(this.condition,u,E),this}get names(){const u=super.names;return K(u,this.condition),this.else&&L(u,this.else.names),u}}i.kind="if";class t extends p{}t.kind="for";class o extends t{constructor(u){super(),this.iteration=u}render(u){return`for(${this.iteration})`+super.render(u)}optimizeNames(u,E){if(super.optimizeNames(u,E))return this.iteration=B(this.iteration,u,E),this}get names(){return L(super.names,this.iteration.names)}}class h extends t{constructor(u,E,I,U){super(),this.varKind=u,this.name=E,this.from=I,this.to=U}render(u){const E=u.es5?S.varKinds.var:this.varKind,{name:I,from:U,to:F}=this;return`for(${E} ${I}=${U}; ${I}<${F}; ${I}++)`+super.render(u)}get names(){const u=K(super.names,this.from);return K(u,this.to)}}class r extends t{constructor(u,E,I,U){super(),this.loop=u,this.varKind=E,this.name=I,this.iterable=U}render(u){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(u)}optimizeNames(u,E){if(super.optimizeNames(u,E))return this.iterable=B(this.iterable,u,E),this}get names(){return L(super.names,this.iterable.names)}}class c extends p{constructor(u,E,I){super(),this.name=u,this.args=E,this.async=I}render(u){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(u)}}c.kind="func";class g extends y{render(u){return"return "+super.render(u)}}g.kind="return";class j extends p{render(u){let E="try"+super.render(u);return this.catch&&(E+=this.catch.render(u)),this.finally&&(E+=this.finally.render(u)),E}optimizeNodes(){var u,E;return super.optimizeNodes(),(u=this.catch)===null||u===void 0||u.optimizeNodes(),(E=this.finally)===null||E===void 0||E.optimizeNodes(),this}optimizeNames(u,E){var I,U;return super.optimizeNames(u,E),(I=this.catch)===null||I===void 0||I.optimizeNames(u,E),(U=this.finally)===null||U===void 0||U.optimizeNames(u,E),this}get names(){const u=super.names;return this.catch&&L(u,this.catch.names),this.finally&&L(u,this.finally.names),u}}class C extends p{constructor(u){super(),this.error=u}render(u){return`catch(${this.error})`+super.render(u)}}C.kind="catch";class D extends p{render(u){return"finally"+super.render(u)}}D.kind="finally";class V{constructor(u,E={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...E,_n:E.lines?`
2
+ `:""},this._extScope=u,this._scope=new S.Scope({parent:u}),this._nodes=[new w]}toString(){return this._root.render(this.opts)}name(u){return this._scope.name(u)}scopeName(u){return this._extScope.name(u)}scopeValue(u,E){const I=this._extScope.value(u,E);return(this._values[I.prefix]||(this._values[I.prefix]=new Set)).add(I),I}getScopeValue(u,E){return this._extScope.getValue(u,E)}scopeRefs(u){return this._extScope.scopeRefs(u,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(u,E,I,U){const F=this._scope.toName(E);return I!==void 0&&U&&(this._constants[F.str]=I),this._leafNode(new f(u,F,I)),F}const(u,E,I){return this._def(S.varKinds.const,u,E,I)}let(u,E,I){return this._def(S.varKinds.let,u,E,I)}var(u,E,I){return this._def(S.varKinds.var,u,E,I)}assign(u,E,I){return this._leafNode(new l(u,E,I))}add(u,E){return this._leafNode(new m(u,e.operators.ADD,E))}code(u){return typeof u=="function"?u():u!==n.nil&&this._leafNode(new v(u)),this}object(...u){const E=["{"];for(const[I,U]of u)E.length>1&&E.push(","),E.push(I),(I!==U||this.opts.es5)&&(E.push(":"),(0,n.addCodeArg)(E,U));return E.push("}"),new n._Code(E)}if(u,E,I){if(this._blockNode(new i(u)),E&&I)this.code(E).else().code(I).endIf();else if(E)this.code(E).endIf();else if(I)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(u){return this._elseNode(new i(u))}else(){return this._elseNode(new a)}endIf(){return this._endBlockNode(i,a)}_for(u,E){return this._blockNode(u),E&&this.code(E).endFor(),this}for(u,E){return this._for(new o(u),E)}forRange(u,E,I,U,F=this.opts.es5?S.varKinds.var:S.varKinds.let){const X=this._scope.toName(u);return this._for(new h(F,X,E,I),()=>U(X))}forOf(u,E,I,U=S.varKinds.const){const F=this._scope.toName(u);if(this.opts.es5){const X=E instanceof n.Name?E:this.var("_arr",E);return this.forRange("_i",0,(0,n._)`${X}.length`,W=>{this.var(F,(0,n._)`${X}[${W}]`),I(F)})}return this._for(new r("of",U,F,E),()=>I(F))}forIn(u,E,I,U=this.opts.es5?S.varKinds.var:S.varKinds.const){if(this.opts.ownProperties)return this.forOf(u,(0,n._)`Object.keys(${E})`,I);const F=this._scope.toName(u);return this._for(new r("in",U,F,E),()=>I(F))}endFor(){return this._endBlockNode(t)}label(u){return this._leafNode(new $(u))}break(u){return this._leafNode(new _(u))}return(u){const E=new g;if(this._blockNode(E),this.code(u),E.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(g)}try(u,E,I){if(!E&&!I)throw new Error('CodeGen: "try" without "catch" and "finally"');const U=new j;if(this._blockNode(U),this.code(u),E){const F=this.name("e");this._currNode=U.catch=new C(F),E(F)}return I&&(this._currNode=U.finally=new D,this.code(I)),this._endBlockNode(C,D)}throw(u){return this._leafNode(new P(u))}block(u,E){return this._blockStarts.push(this._nodes.length),u&&this.code(u).endBlock(E),this}endBlock(u){const E=this._blockStarts.pop();if(E===void 0)throw new Error("CodeGen: not in self-balancing block");const I=this._nodes.length-E;if(I<0||u!==void 0&&I!==u)throw new Error(`CodeGen: wrong number of nodes: ${I} vs ${u} expected`);return this._nodes.length=E,this}func(u,E=n.nil,I,U){return this._blockNode(new c(u,E,I)),U&&this.code(U).endFunc(),this}endFunc(){return this._endBlockNode(c)}optimize(u=1){for(;u-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(u){return this._currNode.nodes.push(u),this}_blockNode(u){this._currNode.nodes.push(u),this._nodes.push(u)}_endBlockNode(u,E){const I=this._currNode;if(I instanceof u||E&&I instanceof E)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${E?`${u.kind}/${E.kind}`:u.kind}"`)}_elseNode(u){const E=this._currNode;if(!(E instanceof i))throw new Error('CodeGen: "else" without "if"');return this._currNode=E.else=u,this}get _root(){return this._nodes[0]}get _currNode(){const u=this._nodes;return u[u.length-1]}set _currNode(u){const E=this._nodes;E[E.length-1]=u}}e.CodeGen=V;function L(k,u){for(const E in u)k[E]=(k[E]||0)+(u[E]||0);return k}function K(k,u){return u instanceof n._CodeOrName?L(k,u.names):k}function B(k,u,E){if(k instanceof n.Name)return I(k);if(!U(k))return k;return new n._Code(k._items.reduce((F,X)=>(X instanceof n.Name&&(X=I(X)),X instanceof n._Code?F.push(...X._items):F.push(X),F),[]));function I(F){const X=E[F.str];return X===void 0||u[F.str]!==1?F:(delete u[F.str],X)}function U(F){return F instanceof n._Code&&F._items.some(X=>X instanceof n.Name&&u[X.str]===1&&E[X.str]!==void 0)}}function x(k,u){for(const E in u)k[E]=(k[E]||0)-(u[E]||0)}function de(k){return typeof k=="boolean"||typeof k=="number"||k===null?!k:(0,n._)`!${T(k)}`}e.not=de;const fe=R(e.operators.AND);function Z(...k){return k.reduce(fe)}e.and=Z;const ye=R(e.operators.OR);function A(...k){return k.reduce(ye)}e.or=A;function R(k){return(u,E)=>u===n.nil?E:E===n.nil?u:(0,n._)`${T(u)} ${k} ${T(E)}`}function T(k){return k instanceof n.Name?k:(0,n._)`(${k})`}})(St)),St}var H={},Ft;function Q(){if(Ft)return H;Ft=1,Object.defineProperty(H,"__esModule",{value:!0}),H.checkStrictMode=H.getErrorPath=H.Type=H.useFunc=H.setEvaluated=H.evaluatedPropsToName=H.mergeEvaluated=H.eachItem=H.unescapeJsonPointer=H.escapeJsonPointer=H.escapeFragment=H.unescapeFragment=H.schemaRefOrVal=H.schemaHasRulesButRef=H.schemaHasRules=H.checkUnknownRules=H.alwaysValidSchema=H.toHash=void 0;const e=J(),n=ht();function S(r){const c={};for(const g of r)c[g]=!0;return c}H.toHash=S;function d(r,c){return typeof c=="boolean"?c:Object.keys(c).length===0?!0:(b(r,c),!s(c,r.self.RULES.all))}H.alwaysValidSchema=d;function b(r,c=r.schema){const{opts:g,self:j}=r;if(!g.strictSchema||typeof c=="boolean")return;const C=j.RULES.keywords;for(const D in c)C[D]||h(r,`unknown keyword: "${D}"`)}H.checkUnknownRules=b;function s(r,c){if(typeof r=="boolean")return!r;for(const g in r)if(c[g])return!0;return!1}H.schemaHasRules=s;function f(r,c){if(typeof r=="boolean")return!r;for(const g in r)if(g!=="$ref"&&c.all[g])return!0;return!1}H.schemaHasRulesButRef=f;function l({topSchemaRef:r,schemaPath:c},g,j,C){if(!C){if(typeof g=="number"||typeof g=="boolean")return g;if(typeof g=="string")return(0,e._)`${g}`}return(0,e._)`${r}${c}${(0,e.getProperty)(j)}`}H.schemaRefOrVal=l;function m(r){return P(decodeURIComponent(r))}H.unescapeFragment=m;function $(r){return encodeURIComponent(_(r))}H.escapeFragment=$;function _(r){return typeof r=="number"?`${r}`:r.replace(/~/g,"~0").replace(/\//g,"~1")}H.escapeJsonPointer=_;function P(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}H.unescapeJsonPointer=P;function v(r,c){if(Array.isArray(r))for(const g of r)c(g);else c(r)}H.eachItem=v;function y({mergeNames:r,mergeToName:c,mergeValues:g,resultToName:j}){return(C,D,V,L)=>{const K=V===void 0?D:V instanceof e.Name?(D instanceof e.Name?r(C,D,V):c(C,D,V),V):D instanceof e.Name?(c(C,V,D),D):g(D,V);return L===e.Name&&!(K instanceof e.Name)?j(C,K):K}}H.mergeEvaluated={props:y({mergeNames:(r,c,g)=>r.if((0,e._)`${g} !== true && ${c} !== undefined`,()=>{r.if((0,e._)`${c} === true`,()=>r.assign(g,!0),()=>r.assign(g,(0,e._)`${g} || {}`).code((0,e._)`Object.assign(${g}, ${c})`))}),mergeToName:(r,c,g)=>r.if((0,e._)`${g} !== true`,()=>{c===!0?r.assign(g,!0):(r.assign(g,(0,e._)`${g} || {}`),w(r,g,c))}),mergeValues:(r,c)=>r===!0?!0:{...r,...c},resultToName:p}),items:y({mergeNames:(r,c,g)=>r.if((0,e._)`${g} !== true && ${c} !== undefined`,()=>r.assign(g,(0,e._)`${c} === true ? true : ${g} > ${c} ? ${g} : ${c}`)),mergeToName:(r,c,g)=>r.if((0,e._)`${g} !== true`,()=>r.assign(g,c===!0?!0:(0,e._)`${g} > ${c} ? ${g} : ${c}`)),mergeValues:(r,c)=>r===!0?!0:Math.max(r,c),resultToName:(r,c)=>r.var("items",c)})};function p(r,c){if(c===!0)return r.var("props",!0);const g=r.var("props",(0,e._)`{}`);return c!==void 0&&w(r,g,c),g}H.evaluatedPropsToName=p;function w(r,c,g){Object.keys(g).forEach(j=>r.assign((0,e._)`${c}${(0,e.getProperty)(j)}`,!0))}H.setEvaluated=w;const a={};function i(r,c){return r.scopeValue("func",{ref:c,code:a[c.code]||(a[c.code]=new n._Code(c.code))})}H.useFunc=i;var t;(function(r){r[r.Num=0]="Num",r[r.Str=1]="Str"})(t||(H.Type=t={}));function o(r,c,g){if(r instanceof e.Name){const j=c===t.Num;return g?j?(0,e._)`"[" + ${r} + "]"`:(0,e._)`"['" + ${r} + "']"`:j?(0,e._)`"/" + ${r}`:(0,e._)`"/" + ${r}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return g?(0,e.getProperty)(r).toString():"/"+_(r)}H.getErrorPath=o;function h(r,c,g=r.opts.strictSchema){if(g){if(c=`strict mode: ${c}`,g===!0)throw new Error(c);r.self.logger.warn(c)}}return H.checkStrictMode=h,H}var je={},Kt;function ve(){if(Kt)return je;Kt=1,Object.defineProperty(je,"__esModule",{value:!0});const e=J(),n={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return je.default=n,je}var Lt;function pt(){return Lt||(Lt=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const n=J(),S=Q(),d=ve();e.keywordError={message:({keyword:a})=>(0,n.str)`must pass "${a}" keyword validation`},e.keyword$DataError={message:({keyword:a,schemaType:i})=>i?(0,n.str)`"${a}" keyword must be ${i} ($data)`:(0,n.str)`"${a}" keyword is invalid ($data)`};function b(a,i=e.keywordError,t,o){const{it:h}=a,{gen:r,compositeRule:c,allErrors:g}=h,j=P(a,i,t);o??(c||g)?m(r,j):$(h,(0,n._)`[${j}]`)}e.reportError=b;function s(a,i=e.keywordError,t){const{it:o}=a,{gen:h,compositeRule:r,allErrors:c}=o,g=P(a,i,t);m(h,g),r||c||$(o,d.default.vErrors)}e.reportExtraError=s;function f(a,i){a.assign(d.default.errors,i),a.if((0,n._)`${d.default.vErrors} !== null`,()=>a.if(i,()=>a.assign((0,n._)`${d.default.vErrors}.length`,i),()=>a.assign(d.default.vErrors,null)))}e.resetErrorsCount=f;function l({gen:a,keyword:i,schemaValue:t,data:o,errsCount:h,it:r}){if(h===void 0)throw new Error("ajv implementation error");const c=a.name("err");a.forRange("i",h,d.default.errors,g=>{a.const(c,(0,n._)`${d.default.vErrors}[${g}]`),a.if((0,n._)`${c}.instancePath === undefined`,()=>a.assign((0,n._)`${c}.instancePath`,(0,n.strConcat)(d.default.instancePath,r.errorPath))),a.assign((0,n._)`${c}.schemaPath`,(0,n.str)`${r.errSchemaPath}/${i}`),r.opts.verbose&&(a.assign((0,n._)`${c}.schema`,t),a.assign((0,n._)`${c}.data`,o))})}e.extendErrors=l;function m(a,i){const t=a.const("err",i);a.if((0,n._)`${d.default.vErrors} === null`,()=>a.assign(d.default.vErrors,(0,n._)`[${t}]`),(0,n._)`${d.default.vErrors}.push(${t})`),a.code((0,n._)`${d.default.errors}++`)}function $(a,i){const{gen:t,validateName:o,schemaEnv:h}=a;h.$async?t.throw((0,n._)`new ${a.ValidationError}(${i})`):(t.assign((0,n._)`${o}.errors`,i),t.return(!1))}const _={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function P(a,i,t){const{createErrors:o}=a.it;return o===!1?(0,n._)`{}`:v(a,i,t)}function v(a,i,t={}){const{gen:o,it:h}=a,r=[y(h,t),p(a,t)];return w(a,i,r),o.object(...r)}function y({errorPath:a},{instancePath:i}){const t=i?(0,n.str)`${a}${(0,S.getErrorPath)(i,S.Type.Str)}`:a;return[d.default.instancePath,(0,n.strConcat)(d.default.instancePath,t)]}function p({keyword:a,it:{errSchemaPath:i}},{schemaPath:t,parentSchema:o}){let h=o?i:(0,n.str)`${i}/${a}`;return t&&(h=(0,n.str)`${h}${(0,S.getErrorPath)(t,S.Type.Str)}`),[_.schemaPath,h]}function w(a,{params:i,message:t},o){const{keyword:h,data:r,schemaValue:c,it:g}=a,{opts:j,propertyName:C,topSchemaRef:D,schemaPath:V}=g;o.push([_.keyword,h],[_.params,typeof i=="function"?i(a):i||(0,n._)`{}`]),j.messages&&o.push([_.message,typeof t=="function"?t(a):t]),j.verbose&&o.push([_.schema,c],[_.parentSchema,(0,n._)`${D}${V}`],[d.default.data,r]),C&&o.push([_.propertyName,C])}})(Et)),Et}var Ht;function un(){if(Ht)return ge;Ht=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.boolOrEmptySchema=ge.topBoolOrEmptySchema=void 0;const e=pt(),n=J(),S=ve(),d={message:"boolean schema is false"};function b(l){const{gen:m,schema:$,validateName:_}=l;$===!1?f(l,!1):typeof $=="object"&&$.$async===!0?m.return(S.default.data):(m.assign((0,n._)`${_}.errors`,null),m.return(!0))}ge.topBoolOrEmptySchema=b;function s(l,m){const{gen:$,schema:_}=l;_===!1?($.var(m,!1),f(l)):$.var(m,!0)}ge.boolOrEmptySchema=s;function f(l,m){const{gen:$,data:_}=l,P={gen:$,keyword:"false schema",data:_,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:l};(0,e.reportError)(P,d,void 0,m)}return ge}var re={},$e={},Gt;function Xr(){if(Gt)return $e;Gt=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.getRules=$e.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],n=new Set(e);function S(b){return typeof b=="string"&&n.has(b)}$e.isJSONType=S;function d(){const b={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...b,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},b.number,b.string,b.array,b.object],post:{rules:[]},all:{},keywords:{}}}return $e.getRules=d,$e}var me={},Jt;function Yr(){if(Jt)return me;Jt=1,Object.defineProperty(me,"__esModule",{value:!0}),me.shouldUseRule=me.shouldUseGroup=me.schemaHasRulesForType=void 0;function e({schema:d,self:b},s){const f=b.RULES.types[s];return f&&f!==!0&&n(d,f)}me.schemaHasRulesForType=e;function n(d,b){return b.rules.some(s=>S(d,s))}me.shouldUseGroup=n;function S(d,b){var s;return d[b.keyword]!==void 0||((s=b.definition.implements)===null||s===void 0?void 0:s.some(f=>d[f]!==void 0))}return me.shouldUseRule=S,me}var Wt;function mt(){if(Wt)return re;Wt=1,Object.defineProperty(re,"__esModule",{value:!0}),re.reportTypeError=re.checkDataTypes=re.checkDataType=re.coerceAndCheckDataType=re.getJSONTypes=re.getSchemaTypes=re.DataType=void 0;const e=Xr(),n=Yr(),S=pt(),d=J(),b=Q();var s;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(s||(re.DataType=s={}));function f(t){const o=l(t.type);if(o.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!o.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&o.push("null")}return o}re.getSchemaTypes=f;function l(t){const o=Array.isArray(t)?t:t?[t]:[];if(o.every(e.isJSONType))return o;throw new Error("type must be JSONType or JSONType[]: "+o.join(","))}re.getJSONTypes=l;function m(t,o){const{gen:h,data:r,opts:c}=t,g=_(o,c.coerceTypes),j=o.length>0&&!(g.length===0&&o.length===1&&(0,n.schemaHasRulesForType)(t,o[0]));if(j){const C=p(o,r,c.strictNumbers,s.Wrong);h.if(C,()=>{g.length?P(t,o,g):a(t)})}return j}re.coerceAndCheckDataType=m;const $=new Set(["string","number","integer","boolean","null"]);function _(t,o){return o?t.filter(h=>$.has(h)||o==="array"&&h==="array"):[]}function P(t,o,h){const{gen:r,data:c,opts:g}=t,j=r.let("dataType",(0,d._)`typeof ${c}`),C=r.let("coerced",(0,d._)`undefined`);g.coerceTypes==="array"&&r.if((0,d._)`${j} == 'object' && Array.isArray(${c}) && ${c}.length == 1`,()=>r.assign(c,(0,d._)`${c}[0]`).assign(j,(0,d._)`typeof ${c}`).if(p(o,c,g.strictNumbers),()=>r.assign(C,c))),r.if((0,d._)`${C} !== undefined`);for(const V of h)($.has(V)||V==="array"&&g.coerceTypes==="array")&&D(V);r.else(),a(t),r.endIf(),r.if((0,d._)`${C} !== undefined`,()=>{r.assign(c,C),v(t,C)});function D(V){switch(V){case"string":r.elseIf((0,d._)`${j} == "number" || ${j} == "boolean"`).assign(C,(0,d._)`"" + ${c}`).elseIf((0,d._)`${c} === null`).assign(C,(0,d._)`""`);return;case"number":r.elseIf((0,d._)`${j} == "boolean" || ${c} === null
3
+ || (${j} == "string" && ${c} && ${c} == +${c})`).assign(C,(0,d._)`+${c}`);return;case"integer":r.elseIf((0,d._)`${j} === "boolean" || ${c} === null
4
+ || (${j} === "string" && ${c} && ${c} == +${c} && !(${c} % 1))`).assign(C,(0,d._)`+${c}`);return;case"boolean":r.elseIf((0,d._)`${c} === "false" || ${c} === 0 || ${c} === null`).assign(C,!1).elseIf((0,d._)`${c} === "true" || ${c} === 1`).assign(C,!0);return;case"null":r.elseIf((0,d._)`${c} === "" || ${c} === 0 || ${c} === false`),r.assign(C,null);return;case"array":r.elseIf((0,d._)`${j} === "string" || ${j} === "number"
5
+ || ${j} === "boolean" || ${c} === null`).assign(C,(0,d._)`[${c}]`)}}}function v({gen:t,parentData:o,parentDataProperty:h},r){t.if((0,d._)`${o} !== undefined`,()=>t.assign((0,d._)`${o}[${h}]`,r))}function y(t,o,h,r=s.Correct){const c=r===s.Correct?d.operators.EQ:d.operators.NEQ;let g;switch(t){case"null":return(0,d._)`${o} ${c} null`;case"array":g=(0,d._)`Array.isArray(${o})`;break;case"object":g=(0,d._)`${o} && typeof ${o} == "object" && !Array.isArray(${o})`;break;case"integer":g=j((0,d._)`!(${o} % 1) && !isNaN(${o})`);break;case"number":g=j();break;default:return(0,d._)`typeof ${o} ${c} ${t}`}return r===s.Correct?g:(0,d.not)(g);function j(C=d.nil){return(0,d.and)((0,d._)`typeof ${o} == "number"`,C,h?(0,d._)`isFinite(${o})`:d.nil)}}re.checkDataType=y;function p(t,o,h,r){if(t.length===1)return y(t[0],o,h,r);let c;const g=(0,b.toHash)(t);if(g.array&&g.object){const j=(0,d._)`typeof ${o} != "object"`;c=g.null?j:(0,d._)`!${o} || ${j}`,delete g.null,delete g.array,delete g.object}else c=d.nil;g.number&&delete g.integer;for(const j in g)c=(0,d.and)(c,y(j,o,h,r));return c}re.checkDataTypes=p;const w={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:o})=>typeof t=="string"?(0,d._)`{type: ${t}}`:(0,d._)`{type: ${o}}`};function a(t){const o=i(t);(0,S.reportError)(o,w)}re.reportTypeError=a;function i(t){const{gen:o,data:h,schema:r}=t,c=(0,b.schemaRefOrVal)(t,r,"type");return{gen:o,keyword:"type",data:h,schema:r.type,schemaCode:c,schemaValue:c,parentSchema:r,params:{},it:t}}return re}var Ne={},Bt;function cn(){if(Bt)return Ne;Bt=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.assignDefaults=void 0;const e=J(),n=Q();function S(b,s){const{properties:f,items:l}=b.schema;if(s==="object"&&f)for(const m in f)d(b,m,f[m].default);else s==="array"&&Array.isArray(l)&&l.forEach((m,$)=>d(b,$,m.default))}Ne.assignDefaults=S;function d(b,s,f){const{gen:l,compositeRule:m,data:$,opts:_}=b;if(f===void 0)return;const P=(0,e._)`${$}${(0,e.getProperty)(s)}`;if(m){(0,n.checkStrictMode)(b,`default is ignored for: ${P}`);return}let v=(0,e._)`${P} === undefined`;_.useDefaults==="empty"&&(v=(0,e._)`${v} || ${P} === null || ${P} === ""`),l.if(v,(0,e._)`${P} = ${(0,e.stringify)(f)}`)}return Ne}var ce={},Y={},Qt;function le(){if(Qt)return Y;Qt=1,Object.defineProperty(Y,"__esModule",{value:!0}),Y.validateUnion=Y.validateArray=Y.usePattern=Y.callValidateCode=Y.schemaProperties=Y.allSchemaProperties=Y.noPropertyInData=Y.propertyInData=Y.isOwnProperty=Y.hasPropFunc=Y.reportMissingProp=Y.checkMissingProp=Y.checkReportMissingProp=void 0;const e=J(),n=Q(),S=ve(),d=Q();function b(t,o){const{gen:h,data:r,it:c}=t;h.if(_(h,r,o,c.opts.ownProperties),()=>{t.setParams({missingProperty:(0,e._)`${o}`},!0),t.error()})}Y.checkReportMissingProp=b;function s({gen:t,data:o,it:{opts:h}},r,c){return(0,e.or)(...r.map(g=>(0,e.and)(_(t,o,g,h.ownProperties),(0,e._)`${c} = ${g}`)))}Y.checkMissingProp=s;function f(t,o){t.setParams({missingProperty:o},!0),t.error()}Y.reportMissingProp=f;function l(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}Y.hasPropFunc=l;function m(t,o,h){return(0,e._)`${l(t)}.call(${o}, ${h})`}Y.isOwnProperty=m;function $(t,o,h,r){const c=(0,e._)`${o}${(0,e.getProperty)(h)} !== undefined`;return r?(0,e._)`${c} && ${m(t,o,h)}`:c}Y.propertyInData=$;function _(t,o,h,r){const c=(0,e._)`${o}${(0,e.getProperty)(h)} === undefined`;return r?(0,e.or)(c,(0,e.not)(m(t,o,h))):c}Y.noPropertyInData=_;function P(t){return t?Object.keys(t).filter(o=>o!=="__proto__"):[]}Y.allSchemaProperties=P;function v(t,o){return P(o).filter(h=>!(0,n.alwaysValidSchema)(t,o[h]))}Y.schemaProperties=v;function y({schemaCode:t,data:o,it:{gen:h,topSchemaRef:r,schemaPath:c,errorPath:g},it:j},C,D,V){const L=V?(0,e._)`${t}, ${o}, ${r}${c}`:o,K=[[S.default.instancePath,(0,e.strConcat)(S.default.instancePath,g)],[S.default.parentData,j.parentData],[S.default.parentDataProperty,j.parentDataProperty],[S.default.rootData,S.default.rootData]];j.opts.dynamicRef&&K.push([S.default.dynamicAnchors,S.default.dynamicAnchors]);const B=(0,e._)`${L}, ${h.object(...K)}`;return D!==e.nil?(0,e._)`${C}.call(${D}, ${B})`:(0,e._)`${C}(${B})`}Y.callValidateCode=y;const p=(0,e._)`new RegExp`;function w({gen:t,it:{opts:o}},h){const r=o.unicodeRegExp?"u":"",{regExp:c}=o.code,g=c(h,r);return t.scopeValue("pattern",{key:g.toString(),ref:g,code:(0,e._)`${c.code==="new RegExp"?p:(0,d.useFunc)(t,c)}(${h}, ${r})`})}Y.usePattern=w;function a(t){const{gen:o,data:h,keyword:r,it:c}=t,g=o.name("valid");if(c.allErrors){const C=o.let("valid",!0);return j(()=>o.assign(C,!1)),C}return o.var(g,!0),j(()=>o.break()),g;function j(C){const D=o.const("len",(0,e._)`${h}.length`);o.forRange("i",0,D,V=>{t.subschema({keyword:r,dataProp:V,dataPropType:n.Type.Num},g),o.if((0,e.not)(g),C)})}}Y.validateArray=a;function i(t){const{gen:o,schema:h,keyword:r,it:c}=t;if(!Array.isArray(h))throw new Error("ajv implementation error");if(h.some(D=>(0,n.alwaysValidSchema)(c,D))&&!c.opts.unevaluated)return;const j=o.let("valid",!1),C=o.name("_valid");o.block(()=>h.forEach((D,V)=>{const L=t.subschema({keyword:r,schemaProp:V,compositeRule:!0},C);o.assign(j,(0,e._)`${j} || ${C}`),t.mergeValidEvaluated(L,C)||o.if((0,e.not)(j))})),t.result(j,()=>t.reset(),()=>t.error(!0))}return Y.validateUnion=i,Y}var Xt;function ln(){if(Xt)return ce;Xt=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.validateKeywordUsage=ce.validSchemaType=ce.funcKeywordCode=ce.macroKeywordCode=void 0;const e=J(),n=ve(),S=le(),d=pt();function b(v,y){const{gen:p,keyword:w,schema:a,parentSchema:i,it:t}=v,o=y.macro.call(t.self,a,i,t),h=$(p,w,o);t.opts.validateSchema!==!1&&t.self.validateSchema(o,!0);const r=p.name("valid");v.subschema({schema:o,schemaPath:e.nil,errSchemaPath:`${t.errSchemaPath}/${w}`,topSchemaRef:h,compositeRule:!0},r),v.pass(r,()=>v.error(!0))}ce.macroKeywordCode=b;function s(v,y){var p;const{gen:w,keyword:a,schema:i,parentSchema:t,$data:o,it:h}=v;m(h,y);const r=!o&&y.compile?y.compile.call(h.self,i,t,h):y.validate,c=$(w,a,r),g=w.let("valid");v.block$data(g,j),v.ok((p=y.valid)!==null&&p!==void 0?p:g);function j(){if(y.errors===!1)V(),y.modifying&&f(v),L(()=>v.error());else{const K=y.async?C():D();y.modifying&&f(v),L(()=>l(v,K))}}function C(){const K=w.let("ruleErrs",null);return w.try(()=>V((0,e._)`await `),B=>w.assign(g,!1).if((0,e._)`${B} instanceof ${h.ValidationError}`,()=>w.assign(K,(0,e._)`${B}.errors`),()=>w.throw(B))),K}function D(){const K=(0,e._)`${c}.errors`;return w.assign(K,null),V(e.nil),K}function V(K=y.async?(0,e._)`await `:e.nil){const B=h.opts.passContext?n.default.this:n.default.self,x=!("compile"in y&&!o||y.schema===!1);w.assign(g,(0,e._)`${K}${(0,S.callValidateCode)(v,c,B,x)}`,y.modifying)}function L(K){var B;w.if((0,e.not)((B=y.valid)!==null&&B!==void 0?B:g),K)}}ce.funcKeywordCode=s;function f(v){const{gen:y,data:p,it:w}=v;y.if(w.parentData,()=>y.assign(p,(0,e._)`${w.parentData}[${w.parentDataProperty}]`))}function l(v,y){const{gen:p}=v;p.if((0,e._)`Array.isArray(${y})`,()=>{p.assign(n.default.vErrors,(0,e._)`${n.default.vErrors} === null ? ${y} : ${n.default.vErrors}.concat(${y})`).assign(n.default.errors,(0,e._)`${n.default.vErrors}.length`),(0,d.extendErrors)(v)},()=>v.error())}function m({schemaEnv:v},y){if(y.async&&!v.$async)throw new Error("async keyword in sync schema")}function $(v,y,p){if(p===void 0)throw new Error(`keyword "${y}" failed to compile`);return v.scopeValue("keyword",typeof p=="function"?{ref:p}:{ref:p,code:(0,e.stringify)(p)})}function _(v,y,p=!1){return!y.length||y.some(w=>w==="array"?Array.isArray(v):w==="object"?v&&typeof v=="object"&&!Array.isArray(v):typeof v==w||p&&typeof v>"u")}ce.validSchemaType=_;function P({schema:v,opts:y,self:p,errSchemaPath:w},a,i){if(Array.isArray(a.keyword)?!a.keyword.includes(i):a.keyword!==i)throw new Error("ajv implementation error");const t=a.dependencies;if(t?.some(o=>!Object.prototype.hasOwnProperty.call(v,o)))throw new Error(`parent schema must have dependencies of ${i}: ${t.join(",")}`);if(a.validateSchema&&!a.validateSchema(v[i])){const h=`keyword "${i}" value is invalid at path "${w}": `+p.errorsText(a.validateSchema.errors);if(y.validateSchema==="log")p.logger.error(h);else throw new Error(h)}}return ce.validateKeywordUsage=P,ce}var pe={},Yt;function dn(){if(Yt)return pe;Yt=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.extendSubschemaMode=pe.extendSubschemaData=pe.getSubschema=void 0;const e=J(),n=Q();function S(s,{keyword:f,schemaProp:l,schema:m,schemaPath:$,errSchemaPath:_,topSchemaRef:P}){if(f!==void 0&&m!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(f!==void 0){const v=s.schema[f];return l===void 0?{schema:v,schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(f)}`,errSchemaPath:`${s.errSchemaPath}/${f}`}:{schema:v[l],schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(f)}${(0,e.getProperty)(l)}`,errSchemaPath:`${s.errSchemaPath}/${f}/${(0,n.escapeFragment)(l)}`}}if(m!==void 0){if($===void 0||_===void 0||P===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:m,schemaPath:$,topSchemaRef:P,errSchemaPath:_}}throw new Error('either "keyword" or "schema" must be passed')}pe.getSubschema=S;function d(s,f,{dataProp:l,dataPropType:m,data:$,dataTypes:_,propertyName:P}){if($!==void 0&&l!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:v}=f;if(l!==void 0){const{errorPath:p,dataPathArr:w,opts:a}=f,i=v.let("data",(0,e._)`${f.data}${(0,e.getProperty)(l)}`,!0);y(i),s.errorPath=(0,e.str)`${p}${(0,n.getErrorPath)(l,m,a.jsPropertySyntax)}`,s.parentDataProperty=(0,e._)`${l}`,s.dataPathArr=[...w,s.parentDataProperty]}if($!==void 0){const p=$ instanceof e.Name?$:v.let("data",$,!0);y(p),P!==void 0&&(s.propertyName=P)}_&&(s.dataTypes=_);function y(p){s.data=p,s.dataLevel=f.dataLevel+1,s.dataTypes=[],f.definedProperties=new Set,s.parentData=f.data,s.dataNames=[...f.dataNames,p]}}pe.extendSubschemaData=d;function b(s,{jtdDiscriminator:f,jtdMetadata:l,compositeRule:m,createErrors:$,allErrors:_}){m!==void 0&&(s.compositeRule=m),$!==void 0&&(s.createErrors=$),_!==void 0&&(s.allErrors=_),s.jtdDiscriminator=f,s.jtdMetadata=l}return pe.extendSubschemaMode=b,pe}var ne={},Rt,Zt;function Zr(){return Zt||(Zt=1,Rt=function e(n,S){if(n===S)return!0;if(n&&S&&typeof n=="object"&&typeof S=="object"){if(n.constructor!==S.constructor)return!1;var d,b,s;if(Array.isArray(n)){if(d=n.length,d!=S.length)return!1;for(b=d;b--!==0;)if(!e(n[b],S[b]))return!1;return!0}if(n.constructor===RegExp)return n.source===S.source&&n.flags===S.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===S.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===S.toString();if(s=Object.keys(n),d=s.length,d!==Object.keys(S).length)return!1;for(b=d;b--!==0;)if(!Object.prototype.hasOwnProperty.call(S,s[b]))return!1;for(b=d;b--!==0;){var f=s[b];if(!e(n[f],S[f]))return!1}return!0}return n!==n&&S!==S}),Rt}var Ot={exports:{}},xt;function fn(){if(xt)return Ot.exports;xt=1;var e=Ot.exports=function(d,b,s){typeof b=="function"&&(s=b,b={}),s=b.cb||s;var f=typeof s=="function"?s:s.pre||function(){},l=s.post||function(){};n(b,f,l,d,"",d)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function n(d,b,s,f,l,m,$,_,P,v){if(f&&typeof f=="object"&&!Array.isArray(f)){b(f,l,m,$,_,P,v);for(var y in f){var p=f[y];if(Array.isArray(p)){if(y in e.arrayKeywords)for(var w=0;w<p.length;w++)n(d,b,s,p[w],l+"/"+y+"/"+w,m,l,y,f,w)}else if(y in e.propsKeywords){if(p&&typeof p=="object")for(var a in p)n(d,b,s,p[a],l+"/"+y+"/"+S(a),m,l,y,f,a)}else(y in e.keywords||d.allKeys&&!(y in e.skipKeywords))&&n(d,b,s,p,l+"/"+y,m,l,y,f)}s(f,l,m,$,_,P,v)}}function S(d){return d.replace(/~/g,"~0").replace(/\//g,"~1")}return Ot.exports}var er;function yt(){if(er)return ne;er=1,Object.defineProperty(ne,"__esModule",{value:!0}),ne.getSchemaRefs=ne.resolveUrl=ne.normalizeId=ne._getFullPath=ne.getFullPath=ne.inlineRef=void 0;const e=Q(),n=Zr(),S=fn(),d=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function b(w,a=!0){return typeof w=="boolean"?!0:a===!0?!f(w):a?l(w)<=a:!1}ne.inlineRef=b;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function f(w){for(const a in w){if(s.has(a))return!0;const i=w[a];if(Array.isArray(i)&&i.some(f)||typeof i=="object"&&f(i))return!0}return!1}function l(w){let a=0;for(const i in w){if(i==="$ref")return 1/0;if(a++,!d.has(i)&&(typeof w[i]=="object"&&(0,e.eachItem)(w[i],t=>a+=l(t)),a===1/0))return 1/0}return a}function m(w,a="",i){i!==!1&&(a=P(a));const t=w.parse(a);return $(w,t)}ne.getFullPath=m;function $(w,a){return w.serialize(a).split("#")[0]+"#"}ne._getFullPath=$;const _=/#\/?$/;function P(w){return w?w.replace(_,""):""}ne.normalizeId=P;function v(w,a,i){return i=P(i),w.resolve(a,i)}ne.resolveUrl=v;const y=/^[a-z_][-a-z0-9._]*$/i;function p(w,a){if(typeof w=="boolean")return{};const{schemaId:i,uriResolver:t}=this.opts,o=P(w[i]||a),h={"":o},r=m(t,o,!1),c={},g=new Set;return S(w,{allKeys:!0},(D,V,L,K)=>{if(K===void 0)return;const B=r+V;let x=h[K];typeof D[i]=="string"&&(x=de.call(this,D[i])),fe.call(this,D.$anchor),fe.call(this,D.$dynamicAnchor),h[V]=x;function de(Z){const ye=this.opts.uriResolver.resolve;if(Z=P(x?ye(x,Z):Z),g.has(Z))throw C(Z);g.add(Z);let A=this.refs[Z];return typeof A=="string"&&(A=this.refs[A]),typeof A=="object"?j(D,A.schema,Z):Z!==P(B)&&(Z[0]==="#"?(j(D,c[Z],Z),c[Z]=D):this.refs[Z]=B),Z}function fe(Z){if(typeof Z=="string"){if(!y.test(Z))throw new Error(`invalid anchor "${Z}"`);de.call(this,`#${Z}`)}}}),c;function j(D,V,L){if(V!==void 0&&!n(D,V))throw C(L)}function C(D){return new Error(`reference "${D}" resolves to more than one schema`)}}return ne.getSchemaRefs=p,ne}var tr;function _t(){if(tr)return he;tr=1,Object.defineProperty(he,"__esModule",{value:!0}),he.getData=he.KeywordCxt=he.validateFunctionCode=void 0;const e=un(),n=mt(),S=Yr(),d=mt(),b=cn(),s=ln(),f=dn(),l=J(),m=ve(),$=yt(),_=Q(),P=pt();function v(N){if(r(N)&&(g(N),h(N))){a(N);return}y(N,()=>(0,e.topBoolOrEmptySchema)(N))}he.validateFunctionCode=v;function y({gen:N,validateName:O,schema:q,schemaEnv:M,opts:z},G){z.code.es5?N.func(O,(0,l._)`${m.default.data}, ${m.default.valCxt}`,M.$async,()=>{N.code((0,l._)`"use strict"; ${t(q,z)}`),w(N,z),N.code(G)}):N.func(O,(0,l._)`${m.default.data}, ${p(z)}`,M.$async,()=>N.code(t(q,z)).code(G))}function p(N){return(0,l._)`{${m.default.instancePath}="", ${m.default.parentData}, ${m.default.parentDataProperty}, ${m.default.rootData}=${m.default.data}${N.dynamicRef?(0,l._)`, ${m.default.dynamicAnchors}={}`:l.nil}}={}`}function w(N,O){N.if(m.default.valCxt,()=>{N.var(m.default.instancePath,(0,l._)`${m.default.valCxt}.${m.default.instancePath}`),N.var(m.default.parentData,(0,l._)`${m.default.valCxt}.${m.default.parentData}`),N.var(m.default.parentDataProperty,(0,l._)`${m.default.valCxt}.${m.default.parentDataProperty}`),N.var(m.default.rootData,(0,l._)`${m.default.valCxt}.${m.default.rootData}`),O.dynamicRef&&N.var(m.default.dynamicAnchors,(0,l._)`${m.default.valCxt}.${m.default.dynamicAnchors}`)},()=>{N.var(m.default.instancePath,(0,l._)`""`),N.var(m.default.parentData,(0,l._)`undefined`),N.var(m.default.parentDataProperty,(0,l._)`undefined`),N.var(m.default.rootData,m.default.data),O.dynamicRef&&N.var(m.default.dynamicAnchors,(0,l._)`{}`)})}function a(N){const{schema:O,opts:q,gen:M}=N;y(N,()=>{q.$comment&&O.$comment&&K(N),D(N),M.let(m.default.vErrors,null),M.let(m.default.errors,0),q.unevaluated&&i(N),j(N),B(N)})}function i(N){const{gen:O,validateName:q}=N;N.evaluated=O.const("evaluated",(0,l._)`${q}.evaluated`),O.if((0,l._)`${N.evaluated}.dynamicProps`,()=>O.assign((0,l._)`${N.evaluated}.props`,(0,l._)`undefined`)),O.if((0,l._)`${N.evaluated}.dynamicItems`,()=>O.assign((0,l._)`${N.evaluated}.items`,(0,l._)`undefined`))}function t(N,O){const q=typeof N=="object"&&N[O.schemaId];return q&&(O.code.source||O.code.process)?(0,l._)`/*# sourceURL=${q} */`:l.nil}function o(N,O){if(r(N)&&(g(N),h(N))){c(N,O);return}(0,e.boolOrEmptySchema)(N,O)}function h({schema:N,self:O}){if(typeof N=="boolean")return!N;for(const q in N)if(O.RULES.all[q])return!0;return!1}function r(N){return typeof N.schema!="boolean"}function c(N,O){const{schema:q,gen:M,opts:z}=N;z.$comment&&q.$comment&&K(N),V(N),L(N);const G=M.const("_errs",m.default.errors);j(N,G),M.var(O,(0,l._)`${G} === ${m.default.errors}`)}function g(N){(0,_.checkUnknownRules)(N),C(N)}function j(N,O){if(N.opts.jtd)return de(N,[],!1,O);const q=(0,n.getSchemaTypes)(N.schema),M=(0,n.coerceAndCheckDataType)(N,q);de(N,q,!M,O)}function C(N){const{schema:O,errSchemaPath:q,opts:M,self:z}=N;O.$ref&&M.ignoreKeywordsWithRef&&(0,_.schemaHasRulesButRef)(O,z.RULES)&&z.logger.warn(`$ref: keywords ignored in schema at path "${q}"`)}function D(N){const{schema:O,opts:q}=N;O.default!==void 0&&q.useDefaults&&q.strictSchema&&(0,_.checkStrictMode)(N,"default is ignored in the schema root")}function V(N){const O=N.schema[N.opts.schemaId];O&&(N.baseId=(0,$.resolveUrl)(N.opts.uriResolver,N.baseId,O))}function L(N){if(N.schema.$async&&!N.schemaEnv.$async)throw new Error("async schema in sync schema")}function K({gen:N,schemaEnv:O,schema:q,errSchemaPath:M,opts:z}){const G=q.$comment;if(z.$comment===!0)N.code((0,l._)`${m.default.self}.logger.log(${G})`);else if(typeof z.$comment=="function"){const ee=(0,l.str)`${M}/$comment`,ue=N.scopeValue("root",{ref:O.root});N.code((0,l._)`${m.default.self}.opts.$comment(${G}, ${ee}, ${ue}.schema)`)}}function B(N){const{gen:O,schemaEnv:q,validateName:M,ValidationError:z,opts:G}=N;q.$async?O.if((0,l._)`${m.default.errors} === 0`,()=>O.return(m.default.data),()=>O.throw((0,l._)`new ${z}(${m.default.vErrors})`)):(O.assign((0,l._)`${M}.errors`,m.default.vErrors),G.unevaluated&&x(N),O.return((0,l._)`${m.default.errors} === 0`))}function x({gen:N,evaluated:O,props:q,items:M}){q instanceof l.Name&&N.assign((0,l._)`${O}.props`,q),M instanceof l.Name&&N.assign((0,l._)`${O}.items`,M)}function de(N,O,q,M){const{gen:z,schema:G,data:ee,allErrors:ue,opts:se,self:ae}=N,{RULES:te}=ae;if(G.$ref&&(se.ignoreKeywordsWithRef||!(0,_.schemaHasRulesButRef)(G,te))){z.block(()=>U(N,"$ref",te.all.$ref.definition));return}se.jtd||Z(N,O),z.block(()=>{for(const ie of te.rules)be(ie);be(te.post)});function be(ie){(0,S.shouldUseGroup)(G,ie)&&(ie.type?(z.if((0,d.checkDataType)(ie.type,ee,se.strictNumbers)),fe(N,ie),O.length===1&&O[0]===ie.type&&q&&(z.else(),(0,d.reportTypeError)(N)),z.endIf()):fe(N,ie),ue||z.if((0,l._)`${m.default.errors} === ${M||0}`))}}function fe(N,O){const{gen:q,schema:M,opts:{useDefaults:z}}=N;z&&(0,b.assignDefaults)(N,O.type),q.block(()=>{for(const G of O.rules)(0,S.shouldUseRule)(M,G)&&U(N,G.keyword,G.definition,O.type)})}function Z(N,O){N.schemaEnv.meta||!N.opts.strictTypes||(ye(N,O),N.opts.allowUnionTypes||A(N,O),R(N,N.dataTypes))}function ye(N,O){if(O.length){if(!N.dataTypes.length){N.dataTypes=O;return}O.forEach(q=>{k(N.dataTypes,q)||E(N,`type "${q}" not allowed by context "${N.dataTypes.join(",")}"`)}),u(N,O)}}function A(N,O){O.length>1&&!(O.length===2&&O.includes("null"))&&E(N,"use allowUnionTypes to allow union type keyword")}function R(N,O){const q=N.self.RULES.all;for(const M in q){const z=q[M];if(typeof z=="object"&&(0,S.shouldUseRule)(N.schema,z)){const{type:G}=z.definition;G.length&&!G.some(ee=>T(O,ee))&&E(N,`missing type "${G.join(",")}" for keyword "${M}"`)}}}function T(N,O){return N.includes(O)||O==="number"&&N.includes("integer")}function k(N,O){return N.includes(O)||O==="integer"&&N.includes("number")}function u(N,O){const q=[];for(const M of N.dataTypes)k(O,M)?q.push(M):O.includes("integer")&&M==="number"&&q.push("integer");N.dataTypes=q}function E(N,O){const q=N.schemaEnv.baseId+N.errSchemaPath;O+=` at "${q}" (strictTypes)`,(0,_.checkStrictMode)(N,O,N.opts.strictTypes)}class I{constructor(O,q,M){if((0,s.validateKeywordUsage)(O,q,M),this.gen=O.gen,this.allErrors=O.allErrors,this.keyword=M,this.data=O.data,this.schema=O.schema[M],this.$data=q.$data&&O.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,_.schemaRefOrVal)(O,this.schema,M,this.$data),this.schemaType=q.schemaType,this.parentSchema=O.schema,this.params={},this.it=O,this.def=q,this.$data)this.schemaCode=O.gen.const("vSchema",W(this.$data,O));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw new Error(`${M} value must be ${JSON.stringify(q.schemaType)}`);("code"in q?q.trackErrors:q.errors!==!1)&&(this.errsCount=O.gen.const("_errs",m.default.errors))}result(O,q,M){this.failResult((0,l.not)(O),q,M)}failResult(O,q,M){this.gen.if(O),M?M():this.error(),q?(this.gen.else(),q(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(O,q){this.failResult((0,l.not)(O),void 0,q)}fail(O){if(O===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(O),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(O){if(!this.$data)return this.fail(O);const{schemaCode:q}=this;this.fail((0,l._)`${q} !== undefined && (${(0,l.or)(this.invalid$data(),O)})`)}error(O,q,M){if(q){this.setParams(q),this._error(O,M),this.setParams({});return}this._error(O,M)}_error(O,q){(O?P.reportExtraError:P.reportError)(this,this.def.error,q)}$dataError(){(0,P.reportError)(this,this.def.$dataError||P.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,P.resetErrorsCount)(this.gen,this.errsCount)}ok(O){this.allErrors||this.gen.if(O)}setParams(O,q){q?Object.assign(this.params,O):this.params=O}block$data(O,q,M=l.nil){this.gen.block(()=>{this.check$data(O,M),q()})}check$data(O=l.nil,q=l.nil){if(!this.$data)return;const{gen:M,schemaCode:z,schemaType:G,def:ee}=this;M.if((0,l.or)((0,l._)`${z} === undefined`,q)),O!==l.nil&&M.assign(O,!0),(G.length||ee.validateSchema)&&(M.elseIf(this.invalid$data()),this.$dataError(),O!==l.nil&&M.assign(O,!1)),M.else()}invalid$data(){const{gen:O,schemaCode:q,schemaType:M,def:z,it:G}=this;return(0,l.or)(ee(),ue());function ee(){if(M.length){if(!(q instanceof l.Name))throw new Error("ajv implementation error");const se=Array.isArray(M)?M:[M];return(0,l._)`${(0,d.checkDataTypes)(se,q,G.opts.strictNumbers,d.DataType.Wrong)}`}return l.nil}function ue(){if(z.validateSchema){const se=O.scopeValue("validate$data",{ref:z.validateSchema});return(0,l._)`!${se}(${q})`}return l.nil}}subschema(O,q){const M=(0,f.getSubschema)(this.it,O);(0,f.extendSubschemaData)(M,this.it,O),(0,f.extendSubschemaMode)(M,O);const z={...this.it,...M,items:void 0,props:void 0};return o(z,q),z}mergeEvaluated(O,q){const{it:M,gen:z}=this;M.opts.unevaluated&&(M.props!==!0&&O.props!==void 0&&(M.props=_.mergeEvaluated.props(z,O.props,M.props,q)),M.items!==!0&&O.items!==void 0&&(M.items=_.mergeEvaluated.items(z,O.items,M.items,q)))}mergeValidEvaluated(O,q){const{it:M,gen:z}=this;if(M.opts.unevaluated&&(M.props!==!0||M.items!==!0))return z.if(q,()=>this.mergeEvaluated(O,l.Name)),!0}}he.KeywordCxt=I;function U(N,O,q,M){const z=new I(N,q,O);"code"in q?q.code(z,M):z.$data&&q.validate?(0,s.funcKeywordCode)(z,q):"macro"in q?(0,s.macroKeywordCode)(z,q):(q.compile||q.validate)&&(0,s.funcKeywordCode)(z,q)}const F=/^\/(?:[^~]|~0|~1)*$/,X=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function W(N,{dataLevel:O,dataNames:q,dataPathArr:M}){let z,G;if(N==="")return m.default.rootData;if(N[0]==="/"){if(!F.test(N))throw new Error(`Invalid JSON-pointer: ${N}`);z=N,G=m.default.rootData}else{const ae=X.exec(N);if(!ae)throw new Error(`Invalid JSON-pointer: ${N}`);const te=+ae[1];if(z=ae[2],z==="#"){if(te>=O)throw new Error(se("property/index",te));return M[O-te]}if(te>O)throw new Error(se("data",te));if(G=q[O-te],!z)return G}let ee=G;const ue=z.split("/");for(const ae of ue)ae&&(G=(0,l._)`${G}${(0,l.getProperty)((0,_.unescapeJsonPointer)(ae))}`,ee=(0,l._)`${ee} && ${G}`);return ee;function se(ae,te){return`Cannot access ${ae} ${te} levels up, current level is ${O}`}}return he.getData=W,he}var Ie={},rr;function qt(){if(rr)return Ie;rr=1,Object.defineProperty(Ie,"__esModule",{value:!0});class e extends Error{constructor(S){super("validation failed"),this.errors=S,this.ajv=this.validation=!0}}return Ie.default=e,Ie}var qe={},nr;function vt(){if(nr)return qe;nr=1,Object.defineProperty(qe,"__esModule",{value:!0});const e=yt();class n extends Error{constructor(d,b,s,f){super(f||`can't resolve reference ${s} from id ${b}`),this.missingRef=(0,e.resolveUrl)(d,b,s),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(d,this.missingRef))}}return qe.default=n,qe}var oe={},sr;function Tt(){if(sr)return oe;sr=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.resolveSchema=oe.getCompilingSchema=oe.resolveRef=oe.compileSchema=oe.SchemaEnv=void 0;const e=J(),n=qt(),S=ve(),d=yt(),b=Q(),s=_t();class f{constructor(i){var t;this.refs={},this.dynamicAnchors={};let o;typeof i.schema=="object"&&(o=i.schema),this.schema=i.schema,this.schemaId=i.schemaId,this.root=i.root||this,this.baseId=(t=i.baseId)!==null&&t!==void 0?t:(0,d.normalizeId)(o?.[i.schemaId||"$id"]),this.schemaPath=i.schemaPath,this.localRefs=i.localRefs,this.meta=i.meta,this.$async=o?.$async,this.refs={}}}oe.SchemaEnv=f;function l(a){const i=_.call(this,a);if(i)return i;const t=(0,d.getFullPath)(this.opts.uriResolver,a.root.baseId),{es5:o,lines:h}=this.opts.code,{ownProperties:r}=this.opts,c=new e.CodeGen(this.scope,{es5:o,lines:h,ownProperties:r});let g;a.$async&&(g=c.scopeValue("Error",{ref:n.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const j=c.scopeName("validate");a.validateName=j;const C={gen:c,allErrors:this.opts.allErrors,data:S.default.data,parentData:S.default.parentData,parentDataProperty:S.default.parentDataProperty,dataNames:[S.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:c.scopeValue("schema",this.opts.code.source===!0?{ref:a.schema,code:(0,e.stringify)(a.schema)}:{ref:a.schema}),validateName:j,ValidationError:g,schema:a.schema,schemaEnv:a,rootId:t,baseId:a.baseId||t,schemaPath:e.nil,errSchemaPath:a.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let D;try{this._compilations.add(a),(0,s.validateFunctionCode)(C),c.optimize(this.opts.code.optimize);const V=c.toString();D=`${c.scopeRefs(S.default.scope)}return ${V}`,this.opts.code.process&&(D=this.opts.code.process(D,a));const K=new Function(`${S.default.self}`,`${S.default.scope}`,D)(this,this.scope.get());if(this.scope.value(j,{ref:K}),K.errors=null,K.schema=a.schema,K.schemaEnv=a,a.$async&&(K.$async=!0),this.opts.code.source===!0&&(K.source={validateName:j,validateCode:V,scopeValues:c._values}),this.opts.unevaluated){const{props:B,items:x}=C;K.evaluated={props:B instanceof e.Name?void 0:B,items:x instanceof e.Name?void 0:x,dynamicProps:B instanceof e.Name,dynamicItems:x instanceof e.Name},K.source&&(K.source.evaluated=(0,e.stringify)(K.evaluated))}return a.validate=K,a}catch(V){throw delete a.validate,delete a.validateName,D&&this.logger.error("Error compiling schema, function code:",D),V}finally{this._compilations.delete(a)}}oe.compileSchema=l;function m(a,i,t){var o;t=(0,d.resolveUrl)(this.opts.uriResolver,i,t);const h=a.refs[t];if(h)return h;let r=v.call(this,a,t);if(r===void 0){const c=(o=a.localRefs)===null||o===void 0?void 0:o[t],{schemaId:g}=this.opts;c&&(r=new f({schema:c,schemaId:g,root:a,baseId:i}))}if(r!==void 0)return a.refs[t]=$.call(this,r)}oe.resolveRef=m;function $(a){return(0,d.inlineRef)(a.schema,this.opts.inlineRefs)?a.schema:a.validate?a:l.call(this,a)}function _(a){for(const i of this._compilations)if(P(i,a))return i}oe.getCompilingSchema=_;function P(a,i){return a.schema===i.schema&&a.root===i.root&&a.baseId===i.baseId}function v(a,i){let t;for(;typeof(t=this.refs[i])=="string";)i=t;return t||this.schemas[i]||y.call(this,a,i)}function y(a,i){const t=this.opts.uriResolver.parse(i),o=(0,d._getFullPath)(this.opts.uriResolver,t);let h=(0,d.getFullPath)(this.opts.uriResolver,a.baseId,void 0);if(Object.keys(a.schema).length>0&&o===h)return w.call(this,t,a);const r=(0,d.normalizeId)(o),c=this.refs[r]||this.schemas[r];if(typeof c=="string"){const g=y.call(this,a,c);return typeof g?.schema!="object"?void 0:w.call(this,t,g)}if(typeof c?.schema=="object"){if(c.validate||l.call(this,c),r===(0,d.normalizeId)(i)){const{schema:g}=c,{schemaId:j}=this.opts,C=g[j];return C&&(h=(0,d.resolveUrl)(this.opts.uriResolver,h,C)),new f({schema:g,schemaId:j,root:a,baseId:h})}return w.call(this,t,c)}}oe.resolveSchema=y;const p=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function w(a,{baseId:i,schema:t,root:o}){var h;if(((h=a.fragment)===null||h===void 0?void 0:h[0])!=="/")return;for(const g of a.fragment.slice(1).split("/")){if(typeof t=="boolean")return;const j=t[(0,b.unescapeFragment)(g)];if(j===void 0)return;t=j;const C=typeof t=="object"&&t[this.opts.schemaId];!p.has(g)&&C&&(i=(0,d.resolveUrl)(this.opts.uriResolver,i,C))}let r;if(typeof t!="boolean"&&t.$ref&&!(0,b.schemaHasRulesButRef)(t,this.RULES)){const g=(0,d.resolveUrl)(this.opts.uriResolver,i,t.$ref);r=y.call(this,o,g)}const{schemaId:c}=this.opts;if(r=r||new f({schema:t,schemaId:c,root:o,baseId:i}),r.schema!==r.root.schema)return r}return oe}const hn="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",mn="Meta-schema for $data reference (JSON AnySchema extension proposal)",pn="object",yn=["$data"],_n={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},vn=!1,gn={$id:hn,description:mn,type:pn,required:yn,properties:_n,additionalProperties:vn};var Te={},Re={exports:{}},kt,ar;function xr(){if(ar)return kt;ar=1;const e=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),n=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function S(v){let y="",p=0,w=0;for(w=0;w<v.length;w++)if(p=v[w].charCodeAt(0),p!==48){if(!(p>=48&&p<=57||p>=65&&p<=70||p>=97&&p<=102))return"";y+=v[w];break}for(w+=1;w<v.length;w++){if(p=v[w].charCodeAt(0),!(p>=48&&p<=57||p>=65&&p<=70||p>=97&&p<=102))return"";y+=v[w]}return y}const d=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function b(v){return v.length=0,!0}function s(v,y,p){if(v.length){const w=S(v);if(w!=="")y.push(w);else return p.error=!0,!1;v.length=0}return!0}function f(v){let y=0;const p={error:!1,address:"",zone:""},w=[],a=[];let i=!1,t=!1,o=s;for(let h=0;h<v.length;h++){const r=v[h];if(!(r==="["||r==="]"))if(r===":"){if(i===!0&&(t=!0),!o(a,w,p))break;if(++y>7){p.error=!0;break}h>0&&v[h-1]===":"&&(i=!0),w.push(":");continue}else if(r==="%"){if(!o(a,w,p))break;o=b}else{a.push(r);continue}}return a.length&&(o===b?p.zone=a.join(""):t?w.push(a.join("")):w.push(S(a))),p.address=w.join(""),p}function l(v){if(m(v,":")<2)return{host:v,isIPV6:!1};const y=f(v);if(y.error)return{host:v,isIPV6:!1};{let p=y.address,w=y.address;return y.zone&&(p+="%"+y.zone,w+="%25"+y.zone),{host:p,isIPV6:!0,escapedHost:w}}}function m(v,y){let p=0;for(let w=0;w<v.length;w++)v[w]===y&&p++;return p}function $(v){let y=v;const p=[];let w=-1,a=0;for(;a=y.length;){if(a===1){if(y===".")break;if(y==="/"){p.push("/");break}else{p.push(y);break}}else if(a===2){if(y[0]==="."){if(y[1]===".")break;if(y[1]==="/"){y=y.slice(2);continue}}else if(y[0]==="/"&&(y[1]==="."||y[1]==="/")){p.push("/");break}}else if(a===3&&y==="/.."){p.length!==0&&p.pop(),p.push("/");break}if(y[0]==="."){if(y[1]==="."){if(y[2]==="/"){y=y.slice(3);continue}}else if(y[1]==="/"){y=y.slice(2);continue}}else if(y[0]==="/"&&y[1]==="."){if(y[2]==="/"){y=y.slice(2);continue}else if(y[2]==="."&&y[3]==="/"){y=y.slice(3),p.length!==0&&p.pop();continue}}if((w=y.indexOf("/",1))===-1){p.push(y);break}else p.push(y.slice(0,w)),y=y.slice(w)}return p.join("")}function _(v,y){const p=y!==!0?escape:unescape;return v.scheme!==void 0&&(v.scheme=p(v.scheme)),v.userinfo!==void 0&&(v.userinfo=p(v.userinfo)),v.host!==void 0&&(v.host=p(v.host)),v.path!==void 0&&(v.path=p(v.path)),v.query!==void 0&&(v.query=p(v.query)),v.fragment!==void 0&&(v.fragment=p(v.fragment)),v}function P(v){const y=[];if(v.userinfo!==void 0&&(y.push(v.userinfo),y.push("@")),v.host!==void 0){let p=unescape(v.host);if(!n(p)){const w=l(p);w.isIPV6===!0?p=`[${w.escapedHost}]`:p=v.host}y.push(p)}return(typeof v.port=="number"||typeof v.port=="string")&&(y.push(":"),y.push(String(v.port))),y.length?y.join(""):void 0}return kt={nonSimpleDomain:d,recomposeAuthority:P,normalizeComponentEncoding:_,removeDotSegments:$,isIPv4:n,isUUID:e,normalizeIPv6:l,stringArrayToHexStripped:S},kt}var jt,or;function $n(){if(or)return jt;or=1;const{isUUID:e}=xr(),n=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,S=["http","https","ws","wss","urn","urn:uuid"];function d(r){return S.indexOf(r)!==-1}function b(r){return r.secure===!0?!0:r.secure===!1?!1:r.scheme?r.scheme.length===3&&(r.scheme[0]==="w"||r.scheme[0]==="W")&&(r.scheme[1]==="s"||r.scheme[1]==="S")&&(r.scheme[2]==="s"||r.scheme[2]==="S"):!1}function s(r){return r.host||(r.error=r.error||"HTTP URIs must have a host."),r}function f(r){const c=String(r.scheme).toLowerCase()==="https";return(r.port===(c?443:80)||r.port==="")&&(r.port=void 0),r.path||(r.path="/"),r}function l(r){return r.secure=b(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r}function m(r){if((r.port===(b(r)?443:80)||r.port==="")&&(r.port=void 0),typeof r.secure=="boolean"&&(r.scheme=r.secure?"wss":"ws",r.secure=void 0),r.resourceName){const[c,g]=r.resourceName.split("?");r.path=c&&c!=="/"?c:void 0,r.query=g,r.resourceName=void 0}return r.fragment=void 0,r}function $(r,c){if(!r.path)return r.error="URN can not be parsed",r;const g=r.path.match(n);if(g){const j=c.scheme||r.scheme||"urn";r.nid=g[1].toLowerCase(),r.nss=g[2];const C=`${j}:${c.nid||r.nid}`,D=h(C);r.path=void 0,D&&(r=D.parse(r,c))}else r.error=r.error||"URN can not be parsed.";return r}function _(r,c){if(r.nid===void 0)throw new Error("URN without nid cannot be serialized");const g=c.scheme||r.scheme||"urn",j=r.nid.toLowerCase(),C=`${g}:${c.nid||j}`,D=h(C);D&&(r=D.serialize(r,c));const V=r,L=r.nss;return V.path=`${j||c.nid}:${L}`,c.skipEscape=!0,V}function P(r,c){const g=r;return g.uuid=g.nss,g.nss=void 0,!c.tolerant&&(!g.uuid||!e(g.uuid))&&(g.error=g.error||"UUID is not valid."),g}function v(r){const c=r;return c.nss=(r.uuid||"").toLowerCase(),c}const y={scheme:"http",domainHost:!0,parse:s,serialize:f},p={scheme:"https",domainHost:y.domainHost,parse:s,serialize:f},w={scheme:"ws",domainHost:!0,parse:l,serialize:m},a={scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},o={http:y,https:p,ws:w,wss:a,urn:{scheme:"urn",parse:$,serialize:_,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:P,serialize:v,skipNormalize:!0}};Object.setPrototypeOf(o,null);function h(r){return r&&(o[r]||o[r.toLowerCase()])||void 0}return jt={wsIsSecure:b,SCHEMES:o,isValidSchemeName:d,getSchemeHandler:h},jt}var ir;function wn(){if(ir)return Re.exports;ir=1;const{normalizeIPv6:e,removeDotSegments:n,recomposeAuthority:S,normalizeComponentEncoding:d,isIPv4:b,nonSimpleDomain:s}=xr(),{SCHEMES:f,getSchemeHandler:l}=$n();function m(a,i){return typeof a=="string"?a=v(p(a,i),i):typeof a=="object"&&(a=p(v(a,i),i)),a}function $(a,i,t){const o=t?Object.assign({scheme:"null"},t):{scheme:"null"},h=_(p(a,o),p(i,o),o,!0);return o.skipEscape=!0,v(h,o)}function _(a,i,t,o){const h={};return o||(a=p(v(a,t),t),i=p(v(i,t),t)),t=t||{},!t.tolerant&&i.scheme?(h.scheme=i.scheme,h.userinfo=i.userinfo,h.host=i.host,h.port=i.port,h.path=n(i.path||""),h.query=i.query):(i.userinfo!==void 0||i.host!==void 0||i.port!==void 0?(h.userinfo=i.userinfo,h.host=i.host,h.port=i.port,h.path=n(i.path||""),h.query=i.query):(i.path?(i.path[0]==="/"?h.path=n(i.path):((a.userinfo!==void 0||a.host!==void 0||a.port!==void 0)&&!a.path?h.path="/"+i.path:a.path?h.path=a.path.slice(0,a.path.lastIndexOf("/")+1)+i.path:h.path=i.path,h.path=n(h.path)),h.query=i.query):(h.path=a.path,i.query!==void 0?h.query=i.query:h.query=a.query),h.userinfo=a.userinfo,h.host=a.host,h.port=a.port),h.scheme=a.scheme),h.fragment=i.fragment,h}function P(a,i,t){return typeof a=="string"?(a=unescape(a),a=v(d(p(a,t),!0),{...t,skipEscape:!0})):typeof a=="object"&&(a=v(d(a,!0),{...t,skipEscape:!0})),typeof i=="string"?(i=unescape(i),i=v(d(p(i,t),!0),{...t,skipEscape:!0})):typeof i=="object"&&(i=v(d(i,!0),{...t,skipEscape:!0})),a.toLowerCase()===i.toLowerCase()}function v(a,i){const t={host:a.host,scheme:a.scheme,userinfo:a.userinfo,port:a.port,path:a.path,query:a.query,nid:a.nid,nss:a.nss,uuid:a.uuid,fragment:a.fragment,reference:a.reference,resourceName:a.resourceName,secure:a.secure,error:""},o=Object.assign({},i),h=[],r=l(o.scheme||t.scheme);r&&r.serialize&&r.serialize(t,o),t.path!==void 0&&(o.skipEscape?t.path=unescape(t.path):(t.path=escape(t.path),t.scheme!==void 0&&(t.path=t.path.split("%3A").join(":")))),o.reference!=="suffix"&&t.scheme&&h.push(t.scheme,":");const c=S(t);if(c!==void 0&&(o.reference!=="suffix"&&h.push("//"),h.push(c),t.path&&t.path[0]!=="/"&&h.push("/")),t.path!==void 0){let g=t.path;!o.absolutePath&&(!r||!r.absolutePath)&&(g=n(g)),c===void 0&&g[0]==="/"&&g[1]==="/"&&(g="/%2F"+g.slice(2)),h.push(g)}return t.query!==void 0&&h.push("?",t.query),t.fragment!==void 0&&h.push("#",t.fragment),h.join("")}const y=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function p(a,i){const t=Object.assign({},i),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let h=!1;t.reference==="suffix"&&(t.scheme?a=t.scheme+":"+a:a="//"+a);const r=a.match(y);if(r){if(o.scheme=r[1],o.userinfo=r[3],o.host=r[4],o.port=parseInt(r[5],10),o.path=r[6]||"",o.query=r[7],o.fragment=r[8],isNaN(o.port)&&(o.port=r[5]),o.host)if(b(o.host)===!1){const j=e(o.host);o.host=j.host.toLowerCase(),h=j.isIPV6}else h=!0;o.scheme===void 0&&o.userinfo===void 0&&o.host===void 0&&o.port===void 0&&o.query===void 0&&!o.path?o.reference="same-document":o.scheme===void 0?o.reference="relative":o.fragment===void 0?o.reference="absolute":o.reference="uri",t.reference&&t.reference!=="suffix"&&t.reference!==o.reference&&(o.error=o.error||"URI is not a "+t.reference+" reference.");const c=l(t.scheme||o.scheme);if(!t.unicodeSupport&&(!c||!c.unicodeSupport)&&o.host&&(t.domainHost||c&&c.domainHost)&&h===!1&&s(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(g){o.error=o.error||"Host's domain name can not be converted to ASCII: "+g}(!c||c&&!c.skipNormalize)&&(a.indexOf("%")!==-1&&(o.scheme!==void 0&&(o.scheme=unescape(o.scheme)),o.host!==void 0&&(o.host=unescape(o.host))),o.path&&(o.path=escape(unescape(o.path))),o.fragment&&(o.fragment=encodeURI(decodeURIComponent(o.fragment)))),c&&c.parse&&c.parse(o,t)}else o.error=o.error||"URI can not be parsed.";return o}const w={SCHEMES:f,normalize:m,resolve:$,resolveComponent:_,equal:P,serialize:v,parse:p};return Re.exports=w,Re.exports.default=w,Re.exports.fastUri=w,Re.exports}var ur;function bn(){if(ur)return Te;ur=1,Object.defineProperty(Te,"__esModule",{value:!0});const e=wn();return e.code='require("ajv/dist/runtime/uri").default',Te.default=e,Te}var cr;function En(){return cr||(cr=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var n=_t();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return n.KeywordCxt}});var S=J();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return S._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return S.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return S.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return S.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return S.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return S.CodeGen}});const d=qt(),b=vt(),s=Xr(),f=Tt(),l=J(),m=yt(),$=mt(),_=Q(),P=gn,v=bn(),y=(A,R)=>new RegExp(A,R);y.code="new RegExp";const p=["removeAdditional","useDefaults","coerceTypes"],w=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),a={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},i={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},t=200;function o(A){var R,T,k,u,E,I,U,F,X,W,N,O,q,M,z,G,ee,ue,se,ae,te,be,ie,gt,$t;const Pe=A.strict,wt=(R=A.code)===null||R===void 0?void 0:R.optimize,At=wt===!0||wt===void 0?1:wt||0,Mt=(k=(T=A.code)===null||T===void 0?void 0:T.regExp)!==null&&k!==void 0?k:y,sn=(u=A.uriResolver)!==null&&u!==void 0?u:v.default;return{strictSchema:(I=(E=A.strictSchema)!==null&&E!==void 0?E:Pe)!==null&&I!==void 0?I:!0,strictNumbers:(F=(U=A.strictNumbers)!==null&&U!==void 0?U:Pe)!==null&&F!==void 0?F:!0,strictTypes:(W=(X=A.strictTypes)!==null&&X!==void 0?X:Pe)!==null&&W!==void 0?W:"log",strictTuples:(O=(N=A.strictTuples)!==null&&N!==void 0?N:Pe)!==null&&O!==void 0?O:"log",strictRequired:(M=(q=A.strictRequired)!==null&&q!==void 0?q:Pe)!==null&&M!==void 0?M:!1,code:A.code?{...A.code,optimize:At,regExp:Mt}:{optimize:At,regExp:Mt},loopRequired:(z=A.loopRequired)!==null&&z!==void 0?z:t,loopEnum:(G=A.loopEnum)!==null&&G!==void 0?G:t,meta:(ee=A.meta)!==null&&ee!==void 0?ee:!0,messages:(ue=A.messages)!==null&&ue!==void 0?ue:!0,inlineRefs:(se=A.inlineRefs)!==null&&se!==void 0?se:!0,schemaId:(ae=A.schemaId)!==null&&ae!==void 0?ae:"$id",addUsedSchema:(te=A.addUsedSchema)!==null&&te!==void 0?te:!0,validateSchema:(be=A.validateSchema)!==null&&be!==void 0?be:!0,validateFormats:(ie=A.validateFormats)!==null&&ie!==void 0?ie:!0,unicodeRegExp:(gt=A.unicodeRegExp)!==null&&gt!==void 0?gt:!0,int32range:($t=A.int32range)!==null&&$t!==void 0?$t:!0,uriResolver:sn}}class h{constructor(R={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,R=this.opts={...R,...o(R)};const{es5:T,lines:k}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:w,es5:T,lines:k}),this.logger=L(R.logger);const u=R.validateFormats;R.validateFormats=!1,this.RULES=(0,s.getRules)(),r.call(this,a,R,"NOT SUPPORTED"),r.call(this,i,R,"DEPRECATED","warn"),this._metaOpts=D.call(this),R.formats&&j.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),R.keywords&&C.call(this,R.keywords),typeof R.meta=="object"&&this.addMetaSchema(R.meta),g.call(this),R.validateFormats=u}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:R,meta:T,schemaId:k}=this.opts;let u=P;k==="id"&&(u={...P},u.id=u.$id,delete u.$id),T&&R&&this.addMetaSchema(u,u[k],!1)}defaultMeta(){const{meta:R,schemaId:T}=this.opts;return this.opts.defaultMeta=typeof R=="object"?R[T]||R:void 0}validate(R,T){let k;if(typeof R=="string"){if(k=this.getSchema(R),!k)throw new Error(`no schema with key or ref "${R}"`)}else k=this.compile(R);const u=k(T);return"$async"in k||(this.errors=k.errors),u}compile(R,T){const k=this._addSchema(R,T);return k.validate||this._compileSchemaEnv(k)}compileAsync(R,T){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:k}=this.opts;return u.call(this,R,T);async function u(W,N){await E.call(this,W.$schema);const O=this._addSchema(W,N);return O.validate||I.call(this,O)}async function E(W){W&&!this.getSchema(W)&&await u.call(this,{$ref:W},!0)}async function I(W){try{return this._compileSchemaEnv(W)}catch(N){if(!(N instanceof b.default))throw N;return U.call(this,N),await F.call(this,N.missingSchema),I.call(this,W)}}function U({missingSchema:W,missingRef:N}){if(this.refs[W])throw new Error(`AnySchema ${W} is loaded but ${N} cannot be resolved`)}async function F(W){const N=await X.call(this,W);this.refs[W]||await E.call(this,N.$schema),this.refs[W]||this.addSchema(N,W,T)}async function X(W){const N=this._loading[W];if(N)return N;try{return await(this._loading[W]=k(W))}finally{delete this._loading[W]}}}addSchema(R,T,k,u=this.opts.validateSchema){if(Array.isArray(R)){for(const I of R)this.addSchema(I,void 0,k,u);return this}let E;if(typeof R=="object"){const{schemaId:I}=this.opts;if(E=R[I],E!==void 0&&typeof E!="string")throw new Error(`schema ${I} must be string`)}return T=(0,m.normalizeId)(T||E),this._checkUnique(T),this.schemas[T]=this._addSchema(R,k,T,u,!0),this}addMetaSchema(R,T,k=this.opts.validateSchema){return this.addSchema(R,T,!0,k),this}validateSchema(R,T){if(typeof R=="boolean")return!0;let k;if(k=R.$schema,k!==void 0&&typeof k!="string")throw new Error("$schema must be a string");if(k=k||this.opts.defaultMeta||this.defaultMeta(),!k)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const u=this.validate(k,R);if(!u&&T){const E="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(E);else throw new Error(E)}return u}getSchema(R){let T;for(;typeof(T=c.call(this,R))=="string";)R=T;if(T===void 0){const{schemaId:k}=this.opts,u=new f.SchemaEnv({schema:{},schemaId:k});if(T=f.resolveSchema.call(this,u,R),!T)return;this.refs[R]=T}return T.validate||this._compileSchemaEnv(T)}removeSchema(R){if(R instanceof RegExp)return this._removeAllSchemas(this.schemas,R),this._removeAllSchemas(this.refs,R),this;switch(typeof R){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const T=c.call(this,R);return typeof T=="object"&&this._cache.delete(T.schema),delete this.schemas[R],delete this.refs[R],this}case"object":{const T=R;this._cache.delete(T);let k=R[this.opts.schemaId];return k&&(k=(0,m.normalizeId)(k),delete this.schemas[k],delete this.refs[k]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(R){for(const T of R)this.addKeyword(T);return this}addKeyword(R,T){let k;if(typeof R=="string")k=R,typeof T=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),T.keyword=k);else if(typeof R=="object"&&T===void 0){if(T=R,k=T.keyword,Array.isArray(k)&&!k.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(B.call(this,k,T),!T)return(0,_.eachItem)(k,E=>x.call(this,E)),this;fe.call(this,T);const u={...T,type:(0,$.getJSONTypes)(T.type),schemaType:(0,$.getJSONTypes)(T.schemaType)};return(0,_.eachItem)(k,u.type.length===0?E=>x.call(this,E,u):E=>u.type.forEach(I=>x.call(this,E,u,I))),this}getKeyword(R){const T=this.RULES.all[R];return typeof T=="object"?T.definition:!!T}removeKeyword(R){const{RULES:T}=this;delete T.keywords[R],delete T.all[R];for(const k of T.rules){const u=k.rules.findIndex(E=>E.keyword===R);u>=0&&k.rules.splice(u,1)}return this}addFormat(R,T){return typeof T=="string"&&(T=new RegExp(T)),this.formats[R]=T,this}errorsText(R=this.errors,{separator:T=", ",dataVar:k="data"}={}){return!R||R.length===0?"No errors":R.map(u=>`${k}${u.instancePath} ${u.message}`).reduce((u,E)=>u+T+E)}$dataMetaSchema(R,T){const k=this.RULES.all;R=JSON.parse(JSON.stringify(R));for(const u of T){const E=u.split("/").slice(1);let I=R;for(const U of E)I=I[U];for(const U in k){const F=k[U];if(typeof F!="object")continue;const{$data:X}=F.definition,W=I[U];X&&W&&(I[U]=ye(W))}}return R}_removeAllSchemas(R,T){for(const k in R){const u=R[k];(!T||T.test(k))&&(typeof u=="string"?delete R[k]:u&&!u.meta&&(this._cache.delete(u.schema),delete R[k]))}}_addSchema(R,T,k,u=this.opts.validateSchema,E=this.opts.addUsedSchema){let I;const{schemaId:U}=this.opts;if(typeof R=="object")I=R[U];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof R!="boolean")throw new Error("schema must be object or boolean")}let F=this._cache.get(R);if(F!==void 0)return F;k=(0,m.normalizeId)(I||k);const X=m.getSchemaRefs.call(this,R,k);return F=new f.SchemaEnv({schema:R,schemaId:U,meta:T,baseId:k,localRefs:X}),this._cache.set(F.schema,F),E&&!k.startsWith("#")&&(k&&this._checkUnique(k),this.refs[k]=F),u&&this.validateSchema(R,!0),F}_checkUnique(R){if(this.schemas[R]||this.refs[R])throw new Error(`schema with key or id "${R}" already exists`)}_compileSchemaEnv(R){if(R.meta?this._compileMetaSchema(R):f.compileSchema.call(this,R),!R.validate)throw new Error("ajv implementation error");return R.validate}_compileMetaSchema(R){const T=this.opts;this.opts=this._metaOpts;try{f.compileSchema.call(this,R)}finally{this.opts=T}}}h.ValidationError=d.default,h.MissingRefError=b.default,e.default=h;function r(A,R,T,k="error"){for(const u in A){const E=u;E in R&&this.logger[k](`${T}: option ${u}. ${A[E]}`)}}function c(A){return A=(0,m.normalizeId)(A),this.schemas[A]||this.refs[A]}function g(){const A=this.opts.schemas;if(A)if(Array.isArray(A))this.addSchema(A);else for(const R in A)this.addSchema(A[R],R)}function j(){for(const A in this.opts.formats){const R=this.opts.formats[A];R&&this.addFormat(A,R)}}function C(A){if(Array.isArray(A)){this.addVocabulary(A);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const R in A){const T=A[R];T.keyword||(T.keyword=R),this.addKeyword(T)}}function D(){const A={...this.opts};for(const R of p)delete A[R];return A}const V={log(){},warn(){},error(){}};function L(A){if(A===!1)return V;if(A===void 0)return console;if(A.log&&A.warn&&A.error)return A;throw new Error("logger must implement log, warn and error methods")}const K=/^[a-z_$][a-z0-9_$:-]*$/i;function B(A,R){const{RULES:T}=this;if((0,_.eachItem)(A,k=>{if(T.keywords[k])throw new Error(`Keyword ${k} is already defined`);if(!K.test(k))throw new Error(`Keyword ${k} has invalid name`)}),!!R&&R.$data&&!("code"in R||"validate"in R))throw new Error('$data keyword must have "code" or "validate" function')}function x(A,R,T){var k;const u=R?.post;if(T&&u)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:E}=this;let I=u?E.post:E.rules.find(({type:F})=>F===T);if(I||(I={type:T,rules:[]},E.rules.push(I)),E.keywords[A]=!0,!R)return;const U={keyword:A,definition:{...R,type:(0,$.getJSONTypes)(R.type),schemaType:(0,$.getJSONTypes)(R.schemaType)}};R.before?de.call(this,I,U,R.before):I.rules.push(U),E.all[A]=U,(k=R.implements)===null||k===void 0||k.forEach(F=>this.addKeyword(F))}function de(A,R,T){const k=A.rules.findIndex(u=>u.keyword===T);k>=0?A.rules.splice(k,0,R):(A.rules.push(R),this.logger.warn(`rule ${T} is not defined`))}function fe(A){let{metaSchema:R}=A;R!==void 0&&(A.$data&&this.opts.$data&&(R=ye(R)),A.validateSchema=this.compile(R,!0))}const Z={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ye(A){return{anyOf:[A,Z]}}})(bt)),bt}var Ce={},Ae={},Me={},lr;function Sn(){if(lr)return Me;lr=1,Object.defineProperty(Me,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Me.default=e,Me}var _e={},dr;function Pn(){if(dr)return _e;dr=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.callRef=_e.getValidate=void 0;const e=vt(),n=le(),S=J(),d=ve(),b=Tt(),s=Q(),f={keyword:"$ref",schemaType:"string",code($){const{gen:_,schema:P,it:v}=$,{baseId:y,schemaEnv:p,validateName:w,opts:a,self:i}=v,{root:t}=p;if((P==="#"||P==="#/")&&y===t.baseId)return h();const o=b.resolveRef.call(i,t,y,P);if(o===void 0)throw new e.default(v.opts.uriResolver,y,P);if(o instanceof b.SchemaEnv)return r(o);return c(o);function h(){if(p===t)return m($,w,p,p.$async);const g=_.scopeValue("root",{ref:t});return m($,(0,S._)`${g}.validate`,t,t.$async)}function r(g){const j=l($,g);m($,j,g,g.$async)}function c(g){const j=_.scopeValue("schema",a.code.source===!0?{ref:g,code:(0,S.stringify)(g)}:{ref:g}),C=_.name("valid"),D=$.subschema({schema:g,dataTypes:[],schemaPath:S.nil,topSchemaRef:j,errSchemaPath:P},C);$.mergeEvaluated(D),$.ok(C)}}};function l($,_){const{gen:P}=$;return _.validate?P.scopeValue("validate",{ref:_.validate}):(0,S._)`${P.scopeValue("wrapper",{ref:_})}.validate`}_e.getValidate=l;function m($,_,P,v){const{gen:y,it:p}=$,{allErrors:w,schemaEnv:a,opts:i}=p,t=i.passContext?d.default.this:S.nil;v?o():h();function o(){if(!a.$async)throw new Error("async schema referenced by sync schema");const g=y.let("valid");y.try(()=>{y.code((0,S._)`await ${(0,n.callValidateCode)($,_,t)}`),c(_),w||y.assign(g,!0)},j=>{y.if((0,S._)`!(${j} instanceof ${p.ValidationError})`,()=>y.throw(j)),r(j),w||y.assign(g,!1)}),$.ok(g)}function h(){$.result((0,n.callValidateCode)($,_,t),()=>c(_),()=>r(_))}function r(g){const j=(0,S._)`${g}.errors`;y.assign(d.default.vErrors,(0,S._)`${d.default.vErrors} === null ? ${j} : ${d.default.vErrors}.concat(${j})`),y.assign(d.default.errors,(0,S._)`${d.default.vErrors}.length`)}function c(g){var j;if(!p.opts.unevaluated)return;const C=(j=P?.validate)===null||j===void 0?void 0:j.evaluated;if(p.props!==!0)if(C&&!C.dynamicProps)C.props!==void 0&&(p.props=s.mergeEvaluated.props(y,C.props,p.props));else{const D=y.var("props",(0,S._)`${g}.evaluated.props`);p.props=s.mergeEvaluated.props(y,D,p.props,S.Name)}if(p.items!==!0)if(C&&!C.dynamicItems)C.items!==void 0&&(p.items=s.mergeEvaluated.items(y,C.items,p.items));else{const D=y.var("items",(0,S._)`${g}.evaluated.items`);p.items=s.mergeEvaluated.items(y,D,p.items,S.Name)}}}return _e.callRef=m,_e.default=f,_e}var fr;function Nn(){if(fr)return Ae;fr=1,Object.defineProperty(Ae,"__esModule",{value:!0});const e=Sn(),n=Pn(),S=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,n.default];return Ae.default=S,Ae}var De={},Ve={},hr;function Rn(){if(hr)return Ve;hr=1,Object.defineProperty(Ve,"__esModule",{value:!0});const e=J(),n=e.operators,S={maximum:{okStr:"<=",ok:n.LTE,fail:n.GT},minimum:{okStr:">=",ok:n.GTE,fail:n.LT},exclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},exclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},d={message:({keyword:s,schemaCode:f})=>(0,e.str)`must be ${S[s].okStr} ${f}`,params:({keyword:s,schemaCode:f})=>(0,e._)`{comparison: ${S[s].okStr}, limit: ${f}}`},b={keyword:Object.keys(S),type:"number",schemaType:"number",$data:!0,error:d,code(s){const{keyword:f,data:l,schemaCode:m}=s;s.fail$data((0,e._)`${l} ${S[f].fail} ${m} || isNaN(${l})`)}};return Ve.default=b,Ve}var Ue={},mr;function On(){if(mr)return Ue;mr=1,Object.defineProperty(Ue,"__esModule",{value:!0});const e=J(),S={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:d})=>(0,e.str)`must be multiple of ${d}`,params:({schemaCode:d})=>(0,e._)`{multipleOf: ${d}}`},code(d){const{gen:b,data:s,schemaCode:f,it:l}=d,m=l.opts.multipleOfPrecision,$=b.let("res"),_=m?(0,e._)`Math.abs(Math.round(${$}) - ${$}) > 1e-${m}`:(0,e._)`${$} !== parseInt(${$})`;d.fail$data((0,e._)`(${f} === 0 || (${$} = ${s}/${f}, ${_}))`)}};return Ue.default=S,Ue}var ze={},Fe={},pr;function kn(){if(pr)return Fe;pr=1,Object.defineProperty(Fe,"__esModule",{value:!0});function e(n){const S=n.length;let d=0,b=0,s;for(;b<S;)d++,s=n.charCodeAt(b++),s>=55296&&s<=56319&&b<S&&(s=n.charCodeAt(b),(s&64512)===56320&&b++);return d}return Fe.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',Fe}var yr;function jn(){if(yr)return ze;yr=1,Object.defineProperty(ze,"__esModule",{value:!0});const e=J(),n=Q(),S=kn(),b={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:f}){const l=s==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${l} than ${f} characters`},params:({schemaCode:s})=>(0,e._)`{limit: ${s}}`},code(s){const{keyword:f,data:l,schemaCode:m,it:$}=s,_=f==="maxLength"?e.operators.GT:e.operators.LT,P=$.opts.unicode===!1?(0,e._)`${l}.length`:(0,e._)`${(0,n.useFunc)(s.gen,S.default)}(${l})`;s.fail$data((0,e._)`${P} ${_} ${m}`)}};return ze.default=b,ze}var Ke={},_r;function In(){if(_r)return Ke;_r=1,Object.defineProperty(Ke,"__esModule",{value:!0});const e=le(),n=J(),d={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:b})=>(0,n.str)`must match pattern "${b}"`,params:({schemaCode:b})=>(0,n._)`{pattern: ${b}}`},code(b){const{data:s,$data:f,schema:l,schemaCode:m,it:$}=b,_=$.opts.unicodeRegExp?"u":"",P=f?(0,n._)`(new RegExp(${m}, ${_}))`:(0,e.usePattern)(b,l);b.fail$data((0,n._)`!${P}.test(${s})`)}};return Ke.default=d,Ke}var Le={},vr;function qn(){if(vr)return Le;vr=1,Object.defineProperty(Le,"__esModule",{value:!0});const e=J(),S={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:d,schemaCode:b}){const s=d==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${b} properties`},params:({schemaCode:d})=>(0,e._)`{limit: ${d}}`},code(d){const{keyword:b,data:s,schemaCode:f}=d,l=b==="maxProperties"?e.operators.GT:e.operators.LT;d.fail$data((0,e._)`Object.keys(${s}).length ${l} ${f}`)}};return Le.default=S,Le}var He={},gr;function Tn(){if(gr)return He;gr=1,Object.defineProperty(He,"__esModule",{value:!0});const e=le(),n=J(),S=Q(),b={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,n.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,n._)`{missingProperty: ${s}}`},code(s){const{gen:f,schema:l,schemaCode:m,data:$,$data:_,it:P}=s,{opts:v}=P;if(!_&&l.length===0)return;const y=l.length>=v.loopRequired;if(P.allErrors?p():w(),v.strictRequired){const t=s.parentSchema.properties,{definedProperties:o}=s.it;for(const h of l)if(t?.[h]===void 0&&!o.has(h)){const r=P.schemaEnv.baseId+P.errSchemaPath,c=`required property "${h}" is not defined at "${r}" (strictRequired)`;(0,S.checkStrictMode)(P,c,P.opts.strictRequired)}}function p(){if(y||_)s.block$data(n.nil,a);else for(const t of l)(0,e.checkReportMissingProp)(s,t)}function w(){const t=f.let("missing");if(y||_){const o=f.let("valid",!0);s.block$data(o,()=>i(t,o)),s.ok(o)}else f.if((0,e.checkMissingProp)(s,l,t)),(0,e.reportMissingProp)(s,t),f.else()}function a(){f.forOf("prop",m,t=>{s.setParams({missingProperty:t}),f.if((0,e.noPropertyInData)(f,$,t,v.ownProperties),()=>s.error())})}function i(t,o){s.setParams({missingProperty:t}),f.forOf(t,m,()=>{f.assign(o,(0,e.propertyInData)(f,$,t,v.ownProperties)),f.if((0,n.not)(o),()=>{s.error(),f.break()})},n.nil)}}};return He.default=b,He}var Ge={},$r;function Cn(){if($r)return Ge;$r=1,Object.defineProperty(Ge,"__esModule",{value:!0});const e=J(),S={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:d,schemaCode:b}){const s=d==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${b} items`},params:({schemaCode:d})=>(0,e._)`{limit: ${d}}`},code(d){const{keyword:b,data:s,schemaCode:f}=d,l=b==="maxItems"?e.operators.GT:e.operators.LT;d.fail$data((0,e._)`${s}.length ${l} ${f}`)}};return Ge.default=S,Ge}var Je={},We={},wr;function Ct(){if(wr)return We;wr=1,Object.defineProperty(We,"__esModule",{value:!0});const e=Zr();return e.code='require("ajv/dist/runtime/equal").default',We.default=e,We}var br;function An(){if(br)return Je;br=1,Object.defineProperty(Je,"__esModule",{value:!0});const e=mt(),n=J(),S=Q(),d=Ct(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:f,j:l}})=>(0,n.str)`must NOT have duplicate items (items ## ${l} and ${f} are identical)`,params:({params:{i:f,j:l}})=>(0,n._)`{i: ${f}, j: ${l}}`},code(f){const{gen:l,data:m,$data:$,schema:_,parentSchema:P,schemaCode:v,it:y}=f;if(!$&&!_)return;const p=l.let("valid"),w=P.items?(0,e.getSchemaTypes)(P.items):[];f.block$data(p,a,(0,n._)`${v} === false`),f.ok(p);function a(){const h=l.let("i",(0,n._)`${m}.length`),r=l.let("j");f.setParams({i:h,j:r}),l.assign(p,!0),l.if((0,n._)`${h} > 1`,()=>(i()?t:o)(h,r))}function i(){return w.length>0&&!w.some(h=>h==="object"||h==="array")}function t(h,r){const c=l.name("item"),g=(0,e.checkDataTypes)(w,c,y.opts.strictNumbers,e.DataType.Wrong),j=l.const("indices",(0,n._)`{}`);l.for((0,n._)`;${h}--;`,()=>{l.let(c,(0,n._)`${m}[${h}]`),l.if(g,(0,n._)`continue`),w.length>1&&l.if((0,n._)`typeof ${c} == "string"`,(0,n._)`${c} += "_"`),l.if((0,n._)`typeof ${j}[${c}] == "number"`,()=>{l.assign(r,(0,n._)`${j}[${c}]`),f.error(),l.assign(p,!1).break()}).code((0,n._)`${j}[${c}] = ${h}`)})}function o(h,r){const c=(0,S.useFunc)(l,d.default),g=l.name("outer");l.label(g).for((0,n._)`;${h}--;`,()=>l.for((0,n._)`${r} = ${h}; ${r}--;`,()=>l.if((0,n._)`${c}(${m}[${h}], ${m}[${r}])`,()=>{f.error(),l.assign(p,!1).break(g)})))}}};return Je.default=s,Je}var Be={},Er;function Mn(){if(Er)return Be;Er=1,Object.defineProperty(Be,"__esModule",{value:!0});const e=J(),n=Q(),S=Ct(),b={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,e._)`{allowedValue: ${s}}`},code(s){const{gen:f,data:l,$data:m,schemaCode:$,schema:_}=s;m||_&&typeof _=="object"?s.fail$data((0,e._)`!${(0,n.useFunc)(f,S.default)}(${l}, ${$})`):s.fail((0,e._)`${_} !== ${l}`)}};return Be.default=b,Be}var Qe={},Sr;function Dn(){if(Sr)return Qe;Sr=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e=J(),n=Q(),S=Ct(),b={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,e._)`{allowedValues: ${s}}`},code(s){const{gen:f,data:l,$data:m,schema:$,schemaCode:_,it:P}=s;if(!m&&$.length===0)throw new Error("enum must have non-empty array");const v=$.length>=P.opts.loopEnum;let y;const p=()=>y??(y=(0,n.useFunc)(f,S.default));let w;if(v||m)w=f.let("valid"),s.block$data(w,a);else{if(!Array.isArray($))throw new Error("ajv implementation error");const t=f.const("vSchema",_);w=(0,e.or)(...$.map((o,h)=>i(t,h)))}s.pass(w);function a(){f.assign(w,!1),f.forOf("v",_,t=>f.if((0,e._)`${p()}(${l}, ${t})`,()=>f.assign(w,!0).break()))}function i(t,o){const h=$[o];return typeof h=="object"&&h!==null?(0,e._)`${p()}(${l}, ${t}[${o}])`:(0,e._)`${l} === ${h}`}}};return Qe.default=b,Qe}var Pr;function Vn(){if(Pr)return De;Pr=1,Object.defineProperty(De,"__esModule",{value:!0});const e=Rn(),n=On(),S=jn(),d=In(),b=qn(),s=Tn(),f=Cn(),l=An(),m=Mn(),$=Dn(),_=[e.default,n.default,S.default,d.default,b.default,s.default,f.default,l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},m.default,$.default];return De.default=_,De}var Xe={},Ee={},Nr;function en(){if(Nr)return Ee;Nr=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.validateAdditionalItems=void 0;const e=J(),n=Q(),d={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{parentSchema:f,it:l}=s,{items:m}=f;if(!Array.isArray(m)){(0,n.checkStrictMode)(l,'"additionalItems" is ignored when "items" is not an array of schemas');return}b(s,m)}};function b(s,f){const{gen:l,schema:m,data:$,keyword:_,it:P}=s;P.items=!0;const v=l.const("len",(0,e._)`${$}.length`);if(m===!1)s.setParams({len:f.length}),s.pass((0,e._)`${v} <= ${f.length}`);else if(typeof m=="object"&&!(0,n.alwaysValidSchema)(P,m)){const p=l.var("valid",(0,e._)`${v} <= ${f.length}`);l.if((0,e.not)(p),()=>y(p)),s.ok(p)}function y(p){l.forRange("i",f.length,v,w=>{s.subschema({keyword:_,dataProp:w,dataPropType:n.Type.Num},p),P.allErrors||l.if((0,e.not)(p),()=>l.break())})}}return Ee.validateAdditionalItems=b,Ee.default=d,Ee}var Ye={},Se={},Rr;function tn(){if(Rr)return Se;Rr=1,Object.defineProperty(Se,"__esModule",{value:!0}),Se.validateTuple=void 0;const e=J(),n=Q(),S=le(),d={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:f,it:l}=s;if(Array.isArray(f))return b(s,"additionalItems",f);l.items=!0,!(0,n.alwaysValidSchema)(l,f)&&s.ok((0,S.validateArray)(s))}};function b(s,f,l=s.schema){const{gen:m,parentSchema:$,data:_,keyword:P,it:v}=s;w($),v.opts.unevaluated&&l.length&&v.items!==!0&&(v.items=n.mergeEvaluated.items(m,l.length,v.items));const y=m.name("valid"),p=m.const("len",(0,e._)`${_}.length`);l.forEach((a,i)=>{(0,n.alwaysValidSchema)(v,a)||(m.if((0,e._)`${p} > ${i}`,()=>s.subschema({keyword:P,schemaProp:i,dataProp:i},y)),s.ok(y))});function w(a){const{opts:i,errSchemaPath:t}=v,o=l.length,h=o===a.minItems&&(o===a.maxItems||a[f]===!1);if(i.strictTuples&&!h){const r=`"${P}" is ${o}-tuple, but minItems or maxItems/${f} are not specified or different at path "${t}"`;(0,n.checkStrictMode)(v,r,i.strictTuples)}}}return Se.validateTuple=b,Se.default=d,Se}var Or;function Un(){if(Or)return Ye;Or=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e=tn(),n={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:S=>(0,e.validateTuple)(S,"items")};return Ye.default=n,Ye}var Ze={},kr;function zn(){if(kr)return Ze;kr=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=J(),n=Q(),S=le(),d=en(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:f}})=>(0,e.str)`must NOT have more than ${f} items`,params:({params:{len:f}})=>(0,e._)`{limit: ${f}}`},code(f){const{schema:l,parentSchema:m,it:$}=f,{prefixItems:_}=m;$.items=!0,!(0,n.alwaysValidSchema)($,l)&&(_?(0,d.validateAdditionalItems)(f,_):f.ok((0,S.validateArray)(f)))}};return Ze.default=s,Ze}var xe={},jr;function Fn(){if(jr)return xe;jr=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=J(),n=Q(),d={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:b,max:s}})=>s===void 0?(0,e.str)`must contain at least ${b} valid item(s)`:(0,e.str)`must contain at least ${b} and no more than ${s} valid item(s)`,params:({params:{min:b,max:s}})=>s===void 0?(0,e._)`{minContains: ${b}}`:(0,e._)`{minContains: ${b}, maxContains: ${s}}`},code(b){const{gen:s,schema:f,parentSchema:l,data:m,it:$}=b;let _,P;const{minContains:v,maxContains:y}=l;$.opts.next?(_=v===void 0?1:v,P=y):_=1;const p=s.const("len",(0,e._)`${m}.length`);if(b.setParams({min:_,max:P}),P===void 0&&_===0){(0,n.checkStrictMode)($,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(P!==void 0&&_>P){(0,n.checkStrictMode)($,'"minContains" > "maxContains" is always invalid'),b.fail();return}if((0,n.alwaysValidSchema)($,f)){let o=(0,e._)`${p} >= ${_}`;P!==void 0&&(o=(0,e._)`${o} && ${p} <= ${P}`),b.pass(o);return}$.items=!0;const w=s.name("valid");P===void 0&&_===1?i(w,()=>s.if(w,()=>s.break())):_===0?(s.let(w,!0),P!==void 0&&s.if((0,e._)`${m}.length > 0`,a)):(s.let(w,!1),a()),b.result(w,()=>b.reset());function a(){const o=s.name("_valid"),h=s.let("count",0);i(o,()=>s.if(o,()=>t(h)))}function i(o,h){s.forRange("i",0,p,r=>{b.subschema({keyword:"contains",dataProp:r,dataPropType:n.Type.Num,compositeRule:!0},o),h()})}function t(o){s.code((0,e._)`${o}++`),P===void 0?s.if((0,e._)`${o} >= ${_}`,()=>s.assign(w,!0).break()):(s.if((0,e._)`${o} > ${P}`,()=>s.assign(w,!1).break()),_===1?s.assign(w,!0):s.if((0,e._)`${o} >= ${_}`,()=>s.assign(w,!0)))}}};return xe.default=d,xe}var It={},Ir;function Kn(){return Ir||(Ir=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const n=J(),S=Q(),d=le();e.error={message:({params:{property:m,depsCount:$,deps:_}})=>{const P=$===1?"property":"properties";return(0,n.str)`must have ${P} ${_} when property ${m} is present`},params:({params:{property:m,depsCount:$,deps:_,missingProperty:P}})=>(0,n._)`{property: ${m},
6
+ missingProperty: ${P},
7
+ depsCount: ${$},
8
+ deps: ${_}}`};const b={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(m){const[$,_]=s(m);f(m,$),l(m,_)}};function s({schema:m}){const $={},_={};for(const P in m){if(P==="__proto__")continue;const v=Array.isArray(m[P])?$:_;v[P]=m[P]}return[$,_]}function f(m,$=m.schema){const{gen:_,data:P,it:v}=m;if(Object.keys($).length===0)return;const y=_.let("missing");for(const p in $){const w=$[p];if(w.length===0)continue;const a=(0,d.propertyInData)(_,P,p,v.opts.ownProperties);m.setParams({property:p,depsCount:w.length,deps:w.join(", ")}),v.allErrors?_.if(a,()=>{for(const i of w)(0,d.checkReportMissingProp)(m,i)}):(_.if((0,n._)`${a} && (${(0,d.checkMissingProp)(m,w,y)})`),(0,d.reportMissingProp)(m,y),_.else())}}e.validatePropertyDeps=f;function l(m,$=m.schema){const{gen:_,data:P,keyword:v,it:y}=m,p=_.name("valid");for(const w in $)(0,S.alwaysValidSchema)(y,$[w])||(_.if((0,d.propertyInData)(_,P,w,y.opts.ownProperties),()=>{const a=m.subschema({keyword:v,schemaProp:w},p);m.mergeValidEvaluated(a,p)},()=>_.var(p,!0)),m.ok(p))}e.validateSchemaDeps=l,e.default=b})(It)),It}var et={},qr;function Ln(){if(qr)return et;qr=1,Object.defineProperty(et,"__esModule",{value:!0});const e=J(),n=Q(),d={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:b})=>(0,e._)`{propertyName: ${b.propertyName}}`},code(b){const{gen:s,schema:f,data:l,it:m}=b;if((0,n.alwaysValidSchema)(m,f))return;const $=s.name("valid");s.forIn("key",l,_=>{b.setParams({propertyName:_}),b.subschema({keyword:"propertyNames",data:_,dataTypes:["string"],propertyName:_,compositeRule:!0},$),s.if((0,e.not)($),()=>{b.error(!0),m.allErrors||s.break()})}),b.ok($)}};return et.default=d,et}var tt={},Tr;function rn(){if(Tr)return tt;Tr=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=le(),n=J(),S=ve(),d=Q(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:f})=>(0,n._)`{additionalProperty: ${f.additionalProperty}}`},code(f){const{gen:l,schema:m,parentSchema:$,data:_,errsCount:P,it:v}=f;if(!P)throw new Error("ajv implementation error");const{allErrors:y,opts:p}=v;if(v.props=!0,p.removeAdditional!=="all"&&(0,d.alwaysValidSchema)(v,m))return;const w=(0,e.allSchemaProperties)($.properties),a=(0,e.allSchemaProperties)($.patternProperties);i(),f.ok((0,n._)`${P} === ${S.default.errors}`);function i(){l.forIn("key",_,c=>{!w.length&&!a.length?h(c):l.if(t(c),()=>h(c))})}function t(c){let g;if(w.length>8){const j=(0,d.schemaRefOrVal)(v,$.properties,"properties");g=(0,e.isOwnProperty)(l,j,c)}else w.length?g=(0,n.or)(...w.map(j=>(0,n._)`${c} === ${j}`)):g=n.nil;return a.length&&(g=(0,n.or)(g,...a.map(j=>(0,n._)`${(0,e.usePattern)(f,j)}.test(${c})`))),(0,n.not)(g)}function o(c){l.code((0,n._)`delete ${_}[${c}]`)}function h(c){if(p.removeAdditional==="all"||p.removeAdditional&&m===!1){o(c);return}if(m===!1){f.setParams({additionalProperty:c}),f.error(),y||l.break();return}if(typeof m=="object"&&!(0,d.alwaysValidSchema)(v,m)){const g=l.name("valid");p.removeAdditional==="failing"?(r(c,g,!1),l.if((0,n.not)(g),()=>{f.reset(),o(c)})):(r(c,g),y||l.if((0,n.not)(g),()=>l.break()))}}function r(c,g,j){const C={keyword:"additionalProperties",dataProp:c,dataPropType:d.Type.Str};j===!1&&Object.assign(C,{compositeRule:!0,createErrors:!1,allErrors:!1}),f.subschema(C,g)}}};return tt.default=s,tt}var rt={},Cr;function Hn(){if(Cr)return rt;Cr=1,Object.defineProperty(rt,"__esModule",{value:!0});const e=_t(),n=le(),S=Q(),d=rn(),b={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:f,schema:l,parentSchema:m,data:$,it:_}=s;_.opts.removeAdditional==="all"&&m.additionalProperties===void 0&&d.default.code(new e.KeywordCxt(_,d.default,"additionalProperties"));const P=(0,n.allSchemaProperties)(l);for(const a of P)_.definedProperties.add(a);_.opts.unevaluated&&P.length&&_.props!==!0&&(_.props=S.mergeEvaluated.props(f,(0,S.toHash)(P),_.props));const v=P.filter(a=>!(0,S.alwaysValidSchema)(_,l[a]));if(v.length===0)return;const y=f.name("valid");for(const a of v)p(a)?w(a):(f.if((0,n.propertyInData)(f,$,a,_.opts.ownProperties)),w(a),_.allErrors||f.else().var(y,!0),f.endIf()),s.it.definedProperties.add(a),s.ok(y);function p(a){return _.opts.useDefaults&&!_.compositeRule&&l[a].default!==void 0}function w(a){s.subschema({keyword:"properties",schemaProp:a,dataProp:a},y)}}};return rt.default=b,rt}var nt={},Ar;function Gn(){if(Ar)return nt;Ar=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=le(),n=J(),S=Q(),d=Q(),b={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:f,schema:l,data:m,parentSchema:$,it:_}=s,{opts:P}=_,v=(0,e.allSchemaProperties)(l),y=v.filter(h=>(0,S.alwaysValidSchema)(_,l[h]));if(v.length===0||y.length===v.length&&(!_.opts.unevaluated||_.props===!0))return;const p=P.strictSchema&&!P.allowMatchingProperties&&$.properties,w=f.name("valid");_.props!==!0&&!(_.props instanceof n.Name)&&(_.props=(0,d.evaluatedPropsToName)(f,_.props));const{props:a}=_;i();function i(){for(const h of v)p&&t(h),_.allErrors?o(h):(f.var(w,!0),o(h),f.if(w))}function t(h){for(const r in p)new RegExp(h).test(r)&&(0,S.checkStrictMode)(_,`property ${r} matches pattern ${h} (use allowMatchingProperties)`)}function o(h){f.forIn("key",m,r=>{f.if((0,n._)`${(0,e.usePattern)(s,h)}.test(${r})`,()=>{const c=y.includes(h);c||s.subschema({keyword:"patternProperties",schemaProp:h,dataProp:r,dataPropType:d.Type.Str},w),_.opts.unevaluated&&a!==!0?f.assign((0,n._)`${a}[${r}]`,!0):!c&&!_.allErrors&&f.if((0,n.not)(w),()=>f.break())})})}}};return nt.default=b,nt}var st={},Mr;function Jn(){if(Mr)return st;Mr=1,Object.defineProperty(st,"__esModule",{value:!0});const e=Q(),n={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(S){const{gen:d,schema:b,it:s}=S;if((0,e.alwaysValidSchema)(s,b)){S.fail();return}const f=d.name("valid");S.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},f),S.failResult(f,()=>S.reset(),()=>S.error())},error:{message:"must NOT be valid"}};return st.default=n,st}var at={},Dr;function Wn(){if(Dr)return at;Dr=1,Object.defineProperty(at,"__esModule",{value:!0});const n={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:le().validateUnion,error:{message:"must match a schema in anyOf"}};return at.default=n,at}var ot={},Vr;function Bn(){if(Vr)return ot;Vr=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=J(),n=Q(),d={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:b})=>(0,e._)`{passingSchemas: ${b.passing}}`},code(b){const{gen:s,schema:f,parentSchema:l,it:m}=b;if(!Array.isArray(f))throw new Error("ajv implementation error");if(m.opts.discriminator&&l.discriminator)return;const $=f,_=s.let("valid",!1),P=s.let("passing",null),v=s.name("_valid");b.setParams({passing:P}),s.block(y),b.result(_,()=>b.reset(),()=>b.error(!0));function y(){$.forEach((p,w)=>{let a;(0,n.alwaysValidSchema)(m,p)?s.var(v,!0):a=b.subschema({keyword:"oneOf",schemaProp:w,compositeRule:!0},v),w>0&&s.if((0,e._)`${v} && ${_}`).assign(_,!1).assign(P,(0,e._)`[${P}, ${w}]`).else(),s.if(v,()=>{s.assign(_,!0),s.assign(P,w),a&&b.mergeEvaluated(a,e.Name)})})}}};return ot.default=d,ot}var it={},Ur;function Qn(){if(Ur)return it;Ur=1,Object.defineProperty(it,"__esModule",{value:!0});const e=Q(),n={keyword:"allOf",schemaType:"array",code(S){const{gen:d,schema:b,it:s}=S;if(!Array.isArray(b))throw new Error("ajv implementation error");const f=d.name("valid");b.forEach((l,m)=>{if((0,e.alwaysValidSchema)(s,l))return;const $=S.subschema({keyword:"allOf",schemaProp:m},f);S.ok(f),S.mergeEvaluated($)})}};return it.default=n,it}var ut={},zr;function Xn(){if(zr)return ut;zr=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=J(),n=Q(),d={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,e._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:f,parentSchema:l,it:m}=s;l.then===void 0&&l.else===void 0&&(0,n.checkStrictMode)(m,'"if" without "then" and "else" is ignored');const $=b(m,"then"),_=b(m,"else");if(!$&&!_)return;const P=f.let("valid",!0),v=f.name("_valid");if(y(),s.reset(),$&&_){const w=f.let("ifClause");s.setParams({ifClause:w}),f.if(v,p("then",w),p("else",w))}else $?f.if(v,p("then")):f.if((0,e.not)(v),p("else"));s.pass(P,()=>s.error(!0));function y(){const w=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},v);s.mergeEvaluated(w)}function p(w,a){return()=>{const i=s.subschema({keyword:w},v);f.assign(P,v),s.mergeValidEvaluated(i,P),a?f.assign(a,(0,e._)`${w}`):s.setParams({ifClause:w})}}}};function b(s,f){const l=s.schema[f];return l!==void 0&&!(0,n.alwaysValidSchema)(s,l)}return ut.default=d,ut}var ct={},Fr;function Yn(){if(Fr)return ct;Fr=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=Q(),n={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:S,parentSchema:d,it:b}){d.if===void 0&&(0,e.checkStrictMode)(b,`"${S}" without "if" is ignored`)}};return ct.default=n,ct}var Kr;function Zn(){if(Kr)return Xe;Kr=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=en(),n=Un(),S=tn(),d=zn(),b=Fn(),s=Kn(),f=Ln(),l=rn(),m=Hn(),$=Gn(),_=Jn(),P=Wn(),v=Bn(),y=Qn(),p=Xn(),w=Yn();function a(i=!1){const t=[_.default,P.default,v.default,y.default,p.default,w.default,f.default,l.default,s.default,m.default,$.default];return i?t.push(n.default,d.default):t.push(e.default,S.default),t.push(b.default),t}return Xe.default=a,Xe}var lt={},dt={},Lr;function xn(){if(Lr)return dt;Lr=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=J(),S={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:d})=>(0,e.str)`must match format "${d}"`,params:({schemaCode:d})=>(0,e._)`{format: ${d}}`},code(d,b){const{gen:s,data:f,$data:l,schema:m,schemaCode:$,it:_}=d,{opts:P,errSchemaPath:v,schemaEnv:y,self:p}=_;if(!P.validateFormats)return;l?w():a();function w(){const i=s.scopeValue("formats",{ref:p.formats,code:P.code.formats}),t=s.const("fDef",(0,e._)`${i}[${$}]`),o=s.let("fType"),h=s.let("format");s.if((0,e._)`typeof ${t} == "object" && !(${t} instanceof RegExp)`,()=>s.assign(o,(0,e._)`${t}.type || "string"`).assign(h,(0,e._)`${t}.validate`),()=>s.assign(o,(0,e._)`"string"`).assign(h,t)),d.fail$data((0,e.or)(r(),c()));function r(){return P.strictSchema===!1?e.nil:(0,e._)`${$} && !${h}`}function c(){const g=y.$async?(0,e._)`(${t}.async ? await ${h}(${f}) : ${h}(${f}))`:(0,e._)`${h}(${f})`,j=(0,e._)`(typeof ${h} == "function" ? ${g} : ${h}.test(${f}))`;return(0,e._)`${h} && ${h} !== true && ${o} === ${b} && !${j}`}}function a(){const i=p.formats[m];if(!i){r();return}if(i===!0)return;const[t,o,h]=c(i);t===b&&d.pass(g());function r(){if(P.strictSchema===!1){p.logger.warn(j());return}throw new Error(j());function j(){return`unknown format "${m}" ignored in schema at path "${v}"`}}function c(j){const C=j instanceof RegExp?(0,e.regexpCode)(j):P.code.formats?(0,e._)`${P.code.formats}${(0,e.getProperty)(m)}`:void 0,D=s.scopeValue("formats",{key:m,ref:j,code:C});return typeof j=="object"&&!(j instanceof RegExp)?[j.type||"string",j.validate,(0,e._)`${D}.validate`]:["string",j,D]}function g(){if(typeof i=="object"&&!(i instanceof RegExp)&&i.async){if(!y.$async)throw new Error("async format in sync schema");return(0,e._)`await ${h}(${f})`}return typeof o=="function"?(0,e._)`${h}(${f})`:(0,e._)`${h}.test(${f})`}}}};return dt.default=S,dt}var Hr;function es(){if(Hr)return lt;Hr=1,Object.defineProperty(lt,"__esModule",{value:!0});const n=[xn().default];return lt.default=n,lt}var we={},Gr;function ts(){return Gr||(Gr=1,Object.defineProperty(we,"__esModule",{value:!0}),we.contentVocabulary=we.metadataVocabulary=void 0,we.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],we.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),we}var Jr;function rs(){if(Jr)return Ce;Jr=1,Object.defineProperty(Ce,"__esModule",{value:!0});const e=Nn(),n=Vn(),S=Zn(),d=es(),b=ts(),s=[e.default,n.default,(0,S.default)(),d.default,b.metadataVocabulary,b.contentVocabulary];return Ce.default=s,Ce}var ft={},Oe={},Wr;function ns(){if(Wr)return Oe;Wr=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.DiscrError=void 0;var e;return(function(n){n.Tag="tag",n.Mapping="mapping"})(e||(Oe.DiscrError=e={})),Oe}var Br;function ss(){if(Br)return ft;Br=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=J(),n=ns(),S=Tt(),d=vt(),b=Q(),f={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:l,tagName:m}})=>l===n.DiscrError.Tag?`tag "${m}" must be string`:`value of tag "${m}" must be in oneOf`,params:({params:{discrError:l,tag:m,tagName:$}})=>(0,e._)`{error: ${l}, tag: ${$}, tagValue: ${m}}`},code(l){const{gen:m,data:$,schema:_,parentSchema:P,it:v}=l,{oneOf:y}=P;if(!v.opts.discriminator)throw new Error("discriminator: requires discriminator option");const p=_.propertyName;if(typeof p!="string")throw new Error("discriminator: requires propertyName");if(_.mapping)throw new Error("discriminator: mapping is not supported");if(!y)throw new Error("discriminator: requires oneOf keyword");const w=m.let("valid",!1),a=m.const("tag",(0,e._)`${$}${(0,e.getProperty)(p)}`);m.if((0,e._)`typeof ${a} == "string"`,()=>i(),()=>l.error(!1,{discrError:n.DiscrError.Tag,tag:a,tagName:p})),l.ok(w);function i(){const h=o();m.if(!1);for(const r in h)m.elseIf((0,e._)`${a} === ${r}`),m.assign(w,t(h[r]));m.else(),l.error(!1,{discrError:n.DiscrError.Mapping,tag:a,tagName:p}),m.endIf()}function t(h){const r=m.name("valid"),c=l.subschema({keyword:"oneOf",schemaProp:h},r);return l.mergeEvaluated(c,e.Name),r}function o(){var h;const r={},c=j(P);let g=!0;for(let V=0;V<y.length;V++){let L=y[V];if(L?.$ref&&!(0,b.schemaHasRulesButRef)(L,v.self.RULES)){const B=L.$ref;if(L=S.resolveRef.call(v.self,v.schemaEnv.root,v.baseId,B),L instanceof S.SchemaEnv&&(L=L.schema),L===void 0)throw new d.default(v.opts.uriResolver,v.baseId,B)}const K=(h=L?.properties)===null||h===void 0?void 0:h[p];if(typeof K!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${p}"`);g=g&&(c||j(L)),C(K,V)}if(!g)throw new Error(`discriminator: "${p}" must be required`);return r;function j({required:V}){return Array.isArray(V)&&V.includes(p)}function C(V,L){if(V.const)D(V.const,L);else if(V.enum)for(const K of V.enum)D(K,L);else throw new Error(`discriminator: "properties/${p}" must have "const" or "enum"`)}function D(V,L){if(typeof V!="string"||V in r)throw new Error(`discriminator: "${p}" values must be unique strings`);r[V]=L}}}};return ft.default=f,ft}const as="http://json-schema.org/draft-07/schema#",os="http://json-schema.org/draft-07/schema#",is="Core schema meta-schema",us={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},cs=["object","boolean"],ls={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},ds={$schema:as,$id:os,title:is,definitions:us,type:cs,properties:ls,default:!0};var Qr;function fs(){return Qr||(Qr=1,(function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.MissingRefError=n.ValidationError=n.CodeGen=n.Name=n.nil=n.stringify=n.str=n._=n.KeywordCxt=n.Ajv=void 0;const S=En(),d=rs(),b=ss(),s=ds,f=["/properties"],l="http://json-schema.org/draft-07/schema";class m extends S.default{_addVocabularies(){super._addVocabularies(),d.default.forEach(p=>this.addVocabulary(p)),this.opts.discriminator&&this.addKeyword(b.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const p=this.opts.$data?this.$dataMetaSchema(s,f):s;this.addMetaSchema(p,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}n.Ajv=m,e.exports=n=m,e.exports.Ajv=m,Object.defineProperty(n,"__esModule",{value:!0}),n.default=m;var $=_t();Object.defineProperty(n,"KeywordCxt",{enumerable:!0,get:function(){return $.KeywordCxt}});var _=J();Object.defineProperty(n,"_",{enumerable:!0,get:function(){return _._}}),Object.defineProperty(n,"str",{enumerable:!0,get:function(){return _.str}}),Object.defineProperty(n,"stringify",{enumerable:!0,get:function(){return _.stringify}}),Object.defineProperty(n,"nil",{enumerable:!0,get:function(){return _.nil}}),Object.defineProperty(n,"Name",{enumerable:!0,get:function(){return _.Name}}),Object.defineProperty(n,"CodeGen",{enumerable:!0,get:function(){return _.CodeGen}});var P=qt();Object.defineProperty(n,"ValidationError",{enumerable:!0,get:function(){return P.default}});var v=vt();Object.defineProperty(n,"MissingRefError",{enumerable:!0,get:function(){return v.default}})})(ke,ke.exports)),ke.exports}var nn=fs();const hs=an(nn),ps=on({__proto__:null,default:hs},[nn]);export{ps as a};