@streamline-pulse/formkrafter-wc 0.5.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/components/fk-brick-render.js +1 -1
  2. package/dist/components/fk-code-editor.js +1 -1
  3. package/dist/components/fk-data-grid.js +1 -1
  4. package/dist/components/fk-file-input.js +1 -1
  5. package/dist/components/fk-form-builder.js +1 -1
  6. package/dist/components/fk-form-render.js +1 -1
  7. package/dist/components/fk-property-panel.js +1 -1
  8. package/dist/components/fk-rules-editor.js +1 -1
  9. package/dist/components/fk-select-input.js +1 -1
  10. package/dist/components/fk-stepper.js +1 -1
  11. package/dist/components/fk-tabs.js +1 -1
  12. package/dist/components/index.js +1 -1
  13. package/dist/components/{p-BYhtwUM4.js → p-38x7HHH5.js} +4 -4
  14. package/dist/components/{p-CKAZ15-B.js → p-8ZeGXEsz.js} +1 -1
  15. package/dist/components/{p-DQKpUpzo.js → p-B7Wn62C3.js} +1 -1
  16. package/dist/components/{p-dFTWRHWl.js → p-B87l6fG8.js} +1 -1
  17. package/dist/components/{p-BQIUKz-H.js → p-CBWGephQ.js} +1 -1
  18. package/dist/components/{p-COkZvRcY.js → p-ChORrvt0.js} +1 -1
  19. package/dist/{formkrafter-wc/p-_JpQ28sq.js → components/p-CtXlkz3R.js} +1 -1
  20. package/dist/components/{p-BJ7u_t3N.js → p-CzZHZjz2.js} +1 -1
  21. package/dist/components/{p-C3SjLyf4.js → p-DRAcLQJd.js} +1 -1
  22. package/dist/components/p-DX8WH8Dt.js +1 -0
  23. package/dist/{formkrafter-wc/p-DOTbu58d.js → components/p-DZTNUdkF.js} +1 -1
  24. package/dist/components/{p-CAilSzZp.js → p-Do6vaAvb.js} +1 -1
  25. package/dist/components/p-Ptnsxtwv.js +1 -0
  26. package/dist/components/{p-DtO4LFLi.js → p-YFczER4B.js} +1 -1
  27. package/dist/components/p-jUqF8CGO.js +1 -0
  28. package/dist/components/p-p20GeeQY.js +1 -0
  29. package/dist/components/{p-DyI9tTC9.js → p-x9Ll7hS1.js} +1 -1
  30. package/dist/formkrafter-wc/formkrafter-wc.esm.js +1 -1
  31. package/dist/formkrafter-wc/index.esm.js +1 -1
  32. package/dist/formkrafter-wc/p-7c143286.entry.js +1 -0
  33. package/dist/formkrafter-wc/{p-DvzB4zo1.js → p-C7yLpAp-.js} +2 -2
  34. package/dist/{components/p-_JpQ28sq.js → formkrafter-wc/p-CtXlkz3R.js} +1 -1
  35. package/dist/formkrafter-wc/{p-BJ7u_t3N.js → p-CzZHZjz2.js} +1 -1
  36. package/dist/{components/p-DOTbu58d.js → formkrafter-wc/p-DZTNUdkF.js} +1 -1
  37. package/dist/formkrafter-wc/{p-CAilSzZp.js → p-Do6vaAvb.js} +1 -1
  38. package/dist/formkrafter-wc/{p-BjBiz89q.js → p-NJy5rYft.js} +1 -1
  39. package/dist/formkrafter-wc/p-jUqF8CGO.js +1 -0
  40. package/package.json +2 -2
  41. package/dist/components/p-BKT368_B.js +0 -1
  42. package/dist/components/p-CV2J_nG8.js +0 -1
  43. package/dist/components/p-CfLRuUU4.js +0 -1
  44. package/dist/components/p-Cg-VvkW4.js +0 -1
  45. package/dist/formkrafter-wc/p-954e842c.entry.js +0 -1
  46. package/dist/formkrafter-wc/p-CfLRuUU4.js +0 -1
@@ -1,7 +1,7 @@
1
1
  import{h as t}from"./p-qLZlXROB.js";import{f as e,a as i}from"./p-DYsf28oe.js";var r;const n=Symbol.for("formkrafter.wc.bricks"),s=globalThis,o=null!==(r=s[n])&&void 0!==r?r:s[n]=new Map,a=(t,e)=>`${t}:${e}`;function u(t){o.set(a(t.type,t.id),t)}function h(t){t.forEach(u)}function c(t,e){return o.get(a(t,e))}function f(){return[...o.values()].filter((t=>!t.isPrivate)).map((t=>({type:t.type,id:t.id,name:t.name,configsForm:t.configsForm,category:t.category,isPrivate:t.isPrivate})))}function l(){var t,e;const i={};for(const r of f()){const n=null!==(t=r.category)&&void 0!==t?t:"Uncategorized";(null!==(e=i[n])&&void 0!==e?e:i[n]=[]).push(r)}return i}function d(t,e){var i,r;const n=c(t,e);if(!n)return;const s=n.getBrickEmptySpec(),o=crypto.randomUUID();return Object.assign(Object.assign({},s),{configs:Object.assign(Object.assign({},s.configs),{uid:o,key:null!==(r=null===(i=s.configs)||void 0===i?void 0:i.key)&&void 0!==r?r:`${e}_${o.slice(0,6)}`})})}function p(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var m,v={exports:{}},y=(m||(m=1,v.exports=function(){Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)});var t={},e={"==":function(t,e){return t==e},"===":function(t,e){return t===e},"!=":function(t,e){return t!=e},"!==":function(t,e){return t!==e},">":function(t,e){return t>e},">=":function(t,e){return t>=e},"<":function(t,e,i){return void 0===i?t<e:t<e&&e<i},"<=":function(t,e,i){return void 0===i?t<=e:t<=e&&e<=i},"!!":function(e){return t.truthy(e)},"!":function(e){return!t.truthy(e)},"%":function(t,e){return t%e},log:function(t){return console.log(t),t},in:function(t,e){return!(!e||void 0===e.indexOf)&&-1!==e.indexOf(t)},cat:function(){return Array.prototype.join.call(arguments,"")},substr:function(t,e,i){if(i<0){var r=String(t).substr(e);return r.substr(0,r.length+i)}return String(t).substr(e,i)},"+":function(){return Array.prototype.reduce.call(arguments,(function(t,e){return parseFloat(t,10)+parseFloat(e,10)}),0)},"*":function(){return Array.prototype.reduce.call(arguments,(function(t,e){return parseFloat(t,10)*parseFloat(e,10)}))},"-":function(t,e){return void 0===e?-t:t-e},"/":function(t,e){return t/e},min:function(){return Math.min.apply(this,arguments)},max:function(){return Math.max.apply(this,arguments)},merge:function(){return Array.prototype.reduce.call(arguments,(function(t,e){return t.concat(e)}),[])},var:function(t,e){var i=void 0===e?null:e,r=this;if(void 0===t||""===t||null===t)return r;for(var n=String(t).split("."),s=0;s<n.length;s++){if(null==r)return i;if(void 0===(r=r[n[s]]))return i}return r},missing:function(){for(var e=[],i=Array.isArray(arguments[0])?arguments[0]:arguments,r=0;r<i.length;r++){var n=i[r],s=t.apply({var:n},this);null!==s&&""!==s||e.push(n)}return e},missing_some:function(e,i){var r=t.apply({missing:i},this);return i.length-r.length>=e?[]:r}};return t.is_logic=function(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)&&1===Object.keys(t).length},t.truthy=function(t){return!(Array.isArray(t)&&0===t.length||!t)},t.get_operator=function(t){return Object.keys(t)[0]},t.get_values=function(e){return e[t.get_operator(e)]},t.apply=function(i,r){if(Array.isArray(i))return i.map((function(e){return t.apply(e,r)}));if(!t.is_logic(i))return i;var n,s,o,a,u,h=t.get_operator(i),c=i[h];if(Array.isArray(c)||(c=[c]),"if"===h||"?:"==h){for(n=0;n<c.length-1;n+=2)if(t.truthy(t.apply(c[n],r)))return t.apply(c[n+1],r);return c.length===n+1?t.apply(c[n],r):null}if("and"===h){for(n=0;n<c.length;n+=1)if(s=t.apply(c[n],r),!t.truthy(s))return s;return s}if("or"===h){for(n=0;n<c.length;n+=1)if(s=t.apply(c[n],r),t.truthy(s))return s;return s}if("filter"===h)return a=t.apply(c[0],r),o=c[1],Array.isArray(a)?a.filter((function(e){return t.truthy(t.apply(o,e))})):[];if("map"===h)return a=t.apply(c[0],r),o=c[1],Array.isArray(a)?a.map((function(e){return t.apply(o,e)})):[];if("reduce"===h)return a=t.apply(c[0],r),o=c[1],u=void 0!==c[2]?t.apply(c[2],r):null,Array.isArray(a)?a.reduce((function(e,i){return t.apply(o,{current:i,accumulator:e})}),u):u;if("all"===h){if(a=t.apply(c[0],r),o=c[1],!Array.isArray(a)||!a.length)return!1;for(n=0;n<a.length;n+=1)if(!t.truthy(t.apply(o,a[n])))return!1;return!0}if("none"===h){if(a=t.apply(c[0],r),o=c[1],!Array.isArray(a)||!a.length)return!0;for(n=0;n<a.length;n+=1)if(t.truthy(t.apply(o,a[n])))return!1;return!0}if("some"===h){if(a=t.apply(c[0],r),o=c[1],!Array.isArray(a)||!a.length)return!1;for(n=0;n<a.length;n+=1)if(t.truthy(t.apply(o,a[n])))return!0;return!1}if(c=c.map((function(e){return t.apply(e,r)})),e.hasOwnProperty(h)&&"function"==typeof e[h])return e[h].apply(r,c);if(h.indexOf(".")>0){var f=String(h).split("."),l=e;for(n=0;n<f.length;n++){if(!l.hasOwnProperty(f[n]))throw new Error("Unrecognized operation "+h+" (failed at "+f.slice(0,n+1).join(".")+")");l=l[f[n]]}return l.apply(r,c)}throw new Error("Unrecognized operation "+h)},t.uses_data=function(e){var i=[];if(t.is_logic(e)){var r=t.get_operator(e),n=e[r];Array.isArray(n)||(n=[n]),"var"===r?i.push(n[0]):n.forEach((function(e){i.push.apply(i,t.uses_data(e))}))}return function(t){for(var e=[],i=0,r=t.length;i<r;i++)-1===e.indexOf(t[i])&&e.push(t[i]);return e}(i)},t.add_operation=function(t,i){e[t]=i},t.rm_operation=function(t){delete e[t]},t.rule_like=function(e,i){if(i===e)return!0;if("@"===i)return!0;if("number"===i)return"number"==typeof e;if("string"===i)return"string"==typeof e;if("array"===i)return Array.isArray(e)&&!t.is_logic(e);if(t.is_logic(i)){if(t.is_logic(e)){var r=t.get_operator(i),n=t.get_operator(e);if("@"===r||r===n)return t.rule_like(t.get_values(e,!1),t.get_values(i,!1))}return!1}if(Array.isArray(i)){if(Array.isArray(e)){if(i.length!==e.length)return!1;for(var s=0;s<i.length;s+=1)if(!t.rule_like(e[s],i[s]))return!1;return!0}return!1}return!1},t}()),v.exports),g=p(y),$=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],w=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],b="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",_={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},E="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",k={5:E,"5module":E+" export import",6:E+" const class extends export import super"},O=/^in(stanceof)?$/,S=new RegExp("["+b+"]"),x=new RegExp("["+b+"‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・]");function j(t,e){for(var i=65536,r=0;r<e.length;r+=2){if((i+=e[r])>t)return!1;if((i+=e[r+1])>=t)return!0}return!1}function I(t,e){return t<65?36===t:t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&S.test(String.fromCharCode(t)):!1!==e&&j(t,w)))}function P(t,e){return t<48?36===t:t<58||!(t<65)&&(t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&x.test(String.fromCharCode(t)):!1!==e&&(j(t,w)||j(t,$)))))}var C=function(t,e){void 0===e&&(e={}),this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop||null,this.updateContext=null};function T(t,e){return new C(t,{beforeExpr:!0,binop:e})}var A={beforeExpr:!0},N={startsExpr:!0},M={};function R(t,e){return void 0===e&&(e={}),e.keyword=t,M[t]=new C(t,e)}var D={num:new C("num",N),regexp:new C("regexp",N),string:new C("string",N),name:new C("name",N),privateId:new C("privateId",N),eof:new C("eof"),bracketL:new C("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new C("]"),braceL:new C("{",{beforeExpr:!0,startsExpr:!0}),braceR:new C("}"),parenL:new C("(",{beforeExpr:!0,startsExpr:!0}),parenR:new C(")"),comma:new C(",",A),semi:new C(";",A),colon:new C(":",A),dot:new C("."),question:new C("?",A),questionDot:new C("?."),arrow:new C("=>",A),template:new C("template"),invalidTemplate:new C("invalidTemplate"),ellipsis:new C("...",A),backQuote:new C("`",N),dollarBraceL:new C("${",{beforeExpr:!0,startsExpr:!0}),eq:new C("=",{beforeExpr:!0,isAssign:!0}),assign:new C("_=",{beforeExpr:!0,isAssign:!0}),incDec:new C("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new C("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:T("||",1),logicalAND:T("&&",2),bitwiseOR:T("|",3),bitwiseXOR:T("^",4),bitwiseAND:T("&",5),equality:T("==/!=/===/!==",6),relational:T("</>/<=/>=",7),bitShift:T("<</>>/>>>",8),plusMin:new C("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:T("%",10),star:T("*",10),slash:T("/",10),starstar:new C("**",{beforeExpr:!0}),coalesce:T("??",1),_break:R("break"),_case:R("case",A),_catch:R("catch"),_continue:R("continue"),_debugger:R("debugger"),_default:R("default",A),_do:R("do",{isLoop:!0,beforeExpr:!0}),_else:R("else",A),_finally:R("finally"),_for:R("for",{isLoop:!0}),_function:R("function",N),_if:R("if"),_return:R("return",A),_switch:R("switch"),_throw:R("throw",A),_try:R("try"),_var:R("var"),_const:R("const"),_while:R("while",{isLoop:!0}),_with:R("with"),_new:R("new",{beforeExpr:!0,startsExpr:!0}),_this:R("this",N),_super:R("super",N),_class:R("class",N),_extends:R("extends",A),_export:R("export"),_import:R("import",N),_null:R("null",N),_true:R("true",N),_false:R("false",N),_in:R("in",{beforeExpr:!0,binop:7}),_instanceof:R("instanceof",{beforeExpr:!0,binop:7}),_typeof:R("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:R("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:R("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},z=/\r\n?|\n|\u2028|\u2029/,L=new RegExp(z.source,"g");function U(t){return 10===t||13===t||8232===t||8233===t}function q(t,e,i){void 0===i&&(i=t.length);for(var r=e;r<i;r++){var n=t.charCodeAt(r);if(U(n))return r<i-1&&13===n&&10===t.charCodeAt(r+1)?r+2:r+1}return-1}var F=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,B=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,V=Object.prototype,G=V.hasOwnProperty,H=V.toString,K=Object.hasOwn||function(t,e){return G.call(t,e)},W=Array.isArray||function(t){return"[object Array]"===H.call(t)},J=Object.create(null);function Z(t){return J[t]||(J[t]=new RegExp("^(?:"+t.replace(/ /g,"|")+")$"))}function X(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t)))}var Y=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Q=function(t,e){this.line=t,this.column=e};Q.prototype.offset=function(t){return new Q(this.line,this.column+t)};var tt=function(t,e,i){this.start=e,this.end=i,null!==t.sourceFile&&(this.source=t.sourceFile)};function et(t,e){for(var i=1,r=0;;){var n=q(t,r,e);if(n<0)return new Q(i,e-r);++i,r=n}}var it={ecmaVersion:null,sourceType:"script",strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},rt=!1;function nt(t,e){return 2|(t?4:0)|(e?8:0)}var st=function(t,e,i){this.options=t=function(t){var e={};for(var i in it)e[i]=t&&K(t,i)?t[i]:it[i];if("latest"===e.ecmaVersion?e.ecmaVersion=1e8:null==e.ecmaVersion?(!rt&&"object"==typeof console&&console.warn&&(rt=!0,console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")),e.ecmaVersion=11):e.ecmaVersion>=2015&&(e.ecmaVersion-=2009),null==e.allowReserved&&(e.allowReserved=e.ecmaVersion<5),t&&null!=t.allowHashBang||(e.allowHashBang=e.ecmaVersion>=14),W(e.onToken)){var r=e.onToken;e.onToken=function(t){return r.push(t)}}if(W(e.onComment)&&(e.onComment=function(t,e){return function(i,r,n,s,o,a){var u={type:i?"Block":"Line",value:r,start:n,end:s};t.locations&&(u.loc=new tt(this,o,a)),t.ranges&&(u.range=[n,s]),e.push(u)}}(e,e.onComment)),"commonjs"===e.sourceType&&e.allowAwaitOutsideFunction)throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return e}(t),this.sourceFile=t.sourceFile,this.keywords=Z(k[t.ecmaVersion>=6?6:"module"===t.sourceType?"5module":5]);var r="";!0!==t.allowReserved&&(r=_[t.ecmaVersion>=6?6:5===t.ecmaVersion?5:3],"module"===t.sourceType&&(r+=" await")),this.reservedWords=Z(r);var n=(r?r+" ":"")+_.strict;this.reservedWordsStrict=Z(n),this.reservedWordsStrictBind=Z(n+" "+_.strictBind),this.input=String(e),this.containsEsc=!1,this.pos=i||0,this.curLine=1,t.startLocation?(this.lineStart=this.pos-t.startLocation.column,this.curLine=t.startLocation.line):i?(this.lineStart=this.input.lastIndexOf("\n",i-1)+1,this.options.locations&&(this.curLine=this.input.slice(0,this.lineStart).split(z).length)):this.lineStart=0,this.type=D.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule="module"===t.sourceType,this.strict=this.inModule||!0===t.strict||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),0===this.pos&&t.allowHashBang&&"#!"===this.input.slice(0,2)&&this.skipLineComment(2),this.scopeStack=[],this.enterScope("commonjs"===this.options.sourceType?2:1),this.regexpState=null,this.privateNameStack=[]},ot={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};st.prototype.parse=function(){var t=this,e=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow((function(){return t.parseTopLevel(e)}))},ot.inFunction.get=function(){return(2&this.currentVarScope().flags)>0},ot.inGenerator.get=function(){return(8&this.currentVarScope().flags)>0},ot.inAsync.get=function(){return(4&this.currentVarScope().flags)>0},ot.canAwait.get=function(){for(var t=this.scopeStack.length-1;t>=0;t--){var e=this.scopeStack[t].flags;if(768&e)return!1;if(2&e)return(4&e)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},ot.allowReturn.get=function(){return!!this.inFunction||!!(this.options.allowReturnOutsideFunction&&1&this.currentVarScope().flags)},ot.allowSuper.get=function(){return(64&this.currentThisScope().flags)>0||this.options.allowSuperOutsideMethod},ot.allowDirectSuper.get=function(){return(128&this.currentThisScope().flags)>0},ot.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},ot.allowNewDotTarget.get=function(){for(var t=this.scopeStack.length-1;t>=0;t--){var e=this.scopeStack[t].flags;if(768&e||2&e&&!(16&e))return!0}return!1},ot.allowUsing.get=function(){var t=this.currentScope().flags;return!(1024&t||!this.inModule&&1&t)},ot.inClassStaticBlock.get=function(){return(256&this.currentVarScope().flags)>0},st.extend=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];for(var i=this,r=0;r<t.length;r++)i=t[r](i);return i},st.parse=function(t,e){return new this(e,t).parse()},st.parseExpressionAt=function(t,e,i){var r=new this(i,t,e);return r.nextToken(),r.parseExpression()},st.tokenizer=function(t,e){return new this(e,t)},Object.defineProperties(st.prototype,ot);var at=st.prototype,ut=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;at.strictDirective=function(t){if(this.options.ecmaVersion<5)return!1;for(;;){B.lastIndex=t,t+=B.exec(this.input)[0].length;var e=ut.exec(this.input.slice(t));if(!e)return!1;if("use strict"===(e[1]||e[2])){B.lastIndex=t+e[0].length;var i=B.exec(this.input),r=i.index+i[0].length,n=this.input.charAt(r);return";"===n||"}"===n||z.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(n)||"!"===n&&"="===this.input.charAt(r+1))}B.lastIndex=t+=e[0].length,t+=B.exec(this.input)[0].length,";"===this.input[t]&&t++}},at.eat=function(t){return this.type===t&&(this.next(),!0)},at.isContextual=function(t){return this.type===D.name&&this.value===t&&!this.containsEsc},at.eatContextual=function(t){return!!this.isContextual(t)&&(this.next(),!0)},at.catchStackOverflow=function(t){try{return t()}catch(t){if(!(t instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(t.message)||/\btoo much recursion\b/i.test(t.message))))throw t;this.raise(this.start,"Not enough stack space to parse input")}},at.expectContextual=function(t){this.eatContextual(t)||this.unexpected()},at.canInsertSemicolon=function(){return this.type===D.eof||this.type===D.braceR||z.test(this.input.slice(this.lastTokEnd,this.start))},at.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},at.semicolon=function(){this.eat(D.semi)||this.insertSemicolon()||this.unexpected()},at.afterTrailingComma=function(t,e){if(this.type===t)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),e||this.next(),!0},at.expect=function(t){this.eat(t)||this.unexpected()},at.unexpected=function(t){this.raise(null!=t?t:this.start,"Unexpected token")};var ht=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};at.checkPatternErrors=function(t,e){if(t){t.trailingComma>-1&&this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");var i=e?t.parenthesizedAssign:t.parenthesizedBind;i>-1&&this.raiseRecoverable(i,e?"Assigning to rvalue":"Parenthesized pattern")}},at.checkExpressionErrors=function(t,e){if(!t)return!1;var i=t.shorthandAssign,r=t.doubleProto;if(!e)return i>=0||r>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property")},at.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},at.isSimpleAssignTarget=function(t){return"ParenthesizedExpression"===t.type?this.isSimpleAssignTarget(t.expression):"Identifier"===t.type||"MemberExpression"===t.type};var ct=st.prototype;ct.parseTopLevel=function(t){var e=Object.create(null);for(t.body||(t.body=[]);this.type!==D.eof;){var i=this.parseStatement(null,!0,e);t.body.push(i)}if(this.inModule)for(var r=0,n=Object.keys(this.undefinedExports);r<n.length;r+=1){var s=n[r];this.raiseRecoverable(this.undefinedExports[s].start,"Export '"+s+"' is not defined")}return this.adaptDirectivePrologue(t.body),this.next(),t.sourceType="commonjs"===this.options.sourceType?"script":this.options.sourceType,this.finishNode(t,"Program")};var ft={kind:"loop"},lt={kind:"switch"};ct.isLet=function(t){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;B.lastIndex=this.pos;var e=B.exec(this.input),i=this.pos+e[0].length,r=this.fullCharCodeAt(i);if(91===r||92===r)return!0;if(t)return!1;if(123===r)return!0;if(I(r)){var n=i;do{i+=r<=65535?1:2}while(P(r=this.fullCharCodeAt(i)));if(92===r)return!0;var s=this.input.slice(n,i);if(!O.test(s))return!0}return!1},ct.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;B.lastIndex=this.pos;var t,e=B.exec(this.input),i=this.pos+e[0].length;return!(z.test(this.input.slice(this.pos,i))||"function"!==this.input.slice(i,i+8)||i+8!==this.input.length&&(P(t=this.fullCharCodeAt(i+8))||92===t))},ct.isUsingKeyword=function(t,e){if(this.options.ecmaVersion<17||!this.isContextual(t?"await":"using"))return!1;B.lastIndex=this.pos;var i=B.exec(this.input),r=this.pos+i[0].length;if(z.test(this.input.slice(this.pos,r)))return!1;if(t){var n,s=r+5;if("using"!==this.input.slice(r,s)||s===this.input.length||P(n=this.fullCharCodeAt(s))||92===n)return!1;B.lastIndex=s;var o=B.exec(this.input);if(r=s+o[0].length,o&&z.test(this.input.slice(s,r)))return!1}var a=this.fullCharCodeAt(r);if(!I(a)&&92!==a)return!1;var u=r;do{r+=a<=65535?1:2}while(P(a=this.fullCharCodeAt(r)));if(92===a)return!0;var h=this.input.slice(u,r);if(O.test(h))return!1;if(e&&!t&&"of"===h){B.lastIndex=r;var c=B.exec(this.input);if(61!==this.input.charCodeAt(r+=c[0].length)||61===(a=this.input.charCodeAt(r+1))||62===a)return!1}return!0},ct.isAwaitUsing=function(t){return this.isUsingKeyword(!0,t)},ct.isUsing=function(t){return this.isUsingKeyword(!1,t)},ct.parseStatement=function(t,e,i){var r,n=this.type,s=this.startNode();switch(this.isLet(t)&&(n=D._var,r="let"),n){case D._break:case D._continue:return this.parseBreakContinueStatement(s,n.keyword);case D._debugger:return this.parseDebuggerStatement(s);case D._do:return this.parseDoStatement(s);case D._for:return this.parseForStatement(s);case D._function:return t&&(this.strict||"if"!==t&&"label"!==t)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,!1,!t);case D._class:return t&&this.unexpected(),this.parseClass(s,!0);case D._if:return this.parseIfStatement(s);case D._return:return this.parseReturnStatement(s);case D._switch:return this.parseSwitchStatement(s);case D._throw:return this.parseThrowStatement(s);case D._try:return this.parseTryStatement(s);case D._const:case D._var:return r=r||this.value,t&&"var"!==r&&this.unexpected(),this.parseVarStatement(s,r);case D._while:return this.parseWhileStatement(s);case D._with:return this.parseWithStatement(s);case D.braceL:return this.parseBlock(!0,s);case D.semi:return this.parseEmptyStatement(s);case D._export:case D._import:if(this.options.ecmaVersion>10&&n===D._import){B.lastIndex=this.pos;var o=B.exec(this.input),a=this.input.charCodeAt(this.pos+o[0].length);if(40===a||46===a)return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(e||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),n===D._import?this.parseImport(s):this.parseExport(s,i);default:if(this.isAsyncFunction())return t&&this.unexpected(),this.next(),this.parseFunctionStatement(s,!0,!t);var u=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(u)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),t&&this.raise(this.start,"Using declaration is not allowed in single-statement positions"),"await using"===u&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(s,!1,u),this.semicolon(),this.finishNode(s,"VariableDeclaration");var h=this.value,c=this.parseExpression();return n===D.name&&"Identifier"===c.type&&this.eat(D.colon)?this.parseLabeledStatement(s,h,c,t):this.parseExpressionStatement(s,c)}},ct.parseBreakContinueStatement=function(t,e){var i="break"===e;this.next(),this.eat(D.semi)||this.insertSemicolon()?t.label=null:this.type!==D.name?this.unexpected():(t.label=this.parseIdent(),this.semicolon());for(var r=0;r<this.labels.length;++r){var n=this.labels[r];if(null==t.label||n.name===t.label.name){if(null!=n.kind&&(i||"loop"===n.kind))break;if(t.label&&i)break}}return r===this.labels.length&&this.raise(t.start,"Unsyntactic "+e),this.finishNode(t,i?"BreakStatement":"ContinueStatement")},ct.parseDebuggerStatement=function(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")},ct.parseDoStatement=function(t){return this.next(),this.labels.push(ft),t.body=this.parseStatement("do"),this.labels.pop(),this.expect(D._while),t.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(D.semi):this.semicolon(),this.finishNode(t,"DoWhileStatement")},ct.parseForStatement=function(t){this.next();var e=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(ft),this.enterScope(0),this.expect(D.parenL),this.type===D.semi)return e>-1&&this.unexpected(e),this.parseFor(t,null);var i=this.isLet();if(this.type===D._var||this.type===D._const||i){var r=this.startNode(),n=i?"let":this.value;return this.next(),this.parseVar(r,!0,n),this.finishNode(r,"VariableDeclaration"),this.parseForAfterInit(t,r,e)}var s=this.isContextual("let"),o=!1,a=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(a){var u=this.startNode();return this.next(),"await using"===a&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(u,!0,a),this.finishNode(u,"VariableDeclaration"),this.parseForAfterInit(t,u,e)}var h=this.containsEsc,c=new ht,f=this.start,l=e>-1?this.parseExprSubscripts(c,"await"):this.parseExpression(!0,c);return this.type===D._in||(o=this.options.ecmaVersion>=6&&this.isContextual("of"))?(e>-1?(this.type===D._in&&this.unexpected(e),t.await=!0):o&&this.options.ecmaVersion>=8&&(l.start!==f||h||"Identifier"!==l.type||"async"!==l.name?this.options.ecmaVersion>=9&&(t.await=!1):this.unexpected()),s&&o&&this.raise(l.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(l,!1,c),this.checkLValPattern(l),this.parseForIn(t,l)):(this.checkExpressionErrors(c,!0),e>-1&&this.unexpected(e),this.parseFor(t,l))},ct.parseForAfterInit=function(t,e,i){return(this.type===D._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&1===e.declarations.length?(this.type===D._in?("using"!==e.kind&&"await using"!==e.kind||e.declarations[0].init||this.raise(this.start,"Using declaration is not allowed in for-in loops"),this.options.ecmaVersion>=9&&i>-1&&this.unexpected(i)):this.options.ecmaVersion>=9&&(t.await=i>-1),this.parseForIn(t,e)):(i>-1&&this.unexpected(i),this.parseFor(t,e))},ct.parseFunctionStatement=function(t,e,i){return this.next(),this.parseFunction(t,pt|(i?0:mt),!1,e)},ct.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement("if"),t.alternate=this.eat(D._else)?this.parseStatement("if"):null,this.finishNode(t,"IfStatement")},ct.parseReturnStatement=function(t){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(D.semi)||this.insertSemicolon()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")},ct.parseSwitchStatement=function(t){var e;this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(D.braceL),this.labels.push(lt),this.enterScope(1024);for(var i=!1;this.type!==D.braceR;)if(this.type===D._case||this.type===D._default){var r=this.type===D._case;e&&this.finishNode(e,"SwitchCase"),t.cases.push(e=this.startNode()),e.consequent=[],this.next(),r?e.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,e.test=null),this.expect(D.colon)}else e||this.unexpected(),e.consequent.push(this.parseStatement(null));return this.exitScope(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")},ct.parseThrowStatement=function(t){return this.next(),z.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var dt=[];ct.parseCatchClauseParam=function(){var t=this.parseBindingAtom(),e="Identifier"===t.type;return this.enterScope(e?32:0),this.checkLValPattern(t,e?4:2),this.expect(D.parenR),t},ct.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===D._catch){var e=this.startNode();this.next(),this.eat(D.parenL)?e.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),e.param=null,this.enterScope(0)),e.body=this.parseBlock(!1),this.exitScope(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(D._finally)?this.parseBlock():null,t.handler||t.finalizer||this.raise(t.start,"Missing catch or finally clause"),this.finishNode(t,"TryStatement")},ct.parseVarStatement=function(t,e,i){return this.next(),this.parseVar(t,!1,e,i),this.semicolon(),this.finishNode(t,"VariableDeclaration")},ct.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(ft),t.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(t,"WhileStatement")},ct.parseWithStatement=function(t){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement("with"),this.finishNode(t,"WithStatement")},ct.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")},ct.parseLabeledStatement=function(t,e,i,r){for(var n=0,s=this.labels;n<s.length;n+=1)s[n].name===e&&this.raise(i.start,"Label '"+e+"' is already declared");for(var o=this.type.isLoop?"loop":this.type===D._switch?"switch":null,a=this.labels.length-1;a>=0;a--){var u=this.labels[a];if(u.statementStart!==t.start)break;u.statementStart=this.start,u.kind=o}return this.labels.push({name:e,kind:o,statementStart:this.start}),t.body=this.parseStatement(r?-1===r.indexOf("label")?r+"label":r:"label"),this.labels.pop(),t.label=i,this.finishNode(t,"LabeledStatement")},ct.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")},ct.parseBlock=function(t,e,i){for(void 0===t&&(t=!0),void 0===e&&(e=this.startNode()),e.body=[],this.expect(D.braceL),t&&this.enterScope(0);this.type!==D.braceR;){var r=this.parseStatement(null);e.body.push(r)}return i&&(this.strict=!1),this.next(),t&&this.exitScope(),this.finishNode(e,"BlockStatement")},ct.parseFor=function(t,e){return t.init=e,this.expect(D.semi),t.test=this.type===D.semi?null:this.parseExpression(),this.expect(D.semi),t.update=this.type===D.parenR?null:this.parseExpression(),this.expect(D.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,"ForStatement")},ct.parseForIn=function(t,e){var i=this.type===D._in;return this.next(),"VariableDeclaration"===e.type&&null!=e.declarations[0].init&&(!i||this.options.ecmaVersion<8||this.strict||"var"!==e.kind||"Identifier"!==e.declarations[0].id.type)&&this.raise(e.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(D.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")},ct.parseVar=function(t,e,i,r){for(t.declarations=[],t.kind=i;;){var n=this.startNode();if(this.parseVarId(n,i),this.eat(D.eq)?n.init=this.parseMaybeAssign(e):r||"const"!==i||this.type===D._in||this.options.ecmaVersion>=6&&this.isContextual("of")?r||"using"!==i&&"await using"!==i||!(this.options.ecmaVersion>=17)||this.type===D._in||this.isContextual("of")?r||"Identifier"===n.id.type||e&&(this.type===D._in||this.isContextual("of"))?n.init=null:this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):this.raise(this.lastTokEnd,"Missing initializer in "+i+" declaration"):this.unexpected(),t.declarations.push(this.finishNode(n,"VariableDeclarator")),!this.eat(D.comma))break}return t},ct.parseVarId=function(t,e){t.id="using"===e||"await using"===e?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(t.id,"var"===e?1:2,!1)};var pt=1,mt=2;function vt(t,e){var i=e.key.name,r=t[i],n="true";return"MethodDefinition"!==e.type||"get"!==e.kind&&"set"!==e.kind||(n=(e.static?"s":"i")+e.kind),"iget"===r&&"iset"===n||"iset"===r&&"iget"===n||"sget"===r&&"sset"===n||"sset"===r&&"sget"===n?(t[i]="true",!1):!!r||(t[i]=n,!1)}function yt(t,e){var i=t.key;return!t.computed&&("Identifier"===i.type&&i.name===e||"Literal"===i.type&&i.value===e)}ct.parseFunction=function(t,e,i,r,n){this.initFunction(t),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===D.star&&e&mt&&this.unexpected(),t.generator=this.eat(D.star)),this.options.ecmaVersion>=8&&(t.async=!!r),e&pt&&(t.id=4&e&&this.type!==D.name?null:this.parseIdent(),!t.id||e&mt||this.checkLValSimple(t.id,this.strict||t.generator||t.async?this.treatFunctionsAsVar?1:2:3));var s=this.yieldPos,o=this.awaitPos,a=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(nt(t.async,t.generator)),e&pt||(t.id=this.type===D.name?this.parseIdent():null),this.parseFunctionParams(t),this.parseFunctionBody(t,i,!1,n),this.yieldPos=s,this.awaitPos=o,this.awaitIdentPos=a,this.finishNode(t,e&pt?"FunctionDeclaration":"FunctionExpression")},ct.parseFunctionParams=function(t){this.expect(D.parenL),t.params=this.parseBindingList(D.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},ct.parseClass=function(t,e){this.next();var i=this.strict;this.strict=!0,this.parseClassId(t,e),this.parseClassSuper(t);var r=this.enterClassBody(),n=this.startNode(),s=!1;for(n.body=[],this.expect(D.braceL);this.type!==D.braceR;){var o=this.parseClassElement(null!==t.superClass);o&&(n.body.push(o),"MethodDefinition"===o.type&&"constructor"===o.kind?(s&&this.raiseRecoverable(o.start,"Duplicate constructor in the same class"),s=!0):o.key&&"PrivateIdentifier"===o.key.type&&vt(r,o)&&this.raiseRecoverable(o.key.start,"Identifier '#"+o.key.name+"' has already been declared"))}return this.strict=i,this.next(),t.body=this.finishNode(n,"ClassBody"),this.exitClassBody(),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")},ct.parseClassElement=function(t){if(this.eat(D.semi))return null;var e=this.options.ecmaVersion,i=this.startNode(),r="",n=!1,s=!1,o="method",a=!1;if(this.eatContextual("static")){if(e>=13&&this.eat(D.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===D.star?a=!0:r="static"}if(i.static=a,!r&&e>=8&&this.eatContextual("async")&&(!this.isClassElementNameStart()&&this.type!==D.star||this.canInsertSemicolon()?r="async":s=!0),!r&&(e>=9||!s)&&this.eat(D.star)&&(n=!0),!r&&!s&&!n){var u=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?o=u:r=u)}if(r?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=r,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),e<13||this.type===D.parenL||"method"!==o||n||s){var h=!i.static&&yt(i,"constructor"),c=h&&t;h&&"method"!==o&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=h?"constructor":o,this.parseClassMethod(i,n,s,c)}else this.parseClassField(i);return i},ct.isClassElementNameStart=function(){return this.type===D.name||this.type===D.privateId||this.type===D.num||this.type===D.string||this.type===D.bracketL||this.type.keyword},ct.parseClassElementName=function(t){this.type===D.privateId?("constructor"===this.value&&this.raise(this.start,"Classes can't have an element named '#constructor'"),t.computed=!1,t.key=this.parsePrivateIdent()):this.parsePropertyName(t)},ct.parseClassMethod=function(t,e,i,r){var n=t.key;"constructor"===t.kind?(e&&this.raise(n.start,"Constructor can't be a generator"),i&&this.raise(n.start,"Constructor can't be an async method")):t.static&&yt(t,"prototype")&&this.raise(n.start,"Classes may not have a static property named prototype");var s=t.value=this.parseMethod(e,i,r);return"get"===t.kind&&0!==s.params.length&&this.raiseRecoverable(s.start,"getter should have no params"),"set"===t.kind&&1!==s.params.length&&this.raiseRecoverable(s.start,"setter should have exactly one param"),"set"===t.kind&&"RestElement"===s.params[0].type&&this.raiseRecoverable(s.params[0].start,"Setter cannot use rest params"),this.finishNode(t,"MethodDefinition")},ct.parseClassField=function(t){return yt(t,"constructor")?this.raise(t.key.start,"Classes can't have a field named 'constructor'"):t.static&&yt(t,"prototype")&&this.raise(t.key.start,"Classes can't have a static field named 'prototype'"),this.eat(D.eq)?(this.enterScope(576),t.value=this.parseMaybeAssign(),this.exitScope()):t.value=null,this.semicolon(),this.finishNode(t,"PropertyDefinition")},ct.parseClassStaticBlock=function(t){t.body=[];var e=this.labels;for(this.labels=[],this.enterScope(320);this.type!==D.braceR;){var i=this.parseStatement(null);t.body.push(i)}return this.next(),this.exitScope(),this.labels=e,this.finishNode(t,"StaticBlock")},ct.parseClassId=function(t,e){this.type===D.name?(t.id=this.parseIdent(),e&&this.checkLValSimple(t.id,2,!1)):(!0===e&&this.unexpected(),t.id=null)},ct.parseClassSuper=function(t){t.superClass=this.eat(D._extends)?this.parseExprSubscripts(null,!1):null},ct.enterClassBody=function(){var t={declared:Object.create(null),used:[]};return this.privateNameStack.push(t),t.declared},ct.exitClassBody=function(){var t=this.privateNameStack.pop(),e=t.declared,i=t.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,n=0===r?null:this.privateNameStack[r-1],s=0;s<i.length;++s){var o=i[s];K(e,o.name)||(n?n.used.push(o):this.raiseRecoverable(o.start,"Private field '#"+o.name+"' must be declared in an enclosing class"))}},ct.parseExportAllDeclaration=function(t,e){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(t.exported=this.parseModuleExportName(),this.checkExport(e,t.exported,this.lastTokStart)):t.exported=null),this.expectContextual("from"),this.type!==D.string&&this.unexpected(),t.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(t.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(t,"ExportAllDeclaration")},ct.parseExport=function(t,e){if(this.next(),this.eat(D.star))return this.parseExportAllDeclaration(t,e);if(this.eat(D._default))return this.checkExport(e,"default",this.lastTokStart),t.declaration=this.parseExportDefaultDeclaration(),this.finishNode(t,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())t.declaration=this.parseExportDeclaration(t),"VariableDeclaration"===t.declaration.type?this.checkVariableExport(e,t.declaration.declarations):this.checkExport(e,t.declaration.id,t.declaration.id.start),t.specifiers=[],t.source=null,this.options.ecmaVersion>=16&&(t.attributes=[]);else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from"))this.type!==D.string&&this.unexpected(),t.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(t.attributes=this.parseWithClause());else{for(var i=0,r=t.specifiers;i<r.length;i+=1){var n=r[i];this.checkUnreserved(n.local),this.checkLocalExport(n.local),"Literal"===n.local.type&&this.raise(n.local.start,"A string literal cannot be used as an exported binding without `from`.")}t.source=null,this.options.ecmaVersion>=16&&(t.attributes=[])}this.semicolon()}return this.finishNode(t,"ExportNamedDeclaration")},ct.parseExportDeclaration=function(){return this.parseStatement(null)},ct.parseExportDefaultDeclaration=function(){var t;if(this.type===D._function||(t=this.isAsyncFunction())){var e=this.startNode();return this.next(),t&&this.next(),this.parseFunction(e,4|pt,!1,t)}if(this.type===D._class){var i=this.startNode();return this.parseClass(i,"nullableID")}var r=this.parseMaybeAssign();return this.semicolon(),r},ct.checkExport=function(t,e,i){t&&("string"!=typeof e&&(e="Identifier"===e.type?e.name:e.value),K(t,e)&&this.raiseRecoverable(i,"Duplicate export '"+e+"'"),t[e]=!0)},ct.checkPatternExport=function(t,e){var i=e.type;if("Identifier"===i)this.checkExport(t,e,e.start);else if("ObjectPattern"===i)for(var r=0,n=e.properties;r<n.length;r+=1)this.checkPatternExport(t,n[r]);else if("ArrayPattern"===i)for(var s=0,o=e.elements;s<o.length;s+=1){var a=o[s];a&&this.checkPatternExport(t,a)}else"Property"===i?this.checkPatternExport(t,e.value):"AssignmentPattern"===i?this.checkPatternExport(t,e.left):"RestElement"===i&&this.checkPatternExport(t,e.argument)},ct.checkVariableExport=function(t,e){if(t)for(var i=0,r=e;i<r.length;i+=1)this.checkPatternExport(t,r[i].id)},ct.shouldParseExportStatement=function(){return"var"===this.type.keyword||"const"===this.type.keyword||"class"===this.type.keyword||"function"===this.type.keyword||this.isLet()||this.isAsyncFunction()},ct.parseExportSpecifier=function(t){var e=this.startNode();return e.local=this.parseModuleExportName(),e.exported=this.eatContextual("as")?this.parseModuleExportName():e.local,this.checkExport(t,e.exported,e.exported.start),this.finishNode(e,"ExportSpecifier")},ct.parseExportSpecifiers=function(t){var e=[],i=!0;for(this.expect(D.braceL);!this.eat(D.braceR);){if(i)i=!1;else if(this.expect(D.comma),this.afterTrailingComma(D.braceR))break;e.push(this.parseExportSpecifier(t))}return e},ct.parseImport=function(t){return this.next(),this.type===D.string?(t.specifiers=dt,t.source=this.parseExprAtom()):(t.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),t.source=this.type===D.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(t.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(t,"ImportDeclaration")},ct.parseImportSpecifier=function(){var t=this.startNode();return t.imported=this.parseModuleExportName(),this.eatContextual("as")?t.local=this.parseIdent():(this.checkUnreserved(t.imported),t.local=t.imported),this.checkLValSimple(t.local,2),this.finishNode(t,"ImportSpecifier")},ct.parseImportDefaultSpecifier=function(){var t=this.startNode();return t.local=this.parseIdent(),this.checkLValSimple(t.local,2),this.finishNode(t,"ImportDefaultSpecifier")},ct.parseImportNamespaceSpecifier=function(){var t=this.startNode();return this.next(),this.expectContextual("as"),t.local=this.parseIdent(),this.checkLValSimple(t.local,2),this.finishNode(t,"ImportNamespaceSpecifier")},ct.parseImportSpecifiers=function(){var t=[],e=!0;if(this.type===D.name&&(t.push(this.parseImportDefaultSpecifier()),!this.eat(D.comma)))return t;if(this.type===D.star)return t.push(this.parseImportNamespaceSpecifier()),t;for(this.expect(D.braceL);!this.eat(D.braceR);){if(e)e=!1;else if(this.expect(D.comma),this.afterTrailingComma(D.braceR))break;t.push(this.parseImportSpecifier())}return t},ct.parseWithClause=function(){var t=[];if(!this.eat(D._with))return t;this.expect(D.braceL);for(var e={},i=!0;!this.eat(D.braceR);){if(i)i=!1;else if(this.expect(D.comma),this.afterTrailingComma(D.braceR))break;var r=this.parseImportAttribute(),n="Identifier"===r.key.type?r.key.name:r.key.value;K(e,n)&&this.raiseRecoverable(r.key.start,"Duplicate attribute key '"+n+"'"),e[n]=!0,t.push(r)}return t},ct.parseImportAttribute=function(){var t=this.startNode();return t.key=this.type===D.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved),this.expect(D.colon),this.type!==D.string&&this.unexpected(),t.value=this.parseExprAtom(),this.finishNode(t,"ImportAttribute")},ct.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===D.string){var t=this.parseLiteral(this.value);return Y.test(t.value)&&this.raise(t.start,"An export name cannot include a lone surrogate."),t}return this.parseIdent(!0)},ct.adaptDirectivePrologue=function(t){for(var e=0;e<t.length&&this.isDirectiveCandidate(t[e]);++e)t[e].directive=t[e].expression.raw.slice(1,-1)},ct.isDirectiveCandidate=function(t){return this.options.ecmaVersion>=5&&"ExpressionStatement"===t.type&&"Literal"===t.expression.type&&"string"==typeof t.expression.value&&('"'===this.input[t.start]||"'"===this.input[t.start])};var gt=st.prototype;gt.toAssignable=function(t,e,i){if(this.options.ecmaVersion>=6&&t)switch(t.type){case"Identifier":this.inAsync&&"await"===t.name&&this.raise(t.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var r=0,n=t.properties;r<n.length;r+=1){var s=n[r];this.toAssignable(s,e),"RestElement"!==s.type||"ArrayPattern"!==s.argument.type&&"ObjectPattern"!==s.argument.type||this.raise(s.argument.start,"Unexpected token")}break;case"Property":"init"!==t.kind&&this.raise(t.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(t.value,e);break;case"ArrayExpression":t.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(t.elements,e);break;case"SpreadElement":t.type="RestElement",this.toAssignable(t.argument,e),"AssignmentPattern"===t.argument.type&&this.raise(t.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":"="!==t.operator&&this.raise(t.left.end,"Only '=' operator can be used for specifying default value."),t.type="AssignmentPattern",delete t.operator,this.toAssignable(t.left,e);break;case"ParenthesizedExpression":this.toAssignable(t.expression,e,i);break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!e)break;default:this.raise(t.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return t},gt.toAssignableList=function(t,e){for(var i=t.length,r=0;r<i;r++){var n=t[r];n&&this.toAssignable(n,e)}if(i){var s=t[i-1];6===this.options.ecmaVersion&&e&&s&&"RestElement"===s.type&&"Identifier"!==s.argument.type&&this.unexpected(s.argument.start)}return t},gt.parseSpread=function(t){var e=this.startNode();return this.next(),e.argument=this.parseMaybeAssign(!1,t),this.finishNode(e,"SpreadElement")},gt.parseRestBinding=function(){var t=this.startNode();return this.next(),6===this.options.ecmaVersion&&this.type!==D.name&&this.unexpected(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")},gt.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case D.bracketL:var t=this.startNode();return this.next(),t.elements=this.parseBindingList(D.bracketR,!0,!0),this.finishNode(t,"ArrayPattern");case D.braceL:return this.parseObj(!0)}return this.parseIdent()},gt.parseBindingList=function(t,e,i,r){for(var n=[],s=!0;!this.eat(t);)if(s?s=!1:this.expect(D.comma),e&&this.type===D.comma)n.push(null);else{if(i&&this.afterTrailingComma(t))break;if(this.type===D.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),n.push(o),this.type===D.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(t);break}n.push(this.parseAssignableListItem(r))}return n},gt.parseAssignableListItem=function(){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},gt.parseBindingListItem=function(t){return t},gt.parseMaybeDefault=function(t,e,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(D.eq))return i;var r=this.startNodeAt(t,e);return r.left=i,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")},gt.checkLValSimple=function(t,e,i){void 0===e&&(e=0);var r=0!==e;switch(t.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(t.name)&&this.raiseRecoverable(t.start,(r?"Binding ":"Assigning to ")+t.name+" in strict mode"),r&&(2===e&&"let"===t.name&&this.raiseRecoverable(t.start,"let is disallowed as a lexically bound name"),i&&(K(i,t.name)&&this.raiseRecoverable(t.start,"Argument name clash"),i[t.name]=!0),5!==e&&this.declareName(t.name,e,t.start));break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":r&&this.raiseRecoverable(t.start,"Binding member expression");break;case"ParenthesizedExpression":return r&&this.raiseRecoverable(t.start,"Binding parenthesized expression"),this.checkLValSimple(t.expression,e,i);default:this.raise(t.start,(r?"Binding":"Assigning to")+" rvalue")}},gt.checkLValPattern=function(t,e,i){switch(void 0===e&&(e=0),t.type){case"ObjectPattern":for(var r=0,n=t.properties;r<n.length;r+=1)this.checkLValInnerPattern(n[r],e,i);break;case"ArrayPattern":for(var s=0,o=t.elements;s<o.length;s+=1){var a=o[s];a&&this.checkLValInnerPattern(a,e,i)}break;default:this.checkLValSimple(t,e,i)}},gt.checkLValInnerPattern=function(t,e,i){switch(void 0===e&&(e=0),t.type){case"Property":this.checkLValInnerPattern(t.value,e,i);break;case"AssignmentPattern":this.checkLValPattern(t.left,e,i);break;case"RestElement":this.checkLValPattern(t.argument,e,i);break;default:this.checkLValPattern(t,e,i)}};var $t=function(t,e,i,r,n){this.token=t,this.isExpr=!!e,this.preserveSpace=!!i,this.override=r,this.generator=!!n},wt={b_stat:new $t("{",!1),b_expr:new $t("{",!0),b_tmpl:new $t("${",!1),p_stat:new $t("(",!1),p_expr:new $t("(",!0),q_tmpl:new $t("`",!0,!0,(function(t){return t.tryReadTemplateToken()})),f_stat:new $t("function",!1),f_expr:new $t("function",!0),f_expr_gen:new $t("function",!0,!1,null,!0),f_gen:new $t("function",!1,!1,null,!0)},bt=st.prototype;bt.initialContext=function(){return[wt.b_stat]},bt.curContext=function(){return this.context[this.context.length-1]},bt.braceIsBlock=function(t){var e=this.curContext();return e===wt.f_expr||e===wt.f_stat||(t!==D.colon||e!==wt.b_stat&&e!==wt.b_expr?t===D._return||t===D.name&&this.exprAllowed?z.test(this.input.slice(this.lastTokEnd,this.start)):t===D._else||t===D.semi||t===D.eof||t===D.parenR||t===D.arrow||(t===D.braceL?e===wt.b_stat:t!==D._var&&t!==D._const&&t!==D.name&&!this.exprAllowed):!e.isExpr)},bt.inGeneratorContext=function(){for(var t=this.context.length-1;t>=1;t--){var e=this.context[t];if("function"===e.token)return e.generator}return!1},bt.updateContext=function(t){var e,i=this.type;i.keyword&&t===D.dot?this.exprAllowed=!1:(e=i.updateContext)?e.call(this,t):this.exprAllowed=i.beforeExpr},bt.overrideContext=function(t){this.curContext()!==t&&(this.context[this.context.length-1]=t)},D.parenR.updateContext=D.braceR.updateContext=function(){if(1!==this.context.length){var t=this.context.pop();t===wt.b_stat&&"function"===this.curContext().token&&(t=this.context.pop()),this.exprAllowed=!t.isExpr}else this.exprAllowed=!0},D.braceL.updateContext=function(t){this.context.push(this.braceIsBlock(t)?wt.b_stat:wt.b_expr),this.exprAllowed=!0},D.dollarBraceL.updateContext=function(){this.context.push(wt.b_tmpl),this.exprAllowed=!0},D.parenL.updateContext=function(t){this.context.push(t===D._if||t===D._for||t===D._with||t===D._while?wt.p_stat:wt.p_expr),this.exprAllowed=!0},D.incDec.updateContext=function(){},D._function.updateContext=D._class.updateContext=function(t){!t.beforeExpr||t===D._else||t===D.semi&&this.curContext()!==wt.p_stat||t===D._return&&z.test(this.input.slice(this.lastTokEnd,this.start))||(t===D.colon||t===D.braceL)&&this.curContext()===wt.b_stat?this.context.push(wt.f_stat):this.context.push(wt.f_expr),this.exprAllowed=!1},D.colon.updateContext=function(){"function"===this.curContext().token&&this.context.pop(),this.exprAllowed=!0},D.backQuote.updateContext=function(){this.curContext()===wt.q_tmpl?this.context.pop():this.context.push(wt.q_tmpl),this.exprAllowed=!1},D.star.updateContext=function(t){if(t===D._function){var e=this.context.length-1;this.context[e]=this.context[e]===wt.f_expr?wt.f_expr_gen:wt.f_gen}this.exprAllowed=!0},D.name.updateContext=function(t){var e=!1;this.options.ecmaVersion>=6&&t!==D.dot&&("of"===this.value&&!this.exprAllowed||"yield"===this.value&&this.inGeneratorContext())&&(e=!0),this.exprAllowed=e};var _t=st.prototype;function Et(t){return"Identifier"===t.type||"ParenthesizedExpression"===t.type&&Et(t.expression)}function kt(t){return"MemberExpression"===t.type&&"PrivateIdentifier"===t.property.type||"ChainExpression"===t.type&&kt(t.expression)||"ParenthesizedExpression"===t.type&&kt(t.expression)}_t.checkPropClash=function(t,e,i){if(!(this.options.ecmaVersion>=9&&"SpreadElement"===t.type||this.options.ecmaVersion>=6&&(t.computed||t.method||t.shorthand))){var r,n=t.key;switch(n.type){case"Identifier":r=n.name;break;case"Literal":r=String(n.value);break;default:return}var s=t.kind;if(this.options.ecmaVersion>=6)"__proto__"===r&&"init"===s&&(e.proto&&(i?i.doubleProto<0&&(i.doubleProto=n.start):this.raiseRecoverable(n.start,"Redefinition of __proto__ property")),e.proto=!0);else{var o=e[r="$"+r];o?("init"===s?this.strict&&o.init||o.get||o.set:o.init||o[s])&&this.raiseRecoverable(n.start,"Redefinition of property"):o=e[r]={init:!1,get:!1,set:!1},o[s]=!0}}},_t.parseExpression=function(t,e){var i=this;return this.catchStackOverflow((function(){var r=i.start,n=i.startLoc,s=i.parseMaybeAssign(t,e);if(i.type===D.comma){var o=i.startNodeAt(r,n);for(o.expressions=[s];i.eat(D.comma);)o.expressions.push(i.parseMaybeAssign(t,e));return i.finishNode(o,"SequenceExpression")}return s}))},_t.parseMaybeAssign=function(t,e,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(t);this.exprAllowed=!1}var r=!1,n=-1,s=-1,o=-1;e?(n=e.parenthesizedAssign,s=e.trailingComma,o=e.doubleProto,e.parenthesizedAssign=e.trailingComma=-1):(e=new ht,r=!0);var a=this.start,u=this.startLoc;this.type!==D.parenL&&this.type!==D.name||(this.potentialArrowAt=this.start,this.potentialArrowInForAwait="await"===t);var h=this.parseMaybeConditional(t,e);if(i&&(h=i.call(this,h,a,u)),this.type.isAssign){var c=this.startNodeAt(a,u);return c.operator=this.value,this.type===D.eq&&(h=this.toAssignable(h,!1,e)),r||(e.parenthesizedAssign=e.trailingComma=e.doubleProto=-1),e.shorthandAssign>=h.start&&(e.shorthandAssign=-1),this.type===D.eq?this.checkLValPattern(h):this.checkLValSimple(h),c.left=h,this.next(),c.right=this.parseMaybeAssign(t),o>-1&&(e.doubleProto=o),this.finishNode(c,"AssignmentExpression")}return r&&this.checkExpressionErrors(e,!0),n>-1&&(e.parenthesizedAssign=n),s>-1&&(e.trailingComma=s),h},_t.parseMaybeConditional=function(t,e){var i=this.start,r=this.startLoc,n=this.parseExprOps(t,e);if(this.checkExpressionErrors(e))return n;if(("ArrowFunctionExpression"!==n.type||n.start!==i)&&this.eat(D.question)){var s=this.startNodeAt(i,r);return s.test=n,s.consequent=this.parseMaybeAssign(),this.expect(D.colon),s.alternate=this.parseMaybeAssign(t),this.finishNode(s,"ConditionalExpression")}return n},_t.parseExprOps=function(t,e){var i=this.start,r=this.startLoc,n=this.parseMaybeUnary(e,!1,!1,t);return this.checkExpressionErrors(e)||n.start===i&&"ArrowFunctionExpression"===n.type?n:this.parseExprOp(n,i,r,-1,t)},_t.parseExprOp=function(t,e,i,r,n){var s=this.type.binop;if(null!=s&&(!n||this.type!==D._in)&&s>r){var o=this.type===D.logicalOR||this.type===D.logicalAND,a=this.type===D.coalesce;a&&(s=D.logicalAND.binop);var u=this.value;this.next();var h=this.start,c=this.startLoc,f=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,n),h,c,s,n),l=this.buildBinary(e,i,t,f,u,o||a);return(o&&this.type===D.coalesce||a&&(this.type===D.logicalOR||this.type===D.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(l,e,i,r,n)}return t},_t.buildBinary=function(t,e,i,r,n,s){"PrivateIdentifier"===r.type&&this.raise(r.start,"Private identifier can only be left side of binary expression");var o=this.startNodeAt(t,e);return o.left=i,o.operator=n,o.right=r,this.finishNode(o,s?"LogicalExpression":"BinaryExpression")},_t.parseMaybeUnary=function(t,e,i,r){var n,s=this.start,o=this.startLoc;if(this.isContextual("await")&&this.canAwait)n=this.parseAwait(r),e=!0;else if(this.type.prefix){var a=this.startNode(),u=this.type===D.incDec;a.operator=this.value,a.prefix=!0,this.next(),a.argument=this.parseMaybeUnary(null,!0,u,r),this.checkExpressionErrors(t,!0),u?this.checkLValSimple(a.argument):this.strict&&"delete"===a.operator&&Et(a.argument)?this.raiseRecoverable(a.start,"Deleting local variable in strict mode"):"delete"===a.operator&&kt(a.argument)?this.raiseRecoverable(a.start,"Private fields can not be deleted"):e=!0,n=this.finishNode(a,u?"UpdateExpression":"UnaryExpression")}else if(e||this.type!==D.privateId){if(n=this.parseExprSubscripts(t,r),this.checkExpressionErrors(t))return n;for(;this.type.postfix&&!this.canInsertSemicolon();){var h=this.startNodeAt(s,o);h.operator=this.value,h.prefix=!1,h.argument=n,this.checkLValSimple(n),this.next(),n=this.finishNode(h,"UpdateExpression")}}else(r||0===this.privateNameStack.length)&&this.options.checkPrivateFields&&this.unexpected(),n=this.parsePrivateIdent(),this.type!==D._in&&this.unexpected();return i||"ArrowFunctionExpression"===n.type&&n.start===s||!this.eat(D.starstar)?n:e?void this.unexpected(this.lastTokStart):this.buildBinary(s,o,n,this.parseMaybeUnary(null,!1,!1,r),"**",!1)},_t.parseExprSubscripts=function(t,e){var i=this.start,r=this.startLoc,n=this.parseExprAtom(t,e);if("ArrowFunctionExpression"===n.type&&")"!==this.input.slice(this.lastTokStart,this.lastTokEnd))return n;var s=this.parseSubscripts(n,i,r,!1,e);return t&&"MemberExpression"===s.type&&(t.parenthesizedAssign>=s.start&&(t.parenthesizedAssign=-1),t.parenthesizedBind>=s.start&&(t.parenthesizedBind=-1),t.trailingComma>=s.start&&(t.trailingComma=-1)),s},_t.parseSubscripts=function(t,e,i,r,n){for(var s=this.options.ecmaVersion>=8&&"Identifier"===t.type&&"async"===t.name&&this.lastTokEnd===t.end&&!this.canInsertSemicolon()&&t.end-t.start==5&&this.potentialArrowAt===t.start,o=!1;;){var a=this.parseSubscript(t,e,i,r,s,o,n);if(a.optional&&(o=!0),a===t||"ArrowFunctionExpression"===a.type){if(o){var u=this.startNodeAt(e,i);u.expression=a,a=this.finishNode(u,"ChainExpression")}return a}t=a}},_t.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(D.arrow)},_t.parseSubscriptAsyncArrow=function(t,e,i,r){return this.parseArrowExpression(this.startNodeAt(t,e),i,!0,r)},_t.parseSubscript=function(t,e,i,r,n,s,o){var a=this.options.ecmaVersion>=11,u=a&&this.eat(D.questionDot);r&&u&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var h=this.eat(D.bracketL);if(h||u&&this.type!==D.parenL&&this.type!==D.backQuote||this.eat(D.dot)){var c=this.startNodeAt(e,i);c.object=t,h?(c.property=this.parseExpression(),this.expect(D.bracketR)):c.property=this.type===D.privateId&&"Super"!==t.type?this.parsePrivateIdent():this.parseIdent("never"!==this.options.allowReserved),c.computed=!!h,a&&(c.optional=u),t=this.finishNode(c,"MemberExpression")}else if(!r&&this.eat(D.parenL)){var f=new ht,l=this.yieldPos,d=this.awaitPos,p=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var m=this.parseExprList(D.parenR,this.options.ecmaVersion>=8,!1,f);if(n&&!u&&this.shouldParseAsyncArrow())return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=l,this.awaitPos=d,this.awaitIdentPos=p,this.parseSubscriptAsyncArrow(e,i,m,o);this.checkExpressionErrors(f,!0),this.yieldPos=l||this.yieldPos,this.awaitPos=d||this.awaitPos,this.awaitIdentPos=p||this.awaitIdentPos;var v=this.startNodeAt(e,i);v.callee=t,v.arguments=m,a&&(v.optional=u),t=this.finishNode(v,"CallExpression")}else if(this.type===D.backQuote){(u||s)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var y=this.startNodeAt(e,i);y.tag=t,y.quasi=this.parseTemplate({isTagged:!0}),t=this.finishNode(y,"TaggedTemplateExpression")}return t},_t.parseExprAtom=function(t,e,i){this.type===D.slash&&this.readRegexp();var r,n=this.potentialArrowAt===this.start;switch(this.type){case D._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),r=this.startNode(),this.next(),this.type!==D.parenL||this.allowDirectSuper||this.raise(r.start,"super() call outside constructor of a subclass"),this.type!==D.dot&&this.type!==D.bracketL&&this.type!==D.parenL&&this.unexpected(),this.finishNode(r,"Super");case D._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case D.name:var s=this.start,o=this.startLoc,a=this.containsEsc,u=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!a&&"async"===u.name&&!this.canInsertSemicolon()&&this.eat(D._function))return this.overrideContext(wt.f_expr),this.parseFunction(this.startNodeAt(s,o),0,!1,!0,e);if(n&&!this.canInsertSemicolon()){if(this.eat(D.arrow))return this.parseArrowExpression(this.startNodeAt(s,o),[u],!1,e);if(this.options.ecmaVersion>=8&&"async"===u.name&&this.type===D.name&&!a&&(!this.potentialArrowInForAwait||"of"!==this.value||this.containsEsc))return u=this.parseIdent(!1),!this.canInsertSemicolon()&&this.eat(D.arrow)||this.unexpected(),this.parseArrowExpression(this.startNodeAt(s,o),[u],!0,e)}return u;case D.regexp:var h=this.value;return(r=this.parseLiteral(h.value)).regex={pattern:h.pattern,flags:h.flags},r;case D.num:case D.string:return this.parseLiteral(this.value);case D._null:case D._true:case D._false:return(r=this.startNode()).value=this.type===D._null?null:this.type===D._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,"Literal");case D.parenL:var c=this.start,f=this.parseParenAndDistinguishExpression(n,e);return t&&(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(f)&&(t.parenthesizedAssign=c),t.parenthesizedBind<0&&(t.parenthesizedBind=c)),f;case D.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(D.bracketR,!0,!0,t),this.finishNode(r,"ArrayExpression");case D.braceL:return this.overrideContext(wt.b_expr),this.parseObj(!1,t);case D._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case D._class:return this.parseClass(this.startNode(),!1);case D._new:return this.parseNew();case D.backQuote:return this.parseTemplate();case D._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}},_t.parseExprAtomDefault=function(){this.unexpected()},_t.parseExprImport=function(t){var e=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===D.parenL&&!t)return this.parseDynamicImport(e);if(this.type===D.dot){var i=this.startNodeAt(e.start,e.loc&&e.loc.start);return i.name="import",e.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(e)}this.unexpected()},_t.parseDynamicImport=function(t){if(this.next(),t.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(D.parenR)?t.options=null:(this.expect(D.comma),this.afterTrailingComma(D.parenR)?t.options=null:(t.options=this.parseMaybeAssign(),this.eat(D.parenR)||(this.expect(D.comma),this.afterTrailingComma(D.parenR)||this.unexpected())));else if(!this.eat(D.parenR)){var e=this.start;this.eat(D.comma)&&this.eat(D.parenR)?this.raiseRecoverable(e,"Trailing comma is not allowed in import()"):this.unexpected(e)}return this.finishNode(t,"ImportExpression")},_t.parseImportMeta=function(t){this.next();var e=this.containsEsc;return t.property=this.parseIdent(!0),"meta"!==t.property.name&&this.raiseRecoverable(t.property.start,"The only valid meta property for import is 'import.meta'"),e&&this.raiseRecoverable(t.start,"'import.meta' must not contain escaped characters"),"module"===this.options.sourceType||this.options.allowImportExportEverywhere||this.raiseRecoverable(t.start,"Cannot use 'import.meta' outside a module"),this.finishNode(t,"MetaProperty")},_t.parseLiteral=function(t){var e=this.startNode();return e.value=t,e.raw=this.input.slice(this.start,this.end),110===e.raw.charCodeAt(e.raw.length-1)&&(e.bigint=null!=e.value?e.value.toString():e.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(e,"Literal")},_t.parseParenExpression=function(){this.expect(D.parenL);var t=this.parseExpression();return this.expect(D.parenR),t},_t.shouldParseArrow=function(){return!this.canInsertSemicolon()},_t.parseParenAndDistinguishExpression=function(t,e){var i,r=this.start,n=this.startLoc,s=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o,a=this.start,u=this.startLoc,h=[],c=!0,f=!1,l=new ht,d=this.yieldPos,p=this.awaitPos;for(this.yieldPos=0,this.awaitPos=0;this.type!==D.parenR;){if(c?c=!1:this.expect(D.comma),s&&this.afterTrailingComma(D.parenR,!0)){f=!0;break}if(this.type===D.ellipsis){o=this.start,h.push(this.parseParenItem(this.parseRestBinding())),this.type===D.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}h.push(this.parseMaybeAssign(!1,l,this.parseParenItem))}var m=this.lastTokEnd,v=this.lastTokEndLoc;if(this.expect(D.parenR),t&&this.shouldParseArrow(h)&&this.eat(D.arrow))return this.checkPatternErrors(l,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=d,this.awaitPos=p,this.parseParenArrowList(r,n,h,e);h.length&&!f||this.unexpected(this.lastTokStart),o&&this.unexpected(o),this.checkExpressionErrors(l,!0),this.yieldPos=d||this.yieldPos,this.awaitPos=p||this.awaitPos,h.length>1?((i=this.startNodeAt(a,u)).expressions=h,this.finishNodeAt(i,"SequenceExpression",m,v)):i=h[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var y=this.startNodeAt(r,n);return y.expression=i,this.finishNode(y,"ParenthesizedExpression")}return i},_t.parseParenItem=function(t){return t},_t.parseParenArrowList=function(t,e,i,r){return this.parseArrowExpression(this.startNodeAt(t,e),i,!1,r)};var Ot=[];_t.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var t=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===D.dot){var e=this.startNodeAt(t.start,t.loc&&t.loc.start);e.name="new",t.meta=this.finishNode(e,"Identifier"),this.next();var i=this.containsEsc;return t.property=this.parseIdent(!0),"target"!==t.property.name&&this.raiseRecoverable(t.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(t.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(t.start,"'new.target' can only be used in functions and class static block"),this.finishNode(t,"MetaProperty")}var r=this.start,n=this.startLoc;return t.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,n,!0,!1),"Super"===t.callee.type&&this.raiseRecoverable(r,"Invalid use of 'super'"),t.arguments=this.eat(D.parenL)?this.parseExprList(D.parenR,this.options.ecmaVersion>=8,!1):Ot,this.finishNode(t,"NewExpression")},_t.parseTemplateElement=function(t){var e=t.isTagged,i=this.startNode();return this.type===D.invalidTemplate?(e||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,"\n"),cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,"\n"),cooked:this.value},this.next(),i.tail=this.type===D.backQuote,this.finishNode(i,"TemplateElement")},_t.parseTemplate=function(t){void 0===t&&(t={});var e=t.isTagged;void 0===e&&(e=!1);var i=this.startNode();this.next(),i.expressions=[];var r=this.parseTemplateElement({isTagged:e});for(i.quasis=[r];!r.tail;)this.type===D.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(D.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(D.braceR),i.quasis.push(r=this.parseTemplateElement({isTagged:e}));return this.next(),this.finishNode(i,"TemplateLiteral")},_t.isAsyncProp=function(t){return!t.computed&&"Identifier"===t.key.type&&"async"===t.key.name&&(this.type===D.name||this.type===D.num||this.type===D.string||this.type===D.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===D.star)&&!z.test(this.input.slice(this.lastTokEnd,this.start))},_t.parseObj=function(t,e){var i=this.startNode(),r=!0,n={};for(i.properties=[],this.next();!this.eat(D.braceR);){if(r)r=!1;else if(this.expect(D.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(D.braceR))break;var s=this.parseProperty(t,e);t||this.checkPropClash(s,n,e),i.properties.push(s)}return this.finishNode(i,t?"ObjectPattern":"ObjectExpression")},_t.parseProperty=function(t,e){var i,r,n,s,o=this.startNode();if(this.options.ecmaVersion>=9&&this.eat(D.ellipsis))return t?(o.argument=this.parseIdent(!1),this.type===D.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(o,"RestElement")):(o.argument=this.parseMaybeAssign(!1,e),this.type===D.comma&&e&&e.trailingComma<0&&(e.trailingComma=this.start),this.finishNode(o,"SpreadElement"));this.options.ecmaVersion>=6&&(o.method=!1,o.shorthand=!1,(t||e)&&(n=this.start,s=this.startLoc),t||(i=this.eat(D.star)));var a=this.containsEsc;return this.parsePropertyName(o),!t&&!a&&this.options.ecmaVersion>=8&&!i&&this.isAsyncProp(o)?(r=!0,i=this.options.ecmaVersion>=9&&this.eat(D.star),this.parsePropertyName(o)):r=!1,this.parsePropertyValue(o,t,i,r,n,s,e,a),this.finishNode(o,"Property")},_t.parseGetterSetter=function(t){var e=t.key.name;(this.parsePropertyName(t),t.value=this.parseMethod(!1),t.kind=e,t.value.params.length!==("get"===t.kind?0:1))?this.raiseRecoverable(t.value.start,"get"===t.kind?"getter should have no params":"setter should have exactly one param"):"set"===t.kind&&"RestElement"===t.value.params[0].type&&this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")},_t.parsePropertyValue=function(t,e,i,r,n,s,o,a){(i||r)&&this.type===D.colon&&this.unexpected(),this.eat(D.colon)?(t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),t.kind="init"):this.options.ecmaVersion>=6&&this.type===D.parenL?(e&&this.unexpected(),t.method=!0,t.value=this.parseMethod(i,r),t.kind="init"):e||a||!(this.options.ecmaVersion>=5)||t.computed||"Identifier"!==t.key.type||"get"!==t.key.name&&"set"!==t.key.name||this.type===D.comma||this.type===D.braceR||this.type===D.eq?this.options.ecmaVersion>=6&&!t.computed&&"Identifier"===t.key.type?((i||r)&&this.unexpected(),this.checkUnreserved(t.key),"await"!==t.key.name||this.awaitIdentPos||(this.awaitIdentPos=n),e?t.value=this.parseMaybeDefault(n,s,this.copyNode(t.key)):this.type===D.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),t.value=this.parseMaybeDefault(n,s,this.copyNode(t.key))):t.value=this.copyNode(t.key),t.kind="init",t.shorthand=!0):this.unexpected():((i||r)&&this.unexpected(),this.parseGetterSetter(t))},_t.parsePropertyName=function(t){if(this.options.ecmaVersion>=6){if(this.eat(D.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(D.bracketR),t.key;t.computed=!1}return t.key=this.type===D.num||this.type===D.string?this.parseExprAtom():this.parseIdent("never"!==this.options.allowReserved)},_t.initFunction=function(t){t.id=null,this.options.ecmaVersion>=6&&(t.generator=t.expression=!1),this.options.ecmaVersion>=8&&(t.async=!1)},_t.parseMethod=function(t,e,i){var r=this.startNode(),n=this.yieldPos,s=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=t),this.options.ecmaVersion>=8&&(r.async=!!e),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(64|nt(e,r.generator)|(i?128:0)),this.expect(D.parenL),r.params=this.parseBindingList(D.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=n,this.awaitPos=s,this.awaitIdentPos=o,this.finishNode(r,"FunctionExpression")},_t.parseArrowExpression=function(t,e,i,r){var n=this.yieldPos,s=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(16|nt(i,!1)),this.initFunction(t),this.options.ecmaVersion>=8&&(t.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0,!1,r),this.yieldPos=n,this.awaitPos=s,this.awaitIdentPos=o,this.finishNode(t,"ArrowFunctionExpression")},_t.parseFunctionBody=function(t,e,i,r){var n=this.strict,s=!1;if(e&&this.type!==D.braceL)t.body=this.parseMaybeAssign(r),t.expression=!0,this.checkParams(t,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(t.params);n&&!o||(s=this.strictDirective(this.end))&&o&&this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list");var a=this.labels;this.labels=[],s&&(this.strict=!0),this.checkParams(t,!n&&!s&&!e&&!i&&this.isSimpleParamList(t.params)),this.strict&&t.id&&this.checkLValSimple(t.id,5),t.body=this.parseBlock(!1,void 0,s&&!n),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=a}this.exitScope()},_t.isSimpleParamList=function(t){for(var e=0,i=t;e<i.length;e+=1)if("Identifier"!==i[e].type)return!1;return!0},_t.checkParams=function(t,e){for(var i=Object.create(null),r=0,n=t.params;r<n.length;r+=1)this.checkLValInnerPattern(n[r],1,e?null:i)},_t.parseExprList=function(t,e,i,r){for(var n=[],s=!0;!this.eat(t);){if(s)s=!1;else if(this.expect(D.comma),e&&this.afterTrailingComma(t))break;var o=void 0;i&&this.type===D.comma?o=null:this.type===D.ellipsis?(o=this.parseSpread(r),r&&this.type===D.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),n.push(o)}return n},_t.checkUnreserved=function(t){var e=t.start,i=t.end,r=t.name;this.inGenerator&&"yield"===r&&this.raiseRecoverable(e,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&"await"===r&&this.raiseRecoverable(e,"Cannot use 'await' as identifier inside an async function"),259&this.currentThisScope().flags||"arguments"!==r||this.raiseRecoverable(e,"Cannot use 'arguments' in class field initializer"),!this.inClassStaticBlock||"arguments"!==r&&"await"!==r||this.raise(e,"Cannot use "+r+" in class static initialization block"),this.keywords.test(r)&&this.raise(e,"Unexpected keyword '"+r+"'"),this.options.ecmaVersion<6&&-1!==this.input.slice(e,i).indexOf("\\")||(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(this.inAsync||"await"!==r||this.raiseRecoverable(e,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(e,"The keyword '"+r+"' is reserved"))},_t.parseIdent=function(t){var e=this.parseIdentNode();return this.next(!!t),this.finishNode(e,"Identifier"),t||(this.checkUnreserved(e),"await"!==e.name||this.awaitIdentPos||(this.awaitIdentPos=e.start)),e},_t.parseIdentNode=function(){var t=this.startNode();return this.type===D.name?t.name=this.value:this.type.keyword?(t.name=this.type.keyword,"class"!==t.name&&"function"!==t.name||this.lastTokEnd===this.lastTokStart+1&&46===this.input.charCodeAt(this.lastTokStart)||this.context.pop(),this.type=D.name):this.unexpected(),t},_t.parsePrivateIdent=function(){var t=this.startNode();return this.type===D.privateId?t.name=this.value:this.unexpected(),this.next(),this.finishNode(t,"PrivateIdentifier"),this.options.checkPrivateFields&&(0===this.privateNameStack.length?this.raise(t.start,"Private field '#"+t.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(t)),t},_t.parseYield=function(t){this.yieldPos||(this.yieldPos=this.start);var e=this.startNode();return this.next(),this.type===D.semi||this.canInsertSemicolon()||this.type!==D.star&&!this.type.startsExpr?(e.delegate=!1,e.argument=null):(e.delegate=this.eat(D.star),e.argument=this.parseMaybeAssign(t)),this.finishNode(e,"YieldExpression")},_t.parseAwait=function(t){this.awaitPos||(this.awaitPos=this.start);var e=this.startNode();return this.next(),e.argument=this.parseMaybeUnary(null,!0,!1,t),this.finishNode(e,"AwaitExpression")};var St=st.prototype;St.raise=function(t,e){var i=et(this.input,t);e+=" ("+i.line+":"+i.column+")",this.sourceFile&&(e+=" in "+this.sourceFile);var r=new SyntaxError(e);throw r.pos=t,r.loc=i,r.raisedAt=this.pos,r},St.raiseRecoverable=St.raise,St.curPosition=function(){if(this.options.locations)return new Q(this.curLine,this.pos-this.lineStart)};var xt=st.prototype,jt=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[]};xt.enterScope=function(t){this.scopeStack.push(new jt(t))},xt.exitScope=function(){this.scopeStack.pop()},xt.treatFunctionsAsVarInScope=function(t){return 2&t.flags||!this.inModule&&1&t.flags},xt.declareName=function(t,e,i){var r=!1;if(2===e){var n=this.currentScope();r=n.lexical.indexOf(t)>-1||n.functions.indexOf(t)>-1||n.var.indexOf(t)>-1,n.lexical.push(t),this.inModule&&1&n.flags&&delete this.undefinedExports[t]}else if(4===e)this.currentScope().lexical.push(t);else if(3===e){var s=this.currentScope();r=this.treatFunctionsAsVar?s.lexical.indexOf(t)>-1:s.lexical.indexOf(t)>-1||s.var.indexOf(t)>-1,s.functions.push(t)}else for(var o=this.scopeStack.length-1;o>=0;--o){var a=this.scopeStack[o];if(a.lexical.indexOf(t)>-1&&!(32&a.flags&&a.lexical[0]===t)||!this.treatFunctionsAsVarInScope(a)&&a.functions.indexOf(t)>-1){r=!0;break}if(a.var.push(t),this.inModule&&1&a.flags&&delete this.undefinedExports[t],259&a.flags)break}r&&this.raiseRecoverable(i,"Identifier '"+t+"' has already been declared")},xt.checkLocalExport=function(t){-1===this.scopeStack[0].lexical.indexOf(t.name)&&-1===this.scopeStack[0].var.indexOf(t.name)&&(this.undefinedExports[t.name]=t)},xt.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},xt.currentVarScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(771&e.flags)return e}},xt.currentThisScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(771&e.flags&&!(16&e.flags))return e}};var It=function(t,e,i){this.type="",this.start=e,this.end=0,t.options.locations&&(this.loc=new tt(t,i)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[e,0])},Pt=st.prototype;function Ct(t,e,i,r){return t.type=e,t.end=i,this.options.locations&&(t.loc.end=r),this.options.ranges&&(t.range[1]=i),t}Pt.startNode=function(){return new It(this,this.start,this.startLoc)},Pt.startNodeAt=function(t,e){return new It(this,t,e)},Pt.finishNode=function(t,e){return Ct.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)},Pt.finishNodeAt=function(t,e,i,r){return Ct.call(this,t,e,i,r)},Pt.copyNode=function(t){var e=new It(this,t.start,this.startLoc);for(var i in t)e[i]=t[i];return e};var Tt,At,Nt="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Mt=Nt+" Extended_Pictographic",Rt=Mt+" EBase EComp EMod EPres ExtPict",Dt={9:Nt,10:Mt,11:Mt,12:Rt,13:Rt,14:Rt},zt={9:"",10:"",11:"",12:"",13:"",14:"Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"},Lt="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Ut="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",qt=Ut+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Ft=qt+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Bt=Ft+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Vt=Bt+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Gt={9:Ut,10:qt,11:Ft,12:Bt,13:Vt,14:Vt+" Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz"},Ht={};for(var Kt=0,Wt=[9,10,11,12,13,14];Kt<Wt.length;Kt+=1)At=void 0,(At=Ht[Tt=Wt[Kt]]={binary:Z(Dt[Tt]+" "+Lt),binaryOfStrings:Z(zt[Tt]),nonBinary:{General_Category:Z(Lt),Script:Z(Gt[Tt])}}).nonBinary.Script_Extensions=At.nonBinary.Script,At.nonBinary.gc=At.nonBinary.General_Category,At.nonBinary.sc=At.nonBinary.Script,At.nonBinary.scx=At.nonBinary.Script_Extensions;var Jt=st.prototype,Zt=function(t,e){this.parent=t,this.base=e||this};Zt.prototype.separatedFrom=function(t){for(var e=this;e;e=e.parent)for(var i=t;i;i=i.parent)if(e.base===i.base&&e!==i)return!0;return!1},Zt.prototype.sibling=function(){return new Zt(this.parent,this.base)};var Xt=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":"")+(t.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Ht[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};function Yt(t){return 105===t||109===t||115===t}function Qt(t){return 36===t||t>=40&&t<=43||46===t||63===t||t>=91&&t<=94||t>=123&&t<=125}function te(t){return t>=65&&t<=90||t>=97&&t<=122}function ee(t){return te(t)||95===t}function ie(t){return ee(t)||re(t)}function re(t){return t>=48&&t<=57}function ne(t){return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}function se(t){return t>=65&&t<=70?t-65+10:t>=97&&t<=102?t-97+10:t-48}function oe(t){return t>=48&&t<=55}Xt.prototype.reset=function(t,e,i){var r=-1!==i.indexOf("v"),n=-1!==i.indexOf("u");this.start=0|t,this.source=e+"",this.flags=i,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=n&&this.parser.options.ecmaVersion>=9)},Xt.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)},Xt.prototype.at=function(t,e){void 0===e&&(e=!1);var i=this.source,r=i.length;if(t>=r)return-1;var n=i.charCodeAt(t);if(!e&&!this.switchU||n<=55295||n>=57344||t+1>=r)return n;var s=i.charCodeAt(t+1);return s>=56320&&s<=57343?(n<<10)+s-56613888:n},Xt.prototype.nextIndex=function(t,e){void 0===e&&(e=!1);var i=this.source,r=i.length;if(t>=r)return r;var n,s=i.charCodeAt(t);return!e&&!this.switchU||s<=55295||s>=57344||t+1>=r||(n=i.charCodeAt(t+1))<56320||n>57343?t+1:t+2},Xt.prototype.current=function(t){return void 0===t&&(t=!1),this.at(this.pos,t)},Xt.prototype.lookahead=function(t){return void 0===t&&(t=!1),this.at(this.nextIndex(this.pos,t),t)},Xt.prototype.advance=function(t){void 0===t&&(t=!1),this.pos=this.nextIndex(this.pos,t)},Xt.prototype.eat=function(t,e){return void 0===e&&(e=!1),this.current(e)===t&&(this.advance(e),!0)},Xt.prototype.eatChars=function(t,e){void 0===e&&(e=!1);for(var i=this.pos,r=0,n=t;r<n.length;r+=1){var s=n[r],o=this.at(i,e);if(-1===o||o!==s)return!1;i=this.nextIndex(i,e)}return this.pos=i,!0},Jt.validateRegExpFlags=function(t){for(var e=t.validFlags,i=t.flags,r=!1,n=!1,s=0;s<i.length;s++){var o=i.charAt(s);-1===e.indexOf(o)&&this.raise(t.start,"Invalid regular expression flag"),i.indexOf(o,s+1)>-1&&this.raise(t.start,"Duplicate regular expression flag"),"u"===o&&(r=!0),"v"===o&&(n=!0)}this.options.ecmaVersion>=15&&r&&n&&this.raise(t.start,"Invalid regular expression flag")},Jt.validateRegExpPattern=function(t){this.regexp_pattern(t),!t.switchN&&this.options.ecmaVersion>=9&&function(t){for(var e in t)return!0;return!1}(t.groupNames)&&(t.switchN=!0,this.regexp_pattern(t))},Jt.regexp_pattern=function(t){t.pos=0,t.lastIntValue=0,t.lastStringValue="",t.lastAssertionIsQuantifiable=!1,t.numCapturingParens=0,t.maxBackReference=0,t.groupNames=Object.create(null),t.backReferenceNames.length=0,t.branchID=null,this.regexp_disjunction(t),t.pos!==t.source.length&&(t.eat(41)&&t.raise("Unmatched ')'"),(t.eat(93)||t.eat(125))&&t.raise("Lone quantifier brackets")),t.maxBackReference>t.numCapturingParens&&t.raise("Invalid escape");for(var e=0,i=t.backReferenceNames;e<i.length;e+=1)t.groupNames[i[e]]||t.raise("Invalid named capture referenced")},Jt.regexp_disjunction=function(t){var e=this.options.ecmaVersion>=16;for(e&&(t.branchID=new Zt(t.branchID,null)),this.regexp_alternative(t);t.eat(124);)e&&(t.branchID=t.branchID.sibling()),this.regexp_alternative(t);e&&(t.branchID=t.branchID.parent),this.regexp_eatQuantifier(t,!0)&&t.raise("Nothing to repeat"),t.eat(123)&&t.raise("Lone quantifier brackets")},Jt.regexp_alternative=function(t){for(;t.pos<t.source.length&&this.regexp_eatTerm(t););},Jt.regexp_eatTerm=function(t){return this.regexp_eatAssertion(t)?(t.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(t)&&t.switchU&&t.raise("Invalid quantifier"),!0):!!(t.switchU?this.regexp_eatAtom(t):this.regexp_eatExtendedAtom(t))&&(this.regexp_eatQuantifier(t),!0)},Jt.regexp_eatAssertion=function(t){var e=t.pos;if(t.lastAssertionIsQuantifiable=!1,t.eat(94)||t.eat(36))return!0;if(t.eat(92)){if(t.eat(66)||t.eat(98))return!0;t.pos=e}if(t.eat(40)&&t.eat(63)){var i=!1;if(this.options.ecmaVersion>=9&&(i=t.eat(60)),t.eat(61)||t.eat(33))return this.regexp_disjunction(t),t.eat(41)||t.raise("Unterminated group"),t.lastAssertionIsQuantifiable=!i,!0}return t.pos=e,!1},Jt.regexp_eatQuantifier=function(t,e){return void 0===e&&(e=!1),!!this.regexp_eatQuantifierPrefix(t,e)&&(t.eat(63),!0)},Jt.regexp_eatQuantifierPrefix=function(t,e){return t.eat(42)||t.eat(43)||t.eat(63)||this.regexp_eatBracedQuantifier(t,e)},Jt.regexp_eatBracedQuantifier=function(t,e){var i=t.pos;if(t.eat(123)){var r=0,n=-1;if(this.regexp_eatDecimalDigits(t)&&(r=t.lastIntValue,t.eat(44)&&this.regexp_eatDecimalDigits(t)&&(n=t.lastIntValue),t.eat(125)))return-1!==n&&n<r&&!e&&t.raise("numbers out of order in {} quantifier"),!0;t.switchU&&!e&&t.raise("Incomplete quantifier"),t.pos=i}return!1},Jt.regexp_eatAtom=function(t){return this.regexp_eatPatternCharacters(t)||t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)},Jt.regexp_eatReverseSolidusAtomEscape=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatAtomEscape(t))return!0;t.pos=e}return!1},Jt.regexp_eatUncapturingGroup=function(t){var e=t.pos;if(t.eat(40)){if(t.eat(63)){if(this.options.ecmaVersion>=16){var i=this.regexp_eatModifiers(t),r=t.eat(45);if(i||r){for(var n=0;n<i.length;n++){var s=i.charAt(n);i.indexOf(s,n+1)>-1&&t.raise("Duplicate regular expression modifiers")}if(r){var o=this.regexp_eatModifiers(t);i||o||58!==t.current()||t.raise("Invalid regular expression modifiers");for(var a=0;a<o.length;a++){var u=o.charAt(a);(o.indexOf(u,a+1)>-1||i.indexOf(u)>-1)&&t.raise("Duplicate regular expression modifiers")}}}}if(t.eat(58)){if(this.regexp_disjunction(t),t.eat(41))return!0;t.raise("Unterminated group")}}t.pos=e}return!1},Jt.regexp_eatCapturingGroup=function(t){if(t.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(t):63===t.current()&&t.raise("Invalid group"),this.regexp_disjunction(t),t.eat(41))return t.numCapturingParens+=1,!0;t.raise("Unterminated group")}return!1},Jt.regexp_eatModifiers=function(t){for(var e="",i=0;-1!==(i=t.current())&&Yt(i);)e+=X(i),t.advance();return e},Jt.regexp_eatExtendedAtom=function(t){return t.eat(46)||this.regexp_eatReverseSolidusAtomEscape(t)||this.regexp_eatCharacterClass(t)||this.regexp_eatUncapturingGroup(t)||this.regexp_eatCapturingGroup(t)||this.regexp_eatInvalidBracedQuantifier(t)||this.regexp_eatExtendedPatternCharacter(t)},Jt.regexp_eatInvalidBracedQuantifier=function(t){return this.regexp_eatBracedQuantifier(t,!0)&&t.raise("Nothing to repeat"),!1},Jt.regexp_eatSyntaxCharacter=function(t){var e=t.current();return!!Qt(e)&&(t.lastIntValue=e,t.advance(),!0)},Jt.regexp_eatPatternCharacters=function(t){for(var e=t.pos,i=0;-1!==(i=t.current())&&!Qt(i);)t.advance();return t.pos!==e},Jt.regexp_eatExtendedPatternCharacter=function(t){var e=t.current();return!(-1===e||36===e||e>=40&&e<=43||46===e||63===e||91===e||94===e||124===e||(t.advance(),0))},Jt.regexp_groupSpecifier=function(t){if(t.eat(63)){this.regexp_eatGroupName(t)||t.raise("Invalid group");var e=this.options.ecmaVersion>=16,i=t.groupNames[t.lastStringValue];if(i)if(e)for(var r=0,n=i;r<n.length;r+=1)n[r].separatedFrom(t.branchID)||t.raise("Duplicate capture group name");else t.raise("Duplicate capture group name");e?(i||(t.groupNames[t.lastStringValue]=[])).push(t.branchID):t.groupNames[t.lastStringValue]=!0}},Jt.regexp_eatGroupName=function(t){if(t.lastStringValue="",t.eat(60)){if(this.regexp_eatRegExpIdentifierName(t)&&t.eat(62))return!0;t.raise("Invalid capture group name")}return!1},Jt.regexp_eatRegExpIdentifierName=function(t){if(t.lastStringValue="",this.regexp_eatRegExpIdentifierStart(t)){for(t.lastStringValue+=X(t.lastIntValue);this.regexp_eatRegExpIdentifierPart(t);)t.lastStringValue+=X(t.lastIntValue);return!0}return!1},Jt.regexp_eatRegExpIdentifierStart=function(t){var e=t.pos,i=this.options.ecmaVersion>=11,r=t.current(i);return t.advance(i),92===r&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(r=t.lastIntValue),function(t){return I(t,!0)||36===t||95===t}(r)?(t.lastIntValue=r,!0):(t.pos=e,!1)},Jt.regexp_eatRegExpIdentifierPart=function(t){var e=t.pos,i=this.options.ecmaVersion>=11,r=t.current(i);return t.advance(i),92===r&&this.regexp_eatRegExpUnicodeEscapeSequence(t,i)&&(r=t.lastIntValue),function(t){return P(t,!0)||36===t||95===t||8204===t||8205===t}(r)?(t.lastIntValue=r,!0):(t.pos=e,!1)},Jt.regexp_eatAtomEscape=function(t){return!!(this.regexp_eatBackReference(t)||this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)||t.switchN&&this.regexp_eatKGroupName(t))||(t.switchU&&(99===t.current()&&t.raise("Invalid unicode escape"),t.raise("Invalid escape")),!1)},Jt.regexp_eatBackReference=function(t){var e=t.pos;if(this.regexp_eatDecimalEscape(t)){var i=t.lastIntValue;if(t.switchU)return i>t.maxBackReference&&(t.maxBackReference=i),!0;if(i<=t.numCapturingParens)return!0;t.pos=e}return!1},Jt.regexp_eatKGroupName=function(t){if(t.eat(107)){if(this.regexp_eatGroupName(t))return t.backReferenceNames.push(t.lastStringValue),!0;t.raise("Invalid named reference")}return!1},Jt.regexp_eatCharacterEscape=function(t){return this.regexp_eatControlEscape(t)||this.regexp_eatCControlLetter(t)||this.regexp_eatZero(t)||this.regexp_eatHexEscapeSequence(t)||this.regexp_eatRegExpUnicodeEscapeSequence(t,!1)||!t.switchU&&this.regexp_eatLegacyOctalEscapeSequence(t)||this.regexp_eatIdentityEscape(t)},Jt.regexp_eatCControlLetter=function(t){var e=t.pos;if(t.eat(99)){if(this.regexp_eatControlLetter(t))return!0;t.pos=e}return!1},Jt.regexp_eatZero=function(t){return 48===t.current()&&!re(t.lookahead())&&(t.lastIntValue=0,t.advance(),!0)},Jt.regexp_eatControlEscape=function(t){var e=t.current();return 116===e?(t.lastIntValue=9,t.advance(),!0):110===e?(t.lastIntValue=10,t.advance(),!0):118===e?(t.lastIntValue=11,t.advance(),!0):102===e?(t.lastIntValue=12,t.advance(),!0):114===e&&(t.lastIntValue=13,t.advance(),!0)},Jt.regexp_eatControlLetter=function(t){var e=t.current();return!!te(e)&&(t.lastIntValue=e%32,t.advance(),!0)},Jt.regexp_eatRegExpUnicodeEscapeSequence=function(t,e){void 0===e&&(e=!1);var i,r=t.pos,n=e||t.switchU;if(t.eat(117)){if(this.regexp_eatFixedHexDigits(t,4)){var s=t.lastIntValue;if(n&&s>=55296&&s<=56319){var o=t.pos;if(t.eat(92)&&t.eat(117)&&this.regexp_eatFixedHexDigits(t,4)){var a=t.lastIntValue;if(a>=56320&&a<=57343)return t.lastIntValue=1024*(s-55296)+(a-56320)+65536,!0}t.pos=o,t.lastIntValue=s}return!0}if(n&&t.eat(123)&&this.regexp_eatHexDigits(t)&&t.eat(125)&&(i=t.lastIntValue)>=0&&i<=1114111)return!0;n&&t.raise("Invalid unicode escape"),t.pos=r}return!1},Jt.regexp_eatIdentityEscape=function(t){if(t.switchU)return!!this.regexp_eatSyntaxCharacter(t)||!!t.eat(47)&&(t.lastIntValue=47,!0);var e=t.current();return!(99===e||t.switchN&&107===e||(t.lastIntValue=e,t.advance(),0))},Jt.regexp_eatDecimalEscape=function(t){t.lastIntValue=0;var e=t.current();if(e>=49&&e<=57){do{t.lastIntValue=10*t.lastIntValue+(e-48),t.advance()}while((e=t.current())>=48&&e<=57);return!0}return!1},Jt.regexp_eatCharacterClassEscape=function(t){var e=t.current();if(function(t){return 100===t||68===t||115===t||83===t||119===t||87===t}(e))return t.lastIntValue=-1,t.advance(),1;var i=!1;if(t.switchU&&this.options.ecmaVersion>=9&&((i=80===e)||112===e)){var r;if(t.lastIntValue=-1,t.advance(),t.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(t))&&t.eat(125))return i&&2===r&&t.raise("Invalid property name"),r;t.raise("Invalid property name")}return 0},Jt.regexp_eatUnicodePropertyValueExpression=function(t){var e=t.pos;if(this.regexp_eatUnicodePropertyName(t)&&t.eat(61)){var i=t.lastStringValue;if(this.regexp_eatUnicodePropertyValue(t))return this.regexp_validateUnicodePropertyNameAndValue(t,i,t.lastStringValue),1}return t.pos=e,this.regexp_eatLoneUnicodePropertyNameOrValue(t)?this.regexp_validateUnicodePropertyNameOrValue(t,t.lastStringValue):0},Jt.regexp_validateUnicodePropertyNameAndValue=function(t,e,i){K(t.unicodeProperties.nonBinary,e)||t.raise("Invalid property name"),t.unicodeProperties.nonBinary[e].test(i)||t.raise("Invalid property value")},Jt.regexp_validateUnicodePropertyNameOrValue=function(t,e){return t.unicodeProperties.binary.test(e)?1:t.switchV&&t.unicodeProperties.binaryOfStrings.test(e)?2:void t.raise("Invalid property name")},Jt.regexp_eatUnicodePropertyName=function(t){var e=0;for(t.lastStringValue="";ee(e=t.current());)t.lastStringValue+=X(e),t.advance();return""!==t.lastStringValue},Jt.regexp_eatUnicodePropertyValue=function(t){var e=0;for(t.lastStringValue="";ie(e=t.current());)t.lastStringValue+=X(e),t.advance();return""!==t.lastStringValue},Jt.regexp_eatLoneUnicodePropertyNameOrValue=function(t){return this.regexp_eatUnicodePropertyValue(t)},Jt.regexp_eatCharacterClass=function(t){if(t.eat(91)){var e=t.eat(94),i=this.regexp_classContents(t);return t.eat(93)||t.raise("Unterminated character class"),e&&2===i&&t.raise("Negated character class may contain strings"),!0}return!1},Jt.regexp_classContents=function(t){return 93===t.current()?1:t.switchV?this.regexp_classSetExpression(t):(this.regexp_nonEmptyClassRanges(t),1)},Jt.regexp_nonEmptyClassRanges=function(t){for(;this.regexp_eatClassAtom(t);){var e=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassAtom(t)){var i=t.lastIntValue;!t.switchU||-1!==e&&-1!==i||t.raise("Invalid character class"),-1!==e&&-1!==i&&e>i&&t.raise("Range out of order in character class")}}},Jt.regexp_eatClassAtom=function(t){var e=t.pos;if(t.eat(92)){if(this.regexp_eatClassEscape(t))return!0;if(t.switchU){var i=t.current();(99===i||oe(i))&&t.raise("Invalid class escape"),t.raise("Invalid escape")}t.pos=e}var r=t.current();return 93!==r&&(t.lastIntValue=r,t.advance(),!0)},Jt.regexp_eatClassEscape=function(t){var e=t.pos;if(t.eat(98))return t.lastIntValue=8,!0;if(t.switchU&&t.eat(45))return t.lastIntValue=45,!0;if(!t.switchU&&t.eat(99)){if(this.regexp_eatClassControlLetter(t))return!0;t.pos=e}return this.regexp_eatCharacterClassEscape(t)||this.regexp_eatCharacterEscape(t)},Jt.regexp_classSetExpression=function(t){var e,i=1;if(this.regexp_eatClassSetRange(t));else if(e=this.regexp_eatClassSetOperand(t)){2===e&&(i=2);for(var r=t.pos;t.eatChars([38,38]);)38!==t.current()&&(e=this.regexp_eatClassSetOperand(t))?2!==e&&(i=1):t.raise("Invalid character in character class");if(r!==t.pos)return i;for(;t.eatChars([45,45]);)this.regexp_eatClassSetOperand(t)||t.raise("Invalid character in character class");if(r!==t.pos)return i}else t.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(t)){if(!(e=this.regexp_eatClassSetOperand(t)))return i;2===e&&(i=2)}},Jt.regexp_eatClassSetRange=function(t){var e=t.pos;if(this.regexp_eatClassSetCharacter(t)){var i=t.lastIntValue;if(t.eat(45)&&this.regexp_eatClassSetCharacter(t)){var r=t.lastIntValue;return-1!==i&&-1!==r&&i>r&&t.raise("Range out of order in character class"),!0}t.pos=e}return!1},Jt.regexp_eatClassSetOperand=function(t){return this.regexp_eatClassSetCharacter(t)?1:this.regexp_eatClassStringDisjunction(t)||this.regexp_eatNestedClass(t)},Jt.regexp_eatNestedClass=function(t){var e=t.pos;if(t.eat(91)){var i=t.eat(94),r=this.regexp_classContents(t);if(t.eat(93))return i&&2===r&&t.raise("Negated character class may contain strings"),r;t.pos=e}if(t.eat(92)){var n=this.regexp_eatCharacterClassEscape(t);if(n)return n;t.pos=e}return null},Jt.regexp_eatClassStringDisjunction=function(t){var e=t.pos;if(t.eatChars([92,113])){if(t.eat(123)){var i=this.regexp_classStringDisjunctionContents(t);if(t.eat(125))return i}else t.raise("Invalid escape");t.pos=e}return null},Jt.regexp_classStringDisjunctionContents=function(t){for(var e=this.regexp_classString(t);t.eat(124);)2===this.regexp_classString(t)&&(e=2);return e},Jt.regexp_classString=function(t){for(var e=0;this.regexp_eatClassSetCharacter(t);)e++;return 1===e?1:2},Jt.regexp_eatClassSetCharacter=function(t){var e=t.pos;if(t.eat(92))return!(!this.regexp_eatCharacterEscape(t)&&!this.regexp_eatClassSetReservedPunctuator(t)&&(t.eat(98)?(t.lastIntValue=8,0):(t.pos=e,1)));var i=t.current();return!(i<0||i===t.lookahead()&&function(t){return 33===t||t>=35&&t<=38||t>=42&&t<=44||46===t||t>=58&&t<=64||94===t||96===t||126===t}(i)||function(t){return 40===t||41===t||45===t||47===t||t>=91&&t<=93||t>=123&&t<=125}(i)||(t.advance(),t.lastIntValue=i,0))},Jt.regexp_eatClassSetReservedPunctuator=function(t){var e=t.current();return!!function(t){return 33===t||35===t||37===t||38===t||44===t||45===t||t>=58&&t<=62||64===t||96===t||126===t}(e)&&(t.lastIntValue=e,t.advance(),!0)},Jt.regexp_eatClassControlLetter=function(t){var e=t.current();return!(!re(e)&&95!==e||(t.lastIntValue=e%32,t.advance(),0))},Jt.regexp_eatHexEscapeSequence=function(t){var e=t.pos;if(t.eat(120)){if(this.regexp_eatFixedHexDigits(t,2))return!0;t.switchU&&t.raise("Invalid escape"),t.pos=e}return!1},Jt.regexp_eatDecimalDigits=function(t){var e=t.pos,i=0;for(t.lastIntValue=0;re(i=t.current());)t.lastIntValue=10*t.lastIntValue+(i-48),t.advance();return t.pos!==e},Jt.regexp_eatHexDigits=function(t){var e=t.pos,i=0;for(t.lastIntValue=0;ne(i=t.current());)t.lastIntValue=16*t.lastIntValue+se(i),t.advance();return t.pos!==e},Jt.regexp_eatLegacyOctalEscapeSequence=function(t){if(this.regexp_eatOctalDigit(t)){var e=t.lastIntValue;if(this.regexp_eatOctalDigit(t)){var i=t.lastIntValue;t.lastIntValue=e<=3&&this.regexp_eatOctalDigit(t)?64*e+8*i+t.lastIntValue:8*e+i}else t.lastIntValue=e;return!0}return!1},Jt.regexp_eatOctalDigit=function(t){var e=t.current();return oe(e)?(t.lastIntValue=e-48,t.advance(),!0):(t.lastIntValue=0,!1)},Jt.regexp_eatFixedHexDigits=function(t,e){var i=t.pos;t.lastIntValue=0;for(var r=0;r<e;++r){var n=t.current();if(!ne(n))return t.pos=i,!1;t.lastIntValue=16*t.lastIntValue+se(n),t.advance()}return!0};var ae=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new tt(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},ue=st.prototype;function he(t){return"function"!=typeof BigInt?null:BigInt(t.replace(/_/g,""))}ue.next=function(t){!t&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new ae(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},ue.getToken=function(){return this.next(),new ae(this)},"undefined"!=typeof Symbol&&(ue[Symbol.iterator]=function(){var t=this;return{next:function(){var e=t.getToken();return{done:e.type===D.eof,value:e}}}}),ue.nextToken=function(){var t=this.curContext();return t&&t.preserveSpace||this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length?this.finishToken(D.eof):t.override?t.override(this):void this.readToken(this.fullCharCodeAtPos())},ue.readToken=function(t){return I(t,this.options.ecmaVersion>=6)||92===t?this.readWord():this.getTokenFromCode(t)},ue.fullCharCodeAt=function(t){var e=this.input.charCodeAt(t);if(e<=55295||e>=56320)return e;var i=this.input.charCodeAt(t+1);return i<=56319||i>=57344?e:(e<<10)+i-56613888},ue.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)},ue.skipBlockComment=function(){var t=this.options.onComment&&this.curPosition(),e=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(-1===i&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var r=void 0,n=e;(r=q(this.input,n,this.pos))>-1;)++this.curLine,n=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(e+2,i),e,this.pos,t,this.curPosition())},ue.skipLineComment=function(t){for(var e=this.pos,i=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=t);this.pos<this.input.length&&!U(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(e+t,this.pos),e,this.pos,i,this.curPosition())},ue.skipSpace=function(){t:for(;this.pos<this.input.length;){var t=this.input.charCodeAt(this.pos);switch(t){case 32:case 160:++this.pos;break;case 13:10===this.input.charCodeAt(this.pos+1)&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break t}break;default:if(!(t>8&&t<14||t>=5760&&F.test(String.fromCharCode(t))))break t;++this.pos}}},ue.finishToken=function(t,e){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=t,this.value=e,this.updateContext(i)},ue.readToken_dot=function(){var t=this.input.charCodeAt(this.pos+1);if(t>=48&&t<=57)return this.readNumber(!0);var e=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&46===t&&46===e?(this.pos+=3,this.finishToken(D.ellipsis)):(++this.pos,this.finishToken(D.dot))},ue.readToken_slash=function(){var t=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):61===t?this.finishOp(D.assign,2):this.finishOp(D.slash,1)},ue.readToken_mult_modulo_exp=function(t){var e=this.input.charCodeAt(this.pos+1),i=1,r=42===t?D.star:D.modulo;return this.options.ecmaVersion>=7&&42===t&&42===e&&(++i,r=D.starstar,e=this.input.charCodeAt(this.pos+2)),61===e?this.finishOp(D.assign,i+1):this.finishOp(r,i)},ue.readToken_pipe_amp=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?this.options.ecmaVersion>=12&&61===this.input.charCodeAt(this.pos+2)?this.finishOp(D.assign,3):this.finishOp(124===t?D.logicalOR:D.logicalAND,2):61===e?this.finishOp(D.assign,2):this.finishOp(124===t?D.bitwiseOR:D.bitwiseAND,1)},ue.readToken_caret=function(){return 61===this.input.charCodeAt(this.pos+1)?this.finishOp(D.assign,2):this.finishOp(D.bitwiseXOR,1)},ue.readToken_plus_min=function(t){var e=this.input.charCodeAt(this.pos+1);return e===t?45!==e||this.inModule||62!==this.input.charCodeAt(this.pos+2)||0!==this.lastTokEnd&&!z.test(this.input.slice(this.lastTokEnd,this.pos))?this.finishOp(D.incDec,2):(this.skipLineComment(3),this.skipSpace(),this.nextToken()):61===e?this.finishOp(D.assign,2):this.finishOp(D.plusMin,1)},ue.readToken_lt_gt=function(t){var e=this.input.charCodeAt(this.pos+1),i=1;return e===t?(i=62===t&&62===this.input.charCodeAt(this.pos+2)?3:2,61===this.input.charCodeAt(this.pos+i)?this.finishOp(D.assign,i+1):this.finishOp(D.bitShift,i)):33!==e||60!==t||this.inModule||45!==this.input.charCodeAt(this.pos+2)||45!==this.input.charCodeAt(this.pos+3)?(61===e&&(i=2),this.finishOp(D.relational,i)):(this.skipLineComment(4),this.skipSpace(),this.nextToken())},ue.readToken_eq_excl=function(t){var e=this.input.charCodeAt(this.pos+1);return 61===e?this.finishOp(D.equality,61===this.input.charCodeAt(this.pos+2)?3:2):61===t&&62===e&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(D.arrow)):this.finishOp(61===t?D.eq:D.prefix,1)},ue.readToken_question=function(){var t=this.options.ecmaVersion;if(t>=11){var e=this.input.charCodeAt(this.pos+1);if(46===e){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(D.questionDot,2)}if(63===e)return t>=12&&61===this.input.charCodeAt(this.pos+2)?this.finishOp(D.assign,3):this.finishOp(D.coalesce,2)}return this.finishOp(D.question,1)},ue.readToken_numberSign=function(){var t=35;if(this.options.ecmaVersion>=13&&(++this.pos,I(t=this.fullCharCodeAtPos(),!0)||92===t))return this.finishToken(D.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+X(t)+"'")},ue.getTokenFromCode=function(t){switch(t){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(D.parenL);case 41:return++this.pos,this.finishToken(D.parenR);case 59:return++this.pos,this.finishToken(D.semi);case 44:return++this.pos,this.finishToken(D.comma);case 91:return++this.pos,this.finishToken(D.bracketL);case 93:return++this.pos,this.finishToken(D.bracketR);case 123:return++this.pos,this.finishToken(D.braceL);case 125:return++this.pos,this.finishToken(D.braceR);case 58:return++this.pos,this.finishToken(D.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(D.backQuote);case 48:var e=this.input.charCodeAt(this.pos+1);if(120===e||88===e)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(111===e||79===e)return this.readRadixNumber(8);if(98===e||66===e)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);case 63:return this.readToken_question();case 126:return this.finishOp(D.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+X(t)+"'")},ue.finishOp=function(t,e){var i=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,i)},ue.readRegexp=function(){for(var t,e,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(z.test(r)&&this.raise(i,"Unterminated regular expression"),t)t=!1;else{if("["===r)e=!0;else if("]"===r&&e)e=!1;else if("/"===r&&!e)break;t="\\"===r}++this.pos}var n=this.input.slice(i,this.pos);++this.pos;var s=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(s);var a=this.regexpState||(this.regexpState=new Xt(this));a.reset(i,n,o),this.validateRegExpFlags(a),this.validateRegExpPattern(a);var u=null;try{u=new RegExp(n,o)}catch(t){}return this.finishToken(D.regexp,{pattern:n,flags:o,value:u})},ue.readInt=function(t,e,i){for(var r=this.options.ecmaVersion>=12&&void 0===e,n=i&&48===this.input.charCodeAt(this.pos),s=this.pos,o=0,a=0,u=0,h=null==e?1/0:e;u<h;++u,++this.pos){var c=this.input.charCodeAt(this.pos),f=void 0;if(r&&95===c)n&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),95===a&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),0===u&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),a=c;else{if((f=c>=97?c-97+10:c>=65?c-65+10:c>=48&&c<=57?c-48:1/0)>=t)break;a=c,o=o*t+f}}return r&&95===a&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===s||null!=e&&this.pos-s!==e?null:o},ue.readRadixNumber=function(t){var e=this.pos;this.pos+=2;var i=this.readInt(t);return null==i&&this.raise(this.start+2,"Expected number in radix "+t),this.options.ecmaVersion>=11&&110===this.input.charCodeAt(this.pos)?(i=he(this.input.slice(e,this.pos)),++this.pos):I(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(D.num,i)},ue.readNumber=function(t){var e=this.pos;t||null!==this.readInt(10,void 0,!0)||this.raise(e,"Invalid number");var i=this.pos-e>=2&&48===this.input.charCodeAt(e);i&&this.strict&&this.raise(e,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!i&&!t&&this.options.ecmaVersion>=11&&110===r){var n=he(this.input.slice(e,this.pos));return++this.pos,I(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(D.num,n)}i&&/[89]/.test(this.input.slice(e,this.pos))&&(i=!1),46!==r||i||(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),69!==r&&101!==r||i||(43!==(r=this.input.charCodeAt(++this.pos))&&45!==r||++this.pos,null===this.readInt(10)&&this.raise(e,"Invalid number")),I(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var s,o=(s=this.input.slice(e,this.pos),i?parseInt(s,8):parseFloat(s.replace(/_/g,"")));return this.finishToken(D.num,o)},ue.readCodePoint=function(){var t;if(123===this.input.charCodeAt(this.pos)){this.options.ecmaVersion<6&&this.unexpected();var e=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(e,"Code point out of bounds")}else t=this.readHexChar(4);return t},ue.readString=function(t){for(var e="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===t)break;92===r?(e+=this.input.slice(i,this.pos),e+=this.readEscapedChar(!1),i=this.pos):8232===r||8233===r?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(U(r)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return e+=this.input.slice(i,this.pos++),this.finishToken(D.string,e)};var ce={};function fe(t,e){return st.parse(t,e)}ue.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t!==ce)throw t;this.readInvalidTemplateToken()}this.inTemplateElement=!1},ue.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw ce;this.raise(t,e)},ue.readTmplToken=function(){for(var t="",e=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(96===i||36===i&&123===this.input.charCodeAt(this.pos+1))return this.pos!==this.start||this.type!==D.template&&this.type!==D.invalidTemplate?(t+=this.input.slice(e,this.pos),this.finishToken(D.template,t)):36===i?(this.pos+=2,this.finishToken(D.dollarBraceL)):(++this.pos,this.finishToken(D.backQuote));if(92===i)t+=this.input.slice(e,this.pos),t+=this.readEscapedChar(!0),e=this.pos;else if(U(i)){switch(t+=this.input.slice(e,this.pos),++this.pos,i){case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:t+="\n";break;default:t+=String.fromCharCode(i)}this.options.locations&&(++this.curLine,this.lineStart=this.pos),e=this.pos}else++this.pos}},ue.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if("{"!==this.input[this.pos+1])break;case"`":return this.finishToken(D.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":"\n"===this.input[this.pos+1]&&++this.pos;case"\n":case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1}this.raise(this.start,"Unterminated template")},ue.readEscapedChar=function(t){var e=this.input.charCodeAt(++this.pos);switch(++this.pos,e){case 110:return"\n";case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return X(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:10===this.input.charCodeAt(this.pos)&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),t&&this.invalidStringToken(this.pos-1,"Invalid escape sequence in template string");default:if(e>=48&&e<=55){var i=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(i,8);return r>255&&(i=i.slice(0,-1),r=parseInt(i,8)),this.pos+=i.length-1,e=this.input.charCodeAt(this.pos),"0"===i&&56!==e&&57!==e||!this.strict&&!t||this.invalidStringToken(this.pos-1-i.length,t?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(r)}return U(e)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(e)}},ue.readHexChar=function(t){var e=this.pos,i=this.readInt(16,t);return null===i&&this.invalidStringToken(e,"Bad character escape sequence"),i},ue.readWord1=function(){this.containsEsc=!1;for(var t="",e=!0,i=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var n=this.fullCharCodeAtPos();if(P(n,r))this.pos+=n<=65535?1:2;else{if(92!==n)break;this.containsEsc=!0,t+=this.input.slice(i,this.pos);var s=this.pos;117!==this.input.charCodeAt(++this.pos)&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var o=this.readCodePoint();(e?I:P)(o,r)||this.invalidStringToken(s,"Invalid Unicode escape"),t+=X(o),i=this.pos}e=!1}return t+this.input.slice(i,this.pos)},ue.readWord=function(){var t=this.readWord1(),e=D.name;return this.keywords.test(t)&&(e=M[t]),this.finishToken(e,t)},st.acorn={Parser:st,version:"8.18.0",defaultOptions:it,Position:Q,SourceLocation:tt,getLineInfo:et,Node:It,TokenType:C,tokTypes:D,keywordTypes:M,TokContext:$t,tokContexts:wt,isIdentifierChar:P,isIdentifierStart:I,Token:ae,isNewLine:U,lineBreak:z,lineBreakG:L,nonASCIIwhitespace:F};var le,de={exports:{}},pe={},me={},ve={},ye={},ge={},$e={};function we(){return le||(le=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class i extends e{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=i;class r extends e{constructor(t){super(),this._items="string"==typeof t?[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 null!==(t=this._str)&&void 0!==t?t:this._str=this._items.reduce(((t,e)=>`${t}${e}`),"")}get names(){var t;return null!==(t=this._names)&&void 0!==t?t:this._names=this._items.reduce(((t,e)=>(e instanceof i&&(t[e.str]=(t[e.str]||0)+1),t)),{})}}function n(t,...e){const i=[t[0]];let n=0;for(;n<e.length;)a(i,e[n]),i.push(t[++n]);return new r(i)}t._Code=r,t.nil=new r(""),t._=n;const s=new r("+");function o(t,...e){const i=[h(t[0])];let n=0;for(;n<e.length;)i.push(s),a(i,e[n]),i.push(s,h(t[++n]));return function(t){let e=1;for(;e<t.length-1;){if(t[e]===s){const i=u(t[e-1],t[e+1]);if(void 0!==i){t.splice(e-1,3,i);continue}t[e++]="+"}e++}}(i),new r(i)}function a(t,e){var n;e instanceof r?t.push(...e._items):t.push(e instanceof i?e:"number"==typeof(n=e)||"boolean"==typeof n||null===n?n:h(Array.isArray(n)?n.join(","):n))}function u(t,e){if('""'===e)return t;if('""'===t)return e;if("string"==typeof t){if(e instanceof i||'"'!==t[t.length-1])return;return"string"!=typeof e?`${t.slice(0,-1)}${e}"`:'"'===e[0]?t.slice(0,-1)+e.slice(1):void 0}return"string"!=typeof e||'"'!==e[0]||t instanceof i?void 0:`"${t}${e.slice(1)}`}function h(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=o,t.addCodeArg=a,t.strConcat=function(t,e){return e.emptyStr()?t:t.emptyStr()?e:o`${t}${e}`},t.stringify=function(t){return new r(h(t))},t.safeStringify=h,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new r(`.${e}`):n`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new r(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(t){return new r(t.toString())}}($e)),$e}var be,_e,Ee={};function ke(){return be||(be=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const e=we();class i extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}}var r;!function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"}(r||(t.UsedValueState=r={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class n{constructor({prefixes:t,parent:e}={}){this._names={},this._prefixes=t,this._parent=e}toName(t){return t instanceof e.Name?t:this.name(t)}name(t){return new e.Name(this._newName(t))}_newName(t){return`${t}${(this._names[t]||this._nameGroup(t)).index++}`}_nameGroup(t){var e,i;if((null===(i=null===(e=this._parent)||void 0===e?void 0:e._prefixes)||void 0===i?void 0:i.has(t))||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}}t.Scope=n;class s extends e.Name{constructor(t,e){super(e),this.prefix=t}setValue(t,{property:i,itemIndex:r}){this.value=t,this.scopePath=e._`.${new e.Name(i)}[${r}]`}}t.ValueScopeName=s;const o=e._`\n`;t.ValueScope=class extends n{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?o:e.nil}}get(){return this._scope}name(t){return new s(t,this._newName(t))}value(t,e){var i;if(void 0===e.ref)throw new Error("CodeGen: ref must be passed in value");const r=this.toName(t),{prefix:n}=r,s=null!==(i=e.key)&&void 0!==i?i:e.ref;let o=this._values[n];if(o){const t=o.get(s);if(t)return t}else o=this._values[n]=new Map;o.set(s,r);const a=this._scope[n]||(this._scope[n]=[]),u=a.length;return a[u]=e.ref,r.setValue(e,{property:n,itemIndex:u}),r}getValue(t,e){const i=this._values[t];if(i)return i.get(e)}scopeRefs(t,i=this._values){return this._reduceValues(i,(i=>{if(void 0===i.scopePath)throw new Error(`CodeGen: name "${i}" has no value`);return e._`${t}${i.scopePath}`}))}scopeCode(t=this._values,e,i){return this._reduceValues(t,(t=>{if(void 0===t.value)throw new Error(`CodeGen: name "${t}" has no value`);return t.value.code}),e,i)}_reduceValues(n,s,o={},a){let u=e.nil;for(const h in n){const c=n[h];if(!c)continue;const f=o[h]=o[h]||new Map;c.forEach((n=>{if(f.has(n))return;f.set(n,r.Started);let o=s(n);if(o)u=e._`${u}${this.opts.es5?t.varKinds.var:t.varKinds.const} ${n} = ${o};${this.opts._n}`;else{if(!(o=null==a?void 0:a(n)))throw new i(n);u=e._`${u}${o}${this.opts._n}`}f.set(n,r.Completed)}))}return u}}}(Ee)),Ee}function Oe(){return _e||(_e=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const e=we(),i=ke();var r=we();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}});var n=ke();Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return n.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return n.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return n.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return n.varKinds}}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class s{optimizeNodes(){return this}optimizeNames(t,e){return this}}class o extends s{constructor(t,e,i){super(),this.varKind=t,this.name=e,this.rhs=i}render({es5:t,_n:e}){return`${t?i.varKinds.var:this.varKind} ${this.name}${void 0===this.rhs?"":` = ${this.rhs}`};`+e}optimizeNames(t,e){if(t[this.name.str])return this.rhs&&(this.rhs=I(this.rhs,t,e)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class a extends s{constructor(t,e,i){super(),this.lhs=t,this.rhs=e,this.sideEffects=i}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,i){if(!(this.lhs instanceof e.Name)||t[this.lhs.str]||this.sideEffects)return this.rhs=I(this.rhs,t,i),this}get names(){return j(this.lhs instanceof e.Name?{}:{...this.lhs.names},this.rhs)}}class u extends a{constructor(t,e,i,r){super(t,i,r),this.op=e}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}}class h extends s{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}}class c extends s{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}}class f extends s{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}}class l extends s{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,e){return this.code=I(this.code,t,e),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class d extends s{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce(((e,i)=>e+i.render(t)),"")}optimizeNodes(){const{nodes:t}=this;let e=t.length;for(;e--;){const i=t[e].optimizeNodes();Array.isArray(i)?t.splice(e,1,...i):i?t[e]=i:t.splice(e,1)}return t.length>0?this:void 0}optimizeNames(t,e){const{nodes:i}=this;let r=i.length;for(;r--;){const n=i[r];n.optimizeNames(t,e)||(P(t,n.names),i.splice(r,1))}return i.length>0?this:void 0}get names(){return this.nodes.reduce(((t,e)=>x(t,e.names)),{})}}class p extends d{render(t){return"{"+t._n+super.render(t)+"}"+t._n}}class m extends d{}class v extends p{}v.kind="else";class y extends p{constructor(t,e){super(e),this.condition=t}render(t){let e=`if(${this.condition})`+super.render(t);return this.else&&(e+="else "+this.else.render(t)),e}optimizeNodes(){super.optimizeNodes();const t=this.condition;if(!0===t)return this.nodes;let e=this.else;if(e){const t=e.optimizeNodes();e=this.else=Array.isArray(t)?new v(t):t}return e?!1===t?e instanceof y?e:e.nodes:this.nodes.length?this:new y(C(t),e instanceof y?[e]:e.nodes):!1!==t&&this.nodes.length?this:void 0}optimizeNames(t,e){var i;if(this.else=null===(i=this.else)||void 0===i?void 0:i.optimizeNames(t,e),super.optimizeNames(t,e)||this.else)return this.condition=I(this.condition,t,e),this}get names(){const t=super.names;return j(t,this.condition),this.else&&x(t,this.else.names),t}}y.kind="if";class g extends p{}g.kind="for";class $ extends g{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,e){if(super.optimizeNames(t,e))return this.iteration=I(this.iteration,t,e),this}get names(){return x(super.names,this.iteration.names)}}class w extends g{constructor(t,e,i,r){super(),this.varKind=t,this.name=e,this.from=i,this.to=r}render(t){const e=t.es5?i.varKinds.var:this.varKind,{name:r,from:n,to:s}=this;return`for(${e} ${r}=${n}; ${r}<${s}; ${r}++)`+super.render(t)}get names(){const t=j(super.names,this.from);return j(t,this.to)}}class b extends g{constructor(t,e,i,r){super(),this.loop=t,this.varKind=e,this.name=i,this.iterable=r}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,e){if(super.optimizeNames(t,e))return this.iterable=I(this.iterable,t,e),this}get names(){return x(super.names,this.iterable.names)}}class _ extends p{constructor(t,e,i){super(),this.name=t,this.args=e,this.async=i}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}}_.kind="func";class E extends d{render(t){return"return "+super.render(t)}}E.kind="return";class k extends p{render(t){let e="try"+super.render(t);return this.catch&&(e+=this.catch.render(t)),this.finally&&(e+=this.finally.render(t)),e}optimizeNodes(){var t,e;return super.optimizeNodes(),null===(t=this.catch)||void 0===t||t.optimizeNodes(),null===(e=this.finally)||void 0===e||e.optimizeNodes(),this}optimizeNames(t,e){var i,r;return super.optimizeNames(t,e),null===(i=this.catch)||void 0===i||i.optimizeNames(t,e),null===(r=this.finally)||void 0===r||r.optimizeNames(t,e),this}get names(){const t=super.names;return this.catch&&x(t,this.catch.names),this.finally&&x(t,this.finally.names),t}}class O extends p{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}}O.kind="catch";class S extends p{render(t){return"finally"+super.render(t)}}function x(t,e){for(const i in e)t[i]=(t[i]||0)+(e[i]||0);return t}function j(t,i){return i instanceof e._CodeOrName?x(t,i.names):t}function I(t,i,r){return t instanceof e.Name?s(t):(n=t)instanceof e._Code&&n._items.some((t=>t instanceof e.Name&&1===i[t.str]&&void 0!==r[t.str]))?new e._Code(t._items.reduce(((t,i)=>(i instanceof e.Name&&(i=s(i)),i instanceof e._Code?t.push(...i._items):t.push(i),t)),[])):t;var n;function s(t){const e=r[t.str];return void 0===e||1!==i[t.str]?t:(delete i[t.str],e)}}function P(t,e){for(const i in e)t[i]=(t[i]||0)-(e[i]||0)}function C(t){return"boolean"==typeof t||"number"==typeof t||null===t?!t:e._`!${M(t)}`}S.kind="finally",t.CodeGen=class{constructor(t,e={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...e,_n:e.lines?"\n":""},this._extScope=t,this._scope=new i.Scope({parent:t}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,e){const i=this._extScope.value(t,e);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}getScopeValue(t,e){return this._extScope.getValue(t,e)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,e,i,r){const n=this._scope.toName(e);return void 0!==i&&r&&(this._constants[n.str]=i),this._leafNode(new o(t,n,i)),n}const(t,e,r){return this._def(i.varKinds.const,t,e,r)}let(t,e,r){return this._def(i.varKinds.let,t,e,r)}var(t,e,r){return this._def(i.varKinds.var,t,e,r)}assign(t,e,i){return this._leafNode(new a(t,e,i))}add(e,i){return this._leafNode(new u(e,t.operators.ADD,i))}code(t){return"function"==typeof t?t():t!==e.nil&&this._leafNode(new l(t)),this}object(...t){const i=["{"];for(const[r,n]of t)i.length>1&&i.push(","),i.push(r),(r!==n||this.opts.es5)&&(i.push(":"),(0,e.addCodeArg)(i,n));return i.push("}"),new e._Code(i)}if(t,e,i){if(this._blockNode(new y(t)),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(t){return this._elseNode(new y(t))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(y,v)}_for(t,e){return this._blockNode(t),e&&this.code(e).endFor(),this}for(t,e){return this._for(new $(t),e)}forRange(t,e,r,n,s=(this.opts.es5?i.varKinds.var:i.varKinds.let)){const o=this._scope.toName(t);return this._for(new w(s,o,e,r),(()=>n(o)))}forOf(t,r,n,s=i.varKinds.const){const o=this._scope.toName(t);if(this.opts.es5){const t=r instanceof e.Name?r:this.var("_arr",r);return this.forRange("_i",0,e._`${t}.length`,(i=>{this.var(o,e._`${t}[${i}]`),n(o)}))}return this._for(new b("of",s,o,r),(()=>n(o)))}forIn(t,r,n,s=(this.opts.es5?i.varKinds.var:i.varKinds.const)){if(this.opts.ownProperties)return this.forOf(t,e._`Object.keys(${r})`,n);const o=this._scope.toName(t);return this._for(new b("in",s,o,r),(()=>n(o)))}endFor(){return this._endBlockNode(g)}label(t){return this._leafNode(new h(t))}break(t){return this._leafNode(new c(t))}return(t){const e=new E;if(this._blockNode(e),this.code(t),1!==e.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(E)}try(t,e,i){if(!e&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');const r=new k;if(this._blockNode(r),this.code(t),e){const t=this.name("e");this._currNode=r.catch=new O(t),e(t)}return i&&(this._currNode=r.finally=new S,this.code(i)),this._endBlockNode(O,S)}throw(t){return this._leafNode(new f(t))}block(t,e){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(e),this}endBlock(t){const e=this._blockStarts.pop();if(void 0===e)throw new Error("CodeGen: not in self-balancing block");const i=this._nodes.length-e;if(i<0||void 0!==t&&i!==t)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${t} expected`);return this._nodes.length=e,this}func(t,i=e.nil,r,n){return this._blockNode(new _(t,i,r)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(_)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,e){const i=this._currNode;if(i instanceof t||e&&i instanceof e)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${e?`${t.kind}/${e.kind}`:t.kind}"`)}_elseNode(t){const e=this._currNode;if(!(e instanceof y))throw new Error('CodeGen: "else" without "if"');return this._currNode=e.else=t,this}get _root(){return this._nodes[0]}get _currNode(){const t=this._nodes;return t[t.length-1]}set _currNode(t){const e=this._nodes;e[e.length-1]=t}},t.not=C;const T=N(t.operators.AND);t.and=function(...t){return t.reduce(T)};const A=N(t.operators.OR);function N(t){return(i,r)=>i===e.nil?r:r===e.nil?i:e._`${M(i)} ${t} ${M(r)}`}function M(t){return t instanceof e.Name?t:e._`(${t})`}t.or=function(...t){return t.reduce(A)}}(ge)),ge}var Se,xe={};function je(){if(Se)return xe;Se=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.checkStrictMode=xe.getErrorPath=xe.Type=xe.useFunc=xe.setEvaluated=xe.evaluatedPropsToName=xe.mergeEvaluated=xe.eachItem=xe.unescapeJsonPointer=xe.escapeJsonPointer=xe.escapeFragment=xe.unescapeFragment=xe.schemaRefOrVal=xe.schemaHasRulesButRef=xe.schemaHasRules=xe.checkUnknownRules=xe.alwaysValidSchema=xe.toHash=void 0;const t=Oe(),e=we();function i(t,e=t.schema){const{opts:i,self:r}=t;if(!i.strictSchema)return;if("boolean"==typeof e)return;const n=r.RULES.keywords;for(const i in e)n[i]||f(t,`unknown keyword: "${i}"`)}function r(t,e){if("boolean"==typeof t)return!t;for(const i in t)if(e[i])return!0;return!1}function n(t){return"number"==typeof t?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}function s(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function o({mergeNames:e,mergeToName:i,mergeValues:r,resultToName:n}){return(s,o,a,u)=>{const h=void 0===a?o:a instanceof t.Name?(o instanceof t.Name?e(s,o,a):i(s,o,a),a):o instanceof t.Name?(i(s,a,o),o):r(o,a);return u!==t.Name||h instanceof t.Name?h:n(s,h)}}function a(e,i){if(!0===i)return e.var("props",!0);const r=e.var("props",t._`{}`);return void 0!==i&&u(e,r,i),r}function u(e,i,r){Object.keys(r).forEach((r=>e.assign(t._`${i}${(0,t.getProperty)(r)}`,!0)))}xe.toHash=function(t){const e={};for(const i of t)e[i]=!0;return e},xe.alwaysValidSchema=function(t,e){return"boolean"==typeof e?e:0===Object.keys(e).length||(i(t,e),!r(e,t.self.RULES.all))},xe.checkUnknownRules=i,xe.schemaHasRules=r,xe.schemaHasRulesButRef=function(t,e){if("boolean"==typeof t)return!t;for(const i in t)if("$ref"!==i&&e.all[i])return!0;return!1},xe.schemaRefOrVal=function({topSchemaRef:e,schemaPath:i},r,n,s){if(!s){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return t._`${r}`}return t._`${e}${i}${(0,t.getProperty)(n)}`},xe.unescapeFragment=function(t){return s(decodeURIComponent(t))},xe.escapeFragment=function(t){return encodeURIComponent(n(t))},xe.escapeJsonPointer=n,xe.unescapeJsonPointer=s,xe.eachItem=function(t,e){if(Array.isArray(t))for(const i of t)e(i);else e(t)},xe.mergeEvaluated={props:o({mergeNames:(e,i,r)=>e.if(t._`${r} !== true && ${i} !== undefined`,(()=>{e.if(t._`${i} === true`,(()=>e.assign(r,!0)),(()=>e.assign(r,t._`${r} || {}`).code(t._`Object.assign(${r}, ${i})`)))})),mergeToName:(e,i,r)=>e.if(t._`${r} !== true`,(()=>{!0===i?e.assign(r,!0):(e.assign(r,t._`${r} || {}`),u(e,r,i))})),mergeValues:(t,e)=>!0===t||{...t,...e},resultToName:a}),items:o({mergeNames:(e,i,r)=>e.if(t._`${r} !== true && ${i} !== undefined`,(()=>e.assign(r,t._`${i} === true ? true : ${r} > ${i} ? ${r} : ${i}`))),mergeToName:(e,i,r)=>e.if(t._`${r} !== true`,(()=>e.assign(r,!0===i||t._`${r} > ${i} ? ${r} : ${i}`))),mergeValues:(t,e)=>!0===t||Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})},xe.evaluatedPropsToName=a,xe.setEvaluated=u;const h={};var c;function f(t,e,i=t.opts.strictSchema){if(i){if(e=`strict mode: ${e}`,!0===i)throw new Error(e);t.self.logger.warn(e)}}return xe.useFunc=function(t,i){return t.scopeValue("func",{ref:i,code:h[i.code]||(h[i.code]=new e._Code(i.code))})},function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"}(c||(xe.Type=c={})),xe.getErrorPath=function(e,i,r){if(e instanceof t.Name){const n=i===c.Num;return r?n?t._`"[" + ${e} + "]"`:t._`"['" + ${e} + "']"`:n?t._`"/" + ${e}`:t._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,t.getProperty)(e).toString():"/"+n(e)},xe.checkStrictMode=f,xe}var Ie,Pe,Ce,Te={};function Ae(){if(Ie)return Te;Ie=1,Object.defineProperty(Te,"__esModule",{value:!0});const t=Oe(),e={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")};return Te.default=e,Te}function Ne(){return Pe||(Pe=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const e=Oe(),i=je(),r=Ae();function n(t,i){const n=t.const("err",i);t.if(e._`${r.default.vErrors} === null`,(()=>t.assign(r.default.vErrors,e._`[${n}]`)),e._`${r.default.vErrors}.push(${n})`),t.code(e._`${r.default.errors}++`)}function s(t,i){const{gen:r,validateName:n,schemaEnv:s}=t;s.$async?r.throw(e._`new ${t.ValidationError}(${i})`):(r.assign(e._`${n}.errors`,i),r.return(!1))}t.keywordError={message:({keyword:t})=>e.str`must pass "${t}" keyword validation`},t.keyword$DataError={message:({keyword:t,schemaType:i})=>i?e.str`"${t}" keyword must be ${i} ($data)`:e.str`"${t}" keyword is invalid ($data)`},t.reportError=function(i,r=t.keywordError,o,u){const{it:h}=i,{gen:c,compositeRule:f,allErrors:l}=h,d=a(i,r,o);(null!=u?u:f||l)?n(c,d):s(h,e._`[${d}]`)},t.reportExtraError=function(e,i=t.keywordError,o){const{it:u}=e,{gen:h,compositeRule:c,allErrors:f}=u;n(h,a(e,i,o)),c||f||s(u,r.default.vErrors)},t.resetErrorsCount=function(t,i){t.assign(r.default.errors,i),t.if(e._`${r.default.vErrors} !== null`,(()=>t.if(i,(()=>t.assign(e._`${r.default.vErrors}.length`,i)),(()=>t.assign(r.default.vErrors,null)))))},t.extendErrors=function({gen:t,keyword:i,schemaValue:n,data:s,errsCount:o,it:a}){if(void 0===o)throw new Error("ajv implementation error");const u=t.name("err");t.forRange("i",o,r.default.errors,(o=>{t.const(u,e._`${r.default.vErrors}[${o}]`),t.if(e._`${u}.instancePath === undefined`,(()=>t.assign(e._`${u}.instancePath`,(0,e.strConcat)(r.default.instancePath,a.errorPath)))),t.assign(e._`${u}.schemaPath`,e.str`${a.errSchemaPath}/${i}`),a.opts.verbose&&(t.assign(e._`${u}.schema`,n),t.assign(e._`${u}.data`,s))}))};const o={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function a(t,i,n){const{createErrors:s}=t.it;return!1===s?e._`{}`:function(t,i,n={}){const{gen:s,it:a}=t,c=[u(a,n),h(t,n)];return function(t,{params:i,message:n},s){const{keyword:a,data:u,schemaValue:h,it:c}=t,{opts:f,propertyName:l,topSchemaRef:d,schemaPath:p}=c;s.push([o.keyword,a],[o.params,"function"==typeof i?i(t):i||e._`{}`]),f.messages&&s.push([o.message,"function"==typeof n?n(t):n]),f.verbose&&s.push([o.schema,h],[o.parentSchema,e._`${d}${p}`],[r.default.data,u]),l&&s.push([o.propertyName,l])}(t,i,c),s.object(...c)}(t,i,n)}function u({errorPath:t},{instancePath:n}){const s=n?e.str`${t}${(0,i.getErrorPath)(n,i.Type.Str)}`:t;return[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,s)]}function h({keyword:t,it:{errSchemaPath:r}},{schemaPath:n,parentSchema:s}){let a=s?r:e.str`${r}/${t}`;return n&&(a=e.str`${a}${(0,i.getErrorPath)(n,i.Type.Str)}`),[o.schemaPath,a]}}(ye)),ye}function Me(){if(Ce)return ve;Ce=1,Object.defineProperty(ve,"__esModule",{value:!0}),ve.boolOrEmptySchema=ve.topBoolOrEmptySchema=void 0;const t=Ne(),e=Oe(),i=Ae(),r={message:"boolean schema is false"};function n(e,i){const{gen:n,data:s}=e;(0,t.reportError)({gen:n,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},r,void 0,i)}return ve.topBoolOrEmptySchema=function(t){const{gen:r,schema:s,validateName:o}=t;!1===s?n(t,!1):"object"==typeof s&&!0===s.$async?r.return(i.default.data):(r.assign(e._`${o}.errors`,null),r.return(!0))},ve.boolOrEmptySchema=function(t,e){const{gen:i,schema:r}=t;!1===r?(i.var(e,!1),n(t)):i.var(e,!0)},ve}var Re,De={},ze={};function Le(){if(Re)return ze;Re=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.getRules=ze.isJSONType=void 0;const t=new Set(["string","number","integer","boolean","null","object","array"]);return ze.isJSONType=function(e){return"string"==typeof e&&t.has(e)},ze.getRules=function(){const t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}},ze}var Ue,qe,Fe={};function Be(){if(Ue)return Fe;function t(t,i){return i.rules.some((i=>e(t,i)))}function e(t,e){var i;return void 0!==t[e.keyword]||(null===(i=e.definition.implements)||void 0===i?void 0:i.some((e=>void 0!==t[e])))}return Ue=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.shouldUseRule=Fe.shouldUseGroup=Fe.schemaHasRulesForType=void 0,Fe.schemaHasRulesForType=function({schema:e,self:i},r){const n=i.RULES.types[r];return n&&!0!==n&&t(e,n)},Fe.shouldUseGroup=t,Fe.shouldUseRule=e,Fe}function Ve(){if(qe)return De;qe=1,Object.defineProperty(De,"__esModule",{value:!0}),De.reportTypeError=De.checkDataTypes=De.checkDataType=De.coerceAndCheckDataType=De.getJSONTypes=De.getSchemaTypes=De.DataType=void 0;const t=Le(),e=Be(),i=Ne(),r=Oe(),n=je();var s;function o(e){const i=Array.isArray(e)?e:e?[e]:[];if(i.every(t.isJSONType))return i;throw new Error("type must be JSONType or JSONType[]: "+i.join(","))}!function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"}(s||(De.DataType=s={})),De.getSchemaTypes=function(t){const e=o(t.type);if(e.includes("null")){if(!1===t.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&void 0!==t.nullable)throw new Error('"nullable" cannot be used without "type"');!0===t.nullable&&e.push("null")}return e},De.getJSONTypes=o,De.coerceAndCheckDataType=function(t,i){const{gen:n,data:o,opts:u}=t,c=function(t,e){return e?t.filter((t=>a.has(t)||"array"===e&&"array"===t)):[]}(i,u.coerceTypes),l=i.length>0&&!(0===c.length&&1===i.length&&(0,e.schemaHasRulesForType)(t,i[0]));if(l){const e=h(i,o,u.strictNumbers,s.Wrong);n.if(e,(()=>{c.length?function(t,e,i){const{gen:n,data:s,opts:o}=t,u=n.let("dataType",r._`typeof ${s}`),c=n.let("coerced",r._`undefined`);"array"===o.coerceTypes&&n.if(r._`${u} == 'object' && Array.isArray(${s}) && ${s}.length == 1`,(()=>n.assign(s,r._`${s}[0]`).assign(u,r._`typeof ${s}`).if(h(e,s,o.strictNumbers),(()=>n.assign(c,s))))),n.if(r._`${c} !== undefined`);for(const t of i)(a.has(t)||"array"===t&&"array"===o.coerceTypes)&&l(t);function l(t){switch(t){case"string":return void n.elseIf(r._`${u} == "number" || ${u} == "boolean"`).assign(c,r._`"" + ${s}`).elseIf(r._`${s} === null`).assign(c,r._`""`);case"number":return void n.elseIf(r._`${u} == "boolean" || ${s} === null
2
2
  || (${u} == "string" && ${s} && ${s} == +${s})`).assign(c,r._`+${s}`);case"integer":return void n.elseIf(r._`${u} === "boolean" || ${s} === null
3
3
  || (${u} === "string" && ${s} && ${s} == +${s} && !(${s} % 1))`).assign(c,r._`+${s}`);case"boolean":return void n.elseIf(r._`${s} === "false" || ${s} === 0 || ${s} === null`).assign(c,!1).elseIf(r._`${s} === "true" || ${s} === 1`).assign(c,!0);case"null":return n.elseIf(r._`${s} === "" || ${s} === 0 || ${s} === false`),void n.assign(c,null);case"array":n.elseIf(r._`${u} === "string" || ${u} === "number"
4
- || ${u} === "boolean" || ${s} === null`).assign(c,r._`[${s}]`)}}n.else(),f(t),n.endIf(),n.if(r._`${c} !== undefined`,(()=>{n.assign(s,c),function({gen:t,parentData:e,parentDataProperty:i},n){t.if(r._`${e} !== undefined`,(()=>t.assign(r._`${e}[${i}]`,n)))}(t,c)}))}(t,i,c):f(t)}))}return l};const a=new Set(["string","number","integer","boolean","null"]);function u(t,e,i,n=s.Correct){const o=n===s.Correct?r.operators.EQ:r.operators.NEQ;let a;switch(t){case"null":return r._`${e} ${o} null`;case"array":a=r._`Array.isArray(${e})`;break;case"object":a=r._`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":a=u(r._`!(${e} % 1) && !isNaN(${e})`);break;case"number":a=u();break;default:return r._`typeof ${e} ${o} ${t}`}return n===s.Correct?a:(0,r.not)(a);function u(t=r.nil){return(0,r.and)(r._`typeof ${e} == "number"`,t,i?r._`isFinite(${e})`:r.nil)}}function h(t,e,i,s){if(1===t.length)return u(t[0],e,i,s);let o;const a=(0,n.toHash)(t);if(a.array&&a.object){const t=r._`typeof ${e} != "object"`;o=a.null?t:r._`!${e} || ${t}`,delete a.null,delete a.array,delete a.object}else o=r.nil;a.number&&delete a.integer;for(const t in a)o=(0,r.and)(o,u(t,e,i,s));return o}De.checkDataType=u,De.checkDataTypes=h;const c={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>"string"==typeof t?r._`{type: ${t}}`:r._`{type: ${e}}`};function f(t){const e=function(t){const{gen:e,data:i,schema:r}=t,s=(0,n.schemaRefOrVal)(t,r,"type");return{gen:e,keyword:"type",data:i,schema:r.type,schemaCode:s,schemaValue:s,parentSchema:r,params:{},it:t}}(t);(0,i.reportError)(e,c)}return De.reportTypeError=f,De}var Ge,He={};function Ke(){if(Ge)return He;Ge=1,Object.defineProperty(He,"__esModule",{value:!0}),He.assignDefaults=void 0;const t=Oe(),e=je();function i(i,r,n){const{gen:s,compositeRule:o,data:a,opts:u}=i;if(void 0===n)return;const h=t._`${a}${(0,t.getProperty)(r)}`;if(o)return void(0,e.checkStrictMode)(i,`default is ignored for: ${h}`);let c=t._`${h} === undefined`;"empty"===u.useDefaults&&(c=t._`${c} || ${h} === null || ${h} === ""`),s.if(c,t._`${h} = ${(0,t.stringify)(n)}`)}return He.assignDefaults=function(t,e){const{properties:r,items:n}=t.schema;if("object"===e&&r)for(const e in r)i(t,e,r[e].default);else"array"===e&&Array.isArray(n)&&n.forEach(((e,r)=>i(t,r,e.default)))},He}var We,Je,Ze={},Xe={};function Ye(){if(We)return Xe;We=1,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.validateUnion=Xe.validateArray=Xe.usePattern=Xe.callValidateCode=Xe.schemaProperties=Xe.allSchemaProperties=Xe.noPropertyInData=Xe.propertyInData=Xe.isOwnProperty=Xe.hasPropFunc=Xe.reportMissingProp=Xe.checkMissingProp=Xe.checkReportMissingProp=void 0;const t=Oe(),e=je(),i=Ae(),r=je();function n(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:t._`Object.prototype.hasOwnProperty`})}function s(e,i,r){return t._`${n(e)}.call(${i}, ${r})`}function o(e,i,r,n){const o=t._`${i}${(0,t.getProperty)(r)} === undefined`;return n?(0,t.or)(o,(0,t.not)(s(e,i,r))):o}function a(t){return t?Object.keys(t).filter((t=>"__proto__"!==t)):[]}Xe.checkReportMissingProp=function(e,i){const{gen:r,data:n,it:s}=e;r.if(o(r,n,i,s.opts.ownProperties),(()=>{e.setParams({missingProperty:t._`${i}`},!0),e.error()}))},Xe.checkMissingProp=function({gen:e,data:i,it:{opts:r}},n,s){return(0,t.or)(...n.map((n=>(0,t.and)(o(e,i,n,r.ownProperties),t._`${s} = ${n}`))))},Xe.reportMissingProp=function(t,e){t.setParams({missingProperty:e},!0),t.error()},Xe.hasPropFunc=n,Xe.isOwnProperty=s,Xe.propertyInData=function(e,i,r,n){const o=t._`${i}${(0,t.getProperty)(r)} !== undefined`;return n?t._`${o} && ${s(e,i,r)}`:o},Xe.noPropertyInData=o,Xe.allSchemaProperties=a,Xe.schemaProperties=function(t,i){return a(i).filter((r=>!(0,e.alwaysValidSchema)(t,i[r])))},Xe.callValidateCode=function({schemaCode:e,data:r,it:{gen:n,topSchemaRef:s,schemaPath:o,errorPath:a},it:u},h,c,f){const l=f?t._`${e}, ${r}, ${s}${o}`:r,d=[[i.default.instancePath,(0,t.strConcat)(i.default.instancePath,a)],[i.default.parentData,u.parentData],[i.default.parentDataProperty,u.parentDataProperty],[i.default.rootData,i.default.rootData]];u.opts.dynamicRef&&d.push([i.default.dynamicAnchors,i.default.dynamicAnchors]);const p=t._`${l}, ${n.object(...d)}`;return c!==t.nil?t._`${h}.call(${c}, ${p})`:t._`${h}(${p})`};const u=t._`new RegExp`;return Xe.usePattern=function({gen:e,it:{opts:i}},n){const s=i.unicodeRegExp?"u":"",{regExp:o}=i.code,a=o(n,s);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:t._`${"new RegExp"===o.code?u:(0,r.useFunc)(e,o)}(${n}, ${s})`})},Xe.validateArray=function(i){const{gen:r,data:n,keyword:s,it:o}=i,a=r.name("valid");if(o.allErrors){const t=r.let("valid",!0);return u((()=>r.assign(t,!1))),t}return r.var(a,!0),u((()=>r.break())),a;function u(o){const u=r.const("len",t._`${n}.length`);r.forRange("i",0,u,(n=>{i.subschema({keyword:s,dataProp:n,dataPropType:e.Type.Num},a),r.if((0,t.not)(a),o)}))}},Xe.validateUnion=function(i){const{gen:r,schema:n,keyword:s,it:o}=i;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some((t=>(0,e.alwaysValidSchema)(o,t)))&&!o.opts.unevaluated)return;const a=r.let("valid",!1),u=r.name("_valid");r.block((()=>n.forEach(((e,n)=>{const o=i.subschema({keyword:s,schemaProp:n,compositeRule:!0},u);r.assign(a,t._`${a} || ${u}`),i.mergeValidEvaluated(o,u)||r.if((0,t.not)(a))})))),i.result(a,(()=>i.reset()),(()=>i.error(!0)))},Xe}function Qe(){if(Je)return Ze;Je=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.validateKeywordUsage=Ze.validSchemaType=Ze.funcKeywordCode=Ze.macroKeywordCode=void 0;const t=Oe(),e=Ae(),i=Ye(),r=Ne();function n(e){const{gen:i,data:r,it:n}=e;i.if(n.parentData,(()=>i.assign(r,t._`${n.parentData}[${n.parentDataProperty}]`)))}function s(e,i,r){if(void 0===r)throw new Error(`keyword "${i}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,t.stringify)(r)})}return Ze.macroKeywordCode=function(e,i){const{gen:r,keyword:n,schema:o,parentSchema:a,it:u}=e,h=i.macro.call(u.self,o,a,u),c=s(r,n,h);!1!==u.opts.validateSchema&&u.self.validateSchema(h,!0);const f=r.name("valid");e.subschema({schema:h,schemaPath:t.nil,errSchemaPath:`${u.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},f),e.pass(f,(()=>e.error(!0)))},Ze.funcKeywordCode=function(o,a){var u;const{gen:h,keyword:c,schema:f,parentSchema:l,$data:d,it:p}=o;!function({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}(p,a);const m=!d&&a.compile?a.compile.call(p.self,f,l,p):a.validate,v=s(h,c,m),y=h.let("valid");function g(r=(a.async?t._`await `:t.nil)){h.assign(y,t._`${r}${(0,i.callValidateCode)(o,v,p.opts.passContext?e.default.this:e.default.self,!("compile"in a&&!d||!1===a.schema))}`,a.modifying)}function $(e){var i;h.if((0,t.not)(null!==(i=a.valid)&&void 0!==i?i:y),e)}o.block$data(y,(function(){if(!1===a.errors)g(),a.modifying&&n(o),$((()=>o.error()));else{const i=a.async?function(){const e=h.let("ruleErrs",null);return h.try((()=>g(t._`await `)),(i=>h.assign(y,!1).if(t._`${i} instanceof ${p.ValidationError}`,(()=>h.assign(e,t._`${i}.errors`)),(()=>h.throw(i))))),e}():function(){const e=t._`${v}.errors`;return h.assign(e,null),g(t.nil),e}();a.modifying&&n(o),$((()=>function(i,n){const{gen:s}=i;s.if(t._`Array.isArray(${n})`,(()=>{s.assign(e.default.vErrors,t._`${e.default.vErrors} === null ? ${n} : ${e.default.vErrors}.concat(${n})`).assign(e.default.errors,t._`${e.default.vErrors}.length`),(0,r.extendErrors)(i)}),(()=>i.error()))}(o,i)))}})),o.ok(null!==(u=a.valid)&&void 0!==u?u:y)},Ze.validSchemaType=function(t,e,i=!1){return!e.length||e.some((e=>"array"===e?Array.isArray(t):"object"===e?t&&"object"==typeof t&&!Array.isArray(t):typeof t==e||i&&void 0===t))},Ze.validateKeywordUsage=function({schema:t,opts:e,self:i,errSchemaPath:r},n,s){if(Array.isArray(n.keyword)?!n.keyword.includes(s):n.keyword!==s)throw new Error("ajv implementation error");const o=n.dependencies;if(null==o?void 0:o.some((e=>!Object.prototype.hasOwnProperty.call(t,e))))throw new Error(`parent schema must have dependencies of ${s}: ${o.join(",")}`);if(n.validateSchema&&!n.validateSchema(t[s])){const t=`keyword "${s}" value is invalid at path "${r}": `+i.errorsText(n.validateSchema.errors);if("log"!==e.validateSchema)throw new Error(t);i.logger.error(t)}},Ze}var ti,ei={};function ii(){if(ti)return ei;ti=1,Object.defineProperty(ei,"__esModule",{value:!0}),ei.extendSubschemaMode=ei.extendSubschemaData=ei.getSubschema=void 0;const t=Oe(),e=je();return ei.getSubschema=function(i,{keyword:r,schemaProp:n,schema:s,schemaPath:o,errSchemaPath:a,topSchemaRef:u}){if(void 0!==r&&void 0!==s)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==r){const s=i.schema[r];return void 0===n?{schema:s,schemaPath:t._`${i.schemaPath}${(0,t.getProperty)(r)}`,errSchemaPath:`${i.errSchemaPath}/${r}`}:{schema:s[n],schemaPath:t._`${i.schemaPath}${(0,t.getProperty)(r)}${(0,t.getProperty)(n)}`,errSchemaPath:`${i.errSchemaPath}/${r}/${(0,e.escapeFragment)(n)}`}}if(void 0!==s){if(void 0===o||void 0===a||void 0===u)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:s,schemaPath:o,topSchemaRef:u,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},ei.extendSubschemaData=function(i,r,{dataProp:n,dataPropType:s,data:o,dataTypes:a,propertyName:u}){if(void 0!==o&&void 0!==n)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:h}=r;if(void 0!==n){const{errorPath:o,dataPathArr:a,opts:u}=r;c(h.let("data",t._`${r.data}${(0,t.getProperty)(n)}`,!0)),i.errorPath=t.str`${o}${(0,e.getErrorPath)(n,s,u.jsPropertySyntax)}`,i.parentDataProperty=t._`${n}`,i.dataPathArr=[...a,i.parentDataProperty]}function c(t){i.data=t,i.dataLevel=r.dataLevel+1,i.dataTypes=[],r.definedProperties=new Set,i.parentData=r.data,i.dataNames=[...r.dataNames,t]}void 0!==o&&(c(o instanceof t.Name?o:h.let("data",o,!0)),void 0!==u&&(i.propertyName=u)),a&&(i.dataTypes=a)},ei.extendSubschemaMode=function(t,{jtdDiscriminator:e,jtdMetadata:i,compositeRule:r,createErrors:n,allErrors:s}){void 0!==r&&(t.compositeRule=r),void 0!==n&&(t.createErrors=n),void 0!==s&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=i},ei}var ri,ni,si={};function oi(){return ni||(ni=1,ri=function t(e,i){if(e===i)return!0;if(e&&i&&"object"==typeof e&&"object"==typeof i){if(e.constructor!==i.constructor)return!1;var r,n,s;if(Array.isArray(e)){if((r=e.length)!=i.length)return!1;for(n=r;0!=n--;)if(!t(e[n],i[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===i.source&&e.flags===i.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===i.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===i.toString();if((r=(s=Object.keys(e)).length)!==Object.keys(i).length)return!1;for(n=r;0!=n--;)if(!Object.prototype.hasOwnProperty.call(i,s[n]))return!1;for(n=r;0!=n--;){var o=s[n];if(!t(e[o],i[o]))return!1}return!0}return e!=e&&i!=i}),ri}var ai,ui,hi,ci={exports:{}};function fi(){if(ai)return ci.exports;ai=1;var t=ci.exports=function(t,i,r){"function"==typeof i&&(r=i,i={}),e(i,"function"==typeof(r=i.cb||r)?r:r.pre||function(){},r.post||function(){},t,"",t)};function e(i,r,n,s,o,a,u,h,c,f){if(s&&"object"==typeof s&&!Array.isArray(s)){for(var l in r(s,o,a,u,h,c,f),s){var d=s[l];if(Array.isArray(d)){if(l in t.arrayKeywords)for(var p=0;p<d.length;p++)e(i,r,n,d[p],o+"/"+l+"/"+p,a,o,l,s,p)}else if(l in t.propsKeywords){if(d&&"object"==typeof d)for(var m in d)e(i,r,n,d[m],o+"/"+l+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),a,o,l,s,m)}else(l in t.keywords||i.allKeys&&!(l in t.skipKeywords))&&e(i,r,n,d,o+"/"+l,a,o,l,s)}n(s,o,a,u,h,c,f)}}return t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.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},ci.exports}function li(){if(ui)return si;ui=1,Object.defineProperty(si,"__esModule",{value:!0}),si.getSchemaRefs=si.resolveUrl=si.normalizeId=si._getFullPath=si.getFullPath=si.inlineRef=void 0;const t=je(),e=oi(),i=fi(),r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);si.inlineRef=function(t,e=!0){return"boolean"==typeof t||(!0===e?!s(t):!!e&&o(t)<=e)};const n=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function s(t){for(const e in t){if(n.has(e))return!0;const i=t[e];if(Array.isArray(i)&&i.some(s))return!0;if("object"==typeof i&&s(i))return!0}return!1}function o(e){let i=0;for(const n in e){if("$ref"===n)return 1/0;if(i++,!r.has(n)&&("object"==typeof e[n]&&(0,t.eachItem)(e[n],(t=>i+=o(t))),i===1/0))return 1/0}return i}function a(t,e="",i){!1!==i&&(e=c(e));const r=t.parse(e);return u(t,r)}function u(t,e){return t.serialize(e).split("#")[0]+"#"}si.getFullPath=a,si._getFullPath=u;const h=/#\/?$/;function c(t){return t?t.replace(h,""):""}si.normalizeId=c,si.resolveUrl=function(t,e,i){return i=c(i),t.resolve(e,i)};const f=/^[a-z_][-a-z0-9._]*$/i;return si.getSchemaRefs=function(t,r){if("boolean"==typeof t)return{};const{schemaId:n,uriResolver:s}=this.opts,o=c(t[n]||r),u={"":o},h=a(s,o,!1),l={},d=new Set;return i(t,{allKeys:!0},((t,e,i,r)=>{if(void 0===r)return;const s=h+e;let o=u[r];function a(e){if(e=c(o?(0,this.opts.uriResolver.resolve)(o,e):e),d.has(e))throw m(e);d.add(e);let i=this.refs[e];return"string"==typeof i&&(i=this.refs[i]),"object"==typeof i?p(t,i.schema,e):e!==c(s)&&("#"===e[0]?(p(t,l[e],e),l[e]=t):this.refs[e]=s),e}function v(t){if("string"==typeof t){if(!f.test(t))throw new Error(`invalid anchor "${t}"`);a.call(this,`#${t}`)}}"string"==typeof t[n]&&(o=a.call(this,t[n])),v.call(this,t.$anchor),v.call(this,t.$dynamicAnchor),u[e]=o})),l;function p(t,i,r){if(void 0!==i&&!e(t,i))throw m(r)}function m(t){return new Error(`reference "${t}" resolves to more than one schema`)}},si}function di(){if(hi)return me;hi=1,Object.defineProperty(me,"__esModule",{value:!0}),me.getData=me.KeywordCxt=me.validateFunctionCode=void 0;const t=Me(),e=Ve(),i=Be(),r=Ve(),n=Ke(),s=Qe(),o=ii(),a=Oe(),u=Ae(),h=li(),c=je(),f=Ne();function l({gen:t,validateName:e,schema:i,schemaEnv:r,opts:n},s){n.code.es5?t.func(e,a._`${u.default.data}, ${u.default.valCxt}`,r.$async,(()=>{t.code(a._`"use strict"; ${d(i,n)}`),function(t,e){t.if(u.default.valCxt,(()=>{t.var(u.default.instancePath,a._`${u.default.valCxt}.${u.default.instancePath}`),t.var(u.default.parentData,a._`${u.default.valCxt}.${u.default.parentData}`),t.var(u.default.parentDataProperty,a._`${u.default.valCxt}.${u.default.parentDataProperty}`),t.var(u.default.rootData,a._`${u.default.valCxt}.${u.default.rootData}`),e.dynamicRef&&t.var(u.default.dynamicAnchors,a._`${u.default.valCxt}.${u.default.dynamicAnchors}`)}),(()=>{t.var(u.default.instancePath,a._`""`),t.var(u.default.parentData,a._`undefined`),t.var(u.default.parentDataProperty,a._`undefined`),t.var(u.default.rootData,u.default.data),e.dynamicRef&&t.var(u.default.dynamicAnchors,a._`{}`)}))}(t,n),t.code(s)})):t.func(e,a._`${u.default.data}, ${function(t){return a._`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${t.dynamicRef?a._`, ${u.default.dynamicAnchors}={}`:a.nil}}={}`}(n)}`,r.$async,(()=>t.code(d(i,n)).code(s)))}function d(t,e){const i="object"==typeof t&&t[e.schemaId];return i&&(e.code.source||e.code.process)?a._`/*# sourceURL=${i} */`:a.nil}function p({schema:t,self:e}){if("boolean"==typeof t)return!t;for(const i in t)if(e.RULES.all[i])return!0;return!1}function m(t){return"boolean"!=typeof t.schema}function v(t){(0,c.checkUnknownRules)(t),function(t){const{schema:e,errSchemaPath:i,opts:r,self:n}=t;e.$ref&&r.ignoreKeywordsWithRef&&(0,c.schemaHasRulesButRef)(e,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path "${i}"`)}(t)}function y(t,i){if(t.opts.jtd)return $(t,[],!1,i);const r=(0,e.getSchemaTypes)(t.schema);$(t,r,!(0,e.coerceAndCheckDataType)(t,r),i)}function g({gen:t,schemaEnv:e,schema:i,errSchemaPath:r,opts:n}){const s=i.$comment;if(!0===n.$comment)t.code(a._`${u.default.self}.logger.log(${s})`);else if("function"==typeof n.$comment){const i=a.str`${r}/$comment`,n=t.scopeValue("root",{ref:e.root});t.code(a._`${u.default.self}.opts.$comment(${s}, ${i}, ${n}.schema)`)}}function $(t,e,n,s){const{gen:o,schema:h,data:f,allErrors:l,opts:d,self:p}=t,{RULES:m}=p;function v(c){(0,i.shouldUseGroup)(h,c)&&(c.type?(o.if((0,r.checkDataType)(c.type,f,d.strictNumbers)),w(t,c),1===e.length&&e[0]===c.type&&n&&(o.else(),(0,r.reportTypeError)(t)),o.endIf()):w(t,c),l||o.if(a._`${u.default.errors} === ${s||0}`))}!h.$ref||!d.ignoreKeywordsWithRef&&(0,c.schemaHasRulesButRef)(h,m)?(d.jtd||function(t,e){!t.schemaEnv.meta&&t.opts.strictTypes&&(function(t,e){e.length&&(t.dataTypes.length?(e.forEach((e=>{b(t.dataTypes,e)||_(t,`type "${e}" not allowed by context "${t.dataTypes.join(",")}"`)})),function(t,e){const i=[];for(const r of t.dataTypes)b(e,r)?i.push(r):e.includes("integer")&&"number"===r&&i.push("integer");t.dataTypes=i}(t,e)):t.dataTypes=e)}(t,e),t.opts.allowUnionTypes||function(t,e){e.length>1&&(2!==e.length||!e.includes("null"))&&_(t,"use allowUnionTypes to allow union type keyword")}(t,e),function(t,e){const r=t.self.RULES.all;for(const n in r){const s=r[n];if("object"==typeof s&&(0,i.shouldUseRule)(t.schema,s)){const{type:i}=s.definition;i.length&&!i.some((t=>{return(i=e).includes(r=t)||"number"===r&&i.includes("integer");var i,r}))&&_(t,`missing type "${i.join(",")}" for keyword "${n}"`)}}}(t,t.dataTypes))}(t,e),o.block((()=>{for(const t of m.rules)v(t);v(m.post)}))):o.block((()=>k(t,"$ref",m.all.$ref.definition)))}function w(t,e){const{gen:r,schema:s,opts:{useDefaults:o}}=t;o&&(0,n.assignDefaults)(t,e.type),r.block((()=>{for(const r of e.rules)(0,i.shouldUseRule)(s,r)&&k(t,r.keyword,r.definition,e.type)}))}function b(t,e){return t.includes(e)||"integer"===e&&t.includes("number")}function _(t,e){(0,c.checkStrictMode)(t,e+=` at "${t.schemaEnv.baseId+t.errSchemaPath}" (strictTypes)`,t.opts.strictTypes)}me.validateFunctionCode=function(e){m(e)&&(v(e),p(e))?function(t){const{schema:e,opts:i,gen:r}=t;l(t,(()=>{i.$comment&&e.$comment&&g(t),function(t){const{schema:e,opts:i}=t;void 0!==e.default&&i.useDefaults&&i.strictSchema&&(0,c.checkStrictMode)(t,"default is ignored in the schema root")}(t),r.let(u.default.vErrors,null),r.let(u.default.errors,0),i.unevaluated&&function(t){const{gen:e,validateName:i}=t;t.evaluated=e.const("evaluated",a._`${i}.evaluated`),e.if(a._`${t.evaluated}.dynamicProps`,(()=>e.assign(a._`${t.evaluated}.props`,a._`undefined`))),e.if(a._`${t.evaluated}.dynamicItems`,(()=>e.assign(a._`${t.evaluated}.items`,a._`undefined`)))}(t),y(t),function(t){const{gen:e,schemaEnv:i,validateName:r,ValidationError:n,opts:s}=t;i.$async?e.if(a._`${u.default.errors} === 0`,(()=>e.return(u.default.data)),(()=>e.throw(a._`new ${n}(${u.default.vErrors})`))):(e.assign(a._`${r}.errors`,u.default.vErrors),s.unevaluated&&function({gen:t,evaluated:e,props:i,items:r}){i instanceof a.Name&&t.assign(a._`${e}.props`,i),r instanceof a.Name&&t.assign(a._`${e}.items`,r)}(t),e.return(a._`${u.default.errors} === 0`))}(t)}))}(e):l(e,(()=>(0,t.topBoolOrEmptySchema)(e)))};class E{constructor(t,e,i){if((0,s.validateKeywordUsage)(t,e,i),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=i,this.data=t.data,this.schema=t.schema[i],this.$data=e.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,c.schemaRefOrVal)(t,this.schema,i,this.$data),this.schemaType=e.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=e,this.$data)this.schemaCode=t.gen.const("vSchema",x(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,e.schemaType,e.allowUndefined))throw new Error(`${i} value must be ${JSON.stringify(e.schemaType)}`);("code"in e?e.trackErrors:!1!==e.errors)&&(this.errsCount=t.gen.const("_errs",u.default.errors))}result(t,e,i){this.failResult((0,a.not)(t),e,i)}failResult(t,e,i){this.gen.if(t),i?i():this.error(),e?(this.gen.else(),e(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,e){this.failResult((0,a.not)(t),void 0,e)}fail(t){if(void 0===t)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:e}=this;this.fail(a._`${e} !== undefined && (${(0,a.or)(this.invalid$data(),t)})`)}error(t,e,i){if(e)return this.setParams(e),this._error(t,i),void this.setParams({});this._error(t,i)}_error(t,e){(t?f.reportExtraError:f.reportError)(this,this.def.error,e)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,e){e?Object.assign(this.params,t):this.params=t}block$data(t,e,i=a.nil){this.gen.block((()=>{this.check$data(t,i),e()}))}check$data(t=a.nil,e=a.nil){if(!this.$data)return;const{gen:i,schemaCode:r,schemaType:n,def:s}=this;i.if((0,a.or)(a._`${r} === undefined`,e)),t!==a.nil&&i.assign(t,!0),(n.length||s.validateSchema)&&(i.elseIf(this.invalid$data()),this.$dataError(),t!==a.nil&&i.assign(t,!1)),i.else()}invalid$data(){const{gen:t,schemaCode:e,schemaType:i,def:n,it:s}=this;return(0,a.or)(function(){if(i.length){if(!(e instanceof a.Name))throw new Error("ajv implementation error");const t=Array.isArray(i)?i:[i];return a._`${(0,r.checkDataTypes)(t,e,s.opts.strictNumbers,r.DataType.Wrong)}`}return a.nil}(),function(){if(n.validateSchema){const i=t.scopeValue("validate$data",{ref:n.validateSchema});return a._`!${i}(${e})`}return a.nil}())}subschema(e,i){const r=(0,o.getSubschema)(this.it,e);(0,o.extendSubschemaData)(r,this.it,e),(0,o.extendSubschemaMode)(r,e);const n={...this.it,...r,items:void 0,props:void 0};return function(e,i){m(e)&&(v(e),p(e))?function(t,e){const{schema:i,gen:r,opts:n}=t;n.$comment&&i.$comment&&g(t),function(t){const e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,h.resolveUrl)(t.opts.uriResolver,t.baseId,e))}(t),function(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}(t);const s=r.const("_errs",u.default.errors);y(t,s),r.var(e,a._`${s} === ${u.default.errors}`)}(e,i):(0,t.boolOrEmptySchema)(e,i)}(n,i),n}mergeEvaluated(t,e){const{it:i,gen:r}=this;i.opts.unevaluated&&(!0!==i.props&&void 0!==t.props&&(i.props=c.mergeEvaluated.props(r,t.props,i.props,e)),!0!==i.items&&void 0!==t.items&&(i.items=c.mergeEvaluated.items(r,t.items,i.items,e)))}mergeValidEvaluated(t,e){const{it:i,gen:r}=this;if(i.opts.unevaluated&&(!0!==i.props||!0!==i.items))return r.if(e,(()=>this.mergeEvaluated(t,a.Name))),!0}}function k(t,e,i,r){const n=new E(t,i,e);"code"in i?i.code(n,r):n.$data&&i.validate?(0,s.funcKeywordCode)(n,i):"macro"in i?(0,s.macroKeywordCode)(n,i):(i.compile||i.validate)&&(0,s.funcKeywordCode)(n,i)}me.KeywordCxt=E;const O=/^\/(?:[^~]|~0|~1)*$/,S=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function x(t,{dataLevel:e,dataNames:i,dataPathArr:r}){let n,s;if(""===t)return u.default.rootData;if("/"===t[0]){if(!O.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);n=t,s=u.default.rootData}else{const o=S.exec(t);if(!o)throw new Error(`Invalid JSON-pointer: ${t}`);const a=+o[1];if(n=o[2],"#"===n){if(a>=e)throw new Error(f("property/index",a));return r[e-a]}if(a>e)throw new Error(f("data",a));if(s=i[e-a],!n)return s}let o=s;const h=n.split("/");for(const t of h)t&&(s=a._`${s}${(0,a.getProperty)((0,c.unescapeJsonPointer)(t))}`,o=a._`${o} && ${s}`);return o;function f(t,i){return`Cannot access ${t} ${i} levels up, current level is ${e}`}}return me.getData=x,me}var pi,mi={};function vi(){if(pi)return mi;pi=1,Object.defineProperty(mi,"__esModule",{value:!0});class t extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}return mi.default=t,mi}var yi,gi={};function $i(){if(yi)return gi;yi=1,Object.defineProperty(gi,"__esModule",{value:!0});const t=li();class e extends Error{constructor(e,i,r,n){super(n||`can't resolve reference ${r} from id ${i}`),this.missingRef=(0,t.resolveUrl)(e,i,r),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(e,this.missingRef))}}return gi.default=e,gi}var wi,bi={};function _i(){if(wi)return bi;wi=1,Object.defineProperty(bi,"__esModule",{value:!0}),bi.resolveSchema=bi.getCompilingSchema=bi.resolveRef=bi.compileSchema=bi.SchemaEnv=void 0;const t=Oe(),e=vi(),i=Ae(),r=li(),n=je(),s=di();class o{constructor(t){var e;let i;this.refs={},this.dynamicAnchors={},"object"==typeof t.schema&&(i=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=null!==(e=t.baseId)&&void 0!==e?e:(0,r.normalizeId)(null==i?void 0:i[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=null==i?void 0:i.$async,this.refs={}}}function a(n){const o=h.call(this,n);if(o)return o;const a=(0,r.getFullPath)(this.opts.uriResolver,n.root.baseId),{es5:u,lines:c}=this.opts.code,{ownProperties:f}=this.opts,l=new t.CodeGen(this.scope,{es5:u,lines:c,ownProperties:f});let d;n.$async&&(d=l.scopeValue("Error",{ref:e.default,code:t._`require("ajv/dist/runtime/validation_error").default`}));const p=l.scopeName("validate");n.validateName=p;const m={gen:l,allErrors:this.opts.allErrors,data:i.default.data,parentData:i.default.parentData,parentDataProperty:i.default.parentDataProperty,dataNames:[i.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:l.scopeValue("schema",!0===this.opts.code.source?{ref:n.schema,code:(0,t.stringify)(n.schema)}:{ref:n.schema}),validateName:p,ValidationError:d,schema:n.schema,schemaEnv:n,rootId:a,baseId:n.baseId||a,schemaPath:t.nil,errSchemaPath:n.schemaPath||(this.opts.jtd?"":"#"),errorPath:t._`""`,opts:this.opts,self:this};let v;try{this._compilations.add(n),(0,s.validateFunctionCode)(m),l.optimize(this.opts.code.optimize);const e=l.toString();v=`${l.scopeRefs(i.default.scope)}return ${e}`,this.opts.code.process&&(v=this.opts.code.process(v,n));const r=new Function(`${i.default.self}`,`${i.default.scope}`,v)(this,this.scope.get());if(this.scope.value(p,{ref:r}),r.errors=null,r.schema=n.schema,r.schemaEnv=n,n.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:p,validateCode:e,scopeValues:l._values}),this.opts.unevaluated){const{props:e,items:i}=m;r.evaluated={props:e instanceof t.Name?void 0:e,items:i instanceof t.Name?void 0:i,dynamicProps:e instanceof t.Name,dynamicItems:i instanceof t.Name},r.source&&(r.source.evaluated=(0,t.stringify)(r.evaluated))}return n.validate=r,n}catch(t){throw delete n.validate,delete n.validateName,v&&this.logger.error("Error compiling schema, function code:",v),t}finally{this._compilations.delete(n)}}function u(t){return(0,r.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:a.call(this,t)}function h(t){for(const r of this._compilations)if((e=r).schema===(i=t).schema&&e.root===i.root&&e.baseId===i.baseId)return r;var e,i}function c(t,e){let i;for(;"string"==typeof(i=this.refs[e]);)e=i;return i||this.schemas[e]||f.call(this,t,e)}function f(t,e){const i=this.opts.uriResolver.parse(e),n=(0,r._getFullPath)(this.opts.uriResolver,i);let s=(0,r.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===s)return d.call(this,i,t);const u=(0,r.normalizeId)(n),h=this.refs[u]||this.schemas[u];if("string"==typeof h){const e=f.call(this,t,h);if("object"!=typeof(null==e?void 0:e.schema))return;return d.call(this,i,e)}if("object"==typeof(null==h?void 0:h.schema)){if(h.validate||a.call(this,h),u===(0,r.normalizeId)(e)){const{schema:e}=h,{schemaId:i}=this.opts,n=e[i];return n&&(s=(0,r.resolveUrl)(this.opts.uriResolver,s,n)),new o({schema:e,schemaId:i,root:t,baseId:s})}return d.call(this,i,h)}}bi.SchemaEnv=o,bi.compileSchema=a,bi.resolveRef=function(t,e,i){var n;i=(0,r.resolveUrl)(this.opts.uriResolver,e,i);const s=t.refs[i];if(s)return s;let a=c.call(this,t,i);if(void 0===a){const r=null===(n=t.localRefs)||void 0===n?void 0:n[i],{schemaId:s}=this.opts;r&&(a=new o({schema:r,schemaId:s,root:t,baseId:e}))}return void 0!==a?t.refs[i]=u.call(this,a):void 0},bi.getCompilingSchema=h,bi.resolveSchema=f;const l=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function d(t,{baseId:e,schema:i,root:s}){var a;if("/"!==(null===(a=t.fragment)||void 0===a?void 0:a[0]))return;for(const s of t.fragment.slice(1).split("/")){if("boolean"==typeof i)return;const t=i[(0,n.unescapeFragment)(s)];if(void 0===t)return;const o="object"==typeof(i=t)&&i[this.opts.schemaId];!l.has(s)&&o&&(e=(0,r.resolveUrl)(this.opts.uriResolver,e,o))}let u;if("boolean"!=typeof i&&i.$ref&&!(0,n.schemaHasRulesButRef)(i,this.RULES)){const t=(0,r.resolveUrl)(this.opts.uriResolver,e,i.$ref);u=f.call(this,s,t)}const{schemaId:h}=this.opts;return u=u||new o({schema:i,schemaId:h,root:s,baseId:e}),u.schema!==u.root.schema?u:void 0}return bi}var Ei,ki,Oi,Si,xi,ji,Ii,Pi={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1},Ci={},Ti={exports:{}};function Ai(){if(ki)return Ei;ki=1;const t=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),e=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),i=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),r=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),n=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function s(t){let e="",i=0,r=0;for(r=0;r<t.length;r++)if(i=t[r].charCodeAt(0),48!==i){if(!(i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102))return"";e+=t[r];break}for(r+=1;r<t.length;r++){if(i=t[r].charCodeAt(0),!(i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102))return"";e+=t[r]}return e}const o=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function a(t){return t.length=0,!0}function u(t,e,i){if(t.length){const r=s(t);if(""===r)return i.error=!0,!1;e.push(r),t.length=0}return!0}function h(t){if(function(t){let e=0;for(let i=0;i<t.length;i++)":"===t[i]&&e++;return e}(t)<2)return{host:t,isIPV6:!1};const e=function(t){let e=0;const i={error:!1,address:"",zone:""},r=[],n=[];let o=!1,h=!1,c=u;for(let s=0;s<t.length;s++){const u=t[s];if("["!==u&&"]"!==u)if(":"!==u)if("%"===u){if(!c(n,r,i))break;c=a}else n.push(u);else{if(!0===o&&(h=!0),!c(n,r,i))break;if(++e>7){i.error=!0;break}s>0&&":"===t[s-1]&&(o=!0),r.push(":")}}return n.length&&(c===a?i.zone=n.join(""):r.push(h?n.join(""):s(n))),i.address=r.join(""),i}(t);if(e.error)return{host:t,isIPV6:!1};{let t=e.address,i=e.address;return e.zone&&(t+="%"+e.zone,i+="%25"+e.zone),{host:t,isIPV6:!0,escapedHost:i}}}const c={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},f=/[@/?#:]/g,l=/[@/?#]/g;function d(t,e){const i=e?l:f;return i.lastIndex=0,t.replace(i,(t=>c[t]))}return Ei={nonSimpleDomain:o,recomposeAuthority:function(t){const i=[];if(void 0!==t.userinfo&&(i.push(t.userinfo),i.push("@")),void 0!==t.host){let r=unescape(t.host);if(!e(r)){const t=h(r);r=!0===t.isIPV6?`[${t.escapedHost}]`:d(r,!1)}i.push(r)}return"number"!=typeof t.port&&"string"!=typeof t.port||(i.push(":"),i.push(String(t.port))),i.length?i.join(""):void 0},reescapeHostDelimiters:d,normalizePercentEncoding:function(t,e=!1){if(-1===t.indexOf("%"))return t;let n="";for(let s=0;s<t.length;s++){if("%"===t[s]&&s+2<t.length){const o=t.slice(s+1,s+3);if(i(o)){const t=o.toUpperCase(),i=String.fromCharCode(parseInt(t,16));e&&r(i)?n+=i:n+="%"+t,s+=2;continue}}n+=t[s]}return n},normalizePathEncoding:function(t){let e="";for(let s=0;s<t.length;s++){if("%"===t[s]&&s+2<t.length){const n=t.slice(s+1,s+3);if(i(n)){const t=n.toUpperCase(),i=String.fromCharCode(parseInt(t,16));"."!==i&&r(i)?e+=i:e+="%"+t,s+=2;continue}}n(t[s])?e+=t[s]:e+=escape(t[s])}return e},escapePreservingEscapes:function(t){let e="";for(let r=0;r<t.length;r++){if("%"===t[r]&&r+2<t.length){const n=t.slice(r+1,r+3);if(i(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e},removeDotSegments:function(t){let e=t;const i=[];let r=-1,n=0;for(;n=e.length;){if(1===n){if("."===e)break;if("/"===e){i.push("/");break}i.push(e);break}if(2===n){if("."===e[0]){if("."===e[1])break;if("/"===e[1]){e=e.slice(2);continue}}else if("/"===e[0]&&("."===e[1]||"/"===e[1])){i.push("/");break}}else if(3===n&&"/.."===e){0!==i.length&&i.pop(),i.push("/");break}if("."===e[0]){if("."===e[1]){if("/"===e[2]){e=e.slice(3);continue}}else if("/"===e[1]){e=e.slice(2);continue}}else if("/"===e[0]&&"."===e[1]){if("/"===e[2]){e=e.slice(2);continue}if("."===e[2]&&"/"===e[3]){e=e.slice(3),0!==i.length&&i.pop();continue}}if(-1===(r=e.indexOf("/",1))){i.push(e);break}i.push(e.slice(0,r)),e=e.slice(r)}return i.join("")},isIPv4:e,isUUID:t,normalizeIPv6:h,stringArrayToHexStripped:s},Ei}function Ni(){if(ji)return Ci;ji=1,Object.defineProperty(Ci,"__esModule",{value:!0});const t=function(){if(xi)return Ti.exports;xi=1;const{normalizeIPv6:t,removeDotSegments:e,recomposeAuthority:i,normalizePercentEncoding:r,normalizePathEncoding:n,escapePreservingEscapes:s,reescapeHostDelimiters:o,isIPv4:a,nonSimpleDomain:u}=Ai(),{SCHEMES:h,getSchemeHandler:c}=function(){if(Si)return Oi;Si=1;const{isUUID:t}=Ai(),e=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,i=["http","https","ws","wss","urn","urn:uuid"];function r(t){return!0===t.secure||!1!==t.secure&&!!t.scheme&&!(3!==t.scheme.length||"w"!==t.scheme[0]&&"W"!==t.scheme[0]||"s"!==t.scheme[1]&&"S"!==t.scheme[1]||"s"!==t.scheme[2]&&"S"!==t.scheme[2])}function n(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function s(t){const e="https"===String(t.scheme).toLowerCase();return t.port!==(e?443:80)&&""!==t.port||(t.port=void 0),t.path||(t.path="/"),t}const o={scheme:"http",domainHost:!0,parse:n,serialize:s},a={scheme:"ws",domainHost:!0,parse:function(t){return t.secure=r(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(t){if(t.port!==(r(t)?443:80)&&""!==t.port||(t.port=void 0),"boolean"==typeof t.secure&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){const[e,i]=t.resourceName.split("?");t.path=e&&"/"!==e?e:void 0,t.query=i,t.resourceName=void 0}return t.fragment=void 0,t}},u={scheme:"urn",parse:function(t,i){if(!t.path)return t.error="URN can not be parsed",t;const r=t.path.match(e);if(r){const e=i.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];const n=c(`${e}:${i.nid||t.nid}`);t.path=void 0,n&&(t=n.parse(t,i))}else t.error=t.error||"URN can not be parsed.";return t},serialize:function(t,e){if(void 0===t.nid)throw new Error("URN without nid cannot be serialized");const i=e.scheme||t.scheme||"urn",r=t.nid.toLowerCase(),n=c(`${i}:${e.nid||r}`);n&&(t=n.serialize(t,e));const s=t;return s.path=`${r||e.nid}:${t.nss}`,e.skipEscape=!0,s},skipNormalize:!0},h={http:o,https:{scheme:"https",domainHost:o.domainHost,parse:n,serialize:s},ws:a,wss:{scheme:"wss",domainHost:a.domainHost,parse:a.parse,serialize:a.serialize},urn:u,"urn:uuid":{scheme:"urn:uuid",parse:function(e,i){const r=e;return r.uuid=r.nss,r.nss=void 0,i.tolerant||r.uuid&&t(r.uuid)||(r.error=r.error||"UUID is not valid."),r},serialize:function(t){const e=t;return e.nss=(t.uuid||"").toLowerCase(),e},skipNormalize:!0}};function c(t){return t&&(h[t]||h[t.toLowerCase()])||void 0}return Object.setPrototypeOf(h,null),Oi={wsIsSecure:r,SCHEMES:h,isValidSchemeName:function(t){return-1!==i.indexOf(t)},getSchemeHandler:c}}();function f(t,i,r,n){const s={};return n||(t=v(l(t,r),r),i=v(l(i,r),r)),!(r=r||{}).tolerant&&i.scheme?(s.scheme=i.scheme,s.userinfo=i.userinfo,s.host=i.host,s.port=i.port,s.path=e(i.path||""),s.query=i.query):(void 0!==i.userinfo||void 0!==i.host||void 0!==i.port?(s.userinfo=i.userinfo,s.host=i.host,s.port=i.port,s.path=e(i.path||""),s.query=i.query):(i.path?("/"===i.path[0]?s.path=e(i.path):(s.path=void 0===t.userinfo&&void 0===t.host&&void 0===t.port||t.path?t.path?t.path.slice(0,t.path.lastIndexOf("/")+1)+i.path:i.path:"/"+i.path,s.path=e(s.path)),s.query=i.query):(s.path=t.path,s.query=void 0!==i.query?i.query:t.query),s.userinfo=t.userinfo,s.host=t.host,s.port=t.port),s.scheme=t.scheme),s.fragment=i.fragment,s}function l(t,n){const o={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},a=Object.assign({},n),u=[],h=c(a.scheme||o.scheme);h&&h.serialize&&h.serialize(o,a),void 0!==o.path&&(a.skipEscape?o.path=r(o.path):(o.path=s(o.path),void 0!==o.scheme&&(o.path=o.path.split("%3A").join(":")))),"suffix"!==a.reference&&o.scheme&&u.push(o.scheme,":");const f=i(o);if(void 0!==f&&("suffix"!==a.reference&&u.push("//"),u.push(f),o.path&&"/"!==o.path[0]&&u.push("/")),void 0!==o.path){let t=o.path;a.absolutePath||h&&h.absolutePath||(t=e(t)),void 0===f&&"/"===t[0]&&"/"===t[1]&&(t="/%2F"+t.slice(2)),u.push(t)}return void 0!==o.query&&u.push("?",o.query),void 0!==o.fragment&&u.push("#",o.fragment),u.join("")}const d=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,p=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/;function m(e,i){const r=Object.assign({},i),s={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let h=!1,f=!1;"suffix"===r.reference&&(e=r.scheme?r.scheme+":"+e:"//"+e);const l=e.match(p);null!==l&&-1!==l[1].indexOf("\\")&&(s.error="URI authority must not contain a literal backslash.",h=!0);const m=e.match(d);if(m){s.scheme=m[1],s.userinfo=m[3],s.host=m[4],s.port=parseInt(m[5],10),s.path=m[6]||"",s.query=m[7],s.fragment=m[8],isNaN(s.port)&&(s.port=m[5]);const i=function(t,e){return void 0!==e[2]&&t.path&&"/"!==t.path[0]?'URI path must start with "/" when authority is present.':"number"==typeof t.port&&(t.port<0||t.port>65535)?"URI port is malformed.":void 0}(s,m);if(void 0!==i&&(s.error=s.error||i,h=!0),s.host)if(!1===a(s.host)){const e=t(s.host);s.host=e.host.toLowerCase(),f=e.isIPV6}else f=!0;s.reference=void 0!==s.scheme||void 0!==s.userinfo||void 0!==s.host||void 0!==s.port||void 0!==s.query||s.path?void 0===s.scheme?"relative":void 0===s.fragment?"absolute":"uri":"same-document",r.reference&&"suffix"!==r.reference&&r.reference!==s.reference&&(s.error=s.error||"URI is not a "+r.reference+" reference.");const l=c(r.scheme||s.scheme);if(!(r.unicodeSupport||l&&l.unicodeSupport)&&s.host&&(r.domainHost||l&&l.domainHost)&&!1===f&&u(s.host))try{s.host=new URL("http://"+s.host).hostname}catch(t){s.error=s.error||"Host's domain name can not be converted to ASCII: "+t}if((!l||l&&!l.skipNormalize)&&(-1!==e.indexOf("%")&&(void 0!==s.scheme&&(s.scheme=unescape(s.scheme)),void 0!==s.host&&(s.host=o(unescape(s.host),f))),s.path&&(s.path=n(s.path)),s.fragment))try{s.fragment=encodeURI(decodeURIComponent(s.fragment))}catch{s.error=s.error||"URI malformed"}l&&l.parse&&l.parse(s,r)}else s.error=s.error||"URI can not be parsed.";return{parsed:s,malformedAuthorityOrPort:h}}function v(t,e){return m(t,e).parsed}function y(t,e){const{parsed:i,malformedAuthorityOrPort:r}=m(t,e);return{normalized:r?t:l(i,e),malformedAuthorityOrPort:r}}function g(t,e){if("string"==typeof t){const{normalized:i,malformedAuthorityOrPort:r}=y(t,e);return r?void 0:i}if("object"==typeof t)return l(t,e)}const $={SCHEMES:h,normalize:function(t,e){return"string"==typeof t?t=function(t,e){return y(t,e).normalized}(t,e):"object"==typeof t&&(t=v(l(t,e),e)),t},resolve:function(t,e,i){const r=i?Object.assign({scheme:"null"},i):{scheme:"null"},n=f(v(t,r),v(e,r),r,!0);return r.skipEscape=!0,l(n,r)},resolveComponent:f,equal:function(t,e,i){const r=g(t,i),n=g(e,i);return void 0!==r&&void 0!==n&&r.toLowerCase()===n.toLowerCase()},serialize:l,parse:v};return Ti.exports=$,Ti.exports.default=$,Ti.exports.fastUri=$,Ti.exports}();return t.code='require("ajv/dist/runtime/uri").default',Ci.default=t,Ci}function Mi(){return Ii||(Ii=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=di();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return e.KeywordCxt}});var i=Oe();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return i.CodeGen}});const r=vi(),n=$i(),s=Le(),o=_i(),a=Oe(),u=li(),h=Ve(),c=je(),f=Pi,l=Ni(),d=(t,e)=>new RegExp(t,e);d.code="new RegExp";const p=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={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."},y={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function g(t){var e,i,r,n,s,o,a,u,h,c,f,p,m,v,y,g,$,w,b,_,E,k,O,S,x;const j=t.strict,I=null===(e=t.code)||void 0===e?void 0:e.optimize,P=!0===I||void 0===I?1:I||0,C=null!==(r=null===(i=t.code)||void 0===i?void 0:i.regExp)&&void 0!==r?r:d,T=null!==(n=t.uriResolver)&&void 0!==n?n:l.default;return{strictSchema:null===(o=null!==(s=t.strictSchema)&&void 0!==s?s:j)||void 0===o||o,strictNumbers:null===(u=null!==(a=t.strictNumbers)&&void 0!==a?a:j)||void 0===u||u,strictTypes:null!==(c=null!==(h=t.strictTypes)&&void 0!==h?h:j)&&void 0!==c?c:"log",strictTuples:null!==(p=null!==(f=t.strictTuples)&&void 0!==f?f:j)&&void 0!==p?p:"log",strictRequired:null!==(v=null!==(m=t.strictRequired)&&void 0!==m?m:j)&&void 0!==v&&v,code:t.code?{...t.code,optimize:P,regExp:C}:{optimize:P,regExp:C},loopRequired:null!==(y=t.loopRequired)&&void 0!==y?y:200,loopEnum:null!==(g=t.loopEnum)&&void 0!==g?g:200,meta:null===($=t.meta)||void 0===$||$,messages:null===(w=t.messages)||void 0===w||w,inlineRefs:null===(b=t.inlineRefs)||void 0===b||b,schemaId:null!==(_=t.schemaId)&&void 0!==_?_:"$id",addUsedSchema:null===(E=t.addUsedSchema)||void 0===E||E,validateSchema:null===(k=t.validateSchema)||void 0===k||k,validateFormats:null===(O=t.validateFormats)||void 0===O||O,unicodeRegExp:null===(S=t.unicodeRegExp)||void 0===S||S,int32range:null===(x=t.int32range)||void 0===x||x,uriResolver:T}}class ${constructor(t={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...g(t)};const{es5:e,lines:i}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:m,es5:e,lines:i}),this.logger=function(t){if(!1===t)return S;if(void 0===t)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}(t.logger);const r=t.validateFormats;t.validateFormats=!1,this.RULES=(0,s.getRules)(),w.call(this,v,t,"NOT SUPPORTED"),w.call(this,y,t,"DEPRECATED","warn"),this._metaOpts=O.call(this),t.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&k.call(this,t.keywords),"object"==typeof t.meta&&this.addMetaSchema(t.meta),_.call(this),t.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:t,meta:e,schemaId:i}=this.opts;let r=f;"id"===i&&(r={...f},r.id=r.$id,delete r.$id),e&&t&&this.addMetaSchema(r,r[i],!1)}defaultMeta(){const{meta:t,schemaId:e}=this.opts;return this.opts.defaultMeta="object"==typeof t?t[e]||t:void 0}validate(t,e){let i;if("string"==typeof t){if(i=this.getSchema(t),!i)throw new Error(`no schema with key or ref "${t}"`)}else i=this.compile(t);const r=i(e);return"$async"in i||(this.errors=i.errors),r}compile(t,e){const i=this._addSchema(t,e);return i.validate||this._compileSchemaEnv(i)}compileAsync(t,e){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:i}=this.opts;return r.call(this,t,e);async function r(t,e){await s.call(this,t.$schema);const i=this._addSchema(t,e);return i.validate||o.call(this,i)}async function s(t){t&&!this.getSchema(t)&&await r.call(this,{$ref:t},!0)}async function o(t){try{return this._compileSchemaEnv(t)}catch(e){if(!(e instanceof n.default))throw e;return a.call(this,e),await u.call(this,e.missingSchema),o.call(this,t)}}function a({missingSchema:t,missingRef:e}){if(this.refs[t])throw new Error(`AnySchema ${t} is loaded but ${e} cannot be resolved`)}async function u(t){const i=await h.call(this,t);this.refs[t]||await s.call(this,i.$schema),this.refs[t]||this.addSchema(i,t,e)}async function h(t){const e=this._loading[t];if(e)return e;try{return await(this._loading[t]=i(t))}finally{delete this._loading[t]}}}addSchema(t,e,i,r=this.opts.validateSchema){if(Array.isArray(t)){for(const e of t)this.addSchema(e,void 0,i,r);return this}let n;if("object"==typeof t){const{schemaId:e}=this.opts;if(n=t[e],void 0!==n&&"string"!=typeof n)throw new Error(`schema ${e} must be string`)}return e=(0,u.normalizeId)(e||n),this._checkUnique(e),this.schemas[e]=this._addSchema(t,i,e,r,!0),this}addMetaSchema(t,e,i=this.opts.validateSchema){return this.addSchema(t,e,!0,i),this}validateSchema(t,e){if("boolean"==typeof t)return!0;let i;if(i=t.$schema,void 0!==i&&"string"!=typeof i)throw new Error("$schema must be a string");if(i=i||this.opts.defaultMeta||this.defaultMeta(),!i)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const r=this.validate(i,t);if(!r&&e){const t="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(t);this.logger.error(t)}return r}getSchema(t){let e;for(;"string"==typeof(e=b.call(this,t));)t=e;if(void 0===e){const{schemaId:i}=this.opts,r=new o.SchemaEnv({schema:{},schemaId:i});if(e=o.resolveSchema.call(this,r,t),!e)return;this.refs[t]=e}return e.validate||this._compileSchemaEnv(e)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const e=b.call(this,t);return"object"==typeof e&&this._cache.delete(e.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{this._cache.delete(t);let e=t[this.opts.schemaId];return e&&(e=(0,u.normalizeId)(e),delete this.schemas[e],delete this.refs[e]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(const e of t)this.addKeyword(e);return this}addKeyword(t,e){let i;if("string"==typeof t)i=t,"object"==typeof e&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),e.keyword=i);else{if("object"!=typeof t||void 0!==e)throw new Error("invalid addKeywords parameters");if(i=(e=t).keyword,Array.isArray(i)&&!i.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(j.call(this,i,e),!e)return(0,c.eachItem)(i,(t=>I.call(this,t))),this;C.call(this,e);const r={...e,type:(0,h.getJSONTypes)(e.type),schemaType:(0,h.getJSONTypes)(e.schemaType)};return(0,c.eachItem)(i,0===r.type.length?t=>I.call(this,t,r):t=>r.type.forEach((e=>I.call(this,t,r,e)))),this}getKeyword(t){const e=this.RULES.all[t];return"object"==typeof e?e.definition:!!e}removeKeyword(t){const{RULES:e}=this;delete e.keywords[t],delete e.all[t];for(const i of e.rules){const e=i.rules.findIndex((e=>e.keyword===t));e>=0&&i.rules.splice(e,1)}return this}addFormat(t,e){return"string"==typeof e&&(e=new RegExp(e)),this.formats[t]=e,this}errorsText(t=this.errors,{separator:e=", ",dataVar:i="data"}={}){return t&&0!==t.length?t.map((t=>`${i}${t.instancePath} ${t.message}`)).reduce(((t,i)=>t+e+i)):"No errors"}$dataMetaSchema(t,e){const i=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(const r of e){const e=r.split("/").slice(1);let n=t;for(const t of e)n=n[t];for(const t in i){const e=i[t];if("object"!=typeof e)continue;const{$data:r}=e.definition,s=n[t];r&&s&&(n[t]=A(s))}}return t}_removeAllSchemas(t,e){for(const i in t){const r=t[i];e&&!e.test(i)||("string"==typeof r?delete t[i]:r&&!r.meta&&(this._cache.delete(r.schema),delete t[i]))}}_addSchema(t,e,i,r=this.opts.validateSchema,n=this.opts.addUsedSchema){let s;const{schemaId:a}=this.opts;if("object"==typeof t)s=t[a];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof t)throw new Error("schema must be object or boolean")}let h=this._cache.get(t);if(void 0!==h)return h;i=(0,u.normalizeId)(s||i);const c=u.getSchemaRefs.call(this,t,i);return h=new o.SchemaEnv({schema:t,schemaId:a,meta:e,baseId:i,localRefs:c}),this._cache.set(h.schema,h),n&&!i.startsWith("#")&&(i&&this._checkUnique(i),this.refs[i]=h),r&&this.validateSchema(t,!0),h}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):o.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){const e=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,t)}finally{this.opts=e}}}function w(t,e,i,r="error"){for(const n in t)n in e&&this.logger[r](`${i}: option ${n}. ${t[n]}`)}function b(t){return t=(0,u.normalizeId)(t),this.schemas[t]||this.refs[t]}function _(){const t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(const e in t)this.addSchema(t[e],e)}function E(){for(const t in this.opts.formats){const e=this.opts.formats[t];e&&this.addFormat(t,e)}}function k(t){if(Array.isArray(t))this.addVocabulary(t);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const e in t){const i=t[e];i.keyword||(i.keyword=e),this.addKeyword(i)}}}function O(){const t={...this.opts};for(const e of p)delete t[e];return t}$.ValidationError=r.default,$.MissingRefError=n.default,t.default=$;const S={log(){},warn(){},error(){}},x=/^[a-z_$][a-z0-9_$:-]*$/i;function j(t,e){const{RULES:i}=this;if((0,c.eachItem)(t,(t=>{if(i.keywords[t])throw new Error(`Keyword ${t} is already defined`);if(!x.test(t))throw new Error(`Keyword ${t} has invalid name`)})),e&&e.$data&&!("code"in e)&&!("validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function I(t,e,i){var r;const n=null==e?void 0:e.post;if(i&&n)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:s}=this;let o=n?s.post:s.rules.find((({type:t})=>t===i));if(o||(o={type:i,rules:[]},s.rules.push(o)),s.keywords[t]=!0,!e)return;const a={keyword:t,definition:{...e,type:(0,h.getJSONTypes)(e.type),schemaType:(0,h.getJSONTypes)(e.schemaType)}};e.before?P.call(this,o,a,e.before):o.rules.push(a),s.all[t]=a,null===(r=e.implements)||void 0===r||r.forEach((t=>this.addKeyword(t)))}function P(t,e,i){const r=t.rules.findIndex((t=>t.keyword===i));r>=0?t.rules.splice(r,0,e):(t.rules.push(e),this.logger.warn(`rule ${i} is not defined`))}function C(t){let{metaSchema:e}=t;void 0!==e&&(t.$data&&this.opts.$data&&(e=A(e)),t.validateSchema=this.compile(e,!0))}const T={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function A(t){return{anyOf:[t,T]}}}(pe)),pe}var Ri,Di={},zi={},Li={};function Ui(){return Ri||(Ri=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.default={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}}),Li}var qi,Fi,Bi={};function Vi(){if(qi)return Bi;qi=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.callRef=Bi.getValidate=void 0;const t=$i(),e=Ye(),i=Oe(),r=Ae(),n=_i(),s=je(),o={keyword:"$ref",schemaType:"string",code(e){const{gen:r,schema:s,it:o}=e,{baseId:h,schemaEnv:c,validateName:f,opts:l,self:d}=o,{root:p}=c;if(("#"===s||"#/"===s)&&h===p.baseId)return function(){if(c===p)return u(e,f,c,c.$async);const t=r.scopeValue("root",{ref:p});return u(e,i._`${t}.validate`,p,p.$async)}();const m=n.resolveRef.call(d,p,h,s);if(void 0===m)throw new t.default(o.opts.uriResolver,h,s);return m instanceof n.SchemaEnv?function(t){const i=a(e,t);u(e,i,t,t.$async)}(m):function(t){const n=r.scopeValue("schema",!0===l.code.source?{ref:t,code:(0,i.stringify)(t)}:{ref:t}),o=r.name("valid"),a=e.subschema({schema:t,dataTypes:[],schemaPath:i.nil,topSchemaRef:n,errSchemaPath:s},o);e.mergeEvaluated(a),e.ok(o)}(m)}};function a(t,e){const{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):i._`${r.scopeValue("wrapper",{ref:e})}.validate`}function u(t,n,o,a){const{gen:u,it:h}=t,{allErrors:c,schemaEnv:f,opts:l}=h,d=l.passContext?r.default.this:i.nil;function p(t){const e=i._`${t}.errors`;u.assign(r.default.vErrors,i._`${r.default.vErrors} === null ? ${e} : ${r.default.vErrors}.concat(${e})`),u.assign(r.default.errors,i._`${r.default.vErrors}.length`)}function m(t){var e;if(!h.opts.unevaluated)return;const r=null===(e=null==o?void 0:o.validate)||void 0===e?void 0:e.evaluated;if(!0!==h.props)if(r&&!r.dynamicProps)void 0!==r.props&&(h.props=s.mergeEvaluated.props(u,r.props,h.props));else{const e=u.var("props",i._`${t}.evaluated.props`);h.props=s.mergeEvaluated.props(u,e,h.props,i.Name)}if(!0!==h.items)if(r&&!r.dynamicItems)void 0!==r.items&&(h.items=s.mergeEvaluated.items(u,r.items,h.items));else{const e=u.var("items",i._`${t}.evaluated.items`);h.items=s.mergeEvaluated.items(u,e,h.items,i.Name)}}a?function(){if(!f.$async)throw new Error("async schema referenced by sync schema");const r=u.let("valid");u.try((()=>{u.code(i._`await ${(0,e.callValidateCode)(t,n,d)}`),m(n),c||u.assign(r,!0)}),(t=>{u.if(i._`!(${t} instanceof ${h.ValidationError})`,(()=>u.throw(t))),p(t),c||u.assign(r,!1)})),t.ok(r)}():t.result((0,e.callValidateCode)(t,n,d),(()=>m(n)),(()=>p(n)))}return Bi.getValidate=a,Bi.callRef=u,Bi.default=o,Bi}function Gi(){return Fi||(Fi=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.default=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Ui().default,Vi().default]),zi}var Hi,Ki={},Wi={};function Ji(){if(Hi)return Wi;Hi=1,Object.defineProperty(Wi,"__esModule",{value:!0});const t=Oe(),e=t.operators,i={maximum:{okStr:"<=",ok:e.LTE,fail:e.GT},minimum:{okStr:">=",ok:e.GTE,fail:e.LT},exclusiveMaximum:{okStr:"<",ok:e.LT,fail:e.GTE},exclusiveMinimum:{okStr:">",ok:e.GT,fail:e.LTE}},r={message:({keyword:e,schemaCode:r})=>t.str`must be ${i[e].okStr} ${r}`,params:({keyword:e,schemaCode:r})=>t._`{comparison: ${i[e].okStr}, limit: ${r}}`},n={keyword:Object.keys(i),type:"number",schemaType:"number",$data:!0,error:r,code(e){const{keyword:r,data:n,schemaCode:s}=e;e.fail$data(t._`${n} ${i[r].fail} ${s} || isNaN(${n})`)}};return Wi.default=n,Wi}var Zi,Xi={};function Yi(){if(Zi)return Xi;Zi=1,Object.defineProperty(Xi,"__esModule",{value:!0});const t=Oe(),e={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>t.str`must be multiple of ${e}`,params:({schemaCode:e})=>t._`{multipleOf: ${e}}`},code(e){const{gen:i,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,a=i.let("res"),u=o?t._`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:t._`${a} !== parseInt(${a})`;e.fail$data(t._`(${n} === 0 || (${a} = ${r}/${n}, ${u}))`)}};return Xi.default=e,Xi}var Qi,tr,er={},ir={};function rr(){if(Qi)return ir;function t(t){const e=t.length;let i,r=0,n=0;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),56320==(64512&i)&&n++);return r}return Qi=1,Object.defineProperty(ir,"__esModule",{value:!0}),ir.default=t,t.code='require("ajv/dist/runtime/ucs2length").default',ir}function nr(){if(tr)return er;tr=1,Object.defineProperty(er,"__esModule",{value:!0});const t=Oe(),e=je(),i=rr(),r={message:({keyword:e,schemaCode:i})=>t.str`must NOT have ${"maxLength"===e?"more":"fewer"} than ${i} characters`,params:({schemaCode:e})=>t._`{limit: ${e}}`},n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:r,code(r){const{keyword:n,data:s,schemaCode:o,it:a}=r,u="maxLength"===n?t.operators.GT:t.operators.LT,h=!1===a.opts.unicode?t._`${s}.length`:t._`${(0,e.useFunc)(r.gen,i.default)}(${s})`;r.fail$data(t._`${h} ${u} ${o}`)}};return er.default=n,er}var sr,or={};function ar(){if(sr)return or;sr=1,Object.defineProperty(or,"__esModule",{value:!0});const t=Ye(),e=je(),i=Oe(),r={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>i.str`must match pattern "${t}"`,params:({schemaCode:t})=>i._`{pattern: ${t}}`},code(r){const{gen:n,data:s,$data:o,schema:a,schemaCode:u,it:h}=r,c=h.opts.unicodeRegExp?"u":"";if(o){const{regExp:t}=h.opts.code,o="new RegExp"===t.code?i._`new RegExp`:(0,e.useFunc)(n,t),a=n.let("valid");n.try((()=>n.assign(a,i._`${o}(${u}, ${c}).test(${s})`)),(()=>n.assign(a,!1))),r.fail$data(i._`!${a}`)}else{const e=(0,t.usePattern)(r,a);r.fail$data(i._`!${e}.test(${s})`)}}};return or.default=r,or}var ur,hr={};function cr(){if(ur)return hr;ur=1,Object.defineProperty(hr,"__esModule",{value:!0});const t=Oe(),e={message:({keyword:e,schemaCode:i})=>t.str`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${i} properties`,params:({schemaCode:e})=>t._`{limit: ${e}}`},i={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:e,code(e){const{keyword:i,data:r,schemaCode:n}=e;e.fail$data(t._`Object.keys(${r}).length ${"maxProperties"===i?t.operators.GT:t.operators.LT} ${n}`)}};return hr.default=i,hr}var fr,lr={};function dr(){if(fr)return lr;fr=1,Object.defineProperty(lr,"__esModule",{value:!0});const t=Ye(),e=Oe(),i=je(),r={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:t}})=>e.str`must have required property '${t}'`,params:({params:{missingProperty:t}})=>e._`{missingProperty: ${t}}`},code(r){const{gen:n,schema:s,schemaCode:o,data:a,$data:u,it:h}=r,{opts:c}=h;if(!u&&0===s.length)return;const f=s.length>=c.loopRequired;if(h.allErrors?function(){if(f||u)r.block$data(e.nil,l);else for(const e of s)(0,t.checkReportMissingProp)(r,e)}():function(){const i=n.let("missing");if(f||u){const s=n.let("valid",!0);r.block$data(s,(()=>function(i,s){r.setParams({missingProperty:i}),n.forOf(i,o,(()=>{n.assign(s,(0,t.propertyInData)(n,a,i,c.ownProperties)),n.if((0,e.not)(s),(()=>{r.error(),n.break()}))}),e.nil)}(i,s))),r.ok(s)}else n.if((0,t.checkMissingProp)(r,s,i)),(0,t.reportMissingProp)(r,i),n.else()}(),c.strictRequired){const t=r.parentSchema.properties,{definedProperties:e}=r.it;for(const r of s)void 0!==(null==t?void 0:t[r])||e.has(r)||(0,i.checkStrictMode)(h,`required property "${r}" is not defined at "${h.schemaEnv.baseId+h.errSchemaPath}" (strictRequired)`,h.opts.strictRequired)}function l(){n.forOf("prop",o,(e=>{r.setParams({missingProperty:e}),n.if((0,t.noPropertyInData)(n,a,e,c.ownProperties),(()=>r.error()))}))}}};return lr.default=r,lr}var pr,mr={};function vr(){if(pr)return mr;pr=1,Object.defineProperty(mr,"__esModule",{value:!0});const t=Oe(),e={message:({keyword:e,schemaCode:i})=>t.str`must NOT have ${"maxItems"===e?"more":"fewer"} than ${i} items`,params:({schemaCode:e})=>t._`{limit: ${e}}`},i={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:e,code(e){const{keyword:i,data:r,schemaCode:n}=e;e.fail$data(t._`${r}.length ${"maxItems"===i?t.operators.GT:t.operators.LT} ${n}`)}};return mr.default=i,mr}var yr,gr,$r={},wr={};function br(){if(yr)return wr;yr=1,Object.defineProperty(wr,"__esModule",{value:!0});const t=oi();return t.code='require("ajv/dist/runtime/equal").default',wr.default=t,wr}function _r(){if(gr)return $r;gr=1,Object.defineProperty($r,"__esModule",{value:!0});const t=Ve(),e=Oe(),i=je(),r=br(),n={message:({params:{i:t,j:i}})=>e.str`must NOT have duplicate items (items ## ${i} and ${t} are identical)`,params:({params:{i:t,j:i}})=>e._`{i: ${t}, j: ${i}}`},s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:n,code(n){const{gen:s,data:o,$data:a,schema:u,parentSchema:h,schemaCode:c,it:f}=n;if(!a&&!u)return;const l=s.let("valid"),d=h.items?(0,t.getSchemaTypes)(h.items):[];function p(i,r){const a=s.name("item"),u=(0,t.checkDataTypes)(d,a,f.opts.strictNumbers,t.DataType.Wrong),h=s.const("indices",e._`{}`);s.for(e._`;${i}--;`,(()=>{s.let(a,e._`${o}[${i}]`),s.if(u,e._`continue`),d.length>1&&s.if(e._`typeof ${a} == "string"`,e._`${a} += "_"`),s.if(e._`typeof ${h}[${a}] == "number"`,(()=>{s.assign(r,e._`${h}[${a}]`),n.error(),s.assign(l,!1).break()})).code(e._`${h}[${a}] = ${i}`)}))}function m(t,a){const u=(0,i.useFunc)(s,r.default),h=s.name("outer");s.label(h).for(e._`;${t}--;`,(()=>s.for(e._`${a} = ${t}; ${a}--;`,(()=>s.if(e._`${u}(${o}[${t}], ${o}[${a}])`,(()=>{n.error(),s.assign(l,!1).break(h)}))))))}n.block$data(l,(function(){const t=s.let("i",e._`${o}.length`),i=s.let("j");n.setParams({i:t,j:i}),s.assign(l,!0),s.if(e._`${t} > 1`,(()=>(d.length>0&&!d.some((t=>"object"===t||"array"===t))?p:m)(t,i)))}),e._`${c} === false`),n.ok(l)}};return $r.default=s,$r}var Er,kr={};function Or(){if(Er)return kr;Er=1,Object.defineProperty(kr,"__esModule",{value:!0});const t=Oe(),e=je(),i=br(),r={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>t._`{allowedValue: ${e}}`},code(r){const{gen:n,data:s,$data:o,schemaCode:a,schema:u}=r;o||u&&"object"==typeof u?r.fail$data(t._`!${(0,e.useFunc)(n,i.default)}(${s}, ${a})`):r.fail(t._`${u} !== ${s}`)}};return kr.default=r,kr}var Sr,xr,jr={};function Ir(){if(Sr)return jr;Sr=1,Object.defineProperty(jr,"__esModule",{value:!0});const t=Oe(),e=je(),i=br(),r={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>t._`{allowedValues: ${e}}`},code(r){const{gen:n,data:s,$data:o,schema:a,schemaCode:u,it:h}=r;if(!o&&0===a.length)throw new Error("enum must have non-empty array");let c;const f=()=>null!=c?c:c=(0,e.useFunc)(n,i.default);let l;if(a.length>=h.opts.loopEnum||o)l=n.let("valid"),r.block$data(l,(function(){n.assign(l,!1),n.forOf("v",u,(e=>n.if(t._`${f()}(${s}, ${e})`,(()=>n.assign(l,!0).break()))))}));else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=n.const("vSchema",u);l=(0,t.or)(...a.map(((i,r)=>function(e,i){const r=a[i];return"object"==typeof r&&null!==r?t._`${f()}(${s}, ${e}[${i}])`:t._`${s} === ${r}`}(e,r))))}r.pass(l)}};return jr.default=r,jr}function Pr(){return xr||(xr=1,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.default=[Ji().default,Yi().default,nr().default,ar().default,cr().default,dr().default,vr().default,_r().default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Or().default,Ir().default]),Ki}var Cr,Tr={},Ar={};function Nr(){if(Cr)return Ar;Cr=1,Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.validateAdditionalItems=void 0;const t=Oe(),e=je(),i={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>t.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>t._`{limit: ${e}}`},code(t){const{parentSchema:i,it:n}=t,{items:s}=i;Array.isArray(s)?r(t,s):(0,e.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas')}};function r(i,r){const{gen:n,schema:s,data:o,keyword:a,it:u}=i;u.items=!0;const h=n.const("len",t._`${o}.length`);if(!1===s)i.setParams({len:r.length}),i.pass(t._`${h} <= ${r.length}`);else if("object"==typeof s&&!(0,e.alwaysValidSchema)(u,s)){const s=n.var("valid",t._`${h} <= ${r.length}`);n.if((0,t.not)(s),(()=>function(s){n.forRange("i",r.length,h,(r=>{i.subschema({keyword:a,dataProp:r,dataPropType:e.Type.Num},s),u.allErrors||n.if((0,t.not)(s),(()=>n.break()))}))}(s))),i.ok(s)}}return Ar.validateAdditionalItems=r,Ar.default=i,Ar}var Mr,Rr,Dr={},zr={};function Lr(){if(Mr)return zr;Mr=1,Object.defineProperty(zr,"__esModule",{value:!0}),zr.validateTuple=void 0;const t=Oe(),e=je(),i=Ye(),r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){const{schema:r,it:s}=t;if(Array.isArray(r))return n(t,"additionalItems",r);s.items=!0,(0,e.alwaysValidSchema)(s,r)||t.ok((0,i.validateArray)(t))}};function n(i,r,n=i.schema){const{gen:s,parentSchema:o,data:a,keyword:u,it:h}=i;!function(t){const{opts:i,errSchemaPath:s}=h,o=n.length;i.strictTuples&&!(o===t.minItems&&(o===t.maxItems||!1===t[r]))&&(0,e.checkStrictMode)(h,`"${u}" is ${o}-tuple, but minItems or maxItems/${r} are not specified or different at path "${s}"`,i.strictTuples)}(o),h.opts.unevaluated&&n.length&&!0!==h.items&&(h.items=e.mergeEvaluated.items(s,n.length,h.items));const c=s.name("valid"),f=s.const("len",t._`${a}.length`);n.forEach(((r,n)=>{(0,e.alwaysValidSchema)(h,r)||(s.if(t._`${f} > ${n}`,(()=>i.subschema({keyword:u,schemaProp:n,dataProp:n},c))),i.ok(c))}))}return zr.validateTuple=n,zr.default=r,zr}function Ur(){if(Rr)return Dr;Rr=1,Object.defineProperty(Dr,"__esModule",{value:!0});const t=Lr();return Dr.default={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,t.validateTuple)(e,"items")},Dr}var qr,Fr={};function Br(){if(qr)return Fr;qr=1,Object.defineProperty(Fr,"__esModule",{value:!0});const t=Oe(),e=je(),i=Ye(),r=Nr(),n={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>t.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>t._`{limit: ${e}}`},code(t){const{schema:n,parentSchema:s,it:o}=t,{prefixItems:a}=s;o.items=!0,(0,e.alwaysValidSchema)(o,n)||(a?(0,r.validateAdditionalItems)(t,a):t.ok((0,i.validateArray)(t)))}};return Fr.default=n,Fr}var Vr,Gr={};function Hr(){if(Vr)return Gr;Vr=1,Object.defineProperty(Gr,"__esModule",{value:!0});const t=Oe(),e=je(),i={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:i}})=>void 0===i?t.str`must contain at least ${e} valid item(s)`:t.str`must contain at least ${e} and no more than ${i} valid item(s)`,params:({params:{min:e,max:i}})=>void 0===i?t._`{minContains: ${e}}`:t._`{minContains: ${e}, maxContains: ${i}}`},code(i){const{gen:r,schema:n,parentSchema:s,data:o,it:a}=i;let u,h;const{minContains:c,maxContains:f}=s;a.opts.next?(u=void 0===c?1:c,h=f):u=1;const l=r.const("len",t._`${o}.length`);if(i.setParams({min:u,max:h}),void 0===h&&0===u)return void(0,e.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==h&&u>h)return(0,e.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void i.fail();if((0,e.alwaysValidSchema)(a,n)){let e=t._`${l} >= ${u}`;return void 0!==h&&(e=t._`${e} && ${l} <= ${h}`),void i.pass(e)}a.items=!0;const d=r.name("valid");function p(){const e=r.name("_valid"),i=r.let("count",0);m(e,(()=>r.if(e,(()=>function(e){r.code(t._`${e}++`),void 0===h?r.if(t._`${e} >= ${u}`,(()=>r.assign(d,!0).break())):(r.if(t._`${e} > ${h}`,(()=>r.assign(d,!1).break())),1===u?r.assign(d,!0):r.if(t._`${e} >= ${u}`,(()=>r.assign(d,!0))))}(i)))))}function m(t,n){r.forRange("i",0,l,(r=>{i.subschema({keyword:"contains",dataProp:r,dataPropType:e.Type.Num,compositeRule:!0},t),n()}))}void 0===h&&1===u?m(d,(()=>r.if(d,(()=>r.break())))):0===u?(r.let(d,!0),void 0!==h&&r.if(t._`${o}.length > 0`,p)):(r.let(d,!1),p()),i.result(d,(()=>i.reset()))}};return Gr.default=i,Gr}var Kr,Wr={};function Jr(){return Kr||(Kr=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const e=Oe(),i=je(),r=Ye();t.error={message:({params:{property:t,depsCount:i,deps:r}})=>e.str`must have ${1===i?"property":"properties"} ${r} when property ${t} is present`,params:({params:{property:t,depsCount:i,deps:r,missingProperty:n}})=>e._`{property: ${t},
4
+ || ${u} === "boolean" || ${s} === null`).assign(c,r._`[${s}]`)}}n.else(),f(t),n.endIf(),n.if(r._`${c} !== undefined`,(()=>{n.assign(s,c),function({gen:t,parentData:e,parentDataProperty:i},n){t.if(r._`${e} !== undefined`,(()=>t.assign(r._`${e}[${i}]`,n)))}(t,c)}))}(t,i,c):f(t)}))}return l};const a=new Set(["string","number","integer","boolean","null"]);function u(t,e,i,n=s.Correct){const o=n===s.Correct?r.operators.EQ:r.operators.NEQ;let a;switch(t){case"null":return r._`${e} ${o} null`;case"array":a=r._`Array.isArray(${e})`;break;case"object":a=r._`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":a=u(r._`!(${e} % 1) && !isNaN(${e})`);break;case"number":a=u();break;default:return r._`typeof ${e} ${o} ${t}`}return n===s.Correct?a:(0,r.not)(a);function u(t=r.nil){return(0,r.and)(r._`typeof ${e} == "number"`,t,i?r._`isFinite(${e})`:r.nil)}}function h(t,e,i,s){if(1===t.length)return u(t[0],e,i,s);let o;const a=(0,n.toHash)(t);if(a.array&&a.object){const t=r._`typeof ${e} != "object"`;o=a.null?t:r._`!${e} || ${t}`,delete a.null,delete a.array,delete a.object}else o=r.nil;a.number&&delete a.integer;for(const t in a)o=(0,r.and)(o,u(t,e,i,s));return o}De.checkDataType=u,De.checkDataTypes=h;const c={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>"string"==typeof t?r._`{type: ${t}}`:r._`{type: ${e}}`};function f(t){const e=function(t){const{gen:e,data:i,schema:r}=t,s=(0,n.schemaRefOrVal)(t,r,"type");return{gen:e,keyword:"type",data:i,schema:r.type,schemaCode:s,schemaValue:s,parentSchema:r,params:{},it:t}}(t);(0,i.reportError)(e,c)}return De.reportTypeError=f,De}var Ge,He={};function Ke(){if(Ge)return He;Ge=1,Object.defineProperty(He,"__esModule",{value:!0}),He.assignDefaults=void 0;const t=Oe(),e=je();function i(i,r,n){const{gen:s,compositeRule:o,data:a,opts:u}=i;if(void 0===n)return;const h=t._`${a}${(0,t.getProperty)(r)}`;if(o)return void(0,e.checkStrictMode)(i,`default is ignored for: ${h}`);let c=t._`${h} === undefined`;"empty"===u.useDefaults&&(c=t._`${c} || ${h} === null || ${h} === ""`),s.if(c,t._`${h} = ${(0,t.stringify)(n)}`)}return He.assignDefaults=function(t,e){const{properties:r,items:n}=t.schema;if("object"===e&&r)for(const e in r)i(t,e,r[e].default);else"array"===e&&Array.isArray(n)&&n.forEach(((e,r)=>i(t,r,e.default)))},He}var We,Je,Ze={},Xe={};function Ye(){if(We)return Xe;We=1,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.validateUnion=Xe.validateArray=Xe.usePattern=Xe.callValidateCode=Xe.schemaProperties=Xe.allSchemaProperties=Xe.noPropertyInData=Xe.propertyInData=Xe.isOwnProperty=Xe.hasPropFunc=Xe.reportMissingProp=Xe.checkMissingProp=Xe.checkReportMissingProp=void 0;const t=Oe(),e=je(),i=Ae(),r=je();function n(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:t._`Object.prototype.hasOwnProperty`})}function s(e,i,r){return t._`${n(e)}.call(${i}, ${r})`}function o(e,i,r,n){const o=t._`${i}${(0,t.getProperty)(r)} === undefined`;return n?(0,t.or)(o,(0,t.not)(s(e,i,r))):o}function a(t){return t?Object.keys(t).filter((t=>"__proto__"!==t)):[]}Xe.checkReportMissingProp=function(e,i){const{gen:r,data:n,it:s}=e;r.if(o(r,n,i,s.opts.ownProperties),(()=>{e.setParams({missingProperty:t._`${i}`},!0),e.error()}))},Xe.checkMissingProp=function({gen:e,data:i,it:{opts:r}},n,s){return(0,t.or)(...n.map((n=>(0,t.and)(o(e,i,n,r.ownProperties),t._`${s} = ${n}`))))},Xe.reportMissingProp=function(t,e){t.setParams({missingProperty:e},!0),t.error()},Xe.hasPropFunc=n,Xe.isOwnProperty=s,Xe.propertyInData=function(e,i,r,n){const o=t._`${i}${(0,t.getProperty)(r)} !== undefined`;return n?t._`${o} && ${s(e,i,r)}`:o},Xe.noPropertyInData=o,Xe.allSchemaProperties=a,Xe.schemaProperties=function(t,i){return a(i).filter((r=>!(0,e.alwaysValidSchema)(t,i[r])))},Xe.callValidateCode=function({schemaCode:e,data:r,it:{gen:n,topSchemaRef:s,schemaPath:o,errorPath:a},it:u},h,c,f){const l=f?t._`${e}, ${r}, ${s}${o}`:r,d=[[i.default.instancePath,(0,t.strConcat)(i.default.instancePath,a)],[i.default.parentData,u.parentData],[i.default.parentDataProperty,u.parentDataProperty],[i.default.rootData,i.default.rootData]];u.opts.dynamicRef&&d.push([i.default.dynamicAnchors,i.default.dynamicAnchors]);const p=t._`${l}, ${n.object(...d)}`;return c!==t.nil?t._`${h}.call(${c}, ${p})`:t._`${h}(${p})`};const u=t._`new RegExp`;return Xe.usePattern=function({gen:e,it:{opts:i}},n){const s=i.unicodeRegExp?"u":"",{regExp:o}=i.code,a=o(n,s);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:t._`${"new RegExp"===o.code?u:(0,r.useFunc)(e,o)}(${n}, ${s})`})},Xe.validateArray=function(i){const{gen:r,data:n,keyword:s,it:o}=i,a=r.name("valid");if(o.allErrors){const t=r.let("valid",!0);return u((()=>r.assign(t,!1))),t}return r.var(a,!0),u((()=>r.break())),a;function u(o){const u=r.const("len",t._`${n}.length`);r.forRange("i",0,u,(n=>{i.subschema({keyword:s,dataProp:n,dataPropType:e.Type.Num},a),r.if((0,t.not)(a),o)}))}},Xe.validateUnion=function(i){const{gen:r,schema:n,keyword:s,it:o}=i;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some((t=>(0,e.alwaysValidSchema)(o,t)))&&!o.opts.unevaluated)return;const a=r.let("valid",!1),u=r.name("_valid");r.block((()=>n.forEach(((e,n)=>{const o=i.subschema({keyword:s,schemaProp:n,compositeRule:!0},u);r.assign(a,t._`${a} || ${u}`),i.mergeValidEvaluated(o,u)||r.if((0,t.not)(a))})))),i.result(a,(()=>i.reset()),(()=>i.error(!0)))},Xe}function Qe(){if(Je)return Ze;Je=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.validateKeywordUsage=Ze.validSchemaType=Ze.funcKeywordCode=Ze.macroKeywordCode=void 0;const t=Oe(),e=Ae(),i=Ye(),r=Ne();function n(e){const{gen:i,data:r,it:n}=e;i.if(n.parentData,(()=>i.assign(r,t._`${n.parentData}[${n.parentDataProperty}]`)))}function s(e,i,r){if(void 0===r)throw new Error(`keyword "${i}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,t.stringify)(r)})}return Ze.macroKeywordCode=function(e,i){const{gen:r,keyword:n,schema:o,parentSchema:a,it:u}=e,h=i.macro.call(u.self,o,a,u),c=s(r,n,h);!1!==u.opts.validateSchema&&u.self.validateSchema(h,!0);const f=r.name("valid");e.subschema({schema:h,schemaPath:t.nil,errSchemaPath:`${u.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},f),e.pass(f,(()=>e.error(!0)))},Ze.funcKeywordCode=function(o,a){var u;const{gen:h,keyword:c,schema:f,parentSchema:l,$data:d,it:p}=o;!function({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}(p,a);const m=!d&&a.compile?a.compile.call(p.self,f,l,p):a.validate,v=s(h,c,m),y=h.let("valid");function g(r=(a.async?t._`await `:t.nil)){h.assign(y,t._`${r}${(0,i.callValidateCode)(o,v,p.opts.passContext?e.default.this:e.default.self,!("compile"in a&&!d||!1===a.schema))}`,a.modifying)}function $(e){var i;h.if((0,t.not)(null!==(i=a.valid)&&void 0!==i?i:y),e)}o.block$data(y,(function(){if(!1===a.errors)g(),a.modifying&&n(o),$((()=>o.error()));else{const i=a.async?function(){const e=h.let("ruleErrs",null);return h.try((()=>g(t._`await `)),(i=>h.assign(y,!1).if(t._`${i} instanceof ${p.ValidationError}`,(()=>h.assign(e,t._`${i}.errors`)),(()=>h.throw(i))))),e}():function(){const e=t._`${v}.errors`;return h.assign(e,null),g(t.nil),e}();a.modifying&&n(o),$((()=>function(i,n){const{gen:s}=i;s.if(t._`Array.isArray(${n})`,(()=>{s.assign(e.default.vErrors,t._`${e.default.vErrors} === null ? ${n} : ${e.default.vErrors}.concat(${n})`).assign(e.default.errors,t._`${e.default.vErrors}.length`),(0,r.extendErrors)(i)}),(()=>i.error()))}(o,i)))}})),o.ok(null!==(u=a.valid)&&void 0!==u?u:y)},Ze.validSchemaType=function(t,e,i=!1){return!e.length||e.some((e=>"array"===e?Array.isArray(t):"object"===e?t&&"object"==typeof t&&!Array.isArray(t):typeof t==e||i&&void 0===t))},Ze.validateKeywordUsage=function({schema:t,opts:e,self:i,errSchemaPath:r},n,s){if(Array.isArray(n.keyword)?!n.keyword.includes(s):n.keyword!==s)throw new Error("ajv implementation error");const o=n.dependencies;if(null==o?void 0:o.some((e=>!Object.prototype.hasOwnProperty.call(t,e))))throw new Error(`parent schema must have dependencies of ${s}: ${o.join(",")}`);if(n.validateSchema&&!n.validateSchema(t[s])){const t=`keyword "${s}" value is invalid at path "${r}": `+i.errorsText(n.validateSchema.errors);if("log"!==e.validateSchema)throw new Error(t);i.logger.error(t)}},Ze}var ti,ei={};function ii(){if(ti)return ei;ti=1,Object.defineProperty(ei,"__esModule",{value:!0}),ei.extendSubschemaMode=ei.extendSubschemaData=ei.getSubschema=void 0;const t=Oe(),e=je();return ei.getSubschema=function(i,{keyword:r,schemaProp:n,schema:s,schemaPath:o,errSchemaPath:a,topSchemaRef:u}){if(void 0!==r&&void 0!==s)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==r){const s=i.schema[r];return void 0===n?{schema:s,schemaPath:t._`${i.schemaPath}${(0,t.getProperty)(r)}`,errSchemaPath:`${i.errSchemaPath}/${r}`}:{schema:s[n],schemaPath:t._`${i.schemaPath}${(0,t.getProperty)(r)}${(0,t.getProperty)(n)}`,errSchemaPath:`${i.errSchemaPath}/${r}/${(0,e.escapeFragment)(n)}`}}if(void 0!==s){if(void 0===o||void 0===a||void 0===u)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:s,schemaPath:o,topSchemaRef:u,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},ei.extendSubschemaData=function(i,r,{dataProp:n,dataPropType:s,data:o,dataTypes:a,propertyName:u}){if(void 0!==o&&void 0!==n)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:h}=r;if(void 0!==n){const{errorPath:o,dataPathArr:a,opts:u}=r;c(h.let("data",t._`${r.data}${(0,t.getProperty)(n)}`,!0)),i.errorPath=t.str`${o}${(0,e.getErrorPath)(n,s,u.jsPropertySyntax)}`,i.parentDataProperty=t._`${n}`,i.dataPathArr=[...a,i.parentDataProperty]}function c(t){i.data=t,i.dataLevel=r.dataLevel+1,i.dataTypes=[],r.definedProperties=new Set,i.parentData=r.data,i.dataNames=[...r.dataNames,t]}void 0!==o&&(c(o instanceof t.Name?o:h.let("data",o,!0)),void 0!==u&&(i.propertyName=u)),a&&(i.dataTypes=a)},ei.extendSubschemaMode=function(t,{jtdDiscriminator:e,jtdMetadata:i,compositeRule:r,createErrors:n,allErrors:s}){void 0!==r&&(t.compositeRule=r),void 0!==n&&(t.createErrors=n),void 0!==s&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=i},ei}var ri,ni,si={};function oi(){return ni||(ni=1,ri=function t(e,i){if(e===i)return!0;if(e&&i&&"object"==typeof e&&"object"==typeof i){if(e.constructor!==i.constructor)return!1;var r,n,s;if(Array.isArray(e)){if((r=e.length)!=i.length)return!1;for(n=r;0!=n--;)if(!t(e[n],i[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===i.source&&e.flags===i.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===i.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===i.toString();if((r=(s=Object.keys(e)).length)!==Object.keys(i).length)return!1;for(n=r;0!=n--;)if(!Object.prototype.hasOwnProperty.call(i,s[n]))return!1;for(n=r;0!=n--;){var o=s[n];if(!t(e[o],i[o]))return!1}return!0}return e!=e&&i!=i}),ri}var ai,ui,hi,ci={exports:{}};function fi(){if(ai)return ci.exports;ai=1;var t=ci.exports=function(t,i,r){"function"==typeof i&&(r=i,i={}),e(i,"function"==typeof(r=i.cb||r)?r:r.pre||function(){},r.post||function(){},t,"",t)};function e(i,r,n,s,o,a,u,h,c,f){if(s&&"object"==typeof s&&!Array.isArray(s)){for(var l in r(s,o,a,u,h,c,f),s){var d=s[l];if(Array.isArray(d)){if(l in t.arrayKeywords)for(var p=0;p<d.length;p++)e(i,r,n,d[p],o+"/"+l+"/"+p,a,o,l,s,p)}else if(l in t.propsKeywords){if(d&&"object"==typeof d)for(var m in d)e(i,r,n,d[m],o+"/"+l+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),a,o,l,s,m)}else(l in t.keywords||i.allKeys&&!(l in t.skipKeywords))&&e(i,r,n,d,o+"/"+l,a,o,l,s)}n(s,o,a,u,h,c,f)}}return t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.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},ci.exports}function li(){if(ui)return si;ui=1,Object.defineProperty(si,"__esModule",{value:!0}),si.getSchemaRefs=si.resolveUrl=si.normalizeId=si._getFullPath=si.getFullPath=si.inlineRef=void 0;const t=je(),e=oi(),i=fi(),r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);si.inlineRef=function(t,e=!0){return"boolean"==typeof t||(!0===e?!s(t):!!e&&o(t)<=e)};const n=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function s(t){for(const e in t){if(n.has(e))return!0;const i=t[e];if(Array.isArray(i)&&i.some(s))return!0;if("object"==typeof i&&s(i))return!0}return!1}function o(e){let i=0;for(const n in e){if("$ref"===n)return 1/0;if(i++,!r.has(n)&&("object"==typeof e[n]&&(0,t.eachItem)(e[n],(t=>i+=o(t))),i===1/0))return 1/0}return i}function a(t,e="",i){!1!==i&&(e=c(e));const r=t.parse(e);return u(t,r)}function u(t,e){return t.serialize(e).split("#")[0]+"#"}si.getFullPath=a,si._getFullPath=u;const h=/#\/?$/;function c(t){return t?t.replace(h,""):""}si.normalizeId=c,si.resolveUrl=function(t,e,i){return i=c(i),t.resolve(e,i)};const f=/^[a-z_][-a-z0-9._]*$/i;return si.getSchemaRefs=function(t,r){if("boolean"==typeof t)return{};const{schemaId:n,uriResolver:s}=this.opts,o=c(t[n]||r),u={"":o},h=a(s,o,!1),l={},d=new Set;return i(t,{allKeys:!0},((t,e,i,r)=>{if(void 0===r)return;const s=h+e;let o=u[r];function a(e){if(e=c(o?(0,this.opts.uriResolver.resolve)(o,e):e),d.has(e))throw m(e);d.add(e);let i=this.refs[e];return"string"==typeof i&&(i=this.refs[i]),"object"==typeof i?p(t,i.schema,e):e!==c(s)&&("#"===e[0]?(p(t,l[e],e),l[e]=t):this.refs[e]=s),e}function v(t){if("string"==typeof t){if(!f.test(t))throw new Error(`invalid anchor "${t}"`);a.call(this,`#${t}`)}}"string"==typeof t[n]&&(o=a.call(this,t[n])),v.call(this,t.$anchor),v.call(this,t.$dynamicAnchor),u[e]=o})),l;function p(t,i,r){if(void 0!==i&&!e(t,i))throw m(r)}function m(t){return new Error(`reference "${t}" resolves to more than one schema`)}},si}function di(){if(hi)return me;hi=1,Object.defineProperty(me,"__esModule",{value:!0}),me.getData=me.KeywordCxt=me.validateFunctionCode=void 0;const t=Me(),e=Ve(),i=Be(),r=Ve(),n=Ke(),s=Qe(),o=ii(),a=Oe(),u=Ae(),h=li(),c=je(),f=Ne();function l({gen:t,validateName:e,schema:i,schemaEnv:r,opts:n},s){n.code.es5?t.func(e,a._`${u.default.data}, ${u.default.valCxt}`,r.$async,(()=>{t.code(a._`"use strict"; ${d(i,n)}`),function(t,e){t.if(u.default.valCxt,(()=>{t.var(u.default.instancePath,a._`${u.default.valCxt}.${u.default.instancePath}`),t.var(u.default.parentData,a._`${u.default.valCxt}.${u.default.parentData}`),t.var(u.default.parentDataProperty,a._`${u.default.valCxt}.${u.default.parentDataProperty}`),t.var(u.default.rootData,a._`${u.default.valCxt}.${u.default.rootData}`),e.dynamicRef&&t.var(u.default.dynamicAnchors,a._`${u.default.valCxt}.${u.default.dynamicAnchors}`)}),(()=>{t.var(u.default.instancePath,a._`""`),t.var(u.default.parentData,a._`undefined`),t.var(u.default.parentDataProperty,a._`undefined`),t.var(u.default.rootData,u.default.data),e.dynamicRef&&t.var(u.default.dynamicAnchors,a._`{}`)}))}(t,n),t.code(s)})):t.func(e,a._`${u.default.data}, ${function(t){return a._`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${t.dynamicRef?a._`, ${u.default.dynamicAnchors}={}`:a.nil}}={}`}(n)}`,r.$async,(()=>t.code(d(i,n)).code(s)))}function d(t,e){const i="object"==typeof t&&t[e.schemaId];return i&&(e.code.source||e.code.process)?a._`/*# sourceURL=${i} */`:a.nil}function p({schema:t,self:e}){if("boolean"==typeof t)return!t;for(const i in t)if(e.RULES.all[i])return!0;return!1}function m(t){return"boolean"!=typeof t.schema}function v(t){(0,c.checkUnknownRules)(t),function(t){const{schema:e,errSchemaPath:i,opts:r,self:n}=t;e.$ref&&r.ignoreKeywordsWithRef&&(0,c.schemaHasRulesButRef)(e,n.RULES)&&n.logger.warn(`$ref: keywords ignored in schema at path "${i}"`)}(t)}function y(t,i){if(t.opts.jtd)return $(t,[],!1,i);const r=(0,e.getSchemaTypes)(t.schema);$(t,r,!(0,e.coerceAndCheckDataType)(t,r),i)}function g({gen:t,schemaEnv:e,schema:i,errSchemaPath:r,opts:n}){const s=i.$comment;if(!0===n.$comment)t.code(a._`${u.default.self}.logger.log(${s})`);else if("function"==typeof n.$comment){const i=a.str`${r}/$comment`,n=t.scopeValue("root",{ref:e.root});t.code(a._`${u.default.self}.opts.$comment(${s}, ${i}, ${n}.schema)`)}}function $(t,e,n,s){const{gen:o,schema:h,data:f,allErrors:l,opts:d,self:p}=t,{RULES:m}=p;function v(c){(0,i.shouldUseGroup)(h,c)&&(c.type?(o.if((0,r.checkDataType)(c.type,f,d.strictNumbers)),w(t,c),1===e.length&&e[0]===c.type&&n&&(o.else(),(0,r.reportTypeError)(t)),o.endIf()):w(t,c),l||o.if(a._`${u.default.errors} === ${s||0}`))}!h.$ref||!d.ignoreKeywordsWithRef&&(0,c.schemaHasRulesButRef)(h,m)?(d.jtd||function(t,e){!t.schemaEnv.meta&&t.opts.strictTypes&&(function(t,e){e.length&&(t.dataTypes.length?(e.forEach((e=>{b(t.dataTypes,e)||_(t,`type "${e}" not allowed by context "${t.dataTypes.join(",")}"`)})),function(t,e){const i=[];for(const r of t.dataTypes)b(e,r)?i.push(r):e.includes("integer")&&"number"===r&&i.push("integer");t.dataTypes=i}(t,e)):t.dataTypes=e)}(t,e),t.opts.allowUnionTypes||function(t,e){e.length>1&&(2!==e.length||!e.includes("null"))&&_(t,"use allowUnionTypes to allow union type keyword")}(t,e),function(t,e){const r=t.self.RULES.all;for(const n in r){const s=r[n];if("object"==typeof s&&(0,i.shouldUseRule)(t.schema,s)){const{type:i}=s.definition;i.length&&!i.some((t=>{return(i=e).includes(r=t)||"number"===r&&i.includes("integer");var i,r}))&&_(t,`missing type "${i.join(",")}" for keyword "${n}"`)}}}(t,t.dataTypes))}(t,e),o.block((()=>{for(const t of m.rules)v(t);v(m.post)}))):o.block((()=>k(t,"$ref",m.all.$ref.definition)))}function w(t,e){const{gen:r,schema:s,opts:{useDefaults:o}}=t;o&&(0,n.assignDefaults)(t,e.type),r.block((()=>{for(const r of e.rules)(0,i.shouldUseRule)(s,r)&&k(t,r.keyword,r.definition,e.type)}))}function b(t,e){return t.includes(e)||"integer"===e&&t.includes("number")}function _(t,e){(0,c.checkStrictMode)(t,e+=` at "${t.schemaEnv.baseId+t.errSchemaPath}" (strictTypes)`,t.opts.strictTypes)}me.validateFunctionCode=function(e){m(e)&&(v(e),p(e))?function(t){const{schema:e,opts:i,gen:r}=t;l(t,(()=>{i.$comment&&e.$comment&&g(t),function(t){const{schema:e,opts:i}=t;void 0!==e.default&&i.useDefaults&&i.strictSchema&&(0,c.checkStrictMode)(t,"default is ignored in the schema root")}(t),r.let(u.default.vErrors,null),r.let(u.default.errors,0),i.unevaluated&&function(t){const{gen:e,validateName:i}=t;t.evaluated=e.const("evaluated",a._`${i}.evaluated`),e.if(a._`${t.evaluated}.dynamicProps`,(()=>e.assign(a._`${t.evaluated}.props`,a._`undefined`))),e.if(a._`${t.evaluated}.dynamicItems`,(()=>e.assign(a._`${t.evaluated}.items`,a._`undefined`)))}(t),y(t),function(t){const{gen:e,schemaEnv:i,validateName:r,ValidationError:n,opts:s}=t;i.$async?e.if(a._`${u.default.errors} === 0`,(()=>e.return(u.default.data)),(()=>e.throw(a._`new ${n}(${u.default.vErrors})`))):(e.assign(a._`${r}.errors`,u.default.vErrors),s.unevaluated&&function({gen:t,evaluated:e,props:i,items:r}){i instanceof a.Name&&t.assign(a._`${e}.props`,i),r instanceof a.Name&&t.assign(a._`${e}.items`,r)}(t),e.return(a._`${u.default.errors} === 0`))}(t)}))}(e):l(e,(()=>(0,t.topBoolOrEmptySchema)(e)))};class E{constructor(t,e,i){if((0,s.validateKeywordUsage)(t,e,i),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=i,this.data=t.data,this.schema=t.schema[i],this.$data=e.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,c.schemaRefOrVal)(t,this.schema,i,this.$data),this.schemaType=e.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=e,this.$data)this.schemaCode=t.gen.const("vSchema",x(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,e.schemaType,e.allowUndefined))throw new Error(`${i} value must be ${JSON.stringify(e.schemaType)}`);("code"in e?e.trackErrors:!1!==e.errors)&&(this.errsCount=t.gen.const("_errs",u.default.errors))}result(t,e,i){this.failResult((0,a.not)(t),e,i)}failResult(t,e,i){this.gen.if(t),i?i():this.error(),e?(this.gen.else(),e(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,e){this.failResult((0,a.not)(t),void 0,e)}fail(t){if(void 0===t)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:e}=this;this.fail(a._`${e} !== undefined && (${(0,a.or)(this.invalid$data(),t)})`)}error(t,e,i){if(e)return this.setParams(e),this._error(t,i),void this.setParams({});this._error(t,i)}_error(t,e){(t?f.reportExtraError:f.reportError)(this,this.def.error,e)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,e){e?Object.assign(this.params,t):this.params=t}block$data(t,e,i=a.nil){this.gen.block((()=>{this.check$data(t,i),e()}))}check$data(t=a.nil,e=a.nil){if(!this.$data)return;const{gen:i,schemaCode:r,schemaType:n,def:s}=this;i.if((0,a.or)(a._`${r} === undefined`,e)),t!==a.nil&&i.assign(t,!0),(n.length||s.validateSchema)&&(i.elseIf(this.invalid$data()),this.$dataError(),t!==a.nil&&i.assign(t,!1)),i.else()}invalid$data(){const{gen:t,schemaCode:e,schemaType:i,def:n,it:s}=this;return(0,a.or)(function(){if(i.length){if(!(e instanceof a.Name))throw new Error("ajv implementation error");const t=Array.isArray(i)?i:[i];return a._`${(0,r.checkDataTypes)(t,e,s.opts.strictNumbers,r.DataType.Wrong)}`}return a.nil}(),function(){if(n.validateSchema){const i=t.scopeValue("validate$data",{ref:n.validateSchema});return a._`!${i}(${e})`}return a.nil}())}subschema(e,i){const r=(0,o.getSubschema)(this.it,e);(0,o.extendSubschemaData)(r,this.it,e),(0,o.extendSubschemaMode)(r,e);const n={...this.it,...r,items:void 0,props:void 0};return function(e,i){m(e)&&(v(e),p(e))?function(t,e){const{schema:i,gen:r,opts:n}=t;n.$comment&&i.$comment&&g(t),function(t){const e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,h.resolveUrl)(t.opts.uriResolver,t.baseId,e))}(t),function(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}(t);const s=r.const("_errs",u.default.errors);y(t,s),r.var(e,a._`${s} === ${u.default.errors}`)}(e,i):(0,t.boolOrEmptySchema)(e,i)}(n,i),n}mergeEvaluated(t,e){const{it:i,gen:r}=this;i.opts.unevaluated&&(!0!==i.props&&void 0!==t.props&&(i.props=c.mergeEvaluated.props(r,t.props,i.props,e)),!0!==i.items&&void 0!==t.items&&(i.items=c.mergeEvaluated.items(r,t.items,i.items,e)))}mergeValidEvaluated(t,e){const{it:i,gen:r}=this;if(i.opts.unevaluated&&(!0!==i.props||!0!==i.items))return r.if(e,(()=>this.mergeEvaluated(t,a.Name))),!0}}function k(t,e,i,r){const n=new E(t,i,e);"code"in i?i.code(n,r):n.$data&&i.validate?(0,s.funcKeywordCode)(n,i):"macro"in i?(0,s.macroKeywordCode)(n,i):(i.compile||i.validate)&&(0,s.funcKeywordCode)(n,i)}me.KeywordCxt=E;const O=/^\/(?:[^~]|~0|~1)*$/,S=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function x(t,{dataLevel:e,dataNames:i,dataPathArr:r}){let n,s;if(""===t)return u.default.rootData;if("/"===t[0]){if(!O.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);n=t,s=u.default.rootData}else{const o=S.exec(t);if(!o)throw new Error(`Invalid JSON-pointer: ${t}`);const a=+o[1];if(n=o[2],"#"===n){if(a>=e)throw new Error(f("property/index",a));return r[e-a]}if(a>e)throw new Error(f("data",a));if(s=i[e-a],!n)return s}let o=s;const h=n.split("/");for(const t of h)t&&(s=a._`${s}${(0,a.getProperty)((0,c.unescapeJsonPointer)(t))}`,o=a._`${o} && ${s}`);return o;function f(t,i){return`Cannot access ${t} ${i} levels up, current level is ${e}`}}return me.getData=x,me}var pi,mi={};function vi(){if(pi)return mi;pi=1,Object.defineProperty(mi,"__esModule",{value:!0});class t extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}return mi.default=t,mi}var yi,gi={};function $i(){if(yi)return gi;yi=1,Object.defineProperty(gi,"__esModule",{value:!0});const t=li();class e extends Error{constructor(e,i,r,n){super(n||`can't resolve reference ${r} from id ${i}`),this.missingRef=(0,t.resolveUrl)(e,i,r),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(e,this.missingRef))}}return gi.default=e,gi}var wi,bi={};function _i(){if(wi)return bi;wi=1,Object.defineProperty(bi,"__esModule",{value:!0}),bi.resolveSchema=bi.getCompilingSchema=bi.resolveRef=bi.compileSchema=bi.SchemaEnv=void 0;const t=Oe(),e=vi(),i=Ae(),r=li(),n=je(),s=di();class o{constructor(t){var e;let i;this.refs={},this.dynamicAnchors={},"object"==typeof t.schema&&(i=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=null!==(e=t.baseId)&&void 0!==e?e:(0,r.normalizeId)(null==i?void 0:i[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=null==i?void 0:i.$async,this.refs={}}}function a(n){const o=h.call(this,n);if(o)return o;const a=(0,r.getFullPath)(this.opts.uriResolver,n.root.baseId),{es5:u,lines:c}=this.opts.code,{ownProperties:f}=this.opts,l=new t.CodeGen(this.scope,{es5:u,lines:c,ownProperties:f});let d;n.$async&&(d=l.scopeValue("Error",{ref:e.default,code:t._`require("ajv/dist/runtime/validation_error").default`}));const p=l.scopeName("validate");n.validateName=p;const m={gen:l,allErrors:this.opts.allErrors,data:i.default.data,parentData:i.default.parentData,parentDataProperty:i.default.parentDataProperty,dataNames:[i.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:l.scopeValue("schema",!0===this.opts.code.source?{ref:n.schema,code:(0,t.stringify)(n.schema)}:{ref:n.schema}),validateName:p,ValidationError:d,schema:n.schema,schemaEnv:n,rootId:a,baseId:n.baseId||a,schemaPath:t.nil,errSchemaPath:n.schemaPath||(this.opts.jtd?"":"#"),errorPath:t._`""`,opts:this.opts,self:this};let v;try{this._compilations.add(n),(0,s.validateFunctionCode)(m),l.optimize(this.opts.code.optimize);const e=l.toString();v=`${l.scopeRefs(i.default.scope)}return ${e}`,this.opts.code.process&&(v=this.opts.code.process(v,n));const r=new Function(`${i.default.self}`,`${i.default.scope}`,v)(this,this.scope.get());if(this.scope.value(p,{ref:r}),r.errors=null,r.schema=n.schema,r.schemaEnv=n,n.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:p,validateCode:e,scopeValues:l._values}),this.opts.unevaluated){const{props:e,items:i}=m;r.evaluated={props:e instanceof t.Name?void 0:e,items:i instanceof t.Name?void 0:i,dynamicProps:e instanceof t.Name,dynamicItems:i instanceof t.Name},r.source&&(r.source.evaluated=(0,t.stringify)(r.evaluated))}return n.validate=r,n}catch(t){throw delete n.validate,delete n.validateName,v&&this.logger.error("Error compiling schema, function code:",v),t}finally{this._compilations.delete(n)}}function u(t){return(0,r.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:a.call(this,t)}function h(t){for(const r of this._compilations)if((e=r).schema===(i=t).schema&&e.root===i.root&&e.baseId===i.baseId)return r;var e,i}function c(t,e){let i;for(;"string"==typeof(i=this.refs[e]);)e=i;return i||this.schemas[e]||f.call(this,t,e)}function f(t,e){const i=this.opts.uriResolver.parse(e),n=(0,r._getFullPath)(this.opts.uriResolver,i);let s=(0,r.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===s)return d.call(this,i,t);const u=(0,r.normalizeId)(n),h=this.refs[u]||this.schemas[u];if("string"==typeof h){const e=f.call(this,t,h);if("object"!=typeof(null==e?void 0:e.schema))return;return d.call(this,i,e)}if("object"==typeof(null==h?void 0:h.schema)){if(h.validate||a.call(this,h),u===(0,r.normalizeId)(e)){const{schema:e}=h,{schemaId:i}=this.opts,n=e[i];return n&&(s=(0,r.resolveUrl)(this.opts.uriResolver,s,n)),new o({schema:e,schemaId:i,root:t,baseId:s})}return d.call(this,i,h)}}bi.SchemaEnv=o,bi.compileSchema=a,bi.resolveRef=function(t,e,i){var n;i=(0,r.resolveUrl)(this.opts.uriResolver,e,i);const s=t.refs[i];if(s)return s;let a=c.call(this,t,i);if(void 0===a){const r=null===(n=t.localRefs)||void 0===n?void 0:n[i],{schemaId:s}=this.opts;r&&(a=new o({schema:r,schemaId:s,root:t,baseId:e}))}return void 0!==a?t.refs[i]=u.call(this,a):void 0},bi.getCompilingSchema=h,bi.resolveSchema=f;const l=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function d(t,{baseId:e,schema:i,root:s}){var a;if("/"!==(null===(a=t.fragment)||void 0===a?void 0:a[0]))return;for(const s of t.fragment.slice(1).split("/")){if("boolean"==typeof i)return;const t=i[(0,n.unescapeFragment)(s)];if(void 0===t)return;const o="object"==typeof(i=t)&&i[this.opts.schemaId];!l.has(s)&&o&&(e=(0,r.resolveUrl)(this.opts.uriResolver,e,o))}let u;if("boolean"!=typeof i&&i.$ref&&!(0,n.schemaHasRulesButRef)(i,this.RULES)){const t=(0,r.resolveUrl)(this.opts.uriResolver,e,i.$ref);u=f.call(this,s,t)}const{schemaId:h}=this.opts;return u=u||new o({schema:i,schemaId:h,root:s,baseId:e}),u.schema!==u.root.schema?u:void 0}return bi}var Ei,ki,Oi,Si,xi,ji,Ii,Pi={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1},Ci={},Ti={exports:{}};function Ai(){if(ki)return Ei;ki=1;const t=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),e=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),i=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),r=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),n=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function s(t){let e="",i=0,r=0;for(r=0;r<t.length;r++)if(i=t[r].charCodeAt(0),48!==i){if(!(i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102))return"";e+=t[r];break}for(r+=1;r<t.length;r++){if(i=t[r].charCodeAt(0),!(i>=48&&i<=57||i>=65&&i<=70||i>=97&&i<=102))return"";e+=t[r]}return e}const o=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function a(t){return t.length=0,!0}function u(t,e,i){if(t.length){const r=s(t);if(""===r)return i.error=!0,!1;e.push(r),t.length=0}return!0}function h(t){if(function(t){let e=0;for(let i=0;i<t.length;i++)":"===t[i]&&e++;return e}(t)<2)return{host:t,isIPV6:!1};const e=function(t){let e=0;const i={error:!1,address:"",zone:""},r=[],n=[];let o=!1,h=!1,c=u;for(let s=0;s<t.length;s++){const u=t[s];if("["!==u&&"]"!==u)if(":"!==u)if("%"===u){if(!c(n,r,i))break;c=a}else n.push(u);else{if(!0===o&&(h=!0),!c(n,r,i))break;if(++e>7){i.error=!0;break}s>0&&":"===t[s-1]&&(o=!0),r.push(":")}}return n.length&&(c===a?i.zone=n.join(""):r.push(h?n.join(""):s(n))),i.address=r.join(""),i}(t);if(e.error)return{host:t,isIPV6:!1};{let t=e.address,i=e.address;return e.zone&&(t+="%"+e.zone,i+="%25"+e.zone),{host:t,isIPV6:!0,escapedHost:i}}}const c={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},f=/[@/?#:]/g,l=/[@/?#]/g;function d(t,e){const i=e?l:f;return i.lastIndex=0,t.replace(i,(t=>c[t]))}return Ei={nonSimpleDomain:o,recomposeAuthority:function(t){const i=[];if(void 0!==t.userinfo&&(i.push(t.userinfo),i.push("@")),void 0!==t.host){let r=unescape(t.host);if(!e(r)){const t=h(r);r=!0===t.isIPV6?`[${t.escapedHost}]`:d(r,!1)}i.push(r)}return"number"!=typeof t.port&&"string"!=typeof t.port||(i.push(":"),i.push(String(t.port))),i.length?i.join(""):void 0},reescapeHostDelimiters:d,normalizePercentEncoding:function(t,e=!1){if(-1===t.indexOf("%"))return t;let n="";for(let s=0;s<t.length;s++){if("%"===t[s]&&s+2<t.length){const o=t.slice(s+1,s+3);if(i(o)){const t=o.toUpperCase(),i=String.fromCharCode(parseInt(t,16));e&&r(i)?n+=i:n+="%"+t,s+=2;continue}}n+=t[s]}return n},normalizePathEncoding:function(t){let e="";for(let s=0;s<t.length;s++){if("%"===t[s]&&s+2<t.length){const n=t.slice(s+1,s+3);if(i(n)){const t=n.toUpperCase(),i=String.fromCharCode(parseInt(t,16));"."!==i&&r(i)?e+=i:e+="%"+t,s+=2;continue}}n(t[s])?e+=t[s]:e+=escape(t[s])}return e},escapePreservingEscapes:function(t){let e="";for(let r=0;r<t.length;r++){if("%"===t[r]&&r+2<t.length){const n=t.slice(r+1,r+3);if(i(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e},removeDotSegments:function(t){let e=t;const i=[];let r=-1,n=0;for(;n=e.length;){if(1===n){if("."===e)break;if("/"===e){i.push("/");break}i.push(e);break}if(2===n){if("."===e[0]){if("."===e[1])break;if("/"===e[1]){e=e.slice(2);continue}}else if("/"===e[0]&&("."===e[1]||"/"===e[1])){i.push("/");break}}else if(3===n&&"/.."===e){0!==i.length&&i.pop(),i.push("/");break}if("."===e[0]){if("."===e[1]){if("/"===e[2]){e=e.slice(3);continue}}else if("/"===e[1]){e=e.slice(2);continue}}else if("/"===e[0]&&"."===e[1]){if("/"===e[2]){e=e.slice(2);continue}if("."===e[2]&&"/"===e[3]){e=e.slice(3),0!==i.length&&i.pop();continue}}if(-1===(r=e.indexOf("/",1))){i.push(e);break}i.push(e.slice(0,r)),e=e.slice(r)}return i.join("")},isIPv4:e,isUUID:t,normalizeIPv6:h,stringArrayToHexStripped:s},Ei}function Ni(){if(ji)return Ci;ji=1,Object.defineProperty(Ci,"__esModule",{value:!0});const t=function(){if(xi)return Ti.exports;xi=1;const{normalizeIPv6:t,removeDotSegments:e,recomposeAuthority:i,normalizePercentEncoding:r,normalizePathEncoding:n,escapePreservingEscapes:s,reescapeHostDelimiters:o,isIPv4:a,nonSimpleDomain:u}=Ai(),{SCHEMES:h,getSchemeHandler:c}=function(){if(Si)return Oi;Si=1;const{isUUID:t}=Ai(),e=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,i=["http","https","ws","wss","urn","urn:uuid"];function r(t){return!0===t.secure||!1!==t.secure&&!!t.scheme&&!(3!==t.scheme.length||"w"!==t.scheme[0]&&"W"!==t.scheme[0]||"s"!==t.scheme[1]&&"S"!==t.scheme[1]||"s"!==t.scheme[2]&&"S"!==t.scheme[2])}function n(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function s(t){const e="https"===String(t.scheme).toLowerCase();return t.port!==(e?443:80)&&""!==t.port||(t.port=void 0),t.path||(t.path="/"),t}const o={scheme:"http",domainHost:!0,parse:n,serialize:s},a={scheme:"ws",domainHost:!0,parse:function(t){return t.secure=r(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t},serialize:function(t){if(t.port!==(r(t)?443:80)&&""!==t.port||(t.port=void 0),"boolean"==typeof t.secure&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){const[e,i]=t.resourceName.split("?");t.path=e&&"/"!==e?e:void 0,t.query=i,t.resourceName=void 0}return t.fragment=void 0,t}},u={scheme:"urn",parse:function(t,i){if(!t.path)return t.error="URN can not be parsed",t;const r=t.path.match(e);if(r){const e=i.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];const n=c(`${e}:${i.nid||t.nid}`);t.path=void 0,n&&(t=n.parse(t,i))}else t.error=t.error||"URN can not be parsed.";return t},serialize:function(t,e){if(void 0===t.nid)throw new Error("URN without nid cannot be serialized");const i=e.scheme||t.scheme||"urn",r=t.nid.toLowerCase(),n=c(`${i}:${e.nid||r}`);n&&(t=n.serialize(t,e));const s=t;return s.path=`${r||e.nid}:${t.nss}`,e.skipEscape=!0,s},skipNormalize:!0},h={http:o,https:{scheme:"https",domainHost:o.domainHost,parse:n,serialize:s},ws:a,wss:{scheme:"wss",domainHost:a.domainHost,parse:a.parse,serialize:a.serialize},urn:u,"urn:uuid":{scheme:"urn:uuid",parse:function(e,i){const r=e;return r.uuid=r.nss,r.nss=void 0,i.tolerant||r.uuid&&t(r.uuid)||(r.error=r.error||"UUID is not valid."),r},serialize:function(t){const e=t;return e.nss=(t.uuid||"").toLowerCase(),e},skipNormalize:!0}};function c(t){return t&&(h[t]||h[t.toLowerCase()])||void 0}return Object.setPrototypeOf(h,null),Oi={wsIsSecure:r,SCHEMES:h,isValidSchemeName:function(t){return-1!==i.indexOf(t)},getSchemeHandler:c}}();function f(t,i,r,n){const s={};return n||(t=y(l(t,r),r),i=y(l(i,r),r)),!(r=r||{}).tolerant&&i.scheme?(s.scheme=i.scheme,s.userinfo=i.userinfo,s.host=i.host,s.port=i.port,s.path=e(i.path||""),s.query=i.query):(void 0!==i.userinfo||void 0!==i.host||void 0!==i.port?(s.userinfo=i.userinfo,s.host=i.host,s.port=i.port,s.path=e(i.path||""),s.query=i.query):(i.path?("/"===i.path[0]?s.path=e(i.path):(s.path=void 0===t.userinfo&&void 0===t.host&&void 0===t.port||t.path?t.path?t.path.slice(0,t.path.lastIndexOf("/")+1)+i.path:i.path:"/"+i.path,s.path=e(s.path)),s.query=i.query):(s.path=t.path,s.query=void 0!==i.query?i.query:t.query),s.userinfo=t.userinfo,s.host=t.host,s.port=t.port),s.scheme=t.scheme),s.fragment=i.fragment,s}function l(t,n){const o={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},a=Object.assign({},n),u=[],h=c(a.scheme||o.scheme);h&&h.serialize&&h.serialize(o,a),void 0!==o.path&&(a.skipEscape?o.path=r(o.path):(o.path=s(o.path),void 0!==o.scheme&&(o.path=o.path.split("%3A").join(":")))),"suffix"!==a.reference&&o.scheme&&u.push(o.scheme,":");const f=i(o);if(void 0!==f&&("suffix"!==a.reference&&u.push("//"),u.push(f),o.path&&"/"!==o.path[0]&&u.push("/")),void 0!==o.path){let t=o.path;a.absolutePath||h&&h.absolutePath||(t=e(t)),void 0===f&&"/"===t[0]&&"/"===t[1]&&(t="/%2F"+t.slice(2)),u.push(t)}return void 0!==o.query&&u.push("?",o.query),void 0!==o.fragment&&u.push("#",o.fragment),u.join("")}const d=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,p=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,m=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function v(e,i){const r=Object.assign({},i),s={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let h=!1,f=!1;"suffix"===r.reference&&(e=r.scheme?r.scheme+":"+e:"//"+e);const l=e.match(p);null!==l&&-1!==l[1].indexOf("\\")&&(s.error="URI authority must not contain a literal backslash.",h=!0);const v=e.match(m);if(null!==v){const t=v[1],e=t.replace(/[\t\n\r]/g,"");e.length>=2&&("//"!==e.slice(0,2)?(s.error=s.error||"URI authority must not contain a literal backslash.",h=!0):t.length!==e.length&&(s.error=s.error||"URI authority introducer must not contain whitespace.",h=!0))}const y=e.match(d);if(y){s.scheme=y[1],s.userinfo=y[3],s.host=y[4],s.port=parseInt(y[5],10),s.path=y[6]||"",s.query=y[7],s.fragment=y[8],isNaN(s.port)&&(s.port=y[5]);const i=function(t,e){return void 0!==e[2]&&t.path&&"/"!==t.path[0]?'URI path must start with "/" when authority is present.':"number"==typeof t.port&&(t.port<0||t.port>65535)?"URI port is malformed.":void 0}(s,y);if(void 0!==i&&(s.error=s.error||i,h=!0),s.host)if(!1===a(s.host)){const e=t(s.host);s.host=e.host.toLowerCase(),f=e.isIPV6}else f=!0;s.reference=void 0!==s.scheme||void 0!==s.userinfo||void 0!==s.host||void 0!==s.port||void 0!==s.query||s.path?void 0===s.scheme?"relative":void 0===s.fragment?"absolute":"uri":"same-document",r.reference&&"suffix"!==r.reference&&r.reference!==s.reference&&(s.error=s.error||"URI is not a "+r.reference+" reference.");const l=c(r.scheme||s.scheme);if(!(r.unicodeSupport||l&&l.unicodeSupport)&&s.host&&(r.domainHost||l&&l.domainHost)&&!1===f&&u(s.host))try{s.host=new URL("http://"+s.host).hostname}catch(t){s.error=s.error||"Host's domain name can not be converted to ASCII: "+t}if((!l||l&&!l.skipNormalize)&&(-1!==e.indexOf("%")&&(void 0!==s.scheme&&(s.scheme=unescape(s.scheme)),void 0!==s.host&&(s.host=o(unescape(s.host),f))),s.path&&(s.path=n(s.path)),s.fragment))try{s.fragment=encodeURI(decodeURIComponent(s.fragment))}catch{s.error=s.error||"URI malformed"}l&&l.parse&&l.parse(s,r)}else s.error=s.error||"URI can not be parsed.";return{parsed:s,malformedAuthorityOrPort:h}}function y(t,e){return v(t,e).parsed}function g(t,e){const{parsed:i,malformedAuthorityOrPort:r}=v(t,e);return{normalized:r?t:l(i,e),malformedAuthorityOrPort:r}}function $(t,e){if("string"==typeof t){const{normalized:i,malformedAuthorityOrPort:r}=g(t,e);return r?void 0:i}if("object"==typeof t)return l(t,e)}const w={SCHEMES:h,normalize:function(t,e){return"string"==typeof t?t=function(t,e){return g(t,e).normalized}(t,e):"object"==typeof t&&(t=y(l(t,e),e)),t},resolve:function(t,e,i){const r=i?Object.assign({scheme:"null"},i):{scheme:"null"},{parsed:n,malformedAuthorityOrPort:s}=v(t,r),{parsed:o,malformedAuthorityOrPort:a}=v(e,r);if(s||a)throw new Error(n.error||o.error||"URI is malformed.");const u=f(n,o,r,!0);return r.skipEscape=!0,l(u,r)},resolveComponent:f,equal:function(t,e,i){const r=$(t,i),n=$(e,i);return void 0!==r&&void 0!==n&&r.toLowerCase()===n.toLowerCase()},serialize:l,parse:y};return Ti.exports=w,Ti.exports.default=w,Ti.exports.fastUri=w,Ti.exports}();return t.code='require("ajv/dist/runtime/uri").default',Ci.default=t,Ci}function Mi(){return Ii||(Ii=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=di();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return e.KeywordCxt}});var i=Oe();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return i.CodeGen}});const r=vi(),n=$i(),s=Le(),o=_i(),a=Oe(),u=li(),h=Ve(),c=je(),f=Pi,l=Ni(),d=(t,e)=>new RegExp(t,e);d.code="new RegExp";const p=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={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."},y={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function g(t){var e,i,r,n,s,o,a,u,h,c,f,p,m,v,y,g,$,w,b,_,E,k,O,S,x;const j=t.strict,I=null===(e=t.code)||void 0===e?void 0:e.optimize,P=!0===I||void 0===I?1:I||0,C=null!==(r=null===(i=t.code)||void 0===i?void 0:i.regExp)&&void 0!==r?r:d,T=null!==(n=t.uriResolver)&&void 0!==n?n:l.default;return{strictSchema:null===(o=null!==(s=t.strictSchema)&&void 0!==s?s:j)||void 0===o||o,strictNumbers:null===(u=null!==(a=t.strictNumbers)&&void 0!==a?a:j)||void 0===u||u,strictTypes:null!==(c=null!==(h=t.strictTypes)&&void 0!==h?h:j)&&void 0!==c?c:"log",strictTuples:null!==(p=null!==(f=t.strictTuples)&&void 0!==f?f:j)&&void 0!==p?p:"log",strictRequired:null!==(v=null!==(m=t.strictRequired)&&void 0!==m?m:j)&&void 0!==v&&v,code:t.code?{...t.code,optimize:P,regExp:C}:{optimize:P,regExp:C},loopRequired:null!==(y=t.loopRequired)&&void 0!==y?y:200,loopEnum:null!==(g=t.loopEnum)&&void 0!==g?g:200,meta:null===($=t.meta)||void 0===$||$,messages:null===(w=t.messages)||void 0===w||w,inlineRefs:null===(b=t.inlineRefs)||void 0===b||b,schemaId:null!==(_=t.schemaId)&&void 0!==_?_:"$id",addUsedSchema:null===(E=t.addUsedSchema)||void 0===E||E,validateSchema:null===(k=t.validateSchema)||void 0===k||k,validateFormats:null===(O=t.validateFormats)||void 0===O||O,unicodeRegExp:null===(S=t.unicodeRegExp)||void 0===S||S,int32range:null===(x=t.int32range)||void 0===x||x,uriResolver:T}}class ${constructor(t={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...g(t)};const{es5:e,lines:i}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:m,es5:e,lines:i}),this.logger=function(t){if(!1===t)return S;if(void 0===t)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}(t.logger);const r=t.validateFormats;t.validateFormats=!1,this.RULES=(0,s.getRules)(),w.call(this,v,t,"NOT SUPPORTED"),w.call(this,y,t,"DEPRECATED","warn"),this._metaOpts=O.call(this),t.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&k.call(this,t.keywords),"object"==typeof t.meta&&this.addMetaSchema(t.meta),_.call(this),t.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:t,meta:e,schemaId:i}=this.opts;let r=f;"id"===i&&(r={...f},r.id=r.$id,delete r.$id),e&&t&&this.addMetaSchema(r,r[i],!1)}defaultMeta(){const{meta:t,schemaId:e}=this.opts;return this.opts.defaultMeta="object"==typeof t?t[e]||t:void 0}validate(t,e){let i;if("string"==typeof t){if(i=this.getSchema(t),!i)throw new Error(`no schema with key or ref "${t}"`)}else i=this.compile(t);const r=i(e);return"$async"in i||(this.errors=i.errors),r}compile(t,e){const i=this._addSchema(t,e);return i.validate||this._compileSchemaEnv(i)}compileAsync(t,e){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:i}=this.opts;return r.call(this,t,e);async function r(t,e){await s.call(this,t.$schema);const i=this._addSchema(t,e);return i.validate||o.call(this,i)}async function s(t){t&&!this.getSchema(t)&&await r.call(this,{$ref:t},!0)}async function o(t){try{return this._compileSchemaEnv(t)}catch(e){if(!(e instanceof n.default))throw e;return a.call(this,e),await u.call(this,e.missingSchema),o.call(this,t)}}function a({missingSchema:t,missingRef:e}){if(this.refs[t])throw new Error(`AnySchema ${t} is loaded but ${e} cannot be resolved`)}async function u(t){const i=await h.call(this,t);this.refs[t]||await s.call(this,i.$schema),this.refs[t]||this.addSchema(i,t,e)}async function h(t){const e=this._loading[t];if(e)return e;try{return await(this._loading[t]=i(t))}finally{delete this._loading[t]}}}addSchema(t,e,i,r=this.opts.validateSchema){if(Array.isArray(t)){for(const e of t)this.addSchema(e,void 0,i,r);return this}let n;if("object"==typeof t){const{schemaId:e}=this.opts;if(n=t[e],void 0!==n&&"string"!=typeof n)throw new Error(`schema ${e} must be string`)}return e=(0,u.normalizeId)(e||n),this._checkUnique(e),this.schemas[e]=this._addSchema(t,i,e,r,!0),this}addMetaSchema(t,e,i=this.opts.validateSchema){return this.addSchema(t,e,!0,i),this}validateSchema(t,e){if("boolean"==typeof t)return!0;let i;if(i=t.$schema,void 0!==i&&"string"!=typeof i)throw new Error("$schema must be a string");if(i=i||this.opts.defaultMeta||this.defaultMeta(),!i)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const r=this.validate(i,t);if(!r&&e){const t="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(t);this.logger.error(t)}return r}getSchema(t){let e;for(;"string"==typeof(e=b.call(this,t));)t=e;if(void 0===e){const{schemaId:i}=this.opts,r=new o.SchemaEnv({schema:{},schemaId:i});if(e=o.resolveSchema.call(this,r,t),!e)return;this.refs[t]=e}return e.validate||this._compileSchemaEnv(e)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const e=b.call(this,t);return"object"==typeof e&&this._cache.delete(e.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{this._cache.delete(t);let e=t[this.opts.schemaId];return e&&(e=(0,u.normalizeId)(e),delete this.schemas[e],delete this.refs[e]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(const e of t)this.addKeyword(e);return this}addKeyword(t,e){let i;if("string"==typeof t)i=t,"object"==typeof e&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),e.keyword=i);else{if("object"!=typeof t||void 0!==e)throw new Error("invalid addKeywords parameters");if(i=(e=t).keyword,Array.isArray(i)&&!i.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(j.call(this,i,e),!e)return(0,c.eachItem)(i,(t=>I.call(this,t))),this;C.call(this,e);const r={...e,type:(0,h.getJSONTypes)(e.type),schemaType:(0,h.getJSONTypes)(e.schemaType)};return(0,c.eachItem)(i,0===r.type.length?t=>I.call(this,t,r):t=>r.type.forEach((e=>I.call(this,t,r,e)))),this}getKeyword(t){const e=this.RULES.all[t];return"object"==typeof e?e.definition:!!e}removeKeyword(t){const{RULES:e}=this;delete e.keywords[t],delete e.all[t];for(const i of e.rules){const e=i.rules.findIndex((e=>e.keyword===t));e>=0&&i.rules.splice(e,1)}return this}addFormat(t,e){return"string"==typeof e&&(e=new RegExp(e)),this.formats[t]=e,this}errorsText(t=this.errors,{separator:e=", ",dataVar:i="data"}={}){return t&&0!==t.length?t.map((t=>`${i}${t.instancePath} ${t.message}`)).reduce(((t,i)=>t+e+i)):"No errors"}$dataMetaSchema(t,e){const i=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(const r of e){const e=r.split("/").slice(1);let n=t;for(const t of e)n=n[t];for(const t in i){const e=i[t];if("object"!=typeof e)continue;const{$data:r}=e.definition,s=n[t];r&&s&&(n[t]=A(s))}}return t}_removeAllSchemas(t,e){for(const i in t){const r=t[i];e&&!e.test(i)||("string"==typeof r?delete t[i]:r&&!r.meta&&(this._cache.delete(r.schema),delete t[i]))}}_addSchema(t,e,i,r=this.opts.validateSchema,n=this.opts.addUsedSchema){let s;const{schemaId:a}=this.opts;if("object"==typeof t)s=t[a];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof t)throw new Error("schema must be object or boolean")}let h=this._cache.get(t);if(void 0!==h)return h;i=(0,u.normalizeId)(s||i);const c=u.getSchemaRefs.call(this,t,i);return h=new o.SchemaEnv({schema:t,schemaId:a,meta:e,baseId:i,localRefs:c}),this._cache.set(h.schema,h),n&&!i.startsWith("#")&&(i&&this._checkUnique(i),this.refs[i]=h),r&&this.validateSchema(t,!0),h}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):o.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){const e=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,t)}finally{this.opts=e}}}function w(t,e,i,r="error"){for(const n in t)n in e&&this.logger[r](`${i}: option ${n}. ${t[n]}`)}function b(t){return t=(0,u.normalizeId)(t),this.schemas[t]||this.refs[t]}function _(){const t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(const e in t)this.addSchema(t[e],e)}function E(){for(const t in this.opts.formats){const e=this.opts.formats[t];e&&this.addFormat(t,e)}}function k(t){if(Array.isArray(t))this.addVocabulary(t);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const e in t){const i=t[e];i.keyword||(i.keyword=e),this.addKeyword(i)}}}function O(){const t={...this.opts};for(const e of p)delete t[e];return t}$.ValidationError=r.default,$.MissingRefError=n.default,t.default=$;const S={log(){},warn(){},error(){}},x=/^[a-z_$][a-z0-9_$:-]*$/i;function j(t,e){const{RULES:i}=this;if((0,c.eachItem)(t,(t=>{if(i.keywords[t])throw new Error(`Keyword ${t} is already defined`);if(!x.test(t))throw new Error(`Keyword ${t} has invalid name`)})),e&&e.$data&&!("code"in e)&&!("validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function I(t,e,i){var r;const n=null==e?void 0:e.post;if(i&&n)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:s}=this;let o=n?s.post:s.rules.find((({type:t})=>t===i));if(o||(o={type:i,rules:[]},s.rules.push(o)),s.keywords[t]=!0,!e)return;const a={keyword:t,definition:{...e,type:(0,h.getJSONTypes)(e.type),schemaType:(0,h.getJSONTypes)(e.schemaType)}};e.before?P.call(this,o,a,e.before):o.rules.push(a),s.all[t]=a,null===(r=e.implements)||void 0===r||r.forEach((t=>this.addKeyword(t)))}function P(t,e,i){const r=t.rules.findIndex((t=>t.keyword===i));r>=0?t.rules.splice(r,0,e):(t.rules.push(e),this.logger.warn(`rule ${i} is not defined`))}function C(t){let{metaSchema:e}=t;void 0!==e&&(t.$data&&this.opts.$data&&(e=A(e)),t.validateSchema=this.compile(e,!0))}const T={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function A(t){return{anyOf:[t,T]}}}(pe)),pe}var Ri,Di={},zi={},Li={};function Ui(){return Ri||(Ri=1,Object.defineProperty(Li,"__esModule",{value:!0}),Li.default={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}}),Li}var qi,Fi,Bi={};function Vi(){if(qi)return Bi;qi=1,Object.defineProperty(Bi,"__esModule",{value:!0}),Bi.callRef=Bi.getValidate=void 0;const t=$i(),e=Ye(),i=Oe(),r=Ae(),n=_i(),s=je(),o={keyword:"$ref",schemaType:"string",code(e){const{gen:r,schema:s,it:o}=e,{baseId:h,schemaEnv:c,validateName:f,opts:l,self:d}=o,{root:p}=c;if(("#"===s||"#/"===s)&&h===p.baseId)return function(){if(c===p)return u(e,f,c,c.$async);const t=r.scopeValue("root",{ref:p});return u(e,i._`${t}.validate`,p,p.$async)}();const m=n.resolveRef.call(d,p,h,s);if(void 0===m)throw new t.default(o.opts.uriResolver,h,s);return m instanceof n.SchemaEnv?function(t){const i=a(e,t);u(e,i,t,t.$async)}(m):function(t){const n=r.scopeValue("schema",!0===l.code.source?{ref:t,code:(0,i.stringify)(t)}:{ref:t}),o=r.name("valid"),a=e.subschema({schema:t,dataTypes:[],schemaPath:i.nil,topSchemaRef:n,errSchemaPath:s},o);e.mergeEvaluated(a),e.ok(o)}(m)}};function a(t,e){const{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):i._`${r.scopeValue("wrapper",{ref:e})}.validate`}function u(t,n,o,a){const{gen:u,it:h}=t,{allErrors:c,schemaEnv:f,opts:l}=h,d=l.passContext?r.default.this:i.nil;function p(t){const e=i._`${t}.errors`;u.assign(r.default.vErrors,i._`${r.default.vErrors} === null ? ${e} : ${r.default.vErrors}.concat(${e})`),u.assign(r.default.errors,i._`${r.default.vErrors}.length`)}function m(t){var e;if(!h.opts.unevaluated)return;const r=null===(e=null==o?void 0:o.validate)||void 0===e?void 0:e.evaluated;if(!0!==h.props)if(r&&!r.dynamicProps)void 0!==r.props&&(h.props=s.mergeEvaluated.props(u,r.props,h.props));else{const e=u.var("props",i._`${t}.evaluated.props`);h.props=s.mergeEvaluated.props(u,e,h.props,i.Name)}if(!0!==h.items)if(r&&!r.dynamicItems)void 0!==r.items&&(h.items=s.mergeEvaluated.items(u,r.items,h.items));else{const e=u.var("items",i._`${t}.evaluated.items`);h.items=s.mergeEvaluated.items(u,e,h.items,i.Name)}}a?function(){if(!f.$async)throw new Error("async schema referenced by sync schema");const r=u.let("valid");u.try((()=>{u.code(i._`await ${(0,e.callValidateCode)(t,n,d)}`),m(n),c||u.assign(r,!0)}),(t=>{u.if(i._`!(${t} instanceof ${h.ValidationError})`,(()=>u.throw(t))),p(t),c||u.assign(r,!1)})),t.ok(r)}():t.result((0,e.callValidateCode)(t,n,d),(()=>m(n)),(()=>p(n)))}return Bi.getValidate=a,Bi.callRef=u,Bi.default=o,Bi}function Gi(){return Fi||(Fi=1,Object.defineProperty(zi,"__esModule",{value:!0}),zi.default=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Ui().default,Vi().default]),zi}var Hi,Ki={},Wi={};function Ji(){if(Hi)return Wi;Hi=1,Object.defineProperty(Wi,"__esModule",{value:!0});const t=Oe(),e=t.operators,i={maximum:{okStr:"<=",ok:e.LTE,fail:e.GT},minimum:{okStr:">=",ok:e.GTE,fail:e.LT},exclusiveMaximum:{okStr:"<",ok:e.LT,fail:e.GTE},exclusiveMinimum:{okStr:">",ok:e.GT,fail:e.LTE}},r={message:({keyword:e,schemaCode:r})=>t.str`must be ${i[e].okStr} ${r}`,params:({keyword:e,schemaCode:r})=>t._`{comparison: ${i[e].okStr}, limit: ${r}}`},n={keyword:Object.keys(i),type:"number",schemaType:"number",$data:!0,error:r,code(e){const{keyword:r,data:n,schemaCode:s}=e;e.fail$data(t._`${n} ${i[r].fail} ${s} || isNaN(${n})`)}};return Wi.default=n,Wi}var Zi,Xi={};function Yi(){if(Zi)return Xi;Zi=1,Object.defineProperty(Xi,"__esModule",{value:!0});const t=Oe(),e={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>t.str`must be multiple of ${e}`,params:({schemaCode:e})=>t._`{multipleOf: ${e}}`},code(e){const{gen:i,data:r,schemaCode:n,it:s}=e,o=s.opts.multipleOfPrecision,a=i.let("res"),u=o?t._`Math.abs(Math.round(${a}) - ${a}) > 1e-${o}`:t._`${a} !== parseInt(${a})`;e.fail$data(t._`(${n} === 0 || (${a} = ${r}/${n}, ${u}))`)}};return Xi.default=e,Xi}var Qi,tr,er={},ir={};function rr(){if(Qi)return ir;function t(t){const e=t.length;let i,r=0,n=0;for(;n<e;)r++,i=t.charCodeAt(n++),i>=55296&&i<=56319&&n<e&&(i=t.charCodeAt(n),56320==(64512&i)&&n++);return r}return Qi=1,Object.defineProperty(ir,"__esModule",{value:!0}),ir.default=t,t.code='require("ajv/dist/runtime/ucs2length").default',ir}function nr(){if(tr)return er;tr=1,Object.defineProperty(er,"__esModule",{value:!0});const t=Oe(),e=je(),i=rr(),r={message:({keyword:e,schemaCode:i})=>t.str`must NOT have ${"maxLength"===e?"more":"fewer"} than ${i} characters`,params:({schemaCode:e})=>t._`{limit: ${e}}`},n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:r,code(r){const{keyword:n,data:s,schemaCode:o,it:a}=r,u="maxLength"===n?t.operators.GT:t.operators.LT,h=!1===a.opts.unicode?t._`${s}.length`:t._`${(0,e.useFunc)(r.gen,i.default)}(${s})`;r.fail$data(t._`${h} ${u} ${o}`)}};return er.default=n,er}var sr,or={};function ar(){if(sr)return or;sr=1,Object.defineProperty(or,"__esModule",{value:!0});const t=Ye(),e=je(),i=Oe(),r={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>i.str`must match pattern "${t}"`,params:({schemaCode:t})=>i._`{pattern: ${t}}`},code(r){const{gen:n,data:s,$data:o,schema:a,schemaCode:u,it:h}=r,c=h.opts.unicodeRegExp?"u":"";if(o){const{regExp:t}=h.opts.code,o="new RegExp"===t.code?i._`new RegExp`:(0,e.useFunc)(n,t),a=n.let("valid");n.try((()=>n.assign(a,i._`${o}(${u}, ${c}).test(${s})`)),(()=>n.assign(a,!1))),r.fail$data(i._`!${a}`)}else{const e=(0,t.usePattern)(r,a);r.fail$data(i._`!${e}.test(${s})`)}}};return or.default=r,or}var ur,hr={};function cr(){if(ur)return hr;ur=1,Object.defineProperty(hr,"__esModule",{value:!0});const t=Oe(),e={message:({keyword:e,schemaCode:i})=>t.str`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${i} properties`,params:({schemaCode:e})=>t._`{limit: ${e}}`},i={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:e,code(e){const{keyword:i,data:r,schemaCode:n}=e;e.fail$data(t._`Object.keys(${r}).length ${"maxProperties"===i?t.operators.GT:t.operators.LT} ${n}`)}};return hr.default=i,hr}var fr,lr={};function dr(){if(fr)return lr;fr=1,Object.defineProperty(lr,"__esModule",{value:!0});const t=Ye(),e=Oe(),i=je(),r={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:t}})=>e.str`must have required property '${t}'`,params:({params:{missingProperty:t}})=>e._`{missingProperty: ${t}}`},code(r){const{gen:n,schema:s,schemaCode:o,data:a,$data:u,it:h}=r,{opts:c}=h;if(!u&&0===s.length)return;const f=s.length>=c.loopRequired;if(h.allErrors?function(){if(f||u)r.block$data(e.nil,l);else for(const e of s)(0,t.checkReportMissingProp)(r,e)}():function(){const i=n.let("missing");if(f||u){const s=n.let("valid",!0);r.block$data(s,(()=>function(i,s){r.setParams({missingProperty:i}),n.forOf(i,o,(()=>{n.assign(s,(0,t.propertyInData)(n,a,i,c.ownProperties)),n.if((0,e.not)(s),(()=>{r.error(),n.break()}))}),e.nil)}(i,s))),r.ok(s)}else n.if((0,t.checkMissingProp)(r,s,i)),(0,t.reportMissingProp)(r,i),n.else()}(),c.strictRequired){const t=r.parentSchema.properties,{definedProperties:e}=r.it;for(const r of s)void 0!==(null==t?void 0:t[r])||e.has(r)||(0,i.checkStrictMode)(h,`required property "${r}" is not defined at "${h.schemaEnv.baseId+h.errSchemaPath}" (strictRequired)`,h.opts.strictRequired)}function l(){n.forOf("prop",o,(e=>{r.setParams({missingProperty:e}),n.if((0,t.noPropertyInData)(n,a,e,c.ownProperties),(()=>r.error()))}))}}};return lr.default=r,lr}var pr,mr={};function vr(){if(pr)return mr;pr=1,Object.defineProperty(mr,"__esModule",{value:!0});const t=Oe(),e={message:({keyword:e,schemaCode:i})=>t.str`must NOT have ${"maxItems"===e?"more":"fewer"} than ${i} items`,params:({schemaCode:e})=>t._`{limit: ${e}}`},i={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:e,code(e){const{keyword:i,data:r,schemaCode:n}=e;e.fail$data(t._`${r}.length ${"maxItems"===i?t.operators.GT:t.operators.LT} ${n}`)}};return mr.default=i,mr}var yr,gr,$r={},wr={};function br(){if(yr)return wr;yr=1,Object.defineProperty(wr,"__esModule",{value:!0});const t=oi();return t.code='require("ajv/dist/runtime/equal").default',wr.default=t,wr}function _r(){if(gr)return $r;gr=1,Object.defineProperty($r,"__esModule",{value:!0});const t=Ve(),e=Oe(),i=je(),r=br(),n={message:({params:{i:t,j:i}})=>e.str`must NOT have duplicate items (items ## ${i} and ${t} are identical)`,params:({params:{i:t,j:i}})=>e._`{i: ${t}, j: ${i}}`},s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:n,code(n){const{gen:s,data:o,$data:a,schema:u,parentSchema:h,schemaCode:c,it:f}=n;if(!a&&!u)return;const l=s.let("valid"),d=h.items?(0,t.getSchemaTypes)(h.items):[];function p(i,r){const a=s.name("item"),u=(0,t.checkDataTypes)(d,a,f.opts.strictNumbers,t.DataType.Wrong),h=s.const("indices",e._`{}`);s.for(e._`;${i}--;`,(()=>{s.let(a,e._`${o}[${i}]`),s.if(u,e._`continue`),d.length>1&&s.if(e._`typeof ${a} == "string"`,e._`${a} += "_"`),s.if(e._`typeof ${h}[${a}] == "number"`,(()=>{s.assign(r,e._`${h}[${a}]`),n.error(),s.assign(l,!1).break()})).code(e._`${h}[${a}] = ${i}`)}))}function m(t,a){const u=(0,i.useFunc)(s,r.default),h=s.name("outer");s.label(h).for(e._`;${t}--;`,(()=>s.for(e._`${a} = ${t}; ${a}--;`,(()=>s.if(e._`${u}(${o}[${t}], ${o}[${a}])`,(()=>{n.error(),s.assign(l,!1).break(h)}))))))}n.block$data(l,(function(){const t=s.let("i",e._`${o}.length`),i=s.let("j");n.setParams({i:t,j:i}),s.assign(l,!0),s.if(e._`${t} > 1`,(()=>(d.length>0&&!d.some((t=>"object"===t||"array"===t))?p:m)(t,i)))}),e._`${c} === false`),n.ok(l)}};return $r.default=s,$r}var Er,kr={};function Or(){if(Er)return kr;Er=1,Object.defineProperty(kr,"__esModule",{value:!0});const t=Oe(),e=je(),i=br(),r={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>t._`{allowedValue: ${e}}`},code(r){const{gen:n,data:s,$data:o,schemaCode:a,schema:u}=r;o||u&&"object"==typeof u?r.fail$data(t._`!${(0,e.useFunc)(n,i.default)}(${s}, ${a})`):r.fail(t._`${u} !== ${s}`)}};return kr.default=r,kr}var Sr,xr,jr={};function Ir(){if(Sr)return jr;Sr=1,Object.defineProperty(jr,"__esModule",{value:!0});const t=Oe(),e=je(),i=br(),r={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>t._`{allowedValues: ${e}}`},code(r){const{gen:n,data:s,$data:o,schema:a,schemaCode:u,it:h}=r;if(!o&&0===a.length)throw new Error("enum must have non-empty array");let c;const f=()=>null!=c?c:c=(0,e.useFunc)(n,i.default);let l;if(a.length>=h.opts.loopEnum||o)l=n.let("valid"),r.block$data(l,(function(){n.assign(l,!1),n.forOf("v",u,(e=>n.if(t._`${f()}(${s}, ${e})`,(()=>n.assign(l,!0).break()))))}));else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=n.const("vSchema",u);l=(0,t.or)(...a.map(((i,r)=>function(e,i){const r=a[i];return"object"==typeof r&&null!==r?t._`${f()}(${s}, ${e}[${i}])`:t._`${s} === ${r}`}(e,r))))}r.pass(l)}};return jr.default=r,jr}function Pr(){return xr||(xr=1,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.default=[Ji().default,Yi().default,nr().default,ar().default,cr().default,dr().default,vr().default,_r().default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Or().default,Ir().default]),Ki}var Cr,Tr={},Ar={};function Nr(){if(Cr)return Ar;Cr=1,Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.validateAdditionalItems=void 0;const t=Oe(),e=je(),i={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>t.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>t._`{limit: ${e}}`},code(t){const{parentSchema:i,it:n}=t,{items:s}=i;Array.isArray(s)?r(t,s):(0,e.checkStrictMode)(n,'"additionalItems" is ignored when "items" is not an array of schemas')}};function r(i,r){const{gen:n,schema:s,data:o,keyword:a,it:u}=i;u.items=!0;const h=n.const("len",t._`${o}.length`);if(!1===s)i.setParams({len:r.length}),i.pass(t._`${h} <= ${r.length}`);else if("object"==typeof s&&!(0,e.alwaysValidSchema)(u,s)){const s=n.var("valid",t._`${h} <= ${r.length}`);n.if((0,t.not)(s),(()=>function(s){n.forRange("i",r.length,h,(r=>{i.subschema({keyword:a,dataProp:r,dataPropType:e.Type.Num},s),u.allErrors||n.if((0,t.not)(s),(()=>n.break()))}))}(s))),i.ok(s)}}return Ar.validateAdditionalItems=r,Ar.default=i,Ar}var Mr,Rr,Dr={},zr={};function Lr(){if(Mr)return zr;Mr=1,Object.defineProperty(zr,"__esModule",{value:!0}),zr.validateTuple=void 0;const t=Oe(),e=je(),i=Ye(),r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){const{schema:r,it:s}=t;if(Array.isArray(r))return n(t,"additionalItems",r);s.items=!0,(0,e.alwaysValidSchema)(s,r)||t.ok((0,i.validateArray)(t))}};function n(i,r,n=i.schema){const{gen:s,parentSchema:o,data:a,keyword:u,it:h}=i;!function(t){const{opts:i,errSchemaPath:s}=h,o=n.length;i.strictTuples&&!(o===t.minItems&&(o===t.maxItems||!1===t[r]))&&(0,e.checkStrictMode)(h,`"${u}" is ${o}-tuple, but minItems or maxItems/${r} are not specified or different at path "${s}"`,i.strictTuples)}(o),h.opts.unevaluated&&n.length&&!0!==h.items&&(h.items=e.mergeEvaluated.items(s,n.length,h.items));const c=s.name("valid"),f=s.const("len",t._`${a}.length`);n.forEach(((r,n)=>{(0,e.alwaysValidSchema)(h,r)||(s.if(t._`${f} > ${n}`,(()=>i.subschema({keyword:u,schemaProp:n,dataProp:n},c))),i.ok(c))}))}return zr.validateTuple=n,zr.default=r,zr}function Ur(){if(Rr)return Dr;Rr=1,Object.defineProperty(Dr,"__esModule",{value:!0});const t=Lr();return Dr.default={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,t.validateTuple)(e,"items")},Dr}var qr,Fr={};function Br(){if(qr)return Fr;qr=1,Object.defineProperty(Fr,"__esModule",{value:!0});const t=Oe(),e=je(),i=Ye(),r=Nr(),n={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>t.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>t._`{limit: ${e}}`},code(t){const{schema:n,parentSchema:s,it:o}=t,{prefixItems:a}=s;o.items=!0,(0,e.alwaysValidSchema)(o,n)||(a?(0,r.validateAdditionalItems)(t,a):t.ok((0,i.validateArray)(t)))}};return Fr.default=n,Fr}var Vr,Gr={};function Hr(){if(Vr)return Gr;Vr=1,Object.defineProperty(Gr,"__esModule",{value:!0});const t=Oe(),e=je(),i={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:i}})=>void 0===i?t.str`must contain at least ${e} valid item(s)`:t.str`must contain at least ${e} and no more than ${i} valid item(s)`,params:({params:{min:e,max:i}})=>void 0===i?t._`{minContains: ${e}}`:t._`{minContains: ${e}, maxContains: ${i}}`},code(i){const{gen:r,schema:n,parentSchema:s,data:o,it:a}=i;let u,h;const{minContains:c,maxContains:f}=s;a.opts.next?(u=void 0===c?1:c,h=f):u=1;const l=r.const("len",t._`${o}.length`);if(i.setParams({min:u,max:h}),void 0===h&&0===u)return void(0,e.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==h&&u>h)return(0,e.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void i.fail();if((0,e.alwaysValidSchema)(a,n)){let e=t._`${l} >= ${u}`;return void 0!==h&&(e=t._`${e} && ${l} <= ${h}`),void i.pass(e)}a.items=!0;const d=r.name("valid");function p(){const e=r.name("_valid"),i=r.let("count",0);m(e,(()=>r.if(e,(()=>function(e){r.code(t._`${e}++`),void 0===h?r.if(t._`${e} >= ${u}`,(()=>r.assign(d,!0).break())):(r.if(t._`${e} > ${h}`,(()=>r.assign(d,!1).break())),1===u?r.assign(d,!0):r.if(t._`${e} >= ${u}`,(()=>r.assign(d,!0))))}(i)))))}function m(t,n){r.forRange("i",0,l,(r=>{i.subschema({keyword:"contains",dataProp:r,dataPropType:e.Type.Num,compositeRule:!0},t),n()}))}void 0===h&&1===u?m(d,(()=>r.if(d,(()=>r.break())))):0===u?(r.let(d,!0),void 0!==h&&r.if(t._`${o}.length > 0`,p)):(r.let(d,!1),p()),i.result(d,(()=>i.reset()))}};return Gr.default=i,Gr}var Kr,Wr={};function Jr(){return Kr||(Kr=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const e=Oe(),i=je(),r=Ye();t.error={message:({params:{property:t,depsCount:i,deps:r}})=>e.str`must have ${1===i?"property":"properties"} ${r} when property ${t} is present`,params:({params:{property:t,depsCount:i,deps:r,missingProperty:n}})=>e._`{property: ${t},
5
5
  missingProperty: ${n},
6
6
  depsCount: ${i},
7
7
  deps: ${r}}`};const n={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(t){const[e,i]=function({schema:t}){const e={},i={};for(const r in t)"__proto__"!==r&&((Array.isArray(t[r])?e:i)[r]=t[r]);return[e,i]}(t);s(t,e),o(t,i)}};function s(t,i=t.schema){const{gen:n,data:s,it:o}=t;if(0===Object.keys(i).length)return;const a=n.let("missing");for(const u in i){const h=i[u];if(0===h.length)continue;const c=(0,r.propertyInData)(n,s,u,o.opts.ownProperties);t.setParams({property:u,depsCount:h.length,deps:h.join(", ")}),o.allErrors?n.if(c,(()=>{for(const e of h)(0,r.checkReportMissingProp)(t,e)})):(n.if(e._`${c} && (${(0,r.checkMissingProp)(t,h,a)})`),(0,r.reportMissingProp)(t,a),n.else())}}function o(t,e=t.schema){const{gen:n,data:s,keyword:o,it:a}=t,u=n.name("valid");for(const h in e)(0,i.alwaysValidSchema)(a,e[h])||(n.if((0,r.propertyInData)(n,s,h,a.opts.ownProperties),(()=>{const e=t.subschema({keyword:o,schemaProp:h},u);t.mergeValidEvaluated(e,u)}),(()=>n.var(u,!0))),t.ok(u))}t.validatePropertyDeps=s,t.validateSchemaDeps=o,t.default=n}(Wr)),Wr}var Zr,Xr={};function Yr(){if(Zr)return Xr;Zr=1,Object.defineProperty(Xr,"__esModule",{value:!0});const t=Oe(),e=je(),i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>t._`{propertyName: ${e.propertyName}}`},code(i){const{gen:r,schema:n,data:s,it:o}=i;if((0,e.alwaysValidSchema)(o,n))return;const a=r.name("valid");r.forIn("key",s,(e=>{i.setParams({propertyName:e}),i.subschema({keyword:"propertyNames",data:e,dataTypes:["string"],propertyName:e,compositeRule:!0},a),r.if((0,t.not)(a),(()=>{i.error(!0),o.allErrors||r.break()}))})),i.ok(a)}};return Xr.default=i,Xr}var Qr,tn={};function en(){if(Qr)return tn;Qr=1,Object.defineProperty(tn,"__esModule",{value:!0});const t=Ye(),e=Oe(),i=Ae(),r=je(),n={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:t})=>e._`{additionalProperty: ${t.additionalProperty}}`},code(n){const{gen:s,schema:o,parentSchema:a,data:u,errsCount:h,it:c}=n;if(!h)throw new Error("ajv implementation error");const{allErrors:f,opts:l}=c;if(c.props=!0,"all"!==l.removeAdditional&&(0,r.alwaysValidSchema)(c,o))return;const d=(0,t.allSchemaProperties)(a.properties),p=(0,t.allSchemaProperties)(a.patternProperties);function m(t){s.code(e._`delete ${u}[${t}]`)}function v(t){if("all"===l.removeAdditional||l.removeAdditional&&!1===o)m(t);else{if(!1===o)return n.setParams({additionalProperty:t}),n.error(),void(f||s.break());if("object"==typeof o&&!(0,r.alwaysValidSchema)(c,o)){const i=s.name("valid");"failing"===l.removeAdditional?(y(t,i,!1),s.if((0,e.not)(i),(()=>{n.reset(),m(t)}))):(y(t,i),f||s.if((0,e.not)(i),(()=>s.break())))}}}function y(t,e,i){const s={keyword:"additionalProperties",dataProp:t,dataPropType:r.Type.Str};!1===i&&Object.assign(s,{compositeRule:!0,createErrors:!1,allErrors:!1}),n.subschema(s,e)}s.forIn("key",u,(i=>{d.length||p.length?s.if(function(i){let o;if(d.length>8){const e=(0,r.schemaRefOrVal)(c,a.properties,"properties");o=(0,t.isOwnProperty)(s,e,i)}else o=d.length?(0,e.or)(...d.map((t=>e._`${i} === ${t}`))):e.nil;return p.length&&(o=(0,e.or)(o,...p.map((r=>e._`${(0,t.usePattern)(n,r)}.test(${i})`)))),(0,e.not)(o)}(i),(()=>v(i))):v(i)})),n.ok(e._`${h} === ${i.default.errors}`)}};return tn.default=n,tn}var rn,nn={};function sn(){if(rn)return nn;rn=1,Object.defineProperty(nn,"__esModule",{value:!0});const t=di(),e=Ye(),i=je(),r=en(),n={keyword:"properties",type:"object",schemaType:"object",code(n){const{gen:s,schema:o,parentSchema:a,data:u,it:h}=n;"all"===h.opts.removeAdditional&&void 0===a.additionalProperties&&r.default.code(new t.KeywordCxt(h,r.default,"additionalProperties"));const c=(0,e.allSchemaProperties)(o);for(const t of c)h.definedProperties.add(t);h.opts.unevaluated&&c.length&&!0!==h.props&&(h.props=i.mergeEvaluated.props(s,(0,i.toHash)(c),h.props));const f=c.filter((t=>!(0,i.alwaysValidSchema)(h,o[t])));if(0===f.length)return;const l=s.name("valid");for(const t of f)d(t)?p(t):(s.if((0,e.propertyInData)(s,u,t,h.opts.ownProperties)),p(t),h.allErrors||s.else().var(l,!0),s.endIf()),n.it.definedProperties.add(t),n.ok(l);function d(t){return h.opts.useDefaults&&!h.compositeRule&&void 0!==o[t].default}function p(t){n.subschema({keyword:"properties",schemaProp:t,dataProp:t},l)}}};return nn.default=n,nn}var on,an={};function un(){if(on)return an;on=1,Object.defineProperty(an,"__esModule",{value:!0});const t=Ye(),e=Oe(),i=je(),r=je(),n={keyword:"patternProperties",type:"object",schemaType:"object",code(n){const{gen:s,schema:o,data:a,parentSchema:u,it:h}=n,{opts:c}=h,f=(0,t.allSchemaProperties)(o),l=f.filter((t=>(0,i.alwaysValidSchema)(h,o[t])));if(0===f.length||l.length===f.length&&(!h.opts.unevaluated||!0===h.props))return;const d=c.strictSchema&&!c.allowMatchingProperties&&u.properties,p=s.name("valid");!0===h.props||h.props instanceof e.Name||(h.props=(0,r.evaluatedPropsToName)(s,h.props));const{props:m}=h;function v(t){for(const e in d)new RegExp(t).test(e)&&(0,i.checkStrictMode)(h,`property ${e} matches pattern ${t} (use allowMatchingProperties)`)}function y(i){s.forIn("key",a,(o=>{s.if(e._`${(0,t.usePattern)(n,i)}.test(${o})`,(()=>{const t=l.includes(i);t||n.subschema({keyword:"patternProperties",schemaProp:i,dataProp:o,dataPropType:r.Type.Str},p),h.opts.unevaluated&&!0!==m?s.assign(e._`${m}[${o}]`,!0):t||h.allErrors||s.if((0,e.not)(p),(()=>s.break()))}))}))}!function(){for(const t of f)d&&v(t),h.allErrors?y(t):(s.var(p,!0),y(t),s.if(p))}()}};return an.default=n,an}var hn,cn={};function fn(){if(hn)return cn;hn=1,Object.defineProperty(cn,"__esModule",{value:!0});const t=je();return cn.default={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:i,schema:r,it:n}=e;if((0,t.alwaysValidSchema)(n,r))return void e.fail();const s=i.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),e.failResult(s,(()=>e.reset()),(()=>e.error()))},error:{message:"must NOT be valid"}},cn}var ln,dn={};function pn(){return ln||(ln=1,Object.defineProperty(dn,"__esModule",{value:!0}),dn.default={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Ye().validateUnion,error:{message:"must match a schema in anyOf"}}),dn}var mn,vn={};function yn(){if(mn)return vn;mn=1,Object.defineProperty(vn,"__esModule",{value:!0});const t=Oe(),e=je(),i={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>t._`{passingSchemas: ${e.passing}}`},code(i){const{gen:r,schema:n,parentSchema:s,it:o}=i;if(!Array.isArray(n))throw new Error("ajv implementation error");if(o.opts.discriminator&&s.discriminator)return;const a=n,u=r.let("valid",!1),h=r.let("passing",null),c=r.name("_valid");i.setParams({passing:h}),r.block((function(){a.forEach(((n,s)=>{let a;(0,e.alwaysValidSchema)(o,n)?r.var(c,!0):a=i.subschema({keyword:"oneOf",schemaProp:s,compositeRule:!0},c),s>0&&r.if(t._`${c} && ${u}`).assign(u,!1).assign(h,t._`[${h}, ${s}]`).else(),r.if(c,(()=>{r.assign(u,!0),r.assign(h,s),a&&i.mergeEvaluated(a,t.Name)}))}))})),i.result(u,(()=>i.reset()),(()=>i.error(!0)))}};return vn.default=i,vn}var gn,$n={};function wn(){if(gn)return $n;gn=1,Object.defineProperty($n,"__esModule",{value:!0});const t=je(),e={keyword:"allOf",schemaType:"array",code(e){const{gen:i,schema:r,it:n}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const s=i.name("valid");r.forEach(((i,r)=>{if((0,t.alwaysValidSchema)(n,i))return;const o=e.subschema({keyword:"allOf",schemaProp:r},s);e.ok(s),e.mergeEvaluated(o)}))}};return $n.default=e,$n}var bn,_n={};function En(){if(bn)return _n;bn=1,Object.defineProperty(_n,"__esModule",{value:!0});const t=Oe(),e=je(),i={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>t.str`must match "${e.ifClause}" schema`,params:({params:e})=>t._`{failingKeyword: ${e.ifClause}}`},code(i){const{gen:n,parentSchema:s,it:o}=i;void 0===s.then&&void 0===s.else&&(0,e.checkStrictMode)(o,'"if" without "then" and "else" is ignored');const a=r(o,"then"),u=r(o,"else");if(!a&&!u)return;const h=n.let("valid",!0),c=n.name("_valid");if(function(){const t=i.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},c);i.mergeEvaluated(t)}(),i.reset(),a&&u){const t=n.let("ifClause");i.setParams({ifClause:t}),n.if(c,f("then",t),f("else",t))}else a?n.if(c,f("then")):n.if((0,t.not)(c),f("else"));function f(e,r){return()=>{const s=i.subschema({keyword:e},c);n.assign(h,c),i.mergeValidEvaluated(s,h),r?n.assign(r,t._`${e}`):i.setParams({ifClause:e})}}i.pass(h,(()=>i.error(!0)))}};function r(t,i){const r=t.schema[i];return void 0!==r&&!(0,e.alwaysValidSchema)(t,r)}return _n.default=i,_n}var kn,On,Sn={};function xn(){if(kn)return Sn;kn=1,Object.defineProperty(Sn,"__esModule",{value:!0});const t=je(),e={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:i,it:r}){void 0===i.if&&(0,t.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};return Sn.default=e,Sn}function jn(){if(On)return Tr;On=1,Object.defineProperty(Tr,"__esModule",{value:!0});const t=Nr(),e=Ur(),i=Lr(),r=Br(),n=Hr(),s=Jr(),o=Yr(),a=en(),u=sn(),h=un(),c=fn(),f=pn(),l=yn(),d=wn(),p=En(),m=xn();return Tr.default=function(v=!1){const y=[c.default,f.default,l.default,d.default,p.default,m.default,o.default,a.default,s.default,u.default,h.default];return v?y.push(e.default,r.default):y.push(t.default,i.default),y.push(n.default),y},Tr}var In,Pn,Cn={},Tn={};function An(){if(In)return Tn;In=1,Object.defineProperty(Tn,"__esModule",{value:!0});const t=Oe(),e={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>t.str`must match format "${e}"`,params:({schemaCode:e})=>t._`{format: ${e}}`},code(e,i){const{gen:r,data:n,$data:s,schema:o,schemaCode:a,it:u}=e,{opts:h,errSchemaPath:c,schemaEnv:f,self:l}=u;h.validateFormats&&(s?function(){const s=r.scopeValue("formats",{ref:l.formats,code:h.code.formats}),o=r.const("fDef",t._`${s}[${a}]`),u=r.let("fType"),c=r.let("format");r.if(t._`typeof ${o} == "object" && !(${o} instanceof RegExp)`,(()=>r.assign(u,t._`${o}.type || "string"`).assign(c,t._`${o}.validate`)),(()=>r.assign(u,t._`"string"`).assign(c,o))),e.fail$data((0,t.or)(!1===h.strictSchema?t.nil:t._`${a} && !${c}`,function(){const e=f.$async?t._`(${o}.async ? await ${c}(${n}) : ${c}(${n}))`:t._`${c}(${n})`,r=t._`(typeof ${c} == "function" ? ${e} : ${c}.test(${n}))`;return t._`${c} && ${c} !== true && ${u} === ${i} && !${r}`}()))}():function(){const s=l.formats[o];if(!s)return void function(){if(!1!==h.strictSchema)throw new Error(t());function t(){return`unknown format "${o}" ignored in schema at path "${c}"`}l.logger.warn(t())}();if(!0===s)return;const[a,u,d]=function(e){const i=e instanceof RegExp?(0,t.regexpCode)(e):h.code.formats?t._`${h.code.formats}${(0,t.getProperty)(o)}`:void 0,n=r.scopeValue("formats",{key:o,ref:e,code:i});return"object"!=typeof e||e instanceof RegExp?["string",e,n]:[e.type||"string",e.validate,t._`${n}.validate`]}(s);a===i&&e.pass(function(){if("object"==typeof s&&!(s instanceof RegExp)&&s.async){if(!f.$async)throw new Error("async format in sync schema");return t._`await ${d}(${n})`}return"function"==typeof u?t._`${d}(${n})`:t._`${d}.test(${n})`}())}())}};return Tn.default=e,Tn}function Nn(){return Pn||(Pn=1,Object.defineProperty(Cn,"__esModule",{value:!0}),Cn.default=[An().default]),Cn}var Mn,Rn,Dn={};function zn(){return Mn||(Mn=1,Object.defineProperty(Dn,"__esModule",{value:!0}),Dn.contentVocabulary=Dn.metadataVocabulary=void 0,Dn.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],Dn.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),Dn}function Ln(){if(Rn)return Di;Rn=1,Object.defineProperty(Di,"__esModule",{value:!0});const t=Gi(),e=Pr(),i=jn(),r=Nn(),n=zn(),s=[t.default,e.default,(0,i.default)(),r.default,n.metadataVocabulary,n.contentVocabulary];return Di.default=s,Di}var Un,qn,Fn={},Bn={};function Vn(){return Un||(Un=1,Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.DiscrError=void 0,function(t){t.Tag="tag",t.Mapping="mapping"}(t||(Bn.DiscrError=t={}))),Bn;var t}function Gn(){if(qn)return Fn;qn=1,Object.defineProperty(Fn,"__esModule",{value:!0});const t=Oe(),e=Vn(),i=_i(),r=$i(),n=je(),s={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:t,tagName:i}})=>t===e.DiscrError.Tag?`tag "${i}" must be string`:`value of tag "${i}" must be in oneOf`,params:({params:{discrError:e,tag:i,tagName:r}})=>t._`{error: ${e}, tag: ${r}, tagValue: ${i}}`},code(s){const{gen:o,data:a,schema:u,parentSchema:h,it:c}=s,{oneOf:f}=h;if(!c.opts.discriminator)throw new Error("discriminator: requires discriminator option");const l=u.propertyName;if("string"!=typeof l)throw new Error("discriminator: requires propertyName");if(u.mapping)throw new Error("discriminator: mapping is not supported");if(!f)throw new Error("discriminator: requires oneOf keyword");const d=o.let("valid",!1),p=o.const("tag",t._`${a}${(0,t.getProperty)(l)}`);function m(e){const i=o.name("valid"),r=s.subschema({keyword:"oneOf",schemaProp:e},i);return s.mergeEvaluated(r,t.Name),i}o.if(t._`typeof ${p} == "string"`,(()=>function(){const a=function(){var t;const e={},s=a(h);let o=!0;for(let e=0;e<f.length;e++){let h=f[e];if((null==h?void 0:h.$ref)&&!(0,n.schemaHasRulesButRef)(h,c.self.RULES)){const t=h.$ref;if(h=i.resolveRef.call(c.self,c.schemaEnv.root,c.baseId,t),h instanceof i.SchemaEnv&&(h=h.schema),void 0===h)throw new r.default(c.opts.uriResolver,c.baseId,t)}const d=null===(t=null==h?void 0:h.properties)||void 0===t?void 0:t[l];if("object"!=typeof d)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${l}"`);o=o&&(s||a(h)),u(d,e)}if(!o)throw new Error(`discriminator: "${l}" must be required`);return e;function a({required:t}){return Array.isArray(t)&&t.includes(l)}function u(t,e){if(t.const)d(t.const,e);else{if(!t.enum)throw new Error(`discriminator: "properties/${l}" must have "const" or "enum"`);for(const i of t.enum)d(i,e)}}function d(t,i){if("string"!=typeof t||t in e)throw new Error(`discriminator: "${l}" values must be unique strings`);e[t]=i}}();o.if(!1);for(const e in a)o.elseIf(t._`${p} === ${e}`),o.assign(d,m(a[e]));o.else(),s.error(!1,{discrError:e.DiscrError.Mapping,tag:p,tagName:l}),o.endIf()}()),(()=>s.error(!1,{discrError:e.DiscrError.Tag,tag:p,tagName:l}))),s.ok(d)}};return Fn.default=s,Fn}var Hn,Kn={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{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:[]}},type:["object","boolean"],properties:{$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:"#"}},default:!0};function Wn(){return Hn||(Hn=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;const i=Mi(),r=Ln(),n=Gn(),s=Kn,o=["/properties"],a="http://json-schema.org/draft-07/schema";class u extends i.default{_addVocabularies(){super._addVocabularies(),r.default.forEach((t=>this.addVocabulary(t))),this.opts.discriminator&&this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const t=this.opts.$data?this.$dataMetaSchema(s,o):s;this.addMetaSchema(t,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}}e.Ajv=u,t.exports=e=u,t.exports.Ajv=u,Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var h=di();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return h.KeywordCxt}});var c=Oe();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return c.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var f=vi();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return f.default}});var l=$i();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return l.default}})}(de,de.exports)),de.exports}var Jn,Zn,Xn,Yn,Qn,ts=Wn(),es={exports:{}},is=(Jn||(Jn=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const i=Wn(),r=Oe(),n=we(),s=di(),o=Ne(),a=Ae(),u="errorMessage",h=new i.Name("emUsed"),c={required:"missingProperty",dependencies:"property",dependentRequired:"property"},f=/\$\{[^}]+\}/,l=/\$\{([^}]+)\}/g,d=/^""\s*\+\s*|\s*\+\s*""$/g;const p=(t,e={})=>{if(!t.opts.allErrors)throw new Error("ajv-errors: Ajv option allErrors must be true");if(t.opts.jsPropertySyntax)throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported");return t.addKeyword(function(t){return{keyword:u,schemaType:["string","object"],post:!0,code(e){const{gen:p,data:m,schema:v,schemaValue:y,it:g}=e;if(!1===g.createErrors)return;const $=v,w=r.strConcat(a.default.instancePath,g.errorPath);function b(t,e){return r.and(i._`${t}.keyword !== ${u}`,i._`!${t}.${h}`,i._`${t}.instancePath === ${w}`,i._`${t}.keyword in ${e}`,i._`${t}.schemaPath.indexOf(${g.errSchemaPath}) === 0`,i._`/^\\/[^\\/]*$/.test(${t}.schemaPath.slice(${g.errSchemaPath.length}))`)}function _(t,e){const i=[];for(const r in t){const t=e[r];f.test(t)&&i.push([r,k(t)])}return p.object(...i)}function E(t){return f.test(t)?new n._Code(n.safeStringify(t).replace(l,((t,e)=>`" + JSON.stringify(${s.getData(e,g)}) + "`)).replace(d,"")):i.stringify(t)}function k(t){return i._`function(){return ${E(t)}}`}p.if(i._`${a.default.errors} > 0`,(()=>{if("object"==typeof $){const[n,s]=function(t){let e,i;for(const r in t){if("properties"===r||"items"===r)continue;const n=t[r];if("object"==typeof n){e||(e={});const t=e[r]={};for(const e in n)t[e]=[]}else i||(i={}),i[r]=[]}return[e,i]}($);s&&function(r){const n=p.const("emErrors",i.stringify(r)),s=p.const("templates",_(r,v));p.forOf("err",a.default.vErrors,(t=>p.if(b(t,n),(()=>p.code(i._`${n}[${t}.keyword].push(${t})`).assign(i._`${t}.${h}`,!0)))));const{singleError:u}=t;if(u){const t=p.let("message",i._`""`),r=p.let("paramsErrors",i._`[]`);c((e=>{p.if(t,(()=>p.code(i._`${t} += ${"string"==typeof u?u:";"}`))),p.code(i._`${t} += ${f(e)}`),p.assign(r,i._`${r}.concat(${n}[${e}])`)})),o.reportError(e,{message:t,params:i._`{errors: ${r}}`})}else c((t=>o.reportError(e,{message:f(t),params:i._`{errors: ${n}[${t}]}`})));function c(t){p.forIn("key",n,(e=>p.if(i._`${n}[${e}].length`,(()=>t(e)))))}function f(t){return i._`${t} in ${s} ? ${s}[${t}]() : ${y}[${t}]`}}(s),n&&function(t){const r=p.const("emErrors",i.stringify(t)),n=[];for(const e in t)n.push([e,_(t[e],v[e])]);const s=p.const("templates",p.object(...n)),u=p.scopeValue("obj",{ref:c,code:i.stringify(c)}),f=p.let("emPropParams"),l=p.let("emParamsErrors");p.forOf("err",a.default.vErrors,(t=>p.if(b(t,r),(()=>{p.assign(f,i._`${u}[${t}.keyword]`),p.assign(l,i._`${r}[${t}.keyword][${t}.params[${f}]]`),p.if(l,(()=>p.code(i._`${l}.push(${t})`).assign(i._`${t}.${h}`,!0)))})))),p.forIn("key",r,(t=>p.forIn("keyProp",i._`${r}[${t}]`,(n=>{p.assign(l,i._`${r}[${t}][${n}]`),p.if(i._`${l}.length`,(()=>{const r=p.const("tmpl",i._`${s}[${t}] && ${s}[${t}][${n}]`);o.reportError(e,{message:i._`${r} ? ${r}() : ${y}[${t}][${n}]`,params:i._`{errors: ${l}}`})}))}))))}(n),function(t){const{props:n,items:s}=t;if(!n&&!s)return;const c=i._`typeof ${m} == "object"`,f=i._`Array.isArray(${m})`,l=p.let("emErrors");let d,g;const $=p.let("templates");function b(t,e){p.assign(l,i.stringify(t)),p.assign($,_(t,e))}n&&s?(d=p.let("emChildKwd"),p.if(c),p.if(f,(()=>{b(s,v.items),p.assign(d,i.str`items`)}),(()=>{b(n,v.properties),p.assign(d,i.str`properties`)})),g=i._`[${d}]`):s?(p.if(f),b(s,v.items),g=i._`.items`):n&&(p.if(r.and(c,r.not(f))),b(n,v.properties),g=i._`.properties`),p.forOf("err",a.default.vErrors,(t=>function(t,e,n){p.if(r.and(i._`${t}.keyword !== ${u}`,i._`!${t}.${h}`,i._`${t}.instancePath.indexOf(${w}) === 0`),(()=>{const r=p.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:i._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),s=p.const("emMatches",i._`${r}.exec(${t}.instancePath.slice(${w}.length))`),o=p.const("emChild",i._`${s} && ${s}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);p.if(i._`${o} !== undefined && ${o} in ${e}`,(()=>n(o)))}))}(t,l,(e=>p.code(i._`${l}[${e}].push(${t})`).assign(i._`${t}.${h}`,!0))))),p.forIn("key",l,(t=>p.if(i._`${l}[${t}].length`,(()=>{o.reportError(e,{message:i._`${t} in ${$} ? ${$}[${t}]() : ${y}${g}[${t}]`,params:i._`{errors: ${l}[${t}]}`}),p.assign(i._`${a.default.vErrors}[${a.default.errors}-1].instancePath`,i._`${w} + "/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`)})))),p.endIf()}(function({properties:t,items:e}){const i={};if(t){i.props={};for(const e in t)i.props[e]=[]}if(e){i.items={};for(let t=0;t<e.length;t++)i.items[t]=[]}return i}($))}const n="string"==typeof $?$:$._;n&&function(t){const n=p.const("emErrs",i._`[]`);p.forOf("err",a.default.vErrors,(t=>p.if(function(t){return r.and(i._`${t}.keyword !== ${u}`,i._`!${t}.${h}`,r.or(i._`${t}.instancePath === ${w}`,r.and(i._`${t}.instancePath.indexOf(${w}) === 0`,i._`${t}.instancePath[${w}.length] === "/"`)),i._`${t}.schemaPath.indexOf(${g.errSchemaPath}) === 0`,i._`${t}.schemaPath[${g.errSchemaPath}.length] === "/"`)}(t),(()=>p.code(i._`${n}.push(${t})`).assign(i._`${t}.${h}`,!0))))),p.if(i._`${n}.length`,(()=>o.reportError(e,{message:E(t),params:i._`{errors: ${n}}`})))}(n),t.keepErrors||function(){const t=p.const("emErrs",i._`[]`);p.forOf("err",a.default.vErrors,(e=>p.if(i._`!${e}.${h}`,(()=>p.code(i._`${t}.push(${e})`))))),p.assign(a.default.vErrors,t).assign(a.default.errors,i._`${t}.length`)}()}))},metaSchema:{anyOf:[{type:"string"},{type:"object",properties:{properties:{$ref:"#/$defs/stringMap"},items:{$ref:"#/$defs/stringList"},required:{$ref:"#/$defs/stringOrMap"},dependencies:{$ref:"#/$defs/stringOrMap"}},additionalProperties:{type:"string"}}],$defs:{stringMap:{type:"object",additionalProperties:{type:"string"}},stringOrMap:{anyOf:[{type:"string"},{$ref:"#/$defs/stringMap"}]},stringList:{type:"array",items:{type:"string"}}}}}}(e))};e.default=p,t.exports=p,t.exports.default=p}(es,es.exports)),es.exports),rs=p(is),ns={exports:{}},ss={},os={},as=(Yn||(Yn=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const i=(Zn||(Zn=1,function(t){function e(t,e){return{validate:t,compare:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0,t.fullFormats={date:e(n,s),time:e(a(!0),u),"date-time":e(f(!0),l),"iso-time":e(a(),h),"iso-date-time":e(f(),d),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(t){return p.test(t)&&m.test(t)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function(t){if(w.test(t))return!1;try{return!0}catch(t){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function(t){return v.lastIndex=0,v.test(t)},int32:{type:"number",validate:function(t){return Number.isInteger(t)&&t<=g&&t>=y}},int64:{type:"number",validate:function(t){return Number.isInteger(t)}},float:{type:"number",validate:$},double:{type:"number",validate:$},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:e(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,s),time:e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"iso-time":e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,h),"iso-date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,d),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);const i=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,r=[0,31,28,31,30,31,30,31,31,30,31,30,31];function n(t){const e=i.exec(t);if(!e)return!1;const n=+e[2],s=+e[3];return n>=1&&n<=12&&s>=1&&s<=(2!==n||(o=+e[1])%4!=0||o%100==0&&o%400!=0?r[n]:29);var o}function s(t,e){if(t&&e)return t>e?1:t<e?-1:0}const o=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function a(t){return function(e){const i=o.exec(e);if(!i)return!1;const r=+i[1],n=+i[2],s=+i[3],a="-"===i[5]?-1:1,u=+(i[6]||0),h=+(i[7]||0);if(u>23||h>59||t&&!i[4])return!1;if(r<=23&&n<=59&&s<60)return!0;const c=n-h*a,f=r-u*a-(c<0?1:0);return(23===f||-1===f)&&(59===c||-1===c)&&s<61}}function u(t,e){if(!t||!e)return;const i=new Date("2020-01-01T"+t).valueOf(),r=new Date("2020-01-01T"+e).valueOf();return i&&r?i-r:void 0}function h(t,e){if(!t||!e)return;const i=o.exec(t),r=o.exec(e);return i&&r?(t=i[1]+i[2]+i[3])>(e=r[1]+r[2]+r[3])?1:t<e?-1:0:void 0}const c=/t|\s/i;function f(t){const e=a(t);return function(t){const i=t.split(c);return 2===i.length&&n(i[0])&&e(i[1])}}function l(t,e){if(!t||!e)return;const i=new Date(t).valueOf(),r=new Date(e).valueOf();return i&&r?i-r:void 0}function d(t,e){if(!t||!e)return;const[i,r]=t.split(c),[n,o]=e.split(c),a=s(i,n);return void 0!==a?a||u(r,o):void 0}const p=/\/|:/,m=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm,y=-2147483648,g=2**31-1;function $(){return!0}const w=/[^\\]\\Z/}(ss)),ss),r=(Xn||(Xn=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;const e=Wn(),i=Oe(),r=i.operators,n={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},s={message:({keyword:t,schemaCode:e})=>i.str`should be ${n[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>i._`{comparison: ${n[t].okStr}, limit: ${e}}`};t.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:s,code(t){const{gen:r,data:s,schemaCode:o,keyword:a,it:u}=t,{opts:h,self:c}=u;if(!h.validateFormats)return;const f=new e.KeywordCxt(u,c.RULES.all.format.definition,"format");function l(t){return i._`${t}.compare(${s}, ${o}) ${n[a].fail} 0`}f.$data?function(){const e=r.scopeValue("formats",{ref:c.formats,code:h.code.formats}),n=r.const("fmt",i._`${e}[${f.schemaCode}]`);t.fail$data((0,i.or)(i._`typeof ${n} != "object"`,i._`${n} instanceof RegExp`,i._`typeof ${n}.compare != "function"`,l(n)))}():function(){const e=f.schema,n=c.formats[e];if(!n||!0===n)return;if("object"!=typeof n||n instanceof RegExp||"function"!=typeof n.compare)throw new Error(`"${a}": format "${e}" does not define "compare" function`);const s=r.scopeValue("formats",{key:e,ref:n,code:h.code.formats?i._`${h.code.formats}${(0,i.getProperty)(e)}`:void 0});t.fail$data(l(s))}()},dependencies:["format"]},t.default=e=>(e.addKeyword(t.formatLimitDefinition),e)}(os)),os),n=Oe(),s=new n.Name("fullFormats"),o=new n.Name("fastFormats"),a=(t,e={keywords:!0})=>{if(Array.isArray(e))return u(t,e,i.fullFormats,s),t;const[n,a]="fast"===e.mode?[i.fastFormats,o]:[i.fullFormats,s];return u(t,e.formats||i.formatNames,n,a),e.keywords&&(0,r.default)(t),t};function u(t,e,i,r){var s,o;null!==(s=(o=t.opts.code).formats)&&void 0!==s||(o.formats=n._`require("ajv-formats/dist/formats").${r}`);for(const r of e)t.addFormat(r,i[r])}a.get=(t,e="full")=>{const r=("fast"===e?i.fastFormats:i.fullFormats)[t];if(!r)throw new Error(`Unknown format "${t}"`);return r},t.exports=e=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a}(ns,ns.exports)),ns.exports),us=p(as),hs=(Qn=function(t,e){return Qn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},Qn(t,e)},function(t,e){function i(){this.constructor=t}Qn(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),cs=Object.prototype.hasOwnProperty;function fs(t,e){return cs.call(t,e)}function ls(t){if(Array.isArray(t)){for(var e=new Array(t.length),i=0;i<e.length;i++)e[i]=""+i;return e}if(Object.keys)return Object.keys(t);var r=[];for(var n in t)fs(t,n)&&r.push(n);return r}function ds(t){switch(typeof t){case"object":return JSON.parse(JSON.stringify(t));case"undefined":return null;default:return t}}function ps(t){for(var e,i=0,r=t.length;i<r;){if(!((e=t.charCodeAt(i))>=48&&e<=57))return!1;i++}return!0}function ms(t){return-1===t.indexOf("/")&&-1===t.indexOf("~")?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function vs(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function ys(t){if(void 0===t)return!0;if(t)if(Array.isArray(t)){for(var e=0,i=t.length;e<i;e++)if(ys(t[e]))return!0}else if("object"==typeof t)for(var r=ls(t),n=r.length,s=0;s<n;s++)if(ys(t[r[s]]))return!0;return!1}function gs(t,e){var i=[t];for(var r in e){var n="object"==typeof e[r]?JSON.stringify(e[r],null,2):e[r];void 0!==n&&i.push(r+": "+n)}return i.join("\n")}var $s=function(t){function e(e,i,r,n,s){var o=this.constructor,a=t.call(this,gs(e,{name:i,index:r,operation:n,tree:s}))||this;return a.name=i,a.index=r,a.operation=n,a.tree=s,Object.setPrototypeOf(a,o.prototype),a.message=gs(e,{name:i,index:r,operation:n,tree:s}),a}return hs(e,t),e}(Error),ws=$s,bs={add:function(t,e,i){return t[e]=this.value,{newDocument:i}},remove:function(t,e,i){var r=t[e];return delete t[e],{newDocument:i,removed:r}},replace:function(t,e,i){var r=t[e];return t[e]=this.value,{newDocument:i,removed:r}},move:function(t,e,i){var r=Es(i,this.path);r&&(r=ds(r));var n=ks(i,{op:"remove",path:this.from}).removed;return ks(i,{op:"add",path:this.path,value:n}),{newDocument:i,removed:r}},copy:function(t,e,i){var r=Es(i,this.from);return ks(i,{op:"add",path:this.path,value:ds(r)}),{newDocument:i}},test:function(t,e,i){return{newDocument:i,test:Is(t[e],this.value)}},_get:function(t,e,i){return this.value=t[e],{newDocument:i}}},_s={add:function(t,e,i){return ps(e)?t.splice(e,0,this.value):t[e]=this.value,{newDocument:i,index:e}},remove:function(t,e,i){return{newDocument:i,removed:t.splice(e,1)[0]}},replace:function(t,e,i){var r=t[e];return t[e]=this.value,{newDocument:i,removed:r}},move:bs.move,copy:bs.copy,test:bs.test,_get:bs._get};function Es(t,e){if(""==e)return t;var i={op:"_get",path:e};return ks(t,i),i.value}function ks(t,e,i,r,n,s){if(void 0===i&&(i=!1),void 0===r&&(r=!0),void 0===n&&(n=!0),void 0===s&&(s=0),i&&("function"==typeof i?i(e,0,t,e.path):xs(e,0)),""===e.path){var o={newDocument:t};if("add"===e.op)return o.newDocument=e.value,o;if("replace"===e.op)return o.newDocument=e.value,o.removed=t,o;if("move"===e.op||"copy"===e.op)return o.newDocument=Es(t,e.from),"move"===e.op&&(o.removed=t),o;if("test"===e.op){if(o.test=Is(t,e.value),!1===o.test)throw new ws("Test operation failed","TEST_OPERATION_FAILED",s,e,t);return o.newDocument=t,o}if("remove"===e.op)return o.removed=t,o.newDocument=null,o;if("_get"===e.op)return e.value=t,o;if(i)throw new ws("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,e,t);return o}r||(t=ds(t));var a=(e.path||"").split("/"),u=t,h=1,c=a.length,f=void 0,l=void 0,d=void 0;for(d="function"==typeof i?i:xs;;){if((l=a[h])&&-1!=l.indexOf("~")&&(l=vs(l)),n&&("__proto__"==l||"prototype"==l&&h>0&&"constructor"==a[h-1]))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(i&&void 0===f&&(void 0===u[l]?f=a.slice(0,h).join("/"):h==c-1&&(f=e.path),void 0!==f&&d(e,0,t,f)),h++,Array.isArray(u)){if("-"===l)l=u.length;else{if(i&&!ps(l))throw new ws("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",s,e,t);ps(l)&&(l=~~l)}if(h>=c){if(i&&"add"===e.op&&l>u.length)throw new ws("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,e,t);if(!1===(o=_s[e.op].call(e,u,l,t)).test)throw new ws("Test operation failed","TEST_OPERATION_FAILED",s,e,t);return o}}else if(h>=c){if(!1===(o=bs[e.op].call(e,u,l,t)).test)throw new ws("Test operation failed","TEST_OPERATION_FAILED",s,e,t);return o}if(u=u[l],i&&h<c&&(!u||"object"!=typeof u))throw new ws("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,e,t)}}function Os(t,e,i,r,n){if(void 0===r&&(r=!0),void 0===n&&(n=!0),i&&!Array.isArray(e))throw new ws("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");r||(t=ds(t));for(var s=new Array(e.length),o=0,a=e.length;o<a;o++)s[o]=ks(t,e[o],i,!0,n,o),t=s[o].newDocument;return s.newDocument=t,s}function Ss(t,e,i){var r=ks(t,e);if(!1===r.test)throw new ws("Test operation failed","TEST_OPERATION_FAILED",i,e,t);return r.newDocument}function xs(t,e,i,r){if("object"!=typeof t||null===t||Array.isArray(t))throw new ws("Operation is not an object","OPERATION_NOT_AN_OBJECT",e,t,i);if(!bs[t.op])throw new ws("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,t,i);if("string"!=typeof t.path)throw new ws("Operation `path` property is not a string","OPERATION_PATH_INVALID",e,t,i);if(0!==t.path.indexOf("/")&&t.path.length>0)throw new ws('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,t,i);if(("move"===t.op||"copy"===t.op)&&"string"!=typeof t.from)throw new ws("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,t,i);if(("add"===t.op||"replace"===t.op||"test"===t.op)&&void 0===t.value)throw new ws("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,t,i);if(("add"===t.op||"replace"===t.op||"test"===t.op)&&ys(t.value))throw new ws("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,t,i);if(i)if("add"==t.op){var n=t.path.split("/").length,s=r.split("/").length;if(n!==s+1&&n!==s)throw new ws("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,t,i)}else if("replace"===t.op||"remove"===t.op||"_get"===t.op){if(t.path!==r)throw new ws("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,t,i)}else if("move"===t.op||"copy"===t.op){var o=js([{op:"_get",path:t.from,value:void 0}],i);if(o&&"OPERATION_PATH_UNRESOLVABLE"===o.name)throw new ws("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,t,i)}}function js(t,e,i){try{if(!Array.isArray(t))throw new ws("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)Os(ds(e),ds(t),i||!0);else{i=i||xs;for(var r=0;r<t.length;r++)i(t[r],r,e,void 0)}}catch(t){if(t instanceof ws)return t;throw t}}function Is(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){var i,r,n,s=Array.isArray(t),o=Array.isArray(e);if(s&&o){if((r=t.length)!=e.length)return!1;for(i=r;0!=i--;)if(!Is(t[i],e[i]))return!1;return!0}if(s!=o)return!1;var a=Object.keys(t);if((r=a.length)!==Object.keys(e).length)return!1;for(i=r;0!=i--;)if(!e.hasOwnProperty(a[i]))return!1;for(i=r;0!=i--;)if(!Is(t[n=a[i]],e[n]))return!1;return!0}return t!=t&&e!=e}var Ps=Object.freeze({__proto__:null,JsonPatchError:ws,_areEquals:Is,applyOperation:ks,applyPatch:Os,applyReducer:Ss,deepClone:ds,getValueByPointer:Es,validate:js,validator:xs}),Cs=new WeakMap,Ts=function(t){this.observers=new Map,this.obj=t},As=function(t,e){this.callback=t,this.observer=e};
@@ -9,4 +9,4 @@ import{h as t}from"./p-qLZlXROB.js";import{f as e,a as i}from"./p-DYsf28oe.js";v
9
9
  * https://github.com/Starcounter-Jack/JSON-Patch
10
10
  * (c) 2017-2021 Joachim Wester
11
11
  * MIT license
12
- */function Ns(t,e){e.unobserve()}function Ms(t,e){var i,r=function(t){return Cs.get(t)}(t);if(r){var n=function(t,e){return t.observers.get(e)}(r,e);i=n&&n.observer}else r=new Ts(t),Cs.set(t,r);if(i)return i;if(i={},r.value=ds(t),e){i.callback=e,i.next=null;var s=function(){Rs(i)},o=function(){clearTimeout(i.next),i.next=setTimeout(s)};"undefined"!=typeof window&&(window.addEventListener("mouseup",o),window.addEventListener("keyup",o),window.addEventListener("mousedown",o),window.addEventListener("keydown",o),window.addEventListener("change",o))}return i.patches=[],i.object=t,i.unobserve=function(){Rs(i),clearTimeout(i.next),function(t,e){t.observers.delete(e.callback)}(r,i),"undefined"!=typeof window&&(window.removeEventListener("mouseup",o),window.removeEventListener("keyup",o),window.removeEventListener("mousedown",o),window.removeEventListener("keydown",o),window.removeEventListener("change",o))},r.observers.set(e,new As(e,i)),i}function Rs(t,e){void 0===e&&(e=!1);var i=Cs.get(t.object);Ds(i.value,t.object,t.patches,"",e),t.patches.length&&Os(i.value,t.patches);var r=t.patches;return r.length>0&&(t.patches=[],t.callback&&t.callback(r)),r}function Ds(t,e,i,r,n){if(e!==t){"function"==typeof e.toJSON&&(e=e.toJSON());for(var s=ls(e),o=ls(t),a=!1,u=o.length-1;u>=0;u--){var h=t[f=o[u]];if(!fs(e,f)||void 0===e[f]&&void 0!==h&&!1===Array.isArray(e))Array.isArray(t)===Array.isArray(e)?(n&&i.push({op:"test",path:r+"/"+ms(f),value:ds(h)}),i.push({op:"remove",path:r+"/"+ms(f)}),a=!0):(n&&i.push({op:"test",path:r,value:t}),i.push({op:"replace",path:r,value:e}));else{var c=e[f];"object"==typeof h&&null!=h&&"object"==typeof c&&null!=c&&Array.isArray(h)===Array.isArray(c)?Ds(h,c,i,r+"/"+ms(f),n):h!==c&&(n&&i.push({op:"test",path:r+"/"+ms(f),value:ds(h)}),i.push({op:"replace",path:r+"/"+ms(f),value:ds(c)}))}}if(a||s.length!=o.length)for(u=0;u<s.length;u++){var f;fs(t,f=s[u])||void 0===e[f]||i.push({op:"add",path:r+"/"+ms(f),value:ds(e[f])})}}}function zs(t,e,i){void 0===i&&(i=!1);var r=[];return Ds(t,e,r,"",i),r}var Ls=Object.assign({},Ps,Object.freeze({__proto__:null,compare:zs,generate:Rs,observe:Ms,unobserve:Ns}),{JsonPatchError:$s,deepClone:ds,escapePathComponent:ms,unescapePathComponent:vs}),Us=Object.freeze({__proto__:null,JsonPatchError:$s,_areEquals:Is,applyOperation:ks,applyPatch:Os,applyReducer:Ss,compare:zs,deepClone:ds,default:Ls,escapePathComponent:ms,generate:Rs,getValueByPointer:Es,observe:Ms,unescapePathComponent:vs,unobserve:Ns,validate:js,validator:xs});function qs(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)&&Object.keys(t).length>0&&Object.values(t).every((t=>"string"==typeof t))}function Fs(t,e){return qs(t)?e&&void 0!==t[e]?t[e]:Object.values(t)[0]:t}function Bs(t,e){if(!t)return t;const i={};for(const[r,n]of Object.entries(t))i[r]=Fs(n,e);return i}var Vs={en:{required:"This field is required",minLength:"Must be at least {value} characters",maxLength:"Must be at most {value} characters",min:"Must be at least {value}",max:"Must be at most {value}",pattern:"Invalid format",minItems:"Select at least {value} item(s)",maxItems:"Select at most {value} item(s)",email:"Invalid email address",url:"Invalid URL",type:"Invalid value",custom:"Invalid value"},fr:{required:"Ce champ est obligatoire",minLength:"Minimum {value} caractères",maxLength:"Maximum {value} caractères",min:"Minimum {value}",max:"Maximum {value}",pattern:"Format invalide",minItems:"Sélectionnez au moins {value} élément(s)",maxItems:"Sélectionnez au plus {value} élément(s)",email:"Adresse email invalide",url:"URL invalide",type:"Valeur invalide",custom:"Valeur invalide"}};function Gs(t,e,i){return((Vs[e??"en"]??Vs.en)[t]??Vs.en[t]??"Invalid value").replace("{value}",String(i??""))}function*Hs(t,e="0"){if(t){yield{brick:t,path:e};for(const[i,r]of(t.children??[]).entries())yield*Hs(r,`${e}.${i}`)}}function*Ks(t){if(t&&(yield t,"collection"!==t.type))for(const e of t.children??[])yield*Ks(e)}class Ws{type;dataType;id;name;configsForm;category;styles;unWrapData;isPrivate;validators;defaultConfigs;constructor(t){this.type=t.type,this.dataType=t.dataType,this.id=t.id,this.name=t.name,this.configsForm=t.configsForm,this.category=t.category,this.styles=t.styles,this.unWrapData=t.unWrapData??!1,this.isPrivate=t.isPrivate??!1,this.validators=t.validators??[],this.defaultConfigs=t.defaultConfigs}getBrickEmptySpec(){return{type:this.type,dataType:this.dataType,id:this.id,name:this.name,...void 0!==this.category?{category:this.category}:{},...void 0!==this.configsForm?{configsForm:this.configsForm}:{},...void 0!==this.styles?{styles:this.styles}:{},...void 0!==this.defaultConfigs?{configs:{...this.defaultConfigs}}:{},validators:this.validators}}}var Js=new Set(["__proto__","constructor","prototype"]);class Zs{value;constructor(t){this.value=t}}var Xs=(t,e,i)=>{t.scopes[t.scopes.length-1].set(e,i)},Ys=t=>{if("number"==typeof t)return t;const e=String(t);if(Js.has(e))throw new Error(`Access to "${e}" is not allowed`);return e},Qs=(t,e)=>({object:to(t,e.object),prop:Ys(e.computed?to(t,e.property):e.property.name),optional:!0===e.optional}),to=(t,e)=>{if(++t.steps>1e5)throw new Error("Sandbox execution budget exceeded");switch(e.type){case"Program":case"BlockStatement":for(const i of e.body){const e=to(t,i);if(e instanceof Zs)return e}return;case"ReturnStatement":return new Zs(e.argument?to(t,e.argument):void 0);case"IfStatement":return to(t,e.test)?to(t,e.consequent):e.alternate?to(t,e.alternate):void 0;case"VariableDeclaration":for(const i of e.declarations){const e=i.id;if("Identifier"!==e.type)throw new Error("Only simple variable names are supported");Xs(t,e.name,i.init?to(t,i.init):void 0)}return;case"ExpressionStatement":return void to(t,e.expression);case"Literal":return e.value;case"TemplateLiteral":{const i=e.expressions;let r="";return e.quasis.forEach(((e,n)=>{r+=e.value.cooked??"",n<i.length&&(r+=String(to(t,i[n])))})),r}case"Identifier":return((t,e)=>{for(let i=t.scopes.length-1;i>=0;i--)if(t.scopes[i].has(e))return t.scopes[i].get(e);throw new Error(`Unknown identifier "${e}"`)})(t,e.name);case"ThisExpression":return;case"ChainExpression":return to(t,e.expression);case"MemberExpression":return((t,e)=>{const{object:i,prop:r,optional:n}=Qs(t,e);if(null==i){if(n)return;throw new Error(`Cannot read "${String(r)}" of ${String(i)}`)}return i[r]})(t,e);case"CallExpression":{const i=e.callee,r=[];for(const i of e.arguments)if("SpreadElement"===i.type){const e=to(t,i.argument);Array.isArray(e)&&r.push(...e)}else r.push(to(t,i));if("MemberExpression"===i.type){const{object:n,prop:s,optional:o}=Qs(t,i);if(null==n){if(o||!0===e.optional)return;throw new Error(`Cannot call "${String(s)}" of ${String(n)}`)}const a=n[s];if("function"!=typeof a){if(!0===e.optional&&null==a)return;throw new Error(`"${String(s)}" is not a function`)}if(a===Function||a===eval)throw new Error("This function is not allowed");return a.apply(n,r)}const n=to(t,i);if("function"!=typeof n){if(!0===e.optional&&null==n)return;throw new Error("Value is not a function")}if(n===Function||n===eval)throw new Error("This function is not allowed");return n(...r)}case"ArrowFunctionExpression":{const i=e.params,r=e.body,n=[...t.scopes];return(...s)=>{const o=new Map;i.forEach(((t,e)=>{if("Identifier"!==t.type)throw new Error("Only simple parameters are supported");o.set(t.name,s[e])}));const a={steps:t.steps,scopes:[...n,o]},u=to(a,r);return t.steps=a.steps,u instanceof Zs?u.value:!0===e.expression?u:void 0}}case"BinaryExpression":{const i=to(t,e.left),r=to(t,e.right);switch(e.operator){case"===":return i===r;case"!==":return i!==r;case"==":return i==r;case"!=":return i!=r;case"<":return i<r;case"<=":return i<=r;case">":return i>r;case">=":return i>=r;case"+":return i+r;case"-":return i-r;case"*":return i*r;case"/":return i/r;case"%":return i%r;case"**":return i**r;default:throw new Error(`Unsupported operator "${String(e.operator)}"`)}}case"LogicalExpression":{const i=to(t,e.left);switch(e.operator){case"&&":return i&&to(t,e.right);case"||":return i||to(t,e.right);case"??":return i??to(t,e.right);default:throw new Error(`Unsupported operator "${String(e.operator)}"`)}}case"UnaryExpression":{const i=to(t,e.argument);switch(e.operator){case"!":return!i;case"-":return-i;case"+":return+i;case"typeof":return typeof i;default:throw new Error(`Unsupported operator "${String(e.operator)}"`)}}case"ConditionalExpression":return to(t,e.test)?to(t,e.consequent):to(t,e.alternate);case"AssignmentExpression":{const i=e.left;if("Identifier"!==i.type||"="!==e.operator)throw new Error("Only simple assignments are supported");const r=to(t,e.right);return((t,e,i)=>{for(let r=t.scopes.length-1;r>=0;r--)if(t.scopes[r].has(e))return void t.scopes[r].set(e,i);throw new Error(`Cannot assign to unknown identifier "${e}"`)})(t,i.name,r),r}case"ArrayExpression":{const i=[];for(const r of e.elements)if(r)if("SpreadElement"===r.type){const e=to(t,r.argument);Array.isArray(e)&&i.push(...e)}else i.push(to(t,r));return i}case"ObjectExpression":{const i={};for(const r of e.properties){if("SpreadElement"===r.type){const e=to(t,r.argument);if(e&&"object"==typeof e)for(const[t,r]of Object.entries(e))i[String(Ys(t))]=r;continue}const e=r.key,n=Ys(r.computed?to(t,e):"Identifier"===e.type?e.name:e.value);i[String(n)]=to(t,r.value)}return i}default:throw new Error(`Unsupported syntax: ${e.type}`)}},eo={undefined:void 0,NaN:NaN,Infinity:1/0,Math,JSON,Number,String,Boolean,Array,Object,Date,parseInt,parseFloat,isNaN,isFinite};class io{defaults;cache=new Map;constructor(t={}){this.defaults=t}resolveUrl(t){return/^https?:\/\//.test(t)||!this.defaults.baseUrl?t:`${this.defaults.baseUrl.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}fetchSpec(t){const e=this.resolveUrl(t);let i=this.cache.get(e);return i||(i=(this.defaults.fetch??globalThis.fetch.bind(globalThis))(e,{headers:this.defaults.headers,credentials:this.defaults.credentials}).then((async e=>{if(!e.ok)throw new Error(`Failed to load spec "${t}" (${e.status})`);return await e.json()})),i.catch((()=>this.cache.delete(e))),this.cache.set(e,i)),i}}class ro{defaults;cache=new Map;constructor(t={}){this.defaults=t}resolveUrl(t){return/^https?:\/\//.test(t)||!this.defaults.baseUrl?t:`${this.defaults.baseUrl.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}fetchOptions(t){const e=this.resolveUrl(t);let i=this.cache.get(e);return i||(i=(this.defaults.fetch??globalThis.fetch.bind(globalThis))(e,{headers:this.defaults.headers,credentials:this.defaults.credentials}).then((async e=>{if(!e.ok)throw new Error(`Failed to load options "${t}" (${e.status})`);return await e.json()})),i.catch((()=>this.cache.delete(e))),this.cache.set(e,i)),i}}var no=Symbol.for("formkrafter.core.services"),so=globalThis,oo=so[no]??={jsRunnerService:new class{validateJs(t,e={ecmaVersion:"latest",allowReturnOutsideFunction:!0}){try{return fe(t,e),{valide:!0}}catch(t){return{valide:!1,error:t instanceof Error?t:new Error(String(t))}}}eval(t,e={}){return function(t,e={}){const i=fe(t,{ecmaVersion:"latest",allowReturnOutsideFunction:!0}),r={steps:0,scopes:[new Map(Object.entries({...eo,...e})),new Map]},n=to(r,i);return n instanceof Zs?n.value:void 0}(t,e)}},dataSourceService:new class{defaults;cache=new Map;constructor(t={}){this.defaults=t}fetchOptions(t,e){const i={...this.defaults.headers,...e?.headers},r={};Object.keys(i).length&&(r.headers=i),this.defaults.credentials&&(r.credentials=this.defaults.credentials);const n=`${t}|${JSON.stringify(r)}`;let s=this.cache.get(n);return s||(s=fetch(t,Object.keys(r).length?r:void 0).then((e=>{if(!e.ok)throw new Error(`Data source request failed (${e.status}): ${t}`);return e.json()})).then((t=>Array.isArray(t)?t:[])).catch((t=>{throw this.cache.delete(n),t})),this.cache.set(n,s)),s}},fileUploadService:new class{async upload(t){const e=globalThis.btoa;if(!e)throw new Error("No base64 encoder available");const i=new Uint8Array(await t.arrayBuffer());let r="";for(const t of i)r+=String.fromCharCode(t);return{name:t.name,type:t.type,size:t.size,url:`data:${t.type};base64,${e(r)}`}}},specSourceService:new io,optionSourceService:new ro};oo.specSourceService??=new io,oo.optionSourceService??=new ro;var ao=(t,e)=>{try{return oo.jsRunnerService.eval(t,{dataMap:e??{}})}catch(t){return t instanceof Error?t:new Error(String(t))}},uo=(t,e)=>((t,e)=>((t,e)=>t?.filter((t=>((t,e)=>"jsonLogic"===t.type?null!=t.logic&&!0===g.apply(t.logic,e):"javaScript"===t.type&&!!t.code&&!0===ao(t.code,e))(t,e))))(t,e)?.map((t=>t.effects)).flat().filter((t=>null!=t)))(t,e)?.map((t=>{let i;return t.property?("boolean"===t.property.type?i=t.boolean:"logic"===t.property.type&&null!=t.logic?i=g.apply(t.logic,e):"code"===t.property.type&&t.code?i=ao(t.code,e):"string"===t.property.type&&(i=t.string),{[t.property.target]:i}):{}})).flat().reduce(((t,e)=>({...t,...e})),{})??{hidden:!1},ho=new ts.Ajv({allErrors:!0});us(ho,["email","uri"]),rs(ho);var co=new WeakMap,fo=t=>{if("required"===t.keyword)return t.params.missingProperty;if("errorMessage"===t.keyword){const e=t.params.errors?.[0];return e?fo(e):void 0}return t.instancePath.split("/").filter(Boolean)[0]},lo=(t,e,i)=>{const r={},n=((t,e)=>{let i=co.get(t);i||(i=new Map,co.set(t,i));const r=e??"";let n=i.get(r);if(!n){const s=function(t,e){if(!t)return;const i={},r=[],n={},s=t=>{const i=Fs(t,e);return"string"==typeof i?i:void 0};for(const o of Ks(t)){const t=o.configs?.key,a=!0===o.configs?.multiple&&"object"===o.dataType?"array":o.dataType;if(!t||!a||"void"===a)continue;const u=o.validations?.find((t=>"required"===t.validator)),h={type:a,nullable:!u},c={type:Gs("type",e)};for(const t of o.validations??[]){const{validator:i,value:r}=t,n=s(t.message)??Gs(i,e,r);"minLength"===i&&null!=r?(h.minLength=Number(r),c.minLength=n):"maxLength"===i&&null!=r?(h.maxLength=Number(r),c.maxLength=n):"min"===i&&null!=r?(h.minimum=Number(r),c.minimum=n):"max"===i&&null!=r?(h.maximum=Number(r),c.maximum=n):"pattern"===i&&"string"==typeof r&&r?(h.pattern=r,c.pattern=n):"minItems"===i&&null!=r?(h.minItems=Number(r),c.minItems=n):"maxItems"===i&&null!=r?(h.maxItems=Number(r),c.maxItems=n):"email"===i?(h.format="email",c.format=n):"url"===i&&(h.format="uri",c.format=n)}h.errorMessage=c,i[t]=h,u&&(r.push(t),n[t]=s(u.message)??Gs("required",e))}return{type:"object",properties:i,required:r,...Object.keys(n).length?{errorMessage:{required:n}}:{},additionalProperties:!1}}(t,e);if(!s)return;try{n=ho.compile(s)}catch{return}i.set(r,n)}return n})(t,i);if(n&&!n(e))for(const t of n.errors??[]){const e=fo(t);e&&!(e in r)&&t.message&&(r[e]=t.message)}for(const[n,s]of Object.entries(((t,e,i)=>{const r={},n=e??{};for(const e of Ks(t)){const t=e.configs?.key;if(t)for(const s of e.validations??[]){if("custom"!==s.validator||!s.customValidator)continue;const e=ao(`const value = dataMap?.[${JSON.stringify(t)}];\n${s.customValidator}`,n);if(!0!==e&&null!=e&&!(t in r))if("string"==typeof e)r[t]=e;else if(e instanceof Error)r[t]=e.message;else{const e=Fs(s.message,i);r[t]="string"==typeof e?e:Gs("custom",i)}}}return r})(t,e,i)))n in r||(r[n]=s);const s="object"==typeof e&&null!==e?e:void 0;for(const e of((t,e)=>{const i=new Set,r=(t,n)=>{const s=n||!!t.rules?.length&&!0===uo(t.rules,e).hidden,o=t.configs?.key;if(s&&o&&i.add(o),"collection"!==t.type)for(const e of t.children??[])r(e,s)};return r(t,!1),i})(t,s))delete r[e];return{valid:0===Object.keys(r).length,errors:r}};function po(t){return t.split(".").slice(1).map((t=>`/children/${t}`)).join("")}function mo(t,e){if(t.configs?.uid===e)return"";for(const[i,r]of(t.children??[]).entries()){const t=mo(r,e);if(void 0!==t)return`/children/${i}${t}`}}function vo(t,e){let i=t;for(const t of e.split(".").slice(1))i=i?.children?.[Number(t)];return i}var yo=(Ls??Us).applyPatch,go=(t,e,i)=>({spec:yo(t,e,!0,!1).newDocument,patches:e,inverse:i}),$o=(t,e)=>{const i=vo(t,e);if(!i)throw new Error(`No brick at path "${e}"`);return i},wo=(t,e)=>{const i=mo(t,e);if(void 0===i)throw new Error(`No brick with uid "${e}"`);let r=t;for(const t of i.split("/children/").slice(1))r=r.children[Number(t)];return{pointer:i,brick:r}},bo=t=>JSON.parse(JSON.stringify(t));function _o(t,e,i,r){const n=$o(t,i),s=po(i),o=bo(e);if(!n.children){const e=`${s}/children`;return go(t,[{op:"add",path:e,value:[o]}],[{op:"remove",path:e}])}const a=`${s}/children/${Math.min(r??n.children.length,n.children.length)}`;return go(t,[{op:"add",path:a,value:o}],[{op:"remove",path:a}])}function Eo(t,e){if("0"===e)throw new Error("Cannot remove the root brick");const i=$o(t,e),r=po(e);return go(t,[{op:"remove",path:r}],[{op:"add",path:r,value:i}])}function ko(t,e,i){if("0"===e||"0"===i)throw new Error("Cannot move the root brick");const r=$o(t,e),n=e.split(".").map(Number),s=i.split(".").map(Number),o=n.length-1,a=n[o],u=s.length>o&&n.slice(0,o).every(((t,e)=>t===s[e])),h=[...s];if(u){if(h[o]===a&&h.length>n.length)throw new Error(`Cannot move a brick into its own subtree ("${e}" → "${i}")`);h[o]>a&&(h[o]-=1)}const c=po(e),f=po(h.join("."));return go(t,[{op:"remove",path:c},{op:"add",path:f,value:r}],[{op:"remove",path:f},{op:"add",path:c,value:r}])}var Oo=t=>({...t,...t.configs?{configs:{...t.configs,uid:crypto.randomUUID()}}:{},...t.children?{children:t.children.map(Oo)}:{}});function So(t,e){if("0"===e)throw new Error("Cannot duplicate the root brick");const i=$o(t,e),r=e.split("."),n=Number(r[r.length-1])+1,s=po([...r.slice(0,-1),String(n)].join(".")),o=Oo(bo(i));return go(t,[{op:"add",path:s,value:o}],[{op:"remove",path:s}])}var xo=(t,e,i,r,n)=>{const s=`${e}/${i}`;return void 0===n?go(t,[{op:"add",path:s,value:r}],[{op:"remove",path:s}]):go(t,[{op:"replace",path:s,value:r}],[{op:"replace",path:s,value:n}])};function jo(t,e,i){const{pointer:r,brick:n}=wo(t,e),s={...n.configs,...i};return xo(t,r,"configs",s,n.configs)}function Io(t,e,i){const{pointer:r,brick:n}=wo(t,e),s={...n.styles,...i};return xo(t,r,"styles",s,n.styles)}function Po(t,e,i){const{pointer:r,brick:n}=wo(t,e);return xo(t,r,"validations",i,n.validations)}function Co(t,e,i){const{pointer:r,brick:n}=wo(t,e);return xo(t,r,"rules",i,n.rules)}class To{past=[];future=[];record(t){this.past.push({patches:t.patches,inverse:t.inverse}),this.future=[]}get canUndo(){return this.past.length>0}get canRedo(){return this.future.length>0}undo(t){const e=this.past.pop();if(e)return this.future.push(e),yo(t,e.inverse,!0,!1).newDocument}redo(t){const e=this.future.pop();if(e)return this.past.push(e),yo(t,e.patches,!0,!1).newDocument}clear(){this.past=[],this.future=[]}}var Ao=t=>"nested-form"===t.id&&"string"==typeof t.configs?.specRef,No=t=>{if(!t)return!1;for(const{brick:e}of Hs(t))if(Ao(e)&&e.configs?.specRef)return!0;return!1};async function Mo(t,e={}){const i=e.specSourceService??oo.specSourceService,r=e.maxDepth??5,n=async(t,e)=>{if(Ao(t)&&t.configs?.specRef){const s=String(t.configs.specRef);if(e.includes(s))throw new Error(`Circular nested form reference: ${[...e,s].join(" → ")}`);if(e.length>=r)throw new Error(`Nested forms exceed the maximum depth of ${r} (${s})`);const o=await i.fetchSpec(s),a=await n(structuredClone(o),[...e,s]);return{type:"panel",id:"group",name:t.name,configs:{...t.configs,label:t.configs.label??a.name},styles:t.styles,rules:t.rules,children:a.children??[]}}return t.children?.length?{...t,children:await Promise.all(t.children.map((t=>n(t,e))))}:t};return n(structuredClone(t),[])}function Ro(t){return new class extends Ws{constructor(){var e;super({type:t.type,dataType:t.dataType,id:t.id,name:t.name,category:t.category,configsForm:t.configsForm,styles:null!==(e=t.styles)&&void 0!==e?e:{},validators:t.validators,unWrapData:t.unWrapData,isPrivate:t.isPrivate,defaultConfigs:t.defaultConfigs})}render(e){return t.render(e)}renderBuilder(e){var i;return(null!==(i=t.renderBuilder)&&void 0!==i?i:t.render)(e)}getComponent(t){return this.render(t)}getComponentWithActions(t){return this.renderBuilder(t)}}}const Do=t=>t.replace(/-([a-z])/g,((t,e)=>e.toUpperCase()));function zo(t){const e=Object.entries(null!=t?t:{}).filter((([,t])=>null!=t&&""!==t));if(0===e.length)return;const i={};for(const[t,r]of e)i[Do(t)]=String(r);return i}const Lo=(t,e)=>{if(!e.includes("."))return t[e];let i=t;for(const t of e.split(".")){if("object"!=typeof i||null===i)return;i=i[t]}return i};function Uo(t,e="label",i="value"){return Array.isArray(t)?t.map((t=>{var r,n;if("object"==typeof t&&null!==t){const s=t,o=null!==(r=Lo(s,e))&&void 0!==r?r:Lo(s,i),a=null!==(n=Lo(s,i))&&void 0!==n?n:Lo(s,e);return{label:String(null!=o?o:""),value:String(null!=a?a:"")}}return{label:String(t),value:String(t)}})).filter((t=>""!==t.label)):String(null!=t?t:"").split("\n").map((t=>t.trim())).filter(Boolean).map((t=>({label:t,value:t})))}const qo=(t,e)=>"9"===t?/\d/.test(e):"a"===t||"A"===t?/[a-zA-Z]/.test(e):/[0-9a-zA-Z]/.test(e),Fo=t=>"9"===t||"a"===t||"A"===t||"*"===t,Bo=(t,e)=>{var i,r,n,s;return null!==(s=null!==(r=null===(i=t.configs)||void 0===i?void 0:i.label)&&void 0!==r?r:null===(n=t.configs)||void 0===n?void 0:n.key)&&void 0!==s?s:e},Vo=(e,i)=>{var r,n;const s=null===(r=e.configs)||void 0===r?void 0:r.prefix,o=null===(n=e.configs)||void 0===n?void 0:n.suffix;return s||o?t("div",{class:"fk-adorned"},s?t("span",{class:"fk-adorned__affix"},s):null,i,o?t("span",{class:"fk-adorned__affix"},o):null):i},Go=e=>e.error?t("span",{class:"fk-field__error",role:"alert"},e.error):null,Ho=t=>t.error?{"aria-invalid":"true"}:{},Ko=(e,i,r)=>t("div",{class:"fk-field",style:zo(e.styles)},t("span",{class:"fk-field__label"},Bo(e,i)),r,Go(e)),Wo=(e,i,r)=>t("label",{class:"fk-field",style:zo(e.styles)},t("span",{class:"fk-field__label"},Bo(e,i)),r,Go(e)),Jo=e=>Ro({type:"input",dataType:"string",id:e.id,name:e.name,category:"Inputs",defaultConfigs:e.maskable?{label:e.name,mask:""}:{label:e.name},render:i=>{var r,n;return Wo(i,e.name,Vo(i,t("input",Object.assign({},Ho(i),{class:"fk-field__input fk-adorned__input",type:e.inputType,value:null!==(r=i.data)&&void 0!==r?r:"",placeholder:null===(n=i.configs)||void 0===n?void 0:n.placeholder,disabled:i.editable||i.disabled,onInput:t=>{var e,r;const n=t.target,s=null===(e=i.configs)||void 0===e?void 0:e.mask,o=s?((t,e)=>{if(!e)return t;let i="",r=0;for(let n=0;n<e.length&&r<t.length;n++){const s=e[n];if(Fo(s))for(;r<t.length;){const e=t[r++];if(qo(s,e)){i+="A"===s?e.toUpperCase():e;break}}else i+=s,t[r]===s&&r++}return i})(n.value,s):n.value;o!==n.value&&(n.value=o),null===(r=i.onDataChange)||void 0===r||r.call(i,o)}}))))}}),Zo=Jo({id:"text",name:"Text",inputType:"text",maskable:!0}),Xo=Jo({id:"email",name:"Email",inputType:"email"}),Yo=Jo({id:"password",name:"Password",inputType:"password"}),Qo=Jo({id:"url",name:"URL",inputType:"url"}),ta=Jo({id:"phone",name:"Phone",inputType:"tel",maskable:!0}),ea=Ro({type:"input",dataType:"string",id:"textarea",name:"Text area",category:"Inputs",defaultConfigs:{label:"Text area"},render:e=>{var i,r;return Wo(e,"Text area",t("textarea",Object.assign({},Ho(e),{class:"fk-field__input fk-field__input--textarea",value:null!==(i=e.data)&&void 0!==i?i:"",placeholder:null===(r=e.configs)||void 0===r?void 0:r.placeholder,disabled:e.editable||e.disabled,onInput:t=>{var i;return null===(i=e.onDataChange)||void 0===i?void 0:i.call(e,t.target.value)}})))}}),ia=Ro({type:"input",dataType:"number",id:"number",name:"Number",category:"Inputs",defaultConfigs:{label:"Number"},render:e=>{var i;return Wo(e,"Number",Vo(e,t("input",Object.assign({},Ho(e),{class:"fk-field__input fk-adorned__input",type:"number",value:null==e.data?"":String(e.data),placeholder:null===(i=e.configs)||void 0===i?void 0:i.placeholder,disabled:e.editable||e.disabled,onInput:t=>{var i;const r=t.target.value;null===(i=e.onDataChange)||void 0===i||i.call(e,""===r?void 0:Number(r))}}))))}}),ra=Ro({type:"input",dataType:"string",id:"date",name:"Date",category:"Inputs",defaultConfigs:{label:"Date"},render:e=>{var i;return Wo(e,"Date",t("input",Object.assign({},Ho(e),{class:"fk-field__input",type:"date",value:null!==(i=e.data)&&void 0!==i?i:"",disabled:e.editable||e.disabled,onInput:t=>{var i;const r=t.target.value;null===(i=e.onDataChange)||void 0===i||i.call(e,""===r?void 0:r)}})))}}),na=Ro({type:"input",dataType:"string",id:"select",name:"Select",category:"Inputs",defaultConfigs:{label:"Select",optionsSource:"static",options:"Option 1\nOption 2"},render:e=>{var i;return Ko(e,"Select",t("fk-select-input",{configs:e.configs,value:null!==(i=e.data)&&void 0!==i?i:"",disabled:e.editable||e.disabled,invalid:!!e.error,dataMap:e.dataMap,onSelectValueChange:t=>{var i;t.stopPropagation(),null===(i=e.onDataChange)||void 0===i||i.call(e,t.detail)}}))}}),sa=Ro({type:"input",dataType:"array",id:"multi-select",name:"Multi select",category:"Inputs",defaultConfigs:{label:"Multi select",optionsSource:"static",options:"Option 1\nOption 2\nOption 3"},render:e=>Ko(e,"Multi select",t("fk-select-input",{configs:e.configs,value:Array.isArray(e.data)?e.data:[],multiple:!0,disabled:e.editable||e.disabled,invalid:!!e.error,dataMap:e.dataMap,onSelectValueChange:t=>{var i;t.stopPropagation(),null===(i=e.onDataChange)||void 0===i||i.call(e,t.detail)}}))}),oa=Jo({id:"time",name:"Time",inputType:"time"}),aa=Jo({id:"datetime",name:"Date / Time",inputType:"datetime-local"}),ua=t=>{var e,i,r;return Uo(null===(e=t.configs)||void 0===e?void 0:e.options,"string"==typeof(null===(i=t.configs)||void 0===i?void 0:i.labelKey)?t.configs.labelKey:"label","string"==typeof(null===(r=t.configs)||void 0===r?void 0:r.valueKey)?t.configs.valueKey:"value")},ha=Ro({type:"input",dataType:"array",id:"select-boxes",name:"Select boxes",category:"Inputs",defaultConfigs:{label:"Select boxes",options:"Option 1\nOption 2\nOption 3"},render:e=>{const i=Array.isArray(e.data)?e.data:[];return t("div",{class:"fk-field",style:zo(e.styles)},t("span",{class:"fk-field__label"},Bo(e,"Select boxes")),t("div",{class:"fk-radio-group"},ua(e).map((r=>t("label",{class:"fk-radio",key:r.value},t("input",{type:"checkbox",checked:i.includes(r.value),disabled:e.editable||e.disabled,onChange:t=>{var n;const s=t.target.checked?[...i,r.value]:i.filter((t=>t!==r.value));null===(n=e.onDataChange)||void 0===n||n.call(e,s.length?s:void 0)}}),t("span",null,r.label))))),e.error?t("span",{class:"fk-field__error"},e.error):null)}}),ca=Ro({type:"input",dataType:"array",id:"tags",name:"Tags",category:"Inputs",defaultConfigs:{label:"Tags"},render:e=>{const i=Array.isArray(e.data)?e.data:[];return Wo(e,"Tags",t("div",{class:"fk-tags"},i.map((r=>t("span",{class:"fk-tags__chip",key:r},r,t("button",{type:"button",class:"fk-tags__remove",disabled:e.editable||e.disabled,onClick:()=>{var t;const n=i.filter((t=>t!==r));null===(t=e.onDataChange)||void 0===t||t.call(e,n.length?n:void 0)}},"✕")))),t("input",{class:"fk-tags__input",type:"text",placeholder:"Add a tag…",disabled:e.editable||e.disabled,onKeyDown:t=>{var r;if("Enter"!==t.key)return;t.preventDefault();const n=t.target,s=n.value.trim();s&&!i.includes(s)&&(null===(r=e.onDataChange)||void 0===r||r.call(e,[...i,s]),n.value="")}})))}}),fa=Ro({type:"input",dataType:"string",id:"signature",name:"Signature",category:"Inputs",defaultConfigs:{label:"Signature"},render:e=>{var i;return Wo(e,"Signature",t("fk-signature-input",{value:null!==(i=e.data)&&void 0!==i?i:void 0,disabled:e.editable||e.disabled,onSignatureChange:t=>{var i;t.stopPropagation(),null===(i=e.onDataChange)||void 0===i||i.call(e,t.detail)}}))}}),la=Ro({type:"panel",dataType:"void",id:"tabs",name:"Tabs",category:"Layout",defaultConfigs:{validateTabs:!1},render:e=>{var i,r;const n=(null!==(r=null===(i=e.brickSpec)||void 0===i?void 0:i.children)&&void 0!==r?r:[]).map(((t,i)=>{var r,n;const s=Fs(null===(r=t.configs)||void 0===r?void 0:r.label,e.locale);return"string"==typeof s?s:null!==(n=t.name)&&void 0!==n?n:`Tab ${i+1}`}));return t("fk-tabs",{tabLabels:n,editable:e.editable,spec:e.brickSpec,dataMap:e.dataMap,locale:e.locale,style:zo(e.styles)},e.children)}}),da=Ro({type:"input",dataType:"string",id:"radio",name:"Radio",category:"Inputs",defaultConfigs:{label:"Radio",options:"Option 1\nOption 2"},render:e=>t("div",{class:"fk-field",style:zo(e.styles)},t("span",{class:"fk-field__label"},Bo(e,"Radio")),t("div",Object.assign({class:"fk-radio-group",role:"radiogroup"},Ho(e)),ua(e).map((i=>{var r,n;return t("label",{class:"fk-radio",key:i.value},t("input",{type:"radio",name:null!==(n=null===(r=e.configs)||void 0===r?void 0:r.key)&&void 0!==n?n:e.path,checked:e.data===i.value,disabled:e.editable||e.disabled,onChange:()=>{var t;return null===(t=e.onDataChange)||void 0===t?void 0:t.call(e,i.value)}}),t("span",null,i.label))}))),e.error?t("span",{class:"fk-field__error"},e.error):null)}),pa=[{key:"street",label:()=>e("address.street"),full:!0},{key:"city",label:()=>e("address.city"),full:!1},{key:"zip",label:()=>e("address.zip"),full:!1},{key:"country",label:()=>e("address.country"),full:!1}],ma=Ro({type:"input",dataType:"object",id:"address",name:"Address",category:"Inputs",defaultConfigs:{label:"Address"},render:e=>{var i;const r=null!==(i=e.data)&&void 0!==i?i:{};return Ko(e,"Address",t("div",{class:"fk-address"},pa.map((i=>{var n;return t("label",{class:{"fk-address__part":!0,"fk-address__part--full":i.full},key:i.key},t("span",{class:"fk-address__label"},i.label()),t("input",{class:"fk-field__input",type:"text",value:null!==(n=r[i.key])&&void 0!==n?n:"",disabled:e.editable||e.disabled,onInput:t=>{var n;const s=t.target.value,o=Object.assign(Object.assign({},r),{[i.key]:s||void 0}),a=Object.fromEntries(Object.entries(o).filter((([,t])=>void 0!==t)));null===(n=e.onDataChange)||void 0===n||n.call(e,Object.keys(a).length?a:void 0)}}))}))))}}),va=Ro({type:"input",dataType:"object",id:"file",name:"File",category:"Data",defaultConfigs:{label:"File",accept:"",uploadUrl:"",multiple:!1},render:e=>{var i,r,n;return Ko(e,"File",t("fk-file-input",{value:e.data,accept:null===(i=e.configs)||void 0===i?void 0:i.accept,uploadUrl:null===(r=e.configs)||void 0===r?void 0:r.uploadUrl,multiple:!0===(null===(n=e.configs)||void 0===n?void 0:n.multiple),disabled:e.editable||e.disabled,onFileValueChange:t=>{var i;t.stopPropagation(),null===(i=e.onDataChange)||void 0===i||i.call(e,t.detail)}}))}}),ya=Ro({type:"collection",dataType:"array",id:"data-grid",name:"Data grid",category:"Data",defaultConfigs:{label:"Data grid"},render:i=>Ko(i,"Data grid",i.editable||!i.brickSpec?t("div",{class:"fk-grid-template"},t("span",{class:"fk-grid-template__hint"},e("grid.columns")),i.children):t("fk-data-grid",{spec:i.brickSpec,value:i.data,disabled:i.disabled,locale:i.locale,utils:i.utils,onGridValueChange:t=>{var e;t.stopPropagation(),null===(e=i.onDataChange)||void 0===e||e.call(i,t.detail)}}))}),ga=Ro({type:"input",dataType:"string",id:"hidden",name:"Hidden",category:"Data",defaultConfigs:{},render:e=>{var i,r;return e.editable?t("div",{class:"fk-hidden-chip"},"hidden: ",null===(i=e.configs)||void 0===i?void 0:i.key):t("input",{type:"hidden",value:null!==(r=e.data)&&void 0!==r?r:""})}}),$a=Ro({type:"output",dataType:"void",id:"content",name:"Content",category:"Layout",defaultConfigs:{content:"Some text…"},render:e=>{var i,r;return t("div",{class:"fk-content",style:zo(e.styles)},String(null!==(r=null===(i=e.configs)||void 0===i?void 0:i.content)&&void 0!==r?r:"").split("\n").map((e=>t("p",{class:"fk-content__line"},e))))}}),wa=Ro({type:"panel",dataType:"void",id:"stepper",name:"Stepper",category:"Layout",defaultConfigs:{validateSteps:!1,allowStepClick:!0,showSubmit:!1},render:e=>{var i,r;const n=(null!==(r=null===(i=e.brickSpec)||void 0===i?void 0:i.children)&&void 0!==r?r:[]).map(((t,i)=>{var r,n;const s=Fs(null===(r=t.configs)||void 0===r?void 0:r.label,e.locale);return"string"==typeof s?s:null!==(n=t.name)&&void 0!==n?n:`Step ${i+1}`}));return t("fk-stepper",{stepLabels:n,editable:e.editable,spec:e.brickSpec,dataMap:e.dataMap,locale:e.locale,style:zo(e.styles)},e.children)}}),ba=Ro({type:"input",dataType:"boolean",id:"checkbox",name:"Checkbox",category:"Inputs",defaultConfigs:{label:"Checkbox"},render:e=>t("label",{class:"fk-field fk-field--inline",style:zo(e.styles)},t("input",{class:"fk-field__checkbox",type:"checkbox",checked:!0===e.data,disabled:e.editable||e.disabled,onChange:t=>{var i;return null===(i=e.onDataChange)||void 0===i?void 0:i.call(e,t.target.checked)}}),t("span",{class:"fk-field__label"},Bo(e,"Checkbox")),e.error?t("span",{class:"fk-field__error"},e.error):null)}),_a=Ro({type:"panel",dataType:"void",id:"group",name:"Group",category:"Layout",render:e=>{var i;return t("fieldset",{class:"fk-group",style:zo(e.styles)},(null===(i=e.configs)||void 0===i?void 0:i.label)?t("legend",{class:"fk-group__legend"},e.configs.label):null,e.children)}}),Ea=Ro({type:"panel",dataType:"void",id:"row",name:"Row",category:"Layout",render:e=>t("div",{class:"fk-row",style:zo(e.styles)},e.children)}),ka=Ro({type:"panel",dataType:"void",id:"column",name:"Column",category:"Layout",render:e=>t("div",{class:"fk-column",style:zo(e.styles)},e.children)}),Oa=(t,e)=>{var r;if(Array.isArray(e))return e.map((e=>Oa(t,e))).filter(Boolean).join(", ");if(!0===e)return i("recap.yes","Yes");if(!1===e)return i("recap.no","No");if(e&&"object"==typeof e)return"string"==typeof e.name&&"url"in e?e.name:Object.values(e).filter((t=>"string"==typeof t&&t)).join(" ");const n=String(null!=e?e:"");if(null!=(null===(r=t.configs)||void 0===r?void 0:r.options)){const e=Uo(t.configs.options,"string"==typeof t.configs.labelKey?t.configs.labelKey:"label","string"==typeof t.configs.valueKey?t.configs.valueKey:"value").find((t=>t.value===n));if(e)return e.label}return n},Sa=t=>null==t||""===t||Array.isArray(t)&&0===t.length,xa=(t,e)=>{var i,r,n,s,o;return String(null!==(o=null!==(n=null!==(r=Fs(null===(i=t.configs)||void 0===i?void 0:i.label,e))&&void 0!==r?r:t.name)&&void 0!==n?n:null===(s=t.configs)||void 0===s?void 0:s.key)&&void 0!==o?o:"")},ja=t=>{var e,i;const r=[];for(const n of null!==(e=t.children)&&void 0!==e?e:[]){const t=null===(i=n.configs)||void 0===i?void 0:i.key;"input"===n.type&&t&&!t.startsWith("_")?r.push(n):"panel"===n.type&&r.push(...ja(n))}return r},Ia=(t,e,i,r,n=!1)=>{var s,o,a;if(!t)return[];const u=[];for(const h of null!==(s=t.children)&&void 0!==s?s:[]){if("recap"===h.id||"action"===h.type)continue;if(!0===uo(h.rules,e).hidden)continue;const t=null===(o=h.configs)||void 0===o?void 0:o.key,s=xa(h,i);if("collection"===h.type){const n=t&&Array.isArray(null==e?void 0:e[t])?e[t]:[];if(!n.length&&!r)continue;const o=ja(h);u.push({kind:"collection",label:s,columns:o.map((t=>xa(t,i))),rows:n.map((t=>o.map((e=>{const i=null==t?void 0:t[e.configs.key];return Sa(i)?"—":Oa(e,i)}))))});continue}if("panel"===h.type){const t=Fs(null===(a=h.configs)||void 0===a?void 0:a.label,i);if(n&&"string"==typeof t&&t.trim()){const n=Ia(h,e,i,r);n.length&&(u.push({kind:"section",label:t}),u.push(...n));continue}u.push(...Ia(h,e,i,r,n));continue}if("input"!==h.type||!t||t.startsWith("_"))continue;const c=null==e?void 0:e[t];Sa(c)&&!r||u.push({kind:"field",label:s,value:Sa(c)?"—":Oa(h,c)})}return u},Pa=Ro({type:"output",dataType:"void",id:"recap",name:"Recap",category:"Layout",defaultConfigs:{label:"Recap",showEmpty:!1,groupBySections:!1},render:e=>{var r,n;const s=Ia(e.rootSpec,e.dataMap,e.locale,!0===(null===(r=e.configs)||void 0===r?void 0:r.showEmpty),!0===(null===(n=e.configs)||void 0===n?void 0:n.groupBySections)),o=[];let a=[];const u=()=>{a.length&&(o.push(t("dl",{class:"fk-recap__list"},a.map((e=>t("div",{class:"fk-recap__row",key:e.label},t("dt",{class:"fk-recap__term"},e.label),t("dd",{class:"fk-recap__value"},e.value)))))),a=[])};for(const e of s)"field"!==e.kind?(u(),o.push("section"!==e.kind?t("section",{class:"fk-recap__section",key:e.label},t("span",{class:"fk-recap__section-title"},e.label),e.rows.length?t("div",{class:"fk-recap__table-wrap"},t("table",{class:"fk-recap__table"},t("thead",null,t("tr",null,t("th",{class:"fk-recap__index-cell"},"#"),e.columns.map((e=>t("th",{key:e},e))))),t("tbody",null,e.rows.map(((e,i)=>t("tr",{key:i},t("td",{class:"fk-recap__index-cell"},i+1),e.map(((e,i)=>t("td",{key:i},e))))))))):t("p",{class:"fk-recap__empty"},i("recap.empty","Nothing to summarize yet."))):t("span",{class:"fk-recap__group-title",key:`section:${e.label}`},e.label))):a.push(e);return u(),t("div",{class:"fk-field fk-recap",style:zo(e.styles)},t("span",{class:"fk-field__label"},Bo(e,"Recap")),o.length?o:t("p",{class:"fk-recap__empty"},i("recap.empty","Nothing to summarize yet.")))}}),Ca=t=>{if(!t)return[];const e=[],i=t=>{var r,n;const s=null===(r=t.configs)||void 0===r?void 0:r.key;"input"===t.type&&s&&!s.startsWith("_")&&e.push(s);for(const e of null!==(n=t.children)&&void 0!==n?n:[])i(e)};return i(t),e},Ta=Ro({type:"input",dataType:"string",id:"code",name:"Code",category:"Inputs",defaultConfigs:{label:"Code",placeholder:"return value;"},render:e=>{var i,r,n,s;return Ko(e,"Code",e.editable||e.disabled?t("pre",{class:"fk-code-preview"},e.data||String(null!==(r=null===(i=e.configs)||void 0===i?void 0:i.placeholder)&&void 0!==r?r:"")):t("fk-code-editor",{value:null!==(n=e.data)&&void 0!==n?n:"",completions:Ca(e.rootSpec),placeholder:null===(s=e.configs)||void 0===s?void 0:s.placeholder,onCodeChange:t=>{var i;t.stopPropagation(),null===(i=e.onDataChange)||void 0===i||i.call(e,t.detail||void 0)}}))}}),Aa=Ro({type:"panel",dataType:"void",id:"nested-form",name:"Nested form",category:"Layout",defaultConfigs:{label:"Nested form",specRef:""},render:e=>{var r;const n=(null===(r=e.configs)||void 0===r?void 0:r.specRef)||"";return t("div",{class:"fk-nested-form",style:zo(e.styles)},t("span",{class:"fk-field__label"},Bo(e,"Nested form")),t("p",{class:"fk-nested-form__hint"},n?`${i("nestedForm.ref","Referenced form")}: ${n}`:i("nestedForm.missing","Set the specRef config to reference a form.")))}});function Na(){h([Zo,Xo,Yo,Qo,ta,ea,ia,ra,oa,aa,na,sa,da,ha,ba,ca,fa,ma,Ta,va,ya,ga,$a,Pa,Aa,_a,Ea,ka,wa,la])}export{Aa as $,h as A,Ro as B,Zo as C,Xo as D,Yo as E,Qo as F,ta as G,ea as H,ia as I,ra as J,oa as K,aa as L,na as M,sa as N,da as O,ha as P,ba as Q,ca as R,To as S,fa as T,ma as U,Ta as V,va as W,ya as X,ga as Y,$a as Z,Pa as _,l as a,_a as a0,Ea as a1,ka as a2,wa as a3,la as a4,c as b,uo as c,Na as d,_o as e,vo as f,f as g,Eo as h,So as i,Io as j,Po as k,Co as l,ko as m,d as n,Hs as o,No as p,Mo as q,Bs as r,oo as s,qs as t,jo as u,lo as v,Uo as w,ao as x,Ks as y,u as z}
12
+ */function Ns(t,e){e.unobserve()}function Ms(t,e){var i,r=function(t){return Cs.get(t)}(t);if(r){var n=function(t,e){return t.observers.get(e)}(r,e);i=n&&n.observer}else r=new Ts(t),Cs.set(t,r);if(i)return i;if(i={},r.value=ds(t),e){i.callback=e,i.next=null;var s=function(){Rs(i)},o=function(){clearTimeout(i.next),i.next=setTimeout(s)};"undefined"!=typeof window&&(window.addEventListener("mouseup",o),window.addEventListener("keyup",o),window.addEventListener("mousedown",o),window.addEventListener("keydown",o),window.addEventListener("change",o))}return i.patches=[],i.object=t,i.unobserve=function(){Rs(i),clearTimeout(i.next),function(t,e){t.observers.delete(e.callback)}(r,i),"undefined"!=typeof window&&(window.removeEventListener("mouseup",o),window.removeEventListener("keyup",o),window.removeEventListener("mousedown",o),window.removeEventListener("keydown",o),window.removeEventListener("change",o))},r.observers.set(e,new As(e,i)),i}function Rs(t,e){void 0===e&&(e=!1);var i=Cs.get(t.object);Ds(i.value,t.object,t.patches,"",e),t.patches.length&&Os(i.value,t.patches);var r=t.patches;return r.length>0&&(t.patches=[],t.callback&&t.callback(r)),r}function Ds(t,e,i,r,n){if(e!==t){"function"==typeof e.toJSON&&(e=e.toJSON());for(var s=ls(e),o=ls(t),a=!1,u=o.length-1;u>=0;u--){var h=t[f=o[u]];if(!fs(e,f)||void 0===e[f]&&void 0!==h&&!1===Array.isArray(e))Array.isArray(t)===Array.isArray(e)?(n&&i.push({op:"test",path:r+"/"+ms(f),value:ds(h)}),i.push({op:"remove",path:r+"/"+ms(f)}),a=!0):(n&&i.push({op:"test",path:r,value:t}),i.push({op:"replace",path:r,value:e}));else{var c=e[f];"object"==typeof h&&null!=h&&"object"==typeof c&&null!=c&&Array.isArray(h)===Array.isArray(c)?Ds(h,c,i,r+"/"+ms(f),n):h!==c&&(n&&i.push({op:"test",path:r+"/"+ms(f),value:ds(h)}),i.push({op:"replace",path:r+"/"+ms(f),value:ds(c)}))}}if(a||s.length!=o.length)for(u=0;u<s.length;u++){var f;fs(t,f=s[u])||void 0===e[f]||i.push({op:"add",path:r+"/"+ms(f),value:ds(e[f])})}}}function zs(t,e,i){void 0===i&&(i=!1);var r=[];return Ds(t,e,r,"",i),r}var Ls=Object.assign({},Ps,Object.freeze({__proto__:null,compare:zs,generate:Rs,observe:Ms,unobserve:Ns}),{JsonPatchError:$s,deepClone:ds,escapePathComponent:ms,unescapePathComponent:vs}),Us=Object.freeze({__proto__:null,JsonPatchError:$s,_areEquals:Is,applyOperation:ks,applyPatch:Os,applyReducer:Ss,compare:zs,deepClone:ds,default:Ls,escapePathComponent:ms,generate:Rs,getValueByPointer:Es,observe:Ms,unescapePathComponent:vs,unobserve:Ns,validate:js,validator:xs});function qs(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)&&Object.keys(t).length>0&&Object.values(t).every((t=>"string"==typeof t))}function Fs(t,e){return qs(t)?e&&void 0!==t[e]?t[e]:Object.values(t)[0]:t}function Bs(t,e){if(!t)return t;const i={};for(const[r,n]of Object.entries(t))i[r]=Fs(n,e);return i}var Vs={en:{required:"This field is required",minLength:"Must be at least {value} characters",maxLength:"Must be at most {value} characters",min:"Must be at least {value}",max:"Must be at most {value}",pattern:"Invalid format",minItems:"Select at least {value} item(s)",maxItems:"Select at most {value} item(s)",email:"Invalid email address",url:"Invalid URL",type:"Invalid value",custom:"Invalid value"},fr:{required:"Ce champ est obligatoire",minLength:"Minimum {value} caractères",maxLength:"Maximum {value} caractères",min:"Minimum {value}",max:"Maximum {value}",pattern:"Format invalide",minItems:"Sélectionnez au moins {value} élément(s)",maxItems:"Sélectionnez au plus {value} élément(s)",email:"Adresse email invalide",url:"URL invalide",type:"Valeur invalide",custom:"Valeur invalide"}};function Gs(t,e,i){return((Vs[e??"en"]??Vs.en)[t]??Vs.en[t]??"Invalid value").replace("{value}",String(i??""))}function*Hs(t,e="0"){if(t){yield{brick:t,path:e};for(const[i,r]of(t.children??[]).entries())yield*Hs(r,`${e}.${i}`)}}function*Ks(t){if(t&&(yield t,"collection"!==t.type))for(const e of t.children??[])yield*Ks(e)}class Ws{type;dataType;id;name;configsForm;category;styles;unWrapData;isPrivate;validators;defaultConfigs;constructor(t){this.type=t.type,this.dataType=t.dataType,this.id=t.id,this.name=t.name,this.configsForm=t.configsForm,this.category=t.category,this.styles=t.styles,this.unWrapData=t.unWrapData??!1,this.isPrivate=t.isPrivate??!1,this.validators=t.validators??[],this.defaultConfigs=t.defaultConfigs}getBrickEmptySpec(){return{type:this.type,dataType:this.dataType,id:this.id,name:this.name,...void 0!==this.category?{category:this.category}:{},...void 0!==this.configsForm?{configsForm:this.configsForm}:{},...void 0!==this.styles?{styles:this.styles}:{},...void 0!==this.defaultConfigs?{configs:{...this.defaultConfigs}}:{},validators:this.validators}}}var Js=new Set(["__proto__","constructor","prototype"]);class Zs{value;constructor(t){this.value=t}}var Xs=(t,e,i)=>{t.scopes[t.scopes.length-1].set(e,i)},Ys=t=>{if("number"==typeof t)return t;const e=String(t);if(Js.has(e))throw new Error(`Access to "${e}" is not allowed`);return e},Qs=(t,e)=>({object:to(t,e.object),prop:Ys(e.computed?to(t,e.property):e.property.name),optional:!0===e.optional}),to=(t,e)=>{if(++t.steps>1e5)throw new Error("Sandbox execution budget exceeded");switch(e.type){case"Program":case"BlockStatement":for(const i of e.body){const e=to(t,i);if(e instanceof Zs)return e}return;case"ReturnStatement":return new Zs(e.argument?to(t,e.argument):void 0);case"IfStatement":return to(t,e.test)?to(t,e.consequent):e.alternate?to(t,e.alternate):void 0;case"VariableDeclaration":for(const i of e.declarations){const e=i.id;if("Identifier"!==e.type)throw new Error("Only simple variable names are supported");Xs(t,e.name,i.init?to(t,i.init):void 0)}return;case"ExpressionStatement":return void to(t,e.expression);case"Literal":return e.value;case"TemplateLiteral":{const i=e.expressions;let r="";return e.quasis.forEach(((e,n)=>{r+=e.value.cooked??"",n<i.length&&(r+=String(to(t,i[n])))})),r}case"Identifier":return((t,e)=>{for(let i=t.scopes.length-1;i>=0;i--)if(t.scopes[i].has(e))return t.scopes[i].get(e);throw new Error(`Unknown identifier "${e}"`)})(t,e.name);case"ThisExpression":return;case"ChainExpression":return to(t,e.expression);case"MemberExpression":return((t,e)=>{const{object:i,prop:r,optional:n}=Qs(t,e);if(null==i){if(n)return;throw new Error(`Cannot read "${String(r)}" of ${String(i)}`)}return i[r]})(t,e);case"CallExpression":{const i=e.callee,r=[];for(const i of e.arguments)if("SpreadElement"===i.type){const e=to(t,i.argument);Array.isArray(e)&&r.push(...e)}else r.push(to(t,i));if("MemberExpression"===i.type){const{object:n,prop:s,optional:o}=Qs(t,i);if(null==n){if(o||!0===e.optional)return;throw new Error(`Cannot call "${String(s)}" of ${String(n)}`)}const a=n[s];if("function"!=typeof a){if(!0===e.optional&&null==a)return;throw new Error(`"${String(s)}" is not a function`)}if(a===Function||a===eval)throw new Error("This function is not allowed");return a.apply(n,r)}const n=to(t,i);if("function"!=typeof n){if(!0===e.optional&&null==n)return;throw new Error("Value is not a function")}if(n===Function||n===eval)throw new Error("This function is not allowed");return n(...r)}case"ArrowFunctionExpression":{const i=e.params,r=e.body,n=[...t.scopes];return(...s)=>{const o=new Map;i.forEach(((t,e)=>{if("Identifier"!==t.type)throw new Error("Only simple parameters are supported");o.set(t.name,s[e])}));const a={steps:t.steps,scopes:[...n,o]},u=to(a,r);return t.steps=a.steps,u instanceof Zs?u.value:!0===e.expression?u:void 0}}case"BinaryExpression":{const i=to(t,e.left),r=to(t,e.right);switch(e.operator){case"===":return i===r;case"!==":return i!==r;case"==":return i==r;case"!=":return i!=r;case"<":return i<r;case"<=":return i<=r;case">":return i>r;case">=":return i>=r;case"+":return i+r;case"-":return i-r;case"*":return i*r;case"/":return i/r;case"%":return i%r;case"**":return i**r;default:throw new Error(`Unsupported operator "${String(e.operator)}"`)}}case"LogicalExpression":{const i=to(t,e.left);switch(e.operator){case"&&":return i&&to(t,e.right);case"||":return i||to(t,e.right);case"??":return i??to(t,e.right);default:throw new Error(`Unsupported operator "${String(e.operator)}"`)}}case"UnaryExpression":{const i=to(t,e.argument);switch(e.operator){case"!":return!i;case"-":return-i;case"+":return+i;case"typeof":return typeof i;default:throw new Error(`Unsupported operator "${String(e.operator)}"`)}}case"ConditionalExpression":return to(t,e.test)?to(t,e.consequent):to(t,e.alternate);case"AssignmentExpression":{const i=e.left;if("Identifier"!==i.type||"="!==e.operator)throw new Error("Only simple assignments are supported");const r=to(t,e.right);return((t,e,i)=>{for(let r=t.scopes.length-1;r>=0;r--)if(t.scopes[r].has(e))return void t.scopes[r].set(e,i);throw new Error(`Cannot assign to unknown identifier "${e}"`)})(t,i.name,r),r}case"ArrayExpression":{const i=[];for(const r of e.elements)if(r)if("SpreadElement"===r.type){const e=to(t,r.argument);Array.isArray(e)&&i.push(...e)}else i.push(to(t,r));return i}case"ObjectExpression":{const i={};for(const r of e.properties){if("SpreadElement"===r.type){const e=to(t,r.argument);if(e&&"object"==typeof e)for(const[t,r]of Object.entries(e))i[String(Ys(t))]=r;continue}const e=r.key,n=Ys(r.computed?to(t,e):"Identifier"===e.type?e.name:e.value);i[String(n)]=to(t,r.value)}return i}default:throw new Error(`Unsupported syntax: ${e.type}`)}},eo={undefined:void 0,NaN:NaN,Infinity:1/0,Math,JSON,Number,String,Boolean,Array,Object,Date,parseInt,parseFloat,isNaN,isFinite};class io{defaults;cache=new Map;constructor(t={}){this.defaults=t}resolveUrl(t){return/^https?:\/\//.test(t)||!this.defaults.baseUrl?t:`${this.defaults.baseUrl.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}fetchSpec(t){const e=this.resolveUrl(t);let i=this.cache.get(e);return i||(i=(this.defaults.fetch??globalThis.fetch.bind(globalThis))(e,{headers:this.defaults.headers,credentials:this.defaults.credentials}).then((async e=>{if(!e.ok)throw new Error(`Failed to load spec "${t}" (${e.status})`);return await e.json()})),i.catch((()=>this.cache.delete(e))),this.cache.set(e,i)),i}}class ro{defaults;cache=new Map;constructor(t={}){this.defaults=t}resolveUrl(t){return/^https?:\/\//.test(t)||!this.defaults.baseUrl?t:`${this.defaults.baseUrl.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}fetchOptions(t){const e=this.resolveUrl(t);let i=this.cache.get(e);return i||(i=(this.defaults.fetch??globalThis.fetch.bind(globalThis))(e,{headers:this.defaults.headers,credentials:this.defaults.credentials}).then((async e=>{if(!e.ok)throw new Error(`Failed to load options "${t}" (${e.status})`);return await e.json()})),i.catch((()=>this.cache.delete(e))),this.cache.set(e,i)),i}}var no=Symbol.for("formkrafter.core.services"),so=globalThis,oo=so[no]??={jsRunnerService:new class{validateJs(t,e={ecmaVersion:"latest",allowReturnOutsideFunction:!0}){try{return fe(t,e),{valid:!0}}catch(t){return{valid:!1,error:t instanceof Error?t:new Error(String(t))}}}eval(t,e={}){return function(t,e={}){const i=fe(t,{ecmaVersion:"latest",allowReturnOutsideFunction:!0}),r={steps:0,scopes:[new Map(Object.entries({...eo,...e})),new Map]},n=to(r,i);return n instanceof Zs?n.value:void 0}(t,e)}},dataSourceService:new class{defaults;cache=new Map;constructor(t={}){this.defaults=t}fetchOptions(t,e){const i={...this.defaults.headers,...e?.headers},r={};Object.keys(i).length&&(r.headers=i),this.defaults.credentials&&(r.credentials=this.defaults.credentials);const n=`${t}|${JSON.stringify(r)}`;let s=this.cache.get(n);return s||(s=fetch(t,Object.keys(r).length?r:void 0).then((e=>{if(!e.ok)throw new Error(`Data source request failed (${e.status}): ${t}`);return e.json()})).then((t=>Array.isArray(t)?t:[])).catch((t=>{throw this.cache.delete(n),t})),this.cache.set(n,s)),s}},fileUploadService:new class{async upload(t){const e=globalThis.btoa;if(!e)throw new Error("No base64 encoder available");const i=new Uint8Array(await t.arrayBuffer());let r="";for(const t of i)r+=String.fromCharCode(t);return{name:t.name,type:t.type,size:t.size,url:`data:${t.type};base64,${e(r)}`}}},specSourceService:new io,optionSourceService:new ro};oo.specSourceService??=new io,oo.optionSourceService??=new ro;var ao=(t,e)=>{try{return oo.jsRunnerService.eval(t,{dataMap:e??{}})}catch(t){return t instanceof Error?t:new Error(String(t))}},uo=(t,e)=>((t,e)=>((t,e)=>t?.filter((t=>((t,e)=>"jsonLogic"===t.type?null!=t.logic&&!0===g.apply(t.logic,e):"javaScript"===t.type&&!!t.code&&!0===ao(t.code,e))(t,e))))(t,e)?.map((t=>t.effects)).flat().filter((t=>null!=t)))(t,e)?.map((t=>{let i;return t.property?("boolean"===t.property.type?i=t.boolean:"logic"===t.property.type&&null!=t.logic?i=g.apply(t.logic,e):"code"===t.property.type&&t.code?i=ao(t.code,e):"string"===t.property.type&&(i=t.string),{[t.property.target]:i}):{}})).flat().reduce(((t,e)=>({...t,...e})),{})??{hidden:!1},ho=new ts.Ajv({allErrors:!0});us(ho,["email","uri"]),rs(ho);var co=new WeakMap,fo=t=>{if("required"===t.keyword)return t.params.missingProperty;if("errorMessage"===t.keyword){const e=t.params.errors?.[0];return e?fo(e):void 0}return t.instancePath.split("/").filter(Boolean)[0]},lo=(t,e,i)=>{const r={},n=((t,e)=>{let i=co.get(t);i||(i=new Map,co.set(t,i));const r=e??"";let n=i.get(r);if(!n){const s=function(t,e){if(!t)return;const i={},r=[],n={},s=t=>{const i=Fs(t,e);return"string"==typeof i?i:void 0};for(const o of Ks(t)){const t=o.configs?.key,a=!0===o.configs?.multiple&&"object"===o.dataType?"array":o.dataType;if(!t||!a||"void"===a)continue;const u=o.validations?.find((t=>"required"===t.validator)),h={type:a,nullable:!u},c={type:Gs("type",e)};for(const t of o.validations??[]){const{validator:i,value:r}=t,n=s(t.message)??Gs(i,e,r);"minLength"===i&&null!=r?(h.minLength=Number(r),c.minLength=n):"maxLength"===i&&null!=r?(h.maxLength=Number(r),c.maxLength=n):"min"===i&&null!=r?(h.minimum=Number(r),c.minimum=n):"max"===i&&null!=r?(h.maximum=Number(r),c.maximum=n):"pattern"===i&&"string"==typeof r&&r?(h.pattern=r,c.pattern=n):"minItems"===i&&null!=r?(h.minItems=Number(r),c.minItems=n):"maxItems"===i&&null!=r?(h.maxItems=Number(r),c.maxItems=n):"email"===i?(h.format="email",c.format=n):"url"===i&&(h.format="uri",c.format=n)}h.errorMessage=c,i[t]=h,u&&(r.push(t),n[t]=s(u.message)??Gs("required",e))}return{type:"object",properties:i,required:r,...Object.keys(n).length?{errorMessage:{required:n}}:{},additionalProperties:!1}}(t,e);if(!s)return;try{n=ho.compile(s)}catch{return}i.set(r,n)}return n})(t,i);if(n&&!n(e))for(const t of n.errors??[]){const e=fo(t);e&&!(e in r)&&t.message&&(r[e]=t.message)}for(const[n,s]of Object.entries(((t,e,i)=>{const r={},n=e??{};for(const e of Ks(t)){const t=e.configs?.key;if(t)for(const s of e.validations??[]){if("custom"!==s.validator||!s.customValidator)continue;const e=ao(`const value = dataMap?.[${JSON.stringify(t)}];\n${s.customValidator}`,n);if(!0!==e&&null!=e&&!(t in r))if("string"==typeof e)r[t]=e;else if(e instanceof Error)r[t]=e.message;else{const e=Fs(s.message,i);r[t]="string"==typeof e?e:Gs("custom",i)}}}return r})(t,e,i)))n in r||(r[n]=s);const s="object"==typeof e&&null!==e?e:void 0;for(const e of((t,e)=>{const i=new Set,r=(t,n)=>{const s=n||!!t.rules?.length&&!0===uo(t.rules,e).hidden,o=t.configs?.key;if(s&&o&&i.add(o),"collection"!==t.type)for(const e of t.children??[])r(e,s)};return r(t,!1),i})(t,s))delete r[e];return{valid:0===Object.keys(r).length,errors:r}};function po(t){return t.split(".").slice(1).map((t=>`/children/${t}`)).join("")}function mo(t,e){if(t.configs?.uid===e)return"";for(const[i,r]of(t.children??[]).entries()){const t=mo(r,e);if(void 0!==t)return`/children/${i}${t}`}}function vo(t,e){let i=t;for(const t of e.split(".").slice(1))i=i?.children?.[Number(t)];return i}var yo=(Ls??Us).applyPatch,go=(t,e,i)=>({spec:yo(t,e,!0,!1).newDocument,patches:e,inverse:i}),$o=(t,e)=>{const i=vo(t,e);if(!i)throw new Error(`No brick at path "${e}"`);return i},wo=(t,e)=>{const i=mo(t,e);if(void 0===i)throw new Error(`No brick with uid "${e}"`);let r=t;for(const t of i.split("/children/").slice(1))r=r.children[Number(t)];return{pointer:i,brick:r}},bo=t=>JSON.parse(JSON.stringify(t));function _o(t,e,i,r){const n=$o(t,i),s=po(i),o=bo(e);if(!n.children){const e=`${s}/children`;return go(t,[{op:"add",path:e,value:[o]}],[{op:"remove",path:e}])}const a=`${s}/children/${Math.min(r??n.children.length,n.children.length)}`;return go(t,[{op:"add",path:a,value:o}],[{op:"remove",path:a}])}function Eo(t,e){if("0"===e)throw new Error("Cannot remove the root brick");const i=$o(t,e),r=po(e);return go(t,[{op:"remove",path:r}],[{op:"add",path:r,value:i}])}function ko(t,e,i){if("0"===e||"0"===i)throw new Error("Cannot move the root brick");const r=$o(t,e),n=e.split(".").map(Number),s=i.split(".").map(Number),o=n.length-1,a=n[o],u=s.length>o&&n.slice(0,o).every(((t,e)=>t===s[e])),h=[...s];if(u){if(h[o]===a&&h.length>n.length)throw new Error(`Cannot move a brick into its own subtree ("${e}" → "${i}")`);h[o]>a&&(h[o]-=1)}const c=po(e),f=po(h.join("."));return go(t,[{op:"remove",path:c},{op:"add",path:f,value:r}],[{op:"remove",path:f},{op:"add",path:c,value:r}])}var Oo=t=>({...t,...t.configs?{configs:{...t.configs,uid:crypto.randomUUID()}}:{},...t.children?{children:t.children.map(Oo)}:{}});function So(t,e){if("0"===e)throw new Error("Cannot duplicate the root brick");const i=$o(t,e),r=e.split("."),n=Number(r[r.length-1])+1,s=po([...r.slice(0,-1),String(n)].join(".")),o=Oo(bo(i));return go(t,[{op:"add",path:s,value:o}],[{op:"remove",path:s}])}var xo=(t,e,i,r,n)=>{const s=`${e}/${i}`;return void 0===n?go(t,[{op:"add",path:s,value:r}],[{op:"remove",path:s}]):go(t,[{op:"replace",path:s,value:r}],[{op:"replace",path:s,value:n}])};function jo(t,e,i){const{pointer:r,brick:n}=wo(t,e),s={...n.configs,...i};return xo(t,r,"configs",s,n.configs)}function Io(t,e,i){const{pointer:r,brick:n}=wo(t,e),s={...n.styles,...i};return xo(t,r,"styles",s,n.styles)}function Po(t,e,i){const{pointer:r,brick:n}=wo(t,e);return xo(t,r,"validations",i,n.validations)}function Co(t,e,i){const{pointer:r,brick:n}=wo(t,e);return xo(t,r,"rules",i,n.rules)}class To{past=[];future=[];record(t){this.past.push({patches:t.patches,inverse:t.inverse}),this.future=[]}get canUndo(){return this.past.length>0}get canRedo(){return this.future.length>0}undo(t){const e=this.past.pop();if(e)return this.future.push(e),yo(t,e.inverse,!0,!1).newDocument}redo(t){const e=this.future.pop();if(e)return this.past.push(e),yo(t,e.patches,!0,!1).newDocument}clear(){this.past=[],this.future=[]}}var Ao=t=>"nested-form"===t.id&&"string"==typeof t.configs?.specRef,No=t=>{if(!t)return!1;for(const{brick:e}of Hs(t))if(Ao(e)&&e.configs?.specRef)return!0;return!1};async function Mo(t,e={}){const i=e.specSourceService??oo.specSourceService,r=e.maxDepth??5,n=async(t,e)=>{if(Ao(t)&&t.configs?.specRef){const s=String(t.configs.specRef);if(e.includes(s))throw new Error(`Circular nested form reference: ${[...e,s].join(" → ")}`);if(e.length>=r)throw new Error(`Nested forms exceed the maximum depth of ${r} (${s})`);const o=await i.fetchSpec(s),a=await n(structuredClone(o),[...e,s]);return{type:"panel",id:"group",name:t.name,configs:{...t.configs,label:t.configs.label??a.name},styles:t.styles,rules:t.rules,children:a.children??[]}}return t.children?.length?{...t,children:await Promise.all(t.children.map((t=>n(t,e))))}:t};return n(structuredClone(t),[])}function Ro(t){return new class extends Ws{constructor(){var e;super({type:t.type,dataType:t.dataType,id:t.id,name:t.name,category:t.category,configsForm:t.configsForm,styles:null!==(e=t.styles)&&void 0!==e?e:{},validators:t.validators,unWrapData:t.unWrapData,isPrivate:t.isPrivate,defaultConfigs:t.defaultConfigs})}render(e){return t.render(e)}renderBuilder(e){var i;return(null!==(i=t.renderBuilder)&&void 0!==i?i:t.render)(e)}getComponent(t){return this.render(t)}getComponentWithActions(t){return this.renderBuilder(t)}}}const Do=t=>t.replace(/-([a-z])/g,((t,e)=>e.toUpperCase()));function zo(t){const e=Object.entries(null!=t?t:{}).filter((([,t])=>null!=t&&""!==t));if(0===e.length)return;const i={};for(const[t,r]of e)i[Do(t)]=String(r);return i}const Lo=(t,e)=>{if(!e.includes("."))return t[e];let i=t;for(const t of e.split(".")){if("object"!=typeof i||null===i)return;i=i[t]}return i};function Uo(t,e="label",i="value"){return Array.isArray(t)?t.map((t=>{var r,n;if("object"==typeof t&&null!==t){const s=t,o=null!==(r=Lo(s,e))&&void 0!==r?r:Lo(s,i),a=null!==(n=Lo(s,i))&&void 0!==n?n:Lo(s,e);return{label:String(null!=o?o:""),value:String(null!=a?a:"")}}return{label:String(t),value:String(t)}})).filter((t=>""!==t.label)):String(null!=t?t:"").split("\n").map((t=>t.trim())).filter(Boolean).map((t=>({label:t,value:t})))}const qo=(t,e)=>"9"===t?/\d/.test(e):"a"===t||"A"===t?/[a-zA-Z]/.test(e):/[0-9a-zA-Z]/.test(e),Fo=t=>"9"===t||"a"===t||"A"===t||"*"===t,Bo=(t,e)=>{var i,r,n,s;return null!==(s=null!==(r=null===(i=t.configs)||void 0===i?void 0:i.label)&&void 0!==r?r:null===(n=t.configs)||void 0===n?void 0:n.key)&&void 0!==s?s:e},Vo=(e,i)=>{var r,n;const s=null===(r=e.configs)||void 0===r?void 0:r.prefix,o=null===(n=e.configs)||void 0===n?void 0:n.suffix;return s||o?t("div",{class:"fk-adorned"},s?t("span",{class:"fk-adorned__affix"},s):null,i,o?t("span",{class:"fk-adorned__affix"},o):null):i},Go=e=>e.error?t("span",{class:"fk-field__error",role:"alert"},e.error):null,Ho=t=>t.error?{"aria-invalid":"true"}:{},Ko=(e,i,r)=>t("div",{class:"fk-field",style:zo(e.styles)},t("span",{class:"fk-field__label"},Bo(e,i)),r,Go(e)),Wo=(e,i,r)=>t("label",{class:"fk-field",style:zo(e.styles)},t("span",{class:"fk-field__label"},Bo(e,i)),r,Go(e)),Jo=e=>Ro({type:"input",dataType:"string",id:e.id,name:e.name,category:"Inputs",defaultConfigs:e.maskable?{label:e.name,mask:""}:{label:e.name},render:i=>{var r,n;return Wo(i,e.name,Vo(i,t("input",Object.assign({},Ho(i),{class:"fk-field__input fk-adorned__input",type:e.inputType,value:null!==(r=i.data)&&void 0!==r?r:"",placeholder:null===(n=i.configs)||void 0===n?void 0:n.placeholder,disabled:i.editable||i.disabled,onInput:t=>{var e,r;const n=t.target,s=null===(e=i.configs)||void 0===e?void 0:e.mask,o=s?((t,e)=>{if(!e)return t;let i="",r=0;for(let n=0;n<e.length&&r<t.length;n++){const s=e[n];if(Fo(s))for(;r<t.length;){const e=t[r++];if(qo(s,e)){i+="A"===s?e.toUpperCase():e;break}}else i+=s,t[r]===s&&r++}return i})(n.value,s):n.value;o!==n.value&&(n.value=o),null===(r=i.onDataChange)||void 0===r||r.call(i,o)}}))))}}),Zo=Jo({id:"text",name:"Text",inputType:"text",maskable:!0}),Xo=Jo({id:"email",name:"Email",inputType:"email"}),Yo=Jo({id:"password",name:"Password",inputType:"password"}),Qo=Jo({id:"url",name:"URL",inputType:"url"}),ta=Jo({id:"phone",name:"Phone",inputType:"tel",maskable:!0}),ea=Ro({type:"input",dataType:"string",id:"textarea",name:"Text area",category:"Inputs",defaultConfigs:{label:"Text area"},render:e=>{var i,r;return Wo(e,"Text area",t("textarea",Object.assign({},Ho(e),{class:"fk-field__input fk-field__input--textarea",value:null!==(i=e.data)&&void 0!==i?i:"",placeholder:null===(r=e.configs)||void 0===r?void 0:r.placeholder,disabled:e.editable||e.disabled,onInput:t=>{var i;return null===(i=e.onDataChange)||void 0===i?void 0:i.call(e,t.target.value)}})))}}),ia=Ro({type:"input",dataType:"number",id:"number",name:"Number",category:"Inputs",defaultConfigs:{label:"Number"},render:e=>{var i;return Wo(e,"Number",Vo(e,t("input",Object.assign({},Ho(e),{class:"fk-field__input fk-adorned__input",type:"number",value:null==e.data?"":String(e.data),placeholder:null===(i=e.configs)||void 0===i?void 0:i.placeholder,disabled:e.editable||e.disabled,onInput:t=>{var i;const r=t.target.value;null===(i=e.onDataChange)||void 0===i||i.call(e,""===r?void 0:Number(r))}}))))}}),ra=Ro({type:"input",dataType:"string",id:"date",name:"Date",category:"Inputs",defaultConfigs:{label:"Date"},render:e=>{var i;return Wo(e,"Date",t("input",Object.assign({},Ho(e),{class:"fk-field__input",type:"date",value:null!==(i=e.data)&&void 0!==i?i:"",disabled:e.editable||e.disabled,onInput:t=>{var i;const r=t.target.value;null===(i=e.onDataChange)||void 0===i||i.call(e,""===r?void 0:r)}})))}}),na=Ro({type:"input",dataType:"string",id:"select",name:"Select",category:"Inputs",defaultConfigs:{label:"Select",optionsSource:"static",options:"Option 1\nOption 2"},render:e=>{var i;return Ko(e,"Select",t("fk-select-input",{configs:e.configs,value:null!==(i=e.data)&&void 0!==i?i:"",disabled:e.editable||e.disabled,invalid:!!e.error,dataMap:e.dataMap,onSelectValueChange:t=>{var i;t.stopPropagation(),null===(i=e.onDataChange)||void 0===i||i.call(e,t.detail)}}))}}),sa=Ro({type:"input",dataType:"array",id:"multi-select",name:"Multi select",category:"Inputs",defaultConfigs:{label:"Multi select",optionsSource:"static",options:"Option 1\nOption 2\nOption 3"},render:e=>Ko(e,"Multi select",t("fk-select-input",{configs:e.configs,value:Array.isArray(e.data)?e.data:[],multiple:!0,disabled:e.editable||e.disabled,invalid:!!e.error,dataMap:e.dataMap,onSelectValueChange:t=>{var i;t.stopPropagation(),null===(i=e.onDataChange)||void 0===i||i.call(e,t.detail)}}))}),oa=Jo({id:"time",name:"Time",inputType:"time"}),aa=Jo({id:"datetime",name:"Date / Time",inputType:"datetime-local"}),ua=t=>{var e,i,r;return Uo(null===(e=t.configs)||void 0===e?void 0:e.options,"string"==typeof(null===(i=t.configs)||void 0===i?void 0:i.labelKey)?t.configs.labelKey:"label","string"==typeof(null===(r=t.configs)||void 0===r?void 0:r.valueKey)?t.configs.valueKey:"value")},ha=Ro({type:"input",dataType:"array",id:"select-boxes",name:"Select boxes",category:"Inputs",defaultConfigs:{label:"Select boxes",options:"Option 1\nOption 2\nOption 3"},render:e=>{const i=Array.isArray(e.data)?e.data:[];return t("div",{class:"fk-field",style:zo(e.styles)},t("span",{class:"fk-field__label"},Bo(e,"Select boxes")),t("div",{class:"fk-radio-group"},ua(e).map((r=>t("label",{class:"fk-radio",key:r.value},t("input",{type:"checkbox",checked:i.includes(r.value),disabled:e.editable||e.disabled,onChange:t=>{var n;const s=t.target.checked?[...i,r.value]:i.filter((t=>t!==r.value));null===(n=e.onDataChange)||void 0===n||n.call(e,s.length?s:void 0)}}),t("span",null,r.label))))),e.error?t("span",{class:"fk-field__error"},e.error):null)}}),ca=Ro({type:"input",dataType:"array",id:"tags",name:"Tags",category:"Inputs",defaultConfigs:{label:"Tags"},render:e=>{const i=Array.isArray(e.data)?e.data:[];return Wo(e,"Tags",t("div",{class:"fk-tags"},i.map((r=>t("span",{class:"fk-tags__chip",key:r},r,t("button",{type:"button",class:"fk-tags__remove",disabled:e.editable||e.disabled,onClick:()=>{var t;const n=i.filter((t=>t!==r));null===(t=e.onDataChange)||void 0===t||t.call(e,n.length?n:void 0)}},"✕")))),t("input",{class:"fk-tags__input",type:"text",placeholder:"Add a tag…",disabled:e.editable||e.disabled,onKeyDown:t=>{var r;if("Enter"!==t.key)return;t.preventDefault();const n=t.target,s=n.value.trim();s&&!i.includes(s)&&(null===(r=e.onDataChange)||void 0===r||r.call(e,[...i,s]),n.value="")}})))}}),fa=Ro({type:"input",dataType:"string",id:"signature",name:"Signature",category:"Inputs",defaultConfigs:{label:"Signature"},render:e=>{var i;return Wo(e,"Signature",t("fk-signature-input",{value:null!==(i=e.data)&&void 0!==i?i:void 0,disabled:e.editable||e.disabled,onSignatureChange:t=>{var i;t.stopPropagation(),null===(i=e.onDataChange)||void 0===i||i.call(e,t.detail)}}))}}),la=Ro({type:"panel",dataType:"void",id:"tabs",name:"Tabs",category:"Layout",defaultConfigs:{validateTabs:!1},render:e=>{var i,r;const n=(null!==(r=null===(i=e.brickSpec)||void 0===i?void 0:i.children)&&void 0!==r?r:[]).map(((t,i)=>{var r,n;const s=Fs(null===(r=t.configs)||void 0===r?void 0:r.label,e.locale);return"string"==typeof s?s:null!==(n=t.name)&&void 0!==n?n:`Tab ${i+1}`}));return t("fk-tabs",{tabLabels:n,editable:e.editable,spec:e.brickSpec,dataMap:e.dataMap,locale:e.locale,style:zo(e.styles)},e.children)}}),da=Ro({type:"input",dataType:"string",id:"radio",name:"Radio",category:"Inputs",defaultConfigs:{label:"Radio",options:"Option 1\nOption 2"},render:e=>t("div",{class:"fk-field",style:zo(e.styles)},t("span",{class:"fk-field__label"},Bo(e,"Radio")),t("div",Object.assign({class:"fk-radio-group",role:"radiogroup"},Ho(e)),ua(e).map((i=>{var r,n;return t("label",{class:"fk-radio",key:i.value},t("input",{type:"radio",name:null!==(n=null===(r=e.configs)||void 0===r?void 0:r.key)&&void 0!==n?n:e.path,checked:e.data===i.value,disabled:e.editable||e.disabled,onChange:()=>{var t;return null===(t=e.onDataChange)||void 0===t?void 0:t.call(e,i.value)}}),t("span",null,i.label))}))),e.error?t("span",{class:"fk-field__error"},e.error):null)}),pa=[{key:"street",label:()=>e("address.street"),full:!0},{key:"city",label:()=>e("address.city"),full:!1},{key:"zip",label:()=>e("address.zip"),full:!1},{key:"country",label:()=>e("address.country"),full:!1}],ma=Ro({type:"input",dataType:"object",id:"address",name:"Address",category:"Inputs",defaultConfigs:{label:"Address"},render:e=>{var i;const r=null!==(i=e.data)&&void 0!==i?i:{};return Ko(e,"Address",t("div",{class:"fk-address"},pa.map((i=>{var n;return t("label",{class:{"fk-address__part":!0,"fk-address__part--full":i.full},key:i.key},t("span",{class:"fk-address__label"},i.label()),t("input",{class:"fk-field__input",type:"text",value:null!==(n=r[i.key])&&void 0!==n?n:"",disabled:e.editable||e.disabled,onInput:t=>{var n;const s=t.target.value,o=Object.assign(Object.assign({},r),{[i.key]:s||void 0}),a=Object.fromEntries(Object.entries(o).filter((([,t])=>void 0!==t)));null===(n=e.onDataChange)||void 0===n||n.call(e,Object.keys(a).length?a:void 0)}}))}))))}}),va=Ro({type:"input",dataType:"object",id:"file",name:"File",category:"Data",defaultConfigs:{label:"File",accept:"",uploadUrl:"",multiple:!1},render:e=>{var i,r,n;return Ko(e,"File",t("fk-file-input",{value:e.data,accept:null===(i=e.configs)||void 0===i?void 0:i.accept,uploadUrl:null===(r=e.configs)||void 0===r?void 0:r.uploadUrl,multiple:!0===(null===(n=e.configs)||void 0===n?void 0:n.multiple),disabled:e.editable||e.disabled,onFileValueChange:t=>{var i;t.stopPropagation(),null===(i=e.onDataChange)||void 0===i||i.call(e,t.detail)}}))}}),ya=Ro({type:"collection",dataType:"array",id:"data-grid",name:"Data grid",category:"Data",defaultConfigs:{label:"Data grid"},render:i=>Ko(i,"Data grid",i.editable||!i.brickSpec?t("div",{class:"fk-grid-template"},t("span",{class:"fk-grid-template__hint"},e("grid.columns")),i.children):t("fk-data-grid",{spec:i.brickSpec,value:i.data,disabled:i.disabled,locale:i.locale,utils:i.utils,onGridValueChange:t=>{var e;t.stopPropagation(),null===(e=i.onDataChange)||void 0===e||e.call(i,t.detail)}}))}),ga=Ro({type:"input",dataType:"string",id:"hidden",name:"Hidden",category:"Data",defaultConfigs:{},render:e=>{var i,r;return e.editable?t("div",{class:"fk-hidden-chip"},"hidden: ",null===(i=e.configs)||void 0===i?void 0:i.key):t("input",{type:"hidden",value:null!==(r=e.data)&&void 0!==r?r:""})}}),$a=Ro({type:"output",dataType:"void",id:"content",name:"Content",category:"Layout",defaultConfigs:{content:"Some text…"},render:e=>{var i,r;return t("div",{class:"fk-content",style:zo(e.styles)},String(null!==(r=null===(i=e.configs)||void 0===i?void 0:i.content)&&void 0!==r?r:"").split("\n").map((e=>t("p",{class:"fk-content__line"},e))))}}),wa=Ro({type:"panel",dataType:"void",id:"stepper",name:"Stepper",category:"Layout",defaultConfigs:{validateSteps:!1,allowStepClick:!0,showSubmit:!1},render:e=>{var i,r;const n=(null!==(r=null===(i=e.brickSpec)||void 0===i?void 0:i.children)&&void 0!==r?r:[]).map(((t,i)=>{var r,n;const s=Fs(null===(r=t.configs)||void 0===r?void 0:r.label,e.locale);return"string"==typeof s?s:null!==(n=t.name)&&void 0!==n?n:`Step ${i+1}`}));return t("fk-stepper",{stepLabels:n,editable:e.editable,spec:e.brickSpec,dataMap:e.dataMap,locale:e.locale,style:zo(e.styles)},e.children)}}),ba=Ro({type:"input",dataType:"boolean",id:"checkbox",name:"Checkbox",category:"Inputs",defaultConfigs:{label:"Checkbox"},render:e=>t("label",{class:"fk-field fk-field--inline",style:zo(e.styles)},t("input",{class:"fk-field__checkbox",type:"checkbox",checked:!0===e.data,disabled:e.editable||e.disabled,onChange:t=>{var i;return null===(i=e.onDataChange)||void 0===i?void 0:i.call(e,t.target.checked)}}),t("span",{class:"fk-field__label"},Bo(e,"Checkbox")),e.error?t("span",{class:"fk-field__error"},e.error):null)}),_a=Ro({type:"panel",dataType:"void",id:"group",name:"Group",category:"Layout",render:e=>{var i;return t("fieldset",{class:"fk-group",style:zo(e.styles)},(null===(i=e.configs)||void 0===i?void 0:i.label)?t("legend",{class:"fk-group__legend"},e.configs.label):null,e.children)}}),Ea=Ro({type:"panel",dataType:"void",id:"row",name:"Row",category:"Layout",render:e=>t("div",{class:"fk-row",style:zo(e.styles)},e.children)}),ka=Ro({type:"panel",dataType:"void",id:"column",name:"Column",category:"Layout",render:e=>t("div",{class:"fk-column",style:zo(e.styles)},e.children)}),Oa=(t,e)=>{var r;if(Array.isArray(e))return e.map((e=>Oa(t,e))).filter(Boolean).join(", ");if(!0===e)return i("recap.yes","Yes");if(!1===e)return i("recap.no","No");if(e&&"object"==typeof e)return"string"==typeof e.name&&"url"in e?e.name:Object.values(e).filter((t=>"string"==typeof t&&t)).join(" ");const n=String(null!=e?e:"");if(null!=(null===(r=t.configs)||void 0===r?void 0:r.options)){const e=Uo(t.configs.options,"string"==typeof t.configs.labelKey?t.configs.labelKey:"label","string"==typeof t.configs.valueKey?t.configs.valueKey:"value").find((t=>t.value===n));if(e)return e.label}return n},Sa=t=>null==t||""===t||Array.isArray(t)&&0===t.length,xa=(t,e)=>{var i,r,n,s,o;return String(null!==(o=null!==(n=null!==(r=Fs(null===(i=t.configs)||void 0===i?void 0:i.label,e))&&void 0!==r?r:t.name)&&void 0!==n?n:null===(s=t.configs)||void 0===s?void 0:s.key)&&void 0!==o?o:"")},ja=t=>{var e,i;const r=[];for(const n of null!==(e=t.children)&&void 0!==e?e:[]){const t=null===(i=n.configs)||void 0===i?void 0:i.key;"input"===n.type&&t&&!t.startsWith("_")?r.push(n):"panel"===n.type&&r.push(...ja(n))}return r},Ia=(t,e,i,r,n=!1)=>{var s,o,a;if(!t)return[];const u=[];for(const h of null!==(s=t.children)&&void 0!==s?s:[]){if("recap"===h.id||"action"===h.type)continue;if(!0===uo(h.rules,e).hidden)continue;const t=null===(o=h.configs)||void 0===o?void 0:o.key,s=xa(h,i);if("collection"===h.type){const n=t&&Array.isArray(null==e?void 0:e[t])?e[t]:[];if(!n.length&&!r)continue;const o=ja(h);u.push({kind:"collection",label:s,columns:o.map((t=>xa(t,i))),rows:n.map((t=>o.map((e=>{const i=null==t?void 0:t[e.configs.key];return Sa(i)?"—":Oa(e,i)}))))});continue}if("panel"===h.type){const t=Fs(null===(a=h.configs)||void 0===a?void 0:a.label,i);if(n&&"string"==typeof t&&t.trim()){const n=Ia(h,e,i,r);n.length&&(u.push({kind:"section",label:t}),u.push(...n));continue}u.push(...Ia(h,e,i,r,n));continue}if("input"!==h.type||!t||t.startsWith("_"))continue;const c=null==e?void 0:e[t];Sa(c)&&!r||u.push({kind:"field",label:s,value:Sa(c)?"—":Oa(h,c)})}return u},Pa=Ro({type:"output",dataType:"void",id:"recap",name:"Recap",category:"Layout",defaultConfigs:{label:"Recap",showEmpty:!1,groupBySections:!1},render:e=>{var r,n;const s=Ia(e.rootSpec,e.dataMap,e.locale,!0===(null===(r=e.configs)||void 0===r?void 0:r.showEmpty),!0===(null===(n=e.configs)||void 0===n?void 0:n.groupBySections)),o=[];let a=[];const u=()=>{a.length&&(o.push(t("dl",{class:"fk-recap__list"},a.map((e=>t("div",{class:"fk-recap__row",key:e.label},t("dt",{class:"fk-recap__term"},e.label),t("dd",{class:"fk-recap__value"},e.value)))))),a=[])};for(const e of s)"field"!==e.kind?(u(),o.push("section"!==e.kind?t("section",{class:"fk-recap__section",key:e.label},t("span",{class:"fk-recap__section-title"},e.label),e.rows.length?t("div",{class:"fk-recap__table-wrap"},t("table",{class:"fk-recap__table"},t("thead",null,t("tr",null,t("th",{class:"fk-recap__index-cell"},"#"),e.columns.map((e=>t("th",{key:e},e))))),t("tbody",null,e.rows.map(((e,i)=>t("tr",{key:i},t("td",{class:"fk-recap__index-cell"},i+1),e.map(((e,i)=>t("td",{key:i},e))))))))):t("p",{class:"fk-recap__empty"},i("recap.empty","Nothing to summarize yet."))):t("span",{class:"fk-recap__group-title",key:`section:${e.label}`},e.label))):a.push(e);return u(),t("div",{class:"fk-field fk-recap",style:zo(e.styles)},t("span",{class:"fk-field__label"},Bo(e,"Recap")),o.length?o:t("p",{class:"fk-recap__empty"},i("recap.empty","Nothing to summarize yet.")))}}),Ca=t=>{if(!t)return[];const e=[],i=t=>{var r,n;const s=null===(r=t.configs)||void 0===r?void 0:r.key;"input"===t.type&&s&&!s.startsWith("_")&&e.push(s);for(const e of null!==(n=t.children)&&void 0!==n?n:[])i(e)};return i(t),e},Ta=Ro({type:"input",dataType:"string",id:"code",name:"Code",category:"Inputs",defaultConfigs:{label:"Code",placeholder:"return value;"},render:e=>{var i,r,n,s;return Ko(e,"Code",e.editable||e.disabled?t("pre",{class:"fk-code-preview"},e.data||String(null!==(r=null===(i=e.configs)||void 0===i?void 0:i.placeholder)&&void 0!==r?r:"")):t("fk-code-editor",{value:null!==(n=e.data)&&void 0!==n?n:"",completions:Ca(e.rootSpec),placeholder:null===(s=e.configs)||void 0===s?void 0:s.placeholder,onCodeChange:t=>{var i;t.stopPropagation(),null===(i=e.onDataChange)||void 0===i||i.call(e,t.detail||void 0)}}))}}),Aa=Ro({type:"panel",dataType:"void",id:"nested-form",name:"Nested form",category:"Layout",defaultConfigs:{label:"Nested form",specRef:""},render:e=>{var r;const n=(null===(r=e.configs)||void 0===r?void 0:r.specRef)||"";return t("div",{class:"fk-nested-form",style:zo(e.styles)},t("span",{class:"fk-field__label"},Bo(e,"Nested form")),t("p",{class:"fk-nested-form__hint"},n?`${i("nestedForm.ref","Referenced form")}: ${n}`:i("nestedForm.missing","Set the specRef config to reference a form.")))}}),Na=Symbol.for("formkrafter.wc.defaultBricksRegistered"),Ma=globalThis;function Ra(){Ma[Na]||(Ma[Na]=!0,h([Zo,Xo,Yo,Qo,ta,ea,ia,ra,oa,aa,na,sa,da,ha,ba,ca,fa,ma,Ta,va,ya,ga,$a,Pa,Aa,_a,Ea,ka,wa,la]))}export{Aa as $,h as A,Ro as B,Zo as C,Xo as D,Yo as E,Qo as F,ta as G,ea as H,ia as I,ra as J,oa as K,aa as L,na as M,sa as N,da as O,ha as P,ba as Q,ca as R,To as S,fa as T,ma as U,Ta as V,va as W,ya as X,ga as Y,$a as Z,Pa as _,l as a,_a as a0,Ea as a1,ka as a2,wa as a3,la as a4,c as b,uo as c,Ra as d,_o as e,vo as f,f as g,Eo as h,So as i,Io as j,Po as k,Co as l,ko as m,d as n,Hs as o,No as p,Mo as q,Bs as r,oo as s,qs as t,jo as u,lo as v,Uo as w,ao as x,Ks as y,u as z}