projectlens 0.1.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 (58) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +128 -0
  3. package/dist/chunk-2ESYSVXG.js +48 -0
  4. package/dist/cli.js +5142 -0
  5. package/dist/esm-UD73TBFV.js +5195 -0
  6. package/dist/lib-RYPZ47SK.js +32422 -0
  7. package/dist/promise-RZT5M2G5.js +19290 -0
  8. package/package.json +37 -0
  9. package/public/404.html +1 -0
  10. package/public/__next.__PAGE__.txt +6 -0
  11. package/public/__next._full.txt +19 -0
  12. package/public/__next._head.txt +5 -0
  13. package/public/__next._index.txt +8 -0
  14. package/public/__next._tree.txt +5 -0
  15. package/public/_next/static/Y9zjmXhW-zuG8Rhhw7lhH/_buildManifest.js +11 -0
  16. package/public/_next/static/Y9zjmXhW-zuG8Rhhw7lhH/_clientMiddlewareManifest.js +1 -0
  17. package/public/_next/static/Y9zjmXhW-zuG8Rhhw7lhH/_ssgManifest.js +1 -0
  18. package/public/_next/static/chunks/00g6ktfqbvh0k.js +1 -0
  19. package/public/_next/static/chunks/02jqkfcbj77p5.css +2 -0
  20. package/public/_next/static/chunks/03~yq9q893hmn.js +1 -0
  21. package/public/_next/static/chunks/04..ecqvwwq50.js +409 -0
  22. package/public/_next/static/chunks/060q84nvp94s6.js +5 -0
  23. package/public/_next/static/chunks/0ag9_thdvsufz.js +1 -0
  24. package/public/_next/static/chunks/0fulyomwb7at-.js +1 -0
  25. package/public/_next/static/chunks/0l0vfv7tr4h1n.css +1 -0
  26. package/public/_next/static/chunks/0~hotr4crj3w3.js +1 -0
  27. package/public/_next/static/chunks/17mke5d8u31kx.js +31 -0
  28. package/public/_next/static/chunks/turbopack-0btzs1a7324pk.js +1 -0
  29. package/public/_next/static/media/13bf9871fe164e7f-s.0s19wthhh_6~m.woff2 +0 -0
  30. package/public/_next/static/media/3fe682a82f50d426-s.09q3q1i5159bl.woff2 +0 -0
  31. package/public/_next/static/media/53b9e256198e5412-s.0-wfv7uh4i7h9.woff2 +0 -0
  32. package/public/_next/static/media/70bc3e132a0a741e-s.p.1409xf.ylxg8g.woff2 +0 -0
  33. package/public/_next/static/media/7178b3e590c64307-s.0nx0ww8fni_q3.woff2 +0 -0
  34. package/public/_next/static/media/71b036adf157cdcf-s.03nf~dfjdkf~..woff2 +0 -0
  35. package/public/_next/static/media/89b21bb081cb7469-s.0gfhww.tctz1o.woff2 +0 -0
  36. package/public/_next/static/media/8a480f0b521d4e75-s.0jzbimsg8vl84.woff2 +0 -0
  37. package/public/_next/static/media/caa3a2e1cccd8315-s.p.09~u27dqhyhd6.woff2 +0 -0
  38. package/public/_next/static/media/cc545e633e20c56d-s.0dza.stei.9v7.woff2 +0 -0
  39. package/public/_next/static/media/fef07dbb0973bf53-s.12tyk43_3sh9u.woff2 +0 -0
  40. package/public/_not-found/__next._full.txt +18 -0
  41. package/public/_not-found/__next._head.txt +5 -0
  42. package/public/_not-found/__next._index.txt +8 -0
  43. package/public/_not-found/__next._not-found/__PAGE__.txt +5 -0
  44. package/public/_not-found/__next._not-found.txt +5 -0
  45. package/public/_not-found/__next._tree.txt +3 -0
  46. package/public/_not-found.html +1 -0
  47. package/public/_not-found.txt +18 -0
  48. package/public/apple-icon.png +0 -0
  49. package/public/icon-dark-32x32.png +0 -0
  50. package/public/icon-light-32x32.png +0 -0
  51. package/public/icon.svg +26 -0
  52. package/public/index.html +1 -0
  53. package/public/index.txt +19 -0
  54. package/public/placeholder-logo.png +0 -0
  55. package/public/placeholder-logo.svg +1 -0
  56. package/public/placeholder-user.jpg +0 -0
  57. package/public/placeholder.jpg +0 -0
  58. package/public/placeholder.svg +1 -0
@@ -0,0 +1,409 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,69090,(e,t,n)=>{"use strict";var r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,a=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,c=/^\s+|\s+$/g;function u(e){return e?e.replace(c,""):""}t.exports=function(e,t){if("string"!=typeof e)throw TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,c=1;function m(e){var t=e.match(i);t&&(n+=t.length);var r=e.lastIndexOf("\n");c=~r?e.length-r:c+e.length}function p(){var e={line:n,column:c};return function(t){return t.position=new f(e),g(a),t}}function f(e){this.start=e,this.end={line:n,column:c},this.source=t.source}function h(r){var i=Error(t.source+":"+n+":"+c+": "+r);if(i.reason=r,i.filename=t.source,i.line=n,i.column=c,i.source=e,t.silent);else throw i}function g(t){var n=t.exec(e);if(n){var r=n[0];return m(r),e=e.slice(r.length),n}}function x(e){var t;for(e=e||[];t=v();)!1!==t&&e.push(t);return e}function v(){var t=p();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return h("End of comment missing");var r=e.slice(2,n-2);return c+=2,m(r),e=e.slice(n),c+=2,t({type:"comment",comment:r})}}f.prototype.content=e,g(a);var y,b=[];for(x(b);y=function(){var e=p(),t=g(s);if(t){if(v(),!g(o))return h("property missing ':'");var n=g(l),i=e({type:"declaration",property:u(t[0].replace(r,"")),value:n?u(n[0].replace(r,"")):""});return g(d),i}}();)!1!==y&&(b.push(y),x(b));return b}},59596,(e,t,n)=>{"use strict";var r=e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;let r=(0,i.default)(e),a="function"==typeof t;return r.forEach(e=>{if("declaration"!==e.type)return;let{property:r,value:i}=e;a?t(r,i,e):i&&((n=n||{})[r]=i)}),n};let i=r(e.r(69090))},51521,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.camelCase=void 0;var r=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,a=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,l=function(e,t){return t.toUpperCase()},d=function(e,t){return"".concat(t,"-")};n.camelCase=function(e,t){var n;return(void 0===t&&(t={}),!(n=e)||a.test(n)||r.test(n))?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(o,d):e.replace(s,d)).replace(i,l))}},63185,(e,t,n)=>{"use strict";var r=(e.e&&e.e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(e.r(59596)),i=e.r(51521);function a(e,t){var n={};return e&&"string"==typeof e&&(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a},75609,(e,t,n)=>{"use strict";var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=Object.defineProperty,s=Object.getOwnPropertyDescriptor,o=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===i.call(e)},l=function(e){if(!e||"[object Object]"!==i.call(e))return!1;var t,n=r.call(e,"constructor"),a=e.constructor&&e.constructor.prototype&&r.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!a)return!1;for(t in e);return void 0===t||r.call(e,t)},d=function(e,t){a&&"__proto__"===t.name?a(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},c=function(e,t){if("__proto__"===t){if(!r.call(e,t))return;else if(s)return s(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,s,u=arguments[0],m=1,p=arguments.length,f=!1;for("boolean"==typeof u&&(f=u,u=arguments[1]||{},m=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});m<p;++m)if(t=arguments[m],null!=t)for(n in t)r=c(u,n),u!==(i=c(t,n))&&(f&&i&&(l(i)||(a=o(i)))?(a?(a=!1,s=r&&o(r)?r:[]):s=r&&l(r)?r:{},d(u,{name:n,newValue:e(f,s,i)})):void 0!==i&&d(u,{name:n,newValue:i}));return u}},57047,(e,t,n)=>{var r={675:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),n=t[0],r=t[1];return(n+r)*3/4-r},t.toByteArray=function(e){var t,n,a=l(e),s=a[0],o=a[1],d=new i((s+o)*3/4-o),c=0,u=o>0?s-4:s;for(n=0;n<u;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],d[c++]=t>>16&255,d[c++]=t>>8&255,d[c++]=255&t;return 2===o&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,d[c++]=255&t),1===o&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,d[c++]=t>>8&255,d[c++]=255&t),d},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,a=[],s=0,o=r-i;s<o;s+=16383)a.push(function(e,t,r){for(var i,a=[],s=t;s<r;s+=3)i=(e[s]<<16&0xff0000)+(e[s+1]<<8&65280)+(255&e[s+2]),a.push(n[i>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return a.join("")}(e,s,s+16383>o?o:s+16383));return 1===i?a.push(n[(t=e[r-1])>>2]+n[t<<4&63]+"=="):2===i&&a.push(n[(t=(e[r-2]<<8)+e[r-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),a.join("")};for(var n=[],r=[],i="u">typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,o=a.length;s<o;++s)n[s]=a[s],r[a.charCodeAt(s)]=s;function l(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");-1===n&&(n=t);var r=n===t?0:4-n%4;return[n,r]}r[45]=62,r[95]=63},72:function(e,t,n){"use strict";var r=n(675),i=n(783),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function s(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,n){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return c(e)}return l(e,t,n)}function l(e,t,n){if("string"==typeof e){var r=e,i=t;if(("string"!=typeof i||""===i)&&(i="utf8"),!o.isEncoding(i))throw TypeError("Unknown encoding: "+i);var a=0|p(r,i),l=s(a),d=l.write(r,i);return d!==a&&(l=l.slice(0,d)),l}if(ArrayBuffer.isView(e))return u(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(E(e,ArrayBuffer)||e&&E(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(E(e,SharedArrayBuffer)||e&&E(e.buffer,SharedArrayBuffer)))return function(e,t,n){var r;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),o.prototype),r}(e,t,n);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var c=e.valueOf&&e.valueOf();if(null!=c&&c!==e)return o.from(c,t,n);var f=function(e){if(o.isBuffer(e)){var t=0|m(e.length),n=s(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?s(0):u(e):"Buffer"===e.type&&Array.isArray(e.data)?u(e.data):void 0}(e);if(f)return f;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,n);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function d(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return d(e),s(e<0?0:0|m(e))}function u(e){for(var t=e.length<0?0:0|m(e.length),n=s(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}t.Buffer=o,t.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,o.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),!o.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,n){return l(e,t,n)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,n){return(d(e),e<=0)?s(e):void 0!==t?"string"==typeof n?s(e).fill(t,n):s(e).fill(t):s(e)},o.allocUnsafe=function(e){return c(e)},o.allocUnsafeSlow=function(e){return c(e)};function m(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function p(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||E(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return _(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return $(e).length;default:if(i)return r?-1:_(e).length;t=(""+t).toLowerCase(),i=!0}}function f(e,t,n){var i,a,s,o=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===n||n>this.length)&&(n=this.length),n<=0||(n>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",a=t;a<n;++a)i+=C[e[a]];return i}(this,t,n);case"utf8":case"utf-8":return v(this,t,n);case"ascii":return function(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}(this,t,n);case"latin1":case"binary":return function(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}(this,t,n);case"base64":return i=this,a=t,s=n,0===a&&s===i.length?r.fromByteArray(i):r.fromByteArray(i.slice(a,s));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,n){for(var r=e.slice(t,n),i="",a=0;a<r.length;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}(this,t,n);default:if(o)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function h(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,i){var a;if(0===e.length)return -1;if("string"==typeof n?(r=n,n=0):n>0x7fffffff?n=0x7fffffff:n<-0x80000000&&(n=-0x80000000),(a=n*=1)!=a&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length)if(i)return -1;else n=e.length-1;else if(n<0)if(!i)return -1;else n=0;if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:x(e,t,n,r,i);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(i)return Uint8Array.prototype.indexOf.call(e,t,n);else return Uint8Array.prototype.lastIndexOf.call(e,t,n);return x(e,[t],n,r,i)}throw TypeError("val must be string, number or Buffer")}function x(e,t,n,r,i){var a,s=1,o=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return -1;s=2,o/=2,l/=2,n/=2}function d(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(a=n;a<o;a++)if(d(e,a)===d(t,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===l)return c*s}else -1!==c&&(a-=a-c),c=-1}else for(n+l>o&&(n=o-l),a=n;a>=0;a--){for(var u=!0,m=0;m<l;m++)if(d(e,a+m)!==d(t,m)){u=!1;break}if(u)return a}return -1}o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(E(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),E(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:+(r<n)},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);if(void 0===t)for(n=0,t=0;n<e.length;++n)t+=e[n].length;var n,r=o.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(E(a,Uint8Array)&&(a=o.from(a)),!o.isBuffer(a))throw TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},o.byteLength=p,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)h(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)h(this,t,t+3),h(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)h(this,t,t+7),h(this,t+1,t+6),h(this,t+2,t+5),h(this,t+3,t+4);return this},o.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?v(this,0,e):f.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},a&&(o.prototype[a]=o.prototype.inspect),o.prototype.compare=function(e,t,n,r,i){if(E(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return -1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var a=i-r,s=n-t,l=Math.min(a,s),d=this.slice(r,i),c=e.slice(t,n),u=0;u<l;++u)if(d[u]!==c[u]){a=d[u],s=c[u];break}return a<s?-1:+(s<a)},o.prototype.includes=function(e,t,n){return -1!==this.indexOf(e,t,n)},o.prototype.indexOf=function(e,t,n){return g(this,e,t,n,!0)},o.prototype.lastIndexOf=function(e,t,n){return g(this,e,t,n,!1)};function v(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a,s,o,l,d=e[i],c=null,u=d>239?4:d>223?3:d>191?2:1;if(i+u<=n)switch(u){case 1:d<128&&(c=d);break;case 2:(192&(a=e[i+1]))==128&&(l=(31&d)<<6|63&a)>127&&(c=l);break;case 3:a=e[i+1],s=e[i+2],(192&a)==128&&(192&s)==128&&(l=(15&d)<<12|(63&a)<<6|63&s)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:a=e[i+1],s=e[i+2],o=e[i+3],(192&a)==128&&(192&s)==128&&(192&o)==128&&(l=(15&d)<<18|(63&a)<<12|(63&s)<<6|63&o)>65535&&l<1114112&&(c=l)}null===c?(c=65533,u=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=u}var m=r,p=m.length;if(p<=4096)return String.fromCharCode.apply(String,m);for(var f="",h=0;h<p;)f+=String.fromCharCode.apply(String,m.slice(h,h+=4096));return f}function y(e,t,n){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>n)throw RangeError("Trying to access beyond buffer length")}function b(e,t,n,r,i,a){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw RangeError('"value" argument is out of bounds');if(n+r>e.length)throw RangeError("Index out of range")}function k(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError("Index out of range")}function j(e,t,n,r,a){return t*=1,n>>>=0,a||k(e,t,n,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,n,r,23,4),n+4}function w(e,t,n,r,a){return t*=1,n>>>=0,a||k(e,t,n,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,n,r,52,8),n+8}o.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i,a,s,o,l,d,c,u,m=this.length-t;if((void 0===n||n>m)&&(n=m),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var p=!1;;)switch(r){case"hex":return function(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var a=t.length;r>a/2&&(r=a/2);for(var s=0;s<r;++s){var o,l=parseInt(t.substr(2*s,2),16);if((o=l)!=o)break;e[n+s]=l}return s}(this,e,t,n);case"utf8":case"utf-8":return i=t,a=n,I(_(e,this.length-i),this,i,a);case"ascii":return s=t,o=n,I(S(e),this,s,o);case"latin1":case"binary":return function(e,t,n,r){return I(S(t),e,n,r)}(this,e,t,n);case"base64":return l=t,d=n,I($(e),this,l,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c=t,u=n,I(function(e,t){for(var n,r,i=[],a=0;a<e.length&&!((t-=2)<0);++a)r=(n=e.charCodeAt(a))>>8,i.push(n%256),i.push(r);return i}(e,this.length-c),this,c,u);default:if(p)throw TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),p=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return Object.setPrototypeOf(r,o.prototype),r},o.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||y(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},o.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||y(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},o.prototype.readUInt8=function(e,t){return e>>>=0,t||y(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||y(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||y(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||y(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||y(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},o.prototype.readInt8=function(e,t){return(e>>>=0,t||y(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||y(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?0xffff0000|n:n},o.prototype.readInt16BE=function(e,t){e>>>=0,t||y(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?0xffff0000|n:n},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||y(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||y(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||y(e,4,this.length),i.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||y(e,4,this.length),i.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||y(e,8,this.length),i.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||y(e,8,this.length),i.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,n,r){if(e*=1,t>>>=0,n>>>=0,!r){var i=Math.pow(2,8*n)-1;b(this,e,t,n,i,0)}var a=1,s=0;for(this[t]=255&e;++s<n&&(a*=256);)this[t+s]=e/a&255;return t+n},o.prototype.writeUIntBE=function(e,t,n,r){if(e*=1,t>>>=0,n>>>=0,!r){var i=Math.pow(2,8*n)-1;b(this,e,t,n,i,0)}var a=n-1,s=1;for(this[t+a]=255&e;--a>=0&&(s*=256);)this[t+a]=e/s&255;return t+n},o.prototype.writeUInt8=function(e,t,n){return e*=1,t>>>=0,n||b(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,n){return e*=1,t>>>=0,n||b(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUInt16BE=function(e,t,n){return e*=1,t>>>=0,n||b(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUInt32LE=function(e,t,n){return e*=1,t>>>=0,n||b(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUInt32BE=function(e,t,n){return e*=1,t>>>=0,n||b(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,n,r){if(e*=1,t>>>=0,!r){var i=Math.pow(2,8*n-1);b(this,e,t,n,i-1,-i)}var a=0,s=1,o=0;for(this[t]=255&e;++a<n&&(s*=256);)e<0&&0===o&&0!==this[t+a-1]&&(o=1),this[t+a]=(e/s|0)-o&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e*=1,t>>>=0,!r){var i=Math.pow(2,8*n-1);b(this,e,t,n,i-1,-i)}var a=n-1,s=1,o=0;for(this[t+a]=255&e;--a>=0&&(s*=256);)e<0&&0===o&&0!==this[t+a+1]&&(o=1),this[t+a]=(e/s|0)-o&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e*=1,t>>>=0,n||b(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e*=1,t>>>=0,n||b(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,n){return e*=1,t>>>=0,n||b(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,n){return e*=1,t>>>=0,n||b(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,n){return e*=1,t>>>=0,n||b(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,n){return j(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return j(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return w(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return w(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(!o.isBuffer(e))throw TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw RangeError("Index out of range");if(r<0)throw RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i=r-n;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,n,r);else if(this===e&&n<t&&t<r)for(var a=i-1;a>=0;--a)e[a+t]=this[a+n];else Uint8Array.prototype.set.call(e,this.subarray(n,r),t);return i},o.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw TypeError("encoding must be a string");if("string"==typeof r&&!o.isEncoding(r))throw TypeError("Unknown encoding: "+r);if(1===e.length){var i,a=e.charCodeAt(0);("utf8"===r&&a<128||"latin1"===r)&&(e=a)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError("Out of range index");if(n<=t)return this;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var s=o.isBuffer(e)?e:o.from(e,r),l=s.length;if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=s[i%l]}return this};var N=/[^+/0-9A-Za-z-_]/g;function _(e,t){t=t||1/0;for(var n,r=e.length,i=null,a=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319||s+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}else throw Error("Invalid code point")}return a}function S(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}function $(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(N,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function I(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length)&&!(i>=e.length);++i)t[i+n]=e[i];return i}function E(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var C=function(){for(var e="0123456789abcdef",t=Array(256),n=0;n<16;++n)for(var r=16*n,i=0;i<16;++i)t[r+i]=e[n]+e[i];return t}()},783:function(e,t){t.read=function(e,t,n,r,i){var a,s,o=8*i-r-1,l=(1<<o)-1,d=l>>1,c=-7,u=n?i-1:0,m=n?-1:1,p=e[t+u];for(u+=m,a=p&(1<<-c)-1,p>>=-c,c+=o;c>0;a=256*a+e[t+u],u+=m,c-=8);for(s=a&(1<<-c)-1,a>>=-c,c+=r;c>0;s=256*s+e[t+u],u+=m,c-=8);if(0===a)a=1-d;else{if(a===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),a-=d}return(p?-1:1)*s*Math.pow(2,a-r)},t.write=function(e,t,n,r,i,a){var s,o,l,d=8*a-i-1,c=(1<<d)-1,u=c>>1,m=5960464477539062e-23*(23===i),p=r?0:a-1,f=r?1:-1,h=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(o=+!!isNaN(t),s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+u>=1?t+=m/l:t+=m*Math.pow(2,1-u),t*l>=2&&(s++,l/=2),s+u>=c?(o=0,s=c):s+u>=1?(o=(t*l-1)*Math.pow(2,i),s+=u):(o=t*Math.pow(2,u-1)*Math.pow(2,i),s=0));i>=8;e[n+p]=255&o,p+=f,o/=256,i-=8);for(s=s<<i|o,d+=i;d>0;e[n+p]=255&s,p+=f,s/=256,d-=8);e[n+p-f]|=128*h}}},i={};function a(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}},s=!0;try{r[e](n,n.exports,a),s=!1}finally{s&&delete i[e]}return n.exports}a.ab="/ROOT/node_modules/.pnpm/next@16.2.6_@babel+core@7.2_ee6123ad7e9f962a9373ff47d209d4ed/node_modules/next/dist/compiled/buffer/",t.exports=a(72)},47258,(e,t,n)=>{"use strict";var r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={},l={SYMBOL_FOR_REQ_CONTEXT:()=>c,getContext:()=>u};for(var d in l)r(o,d,{get:l[d],enumerable:!0});t.exports=((e,t,n,o)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of a(t))s.call(e,l)||l===n||r(e,l,{get:()=>t[l],enumerable:!(o=i(t,l))||o.enumerable});return e})(r({},"__esModule",{value:!0}),o);let c=Symbol.for("@vercel/request-context");function u(){let e=globalThis;return e[c]?.get?.()??{}}},6637,(e,t,n)=>{"use strict";var r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={},l={AccessTokenMissingError:()=>c,RefreshAccessTokenFailedError:()=>u};for(var d in l)r(o,d,{get:l[d],enumerable:!0});t.exports=((e,t,n,o)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of a(t))s.call(e,l)||l===n||r(e,l,{get:()=>t[l],enumerable:!(o=i(t,l))||o.enumerable});return e})(r({},"__esModule",{value:!0}),o);class c extends Error{constructor(){super("No authentication found. Please log in with the Vercel CLI (vercel login)."),this.name="AccessTokenMissingError"}}class u extends Error{constructor(e){super("Failed to refresh authentication token.",{cause:e}),this.name="RefreshAccessTokenFailedError"}}},24154,(e,t,n)=>{"use strict";var r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,o={},l={AccessTokenMissingError:()=>u.AccessTokenMissingError,RefreshAccessTokenFailedError:()=>u.RefreshAccessTokenFailedError,getContext:()=>c.getContext,getVercelOidcToken:()=>m,getVercelOidcTokenSync:()=>p,getVercelToken:()=>f};for(var d in l)r(o,d,{get:l[d],enumerable:!0});t.exports=((e,t,n,o)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of a(t))s.call(e,l)||l===n||r(e,l,{get:()=>t[l],enumerable:!(o=i(t,l))||o.enumerable});return e})(r({},"__esModule",{value:!0}),o);var c=e.r(47258),u=e.r(6637);async function m(){return""}function p(){return""}async function f(){throw Error("getVercelToken is not supported in browser environments")}},61030,(e,t,n)=>{t.exports=function(e,t){let n;if("function"!=typeof e)throw TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let r=0;return function(...i){clearTimeout(n);let a=Date.now(),s=t-(a-r);s<=0?(r=a,e.apply(this,i)):n=setTimeout(()=>{r=Date.now(),e.apply(this,i)},s)}}},40881,e=>{"use strict";let t,n,r;var i,a,s,o,l,d,c,u,m,p,f,h,g,x,v,y,b,k,j,w,N,_,S,$,I,E,C,A,T,P,z,O,M,R,D,L,U,Z,F,B,V,q,W,H,G,K,J,Y,X,Q,ee,et,en,er,ei,ea,es,eo,el,ed,ec,eu,em,ep,ef,eh,eg,ex,ev,ey,eb,ek,ej,ew,eN,e_,eS,e$,eI,eE,eC,eA,eT=e.i(9400),eP=e.i(62588);let ez=(...e)=>e.filter((e,t,n)=>!!e&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),eO=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var eM={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let eR=(0,eP.createContext)({}),eD=(0,eP.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i="",children:a,iconNode:s,...o},l)=>{let{size:d=24,strokeWidth:c=2,absoluteStrokeWidth:u=!1,color:m="currentColor",className:p=""}=(0,eP.useContext)(eR)??{},f=r??u?24*Number(n??c)/Number(t??d):n??c;return(0,eP.createElement)("svg",{ref:l,...eM,width:t??d??eM.width,height:t??d??eM.height,stroke:e??m,strokeWidth:f,className:ez("lucide",p,i),...!a&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(o)&&{"aria-hidden":"true"},...o},[...s.map(([e,t])=>(0,eP.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),eL=(e,t)=>{let n=(0,eP.forwardRef)(({className:n,...r},i)=>(0,eP.createElement)(eD,{ref:i,iconNode:t,className:ez(`lucide-${eO(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...r}));return n.displayName=eO(e),n},eU=eL("layout-dashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]),eZ=eL("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),eF=eL("braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]),eB=eL("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),eV=eL("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),eq=eL("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),eW=eL("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),eH=eL("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]),eG=eL("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]),eK=eL("git-branch",[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]]),eJ=eL("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]),eY=eL("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]),eX=eL("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),eQ=eL("accessibility",[["circle",{cx:"16",cy:"4",r:"1",key:"1grugj"}],["path",{d:"m18 19 1-7-6 1",key:"r0i19z"}],["path",{d:"m5 8 3-3 5.5 3-2.36 3.5",key:"9ptxx2"}],["path",{d:"M4.24 14.5a5 5 0 0 0 6.88 6",key:"10kmtu"}],["path",{d:"M13.76 17.5a5 5 0 0 0-6.88-6",key:"2qq6rc"}]]),e0=eL("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]),e1=eL("flask-conical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]),e2=eL("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]),e4=eL("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]),e5=eL("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),e6=eL("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]),e3=eL("webhook",[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]),e9=eL("route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]),e8=eL("chart-line",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]),e7=eL("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]),te=eL("boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);e.s([],68722),e.i(68722);var tt=e.i(379);function tn({controlled:e,default:t,name:n,state:r="value"}){let{current:i}=eP.useRef(void 0!==e),[a,s]=eP.useState(t),o=eP.useCallback(e=>{i||s(e)},[]);return[i?e:a,o]}var tr=e.i(26126),ti=e.i(91767),ta=e.i(80713),ts=e.i(8827);let to=eP.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function tl(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=(0,ti.useStableCallback)(i),s=eP.useRef(0),o=(0,ts.useRefWithInit)(tc).current,l=(0,ts.useRefWithInit)(td).current,[d,c]=eP.useState(0),u=eP.useRef(d),m=(0,ti.useStableCallback)((e,t)=>{l.set(e,t??null),u.current+=1,c(u.current)}),p=(0,ti.useStableCallback)(e=>{l.delete(e),u.current+=1,c(u.current)}),f=eP.useMemo(()=>{let e=new Map;return Array.from(l.keys()).filter(e=>e.isConnected).sort(tu).forEach((t,n)=>{let r=l.get(t)??{};e.set(t,{...r,index:n})}),e},[l,d]);(0,tr.useIsoLayoutEffect)(()=>{if("function"!=typeof MutationObserver||0===f.size)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),0===t.size&&(u.current+=1,c(u.current))});return f.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[f]),(0,tr.useIsoLayoutEffect)(()=>{u.current===d&&(n.current.length!==f.size&&(n.current.length=f.size),r&&r.current.length!==f.size&&(r.current.length=f.size),s.current=f.size),a(f)},[a,f,n,r,d]),(0,tr.useIsoLayoutEffect)(()=>()=>{n.current=[]},[n]),(0,tr.useIsoLayoutEffect)(()=>()=>{r&&(r.current=[])},[r]);let h=(0,ti.useStableCallback)(e=>(o.add(e),()=>{o.delete(e)}));(0,tr.useIsoLayoutEffect)(()=>{o.forEach(e=>e(f))},[o,f]);let g=eP.useMemo(()=>({register:m,unregister:p,subscribeMapChange:h,elementsRef:n,labelsRef:r,nextIndexRef:s}),[m,p,h,n,r,s]);return(0,eT.jsx)(to.Provider,{value:g,children:t})}function td(){return new Map}function tc(){return new Set}function tu(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}var tm=e.i(70078);let tp=eP.createContext(void 0);function tf(){let e=eP.useContext(tp);if(void 0===e)throw Error((0,tm.default)(64));return e}let th=((i={}).activationDirection="data-activation-direction",i.orientation="data-orientation",i),tg={tabActivationDirection:e=>({[th.activationDirection]:e})};var tx=e.i(89301),tv=e.i(40340);let ty=eP.forwardRef(function(e,t){let{className:n,defaultValue:r=0,onValueChange:i,orientation:a="horizontal",render:s,value:o,style:l,...d}=e,c=void 0!==e.defaultValue,u=eP.useRef([]),[m,p]=eP.useState(()=>new Map),[f,h]=tn({controlled:o,default:r,name:"Tabs",state:"value"}),g=void 0!==o,[x,v]=eP.useState(()=>new Map),y=eP.useCallback(e=>{if(void 0===e)return null;for(let[t,n]of x.entries())if(null!=n&&e===(n.value??n.index))return t;return null},[x]),[b,k]=eP.useState(()=>({previousValue:f,tabActivationDirection:"none"})),{previousValue:j,tabActivationDirection:w}=b,N=w,_=!1;j!==f&&(N=tb(j,f,a,x),_=null!=j&&null!=f&&null==y(f));let S=_?j:f,$=j!==S||w!==N;(0,tr.useIsoLayoutEffect)(()=>{$&&k({previousValue:S,tabActivationDirection:N})},[S,$,N]);let I=(0,ti.useStableCallback)((e,t)=>{t.activationDirection=tb(f,e,a,x),i?.(e,t),t.isCanceled||h(e)}),E=(0,ti.useStableCallback)((e,t)=>{i?.(e,(0,tx.createChangeEventDetails)(t,void 0,void 0,{activationDirection:"none"}))}),C=(0,ti.useStableCallback)((e,t)=>{p(n=>{if(n.get(e)===t)return n;let r=new Map(n);return r.set(e,t),r})}),A=(0,ti.useStableCallback)((e,t)=>{p(n=>{if(!n.has(e)||n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})}),T=eP.useCallback(e=>m.get(e),[m]),P=eP.useCallback(e=>{for(let t of x.values())if(e===t?.value)return t?.id},[x]),z=eP.useMemo(()=>({getTabElementBySelectedValue:y,getTabIdByPanelValue:P,getTabPanelIdByValue:T,onValueChange:I,orientation:a,registerMountedTabPanel:C,setTabMap:v,unregisterMountedTabPanel:A,tabActivationDirection:N,value:f}),[y,P,T,I,a,C,v,A,N,f]),O=eP.useMemo(()=>{for(let e of x.values())if(null!=e&&e.value===f)return e},[x,f]),M=eP.useMemo(()=>{for(let e of x.values())if(null!=e&&!e.disabled)return e.value},[x]),R=eP.useRef(!c),D=eP.useRef(c),L=eP.useRef(!1);(0,tr.useIsoLayoutEffect)(()=>{if(g)return;function e(e,t){h(e),k(t=>t.previousValue===e&&"none"===t.tabActivationDirection?t:{previousValue:e,tabActivationDirection:"none"}),E(e,t),R.current=!1}if(0===x.size){if(!L.current||null===f)return;e(null,tv.REASONS.missing);return}L.current=!0;let t=O?.disabled,n=null==O&&null!==f;if(t||f!==r||(D.current=!1),D.current&&t&&f===r)return;let i=R.current;if(t||n){let n=M??null;if(f===n){R.current=!1;return}let r=tv.REASONS.missing;i?r=tv.REASONS.initial:t&&(r=tv.REASONS.disabled),e(n,r);return}i&&null!=O&&(E(f,tv.REASONS.initial),R.current=!1)},[r,M,g,E,O,h,x,f]);let U={orientation:a,tabActivationDirection:N},Z=(0,ta.useRenderElement)("div",e,{state:U,ref:t,props:d,stateAttributesMapping:tg});return(0,eT.jsx)(tp.Provider,{value:z,children:(0,eT.jsx)(tl,{elementsRef:u,children:Z})})});function tb(e,t,n,r){if(null==e||null==t)return"none";let i=null,a=null;for(let[n,s]of r.entries()){if(null==s)continue;let r=s.value??s.index;if(e===r&&(i=n),t===r&&(a=n),null!=i&&null!=a)break}if(null==i||null==a)return i!==a&&("number"==typeof e||"string"==typeof e)&&typeof e==typeof t?"horizontal"===n?t>e?"right":"left":t>e?"down":"up":"none";let s=i.getBoundingClientRect(),o=a.getBoundingClientRect();if("horizontal"===n){if(o.left<s.left)return"left";if(o.left>s.left)return"right"}else{if(o.top<s.top)return"up";if(o.top>s.top)return"down"}return"none"}var tk=e.i(10284),tj=e.i(2957),tw=e.i(92615),tN=e.i(82203);let t_=eP.createContext(void 0);function tS(e=!1){let t=eP.useContext(t_);if(void 0===t&&!e)throw Error((0,tm.default)(16));return t}function t$(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,s=eP.useRef(null),o=tS(!0),l=a??void 0!==o,{props:d}=function(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,s=r&&!1!==t,o=r&&!1===t;return{props:eP.useMemo(()=>{let e={onKeyDown(e){n&&t&&"Tab"!==e.key&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||s)||!a&&n)&&(e["aria-disabled"]=n),a&&(!t||o)&&(e.disabled=n),e},[r,n,t,s,o,a,i])}}({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:i}),c=eP.useCallback(()=>{let e=s.current;tI(e)&&l&&t&&void 0===d.disabled&&e.disabled&&(e.disabled=!1)},[t,d.disabled,l]);return(0,tr.useIsoLayoutEffect)(c,[c]),{getButtonProps:eP.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:s,onPointerDown:o,...c}=e;return(0,tN.mergeProps)({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){var r;if(t||((0,tN.makeEventPreventable)(e),s?.(e),e.baseUIHandlerPrevented))return;let a=e.target===e.currentTarget,o=e.currentTarget,d=tI(o),c=!i&&(r=o,!!(r?.tagName==="A"&&r?.href)),u=a&&(i?d:!c),m="Enter"===e.key,p=" "===e.key,f=o.getAttribute("role"),h=f?.startsWith("menuitem")||"option"===f||"gridcell"===f;if(a&&l&&p){if(e.defaultPrevented&&h)return;e.preventDefault(),c||i&&d?(o.click(),e.preventBaseUIHandler()):u&&(n?.(e),e.preventBaseUIHandler());return}u&&(!i&&(p||m)&&e.preventDefault(),!i&&m&&n?.(e))},onKeyUp(e){t||(((0,tN.makeEventPreventable)(e),a?.(e),e.target===e.currentTarget&&i&&l&&tI(e.currentTarget)&&" "===e.key)?e.preventDefault():!e.baseUIHandlerPrevented&&(e.target!==e.currentTarget||i||l||" "!==e.key||n?.(e)))},onPointerDown(e){t?e.preventDefault():o?.(e)}},i?{type:"button"}:{role:"button"},d,c)},[t,d,l,i]),buttonRef:(0,ti.useStableCallback)(e=>{s.current=e,c()})}}function tI(e){return(0,tw.isHTMLElement)(e)&&"BUTTON"===e.tagName}let tE="data-composite-item-active";var tC=e.i(52653);let tA=((a={})[a.None=0]="None",a[a.GuessFromOrder=1]="GuessFromOrder",a);function tT(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:s,unregister:o,subscribeMapChange:l,elementsRef:d,labelsRef:c,nextIndexRef:u}=eP.useContext(to),m=eP.useRef(-1),[p,f]=eP.useState(a??(i===tA.GuessFromOrder?()=>{if(-1===m.current){let e=u.current;u.current+=1,m.current=e}return m.current}:-1)),h=eP.useRef(null),g=eP.useCallback(e=>{if(h.current=e,-1!==p&&null!==e&&(d.current[p]=e,c)){let n=void 0!==t;c.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,d,c,t,r]);return(0,tr.useIsoLayoutEffect)(()=>{if(null!=a)return;let e=h.current;if(e)return s(e,n),()=>{o(e)}},[a,s,o,n]),(0,tr.useIsoLayoutEffect)(()=>{if(null==a)return l(e=>{let t=h.current?e.get(h.current)?.index:null;null!=t&&f(t)})},[a,l,f]),eP.useMemo(()=>({ref:g,index:p}),[p,g])}function tP(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=tS(),{ref:i,index:a}=tT(e),s=n===a,o=eP.useRef(null),l=(0,tC.useMergedRefs)(i,o);return{compositeProps:eP.useMemo(()=>({tabIndex:s?0:-1,onFocus(){r(a)},onMouseMove(){let e=o.current;if(!t||!e)return;let n=e.hasAttribute("disabled")||"true"===e.ariaDisabled;s||n||e.focus()}}),[s,r,a,t]),compositeRef:l,index:a}}let tz=eP.createContext(void 0);function tO(){let e=eP.useContext(tz);if(void 0===e)throw Error((0,tm.default)(65));return e}var tM=e.i(70362);let tR=eP.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:s,nativeButton:o=!0,style:l,...d}=e,{value:c,getTabPanelIdByValue:u,orientation:m}=tf(),{activateOnFocus:p,highlightedTabIndex:f,onTabActivation:h,registerTabResizeObserverElement:g,setHighlightedTabIndex:x,tabsListElement:v}=tO(),y=(0,tj.useBaseUiId)(s),{compositeProps:b,compositeRef:k,index:j}=tP({metadata:eP.useMemo(()=>({disabled:r,id:y,value:a}),[r,y,a])}),w=a===c,N=eP.useRef(!1),_=eP.useRef(null);eP.useEffect(()=>{let e=_.current;if(e)return g(e)},[g]),(0,tr.useIsoLayoutEffect)(()=>{if(N.current){N.current=!1;return}if(w&&j>-1&&f!==j){if(null!=v){let e=(0,tM.activeElement)((0,tk.ownerDocument)(v));if(e&&(0,tM.contains)(v,e))return}r||x(j)}},[w,j,f,x,r,v]);let{getButtonProps:S,buttonRef:$}=t$({disabled:r,native:o,focusableWhenDisabled:!0}),I=u(a),E=eP.useRef(!1),C=eP.useRef(!1);return(0,ta.useRenderElement)("button",e,{state:{disabled:r,active:w,orientation:m},ref:[t,$,k,_],props:[b,{role:"tab","aria-controls":I,"aria-selected":w,id:y,onClick:function(e){w||r||h(a,(0,tx.createChangeEventDetails)(tv.REASONS.none,e.nativeEvent,void 0,{activationDirection:"none"}))},onFocus:function(e){w||(j>-1&&!r&&x(j),!r&&p&&(!E.current||E.current&&C.current)&&h(a,(0,tx.createChangeEventDetails)(tv.REASONS.none,e.nativeEvent,void 0,{activationDirection:"none"})))},onPointerDown:function(e){w||r||(E.current=!0,e.button&&0!==e.button||(C.current=!0,(0,tk.ownerDocument)(e.currentTarget).addEventListener("pointerup",function(){E.current=!1,C.current=!1},{once:!0})))},[tE]:w?"":void 0,onKeyDownCapture(){N.current=!0}},d,S]})});var tD=e.i(15183),tL=e.i(56032),tU=e.i(71793);function tZ(){return tU.NOOP}function tF(){return!1}function tB(){return!0}let tV=((s={}).activeTabLeft="--active-tab-left",s.activeTabRight="--active-tab-right",s.activeTabTop="--active-tab-top",s.activeTabBottom="--active-tab-bottom",s.activeTabWidth="--active-tab-width",s.activeTabHeight="--active-tab-height",s),tq=eP.createContext(void 0),tW={disableStyleElements:!1};function tH(){return eP.useContext(tq)??tW}let tG={...tg,activeTabPosition:()=>null,activeTabSize:()=>null},tK=eP.forwardRef(function(e,t){let{className:n,render:r,renderBeforeHydration:i=!1,style:a,...s}=e,{nonce:o}=tH(),{getTabElementBySelectedValue:l,orientation:d,tabActivationDirection:c,value:u}=tf(),{tabsListElement:m,registerIndicatorUpdateListener:p}=tO(),f=(0,tL.useSyncExternalStore)(tZ,tF,tB),h=function(){let[,e]=eP.useState({});return eP.useCallback(()=>{e({})},[])}();eP.useEffect(()=>p(h),[p,h]);let g=0,x=0,v=0,y=0,b=0,k=0,j=!1;if(null!=u&&null!=m){let e=l(u);if(j=!0,null!=e){let{width:t,height:n}=(0,tD.getCssDimensions)(e),{width:r,height:i}=(0,tD.getCssDimensions)(m),a=e.getBoundingClientRect(),s=m.getBoundingClientRect(),o=r>0?s.width/r:1,l=i>0?s.height/i:1;if(Math.abs(o)>Number.EPSILON&&Math.abs(l)>Number.EPSILON){let e=a.left-s.left,t=a.top-s.top;g=e/o+m.scrollLeft-m.clientLeft,v=t/l+m.scrollTop-m.clientTop}else g=e.offsetLeft,v=e.offsetTop;b=t,k=n,x=m.scrollWidth-g-b,y=m.scrollHeight-v-k}}let w=j?{left:g,right:x,top:v,bottom:y}:null,N=j?{width:b,height:k}:null,_=j?{[tV.activeTabLeft]:`${g}px`,[tV.activeTabRight]:`${x}px`,[tV.activeTabTop]:`${v}px`,[tV.activeTabBottom]:`${y}px`,[tV.activeTabWidth]:`${b}px`,[tV.activeTabHeight]:`${k}px`}:void 0,S=j&&b>0&&k>0,$=(0,ta.useRenderElement)("span",e,{state:{orientation:d,activeTabPosition:w,activeTabSize:N,tabActivationDirection:c},ref:t,props:[{role:"presentation",style:_,hidden:!S},s,{suppressHydrationWarning:!0}],stateAttributesMapping:tG});return null==u?null:(0,eT.jsxs)(eP.Fragment,{children:[$,f&&i&&(0,eT.jsx)("script",{nonce:o,dangerouslySetInnerHTML:{__html:'!function(){const t=document.currentScript.previousElementSibling;if(!t)return;const e=t.closest(\'[role="tablist"]\');if(!e)return;const i=e.querySelector("[data-active]");if(!i)return;if(0===i.offsetWidth||0===e.offsetWidth)return;let o=0,n=0,h=0,l=0,r=0,f=0;function s(t){const e=getComputedStyle(t);let i=parseFloat(e.width)||0,o=parseFloat(e.height)||0;return(Math.round(i)!==t.offsetWidth||Math.round(o)!==t.offsetHeight)&&(i=t.offsetWidth,o=t.offsetHeight),{width:i,height:o}}if(null!=i&&null!=e){const{width:t,height:c}=s(i),{width:u,height:d}=s(e),a=i.getBoundingClientRect(),g=e.getBoundingClientRect(),p=u>0?g.width/u:1,b=d>0?g.height/d:1;if(Math.abs(p)>Number.EPSILON&&Math.abs(b)>Number.EPSILON){const t=a.left-g.left,i=a.top-g.top;o=t/p+e.scrollLeft-e.clientLeft,h=i/b+e.scrollTop-e.clientTop}else o=i.offsetLeft,h=i.offsetTop;r=t,f=c,n=e.scrollWidth-o-r,l=e.scrollHeight-h-f}function c(e,i){t.style.setProperty(`--active-tab-${e}`,`${i}px`)}c("left",o),c("right",n),c("top",h),c("bottom",l),c("width",r),c("height",f),r>0&&f>0&&t.removeAttribute("hidden")}();'},suppressHydrationWarning:!0})]})});var tJ=e.i(3224),tY=e.i(46315),tX=e.i(74146),tQ=e.i(36119);let t0=((o={}).index="data-index",o.activationDirection="data-activation-direction",o.orientation="data-orientation",o.hidden="data-hidden",o[o.startingStyle=tY.TransitionStatusDataAttributes.startingStyle]="startingStyle",o[o.endingStyle=tY.TransitionStatusDataAttributes.endingStyle]="endingStyle",o),t1={...tg,...tY.transitionStatusMapping},t2=eP.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,style:s,...o}=e,{value:l,getTabIdByPanelValue:d,orientation:c,tabActivationDirection:u,registerMountedTabPanel:m,unregisterMountedTabPanel:p}=tf(),f=(0,tj.useBaseUiId)(),{ref:h,index:g}=tT({metadata:eP.useMemo(()=>({id:f,value:r}),[f,r])}),x=r===l,{mounted:v,transitionStatus:y,setMounted:b}=(0,tQ.useTransitionStatus)(x),k=!v,j=d(r),w=eP.useRef(null),N=(0,ta.useRenderElement)("div",e,{state:{hidden:k,orientation:c,tabActivationDirection:u,transitionStatus:y},ref:[t,h,w],props:[{"aria-labelledby":j,hidden:k,id:f,role:"tabpanel",tabIndex:x?0:-1,inert:(0,tJ.inertValue)(!x),[t0.index]:g},o],stateAttributesMapping:t1});return((0,tX.useOpenChangeComplete)({open:x,ref:w,onComplete(){x||b(!1)}}),(0,tr.useIsoLayoutEffect)(()=>{if((!k||a)&&null!=f)return m(r,f),()=>{p(r,f)}},[k,a,r,f,m,p]),a||v)?N:null}),t4="ArrowUp",t5="ArrowDown",t6="ArrowLeft",t3="ArrowRight",t9="Home",t8=new Set([t6,t3]),t7=new Set([t6,t3,t9,"End"]),ne=new Set([t4,t5]),nt=new Set([t4,t5,t9,"End"]),nn=new Set([...t8,...ne]),nr=new Set([...nn,t9,"End"]),ni=new Set(["Shift","Control","Alt","Meta"]);function na(e){return!!((0,tw.isHTMLElement)(e)&&"INPUT"===e.tagName&&null!=e.selectionStart||(0,tw.isHTMLElement)(e)&&"TEXTAREA"===e.tagName)}function ns(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,s=e.clientWidth<e.scrollWidth,o=e.clientHeight<e.scrollHeight;if(s&&"vertical"!==r){let r=no(e,t,"left"),a=nl(e),s=nl(t);"ltr"===n&&(r+t.offsetWidth+s.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+s.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-s.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-s.scrollMarginLeft-a.scrollPaddingLeft)),"rtl"===n&&(r-s.scrollMarginRight<e.scrollLeft+a.scrollPaddingLeft?i=r-s.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+s.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+s.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(o&&"horizontal"!==r){let n=no(e,t,"top"),r=nl(e),i=nl(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:"auto"})}function no(e,t,n){let r="left"===n?"offsetLeft":"offsetTop",i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function nl(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var nd=e.i(11302);let nc=[];var nu=e.i(65269);function nm(e){let{render:t,className:n,style:r,refs:i=tU.EMPTY_ARRAY,props:a=tU.EMPTY_ARRAY,state:s=tU.EMPTY_OBJECT,stateAttributesMapping:o,highlightedIndex:l,onHighlightedIndexChange:d,orientation:c,dense:u,itemSizes:m,loopFocus:p,onLoop:f,cols:h,enableHomeAndEndKeys:g,onMapChange:x,stopEventPropagation:v=!0,rootRef:y,disabledIndices:b,modifierKeys:k,highlightItemOnHover:j=!1,tag:w="div",...N}=e,{props:_,highlightedIndex:S,onHighlightedIndexChange:$,elementsRef:I,onMapChange:E,relayKeyboardEvent:C}=function(e){let{itemSizes:t,cols:n=1,loopFocus:r=!0,onLoop:i,dense:a=!1,orientation:s="both",direction:o,highlightedIndex:l,onHighlightedIndexChange:d,rootRef:c,enableHomeAndEndKeys:u=!1,stopEventPropagation:m=!1,disabledIndices:p,modifierKeys:f=nc}=e,[h,g]=eP.useState(0),x=n>1,v=eP.useRef(null),y=(0,tC.useMergedRefs)(v,c),b=eP.useRef([]),k=eP.useRef(!1),j=l??h,w=(0,ti.useStableCallback)((e,t=!1)=>{if((d??g)(e),t){let t=b.current[e];ns(v.current,t,o,s)}}),N=(0,ti.useStableCallback)(e=>{if(0===e.size||k.current)return;k.current=!0;let t=Array.from(e.keys()),n=t.find(e=>e?.hasAttribute(tE))??null,r=n?t.indexOf(n):-1;-1!==r&&w(r),ns(v.current,n,o,s)}),_=(0,ti.useStableCallback)((e,t,n)=>i?i?.(e,t,n,b):n),S=eP.useMemo(()=>({"aria-orientation":"both"===s?void 0:s,ref:y,onFocus(e){let t=v.current,n=(0,tM.getTarget)(e.nativeEvent);t&&null!=n&&na(n)&&n.setSelectionRange(0,n.value.length??0)},onKeyDown(e){let l=u?nr:nn;if(!l.has(e.key)||function(e,t){for(let n of ni.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}(e,f)||!v.current)return;let d="rtl"===o,c=d?t6:t3,h={horizontal:c,vertical:t5,both:c}[s],g=d?t3:t6,y={horizontal:g,vertical:t4,both:g}[s],k=(0,tM.getTarget)(e.nativeEvent);if(null!=k&&na(k)&&!(null==k||k.hasAttribute("disabled")||"true"===k.getAttribute("aria-disabled"))){let t=k.selectionStart,n=k.selectionEnd,r=k.value??"";if(null==t||e.shiftKey||t!==n||e.key!==y&&t<r.length||e.key!==h&&t>0)return}let N=j,S=(0,nd.getMinListIndex)(b,p),$=(0,nd.getMaxListIndex)(b,p);if(x){let i=t||Array.from({length:b.current.length},()=>({width:1,height:1})),o=(0,nd.createGridCellMap)(i,n,a),l=o.findIndex(e=>null!=e&&!(0,nd.isListIndexDisabled)(b.current,e,p)),c=o.reduce((e,t,n)=>null==t||(0,nd.isListIndexDisabled)(b.current,t,p)?e:n,-1);N=o[(0,nd.getGridNavigatedIndex)(o.map(e=>null!=e?b.current[e]:null),{event:e,orientation:s,loopFocus:r,onLoop:_,cols:n,disabledIndices:(0,nd.getGridCellIndices)([...p||b.current.map((e,t)=>(0,nd.isListIndexDisabled)(b.current,t)?t:void 0),void 0],o),minIndex:l,maxIndex:c,prevIndex:(0,nd.getGridCellIndexOfCorner)(j>$?S:j,i,o,n,e.key===t5?"bl":e.key===t3?"tr":"tl"),rtl:d})]}let I={horizontal:[c],vertical:[t5],both:[c,t5]}[s],E={horizontal:[g],vertical:[t4],both:[g,t4]}[s],C=x?l:({horizontal:u?t7:t8,vertical:u?nt:ne,both:l})[s];u&&(e.key===t9?N=S:"End"===e.key&&(N=$)),N===j&&(I.includes(e.key)||E.includes(e.key))&&(r&&N===$&&I.includes(e.key)?(N=S,i&&(N=i(e,j,N,b))):r&&N===S&&E.includes(e.key)?(N=$,i&&(N=i(e,j,N,b))):N=(0,nd.findNonDisabledListIndex)(b.current,{startingIndex:N,decrement:E.includes(e.key),disabledIndices:p})),N===j||(0,nd.isIndexOutOfListBounds)(b.current,N)||(m&&e.stopPropagation(),C.has(e.key)&&e.preventDefault(),w(N,!0),queueMicrotask(()=>{b.current[N]?.focus()}))}}),[n,a,o,p,b,u,j,x,t,r,i,_,y,f,w,s,m]);return eP.useMemo(()=>({props:S,highlightedIndex:j,onHighlightedIndexChange:w,elementsRef:b,disabledIndices:p,onMapChange:N,relayKeyboardEvent:S.onKeyDown}),[S,j,w,b,p,N])}({itemSizes:m,cols:h,loopFocus:p,onLoop:f,dense:u,orientation:c,highlightedIndex:l,onHighlightedIndexChange:d,rootRef:y,stopEventPropagation:v,enableHomeAndEndKeys:g,direction:(0,nu.useDirection)(),disabledIndices:b,modifierKeys:k}),A=(0,ta.useRenderElement)(w,e,{state:s,ref:i,props:[_,...a,N],stateAttributesMapping:o}),T=eP.useMemo(()=>({highlightedIndex:S,onHighlightedIndexChange:$,highlightItemOnHover:j,relayKeyboardEvent:C}),[S,$,j,C]);return(0,eT.jsx)(t_.Provider,{value:T,children:(0,eT.jsx)(tl,{elementsRef:I,onMapChange:e=>{x?.(e),E(e)},children:A})})}let np=eP.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,style:s,...o}=e,{onValueChange:l,orientation:d,value:c,setTabMap:u,tabActivationDirection:m}=tf(),[p,f]=eP.useState(0),[h,g]=eP.useState(null),x=eP.useRef(new Set),v=eP.useRef(new Set),y=eP.useRef(null);eP.useEffect(()=>{if("u"<typeof ResizeObserver)return;let e=new ResizeObserver(()=>{x.current.forEach(e=>{e()})});return y.current=e,h&&e.observe(h),v.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),y.current=null}},[h]);let b=(0,ti.useStableCallback)(e=>(x.current.add(e),()=>{x.current.delete(e)})),k=(0,ti.useStableCallback)(e=>(v.current.add(e),y.current?.observe(e),()=>{v.current.delete(e),y.current?.unobserve(e)})),j=(0,ti.useStableCallback)((e,t)=>{e!==c&&l(e,t)}),w=eP.useMemo(()=>({activateOnFocus:n,highlightedTabIndex:p,registerIndicatorUpdateListener:b,registerTabResizeObserverElement:k,onTabActivation:j,setHighlightedTabIndex:f,tabsListElement:h}),[n,p,b,k,j,f,h]);return(0,eT.jsx)(tz.Provider,{value:w,children:(0,eT.jsx)(nm,{render:a,className:r,style:s,state:{orientation:d,tabActivationDirection:m},refs:[t,g],props:[{"aria-orientation":"vertical"===d?"vertical":void 0,role:"tablist"},o],stateAttributesMapping:tg,highlightedIndex:p,enableHomeAndEndKeys:!0,loopFocus:i,orientation:d,onHighlightedIndexChange:f,onMapChange:u,disabledIndices:tU.EMPTY_ARRAY})})});e.s(["Indicator",0,tK,"List",0,np,"Panel",0,t2,"Root",0,ty,"Tab",0,tR],71998);var nf=e.i(71998),nf=nf,nh=e.i(7284);let ng=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,nx=nh.clsx,nv=(e,t)=>n=>{var r;if((null==t?void 0:t.variants)==null)return nx(e,null==n?void 0:n.class,null==n?void 0:n.className);let{variants:i,defaultVariants:a}=t,s=Object.keys(i).map(e=>{let t=null==n?void 0:n[e],r=null==a?void 0:a[e];if(null===t)return null;let s=ng(t)||ng(r);return i[e][s]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{});return nx(e,s,null==t||null==(r=t.compoundVariants)?void 0:r.reduce((e,t)=>{let{class:n,className:r,...i}=t;return Object.entries(i).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...a,...o}[t]):({...a,...o})[t]===n})?[...e,n,r]:e},[]),null==n?void 0:n.class,null==n?void 0:n.className)};var ny=e.i(47163);function nb({className:e,orientation:t="horizontal",...n}){return(0,eT.jsx)(nf.Root,{"data-slot":"tabs","data-orientation":t,className:(0,ny.cn)("group/tabs flex gap-2 data-horizontal:flex-col",e),...n})}let nk=nv("group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function nj({className:e,variant:t="default",...n}){return(0,eT.jsx)(nf.List,{"data-slot":"tabs-list","data-variant":t,className:(0,ny.cn)(nk({variant:t}),e),...n})}function nw({className:e,...t}){return(0,eT.jsx)(nf.Tab,{"data-slot":"tabs-trigger",className:(0,ny.cn)("relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground","after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...t})}function nN({className:e,...t}){return(0,eT.jsx)(nf.Panel,{"data-slot":"tabs-content",className:(0,ny.cn)("flex-1 text-sm outline-none",e),...t})}let n_=nv("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function nS({className:e,variant:t="default",render:n,...r}){var i;return i={defaultTagName:"span",props:(0,tN.mergeProps)({className:(0,ny.cn)(n_({variant:t}),e)},r),render:n,state:{slot:"badge",variant:t}},(0,ta.useRenderElement)(i.defaultTagName??"div",i,i)}e.s([],40861),e.i(40861);var n$=e.i(96555),nI=e.i(14545),nE=e.i(81254),nC=e.i(55649),nA=e.i(62352),nT=e.i(2534),nP=e.i(95680),nz=e.i(62993),nO=e.i(55601),nM=e.i(73499);function nR(e,t={}){let{enabled:n=!0,event:r="click",toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:s=!0,touchOpenDelay:o=0,reason:l=tv.REASONS.triggerPress}=t,d="rootStore"in e?e.rootStore:e,c=d.context.dataRef,u=eP.useRef(void 0),m=(0,nP.useAnimationFrame)(),p=(0,nz.useTimeout)(),f=eP.useMemo(()=>{function e(e,t,n,r){let i=(0,tx.createChangeEventDetails)(l,t,n);e&&"touch"===r&&o>0?p.start(o,()=>{d.setOpen(!0,i)}):d.setOpen(e,i)}function t(e,t,n){let r=c.current.openEvent,a=d.select("domReferenceElement")!==t;return!!e&&!!a||!e||!i||!!r&&!!s&&!n(r.type)}return{onPointerDown(e){u.current=e.pointerType},onMouseDown(n){let i=u.current,s=n.nativeEvent,o=d.select("open");if(0!==n.button||"click"===r||(0,nM.isMouseLikePointerType)(i,!0)&&a)return;let l=t(o,n.currentTarget,e=>"click"===e||"mousedown"===e),c=(0,tM.getTarget)(s);if((0,nO.isTypeableElement)(c))return void e(l,s,c,i);let p=n.currentTarget;m.request(()=>{e(l,s,p,i)})},onClick(n){if("mousedown-only"===r)return;let i=u.current;if("mousedown"===r&&i){u.current=void 0;return}(0,nM.isMouseLikePointerType)(i,!0)&&a||e(t(d.select("open"),n.currentTarget,e=>"click"===e||"mousedown"===e||"keydown"===e||"keyup"===e),n.nativeEvent,n.currentTarget,i)},onKeyDown(){u.current=void 0}}},[c,r,a,l,d,s,i,m,p,o]);return eP.useMemo(()=>n?{reference:f}:tU.EMPTY_OBJECT,[n,f])}var nD=e.i(84279),nL=e.i(78602),nU=e.i(91245),nZ=e.i(24860);let nF=0;function nB(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;function a(){(!i||i())&&e?.focus({preventScroll:n})}if(cancelAnimationFrame(nF),r)return a(),tU.NOOP;let s=requestAnimationFrame(a);return nF=s,()=>{nF===s&&(cancelAnimationFrame(s),nF=0)}}function nV(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function nq(e,t){return nV(t,e===nZ.ARROW_UP||e===nZ.ARROW_DOWN,e===nZ.ARROW_LEFT||e===nZ.ARROW_RIGHT)}function nW(e,t,n){return nV(t,e===nZ.ARROW_DOWN,n?e===nZ.ARROW_LEFT:e===nZ.ARROW_RIGHT)||"Enter"===e||" "===e||""===e}function nH(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:s=null,allowEscape:o=!1,loopFocus:l=!1,nested:d=!1,rtl:c=!1,virtual:u=!1,focusItemOnOpen:m="auto",focusItemOnHover:p=!0,openOnArrowKeyDown:f=!0,disabledIndices:h,orientation:g="vertical",parentOrientation:x,cols:v=1,id:y,resetOnPointerLeave:b=!0,externalTree:k}=t,j="rootStore"in e?e.rootStore:e,w=j.useState("open"),N=j.useState("floatingElement"),_=j.useState("domReferenceElement"),S=j.context.dataRef,$=(0,nO.getFloatingFocusElement)(N),I=(0,nO.isTypeableCombobox)(_),E=(0,nC.useValueAsRef)($),C=(0,nU.useFloatingParentNodeId)(),A=(0,nU.useFloatingTree)(k),T=eP.useRef(m),P=eP.useRef(s??-1),z=eP.useRef(null),O=eP.useRef(!0),M=(0,ti.useStableCallback)(e=>{i(-1===P.current?null:P.current,e)}),R=eP.useRef(M),D=eP.useRef(!!N),L=eP.useRef(w),U=eP.useRef(!1),Z=eP.useRef(!1),F=eP.useRef(null),B=(0,nC.useValueAsRef)(h),V=(0,nC.useValueAsRef)(w),q=(0,nC.useValueAsRef)(s),W=(0,nC.useValueAsRef)(b),H=(0,nP.useAnimationFrame)(),G=(0,nP.useAnimationFrame)(),K=(0,ti.useStableCallback)(()=>{function e(e){u?A?.events.emit("virtualfocus",e):F.current=nB(e,{sync:U.current,preventScroll:!0})}let t=n.current[P.current],r=Z.current;t&&e(t),(U.current?e=>e():e=>H.request(e))(()=>{let i=n.current[P.current]||t;!i||(t||e(i),et&&(r||!O.current)&&i.scrollIntoView?.({block:"nearest",inline:"nearest"}))})});(0,tr.useIsoLayoutEffect)(()=>{S.current.orientation=g},[S,g]),(0,tr.useIsoLayoutEffect)(()=>{a&&(w&&N?(P.current=s??-1,T.current&&null!=s&&(Z.current=!0,M())):D.current&&(P.current=-1,R.current()))},[a,w,N,s,M]),(0,tr.useIsoLayoutEffect)(()=>{if(a){if(!w){U.current=!1;return}if(N)if(null==r){if(U.current=!1,null!=q.current)return;if(D.current&&(P.current=-1,K()),(!L.current||!D.current)&&T.current&&(null!=z.current||!0===T.current&&null==z.current)){let e=0,t=()=>{null==n.current[0]?(e<2&&(e?e=>G.request(e):queueMicrotask)(t),e+=1):(P.current=null==z.current||nW(z.current,g,c)||d?(0,nd.getMinListIndex)(n):(0,nd.getMaxListIndex)(n),z.current=null,M())};t()}}else(0,nd.isIndexOutOfListBounds)(n.current,r)||(P.current=r,K(),Z.current=!1)}},[a,w,N,r,q,d,n,g,c,M,K,G]),(0,tr.useIsoLayoutEffect)(()=>{if(!a||N||!A||u||!D.current)return;let e=A.nodesRef.current,t=e.find(e=>e.id===C)?.context?.elements.floating,n=(0,tM.activeElement)((0,tk.ownerDocument)(N)),r=e.some(e=>e.context&&(0,tM.contains)(e.context.elements.floating,n));t&&!r&&O.current&&t.focus({preventScroll:!0})},[a,N,A,C,u]),(0,tr.useIsoLayoutEffect)(()=>{R.current=M,L.current=w,D.current=!!N}),(0,tr.useIsoLayoutEffect)(()=>{w||(z.current=null,T.current=m)},[w,m]);let J=null!=r,Y=(0,ti.useStableCallback)(e=>{if(!V.current)return;let t=n.current.indexOf(e.currentTarget);-1!==t&&(P.current!==t||r!==t)&&(P.current=t,M(e))}),X=(0,ti.useStableCallback)(()=>x??A?.nodesRef.current.find(e=>e.id===C)?.context?.dataRef?.current.orientation),Q=(0,ti.useStableCallback)(()=>(0,nd.getMinListIndex)(n,B.current)),ee=(0,ti.useStableCallback)(e=>{var t;let r,i;if(O.current=!1,U.current=!0,229===e.which||!V.current&&e.currentTarget===E.current)return;if(d&&(t=e.key,r=c?t===nZ.ARROW_RIGHT:t===nZ.ARROW_LEFT,i=t===nZ.ARROW_UP,"both"===g||"horizontal"===g&&v&&v>1?"Escape"===t:nV(g,r,i))){nq(e.key,X())||(0,nM.stopEvent)(e),j.setOpen(!1,(0,tx.createChangeEventDetails)(tv.REASONS.listNavigation,e.nativeEvent)),(0,tw.isHTMLElement)(_)&&(u?A?.events.emit("virtualfocus",_):_.focus());return}let a=P.current,s=(0,nd.getMinListIndex)(n,h),m=(0,nd.getMaxListIndex)(n,h);if(I||("Home"===e.key&&((0,nM.stopEvent)(e),P.current=s,M(e)),"End"===e.key&&((0,nM.stopEvent)(e),P.current=m,M(e))),v>1){let t=Array.from({length:n.current.length},()=>({width:1,height:1})),r=(0,nd.createGridCellMap)(t,v,!1),i=r.findIndex(e=>null!=e&&!(0,nd.isListIndexDisabled)(n.current,e,h)),a=r.reduce((e,t,r)=>null==t||(0,nd.isListIndexDisabled)(n.current,t,h)?e:r,-1),o=r[(0,nd.getGridNavigatedIndex)(r.map(e=>null!=e?n.current[e]:null),{event:e,orientation:g,loopFocus:l,rtl:c,cols:v,disabledIndices:(0,nd.getGridCellIndices)([...("function"!=typeof h?h:null)||n.current.map((e,t)=>(0,nd.isListIndexDisabled)(n.current,t,h)?t:void 0),void 0],r),minIndex:i,maxIndex:a,prevIndex:(0,nd.getGridCellIndexOfCorner)(P.current>m?s:P.current,t,r,v,e.key===nZ.ARROW_DOWN?"bl":e.key===(c?nZ.ARROW_LEFT:nZ.ARROW_RIGHT)?"tr":"tl"),stopEvent:!0})];if(null!=o&&(P.current=o,M(e)),"both"===g)return}if(nq(e.key,g)){if((0,nM.stopEvent)(e),w&&!u&&(0,tM.activeElement)(e.currentTarget.ownerDocument)===e.currentTarget){P.current=nW(e.key,g,c)?s:m,M(e);return}nW(e.key,g,c)?l?a>=m?o&&a!==n.current.length?P.current=-1:(U.current=!1,P.current=s):P.current=(0,nd.findNonDisabledListIndex)(n.current,{startingIndex:a,disabledIndices:h}):P.current=Math.min(m,(0,nd.findNonDisabledListIndex)(n.current,{startingIndex:a,disabledIndices:h})):l?a<=s?o&&-1!==a?P.current=n.current.length:(U.current=!1,P.current=m):P.current=(0,nd.findNonDisabledListIndex)(n.current,{startingIndex:a,decrement:!0,disabledIndices:h}):P.current=Math.max(s,(0,nd.findNonDisabledListIndex)(n.current,{startingIndex:a,decrement:!0,disabledIndices:h})),(0,nd.isIndexOutOfListBounds)(n.current,P.current)&&(P.current=-1),M(e)}}),et=eP.useMemo(()=>({onFocus(e){U.current=!0,Y(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){U.current=!0,Z.current=!1,p&&Y(e)},onPointerLeave(e){if(!V.current||!O.current||"touch"===e.pointerType)return;U.current=!0;let t=e.relatedTarget;if(!(!p||n.current.includes(t))&&W.current&&(F.current?.(),F.current=null,P.current=-1,M(e),!u)){let e=E.current,t=(0,tM.activeElement)((0,tk.ownerDocument)(e));e&&(0,tM.contains)(e,t)&&e.focus({preventScroll:!0})}}}),[Y,V,E,p,n,M,W,u]),en=eP.useMemo(()=>u&&w&&J&&{"aria-activedescendant":`${y}-${r}`},[u,w,J,y,r]),er=eP.useMemo(()=>({"aria-orientation":"both"===g?void 0:g,...!I?en:{},onKeyDown(e){if("Tab"===e.key&&e.shiftKey&&w&&!u){let t=(0,tM.getTarget)(e.nativeEvent);if(t&&!(0,tM.contains)(E.current,t))return;(0,nM.stopEvent)(e),j.setOpen(!1,(0,tx.createChangeEventDetails)(tv.REASONS.focusOut,e.nativeEvent)),(0,tw.isHTMLElement)(_)&&_.focus();return}ee(e)},onPointerMove(){O.current=!0}}),[en,ee,E,g,I,j,w,u,_]),ei=eP.useMemo(()=>{function e(e){j.setOpen(!0,(0,tx.createChangeEventDetails)(tv.REASONS.listNavigation,e.nativeEvent,e.currentTarget))}function t(e){"auto"===m&&(0,nM.isVirtualClick)(e.nativeEvent)&&(T.current=!u)}function n(e){T.current=m,"auto"===m&&(0,nM.isVirtualPointerEvent)(e.nativeEvent)&&(T.current=!0)}return{onKeyDown(t){var n,r;let i=j.select("open");O.current=!1;let a=t.key.startsWith("Arrow"),s=(n=t.key,r=X(),nV(r,c?n===nZ.ARROW_LEFT:n===nZ.ARROW_RIGHT,n===nZ.ARROW_DOWN)),o=nq(t.key,g),l=(d?s:o)||"Enter"===t.key||""===t.key.trim();if(u&&i)return ee(t);if(i||f||!a){if(l){let e=nq(t.key,X());z.current=d&&e?null:t.key}if(d){s&&((0,nM.stopEvent)(t),i?(P.current=Q(),M(t)):e(t));return}o&&(null!=q.current&&(P.current=q.current),(0,nM.stopEvent)(t),!i&&f?e(t):ee(t),i&&M(t))}},onFocus(e){j.select("open")&&!u&&(P.current=-1,M(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[ee,m,Q,d,M,j,f,g,X,c,q,u]),ea=eP.useMemo(()=>({...en,...ei}),[en,ei]);return eP.useMemo(()=>a?{reference:ea,floating:er,item:et,trigger:ei}:{},[a,ea,er,ei,et])}function nG(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,onTyping:s,enabled:o=!0,resetMs:l=750,selectedIndex:d=null}=t,c="rootStore"in e?e.rootStore:e,u=c.useState("open"),m=(0,nz.useTimeout)(),p=eP.useRef(""),f=eP.useRef(d??i??-1),h=eP.useRef(null),g=(0,ti.useStableCallback)(e=>{function t(e,n,i=0){if(0===e.length)return -1;let a=(i%e.length+e.length)%e.length,s=n.toLocaleLowerCase();for(let t=0;t<e.length;t+=1){let n=(a+t)%e.length,i=e[n];if(i?.toLocaleLowerCase().startsWith(s)&&function(e){let t=r?.current[e];return!t||(0,nd.isElementVisible)(t)}(n))return n}return -1}let o=n.current;if(p.current.length>0&&" "===e.key&&((0,nM.stopEvent)(e),s?.(!0)),p.current.length>0&&" "!==p.current[0]&&-1===t(o,p.current)&&" "!==e.key&&s?.(!1),null==o||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;u&&" "!==e.key&&((0,nM.stopEvent)(e),s?.(!0));let c=""===p.current;c&&(f.current=d??i??-1),o.every(e=>!e||e[0]?.toLocaleLowerCase()!==e[1]?.toLocaleLowerCase())&&p.current===e.key&&(p.current="",f.current=h.current),p.current+=e.key,m.start(l,()=>{p.current="",f.current=h.current,s?.(!1)});let g=c?d??i??-1:f.current,x=t(o,p.current,(g??0)+1);-1!==x?(a?.(x),h.current=x):" "!==e.key&&(p.current="",s?.(!1))}),x=(0,ti.useStableCallback)(e=>{let t=e.relatedTarget,n=c.select("domReferenceElement"),r=c.select("floatingElement");(0,tM.contains)(n,t)||(0,tM.contains)(r,t)||(m.clear(),p.current="",f.current=h.current,s?.(!1))});(0,tr.useIsoLayoutEffect)(()=>{(u||null===d)&&(m.clear(),h.current=null,""!==p.current&&(p.current=""))},[u,d,m]),(0,tr.useIsoLayoutEffect)(()=>{u&&""===p.current&&(f.current=d??i??-1)},[u,d,i]);let v=eP.useMemo(()=>({onKeyDown:g,onBlur:x}),[g,x]);return eP.useMemo(()=>o?{reference:v,floating:v}:{},[o,v])}let nK=eP.createContext(null),nJ=eP.createContext(null);function nY(){let e=eP.useContext(nK);if(null===e)throw Error((0,tm.default)(60));return e}function nX(){let e=eP.useContext(nJ);if(null===e)throw Error((0,tm.default)(61));return e}var nQ=tU;let n0=((l={}).disabled="data-disabled",l.valid="data-valid",l.invalid="data-invalid",l.touched="data-touched",l.dirty="data-dirty",l.filled="data-filled",l.focused="data-focused",l),n1={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},n2={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},n4={disabled:!1,...n2},n5={valid:e=>null===e?null:e?{[n0.valid]:""}:{[n0.invalid]:""}},n6={invalid:void 0,name:void 0,validityData:{state:n1,errors:[],error:"",value:"",initialValue:null},setValidityData:nQ.NOOP,disabled:void 0,touched:n2.touched,setTouched:nQ.NOOP,dirty:n2.dirty,setDirty:nQ.NOOP,filled:n2.filled,setFilled:nQ.NOOP,focused:n2.focused,setFocused:nQ.NOOP,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:n4,markedDirtyRef:{current:!1},registerFieldControl:nQ.NOOP,validation:{getValidationProps:(e=nQ.EMPTY_OBJECT)=>e,getInputValidationProps:(e=nQ.EMPTY_OBJECT)=>e,inputRef:{current:null},commit:async()=>{}}},n3=eP.createContext(n6);function n9(e=!0){let t=eP.useContext(n3);if(t.setValidityData===nQ.NOOP&&!e)throw Error((0,tm.default)(28));return t}function n8(e,t,n,r,i=!0){let{registerFieldControl:a}=n9(),s=eP.useRef(null);s.current||(s.current=Symbol()),(0,tr.useIsoLayoutEffect)(()=>{let o=s.current;if(o&&i)return a(o,{controlRef:e,getValue:r,id:t,value:n}),()=>{a(o,void 0)}},[e,i,r,t,a,n])}let n7=eP.createContext({controlId:void 0,registerControlId:tU.NOOP,labelId:void 0,setLabelId:tU.NOOP,messageIds:[],setMessageIds:tU.NOOP,getDescriptionProps:e=>e});function re(){return eP.useContext(n7)}function rt(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=re(),s=(0,tj.useBaseUiId)(t),o=n?i:void 0,l=(0,ts.useRefWithInit)(()=>Symbol("labelable-control")),d=eP.useRef(!1),c=eP.useRef(null!=t),u=(0,ti.useStableCallback)(()=>{d.current&&a!==tU.NOOP&&(d.current=!1,a(l.current,void 0))});return(0,tr.useIsoLayoutEffect)(()=>{let e;if(a!==tU.NOOP){if(n){let n=r?.current;e=(0,tw.isElement)(n)&&null!=n.closest("label")?t??null:o??s}else if(null!=t)c.current=!0,e=t;else{if(!c.current)return void u();e=s}if(void 0===e)return void u();d.current=!0,a(l.current,e)}},[t,r,o,a,n,s,l,u]),eP.useEffect(()=>u,[u]),i??s}var rn=e.i(36335);let rr=(e,t)=>Object.is(e,t);function ri(e,t,n){return null==e||null==t?Object.is(e,t):n(e,t)}function ra(e,t,n){return e&&0!==e.length?e.findIndex(e=>void 0!==e&&ri(e,t,n)):-1}function rs(e){if(null==e)return"";if("string"==typeof e)return e;try{return JSON.stringify(e)}catch{return String(e)}}function ro(e){return null!=e&&e.length>0&&"object"==typeof e[0]&&null!=e[0]&&"items"in e[0]}function rl(e,t){if(t&&null!=e)return t(e)??"";if(e&&"object"==typeof e){if("label"in e&&null!=e.label)return String(e.label);if("value"in e)return String(e.value)}return rs(e)}function rd(e,t){return t&&null!=e?t(e)??"":e&&"object"==typeof e&&"value"in e&&"label"in e?rs(e.value):rs(e)}function rc(e,t,n){if(n&&null!=e)return n(e);if(e&&"object"==typeof e&&"label"in e&&null!=e.label)return e.label;if(t&&!Array.isArray(t))return t[e]??rl(e,n);if(Array.isArray(t)){let r=ro(t)?t.flatMap(e=>e.items):t;if(null==e||"object"!=typeof e){let t=r.find(t=>t.value===e);return t&&null!=t.label?t.label:rl(e,n)}if("value"in e){let t=r.find(t=>t&&t.value===e.value);if(t&&null!=t.label)return t.label}}return rl(e,n)}let ru={id:(0,rn.createSelector)(e=>e.id),labelId:(0,rn.createSelector)(e=>e.labelId),modal:(0,rn.createSelector)(e=>e.modal),multiple:(0,rn.createSelector)(e=>e.multiple),items:(0,rn.createSelector)(e=>e.items),itemToStringLabel:(0,rn.createSelector)(e=>e.itemToStringLabel),itemToStringValue:(0,rn.createSelector)(e=>e.itemToStringValue),isItemEqualToValue:(0,rn.createSelector)(e=>e.isItemEqualToValue),value:(0,rn.createSelector)(e=>e.value),hasSelectedValue:(0,rn.createSelector)(e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return null!=t&&(n&&Array.isArray(t)?t.length>0:""!==rd(t,r))}),hasNullItemLabel:(0,rn.createSelector)((e,t)=>!!t&&function(e){if(!Array.isArray(e))return null!=e&&"null"in e;if(ro(e)){for(let t of e)for(let e of t.items)if(e&&null==e.value&&null!=e.label)return!0;return!1}for(let t of e)if(t&&null==t.value&&null!=t.label)return!0;return!1}(e.items)),open:(0,rn.createSelector)(e=>e.open),mounted:(0,rn.createSelector)(e=>e.mounted),forceMount:(0,rn.createSelector)(e=>e.forceMount),transitionStatus:(0,rn.createSelector)(e=>e.transitionStatus),openMethod:(0,rn.createSelector)(e=>e.openMethod),activeIndex:(0,rn.createSelector)(e=>e.activeIndex),selectedIndex:(0,rn.createSelector)(e=>e.selectedIndex),isActive:(0,rn.createSelector)((e,t)=>e.activeIndex===t),isSelected:(0,rn.createSelector)((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>ri(n,e,r)):e.selectedIndex===t&&null!==e.selectedIndex||ri(n,i,r)}),isSelectedByFocus:(0,rn.createSelector)((e,t)=>e.selectedIndex===t),popupProps:(0,rn.createSelector)(e=>e.popupProps),triggerProps:(0,rn.createSelector)(e=>e.triggerProps),triggerElement:(0,rn.createSelector)(e=>e.triggerElement),positionerElement:(0,rn.createSelector)(e=>e.positionerElement),listElement:(0,rn.createSelector)(e=>e.listElement),popupSide:(0,rn.createSelector)(e=>e.popupSide),scrollUpArrowVisible:(0,rn.createSelector)(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:(0,rn.createSelector)(e=>e.scrollDownArrowVisible),hasScrollArrows:(0,rn.createSelector)(e=>e.hasScrollArrows)},rm=eP.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:tU.NOOP,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function rp(){return eP.useContext(rm)}function rf(e,t){let n=eP.useRef(e),r=(0,ti.useStableCallback)(t);(0,tr.useIsoLayoutEffect)(()=>{n.current!==e&&r(n.current)},[e,r]),(0,tr.useIsoLayoutEffect)(()=>{n.current=e},[e])}var rh=e.i(95033);function rg(e,t){var n;let r,i,{onClick:a,onPointerDown:s}=(n=(0,ti.useStableCallback)((n,r)=>{("function"==typeof e?e():e)||t(r||(rh.isIOS?"touch":""))}),r=eP.useRef(""),i=eP.useCallback(e=>{e.defaultPrevented||(r.current=e.pointerType,n(e,e.pointerType))},[n]),{onClick:eP.useCallback(e=>{0===e.detail?n(e,"keyboard"):("pointerType"in e?n(e,e.pointerType):n(e,r.current),r.current="")},[n]),onPointerDown:i});return eP.useMemo(()=>({onClick:a,onPointerDown:s}),[a,s])}function rx(e){let[t,n]=eP.useState(null),r=rg(e,n);return rf(e,t=>{t&&!e&&n(null)}),eP.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function rv(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function ry(e,t){return Math.max(0,e-t)}function rb(e,t){if(t<=0)return 0;let n=rv(e,0,t),r=t-n,i=n<=1,a=r<=1;return i&&a?n<=r?0:t:i?0:a?t:n}var rk=e.i(1069);function rj(e,t){let n=(0,tj.useBaseUiId)(e);return(0,tr.useIsoLayoutEffect)(()=>(t(n),()=>{t(void 0)}),[n,t]),n}function rw(e={}){let{id:t,fallbackControlId:n,native:r=!1,setLabelId:i,focusControl:a}=e,{controlId:s,setLabelId:o}=re(),l=rj(t,(0,ti.useStableCallback)(e=>{o(e),i?.(e)})),d=s??n;function c(e){let t=(0,tM.getTarget)(e.nativeEvent);t?.closest("button,input,select,textarea")||(!e.defaultPrevented&&e.detail>1&&e.preventDefault(),r||function(e){if(a)return a(e,d);if(!d)return;let t=(0,tk.ownerDocument)(e.currentTarget).getElementById(d);(0,tw.isHTMLElement)(t)&&t.focus({focusVisible:!0})}(e))}return r?{id:l,htmlFor:d??void 0,onMouseDown:c}:{id:l,onClick:c,onPointerDown(e){e.preventDefault()}}}let rN=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;delete a.id;let s=n9(),{store:o}=nY(),l=(0,nA.useStore)(o,ru.triggerElement),d=(0,nA.useStore)(o,ru.id),c=rw({id:null==d?void 0:`${d}-label`,fallbackControlId:l?.id??d,setLabelId(e){o.set("labelId",e)}});return(0,ta.useRenderElement)("div",e,{ref:t,state:s.state,props:[c,a],stateAttributesMapping:n5})});var r_=e.i(50092),rS=e.i(85182);function r$(e){let t=e.getBoundingClientRect(),n=(0,rS.ownerWindow)(e),r=n.getComputedStyle(e,"::before"),i=n.getComputedStyle(e,"::after");if("none"===r.content&&"none"===i.content)return t;let a=parseFloat(r.width)||0,s=parseFloat(r.height)||0,o=parseFloat(i.width)||0,l=parseFloat(i.height)||0,d=Math.max(t.width,a,o),c=Math.max(t.height,s,l),u=d-t.width,m=c-t.height;return{left:t.left-u/2,right:t.right+u/2,top:t.top-m/2,bottom:t.bottom+m/2}}let rI={...r_.pressableTriggerOpenStateMapping,...n5,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},rE=eP.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:s=!0,style:o,...l}=e,{setTouched:d,setFocused:c,validationMode:u,state:m,disabled:p}=n9(),{labelId:f}=re(),{store:h,setOpen:g,selectionRef:x,validation:v,readOnly:y,required:b,alignItemWithTriggerActiveRef:k,disabled:j,keyboardActiveRef:w}=nY(),N=p||j||a,_=(0,nA.useStore)(h,ru.open),S=(0,nA.useStore)(h,ru.mounted),$=(0,nA.useStore)(h,ru.value),I=(0,nA.useStore)(h,ru.triggerProps),E=(0,nA.useStore)(h,ru.positionerElement),C=(0,nA.useStore)(h,ru.listElement),A=(0,nA.useStore)(h,ru.popupSide),T=(0,nA.useStore)(h,ru.id),P=(0,nA.useStore)(h,ru.labelId),z=(0,nA.useStore)(h,ru.hasSelectedValue),O=S&&E?A:null,M=i??T;rt({id:M});let R=(0,nC.useValueAsRef)(E),D=eP.useRef(null),{getButtonProps:L,buttonRef:U}=t$({disabled:N,native:s}),Z=(0,ti.useStableCallback)(e=>{h.set("triggerElement",e)}),F=(0,tC.useMergedRefs)(t,D,U,Z),B=(0,nz.useTimeout)(),V=(0,nz.useTimeout)(),q=(0,nz.useTimeout)();eP.useEffect(()=>{if(_)return q.start(400,()=>{x.current.allowUnselectedMouseUp=!0,x.current.allowSelectedMouseUp=!0}),()=>{q.clear()};x.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},V.clear()},[_,x,V,q]);let W=(0,tN.mergeProps)(I,{id:M,role:"combobox","aria-expanded":_?"true":"false","aria-haspopup":"listbox","aria-controls":_?C?.id??(0,nO.getFloatingFocusElement)(E)?.id:void 0,"aria-labelledby":f??P,"aria-readonly":y||void 0,"aria-required":b||void 0,tabIndex:N?-1:0,ref:F,onFocus(e){c(!0),_&&k.current&&g(!1,(0,tx.createChangeEventDetails)(tv.REASONS.none,e.nativeEvent)),B.start(0,()=>{h.set("forceMount",!0)})},onBlur(e){(0,tM.contains)(E,e.relatedTarget)||(d(!0),c(!1),"onBlur"===u&&v.commit($))},onPointerMove(){w.current=!1},onKeyDown(){w.current=!0},onMouseDown(e){if(_)return;let t=(0,tk.ownerDocument)(e.currentTarget);function n(e){if(!D.current)return;let t=e.target;if((0,tM.contains)(D.current,t)||(0,tM.contains)(R.current,t)||t===D.current)return;let n=r$(D.current);e.clientX>=n.left-2&&e.clientX<=n.right+2&&e.clientY>=n.top-2&&e.clientY<=n.bottom+2||g(!1,(0,tx.createChangeEventDetails)(tv.REASONS.cancelOpen,e))}V.start(0,()=>{t.addEventListener("mouseup",n,{once:!0})})}},v.getValidationProps,l,L);W.role="combobox";let H={...m,open:_,disabled:N,value:$,readOnly:y,popupSide:O,placeholder:!z};return(0,ta.useRenderElement)("button",e,{ref:[t,D],state:H,stateAttributesMapping:rI,props:W})}),rC={value:()=>null},rA=eP.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:s,...o}=e,{store:l,valueRef:d}=nY(),c=(0,nA.useStore)(l,ru.value),u=(0,nA.useStore)(l,ru.items),m=(0,nA.useStore)(l,ru.itemToStringLabel),p=(0,nA.useStore)(l,ru.hasSelectedValue),f=(0,nA.useStore)(l,ru.hasNullItemLabel,!p&&null!=a&&null==i),h=null;if("function"==typeof i)h=i(c);else if(null!=i)h=i;else if(p||null==a||f)if(Array.isArray(c))h=c.reduce((e,t,n)=>(n>0&&e.push(", "),e.push((0,eT.jsx)(eP.Fragment,{children:rc(t,u,m)},n)),e),[]);else h=rc(c,u,m);else h=a;return(0,ta.useRenderElement)("span",e,{state:{value:c,placeholder:!p},ref:[t,d],props:[{children:h},o],stateAttributesMapping:rC})}),rT=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:s}=nY(),o=(0,nA.useStore)(s,ru.open);return(0,ta.useRenderElement)("span",e,{state:{open:o},ref:t,props:[{"aria-hidden":!0,children:"▼"},a],stateAttributesMapping:r_.triggerOpenStateMapping})});var rP=e.i(23840);let rz=eP.createContext(void 0),rO=eP.forwardRef(function(e,t){let{store:n}=nY(),r=(0,nA.useStore)(n,ru.mounted),i=(0,nA.useStore)(n,ru.forceMount);return r||i?(0,eT.jsx)(rz.Provider,{value:!0,children:(0,eT.jsx)(rP.FloatingPortal,{ref:t,...e})}):null}),rM={...r_.popupStateMapping,...tY.transitionStatusMapping},rR=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:s}=nY(),o=(0,nA.useStore)(s,ru.open),l=(0,nA.useStore)(s,ru.mounted),d=(0,nA.useStore)(s,ru.transitionStatus);return(0,ta.useRenderElement)("div",e,{state:{open:o,transitionStatus:d},ref:t,props:[{role:"presentation",hidden:!l,style:{userSelect:"none",WebkitUserSelect:"none"}},a],stateAttributesMapping:rM})});var rD=e.i(24281);let rL=eP.createContext(void 0);function rU(){let e=eP.useContext(rL);if(!e)throw Error((0,tm.default)(59));return e}let rZ=eP.forwardRef(function(e,t){let n,{cutout:r,...i}=e;if(r){let e=r.getBoundingClientRect();n=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,eT.jsx)("div",{ref:t,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:n}})});var rF=e.i(30550);function rB(e,t){e&&Object.assign(e.style,t)}let rV={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};var rq=e.i(57567),rW=e.i(85927);let rH={},rG={},rK="";class rJ{lockCount=0;restore=null;timeoutLock=nz.Timeout.create();timeoutUnlock=nz.Timeout.create();acquire(e){return this.lockCount+=1,1===this.lockCount&&null===this.restore&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{this.lockCount-=1,0===this.lockCount&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{0===this.lockCount&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){let t,n,r,i,a;if(0===this.lockCount||null!==this.restore)return;let s=(0,tk.ownerDocument)(e).documentElement,o=(0,rS.ownerWindow)(s).getComputedStyle(s).overflowY;if("hidden"===o||"clip"===o){this.restore=tU.NOOP;return}let l=rh.isIOS||!function(e){if("u"<typeof document)return!1;let t=(0,tk.ownerDocument)(e);return(0,rS.ownerWindow)(t).innerWidth-t.documentElement.clientWidth>0}(e);this.restore=l?(n=(t=(0,tk.ownerDocument)(e)).documentElement,r=t.body,a={overflowY:(i=(0,tw.isOverflowElement)(n)?n:r).style.overflowY,overflowX:i.style.overflowX},Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,a)}):function(e){let t=(0,tk.ownerDocument)(e),n=t.documentElement,r=t.body,i=(0,rS.ownerWindow)(n),a=0,s=0,o=!1,l=nP.AnimationFrame.create();if(rh.isWebKit&&(i.visualViewport?.scale??1)!==1)return()=>{};function d(){let t=i.getComputedStyle(n),l=i.getComputedStyle(r),d=(t.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=n.scrollTop,s=n.scrollLeft,rH={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},rK=n.style.scrollBehavior,rG={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let c=n.scrollHeight>n.clientHeight,u=n.scrollWidth>n.clientWidth,m="scroll"===t.overflowY||"scroll"===l.overflowY,p="scroll"===t.overflowX||"scroll"===l.overflowX,f=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(l.marginTop)+parseFloat(l.marginBottom),x=parseFloat(l.marginLeft)+parseFloat(l.marginRight),v=(0,tw.isOverflowElement)(n)?n:r;if(o=function(e){if(!("u">typeof CSS&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||"u"<typeof document)return!1;let t=(0,tk.ownerDocument)(e),n=t.documentElement,r=t.body,i=(0,tw.isOverflowElement)(n)?n:r,a=i.style.overflowY,s=n.style.scrollbarGutter;n.style.scrollbarGutter="stable",i.style.overflowY="scroll";let o=i.offsetWidth;i.style.overflowY="hidden";let l=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=s,o===l}(e)){n.style.scrollbarGutter=d,v.style.overflowY="hidden",v.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:d,overflowY:"hidden",overflowX:"hidden"}),(c||m)&&(n.style.overflowY="scroll"),(u||p)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:g||h?`calc(100dvh - ${g+h}px)`:"100dvh",width:x||f?`calc(100vw - ${x+f}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=a,r.scrollLeft=s,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function c(){Object.assign(n.style,rH),Object.assign(r.style,rG),o||(n.scrollTop=a,n.scrollLeft=s,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=rK)}d();let u=(0,rW.addEventListener)(i,"resize",function(){c(),l.request(d)});return()=>{l.cancel(),c(),"function"==typeof i.removeEventListener&&u()}}(e)}}let rY=new rJ;function rX(e=!0,t=null){(0,tr.useIsoLayoutEffect)(()=>{if(e)return rY.acquire(t)},[e,t])}function rQ(e,t,n,r){let[i,a]=eP.useState(!1);(0,tr.useIsoLayoutEffect)(()=>{if(!e||!t||null==n)return void a(!1);let r=(0,tk.ownerDocument)(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-20)},[e,t,n]),rX(e&&(!t||i),r)}let r0={position:"fixed"},r1=eP.forwardRef(function(e,t){let{anchor:n,positionMethod:r="absolute",className:i,render:a,side:s="bottom",align:o="center",sideOffset:l=0,alignOffset:d=0,collisionBoundary:c="clipping-ancestors",collisionPadding:u,arrowPadding:m=5,sticky:p=!1,disableAnchorTracking:f,alignItemWithTrigger:h=!0,collisionAvoidance:g=rF.DROPDOWN_COLLISION_AVOIDANCE,style:x,...v}=e,{store:y,listRef:b,labelsRef:k,alignItemWithTriggerActiveRef:j,selectedItemTextRef:w,valuesRef:N,initialValueRef:_,popupRef:S,setValue:$}=nY(),I=nX(),E=(0,nA.useStore)(y,ru.open),C=(0,nA.useStore)(y,ru.mounted),A=(0,nA.useStore)(y,ru.modal),T=(0,nA.useStore)(y,ru.value),P=(0,nA.useStore)(y,ru.openMethod),z=(0,nA.useStore)(y,ru.positionerElement),O=(0,nA.useStore)(y,ru.triggerElement),M=(0,nA.useStore)(y,ru.isItemEqualToValue),R=(0,nA.useStore)(y,ru.transitionStatus),D=eP.useRef(null),L=eP.useRef(null),[U,Z]=eP.useState(h),F=C&&U&&"touch"!==P;C||U===h||Z(h),(0,tr.useIsoLayoutEffect)(()=>{!C&&(ru.scrollUpArrowVisible(y.state)&&y.set("scrollUpArrowVisible",!1),ru.scrollDownArrowVisible(y.state)&&y.set("scrollDownArrowVisible",!1))},[y,C]),eP.useImperativeHandle(j,()=>F),rQ((F||A)&&E,"touch"===P,z,O);let B=(0,rD.useAnchorPositioning)({anchor:n,floatingRootContext:I,positionMethod:r,mounted:C,side:s,sideOffset:l,align:o,alignOffset:d,arrowPadding:m,collisionBoundary:c,collisionPadding:u,sticky:p,disableAnchorTracking:f??F,collisionAvoidance:g,keepMounted:!0}),V=F?"none":B.side,q=F?r0:B.positionerStyles,W={open:E,side:V,align:B.align,anchorHidden:B.anchorHidden};(0,tr.useIsoLayoutEffect)(()=>{y.set("popupSide",B.side)},[y,B.side]);let H=(0,ti.useStableCallback)(e=>{y.set("positionerElement",e)}),G=(0,rq.usePositioner)(e,W,{styles:q,transitionStatus:R,props:v,refs:[t,H],hidden:!C,inert:!E}),K=eP.useRef(0),J=(0,ti.useStableCallback)(e=>{if(0===e.size&&0===K.current||0===N.current.length)return;let t=K.current;if(K.current=e.size,e.size===t)return;let n=(0,tx.createChangeEventDetails)(tv.REASONS.none);if(0!==t&&!y.state.multiple&&null!==T&&-1===ra(N.current,T,M)){let e=_.current,t=null!=e&&-1!==ra(N.current,e,M)?e:null;$(t,n),null===t&&(y.set("selectedIndex",null),w.current=null)}if(0!==t&&y.state.multiple&&Array.isArray(T)){let e=T.filter(e=>-1!==ra(N.current,e,M));(e.length!==T.length||e.some(e=>!(T&&0!==T.length&&T.some(t=>void 0!==t&&ri(e,t,M)))))&&($(e,n),0===e.length&&(y.set("selectedIndex",null),w.current=null))}if(E&&F){y.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:""};rB(z,e),rB(S.current,e)}}),Y=eP.useMemo(()=>({...B,side:V,alignItemWithTriggerActive:F,setControlledAlignItemWithTrigger:Z,scrollUpArrowRef:D,scrollDownArrowRef:L}),[B,V,F,Z]);return(0,eT.jsx)(tl,{elementsRef:b,labelsRef:k,onMapChange:J,children:(0,eT.jsxs)(rL.Provider,{value:Y,children:[C&&A&&(0,eT.jsx)(rZ,{inert:(0,tJ.inertValue)(!E),cutout:O}),G]})})});var r2=e.i(41645),r4=e.i(55283),r5=e.i(96704),r6=e.i(45758),r3=e.i(47951),r9=e.i(2601);let r8={inert:new WeakMap,"aria-hidden":new WeakMap},r7="data-base-ui-inert",ie={inert:new WeakSet,"aria-hidden":new WeakSet},it=new WeakMap,ir=0,ii=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=function e(t){return t?(0,tw.isShadowRoot)(t)?t.host:e(t.parentNode):null}(t);return e.contains(n)?n:null}).filter(e=>null!=e),ia=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},is=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{"script"!==(0,tw.getNodeName)(e)&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function io(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0,markerIgnoreElements:a=[]}=t,s=(0,tk.ownerDocument)(e[0]).body;return function(e,t,n,r,{mark:i=!0,markerIgnoreElements:a=[]}){let s=r?"inert":n?"aria-hidden":null,o=null,l=null,d=ii(t,e),c=new Set(i?ii(t,a):[]),u=i?is(t,ia(d),new Set(d)).filter(e=>!c.has(e)):[],m=[],p=[];if(s){let e=r8[s],n=ie[s];l=n,o=e;let r=ii(t,Array.from(t.querySelectorAll("[aria-live]"))),i=d.concat(r);is(t,ia(i),new Set(i)).forEach(t=>{let r=t.getAttribute(s),i=null!==r&&"false"!==r,a=(e.get(t)||0)+1;e.set(t,a),m.push(t),1===a&&i&&n.add(t),i||t.setAttribute(s,"inert"===s?"":"true")})}return i&&u.forEach(e=>{let t=(it.get(e)||0)+1;it.set(e,t),p.push(e),1===t&&e.setAttribute(r7,"")}),ir+=1,()=>{o&&m.forEach(e=>{let t=(o.get(e)||0)-1;o.set(e,t),t||(!l?.has(e)&&s&&e.removeAttribute(s),l?.delete(e))}),i&&p.forEach(e=>{let t=(it.get(e)||0)-1;it.set(e,t),t||e.removeAttribute(r7)}),(ir-=1)||(r8.inert=new WeakMap,r8["aria-hidden"]=new WeakMap,ie.inert=new WeakSet,ie["aria-hidden"]=new WeakSet,it=new WeakMap)}}(e,s,n,r,{mark:i,markerIgnoreElements:a})}var il=e.i(51486);let id=[];function ic(){id=id.filter(e=>e.deref()?.isConnected)}function iu(){return ic(),id[id.length-1]?.deref()}function im(e,t){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;let n=(0,r6.focusable)(e).filter(e=>{let t=e.getAttribute("data-tabindex")||"";return(0,r6.isTabbable)(e)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")}),r=e.getAttribute("tabindex");t.current.includes("floating")||0===n.length?"0"!==r&&e.setAttribute("tabindex","0"):("-1"!==r||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function ip(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:s=!1,modal:o=!0,closeOnFocusOut:l=!0,openInteractionType:d="",nextFocusableElement:c,previousFocusableElement:u,beforeContentFocusGuardRef:m,externalTree:p,getInsideElements:f}=e,h="rootStore"in t?t.rootStore:t,g=h.useState("open"),x=h.useState("domReferenceElement"),v=h.useState("floatingElement"),{events:y,dataRef:b}=h.context,k=(0,ti.useStableCallback)(()=>b.current.floatingContext?.nodeId),j=(0,nO.isTypeableCombobox)(x)&&!1===i,w=eP.useRef(["content"]),N=(0,nC.useValueAsRef)(i),_=(0,nC.useValueAsRef)(a),S=(0,nC.useValueAsRef)(d),$=(0,nU.useFloatingTree)(p),I=(0,rP.usePortalContext)(),E=eP.useRef(!1),C=eP.useRef(!1),A=eP.useRef(!1),T=eP.useRef(null),P=eP.useRef(""),z=eP.useRef(""),O=eP.useRef(null),M=eP.useRef(null),R=(0,tC.useMergedRefs)(O,m,I?.beforeInsideRef),D=(0,tC.useMergedRefs)(M,I?.afterInsideRef),L=(0,nz.useTimeout)(),U=(0,nz.useTimeout)(),Z=(0,nP.useAnimationFrame)(),F=null!=I,B=(0,nO.getFloatingFocusElement)(v),V=(0,ti.useStableCallback)((e=B)=>e?(0,r6.tabbable)(e):[]),q=(0,ti.useStableCallback)(()=>f?.().filter(e=>null!=e)??[]);eP.useEffect(()=>{if(r||!o)return;let e=(0,tk.ownerDocument)(B);return(0,rW.addEventListener)(e,"keydown",function(e){"Tab"===e.key&&(0,tM.contains)(B,(0,tM.activeElement)((0,tk.ownerDocument)(B)))&&0===V().length&&!j&&(0,nM.stopEvent)(e)})},[r,B,o,j,V]),eP.useEffect(()=>{if(r||!g)return;let e=(0,tk.ownerDocument)(B);function t(){A.current=!1}return(0,r4.mergeCleanups)((0,rW.addEventListener)(e,"pointerdown",function(e){let t=(0,tM.getTarget)(e),n=q();A.current=!((0,tM.contains)(v,t)||(0,tM.contains)(x,t)||(0,tM.contains)(I?.portalNode,t)||n.some(e=>e===t||(0,tM.contains)(e,t))),z.current=e.pointerType||"keyboard",t?.closest(`[${rF.CLICK_TRIGGER_IDENTIFIER}]`)&&(C.current=!0)},!0),(0,rW.addEventListener)(e,"pointerup",t,!0),(0,rW.addEventListener)(e,"pointercancel",t,!0),(0,rW.addEventListener)(e,"keydown",function(){z.current="keyboard"},!0))},[r,v,x,B,g,I,q]),eP.useEffect(()=>{if(r||!l)return;let e=(0,tk.ownerDocument)(B);function t(t){let n=t.relatedTarget,r=t.currentTarget,i=(0,tM.getTarget)(t);queueMicrotask(()=>{let a=k(),l=h.context.triggerElements,d=q(),m=n?.hasAttribute((0,r9.createAttribute)("focus-guard"))&&[O.current,M.current,I?.beforeInsideRef.current,I?.afterInsideRef.current,I?.beforeOutsideRef.current,I?.afterOutsideRef.current,(0,il.resolveRef)(u),(0,il.resolveRef)(c)].includes(n),p=!((0,tM.contains)(x,n)||(0,tM.contains)(v,n)||(0,tM.contains)(n,v)||(0,tM.contains)(I?.portalNode,n)||d.some(e=>e===n||(0,tM.contains)(e,n))||null!=n&&l.hasElement(n)||l.hasMatchingElement(e=>(0,tM.contains)(e,n))||m||$&&((0,r3.getNodeChildren)($.nodesRef.current,a).find(e=>(0,tM.contains)(e.context?.elements.floating,n)||(0,tM.contains)(e.context?.elements.domReference,n))||(0,r3.getNodeAncestors)($.nodesRef.current,a).find(e=>[e.context?.elements.floating,(0,nO.getFloatingFocusElement)(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===x&&B&&im(B,w),s&&r!==x&&!(0,nd.isElementVisible)(i)&&(0,tM.activeElement)(e)===e.body){if((0,tw.isHTMLElement)(B)&&(B.focus(),"popup"===s))return void Z.request(()=>{B.focus()});let e=V(),t=T.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||B;(0,tw.isHTMLElement)(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(j||!o)&&n&&p&&!C.current&&(j||n!==iu())&&(E.current=!0,h.setOpen(!1,(0,tx.createChangeEventDetails)(tv.REASONS.focusOut,t)))})}let n=(0,tw.isHTMLElement)(x)?x:null;if(v||n)return(0,r4.mergeCleanups)(n&&(0,rW.addEventListener)(n,"focusout",t),n&&(0,rW.addEventListener)(n,"pointerdown",function(){C.current=!0,U.start(0,()=>{C.current=!1})}),v&&(0,rW.addEventListener)(v,"focusin",function(e){let t=(0,tM.getTarget)(e);(0,r6.isTabbable)(t)&&(T.current=t)}),v&&(0,rW.addEventListener)(v,"focusout",t),v&&I&&(0,rW.addEventListener)(v,"focusout",function(){A.current||(b.current.insideReactTree=!0,L.start(0,()=>{b.current.insideReactTree=!1}))},!0))},[r,x,v,B,o,$,I,h,l,s,V,j,k,w,b,L,U,Z,c,u,q]),eP.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(I?.portalNode?.querySelectorAll(`[${(0,r9.createAttribute)("portal")}]`)||[]),t=$?(0,r3.getNodeAncestors)($.nodesRef.current,k()):[],n=t.find(e=>(0,nO.isTypeableCombobox)(e.context?.elements.domReference||null))?.context?.elements.domReference,i=io([v,...e,O.current,M.current,I?.beforeOutsideRef.current,I?.afterOutsideRef.current,...q(),n,(0,il.resolveRef)(u),(0,il.resolveRef)(c),j?x:null].filter(e=>null!=e),{ariaHidden:o||j,mark:!1}),a=io([v,...e].filter(e=>null!=e));return()=>{a(),i()}},[g,r,x,v,o,I,j,$,k,c,u,q]),(0,tr.useIsoLayoutEffect)(()=>{if(!g||r||!(0,tw.isHTMLElement)(B))return;let e=(0,tk.ownerDocument)(B),t=(0,tM.activeElement)(e);queueMicrotask(()=>{let n,r=N.current,i="function"==typeof r?r(S.current||""):r;if(void 0===i||!1===i||(0,tM.contains)(B,t))return;let a=null,s=()=>(null==a&&(a=V(B)),a[0]||B);n=(n=!0===i||null===i?s():(0,il.resolveRef)(i))||s();let o=(0,tM.contains)(B,(0,tM.activeElement)(e));nB(n,{preventScroll:n===B,shouldFocus(){if(o)return!0;let t=(0,tM.activeElement)(e);return!(t!==n&&(0,tM.contains)(B,t))}})})},[r,g,B,V,N,S]),(0,tr.useIsoLayoutEffect)(()=>{var e;if(r||!B)return;let t=(0,tk.ownerDocument)(B);function n(e){var t,n;let r;if(e.open||(t=e.nativeEvent,n=z.current,r=(0,rS.ownerWindow)((0,tM.getTarget)(t)),P.current=t instanceof r.KeyboardEvent?"keyboard":t instanceof r.FocusEvent?n||"keyboard":"pointerType"in t?t.pointerType||"keyboard":"touches"in t?"touch":t instanceof r.MouseEvent?n||(0===t.detail?"keyboard":"mouse"):""),e.reason===tv.REASONS.triggerHover&&"mouseleave"===e.nativeEvent.type&&(E.current=!0),e.reason===tv.REASONS.outsidePress)if(e.nested)E.current=!1;else if((0,nM.isVirtualClick)(e.nativeEvent)||(0,nM.isVirtualPointerEvent)(e.nativeEvent))E.current=!1;else{let e=!1;(0,tk.ownerDocument)(B).createElement("div").focus({get preventScroll(){return e=!0,!1}}),e?E.current=!1:E.current=!0}}return e=(0,tM.activeElement)(t),ic(),e&&"body"!==(0,tw.getNodeName)(e)&&(id.push(new WeakRef(e)),id.length>20&&(id=id.slice(-20))),y.on("openchange",n),()=>{y.off("openchange",n);let e=(0,tM.activeElement)(t),r=q(),i=(0,tM.contains)(v,e)||r.some(t=>t===e||(0,tM.contains)(t,e))||$&&(0,r3.getNodeChildren)($.nodesRef.current,k(),!1).some(t=>(0,tM.contains)(t.context?.elements.floating,e)),a=_.current,s=function(){let e=_.current,t="function"==typeof e?e(P.current):e;if(void 0===t||!1===t)return null;if(null===t&&(t=!0),"boolean"==typeof t)return x?.isConnected?x:iu()||null;let n=x?.isConnected?x:iu();return(0,il.resolveRef)(t)||n||null}();queueMicrotask(()=>{let n=s?(0,r6.isTabbable)(s)?s:(0,r6.tabbable)(s)[0]||s:null;a&&!E.current&&(0,tw.isHTMLElement)(n)&&("boolean"!=typeof a||n===e||e===t.body||i)&&n.focus({preventScroll:!0}),E.current=!1})}},[r,v,B,_,y,$,x,k,q]),(0,tr.useIsoLayoutEffect)(()=>{if(!rh.isWebKit||g||!v)return;let e=(0,tM.activeElement)((0,tk.ownerDocument)(v));(0,tw.isHTMLElement)(e)&&(0,nO.isTypeableElement)(e)&&(0,tM.contains)(v,e)&&e.blur()},[g,v]),(0,tr.useIsoLayoutEffect)(()=>{if(!r&&I)return I.setFocusManagerState({modal:o,closeOnFocusOut:l,open:g,onOpenChange:h.setOpen,domReference:x}),()=>{I.setFocusManagerState(null)}},[r,I,o,g,h,l,x]),(0,tr.useIsoLayoutEffect)(()=>{if(!r&&B)return im(B,w),()=>{queueMicrotask(ic)}},[r,B,w]);let W=!r&&(!o||!j)&&(F||o);return(0,eT.jsxs)(eP.Fragment,{children:[W&&(0,eT.jsx)(r5.FocusGuard,{"data-type":"inside",ref:R,onFocus:e=>{if(o){let e=V();nB(e[e.length-1])}else if(I?.portalNode)if(E.current=!1,(0,r6.isOutsideEvent)(e,I.portalNode)){let e=(0,r6.getNextTabbable)(x);e?.focus()}else(0,il.resolveRef)(u??I.beforeOutsideRef)?.focus()}}),n,W&&(0,eT.jsx)(r5.FocusGuard,{"data-type":"inside",ref:D,onFocus:e=>{if(o)nB(V()[0]);else if(I?.portalNode)if(l&&(E.current=!0),(0,r6.isOutsideEvent)(e,I.portalNode)){let e=(0,r6.getPreviousTabbable)(x);e?.focus()}else(0,il.resolveRef)(c??I.afterOutsideRef)?.focus()}})]})}var ih=e.i(78928);let ig="base-ui-disable-scrollbar",ix=eP.createContext(void 0);function iv(e){let t=eP.useContext(ix);if(void 0===t&&!e)throw Error((0,tm.default)(69));return t}var iy=e.i(53750);let ib={...r_.popupStateMapping,...tY.transitionStatusMapping},ik=eP.forwardRef(function(e,t){let n,{render:r,className:i,style:a,finalFocus:s,...o}=e,{store:l,popupRef:d,onOpenChangeComplete:c,setOpen:u,valueRef:m,firstItemTextRef:p,selectedItemTextRef:f,keyboardActiveRef:h,multiple:g,handleScrollArrowVisibility:x,scrollHandlerRef:v,listRef:y,highlightItemOnHover:b}=nY(),{side:k,align:j,alignItemWithTriggerActive:w,isPositioned:N,setControlledAlignItemWithTrigger:_,scrollDownArrowRef:S,scrollUpArrowRef:$}=rU(),I=null!=iv(!0),E=nX(),C=(0,nu.useDirection)(),{nonce:A,disableStyleElements:T}=tH(),P=(0,nA.useStore)(l,ru.id),z=(0,nA.useStore)(l,ru.open),O=(0,nA.useStore)(l,ru.mounted),M=(0,nA.useStore)(l,ru.popupProps),R=(0,nA.useStore)(l,ru.transitionStatus),D=(0,nA.useStore)(l,ru.triggerElement),L=(0,nA.useStore)(l,ru.positionerElement),U=(0,nA.useStore)(l,ru.listElement),Z=eP.useRef(!1),F=eP.useRef(!1),B=eP.useRef({}),V=(0,nP.useAnimationFrame)(),q=(0,ti.useStableCallback)(e=>{var t;if(!L||!d.current||!F.current)return;if(Z.current||!w)return void x();let n="0px"===L.style.top,r="0px"===L.style.bottom;if(!n&&!r)return void x();let i=iN(L),a=(t=L.getBoundingClientRect().height,t/i.y),s=(0,tk.ownerDocument)(L),o=getComputedStyle(L),l=parseFloat(o.marginTop),c=parseFloat(o.marginBottom),u=ij(getComputedStyle(d.current)),m=Math.min(s.documentElement.clientHeight-l-c,u),p=e.scrollTop,f=iw(e),h=0,g=null,v=!1,y=!1,b=e=>{L.style.height=`${e}px`},k=n?f-p:p,j=Math.min(a+k,m);if(h=j,k<=1){let t;return void((t=rv(k,0,m-a))>0&&b(a+t),e.scrollTop=n?f:0,m-(a+t)<=1&&(Z.current=!0),x())}if(m-j>1)n?y=!0:g=0;else if(v=!0,r&&p<f){let e=a+k-m;g=p-(k-e)}if(0!==(h=Math.ceil(h))&&b(h),y||null!=g){let t=iw(e),n=y?t:rv(g,0,t);Math.abs(e.scrollTop-n)>1&&(e.scrollTop=n)}(v||h>=m-1)&&(Z.current=!0),x()});eP.useImperativeHandle(v,()=>q,[q]),(0,tX.useOpenChangeComplete)({open:z,ref:d,onComplete(){z&&c?.(!0)}}),(0,tr.useIsoLayoutEffect)(()=>{L&&d.current&&!Object.keys(B.current).length&&(B.current={top:L.style.top||"0",left:L.style.left||"0",right:L.style.right,height:L.style.height,bottom:L.style.bottom,minHeight:L.style.minHeight,maxHeight:L.style.maxHeight,marginTop:L.style.marginTop,marginBottom:L.style.marginBottom})},[d,L]),(0,tr.useIsoLayoutEffect)(()=>{z||w||(F.current=!1,Z.current=!1,rB(L,B.current))},[z,w,L,d]),(0,tr.useIsoLayoutEffect)(()=>{let e=d.current;if(!z||!D||!L||!e||w&&!N||"ending"===l.state.transitionStatus)return;if(!w){F.current=!0,V.request(x),e.style.removeProperty("--transform-origin");return}let t=function(e){let{style:t}=e,n={};for(let[e,r]of iS)n[e]=t.getPropertyValue(e),t.setProperty(e,r,"important");return()=>{for(let[e]of iS){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}(e);e.style.removeProperty("--transform-origin");try{let t,n=f.current;n?.isConnected||(n=!ru.hasSelectedValue(l.state)&&p.current?.isConnected?p.current:null);let r=m.current,i=getComputedStyle(L),a=getComputedStyle(e),s=(0,tk.ownerDocument)(D),o=(0,rS.ownerWindow)(L),d=iN(D),c=i_(D.getBoundingClientRect(),d),u=i_(L.getBoundingClientRect(),d),h=c.height,g=U||e,v=g.scrollHeight,k=parseFloat(a.borderBottomWidth),j=parseFloat(i.marginTop)||10,w=parseFloat(i.marginBottom)||10,N=parseFloat(i.minHeight)||100,S=ij(a),$=s.documentElement.clientHeight-j-w,I=s.documentElement.clientWidth,E=$-c.bottom+h,A="rtl"===C?c.right-u.width:c.left,T=0;if(n&&r){let e=i_(r.getBoundingClientRect(),d);t=i_(n.getBoundingClientRect(),d),A=u.left+("rtl"===C?e.right-t.right:e.left-t.left);let i=e.top-c.top+e.height/2;T=t.top-u.top+t.height/2-i}let P=E+T+w+k,z=Math.min($,P),O=$-j-w,M=P-z;L.style.left=`${rv(A,5,I-5-u.width)}px`,L.style.height=`${z}px`,L.style.maxHeight="auto",L.style.marginTop=`${j}px`,L.style.marginBottom=`${w}px`,e.style.height="100%";let R=iw(g),V=M>=R-1;V&&(z=Math.min($,u.height)-(M-R));let q=c.top<20||c.bottom>$-20||Math.ceil(z)+1<Math.min(v,N),W=(o.visualViewport?.scale??1)!==1&&rh.isWebKit;if(q||W){F.current=!0,rB(L,B.current),_(!1);return}let H=Math.max(N,z);if(V){let e=Math.max(0,$-P);L.style.top=u.height>=O?"0":`${e}px`,L.style.height=`${z}px`,g.scrollTop=iw(g)}else L.style.bottom="0",g.scrollTop=M;if(t){let n=u.top,r=u.height,i=t.top+t.height/2,a=rv(r>0?(i-n)/r*100:50,0,100);e.style.setProperty("--transform-origin",`50% ${a}%`)}(H===$||z>=S)&&(Z.current=!0),x(),b&&null===l.state.selectedIndex&&null===l.state.activeIndex&&null!=y.current[0]&&l.set("activeIndex",0),F.current=!0}finally{t()}},[l,z,L,D,m,p,f,d,x,w,_,V,S,$,U,y,b,C,N]),eP.useEffect(()=>{if(!w||!L||!z)return;let e=(0,rS.ownerWindow)(L);return(0,rW.addEventListener)(e,"resize",function(e){u(!1,(0,tx.createChangeEventDetails)(tv.REASONS.windowResize,e))})},[u,w,L,z]);let W={...U?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":g||void 0,id:`${P}-list`},onKeyDown(e){h.current=!0,I&&nr.has(e.key)&&e.stopPropagation()},onMouseMove(){h.current=!1},onScroll(e){U||q(e.currentTarget)},...w&&{style:U?{height:"100%"}:rV}},H=(0,ta.useRenderElement)("div",e,{ref:[t,d],state:{open:z,transitionStatus:R,side:k,align:j},stateAttributesMapping:ib,props:[M,W,(0,iy.getDisabledMountTransitionStyles)(R),{className:!U&&w?ig:void 0},o]});return(0,eT.jsxs)(eP.Fragment,{children:[!T&&(n=A,(0,eT.jsx)("style",{nonce:n,href:ig,precedence:"base-ui:low",children:`.${ig}{scrollbar-width:none}.${ig}::-webkit-scrollbar{display:none}`})),(0,eT.jsx)(ip,{context:E,modal:!1,disabled:!O,returnFocus:s,restoreFocus:!0,children:H})]})});function ij(e){let t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function iw(e){return ry(e.scrollHeight,e.clientHeight)}function iN(e){return ih.platform.getScale(e)}function i_(e,t){return(0,r2.rectToClientRect)({x:e.x/t.x,y:e.y/t.y,width:e.width/t.x,height:e.height/t.y})}let iS=[["transform","none"],["scale","1"],["translate","0 0"]],i$=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:s,scrollHandlerRef:o}=nY(),{alignItemWithTriggerActive:l}=rU(),d=(0,nA.useStore)(s,ru.hasScrollArrows),c=(0,nA.useStore)(s,ru.openMethod),u=(0,nA.useStore)(s,ru.multiple),m=(0,nA.useStore)(s,ru.id),p={id:`${m}-list`,role:"listbox","aria-multiselectable":u||void 0,onScroll(e){o.current?.(e.currentTarget)},...l&&{style:rV},className:d&&"touch"!==c?ig:void 0},f=(0,ti.useStableCallback)(e=>{s.set("listElement",e)});return(0,ta.useRenderElement)("div",e,{ref:[t,f],props:[p,a]})}),iI=eP.createContext(void 0);function iE(){let e=eP.useContext(iI);if(!e)throw Error((0,tm.default)(57));return e}let iC=eP.memo(eP.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:s,disabled:o=!1,nativeButton:l=!1,...d}=e,c=eP.useRef(null),u=tT({label:s,textRef:c,indexGuessBehavior:tA.GuessFromOrder}),{store:m,itemProps:p,setOpen:f,setValue:h,selectionRef:g,typingRef:x,valuesRef:v,multiple:y,selectedItemTextRef:b}=nY(),k=(0,nA.useStore)(m,ru.isActive,u.index),j=(0,nA.useStore)(m,ru.isSelected,u.index,a),w=(0,nA.useStore)(m,ru.isSelectedByFocus,u.index),N=(0,nA.useStore)(m,ru.isItemEqualToValue),_=u.index,S=-1!==_,$=eP.useRef(null);(0,tr.useIsoLayoutEffect)(()=>{if(!S)return;let e=v.current;return e[_]=a,()=>{delete e[_]}},[S,_,a,v]),(0,tr.useIsoLayoutEffect)(()=>{if(!S)return;let e=m.state.value,t=e;y&&Array.isArray(e)&&e.length>0&&(t=e[e.length-1]),void 0!==t&&ri(a,t,N)&&(m.set("selectedIndex",_),c.current&&(b.current=c.current))},[S,_,y,N,m,a,b]);let I=eP.useRef(null),E=eP.useRef("mouse"),C=eP.useRef(!1),{getButtonProps:A,buttonRef:T}=t$({disabled:o,focusableWhenDisabled:!0,native:l,composite:!0});function P(){g.current.dragY=0}let z=(0,ta.useRenderElement)("div",e,{ref:[T,t,u.ref,$],state:{disabled:o,selected:j,highlighted:k},props:[p,{role:"option","aria-selected":j,tabIndex:k?0:-1,onKeyDown(e){I.current=e.key,m.set("activeIndex",_)," "===e.key&&x.current&&e.preventDefault()},onClick(e){let t="click"===e.type&&"touch"!==E.current,n=e.nativeEvent.pointerType,r=t&&(0,nM.isVirtualClick)(e.nativeEvent)&&(void 0!==n||k),i=t&&!r&&!C.current;C.current=!1,"keydown"===e.type&&null===I.current||o||"keydown"===e.type&&" "===I.current&&x.current||i||(I.current=null,function(e){let t=m.state.value;if(y){let n=Array.isArray(t)?t:[];h(j?n.filter(e=>!ri(a,e,N)):[...n,a],(0,tx.createChangeEventDetails)(tv.REASONS.itemPress,e))}else h(a,(0,tx.createChangeEventDetails)(tv.REASONS.itemPress,e)),f(!1,(0,tx.createChangeEventDetails)(tv.REASONS.itemPress,e))}(e.nativeEvent))},onPointerEnter(e){E.current=e.pointerType},onPointerMove(e){if("mouse"===e.pointerType&&1===e.buttons){let t=g.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){E.current=e.pointerType,C.current=!0,P()},onMouseUp(){if(P(),o||"touch"===E.current||C.current)return;let e=!g.current.allowSelectedMouseUp&&j,t=!g.current.allowUnselectedMouseUp&&!j;e||t||(C.current=!0,$.current?.click(),C.current=!1)}},d,A]}),O=eP.useMemo(()=>({selected:j,index:_,textRef:c,selectedByFocus:w,hasRegistered:S}),[j,_,c,w,S]);return(0,eT.jsx)(iI.Provider,{value:O,children:z})})),iA=eP.forwardRef(function(e,t){let n=e.keepMounted??!1,{selected:r}=iE();return n||r?(0,eT.jsx)(iT,{...e,ref:t}):null}),iT=eP.memo(eP.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...s}=e,{selected:o}=iE(),l=eP.useRef(null),{transitionStatus:d,setMounted:c}=(0,tQ.useTransitionStatus)(o),u=(0,ta.useRenderElement)("span",e,{ref:[t,l],state:{selected:o,transitionStatus:d},props:[{"aria-hidden":!0,children:"✔️"},s],stateAttributesMapping:tY.transitionStatusMapping});return(0,tX.useOpenChangeComplete)({open:o,ref:l,onComplete(){o||c(!1)}}),u})),iP=eP.memo(eP.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i,hasRegistered:a}=iE(),{firstItemTextRef:s,selectedItemTextRef:o}=nY(),{render:l,className:d,style:c,...u}=e,m=eP.useCallback(e=>{e&&(a&&0===n&&(s.current=e),a&&i&&(o.current=e))},[s,o,n,i,a]);return(0,ta.useRenderElement)("div",e,{ref:[m,t,r],props:u})})),iz={...r_.popupStateMapping,...tY.transitionStatusMapping},iO=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:s}=nY(),{side:o,align:l,arrowRef:d,arrowStyles:c,arrowUncentered:u,alignItemWithTriggerActive:m}=rU(),p=(0,nA.useStore)(s,ru.open,!0),f=(0,ta.useRenderElement)("div",e,{state:{open:p,side:o,align:l,uncentered:u},ref:[d,t],props:[{style:c,"aria-hidden":!0},a],stateAttributesMapping:iz});return m?null:f}),iM=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:s=!1,...o}=e,l="up"===a,{store:d,popupRef:c,listRef:u,handleScrollArrowVisibility:m,scrollArrowsMountedCountRef:p}=nY(),{side:f,scrollDownArrowRef:h,scrollUpArrowRef:g}=rU(),x=l?ru.scrollUpArrowVisible:ru.scrollDownArrowVisible,v=(0,nA.useStore)(d,x),y=(0,nA.useStore)(d,ru.openMethod),b=v&&"touch"!==y,k=(0,nz.useTimeout)(),j=l?g:h,{transitionStatus:w,setMounted:N}=(0,tQ.useTransitionStatus)(b);(0,tr.useIsoLayoutEffect)(()=>(p.current+=1,d.state.hasScrollArrows||d.set("hasScrollArrows",!0),()=>{p.current=Math.max(0,p.current-1),0===p.current&&d.state.hasScrollArrows&&d.set("hasScrollArrows",!1)}),[d,p]),(0,tX.useOpenChangeComplete)({open:b,ref:j,onComplete(){b||N(!1)}});let _=(0,ta.useRenderElement)("div",e,{ref:[t,j],state:{direction:a,visible:b,side:f,transitionStatus:w},props:[{"aria-hidden":!0,children:l?"▲":"▼",style:{position:"absolute"},onMouseMove(e){0===e.movementX&&0===e.movementY||k.isStarted()||(d.set("activeIndex",null),k.start(40,function e(){let t=d.state.listElement??c.current;if(!t)return;d.set("activeIndex",null),m();let n=ry(t.scrollHeight,t.clientHeight),r=rb(t.scrollTop,n),i=r===(l?0:n),a=u.current;if(r!==t.scrollTop&&(t.scrollTop=r),0===a.length&&d.set(l?"scrollUpArrowVisible":"scrollDownArrowVisible",!i),i)return void k.clear();if(a.length>0){let e=j.current?.offsetHeight||0;t.scrollTop=function(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let s=Math.max(0,t-1),o=e[s];return s<t&&o?rb(o.offsetTop-i,a):0}let s=e.length-1,o=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>o){s=Math.max(0,t-1);break}}let l=Math.min(e.length-1,s+1),d=e[l];return l>s&&d?rb(d.offsetTop+d.offsetHeight-r+i,a):a}(a,l,r,t.clientHeight,e,n)}k.start(40,e)}))},onMouseLeave(){k.clear()}},o]});return b||s?_:null}),iR=eP.forwardRef(function(e,t){return(0,eT.jsx)(iM,{...e,ref:t,direction:"down"})}),iD=eP.forwardRef(function(e,t){return(0,eT.jsx)(iM,{...e,ref:t,direction:"up"})}),iL=eP.createContext(void 0),iU=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[s,o]=eP.useState(),l=eP.useMemo(()=>({labelId:s,setLabelId:o}),[s,o]),d=(0,ta.useRenderElement)("div",e,{ref:t,props:[{role:"group","aria-labelledby":s},a]});return(0,eT.jsx)(iL.Provider,{value:l,children:d})}),iZ=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...s}=e,{setLabelId:o}=function(){let e=eP.useContext(iL);if(void 0===e)throw Error((0,tm.default)(56));return e}(),l=(0,tj.useBaseUiId)(a);return(0,tr.useIsoLayoutEffect)(()=>{o(l)},[l,o]),(0,ta.useRenderElement)("div",e,{ref:t,props:[{id:l},s]})}),iF=eP.forwardRef(function(e,t){let{className:n,render:r,orientation:i="horizontal",style:a,...s}=e;return(0,ta.useRenderElement)("div",e,{state:{orientation:i},ref:t,props:[{role:"separator","aria-orientation":i},s]})});e.s(["Arrow",0,iO,"Backdrop",0,rR,"Group",0,iU,"GroupLabel",0,iZ,"Icon",0,rT,"Item",0,iC,"ItemIndicator",0,iA,"ItemText",0,iP,"Label",0,rN,"List",0,i$,"Popup",0,ik,"Portal",0,rO,"Positioner",0,r1,"Root",0,function(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:s=!1,onOpenChange:o,name:l,form:d,autoComplete:c,disabled:u=!1,readOnly:m=!1,required:p=!1,modal:f=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:x,items:v,multiple:y=!1,itemToStringLabel:b,itemToStringValue:k,isItemEqualToValue:j=rr,highlightItemOnHover:w=!0,children:N}=e,{clearErrors:_}=rp(),{setDirty:S,setTouched:$,setFocused:I,shouldValidateOnChange:E,validityData:C,setFilled:A,name:T,disabled:P,validation:z,validationMode:O}=n9(),M=rt({id:t}),R=P||u,D=T??l,[L,U]=tn({controlled:n,default:y?r??tU.EMPTY_ARRAY:r,name:"Select",state:"value"}),[Z,F]=tn({controlled:a,default:s,name:"Select",state:"open"}),B=eP.useRef([]),V=eP.useRef([]),q=eP.useRef(null),W=eP.useRef(null),H=eP.useRef(0),G=eP.useRef(null),K=eP.useRef([]),J=eP.useRef(!1),Y=eP.useRef(!1),X=eP.useRef(null),Q=eP.useRef(null),ee=eP.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),et=eP.useRef(!1),{mounted:en,setMounted:er,transitionStatus:ei}=(0,tQ.useTransitionStatus)(Z),{openMethod:ea,triggerProps:es}=rx(Z),eo=(0,ts.useRefWithInit)(()=>new nT.Store({id:M,labelId:void 0,modal:f,multiple:y,itemToStringLabel:b,itemToStringValue:k,isItemEqualToValue:j,value:L,open:Z,mounted:en,transitionStatus:ei,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,el=(0,nA.useStore)(eo,ru.activeIndex),ed=(0,nA.useStore)(eo,ru.selectedIndex),ec=(0,nA.useStore)(eo,ru.triggerElement),eu=(0,nA.useStore)(eo,ru.positionerElement),em=(0,nE.usePreviousValue)(ea),ep=ea??em,ef=eP.useMemo(()=>y&&Array.isArray(L)&&0===L.length?"":rd(L,k),[y,L,k]),eh=eP.useMemo(()=>y&&Array.isArray(L)?L.map(e=>rd(e,k)):rd(L,k),[y,L,k]);n8((0,nC.useValueAsRef)(eo.state.triggerElement),M,L,(0,ti.useStableCallback)(()=>eh));let eg=eP.useRef(L),ex=y?Array.isArray(L)&&L.length>0:null!=L;(0,tr.useIsoLayoutEffect)(()=>{L!==eg.current&&eo.set("forceMount",!0)},[eo,L]),(0,tr.useIsoLayoutEffect)(()=>{A(ex)},[ex,A]),(0,tr.useIsoLayoutEffect)(function(){let e,t=K.current;if(y){let n=Array.isArray(L)?L:[];if(0===n.length)e=null;else{let r=ra(t,n[n.length-1],j);e=-1===r?null:r}}else{let n=ra(t,L,j);e=-1===n?null:n}null===e&&(Q.current=null),Z||eo.set("selectedIndex",e)},[ex,y,Z,L,K,j,eo,Q]),rf(L,()=>{_(D),S(L!==C.initialValue),E()?z.commit(L):z.commit(L,!0)});let ev=(0,ti.useStableCallback)((e,t)=>{if(o?.(e,t),!t.isCanceled&&(F(e),e||t.reason!==tv.REASONS.focusOut&&t.reason!==tv.REASONS.outsidePress||($(!0),I(!1),"onBlur"===O&&z.commit(L)),!e&&null!==eo.state.activeIndex)){let e=B.current[eo.state.activeIndex];queueMicrotask(()=>{e?.setAttribute("tabindex","-1")})}}),ey=(0,ti.useStableCallback)(()=>{er(!1),eo.update({activeIndex:null,openMethod:null}),x?.(!1)});(0,tX.useOpenChangeComplete)({enabled:!h,open:Z,ref:q,onComplete(){Z||ey()}}),eP.useImperativeHandle(h,()=>({unmount:ey}),[ey]);let eb=(0,ti.useStableCallback)((e,t)=>{i?.(e,t),t.isCanceled||U(e)}),ek=(0,ti.useStableCallback)(()=>{let e=eo.state.listElement||q.current;if(!e)return;let t=ry(e.scrollHeight,e.clientHeight),n=rb(e.scrollTop,t),r=n>0,i=n<t;eo.state.scrollUpArrowVisible!==r&&eo.set("scrollUpArrowVisible",r),eo.state.scrollDownArrowVisible!==i&&eo.set("scrollDownArrowVisible",i)}),ej=(0,nL.useFloatingRootContext)({open:Z,onOpenChange:ev,elements:{reference:ec,floating:eu}}),ew=nR(ej,{enabled:!m&&!R,event:"mousedown"}),eN=(0,nD.useDismiss)(ej),e_=nH(ej,{enabled:!m&&!R,listRef:B,activeIndex:el,selectedIndex:ed,disabledIndices:tU.EMPTY_ARRAY,onNavigate(e){(null!==e||Z)&&eo.set("activeIndex",e)},focusItemOnHover:w}),eS=nG(ej,{enabled:!m&&!R&&(Z||!y),listRef:V,activeIndex:el,selectedIndex:ed,onMatch(e){Z?eo.set("activeIndex",e):eb(K.current[e],(0,tx.createChangeEventDetails)("none"))},onTyping(e){J.current=e}}),e$=eP.useMemo(()=>{let e=(0,tN.mergeProps)(eS.reference,e_.reference,eN.reference,ew.reference,es);return M&&(e.id=M),e},[ew.reference,eS.reference,e_.reference,eN.reference,es,M]),eI=eP.useMemo(()=>(0,tN.mergeProps)(rk.FOCUSABLE_POPUP_PROPS,eS.floating,e_.floating,eN.floating),[eS.floating,e_.floating,eN.floating]),eE=e_.item??tU.EMPTY_OBJECT;(0,nI.useOnFirstRender)(()=>{eo.update({popupProps:eI,triggerProps:e$})}),(0,tr.useIsoLayoutEffect)(()=>{eo.update({id:M,modal:f,multiple:y,value:L,open:Z,mounted:en,transitionStatus:ei,popupProps:eI,triggerProps:e$,items:v,itemToStringLabel:b,itemToStringValue:k,isItemEqualToValue:j,openMethod:ep})},[eo,M,f,y,L,Z,en,ei,eI,e$,v,b,k,j,ep]);let eC=eP.useMemo(()=>({store:eo,name:D,required:p,disabled:R,readOnly:m,multiple:y,highlightItemOnHover:w,setValue:eb,setOpen:ev,listRef:B,popupRef:q,scrollHandlerRef:W,handleScrollArrowVisibility:ek,scrollArrowsMountedCountRef:H,itemProps:eE,events:ej.context.events,valueRef:G,valuesRef:K,labelsRef:V,typingRef:J,selectionRef:ee,firstItemTextRef:X,selectedItemTextRef:Q,validation:z,onOpenChangeComplete:x,keyboardActiveRef:Y,alignItemWithTriggerActiveRef:et,initialValueRef:eg}),[eo,D,p,R,m,y,w,eb,ev,eE,ej.context.events,z,x,ek]),eA=(0,tC.useMergedRefs)(g,z.inputRef),ez=y&&Array.isArray(L)&&L.length>0,eO=y?void 0:D,eM=eP.useMemo(()=>y&&Array.isArray(L)&&D?L.map(e=>{let t=rd(e,k);return(0,eT.jsx)("input",{type:"hidden",form:d,name:D,value:t},t)}):null,[y,L,d,D,k]);return(0,eT.jsx)(nK.Provider,{value:eC,children:(0,eT.jsxs)(nJ.Provider,{value:ej,children:[N,(0,eT.jsx)("input",{...z.getInputValidationProps({onFocus(){eo.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||R||m)return void e.preventBaseUIHandler?.();let t=e.currentTarget.value,n=(0,tx.createChangeEventDetails)(tv.REASONS.none,e.nativeEvent);eo.set("forceMount",!0),queueMicrotask(function(){if(y)return;let e=K.current.find(e=>rd(e,k).toLowerCase()===t.toLowerCase()||rl(e,b).toLowerCase()===t.toLowerCase());null!=e&&(S(e!==C.initialValue),eb(e,n),E()&&z.commit(e))})}}),id:M&&null==eO?`${M}-hidden-input`:void 0,form:d,name:eO,autoComplete:c,value:ef,disabled:R,required:p&&!ez,readOnly:m,ref:eA,style:D?n$.visuallyHiddenInput:n$.visuallyHidden,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),eM]})})},"ScrollDownArrow",0,iR,"ScrollUpArrow",0,iD,"Separator",0,iF,"Trigger",0,rE,"Value",0,rA],25225);var iB=e.i(25225),iB=iB;let iV=eL("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),iq=eL("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),iW=eL("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),iH=iB.Root;function iG({className:e,...t}){return(0,eT.jsx)(iB.Group,{"data-slot":"select-group",className:(0,ny.cn)("scroll-my-1 p-1",e),...t})}function iK({className:e,...t}){return(0,eT.jsx)(iB.Value,{"data-slot":"select-value",className:(0,ny.cn)("flex flex-1 text-left",e),...t})}function iJ({className:e,size:t="default",children:n,...r}){return(0,eT.jsxs)(iB.Trigger,{"data-slot":"select-trigger","data-size":t,className:(0,ny.cn)("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,(0,eT.jsx)(iB.Icon,{render:(0,eT.jsx)(iV,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function iY({className:e,children:t,side:n="bottom",sideOffset:r=4,align:i="center",alignOffset:a=0,alignItemWithTrigger:s=!0,...o}){return(0,eT.jsx)(iB.Portal,{children:(0,eT.jsx)(iB.Positioner,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:s,className:"isolate z-50",children:(0,eT.jsxs)(iB.Popup,{"data-slot":"select-content","data-align-trigger":s,className:(0,ny.cn)("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...o,children:[(0,eT.jsx)(i0,{}),(0,eT.jsx)(iB.List,{children:t}),(0,eT.jsx)(i1,{})]})})})}function iX({className:e,...t}){return(0,eT.jsx)(iB.GroupLabel,{"data-slot":"select-label",className:(0,ny.cn)("px-1.5 py-1 text-xs text-muted-foreground",e),...t})}function iQ({className:e,children:t,...n}){return(0,eT.jsxs)(iB.Item,{"data-slot":"select-item",className:(0,ny.cn)("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[(0,eT.jsx)(iB.ItemText,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:t}),(0,eT.jsx)(iB.ItemIndicator,{render:(0,eT.jsx)("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:(0,eT.jsx)(iq,{className:"pointer-events-none"})})]})}function i0({className:e,...t}){return(0,eT.jsx)(iB.ScrollUpArrow,{"data-slot":"select-scroll-up-button",className:(0,ny.cn)("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:(0,eT.jsx)(iW,{})})}function i1({className:e,...t}){return(0,eT.jsx)(iB.ScrollDownArrow,{"data-slot":"select-scroll-down-button",className:(0,ny.cn)("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:(0,eT.jsx)(iV,{})})}let i2=eL("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]),i4=eL("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]),i5=eL("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);e.s([],66254),e.i(66254);let i6=eP.createContext(void 0);function i3(e){let t=eP.useContext(i6);if(void 0===t&&!e)throw Error((0,tm.default)(33));return t}let i9=eP.createContext(void 0);function i8(e){let t=eP.useContext(i9);if(void 0===t&&!e)throw Error((0,tm.default)(36));return t}let i7=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:s}=i8(),{arrowRef:o,side:l,align:d,arrowUncentered:c,arrowStyles:u}=i3(),m=s.useState("open");return(0,ta.useRenderElement)("div",e,{ref:[o,t],stateAttributesMapping:r_.popupStateMapping,state:{open:m,side:l,align:d,uncentered:c},props:{style:u,"aria-hidden":!0,...a}})}),ae=eP.createContext(void 0);function at(e=!0){let t=eP.useContext(ae);if(void 0===t&&!e)throw Error((0,tm.default)(25));return t}let an={...r_.popupStateMapping,...tY.transitionStatusMapping},ar=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:s}=i8(),o=s.useState("open"),l=s.useState("mounted"),d=s.useState("transitionStatus"),c=s.useState("lastOpenChangeReason"),u=at();return(0,ta.useRenderElement)("div",e,{ref:u?.backdropRef?[t,u.backdropRef]:t,state:{open:o,transitionStatus:d},stateAttributesMapping:an,props:[{role:"presentation",hidden:!l,style:{pointerEvents:c===tv.REASONS.triggerHover?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},a]})}),ai=eP.createContext(void 0);function aa(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:s,itemRef:o,itemMetadata:l}=e,{events:d}=a.useState("floatingTreeRoot"),c=at(!0),u=void 0!==c;return eP.useMemo(()=>({id:r,role:"menuitem",tabIndex:n?0:-1,onKeyDown(e){" "===e.key&&s?.current&&e.preventDefault()},onMouseMove(e){i&&d.emit("itemhover",{nodeId:i,target:e.currentTarget})},onClick(e){t&&d.emit("close",{domEvent:e,reason:tv.REASONS.itemPress})},onMouseUp(e){if(c){let t=c.initialCursorPointRef.current;if(c.initialCursorPointRef.current=null,u&&t&&1>=Math.abs(e.clientX-t.x)&&1>=Math.abs(e.clientY-t.y)||u&&!rh.isMac&&2===e.button)return}o.current&&a.context.allowMouseUpTriggerRef.current&&(!u||2===e.button)&&(!l||"regular-item"===l.type)&&o.current.click()}}),[t,n,r,d,i,a,s,o,c,u,l])}let as={type:"regular-item"};function ao(e){let{closeOnClick:t,disabled:n=!1,highlighted:r,id:i,store:a,typingRef:s=a.context.typingRef,nativeButton:o,itemMetadata:l,nodeId:d}=e,c=eP.useRef(null),{getButtonProps:u,buttonRef:m}=t$({disabled:n,focusableWhenDisabled:!0,native:o,composite:!0}),p=aa({closeOnClick:t,highlighted:r,id:i,nodeId:d,store:a,typingRef:s,itemRef:c,itemMetadata:l}),f=eP.useCallback(e=>(0,tN.mergeProps)(p,{onMouseEnter(){"submenu-trigger"===l.type&&l.setActive()}},e,u),[p,u,l]),h=(0,tC.useMergedRefs)(c,m);return eP.useMemo(()=>({getItemProps:f,itemRef:h}),[f,h])}let al=((d={}).checked="data-checked",d.unchecked="data-unchecked",d.disabled="data-disabled",d.highlighted="data-highlighted",d),ad={checked:e=>e?{[al.checked]:""}:{[al.unchecked]:""},...tY.transitionStatusMapping},ac=eP.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:s=!1,disabled:o=!1,closeOnClick:l=!1,checked:d,defaultChecked:c,onCheckedChange:u,style:m,...p}=e,f=tT({label:a}),h=i3(!0),g=(0,tj.useBaseUiId)(i),{store:x}=i8(),v=x.useState("isActive",f.index),y=x.useState("itemProps"),[b,k]=tn({controlled:d,default:c??!1,name:"MenuCheckboxItem",state:"checked"}),{getItemProps:j,itemRef:w}=ao({closeOnClick:l,disabled:o,highlighted:v,id:g,store:x,nativeButton:s,nodeId:h?.context.nodeId,itemMetadata:as}),N=eP.useMemo(()=>({disabled:o,highlighted:v,checked:b}),[o,v,b]),_=(0,ta.useRenderElement)("div",e,{state:N,stateAttributesMapping:ad,props:[y,{role:"menuitemcheckbox","aria-checked":b,onClick:function(e){let t=(0,tx.createChangeEventDetails)(tv.REASONS.itemPress,e.nativeEvent,void 0,{preventUnmountOnClose(){}});u?.(!b,t),t.isCanceled||k(e=>!e)}},p,j],ref:[w,t,f.ref]});return(0,eT.jsx)(ai.Provider,{value:N,children:_})}),au=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...s}=e,o=function(){let e=eP.useContext(ai);if(void 0===e)throw Error((0,tm.default)(30));return e}(),l=eP.useRef(null),{transitionStatus:d,setMounted:c}=(0,tQ.useTransitionStatus)(o.checked);(0,tX.useOpenChangeComplete)({open:o.checked,ref:l,onComplete(){o.checked||c(!1)}});let u={checked:o.checked,disabled:o.disabled,highlighted:o.highlighted,transitionStatus:d};return(0,ta.useRenderElement)("span",e,{state:u,ref:[t,l],stateAttributesMapping:ad,props:{"aria-hidden":!0,...s},enabled:a||o.checked})}),am=eP.createContext(void 0),ap=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[s,o]=eP.useState(void 0),l=(0,ta.useRenderElement)("div",e,{ref:t,props:{role:"group","aria-labelledby":s,...a}});return(0,eT.jsx)(am.Provider,{value:o,children:l})}),af=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...s}=e,o=(0,tj.useBaseUiId)(a),l=function(){let e=eP.useContext(am);if(void 0===e)throw Error((0,tm.default)(31));return e}();return(0,tr.useIsoLayoutEffect)(()=>(l(o),()=>{l(void 0)}),[l,o]),(0,ta.useRenderElement)("div",e,{ref:t,props:{id:o,role:"presentation",...s}})}),ah=eP.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:s=!1,disabled:o=!1,closeOnClick:l=!0,style:d,...c}=e,u=tT({label:a}),m=i3(!0),p=(0,tj.useBaseUiId)(i),{store:f}=i8(),h=f.useState("isActive",u.index),g=f.useState("itemProps"),{getItemProps:x,itemRef:v}=ao({closeOnClick:l,disabled:o,highlighted:h,id:p,store:f,nativeButton:s,nodeId:m?.context.nodeId,itemMetadata:as});return(0,ta.useRenderElement)("div",e,{state:{disabled:o,highlighted:h},props:[g,c,x],ref:[v,t,u.ref]})}),ag=eP.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,closeOnClick:s=!1,style:o,...l}=e,d=eP.useRef(null),c=tT({label:a}),u=i3(!0),m=u?.context.nodeId,p=(0,tj.useBaseUiId)(i),{store:f}=i8(),h=f.useState("isActive",c.index),g=f.useState("itemProps"),x=f.context.typingRef,{getButtonProps:v,buttonRef:y}=t$({native:!1,composite:!0}),b=aa({closeOnClick:s,highlighted:h,id:p,nodeId:m,store:f,typingRef:x,itemRef:d});return(0,ta.useRenderElement)("a",e,{state:{highlighted:h},props:[g,l,function(e){return(0,tN.mergeProps)(b,e,v)}],ref:[d,y,t,c.ref]})});var ax=e.i(28800);let av={...r_.popupStateMapping,...tY.transitionStatusMapping},ay=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,...s}=e,{store:o}=i8(),{side:l,align:d}=i3(),c=null!=iv(!0),u=o.useState("open"),m=o.useState("transitionStatus"),p=o.useState("popupProps"),f=o.useState("mounted"),h=o.useState("instantType"),g=o.useState("activeTriggerElement"),x=o.useState("parent"),v=o.useState("lastOpenChangeReason"),y=o.useState("rootId"),b=o.useState("floatingRootContext"),k=o.useState("floatingTreeRoot"),j=o.useState("closeDelay"),w=o.useState("activeTriggerElement"),N=o.useState("hoverEnabled"),_=o.useState("disabled"),S="context-menu"===x.type;(0,tX.useOpenChangeComplete)({open:u,ref:o.context.popupRef,onComplete(){u&&o.context.onOpenChangeComplete?.(!0)}}),eP.useEffect(()=>{function e(e){o.setOpen(!1,(0,tx.createChangeEventDetails)(e.reason,e.domEvent))}return k.events.on("close",e),()=>{k.events.off("close",e)}},[k.events,o]),(0,ax.useHoverFloatingInteraction)(b,{enabled:N&&!_&&!S&&"menubar"!==x.type,closeDelay:j});let $=eP.useCallback(e=>{o.set("popupElement",e)},[o]),I={transitionStatus:m,side:l,align:d,open:u,nested:"menu"===x.type,instant:h},E=(0,ta.useRenderElement)("div",e,{state:I,ref:[t,o.context.popupRef,$],stateAttributesMapping:av,props:[p,{onKeyDown(e){c&&nr.has(e.key)&&e.stopPropagation()}},(0,iy.getDisabledMountTransitionStyles)(m),s,{"data-rootownerid":y}]}),C=void 0===x.type||S;return(g||"menubar"===x.type&&v!==tv.REASONS.outsidePress)&&(C=!0),(0,eT.jsx)(ip,{context:b,modal:S,disabled:!f,returnFocus:void 0===a?C:a,initialFocus:"menu"!==x.type,restoreFocus:!0,externalTree:"menubar"!==x.type?k:void 0,previousFocusableElement:w,nextFocusableElement:void 0===x.type?o.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:void 0===x.type?o.context.beforeContentFocusGuardRef:void 0,children:E})}),ab=eP.createContext(void 0),ak=eP.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=i8();return i.useState("mounted")||n?(0,eT.jsx)(ab.Provider,{value:n,children:(0,eT.jsx)(rP.FloatingPortal,{ref:t,...r})}):null});var aj=e.i(44484),aw=e.i(80809);let aN=eP.forwardRef(function(e,t){let{anchor:n,positionMethod:r="absolute",className:i,render:a,side:s,align:o,sideOffset:l=0,alignOffset:d=0,collisionBoundary:c="clipping-ancestors",collisionPadding:u=5,arrowPadding:m=5,sticky:p=!1,disableAnchorTracking:f=!1,collisionAvoidance:h=rF.DROPDOWN_COLLISION_AVOIDANCE,style:g,...x}=e,{store:v}=i8(),y=function(){let e=eP.useContext(ab);if(void 0===e)throw Error((0,tm.default)(32));return e}(),b=at(!0),k=v.useState("parent"),j=v.useState("floatingRootContext"),w=v.useState("floatingTreeRoot"),N=v.useState("mounted"),_=v.useState("open"),S=v.useState("modal"),$=v.useState("openMethod"),I=v.useState("activeTriggerElement"),E=v.useState("transitionStatus"),C=v.useState("positionerElement"),A=v.useState("instantType"),T=v.useState("hasViewport"),P=v.useState("lastOpenChangeReason"),z=v.useState("floatingNodeId"),O=v.useState("floatingParentNodeId"),M=j.useState("domReferenceElement"),R=eP.useRef(null),D=(0,aw.useAnimationsFinished)(C,!1,!1),L=n,U=l,Z=d,F=o,B=h;"context-menu"===k.type&&(L=n??k.context?.anchor,F=F??"start",s||"center"===F||(Z=e.alignOffset??2,U=e.sideOffset??-5));let V=s,q=F;"menu"===k.type?(V=V??"inline-end",q=q??"start",B=e.collisionAvoidance??rF.POPUP_COLLISION_AVOIDANCE):"menubar"===k.type&&(V=V??"bottom",q=q??"start");let W="context-menu"===k.type,H=(0,rD.useAnchorPositioning)({anchor:L,floatingRootContext:j,positionMethod:b?"fixed":r,mounted:N,side:V,sideOffset:U,align:q,alignOffset:Z,arrowPadding:W?0:m,collisionBoundary:c,collisionPadding:u,sticky:p,nodeId:z,keepMounted:y,disableAnchorTracking:f,collisionAvoidance:B,shiftCrossAxis:W&&!("side"in B&&"flip"===B.side),externalTree:w,adaptiveOrigin:T?aj.adaptiveOrigin:void 0});eP.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===z&&v.set("hoverEnabled",!1),e.nodeId!==z&&e.parentNodeId===v.select("floatingParentNodeId")&&v.setOpen(!1,(0,tx.createChangeEventDetails)(tv.REASONS.siblingOpen)))}return w.events.on("menuopenchange",e),()=>{w.events.off("menuopenchange",e)}},[v,w.events,z]),eP.useEffect(()=>{if(null!=v.select("floatingParentNodeId"))return w.events.on("menuopenchange",e),()=>{w.events.off("menuopenchange",e)};function e(e){if(e.open||e.nodeId!==v.select("floatingParentNodeId"))return;let t=e.reason??tv.REASONS.siblingOpen;v.setOpen(!1,(0,tx.createChangeEventDetails)(t))}},[w.events,v]);let G=(0,nz.useTimeout)();eP.useEffect(()=>{_||G.clear()},[_,G]),eP.useEffect(()=>{function e(e){if(_&&e.nodeId===v.select("floatingParentNodeId"))if(e.target&&I&&I!==e.target){let e=v.select("closeDelay");e>0?G.isStarted()||G.start(e,()=>{v.setOpen(!1,(0,tx.createChangeEventDetails)(tv.REASONS.siblingOpen))}):v.setOpen(!1,(0,tx.createChangeEventDetails)(tv.REASONS.siblingOpen))}else G.clear()}return w.events.on("itemhover",e),()=>{w.events.off("itemhover",e)}},[w.events,_,I,v,G]),eP.useEffect(()=>{let e={open:_,nodeId:z,parentNodeId:O,reason:v.select("lastOpenChangeReason")};w.events.emit("menuopenchange",e)},[w.events,_,v,z,O]),(0,tr.useIsoLayoutEffect)(()=>{let e=R.current;if(M&&(R.current=M),e&&M&&M!==e){v.set("instantType",void 0);let e=new AbortController;return D(()=>{v.set("instantType","trigger-change")},e.signal),()=>{e.abort()}}},[M,D,v]);let K={open:_,side:H.side,align:H.align,anchorHidden:H.anchorHidden,nested:"menu"===k.type,instant:A},J="menubar"===k.type&&k.context.modal,Y=S&&P!==tv.REASONS.triggerHover;rQ(_&&(J||Y),"touch"===$,C,I);let X=(0,rq.usePositioner)(e,K,{styles:H.positionerStyles,transitionStatus:E,props:x,refs:[t,v.useStateSetter("positionerElement")],hidden:!N,inert:!_}),Q=N&&"menu"!==k.type&&("menubar"!==k.type&&S&&P!==tv.REASONS.triggerHover||"menubar"===k.type&&k.context.modal),ee=null;return"menubar"===k.type?ee=k.context.contentElement:void 0===k.type&&(ee=I),(0,eT.jsxs)(i6.Provider,{value:H,children:[Q&&(0,eT.jsx)(rZ,{ref:"context-menu"===k.type||"nested-context-menu"===k.type?k.context.internalBackdropRef:null,inert:(0,tJ.inertValue)(!_),cutout:ee}),(0,eT.jsx)(nU.FloatingNode,{id:z,children:(0,eT.jsx)(tl,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:X})})]})}),a_=eP.createContext(void 0),aS=eP.memo(eP.forwardRef(function(e,t){let{render:n,className:r,value:i,defaultValue:a,onValueChange:s,disabled:o=!1,style:l,"aria-labelledby":d,...c}=e,[u,m]=eP.useState(void 0),[p,f]=tn({controlled:i,default:a,name:"MenuRadioGroup"}),h=(0,ti.useStableCallback)((e,t)=>{s?.(e,t),t.isCanceled||f(e)}),g=(0,ta.useRenderElement)("div",e,{state:{disabled:o},ref:t,props:{role:"group","aria-labelledby":d??u,"aria-disabled":o||void 0,...c}}),x=eP.useMemo(()=>({value:p,setValue:h,disabled:o}),[p,h,o]);return(0,eT.jsx)(am.Provider,{value:m,children:(0,eT.jsx)(a_.Provider,{value:x,children:g})})})),a$=eP.createContext(void 0),aI=eP.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:s=!1,disabled:o=!1,closeOnClick:l=!1,value:d,style:c,...u}=e,m=tT({label:a}),p=i3(!0),f=(0,tj.useBaseUiId)(i),{store:h}=i8(),g=h.useState("isActive",m.index),x=h.useState("itemProps"),{value:v,setValue:y,disabled:b}=function(){let e=eP.useContext(a_);if(void 0===e)throw Error((0,tm.default)(34));return e}(),k=b||o,j=v===d,{getItemProps:w,itemRef:N}=ao({closeOnClick:l,disabled:k,highlighted:g,id:f,store:h,nativeButton:s,nodeId:p?.context.nodeId,itemMetadata:as}),_=eP.useMemo(()=>({disabled:k,highlighted:g,checked:j}),[k,g,j]),S=(0,ta.useRenderElement)("div",e,{state:_,stateAttributesMapping:ad,props:[x,{role:"menuitemradio","aria-checked":j,onClick:function(e){y(d,(0,tx.createChangeEventDetails)(tv.REASONS.itemPress,e.nativeEvent,void 0,{preventUnmountOnClose(){}}))}},u,w],ref:[N,t,m.ref]});return(0,eT.jsx)(a$.Provider,{value:_,children:S})}),aE=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...s}=e,o=function(){let e=eP.useContext(a$);if(void 0===e)throw Error((0,tm.default)(35));return e}(),l=eP.useRef(null),{transitionStatus:d,setMounted:c}=(0,tQ.useTransitionStatus)(o.checked);(0,tX.useOpenChangeComplete)({open:o.checked,ref:l,onComplete(){o.checked||c(!1)}});let u={checked:o.checked,disabled:o.disabled,highlighted:o.highlighted,transitionStatus:d};return(0,ta.useRenderElement)("span",e,{state:u,stateAttributesMapping:ad,ref:[t,l],props:{"aria-hidden":!0,...s},enabled:a||o.checked})});var aC=e.i(69601),aA=e.i(16361),aT=e.i(42825);let aP=eP.createContext(null);function az(e){let t=eP.useContext(aP);if(null===t&&!e)throw Error((0,tm.default)(5));return t}var aO=e.i(8670),aM=e.i(25436),aR=e.i(78671),aD=e.i(91299);let aL={...aR.popupStoreSelectors,disabled:(0,rn.createSelector)(e=>"menubar"===e.parent.type&&e.parent.context.disabled||e.disabled),modal:(0,rn.createSelector)(e=>(void 0===e.parent.type||"context-menu"===e.parent.type)&&(e.modal??!0)),openMethod:(0,rn.createSelector)(e=>e.openMethod),allowMouseEnter:(0,rn.createSelector)(e=>e.allowMouseEnter),stickIfOpen:(0,rn.createSelector)(e=>e.stickIfOpen),parent:(0,rn.createSelector)(e=>e.parent),rootId:(0,rn.createSelector)(e=>"menu"===e.parent.type?e.parent.store.select("rootId"):void 0!==e.parent.type?e.parent.context.rootId:e.rootId),activeIndex:(0,rn.createSelector)(e=>e.activeIndex),isActive:(0,rn.createSelector)((e,t)=>e.activeIndex===t),hoverEnabled:(0,rn.createSelector)(e=>e.hoverEnabled),instantType:(0,rn.createSelector)(e=>e.instantType),lastOpenChangeReason:(0,rn.createSelector)(e=>e.openChangeReason),floatingTreeRoot:(0,rn.createSelector)(e=>"menu"===e.parent.type?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:(0,rn.createSelector)(e=>e.floatingNodeId),floatingParentNodeId:(0,rn.createSelector)(e=>e.floatingParentNodeId),itemProps:(0,rn.createSelector)(e=>e.itemProps),closeDelay:(0,rn.createSelector)(e=>e.closeDelay),hasViewport:(0,rn.createSelector)(e=>e.hasViewport),keyboardEventRelay:(0,rn.createSelector)(e=>e.keyboardEventRelay?e.keyboardEventRelay:"menu"===e.parent.type?e.parent.store.select("keyboardEventRelay"):void 0)};class aU extends aO.ReactStore{constructor(e){super({...{...(0,aR.createInitialPopupStoreState)(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new aM.FloatingTreeStore,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:tU.EMPTY_OBJECT,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1},...e},{positionerRef:eP.createRef(),popupRef:eP.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:eP.createRef(),beforeContentFocusGuardRef:eP.createRef(),onOpenChangeComplete:void 0,triggerElements:new aD.PopupTriggerMap},aL),this.unsubscribeParentListener=this.observe("parent",e=>{if(this.unsubscribeParentListener?.(),"menu"===e.type){let t=e.store.select("rootId"),n=e.store.select("floatingTreeRoot"),r=e.store.select("keyboardEventRelay");this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select("rootId"),a=e.store.select("floatingTreeRoot"),s=e.store.select("keyboardEventRelay");(t!==i||n!==a||r!==s)&&(t=i,n=a,r=s,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}void 0!==e.type&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:t})}static useStore(e,t){let n=(0,ts.useRefWithInit)(()=>new aU(t)).current;return e??n}unsubscribeParentListener=null}let aZ=eP.createContext(void 0);function aF(){return eP.useContext(aZ)}let aB=(0,aA.fastComponent)(function(e){let t,{children:n,open:r,onOpenChange:i,onOpenChangeComplete:a,defaultOpen:s=!1,disabled:o=!1,modal:l,loopFocus:d=!0,orientation:c="vertical",actionsRef:u,closeParentOnEsc:m=!1,handle:p,triggerId:f,defaultTriggerId:h=null,highlightItemOnHover:g=!0}=e,x=at(!0),v=i8(!0),y=az(!0),b=aF(),k=eP.useMemo(()=>b&&v?{type:"menu",store:v.store}:y?{type:"menubar",context:y}:x&&!v?{type:"context-menu",context:x}:{type:void 0},[x,v,y,b]),j=aU.useStore(p?.store,{open:s,openProp:r,activeTriggerId:h,triggerIdProp:f,parent:k});(0,nI.useOnFirstRender)(()=>{void 0===r&&!1===j.state.open&&!0===s&&j.update({open:!0,activeTriggerId:h})}),j.useControlledProp("openProp",r),j.useControlledProp("triggerIdProp",f),j.useContextCallback("onOpenChangeComplete",a);let w=(0,aC.useId)(),N=(0,aC.useId)(),_=j.useState("floatingTreeRoot"),S=(0,nU.useFloatingNodeId)(_),$=(0,nU.useFloatingParentNodeId)(),I=j.useState("open"),E=j.useState("activeTriggerElement"),C=j.useState("positionerElement"),A=j.useState("hoverEnabled"),T=j.useState("disabled"),P=j.useState("lastOpenChangeReason"),z=j.useState("parent"),O=j.useState("activeIndex"),M=j.useState("payload"),R=j.useState("floatingParentNodeId"),D=eP.useRef(null),L=eP.useRef("context-menu"!==z.type),U=(0,nz.useTimeout)(),Z=eP.useRef(!0),F=(0,nz.useTimeout)(),B=null!=R,{openMethod:V,triggerProps:q}=rx(I);j.useSyncedValues({disabled:o,modal:void 0===z.type?l:void 0,openMethod:V,rootId:w}),(0,rk.useImplicitActiveTrigger)(j);let{forceUnmount:W}=(0,rk.useOpenStateTransitions)(I,j,()=>{j.update({allowMouseEnter:!1,stickIfOpen:!0})});(0,tr.useIsoLayoutEffect)(()=>{x&&!v?j.update({parent:{type:"context-menu",context:x},floatingNodeId:S,floatingParentNodeId:$}):v&&j.update({floatingNodeId:S,floatingParentNodeId:$})},[x,v,S,$,j]),eP.useEffect(()=>{if(I||(D.current=null),"context-menu"===z.type){if(!I){U.clear(),L.current=!1;return}U.start(500,()=>{L.current=!0})}},[U,I,z.type]),(0,tr.useIsoLayoutEffect)(()=>{I||A||j.set("hoverEnabled",!0)},[I,A,j]);let H=(0,ti.useStableCallback)((e,t)=>{let n=t.reason;if(I===e&&t.trigger===E&&P===n||(t.preventUnmountOnClose=()=>{j.set("preventUnmountingOnClose",!0)},e||null!=t.trigger||(t.trigger=E??void 0),i?.(e,t),t.isCanceled))return;j.state.floatingRootContext.dispatchOpenChange(e,t);let r=t.event;if(!1===e&&r?.type==="click"&&"touch"===r.pointerType&&!Z.current)return;if(!e&&null!==O){let e=j.context.itemDomElements.current[O];queueMicrotask(()=>{e?.setAttribute("tabindex","-1")})}e&&n===tv.REASONS.triggerFocus?(Z.current=!1,F.start(300,()=>{Z.current=!0})):(Z.current=!0,F.clear());let a=(n===tv.REASONS.triggerPress||n===tv.REASONS.itemPress)&&0===r.detail&&r?.isTrusted,s=!e&&(n===tv.REASONS.escapeKey||null==n),o={open:e,openChangeReason:n};D.current=t.event??null;let l=t.trigger?.id??null;(l||e)&&(o.activeTriggerId=l,o.activeTriggerElement=t.trigger??null),j.update(o),"menubar"===z.type&&(n===tv.REASONS.triggerFocus||n===tv.REASONS.focusOut||n===tv.REASONS.triggerHover||n===tv.REASONS.listNavigation||n===tv.REASONS.siblingOpen)?j.set("instantType","group"):a||s?j.set("instantType",a?"click":"dismiss"):j.set("instantType",void 0)}),G=(0,aT.useSyncedFloatingRootContext)({popupStore:j,floatingId:N,nested:null!=$,onOpenChange:H}),K=G.context.events;eP.useEffect(()=>{let e=({open:e,eventDetails:t})=>H(e,t);return K.on("setOpen",e),()=>{K?.off("setOpen",e)}},[K,H]);let J=eP.useCallback(()=>{j.setOpen(!1,(0,tx.createChangeEventDetails)(tv.REASONS.imperativeAction))},[j]);eP.useImperativeHandle(u,()=>({unmount:W,close:J}),[W,J]),"context-menu"===z.type&&(t=z.context),eP.useImperativeHandle(t?.positionerRef,()=>C,[C]),eP.useImperativeHandle(t?.actionsRef,()=>({setOpen:H}),[H]);let Y=(0,nD.useDismiss)(G,{enabled:!T,bubbles:{escapeKey:m&&"menu"===z.type},outsidePress:()=>"context-menu"!==z.type||D.current?.type==="contextmenu"||L.current,externalTree:B?_:void 0}),X=(0,nu.useDirection)(),Q=eP.useCallback(e=>{j.select("activeIndex")!==e&&j.set("activeIndex",e)},[j]),ee=nH(G,{enabled:!T,listRef:j.context.itemDomElements,activeIndex:O,nested:void 0!==z.type,loopFocus:d,orientation:c,parentOrientation:"menubar"===z.type?z.context.orientation:void 0,rtl:"rtl"===X,disabledIndices:tU.EMPTY_ARRAY,onNavigate:Q,openOnArrowKeyDown:"context-menu"!==z.type,externalTree:B?_:void 0,focusItemOnHover:g}),et=eP.useCallback(e=>{j.context.typingRef.current=e},[j]),en=nG(G,{listRef:j.context.itemLabels,elementsRef:j.context.itemDomElements,activeIndex:O,resetMs:rF.TYPEAHEAD_RESET_MS,onMatch:e=>{I&&e!==O&&j.set("activeIndex",e)},onTyping:et}),er=eP.useMemo(()=>{let e=(0,tN.mergeProps)(en.reference,ee.reference,Y.reference,{onMouseMove(){j.set("allowMouseEnter",!0)}},q);return e["aria-haspopup"]="menu",e["aria-expanded"]=I,e},[j,en.reference,ee.reference,Y.reference,q,I]),ei=eP.useMemo(()=>{let e=(0,tN.mergeProps)(ee.trigger,Y.trigger,q);return e["aria-haspopup"]="menu",e["aria-expanded"]=!1,e},[ee.trigger,Y.trigger,q]),ea=eP.useMemo(()=>(0,tN.mergeProps)(rk.FOCUSABLE_POPUP_PROPS,{id:N,role:"menu","aria-labelledby":E?.id,onMouseMove(){j.set("allowMouseEnter",!0),"menu"===z.type&&j.set("hoverEnabled",!1)},onClick(){j.select("hoverEnabled")&&j.set("hoverEnabled",!1)},onKeyDown(e){let t=j.select("keyboardEventRelay");t&&!e.isPropagationStopped()&&t(e)}},en.floating,ee.floating,Y.floating),[E,N,z.type,j,en.floating,ee.floating,Y.floating]),es=ee.item??tU.EMPTY_OBJECT;(0,rk.usePopupInteractionProps)(j,{floatingRootContext:G,activeTriggerProps:er,inactiveTriggerProps:ei,popupProps:ea,itemProps:es});let eo=eP.useMemo(()=>({store:j,parent:k}),[j,k]),el=(0,eT.jsx)(i9.Provider,{value:eo,children:"function"==typeof n?n({payload:M}):n});return void 0===z.type||"context-menu"===z.type?(0,eT.jsx)(nU.FloatingTree,{externalTree:_,children:el}):el});var aV=e.i(30836),aq=e.i(22859),aW=e.i(21960);function aH(e){let{render:t,className:n,style:r,state:i=tU.EMPTY_OBJECT,props:a=tU.EMPTY_ARRAY,refs:s=tU.EMPTY_ARRAY,metadata:o,stateAttributesMapping:l,tag:d="div",...c}=e,{compositeProps:u,compositeRef:m}=tP({metadata:o});return(0,ta.useRenderElement)(d,e,{state:i,ref:[...s,m],props:[u,...a,c],stateAttributesMapping:l})}var aG=e.i(92343);let aK=(0,aA.fastComponentRef)(function(e,t){let n,r,i,a,{render:s,className:o,style:l,disabled:d=!1,nativeButton:c=!0,id:u,openOnHover:m,delay:p=100,closeDelay:f=0,handle:h,payload:g,...x}=e,v=i8(!0),y=h?.store??v?.store;if(!y)throw Error((0,tm.default)(85));let b=(0,tj.useBaseUiId)(u),k=y.useState("isTriggerActive",b),j=y.useState("floatingRootContext"),w=y.useState("isOpenedByTrigger",b),N=y.useState("triggerPopupId",b),_=eP.useRef(null),S=(n=at(!0),r=i8(!0),i=az(!0),eP.useMemo(()=>i?{type:"menubar",context:i}:n&&!r?{type:"context-menu",context:n}:{type:void 0},[n,r,i])),$=tS(!0),I=(0,nU.useFloatingTree)(),E=eP.useMemo(()=>I??new aM.FloatingTreeStore,[I]),C=(0,nU.useFloatingNodeId)(E),A=(0,nU.useFloatingParentNodeId)(),{registerTrigger:T,isMountedByThisTrigger:P}=(0,rk.useTriggerDataForwarding)(b,_,y,{payload:g,closeDelay:f,parent:S,floatingTreeRoot:E,floatingNodeId:C,floatingParentNodeId:A,keyboardEventRelay:$?.relayKeyboardEvent}),z="menubar"===S.type,O=y.useState("disabled"),M=d||O||z&&S.context.disabled,{getButtonProps:R,buttonRef:D}=t$({disabled:M,native:c});eP.useEffect(()=>{w||void 0!==S.type||(y.context.allowMouseUpTriggerRef.current=!1)},[y,w,S.type]);let L=eP.useRef(null),U=(0,nz.useTimeout)(),Z=(0,ti.useStableCallback)(e=>{if(!L.current)return;U.clear(),y.context.allowMouseUpTriggerRef.current=!1;let t=e.target;if((0,tM.contains)(L.current,t)||(0,tM.contains)(y.select("positionerElement"),t)||t===L.current||null!=t&&function e(t){return(0,tw.isHTMLElement)(t)&&t.hasAttribute("data-rootownerid")?t.getAttribute("data-rootownerid")??void 0:(0,tw.isLastTraversableNode)(t)?void 0:e((0,tw.getParentNode)(t))}(t)===y.select("rootId"))return;let n=r$(L.current);e.clientX>=n.left-2&&e.clientX<=n.right+2&&e.clientY>=n.top-2&&e.clientY<=n.bottom+2||E.events.emit("close",{domEvent:e,reason:tv.REASONS.cancelOpen})});eP.useEffect(()=>{w&&y.select("lastOpenChangeReason")===tv.REASONS.triggerHover&&(0,tk.ownerDocument)(L.current).addEventListener("mouseup",Z,{once:!0})},[w,Z,y]);let F=z&&S.context.hasSubmenuOpen,B=m??F,V=(0,aW.useHoverReferenceInteraction)(j,{enabled:B&&!M&&"context-menu"!==S.type&&(!z||F&&!P),handleClose:(0,aV.safePolygon)({blockPointerEvents:!z}),mouseOnly:!0,move:!1,restMs:void 0===S.type?p:void 0,delay:{close:f},triggerElementRef:_,externalTree:E,isActiveTrigger:k,isClosing:()=>"ending"===y.select("transitionStatus")}),q=function(e,t){let n=(0,nz.useTimeout)(),[r,i]=eP.useState(!1);return(0,tr.useIsoLayoutEffect)(()=>{e&&"trigger-hover"===t?(i(!0),n.start(rF.PATIENT_CLICK_THRESHOLD,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}(w,y.select("lastOpenChangeReason")),W=nR(j,{enabled:!M&&"context-menu"!==S.type,event:w&&z?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:void 0===S.type&&q}),H=(0,aq.useFocus)(j,{enabled:!M&&F}),G=function(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=eP.useRef(!1);return eP.useMemo(()=>t?{onMouseDown:e=>{("open"===n&&!r||"close"===n&&r)&&(i.current=!0,(0,tk.ownerDocument)(e.currentTarget).addEventListener("click",()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:tU.EMPTY_OBJECT,[t,n,r])}({open:w,enabled:z,mouseDownAction:"open"}),K=eP.useMemo(()=>(0,tN.mergeProps)(H.reference,W.reference),[H.reference,W.reference]),J=y.useState("triggerProps",P),{preFocusGuardRef:Y,handlePreFocusGuardFocus:X,handleFocusTargetFocus:Q}={preFocusGuardRef:a=eP.useRef(null),handlePreFocusGuardFocus:function(e){aG.flushSync(()=>{y.setOpen(!1,(0,tx.createChangeEventDetails)(tv.REASONS.focusOut,e.nativeEvent,e.currentTarget))});let t=(0,r6.getTabbableBeforeElement)(a.current);t?.focus()},handleFocusTargetFocus:function(e){let t=y.select("positionerElement");if(t&&(0,r6.isOutsideEvent)(e,t))y.context.beforeContentFocusGuardRef.current?.focus();else{aG.flushSync(()=>{y.setOpen(!1,(0,tx.createChangeEventDetails)(tv.REASONS.focusOut,e.nativeEvent,e.currentTarget))});let n=(0,r6.getTabbableAfterElement)(y.context.triggerFocusTargetRef.current||_.current);for(;null!==n&&(0,tM.contains)(t,n);){let e=n;if((n=(0,r6.getNextTabbable)(n))===e)break}n?.focus()}}},ee={disabled:M,open:w},et=[L,t,D,T,_],en=[K,V??tU.EMPTY_OBJECT,J,{"aria-haspopup":"menu","aria-controls":N,id:b,onMouseDown:e=>{y.select("open")||(U.start(200,()=>{y.context.allowMouseUpTriggerRef.current=!0}),(0,tk.ownerDocument)(e.currentTarget).addEventListener("mouseup",Z,{once:!0}))}},z?{role:"menuitem"}:{},G,x,R],er=(0,ta.useRenderElement)("button",e,{enabled:!z,stateAttributesMapping:r_.pressableTriggerOpenStateMapping,state:ee,ref:et,props:en});return z?(0,eT.jsx)(aH,{tag:"button",render:s,className:o,style:l,state:ee,refs:et,props:en,stateAttributesMapping:r_.pressableTriggerOpenStateMapping}):w?(0,eT.jsxs)(eP.Fragment,{children:[(0,eT.jsx)(r5.FocusGuard,{ref:Y,onFocus:X},`${b}-pre-focus-guard`),(0,eT.jsx)(eP.Fragment,{children:er},b),(0,eT.jsx)(r5.FocusGuard,{ref:y.context.triggerFocusTargetRef,onFocus:Q},`${b}-post-focus-guard`)]}):(0,eT.jsx)(eP.Fragment,{children:er},b)});var aJ=e.i(53780);let aY=((c={}).popupWidth="--popup-width",c.popupHeight="--popup-height",c),aX={activationDirection:e=>e?{"data-activation-direction":e}:null},aQ=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...s}=e,{store:o}=i8(),{side:l}=i3(),d=o.useState("instantType"),{children:c,state:u}=(0,aJ.usePopupViewport)({store:o,side:l,cssVars:aY,children:a}),m={activationDirection:u.activationDirection,transitioning:u.transitioning,instant:d};return(0,ta.useRenderElement)("div",e,{state:m,ref:t,props:[s,{children:c}],stateAttributesMapping:aX})}),a0=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,label:a,id:s,nativeButton:o=!1,openOnHover:l=!0,delay:d=100,closeDelay:c=0,disabled:u=!1,...m}=e,p=tT(),f=i3(),{store:h}=i8(),g=(0,tj.useBaseUiId)(s),x=h.useState("open"),v=h.useState("floatingRootContext"),y=h.useState("floatingTreeRoot"),b=h.useState("triggerPopupId",g),k=(0,rk.useTriggerRegistration)(g,h),j=eP.useCallback(e=>{let t=k(e);return null!==e&&h.select("open")&&null==h.select("activeTriggerId")&&h.update({activeTriggerId:g,activeTriggerElement:e,closeDelay:c}),t},[k,c,h,g]),w=eP.useRef(null),N=eP.useCallback(e=>{w.current=e,h.set("activeTriggerElement",e)},[h]),_=aF();if(!_?.parentMenu)throw Error((0,tm.default)(37));h.useSyncedValue("closeDelay",c);let S=_.parentMenu,$=S.useState("itemProps"),I=S.useState("isActive",p.index),E=eP.useMemo(()=>({type:"submenu-trigger",setActive(){S.set("activeIndex",p.index)}}),[S,p.index]),C=h.useState("disabled"),A=u||C,{getItemProps:T,itemRef:P}=ao({closeOnClick:!1,disabled:A,highlighted:I,id:g,store:h,typingRef:S.context.typingRef,nativeButton:o,itemMetadata:E,nodeId:f?.context.nodeId}),z=h.useState("hoverEnabled"),O=S.useState("allowMouseEnter"),M=(0,aW.useHoverReferenceInteraction)(v,{enabled:z&&l&&!A,handleClose:(0,aV.safePolygon)({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:d,delay:O?{open:d,close:c}:0,triggerElementRef:w,externalTree:y,isClosing:()=>"ending"===h.select("transitionStatus")}),R=nR(v,{enabled:!A,event:"mousedown",toggle:!l,ignoreMouse:l,stickIfOpen:!1}).reference??tU.EMPTY_OBJECT,D=h.useState("triggerProps",!0);return delete D.id,(0,ta.useRenderElement)("div",e,{state:{disabled:A,highlighted:I,open:x},stateAttributesMapping:r_.triggerOpenStateMapping,props:[R,M,D,$,{"aria-controls":b,tabIndex:x||I?0:-1,onBlur(){I&&S.set("activeIndex",null)}},m,T],ref:[t,p.ref,P,j,N]})});class a1{constructor(){this.store=new aU}open(e){let t=e?this.store.context.triggerElements.getById(e):void 0;if(e&&!t)throw Error((0,tm.default)(83,e));this.store.setOpen(!0,(0,tx.createChangeEventDetails)("imperative-action",void 0,t))}close(){this.store.setOpen(!1,(0,tx.createChangeEventDetails)("imperative-action",void 0,void 0))}get isOpen(){return this.store.select("open")}}e.s(["Arrow",0,i7,"Backdrop",0,ar,"CheckboxItem",0,ac,"CheckboxItemIndicator",0,au,"Group",0,ap,"GroupLabel",0,af,"Handle",0,a1,"Item",0,ah,"LinkItem",0,ag,"Popup",0,ay,"Portal",0,ak,"Positioner",0,aN,"RadioGroup",0,aS,"RadioItem",0,aI,"RadioItemIndicator",0,aE,"Root",0,aB,"Separator",0,iF,"SubmenuRoot",0,function(e){let t=i8().store,n=eP.useMemo(()=>({parentMenu:t}),[t]);return(0,eT.jsx)(aZ.Provider,{value:n,children:(0,eT.jsx)(aB,{...e})})},"SubmenuTrigger",0,a0,"Trigger",0,aK,"Viewport",0,aQ,"createHandle",0,function(){return new a1}],34459);var a2=e.i(34459),a2=a2;let a4=eL("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);function a5({...e}){return(0,eT.jsx)(a2.Root,{"data-slot":"dropdown-menu",...e})}function a6({...e}){return(0,eT.jsx)(a2.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function a3({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:r=4,className:i,...a}){return(0,eT.jsx)(a2.Portal,{children:(0,eT.jsx)(a2.Positioner,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:r,children:(0,eT.jsx)(a2.Popup,{"data-slot":"dropdown-menu-content",className:(0,ny.cn)("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",i),...a})})})}function a9({className:e,inset:t,...n}){return(0,eT.jsx)(a2.GroupLabel,{"data-slot":"dropdown-menu-label","data-inset":t,className:(0,ny.cn)("px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7",e),...n})}function a8({className:e,inset:t,variant:n="default",...r}){return(0,eT.jsx)(a2.Item,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:(0,ny.cn)("group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",e),...r})}function a7({className:e,...t}){return(0,eT.jsx)(a2.Separator,{"data-slot":"dropdown-menu-separator",className:(0,ny.cn)("-mx-1 my-1 h-px bg-border",e),...t})}let se=eL("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),st=eL("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),sn=eL("list-checks",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]),sr=eL("square-kanban",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 7v7",key:"1x2jlm"}],["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M16 7v9",key:"1hp2iy"}]]),si=eL("file-code-corner",[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]]),sa=eL("package-search",[["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"M20.27 18.27 22 20",key:"er2am"}],["path",{d:"M21 10.498V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l.98-.559",key:"tok1h1"}],["path",{d:"M3.29 7 12 12l8.71-5",key:"19ckod"}],["path",{d:"m7.5 4.27 8.997 5.148",key:"9yrvtv"}],["circle",{cx:"18.5",cy:"16.5",r:"2.5",key:"ke13xx"}]]);e.s([],7544),e.i(7544);let ss=eP.createContext(!1),so=eP.createContext(void 0);function sl(e){let t=eP.useContext(so);if(!1===e&&void 0===t)throw Error((0,tm.default)(27));return t}let sd={...r_.popupStateMapping,...tY.transitionStatusMapping},sc=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...s}=e,{store:o}=sl(),l=o.useState("open"),d=o.useState("nested"),c=o.useState("mounted"),u=o.useState("transitionStatus");return(0,ta.useRenderElement)("div",e,{state:{open:l,transitionStatus:u},ref:[o.context.backdropRef,t],stateAttributesMapping:sd,props:[{role:"presentation",hidden:!c,style:{userSelect:"none",WebkitUserSelect:"none"}},s],enabled:a||!d})}),su=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:s=!0,...o}=e,{store:l}=sl(),d=l.useState("open"),{getButtonProps:c,buttonRef:u}=t$({disabled:a,native:s});return(0,ta.useRenderElement)("button",e,{state:{disabled:a},ref:[t,u],props:[{onClick:function(e){d&&l.setOpen(!1,(0,tx.createChangeEventDetails)(tv.REASONS.closePress,e.nativeEvent))}},o,c]})}),sm=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...s}=e,{store:o}=sl(),l=(0,tj.useBaseUiId)(a);return o.useSyncedValueWithCleanup("descriptionElementId",l),(0,ta.useRenderElement)("p",e,{ref:t,props:[{id:l},s]})}),sp=((u={}).nestedDialogs="--nested-dialogs",u),sf=((m={})[m.open=r_.CommonPopupDataAttributes.open]="open",m[m.closed=r_.CommonPopupDataAttributes.closed]="closed",m[m.startingStyle=r_.CommonPopupDataAttributes.startingStyle]="startingStyle",m[m.endingStyle=r_.CommonPopupDataAttributes.endingStyle]="endingStyle",m.nested="data-nested",m.nestedDialogOpen="data-nested-dialog-open",m),sh=eP.createContext(void 0);function sg(){let e=eP.useContext(sh);if(void 0===e)throw Error((0,tm.default)(26));return e}let sx={...r_.popupStateMapping,...tY.transitionStatusMapping,nestedDialogOpen:e=>e?{[sf.nestedDialogOpen]:""}:null},sv=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:s,...o}=e,{store:l}=sl(),d=l.useState("descriptionElementId"),c=l.useState("disablePointerDismissal"),u=l.useState("floatingRootContext"),m=l.useState("popupProps"),p=l.useState("modal"),f=l.useState("mounted"),h=l.useState("nested"),g=l.useState("nestedOpenDialogCount"),x=l.useState("open"),v=l.useState("openMethod"),y=l.useState("titleElementId"),b=l.useState("transitionStatus"),k=l.useState("role"),j=u.useState("floatingId"),w=o.id??j;sg(),(0,tX.useOpenChangeComplete)({open:x,ref:l.context.popupRef,onComplete(){x&&l.context.onOpenChangeComplete?.(!0)}});let N=void 0===s?function(e){return"touch"!==e||l.context.popupRef.current}:s,_=l.useStateSetter("popupElement"),S=(0,ta.useRenderElement)("div",e,{state:{open:x,nested:h,transitionStatus:b,nestedDialogOpen:g>0},props:[m,{id:w,"aria-labelledby":y??void 0,"aria-describedby":d??void 0,role:k,...rk.FOCUSABLE_POPUP_PROPS,hidden:!f,onKeyDown(e){nr.has(e.key)&&e.stopPropagation()},style:{[sp.nestedDialogs]:g}},o],ref:[t,l.context.popupRef,_],stateAttributesMapping:sx});return(0,eT.jsx)(ip,{context:u,openInteractionType:v,disabled:!f,closeOnFocusOut:!c,initialFocus:N,returnFocus:a,modal:!1!==p,restoreFocus:"popup",children:S})}),sy=eP.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=sl(),a=i.useState("mounted"),s=i.useState("modal"),o=i.useState("open");return a||n?(0,eT.jsx)(sh.Provider,{value:n,children:(0,eT.jsxs)(rP.FloatingPortal,{ref:t,...r,children:[a&&!0===s&&(0,eT.jsx)(rZ,{ref:i.context.internalBackdropRef,inert:(0,tJ.inertValue)(!o)}),e.children]})}):null});function sb({store:e,dialogRoot:t}){let{parentContext:n,isDrawer:r}=t,i=e.useState("open"),a=e.useState("disablePointerDismissal"),s=e.useState("modal"),o=e.useState("popupElement"),l=e.useState("floatingRootContext"),[d,c]=eP.useState(0),[u,m]=eP.useState(0),p=0===d,f=(0,nD.useDismiss)(l,{outsidePressEvent:()=>e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:"trap-focus"===s?"sloppy":"intentional",touch:"sloppy"},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||"button"in t&&0!==t.button||"touches"in t&&1!==t.touches.length)return!1;let n=(0,tM.getTarget)(t);return!!p&&!a&&(!s||!e.context.internalBackdropRef.current&&!e.context.backdropRef.current||e.context.internalBackdropRef.current===n||e.context.backdropRef.current===n||(0,tM.contains)(n,o)&&!n?.hasAttribute("data-base-ui-portal"))},escapeKey:p});rX(i&&!0===s,o),e.useContextCallback("onNestedDialogOpen",(e,t)=>{c(e),m(t)}),e.useContextCallback("onNestedDialogClose",()=>{c(0),m(0)}),eP.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(d+1,u+ +!!r),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[r,i,d,u,n]);let h=f.reference??tU.EMPTY_OBJECT,g=f.trigger??tU.EMPTY_OBJECT,x=eP.useMemo(()=>(0,tN.mergeProps)(rk.FOCUSABLE_POPUP_PROPS,f.floating),[f.floating]);return(0,rk.usePopupInteractionProps)(e,{activeTriggerProps:h,inactiveTriggerProps:g,popupProps:x,nestedOpenDialogCount:d,nestedOpenDrawerCount:u}),null}var sk=aO;let sj={...aR.popupStoreSelectors,modal:(0,rn.createSelector)(e=>e.modal),nested:(0,rn.createSelector)(e=>e.nested),nestedOpenDialogCount:(0,rn.createSelector)(e=>e.nestedOpenDialogCount),nestedOpenDrawerCount:(0,rn.createSelector)(e=>e.nestedOpenDrawerCount),disablePointerDismissal:(0,rn.createSelector)(e=>e.disablePointerDismissal),openMethod:(0,rn.createSelector)(e=>e.openMethod),descriptionElementId:(0,rn.createSelector)(e=>e.descriptionElementId),titleElementId:(0,rn.createSelector)(e=>e.titleElementId),viewportElement:(0,rn.createSelector)(e=>e.viewportElement),role:(0,rn.createSelector)(e=>e.role)};class sw extends sk.ReactStore{constructor(e,t,n=!1){const r=new aD.PopupTriggerMap,i=function(e={}){return{...(0,aR.createInitialPopupStoreState)(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e}}(e);i.floatingRootContext=(0,aR.createPopupFloatingRootContext)(r,t,n),super(i,{popupRef:eP.createRef(),backdropRef:eP.createRef(),internalBackdropRef:eP.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:r,onOpenChange:void 0,onOpenChangeComplete:void 0},sj)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},e||null!=t.trigger||null==this.state.activeTriggerId||(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let n={open:e};(0,rk.setOpenTriggerState)(n,e,t.trigger),this.update(n)};static useStore(e,t){return(0,rk.usePopupStore)(e,(e,n)=>new sw(t,e,n),!0).store}}let sN=((p={})[p.open=r_.CommonPopupDataAttributes.open]="open",p[p.closed=r_.CommonPopupDataAttributes.closed]="closed",p[p.startingStyle=r_.CommonPopupDataAttributes.startingStyle]="startingStyle",p[p.endingStyle=r_.CommonPopupDataAttributes.endingStyle]="endingStyle",p.nested="data-nested",p.nestedDialogOpen="data-nested-dialog-open",p),s_={...r_.popupStateMapping,...tY.transitionStatusMapping,nested:e=>e?{[sN.nested]:""}:null,nestedDialogOpen:e=>e?{[sN.nestedDialogOpen]:""}:null},sS=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...s}=e,o=sg(),{store:l}=sl(),d=l.useState("open"),c=l.useState("nested"),u=l.useState("transitionStatus"),m=l.useState("nestedOpenDialogCount"),p=l.useState("mounted"),f=l.useStateSetter("viewportElement");return(0,ta.useRenderElement)("div",e,{enabled:o||p,state:{open:d,nested:c,transitionStatus:u,nestedDialogOpen:m>0},ref:[t,f],stateAttributesMapping:s_,props:[{role:"presentation",hidden:!p,style:{pointerEvents:d?void 0:"none"},children:a},s]})}),s$=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...s}=e,{store:o}=sl(),l=(0,tj.useBaseUiId)(a);return o.useSyncedValueWithCleanup("titleElementId",l),(0,ta.useRenderElement)("h2",e,{ref:t,props:[{id:l},s]})}),sI=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:s=!0,id:o,payload:l,handle:d,...c}=e,u=sl(!0),m=d?.store??u?.store;if(!m)throw Error((0,tm.default)(79));let p=(0,tj.useBaseUiId)(o),f=m.useState("floatingRootContext"),h=m.useState("isOpenedByTrigger",p),g=m.useState("triggerPopupId",p),x=eP.useRef(null),{registerTrigger:v,isMountedByThisTrigger:y}=(0,rk.useTriggerDataForwarding)(p,x,m,{payload:l}),{getButtonProps:b,buttonRef:k}=t$({disabled:a,native:s}),j=nR(f,{enabled:null!=f}),w=rg(()=>m.select("open"),e=>{m.set("openMethod",e)}),N=m.useState("triggerProps",y);return(0,ta.useRenderElement)("button",e,{state:{disabled:a,open:h},ref:[k,t,v,x],props:[j.reference,N,w,{[rF.CLICK_TRIGGER_IDENTIFIER]:"",id:p,"aria-haspopup":"dialog","aria-expanded":h,"aria-controls":g},c,b],stateAttributesMapping:r_.triggerOpenStateMapping})});class sE{constructor(e){this.store=e??new sw}open(e){let t=e?this.store.context.triggerElements.getById(e):void 0;this.store.setOpen(!0,(0,tx.createChangeEventDetails)(tv.REASONS.imperativeAction,void 0,t))}openWithPayload(e){this.store.set("payload",e),this.store.setOpen(!0,(0,tx.createChangeEventDetails)(tv.REASONS.imperativeAction,void 0,void 0))}close(){this.store.setOpen(!1,(0,tx.createChangeEventDetails)(tv.REASONS.imperativeAction,void 0,void 0))}get isOpen(){return this.store.select("open")}}e.s(["Backdrop",0,sc,"Close",0,su,"Description",0,sm,"Handle",0,sE,"Popup",0,sv,"Portal",0,sy,"Root",0,function(e){return function(e,t="dialog"){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:s,disablePointerDismissal:o=!1,modal:l=!0,actionsRef:d,handle:c,triggerId:u,defaultTriggerId:m=null}=e,p="alert-dialog"===t,f=sl(!0),h={modal:!!p||l,disablePointerDismissal:p||o,nested:!!f,role:p?"alertdialog":"dialog"},g=sw.useStore(c?.store,{open:i,openProp:r,activeTriggerId:m,triggerIdProp:u,...h});(0,nI.useOnFirstRender)(()=>{let e=void 0===r&&!1===g.state.open&&!0===i?{open:!0,activeTriggerId:m}:null;p?g.update(e?{...h,...e}:h):e&&g.update(e)}),g.useControlledProp("openProp",r),g.useControlledProp("triggerIdProp",u),g.useSyncedValues(h),g.useContextCallback("onOpenChange",a),g.useContextCallback("onOpenChangeComplete",s);let x=g.useState("open"),v=g.useState("mounted"),y=g.useState("payload"),b=function(e){let{store:t,parentContext:n,actionsRef:r,isDrawer:i}=e,a=t.useState("open");(0,rk.usePopupRootSync)(t,a),(0,rk.useImplicitActiveTrigger)(t);let{forceUnmount:s}=(0,rk.useOpenStateTransitions)(a,t),o=eP.useCallback(()=>{t.setOpen(!1,(0,tx.createChangeEventDetails)(tv.REASONS.imperativeAction))},[t]);return eP.useImperativeHandle(r,()=>({unmount:s,close:o}),[s,o]),{parentContext:n,isDrawer:i}}({store:g,actionsRef:d,parentContext:f?.store.context,isDrawer:"drawer"===t}),k=eP.useMemo(()=>({store:g}),[g]);return(0,eT.jsx)(ss.Provider,{value:!1,children:(0,eT.jsxs)(so.Provider,{value:k,children:[(x||v)&&(0,eT.jsx)(sb,{store:g,dialogRoot:b}),"function"==typeof n?n({payload:y}):n]})})}(e,eP.useContext(ss)?"drawer":"dialog")},"Title",0,s$,"Trigger",0,sI,"Viewport",0,sS,"createHandle",0,function(){return new sE}],50430);var sC=e.i(50430),sC=sC;let sA=eP.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:s=!0,style:o,...l}=e,{getButtonProps:d,buttonRef:c}=t$({disabled:i,focusableWhenDisabled:a,native:s});return(0,ta.useRenderElement)("button",e,{state:{disabled:i},ref:[t,c],props:[l,d]})}),sT=nv("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function sP({className:e,variant:t="default",size:n="default",...r}){return(0,eT.jsx)(sA,{"data-slot":"button",className:(0,ny.cn)(sT({variant:t,size:n,className:e})),...r})}let sz=eL("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function sO({...e}){return(0,eT.jsx)(sC.Root,{"data-slot":"dialog",...e})}function sM({...e}){return(0,eT.jsx)(sC.Trigger,{"data-slot":"dialog-trigger",...e})}function sR({...e}){return(0,eT.jsx)(sC.Portal,{"data-slot":"dialog-portal",...e})}function sD({className:e,...t}){return(0,eT.jsx)(sC.Backdrop,{"data-slot":"dialog-overlay",className:(0,ny.cn)("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function sL({className:e,children:t,showCloseButton:n=!0,...r}){return(0,eT.jsxs)(sR,{children:[(0,eT.jsx)(sD,{}),(0,eT.jsxs)(sC.Popup,{"data-slot":"dialog-content",className:(0,ny.cn)("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...r,children:[t,n&&(0,eT.jsxs)(sC.Close,{"data-slot":"dialog-close",render:(0,eT.jsx)(sP,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[(0,eT.jsx)(sz,{}),(0,eT.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function sU({className:e,...t}){return(0,eT.jsx)("div",{"data-slot":"dialog-header",className:(0,ny.cn)("flex flex-col gap-2",e),...t})}function sZ({className:e,...t}){return(0,eT.jsx)(sC.Title,{"data-slot":"dialog-title",className:(0,ny.cn)("text-base leading-none font-medium",e),...t})}function sF({className:e,...t}){return(0,eT.jsx)(sC.Description,{"data-slot":"dialog-description",className:(0,ny.cn)("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}function sB({children:e}){return(0,eT.jsx)("pre",{className:"overflow-x-auto rounded-sm border border-border bg-muted/60 px-3 py-2 font-mono text-xs leading-relaxed text-foreground",children:(0,eT.jsx)("code",{children:e})})}function sV({icon:e,title:t,children:n}){return(0,eT.jsxs)("section",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(e,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"font-mono text-sm font-semibold text-foreground",children:t})]}),(0,eT.jsx)("div",{className:"flex flex-col gap-2 border-l border-border pl-4",children:n})]})}let sq=[{flag:"--ci",desc:"Run once, print a summary, and exit non-zero if thresholds are breached. No dashboard."},{flag:"--json",desc:"Write the full report as JSON to stdout for piping into other tools."},{flag:"--no-ai",desc:"Skip the AI security review (lint + types + dependency audit only)."},{flag:"--port <n>",desc:"Serve the dashboard on a specific port (default 4321)."},{flag:"--watch",desc:"Re-run affected checks automatically when files change."}],sW={live:"runs in your repo",static:"static scan",library:"library"},sH=[{icon:eV,title:"Core checks",blurb:"Your project's own toolchain, executed locally — the results match what you see in CI.",tools:[{name:"ESLint",kind:"live",desc:"Lint findings (errors, warnings, fixable) powering the Lint tab. Uses your project's ESLint and config.",detail:"eslint . --format json"},{name:"TypeScript (tsc)",kind:"live",desc:"Type diagnostics with the full assignability chain, shown in the Types tab. Uses your project's TypeScript.",detail:"tsc --noEmit --pretty false"},{name:"npm / pnpm / yarn audit",kind:"live",desc:"Ground-truth CVE advisories for the Dependencies view. The package manager is auto-detected from your lockfile.",detail:"<pm> audit --json"},{name:"AI security review",kind:"live",desc:"Reviews security-relevant source files for exploitable issues and ranks the real advisories. Powers the Security tab.",detail:"AI SDK → Vercel AI Gateway"}]},{icon:si,title:"Project intelligence",blurb:"Built-in static analyzers that read your source once per run — no extra tools to install.",tools:[{name:"API surface",kind:"static",desc:"Detects route handlers, methods, dynamic segments, and protection gaps for the API tab."},{name:"Network calls",kind:"static",desc:"Finds outbound fetch/axios calls and flags insecure or external domains in the Network tab."},{name:"Accessibility",kind:"static",desc:"WCAG rule heuristics over your markup, grouped by principle, for the Accessibility tab."},{name:"Performance",kind:"static",desc:"Heavy-dependency, bundle, and Web-Vitals heuristics surfaced in the Performance tab."},{name:"Environment variables",kind:"static",desc:"Inventories .env files and client/server exposure for the Environment tab."},{name:"Documentation",kind:"static",desc:"Scores README, CHANGELOG, and agent-readiness for the Docs tab."}]},{icon:eK,title:"Repository & data",blurb:"Collectors that read your git history, test output, and live database schema.",tools:[{name:"Git CLI",kind:"live",desc:"Branch, status, commit log, and contributor data for the Git tab.",detail:"git rev-parse · status · log · shortlog"},{name:"GitHub REST API",kind:"live",desc:"Repo overview and releases. Optional GITHUB_TOKEN raises the rate limit and enables private repos."},{name:"Test coverage",kind:"static",desc:"Reads coverage-summary.json from Vitest, Jest, or Playwright for the Tests tab."},{name:"Database introspection",kind:"live",desc:"Optional: connects with your DB driver to read the live schema via information_schema.",detail:"pg · mysql2 (when present)"}]},{icon:te,title:"Engine libraries",blurb:"The packages the CodeLens CLI itself is built on.",tools:[{name:"commander",kind:"library",desc:"Parses CLI arguments and flags."},{name:"execa",kind:"library",desc:"Runs the lint, type, audit, and git processes."},{name:"ws",kind:"library",desc:"Streams live run progress to this dashboard over a WebSocket."},{name:"zod",kind:"library",desc:"Validates the AI output schema and your .codelens.json config."},{name:"ai (AI SDK 6)",kind:"library",desc:"Talks to models through the Vercel AI Gateway — no provider SDK needed."},{name:"open",kind:"library",desc:"Launches the dashboard in your browser after a run."}]}];function sG({kind:e}){return(0,eT.jsx)("span",{className:"live"===e?"shrink-0 rounded-sm bg-foreground px-1.5 py-0.5 font-mono text-[9px] font-medium uppercase tracking-wide text-background":"shrink-0 rounded-sm border border-border px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-wide text-muted-foreground",children:sW[e]})}function sK({group:e}){let t=e.icon;return(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-start gap-2",children:[(0,eT.jsx)(t,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("h3",{className:"font-mono text-sm font-semibold text-foreground",children:e.title}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:e.blurb})]})]}),(0,eT.jsx)("ul",{className:"flex flex-col gap-2 border-l border-border pl-4",children:e.tools.map(e=>(0,eT.jsxs)("li",{className:"flex flex-col gap-1 rounded-sm border border-border bg-card/50 px-3 py-2.5",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,eT.jsx)("span",{className:"font-mono text-xs font-semibold text-foreground",children:e.name}),(0,eT.jsx)(sG,{kind:e.kind})]}),(0,eT.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:e.desc}),e.detail&&(0,eT.jsx)("code",{className:"mt-0.5 w-fit rounded-sm bg-muted px-1.5 py-0.5 font-mono text-[11px] text-foreground/80",children:e.detail})]},e.name))})]})}function sJ(){let[e,t]=(0,eP.useState)(!1);return(0,eT.jsxs)(sO,{open:e,onOpenChange:t,children:[(0,eT.jsxs)(sM,{"aria-label":"How to use CodeLens",className:"inline-flex h-9 items-center gap-1.5 rounded-sm border border-border bg-card px-3 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:[(0,eT.jsx)(se,{className:"size-4"}),(0,eT.jsx)("span",{className:"hidden sm:inline",children:"Guide"})]}),(0,eT.jsxs)(sL,{className:"max-h-[85svh] gap-0 overflow-y-auto sm:max-w-2xl",children:[(0,eT.jsxs)(sU,{className:"border-b border-border pb-4",children:[(0,eT.jsx)(sZ,{className:"font-mono",children:"Using the CodeLens CLI"}),(0,eT.jsx)(sF,{children:"CodeLens runs your real ESLint, TypeScript, and dependency-audit toolchain locally, then streams the results into this dashboard."})]}),(0,eT.jsxs)(nb,{defaultValue:"guide",className:"py-5",children:[(0,eT.jsxs)(nj,{className:"mb-2 w-full",children:[(0,eT.jsxs)(nw,{value:"guide",className:"flex-1",children:[(0,eT.jsx)(i2,{className:"size-3.5"}),"Getting started"]}),(0,eT.jsxs)(nw,{value:"toolchain",className:"flex-1",children:[(0,eT.jsx)(sa,{className:"size-3.5"}),"Toolchain"]})]}),(0,eT.jsx)(nN,{value:"guide",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,eT.jsxs)(sV,{icon:st,title:"1 · Install",children:[(0,eT.jsx)("p",{className:"text-sm text-muted-foreground",children:"Try it instantly with no install:"}),(0,eT.jsx)(sB,{children:"npx codelens"}),(0,eT.jsx)("p",{className:"text-sm text-muted-foreground",children:"Or add it as a dev dependency to pin a version per project:"}),(0,eT.jsx)(sB,{children:`pnpm add -D codelens
2
+ # then add to package.json scripts: "lens": "codelens"`})]}),(0,eT.jsxs)(sV,{icon:eH,title:"2 · Configure the AI key",children:[(0,eT.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Lint and type checks need no key. The AI security audit reads an API key from your environment or a local ",(0,eT.jsx)("code",{className:"rounded-sm bg-muted px-1 py-0.5 font-mono text-xs",children:".codelens.json"}),":"]}),(0,eT.jsx)(sB,{children:"export AI_GATEWAY_API_KEY=your_key_here"})]}),(0,eT.jsxs)(sV,{icon:i2,title:"3 · Run it in your project",children:[(0,eT.jsxs)("p",{className:"text-sm text-muted-foreground",children:["From the root of any JS/TS project (Next.js, SvelteKit, Vue, …). CodeLens auto-detects the framework and package manager, runs every check, and opens the dashboard at"," ",(0,eT.jsx)("code",{className:"rounded-sm bg-muted px-1 py-0.5 font-mono text-xs",children:"localhost:4321"}),":"]}),(0,eT.jsx)(sB,{children:"cd my-app && codelens"})]}),(0,eT.jsx)(sV,{icon:sn,title:"Flags",children:(0,eT.jsx)("ul",{className:"flex flex-col gap-2",children:sq.map(e=>(0,eT.jsxs)("li",{className:"flex flex-col gap-0.5 sm:flex-row sm:gap-3",children:[(0,eT.jsx)("code",{className:"shrink-0 font-mono text-xs text-foreground sm:w-28",children:e.flag}),(0,eT.jsx)("span",{className:"text-sm text-muted-foreground",children:e.desc})]},e.flag))})}),(0,eT.jsxs)(sV,{icon:e2,title:"In CI",children:[(0,eT.jsx)("p",{className:"text-sm text-muted-foreground",children:"The same engine drops into GitHub Actions. Fail the build when quality regresses:"}),(0,eT.jsx)(sB,{children:`- run: npx codelens --ci --no-ai
3
+ # exits non-zero past your configured thresholds`})]}),(0,eT.jsxs)(sV,{icon:sr,title:"Track & triage in the dashboard",children:[(0,eT.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Every finding has a ",(0,eT.jsx)("span",{className:"font-mono text-foreground",children:"Track task"})," action — in its detail sheet and inline on each list row. Tracking a finding adds it to the"," ",(0,eT.jsx)("span",{className:"font-mono text-foreground",children:"Task Manager"}),"board and marks the row with a dot so you can see at a glance what's already on your worklist."]}),(0,eT.jsxs)("ul",{className:"flex flex-col gap-1.5 text-sm text-muted-foreground",children:[(0,eT.jsxs)("li",{children:[(0,eT.jsx)("span",{className:"text-foreground",children:"Custom columns"})," — rename or delete the defaults (To do / In progress / Done) and add your own. Drag cards between columns to update status."]}),(0,eT.jsxs)("li",{children:[(0,eT.jsx)("span",{className:"text-foreground",children:"Groups"}),"— file tasks under tags like “This sprint” or “Tech debt” and filter the board by them."]}),(0,eT.jsxs)("li",{children:[(0,eT.jsx)("span",{className:"text-foreground",children:"Detail"})," — click a tracked finding to reopen its full analysis; click a free-form task to edit its column, priority, group, and notes."]})]}),(0,eT.jsxs)("p",{className:"text-sm text-muted-foreground",children:["The board lives only in your browser — it never leaves your machine or reaches the CLI. Manage or reset it from ",(0,eT.jsx)("span",{className:"font-mono text-foreground",children:"Settings → Data & storage"}),"."]})]})]})}),(0,eT.jsx)(nN,{value:"toolchain",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,eT.jsxs)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:["Every scan is powered by a real tool — there are no black boxes. Checks marked"," ",(0,eT.jsx)("span",{className:"font-mono text-foreground",children:"runs in your repo"}),"execute your project's own binaries; ",(0,eT.jsx)("span",{className:"font-mono text-foreground",children:"static scan"})," analyzers read your source directly; and the ",(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 font-mono text-foreground",children:[(0,eT.jsx)(e4,{className:"size-3"}),"AI review"]})," ","uses the Vercel AI Gateway."]}),sH.map(e=>(0,eT.jsx)(sK,{group:e},e.title)),(0,eT.jsxs)("div",{className:"flex items-start gap-2 rounded-sm border border-border bg-muted/40 px-3 py-2.5",children:[(0,eT.jsx)(eW,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:["Nothing leaves your machine except the AI calls. Source snippets sent for the security review can be scrubbed of secrets first — toggle"," ",(0,eT.jsx)("span",{className:"font-mono text-foreground",children:"Redact secrets"})," under"," ",(0,eT.jsx)("span",{className:"font-mono text-foreground",children:"Settings → AI security audit"}),"."]})]})]})})]})]})]})}let sY=eL("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]),sX=eL("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);var sQ=e.i(82031);function s0({className:e}){let{resolvedTheme:t,setTheme:n}=(0,sQ.useTheme)(),[r,i]=(0,eP.useState)(!1);(0,eP.useEffect)(()=>i(!0),[]);let a="dark"===t;return(0,eT.jsx)("button",{type:"button","aria-label":"Toggle color theme",onClick:()=>n(a?"light":"dark"),className:(0,ny.cn)("inline-flex size-9 items-center justify-center rounded-sm border border-border bg-card text-muted-foreground transition-colors hover:text-foreground",e),children:r?a?(0,eT.jsx)(sX,{className:"size-4"}):(0,eT.jsx)(sY,{className:"size-4"}):(0,eT.jsx)(sX,{className:"size-4"})})}function s1({project:e,aiEnabled:t,lastRunMs:n,lastRunLabel:r,empty:i,demoActive:a,onToggleDemo:s,onOpenSearch:o,onRunChecks:l}){return(0,eT.jsxs)("header",{className:"sticky top-0 z-20 flex h-16 shrink-0 items-center justify-between gap-3 border-b border-border bg-card/80 px-4 backdrop-blur supports-[backdrop-filter]:bg-card/60 sm:px-6",children:[(0,eT.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 lg:hidden",children:[(0,eT.jsx)("div",{className:"flex size-8 shrink-0 items-center justify-center rounded-sm border border-border text-foreground",children:(0,eT.jsx)(e2,{className:"size-4"})}),(0,eT.jsx)("span",{className:"font-mono text-sm font-semibold text-foreground",children:"CodeLens"}),t&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] uppercase text-foreground",children:[(0,eT.jsx)(e4,{className:"size-2.5"}),"AI"]})]}),(0,eT.jsx)("p",{className:"hidden min-w-0 truncate font-mono text-xs text-muted-foreground lg:block",children:i?a?"Demo data · sample project":"No analysis yet":`${e.framework} \xb7 ${e.packageManager} \xb7 ${e.root}`})]}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[null!=n&&(0,eT.jsxs)("span",{className:"mr-1 hidden items-center gap-1.5 font-mono text-xs text-muted-foreground sm:inline-flex",children:[(0,eT.jsx)(i4,{className:"size-3.5"}),"last run ",r??`${(n/1e3).toFixed(1)}s`]}),(0,eT.jsxs)("div",{className:"inline-flex items-stretch",children:[(0,eT.jsxs)("button",{type:"button",onClick:l,className:"inline-flex items-center gap-2 rounded-l-sm bg-primary px-4 py-2 font-mono text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:[(0,eT.jsx)(i2,{className:"size-4"}),(0,eT.jsx)("span",{className:"hidden sm:inline",children:"Run checks"})]}),(0,eT.jsxs)(a5,{children:[(0,eT.jsx)(a6,{"aria-label":"Run options",className:"inline-flex items-center justify-center rounded-r-sm border-l border-primary-foreground/20 bg-primary px-2 text-primary-foreground transition-colors hover:bg-primary/90",children:(0,eT.jsx)(iV,{className:"size-4"})}),(0,eT.jsx)(a3,{align:"end",className:"w-56",children:a?(0,eT.jsxs)(a8,{onClick:()=>s?.(!1),children:[(0,eT.jsx)(i5,{className:"size-4"}),(0,eT.jsx)("span",{children:"Clear demo data"})]}):(0,eT.jsxs)(a8,{onClick:()=>s?.(!0),children:[(0,eT.jsx)(e1,{className:"size-4"}),(0,eT.jsx)("span",{children:"Load demo data"})]})})]})]}),o&&(0,eT.jsx)("button",{type:"button",onClick:o,"aria-label":"Search",className:"inline-flex size-9 items-center justify-center rounded-sm border border-border bg-card text-muted-foreground transition-colors hover:text-foreground",children:(0,eT.jsx)(eX,{className:"size-4"})}),(0,eT.jsx)(sJ,{}),(0,eT.jsx)(s0,{})]})]})}let s2=eL("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]),s4=eL("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]),s5=eL("file-exclamation-point",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),s6=eL("circle-arrow-up",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]),s3=eL("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]),s9=eL("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);function s8({className:e,size:t="default",...n}){return(0,eT.jsx)("div",{"data-slot":"card","data-size":t,className:(0,ny.cn)("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",e),...n})}e.s([],22093),e.i(22093);let s7=new Map;function oe(e,t,n){return null==e?"":(function(e,t){let n=JSON.stringify({locale:e,options:t}),r=s7.get(n);if(r)return r;let i=new Intl.NumberFormat(e,t);return s7.set(n,i),i})(t,n).format(e)}let ot=eP.createContext(void 0);function on(){let e=eP.useContext(ot);if(void 0===e)throw Error((0,tm.default)(51));return e}let or=((f={}).complete="data-complete",f.indeterminate="data-indeterminate",f.progressing="data-progressing",f),oi={status:e=>"progressing"===e?{[or.progressing]:""}:"complete"===e?{[or.complete]:""}:"indeterminate"===e?{[or.indeterminate]:""}:null};function oa(e,t){return null==t?"indeterminate progress":e||`${t}%`}let os=eP.forwardRef(function(e,t){var n;let{format:r,getAriaValueText:i=oa,locale:a,max:s=100,min:o=0,value:l,render:d,className:c,children:u,style:m,...p}=e,[f,h]=eP.useState(),g=(0,nC.useValueAsRef)(r),x="indeterminate";Number.isFinite(l)&&(x=l===s?"complete":"progressing");let v=(n=g.current,null==l?"":n?oe(l,a,n):oe(l/100,a,{style:"percent"})),y=eP.useMemo(()=>({status:x}),[x]),b={"aria-labelledby":f,"aria-valuemax":s,"aria-valuemin":o,"aria-valuenow":l??void 0,"aria-valuetext":i(v,l),role:"progressbar",children:(0,eT.jsxs)(eP.Fragment,{children:[u,(0,eT.jsx)("span",{role:"presentation",style:n$.visuallyHidden,children:"x"})]})},k=eP.useMemo(()=>({formattedValue:v,max:s,min:o,setLabelId:h,state:y,status:x,value:l}),[v,s,o,h,y,x,l]),j=(0,ta.useRenderElement)("div",e,{state:y,ref:t,props:[b,p],stateAttributesMapping:oi});return(0,eT.jsx)(ot.Provider,{value:k,children:j})}),oo=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:s}=on();return(0,ta.useRenderElement)("div",e,{state:s,ref:t,props:a,stateAttributesMapping:oi})}),ol=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{max:s,min:o,value:l,state:d}=on(),c=Number.isFinite(l)&&null!==l?(l-o)*100/(s-o):null,u=null==c?{}:{insetInlineStart:0,height:"inherit",width:`${c}%`};return(0,ta.useRenderElement)("div",e,{state:d,ref:t,props:[{style:u},a],stateAttributesMapping:oi})}),od=eP.forwardRef(function(e,t){let{className:n,render:r,children:i,style:a,...s}=e,{value:o,formattedValue:l,state:d}=on(),c=null==o?"indeterminate":l,u=null==o?null:l;return(0,ta.useRenderElement)("span",e,{state:d,ref:t,props:[{"aria-hidden":!0,children:"function"==typeof i?i(c,o):u},s],stateAttributesMapping:oi})}),oc=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...s}=e,{setLabelId:o,state:l}=on(),d=rj(a,o);return(0,ta.useRenderElement)("span",e,{state:l,ref:t,props:[{id:d,role:"presentation"},s],stateAttributesMapping:oi})});e.s(["Indicator",0,ol,"Label",0,oc,"Root",0,os,"Track",0,oo,"Value",0,od],63172);var ou=e.i(63172),ou=ou;function om({className:e,children:t,value:n,...r}){return(0,eT.jsxs)(ou.Root,{value:n,"data-slot":"progress",className:(0,ny.cn)("flex flex-wrap gap-3",e),...r,children:[t,(0,eT.jsx)(op,{children:(0,eT.jsx)(of,{})})]})}function op({className:e,...t}){return(0,eT.jsx)(ou.Track,{className:(0,ny.cn)("relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted",e),"data-slot":"progress-track",...t})}function of({className:e,...t}){return(0,eT.jsx)(ou.Indicator,{"data-slot":"progress-indicator",className:(0,ny.cn)("h-full bg-primary transition-all",e),...t})}function oh({score:e,grade:t,size:n=160}){let r=(n-12)/2,i=2*Math.PI*r,a=e>=80?"var(--sev-ok)":e>=60?"var(--sev-medium)":e>=40?"var(--sev-high)":"var(--sev-critical)";return(0,eT.jsxs)("div",{className:"relative inline-flex items-center justify-center",style:{width:n,height:n},children:[(0,eT.jsxs)("svg",{width:n,height:n,className:"-rotate-90",children:[(0,eT.jsx)("circle",{cx:n/2,cy:n/2,r:r,fill:"none",stroke:"var(--border)",strokeWidth:12}),(0,eT.jsx)("circle",{cx:n/2,cy:n/2,r:r,fill:"none",stroke:a,strokeWidth:12,strokeLinecap:"round",strokeDasharray:i,strokeDashoffset:i-e/100*i,style:{transition:"stroke-dashoffset 0.8s ease-out, stroke 0.4s ease"}})]}),(0,eT.jsxs)("div",{className:"absolute flex flex-col items-center",children:[(0,eT.jsx)("span",{className:"font-mono text-4xl font-semibold tabular-nums",style:{color:a},children:e}),(0,eT.jsxs)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:["Grade ",t]})]})]})}function og({data:e,height:t=120}){if(e.length<2)return(0,eT.jsx)("div",{className:"text-xs text-muted-foreground",children:"Not enough runs yet to show a trend."});let n=Math.min(40,...e.map(e=>e.score))-5,r=100-n||1,i=e.map((i,a)=>({x:a/(e.length-1)*100,y:t-(i.score-n)/r*t,d:i})),a=i.map((e,t)=>`${0===t?"M":"L"} ${e.x} ${e.y}`).join(" "),s=`${a} L 100 ${t} L 0 ${t} Z`,o=i[i.length-1];return(0,eT.jsxs)("svg",{viewBox:`0 0 100 ${t}`,preserveAspectRatio:"none",className:"h-[120px] w-full overflow-visible",role:"img","aria-label":"Health score trend over recent runs",children:[(0,eT.jsx)("defs",{children:(0,eT.jsxs)("linearGradient",{id:"trendFill",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,eT.jsx)("stop",{offset:"0%",stopColor:"var(--sev-ok)",stopOpacity:"0.35"}),(0,eT.jsx)("stop",{offset:"100%",stopColor:"var(--sev-ok)",stopOpacity:"0"})]})}),(0,eT.jsx)("path",{d:s,fill:"url(#trendFill)"}),(0,eT.jsx)("path",{d:a,fill:"none",stroke:"var(--sev-ok)",strokeWidth:"1.5",vectorEffect:"non-scaling-stroke"}),(0,eT.jsx)("circle",{cx:o.x,cy:o.y,r:"2.5",fill:"var(--sev-ok)",vectorEffect:"non-scaling-stroke"})]})}let ox=eL("clipboard-check",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]),ov=eL("clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]),oy={critical:28,error:22,high:16,medium:8,warning:7,low:3,info:1};function ob(e){let t=100;for(let n of e)t-=oy[n]??4;return Math.max(0,Math.min(100,Math.round(t)))}function ok(e,t){let{lint:n,types:r,security:i,deps:a}=e,{env:s,network:o,git:l,docs:d,database:c,accessibility:u,performance:m,tests:p}=t,f=ob(n.messages.map(e=>e.severity)),h=ob(r.diagnostics.map(()=>"error")),g=ob([...i.findings.map(e=>e.severity),...i.dependencies.map(e=>e.severity)]),x=ob(a.findings.map(e=>e.severity)),v=ob(c.findings.map(e=>e.severity)),y=s.variables.filter(e=>"ok"!==e.status),b=ob(y.map(e=>e.severity)),k=o.calls.flatMap(e=>e.issues.map(e=>e.severity)),j=ob(k);ob([...l.issues,...l.workflows.flatMap(e=>e.issues)].map(e=>e.severity));let w=d.standards.flatMap(e=>e.checks),N=w.filter(e=>"fail"===e.status||"warn"===e.status),_=w.length?Math.round(w.filter(e=>"pass"===e.status).length/w.length*100):100,S=u.score,$=m.score,I=p.counts.total?p.counts.passed/p.counts.total:1,E=Math.max(0,Math.min(100,Math.round(.5*p.coverage.lines+100*I*.5-3*p.counts.failed))),C=[{key:"security",label:"Security",weight:.2,score:g,issues:i.findings.length+i.dependencies.length,detail:"findings + vuln deps"},{key:"types",label:"Types",weight:.12,score:h,issues:r.diagnostics.length,detail:"tsc diagnostics"},{key:"deps",label:"Dependencies",weight:.12,score:x,issues:a.findings.length,detail:"outdated, unused, vulns"},{key:"lint",label:"Lint",weight:.1,score:f,issues:n.messages.length,detail:"errors + warnings"},{key:"database",label:"Database",weight:.1,score:v,issues:c.findings.length,detail:"query + schema issues"},{key:"tests",label:"Tests",weight:.1,score:E,issues:p.counts.failed,detail:`${p.coverage.lines}% line coverage`},{key:"perf",label:"Performance",weight:.08,score:$,issues:m.findings.length,detail:"bundle + web vitals"},{key:"a11y",label:"Accessibility",weight:.08,score:S,issues:u.violations.length,detail:"WCAG violations"},{key:"env",label:"Environment",weight:.04,score:b,issues:y.length,detail:"config + secrets"},{key:"network",label:"Network",weight:.03,score:j,issues:k.length,detail:"outbound requests"},{key:"docs",label:"Documentation",weight:.03,score:_,issues:N.length,detail:"agent readiness"}],A=C.reduce((e,t)=>e+t.weight,0)||1,T=Math.round(C.reduce((e,t)=>e+t.score*t.weight,0)/A);return{score:T,grade:T>=95?"A+":T>=90?"A":T>=80?"B":T>=70?"C":T>=60?"D":"F",categories:C}}function oj(e,t){let n=ok(e,t),{project:r}=e.meta,i=new Date(e.meta.finishedAt||Date.now()).toISOString().slice(0,16).replace("T"," "),a=[];for(let e of(a.push("# CodeLens Report"),a.push(""),a.push(`**Project:** \`${r.root}\` `),a.push(`**Stack:** ${r.framework} \xb7 ${r.packageManager} `),a.push(`**Generated:** ${i} UTC `),a.push(`**Health:** ${n.score}/100 (Grade ${n.grade})`),a.push(""),a.push("## Health breakdown"),a.push(""),a.push("| Surface | Score | Weight | Issues |"),a.push("| --- | --: | --: | --: |"),n.categories))a.push(`| ${e.label} | ${e.score} | ${Math.round(100*e.weight)}% | ${e.issues} |`);a.push("");let s=e.security,o=s.findings.filter(e=>"critical"===e.severity).length,l=s.findings.filter(e=>"high"===e.severity).length;if(a.push("## Summary"),a.push(""),a.push(`- **Lint:** ${e.lint.errorCount} errors, ${e.lint.warningCount} warnings (${e.lint.fixableCount} auto-fixable)`),a.push(`- **Types:** ${e.types.diagnostics.length} diagnostics`),a.push(`- **Security:** ${s.findings.length} findings (${o} critical, ${l} high), ${s.dependencies.length} vulnerable deps`),a.push(`- **Dependencies:** ${e.deps.findings.length} findings across ${e.deps.counts.total} packages`),a.push(`- **Database:** ${t.database.findings.length} findings`),a.push(`- **Accessibility:** score ${t.accessibility.score}, ${t.accessibility.violations.length} violations`),a.push(`- **Performance:** score ${t.performance.score}, ${t.performance.findings.length} findings, ${t.performance.totalBundleKb} KB first load`),a.push(`- **Tests:** ${t.tests.counts.passed}/${t.tests.counts.total} passing, ${t.tests.coverage.lines}% line coverage`),a.push(`- **Environment:** ${t.env.counts.issues} issues`),a.push(`- **Network:** ${t.network.counts.issues} issues across ${t.network.counts.total} calls`),a.push(""),s.findings.length){for(let e of(a.push("## Security findings"),a.push(""),[...s.findings].sort((e,t)=>ow(t.severity)-ow(e.severity)).slice(0,15)))a.push(`- \`${e.severity.toUpperCase()}\` **${e.title}** — ${e.filePath}:${e.line}`);a.push("")}let d=t.tests.findings.filter(e=>"failing"===e.kind);if(d.length){for(let e of(a.push("## Failing tests"),a.push(""),d))a.push(`- **${e.title}** — ${e.filePath}:${e.line??1}`);a.push("")}if(t.accessibility.violations.length){for(let e of(a.push("## Accessibility violations"),a.push(""),t.accessibility.violations))a.push(`- \`${e.impact.toUpperCase()}\` **${e.rule}** (${e.principle}) — ${e.filePath}:${e.line}`);a.push("")}return a.push("---"),a.push("_Generated by CodeLens._"),a.push(""),a.join("\n")}function ow(e){return({critical:6,error:5,high:4,warning:3,medium:3,low:2,info:1})[e]??1}function oN(e,t,n){let r=new Blob([t],{type:n}),i=URL.createObjectURL(r),a=document.createElement("a");a.href=i,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)}function o_({report:e,insights:t}){let[n,r]=(0,eP.useState)(!1),i=e.meta.project.root.split("/").filter(Boolean).pop()?.replace(/[^a-z0-9]+/gi,"-")||"project",a=new Date().toISOString().slice(0,10);function s(){oN(`codelens-${i}-${a}.md`,oj(e,t),"text/markdown")}async function o(){try{await navigator.clipboard.writeText(oj(e,t)),r(!0),setTimeout(()=>r(!1),1800)}catch{s()}}return(0,eT.jsxs)(a5,{children:[(0,eT.jsxs)(a6,{className:"inline-flex items-center gap-2 rounded-sm border border-border bg-card px-3 py-2 text-xs font-medium text-foreground transition-colors hover:bg-secondary",children:[(0,eT.jsx)(st,{className:"size-3.5"}),"Export report",(0,eT.jsx)(iV,{className:"size-3.5 text-muted-foreground"})]}),(0,eT.jsxs)(a3,{align:"end",className:"w-52",children:[(0,eT.jsxs)(a8,{onClick:s,children:[(0,eT.jsx)(eZ,{className:"size-4"}),(0,eT.jsx)("span",{children:"Markdown (.md)"})]}),(0,eT.jsxs)(a8,{onClick:function(){let n;oN(`codelens-${i}-${a}.json`,(n=ok(e,t),JSON.stringify({generatedAt:new Date().toISOString(),project:e.meta.project,health:n,report:e,insights:t},null,2)),"application/json")},children:[(0,eT.jsx)(eF,{className:"size-4"}),(0,eT.jsx)("span",{children:"JSON (.json)"})]}),(0,eT.jsx)(a7,{}),(0,eT.jsxs)(a8,{closeOnClick:!1,onClick:o,children:[n?(0,eT.jsx)(ox,{className:"size-4 text-[color:var(--sev-ok)]"}):(0,eT.jsx)(ov,{className:"size-4"}),(0,eT.jsx)("span",{children:n?"Copied to clipboard":"Copy as Markdown"})]})]})]})}function oS({title:e,action:t,children:n,className:r}){return(0,eT.jsxs)(s8,{className:(0,ny.cn)("gap-0 overflow-hidden py-0",r),children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between border-b border-border bg-secondary/30 px-3 py-2",children:[(0,eT.jsx)("h3",{className:"font-mono text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:e}),t]}),(0,eT.jsx)("div",{className:"p-3",children:n})]})}function o$({segments:e}){let t=e.reduce((e,t)=>e+t.value,0)||1;return(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)("div",{className:"flex h-2 w-full overflow-hidden rounded-sm border border-border",children:e.map(e=>e.value>0?(0,eT.jsx)("div",{style:{width:`${e.value/t*100}%`,background:e.color},title:`${e.label}: ${e.value}`},e.label):null)}),(0,eT.jsx)("ul",{className:"flex flex-col gap-1.5",children:e.map(e=>(0,eT.jsxs)("li",{className:"flex items-center justify-between text-xs",children:[(0,eT.jsxs)("span",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"size-2 shrink-0 rounded-[2px]",style:{background:e.color},"aria-hidden":!0}),(0,eT.jsx)("span",{className:"text-muted-foreground",children:e.label})]}),(0,eT.jsx)("span",{className:"font-mono tabular-nums text-foreground",children:e.value})]},e.label))})]})}function oI({rows:e,emptyLabel:t="Nothing to show",activeKey:n,onSelect:r}){if(0===e.length)return(0,eT.jsx)("p",{className:"text-xs text-muted-foreground",children:t});let i=Math.max(...e.map(e=>e.count),1);return(0,eT.jsx)("ul",{className:"flex flex-col gap-1",children:e.map(e=>{let t=n===e.key,a=(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsx)("span",{className:"absolute inset-y-0 left-0 -z-0 bg-foreground/[0.06]",style:{width:`${e.count/i*100}%`},"aria-hidden":!0}),(0,eT.jsxs)("span",{className:"relative z-10 flex min-w-0 flex-1 flex-col",children:[(0,eT.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:e.label}),e.hint&&(0,eT.jsx)("span",{className:"truncate text-[10px] text-muted-foreground",children:e.hint})]}),(0,eT.jsx)("span",{className:"relative z-10 ml-2 font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]}),s="relative flex items-center overflow-hidden rounded-sm px-2 py-1.5 text-left transition-colors";return(0,eT.jsx)("li",{children:r?(0,eT.jsx)("button",{type:"button",onClick:()=>r(e.key),className:(0,ny.cn)(s,"w-full",t?"ring-1 ring-ring":"hover:bg-secondary/50"),children:a}):(0,eT.jsx)("div",{className:s,children:a})},e.key)})})}let oE=eL("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),oC=eL("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),oA=eL("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),oT=eL("list-tree",[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]]),oP=eL("square-arrow-out-up-right",[["path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6",key:"y09zxi"}],["path",{d:"m21 3-9 9",key:"mpx6sq"}],["path",{d:"M15 3h6v6",key:"1q9fwt"}]]),oz=eL("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),oO=eL("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var sC=sC;function oM({...e}){return(0,eT.jsx)(sC.Root,{"data-slot":"sheet",...e})}function oR({...e}){return(0,eT.jsx)(sC.Portal,{"data-slot":"sheet-portal",...e})}function oD({className:e,...t}){return(0,eT.jsx)(sC.Backdrop,{"data-slot":"sheet-overlay",className:(0,ny.cn)("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",e),...t})}function oL({className:e,children:t,side:n="right",showCloseButton:r=!0,...i}){return(0,eT.jsxs)(oR,{children:[(0,eT.jsx)(oD,{}),(0,eT.jsxs)(sC.Popup,{"data-slot":"sheet-content","data-side":n,className:(0,ny.cn)("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",e),...i,children:[t,r&&(0,eT.jsxs)(sC.Close,{"data-slot":"sheet-close",render:(0,eT.jsx)(sP,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[(0,eT.jsx)(sz,{}),(0,eT.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function oU({className:e,...t}){return(0,eT.jsx)("div",{"data-slot":"sheet-header",className:(0,ny.cn)("flex flex-col gap-0.5 p-4",e),...t})}function oZ({className:e,...t}){return(0,eT.jsx)(sC.Title,{"data-slot":"sheet-title",className:(0,ny.cn)("text-base font-medium text-foreground",e),...t})}function oF({className:e,...t}){return(0,eT.jsx)(sC.Description,{"data-slot":"sheet-description",className:(0,ny.cn)("text-sm text-muted-foreground",e),...t})}let oB={critical:{label:"Critical",text:"text-[color:var(--sev-critical)]",bg:"bg-[color:var(--sev-critical)]/12",border:"border-[color:var(--sev-critical)]/55",dot:"bg-[color:var(--sev-critical)]",rank:6},error:{label:"Error",text:"text-[color:var(--sev-critical)]",bg:"bg-[color:var(--sev-critical)]/12",border:"border-[color:var(--sev-critical)]/55",dot:"bg-[color:var(--sev-critical)]",rank:5},high:{label:"High",text:"text-[color:var(--sev-high)]",bg:"bg-[color:var(--sev-high)]/12",border:"border-[color:var(--sev-high)]/55",dot:"bg-[color:var(--sev-high)]",rank:4},warning:{label:"Warning",text:"text-[color:var(--sev-medium)]",bg:"bg-[color:var(--sev-medium)]/12",border:"border-[color:var(--sev-medium)]/55",dot:"bg-[color:var(--sev-medium)]",rank:3},medium:{label:"Medium",text:"text-[color:var(--sev-medium)]",bg:"bg-[color:var(--sev-medium)]/12",border:"border-[color:var(--sev-medium)]/55",dot:"bg-[color:var(--sev-medium)]",rank:3},low:{label:"Low",text:"text-[color:var(--sev-low)]",bg:"bg-[color:var(--sev-low)]/12",border:"border-[color:var(--sev-low)]/55",dot:"bg-[color:var(--sev-low)]",rank:2},info:{label:"Info",text:"text-[color:var(--sev-info)]",bg:"bg-[color:var(--sev-info)]/12",border:"border-[color:var(--sev-info)]/55",dot:"bg-[color:var(--sev-info)]",rank:1}};function oV(e){return oB[e]??oB.info}function oq(e,t){return oV(t.severity).rank-oV(e.severity).rank}let oW={"app/api/orders/route.ts":`import { NextRequest, NextResponse } from "next/server"
4
+ import { sql } from "@/lib/db"
5
+ import { auth } from "@/lib/auth"
6
+
7
+ // GET /api/orders?email=... — returns a customer's orders
8
+ export async function GET(req: NextRequest) {
9
+ const start = Date.now()
10
+
11
+ if (req.method !== "GET") {
12
+ return NextResponse.json({ error: "method" }, { status: 405 })
13
+ }
14
+
15
+ // TODO: remove debug logging before shipping
16
+ const ua = req.headers.get("user-agent")
17
+ console.log("orders request", ua)
18
+
19
+ const session = await auth()
20
+
21
+ // Pull the lookup key straight from the query string.
22
+ // No check that the session user actually owns these orders.
23
+ const params = req.nextUrl.searchParams
24
+ const email = params.get("email")
25
+
26
+ // Later we read session.user without verifying it exists
27
+ const owner = session.user.email
28
+
29
+ // Build the query by interpolating user input directly.
30
+ const rows = await sql(
31
+ \`SELECT * FROM orders
32
+ WHERE email = '\${email}'
33
+ ORDER BY created_at DESC\`,
34
+ )
35
+
36
+ const elapsed = Date.now() - start
37
+
38
+ // Loose equality + magic status code
39
+ const ok = rows.length
40
+ if (ok == 0) {
41
+ return NextResponse.json({ orders: [] })
42
+ }
43
+
44
+ return NextResponse.json({ orders: rows, owner, ms: elapsed })
45
+ }
46
+ `,"lib/cart.ts":`import { db } from "./db"
47
+ import { syncCartToServer } from "./sync"
48
+
49
+ export interface CartItem {
50
+ id: string
51
+ price: number
52
+ qty: number
53
+ }
54
+
55
+ // Add an item and kick off a background sync.
56
+ export function addItem(id: string) {
57
+ syncCartToServer(id)
58
+ }
59
+
60
+ export function findItem(items: CartItem[], id?: string) {
61
+ // \`id\` may be undefined but lookupById expects a string
62
+ return items.find((i) =>
63
+ matchesId(i, lookupById(id)),
64
+ )
65
+ }
66
+
67
+ function matchesId(item: CartItem, id: string) {
68
+ return item.id === id
69
+ }
70
+
71
+ function lookupById(id: string) {
72
+ return id.trim()
73
+ }
74
+
75
+ export function cartTotal(items: CartItem[]) {
76
+ let total = items.reduce((s, i) => s + i.price, 0)
77
+ return total
78
+ }
79
+ `,"components/checkout-form.tsx":`import { useState } from "react"
80
+ import { PriceInput } from "@/components/price-input"
81
+ import { submitOrder } from "@/lib/orders"
82
+
83
+ interface CheckoutFormProps {
84
+ cartTotal: number
85
+ onComplete: (orderId: string) => void
86
+ }
87
+
88
+ export function CheckoutForm({ cartTotal, onComplete }: CheckoutFormProps) {
89
+ const [email, setEmail] = useState("")
90
+ const [name, setName] = useState("")
91
+ const [address, setAddress] = useState("")
92
+ const [amount, setAmount] = useState(cartTotal)
93
+ const [submitting, setSubmitting] = useState(false)
94
+
95
+ async function handleSubmit(e: React.FormEvent) {
96
+ e.preventDefault()
97
+ setSubmitting(true)
98
+ try {
99
+ const id = await submitOrder({ email, name, address, amount })
100
+ onComplete(id)
101
+ } finally {
102
+ setSubmitting(false)
103
+ }
104
+ }
105
+
106
+ return (
107
+ <form onSubmit={handleSubmit} className="checkout">
108
+ <fieldset>
109
+ <legend>Contact</legend>
110
+
111
+ <label htmlFor="email">Email</label>
112
+ <input
113
+ id="email"
114
+ type="email"
115
+ value={email}
116
+ onChange={(e) => setEmail(e.target.value)}
117
+ />
118
+
119
+ <label htmlFor="name">Full name</label>
120
+ <input
121
+ id="name"
122
+ value={name}
123
+ onChange={(e) => setName(e.target.value)}
124
+ />
125
+ </fieldset>
126
+
127
+ <fieldset>
128
+ <legend>Payment</legend>
129
+
130
+ <label htmlFor="amount">Amount</label>
131
+ <PriceInput
132
+ value={amount}
133
+ onChange={(v: string) => setAmount(v)}
134
+ id="amount"
135
+ />
136
+ </fieldset>
137
+
138
+ <fieldset>
139
+ <legend>Shipping</legend>
140
+
141
+ <label htmlFor="address">Address</label>
142
+ <textarea id="address" value={address}
143
+ onChange={(e) => setAddress(e.target.value)} />
144
+
145
+ <label>Gift wrapping</label>
146
+ <input type="checkbox" name="gift" />
147
+ </fieldset>
148
+
149
+ <button type="submit" disabled={submitting}>
150
+ {submitting ? "Processing…" : "Pay now"}
151
+ </button>
152
+ </form>
153
+ )
154
+ }
155
+
156
+ // Helper kept in the same module for brevity
157
+ export function formatErrors(errors: unknown) {
158
+ const list: string[] = []
159
+
160
+ if (Array.isArray(errors)) {
161
+ for (const err of errors) {
162
+ const e = err as any
163
+ list.push(e.message)
164
+ }
165
+ }
166
+
167
+ const fallback = (errors as any).message
168
+ if (fallback) {
169
+ list.push(fallback)
170
+ const extra = (errors as any).extra
171
+ }
172
+
173
+ return list
174
+ }
175
+ `,"app/products/[id]/page.tsx":`import { useState } from "react"
176
+ import { useProduct } from "@/hooks/use-product"
177
+ import { PriceTag } from "@/components/price-tag"
178
+ import { AddToCart } from "@/components/add-to-cart"
179
+
180
+ interface Props {
181
+ params: { id: string }
182
+ }
183
+
184
+ export default function ProductPage({ params }: Props) {
185
+ // Guard clause returns before hooks are declared.
186
+ if (!params.id) {
187
+ return null
188
+ }
189
+
190
+ // ...some derived values
191
+ const slug = params.id.toLowerCase()
192
+ const isPreview = slug.startsWith("preview-")
193
+
194
+ // Hook called conditionally — violates rules of hooks
195
+ if (isPreview) {
196
+ // preview mode
197
+ const [qty, setQty] = useState(1)
198
+ console.log(qty, setQty)
199
+ }
200
+
201
+ const { product: data, isLoading } = useProduct(params.id)
202
+
203
+ if (isLoading || !data) {
204
+ return <p>Loading…</p>
205
+ }
206
+
207
+ return (
208
+ <main className="product">
209
+ <header className="product__header">
210
+ <h1>{data.title}</h1>
211
+ <PriceTag value={data.price} />
212
+ </header>
213
+
214
+ <section className="product__body">
215
+ <ProductInfo data={data} />
216
+ </section>
217
+ </main>
218
+ )
219
+ }
220
+
221
+ function ProductInfo({ data }: { data: any }) {
222
+ const discount = data.discount ?? 0
223
+ const price = data.price
224
+
225
+ return (
226
+ <div className="product-info">
227
+ <PriceTag value={price} />
228
+
229
+ <AddToCart id={data.id} />
230
+
231
+ {/* Renders server HTML without sanitization */}
232
+ <div
233
+ className="prose"
234
+ dangerouslySetInnerHTML={{ __html: data.description }}
235
+ />
236
+ </div>
237
+ )
238
+ }
239
+ `,"hooks/use-product.ts":`import { useState, useEffect } from "react"
240
+ import useSWR from "swr"
241
+
242
+ export function useProduct(productId: string) {
243
+ const [views, setViews] = useState(0)
244
+
245
+ useEffect(() => {
246
+ trackView(productId)
247
+ setViews((v) => v + 1)
248
+ // missing dependency: productId
249
+ }, [])
250
+
251
+ const { data, error, isLoading } = useSWR(
252
+ productId ? \`/api/products/\${productId}\` : null,
253
+ fetcher,
254
+ )
255
+
256
+ return { product: data, error, isLoading, views }
257
+ }
258
+
259
+
260
+ import { fetcher } from "@/lib/fetcher"
261
+
262
+ function trackView(id: string) {
263
+ void fetch(\`/api/track?id=\${id}\`, { method: "POST" })
264
+ }
265
+ `,"lib/supabase.ts":`import { createClient } from "@supabase/supabase-js"
266
+
267
+ const url = process.env.NEXT_PUBLIC_SUPABASE_URL!
268
+ export const admin = createClient(url, process.env.NEXT_PUBLIC_SUPABASE_SERVICE_ROLE!)
269
+
270
+ export const db = createClient(url, process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!)
271
+ `,"lib/tokens.ts":`import crypto from "node:crypto"
272
+
273
+ // Generate a password-reset token for the given email.
274
+ export function createResetToken(email: string) {
275
+ const salt = process.env.TOKEN_SALT ?? "static-salt"
276
+
277
+ // MD5 is fast and collision-prone — unsuitable for security tokens.
278
+ return crypto
279
+ .createHash("md5")
280
+ .update(email + salt)
281
+ .digest("hex")
282
+ }
283
+
284
+ export function verifyToken(token: string, email: string) {
285
+ return token === createResetToken(email)
286
+ }
287
+ `,"package.json":`{
288
+ "name": "storefront",
289
+ "private": true,
290
+ "scripts": {
291
+ "dev": "next dev",
292
+ "build": "next build",
293
+ "start": "next start",
294
+ "lint": "next lint"
295
+ },
296
+ "dependencies": {
297
+ "next": "14.1.0",
298
+ "react": "18.2.0",
299
+ "react-dom": "18.2.0",
300
+ "axios": "1.6.2",
301
+ "@supabase/supabase-js": "2.39.0",
302
+ "lodash": "4.17.20",
303
+ "moment": "2.29.4",
304
+ "swr": "2.2.4"
305
+ },
306
+ "devDependencies": {
307
+ "typescript": "5.3.3",
308
+ "eslint": "8.56.0",
309
+ "@types/react": "18.2.0",
310
+ "node-sass": "7.0.3",
311
+ "request": "2.88.2"
312
+ }
313
+ }
314
+ `};function oH(e){return{source:"lint",severity:e.severity,title:e.message,filePath:e.filePath,line:e.line,column:e.column,endLine:e.endLine,ruleId:e.ruleId,fixable:e.fixable,description:e.message,snippet:e.snippet}}function oG(e){return{source:"types",severity:"error",title:e.message,filePath:e.filePath,line:e.line,column:e.column,code:e.code,description:e.message,related:e.related}}function oK(e){return{source:"security",severity:e.severity,title:e.title,filePath:e.filePath,line:e.line,endLine:e.endLine,category:e.category,confidence:e.confidence,description:e.description,recommendation:e.recommendation,suggestedFix:e.suggestedFix,snippet:e.snippet,reference:e.reference}}function oJ(e){return{source:"deps",severity:e.severity,title:e.title,filePath:"package.json",line:1,category:e.kind,description:e.detail,recommendation:e.recommendation,reference:e.reference,cves:e.cves,dep:{name:e.name,current:e.current,latest:e.latest,fixedIn:e.fixedIn,type:e.type,kind:e.kind,license:e.license,usedIn:e.usedIn}}}let oY={ok:"Configured correctly",missing:"Referenced but never defined",undocumented:"Missing from .env.example",unused:"Defined but never used",exposed:"Secret reachable from the client bundle",empty:"Defined with an empty value"};function oX(e){return{source:"env",severity:e.severity,title:`${e.key} — ${oY[e.status]??e.status}`,filePath:e.usedIn[0]??e.definedIn[0]??".env.local",line:1,category:e.status,description:e.note,recommendation:"exposed"===e.status?"Move this read into a Server Component, Route Handler, or Server Action. Never reference a non-NEXT_PUBLIC secret from client code.":"missing"===e.status?"Add the variable to .env.local (and .env.example) before it is read at runtime.":"undocumented"===e.status?"Add the key with a placeholder value and a comment to .env.example.":"unused"===e.status?"Remove the unused variable to reduce confusion and attack surface.":"empty"===e.status?"Provide a real value or guard the code path that reads it.":void 0,env:{key:e.key,scope:e.scope,status:e.status,usedIn:e.usedIn,definedIn:e.definedIn,sample:e.sample}}}function oQ(e){let t=[...e.issues].sort((e,t)=>o3(t.severity)-o3(e.severity))[0];return{source:"network",severity:t?.severity??"info",title:t?t.message:`${e.method} ${e.host}`,filePath:e.filePath,line:e.line,category:e.client,description:`${e.method} request to ${e.url} via ${e.client}.`+(e.issues.length?` ${e.issues.length} issue${1===e.issues.length?"":"s"} detected.`:" No issues detected."),recommendation:e.issues.map(e=>e.message).join(" "),net:{url:e.url,host:e.host,method:e.method,client:e.client,secure:e.secure,external:e.external,issues:e.issues}}}function o0(e){return{source:"database",severity:e.severity,title:e.title,filePath:e.filePath,line:e.line??1,category:e.kind,description:e.detail,recommendation:e.recommendation,snippet:e.snippet,db:{engine:e.engine,kind:e.kind,target:e.target}}}function o1(e){return{source:"git",severity:e.severity,title:e.title,filePath:e.filePath??".git",line:1,category:e.kind,description:e.detail,recommendation:e.recommendation}}let o2={critical:"critical",serious:"high",moderate:"medium",minor:"low"};function o4(e){return{source:"a11y",severity:o2[e.impact]??"medium",title:e.help,filePath:e.filePath,line:e.line,category:e.rule,description:`${e.description}. ${e.nodes} ${1===e.nodes?"element is":"elements are"} affected (${e.selector}).`,recommendation:e.recommendation,snippet:e.snippet,a11y:{rule:e.rule,impact:e.impact,principle:e.principle,wcag:e.wcag,helpUrl:e.helpUrl,selector:e.selector,nodes:e.nodes}}}function o5(e){return{source:"perf",severity:e.severity,title:e.title,filePath:e.filePath,line:e.line??1,category:e.kind,description:e.detail,recommendation:e.recommendation,snippet:e.snippet,perf:{kind:e.kind,estimatedSavingKb:e.estimatedSavingKb}}}function o6(e){return{source:"tests",severity:e.severity,title:e.title,filePath:e.filePath,line:e.line??1,category:e.kind,description:e.detail,recommendation:e.recommendation,snippet:e.snippet,test:{kind:e.kind}}}function o3(e){return({critical:6,error:5,high:4,warning:3,medium:3,low:2,info:1})[e]??1}let o9={injection:[{label:"OWASP: SQL Injection Prevention",href:"https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html",kind:"OWASP"},{label:"PortSwigger: SQL injection",href:"https://portswigger.net/web-security/sql-injection",kind:"PortSwigger"}],xss:[{label:"OWASP: XSS Prevention",href:"https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html",kind:"OWASP"},{label:"React: dangerouslySetInnerHTML",href:"https://react.dev/reference/react-dom/components/common#dangerously-setting-the-inner-html",kind:"React"}],auth:[{label:"OWASP: Authorization Cheat Sheet",href:"https://cheatsheetseries.owasp.org/cheatsheets/Authorization_Cheat_Sheet.html",kind:"OWASP"},{label:"OWASP: Broken Access Control",href:"https://owasp.org/Top10/A01_2021-Broken_Access_Control/",kind:"OWASP"}],secrets:[{label:"OWASP: Secrets Management",href:"https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html",kind:"OWASP"},{label:"Next.js: Environment Variables",href:"https://nextjs.org/docs/app/building-your-application/configuring/environment-variables",kind:"Next.js"}],crypto:[{label:"OWASP: Cryptographic Storage",href:"https://cheatsheetseries.owasp.org/cheatsheets/Cryptographic_Storage_Cheat_Sheet.html",kind:"OWASP"},{label:"Node.js: crypto.randomBytes",href:"https://nodejs.org/api/crypto.html#cryptorandombytessize-callback",kind:"Node.js"}],ssrf:[{label:"OWASP: SSRF Prevention",href:"https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html",kind:"OWASP"}],config:[{label:"OWASP: Security Misconfiguration",href:"https://owasp.org/Top10/A05_2021-Security_Misconfiguration/",kind:"OWASP"}],"data-exposure":[{label:"OWASP: Sensitive Data Exposure",href:"https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure",kind:"OWASP"}],other:[{label:"OWASP Top 10",href:"https://owasp.org/www-project-top-ten/",kind:"OWASP"}]};function o8(e){let t=[];if("lint"===e.source&&e.ruleId){var n;let r=(n=e.ruleId).startsWith("@typescript-eslint/")?{label:`typescript-eslint: ${n}`,href:`https://typescript-eslint.io/rules/${n.replace("@typescript-eslint/","")}/`,kind:"typescript-eslint"}:n.startsWith("react-hooks/")?{label:"React: Rules of Hooks",href:"https://react.dev/reference/rules/rules-of-hooks",kind:"React"}:n.startsWith("jsx-a11y/")?{label:`eslint-plugin-jsx-a11y: ${n}`,href:`https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/${n.replace("jsx-a11y/","")}.md`,kind:"a11y"}:n.startsWith("import/")?{label:`eslint-plugin-import: ${n}`,href:`https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/${n.replace("import/","")}.md`,kind:"import"}:{label:`ESLint: ${n}`,href:`https://eslint.org/docs/latest/rules/${n}`,kind:"ESLint"};t.push(r)}for(let n of("types"===e.source&&e.code&&t.push({label:`Explained: ${e.code}`,href:`https://typescript.tv/errors/#${e.code}`,kind:"typescript.tv"},{label:"TypeScript Handbook",href:"https://www.typescriptlang.org/docs/handbook/2/everyday-types.html",kind:"TypeScript"}),"security"===e.source&&(e.reference?.startsWith("CWE-")&&t.push({label:e.reference,href:`https://cwe.mitre.org/data/definitions/${e.reference.replace("CWE-","")}.html`,kind:"MITRE CWE"}),e.category&&o9[e.category]&&t.push(...o9[e.category])),e.cves??[]))t.push({label:n,href:`https://nvd.nist.gov/vuln/detail/${n}`,kind:"NVD"});if("deps"===e.source&&e.dep){let{name:n}=e.dep,r=encodeURIComponent(n);e.reference&&t.push({label:"Primary advisory",href:e.reference,kind:"Advisory"}),t.push({label:`npm: ${n}`,href:`https://www.npmjs.com/package/${r}`,kind:"npm"},{label:"Snyk vulnerability DB",href:`https://security.snyk.io/package/npm/${r}`,kind:"Snyk"},{label:"GitHub Advisories",href:`https://github.com/advisories?query=${r}`,kind:"GitHub"},{label:"Socket.dev supply-chain report",href:`https://socket.dev/npm/package/${r}`,kind:"Socket"},{label:"deps.dev dependency graph",href:`https://deps.dev/npm/${r}`,kind:"deps.dev"}),"license"===e.dep.kind&&t.push({label:"SPDX license list",href:"https://spdx.org/licenses/",kind:"SPDX"})}if("env"===e.source&&(t.push({label:"Next.js: Environment Variables",href:"https://nextjs.org/docs/app/building-your-application/configuring/environment-variables",kind:"Next.js"},{label:"OWASP: Secrets Management",href:"https://cheatsheetseries.owasp.org/cheatsheets/Secrets_Management_Cheat_Sheet.html",kind:"OWASP"}),e.env?.status==="exposed"&&t.push({label:"Next.js: Keeping Server-Only Code",href:"https://nextjs.org/docs/app/building-your-application/rendering/composition-patterns#keeping-server-only-code-out-of-the-client-environment",kind:"Next.js"})),"network"===e.source&&(t.push({label:"MDN: Using the Fetch API",href:"https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch",kind:"MDN"},{label:"MDN: AbortController (timeouts)",href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortController",kind:"MDN"}),e.net&&!e.net.secure&&t.push({label:"MDN: Mixed content",href:"https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content",kind:"MDN"})),"database"===e.source){let n=e.db?.engine;"mongodb"===n?t.push({label:"MongoDB: Indexing Strategies",href:"https://www.mongodb.com/docs/manual/applications/indexes/",kind:"MongoDB"},{label:"MongoDB: Query Optimization",href:"https://www.mongodb.com/docs/manual/core/query-optimization/",kind:"MongoDB"},{label:"Mongoose: Connections",href:"https://mongoosejs.com/docs/connections.html",kind:"Mongoose"}):"redis"===n?t.push({label:"Redis: Key expiration (TTL)",href:"https://redis.io/docs/latest/develop/use/keyspace/#key-expiration",kind:"Redis"},{label:"Redis: TLS support",href:"https://redis.io/docs/latest/operate/oss_and_stack/management/security/encryption/",kind:"Redis"}):t.push({label:"PostgreSQL: Using EXPLAIN",href:"https://www.postgresql.org/docs/current/using-explain.html",kind:"PostgreSQL"},{label:"PostgreSQL: Indexes",href:"https://www.postgresql.org/docs/current/indexes.html",kind:"PostgreSQL"}),e.db?.kind==="injection"&&t.push({label:"OWASP: SQL Injection Prevention",href:"https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html",kind:"OWASP"}),e.db?.kind==="n+1"&&t.push({label:"The N+1 query problem",href:"https://planetscale.com/blog/what-is-n-1-query-problem-and-how-to-solve-it",kind:"PlanetScale"})}if("git"===e.source&&(t.push({label:"GitHub: Removing sensitive data",href:"https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository",kind:"GitHub"},{label:"GitHub Actions: Security hardening",href:"https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions",kind:"GitHub"}),"large-file"===e.category&&t.push({label:"Git LFS",href:"https://git-lfs.com/",kind:"Git LFS"})),"a11y"===e.source&&e.a11y){t.push({label:`axe: ${e.a11y.rule}`,href:e.a11y.helpUrl,kind:"Deque"},{label:"WAI-ARIA Authoring Practices",href:"https://www.w3.org/WAI/ARIA/apg/",kind:"W3C"},{label:"MDN: Accessibility",href:"https://developer.mozilla.org/en-US/docs/Web/Accessibility",kind:"MDN"});let n=e.a11y.wcag.find(e=>/^\d/.test(e));n&&t.push({label:`WCAG ${n}`,href:`https://www.w3.org/WAI/WCAG21/Understanding/${n.replace(/\./g,"")}`,kind:"WCAG"})}return"perf"===e.source&&(t.push({label:"web.dev: Core Web Vitals",href:"https://web.dev/articles/vitals",kind:"web.dev"},{label:"Next.js: Optimizing",href:"https://nextjs.org/docs/app/building-your-application/optimizing",kind:"Next.js"}),e.perf?.kind==="unoptimized-image"&&t.push({label:"next/image",href:"https://nextjs.org/docs/app/api-reference/components/image",kind:"Next.js"}),(e.perf?.kind==="large-dependency"||e.perf?.kind==="duplicate-dependency")&&t.push({label:"Bundlephobia",href:"https://bundlephobia.com/",kind:"Bundlephobia"}),e.perf?.kind==="layout-shift"&&t.push({label:"web.dev: Optimize CLS",href:"https://web.dev/articles/optimize-cls",kind:"web.dev"}),(e.perf?.kind==="render-blocking"||e.perf?.kind==="sync-script")&&t.push({label:"next/script",href:"https://nextjs.org/docs/app/api-reference/components/script",kind:"Next.js"}),(e.perf?.kind==="no-code-split"||e.perf?.kind==="no-memo")&&t.push({label:"React: lazy & Suspense",href:"https://react.dev/reference/react/lazy",kind:"React"})),"tests"===e.source&&(t.push({label:"Vitest docs",href:"https://vitest.dev/guide/",kind:"Vitest"},{label:"Testing Library queries",href:"https://testing-library.com/docs/queries/about/",kind:"Testing Library"}),e.test?.kind==="flaky"&&t.push({label:"Vitest: async & timers",href:"https://vitest.dev/guide/mocking.html#timers",kind:"Vitest"}),(e.test?.kind==="uncovered"||e.test?.kind==="no-tests")&&t.push({label:"Vitest: coverage",href:"https://vitest.dev/guide/coverage.html",kind:"Vitest"})),t}let o7=[{id:"vscode",label:"VS Code",url:(e,t,n)=>`vscode://file/${e}:${t}:${n}`},{id:"cursor",label:"Cursor",url:(e,t,n)=>`cursor://file/${e}:${t}:${n}`},{id:"windsurf",label:"Windsurf",url:(e,t,n)=>`windsurf://file/${e}:${t}:${n}`},{id:"vscode-insiders",label:"VS Code Insiders",url:(e,t,n)=>`vscode-insiders://file/${e}:${t}:${n}`},{id:"webstorm",label:"WebStorm",url:(e,t)=>`webstorm://open?file=${encodeURIComponent(e)}&line=${t}`},{id:"zed",label:"Zed",url:(e,t,n)=>`zed://file/${e}:${t}:${n}`}];function le(e,t){return t.startsWith("/")?t:`${e.replace(/\/$/,"")}/${t}`}let lt=[{id:"todo",name:"To do"},{id:"in-progress",name:"In progress"},{id:"done",name:"Done",done:!0}],ln=[{id:"g_backlog",name:"Backlog",createdAt:"1970-01-01T00:00:00.000Z"},{id:"g_sprint",name:"This sprint",createdAt:"1970-01-01T00:00:00.000Z"}],lr="codelens.tasks.v2",li="codelens.tasks.v1",la="codelens.task-columns.v1",ls="codelens.task-groups.v1",lo="codelens:tasks-changed";function ll(e="t"){return`${e}_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,7)}`}function ld(){try{let e=window.localStorage.getItem(la);if(!e)return lt;let t=JSON.parse(e);return Array.isArray(t)&&t.length>0?t:lt}catch{return lt}}function lc(e){window.localStorage.setItem(la,JSON.stringify(e)),window.dispatchEvent(new CustomEvent(lo))}function lu(){let[e,t]=(0,eP.useState)([]),n=(0,eP.useCallback)(()=>t(ld()),[]);return(0,eP.useEffect)(()=>{n();let e=()=>n();return window.addEventListener(lo,e),window.addEventListener("storage",e),()=>{window.removeEventListener(lo,e),window.removeEventListener("storage",e)}},[n]),e}function lm(){try{let e=window.localStorage.getItem(lr);if(!e)return function(){try{let e=window.localStorage.getItem(li);if(!e)return null;let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=t.map(({status:e,...t})=>({...t,columnId:e}));return window.localStorage.setItem(lr,JSON.stringify(n)),window.localStorage.removeItem(li),n}catch{return null}}()??[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function lp(e){window.localStorage.setItem(lr,JSON.stringify(e)),window.dispatchEvent(new CustomEvent(lo))}function lf(e){let t=new Date().toISOString(),n={id:ll(),title:e.title,columnId:e.columnId??ld()[0]?.id??"todo",priority:e.priority??"medium",source:e.source,severity:e.severity,filePath:e.filePath,line:e.line,groupId:e.groupId,note:e.note,issue:e.issue,createdAt:t,updatedAt:t};return lp([n,...lm()]),n}function lh(e){return`${e.source}::${e.filePath}::${e.line}::${e.title}`}function lg(e){return e.source?`${e.source}::${e.filePath}::${e.line}::${e.title}`:null}function lx(e,t){lp(lm().map(n=>n.id===e?{...n,...t,updatedAt:new Date().toISOString()}:n))}function lv(e,t,n){let r,i=lm(),a=i.find(t=>t.id===e);if(!a)return;let s={...a,columnId:t,updatedAt:new Date().toISOString()},o=i.filter(t=>t.id!==e);if(n&&n!==e){let e=o.findIndex(e=>e.id===n);r=-1===e?o.length:e}else{let e=-1;o.forEach((n,r)=>{n.columnId===t&&(e=r)}),r=-1===e?o.length:e+1}o.splice(r,0,s),lp(o)}function ly(e){lp(lm().filter(t=>t.id!==e))}function lb(){let e=new Set(ld().filter(e=>e.done).map(e=>e.id));lp(lm().filter(t=>!e.has(t.columnId)))}function lk(){try{let e=window.localStorage.getItem(ls);if(!e)return ln;let t=JSON.parse(e);return Array.isArray(t)?t:ln}catch{return ln}}function lj(e){window.localStorage.setItem(ls,JSON.stringify(e)),window.dispatchEvent(new CustomEvent(lo))}function lw(e){let t={id:ll("g"),name:e.trim(),createdAt:new Date().toISOString()};return lj([...lk(),t]),t}function lN(e){let[t,n]=(0,eP.useState)(e),r=(0,eP.useCallback)(()=>n(e()),[e]);return(0,eP.useEffect)(()=>{r();let e=()=>r();return window.addEventListener(lo,e),window.addEventListener("storage",e),()=>{window.removeEventListener(lo,e),window.removeEventListener("storage",e)}},[]),t}function l_(){let e=lN(lm),t=new Set;for(let n of e){let e=lg(n);e&&t.add(e)}return t}let lS=(0,eP.createContext)(null);function l$(){let e=(0,eP.useContext)(lS);if(!e)throw Error("useInspector must be used within <InspectorProvider>");return e}function lI({absPath:e,line:t,column:n}){return(0,eT.jsxs)(a5,{children:[(0,eT.jsxs)(a6,{className:"inline-flex items-center gap-1.5 rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:[(0,eT.jsx)(oP,{className:"size-3.5"}),"Open in IDE"]}),(0,eT.jsxs)(a3,{align:"end",className:"min-w-44",children:[(0,eT.jsxs)(a9,{className:"font-mono text-[10px] uppercase tracking-wider",children:["Open at ",t,":",n]}),(0,eT.jsx)(a7,{}),o7.map(r=>(0,eT.jsx)(a8,{render:(0,eT.jsxs)("a",{href:r.url(e,t,n),children:[(0,eT.jsx)(si,{className:"size-3.5"}),r.label]})},r.id))]})]})}function lE({code:e,highlight:t}){let n=e.replace(/\n$/,"").split("\n"),r=(0,eP.useRef)(null);return(0,eT.jsx)("pre",{className:"overflow-x-auto py-2 font-mono text-xs leading-relaxed",children:(0,eT.jsx)("code",{className:"block",children:n.map((e,n)=>{let i=n+1,a=i===t;return(0,eT.jsxs)("div",{ref:a?e=>{r.current=e,e?.scrollIntoView({block:"center"})}:void 0,className:(0,ny.cn)("flex",a&&"bg-foreground/[0.08]"),children:[(0,eT.jsx)("span",{className:(0,ny.cn)("sticky left-0 w-12 shrink-0 select-none bg-popover px-2 text-right tabular-nums",a?"text-foreground":"text-muted-foreground/50"),children:i}),(0,eT.jsx)("span",{className:(0,ny.cn)("flex-1 whitespace-pre pl-3 pr-4",a?"border-l-2 border-foreground text-foreground":"border-l-2 border-transparent text-foreground/80"),children:e||" "})]},i)})})})}function lC({startLine:e,code:t,highlight:n}){let r=t.replace(/\n$/,"").split("\n");return(0,eT.jsx)("pre",{className:"overflow-x-auto rounded-sm border border-border bg-background/60 py-2 font-mono text-xs leading-relaxed",children:(0,eT.jsx)("code",{className:"block",children:r.map((t,r)=>{let i=e+r,a=i===n;return(0,eT.jsxs)("div",{className:(0,ny.cn)("flex",a&&"bg-foreground/[0.08]"),children:[(0,eT.jsx)("span",{className:(0,ny.cn)("w-10 shrink-0 select-none px-2 text-right tabular-nums",a?"text-foreground":"text-muted-foreground/50"),children:i}),(0,eT.jsx)("span",{className:(0,ny.cn)("flex-1 whitespace-pre pl-3 pr-4",a?"border-l-2 border-foreground text-foreground":"border-l-2 border-transparent text-foreground/80"),children:t||" "})]},i)})})})}function lA({fix:e}){let t=e.replace(/\n$/,"").split("\n");return(0,eT.jsx)("pre",{className:"overflow-x-auto rounded-sm border border-border bg-background/60 py-2 font-mono text-xs leading-relaxed",children:(0,eT.jsx)("code",{className:"block",children:t.map((e,t)=>{let n=e.startsWith("+"),r=e.startsWith("-");return(0,eT.jsx)("div",{className:(0,ny.cn)("flex whitespace-pre border-l-2 px-3",n&&"border-foreground bg-foreground/[0.07] text-foreground",r&&"border-muted-foreground/40 text-muted-foreground line-through decoration-muted-foreground/40",!n&&!r&&"border-transparent text-foreground/60"),children:e||" "},t)})})})}function lT({icon:e,children:t}){return(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(e,{className:"size-3.5"}),t]})}function lP({label:e,value:t,highlight:n}){return(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5 bg-card px-3 py-2",children:[(0,eT.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:e}),(0,eT.jsx)("span",{className:(0,ny.cn)("tabular-nums",n?"text-[color:var(--sev-ok)]":"text-foreground"),children:t})]})}function lz({projectRoot:e,onAskAI:t,children:n}){let[r,i]=(0,eP.useState)(null),[a,s]=(0,eP.useState)(null),{copied:o,copy:l}=function(){let[e,t]=(0,eP.useState)(!1);return{copied:e,copy:(0,eP.useCallback)(e=>{navigator.clipboard?.writeText(e).then(()=>{t(!0),window.setTimeout(()=>t(!1),1400)})},[])}}(),d=(0,eP.useCallback)((e,t,n)=>{i({filePath:e,line:t,column:n})},[]),c=(0,eP.useCallback)(e=>s(e),[]),u=(0,eP.useCallback)(e=>{t?.(e),s(null)},[t]),m=(0,eP.useMemo)(()=>({projectRoot:e,viewFile:d,viewIssue:c,canAskAI:!!t,askAI:u}),[e,d,c,t,u]),p=r?oW[r.filePath]??null:null,f=a?o8(a):[],h=a?oV(a.severity):null;return(0,eT.jsxs)(lS.Provider,{value:m,children:[n,(0,eT.jsx)(oM,{open:!!r,onOpenChange:e=>!e&&i(null),children:(0,eT.jsx)(oL,{side:"right",className:"w-full gap-0 p-0 sm:!max-w-3xl",children:r&&(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(oU,{className:"border-b border-border",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 pr-8",children:[(0,eT.jsx)(si,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsx)(oZ,{className:"truncate font-mono text-sm",children:r.filePath})]}),(0,eT.jsx)(oF,{className:"sr-only",children:"Source file preview"}),(0,eT.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[null!=r.line&&(0,eT.jsxs)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:["line ",r.line,null!=r.column?`:${r.column}`:""]}),(0,eT.jsxs)("button",{type:"button",onClick:()=>l(le(e,r.filePath)),className:"inline-flex items-center gap-1.5 rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:[o?(0,eT.jsx)(iq,{className:"size-3.5"}):(0,eT.jsx)(oC,{className:"size-3.5"}),o?"Copied":"Copy path"]}),(0,eT.jsx)(lI,{absPath:le(e,r.filePath),line:r.line??1,column:r.column??1})]})]}),(0,eT.jsx)("div",{className:"min-h-0 flex-1 overflow-auto",children:p?(0,eT.jsx)(lE,{code:p,highlight:r.line}):(0,eT.jsx)("p",{className:"p-6 text-sm text-muted-foreground",children:"No preview available for this file in the demo fixture. The installed CLI reads the real file from disk."})})]})})}),(0,eT.jsx)(oM,{open:!!a,onOpenChange:e=>!e&&s(null),children:(0,eT.jsx)(oL,{side:"right",className:"w-full gap-0 p-0 sm:!max-w-2xl",children:a&&h&&(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(oU,{className:"border-b border-border",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pr-8",children:[(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",h.bg,h.text),children:h.label}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:a.source}),a.ruleId&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:a.ruleId}),a.code&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:a.code}),a.category&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:a.category}),null!=a.confidence&&(0,eT.jsxs)("span",{className:"ml-auto font-mono text-[10px] text-muted-foreground",children:[Math.round(100*a.confidence),"% conf."]})]}),(0,eT.jsx)(oZ,{className:"mt-2 text-pretty text-sm leading-relaxed",children:a.title}),(0,eT.jsx)(oF,{className:"sr-only",children:"Issue detail"})]}),(0,eT.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-5 overflow-auto p-4",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsxs)("button",{type:"button",onClick:()=>d(a.filePath,a.line,a.column),className:"inline-flex items-center gap-1.5 rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-foreground transition-colors hover:bg-secondary",children:[(0,eT.jsx)(si,{className:"size-3.5 text-muted-foreground"}),a.filePath,":",a.line]}),(0,eT.jsx)(lI,{absPath:le(e,a.filePath),line:a.line,column:a.column??1}),t&&(0,eT.jsxs)("button",{type:"button",onClick:()=>{let e;return u((e=[a.description,a.recommendation?`Suggested direction: ${a.recommendation}`:"",a.ruleId?`Rule: ${a.ruleId}`:"",a.code?`Code: ${a.code}`:"",a.cves?.length?`Advisories: ${a.cves.join(", ")}`:"",a.snippet?`
315
+ Relevant code:
316
+ ${a.snippet.code}`:""].filter(Boolean).join("\n"),{source:a.source,title:a.title,summary:e,filePath:a.filePath,line:a.line,severity:a.severity}))},className:"inline-flex items-center gap-1.5 rounded-sm bg-primary px-2.5 py-1.5 font-mono text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:[(0,eT.jsx)(e4,{className:"size-3.5"}),"Ask AI"]}),(0,eT.jsx)(lO,{issue:a}),a.fixable&&(0,eT.jsx)("span",{className:"rounded-sm bg-[color:var(--sev-ok)]/12 px-2 py-1 font-mono text-[11px] text-[color:var(--sev-ok)]",children:"auto-fixable"})]}),a.dep&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:eq,children:"Package"}),(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-card",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[(0,eT.jsx)("span",{className:"font-mono text-sm text-foreground",children:a.dep.name}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:a.dep.type})]}),(0,eT.jsxs)("dl",{className:"grid grid-cols-2 gap-px bg-border font-mono text-xs sm:grid-cols-4",children:[(0,eT.jsx)(lP,{label:"installed",value:a.dep.current}),a.dep.latest&&(0,eT.jsx)(lP,{label:"latest",value:a.dep.latest}),a.dep.fixedIn&&(0,eT.jsx)(lP,{label:"fixed in",value:a.dep.fixedIn,highlight:!0}),a.dep.license&&(0,eT.jsx)(lP,{label:"license",value:a.dep.license})]}),a.dep.fixedIn&&"—"!==a.dep.current&&(0,eT.jsxs)("div",{className:"flex items-center gap-2 border-t border-border px-3 py-2 font-mono text-xs",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:a.dep.current}),(0,eT.jsx)(oz,{className:"size-3 text-muted-foreground"}),(0,eT.jsx)("span",{className:"text-[color:var(--sev-ok)]",children:a.dep.fixedIn}),(0,eT.jsx)("span",{className:"ml-auto text-muted-foreground",children:"recommended upgrade"})]})]}),a.dep.usedIn&&a.dep.usedIn.length>0&&(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:"imported in:"}),a.dep.usedIn.map(e=>(0,eT.jsx)(lR,{path:e,className:"text-[11px]"},e))]})]}),a.env&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:eH,children:"Variable"}),(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-card",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[(0,eT.jsx)("span",{className:"font-mono text-sm text-foreground",children:a.env.key}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:a.env.scope})]}),(0,eT.jsxs)("dl",{className:"grid grid-cols-2 gap-px bg-border font-mono text-xs",children:[(0,eT.jsx)(lP,{label:"status",value:a.env.status,highlight:"exposed"===a.env.status}),(0,eT.jsx)(lP,{label:"value",value:a.env.sample??"—"})]})]}),a.env.definedIn.length>0&&(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:"declared in:"}),a.env.definedIn.map(e=>(0,eT.jsx)(lR,{path:e,className:"text-[11px]"},e))]}),a.env.usedIn.length>0&&(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:"referenced in:"}),a.env.usedIn.map(e=>(0,eT.jsx)(lR,{path:e,className:"text-[11px]"},e))]})]}),a.net&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:eG,children:"Request"}),(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-card",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2 font-mono text-xs",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 uppercase text-foreground",children:a.net.method}),(0,eT.jsx)("span",{className:"truncate text-foreground",children:a.net.url})]}),(0,eT.jsxs)("dl",{className:"grid grid-cols-2 gap-px bg-border font-mono text-xs sm:grid-cols-4",children:[(0,eT.jsx)(lP,{label:"host",value:a.net.host}),(0,eT.jsx)(lP,{label:"client",value:a.net.client}),(0,eT.jsx)(lP,{label:"scheme",value:a.net.secure?"https":"http",highlight:!a.net.secure}),(0,eT.jsx)(lP,{label:"scope",value:a.net.external?"external":"internal"})]})]}),a.net.issues.length>0&&(0,eT.jsx)("ul",{className:"flex flex-col gap-1.5",children:a.net.issues.map((e,t)=>{let n=oV(e.severity);return(0,eT.jsxs)("li",{className:"flex items-start gap-2 text-xs leading-relaxed text-muted-foreground",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("mt-1 size-1.5 shrink-0 rounded-full",n.dot),"aria-hidden":!0}),(0,eT.jsxs)("span",{children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-foreground",children:e.kind})," — ",e.message]})]},t)})})]}),a.a11y&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:eQ,children:"WCAG details"}),(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-card",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-3 py-2 font-mono text-xs",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 text-foreground",children:a.a11y.rule}),(0,eT.jsx)("span",{className:"truncate text-muted-foreground",children:a.a11y.selector})]}),(0,eT.jsxs)("dl",{className:"grid grid-cols-2 gap-px bg-border font-mono text-xs sm:grid-cols-4",children:[(0,eT.jsx)(lP,{label:"impact",value:a.a11y.impact,highlight:"critical"===a.a11y.impact}),(0,eT.jsx)(lP,{label:"principle",value:a.a11y.principle}),(0,eT.jsx)(lP,{label:"nodes",value:String(a.a11y.nodes)}),(0,eT.jsx)(lP,{label:"criteria",value:a.a11y.wcag.filter(e=>/^\d/.test(e))[0]??"—"})]})]})]}),a.cves&&a.cves.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:eB,children:"Known advisories"}),(0,eT.jsx)("div",{className:"flex flex-wrap gap-1.5",children:a.cves.map(e=>(0,eT.jsxs)("a",{href:`https://nvd.nist.gov/vuln/detail/${e}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 rounded-sm border border-border bg-card px-2 py-1 font-mono text-[11px] text-foreground transition-colors hover:bg-secondary",children:[e,(0,eT.jsx)(oE,{className:"size-3 text-muted-foreground"})]},e))})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:eY,children:"What's happening"}),(0,eT.jsx)("p",{className:"text-pretty text-sm leading-relaxed text-foreground",children:a.description})]}),a.snippet&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)(lT,{icon:si,children:"Code"}),(0,eT.jsxs)("button",{type:"button",onClick:()=>d(a.filePath,a.line,a.column),className:"inline-flex items-center gap-1 font-mono text-[11px] text-muted-foreground transition-colors hover:text-foreground",children:["view full file ",(0,eT.jsx)(a4,{className:"size-3"})]})]}),(0,eT.jsx)(lC,{startLine:a.snippet.startLine,code:a.snippet.code,highlight:a.line})]}),a.related&&a.related.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:oT,children:"Diagnostic chain"}),(0,eT.jsx)("ol",{className:"relative ml-2 border-l border-border",children:a.related.map((e,t)=>(0,eT.jsxs)("li",{className:"relative py-1.5 text-sm leading-relaxed text-muted-foreground",style:{paddingLeft:`${12*e.depth+20}px`},children:[(0,eT.jsx)("span",{className:"absolute top-3 size-1.5 rounded-full bg-muted-foreground/40",style:{left:`${12*e.depth+4}px`},"aria-hidden":!0}),e.message]},t))})]}),a.recommendation&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:oA,children:"How to fix"}),(0,eT.jsx)("div",{className:"rounded-sm border border-border bg-card p-3",children:(0,eT.jsx)("p",{className:"text-pretty text-sm leading-relaxed text-foreground",children:a.recommendation})})]}),a.suggestedFix&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:oA,children:"Suggested fix"}),(0,eT.jsx)(lA,{fix:a.suggestedFix})]}),"lint"===a.source&&a.fixable&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:oA,children:"Auto-fix command"}),(0,eT.jsxs)("code",{className:"rounded-sm border border-border bg-background/60 px-3 py-2 font-mono text-xs text-foreground",children:["eslint --fix ",a.filePath]})]}),f.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)(lT,{icon:eY,children:"Resources & docs"}),(0,eT.jsx)("ul",{className:"flex flex-col gap-1.5",children:f.map(e=>(0,eT.jsx)("li",{children:(0,eT.jsxs)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 rounded-sm border border-border bg-card px-3 py-2 text-sm transition-colors hover:bg-secondary",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.kind}),(0,eT.jsx)("span",{className:"min-w-0 flex-1 truncate text-foreground",children:e.label}),(0,eT.jsx)(oE,{className:"size-3.5 shrink-0 text-muted-foreground"})]})},e.href))})]})]})]})})})]})}function lO({issue:e}){let t=lN(lk),n=l_().has(lh(e)),[r,i]=(0,eP.useState)(!1),[a,s]=(0,eP.useState)(null),[o,l]=(0,eP.useState)(!1),[d,c]=(0,eP.useState)("");function u(){l(!1),c("")}function m(t){let n,r,{created:a}=(n=lh(e),(r=lm().find(e=>lg(e)===n))?(t&&r.groupId!==t&&lx(r.id,{groupId:t}),{task:r,created:!1}):{task:lf({title:e.title,source:e.source,severity:e.severity,filePath:e.filePath,line:e.line,groupId:t,priority:function(e){switch(e){case"critical":case"high":case"error":return"high";case"medium":case"warning":return"medium";default:return"low"}}(e.severity),note:e.recommendation,issue:e}),created:!0});s(a?"added":"exists"),window.setTimeout(()=>s(null),1600),i(!1),u()}function p(){let e=d.trim();e&&m(lw(e).id)}let f=a||n?ox:e7;return(0,eT.jsxs)(a5,{open:r,onOpenChange:e=>{i(e),e||u()},children:[(0,eT.jsxs)(a6,{className:(0,ny.cn)("inline-flex items-center gap-1.5 rounded-sm border px-2.5 py-1.5 font-mono text-xs transition-colors",n?"border-foreground/40 bg-secondary text-foreground":"border-border bg-card text-foreground hover:bg-secondary"),children:[(0,eT.jsx)(f,{className:(0,ny.cn)("size-3.5",n?"text-foreground":"text-muted-foreground")}),"added"===a?"Tracked":"exists"===a?"Already tracked":n?"Tracked":"Track task",(0,eT.jsx)(a4,{className:"size-3 rotate-90 text-muted-foreground"})]}),(0,eT.jsxs)(a3,{align:"end",className:"min-w-52",children:[(0,eT.jsx)("p",{className:"px-1.5 py-1 font-mono text-[10px] uppercase tracking-wider text-muted-foreground",children:n?"Update task group":"Add to task board"}),(0,eT.jsxs)(a8,{onClick:()=>m(void 0),children:[(0,eT.jsx)(e7,{className:"size-3.5 text-muted-foreground"}),"Track (no group)"]}),t.length>0&&(0,eT.jsx)(a7,{}),t.map(e=>(0,eT.jsxs)(a8,{onClick:()=>m(e.id),children:[(0,eT.jsx)("span",{className:"size-2 rounded-full border border-muted-foreground","aria-hidden":!0}),e.name]},e.id)),(0,eT.jsx)(a7,{}),o?(0,eT.jsxs)("div",{className:"flex items-center gap-1.5 px-1.5 py-1",onKeyDown:e=>e.stopPropagation(),children:[(0,eT.jsx)("input",{autoFocus:!0,value:d,onChange:e=>c(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),p())},placeholder:"New group name",className:"w-full rounded-sm border border-border bg-background px-2 py-1 font-mono text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),(0,eT.jsx)("button",{type:"button",onClick:p,disabled:!d.trim(),className:"rounded-sm bg-primary px-2 py-1 font-mono text-[11px] text-primary-foreground disabled:opacity-40",children:"Add"})]}):(0,eT.jsxs)(a8,{closeOnClick:!1,onClick:()=>l(!0),children:[(0,eT.jsx)(oO,{className:"size-3.5 text-muted-foreground"}),"New group…"]})]})]})}function lM({issue:e,variant:t="badge",className:n}){return l_().has(lh(e))?"dot"===t?(0,eT.jsx)(ox,{className:(0,ny.cn)("size-3.5 shrink-0 text-foreground",n),"aria-label":"Tracked in Task Manager"}):(0,eT.jsxs)("span",{title:"Tracked in Task Manager",className:(0,ny.cn)("inline-flex items-center gap-1 rounded-sm border border-foreground/40 bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-foreground",n),children:[(0,eT.jsx)(ox,{className:"size-3"}),"tracked"]}):null}function lR({path:e,line:t,column:n,className:r,children:i}){let{viewFile:a}=l$();return(0,eT.jsx)("button",{type:"button",onClick:r=>{r.stopPropagation(),a(e,t,n)},className:(0,ny.cn)("inline-flex items-center gap-1 font-mono text-xs text-foreground/80 underline decoration-border underline-offset-2 transition-colors hover:text-foreground hover:decoration-foreground",r),children:i??(0,eT.jsxs)(eT.Fragment,{children:[e,null!=t?`:${t}`:""]})})}let lD={security:"security",types:"types",deps:"deps",lint:"lint",database:"database",tests:"tests",perf:"performance",a11y:"accessibility",env:"env",network:"network",docs:"docs"};function lL({label:e,value:t,sub:n,accent:r,onClick:i}){let a=(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:e}),i&&(0,eT.jsx)(a4,{className:"size-3.5 text-muted-foreground/50 transition-transform group-hover:translate-x-0.5"})]}),(0,eT.jsx)("span",{className:"font-mono text-3xl font-semibold tabular-nums",style:{color:r},children:t}),(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:n})]});return i?(0,eT.jsx)("button",{type:"button",onClick:i,className:"group flex flex-col gap-2 overflow-hidden rounded-xl bg-card p-4 text-left text-card-foreground ring-1 ring-foreground/10 transition-colors hover:ring-foreground/25",children:a}):(0,eT.jsx)(s8,{className:"gap-2 p-4",children:a})}function lU({category:e,onSelect:t}){var n;let r=(n=e.score)>=80?"var(--sev-ok)":n>=60?"var(--sev-medium)":n>=40?"var(--sev-high)":"var(--sev-critical)";return(0,eT.jsxs)("button",{type:"button",onClick:t,disabled:!t,className:"group flex flex-col gap-1.5 rounded-sm p-1.5 text-left transition-colors enabled:hover:bg-secondary/50",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-2 text-sm",children:[(0,eT.jsxs)("span",{className:"flex min-w-0 items-baseline gap-1.5",children:[(0,eT.jsx)("span",{className:"truncate text-muted-foreground group-enabled:group-hover:text-foreground",children:e.label}),(0,eT.jsxs)("span",{className:"shrink-0 font-mono text-[10px] tabular-nums text-muted-foreground/60",children:[e.issues," ",1===e.issues?"issue":"issues"]})]}),(0,eT.jsxs)("span",{className:"flex shrink-0 items-center gap-1",children:[(0,eT.jsx)("span",{className:"font-mono tabular-nums",style:{color:r},children:e.score}),t&&(0,eT.jsx)(a4,{className:"size-3 text-muted-foreground/40 transition-transform group-hover:translate-x-0.5"})]})]}),(0,eT.jsx)(om,{value:e.score,className:"h-1.5"})]})}function lZ({icon:e,label:t,value:n,onClick:r}){let i=(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsx)(e,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("span",{className:"flex min-w-0 flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase tracking-wider text-muted-foreground/70",children:t}),(0,eT.jsx)("span",{className:"truncate font-mono text-sm text-foreground",children:n})]})]}),a="flex min-w-0 items-center gap-2.5 rounded-sm px-3 py-2";return r?(0,eT.jsx)("button",{type:"button",onClick:r,className:`${a} text-left transition-colors hover:bg-secondary/50`,children:i}):(0,eT.jsx)("div",{className:a,children:i})}function lF({report:e,history:t,insights:n,onSelectTab:r}){let i,a,{lint:s,types:o,security:l}=e,{viewIssue:d,viewFile:c}=l$(),u=ok(e,n),m=l.findings.filter(e=>"critical"===e.severity).length,p=l.findings.filter(e=>"high"===e.severity).length,f=t.length>=2?t[t.length-2].score:null,h=null!=f?u.score-f:null,g=function(e){let{lint:t,types:n,security:r}=e,i=[];for(let e of r.findings)("critical"===e.severity||"high"===e.severity)&&i.push({id:`sec-${e.id}`,icon:eB,severity:e.severity,title:e.title,detail:`${e.filePath}:${e.line}`,issue:oK(e)});for(let e of r.dependencies)e.fixedIn&&("critical"===e.severity||"high"===e.severity)&&i.push({id:`dep-${e.name}`,icon:s6,severity:e.severity,title:`Upgrade ${e.name} to ${e.fixedIn}`,detail:e.cves.join(", ")||e.title,tab:"deps"});return t.fixableCount>0&&i.push({id:"lint-fix",icon:s4,severity:"warning",title:`Auto-fix ${t.fixableCount} lint ${1===t.fixableCount?"issue":"issues"}`,detail:"eslint . --fix",tab:"lint"}),n.diagnostics.length>0&&i.push({id:"types",icon:s5,severity:"high",title:`Resolve ${n.diagnostics.length} type ${1===n.diagnostics.length?"error":"errors"}`,detail:"tsc --noEmit",tab:"types"}),i.sort((e,t)=>oV(t.severity).rank-oV(e.severity).rank).slice(0,6)}(e),x=(i=new Map,a=e=>i.set(e,(i.get(e)??0)+1),e.lint.messages.forEach(e=>a(e.filePath)),e.types.diagnostics.forEach(e=>a(e.filePath)),e.security.findings.forEach(e=>a(e.filePath)),[...i.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count).slice(0,8)),v=u.categories.reduce((e,t)=>e+t.issues,0),y=u.categories.filter(e=>0===e.issues).length,b=e=>{e&&r&&r(e)},k=["critical","high","medium","low","info"].map((e,t)=>({label:oV(e).label,value:l.findings.filter(t=>t.severity===e).length,color:`var(--chart-${t+1})`}));return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"Project health"}),(0,eT.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Weighted across ",u.categories.length," analysis surfaces"]})]}),(0,eT.jsx)(o_,{report:e,insights:n})]}),(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-3",children:[(0,eT.jsxs)(s8,{className:"flex flex-col items-center justify-center gap-4 p-6",children:[(0,eT.jsx)(oh,{score:u.score,grade:u.grade}),(0,eT.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[null!=h&&(0,eT.jsxs)("span",{className:"font-mono tabular-nums",style:{color:h>=0?"var(--sev-ok)":"var(--sev-critical)"},children:[h>=0?"+":"",h]}),(0,eT.jsx)("span",{className:"text-muted-foreground",children:"vs previous run"})]})]}),(0,eT.jsxs)(s8,{className:"flex flex-col gap-3 p-6 lg:col-span-2",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("h3",{className:"text-sm font-semibold",children:"Score breakdown"}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase tracking-wider text-muted-foreground",children:"issues · score"})]}),(0,eT.jsx)("div",{className:"grid gap-x-4 gap-y-1 sm:grid-cols-2",children:u.categories.map(e=>(0,eT.jsx)(lU,{category:e,onSelect:r?()=>b(lD[e.key]):void 0},e.key))})]})]}),(0,eT.jsxs)(s8,{className:"grid grid-cols-2 gap-1 p-2 sm:grid-cols-3 lg:grid-cols-6",children:[(0,eT.jsx)(lZ,{icon:te,label:"Framework",value:e.meta.project.framework}),(0,eT.jsx)(lZ,{icon:s9,label:"Package manager",value:e.meta.project.packageManager}),(0,eT.jsx)(lZ,{icon:s3,label:"AI review",value:e.meta.aiEnabled?"Enabled":"Skipped",onClick:r?()=>b("security"):void 0}),(0,eT.jsx)(lZ,{icon:i4,label:"Duration",value:`${(e.meta.durationMs/1e3).toFixed(1)}s`}),(0,eT.jsx)(lZ,{icon:eB,label:"Total issues",value:String(v)}),(0,eT.jsx)(lZ,{icon:s9,label:"Clean surfaces",value:`${y}/${u.categories.length}`})]}),(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-3",children:[(0,eT.jsxs)(s8,{className:"flex flex-col gap-3 p-6 lg:col-span-3",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("h3",{className:"text-sm font-semibold",children:"Health trend"}),(0,eT.jsxs)("button",{type:"button",onClick:()=>b("trends"),disabled:!r,className:"inline-flex items-center gap-1 font-mono text-xs text-muted-foreground transition-colors enabled:hover:text-foreground",children:[t.length," runs",r&&(0,eT.jsx)(s2,{className:"size-3"})]})]}),(0,eT.jsx)(og,{data:t})]}),(0,eT.jsx)(lL,{label:"Lint errors",value:s.errorCount,sub:`${s.warningCount} warnings \xb7 ${s.fixableCount} auto-fixable`,accent:s.errorCount>0?"var(--sev-critical)":"var(--sev-ok)",onClick:r?()=>b("lint"):void 0}),(0,eT.jsx)(lL,{label:"Type errors",value:o.diagnostics.length,sub:o.unavailable?"TypeScript not detected":"from tsc --noEmit",accent:o.diagnostics.length>0?"var(--sev-high)":"var(--sev-ok)",onClick:r?()=>b("types"):void 0}),(0,eT.jsx)(lL,{label:"Security findings",value:l.findings.length,sub:`${m} critical \xb7 ${p} high \xb7 ${l.dependencies.length} vuln deps`,accent:m>0?"var(--sev-critical)":p>0?"var(--sev-high)":"var(--sev-ok)",onClick:r?()=>b("security"):void 0}),(0,eT.jsx)("div",{className:"lg:col-span-2",children:(0,eT.jsx)(oS,{title:"Recommended next actions",children:0===g.length?(0,eT.jsx)("p",{className:"py-4 text-center text-sm text-muted-foreground",children:"All clear — nothing urgent to address."}):(0,eT.jsx)("ol",{className:"flex flex-col",children:g.map((e,t)=>{let n=oV(e.severity),r=e.icon;return(0,eT.jsx)("li",{className:"border-t border-border first:border-t-0",children:(0,eT.jsxs)("button",{type:"button",onClick:()=>{e.issue?d(e.issue):b(e.tab)},className:"group flex w-full items-start gap-3 py-2.5 text-left transition-colors hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:"mt-0.5 font-mono text-xs tabular-nums text-muted-foreground",children:String(t+1).padStart(2,"0")}),(0,eT.jsx)(r,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("span",{className:"block text-pretty text-sm text-foreground",children:e.title}),(0,eT.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:e.detail})]}),(0,eT.jsx)("span",{className:`shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase ${n.bg} ${n.text}`,children:n.label}),(0,eT.jsx)(a4,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground/40 transition-transform group-hover:translate-x-0.5"})]})},e.id)})})})}),(0,eT.jsx)(oS,{title:"Findings by severity",action:r?(0,eT.jsxs)("button",{type:"button",onClick:()=>b("security"),className:"inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground transition-colors hover:text-foreground",children:["view ",(0,eT.jsx)(s2,{className:"size-3"})]}):void 0,children:(0,eT.jsx)(o$,{segments:k})}),(0,eT.jsx)("div",{className:"lg:col-span-3",children:(0,eT.jsx)(oS,{title:"Most affected files",action:(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground",children:["issues ",(0,eT.jsx)(s2,{className:"size-3"})]}),children:(0,eT.jsx)("div",{className:"sm:columns-2 sm:gap-6",children:(0,eT.jsx)(oI,{rows:x,emptyLabel:"No issues across any files.",onSelect:e=>c(e)})})})})]})]})}let lB=eL("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]),lV=eL("trending-down",[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]]),lq=eL("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),lW=eL("history",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]),lH=eL("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),lG=[{key:"score",label:"Health score",invert:!1,stroke:"var(--chart-1)"},{key:"lintErrors",label:"Lint errors",invert:!0,stroke:"var(--chart-2)"},{key:"lintWarnings",label:"Lint warnings",invert:!0,stroke:"var(--chart-3)"},{key:"typeErrors",label:"Type errors",invert:!0,stroke:"var(--chart-4)"},{key:"securityFindings",label:"Security findings",invert:!0,stroke:"var(--chart-5)"}];function lK({history:e,report:t}){let[n,r]=(0,eP.useState)("score"),[i,a]=(0,eP.useState)(null),s=lG.find(e=>e.key===n),o=(0,eP.useMemo)(()=>[...e].reverse(),[e]);if(0===e.length)return(0,eT.jsxs)(s8,{className:"flex flex-col items-center gap-3 p-10 text-center",children:[(0,eT.jsx)(lW,{className:"size-8 text-muted-foreground"}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"No run history yet"}),(0,eT.jsxs)("p",{className:"mt-1 text-pretty text-xs leading-relaxed text-muted-foreground",children:["CodeLens records a trend point after every analysis in ",(0,eT.jsx)("span",{className:"font-mono",children:".codelens/history.json"}),". Run checks a few times to watch your project's health evolve here."]})]})]});let l=e[0],d=e[e.length-1],c=d.score-l.score;return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:lG.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>r(e.key),className:(0,ny.cn)("flex items-center gap-2 rounded-sm px-3 py-1.5 text-sm transition-colors",n===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)("span",{className:"size-2 rounded-[2px]",style:{background:e.stroke},"aria-hidden":!0}),e.label]},e.key))}),(0,eT.jsx)(s8,{className:"p-4",children:(0,eT.jsx)(lJ,{points:e,metric:s,hover:i,onHover:a})}),(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,eT.jsx)(lW,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"font-mono text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Run history"}),(0,eT.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground/60",children:[e.length," runs"]})]}),(0,eT.jsx)("div",{className:"overflow-hidden rounded-sm border border-border",children:(0,eT.jsxs)("table",{className:"w-full text-sm",children:[(0,eT.jsx)("thead",{children:(0,eT.jsxs)("tr",{className:"border-b border-border bg-secondary/30 text-left font-mono text-[10px] uppercase tracking-wide text-muted-foreground",children:[(0,eT.jsx)("th",{className:"px-3 py-2 font-medium",children:"When"}),(0,eT.jsx)("th",{className:"px-3 py-2 text-right font-medium",children:"Score"}),(0,eT.jsx)("th",{className:"hidden px-3 py-2 text-right font-medium sm:table-cell",children:"Lint"}),(0,eT.jsx)("th",{className:"hidden px-3 py-2 text-right font-medium sm:table-cell",children:"Types"}),(0,eT.jsx)("th",{className:"hidden px-3 py-2 text-right font-medium sm:table-cell",children:"Security"}),(0,eT.jsx)("th",{className:"px-3 py-2 text-right font-medium",children:"Δ"})]})}),(0,eT.jsx)("tbody",{children:o.map((t,n)=>{let r=e.length-1-n-1,i=r>=0?e[r]:null,a=i?t.score-i.score:0,s=0===n;return(0,eT.jsxs)("tr",{className:(0,ny.cn)("border-b border-border last:border-0 transition-colors hover:bg-secondary/30",s&&"bg-secondary/20"),children:[(0,eT.jsxs)("td",{className:"px-3 py-2 font-mono text-xs text-foreground",children:[l0(t.timestamp),s&&(0,eT.jsx)("span",{className:"ml-2 rounded-sm bg-primary px-1 py-0.5 font-mono text-[9px] uppercase text-primary-foreground",children:"latest"})]}),(0,eT.jsx)("td",{className:"px-3 py-2 text-right font-mono text-foreground",children:t.score}),(0,eT.jsx)("td",{className:"hidden px-3 py-2 text-right font-mono text-muted-foreground sm:table-cell",children:t.lintErrors+t.lintWarnings}),(0,eT.jsx)("td",{className:"hidden px-3 py-2 text-right font-mono text-muted-foreground sm:table-cell",children:t.typeErrors}),(0,eT.jsx)("td",{className:"hidden px-3 py-2 text-right font-mono text-muted-foreground sm:table-cell",children:t.securityFindings}),(0,eT.jsx)("td",{className:"px-3 py-2 text-right",children:(0,eT.jsx)(lY,{value:a})})]},t.runId)})})]})})]})]}),(0,eT.jsxs)("aside",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)(oS,{title:"Current",children:[(0,eT.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,eT.jsx)("span",{className:"font-mono text-4xl font-semibold tabular-nums text-foreground",children:t.health.score}),(0,eT.jsx)("span",{className:"font-mono text-sm text-muted-foreground",children:"/ 100"})]}),(0,eT.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono text-xs text-foreground",children:t.health.grade}),(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:"grade"})]})]}),(0,eT.jsx)(oS,{title:"Since first run",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,eT.jsx)(lX,{label:"Score change",value:lQ(c),positive:c>0,negative:c<0}),(0,eT.jsx)(lX,{label:"Lint resolved",value:lQ(l.lintErrors+l.lintWarnings-(d.lintErrors+d.lintWarnings)),positive:l.lintErrors+l.lintWarnings-(d.lintErrors+d.lintWarnings)>0}),(0,eT.jsx)(lX,{label:"Type errors fixed",value:lQ(l.typeErrors-d.typeErrors),positive:l.typeErrors-d.typeErrors>0}),(0,eT.jsx)(lX,{label:"Security closed",value:lQ(l.securityFindings-d.securityFindings),positive:l.securityFindings-d.securityFindings>0})]})}),(0,eT.jsx)(oS,{title:"Best & worst",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-2.5 text-sm",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Peak score"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:Math.max(...e.map(e=>e.score))})]}),(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Lowest score"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:Math.min(...e.map(e=>e.score))})]}),(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Average"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:Math.round(e.reduce((e,t)=>e+t.score,0)/e.length)})]})]})})]})]})}function lJ({points:e,metric:t,hover:n,onHover:r}){if(e.length<2)return(0,eT.jsx)("div",{className:"flex h-[140px] items-center justify-center text-xs text-muted-foreground",children:"Need at least two runs to plot a trend."});let i=e.map(e=>e[t.key]),a=Math.max(...i),s=Math.min(...i),o=a-s||1,l=e.map((n,r)=>({x:r/(e.length-1)*100,y:8+(1-(n[t.key]-s)/o)*124,p:n})),d=l.map((e,t)=>`${0===t?"M":"L"} ${e.x} ${e.y}`).join(" "),c=`${d} L 100 140 L 0 140 Z`,u=null!=n?l[n]:l[l.length-1];return(0,eT.jsxs)("div",{className:"relative",children:[(0,eT.jsxs)("svg",{viewBox:"0 0 100 140",preserveAspectRatio:"none",className:"h-[160px] w-full overflow-visible",role:"img","aria-label":`${t.label} across ${e.length} runs`,children:[(0,eT.jsx)("defs",{children:(0,eT.jsxs)("linearGradient",{id:`fill-${t.key}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,eT.jsx)("stop",{offset:"0%",stopColor:t.stroke,stopOpacity:"0.25"}),(0,eT.jsx)("stop",{offset:"100%",stopColor:t.stroke,stopOpacity:"0"})]})}),[.25,.5,.75].map(e=>(0,eT.jsx)("line",{x1:"0",x2:100,y1:8+124*e,y2:8+124*e,stroke:"var(--border)",strokeWidth:"0.5",vectorEffect:"non-scaling-stroke",strokeDasharray:"2 2"},e)),(0,eT.jsx)("path",{d:c,fill:`url(#fill-${t.key})`}),(0,eT.jsx)("path",{d:d,fill:"none",stroke:t.stroke,strokeWidth:"1.5",vectorEffect:"non-scaling-stroke"}),null!=n&&(0,eT.jsx)("line",{x1:u.x,x2:u.x,y1:8,y2:140,stroke:"var(--foreground)",strokeWidth:"0.5",vectorEffect:"non-scaling-stroke",strokeOpacity:"0.4"}),(0,eT.jsx)("circle",{cx:u.x,cy:u.y,r:"2.5",fill:t.stroke,vectorEffect:"non-scaling-stroke"}),l.map((t,n)=>(0,eT.jsx)("rect",{x:t.x-100/e.length/2,y:0,width:100/e.length,height:140,fill:"transparent",onMouseEnter:()=>r(n),onMouseLeave:()=>r(null)},n))]}),(0,eT.jsxs)("div",{className:"mt-2 flex items-center justify-between text-xs",children:[(0,eT.jsx)("span",{className:"font-mono text-muted-foreground",children:l0(u.p.timestamp)}),(0,eT.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,eT.jsxs)("span",{className:"text-muted-foreground",children:[t.label,":"]}),(0,eT.jsx)("span",{className:"font-mono font-semibold text-foreground",children:u.p[t.key]})]})]})]})}function lY({value:e}){if(0===e)return(0,eT.jsxs)("span",{className:"inline-flex items-center gap-0.5 font-mono text-xs text-muted-foreground",children:[(0,eT.jsx)(lq,{className:"size-3"}),"0"]});let t=e>0;return(0,eT.jsxs)("span",{className:(0,ny.cn)("inline-flex items-center gap-0.5 font-mono text-xs",t?"text-foreground":"text-muted-foreground"),children:[t?(0,eT.jsx)(lB,{className:"size-3"}):(0,eT.jsx)(lV,{className:"size-3"}),lQ(e)]})}function lX({label:e,value:t,positive:n,negative:r}){return(0,eT.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:e}),(0,eT.jsxs)("span",{className:(0,ny.cn)("inline-flex items-center gap-1 font-mono",n?"font-semibold text-foreground":r?"text-muted-foreground":"text-foreground"),children:[n?(0,eT.jsx)(lB,{className:"size-3"}):r?(0,eT.jsx)(lV,{className:"size-3"}):(0,eT.jsx)(lH,{className:"size-3"}),t]})]})}function lQ(e){return e>0?`+${e}`:`${e}`}function l0(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{month:"short",day:"numeric"})+" "+t.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}let l1=eL("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),l2=eL("grip-vertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]),l4=eL("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),l5=eL("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),l6={high:"High",medium:"Medium",low:"Low"};function l3(){let e=lN(lm),t=lN(lk),n=lu(),{viewIssue:r}=l$(),[i,a]=(0,eP.useState)(""),[s,o]=(0,eP.useState)("all"),[l,d]=(0,eP.useState)("all"),[c,u]=(0,eP.useState)(""),[m,p]=(0,eP.useState)(""),[f,h]=(0,eP.useState)(!1),[g,x]=(0,eP.useState)(null),[v,y]=(0,eP.useState)(null),[b,k]=(0,eP.useState)(null),[j,w]=(0,eP.useState)(null),N=(0,eP.useMemo)(()=>e.filter(e=>("all"===s||e.priority===s)&&("all"===l||("none"===l?!e.groupId:e.groupId===l))),[e,s,l]),_=(0,eP.useMemo)(()=>{let t=new Map,n=0;for(let r of e)r.groupId?t.set(r.groupId,(t.get(r.groupId)??0)+1):n++;return{map:t,ungrouped:n}},[e]),S=(0,eP.useMemo)(()=>{let e={};for(let t of n)e[t.id]=[];for(let t of N)e[t.columnId]||(e[t.columnId]=[]),e[t.columnId].push(t);return e},[N,n]),$=(0,eP.useMemo)(()=>new Set(n.filter(e=>e.done).map(e=>e.id)),[n]),I=e.filter(e=>$.has(e.columnId)).length;function E(e){e.issue?r(e.issue):x(e)}function C(){y(null),k(null),w(null)}return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,eT.jsxs)("form",{onSubmit:function(e){e.preventDefault();let t=i.trim();t&&(lf({title:t,groupId:"all"!==l&&"none"!==l?l:void 0,columnId:n[0]?.id}),a(""))},className:"flex flex-1 items-center gap-2",children:[(0,eT.jsxs)("div",{className:"relative flex-1",children:[(0,eT.jsx)(oO,{className:"pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),(0,eT.jsx)("input",{value:i,onChange:e=>a(e.target.value),placeholder:"Add a task…",className:"w-full rounded-sm border border-border bg-card py-2 pl-8 pr-3 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring","aria-label":"New task title"})]}),(0,eT.jsx)("button",{type:"submit",disabled:!i.trim(),className:"rounded-sm bg-primary px-3 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-40",children:"Add"})]}),(0,eT.jsx)("div",{className:"flex items-center gap-1 rounded-sm border border-border bg-card p-1",children:["all","high","medium","low"].map(e=>(0,eT.jsx)("button",{type:"button",onClick:()=>o(e),className:(0,ny.cn)("rounded-sm px-2.5 py-1 text-xs capitalize transition-colors",s===e?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:e},e))})]}),(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,eT.jsx)(de,{label:"All",count:e.length,active:"all"===l,onClick:()=>d("all")}),_.ungrouped>0&&(0,eT.jsx)(de,{label:"Ungrouped",count:_.ungrouped,active:"none"===l,onClick:()=>d("none")}),t.map(e=>(0,eT.jsx)(de,{label:e.name,count:_.map.get(e.id)??0,active:l===e.id,onClick:()=>d(e.id),onRemove:()=>{var t;t=e.id,lj(lk().filter(e=>e.id!==t)),lp(lm().map(e=>e.groupId===t?{...e,groupId:void 0}:e)),l===e.id&&d("all")}},e.id)),(0,eT.jsxs)("form",{onSubmit:function(e){e.preventDefault();let t=c.trim();if(!t)return;let n=lw(t);u(""),d(n.id)},className:"ml-auto flex items-center gap-1",children:[(0,eT.jsx)("input",{value:c,onChange:e=>u(e.target.value),placeholder:"New group…","aria-label":"New group name",className:"w-32 rounded-sm border border-border bg-card px-2 py-1 font-mono text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),(0,eT.jsx)("button",{type:"submit",disabled:!c.trim(),"aria-label":"Create group",className:"inline-flex size-7 items-center justify-center rounded-sm border border-border bg-card text-muted-foreground transition-colors hover:text-foreground disabled:opacity-40",children:(0,eT.jsx)(oO,{className:"size-3.5"})})]})]}),0===e.length?(0,eT.jsxs)(s8,{className:"flex flex-col items-center gap-3 p-10 text-center",children:[(0,eT.jsx)(e7,{className:"size-8 text-muted-foreground"}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"No tasks yet"}),(0,eT.jsxs)("p",{className:"mt-1 text-pretty text-xs leading-relaxed text-muted-foreground",children:["Add a task above, or open any finding across the dashboard and click"," ",(0,eT.jsx)("span",{className:"font-mono text-foreground",children:"Track task"})," to capture it here. Drag cards between columns, and use the column menu to rename or remove columns."]})]})]}):(0,eT.jsxs)("div",{className:"flex gap-3 overflow-x-auto pb-2",children:[n.map(e=>(0,eT.jsx)(l9,{column:e,tasks:S[e.id]??[],groups:t,isDropTarget:b===e.id,overTask:j,dragId:v,showClear:!!e.done&&I>0,canDelete:n.length>1,onClear:lb,onRename:t=>{var n;return n=e.id,void lc(ld().map(e=>e.id===n?{...e,name:t.trim()}:e))},onDelete:()=>(function(e){let t=ld();if(t.length<=1)return;let n=t.filter(t=>t.id!==e);lc(n);let r=n[0].id;lp(lm().map(t=>t.columnId===e?{...t,columnId:r}:t))})(e.id),onOpenTask:E,onDragStartTask:e=>y(e),onDragEndTask:C,onColumnDragOver:()=>{k(e.id),w(null)},onColumnDrop:()=>{var t;return t=e.id,void(v&&lv(v,t),C())},onTaskDragOver:t=>{w(t),k(e.id)},onTaskDrop:t=>{var n;return n=e.id,void(v&&v!==t&&lv(v,n,t),C())}},e.id)),(0,eT.jsx)("div",{className:"w-72 shrink-0",children:f?(0,eT.jsxs)("form",{onSubmit:function(e){e.preventDefault();let t=m.trim();t&&(!function(e){let t={id:ll("col"),name:e.trim()},n=ld(),r=n.findIndex(e=>e.done);if(r>=0){let e=[...n];e.splice(r,0,t),lc(e)}else lc([...n,t])}(t),p(""),h(!1))},className:"flex items-center gap-1 rounded-sm border border-border bg-card p-2",children:[(0,eT.jsx)("input",{autoFocus:!0,value:m,onChange:e=>p(e.target.value),onBlur:()=>!m.trim()&&h(!1),placeholder:"Column name…","aria-label":"New column name",className:"w-full rounded-sm border border-border bg-background px-2 py-1 font-mono text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"}),(0,eT.jsx)("button",{type:"submit",disabled:!m.trim(),"aria-label":"Confirm new column",className:"inline-flex size-7 shrink-0 items-center justify-center rounded-sm bg-primary text-primary-foreground disabled:opacity-40",children:(0,eT.jsx)(iq,{className:"size-3.5"})})]}):(0,eT.jsxs)("button",{type:"button",onClick:()=>h(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-sm border border-dashed border-border bg-card/40 py-2.5 font-mono text-xs text-muted-foreground transition-colors hover:border-foreground/30 hover:text-foreground",children:[(0,eT.jsx)(oO,{className:"size-3.5"}),"Add column"]})})]}),(0,eT.jsx)(l7,{task:g,columns:n,groups:t,onClose:()=>x(null),onViewIssue:e=>{x(null),r(e)}})]})}function l9({column:e,tasks:t,groups:n,isDropTarget:r,overTask:i,dragId:a,showClear:s,canDelete:o,onClear:l,onRename:d,onDelete:c,onOpenTask:u,onDragStartTask:m,onDragEndTask:p,onColumnDragOver:f,onColumnDrop:h,onTaskDragOver:g,onTaskDrop:x}){let[v,y]=(0,eP.useState)(!1),[b,k]=(0,eP.useState)(e.name),j=(0,eP.useRef)(null);function w(){let t=b.trim();t&&t!==e.name?d(t):k(e.name),y(!1)}return(0,eT.jsxs)("div",{className:"flex w-72 shrink-0 flex-col gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("size-2 shrink-0 rounded-full",e.done?"bg-foreground":"bg-muted-foreground"),"aria-hidden":!0}),v?(0,eT.jsx)("input",{ref:j,autoFocus:!0,value:b,onChange:e=>k(e.target.value),onBlur:w,onKeyDown:t=>{"Enter"===t.key&&w(),"Escape"===t.key&&(k(e.name),y(!1))},className:"min-w-0 flex-1 rounded-sm border border-border bg-background px-1.5 py-0.5 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring","aria-label":"Column name"}):(0,eT.jsx)("h3",{className:"truncate font-mono text-xs font-semibold uppercase tracking-wide text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:t.length}),(0,eT.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[s&&(0,eT.jsxs)("button",{type:"button",onClick:l,className:"inline-flex items-center gap-1 font-mono text-[10px] uppercase text-muted-foreground transition-colors hover:text-foreground",children:[(0,eT.jsx)(l1,{className:"size-3"}),"clear"]}),(0,eT.jsxs)(a5,{children:[(0,eT.jsx)(a6,{"aria-label":"Column options",className:"inline-flex size-6 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground",children:(0,eT.jsx)(l4,{className:"size-3.5"})}),(0,eT.jsxs)(a3,{align:"end",className:"min-w-40",children:[(0,eT.jsxs)(a8,{onClick:()=>{k(e.name),y(!0)},children:[(0,eT.jsx)(l5,{className:"size-3.5 text-muted-foreground"}),"Rename column"]}),(0,eT.jsxs)(a8,{variant:"destructive",disabled:!o,onClick:c,children:[(0,eT.jsx)(l1,{className:"size-3.5"}),"Delete column"]})]})]})]})]}),(0,eT.jsx)("div",{onDragOver:e=>{e.preventDefault(),f()},onDrop:e=>{e.preventDefault(),h()},className:(0,ny.cn)("flex min-h-24 flex-1 flex-col gap-2 rounded-sm border border-dashed p-2 transition-colors",r?"border-foreground/40 bg-secondary/40":"border-border"),children:0===t.length?(0,eT.jsx)("p",{className:"px-1 py-4 text-center font-mono text-[11px] text-muted-foreground/60",children:a?"drop here":"empty"}):t.map(e=>(0,eT.jsx)(l8,{task:e,groups:n,isDragging:a===e.id,showInsertLine:i===e.id&&null!==a&&a!==e.id,onOpen:()=>u(e),onDragStart:()=>m(e.id),onDragEnd:p,onDragOver:()=>g(e.id),onDrop:()=>x(e.id)},e.id))})]})}function l8({task:e,groups:t,isDragging:n,showInsertLine:r,onOpen:i,onDragStart:a,onDragEnd:s,onDragOver:o,onDrop:l}){let d=t.find(t=>t.id===e.groupId);return(0,eT.jsx)("div",{draggable:!0,onDragStart:t=>{t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/plain",e.id),a()},onDragEnd:s,onDragOver:e=>{e.preventDefault(),e.stopPropagation(),o()},onDrop:e=>{e.preventDefault(),e.stopPropagation(),l()},className:(0,ny.cn)("rounded-sm transition-opacity",r&&"border-t-2 border-foreground/50 pt-0.5",n&&"opacity-40"),children:(0,eT.jsxs)(s8,{className:"group gap-0 p-2.5",children:[(0,eT.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,eT.jsx)(l2,{className:"mt-0.5 size-3.5 shrink-0 cursor-grab text-muted-foreground/40","aria-hidden":!0}),(0,eT.jsx)(dt,{priority:e.priority}),(0,eT.jsx)("button",{type:"button",onClick:i,className:"min-w-0 flex-1 text-pretty text-left text-sm leading-snug text-foreground transition-colors hover:text-foreground",children:e.title}),e.issue&&(0,eT.jsx)(oE,{className:"mt-0.5 size-3 shrink-0 text-muted-foreground/50","aria-hidden":!0}),(0,eT.jsx)("button",{type:"button",onClick:()=>ly(e.id),"aria-label":"Delete task",className:"shrink-0 text-muted-foreground/50 opacity-0 transition-opacity hover:text-foreground group-hover:opacity-100",children:(0,eT.jsx)(sz,{className:"size-3.5"})})]}),(e.source||e.filePath||d)&&(0,eT.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 pl-5",children:[d&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-border bg-background px-1.5 py-0.5 font-mono text-[9px] text-foreground",children:[(0,eT.jsx)("span",{className:"size-1.5 rounded-full bg-foreground","aria-hidden":!0}),d.name]}),e.source&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[9px] uppercase text-muted-foreground",children:e.source}),e.filePath&&(0,eT.jsx)(lR,{path:e.filePath,line:e.line,className:"text-[10px]"})]})]})})}function l7({task:e,columns:t,groups:n,onClose:r,onViewIssue:i}){return(0,eT.jsx)(sO,{open:null!==e,onOpenChange:e=>!e&&r(),children:(0,eT.jsx)(sL,{className:"sm:max-w-md",children:e&&(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(sU,{children:[(0,eT.jsx)(sZ,{className:"text-pretty pr-6",children:e.title}),(0,eT.jsxs)(sF,{children:["Created ",new Date(e.createdAt).toLocaleString()," · Updated"," ",new Date(e.updatedAt).toLocaleString()]})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,eT.jsxs)("label",{className:"flex flex-col gap-1 font-mono text-[10px] uppercase text-muted-foreground",children:["Column",(0,eT.jsx)("select",{value:e.columnId,onChange:t=>lx(e.id,{columnId:t.target.value}),className:"rounded-sm border border-border bg-background px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring",children:t.map(e=>(0,eT.jsx)("option",{value:e.id,children:e.name},e.id))})]}),(0,eT.jsxs)("label",{className:"flex flex-col gap-1 font-mono text-[10px] uppercase text-muted-foreground",children:["Priority",(0,eT.jsx)("select",{value:e.priority,onChange:t=>lx(e.id,{priority:t.target.value}),className:"rounded-sm border border-border bg-background px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring",children:["high","medium","low"].map(e=>(0,eT.jsx)("option",{value:e,children:l6[e]},e))})]})]}),(0,eT.jsxs)("label",{className:"flex flex-col gap-1 font-mono text-[10px] uppercase text-muted-foreground",children:["Group",(0,eT.jsxs)("select",{value:e.groupId??"",onChange:t=>{lx(e.id,{groupId:t.target.value||void 0})},className:"rounded-sm border border-border bg-background px-2 py-1 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring",children:[(0,eT.jsx)("option",{value:"",children:"No group"}),n.map(e=>(0,eT.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,eT.jsxs)("label",{className:"flex flex-col gap-1 font-mono text-[10px] uppercase text-muted-foreground",children:["Notes",(0,eT.jsx)("textarea",{value:e.note??"",onChange:t=>lx(e.id,{note:t.target.value}),rows:4,placeholder:"Add details, links, or a remediation plan…",className:"resize-y rounded-sm border border-border bg-background px-2 py-1.5 text-sm leading-relaxed text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring"})]}),e.source&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2 rounded-sm border border-border bg-background p-3",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.source}),e.severity&&(0,eT.jsx)("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] uppercase text-foreground",children:e.severity})]}),e.issue?.recommendation&&(0,eT.jsx)("p",{className:"text-pretty text-xs leading-relaxed text-muted-foreground",children:e.issue.recommendation}),e.filePath&&(0,eT.jsx)("div",{className:"font-mono text-[11px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath,line:e.line})}),e.issue&&o8(e.issue).length>0&&(0,eT.jsx)("div",{className:"flex flex-wrap gap-1.5",children:o8(e.issue).map(e=>(0,eT.jsxs)("a",{href:e.href,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground transition-colors hover:text-foreground",children:[(0,eT.jsx)(oE,{className:"size-3"}),e.label]},e.href))}),e.issue&&(0,eT.jsxs)("button",{type:"button",onClick:()=>i(e.issue),className:"inline-flex items-center justify-center gap-1.5 self-start rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-foreground transition-colors hover:bg-secondary",children:[(0,eT.jsx)(oE,{className:"size-3.5 text-muted-foreground"}),"View full analysis"]})]}),!e.source&&e.filePath&&(0,eT.jsx)("div",{className:"font-mono text-[11px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath,line:e.line})}),(0,eT.jsxs)("button",{type:"button",onClick:()=>{ly(e.id),r()},className:"inline-flex items-center justify-center gap-1.5 self-start rounded-sm border border-destructive/40 px-2.5 py-1.5 font-mono text-xs text-destructive transition-colors hover:bg-destructive/10",children:[(0,eT.jsx)(l1,{className:"size-3.5"}),"Delete task"]})]})]})})})}function de({label:e,count:t,active:n,onClick:r,onRemove:i}){return(0,eT.jsxs)("span",{className:(0,ny.cn)("group/chip inline-flex items-center gap-1.5 rounded-sm border px-2.5 py-1 text-xs transition-colors",n?"border-foreground/40 bg-secondary text-foreground":"border-border bg-card text-muted-foreground hover:text-foreground"),children:[(0,eT.jsxs)("button",{type:"button",onClick:r,className:"inline-flex items-center gap-1.5",children:[e,(0,eT.jsx)("span",{className:"font-mono text-[10px] tabular-nums text-muted-foreground",children:t})]}),i&&(0,eT.jsx)("button",{type:"button",onClick:i,"aria-label":`Delete group ${e}`,className:"text-muted-foreground/50 transition-colors hover:text-foreground",children:(0,eT.jsx)(sz,{className:"size-3"})})]})}function dt({priority:e}){return(0,eT.jsx)("span",{className:(0,ny.cn)("mt-1 size-2 shrink-0 rounded-full","high"===e?"bg-foreground":"medium"===e?"bg-muted-foreground":"border border-muted-foreground bg-transparent"),"aria-hidden":!0,title:`${e} priority`})}function dn({active:e,onClick:t,children:n,count:r}){return(0,eT.jsxs)("button",{type:"button",onClick:t,className:`flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors ${e?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"}`,children:[n,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:r})]})}function dr({msg:e,showFile:t}){let{viewIssue:n}=l$(),r=oV(e.severity);return(0,eT.jsx)("div",{className:"border-t border-border first:border-t-0",children:(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>n(oH(e)),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),n(oH(e)))},className:"flex w-full cursor-pointer items-start gap-3 px-4 py-3 text-left transition-colors hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:`mt-1 size-2 shrink-0 rounded-full ${r.dot}`,"aria-hidden":!0}),(0,eT.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("span",{className:"text-sm text-foreground",children:e.message}),(0,eT.jsxs)("span",{className:"mt-1 flex flex-wrap items-center gap-2 font-mono text-xs text-muted-foreground",children:[t&&(0,eT.jsx)(lR,{path:e.filePath,line:e.line,column:e.column}),!t&&(0,eT.jsxs)("span",{children:[e.line,":",e.column]}),!t&&e.ruleId&&(0,eT.jsx)("span",{className:`rounded-sm px-1.5 py-0.5 ${r.bg} ${r.text}`,children:e.ruleId}),e.fixable&&(0,eT.jsx)("span",{className:"rounded-sm bg-[color:var(--sev-ok)]/12 px-1.5 py-0.5 text-[color:var(--sev-ok)]",children:"auto-fixable"})]})]}),(0,eT.jsx)(lM,{issue:oH(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})})}function di({lint:e}){let[t,n]=(0,eP.useState)("all"),[r,i]=(0,eP.useState)("file"),[a,s]=(0,eP.useState)(null),o=(0,eP.useMemo)(()=>e.messages.filter(e=>(!a||e.ruleId===a)&&("all"===t||("fixable"===t?e.fixable:e.severity===t))),[e.messages,t,a]),l=(0,eP.useMemo)(()=>{let e=new Map;for(let t of o){let n="file"===r?t.filePath:t.ruleId??"(no rule)",i=e.get(n)??[];i.push(t),e.set(n,i)}return[...e.entries()].sort((e,t)=>t[1].length-e[1].length)},[o,r]),d=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.messages){let e=n.ruleId??"(no rule)";t.set(e,(t.get(e)??0)+1)}return[...t.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count)},[e.messages]);return e.unavailable?(0,eT.jsxs)(s8,{className:"p-6 text-sm text-muted-foreground",children:["ESLint could not run. ",e.note]}):(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsxs)(oS,{title:"Breakdown",children:[(0,eT.jsx)(o$,{segments:[{label:"Errors",value:e.errorCount,color:"var(--sev-critical)"},{label:"Warnings",value:e.warningCount,color:"var(--sev-medium)"}]}),(0,eT.jsxs)("p",{className:"mt-3 border-t border-border pt-3 text-xs text-muted-foreground",children:[(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.fixableCount})," of"," ",(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.messages.length})," auto-fixable"]})]}),(0,eT.jsx)(oS,{title:"Rules",action:a?(0,eT.jsxs)("button",{type:"button",onClick:()=>s(null),className:"inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground hover:text-foreground",children:["clear ",(0,eT.jsx)(sz,{className:"size-3"})]}):void 0,children:(0,eT.jsx)(oI,{rows:d,activeKey:a,onSelect:e=>s(t=>t===e?null:e)})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:[(0,eT.jsx)(dn,{active:"all"===t,onClick:()=>n("all"),count:e.messages.length,children:"All"}),(0,eT.jsx)(dn,{active:"error"===t,onClick:()=>n("error"),count:e.errorCount,children:"Errors"}),(0,eT.jsx)(dn,{active:"warning"===t,onClick:()=>n("warning"),count:e.warningCount,children:"Warnings"}),(0,eT.jsx)(dn,{active:"fixable"===t,onClick:()=>n("fixable"),count:e.fixableCount,children:"Auto-fixable"})]}),(0,eT.jsxs)("div",{className:"flex items-center gap-1 rounded-sm border border-border bg-card p-1",children:[(0,eT.jsx)("span",{className:"px-2 font-mono text-[10px] uppercase text-muted-foreground",children:"Group"}),(0,eT.jsx)("button",{type:"button",onClick:()=>i("file"),className:`rounded-sm px-2.5 py-1.5 text-sm transition-colors ${"file"===r?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"}`,children:"File"}),(0,eT.jsx)("button",{type:"button",onClick:()=>i("rule"),className:`rounded-sm px-2.5 py-1.5 text-sm transition-colors ${"rule"===r?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"}`,children:"Rule"})]})]}),a&&(0,eT.jsxs)("div",{className:"flex items-center gap-2 rounded-sm border border-border bg-secondary/30 px-3 py-2 text-xs",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Filtered by rule"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:a}),(0,eT.jsxs)("button",{type:"button",onClick:()=>s(null),className:"ml-auto inline-flex items-center gap-1 text-muted-foreground hover:text-foreground",children:["clear ",(0,eT.jsx)(sz,{className:"size-3"})]})]}),0===l.length?(0,eT.jsx)(s8,{className:"p-8 text-center text-sm text-muted-foreground",children:"No matching issues."}):l.map(([e,t])=>{let n="rule"===r?oV(t[0].severity):null;return(0,eT.jsxs)(s8,{className:"gap-0 overflow-hidden py-0",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between border-b border-border bg-secondary/30 px-4 py-2.5",children:[(0,eT.jsxs)("span",{className:"flex min-w-0 items-center gap-2",children:[n&&(0,eT.jsx)("span",{className:`size-2 shrink-0 rounded-full ${n.dot}`,"aria-hidden":!0}),"file"===r?(0,eT.jsx)(lR,{path:e,className:"truncate text-sm"}):(0,eT.jsx)("span",{className:"truncate font-mono text-sm text-foreground",children:e})]}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:t.length})]}),(0,eT.jsx)("div",{children:t.map((e,t)=>(0,eT.jsx)(dr,{msg:e,showFile:"rule"===r},`${e.filePath}-${e.line}-${e.column}-${t}`))})]},e)})]})]})}let da=eL("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),ds=eL("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),dl=eL("brackets",[["path",{d:"M16 3h3a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1h-3",key:"1kt8lf"}],["path",{d:"M8 21H5a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h3",key:"gduv9"}]]),dd=eL("hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]),dc=eL("box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]),du=eL("square-function",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3",key:"m1af9g"}],["path",{d:"M9 11.2h5.7",key:"3zgcl2"}]]),dm=eL("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),dp=eL("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]),df={interface:{label:"interface",icon:eF,color:"var(--chart-1)"},type:{label:"type",icon:dl,color:"var(--chart-2)"},enum:{label:"enum",icon:dd,color:"var(--chart-3)"},class:{label:"class",icon:dc,color:"var(--chart-4)"},function:{label:"function",icon:du,color:"var(--chart-5)"}};function dh({m:e}){return(0,eT.jsxs)("div",{className:"flex items-baseline gap-2 border-t border-border py-2 font-mono text-xs first:border-t-0",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-foreground",children:[e.readonly&&(0,eT.jsx)(dm,{className:"size-3 text-muted-foreground","aria-label":"readonly"}),e.name,e.optional&&(0,eT.jsx)("span",{className:"text-muted-foreground",children:"?"})]}),(0,eT.jsx)("span",{className:"text-muted-foreground",children:":"}),(0,eT.jsx)("span",{className:"text-[color:var(--chart-2)]",children:e.type}),e.doc&&(0,eT.jsx)("span",{className:"ml-auto truncate text-[11px] text-muted-foreground",children:e.doc})]})}function dg({def:e,onSelectName:t}){let n=df[e.kind];return(0,eT.jsxs)(s8,{className:"gap-0 p-4",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)(n.icon,{className:"size-4",style:{color:n.color}}),(0,eT.jsx)("span",{className:"font-mono text-sm font-semibold text-foreground",children:e.name})]}),e.generics&&e.generics.length>0&&(0,eT.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:`<${e.generics.join(", ")}>`}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-[10px] uppercase",children:n.label}),e.exported?(0,eT.jsx)(nS,{className:"border-0 bg-[color:var(--sev-ok)]/12 font-mono text-[10px] uppercase text-[color:var(--sev-ok)]",children:"exported"}):(0,eT.jsx)(nS,{variant:"outline",className:"font-mono text-[10px] uppercase text-muted-foreground",children:"local"})]}),e.doc&&(0,eT.jsx)("p",{className:"mt-2 text-pretty text-sm leading-relaxed text-muted-foreground",children:e.doc}),(0,eT.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2 font-mono text-[11px] text-muted-foreground",children:[(0,eT.jsx)(lR,{path:e.filePath,line:e.line}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(dp,{className:"size-3"}),e.references," refs"]})]}),e.extendsFrom&&e.extendsFrom.length>0&&(0,eT.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:"extends"}),e.extendsFrom.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>t(e),className:"inline-flex items-center gap-1 rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-foreground hover:bg-secondary/70",children:[e,(0,eT.jsx)(oE,{className:"size-2.5"})]},e))]}),e.members.length>0&&(0,eT.jsxs)("div",{className:"mt-4",children:[(0,eT.jsxs)("span",{className:"text-[11px] font-medium text-muted-foreground",children:["enum"===e.kind?"Members":"Properties"," (",e.members.length,")"]}),(0,eT.jsx)("div",{className:"mt-1",children:e.members.map(e=>(0,eT.jsx)(dh,{m:e},e.name))})]}),(0,eT.jsxs)("div",{className:"mt-4",children:[(0,eT.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:"Declaration"}),(0,eT.jsx)("pre",{className:"mt-1 overflow-x-auto rounded-sm border border-border bg-background p-3 font-mono text-xs leading-relaxed text-foreground",children:(0,eT.jsx)("code",{children:e.source})})]})]})}function dx({definitions:e}){let[t,n]=(0,eP.useState)(""),[r,i]=(0,eP.useState)("all"),[a,s]=(0,eP.useState)(e[0]?.id??""),o=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.kind,(t.get(n.kind)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:df[e].label,count:t})).sort((e,t)=>t.count-e.count)},[e]),l=(0,eP.useMemo)(()=>{let n=t.trim().toLowerCase();return e.filter(e=>"all"===r||e.kind===r).filter(e=>!n||e.name.toLowerCase().includes(n)||e.filePath.toLowerCase().includes(n)).sort((e,t)=>t.references-e.references)},[e,r,t]),d=(0,eP.useMemo)(()=>e.find(e=>e.id===a)??l[0]??e[0],[e,a,l]),c=e.filter(e=>e.exported).length,u=[{key:"all",label:"All",count:e.length},...o.map(e=>({key:e.key,label:e.label,count:e.count}))];return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[300px_1fr]",children:[(0,eT.jsxs)("aside",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsx)(oS,{title:"Type inventory",children:(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.length}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"declared"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:c}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"exported"})]})]})}),(0,eT.jsx)(oS,{title:"By kind",children:(0,eT.jsx)(oI,{rows:o,activeKey:"all"===r?null:r,onSelect:e=>i(t=>t===e?"all":e)})}),(0,eT.jsxs)(s8,{className:"gap-0 p-3",children:[(0,eT.jsxs)("div",{className:"relative",children:[(0,eT.jsx)(eX,{className:"absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),(0,eT.jsx)("input",{value:t,onChange:e=>n(e.target.value),placeholder:"Filter types…",className:"w-full rounded-sm border border-border bg-background py-1.5 pl-8 pr-2 text-sm text-foreground outline-none placeholder:text-muted-foreground focus:border-ring"})]}),(0,eT.jsx)("div",{className:"mt-3 flex flex-wrap gap-1",children:u.map(e=>(0,eT.jsx)("button",{type:"button",onClick:()=>i(e.key),className:(0,ny.cn)("rounded-sm px-2 py-0.5 text-xs transition-colors",r===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:e.label},e.key))}),(0,eT.jsx)("div",{className:"mt-3 flex max-h-[460px] flex-col overflow-y-auto",children:0===l.length?(0,eT.jsx)("p",{className:"py-6 text-center text-xs text-muted-foreground",children:"No types match."}):l.map(e=>{let t=df[e.kind],n=d?.id===e.id;return(0,eT.jsxs)("button",{type:"button",onClick:()=>s(e.id),className:(0,ny.cn)("flex items-center gap-2 rounded-sm border-t border-border px-2 py-2 text-left transition-colors first:border-t-0",n?"bg-secondary":"hover:bg-secondary/40"),children:[(0,eT.jsx)(t.icon,{className:"size-3.5 shrink-0",style:{color:t.color}}),(0,eT.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:e.name}),!e.exported&&(0,eT.jsx)(dm,{className:"size-3 shrink-0 text-muted-foreground","aria-label":"local"}),(0,eT.jsx)("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground",children:e.references})]},e.id)})})]})]}),(0,eT.jsx)("div",{className:"min-w-0",children:d?(0,eT.jsx)(dg,{def:d,onSelectName:function(t){let n=e.find(e=>e.name===t);n&&s(n.id)}}):(0,eT.jsx)(s8,{className:"p-6 text-sm text-muted-foreground",children:"Select a type to explore its shape."})})]})}function dv({diag:e}){let{viewIssue:t}=l$(),n=e.related.length>0;return(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(oG(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(oG(e)))},className:"flex w-full cursor-pointer items-start gap-3 p-4 text-left transition-colors hover:bg-secondary/40",children:[(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2 font-mono text-xs text-muted-foreground",children:[(0,eT.jsx)(si,{className:"size-3.5 shrink-0"}),(0,eT.jsx)(lR,{path:e.filePath,line:e.line,column:e.column}),(0,eT.jsxs)("span",{className:"ml-auto flex shrink-0 items-center gap-2",children:[n&&(0,eT.jsxs)("span",{className:"flex items-center gap-1 text-muted-foreground",children:[(0,eT.jsx)(oT,{className:"size-3.5"}),e.related.length]}),(0,eT.jsx)("span",{className:"rounded-sm bg-[color:var(--sev-high)]/12 px-1.5 py-0.5 text-[color:var(--sev-high)]",children:e.code})]})]}),(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm leading-relaxed text-foreground",children:e.message})]}),(0,eT.jsx)(lM,{issue:oG(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})})}function dy({types:e}){let t=e.definitions??[],[n,r]=(0,eP.useState)("diagnostics");if(e.unavailable)return(0,eT.jsxs)(s8,{className:"p-6 text-sm text-muted-foreground",children:["TypeScript was not detected in this project. ",e.note]});let i=[{key:"diagnostics",label:"Diagnostics",icon:ds,count:e.diagnostics.length},{key:"explorer",label:"Type explorer",icon:eF,count:t.length}];return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 self-start rounded-sm border border-border bg-card p-1",children:i.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>r(e.key),disabled:"explorer"===e.key&&0===t.length,className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors disabled:opacity-40",n===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)(e.icon,{className:"size-4"}),e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),"explorer"===n&&t.length>0?(0,eT.jsx)(dx,{definitions:t}):(0,eT.jsx)(db,{types:e})]})}function db({types:e}){let t=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.diagnostics)t.set(n.filePath,(t.get(n.filePath)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count)},[e.diagnostics]),n=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.diagnostics)t.set(n.code,(t.get(n.code)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count)},[e.diagnostics]);return 0===e.diagnostics.length?(0,eT.jsxs)(s8,{className:"flex flex-col items-center justify-center gap-3 py-16 text-center",children:[(0,eT.jsx)(da,{className:"size-8 text-[color:var(--sev-ok)]"}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"No type errors"}),(0,eT.jsx)("p",{className:"text-sm text-muted-foreground",children:"tsc --noEmit passed cleanly."})]})]}):(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsx)(oS,{title:"Affected files",children:(0,eT.jsx)(oI,{rows:t})}),(0,eT.jsx)(oS,{title:"Error codes",children:(0,eT.jsx)(oI,{rows:n})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[(0,eT.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:[e.diagnostics.length," type ",1===e.diagnostics.length?"error":"errors"," — click to expand the diagnostic chain"]}),e.diagnostics.map((e,t)=>(0,eT.jsx)(dv,{diag:e},`${e.filePath}-${e.line}-${t}`))]})]})}let dk=eL("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),dj=eL("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),dw=eL("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);function dN({finding:e}){let{viewIssue:t}=l$(),n=oV(e.severity);return(0,eT.jsx)(s8,{className:(0,ny.cn)("gap-0 overflow-hidden border-l-2 py-0",n.border),children:(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(oK(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(oK(e)))},className:"flex w-full cursor-pointer items-start gap-3 p-4 text-left transition-colors hover:bg-secondary/40",children:[(0,eT.jsx)(eB,{className:(0,ny.cn)("mt-0.5 size-4 shrink-0",n.text)}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.category}),(0,eT.jsx)(lR,{path:e.filePath,line:e.line}),(0,eT.jsxs)("span",{className:"ml-auto font-mono text-[10px] text-muted-foreground",children:[Math.round(100*e.confidence),"% conf."]})]}),(0,eT.jsx)("p",{className:"mt-2 text-pretty text-sm font-medium text-foreground",children:e.title}),(0,eT.jsx)("p",{className:"mt-1 line-clamp-2 text-pretty text-sm leading-relaxed text-muted-foreground",children:e.description})]}),(0,eT.jsx)(lM,{issue:oK(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})})}let d_=["critical","high","medium","low","info"];function dS({rescanning:e,onClick:t}){return(0,eT.jsxs)("button",{type:"button",onClick:t,disabled:e,className:"inline-flex items-center gap-1.5 rounded-sm border border-border px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground disabled:cursor-not-allowed disabled:opacity-60",children:[e?(0,eT.jsx)(dj,{className:"size-3.5 animate-spin"}):(0,eT.jsx)(dk,{className:"size-3.5"}),e?"Rescanning…":"Rescan security"]})}function d$({security:e}){let[t,n]=(0,eP.useState)("all"),{rescanning:r,error:i,rescan:a}=function(e){let[t,n]=(0,eP.useState)(!1),[r,i]=(0,eP.useState)(null),a=(0,eP.useRef)(e);return(0,eP.useEffect)(()=>{a.current!==e&&(a.current=e,n(!1))},[e]),(0,eP.useEffect)(()=>{if(!t)return;let e=window.setTimeout(()=>n(!1),12e4);return()=>window.clearTimeout(e)},[t]),{rescanning:t,error:r,rescan:(0,eP.useCallback)(async()=>{i(null),n(!0);try{let e=await fetch("/api/run?scope=security",{method:"POST"});if(!e.ok&&409!==e.status)throw Error(501===e.status?"Rescan needs the CodeLens CLI backend":`Rescan failed (${e.status})`)}catch(e){n(!1),i(e instanceof Error?e.message:"Rescan failed")}},[])}}(e),s=(0,eP.useMemo)(()=>[...e.findings].sort(oq),[e.findings]),o=(0,eP.useMemo)(()=>"all"===t?s:s.filter(e=>e.severity===t),[s,t]),l=(0,eP.useMemo)(()=>{let t=[{key:"all",label:"All",count:e.findings.length}];for(let n of d_){let r=e.findings.filter(e=>e.severity===n).length;r>0&&t.push({key:n,label:oV(n).label,count:r})}return t},[e.findings]),d=["critical","high","medium","low","info"].map((t,n)=>({label:oV(t).label,value:e.findings.filter(e=>e.severity===t).length,color:`var(--chart-${n+1})`})),c=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.findings)t.set(n.category,(t.get(n.category)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count)},[e.findings]),u=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.findings)t.set(n.filePath,(t.get(n.filePath)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count)},[e.findings]);if(e.skipped)return(0,eT.jsxs)(s8,{className:"flex flex-col items-center justify-center gap-3 py-16 text-center",children:[(0,eT.jsx)(eB,{className:"size-8 text-muted-foreground"}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"AI security audit skipped"}),(0,eT.jsx)("p",{className:"max-w-sm text-pretty text-sm text-muted-foreground",children:"No AI key was configured. Set AI_GATEWAY_API_KEY to enable the code review and dependency prioritization."})]}),(0,eT.jsx)(dS,{rescanning:r,onClick:a}),i&&(0,eT.jsx)("p",{className:"font-mono text-xs text-[color:var(--sev-critical)]",children:i})]});let m=e.findings.filter(e=>"critical"===e.severity||"high"===e.severity).length,p=e.findings.length>0?Math.round(e.findings.reduce((e,t)=>e+t.confidence,0)/e.findings.length*100):0;return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsxs)(oS,{title:"Posture",children:[(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.findings.length}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"code findings"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:m}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"critical + high"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:c.length}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"categories"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsxs)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:[p,"%"]}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"avg confidence"})]})]}),(0,eT.jsxs)("p",{className:"mt-3 border-t border-border pt-3 text-xs leading-relaxed text-muted-foreground",children:["Dependency advisories now live in the"," ",(0,eT.jsx)("span",{className:"font-mono text-foreground",children:"Dependencies"})," tab."]})]}),(0,eT.jsx)(oS,{title:"By severity",children:(0,eT.jsx)(o$,{segments:d})}),(0,eT.jsx)(oS,{title:"By category",children:(0,eT.jsx)(oI,{rows:c,emptyLabel:"No findings."})}),(0,eT.jsx)(oS,{title:"Affected files",children:(0,eT.jsx)(oI,{rows:u,emptyLabel:"No findings."})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-3",children:[(e.failed||i)&&(0,eT.jsxs)(s8,{className:"flex items-start gap-3 border-l-2 border-l-[color:var(--sev-high)] bg-[color:var(--sev-high)]/[0.06] p-4",children:[(0,eT.jsx)(dw,{className:"mt-0.5 size-4 shrink-0 text-[color:var(--sev-high)]"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"AI security review error"}),(0,eT.jsx)("p",{className:"mt-1 text-pretty text-sm leading-relaxed text-muted-foreground",children:i??e.error??"The AI review failed. Results below may be incomplete."})]}),(0,eT.jsx)(dS,{rescanning:r,onClick:a})]}),e.findings.length>0&&(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:l.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eB,{className:"size-4 text-[color:var(--sev-high)]"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Code findings"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:o.length}),(0,eT.jsx)("span",{className:"ml-auto hidden font-mono text-xs text-muted-foreground sm:inline",children:"click a finding for full detail"}),!e.failed&&!i&&(0,eT.jsx)("div",{className:"ml-auto sm:ml-0",children:(0,eT.jsx)(dS,{rescanning:r,onClick:a})})]}),0===e.findings.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No code-level security issues found by the AI review."]}):0===o.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No findings at this severity."]}):(0,eT.jsx)("div",{className:"flex flex-col gap-2",children:o.map(e=>(0,eT.jsx)(dN,{finding:e},e.id))})]})]})}let dI=eL("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);function dE(e){if(e.flagged&&e.severity)return`var(--chart-${dC(e.severity)})`;switch(e.type){case"direct":return"var(--chart-1)";case"dev":return"var(--chart-4)";default:return"var(--muted-foreground)"}}function dC(e){return({critical:1,high:2,medium:3,low:4,info:5})[e]??5}function dA({graph:e}){let[t,n]=(0,eP.useState)(null),[r,i]=(0,eP.useState)(null),[a,s]=(0,eP.useState)(null),o=(0,eP.useMemo)(()=>Math.max(...e.nodes.map(e=>e.depth)),[e.nodes]),{positioned:l,byId:d,width:c,height:u}=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.nodes){let e=t.get(n.depth)??[];e.push(n),t.set(n.depth,e)}let n=[],r=0;for(let e=0;e<=o;e++){let i=(t.get(e)??[]).sort((e,t)=>!!t.flagged!=!!e.flagged?t.flagged?1:-1:(t.sizeKb??0)-(e.sizeKb??0));r=Math.max(r,i.length),i.forEach((t,r)=>{n.push({...t,x:24+240*e,y:24+46*r})})}let i=new Map(n.map(e=>[e.id,e]));return{positioned:n,byId:i,width:48+240*o+176,height:48+46*r}},[e.nodes,o]),m=(0,eP.useMemo)(()=>{let e=[];for(let t of l)for(let n of t.dependencies){let r=d.get(n);r&&e.push({from:t,to:r})}return e},[l,d]),p=t??r,f=(0,eP.useMemo)(()=>{if(!p)return null;let e=d.get(p);return e?{deps:new Set(e.dependencies.filter(e=>d.has(e))),dependents:new Set(l.filter(e=>e.dependencies.includes(p)).map(e=>e.id))}:null},[p,d,l]),h=t?d.get(t):null,g=t?l.filter(e=>e.dependencies.includes(t)):[],x=e.nodes.filter(e=>"direct"===e.type).length,v=e.nodes.filter(e=>"dev"===e.type).length,y=e.nodes.filter(e=>e.flagged).length,b=e.nodes.reduce((e,t)=>e+(t.sizeKb??0),0);return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)(s8,{className:"min-w-0 gap-0 overflow-hidden py-0",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-b border-border p-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(s9,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("span",{className:"text-sm font-semibold text-foreground",children:"Module graph"})]}),(0,eT.jsxs)("div",{className:"ml-auto flex flex-wrap items-center gap-1 rounded-sm border border-border bg-background p-0.5",children:[(0,eT.jsx)("button",{type:"button",onClick:()=>s(null),className:(0,ny.cn)("rounded-sm px-2.5 py-1 text-xs transition-colors",null===a?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:"All depths"}),Array.from({length:o+1}).map((e,t)=>(0,eT.jsxs)("button",{type:"button",onClick:()=>s(e=>e===t?null:t),className:(0,ny.cn)("rounded-sm px-2.5 py-1 font-mono text-xs transition-colors",a===t?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:["L",t]},t))]})]}),(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-4 border-b border-border px-3 py-2 text-[11px] text-muted-foreground",children:[(0,eT.jsx)(dT,{color:"var(--chart-1)",label:"direct"}),(0,eT.jsx)(dT,{color:"var(--chart-4)",label:"dev"}),(0,eT.jsx)(dT,{color:"var(--muted-foreground)",label:"transitive"}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)(dw,{className:"size-3 text-[color:var(--sev-high)]"})," flagged"]}),(0,eT.jsx)("span",{className:"ml-auto hidden sm:inline",children:"Click a node to inspect its edges"})]}),(0,eT.jsx)("div",{className:"overflow-auto bg-[image:radial-gradient(var(--border)_1px,transparent_1px)] [background-size:16px_16px]",children:(0,eT.jsxs)("svg",{width:c,height:u,viewBox:`0 0 ${c} ${u}`,className:"min-w-full",role:"img","aria-label":"Dependency graph",children:[(0,eT.jsx)("g",{children:m.map((e,t)=>{let n=null!==a&&e.from.depth!==a&&e.to.depth!==a,r=e.from.x+176,i=e.from.y+15,s=e.to.x,o=e.to.y+15,l=(r+s)/2,d=!!p&&(e.from.id===p||e.to.id===p);return(0,eT.jsx)("path",{d:`M ${r} ${i} C ${l} ${i}, ${l} ${o}, ${s} ${o}`,fill:"none",stroke:d?"var(--chart-1)":"var(--border)",strokeWidth:d?1.6:1,opacity:n?.15:p&&!d?.25:.7},t)})}),(0,eT.jsx)("g",{children:l.map(e=>{var t;let r=(t=e.id,p?t===p?"active":f?.deps.has(t)||f?.dependents.has(t)?"linked":"dim":"normal"),s=null!==a&&e.depth!==a,o=dE(e);return(0,eT.jsxs)("g",{transform:`translate(${e.x}, ${e.y})`,opacity:s?.2:"dim"===r?.3:1,className:"cursor-pointer",onMouseEnter:()=>i(e.id),onMouseLeave:()=>i(null),onClick:()=>n(t=>t===e.id?null:e.id),children:[(0,eT.jsx)("rect",{width:176,height:30,rx:4,fill:"var(--card)",stroke:"active"===r?o:"var(--border)",strokeWidth:"active"===r?2:1}),(0,eT.jsx)("rect",{width:4,height:30,rx:2,fill:o}),(0,eT.jsx)("text",{x:14,y:15,dominantBaseline:"central",className:"fill-foreground font-mono",fontSize:11,children:e.id.length>18?e.id.slice(0,17)+"…":e.id}),e.flagged&&(0,eT.jsx)("circle",{cx:164,cy:15,r:3,fill:`var(--chart-${dC(e.severity??"info")})`})]},e.id)})})]})})]}),(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsxs)(s8,{className:"gap-0 p-4",children:[(0,eT.jsx)("h3",{className:"mb-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Graph stats"}),(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsx)(dP,{icon:eq,value:e.nodes.length,label:"modules"}),(0,eT.jsx)(dP,{icon:te,value:x,label:"direct"}),(0,eT.jsx)(dP,{icon:s4,value:v,label:"dev"}),(0,eT.jsx)(dP,{icon:dw,value:y,label:"flagged"})]}),(0,eT.jsxs)("p",{className:"mt-3 border-t border-border pt-3 text-xs text-muted-foreground",children:["install size ≈ ",(0,eT.jsxs)("span",{className:"font-mono text-foreground",children:[(b/1024).toFixed(1)," MB"]})," ·"," ",o+1," levels deep"]})]}),h?(0,eT.jsxs)(s8,{className:"gap-0 p-4",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"size-2.5 rounded-full",style:{background:dE(h)},"aria-hidden":!0}),(0,eT.jsx)("span",{className:"truncate font-mono text-sm text-foreground",children:h.id})]}),(0,eT.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:h.version}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:h.type}),(0,eT.jsxs)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:["depth ",h.depth]}),null!=h.sizeKb&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:h.sizeKb>=1024?`${(h.sizeKb/1024).toFixed(1)} MB`:`${h.sizeKb} KB`})]}),h.flagged&&h.severity&&(0,eT.jsx)("div",{className:"mt-3",children:(0,eT.jsxs)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",oV(h.severity).bg,oV(h.severity).text),children:["has ",oV(h.severity).label," finding"]})}),(0,eT.jsxs)("div",{className:"mt-4 flex flex-col gap-1",children:[(0,eT.jsxs)("span",{className:"text-[11px] font-medium text-muted-foreground",children:["Depends on (",h.dependencies.length,")"]}),0===h.dependencies.length?(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:"No further dependencies (leaf)."}):(0,eT.jsx)("div",{className:"flex flex-wrap gap-1",children:h.dependencies.map(e=>(0,eT.jsx)("button",{type:"button",onClick:()=>d.has(e)&&n(e),className:(0,ny.cn)("rounded-sm px-1.5 py-0.5 font-mono text-[10px]",d.has(e)?"bg-secondary text-foreground hover:bg-secondary/70":"bg-secondary/40 text-muted-foreground"),children:e},e))})]}),(0,eT.jsxs)("div",{className:"mt-3 flex flex-col gap-1",children:[(0,eT.jsxs)("span",{className:"text-[11px] font-medium text-muted-foreground",children:["Required by (",g.length,")"]}),0===g.length?(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:"Root-level / not required by another module."}):(0,eT.jsx)("div",{className:"flex flex-wrap gap-1",children:g.map(e=>(0,eT.jsx)("button",{type:"button",onClick:()=>n(e.id),className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-foreground hover:bg-secondary/70",children:e.id},e.id))})]})]}):(0,eT.jsxs)(s8,{className:"flex flex-col items-start gap-2 p-4 text-sm text-muted-foreground",children:[(0,eT.jsx)(eq,{className:"size-5 text-muted-foreground"}),(0,eT.jsx)("p",{className:"text-pretty",children:"Select a module in the graph to trace what it depends on and which packages require it."})]})]})]})}function dT({color:e,label:t}){return(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"size-2.5 rounded-full",style:{background:e},"aria-hidden":!0}),t]})}function dP({icon:e,value:t,label:n}){return(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)(e,{className:"size-3.5 text-muted-foreground"}),(0,eT.jsx)("span",{className:"font-mono text-xl font-semibold tabular-nums text-foreground",children:t})]}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:n})]})}let dz={vulnerability:"Vulnerable",outdated:"Outdated",deprecated:"Deprecated",unused:"Unused",missing:"Missing",license:"License"};function dO({dep:e}){let{viewIssue:t}=l$(),n=oV(e.severity);return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(oJ(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(oJ(e)))},className:"flex w-full cursor-pointer flex-col gap-2 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40 sm:flex-row sm:items-start sm:gap-4",children:[(0,eT.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[(0,eT.jsx)(eq,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"font-mono text-sm text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:e.current}),(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:dz[e.kind]}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e.type})]}),(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm text-foreground",children:e.title}),(0,eT.jsx)("p",{className:"mt-1 line-clamp-2 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.detail}),(0,eT.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[e.cves?.map(e=>(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:e},e)),e.license&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:e.license}),e.usedIn&&e.usedIn.length>0&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:["used in ",(0,eT.jsx)(lR,{path:e.usedIn[0]})]})]})]}),(0,eT.jsx)(lM,{issue:oJ(e),variant:"dot",className:"mt-0.5"})]}),e.fixedIn&&(0,eT.jsxs)("div",{className:"inline-flex shrink-0 items-center gap-1 rounded-sm border border-[color:var(--sev-ok)]/40 bg-[color:var(--sev-ok)]/10 px-2.5 py-1 font-mono text-xs text-[color:var(--sev-ok)]",children:[e.current," ",(0,eT.jsx)(s2,{className:"size-3"})," ",e.fixedIn]})]})}function dM({deps:e}){let[t,n]=(0,eP.useState)("findings"),r=[{key:"findings",label:"Findings",icon:oT,count:e.findings.length},{key:"graph",label:"Dependency graph",icon:dI,count:e.graph?.nodes.length}];return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 self-start rounded-sm border border-border bg-card p-1",children:r.map(r=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(r.key),disabled:"graph"===r.key&&!e.graph,className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors disabled:opacity-40",t===r.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)(r.icon,{className:"size-4"}),r.label,null!=r.count&&(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:r.count})]},r.key))}),"graph"===t&&e.graph?(0,eT.jsx)(dA,{graph:e.graph}):(0,eT.jsx)(dR,{deps:e})]})}function dR({deps:e}){let[t,n]=(0,eP.useState)("all"),r=(0,eP.useMemo)(()=>[...e.findings].sort(oq),[e.findings]),i=(0,eP.useMemo)(()=>"all"===t?r:r.filter(e=>e.kind===t),[r,t]),a=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.findings)t.set(n.kind,(t.get(n.kind)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:dz[e],count:t})).sort((e,t)=>t.count-e.count)},[e.findings]),s=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.findings)t.set(n.type,(t.get(n.type)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count)},[e.findings]),o=["critical","high","medium","low","info"].map((t,n)=>({label:oV(t).label,value:e.findings.filter(e=>e.severity===t).length,color:`var(--chart-${n+1})`})),l=e.findings.filter(e=>e.fixedIn).length,d=e.findings.filter(e=>"vulnerability"===e.kind).length,c=[{key:"all",label:"All",count:e.findings.length},...a.map(e=>({key:e.key,label:e.label,count:e.count}))];return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsxs)(oS,{title:"Inventory",children:[(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.total}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"total deps"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.direct}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"direct"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.dev}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"dev"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:l}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"upgradable"})]})]}),(0,eT.jsxs)("p",{className:"mt-3 border-t border-border pt-3 text-xs text-muted-foreground",children:[(0,eT.jsx)("span",{className:"font-mono text-foreground",children:d})," with known advisories ·"," ",(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.counts.transitive})," transitive"]})]}),(0,eT.jsx)(oS,{title:"By severity",children:(0,eT.jsx)(o$,{segments:o})}),(0,eT.jsx)(oS,{title:"By issue type",children:(0,eT.jsx)(oI,{rows:a,activeKey:"all"===t?null:t,onSelect:e=>n(t=>t===e?"all":e)})}),(0,eT.jsx)(oS,{title:"By dependency type",children:(0,eT.jsx)(oI,{rows:s})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:c.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(te,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Dependency findings"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:i.length}),(0,eT.jsxs)("span",{className:"ml-auto font-mono text-xs text-muted-foreground",children:["from ",(0,eT.jsx)(lR,{path:e.manifestPath})]})]}),0===i.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No dependency issues in this category."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:i.map(e=>(0,eT.jsx)(dO,{dep:e},e.id))})]})]})}let dD=eL("lock-open",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]),dL=eL("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]),dU=eL("key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]),dZ=eL("plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]]),dF=eL("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]),dB=eL("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]),dV=eL("table-2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]),dq={postgres:"PostgreSQL",mysql:"MySQL",mongodb:"MongoDB",sqlite:"SQLite",redis:"Redis",other:"Other"};function dW({tables:e,connections:t}){let[n,r]=(0,eP.useState)(null),[i,a]=(0,eP.useState)(null),s=(0,eP.useMemo)(()=>{let n=new Map;for(let r of e){let e=t.find(e=>e.id===r.connectionId);n.set(r.name,e?.engine??"other")}return n},[e,t]),o=(0,eP.useMemo)(()=>{let t=new Set(e.map(e=>e.name)),n=[];for(let r of e)for(let e of r.columns){if(!e.references)continue;let i=function(e){let t=e.lastIndexOf(".");return t<=0?null:{table:e.slice(0,t),column:e.slice(t+1)}}(e.references);i&&t.has(i.table)&&i.table!==r.name&&n.push({id:`${r.name}.${e.name}->${i.table}`,from:r.name,to:i.table,fromColumn:e.name,toColumn:i.column})}return n},[e]),{positioned:l,byName:d,width:c,height:u}=(0,eP.useMemo)(()=>{let t=new Set;for(let e of o)t.add(e.from),t.add(e.to);let n=[...e].sort((e,n)=>{let r=+!t.has(e.name),i=+!t.has(n.name);return r!==i?r-i:n.columns.length-e.columns.length}),r=Math.max(1,Math.ceil(Math.sqrt(n.length))),i=e=>34+22*Math.min(e.columns.length,7),a=Math.max(56,...n.map(i))+48,s=n.map((e,t)=>{let n=Math.floor(t/r),s=e.columns.slice(0,7);return{table:e,rows:s,x:28+t%r*280,y:28+n*a,w:210,h:i(e)}}),l=new Map(s.map(e=>[e.table.name,e])),d=Math.ceil(n.length/r);return{positioned:s,byName:l,width:56+280*r-70,height:56+d*a-48}},[e,o]),m=n??i,p=(0,eP.useMemo)(()=>{if(!m)return null;let e=new Set([m]);for(let t of o)t.from===m&&e.add(t.to),t.to===m&&e.add(t.from);return e},[m,o]),f=n?d.get(n)?.table:null,h=n?o.filter(e=>e.from===n):[],g=n?o.filter(e=>e.to===n):[];return 0===e.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(dB,{className:"size-5"}),"No schema discovered, so there are no relationships to map yet."]}):0===o.length?(0,eT.jsxs)(s8,{className:"flex flex-col items-start gap-2 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(dB,{className:"size-5"}),(0,eT.jsxs)("p",{className:"text-pretty",children:[e.length," ",1===e.length?"table was":"tables were"," found, but no foreign-key relationships were detected between them. Add explicit references in your schema (e.g. Drizzle"," ",(0,eT.jsx)("span",{className:"font-mono",children:"references()"})," or Prisma ",(0,eT.jsx)("span",{className:"font-mono",children:"@relation"}),") to see an ER map here."]})]}):(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)(s8,{className:"min-w-0 gap-0 overflow-hidden py-0",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-4 border-b border-border px-3 py-2 text-[11px] text-muted-foreground",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)(dU,{className:"size-3 text-[color:var(--sev-ok)]"})," primary key"]}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)(dp,{className:"size-3 text-[color:var(--chart-1)]"})," foreign key"]}),(0,eT.jsx)("span",{className:"ml-auto hidden sm:inline",children:"Click a table to trace its relationships"})]}),(0,eT.jsx)("div",{className:"overflow-auto bg-[image:radial-gradient(var(--border)_1px,transparent_1px)] [background-size:16px_16px]",children:(0,eT.jsxs)("svg",{width:c,height:u,viewBox:`0 0 ${c} ${u}`,className:"min-w-full",role:"img","aria-label":"Database relationship diagram",children:[(0,eT.jsx)("g",{children:o.map(e=>{let t=function(e){let t=d.get(e.from),n=d.get(e.to);if(!t||!n)return null;let r=t.x+t.w/2,i=n.x+n.w/2,a=t.rows.findIndex(t=>t.name===e.fromColumn),s=a>=0?t.y+34+22*a+11:t.y+t.h/2,o=n.y+17,l=i>=r,c=l?t.x+t.w:t.x,u=i>=r?n.x:n.x+n.w,p=.5*Math.abs(u-c)||30;return{d:`M ${c} ${s} C ${l?c+p:c-p} ${s}, ${l?u-p:u+p} ${o}, ${u} ${o}`,activeEdge:m===e.from||m===e.to}}(e);if(!t)return null;let n=m&&!t.activeEdge;return(0,eT.jsx)("path",{d:t.d,fill:"none",stroke:t.activeEdge?"var(--chart-1)":"var(--muted-foreground)",strokeWidth:t.activeEdge?1.8:1,opacity:n?.15:.55,markerEnd:t.activeEdge?"url(#er-arrow-active)":"url(#er-arrow)"},e.id)})}),(0,eT.jsxs)("defs",{children:[(0,eT.jsx)("marker",{id:"er-arrow",markerWidth:"8",markerHeight:"8",refX:"6",refY:"3",orient:"auto",children:(0,eT.jsx)("path",{d:"M0,0 L6,3 L0,6 Z",fill:"var(--muted-foreground)"})}),(0,eT.jsx)("marker",{id:"er-arrow-active",markerWidth:"8",markerHeight:"8",refX:"6",refY:"3",orient:"auto",children:(0,eT.jsx)("path",{d:"M0,0 L6,3 L0,6 Z",fill:"var(--chart-1)"})})]}),(0,eT.jsx)("g",{children:l.map(e=>{var t;let n=(t=e.table.name,!!(m&&p&&!p.has(t))),i=m===e.table.name,o=s.get(e.table.name)??"other",l=e.table.columns.length-e.rows.length;return(0,eT.jsxs)("g",{transform:`translate(${e.x}, ${e.y})`,opacity:n?.3:1,className:"cursor-pointer",onMouseEnter:()=>a(e.table.name),onMouseLeave:()=>a(null),onClick:()=>r(t=>t===e.table.name?null:e.table.name),children:[(0,eT.jsx)("rect",{width:e.w,height:e.h,rx:6,fill:"var(--card)",stroke:i?"var(--chart-1)":"var(--border)",strokeWidth:i?2:1}),(0,eT.jsx)("rect",{width:e.w,height:34,rx:6,fill:"var(--secondary)"}),(0,eT.jsx)("rect",{y:28,width:e.w,height:6,fill:"var(--secondary)"}),(0,eT.jsx)("text",{x:12,y:17,dominantBaseline:"central",className:"fill-foreground font-mono",fontSize:12,fontWeight:600,children:e.table.name.length>22?e.table.name.slice(0,21)+"…":e.table.name}),(0,eT.jsx)("text",{x:e.w-10,y:17,textAnchor:"end",dominantBaseline:"central",className:"fill-muted-foreground font-mono",fontSize:8,children:dq[o].toUpperCase()}),e.rows.map((t,n)=>{let r=t.flags.includes("pk"),i=t.flags.includes("fk")||!!t.references;return(0,eT.jsxs)("g",{transform:`translate(0, ${34+22*n})`,children:[n>0&&(0,eT.jsx)("line",{x1:0,y1:0,x2:e.w,y2:0,stroke:"var(--border)",strokeWidth:.5,opacity:.5}),r&&(0,eT.jsx)("circle",{cx:12,cy:11,r:3,fill:"var(--sev-ok)"}),!r&&i&&(0,eT.jsx)("circle",{cx:12,cy:11,r:3,fill:"var(--chart-1)"}),!r&&!i&&(0,eT.jsx)("circle",{cx:12,cy:11,r:2,fill:"var(--muted-foreground)",opacity:.4}),(0,eT.jsx)("text",{x:24,y:11,dominantBaseline:"central",className:"fill-foreground font-mono",fontSize:10,children:t.name.length>16?t.name.slice(0,15)+"…":t.name}),(0,eT.jsx)("text",{x:e.w-10,y:11,textAnchor:"end",dominantBaseline:"central",className:"fill-muted-foreground font-mono",fontSize:9,children:t.type.length>12?t.type.slice(0,11)+"…":t.type})]},t.name)}),l>0&&(0,eT.jsx)("text",{x:24,y:34+22*e.rows.length-11+22,dominantBaseline:"central",className:"fill-muted-foreground font-mono",fontSize:9,children:`+${l} more`})]},e.table.name)})})]})})]}),(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsxs)(s8,{className:"gap-0 p-4",children:[(0,eT.jsx)("h3",{className:"mb-3 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Schema map"}),(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)(dV,{className:"size-3.5 text-muted-foreground"}),(0,eT.jsx)("span",{className:"font-mono text-xl font-semibold tabular-nums text-foreground",children:e.length})]}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"tables"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,eT.jsx)(dp,{className:"size-3.5 text-muted-foreground"}),(0,eT.jsx)("span",{className:"font-mono text-xl font-semibold tabular-nums text-foreground",children:o.length})]}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"relationships"})]})]})]}),f?(0,eT.jsxs)(s8,{className:"gap-0 p-4",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(dV,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("span",{className:"truncate font-mono text-sm text-foreground",children:f.name})]}),(0,eT.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:f.kind}),(0,eT.jsxs)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:[f.columns.length," cols"]}),f.rowCount>0&&(0,eT.jsxs)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5",children:[f.rowCount.toLocaleString()," rows"]})]}),(0,eT.jsxs)("div",{className:"mt-4 flex flex-col gap-1",children:[(0,eT.jsxs)("span",{className:"text-[11px] font-medium text-muted-foreground",children:["References (",h.length,")"]}),0===h.length?(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:"This table has no outgoing foreign keys."}):(0,eT.jsx)("div",{className:"flex flex-col gap-1",children:h.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>r(e.to),className:"flex items-center gap-1.5 rounded-sm bg-secondary/60 px-2 py-1 text-left font-mono text-[11px] text-foreground transition-colors hover:bg-secondary",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:e.fromColumn}),(0,eT.jsx)(dp,{className:"size-3 text-[color:var(--chart-1)]"}),(0,eT.jsx)("span",{children:e.to}),(0,eT.jsxs)("span",{className:"text-muted-foreground/70",children:[".",e.toColumn]})]},e.id))})]}),(0,eT.jsxs)("div",{className:"mt-3 flex flex-col gap-1",children:[(0,eT.jsxs)("span",{className:"text-[11px] font-medium text-muted-foreground",children:["Referenced by (",g.length,")"]}),0===g.length?(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:"No other table references this one."}):(0,eT.jsx)("div",{className:"flex flex-col gap-1",children:g.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>r(e.from),className:"flex items-center gap-1.5 rounded-sm bg-secondary/60 px-2 py-1 text-left font-mono text-[11px] text-foreground transition-colors hover:bg-secondary",children:[(0,eT.jsx)("span",{children:e.from}),(0,eT.jsxs)("span",{className:"text-muted-foreground/70",children:[".",e.fromColumn]}),(0,eT.jsx)(dp,{className:"size-3 text-[color:var(--chart-1)]"}),(0,eT.jsx)("span",{className:"text-muted-foreground",children:e.toColumn})]},e.id))})]}),f.filePath&&(0,eT.jsx)("div",{className:"mt-3 border-t border-border pt-3 font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:f.filePath})})]}):(0,eT.jsxs)(s8,{className:"flex flex-col items-start gap-2 p-4 text-sm text-muted-foreground",children:[(0,eT.jsx)(dB,{className:"size-5 text-muted-foreground"}),(0,eT.jsx)("p",{className:"text-pretty",children:"Select a table in the diagram to trace what it references and which tables point back to it."})]})]})]})}let dH={"n+1":"N+1 query","missing-index":"Missing index","no-pooling":"No pooling",injection:"Injection",unparameterized:"Unparameterized","schema-drift":"Schema drift","no-migration":"No migration","unbounded-query":"Unbounded query","no-ssl":"No SSL","connection-leak":"Connection leak","missing-ttl":"Missing TTL","full-scan":"Full scan","no-validation":"No validation"},dG={postgres:"PostgreSQL",mysql:"MySQL",mongodb:"MongoDB",sqlite:"SQLite",redis:"Redis",other:"Other"},dK={dependency:"Dependency",env:"Env var","connection-string":"Connection string","schema-file":"Schema file",config:"Config"};function dJ({engine:e}){return(0,eT.jsx)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-border bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:dG[e]})}function dY({active:e,onClick:t,icon:n,label:r,count:i}){return(0,eT.jsxs)("button",{type:"button",onClick:t,className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",e?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[n,r,null!=i&&(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:i})]})}function dX({conn:e}){return(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5 border-t border-border px-3 py-2.5 first:border-t-0",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eW,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:e.name}),(0,eT.jsx)(dJ,{engine:e.engine})]}),(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 pl-6 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)("span",{className:"truncate",children:e.client}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[e.ssl?(0,eT.jsx)(dm,{className:"size-3 text-[color:var(--sev-ok)]"}):(0,eT.jsx)(dD,{className:"size-3 text-[color:var(--sev-high)]"}),e.ssl?"TLS":"no TLS"]}),(0,eT.jsx)("span",{className:(0,ny.cn)(e.pooled?"text-muted-foreground":"text-[color:var(--sev-medium)]"),children:e.pooled?"pooled":"unpooled"})]})]})}function dQ({label:e,value:t,mono:n=!0}){return(0,eT.jsxs)("div",{className:"flex items-start justify-between gap-3 py-1.5",children:[(0,eT.jsx)("span",{className:"shrink-0 text-[11px] uppercase tracking-wide text-muted-foreground",children:e}),(0,eT.jsx)("span",{className:(0,ny.cn)("min-w-0 truncate text-right text-xs text-foreground",n&&"font-mono"),children:t})]})}function d0({conn:e}){return(0,eT.jsxs)(s8,{className:"gap-0 p-0",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 border-b border-border p-4",children:[(0,eT.jsx)("span",{className:"inline-flex size-8 shrink-0 items-center justify-center rounded-sm bg-secondary",children:(0,eT.jsx)(eW,{className:"size-4 text-foreground"})}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"truncate font-mono text-sm font-medium text-foreground",children:e.name}),(0,eT.jsx)(dJ,{engine:e.engine})]}),(0,eT.jsx)("p",{className:"truncate font-mono text-[11px] text-muted-foreground",children:e.client})]}),(0,eT.jsx)("div",{className:"flex shrink-0 items-center gap-1.5",children:e.ssl?(0,eT.jsxs)(nS,{className:"border-0 bg-[color:var(--sev-ok)]/12 font-mono text-[10px] uppercase text-[color:var(--sev-ok)]",children:[(0,eT.jsx)(dm,{className:"mr-1 size-3"}),"TLS"]}):(0,eT.jsxs)(nS,{className:"border-0 bg-[color:var(--sev-high)]/12 font-mono text-[10px] uppercase text-[color:var(--sev-high)]",children:[(0,eT.jsx)(dD,{className:"mr-1 size-3"}),"No TLS"]})})]}),(0,eT.jsxs)("div",{className:"flex flex-col px-4 py-2",children:[(0,eT.jsx)(dQ,{label:"Host",value:e.host}),e.scheme&&(0,eT.jsx)(dQ,{label:"Scheme",value:e.scheme}),e.envVar&&(0,eT.jsx)(dQ,{label:"Env var",value:e.envVar}),(0,eT.jsx)(dQ,{label:"Detected via",value:e.detectedVia?dK[e.detectedVia]:"—",mono:!1}),e.schemaSource&&(0,eT.jsx)(dQ,{label:"Schema",value:e.schemaSource,mono:!1}),(0,eT.jsx)(dQ,{label:"Pooling",value:e.pooled?"Pooled":"Direct / unpooled",mono:!1}),(0,eT.jsx)(dQ,{label:"mongodb"===e.engine?"Collections":"Tables",value:e.collections.toLocaleString()})]}),(0,eT.jsx)("div",{className:"border-t border-border px-4 py-2 font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath})})]})}function d1({f:e}){let{viewIssue:t}=l$(),n=oV(e.severity);return(0,eT.jsx)("div",{role:"button",tabIndex:0,onClick:()=>t(o0(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(o0(e)))},className:"flex w-full cursor-pointer flex-col gap-2 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:(0,eT.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[(0,eT.jsx)(eW,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)(dJ,{engine:e.engine}),(0,eT.jsx)("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:dH[e.kind]}),e.target&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e.target})]}),(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm text-foreground",children:e.title}),(0,eT.jsx)("p",{className:"mt-1 line-clamp-2 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.detail}),(0,eT.jsx)("div",{className:"mt-1.5 font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath,line:e.line})})]}),(0,eT.jsx)(lM,{issue:o0(e),variant:"dot",className:"mt-0.5"})]})})}function d2({flags:e}){return(0,eT.jsxs)("div",{className:"mt-1 flex flex-wrap gap-1",children:[e.includes("pk")&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm bg-[color:var(--sev-ok)]/12 px-1.5 py-0.5 text-[color:var(--sev-ok)]",children:[(0,eT.jsx)(dU,{className:"size-3"}),"PK"]}),e.includes("fk")&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 text-muted-foreground",children:"Link"}),e.includes("unique")&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 text-muted-foreground",children:"Unique"}),e.includes("index")&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 text-muted-foreground",children:"Index"}),e.includes("nullable")&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 text-muted-foreground",children:"Nullable"}),e.includes("default")&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 text-muted-foreground",children:"Default"})]})}function d4({table:e,expanded:t,onToggle:n}){return(0,eT.jsxs)("div",{className:"border-t border-border first:border-t-0",children:[(0,eT.jsx)("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),n())},className:"flex w-full cursor-pointer items-center justify-between gap-3 p-4 text-left transition-colors hover:bg-secondary/40",children:(0,eT.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[(0,eT.jsx)("div",{className:"mt-0.5 inline-flex size-4 shrink-0 items-center justify-center",children:(0,eT.jsx)(a4,{className:(0,ny.cn)("size-4 transition-transform",t&&"rotate-90")})}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"truncate font-mono text-sm font-medium text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.kind})]}),(0,eT.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-1 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsxs)("span",{children:[e.columns.length," columns"]}),e.rowCount>0&&(0,eT.jsxs)("span",{children:[e.rowCount.toLocaleString()," rows"]}),e.sizeKb?(0,eT.jsxs)("span",{children:[(e.sizeKb/1024).toFixed(1)," MB"]}):null,e.indexes.length>0&&(0,eT.jsxs)("span",{children:[e.indexes.length," indexes"]})]})]})]})}),t&&(0,eT.jsxs)("div",{className:"border-t border-border/50 bg-secondary/20 p-4",children:[(0,eT.jsx)("div",{className:"flex flex-col gap-3",children:e.columns.map(e=>(0,eT.jsx)("div",{className:"flex items-start justify-between gap-2 font-mono text-xs",children:(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"font-medium text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"text-muted-foreground/70",children:e.type}),e.references&&(0,eT.jsx)("span",{className:"text-muted-foreground/70",children:`→ ${e.references}`})]}),(0,eT.jsx)(d2,{flags:e.flags})]})},e.name))}),e.indexes.length>0&&(0,eT.jsxs)("div",{className:"mt-4 border-t border-border/50 pt-3",children:[(0,eT.jsx)("p",{className:"mb-2 font-mono text-[10px] uppercase tracking-wide text-muted-foreground",children:"Indexes"}),(0,eT.jsx)("div",{className:"flex flex-col gap-1.5",children:e.indexes.map(e=>(0,eT.jsxs)("div",{className:"flex items-center gap-2 font-mono text-[11px]",children:[(0,eT.jsx)(dd,{className:"size-3 text-muted-foreground"}),(0,eT.jsx)("span",{className:"text-foreground",children:e.name}),(0,eT.jsxs)("span",{className:"text-muted-foreground/70",children:["(",e.columns.join(", "),")"]}),e.unique&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 text-muted-foreground",children:"unique"})]},e.name))})]}),e.filePath&&(0,eT.jsx)("div",{className:"mt-3 border-t border-border/50 pt-3 font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath})})]})]})}function d5({q:e}){let t=e.estMs>=1500?"var(--sev-critical)":e.estMs>=1e3?"var(--sev-high)":e.estMs>=300?"var(--sev-medium)":"var(--sev-ok)";return(0,eT.jsxs)("div",{className:"flex items-center gap-3 border-t border-border p-3 first:border-t-0",children:[(0,eT.jsx)("span",{className:"w-16 shrink-0 font-mono text-[11px] uppercase text-muted-foreground",children:e.operation}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:e.target}),(0,eT.jsx)(dJ,{engine:e.engine}),e.fullScan&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm bg-[color:var(--sev-high)]/12 px-1.5 py-0.5 font-mono text-[10px] uppercase text-[color:var(--sev-high)]",children:[(0,eT.jsx)(dw,{className:"size-3"})," scan"]})]}),(0,eT.jsx)("p",{className:"mt-0.5 line-clamp-1 text-[11px] text-muted-foreground",children:e.note}),(0,eT.jsx)("div",{className:"mt-1 font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath,line:e.line})})]}),(0,eT.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1 font-mono text-xs tabular-nums",style:{color:t},children:[(0,eT.jsx)(dL,{className:"size-3"}),e.estMs>=1e3?`${(e.estMs/1e3).toFixed(1)}s`:`${e.estMs}ms`]})]})}let d6=["critical","high","medium","low","info"];function d3({database:e}){let t=e.tables??[],n=e.connections.length>0,[r,i]=(0,eP.useState)(n?"connections":"findings"),[a,s]=(0,eP.useState)("all"),[o,l]=(0,eP.useState)(new Set),d=(0,eP.useMemo)(()=>[...e.findings].sort(oq),[e.findings]),c=(0,eP.useMemo)(()=>"all"===a?d:d.filter(e=>e.severity===a),[d,a]),u=(0,eP.useMemo)(()=>[...e.queries].sort((e,t)=>t.estMs-e.estMs),[e.queries]),m=(0,eP.useMemo)(()=>[...new Set(e.connections.map(e=>e.engine))].map((t,n)=>({label:dG[t],value:Math.max(1,e.connections.filter(e=>e.engine===t).length),color:`var(--chart-${n%5+1})`})),[e.connections]),p=d6.map((t,n)=>({label:oV(t).label,value:e.findings.filter(e=>e.severity===t).length,color:`var(--chart-${n+1})`})).filter(e=>e.value>0),f=[{key:"all",label:"All",count:d.length},...d6.map(e=>({key:e,label:oV(e).label,count:d.filter(t=>t.severity===e).length})).filter(e=>e.count>0)],h=(0,eP.useMemo)(()=>{let e=new Set(t.map(e=>e.name)),n=0;for(let r of t)for(let t of r.columns){if(!t.references)continue;let i=t.references.lastIndexOf("."),a=i>0?t.references.slice(0,i):"";a&&a!==r.name&&e.has(a)&&n++}return n},[t]),g=(0,eP.useMemo)(()=>{let e=new Map;for(let n of t){let t=e.get(n.connectionId)??[];t.push(n),e.set(n.connectionId,t)}return e},[t]);return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsxs)(oS,{title:"Datastores",children:[(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3 pb-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.connections}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"connections"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.collections}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"tables / collections"})]})]}),(0,eT.jsxs)("div",{className:"-mx-3 border-t border-border",children:[e.connections.map(e=>(0,eT.jsx)(dX,{conn:e},e.id)),!n&&(0,eT.jsx)("p",{className:"px-3 py-3 text-[11px] text-muted-foreground",children:"No datastore detected."})]})]}),m.length>0&&(0,eT.jsx)(oS,{title:"By engine",children:(0,eT.jsx)(o$,{segments:m})}),p.length>0&&(0,eT.jsx)(oS,{title:"Findings by severity",children:(0,eT.jsx)(o$,{segments:p})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:[(0,eT.jsx)(dY,{active:"connections"===r,onClick:()=>i("connections"),icon:(0,eT.jsx)(dZ,{className:"size-4"}),label:"Connections",count:e.connections.length}),(0,eT.jsx)(dY,{active:"schema"===r,onClick:()=>i("schema"),icon:(0,eT.jsx)(s9,{className:"size-4"}),label:"Schema",count:t.length}),(0,eT.jsx)(dY,{active:"relationships"===r,onClick:()=>i("relationships"),icon:(0,eT.jsx)(dB,{className:"size-4"}),label:"Relationships",count:h}),(0,eT.jsx)(dY,{active:"queries"===r,onClick:()=>i("queries"),icon:(0,eT.jsx)(e0,{className:"size-4"}),label:"Queries",count:e.queries.length}),(0,eT.jsx)(dY,{active:"findings"===r,onClick:()=>i("findings"),icon:(0,eT.jsx)(dw,{className:"size-4"}),label:"Findings",count:e.findings.length})]}),"connections"===r&&(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(dF,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Detected datastores"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:e.connections.length})]}),n?(0,eT.jsx)("div",{className:"grid gap-4 md:grid-cols-2",children:e.connections.map(e=>(0,eT.jsx)(d0,{conn:e},e.id))}):(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eW,{className:"size-5"}),"No database connection detected. Add a connection string (e.g. DATABASE_URL or MONGODB_URI) or a database client dependency."]})]}),"schema"===r&&(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(s9,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Schema explorer"}),(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-xs",children:[t.length," ",1===t.length?"table":"tables"]})]}),0===t.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(lH,{className:"size-5"}),"No schema discovered. Add a Prisma/Drizzle schema, Mongoose models, or provide a reachable connection string for live introspection."]}):(0,eT.jsx)("div",{className:"flex flex-col gap-4",children:[...g.entries()].map(([t,n])=>{let r=e.connections.find(e=>e.id===t);return(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[r&&(0,eT.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,eT.jsx)(te,{className:"size-3.5 text-muted-foreground"}),(0,eT.jsx)("span",{className:"font-mono text-xs text-foreground",children:r.name}),(0,eT.jsx)(dJ,{engine:r.engine}),(0,eT.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:[n.length," ","mongodb"===r.engine?"collections":"tables"]})]}),(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:n.map(e=>(0,eT.jsx)(d4,{table:e,expanded:o.has(`${t}:${e.name}`),onToggle:()=>{var n;return n=`${t}:${e.name}`,void l(e=>{let t=new Set(e);return t.has(n)?t.delete(n):t.add(n),t})}},`${t}:${e.name}`))})]},t)})})]}),"relationships"===r&&(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(dB,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Relationship map"}),(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-xs",children:[h," ",1===h?"relation":"relations"]})]}),(0,eT.jsx)(dW,{tables:t,connections:e.connections})]}),"queries"===r&&(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(e0,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Slowest queries"}),(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-xs",children:[e.counts.slowQueries," slow"]})]}),0===u.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No notable or slow queries detected."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:u.map(e=>(0,eT.jsx)(d5,{q:e},e.id))})]}),"findings"===r&&(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:f.map(e=>(0,eT.jsx)(dY,{active:a===e.key,onClick:()=>s(e.key),label:e.label,count:e.count},e.key))}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eW,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Database findings"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:c.length})]}),0===c.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No database issues in this severity."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:c.map(e=>(0,eT.jsx)(d1,{f:e},e.id))})]})]})]})}let d9=eL("circle-slash",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]]);function d8(e){switch(e){case"GET":case"HEAD":case"OPTIONS":default:return{text:"text-muted-foreground",bg:"bg-secondary",border:"border-border"};case"POST":return{text:"text-primary-foreground",bg:"bg-primary",border:"border-primary"};case"PUT":case"PATCH":return{text:"text-foreground",bg:"bg-accent",border:"border-foreground/40"};case"DELETE":return{text:"text-foreground",bg:"bg-background",border:"border-foreground/60"}}}let d7=["POST","PUT","PATCH","DELETE"];function ce({api:e}){let[t,n]=(0,eP.useState)("all"),[r,i]=(0,eP.useState)(""),a=(0,eP.useMemo)(()=>[...e.endpoints].sort((e,t)=>e.path.localeCompare(t.path)||e.method.localeCompare(t.method)),[e.endpoints]),s=(0,eP.useMemo)(()=>{let e=a;"mutations"===t?e=e.filter(e=>d7.includes(e.method)):"public"===t?e=e.filter(e=>!e.flags.auth&&d7.includes(e.method)):"issues"===t&&(e=e.filter(e=>e.findings.length>0));let n=r.trim().toLowerCase();return n&&(e=e.filter(e=>e.path.toLowerCase().includes(n)||e.method.toLowerCase().includes(n))),e},[a,t,r]),o=(0,eP.useMemo)(()=>{let e=new Map;for(let t of s){let n=t.path.replace(/^\//,"").split("/")[0]||"(root)";e.has(n)||e.set(n,[]),e.get(n).push(t)}return[...e.entries()].sort((e,t)=>e[0].localeCompare(t[0]))},[s]);if(!e.present)return(0,eT.jsxs)(s8,{className:"flex flex-col items-center gap-3 p-10 text-center",children:[(0,eT.jsx)(dB,{className:"size-8 text-muted-foreground"}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"No API endpoints detected"}),(0,eT.jsx)("p",{className:"mt-1 text-pretty text-xs leading-relaxed text-muted-foreground",children:"CodeLens maps route handlers and server actions across Next.js, Express, Hono, Fastify, SvelteKit and Nuxt. Add a server route to see your API surface here."})]})]});let l=[{key:"all",label:"All",count:e.counts.endpoints},{key:"mutations",label:"Mutations",count:e.counts.mutations},{key:"public",label:"Public mutations",count:e.endpoints.filter(e=>!e.flags.auth&&d7.includes(e.method)).length},{key:"issues",label:"With issues",count:e.endpoints.filter(e=>e.findings.length>0).length}],d=e.counts.endpoints>0?Math.round(e.counts.protected/e.counts.endpoints*100):0,c=e.counts.endpoints>0?Math.round(e.counts.validated/e.counts.endpoints*100):0;return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:l.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),(0,eT.jsx)("input",{type:"search",value:r,onChange:e=>i(e.target.value),placeholder:"Filter routes…",className:"w-full rounded-sm border border-border bg-card px-3 py-1.5 font-mono text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring sm:w-44","aria-label":"Filter routes"})]}),0===o.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(d9,{className:"size-5 text-muted-foreground"}),"No endpoints match this filter."]}):o.map(([e,t])=>(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,eT.jsxs)("span",{className:"font-mono text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:["/",e]}),(0,eT.jsxs)("span",{className:"font-mono text-[11px] text-muted-foreground/60",children:[t.length," ",1===t.length?"route":"routes"]})]}),(0,eT.jsx)("div",{className:"flex flex-col gap-2",children:t.map(e=>(0,eT.jsx)(ct,{endpoint:e},e.id))})]},e))]}),(0,eT.jsxs)("aside",{className:"flex flex-col gap-4",children:[(0,eT.jsx)(oS,{title:"Surface",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Endpoints"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.counts.endpoints})]}),(0,eT.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Mutations"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.counts.mutations})]}),(0,eT.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Dynamic routes"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.counts.dynamic})]}),e.style&&(0,eT.jsx)("div",{className:"border-t border-border pt-2 text-xs leading-relaxed text-muted-foreground",children:e.style})]})}),(0,eT.jsx)(oS,{title:"Coverage",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,eT.jsx)(ci,{label:"Protected",pct:d,count:e.counts.protected,total:e.counts.endpoints}),(0,eT.jsx)(ci,{label:"Validated",pct:c,count:e.counts.validated,total:e.counts.endpoints})]})}),e.methodCounts.length>0&&(0,eT.jsxs)(oS,{title:"By method",children:[(0,eT.jsx)(o$,{segments:e.methodCounts.map(e=>({label:e.method,value:e.count,color:function(e){switch(e){case"GET":case"HEAD":case"OPTIONS":return"var(--chart-4)";case"POST":return"var(--chart-1)";case"PUT":case"PATCH":return"var(--chart-2)";case"DELETE":return"var(--chart-3)";default:return"var(--chart-5)"}}(e.method)}))}),(0,eT.jsx)("div",{className:"mt-3 flex flex-col gap-1.5",children:e.methodCounts.map(e=>(0,eT.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("font-mono font-semibold",d8(e.method).text),children:e.method}),(0,eT.jsx)("span",{className:"font-mono text-muted-foreground",children:e.count})]},e.method))})]}),(0,eT.jsx)(oS,{title:"Findings",children:(0,eT.jsx)("div",{className:"flex items-center gap-2",children:0===e.counts.findings?(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsx)(eV,{className:"size-4 text-[color:var(--sev-ok)]"}),(0,eT.jsx)("span",{className:"text-sm text-muted-foreground",children:"No API issues found"})]}):(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsx)(eB,{className:"size-4 text-[color:var(--sev-high)]"}),(0,eT.jsxs)("span",{className:"text-sm text-foreground",children:[e.counts.findings," ",1===e.counts.findings?"issue":"issues"," across the surface"]})]})})})]})]})}function ct({endpoint:e}){let[t,n]=(0,eP.useState)(!1),r=d8(e.method),i=e.findings.length>0,a=i?e.findings.reduce((e,t)=>ca(t.severity)>ca(e)?t.severity:e,e.findings[0].severity):null;return(0,eT.jsxs)(s8,{className:(0,ny.cn)("overflow-hidden transition-colors",t&&"ring-1 ring-border"),children:[(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e=>!e),className:"flex w-full items-center gap-3 p-3 text-left hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("shrink-0 rounded-sm border px-2 py-0.5 font-mono text-[11px] font-semibold uppercase",r.bg,r.border,r.text),children:e.method}),(0,eT.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-sm text-foreground",children:e.path}),(0,eT.jsxs)("div",{className:"hidden items-center gap-1.5 sm:flex",children:[(0,eT.jsx)(cn,{ok:e.flags.auth,okIcon:dm,noIcon:dD,okLabel:"auth",noLabel:"public"}),(0,eT.jsx)(cn,{ok:e.flags.validation,okIcon:da,noIcon:d9,okLabel:"valid",noLabel:"no schema",muted:!d7.includes(e.method)}),e.flags.database&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)(eW,{className:"size-3"}),"db"]})]}),i&&a&&(0,eT.jsx)("span",{className:(0,ny.cn)("shrink-0 rounded-sm px-1.5 py-0.5 font-mono text-[10px] font-semibold uppercase",oV(a).bg,oV(a).text),children:e.findings.length}),(0,eT.jsx)(a4,{className:(0,ny.cn)("size-4 shrink-0 text-muted-foreground transition-transform",t&&"rotate-90")})]}),t&&(0,eT.jsxs)("div",{className:"flex flex-col gap-3 border-t border-border bg-background/40 p-3",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[(0,eT.jsx)(lR,{path:e.filePath,line:e.line}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase",children:function(e){switch(e){case"next-app":return"App Route";case"next-pages":return"Pages API";case"next-action":return"Server Action";case"sveltekit":return"SvelteKit";case"nuxt":return"Nuxt";default:return e}}(e.kind)}),e.dynamic&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px]",children:"dynamic"}),e.handler&&(0,eT.jsxs)("span",{className:"font-mono text-[10px]",children:["handler: ",e.handler]})]}),(0,eT.jsxs)("dl",{className:"grid grid-cols-2 gap-px overflow-hidden rounded-sm border border-border bg-border font-mono text-xs sm:grid-cols-3",children:[(0,eT.jsx)(cr,{label:"auth",on:e.flags.auth}),(0,eT.jsx)(cr,{label:"validation",on:e.flags.validation}),(0,eT.jsx)(cr,{label:"error handling",on:e.flags.errorHandling}),(0,eT.jsx)(cr,{label:"reads input",on:e.flags.inputs,neutral:!0}),(0,eT.jsx)(cr,{label:"database",on:e.flags.database,neutral:!0}),(0,eT.jsx)(cr,{label:"env access",on:e.flags.env,neutral:!0})]}),i&&(0,eT.jsx)("ul",{className:"flex flex-col gap-2",children:e.findings.map(e=>{let t=oV(e.severity);return(0,eT.jsxs)("li",{className:"rounded-sm border border-border bg-card p-2.5",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("size-1.5 rounded-full",t.dot),"aria-hidden":!0}),(0,eT.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.title}),(0,eT.jsx)("span",{className:(0,ny.cn)("ml-auto font-mono text-[10px] uppercase",t.text),children:t.label})]}),(0,eT.jsx)("p",{className:"mt-1 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.detail}),(0,eT.jsxs)("p",{className:"mt-1.5 text-pretty text-xs leading-relaxed text-foreground/80",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:"fix:"})," ",e.recommendation]})]},e.id)})})]})]})}function cn({ok:e,okIcon:t,noIcon:n,okLabel:r,noLabel:i,muted:a}){return a?null:(0,eT.jsxs)("span",{className:(0,ny.cn)("inline-flex items-center gap-1 rounded-sm border px-1.5 py-0.5 font-mono text-[10px]",e?"border-border bg-secondary text-muted-foreground":"border-foreground/40 bg-background font-semibold text-foreground"),children:[(0,eT.jsx)(e?t:n,{className:"size-3"}),e?r:i]})}function cr({label:e,on:t,neutral:n}){return(0,eT.jsxs)("div",{className:"flex items-center justify-between bg-card px-2.5 py-1.5",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:e}),(0,eT.jsx)("span",{className:(0,ny.cn)(n?"text-foreground/70":t?"font-semibold text-foreground":"text-muted-foreground"),children:t?"yes":"no"})]})}function ci({label:e,pct:t,count:n,total:r}){return(0,eT.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:e}),(0,eT.jsxs)("span",{className:"font-mono text-foreground",children:[n,"/",r," · ",t,"%"]})]}),(0,eT.jsx)("div",{className:"h-1.5 overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("div",{className:"h-full rounded-full bg-foreground",style:{width:`${t}%`},"aria-hidden":!0})})]})}function ca(e){return({critical:5,high:4,medium:3,low:2,info:1})[e]??0}let cs=eL("puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]),co=eL("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),cl=eL("fingerprint-pattern",[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]]),cd={"two-factor":"Two-Factor",passwordless:"Passwordless",social:"Social",authorization:"Authorization",session:"Session",api:"API",enterprise:"Enterprise",integration:"Integration",utility:"Utility",other:"Other"},cc={ok:"var(--sev-ok)",warn:"var(--sev-medium)",fail:"var(--sev-critical)",info:"var(--muted-foreground)"};function cu({method:e}){var t;let n="credential"===(t=e.kind)?eH:"social"===t?eG:cl;return(0,eT.jsx)(s8,{className:"gap-0 p-4",children:(0,eT.jsxs)("div",{className:"flex items-start gap-3",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("flex size-9 shrink-0 items-center justify-center rounded-sm border",e.enabled?"border-[color:var(--sev-ok)]/40 text-[color:var(--sev-ok)]":"border-border text-muted-foreground"),children:(0,eT.jsx)(n,{className:"size-4"})}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:e.label}),(0,eT.jsx)("span",{className:(0,ny.cn)("rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase",e.enabled?"bg-[color:var(--sev-ok)]/12 text-[color:var(--sev-ok)]":"bg-secondary text-muted-foreground"),children:e.enabled?"On":"Off"})]}),(0,eT.jsx)("p",{className:"mt-1 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.detail}),e.providers&&e.providers.length>0&&(0,eT.jsx)("div",{className:"mt-2 flex flex-wrap gap-1",children:e.providers.map(e=>(0,eT.jsx)("span",{className:"rounded-sm border border-border bg-secondary px-1.5 py-0.5 font-mono text-[10px] capitalize text-muted-foreground",children:e},e))})]})]})})}function cm({plugin:e,onOpen:t}){return(0,eT.jsxs)("button",{type:"button",onClick:t,className:"flex w-full items-start gap-3 rounded-sm border border-border bg-card p-3 text-left transition-colors hover:bg-secondary/40",children:[(0,eT.jsx)(cs,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:cd[e.category]}),e.clientMissing&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm bg-[color:var(--sev-medium)]/12 px-1.5 py-0.5 font-mono text-[10px] uppercase text-[color:var(--sev-medium)]",children:[(0,eT.jsx)(dw,{className:"size-3"}),"client missing"]})]}),(0,eT.jsx)("p",{className:"mt-1 line-clamp-2 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.description}),(0,eT.jsxs)("div",{className:"mt-2 flex items-center gap-3 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsxs)("span",{className:(0,ny.cn)("inline-flex items-center gap-1",e.detectedServer?"text-[color:var(--sev-ok)]":"text-muted-foreground/50"),children:[(0,eT.jsx)(dF,{className:"size-3"}),"server"]}),e.needsClient&&(0,eT.jsxs)("span",{className:(0,ny.cn)("inline-flex items-center gap-1",e.detectedClient?"text-[color:var(--sev-ok)]":"text-[color:var(--sev-medium)]"),children:[(0,eT.jsx)(co,{className:"size-3"}),"client"]})]})]}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function cp({item:e}){let t=cc[e.status];return(0,eT.jsxs)("div",{className:"flex items-start justify-between gap-3 border-t border-border p-3 first:border-t-0",children:[(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"size-2 shrink-0 rounded-full",style:{background:t},"aria-hidden":!0}),(0,eT.jsx)("span",{className:"text-sm text-foreground",children:e.label})]}),e.detail&&(0,eT.jsx)("p",{className:"mt-1 pl-4 text-xs text-muted-foreground",children:e.detail}),e.recommendation&&(0,eT.jsx)("p",{className:"mt-1 pl-4 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.recommendation})]}),(0,eT.jsx)("span",{className:"shrink-0 font-mono text-xs",style:{color:t},children:e.value})]})}function cf({f:e,onOpen:t}){let n=oV(e.severity);return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:t,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),t())},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[(0,eT.jsx)(dw,{className:"mt-0.5 size-4 shrink-0",style:{color:`var(--sev-${e.severity})`}}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.title})]}),(0,eT.jsx)("p",{className:"mt-1 line-clamp-2 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.detail}),e.filePath&&(0,eT.jsx)("div",{className:"mt-1.5 font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath,line:e.line})})]}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function ch({auth:e}){let[t,n]=(0,eP.useState)(null),[r,i]=(0,eP.useState)(null),a=(0,eP.useMemo)(()=>[...e.findings].sort(oq),[e.findings]),s=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.plugins)t.set(n.category,(t.get(n.category)??0)+1);return[...t.entries()].map(([e,t],n)=>({label:cd[e],value:t,color:`var(--chart-${n%5+1})`}))},[e.plugins]);if(!e.present)return(0,eT.jsxs)(s8,{className:"flex flex-col items-center gap-3 p-10 text-center",children:[(0,eT.jsx)(eV,{className:"size-8 text-muted-foreground"}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"No auth provider detected"}),(0,eT.jsxs)("p",{className:"mt-1 text-pretty text-xs leading-relaxed text-muted-foreground",children:["CodeLens looks for popular auth libraries — ",(0,eT.jsx)("span",{className:"font-mono",children:"better-auth"}),","," ",(0,eT.jsx)("span",{className:"font-mono",children:"@clerk/nextjs"}),", ",(0,eT.jsx)("span",{className:"font-mono",children:"next-auth"}),","," ",(0,eT.jsx)("span",{className:"font-mono",children:"@supabase/supabase-js"}),", ",(0,eT.jsx)("span",{className:"font-mono",children:"lucia"}),","," ",(0,eT.jsx)("span",{className:"font-mono",children:"firebase"})," and more. Install one to see a breakdown here."]})]})]});let o=e.provider,l=o?.deepSupport??!1;return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsx)(oS,{title:o?.name??"Auth",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-sm text-foreground",children:[(0,eT.jsx)(eV,{className:"size-4 text-[color:var(--sev-ok)]"}),"Detected"]}),e.version&&(0,eT.jsxs)("span",{className:"font-mono text-xs text-muted-foreground",children:["v",e.version]})]}),!l&&(0,eT.jsx)("div",{className:"rounded-sm border border-[color:var(--sev-medium)]/30 bg-[color:var(--sev-medium)]/10 px-2 py-1.5 text-[11px] leading-relaxed text-muted-foreground",children:"Provider-level analysis. Deep config introspection (methods, plugins, session) is available for Better Auth."}),e.integration&&(0,eT.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:"Integration"}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.integration})]}),e.databaseAdapter&&(0,eT.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[(0,eT.jsx)(eW,{className:"size-3"}),"Adapter"]}),(0,eT.jsx)("span",{className:"font-mono text-foreground",children:e.databaseAdapter.name})]}),e.configPath&&(0,eT.jsx)("div",{className:"border-t border-border pt-2 font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.configPath})}),e.clientPath&&(0,eT.jsx)("div",{className:"font-mono text-[10px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.clientPath})}),o&&(0,eT.jsxs)("a",{href:o.docsUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 border-t border-border pt-2 font-mono text-[10px] text-muted-foreground transition-colors hover:text-foreground",children:[o.name," docs",(0,eT.jsx)(oE,{className:"size-3"})]})]})}),(0,eT.jsx)(oS,{title:"At a glance",children:(0,eT.jsx)("div",{className:"grid grid-cols-3 gap-2 text-center",children:[{label:"Methods",value:e.counts.methods,icon:eH},{label:"Plugins",value:e.counts.plugins,icon:cs},{label:"Issues",value:e.counts.findings,icon:dw}].map(e=>(0,eT.jsxs)("div",{className:"flex flex-col items-center gap-0.5 rounded-sm bg-secondary/40 py-2",children:[(0,eT.jsx)(e.icon,{className:"size-3.5 text-muted-foreground"}),(0,eT.jsx)("span",{className:"font-mono text-lg font-semibold tabular-nums text-foreground",children:e.value}),(0,eT.jsx)("span",{className:"text-[10px] text-muted-foreground",children:e.label})]},e.label))})}),s.length>0&&(0,eT.jsx)(oS,{title:"Plugins by category",children:(0,eT.jsx)(o$,{segments:s})}),e.socialProviders.length>0&&(0,eT.jsx)(oS,{title:"Social providers",children:(0,eT.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.socialProviders.map(e=>(0,eT.jsx)("span",{className:"rounded-sm border border-border bg-secondary px-2 py-1 font-mono text-[11px] capitalize text-foreground",children:e},e))})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eH,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Sign-in methods"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:e.methods.length})]}),0===e.methods.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(dw,{className:"size-5 text-[color:var(--sev-medium)]"}),"No sign-in methods detected in the config."]}):(0,eT.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:e.methods.map(e=>(0,eT.jsx)(cu,{method:e},e.id))})]}),l&&(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(cs,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Plugins"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:e.plugins.length})]}),0===e.plugins.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(te,{className:"size-5 text-muted-foreground"}),"No ",o?.name??"auth"," plugins are registered."]}):(0,eT.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:e.plugins.map(e=>(0,eT.jsx)(cm,{plugin:e,onOpen:()=>n(e)},e.id))})]}),(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eJ,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Configuration"})]}),(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:e.config.map(e=>(0,eT.jsx)(cp,{item:e},e.key))})]}),(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eV,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Auth findings"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:a.length})]}),0===a.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No authentication issues detected."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:a.map(e=>(0,eT.jsx)(cf,{f:e,onOpen:()=>i(e)},e.id))})]})]}),(0,eT.jsx)(cg,{plugin:t,onClose:()=>n(null)}),(0,eT.jsx)(cx,{finding:r,onClose:()=>i(null)})]})}function cg({plugin:e,onClose:t}){return(0,eT.jsx)(oM,{open:!!e,onOpenChange:e=>!e&&t(),children:(0,eT.jsx)(oL,{side:"right",className:"w-full gap-0 p-0 sm:!max-w-md",children:e&&(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(oU,{className:"border-b border-border",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pr-8",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:cd[e.category]}),e.clientMissing&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm bg-[color:var(--sev-medium)]/12 px-1.5 py-0.5 font-mono text-[10px] uppercase text-[color:var(--sev-medium)]",children:[(0,eT.jsx)(dw,{className:"size-3"}),"client missing"]})]}),(0,eT.jsx)(oZ,{className:"mt-2 text-pretty text-base",children:e.name}),(0,eT.jsx)(oF,{className:"text-pretty leading-relaxed",children:e.description})]}),(0,eT.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-5 overflow-auto p-4",children:[(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-px overflow-hidden rounded-sm border border-border bg-border",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5 bg-card px-3 py-2",children:[(0,eT.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Server"}),(0,eT.jsx)("span",{className:"font-mono text-sm",style:{color:e.detectedServer?"var(--sev-ok)":"var(--muted-foreground)"},children:e.detectedServer?"Registered":"Not found"})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5 bg-card px-3 py-2",children:[(0,eT.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Client"}),(0,eT.jsx)("span",{className:"font-mono text-sm",style:{color:e.needsClient?e.detectedClient?"var(--sev-ok)":"var(--sev-medium)":"var(--muted-foreground)"},children:e.needsClient?e.detectedClient?"Registered":"Missing":"Not required"})]})]}),e.clientMissing&&(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5 rounded-sm border border-[color:var(--sev-medium)]/30 bg-[color:var(--sev-medium)]/[0.06] p-3",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium text-[color:var(--sev-medium)]",children:[(0,eT.jsx)(dw,{className:"size-3.5"}),"Client plugin missing"]}),(0,eT.jsxs)("p",{className:"text-pretty text-xs leading-relaxed text-muted-foreground",children:["Add ",(0,eT.jsxs)("span",{className:"font-mono",children:[e.id,"Client()"]})," to your"," ",(0,eT.jsx)("span",{className:"font-mono",children:"createAuthClient()"})," plugins so its actions work in the browser."]})]}),e.addsTables&&e.addsTables.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(eW,{className:"size-3.5"}),"Database tables added"]}),(0,eT.jsx)("div",{className:"flex flex-wrap gap-1.5",children:e.addsTables.map(e=>(0,eT.jsx)("span",{className:"rounded-sm border border-border bg-secondary px-2 py-1 font-mono text-[11px] text-foreground",children:e},e))}),(0,eT.jsx)("p",{className:"text-pretty text-xs leading-relaxed text-muted-foreground",children:"Generate and apply migrations after adding this plugin so these tables exist."})]}),(0,eT.jsxs)("a",{href:e.docsUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 self-start rounded-sm border border-border px-3 py-2 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:["Plugin docs",(0,eT.jsx)(oE,{className:"size-3.5"})]})]})]})})})}function cx({finding:e,onClose:t}){let n=e?oV(e.severity):null;return(0,eT.jsx)(oM,{open:!!e,onOpenChange:e=>!e&&t(),children:(0,eT.jsx)(oL,{side:"right",className:"w-full gap-0 p-0 sm:!max-w-md",children:e&&n&&(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(oU,{className:"border-b border-border",children:[(0,eT.jsx)(nS,{className:(0,ny.cn)("w-fit border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)(oZ,{className:"mt-2 text-pretty text-base leading-relaxed",children:e.title}),(0,eT.jsx)(oF,{className:"sr-only",children:"Authentication finding detail"})]}),(0,eT.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-5 overflow-auto p-4",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(dw,{className:"size-3.5"}),"Issue"]}),(0,eT.jsx)("p",{className:"text-pretty text-sm leading-relaxed text-foreground",children:e.detail}),e.filePath&&(0,eT.jsx)("div",{className:"font-mono text-[11px] text-muted-foreground",children:(0,eT.jsx)(lR,{path:e.filePath,line:e.line})})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(dm,{className:"size-3.5"}),"Recommendation"]}),(0,eT.jsx)("p",{className:"rounded-sm border border-border bg-secondary/30 px-3 py-2 text-pretty text-sm leading-relaxed text-foreground",children:e.recommendation})]}),e.docsUrl&&(0,eT.jsxs)("a",{href:e.docsUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 self-start rounded-sm border border-border px-3 py-2 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:["Better Auth docs",(0,eT.jsx)(oE,{className:"size-3.5"})]})]})]})})})}let cv=eL("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),cy=eL("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),cb={ok:"Healthy",missing:"Missing",undocumented:"Undocumented",unused:"Unused",exposed:"Exposed",empty:"Empty"};function ck({v:e}){let{viewIssue:t}=l$(),n=oV(e.severity),r="ok"!==e.status;return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(oX(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(oX(e)))},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:["client"===e.scope?(0,eT.jsx)(co,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}):(0,eT.jsx)(dF,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"font-mono text-sm text-foreground",children:e.key}),e.sample&&(0,eT.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:e.sample}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.scope}),r?(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:cb[e.status]}):(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm bg-[color:var(--sev-ok)]/12 px-1.5 py-0.5 font-mono text-[10px] uppercase text-[color:var(--sev-ok)]",children:[(0,eT.jsx)(eV,{className:"size-3"}),"OK"]})]}),(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm leading-relaxed text-foreground",children:e.note})]}),(0,eT.jsx)(lM,{issue:oX(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function cj({v:e,shown:t,onToggle:n}){let[r,i]=(0,eP.useState)(!1),a=void 0===e.value,s=a?"(not set)":""===e.value?"(empty)":e.value,o=e.values?[...e.values].sort((e,t)=>{let n={".env.local":0,".env.example":1};return(n[e.file]??2)-(n[t.file]??2)}):[];return(0,eT.jsxs)("div",{className:"flex flex-col gap-3 border-t border-border p-3 first:border-t-0",children:[(0,eT.jsxs)("div",{className:"flex items-start gap-3",children:["client"===e.scope?(0,eT.jsx)(co,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}):(0,eT.jsx)(dF,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"font-mono text-sm text-foreground",children:e.key}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.scope})]}),(0,eT.jsx)("p",{className:(0,ny.cn)("mt-1.5 break-all font-mono text-xs",a?"text-muted-foreground/60 italic":t?"text-foreground":"tracking-widest text-muted-foreground"),children:a||t?s:"•".repeat(Math.min(28,Math.max(8,(e.value||"").length||12)))})]}),(0,eT.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[!a&&(0,eT.jsx)("button",{type:"button",onClick:()=>{a||navigator.clipboard?.writeText(e.value??"").then(()=>{i(!0),window.setTimeout(()=>i(!1),1400)})},"aria-label":"Copy value",className:"inline-flex size-7 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground",children:r?(0,eT.jsx)(iq,{className:"size-3.5 text-[color:var(--sev-ok)]"}):(0,eT.jsx)(oC,{className:"size-3.5"})}),(0,eT.jsx)("button",{type:"button",onClick:n,disabled:a,"aria-label":t?"Hide value":"Reveal value","aria-pressed":t,className:"inline-flex size-7 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground disabled:opacity-30",children:t?(0,eT.jsx)(cy,{className:"size-3.5"}):(0,eT.jsx)(cv,{className:"size-3.5"})})]})]}),o.length>1&&(0,eT.jsx)("div",{className:"ml-7 flex flex-col gap-1 border-l border-border/50 pl-3 text-xs",children:o.map(e=>(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:e.file}),(0,eT.jsx)("span",{className:(0,ny.cn)("font-mono truncate",null===e.value?"text-muted-foreground/60 italic":"text-foreground"),children:null===e.value?"(not set)":""===e.value?"(empty)":t?e.value:"•".repeat(Math.min(12,Math.max(4,(e.value||"").length||8)))})]},e.file))})]})}function cw({env:e}){let[t,n]=(0,eP.useState)(!1),[r,i]=(0,eP.useState)(new Set),a=(0,eP.useMemo)(()=>[...e.variables].sort((e,t)=>e.key.localeCompare(t.key)),[e.variables]),s=a.filter(e=>void 0!==e.value);return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eH,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Variable values"}),(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-xs",children:[s.length," set"]})]}),(0,eT.jsxs)("button",{type:"button",onClick:()=>{n(e=>!e),i(new Set)},"aria-pressed":t,className:"inline-flex items-center gap-1.5 rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:[t?(0,eT.jsx)(cy,{className:"size-3.5"}):(0,eT.jsx)(cv,{className:"size-3.5"}),t?"Hide all":"Reveal all"]})]}),(0,eT.jsx)("p",{className:"rounded-sm border border-border bg-secondary/30 px-3 py-2 text-xs leading-relaxed text-muted-foreground",children:"Values are read from your local env files and rendered only in your browser. They are hidden by default — use the eye toggle to reveal a single value or reveal all at once."}),0===a.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No environment variables found."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:a.map(e=>{let n;return(0,eT.jsx)(cj,{v:e,shown:(n=e.key,t||r.has(n)),onToggle:()=>{let t;return t=e.key,i(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})}},e.key)})})]})}function cN({env:e}){let[t,n]=(0,eP.useState)("audit"),[r,i]=(0,eP.useState)("all"),a=(0,eP.useMemo)(()=>[...e.variables].sort(oq),[e.variables]),s=(0,eP.useMemo)(()=>"all"===r?a:"issues"===r?a.filter(e=>"ok"!==e.status):a.filter(e=>e.status===r),[a,r]),o=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.variables)t.set(n.status,(t.get(n.status)??0)+1);return[...t.entries()].map(([e,t])=>({key:e,label:cb[e],count:t})).sort((e,t)=>t.count-e.count)},[e.variables]),l=[{label:"Server",value:e.counts.server,color:"var(--chart-1)"},{label:"Client",value:e.counts.client,color:"var(--chart-3)"}],d=e.variables.filter(e=>"exposed"===e.status).length,c=e.variables.filter(e=>"missing"===e.status).length,u=[{key:"audit",label:"Audit",icon:sn,count:e.counts.issues},{key:"values",label:"Values",icon:oT,count:e.counts.total}];return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 self-start rounded-sm border border-border bg-card p-1",children:u.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)(e.icon,{className:"size-4"}),e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),"values"===t?(0,eT.jsx)(cw,{env:e}):(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsx)(oS,{title:"Variables",children:(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.total}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"total"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.issues}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"with issues"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums",style:{color:d>0?"var(--sev-critical)":"var(--sev-ok)"},children:d}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"exposed"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums",style:{color:c>0?"var(--sev-high)":"var(--sev-ok)"},children:c}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"missing"})]})]})}),(0,eT.jsx)(oS,{title:"By scope",children:(0,eT.jsx)(o$,{segments:l})}),(0,eT.jsx)(oS,{title:"By status",children:(0,eT.jsx)(oI,{rows:o,activeKey:"all"===r||"issues"===r?null:r,onSelect:e=>i(t=>t===e?"all":e)})}),(0,eT.jsx)(oS,{title:"Env files",children:(0,eT.jsx)("ul",{className:"flex flex-col gap-1.5",children:e.files.map(e=>(0,eT.jsxs)("li",{className:"flex items-center justify-between font-mono text-xs",children:[(0,eT.jsxs)("span",{className:"flex items-center gap-2",children:[(0,eT.jsx)(si,{className:"size-3.5 text-muted-foreground"}),(0,eT.jsx)("span",{className:(0,ny.cn)(e.present?"text-foreground":"text-muted-foreground line-through"),children:e.path})]}),(0,eT.jsx)("span",{className:"tabular-nums text-muted-foreground",children:e.present?`${e.vars}`:"—"})]},e.path))})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:[{key:"all",label:"All",count:e.counts.total},{key:"issues",label:"Issues",count:e.counts.issues},...o.filter(e=>"ok"!==e.key).map(e=>({key:e.key,label:e.label,count:e.count}))].map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>i(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",r===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eH,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Environment variables"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:s.length})]}),0===s.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No variables in this category."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:s.map(e=>(0,eT.jsx)(ck,{v:e},e.key))})]})]})]})}let c_=eL("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]);function cS(e){let t=e.issues.map(e=>oV(e.severity).rank);return t.length?Math.max(...t):0}function c$({call:e}){let{viewIssue:t}=l$(),n=[...e.issues].sort((e,t)=>oV(t.severity).rank-oV(e.severity).rank)[0],r=n?oV(n.severity):null;return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(oQ(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(oQ(e)))},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[e.secure?(0,eT.jsx)(dm,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}):(0,eT.jsx)(dD,{className:"mt-0.5 size-4 shrink-0 text-[color:var(--sev-high)]"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-foreground",children:e.method}),(0,eT.jsx)("span",{className:"truncate font-mono text-sm text-foreground",children:e.url})]}),(0,eT.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 font-mono text-[10px] uppercase text-muted-foreground",children:[(0,eT.jsx)("span",{className:"rounded-sm border border-border px-1.5 py-0.5",children:e.client}),(0,eT.jsx)("span",{className:"rounded-sm border border-border px-1.5 py-0.5",children:e.external?"external":"internal"}),r&&(0,eT.jsxs)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",r.bg,r.text),children:[e.issues.length," ",1===e.issues.length?"issue":"issues"]})]}),n&&(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm leading-relaxed text-foreground",children:n.message})]}),(0,eT.jsx)(lM,{issue:oQ(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function cI({network:e}){let[t,n]=(0,eP.useState)("all"),[r,i]=(0,eP.useState)("all"),a=(0,eP.useMemo)(()=>[...e.calls].sort((e,t)=>cS(t)-cS(e)),[e.calls]),s=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.calls)t.set(n.method,(t.get(n.method)??0)+1);let n=[...t.entries()].sort((e,t)=>t[1]-e[1]);return[{key:"all",count:e.calls.length},...n.map(([e,t])=>({key:e,count:t}))]},[e.calls]),o=(0,eP.useMemo)(()=>{let e=(()=>{switch(t){case"external":return a.filter(e=>e.external);case"insecure":return a.filter(e=>!e.secure);case"issues":return a.filter(e=>e.issues.length>0);default:return a}})();return"all"===r?e:e.filter(e=>e.method===r)},[a,t,r]),l=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.domains)t.set(n.category,(t.get(n.category)??0)+n.calls);return[...t.entries()].map(([e,t])=>({key:e,label:e,count:t})).sort((e,t)=>t.count-e.count)},[e.domains]),d=[{label:"HTTPS",value:e.calls.filter(e=>e.secure).length,color:"var(--chart-1)"},{label:"HTTP",value:e.calls.filter(e=>!e.secure).length,color:"var(--chart-3)"}],c=[{key:"all",label:"All",count:e.counts.total},{key:"issues",label:"Issues",count:e.counts.issues},{key:"external",label:"External",count:e.counts.external},{key:"insecure",label:"Insecure",count:e.counts.insecure}];return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsx)(oS,{title:"Requests",children:(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.total}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"total calls"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.counts.external}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"external"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums",style:{color:e.counts.insecure>0?"var(--sev-high)":"var(--sev-ok)"},children:e.counts.insecure}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"insecure"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.domains.length}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"hosts"})]})]})}),(0,eT.jsx)(oS,{title:"By scheme",children:(0,eT.jsx)(o$,{segments:d})}),(0,eT.jsx)(oS,{title:"Traffic by category",children:(0,eT.jsx)(oI,{rows:l})}),(0,eT.jsx)(oS,{title:"Hosts",children:(0,eT.jsx)("ul",{className:"flex flex-col gap-1.5",children:e.domains.map(e=>(0,eT.jsxs)("li",{className:"flex items-center justify-between gap-2 font-mono text-xs",children:[(0,eT.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[e.external?(0,eT.jsx)(s2,{className:"size-3 shrink-0 text-muted-foreground"}):(0,eT.jsx)(eG,{className:"size-3 shrink-0 text-muted-foreground"}),(0,eT.jsx)("span",{className:"truncate text-foreground",children:e.host})]}),(0,eT.jsx)("span",{className:"tabular-nums text-muted-foreground",children:e.calls})]},e.host))})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:c.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),s.length>2&&(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5 pr-1 font-mono text-[10px] uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(c_,{className:"size-3.5"}),"Method"]}),s.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>i(e.key),className:(0,ny.cn)("inline-flex items-center gap-1.5 rounded-sm border px-2 py-1 font-mono text-[11px] uppercase transition-colors",r===e.key?"border-foreground/30 bg-foreground/[0.06] text-foreground":"border-border text-muted-foreground hover:text-foreground"),children:["all"===e.key?"All":e.key,(0,eT.jsx)("span",{className:"tabular-nums text-muted-foreground",children:e.count})]},e.key))]}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eG,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Outbound requests"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:o.length})]}),0===o.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No requests in this category."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:o.map(e=>(0,eT.jsx)(c$,{call:e},e.id))})]})]})}let cE=eL("git-commit-horizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]),cC=eL("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),cA=eL("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]),cT=eL("workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]),cP=eL("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]),cz=eL("git-graph",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M5 9v6",key:"158jrl"}],["circle",{cx:"5",cy:"18",r:"3",key:"104gr9"}],["path",{d:"M12 3v18",key:"108xh3"}],["circle",{cx:"19",cy:"6",r:"3",key:"108a5v"}],["path",{d:"M16 15.7A9 9 0 0 0 19 9",key:"1e3vqb"}]]),cO=eL("git-fork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]),cM=eL("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]),cR=eL("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]),cD=eL("rocket",[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]]),cL=eL("file-diff",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]),cU=eL("stethoscope",[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]]),cZ=eL("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);e.s(["ERROR_REVALIDATE_EVENT",0,3,"FOCUS_EVENT",0,0,"MUTATE_EVENT",0,2,"RECONNECT_EVENT",0,1],67005);var cF=Object.prototype.hasOwnProperty;let cB=new WeakMap,cV=()=>{},cq=cV(),cW=Object,cH=e=>e===cq,cG=(e,t)=>({...e,...t}),cK={},cJ={},cY="undefined",cX=typeof window!=cY,cQ=typeof document!=cY,c0=cX&&"Deno"in window,c1=(e,t)=>{let n=cB.get(e);return[()=>!cH(t)&&e.get(t)||cK,r=>{if(!cH(t)){let i=e.get(t);t in cJ||(cJ[t]=i),n[5](t,cG(i,r),i||cK)}},n[6],()=>!cH(t)&&t in cJ?cJ[t]:!cH(t)&&e.get(t)||cK]},c2=!0,[c4,c5]=cX&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[cV,cV],c6={initFocus:e=>(cQ&&document.addEventListener("visibilitychange",e),c4("focus",e),()=>{cQ&&document.removeEventListener("visibilitychange",e),c5("focus",e)}),initReconnect:e=>{let t=()=>{c2=!0,e()},n=()=>{c2=!1};return c4("online",t),c4("offline",n),()=>{c5("online",t),c5("offline",n)}}},c3=!eP.default.useId,c9=!cX||c0,c8=c9?eP.useEffect:eP.useLayoutEffect,c7="u">typeof navigator&&navigator.connection,ue=!c9&&c7&&(["slow-2g","2g"].includes(c7.effectiveType)||c7.saveData),ut=new WeakMap,un=(e,t)=>e===`[object ${t}]`,ur=0,ui=e=>{let t,n,r=typeof e,i=cW.prototype.toString.call(e),a=un(i,"Date"),s=un(i,"RegExp"),o=un(i,"Object");if(cW(e)!==e||a||s)t=a?e.toJSON():"symbol"==r?e.toString():"string"==r?JSON.stringify(e):""+e;else{if(t=ut.get(e))return t;if(t=++ur+"~",ut.set(e,t),Array.isArray(e)){for(n=0,t="@";n<e.length;n++)t+=ui(e[n])+",";ut.set(e,t)}if(o){t="#";let r=cW.keys(e).sort();for(;!cH(n=r.pop());)cH(e[n])||(t+=n+":"+ui(e[n])+",");ut.set(e,t)}}return t},ua=e=>{if("function"==typeof e)try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?ui(e):"",t]},us=0,uo=()=>++us;async function ul(...e){let[t,n,r,i]=e,a=cG({populateCache:!0,throwOnError:!0},"boolean"==typeof i?{revalidate:i}:i||{}),s=a.populateCache,o=a.rollbackOnError,l=a.optimisticData,d=a.throwOnError;if("function"==typeof n){let e=[];for(let r of t.keys())!/^\$(inf|sub)\$/.test(r)&&n(t.get(r)._k)&&e.push(r);return Promise.all(e.map(c))}return c(n);async function c(n){let i,[c]=ua(n);if(!c)return;let[u,m]=c1(t,c),[p,f,h,g]=cB.get(t),x=()=>{let e=p[c];return("function"==typeof a.revalidate?a.revalidate(u().data,n):!1!==a.revalidate)&&(delete h[c],delete g[c],e&&e[0])?e[0](2).then(()=>u().data):u().data};if(e.length<3)return x();let v=r,y=!1,b=uo();f[c]=[b,0];let k=!cH(l),j=u(),w=j.data,N=j._c,_=cH(N)?w:N;if(k&&m({data:l="function"==typeof l?l(_,w):l,_c:_}),"function"==typeof v)try{v=v(_)}catch(e){i=e,y=!0}if(v&&"function"==typeof v.then){let e;if(v=await v.catch(e=>{i=e,y=!0}),b!==f[c][0]){if(y)throw i;return v}y&&k&&(e=i,"function"==typeof o?o(e):!1!==o)&&(s=!0,m({data:_,_c:cq}))}if(s&&!y&&("function"==typeof s?m({data:s(v,_),error:cq,_c:cq}):m({data:v,error:cq,_c:cq})),f[c][1]=uo(),Promise.resolve(x()).then(()=>{m({_c:cq})}),y){if(d)throw i;return}return v}}let ud=(e,t)=>{for(let n in e)e[n][0]&&e[n][0](t)},uc=(e,t)=>{if(!cB.has(e)){let n=cG(c6,t),r=Object.create(null),i=ul.bind(cq,e),a=cV,s=Object.create(null),o=(e,t)=>{let n=s[e]||[];return s[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},l=(t,n,r)=>{e.set(t,n);let i=s[t];if(i)for(let e of i)e(n,r)},d=()=>{if(!cB.has(e)&&(cB.set(e,[r,Object.create(null),Object.create(null),Object.create(null),i,l,o]),!c9)){let t=n.initFocus(setTimeout.bind(cq,ud.bind(cq,r,0))),i=n.initReconnect(setTimeout.bind(cq,ud.bind(cq,r,1)));a=()=>{t&&t(),i&&i(),cB.delete(e)}}};return d(),[e,i,d,a]}return[e,cB.get(e)[4]]},[uu,um]=uc(new Map),up=cG({onLoadingSlow:cV,onSuccess:cV,onError:cV,onErrorRetry:(e,t,n,r,i)=>{let a=n.errorRetryCount,s=i.retryCount,o=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;(cH(a)||!(s>a))&&setTimeout(r,o,i)},onDiscarded:cV,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:ue?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:ue?5e3:3e3,compare:function e(t,n){var r,i;if(t===n)return!0;if(t&&n&&(r=t.constructor)===n.constructor){if(r===Date)return t.getTime()===n.getTime();if(r===RegExp)return t.toString()===n.toString();if(r===Array){if((i=t.length)===n.length)for(;i--&&e(t[i],n[i]););return -1===i}if(!r||"object"==typeof t){for(r in i=0,t)if(cF.call(t,r)&&++i&&!cF.call(n,r)||!(r in n)||!e(t[r],n[r]))return!1;return Object.keys(n).length===i}}return t!=t&&n!=n},isPaused:()=>!1,cache:uu,mutate:um,fallback:{}},{isOnline:()=>c2,isVisible:()=>{let e=cQ&&document.visibilityState;return cH(e)||"hidden"!==e}}),uf=(e,t)=>{let n=cG(e,t);if(t){let{use:r,fallback:i}=e,{use:a,fallback:s}=t;r&&a&&(n.use=r.concat(a)),i&&s&&(n.fallback=cG(i,s))}return n},uh=(0,eP.createContext)({});var ug=e.i(67005);let ux=cX&&window.__SWR_DEVTOOLS_USE__,uv=(ux?window.__SWR_DEVTOOLS_USE__:[]).concat(e=>(t,n,r)=>{let i=n&&((...e)=>{let[r]=ua(t),[,,,i]=cB.get(uu);if(r.startsWith("$inf$"))return n(...e);let a=i[r];return cH(a)?n(...e):(delete i[r],a)});return e(t,i,r)});ux&&(window.__SWR_DEVTOOLS_REACT__=eP.default);let uy=()=>{},ub=uy(),uk=(new WeakMap,eP.default.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}})),uj={dedupe:!0},uw=Promise.resolve(cq),uN=()=>cV;cW.defineProperty(e=>{let{value:t}=e,n=(0,eP.useContext)(uh),r="function"==typeof t,i=(0,eP.useMemo)(()=>r?t(n):t,[r,n,t]),a=(0,eP.useMemo)(()=>r?i:uf(n,i),[r,n,i]),s=i&&i.provider,o=(0,eP.useRef)(cq);s&&!o.current&&(o.current=uc(s(a.cache||uu),i));let l=o.current;return l&&(a.cache=l[0],a.mutate=l[1]),c8(()=>{if(l)return l[2]&&l[2](),l[3]},[]),(0,eP.createElement)(uh.Provider,cG(e,{value:a}))},"defaultValue",{value:up});let u_=(n=(e,t,n)=>{let{cache:r,compare:i,suspense:a,fallbackData:s,revalidateOnMount:o,revalidateIfStale:l,refreshInterval:d,refreshWhenHidden:c,refreshWhenOffline:u,keepPreviousData:m,strictServerPrefetchWarning:p}=n,[f,h,g,x]=cB.get(r),[v,y]=ua(e),b=(0,eP.useRef)(!1),k=(0,eP.useRef)(!1),j=(0,eP.useRef)(v),w=(0,eP.useRef)(t),N=(0,eP.useRef)(n),_=()=>N.current.isVisible()&&N.current.isOnline(),[S,$,I,E]=c1(r,v),C=(0,eP.useRef)({}).current,A=cH(s)?cH(n.fallback)?cq:n.fallback[v]:s,T=(e,t)=>{for(let n in C)if("data"===n){if(!i(e[n],t[n])&&(!cH(e[n])||!i(Z,t[n])))return!1}else if(t[n]!==e[n])return!1;return!0},P=!b.current,z=(0,eP.useMemo)(()=>{let e=S(),n=E(),r=e=>{let n=cG(e);return(delete n._k,(()=>{if(!v||!t||N.current.isPaused())return!1;if(P&&!cH(o))return o;let e=cH(A)?n.data:A;return cH(e)||l})())?{isValidating:!0,isLoading:!0,...n}:n},i=r(e),a=e===n?i:r(n),s=i;return[()=>{let e=r(S());return T(e,s)?(s.data=e.data,s.isLoading=e.isLoading,s.isValidating=e.isValidating,s.error=e.error,s):(s=e,e)},()=>a]},[r,v]),O=(0,tL.useSyncExternalStore)((0,eP.useCallback)(e=>I(v,(t,n)=>{T(n,t)||e()}),[r,v]),z[0],z[1]),M=f[v]&&f[v].length>0,R=O.data,D=cH(R)?A&&"function"==typeof A.then?uk(A):A:R,L=O.error,U=(0,eP.useRef)(D),Z=m?cH(R)?cH(U.current)?D:U.current:R:D,F=v&&cH(D),B=(0,eP.useRef)(null);c9||(0,tL.useSyncExternalStore)(uN,()=>(B.current=!1,B),()=>(B.current=!0,B));let V=B.current;p&&V&&!a&&F&&console.warn(`Missing pre-initiated data for serialized key "${v}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);let q=!(!v||!t||N.current.isPaused())&&(!M||!!cH(L))&&(P&&!cH(o)?o:a?!cH(D)&&l:cH(D)||l),W=P&&q,H=cH(O.isValidating)?W:O.isValidating,G=cH(O.isLoading)?W:O.isLoading,K=(0,eP.useCallback)(async e=>{let t,r,a=w.current;if(!v||!a||k.current||N.current.isPaused())return!1;let s=!0,o=e||{},l=!g[v]||!o.dedupe,d=()=>c3?!k.current&&v===j.current&&b.current:v===j.current,c={isValidating:!1,isLoading:!1},u=()=>{$(c)},m=()=>{let e=g[v];e&&e[1]===r&&delete g[v]},p={isValidating:!0};cH(S().data)&&(p.isLoading=!0);try{if(l&&($(p),n.loadingTimeout&&cH(S().data)&&setTimeout(()=>{s&&d()&&N.current.onLoadingSlow(v,n)},n.loadingTimeout),g[v]=[a(y),uo()]),[t,r]=g[v],t=await t,l&&setTimeout(m,n.dedupingInterval),!g[v]||g[v][1]!==r)return l&&d()&&N.current.onDiscarded(v),!1;c.error=cq;let e=h[v];if(!cH(e)&&(r<=e[0]||r<=e[1]||0===e[1]))return u(),l&&d()&&N.current.onDiscarded(v),!1;let o=S().data;c.data=i(o,t)?o:t,l&&d()&&N.current.onSuccess(t,v,n)}catch(n){m();let e=N.current,{shouldRetryOnError:t}=e;!e.isPaused()&&(c.error=n,l&&d())&&(e.onError(n,v,e),(!0===t||"function"==typeof t&&t(n))&&(!N.current.revalidateOnFocus||!N.current.revalidateOnReconnect||_())&&e.onErrorRetry(n,v,e,e=>{let t=f[v];t&&t[0]&&t[0](ug.ERROR_REVALIDATE_EVENT,e)},{retryCount:(o.retryCount||0)+1,dedupe:!0}))}return s=!1,u(),!0},[v,r]),J=(0,eP.useCallback)((...e)=>ul(r,j.current,...e),[]);if(c8(()=>{w.current=t,N.current=n,cH(R)||(U.current=R)}),c8(()=>{var e;let t;if(!v)return;let n=K.bind(cq,uj),r=0;N.current.revalidateOnFocus&&(r=Date.now()+N.current.focusThrottleInterval);let i=(e=(e,t={})=>{if(e==ug.FOCUS_EVENT){let e=Date.now();N.current.revalidateOnFocus&&e>r&&_()&&(r=e+N.current.focusThrottleInterval,n())}else if(e==ug.RECONNECT_EVENT)N.current.revalidateOnReconnect&&_()&&n();else if(e==ug.MUTATE_EVENT)return K();else if(e==ug.ERROR_REVALIDATE_EVENT)return K(t)},(t=f[v]||(f[v]=[])).push(e),()=>{let n=t.indexOf(e);n>=0&&(t[n]=t[t.length-1],t.pop())});if(k.current=!1,j.current=v,b.current=!0,$({_k:y}),q&&!g[v])if(cH(D)||c9)n();else cX&&typeof window.requestAnimationFrame!=cY?window.requestAnimationFrame(n):setTimeout(n,1);return()=>{k.current=!0,i()}},[v]),c8(()=>{let e;function t(){let t="function"==typeof d?d(S().data):d;t&&-1!==e&&(e=setTimeout(n,t))}function n(){!S().error&&(c||N.current.isVisible())&&(u||N.current.isOnline())?K(uj).then(t):t()}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[d,c,u,v]),(0,eP.useDebugValue)(Z),a){if(!c3&&c9&&F)throw Error("Fallback data is required when using Suspense in SSR.");F&&(w.current=t,N.current=n,k.current=!1);let e=x[v];if(uk(!cH(e)&&F?J(e):uw),!cH(L)&&F)throw L;let r=F?K(uj):uw;!cH(Z)&&F&&(r.status="fulfilled",r.value=!0),uk(r)}return{mutate:J,get data(){return C.data=!0,Z},get error(){return C.error=!0,L},get isValidating(){return C.isValidating=!0,H},get isLoading(){return C.isLoading=!0,G}}},function(...e){let t,r=(t=(0,eP.useContext)(uh),(0,eP.useMemo)(()=>cG(up,t),[t])),[i,a,s]="function"==typeof e[1]?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],o=uf(r,s),l=n,{use:d}=o,c=(d||[]).concat(uv);for(let e=c.length;e--;)l=c[e](l);return l(i,a||o.fetcher||null,o)}),uS=eL("git-compare-arrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]),u$=eL("calendar-days",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]),uI=eL("trophy",[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]]),uE=eL("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]),uC=eL("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);function uA(){}function uT(){}let uP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uz=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,uO={};function uM(e,t){return((t||uO).jsx?uz:uP).test(e)}let uR=/[ \t\n\f\r]/g;function uD(e){return""===e.replace(uR,"")}class uL{constructor(e,t){this.attribute=t,this.property=e}}uL.prototype.attribute="",uL.prototype.booleanish=!1,uL.prototype.boolean=!1,uL.prototype.commaOrSpaceSeparated=!1,uL.prototype.commaSeparated=!1,uL.prototype.defined=!1,uL.prototype.mustUseProperty=!1,uL.prototype.number=!1,uL.prototype.overloadedBoolean=!1,uL.prototype.property="",uL.prototype.spaceSeparated=!1,uL.prototype.space=void 0;let uU=0,uZ=uG(),uF=uG(),uB=uG(),uV=uG(),uq=uG(),uW=uG(),uH=uG();function uG(){return 2**++uU}e.s(["boolean",0,uZ,"booleanish",0,uF,"commaOrSpaceSeparated",0,uH,"commaSeparated",0,uW,"number",0,uV,"overloadedBoolean",0,uB,"spaceSeparated",0,uq],35999);var uK=e.i(35999);let uJ=Object.keys(uK);class uY extends uL{constructor(e,t,n,r){let i=-1;if(super(e,t),function(e,t,n){n&&(e[t]=n)}(this,"space",r),"number"==typeof n)for(;++i<uJ.length;){const e=uJ[i];!function(e,t,n){n&&(e[t]=n)}(this,uJ[i],(n&uK[e])===uK[e])}}}function uX(e){return e.toLowerCase()}uY.prototype.defined=!0;let uQ=/[A-Z]/g,u0=/-[a-z]/g,u1=/^data[-\w.:]+$/i;function u2(e){return"-"+e.toLowerCase()}function u4(e){return e.charAt(1).toUpperCase()}let u5={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};class u6{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function u3(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new u6(n,r,t)}function u9(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new uY(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[uX(r)]=r,n[uX(a.attribute)]=r}return new u6(t,n,e.space)}u6.prototype.normal={},u6.prototype.property={},u6.prototype.space=void 0;let u8=u9({properties:{ariaActiveDescendant:null,ariaAtomic:uF,ariaAutoComplete:null,ariaBusy:uF,ariaChecked:uF,ariaColCount:uV,ariaColIndex:uV,ariaColSpan:uV,ariaControls:uq,ariaCurrent:null,ariaDescribedBy:uq,ariaDetails:null,ariaDisabled:uF,ariaDropEffect:uq,ariaErrorMessage:null,ariaExpanded:uF,ariaFlowTo:uq,ariaGrabbed:uF,ariaHasPopup:null,ariaHidden:uF,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:uq,ariaLevel:uV,ariaLive:null,ariaModal:uF,ariaMultiLine:uF,ariaMultiSelectable:uF,ariaOrientation:null,ariaOwns:uq,ariaPlaceholder:null,ariaPosInSet:uV,ariaPressed:uF,ariaReadOnly:uF,ariaRelevant:null,ariaRequired:uF,ariaRoleDescription:uq,ariaRowCount:uV,ariaRowIndex:uV,ariaRowSpan:uV,ariaSelected:uF,ariaSetSize:uV,ariaSort:null,ariaValueMax:uV,ariaValueMin:uV,ariaValueNow:uV,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function u7(e,t){return t in e?e[t]:t}function me(e,t){return u7(e,t.toLowerCase())}let mt=u9({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:uW,acceptCharset:uq,accessKey:uq,action:null,allow:null,allowFullScreen:uZ,allowPaymentRequest:uZ,allowUserMedia:uZ,alpha:uZ,alt:null,as:null,async:uZ,autoCapitalize:null,autoComplete:uq,autoFocus:uZ,autoPlay:uZ,blocking:uq,capture:null,charSet:null,checked:uZ,cite:null,className:uq,closedBy:null,colorSpace:null,cols:uV,colSpan:uV,command:null,commandFor:null,content:null,contentEditable:uF,controls:uZ,controlsList:uq,coords:uV|uW,crossOrigin:null,data:null,dateTime:null,decoding:null,default:uZ,defer:uZ,dir:null,dirName:null,disabled:uZ,download:uB,draggable:uF,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:uZ,formTarget:null,headers:uq,height:uV,hidden:uB,high:uV,href:null,hrefLang:null,htmlFor:uq,httpEquiv:uq,id:null,imageSizes:null,imageSrcSet:null,inert:uZ,inputMode:null,integrity:null,is:null,isMap:uZ,itemId:null,itemProp:uq,itemRef:uq,itemScope:uZ,itemType:uq,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:uZ,low:uV,manifest:null,max:null,maxLength:uV,media:null,method:null,min:null,minLength:uV,multiple:uZ,muted:uZ,name:null,nonce:null,noModule:uZ,noValidate:uZ,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:uZ,optimum:uV,pattern:null,ping:uq,placeholder:null,playsInline:uZ,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:uZ,referrerPolicy:null,rel:uq,required:uZ,reversed:uZ,rows:uV,rowSpan:uV,sandbox:uq,scope:null,scoped:uZ,seamless:uZ,selected:uZ,shadowRootClonable:uZ,shadowRootCustomElementRegistry:uZ,shadowRootDelegatesFocus:uZ,shadowRootMode:null,shadowRootSerializable:uZ,shape:null,size:uV,sizes:null,slot:null,span:uV,spellCheck:uF,src:null,srcDoc:null,srcLang:null,srcSet:null,start:uV,step:null,style:null,tabIndex:uV,target:null,title:null,translate:null,type:null,typeMustMatch:uZ,useMap:null,value:uF,width:uV,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:uq,axis:null,background:null,bgColor:null,border:uV,borderColor:null,bottomMargin:uV,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:uZ,declare:uZ,event:null,face:null,frame:null,frameBorder:null,hSpace:uV,leftMargin:uV,link:null,longDesc:null,lowSrc:null,marginHeight:uV,marginWidth:uV,noResize:uZ,noHref:uZ,noShade:uZ,noWrap:uZ,object:null,profile:null,prompt:null,rev:null,rightMargin:uV,rules:null,scheme:null,scrolling:uF,standby:null,summary:null,text:null,topMargin:uV,valueType:null,version:null,vAlign:null,vLink:null,vSpace:uV,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:uZ,disablePictureInPicture:uZ,disableRemotePlayback:uZ,exportParts:uW,part:uq,prefix:null,property:null,results:uV,security:null,unselectable:null},space:"html",transform:me}),mn=u9({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:uH,accentHeight:uV,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:uV,amplitude:uV,arabicForm:null,ascent:uV,attributeName:null,attributeType:null,azimuth:uV,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:uV,by:null,calcMode:null,capHeight:uV,className:uq,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:uV,diffuseConstant:uV,direction:null,display:null,dur:null,divisor:uV,dominantBaseline:null,download:uZ,dx:null,dy:null,edgeMode:null,editable:null,elevation:uV,enableBackground:null,end:null,event:null,exponent:uV,externalResourcesRequired:null,fill:null,fillOpacity:uV,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:uW,g2:uW,glyphName:uW,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:uV,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:uV,horizOriginX:uV,horizOriginY:uV,id:null,ideographic:uV,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:uV,k:uV,k1:uV,k2:uV,k3:uV,k4:uV,kernelMatrix:uH,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:uV,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:uV,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:uV,overlineThickness:uV,paintOrder:null,panose1:null,path:null,pathLength:uV,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:uq,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:uV,pointsAtY:uV,pointsAtZ:uV,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:uH,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:uH,rev:uH,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:uH,requiredFeatures:uH,requiredFonts:uH,requiredFormats:uH,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:uV,specularExponent:uV,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:uV,strikethroughThickness:uV,string:null,stroke:null,strokeDashArray:uH,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:uV,strokeOpacity:uV,strokeWidth:null,style:null,surfaceScale:uV,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:uH,tabIndex:uV,tableValues:null,target:null,targetX:uV,targetY:uV,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:uH,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:uV,underlineThickness:uV,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:uV,values:null,vAlphabetic:uV,vMathematical:uV,vectorEffect:null,vHanging:uV,vIdeographic:uV,version:null,vertAdvY:uV,vertOriginX:uV,vertOriginY:uV,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:uV,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:u7}),mr=u9({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(e,t)=>"xlink:"+t.slice(5).toLowerCase()}),mi=u9({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:me}),ma=u9({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),ms=u3([u8,mt,mr,mi,ma],"html"),mo=u3([u8,mn,mr,mi,ma],"svg");var ml=e.i(63185);let md=mu("end"),mc=mu("start");function mu(e){return function(t){let n=t&&t.position&&t.position[e]||{};if("number"==typeof n.line&&n.line>0&&"number"==typeof n.column&&n.column>0)return{line:n.line,column:n.column,offset:"number"==typeof n.offset&&n.offset>-1?n.offset:void 0}}}function mm(e){return e&&"object"==typeof e?"position"in e||"type"in e?mf(e.position):"start"in e||"end"in e?mf(e):"line"in e||"column"in e?mp(e):"":""}function mp(e){return mh(e&&e.line)+":"+mh(e&&e.column)}function mf(e){return mp(e&&e.start)+"-"+mp(e&&e.end)}function mh(e){return e&&"number"==typeof e?e:1}class mg extends Error{constructor(e,t,n){super(),"string"==typeof t&&(n=t,t=void 0);let r="",i={},a=!1;if(t&&(i="line"in t&&"column"in t||"start"in t&&"end"in t?{place:t}:"type"in t?{ancestors:[t],place:t.position}:{...t}),"string"==typeof e?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&"string"==typeof n){const e=n.indexOf(":");-1===e?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){const e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}const s=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=s?s.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=s?s.line:void 0,this.name=mm(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&"string"==typeof i.cause.stack?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}mg.prototype.file="",mg.prototype.name="",mg.prototype.reason="",mg.prototype.message="",mg.prototype.stack="",mg.prototype.column=void 0,mg.prototype.line=void 0,mg.prototype.ancestors=void 0,mg.prototype.cause=void 0,mg.prototype.fatal=void 0,mg.prototype.place=void 0,mg.prototype.ruleId=void 0,mg.prototype.source=void 0;let mx={}.hasOwnProperty,mv=new Map,my=/[A-Z]/g,mb=new Set(["table","tbody","thead","tfoot","tr"]),mk=new Set(["td","th"]),mj="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function mw(e,t,n){var r,i,a,s,o,l,d,c,u;let m,p,f,h,g,x,v,y,b,k,j;return"element"===t.type?(r=e,i=t,a=n,p=m=r.schema,"svg"===i.tagName.toLowerCase()&&"html"===m.space&&(r.schema=mo),r.ancestors.push(i),f=m$(r,i.tagName,!1),h=function(e,t){let n,r,i={};for(r in t.properties)if("children"!==r&&mx.call(t.properties,r)){let a=function(e,t,n){let r=function(e,t){let n=uX(t),r=t,i=uL;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&u1.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(u0,u4);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!u0.test(e)){let n=e.replace(uQ,u2);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=uY}return new i(r,t)}(e.schema,t);if(!(null==n||"number"==typeof n&&Number.isNaN(n))){var i;let t;if(Array.isArray(n)&&(n=r.commaSeparated?(t={},(""===(i=n)[i.length-1]?[...i,""]:i).join((t.padRight?" ":"")+","+(!1===t.padLeft?"":" ")).trim()):n.join(" ").trim()),"style"===r.property){let t="object"==typeof n?n:function(e,t){try{return(0,ml.default)(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};let t=new mg("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw t.file=e.filePath||void 0,t.url=mj+"#cannot-parse-style-attribute",t}}(e,String(n));return"css"===e.stylePropertyNameCase&&(t=function(e){let t,n={};for(t in e)mx.call(e,t)&&(n[function(e){let t=e.replace(my,mE);return"ms-"===t.slice(0,3)&&(t="-"+t),t}(t)]=e[t]);return n}(t)),["style",t]}return["react"===e.elementAttributeNameCase&&r.space?u5[r.property]||r.property:r.attribute,n]}}(e,r,t.properties[r]);if(a){let[r,s]=a;e.tableCellAlignToStyle&&"align"===r&&"string"==typeof s&&mk.has(t.tagName)?n=s:i[r]=s}}return n&&((i.style||(i.style={}))["css"===e.stylePropertyNameCase?"text-align":"textAlign"]=n),i}(r,i),g=mS(r,i),mb.has(i.tagName)&&(g=g.filter(function(e){return"string"!=typeof e||!("object"==typeof e?"text"===e.type&&uD(e.value):uD(e))})),mN(r,h,f,i),m_(h,g),r.ancestors.pop(),r.schema=m,r.create(i,f,h,a)):"mdxFlowExpression"===t.type||"mdxTextExpression"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return uA("ExpressionStatement"===n.type),e.evaluater.evaluateExpression(n.expression)}mI(e,t.position)}(e,t):"mdxJsxFlowElement"===t.type||"mdxJsxTextElement"===t.type?(s=e,o=t,l=n,v=x=s.schema,"svg"===o.name&&"html"===x.space&&(s.schema=mo),s.ancestors.push(o),y=null===o.name?s.Fragment:m$(s,o.name,!0),b=function(e,t){let n={};for(let r of t.attributes)if("mdxJsxExpressionAttribute"===r.type)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];uA("ExpressionStatement"===t.type);let i=t.expression;uA("ObjectExpression"===i.type);let a=i.properties[0];uA("SpreadElement"===a.type),Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else mI(e,t.position);else{let i,a=r.name;if(r.value&&"object"==typeof r.value)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];uA("ExpressionStatement"===t.type),i=e.evaluater.evaluateExpression(t.expression)}else mI(e,t.position);else i=null===r.value||r.value;n[a]=i}return n}(s,o),k=mS(s,o),mN(s,b,y,o),m_(b,k),s.ancestors.pop(),s.schema=x,s.create(o,y,b,l)):"mdxjsEsm"===t.type?function(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);mI(e,t.position)}(e,t):"root"===t.type?(d=e,c=t,u=n,m_(j={},mS(d,c)),d.create(c,d.Fragment,j,u)):"text"===t.type?t.value:void 0}function mN(e,t,n,r){"string"!=typeof n&&n!==e.Fragment&&e.passNode&&(t.node=r)}function m_(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function mS(e,t){let n=[],r=-1,i=e.passKeys?new Map:mv;for(;++r<t.children.length;){let a,s=t.children[r];if(e.passKeys){let e="element"===s.type?s.tagName:"mdxJsxFlowElement"===s.type||"mdxJsxTextElement"===s.type?s.name:void 0;if(e){let t=i.get(e)||0;a=e+"-"+t,i.set(e,t+1)}}let o=mw(e,s,a);void 0!==o&&n.push(o)}return n}function m$(e,t,n){let r;if(n)if(t.includes(".")){let e,n=t.split("."),i=-1;for(;++i<n.length;){let t=uM(n[i])?{type:"Identifier",name:n[i]}:{type:"Literal",value:n[i]};e=e?{type:"MemberExpression",object:e,property:t,computed:!!(i&&"Literal"===t.type),optional:!1}:t}uA(e,"always a result"),r=e}else r=uM(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};else r={type:"Literal",value:t};if("Literal"===r.type){let t=r.value;return mx.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);mI(e)}function mI(e,t){let n=new mg("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=mj+"#cannot-handle-mdx-estrees-without-createevaluater",n}function mE(e){return"-"+e.toLowerCase()}let mC={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},mA={};function mT(e,t){let n=t||mA;return mP(e,"boolean"!=typeof n.includeImageAlt||n.includeImageAlt,"boolean"!=typeof n.includeHtml||n.includeHtml)}function mP(e,t,n){var r;if((r=e)&&"object"==typeof r){if("value"in e)return"html"!==e.type||n?e.value:"";if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return mz(e.children,t,n)}return Array.isArray(e)?mz(e,t,n):""}function mz(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=mP(e[i],t,n);return r.join("")}function mO(e,t,n,r){let i,a=e.length,s=0;if(t=t<0?-t>a?0:a+t:t>a?a:t,n=n>0?n:0,r.length<1e4)(i=Array.from(r)).unshift(t,n),e.splice(...i);else for(n&&e.splice(t,n);s<r.length;)(i=r.slice(s,s+1e4)).unshift(t,0),e.splice(...i),s+=1e4,t+=1e4}function mM(e,t){return e.length>0?(mO(e,e.length,0,t),e):t}let mR={}.hasOwnProperty;function mD(e){let t={},n=-1;for(;++n<e.length;)!function(e,t){let n;for(n in t){let r,i=(mR.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];if(a)for(r in a){mR.call(i,r)||(i[r]=[]);let e=a[r];!function(e,t){let n=-1,r=[];for(;++n<t.length;)("after"===t[n].add?e:r).push(t[n]);mO(e,0,0,r)}(i[r],Array.isArray(e)?e:e?[e]:[])}}}(t,e[n]);return t}let mL=mY(/[A-Za-z]/),mU=mY(/[\dA-Za-z]/),mZ=mY(/[#-'*+\--9=?A-Z^-~]/);function mF(e){return null!==e&&(e<32||127===e)}let mB=mY(/\d/),mV=mY(/[\dA-Fa-f]/),mq=mY(/[!-/:-@[-`{-~]/);function mW(e){return null!==e&&e<-2}function mH(e){return null!==e&&(e<0||32===e)}function mG(e){return -2===e||-1===e||32===e}let mK=mY(/\p{P}|\p{S}/u),mJ=mY(/\s/);function mY(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}function mX(e,t,n,r){let i=r?r-1:1/0,a=0;return function(r){return mG(r)?(e.enter(n),function r(s){return mG(s)&&a++<i?(e.consume(s),r):(e.exit(n),t(s))}(r)):t(r)}}let mQ={tokenize:function(e){let t,n=e.attempt(this.parser.constructs.contentInitial,function(t){return null===t?void e.consume(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),mX(e,n,"linePrefix"))},function(n){return e.enter("paragraph"),function n(r){let i=e.enter("chunkText",{contentType:"text",previous:t});return t&&(t.next=i),t=i,function t(r){if(null===r){e.exit("chunkText"),e.exit("paragraph"),e.consume(r);return}return mW(r)?(e.consume(r),e.exit("chunkText"),n):(e.consume(r),t)}(r)}(n)});return n}},m0={tokenize:function(e){let t,n,r,i=this,a=[],s=0;return o;function o(t){if(s<a.length){let n=a[s];return i.containerState=n[1],e.attempt(n[0].continuation,l,d)(t)}return d(t)}function l(e){if(s++,i.containerState._closeFlow){let n;i.containerState._closeFlow=void 0,t&&x();let r=i.events.length,a=r;for(;a--;)if("exit"===i.events[a][0]&&"chunkFlow"===i.events[a][1].type){n=i.events[a][1].end;break}g(s);let o=r;for(;o<i.events.length;)i.events[o][1].end={...n},o++;return mO(i.events,a+1,0,i.events.slice(r)),i.events.length=o,d(e)}return o(e)}function d(n){if(s===a.length){if(!t)return m(n);if(t.currentConstruct&&t.currentConstruct.concrete)return f(n);i.interrupt=!!(t.currentConstruct&&!t._gfmTableDynamicInterruptHack)}return i.containerState={},e.check(m1,c,u)(n)}function c(e){return t&&x(),g(s),m(e)}function u(e){return i.parser.lazy[i.now().line]=s!==a.length,r=i.now().offset,f(e)}function m(t){return i.containerState={},e.attempt(m1,p,f)(t)}function p(e){return s++,a.push([i.currentConstruct,i.containerState]),m(e)}function f(r){if(null===r){t&&x(),g(0),e.consume(r);return}return t=t||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:t,contentType:"flow",previous:n}),function t(n){if(null===n){h(e.exit("chunkFlow"),!0),g(0),e.consume(n);return}return mW(n)?(e.consume(n),h(e.exit("chunkFlow")),s=0,i.interrupt=void 0,o):(e.consume(n),t)}(r)}function h(e,a){let o=i.sliceStream(e);if(a&&o.push(null),e.previous=n,n&&(n.next=e),n=e,t.defineSkip(e.start),t.write(o),i.parser.lazy[e.start.line]){let e,n,a=t.events.length;for(;a--;)if(t.events[a][1].start.offset<r&&(!t.events[a][1].end||t.events[a][1].end.offset>r))return;let o=i.events.length,l=o;for(;l--;)if("exit"===i.events[l][0]&&"chunkFlow"===i.events[l][1].type){if(e){n=i.events[l][1].end;break}e=!0}for(g(s),a=o;a<i.events.length;)i.events[a][1].end={...n},a++;mO(i.events,l+1,0,i.events.slice(o)),i.events.length=a}}function g(t){let n=a.length;for(;n-- >t;){let t=a[n];i.containerState=t[1],t[0].exit.call(i,e)}a.length=t}function x(){t.write([null]),n=void 0,t=void 0,i.containerState._closeFlow=void 0}}},m1={tokenize:function(e,t,n){return mX(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}},m2={partial:!0,tokenize:function(e,t,n){return function(t){return mG(t)?mX(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||mW(e)?t(e):n(e)}}};class m4{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=null==t?1/0:t;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){this.setCursor(Math.trunc(e));let r=this.right.splice(this.right.length-(t||0),1/0);return n&&m5(this.left,n),r.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),m5(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),m5(this.right,e.reverse())}setCursor(e){if(e!==this.left.length&&(!(e>this.left.length)||0!==this.right.length)&&(!(e<0)||0!==this.left.length))if(e<this.left.length){let t=this.left.splice(e,1/0);m5(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);m5(this.left,t.reverse())}}}function m5(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function m6(e){let t,n,r,i,a,s,o,l={},d=-1,c=new m4(e);for(;++d<c.length;){for(;d in l;)d=l[d];if(t=c.get(d),d&&"chunkFlow"===t[1].type&&"listItemPrefix"===c.get(d-1)[1].type&&((r=0)<(s=t[1]._tokenizer.events).length&&"lineEndingBlank"===s[r][1].type&&(r+=2),r<s.length&&"content"===s[r][1].type))for(;++r<s.length&&"content"!==s[r][1].type;)"chunkText"===s[r][1].type&&(s[r][1]._isInFirstContentOfListItem=!0,r++);if("enter"===t[0])t[1].contentType&&(Object.assign(l,function(e,t){let n,r,i=e.get(t)[1],a=e.get(t)[2],s=t-1,o=[],l=i._tokenizer;!l&&(l=a.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));let d=l.events,c=[],u={},m=-1,p=i,f=0,h=0,g=[0];for(;p;){for(;e.get(++s)[1]!==p;);o.push(s),!p._tokenizer&&(n=a.sliceStream(p),p.next||n.push(null),r&&l.defineSkip(p.start),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(n),p._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),r=p,p=p.next}for(p=i;++m<d.length;)"exit"===d[m][0]&&"enter"===d[m-1][0]&&d[m][1].type===d[m-1][1].type&&d[m][1].start.line!==d[m][1].end.line&&(h=m+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(l.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),m=g.length;m--;){let t=d.slice(g[m],g[m+1]),n=o.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),m=-1;++m<c.length;)u[f+c[m][0]]=f+c[m][1],f+=c[m][1]-c[m][0]-1;return u}(c,d)),d=l[d],o=!0);else if(t[1]._container){for(r=d,n=void 0;r--;)if("lineEnding"===(i=c.get(r))[1].type||"lineEndingBlank"===i[1].type)"enter"===i[0]&&(n&&(c.get(n)[1].type="lineEndingBlank"),i[1].type="lineEnding",n=r);else if("linePrefix"===i[1].type||"listItemIndent"===i[1].type);else break;n&&(t[1].end={...c.get(n)[1].start},(a=c.slice(n,d)).unshift(t),c.splice(n,d-n+1,a))}}return mO(e,0,1/0,c.slice(0)),!o}let m3={resolve:function(e){return m6(e),e},tokenize:function(e,t){let n;return function(t){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(t)};function r(t){return null===t?i(t):mW(t)?e.check(m9,a,i)(t):(e.consume(t),r)}function i(n){return e.exit("chunkContent"),e.exit("content"),t(n)}function a(t){return e.consume(t),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}},m9={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),mX(e,i,"linePrefix")};function i(i){if(null===i||mW(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}},m8={tokenize:function(e){let t=this,n=e.attempt(m2,function(r){return null===r?void e.consume(r):(e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n)},e.attempt(this.parser.constructs.flowInitial,r,mX(e,e.attempt(this.parser.constructs.flow,r,e.attempt(m3,r)),"linePrefix")));return n;function r(r){return null===r?void e.consume(r):(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n)}}},m7={resolveAll:pr()},pe=pn("string"),pt=pn("text");function pn(e){return{resolveAll:pr("text"===e?pi:void 0),tokenize:function(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,s);return a;function a(e){return l(e)?i(e):s(e)}function s(e){return null===e?void t.consume(e):(t.enter("data"),t.consume(e),o)}function o(e){return l(e)?(t.exit("data"),i(e)):(t.consume(e),o)}function l(e){if(null===e)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}}function pr(e){return function(t,n){let r,i=-1;for(;++i<=t.length;)void 0===r?t[i]&&"data"===t[i][1].type&&(r=i,i++):t[i]&&"data"===t[i][1].type||(i!==r+2&&(t[r][1].end=t[i-1][1].end,t.splice(r+2,i-r-2),i=r+2),r=void 0);return e?e(t,n):t}}function pi(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||"lineEnding"===e[n][1].type)&&"data"===e[n-1][1].type){let r,i=e[n-1][1],a=t.sliceStream(i),s=a.length,o=-1,l=0;for(;s--;){let e=a[s];if("string"==typeof e){for(o=e.length;32===e.charCodeAt(o-1);)l++,o--;if(o)break;o=-1}else if(-2===e)r=!0,l++;else if(-1===e);else{s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){let a={type:n===e.length||r||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:i.start._bufferIndex+o,_index:i.start._index+s,line:i.end.line,column:i.end.column-l,offset:i.end.offset-l},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):(e.splice(n,0,["enter",a,t],["exit",a,t]),n+=2)}n++}return e}function pa(e){return null===e||mH(e)||mJ(e)?1:mK(e)?2:void 0}function ps(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}let po={name:"attention",resolveAll:function(e,t){let n,r,i,a,s,o,l,d,c=-1;for(;++c<e.length;)if("enter"===e[c][0]&&"attentionSequence"===e[c][1].type&&e[c][1]._close){for(n=c;n--;)if("exit"===e[n][0]&&"attentionSequence"===e[n][1].type&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[c][1]).charCodeAt(0)){if((e[n][1]._close||e[c][1]._open)&&(e[c][1].end.offset-e[c][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[c][1].end.offset-e[c][1].start.offset)%3))continue;o=e[n][1].end.offset-e[n][1].start.offset>1&&e[c][1].end.offset-e[c][1].start.offset>1?2:1;let u={...e[n][1].end},m={...e[c][1].start};pl(u,-o),pl(m,o),a={type:o>1?"strongSequence":"emphasisSequence",start:u,end:{...e[n][1].end}},s={type:o>1?"strongSequence":"emphasisSequence",start:{...e[c][1].start},end:m},i={type:o>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[c][1].start}},r={type:o>1?"strong":"emphasis",start:{...a.start},end:{...s.end}},e[n][1].end={...a.start},e[c][1].start={...s.end},l=[],e[n][1].end.offset-e[n][1].start.offset&&(l=mM(l,[["enter",e[n][1],t],["exit",e[n][1],t]])),l=mM(l,[["enter",r,t],["enter",a,t],["exit",a,t],["enter",i,t]]),l=mM(l,ps(t.parser.constructs.insideSpan.null,e.slice(n+1,c),t)),l=mM(l,[["exit",i,t],["enter",s,t],["exit",s,t],["exit",r,t]]),e[c][1].end.offset-e[c][1].start.offset?(d=2,l=mM(l,[["enter",e[c][1],t],["exit",e[c][1],t]])):d=0,mO(e,n-1,c-n+3,l),c=n+l.length-d-2;break}}for(c=-1;++c<e.length;)"attentionSequence"===e[c][1].type&&(e[c][1].type="data");return e},tokenize:function(e,t){let n,r=this.parser.constructs.attentionMarkers.null,i=this.previous,a=pa(i);return function(s){return n=s,e.enter("attentionSequence"),function s(o){if(o===n)return e.consume(o),s;let l=e.exit("attentionSequence"),d=pa(o),c=!d||2===d&&a||r.includes(o),u=!a||2===a&&d||r.includes(i);return l._open=!!(42===n?c:c&&(a||!u)),l._close=!!(42===n?u:u&&(d||!c)),t(o)}(s)}}};function pl(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}let pd={continuation:{tokenize:function(e,t,n){let r=this;return function(t){return mG(t)?mX(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):i(t)};function i(r){return e.attempt(pd,t,n)(r)}}},exit:function(e){e.exit("blockQuote")},name:"blockQuote",tokenize:function(e,t,n){let r=this;return function(t){if(62===t){let n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),i}return n(t)};function i(n){return mG(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}}},pc={name:"characterEscape",tokenize:function(e,t,n){return function(t){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(t),e.exit("escapeMarker"),r};function r(r){return mq(r)?(e.enter("characterEscapeValue"),e.consume(r),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(r)}}},pu=document.createElement("i");function pm(e){let t="&"+e+";";pu.innerHTML=t;let n=pu.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&n!==t&&n}let pp={name:"characterReference",tokenize:function(e,t,n){let r,i,a=this,s=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),o};function o(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),r=31,i=mU,d(t))}function l(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),r=6,i=mV,d):(e.enter("characterReferenceValue"),r=7,i=mB,d(t))}function d(o){if(59===o&&s){let r=e.exit("characterReferenceValue");return i!==mU||pm(a.sliceSerialize(r))?(e.enter("characterReferenceMarker"),e.consume(o),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(o)}return i(o)&&s++<r?(e.consume(o),d):n(o)}}},pf={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return null===t?n(t):(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},ph={concrete:!0,name:"codeFenced",tokenize:function(e,t,n){let r,i=this,a={partial:!0,tokenize:function(e,t,n){let a=0;return function(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s};function s(t){return e.enter("codeFencedFence"),mG(t)?mX(e,l,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):l(t)}function l(t){return t===r?(e.enter("codeFencedFenceSequence"),function t(i){return i===r?(a++,e.consume(i),t):a>=o?(e.exit("codeFencedFenceSequence"),mG(i)?mX(e,d,"whitespace")(i):d(i)):n(i)}(t)):n(t)}function d(r){return null===r||mW(r)?(e.exit("codeFencedFence"),t(r)):n(r)}}},s=0,o=0;return function(t){var a;let d;return a=t,s=(d=i.events[i.events.length-1])&&"linePrefix"===d[1].type?d[2].sliceSerialize(d[1],!0).length:0,r=a,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),function t(i){return i===r?(o++,e.consume(i),t):o<3?n(i):(e.exit("codeFencedFenceSequence"),mG(i)?mX(e,l,"whitespace")(i):l(i))}(a)};function l(a){return null===a||mW(a)?(e.exit("codeFencedFence"),i.interrupt?t(a):e.check(pf,c,f)(a)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||mW(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),l(i)):mG(i)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),mX(e,d,"whitespace")(i)):96===i&&i===r?n(i):(e.consume(i),t)}(a))}function d(t){return null===t||mW(t)?l(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),function t(i){return null===i||mW(i)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),l(i)):96===i&&i===r?n(i):(e.consume(i),t)}(t))}function c(t){return e.attempt(a,f,u)(t)}function u(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),m}function m(t){return s>0&&mG(t)?mX(e,p,"linePrefix",s+1)(t):p(t)}function p(t){return null===t||mW(t)?e.check(pf,c,f)(t):(e.enter("codeFlowValue"),function t(n){return null===n||mW(n)?(e.exit("codeFlowValue"),p(n)):(e.consume(n),t)}(t))}function f(n){return e.exit("codeFenced"),t(n)}}},pg={name:"codeIndented",tokenize:function(e,t,n){let r=this;return function(t){return e.enter("codeIndented"),mX(e,i,"linePrefix",5)(t)};function i(t){let i=r.events[r.events.length-1];return i&&"linePrefix"===i[1].type&&i[2].sliceSerialize(i[1],!0).length>=4?function t(n){return null===n?a(n):mW(n)?e.attempt(px,t,a)(n):(e.enter("codeFlowValue"),function n(r){return null===r||mW(r)?(e.exit("codeFlowValue"),t(r)):(e.consume(r),n)}(n))}(t):n(t)}function a(n){return e.exit("codeIndented"),t(n)}}},px={partial:!0,tokenize:function(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):mW(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):mX(e,a,"linePrefix",5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):mW(e)?i(e):n(e)}}};function pv(e,t,n,r,i,a,s,o,l){let d=l||1/0,c=0;return function(t){return 60===t?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),u):null===t||32===t||41===t||mF(t)?n(t):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),f(t))};function u(n){return 62===n?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(n))}function m(t){return 62===t?(e.exit("chunkString"),e.exit(o),u(t)):null===t||60===t||mW(t)?n(t):(e.consume(t),92===t?p:m)}function p(t){return 60===t||62===t||92===t?(e.consume(t),m):m(t)}function f(i){return!c&&(null===i||41===i||mH(i))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(i)):c<d&&40===i?(e.consume(i),c++,f):41===i?(e.consume(i),c--,f):null===i||32===i||40===i||mF(i)?n(i):(e.consume(i),92===i?h:f)}function h(t){return 40===t||41===t||92===t?(e.consume(t),f):f(t)}}function py(e,t,n,r,i,a){let s,o=this,l=0;return function(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),d};function d(u){return l>999||null===u||91===u||93===u&&!s||94===u&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(u):93===u?(e.exit(a),e.enter(i),e.consume(u),e.exit(i),e.exit(r),t):mW(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),c(u))}function c(t){return null===t||91===t||93===t||mW(t)||l++>999?(e.exit("chunkString"),d(t)):(e.consume(t),s||(s=!mG(t)),92===t?u:c)}function u(t){return 91===t||92===t||93===t?(e.consume(t),l++,c):c(t)}}function pb(e,t,n,r,i,a){let s;return function(t){return 34===t||39===t||40===t?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),s=40===t?41:t,o):n(t)};function o(n){return n===s?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===s?(e.exit(a),o(s)):null===t?n(t):mW(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),mX(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(t))}function d(t){return t===s||null===t||mW(t)?(e.exit("chunkString"),l(t)):(e.consume(t),92===t?c:d)}function c(t){return t===s||92===t?(e.consume(t),d):d(t)}}function pk(e,t){let n;return function r(i){return mW(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):mG(i)?mX(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}function pj(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}let pw={partial:!0,tokenize:function(e,t,n){return function(t){return mH(t)?pk(e,r)(t):n(t)};function r(t){return pb(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function i(t){return mG(t)?mX(e,a,"whitespace")(t):a(t)}function a(e){return null===e||mW(e)?t(e):n(e)}}},pN=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],p_=["pre","script","style","textarea"],pS={partial:!0,tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(m2,t,n)}}},p$={partial:!0,tokenize:function(e,t,n){let r=this;return function(t){return mW(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),i):n(t)};function i(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}},pI={name:"labelEnd",resolveAll:function(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),"labelImage"===r.type||"labelLink"===r.type||"labelEnd"===r.type){let e="labelImage"===r.type?4:2;r.type="data",t+=e}}return e.length!==n.length&&mO(e,0,e.length,n),e},resolveTo:function(e,t){let n,r,i,a,s=e.length,o=0;for(;s--;)if(n=e[s][1],r){if("link"===n.type||"labelLink"===n.type&&n._inactive)break;"enter"===e[s][0]&&"labelLink"===n.type&&(n._inactive=!0)}else if(i){if("enter"===e[s][0]&&("labelImage"===n.type||"labelLink"===n.type)&&!n._balanced&&(r=s,"labelLink"!==n.type)){o=2;break}}else"labelEnd"===n.type&&(i=s);let l={type:"labelLink"===e[r][1].type?"link":"image",start:{...e[r][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[r][1].start},end:{...e[i][1].end}},c={type:"labelText",start:{...e[r+o+2][1].end},end:{...e[i-2][1].start}};return a=mM(a=[["enter",l,t],["enter",d,t]],e.slice(r+1,r+o+3)),a=mM(a,[["enter",c,t]]),a=mM(a,ps(t.parser.constructs.insideSpan.null,e.slice(r+o+4,i-3),t)),a=mM(a,[["exit",c,t],e[i-2],e[i-1],["exit",d,t]]),a=mM(a,e.slice(i+1)),a=mM(a,[["exit",l,t]]),mO(e,r,e.length,a),e},tokenize:function(e,t,n){let r,i,a=this,s=a.events.length;for(;s--;)if(("labelImage"===a.events[s][1].type||"labelLink"===a.events[s][1].type)&&!a.events[s][1]._balanced){r=a.events[s][1];break}return function(t){return r?r._inactive?c(t):(i=a.parser.defined.includes(pj(a.sliceSerialize({start:r.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelEnd"),o):n(t)};function o(t){return 40===t?e.attempt(pE,d,i?d:c)(t):91===t?e.attempt(pC,d,i?l:c)(t):i?d(t):c(t)}function l(t){return e.attempt(pA,d,c)(t)}function d(e){return t(e)}function c(e){return r._balanced=!0,n(e)}}},pE={tokenize:function(e,t,n){return function(t){return e.enter("resource"),e.enter("resourceMarker"),e.consume(t),e.exit("resourceMarker"),r};function r(t){return mH(t)?pk(e,i)(t):i(t)}function i(t){return 41===t?d(t):pv(e,a,s,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(t)}function a(t){return mH(t)?pk(e,o)(t):d(t)}function s(e){return n(e)}function o(t){return 34===t||39===t||40===t?pb(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(t):d(t)}function l(t){return mH(t)?pk(e,d)(t):d(t)}function d(r){return 41===r?(e.enter("resourceMarker"),e.consume(r),e.exit("resourceMarker"),e.exit("resource"),t):n(r)}}},pC={tokenize:function(e,t,n){let r=this;return function(t){return py.call(r,e,i,a,"reference","referenceMarker","referenceString")(t)};function i(e){return r.parser.defined.includes(pj(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function a(e){return n(e)}}},pA={tokenize:function(e,t,n){return function(t){return e.enter("reference"),e.enter("referenceMarker"),e.consume(t),e.exit("referenceMarker"),r};function r(r){return 93===r?(e.enter("referenceMarker"),e.consume(r),e.exit("referenceMarker"),e.exit("reference"),t):n(r)}}},pT={name:"labelStartImage",resolveAll:pI.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(t),e.exit("labelImageMarker"),i};function i(t){return 91===t?(e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelImage"),a):n(t)}function a(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},pP={name:"labelStartLink",resolveAll:pI.resolveAll,tokenize:function(e,t,n){let r=this;return function(t){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(t),e.exit("labelMarker"),e.exit("labelLink"),i};function i(e){return 94===e&&"_hiddenFootnoteSupport"in r.parser.constructs?n(e):t(e)}}},pz={name:"lineEnding",tokenize:function(e,t){return function(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),mX(e,t,"linePrefix")}}},pO={name:"thematicBreak",tokenize:function(e,t,n){let r,i=0;return function(a){var s;return e.enter("thematicBreak"),r=s=a,function a(s){return s===r?(e.enter("thematicBreakSequence"),function t(n){return n===r?(e.consume(n),i++,t):(e.exit("thematicBreakSequence"),mG(n)?mX(e,a,"whitespace")(n):a(n))}(s)):i>=3&&(null===s||mW(s))?(e.exit("thematicBreak"),t(s)):n(s)}(s)}}},pM={continuation:{tokenize:function(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(m2,function(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,mX(e,t,"listItemIndent",r.containerState.size+1)(n)},function(n){return r.containerState.furtherBlankLines||!mG(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,i(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(pD,t,i)(n))});function i(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,mX(e,e.attempt(pM,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(i)}}},exit:function(e){e.exit(this.containerState.type)},name:"list",tokenize:function(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&"linePrefix"===i[1].type?i[2].sliceSerialize(i[1],!0).length:0,s=0;return function(t){let i=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===i?!r.containerState.marker||t===r.containerState.marker:mB(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),"listUnordered"===i)return e.enter("listItemPrefix"),42===t||45===t?e.check(pO,n,o)(t):o(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),function t(i){return mB(i)&&++s<10?(e.consume(i),t):(!r.interrupt||s<2)&&(r.containerState.marker?i===r.containerState.marker:41===i||46===i)?(e.exit("listItemValue"),o(i)):n(i)}(t)}return n(t)};function o(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(m2,r.interrupt?n:l,e.attempt(pR,c,d))}function l(e){return r.containerState.initialBlankLine=!0,a++,c(e)}function d(t){return mG(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),c):n(t)}function c(n){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}}},pR={partial:!0,tokenize:function(e,t,n){let r=this;return mX(e,function(e){let i=r.events[r.events.length-1];return!mG(e)&&i&&"listItemPrefixWhitespace"===i[1].type?t(e):n(e)},"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)}},pD={partial:!0,tokenize:function(e,t,n){let r=this;return mX(e,function(e){let i=r.events[r.events.length-1];return i&&"listItemIndent"===i[1].type&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)},"listItemIndent",r.containerState.size+1)}},pL={name:"setextUnderline",resolveTo:function(e,t){let n,r,i,a=e.length;for(;a--;)if("enter"===e[a][0]){if("content"===e[a][1].type){n=a;break}"paragraph"===e[a][1].type&&(r=a)}else"content"===e[a][1].type&&e.splice(a,1),i||"definition"!==e[a][1].type||(i=a);let s={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",s,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end={...e[i][1].end}):e[n][1]=s,e.push(["exit",s,t]),e},tokenize:function(e,t,n){let r,i=this;return function(t){var s;let o,l=i.events.length;for(;l--;)if("lineEnding"!==i.events[l][1].type&&"linePrefix"!==i.events[l][1].type&&"content"!==i.events[l][1].type){o="paragraph"===i.events[l][1].type;break}return!i.parser.lazy[i.now().line]&&(i.interrupt||o)?(e.enter("setextHeadingLine"),r=t,s=t,e.enter("setextHeadingLineSequence"),function t(n){return n===r?(e.consume(n),t):(e.exit("setextHeadingLineSequence"),mG(n)?mX(e,a,"lineSuffix")(n):a(n))}(s)):n(t)};function a(r){return null===r||mW(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}}};e.s(["attentionMarkers",0,{null:[42,95]},"contentInitial",0,{91:{name:"definition",tokenize:function(e,t,n){let r,i=this;return function(t){var r;return e.enter("definition"),r=t,py.call(i,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(r)};function a(t){return(r=pj(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),58===t)?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),s):n(t)}function s(t){return mH(t)?pk(e,o)(t):o(t)}function o(t){return pv(e,l,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function l(t){return e.attempt(pw,d,d)(t)}function d(t){return mG(t)?mX(e,c,"whitespace")(t):c(t)}function c(a){return null===a||mW(a)?(e.exit("definition"),i.parser.defined.push(r),t(a)):n(a)}}}},"disable",0,{null:[]},"document",0,{42:pM,43:pM,45:pM,48:pM,49:pM,50:pM,51:pM,52:pM,53:pM,54:pM,55:pM,56:pM,57:pM,62:pd},"flow",0,{35:{name:"headingAtx",resolve:function(e,t){let n,r,i=e.length-2,a=3;return"whitespace"===e[3][1].type&&(a+=2),i-2>a&&"whitespace"===e[i][1].type&&(i-=2),"atxHeadingSequence"===e[i][1].type&&(a===i-1||i-4>a&&"whitespace"===e[i-2][1].type)&&(i-=a+1===i?2:4),i>a&&(n={type:"atxHeadingText",start:e[a][1].start,end:e[i][1].end},r={type:"chunkText",start:e[a][1].start,end:e[i][1].end,contentType:"text"},mO(e,a,i-a+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]])),e},tokenize:function(e,t,n){let r=0;return function(i){var a;return e.enter("atxHeading"),a=i,e.enter("atxHeadingSequence"),function i(a){return 35===a&&r++<6?(e.consume(a),i):null===a||mH(a)?(e.exit("atxHeadingSequence"),function n(r){return 35===r?(e.enter("atxHeadingSequence"),function t(r){return 35===r?(e.consume(r),t):(e.exit("atxHeadingSequence"),n(r))}(r)):null===r||mW(r)?(e.exit("atxHeading"),t(r)):mG(r)?mX(e,n,"whitespace")(r):(e.enter("atxHeadingText"),function t(r){return null===r||35===r||mH(r)?(e.exit("atxHeadingText"),n(r)):(e.consume(r),t)}(r))}(a)):n(a)}(a)}}},42:pO,45:[pL,pO],60:{concrete:!0,name:"htmlFlow",resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););return t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e},tokenize:function(e,t,n){let r,i,a,s,o,l=this;return function(t){var n;return n=t,e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(n),d};function d(s){return 33===s?(e.consume(s),c):47===s?(e.consume(s),i=!0,p):63===s?(e.consume(s),r=3,l.interrupt?t:T):mL(s)?(e.consume(s),a=String.fromCharCode(s),f):n(s)}function c(i){return 45===i?(e.consume(i),r=2,u):91===i?(e.consume(i),r=5,s=0,m):mL(i)?(e.consume(i),r=4,l.interrupt?t:T):n(i)}function u(r){return 45===r?(e.consume(r),l.interrupt?t:T):n(r)}function m(r){let i="CDATA[";return r===i.charCodeAt(s++)?(e.consume(r),s===i.length)?l.interrupt?t:N:m:n(r)}function p(t){return mL(t)?(e.consume(t),a=String.fromCharCode(t),f):n(t)}function f(s){if(null===s||47===s||62===s||mH(s)){let o=47===s,d=a.toLowerCase();return!o&&!i&&p_.includes(d)?(r=1,l.interrupt?t(s):N(s)):pN.includes(a.toLowerCase())?(r=6,o)?(e.consume(s),h):l.interrupt?t(s):N(s):(r=7,l.interrupt&&!l.parser.lazy[l.now().line]?n(s):i?function t(n){return mG(n)?(e.consume(n),t):j(n)}(s):g(s))}return 45===s||mU(s)?(e.consume(s),a+=String.fromCharCode(s),f):n(s)}function h(r){return 62===r?(e.consume(r),l.interrupt?t:N):n(r)}function g(t){return 47===t?(e.consume(t),j):58===t||95===t||mL(t)?(e.consume(t),x):mG(t)?(e.consume(t),g):j(t)}function x(t){return 45===t||46===t||58===t||95===t||mU(t)?(e.consume(t),x):v(t)}function v(t){return 61===t?(e.consume(t),y):mG(t)?(e.consume(t),v):g(t)}function y(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),o=t,b):mG(t)?(e.consume(t),y):function t(n){return null===n||34===n||39===n||47===n||60===n||61===n||62===n||96===n||mH(n)?v(n):(e.consume(n),t)}(t)}function b(t){return t===o?(e.consume(t),o=null,k):null===t||mW(t)?n(t):(e.consume(t),b)}function k(e){return 47===e||62===e||mG(e)?g(e):n(e)}function j(t){return 62===t?(e.consume(t),w):n(t)}function w(t){return null===t||mW(t)?N(t):mG(t)?(e.consume(t),w):n(t)}function N(t){return 45===t&&2===r?(e.consume(t),I):60===t&&1===r?(e.consume(t),E):62===t&&4===r?(e.consume(t),P):63===t&&3===r?(e.consume(t),T):93===t&&5===r?(e.consume(t),A):mW(t)&&(6===r||7===r)?(e.exit("htmlFlowData"),e.check(pS,z,_)(t)):null===t||mW(t)?(e.exit("htmlFlowData"),_(t)):(e.consume(t),N)}function _(t){return e.check(p$,S,z)(t)}function S(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),$}function $(t){return null===t||mW(t)?_(t):(e.enter("htmlFlowData"),N(t))}function I(t){return 45===t?(e.consume(t),T):N(t)}function E(t){return 47===t?(e.consume(t),a="",C):N(t)}function C(t){if(62===t){let n=a.toLowerCase();return p_.includes(n)?(e.consume(t),P):N(t)}return mL(t)&&a.length<8?(e.consume(t),a+=String.fromCharCode(t),C):N(t)}function A(t){return 93===t?(e.consume(t),T):N(t)}function T(t){return 62===t?(e.consume(t),P):45===t&&2===r?(e.consume(t),T):N(t)}function P(t){return null===t||mW(t)?(e.exit("htmlFlowData"),z(t)):(e.consume(t),P)}function z(n){return e.exit("htmlFlow"),t(n)}}},61:pL,95:pO,96:ph,126:ph},"flowInitial",0,{[-2]:pg,[-1]:pg,32:pg},"insideSpan",0,{null:[po,m7]},"string",0,{38:pp,92:pc},"text",0,{[-5]:pz,[-4]:pz,[-3]:pz,33:pT,38:pp,42:po,60:[{name:"autolink",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(t),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i};function i(t){return mL(t)?(e.consume(t),a):64===t?n(t):o(t)}function a(t){return 43===t||45===t||46===t||mU(t)?(r=1,function t(n){return 58===n?(e.consume(n),r=0,s):(43===n||45===n||46===n||mU(n))&&r++<32?(e.consume(n),t):(r=0,o(n))}(t)):o(t)}function s(r){return 62===r?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(r),e.exit("autolinkMarker"),e.exit("autolink"),t):null===r||32===r||60===r||mF(r)?n(r):(e.consume(r),s)}function o(t){return 64===t?(e.consume(t),l):mZ(t)?(e.consume(t),o):n(t)}function l(i){return mU(i)?function i(a){return 46===a?(e.consume(a),r=0,l):62===a?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(a),e.exit("autolinkMarker"),e.exit("autolink"),t):function t(a){if((45===a||mU(a))&&r++<63){let n=45===a?t:i;return e.consume(a),n}return n(a)}(a)}(i):n(i)}}},{name:"htmlText",tokenize:function(e,t,n){let r,i,a,s=this;return function(t){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(t),o};function o(t){return 33===t?(e.consume(t),l):47===t?(e.consume(t),b):63===t?(e.consume(t),v):mL(t)?(e.consume(t),j):n(t)}function l(t){return 45===t?(e.consume(t),d):91===t?(e.consume(t),i=0,p):mL(t)?(e.consume(t),x):n(t)}function d(t){return 45===t?(e.consume(t),m):n(t)}function c(t){return null===t?n(t):45===t?(e.consume(t),u):mW(t)?(a=c,C(t)):(e.consume(t),c)}function u(t){return 45===t?(e.consume(t),m):c(t)}function m(e){return 62===e?E(e):45===e?u(e):c(e)}function p(t){let r="CDATA[";return t===r.charCodeAt(i++)?(e.consume(t),i===r.length?f:p):n(t)}function f(t){return null===t?n(t):93===t?(e.consume(t),h):mW(t)?(a=f,C(t)):(e.consume(t),f)}function h(t){return 93===t?(e.consume(t),g):f(t)}function g(t){return 62===t?E(t):93===t?(e.consume(t),g):f(t)}function x(t){return null===t||62===t?E(t):mW(t)?(a=x,C(t)):(e.consume(t),x)}function v(t){return null===t?n(t):63===t?(e.consume(t),y):mW(t)?(a=v,C(t)):(e.consume(t),v)}function y(e){return 62===e?E(e):v(e)}function b(t){return mL(t)?(e.consume(t),k):n(t)}function k(t){return 45===t||mU(t)?(e.consume(t),k):function t(n){return mW(n)?(a=t,C(n)):mG(n)?(e.consume(n),t):E(n)}(t)}function j(t){return 45===t||mU(t)?(e.consume(t),j):47===t||62===t||mH(t)?w(t):n(t)}function w(t){return 47===t?(e.consume(t),E):58===t||95===t||mL(t)?(e.consume(t),N):mW(t)?(a=w,C(t)):mG(t)?(e.consume(t),w):E(t)}function N(t){return 45===t||46===t||58===t||95===t||mU(t)?(e.consume(t),N):function t(n){return 61===n?(e.consume(n),_):mW(n)?(a=t,C(n)):mG(n)?(e.consume(n),t):w(n)}(t)}function _(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),r=t,S):mW(t)?(a=_,C(t)):mG(t)?(e.consume(t),_):(e.consume(t),$)}function S(t){return t===r?(e.consume(t),r=void 0,I):null===t?n(t):mW(t)?(a=S,C(t)):(e.consume(t),S)}function $(t){return null===t||34===t||39===t||60===t||61===t||96===t?n(t):47===t||62===t||mH(t)?w(t):(e.consume(t),$)}function I(e){return 47===e||62===e||mH(e)?w(e):n(e)}function E(r){return 62===r?(e.consume(r),e.exit("htmlTextData"),e.exit("htmlText"),t):n(r)}function C(t){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),A}function A(t){return mG(t)?mX(e,T,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):T(t)}function T(t){return e.enter("htmlTextData"),a(t)}}}],91:pP,92:[{name:"hardBreakEscape",tokenize:function(e,t,n){return function(t){return e.enter("hardBreakEscape"),e.consume(t),r};function r(r){return mW(r)?(e.exit("hardBreakEscape"),t(r)):n(r)}}},pc],93:pI,95:po,96:{name:"codeText",previous:function(e){return 96!==e||"characterEscape"===this.events[this.events.length-1][1].type},resolve:function(e){let t,n,r=e.length-4,i=3;if(("lineEnding"===e[3][1].type||"space"===e[i][1].type)&&("lineEnding"===e[r][1].type||"space"===e[r][1].type)){for(t=i;++t<r;)if("codeTextData"===e[t][1].type){e[i][1].type="codeTextPadding",e[r][1].type="codeTextPadding",i+=2,r-=2;break}}for(t=i-1,r++;++t<=r;)void 0===n?t!==r&&"lineEnding"!==e[t][1].type&&(n=t):(t===r||"lineEnding"===e[t][1].type)&&(e[n][1].type="codeTextData",t!==n+2&&(e[n][1].end=e[t-1][1].end,e.splice(n+2,t-n-2),r-=t-n-2,t=n+2),n=void 0);return e},tokenize:function(e,t,n){let r,i,a=0;return function(t){return e.enter("codeText"),e.enter("codeTextSequence"),function t(n){return 96===n?(e.consume(n),a++,t):(e.exit("codeTextSequence"),s(n))}(t)};function s(l){return null===l?n(l):32===l?(e.enter("space"),e.consume(l),e.exit("space"),s):96===l?(i=e.enter("codeTextSequence"),r=0,function n(s){return 96===s?(e.consume(s),r++,n):r===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(s)):(i.type="codeTextData",o(s))}(l)):mW(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):(e.enter("codeTextData"),o(l))}function o(t){return null===t||32===t||96===t||mW(t)?(e.exit("codeTextData"),s(t)):(e.consume(t),o)}}}}],19210);var pU=e.i(19210);let pZ=/[\0\t\n\r]/g;function pF(e,t){let n=Number.parseInt(e,t);return n<9||11===n||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(65535&n)==65535||(65535&n)==65534||n>1114111?"�":String.fromCodePoint(n)}let pB=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function pV(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){let e=n.charCodeAt(1),t=120===e||88===e;return pF(n.slice(t?2:1),t?16:10)}return pm(n)||e}let pq={}.hasOwnProperty;function pW(e){return{line:e.line,column:e.column,offset:e.offset}}function pH(e,t){if(e)throw Error("Cannot close `"+e.type+"` ("+mm({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+mm({start:t.start,end:t.end})+") is open");throw Error("Cannot close document, a token (`"+t.type+"`, "+mm({start:t.start,end:t.end})+") is still open")}function pG(e){let t=this;t.parser=function(n){var r,i;let a,s,o,l;return"object"==typeof(r={...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})&&(i=r,r=void 0),(function(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(x),autolinkProtocol:d,autolinkEmail:d,atxHeading:r(f),blockQuote:r(function(){return{type:"blockquote",children:[]}}),characterEscape:d,characterReference:d,codeFenced:r(p),codeFencedFenceInfo:i,codeFencedFenceMeta:i,codeIndented:r(p,i),codeText:r(function(){return{type:"inlineCode",value:""}},i),codeTextData:d,data:d,codeFlowValue:d,definition:r(function(){return{type:"definition",identifier:"",label:null,title:null,url:""}}),definitionDestinationString:i,definitionLabelString:i,definitionTitleString:i,emphasis:r(function(){return{type:"emphasis",children:[]}}),hardBreakEscape:r(h),hardBreakTrailing:r(h),htmlFlow:r(g,i),htmlFlowData:d,htmlText:r(g,i),htmlTextData:d,image:r(function(){return{type:"image",title:null,url:"",alt:null}}),label:i,link:r(x),listItem:r(function(e){return{type:"listItem",spread:e._spread,checked:null,children:[]}}),listItemValue:function(e){this.data.expectingFirstListItemValue&&(this.stack[this.stack.length-2].start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0)},listOrdered:r(v,function(){this.data.expectingFirstListItemValue=!0}),listUnordered:r(v),paragraph:r(function(){return{type:"paragraph",children:[]}}),reference:function(){this.data.referenceType="collapsed"},referenceString:i,resourceDestinationString:i,resourceTitleString:i,setextHeading:r(f),strong:r(function(){return{type:"strong",children:[]}}),thematicBreak:r(function(){return{type:"thematicBreak"}})},exit:{atxHeading:s(),atxHeadingSequence:function(e){let t=this.stack[this.stack.length-1];t.depth||(t.depth=this.sliceSerialize(e).length)},autolink:s(),autolinkEmail:function(e){c.call(this,e),this.stack[this.stack.length-1].url="mailto:"+this.sliceSerialize(e)},autolinkProtocol:function(e){c.call(this,e),this.stack[this.stack.length-1].url=this.sliceSerialize(e)},blockQuote:s(),characterEscapeValue:c,characterReferenceMarkerHexadecimal:m,characterReferenceMarkerNumeric:m,characterReferenceValue:function(e){let t,n=this.sliceSerialize(e),r=this.data.characterReferenceType;r?(t=pF(n,"characterReferenceMarkerNumeric"===r?10:16),this.data.characterReferenceType=void 0):t=pm(n);let i=this.stack[this.stack.length-1];i.value+=t},characterReference:function(e){this.stack.pop().position.end=pW(e.end)},codeFenced:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}),codeFencedFence:function(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)},codeFencedFenceInfo:function(){let e=this.resume();this.stack[this.stack.length-1].lang=e},codeFencedFenceMeta:function(){let e=this.resume();this.stack[this.stack.length-1].meta=e},codeFlowValue:c,codeIndented:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e.replace(/(\r?\n|\r)$/g,"")}),codeText:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),codeTextData:c,data:c,definition:s(),definitionDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},definitionLabelString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=pj(this.sliceSerialize(e)).toLowerCase()},definitionTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},emphasis:s(),hardBreakEscape:s(u),hardBreakTrailing:s(u),htmlFlow:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlFlowData:c,htmlText:s(function(){let e=this.resume();this.stack[this.stack.length-1].value=e}),htmlTextData:c,image:s(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),label:function(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,"link"===n.type?n.children=e.children:n.alt=t},labelText:function(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=t.replace(pB,pV),n.identifier=pj(t).toLowerCase()},lineEnding:function(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){n.children[n.children.length-1].position.end=pW(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(d.call(this,e),c.call(this,e))},link:s(function(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||"shortcut";e.type+="Reference",e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:function(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=pj(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType="full"},resourceDestinationString:function(){let e=this.resume();this.stack[this.stack.length-1].url=e},resourceTitleString:function(){let e=this.resume();this.stack[this.stack.length-1].title=e},resource:function(){this.data.inReference=void 0},setextHeading:s(function(){this.data.setextHeadingSlurpLineEnding=void 0}),setextHeadingLineSequence:function(e){this.stack[this.stack.length-1].depth=61===this.sliceSerialize(e).codePointAt(0)?1:2},setextHeadingText:function(){this.data.setextHeadingSlurpLineEnding=!0},strong:s(),thematicBreak:s()}};!function e(t,n){let r=-1;for(;++r<n.length;){let i=n[r];Array.isArray(i)?e(t,i):function(e,t){let n;for(n in t)if(pq.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r)}}}(t,i)}}(t,(e||{}).mdastExtensions||[]);let n={};return function(e){let r={type:"root",children:[]},s={stack:[r],tokenStack:[],config:t,enter:a,exit:o,buffer:i,resume:l,data:n},d=[],c=-1;for(;++c<e.length;)("listOrdered"===e[c][1].type||"listUnordered"===e[c][1].type)&&("enter"===e[c][0]?d.push(c):c=function(e,t,n){let r,i,a,s,o=t-1,l=-1,d=!1;for(;++o<=n;){let t=e[o];switch(t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":"enter"===t[0]?l++:l--,s=void 0;break;case"lineEndingBlank":"enter"===t[0]&&(!r||s||l||a||(a=o),s=void 0);break;case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:s=void 0}if(!l&&"enter"===t[0]&&"listItemPrefix"===t[1].type||-1===l&&"exit"===t[0]&&("listUnordered"===t[1].type||"listOrdered"===t[1].type)){if(r){let s=o;for(i=void 0;s--;){let t=e[s];if("lineEnding"===t[1].type||"lineEndingBlank"===t[1].type){if("exit"===t[0])continue;i&&(e[i][1].type="lineEndingBlank",d=!0),t[1].type="lineEnding",i=s}else if("linePrefix"===t[1].type||"blockQuotePrefix"===t[1].type||"blockQuotePrefixWhitespace"===t[1].type||"blockQuoteMarker"===t[1].type||"listItemIndent"===t[1].type);else break}a&&(!i||a<i)&&(r._spread=!0),r.end=Object.assign({},i?e[i][1].start:t[1].end),e.splice(i||o,0,["exit",r,t[2]]),o++,n++}if("listItemPrefix"===t[1].type){let i={type:"listItem",_spread:!1,start:Object.assign({},t[1].start),end:void 0};r=i,e.splice(o,0,["enter",i,t[2]]),o++,n++,a=void 0,s=!0}}}return e[t][1]._spread=d,n}(e,d.pop(),c));for(c=-1;++c<e.length;){let n=t[e[c][0]];pq.call(n,e[c][1].type)&&n[e[c][1].type].call(Object.assign({sliceSerialize:e[c][2].sliceSerialize},s),e[c][1])}if(s.tokenStack.length>0){let e=s.tokenStack[s.tokenStack.length-1];(e[1]||pH).call(s,void 0,e[0])}for(r.position={start:pW(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:pW(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},c=-1;++c<t.transforms.length;)r=t.transforms[c](r)||r;return r};function r(e,t){return function(n){a.call(this,e(n),n),t&&t.call(this,n)}}function i(){this.stack.push({type:"fragment",children:[]})}function a(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:pW(t.start),end:void 0}}function s(e){return function(t){e&&e.call(this,t),o.call(this,t)}}function o(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||pH).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+mm({start:e.start,end:e.end})+"): it’s not open");n.position.end=pW(e.end)}function l(){return mT(this.stack.pop())}function d(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&"text"===n.type||((n={type:"text",value:""}).position={start:pW(e.start),end:void 0},t.push(n)),this.stack.push(n)}function c(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=pW(e.end)}function u(){this.data.atHardBreak=!0}function m(e){this.data.characterReferenceType=e.type}function p(){return{type:"code",lang:null,meta:null,value:""}}function f(){return{type:"heading",depth:0,children:[]}}function h(){return{type:"break"}}function g(){return{type:"html",value:""}}function x(){return{type:"link",title:null,url:"",children:[]}}function v(e){return{type:"list",ordered:"listOrdered"===e.type,start:null,spread:e._spread,children:[]}}})(i)(function(e){for(;!m6(e););return e}((function(e){let t={constructs:mD([pU,...(e||{}).extensions||[]]),content:n(mQ),defined:[],document:n(m0),flow:n(m8),lazy:{},string:n(pe),text:n(pt)};return t;function n(e){return function(n){return function(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],s=[],o=[],l={attempt:f(function(e,t){h(e,t.from)}),check:f(p),consume:function(e){mW(e)?(r.line++,r.column=1,r.offset+=-3===e?2:1,g()):-1!==e&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=e},enter:function(e,t){let n=t||{};return n.type=e,n.start=m(),d.events.push(["enter",n,d]),o.push(n),n},exit:function(e){let t=o.pop();return t.end=m(),d.events.push(["exit",t,d]),t},interrupt:f(p,{interrupt:!0})},d={code:null,containerState:{},defineSkip:function(e){i[e.line]=e.column,g()},events:[],now:m,parser:e,previous:null,sliceSerialize:function(e,t){return function(e,t){let n,r=-1,i=[];for(;++r<e.length;){let a,s=e[r];if("string"==typeof s)a=s;else switch(s){case -5:a="\r";break;case -4:a="\n";break;case -3:a="\r\n";break;case -2:a=t?" ":" ";break;case -1:if(!t&&n)continue;a=" ";break;default:a=String.fromCharCode(s)}n=-2===s,i.push(a)}return i.join("")}(u(e),t)},sliceStream:u,write:function(e){return(s=mM(s,e),function(){let e;for(;r._index<s.length;){let n=s[r._index];if("string"==typeof n)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<n.length;){var t;t=n.charCodeAt(r._bufferIndex),c=c(t)}else c=c(n)}}(),null!==s[s.length-1])?[]:(h(t,0),d.events=ps(a,d.events,d),d.events)}},c=t.tokenize.call(d,l);return t.resolveAll&&a.push(t),d;function u(e){return function(e,t){let n,r=t.start._index,i=t.start._bufferIndex,a=t.end._index,s=t.end._bufferIndex;if(r===a)n=[e[r].slice(i,s)];else{if(n=e.slice(r,a),i>-1){let e=n[0];"string"==typeof e?n[0]=e.slice(i):n.shift()}s>0&&n.push(e[a].slice(0,s))}return n}(s,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function p(e,t){t.restore()}function f(e,t){return function(n,i,a){var s;let c,u,p,f;return Array.isArray(n)?h(n):"tokenize"in n?h([n]):(s=n,function(e){let t=null!==e&&s[e],n=null!==e&&s.null;return h([...Array.isArray(t)?t:t?[t]:[],...Array.isArray(n)?n:n?[n]:[]])(e)});function h(e){return(c=e,u=0,0===e.length)?a:x(e[u])}function x(e){return function(n){let i,a,s,c,u;return(i=m(),a=d.previous,s=d.currentConstruct,c=d.events.length,u=Array.from(o),f={from:c,restore:function(){r=i,d.previous=a,d.currentConstruct=s,d.events.length=c,o=u,g()}},p=e,e.partial||(d.currentConstruct=e),e.name&&d.parser.constructs.disable.null.includes(e.name))?y(n):e.tokenize.call(t?Object.assign(Object.create(d),t):d,l,v,y)(n)}}function v(t){return e(p,f),i}function y(e){return(f.restore(),++u<c.length)?x(c[u]):a}}}function h(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&mO(d.events,t,d.events.length-t,e.resolve(d.events.slice(t),d)),e.resolveTo&&(d.events=e.resolveTo(d.events,d))}function g(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}(t,e,n)}}})(i).document().write((s=1,o="",l=!0,function(e,t,n){let r,i,d,c,u,m=[];for(e=o+("string"==typeof e?e.toString():new TextDecoder(t||void 0).decode(e)),d=0,o="",l&&(65279===e.charCodeAt(0)&&d++,l=void 0);d<e.length;){if(pZ.lastIndex=d,c=(r=pZ.exec(e))&&void 0!==r.index?r.index:e.length,u=e.charCodeAt(c),!r){o=e.slice(d);break}if(10===u&&d===c&&a)m.push(-3),a=void 0;else switch(a&&(m.push(-5),a=void 0),d<c&&(m.push(e.slice(d,c)),s+=c-d),u){case 0:m.push(65533),s++;break;case 9:for(i=4*Math.ceil(s/4),m.push(-2);s++<i;)m.push(-1);break;case 10:m.push(-4),s=1;break;default:a=!0,s=1}d=c+1}return n&&(a&&m.push(-5),o&&m.push(o),m.push(null)),m})(n,r,!0))))}}let pK="object"==typeof self?self:globalThis,pJ=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw TypeError("unable to deserialize "+e)}return new pK[e](t)},pY=e=>{var t;let n,r;return(t=new Map,n=(e,n)=>(t.set(n,e),e),r=i=>{if(t.has(i))return t.get(i);let[a,s]=e[i];switch(a){case 0:case -1:return n(s,i);case 1:{let e=n([],i);for(let t of s)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of s)e[r(t)]=r(n);return e}case 3:return n(new Date(s),i);case 4:{let{source:e,flags:t}=s;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of s)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of s)e.add(r(t));return e}case 7:{let{name:e,message:t}=s;return n(pJ(e,t),i)}case 8:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{let{buffer:e}=new Uint8Array(s);return n(new DataView(e),s)}}return n(pJ(a,s),i)})(0)},{toString:pX}={},{keys:pQ}=Object,p0=e=>{let t=typeof e;if("object"!==t||!e)return[0,t];let n=pX.call(e).slice(8,-1);switch(n){case"Array":return[1,""];case"Object":return[2,""];case"Date":return[3,""];case"RegExp":return[4,""];case"Map":return[5,""];case"Set":return[6,""];case"DataView":return[1,n]}return n.includes("Array")?[1,n]:n.includes("Error")?[7,n]:[2,n]},p1=([e,t])=>0===e&&("function"===t||"symbol"===t),p2=(e,{json:t,lossy:n}={})=>{var r,i,a;let s,o,l=[];return(r=!(t||n),i=!!t,a=new Map,s=(e,t)=>{let n=l.push(e)-1;return a.set(t,n),n},o=e=>{if(a.has(e))return a.get(e);let[t,n]=p0(e);switch(t){case 0:{let i=e;switch(n){case"bigint":t=8,i=e.toString();break;case"function":case"symbol":if(r)throw TypeError("unable to serialize "+n);i=null;break;case"undefined":return s([-1],e)}return s([t,i],e)}case 1:{if(n){let t=e;return"DataView"===n?t=new Uint8Array(e.buffer):"ArrayBuffer"===n&&(t=new Uint8Array(e)),s([n,[...t]],e)}let r=[],i=s([t,r],e);for(let t of e)r.push(o(t));return i}case 2:{if(n)switch(n){case"BigInt":return s([n,e.toString()],e);case"Boolean":case"Number":case"String":return s([n,e.valueOf()],e)}if(i&&"toJSON"in e)return o(e.toJSON());let a=[],l=s([t,a],e);for(let t of pQ(e))(r||!p1(p0(e[t])))&&a.push([o(t),o(e[t])]);return l}case 3:return s([t,e.toISOString()],e);case 4:{let{source:n,flags:r}=e;return s([t,{source:n,flags:r}],e)}case 5:{let n=[],i=s([t,n],e);for(let[t,i]of e)(r||!(p1(p0(t))||p1(p0(i))))&&n.push([o(t),o(i)]);return i}case 6:{let n=[],i=s([t,n],e);for(let t of e)(r||!p1(p0(t)))&&n.push(o(t));return i}}let{message:l}=e;return s([t,{name:n,message:l}],e)})(e),l},p4="function"==typeof structuredClone?(e,t)=>t&&("json"in t||"lossy"in t)?pY(p2(e,t)):structuredClone(e):(e,t)=>pY(p2(e,t));function p5(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),s="";if(37===a&&mU(e.charCodeAt(n+1))&&mU(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(s=String.fromCharCode(a,t),i=1):s="�"}else s=String.fromCharCode(a);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function p6(e,t){let n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function p3(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}let p9=function(e){var t,n;if(null==e)return p7;if("function"==typeof e)return p8(e);if("object"==typeof e){return Array.isArray(e)?function(e){let t=[],n=-1;for(;++n<e.length;)t[n]=p9(e[n]);return p8(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):(t=e,p8(function(e){let n;for(n in t)if(e[n]!==t[n])return!1;return!0}))}if("string"==typeof e){return n=e,p8(function(e){return e&&e.type===n})}throw Error("Expected function, string, or object as test")};function p8(e){return function(t,n,r){return!!(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function p7(){return!0}let fe=[];function ft(e,t,n,r){let i;"function"==typeof t&&"function"!=typeof n?(r=n,n=t):i=t;let a=p9(i),s=r?-1:1;(function e(i,o,l){let d=i&&"object"==typeof i?i:{};if("string"==typeof d.type){let e="string"==typeof d.tagName?d.tagName:"string"==typeof d.name?d.name:void 0;Object.defineProperty(c,"name",{value:"node ("+i.type+(e?"<"+e+">":"")+")"})}return c;function c(){var d;let c,u,m,p=fe;if((!t||a(i,o,l[l.length-1]||void 0))&&!1===(p=Array.isArray(d=n(i,l))?d:"number"==typeof d?[!0,d]:null==d?fe:[d])[0])return p;if("children"in i&&i.children&&i.children&&"skip"!==p[0])for(u=(r?i.children.length:-1)+s,m=l.concat(i);u>-1&&u<i.children.length;){if(!1===(c=e(i.children[u],u,m)())[0])return c;u="number"==typeof c[1]?c[1]:u+s}return p}})(e,void 0,[])()}function fn(e,t,n,r){let i,a,s;"function"==typeof t&&"function"!=typeof n?(a=void 0,s=t,i=n):(a=t,s=n,i=r),ft(e,a,function(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return s(e,r,n)},i)}function fr(e,t){let n=t.referenceType,r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return[{type:"text",value:"!["+t.alt+r}];let i=e.all(t),a=i[0];a&&"text"===a.type?a.value="["+a.value:i.unshift({type:"text",value:"["});let s=i[i.length-1];return s&&"text"===s.type?s.value+=r:i.push({type:"text",value:r}),i}function fi(e){let t=e.spread;return null==t?e.children.length>1:t}function fa(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;9===t||32===t;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;9===t||32===t;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}let fs={blockquote:function(e,t){let n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){let n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){let n=t.value?t.value+"\n":"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a={type:"element",tagName:"pre",properties:{},children:[a=e.applyData(t,a)]},e.patch(t,a),a},delete:function(e,t){let n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){let n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:function(e,t){let n,r="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",i=String(t.identifier).toUpperCase(),a=p5(i.toLowerCase()),s=e.footnoteOrder.indexOf(i),o=e.footnoteCounts.get(i);void 0===o?(o=0,e.footnoteOrder.push(i),n=e.footnoteOrder.length):n=s+1,o+=1,e.footnoteCounts.set(i,o);let l={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+a,id:r+"fnref-"+a+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(n)}]};e.patch(t,l);let d={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,d),e.applyData(t,d)},heading:function(e,t){let n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.options.allowDangerousHtml){let n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}},imageReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return fr(e,t);let i={src:p5(r.url||""),alt:t.alt};null!==r.title&&void 0!==r.title&&(i.title=r.title);let a={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)},image:function(e,t){let n={src:p5(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){let n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);let r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return fr(e,t);let i={href:p5(r.url||"")};null!==r.title&&void 0!==r.title&&(i.title=r.title);let a={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)},link:function(e,t){let n={href:p5(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);let r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){let r=e.all(t),i=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=fi(n[r])}return t}(n):fi(t),a={},s=[];if("boolean"==typeof t.checked){let e,n=r[0];n&&"element"===n.type&&"p"===n.tagName?e=n:(e={type:"element",tagName:"p",properties:{},children:[]},r.unshift(e)),e.children.length>0&&e.children.unshift({type:"text",value:" "}),e.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let o=-1;for(;++o<r.length;){let e=r[o];(i||0!==o||"element"!==e.type||"p"!==e.tagName)&&s.push({type:"text",value:"\n"}),"element"!==e.type||"p"!==e.tagName||i?s.push(e):s.push(...e.children)}let l=r[r.length-1];l&&(i||"element"!==l.type||"p"!==l.tagName)&&s.push({type:"text",value:"\n"});let d={type:"element",tagName:"li",properties:a,children:s};return e.patch(t,d),e.applyData(t,d)},list:function(e,t){let n={},r=e.all(t),i=-1;for("number"==typeof t.start&&1!==t.start&&(n.start=t.start);++i<r.length;){let e=r[i];if("element"===e.type&&"li"===e.tagName&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}let a={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)},paragraph:function(e,t){let n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},root:function(e,t){let n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)},strong:function(e,t){let n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},table:function(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=mc(t.children[1]),s=md(t.children[t.children.length-1]);a&&s&&(r.position={start:a,end:s}),i.push(r)}let a={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)},tableCell:function(e,t){let n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){let r=n?n.children:void 0,i=0===(r?r.indexOf(t):1)?"th":"td",a=n&&"table"===n.type?n.align:void 0,s=a?a.length:t.children.length,o=-1,l=[];for(;++o<s;){let n=t.children[o],r={},s=a?a[o]:void 0;s&&(r.align=s);let d={type:"element",tagName:i,properties:r,children:[]};n&&(d.children=e.all(n),e.patch(n,d),d=e.applyData(n,d)),l.push(d)}let d={type:"element",tagName:"tr",properties:{},children:e.wrap(l,!0)};return e.patch(t,d),e.applyData(t,d)},text:function(e,t){let n={type:"text",value:function(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(fa(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(fa(t.slice(i),i>0,!1)),a.join("")}(String(t.value))};return e.patch(t,n),e.applyData(t,n)},thematicBreak:function(e,t){let n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)},toml:fo,yaml:fo,definition:fo,footnoteDefinition:fo};function fo(){}let fl={}.hasOwnProperty,fd={};function fc(e,t){e.position&&(t.position=function(e){let t=mc(e),n=md(e);if(t&&n)return{start:t,end:n}}(e))}function fu(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;"string"==typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:"children"in n?n.children:[n]}),"element"===n.type&&i&&Object.assign(n.properties,p4(i)),"children"in n&&n.children&&null!=r&&(n.children=r)}return n}function fm(e,t){let n=[],r=-1;for(t&&n.push({type:"text",value:"\n"});++r<e.length;)r&&n.push({type:"text",value:"\n"}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:"\n"}),n}function fp(e){let t=0,n=e.charCodeAt(t);for(;9===n||32===n;)t++,n=e.charCodeAt(t);return e.slice(t)}function ff(e,t){let n,r,i,a,s=(n=t||fd,r=new Map,i=new Map,a={all:function(e){let t=[];if("children"in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&"break"===n[r-1].type&&(Array.isArray(i)||"text"!==i.type||(i.value=fp(i.value)),!Array.isArray(i)&&"element"===i.type)){let e=i.children[0];e&&"text"===e.type&&(e.value=fp(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t},applyData:fu,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...fs,...n.handlers},one:function(e,t){let n=e.type,r=a.handlers[n];if(fl.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if("children"in e){let{children:t,...n}=e,r=p4(n);return r.children=a.all(e),r}return p4(e)}return(a.options.unknownHandler||function(e,t){let n=t.data||{},r="value"in t&&!(fl.call(n,"hProperties")||fl.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)})(a,e,t)},options:n,patch:fc,wrap:fm},fn(e,function(e){if("definition"===e.type||"footnoteDefinition"===e.type){let t="definition"===e.type?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a),o=s.one(e,void 0),l=function(e){let t="string"==typeof e.options.clobberPrefix?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||p6,r=e.options.footnoteBackLabel||p3,i=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[],l=-1;for(;++l<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[l]);if(!i)continue;let a=e.all(i),s=String(i.identifier).toUpperCase(),d=p5(s.toLowerCase()),c=0,u=[],m=e.footnoteCounts.get(s);for(;void 0!==m&&++c<=m;){u.length>0&&u.push({type:"text",value:" "});let e="string"==typeof n?n:n(l,c);"string"==typeof e&&(e={type:"text",value:e}),u.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+d+(c>1?"-"+c:""),dataFootnoteBackref:"",ariaLabel:"string"==typeof r?r:r(l,c),className:["data-footnote-backref"]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&"element"===p.type&&"p"===p.tagName){let e=p.children[p.children.length-1];e&&"text"===e.type?e.value+=" ":p.children.push({type:"text",value:" "}),p.children.push(...u)}else a.push(...u);let f={type:"element",tagName:"li",properties:{id:t+"fn-"+d},children:e.wrap(a,!0)};e.patch(i,f),o.push(f)}if(0!==o.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...p4(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:"\n"}]}}(s),d=Array.isArray(o)?{type:"root",children:o}:o||{type:"root",children:[]};return l&&(uA("children"in d),d.children.push({type:"text",value:"\n"},l)),d}function fh(e,t){return e&&"run"in e?async function(n,r){let i=ff(n,{file:r,...t});await e.run(i,r)}:function(n,r){return ff(n,{file:r,...e||t})}}function fg(e){if(e)throw e}var fx=e.i(75609);function fv(e){if("object"!=typeof e||null===e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}let fy=function(e,t){let n;if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');fw(e);let r=0,i=-1,a=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else i<0&&(n=!0,i=a+1);return i<0?"":e.slice(r,i)}if(t===e)return"";let s=-1,o=t.length-1;for(;a--;)if(47===e.codePointAt(a)){if(n){r=a+1;break}}else s<0&&(n=!0,s=a+1),o>-1&&(e.codePointAt(a)===t.codePointAt(o--)?o<0&&(i=a):(o=-1,i=s));return r===i?i=s:i<0&&(i=e.length),e.slice(r,i)},fb=function(e){let t;if(fw(e),0===e.length)return".";let n=-1,r=e.length;for(;--r;)if(47===e.codePointAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.codePointAt(0)?"/":".":1===n&&47===e.codePointAt(0)?"//":e.slice(0,n)},fk=function(e){let t;fw(e);let n=e.length,r=-1,i=0,a=-1,s=0;for(;n--;){let o=e.codePointAt(n);if(47===o){if(t){i=n+1;break}continue}r<0&&(t=!0,r=n+1),46===o?a<0?a=n:1!==s&&(s=1):a>-1&&(s=-1)}return a<0||r<0||0===s||1===s&&a===r-1&&a===i+1?"":e.slice(a,r)},fj=function(...e){var t;let n,r,i,a=-1;for(;++a<e.length;)fw(e[a]),e[a]&&(i=void 0===i?e[a]:i+"/"+e[a]);return void 0===i?".":(fw(t=i),n=47===t.codePointAt(0),0!==(r=function(e,t){let n,r,i="",a=0,s=-1,o=0,l=-1;for(;++l<=e.length;){if(l<e.length)n=e.codePointAt(l);else if(47===n)break;else n=47;if(47===n){if(s===l-1||1===o);else if(s!==l-1&&2===o){if(i.length<2||2!==a||46!==i.codePointAt(i.length-1)||46!==i.codePointAt(i.length-2)){if(i.length>2){if((r=i.lastIndexOf("/"))!==i.length-1){r<0?(i="",a=0):a=(i=i.slice(0,r)).length-1-i.lastIndexOf("/"),s=l,o=0;continue}}else if(i.length>0){i="",a=0,s=l,o=0;continue}}t&&(i=i.length>0?i+"/..":"..",a=2)}else i.length>0?i+="/"+e.slice(s+1,l):i=e.slice(s+1,l),a=l-s-1;s=l,o=0}else 46===n&&o>-1?o++:o=-1}return i}(t,!n)).length||n||(r="."),r.length>0&&47===t.codePointAt(t.length-1)&&(r+="/"),n?"/"+r:r)};function fw(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function fN(e){return!!(null!==e&&"object"==typeof e&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&void 0===e.auth)}let f_=["history","path","basename","stem","extname","dirname"];class fS{constructor(e){let t,n;t=e?fN(e)?{path:e}:"string"==typeof e||function(e){return!!(e&&"object"==typeof e&&"byteLength"in e&&"byteOffset"in e)}(e)?{value:e}:e:{},this.cwd="cwd"in t?"":"/",this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<f_.length;){const e=f_[r];e in t&&void 0!==t[e]&&null!==t[e]&&(this[e]="history"===e?[...t[e]]:t[e])}for(n in t)f_.includes(n)||(this[n]=t[n])}get basename(){return"string"==typeof this.path?fy(this.path):void 0}set basename(e){fI(e,"basename"),f$(e,"basename"),this.path=fj(this.dirname||"",e)}get dirname(){return"string"==typeof this.path?fb(this.path):void 0}set dirname(e){fE(this.basename,"dirname"),this.path=fj(e||"",this.basename)}get extname(){return"string"==typeof this.path?fk(this.path):void 0}set extname(e){if(f$(e,"extname"),fE(this.dirname,"extname"),e){if(46!==e.codePointAt(0))throw Error("`extname` must start with `.`");if(e.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=fj(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){fN(e)&&(e=function(e){if("string"==typeof e)e=new URL(e);else if(!fN(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){let e=TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){let e=TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}let t=e.pathname,n=-1;for(;++n<t.length;)if(37===t.codePointAt(n)&&50===t.codePointAt(n+1)){let e=t.codePointAt(n+2);if(70===e||102===e){let e=TypeError("File URL path must not include encoded / characters");throw e.code="ERR_INVALID_FILE_URL_PATH",e}}return decodeURIComponent(t)}(e)}(e)),fI(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return"string"==typeof this.path?fy(this.path,this.extname):void 0}set stem(e){fI(e,"stem"),f$(e,"stem"),this.path=fj(this.dirname||"",e+(this.extname||""))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new mg(e,t,n);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return void 0===this.value?"":"string"==typeof this.value?this.value:new TextDecoder(e||void 0).decode(this.value)}}function f$(e,t){if(e&&e.includes("/"))throw Error("`"+t+"` cannot be a path: did not expect `/`")}function fI(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function fE(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}let fC=function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r},fA={}.hasOwnProperty;class fT extends fC{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=function(){let e=[],t={run:function(...t){let n=-1,r=t.pop();if("function"!=typeof r)throw TypeError("Expected function as last argument, not "+r);!function i(a,...s){let o=e[++n],l=-1;if(a)return void r(a);for(;++l<t.length;)(null===s[l]||void 0===s[l])&&(s[l]=t[l]);t=s,o?(function(e,t){let n;return function(...t){let a,s=e.length>t.length;s&&t.push(r);try{a=e.apply(this,t)}catch(e){if(s&&n)throw e;return r(e)}s||(a&&a.then&&"function"==typeof a.then?a.then(i,r):a instanceof Error?r(a):i(a))};function r(e,...i){n||(n=!0,t(e,...i))}function i(e){r(null,e)}})(o,i)(...s):r(null,...s)}(null,...t)},use:function(n){if("function"!=typeof n)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}};return t}()}copy(){let e=new fT,t=-1;for(;++t<this.attachers.length;){let n=this.attachers[t];e.use(...n)}return e.data((0,fx.default)(!0,{},this.namespace)),e}data(e,t){return"string"==typeof e?2==arguments.length?(fM("data",this.frozen),this.namespace[e]=t,this):fA.call(this.namespace,e)&&this.namespace[e]||void 0:e?(fM("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;for(;++this.freezeIndex<this.attachers.length;){let[e,...t]=this.attachers[this.freezeIndex];if(!1===t[0])continue;!0===t[0]&&(t[0]=void 0);let n=e.call(this,...t);"function"==typeof n&&this.transformers.use(n)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=fL(e),n=this.parser||this.Parser;return fz("parse",n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),fz("process",this.parser||this.Parser),fO("process",this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=fL(e),s=n.parse(a);function o(e,n){e||!n?i(e):r?r(n):(uA(t,"`done` is defined if `resolve` is not"),t(void 0,n))}n.run(s,a,function(e,t,r){var i,a;if(e||!t||!r)return o(e);let s=n.stringify(t,r);"string"==typeof(i=s)||(a=i)&&"object"==typeof a&&"byteLength"in a&&"byteOffset"in a?r.value=s:r.result=s,o(e,r)})}}processSync(e){let t,n=!1;return this.freeze(),fz("processSync",this.parser||this.Parser),fO("processSync",this.compiler||this.Compiler),this.process(e,function(e,r){n=!0,fg(e),t=r}),fD("processSync","process",n),uA(t,"we either bailed on an error or have a tree"),t}run(e,t,n){fR(e),this.freeze();let r=this.transformers;return n||"function"!=typeof t||(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){uA("function"!=typeof t,"`file` can’t be a `done` anymore, we checked");let s=fL(t);r.run(e,s,function(t,r,s){let o=r||e;t?a(t):i?i(o):(uA(n,"`done` is defined if `resolve` is not"),n(void 0,o,s))})}}runSync(e,t){let n,r=!1;return this.run(e,t,function(e,t){fg(e),n=t,r=!0}),fD("runSync","run",r),uA(n,"we either bailed on an error or have a tree"),n}stringify(e,t){this.freeze();let n=fL(t),r=this.compiler||this.Compiler;return fO("stringify",r),fR(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(fM("use",this.frozen),null==e);else if("function"==typeof e)s(e,t);else if("object"==typeof e)Array.isArray(e)?a(e):i(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(!("plugins"in e)&&!("settings"in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(e.plugins),e.settings&&(r.settings=(0,fx.default)(!0,r.settings,e.settings))}function a(e){let t=-1;if(null==e);else if(Array.isArray(e))for(;++t<e.length;)!function(e){if("function"==typeof e)s(e,[]);else if("object"==typeof e)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else i(e);else throw TypeError("Expected usable value, not `"+e+"`")}(e[t]);else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(-1===i)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,s=n[i][1];fv(s)&&fv(r)&&(r=(0,fx.default)(!0,s,r)),n[i]=[e,r,...a]}}}}let fP=new fT().freeze();function fz(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `parser`")}function fO(e,t){if("function"!=typeof t)throw TypeError("Cannot `"+e+"` without `compiler`")}function fM(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function fR(e){if(!fv(e)||"string"!=typeof e.type)throw TypeError("Expected node, got `"+e+"`")}function fD(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function fL(e){var t;return(t=e)&&"object"==typeof t&&"message"in t&&"messages"in t?e:new fS(e)}let fU=[],fZ={allowDangerousHtml:!0},fF=/^(https?|ircs?|mailto|xmpp)$/i,fB=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function fV(e){var t;let n,r,i,a,s,o=(n=(t=e).rehypePlugins||fU,r=t.remarkPlugins||fU,i=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...fZ}:fZ,fP().use(pG).use(r).use(fh,i).use(n)),l=(a=e.children||"",s=new fS,"string"==typeof a?s.value=a:uT("Unexpected value `"+a+"` for `children` prop, expected `string`"),s);return function(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,s=t.skipHtml,o=t.unwrapDisallowed,l=t.urlTransform||fq;for(let e of fB)Object.hasOwn(t,e.from)&&uT("Unexpected `"+e.from+"` prop, "+(e.to?"use `"+e.to+"` instead":"remove it")+" (see <https://github.com/remarkjs/react-markdown/blob/main/changelog.md#"+e.id+"> for more info)");return n&&a&&uT("Unexpected combined `allowedElements` and `disallowedElements`, expected one or the other"),fn(e,function(e,t,i){if("raw"===e.type&&i&&"number"==typeof t)return s?i.children.splice(t,1):i.children[t]={type:"text",value:e.value},t;if("element"===e.type){let t;for(t in mC)if(Object.hasOwn(mC,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=mC[t];(null===r||r.includes(e.tagName))&&(e.properties[t]=l(String(n||""),t,e))}}if("element"===e.type){let s=n?!n.includes(e.tagName):!!a&&a.includes(e.tagName);if(!s&&r&&"number"==typeof t&&(s=!r(e,t,i)),s&&i&&"number"==typeof t)return o&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}),function(e,t){var n,r,i,a;let s;if(!t||void 0===t.Fragment)throw TypeError("Expected `Fragment` in options");let o=t.filePath||void 0;if(t.development){if("function"!=typeof t.jsxDEV)throw TypeError("Expected `jsxDEV` in options when `development: true`");n=o,r=t.jsxDEV,s=function(e,t,i,a){let s=Array.isArray(i.children),o=mc(e);return r(t,i,a,s,{columnNumber:o?o.column-1:void 0,fileName:n,lineNumber:o?o.line:void 0},void 0)}}else{if("function"!=typeof t.jsx)throw TypeError("Expected `jsx` in production options");if("function"!=typeof t.jsxs)throw TypeError("Expected `jsxs` in production options");i=t.jsx,a=t.jsxs,s=function(e,t,n,r){let s=Array.isArray(n.children)?a:i;return r?s(t,n,r):s(t,n)}}let l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:s,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:o,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:!1!==t.passKeys,passNode:t.passNode||!1,schema:"svg"===t.space?mo:ms,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:!1!==t.tableCellAlignToStyle},d=mw(l,e,void 0);return d&&"string"!=typeof d?d:l.create(e,l.Fragment,{children:d||void 0},void 0)}(e,{Fragment:eT.Fragment,components:i,ignoreInvalidStyle:!0,jsx:eT.jsx,jsxs:eT.jsxs,passKeys:!0,passNode:!0})}(o.runSync(o.parse(l),l),e)}function fq(e){let t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return -1===t||-1!==i&&t>i||-1!==n&&t>n||-1!==r&&t>r||fF.test(e.slice(0,t))?e:""}function fW(e,t){let n=String(e);if("string"!=typeof t)throw TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}let fH="phrasing",fG=["autolink","link","image","label"];function fK(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function fJ(e){this.config.enter.autolinkProtocol.call(this,e)}function fY(e){this.config.exit.autolinkProtocol.call(this,e)}function fX(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];uA("link"===t.type),t.url="http://"+this.sliceSerialize(e)}function fQ(e){this.config.exit.autolinkEmail.call(this,e)}function f0(e){this.exit(e)}function f1(e){!function(e,t,n){let r=p9((n||{}).ignore||[]),i=function(e){let t=[];if(!Array.isArray(e))throw TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){var i;let e=n[r];t.push(["string"==typeof(i=e[0])?RegExp(function(e){if("string"!=typeof e)throw TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}(i),"g"):i,function(e){return"function"==typeof e?e:function(){return e}}(e[1])])}return t}(t),a=-1;for(;++a<i.length;)ft(e,"text",s);function s(e,t){let n,s=-1;for(;++s<t.length;){let e=t[s],i=n?n.children:void 0;if(r(e,i?i.indexOf(e):void 0,n))return;n=e}if(n)return function(e,t){let n=t[t.length-1],r=i[a][0],s=i[a][1],o=0,l=n.children.indexOf(e),d=!1,c=[];r.lastIndex=0;let u=r.exec(e.value);for(;u;){let n=u.index,i={index:u.index,input:u.input,stack:[...t,e]},a=s(...u,i);if("string"==typeof a&&(a=a.length>0?{type:"text",value:a}:void 0),!1===a?r.lastIndex=n+1:(o!==n&&c.push({type:"text",value:e.value.slice(o,n)}),Array.isArray(a)?c.push(...a):a&&c.push(a),o=n+u[0].length,d=!0),!r.global)break;u=r.exec(e.value)}return d?(o<e.value.length&&c.push({type:"text",value:e.value.slice(o)}),n.children.splice(l,1,...c)):c=[e],l+c.length}(e,t)}}(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,f2],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,f4]],{ignore:["link","linkReference"]})}function f2(e,t,n,r,i){let a,s="";if(!f5(i))return!1;if(/^w/i.test(t)&&(n=t+n,t="",s="http://"),(a=n.split(".")).length<2||a[a.length-1]&&(/_/.test(a[a.length-1])||!/[a-zA-Z\d]/.test(a[a.length-1]))||a[a.length-2]&&(/_/.test(a[a.length-2])||!/[a-zA-Z\d]/.test(a[a.length-2])))return!1;let o=function(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")"),i=fW(e,"("),a=fW(e,")");for(;-1!==r&&i>a;)e+=n.slice(0,r+1),r=(n=n.slice(r+1)).indexOf(")"),a++;return[e,n]}(n+r);if(!o[0])return!1;let l={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[l,{type:"text",value:o[1]}]:l}function f4(e,t,n,r){return!(!f5(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function f5(e,t){let n=e.input.charCodeAt(e.index-1);return(0===e.index||mJ(n)||mK(n))&&(!t||47!==n)}function f6(){this.buffer()}function f3(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function f9(){this.buffer()}function f8(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function f7(e){let t=this.resume(),n=this.stack[this.stack.length-1];uA("footnoteReference"===n.type),n.identifier=pj(this.sliceSerialize(e)).toLowerCase(),n.label=t}function he(e){this.exit(e)}function ht(e){let t=this.resume(),n=this.stack[this.stack.length-1];uA("footnoteDefinition"===n.type),n.identifier=pj(this.sliceSerialize(e)).toLowerCase(),n.label=t}function hn(e){this.exit(e)}function hr(e,t,n,r){let i=n.createTracker(r),a=i.move("[^"),s=n.enter("footnoteReference"),o=n.enter("reference");return a+=i.move(n.safe(n.associationId(e),{after:"]",before:a})),o(),s(),a+=i.move("]")}function hi(e,t,n){return 0===t?e:ha(e,t,n)}function ha(e,t,n){return(n?"":" ")+e}hr.peek=function(){return"["};let hs=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];function ho(e){this.enter({type:"delete",children:[]},e)}function hl(e){this.exit(e)}function hd(e,t,n,r){let i=n.createTracker(r),a=n.enter("strikethrough"),s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),a(),s}function hc(e){return e.length}function hu(e){let t="string"==typeof e?e.codePointAt(0):0;return 67===t||99===t?99:76===t||108===t?108:114*(82===t||114===t)}hd.peek=function(){return"~"};function hm(e,t,n){let r=e.value||"",i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a<n.unsafe.length;){let e,t=n.unsafe[a],i=n.compilePattern(t);if(t.atBreak)for(;e=i.exec(r);){let t=e.index;10===r.charCodeAt(t)&&13===r.charCodeAt(t-1)&&t--,r=r.slice(0,t)+" "+r.slice(e.index+1)}}return i+r+i}hm.peek=function(){return"`"};p9(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);let hp=function(e,t,n,r){let i=function(e){let t=e.options.listItemIndent||"one";if("tab"!==t&&"one"!==t&&"mixed"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}(n),a=n.bulletCurrent||function(e){let t=e.options.bullet||"*";if("*"!==t&&"+"!==t&&"-"!==t)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}(n);t&&"list"===t.type&&t.ordered&&(a=("number"==typeof t.start&&t.start>-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+a);let s=a.length+1;("tab"===i||"mixed"===i&&(t&&"list"===t.type&&t.spread||e.spread))&&(s=4*Math.ceil(s/4));let o=n.createTracker(r);o.move(a+" ".repeat(s-a.length)),o.shift(s);let l=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,o.current()),function(e,t,n){return t?(n?"":" ".repeat(s))+e:(n?a:a+" ".repeat(s-a.length))+e});return l(),d};function hf(e){let t=e._align;uA(t,"expected `_align` on table"),this.enter({type:"table",align:t.map(function(e){return"none"===e?null:e}),children:[]},e),this.data.inTable=!0}function hh(e){this.exit(e),this.data.inTable=void 0}function hg(e){this.enter({type:"tableRow",children:[]},e)}function hx(e){this.exit(e)}function hv(e){this.enter({type:"tableCell",children:[]},e)}function hy(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,hb));let n=this.stack[this.stack.length-1];uA("inlineCode"===n.type),n.value=t,this.exit(e)}function hb(e,t){return"|"===t?t:e}function hk(e){let t=this.stack[this.stack.length-2];uA("listItem"===t.type),t.checked="taskListCheckValueChecked"===e.type}function hj(e){let t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"==typeof t.checked){let e=this.stack[this.stack.length-1];uA("paragraph"===e.type);let n=e.children[0];if(n&&"text"===n.type){let r,i=t.children,a=-1;for(;++a<i.length;){let e=i[a];if("paragraph"===e.type){r=e;break}}r===e&&(n.value=n.value.slice(1),0===n.value.length?e.children.shift():e.position&&n.position&&"number"==typeof n.position.start.offset&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function hw(e,t,n,r){let i=e.children[0],a="boolean"==typeof e.checked&&i&&"paragraph"===i.type,s="["+(e.checked?"x":" ")+"] ",o=n.createTracker(r);a&&o.move(s);let l=hp(e,t,n,{...r,...o.current()});return a&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,function(e){return e+s})),l}let hN={tokenize:function(e,t,n){let r=0;return function t(a){return(87===a||119===a)&&r<3?(r++,e.consume(a),t):46===a&&3===r?(e.consume(a),i):n(a)};function i(e){return null===e?n(e):t(e)}},partial:!0},h_={tokenize:function(e,t,n){let r,i,a;return s;function s(t){return 46===t||95===t?e.check(h$,l,o)(t):null===t||mH(t)||mJ(t)||45!==t&&mK(t)?l(t):(a=!0,e.consume(t),s)}function o(t){return 95===t?r=!0:(i=r,r=void 0),e.consume(t),s}function l(e){return i||r||!a?n(e):t(e)}},partial:!0},hS={tokenize:function(e,t){let n=0,r=0;return i;function i(s){return 40===s?(n++,e.consume(s),i):41===s&&r<n?a(s):33===s||34===s||38===s||39===s||41===s||42===s||44===s||46===s||58===s||59===s||60===s||63===s||93===s||95===s||126===s?e.check(h$,t,a)(s):null===s||mH(s)||mJ(s)?t(s):(e.consume(s),i)}function a(t){return 41===t&&r++,e.consume(t),i}},partial:!0},h$={tokenize:function(e,t,n){return r;function r(s){return 33===s||34===s||39===s||41===s||42===s||44===s||46===s||58===s||59===s||63===s||95===s||126===s?(e.consume(s),r):38===s?(e.consume(s),a):93===s?(e.consume(s),i):60===s||null===s||mH(s)||mJ(s)?t(s):n(s)}function i(e){return null===e||40===e||91===e||mH(e)||mJ(e)?t(e):r(e)}function a(t){return mL(t)?function t(i){return 59===i?(e.consume(i),r):mL(i)?(e.consume(i),t):n(i)}(t):n(t)}},partial:!0},hI={tokenize:function(e,t,n){return function(t){return e.consume(t),r};function r(e){return mU(e)?n(e):t(e)}},partial:!0},hE={name:"wwwAutolink",tokenize:function(e,t,n){let r=this;return function(t){return 87!==t&&119!==t||!hz.call(r,r.previous)||hD(r.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(hN,e.attempt(h_,e.attempt(hS,i),n),n)(t))};function i(n){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(n)}},previous:hz},hC={name:"protocolAutolink",tokenize:function(e,t,n){let r=this,i="",a=!1;return function(t){return(72===t||104===t)&&hO.call(r,r.previous)&&!hD(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(t),e.consume(t),s):n(t)};function s(t){if(mL(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(58===t){let n=i.toLowerCase();if("http"===n||"https"===n)return e.consume(t),o}return n(t)}function o(t){return 47===t?(e.consume(t),a)?l:(a=!0,o):n(t)}function l(t){return null===t||mF(t)||mH(t)||mJ(t)||mK(t)?n(t):e.attempt(h_,e.attempt(hS,d),n)(t)}function d(n){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(n)}},previous:hO},hA={name:"emailAutolink",tokenize:function(e,t,n){let r,i,a=this;return function(t){return!hR(t)||!hM.call(a,a.previous)||hD(a.events)?n(t):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),function t(r){return hR(r)?(e.consume(r),t):64===r?(e.consume(r),s):n(r)}(t))};function s(t){return 46===t?e.check(hI,l,o)(t):45===t||95===t||mU(t)?(i=!0,e.consume(t),s):l(t)}function o(t){return e.consume(t),r=!0,s}function l(s){return i&&r&&mL(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(s)):n(s)}},previous:hM},hT={},hP=48;for(;hP<123;)hT[hP]=hA,58==++hP?hP=65:91===hP&&(hP=97);function hz(e){return null===e||40===e||42===e||95===e||91===e||93===e||126===e||mH(e)}function hO(e){return!mL(e)}function hM(e){return!(47===e||hR(e))}function hR(e){return 43===e||45===e||46===e||95===e||mU(e)}function hD(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if(("labelLink"===r.type||"labelImage"===r.type)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}hT[43]=hA,hT[45]=hA,hT[46]=hA,hT[95]=hA,hT[72]=[hA,hC],hT[104]=[hA,hC],hT[87]=[hA,hE],hT[119]=[hA,hE];let hL={tokenize:function(e,t,n){let r=this;return mX(e,function(e){let i=r.events[r.events.length-1];return i&&"gfmFootnoteDefinitionIndent"===i[1].type&&4===i[2].sliceSerialize(i[1],!0).length?t(e):n(e)},"gfmFootnoteDefinitionIndent",5)},partial:!0};function hU(e,t,n){let r,i=this,a=i.events.length,s=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);for(;a--;){let e=i.events[a][1];if("labelImage"===e.type){r=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(a){if(!r||!r._balanced)return n(a);let o=pj(i.sliceSerialize({start:r.end,end:i.now()}));return 94===o.codePointAt(0)&&s.includes(o.slice(1))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(a),e.exit("gfmFootnoteCallLabelMarker"),t(a)):n(a)}}function hZ(e,t){let n=e.length;for(;n--;)if("labelImage"===e[n][1].type&&"enter"===e[n][0]){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",a,t],["enter",s,t],["exit",s,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function hF(e,t,n){let r,i=this,a=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]),s=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),o};function o(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(o){if(s>999||93===o&&!r||null===o||91===o||mH(o))return n(o);if(93===o){e.exit("chunkString");let r=e.exit("gfmFootnoteCallString");return a.includes(pj(i.sliceSerialize(r)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(o)}return mH(o)||(r=!0),s++,e.consume(o),92===o?d:l}function d(t){return 91===t||92===t||93===t?(e.consume(t),s++,l):l(t)}}function hB(e,t,n){let r,i,a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]),o=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),l};function l(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(t)}function d(t){if(o>999||93===t&&!i||null===t||91===t||mH(t))return n(t);if(93===t){e.exit("chunkString");let n=e.exit("gfmFootnoteDefinitionLabelString");return r=pj(a.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),u}return mH(t)||(i=!0),o++,e.consume(t),92===t?c:d}function c(t){return 91===t||92===t||93===t?(e.consume(t),o++,d):d(t)}function u(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),s.includes(r)||s.push(r),mX(e,m,"gfmFootnoteDefinitionWhitespace")):n(t)}function m(e){return t(e)}}function hV(e,t,n){return e.check(m2,t,e.attempt(hL,t,n))}function hq(e){e.exit("gfmFootnoteDefinition")}class hW{constructor(){this.map=[]}add(e,t,n){!function(e,t,n,r){let i=0;if(0!==n||0!==r.length){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),0===this.map.length)return;let t=this.map.length,n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}}function hH(e,t,n){let r,i=this,a=0,s=0;return function(e){let t=i.events.length-1;for(;t>-1;){let e=i.events[t][1].type;if("lineEnding"===e||"linePrefix"===e)t--;else break}let r=t>-1?i.events[t][1].type:null,a="tableHead"===r||"tableRow"===r?v:o;return a===v&&i.parser.lazy[i.now().line]?n(e):a(e)};function o(t){var n;return e.enter("tableHead"),e.enter("tableRow"),124===(n=t)||(r=!0,s+=1),l(n)}function l(t){return null===t?n(t):mW(t)?s>1?(s=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),u):n(t):mG(t)?mX(e,l,"whitespace")(t):(s+=1,r&&(r=!1,a+=1),124===t)?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),r=!0,l):(e.enter("data"),d(t))}function d(t){return null===t||124===t||mH(t)?(e.exit("data"),l(t)):(e.consume(t),92===t?c:d)}function c(t){return 92===t||124===t?(e.consume(t),d):d(t)}function u(t){return(i.interrupt=!1,i.parser.lazy[i.now().line])?n(t):(e.enter("tableDelimiterRow"),r=!1,mG(t))?mX(e,m,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):m(t)}function m(t){return 45===t||58===t?f(t):124===t?(r=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),p):n(t)}function p(t){return mG(t)?mX(e,f,"whitespace")(t):f(t)}function f(t){return 58===t?(s+=1,r=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),h):45===t?(s+=1,h(t)):null===t||mW(t)?x(t):n(t)}function h(t){return 45===t?(e.enter("tableDelimiterFiller"),function t(n){return 45===n?(e.consume(n),t):58===n?(r=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(n),e.exit("tableDelimiterMarker"),g):(e.exit("tableDelimiterFiller"),g(n))}(t)):n(t)}function g(t){return mG(t)?mX(e,x,"whitespace")(t):x(t)}function x(i){if(124===i)return m(i);if(null===i||mW(i))return r&&a===s?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(i)):n(i);return n(i)}function v(t){return e.enter("tableRow"),y(t)}function y(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),y):null===n||mW(n)?(e.exit("tableRow"),t(n)):mG(n)?mX(e,y,"whitespace")(n):(e.enter("data"),b(n))}function b(t){return null===t||124===t||mH(t)?(e.exit("data"),y(t)):(e.consume(t),92===t?k:b)}function k(t){return 92===t||124===t?(e.consume(t),b):b(t)}}function hG(e,t){let n,r,i,a=-1,s=!0,o=0,l=[0,0,0,0],d=[0,0,0,0],c=!1,u=0,m=new hW;for(;++a<e.length;){let p=e[a],f=p[1];"enter"===p[0]?"tableHead"===f.type?(c=!1,0!==u&&(hJ(m,t,u,n,r),r=void 0,u=0),n={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},m.add(a,0,[["enter",n,t]])):"tableRow"===f.type||"tableDelimiterRow"===f.type?(s=!0,i=void 0,l=[0,0,0,0],d=[0,a+1,0,0],c&&(c=!1,r={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},m.add(a,0,[["enter",r,t]])),o="tableDelimiterRow"===f.type?2:r?3:1):o&&("data"===f.type||"tableDelimiterMarker"===f.type||"tableDelimiterFiller"===f.type)?(s=!1,0===d[2]&&(0!==l[1]&&(d[0]=d[1],i=hK(m,t,l,o,void 0,i),l=[0,0,0,0]),d[2]=a)):"tableCellDivider"===f.type&&(s?s=!1:(0!==l[1]&&(d[0]=d[1],i=hK(m,t,l,o,void 0,i)),d=[(l=d)[1],a,0,0])):"tableHead"===f.type?(c=!0,u=a):"tableRow"===f.type||"tableDelimiterRow"===f.type?(u=a,0!==l[1]?(d[0]=d[1],i=hK(m,t,l,o,a,i)):0!==d[1]&&(i=hK(m,t,d,o,a,i)),o=0):o&&("data"===f.type||"tableDelimiterMarker"===f.type||"tableDelimiterFiller"===f.type)&&(d[3]=a)}for(0!==u&&hJ(m,t,u,n,r),m.consume(t.events),a=-1;++a<t.events.length;){let e=t.events[a];"enter"===e[0]&&"table"===e[1].type&&(e[1]._align=function(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if("enter"===i[0])"tableContent"===i[1].type&&r.push("tableDelimiterMarker"===e[t+1][1].type?"left":"none");else if("tableContent"===i[1].type){if("tableDelimiterMarker"===e[t-1][1].type){let e=r.length-1;r[e]="left"===r[e]?"center":"right"}}else if("tableDelimiterRow"===i[1].type)break}else"enter"===i[0]&&"tableDelimiterRow"===i[1].type&&(n=!0);t+=1}return r}(t.events,a))}return e}function hK(e,t,n,r,i,a){0!==n[0]&&(a.end=Object.assign({},hY(t.events,n[0])),e.add(n[0],0,[["exit",a,t]]));let s=hY(t.events,n[1]);if(a={type:1===r?"tableHeader":2===r?"tableDelimiter":"tableData",start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[["enter",a,t]]),0!==n[2]){let i=hY(t.events,n[2]),a=hY(t.events,n[3]),s={type:"tableContent",start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[["enter",s,t]]),2!==r){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type="chunkText",r[1].contentType="text",n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",s,t]])}return void 0!==i&&(a.end=Object.assign({},hY(t.events,i)),e.add(i,0,[["exit",a,t]]),a=void 0),a}function hJ(e,t,n,r,i){let a=[],s=hY(t.events,n);i&&(i.end=Object.assign({},s),a.push(["exit",i,t])),r.end=Object.assign({},s),a.push(["exit",r,t]),e.add(n+1,0,a)}function hY(e,t){let n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}let hX={name:"tasklistCheck",tokenize:function(e,t,n){let r=this;return function(t){return null===r.previous&&r._gfmTasklistFirstContentOfListItem?(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),i):n(t)};function i(t){return mH(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),a):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),a):n(t)}function a(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),s):n(t)}function s(r){return mW(r)?t(r):mG(r)?e.check({tokenize:hQ},t,n)(r):n(r)}}};function hQ(e,t,n){return mX(e,function(e){return null===e?n(e):t(e)},"whitespace")}let h0={};function h1(e){let t,n,r,i=e||h0,a=this.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),l=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(mD([{text:hT},{document:{91:{name:"gfmFootnoteDefinition",tokenize:hB,continuation:{tokenize:hV},exit:hq}},text:{91:{name:"gfmFootnoteCall",tokenize:hF},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:hU,resolveTo:hZ}}},(t=(i||{}).singleTilde,n={name:"strikethrough",tokenize:function(e,n,r){let i=this.previous,a=this.events,s=0;return function(o){return 126===i&&"characterEscape"!==a[a.length-1][1].type?r(o):(e.enter("strikethroughSequenceTemporary"),function a(o){let l=pa(i);if(126===o)return s>1?r(o):(e.consume(o),s++,a);if(s<2&&!t)return r(o);let d=e.exit("strikethroughSequenceTemporary"),c=pa(o);return d._open=!c||2===c&&!!l,d._close=!l||2===l&&!!c,n(o)}(o))}},resolveAll:function(e,t){let n=-1;for(;++n<e.length;)if("enter"===e[n][0]&&"strikethroughSequenceTemporary"===e[n][1].type&&e[n][1]._close){let r=n;for(;r--;)if("exit"===e[r][0]&&"strikethroughSequenceTemporary"===e[r][1].type&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset==e[r][1].end.offset-e[r][1].start.offset){e[n][1].type="strikethroughSequence",e[r][1].type="strikethroughSequence";let i={type:"strikethrough",start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:"strikethroughText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},s=[["enter",i,t],["enter",e[r][1],t],["exit",e[r][1],t],["enter",a,t]],o=t.parser.constructs.insideSpan.null;o&&mO(s,s.length,0,ps(o,e.slice(r+1,n),t)),mO(s,s.length,0,[["exit",a,t],["enter",e[n][1],t],["exit",e[n][1],t],["exit",i,t]]),mO(e,r-1,n-r+3,s),n=r+s.length-2;break}}for(n=-1;++n<e.length;)"strikethroughSequenceTemporary"===e[n][1].type&&(e[n][1].type="data");return e}},null==t&&(t=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}}),{flow:{null:{name:"table",tokenize:hH,resolveAll:hG}}},{text:{91:hX}}])),o.push([{transforms:[f1],enter:{literalAutolink:fK,literalAutolinkEmail:fJ,literalAutolinkHttp:fJ,literalAutolinkWww:fJ},exit:{literalAutolink:f0,literalAutolinkEmail:fQ,literalAutolinkHttp:fY,literalAutolinkWww:fX}},{enter:{gfmFootnoteCallString:f6,gfmFootnoteCall:f3,gfmFootnoteDefinitionLabelString:f9,gfmFootnoteDefinition:f8},exit:{gfmFootnoteCallString:f7,gfmFootnoteCall:he,gfmFootnoteDefinitionLabelString:ht,gfmFootnoteDefinition:hn}},{canContainEols:["delete"],enter:{strikethrough:ho},exit:{strikethrough:hl}},{enter:{table:hf,tableData:hv,tableHeader:hv,tableRow:hg},exit:{codeText:hy,table:hh,tableData:hx,tableHeader:hx,tableRow:hx}},{exit:{taskListCheckValueChecked:hk,taskListCheckValueUnchecked:hk,paragraph:hj}}]),l.push({extensions:[{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:fH,notInConstruct:fG},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:fH,notInConstruct:fG},{character:":",before:"[ps]",after:"\\/",inConstruct:fH,notInConstruct:fG}]},(r=!1,i&&i.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:function(e,t,n,i){let a=n.createTracker(i),s=a.move("[^"),o=n.enter("footnoteDefinition"),l=n.enter("label");return s+=a.move(n.safe(n.associationId(e),{before:s,after:"]"})),l(),s+=a.move("]:"),e.children&&e.children.length>0&&(a.shift(4),s+=a.move((r?"\n":" ")+n.indentLines(n.containerFlow(e,a.current()),r?ha:hi))),o(),s},footnoteReference:hr},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]}),{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:hs}],handlers:{delete:hd}},function(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:function(e,t,n){let r=hm(e,t,n);return n.stack.includes("tableCell")&&(r=r.replace(/\|/g,"\\$&")),r},table:function(e,t,n,r){return o(function(e,t,n){let r=e.children,i=-1,a=[],s=t.enter("table");for(;++i<r.length;)a[i]=l(r[i],t,n);return s(),a}(e,n,r),e.align)},tableCell:s,tableRow:function(e,t,n,r){let i=o([l(e,n,r)]);return i.slice(0,i.indexOf("\n"))}}};function s(e,t,n,r){let i=n.enter("tableCell"),s=n.enter("phrasing"),o=n.containerPhrasing(e,{...r,before:a,after:a});return s(),i(),o}function o(e,t){return function(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||hc,a=[],s=[],o=[],l=[],d=0,c=-1;for(;++c<e.length;){let t=[],r=[],a=-1;for(e[c].length>d&&(d=e[c].length);++a<e[c].length;){var u;let s=null==(u=e[c][a])?"":String(u);if(!1!==n.alignDelimiters){let e=i(s);r[a]=e,(void 0===l[a]||e>l[a])&&(l[a]=e)}t.push(s)}s[c]=t,o[c]=r}let m=-1;if("object"==typeof r&&"length"in r)for(;++m<d;)a[m]=hu(r[m]);else{let e=hu(r);for(;++m<d;)a[m]=e}m=-1;let p=[],f=[];for(;++m<d;){let e=a[m],t="",r="";99===e?(t=":",r=":"):108===e?t=":":114===e&&(r=":");let i=!1===n.alignDelimiters?1:Math.max(1,l[m]-t.length-r.length),s=t+"-".repeat(i)+r;!1!==n.alignDelimiters&&((i=t.length+i+r.length)>l[m]&&(l[m]=i),f[m]=i),p[m]=s}s.splice(1,0,p),o.splice(1,0,f),c=-1;let h=[];for(;++c<s.length;){let e=s[c],t=o[c];m=-1;let r=[];for(;++m<d;){let i=e[m]||"",s="",o="";if(!1!==n.alignDelimiters){let e=l[m]-(t[m]||0),n=a[m];114===n?s=" ".repeat(e):99===n?e%2?(s=" ".repeat(e/2+.5),o=" ".repeat(e/2-.5)):o=s=" ".repeat(e/2):o=" ".repeat(e)}!1===n.delimiterStart||m||r.push("|"),!1!==n.padding&&(!1!==n.alignDelimiters||""!==i)&&(!1!==n.delimiterStart||m)&&r.push(" "),!1!==n.alignDelimiters&&r.push(s),r.push(i),!1!==n.alignDelimiters&&r.push(o),!1!==n.padding&&r.push(" "),(!1!==n.delimiterEnd||m!==d-1)&&r.push("|")}h.push(!1===n.delimiterEnd?r.join("").replace(/ +$/,""):r.join(""))}return h.join("\n")}(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function l(e,t,n){let r=e.children,i=-1,a=[],o=t.enter("tableRow");for(;++i<r.length;)a[i]=s(r[i],e,t,n);return o(),a}}(i),{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:hw}}]})}function h2({className:e,children:t}){let[n,r]=(0,eP.useState)(!1),i=/language-(\w+)/.exec(e??"")?.[1],a=String(t).replace(/\n$/,"");return(0,eT.jsxs)("div",{className:"group relative my-3 overflow-hidden rounded-sm border border-border bg-background/70",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between border-b border-border bg-card/60 px-3 py-1.5",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase tracking-wider text-muted-foreground",children:i??"code"}),(0,eT.jsxs)("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(a).then(()=>{r(!0),window.setTimeout(()=>r(!1),1400)})},className:"inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground transition-colors hover:text-foreground",children:[n?(0,eT.jsx)(iq,{className:"size-3"}):(0,eT.jsx)(oC,{className:"size-3"}),n?"copied":"copy"]})]}),(0,eT.jsx)("pre",{className:"overflow-x-auto px-3 py-2.5 font-mono text-xs leading-relaxed text-foreground/90",children:(0,eT.jsx)("code",{children:a})})]})}let h4=(0,eP.memo)(function({children:e}){return(0,eT.jsx)("div",{className:"text-sm leading-relaxed text-foreground",children:(0,eT.jsx)(fV,{remarkPlugins:[h1],components:{p:({children:e})=>(0,eT.jsx)("p",{className:"mb-3 last:mb-0 text-pretty",children:e}),h1:({children:e})=>(0,eT.jsx)("h1",{className:"mb-2 mt-4 text-base font-semibold first:mt-0",children:e}),h2:({children:e})=>(0,eT.jsx)("h2",{className:"mb-2 mt-4 text-sm font-semibold first:mt-0",children:e}),h3:({children:e})=>(0,eT.jsx)("h3",{className:"mb-1.5 mt-3 text-sm font-semibold first:mt-0",children:e}),ul:({children:e})=>(0,eT.jsx)("ul",{className:"mb-3 ml-4 list-disc space-y-1 last:mb-0",children:e}),ol:({children:e})=>(0,eT.jsx)("ol",{className:"mb-3 ml-4 list-decimal space-y-1 last:mb-0",children:e}),li:({children:e})=>(0,eT.jsx)("li",{className:"text-pretty",children:e}),a:({href:e,children:t})=>(0,eT.jsx)("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-foreground underline decoration-border underline-offset-2 transition-colors hover:decoration-foreground",children:t}),strong:({children:e})=>(0,eT.jsx)("strong",{className:"font-semibold text-foreground",children:e}),blockquote:({children:e})=>(0,eT.jsx)("blockquote",{className:"my-3 border-l-2 border-border pl-3 text-muted-foreground",children:e}),hr:()=>(0,eT.jsx)("hr",{className:"my-4 border-border"}),table:({children:e})=>(0,eT.jsx)("div",{className:"my-3 overflow-x-auto rounded-sm border border-border",children:(0,eT.jsx)("table",{className:"w-full border-collapse text-xs",children:e})}),th:({children:e})=>(0,eT.jsx)("th",{className:"border-b border-border bg-card px-2.5 py-1.5 text-left font-mono text-[11px] font-semibold",children:e}),td:({children:e})=>(0,eT.jsx)("td",{className:"border-b border-border px-2.5 py-1.5",children:e}),code:({className:e,children:t,...n})=>e?(0,eT.jsx)(h2,{className:e,children:t}):(0,eT.jsx)("code",{className:(0,ny.cn)("rounded-sm border border-border bg-background/70 px-1 py-0.5 font-mono text-[0.85em] text-foreground"),...n,children:t}),pre:({children:e})=>(0,eT.jsx)(eT.Fragment,{children:e})},children:e})})}),h5=e=>fetch(e).then(e=>e.json()),h6=[{id:"dashboard",label:"Dashboard",icon:cD},{id:"notes",label:"Release notes",icon:eZ},{id:"contributors",label:"Contributors",icon:uI},{id:"reactions",label:"Reactions",icon:uE},{id:"cadence",label:"Cadence",icon:u$},{id:"compare",label:"Compare",icon:uS}],h3=[{key:"plusOne",emoji:"👍",label:"+1"},{key:"minusOne",emoji:"👎",label:"-1"},{key:"laugh",emoji:"😄",label:"Laugh"},{key:"hooray",emoji:"🎉",label:"Hooray"},{key:"heart",emoji:"❤️",label:"Heart"},{key:"rocket",emoji:"🚀",label:"Rocket"},{key:"eyes",emoji:"👀",label:"Eyes"},{key:"confused",emoji:"😕",label:"Confused"}];function h9(e){return e.toLocaleString()}function h8(e){return e?new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):"—"}function h7(e,t){return Math.abs(new Date(e).getTime()-new Date(t).getTime())/864e5}function ge({icon:e,label:t,value:n,sub:r}){return(0,eT.jsxs)(s8,{className:"flex flex-row items-center gap-3 p-4",children:[(0,eT.jsx)("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-sm border border-border text-muted-foreground",children:(0,eT.jsx)(e,{className:"size-5"})}),(0,eT.jsxs)("div",{className:"min-w-0",children:[(0,eT.jsx)("p",{className:"font-mono text-[10px] uppercase tracking-wide text-muted-foreground",children:t}),(0,eT.jsx)("p",{className:"truncate text-lg font-semibold tabular-nums text-foreground",children:n}),r&&(0,eT.jsx)("p",{className:"truncate font-mono text-[10px] text-muted-foreground",children:r})]})]})}function gt({release:e}){return(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.prerelease&&(0,eT.jsx)(nS,{className:"border-0 bg-[color:var(--sev-medium)]/15 font-mono text-[10px] text-[color:var(--sev-medium)]",children:"pre-release"}),e.draft&&(0,eT.jsx)(nS,{className:"border-0 bg-secondary font-mono text-[10px] text-muted-foreground",children:"draft"})]})}function gn({releases:e}){let t=(0,eP.useMemo)(()=>{let t=e.filter(e=>e.publishedAt),n=e.reduce((e,t)=>e+t.totalDownloads,0),r=e.reduce((e,t)=>e+(t.reactions?.total??0),0),i=t.map(e=>e.publishedAt).sort((e,t)=>new Date(t).getTime()-new Date(e).getTime()),a=[];for(let e=0;e<i.length-1;e++)a.push(h7(i[e],i[e+1]));return{total:e.length,prereleases:e.filter(e=>e.prerelease).length,totalDownloads:n,totalReactions:r,latest:t[0]??e[0],medianGap:Math.round(function(e){if(0===e.length)return 0;let t=[...e].sort((e,t)=>e-t),n=Math.floor(t.length/2);return t.length%2?t[n]:(t[n-1]+t[n])/2}(a))}},[e]),n=(0,eP.useMemo)(()=>[...e].sort((e,t)=>t.totalDownloads-e.totalDownloads).slice(0,5),[e]);return(0,eT.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,eT.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[(0,eT.jsx)(ge,{icon:cM,label:"Releases",value:h9(t.total),sub:`${t.prereleases} pre-release`}),(0,eT.jsx)(ge,{icon:st,label:"Downloads",value:h9(t.totalDownloads),sub:"across all assets"}),(0,eT.jsx)(ge,{icon:uE,label:"Reactions",value:h9(t.totalReactions),sub:"community feedback"}),(0,eT.jsx)(ge,{icon:u$,label:"Median cadence",value:t.medianGap?`${t.medianGap}d`:"—",sub:"between releases"})]}),t.latest&&(0,eT.jsx)(oS,{title:"Latest release",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(cD,{className:"size-4 text-[color:var(--sev-ok)]"}),(0,eT.jsx)("span",{className:"font-semibold text-foreground",children:t.latest.name}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:t.latest.tag}),(0,eT.jsx)(gt,{release:t.latest})]}),(0,eT.jsxs)("a",{href:t.latest.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 font-mono text-[11px] text-muted-foreground hover:text-foreground",children:[(0,eT.jsx)(oE,{className:"size-3"})," GitHub"]})]}),(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-4 font-mono text-[11px] text-muted-foreground",children:[(0,eT.jsx)("span",{children:h8(t.latest.publishedAt)}),t.latest.author&&(0,eT.jsxs)("span",{children:["by ",t.latest.author.login]}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(st,{className:"size-3"})," ",h9(t.latest.totalDownloads)]})]})]})}),(0,eT.jsx)(oS,{title:"Most downloaded",children:n.every(e=>0===e.totalDownloads)?(0,eT.jsx)("p",{className:"text-xs text-muted-foreground",children:"No downloadable assets attached to releases."}):(0,eT.jsx)("div",{className:"flex flex-col gap-2.5",children:n.map(e=>{let t=n[0].totalDownloads||1,r=e.totalDownloads/t*100;return(0,eT.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between font-mono text-[11px]",children:[(0,eT.jsx)("span",{className:"truncate text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"tabular-nums text-muted-foreground",children:h9(e.totalDownloads)})]}),(0,eT.jsx)("div",{className:"h-1.5 overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("div",{className:"h-full rounded-full bg-primary",style:{width:`${Math.max(r,2)}%`}})})]},e.id)})})})]})}function gr({releases:e}){let[t,n]=(0,eP.useState)(e[0]?.id??null),r=e.find(e=>e.id===t)??e[0];return r?(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[220px_1fr]",children:[(0,eT.jsx)("div",{className:"flex max-h-[60vh] flex-col gap-1 overflow-auto rounded-sm border border-border bg-card p-2",children:e.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.id),className:(0,ny.cn)("flex flex-col gap-0.5 rounded-sm px-2.5 py-2 text-left transition-colors",e.id===r.id?"bg-secondary":"hover:bg-secondary/50"),children:[(0,eT.jsx)("span",{className:"truncate font-mono text-xs font-medium text-foreground",children:e.tag}),(0,eT.jsx)("span",{className:"truncate text-[10px] text-muted-foreground",children:h8(e.publishedAt)})]},e.id))}),(0,eT.jsxs)(s8,{className:"min-w-0 p-5",children:[(0,eT.jsxs)("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-2 border-b border-border pb-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("h3",{className:"text-base font-semibold text-foreground",children:r.name}),(0,eT.jsx)(gt,{release:r})]}),(0,eT.jsxs)("a",{href:r.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 font-mono text-[11px] text-muted-foreground hover:text-foreground",children:[(0,eT.jsx)(oE,{className:"size-3"})," View on GitHub"]})]}),r.assets.length>0&&(0,eT.jsx)("div",{className:"mb-4 flex flex-col gap-1.5",children:r.assets.map(e=>{var t;return(0,eT.jsxs)("div",{className:"flex items-center gap-2 rounded-sm border border-border px-2.5 py-1.5 font-mono text-[11px]",children:[(0,eT.jsx)(eq,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,eT.jsx)("span",{className:"min-w-0 flex-1 truncate text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"shrink-0 text-muted-foreground",children:(t=e.size)<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:t<0x40000000?`${(t/1048576).toFixed(1)} MB`:`${(t/0x40000000).toFixed(2)} GB`}),(0,eT.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1 text-muted-foreground",children:[(0,eT.jsx)(st,{className:"size-3"}),h9(e.downloadCount)]})]},e.name)})}),r.body.trim()?(0,eT.jsx)(h4,{children:r.body}):(0,eT.jsx)("p",{className:"text-sm text-muted-foreground",children:"No release notes provided."})]})]}):null}function gi({releases:e}){let t=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e){if(!n.author)continue;let e=t.get(n.author.login)??{login:n.author.login,avatarUrl:n.author.avatarUrl,htmlUrl:n.author.htmlUrl,releases:0,downloads:0};e.releases+=1,e.downloads+=n.totalDownloads,t.set(n.author.login,e)}return[...t.values()].sort((e,t)=>t.releases-e.releases)},[e]);if(0===t.length)return(0,eT.jsx)("p",{className:"text-sm text-muted-foreground",children:"No release authors found."});let n=t[0].releases;return(0,eT.jsx)("div",{className:"flex flex-col gap-2.5",children:t.map((e,t)=>(0,eT.jsxs)(s8,{className:"flex flex-row items-center gap-3 p-3",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("flex size-7 shrink-0 items-center justify-center rounded-full font-mono text-xs font-semibold",0===t?"bg-[color:var(--sev-medium)]/20 text-[color:var(--sev-medium)]":"bg-secondary text-muted-foreground"),children:t+1}),(0,eT.jsx)("img",{src:e.avatarUrl||"/placeholder.svg",alt:"",className:"size-9 shrink-0 rounded-full"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:"truncate font-medium text-foreground hover:underline",children:e.login}),(0,eT.jsx)("div",{className:"mt-1 h-1.5 w-full overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("div",{className:"h-full rounded-full bg-primary",style:{width:`${e.releases/n*100}%`}})})]}),(0,eT.jsxs)("div",{className:"shrink-0 text-right font-mono text-[11px] text-muted-foreground",children:[(0,eT.jsxs)("p",{className:"text-foreground",children:[e.releases," releases"]}),(0,eT.jsxs)("p",{children:[h9(e.downloads)," downloads"]})]})]},e.login))})}function ga({releases:e}){let{totals:t,ranked:n}=(0,eP.useMemo)(()=>{let t={total:0,plusOne:0,minusOne:0,laugh:0,hooray:0,confused:0,heart:0,rocket:0,eyes:0};for(let n of e)if(n.reactions)for(let e of Object.keys(t))t[e]+=n.reactions[e];return{totals:t,ranked:e.filter(e=>(e.reactions?.total??0)>0).sort((e,t)=>(t.reactions?.total??0)-(e.reactions?.total??0)).slice(0,8)}},[e]);if(0===t.total)return(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(uE,{className:"size-5 text-muted-foreground"}),"No reactions on releases yet."]});let r=Math.max(...h3.map(e=>t[e.key]));return(0,eT.jsxs)("div",{className:"flex flex-col gap-5",children:[(0,eT.jsx)(oS,{title:`Community reactions (${h9(t.total)})`,children:(0,eT.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:h3.map(e=>(0,eT.jsxs)("div",{className:"flex items-center gap-3",children:[(0,eT.jsx)("span",{className:"w-6 text-center text-base","aria-hidden":!0,children:e.emoji}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between font-mono text-[11px]",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:e.label}),(0,eT.jsx)("span",{className:"tabular-nums text-foreground",children:h9(t[e.key])})]}),(0,eT.jsx)("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("div",{className:"h-full rounded-full bg-primary",style:{width:`${r?t[e.key]/r*100:0}%`}})})]})]},e.key))})}),n.length>0&&(0,eT.jsx)(oS,{title:"Most-loved releases",children:(0,eT.jsx)("div",{className:"flex flex-col divide-y divide-border",children:n.map(e=>(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-3 py-2.5 first:pt-0 last:pb-0",children:[(0,eT.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:e.tag}),(0,eT.jsx)("div",{className:"flex shrink-0 items-center gap-2 font-mono text-[11px] text-muted-foreground",children:h3.filter(t=>(e.reactions?.[t.key]??0)>0).map(t=>(0,eT.jsxs)("span",{className:"inline-flex items-center gap-0.5",children:[(0,eT.jsx)("span",{"aria-hidden":!0,children:t.emoji}),e.reactions?.[t.key]]},t.key))})]},e.id))})})]})}function gs({releases:e}){let{years:t,months:n,grid:r,max:i}=(0,eP.useMemo)(()=>{let t=new Map,n=1/0,r=-1/0;for(let i of e){if(!i.publishedAt)continue;let e=new Date(i.publishedAt),a=e.getFullYear(),s=e.getMonth();t.set(`${a}-${s}`,(t.get(`${a}-${s}`)??0)+1),n=Math.min(n,a),r=Math.max(r,a)}let i=[];if(Number.isFinite(n))for(let e=r;e>=n;e--)i.push(e);let a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],s=Math.max(1,...t.values()),o=i.map(e=>({year:e,cells:a.map((n,r)=>t.get(`${e}-${r}`)??0)}));return{years:i,months:a,grid:o,max:s}},[e]);return 0===t.length?(0,eT.jsx)("p",{className:"text-sm text-muted-foreground",children:"No published releases to chart."}):(0,eT.jsx)(oS,{title:"Release cadence",children:(0,eT.jsx)("div",{className:"overflow-x-auto",children:(0,eT.jsxs)("div",{className:"min-w-[520px]",children:[(0,eT.jsxs)("div",{className:"mb-1 grid grid-cols-[40px_repeat(12,1fr)] gap-1",children:[(0,eT.jsx)("span",{}),n.map(e=>(0,eT.jsx)("span",{className:"text-center font-mono text-[10px] text-muted-foreground",children:e},e))]}),r.map(e=>(0,eT.jsxs)("div",{className:"mb-1 grid grid-cols-[40px_repeat(12,1fr)] items-center gap-1",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground",children:e.year}),e.cells.map((t,r)=>(0,eT.jsx)("div",{title:`${n[r]} ${e.year}: ${t} release${1===t?"":"s"}`,className:(0,ny.cn)("aspect-square rounded-sm",function(e){if(0===e)return"bg-secondary";let t=e/i;return t>.66?"bg-primary":t>.33?"bg-primary/60":"bg-primary/30"}(t))},r))]},e.year)),(0,eT.jsxs)("div",{className:"mt-3 flex items-center justify-end gap-1.5 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)("span",{children:"less"}),(0,eT.jsx)("div",{className:"size-3 rounded-sm bg-secondary"}),(0,eT.jsx)("div",{className:"size-3 rounded-sm bg-primary/30"}),(0,eT.jsx)("div",{className:"size-3 rounded-sm bg-primary/60"}),(0,eT.jsx)("div",{className:"size-3 rounded-sm bg-primary"}),(0,eT.jsx)("span",{children:"more"})]})]})})})}function go({releases:e}){let[t,n]=(0,eP.useState)(e[1]?.id??e[0]?.id??null),[r,i]=(0,eP.useState)(e[0]?.id??null),a=e.find(e=>e.id===t),s=e.find(e=>e.id===r);function o({value:t,onChange:n}){return(0,eT.jsx)("select",{value:t??"",onChange:e=>n(Number(e.target.value)),className:"w-full rounded-sm border border-border bg-background px-2 py-1.5 font-mono text-xs text-foreground outline-none focus:border-foreground/30",children:e.map(e=>(0,eT.jsxs)("option",{value:e.id,children:[e.tag," — ",h8(e.publishedAt)]},e.id))})}function l({release:e}){return e?(0,eT.jsxs)(s8,{className:"flex min-w-0 flex-col gap-3 p-4",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-2 border-b border-border pb-2",children:[(0,eT.jsx)("span",{className:"truncate font-semibold text-foreground",children:e.name}),(0,eT.jsx)(gt,{release:e})]}),(0,eT.jsxs)("dl",{className:"grid grid-cols-2 gap-2 font-mono text-[11px]",children:[(0,eT.jsx)("dt",{className:"text-muted-foreground",children:"Published"}),(0,eT.jsx)("dd",{className:"text-right text-foreground",children:h8(e.publishedAt)}),(0,eT.jsx)("dt",{className:"text-muted-foreground",children:"Author"}),(0,eT.jsx)("dd",{className:"truncate text-right text-foreground",children:e.author?.login??"—"}),(0,eT.jsx)("dt",{className:"text-muted-foreground",children:"Downloads"}),(0,eT.jsx)("dd",{className:"text-right tabular-nums text-foreground",children:h9(e.totalDownloads)}),(0,eT.jsx)("dt",{className:"text-muted-foreground",children:"Assets"}),(0,eT.jsx)("dd",{className:"text-right tabular-nums text-foreground",children:e.assets.length}),(0,eT.jsx)("dt",{className:"text-muted-foreground",children:"Reactions"}),(0,eT.jsx)("dd",{className:"text-right tabular-nums text-foreground",children:h9(e.reactions?.total??0)})]}),(0,eT.jsx)("div",{className:"max-h-72 overflow-auto border-t border-border pt-3",children:e.body.trim()?(0,eT.jsx)(h4,{children:e.body}):(0,eT.jsx)("p",{className:"text-xs text-muted-foreground",children:"No notes."})})]}):(0,eT.jsx)(s8,{className:"p-5 text-sm text-muted-foreground",children:"Select a release."})}let d=(0,eP.useMemo)(()=>a&&s?{days:Math.round(h7(a.publishedAt??a.createdAt,s.publishedAt??s.createdAt)),downloads:s.totalDownloads-a.totalDownloads,reactions:(s.reactions?.total??0)-(a.reactions?.total??0)}:null,[a,s]);return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"grid items-center gap-3 sm:grid-cols-[1fr_auto_1fr]",children:[(0,eT.jsx)(o,{value:t,onChange:n}),(0,eT.jsx)(uC,{className:"mx-auto size-4 rotate-90 text-muted-foreground sm:rotate-0"}),(0,eT.jsx)(o,{value:r,onChange:i})]}),d&&(0,eT.jsxs)(s8,{className:"grid grid-cols-3 divide-x divide-border p-0",children:[(0,eT.jsxs)("div",{className:"flex flex-col items-center gap-0.5 p-3",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:"Time apart"}),(0,eT.jsxs)("span",{className:"font-semibold tabular-nums text-foreground",children:[d.days,"d"]})]}),(0,eT.jsxs)("div",{className:"flex flex-col items-center gap-0.5 p-3",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:"Δ downloads"}),(0,eT.jsxs)("span",{className:"font-semibold tabular-nums text-foreground",children:[d.downloads>0?"+":"",h9(d.downloads)]})]}),(0,eT.jsxs)("div",{className:"flex flex-col items-center gap-0.5 p-3",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:"Δ reactions"}),(0,eT.jsxs)("span",{className:"font-semibold tabular-nums text-foreground",children:[d.reactions>0?"+":"",h9(d.reactions)]})]})]}),(0,eT.jsxs)("div",{className:"grid gap-3 lg:grid-cols-2",children:[(0,eT.jsx)(l,{release:a}),(0,eT.jsx)(l,{release:s})]})]})}function gl({owner:e,repo:t}){let[n,r]=(0,eP.useState)("dashboard"),[i,a]=(0,eP.useState)(""),[s,o]=(0,eP.useState)("all"),{data:l,isLoading:d,error:c}=u_(e&&t?`/api/github/releases?owner=${encodeURIComponent(e)}&repo=${encodeURIComponent(t)}`:null,h5,{revalidateOnFocus:!1}),u=(0,eP.useMemo)(()=>l?.releases??[],[l]),m=(0,eP.useMemo)(()=>{let e=i.trim().toLowerCase();return u.filter(t=>("stable"!==s||!t.prerelease)&&("prerelease"!==s||!!t.prerelease)&&(!e||t.name.toLowerCase().includes(e)||t.tag.toLowerCase().includes(e)||t.body.toLowerCase().includes(e)||(t.author?.login.toLowerCase().includes(e)??!1)))},[u,i,s]);return d?(0,eT.jsxs)("div",{className:"flex items-center justify-center gap-2 py-16 font-mono text-sm text-muted-foreground",children:[(0,eT.jsx)(dj,{className:"size-4 animate-spin"}),"Loading releases from GitHub…"]}):c||l?.error?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(dw,{className:"size-5 text-[color:var(--sev-medium)]"}),l?.error??"Could not load releases from GitHub."]}):0===u.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(cM,{className:"size-5 text-muted-foreground"}),"This repository has no published releases."]}):(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1.5",children:h6.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>r(e.id),className:(0,ny.cn)("inline-flex items-center gap-1.5 rounded-sm border px-2.5 py-1.5 font-mono text-xs transition-colors",n===e.id?"border-foreground/30 bg-foreground/[0.06] text-foreground":"border-border text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)(e.icon,{className:"size-3.5"}),e.label]},e.id))}),(0,eT.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[(0,eT.jsxs)("div",{className:"relative flex-1",children:[(0,eT.jsx)(eX,{className:"absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),(0,eT.jsx)("input",{value:i,onChange:e=>a(e.target.value),placeholder:"Search tag, title, notes, author…",className:"w-full rounded-sm border border-border bg-background py-2 pl-9 pr-8 font-mono text-xs text-foreground outline-none placeholder:text-muted-foreground focus:border-foreground/30"}),i&&(0,eT.jsx)("button",{type:"button",onClick:()=>a(""),"aria-label":"Clear search",className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:(0,eT.jsx)(sz,{className:"size-3.5"})})]}),(0,eT.jsx)("div",{className:"flex items-center gap-1.5",children:["all","stable","prerelease"].map(e=>(0,eT.jsx)("button",{type:"button",onClick:()=>o(e),className:(0,ny.cn)("rounded-sm border px-2.5 py-1.5 font-mono text-[11px] capitalize transition-colors",s===e?"border-foreground/30 bg-foreground/[0.06] text-foreground":"border-border text-muted-foreground hover:text-foreground"),children:e},e))})]}),(0,eT.jsxs)("p",{className:"font-mono text-[11px] text-muted-foreground",children:[m.length," of ",u.length," releases"]}),0===m.length?(0,eT.jsx)(s8,{className:"p-6 text-center text-sm text-muted-foreground",children:"No releases match your search."}):(0,eT.jsxs)(eT.Fragment,{children:["dashboard"===n&&(0,eT.jsx)(gn,{releases:m}),"notes"===n&&(0,eT.jsx)(gr,{releases:m}),"contributors"===n&&(0,eT.jsx)(gi,{releases:m}),"reactions"===n&&(0,eT.jsx)(ga,{releases:m}),"cadence"===n&&(0,eT.jsx)(gs,{releases:m}),"compare"===n&&(0,eT.jsx)(go,{releases:m})]})]})}let gd=eL("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]),gc=eL("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]),gu=eL("scale",[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"m19 8 3 8a5 5 0 0 1-6 0zV7",key:"zcdpyk"}],["path",{d:"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1",key:"1yorad"}],["path",{d:"m5 8 3 8a5 5 0 0 1-6 0zV7",key:"eua70x"}],["path",{d:"M7 21h10",key:"1b0cd5"}]]);function gm(e){return(0,eT.jsx)("svg",{viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",...e,children:(0,eT.jsx)("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})})}let gp=e=>fetch(e).then(e=>e.json()),gf=["var(--primary)","var(--sev-ok)","var(--sev-medium)","var(--sev-info)","var(--sev-high)","var(--muted-foreground)"];function gh(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function gg({source:e,detected:t,onChange:n}){let[r,i]=(0,eP.useState)(!1),[a,s]=(0,eP.useState)(e?.owner??""),[o,l]=(0,eP.useState)(e?.repo??"");function d(){let e=a.trim(),t=o.trim().replace(/\.git$/,"");e&&t&&(n({owner:e,repo:t}),i(!1))}return r||!e?(0,eT.jsxs)(s8,{className:"flex flex-col gap-2 p-3 sm:flex-row sm:items-center",children:[(0,eT.jsx)(gm,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"flex flex-1 items-center gap-1.5 font-mono text-xs",children:[(0,eT.jsx)("input",{value:a,onChange:e=>s(e.target.value),placeholder:"owner",className:"min-w-0 flex-1 rounded-sm border border-border bg-background px-2 py-1.5 text-foreground outline-none focus:border-foreground/30"}),(0,eT.jsx)("span",{className:"text-muted-foreground",children:"/"}),(0,eT.jsx)("input",{value:o,onChange:e=>l(e.target.value),placeholder:"repo",onKeyDown:e=>"Enter"===e.key&&d(),className:"min-w-0 flex-1 rounded-sm border border-border bg-background px-2 py-1.5 text-foreground outline-none focus:border-foreground/30"})]}),(0,eT.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,eT.jsxs)("button",{type:"button",onClick:d,className:"inline-flex items-center gap-1 rounded-sm bg-primary px-2.5 py-1.5 font-mono text-xs text-primary-foreground hover:bg-primary/90",children:[(0,eT.jsx)(iq,{className:"size-3.5"})," Load"]}),e&&(0,eT.jsx)("button",{type:"button",onClick:()=>i(!1),"aria-label":"Cancel",className:"inline-flex items-center rounded-sm border border-border px-2 py-1.5 text-muted-foreground hover:text-foreground",children:(0,eT.jsx)(sz,{className:"size-3.5"})}),t&&(t.owner!==a||t.repo!==o)&&(0,eT.jsx)("button",{type:"button",onClick:()=>{s(t.owner),l(t.repo),n(t),i(!1)},className:"font-mono text-[11px] text-muted-foreground underline hover:text-foreground",children:"reset to detected"})]})]}):(0,eT.jsxs)(s8,{className:"flex items-center justify-between gap-2 p-3",children:[(0,eT.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,eT.jsx)(gm,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("span",{className:"truncate font-mono text-sm text-foreground",children:[e.owner,"/",e.repo]}),t&&t.owner===e.owner&&t.repo===e.repo&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:"detected"})]}),(0,eT.jsxs)("button",{type:"button",onClick:()=>i(!0),className:"inline-flex shrink-0 items-center gap-1 font-mono text-[11px] text-muted-foreground hover:text-foreground",children:[(0,eT.jsx)(l5,{className:"size-3"})," Change"]})]})}function gx({icon:e,label:t,value:n}){return(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(e,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0",children:[(0,eT.jsx)("span",{className:"font-mono text-sm tabular-nums text-foreground",children:n}),(0,eT.jsx)("span",{className:"ml-1 font-mono text-[10px] text-muted-foreground",children:t})]})]})}function gv({source:e}){let{data:t,isLoading:n,error:r}=u_(`/api/github/repo?owner=${encodeURIComponent(e.owner)}&repo=${encodeURIComponent(e.repo)}`,gp,{revalidateOnFocus:!1});if(n)return(0,eT.jsx)(oS,{title:"GitHub",children:(0,eT.jsxs)("div",{className:"flex items-center gap-2 py-3 font-mono text-xs text-muted-foreground",children:[(0,eT.jsx)(dj,{className:"size-4 animate-spin"})," Loading repository…"]})});if(r||t?.error||!t?.overview)return(0,eT.jsx)(oS,{title:"GitHub",children:(0,eT.jsxs)("div",{className:"flex items-start gap-2 py-1 font-mono text-xs text-muted-foreground",children:[(0,eT.jsx)(dw,{className:"mt-0.5 size-3.5 shrink-0 text-[color:var(--sev-medium)]"}),t?.error??"Could not reach the GitHub API."]})});let i=t.overview,a=i.languages.reduce((e,t)=>e+t.bytes,0)||1;return(0,eT.jsx)(oS,{title:"GitHub",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-3",children:[i.description&&(0,eT.jsx)("p",{className:"text-pretty text-xs leading-relaxed text-foreground",children:i.description}),(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-2.5",children:[(0,eT.jsx)(gx,{icon:gd,label:"stars",value:gh(i.stars)}),(0,eT.jsx)(gx,{icon:cO,label:"forks",value:gh(i.forks)}),(0,eT.jsx)(gx,{icon:cv,label:"watchers",value:gh(i.subscribers)}),(0,eT.jsx)(gx,{icon:gc,label:"open issues",value:gh(i.openIssues)})]}),i.license&&(0,eT.jsxs)("div",{className:"flex items-center gap-2 border-t border-border pt-3",children:[(0,eT.jsx)(gu,{className:"size-3.5 text-muted-foreground"}),(0,eT.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:i.license})]}),i.languages.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5 border-t border-border pt-3",children:[(0,eT.jsx)("div",{className:"flex h-2 overflow-hidden rounded-full",children:i.languages.slice(0,6).map((e,t)=>(0,eT.jsx)("div",{title:`${e.name} ${(e.bytes/a*100).toFixed(1)}%`,style:{width:`${e.bytes/a*100}%`,background:gf[t%gf.length]}},e.name))}),(0,eT.jsx)("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:i.languages.slice(0,4).map((e,t)=>(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)("span",{className:"size-2 rounded-full",style:{background:gf[t%gf.length]},"aria-hidden":!0}),e.name]},e.name))})]}),i.contributors.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2 border-t border-border pt-3",children:[(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:"Top contributors"}),(0,eT.jsx)("div",{className:"flex flex-wrap gap-1.5",children:i.contributors.slice(0,8).map(e=>(0,eT.jsx)("a",{href:e.htmlUrl,target:"_blank",rel:"noopener noreferrer",title:`${e.login} \xb7 ${e.contributions} commits`,children:(0,eT.jsx)("img",{src:e.avatarUrl||"/placeholder.svg",alt:e.login,className:"size-7 rounded-full ring-1 ring-border transition-transform hover:scale-110"})},e.login))})]}),(0,eT.jsxs)("a",{href:i.htmlUrl,target:"_blank",rel:"noopener noreferrer",className:(0,ny.cn)("inline-flex items-center justify-center gap-1.5 rounded-sm border border-border px-2 py-1.5","font-mono text-[11px] text-foreground transition-colors hover:bg-secondary"),children:[(0,eT.jsx)(oE,{className:"size-3"}),"Open on GitHub"]})]})})}let gy=[{id:"vercel",name:"Vercel AI Gateway",blurb:"Zero-config routing to OpenAI, Anthropic, Google and more. Recommended default.",envVar:"AI_GATEWAY_API_KEY",keyPrefix:"vck_",needsKey:!0,keyUrl:"https://vercel.com/docs/ai-gateway",models:[{id:"anthropic/claude-opus-4.6",label:"Claude Opus 4.6",note:"Deepest reasoning · best for security"},{id:"anthropic/claude-sonnet-4.5",label:"Claude Sonnet 4.5",note:"Balanced quality / speed"},{id:"openai/gpt-5",label:"GPT-5",note:"Strong general analysis"},{id:"openai/gpt-5-mini",label:"GPT-5 Mini",note:"Fast triage pass"},{id:"google/gemini-3-flash",label:"Gemini 3 Flash",note:"Very fast, large context"}]},{id:"openrouter",name:"OpenRouter",blurb:"Single key, hundreds of models across providers — including free tiers.",envVar:"OPENROUTER_API_KEY",keyPrefix:"sk-or-",needsKey:!0,keyUrl:"https://openrouter.ai/keys",models:[{id:"meta-llama/llama-3.3-70b-instruct:free",label:"Llama 3.3 70B (free)",note:"Free · solid general text model"},{id:"deepseek/deepseek-chat-v3-0324:free",label:"DeepSeek V3 (free)",note:"Free · strong reasoning"},{id:"google/gemini-2.0-flash-exp:free",label:"Gemini 2.0 Flash (free)",note:"Free · fast, large context"},{id:"anthropic/claude-opus-4.6",label:"Claude Opus 4.6"},{id:"anthropic/claude-3.7-sonnet",label:"Claude 3.7 Sonnet"},{id:"openai/gpt-5",label:"GPT-5"},{id:"google/gemini-2.5-pro",label:"Gemini 2.5 Pro"},{id:"deepseek/deepseek-r1",label:"DeepSeek R1",note:"Open weights"},{id:"meta-llama/llama-3.3-70b-instruct",label:"Llama 3.3 70B"}]},{id:"anthropic",name:"Anthropic",blurb:"Claude models directly from Anthropic.",envVar:"ANTHROPIC_API_KEY",keyPrefix:"sk-ant-",needsKey:!0,keyUrl:"https://console.anthropic.com/settings/keys",models:[{id:"claude-opus-4-6",label:"Claude Opus 4.6",note:"Best for security review"},{id:"claude-sonnet-4-5",label:"Claude Sonnet 4.5"},{id:"claude-haiku-4",label:"Claude Haiku 4",note:"Fast triage"}]},{id:"openai",name:"OpenAI",blurb:"GPT models directly from OpenAI.",envVar:"OPENAI_API_KEY",keyPrefix:"sk-",needsKey:!0,keyUrl:"https://platform.openai.com/api-keys",models:[{id:"gpt-5",label:"GPT-5"},{id:"gpt-5-mini",label:"GPT-5 Mini",note:"Fast triage"},{id:"o4-mini",label:"o4-mini",note:"Reasoning, low cost"}]},{id:"xai",name:"xAI (Grok)",blurb:"Grok models from xAI. Requires an AI Gateway key with xAI enabled.",envVar:"XAI_API_KEY",keyPrefix:"xai-",needsKey:!0,keyUrl:"https://x.ai/api",models:[{id:"grok-4",label:"Grok 4"},{id:"grok-4-fast",label:"Grok 4 Fast",note:"Fast triage"}]},{id:"ollama",name:"Ollama (local)",blurb:"Run models fully offline on your machine. No code leaves your computer.",envVar:"OLLAMA_HOST",needsKey:!1,keyUrl:"https://ollama.com",models:[{id:"qwen2.5-coder:14b",label:"Qwen2.5 Coder 14B",note:"Best local code model"},{id:"llama3.1:8b",label:"Llama 3.1 8B",note:"Lightweight"},{id:"deepseek-r1:14b",label:"DeepSeek R1 14B",note:"Reasoning"}]}];function gb(e){return gy.find(t=>t.id===e)??gy[0]}let gk={provider:"openrouter",model:"meta-llama/llama-3.3-70b-instruct:free",keys:{},aiEnabled:!0,redactSecrets:!0,maxFiles:25,chatEnabled:!0,persistChats:!0,githubToken:"",defaultRepo:"",colorAccents:!1},gj="codelens.settings.v1";function gw(e){"u">typeof document&&document.documentElement.classList.toggle("accents",e)}function gN(){try{let e=window.localStorage.getItem(gj);if(!e)return gk;let t=JSON.parse(e);return{...gk,...t,keys:{...gk.keys,...t.keys}}}catch{return gk}}function g_(e){window.localStorage.setItem(gj,JSON.stringify(e))}let gS={modified:"M",added:"A",deleted:"D",untracked:"??",renamed:"R"},g$={modified:"var(--sev-medium)",added:"var(--sev-ok)",deleted:"var(--sev-critical)",untracked:"var(--sev-medium)",renamed:"var(--sev-info)"};function gI(e){switch(e){case"passing":return{Icon:da,color:"var(--sev-ok)",label:"Passing"};case"failing":return{Icon:i5,color:"var(--sev-critical)",label:"Failing"};case"disabled":return{Icon:d9,color:"var(--sev-info)",label:"Disabled"};default:return{Icon:d9,color:"var(--sev-info)",label:"No runs"}}}function gE({value:e,label:t="Copy"}){let[n,r]=(0,eP.useState)(!1);return(0,eT.jsxs)("button",{type:"button",onClick:()=>{navigator.clipboard?.writeText(e).then(()=>{r(!0),window.setTimeout(()=>r(!1),1400)})},className:"inline-flex items-center gap-1.5 rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:[n?(0,eT.jsx)(iq,{className:"size-3.5"}):(0,eT.jsx)(oC,{className:"size-3.5"}),n?"Copied":t]})}function gC({label:e,children:t}){return(0,eT.jsxs)("div",{className:"flex items-baseline gap-3 px-3 py-2",children:[(0,eT.jsx)("span",{className:"w-24 shrink-0 text-[10px] uppercase tracking-wide text-muted-foreground",children:e}),(0,eT.jsx)("span",{className:"min-w-0 flex-1 text-sm text-foreground",children:t})]})}function gA({detail:e,remoteInfo:t,onClose:n}){let r=t?.provider==="GitHub"?t.url:null;return(0,eT.jsx)(oM,{open:!!e,onOpenChange:e=>!e&&n(),children:(0,eT.jsxs)(oL,{side:"right",className:"w-full gap-0 p-0 sm:!max-w-xl",children:[e?.kind==="commit"&&(0,eT.jsx)(gT,{commit:e.commit,ghBase:r}),e?.kind==="branch"&&(0,eT.jsx)(gP,{branch:e.branch,ghBase:r}),e?.kind==="tag"&&(0,eT.jsx)(gz,{tag:e.tag,ghBase:r})]})})}function gT({commit:e,ghBase:t}){let n=e.fullHash||e.hash,[r,...i]=e.message.split("\n"),a=e.body||i.join("\n").trim();return(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(oU,{className:"border-b border-border",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 pr-8",children:[(0,eT.jsx)(cE,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsx)(oZ,{className:"truncate text-sm",children:r})]}),(0,eT.jsx)(oF,{className:"sr-only",children:"Commit detail"}),(0,eT.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[11px] text-muted-foreground",children:e.hash}),(0,eT.jsx)(gE,{value:n,label:"Copy SHA"}),t&&(0,eT.jsxs)("a",{href:`${t}/commit/${n}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:[(0,eT.jsx)(oE,{className:"size-3.5"})," View on GitHub"]})]})]}),(0,eT.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto p-4",children:[a&&(0,eT.jsx)("p",{className:"whitespace-pre-wrap text-pretty text-sm leading-relaxed text-muted-foreground",children:a}),(0,eT.jsx)("div",{className:"rounded-sm border border-border bg-card",children:(0,eT.jsxs)("div",{className:"divide-y divide-border",children:[(0,eT.jsxs)(gC,{label:"Author",children:[e.author,e.email&&(0,eT.jsxs)("span",{className:"ml-1.5 font-mono text-xs text-muted-foreground",children:["<",e.email,">"]})]}),(0,eT.jsxs)(gC,{label:"Date",children:[(0,eT.jsx)("span",{className:"font-mono text-xs",children:e.relative}),e.date&&(0,eT.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:new Date(e.date).toLocaleString()})]}),(0,eT.jsx)(gC,{label:"Commit",children:(0,eT.jsx)("span",{className:"break-all font-mono text-xs",children:n})}),(null!=e.insertions||null!=e.deletions)&&(0,eT.jsx)(gC,{label:"Changes",children:(0,eT.jsxs)("span",{className:"font-mono text-xs",children:[(0,eT.jsxs)("span",{className:"text-[color:var(--sev-ok)]",children:["+",e.insertions??0]})," ",(0,eT.jsxs)("span",{className:"text-[color:var(--sev-critical)]",children:["-",e.deletions??0]}),e.files?` \xb7 ${e.files.length} files`:""]})}),e.refs&&e.refs.length>0&&(0,eT.jsx)(gC,{label:"Refs",children:(0,eT.jsx)("span",{className:"flex flex-wrap gap-1",children:e.refs.map(e=>(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e},e))})})]})}),e.files&&e.files.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(cL,{className:"size-3.5"})," Files changed (",e.files.length,")"]}),(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:e.files.map(e=>(0,eT.jsxs)("div",{className:"flex items-center gap-2.5 border-t border-border px-3 py-2 first:border-t-0",children:[(0,eT.jsx)("span",{className:"w-5 shrink-0 text-center font-mono text-[10px]",style:{color:g$[e.status]},children:gS[e.status]}),(0,eT.jsx)(lR,{path:e.path,className:"text-xs"})]},e.path))})]})]})]})}function gP({branch:e,ghBase:t}){return(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(oU,{className:"border-b border-border",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 pr-8",children:[e.remote?(0,eT.jsx)(cO,{className:"size-4 shrink-0 text-muted-foreground"}):(0,eT.jsx)(eK,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsx)(oZ,{className:"truncate font-mono text-sm",children:e.name})]}),(0,eT.jsx)(oF,{className:"sr-only",children:"Branch detail"}),(0,eT.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[e.current&&(0,eT.jsx)(nS,{className:"border-0 bg-[color:var(--sev-ok)]/15 font-mono text-[10px] text-[color:var(--sev-ok)]",children:"current"}),e.merged&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)(cZ,{className:"size-3"})," merged"]}),(0,eT.jsx)(gE,{value:e.name,label:"Copy name"}),t&&!e.remote&&(0,eT.jsxs)("a",{href:`${t}/tree/${e.name}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:[(0,eT.jsx)(oE,{className:"size-3.5"})," View on GitHub"]})]})]}),(0,eT.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto p-4",children:[(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-px overflow-hidden rounded-sm border border-border bg-border",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5 bg-card px-3 py-2.5",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 font-mono text-lg tabular-nums text-foreground",children:[(0,eT.jsx)(cC,{className:"size-3.5 text-[color:var(--sev-ok)]"})," ",e.ahead??0]}),(0,eT.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"ahead of default"})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5 bg-card px-3 py-2.5",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 font-mono text-lg tabular-nums text-foreground",children:[(0,eT.jsx)(cA,{className:"size-3.5 text-[color:var(--sev-high)]"})," ",e.behind??0]}),(0,eT.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"behind default"})]})]}),(0,eT.jsx)("div",{className:"rounded-sm border border-border bg-card",children:(0,eT.jsxs)("div",{className:"divide-y divide-border",children:[(0,eT.jsx)(gC,{label:"Type",children:e.remote?"Remote-tracking":"Local"}),e.upstream&&(0,eT.jsx)(gC,{label:"Upstream",children:(0,eT.jsx)("span",{className:"font-mono text-xs",children:e.upstream})}),e.tip&&(0,eT.jsx)(gC,{label:"Tip",children:(0,eT.jsx)("span",{className:"font-mono text-xs",children:e.tip})}),e.subject&&(0,eT.jsx)(gC,{label:"Last commit",children:e.subject}),e.author&&(0,eT.jsx)(gC,{label:"Author",children:e.author}),e.lastCommitRelative&&(0,eT.jsx)(gC,{label:"Updated",children:(0,eT.jsx)("span",{className:"font-mono text-xs",children:e.lastCommitRelative})})]})})]})]})}function gz({tag:e,ghBase:t}){return(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(oU,{className:"border-b border-border",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 pr-8",children:[(0,eT.jsx)(cM,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsx)(oZ,{className:"truncate font-mono text-sm",children:e.name})]}),(0,eT.jsx)(oF,{className:"sr-only",children:"Tag detail"}),(0,eT.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.annotated?"annotated":"lightweight"}),(0,eT.jsx)(gE,{value:e.name,label:"Copy tag"}),t&&(0,eT.jsxs)("a",{href:`${t}/releases/tag/${e.name}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-sm border border-border bg-card px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:[(0,eT.jsx)(oE,{className:"size-3.5"})," View release"]})]})]}),(0,eT.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-auto p-4",children:[e.message&&(0,eT.jsx)("p",{className:"whitespace-pre-wrap text-pretty text-sm leading-relaxed text-muted-foreground",children:e.message}),(0,eT.jsx)("div",{className:"rounded-sm border border-border bg-card",children:(0,eT.jsxs)("div",{className:"divide-y divide-border",children:[e.commit&&(0,eT.jsx)(gC,{label:"Commit",children:(0,eT.jsx)("span",{className:"font-mono text-xs",children:e.commit})}),e.tagger&&(0,eT.jsx)(gC,{label:"Tagger",children:e.tagger}),e.relative&&(0,eT.jsxs)(gC,{label:"Date",children:[(0,eT.jsx)("span",{className:"font-mono text-xs",children:e.relative}),e.date&&(0,eT.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:new Date(e.date).toLocaleDateString()})]})]})})]})]})}function gO({issue:e}){let{viewIssue:t}=l$(),n=oV(e.severity);return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(o1(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(o1(e)))},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("mt-1 size-2 shrink-0 rounded-full",n.dot),"aria-hidden":!0}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.title}),(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.kind.replace(/-/g," ")})]}),(0,eT.jsx)("p",{className:"mt-1 line-clamp-2 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.detail}),e.filePath&&(0,eT.jsx)("div",{className:"mt-1.5",children:(0,eT.jsx)(lR,{path:e.filePath,className:"text-[11px]"})})]}),(0,eT.jsx)(lM,{issue:o1(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function gM({step:e}){let t=e.diagnostics&&e.diagnostics.length>0;return(0,eT.jsx)("div",{className:"flex flex-col gap-1 border-t border-border px-3 py-2 first:border-t-0",children:(0,eT.jsxs)("div",{className:"flex items-start gap-2",children:[t?(0,eT.jsx)(i5,{className:"mt-0.5 size-3.5 shrink-0 text-[color:var(--sev-high)]"}):(0,eT.jsx)(da,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground/50"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("span",{className:"text-xs text-foreground",children:e.name}),e.uses&&(0,eT.jsx)("span",{className:"ml-2 rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e.uses}),e.run&&(0,eT.jsxs)("pre",{className:"mt-1 overflow-x-auto rounded-sm bg-background/60 px-2 py-1 font-mono text-[11px] text-foreground/80",children:["$ ",e.run]}),e.condition&&(0,eT.jsxs)("p",{className:"mt-1 font-mono text-[10px] text-muted-foreground",children:["if: ",e.condition]}),t&&e.diagnostics.map((e,t)=>(0,eT.jsxs)("p",{className:"mt-1 flex items-start gap-1 text-[11px] leading-relaxed text-[color:var(--sev-high)]",children:[(0,eT.jsx)(cU,{className:"mt-0.5 size-3 shrink-0"})," ",e]},t))]})]})})}function gR({job:e}){let[t,n]=(0,eP.useState)("failing"===e.status),r=gI(e.status);return(0,eT.jsxs)("div",{className:"overflow-hidden rounded-sm border border-border bg-card",children:[(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e=>!e),className:"flex w-full items-center gap-2.5 px-3 py-2.5 text-left transition-colors hover:bg-secondary/40",children:[(0,eT.jsx)(r.Icon,{className:"size-4 shrink-0",style:{color:r.color}}),(0,eT.jsx)("span",{className:"font-mono text-sm text-foreground",children:e.name}),e.runsOn&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e.runsOn}),e.needs&&e.needs.length>0&&(0,eT.jsxs)("span",{className:"font-mono text-[10px] text-muted-foreground",children:["needs: ",e.needs.join(", ")]}),(0,eT.jsxs)("span",{className:"ml-auto flex items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[null!=e.durationMs&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(i4,{className:"size-3"})," ",(e.durationMs/1e3).toFixed(0),"s"]}),e.steps&&(0,eT.jsxs)("span",{children:[e.steps.length," steps"]}),(0,eT.jsx)(a4,{className:(0,ny.cn)("size-4 transition-transform",t&&"rotate-90")})]})]}),t&&e.condition&&(0,eT.jsxs)("p",{className:"border-t border-border bg-secondary/20 px-3 py-1.5 font-mono text-[10px] text-muted-foreground",children:["if: ",e.condition]}),t&&e.steps&&e.steps.length>0&&(0,eT.jsx)("div",{className:"border-t border-border",children:e.steps.map((e,t)=>(0,eT.jsx)(gM,{step:e},`${e.name}-${t}`))})]})}function gD({wf:e}){let t=gI(e.status);return(0,eT.jsxs)(s8,{className:"gap-0 overflow-hidden py-0",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-3 border-b border-border bg-secondary/30 px-4 py-3",children:[(0,eT.jsx)(cT,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"text-sm font-semibold text-foreground",children:e.name}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 font-mono text-[11px]",style:{color:t.color},children:[(0,eT.jsx)(t.Icon,{className:"size-3.5"}),t.label]}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e.provider})]}),(0,eT.jsx)(lR,{path:e.file,className:"text-[11px]"})]}),(0,eT.jsx)("div",{className:"flex shrink-0 flex-wrap justify-end gap-1",children:e.triggers.map(e=>(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e},e))})]}),(e.concurrency||e.permissions&&e.permissions.length>0||e.env&&e.env.length>0)&&(0,eT.jsxs)("div",{className:"flex flex-wrap gap-x-4 gap-y-1 border-b border-border px-4 py-2 font-mono text-[10px] text-muted-foreground",children:[e.concurrency&&(0,eT.jsxs)("span",{children:["concurrency: ",e.concurrency]}),e.permissions&&e.permissions.length>0&&(0,eT.jsxs)("span",{children:["permissions: ",e.permissions.join(", ")]}),e.env&&e.env.length>0&&(0,eT.jsxs)("span",{children:["env: ",e.env.join(", ")]})]}),(0,eT.jsx)("div",{className:"flex flex-col gap-2 p-3",children:e.jobs.map(e=>(0,eT.jsx)(gR,{job:e},e.name))}),e.diagnosis&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2 border-t border-border bg-secondary/20 px-4 py-3",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(cU,{className:"size-3.5"}),"Diagnose & run locally"]}),e.diagnosis.localCommand&&(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsxs)("pre",{className:"flex-1 overflow-x-auto rounded-sm border border-border bg-background/60 px-2.5 py-1.5 font-mono text-[11px] text-foreground",children:[(0,eT.jsx)(e2,{className:"mr-1.5 inline size-3 text-muted-foreground"}),e.diagnosis.localCommand]}),(0,eT.jsx)(gE,{value:e.diagnosis.localCommand})]}),(0,eT.jsx)("ul",{className:"flex flex-col gap-1",children:e.diagnosis.notes.map((e,t)=>(0,eT.jsxs)("li",{className:"flex items-start gap-1.5 text-[11px] leading-relaxed text-muted-foreground",children:[(0,eT.jsx)(a4,{className:"mt-0.5 size-3 shrink-0"})," ",e]},t))})]}),e.issues.length>0&&(0,eT.jsx)("div",{className:"flex flex-col border-t border-border",children:e.issues.map(e=>(0,eT.jsx)(gO,{issue:e},e.id))})]})}function gL({branch:e,onOpen:t}){return(0,eT.jsxs)("button",{type:"button",onClick:t,className:"flex w-full items-center gap-2.5 border-t border-border px-4 py-2.5 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[e.current?(0,eT.jsx)(iq,{className:"size-3.5 shrink-0 text-[color:var(--sev-ok)]"}):e.remote?(0,eT.jsx)(cO,{className:"size-3.5 shrink-0 text-muted-foreground"}):(0,eT.jsx)(eK,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,eT.jsx)("span",{className:(0,ny.cn)("min-w-0 flex-1 truncate font-mono text-xs",e.current?"font-semibold text-foreground":"text-foreground"),children:e.name}),null!=e.ahead&&e.ahead>0||null!=e.behind&&e.behind>0?(0,eT.jsxs)("span",{className:"flex shrink-0 items-center gap-1.5 font-mono text-[10px] text-muted-foreground",children:[null!=e.ahead&&e.ahead>0&&(0,eT.jsxs)("span",{className:"inline-flex items-center",children:[(0,eT.jsx)(cC,{className:"size-3"}),e.ahead]}),null!=e.behind&&e.behind>0&&(0,eT.jsxs)("span",{className:"inline-flex items-center",children:[(0,eT.jsx)(cA,{className:"size-3"}),e.behind]})]}):null,e.current&&(0,eT.jsx)(nS,{className:"border-0 bg-[color:var(--sev-ok)]/15 font-mono text-[10px] text-[color:var(--sev-ok)]",children:"current"}),e.remote&&!e.current&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:"remote"}),e.lastCommitRelative&&(0,eT.jsx)("span",{className:"hidden shrink-0 font-mono text-[10px] text-muted-foreground sm:inline",children:e.lastCommitRelative}),(0,eT.jsx)(a4,{className:"size-4 shrink-0 text-muted-foreground"})]})}function gU({git:e}){let{state:t}=e,[n,r]=(0,eP.useState)(!1),[i,a]=(0,eP.useState)("repository"),[s,o]=(0,eP.useState)(null),l=[...e.issues].sort(oq),d=t.branches.filter(e=>!e.remote),c=t.branches.filter(e=>e.remote),u=[...d,...c],[m,p]=(0,eP.useState)(null);(0,eP.useEffect)(()=>{let e=gN().defaultRepo.trim().match(/^([^/\s]+)\/([^/\s]+)$/);e&&p({owner:e[1],repo:e[2]})},[]);let f=(0,eP.useMemo)(()=>m||(t.remoteInfo?.provider==="GitHub"?{owner:t.remoteInfo.owner,repo:t.remoteInfo.name}:null),[t.remoteInfo,m]),[h,g]=(0,eP.useState)(f);(0,eP.useEffect)(()=>{m&&g(m)},[m]);let x=t.remoteInfo?.provider==="GitHub"||!!h,v=[{key:"repository",label:"Repository",Icon:dB,show:!0},{key:"cicd",label:"CI / CD",Icon:cT,show:!0,count:e.workflows.length},{key:"releases",label:"Releases",Icon:cD,show:x}];return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1.5",children:v.filter(e=>e.show).map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>a(e.key),className:(0,ny.cn)("inline-flex items-center gap-1.5 rounded-sm border px-3 py-1.5 font-mono text-xs transition-colors",i===e.key?"border-foreground/30 bg-foreground/[0.06] text-foreground":"border-border text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)(e.Icon,{className:"size-3.5"}),e.label,null!=e.count&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1 font-mono text-[10px] tabular-nums text-muted-foreground",children:e.count})]},e.key))}),"releases"===i&&x?(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)(gg,{source:h,detected:f,onChange:g}),h?(0,eT.jsx)(gl,{owner:h.owner,repo:h.repo}):(0,eT.jsx)(s8,{className:"p-6 text-center text-sm text-muted-foreground",children:"Enter a GitHub owner/repo above to load releases."})]}):"cicd"===i?(0,eT.jsx)(gZ,{git:e}):(0,eT.jsx)(gF,{git:e,state:t,issues:l,orderedBranches:u,localBranches:d,remoteBranches:c,showRemote:n,setShowRemote:r,source:h,detected:f,setSource:g,isGithub:x,onOpenDetail:o}),(0,eT.jsx)(gA,{detail:s,remoteInfo:t.remoteInfo,onClose:()=>o(null)})]})}function gZ({git:e}){if(0===e.workflows.length)return(0,eT.jsxs)(s8,{className:"flex flex-col items-center justify-center gap-3 py-16 text-center",children:[(0,eT.jsx)(cT,{className:"size-8 text-muted-foreground"}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:"No CI/CD workflows detected"}),(0,eT.jsxs)("p",{className:"max-w-sm text-pretty text-sm text-muted-foreground",children:["Add a workflow under ",(0,eT.jsx)("span",{className:"font-mono",children:".github/workflows"})," (or a GitLab/CircleCI config) to see jobs, steps, and diagnostics here."]})]})]});let t=e.workflows.filter(e=>"passing"===e.status).length,n=e.workflows.filter(e=>"failing"===e.status).length,r=e.workflows.reduce((e,t)=>e+t.jobs.length,0);return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"grid gap-4 sm:grid-cols-4",children:[(0,eT.jsxs)(s8,{className:"gap-1 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Workflows"}),(0,eT.jsx)("span",{className:"font-mono text-3xl font-semibold tabular-nums text-foreground",children:e.workflows.length})]}),(0,eT.jsxs)(s8,{className:"gap-1 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Passing"}),(0,eT.jsx)("span",{className:"font-mono text-3xl font-semibold tabular-nums",style:{color:"var(--sev-ok)"},children:t})]}),(0,eT.jsxs)(s8,{className:"gap-1 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Failing"}),(0,eT.jsx)("span",{className:"font-mono text-3xl font-semibold tabular-nums",style:{color:n>0?"var(--sev-critical)":"var(--sev-ok)"},children:n})]}),(0,eT.jsxs)(s8,{className:"gap-1 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Jobs"}),(0,eT.jsx)("span",{className:"font-mono text-3xl font-semibold tabular-nums text-foreground",children:r})]})]}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(cT,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Pipelines"}),(0,eT.jsx)("span",{className:"ml-auto font-mono text-xs text-muted-foreground",children:"expand a job to inspect its steps"})]}),(0,eT.jsx)("div",{className:"flex flex-col gap-4",children:e.workflows.map(e=>(0,eT.jsx)(gD,{wf:e},e.id))})]})}function gF({git:e,state:t,issues:n,orderedBranches:r,localBranches:i,remoteBranches:a,showRemote:s,setShowRemote:o,source:l,detected:d,setSource:c,isGithub:u,onOpenDetail:m}){let p=(0,eP.useMemo)(()=>t.tagDetails&&t.tagDetails.length>0?t.tagDetails:t.tags.map(e=>({name:e})),[t.tagDetails,t.tags]);return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[t.remoteInfo&&(0,eT.jsx)(oS,{title:"Repository",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(cz,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("span",{className:"truncate font-mono text-sm text-foreground",children:[t.remoteInfo.owner,"/",t.remoteInfo.name]})]}),(0,eT.jsxs)("a",{href:t.remoteInfo.url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 self-start rounded-sm bg-secondary px-2 py-1 font-mono text-[11px] text-foreground transition-colors hover:bg-secondary/70",children:[(0,eT.jsx)(oE,{className:"size-3"}),"View on ",t.remoteInfo.provider]})]})}),u&&(0,eT.jsxs)(eT.Fragment,{children:[!d&&(0,eT.jsx)(gg,{source:l,detected:d,onChange:c}),l&&(0,eT.jsx)(gv,{source:l})]}),(0,eT.jsx)(oS,{title:"Working tree",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eK,{className:"size-4 shrink-0 text-muted-foreground"}),(0,eT.jsx)("span",{className:"truncate font-mono text-sm text-foreground",children:t.branch})]}),(0,eT.jsxs)("div",{className:"flex items-center gap-3 font-mono text-xs",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-foreground",children:[(0,eT.jsx)(cC,{className:"size-3.5"})," ",t.ahead]}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-foreground",children:[(0,eT.jsx)(cA,{className:"size-3.5"})," ",t.behind]}),(0,eT.jsxs)("span",{className:"text-muted-foreground",children:["vs ",t.defaultBranch]})]}),(0,eT.jsx)("button",{type:"button",onClick:()=>m({kind:"commit",commit:t.recentCommits[0]??{...t.lastCommit}}),className:"border-t border-border pt-3 text-left transition-colors hover:opacity-80",children:(0,eT.jsxs)("div",{className:"flex items-start gap-2",children:[(0,eT.jsx)(cE,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0",children:[(0,eT.jsx)("p",{className:"truncate text-xs text-foreground",children:t.lastCommit.message}),(0,eT.jsxs)("p",{className:"font-mono text-[10px] text-muted-foreground",children:[t.lastCommit.hash," · ",t.lastCommit.author," · ",t.lastCommit.relative]})]})]})}),(0,eT.jsxs)("div",{className:"flex items-center justify-between border-t border-border pt-3 font-mono text-[11px] text-muted-foreground",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(cP,{className:"size-3.5"})," ",t.contributors," authors"]}),(0,eT.jsxs)("span",{children:[t.totalCommits.toLocaleString()," commits"]})]}),(t.firstCommitRelative||null!=t.trackedFiles)&&(0,eT.jsxs)("div",{className:"flex items-center justify-between border-t border-border pt-3 font-mono text-[11px] text-muted-foreground",children:[t.firstCommitRelative&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(i4,{className:"size-3.5"})," since ",t.firstCommitRelative]}),null!=t.trackedFiles&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(s9,{className:"size-3.5"})," ",t.trackedFiles.toLocaleString()," files"]})]}),(t.stashes>0||t.tags.length>0)&&(0,eT.jsxs)("div",{className:"flex items-center justify-between border-t border-border pt-3 font-mono text-[11px] text-muted-foreground",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(cR,{className:"size-3.5"})," ",t.stashes," ",1===t.stashes?"stash":"stashes"]}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,eT.jsx)(cM,{className:"size-3.5"})," ",t.tags.length," tags"]})]})]})}),t.topContributors&&t.topContributors.length>0&&(0,eT.jsx)(oS,{title:"Top contributors",children:(0,eT.jsx)("ul",{className:"flex flex-col gap-2",children:t.topContributors.map(e=>{let n=t.topContributors[0].commits||1;return(0,eT.jsxs)("li",{className:"flex flex-col gap-1",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between font-mono text-[11px]",children:[(0,eT.jsx)("span",{className:"truncate text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"tabular-nums text-muted-foreground",children:e.commits})]}),(0,eT.jsx)("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("span",{className:"block h-full rounded-full bg-foreground/40",style:{width:`${e.commits/n*100}%`}})})]},e.name)})})}),(0,eT.jsx)(oS,{title:`Changes (${t.changes.length})`,children:0===t.changes.length?(0,eT.jsx)("p",{className:"text-xs text-muted-foreground",children:"Working tree clean."}):(0,eT.jsx)("ul",{className:"flex flex-col gap-1.5",children:t.changes.map(e=>(0,eT.jsxs)("li",{className:"flex items-center gap-2 font-mono text-xs",children:[(0,eT.jsx)("span",{className:"w-5 shrink-0 text-center text-[10px]",style:{color:g$[e.status]},children:gS[e.status]}),(0,eT.jsx)("span",{className:"truncate text-foreground",children:e.path})]},e.path))})}),t.ignored.count>0&&(0,eT.jsx)(oS,{title:`Ignored files (${t.ignored.count})`,children:(0,eT.jsxs)("ul",{className:"flex flex-col gap-1.5",children:[t.ignored.samples.map(e=>(0,eT.jsxs)("li",{className:"flex items-center gap-2 font-mono text-xs text-muted-foreground",children:[(0,eT.jsx)(cy,{className:"size-3.5 shrink-0"}),(0,eT.jsx)("span",{className:"truncate",children:e})]},e)),t.ignored.count>t.ignored.samples.length&&(0,eT.jsxs)("li",{className:"font-mono text-[10px] text-muted-foreground",children:["+",t.ignored.count-t.ignored.samples.length," more"]})]})}),(0,eT.jsx)(oS,{title:"Remote",action:t.remote?(0,eT.jsxs)("button",{type:"button",onClick:()=>o(e=>!e),"aria-pressed":s,"aria-label":s?"Hide remote URL":"Reveal remote URL",className:"inline-flex items-center gap-1 rounded-sm px-1 py-0.5 font-mono text-[10px] uppercase text-muted-foreground transition-colors hover:text-foreground",children:[s?(0,eT.jsx)(cy,{className:"size-3.5"}):(0,eT.jsx)(cv,{className:"size-3.5"}),s?"Hide":"Reveal"]}):void 0,children:t.remote?s?(0,eT.jsx)("p",{className:"break-all font-mono text-xs text-foreground",children:t.remote}):(0,eT.jsx)("p",{className:"font-mono text-xs tracking-widest text-muted-foreground","aria-hidden":!0,children:"•".repeat(28)}):(0,eT.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:"No remote configured"})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[r.length>0&&(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eK,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Branches"}),(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-xs",children:[i.length," local · ",a.length," remote"]})]}),(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:r.map(e=>(0,eT.jsx)(gL,{branch:e,onOpen:()=>m({kind:"branch",branch:e})},`${e.remote?"r":"l"}-${e.name}`))})]}),t.recentCommits.length>0&&(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(cE,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Recent commits"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:t.recentCommits.length})]}),(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:t.recentCommits.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>m({kind:"commit",commit:e}),className:"flex w-full items-start gap-3 border-t border-border px-4 py-2.5 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:"mt-0.5 shrink-0 rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e.hash}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("p",{className:"truncate text-xs text-foreground",children:e.message.split("\n")[0]}),(0,eT.jsxs)("p",{className:"font-mono text-[10px] text-muted-foreground",children:[e.author," · ",e.relative,null!=e.insertions&&(0,eT.jsxs)("span",{className:"ml-2",children:[(0,eT.jsxs)("span",{className:"text-[color:var(--sev-ok)]",children:["+",e.insertions]})," ",(0,eT.jsxs)("span",{className:"text-[color:var(--sev-critical)]",children:["-",e.deletions??0]})]})]})]}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]},e.hash))})]}),p.length>0&&(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(cM,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Tags"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:p.length})]}),(0,eT.jsx)("div",{className:"flex flex-wrap gap-1.5",children:p.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>m({kind:"tag",tag:e}),className:"inline-flex items-center gap-1 rounded-sm bg-secondary px-2 py-1 font-mono text-[11px] text-foreground transition-colors hover:bg-secondary/70",children:[(0,eT.jsx)(cM,{className:"size-3"}),e.name,e.relative&&(0,eT.jsxs)("span",{className:"text-muted-foreground",children:["· ",e.relative]})]},e.name))})]}),(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eK,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Repository findings"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:n.length})]}),0===n.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No repository hygiene issues detected."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:n.map(e=>(0,eT.jsx)(gO,{issue:e},e.id))})]})]})]})}let gB=eL("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);function gV({label:e,value:t,sub:n}){return(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5 bg-card p-4",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:t}),(0,eT.jsx)("span",{className:"text-xs font-medium text-foreground",children:e}),n&&(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:n})]})}function gq({c:e}){return(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:(0,eT.jsxs)("div",{className:"flex items-start gap-3 p-4",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-sm",e.present?"bg-[color:var(--sev-ok)]/15 text-[color:var(--sev-ok)]":"bg-[color:var(--sev-medium)]/15 text-[color:var(--sev-medium)]"),children:e.present?(0,eT.jsx)(iq,{className:"size-3.5"}):(0,eT.jsx)(sz,{className:"size-3.5"})}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"text-sm font-semibold text-foreground",children:e.name}),e.present?(0,eT.jsx)(lR,{path:e.file,className:"text-[11px]"}):(0,eT.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground line-through",children:e.file}),null!=e.ruleCount&&(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-[10px]",children:[e.ruleCount," rules"]})]}),(0,eT.jsx)("p",{className:"mt-1 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.summary}),e.highlights&&e.highlights.length>0&&(0,eT.jsx)("dl",{className:"mt-3 grid grid-cols-1 gap-px overflow-hidden rounded-sm border border-border bg-border sm:grid-cols-2",children:e.highlights.map(e=>(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-2 bg-card px-2.5 py-1.5",children:[(0,eT.jsx)("dt",{className:"font-mono text-[11px] text-muted-foreground",children:e.label}),(0,eT.jsx)("dd",{className:(0,ny.cn)("font-mono text-[11px] tabular-nums",!1===e.good?"text-[color:var(--sev-high)]":e.good?"text-[color:var(--sev-ok)]":"text-foreground"),children:e.value})]},e.label))})]})]})})}function gW({setup:e}){let{stats:t}=e,n=[{label:"Code",value:t.codeLoc,color:"var(--chart-1)"},{label:"Comments",value:t.commentLoc,color:"var(--chart-3)"},{label:"Blank",value:t.blankLoc,color:"var(--chart-5)"}],r=t.languages.map(e=>({key:e.language,label:e.language,count:e.loc,hint:`${e.files} files \xb7 ${Math.round(100*e.share)}%`})),i=t.largestFiles.map(e=>({key:e.path,label:e.path,count:e.loc}));return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsx)(oS,{title:"Tooling detected",children:(0,eT.jsx)("ul",{className:"flex flex-col gap-1.5",children:e.tooling.map(e=>(0,eT.jsxs)("li",{className:"flex items-center justify-between gap-2 text-xs",children:[(0,eT.jsxs)("span",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("flex size-4 items-center justify-center rounded-[3px]",e.detected?"bg-[color:var(--sev-ok)]/15 text-[color:var(--sev-ok)]":"bg-secondary text-muted-foreground"),children:e.detected?(0,eT.jsx)(iq,{className:"size-3"}):(0,eT.jsx)(sz,{className:"size-3"})}),(0,eT.jsx)("span",{className:(0,ny.cn)(e.detected?"text-foreground":"text-muted-foreground"),children:e.name})]}),e.version&&(0,eT.jsx)("span",{className:"font-mono text-[10px] tabular-nums text-muted-foreground",children:e.version})]},e.name))})}),(0,eT.jsxs)(oS,{title:"LOC composition",children:[(0,eT.jsx)(o$,{segments:n}),(0,eT.jsxs)("p",{className:"mt-3 border-t border-border pt-3 font-mono text-[11px] text-muted-foreground",children:[(100*t.commentRatio).toFixed(1),"% comments · ",(100*t.testRatio).toFixed(0),"% test ratio"]})]}),(0,eT.jsx)(oS,{title:"Languages",children:(0,eT.jsx)(oI,{rows:r})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(gB,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Workspace statistics"})]}),(0,eT.jsxs)(s8,{className:"grid grid-cols-2 gap-px overflow-hidden bg-border p-0 sm:grid-cols-3 lg:grid-cols-4",children:[(0,eT.jsx)(gV,{label:"Files",value:t.totalFiles}),(0,eT.jsx)(gV,{label:"Lines of code",value:t.totalLoc.toLocaleString(),sub:`${t.codeLoc.toLocaleString()} code`}),(0,eT.jsx)(gV,{label:"Components",value:t.components}),(0,eT.jsx)(gV,{label:"Routes",value:t.routes}),(0,eT.jsx)(gV,{label:"Test files",value:t.testFiles,sub:`${t.testLoc.toLocaleString()} LOC`}),(0,eT.jsx)(gV,{label:"Comments",value:`${(100*t.commentRatio).toFixed(1)}%`,sub:"of code"}),(0,eT.jsx)(gV,{label:"Test ratio",value:`${(100*t.testRatio).toFixed(0)}%`,sub:"tests : code"}),(0,eT.jsx)(gV,{label:"TODO / FIXME",value:t.todoCount,sub:"markers"})]})]}),(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(s5,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Largest files"})]}),(0,eT.jsx)(s8,{className:"p-3",children:(0,eT.jsx)(oI,{rows:i})})]}),(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eJ,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Configuration & rules"}),(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-xs",children:[e.configs.filter(e=>e.present).length,"/",e.configs.length]})]}),(0,eT.jsx)("div",{className:"flex flex-col gap-3",children:e.configs.map(e=>(0,eT.jsx)(gq,{c:e},e.id))})]})]})]})}let gH=eL("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);function gG(e){switch(e){case"pass":return{Icon:iq,color:"var(--sev-ok)",label:"Pass"};case"warn":return{Icon:dw,color:"var(--sev-medium)",label:"Warn"};case"na":return{Icon:lq,color:"var(--muted-foreground)",label:"N/A"};default:return{Icon:sz,color:"var(--sev-critical)",label:"Fail"}}}let gK={excellent:"Excellent",good:"Good","needs-improvement":"Needs improvement",poor:"Poor"};function gJ(e){return e>=80?"var(--sev-ok)":e>=60?"var(--sev-medium)":e>=40?"var(--sev-high)":"var(--sev-critical)"}function gY({score:e,label:t,sub:n}){let r=gJ(e);return(0,eT.jsxs)("div",{className:"flex flex-col items-center gap-2 p-6",children:[(0,eT.jsxs)("div",{className:"relative flex size-28 items-center justify-center",children:[(0,eT.jsxs)("svg",{viewBox:"0 0 100 100",className:"size-full -rotate-90",children:[(0,eT.jsx)("circle",{cx:"50",cy:"50",r:"42",fill:"none",stroke:"var(--border)",strokeWidth:"8"}),(0,eT.jsx)("circle",{cx:"50",cy:"50",r:"42",fill:"none",stroke:r,strokeWidth:"8",strokeLinecap:"round",strokeDasharray:`${e/100*264} 264`})]}),(0,eT.jsx)("span",{className:"absolute font-mono text-3xl font-semibold tabular-nums text-foreground",children:e})]}),(0,eT.jsx)("span",{className:"text-sm font-semibold text-foreground",children:t}),(0,eT.jsx)("span",{className:"text-center text-xs text-muted-foreground",children:n})]})}function gX({standard:e,active:t,onSelect:n}){let r=gJ(e.score),i=e.checks.filter(e=>"pass"===e.status).length,a=e.checks.filter(e=>"na"!==e.status).length;return(0,eT.jsxs)("button",{type:"button",onClick:n,className:(0,ny.cn)("flex flex-col gap-3 rounded-md border bg-card p-4 text-left transition-colors",t?"border-ring ring-1 ring-ring":"border-border hover:bg-secondary/40"),children:[(0,eT.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,eT.jsxs)("div",{className:"min-w-0",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,eT.jsx)("span",{className:"truncate text-sm font-semibold text-foreground",children:e.label}),e.liveOnly&&(0,eT.jsx)("span",{className:"shrink-0 rounded-sm border border-border px-1 py-0.5 font-mono text-[9px] uppercase text-muted-foreground",children:"live"})]}),(0,eT.jsx)("p",{className:"mt-0.5 line-clamp-2 text-pretty text-[11px] leading-snug text-muted-foreground",children:e.tagline})]}),(0,eT.jsx)("span",{className:"shrink-0 font-mono text-2xl font-semibold tabular-nums",style:{color:r},children:e.score})]}),(0,eT.jsx)(om,{value:e.score,className:"h-1.5"}),(0,eT.jsxs)("div",{className:"flex items-center justify-between font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)("span",{children:gK[e.band]}),(0,eT.jsxs)("span",{children:[i,"/",a," pass · ",Math.round(100*e.weight),"% wt"]})]})]})}function gQ({check:e,onOpen:t}){let n=gG(e.status);return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:t,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),t())},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[(0,eT.jsx)(n.Icon,{className:"mt-0.5 size-4 shrink-0",style:{color:n.color}}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.label}),e.agent&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:[(0,eT.jsx)(gH,{className:"size-3"}),"agent"]}),(0,eT.jsx)("span",{className:"ml-auto font-mono text-[10px] text-muted-foreground",children:"na"===e.status?"n/a":`+${e.weight}`})]}),(0,eT.jsx)("p",{className:"mt-1 line-clamp-2 text-pretty text-xs leading-relaxed text-muted-foreground",children:e.detail}),e.fix&&(0,eT.jsxs)("p",{className:"mt-1.5 inline-flex items-start gap-1.5 text-pretty text-xs leading-relaxed text-foreground",children:[(0,eT.jsx)(s4,{className:"mt-0.5 size-3 shrink-0 text-muted-foreground"}),(0,eT.jsx)("span",{className:"line-clamp-1",children:e.fix})]})]}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function g0({doc:e}){return(0,eT.jsxs)("div",{className:"flex items-center gap-3 border-t border-border px-3 py-2.5 first:border-t-0",children:[(0,eT.jsx)(eZ,{className:(0,ny.cn)("size-4 shrink-0",e.present?"text-foreground":"text-muted-foreground")}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[e.present?(0,eT.jsx)(lR,{path:e.path,className:"text-xs"}):(0,eT.jsx)("span",{className:"font-mono text-xs text-muted-foreground line-through",children:e.path}),(0,eT.jsx)("p",{className:"mt-0.5 line-clamp-1 text-[11px] text-muted-foreground",children:e.note})]}),e.present?(0,eT.jsx)("span",{className:"shrink-0 font-mono text-xs tabular-nums",style:{color:gJ(e.score)},children:e.score}):(0,eT.jsx)("span",{className:"shrink-0 font-mono text-[10px] uppercase text-[color:var(--sev-high)]",children:"missing"})]})}function g1({standard:e,onOpenCheck:t}){let n=(0,eP.useMemo)(()=>{let t=new Map;for(let n of e.checks){let e=n.group??"";t.has(e)||t.set(e,[]),t.get(e).push(n)}return[...t.entries()]},[e.checks]);return(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)(eY,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:e.label}),(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums",style:{color:gJ(e.score)},children:e.score}),(0,eT.jsxs)("a",{href:e.href,target:"_blank",rel:"noreferrer",className:"ml-auto inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground transition-colors hover:text-foreground",children:[e.source,(0,eT.jsx)(oE,{className:"size-3"})]})]}),n.map(([n,r])=>(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[n&&(0,eT.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-wider text-muted-foreground",children:n}),(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:r.map(e=>(0,eT.jsx)(gQ,{check:e,onOpen:()=>t(e)},e.id))})]},n||e.id))]})}function g2({docs:e}){let[t,n]=(0,eP.useState)("all"),[r,i]=(0,eP.useState)(null),a=(0,eP.useMemo)(()=>e.standards.flatMap(e=>e.checks),[e.standards]),s=(0,eP.useMemo)(()=>a.filter(e=>e.agent),[a]),o=a.filter(e=>"pass"===e.status).length,l=a.filter(e=>"na"!==e.status).length,d=s.filter(e=>"pass"===e.status).length,c=s.filter(e=>"na"!==e.status).length,u="all"===t?e.standards:e.standards.filter(e=>e.id===t),m=[{id:"all",label:"All standards"},...e.standards.map(e=>({id:e.id,label:e.label}))];return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsx)(s8,{className:"flex flex-col items-center gap-1 py-0",children:(0,eT.jsx)(gY,{score:e.score,label:`Docs Benchmark \xb7 ${e.grade}`,sub:`${gK[e.band]} — ${o}/${l} checks passing`})}),(0,eT.jsx)(oS,{title:"AI / Agent readiness",action:(0,eT.jsx)("span",{className:(0,ny.cn)("rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase",e.agentReady?"bg-[color:var(--sev-ok)]/15 text-[color:var(--sev-ok)]":"bg-[color:var(--sev-high)]/15 text-[color:var(--sev-high)]"),children:e.agentReady?"Ready":"Not ready"}),children:(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-muted-foreground",children:[(0,eT.jsx)(gH,{className:"size-4"})," Agent score"]}),(0,eT.jsxs)("span",{className:"font-mono tabular-nums text-foreground",children:[e.agentScore,"/100"]})]}),(0,eT.jsx)(om,{value:e.agentScore,className:"h-1.5"}),(0,eT.jsxs)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:[d,"/",c," agent-readiness checks pass across all standards. Adding AGENTS.md and llms.txt has the highest impact."]}),!e.liveUrl&&(0,eT.jsx)("p",{className:"rounded-sm border border-border bg-secondary/30 px-2 py-1.5 text-[11px] leading-relaxed text-muted-foreground",children:"No live docs URL set. Surface-level checks (robots, sitemap, .md mirrors, MCP) are marked N/A and excluded from scoring."})]})}),(0,eT.jsx)(oS,{title:"Documents",children:(0,eT.jsx)("div",{className:"-mx-3 -mb-3",children:e.documents.map(e=>(0,eT.jsx)(g0,{doc:e},e.path))})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,eT.jsxs)("section",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Benchmark composition"}),(0,eT.jsxs)(nS,{variant:"secondary",className:"font-mono text-xs",children:[e.standards.length," standards"]})]}),(0,eT.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:e.standards.map(e=>(0,eT.jsx)(gX,{standard:e,active:t===e.id,onSelect:()=>n(t=>t===e.id?"all":e.id)},e.id))})]}),(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:m.map(e=>(0,eT.jsx)("button",{type:"button",onClick:()=>n(e.id),className:(0,ny.cn)("rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.id?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:e.label},e.id))}),u.map(e=>(0,eT.jsx)(g1,{standard:e,onOpenCheck:t=>i({check:t,standard:e})},e.id))]}),(0,eT.jsx)(g4,{detail:r,onClose:()=>i(null)})]})}function g4({detail:e,onClose:t}){let n=e?.check,r=e?.standard,i=n?gG(n.status):null;return(0,eT.jsx)(oM,{open:!!e,onOpenChange:e=>!e&&t(),children:(0,eT.jsx)(oL,{side:"right",className:"w-full gap-0 p-0 sm:!max-w-md",children:n&&r&&i&&(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)(oU,{className:"border-b border-border",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pr-8",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase",style:{color:i.color,background:`color-mix(in oklch, ${i.color} 14%, transparent)`},children:[(0,eT.jsx)(i.Icon,{className:"size-3"}),i.label]}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:r.label}),n.agent&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:[(0,eT.jsx)(gH,{className:"size-3"}),"agent"]}),n.group&&(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:n.group})]}),(0,eT.jsx)(oZ,{className:"mt-2 text-pretty text-sm leading-relaxed",children:n.label}),(0,eT.jsx)(oF,{className:"sr-only",children:"Documentation check detail"})]}),(0,eT.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-5 overflow-auto p-4",children:[(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-px overflow-hidden rounded-sm border border-border bg-border",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5 bg-card px-3 py-2",children:[(0,eT.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Status"}),(0,eT.jsx)("span",{className:"font-mono text-sm tabular-nums",style:{color:i.color},children:i.label})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5 bg-card px-3 py-2",children:[(0,eT.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:"Weight"}),(0,eT.jsx)("span",{className:"font-mono text-sm tabular-nums text-foreground",children:"na"===n.status?"n/a":`+${n.weight}`})]})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(eY,{className:"size-3.5"}),"What this checks"]}),(0,eT.jsx)("p",{className:"text-pretty text-sm leading-relaxed text-foreground",children:n.detail})]}),n.fix&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(s4,{className:"size-3.5"}),"How to fix"]}),(0,eT.jsx)("p",{className:"rounded-sm border border-border bg-secondary/30 px-3 py-2 text-pretty text-sm leading-relaxed text-foreground",children:n.fix})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("p",{className:"flex items-center gap-1.5 text-xs font-medium uppercase tracking-wider text-muted-foreground",children:[(0,eT.jsx)(gu,{className:"size-3.5"}),"Standard"]}),(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-card p-3",children:[(0,eT.jsx)("p",{className:"text-sm font-medium text-foreground",children:r.label}),(0,eT.jsx)("p",{className:"mt-0.5 text-pretty text-xs leading-relaxed text-muted-foreground",children:r.tagline}),(0,eT.jsxs)("a",{href:r.href,target:"_blank",rel:"noreferrer",className:"mt-2 inline-flex items-center gap-1 font-mono text-[11px] text-muted-foreground transition-colors hover:text-foreground",children:[r.source,(0,eT.jsx)(oE,{className:"size-3"})]})]})]})]})]})})})}let g5={critical:"critical",serious:"high",moderate:"medium",minor:"low"};function g6({violation:e}){let{viewIssue:t}=l$(),n=oV(g5[e.impact]);return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(o4(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(o4(e)))},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("mt-0.5 size-2 shrink-0 rounded-full",n.dot),"aria-hidden":!0}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-foreground",children:e.rule}),(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:e.impact}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:e.principle})]}),(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm leading-relaxed text-foreground",children:e.help}),(0,eT.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-2 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsxs)("span",{className:"truncate",children:[e.filePath,":",e.line]}),(0,eT.jsxs)("span",{className:"rounded-sm border border-border px-1.5 py-0.5",children:[e.nodes," node",1===e.nodes?"":"s"]}),e.wcag.filter(e=>/^\d/.test(e)).map(e=>(0,eT.jsxs)("span",{className:"rounded-sm border border-border px-1.5 py-0.5",children:["WCAG ",e]},e))]})]}),(0,eT.jsx)(lM,{issue:o4(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function g3({accessibility:e}){let[t,n]=(0,eP.useState)("all"),r=(0,eP.useMemo)(()=>[...e.violations].sort((e,t)=>oV(g5[t.impact]).rank-oV(g5[e.impact]).rank),[e.violations]),i=(0,eP.useMemo)(()=>"all"===t?r:r.filter(e=>e.impact===t),[r,t]),a=[{label:"Critical",value:e.counts.critical,color:"var(--chart-1)"},{label:"Serious",value:e.counts.serious,color:"var(--chart-2)"},{label:"Moderate",value:e.counts.moderate,color:"var(--chart-3)"},{label:"Minor",value:e.counts.minor,color:"var(--chart-4)"}],s=e.byPrinciple.map(e=>({key:e.principle,label:e.principle,count:e.count})),o=[{key:"all",label:"All",count:e.violations.length},{key:"critical",label:"Critical",count:e.counts.critical},{key:"serious",label:"Serious",count:e.counts.serious},{key:"moderate",label:"Moderate",count:e.counts.moderate},{key:"minor",label:"Minor",count:e.counts.minor}],l=e.score>=90?"var(--sev-ok)":e.score>=70?"var(--sev-medium)":"var(--sev-high)";return(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_260px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsxs)(oS,{title:"Accessibility score",children:[(0,eT.jsxs)("div",{className:"flex items-end justify-between",children:[(0,eT.jsx)("span",{className:"font-mono text-4xl font-semibold tabular-nums",style:{color:l},children:e.score}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"out of 100"})]}),(0,eT.jsxs)("div",{className:"mt-3 grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-lg font-semibold tabular-nums text-[color:var(--sev-ok)]",children:e.passes}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"checks passed"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-lg font-semibold tabular-nums text-foreground",children:e.incomplete}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"need review"})]})]})]}),(0,eT.jsx)(oS,{title:"By impact",children:(0,eT.jsx)(o$,{segments:a})}),(0,eT.jsx)(oS,{title:"By WCAG principle",children:(0,eT.jsx)(oI,{rows:s})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:o.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(eQ,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"WCAG violations"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:i.length}),(0,eT.jsxs)("span",{className:"ml-auto inline-flex items-center gap-1.5 font-mono text-[10px] uppercase text-muted-foreground",children:[(0,eT.jsx)(cv,{className:"size-3"}),"axe-core"]})]}),0===i.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No violations in this category."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:i.map(e=>(0,eT.jsx)(g6,{violation:e},e.id))})]})]})}let g9=eL("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),g8={good:"var(--sev-ok)","needs-improvement":"var(--sev-medium)",poor:"var(--sev-high)"},g7={good:"Good","needs-improvement":"Needs work",poor:"Poor"};function xe({vital:e}){let t=g8[e.rating],n=1.5*e.threshold.poor,r=Math.min(100,e.value/n*100),i=Math.min(100,e.threshold.good/n*100),a=Math.min(100,e.threshold.poor/n*100);return(0,eT.jsxs)(s8,{className:"gap-2 p-4",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("span",{className:"font-mono text-xs font-semibold text-foreground",children:e.id}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase",style:{color:t},children:g7[e.rating]})]}),(0,eT.jsxs)("span",{className:"font-mono text-2xl font-semibold tabular-nums",style:{color:t},children:[e.value,(0,eT.jsx)("span",{className:"ml-0.5 text-sm text-muted-foreground",children:e.unit})]}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:e.label}),(0,eT.jsxs)("div",{className:"relative mt-1 h-1.5 w-full overflow-hidden rounded-full bg-secondary",children:[(0,eT.jsx)("span",{className:"absolute inset-y-0 left-0 bg-[color:var(--sev-ok)]/30",style:{width:`${i}%`},"aria-hidden":!0}),(0,eT.jsx)("span",{className:"absolute inset-y-0 bg-[color:var(--sev-medium)]/30",style:{left:`${i}%`,width:`${a-i}%`},"aria-hidden":!0}),(0,eT.jsx)("span",{className:"absolute top-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full ring-2 ring-card",style:{left:`${r}%`,background:t},"aria-hidden":!0})]})]})}function xt({bundle:e}){let t=g8[e.rating];return(0,eT.jsxs)("li",{className:"flex flex-col gap-1.5",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-2 text-xs",children:[(0,eT.jsx)("span",{className:"truncate font-mono text-foreground",children:e.route}),(0,eT.jsxs)("span",{className:"shrink-0 font-mono tabular-nums",style:{color:t},children:[e.firstLoadKb," KB"]})]}),(0,eT.jsx)("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("span",{className:"block h-full rounded-full",style:{width:`${Math.min(100,e.firstLoadKb/320*100)}%`,background:t}})})]})}function xn({finding:e}){let{viewIssue:t}=l$(),n=oV(e.severity);return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(o5(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(o5(e)))},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("mt-0.5 size-2 shrink-0 rounded-full",n.dot),"aria-hidden":!0}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:e.kind.replace(/-/g," ")}),null!=e.estimatedSavingKb&&e.estimatedSavingKb>0&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] text-[color:var(--sev-ok)]",children:[(0,eT.jsx)(g9,{className:"size-2.5"}),"save ~",e.estimatedSavingKb," KB"]})]}),(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm leading-relaxed text-foreground",children:e.title}),(0,eT.jsxs)("span",{className:"mt-1 block truncate font-mono text-[10px] text-muted-foreground",children:[e.filePath,e.line?`:${e.line}`:""]})]}),(0,eT.jsx)(lM,{issue:o5(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function xr({performance:e}){let[t,n]=(0,eP.useState)(!1),r=(0,eP.useMemo)(()=>{let n=[...e.findings].sort((e,t)=>oV(t.severity).rank-oV(e.severity).rank);return t?n.filter(e=>(e.estimatedSavingKb??0)>0):n},[e.findings,t]),i=e.findings.reduce((e,t)=>e+(t.estimatedSavingKb??0),0),a=e.score>=90?"var(--sev-ok)":e.score>=50?"var(--sev-medium)":"var(--sev-high)";return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6",children:[(0,eT.jsxs)(s8,{className:"gap-2 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Perf score"}),(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums",style:{color:a},children:e.score}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"Lighthouse-style"})]}),e.vitals.map(e=>(0,eT.jsx)(xe,{vital:e},e.id))]}),(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsxs)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:[(0,eT.jsx)(oS,{title:"First Load JS by route",children:(0,eT.jsx)("ul",{className:"flex flex-col gap-3",children:e.bundles.map(e=>(0,eT.jsx)(xt,{bundle:e},e.route))})}),(0,eT.jsx)(oS,{title:"Budget",children:(0,eT.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.totalBundleKb}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"KB shared JS"})]}),(0,eT.jsxs)("div",{className:"flex flex-col",children:[(0,eT.jsx)("span",{className:"font-mono text-2xl font-semibold tabular-nums text-[color:var(--sev-ok)]",children:i}),(0,eT.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"KB recoverable"})]})]})})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)(e0,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Optimization opportunities"}),(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-xs",children:r.length}),(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e=>!e),className:(0,ny.cn)("ml-auto inline-flex items-center gap-1.5 rounded-sm border border-border px-2.5 py-1 font-mono text-[10px] uppercase transition-colors",t?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)(eq,{className:"size-3"}),"Has savings"]})]}),0===r.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No optimization opportunities in this view."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:r.map(e=>(0,eT.jsx)(xn,{finding:e},e.id))})]})]})]})}let xi=eL("circle-minus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]]);function xa(e){return e>=80?"var(--sev-ok)":e>=50?"var(--sev-medium)":e>0?"var(--sev-high)":"var(--sev-critical)"}function xs({label:e,value:t}){let n=xa(t);return(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,eT.jsx)("span",{className:"text-muted-foreground",children:e}),(0,eT.jsxs)("span",{className:"font-mono tabular-nums",style:{color:n},children:[t,"%"]})]}),(0,eT.jsx)("div",{className:"h-1.5 w-full overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("span",{className:"block h-full rounded-full",style:{width:`${t}%`,background:n}})})]})}function xo({finding:e}){let{viewIssue:t}=l$(),n=oV(e.severity);return(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:()=>t(o6(e)),onKeyDown:n=>{("Enter"===n.key||" "===n.key)&&(n.preventDefault(),t(o6(e)))},className:"flex w-full cursor-pointer items-start gap-3 border-t border-border p-4 text-left transition-colors first:border-t-0 hover:bg-secondary/40",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("mt-0.5 size-2 shrink-0 rounded-full",n.dot),"aria-hidden":!0}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)(nS,{className:(0,ny.cn)("border-0 font-mono text-[10px] uppercase",n.bg,n.text),children:n.label}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:e.kind.replace(/-/g," ")})]}),(0,eT.jsx)("p",{className:"mt-1.5 text-pretty text-sm leading-relaxed text-foreground",children:e.title}),(0,eT.jsxs)("span",{className:"mt-1 block truncate font-mono text-[10px] text-muted-foreground",children:[e.filePath,e.line?`:${e.line}`:""]})]}),(0,eT.jsx)(lM,{issue:o6(e),variant:"dot",className:"mt-0.5"}),(0,eT.jsx)(a4,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"})]})}function xl({suite:e,expanded:t,onToggle:n}){let r="failed"===e.status,i=e.tests??[];return(0,eT.jsxs)("div",{className:"border-t border-border first:border-t-0",children:[(0,eT.jsxs)("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),n())},className:"flex w-full cursor-pointer items-center justify-between gap-3 p-4 transition-colors hover:bg-secondary/40",children:[(0,eT.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,eT.jsx)("div",{className:"inline-flex size-4 shrink-0 items-center justify-center",children:(0,eT.jsx)(a4,{className:(0,ny.cn)("size-4 transition-transform",t&&"rotate-90")})}),r?(0,eT.jsx)(i5,{className:"size-4 shrink-0 text-[color:var(--sev-critical)]"}):(0,eT.jsx)(da,{className:"size-4 shrink-0 text-[color:var(--sev-ok)]"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("span",{className:"block truncate font-mono text-sm text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"truncate font-mono text-[10px] text-muted-foreground",children:e.filePath})]})]}),(0,eT.jsxs)("div",{className:"flex shrink-0 items-center gap-2 font-mono text-[10px] tabular-nums",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-[color:var(--sev-ok)]",children:[(0,eT.jsx)(da,{className:"size-3"}),e.passed]}),e.failed>0&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-[color:var(--sev-critical)]",children:[(0,eT.jsx)(i5,{className:"size-3"}),e.failed]}),e.skipped>0&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[(0,eT.jsx)(xi,{className:"size-3"}),e.skipped]}),(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[(0,eT.jsx)(i4,{className:"size-3"}),(e.durationMs/1e3).toFixed(1),"s"]})]})]}),t&&i.length>0&&(0,eT.jsx)("div",{className:"border-t border-border/50 bg-secondary/20",children:(0,eT.jsx)("div",{className:"flex flex-col divide-y divide-border/50",children:i.map(e=>(0,eT.jsxs)("div",{className:"flex flex-col gap-2 p-3 font-mono text-xs",children:[(0,eT.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,eT.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:["passed"===e.status?(0,eT.jsx)(da,{className:"size-3.5 shrink-0 text-[color:var(--sev-ok)]"}):"failed"===e.status?(0,eT.jsx)(i5,{className:"size-3.5 shrink-0 text-[color:var(--sev-critical)]"}):(0,eT.jsx)(xi,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,eT.jsx)("span",{className:(0,ny.cn)("truncate font-medium","failed"===e.status?"text-foreground":"text-muted-foreground"),children:e.name})]}),null!=e.durationMs&&(0,eT.jsxs)("span",{className:"shrink-0 text-muted-foreground/70",children:[(e.durationMs/1e3).toFixed(2),"s"]})]}),e.error&&(0,eT.jsx)("div",{className:"ml-5 rounded-sm border border-[color:var(--sev-critical)]/20 bg-[color:var(--sev-critical)]/5 px-2 py-1.5 text-[10px]",children:(0,eT.jsx)("div",{className:"font-semibold text-[color:var(--sev-critical)]",children:e.error})}),e.assertions&&e.assertions.length>0&&(0,eT.jsx)("div",{className:"ml-5 flex flex-col gap-1",children:e.assertions.map((e,t)=>(0,eT.jsxs)("div",{className:"flex items-start gap-2 text-muted-foreground/80",children:[(0,eT.jsx)("span",{className:"mt-0.5 inline-flex size-1.5 shrink-0 rounded-full bg-current"}),(0,eT.jsx)("span",{className:"truncate",children:e})]},t))})]},e.name))})})]})}function xd({file:e}){let t=xa(e.lines);return(0,eT.jsxs)("div",{className:"flex items-center gap-3 border-t border-border p-4 first:border-t-0",children:[(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("span",{className:"block truncate font-mono text-sm text-foreground",children:e.filePath}),(0,eT.jsx)("div",{className:"mt-1.5 h-1.5 w-full overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("span",{className:"block h-full rounded-full",style:{width:`${e.lines}%`,background:t}})})]}),(0,eT.jsxs)("div",{className:"flex shrink-0 flex-col items-end",children:[(0,eT.jsxs)("span",{className:"font-mono text-sm tabular-nums",style:{color:t},children:[e.lines,"%"]}),(0,eT.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground",children:"lines"})]})]})}function xc({tests:e}){let[t,n]=(0,eP.useState)("findings"),[r,i]=(0,eP.useState)(new Set),a=(0,eP.useMemo)(()=>[...e.findings].sort((e,t)=>oV(t.severity).rank-oV(e.severity).rank),[e.findings]),s=(0,eP.useMemo)(()=>[...e.suites].sort((e,t)=>t.failed-e.failed||t.durationMs-e.durationMs),[e.suites]),o=(0,eP.useMemo)(()=>[...e.files].sort((e,t)=>e.lines-t.lines),[e.files]),l=e.counts.total?Math.round(e.counts.passed/e.counts.total*100):0,d=[{key:"findings",label:"Findings",count:a.length},{key:"suites",label:"Suites",count:s.length},{key:"coverage",label:"Coverage",count:o.length}];return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[(0,eT.jsxs)(s8,{className:"gap-2 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Pass rate"}),(0,eT.jsxs)("span",{className:"font-mono text-3xl font-semibold tabular-nums",style:{color:e.counts.failed>0?"var(--sev-high)":"var(--sev-ok)"},children:[l,"%"]}),(0,eT.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.counts.passed,"/",e.counts.total," passing · ",e.counts.skipped," skipped"]})]}),(0,eT.jsxs)(s8,{className:"gap-2 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Failing"}),(0,eT.jsx)("span",{className:"font-mono text-3xl font-semibold tabular-nums",style:{color:e.counts.failed>0?"var(--sev-critical)":"var(--sev-ok)"},children:e.counts.failed}),(0,eT.jsxs)("span",{className:"text-xs text-muted-foreground",children:["across ",e.counts.suites," suites"]})]}),(0,eT.jsxs)(s8,{className:"gap-2 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Line coverage"}),(0,eT.jsxs)("span",{className:"font-mono text-3xl font-semibold tabular-nums",style:{color:xa(e.coverage.lines)},children:[e.coverage.lines,"%"]}),(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:e.framework})]}),(0,eT.jsxs)(s8,{className:"gap-2 p-4",children:[(0,eT.jsx)("span",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground",children:"Duration"}),(0,eT.jsxs)("span",{className:"font-mono text-3xl font-semibold tabular-nums text-foreground",children:[(e.counts.durationMs/1e3).toFixed(1),"s"]}),(0,eT.jsx)("span",{className:"text-xs text-muted-foreground",children:"full suite run"})]})]}),(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_280px]",children:[(0,eT.jsx)("aside",{className:"flex flex-col gap-4 lg:order-last lg:sticky lg:top-20 lg:self-start",children:(0,eT.jsx)(oS,{title:"Coverage breakdown",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,eT.jsx)(xs,{label:"Lines",value:e.coverage.lines}),(0,eT.jsx)(xs,{label:"Functions",value:e.coverage.functions}),(0,eT.jsx)(xs,{label:"Branches",value:e.coverage.branches}),(0,eT.jsx)(xs,{label:"Statements",value:e.coverage.statements})]})})}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1 rounded-sm border border-border bg-card p-1",children:d.map(e=>(0,eT.jsxs)("button",{type:"button",onClick:()=>n(e.key),className:(0,ny.cn)("flex items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm transition-colors",t===e.key?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground"),children:[e.label,(0,eT.jsx)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.count})]},e.key))}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(e1,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"findings"===t?"Test findings":"suites"===t?"Test suites":"Lowest coverage files"})]}),"findings"===t&&(0===a.length?(0,eT.jsxs)(s8,{className:"flex items-center gap-3 p-6 text-sm text-muted-foreground",children:[(0,eT.jsx)(eV,{className:"size-5 text-[color:var(--sev-ok)]"}),"No test findings — suite is healthy."]}):(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:a.map(e=>(0,eT.jsx)(xo,{finding:e},e.id))})),"suites"===t&&(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:s.map(e=>(0,eT.jsx)(xl,{suite:e,expanded:r.has(e.id),onToggle:()=>{var t;let n;return t=e.id,void((n=new Set(r)).has(t)?n.delete(t):n.add(t),i(n))}},e.id))}),"coverage"===t&&(0,eT.jsx)(s8,{className:"gap-0 overflow-hidden py-0",children:o.map(e=>(0,eT.jsx)(xd,{file:e},e.filePath))})]})]})]})}let xu=eL("sun-moon",[["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715",key:"xlf6rm"}],["path",{d:"M16 12a4 4 0 0 0-4-4",key:"6vsxu"}],["path",{d:"m19 5-1.256 1.256",key:"1yg6a6"}],["path",{d:"M20 12h2",key:"1q8mjw"}]]);var xm=/[\\\/_+.#"@\[\(\{&]/,xp=/[\\\/_+.#"@\[\(\{&]/g,xf=/[\s-]/,xh=/[\s-]/g;function xg(e){return e.toLowerCase().replace(xh," ")}function xx(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function xv(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function xy(...e){return t=>{let n=!1,r=e.map(e=>{let r=xv(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];"function"==typeof n?n():xv(e[t],null)}}}}function xb(...e){return eP.useCallback(xy(...e),e)}"u">typeof window&&window.document&&window.document.createElement;var xk=globalThis?.document?eP.useLayoutEffect:()=>{},xj=eP[" useId ".trim().toString()]||(()=>void 0),xw=0;function xN(e){let[t,n]=eP.useState(xj());return xk(()=>{e||n(e=>e??String(xw++))},[e]),e||(t?`radix-${t}`:"")}eP[" useEffectEvent ".trim().toString()],eP[" useInsertionEffect ".trim().toString()];var x_=eP[" useInsertionEffect ".trim().toString()]||xk;function xS(e){let t=eP.forwardRef((t,n)=>{var r;let i,a,{children:s,...o}=t,l=null,d=!1,c=[];xC(s)&&"function"==typeof xP&&(s=xP(s._payload)),eP.Children.forEach(s,e=>{var t;if(t=e,eP.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===x$){d=!0;let t="child"in e.props?e.props.child:e.props.children;xC(t)&&"function"==typeof xP&&(t=xP(t._payload)),l=xI(e,t),c.push(l?.props?.children)}else c.push(e)}),l?l=eP.cloneElement(l,void 0,c):!d&&1===eP.Children.count(s)&&eP.isValidElement(s)&&(l=s);let u=l?(r=l,(a=(i=Object.getOwnPropertyDescriptor(r.props,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?r.ref:(a=(i=Object.getOwnPropertyDescriptor(r,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?r.props.ref:r.props.ref||r.ref):void 0,m=xb(n,u);if(!l){if(s||0===s)throw Error(d?xT(e):xA(e));return s}let p=function(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]={...i,...a}:"className"===r&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}(o,l.props??{});return l.type!==eP.Fragment&&(p.ref=n?m:u),eP.cloneElement(l,p)});return t.displayName=`${e}.Slot`,t}Symbol("RADIX:SYNC_STATE");var x$=Symbol.for("radix.slottable"),xI=(e,t)=>{if("child"in e.props){let t=e.props.child;return eP.isValidElement(t)?eP.cloneElement(t,void 0,e.props.children(t.props.children)):null}return eP.isValidElement(t)?t:null},xE=Symbol.for("react.lazy");function xC(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===xE&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var xA=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,xT=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,xP=eP[" use ".trim().toString()],xz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=xS(`Primitive.${t}`),r=eP.forwardRef((e,r)=>{let{asChild:i,...a}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,eT.jsx)(i?n:t,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function xO(e){let t=eP.useRef(e);return eP.useEffect(()=>{t.current=e}),eP.useMemo(()=>(...e)=>t.current?.(...e),[])}var xM="dismissableLayer.update",xR=eP.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),xD=eP.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:o,onDismiss:l,...d}=e,c=eP.useContext(xR),[u,m]=eP.useState(null),p=u?.ownerDocument??globalThis?.document,[,f]=eP.useState({}),h=xb(t,e=>m(e)),g=Array.from(c.layers),[x]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(x),y=u?g.indexOf(u):-1,b=c.layersWithOutsidePointerEventsDisabled.size>0,k=y>=v,j=eP.useRef(!1),w=function(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a}=t,s=xO(e),o=eP.useRef(!1),l=eP.useRef(!1),d=eP.useRef(new Map),c=eP.useRef(()=>{});return eP.useEffect(()=>{function e(){l.current=!1,i.current=!1,d.current.clear()}function t(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),"click"===e.type&&window.setTimeout(()=>{l.current&&c.current()},0)}function u(e){l.current&&d.current.set(e.type,!1)}let m=t=>{if(t.target&&!o.current){let a=function(){n.removeEventListener("click",c.current);let t=Array.from(d.current.values()).some(Boolean);e(),t||xU("dismissableLayer.pointerDownOutside",s,o,{discrete:!0})},o={originalEvent:t};l.current=!0,i.current=r&&0===t.button,d.current.clear(),r&&0===t.button?(n.removeEventListener("click",c.current),c.current=a,n.addEventListener("click",c.current,{once:!0})):a()}else n.removeEventListener("click",c.current),e();o.current=!1},p=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let e of p)n.addEventListener(e,t,!0),n.addEventListener(e,u);let f=window.setTimeout(()=>{n.addEventListener("pointerdown",m)},0);return()=>{for(let e of(window.clearTimeout(f),n.removeEventListener("pointerdown",m),n.removeEventListener("click",c.current),p))n.removeEventListener(e,t,!0),n.removeEventListener(e,u)}},[n,s,r,i,a]),{onPointerDownCapture:()=>o.current=!0}}(e=>{let t=e.target;if(!(t instanceof Node))return;let n=[...c.branches].some(e=>e.contains(t));k&&!n&&(a?.(e),o?.(e),e.defaultPrevented||l?.())},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:j,dismissableSurfaces:c.dismissableSurfaces}),N=function(e,t=globalThis?.document){let n=xO(e),r=eP.useRef(!1);return eP.useEffect(()=>{let e=e=>{e.target&&!r.current&&xU("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}(e=>{if(r&&j.current)return;let t=e.target;![...c.branches].some(e=>e.contains(t))&&(s?.(e),o?.(e),e.defaultPrevented||l?.())},p);return!function(e,t=globalThis?.document){let n=xO(e);eP.useEffect(()=>{let e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{y===c.layers.size-1&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},p),eP.useEffect(()=>{if(u)return n&&(0===c.layersWithOutsidePointerEventsDisabled.size&&(I=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),xL(),()=>{n&&(c.layersWithOutsidePointerEventsDisabled.delete(u),0===c.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=I))}},[u,p,n,c]),eP.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),xL())},[u,c]),eP.useEffect(()=>{let e=()=>f({});return document.addEventListener(xM,e),()=>document.removeEventListener(xM,e)},[]),(0,eT.jsx)(xz.div,{...d,ref:h,style:{pointerEvents:b?k?"auto":"none":void 0,...e.style},onFocusCapture:xx(e.onFocusCapture,N.onFocusCapture),onBlurCapture:xx(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:xx(e.onPointerDownCapture,w.onPointerDownCapture)})});function xL(){let e=new CustomEvent(xM);document.dispatchEvent(e)}function xU(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});if(t&&i.addEventListener(e,t,{once:!0}),r)i&&aG.flushSync(()=>i.dispatchEvent(a));else i.dispatchEvent(a)}xD.displayName="DismissableLayer",eP.forwardRef((e,t)=>{let n=eP.useContext(xR),r=eP.useRef(null),i=xb(t,r);return eP.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,eT.jsx)(xz.div,{...e,ref:i})}).displayName="DismissableLayerBranch";var xZ="focusScope.autoFocusOnMount",xF="focusScope.autoFocusOnUnmount",xB={bubbles:!1,cancelable:!0},xV=eP.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...s}=e,[o,l]=eP.useState(null),d=xO(i),c=xO(a),u=eP.useRef(null),m=xb(t,e=>l(e)),p=eP.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;eP.useEffect(()=>{if(r){let e=function(e){if(p.paused||!o)return;let t=e.target;o.contains(t)?u.current=t:xH(u.current,{select:!0})},t=function(e){if(p.paused||!o)return;let t=e.relatedTarget;null!==t&&(o.contains(t)||xH(u.current,{select:!0}))};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let n=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&xH(o)});return o&&n.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[r,o,p.paused]),eP.useEffect(()=>{if(o){xG.add(p);let e=document.activeElement;if(!o.contains(e)){let t=new CustomEvent(xZ,xB);o.addEventListener(xZ,d),o.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(xH(r,{select:t}),document.activeElement!==n)return}(xq(o).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&xH(o))}return()=>{o.removeEventListener(xZ,d),setTimeout(()=>{let t=new CustomEvent(xF,xB);o.addEventListener(xF,c),o.dispatchEvent(t),t.defaultPrevented||xH(e??document.body,{select:!0}),o.removeEventListener(xF,c),xG.remove(p)},0)}}},[o,d,c,p]);let f=eP.useCallback(e=>{if(!n&&!r||p.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){var a;let t,r=e.currentTarget,[s,o]=[xW(t=xq(a=r),a),xW(t.reverse(),a)];s&&o?e.shiftKey||i!==o?e.shiftKey&&i===s&&(e.preventDefault(),n&&xH(o,{select:!0})):(e.preventDefault(),n&&xH(s,{select:!0})):i===r&&e.preventDefault()}},[n,r,p.paused]);return(0,eT.jsx)(xz.div,{tabIndex:-1,...s,ref:m,onKeyDown:f})});function xq(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function xW(e,t){for(let n of e)if(!function(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(n,{upTo:t}))return n}function xH(e,{select:t=!1}={}){if(e&&e.focus){var n;let r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&(n=e)instanceof HTMLInputElement&&"select"in n&&t&&e.select()}}xV.displayName="FocusScope";var xG=(r=[],{add(e){let t=r[0];e!==t&&t?.pause(),(r=xK(r,e)).unshift(e)},remove(e){r=xK(r,e),r[0]?.resume()}});function xK(e,t){let n=[...e],r=n.indexOf(t);return -1!==r&&n.splice(r,1),n}var xJ=eP.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=eP.useState(!1);xk(()=>a(!0),[]);let s=n||i&&globalThis?.document?.body;return s?aG.createPortal((0,eT.jsx)(xz.div,{...r,ref:t}),s):null});xJ.displayName="Portal";var xY=e=>{var t;let n,r,{present:i,children:a}=e,s=function(e){var t,n;let[r,i]=eP.useState(),a=eP.useRef(null),s=eP.useRef(e),o=eP.useRef("none"),[l,d]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},eP.useReducer((e,t)=>n[e][t]??e,t));return eP.useEffect(()=>{let e=xQ(a.current);o.current="mounted"===l?e:"none"},[l]),xk(()=>{let t=a.current,n=s.current;if(n!==e){let r=o.current,i=xQ(t);e?d("MOUNT"):"none"===i||t?.display==="none"?d("UNMOUNT"):n&&r!==i?d("ANIMATION_OUT"):d("UNMOUNT"),s.current=e}},[e,d]),xk(()=>{if(r){let e,t=r.ownerDocument.defaultView??window,n=n=>{let i=xQ(a.current).includes(CSS.escape(n.animationName));if(n.target===r&&i&&(d("ANIMATION_END"),!s.current)){let n=r.style.animationFillMode;r.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=n)})}},i=e=>{e.target===r&&(o.current=xQ(a.current))};return r.addEventListener("animationstart",i),r.addEventListener("animationcancel",n),r.addEventListener("animationend",n),()=>{t.clearTimeout(e),r.removeEventListener("animationstart",i),r.removeEventListener("animationcancel",n),r.removeEventListener("animationend",n)}}d("ANIMATION_END")},[r,d]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:eP.useCallback(e=>{a.current=e?getComputedStyle(e):null,i(e)},[])}}(i),o="function"==typeof a?a({present:s.isPresent}):eP.Children.only(a),l=function(...e){let t=eP.useRef(e);return t.current=e,eP.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=xX(t,e);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];"function"==typeof t?t():xX(n[e],null)}}},[])}(s.ref,(t=o,(r=(n=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in n&&n.isReactWarning)?t.ref:(r=(n=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in n&&n.isReactWarning)?t.props.ref:t.props.ref||t.ref));return"function"==typeof a||s.isPresent?eP.cloneElement(o,{ref:l}):null};function xX(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function xQ(e){return e?.animationName||"none"}xY.displayName="Presence";var x0=0,x1=null;function x2(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var x4=function(){return(x4=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function x5(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var x6=("function"==typeof SuppressedError&&SuppressedError,"right-scroll-bar-position"),x3="width-before-scroll-bar";function x9(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var x8="u">typeof window?eP.useLayoutEffect:eP.useEffect,x7=new WeakMap,ve=(void 0===h&&(h={}),(void 0===g&&(g=function(e){return e}),x=[],v=!1,y={read:function(){if(v)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return x.length?x[x.length-1]:null},useMedium:function(e){var t=g(e,v);return x.push(t),function(){x=x.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(v=!0;x.length;){var t=x;x=[],t.forEach(e)}x={push:function(t){return e(t)},filter:function(){return x}}},assignMedium:function(e){v=!0;var t=[];if(x.length){var n=x;x=[],n.forEach(e),t=x}var r=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(r)};i(),x={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),x}}}}).options=x4({async:!0,ssr:!1},h),y),vt=function(){},vn=eP.forwardRef(function(e,t){var n,r,i,a,s=eP.useRef(null),o=eP.useState({onScrollCapture:vt,onWheelCapture:vt,onTouchMoveCapture:vt}),l=o[0],d=o[1],c=e.forwardProps,u=e.children,m=e.className,p=e.removeScrollBar,f=e.enabled,h=e.shards,g=e.sideCar,x=e.noRelative,v=e.noIsolation,y=e.inert,b=e.allowPinchZoom,k=e.as,j=e.gapMode,w=x5(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=(n=[s,t],r=function(e){return n.forEach(function(t){return x9(t,e)})},(i=(0,eP.useState)(function(){return{value:null,callback:r,facade:{get current(){return i.value},set current(value){var e=i.value;e!==value&&(i.value=value,i.callback(value,e))}}}})[0]).callback=r,a=i.facade,x8(function(){var e=x7.get(a);if(e){var t=new Set(e),r=new Set(n),i=a.current;t.forEach(function(e){r.has(e)||x9(e,null)}),r.forEach(function(e){t.has(e)||x9(e,i)})}x7.set(a,n)},[n]),a),_=x4(x4({},w),l);return eP.createElement(eP.Fragment,null,f&&eP.createElement(g,{sideCar:ve,removeScrollBar:p,shards:h,noRelative:x,noIsolation:v,inert:y,setCallbacks:d,allowPinchZoom:!!b,lockRef:s,gapMode:j}),c?eP.cloneElement(eP.Children.only(u),x4(x4({},_),{ref:N})):eP.createElement(void 0===k?"div":k,x4({},_,{className:m,ref:N}),u))});vn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},vn.classNames={fullWidth:x3,zeroRight:x6};var vr=function(e){var t=e.sideCar,n=x5(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error("Sidecar medium not found");return eP.createElement(r,x4({},n))};vr.isSideCarExport=!0;var vi=function(){var e=0,t=null;return{add:function(n){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=E||("u">typeof __webpack_nonce__?__webpack_nonce__:void 0);return t&&e.setAttribute("nonce",t),e}())){var r,i;(r=t).styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),i=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(i)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},va=function(){var e=vi();return function(t,n){eP.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},vs=function(){var e=va();return function(t){return e(t.styles,t.dynamic),null}},vo={left:0,top:0,right:0,gap:0},vl=function(e){return parseInt(e||"",10)||0},vd=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],i=t["padding"===e?"paddingRight":"marginRight"];return[vl(n),vl(r),vl(i)]},vc=function(e){if(void 0===e&&(e="margin"),"u"<typeof window)return vo;var t=vd(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},vu=vs(),vm="data-scroll-locked",vp=function(e,t,n,r){var i=e.left,a=e.top,s=e.right,o=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(o,"px ").concat(r,";\n }\n body[").concat(vm,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(i,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(o,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(o,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(x6," {\n right: ").concat(o,"px ").concat(r,";\n }\n \n .").concat(x3," {\n margin-right: ").concat(o,"px ").concat(r,";\n }\n \n .").concat(x6," .").concat(x6," {\n right: 0 ").concat(r,";\n }\n \n .").concat(x3," .").concat(x3," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(vm,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(o,"px;\n }\n")},vf=function(){var e=parseInt(document.body.getAttribute(vm)||"0",10);return isFinite(e)?e:0},vh=function(){eP.useEffect(function(){return document.body.setAttribute(vm,(vf()+1).toString()),function(){var e=vf()-1;e<=0?document.body.removeAttribute(vm):document.body.setAttribute(vm,e.toString())}},[])},vg=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=void 0===r?"margin":r;vh();var a=eP.useMemo(function(){return vc(i)},[i]);return eP.createElement(vu,{styles:vp(a,!t,i,n?"":"!important")})},vx=!1;if("u">typeof window)try{var vv=Object.defineProperty({},"passive",{get:function(){return vx=!0,!0}});window.addEventListener("test",vv,vv),window.removeEventListener("test",vv,vv)}catch(e){vx=!1}var vy=!!vx&&{passive:!1},vb=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&(n.overflowY!==n.overflowX||"TEXTAREA"===e.tagName||"visible"!==n[t])},vk=function(e,t){var n=t.ownerDocument,r=t;do{if("u">typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),vj(e,r)){var i=vw(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body)return!1},vj=function(e,t){return"v"===e?vb(t,"overflowY"):vb(t,"overflowX")},vw=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},vN=function(e,t,n,r,i){var a,s=(a=window.getComputedStyle(t).direction,"h"===e&&"rtl"===a?-1:1),o=s*r,l=n.target,d=t.contains(l),c=!1,u=o>0,m=0,p=0;do{if(!l)break;var f=vw(e,l),h=f[0],g=f[1]-f[2]-s*h;(h||g)&&vj(e,l)&&(m+=g,p+=h);var x=l.parentNode;l=x&&x.nodeType===Node.DOCUMENT_FRAGMENT_NODE?x.host:x}while(!d&&l!==document.body||d&&(t.contains(l)||t===l))return u&&(i&&1>Math.abs(m)||!i&&o>m)?c=!0:!u&&(i&&1>Math.abs(p)||!i&&-o>p)&&(c=!0),c},v_=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},vS=function(e){return[e.deltaX,e.deltaY]},v$=function(e){return e&&"current"in e?e.current:e},vI=0,vE=[];let vC=(b=function(e){var t=eP.useRef([]),n=eP.useRef([0,0]),r=eP.useRef(),i=eP.useState(vI++)[0],a=eP.useState(vs)[0],s=eP.useRef(e);eP.useEffect(function(){s.current=e},[e]),eP.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var t=(function(e,t,n){if(n||2==arguments.length)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))})([e.lockRef.current],(e.shards||[]).map(v$),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var o=eP.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var i,a=v_(e),o=n.current,l="deltaX"in e?e.deltaX:o[0]-a[0],d="deltaY"in e?e.deltaY:o[1]-a[1],c=e.target,u=Math.abs(l)>Math.abs(d)?"h":"v";if("touches"in e&&"h"===u&&"range"===c.type)return!1;var m=window.getSelection(),p=m&&m.anchorNode;if(p&&(p===c||p.contains(c)))return!1;var f=vk(u,c);if(!f)return!0;if(f?i=u:(i="v"===u?"h":"v",f=vk(u,c)),!f)return!1;if(!r.current&&"changedTouches"in e&&(l||d)&&(r.current=i),!i)return!0;var h=r.current||i;return vN(h,t,e,"h"===h?l:d,!0)},[]),l=eP.useCallback(function(e){if(vE.length&&vE[vE.length-1]===a){var n="deltaY"in e?vS(e):v_(e),r=t.current.filter(function(t){var r;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(r=t.delta,r[0]===n[0]&&r[1]===n[1])})[0];if(r&&r.should){e.cancelable&&e.preventDefault();return}if(!r){var i=(s.current.shards||[]).map(v$).filter(Boolean).filter(function(t){return t.contains(e.target)});(i.length>0?o(e,i[0]):!s.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),d=eP.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),c=eP.useCallback(function(e){n.current=v_(e),r.current=void 0},[]),u=eP.useCallback(function(t){d(t.type,vS(t),t.target,o(t,e.lockRef.current))},[]),m=eP.useCallback(function(t){d(t.type,v_(t),t.target,o(t,e.lockRef.current))},[]);eP.useEffect(function(){return vE.push(a),e.setCallbacks({onScrollCapture:u,onWheelCapture:u,onTouchMoveCapture:m}),document.addEventListener("wheel",l,vy),document.addEventListener("touchmove",l,vy),document.addEventListener("touchstart",c,vy),function(){vE=vE.filter(function(e){return e!==a}),document.removeEventListener("wheel",l,vy),document.removeEventListener("touchmove",l,vy),document.removeEventListener("touchstart",c,vy)}},[]);var p=e.removeScrollBar,f=e.inert;return eP.createElement(eP.Fragment,null,f?eP.createElement(a,{styles:"\n .block-interactivity-".concat(i," {pointer-events: none;}\n .allow-interactivity-").concat(i," {pointer-events: all;}\n")}):null,p?eP.createElement(vg,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},ve.useMedium(b),vr);var vA=eP.forwardRef(function(e,t){return eP.createElement(vn,x4({},e,{ref:t,sideCar:vC}))});vA.classNames=vn.classNames;var vT=new WeakMap,vP=new WeakMap,vz={},vO=0,vM=function(e){return e&&(e.host||vM(e.parentNode))},vR=function(e,t,n,r){var i=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var n=vM(e);return n&&t.contains(n)?n:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});vz[n]||(vz[n]=new WeakMap);var a=vz[n],s=[],o=new Set,l=new Set(i),d=function(e){!e||o.has(e)||(o.add(e),d(e.parentNode))};i.forEach(d);var c=function(e){!e||l.has(e)||Array.prototype.forEach.call(e.children,function(e){if(o.has(e))c(e);else try{var t=e.getAttribute(r),i=null!==t&&"false"!==t,l=(vT.get(e)||0)+1,d=(a.get(e)||0)+1;vT.set(e,l),a.set(e,d),s.push(e),1===l&&i&&vP.set(e,!0),1===d&&e.setAttribute(n,"true"),i||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return c(t),o.clear(),vO++,function(){s.forEach(function(e){var t=vT.get(e)-1,i=a.get(e)-1;vT.set(e,t),a.set(e,i),t||(vP.has(e)||e.removeAttribute(r),vP.delete(e)),i||e.removeAttribute(n)}),--vO||(vT=new WeakMap,vT=new WeakMap,vP=new WeakMap,vz={})}},vD=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||("u"<typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),vR(r,i,n,"aria-hidden")):function(){return null}},vL="Dialog",[vU,vZ]=function(e,t=[]){let n=[],r=()=>{let t=n.map(e=>eP.createContext(e));return function(n){let r=n?.[e]||t;return eP.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return r.scopeName=e,[function(t,r){let i=eP.createContext(r);i.displayName=t+"Context";let a=n.length;n=[...n,r];let s=t=>{let{scope:n,children:r,...s}=t,o=n?.[e]?.[a]||i,l=eP.useMemo(()=>s,Object.values(s));return(0,eT.jsx)(o.Provider,{value:l,children:r})};return s.displayName=t+"Provider",[s,function(n,s){let o=s?.[e]?.[a]||i,l=eP.useContext(o);if(l)return l;if(void 0!==r)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return eP.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}(r,...t)]}(vL),[vF,vB]=vU(vL),vV=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:s=!0}=e,o=eP.useRef(null),l=eP.useRef(null),[d,c]=function({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,s]=function({defaultProp:e,onChange:t}){let[n,r]=eP.useState(e),i=eP.useRef(n),a=eP.useRef(t);return x_(()=>{a.current=t},[t]),eP.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}({defaultProp:t,onChange:n}),o=void 0!==e,l=o?e:i;{let t=eP.useRef(void 0!==e);eP.useEffect(()=>{let e=t.current;if(e!==o){let t=o?"controlled":"uncontrolled";console.warn(`${r} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=o},[o,r])}return[l,eP.useCallback(t=>{if(o){let n="function"==typeof t?t(e):t;n!==e&&s.current?.(n)}else a(t)},[o,e,a,s])]}({prop:r,defaultProp:i??!1,onChange:a,caller:vL});return(0,eT.jsx)(vF,{scope:t,triggerRef:o,contentRef:l,contentId:xN(),titleId:xN(),descriptionId:xN(),open:d,onOpenChange:c,onOpenToggle:eP.useCallback(()=>c(e=>!e),[c]),modal:s,children:n})};vV.displayName=vL;var vq="DialogTrigger";eP.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=vB(vq,n),a=xb(t,i.triggerRef);return(0,eT.jsx)(xz.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":v8(i.open),...r,ref:a,onClick:xx(e.onClick,i.onOpenToggle)})}).displayName=vq;var vW="DialogPortal",[vH,vG]=vU(vW,{forceMount:void 0}),vK=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=vB(vW,t);return(0,eT.jsx)(vH,{scope:t,forceMount:n,children:eP.Children.map(r,e=>(0,eT.jsx)(xY,{present:n||a.open,children:(0,eT.jsx)(xJ,{asChild:!0,container:i,children:e})}))})};vK.displayName=vW;var vJ="DialogOverlay",vY=eP.forwardRef((e,t)=>{let n=vG(vJ,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=vB(vJ,e.__scopeDialog);return a.modal?(0,eT.jsx)(xY,{present:r||a.open,children:(0,eT.jsx)(vQ,{...i,ref:t})}):null});vY.displayName=vJ;var vX=xS("DialogOverlay.RemoveScroll"),vQ=eP.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=vB(vJ,n),a=xb(t,function(){let e=eP.useContext(xR),[t,n]=eP.useState(null);return eP.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}());return(0,eT.jsx)(vA,{as:vX,allowPinchZoom:!0,shards:[i.contentRef],children:(0,eT.jsx)(xz.div,{"data-state":v8(i.open),...r,ref:a,style:{pointerEvents:"auto",...r.style}})})}),v0="DialogContent",v1=eP.forwardRef((e,t)=>{let n=vG(v0,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=vB(v0,e.__scopeDialog);return(0,eT.jsx)(xY,{present:r||a.open,children:a.modal?(0,eT.jsx)(v2,{...i,ref:t}):(0,eT.jsx)(v4,{...i,ref:t})})});v1.displayName=v0;var v2=eP.forwardRef((e,t)=>{let n=vB(v0,e.__scopeDialog),r=eP.useRef(null),i=xb(t,n.contentRef,r);return eP.useEffect(()=>{let e=r.current;if(e)return vD(e)},[]),(0,eT.jsx)(v5,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:xx(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:xx(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:xx(e.onFocusOutside,e=>e.preventDefault())})}),v4=eP.forwardRef((e,t)=>{let n=vB(v0,e.__scopeDialog),r=eP.useRef(!1),i=eP.useRef(!1);return(0,eT.jsx)(v5,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,"pointerdown"===t.detail.originalEvent.type&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),v5=eP.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...s}=e,o=vB(v0,n);return eP.useEffect(()=>{x1||(x1={start:x2(),end:x2()});let{start:e,end:t}=x1;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),x0++,()=>{1===x0&&(x1?.start.remove(),x1?.end.remove(),x1=null),x0=Math.max(0,x0-1)}},[]),(0,eT.jsx)(eT.Fragment,{children:(0,eT.jsx)(xV,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,eT.jsx)(xD,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":v8(o.open),...s,ref:t,deferPointerDownOutside:!0,onDismiss:()=>o.onOpenChange(!1)})})})}),v6="DialogTitle";eP.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=vB(v6,n);return(0,eT.jsx)(xz.h2,{id:i.titleId,...r,ref:t})}).displayName=v6;var v3="DialogDescription";eP.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=vB(v3,n);return(0,eT.jsx)(xz.p,{id:i.descriptionId,...r,ref:t})}).displayName=v3;var v9="DialogClose";function v8(e){return e?"open":"closed"}eP.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=vB(v9,n);return(0,eT.jsx)(xz.button,{type:"button",...r,ref:t,onClick:xx(e.onClick,()=>i.onOpenChange(!1))})}).displayName=v9;var v7='[cmdk-group=""]',ye='[cmdk-group-items=""]',yt='[cmdk-item=""]',yn=`${yt}:not([aria-disabled="true"])`,yr="cmdk-item-select",yi="data-value",ya=(e,t,n)=>{var r;return r=e,function e(t,n,r,i,a,s,o){if(s===n.length)return a===t.length?1:.99;var l=`${a},${s}`;if(void 0!==o[l])return o[l];for(var d,c,u,m,p=i.charAt(s),f=r.indexOf(p,a),h=0;f>=0;)(d=e(t,n,r,i,f+1,s+1,o))>h&&(f===a?d*=1:xm.test(t.charAt(f-1))?(d*=.8,(u=t.slice(a,f-1).match(xp))&&a>0&&(d*=Math.pow(.999,u.length))):xf.test(t.charAt(f-1))?(d*=.9,(m=t.slice(a,f-1).match(xh))&&a>0&&(d*=Math.pow(.999,m.length))):(d*=.17,a>0&&(d*=Math.pow(.999,f-a))),t.charAt(f)!==n.charAt(s)&&(d*=.9999)),(d<.1&&r.charAt(f-1)===i.charAt(s+1)||i.charAt(s+1)===i.charAt(s)&&r.charAt(f-1)!==i.charAt(s))&&.1*(c=e(t,n,r,i,f+1,s+2,o))>d&&(d=.1*c),d>h&&(h=d),f=r.indexOf(p,f+1);return o[l]=h,h}(r=n&&n.length>0?`${r+" "+n.join(" ")}`:r,t,xg(r),xg(t),0,0,{})},ys=eP.createContext(void 0),yo=eP.createContext(void 0),yl=eP.createContext(void 0),yd=eP.forwardRef((e,t)=>{let n=yy(()=>{var t,n;return{search:"",value:null!=(n=null!=(t=e.value)?t:e.defaultValue)?n:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=yy(()=>new Set),i=yy(()=>new Map),a=yy(()=>new Map),s=yy(()=>new Set),o=yx(e),{label:l,children:d,value:c,onValueChange:u,filter:m,shouldFilter:p,loop:f,disablePointerSelection:h=!1,vimBindings:g=!0,...x}=e,v=xN(),y=xN(),b=xN(),k=eP.useRef(null),j=yj();yv(()=>{if(void 0!==c){let e=c.trim();n.current.value=e,w.emit()}},[c]),yv(()=>{j(6,E)},[]);let w=eP.useMemo(()=>({subscribe:e=>(s.current.add(e),()=>s.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,s,l;if(!Object.is(n.current[e],t)){if(n.current[e]=t,"search"===e)I(),S(),j(1,$);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(b);e?e.focus():null==(i=document.getElementById(v))||i.focus()}if(j(7,()=>{var e;n.current.selectedItemId=null==(e=C())?void 0:e.id,w.emit()}),r||j(5,E),(null==(a=o.current)?void 0:a.value)!==void 0){null==(l=(s=o.current).onValueChange)||l.call(s,null!=t?t:"");return}}w.emit()}},emit:()=>{s.current.forEach(e=>e())}}),[]),N=eP.useMemo(()=>({value:(e,t,r)=>{var i;t!==(null==(i=a.current.get(e))?void 0:i.value)&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,_(t,r)),j(2,()=>{S(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),j(3,()=>{I(),S(),n.current.value||$(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=C();j(4,()=>{I(),(null==t?void 0:t.getAttribute("id"))===e&&$(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>o.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>o.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:k}),[]);function _(e,t){var r,i;let a=null!=(i=null==(r=o.current)?void 0:r.filter)?i:ya;return e?a(e,n.current.search,t):0}function S(){if(!n.current.search||!1===o.current.shouldFilter)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{a=Math.max(e.get(t),a)}),t.push([n,a])});let r=k.current;A().sort((t,n)=>{var r,i;let a=t.getAttribute("id"),s=n.getAttribute("id");return(null!=(r=e.get(s))?r:0)-(null!=(i=e.get(a))?i:0)}).forEach(e=>{let t=e.closest(ye);t?t.appendChild(e.parentElement===t?e:e.closest(`${ye} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${ye} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let n=null==(t=k.current)?void 0:t.querySelector(`${v7}[${yi}="${encodeURIComponent(e[0])}"]`);null==n||n.parentElement.appendChild(n)})}function $(){let e=A().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(yi);w.setState("value",t||void 0)}function I(){var e,t,s,l;if(!n.current.search||!1===o.current.shouldFilter){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let d=0;for(let i of r.current){let r=_(null!=(t=null==(e=a.current.get(i))?void 0:e.value)?t:"",null!=(l=null==(s=a.current.get(i))?void 0:s.keywords)?l:[]);n.current.filtered.items.set(i,r),r>0&&d++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=d}function E(){var e,t,n;let r=C();r&&((null==(e=r.parentElement)?void 0:e.firstChild)===r&&(null==(n=null==(t=r.closest(v7))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),r.scrollIntoView({block:"nearest"}))}function C(){var e;return null==(e=k.current)?void 0:e.querySelector(`${yt}[aria-selected="true"]`)}function A(){var e;return Array.from((null==(e=k.current)?void 0:e.querySelectorAll(yn))||[])}function T(e){let t=A()[e];t&&w.setState("value",t.getAttribute(yi))}function P(e){var t;let n=C(),r=A(),i=r.findIndex(e=>e===n),a=r[i+e];null!=(t=o.current)&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState("value",a.getAttribute(yi))}function z(e){let t=C(),n=null==t?void 0:t.closest(v7),r;for(;n&&!r;)r=null==(n=e>0?function(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}(n,v7):function(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}(n,v7))?void 0:n.querySelector(yn);r?w.setState("value",r.getAttribute(yi)):P(e)}let O=()=>T(A().length-1),M=e=>{e.preventDefault(),e.metaKey?O():e.altKey?z(1):P(1)},R=e=>{e.preventDefault(),e.metaKey?T(0):e.altKey?z(-1):P(-1)};return eP.createElement(xz.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=x.onKeyDown)||t.call(x,e);let n=e.nativeEvent.isComposing||229===e.keyCode;if(!(e.defaultPrevented||n))switch(e.key){case"n":case"j":g&&e.ctrlKey&&M(e);break;case"ArrowDown":M(e);break;case"p":case"k":g&&e.ctrlKey&&R(e);break;case"ArrowUp":R(e);break;case"Home":e.preventDefault(),T(0);break;case"End":e.preventDefault(),O();break;case"Enter":{e.preventDefault();let t=C();if(t){let e=new Event(yr);t.dispatchEvent(e)}}}}},eP.createElement("label",{"cmdk-label":"",htmlFor:N.inputId,id:N.labelId,style:yN},l),yw(e,e=>eP.createElement(yo.Provider,{value:w},eP.createElement(ys.Provider,{value:N},e))))}),yc=eP.forwardRef((e,t)=>{var n,r;let i=xN(),a=eP.useRef(null),s=eP.useContext(yl),o=eP.useContext(ys),l=yx(e),d=null!=(r=null==(n=l.current)?void 0:n.forceMount)?r:null==s?void 0:s.forceMount;yv(()=>{if(!d)return o.item(i,null==s?void 0:s.id)},[d]);let c=yk(i,a,[e.value,e.children,a],e.keywords),u=eP.useContext(yo),m=yb(e=>e.value&&e.value===c.current),p=yb(e=>!!d||!1===o.filter()||!e.search||e.filtered.items.get(i)>0);function f(){var e,t;h(),null==(t=(e=l.current).onSelect)||t.call(e,c.current)}function h(){u.setState("value",c.current,!0)}if(eP.useEffect(()=>{let t=a.current;if(!(!t||e.disabled))return t.addEventListener(yr,f),()=>t.removeEventListener(yr,f)},[p,e.onSelect,e.disabled]),!p)return null;let{disabled:g,value:x,onSelect:v,forceMount:y,keywords:b,...k}=e;return eP.createElement(xz.div,{ref:xy(a,t),...k,id:i,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!m,"data-disabled":!!g,"data-selected":!!m,onPointerMove:g||o.getDisablePointerSelection()?void 0:h,onClick:g?void 0:f},e.children)}),yu=eP.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,s=xN(),o=eP.useRef(null),l=eP.useRef(null),d=xN(),c=eP.useContext(ys),u=yb(e=>!!i||!1===c.filter()||!e.search||e.filtered.groups.has(s));yv(()=>c.group(s),[]),yk(s,o,[e.value,e.heading,l]);let m=eP.useMemo(()=>({id:s,forceMount:i}),[i]);return eP.createElement(xz.div,{ref:xy(o,t),...a,"cmdk-group":"",role:"presentation",hidden:!u||void 0},n&&eP.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),yw(e,e=>eP.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},eP.createElement(yl.Provider,{value:m},e))))}),ym=eP.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=eP.useRef(null),a=yb(e=>!e.search);return n||a?eP.createElement(xz.div,{ref:xy(i,t),...r,"cmdk-separator":"",role:"separator"}):null}),yp=eP.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=null!=e.value,a=eP.useContext(yo),s=yb(e=>e.search),o=yb(e=>e.selectedItemId),l=eP.useContext(ys);return eP.useEffect(()=>{null!=e.value&&a.setState("search",e.value)},[e.value]),eP.createElement(xz.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":o,id:l.inputId,type:"text",value:i?e.value:s,onChange:e=>{i||a.setState("search",e.target.value),null==n||n(e.target.value)}})}),yf=eP.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,a=eP.useRef(null),s=eP.useRef(null),o=yb(e=>e.selectedItemId),l=eP.useContext(ys);return eP.useEffect(()=>{if(s.current&&a.current){let e=s.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty("--cmdk-list-height",n.toFixed(1)+"px")})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),eP.createElement(xz.div,{ref:xy(a,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":o,"aria-label":r,id:l.listId},yw(e,e=>eP.createElement("div",{ref:xy(s,l.listInnerRef),"cmdk-list-sizer":""},e)))}),yh=eP.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:s,...o}=e;return eP.createElement(vV,{open:n,onOpenChange:r},eP.createElement(vK,{container:s},eP.createElement(vY,{"cmdk-overlay":"",className:i}),eP.createElement(v1,{"aria-label":e.label,"cmdk-dialog":"",className:a},eP.createElement(yd,{ref:t,...o}))))}),yg=Object.assign(yd,{List:yf,Item:yc,Input:yp,Group:yu,Separator:ym,Dialog:yh,Empty:eP.forwardRef((e,t)=>yb(e=>0===e.filtered.count)?eP.createElement(xz.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Loading:eP.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...a}=e;return eP.createElement(xz.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},yw(e,e=>eP.createElement("div",{"aria-hidden":!0},e)))})});function yx(e){let t=eP.useRef(e);return yv(()=>{t.current=e}),t}var yv="u"<typeof window?eP.useEffect:eP.useLayoutEffect;function yy(e){let t=eP.useRef();return void 0===t.current&&(t.current=e()),t}function yb(e){let t=eP.useContext(yo),n=()=>e(t.snapshot());return eP.useSyncExternalStore(t.subscribe,n,n)}function yk(e,t,n,r=[]){let i=eP.useRef(),a=eP.useContext(ys);return yv(()=>{var s;let o=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():i.current}})(),l=r.map(e=>e.trim());a.value(e,o,l),null==(s=t.current)||s.setAttribute(yi,o),i.current=o}),i}var yj=()=>{let[e,t]=eP.useState(),n=yy(()=>new Map);return yv(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function yw({asChild:e,children:t},n){let r;return e&&eP.isValidElement(t)?eP.cloneElement("function"==typeof(r=t.type)?r(t.props):"render"in r?r.render(t.props):t,{ref:t.ref},n(t.props.children)):n(t)}var yN={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};e.s([],53296),e.i(53296);let y_=eP.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0}),yS=function(e){let t=(0,tj.useBaseUiId)(),n=void 0===e.controlId?t:e.controlId,[r,i]=eP.useState(n),[a,s]=eP.useState(e.labelId),[o,l]=eP.useState([]),d=(0,ts.useRefWithInit)(()=>new Map),{messageIds:c}=re(),u=(0,ti.useStableCallback)((e,t)=>{let n=d.current;void 0===t?n.delete(e):(n.set(e,t),i(e=>{let t;if(0!==n.size){for(let r of n.values()){if(void 0!==e&&r===e)return e;void 0===t&&(t=r)}return t}}))}),m=eP.useCallback(e=>(0,tN.mergeProps)({"aria-describedby":c.concat(o).join(" ")||void 0},e),[c,o]),p=eP.useMemo(()=>({controlId:r,registerControlId:u,labelId:a,setLabelId:s,messageIds:o,setMessageIds:l,getDescriptionProps:m}),[r,u,a,s,o,l,m]);return(0,eT.jsx)(n7.Provider,{value:p,children:e.children})};function y$(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}let yI=Object.keys(n1),yE=eP.forwardRef(function(e,t){let{errors:n,validationMode:r,submitAttemptedRef:i}=rp(),{render:a,className:s,validate:o,validationDebounceTime:l=0,validationMode:d=r,name:c,disabled:u=!1,invalid:m,dirty:p,touched:f,actionsRef:h,style:g,...x}=e,{disabled:v}=function(e=!1){let t=eP.useContext(y_);if(!t&&!e)throw Error((0,tm.default)(86));return t}(),y=(0,ti.useStableCallback)(o||(()=>null)),b=v||u,[k,j]=eP.useState(!1),[w,N]=eP.useState(!1),[_,S]=eP.useState(!1),[$,I]=eP.useState(!1),E=p??w,C=f??k,A=eP.useRef(!1),T=eP.useRef(void 0),P=eP.useCallback(()=>T.current,[]),z=eP.useCallback(e=>{T.current=e},[]),O=(0,ti.useStableCallback)(e=>{void 0===p&&(e&&(A.current=!0),N(e))}),M=(0,ti.useStableCallback)(e=>{void 0===f&&j(e)}),R=(0,ti.useStableCallback)(()=>"onChange"===d||"onSubmit"===d&&i.current),D=!!c&&Object.hasOwn(n,c)&&void 0!==n[c],L=!0===m||D,[U,Z]=eP.useState({state:n1,error:"",errors:[],value:null,initialValue:null}),F=!L&&U.state.valid,B=eP.useMemo(()=>({disabled:b,touched:C,dirty:E,valid:F,filled:_,focused:$}),[b,C,E,F,_,$]),V=function(e){let{formRef:t,clearErrors:n}=rp(),{setValidityData:r,validate:i,validityData:a,validationDebounceTime:s,invalid:o,markedDirtyRef:l,state:d,name:c,shouldValidateOnChange:u,getRegisteredFieldId:m}=e,{controlId:p,getDescriptionProps:f}=re(),h=(0,nz.useTimeout)(),g=eP.useRef(null),x=(0,ti.useStableCallback)(async(e,n=!1)=>{let s,c=g.current;if(!c)return;function f(e,n=o){let r=m()??p;if(null==r)return;let i=t.current.fields.get(r);if(!i)return;let a=y$(e,n);t.current.fields.set(r,{...i,validityData:a})}if(n){if(!1!==d.valid)return;let t=c.validity;if(!t.valueMissing){let t={value:e,state:{...n1,valid:!0},error:"",errors:[],initialValue:a.initialValue};c.setCustomValidity(""),f(t,!1),r(t);return}let n=yI.reduce((e,n)=>(e[n]=t[n],e),{});if(!n.valid&&!function(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(let n of yI)"valid"!==n&&("valueMissing"===n&&(t=e[n]),e[n]&&(t=!1));return t}(n))return}h.clear();let x=null,v=[],y=function(e){let t=yI.reduce((t,n)=>(t[n]=e.validity[n],t),{}),n=!1;for(let e of yI)if("valid"!==e){if("valueMissing"===e&&t[e])n=!0;else if(t[e])return t}return n&&!l.current&&(t.valid=!0,t.valueMissing=!1),t}(c),b=u();if(c.validationMessage&&!b)s=c.validationMessage,v=[c.validationMessage];else{let n=i(e,Array.from(t.current.fields.values()).reduce((e,t)=>(t.name&&(e[t.name]=t.getValue()),e),{}));null!==(x="object"==typeof n&&null!==n&&"then"in n?await n:n)?(y.valid=!1,y.customError=!0,Array.isArray(x)?(v=x,c.setCustomValidity(x.join("\n"))):x&&(v=[x],c.setCustomValidity(x))):b&&(c.setCustomValidity(""),y.customError=!1,c.validationMessage?(s=c.validationMessage,v=[c.validationMessage]):c.validity.valid&&!y.valid&&(y.valid=!0))}let k={value:e,state:y,error:s??(Array.isArray(x)?x[0]:x??""),errors:v,initialValue:a.initialValue};f(k),r(k)}),v=eP.useCallback((e={})=>(0,tN.mergeProps)(f,!1===d.valid?{"aria-invalid":!0}:tU.EMPTY_OBJECT,e),[f,d.valid]),y=eP.useCallback((e={})=>(0,tN.mergeProps)({onChange(e){if(e.nativeEvent.defaultPrevented)return;if(n(c),!u())return void x(e.currentTarget.value,!0);let t=e.currentTarget;""===t.value?x(t.value):(h.clear(),s?h.start(s,()=>{x(t.value)}):x(t.value))}},v(e)),[v,n,c,h,x,s,u]);return eP.useMemo(()=>({getValidationProps:v,getInputValidationProps:y,inputRef:g,commit:x}),[v,y,x])}({setValidityData:Z,validate:y,validityData:U,validationDebounceTime:l,invalid:L,markedDirtyRef:A,state:B,name:c,shouldValidateOnChange:R,getRegisteredFieldId:P}),q=U.value,W=eP.useCallback(()=>{A.current=!0,V.commit(q)},[V,q]),H=function(e){let{commit:t,invalid:n,markedDirtyRef:r,name:i,setRegisteredFieldId:a,setValidityData:s,validityData:o}=e,{formRef:l}=rp(),d=eP.useRef(null),c=eP.useRef(null),u=eP.useRef(null),m=(0,ti.useStableCallback)(()=>{let e=c.current;if(e)return e.getValue?e.getValue():e.value}),p=(0,ti.useStableCallback)(()=>{let e=c.current;if(!e)return;let n=e.value;void 0===n&&(n=m()),r.current=!0,t(n)});function f(e=c.current?.id){e&&l.current.fields.delete(e)}return(0,tr.useIsoLayoutEffect)(()=>{let e=c.current;e&&e.id&&l.current.fields.set(e.id,{getValue:m,name:i,controlRef:e.controlRef??u,validityData:y$(o,n),validate:p})},[l,m,n,i,p,o]),(0,tr.useIsoLayoutEffect)(()=>{let e=l.current.fields;return()=>{let t=c.current?.id;t&&e.delete(t)}},[l]),(0,ti.useStableCallback)((e,t)=>{let r;if(!t){d.current===e&&(d.current=null,f(),c.current=null,a(void 0));return}let h=c.current?.id;d.current=e,c.current=t,a(t.id),h&&h!==t.id&&f(h),function(){let e=c.current;if(!e)return;let t=e.value;void 0===t&&(t=m()),null===o.initialValue&&null!==t&&s(e=>({...e,initialValue:t}))}(),(r=c.current)&&r.id&&l.current.fields.set(r.id,{getValue:m,name:i,controlRef:r.controlRef??u,validityData:y$(o,n),validate:p})})}({commit:V.commit,invalid:L,markedDirtyRef:A,name:c,setRegisteredFieldId:z,setValidityData:Z,validityData:U});eP.useImperativeHandle(h,()=>({validate:W}),[W]);let G=eP.useMemo(()=>({invalid:L,name:c,validityData:U,setValidityData:Z,disabled:b,touched:C,setTouched:M,dirty:E,setDirty:O,filled:_,setFilled:S,focused:$,setFocused:I,validate:y,validationMode:d,validationDebounceTime:l,shouldValidateOnChange:R,state:B,markedDirtyRef:A,registerFieldControl:H,validation:V}),[L,c,U,b,C,M,E,O,_,S,$,I,y,d,l,R,B,H,V]),K=(0,ta.useRenderElement)("div",e,{ref:t,state:B,props:x,stateAttributesMapping:n5});return(0,eT.jsx)(n3.Provider,{value:G,children:K})}),yC=eP.forwardRef(function(e,t){return(0,eT.jsx)(yS,{children:(0,eT.jsx)(yE,{...e,ref:t})})}),yA=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,nativeLabel:s=!0,...o}=e,l=n9(!1),{labelId:d}=re(),c=eP.useRef(null),u=rw({id:d??a,native:s});return(0,ta.useRenderElement)("label",e,{ref:[t,c],state:l.state,props:[u,o],stateAttributesMapping:n5})}),yT={...n5,...tY.transitionStatusMapping},yP=eP.forwardRef(function(e,t){let{render:n,id:r,className:i,match:a,style:s,...o}=e,l=(0,tj.useBaseUiId)(r),{validityData:d,state:c,name:u}=n9(!1),{setMessageIds:m}=re(),{errors:p}=rp(),f=u?p[u]:null,h="string"==typeof a,g=!1;g=!0===a||(h?!!d.state[a]:!!f||!1===d.state.valid);let{mounted:x,transitionStatus:v,setMounted:y}=(0,tQ.useTransitionStatus)(g);(0,tr.useIsoLayoutEffect)(()=>{if(g&&l)return m(e=>e.concat(l)),()=>{m(e=>e.filter(e=>e!==l))}},[g,l,m]);let b=eP.useRef(null),[k,j]=eP.useState(null),[w,N]=eP.useState(null),_=d.errors.length>1?(0,eT.jsx)("ul",{children:d.errors.map(e=>(0,eT.jsx)("li",{children:e},e))}):d.error,S=h?_:f||_,$=d.error;null!=f?$=Array.isArray(f)?JSON.stringify(f):f:d.errors.length>1&&($=JSON.stringify(d.errors)),g&&$!==w&&(N($),j(S)),(0,tX.useOpenChangeComplete)({open:g,ref:b,onComplete(){g||y(!1)}});let I={...c,transitionStatus:v},E=(0,ta.useRenderElement)("div",e,{ref:[t,b],state:I,props:[{id:l,children:g?S:k},o],stateAttributesMapping:yT,enabled:x});return x?E:null}),yz=eP.forwardRef(function(e,t){let{render:n,id:r,className:i,style:a,...s}=e,o=(0,tj.useBaseUiId)(r),l=n9(!1),{setMessageIds:d}=re();return(0,tr.useIsoLayoutEffect)(()=>{if(o)return d(e=>e.concat(o)),()=>{d(e=>e.filter(e=>e!==o))}},[o,d]),(0,ta.useRenderElement)("p",e,{ref:t,state:l.state,props:[{id:o},s],stateAttributesMapping:n5})}),yO=eP.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:s,disabled:o=!1,onValueChange:l,defaultValue:d,autoFocus:c=!1,style:u,...m}=e,{state:p,name:f,disabled:h,setTouched:g,setDirty:x,validityData:v,setFocused:y,setFilled:b,validationMode:k,validation:j}=n9(),w=h||o,N={...p,disabled:w},{labelId:_}=re(),S=rt({id:i});(0,tr.useIsoLayoutEffect)(()=>{let e=null!=s;j.inputRef.current?.value||e&&""!==s?b(!0):e&&""===s&&b(!1)},[j.inputRef,b,s]);let $=eP.useRef(null);(0,tr.useIsoLayoutEffect)(()=>{c&&$.current===(0,tM.activeElement)((0,tk.ownerDocument)($.current))&&y(!0)},[c,y]);let[I]=tn({controlled:s,default:d,name:"FieldControl",state:"value"}),E=void 0!==s,C=E?I:void 0,A=(0,ti.useStableCallback)(()=>j.inputRef.current?.value);return n8(j.inputRef,S,C,A),(0,ta.useRenderElement)("input",e,{ref:[t,$],state:N,props:[{id:S,disabled:w,name:f??a,ref:j.inputRef,"aria-labelledby":_,autoFocus:c,...E?{value:C}:{defaultValue:d},onChange(e){let t=e.currentTarget.value;l?.(t,(0,tx.createChangeEventDetails)(tv.REASONS.none,e.nativeEvent)),x(t!==v.initialValue),b(""!==t)},onFocus(){y(!0)},onBlur(e){g(!0),y(!1),"onBlur"===k&&j.commit(e.currentTarget.value)},onKeyDown(e){"INPUT"===e.currentTarget.tagName&&"Enter"===e.key&&(g(!0),j.commit(e.currentTarget.value))}},j.getInputValidationProps(),m],stateAttributesMapping:n5})}),yM=eP.createContext({disabled:!1}),yR=eP.createContext(void 0),yD=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,...s}=e,{state:o,disabled:l}=n9(!1),d=l||a,c=function(e=!0){let t=eP.useContext(yR);if(void 0===t&&!e)throw Error((0,tm.default)(3));return t}(),u=c?.allValues!==void 0?c?.parent.id:void 0,m=eP.useMemo(()=>({disabled:d}),[d]),p=(0,ta.useRenderElement)("div",e,{ref:t,state:o,props:s,stateAttributesMapping:n5});return(0,eT.jsx)(yS,{controlId:u,children:(0,eT.jsx)(yM.Provider,{value:m,children:p})})});e.s(["Control",0,yO,"Description",0,yz,"Error",0,yP,"Item",0,yD,"Label",0,yA,"Root",0,yC,"Validity",0,function(e){let{children:t}=e,{validityData:n,invalid:r}=n9(!1),i=eP.useMemo(()=>y$(n,r),[n,r]),a=!1===i.state.valid,{transitionStatus:s}=(0,tQ.useTransitionStatus)(a),o=eP.useMemo(()=>({...i,validity:i.state,transitionStatus:s}),[i,s]);return(0,eT.jsx)(eP.Fragment,{children:t(o)})}],56615);var yL=e.i(56615),yL=yL;let yU=eP.forwardRef(function(e,t){return(0,eT.jsx)(yL.Control,{ref:t,...e})});function yZ({className:e,type:t,...n}){return(0,eT.jsx)(yU,{type:t,"data-slot":"input",className:(0,ny.cn)("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",e),...n})}function yF({className:e,...t}){return(0,eT.jsx)("div",{"data-slot":"input-group",role:"group",className:(0,ny.cn)("group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5",e),...t})}let yB=nv("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]","inline-end":"order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]","block-start":"order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2","block-end":"order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2"}},defaultVariants:{align:"inline-start"}});function yV({className:e,align:t="inline-start",...n}){return(0,eT.jsx)("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:(0,ny.cn)(yB({align:t}),e),onClick:e=>{e.target.closest("button")||e.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}function yq({className:e,...t}){return(0,eT.jsx)(yg,{"data-slot":"command",className:(0,ny.cn)("flex size-full flex-col overflow-hidden rounded-xl! bg-popover p-1 text-popover-foreground",e),...t})}function yW({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:r,showCloseButton:i=!1,...a}){return(0,eT.jsxs)(sO,{...a,children:[(0,eT.jsxs)(sU,{className:"sr-only",children:[(0,eT.jsx)(sZ,{children:e}),(0,eT.jsx)(sF,{children:t})]}),(0,eT.jsx)(sL,{className:(0,ny.cn)("top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0",r),showCloseButton:i,children:n})]})}function yH({className:e,...t}){return(0,eT.jsx)("div",{"data-slot":"command-input-wrapper",className:"p-1 pb-0",children:(0,eT.jsxs)(yF,{className:"h-8! rounded-lg! border-input/30 bg-input/30 shadow-none! *:data-[slot=input-group-addon]:pl-2!",children:[(0,eT.jsx)(yg.Input,{"data-slot":"command-input",className:(0,ny.cn)("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t}),(0,eT.jsx)(yV,{children:(0,eT.jsx)(eX,{className:"size-4 shrink-0 opacity-50"})})]})})}function yG({className:e,...t}){return(0,eT.jsx)(yg.List,{"data-slot":"command-list",className:(0,ny.cn)("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none",e),...t})}function yK({className:e,...t}){return(0,eT.jsx)(yg.Empty,{"data-slot":"command-empty",className:(0,ny.cn)("py-6 text-center text-sm",e),...t})}function yJ({className:e,...t}){return(0,eT.jsx)(yg.Group,{"data-slot":"command-group",className:(0,ny.cn)("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground",e),...t})}function yY({className:e,...t}){return(0,eT.jsx)(yg.Separator,{"data-slot":"command-separator",className:(0,ny.cn)("-mx-1 h-px bg-border",e),...t})}function yX({className:e,children:t,...n}){return(0,eT.jsxs)(yg.Item,{"data-slot":"command-item",className:(0,ny.cn)("group/command-item relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none in-data-[slot=dialog-content]:rounded-lg! data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-selected:*:[svg]:text-foreground",e),...n,children:[t,(0,eT.jsx)(iq,{className:"ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100"})]})}function yQ({className:e,...t}){return(0,eT.jsx)("span",{"data-slot":"command-shortcut",className:(0,ny.cn)("ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground",e),...t})}function y0({open:e,onOpenChange:t,tabs:n,onSelectTab:r,onRunChecks:i,report:a,insights:s}){let{resolvedTheme:o,setTheme:l}=(0,sQ.useTheme)(),{viewIssue:d}=l$(),c=(0,eP.useMemo)(()=>{let e=[];return a.lint.messages.forEach((t,n)=>e.push({id:`lint-${n}`,issue:oH(t),group:"Lint",icon:eZ})),a.types.diagnostics.forEach((t,n)=>e.push({id:`type-${n}`,issue:oG(t),group:"Types",icon:eF})),a.security.findings.forEach(t=>e.push({id:`sec-${t.id}`,issue:oK(t),group:"Security",icon:eB})),a.deps.findings.forEach(t=>e.push({id:`dep-${t.id}`,issue:oJ(t),group:"Dependencies",icon:eq})),s.database.findings.forEach(t=>e.push({id:`db-${t.id}`,issue:o0(t),group:"Database",icon:eW})),s.tests.findings.forEach(t=>e.push({id:`test-${t.id}`,issue:o6(t),group:"Tests",icon:e1})),s.performance.findings.forEach(t=>e.push({id:`perf-${t.id}`,issue:o5(t),group:"Performance",icon:e0})),s.accessibility.violations.forEach(t=>e.push({id:`a11y-${t.id}`,issue:o4(t),group:"Accessibility",icon:eQ})),s.env.variables.forEach(t=>e.push({id:`env-${t.key}`,issue:oX(t),group:"Environment",icon:eH})),s.network.calls.forEach(t=>e.push({id:`net-${t.id}`,issue:oQ(t),group:"Network",icon:eG})),s.git.issues.forEach(t=>e.push({id:`git-${t.id}`,issue:o1(t),group:"Git",icon:eK})),s.git.workflows.forEach(t=>t.issues.forEach(t=>e.push({id:`ci-${t.id}`,issue:o1(t),group:"CI/CD",icon:eK}))),e},[a,s]);function u(e){t(!1),setTimeout(e,0)}return(0,eT.jsx)(yW,{open:e,onOpenChange:t,className:"sm:!max-w-xl",children:(0,eT.jsxs)(yq,{children:[(0,eT.jsx)(yH,{placeholder:"Search issues, files, and actions…"}),(0,eT.jsxs)(yG,{children:[(0,eT.jsx)(yK,{children:"No results found."}),(0,eT.jsx)(yJ,{heading:"Go to tab",children:n.map(e=>(0,eT.jsxs)(yX,{value:`tab ${e.label}`,onSelect:()=>u(()=>r(e.value)),children:[(0,eT.jsx)(e.icon,{}),(0,eT.jsx)("span",{children:e.label})]},e.value))}),(0,eT.jsx)(yY,{}),(0,eT.jsxs)(yJ,{heading:"Actions",children:[(0,eT.jsxs)(yX,{value:"run checks analysis",onSelect:()=>u(()=>i?.()),children:[(0,eT.jsx)(i2,{}),(0,eT.jsx)("span",{children:"Run checks"}),(0,eT.jsx)(yQ,{children:"R"})]}),(0,eT.jsxs)(yX,{value:"open settings",onSelect:()=>u(()=>r("settings")),children:[(0,eT.jsx)(e5,{}),(0,eT.jsx)("span",{children:"Open settings"}),(0,eT.jsx)(yQ,{children:","})]}),(0,eT.jsxs)(yX,{value:"toggle theme dark light",onSelect:()=>u(()=>l("dark"===o?"light":"dark")),children:[(0,eT.jsx)(xu,{}),(0,eT.jsx)("span",{children:"Toggle theme"})]})]}),(0,eT.jsx)(yY,{}),(0,eT.jsx)(yJ,{heading:"Issues & findings",children:c.map(e=>{let t=oV(e.issue.severity);return(0,eT.jsxs)(yX,{value:`${e.group} ${e.issue.title} ${e.issue.filePath} ${e.issue.ruleId??""} ${e.issue.code??""}`,onSelect:()=>u(()=>d(e.issue)),children:[(0,eT.jsx)(e.icon,{}),(0,eT.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.issue.title}),(0,eT.jsxs)("span",{className:"ml-2 flex shrink-0 items-center gap-2",children:[(0,eT.jsx)(gc,{className:(0,ny.cn)("size-3",t.text)}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:e.group})]})]},e.id)})})]})]})})}nv("flex items-center gap-2 text-sm shadow-none",{variants:{size:{xs:"h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5",sm:"","icon-xs":"size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});let y1=eL("scan-search",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);function y2({onRunChecks:e,onLoadDemo:t}){return(0,eT.jsxs)("div",{className:"flex min-h-[60svh] flex-col items-center justify-center px-4 py-16 text-center",children:[(0,eT.jsx)("div",{className:"flex size-14 items-center justify-center rounded-md border border-border bg-card text-muted-foreground",children:(0,eT.jsx)(y1,{className:"size-7"})}),(0,eT.jsx)("h2",{className:"mt-6 text-balance text-lg font-semibold text-foreground",children:"No analysis yet"}),(0,eT.jsx)("p",{className:"mt-2 max-w-md text-pretty text-sm leading-relaxed text-muted-foreground",children:"Run CodeLens against a project to populate every surface with real lint, type, security, dependency, and project-intelligence results."}),(0,eT.jsxs)("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-3",children:[(0,eT.jsxs)("button",{type:"button",onClick:e,className:"inline-flex items-center gap-2 rounded-sm bg-primary px-4 py-2 font-mono text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:[(0,eT.jsx)(i2,{className:"size-4"}),"Run checks"]}),(0,eT.jsxs)("button",{type:"button",onClick:t,className:"inline-flex items-center gap-2 rounded-sm border border-border bg-card px-4 py-2 text-sm font-medium text-foreground transition-colors hover:bg-secondary",children:[(0,eT.jsx)(e1,{className:"size-4"}),"Load demo data"]})]}),(0,eT.jsxs)("div",{className:"mt-8 flex items-center gap-2 rounded-sm border border-border bg-secondary/40 px-3 py-2 font-mono text-xs text-muted-foreground",children:[(0,eT.jsx)(e2,{className:"size-3.5 shrink-0"}),(0,eT.jsxs)("span",{children:["Or run ",(0,eT.jsx)("span",{className:"font-semibold text-foreground",children:"codelens"})," in your project directory"]})]})]})}function y4({monorepo:e,aggregate:t,selectedPackage:n,onSelect:r}){return(0,eT.jsxs)(iH,{value:n??"__aggregate__",onValueChange:e=>r("__aggregate__"===e?null:e),children:[(0,eT.jsx)(iJ,{className:"w-full",children:(0,eT.jsx)(iK,{placeholder:"All packages"})}),(0,eT.jsxs)(iY,{children:[(0,eT.jsxs)(iQ,{value:"__aggregate__",children:["All packages (",e.packages.length,") — Score: ",t.score]}),t.packageScores.map(e=>(0,eT.jsxs)(iQ,{value:e.name,children:[e.name," — ",e.score," (",e.grade,")"]},e.name))]})]})}function y5({workspace:e,onSelectPackage:t}){return(0,eT.jsxs)("div",{className:"space-y-4",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-3",children:[(0,eT.jsx)("h3",{className:"font-mono text-sm font-medium text-foreground",children:"Packages"}),(0,eT.jsxs)("span",{className:"font-mono text-xs text-muted-foreground",children:[e.monorepo.packages.length," packages · ",e.monorepo.tool]})]}),(0,eT.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4",children:e.aggregate.packageScores.map(n=>{let r=e.packages[n.name];return(0,eT.jsxs)("button",{type:"button",onClick:()=>t(n.name),className:"group flex flex-col items-center gap-2 rounded-xl bg-card p-4 text-left ring-1 ring-foreground/10 transition-colors hover:ring-foreground/25",children:[(0,eT.jsx)(oh,{score:n.score,grade:n.grade,size:64}),(0,eT.jsxs)("div",{className:"text-center",children:[(0,eT.jsx)("p",{className:"font-mono text-xs font-medium text-foreground truncate max-w-[180px]",children:n.name}),(0,eT.jsxs)("p",{className:"font-mono text-[10px] text-muted-foreground",children:[r?.lint.errorCount??0," lint ·"," ",r?.types.diagnostics.length??0," types ·"," ",r?.security.findings.length??0," security"]})]})]},n.name)})})]})}let y6=eL("file-braces",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]]),y3=eL("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),y9=eL("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),y8=eL("eraser",[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]]),y7=eL("hard-drive",[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]]),be=eL("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);e.s([],63983),e.i(63983);let bt=eP.createContext(void 0),bn=((k={}).checked="data-checked",k.unchecked="data-unchecked",k.disabled="data-disabled",k.readonly="data-readonly",k.required="data-required",k.valid="data-valid",k.invalid="data-invalid",k.touched="data-touched",k.dirty="data-dirty",k.filled="data-filled",k.focused="data-focused",k),br={...n5,checked:e=>e?{[bn.checked]:""}:{[bn.unchecked]:""}},bi=eP.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,form:s,id:o,inputRef:l,name:d,nativeButton:c=!1,onCheckedChange:u,readOnly:m=!1,required:p=!1,disabled:f=!1,render:h,uncheckedValue:g,value:x,style:v,...y}=e,{clearErrors:b}=rp(),{state:k,setTouched:j,setDirty:w,validityData:N,setFilled:_,setFocused:S,shouldValidateOnChange:$,validationMode:I,disabled:E,name:C,validation:A}=n9(),{labelId:T}=re(),P=E||f,z=C??d,O=eP.useRef(null),M=(0,tC.useMergedRefs)(O,l,A.inputRef),R=eP.useRef(null),D=(0,tj.useBaseUiId)(),L=rt({id:o,implicit:!1,controlRef:R}),U=c?void 0:L,[Z,F]=tn({controlled:n,default:!!i,name:"Switch",state:"checked"});n8(R,D,Z),(0,tr.useIsoLayoutEffect)(()=>{O.current&&_(O.current.checked)},[O,_]),rf(Z,()=>{b(z),w(Z!==N.initialValue),_(Z),$()?A.commit(Z):A.commit(Z,!0)});let{getButtonProps:B,buttonRef:V}=t$({disabled:P,native:c}),q=function(e,t,n,r=!0,i){let[a,s]=eP.useState(),o=(0,tj.useBaseUiId)(i?`${i}-label`:void 0),l=e??t??a;return(0,tr.useIsoLayoutEffect)(()=>{let i=e||t||!r?void 0:function(e,t){let n=function(e){if(!e)return;let t=e.parentElement;if(t&&"LABEL"===t.tagName)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}(n.current,o);a!==i&&s(i)}),l}(a,T,O,!c,U),W=(0,tN.mergeProps)({checked:Z,disabled:P,form:s,id:U,name:z,required:p,style:z?n$.visuallyHiddenInput:n$.visuallyHidden,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:M,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(m)return void e.preventDefault();let t=e.currentTarget.checked,n=(0,tx.createChangeEventDetails)(tv.REASONS.none,e.nativeEvent);u?.(t,n),n.isCanceled||F(t)},onFocus(){R.current?.focus()}},A.getInputValidationProps,void 0!==x?{value:x}:tU.EMPTY_OBJECT),H=eP.useMemo(()=>({...k,checked:Z,disabled:P,readOnly:m,required:p}),[k,Z,P,m,p]),G=(0,ta.useRenderElement)("span",e,{state:H,ref:[t,R,V],props:[{id:c?L:D,role:"switch","aria-checked":Z,"aria-readonly":m||void 0,"aria-required":p||void 0,"aria-labelledby":q,onFocus(){P||S(!0)},onBlur(){let e=O.current;e&&!P&&(j(!0),S(!1),"onBlur"===I&&A.commit(e.checked))},onClick(e){if(m||P)return;e.preventDefault();let t=O.current;t&&t.dispatchEvent(new((0,rS.ownerWindow)(t)).PointerEvent("click",{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}},A.getValidationProps,y,B],stateAttributesMapping:br});return(0,eT.jsxs)(bt.Provider,{value:H,children:[G,!Z&&z&&void 0!==g&&(0,eT.jsx)("input",{type:"hidden",form:s,name:z,value:g}),(0,eT.jsx)("input",{...W,suppressHydrationWarning:!0})]})}),ba=eP.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,s=function(){let e=eP.useContext(bt);if(void 0===e)throw Error((0,tm.default)(63));return e}();return(0,ta.useRenderElement)("span",e,{state:s,ref:t,stateAttributesMapping:br,props:a})});e.s(["Root",0,bi,"Thumb",0,ba],34344);var bs=e.i(34344),bs=bs;function bo({className:e,size:t="default",...n}){return(0,eT.jsx)(bs.Root,{"data-slot":"switch","data-size":t,className:(0,ny.cn)("peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...n,children:(0,eT.jsx)(bs.Thumb,{"data-slot":"switch-thumb",className:"pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"})})}function bl({className:e,...t}){return(0,eT.jsx)("label",{"data-slot":"label",className:(0,ny.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function bd({provider:e,value:t,active:n,onChange:r}){let[i,a]=(0,eP.useState)(!1),s=t.trim().length>0,o=!e.keyPrefix||!s||t.startsWith(e.keyPrefix);return(0,eT.jsxs)("div",{className:(0,ny.cn)("flex flex-col gap-2 border-l-2 py-3 pl-4 transition-colors",n?"border-foreground":"border-border"),children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(bl,{htmlFor:`key-${e.id}`,className:"font-mono text-sm font-medium text-foreground",children:e.name}),n&&(0,eT.jsx)("span",{className:"rounded-sm border border-foreground/30 bg-foreground/5 px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wide text-foreground",children:"Active"}),s&&o&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)(iq,{className:"size-3"})," set"]})]}),(0,eT.jsx)("code",{className:"font-mono text-[11px] text-muted-foreground",children:e.envVar})]}),(0,eT.jsx)("p",{className:"text-xs leading-relaxed text-muted-foreground",children:e.blurb}),e.needsKey?(0,eT.jsx)("div",{className:"flex items-center gap-2",children:(0,eT.jsxs)("div",{className:"relative flex-1",children:[(0,eT.jsx)(yZ,{id:`key-${e.id}`,type:i?"text":"password",value:t,spellCheck:!1,autoComplete:"off",placeholder:e.keyPrefix?`${e.keyPrefix}…`:"Enter API key",onChange:e=>r(e.target.value),className:(0,ny.cn)("rounded-sm pr-9 font-mono text-sm",!o&&"border-destructive/60")}),(0,eT.jsx)("button",{type:"button",onClick:()=>a(e=>!e),"aria-label":i?"Hide key":"Show key",className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground transition-colors hover:text-foreground",children:i?(0,eT.jsx)(cy,{className:"size-4"}):(0,eT.jsx)(cv,{className:"size-4"})})]})}):(0,eT.jsx)(yZ,{id:`key-${e.id}`,value:t,spellCheck:!1,placeholder:"http://localhost:11434",onChange:e=>r(e.target.value),className:"rounded-sm font-mono text-sm"}),(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[o?(0,eT.jsx)("span",{}):(0,eT.jsxs)("span",{className:"font-mono text-[11px] text-destructive",children:["Expected a key starting with ",e.keyPrefix]}),e.keyUrl&&(0,eT.jsxs)("a",{href:e.keyUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 font-mono text-[11px] text-muted-foreground transition-colors hover:text-foreground",children:["Get key ",(0,eT.jsx)(oE,{className:"size-3"})]})]})]})}let bc=eL("brain",[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]]),bu=eL("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]),bm=new Set(["openrouter/meta-llama/llama-3.2-90b","openrouter/meta-llama/llama-3.2-1b","openrouter/meta-llama/llama-3.1-405b-instruct","openrouter/meta-llama/llama-3-8b-instruct","openrouter/meta-llama/llama-2-13b","openrouter/openchat/openchat-3.5","openrouter/undi95/toppy-m-7b","openrouter/gryphe/mythomax-l2-13b","openrouter/cinematika/cinematika-7b"]);async function bp(){let e=await fetch("https://models.dev/api.json",{headers:{accept:"application/json"}});if(!e.ok)throw Error(`models.dev responded ${e.status}`);var t=await e.json();let n=[];for(let[e,r]of Object.entries(t)){let t=r?.name??e;for(let[i,a]of Object.entries(r?.models??{})){let r=`${e}/${i}`;n.push({id:r,modelId:i,name:a.name??i,providerId:e,providerName:t,family:a.family,reasoning:!!a.reasoning,toolCall:!!a.tool_call,attachment:!!a.attachment,openWeights:!!a.open_weights,inputModalities:a.modalities?.input??[],outputModalities:a.modalities?.output??[],contextLimit:a.limit?.context,outputLimit:a.limit?.output,knowledge:a.knowledge,releaseDate:a.release_date,lastUpdated:a.last_updated,freeOpenRouter:bm.has(r)||"openrouter"===e&&a.cost?.input===0,cost:a.cost?{input:a.cost.input,output:a.cost.output,cacheRead:a.cost.cache_read,cacheWrite:a.cost.cache_write}:void 0})}}return n.sort((e,t)=>{let n=e.releaseDate??"",r=t.releaseDate??"";return n!==r?r.localeCompare(n):e.name.localeCompare(t.name)}),n}let bf=[{id:"all",label:"All"},{id:"reasoning",label:"Reasoning"},{id:"toolCall",label:"Tools"},{id:"attachment",label:"Multimodal"},{id:"openWeights",label:"Open weights"}];function bh(e){return null==e?null:0===e?"$0":`$${e<1?e.toFixed(2):e.toFixed(2).replace(/\.00$/,"")}`}function bg({icon:e,label:t}){return(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:[(0,eT.jsx)(e,{className:"size-3"}),t]})}function bx({model:e,selected:t,onSelect:n}){var r;let i=(r=e.contextLimit)?r>=1e6?`${(r/1e6).toFixed(+(r%1e6!=0))}M`:r>=1e3?`${Math.round(r/1e3)}K`:String(r):null,a=bh(e.cost?.input),s=bh(e.cost?.output);return(0,eT.jsxs)("button",{type:"button",onClick:n,className:(0,ny.cn)("flex w-full flex-col gap-2 rounded-sm border p-3 text-left transition-colors",t?"border-primary/50 bg-primary/[0.06]":"border-border bg-card hover:border-foreground/20 hover:bg-secondary/40"),children:[(0,eT.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,eT.jsxs)("div",{className:"min-w-0",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:e.name}),t&&(0,eT.jsx)(iq,{className:"size-3.5 shrink-0 text-primary"})]}),(0,eT.jsx)("p",{className:"mt-0.5 truncate font-mono text-[11px] text-muted-foreground",children:e.id})]}),(0,eT.jsx)("span",{className:"shrink-0 rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:e.providerName})]}),(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.reasoning&&(0,eT.jsx)(bg,{icon:bc,label:"reasoning"}),e.toolCall&&(0,eT.jsx)(bg,{icon:s4,label:"tools"}),e.attachment&&(0,eT.jsx)(bg,{icon:bu,label:"multimodal"}),e.openWeights&&(0,eT.jsx)(bg,{icon:dD,label:"open"})]}),(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 font-mono text-[10px] text-muted-foreground",children:[i&&(0,eT.jsxs)("span",{children:[i," ctx"]}),a&&(0,eT.jsxs)("span",{children:["in ",a,(0,eT.jsx)("span",{className:"text-muted-foreground/60",children:"/1M"})]}),s&&(0,eT.jsxs)("span",{children:["out ",s,(0,eT.jsx)("span",{className:"text-muted-foreground/60",children:"/1M"})]}),e.releaseDate&&(0,eT.jsx)("span",{children:e.releaseDate})]})]})}function bv({value:e,onChange:t,children:n,triggerClassName:r}){let[i,a]=(0,eP.useState)(!1),[s,o]=(0,eP.useState)(""),[l,d]=(0,eP.useState)("all"),{data:c,isLoading:u,error:m}=u_(i?"models.dev/catalog":null,bp,{revalidateOnFocus:!1,dedupingInterval:6e5,shouldRetryOnError:!1}),p=(0,eP.useMemo)(()=>c??[],[c]),f=(0,eP.useMemo)(()=>p.find(t=>t.id===e),[p,e]),h=(0,eP.useMemo)(()=>{let e=s.trim().toLowerCase();return p.filter(t=>("reasoning"!==l||!!t.reasoning)&&("toolCall"!==l||!!t.toolCall)&&("attachment"!==l||!!t.attachment)&&("openWeights"!==l||!!t.openWeights)&&(!e||t.id.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)||t.providerName.toLowerCase().includes(e)||(t.family?.toLowerCase().includes(e)??!1)))},[p,s,l]),g=(0,eP.useMemo)(()=>h.filter(e=>e.freeOpenRouter),[h]),x=(0,eP.useMemo)(()=>h.filter(e=>!e.freeOpenRouter),[h]);return(0,eT.jsxs)(sO,{open:i,onOpenChange:a,children:[n?(0,eT.jsx)(sM,{className:r,children:n}):(0,eT.jsxs)(sM,{className:"flex w-full items-center justify-between gap-2 rounded-sm border border-border bg-card px-3 py-2 text-left font-mono text-sm transition-colors hover:border-foreground/20",children:[(0,eT.jsx)("span",{className:"truncate text-foreground",children:e||"Select a model"}),(0,eT.jsx)(eX,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),(0,eT.jsxs)(sL,{className:"flex max-h-[80vh] flex-col gap-0 overflow-hidden p-0 sm:max-w-2xl",children:[(0,eT.jsxs)(sU,{className:"border-b border-border px-4 py-3",children:[(0,eT.jsxs)(sZ,{className:"flex items-center gap-2 font-mono text-sm",children:[(0,eT.jsx)(e4,{className:"size-4"}),"Choose a model"]}),(0,eT.jsx)(sF,{className:"text-xs",children:"Live catalog from models.dev — search by name, provider, or capability."})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-2 border-b border-border px-4 py-3",children:[(0,eT.jsxs)("div",{className:"relative",children:[(0,eT.jsx)(eX,{className:"absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),(0,eT.jsx)("input",{autoFocus:!0,value:s,onChange:e=>o(e.target.value),placeholder:"Search models…",className:"w-full rounded-sm border border-border bg-background py-2 pl-9 pr-8 font-mono text-sm text-foreground outline-none placeholder:text-muted-foreground focus:border-foreground/30"}),s&&(0,eT.jsx)("button",{type:"button",onClick:()=>o(""),"aria-label":"Clear search",className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:(0,eT.jsx)(sz,{className:"size-3.5"})})]}),(0,eT.jsx)("div",{className:"flex flex-wrap items-center gap-1.5",children:bf.map(e=>(0,eT.jsx)("button",{type:"button",onClick:()=>d(e.id),className:(0,ny.cn)("rounded-sm border px-2 py-1 font-mono text-[11px] transition-colors",l===e.id?"border-foreground/30 bg-foreground/[0.06] text-foreground":"border-border text-muted-foreground hover:text-foreground"),children:e.label},e.id))})]}),(0,eT.jsx)("div",{className:"min-h-0 flex-1 overflow-auto p-3",children:u?(0,eT.jsxs)("div",{className:"flex items-center justify-center gap-2 py-12 font-mono text-sm text-muted-foreground",children:[(0,eT.jsx)(dj,{className:"size-4 animate-spin"}),"Loading catalog…"]}):m?(0,eT.jsx)("div",{className:"py-12 text-center font-mono text-sm text-muted-foreground",children:"Could not load the model catalog. Try again shortly."}):0===h.length?(0,eT.jsxs)("div",{className:"py-12 text-center font-mono text-sm text-muted-foreground",children:['No models match "',s,'".']}):(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[g.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,eT.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wider text-[color:var(--sev-ok)]",children:"Free on OpenRouter"}),(0,eT.jsx)("span",{className:"rounded-sm bg-[color:var(--sev-ok)]/12 px-1.5 py-0.5 font-mono text-[10px] text-[color:var(--sev-ok)]",children:g.length})]}),(0,eT.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:g.map(n=>(0,eT.jsx)(bx,{model:n,selected:n.id===e,onSelect:()=>{t(n.id),a(!1)}},n.id))})]}),x.length>0&&(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[g.length>0&&(0,eT.jsx)("div",{className:"border-t border-border/50"}),(0,eT.jsxs)("div",{className:"flex items-center gap-2 px-1",children:[(0,eT.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"All models"}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:x.length})]}),(0,eT.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:x.map(n=>(0,eT.jsx)(bx,{model:n,selected:n.id===e,onSelect:()=>{t(n.id),a(!1)}},n.id))})]})]})}),(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-2 border-t border-border px-4 py-2.5 font-mono text-[11px] text-muted-foreground",children:[(0,eT.jsxs)("span",{children:[h.length," models ",g.length>0&&`(${g.length} free)`]}),f&&(0,eT.jsxs)("span",{className:"truncate text-foreground",children:[f.name," selected"]})]})]})]})}async function by(e="all"){try{return(await fetch(`/api/data?scope=${e}`,{method:"DELETE"})).ok}catch{return!1}}async function bb(){await by("all"),function(){let e=[];for(let t=0;t<window.localStorage.length;t++){let n=window.localStorage.key(t);n?.startsWith("codelens.")&&e.push(n)}for(let t of e)window.localStorage.removeItem(t)}()}async function bk(){let e=await fetch("https://ai-gateway.vercel.sh/v1/models",{headers:{accept:"application/json"}});if(!e.ok)throw Error(`Gateway responded ${e.status}`);return((await e.json()).data??[]).filter(e=>"language"===e.type).map(e=>{let t=e.context_window?`${Math.round(e.context_window/1e3)}k ctx`:void 0,n=[e.owned_by,t].filter(Boolean).join(" · ")||void 0;return{id:e.id,label:e.name?.trim()||e.id,note:n}}).sort((e,t)=>e.label.localeCompare(t.label))}function bj({icon:e,title:t,desc:n,children:r}){return(0,eT.jsxs)("section",{className:"rounded-sm border border-border bg-card",children:[(0,eT.jsxs)("div",{className:"flex items-start gap-3 border-b border-border px-5 py-4",children:[(0,eT.jsx)("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-sm border border-border text-foreground",children:(0,eT.jsx)(e,{className:"size-4"})}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("h2",{className:"font-mono text-sm font-semibold text-foreground",children:t}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:n})]})]}),(0,eT.jsx)("div",{className:"px-5 py-4",children:r})]})}function bw(){let[e,t]=(0,eP.useState)(gk),[n,r]=(0,eP.useState)(!1),[i,a]=(0,eP.useState)(!1);(0,eP.useEffect)(()=>{t(gN()),a(!0)},[]);let s=gb(e.provider),o="vercel"===e.provider,{data:l,isLoading:d,mutate:c}=u_(o?"gateway/models":null,bk,{revalidateOnFocus:!1,shouldRetryOnError:!1}),u=o&&l?.length?l:s.models;function m(e){t(t=>({...t,...e})),r(!1)}function p(){t(gk),g_(gk),gw(gk.colorAccents),r(!1)}let f=(0,eP.useMemo)(()=>{let t,n,r;return JSON.stringify((t=gb(e.provider),n={},r=e.keys[e.provider],t.needsKey&&r&&(n[t.envVar]=r),e.githubToken.trim()&&(n.GITHUB_TOKEN=e.githubToken.trim()),{ai:{enabled:e.aiEnabled,provider:e.provider,model:e.model,fallbackModel:"google/gemini-2.5-flash",maxFiles:e.maxFiles,redactSecrets:e.redactSecrets},chat:{enabled:e.chatEnabled,persist:e.persistChats,model:e.model},github:{...e.defaultRepo.trim()?{defaultRepo:e.defaultRepo.trim()}:{}},env:n}),null,2)},[e]),h=s.needsKey&&!e.keys[e.provider]?.trim();return i?(0,eT.jsxs)("div",{className:"flex flex-col gap-6 lg:flex-row",children:[(0,eT.jsxs)("div",{className:"flex flex-1 flex-col gap-6",children:[(0,eT.jsx)(bj,{icon:eV,title:"AI security audit",desc:"Choose whether to run the AI review and how it handles your source.",children:(0,eT.jsxs)("div",{className:"flex flex-col divide-y divide-border",children:[(0,eT.jsx)(bN,{label:"Enable AI security audit",hint:"When off, CodeLens runs lint, types, and the dependency audit only.",checked:e.aiEnabled,onChange:e=>m({aiEnabled:e})}),(0,eT.jsx)(bN,{label:"Redact secrets before sending",hint:"Strip obvious API keys and tokens from snippets before they reach the model.",checked:e.redactSecrets,onChange:e=>m({redactSecrets:e})}),(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-4 py-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"font-mono text-sm text-foreground",children:"Max files per run"}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"Caps how many source files are sent for review."})]}),(0,eT.jsxs)(iH,{value:String(e.maxFiles),onValueChange:e=>m({maxFiles:Number(e)}),children:[(0,eT.jsx)(iJ,{className:"w-24 rounded-sm font-mono",children:(0,eT.jsx)(iK,{})}),(0,eT.jsx)(iY,{children:[10,25,50,100].map(e=>(0,eT.jsx)(iQ,{value:String(e),children:e},e))})]})]})]})}),(0,eT.jsx)(bj,{icon:s3,title:"Provider & model",desc:"The provider and model used to perform the security review.",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,eT.jsx)(bl,{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:"Provider"}),(0,eT.jsxs)(iH,{value:e.provider,onValueChange:n=>{let i,a;return a=(i=gb(n)).models.some(t=>t.id===e.model),void(t(e=>({...e,provider:n,model:a?e.model:i.models[0].id})),r(!1))},children:[(0,eT.jsx)(iJ,{className:"w-full rounded-sm font-mono",children:(0,eT.jsx)(iK,{})}),(0,eT.jsx)(iY,{children:gy.map(e=>(0,eT.jsx)(iQ,{value:e.id,children:e.name},e.id))})]})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)(bl,{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:"Model"}),o&&(0,eT.jsxs)("button",{type:"button",onClick:()=>c(),className:"inline-flex items-center gap-1 font-mono text-[10px] text-muted-foreground transition-colors hover:text-foreground",children:[d?(0,eT.jsx)(dj,{className:"size-3 animate-spin"}):(0,eT.jsx)(y9,{className:"size-3"}),d?"loading":`${u.length} live`]})]}),(0,eT.jsx)(bv,{value:e.model,onChange:e=>m({model:e})}),(0,eT.jsxs)(iH,{value:e.model??void 0,onValueChange:e=>m({model:e??""}),children:[(0,eT.jsx)(iJ,{className:"w-full rounded-sm font-mono text-xs",children:(0,eT.jsx)(iK,{placeholder:"Quick pick…"})}),(0,eT.jsx)(iY,{className:"max-h-72",children:u.map(e=>(0,eT.jsx)(iQ,{value:e.id,children:e.label},e.id))})]})]})]}),o&&(0,eT.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:d?"Fetching the live model list from the AI Gateway…":l?.length?"Live text models from the Vercel AI Gateway.":"Showing built-in defaults — could not reach the gateway."}),u.find(t=>t.id===e.model)?.note&&(0,eT.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:u.find(t=>t.id===e.model)?.note})]})}),(0,eT.jsx)(bj,{icon:eH,title:"API key",desc:"Stored locally in your browser and written to .codelens.json for the CLI. Never sent anywhere else.",children:s.needsKey?(0,eT.jsx)(bd,{provider:s,value:e.keys[s.id]??"",active:!0,onChange:e=>{var n;return n=s.id,void(t(t=>({...t,keys:{...t.keys,[n]:e}})),r(!1))}},s.id):(0,eT.jsxs)("p",{className:"font-mono text-xs leading-relaxed text-muted-foreground",children:[s.name," runs locally and needs no API key. Make sure the Ollama server is running and reachable at ",(0,eT.jsx)("span",{className:"text-foreground",children:s.envVar}),"."]})}),(0,eT.jsx)(bj,{icon:e6,title:"AI chat assistant",desc:"The in-dashboard assistant available from the sidebar and every issue's “Ask AI” button.",children:(0,eT.jsxs)("div",{className:"flex flex-col divide-y divide-border",children:[(0,eT.jsx)(bN,{label:"Enable AI chat assistant",hint:"Adds the AI Chat tab and the Ask AI shortcut in issue detail sheets.",checked:e.chatEnabled,onChange:e=>m({chatEnabled:e})}),(0,eT.jsx)(bN,{label:"Persist chat history",hint:"Save conversations to .codelens/chats.json so they survive restarts. When off, chats are kept in memory only.",checked:e.persistChats,onChange:e=>m({persistChats:e})}),(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-4 py-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"font-mono text-sm text-foreground",children:"Assistant model"}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:"Shared with the audit — set under Provider & model above."})]}),(0,eT.jsx)("span",{className:"max-w-[12rem] truncate rounded-sm border border-border bg-secondary px-2 py-1 font-mono text-[11px] text-foreground",children:e.model})]})]})}),(0,eT.jsx)(bj,{icon:eK,title:"GitHub integration",desc:"Powers the enriched Git overview and the Releases dashboard. All fields are optional.",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,eT.jsx)(bl,{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:"Access token"}),(0,eT.jsx)("input",{type:"password",value:e.githubToken,onChange:e=>m({githubToken:e.target.value}),placeholder:"ghp_… (optional)",autoComplete:"off",spellCheck:!1,className:"w-full rounded-sm border border-border bg-background px-3 py-2 font-mono text-sm text-foreground outline-none placeholder:text-muted-foreground focus:border-foreground/30"}),(0,eT.jsxs)("p",{className:"font-mono text-[11px] leading-relaxed text-muted-foreground",children:["Raises the GitHub API rate limit from 60 to 5,000 requests/hour and enables private repositories. Written to ",(0,eT.jsx)("span",{className:"text-foreground",children:"GITHUB_TOKEN"})," for the CLI."]})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,eT.jsx)(bl,{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:"Default repository"}),(0,eT.jsx)("input",{type:"text",value:e.defaultRepo,onChange:e=>m({defaultRepo:e.target.value}),placeholder:"owner/repo (optional)",autoComplete:"off",spellCheck:!1,className:"w-full rounded-sm border border-border bg-background px-3 py-2 font-mono text-sm text-foreground outline-none placeholder:text-muted-foreground focus:border-foreground/30"}),(0,eT.jsx)("p",{className:"font-mono text-[11px] leading-relaxed text-muted-foreground",children:"Overrides the auto-detected remote in the Git & Releases tabs."})]})]})}),(0,eT.jsx)(bj,{icon:be,title:"Appearance",desc:"Tune how the dashboard looks. These preferences are display-only and never affect the CLI config.",children:(0,eT.jsxs)("div",{className:"flex flex-col divide-y divide-border",children:[(0,eT.jsx)(bN,{label:"Color accents",hint:"Layer subtle semantic colors over the monochrome theme — severity tags, charts, hovers, and focus rings. Takes effect immediately.",checked:e.colorAccents,onChange:function(n){gw(n);let r={...e,colorAccents:n};t(r),g_(r)}}),(0,eT.jsx)(bS,{enabled:e.colorAccents})]})}),(0,eT.jsx)(bj,{icon:e7,title:"Task board",desc:"Your remediation worklist is stored locally in this browser — it never leaves your machine or reaches the CLI.",children:(0,eT.jsx)(b_,{})}),(0,eT.jsx)(bj,{icon:y7,title:"Data & storage",desc:"Reset preferences or permanently delete stored data — runs, chats, the task board, and cached settings.",children:(0,eT.jsx)(bI,{onResetSettings:p})})]}),(0,eT.jsx)("aside",{className:"flex w-full flex-col gap-4 lg:w-80 lg:shrink-0",children:(0,eT.jsxs)("div",{className:"lg:sticky lg:top-6 flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-card",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(y6,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("span",{className:"font-mono text-xs font-semibold text-foreground",children:".codelens.json"})]}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground",children:"preview"})]}),(0,eT.jsx)("pre",{className:"max-h-80 overflow-auto px-4 py-3 font-mono text-[11px] leading-relaxed text-foreground/80",children:(0,eT.jsx)("code",{children:f})})]}),h&&(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-muted/40 px-4 py-3",children:[(0,eT.jsxs)("p",{className:"font-mono text-xs text-foreground",children:["No key for ",s.name]}),(0,eT.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:"Add a key above or the AI audit will be skipped at run time."})]}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsxs)("button",{type:"button",onClick:function(){g_(e),r(!0),window.setTimeout(()=>r(!1),2e3)},className:(0,ny.cn)("inline-flex flex-1 items-center justify-center gap-2 rounded-sm px-4 py-2.5 font-mono text-sm font-medium transition-colors",n?"bg-foreground/10 text-foreground":"bg-primary text-primary-foreground hover:bg-primary/90"),children:[n?(0,eT.jsx)(iq,{className:"size-4"}):(0,eT.jsx)(y3,{className:"size-4"}),n?"Saved":"Save settings"]}),(0,eT.jsx)("button",{type:"button",onClick:p,"aria-label":"Reset to defaults",className:"inline-flex items-center justify-center gap-2 rounded-sm border border-border px-3 py-2.5 font-mono text-sm text-muted-foreground transition-colors hover:text-foreground",children:(0,eT.jsx)(dk,{className:"size-4"})})]})]})})]}):(0,eT.jsx)("div",{className:"h-64 animate-pulse rounded-sm border border-border bg-card/50"})}function bN({label:e,hint:t,checked:n,onChange:r}){return(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-4 py-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"font-mono text-sm text-foreground",children:e}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:t})]}),(0,eT.jsx)(bo,{checked:n,onCheckedChange:r})]})}function b_(){let e=lN(lm),t=lu(),n=lN(lk),[r,i]=(0,eP.useState)(null),a=new Set(t.filter(e=>e.done).map(e=>e.id)),s=e.filter(e=>a.has(e.columnId)).length,o=[{label:"Tasks",value:e.length},{label:"Completed",value:s},{label:"Columns",value:t.length},{label:"Groups",value:n.length}];return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-4",children:o.map(e=>(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-background px-3 py-2.5",children:[(0,eT.jsx)("p",{className:"font-mono text-lg tabular-nums text-foreground",children:e.value}),(0,eT.jsx)("p",{className:"font-mono text-[10px] uppercase tracking-wide text-muted-foreground",children:e.label})]},e.label))}),(0,eT.jsxs)("div",{className:"flex flex-col divide-y divide-border",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-4 py-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"font-mono text-sm text-foreground",children:"Clear completed tasks"}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:"Remove every task in a column marked as done."})]}),(0,eT.jsxs)("button",{type:"button",onClick:lb,disabled:0===s,className:"inline-flex shrink-0 items-center gap-1.5 rounded-sm border border-border px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground disabled:opacity-40",children:[(0,eT.jsx)(y8,{className:"size-3.5"}),"Clear ",s>0?s:""]})]}),(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-4 py-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"font-mono text-sm text-foreground",children:"Delete all tasks"}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:"Empty the board. Your columns and groups are kept."})]}),"clear"===r?(0,eT.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,eT.jsx)("button",{type:"button",onClick:()=>{lp([]),i(null)},className:"rounded-sm bg-destructive px-2.5 py-1.5 font-mono text-xs text-destructive-foreground",children:"Confirm"}),(0,eT.jsx)("button",{type:"button",onClick:()=>i(null),className:"rounded-sm border border-border px-2.5 py-1.5 font-mono text-xs text-muted-foreground hover:text-foreground",children:"Cancel"})]}):(0,eT.jsxs)("button",{type:"button",onClick:()=>i("clear"),disabled:0===e.length,className:"inline-flex shrink-0 items-center gap-1.5 rounded-sm border border-border px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground disabled:opacity-40",children:[(0,eT.jsx)(l1,{className:"size-3.5"}),"Delete all"]})]}),(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-4 py-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"font-mono text-sm text-foreground",children:"Reset board to defaults"}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:"Restore the default columns and groups and remove all tasks."})]}),"reset"===r?(0,eT.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,eT.jsx)("button",{type:"button",onClick:()=>{window.localStorage.setItem(lr,JSON.stringify([])),window.localStorage.setItem(la,JSON.stringify(lt)),window.localStorage.setItem(ls,JSON.stringify(ln)),window.localStorage.removeItem(li),window.dispatchEvent(new CustomEvent(lo)),i(null)},className:"rounded-sm bg-destructive px-2.5 py-1.5 font-mono text-xs text-destructive-foreground",children:"Confirm"}),(0,eT.jsx)("button",{type:"button",onClick:()=>i(null),className:"rounded-sm border border-border px-2.5 py-1.5 font-mono text-xs text-muted-foreground hover:text-foreground",children:"Cancel"})]}):(0,eT.jsxs)("button",{type:"button",onClick:()=>i("reset"),className:"inline-flex shrink-0 items-center gap-1.5 rounded-sm border border-destructive/40 px-2.5 py-1.5 font-mono text-xs text-destructive transition-colors hover:bg-destructive/10",children:[(0,eT.jsx)(dk,{className:"size-3.5"}),"Reset"]})]})]})]})}function bS({enabled:e}){return(0,eT.jsxs)("div",{className:"flex flex-col gap-3 py-3",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between",children:[(0,eT.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:"Preview"}),(0,eT.jsx)("span",{className:"font-mono text-[10px] uppercase tracking-wide text-muted-foreground",children:e?"Color accents on":"Monochrome"})]}),(0,eT.jsx)("div",{className:"flex flex-wrap gap-1.5",children:[{key:"critical",label:"Critical"},{key:"high",label:"High"},{key:"medium",label:"Medium"},{key:"low",label:"Low"},{key:"info",label:"Info"},{key:"ok",label:"Passed"}].map(e=>(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-sm px-2 py-1 font-mono text-[11px]",style:{backgroundColor:`color-mix(in oklab, var(--sev-${e.key}) 14%, transparent)`,color:`var(--sev-${e.key})`},children:[(0,eT.jsx)("span",{className:"size-1.5 rounded-full",style:{backgroundColor:`var(--sev-${e.key})`}}),e.label]},e.key))}),(0,eT.jsxs)("div",{className:"flex items-center gap-3",children:[(0,eT.jsx)("span",{className:"inline-flex items-center rounded-sm bg-primary px-2.5 py-1 font-mono text-[11px] text-primary-foreground",children:"Primary"}),(0,eT.jsx)("span",{className:"rounded-sm bg-accent px-2.5 py-1 font-mono text-[11px] text-accent-foreground",children:"Hover"}),(0,eT.jsx)("div",{className:"flex items-center gap-1",children:[1,2,3,4,5].map(e=>(0,eT.jsx)("span",{className:"size-3 rounded-full",style:{backgroundColor:`var(--chart-${e})`}},e))})]})]})}function b$({icon:e,title:t,desc:n,actionLabel:r,busyLabel:i,onConfirm:a,tone:s="muted"}){let[o,l]=(0,eP.useState)(!1),[d,c]=(0,eP.useState)(!1);async function u(){c(!0);try{await a()}finally{c(!1),l(!1)}}return(0,eT.jsxs)("div",{className:"flex items-center justify-between gap-4 py-3",children:[(0,eT.jsxs)("div",{children:[(0,eT.jsx)("p",{className:"font-mono text-sm text-foreground",children:t}),(0,eT.jsx)("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:n})]}),d?(0,eT.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1.5 rounded-sm border border-border px-2.5 py-1.5 font-mono text-xs text-muted-foreground",children:[(0,eT.jsx)(dj,{className:"size-3.5 animate-spin"}),i]}):o?(0,eT.jsxs)("div",{className:"flex shrink-0 items-center gap-1.5",children:[(0,eT.jsx)("button",{type:"button",onClick:u,className:"rounded-sm bg-destructive px-2.5 py-1.5 font-mono text-xs text-destructive-foreground",children:"Confirm"}),(0,eT.jsx)("button",{type:"button",onClick:()=>l(!1),className:"rounded-sm border border-border px-2.5 py-1.5 font-mono text-xs text-muted-foreground hover:text-foreground",children:"Cancel"})]}):(0,eT.jsxs)("button",{type:"button",onClick:()=>l(!0),className:(0,ny.cn)("inline-flex shrink-0 items-center gap-1.5 rounded-sm border px-2.5 py-1.5 font-mono text-xs transition-colors","destructive"===s?"border-destructive/40 text-destructive hover:bg-destructive/10":"border-border text-muted-foreground hover:text-foreground"),children:[(0,eT.jsx)(e,{className:"size-3.5"}),r]})]})}function bI({onResetSettings:e}){return(0,eT.jsxs)("div",{className:"flex flex-col divide-y divide-border",children:[(0,eT.jsx)(b$,{icon:dk,title:"Reset settings to defaults",desc:"Restore the provider, model, AI, GitHub, and chat preferences to their defaults. Stored data is kept.",actionLabel:"Reset",busyLabel:"Resetting",onConfirm:e}),(0,eT.jsx)(b$,{icon:lW,title:"Delete run history",desc:"Remove all saved runs, the latest snapshot, and project insights from .codelens/ on this machine.",actionLabel:"Delete runs",busyLabel:"Deleting",tone:"destructive",onConfirm:async()=>{await by("runs"),window.location.reload()}}),(0,eT.jsx)(b$,{icon:e6,title:"Delete chat history",desc:"Erase every saved Ask-AI conversation from .codelens/chats.json.",actionLabel:"Delete chats",busyLabel:"Deleting",tone:"destructive",onConfirm:async()=>{await by("chats"),window.location.reload()}}),(0,eT.jsx)(b$,{icon:l1,title:"Delete everything",desc:"Wipe all runs, chats, the task board, and cached settings — server data and this browser's storage. This cannot be undone.",actionLabel:"Delete all data",busyLabel:"Wiping",tone:"destructive",onConfirm:async()=>{await bb(),window.location.reload()}})]})}var bE=e.i(57047),bC="vercel.ai.error",bA=Symbol.for(bC),bT=class e extends(A=Error,C=bA,A){constructor({name:e,message:t,cause:n}){super(t),this[C]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,bC)}static hasMarker(e,t){let n=Symbol.for(t);return null!=e&&"object"==typeof e&&n in e&&"boolean"==typeof e[n]&&!0===e[n]}},bP="AI_APICallError",bz=`vercel.ai.error.${bP}`,bO=Symbol.for(bz),bM=class extends(P=bT,T=bO,P){constructor({message:e,url:t,requestBodyValues:n,statusCode:r,responseHeaders:i,responseBody:a,cause:s,isRetryable:o=null!=r&&(408===r||409===r||429===r||r>=500),data:l}){super({name:bP,message:e,cause:s}),this[T]=!0,this.url=t,this.requestBodyValues=n,this.statusCode=r,this.responseHeaders=i,this.responseBody=a,this.isRetryable=o,this.data=l}static isInstance(e){return bT.hasMarker(e,bz)}},bR="AI_EmptyResponseBodyError",bD=`vercel.ai.error.${bR}`,bL=Symbol.for(bD),bU=class extends(O=bT,z=bL,O){constructor({message:e="Empty response body"}={}){super({name:bR,message:e}),this[z]=!0}static isInstance(e){return bT.hasMarker(e,bD)}};function bZ(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}var bF="AI_InvalidArgumentError",bB=`vercel.ai.error.${bF}`,bV=Symbol.for(bB),bq=class extends(R=bT,M=bV,R){constructor({message:e,cause:t,argument:n}){super({name:bF,message:e,cause:t}),this[M]=!0,this.argument=n}static isInstance(e){return bT.hasMarker(e,bB)}},bW=Symbol.for("vercel.ai.error.AI_InvalidPromptError");Symbol.for("vercel.ai.error.AI_InvalidResponseDataError");var bH="AI_JSONParseError",bG=`vercel.ai.error.${bH}`,bK=Symbol.for(bG),bJ=class extends(L=bT,D=bK,L){constructor({text:e,cause:t}){super({name:bH,message:`JSON parsing failed: Text: ${e}.
317
+ Error message: ${bZ(t)}`,cause:t}),this[D]=!0,this.text=e}static isInstance(e){return bT.hasMarker(e,bG)}},bY=Symbol.for("vercel.ai.error.AI_LoadAPIKeyError");Symbol.for("vercel.ai.error.AI_LoadSettingError");Symbol.for("vercel.ai.error.AI_NoContentGeneratedError");Symbol.for("vercel.ai.error.AI_NoSuchModelError");Symbol.for("vercel.ai.error.AI_TooManyEmbeddingValuesForCallError");var bX="AI_TypeValidationError",bQ=`vercel.ai.error.${bX}`,b0=Symbol.for(bQ),b1=class e extends(Z=bT,U=b0,Z){constructor({value:e,cause:t,context:n}){let r="Type validation failed";if((null==n?void 0:n.field)&&(r+=` for ${n.field}`),(null==n?void 0:n.entityName)||(null==n?void 0:n.entityId)){r+=" (";const e=[];n.entityName&&e.push(n.entityName),n.entityId&&e.push(`id: "${n.entityId}"`),r+=e.join(", "),r+=")"}super({name:bX,message:`${r}: Value: ${JSON.stringify(e)}.
318
+ Error message: ${bZ(t)}`,cause:t}),this[U]=!0,this.value=e,this.context=n}static isInstance(e){return bT.hasMarker(e,bQ)}static wrap({value:t,cause:n,context:r}){var i,a,s;return e.isInstance(n)&&n.value===t&&(null==(i=n.context)?void 0:i.field)===(null==r?void 0:r.field)&&(null==(a=n.context)?void 0:a.entityName)===(null==r?void 0:r.entityName)&&(null==(s=n.context)?void 0:s.entityId)===(null==r?void 0:r.entityId)?n:new e({value:t,cause:n,context:r})}},b2=Symbol.for("vercel.ai.error.AI_UnsupportedFunctionalityError");let b4=Object.freeze({status:"aborted"});function b5(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:s,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=s.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}function s(e){var t;let i=n?.Parent?new a:this;for(let n of(r(i,e),(t=i._zod).deferred??(t.deferred=[]),i._zod.deferred))n();return i}return Object.defineProperty(a,"name",{value:e}),Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!n?.Parent&&t instanceof n.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}let b6=Symbol("zod_brand");class b3 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class b9 extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(F=globalThis).__zod_globalConfig??(F.__zod_globalConfig={});let b8=globalThis.__zod_globalConfig;function b7(e){return e&&Object.assign(b8,e),b8}function ke(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function kt(e,t="|"){return e.map(e=>kw(e)).join(t)}function kn(e,t){return"bigint"==typeof t?t.toString():t}function kr(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ki(e){return null==e}function ka(e){let t=+!!e.startsWith("^"),n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function ks(e,t){let n=e/t,r=Math.round(n),i=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}e.s(["$ZodAsyncError",0,b3,"$ZodEncodeError",0,b9,"$brand",0,b6,"$constructor",0,b5,"NEVER",0,b4,"config",0,b7,"globalConfig",0,b8],2108);let ko=Symbol("evaluating");function kl(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ko)return void 0===r&&(r=ko,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function kd(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function kc(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function ku(e){return JSON.stringify(e)}function km(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}let kp="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function kf(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let kh=kr(()=>{if(b8.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function kg(e){if(!1===kf(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let n=t.prototype;return!1!==kf(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function kx(e){return kg(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}let kv=new Set(["string","number","symbol"]),ky=new Set(["string","number","bigint","boolean","symbol","undefined"]);function kb(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function kk(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function kj(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function kw(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function kN(e){return Object.keys(e).filter(t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout)}let k_={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},kS={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function k$(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function kI(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function kE(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function kC(e){return"string"==typeof e?e:e?.message}function kA(e,t,n){let r=e.message?e.message:kC(e.inst?._zod.def?.error?.(e))??kC(t?.error?.(e))??kC(n.customError?.(e))??kC(n.localeError?.(e))??"Invalid input",{inst:i,continue:a,input:s,...o}=e;return o.path??(o.path=[]),o.message=r,t?.reportInput&&(o.input=s),o}function kT(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function kP(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function kz(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t}function kO(...e){let[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}function kM(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function kR(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}e.s(["BIGINT_FORMAT_RANGES",0,kS,"Class",0,class{constructor(...e){}},"NUMBER_FORMAT_RANGES",0,k_,"aborted",0,k$,"allowsEval",0,kh,"assert",0,function(e){},"assertEqual",0,function(e){return e},"assertIs",0,function(e){},"assertNever",0,function(e){throw Error("Unexpected value in exhaustive check")},"assertNotEqual",0,function(e){return e},"assignProp",0,kd,"base64ToUint8Array",0,kM,"base64urlToUint8Array",0,function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return kM(t+n)},"cached",0,kr,"captureStackTrace",0,kp,"cleanEnum",0,function(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])},"cleanRegex",0,ka,"clone",0,kk,"cloneDef",0,function(e){return kc(e._zod.def)},"createTransparentProxy",0,function(e){let t;return new Proxy({},{get:(n,r,i)=>(t??(t=e()),Reflect.get(t,r,i)),set:(n,r,i,a)=>(t??(t=e()),Reflect.set(t,r,i,a)),has:(n,r)=>(t??(t=e()),Reflect.has(t,r)),deleteProperty:(n,r)=>(t??(t=e()),Reflect.deleteProperty(t,r)),ownKeys:n=>(t??(t=e()),Reflect.ownKeys(t)),getOwnPropertyDescriptor:(n,r)=>(t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)),defineProperty:(n,r,i)=>(t??(t=e()),Reflect.defineProperty(t,r,i))})},"defineLazy",0,kl,"esc",0,ku,"escapeRegex",0,kb,"explicitlyAborted",0,kI,"extend",0,function(e,t){if(!kg(t))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=kc(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return kd(this,"shape",n),n}});return kk(e,r)},"finalizeIssue",0,kA,"floatSafeRemainder",0,ks,"getElementAtPath",0,function(e,t){return t?t.reduce((e,t)=>e?.[t],e):e},"getEnumValues",0,ke,"getLengthableOrigin",0,kP,"getParsedType",0,e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return"promise";if("u">typeof Map&&e instanceof Map)return"map";if("u">typeof Set&&e instanceof Set)return"set";if("u">typeof Date&&e instanceof Date)return"date";if("u">typeof File&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},"getSizableOrigin",0,kT,"hexToUint8Array",0,function(e){let t=e.replace(/^0x/,"");if(t.length%2!=0)throw Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n},"isObject",0,kf,"isPlainObject",0,kg,"issue",0,kO,"joinValues",0,kt,"jsonStringifyReplacer",0,kn,"merge",0,function(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=kc(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return kd(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return kk(e,n)},"mergeDefs",0,kc,"normalizeParams",0,kj,"nullish",0,ki,"numKeys",0,function(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t},"objectClone",0,function(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))},"omit",0,function(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=kc(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return kd(this,"shape",r),r},checks:[]});return kk(e,i)},"optionalKeys",0,kN,"parsedType",0,kz,"partial",0,function(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let i=kc(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return kd(this,"shape",i),i},checks:[]});return kk(t,i)},"pick",0,function(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i=kc(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return kd(this,"shape",e),e},checks:[]});return kk(e,i)},"prefixIssues",0,kE,"primitiveTypes",0,ky,"promiseAllObject",0,function(e){let t=Object.keys(e);return Promise.all(t.map(t=>e[t])).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})},"propertyKeyTypes",0,kv,"randomString",0,function(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n},"required",0,function(e,t,n){let r=kc(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(let t in r)i[t]=new e({type:"nonoptional",innerType:r[t]});return kd(this,"shape",i),i}});return kk(t,r)},"safeExtend",0,function(e,t){if(!kg(t))throw Error("Invalid input to safeExtend: expected a plain object");let n=kc(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return kd(this,"shape",n),n}});return kk(e,n)},"shallowClone",0,kx,"slugify",0,km,"stringifyPrimitive",0,kw,"uint8ArrayToBase64",0,kR,"uint8ArrayToBase64url",0,function(e){return kR(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},"uint8ArrayToHex",0,function(e){return Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")},"unwrapMessage",0,kC],69547);let kD=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,kn,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},kL=b5("$ZodError",kD),kU=b5("$ZodError",kD,{Parent:Error});function kZ(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function kF(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if("invalid_union"===a.code&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if("invalid_key"===a.code)r({issues:a.issues},[...i,...a.path]);else if("invalid_element"===a.code)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(0===e.length)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}function kB(e,t=e=>e.message){let n={errors:[]},r=(e,i=[])=>{var a,s;for(let o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>r({issues:e},[...i,...o.path]));else if("invalid_key"===o.code)r({issues:o.issues},[...i,...o.path]);else if("invalid_element"===o.code)r({issues:o.issues},[...i,...o.path]);else{let e=[...i,...o.path];if(0===e.length){n.errors.push(t(o));continue}let r=n,l=0;for(;l<e.length;){let n=e[l],i=l===e.length-1;"string"==typeof n?(r.properties??(r.properties={}),(a=r.properties)[n]??(a[n]={errors:[]}),r=r.properties[n]):(r.items??(r.items=[]),(s=r.items)[n]??(s[n]={errors:[]}),r=r.items[n]),i&&r.errors.push(t(o)),l++}}};return r(e),n}function kV(e){let t=[];for(let n of e.map(e=>"object"==typeof e?e.key:e))"number"==typeof n?t.push(`[${n}]`):"symbol"==typeof n?t.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?t.push(`[${JSON.stringify(n)}]`):(t.length&&t.push("."),t.push(n));return t.join("")}function kq(e){let t=[];for(let n of[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length))t.push(`✖ ${n.message}`),n.path?.length&&t.push(` → at ${kV(n.path)}`);return t.join("\n")}e.s(["$ZodError",0,kL,"$ZodRealError",0,kU,"flattenError",0,kZ,"formatError",0,kF,"prettifyError",0,kq,"toDotPath",0,kV,"treeifyError",0,kB],67416);let kW=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},a);if(s instanceof Promise)throw new b3;if(s.issues.length){let t=new(i?.Err??e)(s.issues.map(e=>kA(e,a,b7())));throw kp(t,i?.callee),t}return s.value},kH=kW(kU),kG=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},s=t._zod.run({value:n,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let t=new(i?.Err??e)(s.issues.map(e=>kA(e,a,b7())));throw kp(t,i?.callee),t}return s.value},kK=kG(kU),kJ=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new b3;return a.issues.length?{success:!1,error:new(e??kL)(a.issues.map(e=>kA(e,i,b7())))}:{success:!0,data:a.value}},kY=kJ(kU),kX=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>kA(e,i,b7())))}:{success:!0,data:a.value}},kQ=kX(kU),k0=e=>(t,n,r)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return kW(e)(t,n,i)},k1=k0(kU),k2=e=>(t,n,r)=>kW(e)(t,n,r),k4=k2(kU),k5=e=>async(t,n,r)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return kG(e)(t,n,i)},k6=k5(kU),k3=e=>async(t,n,r)=>kG(e)(t,n,r),k9=k3(kU),k8=e=>(t,n,r)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return kJ(e)(t,n,i)},k7=k8(kU),je=e=>(t,n,r)=>kJ(e)(t,n,r),jt=je(kU),jn=e=>async(t,n,r)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return kX(e)(t,n,i)},jr=jn(kU),ji=e=>async(t,n,r)=>kX(e)(t,n,r),ja=ji(kU);e.s(["_decode",0,k2,"_decodeAsync",0,k3,"_encode",0,k0,"_encodeAsync",0,k5,"_parse",0,kW,"_parseAsync",0,kG,"_safeDecode",0,je,"_safeDecodeAsync",0,ji,"_safeEncode",0,k8,"_safeEncodeAsync",0,jn,"_safeParse",0,kJ,"_safeParseAsync",0,kX,"decode",0,k4,"decodeAsync",0,k9,"encode",0,k1,"encodeAsync",0,k6,"parse",0,kH,"parseAsync",0,kK,"safeDecode",0,jt,"safeDecodeAsync",0,ja,"safeEncode",0,k7,"safeEncodeAsync",0,jr,"safeParse",0,kY,"safeParseAsync",0,kQ],5772);let js=(e,t)=>{kL.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>kF(e,t)},flatten:{value:t=>kZ(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,kn,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,kn,2)}},isEmpty:{get:()=>0===e.issues.length}})},jo=b5("ZodError",js),jl=b5("ZodError",js,{Parent:Error});e.s(["ZodError",0,jo,"ZodRealError",0,jl],79163);let jd=kW(jl),jc=kG(jl),ju=kJ(jl),jm=kX(jl),jp=k0(jl),jf=k2(jl),jh=k5(jl),jg=k3(jl),jx=k8(jl),jv=je(jl),jy=jn(jl),jb=ji(jl);e.s(["decode",0,jf,"decodeAsync",0,jg,"encode",0,jp,"encodeAsync",0,jh,"parse",0,jd,"parseAsync",0,jc,"safeDecode",0,jv,"safeDecodeAsync",0,jb,"safeEncode",0,jx,"safeEncodeAsync",0,jy,"safeParse",0,ju,"safeParseAsync",0,jm],96859);let jk=Symbol("ZodOutput"),jj=Symbol("ZodInput");class jw{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function jN(){return new jw}(B=globalThis).__zod_globalRegistry??(B.__zod_globalRegistry=jN());let j_=globalThis.__zod_globalRegistry;function jS(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??j_,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function j$(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);let o=e._zod.toJSONSchema?.();if(o)s.schema=o;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,r);else{let n=s.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(s.ref||(s.ref=a),j$(a,t,r),t.seen.get(a).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),"input"===t.io&&function e(t,n){let r=n??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let i=t._zod.def;if("transform"===i.type)return!0;if("array"===i.type)return e(i.element,r);if("set"===i.type)return e(i.valueType,r);if("lazy"===i.type)return e(i.getter(),r);if("promise"===i.type||"optional"===i.type||"nonoptional"===i.type||"nullable"===i.type||"readonly"===i.type||"default"===i.type||"prefault"===i.type)return e(i.innerType,r);if("intersection"===i.type)return e(i.left,r)||e(i.right,r);if("record"===i.type||"map"===i.type)return e(i.keyType,r)||e(i.valueType,r);if("pipe"===i.type)return!!t._zod.traits.has("$ZodCodec")||e(i.in,r)||e(i.out,r);if("object"===i.type){for(let t in i.shape)if(e(i.shape[t],r))return!0;return!1}if("union"===i.type){for(let t of i.options)if(e(t,r))return!0;return!1}if("tuple"===i.type){for(let t of i.items)if(e(t,r))return!0;if(i.rest&&e(i.rest,r))return!0}return!1}(e)&&(delete s.schema.examples,delete s.schema.default),"input"===t.io&&"_prefault"in s.schema&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function jI(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{if(t[1].schema.$ref)return;let r=t[1],{ref:i,defId:a}=(t=>{let r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i("__shared")}#/${r}/${a}`}}if(t[1]===n)return{ref:"#"};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}})(t);r.def={...r.schema},a&&(r.defId=a);let s=r.schema;for(let e in s)delete s[e];s.$ref=i};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
319
+
320
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){i(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){i(n);continue}}if(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&"ref"===e.reused){i(n);continue}}}function jE(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=t=>{let n=e.seen.get(t);if(null===n.ref)return;let i=n.def??n.schema,a={...i},s=n.ref;if(n.ref=null,s){r(s);let n=e.seen.get(s),o=n.schema;if(o.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(i.allOf=i.allOf??[],i.allOf.push(o)):Object.assign(i,o),Object.assign(i,a),t._zod.parent===s)for(let e in i)"$ref"!==e&&"allOf"!==e&&(e in a||delete i[e]);if(o.$ref&&n.def)for(let e in i)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let o=t._zod.parent;if(o&&o!==s){r(o);let t=e.seen.get(o);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if("draft-2020-12"===e.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;void 0!==a&&i.id===a&&delete i.id;let s=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,s[e.defId]=e.def)}e.external||Object.keys(s).length>0&&("draft-2020-12"===e.target?i.$defs=s:i.definitions=s);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:jA(t,"input",e.processors),output:jA(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw Error("Error converting schema to JSON.")}}e.s(["$ZodRegistry",0,jw,"$input",0,jj,"$output",0,jk,"globalRegistry",0,j_,"registry",0,jN],4277);let jC=(e,t={})=>n=>{let r=jS({...n,processors:t});return j$(e,r),jI(r,e),jE(r,e)},jA=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},s=jS({...i??{},target:a,io:t,processors:n});return j$(e,s),jI(s,e),jE(s,e)};e.s(["createStandardJSONSchemaMethod",0,jA,"createToJSONSchemaMethod",0,jC,"extractDefs",0,jI,"finalize",0,jE,"initializeContext",0,jS,"process",0,j$],28831);let jT={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},jP=(e,t,n,r)=>{n.type="string";let{minimum:i,maximum:a,format:s,patterns:o,contentEncoding:l}=e._zod.bag;if("number"==typeof i&&(n.minLength=i),"number"==typeof a&&(n.maxLength=a),s&&(n.format=jT[s]??s,""===n.format&&delete n.format,"time"===s&&delete n.format),l&&(n.contentEncoding=l),o&&o.size>0){let e=[...o];1===e.length?n.pattern=e[0].source:e.length>1&&(n.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}},jz=(e,t,n,r)=>{let{minimum:i,maximum:a,format:s,multipleOf:o,exclusiveMaximum:l,exclusiveMinimum:d}=e._zod.bag;"string"==typeof s&&s.includes("int")?n.type="integer":n.type="number";let c="number"==typeof d&&d>=(i??-1/0),u="number"==typeof l&&l<=(a??1/0),m="draft-04"===t.target||"openapi-3.0"===t.target;c?m?(n.minimum=d,n.exclusiveMinimum=!0):n.exclusiveMinimum=d:"number"==typeof i&&(n.minimum=i),u?m?(n.maximum=l,n.exclusiveMaximum=!0):n.exclusiveMaximum=l:"number"==typeof a&&(n.maximum=a),"number"==typeof o&&(n.multipleOf=o)},jO=(e,t,n,r)=>{n.type="boolean"},jM=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("BigInt cannot be represented in JSON Schema")},jR=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Symbols cannot be represented in JSON Schema")},jD=(e,t,n,r)=>{"openapi-3.0"===t.target?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},jL=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Undefined cannot be represented in JSON Schema")},jU=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Void cannot be represented in JSON Schema")},jZ=(e,t,n,r)=>{n.not={}},jF=(e,t,n,r)=>{},jB=(e,t,n,r)=>{},jV=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Date cannot be represented in JSON Schema")},jq=(e,t,n,r)=>{let i=ke(e._zod.def.entries);i.every(e=>"number"==typeof e)&&(n.type="number"),i.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=i},jW=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(void 0===e){if("throw"===t.unrepresentable)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e)if("throw"===t.unrepresentable)throw Error("BigInt literals cannot be represented in JSON Schema");else a.push(Number(e));else a.push(e);if(0===a.length);else if(1===a.length){let e=a[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else a.every(e=>"number"==typeof e)&&(n.type="number"),a.every(e=>"string"==typeof e)&&(n.type="string"),a.every(e=>"boolean"==typeof e)&&(n.type="boolean"),a.every(e=>null===e)&&(n.type="null"),n.enum=a},jH=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("NaN cannot be represented in JSON Schema")},jG=(e,t,n,r)=>{let i=e._zod.pattern;if(!i)throw Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},jK=(e,t,n,r)=>{let i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:s,mime:o}=e._zod.bag;void 0!==a&&(i.minLength=a),void 0!==s&&(i.maxLength=s),o?1===o.length?(i.contentMediaType=o[0],Object.assign(n,i)):(Object.assign(n,i),n.anyOf=o.map(e=>({contentMediaType:e}))):Object.assign(n,i)},jJ=(e,t,n,r)=>{n.type="boolean"},jY=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")},jX=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Function types cannot be represented in JSON Schema")},jQ=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema")},j0=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Map cannot be represented in JSON Schema")},j1=(e,t,n,r)=>{if("throw"===t.unrepresentable)throw Error("Set cannot be represented in JSON Schema")},j2=(e,t,n,r)=>{let i=e._zod.def,{minimum:a,maximum:s}=e._zod.bag;"number"==typeof a&&(n.minItems=a),"number"==typeof s&&(n.maxItems=s),n.type="array",n.items=j$(i.element,t,{...r,path:[...r.path,"items"]})},j4=(e,t,n,r)=>{let i=e._zod.def;n.type="object",n.properties={};let a=i.shape;for(let e in a)n.properties[e]=j$(a[e],t,{...r,path:[...r.path,"properties",e]});let s=new Set([...new Set(Object.keys(a))].filter(e=>{let n=i.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));s.size>0&&(n.required=Array.from(s)),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=j$(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(n.additionalProperties=!1)},j5=(e,t,n,r)=>{let i=e._zod.def,a=!1===i.inclusive,s=i.options.map((e,n)=>j$(e,t,{...r,path:[...r.path,a?"oneOf":"anyOf",n]}));a?n.oneOf=s:n.anyOf=s},j6=(e,t,n,r)=>{let i=e._zod.def,a=j$(i.left,t,{...r,path:[...r.path,"allOf",0]}),s=j$(i.right,t,{...r,path:[...r.path,"allOf",1]}),o=e=>"allOf"in e&&1===Object.keys(e).length;n.allOf=[...o(a)?a.allOf:[a],...o(s)?s.allOf:[s]]},j3=(e,t,n,r)=>{let i=e._zod.def;n.type="array";let a="draft-2020-12"===t.target?"prefixItems":"items",s="draft-2020-12"===t.target||"openapi-3.0"===t.target?"items":"additionalItems",o=i.items.map((e,n)=>j$(e,t,{...r,path:[...r.path,a,n]})),l=i.rest?j$(i.rest,t,{...r,path:[...r.path,s,..."openapi-3.0"===t.target?[i.items.length]:[]]}):null;"draft-2020-12"===t.target?(n.prefixItems=o,l&&(n.items=l)):"openapi-3.0"===t.target?(n.items={anyOf:o},l&&n.items.anyOf.push(l),n.minItems=o.length,l||(n.maxItems=o.length)):(n.items=o,l&&(n.additionalItems=l));let{minimum:d,maximum:c}=e._zod.bag;"number"==typeof d&&(n.minItems=d),"number"==typeof c&&(n.maxItems=c)},j9=(e,t,n,r)=>{let i=e._zod.def;n.type="object";let a=i.keyType,s=a._zod.bag,o=s?.patterns;if("loose"===i.mode&&o&&o.size>0){let e=j$(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});for(let t of(n.patternProperties={},o))n.patternProperties[t.source]=e}else("draft-07"===t.target||"draft-2020-12"===t.target)&&(n.propertyNames=j$(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),n.additionalProperties=j$(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});let l=a._zod.values;if(l){let e=[...l].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(n.required=e)}},j8=(e,t,n,r)=>{let i=e._zod.def,a=j$(i.innerType,t,r),s=t.seen.get(e);"openapi-3.0"===t.target?(s.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},j7=(e,t,n,r)=>{let i=e._zod.def;j$(i.innerType,t,r),t.seen.get(e).ref=i.innerType},we=(e,t,n,r)=>{let i=e._zod.def;j$(i.innerType,t,r),t.seen.get(e).ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},wt=(e,t,n,r)=>{let i=e._zod.def;j$(i.innerType,t,r),t.seen.get(e).ref=i.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},wn=(e,t,n,r)=>{let i,a=e._zod.def;j$(a.innerType,t,r),t.seen.get(e).ref=a.innerType;try{i=a.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}n.default=i},wr=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has("$ZodTransform"),s="input"===t.io?a?i.out:i.in:i.out;j$(s,t,r),t.seen.get(e).ref=s},wi=(e,t,n,r)=>{let i=e._zod.def;j$(i.innerType,t,r),t.seen.get(e).ref=i.innerType,n.readOnly=!0},wa=(e,t,n,r)=>{let i=e._zod.def;j$(i.innerType,t,r),t.seen.get(e).ref=i.innerType},ws=(e,t,n,r)=>{let i=e._zod.def;j$(i.innerType,t,r),t.seen.get(e).ref=i.innerType},wo=(e,t,n,r)=>{let i=e._zod.innerType;j$(i,t,r),t.seen.get(e).ref=i},wl={string:jP,number:jz,boolean:jO,bigint:jM,symbol:jR,null:jD,undefined:jL,void:jU,never:jZ,any:jF,unknown:jB,date:jV,enum:jq,literal:jW,nan:jH,template_literal:jG,file:jK,success:jJ,custom:jY,function:jX,transform:jQ,map:j0,set:j1,array:j2,object:j4,union:j5,intersection:j6,tuple:j3,record:j9,nullable:j8,nonoptional:j7,default:we,prefault:wt,catch:wn,pipe:wr,readonly:wi,promise:wa,optional:ws,lazy:wo};function wd(e,t){if("_idmap"in e){let n=jS({...t,processors:wl}),r={};for(let t of e._idmap.entries()){let[e,r]=t;j$(r,n)}let i={};for(let a of(n.external={registry:e,uri:t?.uri,defs:r},e._idmap.entries())){let[e,t]=a;jI(n,t),i[e]=jE(n,t)}return Object.keys(r).length>0&&(i.__shared={["draft-2020-12"===n.target?"$defs":"definitions"]:r}),{schemas:i}}let n=jS({...t,processors:wl});return j$(e,n),jI(n,e),jE(n,e)}(j=V||(V={})).assertEqual=e=>{},j.assertIs=function(e){},j.assertNever=function(e){throw Error()},j.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},j.getValidEnumValues=e=>{let t=j.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),n={};for(let r of t)n[r]=e[r];return j.objectValues(n)},j.objectValues=e=>j.objectKeys(e).map(function(t){return e[t]}),j.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},j.find=(e,t)=>{for(let n of e)if(t(n))return n},j.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,j.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},j.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(q||(q={})).mergeShapes=(e,t)=>({...e,...t});let wc=V.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),wu=e=>{switch(typeof e){case"undefined":return wc.undefined;case"string":return wc.string;case"number":return Number.isNaN(e)?wc.nan:wc.number;case"boolean":return wc.boolean;case"function":return wc.function;case"bigint":return wc.bigint;case"symbol":return wc.symbol;case"object":if(Array.isArray(e))return wc.array;if(null===e)return wc.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return wc.promise;if("u">typeof Map&&e instanceof Map)return wc.map;if("u">typeof Set&&e instanceof Set)return wc.set;if("u">typeof Date&&e instanceof Date)return wc.date;return wc.object;default:return wc.unknown}},wm=V.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class wp extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(r);else if("invalid_return_type"===i.code)r(i.returnTypeError);else if("invalid_arguments"===i.code)r(i.argumentsError);else if(0===i.path.length)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(e){if(!(e instanceof wp))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,V.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){let t=Object.create(null),n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}wp.create=e=>new wp(e);let wf=(e,t)=>{let n;switch(e.code){case wm.invalid_type:n=e.received===wc.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case wm.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,V.jsonStringifyReplacer)}`;break;case wm.unrecognized_keys:n=`Unrecognized key(s) in object: ${V.joinValues(e.keys,", ")}`;break;case wm.invalid_union:n="Invalid input";break;case wm.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${V.joinValues(e.options)}`;break;case wm.invalid_enum_value:n=`Invalid enum value. Expected ${V.joinValues(e.options)}, received '${e.received}'`;break;case wm.invalid_arguments:n="Invalid function arguments";break;case wm.invalid_return_type:n="Invalid function return type";break;case wm.invalid_date:n="Invalid date";break;case wm.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:V.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case wm.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case wm.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case wm.custom:n="Invalid input";break;case wm.invalid_intersection_types:n="Intersection results could not be merged";break;case wm.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case wm.not_finite:n="Number must be finite";break;default:n=t.defaultError,V.assertNever(e)}return{message:n}};(w=W||(W={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},w.toString=e=>"string"==typeof e?e:e?.message;let wh=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],s={...i,path:a};if(void 0!==i.message)return{...i,path:a,message:i.message};let o="";for(let e of r.filter(e=>!!e).slice().reverse())o=e(s,{data:t,defaultError:o}).message;return{...i,path:a,message:o}};function wg(e,t){let n=wh({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,wf,void 0].filter(e=>!!e)});e.common.issues.push(n)}class wx{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let r of t){if("aborted"===r.status)return wv;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let e of t){let t=await e.key,r=await e.value;n.push({key:t,value:r})}return wx.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if("aborted"===t.status||"aborted"===i.status)return wv;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),"__proto__"!==t.value&&(void 0!==i.value||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}}let wv=Object.freeze({status:"aborted"}),wy=e=>({status:"dirty",value:e}),wb=e=>({status:"valid",value:e}),wk=e=>"u">typeof Promise&&e instanceof Promise;class wj{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}let ww=(e,t)=>{if("valid"===t.status)return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new wp(e.common.issues);return this._error=t,this._error}}};function wN(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return"invalid_enum_value"===t.code?{message:a??i.defaultError}:void 0===i.data?{message:a??r??i.defaultError}:"invalid_type"!==t.code?{message:i.defaultError}:{message:a??n??i.defaultError}},description:i}}class w_{get description(){return this._def.description}_getType(e){return wu(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:wu(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new wx,ctx:{common:e.parent.common,data:e.data,parsedType:wu(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(wk(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wu(e)},r=this._parseSync({data:e,path:n.path,parent:n});return ww(n,r)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wu(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return"valid"===n.status?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>"valid"===e.status?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wu(e)},r=this._parse({data:e,path:n.path,parent:n});return ww(n,await (wk(r)?r:Promise.resolve(r)))}refine(e,t){return this._refinement((n,r)=>{let i=e(n),a=()=>r.addIssue({code:wm.custom,..."string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(n):t});return"u">typeof Promise&&i instanceof Promise?i.then(e=>!!e||(a(),!1)):!!i||(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1))}_refinement(e){return new Nl({schema:this,typeName:H.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return Nd.create(this,this._def)}nullable(){return Nc.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return w1.create(this)}promise(){return No.create(this,this._def)}or(e){return w4.create([this,e],this._def)}and(e){return w3.create(this,e,this._def)}transform(e){return new Nl({...wN(this._def),schema:this,typeName:H.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new Nu({...wN(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:H.ZodDefault})}brand(){return new Nf({typeName:H.ZodBranded,type:this,...wN(this._def)})}catch(e){return new Nm({...wN(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:H.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return Nh.create(this,e)}readonly(){return Ng.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}let wS=/^c[^\s-]{8,}$/i,w$=/^[0-9a-z]+$/,wI=/^[0-9A-HJKMNP-TV-Z]{26}$/i,wE=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,wC=/^[a-z0-9_-]{21}$/i,wA=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,wT=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,wP=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,wz=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,wO=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,wM=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,wR=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,wD=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,wL=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,wU="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",wZ=RegExp(`^${wU}$`);function wF(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}class wB extends w_{_parse(e){var n,r,i,a;let s;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==wc.string){let t=this._getOrReturnCtx(e);return wg(t,{code:wm.invalid_type,expected:wc.string,received:t.parsedType}),wv}let o=new wx;for(let l of this._def.checks)if("min"===l.kind)e.data.length<l.value&&(wg(s=this._getOrReturnCtx(e,s),{code:wm.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if("max"===l.kind)e.data.length>l.value&&(wg(s=this._getOrReturnCtx(e,s),{code:wm.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),o.dirty());else if("length"===l.kind){let t=e.data.length>l.value,n=e.data.length<l.value;(t||n)&&(s=this._getOrReturnCtx(e,s),t?wg(s,{code:wm.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):n&&wg(s,{code:wm.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),o.dirty())}else if("email"===l.kind)wP.test(e.data)||(wg(s=this._getOrReturnCtx(e,s),{validation:"email",code:wm.invalid_string,message:l.message}),o.dirty());else if("emoji"===l.kind)t||(t=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),t.test(e.data)||(wg(s=this._getOrReturnCtx(e,s),{validation:"emoji",code:wm.invalid_string,message:l.message}),o.dirty());else if("uuid"===l.kind)wE.test(e.data)||(wg(s=this._getOrReturnCtx(e,s),{validation:"uuid",code:wm.invalid_string,message:l.message}),o.dirty());else if("nanoid"===l.kind)wC.test(e.data)||(wg(s=this._getOrReturnCtx(e,s),{validation:"nanoid",code:wm.invalid_string,message:l.message}),o.dirty());else if("cuid"===l.kind)wS.test(e.data)||(wg(s=this._getOrReturnCtx(e,s),{validation:"cuid",code:wm.invalid_string,message:l.message}),o.dirty());else if("cuid2"===l.kind)w$.test(e.data)||(wg(s=this._getOrReturnCtx(e,s),{validation:"cuid2",code:wm.invalid_string,message:l.message}),o.dirty());else if("ulid"===l.kind)wI.test(e.data)||(wg(s=this._getOrReturnCtx(e,s),{validation:"ulid",code:wm.invalid_string,message:l.message}),o.dirty());else if("url"===l.kind)try{new URL(e.data)}catch{wg(s=this._getOrReturnCtx(e,s),{validation:"url",code:wm.invalid_string,message:l.message}),o.dirty()}else"regex"===l.kind?(l.regex.lastIndex=0,l.regex.test(e.data)||(wg(s=this._getOrReturnCtx(e,s),{validation:"regex",code:wm.invalid_string,message:l.message}),o.dirty())):"trim"===l.kind?e.data=e.data.trim():"includes"===l.kind?e.data.includes(l.value,l.position)||(wg(s=this._getOrReturnCtx(e,s),{code:wm.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),o.dirty()):"toLowerCase"===l.kind?e.data=e.data.toLowerCase():"toUpperCase"===l.kind?e.data=e.data.toUpperCase():"startsWith"===l.kind?e.data.startsWith(l.value)||(wg(s=this._getOrReturnCtx(e,s),{code:wm.invalid_string,validation:{startsWith:l.value},message:l.message}),o.dirty()):"endsWith"===l.kind?e.data.endsWith(l.value)||(wg(s=this._getOrReturnCtx(e,s),{code:wm.invalid_string,validation:{endsWith:l.value},message:l.message}),o.dirty()):"datetime"===l.kind?(function(e){let t=`${wU}T${wF(e)}`,n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,RegExp(`^${t}$`)})(l).test(e.data)||(wg(s=this._getOrReturnCtx(e,s),{code:wm.invalid_string,validation:"datetime",message:l.message}),o.dirty()):"date"===l.kind?wZ.test(e.data)||(wg(s=this._getOrReturnCtx(e,s),{code:wm.invalid_string,validation:"date",message:l.message}),o.dirty()):"time"===l.kind?RegExp(`^${wF(l)}$`).test(e.data)||(wg(s=this._getOrReturnCtx(e,s),{code:wm.invalid_string,validation:"time",message:l.message}),o.dirty()):"duration"===l.kind?wT.test(e.data)||(wg(s=this._getOrReturnCtx(e,s),{validation:"duration",code:wm.invalid_string,message:l.message}),o.dirty()):"ip"===l.kind?(n=e.data,!(("v4"===(r=l.version)||!r)&&wz.test(n)||("v6"===r||!r)&&wM.test(n))&&1&&(wg(s=this._getOrReturnCtx(e,s),{validation:"ip",code:wm.invalid_string,message:l.message}),o.dirty())):"jwt"===l.kind?!function(e,t){if(!wA.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));if("object"!=typeof i||null===i||"typ"in i&&i?.typ!=="JWT"||!i.alg||t&&i.alg!==t)return!1;return!0}catch{return!1}}(e.data,l.alg)&&(wg(s=this._getOrReturnCtx(e,s),{validation:"jwt",code:wm.invalid_string,message:l.message}),o.dirty()):"cidr"===l.kind?(i=e.data,!(("v4"===(a=l.version)||!a)&&wO.test(i)||("v6"===a||!a)&&wR.test(i))&&1&&(wg(s=this._getOrReturnCtx(e,s),{validation:"cidr",code:wm.invalid_string,message:l.message}),o.dirty())):"base64"===l.kind?wD.test(e.data)||(wg(s=this._getOrReturnCtx(e,s),{validation:"base64",code:wm.invalid_string,message:l.message}),o.dirty()):"base64url"===l.kind?wL.test(e.data)||(wg(s=this._getOrReturnCtx(e,s),{validation:"base64url",code:wm.invalid_string,message:l.message}),o.dirty()):V.assertNever(l);return{status:o.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:wm.invalid_string,...W.errToObj(n)})}_addCheck(e){return new wB({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...W.errToObj(e)})}url(e){return this._addCheck({kind:"url",...W.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...W.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...W.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...W.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...W.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...W.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...W.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...W.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...W.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...W.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...W.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...W.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...W.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...W.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...W.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...W.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...W.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...W.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...W.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...W.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...W.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...W.errToObj(t)})}nonempty(e){return this.min(1,W.errToObj(e))}trim(){return new wB({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new wB({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new wB({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}wB.create=e=>new wB({checks:[],typeName:H.ZodString,coerce:e?.coerce??!1,...wN(e)});class wV extends w_{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){let t;if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==wc.number){let t=this._getOrReturnCtx(e);return wg(t,{code:wm.invalid_type,expected:wc.number,received:t.parsedType}),wv}let n=new wx;for(let r of this._def.checks)"int"===r.kind?V.isInteger(e.data)||(wg(t=this._getOrReturnCtx(e,t),{code:wm.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(wg(t=this._getOrReturnCtx(e,t),{code:wm.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(wg(t=this._getOrReturnCtx(e,t),{code:wm.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"multipleOf"===r.kind?0!==function(e,t){let n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}(e.data,r.value)&&(wg(t=this._getOrReturnCtx(e,t),{code:wm.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(wg(t=this._getOrReturnCtx(e,t),{code:wm.not_finite,message:r.message}),n.dirty()):V.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,W.toString(t))}gt(e,t){return this.setLimit("min",e,!1,W.toString(t))}lte(e,t){return this.setLimit("max",e,!0,W.toString(t))}lt(e,t){return this.setLimit("max",e,!1,W.toString(t))}setLimit(e,t,n,r){return new wV({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:W.toString(r)}]})}_addCheck(e){return new wV({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:W.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:W.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:W.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:W.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:W.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:W.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:W.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:W.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:W.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&V.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;else"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}}wV.create=e=>new wV({checks:[],typeName:H.ZodNumber,coerce:e?.coerce||!1,...wN(e)});class wq extends w_{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){let t;if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==wc.bigint)return this._getInvalidInput(e);let n=new wx;for(let r of this._def.checks)"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(wg(t=this._getOrReturnCtx(e,t),{code:wm.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(wg(t=this._getOrReturnCtx(e,t),{code:wm.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(wg(t=this._getOrReturnCtx(e,t),{code:wm.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):V.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return wg(t,{code:wm.invalid_type,expected:wc.bigint,received:t.parsedType}),wv}gte(e,t){return this.setLimit("min",e,!0,W.toString(t))}gt(e,t){return this.setLimit("min",e,!1,W.toString(t))}lte(e,t){return this.setLimit("max",e,!0,W.toString(t))}lt(e,t){return this.setLimit("max",e,!1,W.toString(t))}setLimit(e,t,n,r){return new wq({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:W.toString(r)}]})}_addCheck(e){return new wq({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:W.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:W.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:W.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:W.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:W.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}wq.create=e=>new wq({checks:[],typeName:H.ZodBigInt,coerce:e?.coerce??!1,...wN(e)});class wW extends w_{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==wc.boolean){let t=this._getOrReturnCtx(e);return wg(t,{code:wm.invalid_type,expected:wc.boolean,received:t.parsedType}),wv}return wb(e.data)}}wW.create=e=>new wW({typeName:H.ZodBoolean,coerce:e?.coerce||!1,...wN(e)});class wH extends w_{_parse(e){let t;if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==wc.date){let t=this._getOrReturnCtx(e);return wg(t,{code:wm.invalid_type,expected:wc.date,received:t.parsedType}),wv}if(Number.isNaN(e.data.getTime()))return wg(this._getOrReturnCtx(e),{code:wm.invalid_date}),wv;let n=new wx;for(let r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(wg(t=this._getOrReturnCtx(e,t),{code:wm.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),n.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(wg(t=this._getOrReturnCtx(e,t),{code:wm.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),n.dirty()):V.assertNever(r);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new wH({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:W.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:W.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}wH.create=e=>new wH({checks:[],coerce:e?.coerce||!1,typeName:H.ZodDate,...wN(e)});class wG extends w_{_parse(e){if(this._getType(e)!==wc.symbol){let t=this._getOrReturnCtx(e);return wg(t,{code:wm.invalid_type,expected:wc.symbol,received:t.parsedType}),wv}return wb(e.data)}}wG.create=e=>new wG({typeName:H.ZodSymbol,...wN(e)});class wK extends w_{_parse(e){if(this._getType(e)!==wc.undefined){let t=this._getOrReturnCtx(e);return wg(t,{code:wm.invalid_type,expected:wc.undefined,received:t.parsedType}),wv}return wb(e.data)}}wK.create=e=>new wK({typeName:H.ZodUndefined,...wN(e)});class wJ extends w_{_parse(e){if(this._getType(e)!==wc.null){let t=this._getOrReturnCtx(e);return wg(t,{code:wm.invalid_type,expected:wc.null,received:t.parsedType}),wv}return wb(e.data)}}wJ.create=e=>new wJ({typeName:H.ZodNull,...wN(e)});class wY extends w_{constructor(){super(...arguments),this._any=!0}_parse(e){return wb(e.data)}}wY.create=e=>new wY({typeName:H.ZodAny,...wN(e)});class wX extends w_{constructor(){super(...arguments),this._unknown=!0}_parse(e){return wb(e.data)}}wX.create=e=>new wX({typeName:H.ZodUnknown,...wN(e)});class wQ extends w_{_parse(e){let t=this._getOrReturnCtx(e);return wg(t,{code:wm.invalid_type,expected:wc.never,received:t.parsedType}),wv}}wQ.create=e=>new wQ({typeName:H.ZodNever,...wN(e)});class w0 extends w_{_parse(e){if(this._getType(e)!==wc.undefined){let t=this._getOrReturnCtx(e);return wg(t,{code:wm.invalid_type,expected:wc.void,received:t.parsedType}),wv}return wb(e.data)}}w0.create=e=>new w0({typeName:H.ZodVoid,...wN(e)});class w1 extends w_{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==wc.array)return wg(t,{code:wm.invalid_type,expected:wc.array,received:t.parsedType}),wv;if(null!==r.exactLength){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(wg(t,{code:e?wm.too_big:wm.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(wg(t,{code:wm.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(wg(t,{code:wm.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new wj(t,e,t.path,n)))).then(e=>wx.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new wj(t,e,t.path,n)));return wx.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new w1({...this._def,minLength:{value:e,message:W.toString(t)}})}max(e,t){return new w1({...this._def,maxLength:{value:e,message:W.toString(t)}})}length(e,t){return new w1({...this._def,exactLength:{value:e,message:W.toString(t)}})}nonempty(e){return this.min(1,e)}}w1.create=(e,t)=>new w1({type:e,minLength:null,maxLength:null,exactLength:null,typeName:H.ZodArray,...wN(t)});class w2 extends w_{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=V.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==wc.object){let t=this._getOrReturnCtx(e);return wg(t,{code:wm.invalid_type,expected:wc.object,received:t.parsedType}),wv}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof wQ&&"strip"===this._def.unknownKeys))for(let e in n.data)i.includes(e)||a.push(e);let s=[];for(let e of i){let t=r[e],i=n.data[e];s.push({key:{status:"valid",value:e},value:t._parse(new wj(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof wQ){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of a)s.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)a.length>0&&(wg(n,{code:wm.unrecognized_keys,keys:a}),t.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];s.push({key:{status:"valid",value:t},value:e._parse(new wj(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of s){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>wx.mergeObjectSync(t,e)):wx.mergeObjectSync(t,s)}get shape(){return this._def.shape()}strict(e){return W.errToObj,new w2({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{let r=this._def.errorMap?.(t,n).message??n.defaultError;return"unrecognized_keys"===t.code?{message:W.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new w2({...this._def,unknownKeys:"strip"})}passthrough(){return new w2({...this._def,unknownKeys:"passthrough"})}extend(e){return new w2({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new w2({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:H.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new w2({...this._def,catchall:e})}pick(e){let t={};for(let n of V.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new w2({...this._def,shape:()=>t})}omit(e){let t={};for(let n of V.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new w2({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof w2){let n={};for(let r in t.shape){let i=t.shape[r];n[r]=Nd.create(e(i))}return new w2({...t._def,shape:()=>n})}if(t instanceof w1)return new w1({...t._def,type:e(t.element)});if(t instanceof Nd)return Nd.create(e(t.unwrap()));if(t instanceof Nc)return Nc.create(e(t.unwrap()));if(t instanceof w9)return w9.create(t.items.map(t=>e(t)));else return t}(this)}partial(e){let t={};for(let n of V.objectKeys(this.shape)){let r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()}return new w2({...this._def,shape:()=>t})}required(e){let t={};for(let n of V.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Nd;)e=e._def.innerType;t[n]=e}return new w2({...this._def,shape:()=>t})}keyof(){return Ni(V.objectKeys(this.shape))}}w2.create=(e,t)=>new w2({shape:()=>e,unknownKeys:"strip",catchall:wQ.create(),typeName:H.ZodObject,...wN(t)}),w2.strictCreate=(e,t)=>new w2({shape:()=>e,unknownKeys:"strict",catchall:wQ.create(),typeName:H.ZodObject,...wN(t)}),w2.lazycreate=(e,t)=>new w2({shape:e,unknownKeys:"strip",catchall:wQ.create(),typeName:H.ZodObject,...wN(t)});class w4 extends w_{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(function(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new wp(e.ctx.common.issues));return wg(t,{code:wm.invalid_union,unionErrors:n}),wv});{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new wp(e));return wg(t,{code:wm.invalid_union,unionErrors:i}),wv}}get options(){return this._def.options}}w4.create=(e,t)=>new w4({options:e,typeName:H.ZodUnion,...wN(t)});let w5=e=>{if(e instanceof Nn)return w5(e.schema);if(e instanceof Nl)return w5(e.innerType());if(e instanceof Nr)return[e.value];if(e instanceof Na)return e.options;if(e instanceof Ns)return V.objectValues(e.enum);else if(e instanceof Nu)return w5(e._def.innerType);else if(e instanceof wK)return[void 0];else if(e instanceof wJ)return[null];else if(e instanceof Nd)return[void 0,...w5(e.unwrap())];else if(e instanceof Nc)return[null,...w5(e.unwrap())];else if(e instanceof Nf)return w5(e.unwrap());else if(e instanceof Ng)return w5(e.unwrap());else if(e instanceof Nm)return w5(e._def.innerType);else return[]};class w6 extends w_{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==wc.object)return wg(t,{code:wm.invalid_type,expected:wc.object,received:t.parsedType}),wv;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(wg(t,{code:wm.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),wv)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let r=new Map;for(let n of t){let t=w5(n.shape[e]);if(!t.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of t){if(r.has(i))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,n)}}return new w6({typeName:H.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...wN(n)})}}class w3 extends w_{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if("aborted"===e.status||"aborted"===r.status)return wv;let i=function e(t,n){let r=wu(t),i=wu(n);if(t===n)return{valid:!0,data:t};if(r===wc.object&&i===wc.object){let r=V.objectKeys(n),i=V.objectKeys(t).filter(e=>-1!==r.indexOf(e)),a={...t,...n};for(let r of i){let i=e(t[r],n[r]);if(!i.valid)return{valid:!1};a[r]=i.data}return{valid:!0,data:a}}if(r===wc.array&&i===wc.array){if(t.length!==n.length)return{valid:!1};let r=[];for(let i=0;i<t.length;i++){let a=e(t[i],n[i]);if(!a.valid)return{valid:!1};r.push(a.data)}return{valid:!0,data:r}}if(r===wc.date&&i===wc.date&&+t==+n)return{valid:!0,data:t};return{valid:!1}}(e.value,r.value);return i.valid?(("dirty"===e.status||"dirty"===r.status)&&t.dirty(),{status:t.value,value:i.data}):(wg(n,{code:wm.invalid_intersection_types}),wv)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}w3.create=(e,t,n)=>new w3({left:e,right:t,typeName:H.ZodIntersection,...wN(n)});class w9 extends w_{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==wc.array)return wg(n,{code:wm.invalid_type,expected:wc.array,received:n.parsedType}),wv;if(n.data.length<this._def.items.length)return wg(n,{code:wm.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),wv;!this._def.rest&&n.data.length>this._def.items.length&&(wg(n,{code:wm.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new wj(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>wx.mergeArray(t,e)):wx.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new w9({...this._def,rest:e})}}w9.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new w9({items:e,typeName:H.ZodTuple,rest:null,...wN(t)})};class w8 extends w_{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==wc.object)return wg(n,{code:wm.invalid_type,expected:wc.object,received:n.parsedType}),wv;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new wj(n,e,n.path,e)),value:a._parse(new wj(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?wx.mergeObjectAsync(t,r):wx.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new w8(t instanceof w_?{keyType:e,valueType:t,typeName:H.ZodRecord,...wN(n)}:{keyType:wB.create(),valueType:e,typeName:H.ZodRecord,...wN(t)})}}class w7 extends w_{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==wc.map)return wg(n,{code:wm.invalid_type,expected:wc.map,received:n.parsedType}),wv;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new wj(n,e,n.path,[a,"key"])),value:i._parse(new wj(n,t,n.path,[a,"value"]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if("aborted"===r.status||"aborted"===i.status)return wv;("dirty"===r.status||"dirty"===i.status)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let n of a){let r=n.key,i=n.value;if("aborted"===r.status||"aborted"===i.status)return wv;("dirty"===r.status||"dirty"===i.status)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}}w7.create=(e,t,n)=>new w7({valueType:t,keyType:e,typeName:H.ZodMap,...wN(n)});class Ne extends w_{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==wc.set)return wg(n,{code:wm.invalid_type,expected:wc.set,received:n.parsedType}),wv;let r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(wg(n,{code:wm.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(wg(n,{code:wm.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if("aborted"===r.status)return wv;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let s=[...n.data.values()].map((e,t)=>i._parse(new wj(n,e,n.path,t)));return n.common.async?Promise.all(s).then(e=>a(e)):a(s)}min(e,t){return new Ne({...this._def,minSize:{value:e,message:W.toString(t)}})}max(e,t){return new Ne({...this._def,maxSize:{value:e,message:W.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ne.create=(e,t)=>new Ne({valueType:e,minSize:null,maxSize:null,typeName:H.ZodSet,...wN(t)});class Nt extends w_{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==wc.function)return wg(t,{code:wm.invalid_type,expected:wc.function,received:t.parsedType}),wv;function n(e,n){return wh({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,wf,wf].filter(e=>!!e),issueData:{code:wm.invalid_arguments,argumentsError:n}})}function r(e,n){return wh({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,wf,wf].filter(e=>!!e),issueData:{code:wm.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof No){let e=this;return wb(async function(...t){let s=new wp([]),o=await e._def.args.parseAsync(t,i).catch(e=>{throw s.addIssue(n(t,e)),s}),l=await Reflect.apply(a,this,o);return await e._def.returns._def.type.parseAsync(l,i).catch(e=>{throw s.addIssue(r(l,e)),s})})}{let e=this;return wb(function(...t){let s=e._def.args.safeParse(t,i);if(!s.success)throw new wp([n(t,s.error)]);let o=Reflect.apply(a,this,s.data),l=e._def.returns.safeParse(o,i);if(!l.success)throw new wp([r(o,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Nt({...this._def,args:w9.create(e).rest(wX.create())})}returns(e){return new Nt({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Nt({args:e||w9.create([]).rest(wX.create()),returns:t||wX.create(),typeName:H.ZodFunction,...wN(n)})}}class Nn extends w_{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Nn.create=(e,t)=>new Nn({getter:e,typeName:H.ZodLazy,...wN(t)});class Nr extends w_{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return wg(t,{received:t.data,code:wm.invalid_literal,expected:this._def.value}),wv}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Ni(e,t){return new Na({values:e,typeName:H.ZodEnum,...wN(t)})}Nr.create=(e,t)=>new Nr({value:e,typeName:H.ZodLiteral,...wN(t)});class Na extends w_{_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),n=this._def.values;return wg(t,{expected:V.joinValues(n),received:t.parsedType,code:wm.invalid_type}),wv}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return wg(t,{received:t.data,code:wm.invalid_enum_value,options:n}),wv}return wb(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Na.create(e,{...this._def,...t})}exclude(e,t=this._def){return Na.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}Na.create=Ni;class Ns extends w_{_parse(e){let t=V.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==wc.string&&n.parsedType!==wc.number){let e=V.objectValues(t);return wg(n,{expected:V.joinValues(e),received:n.parsedType,code:wm.invalid_type}),wv}if(this._cache||(this._cache=new Set(V.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let e=V.objectValues(t);return wg(n,{received:n.data,code:wm.invalid_enum_value,options:e}),wv}return wb(e.data)}get enum(){return this._def.values}}Ns.create=(e,t)=>new Ns({values:e,typeName:H.ZodNativeEnum,...wN(t)});class No extends w_{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==wc.promise&&!1===t.common.async?(wg(t,{code:wm.invalid_type,expected:wc.promise,received:t.parsedType}),wv):wb((t.parsedType===wc.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}No.create=(e,t)=>new No({type:e,typeName:H.ZodPromise,...wN(t)});class Nl extends w_{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===H.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{wg(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),"preprocess"===r.type){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return wv;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===r.status?wv:"dirty"===r.status||"dirty"===t.value?wy(r.value):r});{if("aborted"===t.value)return wv;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===r.status?wv:"dirty"===r.status||"dirty"===t.value?wy(r.value):r}}if("refinement"===r.type){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==n.common.async)return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>"aborted"===n.status?wv:("dirty"===n.status&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))));{let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?wv:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}}if("transform"===r.type)if(!1!==n.common.async)return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>"valid"!==e.status?wv:Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})));else{let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if("valid"!==e.status)return wv;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}V.assertNever(r)}}Nl.create=(e,t,n)=>new Nl({schema:e,typeName:H.ZodEffects,effect:t,...wN(n)}),Nl.createWithPreprocess=(e,t,n)=>new Nl({schema:t,effect:{type:"preprocess",transform:e},typeName:H.ZodEffects,...wN(n)});class Nd extends w_{_parse(e){return this._getType(e)===wc.undefined?wb(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Nd.create=(e,t)=>new Nd({innerType:e,typeName:H.ZodOptional,...wN(t)});class Nc extends w_{_parse(e){return this._getType(e)===wc.null?wb(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Nc.create=(e,t)=>new Nc({innerType:e,typeName:H.ZodNullable,...wN(t)});class Nu extends w_{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===wc.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Nu.create=(e,t)=>new Nu({innerType:e,typeName:H.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...wN(t)});class Nm extends w_{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return wk(r)?r.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new wp(n.common.issues)},input:n.data})})):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new wp(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Nm.create=(e,t)=>new Nm({innerType:e,typeName:H.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...wN(t)});class Np extends w_{_parse(e){if(this._getType(e)!==wc.nan){let t=this._getOrReturnCtx(e);return wg(t,{code:wm.invalid_type,expected:wc.nan,received:t.parsedType}),wv}return{status:"valid",value:e.data}}}Np.create=e=>new Np({typeName:H.ZodNaN,...wN(e)}),Symbol("zod_brand");class Nf extends w_{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Nh extends w_{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?wv:"dirty"===e.status?(t.dirty(),wy(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?wv:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new Nh({in:e,out:t,typeName:H.ZodPipeline})}}class Ng extends w_{_parse(e){let t=this._def.innerType._parse(e),n=e=>("valid"===e.status&&(e.value=Object.freeze(e.value)),e);return wk(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}}Ng.create=(e,t)=>new Ng({innerType:e,typeName:H.ZodReadonly,...wN(t)}),w2.lazycreate,(N=H||(H={})).ZodString="ZodString",N.ZodNumber="ZodNumber",N.ZodNaN="ZodNaN",N.ZodBigInt="ZodBigInt",N.ZodBoolean="ZodBoolean",N.ZodDate="ZodDate",N.ZodSymbol="ZodSymbol",N.ZodUndefined="ZodUndefined",N.ZodNull="ZodNull",N.ZodAny="ZodAny",N.ZodUnknown="ZodUnknown",N.ZodNever="ZodNever",N.ZodVoid="ZodVoid",N.ZodArray="ZodArray",N.ZodObject="ZodObject",N.ZodUnion="ZodUnion",N.ZodDiscriminatedUnion="ZodDiscriminatedUnion",N.ZodIntersection="ZodIntersection",N.ZodTuple="ZodTuple",N.ZodRecord="ZodRecord",N.ZodMap="ZodMap",N.ZodSet="ZodSet",N.ZodFunction="ZodFunction",N.ZodLazy="ZodLazy",N.ZodLiteral="ZodLiteral",N.ZodEnum="ZodEnum",N.ZodEffects="ZodEffects",N.ZodNativeEnum="ZodNativeEnum",N.ZodOptional="ZodOptional",N.ZodNullable="ZodNullable",N.ZodDefault="ZodDefault",N.ZodCatch="ZodCatch",N.ZodPromise="ZodPromise",N.ZodBranded="ZodBranded",N.ZodPipeline="ZodPipeline",N.ZodReadonly="ZodReadonly",wB.create,wV.create,Np.create,wq.create,wW.create,wH.create,wG.create,wK.create,wJ.create,wY.create,wX.create,wQ.create,w0.create,w1.create,w2.create,w2.strictCreate,w4.create,w6.create,w3.create,w9.create,w8.create,w7.create,Ne.create,Nt.create,Nn.create,Nr.create,Na.create,Ns.create,No.create,Nl.create,Nd.create,Nc.create,Nl.createWithPreprocess,Nh.create;class Nx extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}function Nv(e){}function Ny(e,t,n){return 100===n&&97===e.charCodeAt(t+1)&&116===e.charCodeAt(t+2)&&97===e.charCodeAt(t+3)&&58===e.charCodeAt(t+4)}function Nb(e,t,n){return 101===n&&118===e.charCodeAt(t+1)&&101===e.charCodeAt(t+2)&&110===e.charCodeAt(t+3)&&116===e.charCodeAt(t+4)&&58===e.charCodeAt(t+5)}class Nk extends TransformStream{constructor({onError:e,onRetry:t,onComment:n,maxBufferSize:r}={}){let i;super({start(a){i=function(e){if("function"==typeof e)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:t=Nv,onError:n=Nv,onRetry:r=Nv,onComment:i,maxBufferSize:a}=e,s=[],o=0,l=!0,d,c="",u=0,m,p=!1;function f(){void 0!==a&&(o+c.length<=a||(p=!0,s.length=0,o=0,d=void 0,c="",u=0,m=void 0,n(new Nx(`Buffered data exceeded max buffer size of ${a} characters`,{type:"max-buffer-size-exceeded"}))))}function h(e){let n=0;if(-1===e.indexOf("\r")){let r=e.indexOf(`
321
+ `,n);for(;-1!==r;){if(n===r){u>0&&t({id:d,event:m,data:c}),d=void 0,c="",u=0,m=void 0,n=r+1,r=e.indexOf(`
322
+ `,n);continue}let i=e.charCodeAt(n);if(Ny(e,n,i)){let i=32===e.charCodeAt(n+5)?n+6:n+5,a=e.slice(i,r);if(0===u&&10===e.charCodeAt(r+1)){t({id:d,event:m,data:a}),d=void 0,c="",m=void 0,n=r+2,r=e.indexOf(`
323
+ `,n);continue}c=0===u?a:`${c}
324
+ ${a}`,u++}else Nb(e,n,i)?m=e.slice(32===e.charCodeAt(n+6)?n+7:n+6,r)||void 0:g(e,n,r);n=r+1,r=e.indexOf(`
325
+ `,n)}return e.slice(n)}for(;n<e.length;){let t=e.indexOf("\r",n),r=e.indexOf(`
326
+ `,n),i=-1;if(-1!==t&&-1!==r?i=t<r?t:r:-1!==t?i=t===e.length-1?-1:t:-1!==r&&(i=r),-1===i)break;g(e,n,i),n=i+1,13===e.charCodeAt(n-1)&&10===e.charCodeAt(n)&&n++}return e.slice(n)}function g(e,n,r){if(n===r)return void(u>0&&t({id:d,event:m,data:c}),d=void 0,c="",u=0,m=void 0);let a=e.charCodeAt(n);if(Ny(e,n,a)){let t=32===e.charCodeAt(n+5)?n+6:n+5,i=e.slice(t,r);c=0===u?i:`${c}
327
+ ${i}`,u++;return}if(Nb(e,n,a)){m=e.slice(32===e.charCodeAt(n+6)?n+7:n+6,r)||void 0;return}if(105===a&&100===e.charCodeAt(n+1)&&58===e.charCodeAt(n+2)){let t=e.slice(32===e.charCodeAt(n+3)?n+4:n+3,r);d=t.includes("\0")?void 0:t;return}if(58===a){i&&i(e.slice(n,r).slice(32===e.charCodeAt(n+1)?2:1));return}let s=e.slice(n,r),o=s.indexOf(":");if(-1===o)return void x(s,"",s);let l=s.slice(0,o),p=32===s.charCodeAt(o+1)?2:1;x(l,s.slice(o+p),s)}function x(e,t,i){switch(e){case"event":m=t||void 0;break;case"data":c=0===u?t:`${c}
328
+ ${t}`,u++;break;case"id":d=t.includes("\0")?void 0:t;break;case"retry":/^\d+$/.test(t)?r(parseInt(t,10)):n(new Nx(`Invalid \`retry\` value: "${t}"`,{type:"invalid-retry",value:t,line:i}));break;default:n(new Nx(`Unknown field "${e.length>20?`${e.slice(0,20)}\u2026`:e}"`,{type:"unknown-field",field:e,value:t,line:i}))}}return{feed:function(e){if(p)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(l&&(l=!1,239===e.charCodeAt(0)&&187===e.charCodeAt(1)&&191===e.charCodeAt(2)&&(e=e.slice(3))),0===s.length){let t=h(e);""!==t&&(s.push(t),o=t.length),f();return}if(-1===e.indexOf(`
329
+ `)&&-1===e.indexOf("\r")){s.push(e),o+=e.length,f();return}s.push(e);let t=s.join("");s.length=0,o=0;let n=h(t);""!==n&&(s.push(n),o=n.length),f()},reset:function(e={}){if(e.consume&&s.length>0){let e=s.join("");g(e,0,e.length)}l=!0,d=void 0,c="",u=0,m=void 0,s.length=0,o=0,p=!1}}}({onEvent:e=>{a.enqueue(e)},onError(t){"function"==typeof e&&e(t),("terminate"===e||"max-buffer-size-exceeded"===t.type)&&a.error(t)},onRetry:t,onComment:n,maxBufferSize:r})},transform(e){i.feed(e)}})}}function Nj(...e){return e.reduce((e,t)=>({...e,...null!=t?t:{}}),{})}function Nw(e){return Object.fromEntries([...e.headers])}var{btoa:NN,atob:N_}=globalThis;function NS(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCodePoint(e[n]);return NN(t)}async function N$(e){var t;try{await (null==(t=e.body)?void 0:t.cancel())}catch(e){}}var NI="AI_DownloadError",NE=`vercel.ai.error.${NI}`,NC=Symbol.for(NE),NA=class extends(K=bT,G=NC,K){constructor({url:e,statusCode:t,statusText:n,cause:r,message:i=null==r?`Failed to download ${e}: ${t} ${n}`:`Failed to download ${e}: ${r}`}){super({name:NI,message:i,cause:r}),this[G]=!0,this.url=e,this.statusCode=t,this.statusText=n}static isInstance(e){return bT.hasMarker(e,NE)}};function NT(e){let t=e.split(".");return 4===t.length&&t.every(e=>{let t=Number(e);return Number.isInteger(t)&&t>=0&&t<=255&&String(t)===e})}function NP(e){let[t,n,r]=e.split(".").map(Number);return 0===t||10===t||100===t&&n>=64&&n<=127||127===t||169===t&&254===n||172===t&&n>=16&&n<=31||192===t&&0===n&&0===r||192===t&&168===n||198===t&&(18===n||19===n)||t>=240||!1}async function Nz({url:e,headers:t,abortSignal:n,maxRedirects:r=10}){let i={signal:n};void 0!==t&&(i.headers=t);let a=e;for(let t=0;t<=r;t++){!function(e){let t;try{t=new URL(e)}catch(t){throw new NA({url:e,message:`Invalid URL: ${e}`})}if("data:"===t.protocol)return;if("http:"!==t.protocol&&"https:"!==t.protocol)throw new NA({url:e,message:`URL scheme must be http, https, or data, got ${t.protocol}`});let n=t.hostname.toLowerCase().replace(/\.+$/,"");if(!n)throw new NA({url:e,message:"URL must have a hostname"});if("localhost"===n||n.endsWith(".local")||n.endsWith(".localhost"))throw new NA({url:e,message:`URL with hostname ${n} is not allowed`});if(n.startsWith("[")&&n.endsWith("]")){if(function(e){let t=function(e){let t=e.toLowerCase(),n=t.indexOf("%");-1!==n&&(t=t.slice(0,n));let r=t.split("::");if(r.length>2)return null;let i=e=>{if(""===e)return[];let t=[],n=e.split(":");for(let e=0;e<n.length;e++){let r=n[e];if(r.includes(".")){if(e!==n.length-1||!NT(r))return null;let[i,a,s,o]=r.split(".").map(Number);t.push(i<<8|a,s<<8|o);continue}if(!/^[0-9a-f]{1,4}$/.test(r))return null;t.push(parseInt(r,16))}return t},a=i(r[0]);if(null===a)return null;if(2===r.length){let e=i(r[1]);if(null===e)return null;let t=8-a.length-e.length;return t<0?null:[...a,...Array(t).fill(0),...e]}return 8===a.length?a:null}(e);if(null===t)return!0;let n=e=>t.slice(0,e).every(e=>0===e);if(n(7)&&(0===t[7]||1===t[7])||(65024&t[0])==64512||(65472&t[0])==65152||(65472&t[0])==65216||(65280&t[0])==65280)return!0;if(n(6)||n(5)&&65535===t[5]||n(4)&&65535===t[4]&&0===t[5]||100===t[0]&&65435===t[1]&&0===t[2]&&0===t[3]&&0===t[4]&&0===t[5]||100===t[0]&&65435===t[1]&&1===t[2]){let e=t[6]>>8&255,n=255&t[6],r=t[7]>>8&255,i=255&t[7];return NP(`${e}.${n}.${r}.${i}`)}return!1}(n.slice(1,-1)))throw new NA({url:e,message:`URL with IPv6 address ${n} is not allowed`});return}if(NT(n)&&NP(n))throw new NA({url:e,message:`URL with IP address ${n} is not allowed`})}(a);let t=await fetch(a,{...i,redirect:"manual"});if("opaqueredirect"===t.type){if(!function(e=globalThis){return null!=e.window}())throw new NA({url:e,message:`Redirect from ${a} could not be validated and was blocked`});return await fetch(a,{...i,redirect:"follow"})}let n=t.headers.get("location");if(t.status>=300&&t.status<400&&n){await N$(t),a=new URL(n,a).toString();continue}return t}throw new NA({url:e,message:`Too many redirects (max ${r})`})}async function NO({response:e,url:t,maxBytes:n=0x80000000}){let r=e.headers.get("content-length");if(null!=r){let i=parseInt(r,10);if(!isNaN(i)&&i>n)throw await N$(e),new NA({url:t,message:`Download of ${t} exceeded maximum size of ${n} bytes (Content-Length: ${i}).`})}let i=e.body;if(null==i)return new Uint8Array(0);let a=i.getReader(),s=[],o=0;try{for(;;){let{done:e,value:r}=await a.read();if(e)break;if((o+=r.length)>n)throw new NA({url:t,message:`Download of ${t} exceeded maximum size of ${n} bytes.`});s.push(r)}}finally{try{await a.cancel()}finally{a.releaseLock()}}let l=new Uint8Array(o),d=0;for(let e of s)l.set(e,d),d+=e.length;return l}var NM=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{let i=()=>{let e=n.length,r=Array(t);for(let i=0;i<t;i++)r[i]=n[Math.random()*e|0];return r.join("")};if(null==e)return i;if(n.includes(r))throw new bq({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${i()}`},NR=NM();function ND(e){return(e instanceof Error||e instanceof DOMException)&&("AbortError"===e.name||"ResponseAborted"===e.name||"TimeoutError"===e.name)}var NL=["fetch failed","failed to fetch"],NU=["ConnectionRefused","ConnectionClosed","FailedToOpenSocket","ECONNRESET","ECONNREFUSED","ETIMEDOUT","EPIPE"];function NZ({error:e,url:t,requestBodyValues:n}){if(ND(e))return e;if(e instanceof TypeError&&NL.includes(e.message.toLowerCase())){let r=e.cause;if(null!=r)return new bM({message:`Cannot connect to API: ${r.message}`,cause:r,url:t,requestBodyValues:n,isRetryable:!0})}return!function(e){if(!(e instanceof Error))return!1;let t=e.code;return!!("string"==typeof t&&NU.includes(t))}(e)?e:new bM({message:`Cannot connect to API: ${e.message}`,cause:e,url:t,requestBodyValues:n,isRetryable:!0})}function NF(e=globalThis){var t,n,r;return e.window?"runtime/browser":(null==(t=e.navigator)?void 0:t.userAgent)?`runtime/${e.navigator.userAgent.toLowerCase()}`:(null==(r=null==(n=e.process)?void 0:n.versions)?void 0:r.node)?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function NB(e){if(null==e)return{};let t={};if(e instanceof Headers)e.forEach((e,n)=>{t[n.toLowerCase()]=e});else for(let[n,r]of(Array.isArray(e)||(e=Object.entries(e)),e))null!=r&&(t[n.toLowerCase()]=r);return t}function NV(e,...t){let n=new Headers(NB(e)),r=n.get("user-agent")||"";return n.set("user-agent",[r,...t].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var Nq="4.0.30",NW=()=>globalThis.fetch,NH=async({url:e,headers:t={},successfulResponseHandler:n,failedResponseHandler:r,abortSignal:i,fetch:a=NW()})=>{try{let s=await a(e,{method:"GET",headers:NV(t,`ai-sdk/provider-utils/${Nq}`,NF()),signal:i}),o=Nw(s);if(!s.ok){let t;try{t=await r({response:s,url:e,requestBodyValues:{}})}catch(t){if(ND(t)||bM.isInstance(t))throw t;throw new bM({message:"Failed to process error response",cause:t,statusCode:s.status,url:e,responseHeaders:o,requestBodyValues:{}})}throw t.value}try{return await n({response:s,url:e,requestBodyValues:{}})}catch(t){if(t instanceof Error&&(ND(t)||bM.isInstance(t)))throw t;throw new bM({message:"Failed to process successful response",cause:t,statusCode:s.status,url:e,responseHeaders:o,requestBodyValues:{}})}}catch(t){throw NZ({error:t,url:e,requestBodyValues:{}})}};function NG({settingValue:e,environmentVariableName:t}){return"string"==typeof e?e:null!=e||void 0===tt.default?void 0:null!=(e=tt.default.env[t])&&"string"==typeof e?e:void 0}var NK=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,NJ=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function NY(e){let t=JSON.parse(e);return null===t||"object"!=typeof t||!1===NK.test(e)&&!1===NJ.test(e)?t:function(e){let t=[e];for(;t.length;){let e=t;for(let n of(t=[],e)){if(Object.prototype.hasOwnProperty.call(n,"__proto__")||Object.prototype.hasOwnProperty.call(n,"constructor")&&null!==n.constructor&&"object"==typeof n.constructor&&Object.prototype.hasOwnProperty.call(n.constructor,"prototype"))throw SyntaxError("Object contains forbidden prototype property");for(let e in n){let r=n[e];r&&"object"==typeof r&&t.push(r)}}}return e}(t)}function NX(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch(t){return NY(e)}try{return NY(e)}finally{Error.stackTraceLimit=t}}function NQ(e){if("object"===e.type||Array.isArray(e.type)&&e.type.includes("object")){e.additionalProperties=!1;let{properties:t}=e;if(null!=t)for(let e of Object.keys(t))t[e]=N0(t[e])}null!=e.items&&(e.items=Array.isArray(e.items)?e.items.map(N0):N0(e.items)),null!=e.anyOf&&(e.anyOf=e.anyOf.map(N0)),null!=e.allOf&&(e.allOf=e.allOf.map(N0)),null!=e.oneOf&&(e.oneOf=e.oneOf.map(N0));let{definitions:t}=e;if(null!=t)for(let e of Object.keys(t))t[e]=N0(t[e]);return e}function N0(e){return"boolean"==typeof e?e:NQ(e)}var N1=Symbol("Let zodToJsonSchema decide on which parser to use"),N2={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"};function N4(e,t){return _f(e.type._def,t)}var N5=void 0,N6=/^[cC][^\s-]{8,}$/,N3=/^[0-9a-z]+$/,N9=/^[0-9A-HJKMNP-TV-Z]{26}$/,N8=/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,N7=()=>(void 0===N5&&(N5=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),N5),_e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,_t=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,_n=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_r=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,_i=/^[a-zA-Z0-9_-]{21}$/,_a=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;function _s(e,t){let n={type:"string"};if(e.checks)for(let r of e.checks)switch(r.kind){case"min":n.minLength="number"==typeof n.minLength?Math.max(n.minLength,r.value):r.value;break;case"max":n.maxLength="number"==typeof n.maxLength?Math.min(n.maxLength,r.value):r.value;break;case"email":switch(t.emailStrategy){case"format:email":_d(n,"email",r.message,t);break;case"format:idn-email":_d(n,"idn-email",r.message,t);break;case"pattern:zod":_c(n,N8,r.message,t)}break;case"url":_d(n,"uri",r.message,t);break;case"uuid":_d(n,"uuid",r.message,t);break;case"regex":_c(n,r.regex,r.message,t);break;case"cuid":_c(n,N6,r.message,t);break;case"cuid2":_c(n,N3,r.message,t);break;case"startsWith":_c(n,RegExp(`^${_o(r.value,t)}`),r.message,t);break;case"endsWith":_c(n,RegExp(`${_o(r.value,t)}$`),r.message,t);break;case"datetime":_d(n,"date-time",r.message,t);break;case"date":_d(n,"date",r.message,t);break;case"time":_d(n,"time",r.message,t);break;case"duration":_d(n,"duration",r.message,t);break;case"length":n.minLength="number"==typeof n.minLength?Math.max(n.minLength,r.value):r.value,n.maxLength="number"==typeof n.maxLength?Math.min(n.maxLength,r.value):r.value;break;case"includes":_c(n,RegExp(_o(r.value,t)),r.message,t);break;case"ip":"v6"!==r.version&&_d(n,"ipv4",r.message,t),"v4"!==r.version&&_d(n,"ipv6",r.message,t);break;case"base64url":_c(n,_r,r.message,t);break;case"jwt":_c(n,_a,r.message,t);break;case"cidr":"v6"!==r.version&&_c(n,_e,r.message,t),"v4"!==r.version&&_c(n,_t,r.message,t);break;case"emoji":_c(n,N7(),r.message,t);break;case"ulid":_c(n,N9,r.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":_d(n,"binary",r.message,t);break;case"contentEncoding:base64":n.contentEncoding="base64";break;case"pattern:zod":_c(n,_n,r.message,t)}break;case"nanoid":_c(n,_i,r.message,t)}return n}function _o(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let n=0;n<e.length;n++)_l.has(e[n])||(t+="\\"),t+=e[n];return t}(e):e}var _l=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function _d(e,t,n,r){var i;e.format||(null==(i=e.anyOf)?void 0:i.some(e=>e.format))?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function _c(e,t,n,r){var i;e.pattern||(null==(i=e.allOf)?void 0:i.some(e=>e.pattern))?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:_u(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=_u(t,r)}function _u(e,t){var n;if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},i=r.i?e.source.toLowerCase():e.source,a="",s=!1,o=!1,l=!1;for(let e=0;e<i.length;e++){if(s){a+=i[e],s=!1;continue}if(r.i){if(o){if(i[e].match(/[a-z]/)){l?(a+=i[e],a+=`${i[e-2]}-${i[e]}`.toUpperCase(),l=!1):"-"===i[e+1]&&(null==(n=i[e+2])?void 0:n.match(/[a-z]/))?(a+=i[e],l=!0):a+=`${i[e]}${i[e].toUpperCase()}`;continue}}else if(i[e].match(/[a-z]/)){a+=`[${i[e]}${i[e].toUpperCase()}]`;continue}}if(r.m){if("^"===i[e]){a+=`(^|(?<=[\r
330
+ ]))`;continue}else if("$"===i[e]){a+=`($|(?=[\r
331
+ ]))`;continue}}if(r.s&&"."===i[e]){a+=o?`${i[e]}\r
332
+ `:`[${i[e]}\r
333
+ ]`;continue}a+=i[e],"\\"===i[e]?s=!0:o&&"]"===i[e]?o=!1:o||"["!==i[e]||(o=!0)}try{new RegExp(a)}catch(n){return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return a}function _m(e,t){var n,r,i,a,s,o;let l={type:"object",additionalProperties:null!=(n=_f(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))?n:t.allowedAdditionalProperties};if((null==(r=e.keyType)?void 0:r._def.typeName)===H.ZodString&&(null==(i=e.keyType._def.checks)?void 0:i.length)){let{type:n,...r}=_s(e.keyType._def,t);return{...l,propertyNames:r}}if((null==(a=e.keyType)?void 0:a._def.typeName)===H.ZodEnum)return{...l,propertyNames:{enum:e.keyType._def.values}};if((null==(s=e.keyType)?void 0:s._def.typeName)===H.ZodBranded&&e.keyType._def.type._def.typeName===H.ZodString&&(null==(o=e.keyType._def.type._def.checks)?void 0:o.length)){let{type:n,...r}=N4(e.keyType._def,t);return{...l,propertyNames:r}}return l}var _p={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function _f(e,t,n=!1){var r;let i=t.seen.get(e);if(t.override){let a=null==(r=t.override)?void 0:r.call(t,e,t,i,n);if(a!==N1)return a}if(i&&!n){let e=_h(i,t);if(void 0!==e)return e}let a={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,a);let s=((e,t,n)=>{var r,i,a,s,o,l;switch(t){case H.ZodString:return _s(e,n);case H.ZodNumber:let d={type:"number"};if(!e.checks)return d;for(let t of e.checks)switch(t.kind){case"int":d.type="integer";break;case"min":t.inclusive?d.minimum=t.value:d.exclusiveMinimum=t.value;break;case"max":t.inclusive?d.maximum=t.value:d.exclusiveMaximum=t.value;break;case"multipleOf":d.multipleOf=t.value}return d;case H.ZodObject:return function(e,t){let n={type:"object",properties:{}},r=[],i=e.shape();for(let e in i){let a=i[e];if(void 0===a||void 0===a._def)continue;let s=function(e){try{return e.isOptional()}catch(e){return!0}}(a),o=_f(a._def,{...t,currentPath:[...t.currentPath,"properties",e],propertyPath:[...t.currentPath,"properties",e]});void 0!==o&&(n.properties[e]=o,s||r.push(e))}r.length&&(n.required=r);let a=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return _f(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return void 0!==a&&(n.additionalProperties=a),n}(e,n);case H.ZodBigInt:let c={type:"integer",format:"int64"};if(!e.checks)return c;for(let t of e.checks)switch(t.kind){case"min":t.inclusive?c.minimum=t.value:c.exclusiveMinimum=t.value;break;case"max":t.inclusive?c.maximum=t.value:c.exclusiveMaximum=t.value;break;case"multipleOf":c.multipleOf=t.value}return c;case H.ZodBoolean:return{type:"boolean"};case H.ZodDate:return function e(t,n,r){let i=null!=r?r:n.dateStrategy;if(Array.isArray(i))return{anyOf:i.map((r,i)=>e(t,n,r))};switch(i){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":var a=t;let s={type:"integer",format:"unix-time"};for(let e of a.checks)switch(e.kind){case"min":s.minimum=e.value;break;case"max":s.maximum=e.value}return s}}(e,n);case H.ZodUndefined:return{not:{}};case H.ZodNull:return{type:"null"};case H.ZodArray:let u;return u={type:"array"},(null==(a=e.type)?void 0:a._def)&&(null==(o=null==(s=e.type)?void 0:s._def)?void 0:o.typeName)!==H.ZodAny&&(u.items=_f(e.type._def,{...n,currentPath:[...n.currentPath,"items"]})),e.minLength&&(u.minItems=e.minLength.value),e.maxLength&&(u.maxItems=e.maxLength.value),e.exactLength&&(u.minItems=e.exactLength.value,u.maxItems=e.exactLength.value),u;case H.ZodUnion:case H.ZodDiscriminatedUnion:let m,p=e.options instanceof Map?Array.from(e.options.values()):e.options;if(p.every(e=>e._def.typeName in _p&&(!e._def.checks||!e._def.checks.length))){let e=p.reduce((e,t)=>{let n=_p[t._def.typeName];return n&&!e.includes(n)?[...e,n]:e},[]);return{type:e.length>1?e:e[0]}}if(p.every(e=>"ZodLiteral"===e._def.typeName&&!e.description)){let e=p.reduce((e,t)=>{let n=typeof t._def.value;switch(n){case"string":case"number":case"boolean":return[...e,n];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}},[]);if(e.length===p.length){let t=e.filter((e,t,n)=>n.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:p.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(p.every(e=>"ZodEnum"===e._def.typeName))return{type:"string",enum:p.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return r=e,i=n,(m=(r.options instanceof Map?Array.from(r.options.values()):r.options).map((e,t)=>_f(e._def,{...i,currentPath:[...i.currentPath,"anyOf",`${t}`]})).filter(e=>!!e&&(!i.strictUnions||"object"==typeof e&&Object.keys(e).length>0))).length?{anyOf:m}:void 0;case H.ZodIntersection:let f,h;return f=[_f(e.left._def,{...n,currentPath:[...n.currentPath,"allOf","0"]}),_f(e.right._def,{...n,currentPath:[...n.currentPath,"allOf","1"]})].filter(e=>!!e),h=[],f.forEach(e=>{if((!("type"in e)||"string"!==e.type)&&"allOf"in e)h.push(...e.allOf);else{let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){let{additionalProperties:n,...r}=e;t=r}h.push(t)}}),h.length?{allOf:h}:void 0;case H.ZodTuple:return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((e,t)=>_f(e._def,{...n,currentPath:[...n.currentPath,"items",`${t}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[]),additionalItems:_f(e.rest._def,{...n,currentPath:[...n.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,t)=>_f(e._def,{...n,currentPath:[...n.currentPath,"items",`${t}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[])};case H.ZodRecord:return _m(e,n);case H.ZodLiteral:let g;return"bigint"!=(g=typeof e.value)&&"number"!==g&&"boolean"!==g&&"string"!==g?{type:Array.isArray(e.value)?"array":"object"}:{type:"bigint"===g?"integer":g,const:e.value};case H.ZodEnum:return{type:"string",enum:Array.from(e.values)};case H.ZodNativeEnum:let x,v,y;return x=e.values,{type:1===(y=Array.from(new Set((v=Object.keys(e.values).filter(e=>"number"!=typeof x[x[e]]).map(e=>x[e])).map(e=>typeof e)))).length?"string"===y[0]?"string":"number":["string","number"],enum:v};case H.ZodNullable:if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[_p[e.innerType._def.typeName],"null"]};let b=_f(e.innerType._def,{...n,currentPath:[...n.currentPath,"anyOf","0"]});return b&&{anyOf:[b,{type:"null"}]};case H.ZodOptional:if(n.currentPath.toString()===(null==(l=n.propertyPath)?void 0:l.toString()))return _f(e.innerType._def,n);let k=_f(e.innerType._def,{...n,currentPath:[...n.currentPath,"anyOf","1"]});return k?{anyOf:[{not:{}},k]}:{};case H.ZodMap:if("record"===n.mapStrategy)return _m(e,n);return{type:"array",maxItems:125,items:{type:"array",items:[_f(e.keyType._def,{...n,currentPath:[...n.currentPath,"items","items","0"]})||{},_f(e.valueType._def,{...n,currentPath:[...n.currentPath,"items","items","1"]})||{}],minItems:2,maxItems:2}};case H.ZodSet:let j;return j={type:"array",uniqueItems:!0,items:_f(e.valueType._def,{...n,currentPath:[...n.currentPath,"items"]})},e.minSize&&(j.minItems=e.minSize.value),e.maxSize&&(j.maxItems=e.maxSize.value),j;case H.ZodLazy:return()=>e.getter()._def;case H.ZodPromise:return _f(e.type._def,n);case H.ZodNaN:case H.ZodNever:return{not:{}};case H.ZodEffects:return"input"===n.effectStrategy?_f(e.schema._def,n):{};case H.ZodAny:case H.ZodUnknown:return{};case H.ZodDefault:return{..._f(e.innerType._def,n),default:e.defaultValue()};case H.ZodBranded:return N4(e,n);case H.ZodReadonly:case H.ZodCatch:return _f(e.innerType._def,n);case H.ZodPipeline:if("input"===n.pipeStrategy)return _f(e.in._def,n);if("output"===n.pipeStrategy)return _f(e.out._def,n);let w=_f(e.in._def,{...n,currentPath:[...n.currentPath,"allOf","0"]}),N=_f(e.out._def,{...n,currentPath:[...n.currentPath,"allOf",w?"1":"0"]});return{allOf:[w,N].filter(e=>void 0!==e)};case H.ZodFunction:case H.ZodVoid:case H.ZodSymbol:default:return}})(e,e.typeName,t),o="function"==typeof s?_f(s(),t):s;if(o&&_g(e,t,o),t.postProcess){let n=t.postProcess(o,e,t);return a.jsonSchema=o,n}return a.jsonSchema=o,o}var _h=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:((e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")})(t.currentPath,e.path)};case"none":case"seen":if(e.path.length<t.currentPath.length&&e.path.every((e,n)=>t.currentPath[n]===e))return console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{};return"seen"===t.$refStrategy?{}:void 0}},_g=(e,t,n)=>(e.description&&(n.description=e.description),n),_x=Symbol.for("vercel.ai.schema");function _v(e){let t;return()=>(null==t&&(t=e()),t)}function _y(e,{validate:t}={}){return{[_x]:!0,_type:void 0,get jsonSchema(){return"function"==typeof e&&(e=e()),e},validate:t}}function _b(e){var t;return null==e?_y({properties:{},additionalProperties:!1}):"object"==typeof e&&null!==e&&_x in e&&!0===e[_x]&&"jsonSchema"in e&&"validate"in e?e:"~standard"in e?"zod"===e["~standard"].vendor?_k(e):(t=e,_y(()=>NQ(t["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async e=>{let n=await t["~standard"].validate(e);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new b1({value:e,cause:n.issues})}}})):e()}function _k(e,t){var n,r;let i;if("_zod"in e){let r;return r=null!=(n=null==t?void 0:t.useReferences)&&n,_y(()=>NQ(wd(e,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async t=>{let n=await jm(e,t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}return i=null!=(r=null==t?void 0:t.useReferences)&&r,_y(()=>((e,t)=>{var n;let r,i,a=(i=void 0!==(r="string"==typeof t?{...N2,name:t}:{...N2,...t}).name?[...r.basePath,r.definitionPath,r.name]:r.basePath,{...r,currentPath:i,propertyPath:void 0,seen:new Map(Object.entries(r.definitions).map(([e,t])=>[t._def,{def:t._def,path:[...r.basePath,r.definitionPath,e],jsonSchema:void 0}]))}),s="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce((e,[t,n])=>{var r;return{...e,[t]:null!=(r=_f(n._def,{...a,currentPath:[...a.basePath,a.definitionPath,t]},!0))?r:{}}},{}):void 0,o="string"==typeof t?t:(null==t?void 0:t.nameStrategy)==="title"||null==t?void 0:t.name,l=null!=(n=_f(e._def,void 0===o?a:{...a,currentPath:[...a.basePath,a.definitionPath,o]},!1))?n:{},d="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==d&&(l.title=d);let c=void 0===o?s?{...l,[a.definitionPath]:s}:l:{$ref:[..."relative"===a.$refStrategy?[]:a.basePath,a.definitionPath,o].join("/"),[a.definitionPath]:{...s,[o]:l}};return c.$schema="http://json-schema.org/draft-07/schema#",c})(e,{$refStrategy:i?"root":"none"}),{validate:async t=>{let n=await e.safeParseAsync(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}}})}async function _j({value:e,schema:t,context:n}){let r=await _w({value:e,schema:t,context:n});if(!r.success)throw b1.wrap({value:e,cause:r.error,context:n});return r.value}async function _w({value:e,schema:t,context:n}){let r=_b(t);try{if(null==r.validate)return{success:!0,value:e,rawValue:e};let t=await r.validate(e);if(t.success)return{success:!0,value:t.value,rawValue:e};return{success:!1,error:b1.wrap({value:e,cause:t.error,context:n}),rawValue:e}}catch(t){return{success:!1,error:b1.wrap({value:e,cause:t,context:n}),rawValue:e}}}async function _N({text:e,schema:t}){try{let n=NX(e);if(null==t)return n;return _j({value:n,schema:t})}catch(t){if(bJ.isInstance(t)||b1.isInstance(t))throw t;throw new bJ({text:e,cause:t})}}async function __({text:e,schema:t}){try{let n=NX(e);if(null==t)return{success:!0,value:n,rawValue:n};return await _w({value:n,schema:t})}catch(t){return{success:!1,error:bJ.isInstance(t)?t:new bJ({text:e,cause:t}),rawValue:void 0}}}function _S({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new Nk).pipeThrough(new TransformStream({async transform({data:e},n){"[DONE]"!==e&&n.enqueue(await __({text:e,schema:t}))}}))}var _$=()=>globalThis.fetch,_I=async({url:e,headers:t,body:n,failedResponseHandler:r,successfulResponseHandler:i,abortSignal:a,fetch:s})=>_E({url:e,headers:{"Content-Type":"application/json",...t},body:{content:JSON.stringify(n),values:n},failedResponseHandler:r,successfulResponseHandler:i,abortSignal:a,fetch:s}),_E=async({url:e,headers:t={},body:n,successfulResponseHandler:r,failedResponseHandler:i,abortSignal:a,fetch:s=_$()})=>{try{let o=await s(e,{method:"POST",headers:NV(t,`ai-sdk/provider-utils/${Nq}`,NF()),body:n.content,signal:a}),l=Nw(o);if(!o.ok){let t;try{t=await i({response:o,url:e,requestBodyValues:n.values})}catch(t){if(ND(t)||bM.isInstance(t))throw t;throw new bM({message:"Failed to process error response",cause:t,statusCode:o.status,url:e,responseHeaders:l,requestBodyValues:n.values})}throw t.value}try{return await r({response:o,url:e,requestBodyValues:n.values})}catch(t){if(t instanceof Error&&(ND(t)||bM.isInstance(t)))throw t;throw new bM({message:"Failed to process successful response",cause:t,statusCode:o.status,url:e,responseHeaders:l,requestBodyValues:n.values})}}catch(t){throw NZ({error:t,url:e,requestBodyValues:n.values})}};function _C({id:e,inputSchema:t,outputSchema:n,supportsDeferredResults:r}){return({execute:i,needsApproval:a,toModelOutput:s,onInputStart:o,onInputDelta:l,onInputAvailable:d,...c})=>({type:"provider",id:e,args:c,inputSchema:t,outputSchema:n,execute:i,needsApproval:a,toModelOutput:s,onInputStart:o,onInputDelta:l,onInputAvailable:d,supportsDeferredResults:r})}async function _A(e){return"function"==typeof e&&(e=e()),Promise.resolve(e)}var _T=({errorSchema:e,errorToMessage:t,isRetryable:n})=>async({response:r,url:i,requestBodyValues:a})=>{let s=await r.text(),o=Nw(r);if(""===s.trim())return{responseHeaders:o,value:new bM({message:r.statusText,url:i,requestBodyValues:a,statusCode:r.status,responseHeaders:o,responseBody:s,isRetryable:null==n?void 0:n(r)})};try{let l=await _N({text:s,schema:e});return{responseHeaders:o,value:new bM({message:t(l),url:i,requestBodyValues:a,statusCode:r.status,responseHeaders:o,responseBody:s,data:l,isRetryable:null==n?void 0:n(r,l)})}}catch(e){return{responseHeaders:o,value:new bM({message:r.statusText,url:i,requestBodyValues:a,statusCode:r.status,responseHeaders:o,responseBody:s,isRetryable:null==n?void 0:n(r)})}}},_P=e=>async({response:t,url:n,requestBodyValues:r})=>{let i=await t.text(),a=await __({text:i,schema:e}),s=Nw(t);if(!a.success)throw new bM({message:"Invalid JSON response",cause:a.error,statusCode:t.status,responseHeaders:s,responseBody:i,url:n,requestBodyValues:r});return{responseHeaders:s,value:a.value,rawValue:a.rawValue}};function _z(){let e,t,n;return{localeError:(e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}},t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;return`Invalid input: expected ${e}, received ${i}`}case"invalid_value":if(1===r.values.length)return`Invalid input: expected ${kw(r.values[0])}`;return`Invalid option: expected one of ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Too big: expected ${r.origin??"value"} to have ${t}${r.maximum.toString()} ${n.unit??"elements"}`;return`Too big: expected ${r.origin??"value"} to be ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Too small: expected ${r.origin} to have ${t}${r.minimum.toString()} ${n.unit}`;return`Too small: expected ${r.origin} to be ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Invalid string: must start with "${r.prefix}"`;if("ends_with"===r.format)return`Invalid string: must end with "${r.suffix}"`;if("includes"===r.format)return`Invalid string: must include "${r.includes}"`;if("regex"===r.format)return`Invalid string: must match pattern ${r.pattern}`;return`Invalid ${t[r.format]??r.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${kt(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":if(r.options&&Array.isArray(r.options)&&r.options.length>0){let e=r.options.map(e=>`'${e}'`).join(" | ");return`Invalid discriminator value. Expected ${e}`}return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}})}}b7(_z()),e.s([],12929),e.i(12929),e.s([],16876),e.i(16876),e.i(2108),e.i(5772),e.i(67416);let _O=/^[cC][0-9a-z]{6,}$/,_M=/^[0-9a-z]+$/,_R=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,_D=/^[0-9a-vA-V]{20}$/,_L=/^[A-Za-z0-9]{27}$/,_U=/^[a-zA-Z0-9_-]{21}$/,_Z=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,_F=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,_B=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,_V=_B(4),_q=_B(6),_W=_B(7),_H=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,_G=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u;function _K(){return RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")}let _J=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,_Y=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,_X=e=>{let t=kb(e??":");return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},_Q=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,_0=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,_1=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,_2=/^[A-Za-z0-9_-]*$/,_4=/^https?$/,_5=/^\+[1-9]\d{6,14}$/,_6="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",_3=RegExp(`^${_6}$`);function _9(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function _8(e){return RegExp(`^${_9(e)}$`)}function _7(e){let t=_9({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${t}(?:${n.join("|")})`;return RegExp(`^${_6}T(?:${r})$`)}let Se=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},St=/^-?\d+n?$/,Sn=/^-?\d+$/,Sr=/^-?\d+(?:\.\d+)?$/,Si=/^(?:true|false)$/i,Sa=/^null$/i,Ss=/^undefined$/i,So=/^[^A-Z]*$/,Sl=/^[^a-z]*$/;function Sd(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Sc(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}let Su=Sd(22,"=="),Sm=Sc(22),Sp=Sd(27,"="),Sf=Sc(27),Sh=Sd(43,"="),Sg=Sc(43),Sx=Sd(64,""),Sv=Sc(64),Sy=Sd(86,"=="),Sb=Sc(86);e.s(["base64",0,_1,"base64url",0,_2,"bigint",0,St,"boolean",0,Si,"browserEmail",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"cidrv4",0,_Q,"cidrv6",0,_0,"cuid",0,_O,"cuid2",0,_M,"date",0,_3,"datetime",0,_7,"domain",0,/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,"duration",0,_Z,"e164",0,_5,"email",0,_H,"emoji",0,_K,"extendedDuration",0,/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,"guid",0,_F,"hex",0,/^[0-9a-fA-F]*$/,"hostname",0,/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,"html5Email",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"httpProtocol",0,_4,"idnEmail",0,_G,"integer",0,Sn,"ipv4",0,_J,"ipv6",0,_Y,"ksuid",0,_L,"lowercase",0,So,"mac",0,_X,"md5_base64",0,Su,"md5_base64url",0,Sm,"md5_hex",0,/^[0-9a-fA-F]{32}$/,"nanoid",0,_U,"null",0,Sa,"number",0,Sr,"rfc5322Email",0,/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,"sha1_base64",0,Sp,"sha1_base64url",0,Sf,"sha1_hex",0,/^[0-9a-fA-F]{40}$/,"sha256_base64",0,Sh,"sha256_base64url",0,Sg,"sha256_hex",0,/^[0-9a-fA-F]{64}$/,"sha384_base64",0,Sx,"sha384_base64url",0,Sv,"sha384_hex",0,/^[0-9a-fA-F]{96}$/,"sha512_base64",0,Sy,"sha512_base64url",0,Sb,"sha512_hex",0,/^[0-9a-fA-F]{128}$/,"string",0,Se,"time",0,_8,"ulid",0,_R,"undefined",0,Ss,"unicodeEmail",0,_G,"uppercase",0,Sl,"uuid",0,_B,"uuid4",0,_V,"uuid6",0,_q,"uuid7",0,_W,"xid",0,_D],53563);let Sk=b5("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Sj={number:"number",bigint:"bigint",object:"date"},Sw=b5("$ZodCheckLessThan",(e,t)=>{Sk.init(e,t);let n=Sj[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),SN=b5("$ZodCheckGreaterThan",(e,t)=>{Sk.init(e,t);let n=Sj[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),S_=b5("$ZodCheckMultipleOf",(e,t)=>{Sk.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===ks(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),SS=b5("$ZodCheckNumberFormat",(e,t)=>{Sk.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[i,a]=k_[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Sn)}),e._zod.check=s=>{let o=s.value;if(n){if(!Number.isInteger(o))return void s.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:o,inst:e});if(!Number.isSafeInteger(o))return void(o>0?s.issues.push({input:o,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):s.issues.push({input:o,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}o<i&&s.issues.push({origin:"number",input:o,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),o>a&&s.issues.push({origin:"number",input:o,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),S$=b5("$ZodCheckBigIntFormat",(e,t)=>{Sk.init(e,t);let[n,r]=kS[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let a=i.value;a<n&&i.issues.push({origin:"bigint",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:"bigint",input:a,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),SI=b5("$ZodCheckMaxSize",(e,t)=>{var n;Sk.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ki(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:kT(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),SE=b5("$ZodCheckMinSize",(e,t)=>{var n;Sk.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ki(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:kT(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),SC=b5("$ZodCheckSizeEquals",(e,t)=>{var n;Sk.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ki(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:kT(r),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),SA=b5("$ZodCheckMaxLength",(e,t)=>{var n;Sk.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ki(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=kP(r);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ST=b5("$ZodCheckMinLength",(e,t)=>{var n;Sk.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ki(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=kP(r);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),SP=b5("$ZodCheckLengthEquals",(e,t)=>{var n;Sk.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!ki(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=kP(r),s=i>t.length;n.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Sz=b5("$ZodCheckStringFormat",(e,t)=>{var n,r;Sk.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),SO=b5("$ZodCheckRegex",(e,t)=>{Sz.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),SM=b5("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=So),Sz.init(e,t)}),SR=b5("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Sl),Sz.init(e,t)}),SD=b5("$ZodCheckIncludes",(e,t)=>{Sk.init(e,t);let n=kb(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),SL=b5("$ZodCheckStartsWith",(e,t)=>{Sk.init(e,t);let n=RegExp(`^${kb(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),SU=b5("$ZodCheckEndsWith",(e,t)=>{Sk.init(e,t);let n=RegExp(`.*${kb(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function SZ(e,t,n){e.issues.length&&t.issues.push(...kE(n,e.issues))}let SF=b5("$ZodCheckProperty",(e,t)=>{Sk.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>SZ(n,e,t.property));SZ(n,e,t.property)}}),SB=b5("$ZodCheckMimeType",(e,t)=>{Sk.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),SV=b5("$ZodCheckOverwrite",(e,t)=>{Sk.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});e.s(["$ZodCheck",0,Sk,"$ZodCheckBigIntFormat",0,S$,"$ZodCheckEndsWith",0,SU,"$ZodCheckGreaterThan",0,SN,"$ZodCheckIncludes",0,SD,"$ZodCheckLengthEquals",0,SP,"$ZodCheckLessThan",0,Sw,"$ZodCheckLowerCase",0,SM,"$ZodCheckMaxLength",0,SA,"$ZodCheckMaxSize",0,SI,"$ZodCheckMimeType",0,SB,"$ZodCheckMinLength",0,ST,"$ZodCheckMinSize",0,SE,"$ZodCheckMultipleOf",0,S_,"$ZodCheckNumberFormat",0,SS,"$ZodCheckOverwrite",0,SV,"$ZodCheckProperty",0,SF,"$ZodCheckRegex",0,SO,"$ZodCheckSizeEquals",0,SC,"$ZodCheckStartsWith",0,SL,"$ZodCheckStringFormat",0,Sz,"$ZodCheckUpperCase",0,SR],94320);class Sq{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}e.s(["Doc",0,Sq],73885);let SW={major:4,minor:4,patch:3};e.s(["version",0,SW],38857);let SH=b5("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=SW;let r=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&r.unshift(e),r))for(let n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r,i=k$(e);for(let a of t){if(a._zod.def.when){if(kI(e)||!a._zod.def.when(e))continue}else if(i)continue;let t=e.issues.length,s=a._zod.check(e);if(s instanceof Promise&&n?.async===!1)throw new b3;if(r||s instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(i||(i=k$(e,t)))});else{if(e.issues.length===t)continue;i||(i=k$(e,t))}}return r?r.then(()=>e):e},n=(n,i,a)=>{if(k$(n))return n.aborted=!0,n;let s=t(i,r,a);if(s instanceof Promise){if(!1===a.async)throw new b3;return s.then(t=>e._zod.parse(t,a))}return e._zod.parse(s,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if("backward"===a.direction){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let s=e._zod.parse(i,a);if(s instanceof Promise){if(!1===a.async)throw new b3;return s.then(e=>t(e,r,a))}return t(s,r,a)}}kl(e,"~standard",()=>({validate:t=>{try{let n=kY(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return kQ(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),SG=b5("$ZodString",(e,t)=>{SH.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Se(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(e){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),SK=b5("$ZodStringFormat",(e,t)=>{Sz.init(e,t),SG.init(e,t)}),SJ=b5("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=_F),SK.init(e,t)}),SY=b5("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=_B(e))}else t.pattern??(t.pattern=_B());SK.init(e,t)}),SX=b5("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=_H),SK.init(e,t)}),SQ=b5("$ZodURL",(e,t)=>{SK.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===_4.source&&!/^https?:\/\//i.test(r))return void n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),S0=b5("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=_K()),SK.init(e,t)}),S1=b5("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=_U),SK.init(e,t)}),S2=b5("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=_O),SK.init(e,t)}),S4=b5("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=_M),SK.init(e,t)}),S5=b5("$ZodULID",(e,t)=>{t.pattern??(t.pattern=_R),SK.init(e,t)}),S6=b5("$ZodXID",(e,t)=>{t.pattern??(t.pattern=_D),SK.init(e,t)}),S3=b5("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=_L),SK.init(e,t)}),S9=b5("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=_7(t)),SK.init(e,t)}),S8=b5("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=_3),SK.init(e,t)}),S7=b5("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=_8(t)),SK.init(e,t)}),$e=b5("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=_Z),SK.init(e,t)}),$t=b5("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=_J),SK.init(e,t),e._zod.bag.format="ipv4"}),$n=b5("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=_Y),SK.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),$r=b5("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=_X(t.delimiter)),SK.init(e,t),e._zod.bag.format="mac"}),$i=b5("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=_Q),SK.init(e,t)}),$a=b5("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=_0),SK.init(e,t),e._zod.check=n=>{let r=n.value.split("/");try{if(2!==r.length)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function $s(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let $o=b5("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=_1),SK.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{$s(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function $l(e){if(!_2.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return $s(t.padEnd(4*Math.ceil(t.length/4),"="))}let $d=b5("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=_2),SK.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{$l(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),$c=b5("$ZodE164",(e,t)=>{t.pattern??(t.pattern=_5),SK.init(e,t)});function $u(e,t=null){try{let n=e.split(".");if(3!==n.length)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));if("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}let $m=b5("$ZodJWT",(e,t)=>{SK.init(e,t),e._zod.check=n=>{$u(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),$p=b5("$ZodCustomStringFormat",(e,t)=>{SK.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),$f=b5("$ZodNumber",(e,t)=>{SH.init(e,t),e._zod.pattern=e._zod.bag.pattern??Sr,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}let i=n.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),n}}),$h=b5("$ZodNumberFormat",(e,t)=>{SS.init(e,t),$f.init(e,t)}),$g=b5("$ZodBoolean",(e,t)=>{SH.init(e,t),e._zod.pattern=Si,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch(e){}let i=n.value;return"boolean"==typeof i||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),$x=b5("$ZodBigInt",(e,t)=>{SH.init(e,t),e._zod.pattern=St,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(e){}return"bigint"==typeof n.value||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),$v=b5("$ZodBigIntFormat",(e,t)=>{S$.init(e,t),$x.init(e,t)}),$y=b5("$ZodSymbol",(e,t)=>{SH.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return"symbol"==typeof r||t.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),t}}),$b=b5("$ZodUndefined",(e,t)=>{SH.init(e,t),e._zod.pattern=Ss,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let r=t.value;return void 0===r||t.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),t}}),$k=b5("$ZodNull",(e,t)=>{SH.init(e,t),e._zod.pattern=Sa,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return null===r||t.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),t}}),$j=b5("$ZodAny",(e,t)=>{SH.init(e,t),e._zod.parse=e=>e}),$w=b5("$ZodUnknown",(e,t)=>{SH.init(e,t),e._zod.parse=e=>e}),$N=b5("$ZodNever",(e,t)=>{SH.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),$_=b5("$ZodVoid",(e,t)=>{SH.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return void 0===r||t.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),t}}),$S=b5("$ZodDate",(e,t)=>{SH.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:i,...a?{received:"Invalid Date"}:{},inst:e}),n}});function $$(e,t,n){e.issues.length&&t.issues.push(...kE(n,e.issues)),t.value[n]=e.value}let $I=b5("$ZodArray",(e,t)=>{SH.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let s=i[e],o=t.element._zod.run({value:s,issues:[]},r);o instanceof Promise?a.push(o.then(t=>$$(t,n,e))):$$(o,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function $E(e,t,n,r,i,a){let s=n in r;if(e.issues.length){if(i&&a&&!s)return;t.issues.push(...kE(n,e.issues))}if(!s&&!i){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}void 0===e.value?s&&(t.value[n]=void 0):t.value[n]=e.value}function $C(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=kN(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function $A(e,t,n,r,i,a){let s=[],o=i.keySet,l=i.catchall._zod,d=l.def.type,c="optional"===l.optin,u="optional"===l.optout;for(let i in t){if("__proto__"===i||o.has(i))continue;if("never"===d){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>$E(e,n,i,t,c,u))):$E(a,n,i,t,c,u)}return(s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:a}),e.length)?Promise.all(e).then(()=>n):n}let $T=b5("$ZodObject",(e,t)=>{let n;SH.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape");if(!r?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let i=kr(()=>$C(t));kl(e._zod,"propValues",()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values)for(let e of(n[t]??(n[t]=new Set),r.values))n[t].add(e)}return n});let a=t.catchall;e._zod.parse=(t,r)=>{n??(n=i.value);let s=t.value;if(!kf(s))return t.issues.push({expected:"object",code:"invalid_type",input:s,inst:e}),t;t.value={};let o=[],l=n.shape;for(let e of n.keys){let n=l[e],i="optional"===n._zod.optin,a="optional"===n._zod.optout,d=n._zod.run({value:s[e],issues:[]},r);d instanceof Promise?o.push(d.then(n=>$E(n,t,e,s,i,a))):$E(d,t,e,s,i,a)}return a?$A(o,s,t,r,i.value,e):o.length?Promise.all(o).then(()=>t):t}}),$P=b5("$ZodObjectJIT",(e,t)=>{let n,r;$T.init(e,t);let i=e._zod.parse,a=kr(()=>$C(t)),s=!b8.jitless,o=s&&kh.value,l=t.catchall;e._zod.parse=(d,c)=>{r??(r=a.value);let u=d.value;return kf(u)?s&&o&&c?.async===!1&&!0!==c.jitless?(n||(n=(e=>{let t=new Sq(["shape","payload","ctx"]),n=a.value,r=e=>{let t=ku(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let i=Object.create(null),s=0;for(let e of n.keys)i[e]=`key_${s++}`;for(let a of(t.write("const newResult = {};"),n.keys)){let n=i[a],s=ku(a),o=e[a],l=o?._zod?.optin==="optional",d=o?._zod?.optout==="optional";t.write(`const ${n} = ${r(a)};`),l&&d?t.write(`
334
+ if (${n}.issues.length) {
335
+ if (${s} in input) {
336
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
337
+ ...iss,
338
+ path: iss.path ? [${s}, ...iss.path] : [${s}]
339
+ })));
340
+ }
341
+ }
342
+
343
+ if (${n}.value === undefined) {
344
+ if (${s} in input) {
345
+ newResult[${s}] = undefined;
346
+ }
347
+ } else {
348
+ newResult[${s}] = ${n}.value;
349
+ }
350
+
351
+ `):l?t.write(`
352
+ if (${n}.issues.length) {
353
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
354
+ ...iss,
355
+ path: iss.path ? [${s}, ...iss.path] : [${s}]
356
+ })));
357
+ }
358
+
359
+ if (${n}.value === undefined) {
360
+ if (${s} in input) {
361
+ newResult[${s}] = undefined;
362
+ }
363
+ } else {
364
+ newResult[${s}] = ${n}.value;
365
+ }
366
+
367
+ `):t.write(`
368
+ const ${n}_present = ${s} in input;
369
+ if (${n}.issues.length) {
370
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
371
+ ...iss,
372
+ path: iss.path ? [${s}, ...iss.path] : [${s}]
373
+ })));
374
+ }
375
+ if (!${n}_present && !${n}.issues.length) {
376
+ payload.issues.push({
377
+ code: "invalid_type",
378
+ expected: "nonoptional",
379
+ input: undefined,
380
+ path: [${s}]
381
+ });
382
+ }
383
+
384
+ if (${n}_present) {
385
+ if (${n}.value === undefined) {
386
+ newResult[${s}] = undefined;
387
+ } else {
388
+ newResult[${s}] = ${n}.value;
389
+ }
390
+ }
391
+
392
+ `)}t.write("payload.value = newResult;"),t.write("return payload;");let o=t.compile();return(t,n)=>o(e,t,n)})(t.shape)),d=n(d,c),l)?$A([],u,d,c,r,e):d:i(d,c):(d.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),d)}});function $z(e,t,n,r){for(let n of e)if(0===n.issues.length)return t.value=n.value,t;let i=e.filter(e=>!k$(e));return 1===i.length?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>kA(e,r,b7())))}),t)}let $O=b5("$ZodUnion",(e,t)=>{SH.init(e,t),kl(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),kl(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),kl(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),kl(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>ka(e.source)).join("|")})$`)}});let n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,s=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)s.push(t),a=!0;else{if(0===t.issues.length)return t;s.push(t)}}return a?Promise.all(s).then(t=>$z(t,r,e,i)):$z(s,r,e,i)}});function $M(e,t,n,r){let i=e.filter(e=>0===e.issues.length);return 1===i.length?t.value=i[0].value:0===i.length?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>kA(e,r,b7())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1}),t}let $R=b5("$ZodXor",(e,t)=>{$O.init(e,t),t.inclusive=!1;let n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,s=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);t instanceof Promise?(s.push(t),a=!0):s.push(t)}return a?Promise.all(s).then(t=>$M(t,r,e,i)):$M(s,r,e,i)}}),$D=b5("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,$O.init(e,t);let n=e._zod.parse;kl(e._zod,"propValues",()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||0===Object.keys(r).length)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r))for(let r of(e[t]||(e[t]=new Set),n))e[t].add(r)}return e});let r=kr(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let s=i.value;if(!kf(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),i;let o=r.value.get(s?.[t.discriminator]);return o?o._zod.run(i,a):t.unionFallback||"backward"===a.direction?n(i,a):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()),input:s,path:[t.discriminator],inst:e}),i)}}),$L=b5("$ZodIntersection",(e,t)=>{SH.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>$U(e,t,n)):$U(e,i,a)}});function $U(e,t,n){let r,i=new Map;for(let n of t.issues)if("unrecognized_keys"===n.code)for(let e of(r??(r=n),n.keys))i.has(e)||i.set(e,{}),i.get(e).l=!0;else e.issues.push(n);for(let t of n.issues)if("unrecognized_keys"===t.code)for(let e of t.keys)i.has(e)||i.set(e,{}),i.get(e).r=!0;else e.issues.push(t);let a=[...i].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&r&&e.issues.push({...r,keys:a}),k$(e))return e;let s=function e(t,n){if(t===n||t instanceof Date&&n instanceof Date&&+t==+n)return{valid:!0,data:t};if(kg(t)&&kg(n)){let r=Object.keys(n),i=Object.keys(t).filter(e=>-1!==r.indexOf(e)),a={...t,...n};for(let r of i){let i=e(t[r],n[r]);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};a[r]=i.data}return{valid:!0,data:a}}if(Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<t.length;i++){let a=e(t[i],n[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}(t.value,n.value);if(!s.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}let $Z=b5("$ZodTuple",(e,t)=>{SH.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];let s=[],o=$F(n,"optin"),l=$F(n,"optout");if(!t.rest){if(a.length<o)return r.issues.push({code:"too_small",minimum:o,inclusive:!0,input:a,inst:e,origin:"array"}),r;a.length>n.length&&r.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:a,inst:e,origin:"array"})}let d=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:a[e],issues:[]},i);t instanceof Promise?s.push(t.then(t=>{d[e]=t})):d[e]=t}if(t.rest){let e=n.length-1;for(let o of a.slice(n.length)){e++;let n=t.rest._zod.run({value:o,issues:[]},i);n instanceof Promise?s.push(n.then(t=>$B(t,r,e))):$B(n,r,e)}}return s.length?Promise.all(s).then(()=>$V(d,r,n,a,l)):$V(d,r,n,a,l)}});function $F(e,t){for(let n=e.length-1;n>=0;n--)if("optional"!==e[n]._zod[t])return n+1;return 0}function $B(e,t,n){e.issues.length&&t.issues.push(...kE(n,e.issues)),t.value[n]=e.value}function $V(e,t,n,r,i){for(let a=0;a<n.length;a++){let n=e[a],s=a<r.length;if(n.issues.length){if(!s&&a>=i){t.value.length=a;break}t.issues.push(...kE(a,n.issues))}t.value[a]=n.value}for(let e=t.value.length-1;e>=r.length;e--)if("optional"===n[e]._zod.optout&&void 0===t.value[e])t.value.length=e;else break;return t}let $q=b5("$ZodRecord",(e,t)=>{SH.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!kg(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;let a=[],s=t.keyType._zod.values;if(s){let o;n.value={};let l=new Set;for(let o of s)if("string"==typeof o||"number"==typeof o||"symbol"==typeof o){l.add("number"==typeof o?o.toString():o);let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(s.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:s.issues.map(e=>kA(e,r,b7())),input:o,path:[o],inst:e});continue}let d=s.value,c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...kE(o,e.issues)),n.value[d]=e.value})):(c.issues.length&&n.issues.push(...kE(o,c.issues)),n.value[d]=c.value)}for(let e in i)l.has(e)||(o=o??[]).push(e);o&&o.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:o})}else for(let s of(n.value={},Reflect.ownKeys(i))){if("__proto__"===s||!Object.prototype.propertyIsEnumerable.call(i,s))continue;let o=t.keyType._zod.run({value:s,issues:[]},r);if(o instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof s&&Sr.test(s)&&o.issues.length){let e=t.keyType._zod.run({value:Number(s),issues:[]},r);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(o=e)}if(o.issues.length){"loose"===t.mode?n.value[s]=i[s]:n.issues.push({code:"invalid_key",origin:"record",issues:o.issues.map(e=>kA(e,r,b7())),input:s,path:[s],inst:e});continue}let l=t.valueType._zod.run({value:i[s],issues:[]},r);l instanceof Promise?a.push(l.then(e=>{e.issues.length&&n.issues.push(...kE(s,e.issues)),n.value[o.value]=e.value})):(l.issues.length&&n.issues.push(...kE(s,l.issues)),n.value[o.value]=l.value)}return a.length?Promise.all(a).then(()=>n):n}}),$W=b5("$ZodMap",(e,t)=>{SH.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),n;let a=[];for(let[s,o]of(n.value=new Map,i)){let l=t.keyType._zod.run({value:s,issues:[]},r),d=t.valueType._zod.run({value:o,issues:[]},r);l instanceof Promise||d instanceof Promise?a.push(Promise.all([l,d]).then(([t,a])=>{$H(t,a,n,s,i,e,r)})):$H(l,d,n,s,i,e,r)}return a.length?Promise.all(a).then(()=>n):n}});function $H(e,t,n,r,i,a,s){e.issues.length&&(kv.has(typeof r)?n.issues.push(...kE(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:i,inst:a,issues:e.issues.map(e=>kA(e,s,b7()))})),t.issues.length&&(kv.has(typeof r)?n.issues.push(...kE(r,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:i,inst:a,key:r,issues:t.issues.map(e=>kA(e,s,b7()))})),n.value.set(e.value,t.value)}let $G=b5("$ZodSet",(e,t)=>{SH.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!(i instanceof Set))return n.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),n;let a=[];for(let e of(n.value=new Set,i)){let i=t.valueType._zod.run({value:e,issues:[]},r);i instanceof Promise?a.push(i.then(e=>$K(e,n))):$K(i,n)}return a.length?Promise.all(a).then(()=>n):n}});function $K(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}let $J=b5("$ZodEnum",(e,t)=>{SH.init(e,t);let n=ke(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>kv.has(typeof e)).map(e=>"string"==typeof e?kb(e):e.toString()).join("|")})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:"invalid_value",values:n,input:a,inst:e}),t}}),$Y=b5("$ZodLiteral",(e,t)=>{if(SH.init(e,t),0===t.values.length)throw Error("Cannot create literal schema with no valid values");let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>"string"==typeof e?kb(e):e?kb(e.toString()):String(e)).join("|")})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),r}}),$X=b5("$ZodFile",(e,t)=>{SH.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),t}}),$Q=b5("$ZodTransform",(e,t)=>{SH.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new b9(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new b3;return n.value=i,n.fallback=!0,n}});function $0(e,t){return void 0===t&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}let $1=b5("$ZodOptional",(e,t)=>{SH.init(e,t),e._zod.optin="optional",e._zod.optout="optional",kl(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),kl(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ka(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>$0(e,r)):$0(i,r)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),$2=b5("$ZodExactOptional",(e,t)=>{$1.init(e,t),kl(e._zod,"values",()=>t.innerType._zod.values),kl(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),$4=b5("$ZodNullable",(e,t)=>{SH.init(e,t),kl(e._zod,"optin",()=>t.innerType._zod.optin),kl(e._zod,"optout",()=>t.innerType._zod.optout),kl(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ka(e.source)}|null)$`):void 0}),kl(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),$5=b5("$ZodDefault",(e,t)=>{SH.init(e,t),e._zod.optin="optional",kl(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>$6(e,t)):$6(r,t)}});function $6(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let $3=b5("$ZodPrefault",(e,t)=>{SH.init(e,t),e._zod.optin="optional",kl(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),$9=b5("$ZodNonOptional",(e,t)=>{SH.init(e,t),kl(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>$8(t,e)):$8(i,e)}});function $8(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}let $7=b5("$ZodSuccess",(e,t)=>{SH.init(e,t),e._zod.parse=(e,n)=>{if("backward"===n.direction)throw new b9("ZodSuccess");let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===r.issues.length,e)}}),Ie=b5("$ZodCatch",(e,t)=>{SH.init(e,t),e._zod.optin="optional",kl(e._zod,"optout",()=>t.innerType._zod.optout),kl(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>kA(e,n,b7()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>kA(e,n,b7()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),It=b5("$ZodNaN",(e,t)=>{SH.init(e,t),e._zod.parse=(t,n)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)}),In=b5("$ZodPipe",(e,t)=>{SH.init(e,t),kl(e._zod,"values",()=>t.in._zod.values),kl(e._zod,"optin",()=>t.in._zod.optin),kl(e._zod,"optout",()=>t.out._zod.optout),kl(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Ir(e,t.in,n)):Ir(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ir(e,t.out,n)):Ir(r,t.out,n)}});function Ir(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}let Ii=b5("$ZodCodec",(e,t)=>{SH.init(e,t),kl(e._zod,"values",()=>t.in._zod.values),kl(e._zod,"optin",()=>t.in._zod.optin),kl(e._zod,"optout",()=>t.out._zod.optout),kl(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("forward"===(n.direction||"forward")){let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Ia(e,t,n)):Ia(r,t,n)}{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Ia(e,t,n)):Ia(r,t,n)}}});function Ia(e,t,n){if(e.issues.length)return e.aborted=!0,e;if("forward"===(n.direction||"forward")){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>Is(e,r,t.out,n)):Is(e,r,t.out,n)}{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>Is(e,r,t.in,n)):Is(e,r,t.in,n)}}function Is(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}let Io=b5("$ZodPreprocess",(e,t)=>{In.init(e,t)}),Il=b5("$ZodReadonly",(e,t)=>{SH.init(e,t),kl(e._zod,"propValues",()=>t.innerType._zod.propValues),kl(e._zod,"values",()=>t.innerType._zod.values),kl(e._zod,"optin",()=>t.innerType?._zod?.optin),kl(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Id):Id(r)}});function Id(e){return e.value=Object.freeze(e.value),e}let Ic=b5("$ZodTemplateLiteral",(e,t)=>{SH.init(e,t);let n=[];for(let e of t.parts)if("object"==typeof e&&null!==e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let r=+!!t.startsWith("^"),i=t.endsWith("$")?t.length-1:t.length;n.push(t.slice(r,i))}else if(null===e||ky.has(typeof e))n.push(kb(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join("")}$`),e._zod.parse=(n,r)=>("string"!=typeof n.value?n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source})),n)}),Iu=b5("$ZodFunction",(e,t)=>(SH.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if("function"!=typeof t)throw Error("implement() must be called with a function");return function(...n){let r=Reflect.apply(t,this,e._def.input?kH(e._def.input,n):n);return e._def.output?kH(e._def.output,r):r}},e.implementAsync=t=>{if("function"!=typeof t)throw Error("implementAsync() must be called with a function");return async function(...n){let r=e._def.input?await kK(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await kK(e._def.output,i):i}},e._zod.parse=(t,n)=>("function"!=typeof t.value?t.issues.push({code:"invalid_type",expected:"function",input:t.value,inst:e}):e._def.output&&"promise"===e._def.output._zod.def.type?t.value=e.implementAsync(t.value):t.value=e.implement(t.value),t),e.input=(...t)=>{let n=e.constructor;return new n(Array.isArray(t[0])?{type:"function",input:new $Z({type:"tuple",items:t[0],rest:t[1]}),output:e._def.output}:{type:"function",input:t[0],output:e._def.output})},e.output=t=>new e.constructor({type:"function",input:e._def.input,output:t}),e)),Im=b5("$ZodPromise",(e,t)=>{SH.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),Ip=b5("$ZodLazy",(e,t)=>{SH.init(e,t),kl(e._zod,"innerType",()=>(t._cachedInner||(t._cachedInner=t.getter()),t._cachedInner)),kl(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),kl(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),kl(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),kl(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),If=b5("$ZodCustom",(e,t)=>{Sk.init(e,t),SH.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Ih(t,n,r,e));Ih(i,n,r,e)}});function Ih(e,t,n,r){if(!e){let e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(kO(e))}}e.s(["$ZodAny",0,$j,"$ZodArray",0,$I,"$ZodBase64",0,$o,"$ZodBase64URL",0,$d,"$ZodBigInt",0,$x,"$ZodBigIntFormat",0,$v,"$ZodBoolean",0,$g,"$ZodCIDRv4",0,$i,"$ZodCIDRv6",0,$a,"$ZodCUID",0,S2,"$ZodCUID2",0,S4,"$ZodCatch",0,Ie,"$ZodCodec",0,Ii,"$ZodCustom",0,If,"$ZodCustomStringFormat",0,$p,"$ZodDate",0,$S,"$ZodDefault",0,$5,"$ZodDiscriminatedUnion",0,$D,"$ZodE164",0,$c,"$ZodEmail",0,SX,"$ZodEmoji",0,S0,"$ZodEnum",0,$J,"$ZodExactOptional",0,$2,"$ZodFile",0,$X,"$ZodFunction",0,Iu,"$ZodGUID",0,SJ,"$ZodIPv4",0,$t,"$ZodIPv6",0,$n,"$ZodISODate",0,S8,"$ZodISODateTime",0,S9,"$ZodISODuration",0,$e,"$ZodISOTime",0,S7,"$ZodIntersection",0,$L,"$ZodJWT",0,$m,"$ZodKSUID",0,S3,"$ZodLazy",0,Ip,"$ZodLiteral",0,$Y,"$ZodMAC",0,$r,"$ZodMap",0,$W,"$ZodNaN",0,It,"$ZodNanoID",0,S1,"$ZodNever",0,$N,"$ZodNonOptional",0,$9,"$ZodNull",0,$k,"$ZodNullable",0,$4,"$ZodNumber",0,$f,"$ZodNumberFormat",0,$h,"$ZodObject",0,$T,"$ZodObjectJIT",0,$P,"$ZodOptional",0,$1,"$ZodPipe",0,In,"$ZodPrefault",0,$3,"$ZodPreprocess",0,Io,"$ZodPromise",0,Im,"$ZodReadonly",0,Il,"$ZodRecord",0,$q,"$ZodSet",0,$G,"$ZodString",0,SG,"$ZodStringFormat",0,SK,"$ZodSuccess",0,$7,"$ZodSymbol",0,$y,"$ZodTemplateLiteral",0,Ic,"$ZodTransform",0,$Q,"$ZodTuple",0,$Z,"$ZodType",0,SH,"$ZodULID",0,S5,"$ZodURL",0,SQ,"$ZodUUID",0,SY,"$ZodUndefined",0,$b,"$ZodUnion",0,$O,"$ZodUnknown",0,$w,"$ZodVoid",0,$_,"$ZodXID",0,S6,"$ZodXor",0,$R,"isValidBase64",0,$s,"isValidBase64URL",0,$l,"isValidJWT",0,$u],83197),e.i(83197),e.s(["$ZodAny",0,$j,"$ZodArray",0,$I,"$ZodBase64",0,$o,"$ZodBase64URL",0,$d,"$ZodBigInt",0,$x,"$ZodBigIntFormat",0,$v,"$ZodBoolean",0,$g,"$ZodCIDRv4",0,$i,"$ZodCIDRv6",0,$a,"$ZodCUID",0,S2,"$ZodCUID2",0,S4,"$ZodCatch",0,Ie,"$ZodCodec",0,Ii,"$ZodCustom",0,If,"$ZodCustomStringFormat",0,$p,"$ZodDate",0,$S,"$ZodDefault",0,$5,"$ZodDiscriminatedUnion",0,$D,"$ZodE164",0,$c,"$ZodEmail",0,SX,"$ZodEmoji",0,S0,"$ZodEnum",0,$J,"$ZodExactOptional",0,$2,"$ZodFile",0,$X,"$ZodFunction",0,Iu,"$ZodGUID",0,SJ,"$ZodIPv4",0,$t,"$ZodIPv6",0,$n,"$ZodISODate",0,S8,"$ZodISODateTime",0,S9,"$ZodISODuration",0,$e,"$ZodISOTime",0,S7,"$ZodIntersection",0,$L,"$ZodJWT",0,$m,"$ZodKSUID",0,S3,"$ZodLazy",0,Ip,"$ZodLiteral",0,$Y,"$ZodMAC",0,$r,"$ZodMap",0,$W,"$ZodNaN",0,It,"$ZodNanoID",0,S1,"$ZodNever",0,$N,"$ZodNonOptional",0,$9,"$ZodNull",0,$k,"$ZodNullable",0,$4,"$ZodNumber",0,$f,"$ZodNumberFormat",0,$h,"$ZodObject",0,$T,"$ZodObjectJIT",0,$P,"$ZodOptional",0,$1,"$ZodPipe",0,In,"$ZodPrefault",0,$3,"$ZodPreprocess",0,Io,"$ZodPromise",0,Im,"$ZodReadonly",0,Il,"$ZodRecord",0,$q,"$ZodSet",0,$G,"$ZodString",0,SG,"$ZodStringFormat",0,SK,"$ZodSuccess",0,$7,"$ZodSymbol",0,$y,"$ZodTemplateLiteral",0,Ic,"$ZodTransform",0,$Q,"$ZodTuple",0,$Z,"$ZodType",0,SH,"$ZodULID",0,S5,"$ZodURL",0,SQ,"$ZodUUID",0,SY,"$ZodUndefined",0,$b,"$ZodUnion",0,$O,"$ZodUnknown",0,$w,"$ZodVoid",0,$_,"$ZodXID",0,S6,"$ZodXor",0,$R,"clone",0,kk,"isValidBase64",0,$s,"isValidBase64URL",0,$l,"isValidJWT",0,$u],9841),e.i(9841),e.i(94320),e.i(38857);var Ig=e.i(69547),Ix=e.i(53563);function Iv(e,t,n,r){let i=Math.abs(e),a=i%10,s=i%100;return s>=11&&s<=19?r:1===a?t:a>=2&&a<=4?n:r}function Iy(e,t,n){return 1===Math.abs(e)?t:n}function Ib(e){if(!e)return"";let t=e[e.length-1];return e+(["ա","ե","ը","ի","ո","ու","օ"].includes(t)?"ն":"ը")}function Ik(){let e,t,n;return{localeError:(e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}},t={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},n={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${r.expected} ប៉ុន្តែទទួលបាន ${i}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${e} ប៉ុន្តែទទួលបាន ${i}`}case"invalid_value":if(1===r.values.length)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${kw(r.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`ធំពេក៖ ត្រូវការ ${r.origin??"តម្លៃ"} ${t} ${r.maximum.toString()} ${n.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${r.origin??"តម្លៃ"} ${t} ${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`តូចពេក៖ ត្រូវការ ${r.origin} ${t} ${r.minimum.toString()} ${n.unit}`;return`តូចពេក៖ ត្រូវការ ${r.origin} ${t} ${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${r.prefix}"`;if("ends_with"===r.format)return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${r.suffix}"`;if("includes"===r.format)return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${r.includes}"`;if("regex"===r.format)return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${r.pattern}`;return`មិនត្រឹមត្រូវ៖ ${t[r.format]??r.format}`;case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${r.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${kt(r.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${r.origin}`;case"invalid_union":default:return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${r.origin}`}})}}e.s([],75763),e.i(75763);let Ij=e=>e.charAt(0).toUpperCase()+e.slice(1);function Iw(e){let t=Math.abs(e),n=t%10,r=t%100;return r>=11&&r<=19||0===n?"many":1===n?"one":"few"}function IN(e,t,n,r){let i=Math.abs(e),a=i%10,s=i%100;return s>=11&&s<=19?r:1===a?t:a>=2&&a<=4?n:r}function I_(){let e,t,n;return{localeError:(e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}},t={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},n={nan:"NaN",number:"число",array:"масив"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Неправильні вхідні дані: очікується instanceof ${r.expected}, отримано ${i}`;return`Неправильні вхідні дані: очікується ${e}, отримано ${i}`}case"invalid_value":if(1===r.values.length)return`Неправильні вхідні дані: очікується ${kw(r.values[0])}`;return`Неправильна опція: очікується одне з ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Занадто велике: очікується, що ${r.origin??"значення"} ${n.verb} ${t}${r.maximum.toString()} ${n.unit??"елементів"}`;return`Занадто велике: очікується, що ${r.origin??"значення"} буде ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Занадто мале: очікується, що ${r.origin} ${n.verb} ${t}${r.minimum.toString()} ${n.unit}`;return`Занадто мале: очікується, що ${r.origin} буде ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Неправильний рядок: повинен починатися з "${r.prefix}"`;if("ends_with"===r.format)return`Неправильний рядок: повинен закінчуватися на "${r.suffix}"`;if("includes"===r.format)return`Неправильний рядок: повинен містити "${r.includes}"`;if("regex"===r.format)return`Неправильний рядок: повинен відповідати шаблону ${r.pattern}`;return`Неправильний ${t[r.format]??r.format}`;case"not_multiple_of":return`Неправильне число: повинно бути кратним ${r.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${r.keys.length>1?"і":""}: ${kt(r.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${r.origin}`;case"invalid_union":default:return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${r.origin}`}})}}e.s(["ar",0,function(){let e,t,n;return{localeError:(e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}},t={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},n={nan:"NaN"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${r.expected}، ولكن تم إدخال ${i}`;return`مدخلات غير مقبولة: يفترض إدخال ${e}، ولكن تم إدخال ${i}`}case"invalid_value":if(1===r.values.length)return`مدخلات غير مقبولة: يفترض إدخال ${kw(r.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return` أكبر من اللازم: يفترض أن تكون ${r.origin??"القيمة"} ${t} ${r.maximum.toString()} ${n.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${r.origin??"القيمة"} ${t} ${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`أصغر من اللازم: يفترض لـ ${r.origin} أن يكون ${t} ${r.minimum.toString()} ${n.unit}`;return`أصغر من اللازم: يفترض لـ ${r.origin} أن يكون ${t} ${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`نَص غير مقبول: يجب أن يبدأ بـ "${r.prefix}"`;if("ends_with"===r.format)return`نَص غير مقبول: يجب أن ينتهي بـ "${r.suffix}"`;if("includes"===r.format)return`نَص غير مقبول: يجب أن يتضمَّن "${r.includes}"`;if("regex"===r.format)return`نَص غير مقبول: يجب أن يطابق النمط ${r.pattern}`;return`${t[r.format]??r.format} غير مقبول`;case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${r.divisor}`;case"unrecognized_keys":return`معرف${r.keys.length>1?"ات":""} غريب${r.keys.length>1?"ة":""}: ${kt(r.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${r.origin}`;case"invalid_union":default:return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${r.origin}`}})}},"az",0,function(){let e,t,n;return{localeError:(e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}},t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Yanlış dəyər: g\xf6zlənilən instanceof ${r.expected}, daxil olan ${i}`;return`Yanlış dəyər: g\xf6zlənilən ${e}, daxil olan ${i}`}case"invalid_value":if(1===r.values.length)return`Yanlış dəyər: g\xf6zlənilən ${kw(r.values[0])}`;return`Yanlış se\xe7im: aşağıdakılardan biri olmalıdır: ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`\xc7ox b\xf6y\xfck: g\xf6zlənilən ${r.origin??"dəyər"} ${t}${r.maximum.toString()} ${n.unit??"element"}`;return`\xc7ox b\xf6y\xfck: g\xf6zlənilən ${r.origin??"dəyər"} ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`\xc7ox ki\xe7ik: g\xf6zlənilən ${r.origin} ${t}${r.minimum.toString()} ${n.unit}`;return`\xc7ox ki\xe7ik: g\xf6zlənilən ${r.origin} ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Yanlış mətn: "${r.prefix}" ilə başlamalıdır`;if("ends_with"===r.format)return`Yanlış mətn: "${r.suffix}" ilə bitməlidir`;if("includes"===r.format)return`Yanlış mətn: "${r.includes}" daxil olmalıdır`;if("regex"===r.format)return`Yanlış mətn: ${r.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${t[r.format]??r.format}`;case"not_multiple_of":return`Yanlış ədəd: ${r.divisor} ilə b\xf6l\xfcnə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan a\xe7ar${r.keys.length>1?"lar":""}: ${kt(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilində yanlış a\xe7ar`;case"invalid_union":default:return"Yanlış dəyər";case"invalid_element":return`${r.origin} daxilində yanlış dəyər`}})}},"be",0,function(){let e,t,n;return{localeError:(e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}},t={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},n={nan:"NaN",number:"лік",array:"масіў"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Няправільны ўвод: чакаўся instanceof ${r.expected}, атрымана ${i}`;return`Няправільны ўвод: чакаўся ${e}, атрымана ${i}`}case"invalid_value":if(1===r.values.length)return`Няправільны ўвод: чакалася ${kw(r.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n){let e=Iv(Number(r.maximum),n.unit.one,n.unit.few,n.unit.many);return`Занадта вялікі: чакалася, што ${r.origin??"значэнне"} павінна ${n.verb} ${t}${r.maximum.toString()} ${e}`}return`Занадта вялікі: чакалася, што ${r.origin??"значэнне"} павінна быць ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n){let e=Iv(Number(r.minimum),n.unit.one,n.unit.few,n.unit.many);return`Занадта малы: чакалася, што ${r.origin} павінна ${n.verb} ${t}${r.minimum.toString()} ${e}`}return`Занадта малы: чакалася, што ${r.origin} павінна быць ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Няправільны радок: павінен пачынацца з "${r.prefix}"`;if("ends_with"===r.format)return`Няправільны радок: павінен заканчвацца на "${r.suffix}"`;if("includes"===r.format)return`Няправільны радок: павінен змяшчаць "${r.includes}"`;if("regex"===r.format)return`Няправільны радок: павінен адпавядаць шаблону ${r.pattern}`;return`Няправільны ${t[r.format]??r.format}`;case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${r.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${r.keys.length>1?"ключы":"ключ"}: ${kt(r.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${r.origin}`;case"invalid_union":default:return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${r.origin}`}})}},"bg",0,function(){let e,t,n;return{localeError:(e={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}},t={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},n={nan:"NaN",number:"число",array:"масив"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Невалиден вход: очакван instanceof ${r.expected}, получен ${i}`;return`Невалиден вход: очакван ${e}, получен ${i}`}case"invalid_value":if(1===r.values.length)return`Невалиден вход: очакван ${kw(r.values[0])}`;return`Невалидна опция: очаквано едно от ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Твърде голямо: очаква се ${r.origin??"стойност"} да съдържа ${t}${r.maximum.toString()} ${n.unit??"елемента"}`;return`Твърде голямо: очаква се ${r.origin??"стойност"} да бъде ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Твърде малко: очаква се ${r.origin} да съдържа ${t}${r.minimum.toString()} ${n.unit}`;return`Твърде малко: очаква се ${r.origin} да бъде ${t}${r.minimum.toString()}`}case"invalid_format":{if("starts_with"===r.format)return`Невалиден низ: трябва да започва с "${r.prefix}"`;if("ends_with"===r.format)return`Невалиден низ: трябва да завършва с "${r.suffix}"`;if("includes"===r.format)return`Невалиден низ: трябва да включва "${r.includes}"`;if("regex"===r.format)return`Невалиден низ: трябва да съвпада с ${r.pattern}`;let e="Невалиден";return"emoji"===r.format&&(e="Невалидно"),"datetime"===r.format&&(e="Невалидно"),"date"===r.format&&(e="Невалидна"),"time"===r.format&&(e="Невалидно"),"duration"===r.format&&(e="Невалидна"),`${e} ${t[r.format]??r.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${r.divisor}`;case"unrecognized_keys":return`Неразпознат${r.keys.length>1?"и":""} ключ${r.keys.length>1?"ове":""}: ${kt(r.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${r.origin}`;case"invalid_union":default:return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${r.origin}`}})}},"ca",0,function(){let e,t,n;return{localeError:(e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}},t={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Tipus inv\xe0lid: s'esperava instanceof ${r.expected}, s'ha rebut ${i}`;return`Tipus inv\xe0lid: s'esperava ${e}, s'ha rebut ${i}`}case"invalid_value":if(1===r.values.length)return`Valor inv\xe0lid: s'esperava ${kw(r.values[0])}`;return`Opci\xf3 inv\xe0lida: s'esperava una de ${kt(r.values," o ")}`;case"too_big":{let t=r.inclusive?"com a màxim":"menys de",n=e[r.origin]??null;if(n)return`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xe9s ${t} ${r.maximum.toString()} ${n.unit??"elements"}`;return`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${t} ${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?"com a mínim":"més de",n=e[r.origin]??null;if(n)return`Massa petit: s'esperava que ${r.origin} contingu\xe9s ${t} ${r.minimum.toString()} ${n.unit}`;return`Massa petit: s'esperava que ${r.origin} fos ${t} ${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Format inv\xe0lid: ha de comen\xe7ar amb "${r.prefix}"`;if("ends_with"===r.format)return`Format inv\xe0lid: ha d'acabar amb "${r.suffix}"`;if("includes"===r.format)return`Format inv\xe0lid: ha d'incloure "${r.includes}"`;if("regex"===r.format)return`Format inv\xe0lid: ha de coincidir amb el patr\xf3 ${r.pattern}`;return`Format inv\xe0lid per a ${t[r.format]??r.format}`;case"not_multiple_of":return`N\xfamero inv\xe0lid: ha de ser m\xfaltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${kt(r.keys,", ")}`;case"invalid_key":return`Clau inv\xe0lida a ${r.origin}`;case"invalid_union":default:return"Entrada invàlida";case"invalid_element":return`Element inv\xe0lid a ${r.origin}`}})}},"cs",0,function(){let e,t,n;return{localeError:(e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}},t={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},n={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Neplatn\xfd vstup: oček\xe1v\xe1no instanceof ${r.expected}, obdrženo ${i}`;return`Neplatn\xfd vstup: oček\xe1v\xe1no ${e}, obdrženo ${i}`}case"invalid_value":if(1===r.values.length)return`Neplatn\xfd vstup: oček\xe1v\xe1no ${kw(r.values[0])}`;return`Neplatn\xe1 možnost: oček\xe1v\xe1na jedna z hodnot ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Hodnota je př\xedliš velk\xe1: ${r.origin??"hodnota"} mus\xed m\xedt ${t}${r.maximum.toString()} ${n.unit??"prvků"}`;return`Hodnota je př\xedliš velk\xe1: ${r.origin??"hodnota"} mus\xed b\xfdt ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Hodnota je př\xedliš mal\xe1: ${r.origin??"hodnota"} mus\xed m\xedt ${t}${r.minimum.toString()} ${n.unit??"prvků"}`;return`Hodnota je př\xedliš mal\xe1: ${r.origin??"hodnota"} mus\xed b\xfdt ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Neplatn\xfd řetězec: mus\xed zač\xednat na "${r.prefix}"`;if("ends_with"===r.format)return`Neplatn\xfd řetězec: mus\xed končit na "${r.suffix}"`;if("includes"===r.format)return`Neplatn\xfd řetězec: mus\xed obsahovat "${r.includes}"`;if("regex"===r.format)return`Neplatn\xfd řetězec: mus\xed odpov\xeddat vzoru ${r.pattern}`;return`Neplatn\xfd form\xe1t ${t[r.format]??r.format}`;case"not_multiple_of":return`Neplatn\xe9 č\xedslo: mus\xed b\xfdt n\xe1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xe1m\xe9 kl\xedče: ${kt(r.keys,", ")}`;case"invalid_key":return`Neplatn\xfd kl\xedč v ${r.origin}`;case"invalid_union":default:return"Neplatný vstup";case"invalid_element":return`Neplatn\xe1 hodnota v ${r.origin}`}})}},"da",0,function(){let e,t,n;return{localeError:(e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},t={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Ugyldigt input: forventede instanceof ${r.expected}, fik ${i}`;return`Ugyldigt input: forventede ${e}, fik ${i}`}case"invalid_value":if(1===r.values.length)return`Ugyldig v\xe6rdi: forventede ${kw(r.values[0])}`;return`Ugyldigt valg: forventede en af f\xf8lgende ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",i=e[r.origin]??null,a=n[r.origin]??r.origin;if(i)return`For stor: forventede ${a??"value"} ${i.verb} ${t} ${r.maximum.toString()} ${i.unit??"elementer"}`;return`For stor: forventede ${a??"value"} havde ${t} ${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",i=e[r.origin]??null,a=n[r.origin]??r.origin;if(i)return`For lille: forventede ${a} ${i.verb} ${t} ${r.minimum.toString()} ${i.unit}`;return`For lille: forventede ${a} havde ${t} ${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Ugyldig streng: skal starte med "${r.prefix}"`;if("ends_with"===r.format)return`Ugyldig streng: skal ende med "${r.suffix}"`;if("includes"===r.format)return`Ugyldig streng: skal indeholde "${r.includes}"`;if("regex"===r.format)return`Ugyldig streng: skal matche m\xf8nsteret ${r.pattern}`;return`Ugyldig ${t[r.format]??r.format}`;case"not_multiple_of":return`Ugyldigt tal: skal v\xe6re deleligt med ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${kt(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xf8gle i ${r.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xe6rdi i ${r.origin}`;default:return"Ugyldigt input"}})}},"de",0,function(){let e,t,n;return{localeError:(e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}},t={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},n={nan:"NaN",number:"Zahl",array:"Array"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Ung\xfcltige Eingabe: erwartet instanceof ${r.expected}, erhalten ${i}`;return`Ung\xfcltige Eingabe: erwartet ${e}, erhalten ${i}`}case"invalid_value":if(1===r.values.length)return`Ung\xfcltige Eingabe: erwartet ${kw(r.values[0])}`;return`Ung\xfcltige Option: erwartet eine von ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Zu gro\xdf: erwartet, dass ${r.origin??"Wert"} ${t}${r.maximum.toString()} ${n.unit??"Elemente"} hat`;return`Zu gro\xdf: erwartet, dass ${r.origin??"Wert"} ${t}${r.maximum.toString()} ist`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Zu klein: erwartet, dass ${r.origin} ${t}${r.minimum.toString()} ${n.unit} hat`;return`Zu klein: erwartet, dass ${r.origin} ${t}${r.minimum.toString()} ist`}case"invalid_format":if("starts_with"===r.format)return`Ung\xfcltiger String: muss mit "${r.prefix}" beginnen`;if("ends_with"===r.format)return`Ung\xfcltiger String: muss mit "${r.suffix}" enden`;if("includes"===r.format)return`Ung\xfcltiger String: muss "${r.includes}" enthalten`;if("regex"===r.format)return`Ung\xfcltiger String: muss dem Muster ${r.pattern} entsprechen`;return`Ung\xfcltig: ${t[r.format]??r.format}`;case"not_multiple_of":return`Ung\xfcltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${kt(r.keys,", ")}`;case"invalid_key":return`Ung\xfcltiger Schl\xfcssel in ${r.origin}`;case"invalid_union":default:return"Ungültige Eingabe";case"invalid_element":return`Ung\xfcltiger Wert in ${r.origin}`}})}},"el",0,function(){let e,t,n;return{localeError:(e={string:{unit:"χαρακτήρες",verb:"να έχει"},file:{unit:"bytes",verb:"να έχει"},array:{unit:"στοιχεία",verb:"να έχει"},set:{unit:"στοιχεία",verb:"να έχει"},map:{unit:"καταχωρήσεις",verb:"να έχει"}},t={regex:"είσοδος",email:"διεύθυνση email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ημερομηνία και ώρα",date:"ISO ημερομηνία",time:"ISO ώρα",duration:"ISO διάρκεια",ipv4:"διεύθυνση IPv4",ipv6:"διεύθυνση IPv6",mac:"διεύθυνση MAC",cidrv4:"εύρος IPv4",cidrv6:"εύρος IPv6",base64:"συμβολοσειρά κωδικοποιημένη σε base64",base64url:"συμβολοσειρά κωδικοποιημένη σε base64url",json_string:"συμβολοσειρά JSON",e164:"αριθμός E.164",jwt:"JWT",template_literal:"είσοδος"},n={nan:"NaN"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if("string"==typeof r.expected&&/^[A-Z]/.test(r.expected))return`Μη έγκυρη είσοδος: αναμενόταν instanceof ${r.expected}, λήφθηκε ${i}`;return`Μη έγκυρη είσοδος: αναμενόταν ${e}, λήφθηκε ${i}`}case"invalid_value":if(1===r.values.length)return`Μη έγκυρη είσοδος: αναμενόταν ${kw(r.values[0])}`;return`Μη έγκυρη επιλογή: αναμενόταν ένα από ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Πολύ μεγάλο: αναμενόταν ${r.origin??"τιμή"} να έχει ${t}${r.maximum.toString()} ${n.unit??"στοιχεία"}`;return`Πολύ μεγάλο: αναμενόταν ${r.origin??"τιμή"} να είναι ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Πολύ μικρό: αναμενόταν ${r.origin} να έχει ${t}${r.minimum.toString()} ${n.unit}`;return`Πολύ μικρό: αναμενόταν ${r.origin} να είναι ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Μη έγκυρη συμβολοσειρά: πρέπει να ξεκινά με "${r.prefix}"`;if("ends_with"===r.format)return`Μη έγκυρη συμβολοσειρά: πρέπει να τελειώνει με "${r.suffix}"`;if("includes"===r.format)return`Μη έγκυρη συμβολοσειρά: πρέπει να περιέχει "${r.includes}"`;if("regex"===r.format)return`Μη έγκυρη συμβολοσειρά: πρέπει να ταιριάζει με το μοτίβο ${r.pattern}`;return`Μη έγκυρο: ${t[r.format]??r.format}`;case"not_multiple_of":return`Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${r.divisor}`;case"unrecognized_keys":return`Άγνωστ${r.keys.length>1?"α":"ο"} κλειδ${r.keys.length>1?"ιά":"ί"}: ${kt(r.keys,", ")}`;case"invalid_key":return`Μη έγκυρο κλειδί στο ${r.origin}`;case"invalid_union":default:return"Μη έγκυρη είσοδος";case"invalid_element":return`Μη έγκυρη τιμή στο ${r.origin}`}})}},"en",0,_z,"eo",0,function(){let e,t,n;return{localeError:(e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}},t={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},n={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Nevalida enigo: atendiĝis instanceof ${r.expected}, riceviĝis ${i}`;return`Nevalida enigo: atendiĝis ${e}, riceviĝis ${i}`}case"invalid_value":if(1===r.values.length)return`Nevalida enigo: atendiĝis ${kw(r.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Tro granda: atendiĝis ke ${r.origin??"valoro"} havu ${t}${r.maximum.toString()} ${n.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${r.origin??"valoro"} havu ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Tro malgranda: atendiĝis ke ${r.origin} havu ${t}${r.minimum.toString()} ${n.unit}`;return`Tro malgranda: atendiĝis ke ${r.origin} estu ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Nevalida karaktraro: devas komenciĝi per "${r.prefix}"`;if("ends_with"===r.format)return`Nevalida karaktraro: devas finiĝi per "${r.suffix}"`;if("includes"===r.format)return`Nevalida karaktraro: devas inkluzivi "${r.includes}"`;if("regex"===r.format)return`Nevalida karaktraro: devas kongrui kun la modelo ${r.pattern}`;return`Nevalida ${t[r.format]??r.format}`;case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} ŝlosilo${r.keys.length>1?"j":""}: ${kt(r.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${r.origin}`;case"invalid_union":default:return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`}})}},"es",0,function(){let e,t,n;return{localeError:(e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},t={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Entrada inv\xe1lida: se esperaba instanceof ${r.expected}, recibido ${i}`;return`Entrada inv\xe1lida: se esperaba ${e}, recibido ${i}`}case"invalid_value":if(1===r.values.length)return`Entrada inv\xe1lida: se esperaba ${kw(r.values[0])}`;return`Opci\xf3n inv\xe1lida: se esperaba una de ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",i=e[r.origin]??null,a=n[r.origin]??r.origin;if(i)return`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${t}${r.maximum.toString()} ${i.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${a??"valor"} fuera ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",i=e[r.origin]??null,a=n[r.origin]??r.origin;if(i)return`Demasiado peque\xf1o: se esperaba que ${a} tuviera ${t}${r.minimum.toString()} ${i.unit}`;return`Demasiado peque\xf1o: se esperaba que ${a} fuera ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Cadena inv\xe1lida: debe comenzar con "${r.prefix}"`;if("ends_with"===r.format)return`Cadena inv\xe1lida: debe terminar en "${r.suffix}"`;if("includes"===r.format)return`Cadena inv\xe1lida: debe incluir "${r.includes}"`;if("regex"===r.format)return`Cadena inv\xe1lida: debe coincidir con el patr\xf3n ${r.pattern}`;return`Inv\xe1lido ${t[r.format]??r.format}`;case"not_multiple_of":return`N\xfamero inv\xe1lido: debe ser m\xfaltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${kt(r.keys,", ")}`;case"invalid_key":return`Llave inv\xe1lida en ${n[r.origin]??r.origin}`;case"invalid_union":default:return"Entrada inválida";case"invalid_element":return`Valor inv\xe1lido en ${n[r.origin]??r.origin}`}})}},"fa",0,function(){let e,t,n;return{localeError:(e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}},t={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},n={nan:"NaN",number:"عدد",array:"آرایه"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`ورودی نامعتبر: می‌بایست instanceof ${r.expected} می‌بود، ${i} دریافت شد`;return`ورودی نامعتبر: می‌بایست ${e} می‌بود، ${i} دریافت شد`}case"invalid_value":if(1===r.values.length)return`ورودی نامعتبر: می‌بایست ${kw(r.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${kt(r.values,"|")} می‌بود`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`خیلی بزرگ: ${r.origin??"مقدار"} باید ${t}${r.maximum.toString()} ${n.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${r.origin??"مقدار"} باید ${t}${r.maximum.toString()} باشد`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`خیلی کوچک: ${r.origin} باید ${t}${r.minimum.toString()} ${n.unit} باشد`;return`خیلی کوچک: ${r.origin} باید ${t}${r.minimum.toString()} باشد`}case"invalid_format":if("starts_with"===r.format)return`رشته نامعتبر: باید با "${r.prefix}" شروع شود`;if("ends_with"===r.format)return`رشته نامعتبر: باید با "${r.suffix}" تمام شود`;if("includes"===r.format)return`رشته نامعتبر: باید شامل "${r.includes}" باشد`;if("regex"===r.format)return`رشته نامعتبر: باید با الگوی ${r.pattern} مطابقت داشته باشد`;return`${t[r.format]??r.format} نامعتبر`;case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${r.divisor} باشد`;case"unrecognized_keys":return`کلید${r.keys.length>1?"های":""} ناشناس: ${kt(r.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${r.origin}`;case"invalid_union":default:return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${r.origin}`}})}},"fi",0,function(){let e,t,n;return{localeError:(e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}},t={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},n={nan:"NaN"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Virheellinen tyyppi: odotettiin instanceof ${r.expected}, oli ${i}`;return`Virheellinen tyyppi: odotettiin ${e}, oli ${i}`}case"invalid_value":if(1===r.values.length)return`Virheellinen sy\xf6te: t\xe4ytyy olla ${kw(r.values[0])}`;return`Virheellinen valinta: t\xe4ytyy olla yksi seuraavista: ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Liian suuri: ${n.subject} t\xe4ytyy olla ${t}${r.maximum.toString()} ${n.unit}`.trim();return`Liian suuri: arvon t\xe4ytyy olla ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Liian pieni: ${n.subject} t\xe4ytyy olla ${t}${r.minimum.toString()} ${n.unit}`.trim();return`Liian pieni: arvon t\xe4ytyy olla ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Virheellinen sy\xf6te: t\xe4ytyy alkaa "${r.prefix}"`;if("ends_with"===r.format)return`Virheellinen sy\xf6te: t\xe4ytyy loppua "${r.suffix}"`;if("includes"===r.format)return`Virheellinen sy\xf6te: t\xe4ytyy sis\xe4lt\xe4\xe4 "${r.includes}"`;if("regex"===r.format)return`Virheellinen sy\xf6te: t\xe4ytyy vastata s\xe4\xe4nn\xf6llist\xe4 lauseketta ${r.pattern}`;return`Virheellinen ${t[r.format]??r.format}`;case"not_multiple_of":return`Virheellinen luku: t\xe4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${kt(r.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}})}},"fr",0,function(){let e,t,n;return{localeError:(e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}},t={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},n={string:"chaîne",number:"nombre",int:"entier",boolean:"booléen",bigint:"grand entier",symbol:"symbole",undefined:"indéfini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Entr\xe9e invalide : instanceof ${r.expected} attendu, ${i} re\xe7u`;return`Entr\xe9e invalide : ${e} attendu, ${i} re\xe7u`}case"invalid_value":if(1===r.values.length)return`Entr\xe9e invalide : ${kw(r.values[0])} attendu`;return`Option invalide : une valeur parmi ${kt(r.values,"|")} attendue`;case"too_big":{let t=r.inclusive?"<=":"<",i=e[r.origin]??null;if(i)return`Trop grand : ${n[r.origin]??"valeur"} doit ${i.verb} ${t}${r.maximum.toString()} ${i.unit??"élément(s)"}`;return`Trop grand : ${n[r.origin]??"valeur"} doit \xeatre ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",i=e[r.origin]??null;if(i)return`Trop petit : ${n[r.origin]??"valeur"} doit ${i.verb} ${t}${r.minimum.toString()} ${i.unit}`;return`Trop petit : ${n[r.origin]??"valeur"} doit \xeatre ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Cha\xeene invalide : doit commencer par "${r.prefix}"`;if("ends_with"===r.format)return`Cha\xeene invalide : doit se terminer par "${r.suffix}"`;if("includes"===r.format)return`Cha\xeene invalide : doit inclure "${r.includes}"`;if("regex"===r.format)return`Cha\xeene invalide : doit correspondre au mod\xe8le ${r.pattern}`;return`${t[r.format]??r.format} invalide`;case"not_multiple_of":return`Nombre invalide : doit \xeatre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xe9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${kt(r.keys,", ")}`;case"invalid_key":return`Cl\xe9 invalide dans ${r.origin}`;case"invalid_union":default:return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`}})}},"frCA",0,function(){let e,t,n;return{localeError:(e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}},t={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},n={nan:"NaN"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Entr\xe9e invalide : attendu instanceof ${r.expected}, re\xe7u ${i}`;return`Entr\xe9e invalide : attendu ${e}, re\xe7u ${i}`}case"invalid_value":if(1===r.values.length)return`Entr\xe9e invalide : attendu ${kw(r.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"≤":"<",n=e[r.origin]??null;if(n)return`Trop grand : attendu que ${r.origin??"la valeur"} ait ${t}${r.maximum.toString()} ${n.unit}`;return`Trop grand : attendu que ${r.origin??"la valeur"} soit ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?"≥":">",n=e[r.origin]??null;if(n)return`Trop petit : attendu que ${r.origin} ait ${t}${r.minimum.toString()} ${n.unit}`;return`Trop petit : attendu que ${r.origin} soit ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Cha\xeene invalide : doit commencer par "${r.prefix}"`;if("ends_with"===r.format)return`Cha\xeene invalide : doit se terminer par "${r.suffix}"`;if("includes"===r.format)return`Cha\xeene invalide : doit inclure "${r.includes}"`;if("regex"===r.format)return`Cha\xeene invalide : doit correspondre au motif ${r.pattern}`;return`${t[r.format]??r.format} invalide`;case"not_multiple_of":return`Nombre invalide : doit \xeatre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xe9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${kt(r.keys,", ")}`;case"invalid_key":return`Cl\xe9 invalide dans ${r.origin}`;case"invalid_union":default:return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`}})}},"he",0,function(){let e,t,n,r,i,a,s,o,l;return{localeError:(e={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},t={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},n=t=>t?e[t]:void 0,r=t=>{let r=n(t);return r?r.label:t??e.unknown.label},i=e=>`ה${r(e)}`,a=e=>{let t=n(e);return"f"===(t?.gender??"m")?"צריכה להיות":"צריך להיות"},s=e=>e?t[e]??null:null,o={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},l={nan:"NaN"},t=>{switch(t.code){case"invalid_type":{let n=t.expected,i=l[n??""]??r(n),a=kz(t.input),s=l[a]??e[a]?.label??a;if(/^[A-Z]/.test(t.expected))return`קלט לא תקין: צריך להיות instanceof ${t.expected}, התקבל ${s}`;return`קלט לא תקין: צריך להיות ${i}, התקבל ${s}`}case"invalid_value":{if(1===t.values.length)return`ערך לא תקין: הערך חייב להיות ${kw(t.values[0])}`;let e=t.values.map(e=>kw(e));if(2===t.values.length)return`ערך לא תקין: האפשרויות המתאימות הן ${e[0]} או ${e[1]}`;let n=e[e.length-1],r=e.slice(0,-1).join(", ");return`ערך לא תקין: האפשרויות המתאימות הן ${r} או ${n}`}case"too_big":{let e=s(t.origin),n=i(t.origin??"value");if("string"===t.origin)return`${e?.longLabel??"ארוך"} מדי: ${n} צריכה להכיל ${t.maximum.toString()} ${e?.unit??""} ${t.inclusive?"או פחות":"לכל היותר"}`.trim();if("number"===t.origin){let e=t.inclusive?`קטן או שווה ל-${t.maximum}`:`קטן מ-${t.maximum}`;return`גדול מדי: ${n} צריך להיות ${e}`}if("array"===t.origin||"set"===t.origin){let r="set"===t.origin?"צריכה":"צריך",i=t.inclusive?`${t.maximum} ${e?.unit??""} או פחות`:`פחות מ-${t.maximum} ${e?.unit??""}`;return`גדול מדי: ${n} ${r} להכיל ${i}`.trim()}let r=t.inclusive?"<=":"<",o=a(t.origin??"value");if(e?.unit)return`${e.longLabel} מדי: ${n} ${o} ${r}${t.maximum.toString()} ${e.unit}`;return`${e?.longLabel??"גדול"} מדי: ${n} ${o} ${r}${t.maximum.toString()}`}case"too_small":{let e=s(t.origin),n=i(t.origin??"value");if("string"===t.origin)return`${e?.shortLabel??"קצר"} מדי: ${n} צריכה להכיל ${t.minimum.toString()} ${e?.unit??""} ${t.inclusive?"או יותר":"לפחות"}`.trim();if("number"===t.origin){let e=t.inclusive?`גדול או שווה ל-${t.minimum}`:`גדול מ-${t.minimum}`;return`קטן מדי: ${n} צריך להיות ${e}`}if("array"===t.origin||"set"===t.origin){let r="set"===t.origin?"צריכה":"צריך";if(1===t.minimum&&t.inclusive){let e=(t.origin,"לפחות פריט אחד");return`קטן מדי: ${n} ${r} להכיל ${e}`}let i=t.inclusive?`${t.minimum} ${e?.unit??""} או יותר`:`יותר מ-${t.minimum} ${e?.unit??""}`;return`קטן מדי: ${n} ${r} להכיל ${i}`.trim()}let r=t.inclusive?">=":">",o=a(t.origin??"value");if(e?.unit)return`${e.shortLabel} מדי: ${n} ${o} ${r}${t.minimum.toString()} ${e.unit}`;return`${e?.shortLabel??"קטן"} מדי: ${n} ${o} ${r}${t.minimum.toString()}`}case"invalid_format":{if("starts_with"===t.format)return`המחרוזת חייבת להתחיל ב "${t.prefix}"`;if("ends_with"===t.format)return`המחרוזת חייבת להסתיים ב "${t.suffix}"`;if("includes"===t.format)return`המחרוזת חייבת לכלול "${t.includes}"`;if("regex"===t.format)return`המחרוזת חייבת להתאים לתבנית ${t.pattern}`;let e=o[t.format],n=e?.label??t.format,r=e?.gender??"m";return`${n} לא ${"f"===r?"תקינה":"תקין"}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${t.divisor}`;case"unrecognized_keys":return`מפתח${t.keys.length>1?"ות":""} לא מזוה${t.keys.length>1?"ים":"ה"}: ${kt(t.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":default:return"קלט לא תקין";case"invalid_element":{let e=i(t.origin??"array");return`ערך לא תקין ב${e}`}}})}},"hr",0,function(){let e,t,n;return{localeError:(e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}},t={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},n={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Neispravan unos: očekuje se instanceof ${r.expected}, a primljeno je ${i}`;return`Neispravan unos: očekuje se ${e}, a primljeno je ${i}`}case"invalid_value":if(1===r.values.length)return`Neispravna vrijednost: očekivano ${kw(r.values[0])}`;return`Neispravna opcija: očekivano jedno od ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",i=e[r.origin]??null,a=n[r.origin]??r.origin;if(i)return`Preveliko: očekivano da ${a??"vrijednost"} ima ${t}${r.maximum.toString()} ${i.unit??"elemenata"}`;return`Preveliko: očekivano da ${a??"vrijednost"} bude ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",i=e[r.origin]??null,a=n[r.origin]??r.origin;if(i)return`Premalo: očekivano da ${a} ima ${t}${r.minimum.toString()} ${i.unit}`;return`Premalo: očekivano da ${a} bude ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Neispravan tekst: mora započinjati s "${r.prefix}"`;if("ends_with"===r.format)return`Neispravan tekst: mora završavati s "${r.suffix}"`;if("includes"===r.format)return`Neispravan tekst: mora sadržavati "${r.includes}"`;if("regex"===r.format)return`Neispravan tekst: mora odgovarati uzorku ${r.pattern}`;return`Neispravna ${t[r.format]??r.format}`;case"not_multiple_of":return`Neispravan broj: mora biti višekratnik od ${r.divisor}`;case"unrecognized_keys":return`Neprepoznat${r.keys.length>1?"i ključevi":" ključ"}: ${kt(r.keys,", ")}`;case"invalid_key":return`Neispravan ključ u ${n[r.origin]??r.origin}`;case"invalid_union":default:return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${n[r.origin]??r.origin}`}})}},"hu",0,function(){let e,t,n;return{localeError:(e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}},t={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},n={nan:"NaN",number:"szám",array:"tömb"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`\xc9rv\xe9nytelen bemenet: a v\xe1rt \xe9rt\xe9k instanceof ${r.expected}, a kapott \xe9rt\xe9k ${i}`;return`\xc9rv\xe9nytelen bemenet: a v\xe1rt \xe9rt\xe9k ${e}, a kapott \xe9rt\xe9k ${i}`}case"invalid_value":if(1===r.values.length)return`\xc9rv\xe9nytelen bemenet: a v\xe1rt \xe9rt\xe9k ${kw(r.values[0])}`;return`\xc9rv\xe9nytelen opci\xf3: valamelyik \xe9rt\xe9k v\xe1rt ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`T\xfal nagy: ${r.origin??"érték"} m\xe9rete t\xfal nagy ${t}${r.maximum.toString()} ${n.unit??"elem"}`;return`T\xfal nagy: a bemeneti \xe9rt\xe9k ${r.origin??"érték"} t\xfal nagy: ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`T\xfal kicsi: a bemeneti \xe9rt\xe9k ${r.origin} m\xe9rete t\xfal kicsi ${t}${r.minimum.toString()} ${n.unit}`;return`T\xfal kicsi: a bemeneti \xe9rt\xe9k ${r.origin} t\xfal kicsi ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`\xc9rv\xe9nytelen string: "${r.prefix}" \xe9rt\xe9kkel kell kezdődnie`;if("ends_with"===r.format)return`\xc9rv\xe9nytelen string: "${r.suffix}" \xe9rt\xe9kkel kell v\xe9gződnie`;if("includes"===r.format)return`\xc9rv\xe9nytelen string: "${r.includes}" \xe9rt\xe9ket kell tartalmaznia`;if("regex"===r.format)return`\xc9rv\xe9nytelen string: ${r.pattern} mint\xe1nak kell megfelelnie`;return`\xc9rv\xe9nytelen ${t[r.format]??r.format}`;case"not_multiple_of":return`\xc9rv\xe9nytelen sz\xe1m: ${r.divisor} t\xf6bbsz\xf6r\xf6s\xe9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${kt(r.keys,", ")}`;case"invalid_key":return`\xc9rv\xe9nytelen kulcs ${r.origin}`;case"invalid_union":default:return"Érvénytelen bemenet";case"invalid_element":return`\xc9rv\xe9nytelen \xe9rt\xe9k: ${r.origin}`}})}},"hy",0,function(){let e,t,n;return{localeError:(e={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}},t={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},n={nan:"NaN",number:"թիվ",array:"զանգված"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${r.expected}, ստացվել է ${i}`;return`Սխալ մուտքագրում․ սպասվում էր ${e}, ստացվել է ${i}`}case"invalid_value":if(1===r.values.length)return`Սխալ մուտքագրում․ սպասվում էր ${kw(r.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n){let e=Iy(Number(r.maximum),n.unit.one,n.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${Ib(r.origin??"արժեք")} կունենա ${t}${r.maximum.toString()} ${e}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${Ib(r.origin??"արժեք")} լինի ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n){let e=Iy(Number(r.minimum),n.unit.one,n.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${Ib(r.origin)} կունենա ${t}${r.minimum.toString()} ${e}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${Ib(r.origin)} լինի ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Սխալ տող․ պետք է սկսվի "${r.prefix}"-ով`;if("ends_with"===r.format)return`Սխալ տող․ պետք է ավարտվի "${r.suffix}"-ով`;if("includes"===r.format)return`Սխալ տող․ պետք է պարունակի "${r.includes}"`;if("regex"===r.format)return`Սխալ տող․ պետք է համապատասխանի ${r.pattern} ձևաչափին`;return`Սխալ ${t[r.format]??r.format}`;case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${r.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${r.keys.length>1?"ներ":""}. ${kt(r.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${Ib(r.origin)}-ում`;case"invalid_union":default:return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${Ib(r.origin)}-ում`}})}},"id",0,function(){let e,t,n;return{localeError:(e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}},t={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Input tidak valid: diharapkan instanceof ${r.expected}, diterima ${i}`;return`Input tidak valid: diharapkan ${e}, diterima ${i}`}case"invalid_value":if(1===r.values.length)return`Input tidak valid: diharapkan ${kw(r.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${t}${r.maximum.toString()} ${n.unit??"elemen"}`;return`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Terlalu kecil: diharapkan ${r.origin} memiliki ${t}${r.minimum.toString()} ${n.unit}`;return`Terlalu kecil: diharapkan ${r.origin} menjadi ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`String tidak valid: harus dimulai dengan "${r.prefix}"`;if("ends_with"===r.format)return`String tidak valid: harus berakhir dengan "${r.suffix}"`;if("includes"===r.format)return`String tidak valid: harus menyertakan "${r.includes}"`;if("regex"===r.format)return`String tidak valid: harus sesuai pola ${r.pattern}`;return`${t[r.format]??r.format} tidak valid`;case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${kt(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":default:return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`}})}},"is",0,function(){let e,t,n;return{localeError:(e={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}},t={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},n={nan:"NaN",number:"númer",array:"fylki"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Rangt gildi: \xde\xfa sl\xf3st inn ${i} \xfear sem \xe1 a\xf0 vera instanceof ${r.expected}`;return`Rangt gildi: \xde\xfa sl\xf3st inn ${i} \xfear sem \xe1 a\xf0 vera ${e}`}case"invalid_value":if(1===r.values.length)return`Rangt gildi: gert r\xe1\xf0 fyrir ${kw(r.values[0])}`;return`\xd3gilt val: m\xe1 vera eitt af eftirfarandi ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Of st\xf3rt: gert er r\xe1\xf0 fyrir a\xf0 ${r.origin??"gildi"} hafi ${t}${r.maximum.toString()} ${n.unit??"hluti"}`;return`Of st\xf3rt: gert er r\xe1\xf0 fyrir a\xf0 ${r.origin??"gildi"} s\xe9 ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Of l\xedti\xf0: gert er r\xe1\xf0 fyrir a\xf0 ${r.origin} hafi ${t}${r.minimum.toString()} ${n.unit}`;return`Of l\xedti\xf0: gert er r\xe1\xf0 fyrir a\xf0 ${r.origin} s\xe9 ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`\xd3gildur strengur: ver\xf0ur a\xf0 byrja \xe1 "${r.prefix}"`;if("ends_with"===r.format)return`\xd3gildur strengur: ver\xf0ur a\xf0 enda \xe1 "${r.suffix}"`;if("includes"===r.format)return`\xd3gildur strengur: ver\xf0ur a\xf0 innihalda "${r.includes}"`;if("regex"===r.format)return`\xd3gildur strengur: ver\xf0ur a\xf0 fylgja mynstri ${r.pattern}`;return`Rangt ${t[r.format]??r.format}`;case"not_multiple_of":return`R\xf6ng tala: ver\xf0ur a\xf0 vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`\xd3\xfeekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${kt(r.keys,", ")}`;case"invalid_key":return`Rangur lykill \xed ${r.origin}`;case"invalid_union":default:return"Rangt gildi";case"invalid_element":return`Rangt gildi \xed ${r.origin}`}})}},"it",0,function(){let e,t,n;return{localeError:(e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}},t={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"numero",array:"vettore"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Input non valido: atteso instanceof ${r.expected}, ricevuto ${i}`;return`Input non valido: atteso ${e}, ricevuto ${i}`}case"invalid_value":if(1===r.values.length)return`Input non valido: atteso ${kw(r.values[0])}`;return`Opzione non valida: atteso uno tra ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Troppo grande: ${r.origin??"valore"} deve avere ${t}${r.maximum.toString()} ${n.unit??"elementi"}`;return`Troppo grande: ${r.origin??"valore"} deve essere ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Troppo piccolo: ${r.origin} deve avere ${t}${r.minimum.toString()} ${n.unit}`;return`Troppo piccolo: ${r.origin} deve essere ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Stringa non valida: deve iniziare con "${r.prefix}"`;if("ends_with"===r.format)return`Stringa non valida: deve terminare con "${r.suffix}"`;if("includes"===r.format)return`Stringa non valida: deve includere "${r.includes}"`;if("regex"===r.format)return`Stringa non valida: deve corrispondere al pattern ${r.pattern}`;return`Input non valido: ${t[r.format]??r.format}`;case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${kt(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":default:return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`}})}},"ja",0,function(){let e,t,n;return{localeError:(e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}},t={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},n={nan:"NaN",number:"数値",array:"配列"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`無効な入力: instanceof ${r.expected}が期待されましたが、${i}が入力されました`;return`無効な入力: ${e}が期待されましたが、${i}が入力されました`}case"invalid_value":if(1===r.values.length)return`無効な入力: ${kw(r.values[0])}が期待されました`;return`無効な選択: ${kt(r.values,"、")}のいずれかである必要があります`;case"too_big":{let t=r.inclusive?"以下である":"より小さい",n=e[r.origin]??null;if(n)return`大きすぎる値: ${r.origin??"値"}は${r.maximum.toString()}${n.unit??"要素"}${t}必要があります`;return`大きすぎる値: ${r.origin??"値"}は${r.maximum.toString()}${t}必要があります`}case"too_small":{let t=r.inclusive?"以上である":"より大きい",n=e[r.origin]??null;if(n)return`小さすぎる値: ${r.origin}は${r.minimum.toString()}${n.unit}${t}必要があります`;return`小さすぎる値: ${r.origin}は${r.minimum.toString()}${t}必要があります`}case"invalid_format":if("starts_with"===r.format)return`無効な文字列: "${r.prefix}"で始まる必要があります`;if("ends_with"===r.format)return`無効な文字列: "${r.suffix}"で終わる必要があります`;if("includes"===r.format)return`無効な文字列: "${r.includes}"を含む必要があります`;if("regex"===r.format)return`無効な文字列: パターン${r.pattern}に一致する必要があります`;return`無効な${t[r.format]??r.format}`;case"not_multiple_of":return`無効な数値: ${r.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${r.keys.length>1?"群":""}: ${kt(r.keys,"、")}`;case"invalid_key":return`${r.origin}内の無効なキー`;case"invalid_union":default:return"無効な入力";case"invalid_element":return`${r.origin}内の無効な値`}})}},"ka",0,function(){let e,t,n;return{localeError:(e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}},t={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული ველი",base64url:"base64url-კოდირებული ველი",json_string:"JSON ველი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},n={nan:"NaN",number:"რიცხვი",string:"ველი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${r.expected}, მიღებული ${i}`;return`არასწორი შეყვანა: მოსალოდნელი ${e}, მიღებული ${i}`}case"invalid_value":if(1===r.values.length)return`არასწორი შეყვანა: მოსალოდნელი ${kw(r.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${kt(r.values,"|")}-დან`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`ზედმეტად დიდი: მოსალოდნელი ${r.origin??"მნიშვნელობა"} ${n.verb} ${t}${r.maximum.toString()} ${n.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${r.origin??"მნიშვნელობა"} იყოს ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`ზედმეტად პატარა: მოსალოდნელი ${r.origin} ${n.verb} ${t}${r.minimum.toString()} ${n.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${r.origin} იყოს ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`არასწორი ველი: უნდა იწყებოდეს "${r.prefix}"-ით`;if("ends_with"===r.format)return`არასწორი ველი: უნდა მთავრდებოდეს "${r.suffix}"-ით`;if("includes"===r.format)return`არასწორი ველი: უნდა შეიცავდეს "${r.includes}"-ს`;if("regex"===r.format)return`არასწორი ველი: უნდა შეესაბამებოდეს შაბლონს ${r.pattern}`;return`არასწორი ${t[r.format]??r.format}`;case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${r.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${r.keys.length>1?"ები":"ი"}: ${kt(r.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${r.origin}-ში`;case"invalid_union":default:return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${r.origin}-ში`}})}},"kh",0,function(){return Ik()},"km",0,Ik,"ko",0,function(){let e,t,n;return{localeError:(e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}},t={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},n={nan:"NaN"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`잘못된 입력: 예상 타입은 instanceof ${r.expected}, 받은 타입은 ${i}입니다`;return`잘못된 입력: 예상 타입은 ${e}, 받은 타입은 ${i}입니다`}case"invalid_value":if(1===r.values.length)return`잘못된 입력: 값은 ${kw(r.values[0])} 이어야 합니다`;return`잘못된 옵션: ${kt(r.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let t=r.inclusive?"이하":"미만",n="미만"===t?"이어야 합니다":"여야 합니다",i=e[r.origin]??null,a=i?.unit??"요소";if(i)return`${r.origin??"값"}이 너무 큽니다: ${r.maximum.toString()}${a} ${t}${n}`;return`${r.origin??"값"}이 너무 큽니다: ${r.maximum.toString()} ${t}${n}`}case"too_small":{let t=r.inclusive?"이상":"초과",n="이상"===t?"이어야 합니다":"여야 합니다",i=e[r.origin]??null,a=i?.unit??"요소";if(i)return`${r.origin??"값"}이 너무 작습니다: ${r.minimum.toString()}${a} ${t}${n}`;return`${r.origin??"값"}이 너무 작습니다: ${r.minimum.toString()} ${t}${n}`}case"invalid_format":if("starts_with"===r.format)return`잘못된 문자열: "${r.prefix}"(으)로 시작해야 합니다`;if("ends_with"===r.format)return`잘못된 문자열: "${r.suffix}"(으)로 끝나야 합니다`;if("includes"===r.format)return`잘못된 문자열: "${r.includes}"을(를) 포함해야 합니다`;if("regex"===r.format)return`잘못된 문자열: 정규식 ${r.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${t[r.format]??r.format}`;case"not_multiple_of":return`잘못된 숫자: ${r.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${kt(r.keys,", ")}`;case"invalid_key":return`잘못된 키: ${r.origin}`;case"invalid_union":default:return"잘못된 입력";case"invalid_element":return`잘못된 값: ${r.origin}`}})}},"lt",0,function(){return{localeError:(()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function t(t,n,r,i){let a=e[t]??null;return null===a?a:{unit:a.unit[n],verb:a.verb[i][r?"inclusive":"notInclusive"]}}let n={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},r={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return e=>{switch(e.code){case"invalid_type":{let t=r[e.expected]??e.expected,n=kz(e.input),i=r[n]??n;if(/^[A-Z]/.test(e.expected))return`Gautas tipas ${i}, o tikėtasi - instanceof ${e.expected}`;return`Gautas tipas ${i}, o tikėtasi - ${t}`}case"invalid_value":if(1===e.values.length)return`Privalo būti ${kw(e.values[0])}`;return`Privalo būti vienas iš ${kt(e.values,"|")} pasirinkimų`;case"too_big":{let n=r[e.origin]??e.origin,i=t(e.origin,Iw(Number(e.maximum)),e.inclusive??!1,"smaller");if(i?.verb)return`${Ij(n??e.origin??"reikšmė")} ${i.verb} ${e.maximum.toString()} ${i.unit??"elementų"}`;let a=e.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${Ij(n??e.origin??"reikšmė")} turi būti ${a} ${e.maximum.toString()} ${i?.unit}`}case"too_small":{let n=r[e.origin]??e.origin,i=t(e.origin,Iw(Number(e.minimum)),e.inclusive??!1,"bigger");if(i?.verb)return`${Ij(n??e.origin??"reikšmė")} ${i.verb} ${e.minimum.toString()} ${i.unit??"elementų"}`;let a=e.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${Ij(n??e.origin??"reikšmė")} turi būti ${a} ${e.minimum.toString()} ${i?.unit}`}case"invalid_format":if("starts_with"===e.format)return`Eilutė privalo prasidėti "${e.prefix}"`;if("ends_with"===e.format)return`Eilutė privalo pasibaigti "${e.suffix}"`;if("includes"===e.format)return`Eilutė privalo įtraukti "${e.includes}"`;if("regex"===e.format)return`Eilutė privalo atitikti ${e.pattern}`;return`Neteisingas ${n[e.format]??e.format}`;case"not_multiple_of":return`Skaičius privalo būti ${e.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${e.keys.length>1?"i":"as"} rakt${e.keys.length>1?"ai":"as"}: ${kt(e.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":default:return"Klaidinga įvestis";case"invalid_element":{let t=r[e.origin]??e.origin;return`${Ij(t??e.origin??"reikšmė")} turi klaidingą įvestį`}}}})()}},"mk",0,function(){let e,t,n;return{localeError:(e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}},t={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},n={nan:"NaN",number:"број",array:"низа"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Грешен внес: се очекува instanceof ${r.expected}, примено ${i}`;return`Грешен внес: се очекува ${e}, примено ${i}`}case"invalid_value":if(1===r.values.length)return`Invalid input: expected ${kw(r.values[0])}`;return`Грешана опција: се очекува една ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Премногу голем: се очекува ${r.origin??"вредноста"} да има ${t}${r.maximum.toString()} ${n.unit??"елементи"}`;return`Премногу голем: се очекува ${r.origin??"вредноста"} да биде ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Премногу мал: се очекува ${r.origin} да има ${t}${r.minimum.toString()} ${n.unit}`;return`Премногу мал: се очекува ${r.origin} да биде ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Неважечка низа: мора да започнува со "${r.prefix}"`;if("ends_with"===r.format)return`Неважечка низа: мора да завршува со "${r.suffix}"`;if("includes"===r.format)return`Неважечка низа: мора да вклучува "${r.includes}"`;if("regex"===r.format)return`Неважечка низа: мора да одгоара на патернот ${r.pattern}`;return`Invalid ${t[r.format]??r.format}`;case"not_multiple_of":return`Грешен број: мора да биде делив со ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${kt(r.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${r.origin}`;case"invalid_union":default:return"Грешен внес";case"invalid_element":return`Грешна вредност во ${r.origin}`}})}},"ms",0,function(){let e,t,n;return{localeError:(e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}},t={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"nombor"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Input tidak sah: dijangka instanceof ${r.expected}, diterima ${i}`;return`Input tidak sah: dijangka ${e}, diterima ${i}`}case"invalid_value":if(1===r.values.length)return`Input tidak sah: dijangka ${kw(r.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Terlalu besar: dijangka ${r.origin??"nilai"} ${n.verb} ${t}${r.maximum.toString()} ${n.unit??"elemen"}`;return`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Terlalu kecil: dijangka ${r.origin} ${n.verb} ${t}${r.minimum.toString()} ${n.unit}`;return`Terlalu kecil: dijangka ${r.origin} adalah ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`String tidak sah: mesti bermula dengan "${r.prefix}"`;if("ends_with"===r.format)return`String tidak sah: mesti berakhir dengan "${r.suffix}"`;if("includes"===r.format)return`String tidak sah: mesti mengandungi "${r.includes}"`;if("regex"===r.format)return`String tidak sah: mesti sepadan dengan corak ${r.pattern}`;return`${t[r.format]??r.format} tidak sah`;case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${kt(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":default:return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`}})}},"nl",0,function(){let e,t,n;return{localeError:(e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}},t={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},n={nan:"NaN",number:"getal"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Ongeldige invoer: verwacht instanceof ${r.expected}, ontving ${i}`;return`Ongeldige invoer: verwacht ${e}, ontving ${i}`}case"invalid_value":if(1===r.values.length)return`Ongeldige invoer: verwacht ${kw(r.values[0])}`;return`Ongeldige optie: verwacht \xe9\xe9n van ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null,i="date"===r.origin?"laat":"string"===r.origin?"lang":"groot";if(n)return`Te ${i}: verwacht dat ${r.origin??"waarde"} ${t}${r.maximum.toString()} ${n.unit??"elementen"} ${n.verb}`;return`Te ${i}: verwacht dat ${r.origin??"waarde"} ${t}${r.maximum.toString()} is`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null,i="date"===r.origin?"vroeg":"string"===r.origin?"kort":"klein";if(n)return`Te ${i}: verwacht dat ${r.origin} ${t}${r.minimum.toString()} ${n.unit} ${n.verb}`;return`Te ${i}: verwacht dat ${r.origin} ${t}${r.minimum.toString()} is`}case"invalid_format":if("starts_with"===r.format)return`Ongeldige tekst: moet met "${r.prefix}" beginnen`;if("ends_with"===r.format)return`Ongeldige tekst: moet op "${r.suffix}" eindigen`;if("includes"===r.format)return`Ongeldige tekst: moet "${r.includes}" bevatten`;if("regex"===r.format)return`Ongeldige tekst: moet overeenkomen met patroon ${r.pattern}`;return`Ongeldig: ${t[r.format]??r.format}`;case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${kt(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":default:return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`}})}},"no",0,function(){let e,t,n;return{localeError:(e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}},t={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"tall",array:"liste"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Ugyldig input: forventet instanceof ${r.expected}, fikk ${i}`;return`Ugyldig input: forventet ${e}, fikk ${i}`}case"invalid_value":if(1===r.values.length)return`Ugyldig verdi: forventet ${kw(r.values[0])}`;return`Ugyldig valg: forventet en av ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`For stor(t): forventet ${r.origin??"value"} til \xe5 ha ${t}${r.maximum.toString()} ${n.unit??"elementer"}`;return`For stor(t): forventet ${r.origin??"value"} til \xe5 ha ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`For lite(n): forventet ${r.origin} til \xe5 ha ${t}${r.minimum.toString()} ${n.unit}`;return`For lite(n): forventet ${r.origin} til \xe5 ha ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Ugyldig streng: m\xe5 starte med "${r.prefix}"`;if("ends_with"===r.format)return`Ugyldig streng: m\xe5 ende med "${r.suffix}"`;if("includes"===r.format)return`Ugyldig streng: m\xe5 inneholde "${r.includes}"`;if("regex"===r.format)return`Ugyldig streng: m\xe5 matche m\xf8nsteret ${r.pattern}`;return`Ugyldig ${t[r.format]??r.format}`;case"not_multiple_of":return`Ugyldig tall: m\xe5 v\xe6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${kt(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xf8kkel i ${r.origin}`;case"invalid_union":default:return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`}})}},"ota",0,function(){let e,t,n;return{localeError:(e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}},t={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},n={nan:"NaN",number:"numara",array:"saf",null:"gayb"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`F\xe2sit giren: umulan instanceof ${r.expected}, alınan ${i}`;return`F\xe2sit giren: umulan ${e}, alınan ${i}`}case"invalid_value":if(1===r.values.length)return`F\xe2sit giren: umulan ${kw(r.values[0])}`;return`F\xe2sit tercih: m\xfbteberler ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Fazla b\xfcy\xfck: ${r.origin??"value"}, ${t}${r.maximum.toString()} ${n.unit??"elements"} sahip olmalıydı.`;return`Fazla b\xfcy\xfck: ${r.origin??"value"}, ${t}${r.maximum.toString()} olmalıydı.`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Fazla k\xfc\xe7\xfck: ${r.origin}, ${t}${r.minimum.toString()} ${n.unit} sahip olmalıydı.`;return`Fazla k\xfc\xe7\xfck: ${r.origin}, ${t}${r.minimum.toString()} olmalıydı.`}case"invalid_format":if("starts_with"===r.format)return`F\xe2sit metin: "${r.prefix}" ile başlamalı.`;if("ends_with"===r.format)return`F\xe2sit metin: "${r.suffix}" ile bitmeli.`;if("includes"===r.format)return`F\xe2sit metin: "${r.includes}" ihtiv\xe2 etmeli.`;if("regex"===r.format)return`F\xe2sit metin: ${r.pattern} nakşına uymalı.`;return`F\xe2sit ${t[r.format]??r.format}`;case"not_multiple_of":return`F\xe2sit sayı: ${r.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${r.keys.length>1?"s":""}: ${kt(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xe7in tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${r.origin} i\xe7in tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}})}},"pl",0,function(){let e,t,n;return{localeError:(e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}},t={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},n={nan:"NaN",number:"liczba",array:"tablica"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${r.expected}, otrzymano ${i}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${e}, otrzymano ${i}`}case"invalid_value":if(1===r.values.length)return`Nieprawidłowe dane wejściowe: oczekiwano ${kw(r.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Za duża wartość: oczekiwano, że ${r.origin??"wartość"} będzie mieć ${t}${r.maximum.toString()} ${n.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${r.origin??"wartość"} będzie wynosić ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Za mała wartość: oczekiwano, że ${r.origin??"wartość"} będzie mieć ${t}${r.minimum.toString()} ${n.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${r.origin??"wartość"} będzie wynosić ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Nieprawidłowy ciąg znak\xf3w: musi zaczynać się od "${r.prefix}"`;if("ends_with"===r.format)return`Nieprawidłowy ciąg znak\xf3w: musi kończyć się na "${r.suffix}"`;if("includes"===r.format)return`Nieprawidłowy ciąg znak\xf3w: musi zawierać "${r.includes}"`;if("regex"===r.format)return`Nieprawidłowy ciąg znak\xf3w: musi odpowiadać wzorcowi ${r.pattern}`;return`Nieprawidłow(y/a/e) ${t[r.format]??r.format}`;case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${kt(r.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${r.origin}`;case"invalid_union":default:return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${r.origin}`}})}},"ps",0,function(){let e,t,n;return{localeError:(e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}},t={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},n={nan:"NaN",number:"عدد",array:"ارې"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`ناسم ورودي: باید instanceof ${r.expected} وای, مګر ${i} ترلاسه شو`;return`ناسم ورودي: باید ${e} وای, مګر ${i} ترلاسه شو`}case"invalid_value":if(1===r.values.length)return`ناسم ورودي: باید ${kw(r.values[0])} وای`;return`ناسم انتخاب: باید یو له ${kt(r.values,"|")} څخه وای`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`ډیر لوی: ${r.origin??"ارزښت"} باید ${t}${r.maximum.toString()} ${n.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${r.origin??"ارزښت"} باید ${t}${r.maximum.toString()} وي`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`ډیر کوچنی: ${r.origin} باید ${t}${r.minimum.toString()} ${n.unit} ولري`;return`ډیر کوچنی: ${r.origin} باید ${t}${r.minimum.toString()} وي`}case"invalid_format":if("starts_with"===r.format)return`ناسم متن: باید د "${r.prefix}" سره پیل شي`;if("ends_with"===r.format)return`ناسم متن: باید د "${r.suffix}" سره پای ته ورسيږي`;if("includes"===r.format)return`ناسم متن: باید "${r.includes}" ولري`;if("regex"===r.format)return`ناسم متن: باید د ${r.pattern} سره مطابقت ولري`;return`${t[r.format]??r.format} ناسم دی`;case"not_multiple_of":return`ناسم عدد: باید د ${r.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${r.keys.length>1?"کلیډونه":"کلیډ"}: ${kt(r.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${r.origin} کې`;case"invalid_union":default:return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${r.origin} کې`}})}},"pt",0,function(){let e,t,n;return{localeError:(e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}},t={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},n={nan:"NaN",number:"número",null:"nulo"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Tipo inv\xe1lido: esperado instanceof ${r.expected}, recebido ${i}`;return`Tipo inv\xe1lido: esperado ${e}, recebido ${i}`}case"invalid_value":if(1===r.values.length)return`Entrada inv\xe1lida: esperado ${kw(r.values[0])}`;return`Op\xe7\xe3o inv\xe1lida: esperada uma das ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Muito grande: esperado que ${r.origin??"valor"} tivesse ${t}${r.maximum.toString()} ${n.unit??"elementos"}`;return`Muito grande: esperado que ${r.origin??"valor"} fosse ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Muito pequeno: esperado que ${r.origin} tivesse ${t}${r.minimum.toString()} ${n.unit}`;return`Muito pequeno: esperado que ${r.origin} fosse ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Texto inv\xe1lido: deve come\xe7ar com "${r.prefix}"`;if("ends_with"===r.format)return`Texto inv\xe1lido: deve terminar com "${r.suffix}"`;if("includes"===r.format)return`Texto inv\xe1lido: deve incluir "${r.includes}"`;if("regex"===r.format)return`Texto inv\xe1lido: deve corresponder ao padr\xe3o ${r.pattern}`;return`${t[r.format]??r.format} inv\xe1lido`;case"not_multiple_of":return`N\xfamero inv\xe1lido: deve ser m\xfaltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${kt(r.keys,", ")}`;case"invalid_key":return`Chave inv\xe1lida em ${r.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inv\xe1lido em ${r.origin}`;default:return"Campo inválido"}})}},"ro",0,function(){let e,t,n;return{localeError:(e={string:{unit:"caractere",verb:"să aibă"},file:{unit:"octeți",verb:"să aibă"},array:{unit:"elemente",verb:"să aibă"},set:{unit:"elemente",verb:"să aibă"},map:{unit:"intrări",verb:"să aibă"}},t={regex:"intrare",email:"adresă de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dată și oră ISO",date:"dată ISO",time:"oră ISO",duration:"durată ISO",ipv4:"adresă IPv4",ipv6:"adresă IPv6",mac:"adresă MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"șir codat base64",base64url:"șir codat base64url",json_string:"șir JSON",e164:"număr E.164",jwt:"JWT",template_literal:"intrare"},n={nan:"NaN",string:"șir",number:"număr",boolean:"boolean",function:"funcție",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"număr mare",void:"void",never:"never",map:"hartă",set:"set"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;return`Intrare invalidă: așteptat ${e}, primit ${i}`}case"invalid_value":if(1===r.values.length)return`Intrare invalidă: așteptat ${kw(r.values[0])}`;return`Opțiune invalidă: așteptat una dintre ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Prea mare: așteptat ca ${r.origin??"valoarea"} ${n.verb} ${t}${r.maximum.toString()} ${n.unit??"elemente"}`;return`Prea mare: așteptat ca ${r.origin??"valoarea"} să fie ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Prea mic: așteptat ca ${r.origin} ${n.verb} ${t}${r.minimum.toString()} ${n.unit}`;return`Prea mic: așteptat ca ${r.origin} să fie ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Șir invalid: trebuie să \xeenceapă cu "${r.prefix}"`;if("ends_with"===r.format)return`Șir invalid: trebuie să se termine cu "${r.suffix}"`;if("includes"===r.format)return`Șir invalid: trebuie să includă "${r.includes}"`;if("regex"===r.format)return`Șir invalid: trebuie să se potrivească cu modelul ${r.pattern}`;return`Format invalid: ${t[r.format]??r.format}`;case"not_multiple_of":return`Număr invalid: trebuie să fie multiplu de ${r.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${kt(r.keys,", ")}`;case"invalid_key":return`Cheie invalidă \xeen ${r.origin}`;case"invalid_union":default:return"Intrare invalidă";case"invalid_element":return`Valoare invalidă \xeen ${r.origin}`}})}},"ru",0,function(){let e,t,n;return{localeError:(e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}},t={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},n={nan:"NaN",number:"число",array:"массив"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Неверный ввод: ожидалось instanceof ${r.expected}, получено ${i}`;return`Неверный ввод: ожидалось ${e}, получено ${i}`}case"invalid_value":if(1===r.values.length)return`Неверный ввод: ожидалось ${kw(r.values[0])}`;return`Неверный вариант: ожидалось одно из ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n){let e=IN(Number(r.maximum),n.unit.one,n.unit.few,n.unit.many);return`Слишком большое значение: ожидалось, что ${r.origin??"значение"} будет иметь ${t}${r.maximum.toString()} ${e}`}return`Слишком большое значение: ожидалось, что ${r.origin??"значение"} будет ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n){let e=IN(Number(r.minimum),n.unit.one,n.unit.few,n.unit.many);return`Слишком маленькое значение: ожидалось, что ${r.origin} будет иметь ${t}${r.minimum.toString()} ${e}`}return`Слишком маленькое значение: ожидалось, что ${r.origin} будет ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Неверная строка: должна начинаться с "${r.prefix}"`;if("ends_with"===r.format)return`Неверная строка: должна заканчиваться на "${r.suffix}"`;if("includes"===r.format)return`Неверная строка: должна содержать "${r.includes}"`;if("regex"===r.format)return`Неверная строка: должна соответствовать шаблону ${r.pattern}`;return`Неверный ${t[r.format]??r.format}`;case"not_multiple_of":return`Неверное число: должно быть кратным ${r.divisor}`;case"unrecognized_keys":return`Нераспознанн${r.keys.length>1?"ые":"ый"} ключ${r.keys.length>1?"и":""}: ${kt(r.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${r.origin}`;case"invalid_union":default:return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${r.origin}`}})}},"sl",0,function(){let e,t,n;return{localeError:(e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}},t={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},n={nan:"NaN",number:"število",array:"tabela"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Neveljaven vnos: pričakovano instanceof ${r.expected}, prejeto ${i}`;return`Neveljaven vnos: pričakovano ${e}, prejeto ${i}`}case"invalid_value":if(1===r.values.length)return`Neveljaven vnos: pričakovano ${kw(r.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Preveliko: pričakovano, da bo ${r.origin??"vrednost"} imelo ${t}${r.maximum.toString()} ${n.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${r.origin??"vrednost"} ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Premajhno: pričakovano, da bo ${r.origin} imelo ${t}${r.minimum.toString()} ${n.unit}`;return`Premajhno: pričakovano, da bo ${r.origin} ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Neveljaven niz: mora se začeti z "${r.prefix}"`;if("ends_with"===r.format)return`Neveljaven niz: mora se končati z "${r.suffix}"`;if("includes"===r.format)return`Neveljaven niz: mora vsebovati "${r.includes}"`;if("regex"===r.format)return`Neveljaven niz: mora ustrezati vzorcu ${r.pattern}`;return`Neveljaven ${t[r.format]??r.format}`;case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i ključi":" ključ"}: ${kt(r.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${r.origin}`;case"invalid_union":default:return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`}})}},"sv",0,function(){let e,t,n;return{localeError:(e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}},t={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},n={nan:"NaN",number:"antal",array:"lista"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Ogiltig inmatning: f\xf6rv\xe4ntat instanceof ${r.expected}, fick ${i}`;return`Ogiltig inmatning: f\xf6rv\xe4ntat ${e}, fick ${i}`}case"invalid_value":if(1===r.values.length)return`Ogiltig inmatning: f\xf6rv\xe4ntat ${kw(r.values[0])}`;return`Ogiltigt val: f\xf6rv\xe4ntade en av ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`F\xf6r stor(t): f\xf6rv\xe4ntade ${r.origin??"värdet"} att ha ${t}${r.maximum.toString()} ${n.unit??"element"}`;return`F\xf6r stor(t): f\xf6rv\xe4ntat ${r.origin??"värdet"} att ha ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`F\xf6r lite(t): f\xf6rv\xe4ntade ${r.origin??"värdet"} att ha ${t}${r.minimum.toString()} ${n.unit}`;return`F\xf6r lite(t): f\xf6rv\xe4ntade ${r.origin??"värdet"} att ha ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Ogiltig str\xe4ng: m\xe5ste b\xf6rja med "${r.prefix}"`;if("ends_with"===r.format)return`Ogiltig str\xe4ng: m\xe5ste sluta med "${r.suffix}"`;if("includes"===r.format)return`Ogiltig str\xe4ng: m\xe5ste inneh\xe5lla "${r.includes}"`;if("regex"===r.format)return`Ogiltig str\xe4ng: m\xe5ste matcha m\xf6nstret "${r.pattern}"`;return`Ogiltig(t) ${t[r.format]??r.format}`;case"not_multiple_of":return`Ogiltigt tal: m\xe5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${kt(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"värdet"}`;case"invalid_union":default:return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xe4rde i ${r.origin??"värdet"}`}})}},"ta",0,function(){let e,t,n;return{localeError:(e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}},t={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},n={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${r.expected}, பெறப்பட்டது ${i}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${e}, பெறப்பட்டது ${i}`}case"invalid_value":if(1===r.values.length)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${kw(r.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${kt(r.values,"|")} இல் ஒன்று`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${r.origin??"மதிப்பு"} ${t}${r.maximum.toString()} ${n.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${r.origin??"மதிப்பு"} ${t}${r.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${r.origin} ${t}${r.minimum.toString()} ${n.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${r.origin} ${t}${r.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":if("starts_with"===r.format)return`தவறான சரம்: "${r.prefix}" இல் தொடங்க வேண்டும்`;if("ends_with"===r.format)return`தவறான சரம்: "${r.suffix}" இல் முடிவடைய வேண்டும்`;if("includes"===r.format)return`தவறான சரம்: "${r.includes}" ஐ உள்ளடக்க வேண்டும்`;if("regex"===r.format)return`தவறான சரம்: ${r.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${t[r.format]??r.format}`;case"not_multiple_of":return`தவறான எண்: ${r.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${r.keys.length>1?"கள்":""}: ${kt(r.keys,", ")}`;case"invalid_key":return`${r.origin} இல் தவறான விசை`;case"invalid_union":default:return"தவறான உள்ளீடு";case"invalid_element":return`${r.origin} இல் தவறான மதிப்பு`}})}},"th",0,function(){let e,t,n;return{localeError:(e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}},t={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},n={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${r.expected} แต่ได้รับ ${i}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${e} แต่ได้รับ ${i}`}case"invalid_value":if(1===r.values.length)return`ค่าไม่ถูกต้อง: ควรเป็น ${kw(r.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"ไม่เกิน":"น้อยกว่า",n=e[r.origin]??null;if(n)return`เกินกำหนด: ${r.origin??"ค่า"} ควรมี${t} ${r.maximum.toString()} ${n.unit??"รายการ"}`;return`เกินกำหนด: ${r.origin??"ค่า"} ควรมี${t} ${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?"อย่างน้อย":"มากกว่า",n=e[r.origin]??null;if(n)return`น้อยกว่ากำหนด: ${r.origin} ควรมี${t} ${r.minimum.toString()} ${n.unit}`;return`น้อยกว่ากำหนด: ${r.origin} ควรมี${t} ${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${r.prefix}"`;if("ends_with"===r.format)return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${r.suffix}"`;if("includes"===r.format)return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${r.includes}" อยู่ในข้อความ`;if("regex"===r.format)return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${r.pattern}`;return`รูปแบบไม่ถูกต้อง: ${t[r.format]??r.format}`;case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${r.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${kt(r.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${r.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${r.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}})}},"tr",0,function(){let e,t,n;return{localeError:(e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}},t={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},n={nan:"NaN"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Ge\xe7ersiz değer: beklenen instanceof ${r.expected}, alınan ${i}`;return`Ge\xe7ersiz değer: beklenen ${e}, alınan ${i}`}case"invalid_value":if(1===r.values.length)return`Ge\xe7ersiz değer: beklenen ${kw(r.values[0])}`;return`Ge\xe7ersiz se\xe7enek: aşağıdakilerden biri olmalı: ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`\xc7ok b\xfcy\xfck: beklenen ${r.origin??"değer"} ${t}${r.maximum.toString()} ${n.unit??"öğe"}`;return`\xc7ok b\xfcy\xfck: beklenen ${r.origin??"değer"} ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`\xc7ok k\xfc\xe7\xfck: beklenen ${r.origin} ${t}${r.minimum.toString()} ${n.unit}`;return`\xc7ok k\xfc\xe7\xfck: beklenen ${r.origin} ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Ge\xe7ersiz metin: "${r.prefix}" ile başlamalı`;if("ends_with"===r.format)return`Ge\xe7ersiz metin: "${r.suffix}" ile bitmeli`;if("includes"===r.format)return`Ge\xe7ersiz metin: "${r.includes}" i\xe7ermeli`;if("regex"===r.format)return`Ge\xe7ersiz metin: ${r.pattern} desenine uymalı`;return`Ge\xe7ersiz ${t[r.format]??r.format}`;case"not_multiple_of":return`Ge\xe7ersiz sayı: ${r.divisor} ile tam b\xf6l\xfcnebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${r.keys.length>1?"lar":""}: ${kt(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xe7inde ge\xe7ersiz anahtar`;case"invalid_union":default:return"Geçersiz değer";case"invalid_element":return`${r.origin} i\xe7inde ge\xe7ersiz değer`}})}},"ua",0,function(){return I_()},"uk",0,I_,"ur",0,function(){let e,t,n;return{localeError:(e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}},t={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},n={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`غلط ان پٹ: instanceof ${r.expected} متوقع تھا، ${i} موصول ہوا`;return`غلط ان پٹ: ${e} متوقع تھا، ${i} موصول ہوا`}case"invalid_value":if(1===r.values.length)return`غلط ان پٹ: ${kw(r.values[0])} متوقع تھا`;return`غلط آپشن: ${kt(r.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`بہت بڑا: ${r.origin??"ویلیو"} کے ${t}${r.maximum.toString()} ${n.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${r.origin??"ویلیو"} کا ${t}${r.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`بہت چھوٹا: ${r.origin} کے ${t}${r.minimum.toString()} ${n.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${r.origin} کا ${t}${r.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":if("starts_with"===r.format)return`غلط سٹرنگ: "${r.prefix}" سے شروع ہونا چاہیے`;if("ends_with"===r.format)return`غلط سٹرنگ: "${r.suffix}" پر ختم ہونا چاہیے`;if("includes"===r.format)return`غلط سٹرنگ: "${r.includes}" شامل ہونا چاہیے`;if("regex"===r.format)return`غلط سٹرنگ: پیٹرن ${r.pattern} سے میچ ہونا چاہیے`;return`غلط ${t[r.format]??r.format}`;case"not_multiple_of":return`غلط نمبر: ${r.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${r.keys.length>1?"ز":""}: ${kt(r.keys,"، ")}`;case"invalid_key":return`${r.origin} میں غلط کی`;case"invalid_union":default:return"غلط ان پٹ";case"invalid_element":return`${r.origin} میں غلط ویلیو`}})}},"uz",0,function(){let e,t,n;return{localeError:(e={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"},map:{unit:"yozuv",verb:"bo‘lishi kerak"}},t={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},n={nan:"NaN",number:"raqam",array:"massiv"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${r.expected}, qabul qilingan ${i}`;return`Noto‘g‘ri kirish: kutilgan ${e}, qabul qilingan ${i}`}case"invalid_value":if(1===r.values.length)return`Noto‘g‘ri kirish: kutilgan ${kw(r.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Juda katta: kutilgan ${r.origin??"qiymat"} ${t}${r.maximum.toString()} ${n.unit} ${n.verb}`;return`Juda katta: kutilgan ${r.origin??"qiymat"} ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Juda kichik: kutilgan ${r.origin} ${t}${r.minimum.toString()} ${n.unit} ${n.verb}`;return`Juda kichik: kutilgan ${r.origin} ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Noto‘g‘ri satr: "${r.prefix}" bilan boshlanishi kerak`;if("ends_with"===r.format)return`Noto‘g‘ri satr: "${r.suffix}" bilan tugashi kerak`;if("includes"===r.format)return`Noto‘g‘ri satr: "${r.includes}" ni o‘z ichiga olishi kerak`;if("regex"===r.format)return`Noto‘g‘ri satr: ${r.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${t[r.format]??r.format}`;case"not_multiple_of":return`Noto‘g‘ri raqam: ${r.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${r.keys.length>1?"lar":""}: ${kt(r.keys,", ")}`;case"invalid_key":return`${r.origin} dagi kalit noto‘g‘ri`;case"invalid_union":default:return"Noto‘g‘ri kirish";case"invalid_element":return`${r.origin} da noto‘g‘ri qiymat`}})}},"vi",0,function(){let e,t,n;return{localeError:(e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}},t={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},n={nan:"NaN",number:"số",array:"mảng"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`Đầu v\xe0o kh\xf4ng hợp lệ: mong đợi instanceof ${r.expected}, nhận được ${i}`;return`Đầu v\xe0o kh\xf4ng hợp lệ: mong đợi ${e}, nhận được ${i}`}case"invalid_value":if(1===r.values.length)return`Đầu v\xe0o kh\xf4ng hợp lệ: mong đợi ${kw(r.values[0])}`;return`T\xf9y chọn kh\xf4ng hợp lệ: mong đợi một trong c\xe1c gi\xe1 trị ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`Qu\xe1 lớn: mong đợi ${r.origin??"giá trị"} ${n.verb} ${t}${r.maximum.toString()} ${n.unit??"phần tử"}`;return`Qu\xe1 lớn: mong đợi ${r.origin??"giá trị"} ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`Qu\xe1 nhỏ: mong đợi ${r.origin} ${n.verb} ${t}${r.minimum.toString()} ${n.unit}`;return`Qu\xe1 nhỏ: mong đợi ${r.origin} ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`Chuỗi kh\xf4ng hợp lệ: phải bắt đầu bằng "${r.prefix}"`;if("ends_with"===r.format)return`Chuỗi kh\xf4ng hợp lệ: phải kết th\xfac bằng "${r.suffix}"`;if("includes"===r.format)return`Chuỗi kh\xf4ng hợp lệ: phải bao gồm "${r.includes}"`;if("regex"===r.format)return`Chuỗi kh\xf4ng hợp lệ: phải khớp với mẫu ${r.pattern}`;return`${t[r.format]??r.format} kh\xf4ng hợp lệ`;case"not_multiple_of":return`Số kh\xf4ng hợp lệ: phải l\xe0 bội số của ${r.divisor}`;case"unrecognized_keys":return`Kh\xf3a kh\xf4ng được nhận dạng: ${kt(r.keys,", ")}`;case"invalid_key":return`Kh\xf3a kh\xf4ng hợp lệ trong ${r.origin}`;case"invalid_union":default:return"Đầu vào không hợp lệ";case"invalid_element":return`Gi\xe1 trị kh\xf4ng hợp lệ trong ${r.origin}`}})}},"yo",0,function(){let e,t,n;return{localeError:(e={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}},t={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},n={nan:"NaN",number:"nọ́mbà",array:"akopọ"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`\xccb\xe1wọl\xe9 aṣ\xecṣe: a n\xed l\xe1ti fi instanceof ${r.expected}, \xe0mọ̀ a r\xed ${i}`;return`\xccb\xe1wọl\xe9 aṣ\xecṣe: a n\xed l\xe1ti fi ${e}, \xe0mọ̀ a r\xed ${i}`}case"invalid_value":if(1===r.values.length)return`\xccb\xe1wọl\xe9 aṣ\xecṣe: a n\xed l\xe1ti fi ${kw(r.values[0])}`;return`\xc0ṣ\xe0y\xe0n aṣ\xecṣe: yan ọ̀kan l\xe1ra ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`T\xf3 pọ̀ j\xf9: a n\xed l\xe1ti jẹ́ p\xe9 ${r.origin??"iye"} ${n.verb} ${t}${r.maximum} ${n.unit}`;return`T\xf3 pọ̀ j\xf9: a n\xed l\xe1ti jẹ́ ${t}${r.maximum}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`K\xe9r\xe9 ju: a n\xed l\xe1ti jẹ́ p\xe9 ${r.origin} ${n.verb} ${t}${r.minimum} ${n.unit}`;return`K\xe9r\xe9 ju: a n\xed l\xe1ti jẹ́ ${t}${r.minimum}`}case"invalid_format":if("starts_with"===r.format)return`Ọ̀rọ̀ aṣ\xecṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀l\xfa "${r.prefix}"`;if("ends_with"===r.format)return`Ọ̀rọ̀ aṣ\xecṣe: gbọ́dọ̀ par\xed pẹ̀l\xfa "${r.suffix}"`;if("includes"===r.format)return`Ọ̀rọ̀ aṣ\xecṣe: gbọ́dọ̀ n\xed "${r.includes}"`;if("regex"===r.format)return`Ọ̀rọ̀ aṣ\xecṣe: gbọ́dọ̀ b\xe1 \xe0pẹẹrẹ mu ${r.pattern}`;return`Aṣ\xecṣe: ${t[r.format]??r.format}`;case"not_multiple_of":return`Nọ́mb\xe0 aṣ\xecṣe: gbọ́dọ̀ jẹ́ \xe8y\xe0 p\xedp\xedn ti ${r.divisor}`;case"unrecognized_keys":return`Bọt\xecn\xec \xe0\xecmọ̀: ${kt(r.keys,", ")}`;case"invalid_key":return`Bọt\xecn\xec aṣ\xecṣe n\xedn\xfa ${r.origin}`;case"invalid_union":default:return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣ\xecṣe n\xedn\xfa ${r.origin}`}})}},"zhCN",0,function(){let e,t,n;return{localeError:(e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}},t={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},n={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`无效输入:期望 instanceof ${r.expected},实际接收 ${i}`;return`无效输入:期望 ${e},实际接收 ${i}`}case"invalid_value":if(1===r.values.length)return`无效输入:期望 ${kw(r.values[0])}`;return`无效选项:期望以下之一 ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`数值过大:期望 ${r.origin??"值"} ${t}${r.maximum.toString()} ${n.unit??"个元素"}`;return`数值过大:期望 ${r.origin??"值"} ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`数值过小:期望 ${r.origin} ${t}${r.minimum.toString()} ${n.unit}`;return`数值过小:期望 ${r.origin} ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`无效字符串:必须以 "${r.prefix}" 开头`;if("ends_with"===r.format)return`无效字符串:必须以 "${r.suffix}" 结尾`;if("includes"===r.format)return`无效字符串:必须包含 "${r.includes}"`;if("regex"===r.format)return`无效字符串:必须满足正则表达式 ${r.pattern}`;return`无效${t[r.format]??r.format}`;case"not_multiple_of":return`无效数字:必须是 ${r.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${kt(r.keys,", ")}`;case"invalid_key":return`${r.origin} 中的键(key)无效`;case"invalid_union":default:return"无效输入";case"invalid_element":return`${r.origin} 中包含无效值(value)`}})}},"zhTW",0,function(){let e,t,n;return{localeError:(e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}},t={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},n={nan:"NaN"},r=>{switch(r.code){case"invalid_type":{let e=n[r.expected]??r.expected,t=kz(r.input),i=n[t]??t;if(/^[A-Z]/.test(r.expected))return`無效的輸入值:預期為 instanceof ${r.expected},但收到 ${i}`;return`無效的輸入值:預期為 ${e},但收到 ${i}`}case"invalid_value":if(1===r.values.length)return`無效的輸入值:預期為 ${kw(r.values[0])}`;return`無效的選項:預期為以下其中之一 ${kt(r.values,"|")}`;case"too_big":{let t=r.inclusive?"<=":"<",n=e[r.origin]??null;if(n)return`數值過大:預期 ${r.origin??"值"} 應為 ${t}${r.maximum.toString()} ${n.unit??"個元素"}`;return`數值過大:預期 ${r.origin??"值"} 應為 ${t}${r.maximum.toString()}`}case"too_small":{let t=r.inclusive?">=":">",n=e[r.origin]??null;if(n)return`數值過小:預期 ${r.origin} 應為 ${t}${r.minimum.toString()} ${n.unit}`;return`數值過小:預期 ${r.origin} 應為 ${t}${r.minimum.toString()}`}case"invalid_format":if("starts_with"===r.format)return`無效的字串:必須以 "${r.prefix}" 開頭`;if("ends_with"===r.format)return`無效的字串:必須以 "${r.suffix}" 結尾`;if("includes"===r.format)return`無效的字串:必須包含 "${r.includes}"`;if("regex"===r.format)return`無效的字串:必須符合格式 ${r.pattern}`;return`無效的 ${t[r.format]??r.format}`;case"not_multiple_of":return`無效的數字:必須為 ${r.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${r.keys.length>1?"們":""}:${kt(r.keys,"、")}`;case"invalid_key":return`${r.origin} 中有無效的鍵值`;case"invalid_union":default:return"無效的輸入值";case"invalid_element":return`${r.origin} 中有無效的值`}})}}],16917);var IS=e.i(16917);function I$(e,t){return new e({type:"string",...kj(t)})}function II(e,t){return new e({type:"string",coerce:!0,...kj(t)})}function IE(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...kj(t)})}function IC(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...kj(t)})}function IA(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...kj(t)})}function IT(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...kj(t)})}function IP(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...kj(t)})}function Iz(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...kj(t)})}function IO(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...kj(t)})}function IM(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...kj(t)})}function IR(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...kj(t)})}function ID(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...kj(t)})}function IL(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...kj(t)})}function IU(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...kj(t)})}function IZ(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...kj(t)})}function IF(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...kj(t)})}function IB(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...kj(t)})}function IV(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...kj(t)})}function Iq(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...kj(t)})}function IW(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...kj(t)})}function IH(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...kj(t)})}function IG(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...kj(t)})}function IK(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...kj(t)})}function IJ(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...kj(t)})}function IY(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...kj(t)})}e.i(4277),e.i(73885);let IX={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function IQ(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...kj(t)})}function I0(e,t){return new e({type:"string",format:"date",check:"string_format",...kj(t)})}function I1(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...kj(t)})}function I2(e,t){return new e({type:"string",format:"duration",check:"string_format",...kj(t)})}function I4(e,t){return new e({type:"number",checks:[],...kj(t)})}function I5(e,t){return new e({type:"number",coerce:!0,checks:[],...kj(t)})}function I6(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...kj(t)})}function I3(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...kj(t)})}function I9(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...kj(t)})}function I8(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...kj(t)})}function I7(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...kj(t)})}function Ee(e,t){return new e({type:"boolean",...kj(t)})}function Et(e,t){return new e({type:"boolean",coerce:!0,...kj(t)})}function En(e,t){return new e({type:"bigint",...kj(t)})}function Er(e,t){return new e({type:"bigint",coerce:!0,...kj(t)})}function Ei(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...kj(t)})}function Ea(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...kj(t)})}function Es(e,t){return new e({type:"symbol",...kj(t)})}function Eo(e,t){return new e({type:"undefined",...kj(t)})}function El(e,t){return new e({type:"null",...kj(t)})}function Ed(e){return new e({type:"any"})}function Ec(e){return new e({type:"unknown"})}function Eu(e,t){return new e({type:"never",...kj(t)})}function Em(e,t){return new e({type:"void",...kj(t)})}function Ep(e,t){return new e({type:"date",...kj(t)})}function Ef(e,t){return new e({type:"date",coerce:!0,...kj(t)})}function Eh(e,t){return new e({type:"nan",...kj(t)})}function Eg(e,t){return new Sw({check:"less_than",...kj(t),value:e,inclusive:!1})}function Ex(e,t){return new Sw({check:"less_than",...kj(t),value:e,inclusive:!0})}function Ev(e,t){return new SN({check:"greater_than",...kj(t),value:e,inclusive:!1})}function Ey(e,t){return new SN({check:"greater_than",...kj(t),value:e,inclusive:!0})}function Eb(e){return Ev(0,e)}function Ek(e){return Eg(0,e)}function Ej(e){return Ex(0,e)}function Ew(e){return Ey(0,e)}function EN(e,t){return new S_({check:"multiple_of",...kj(t),value:e})}function E_(e,t){return new SI({check:"max_size",...kj(t),maximum:e})}function ES(e,t){return new SE({check:"min_size",...kj(t),minimum:e})}function E$(e,t){return new SC({check:"size_equals",...kj(t),size:e})}function EI(e,t){return new SA({check:"max_length",...kj(t),maximum:e})}function EE(e,t){return new ST({check:"min_length",...kj(t),minimum:e})}function EC(e,t){return new SP({check:"length_equals",...kj(t),length:e})}function EA(e,t){return new SO({check:"string_format",format:"regex",...kj(t),pattern:e})}function ET(e){return new SM({check:"string_format",format:"lowercase",...kj(e)})}function EP(e){return new SR({check:"string_format",format:"uppercase",...kj(e)})}function Ez(e,t){return new SD({check:"string_format",format:"includes",...kj(t),includes:e})}function EO(e,t){return new SL({check:"string_format",format:"starts_with",...kj(t),prefix:e})}function EM(e,t){return new SU({check:"string_format",format:"ends_with",...kj(t),suffix:e})}function ER(e,t,n){return new SF({check:"property",property:e,schema:t,...kj(n)})}function ED(e,t){return new SB({check:"mime_type",mime:e,...kj(t)})}function EL(e){return new SV({check:"overwrite",tx:e})}function EU(e){return EL(t=>t.normalize(e))}function EZ(){return EL(e=>e.trim())}function EF(){return EL(e=>e.toLowerCase())}function EB(){return EL(e=>e.toUpperCase())}function EV(){return EL(e=>km(e))}function Eq(e,t,n){return new e({type:"array",element:t,...kj(n)})}function EW(e,t,n){return new e({type:"union",options:t,...kj(n)})}function EH(e,t,n){return new e({type:"union",options:t,inclusive:!1,...kj(n)})}function EG(e,t,n,r){return new e({type:"union",options:n,discriminator:t,...kj(r)})}function EK(e,t,n){return new e({type:"intersection",left:t,right:n})}function EJ(e,t,n,r){let i=n instanceof SH,a=i?r:n;return new e({type:"tuple",items:t,rest:i?n:null,...kj(a)})}function EY(e,t,n,r){return new e({type:"record",keyType:t,valueType:n,...kj(r)})}function EX(e,t,n,r){return new e({type:"map",keyType:t,valueType:n,...kj(r)})}function EQ(e,t,n){return new e({type:"set",valueType:t,...kj(n)})}function E0(e,t,n){return new e({type:"enum",entries:Array.isArray(t)?Object.fromEntries(t.map(e=>[e,e])):t,...kj(n)})}function E1(e,t,n){return new e({type:"enum",entries:t,...kj(n)})}function E2(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...kj(n)})}function E4(e,t){return new e({type:"file",...kj(t)})}function E5(e,t){return new e({type:"transform",transform:t})}function E6(e,t){return new e({type:"optional",innerType:t})}function E3(e,t){return new e({type:"nullable",innerType:t})}function E9(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return"function"==typeof n?n():kx(n)}})}function E8(e,t,n){return new e({type:"nonoptional",innerType:t,...kj(n)})}function E7(e,t){return new e({type:"success",innerType:t})}function Ce(e,t,n){return new e({type:"catch",innerType:t,catchValue:"function"==typeof n?n:()=>n})}function Ct(e,t,n){return new e({type:"pipe",in:t,out:n})}function Cn(e,t){return new e({type:"readonly",innerType:t})}function Cr(e,t,n){return new e({type:"template_literal",parts:t,...kj(n)})}function Ci(e,t){return new e({type:"lazy",getter:t})}function Ca(e,t){return new e({type:"promise",innerType:t})}function Cs(e,t,n){let r=kj(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function Co(e,t,n){return new e({type:"custom",check:"custom",fn:t,...kj(n)})}function Cl(e,t){let n=Cd(t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(kO(e,t.value,n._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=t.value),e.inst??(e.inst=n),e.continue??(e.continue=!n._zod.def.abort),t.issues.push(kO(e)))},e(t.value,t)),t);return n}function Cd(e,t){let n=new Sk({check:"custom",...kj(t)});return n._zod.check=e,n}function Cc(e){let t=new Sk({check:"describe"});return t._zod.onattach=[t=>{let n=j_.get(t)??{};j_.add(t,{...n,description:e})}],t._zod.check=()=>{},t}function Cu(e){let t=new Sk({check:"meta"});return t._zod.onattach=[t=>{let n=j_.get(t)??{};j_.add(t,{...n,...e})}],t._zod.check=()=>{},t}function Cm(e,t){let n=kj(t),r=n.truthy??["true","1","yes","on","y","enabled"],i=n.falsy??["false","0","no","off","n","disabled"];"sensitive"!==n.case&&(r=r.map(e=>"string"==typeof e?e.toLowerCase():e),i=i.map(e=>"string"==typeof e?e.toLowerCase():e));let a=new Set(r),s=new Set(i),o=e.Codec??Ii,l=e.Boolean??$g,d=new o({type:"pipe",in:new(e.String??SG)({type:"string",error:n.error}),out:new l({type:"boolean",error:n.error}),transform:(e,t)=>{let r=e;return"sensitive"!==n.case&&(r=r.toLowerCase()),!!a.has(r)||!s.has(r)&&(t.issues.push({code:"invalid_value",expected:"stringbool",values:[...a,...s],input:t.value,inst:d,continue:!1}),{})},reverseTransform:(e,t)=>!0===e?r[0]||"true":i[0]||"false",error:n.error});return d}function Cp(e,t,n,r={}){let i=kj(r),a={...kj(r),check:"string_format",type:"string",format:t,fn:"function"==typeof n?n:e=>n.test(e),...i};return n instanceof RegExp&&(a.pattern=n),new e(a)}e.s(["TimePrecision",0,IX,"_any",0,Ed,"_array",0,Eq,"_base64",0,IG,"_base64url",0,IK,"_bigint",0,En,"_boolean",0,Ee,"_catch",0,Ce,"_check",0,Cd,"_cidrv4",0,IW,"_cidrv6",0,IH,"_coercedBigint",0,Er,"_coercedBoolean",0,Et,"_coercedDate",0,Ef,"_coercedNumber",0,I5,"_coercedString",0,II,"_cuid",0,ID,"_cuid2",0,IL,"_custom",0,Cs,"_date",0,Ep,"_default",0,E9,"_discriminatedUnion",0,EG,"_e164",0,IJ,"_email",0,IE,"_emoji",0,IM,"_endsWith",0,EM,"_enum",0,E0,"_file",0,E4,"_float32",0,I3,"_float64",0,I9,"_gt",0,Ev,"_gte",0,Ey,"_guid",0,IC,"_includes",0,Ez,"_int",0,I6,"_int32",0,I8,"_int64",0,Ei,"_intersection",0,EK,"_ipv4",0,IB,"_ipv6",0,IV,"_isoDate",0,I0,"_isoDateTime",0,IQ,"_isoDuration",0,I2,"_isoTime",0,I1,"_jwt",0,IY,"_ksuid",0,IF,"_lazy",0,Ci,"_length",0,EC,"_literal",0,E2,"_lowercase",0,ET,"_lt",0,Eg,"_lte",0,Ex,"_mac",0,Iq,"_map",0,EX,"_max",0,Ex,"_maxLength",0,EI,"_maxSize",0,E_,"_mime",0,ED,"_min",0,Ey,"_minLength",0,EE,"_minSize",0,ES,"_multipleOf",0,EN,"_nan",0,Eh,"_nanoid",0,IR,"_nativeEnum",0,E1,"_negative",0,Ek,"_never",0,Eu,"_nonnegative",0,Ew,"_nonoptional",0,E8,"_nonpositive",0,Ej,"_normalize",0,EU,"_null",0,El,"_nullable",0,E3,"_number",0,I4,"_optional",0,E6,"_overwrite",0,EL,"_pipe",0,Ct,"_positive",0,Eb,"_promise",0,Ca,"_property",0,ER,"_readonly",0,Cn,"_record",0,EY,"_refine",0,Co,"_regex",0,EA,"_set",0,EQ,"_size",0,E$,"_slugify",0,EV,"_startsWith",0,EO,"_string",0,I$,"_stringFormat",0,Cp,"_stringbool",0,Cm,"_success",0,E7,"_superRefine",0,Cl,"_symbol",0,Es,"_templateLiteral",0,Cr,"_toLowerCase",0,EF,"_toUpperCase",0,EB,"_transform",0,E5,"_trim",0,EZ,"_tuple",0,EJ,"_uint32",0,I7,"_uint64",0,Ea,"_ulid",0,IU,"_undefined",0,Eo,"_union",0,EW,"_unknown",0,Ec,"_uppercase",0,EP,"_url",0,IO,"_uuid",0,IA,"_uuidv4",0,IT,"_uuidv6",0,IP,"_uuidv7",0,Iz,"_void",0,Em,"_xid",0,IZ,"_xor",0,EH,"describe",0,Cc,"meta",0,Cu],1528),e.i(1528),e.i(28831),e.s([],66074);var Cf=e.i(66074);e.s(["$ZodAny",0,$j,"$ZodArray",0,$I,"$ZodAsyncError",0,b3,"$ZodBase64",0,$o,"$ZodBase64URL",0,$d,"$ZodBigInt",0,$x,"$ZodBigIntFormat",0,$v,"$ZodBoolean",0,$g,"$ZodCIDRv4",0,$i,"$ZodCIDRv6",0,$a,"$ZodCUID",0,S2,"$ZodCUID2",0,S4,"$ZodCatch",0,Ie,"$ZodCheck",0,Sk,"$ZodCheckBigIntFormat",0,S$,"$ZodCheckEndsWith",0,SU,"$ZodCheckGreaterThan",0,SN,"$ZodCheckIncludes",0,SD,"$ZodCheckLengthEquals",0,SP,"$ZodCheckLessThan",0,Sw,"$ZodCheckLowerCase",0,SM,"$ZodCheckMaxLength",0,SA,"$ZodCheckMaxSize",0,SI,"$ZodCheckMimeType",0,SB,"$ZodCheckMinLength",0,ST,"$ZodCheckMinSize",0,SE,"$ZodCheckMultipleOf",0,S_,"$ZodCheckNumberFormat",0,SS,"$ZodCheckOverwrite",0,SV,"$ZodCheckProperty",0,SF,"$ZodCheckRegex",0,SO,"$ZodCheckSizeEquals",0,SC,"$ZodCheckStartsWith",0,SL,"$ZodCheckStringFormat",0,Sz,"$ZodCheckUpperCase",0,SR,"$ZodCodec",0,Ii,"$ZodCustom",0,If,"$ZodCustomStringFormat",0,$p,"$ZodDate",0,$S,"$ZodDefault",0,$5,"$ZodDiscriminatedUnion",0,$D,"$ZodE164",0,$c,"$ZodEmail",0,SX,"$ZodEmoji",0,S0,"$ZodEncodeError",0,b9,"$ZodEnum",0,$J,"$ZodError",0,kL,"$ZodExactOptional",0,$2,"$ZodFile",0,$X,"$ZodFunction",0,Iu,"$ZodGUID",0,SJ,"$ZodIPv4",0,$t,"$ZodIPv6",0,$n,"$ZodISODate",0,S8,"$ZodISODateTime",0,S9,"$ZodISODuration",0,$e,"$ZodISOTime",0,S7,"$ZodIntersection",0,$L,"$ZodJWT",0,$m,"$ZodKSUID",0,S3,"$ZodLazy",0,Ip,"$ZodLiteral",0,$Y,"$ZodMAC",0,$r,"$ZodMap",0,$W,"$ZodNaN",0,It,"$ZodNanoID",0,S1,"$ZodNever",0,$N,"$ZodNonOptional",0,$9,"$ZodNull",0,$k,"$ZodNullable",0,$4,"$ZodNumber",0,$f,"$ZodNumberFormat",0,$h,"$ZodObject",0,$T,"$ZodObjectJIT",0,$P,"$ZodOptional",0,$1,"$ZodPipe",0,In,"$ZodPrefault",0,$3,"$ZodPreprocess",0,Io,"$ZodPromise",0,Im,"$ZodReadonly",0,Il,"$ZodRealError",0,kU,"$ZodRecord",0,$q,"$ZodRegistry",0,jw,"$ZodSet",0,$G,"$ZodString",0,SG,"$ZodStringFormat",0,SK,"$ZodSuccess",0,$7,"$ZodSymbol",0,$y,"$ZodTemplateLiteral",0,Ic,"$ZodTransform",0,$Q,"$ZodTuple",0,$Z,"$ZodType",0,SH,"$ZodULID",0,S5,"$ZodURL",0,SQ,"$ZodUUID",0,SY,"$ZodUndefined",0,$b,"$ZodUnion",0,$O,"$ZodUnknown",0,$w,"$ZodVoid",0,$_,"$ZodXID",0,S6,"$ZodXor",0,$R,"$brand",0,b6,"$constructor",0,b5,"$input",0,jj,"$output",0,jk,"Doc",0,Sq,"JSONSchema",0,Cf,"JSONSchemaGenerator",0,class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??"draft-2020-12";"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),this.ctx=jS({processors:wl,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return j$(e,this.ctx,t)}emit(e,t){t&&(t.cycles&&(this.ctx.cycles=t.cycles),t.reused&&(this.ctx.reused=t.reused),t.external&&(this.ctx.external=t.external)),jI(this.ctx,e);let{"~standard":n,...r}=jE(this.ctx,e);return r}},"NEVER",0,b4,"TimePrecision",0,IX,"_any",0,Ed,"_array",0,Eq,"_base64",0,IG,"_base64url",0,IK,"_bigint",0,En,"_boolean",0,Ee,"_catch",0,Ce,"_check",0,Cd,"_cidrv4",0,IW,"_cidrv6",0,IH,"_coercedBigint",0,Er,"_coercedBoolean",0,Et,"_coercedDate",0,Ef,"_coercedNumber",0,I5,"_coercedString",0,II,"_cuid",0,ID,"_cuid2",0,IL,"_custom",0,Cs,"_date",0,Ep,"_decode",0,k2,"_decodeAsync",0,k3,"_default",0,E9,"_discriminatedUnion",0,EG,"_e164",0,IJ,"_email",0,IE,"_emoji",0,IM,"_encode",0,k0,"_encodeAsync",0,k5,"_endsWith",0,EM,"_enum",0,E0,"_file",0,E4,"_float32",0,I3,"_float64",0,I9,"_gt",0,Ev,"_gte",0,Ey,"_guid",0,IC,"_includes",0,Ez,"_int",0,I6,"_int32",0,I8,"_int64",0,Ei,"_intersection",0,EK,"_ipv4",0,IB,"_ipv6",0,IV,"_isoDate",0,I0,"_isoDateTime",0,IQ,"_isoDuration",0,I2,"_isoTime",0,I1,"_jwt",0,IY,"_ksuid",0,IF,"_lazy",0,Ci,"_length",0,EC,"_literal",0,E2,"_lowercase",0,ET,"_lt",0,Eg,"_lte",0,Ex,"_mac",0,Iq,"_map",0,EX,"_max",0,Ex,"_maxLength",0,EI,"_maxSize",0,E_,"_mime",0,ED,"_min",0,Ey,"_minLength",0,EE,"_minSize",0,ES,"_multipleOf",0,EN,"_nan",0,Eh,"_nanoid",0,IR,"_nativeEnum",0,E1,"_negative",0,Ek,"_never",0,Eu,"_nonnegative",0,Ew,"_nonoptional",0,E8,"_nonpositive",0,Ej,"_normalize",0,EU,"_null",0,El,"_nullable",0,E3,"_number",0,I4,"_optional",0,E6,"_overwrite",0,EL,"_parse",0,kW,"_parseAsync",0,kG,"_pipe",0,Ct,"_positive",0,Eb,"_promise",0,Ca,"_property",0,ER,"_readonly",0,Cn,"_record",0,EY,"_refine",0,Co,"_regex",0,EA,"_safeDecode",0,je,"_safeDecodeAsync",0,ji,"_safeEncode",0,k8,"_safeEncodeAsync",0,jn,"_safeParse",0,kJ,"_safeParseAsync",0,kX,"_set",0,EQ,"_size",0,E$,"_slugify",0,EV,"_startsWith",0,EO,"_string",0,I$,"_stringFormat",0,Cp,"_stringbool",0,Cm,"_success",0,E7,"_superRefine",0,Cl,"_symbol",0,Es,"_templateLiteral",0,Cr,"_toLowerCase",0,EF,"_toUpperCase",0,EB,"_transform",0,E5,"_trim",0,EZ,"_tuple",0,EJ,"_uint32",0,I7,"_uint64",0,Ea,"_ulid",0,IU,"_undefined",0,Eo,"_union",0,EW,"_unknown",0,Ec,"_uppercase",0,EP,"_url",0,IO,"_uuid",0,IA,"_uuidv4",0,IT,"_uuidv6",0,IP,"_uuidv7",0,Iz,"_void",0,Em,"_xid",0,IZ,"_xor",0,EH,"clone",0,kk,"config",0,b7,"createStandardJSONSchemaMethod",0,jA,"createToJSONSchemaMethod",0,jC,"decode",0,k4,"decodeAsync",0,k9,"describe",0,Cc,"encode",0,k1,"encodeAsync",0,k6,"extractDefs",0,jI,"finalize",0,jE,"flattenError",0,kZ,"formatError",0,kF,"globalConfig",0,b8,"globalRegistry",0,j_,"initializeContext",0,jS,"isValidBase64",0,$s,"isValidBase64URL",0,$l,"isValidJWT",0,$u,"locales",0,IS,"meta",0,Cu,"parse",0,kH,"parseAsync",0,kK,"prettifyError",0,kq,"process",0,j$,"regexes",0,Ix,"registry",0,jN,"safeDecode",0,jt,"safeDecodeAsync",0,ja,"safeEncode",0,k7,"safeEncodeAsync",0,jr,"safeParse",0,kY,"safeParseAsync",0,kQ,"toDotPath",0,kV,"toJSONSchema",0,wd,"treeifyError",0,kB,"util",0,Ig,"version",0,SW],62429);var Ch=e.i(62429);e.s(["ZodAny",()=>AL,"ZodArray",()=>AK,"ZodBase64",()=>Aa,"ZodBase64URL",()=>Ao,"ZodBigInt",()=>AI,"ZodBigIntFormat",()=>AC,"ZodBoolean",()=>AS,"ZodCIDRv4",()=>At,"ZodCIDRv6",()=>Ar,"ZodCUID",()=>CK,"ZodCUID2",()=>CY,"ZodCatch",()=>Tz,"ZodCodec",()=>TU,"ZodCustom",()=>T0,"ZodCustomStringFormat",()=>Ap,"ZodDate",()=>AH,"ZodDefault",()=>TS,"ZodDiscriminatedUnion",()=>A3,"ZodE164",()=>Ad,"ZodEmail",()=>CP,"ZodEmoji",()=>Cq,"ZodEnum",()=>Tc,"ZodExactOptional",()=>Tk,"ZodFile",()=>Th,"ZodFunction",()=>TX,"ZodGUID",()=>CO,"ZodIPv4",()=>C6,"ZodIPv6",()=>C7,"ZodIntersection",()=>A8,"ZodJWT",()=>Au,"ZodKSUID",()=>C4,"ZodLazy",()=>TG,"ZodLiteral",()=>Tp,"ZodMAC",()=>C9,"ZodMap",()=>Ts,"ZodNaN",()=>TM,"ZodNanoID",()=>CH,"ZodNever",()=>AB,"ZodNonOptional",()=>TC,"ZodNull",()=>AR,"ZodNullable",()=>Tw,"ZodNumber",()=>Av,"ZodNumberFormat",()=>Ab,"ZodObject",()=>AX,"ZodOptional",()=>Ty,"ZodPipe",()=>TD,"ZodPrefault",()=>TI,"ZodPreprocess",()=>TB,"ZodPromise",()=>TJ,"ZodReadonly",()=>TV,"ZodRecord",()=>Tn,"ZodSet",()=>Tl,"ZodString",()=>CC,"ZodStringFormat",()=>CT,"ZodSuccess",()=>TT,"ZodSymbol",()=>AP,"ZodTemplateLiteral",()=>TW,"ZodTransform",()=>Tx,"ZodTuple",()=>Te,"ZodType",()=>CI,"ZodULID",()=>CQ,"ZodURL",()=>CF,"ZodUUID",()=>CR,"ZodUndefined",()=>AO,"ZodUnion",()=>A2,"ZodUnknown",()=>AZ,"ZodVoid",()=>Aq,"ZodXID",()=>C1,"ZodXor",()=>A5,"_ZodString",()=>CE,"_default",()=>T$,"_function",()=>TQ,"any",()=>AU,"array",()=>AJ,"base64",()=>As,"base64url",()=>Al,"bigint",()=>AE,"boolean",()=>A$,"catch",()=>TO,"check",()=>T1,"cidrv4",()=>An,"cidrv6",()=>Ai,"codec",()=>TZ,"cuid",()=>CJ,"cuid2",()=>CX,"custom",()=>T2,"date",()=>AG,"describe",()=>T6,"discriminatedUnion",()=>A9,"e164",()=>Ac,"email",()=>Cz,"emoji",()=>CW,"enum",()=>Tu,"exactOptional",()=>Tj,"file",()=>Tg,"float32",()=>Aj,"float64",()=>Aw,"function",()=>TQ,"guid",()=>CM,"hash",()=>Ax,"hex",()=>Ag,"hostname",()=>Ah,"httpUrl",()=>CV,"instanceof",()=>T9,"int",()=>Ak,"int32",()=>AN,"int64",()=>AA,"intersection",()=>A7,"invertCodec",()=>TF,"ipv4",()=>C3,"ipv6",()=>Ae,"json",()=>T7,"jwt",()=>Am,"keyof",()=>AY,"ksuid",()=>C5,"lazy",()=>TK,"literal",()=>Tf,"looseObject",()=>A1,"looseRecord",()=>Ta,"mac",()=>C8,"map",()=>To,"meta",()=>T3,"nan",()=>TR,"nanoid",()=>CG,"nativeEnum",()=>Tm,"never",()=>AV,"nonoptional",()=>TA,"null",()=>AD,"nullable",()=>TN,"nullish",()=>T_,"number",()=>Ay,"object",()=>AQ,"optional",()=>Tb,"partialRecord",()=>Ti,"pipe",()=>TL,"prefault",()=>TE,"preprocess",()=>Pe,"promise",()=>TY,"readonly",()=>Tq,"record",()=>Tr,"refine",()=>T4,"set",()=>Td,"strictObject",()=>A0,"string",()=>CA,"stringFormat",()=>Af,"stringbool",()=>T8,"success",()=>TP,"superRefine",()=>T5,"symbol",()=>Az,"templateLiteral",()=>TH,"transform",()=>Tv,"tuple",()=>Tt,"uint32",()=>A_,"uint64",()=>AT,"ulid",()=>C0,"undefined",()=>AM,"union",()=>A4,"unknown",()=>AF,"url",()=>CB,"uuid",()=>CD,"uuidv4",()=>CL,"uuidv6",()=>CU,"uuidv7",()=>CZ,"void",()=>AW,"xid",()=>C2,"xor",()=>A6],3573);var Cg=Ix,Cx=Ig;e.s(["ZodISODate",()=>Cb,"ZodISODateTime",()=>Cv,"ZodISODuration",()=>CN,"ZodISOTime",()=>Cj,"date",()=>Ck,"datetime",()=>Cy,"duration",()=>C_,"time",()=>Cw],49648);let Cv=b5("ZodISODateTime",(e,t)=>{S9.init(e,t),CT.init(e,t)});function Cy(e){return IQ(Cv,e)}let Cb=b5("ZodISODate",(e,t)=>{S8.init(e,t),CT.init(e,t)});function Ck(e){return I0(Cb,e)}let Cj=b5("ZodISOTime",(e,t)=>{S7.init(e,t),CT.init(e,t)});function Cw(e){return I1(Cj,e)}let CN=b5("ZodISODuration",(e,t)=>{$e.init(e,t),CT.init(e,t)});function C_(e){return I2(CN,e)}let CS=new WeakMap;function C$(e,t,n){let r=Object.getPrototypeOf(e),i=CS.get(r);if(i||(i=new Set,CS.set(r,i)),!i.has(t))for(let e in i.add(t),n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}let CI=b5("ZodType",(e,t)=>(SH.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:jA(e,"input"),output:jA(e,"output")}}),e.toJSONSchema=jC(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>jd(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ju(e,t,n),e.parseAsync=async(t,n)=>jc(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>jm(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>jp(e,t,n),e.decode=(t,n)=>jf(e,t,n),e.encodeAsync=async(t,n)=>jh(e,t,n),e.decodeAsync=async(t,n)=>jg(e,t,n),e.safeEncode=(t,n)=>jx(e,t,n),e.safeDecode=(t,n)=>jv(e,t,n),e.safeEncodeAsync=async(t,n)=>jy(e,t,n),e.safeDecodeAsync=async(t,n)=>jb(e,t,n),C$(e,"ZodType",{check(...e){let t=this.def;return this.clone(Cx.mergeDefs(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return kk(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(T4(e,t))},superRefine(e,t){return this.check(T5(e,t))},overwrite(e){return this.check(EL(e))},optional(){return Tb(this)},exactOptional(){return Tj(this)},nullable(){return TN(this)},nullish(){return Tb(TN(this))},nonoptional(e){return TA(this,e)},array(){return AJ(this)},or(e){return A4([this,e])},and(e){return A7(this,e)},transform(e){return TL(this,Tv(e))},default(e){return T$(this,e)},prefault(e){return TE(this,e)},catch(e){return TO(this,e)},pipe(e){return TL(this,e)},readonly(){return Tq(this)},describe(e){let t=this.clone();return j_.add(t,{description:e}),t},meta(...e){if(0===e.length)return j_.get(this);let t=this.clone();return j_.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get:()=>j_.get(e)?.description,configurable:!0}),e)),CE=b5("_ZodString",(e,t)=>{SG.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jP(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,C$(e,"_ZodString",{regex(...e){return this.check(EA(...e))},includes(...e){return this.check(Ez(...e))},startsWith(...e){return this.check(EO(...e))},endsWith(...e){return this.check(EM(...e))},min(...e){return this.check(EE(...e))},max(...e){return this.check(EI(...e))},length(...e){return this.check(EC(...e))},nonempty(...e){return this.check(EE(1,...e))},lowercase(e){return this.check(ET(e))},uppercase(e){return this.check(EP(e))},trim(){return this.check(EZ())},normalize(...e){return this.check(EU(...e))},toLowerCase(){return this.check(EF())},toUpperCase(){return this.check(EB())},slugify(){return this.check(EV())}})}),CC=b5("ZodString",(e,t)=>{SG.init(e,t),CE.init(e,t),e.email=t=>e.check(IE(CP,t)),e.url=t=>e.check(IO(CF,t)),e.jwt=t=>e.check(IY(Au,t)),e.emoji=t=>e.check(IM(Cq,t)),e.guid=t=>e.check(IC(CO,t)),e.uuid=t=>e.check(IA(CR,t)),e.uuidv4=t=>e.check(IT(CR,t)),e.uuidv6=t=>e.check(IP(CR,t)),e.uuidv7=t=>e.check(Iz(CR,t)),e.nanoid=t=>e.check(IR(CH,t)),e.guid=t=>e.check(IC(CO,t)),e.cuid=t=>e.check(ID(CK,t)),e.cuid2=t=>e.check(IL(CY,t)),e.ulid=t=>e.check(IU(CQ,t)),e.base64=t=>e.check(IG(Aa,t)),e.base64url=t=>e.check(IK(Ao,t)),e.xid=t=>e.check(IZ(C1,t)),e.ksuid=t=>e.check(IF(C4,t)),e.ipv4=t=>e.check(IB(C6,t)),e.ipv6=t=>e.check(IV(C7,t)),e.cidrv4=t=>e.check(IW(At,t)),e.cidrv6=t=>e.check(IH(Ar,t)),e.e164=t=>e.check(IJ(Ad,t)),e.datetime=t=>e.check(Cy(t)),e.date=t=>e.check(Ck(t)),e.time=t=>e.check(Cw(t)),e.duration=t=>e.check(C_(t))});function CA(e){return I$(CC,e)}let CT=b5("ZodStringFormat",(e,t)=>{SK.init(e,t),CE.init(e,t)}),CP=b5("ZodEmail",(e,t)=>{SX.init(e,t),CT.init(e,t)});function Cz(e){return IE(CP,e)}let CO=b5("ZodGUID",(e,t)=>{SJ.init(e,t),CT.init(e,t)});function CM(e){return IC(CO,e)}let CR=b5("ZodUUID",(e,t)=>{SY.init(e,t),CT.init(e,t)});function CD(e){return IA(CR,e)}function CL(e){return IT(CR,e)}function CU(e){return IP(CR,e)}function CZ(e){return Iz(CR,e)}let CF=b5("ZodURL",(e,t)=>{SQ.init(e,t),CT.init(e,t)});function CB(e){return IO(CF,e)}function CV(e){return IO(CF,{protocol:Cg.httpProtocol,hostname:Cg.domain,...Cx.normalizeParams(e)})}let Cq=b5("ZodEmoji",(e,t)=>{S0.init(e,t),CT.init(e,t)});function CW(e){return IM(Cq,e)}let CH=b5("ZodNanoID",(e,t)=>{S1.init(e,t),CT.init(e,t)});function CG(e){return IR(CH,e)}let CK=b5("ZodCUID",(e,t)=>{S2.init(e,t),CT.init(e,t)});function CJ(e){return ID(CK,e)}let CY=b5("ZodCUID2",(e,t)=>{S4.init(e,t),CT.init(e,t)});function CX(e){return IL(CY,e)}let CQ=b5("ZodULID",(e,t)=>{S5.init(e,t),CT.init(e,t)});function C0(e){return IU(CQ,e)}let C1=b5("ZodXID",(e,t)=>{S6.init(e,t),CT.init(e,t)});function C2(e){return IZ(C1,e)}let C4=b5("ZodKSUID",(e,t)=>{S3.init(e,t),CT.init(e,t)});function C5(e){return IF(C4,e)}let C6=b5("ZodIPv4",(e,t)=>{$t.init(e,t),CT.init(e,t)});function C3(e){return IB(C6,e)}let C9=b5("ZodMAC",(e,t)=>{$r.init(e,t),CT.init(e,t)});function C8(e){return Iq(C9,e)}let C7=b5("ZodIPv6",(e,t)=>{$n.init(e,t),CT.init(e,t)});function Ae(e){return IV(C7,e)}let At=b5("ZodCIDRv4",(e,t)=>{$i.init(e,t),CT.init(e,t)});function An(e){return IW(At,e)}let Ar=b5("ZodCIDRv6",(e,t)=>{$a.init(e,t),CT.init(e,t)});function Ai(e){return IH(Ar,e)}let Aa=b5("ZodBase64",(e,t)=>{$o.init(e,t),CT.init(e,t)});function As(e){return IG(Aa,e)}let Ao=b5("ZodBase64URL",(e,t)=>{$d.init(e,t),CT.init(e,t)});function Al(e){return IK(Ao,e)}let Ad=b5("ZodE164",(e,t)=>{$c.init(e,t),CT.init(e,t)});function Ac(e){return IJ(Ad,e)}let Au=b5("ZodJWT",(e,t)=>{$m.init(e,t),CT.init(e,t)});function Am(e){return IY(Au,e)}let Ap=b5("ZodCustomStringFormat",(e,t)=>{$p.init(e,t),CT.init(e,t)});function Af(e,t,n={}){return Cp(Ap,e,t,n)}function Ah(e){return Cp(Ap,"hostname",Cg.hostname,e)}function Ag(e){return Cp(Ap,"hex",Cg.hex,e)}function Ax(e,t){let n=t?.enc??"hex",r=`${e}_${n}`,i=Cg[r];if(!i)throw Error(`Unrecognized hash format: ${r}`);return Cp(Ap,r,i,t)}let Av=b5("ZodNumber",(e,t)=>{$f.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jz(e,t,n,r),C$(e,"ZodNumber",{gt(e,t){return this.check(Ev(e,t))},gte(e,t){return this.check(Ey(e,t))},min(e,t){return this.check(Ey(e,t))},lt(e,t){return this.check(Eg(e,t))},lte(e,t){return this.check(Ex(e,t))},max(e,t){return this.check(Ex(e,t))},int(e){return this.check(Ak(e))},safe(e){return this.check(Ak(e))},positive(e){return this.check(Ev(0,e))},nonnegative(e){return this.check(Ey(0,e))},negative(e){return this.check(Eg(0,e))},nonpositive(e){return this.check(Ex(0,e))},multipleOf(e,t){return this.check(EN(e,t))},step(e,t){return this.check(EN(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Ay(e){return I4(Av,e)}let Ab=b5("ZodNumberFormat",(e,t)=>{$h.init(e,t),Av.init(e,t)});function Ak(e){return I6(Ab,e)}function Aj(e){return I3(Ab,e)}function Aw(e){return I9(Ab,e)}function AN(e){return I8(Ab,e)}function A_(e){return I7(Ab,e)}let AS=b5("ZodBoolean",(e,t)=>{$g.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jO(e,t,n,r)});function A$(e){return Ee(AS,e)}let AI=b5("ZodBigInt",(e,t)=>{$x.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jM(e,t,n,r),e.gte=(t,n)=>e.check(Ey(t,n)),e.min=(t,n)=>e.check(Ey(t,n)),e.gt=(t,n)=>e.check(Ev(t,n)),e.gte=(t,n)=>e.check(Ey(t,n)),e.min=(t,n)=>e.check(Ey(t,n)),e.lt=(t,n)=>e.check(Eg(t,n)),e.lte=(t,n)=>e.check(Ex(t,n)),e.max=(t,n)=>e.check(Ex(t,n)),e.positive=t=>e.check(Ev(BigInt(0),t)),e.negative=t=>e.check(Eg(BigInt(0),t)),e.nonpositive=t=>e.check(Ex(BigInt(0),t)),e.nonnegative=t=>e.check(Ey(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(EN(t,n));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});function AE(e){return En(AI,e)}let AC=b5("ZodBigIntFormat",(e,t)=>{$v.init(e,t),AI.init(e,t)});function AA(e){return Ei(AC,e)}function AT(e){return Ea(AC,e)}let AP=b5("ZodSymbol",(e,t)=>{$y.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jR(e,t,n,r)});function Az(e){return Es(AP,e)}let AO=b5("ZodUndefined",(e,t)=>{$b.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jL(e,t,n,r)});function AM(e){return Eo(AO,e)}let AR=b5("ZodNull",(e,t)=>{$k.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jD(e,t,n,r)});function AD(e){return El(AR,e)}let AL=b5("ZodAny",(e,t)=>{$j.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jF(e,t,n,r)});function AU(){return Ed(AL)}let AZ=b5("ZodUnknown",(e,t)=>{$w.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jB(e,t,n,r)});function AF(){return Ec(AZ)}let AB=b5("ZodNever",(e,t)=>{$N.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jZ(e,t,n,r)});function AV(e){return Eu(AB,e)}let Aq=b5("ZodVoid",(e,t)=>{$_.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jU(e,t,n,r)});function AW(e){return Em(Aq,e)}let AH=b5("ZodDate",(e,t)=>{$S.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jV(e,t,n,r),e.min=(t,n)=>e.check(Ey(t,n)),e.max=(t,n)=>e.check(Ex(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function AG(e){return Ep(AH,e)}let AK=b5("ZodArray",(e,t)=>{$I.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>j2(e,t,n,r),e.element=t.element,C$(e,"ZodArray",{min(e,t){return this.check(EE(e,t))},nonempty(e){return this.check(EE(1,e))},max(e,t){return this.check(EI(e,t))},length(e,t){return this.check(EC(e,t))},unwrap(){return this.element}})});function AJ(e,t){return Eq(AK,e,t)}function AY(e){return Tu(Object.keys(e._zod.def.shape))}let AX=b5("ZodObject",(e,t)=>{$P.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>j4(e,t,n,r),Cx.defineLazy(e,"shape",()=>t.shape),C$(e,"ZodObject",{keyof(){return Tu(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:AF()})},loose(){return this.clone({...this._zod.def,catchall:AF()})},strict(){return this.clone({...this._zod.def,catchall:AV()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return Cx.extend(this,e)},safeExtend(e){return Cx.safeExtend(this,e)},merge(e){return Cx.merge(this,e)},pick(e){return Cx.pick(this,e)},omit(e){return Cx.omit(this,e)},partial(...e){return Cx.partial(Ty,this,e[0])},required(...e){return Cx.required(TC,this,e[0])}})});function AQ(e,t){return new AX({type:"object",shape:e??{},...Cx.normalizeParams(t)})}function A0(e,t){return new AX({type:"object",shape:e,catchall:AV(),...Cx.normalizeParams(t)})}function A1(e,t){return new AX({type:"object",shape:e,catchall:AF(),...Cx.normalizeParams(t)})}let A2=b5("ZodUnion",(e,t)=>{$O.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>j5(e,t,n,r),e.options=t.options});function A4(e,t){return new A2({type:"union",options:e,...Cx.normalizeParams(t)})}let A5=b5("ZodXor",(e,t)=>{A2.init(e,t),$R.init(e,t),e._zod.processJSONSchema=(t,n,r)=>j5(e,t,n,r),e.options=t.options});function A6(e,t){return new A5({type:"union",options:e,inclusive:!1,...Cx.normalizeParams(t)})}let A3=b5("ZodDiscriminatedUnion",(e,t)=>{A2.init(e,t),$D.init(e,t)});function A9(e,t,n){return new A3({type:"union",options:t,discriminator:e,...Cx.normalizeParams(n)})}let A8=b5("ZodIntersection",(e,t)=>{$L.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>j6(e,t,n,r)});function A7(e,t){return new A8({type:"intersection",left:e,right:t})}let Te=b5("ZodTuple",(e,t)=>{$Z.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>j3(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function Tt(e,t,n){let r=t instanceof SH,i=r?n:t;return new Te({type:"tuple",items:e,rest:r?t:null,...Cx.normalizeParams(i)})}let Tn=b5("ZodRecord",(e,t)=>{$q.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>j9(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Tr(e,t,n){return new Tn(t&&t._zod?{type:"record",keyType:e,valueType:t,...Cx.normalizeParams(n)}:{type:"record",keyType:CA(),valueType:e,...Cx.normalizeParams(t)})}function Ti(e,t,n){let r=kk(e);return r._zod.values=void 0,new Tn({type:"record",keyType:r,valueType:t,...Cx.normalizeParams(n)})}function Ta(e,t,n){return new Tn({type:"record",keyType:e,valueType:t,mode:"loose",...Cx.normalizeParams(n)})}let Ts=b5("ZodMap",(e,t)=>{$W.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>j0(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(ES(...t)),e.nonempty=t=>e.check(ES(1,t)),e.max=(...t)=>e.check(E_(...t)),e.size=(...t)=>e.check(E$(...t))});function To(e,t,n){return new Ts({type:"map",keyType:e,valueType:t,...Cx.normalizeParams(n)})}let Tl=b5("ZodSet",(e,t)=>{$G.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>j1(e,t,n,r),e.min=(...t)=>e.check(ES(...t)),e.nonempty=t=>e.check(ES(1,t)),e.max=(...t)=>e.check(E_(...t)),e.size=(...t)=>e.check(E$(...t))});function Td(e,t){return new Tl({type:"set",valueType:e,...Cx.normalizeParams(t)})}let Tc=b5("ZodEnum",(e,t)=>{$J.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jq(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Tc({...t,checks:[],...Cx.normalizeParams(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Tc({...t,checks:[],...Cx.normalizeParams(r),entries:i})}});function Tu(e,t){return new Tc({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...Cx.normalizeParams(t)})}function Tm(e,t){return new Tc({type:"enum",entries:e,...Cx.normalizeParams(t)})}let Tp=b5("ZodLiteral",(e,t)=>{$Y.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jW(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Tf(e,t){return new Tp({type:"literal",values:Array.isArray(e)?e:[e],...Cx.normalizeParams(t)})}let Th=b5("ZodFile",(e,t)=>{$X.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jK(e,t,n,r),e.min=(t,n)=>e.check(ES(t,n)),e.max=(t,n)=>e.check(E_(t,n)),e.mime=(t,n)=>e.check(ED(Array.isArray(t)?t:[t],n))});function Tg(e){return E4(Th,e)}let Tx=b5("ZodTransform",(e,t)=>{$Q.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jQ(e,t,n,r),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new b9(e.constructor.name);n.addIssue=r=>{"string"==typeof r?n.issues.push(Cx.issue(r,n.value,t)):(r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),n.issues.push(Cx.issue(r)))};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function Tv(e){return new Tx({type:"transform",transform:e})}let Ty=b5("ZodOptional",(e,t)=>{$1.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ws(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Tb(e){return new Ty({type:"optional",innerType:e})}let Tk=b5("ZodExactOptional",(e,t)=>{$2.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ws(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Tj(e){return new Tk({type:"optional",innerType:e})}let Tw=b5("ZodNullable",(e,t)=>{$4.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>j8(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function TN(e){return new Tw({type:"nullable",innerType:e})}function T_(e){return Tb(TN(e))}let TS=b5("ZodDefault",(e,t)=>{$5.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>we(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function T$(e,t){return new TS({type:"default",innerType:e,get defaultValue(){return"function"==typeof t?t():Cx.shallowClone(t)}})}let TI=b5("ZodPrefault",(e,t)=>{$3.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wt(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function TE(e,t){return new TI({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof t?t():Cx.shallowClone(t)}})}let TC=b5("ZodNonOptional",(e,t)=>{$9.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>j7(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function TA(e,t){return new TC({type:"nonoptional",innerType:e,...Cx.normalizeParams(t)})}let TT=b5("ZodSuccess",(e,t)=>{$7.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jJ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function TP(e){return new TT({type:"success",innerType:e})}let Tz=b5("ZodCatch",(e,t)=>{Ie.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wn(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function TO(e,t){return new Tz({type:"catch",innerType:e,catchValue:"function"==typeof t?t:()=>t})}let TM=b5("ZodNaN",(e,t)=>{It.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jH(e,t,n,r)});function TR(e){return Eh(TM,e)}let TD=b5("ZodPipe",(e,t)=>{In.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wr(e,t,n,r),e.in=t.in,e.out=t.out});function TL(e,t){return new TD({type:"pipe",in:e,out:t})}let TU=b5("ZodCodec",(e,t)=>{TD.init(e,t),Ii.init(e,t)});function TZ(e,t,n){return new TU({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function TF(e){let t=e._zod.def;return new TU({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}let TB=b5("ZodPreprocess",(e,t)=>{TD.init(e,t),Io.init(e,t)}),TV=b5("ZodReadonly",(e,t)=>{Il.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Tq(e){return new TV({type:"readonly",innerType:e})}let TW=b5("ZodTemplateLiteral",(e,t)=>{Ic.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jG(e,t,n,r)});function TH(e,t){return new TW({type:"template_literal",parts:e,...Cx.normalizeParams(t)})}let TG=b5("ZodLazy",(e,t)=>{Ip.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wo(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function TK(e){return new TG({type:"lazy",getter:e})}let TJ=b5("ZodPromise",(e,t)=>{Im.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function TY(e){return new TJ({type:"promise",innerType:e})}let TX=b5("ZodFunction",(e,t)=>{Iu.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jX(e,t,n,r)});function TQ(e){return new TX({type:"function",input:Array.isArray(e?.input)?Tt(e?.input):e?.input??AJ(AF()),output:e?.output??AF()})}let T0=b5("ZodCustom",(e,t)=>{If.init(e,t),CI.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jY(e,t,n,r)});function T1(e){let t=new Sk({check:"custom"});return t._zod.check=e,t}function T2(e,t){return Cs(T0,e??(()=>!0),t)}function T4(e,t={}){return Co(T0,e,t)}function T5(e,t){return Cl(e,t)}let T6=Cc,T3=Cu;function T9(e,t={}){let n=new T0({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...Cx.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:"invalid_type",expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}let T8=(...e)=>Cm({Codec:TU,Boolean:AS,String:CC},...e);function T7(e){let t=TK(()=>A4([CA(e),Ay(),A$(),AD(),AJ(t),Tr(CA(),t)]));return t}function Pe(e,t){return new TB({type:"pipe",in:Tv(e),out:t})}var Pt=e.i(3573);e.s([],15830),e.i(15830),e.s(["endsWith",0,EM,"gt",0,Ev,"gte",0,Ey,"includes",0,Ez,"length",0,EC,"lowercase",0,ET,"lt",0,Eg,"lte",0,Ex,"maxLength",0,EI,"maxSize",0,E_,"mime",0,ED,"minLength",0,EE,"minSize",0,ES,"multipleOf",0,EN,"negative",0,Ek,"nonnegative",0,Ew,"nonpositive",0,Ej,"normalize",0,EU,"overwrite",0,EL,"positive",0,Eb,"property",0,ER,"regex",0,EA,"size",0,E$,"slugify",0,EV,"startsWith",0,EO,"toLowerCase",0,EF,"toUpperCase",0,EB,"trim",0,EZ,"uppercase",0,EP],70854);var Pn=e.i(70854);e.i(79163),e.i(96859);let Pr={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function Pi(e){b7({customError:e})}function Pa(){return b7().customError}J||(J={}),e.s(["ZodFirstPartyTypeKind",0,J,"ZodIssueCode",0,Pr,"getErrorMap",0,Pa,"setErrorMap",0,Pi],14126),e.i(14126),e.s(["$brand",0,b6,"ZodFirstPartyTypeKind",0,J,"ZodIssueCode",0,Pr,"config",0,b7,"getErrorMap",0,Pa,"setErrorMap",0,Pi],45339),e.i(45339);var Cg=Ix,Cx=Ig,Ps=e.i(49648);let Po={...Pt,...Pn,iso:Ps},Pl=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);e.s(["bigint",0,function(e){return Er(AI,e)},"boolean",0,function(e){return Et(AS,e)},"date",0,function(e){return Ef(AH,e)},"number",0,function(e){return I5(Av,e)},"string",0,function(e){return II(CC,e)}],46056);var Pd=e.i(46056);e.s(["$brand",0,b6,"$input",0,jj,"$output",0,jk,"NEVER",0,b4,"TimePrecision",0,IX,"ZodAny",0,AL,"ZodArray",0,AK,"ZodBase64",0,Aa,"ZodBase64URL",0,Ao,"ZodBigInt",0,AI,"ZodBigIntFormat",0,AC,"ZodBoolean",0,AS,"ZodCIDRv4",0,At,"ZodCIDRv6",0,Ar,"ZodCUID",0,CK,"ZodCUID2",0,CY,"ZodCatch",0,Tz,"ZodCodec",0,TU,"ZodCustom",0,T0,"ZodCustomStringFormat",0,Ap,"ZodDate",0,AH,"ZodDefault",0,TS,"ZodDiscriminatedUnion",0,A3,"ZodE164",0,Ad,"ZodEmail",0,CP,"ZodEmoji",0,Cq,"ZodEnum",0,Tc,"ZodError",0,jo,"ZodExactOptional",0,Tk,"ZodFile",0,Th,"ZodFirstPartyTypeKind",0,J,"ZodFunction",0,TX,"ZodGUID",0,CO,"ZodIPv4",0,C6,"ZodIPv6",0,C7,"ZodISODate",0,Cb,"ZodISODateTime",0,Cv,"ZodISODuration",0,CN,"ZodISOTime",0,Cj,"ZodIntersection",0,A8,"ZodIssueCode",0,Pr,"ZodJWT",0,Au,"ZodKSUID",0,C4,"ZodLazy",0,TG,"ZodLiteral",0,Tp,"ZodMAC",0,C9,"ZodMap",0,Ts,"ZodNaN",0,TM,"ZodNanoID",0,CH,"ZodNever",0,AB,"ZodNonOptional",0,TC,"ZodNull",0,AR,"ZodNullable",0,Tw,"ZodNumber",0,Av,"ZodNumberFormat",0,Ab,"ZodObject",0,AX,"ZodOptional",0,Ty,"ZodPipe",0,TD,"ZodPrefault",0,TI,"ZodPreprocess",0,TB,"ZodPromise",0,TJ,"ZodReadonly",0,TV,"ZodRealError",0,jl,"ZodRecord",0,Tn,"ZodSet",0,Tl,"ZodString",0,CC,"ZodStringFormat",0,CT,"ZodSuccess",0,TT,"ZodSymbol",0,AP,"ZodTemplateLiteral",0,TW,"ZodTransform",0,Tx,"ZodTuple",0,Te,"ZodType",0,CI,"ZodULID",0,CQ,"ZodURL",0,CF,"ZodUUID",0,CR,"ZodUndefined",0,AO,"ZodUnion",0,A2,"ZodUnknown",0,AZ,"ZodVoid",0,Aq,"ZodXID",0,C1,"ZodXor",0,A5,"_ZodString",0,CE,"_default",0,T$,"_function",0,TQ,"any",0,AU,"array",0,AJ,"base64",0,As,"base64url",0,Al,"bigint",0,AE,"boolean",0,A$,"catch",0,TO,"check",0,T1,"cidrv4",0,An,"cidrv6",0,Ai,"clone",0,kk,"codec",0,TZ,"coerce",0,Pd,"config",0,b7,"core",0,Ch,"cuid",0,CJ,"cuid2",0,CX,"custom",0,T2,"date",0,AG,"decode",0,jf,"decodeAsync",0,jg,"describe",0,T6,"discriminatedUnion",0,A9,"e164",0,Ac,"email",0,Cz,"emoji",0,CW,"encode",0,jp,"encodeAsync",0,jh,"endsWith",0,EM,"enum",0,Tu,"exactOptional",0,Tj,"file",0,Tg,"flattenError",0,kZ,"float32",0,Aj,"float64",0,Aw,"formatError",0,kF,"fromJSONSchema",0,function(e,t){var n,r;let i,a;if("boolean"==typeof e)return e?Po.any():Po.never();try{i=JSON.parse(JSON.stringify(e))}catch{throw Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let s={version:(n=i,r=t?.defaultTarget,"https://json-schema.org/draft/2020-12/schema"===(a=n.$schema)?"draft-2020-12":"http://json-schema.org/draft-07/schema#"===a?"draft-7":"http://json-schema.org/draft-04/schema#"===a?"draft-4":r??"draft-2020-12"),defs:i.$defs||i.definitions||{},refs:new Map,processing:new Set,rootSchema:i,registry:t?.registry??j_};return function e(t,n){if("boolean"==typeof t)return t?Po.any():Po.never();let r=function t(n,r){let i;if(void 0!==n.not){if("object"==typeof n.not&&0===Object.keys(n.not).length)return Po.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(void 0!==n.unevaluatedItems)throw Error("unevaluatedItems is not supported");if(void 0!==n.unevaluatedProperties)throw Error("unevaluatedProperties is not supported");if(void 0!==n.if||void 0!==n.then||void 0!==n.else)throw Error("Conditional schemas (if/then/else) are not supported");if(void 0!==n.dependentSchemas||void 0!==n.dependentRequired)throw Error("dependentSchemas and dependentRequired are not supported");if(n.$ref){let t=n.$ref;if(r.refs.has(t))return r.refs.get(t);if(r.processing.has(t))return Po.lazy(()=>{if(!r.refs.has(t))throw Error(`Circular reference not resolved: ${t}`);return r.refs.get(t)});r.processing.add(t);let i=e(function(e,t){if(!e.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let n=e.slice(1).split("/").filter(Boolean);if(0===n.length)return t.rootSchema;let r="draft-2020-12"===t.version?"$defs":"definitions";if(n[0]===r){let r=n[1];if(!r||!t.defs[r])throw Error(`Reference not found: ${e}`);return t.defs[r]}throw Error(`Reference not found: ${e}`)}(t,r),r);return r.refs.set(t,i),r.processing.delete(t),i}if(void 0!==n.enum){let e=n.enum;if("openapi-3.0"===r.version&&!0===n.nullable&&1===e.length&&null===e[0])return Po.null();if(0===e.length)return Po.never();if(1===e.length)return Po.literal(e[0]);if(e.every(e=>"string"==typeof e))return Po.enum(e);let t=e.map(e=>Po.literal(e));return t.length<2?t[0]:Po.union([t[0],t[1],...t.slice(2)])}if(void 0!==n.const)return Po.literal(n.const);let a=n.type;if(Array.isArray(a)){let e=a.map(e=>t({...n,type:e},r));return 0===e.length?Po.never():1===e.length?e[0]:Po.union(e)}if(!a)return Po.any();switch(a){case"string":{let e=Po.string();if(n.format){let t=n.format;"email"===t?e=e.check(Po.email()):"uri"===t||"uri-reference"===t?e=e.check(Po.url()):"uuid"===t||"guid"===t?e=e.check(Po.uuid()):"date-time"===t?e=e.check(Po.iso.datetime()):"date"===t?e=e.check(Po.iso.date()):"time"===t?e=e.check(Po.iso.time()):"duration"===t?e=e.check(Po.iso.duration()):"ipv4"===t?e=e.check(Po.ipv4()):"ipv6"===t?e=e.check(Po.ipv6()):"mac"===t?e=e.check(Po.mac()):"cidr"===t?e=e.check(Po.cidrv4()):"cidr-v6"===t?e=e.check(Po.cidrv6()):"base64"===t?e=e.check(Po.base64()):"base64url"===t?e=e.check(Po.base64url()):"e164"===t?e=e.check(Po.e164()):"jwt"===t?e=e.check(Po.jwt()):"emoji"===t?e=e.check(Po.emoji()):"nanoid"===t?e=e.check(Po.nanoid()):"cuid"===t?e=e.check(Po.cuid()):"cuid2"===t?e=e.check(Po.cuid2()):"ulid"===t?e=e.check(Po.ulid()):"xid"===t?e=e.check(Po.xid()):"ksuid"===t&&(e=e.check(Po.ksuid()))}"number"==typeof n.minLength&&(e=e.min(n.minLength)),"number"==typeof n.maxLength&&(e=e.max(n.maxLength)),n.pattern&&(e=e.regex(new RegExp(n.pattern))),i=e;break}case"number":case"integer":{let e="integer"===a?Po.number().int():Po.number();"number"==typeof n.minimum&&(e=e.min(n.minimum)),"number"==typeof n.maximum&&(e=e.max(n.maximum)),"number"==typeof n.exclusiveMinimum?e=e.gt(n.exclusiveMinimum):!0===n.exclusiveMinimum&&"number"==typeof n.minimum&&(e=e.gt(n.minimum)),"number"==typeof n.exclusiveMaximum?e=e.lt(n.exclusiveMaximum):!0===n.exclusiveMaximum&&"number"==typeof n.maximum&&(e=e.lt(n.maximum)),"number"==typeof n.multipleOf&&(e=e.multipleOf(n.multipleOf)),i=e;break}case"boolean":i=Po.boolean();break;case"null":i=Po.null();break;case"object":{let t={},a=n.properties||{},s=new Set(n.required||[]);for(let[n,i]of Object.entries(a)){let a=e(i,r);t[n]=s.has(n)?a:a.optional()}if(n.propertyNames){let a=e(n.propertyNames,r),s=n.additionalProperties&&"object"==typeof n.additionalProperties?e(n.additionalProperties,r):Po.any();if(0===Object.keys(t).length){i=Po.record(a,s);break}let o=Po.object(t).passthrough(),l=Po.looseRecord(a,s);i=Po.intersection(o,l);break}if(n.patternProperties){let a=n.patternProperties,s=Object.keys(a),o=[];for(let t of s){let n=e(a[t],r),i=Po.string().regex(new RegExp(t));o.push(Po.looseRecord(i,n))}let l=[];if(Object.keys(t).length>0&&l.push(Po.object(t).passthrough()),l.push(...o),0===l.length)i=Po.object({}).passthrough();else if(1===l.length)i=l[0];else{let e=Po.intersection(l[0],l[1]);for(let t=2;t<l.length;t++)e=Po.intersection(e,l[t]);i=e}break}let o=Po.object(t);i=!1===n.additionalProperties?o.strict():"object"==typeof n.additionalProperties?o.catchall(e(n.additionalProperties,r)):o.passthrough();break}case"array":{let t=n.prefixItems,a=n.items;if(t&&Array.isArray(t)){let s=t.map(t=>e(t,r)),o=a&&"object"==typeof a&&!Array.isArray(a)?e(a,r):void 0;i=o?Po.tuple(s).rest(o):Po.tuple(s),"number"==typeof n.minItems&&(i=i.check(Po.minLength(n.minItems))),"number"==typeof n.maxItems&&(i=i.check(Po.maxLength(n.maxItems)))}else if(Array.isArray(a)){let t=a.map(t=>e(t,r)),s=n.additionalItems&&"object"==typeof n.additionalItems?e(n.additionalItems,r):void 0;i=s?Po.tuple(t).rest(s):Po.tuple(t),"number"==typeof n.minItems&&(i=i.check(Po.minLength(n.minItems))),"number"==typeof n.maxItems&&(i=i.check(Po.maxLength(n.maxItems)))}else if(void 0!==a){let t=e(a,r),s=Po.array(t);"number"==typeof n.minItems&&(s=s.min(n.minItems)),"number"==typeof n.maxItems&&(s=s.max(n.maxItems)),i=s}else i=Po.array(Po.any());break}default:throw Error(`Unsupported type: ${a}`)}return i}(t,n),i=t.type||void 0!==t.enum||void 0!==t.const;if(t.anyOf&&Array.isArray(t.anyOf)){let a=t.anyOf.map(t=>e(t,n)),s=Po.union(a);r=i?Po.intersection(r,s):s}if(t.oneOf&&Array.isArray(t.oneOf)){let a=t.oneOf.map(t=>e(t,n)),s=Po.xor(a);r=i?Po.intersection(r,s):s}if(t.allOf&&Array.isArray(t.allOf))if(0===t.allOf.length)r=i?r:Po.any();else{let a=i?r:e(t.allOf[0],n),s=+!i;for(let r=s;r<t.allOf.length;r++)a=Po.intersection(a,e(t.allOf[r],n));r=a}!0===t.nullable&&"openapi-3.0"===n.version&&(r=Po.nullable(r)),!0===t.readOnly&&(r=Po.readonly(r)),void 0!==t.default&&(r=r.default(t.default));let a={};for(let e of["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"])e in t&&(a[e]=t[e]);for(let e of["contentEncoding","contentMediaType","contentSchema"])e in t&&(a[e]=t[e]);for(let e of Object.keys(t))Pl.has(e)||(a[e]=t[e]);return Object.keys(a).length>0&&n.registry.add(r,a),t.description&&(r=r.describe(t.description)),r}(i,s)},"function",0,TQ,"getErrorMap",0,Pa,"globalRegistry",0,j_,"gt",0,Ev,"gte",0,Ey,"guid",0,CM,"hash",0,Ax,"hex",0,Ag,"hostname",0,Ah,"httpUrl",0,CV,"includes",0,Ez,"instanceof",0,T9,"int",0,Ak,"int32",0,AN,"int64",0,AA,"intersection",0,A7,"invertCodec",0,TF,"ipv4",0,C3,"ipv6",0,Ae,"iso",0,Ps,"json",0,T7,"jwt",0,Am,"keyof",0,AY,"ksuid",0,C5,"lazy",0,TK,"length",0,EC,"literal",0,Tf,"locales",0,IS,"looseObject",0,A1,"looseRecord",0,Ta,"lowercase",0,ET,"lt",0,Eg,"lte",0,Ex,"mac",0,C8,"map",0,To,"maxLength",0,EI,"maxSize",0,E_,"meta",0,T3,"mime",0,ED,"minLength",0,EE,"minSize",0,ES,"multipleOf",0,EN,"nan",0,TR,"nanoid",0,CG,"nativeEnum",0,Tm,"negative",0,Ek,"never",0,AV,"nonnegative",0,Ew,"nonoptional",0,TA,"nonpositive",0,Ej,"normalize",0,EU,"null",0,AD,"nullable",0,TN,"nullish",0,T_,"number",0,Ay,"object",0,AQ,"optional",0,Tb,"overwrite",0,EL,"parse",0,jd,"parseAsync",0,jc,"partialRecord",0,Ti,"pipe",0,TL,"positive",0,Eb,"prefault",0,TE,"preprocess",0,Pe,"prettifyError",0,kq,"promise",0,TY,"property",0,ER,"readonly",0,Tq,"record",0,Tr,"refine",0,T4,"regex",0,EA,"regexes",()=>Cg,"registry",0,jN,"safeDecode",0,jv,"safeDecodeAsync",0,jb,"safeEncode",0,jx,"safeEncodeAsync",0,jy,"safeParse",0,ju,"safeParseAsync",0,jm,"set",0,Td,"setErrorMap",0,Pi,"size",0,E$,"slugify",0,EV,"startsWith",0,EO,"strictObject",0,A0,"string",0,CA,"stringFormat",0,Af,"stringbool",0,T8,"success",0,TP,"superRefine",0,T5,"symbol",0,Az,"templateLiteral",0,TH,"toJSONSchema",0,wd,"toLowerCase",0,EF,"toUpperCase",0,EB,"transform",0,Tv,"treeifyError",0,kB,"trim",0,EZ,"tuple",0,Tt,"uint32",0,A_,"uint64",0,AT,"ulid",0,C0,"undefined",0,AM,"union",0,A4,"unknown",0,AF,"uppercase",0,EP,"url",0,CB,"util",()=>Cx,"uuid",0,CD,"uuidv4",0,CL,"uuidv6",0,CU,"uuidv7",0,CZ,"void",0,AW,"xid",0,C2,"xor",0,A6],30558);var Pc=e.i(30558),Pc=Pc,Pu=e.i(24154),Pm=Symbol.for("vercel.ai.gateway.error"),Pp=class e extends(X=Error,Y=Pm,X){constructor({message:e,statusCode:t=500,cause:n,generationId:r,isRetryable:i=null!=t&&(408===t||409===t||429===t||t>=500)}){super(r?`${e} [${r}]`:e),this[Y]=!0,this.statusCode=t,this.cause=n,this.generationId=r,this.isRetryable=i}static isInstance(t){return e.hasMarker(t)}static hasMarker(e){return"object"==typeof e&&null!==e&&Pm in e&&!0===e[Pm]}},Pf="GatewayAuthenticationError",Ph=Symbol.for(`vercel.ai.gateway.error.${Pf}`),Pg=class e extends(ee=Pp,Q=Ph,ee){constructor({message:e="Authentication failed",statusCode:t=401,cause:n,generationId:r}={}){super({message:e,statusCode:t,cause:n,generationId:r}),this[Q]=!0,this.name=Pf,this.type="authentication_error"}static isInstance(e){return Pp.hasMarker(e)&&Ph in e}static createContextualError({apiKeyProvided:t,oidcTokenProvided:n,message:r="Authentication failed",statusCode:i=401,cause:a,generationId:s}){return new e({message:t?`AI Gateway authentication failed: Invalid API key.
393
+
394
+ Create a new API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys
395
+
396
+ Provide via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.`:n?`AI Gateway authentication failed: Invalid OIDC token.
397
+
398
+ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the token.
399
+
400
+ Alternatively, use an API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys`:`AI Gateway authentication failed: No authentication provided.
401
+
402
+ Option 1 - API key:
403
+ Create an API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys
404
+ Provide via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.
405
+
406
+ Option 2 - OIDC token:
407
+ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the token.`,statusCode:i,cause:a,generationId:s})}},Px="GatewayInvalidRequestError",Pv=Symbol.for(`vercel.ai.gateway.error.${Px}`),Py=class extends(en=Pp,et=Pv,en){constructor({message:e="Invalid request",statusCode:t=400,cause:n,generationId:r}={}){super({message:e,statusCode:t,cause:n,generationId:r}),this[et]=!0,this.name=Px,this.type="invalid_request_error"}static isInstance(e){return Pp.hasMarker(e)&&Pv in e}},Pb="GatewayRateLimitError",Pk=Symbol.for(`vercel.ai.gateway.error.${Pb}`),Pj=class extends(ei=Pp,er=Pk,ei){constructor({message:e="Rate limit exceeded",statusCode:t=429,cause:n,generationId:r}={}){super({message:e,statusCode:t,cause:n,generationId:r}),this[er]=!0,this.name=Pb,this.type="rate_limit_exceeded"}static isInstance(e){return Pp.hasMarker(e)&&Pk in e}},Pw="GatewayModelNotFoundError",PN=Symbol.for(`vercel.ai.gateway.error.${Pw}`),P_=_v(()=>_k(Pc.object({modelId:Pc.string()}))),PS=class extends(es=Pp,ea=PN,es){constructor({message:e="Model not found",statusCode:t=404,modelId:n,cause:r,generationId:i}={}){super({message:e,statusCode:t,cause:r,generationId:i}),this[ea]=!0,this.name=Pw,this.type="model_not_found",this.modelId=n}static isInstance(e){return Pp.hasMarker(e)&&PN in e}},P$="GatewayInternalServerError",PI=Symbol.for(`vercel.ai.gateway.error.${P$}`),PE=class extends(el=Pp,eo=PI,el){constructor({message:e="Internal server error",statusCode:t=500,cause:n,generationId:r}={}){super({message:e,statusCode:t,cause:n,generationId:r}),this[eo]=!0,this.name=P$,this.type="internal_server_error"}static isInstance(e){return Pp.hasMarker(e)&&PI in e}},PC="GatewayFailedDependencyError",PA=Symbol.for(`vercel.ai.gateway.error.${PC}`),PT=class extends(ec=Pp,ed=PA,ec){constructor({message:e="Failed dependency",statusCode:t=424,cause:n,generationId:r}={}){super({message:e,statusCode:t,cause:n,generationId:r}),this[ed]=!0,this.name=PC,this.type="failed_dependency"}static isInstance(e){return Pp.hasMarker(e)&&PA in e}},PP="GatewayForbiddenError",Pz=Symbol.for(`vercel.ai.gateway.error.${PP}`),PO=class extends(em=Pp,eu=Pz,em){constructor({message:e="Forbidden",statusCode:t=403,cause:n,generationId:r}={}){super({message:e,statusCode:t,cause:n,generationId:r}),this[eu]=!0,this.name=PP,this.type="forbidden"}static isInstance(e){return Pp.hasMarker(e)&&Pz in e}},PM="GatewayResponseError",PR=Symbol.for(`vercel.ai.gateway.error.${PM}`),PD=class extends(ef=Pp,ep=PR,ef){constructor({message:e="Invalid response from Gateway",statusCode:t=502,response:n,validationError:r,cause:i,generationId:a}={}){super({message:e,statusCode:t,cause:i,generationId:a}),this[ep]=!0,this.name=PM,this.type="response_error",this.response=n,this.validationError=r}static isInstance(e){return Pp.hasMarker(e)&&PR in e}};async function PL({response:e,statusCode:t,defaultMessage:n="Gateway request failed",cause:r,authMethod:i}){var a;let s=await _w({value:e,schema:PU});if(!s.success){let i="object"==typeof e&&null!==e&&"generationId"in e?e.generationId:void 0;return new PD({message:`Invalid error response format: ${n}`,statusCode:t,response:e,validationError:s.error,cause:r,generationId:i})}let o=s.value,l=o.error.type,d=o.error.message,c=null!=(a=o.generationId)?a:void 0;switch(l){case"authentication_error":return Pg.createContextualError({apiKeyProvided:"api-key"===i,oidcTokenProvided:"oidc"===i,statusCode:t,cause:r,generationId:c});case"invalid_request_error":return new Py({message:d,statusCode:t,cause:r,generationId:c});case"rate_limit_exceeded":return new Pj({message:d,statusCode:t,cause:r,generationId:c});case"model_not_found":{let e=await _w({value:o.error.param,schema:P_});return new PS({message:d,statusCode:t,modelId:e.success?e.value.modelId:void 0,cause:r,generationId:c})}case"internal_server_error":default:return new PE({message:d,statusCode:t,cause:r,generationId:c});case"failed_dependency":return new PT({message:d,statusCode:t,cause:r,generationId:c});case"forbidden":return new PO({message:d,statusCode:t,cause:r,generationId:c})}}var PU=_v(()=>_k(Pc.object({error:Pc.object({message:Pc.string(),type:Pc.string().nullish(),param:Pc.unknown().nullish(),code:Pc.union([Pc.string(),Pc.number()]).nullish()}),generationId:Pc.string().nullish()}))),PZ="GatewayTimeoutError",PF=Symbol.for(`vercel.ai.gateway.error.${PZ}`),PB=class e extends(eg=Pp,eh=PF,eg){constructor({message:e="Request timed out",statusCode:t=408,cause:n,generationId:r}={}){super({message:e,statusCode:t,cause:n,generationId:r}),this[eh]=!0,this.name=PZ,this.type="timeout_error"}static isInstance(e){return Pp.hasMarker(e)&&PF in e}static createTimeoutError({originalMessage:t,statusCode:n=408,cause:r,generationId:i}){return new e({message:`Gateway request timed out: ${t}
408
+
409
+ This is a client-side timeout. To resolve this, increase your timeout configuration: https://vercel.com/docs/ai-gateway/capabilities/video-generation#extending-timeouts-for-node.js`,statusCode:n,cause:r,generationId:i})}};function PV(e){if(!(e instanceof Error))return!1;let t=e.code;return"string"==typeof t&&["UND_ERR_HEADERS_TIMEOUT","UND_ERR_BODY_TIMEOUT","UND_ERR_CONNECT_TIMEOUT"].includes(t)}async function Pq(e,t){var n;return Pp.isInstance(e)?e:PV(e)?PB.createTimeoutError({originalMessage:e instanceof Error?e.message:"Unknown error",cause:e}):bM.isInstance(e)?e.cause&&PV(e.cause)?PB.createTimeoutError({originalMessage:e.message,cause:e}):await PL({response:function(e){if(void 0!==e.data)return e.data;if(null!=e.responseBody)try{return JSON.parse(e.responseBody)}catch(t){return e.responseBody}return{}}(e),statusCode:null!=(n=e.statusCode)?n:500,defaultMessage:"Gateway request failed",cause:e,authMethod:t}):await PL({response:{},statusCode:500,defaultMessage:e instanceof Error?`Gateway request failed: ${e.message}`:"Unknown Gateway error",cause:e,authMethod:t})}var PW="ai-gateway-auth-method";async function PH(e){let t=await _w({value:e[PW],schema:PG});return t.success?t.value:void 0}var PG=_v(()=>_k(Pc.union([Pc.literal("api-key"),Pc.literal("oidc")]))),PK=["embedding","image","language","reranking","video"],PJ=class{constructor(e){this.config=e}async getAvailableModels(){try{let{value:e}=await NH({url:`${this.config.baseURL}/config`,headers:await _A(this.config.headers()),successfulResponseHandler:_P(PY),failedResponseHandler:_T({errorSchema:Pc.any(),errorToMessage:e=>e}),fetch:this.config.fetch});return e}catch(e){throw await Pq(e)}}async getCredits(){try{let e=new URL(this.config.baseURL),{value:t}=await NH({url:`${e.origin}/v1/credits`,headers:await _A(this.config.headers()),successfulResponseHandler:_P(PX),failedResponseHandler:_T({errorSchema:Pc.any(),errorToMessage:e=>e}),fetch:this.config.fetch});return t}catch(e){throw await Pq(e)}}},PY=_v(()=>_k(Pc.object({models:Pc.array(Pc.object({id:Pc.string(),name:Pc.string(),description:Pc.string().nullish(),pricing:Pc.object({input:Pc.string(),output:Pc.string(),input_cache_read:Pc.string().nullish(),input_cache_write:Pc.string().nullish()}).transform(({input:e,output:t,input_cache_read:n,input_cache_write:r})=>({input:e,output:t,...n?{cachedInputTokens:n}:{},...r?{cacheCreationInputTokens:r}:{}})).nullish(),specification:Pc.object({specificationVersion:Pc.literal("v3"),provider:Pc.string(),modelId:Pc.string()}),modelType:Pc.string().nullish()})).transform(e=>e.filter(e=>null==e.modelType||PK.includes(e.modelType)))}))),PX=_v(()=>_k(Pc.object({balance:Pc.string(),total_used:Pc.string()}).transform(({balance:e,total_used:t})=>({balance:e,totalUsed:t})))),PQ=class{constructor(e){this.config=e}async getSpendReport(e){try{let t=new URL(this.config.baseURL),n=new URLSearchParams;n.set("start_date",e.startDate),n.set("end_date",e.endDate),e.groupBy&&n.set("group_by",e.groupBy),e.datePart&&n.set("date_part",e.datePart),e.userId&&n.set("user_id",e.userId),e.model&&n.set("model",e.model),e.provider&&n.set("provider",e.provider),e.credentialType&&n.set("credential_type",e.credentialType),e.tags&&e.tags.length>0&&n.set("tags",e.tags.join(","));let{value:r}=await NH({url:`${t.origin}/v1/report?${n.toString()}`,headers:await _A(this.config.headers()),successfulResponseHandler:_P(P0),failedResponseHandler:_T({errorSchema:Pc.any(),errorToMessage:e=>e}),fetch:this.config.fetch});return r}catch(e){throw await Pq(e)}}},P0=_v(()=>_k(Pc.object({results:Pc.array(Pc.object({day:Pc.string().optional(),hour:Pc.string().optional(),user:Pc.string().optional(),model:Pc.string().optional(),tag:Pc.string().optional(),provider:Pc.string().optional(),credential_type:Pc.enum(["byok","system"]).optional(),total_cost:Pc.number(),market_cost:Pc.number().optional(),input_tokens:Pc.number().optional(),output_tokens:Pc.number().optional(),cached_input_tokens:Pc.number().optional(),cache_creation_input_tokens:Pc.number().optional(),reasoning_tokens:Pc.number().optional(),request_count:Pc.number().optional()}).transform(({credential_type:e,total_cost:t,market_cost:n,input_tokens:r,output_tokens:i,cached_input_tokens:a,cache_creation_input_tokens:s,reasoning_tokens:o,request_count:l,...d})=>({...d,...void 0!==e?{credentialType:e}:{},totalCost:t,...void 0!==n?{marketCost:n}:{},...void 0!==r?{inputTokens:r}:{},...void 0!==i?{outputTokens:i}:{},...void 0!==a?{cachedInputTokens:a}:{},...void 0!==s?{cacheCreationInputTokens:s}:{},...void 0!==o?{reasoningTokens:o}:{},...void 0!==l?{requestCount:l}:{}})))}))),P1=class{constructor(e){this.config=e}async getGenerationInfo(e){try{let t=new URL(this.config.baseURL),{value:n}=await NH({url:`${t.origin}/v1/generation?id=${encodeURIComponent(e.id)}`,headers:await _A(this.config.headers()),successfulResponseHandler:_P(P2),failedResponseHandler:_T({errorSchema:Pc.any(),errorToMessage:e=>e}),fetch:this.config.fetch});return n}catch(e){throw await Pq(e)}}},P2=_v(()=>_k(Pc.object({data:Pc.object({id:Pc.string(),total_cost:Pc.number(),upstream_inference_cost:Pc.number(),usage:Pc.number(),created_at:Pc.string(),model:Pc.string(),is_byok:Pc.boolean(),provider_name:Pc.string(),streamed:Pc.boolean(),finish_reason:Pc.string(),latency:Pc.number(),generation_time:Pc.number(),native_tokens_prompt:Pc.number(),native_tokens_completion:Pc.number(),native_tokens_reasoning:Pc.number(),native_tokens_cached:Pc.number(),native_tokens_cache_creation:Pc.number(),billable_web_search_calls:Pc.number()}).transform(({total_cost:e,upstream_inference_cost:t,created_at:n,is_byok:r,provider_name:i,finish_reason:a,generation_time:s,native_tokens_prompt:o,native_tokens_completion:l,native_tokens_reasoning:d,native_tokens_cached:c,native_tokens_cache_creation:u,billable_web_search_calls:m,...p})=>({...p,totalCost:e,upstreamInferenceCost:t,createdAt:n,isByok:r,providerName:i,finishReason:a,generationTime:s,promptTokens:o,completionTokens:l,reasoningTokens:d,cachedTokens:c,cacheCreationTokens:u,billableWebSearchCalls:m}))}).transform(({data:e})=>e))),P4=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.supportedUrls={"*/*":[/.*/]}}get provider(){return this.config.provider}async getArgs(e){let{abortSignal:t,...n}=e;return{args:this.maybeEncodeFileParts(n),warnings:[]}}async doGenerate(e){let{args:t,warnings:n}=await this.getArgs(e),{abortSignal:r}=e,i=await _A(this.config.headers());try{let{responseHeaders:a,value:s,rawValue:o}=await _I({url:this.getUrl(),headers:Nj(i,e.headers,this.getModelConfigHeaders(this.modelId,!1),await _A(this.config.o11yHeaders)),body:t,successfulResponseHandler:_P(Pc.any()),failedResponseHandler:_T({errorSchema:Pc.any(),errorToMessage:e=>e}),...r&&{abortSignal:r},fetch:this.config.fetch});return{...s,request:{body:t},response:{headers:a,body:o},warnings:n}}catch(e){throw await Pq(e,await PH(i))}}async doStream(e){let{args:t,warnings:n}=await this.getArgs(e),{abortSignal:r}=e,i=await _A(this.config.headers());try{let a,{value:s,responseHeaders:o}=await _I({url:this.getUrl(),headers:Nj(i,e.headers,this.getModelConfigHeaders(this.modelId,!0),await _A(this.config.o11yHeaders)),body:t,successfulResponseHandler:(a=Pc.any(),async({response:e})=>{let t=Nw(e);if(null==e.body)throw new bU({});return{responseHeaders:t,value:_S({stream:e.body,schema:a})}}),failedResponseHandler:_T({errorSchema:Pc.any(),errorToMessage:e=>e}),...r&&{abortSignal:r},fetch:this.config.fetch});return{stream:s.pipeThrough(new TransformStream({start(e){n.length>0&&e.enqueue({type:"stream-start",warnings:n})},transform(t,n){if(t.success){let r=t.value;("raw"!==r.type||e.includeRawChunks)&&("response-metadata"===r.type&&r.timestamp&&"string"==typeof r.timestamp&&(r.timestamp=new Date(r.timestamp)),n.enqueue(r))}else n.error(t.error)}})),request:{body:t},response:{headers:o}}}catch(e){throw await Pq(e,await PH(i))}}isFilePart(e){return e&&"object"==typeof e&&"type"in e&&"file"===e.type}maybeEncodeFileParts(e){for(let t of e.prompt)for(let e of t.content)if(this.isFilePart(e)&&e.data instanceof Uint8Array){let t=Uint8Array.from(e.data),n=bE.Buffer.from(t).toString("base64");e.data=new URL(`data:${e.mediaType||"application/octet-stream"};base64,${n}`)}return e}getUrl(){return`${this.config.baseURL}/language-model`}getModelConfigHeaders(e,t){return{"ai-language-model-specification-version":"3","ai-language-model-id":e,"ai-language-model-streaming":String(t)}}},P5=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0}get provider(){return this.config.provider}async doEmbed({values:e,headers:t,abortSignal:n,providerOptions:r}){var i,a;let s=await _A(this.config.headers());try{let{responseHeaders:o,value:l,rawValue:d}=await _I({url:this.getUrl(),headers:Nj(s,null!=t?t:{},this.getModelConfigHeaders(),await _A(this.config.o11yHeaders)),body:{values:e,...r?{providerOptions:r}:{}},successfulResponseHandler:_P(P3),failedResponseHandler:_T({errorSchema:Pc.any(),errorToMessage:e=>e}),...n&&{abortSignal:n},fetch:this.config.fetch});return{embeddings:l.embeddings,usage:null!=(i=l.usage)?i:void 0,providerMetadata:l.providerMetadata,response:{headers:o,body:d},warnings:null!=(a=l.warnings)?a:[]}}catch(e){throw await Pq(e,await PH(s))}}getUrl(){return`${this.config.baseURL}/embedding-model`}getModelConfigHeaders(){return{"ai-embedding-model-specification-version":"3","ai-model-id":this.modelId}}},P6=Pc.discriminatedUnion("type",[Pc.object({type:Pc.literal("unsupported"),feature:Pc.string(),details:Pc.string().optional()}),Pc.object({type:Pc.literal("compatibility"),feature:Pc.string(),details:Pc.string().optional()}),Pc.object({type:Pc.literal("other"),message:Pc.string()})]),P3=_v(()=>_k(Pc.object({embeddings:Pc.array(Pc.array(Pc.number())),usage:Pc.object({tokens:Pc.number()}).nullish(),warnings:Pc.array(P6).optional(),providerMetadata:Pc.record(Pc.string(),Pc.record(Pc.string(),Pc.unknown())).optional()}))),P9=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxImagesPerCall=Number.MAX_SAFE_INTEGER}get provider(){return this.config.provider}async doGenerate({prompt:e,n:t,size:n,aspectRatio:r,seed:i,files:a,mask:s,providerOptions:o,headers:l,abortSignal:d}){var c,u,m,p;let f=await _A(this.config.headers());try{let{responseHeaders:h,value:g,rawValue:x}=await _I({url:this.getUrl(),headers:Nj(f,null!=l?l:{},this.getModelConfigHeaders(),await _A(this.config.o11yHeaders)),body:{prompt:e,n:t,...n&&{size:n},...r&&{aspectRatio:r},...i&&{seed:i},...o&&{providerOptions:o},...a&&{files:a.map(e=>P8(e))},...s&&{mask:P8(s)}},successfulResponseHandler:_P(zn),failedResponseHandler:_T({errorSchema:Pc.any(),errorToMessage:e=>e}),...d&&{abortSignal:d},fetch:this.config.fetch});return{images:g.images,warnings:null!=(c=g.warnings)?c:[],providerMetadata:g.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:h},...null!=g.usage&&{usage:{inputTokens:null!=(u=g.usage.inputTokens)?u:void 0,outputTokens:null!=(m=g.usage.outputTokens)?m:void 0,totalTokens:null!=(p=g.usage.totalTokens)?p:void 0}}}}catch(e){throw await Pq(e,await PH(f))}}getUrl(){return`${this.config.baseURL}/image-model`}getModelConfigHeaders(){return{"ai-image-model-specification-version":"3","ai-model-id":this.modelId}}};function P8(e){return"file"===e.type&&e.data instanceof Uint8Array?{...e,data:NS(e.data)}:e}var P7=Pc.object({images:Pc.array(Pc.unknown()).optional()}).catchall(Pc.unknown()),ze=Pc.discriminatedUnion("type",[Pc.object({type:Pc.literal("unsupported"),feature:Pc.string(),details:Pc.string().optional()}),Pc.object({type:Pc.literal("compatibility"),feature:Pc.string(),details:Pc.string().optional()}),Pc.object({type:Pc.literal("other"),message:Pc.string()})]),zt=Pc.object({inputTokens:Pc.number().nullish(),outputTokens:Pc.number().nullish(),totalTokens:Pc.number().nullish()}),zn=Pc.object({images:Pc.array(Pc.string()),warnings:Pc.array(ze).optional(),providerMetadata:Pc.record(Pc.string(),P7).optional(),usage:zt.optional()}),zr=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxVideosPerCall=Number.MAX_SAFE_INTEGER}get provider(){return this.config.provider}async doGenerate({prompt:e,n:t,aspectRatio:n,resolution:r,duration:i,fps:a,seed:s,image:o,providerOptions:l,headers:d,abortSignal:c}){var u,m;let p=await _A(this.config.headers());try{let{responseHeaders:f,value:h}=await _I({url:this.getUrl(),headers:Nj(p,null!=d?d:{},this.getModelConfigHeaders(),await _A(this.config.o11yHeaders),{accept:"text/event-stream"}),body:{prompt:e,n:t,...n&&{aspectRatio:n},...r&&{resolution:r},...i&&{duration:i},...a&&{fps:a},...s&&{seed:s},...l&&{providerOptions:l},...o&&{image:(m=o,"file"===m.type&&m.data instanceof Uint8Array?{...m,data:NS(m.data)}:m)}},successfulResponseHandler:async({response:e,url:t,requestBodyValues:n})=>{if(null==e.body)throw new bM({message:"SSE response body is empty",url:t,requestBodyValues:n,statusCode:e.status});let r=_S({stream:e.body,schema:zo}).getReader(),{done:i,value:a}=await r.read();if(r.releaseLock(),i||!a)throw new bM({message:"SSE stream ended without a data event",url:t,requestBodyValues:n,statusCode:e.status});if(!a.success)throw new bM({message:"Failed to parse video SSE event",cause:a.error,url:t,requestBodyValues:n,statusCode:e.status});let s=a.value;if("error"===s.type)throw new bM({message:s.message,statusCode:s.statusCode,url:t,requestBodyValues:n,responseHeaders:Object.fromEntries([...e.headers]),responseBody:JSON.stringify(s),data:{error:{message:s.message,type:s.errorType,param:s.param}}});return{value:{videos:s.videos,warnings:s.warnings,providerMetadata:s.providerMetadata},responseHeaders:Object.fromEntries([...e.headers])}},failedResponseHandler:_T({errorSchema:Pc.any(),errorToMessage:e=>e}),...c&&{abortSignal:c},fetch:this.config.fetch});return{videos:h.videos,warnings:null!=(u=h.warnings)?u:[],providerMetadata:h.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:f}}}catch(e){throw await Pq(e,await PH(p))}}getUrl(){return`${this.config.baseURL}/video-model`}getModelConfigHeaders(){return{"ai-video-model-specification-version":"3","ai-model-id":this.modelId}}},zi=Pc.object({videos:Pc.array(Pc.unknown()).optional()}).catchall(Pc.unknown()),za=Pc.union([Pc.object({type:Pc.literal("url"),url:Pc.string(),mediaType:Pc.string()}),Pc.object({type:Pc.literal("base64"),data:Pc.string(),mediaType:Pc.string()})]),zs=Pc.discriminatedUnion("type",[Pc.object({type:Pc.literal("unsupported"),feature:Pc.string(),details:Pc.string().optional()}),Pc.object({type:Pc.literal("compatibility"),feature:Pc.string(),details:Pc.string().optional()}),Pc.object({type:Pc.literal("other"),message:Pc.string()})]),zo=Pc.discriminatedUnion("type",[Pc.object({type:Pc.literal("result"),videos:Pc.array(za),warnings:Pc.array(zs).optional(),providerMetadata:Pc.record(Pc.string(),zi).optional()}),Pc.object({type:Pc.literal("error"),message:Pc.string(),errorType:Pc.string(),statusCode:Pc.number(),param:Pc.unknown().nullable()})]),zl=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3"}get provider(){return this.config.provider}async doRerank({documents:e,query:t,topN:n,headers:r,abortSignal:i,providerOptions:a}){var s;let o=await _A(this.config.headers());try{let{responseHeaders:l,value:d,rawValue:c}=await _I({url:this.getUrl(),headers:Nj(o,null!=r?r:{},this.getModelConfigHeaders(),await _A(this.config.o11yHeaders)),body:{documents:e,query:t,...null!=n?{topN:n}:{},...a?{providerOptions:a}:{}},successfulResponseHandler:_P(zc),failedResponseHandler:_T({errorSchema:Pc.any(),errorToMessage:e=>e}),...i&&{abortSignal:i},fetch:this.config.fetch});return{ranking:d.ranking,providerMetadata:d.providerMetadata,response:{headers:l,body:c},warnings:null!=(s=d.warnings)?s:[]}}catch(e){throw await Pq(e,await PH(o))}}getUrl(){return`${this.config.baseURL}/reranking-model`}getModelConfigHeaders(){return{"ai-reranking-model-specification-version":"3","ai-model-id":this.modelId}}},zd=Pc.discriminatedUnion("type",[Pc.object({type:Pc.literal("unsupported"),feature:Pc.string(),details:Pc.string().optional()}),Pc.object({type:Pc.literal("compatibility"),feature:Pc.string(),details:Pc.string().optional()}),Pc.object({type:Pc.literal("other"),message:Pc.string()})]),zc=_v(()=>_k(Pc.object({ranking:Pc.array(Pc.object({index:Pc.number(),relevanceScore:Pc.number()})),warnings:Pc.array(zd).optional(),providerMetadata:Pc.record(Pc.string(),Pc.record(Pc.string(),Pc.unknown())).optional()}))),zu=_C({id:"gateway.parallel_search",inputSchema:_v(()=>_k(Pc.object({objective:Pc.string().describe("Natural-language description of the web research goal, including source or freshness guidance and broader context from the task. Maximum 5000 characters."),search_queries:Pc.array(Pc.string()).optional().describe("Optional search queries to supplement the objective. Maximum 200 characters per query."),mode:Pc.enum(["one-shot","agentic"]).optional().describe('Mode preset: "one-shot" for comprehensive results with longer excerpts (default), "agentic" for concise, token-efficient results for multi-step workflows.'),max_results:Pc.number().optional().describe("Maximum number of results to return (1-20). Defaults to 10 if not specified."),source_policy:Pc.object({include_domains:Pc.array(Pc.string()).optional().describe("List of domains to include in search results."),exclude_domains:Pc.array(Pc.string()).optional().describe("List of domains to exclude from search results."),after_date:Pc.string().optional().describe("Only include results published after this date (ISO 8601 format).")}).optional().describe("Source policy for controlling which domains to include/exclude and freshness."),excerpts:Pc.object({max_chars_per_result:Pc.number().optional().describe("Maximum characters per result."),max_chars_total:Pc.number().optional().describe("Maximum total characters across all results.")}).optional().describe("Excerpt configuration for controlling result length."),fetch_policy:Pc.object({max_age_seconds:Pc.number().optional().describe("Maximum age in seconds for cached content. Set to 0 to always fetch fresh content.")}).optional().describe("Fetch policy for controlling content freshness.")}))),outputSchema:_v(()=>_k(Pc.union([Pc.object({searchId:Pc.string(),results:Pc.array(Pc.object({url:Pc.string(),title:Pc.string(),excerpt:Pc.string(),publishDate:Pc.string().nullable().optional(),relevanceScore:Pc.number().optional()}))}),Pc.object({error:Pc.enum(["api_error","rate_limit","timeout","invalid_input","configuration_error","unknown"]),statusCode:Pc.number().optional(),message:Pc.string()})])))}),zm=_C({id:"gateway.perplexity_search",inputSchema:_v(()=>_k(Pc.object({query:Pc.union([Pc.string(),Pc.array(Pc.string())]).describe("Search query (string) or multiple queries (array of up to 5 strings). Multi-query searches return combined results from all queries."),max_results:Pc.number().optional().describe("Maximum number of search results to return (1-20, default: 10)"),max_tokens_per_page:Pc.number().optional().describe("Maximum number of tokens to extract per search result page (256-2048, default: 2048)"),max_tokens:Pc.number().optional().describe("Maximum total tokens across all search results (default: 25000, max: 1000000)"),country:Pc.string().optional().describe("Two-letter ISO 3166-1 alpha-2 country code for regional search results (e.g., 'US', 'GB', 'FR')"),search_domain_filter:Pc.array(Pc.string()).optional().describe("List of domains to include or exclude from search results (max 20). To include: ['nature.com', 'science.org']. To exclude: ['-example.com', '-spam.net']"),search_language_filter:Pc.array(Pc.string()).optional().describe("List of ISO 639-1 language codes to filter results (max 10, lowercase). Examples: ['en', 'fr', 'de']"),search_after_date:Pc.string().optional().describe("Include only results published after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."),search_before_date:Pc.string().optional().describe("Include only results published before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."),last_updated_after_filter:Pc.string().optional().describe("Include only results last updated after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."),last_updated_before_filter:Pc.string().optional().describe("Include only results last updated before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."),search_recency_filter:Pc.enum(["day","week","month","year"]).optional().describe("Filter results by relative time period. Cannot be used with search_after_date or search_before_date.")}))),outputSchema:_v(()=>_k(Pc.union([Pc.object({results:Pc.array(Pc.object({title:Pc.string(),url:Pc.string(),snippet:Pc.string(),date:Pc.string().optional(),lastUpdated:Pc.string().optional()})),id:Pc.string()}),Pc.object({error:Pc.enum(["api_error","rate_limit","timeout","invalid_input","unknown"]),statusCode:Pc.number().optional(),message:Pc.string()})])))}),zp={parallelSearch:(e={})=>zu(e),perplexitySearch:(e={})=>zm(e)};async function zf(){var e;return null==(e=(0,Pu.getContext)().headers)?void 0:e["x-vercel-id"]}async function zh(e){let t=NG({settingValue:e.apiKey,environmentVariableName:"AI_GATEWAY_API_KEY"});return t?{token:t,authMethod:"api-key"}:{token:await (0,Pu.getVercelOidcToken)(),authMethod:"oidc"}}!function(e={}){var t,n,r;let i=null,a=null,s=null!=(t=e.metadataCacheRefreshMillis)?t:3e5,o=0,l=null!=(n=null==(r=e.baseURL)?void 0:r.replace(/\/$/,""))?n:"https://ai-gateway.vercel.sh/v3/ai",d=async()=>{try{let t=await zh(e);return NV({Authorization:`Bearer ${t.token}`,"ai-gateway-protocol-version":"0.0.1",[PW]:t.authMethod,...e.headers},"ai-sdk/gateway/3.0.133")}catch(e){throw Pg.createContextualError({apiKeyProvided:!1,oidcTokenProvided:!1,statusCode:401,cause:e})}},c=()=>{let e=NG({settingValue:void 0,environmentVariableName:"VERCEL_DEPLOYMENT_ID"}),t=NG({settingValue:void 0,environmentVariableName:"VERCEL_ENV"}),n=NG({settingValue:void 0,environmentVariableName:"VERCEL_REGION"}),r=NG({settingValue:void 0,environmentVariableName:"VERCEL_PROJECT_ID"});return async()=>{let i=await zf();return{...e&&{"ai-o11y-deployment-id":e},...t&&{"ai-o11y-environment":t},...n&&{"ai-o11y-region":n},...i&&{"ai-o11y-request-id":i},...r&&{"ai-o11y-project-id":r}}}},u=t=>new P4(t,{provider:"gateway",baseURL:l,headers:d,fetch:e.fetch,o11yHeaders:c()}),m=async()=>{var t,n,r;let c=null!=(r=null==(n=null==(t=e._internal)?void 0:t.currentDate)?void 0:n.call(t).getTime())?r:Date.now();return(!i||c-o>s)&&(o=c,i=new PJ({baseURL:l,headers:d,fetch:e.fetch}).getAvailableModels().then(e=>(a=e,e)).catch(async e=>{throw await Pq(e,await PH(await d()))})),a?Promise.resolve(a):i},p=async()=>new PJ({baseURL:l,headers:d,fetch:e.fetch}).getCredits().catch(async e=>{throw await Pq(e,await PH(await d()))}),f=async t=>new PQ({baseURL:l,headers:d,fetch:e.fetch}).getSpendReport(t).catch(async e=>{throw await Pq(e,await PH(await d()))}),h=async t=>new P1({baseURL:l,headers:d,fetch:e.fetch}).getGenerationInfo(t).catch(async e=>{throw await Pq(e,await PH(await d()))}),g=function(e){if(new.target)throw Error("The Gateway Provider model function cannot be called with the new keyword.");return u(e)};g.specificationVersion="v3",g.getAvailableModels=m,g.getCredits=p,g.getSpendReport=f,g.getGenerationInfo=h,g.imageModel=t=>new P9(t,{provider:"gateway",baseURL:l,headers:d,fetch:e.fetch,o11yHeaders:c()}),g.languageModel=u;let x=t=>new P5(t,{provider:"gateway",baseURL:l,headers:d,fetch:e.fetch,o11yHeaders:c()});g.embeddingModel=x,g.textEmbeddingModel=x,g.videoModel=t=>new zr(t,{provider:"gateway",baseURL:l,headers:d,fetch:e.fetch,o11yHeaders:c()});let v=t=>new zl(t,{provider:"gateway",baseURL:l,headers:d,fetch:e.fetch,o11yHeaders:c()});g.rerankingModel=v,g.reranking=v,g.chat=g.languageModel,g.embedding=g.embeddingModel,g.image=g.imageModel,g.video=g.videoModel,g.tools=zp}();var Pc=Pc;let zg="1.9.1",zx=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/,zv=function(e){let t=new Set([e]),n=new Set,r=e.match(zx);if(!r)return()=>!1;let i={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(null!=i.prerelease)return function(t){return t===e};function a(e){return n.add(e),!1}return function(e){if(t.has(e))return!0;if(n.has(e))return!1;let r=e.match(zx);if(!r)return a(e);let s={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(null!=s.prerelease||i.major!==s.major)return a(e);if(0===i.major)return i.minor===s.minor&&i.patch<=s.patch?(t.add(e),!0):a(e);return i.minor<=s.minor?(t.add(e),!0):a(e)}}(zg),zy=zg.split(".")[0],zb=Symbol.for(`opentelemetry.js.api.${zy}`),zk="object"==typeof globalThis?globalThis:"object"==typeof self?self:"object"==typeof window?window:e.g;function zj(e,t,n,r=!1){var i;let a=zk[zb]=null!=(i=zk[zb])?i:{version:zg};if(!r&&a[e]){let t=Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(t.stack||t.message),!1}if(a.version!==zg){let t=Error(`@opentelemetry/api: Registration of version v${a.version} for ${e} does not match previously registered API v${zg}`);return n.error(t.stack||t.message),!1}return a[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${zg}.`),!0}function zw(e){var t,n;let r=null==(t=zk[zb])?void 0:t.version;if(r&&zv(r))return null==(n=zk[zb])?void 0:n[e]}function zN(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${zg}.`);let n=zk[zb];n&&delete n[e]}class z_{constructor(e){const t=this;t._currentContext=e?new Map(e):new Map,t.getValue=e=>t._currentContext.get(e),t.setValue=(e,n)=>{let r=new z_(t._currentContext);return r._currentContext.set(e,n),r},t.deleteValue=e=>{let n=new z_(t._currentContext);return n._currentContext.delete(e),n}}}let zS=new z_;class z${constructor(e){this._namespace=e.namespace||"DiagComponentLogger"}debug(...e){return zI("debug",this._namespace,e)}error(...e){return zI("error",this._namespace,e)}info(...e){return zI("info",this._namespace,e)}warn(...e){return zI("warn",this._namespace,e)}verbose(...e){return zI("verbose",this._namespace,e)}}function zI(e,t,n){let r=zw("diag");if(r)return r[e](t,...n)}(_=ex||(ex={}))[_.NONE=0]="NONE",_[_.ERROR=30]="ERROR",_[_.WARN=50]="WARN",_[_.INFO=60]="INFO",_[_.DEBUG=70]="DEBUG",_[_.VERBOSE=80]="VERBOSE",_[_.ALL=9999]="ALL";class zE{static instance(){return this._instance||(this._instance=new zE),this._instance}constructor(){function e(e){return function(...t){let n=zw("diag");if(n)return n[e](...t)}}const t=this,n=(e,n={logLevel:ex.INFO})=>{var r,i,a;if(e===t){let e=Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return t.error(null!=(r=e.stack)?r:e.message),!1}"number"==typeof n&&(n={logLevel:n});let s=zw("diag"),o=function(e,t){function n(n,r){let i=t[n];return"function"==typeof i&&e>=r?i.bind(t):function(){}}return e<ex.NONE?e=ex.NONE:e>ex.ALL&&(e=ex.ALL),t=t||{},{error:n("error",ex.ERROR),warn:n("warn",ex.WARN),info:n("info",ex.INFO),debug:n("debug",ex.DEBUG),verbose:n("verbose",ex.VERBOSE)}}(null!=(i=n.logLevel)?i:ex.INFO,e);if(s&&!n.suppressOverrideMessage){let e=null!=(a=Error().stack)?a:"<failed to generate stacktrace>";s.warn(`Current logger will be overwritten from ${e}`),o.warn(`Current logger will overwrite one already registered from ${e}`)}return zj("diag",o,t,!0)};t.setLogger=n,t.disable=()=>{zN("diag",t)},t.createComponentLogger=e=>new z$(e),t.verbose=e("verbose"),t.debug=e("debug"),t.info=e("info"),t.warn=e("warn"),t.error=e("error")}}let zC="context",zA=new class{active(){return zS}with(e,t,n,...r){return t.call(n,...r)}bind(e,t){return t}enable(){return this}disable(){return this}};class zT{static getInstance(){return this._instance||(this._instance=new zT),this._instance}setGlobalContextManager(e){return zj(zC,e,zE.instance())}active(){return this._getContextManager().active()}with(e,t,n,...r){return this._getContextManager().with(e,t,n,...r)}bind(e,t){return this._getContextManager().bind(e,t)}_getContextManager(){return zw(zC)||zA}disable(){this._getContextManager().disable(),zN(zC,zE.instance())}}(S=ev||(ev={}))[S.NONE=0]="NONE",S[S.SAMPLED=1]="SAMPLED";let zP="0000000000000000",zz="00000000000000000000000000000000",zO={traceId:zz,spanId:zP,traceFlags:ev.NONE};class zM{constructor(e=zO){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}}let zR=Symbol.for("OpenTelemetry Context Key SPAN");function zD(e){return e.getValue(zR)||void 0}function zL(){return zD(zT.getInstance().active())}function zU(e,t){return e.setValue(zR,t)}function zZ(e){return e.deleteValue(zR)}function zF(e,t){return zU(e,new zM(t))}function zB(e){var t;return null==(t=zD(e))?void 0:t.spanContext()}let zV=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function zq(e,t){if("string"!=typeof e||e.length!==t)return!1;let n=0;for(let t=0;t<e.length;t+=4)n+=(0|zV[e.charCodeAt(t)])+(0|zV[e.charCodeAt(t+1)])+(0|zV[e.charCodeAt(t+2)])+(0|zV[e.charCodeAt(t+3)]);return n===t}function zW(e){var t,n;return zq(t=e.traceId,32)&&t!==zz&&zq(n=e.spanId,16)&&n!==zP}function zH(e){return new zM(e)}let zG=zT.getInstance();class zK{startSpan(e,t,n=zG.active()){var r;if(null==t?void 0:t.root)return new zM;let i=n&&zB(n);return null!==(r=i)&&"object"==typeof r&&"spanId"in r&&"string"==typeof r.spanId&&"traceId"in r&&"string"==typeof r.traceId&&"traceFlags"in r&&"number"==typeof r.traceFlags&&zW(i)?new zM(i):new zM}startActiveSpan(e,t,n,r){let i,a,s;if(arguments.length<2)return;2==arguments.length?s=t:3==arguments.length?(i=t,s=n):(i=t,a=n,s=r);let o=null!=a?a:zG.active(),l=this.startSpan(e,i,o),d=zU(o,l);return zG.with(d,s,void 0,l)}}let zJ=new zK;class zY{constructor(e,t,n,r){this._provider=e,this.name=t,this.version=n,this.options=r}startSpan(e,t,n){return this._getTracer().startSpan(e,t,n)}startActiveSpan(e,t,n,r){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):zJ}}let zX=new class{getTracer(e,t,n){return new zK}};class zQ{getTracer(e,t,n){var r;return null!=(r=this.getDelegateTracer(e,t,n))?r:new zY(this,e,t,n)}getDelegate(){var e;return null!=(e=this._delegate)?e:zX}setDelegate(e){this._delegate=e}getDelegateTracer(e,t,n){var r;return null==(r=this._delegate)?void 0:r.getTracer(e,t,n)}}let z0="trace";class z1{constructor(){this._proxyTracerProvider=new zQ,this.wrapSpanContext=zH,this.isSpanContextValid=zW,this.deleteSpan=zZ,this.getSpan=zD,this.getActiveSpan=zL,this.getSpanContext=zB,this.setSpan=zU,this.setSpanContext=zF}static getInstance(){return this._instance||(this._instance=new z1),this._instance}setGlobalTracerProvider(e){let t=zj(z0,this._proxyTracerProvider,zE.instance());return t&&this._proxyTracerProvider.setDelegate(e),t}getTracerProvider(){return zw(z0)||this._proxyTracerProvider}getTracer(e,t){return this.getTracerProvider().getTracer(e,t)}disable(){zN(z0,zE.instance()),this._proxyTracerProvider=new zQ}}z1.getInstance(),($=ey||(ey={}))[$.UNSET=0]="UNSET",$[$.OK=1]="OK",$[$.ERROR=2]="ERROR",zT.getInstance();var z2=Object.defineProperty,z4=(Symbol.for("vercel.ai.error.AI_InvalidArgumentError"),Symbol.for("vercel.ai.error.AI_InvalidStreamPartError"),Symbol.for("vercel.ai.error.AI_InvalidToolApprovalError"),Symbol.for("vercel.ai.error.AI_InvalidToolApprovalSignatureError"),Symbol.for("vercel.ai.error.AI_InvalidToolInputError"),Symbol.for("vercel.ai.error.AI_ToolCallNotFoundForApprovalError"),Symbol.for("vercel.ai.error.AI_MissingToolResultsError"),Symbol.for("vercel.ai.error.AI_NoImageGeneratedError"),"AI_NoObjectGeneratedError"),z5=`vercel.ai.error.${z4}`,z6=Symbol.for(z5),z3=class extends bT{constructor({message:e="No object generated.",cause:t,text:n,response:r,usage:i,finishReason:a}){super({name:z4,message:e,cause:t}),this[eb]=!0,this.text=n,this.response=r,this.usage=i,this.finishReason=a}static isInstance(e){return bT.hasMarker(e,z5)}};eb=z6,Symbol.for("vercel.ai.error.AI_NoOutputGeneratedError"),Symbol.for("vercel.ai.error.AI_NoSpeechGeneratedError"),Symbol.for("vercel.ai.error.AI_NoTranscriptGeneratedError"),Symbol.for("vercel.ai.error.AI_NoVideoGeneratedError"),Symbol.for("vercel.ai.error.AI_NoSuchToolError"),Symbol.for("vercel.ai.error.AI_ToolCallRepairError");var z9="AI_UIMessageStreamError",z8=`vercel.ai.error.${z9}`,z7=Symbol.for(z8),Oe=class extends bT{constructor({chunkType:e,chunkId:t,message:n}){super({name:z9,message:n}),this[ek]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return bT.hasMarker(e,z8)}};ek=z7,Symbol.for("vercel.ai.error.AI_InvalidDataContentError"),Symbol.for("vercel.ai.error.AI_InvalidMessageRoleError"),Symbol.for("vercel.ai.error.AI_MessageConversionError"),Symbol.for("vercel.ai.error.AI_RetryError");var Ot=async({url:e,maxBytes:t,abortSignal:n})=>{var r;let i=e.toString();try{let e=NV({},"ai-sdk/6.0.208",NF()),a=await Nz({url:i,headers:e,abortSignal:n});if(!a.ok)throw await N$(a),new NA({url:i,statusCode:a.status,statusText:a.statusText});return{data:await NO({response:a,url:i,maxBytes:null!=t?t:0x80000000}),mediaType:null!=(r=a.headers.get("content-type"))?r:void 0}}catch(e){if(NA.isInstance(e))throw e;throw new NA({url:i,cause:e})}},On=Pc.union([Pc.string(),Pc.instanceof(Uint8Array),Pc.instanceof(ArrayBuffer),Pc.custom(e=>{var t,n;return null!=(n=null==(t=globalThis.Buffer)?void 0:t.isBuffer(e))&&n},{message:"Must be a Buffer"})]),Or=Pc.lazy(()=>Pc.union([Pc.null(),Pc.string(),Pc.number(),Pc.boolean(),Pc.record(Pc.string(),Or.optional()),Pc.array(Or)])),Oi=Pc.record(Pc.string(),Pc.record(Pc.string(),Or.optional())),Oa=Pc.object({type:Pc.literal("text"),text:Pc.string(),providerOptions:Oi.optional()}),Os=Pc.object({type:Pc.literal("image"),image:Pc.union([On,Pc.instanceof(URL)]),mediaType:Pc.string().optional(),providerOptions:Oi.optional()}),Oo=Pc.object({type:Pc.literal("file"),data:Pc.union([On,Pc.instanceof(URL)]),filename:Pc.string().optional(),mediaType:Pc.string(),providerOptions:Oi.optional()}),Ol=Pc.object({type:Pc.literal("reasoning"),text:Pc.string(),providerOptions:Oi.optional()}),Od=Pc.object({type:Pc.literal("tool-call"),toolCallId:Pc.string(),toolName:Pc.string(),input:Pc.unknown(),providerOptions:Oi.optional(),providerExecuted:Pc.boolean().optional()}),Oc=Pc.discriminatedUnion("type",[Pc.object({type:Pc.literal("text"),value:Pc.string(),providerOptions:Oi.optional()}),Pc.object({type:Pc.literal("json"),value:Or,providerOptions:Oi.optional()}),Pc.object({type:Pc.literal("execution-denied"),reason:Pc.string().optional(),providerOptions:Oi.optional()}),Pc.object({type:Pc.literal("error-text"),value:Pc.string(),providerOptions:Oi.optional()}),Pc.object({type:Pc.literal("error-json"),value:Or,providerOptions:Oi.optional()}),Pc.object({type:Pc.literal("content"),value:Pc.array(Pc.union([Pc.object({type:Pc.literal("text"),text:Pc.string(),providerOptions:Oi.optional()}),Pc.object({type:Pc.literal("media"),data:Pc.string(),mediaType:Pc.string()}),Pc.object({type:Pc.literal("file-data"),data:Pc.string(),mediaType:Pc.string(),filename:Pc.string().optional(),providerOptions:Oi.optional()}),Pc.object({type:Pc.literal("file-url"),url:Pc.string(),providerOptions:Oi.optional()}),Pc.object({type:Pc.literal("file-id"),fileId:Pc.union([Pc.string(),Pc.record(Pc.string(),Pc.string())]),providerOptions:Oi.optional()}),Pc.object({type:Pc.literal("image-data"),data:Pc.string(),mediaType:Pc.string(),providerOptions:Oi.optional()}),Pc.object({type:Pc.literal("image-url"),url:Pc.string(),providerOptions:Oi.optional()}),Pc.object({type:Pc.literal("image-file-id"),fileId:Pc.union([Pc.string(),Pc.record(Pc.string(),Pc.string())]),providerOptions:Oi.optional()}),Pc.object({type:Pc.literal("custom"),providerOptions:Oi.optional()})]))})]),Ou=Pc.object({type:Pc.literal("tool-result"),toolCallId:Pc.string(),toolName:Pc.string(),output:Oc,providerOptions:Oi.optional()}),Om=Pc.object({type:Pc.literal("tool-approval-request"),approvalId:Pc.string(),toolCallId:Pc.string()}),Op=Pc.object({type:Pc.literal("tool-approval-response"),approvalId:Pc.string(),approved:Pc.boolean(),reason:Pc.string().optional()}),Of=Pc.object({role:Pc.literal("system"),content:Pc.string(),providerOptions:Oi.optional()}),Oh=Pc.object({role:Pc.literal("user"),content:Pc.union([Pc.string(),Pc.array(Pc.union([Oa,Os,Oo]))]),providerOptions:Oi.optional()}),Og=Pc.object({role:Pc.literal("assistant"),content:Pc.union([Pc.string(),Pc.array(Pc.union([Oa,Oo,Ol,Od,Ou,Om]))]),providerOptions:Oi.optional()}),Ox=Pc.object({role:Pc.literal("tool"),content:Pc.array(Pc.union([Ou,Op])),providerOptions:Oi.optional()});Pc.union([Of,Oh,Og,Ox]),new TextEncoder;var Ov={},Oy={array:()=>ON,choice:()=>O_,json:()=>OS,object:()=>Ow,text:()=>Oj};for(var Ob in Oy)z2(Ov,Ob,{get:Oy[Ob],enumerable:!0});async function Ok(e){if(void 0===e)return{value:void 0,state:"undefined-input"};let t=await __({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await __({text:function(e){let t=["ROOT"],n=-1,r=null,i=0;function a(e,i,a){switch(e){case'"':n=i,t.pop(),t.push(a),t.push("INSIDE_STRING");break;case"f":case"t":case"n":n=i,r=i,t.pop(),t.push(a),t.push("INSIDE_LITERAL");break;case"-":t.pop(),t.push(a),t.push("INSIDE_NUMBER");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=i,t.pop(),t.push(a),t.push("INSIDE_NUMBER");break;case"{":n=i,t.pop(),t.push(a),t.push("INSIDE_OBJECT_START");break;case"[":n=i,t.pop(),t.push(a),t.push("INSIDE_ARRAY_START")}}function s(e,r){switch(e){case",":t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break;case"}":n=r,t.pop()}}function o(e,r){switch(e){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=r,t.pop()}}for(let l=0;l<e.length;l++){let d=e[l];switch(t[t.length-1]){case"ROOT":a(d,l,"FINISH");break;case"INSIDE_OBJECT_START":switch(d){case'"':t.pop(),t.push("INSIDE_OBJECT_KEY");break;case"}":n=l,t.pop()}break;case"INSIDE_OBJECT_AFTER_COMMA":'"'===d&&(t.pop(),t.push("INSIDE_OBJECT_KEY"));break;case"INSIDE_OBJECT_KEY":'"'===d&&(t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY"));break;case"INSIDE_OBJECT_AFTER_KEY":":"===d&&(t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE"));break;case"INSIDE_OBJECT_BEFORE_VALUE":a(d,l,"INSIDE_OBJECT_AFTER_VALUE");break;case"INSIDE_OBJECT_AFTER_VALUE":s(d,l);break;case"INSIDE_STRING":switch(d){case'"':t.pop(),n=l;break;case"\\":t.push("INSIDE_STRING_ESCAPE");break;default:n=l}break;case"INSIDE_ARRAY_START":"]"===d?(n=l,t.pop()):(n=l,a(d,l,"INSIDE_ARRAY_AFTER_VALUE"));break;case"INSIDE_ARRAY_AFTER_VALUE":switch(d){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":n=l,t.pop();break;default:n=l}break;case"INSIDE_ARRAY_AFTER_COMMA":a(d,l,"INSIDE_ARRAY_AFTER_VALUE");break;case"INSIDE_STRING_ESCAPE":t.pop(),"u"===d?(i=0,t.push("INSIDE_STRING_UNICODE_ESCAPE")):n=l;break;case"INSIDE_STRING_UNICODE_ESCAPE":(d>="0"&&d<="9"||d>="A"&&d<="F"||d>="a"&&d<="f")&&4==++i&&(t.pop(),n=l);break;case"INSIDE_NUMBER":switch(d){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":n=l;break;case"e":case"E":case"-":case".":break;case",":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&o(d,l),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&s(d,l);break;case"}":t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]&&s(d,l);break;case"]":t.pop(),"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&o(d,l);break;default:t.pop()}break;case"INSIDE_LITERAL":{let i=e.substring(r,l+1);"false".startsWith(i)||"true".startsWith(i)||"null".startsWith(i)?n=l:(t.pop(),"INSIDE_OBJECT_AFTER_VALUE"===t[t.length-1]?s(d,l):"INSIDE_ARRAY_AFTER_VALUE"===t[t.length-1]&&o(d,l))}}}let l=e.slice(0,n+1);for(let n=t.length-1;n>=0;n--)switch(t[n]){case"INSIDE_STRING":l+='"';break;case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":l+="}";break;case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":l+="]";break;case"INSIDE_LITERAL":{let t=e.substring(r,e.length);"true".startsWith(t)?l+="true".slice(t.length):"false".startsWith(t)?l+="false".slice(t.length):"null".startsWith(t)&&(l+="null".slice(t.length))}}return l}(e)})).success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"}}var Oj=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),parseCompleteOutput:async({text:e})=>e,parsePartialOutput:async({text:e})=>({partial:e}),createElementStreamTransform(){}}),Ow=({schema:e,name:t,description:n})=>{let r=_b(e);return{name:"object",responseFormat:_A(r.jsonSchema).then(e=>({type:"json",schema:e,...null!=t&&{name:t},...null!=n&&{description:n}})),async parseCompleteOutput({text:e},t){let n=await __({text:e});if(!n.success)throw new z3({message:"No object generated: could not parse the response.",cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let i=await _w({value:n.value,schema:r});if(!i.success)throw new z3({message:"No object generated: response did not match schema.",cause:i.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return i.value},async parsePartialOutput({text:e}){let t=await Ok(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:t.value}}},createElementStreamTransform(){}}},ON=({element:e,name:t,description:n})=>{let r=_b(e);return{name:"array",responseFormat:_A(r.jsonSchema).then(e=>{let{$schema:r,...i}=e;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:i}},required:["elements"],additionalProperties:!1},...null!=t&&{name:t},...null!=n&&{description:n}}}),async parseCompleteOutput({text:e},t){let n=await __({text:e});if(!n.success)throw new z3({message:"No object generated: could not parse the response.",cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let i=n.value;if(null==i||"object"!=typeof i||!("elements"in i)||!Array.isArray(i.elements))throw new z3({message:"No object generated: response did not match schema.",cause:new b1({value:i,cause:"response must be an object with an elements array"}),text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});for(let n of i.elements){let i=await _w({value:n,schema:r});if(!i.success)throw new z3({message:"No object generated: response did not match schema.",cause:i.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason})}return i.elements},async parsePartialOutput({text:e}){let t=await Ok(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let e=t.value;if(null==e||"object"!=typeof e||!("elements"in e)||!Array.isArray(e.elements))return;let n="repaired-parse"===t.state&&e.elements.length>0?e.elements.slice(0,-1):e.elements,i=[];for(let e of n){let t=await _w({value:e,schema:r});t.success&&i.push(t.value)}return{partial:i}}}},createElementStreamTransform(){let e=0;return new TransformStream({transform({partialOutput:t},n){if(null!=t)for(;e<t.length;e++)n.enqueue(t[e])}})}}},O_=({options:e,name:t,description:n})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:e}},required:["result"],additionalProperties:!1},...null!=t&&{name:t},...null!=n&&{description:n}}),async parseCompleteOutput({text:t},n){let r=await __({text:t});if(!r.success)throw new z3({message:"No object generated: could not parse the response.",cause:r.error,text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});let i=r.value;if(null==i||"object"!=typeof i||!("result"in i)||"string"!=typeof i.result||!e.includes(i.result))throw new z3({message:"No object generated: response did not match schema.",cause:new b1({value:i,cause:"response must be an object that contains a choice value."}),text:t,response:n.response,usage:n.usage,finishReason:n.finishReason});return i.result},async parsePartialOutput({text:t}){let n=await Ok(t);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let t=n.value;if(null==t||"object"!=typeof t||!("result"in t)||"string"!=typeof t.result)return;let r=e.filter(e=>e.startsWith(t.result));if("successful-parse"===n.state)return r.includes(t.result)?{partial:t.result}:void 0;return 1===r.length?{partial:r[0]}:void 0}}},createElementStreamTransform(){}}),OS=({name:e,description:t}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...null!=e&&{name:e},...null!=t&&{description:t}}),async parseCompleteOutput({text:e},t){let n=await __({text:e});if(!n.success)throw new z3({message:"No object generated: could not parse the response.",cause:n.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return n.value},async parsePartialOutput({text:e}){let t=await Ok(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return void 0===t.value?void 0:{partial:t.value}}},createElementStreamTransform(){}});NM({prefix:"aitxt",size:24}),TransformStream;var O$=Pc.record(Pc.string(),Or.optional()),OI=_v(()=>_k(Pc.union([Pc.strictObject({type:Pc.literal("text-start"),id:Pc.string(),providerMetadata:Oi.optional()}),Pc.strictObject({type:Pc.literal("text-delta"),id:Pc.string(),delta:Pc.string(),providerMetadata:Oi.optional()}),Pc.strictObject({type:Pc.literal("text-end"),id:Pc.string(),providerMetadata:Oi.optional()}),Pc.strictObject({type:Pc.literal("error"),errorText:Pc.string()}),Pc.strictObject({type:Pc.literal("tool-input-start"),toolCallId:Pc.string(),toolName:Pc.string(),providerExecuted:Pc.boolean().optional(),providerMetadata:Oi.optional(),toolMetadata:O$.optional(),dynamic:Pc.boolean().optional(),title:Pc.string().optional()}),Pc.strictObject({type:Pc.literal("tool-input-delta"),toolCallId:Pc.string(),inputTextDelta:Pc.string()}),Pc.strictObject({type:Pc.literal("tool-input-available"),toolCallId:Pc.string(),toolName:Pc.string(),input:Pc.unknown(),providerExecuted:Pc.boolean().optional(),providerMetadata:Oi.optional(),toolMetadata:O$.optional(),dynamic:Pc.boolean().optional(),title:Pc.string().optional()}),Pc.strictObject({type:Pc.literal("tool-input-error"),toolCallId:Pc.string(),toolName:Pc.string(),input:Pc.unknown(),providerExecuted:Pc.boolean().optional(),providerMetadata:Oi.optional(),toolMetadata:O$.optional(),dynamic:Pc.boolean().optional(),errorText:Pc.string(),title:Pc.string().optional()}),Pc.strictObject({type:Pc.literal("tool-approval-request"),approvalId:Pc.string(),toolCallId:Pc.string(),signature:Pc.string().optional()}),Pc.strictObject({type:Pc.literal("tool-output-available"),toolCallId:Pc.string(),output:Pc.unknown(),providerExecuted:Pc.boolean().optional(),providerMetadata:Oi.optional(),toolMetadata:O$.optional(),dynamic:Pc.boolean().optional(),preliminary:Pc.boolean().optional()}),Pc.strictObject({type:Pc.literal("tool-output-error"),toolCallId:Pc.string(),errorText:Pc.string(),providerExecuted:Pc.boolean().optional(),providerMetadata:Oi.optional(),toolMetadata:O$.optional(),dynamic:Pc.boolean().optional()}),Pc.strictObject({type:Pc.literal("tool-output-denied"),toolCallId:Pc.string()}),Pc.strictObject({type:Pc.literal("reasoning-start"),id:Pc.string(),providerMetadata:Oi.optional()}),Pc.strictObject({type:Pc.literal("reasoning-delta"),id:Pc.string(),delta:Pc.string(),providerMetadata:Oi.optional()}),Pc.strictObject({type:Pc.literal("reasoning-end"),id:Pc.string(),providerMetadata:Oi.optional()}),Pc.strictObject({type:Pc.literal("source-url"),sourceId:Pc.string(),url:Pc.string(),title:Pc.string().optional(),providerMetadata:Oi.optional()}),Pc.strictObject({type:Pc.literal("source-document"),sourceId:Pc.string(),mediaType:Pc.string(),title:Pc.string(),filename:Pc.string().optional(),providerMetadata:Oi.optional()}),Pc.strictObject({type:Pc.literal("file"),url:Pc.string(),mediaType:Pc.string(),providerMetadata:Oi.optional()}),Pc.strictObject({type:Pc.custom(e=>"string"==typeof e&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:Pc.string().optional(),data:Pc.unknown(),transient:Pc.boolean().optional()}),Pc.strictObject({type:Pc.literal("start-step")}),Pc.strictObject({type:Pc.literal("finish-step")}),Pc.strictObject({type:Pc.literal("start"),messageId:Pc.string().optional(),messageMetadata:Pc.unknown().optional()}),Pc.strictObject({type:Pc.literal("finish"),finishReason:Pc.enum(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:Pc.unknown().optional()}),Pc.strictObject({type:Pc.literal("abort"),reason:Pc.string().optional()}),Pc.strictObject({type:Pc.literal("message-metadata"),messageMetadata:Pc.unknown()})])));function OE(){return Object.create(null)}function OC(e){return e.type.startsWith("tool-")}function OA(e){return OC(e)||"dynamic-tool"===e.type}function OT(e){return e.type.split("-").slice(1).join("-")}async function OP({stream:e,onError:t}){let n=e.getReader();try{for(;;){let{done:e}=await n.read();if(e)break}}catch(e){null==t||t(e)}finally{n.releaseLock()}}NM({prefix:"aitxt",size:24});var Oz=Pc.record(Pc.string(),Or.optional());function OO(e){return({url:t,abortSignal:n})=>Ot({url:t,maxBytes:null==e?void 0:e.maxBytes,abortSignal:n})}_v(()=>_k(Pc.array(Pc.object({id:Pc.string(),role:Pc.enum(["system","user","assistant"]),metadata:Pc.unknown().optional(),parts:Pc.array(Pc.union([Pc.object({type:Pc.literal("text"),text:Pc.string(),state:Pc.enum(["streaming","done"]).optional(),providerMetadata:Oi.optional()}),Pc.object({type:Pc.literal("reasoning"),text:Pc.string(),state:Pc.enum(["streaming","done"]).optional(),providerMetadata:Oi.optional()}),Pc.object({type:Pc.literal("source-url"),sourceId:Pc.string(),url:Pc.string(),title:Pc.string().optional(),providerMetadata:Oi.optional()}),Pc.object({type:Pc.literal("source-document"),sourceId:Pc.string(),mediaType:Pc.string(),title:Pc.string(),filename:Pc.string().optional(),providerMetadata:Oi.optional()}),Pc.object({type:Pc.literal("file"),mediaType:Pc.string(),filename:Pc.string().optional(),url:Pc.string(),providerMetadata:Oi.optional()}),Pc.object({type:Pc.literal("step-start")}),Pc.object({type:Pc.string().startsWith("data-"),id:Pc.string().optional(),data:Pc.unknown()}),Pc.object({type:Pc.literal("dynamic-tool"),toolName:Pc.string(),toolCallId:Pc.string(),toolMetadata:Oz.optional(),state:Pc.literal("input-streaming"),input:Pc.unknown().optional(),providerExecuted:Pc.boolean().optional(),callProviderMetadata:Oi.optional(),output:Pc.never().optional(),errorText:Pc.never().optional(),approval:Pc.never().optional()}),Pc.object({type:Pc.literal("dynamic-tool"),toolName:Pc.string(),toolCallId:Pc.string(),toolMetadata:Oz.optional(),state:Pc.literal("input-available"),input:Pc.unknown(),providerExecuted:Pc.boolean().optional(),output:Pc.never().optional(),errorText:Pc.never().optional(),callProviderMetadata:Oi.optional(),approval:Pc.never().optional()}),Pc.object({type:Pc.literal("dynamic-tool"),toolName:Pc.string(),toolCallId:Pc.string(),toolMetadata:Oz.optional(),state:Pc.literal("approval-requested"),input:Pc.unknown(),providerExecuted:Pc.boolean().optional(),output:Pc.never().optional(),errorText:Pc.never().optional(),callProviderMetadata:Oi.optional(),approval:Pc.object({id:Pc.string(),approved:Pc.never().optional(),reason:Pc.never().optional(),signature:Pc.string().optional()})}),Pc.object({type:Pc.literal("dynamic-tool"),toolName:Pc.string(),toolCallId:Pc.string(),toolMetadata:Oz.optional(),state:Pc.literal("approval-responded"),input:Pc.unknown(),providerExecuted:Pc.boolean().optional(),output:Pc.never().optional(),errorText:Pc.never().optional(),callProviderMetadata:Oi.optional(),approval:Pc.object({id:Pc.string(),approved:Pc.boolean(),reason:Pc.string().optional(),signature:Pc.string().optional()})}),Pc.object({type:Pc.literal("dynamic-tool"),toolName:Pc.string(),toolCallId:Pc.string(),toolMetadata:Oz.optional(),state:Pc.literal("output-available"),input:Pc.unknown(),providerExecuted:Pc.boolean().optional(),output:Pc.unknown(),errorText:Pc.never().optional(),callProviderMetadata:Oi.optional(),resultProviderMetadata:Oi.optional(),preliminary:Pc.boolean().optional(),approval:Pc.object({id:Pc.string(),approved:Pc.literal(!0),reason:Pc.string().optional(),signature:Pc.string().optional()}).optional()}),Pc.object({type:Pc.literal("dynamic-tool"),toolName:Pc.string(),toolCallId:Pc.string(),toolMetadata:Oz.optional(),state:Pc.literal("output-error"),input:Pc.unknown().optional(),rawInput:Pc.unknown().optional(),providerExecuted:Pc.boolean().optional(),output:Pc.never().optional(),errorText:Pc.string(),callProviderMetadata:Oi.optional(),resultProviderMetadata:Oi.optional(),approval:Pc.object({id:Pc.string(),approved:Pc.literal(!0),reason:Pc.string().optional(),signature:Pc.string().optional()}).optional()}),Pc.object({type:Pc.literal("dynamic-tool"),toolName:Pc.string(),toolCallId:Pc.string(),toolMetadata:Oz.optional(),state:Pc.literal("output-denied"),input:Pc.unknown(),providerExecuted:Pc.boolean().optional(),output:Pc.never().optional(),errorText:Pc.never().optional(),callProviderMetadata:Oi.optional(),approval:Pc.object({id:Pc.string(),approved:Pc.literal(!1),reason:Pc.string().optional(),signature:Pc.string().optional()})}),Pc.object({type:Pc.string().startsWith("tool-"),toolCallId:Pc.string(),toolMetadata:Oz.optional(),state:Pc.literal("input-streaming"),providerExecuted:Pc.boolean().optional(),callProviderMetadata:Oi.optional(),input:Pc.unknown().optional(),output:Pc.never().optional(),errorText:Pc.never().optional(),approval:Pc.never().optional()}),Pc.object({type:Pc.string().startsWith("tool-"),toolCallId:Pc.string(),toolMetadata:Oz.optional(),state:Pc.literal("input-available"),providerExecuted:Pc.boolean().optional(),input:Pc.unknown(),output:Pc.never().optional(),errorText:Pc.never().optional(),callProviderMetadata:Oi.optional(),approval:Pc.never().optional()}),Pc.object({type:Pc.string().startsWith("tool-"),toolCallId:Pc.string(),toolMetadata:Oz.optional(),state:Pc.literal("approval-requested"),input:Pc.unknown(),providerExecuted:Pc.boolean().optional(),output:Pc.never().optional(),errorText:Pc.never().optional(),callProviderMetadata:Oi.optional(),approval:Pc.object({id:Pc.string(),approved:Pc.never().optional(),reason:Pc.never().optional(),signature:Pc.string().optional()})}),Pc.object({type:Pc.string().startsWith("tool-"),toolCallId:Pc.string(),toolMetadata:Oz.optional(),state:Pc.literal("approval-responded"),input:Pc.unknown(),providerExecuted:Pc.boolean().optional(),output:Pc.never().optional(),errorText:Pc.never().optional(),callProviderMetadata:Oi.optional(),approval:Pc.object({id:Pc.string(),approved:Pc.boolean(),reason:Pc.string().optional(),signature:Pc.string().optional()})}),Pc.object({type:Pc.string().startsWith("tool-"),toolCallId:Pc.string(),toolMetadata:Oz.optional(),state:Pc.literal("output-available"),providerExecuted:Pc.boolean().optional(),input:Pc.unknown(),output:Pc.unknown(),errorText:Pc.never().optional(),callProviderMetadata:Oi.optional(),resultProviderMetadata:Oi.optional(),preliminary:Pc.boolean().optional(),approval:Pc.object({id:Pc.string(),approved:Pc.literal(!0),reason:Pc.string().optional(),signature:Pc.string().optional()}).optional()}),Pc.object({type:Pc.string().startsWith("tool-"),toolCallId:Pc.string(),toolMetadata:Oz.optional(),state:Pc.literal("output-error"),providerExecuted:Pc.boolean().optional(),input:Pc.unknown().optional(),rawInput:Pc.unknown().optional(),output:Pc.never().optional(),errorText:Pc.string(),callProviderMetadata:Oi.optional(),resultProviderMetadata:Oi.optional(),approval:Pc.object({id:Pc.string(),approved:Pc.literal(!0),reason:Pc.string().optional(),signature:Pc.string().optional()}).optional()}),Pc.object({type:Pc.string().startsWith("tool-"),toolCallId:Pc.string(),toolMetadata:Oz.optional(),state:Pc.literal("output-denied"),providerExecuted:Pc.boolean().optional(),input:Pc.unknown(),output:Pc.never().optional(),errorText:Pc.never().optional(),callProviderMetadata:Oi.optional(),approval:Pc.object({id:Pc.string(),approved:Pc.literal(!1),reason:Pc.string().optional(),signature:Pc.string().optional()})})])).nonempty("Message must contain at least one part")})).nonempty("Messages array must not be empty"))),NM({prefix:"aiobj",size:24});var OM=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(e){return new Promise((t,n)=>{this.queue.push(async()=>{try{await e(),t()}catch(e){n(e)}}),this.processQueue()})}};async function OR(e){if(null==e)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw Error("FileList is not supported in the current environment");return Promise.all(Array.from(e).map(async e=>{let{name:t,type:n}=e;return{type:"file",mediaType:n,filename:t,url:await new Promise((t,n)=>{let r=new FileReader;r.onload=e=>{var n;t(null==(n=e.target)?void 0:n.result)},r.onerror=e=>n(e),r.readAsDataURL(e)})}}))}NM({prefix:"aiobj",size:24}),OO(),Symbol.for("vercel.ai.error.AI_NoSuchProviderError"),OO();var OD=class{constructor({api:e="/api/chat",credentials:t,headers:n,body:r,fetch:i,prepareSendMessagesRequest:a,prepareReconnectToStreamRequest:s}){this.api=e,this.credentials=t,this.headers=n,this.body=r,this.fetch=i,this.prepareSendMessagesRequest=a,this.prepareReconnectToStreamRequest=s}async sendMessages({abortSignal:e,...t}){var n,r,i,a,s;let o=await _A(this.body),l=await _A(this.headers),d=await _A(this.credentials),c={...NB(l),...NB(t.headers)},u=await (null==(n=this.prepareSendMessagesRequest)?void 0:n.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...o,...t.body},headers:c,credentials:d,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),m=null!=(r=null==u?void 0:u.api)?r:this.api,p=(null==u?void 0:u.headers)!==void 0?NB(u.headers):c,f=(null==u?void 0:u.body)!==void 0?u.body:{...o,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},h=null!=(i=null==u?void 0:u.credentials)?i:d,g=null!=(a=this.fetch)?a:globalThis.fetch,x=await g(m,{method:"POST",headers:{"Content-Type":"application/json",...p},body:JSON.stringify(f),credentials:h,signal:e});if(!x.ok)throw Error(null!=(s=await x.text())?s:"Failed to fetch the chat response.");if(!x.body)throw Error("The response body is empty.");return this.processResponseStream(x.body)}async reconnectToStream(e){var t,n,r,i,a;let s=await _A(this.body),o=await _A(this.headers),l=await _A(this.credentials),d={...NB(o),...NB(e.headers)},c=await (null==(t=this.prepareReconnectToStreamRequest)?void 0:t.call(this,{api:this.api,id:e.chatId,body:{...s,...e.body},headers:d,credentials:l,requestMetadata:e.metadata})),u=null!=(n=null==c?void 0:c.api)?n:`${this.api}/${e.chatId}/stream`,m=(null==c?void 0:c.headers)!==void 0?NB(c.headers):d,p=null!=(r=null==c?void 0:c.credentials)?r:l,f=null!=(i=this.fetch)?i:globalThis.fetch,h=await f(u,{method:"GET",headers:m,credentials:p});if(204===h.status)return null;if(!h.ok)throw Error(null!=(a=await h.text())?a:"Failed to fetch the chat response.");if(!h.body)throw Error("The response body is empty.");return this.processResponseStream(h.body)}},OL=class extends OD{constructor(e={}){super(e)}processResponseStream(e){return _S({stream:e,schema:OI}).pipeThrough(new TransformStream({async transform(e,t){if(!e.success)throw e.error;t.enqueue(e.value)}}))}},OU=class{constructor({generateId:e=NR,id:t=e(),transport:n=new OL,messageMetadataSchema:r,dataPartSchemas:i,state:a,onError:s,onToolCall:o,onFinish:l,onData:d,sendAutomaticallyWhen:c}){this.activeResponse=void 0,this.jobExecutor=new OM,this.sendMessage=async(e,t)=>{var n,r,i,a;let s;if(null==e)return void await this.makeRequest({trigger:"submit-message",messageId:null==(n=this.lastMessage)?void 0:n.id,...t});if(s="text"in e||"files"in e?{parts:[...Array.isArray(e.files)?e.files:await OR(e.files),..."text"in e&&null!=e.text?[{type:"text",text:e.text}]:[]]}:e,null!=e.messageId){let t=this.state.messages.findIndex(t=>t.id===e.messageId);if(-1===t)throw Error(`message with id ${e.messageId} not found`);if("user"!==this.state.messages[t].role)throw Error(`message with id ${e.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,t+1),this.state.replaceMessage(t,{...s,id:e.messageId,role:null!=(r=s.role)?r:"user",metadata:e.metadata})}else this.state.pushMessage({...s,id:null!=(i=s.id)?i:this.generateId(),role:null!=(a=s.role)?a:"user",metadata:e.metadata});await this.makeRequest({trigger:"submit-message",messageId:e.messageId,...t})},this.regenerate=async({messageId:e,...t}={})=>{let n=null==e?this.state.messages.length-1:this.state.messages.findIndex(t=>t.id===e);if(-1===n)throw Error(`message ${e} not found`);this.state.messages=this.state.messages.slice(0,"assistant"===this.messages[n].role?n:n+1),await this.makeRequest({trigger:"regenerate-message",messageId:e,...t})},this.resumeStream=async(e={})=>{await this.makeRequest({trigger:"resume-stream",...e})},this.clearError=()=>{"error"===this.status&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:e,approved:t,reason:n,options:r})=>this.jobExecutor.run(async()=>{let i=this.state.messages,a=i[i.length-1],s=r=>OA(r)&&"approval-requested"===r.state&&r.approval.id===e?{...r,state:"approval-responded",approval:{id:e,approved:t,reason:n}}:r;this.state.replaceMessage(i.length-1,{...a,parts:a.parts.map(s)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(s)),"streaming"!==this.status&&"submitted"!==this.status&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(e=>{var t;e&&this.makeRequest({trigger:"submit-message",messageId:null==(t=this.lastMessage)?void 0:t.id,...r})})}),this.addToolOutput=async({state:e="output-available",toolCallId:t,output:n,errorText:r,options:i})=>this.jobExecutor.run(async()=>{let a=this.state.messages,s=a[a.length-1],o=i=>OA(i)&&i.toolCallId===t?{...i,state:e,output:n,errorText:r}:i;this.state.replaceMessage(a.length-1,{...s,parts:s.parts.map(o)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(o)),"streaming"!==this.status&&"submitted"!==this.status&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(e=>{var t;e&&this.makeRequest({trigger:"submit-message",messageId:null==(t=this.lastMessage)?void 0:t.id,...i})})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var e;("streaming"===this.status||"submitted"===this.status)&&(null==(e=this.activeResponse)?void 0:e.abortController)&&this.activeResponse.abortController.abort()},this.id=t,this.transport=n,this.generateId=e,this.messageMetadataSchema=r,this.dataPartSchemas=i,this.state=a,this.onError=s,this.onToolCall=o,this.onFinish=l,this.onData=d,this.sendAutomaticallyWhen=c}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async shouldSendAutomatically(){if(!this.sendAutomaticallyWhen)return!1;let e=this.sendAutomaticallyWhen({messages:this.state.messages});return e&&"object"==typeof e&&"then"in e?await e:e}async makeRequest({trigger:e,metadata:t,headers:n,body:r,messageId:i}){var a,s,o;let l;if("resume-stream"===e)try{let e=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:n,body:r});if(null==e)return;l=e}catch(e){this.onError&&e instanceof Error&&this.onError(e),this.setStatus({status:"error",error:e});return}this.setStatus({status:"submitted",error:void 0});let d=this.lastMessage,c=!1,u=!1,m=!1;try{let a,s={state:function({lastMessage:e,messageId:t}){return{message:(null==e?void 0:e.role)==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:OE(),activeReasoningParts:OE(),partialToolCalls:OE()}}({lastMessage:this.state.snapshot(d),messageId:this.generateId()}),abortController:new AbortController};s.abortController.signal.addEventListener("abort",()=>{c=!0}),this.activeResponse=s,a="resume-stream"===e?l:await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:s.abortController.signal,metadata:t,headers:n,body:r,trigger:e,messageId:i});let o=e=>this.jobExecutor.run(()=>e({state:s.state,write:()=>{var e;this.setStatus({status:"streaming"}),s.state.message.id===(null==(e=this.lastMessage)?void 0:e.id)?this.state.replaceMessage(this.state.messages.length-1,s.state.message):this.state.pushMessage(s.state.message)}}));await OP({stream:function({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:r,onError:i,onToolCall:a,onData:s}){return e.pipeThrough(new TransformStream({async transform(e,o){await r(async({state:r,write:l})=>{var d,c,u,m;function p(e){let t=r.message.parts.filter(OA).find(t=>t.toolCallId===e);if(null==t)throw new Oe({chunkType:"tool-invocation",chunkId:e,message:`No tool invocation found for tool call ID "${e}".`});return t}function f(e){var t;let n=r.message.parts.find(t=>OC(t)&&t.toolCallId===e.toolCallId);if(null!=n){n.state=e.state,n.input=e.input,n.output=e.output,n.errorText=e.errorText,n.rawInput=e.rawInput,n.preliminary=e.preliminary,void 0!==e.title&&(n.title=e.title),void 0!==e.toolMetadata&&(n.toolMetadata=e.toolMetadata),n.providerExecuted=null!=(t=e.providerExecuted)?t:n.providerExecuted;let r=e.providerMetadata;null!=r&&("output-available"===e.state||"output-error"===e.state?n.resultProviderMetadata=r:n.callProviderMetadata=r)}else r.message.parts.push({type:`tool-${e.toolName}`,toolCallId:e.toolCallId,state:e.state,title:e.title,...void 0!==e.toolMetadata?{toolMetadata:e.toolMetadata}:{},input:e.input,output:e.output,rawInput:e.rawInput,errorText:e.errorText,providerExecuted:e.providerExecuted,preliminary:e.preliminary,...null!=e.providerMetadata&&("output-available"===e.state||"output-error"===e.state)?{resultProviderMetadata:e.providerMetadata}:{},...null!=e.providerMetadata&&"output-available"!==e.state&&"output-error"!==e.state?{callProviderMetadata:e.providerMetadata}:{}})}function h(e){var t,n;let i=r.message.parts.find(t=>"dynamic-tool"===t.type&&t.toolCallId===e.toolCallId);if(null!=i){i.state=e.state,i.toolName=e.toolName,i.input=e.input,i.output=e.output,i.errorText=e.errorText,i.rawInput=null!=(t=e.rawInput)?t:i.rawInput,i.preliminary=e.preliminary,void 0!==e.title&&(i.title=e.title),void 0!==e.toolMetadata&&(i.toolMetadata=e.toolMetadata),i.providerExecuted=null!=(n=e.providerExecuted)?n:i.providerExecuted;let r=e.providerMetadata;null!=r&&("output-available"===e.state||"output-error"===e.state?i.resultProviderMetadata=r:i.callProviderMetadata=r)}else r.message.parts.push({type:"dynamic-tool",toolName:e.toolName,toolCallId:e.toolCallId,state:e.state,input:e.input,output:e.output,errorText:e.errorText,preliminary:e.preliminary,providerExecuted:e.providerExecuted,title:e.title,...void 0!==e.toolMetadata?{toolMetadata:e.toolMetadata}:{},...null!=e.providerMetadata&&("output-available"===e.state||"output-error"===e.state)?{resultProviderMetadata:e.providerMetadata}:{},...null!=e.providerMetadata&&"output-available"!==e.state&&"output-error"!==e.state?{callProviderMetadata:e.providerMetadata}:{}})}async function g(e){if(null!=e){let n=null!=r.message.metadata?function e(t,n){if(void 0===t&&void 0===n)return;if(void 0===t)return n;if(void 0===n)return t;let r={...t};for(let i in n)if("__proto__"!==i&&"constructor"!==i&&"prototype"!==i&&Object.prototype.hasOwnProperty.call(n,i)){let a=n[i];if(void 0===a)continue;let s=i in t?t[i]:void 0,o=null!==a&&"object"==typeof a&&!Array.isArray(a)&&!(a instanceof Date)&&!(a instanceof RegExp),l=null!=s&&"object"==typeof s&&!Array.isArray(s)&&!(s instanceof Date)&&!(s instanceof RegExp);o&&l?r[i]=e(s,a):r[i]=a}return r}(r.message.metadata,e):e;null!=t&&await _j({value:n,schema:t,context:{field:"message.metadata",entityId:r.message.id}}),r.message.metadata=n}}switch(e.type){case"text-start":{let t={type:"text",text:"",providerMetadata:e.providerMetadata,state:"streaming"};r.activeTextParts[e.id]=t,r.message.parts.push(t),l();break}case"text-delta":{let t=r.activeTextParts[e.id];if(null==t)throw new Oe({chunkType:"text-delta",chunkId:e.id,message:`Received text-delta for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});t.text+=e.delta,t.providerMetadata=null!=(d=e.providerMetadata)?d:t.providerMetadata,l();break}case"text-end":{let t=r.activeTextParts[e.id];if(null==t)throw new Oe({chunkType:"text-end",chunkId:e.id,message:`Received text-end for missing text part with ID "${e.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});t.state="done",t.providerMetadata=null!=(c=e.providerMetadata)?c:t.providerMetadata,delete r.activeTextParts[e.id],l();break}case"reasoning-start":{let t={type:"reasoning",text:"",providerMetadata:e.providerMetadata,state:"streaming"};r.activeReasoningParts[e.id]=t,r.message.parts.push(t),l();break}case"reasoning-delta":{let t=r.activeReasoningParts[e.id];if(null==t)throw new Oe({chunkType:"reasoning-delta",chunkId:e.id,message:`Received reasoning-delta for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});t.text+=e.delta,t.providerMetadata=null!=(u=e.providerMetadata)?u:t.providerMetadata,l();break}case"reasoning-end":{let t=r.activeReasoningParts[e.id];if(null==t)throw new Oe({chunkType:"reasoning-end",chunkId:e.id,message:`Received reasoning-end for missing reasoning part with ID "${e.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});t.providerMetadata=null!=(m=e.providerMetadata)?m:t.providerMetadata,t.state="done",delete r.activeReasoningParts[e.id],l();break}case"file":r.message.parts.push({type:"file",mediaType:e.mediaType,url:e.url,...null!=e.providerMetadata?{providerMetadata:e.providerMetadata}:{}}),l();break;case"source-url":r.message.parts.push({type:"source-url",sourceId:e.sourceId,url:e.url,title:e.title,providerMetadata:e.providerMetadata}),l();break;case"source-document":r.message.parts.push({type:"source-document",sourceId:e.sourceId,mediaType:e.mediaType,title:e.title,filename:e.filename,providerMetadata:e.providerMetadata}),l();break;case"tool-input-start":{let t=r.message.parts.filter(OC);r.partialToolCalls[e.toolCallId]={text:"",toolName:e.toolName,index:t.length,dynamic:e.dynamic,title:e.title,toolMetadata:e.toolMetadata},e.dynamic?h({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-streaming",input:void 0,providerExecuted:e.providerExecuted,title:e.title,toolMetadata:e.toolMetadata,providerMetadata:e.providerMetadata}):f({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-streaming",input:void 0,providerExecuted:e.providerExecuted,title:e.title,toolMetadata:e.toolMetadata,providerMetadata:e.providerMetadata}),l();break}case"tool-input-delta":{let t=r.partialToolCalls[e.toolCallId];if(null==t)throw new Oe({chunkType:"tool-input-delta",chunkId:e.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${e.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});t.text+=e.inputTextDelta;let{value:n}=await Ok(t.text);t.dynamic?h({toolCallId:e.toolCallId,toolName:t.toolName,state:"input-streaming",input:n,title:t.title,toolMetadata:t.toolMetadata}):f({toolCallId:e.toolCallId,toolName:t.toolName,state:"input-streaming",input:n,title:t.title,toolMetadata:t.toolMetadata}),l();break}case"tool-input-available":e.dynamic?h({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-available",input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title,toolMetadata:e.toolMetadata}):f({toolCallId:e.toolCallId,toolName:e.toolName,state:"input-available",input:e.input,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:e.title,toolMetadata:e.toolMetadata}),l(),a&&!e.providerExecuted&&await a({toolCall:e});break;case"tool-input-error":{let t=r.message.parts.filter(OA).find(t=>t.toolCallId===e.toolCallId);(null!=t?"dynamic-tool"===t.type:e.dynamic)?h({toolCallId:e.toolCallId,toolName:e.toolName,state:"output-error",input:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,toolMetadata:e.toolMetadata}):f({toolCallId:e.toolCallId,toolName:e.toolName,state:"output-error",input:void 0,rawInput:e.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,toolMetadata:e.toolMetadata}),l();break}case"tool-approval-request":{let t=p(e.toolCallId);t.state="approval-requested",t.approval={id:e.approvalId,...null!=e.signature?{signature:e.signature}:{}},l();break}case"tool-output-denied":p(e.toolCallId).state="output-denied",l();break;case"tool-output-available":{let t=p(e.toolCallId);"dynamic-tool"===t.type?h({toolCallId:e.toolCallId,toolName:t.toolName,state:"output-available",input:t.input,output:e.output,preliminary:e.preliminary,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:t.toolMetadata}):f({toolCallId:e.toolCallId,toolName:OT(t),state:"output-available",input:t.input,output:e.output,providerExecuted:e.providerExecuted,preliminary:e.preliminary,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:t.toolMetadata}),l();break}case"tool-output-error":{let t=p(e.toolCallId);"dynamic-tool"===t.type?h({toolCallId:e.toolCallId,toolName:t.toolName,state:"output-error",input:t.input,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:t.toolMetadata}):f({toolCallId:e.toolCallId,toolName:OT(t),state:"output-error",input:t.input,rawInput:t.rawInput,errorText:e.errorText,providerExecuted:e.providerExecuted,providerMetadata:e.providerMetadata,title:t.title,toolMetadata:t.toolMetadata}),l();break}case"start-step":r.message.parts.push({type:"step-start"});break;case"finish-step":r.activeTextParts=OE(),r.activeReasoningParts=OE();break;case"start":null!=e.messageId&&(r.message.id=e.messageId),await g(e.messageMetadata),(null!=e.messageId||null!=e.messageMetadata)&&l();break;case"finish":null!=e.finishReason&&(r.finishReason=e.finishReason),await g(e.messageMetadata),null!=e.messageMetadata&&l();break;case"message-metadata":await g(e.messageMetadata),null!=e.messageMetadata&&l();break;case"error":null==i||i(Error(e.errorText));break;default:if(e.type.startsWith("data-")){if((null==n?void 0:n[e.type])!=null){let t=r.message.parts.findIndex(t=>"id"in t&&"data"in t&&t.id===e.id&&t.type===e.type),i=t>=0?t:r.message.parts.length;await _j({value:e.data,schema:n[e.type],context:{field:`message.parts[${i}].data`,entityName:e.type,entityId:e.id}})}if(e.transient){null==s||s(e);break}let t=null!=e.id?r.message.parts.find(t=>e.type===t.type&&e.id===t.id):void 0;null!=t?t.data=e.data:r.message.parts.push(e),null==s||s(e),l()}}o.enqueue(e)})}}))}({stream:a,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:o,onError:e=>{throw e}}),onError:e=>{throw e}}),this.setStatus({status:"ready"})}catch(e){if(c||"AbortError"===e.name)return c=!0,this.setStatus({status:"ready"}),null;m=!0,e instanceof TypeError&&(e.message.toLowerCase().includes("fetch")||e.message.toLowerCase().includes("network"))&&(u=!0),this.onError&&e instanceof Error&&this.onError(e),this.setStatus({status:"error",error:e})}finally{try{null==(s=this.onFinish)||s.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:c,isDisconnect:u,isError:m,finishReason:null==(a=this.activeResponse)?void 0:a.state.finishReason})}catch(e){console.error(e)}this.activeResponse=void 0}!m&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:"submit-message",messageId:null==(o=this.lastMessage)?void 0:o.id,metadata:t,headers:n,body:r})}},OZ=e.i(61030),OF=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},OB=(e,t,n)=>(OF(e,t,"read from private field"),n?n.call(e):t.get(e)),OV=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Oq=(e,t,n,r)=>(OF(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),OW=class{constructor(e=[]){OV(this,ej,void 0),OV(this,ew,"ready"),OV(this,eN,void 0),OV(this,e_,new Set),OV(this,eS,new Set),OV(this,e$,new Set),this.pushMessage=e=>{Oq(this,ej,OB(this,ej).concat(e)),OB(this,eI).call(this)},this.popMessage=()=>{Oq(this,ej,OB(this,ej).slice(0,-1)),OB(this,eI).call(this)},this.replaceMessage=(e,t)=>{Oq(this,ej,[...OB(this,ej).slice(0,e),this.snapshot(t),...OB(this,ej).slice(e+1)]),OB(this,eI).call(this)},this.snapshot=e=>structuredClone(e),this["~registerMessagesCallback"]=(e,t)=>{let n=t?null!=t?(0,OZ.default)(e,t):e:e;return OB(this,e_).add(n),()=>{OB(this,e_).delete(n)}},this["~registerStatusCallback"]=e=>(OB(this,eS).add(e),()=>{OB(this,eS).delete(e)}),this["~registerErrorCallback"]=e=>(OB(this,e$).add(e),()=>{OB(this,e$).delete(e)}),OV(this,eI,()=>{OB(this,e_).forEach(e=>e())}),OV(this,eE,()=>{OB(this,eS).forEach(e=>e())}),OV(this,eC,()=>{OB(this,e$).forEach(e=>e())}),Oq(this,ej,e)}get status(){return OB(this,ew)}set status(e){Oq(this,ew,e),OB(this,eE).call(this)}get error(){return OB(this,eN)}set error(e){Oq(this,eN,e),OB(this,eC).call(this)}get messages(){return OB(this,ej)}set messages(e){Oq(this,ej,[...e]),OB(this,eI).call(this)}};ej=new WeakMap,ew=new WeakMap,eN=new WeakMap,e_=new WeakMap,eS=new WeakMap,e$=new WeakMap,eI=new WeakMap,eE=new WeakMap,eC=new WeakMap;var OH=class extends OU{constructor({messages:e,...t}){const n=new OW(e);super({...t,state:n}),OV(this,eA,void 0),this["~registerMessagesCallback"]=(e,t)=>OB(this,eA)["~registerMessagesCallback"](e,t),this["~registerStatusCallback"]=e=>OB(this,eA)["~registerStatusCallback"](e),this["~registerErrorCallback"]=e=>OB(this,eA)["~registerErrorCallback"](e),Oq(this,eA,n)}};eA=new WeakMap;let OG=eL("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);function OK(e){return(e.parts??[]).filter(e=>"text"===e.type).map(e=>e.text).join("")}let OJ=["Explain this issue in plain language","What's the smallest safe fix?","Show me a corrected code example","What are the security implications?"];function OY({chatId:e,initialMessages:t,model:n,onModelChange:r,seed:i,onActivity:a}){let[s,o]=(0,eP.useState)(""),l=(0,eP.useRef)(null),{messages:d,sendMessage:c,status:u,stop:m}=function({experimental_throttle:e,resume:t=!1,...n}={}){let r=(0,eP.useRef)("chat"in n?{}:{onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});"chat"in n||(r.current={onToolCall:n.onToolCall,onData:n.onData,onFinish:n.onFinish,onError:n.onError,sendAutomaticallyWhen:n.sendAutomaticallyWhen});let i={...n,onToolCall:e=>{var t,n;return null==(n=(t=r.current).onToolCall)?void 0:n.call(t,e)},onData:e=>{var t,n;return null==(n=(t=r.current).onData)?void 0:n.call(t,e)},onFinish:e=>{var t,n;return null==(n=(t=r.current).onFinish)?void 0:n.call(t,e)},onError:e=>{var t,n;return null==(n=(t=r.current).onError)?void 0:n.call(t,e)},sendAutomaticallyWhen:e=>{var t,n,i;return null!=(i=null==(n=(t=r.current).sendAutomaticallyWhen)?void 0:n.call(t,e))&&i}},a=(0,eP.useRef)("chat"in n?n.chat:new OH(i));("chat"in n&&n.chat!==a.current||"id"in n&&a.current.id!==n.id)&&(a.current="chat"in n?n.chat:new OH(i));let s=(0,eP.useCallback)(t=>a.current["~registerMessagesCallback"](t,e),[e,a.current.id]),o=(0,eP.useSyncExternalStore)(s,()=>a.current.messages,()=>a.current.messages),l=(0,eP.useSyncExternalStore)(a.current["~registerStatusCallback"],()=>a.current.status,()=>a.current.status),d=(0,eP.useSyncExternalStore)(a.current["~registerErrorCallback"],()=>a.current.error,()=>a.current.error),c=(0,eP.useCallback)(e=>{"function"==typeof e&&(e=e(a.current.messages)),a.current.messages=e},[a]);return(0,eP.useEffect)(()=>{t&&a.current.resumeStream()},[t,a]),{id:a.current.id,messages:o,setMessages:c,sendMessage:a.current.sendMessage,regenerate:a.current.regenerate,clearError:a.current.clearError,stop:a.current.stop,error:d,resumeStream:a.current.resumeStream,status:l,addToolResult:a.current.addToolOutput,addToolOutput:a.current.addToolOutput,addToolApprovalResponse:a.current.addToolApprovalResponse}}({id:e,messages:t,transport:new OL({api:"/api/chat",prepareSendMessagesRequest:({id:e,messages:t})=>({body:{id:e,messages:t,model:n,seed:i}})}),onFinish:()=>a?.()}),p="streaming"===u||"submitted"===u;function f(e){let t=e.trim();t&&!p&&(c({text:t}),o(""),a?.())}(0,eP.useEffect)(()=>{l.current?.scrollTo({top:l.current.scrollHeight,behavior:"smooth"})},[d,p]);let h=0===d.length,g=i?.severity?oV(i.severity):null;return(0,eT.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[i&&(0,eT.jsx)("div",{className:"shrink-0 border-b border-border bg-card/50 px-4 py-2.5",children:(0,eT.jsxs)("div",{className:"flex items-start gap-2",children:[(0,eT.jsx)(dw,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[g&&(0,eT.jsx)("span",{className:(0,ny.cn)("rounded-sm px-1.5 py-0.5 font-mono text-[10px] uppercase",g.bg,g.text),children:g.label}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] uppercase text-muted-foreground",children:i.source}),(0,eT.jsx)("span",{className:"truncate font-mono text-xs text-foreground",children:i.title})]}),i.filePath&&(0,eT.jsxs)("p",{className:"mt-1 flex items-center gap-1 font-mono text-[11px] text-muted-foreground",children:[(0,eT.jsx)(si,{className:"size-3"}),i.filePath,i.line?`:${i.line}`:""]})]})]})}),(0,eT.jsx)("div",{ref:l,className:"min-h-0 flex-1 overflow-y-auto px-4 py-5",children:h?(0,eT.jsxs)("div",{className:"mx-auto flex max-w-xl flex-col items-center gap-4 py-10 text-center",children:[(0,eT.jsx)("div",{className:"flex size-11 items-center justify-center rounded-sm border border-border text-foreground",children:(0,eT.jsx)(e4,{className:"size-5"})}),(0,eT.jsxs)("div",{children:[(0,eT.jsx)("h2",{className:"font-mono text-sm font-semibold text-foreground",children:i?"Ask about this issue":"How can I help?"}),(0,eT.jsx)("p",{className:"mt-1 text-pretty text-xs leading-relaxed text-muted-foreground",children:i?"I have the issue details as context. Ask for an explanation, a fix, or the security impact.":"Ask about any finding from your analysis — lint, types, security, dependencies and more."})]}),(0,eT.jsx)("div",{className:"grid w-full gap-2 sm:grid-cols-2",children:OJ.map(e=>(0,eT.jsx)("button",{type:"button",onClick:()=>f(e),className:"rounded-sm border border-border bg-card px-3 py-2 text-left text-xs text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground",children:e},e))})]}):(0,eT.jsxs)("div",{className:"mx-auto flex max-w-3xl flex-col gap-5",children:[d.map(e=>(0,eT.jsxs)("div",{className:(0,ny.cn)("flex gap-3","user"===e.role&&"justify-end"),children:["assistant"===e.role&&(0,eT.jsx)("div",{className:"mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-sm border border-border text-foreground",children:(0,eT.jsx)(e4,{className:"size-3.5"})}),(0,eT.jsx)("div",{className:(0,ny.cn)("min-w-0 max-w-[85%] rounded-sm px-3.5 py-2.5","user"===e.role?"bg-primary text-primary-foreground":"border border-border bg-card"),children:"user"===e.role?(0,eT.jsx)("p",{className:"whitespace-pre-wrap text-sm leading-relaxed",children:OK(e)}):(0,eT.jsx)(h4,{children:OK(e)||(p?"…":"")})}),"user"===e.role&&(0,eT.jsx)("div",{className:"mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-sm border border-border text-muted-foreground",children:(0,eT.jsx)(e2,{className:"size-3.5"})})]},e.id)),"submitted"===u&&(0,eT.jsxs)("div",{className:"flex gap-3",children:[(0,eT.jsx)("div",{className:"mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-sm border border-border text-foreground",children:(0,eT.jsx)(e4,{className:"size-3.5 animate-pulse"})}),(0,eT.jsx)("div",{className:"rounded-sm border border-border bg-card px-3.5 py-2.5",children:(0,eT.jsxs)("span",{className:"inline-flex gap-1",children:[(0,eT.jsx)("span",{className:"size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-0.3s]"}),(0,eT.jsx)("span",{className:"size-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-0.15s]"}),(0,eT.jsx)("span",{className:"size-1.5 animate-bounce rounded-full bg-muted-foreground"})]})})]})]})}),(0,eT.jsxs)("div",{className:"shrink-0 border-t border-border bg-card/50 px-4 py-3 pb-14 sm:pb-3",children:[(0,eT.jsxs)("form",{onSubmit:e=>{e.preventDefault(),f(s)},className:"mx-auto flex max-w-3xl items-end gap-2",children:[(0,eT.jsx)("div",{className:"flex flex-1 items-end rounded-sm border border-border bg-background focus-within:border-foreground/30",children:(0,eT.jsx)("textarea",{value:s,onChange:e=>o(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),f(s))},rows:1,placeholder:"Ask CodeLens Assistant…",className:"max-h-40 min-h-[40px] flex-1 resize-none bg-transparent px-3 py-2.5 text-sm text-foreground outline-none placeholder:text-muted-foreground"})}),p?(0,eT.jsx)("button",{type:"button",onClick:()=>m(),"aria-label":"Stop generating",className:"inline-flex size-10 shrink-0 items-center justify-center rounded-sm border border-border bg-card text-foreground transition-colors hover:bg-secondary",children:(0,eT.jsx)(OG,{className:"size-4"})}):(0,eT.jsx)("button",{type:"submit",disabled:!s.trim(),"aria-label":"Send message",className:"inline-flex size-10 shrink-0 items-center justify-center rounded-sm bg-primary text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-40",children:(0,eT.jsx)(cC,{className:"size-4"})})]}),(0,eT.jsxs)("p",{className:"mx-auto mt-1.5 flex max-w-3xl items-center gap-1 font-mono text-[10px] text-muted-foreground",children:[r?(0,eT.jsx)(bv,{value:n,onChange:r,triggerClassName:"rounded-sm px-1 text-foreground underline decoration-dotted underline-offset-2 transition-colors hover:bg-secondary",children:n}):(0,eT.jsx)("span",{className:"text-foreground",children:n}),(0,eT.jsx)("span",{children:"· responses can be inaccurate — verify important fixes"})]})]})]})}let OX=e=>fetch(e).then(e=>e.json());function OQ({pendingSeed:e,seedNonce:t}){let[n,r]=(0,eP.useState)("google/gemini-2.5-flash"),[i,a]=(0,eP.useState)(null),[s,o]=(0,eP.useState)([]),[l,d]=(0,eP.useState)(null),[c,u]=(0,eP.useState)(!1),m=(0,eP.useRef)(void 0),{data:p,mutate:f,isLoading:h}=u_("/api/chats",OX,{revalidateOnFocus:!1}),g=p?.chats??[];(0,eP.useEffect)(()=>{r(gN().model)},[]);let x=(0,eP.useCallback)(e=>{r(e),g_({...gN(),model:e})},[]),v=(0,eP.useCallback)((e=null)=>{a(crypto.randomUUID()),o([]),d(e)},[]);async function y(e){if(e!==i){u(!0);try{let t=await fetch(`/api/chats/${e}`),n=await t.json();a(e),o(n.chat?.messages??[]),d(n.chat?.seed??null),n.chat?.model&&r(n.chat.model)}finally{u(!1)}}}async function b(e,t){t.stopPropagation(),await fetch(`/api/chats/${e}`,{method:"DELETE"}),e===i&&v(null),f()}return(0,eP.useEffect)(()=>{void 0!==t&&t!==m.current&&(m.current=t,v(e??null))},[t,e,v]),(0,eP.useEffect)(()=>{null===i&&void 0===t&&v(null)},[i,t,v]),(0,eT.jsxs)("div",{className:"flex h-[calc(100svh-4rem)] min-h-0 overflow-hidden border-t border-border bg-card",children:[(0,eT.jsx)("div",{className:"min-w-0 flex-1 border-r border-border",children:c?(0,eT.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,eT.jsx)(dj,{className:"size-5 animate-spin text-muted-foreground"})}):i?(0,eT.jsx)(OY,{chatId:i,initialMessages:s,model:n,onModelChange:x,seed:l,onActivity:()=>f()},i):null}),(0,eT.jsxs)("aside",{className:"hidden w-64 shrink-0 flex-col md:flex",children:[(0,eT.jsx)("div",{className:"shrink-0 p-3",children:(0,eT.jsxs)("button",{type:"button",onClick:()=>v(null),className:"flex w-full items-center justify-center gap-2 rounded-sm bg-primary px-3 py-2 font-mono text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:[(0,eT.jsx)(oO,{className:"size-4"}),"New chat"]})}),(0,eT.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto px-2 pb-3",children:[(0,eT.jsx)("p",{className:"px-2 pb-1 font-mono text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/70",children:"History"}),h?(0,eT.jsxs)("div",{className:"flex items-center gap-2 px-2 py-3 font-mono text-xs text-muted-foreground",children:[(0,eT.jsx)(dj,{className:"size-3.5 animate-spin"})," loading…"]}):0===g.length?(0,eT.jsxs)("p",{className:"px-2 py-3 text-xs leading-relaxed text-muted-foreground",children:["No conversations yet. Saved chats appear here and persist in"," ",(0,eT.jsx)("span",{className:"font-mono",children:".codelens/chats.json"}),"."]}):(0,eT.jsx)("ul",{className:"flex flex-col gap-0.5",children:g.map(e=>{let t=e.id===i;return(0,eT.jsx)("li",{children:(0,eT.jsxs)("button",{type:"button",onClick:()=>y(e.id),className:(0,ny.cn)("group flex w-full items-start gap-2 rounded-sm px-2 py-2 text-left transition-colors",t?"bg-secondary":"hover:bg-secondary/50"),children:[e.seedSource?(0,eT.jsx)(eB,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground"}):(0,eT.jsx)(e6,{className:"mt-0.5 size-3.5 shrink-0 text-muted-foreground"}),(0,eT.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("span",{className:"block truncate text-xs text-foreground",children:e.title}),(0,eT.jsxs)("span",{className:"mt-0.5 block font-mono text-[10px] text-muted-foreground",children:[function(e){let t=new Date(e).getTime(),n=Math.round((Date.now()-t)/6e4);if(n<1)return"just now";if(n<60)return`${n}m ago`;let r=Math.round(n/60);if(r<24)return`${r}h ago`;let i=Math.round(r/24);return i<30?`${i}d ago`:new Date(e).toLocaleDateString()}(e.updatedAt)," · ",e.messageCount," msg"]})]}),(0,eT.jsx)("span",{role:"button",tabIndex:0,"aria-label":"Delete chat",onClick:t=>b(e.id,t),className:"shrink-0 rounded-sm p-1 text-muted-foreground opacity-0 transition-opacity hover:text-foreground group-hover:opacity-100",children:(0,eT.jsx)(l1,{className:"size-3.5"})})]})},e.id)})})]}),(0,eT.jsxs)("div",{className:"shrink-0 border-t border-border p-3",children:[(0,eT.jsx)("p",{className:"px-0.5 pb-1.5 font-mono text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/70",children:"Active model"}),(0,eT.jsx)(bv,{value:n,onChange:x,children:(0,eT.jsxs)("span",{className:"flex w-full items-center gap-2 rounded-sm border border-border bg-background px-2.5 py-2 text-left transition-colors hover:border-foreground/20",children:[(0,eT.jsx)(s3,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,eT.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",children:n}),(0,eT.jsx)(e4,{className:"size-3 shrink-0 text-muted-foreground"})]})})]})]})]})}let O0=eL("code-xml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]),O1=e=>fetch(e).then(e=>e.json()),O2={GET:"bg-[color:var(--sev-ok)]/15 text-[color:var(--sev-ok)]",POST:"bg-primary/15 text-primary",PUT:"bg-[color:var(--sev-warn)]/15 text-[color:var(--sev-warn)]",PATCH:"bg-[color:var(--sev-warn)]/15 text-[color:var(--sev-warn)]",DELETE:"bg-destructive/15 text-destructive"};function O4(){let{data:e,isLoading:t}=u_("/api/docs",O1),[n,r]=(0,eP.useState)(""),[i,a]=(0,eP.useState)(null),s=e?.endpoints??[],o=(0,eP.useMemo)(()=>{let e=n.trim().toLowerCase();return e?s.filter(t=>t.path.toLowerCase().includes(e)||t.summary.toLowerCase().includes(e)||t.group.toLowerCase().includes(e)||t.method.toLowerCase().includes(e)):s},[s,n]),l=(0,eP.useMemo)(()=>{let e=new Map;for(let t of o){let n=e.get(t.group)??[];n.push(t),e.set(t.group,n)}return[...e.entries()]},[o]),d=(0,eP.useMemo)(()=>s.find(e=>`${e.method} ${e.path}`===i)??null,[s,i]);return t?(0,eT.jsxs)(s8,{className:"flex items-center justify-center gap-2 p-10 text-sm text-muted-foreground",children:[(0,eT.jsx)(dj,{className:"size-4 animate-spin"}),"Loading API reference…"]}):(0,eT.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[1fr_360px]",children:[(0,eT.jsxs)("div",{className:"flex min-w-0 flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)(O0,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)("h2",{className:"font-mono text-sm font-medium text-foreground",children:e?.name}),(0,eT.jsxs)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:["v",e?.version]})]}),(0,eT.jsx)("p",{className:"text-pretty text-sm text-muted-foreground",children:e?.description})]}),(0,eT.jsxs)("div",{className:"relative",children:[(0,eT.jsx)(eX,{className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),(0,eT.jsx)("input",{value:n,onChange:e=>r(e.target.value),placeholder:"Search endpoints by path, method, or group…",className:"w-full rounded-sm border border-border bg-card py-2 pl-9 pr-3 font-mono text-sm text-foreground outline-none transition-colors placeholder:text-muted-foreground focus:border-foreground/30"})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-5",children:[l.map(([e,t])=>(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)("h3",{className:"font-mono text-[11px] uppercase tracking-wide text-muted-foreground",children:e}),(0,eT.jsx)("div",{className:"flex flex-col gap-1.5",children:t.map(e=>{let t=`${e.method} ${e.path}`;return(0,eT.jsxs)("button",{type:"button",onClick:()=>a(t),className:(0,ny.cn)("flex items-center gap-3 rounded-sm border px-3 py-2.5 text-left transition-colors",i===t?"border-foreground/30 bg-foreground/[0.05]":"border-border bg-card hover:border-foreground/20"),children:[(0,eT.jsx)("span",{className:(0,ny.cn)("w-14 shrink-0 rounded-sm px-1.5 py-0.5 text-center font-mono text-[10px] font-semibold",O2[e.method]),children:e.method}),(0,eT.jsx)("span",{className:"flex-1 truncate font-mono text-xs text-foreground",children:e.path}),(0,eT.jsx)("span",{className:"hidden truncate text-xs text-muted-foreground sm:block",children:e.summary}),(0,eT.jsx)(a4,{className:"size-3.5 shrink-0 text-muted-foreground"})]},t)})})]},e)),0===l.length&&(0,eT.jsxs)(s8,{className:"p-6 text-center text-sm text-muted-foreground",children:["No endpoints match “",n,"”."]})]})]}),(0,eT.jsx)("aside",{className:"lg:sticky lg:top-20 lg:self-start",children:d?(0,eT.jsx)(O5,{endpoint:d}):(0,eT.jsxs)(s8,{className:"flex flex-col items-center gap-2 p-8 text-center",children:[(0,eT.jsx)(oz,{className:"size-5 text-muted-foreground"}),(0,eT.jsx)("p",{className:"text-sm text-muted-foreground",children:"Select an endpoint to see its parameters, body, and response."})]})})]})}function O5({endpoint:e}){return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsx)(oS,{title:"Endpoint",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("span",{className:(0,ny.cn)("rounded-sm px-1.5 py-0.5 font-mono text-[10px] font-semibold",O2[e.method]),children:e.method}),(0,eT.jsx)("code",{className:"break-all font-mono text-xs text-foreground",children:e.path})]}),(0,eT.jsx)("p",{className:"text-pretty text-sm text-muted-foreground",children:e.description})]})}),e.pathParams?.length?(0,eT.jsx)(O6,{title:"Path parameters",fields:e.pathParams}):null,e.query?.length?(0,eT.jsx)(O6,{title:"Query parameters",fields:e.query}):null,e.body?.length?(0,eT.jsx)(O6,{title:"Request body",fields:e.body}):null,(0,eT.jsx)(oS,{title:"Response",children:(0,eT.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,eT.jsx)("p",{className:"text-sm text-foreground",children:e.returns}),e.returnsExample&&(0,eT.jsx)("pre",{className:"overflow-x-auto rounded-sm bg-secondary/60 p-2.5 font-mono text-[11px] leading-relaxed text-muted-foreground",children:e.returnsExample})]})})]})}function O6({title:e,fields:t}){return(0,eT.jsx)(oS,{title:e,children:(0,eT.jsx)("div",{className:"flex flex-col divide-y divide-border",children:t.map(e=>(0,eT.jsxs)("div",{className:"flex flex-col gap-1 py-2 first:pt-0 last:pb-0",children:[(0,eT.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,eT.jsx)("code",{className:"font-mono text-xs font-medium text-foreground",children:e.name}),(0,eT.jsx)("span",{className:"rounded-sm bg-secondary px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:e.type}),e.required?(0,eT.jsx)("span",{className:"font-mono text-[10px] text-destructive",children:"required"}):(0,eT.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground",children:"optional"})]}),(0,eT.jsx)("p",{className:"text-xs text-muted-foreground",children:e.description})]},e.name))})})}let O3=eL("radio",[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]),O9=[{id:"detect",label:"Detect project",command:"codelens detect"},{id:"lint",label:"ESLint",command:"eslint . --format json"},{id:"types",label:"TypeScript",command:"tsc --noEmit --pretty false"},{id:"deps",label:"Dependency audit",command:"pnpm audit --json"},{id:"security",label:"AI security review",command:"codelens audit --ai"},{id:"insights",label:"Project insights",command:"codelens scan --insights"}],O8=O9.map(e=>e.id);function O7(e){return["info","low","warning","medium","high","error","critical"].indexOf(e)}let Me={detect:[{level:"command",text:"$ codelens detect"},{level:"info",text:"Scanning working directory…"},{level:"success",text:"Detected Next.js 16 (App Router)"},{level:"info",text:"Package manager: pnpm · TypeScript 5.6"},{level:"success",text:"Resolved local eslint + tsc binaries"}],lint:[{level:"command",text:"$ eslint . --format json"},{level:"info",text:"Linting 142 files across 3 configs…"},{level:"warn",text:"13 warnings (react-hooks/exhaustive-deps, no-unused-vars)"},{level:"error",text:"5 errors (no-explicit-any, no-floating-promises)"},{level:"success",text:"Lint complete — 18 problems in 9 files"}],types:[{level:"command",text:"$ tsc --noEmit --pretty false"},{level:"info",text:"Type-checking 142 files…"},{level:"error",text:"app/api/orders/route.ts(31,18): error TS2345"},{level:"error",text:"lib/cart.ts(64,9): error TS2322"},{level:"success",text:"tsc finished — 4 type errors"}],deps:[{level:"command",text:"$ pnpm audit --json"},{level:"info",text:"Resolving 312 dependencies…"},{level:"warn",text:"GHSA-rrrj: prototype pollution in lodash.set (high)"},{level:"warn",text:"2 moderate advisories found"},{level:"success",text:"Audit complete — 3 advisories"}],security:[{level:"command",text:"$ codelens audit --ai"},{level:"info",text:"Selecting security-relevant files (12 of 142)…"},{level:"info",text:"Streaming to anthropic/claude-opus-4.6…"},{level:"error",text:"CRITICAL — SQL injection in app/api/orders/route.ts:31"},{level:"warn",text:"HIGH — missing authz check in app/actions/admin.ts"},{level:"success",text:"Review complete — 8 findings"}],insights:[{level:"command",text:"$ codelens scan --insights"},{level:"info",text:"Scanning project for routes, env, network, git…"},{level:"info",text:"Building dependency graph (312 nodes)…"},{level:"success",text:"Insights ready — 9 collectors"}]},Mt={detect:"idle",lint:"idle",types:"idle",deps:"idle",security:"idle",insights:"idle"};function Mn(e,t){return`${e} ${t}${1===e?"":"s"}`}function Mr(e){if("phase"===e.type){let{phase:t,status:n}=e;if("running"===n){let e=O9.find(e=>e.id===t);return[{level:"command",text:`$ ${e?.command??t}`},{level:"info",text:`${e?.label??t}…`}]}if("skipped"===n)return[{level:"info",text:`${t} skipped`}];switch(t){case"detect":{let t=e.project;return t?[{level:"success",text:`Detected ${t.framework} \xb7 ${t.packageManager}`}]:[{level:"success",text:"Project detected"}]}case"lint":{let t=e.lint;if(!t)return[{level:"success",text:"Lint complete"}];if(t.unavailable)return[{level:"warn",text:t.note??"ESLint unavailable"}];return[{level:t.errorCount>0?"error":t.warningCount>0?"warn":"success",text:`Lint complete — ${Mn(t.errorCount,"error")}, ${Mn(t.warningCount,"warning")} (${t.fixableCount} fixable)`}]}case"types":{let t=e.types;if(!t)return[{level:"success",text:"Type-check complete"}];if(t.unavailable)return[{level:"warn",text:t.note??"tsc unavailable"}];let n=t.diagnostics.length;return[{level:n>0?"error":"success",text:`tsc finished — ${Mn(n,"type error")}`}]}case"deps":return[{level:"success",text:"Dependency audit complete"}];case"security":{let t=e.security;if(!t||t.skipped)return[{level:"info",text:"AI security review skipped"}];let n=t.findings.length,r=[];return(t.failed||t.error)&&r.push({level:"error",text:t.error??"AI security review failed"}),r.push({level:t.failed||n>0?"warn":"success",text:`Review complete — ${Mn(n,"finding")}, ${Mn(t.dependencies.length,"advisory").replace("advisorys","advisories")}`}),r}case"insights":return[{level:"success",text:"Project insights ready"}];default:return[]}}if("report"===e.type){let t=e.report?.health?.score;return[{level:"info",text:`Report compiled${null!=t?` — health ${t}/100`:""}`}]}if("state"===e.type)return[{level:"success",text:"Run complete — dashboard updated"}];if("workspace"===e.type)return[{level:"info",text:`Monorepo detected: ${e.workspace.packages.length} packages (${e.workspace.tool})`}];if("package-start"===e.type)return[{level:"command",text:`Analyzing package: ${e.packageName}`},{level:"info",text:`Path: ${e.packagePath}`}];if("package-done"===e.type){let t=e.report?.health?.score;return[{level:"success",text:`Package "${e.packageName}" complete — health ${t??"?"}/100`}]}return[]}function Mi({status:e}){return"running"===e?(0,eT.jsx)(dj,{className:"size-3.5 animate-spin text-foreground"}):"done"===e?(0,eT.jsx)(iq,{className:"size-3.5 text-[color:var(--sev-ok)]"}):"skipped"===e?(0,eT.jsx)(lq,{className:"size-3 text-muted-foreground"}):(0,eT.jsx)("span",{className:"size-1.5 rounded-full bg-muted-foreground/40"})}let Ma={command:"text-foreground font-medium",info:"text-muted-foreground",success:"text-[color:var(--sev-ok)]",warn:"text-[color:var(--sev-medium)]",error:"text-[color:var(--sev-critical)]"},Ms={command:"»",info:"·",success:"✓",warn:"!",error:"×"};function Mo({report:e,packageName:t,onClose:n}){let{phases:r,logs:i,running:a,done:s,elapsedMs:o,start:l,mode:d}=function(e=!0,t=!1,n,r){let[i,a]=(0,eP.useState)(Mt),[s,o]=(0,eP.useState)([]),[l,d]=(0,eP.useState)(!1),[c,u]=(0,eP.useState)(!1),[m,p]=(0,eP.useState)(null),[f,h]=(0,eP.useState)(0),[g,x]=(0,eP.useState)(null),v=(0,eP.useRef)([]),y=(0,eP.useRef)(0),b=(0,eP.useRef)(0),k=(0,eP.useRef)(null),j=(0,eP.useRef)(null),w=(0,eP.useRef)(!1),N=(0,eP.useRef)(0),_=(0,eP.useCallback)(()=>{v.current.forEach(e=>window.clearTimeout(e)),v.current=[],null!=k.current&&(window.clearInterval(k.current),k.current=null)},[]),S=(0,eP.useCallback)(()=>{if(j.current){try{j.current.close()}catch{}j.current=null}},[]),$=(0,eP.useCallback)((e,t)=>{if(0===t.length)return;let n=(performance.now()-y.current)/1e3;o(r=>[...r,...t.map(t=>({id:b.current++,t:n,phase:e,level:t.level,text:t.text}))])},[]),I=(0,eP.useCallback)(()=>{_(),d(!1),u(!0),p(null),h(performance.now()-y.current)},[_]),E=(0,eP.useCallback)(()=>{let t=250,r=O8.filter(t=>"security"!==t||e),i=n?function(e,t){let{lint:n,types:r,security:i}=e,{framework:a,packageManager:s,hasTypeScript:o}=e.meta.project,l=[...i.findings].sort((e,t)=>O7(t.severity)-O7(e.severity))[0],d=n.errorCount>0?"error":n.warningCount>0?"warn":"success";return{detect:[{level:"command",text:`$ ${s} codelens detect`},{level:"info",text:"Scanning working directory…"},{level:"success",text:`Detected ${a}`},{level:"info",text:`Package manager: ${s}${o?" · TypeScript":""}`}],lint:[{level:"command",text:"$ eslint . --format json"},...n.unavailable?[{level:"warn",text:n.note??"ESLint not configured — skipped"}]:[{level:"info",text:"Running ESLint over the project…"},{level:d,text:`Lint complete — ${Mn(n.errorCount,"error")}, ${Mn(n.warningCount,"warning")} (${n.fixableCount} fixable)`}]],types:[{level:"command",text:"$ tsc --noEmit --pretty false"},...r.unavailable?[{level:"warn",text:r.note??"TypeScript not detected — skipped"}]:[{level:"info",text:"Type-checking project…"},{level:r.diagnostics.length>0?"error":"success",text:`tsc finished — ${Mn(r.diagnostics.length,"type error")}`}]],deps:[{level:"command",text:`$ ${s} audit --json`},{level:"info",text:"Resolving dependency advisories…"},{level:i.dependencies.length>0?"warn":"success",text:`Audit complete — ${Mn(i.dependencies.length,"advisory").replace("advisorys","advisories")}`}],security:t?[{level:"command",text:"$ codelens audit --ai"},{level:"info",text:"Selecting security-relevant files…"},{level:"info",text:"Streaming to meta-llama/llama-3.3-70b-instruct:free…"},...l?[{level:"critical"===l.severity?"error":"warn",text:`${l.severity.toUpperCase()} — ${l.title} (${l.filePath}:${l.line})`}]:[],{level:i.findings.length>0?"warn":"success",text:`Review complete — ${Mn(i.findings.length,"finding")}`}]:[{level:"info",text:"AI security review skipped (--no-ai)"}],insights:[{level:"command",text:"$ codelens scan --insights"},{level:"info",text:"Scanning routes, env, network, git & dependency graph…"},{level:"success",text:"Project insights ready"}]}}(n,e):Me;r.forEach(e=>{let n=i[e];v.current.push(window.setTimeout(()=>{p(e),a(t=>({...t,[e]:"running"}))},t)),t+=200,n.forEach(n=>{t+=220+360*Math.random(),v.current.push(window.setTimeout(()=>$(e,[n]),t))}),t+=250,v.current.push(window.setTimeout(()=>{a(t=>({...t,[e]:"done"}))},t))}),e||v.current.push(window.setTimeout(()=>a(e=>({...e,security:"skipped"})),t)),t+=400,v.current.push(window.setTimeout(I,t))},[e,I,$,n]),C=(0,eP.useCallback)(e=>{if("phase"===e.type){w.current=!0,p("done"===e.status?null:e.phase),a(t=>({...t,[e.phase]:e.status})),$(e.phase,Mr(e));return}if("report"===e.type)return void $(m??"insights",Mr(e));if("state"===e.type){if(!w.current)return;$("insights",Mr(e)),I()}},[m,I,$]),A=(0,eP.useCallback)(()=>{_(),S(),a(Mt),o([]),u(!1),d(!0),p(null),h(0),x(null),y.current=performance.now(),b.current=0,w.current=!1;let e=++N.current;k.current=window.setInterval(()=>{h(performance.now()-y.current)},100);let t=!1;try{let e="https:"===window.location.protocol?"wss":"ws",t=new WebSocket(`${e}://${window.location.host}/ws`);j.current=t,t.onmessage=e=>{try{let t=JSON.parse(e.data);C(t)}catch{}},t.onerror=()=>{try{t.close()}catch{}}}catch{}fetch(r?`/api/run?package=${encodeURIComponent(r)}`:"/api/run",{method:"POST"}).then(n=>{t=!0,N.current===e&&(n.ok||409===n.status?x("live"):(x("sim"),S(),E()))}).catch(()=>{t=!0,N.current===e&&(x("sim"),S(),E())}),v.current.push(window.setTimeout(()=>{t||N.current!==e||(x("sim"),S(),E())},4e3))},[C,_,S,E]);return(0,eP.useEffect)(()=>(t&&A(),()=>{N.current++,_(),S()}),[t]),{phases:i,logs:s,running:l,done:c,activePhase:m,elapsedMs:f,start:A,mode:g}}(e.meta.aiEnabled,!0,e,t),c=(0,eP.useRef)(null);(0,eP.useEffect)(()=>{c.current?.scrollIntoView({behavior:"smooth",block:"end"})},[i]);let u=Math.round(O9.filter(e=>"done"===r[e.id]||"skipped"===r[e.id]).length/O9.length*100),{lint:m,types:p,security:f}=e,h=[{label:"Lint",value:m.errorCount+m.warningCount,sub:`${m.errorCount} err`},{label:"Types",value:p.diagnostics.length,sub:"errors"},{label:"Deps",value:f.dependencies.length,sub:"advisories"},{label:"Security",value:f.findings.length,sub:"findings"}];return(0,eT.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-3",children:[(0,eT.jsxs)("span",{className:"inline-flex items-center gap-2 rounded-sm border border-border px-2.5 py-1.5 font-mono text-xs text-foreground",children:[s?(0,eT.jsx)(iq,{className:"size-3.5 text-[color:var(--sev-ok)]"}):a?(0,eT.jsx)(dj,{className:"size-3.5 animate-spin"}):(0,eT.jsx)(i2,{className:"size-3.5"}),s?"Complete":a?"Running…":"Ready"]}),d&&(0,eT.jsxs)("span",{className:(0,ny.cn)("inline-flex items-center gap-1.5 rounded-sm border px-2 py-1 font-mono text-[10px] uppercase","live"===d?"border-[color:var(--sev-ok)]/40 text-[color:var(--sev-ok)]":"border-border text-muted-foreground"),title:"live"===d?"Streaming real results from the CodeLens CLI":"No CLI backend connected — showing a simulated run",children:["live"===d?(0,eT.jsx)(O3,{className:"size-3"}):(0,eT.jsx)(e1,{className:"size-3"}),"live"===d?"Live":"Simulated"]}),(0,eT.jsx)("div",{className:"h-1.5 flex-1 overflow-hidden rounded-full bg-secondary",children:(0,eT.jsx)("div",{className:"h-full rounded-full bg-foreground transition-all duration-500",style:{width:`${u}%`}})}),(0,eT.jsxs)("span",{className:"font-mono text-xs tabular-nums text-muted-foreground",children:[(o/1e3).toFixed(1),"s · ",u,"%"]}),s&&(0,eT.jsxs)(eT.Fragment,{children:[(0,eT.jsxs)("button",{type:"button",onClick:l,className:"inline-flex items-center gap-1.5 rounded-sm border border-border px-2.5 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",children:[(0,eT.jsx)(dk,{className:"size-3.5"}),"Re-run"]}),(0,eT.jsxs)("button",{type:"button",onClick:n,className:"inline-flex items-center gap-1.5 rounded-sm bg-foreground px-3 py-1.5 font-mono text-xs text-background transition-opacity hover:opacity-90",children:[(0,eT.jsx)(iq,{className:"size-3.5"}),"Done"]})]})]}),(0,eT.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row",children:[(0,eT.jsx)("aside",{className:"w-full lg:w-64 lg:shrink-0",children:(0,eT.jsx)("ol",{className:"flex flex-col gap-1",children:O9.map((e,t)=>{let n=r[e.id];return(0,eT.jsxs)("li",{className:(0,ny.cn)("flex items-center gap-3 rounded-sm border px-3 py-2 transition-colors","running"===n?"border-foreground/30 bg-foreground/[0.04]":"border-border"),children:[(0,eT.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center",children:(0,eT.jsx)(Mi,{status:n})}),(0,eT.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,eT.jsx)("p",{className:(0,ny.cn)("font-mono text-sm","idle"===n?"text-muted-foreground/60":"text-foreground"),children:e.label}),(0,eT.jsx)("p",{className:"truncate font-mono text-[10px] text-muted-foreground/60",children:e.command})]}),(0,eT.jsx)("span",{className:"font-mono text-[10px] tabular-nums text-muted-foreground/50",children:String(t+1).padStart(2,"0")})]},e.id)})})}),(0,eT.jsxs)("section",{className:"min-w-0 flex-1",children:[(0,eT.jsxs)("div",{className:"flex h-72 flex-col rounded-sm border border-border bg-card sm:h-80",children:[(0,eT.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-4 py-2.5",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsxs)("div",{className:"flex gap-1.5",children:[(0,eT.jsx)("span",{className:"size-2.5 rounded-full border border-border"}),(0,eT.jsx)("span",{className:"size-2.5 rounded-full border border-border"}),(0,eT.jsx)("span",{className:"size-2.5 rounded-full border border-border"})]}),(0,eT.jsx)("span",{className:"ml-1 font-mono text-xs text-muted-foreground",children:"codelens — run log"})]}),(0,eT.jsxs)("span",{className:"font-mono text-[10px] uppercase text-muted-foreground/60",children:[i.length," lines"]})]}),(0,eT.jsxs)("div",{className:"flex-1 overflow-auto px-4 py-3 font-mono text-xs leading-relaxed",children:[0===i.length&&(0,eT.jsx)("p",{className:"text-muted-foreground/60",children:"Waiting for output…"}),i.map(e=>(0,eT.jsxs)("div",{className:"flex gap-3",children:[(0,eT.jsxs)("span",{className:"shrink-0 tabular-nums text-muted-foreground/40",children:[e.t.toFixed(1).padStart(4," "),"s"]}),(0,eT.jsx)("span",{className:(0,ny.cn)("w-3 shrink-0 text-center",Ma[e.level]),children:Ms[e.level]}),(0,eT.jsx)("span",{className:(0,ny.cn)("whitespace-pre-wrap",Ma[e.level]),children:e.text})]},e.id)),(0,eT.jsx)("div",{ref:c})]})]}),(0,eT.jsx)("div",{className:(0,ny.cn)("mt-4 grid grid-cols-2 gap-3 transition-opacity sm:grid-cols-4",s?"opacity-100":"opacity-40"),children:h.map(e=>(0,eT.jsxs)("div",{className:"rounded-sm border border-border bg-card px-4 py-3",children:[(0,eT.jsx)("p",{className:"font-mono text-[10px] uppercase tracking-wide text-muted-foreground",children:e.label}),(0,eT.jsx)("p",{className:"mt-1 font-mono text-2xl font-semibold tabular-nums text-foreground",children:e.value}),(0,eT.jsx)("p",{className:"font-mono text-[10px] text-muted-foreground/70",children:e.sub})]},e.label))})]})]})]})}function Ml({open:e,onOpenChange:t,report:n,packageName:r}){return(0,eT.jsx)(sO,{open:e,onOpenChange:t,children:(0,eT.jsxs)(sL,{className:"max-h-[90svh] gap-0 overflow-y-auto sm:max-w-3xl lg:max-w-4xl",children:[(0,eT.jsxs)(sU,{className:"border-b border-border pb-4",children:[(0,eT.jsx)(sZ,{className:"font-mono",children:"Run checks"}),(0,eT.jsxs)(sF,{children:[n.meta.project.framework," · ",n.meta.project.packageManager," · ",n.meta.project.root]})]}),(0,eT.jsx)("div",{className:"pt-5",children:e&&(0,eT.jsx)(Mo,{report:n,packageName:r,onClose:()=>t(!1)})})]})})}let Md={value:"settings",label:"Settings",icon:e5},Mc={value:"chat",label:"AI Chat",icon:e6};function Mu({report:e,history:t,insights:n,empty:r=!1,demoActive:i=!1,onToggleDemo:a,workspace:s}){let o,l,[d,c]=(0,eP.useState)("overview"),[u,m]=(0,eP.useState)(!1),[p,f]=(0,eP.useState)(!1),[h,g]=(0,eP.useState)(null),x=(0,eP.useMemo)(()=>h&&s?.packages[h]?s.packages[h].report:e,[h,s,e]),v=(0,eP.useMemo)(()=>h&&s?.packages[h]?s.packages[h].insights:n,[h,s,n]),{lint:y,types:b,security:k,deps:j}=x,[w,N]=(0,eP.useState)(null),[_,S]=(0,eP.useState)(void 0),$=(0,eP.useCallback)(e=>{N(e),S(e=>(e??0)+1),c("chat")},[]),[I,E]=(0,eP.useState)(!0);(0,eP.useEffect)(()=>{E(gN().chatEnabled)},[]),(0,eP.useEffect)(()=>{I||"chat"!==d||c("overview")},[I,d]);let C=(0,eP.useMemo)(()=>{var e;return e=v.auth.present,[{items:[{value:"overview",label:"Overview",icon:eU},...s?[{value:"workspace",label:"Packages",icon:te}]:[],{value:"trends",label:"Trends",icon:e8},{value:"tasks",label:"Task Manager",icon:e7}]},{label:"Code Quality",items:[{value:"lint",label:"Lint",icon:eZ},{value:"types",label:"Types",icon:eF},{value:"tests",label:"Tests",icon:e1}]},{label:"Security",items:[{value:"security",label:"Security",icon:eB},{value:"deps",label:"Dependencies",icon:eq},{value:"env",label:"Environment",icon:eH},{value:"network",label:"Network",icon:eG},...v.api.present?[{value:"api-surface",label:"API Surface",icon:e9}]:[],...e?[{value:"auth",label:"Auth",icon:eV}]:[]]},{label:"Experience",items:[{value:"performance",label:"Performance",icon:e0},{value:"accessibility",label:"Accessibility",icon:eQ}]},{label:"Project",items:[{value:"setup",label:"Setup",icon:eJ},{value:"database",label:"Database",icon:eW},{value:"git",label:"Git & CI/CD",icon:eK},{value:"docs",label:"Docs",icon:eY},{value:"api",label:"API Reference",icon:e3}]}]},[v.auth.present,v.api.present,s]),A=(0,eP.useMemo)(()=>C.flatMap(e=>e.items),[C]),T={tasks:(o=lN(lm),l=new Set(lu().filter(e=>e.done).map(e=>e.id)),o.filter(e=>!l.has(e.columnId)).length),lint:y.errorCount+y.warningCount,types:b.diagnostics.length,tests:v.tests.findings.length,security:k.findings.length,deps:j.findings.length,env:v.env.counts.issues,network:v.network.counts.issues,performance:v.performance.findings.length,accessibility:v.accessibility.violations.length,database:v.database.findings.length,"api-surface":v.api.counts.findings,auth:v.auth.counts.findings,git:v.git.issues.length+v.git.workflows.reduce((e,t)=>e+t.issues.length,0),docs:v.docs.standards.flatMap(e=>e.checks).filter(e=>"fail"===e.status||"warn"===e.status).length},P=(0,eP.useCallback)(e=>c(e),[]),z=[...A,Mc,Md].find(e=>e.value===d)??A[0];return(0,eP.useEffect)(()=>{function e(e){if((e.metaKey||e.ctrlKey)&&"k"===e.key.toLowerCase()){e.preventDefault(),m(e=>!e);return}let t=e.target;if(t&&("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)||e.metaKey||e.ctrlKey||e.altKey)return;if("/"===e.key){e.preventDefault(),m(!0);return}let n=Number.parseInt(e.key,10);if(!Number.isNaN(n)){let t=0===n?9:n-1;A[t]&&(e.preventDefault(),c(A[t].value))}}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[A]),(0,eT.jsx)("main",{className:"min-h-svh bg-background",children:(0,eT.jsxs)(lz,{projectRoot:e.meta.project.root,onAskAI:I?$:void 0,children:[(0,eT.jsxs)("div",{className:"flex",children:[(0,eT.jsxs)("aside",{className:"sticky top-0 hidden h-svh w-60 shrink-0 flex-col border-r border-border bg-card lg:flex",children:[(0,eT.jsxs)("div",{className:"flex h-16 shrink-0 items-center gap-3 border-b border-border px-4",children:[(0,eT.jsx)("div",{className:"flex size-9 shrink-0 items-center justify-center rounded-sm border border-border text-foreground",children:(0,eT.jsx)(e2,{className:"size-5"})}),(0,eT.jsxs)("div",{className:"flex items-center gap-2",children:[(0,eT.jsx)("h1",{className:"font-mono text-base font-semibold text-foreground",children:"CodeLens"}),e.meta.aiEnabled&&(0,eT.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-sm border border-border px-1.5 py-0.5 font-mono text-[10px] uppercase text-foreground",children:[(0,eT.jsx)(e4,{className:"size-2.5"}),"AI"]})]})]}),s&&(0,eT.jsx)("div",{className:"border-b border-border p-3",children:(0,eT.jsx)(y4,{monorepo:s.monorepo,aggregate:s.aggregate,selectedPackage:h,onSelect:g})}),(0,eT.jsx)("nav",{"aria-label":"Analysis sections",className:"flex flex-1 flex-col gap-5 overflow-y-auto p-3",children:C.map((e,t)=>(0,eT.jsxs)("div",{className:"flex flex-col gap-0.5",children:[e.label&&(0,eT.jsx)("p",{className:"px-2 pb-1 font-mono text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/70",children:e.label}),e.items.map(e=>{let t=d===e.value;return(0,eT.jsxs)("button",{type:"button","aria-current":t?"page":void 0,onClick:()=>c(e.value),className:(0,ny.cn)("flex w-full items-center gap-2.5 rounded-sm px-2 py-1.5 text-sm transition-colors",t?"bg-secondary font-medium text-foreground":"text-muted-foreground hover:bg-secondary/50 hover:text-foreground"),children:[(0,eT.jsx)(e.icon,{className:"size-4 shrink-0"}),(0,eT.jsx)("span",{className:"flex-1 truncate text-left",children:e.label}),T[e.value]>0&&(0,eT.jsx)(nS,{variant:"secondary",className:"font-mono text-[10px] tabular-nums",children:T[e.value]})]},e.value)})]},e.label??`group-${t}`))}),(0,eT.jsxs)("div",{className:"flex shrink-0 flex-col gap-1 border-t border-border p-3",children:[I&&(0,eT.jsxs)("button",{type:"button","aria-current":"chat"===d?"page":void 0,onClick:()=>c("chat"),className:(0,ny.cn)("flex w-full items-center gap-2.5 rounded-sm px-2 py-1.5 text-sm transition-colors","chat"===d?"bg-secondary font-medium text-foreground":"text-muted-foreground hover:bg-secondary/50 hover:text-foreground"),children:[(0,eT.jsx)(e6,{className:"size-4 shrink-0"}),(0,eT.jsx)("span",{className:"flex-1 text-left",children:"AI Chat"}),(0,eT.jsx)(e4,{className:"size-3 shrink-0 text-muted-foreground"})]}),(0,eT.jsxs)("button",{type:"button","aria-current":"settings"===d?"page":void 0,onClick:()=>c("settings"),className:(0,ny.cn)("flex w-full items-center gap-2.5 rounded-sm px-2 py-1.5 text-sm transition-colors","settings"===d?"bg-secondary font-medium text-foreground":"text-muted-foreground hover:bg-secondary/50 hover:text-foreground"),children:[(0,eT.jsx)(e5,{className:"size-4 shrink-0"}),(0,eT.jsx)("span",{className:"flex-1 text-left",children:"Settings"})]})]})]}),(0,eT.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,eT.jsx)(s1,{project:x.meta.project,aiEnabled:x.meta.aiEnabled,lastRunMs:r?null:x.meta.durationMs,lastRunLabel:"just now",empty:r,demoActive:i,onToggleDemo:a,onOpenSearch:()=>m(!0),onRunChecks:()=>f(!0)}),r&&"settings"!==d&&"chat"!==d?(0,eT.jsx)(y2,{onRunChecks:()=>f(!0),onLoadDemo:()=>a?.(!0)}):(0,eT.jsxs)(nb,{value:d,onValueChange:c,className:"flex flex-col gap-4 px-4 py-6 sm:px-6",children:[(0,eT.jsxs)("div",{className:"flex items-center gap-2 lg:hidden",children:[(0,eT.jsxs)(iH,{value:d,onValueChange:e=>e&&c(e),children:[(0,eT.jsx)(iJ,{className:"flex-1",children:(0,eT.jsxs)("span",{className:"flex items-center gap-2",children:[(0,eT.jsx)(z.icon,{className:"size-4 text-muted-foreground"}),(0,eT.jsx)(iK,{})]})}),(0,eT.jsxs)(iY,{children:[C.map((e,t)=>(0,eT.jsxs)(iG,{children:[e.label&&(0,eT.jsx)(iX,{children:e.label}),e.items.map(e=>(0,eT.jsx)(iQ,{value:e.value,children:(0,eT.jsxs)("span",{className:"flex items-center gap-2",children:[(0,eT.jsx)(e.icon,{className:"size-4 text-muted-foreground"}),e.label,T[e.value]>0&&(0,eT.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground",children:T[e.value]})]})},e.value))]},e.label??`group-${t}`)),(0,eT.jsxs)(iG,{children:[(0,eT.jsx)(iX,{children:"Configuration"}),I&&(0,eT.jsx)(iQ,{value:Mc.value,children:(0,eT.jsxs)("span",{className:"flex items-center gap-2",children:[(0,eT.jsx)(Mc.icon,{className:"size-4 text-muted-foreground"}),Mc.label]})}),(0,eT.jsx)(iQ,{value:Md.value,children:(0,eT.jsxs)("span",{className:"flex items-center gap-2",children:[(0,eT.jsx)(Md.icon,{className:"size-4 text-muted-foreground"}),Md.label]})})]})]})]}),(0,eT.jsx)("button",{type:"button",onClick:()=>m(!0),"aria-label":"Search",className:"inline-flex size-9 shrink-0 items-center justify-center rounded-sm border border-border bg-card text-muted-foreground transition-colors hover:text-foreground",children:(0,eT.jsx)(eX,{className:"size-4"})})]}),(0,eT.jsxs)("div",{className:"min-w-0",children:[(0,eT.jsx)(nN,{value:"overview",children:(0,eT.jsx)(lF,{report:x,history:t,insights:v,onSelectTab:P})}),s&&(0,eT.jsx)(nN,{value:"workspace",children:(0,eT.jsx)(y5,{workspace:s,onSelectPackage:e=>{g(e),c("overview")}})}),(0,eT.jsx)(nN,{value:"trends",children:(0,eT.jsx)(lK,{history:t,report:x})}),(0,eT.jsx)(nN,{value:"tasks",children:(0,eT.jsx)(l3,{})}),(0,eT.jsx)(nN,{value:"lint",children:(0,eT.jsx)(di,{lint:y})}),(0,eT.jsx)(nN,{value:"types",children:(0,eT.jsx)(dy,{types:b})}),(0,eT.jsx)(nN,{value:"tests",children:(0,eT.jsx)(xc,{tests:v.tests})}),(0,eT.jsx)(nN,{value:"security",children:(0,eT.jsx)(d$,{security:k})}),(0,eT.jsx)(nN,{value:"deps",children:(0,eT.jsx)(dM,{deps:j})}),(0,eT.jsx)(nN,{value:"env",children:(0,eT.jsx)(cN,{env:v.env})}),(0,eT.jsx)(nN,{value:"network",children:(0,eT.jsx)(cI,{network:v.network})}),(0,eT.jsx)(nN,{value:"performance",children:(0,eT.jsx)(xr,{performance:v.performance})}),(0,eT.jsx)(nN,{value:"accessibility",children:(0,eT.jsx)(g3,{accessibility:v.accessibility})}),(0,eT.jsx)(nN,{value:"database",children:(0,eT.jsx)(d3,{database:v.database})}),v.api.present&&(0,eT.jsx)(nN,{value:"api-surface",children:(0,eT.jsx)(ce,{api:v.api})}),v.auth.present&&(0,eT.jsx)(nN,{value:"auth",children:(0,eT.jsx)(ch,{auth:v.auth})}),(0,eT.jsx)(nN,{value:"git",children:(0,eT.jsx)(gU,{git:v.git})}),(0,eT.jsx)(nN,{value:"setup",children:(0,eT.jsx)(gW,{setup:v.setup})}),(0,eT.jsx)(nN,{value:"docs",children:(0,eT.jsx)(g2,{docs:v.docs})}),(0,eT.jsx)(nN,{value:"api",children:(0,eT.jsx)(O4,{})}),(0,eT.jsx)(nN,{value:"chat",className:"-mx-4 -my-6 sm:-mx-6",children:(0,eT.jsx)(OQ,{pendingSeed:w,seedNonce:_})}),(0,eT.jsx)(nN,{value:"settings",children:(0,eT.jsx)(bw,{})})]})]})]})]}),(0,eT.jsx)(y0,{open:u,onOpenChange:m,tabs:A,onSelectTab:P,onRunChecks:()=>f(!0),report:x,insights:v}),(0,eT.jsx)(Ml,{open:p,onOpenChange:f,report:x,packageName:h??void 0})]})})}let Mm={report:{meta:{id:"",cwd:"",project:{root:"",framework:"—",packageManager:"npm",hasTypeScript:!1,hasLintScript:!1},startedAt:"",finishedAt:"",durationMs:0,aiEnabled:!1},health:{score:0,grade:"F",breakdown:{lint:0,types:0,security:0}},lint:{messages:[],errorCount:0,warningCount:0,fixableCount:0},types:{diagnostics:[],definitions:[]},security:{findings:[],dependencies:[],skipped:!1},deps:{counts:{total:0,direct:0,dev:0,transitive:0},findings:[],manifestPath:"",graph:{root:"",nodes:[]}}},insights:{env:{files:[],variables:[],counts:{total:0,client:0,server:0,issues:0}},network:{calls:[],domains:[],counts:{total:0,external:0,insecure:0,issues:0}},git:{state:{branch:"",defaultBranch:"",ahead:0,behind:0,remote:"",remoteInfo:void 0,lastCommit:{hash:"",message:"",author:"",relative:""},recentCommits:[],branches:[],tags:[],ignored:{count:0,samples:[]},stashes:0,changes:[],staged:0,contributors:0,totalCommits:0},issues:[],workflows:[]},setup:{configs:[],stats:{totalFiles:0,totalLoc:0,codeLoc:0,commentLoc:0,blankLoc:0,testFiles:0,testLoc:0,components:0,routes:0,largestFiles:[],languages:[],commentRatio:0,testRatio:0,todoCount:0},tooling:[]},docs:{score:0,grade:"F",band:"poor",agentReady:!1,agentScore:0,liveUrl:null,standards:[],documents:[]},database:{connections:[],findings:[],queries:[],counts:{connections:0,collections:0,findings:0,slowQueries:0}},auth:{present:!1,methods:[],socialProviders:[],plugins:[],config:[],session:{},findings:[],counts:{plugins:0,methods:0,providers:0,findings:0}},api:{present:!1,endpoints:[],groups:[],methodCounts:[],findings:[],counts:{endpoints:0,dynamic:0,mutations:0,protected:0,validated:0,findings:0}},accessibility:{score:0,violations:[],passes:0,incomplete:0,counts:{critical:0,serious:0,moderate:0,minor:0},byPrinciple:[]},performance:{score:0,vitals:[],bundles:[],findings:[],totalBundleKb:0,counts:{findings:0}},tests:{framework:"",coverage:{lines:0,functions:0,branches:0,statements:0},suites:[],findings:[],files:[],counts:{total:0,passed:0,failed:0,skipped:0,suites:0,durationMs:0}}},history:[]},Mp={report:{meta:{id:"run_8f3a2c",cwd:"/Users/dev/projects/storefront",project:{root:"/Users/dev/projects/storefront",framework:"Next.js",packageManager:"pnpm",hasTypeScript:!0,hasLintScript:!0},startedAt:"2026-06-17T14:32:01.000Z",finishedAt:"2026-06-17T14:32:19.420Z",durationMs:18420,aiEnabled:!0},health:{score:72,grade:"C",breakdown:{lint:78,types:80,security:58}},lint:{errorCount:4,warningCount:7,fixableCount:5,messages:[{filePath:"app/products/[id]/page.tsx",line:23,column:7,endLine:23,endColumn:34,severity:"error",ruleId:"react-hooks/rules-of-hooks",message:'React Hook "useState" is called conditionally. React Hooks must be called in the exact same order in every render.',fixable:!1,snippet:{startLine:21,code:" if (!params.id) return null\n\n const [qty, setQty] = useState(1)\n const { data } = useProduct(params.id)"}},{filePath:"app/products/[id]/page.tsx",line:48,column:11,severity:"warning",ruleId:"@typescript-eslint/no-unused-vars",message:"'discount' is assigned a value but never used.",fixable:!1,snippet:{startLine:47,code:" const price = data.price\n const discount = data.discount ?? 0\n return <PriceTag value={price} />"}},{filePath:"lib/cart.ts",line:12,column:1,severity:"error",ruleId:"@typescript-eslint/no-floating-promises",message:"Promises must be awaited, end with a call to .catch, or be explicitly marked as ignored with the `void` operator.",fixable:!1,snippet:{startLine:11,code:"export function addItem(id: string) {\n syncCartToServer(id)\n}"}},{filePath:"lib/cart.ts",line:30,column:9,severity:"warning",ruleId:"prefer-const",message:"'total' is never reassigned. Use 'const' instead.",fixable:!0,snippet:{startLine:30,code:" let total = items.reduce((s, i) => s + i.price, 0)"}},{filePath:"components/checkout-form.tsx",line:67,column:5,severity:"error",ruleId:"jsx-a11y/label-has-associated-control",message:"A form label must be associated with a control.",fixable:!1},{filePath:"components/checkout-form.tsx",line:89,column:13,severity:"warning",ruleId:"@typescript-eslint/no-explicit-any",message:"Unexpected any. Specify a different type.",fixable:!1},{filePath:"components/checkout-form.tsx",line:92,column:13,severity:"warning",ruleId:"@typescript-eslint/no-explicit-any",message:"Unexpected any. Specify a different type.",fixable:!1},{filePath:"app/api/orders/route.ts",line:15,column:3,severity:"error",ruleId:"no-console",message:"Unexpected console statement.",fixable:!0},{filePath:"app/api/orders/route.ts",line:40,column:7,severity:"warning",ruleId:"eqeqeq",message:"Expected '===' and instead saw '=='.",fixable:!0},{filePath:"hooks/use-product.ts",line:8,column:5,severity:"warning",ruleId:"react-hooks/exhaustive-deps",message:"React Hook useEffect has a missing dependency: 'productId'.",fixable:!0},{filePath:"hooks/use-product.ts",line:22,column:1,severity:"warning",ruleId:"import/order",message:"There should be no empty line within import group.",fixable:!0}]},types:{diagnostics:[{filePath:"lib/cart.ts",line:18,column:14,code:"TS2345",message:"Argument of type 'string | undefined' is not assignable to parameter of type 'string'.",related:[{message:"Type 'undefined' is not assignable to type 'string'.",depth:1}]},{filePath:"components/checkout-form.tsx",line:54,column:9,code:"TS2322",message:"Type '{ value: number; onChange: (v: string) => void; }' is not assignable to type 'IntrinsicAttributes & PriceInputProps'.",related:[{message:"Types of property 'onChange' are incompatible.",depth:1},{message:"Type '(v: string) => void' is not assignable to type '(v: number) => void'.",depth:2},{message:"Types of parameters 'v' and 'v' are incompatible.",depth:3},{message:"Type 'number' is not assignable to type 'string'.",depth:4}]},{filePath:"app/api/orders/route.ts",line:27,column:20,code:"TS18048",message:"'session.user' is possibly 'undefined'.",related:[]}],definitions:[{id:"t-cartitem",name:"CartItem",kind:"interface",filePath:"lib/cart.ts",line:4,exported:!0,references:23,extendsFrom:["Identifiable"],doc:"A single line item in a shopping cart.",members:[{name:"id",type:"string",readonly:!0,doc:"Stable line-item id."},{name:"productId",type:"string"},{name:"name",type:"string"},{name:"unitPrice",type:"number",doc:"Price in minor units (cents)."},{name:"quantity",type:"number"},{name:"options",type:"Record<string, string>",optional:!0},{name:"addedAt",type:"Date",readonly:!0}],source:"export interface CartItem extends Identifiable {\n readonly id: string\n productId: string\n name: string\n /** Price in minor units (cents). */\n unitPrice: number\n quantity: number\n options?: Record<string, string>\n readonly addedAt: Date\n}"},{id:"t-cart",name:"Cart",kind:"interface",filePath:"lib/cart.ts",line:16,exported:!0,references:31,doc:"The full cart aggregate persisted per session.",members:[{name:"id",type:"string",readonly:!0},{name:"items",type:"CartItem[]"},{name:"currency",type:"Currency"},{name:"subtotal",type:"number"},{name:"discount",type:"Discount | null"},{name:"updatedAt",type:"Date"}],source:"export interface Cart {\n readonly id: string\n items: CartItem[]\n currency: Currency\n subtotal: number\n discount: Discount | null\n updatedAt: Date\n}"},{id:"t-currency",name:"Currency",kind:"type",filePath:"lib/money.ts",line:2,exported:!0,references:14,doc:"Supported ISO-4217 currency codes.",members:[],source:'export type Currency = "USD" | "EUR" | "GBP" | "JPY" | "CAD"'},{id:"t-orderstatus",name:"OrderStatus",kind:"enum",filePath:"lib/orders.ts",line:6,exported:!0,references:19,members:[{name:"Pending",type:'"pending"'},{name:"Paid",type:'"paid"'},{name:"Shipped",type:'"shipped"'},{name:"Delivered",type:'"delivered"'},{name:"Cancelled",type:'"cancelled"'}],source:'export enum OrderStatus {\n Pending = "pending",\n Paid = "paid",\n Shipped = "shipped",\n Delivered = "delivered",\n Cancelled = "cancelled",\n}'},{id:"t-apiresponse",name:"ApiResponse",kind:"type",filePath:"lib/api.ts",line:11,exported:!0,references:42,generics:["T"],doc:"Discriminated union returned by every API route.",members:[],source:"export type ApiResponse<T> =\n | { ok: true; data: T }\n | { ok: false; error: string; code: number }"},{id:"t-identifiable",name:"Identifiable",kind:"interface",filePath:"lib/types.ts",line:1,exported:!0,references:8,doc:"Base shape for entities with a stable id.",members:[{name:"id",type:"string",readonly:!0}],source:"export interface Identifiable {\n readonly id: string\n}"},{id:"t-discount",name:"Discount",kind:"interface",filePath:"lib/cart.ts",line:26,exported:!1,references:3,members:[{name:"code",type:"string"},{name:"kind",type:'"percent" | "fixed"'},{name:"amount",type:"number"}],source:'interface Discount {\n code: string\n kind: "percent" | "fixed"\n amount: number\n}'},{id:"t-priceinputprops",name:"PriceInputProps",kind:"interface",filePath:"components/checkout-form.tsx",line:12,exported:!1,references:2,doc:"Props for the controlled price input.",members:[{name:"value",type:"number"},{name:"onChange",type:"(v: number) => void"},{name:"currency",type:"Currency",optional:!0},{name:"disabled",type:"boolean",optional:!0}],source:"interface PriceInputProps {\n value: number\n onChange: (v: number) => void\n currency?: Currency\n disabled?: boolean\n}"}]},security:{skipped:!1,findings:[{id:"s1",title:"SQL injection via unparameterized query",severity:"critical",category:"injection",filePath:"app/api/orders/route.ts",line:31,endLine:33,confidence:.94,description:"User-controlled `email` is concatenated directly into a SQL string. An attacker can inject arbitrary SQL, reading or destroying order data.",recommendation:"Use a parameterized query so the driver escapes input. Never interpolate request values into SQL strings.",suggestedFix:"- const rows = await sql(`SELECT * FROM orders WHERE email = '${email}'`)\n+ const rows = await sql`SELECT * FROM orders WHERE email = ${email}`",reference:"CWE-89",snippet:{startLine:31,code:" const email = req.nextUrl.searchParams.get('email')\n const rows = await sql(\n `SELECT * FROM orders WHERE email = '${email}'`)"}},{id:"s2",title:"Service role key exposed to the client bundle",severity:"critical",category:"secrets",filePath:"lib/supabase.ts",line:4,confidence:.9,description:"`NEXT_PUBLIC_SUPABASE_SERVICE_ROLE` is read in a module imported by client components. The `NEXT_PUBLIC_` prefix inlines it into the browser bundle, leaking full database access.",recommendation:"Remove the NEXT_PUBLIC_ prefix and only use the service role key in server-only code (Route Handlers / Server Actions).",suggestedFix:"- const key = process.env.NEXT_PUBLIC_SUPABASE_SERVICE_ROLE\n+ // server-only — never expose the service role to the client\n+ const key = process.env.SUPABASE_SERVICE_ROLE",reference:"CWE-200",snippet:{startLine:4,code:"export const admin = createClient(url,\n process.env.NEXT_PUBLIC_SUPABASE_SERVICE_ROLE!)"}},{id:"s3",title:"Missing authorization check on order lookup",severity:"high",category:"auth",filePath:"app/api/orders/route.ts",line:22,confidence:.81,description:"The handler returns orders for any email passed in the query string without verifying the session user owns them. This is an IDOR allowing access to other customers' orders.",recommendation:"Derive the user from the authenticated session and scope the query to that user id rather than trusting query input.",suggestedFix:"- const email = req.nextUrl.searchParams.get('email')\n+ const session = await auth()\n+ if (!session?.user) return new Response('Unauthorized', { status: 401 })\n+ const email = session.user.email",reference:"CWE-639"},{id:"s4",title:"Unsafe innerHTML render of product description",severity:"high",category:"xss",filePath:"app/products/[id]/page.tsx",line:60,confidence:.77,description:"Product description from the API is rendered with `dangerouslySetInnerHTML` without sanitization, enabling stored XSS if descriptions are attacker-controllable.",recommendation:"Sanitize the HTML with a library like DOMPurify, or render as plain text.",suggestedFix:"- <div dangerouslySetInnerHTML={{ __html: data.description }} />\n+ <div dangerouslySetInnerHTML={{ __html: sanitize(data.description) }} />",reference:"CWE-79"},{id:"s5",title:"Weak hashing for password reset tokens",severity:"medium",category:"crypto",filePath:"lib/tokens.ts",line:9,confidence:.68,description:"Reset tokens are derived with MD5, which is fast and collision-prone. Tokens may be predictable or brute-forceable.",recommendation:"Generate tokens with `crypto.randomBytes(32)` and store a SHA-256 hash, comparing in constant time.",suggestedFix:"- const token = crypto.createHash('md5').update(email).digest('hex')\n+ const token = crypto.randomBytes(32).toString('hex')",reference:"CWE-327"}],dependencies:[{name:"next",currentVersion:"14.1.0",dependencyType:"direct",severity:"high",title:"Server-Side Request Forgery in Next.js Image Optimization",cves:["CVE-2024-34351"],fixedIn:"14.1.1",impact:"Reachable — this app uses next/image with remote patterns, so the optimizer endpoint is exposed. Upgrade is low-risk (patch)."},{name:"axios",currentVersion:"1.6.2",dependencyType:"direct",severity:"medium",title:"Cross-Site Request Forgery via crafted absolute URL",cves:["CVE-2023-45857"],fixedIn:"1.6.5",impact:"Partially reachable — axios is used for server-to-server calls only, lowering practical risk. Still worth patching."},{name:"semver",currentVersion:"7.5.1",dependencyType:"transitive",severity:"low",title:"Regular Expression Denial of Service in semver",cves:["CVE-2022-25883"],fixedIn:"7.5.2",impact:"Low real-world risk — transitive, only parses trusted version strings during install. Safe to defer."}]},deps:{manifestPath:"package.json",counts:{total:312,direct:8,dev:5,transitive:299},findings:[{id:"d1",name:"next",current:"14.1.0",latest:"15.3.0",type:"direct",kind:"vulnerability",severity:"high",title:"SSRF in Next.js Image Optimization",detail:"The image optimizer in Next.js < 14.1.1 can be coerced into making requests to arbitrary internal hosts. This app configures next/image with remote patterns, so the optimizer endpoint is publicly reachable.",recommendation:"Upgrade to the latest 14.x patch immediately; the fix is low-risk. Plan the 15.x major separately.",fixedIn:"14.1.1",cves:["CVE-2024-34351"],reference:"https://github.com/advisories/GHSA-fr5h-rqp8-mj6g",usedIn:["app/products/[id]/page.tsx"]},{id:"d2",name:"axios",current:"1.6.2",latest:"1.7.7",type:"direct",kind:"vulnerability",severity:"medium",title:"CSRF via crafted absolute URL",detail:"axios < 1.6.5 may attach credentials to cross-origin requests when given a maliciously crafted absolute URL. Used here only for server-to-server calls, which lowers practical risk.",recommendation:"Bump to 1.7.x — no breaking changes for this codebase.",fixedIn:"1.6.5",cves:["CVE-2023-45857"],reference:"https://github.com/advisories/GHSA-wf5p-g6vw-rhxx"},{id:"d3",name:"semver",current:"7.5.1",latest:"7.6.3",type:"transitive",kind:"vulnerability",severity:"low",title:"ReDoS in semver range parsing",detail:"A transitive copy of semver < 7.5.2 is vulnerable to regular-expression denial of service. It only parses trusted version strings during install, so real-world risk is minimal.",recommendation:"Add a package-manager override to force semver ≥ 7.5.2, or wait for the parent to update.",fixedIn:"7.5.2",cves:["CVE-2022-25883"],reference:"https://github.com/advisories/GHSA-c2qf-rxjj-qqgw"},{id:"d4",name:"lodash",current:"4.17.20",latest:"4.17.21",type:"direct",kind:"outdated",severity:"medium",title:"Behind on security patches (4.17.20 → 4.17.21)",detail:"4.17.21 ships the fix for the prototype-pollution advisory in zipObjectDeep. You are one patch behind, and most of lodash can be replaced with native ES methods.",recommendation:"Upgrade to 4.17.21, then consider dropping lodash in favor of native array/object methods.",fixedIn:"4.17.21",reference:"https://www.npmjs.com/package/lodash"},{id:"d5",name:"moment",current:"2.29.4",latest:"2.30.1",type:"direct",kind:"deprecated",severity:"medium",title:"Package is in maintenance mode",detail:"Moment is no longer actively developed and ships a large, non-tree-shakeable bundle. The maintainers recommend migrating to a modern alternative for new code.",recommendation:"Migrate to date-fns or Day.js to cut bundle size and gain immutable, tree-shakeable APIs.",reference:"https://momentjs.com/docs/#/-project-status/"},{id:"d6",name:"node-sass",current:"7.0.3",latest:"7.0.3",type:"dev",kind:"deprecated",severity:"high",title:"Deprecated — relies on unmaintained LibSass",detail:"node-sass is deprecated and depends on native LibSass, which is end-of-life and frequently breaks on new Node versions during install.",recommendation:"Replace node-sass with the pure-JS `sass` (Dart Sass) package. It is a near drop-in replacement.",reference:"https://sass-lang.com/blog/libsass-is-deprecated/"},{id:"d7",name:"request",current:"2.88.2",latest:"2.88.2",type:"dev",kind:"deprecated",severity:"medium",title:"Fully deprecated HTTP client",detail:"request was deprecated in 2020 and no longer receives any fixes. It is only used in a dev script here, but it pulls in several transitive advisories.",recommendation:"Swap for the built-in fetch (Node 18+) or a maintained client like undici/got.",reference:"https://github.com/request/request/issues/3142"},{id:"d8",name:"eslint",current:"8.56.0",latest:"9.13.0",type:"dev",kind:"outdated",severity:"low",title:"Major version behind (8 → 9)",detail:"ESLint 9 introduces flat config as the default. Upgrading unlocks newer rules and faster runs but requires migrating .eslintrc to eslint.config.js.",recommendation:"Schedule the flat-config migration; not urgent but worth doing before adding new rules.",fixedIn:"9.13.0",reference:"https://eslint.org/docs/latest/use/migrate-to-9.0.0"},{id:"d9",name:"@types/react",current:"18.2.0",latest:"18.3.12",type:"dev",kind:"outdated",severity:"info",title:"Type definitions drift from runtime",detail:"Your @types/react is several minors behind the installed react, which can surface phantom type errors that do not match runtime behavior.",recommendation:"Align @types/react with your React version (18.3.x).",fixedIn:"18.3.12",reference:"https://www.npmjs.com/package/@types/react"},{id:"d10",name:"left-pad",current:"1.3.0",latest:"1.3.0",type:"direct",kind:"unused",severity:"low",title:"Declared but never imported",detail:"left-pad appears in dependencies but no source file imports it. Unused dependencies bloat install size and widen your supply-chain attack surface.",recommendation:"Remove it from package.json with your package manager's remove command.",usedIn:[],reference:"https://www.npmjs.com/package/left-pad"},{id:"d11",name:"dotenv",current:"—",type:"direct",kind:"missing",severity:"high",title:"Imported but not declared in package.json",detail:"lib/db.ts imports `dotenv`, but it is not listed in dependencies. The build works locally only because it is hoisted from a transitive dependency — CI installs may fail.",recommendation:"Add dotenv as an explicit dependency so installs are reproducible.",usedIn:["lib/cart.ts"],reference:"https://www.npmjs.com/package/dotenv"},{id:"d12",name:"node-forge",current:"1.3.1",latest:"1.3.1",type:"transitive",kind:"license",severity:"medium",title:"Dual GPL/BSD license needs review",detail:"A transitive dependency is distributed under a (GPL-2.0 OR BSD-3-Clause) dual license. If your legal policy disallows GPL, you must ensure the BSD option is the one in effect.",recommendation:"Confirm the BSD-3-Clause option satisfies your license policy, or replace the parent package.",license:"GPL-2.0 OR BSD-3-Clause",reference:"https://www.npmjs.com/package/node-forge"}],graph:{root:"storefront",nodes:[{id:"next",version:"14.1.0",type:"direct",depth:0,sizeKb:24800,dependencies:["react","react-dom","@swc/helpers","postcss","styled-jsx","caniuse-lite"],flagged:!0,severity:"high"},{id:"react",version:"18.2.0",type:"direct",depth:0,sizeKb:318,dependencies:["loose-envify"]},{id:"react-dom",version:"18.2.0",type:"direct",depth:0,sizeKb:4200,dependencies:["react","scheduler","loose-envify"]},{id:"axios",version:"1.6.2",type:"direct",depth:0,sizeKb:1500,dependencies:["follow-redirects","form-data","proxy-from-env"],flagged:!0,severity:"medium"},{id:"lodash",version:"4.17.20",type:"direct",depth:0,sizeKb:1410,dependencies:[],flagged:!0,severity:"medium"},{id:"moment",version:"2.29.4",type:"direct",depth:0,sizeKb:4350,dependencies:[],flagged:!0,severity:"medium"},{id:"left-pad",version:"1.3.0",type:"direct",depth:0,sizeKb:4,dependencies:[],flagged:!0,severity:"low"},{id:"zod",version:"3.22.4",type:"direct",depth:0,sizeKb:580,dependencies:[]},{id:"eslint",version:"8.56.0",type:"dev",depth:0,sizeKb:3100,dependencies:["espree","ajv","chalk","semver"],flagged:!0,severity:"low"},{id:"node-sass",version:"7.0.3",type:"dev",depth:0,sizeKb:8800,dependencies:["node-gyp","sass-graph","semver"],flagged:!0,severity:"high"},{id:"@types/react",version:"18.2.0",type:"dev",depth:0,sizeKb:410,dependencies:["csstype"],flagged:!0,severity:"info"},{id:"scheduler",version:"0.23.0",type:"transitive",depth:1,sizeKb:38,dependencies:["loose-envify"]},{id:"loose-envify",version:"1.4.0",type:"transitive",depth:1,sizeKb:8,dependencies:["js-tokens"]},{id:"styled-jsx",version:"5.1.1",type:"transitive",depth:1,sizeKb:92,dependencies:["client-only"]},{id:"@swc/helpers",version:"0.5.2",type:"transitive",depth:1,sizeKb:140,dependencies:[]},{id:"postcss",version:"8.4.31",type:"transitive",depth:1,sizeKb:210,dependencies:["nanoid","picocolors","source-map-js"]},{id:"caniuse-lite",version:"1.0.30001",type:"transitive",depth:1,sizeKb:1600,dependencies:[]},{id:"follow-redirects",version:"1.15.3",type:"transitive",depth:1,sizeKb:42,dependencies:[]},{id:"form-data",version:"4.0.0",type:"transitive",depth:1,sizeKb:30,dependencies:["mime-types","asynckit"]},{id:"proxy-from-env",version:"1.1.0",type:"transitive",depth:1,sizeKb:6,dependencies:[]},{id:"node-gyp",version:"9.4.0",type:"transitive",depth:1,sizeKb:540,dependencies:["semver"]},{id:"sass-graph",version:"4.0.1",type:"transitive",depth:1,sizeKb:70,dependencies:["semver"]},{id:"espree",version:"9.6.1",type:"transitive",depth:1,sizeKb:120,dependencies:["semver"]},{id:"ajv",version:"6.12.6",type:"transitive",depth:1,sizeKb:420,dependencies:[]},{id:"chalk",version:"4.1.2",type:"transitive",depth:1,sizeKb:44,dependencies:[]},{id:"csstype",version:"3.1.3",type:"transitive",depth:1,sizeKb:90,dependencies:[]},{id:"client-only",version:"0.0.1",type:"transitive",depth:1,sizeKb:2,dependencies:[]},{id:"js-tokens",version:"4.0.0",type:"transitive",depth:2,sizeKb:10,dependencies:[]},{id:"nanoid",version:"3.3.7",type:"transitive",depth:2,sizeKb:12,dependencies:[]},{id:"picocolors",version:"1.0.0",type:"transitive",depth:2,sizeKb:4,dependencies:[]},{id:"source-map-js",version:"1.0.2",type:"transitive",depth:2,sizeKb:36,dependencies:[]},{id:"mime-types",version:"2.1.35",type:"transitive",depth:2,sizeKb:20,dependencies:[]},{id:"asynckit",version:"0.4.0",type:"transitive",depth:2,sizeKb:14,dependencies:[]},{id:"semver",version:"7.5.1",type:"transitive",depth:2,sizeKb:90,dependencies:[],flagged:!0,severity:"low"}]}}},insights:{env:{files:[{path:".env.local",present:!0,vars:9},{path:".env.example",present:!0,vars:6},{path:".env.production",present:!1,vars:0}],counts:{total:11,client:3,server:8,issues:5},variables:[{key:"DATABASE_URL",scope:"server",status:"ok",severity:"info",usedIn:["lib/db.ts"],definedIn:[".env.local",".env.example"],note:"Server-only connection string. Correctly excluded from the client bundle.",sample:"postgres://••••@db.neon.tech/main",value:"postgres://app:s3cr3t_pw@db.neon.tech/main?sslmode=require",values:[{file:".env.local",value:"postgres://app:s3cr3t_pw@db.neon.tech/main?sslmode=require"},{file:".env.example",value:"postgres://app:YOUR_PASSWORD@db.neon.tech/main?sslmode=require"}]},{key:"STRIPE_SECRET_KEY",scope:"server",status:"exposed",severity:"critical",usedIn:["app/checkout/actions.ts","components/price-tag.tsx"],definedIn:[".env.local"],note:"Secret key is imported in a Client Component (price-tag.tsx). It will be inlined into the browser bundle and leak to every visitor.",sample:"sk_live_••••••••",value:"sk_live_51Hx9aBcDeFgHiJkLmNoPqRsT"},{key:"NEXT_PUBLIC_API_URL",scope:"client",status:"ok",severity:"info",usedIn:["lib/api.ts","app/products/page.tsx"],definedIn:[".env.local",".env.example"],note:"Public client variable, correctly prefixed with NEXT_PUBLIC_.",sample:"https://api.storefront.dev",value:"https://api.storefront.dev",values:[{file:".env.local",value:"https://api.storefront.dev"},{file:".env.example",value:"https://api.storefront.dev"}]},{key:"REDIS_URL",scope:"server",status:"missing",severity:"high",usedIn:["lib/cache.ts"],definedIn:[],note:"Referenced in lib/cache.ts but not defined in any env file. Builds will read undefined at runtime."},{key:"SENTRY_DSN",scope:"server",status:"undocumented",severity:"low",usedIn:["lib/monitoring.ts"],definedIn:[".env.local"],note:"Used and defined locally but missing from .env.example, so new contributors won't know to set it.",sample:"https://••••@sentry.io/123",value:"https://a1b2c3d4@o123456.ingest.sentry.io/4505123",values:[{file:".env.local",value:"https://a1b2c3d4@o123456.ingest.sentry.io/4505123"},{file:".env.example",value:null}]},{key:"OPENAI_API_KEY",scope:"server",status:"ok",severity:"info",usedIn:["app/api/chat/route.ts"],definedIn:[".env.local",".env.example"],note:"Server-only secret, used inside a Route Handler. Good.",sample:"sk-••••••••",value:"sk-proj-AbC123XyZ456DeF789GhI"},{key:"NEXT_PUBLIC_GA_ID",scope:"client",status:"ok",severity:"info",usedIn:["app/layout.tsx"],definedIn:[".env.local",".env.example"],note:"Analytics id, safe to expose to the client.",sample:"G-XXXXXXX",value:"G-7H9K2L4M8N"},{key:"LEGACY_TOKEN",scope:"server",status:"unused",severity:"low",usedIn:[],definedIn:[".env.local"],note:"Defined in .env.local but never referenced anywhere in the codebase. Safe to remove.",sample:"••••",value:"legacy-tok-9920-unused"},{key:"SMTP_PASSWORD",scope:"server",status:"empty",severity:"medium",usedIn:["lib/email.ts"],definedIn:[".env.local"],note:"Declared with an empty value. Email sending in lib/email.ts will fail silently.",sample:"(empty)",value:""},{key:"AUTH_SECRET",scope:"server",status:"ok",severity:"info",usedIn:["lib/auth.ts"],definedIn:[".env.local",".env.example"],note:"Session signing secret, server-only. Good.",sample:"••••••••",value:"9f8a7b6c5d4e3f2a1b0c9d8e7f6a5b4c"},{key:"NEXT_PUBLIC_SUPABASE_ANON_KEY",scope:"client",status:"undocumented",severity:"low",usedIn:["lib/supabase.ts"],definedIn:[".env.local"],note:"Public anon key — safe to expose, but missing from .env.example.",sample:"eyJ••••",value:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.demo-anon-key"}]},network:{counts:{total:14,external:8,insecure:2,issues:6},domains:[{host:"api.storefront.dev",calls:5,external:!1,category:"api"},{host:"api.stripe.com",calls:2,external:!0,category:"payment"},{host:"cdn.shopify.com",calls:2,external:!0,category:"cdn"},{host:"www.google-analytics.com",calls:1,external:!0,category:"analytics"},{host:"api.openai.com",calls:1,external:!0,category:"api"},{host:"legacy-tracker.net",calls:1,external:!0,category:"analytics"},{host:"fonts.googleapis.com",calls:1,external:!0,category:"cdn"},{host:"internal-metrics.local",calls:1,external:!1,category:"internal"}],calls:[{id:"n1",method:"GET",url:"http://legacy-tracker.net/collect",host:"legacy-tracker.net",external:!0,secure:!1,client:"image",filePath:"components/analytics/legacy-pixel.tsx",line:12,issues:[{kind:"insecure",severity:"high",message:"Loads over plain HTTP — browsers will block this as mixed content on an HTTPS site."},{kind:"mixed-content",severity:"medium",message:"Mixed-content request from a secure page; the pixel will be dropped silently."}]},{id:"n2",method:"POST",url:"https://api.stripe.com/v1/payment_intents",host:"api.stripe.com",external:!0,secure:!0,client:"fetch",filePath:"app/checkout/actions.ts",line:41,issues:[{kind:"no-timeout",severity:"medium",message:"No timeout or AbortController — a hung Stripe request blocks the checkout action indefinitely."}]},{id:"n3",method:"GET",url:"https://api.storefront.dev/products",host:"api.storefront.dev",external:!1,secure:!0,client:"fetch",filePath:"lib/api.ts",line:8,issues:[{kind:"no-error-handling",severity:"medium",message:"Response is parsed with .json() without checking res.ok; 4xx/5xx bodies will throw an opaque parse error."}]},{id:"n4",method:"GET",url:"http://internal-metrics.local/ping",host:"internal-metrics.local",external:!1,secure:!1,client:"fetch",filePath:"lib/monitoring.ts",line:27,issues:[{kind:"insecure",severity:"low",message:"Plain HTTP to an internal host. Acceptable inside a private network but flagged for visibility."}]},{id:"n5",method:"POST",url:"https://api.openai.com/v1/chat/completions",host:"api.openai.com",external:!0,secure:!0,client:"fetch",filePath:"app/api/chat/route.ts",line:19,issues:[]},{id:"n6",method:"GET",url:"https://www.google-analytics.com/g/collect",host:"www.google-analytics.com",external:!0,secure:!0,client:"script",filePath:"app/layout.tsx",line:34,issues:[{kind:"no-auth",severity:"info",message:"Third-party analytics script loaded without Subresource Integrity (SRI)."}]},{id:"n7",method:"GET",url:"https://api.storefront.dev/cart",host:"api.storefront.dev",external:!1,secure:!0,client:"axios",filePath:"lib/cart.ts",line:15,issues:[{kind:"hardcoded-url",severity:"low",message:"Base URL is hardcoded instead of read from NEXT_PUBLIC_API_URL, making environment overrides impossible."}]}]},git:{state:{branch:"feat/checkout-redesign",defaultBranch:"main",ahead:3,behind:7,remote:"git@github.com:acme/storefront.git",remoteInfo:{provider:"GitHub",owner:"acme",name:"storefront",host:"github.com",url:"https://github.com/acme/storefront"},lastCommit:{hash:"a1b2c3d",message:"wip: tweak price tag layout",author:"Jordan Lee",relative:"2 hours ago"},recentCommits:[{hash:"a1b2c3d",fullHash:"a1b2c3d4e5f60718293a4b5c6d7e8f9012345678",message:"wip: tweak price tag layout",author:"Jordan Lee",email:"jordan@acme.dev",relative:"2 hours ago",date:"2026-06-19T08:12:00Z",refs:["HEAD -> feat/checkout-redesign"],body:"Adjust the discount badge so it aligns with the strikethrough price.\nStill WIP — needs the responsive breakpoint pass.",insertions:34,deletions:12,files:[{path:"components/price-tag.tsx",status:"modified"},{path:"app/checkout/page.tsx",status:"modified"}]},{hash:"9f2a11c",fullHash:"9f2a11c0b1d2e3f405162738495a6b7c8d9e0f12",message:"feat: redesign checkout summary",author:"Jordan Lee",email:"jordan@acme.dev",relative:"5 hours ago",date:"2026-06-19T05:40:00Z",body:"New two-column summary with order totals on the right.",insertions:212,deletions:48,files:[{path:"app/checkout/page.tsx",status:"modified"},{path:"components/order-summary.tsx",status:"added"},{path:"config/payments.ts",status:"modified"}]},{hash:"7c4e0b2",fullHash:"7c4e0b2a3948576675849302a1b0c9d8e7f60514",message:"refactor: extract usePricing hook",author:"Sam Rivera",email:"sam@acme.dev",relative:"1 day ago",date:"2026-06-18T10:05:00Z",insertions:88,deletions:96,files:[{path:"hooks/use-pricing.ts",status:"added"},{path:"components/price-tag.tsx",status:"modified"}]},{hash:"3d9f8a1",fullHash:"3d9f8a1b2c3d4e5f60718293a4b5c6d7e8f90123",message:"fix: cart total rounding error",author:"Priya Nair",email:"priya@acme.dev",relative:"2 days ago",date:"2026-06-17T14:22:00Z",insertions:9,deletions:4,body:"Round to cents before summing instead of after — fixes the off-by-one-cent totals reported in #482.",files:[{path:"lib/cart.ts",status:"modified"}]},{hash:"b50c7e4",fullHash:"b50c7e4f5a6b7c8d9e0f1a2b3c4d5e6f70819203",message:"chore: bump next to 16.0.1",author:"Jordan Lee",email:"jordan@acme.dev",relative:"3 days ago",date:"2026-06-16T09:00:00Z",insertions:14,deletions:14,files:[{path:"package.json",status:"modified"},{path:"pnpm-lock.yaml",status:"modified"}]},{hash:"e1a2d3f",fullHash:"e1a2d3f4b5c6d7e8f90112233445566778899aab",message:"test: add checkout e2e coverage",author:"Sam Rivera",email:"sam@acme.dev",relative:"4 days ago",date:"2026-06-15T16:30:00Z",insertions:156,deletions:0,files:[{path:"e2e/checkout.spec.ts",status:"added"}]}],branches:[{name:"feat/checkout-redesign",current:!0,remote:!1,upstream:"origin/feat/checkout-redesign",lastCommitRelative:"2 hours ago",ahead:3,behind:7,tip:"a1b2c3d",subject:"wip: tweak price tag layout",author:"Jordan Lee",merged:!1},{name:"main",current:!1,remote:!1,upstream:"origin/main",lastCommitRelative:"5 hours ago",ahead:0,behind:0,tip:"9f2a11c",subject:"feat: redesign checkout summary",author:"Jordan Lee",merged:!1},{name:"fix/cart-rounding",current:!1,remote:!1,lastCommitRelative:"2 days ago",ahead:1,behind:4,tip:"3d9f8a1",subject:"fix: cart total rounding error",author:"Priya Nair",merged:!0},{name:"origin/main",current:!1,remote:!0,lastCommitRelative:"5 hours ago",tip:"9f2a11c",subject:"feat: redesign checkout summary",author:"Jordan Lee"},{name:"origin/feat/checkout-redesign",current:!1,remote:!0,lastCommitRelative:"2 hours ago",tip:"a1b2c3d",subject:"wip: tweak price tag layout",author:"Jordan Lee"},{name:"origin/release/2.4",current:!1,remote:!0,lastCommitRelative:"3 weeks ago",tip:"f0d1e2c",subject:"release: cut 2.4.0",author:"Priya Nair"}],tags:["v2.3.0","v2.2.1","v2.2.0","v2.1.0"],tagDetails:[{name:"v2.3.0",commit:"9f2a11c",relative:"5 hours ago",date:"2026-06-19T05:40:00Z",annotated:!0,tagger:"Jordan Lee",message:"Checkout redesign + pricing hook. See CHANGELOG for the full list."},{name:"v2.2.1",commit:"3d9f8a1",relative:"2 days ago",date:"2026-06-17T14:22:00Z",annotated:!0,tagger:"Priya Nair",message:"Patch: cart total rounding fix (#482)."},{name:"v2.2.0",commit:"c9b8a70",relative:"2 weeks ago",date:"2026-06-05T11:00:00Z",annotated:!0,tagger:"Sam Rivera",message:"Minor: search filters + saved carts."},{name:"v2.1.0",commit:"1f2e3d4",relative:"5 weeks ago",date:"2026-05-15T09:30:00Z",annotated:!1}],ignored:{count:5,samples:["node_modules",".next",".env.local","coverage","*.log"]},stashes:2,changes:[{path:"app/checkout/actions.ts",status:"modified"},{path:"components/price-tag.tsx",status:"modified"},{path:".env.local",status:"untracked"},{path:"lib/cache.ts",status:"added"},{path:"notes.todo",status:"untracked"}],staged:0,contributors:6,totalCommits:1284,firstCommitRelative:"2 years ago",trackedFiles:487,topContributors:[{name:"Jordan Lee",commits:612},{name:"Sam Rivera",commits:398},{name:"Priya Nair",commits:201},{name:"Alex Kim",commits:54},{name:"Dana Cho",commits:19}]},issues:[{id:"g1",kind:"secret-in-history",severity:"critical",title:"Possible secret committed in history",detail:"A Stripe-style key (sk_live_…) appears in commit 9f2a11c from 14 days ago in config/payments.ts. Even after deletion it remains recoverable from git history.",filePath:"config/payments.ts",recommendation:"Rotate the key immediately, then purge it from history with git filter-repo or BFG and force-push."},{id:"g2",kind:"uncommitted",severity:"medium",title:".env.local is untracked and contains secrets",detail:"Untracked .env.local holds live secrets. One careless `git add .` would commit them.",filePath:".env.local",recommendation:"Confirm .env.local is matched by .gitignore (it currently is) and never force-add it."},{id:"g3",kind:"large-file",severity:"low",title:"Large binary committed to the repo",detail:"public/demo.mp4 (48 MB) is tracked in git, bloating clone size for everyone.",filePath:"public/demo.mp4",recommendation:"Move large media to Git LFS or external storage and remove it from history."},{id:"g4",kind:"stale-branch",severity:"info",title:"Branch is 7 commits behind main",detail:"feat/checkout-redesign has diverged from main by 7 commits. Rebasing now avoids a painful merge later.",recommendation:"Run git fetch && git rebase origin/main."},{id:"g5",kind:"gitignore",severity:"low",title:"notes.todo is untracked and unignored",detail:"A scratch file is neither tracked nor ignored, so it shows up as noise in every status check.",filePath:"notes.todo",recommendation:"Add it to .gitignore or remove it."}],workflows:[{id:"w1",name:"CI",file:".github/workflows/ci.yml",provider:"GitHub Actions",triggers:["push","pull_request"],status:"failing",concurrency:"ci-${{ github.ref }}",permissions:["contents: read"],env:["CI","TURBO_TOKEN"],diagnosis:{runnable:!0,localCommand:"act pull_request -j typecheck",notes:["Reproduce the failing job locally with nektos/act (runs the workflow in Docker).","Or run the underlying script directly: pnpm typecheck.","typecheck fails on a type error in app/checkout/actions.ts — see the job log."]},jobs:[{name:"lint",status:"passing",durationMs:42e3,runsOn:"ubuntu-latest",steps:[{name:"Checkout",uses:"actions/checkout@v4"},{name:"Setup Node",uses:"actions/setup-node@v4",diagnostics:["No dependency cache configured (cache: 'pnpm')."]},{name:"Install",run:"pnpm install --frozen-lockfile"},{name:"Lint",run:"pnpm lint"}]},{name:"typecheck",status:"failing",durationMs:38e3,runsOn:"ubuntu-latest",needs:["lint"],steps:[{name:"Checkout",uses:"actions/checkout@v4"},{name:"Setup Node",uses:"actions/setup-node@v4"},{name:"Install",run:"pnpm install --frozen-lockfile"},{name:"Type check",run:"pnpm typecheck",diagnostics:["This step failed: tsc reported 1 error in app/checkout/actions.ts:67."]}]},{name:"test",status:"passing",durationMs:96e3,runsOn:"ubuntu-latest",needs:["lint"],condition:"github.event_name == 'pull_request'",steps:[{name:"Checkout",uses:"actions/checkout@v4"},{name:"Setup Node",uses:"actions/setup-node@v4"},{name:"Install",run:"pnpm install --frozen-lockfile"},{name:"Unit tests",run:"pnpm test --coverage"}]}],issues:[{id:"w1i1",kind:"force-push",severity:"medium",title:"No dependency caching",detail:"The workflow runs `pnpm install` without actions/cache or setup-node caching, adding ~40s to every run.",filePath:".github/workflows/ci.yml",recommendation:"Enable cache: 'pnpm' in actions/setup-node to reuse the store between runs."},{id:"w1i2",kind:"no-signoff",severity:"low",title:"Node version is not pinned",detail:"setup-node uses 'node-version: latest', so builds can break unexpectedly when a new major ships.",filePath:".github/workflows/ci.yml",recommendation:"Pin to a specific major (e.g. node-version: 20) matching your engines field."}]},{id:"w2",name:"Deploy",file:".github/workflows/deploy.yml",provider:"GitHub Actions",triggers:["push: main"],status:"passing",concurrency:"deploy-production",permissions:["contents: read","deployments: write"],env:["VERCEL_ORG_ID","VERCEL_PROJECT_ID"],schedules:[],diagnosis:{runnable:!0,localCommand:"act push -j build",notes:["Deploy steps reference repository secrets; act needs a local --secret-file to run end to end.","The build step mirrors `pnpm build`, which you can run directly to reproduce build issues."]},jobs:[{name:"build",status:"passing",durationMs:12e4,runsOn:"ubuntu-latest",steps:[{name:"Checkout",uses:"actions/checkout@v4"},{name:"Setup Node",uses:"actions/setup-node@v4"},{name:"Install",run:"pnpm install --frozen-lockfile"},{name:"Build",run:"pnpm build"}]},{name:"deploy",status:"passing",durationMs:54e3,runsOn:"ubuntu-latest",needs:["build"],condition:"github.ref == 'refs/heads/main'",steps:[{name:"Pull Vercel env",run:"vercel pull --yes --environment=production"},{name:"Debug token",run:"echo $DEPLOY_TOKEN",diagnostics:["Secret printed to logs — remove this echo."]},{name:"Deploy",run:"vercel deploy --prod"}]}],issues:[{id:"w2i1",kind:"secret-in-history",severity:"high",title:"Secret echoed in a run step",detail:"A step runs `echo $DEPLOY_TOKEN` for debugging, which prints the secret into public build logs.",filePath:".github/workflows/deploy.yml",recommendation:"Remove the echo and mask the value with ::add-mask:: if it must be referenced."}]}]},setup:{tooling:[{name:"TypeScript",version:"5.4.5",detected:!0},{name:"ESLint",version:"8.56.0",detected:!0},{name:"Prettier",version:"3.2.5",detected:!0},{name:"Tailwind CSS",version:"3.4.1",detected:!0},{name:"Vitest",version:"1.4.0",detected:!0},{name:"Husky",detected:!1},{name:"Playwright",detected:!1},{name:"EditorConfig",detected:!1}],configs:[{id:"c1",name:"ESLint",file:".eslintrc.json",present:!0,tool:"eslint",summary:"Extends next/core-web-vitals with 4 custom rule overrides.",ruleCount:28,highlights:[{label:"extends",value:"next/core-web-vitals"},{label:"no-unused-vars",value:"warn"},{label:"no-console",value:"off",good:!1},{label:"flat config",value:"no (legacy)",good:!1}]},{id:"c2",name:"TypeScript",file:"tsconfig.json",present:!0,tool:"tsc",summary:"strict mode on, but two safety flags are disabled.",ruleCount:14,highlights:[{label:"strict",value:"true",good:!0},{label:"noUncheckedIndexedAccess",value:"false",good:!1},{label:"noImplicitOverride",value:"false",good:!1},{label:"target",value:"ES2022",good:!0}]},{id:"c3",name:"Prettier",file:".prettierrc",present:!0,tool:"prettier",summary:"Standard config — 2-space, single quotes, 100 print width.",highlights:[{label:"semi",value:"false"},{label:"singleQuote",value:"true"},{label:"printWidth",value:"100"}]},{id:"c4",name:"Tailwind",file:"tailwind.config.ts",present:!0,tool:"tailwindcss",summary:"Custom theme with 3 plugins; content globs cover app + components.",highlights:[{label:"darkMode",value:"class",good:!0},{label:"plugins",value:"3"}]},{id:"c5",name:"Git hooks",file:".husky/",present:!1,tool:"husky",summary:"No pre-commit hooks — lint/format/type checks don't run before commits."},{id:"c6",name:"EditorConfig",file:".editorconfig",present:!1,tool:"editorconfig",summary:"Missing — editors won't share indentation/charset settings across the team."}],stats:{totalFiles:248,totalLoc:18460,codeLoc:14820,commentLoc:1840,blankLoc:1800,testFiles:22,testLoc:2380,components:64,routes:18,commentRatio:.124,testRatio:.16,todoCount:37,largestFiles:[{path:"lib/api.ts",loc:612},{path:"app/checkout/actions.ts",loc:548},{path:"components/product-grid.tsx",loc:503},{path:"lib/db.ts",loc:472},{path:"app/dashboard/page.tsx",loc:441}],languages:[{language:"TypeScript (TSX)",files:132,loc:9240,share:.5},{language:"TypeScript",files:78,loc:6180,share:.335},{language:"CSS",files:12,loc:1420,share:.077},{language:"JSON",files:18,loc:980,share:.053},{language:"Markdown",files:8,loc:640,share:.035}]}},docs:{score:52,grade:"D",band:"needs-improvement",agentReady:!1,agentScore:44,liveUrl:null,documents:[{name:"README.md",path:"README.md",present:!0,score:72,words:840,note:"Has setup and scripts, but no architecture overview or env-var table."},{name:"AGENTS.md",path:"AGENTS.md",present:!1,score:0,words:0,note:"Missing. Agents have no machine-readable guide to conventions, commands, or boundaries."},{name:"llms.txt",path:"llms.txt",present:!1,score:0,words:0,note:"Missing. No curated index of routes/docs for LLM consumption."},{name:"CONTRIBUTING.md",path:"CONTRIBUTING.md",present:!0,score:58,words:320,note:"Covers PR flow but omits local setup and test commands."},{name:"CHANGELOG.md",path:"CHANGELOG.md",present:!1,score:0,words:0,note:"No changelog — release history is undocumented."},{name:"API reference",path:"docs/api.md",present:!0,score:44,words:510,note:"Partially documents 6 of 18 routes; many endpoints undocumented."}],standards:[{id:"vercel",label:"Agent Readability",tagline:"Vercel's spec for making sites legible to AI agents",source:"Vercel Agent Readability Spec",href:"https://vercel.com/docs/agent-readability",score:58,weight:.35,band:"needs-improvement",checks:[{id:"vr1",group:"Discovery",label:"llms.txt index at root",status:"fail",weight:12,agent:!0,detail:"No /llms.txt to point agents at the most relevant docs and routes. This is the single highest-impact discovery signal.",fix:"Add an llms.txt at the project root following the llmstxt.org format."},{id:"vr2",group:"Discovery",label:"AGENTS.md present",status:"fail",weight:10,agent:!0,detail:"No AGENTS.md describing build/test commands, conventions, and do-not-touch areas for coding agents.",fix:"Create AGENTS.md with setup, commands, architecture, and conventions sections."},{id:"vr3",group:"Discovery",label:"robots.txt allows AI crawlers",status:"na",weight:6,agent:!1,detail:"Requires a live URL to verify that GPTBot, ClaudeBot, PerplexityBot, etc. are not disallowed.",fix:"Provide a docs URL to probe robots.txt."},{id:"vr4",group:"Discovery",label:"sitemap.xml / sitemap.md",status:"na",weight:6,agent:!1,detail:"Requires a live URL to confirm a crawlable sitemap is served.",fix:"Provide a docs URL to probe the sitemap."},{id:"vr5",group:"Structure",label:"Page metadata (title + description)",status:"warn",weight:8,agent:!1,detail:"12 of 18 routes export metadata; 6 fall back to the default title, giving agents weak page context."},{id:"vr6",group:"Structure",label:"Canonical URLs",status:"na",weight:6,agent:!1,detail:"Requires a live URL to verify canonical link tags are present and self-referential."},{id:"vr7",group:"Structure",label:"Structured data (JSON-LD)",status:"fail",weight:6,agent:!1,detail:"No JSON-LD on key pages, so agents can't extract typed entities (products, articles, breadcrumbs).",fix:'Emit JSON-LD via a <script type="application/ld+json"> in the route head.'},{id:"vr8",group:"Context",label:"Semantic heading hierarchy",status:"warn",weight:10,agent:!0,detail:"Several docs skip from H1 to H3 or use multiple H1s, which degrades automated outline extraction."},{id:"vr9",group:"Context",label:"Code blocks tagged with language",status:"pass",weight:8,agent:!0,detail:"All fenced code blocks specify a language, so agents can parse and run examples reliably."},{id:"vr10",group:"Context",label:"Markdown route mirrors (.md)",status:"fail",weight:12,agent:!0,detail:"Pages don't expose a clean Markdown mirror (e.g. via content negotiation or .md routes), forcing agents to scrape HTML.",fix:"Serve a Markdown version of each page through content negotiation or a .md route."},{id:"vr11",group:"Context",label:"Descriptive link text",status:"pass",weight:6,agent:!1,detail:'Links use descriptive anchors rather than "click here", aiding both screen readers and agents.'}]},{id:"llmstxt",label:"llms.txt Spec",tagline:"Conformance with the llmstxt.org file format",source:"llmstxt.org specification",href:"https://llmstxt.org",score:22,weight:.2,band:"poor",checks:[{id:"lt1",label:"/llms.txt exists",status:"fail",weight:25,agent:!0,detail:"The spec's required entry file is missing at the project root.",fix:"Create /llms.txt."},{id:"lt2",label:"H1 with project name",status:"fail",weight:10,agent:!0,detail:"A single H1 naming the project must be the first line. Cannot pass without the file."},{id:"lt3",label:"Blockquote summary",status:"fail",weight:10,agent:!1,detail:"A short > blockquote summary should follow the H1 to orient the model."},{id:"lt4",label:"H2 sections with link lists",status:"fail",weight:15,agent:!0,detail:"Curated H2 sections (Docs, Examples, Optional) with markdown link lists are required."},{id:"lt5",label:"Each link has a description",status:"fail",weight:10,agent:!1,detail:"Every link should carry a colon-separated description so models can prioritize."},{id:"lt6",label:"Optional section for low-priority links",status:"na",weight:5,agent:!1,detail:'An "Optional" section lets agents skip secondary content under tight context budgets.'},{id:"lt7",label:"llms-full.txt expanded variant",status:"fail",weight:10,agent:!0,detail:"No llms-full.txt that inlines the full docs corpus for one-shot ingestion.",fix:"Generate llms-full.txt alongside llms.txt."},{id:"lt8",label:"Valid, parseable markdown",status:"na",weight:15,agent:!1,detail:"Cannot validate structure until the file exists."}]},{id:"farming",label:"Agent Score",tagline:"farming-labs live-surface agent readiness probes",source:"@farming-labs/docs · doctor --agent",href:"https://docs.farming-labs.dev/score",score:41,weight:.2,band:"poor",liveOnly:!0,checks:[{id:"fl1",group:"Surfaces",label:"Docs discoverable from root",status:"na",weight:12,agent:!1,detail:"Needs a live URL: checks whether an agent landing on the homepage can find the docs within one hop.",fix:"Set a docs URL to enable live probing."},{id:"fl2",group:"Surfaces",label:"llms.txt served over HTTP",status:"fail",weight:14,agent:!0,detail:"No llms.txt in the repo, so the deployed site will return 404 for /llms.txt."},{id:"fl3",group:"Surfaces",label:"sitemap.xml / sitemap.md",status:"na",weight:10,agent:!1,detail:"Requires a live URL to fetch the sitemap."},{id:"fl4",group:"Surfaces",label:"robots.txt not blocking AI",status:"na",weight:10,agent:!1,detail:"Requires a live URL to confirm AI user-agents aren't disallowed."},{id:"fl5",group:"Surfaces",label:"AGENTS.md served",status:"fail",weight:12,agent:!0,detail:"No AGENTS.md in the repo to serve at /AGENTS.md."},{id:"fl6",group:"Surfaces",label:"skill.md present",status:"fail",weight:8,agent:!0,detail:"No skill.md describing reusable agent skills/workflows for this project.",fix:"Add a skill.md documenting common agent tasks."},{id:"fl7",group:"Surfaces",label:".md route mirrors (content negotiation)",status:"na",weight:14,agent:!0,detail:"Requires a live URL to test whether pages return Markdown when requested with text/markdown."},{id:"fl8",group:"Surfaces",label:"MCP endpoint exposed",status:"fail",weight:10,agent:!0,detail:"No Model Context Protocol endpoint advertised for structured tool access to the docs.",fix:"Expose an MCP server or .well-known/mcp descriptor."},{id:"fl9",group:"Freshness",label:"Docs freshness / compaction",status:"warn",weight:10,agent:!1,detail:"Several docs reference APIs that changed two releases ago; agents may surface stale guidance."}]},{id:"quality",label:"Documentation Quality",tagline:"Human-facing completeness and readability",source:"CodeLens quality rubric (readme-doctor + Vale)",href:"https://github.com/vercel-labs/codelens",score:70,weight:.25,band:"good",checks:[{id:"ql1",label:"README quick-start",status:"pass",weight:12,agent:!1,detail:"Install and dev commands are present and runnable."},{id:"ql2",label:"Architecture overview",status:"fail",weight:10,agent:!1,detail:"No high-level description of how app/, lib/, and components/ fit together.",fix:"Add an Architecture section or docs/architecture.md."},{id:"ql3",label:"Environment variables documented",status:"warn",weight:10,agent:!0,detail:".env.example exists but 3 used variables are undocumented and none have descriptions."},{id:"ql4",label:"Public API / JSDoc coverage",status:"warn",weight:12,agent:!0,detail:"Only 38% of exported functions have JSDoc. Typed, documented signatures help agents infer intent."},{id:"ql5",label:"Usage examples",status:"warn",weight:8,agent:!1,detail:"README shows one snippet; key utilities have no usage examples."},{id:"ql6",label:"CONTRIBUTING present",status:"pass",weight:6,agent:!1,detail:"CONTRIBUTING.md documents the PR flow."},{id:"ql7",label:"LICENSE present",status:"pass",weight:5,agent:!1,detail:"An MIT LICENSE is present at the root."},{id:"ql8",label:"CHANGELOG present",status:"fail",weight:6,agent:!1,detail:"No CHANGELOG.md — release history is undocumented.",fix:"Adopt Keep a Changelog or generate one from conventional commits."},{id:"ql9",label:"Readability (Flesch-Kincaid ≤ 12)",status:"pass",weight:8,agent:!1,detail:"Prose reads at a grade-10 level — accessible without being oversimplified."},{id:"ql10",label:"No broken relative links",status:"warn",weight:8,agent:!1,detail:"2 relative links in docs/api.md point to files that no longer exist."},{id:"ql11",label:"Consistent heading structure",status:"warn",weight:10,agent:!0,detail:"Headings are inconsistent across docs, reducing automated-extraction reliability."}]}]},database:{counts:{connections:3,collections:27,findings:9,slowQueries:4},connections:[{id:"db1",engine:"postgres",name:"storefront",client:"Drizzle ORM (postgres-js)",host:"ep-cool-darkness.us-east-2.aws.neon.tech",ssl:!0,pooled:!0,envVar:"DATABASE_URL",collections:14,filePath:"lib/db.ts",detectedVia:"connection-string",scheme:"postgres",schemaSource:"Drizzle ORM schema"},{id:"db2",engine:"mongodb",name:"analytics",client:"Mongoose",host:"cluster0.ab12c.mongodb.net",ssl:!0,pooled:!1,envVar:"MONGODB_URI",collections:9,filePath:"lib/mongo.ts",detectedVia:"connection-string",scheme:"mongodb+srv",schemaSource:"Mongoose models"},{id:"db3",engine:"redis",name:"cache",client:"ioredis",host:"localhost:6379",ssl:!1,pooled:!0,envVar:"REDIS_URL",collections:4,filePath:"lib/cache.ts",detectedVia:"dependency",scheme:"redis"}],findings:[{id:"dbf1",engine:"postgres",kind:"n+1",severity:"high",title:"N+1 query loading order line items",detail:"The order list maps over orders and awaits a separate `lineItems` query per row. A 50-order page fires 51 round-trips to Postgres.",filePath:"app/dashboard/orders/page.tsx",line:38,target:"line_items",recommendation:"Fetch line items in a single query with a JOIN or `inArray(orderIds)`, then group in memory.",snippet:{startLine:37,code:" const orders = await db.select().from(ordersTable)\n for (const o of orders) {\n o.items = await db.select().from(lineItems).where(eq(lineItems.orderId, o.id))\n }"}},{id:"dbf2",engine:"postgres",kind:"missing-index",severity:"high",title:"Sequential scan on orders.email",detail:"`orders` is filtered by `email` on the lookup path but has no index on that column. EXPLAIN shows a full sequential scan over ~1.2M rows.",filePath:"lib/queries/orders.ts",line:14,target:"orders",recommendation:"Add `CREATE INDEX CONCURRENTLY orders_email_idx ON orders (email);` via a migration."},{id:"dbf3",engine:"mongodb",kind:"unbounded-query",severity:"high",title:"Unbounded find() on events collection",detail:"`Event.find({ type })` returns every matching document with no `.limit()` or pagination. The events collection has 4.6M documents and grows daily.",filePath:"lib/mongo.ts",line:52,target:"events",recommendation:"Add `.limit()` with cursor-based pagination and project only required fields.",snippet:{startLine:52,code:" const events = await Event.find({ type }).sort({ createdAt: -1 })"}},{id:"dbf4",engine:"mongodb",kind:"missing-index",severity:"medium",title:"No compound index for events query pattern",detail:"Events are queried by `{ type, createdAt }` but only a single-field index on `type` exists, forcing an in-memory sort that can exceed the 32MB sort limit.",filePath:"lib/models/event.ts",line:21,target:"events",recommendation:"Create a compound index `{ type: 1, createdAt: -1 }` matching the query and sort order."},{id:"dbf5",engine:"mongodb",kind:"no-validation",severity:"medium",title:"Collection has no schema validation",detail:"The `events` collection accepts arbitrary shapes — there is no `$jsonSchema` validator and the mongoose schema uses `strict: false`, allowing malformed analytics rows.",filePath:"lib/models/event.ts",line:8,target:"events",recommendation:"Enable strict mode in mongoose and attach a $jsonSchema validator to the collection."},{id:"dbf6",engine:"postgres",kind:"injection",severity:"critical",title:"Raw SQL built from request input",detail:"`db.execute(sql.raw(...))` interpolates the `email` query param directly into the statement, allowing SQL injection.",filePath:"app/api/orders/route.ts",line:31,target:"orders",recommendation:"Use parameterized template literals (`sql`... ${email}``) instead of `sql.raw` with string concatenation.",snippet:{startLine:31,code:" const email = req.nextUrl.searchParams.get('email')\n await db.execute(sql.raw(`SELECT * FROM orders WHERE email = '${email}'`))"}},{id:"dbf7",engine:"mongodb",kind:"no-pooling",severity:"medium",title:"New Mongo connection per request",detail:"`mongoose.connect()` is called inside the request handler rather than once at module scope, opening a fresh connection on every invocation and exhausting the Atlas connection limit under load.",filePath:"lib/mongo.ts",line:11,recommendation:"Cache the connection promise at module scope (global singleton) and reuse it across requests."},{id:"dbf8",engine:"redis",kind:"missing-ttl",severity:"low",title:"Cache keys written without TTL",detail:"`redis.set(key, value)` is used without an expiry for product cache entries, so stale data accumulates and memory grows unbounded.",filePath:"lib/cache.ts",line:24,target:"product:*",recommendation:"Set an explicit TTL: `redis.set(key, value, 'EX', 3600)`."},{id:"dbf9",engine:"redis",kind:"no-ssl",severity:"medium",title:"Redis connection is not encrypted",detail:"REDIS_URL uses the plaintext `redis://` scheme. Cache traffic — including session tokens — crosses the network unencrypted.",filePath:"lib/cache.ts",line:6,recommendation:"Use the `rediss://` TLS scheme and verify the server certificate."}],queries:[{id:"q1",engine:"postgres",operation:"SELECT",target:"orders",filePath:"lib/queries/orders.ts",line:14,estMs:1840,fullScan:!0,note:"Sequential scan over orders filtered by email — add an index."},{id:"q2",engine:"mongodb",operation:"find",target:"events",filePath:"lib/mongo.ts",line:52,estMs:2600,fullScan:!0,note:"Unbounded find with in-memory sort; no compound index."},{id:"q3",engine:"postgres",operation:"SELECT",target:"line_items",filePath:"app/dashboard/orders/page.tsx",line:38,estMs:920,fullScan:!1,note:"Fired 51× per page render (N+1)."},{id:"q4",engine:"mongodb",operation:"aggregate",target:"events",filePath:"lib/analytics.ts",line:73,estMs:1450,fullScan:!0,note:"$group stage spills to disk; allowDiskUse without index."},{id:"q5",engine:"redis",operation:"GET",target:"product:*",filePath:"lib/cache.ts",line:24,estMs:3,fullScan:!1,note:"Healthy — sub-millisecond cache reads."}],tables:[{name:"users",connectionId:"db1",kind:"table",rowCount:2840,sizeKb:450,filePath:"lib/schema/users.ts",columns:[{name:"id",type:"uuid",flags:["pk"],references:void 0},{name:"email",type:"varchar(255)",flags:["unique","index"],references:void 0},{name:"name",type:"varchar(255)",flags:[],references:void 0},{name:"createdAt",type:"timestamp",flags:["index"],references:void 0}],indexes:[{name:"users_email_idx",columns:["email"],unique:!0},{name:"users_created_idx",columns:["createdAt"],unique:!1}]},{name:"orders",connectionId:"db1",kind:"table",rowCount:18927,sizeKb:3200,filePath:"lib/schema/orders.ts",columns:[{name:"id",type:"uuid",flags:["pk"],references:void 0},{name:"userId",type:"uuid",flags:["fk","index"],references:"users.id"},{name:"total",type:"decimal(10,2)",flags:[],references:void 0},{name:"status",type:"enum('pending','completed','failed')",flags:["index"],references:void 0},{name:"createdAt",type:"timestamp",flags:["index"],references:void 0}],indexes:[{name:"orders_user_idx",columns:["userId"],unique:!1},{name:"orders_status_idx",columns:["status"],unique:!1},{name:"orders_created_idx",columns:["createdAt"],unique:!1}]},{name:"line_items",connectionId:"db1",kind:"table",rowCount:64210,sizeKb:8900,filePath:"lib/schema/orders.ts",columns:[{name:"id",type:"uuid",flags:["pk"],references:void 0},{name:"orderId",type:"uuid",flags:["fk","index"],references:"orders.id"},{name:"productId",type:"uuid",flags:["fk","index"],references:"products.id"},{name:"quantity",type:"integer",flags:["default"],references:void 0},{name:"unitPrice",type:"decimal(10,2)",flags:[],references:void 0}],indexes:[{name:"line_items_order_idx",columns:["orderId"],unique:!1},{name:"line_items_product_idx",columns:["productId"],unique:!1}]},{name:"events",connectionId:"db2",kind:"collection",rowCount:46e5,sizeKb:185e3,filePath:"lib/models/event.ts",columns:[{name:"_id",type:"ObjectId",flags:["pk"],references:void 0},{name:"type",type:"string",flags:["index"],references:void 0},{name:"userId",type:"string",flags:["fk"],references:"users._id"},{name:"data",type:"object",flags:[],references:void 0},{name:"createdAt",type:"Date",flags:["index"],references:void 0}],indexes:[{name:"events_type_idx",columns:["type"],unique:!1},{name:"events_created_idx",columns:["createdAt"],unique:!1}]},{name:"sessions",connectionId:"db2",kind:"collection",rowCount:128400,sizeKb:24300,filePath:"lib/models/session.ts",columns:[{name:"_id",type:"ObjectId",flags:["pk"],references:void 0},{name:"userId",type:"string",flags:["fk","index"],references:"users._id"},{name:"device",type:"string",flags:[],references:void 0},{name:"expiresAt",type:"Date",flags:["index"],references:void 0}],indexes:[{name:"sessions_user_idx",columns:["userId"],unique:!1},{name:"sessions_expires_ttl",columns:["expiresAt"],unique:!1}]}]},auth:{present:!0,provider:{id:"better-auth",name:"Better Auth",packageName:"better-auth",docsUrl:"https://www.better-auth.com/docs",deepSupport:!0},version:"1.2.8",integration:"Next.js",configPath:"lib/auth.ts",clientPath:"lib/auth-client.ts",databaseAdapter:{name:"Drizzle",detail:"drizzleAdapter()"},methods:[{id:"email-password",label:"Email & Password",kind:"credential",enabled:!0,detail:"Enabled · no email verification"},{id:"social",label:"Social Login",kind:"social",enabled:!0,detail:"2 providers",providers:["github","google"]}],socialProviders:["github","google"],plugins:[{id:"twoFactor",name:"Two-Factor (2FA)",category:"two-factor",side:"both",detectedServer:!0,detectedClient:!1,needsClient:!0,clientMissing:!0,description:"TOTP and OTP-based two-factor authentication.",docsUrl:"https://www.better-auth.com/docs/plugins/2fa",addsTables:["twoFactor"]},{id:"organization",name:"Organization",category:"authorization",side:"both",detectedServer:!0,detectedClient:!0,needsClient:!0,clientMissing:!1,description:"Multi-tenant organizations, members, invitations and roles.",docsUrl:"https://www.better-auth.com/docs/plugins/organization",addsTables:["organization","member","invitation"]},{id:"admin",name:"Admin",category:"authorization",side:"both",detectedServer:!0,detectedClient:!0,needsClient:!0,clientMissing:!1,description:"Admin APIs: user management, banning, impersonation, role checks.",docsUrl:"https://www.better-auth.com/docs/plugins/admin"},{id:"magicLink",name:"Magic Link",category:"passwordless",side:"both",detectedServer:!0,detectedClient:!0,needsClient:!0,clientMissing:!1,description:"Passwordless email magic-link sign-in.",docsUrl:"https://www.better-auth.com/docs/plugins/magic-link"},{id:"nextCookies",name:"Next.js Cookies",category:"integration",side:"server",detectedServer:!0,detectedClient:!1,needsClient:!1,clientMissing:!1,description:"Handles cookie setting inside Next.js server actions.",docsUrl:"https://www.better-auth.com/docs/integrations/next"}],config:[{key:"secret",label:"Secret",value:"From environment",status:"ok"},{key:"baseURL",label:"Base URL",value:"Set",status:"ok"},{key:"trustedOrigins",label:"Trusted Origins",value:"Configured",status:"ok"},{key:"session",label:"Session lifetime",value:"7d",status:"ok",detail:"Cookie cache enabled"},{key:"rateLimit",label:"Rate limiting",value:"Default (prod only)",status:"info"},{key:"cookies",label:"Secure cookies",value:"Auto (prod)",status:"ok"}],session:{expiresIn:604800,updateAge:86400,cookieCache:!0},findings:[{id:"auth-client-twoFactor",severity:"medium",title:"Two-Factor (2FA) is missing its client plugin",detail:"The Two-Factor server plugin is registered but no matching client plugin was found in lib/auth-client.ts. Its client actions won't be available.",recommendation:"Add twoFactorClient() to createAuthClient({ plugins: [...] }).",filePath:"lib/auth.ts",docsUrl:"https://www.better-auth.com/docs/plugins/2fa"},{id:"auth-email-verif",severity:"medium",title:"Email verification not required",detail:"Email & password sign-in is enabled but accounts can be created without verifying ownership of the email address.",recommendation:"Set emailAndPassword.requireEmailVerification = true and wire up emailVerification.sendVerificationEmail.",filePath:"lib/auth.ts",docsUrl:"https://www.better-auth.com/docs/authentication/email-password"},{id:"auth-migrations",severity:"info",title:"Plugins add database tables",detail:"Two-Factor (2FA), Organization extend the schema with new tables. Make sure migrations were generated and applied.",recommendation:"Run `npx @better-auth/cli generate` then your migration tool to sync the schema.",filePath:"lib/auth.ts",docsUrl:"https://www.better-auth.com/docs/concepts/database"}],counts:{plugins:5,methods:2,providers:2,findings:3}},api:{present:!0,style:"Next.js App Router · Server Actions",endpoints:[{id:"api-1",method:"POST",path:"/api/checkout",kind:"next-app",filePath:"app/api/checkout/route.ts",line:12,handler:"POST",dynamic:!1,flags:{auth:!1,validation:!1,database:!0,env:!0,errorHandling:!1,inputs:!0},findings:[{id:"api-1-auth",severity:"high",kind:"no-auth",title:"Mutation without auth check",detail:"This POST handler changes state but no session/user lookup was detected.",recommendation:"Verify the caller's session before mutating data, or confirm the route is intentionally public."},{id:"api-1-valid",severity:"medium",kind:"no-validation",title:"Request body not validated",detail:"The handler reads request input but no schema validation (zod/yup/valibot) was found.",recommendation:"Validate and parse the request body with a schema before using it."}]},{id:"api-2",method:"GET",path:"/api/products/[id]",kind:"next-app",filePath:"app/api/products/[id]/route.ts",line:8,handler:"GET",dynamic:!0,flags:{auth:!1,validation:!0,database:!0,env:!1,errorHandling:!0,inputs:!0},findings:[]},{id:"api-3",method:"DELETE",path:"/api/products/[id]",kind:"next-app",filePath:"app/api/products/[id]/route.ts",line:31,handler:"DELETE",dynamic:!0,flags:{auth:!0,validation:!1,database:!0,env:!1,errorHandling:!0,inputs:!0},findings:[]},{id:"api-4",method:"GET",path:"/api/users",kind:"next-app",filePath:"app/api/users/route.ts",line:6,handler:"GET",dynamic:!1,flags:{auth:!0,validation:!1,database:!0,env:!1,errorHandling:!0,inputs:!1},findings:[]},{id:"api-5",method:"POST",path:"/api/webhooks/stripe",kind:"next-app",filePath:"app/api/webhooks/stripe/route.ts",line:14,handler:"POST",dynamic:!1,flags:{auth:!1,validation:!1,database:!0,env:!0,errorHandling:!0,inputs:!0},findings:[{id:"api-5-valid",severity:"medium",kind:"no-validation",title:"Request body not validated",detail:"The handler reads request input but no schema validation was found. Verify the webhook signature.",recommendation:"Verify the Stripe signature header before trusting the payload."}]},{id:"api-6",method:"POST",path:"/updateProfile",kind:"next-action",filePath:"app/actions/profile.ts",line:9,handler:"updateProfile",dynamic:!1,flags:{auth:!0,validation:!0,database:!0,env:!1,errorHandling:!0,inputs:!0},findings:[]},{id:"api-7",method:"GET",path:"/api/health",kind:"next-app",filePath:"app/api/health/route.ts",line:3,handler:"GET",dynamic:!1,flags:{auth:!1,validation:!1,database:!1,env:!1,errorHandling:!1,inputs:!1},findings:[]}],groups:[{segment:"api",endpoints:[]},{segment:"updateProfile",endpoints:[]}],methodCounts:[{method:"GET",count:3},{method:"POST",count:3},{method:"DELETE",count:1}],findings:[{id:"api-1-auth",severity:"high",kind:"no-auth",title:"Mutation without auth check",detail:"POST /api/checkout changes state but no session/user lookup was detected.",recommendation:"Verify the caller's session before mutating data, or confirm the route is intentionally public."},{id:"api-1-valid",severity:"medium",kind:"no-validation",title:"Request body not validated",detail:"POST /api/checkout reads request input but no schema validation was found.",recommendation:"Validate and parse the request body with a schema before using it."},{id:"api-5-valid",severity:"medium",kind:"no-validation",title:"Request body not validated",detail:"POST /api/webhooks/stripe reads input without validation. Verify the webhook signature.",recommendation:"Verify the Stripe signature header before trusting the payload."}],counts:{endpoints:7,dynamic:2,mutations:4,protected:3,validated:2,findings:3}},accessibility:{score:74,passes:96,incomplete:5,counts:{critical:1,serious:3,moderate:2,minor:2},byPrinciple:[{principle:"Perceivable",count:4},{principle:"Operable",count:2},{principle:"Understandable",count:1},{principle:"Robust",count:1}],violations:[{id:"a11y1",rule:"color-contrast",impact:"serious",principle:"Perceivable",wcag:["1.4.3","WCAG 2.1 AA"],description:"Elements must meet minimum color contrast ratio thresholds",help:"Text contrast of 3.8:1 is below the 4.5:1 minimum for normal text.",helpUrl:"https://dequeuniversity.com/rules/axe/4.8/color-contrast",filePath:"components/marketing/hero.tsx",line:42,selector:".hero-subtitle",nodes:6,recommendation:"Darken the muted foreground token or increase font weight/size to reach 4.5:1.",snippet:{startLine:42,code:'<p className="hero-subtitle text-muted-foreground/70">Ship better code, faster</p>'}},{id:"a11y2",rule:"image-alt",impact:"critical",principle:"Perceivable",wcag:["1.1.1","WCAG 2.0 A"],description:"Images must have alternate text",help:"3 <img> elements have no alt attribute, so screen readers announce only the file name.",helpUrl:"https://dequeuniversity.com/rules/axe/4.8/image-alt",filePath:"components/product/gallery.tsx",line:28,selector:"img.thumb",nodes:3,recommendation:'Add descriptive alt text, or alt="" for purely decorative images.',snippet:{startLine:28,code:'<img src={thumb.src} className="thumb" />'}},{id:"a11y3",rule:"button-name",impact:"critical",principle:"Robust",wcag:["4.1.2","WCAG 2.0 A"],description:"Buttons must have discernible text",help:"Icon-only buttons have no accessible name for assistive technology.",helpUrl:"https://dequeuniversity.com/rules/axe/4.8/button-name",filePath:"components/dashboard/toolbar.tsx",line:64,selector:"button.icon-btn",nodes:4,recommendation:"Add aria-label or visually-hidden text describing the action.",snippet:{startLine:64,code:'<button className="icon-btn"><Trash className="size-4" /></button>'}},{id:"a11y4",rule:"label",impact:"serious",principle:"Perceivable",wcag:["1.3.1","4.1.2","WCAG 2.0 A"],description:"Form elements must have labels",help:"The search input has placeholder text but no associated <label>.",helpUrl:"https://dequeuniversity.com/rules/axe/4.8/label",filePath:"components/search/search-bar.tsx",line:17,selector:"input[type=search]",nodes:1,recommendation:"Associate a <label htmlFor> or add aria-label to the input.",snippet:{startLine:17,code:'<input type="search" placeholder="Search…" />'}},{id:"a11y5",rule:"link-name",impact:"serious",principle:"Operable",wcag:["2.4.4","4.1.2","WCAG 2.0 A"],description:"Links must have discernible text",help:'2 "Read more" links share identical text with no context, ambiguous out of order.',helpUrl:"https://dequeuniversity.com/rules/axe/4.8/link-name",filePath:"components/blog/post-card.tsx",line:53,selector:"a.read-more",nodes:2,recommendation:'Add an aria-label that includes the post title, e.g. "Read more about …".'},{id:"a11y6",rule:"heading-order",impact:"moderate",principle:"Perceivable",wcag:["1.3.1"],description:"Heading levels should only increase by one",help:"The page jumps from <h2> to <h4>, skipping <h3> and breaking the outline.",helpUrl:"https://dequeuniversity.com/rules/axe/4.8/heading-order",filePath:"app/docs/page.tsx",line:88,selector:"h4",nodes:1,recommendation:"Use sequential heading levels so assistive tech can build a correct outline."},{id:"a11y7",rule:"aria-required-attr",impact:"moderate",principle:"Robust",wcag:["4.1.2"],description:"Required ARIA attributes must be provided",help:'A role="switch" element is missing aria-checked.',helpUrl:"https://dequeuniversity.com/rules/axe/4.8/aria-required-attr",filePath:"components/settings/toggle.tsx",line:12,selector:"[role=switch]",nodes:1,recommendation:"Add aria-checked reflecting the current state, or use a native checkbox."},{id:"a11y8",rule:"tabindex",impact:"minor",principle:"Operable",wcag:["2.4.3"],description:"Avoid positive tabindex values",help:"tabindex={3} forces a non-DOM focus order that confuses keyboard users.",helpUrl:"https://dequeuniversity.com/rules/axe/4.8/tabindex",filePath:"components/checkout/form.tsx",line:31,selector:"input[name=zip]",nodes:1,recommendation:"Remove positive tabindex and rely on natural DOM order."},{id:"a11y9",rule:"html-has-lang",impact:"minor",principle:"Understandable",wcag:["3.1.1","WCAG 2.0 A"],description:"The <html> element must have a lang attribute",help:"No lang attribute means screen readers can't pick the correct pronunciation.",helpUrl:"https://dequeuniversity.com/rules/axe/4.8/html-has-lang",filePath:"app/layout.tsx",line:22,selector:"html",nodes:1,recommendation:'Add lang="en" (or the appropriate locale) to the <html> tag.',snippet:{startLine:22,code:'<html className="bg-background">'}}]},performance:{score:68,totalBundleKb:312,counts:{findings:7},vitals:[{id:"LCP",label:"Largest Contentful Paint",value:3.4,unit:"s",rating:"needs-improvement",threshold:{good:2.5,poor:4}},{id:"INP",label:"Interaction to Next Paint",value:290,unit:"ms",rating:"needs-improvement",threshold:{good:200,poor:500}},{id:"CLS",label:"Cumulative Layout Shift",value:.21,unit:"",rating:"poor",threshold:{good:.1,poor:.25}},{id:"FCP",label:"First Contentful Paint",value:1.6,unit:"s",rating:"good",threshold:{good:1.8,poor:3}},{id:"TTFB",label:"Time to First Byte",value:.7,unit:"s",rating:"good",threshold:{good:.8,poor:1.8}}],bundles:[{route:"/",sizeKb:142,firstLoadKb:312,rating:"poor"},{route:"/dashboard",sizeKb:98,firstLoadKb:268,rating:"needs-improvement"},{route:"/products/[id]",sizeKb:64,firstLoadKb:234,rating:"needs-improvement"},{route:"/blog/[slug]",sizeKb:38,firstLoadKb:208,rating:"good"},{route:"/login",sizeKb:21,firstLoadKb:191,rating:"good"}],findings:[{id:"perf1",kind:"large-dependency",severity:"high",title:"moment.js adds 144 KB to the homepage bundle",detail:"moment is imported on the landing page for a single date format. It ships all locales and is not tree-shakeable.",filePath:"components/marketing/hero.tsx",line:4,recommendation:"Replace moment with date-fns or the native Intl.DateTimeFormat to cut ~140 KB.",estimatedSavingKb:140,snippet:{startLine:4,code:"import moment from 'moment'"}},{id:"perf2",kind:"unoptimized-image",severity:"high",title:"Hero image served as unoptimized 1.8 MB PNG",detail:"A raw <img> loads a 1.8 MB PNG above the fold, dominating LCP. next/image with responsive sizing is not used.",filePath:"components/marketing/hero.tsx",line:51,recommendation:"Use next/image with priority and a modern format (AVIF/WebP) plus width/height to reserve space.",estimatedSavingKb:1600,snippet:{startLine:51,code:'<img src="/hero.png" className="w-full" />'}},{id:"perf3",kind:"layout-shift",severity:"high",title:"Web font swap causes 0.21 CLS",detail:"A late-loading web font without size-adjust reflows the hero text, contributing most of the page's layout shift.",filePath:"app/layout.tsx",line:8,recommendation:"Use next/font (self-hosted, with font-display: swap and metric overrides) to eliminate the shift.",estimatedSavingKb:0},{id:"perf4",kind:"no-code-split",severity:"medium",title:"Charts library loaded eagerly on every route",detail:"recharts (78 KB) is imported in a shared layout, so it ships even on routes that render no charts.",filePath:"components/layout/shell.tsx",line:11,recommendation:"Lazy-load the chart components with next/dynamic and ssr: false.",estimatedSavingKb:78,snippet:{startLine:11,code:"import { AreaChart } from '@/components/charts'"}},{id:"perf5",kind:"render-blocking",severity:"medium",title:"Synchronous third-party analytics script",detail:"A blocking <script> for analytics sits in the document head and delays first paint by ~180 ms.",filePath:"app/layout.tsx",line:30,recommendation:'Load it with next/script using strategy="afterInteractive" or "lazyOnload".',estimatedSavingKb:0,snippet:{startLine:30,code:'<script src="https://cdn.analytics.example/a.js"></script>'}},{id:"perf6",kind:"no-memo",severity:"low",title:"Expensive list re-renders on every keystroke",detail:"The product grid re-sorts 800 items on each parent render because the computation isn't memoized.",filePath:"components/product/grid.tsx",line:22,recommendation:"Wrap the sort in useMemo keyed on the input list and sort order.",estimatedSavingKb:0,snippet:{startLine:22,code:"const sorted = products.slice().sort(compare)"}},{id:"perf7",kind:"duplicate-dependency",severity:"low",title:"Two versions of date utilities bundled",detail:"Both moment and dayjs resolve into the client bundle through different dependencies, duplicating ~12 KB.",filePath:"package.json",line:1,recommendation:"Standardize on a single date library and dedupe the lockfile.",estimatedSavingKb:12}]},tests:{framework:"Vitest",coverage:{lines:62,functions:58,branches:49,statements:63},counts:{total:184,passed:171,failed:5,skipped:8,suites:24,durationMs:14820},suites:[{id:"ts1",name:"cart.test.ts",filePath:"lib/__tests__/cart.test.ts",total:22,passed:20,failed:2,skipped:0,durationMs:1840,status:"failed",tests:[{name:"should add item to cart",fullName:"Cart › should add item to cart",status:"passed",durationMs:45,line:12,assertions:["cart.items.length === 1","cart.total > 0"]},{name:"should apply discount before tax",fullName:"Cart › should apply discount before tax",status:"failed",durationMs:85,line:48,error:"Expected 90.00 but received 100.00",expected:"90.00",actual:"100.00",assertions:["cart.subtotal === 90.00"]},{name:"should calculate tax correctly",fullName:"Cart › should calculate tax correctly",status:"passed",durationMs:32,line:68,assertions:["tax === 9.00","total === 99.00"]},{name:"should remove item from cart",fullName:"Cart › should remove item from cart",status:"failed",durationMs:28,line:82,error:"Item not found in cart",assertions:["cart.items.length === 0"]}]},{id:"ts2",name:"checkout.test.tsx",filePath:"components/__tests__/checkout.test.tsx",total:18,passed:15,failed:1,skipped:2,durationMs:3120,status:"failed"},{id:"ts3",name:"auth.test.ts",filePath:"lib/__tests__/auth.test.ts",total:14,passed:12,failed:2,skipped:0,durationMs:990,status:"failed",tests:[{name:"should hash password",status:"passed",durationMs:28,line:15,assertions:["hash !== password","hash.length > 10"]},{name:"should verify valid session",status:"passed",durationMs:32,line:31,assertions:["session.userId === '123'","session.valid === true"]},{name:"should reject expired token",status:"failed",durationMs:18,line:71,error:"Expected session to be invalid but got valid",assertions:["session.valid === false"]},{name:"should validate jwt signature",status:"failed",durationMs:22,line:85,error:"Invalid signature accepted",assertions:["verifyToken().valid === false"]}]},{id:"ts4",name:"money.test.ts",filePath:"lib/__tests__/money.test.ts",total:31,passed:31,failed:0,skipped:0,durationMs:210,status:"passed"},{id:"ts5",name:"api.test.ts",filePath:"lib/__tests__/api.test.ts",total:26,passed:24,failed:0,skipped:2,durationMs:2670,status:"passed"},{id:"ts6",name:"utils.test.ts",filePath:"lib/__tests__/utils.test.ts",total:19,passed:19,failed:0,skipped:0,durationMs:140,status:"passed"},{id:"ts7",name:"orders.test.ts",filePath:"lib/__tests__/orders.test.ts",total:16,passed:14,failed:0,skipped:2,durationMs:1520,status:"passed"},{id:"ts8",name:"search.test.tsx",filePath:"components/__tests__/search.test.tsx",total:38,passed:36,failed:0,skipped:2,durationMs:4330,status:"passed"}],findings:[{id:"test1",kind:"failing",severity:"high",title:"cart applies discount before tax incorrectly",detail:"Expected subtotal 90.00 after a 10% discount on 100.00, received 100.00. The discount is applied after tax instead of before.",filePath:"lib/__tests__/cart.test.ts",line:48,recommendation:"Fix the order of operations in applyDiscount() so percentage discounts run on the pre-tax subtotal.",snippet:{startLine:46,code:" expect(cart.subtotal).toBe(90.0)\n // Received: 100.0\n const cart = applyDiscount(base, { kind: 'percent', amount: 10 })"}},{id:"test2",kind:"failing",severity:"high",title:"auth: expired token is treated as valid",detail:"verifySession() returns the user for a token whose exp is in the past, a security-relevant test failure.",filePath:"lib/__tests__/auth.test.ts",line:71,recommendation:"Compare exp against Date.now() in seconds and reject expired tokens before returning the session."},{id:"test3",kind:"flaky",severity:"medium",title:"checkout test fails intermittently (~18% of runs)",detail:"The Stripe redirect assertion depends on an un-awaited promise, so it passes or fails based on timing.",filePath:"components/__tests__/checkout.test.tsx",line:102,recommendation:"Await the navigation and use findBy* queries instead of getBy* to wait for async UI."},{id:"test4",kind:"slow",severity:"low",title:"search suite takes 4.3 s",detail:"search.test.tsx renders the full results page 38 times without mocking the network layer.",filePath:"components/__tests__/search.test.tsx",line:1,recommendation:"Mock the fetch layer and share a render setup to cut suite time substantially."},{id:"test5",kind:"uncovered",severity:"medium",title:"Payment webhook handler has 0% coverage",detail:"app/api/webhooks/stripe/route.ts contains signature verification and order fulfillment logic with no tests.",filePath:"app/api/webhooks/stripe/route.ts",line:1,recommendation:"Add tests for valid/invalid signatures and idempotent fulfillment before relying on it in production."},{id:"test6",kind:"no-tests",severity:"low",title:"Discount engine has no test file",detail:"lib/discount.ts implements stacking rules and edge cases but has no corresponding test suite.",filePath:"lib/discount.ts",line:1,recommendation:"Create lib/__tests__/discount.test.ts covering stacking, caps, and expiry."}],files:[{filePath:"app/api/webhooks/stripe/route.ts",lines:0,functions:0,branches:0,statements:0,uncoveredLines:[1,2,3,4,5]},{filePath:"lib/discount.ts",lines:0,functions:0,branches:0,statements:0},{filePath:"lib/orders.ts",lines:34,functions:40,branches:22,statements:36,uncoveredLines:[45,46,51,62,78]},{filePath:"components/checkout/form.tsx",lines:41,functions:50,branches:30,statements:44},{filePath:"lib/cart.ts",lines:58,functions:62,branches:44,statements:60},{filePath:"lib/auth.ts",lines:67,functions:70,branches:55,statements:68},{filePath:"lib/api.ts",lines:81,functions:85,branches:72,statements:83},{filePath:"lib/money.ts",lines:98,functions:100,branches:94,statements:98}]}},history:[{runId:"r1",timestamp:"2026-06-10T09:00:00Z",score:54,lintErrors:12,lintWarnings:9,typeErrors:8,securityFindings:9},{runId:"r2",timestamp:"2026-06-11T09:00:00Z",score:58,lintErrors:10,lintWarnings:8,typeErrors:7,securityFindings:8},{runId:"r3",timestamp:"2026-06-12T09:00:00Z",score:61,lintErrors:9,lintWarnings:9,typeErrors:6,securityFindings:7},{runId:"r4",timestamp:"2026-06-13T09:00:00Z",score:60,lintErrors:9,lintWarnings:7,typeErrors:6,securityFindings:7},{runId:"r5",timestamp:"2026-06-14T09:00:00Z",score:65,lintErrors:7,lintWarnings:8,typeErrors:5,securityFindings:6},{runId:"r6",timestamp:"2026-06-15T09:00:00Z",score:68,lintErrors:6,lintWarnings:7,typeErrors:4,securityFindings:6},{runId:"r7",timestamp:"2026-06-16T09:00:00Z",score:70,lintErrors:5,lintWarnings:7,typeErrors:3,securityFindings:5},{runId:"r8",timestamp:"2026-06-17T14:32:19Z",score:72,lintErrors:4,lintWarnings:7,typeErrors:3,securityFindings:5}]};async function Mf(e){let t=await fetch(e,{cache:"no-store"});if(!t.ok)throw Error(`state ${t.status}`);let n=await t.json();return n&&n.report&&n.insights?{...n,history:n.history??[]}:null}e.s(["DashboardLoader",0,function(){let{data:e,source:t,demo:n,setDemo:r}=function(){let{data:e,error:t,isLoading:n,mutate:r}=u_("/api/state",Mf,{revalidateOnFocus:!1,shouldRetryOnError:!1}),[i,a]=(0,eP.useState)(null),[s,o]=(0,eP.useState)(!1),l=(0,eP.useCallback)(e=>{e&&function(){if(lm().length>0)return;let e=Date.now(),t=t=>new Date(e-6e4*t).toISOString(),n=(e,t,n,r,i,a)=>({source:e,severity:t,title:n,filePath:r,line:i,description:n,recommendation:a});lp([{id:ll(),title:"SQL injection via unparameterized query",columnId:"in-progress",priority:"high",source:"security",severity:"critical",filePath:"app/api/orders/route.ts",line:31,groupId:"g_sprint",note:"Switch to a parameterized query before the next release cut.",issue:n("security","critical","SQL injection via unparameterized query","app/api/orders/route.ts",31,"User input is concatenated directly into a SQL string. Use parameterized queries or a query builder to safely bind values."),createdAt:t(180),updatedAt:t(20)},{id:ll(),title:"Service role key exposed to the client bundle",columnId:"todo",priority:"high",source:"security",severity:"critical",filePath:"lib/supabase.ts",line:4,groupId:"g_sprint",issue:n("security","critical","Service role key exposed to the client bundle","lib/supabase.ts",4,"The Supabase service role key is referenced in client code. Move privileged calls to the server and use the anon key on the client."),createdAt:t(170),updatedAt:t(170)},{id:ll(),title:"Missing authorization check on order lookup",columnId:"todo",priority:"medium",source:"security",severity:"high",filePath:"app/api/orders/route.ts",line:22,groupId:"g_backlog",issue:n("security","high","Missing authorization check on order lookup","app/api/orders/route.ts",22,"Any authenticated user can read any order by id. Scope the query to the session user before returning records."),createdAt:t(160),updatedAt:t(160)},{id:ll(),title:"Write integration tests for the checkout flow",columnId:"todo",priority:"low",groupId:"g_backlog",note:"No coverage on the highest-revenue path. Add happy-path + failure cases.",createdAt:t(90),updatedAt:t(90)},{id:ll(),title:"Behind on security patches (4.17.20 → 4.17.21)",columnId:"done",priority:"medium",source:"deps",severity:"medium",filePath:"package.json",line:1,groupId:"g_backlog",issue:n("deps","medium","Behind on security patches (4.17.20 → 4.17.21)","package.json",1,"A transitive dependency has a known prototype-pollution advisory fixed in a patch release. Bump and re-lock."),createdAt:t(300),updatedAt:t(240)}])}(),o(e)},[]),d=(0,eP.useRef)(null);(0,eP.useEffect)(()=>{if(t||n)return;let e="https:"===window.location.protocol?"wss":"ws",i=`${e}://${window.location.host}/ws`,s=!1;try{let e=new WebSocket(i);return d.current=e,e.onmessage=e=>{try{let t=JSON.parse(e.data);t?.type==="state"&&t.state?.report&&t.state?.insights&&(a(t.state),r(t.state,{revalidate:!1}))}catch{}},e.onerror=()=>{s||e.close()},()=>{s=!0,e.close(),d.current=null}}catch{}},[t,n,r]);let c=i??e??null;return c?{data:c,source:"live",demo:s,setDemo:l}:n?{data:Mm,source:"loading",demo:s,setDemo:l}:s?{data:Mp,source:"demo",demo:s,setDemo:l}:{data:Mm,source:"empty",demo:s,setDemo:l}}();return(0,eT.jsxs)(eT.Fragment,{children:["demo"===t&&(0,eT.jsxs)("div",{className:"fixed bottom-3 right-3 z-50 rounded-sm border border-border bg-card px-2.5 py-1 font-mono text-[10px] text-muted-foreground shadow-sm",children:["Demo data — run ",(0,eT.jsx)("span",{className:"font-semibold text-foreground",children:"codelens"})," in a project for live results"]}),(0,eT.jsx)(Mu,{report:e.report,history:e.history,insights:e.insights,workspace:e.workspace,empty:"empty"===t||"loading"===t,demoActive:"demo"===t,onToggleDemo:r})]})}],40881)}]);