@devframes/plugin-git 0.7.2 → 0.7.4

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 (28) hide show
  1. package/README.md +7 -7
  2. package/dist/cli.mjs +1 -1
  3. package/dist/client/404/index.html +1 -1
  4. package/dist/client/404.html +1 -1
  5. package/dist/client/__next.__PAGE__.txt +2 -2
  6. package/dist/client/__next._full.txt +3 -3
  7. package/dist/client/__next._head.txt +1 -1
  8. package/dist/client/__next._index.txt +2 -2
  9. package/dist/client/__next._tree.txt +2 -2
  10. package/dist/client/_next/static/chunks/{0v3rn2zr459uq.css → 0_2422juy0h1v.css} +1 -1
  11. package/dist/client/_next/static/chunks/{13xy7jqtpuh8r.js → 3wvs0t49_75wn.js} +2 -2
  12. package/dist/client/_not-found/__next._full.txt +2 -2
  13. package/dist/client/_not-found/__next._head.txt +1 -1
  14. package/dist/client/_not-found/__next._index.txt +2 -2
  15. package/dist/client/_not-found/__next._not-found.__PAGE__.txt +1 -1
  16. package/dist/client/_not-found/__next._not-found.txt +1 -1
  17. package/dist/client/_not-found/__next._tree.txt +2 -2
  18. package/dist/client/_not-found/index.html +1 -1
  19. package/dist/client/_not-found/index.txt +2 -2
  20. package/dist/client/index.html +1 -1
  21. package/dist/client/index.txt +3 -3
  22. package/dist/index.d.mts +1 -1
  23. package/dist/index.mjs +1 -1
  24. package/dist/{src-Cplt5_oU.mjs → src-DpLNHQoM.mjs} +12 -12
  25. package/package.json +3 -3
  26. /package/dist/client/_next/static/{TJtfuCpZpUpu0oFGmPkuv → 9tWEY8n-kb40prWfFft9t}/_buildManifest.js +0 -0
  27. /package/dist/client/_next/static/{TJtfuCpZpUpu0oFGmPkuv → 9tWEY8n-kb40prWfFft9t}/_clientMiddlewareManifest.js +0 -0
  28. /package/dist/client/_next/static/{TJtfuCpZpUpu0oFGmPkuv → 9tWEY8n-kb40prWfFft9t}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,82747,(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,o=l(e),a=o[0],s=o[1],d=new i((a+s)*3/4-s),u=0,c=s>0?a-4:a;for(n=0;n<c;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[u++]=t>>16&255,d[u++]=t>>8&255,d[u++]=255&t;return 2===s&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,d[u++]=255&t),1===s&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,d[u++]=t>>8&255,d[u++]=255&t),d},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;a<s;a+=16383)o.push(function(e,t,r){for(var i,o=[],a=t;a<r;a+=3)i=(e[a]<<16&0xff0000)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(n[i>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}(e,a,a+16383>s?s:a+16383));return 1===i?o.push(n[(t=e[r-1])>>2]+n[t<<4&63]+"=="):2===i&&o.push(n[(t=(e[r-2]<<8)+e[r-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),o.join("")};for(var n=[],r=[],i="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a<s;++a)n[a]=o[a],r[o.charCodeAt(a)]=a;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),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(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 u(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"),!s.isEncoding(i))throw TypeError("Unknown encoding: "+i);var o=0|f(r,i),l=a(o),d=l.write(r,i);return d!==o&&(l=l.slice(0,d)),l}if(ArrayBuffer.isView(e))return c(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(N(e,ArrayBuffer)||e&&N(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(N(e,SharedArrayBuffer)||e&&N(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),s.prototype),r}(e,t,n);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var u=e.valueOf&&e.valueOf();if(null!=u&&u!==e)return s.from(u,t,n);var p=function(e){if(s.isBuffer(e)){var t=0|h(e.length),n=a(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)?a(0):c(e):"Buffer"===e.type&&Array.isArray(e.data)?c(e.data):void 0}(e);if(p)return p;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.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 u(e){return d(e),a(e<0?0:0|h(e))}function c(e){for(var t=e.length<0?0:0|h(e.length),n=a(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}t.Buffer=s,t.SlowBuffer=function(e){return+e!=e&&(e=0),s.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,s.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}}(),!s.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(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(e,t,n){return l(e,t,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(e,t,n){return(d(e),e<=0)?a(e):void 0!==t?"string"==typeof n?a(e).fill(t,n):a(e).fill(t):a(e)},s.allocUnsafe=function(e){return u(e)},s.allocUnsafeSlow=function(e){return u(e)};function h(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function f(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||N(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 A(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return L(e).length;default:if(i)return r?-1:A(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,n){var i,o,a,s=!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="",o=t;o<n;++o)i+=T[e[o]];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,o=t,a=n,0===o&&a===i.length?r.fromByteArray(i):r.fromByteArray(i.slice(o,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}(this,t,n);default:if(s)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),s=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,i){var o;if(0===e.length)return -1;if("string"==typeof n?(r=n,n=0):n>0x7fffffff?n=0x7fffffff:n<-0x80000000&&(n=-0x80000000),(o=n*=1)!=o&&(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=s.from(t,r)),s.isBuffer(t))return 0===t.length?-1:b(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 b(e,[t],n,r,i)}throw TypeError("val must be string, number or Buffer")}function b(e,t,n,r,i){var o,a=1,s=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;a=2,s/=2,l/=2,n/=2}function d(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var u=-1;for(o=n;o<s;o++)if(d(e,o)===d(t,-1===u?0:o-u)){if(-1===u&&(u=o),o-u+1===l)return u*a}else -1!==u&&(o-=o-u),u=-1}else for(n+l>s&&(n=s-l),o=n;o>=0;o--){for(var c=!0,h=0;h<l;h++)if(d(e,o+h)!==d(t,h)){c=!1;break}if(c)return o}return -1}s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(N(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),N(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.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,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:+(r<n)},s.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}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);if(void 0===t)for(n=0,t=0;n<e.length;++n)t+=e[n].length;var n,r=s.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(N(o,Uint8Array)&&(o=s.from(o)),!s.isBuffer(o))throw TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},s.byteLength=f,s.prototype._isBuffer=!0,s.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)m(this,t,t+1);return this},s.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)m(this,t,t+3),m(this,t+1,t+2);return this},s.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)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},s.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?v(this,0,e):p.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.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+">"},o&&(s.prototype[o]=s.prototype.inspect),s.prototype.compare=function(e,t,n,r,i){if(N(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.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 o=i-r,a=n-t,l=Math.min(o,a),d=this.slice(r,i),u=e.slice(t,n),c=0;c<l;++c)if(d[c]!==u[c]){o=d[c],a=u[c];break}return o<a?-1:+(a<o)},s.prototype.includes=function(e,t,n){return -1!==this.indexOf(e,t,n)},s.prototype.indexOf=function(e,t,n){return g(this,e,t,n,!0)},s.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 o,a,s,l,d=e[i],u=null,c=d>239?4:d>223?3:d>191?2:1;if(i+c<=n)switch(c){case 1:d<128&&(u=d);break;case 2:(192&(o=e[i+1]))==128&&(l=(31&d)<<6|63&o)>127&&(u=l);break;case 3:o=e[i+1],a=e[i+2],(192&o)==128&&(192&a)==128&&(l=(15&d)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],(192&o)==128&&(192&a)==128&&(192&s)==128&&(l=(15&d)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,c=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=c}var h=r,f=h.length;if(f<=4096)return String.fromCharCode.apply(String,h);for(var p="",m=0;m<f;)p+=String.fromCharCode.apply(String,h.slice(m,m+=4096));return p}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 w(e,t,n,r,i,o){if(!s.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw RangeError('"value" argument is out of bounds');if(n+r>e.length)throw RangeError("Index out of range")}function x(e,t,n,r,i,o){if(n+r>e.length||n<0)throw RangeError("Index out of range")}function k(e,t,n,r,o){return t*=1,n>>>=0,o||x(e,t,n,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,n,r,23,4),n+4}function S(e,t,n,r,o){return t*=1,n>>>=0,o||x(e,t,n,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,n,r,52,8),n+8}s.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,o,a,s,l,d,u,c,h=this.length-t;if((void 0===n||n>h)&&(n=h),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var f=!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 o=t.length;r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s,l=parseInt(t.substr(2*a,2),16);if((s=l)!=s)break;e[n+a]=l}return a}(this,e,t,n);case"utf8":case"utf-8":return i=t,o=n,_(A(e,this.length-i),this,i,o);case"ascii":return a=t,s=n,_(E(e),this,a,s);case"latin1":case"binary":return function(e,t,n,r){return _(E(t),e,n,r)}(this,e,t,n);case"base64":return l=t,d=n,_(L(e),this,l,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u=t,c=n,_(function(e,t){for(var n,r,i=[],o=0;o<e.length&&!((t-=2)<0);++o)r=(n=e.charCodeAt(o))>>8,i.push(n%256),i.push(r);return i}(e,this.length-u),this,u,c);default:if(f)throw TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),f=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.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,s.prototype),r},s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||y(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},s.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},s.prototype.readUInt8=function(e,t){return e>>>=0,t||y(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]<<8|this[e+1]},s.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]},s.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])},s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||y(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||y(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},s.prototype.readInt8=function(e,t){return(e>>>=0,t||y(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},s.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},s.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},s.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},s.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]},s.prototype.readFloatLE=function(e,t){return e>>>=0,t||y(e,4,this.length),i.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||y(e,4,this.length),i.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||y(e,8,this.length),i.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||y(e,8,this.length),i.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,n,r){if(e*=1,t>>>=0,n>>>=0,!r){var i=Math.pow(2,8*n)-1;w(this,e,t,n,i,0)}var o=1,a=0;for(this[t]=255&e;++a<n&&(o*=256);)this[t+a]=e/o&255;return t+n},s.prototype.writeUIntBE=function(e,t,n,r){if(e*=1,t>>>=0,n>>>=0,!r){var i=Math.pow(2,8*n)-1;w(this,e,t,n,i,0)}var o=n-1,a=1;for(this[t+o]=255&e;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+n},s.prototype.writeUInt8=function(e,t,n){return e*=1,t>>>=0,n||w(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,n){return e*=1,t>>>=0,n||w(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUInt16BE=function(e,t,n){return e*=1,t>>>=0,n||w(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUInt32LE=function(e,t,n){return e*=1,t>>>=0,n||w(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},s.prototype.writeUInt32BE=function(e,t,n){return e*=1,t>>>=0,n||w(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},s.prototype.writeIntLE=function(e,t,n,r){if(e*=1,t>>>=0,!r){var i=Math.pow(2,8*n-1);w(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<n&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e*=1,t>>>=0,!r){var i=Math.pow(2,8*n-1);w(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e*=1,t>>>=0,n||w(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){return e*=1,t>>>=0,n||w(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e*=1,t>>>=0,n||w(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,n){return e*=1,t>>>=0,n||w(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},s.prototype.writeInt32BE=function(e,t,n){return e*=1,t>>>=0,n||w(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},s.prototype.writeFloatLE=function(e,t,n){return k(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return k(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return S(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return S(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.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 o=i-1;o>=0;--o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,r),t);return i},s.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&&!s.isEncoding(r))throw TypeError("Unknown encoding: "+r);if(1===e.length){var i,o=e.charCodeAt(0);("utf8"===r&&o<128||"latin1"===r)&&(e=o)}}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 a=s.isBuffer(e)?e:s.from(e,r),l=a.length;if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=a[i%l]}return this};var C=/[^+/0-9A-Za-z-_]/g;function A(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319||a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else if(n<1114112){if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}else throw Error("Invalid code point")}return o}function E(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}function L(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(C,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function _(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 N(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var T=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 o,a,s=8*i-r-1,l=(1<<s)-1,d=l>>1,u=-7,c=n?i-1:0,h=n?-1:1,f=e[t+c];for(c+=h,o=f&(1<<-u)-1,f>>=-u,u+=s;u>0;o=256*o+e[t+c],c+=h,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+e[t+c],c+=h,u-=8);if(0===o)o=1-d;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=d}return(f?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,l,d=8*o-i-1,u=(1<<d)-1,c=u>>1,h=5960464477539062e-23*(23===i),f=r?0:o-1,p=r?1:-1,m=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(s=+!!isNaN(t),a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+c>=1?t+=h/l:t+=h*Math.pow(2,1-c),t*l>=2&&(a++,l/=2),a+c>=u?(s=0,a=u):a+c>=1?(s=(t*l-1)*Math.pow(2,i),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;e[n+f]=255&s,f+=p,s/=256,i-=8);for(a=a<<i|s,d+=i;d>0;e[n+f]=255&a,f+=p,a/=256,d-=8);e[n+f-p]|=128*m}}},i={};function o(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}},a=!0;try{r[e](n,n.exports,o),a=!1}finally{a&&delete i[e]}return n.exports}o.ab="/ROOT/node_modules/.pnpm/next@16.2.10_@playwright+test@1.61.1_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/next/dist/compiled/buffer/",t.exports=o(72)},4135,(e,t,n)=>{e.e,function(e){let t=Symbol("newer"),n=Symbol("older");class r{constructor(e,t){"number"!=typeof e&&(t=e,e=0),this.size=0,this.limit=e,this.oldest=this.newest=void 0,this._keymap=new Map,t&&(this.assign(t),e<1&&(this.limit=this.size))}_markEntryAsUsed(e){e!==this.newest&&(e[t]&&(e===this.oldest&&(this.oldest=e[t]),e[t][n]=e[n]),e[n]&&(e[n][t]=e[t]),e[t]=void 0,e[n]=this.newest,this.newest&&(this.newest[t]=e),this.newest=e)}assign(e){let r,o=this.limit||Number.MAX_VALUE;this._keymap.clear();let a=e[Symbol.iterator]();for(let e=a.next();!e.done;e=a.next()){let a=new i(e.value[0],e.value[1]);if(this._keymap.set(a.key,a),r?(r[t]=a,a[n]=r):this.oldest=a,r=a,0==o--)throw Error("overflow")}this.newest=r,this.size=this._keymap.size}get(e){var t=this._keymap.get(e);return t?(this._markEntryAsUsed(t),t.value):void 0}set(e,r){var o=this._keymap.get(e);return o?(o.value=r,this._markEntryAsUsed(o)):(this._keymap.set(e,o=new i(e,r)),this.newest?(this.newest[t]=o,o[n]=this.newest):this.oldest=o,this.newest=o,++this.size,this.size>this.limit&&this.shift()),this}shift(){var e=this.oldest;if(e)return this.oldest[t]?(this.oldest=this.oldest[t],this.oldest[n]=void 0):(this.oldest=void 0,this.newest=void 0),e[t]=e[n]=void 0,this._keymap.delete(e.key),--this.size,[e.key,e.value]}find(e){let t=this._keymap.get(e);return t?t.value:void 0}has(e){return this._keymap.has(e)}delete(e){var r=this._keymap.get(e);return r?(this._keymap.delete(r.key),r[t]&&r[n]?(r[n][t]=r[t],r[t][n]=r[n]):r[t]?(r[t][n]=void 0,this.oldest=r[t]):r[n]?(r[n][t]=void 0,this.newest=r[n]):this.oldest=this.newest=void 0,this.size--,r.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new a(this.oldest)}values(){return new s(this.oldest)}entries(){return this}[Symbol.iterator](){return new o(this.oldest)}forEach(e,n){"object"!=typeof n&&(n=this);let r=this.oldest;for(;r;)e.call(n,r.value,r.key,this),r=r[t]}toJSON(){for(var e=Array(this.size),n=0,r=this.oldest;r;)e[n++]={key:r.key,value:r.value},r=r[t];return e}toString(){for(var e="",n=this.oldest;n;)e+=String(n.key)+":"+n.value,(n=n[t])&&(e+=" < ");return e}}function i(e,r){this.key=e,this.value=r,this[t]=void 0,this[n]=void 0}function o(e){this.entry=e}function a(e){this.entry=e}function s(e){this.entry=e}e.LRUMap=r,o.prototype[Symbol.iterator]=function(){return this},o.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:[e.key,e.value]}):{done:!0,value:void 0}},a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:e.key}):{done:!0,value:void 0}},s.prototype[Symbol.iterator]=function(){return this},s.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:e.value}):{done:!0,value:void 0}}}(n)},53567,e=>{"use strict";let t,n,r,i,o,a,s,l,d,u;var c,h,f,p,m=e.i(46369),g=e.i(19594);function b(...e){return e.filter(Boolean).join(" ")}function v({variant:e="primary",size:t="md",class:n}={}){return b({primary:"btn-primary",secondary:"btn-action",outline:"btn-action",ghost:"inline-flex items-center justify-center gap-1.5 rounded px2 py1 op75 hover:op100 hover:bg-active transition disabled:pointer-events-none disabled:op30!",destructive:"btn-action text-error border-error/30!",link:"inline-flex items-center gap-1.5 color-active hover:underline underline-offset-2"}[e],"sm"===t?"primary"===e?"text-sm px-2.5! py-1!":"text-sm":"lg"===t?"text-base px-4! py-2!":"",n)}var y=e.i(85053);let w="__connection.json",x="devframe_otp",k=function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return"string"===n&&"string"===r?e.localeCompare(t):"number"===n&&"number"===r?e-t:String.prototype.localeCompare.call(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(null===e)return"null";switch(typeof e){case"string":return t?e:`'${e}'`;case"bigint":return`${e}n`;case"object":return this.$object(e);case"function":return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if("[object Object]"!==t)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||void 0===n?"":n.name;if(""!==r&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if("function"==typeof e.toJSON){let t=e.toJSON();return r+(null!==t&&"object"==typeof t?this.$object(t):`(${this.serialize(t)})`)}return this.serializeObjectEntries(r,Object.entries(e))}serializeBuiltInType(e,t){let n=this["$"+e];if(n)return n.call(this,t);if("function"==typeof t?.entries)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=",")}return r+"}"}$object(e){let t=this.#e.get(e);return void 0===t&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return"[native code] }"===t.slice(-15)?`${e.name||""}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,"")}`}$Array(e){let t="[";for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=",");return t+"]"}$Date(e){try{return`Date(${e.toISOString()})`}catch{return"Date(null)"}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(",")}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries("Map",e.entries())}}for(let t of["Error","RegExp","URL"])e.prototype["$"+t]=function(e){return`${t}(${e})`};for(let t of["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"])e.prototype["$"+t]=function(e){return`${t}[${e.join(",")}]`};for(let t of["BigInt64Array","BigUint64Array"])e.prototype["$"+t]=function(e){return`${t}[${e.join("n,")}${e.length>0?"n":""}]`};return e}(),S=[0x6a09e667,-0x4498517b,0x3c6ef372,-0x5ab00ac6,0x510e527f,-0x64fa9774,0x1f83d9ab,0x5be0cd19],C=[0x428a2f98,0x71374491,-0x4a3f0431,-0x164a245b,0x3956c25b,0x59f111f1,-0x6dc07d5c,-0x54e3a12b,-0x27f85568,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,-0x7f214e02,-0x6423f959,-0x3e640e8c,-0x1b64963f,-0x1041b87a,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,-0x67c1aeae,-0x57ce3993,-0x4ffcd838,-0x40a68039,-0x391ff40d,-0x2a586eb9,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,-0x7e3d36d2,-0x6d8dd37b,-0x5d40175f,-0x57e599b5,-0x3db47490,-0x3893ae5d,-0x2e6d17e7,-0x2966f9dc,-0xbf1ca7b,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,-0x7b3787ec,-0x7338fdf8,-0x6f410006,-0x5baf9315,-0x41065c09,-0x398e870e],A=[];class E{_data=new L;_hash=new L([...S]);_nDataBytes=0;_minBufferSize=0;finalize(e){e&&this._append(e);let t=8*this._nDataBytes,n=8*this._data.sigBytes;return this._data.words[n>>>5]|=128<<24-n%32,this._data.words[(n+64>>>9<<4)+14]=Math.floor(t/0x100000000),this._data.words[(n+64>>>9<<4)+15]=t,this._data.sigBytes=4*this._data.words.length,this._process(),this._hash}_doProcessBlock(e,t){let n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],d=n[6],u=n[7];for(let n=0;n<64;n++){if(n<16)A[n]=0|e[t+n];else{let e=A[n-15],t=(e<<25|e>>>7)^(e<<14|e>>>18)^e>>>3,r=A[n-2],i=(r<<15|r>>>17)^(r<<13|r>>>19)^r>>>10;A[n]=t+A[n-7]+i+A[n-16]}let c=s&l^~s&d,h=r&i^r&o^i&o,f=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),p=u+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+c+C[n]+A[n],m=f+h;u=d,d=l,l=s,s=a+p|0,a=o,o=i,i=r,r=p+m|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+l|0,n[6]=n[6]+d|0,n[7]=n[7]+u|0}_append(e){"string"==typeof e&&(e=L.fromUtf8(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_process(e){let t,n=this._data.sigBytes/64,r=16*(n=e?Math.ceil(n):Math.max((0|n)-this._minBufferSize,0)),i=Math.min(4*r,this._data.sigBytes);if(r){for(let e=0;e<r;e+=16)this._doProcessBlock(this._data.words,e);t=this._data.words.splice(0,r),this._data.sigBytes-=i}return new L(t,i)}}class L{words;sigBytes;constructor(e,t){e=this.words=e||[],this.sigBytes=void 0===t?4*e.length:t}static fromUtf8(e){let t=unescape(encodeURIComponent(e)),n=t.length,r=[];for(let e=0;e<n;e++)r[e>>>2]|=(255&t.charCodeAt(e))<<24-e%4*8;return new L(r,n)}toBase64(){let e=[];for(let t=0;t<this.sigBytes;t+=3){let n=(this.words[t>>>2]>>>24-t%4*8&255)<<16|(this.words[t+1>>>2]>>>24-(t+1)%4*8&255)<<8|this.words[t+2>>>2]>>>24-(t+2)%4*8&255;for(let r=0;r<4&&8*t+6*r<8*this.sigBytes;r++)e.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".charAt(n>>>6*(3-r)&63))}return e.join("")}concat(e){if(this.words[this.sigBytes>>>2]&=0xffffffff<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4),this.sigBytes%4)for(let t=0;t<e.sigBytes;t++){let n=e.words[t>>>2]>>>24-t%4*8&255;this.words[this.sigBytes+t>>>2]|=n<<24-(this.sigBytes+t)%4*8}else for(let t=0;t<e.sigBytes;t+=4)this.words[this.sigBytes+t>>>2]=e.words[t>>>2];this.sigBytes+=e.sigBytes}}function _(e){var t;return t="string"==typeof e?`'${e}'`:new k().serialize(e),new E().finalize(t).toBase64()}class N{cacheMap=new Map;options;keySerializer;constructor(e){this.options=e,this.keySerializer=e.keySerializer||(e=>_(e))}updateOptions(e){this.options={...this.options,...e}}cached(e,t){let n=this.cacheMap.get(e);if(n)return n.get(this.keySerializer(t))}has(e,t){return this.cacheMap.get(e)?.has(this.keySerializer(t))??!1}apply(e,t){let n=this.cacheMap.get(e.m)||new Map;n.set(this.keySerializer(e.a),t),this.cacheMap.set(e.m,n)}validate(e){return this.options.functions.includes(e)}clear(e){e?this.cacheMap.delete(e):this.cacheMap.clear()}}function T(e,...t){return"function"==typeof e?e(...t):e}let R=Error.captureStackTrace;var M=class e extends Error{name="Diagnostic";docs;fix;sources;get why(){return this.message}constructor(t,n=e){super(t.why,{cause:t.cause}),this.fix=t.fix,this.docs=t.docs,this.sources=t.sources,R?.(this,n)}toJSON(){return{name:this.name,why:this.why,fix:this.fix,docs:this.docs,sources:this.sources,cause:this.cause,stack:this.stack}}};function P(e,t){let n=`\x1b[${e}m`,r=`\x1b[${t}m`;return(e,...t)=>{if(Array.isArray(e)&&"raw"in e){let i="";for(let n=0;n<e.length;n++)i+=e[n],n<t.length&&(i+=String(t[n]));return`${n}${i}${r}`}return`${n}${String(e)}${r}`}}let I={blue:P(34,39),cyan:P(36,39),gray:P(90,39),green:P(32,39),red:P(31,39),yellow:P(33,39),bold:P(1,22),dim:P(2,22),reset:P(0,0),underline:P(4,24)},D=e=>{let t=`${I.bold(I.red(`[${e.name}]`))} ${e.message}`,n=[];return(e.fix&&n.push(`${I.dim("fix:")} ${e.fix}`),e.sources?.length&&n.push(`${I.dim("sources:")} ${e.sources.join(", ")}`),e.docs&&n.push(`${I.dim("see:")} ${I.cyan(e.docs)}`),0===n.length)?t:[t,...n.map((e,t)=>`${I.dim(t<n.length-1?"├▶":"╰▶")} ${e}`)].join("\n")},j=function(e){let t=e.reporters??[],n={},{docsBase:r}=e;for(let i of Object.keys(e.codes)){let o=e.codes[i],a=!1===o.docs?void 0:o.docs||("string"==typeof r?`${r}/${i.toLowerCase()}`:r?.(i)),s=(e={},n={})=>{let r=new M({why:T(o.why,e),fix:T(o.fix,e),docs:a,cause:e.cause,sources:e.sources},s);for(let e of(r.name=i,t))e(r,n);return r};n[i]=s}return n}({docsBase:"https://devfra.me/errors",reporters:[function(e,{method:t="warn"}={}){console[t](D(e))}],codes:{DF0019:{why:e=>`RPC function "${e.name}" has \`agent\` set but \`jsonSerializable\` is not \`true\` — MCP requires JSON-serializable data.`,fix:"Set `jsonSerializable: true` if the payload is JSON-safe, or remove `agent` to keep it RPC-only."},DF0020:{why:e=>`RPC function "${e.name}" declares \`jsonSerializable: true\` but the value at "${e.path}" is a ${e.type}.`,fix:"Either drop `jsonSerializable: true` (falls back to structured-clone) or change the value to a JSON-safe shape."},DF0021:{why:e=>`RPC function "${e.name}" is already registered`,fix:"Use the `force` parameter to overwrite an existing registration."},DF0022:{why:e=>`RPC function "${e.name}" is not registered. Use register() to add new functions.`},DF0023:{why:e=>`RPC function "${e.name}" is not registered`},DF0024:{why:e=>`Either handler or setup function must be provided for RPC function "${e.name}"`},DF0025:{why:e=>`Function "${e.name}" not found in dump store`},DF0026:{why:e=>`No dump match for "${e.name}" with args: ${e.args}`},DF0027:{why:e=>`Function "${e.name}" with type "${e.type}" cannot have dump configuration. Only "static" and "query" types support dumps.`},DF0028:{why:e=>`Function "${e.name}" with type "${e.type}" cannot use \`snapshot: true\`. Only "query" functions support this sugar; "static" functions have equivalent default behavior already.`,fix:"Remove `snapshot: true`, or change the function type to `query`."}}});async function $(e,t){if(!e.setup)return{};if("object"==typeof t&&null!==t){e.__cache??=new WeakMap;let n=e.__cache,r=n.get(t);return r||((r=Promise.resolve(e.setup(t))).catch(()=>{n.get(t)===r&&n.delete(t)}),n.set(t,r)),await r}if(!e.__promise){let n=Promise.resolve(e.setup(t));n.catch(()=>{e.__promise===n&&(e.__promise=void 0)}),e.__promise=n}return await e.__promise}async function O(e,t){if(e.handler)return e.handler;let n=await $(e,t);if(!n.handler)throw j.DF0024({name:e.name});return n.handler}class z{context;definitions;functions;_onChanged;constructor(e){this.context=e,this.definitions=new Map,this._onChanged=[];const t=this.definitions,n=this;this.functions=new Proxy({},{get(e,r){let i=t.get(r);if(i)return O(i,n.context)},has:(e,n)=>t.has(n),getOwnPropertyDescriptor:(e,n)=>({value:t.get(n)?.handler,configurable:!0,enumerable:!0}),ownKeys:()=>Array.from(t.keys())})}register(e,t=!1){if(this.definitions.has(e.name)&&!t)throw j.DF0021({name:e.name});B(e),this.definitions.set(e.name,e),this._onChanged.forEach(t=>t(e.name))}update(e,t=!1){if(!this.definitions.has(e.name)&&!t)throw j.DF0022({name:e.name});B(e),this.definitions.set(e.name,e),this._onChanged.forEach(t=>t(e.name))}onChanged(e){return this._onChanged.push(e),()=>{let t=this._onChanged.indexOf(e);-1!==t&&this._onChanged.splice(t,1)}}async getHandler(e){return await O(this.definitions.get(e),this.context)}getSchema(e){let t=this.definitions.get(e);if(!t)throw j.DF0023({name:String(e)});return{args:t.args,returns:t.returns}}has(e){return this.definitions.has(e)}get(e){return this.definitions.get(e)}list(){return Array.from(this.definitions.keys())}}function B(e){if(e.agent&&!0!==e.jsonSerializable)throw j.DF0019({name:e.name})}function H(){let e={};function t(n,...r){let i=e[n]||[];for(let e=0,t=i.length;e<t;e++){let t=i[e];t&&t(...r)}}function n(t,n){return(e[t]||=[]).push(n),()=>{e[t]=e[t]?.filter(e=>n!==e)}}return{_listeners:e,emit:t,emitOnce:function(n,...r){t(n,...r),delete e[n]},on:n,once:function(e,t){let r=n(e,(...e)=>(r(),t(...e)));return r}}}let U=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,F=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,G=/^([/\\]\s*){2,}[^/\\]/,W=/\/$|\/\?|\/#/,q=/^\.?\//;function V(e,t){var n;if(!(n=t)||"/"===n||function(e,t={}){return("boolean"==typeof t&&(t={acceptRelative:t}),t.strict)?U.test(e):F.test(e)||!!t.acceptRelative&&G.test(e)}(e))return e;let r=function(e=""){return(!function(e=""){return e.endsWith("/")}(e)?e:e.slice(0,-1))||"/"}(t);if(e.startsWith(r)){let t=e[r.length];if(!t||"/"===t||"?"===t)return e}return function(e,...t){let n=e||"";for(let e of t.filter(e=>e&&"/"!==e))if(n){let t=e.replace(q,"");n=function(e=""){return e.endsWith("/")?e:e+"/"}(n)+t}else n=e;return n}(r,e)}async function X(e,t={}){let n=function(e=x){let t=function(e=x){try{return new URLSearchParams(globalThis.location?.search).get(e)||void 0}catch{return}}(e);return t&&function(e){try{let t=new URL(globalThis.location.href);if(!t.searchParams.has(e))return;t.searchParams.delete(e),globalThis.history?.replaceState(globalThis.history.state,"",t.href)}catch{}}(e),t}(t.param??x);return!!n&&(!!e.isTrusted||e.requestTrustWithCode(n))}Symbol.for("ufo:protocolRelative");var K=Symbol.for("immer-nothing"),Y=Symbol.for("immer-draftable"),J=Symbol.for("immer-state");function Q(e){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Z=Object,ee=Z.getPrototypeOf,et="constructor",en="prototype",er="configurable",ei="enumerable",eo="writable",ea="value",es=e=>!!e&&!!e[J];function el(e){return!!e&&(ec(e)||eb(e)||!!e[Y]||!!e[et]?.[Y]||ev(e)||ey(e))}var ed=Z[en][et].toString(),eu=new WeakMap;function ec(e){if(!e||!ew(e))return!1;let t=ee(e);if(null===t||t===Z[en])return!0;let n=Z.hasOwnProperty.call(t,et)&&t[et];if(n===Object)return!0;if(!ex(n))return!1;let r=eu.get(n);return void 0===r&&(r=Function.toString.call(n),eu.set(n,r)),r===ed}function eh(e,t,n=!0){0===ef(e)?(n?Reflect.ownKeys(e):Z.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function ef(e){let t=e[J];return t?t.type_:eb(e)?1:ev(e)?2:3*!!ey(e)}var ep=(e,t,n=ef(e))=>2===n?e.has(t):Z[en].hasOwnProperty.call(e,t),em=(e,t,n=ef(e))=>2===n?e.get(t):e[t],eg=(e,t,n,r=ef(e))=>{2===r?e.set(t,n):3===r?e.add(n):e[t]=n},eb=Array.isArray,ev=e=>e instanceof Map,ey=e=>e instanceof Set,ew=e=>"object"==typeof e,ex=e=>"function"==typeof e,ek=e=>e.modified_?e.copy_:e.base_;function eS(e,t){if(ev(e))return new Map(e);if(ey(e))return new Set(e);if(eb(e))return Array[en].slice.call(e);let n=ec(e);if(!0!==t&&("class_only"!==t||n)){let t=ee(e);if(null!==t&&n)return{...e};let r=Z.create(t);return Z.assign(r,e)}{let t=Z.getOwnPropertyDescriptors(e);delete t[J];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],o=t[i];!1===o[eo]&&(o[eo]=!0,o[er]=!0),(o.get||o.set)&&(t[i]={[er]:!0,[eo]:!0,[ei]:o[ei],[ea]:e[i]})}return Z.create(ee(e),t)}}function eC(e,t=!1){return eE(e)||es(e)||!el(e)||(ef(e)>1&&Z.defineProperties(e,{set:eA,add:eA,clear:eA,delete:eA}),Z.freeze(e),t&&eh(e,(e,t)=>{eC(t,!0)},!1)),e}var eA={[ea]:function(){Q(2)}};function eE(e){return!(null!==e&&ew(e))||Z.isFrozen(e)}var eL="MapSet",e_="Patches",eN="ArrayMethods",eT={};function eR(e){let t=eT[e];return t||Q(0,e),t}var eM=e=>!!eT[e];function eP(e,t){t&&(e.patchPlugin_=eR(e_),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function eI(e){eD(e),e.drafts_.forEach(e$),e.drafts_=null}function eD(e){e===p&&(p=e.parent_)}var ej=e=>p={drafts_:[],parent_:p,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:eM(eL)?eR(eL):void 0,arrayMethodsPlugin_:eM(eN)?eR(eN):void 0};function e$(e){let t=e[J];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function eO(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(void 0!==e&&e!==n){n[J].modified_&&(eI(t),Q(4)),el(e)&&(e=ez(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[J].base_,e,t)}else e=ez(t,n);return function(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&eC(t,n)}(t,e,!0),eI(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==K?e:void 0}function ez(e,t){if(eE(t))return t;let n=t[J];if(!n)return eW(t,e.handledSet_,e);if(!eH(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);eG(n,e)}return n.copy_}function eB(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var eH=(e,t)=>e.scope_===t,eU=[];function eF(e,t,n,r){let i=e.copy_||e.base_,o=e.type_;if(void 0!==r&&em(i,r,o)===t)return void eg(i,r,n,o);if(!e.draftLocations_){let t=e.draftLocations_=new Map;eh(i,(e,n)=>{if(es(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}for(let r of e.draftLocations_.get(t)??eU)eg(i,r,n,o)}function eG(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||1===e.type_&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}eB(e)}}function eW(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||es(e)||t.has(e)||!el(e)||eE(e)||(t.add(e),eh(e,(r,i)=>{if(es(i)){let t=i[J];eH(t,n)&&(eg(e,r,ek(t),e.type_),eB(t))}else el(i)&&eW(i,t,n)})),e}var eq={get(e,t){let n;if(t===J)return e;if("constructor"===t||"__proto__"===t)return new Proxy((e.copy_||e.base_)[t]||{},{get:(e,t)=>"__proto__"===t||"prototype"===t?Object.freeze(Object.create(null)):Reflect.get(e,t),set:()=>!0,apply:(e,t,n)=>Reflect.apply(e,t,n)});let r=e.scope_.arrayMethodsPlugin_,i=1===e.type_&&"string"==typeof t;if(i&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);let o=e.copy_||e.base_;if(!ep(o,t,e.type_)){var a;let n;return a=e,(n=eK(o,t))?ea in n?n[ea]:n.get?.call(a.draft_):void 0}let s=o[t];if(e.finalized_||!el(s)||i&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&Number.isInteger(n=+t)&&String(n)===t)return s;if(s===eX(e.base_,t)){eJ(e);let n=1===e.type_?+t:t,r=eQ(e.scope_,s,e,n);return e.copy_[n]=r}return s},has:(e,t)=>"constructor"!==t&&"__proto__"!==t&&"prototype"!==t&&t in(e.copy_||e.base_),ownKeys:e=>Reflect.ownKeys(e.copy_||e.base_),set(e,t,n){if("constructor"===t||"__proto__"===t||"prototype"===t)return!0;let r=eK(e.copy_||e.base_,t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=eX(e.copy_||e.base_,t),i=r?.[J];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if((n===r?0!==n||1/n==1/r:n!=n&&r!=r)&&(void 0!==n||ep(e.base_,t,e.type_)))return!0;eJ(e),eY(e)}return!!(e.copy_[t]===n&&(void 0!==n||ep(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t]))||(e.copy_[t]=n,e.assigned_.set(t,!0),!function(e,t,n){let{scope_:r}=e;if(es(n)){let i=n[J];eH(i,r)&&i.callbacks_.push(function(){eJ(e),eF(e,n,ek(i),t)})}else el(n)&&e.callbacks_.push(function(){let i=e.copy_||e.base_;3===e.type_?i.has(n)&&eW(n,r.handledSet_,r):em(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&eW(em(e.copy_,t,e.type_),r.handledSet_,r)})}(e,t,n),!0)},deleteProperty:(e,t)=>(eJ(e),void 0!==eX(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),eY(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){let n=e.copy_||e.base_,r=Reflect.getOwnPropertyDescriptor(n,t);return r?{[eo]:!0,[er]:1!==e.type_||"length"!==t,[ei]:r[ei],[ea]:n[t]}:r},defineProperty(){Q(11)},getPrototypeOf:e=>ee(e.base_),setPrototypeOf(){Q(12)}},eV={};for(let e in eq){let t=eq[e];eV[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}function eX(e,t){let n=e[J];return(n?n.copy_||n.base_:e)[t]}function eK(e,t){if(!(t in e))return;let n=ee(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=ee(n)}}function eY(e){!e.modified_&&(e.modified_=!0,e.parent_&&eY(e.parent_))}function eJ(e){e.copy_||(e.assigned_=new Map,e.copy_=eS(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function eQ(e,t,n,r){let[i,o]=ev(t)?eR(eL).proxyMap_(t,n):ey(t)?eR(eL).proxySet_(t,n):function(e,t){let n=eb(e),r={type_:+!!n,scope_:t?t.scope_:p,modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,o=eq;n&&(i=[r],o=eV);let{revoke:a,proxy:s}=Proxy.revocable(i,o);return r.draft_=s,r.revoke_=a,[s,r]}(t,n);if((n?.scope_??p).drafts_.push(i),o.callbacks_=n?.callbacks_??[],o.key_=r,n&&void 0!==r)n.callbacks_.push(function(e){if(!o||!eH(o,e))return;e.mapSetPlugin_?.fixSetContents(o);let t=ek(o);eF(n,o.draft_??o,t,r),eG(o,e)});else o.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(o);let{patchPlugin_:t}=e;o.modified_&&t&&t.generatePatches_(o,[],e)});return i}eV.deleteProperty=function(e,t){return eV.set.call(this,e,t,void 0)},eV.set=function(e,t,n){return eq.set.call(this,e[0],t,n,e[0])};var eZ=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{let r;if(ex(e)&&!ex(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}if(ex(t)||Q(6),void 0===n||ex(n)||Q(7),el(e)){let i=ej(this),o=eQ(i,e,void 0),a=!0;try{r=t(o),a=!1}finally{a?eI(i):eD(i)}return eP(i,n),eO(r,i)}if(e&&ew(e))Q(1,e);else{if(void 0===(r=t(e))&&(r=e),r===K&&(r=void 0),this.autoFreeze_&&eC(r,!0),n){let t=[],i=[];eR(e_).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}},this.produceWithPatches=(e,t)=>{let n,r;return ex(e)?(t,...n)=>this.produceWithPatches(t,t=>e(t,...n)):[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},(e=>"boolean"==typeof e)(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),(e=>"boolean"==typeof e)(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),(e=>"boolean"==typeof e)(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){var t;el(e)||Q(8),es(e)&&(es(t=e)||Q(10,t),e=function e(t){let n;if(!el(t)||eE(t))return t;let r=t[J],i=!0;if(r){if(!r.modified_)return r.base_;r.finalized_=!0,n=eS(t,r.scope_.immer_.useStrictShallowCopy_),i=r.scope_.immer_.shouldUseStrictIteration()}else n=eS(t,!0);return eh(n,(t,r)=>{eg(n,t,e(r))},i),r&&(r.finalized_=!1),n}(t));let n=ej(this),r=eQ(n,e,void 0);return r[J].isManual_=!0,eD(n),r}finishDraft(e,t){let n=e&&e[J];n&&n.isManual_||Q(9);let{scope_:r}=n;return eP(r,t),eO(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=eR(e_).applyPatches_;return es(e)?r(e,t):this.produce(e,e=>r(e,t))}},e0=eZ.produce,e1=eZ.produceWithPatches.bind(eZ),e2=eZ.applyPatches.bind(eZ);function e8(e=21){let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}function e5(e,t){if(e.add(t),e.size>1e3){let t=e.values().next().value;void 0!==t&&e.delete(t)}}let e6="object"==typeof self?self:globalThis;function e3(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[o,a]=e[i];switch(o){case 0:case -1:return n(a,i);case 1:{let e=n([],i);for(let t of a)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of a)e[r(t)]=r(n);return e}case 3:return n(new Date(a),i);case 4:{let{source:e,flags:t}=a;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of a)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of a)e.add(r(t));return e}case 7:{let{name:e,message:t}=a;return n(new e6[e](t),i)}case 8:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{let{buffer:e}=new Uint8Array(a);return n(new DataView(e),a)}}return n(new e6[o](a),i)})(0)}let{toString:e4}={},{keys:e7}=Object;function e9(e){let t=typeof e;if("object"!==t||!e)return[0,t];let n=e4.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]}function te([e,t]){return 0===e&&("function"===t||"symbol"===t)}let{parse:tt,stringify:tn}=JSON,tr={json:!0,lossy:!0};function ti(e){if(e.error)throw function e(t){var n;let r=t.cause instanceof Error?t.cause:"object"==typeof(n=t.cause)&&null!==n&&"string"==typeof n.message&&"string"==typeof n.name?e(t.cause):t.cause,i=void 0!==r?Error(t.message,{cause:r}):Error(t.message);for(let e of(i.name=t.name,Object.keys(t)))"name"!==e&&"message"!==e&&"cause"!==e&&(i[e]=t[e]);return i}(e.error);return e.output}function to(e){return e.some(e=>null!=e)}async function ta(e){let t=function(e,t){let n=new Map,r=new Map;function i(e,t){var n=null!==e&&"object"==typeof e&&"serialization"in e&&"data"in e?e.data:e;return"structured-clone"===t&&Array.isArray(n)?e3(n):n}async function o(e){n.has(e.path)||n.set(e.path,t(e.path).then(t=>i(t,e.serialization)));let r=await n.get(e.path);return"object"==typeof r&&null!==r&&("output"in r||"error"in r)?ti(r):r}async function a(e,n){return r.has(e)||r.set(e,t(e).then(e=>i(e,n))),await r.get(e)}async function s(t,n){if(!(t in e))throw Error(`[devframe-rpc] Function "${t}" not found in dump store`);let r=e[t];if("object"==typeof r&&null!==r&&"static"===r.type&&"string"==typeof r.path){if(to(n))throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`);return await o(r)}if("object"==typeof r&&null!==r&&"query"===r.type&&"object"==typeof r.records&&null!==r.records){let e=_(n),i=r.records[e];if(i)return ti(await a(i,r.serialization));if(r.fallback)return ti(await a(r.fallback,r.serialization));throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`)}if(!to(n))return r;throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`)}return{call:async(e,t)=>await s(e,t),callOptional:async(t,n)=>{if(t in e)return await s(t,n)},callEvent:async(e,t)=>{}}}(await e.fetchJsonFromBases("__rpc-dump/index.json"),e.fetchJsonFromBases);return{isTrusted:!0,status:"connected",connectionError:null,requestTrust:async()=>!0,requestTrustWithToken:async()=>!0,requestTrustWithCode:async()=>null,ensureTrusted:async()=>!0,call:(...e)=>t.call(e[0],e.slice(1)),callEvent:(...e)=>t.callEvent(e[0],e.slice(1)),callOptional:(...e)=>t.callOptional(e[0],e.slice(1))}}class ts extends Error{name="StreamClosedError"}function tl(e,t){return`${e}\x1f${t}`}let td=Math.random.bind(Math),tu=e=>e,{clearTimeout:tc,setTimeout:th}=globalThis;function tf(e,t,n,r){var i,o;let a=(i=n,o=r,Array.isArray(i)?`[${o}]`:""===o?"<root>":o);return j.DF0020({name:e||"<anonymous>",type:t,path:a})}function tp(){}let tm=new Map,tg="model",tb="name",tv="type",ty="vendor",tw="version",tx="architecture",tk="console",tS="mobile",tC="tablet",tA="smarttv",tE="wearable",tL="embedded",t_="Amazon",tN="Apple",tT="ASUS",tR="BlackBerry",tM="Browser",tP="Chrome",tI="Firefox",tD="Google",tj="Huawei",t$="Microsoft",tO="Motorola",tz="Opera",tB="Samsung",tH="Sharp",tU="Sony",tF="Xiaomi",tG="Zebra",tW="Facebook",tq="Chromium OS",tV="Mac OS";function tX(e){let t={};for(let n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t}function tK(e){return e.toLowerCase()}function tY(e,t){return"string"==typeof e&&tK(t).includes(tK(e))}function tJ(e,t){let n=e.replace(/^\s+/,"");return void 0===t?n:n.substring(0,t)}function tQ(e,t,n){let r=n??{};for(let n=0;n<t.length;n+=2){let i=t[n],o=t[n+1];for(let t=0;t<i.length;t++){let n=i[t];if(!n)break;let a=n.exec(e);if(a){for(let e=0;e<o.length;e++){let t=a[e+1],n=o[e];if(Array.isArray(n)){let e=n[0],i=n.length;if(2===i){let i=n[1];"function"==typeof i?r[e]=i(t,void 0,r):r[e]=i}else if(3===i){let i=n[1],o=n[2];"function"!=typeof i||"exec"in i||"test"in i?r[e]=t?t.replace(i,o):void 0:r[e]=t?i(t,o,r):void 0}else 4===i&&(r[e]=t?n[3](t.replace(n[1],n[2]),void 0,r):void 0)}else r[n]=t||void 0}return r}}}return r}function tZ(e,t){for(let n in t){let r=t[n];if(Array.isArray(r)&&r.length>0){for(let t=0;t<r.length;t++)if(tY(r[t],e))return"?"===n?void 0:n}else if(tY(r,e))return"?"===n?void 0:n}return e}let t0={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},t1={browser:[[/\b(?:crmo|crios)\/([\w.]+)/i],[tw,[tb,"Chrome"]],[/edg(?:e|ios|a)?\/([\w.]+)/i],[tw,[tb,"Edge"]],[/(opera mini)\/([-\w.]+)/i,/(opera [mobileta]{3,6})\b.+version\/([-\w.]+)/i,/(opera)(?:.+version\/|[/ ]+)([\w.]+)/i],[tb,tw],[/opios[/ ]+([\w.]+)/i],[tw,[tb,`${tz} Mini`]],[/\bop(?:rg)?x\/([\w.]+)/i],[tw,[tb,`${tz} GX`]],[/\bopr\/([\w.]+)/i],[tw,[tb,tz]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[/ ]?([\w.]+)/i],[tw,[tb,"Baidu"]],[/(kindle)\/([\w.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[/ ]?([\w.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[/ ]?([\w.]*)/i,/(?:ms|\()(ie) ([\w.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w.]+)/i,/(heytap|ovi)browser\/([\d.]+)/i,/(weibo)__([\d.]+)/i],[tb,tw],[/\bddg\/([\w.]+)/i],[tw,[tb,"DuckDuckGo"]],[/(?:\buc? ?browser|juc.+ucweb)[/ ]?([\w.]+)/i],[tw,[tb,`UC${tM}`]],[/microm.+\bqbcore\/([\w.]+)/i,/\bqbcore\/([\w.]+).+microm/i,/micromessenger\/([\w.]+)/i],[tw,[tb,"WeChat"]],[/konqueror\/([\w.]+)/i],[tw,[tb,"Konqueror"]],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i],[tw,[tb,"IE"]],[/ya(?:search)?browser\/([\w.]+)/i],[tw,[tb,"Yandex"]],[/slbrowser\/([\w.]+)/i],[tw,[tb,`Smart Lenovo ${tM}`]],[/(avast|avg)\/([\w.]+)/i],[[tb,/(.+)/,`$1 Secure ${tM}`],tw],[/\bfocus\/([\w.]+)/i],[tw,[tb,`${tI} Focus`]],[/\bopt\/([\w.]+)/i],[tw,[tb,`${tz} Touch`]],[/coc_coc\w+\/([\w.]+)/i],[tw,[tb,"Coc Coc"]],[/dolfin\/([\w.]+)/i],[tw,[tb,"Dolphin"]],[/coast\/([\w.]+)/i],[tw,[tb,`${tz} Coast`]],[/miuibrowser\/([\w.]+)/i],[tw,[tb,`MIUI ${tM}`]],[/fxios\/([-\w.]+)/i],[tw,[tb,tI]],[/\bqihu|(qi?ho{0,2}|360)browser/i],[[tb,`360 ${tM}`]],[/(oculus|sailfish|huawei|vivo)browser\/([\w.]+)/i],[[tb,/(.+)/,`$1 ${tM}`],tw],[/samsungbrowser\/([\w.]+)/i],[tw,[tb,`${tB} Internet`]],[/(comodo_dragon)\/([\w.]+)/i],[[tb,/_/g," "],tw],[/metasr[/ ]?([\d.]+)/i],[tw,[tb,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d.]+)/i],[[tb,"Sogou Mobile"],tw],[/(electron)\/([\w.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w.]+))/i,/m?(qqbrowser|2345Explorer)[/ ]?([\w.]+)/i],[tb,tw],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[tb],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w.]+);)/i],[[tb,tW],tw],[/(Klarna)\/([\w.]+)/i,/(kakao(?:talk|story))[/ ]([\w.]+)/i,/(naver)\(.*?(\d+\.[\w.]+).*\)/i,/safari (line)\/([\w.]+)/i,/\b(line)\/([\w.]+)\/iab/i,/(alipay)client\/([\w.]+)/i,/(twitter)(?:and| f.+e\/([\w.]+))/i,/(chromium|instagram|snapchat)[/ ]([-\w.]+)/i],[tb,tw],[/\bgsa\/([\w.]+) .*safari\//i],[tw,[tb,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w.]+)/i],[tw,[tb,"TikTok"]],[/headlesschrome(?:\/([\w.]+)| )/i],[tw,[tb,`${tP} Headless`]],[/ wv\).+(chrome)\/([\w.]+)/i],[[tb,`${tP} WebView`],tw],[/droid.+ version\/([\w.]+)\b.+(?:mobile safari|safari)/i],[tw,[tb,`Android ${tM}`]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w.]+)/i],[tb,tw],[/version\/([\w.,]+) .*mobile\/\w+ (safari)/i],[tw,[tb,"Mobile Safari"]],[/version\/([\w(.|,)]+) .*(mobile ?safari|safari)/i],[tw,tb],[/webkit.+?(mobile ?safari|safari)(\/[\w.]+)/i],[tb,[tw,tZ,{"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w.]+)/i],[tb,tw],[/(navigator|netscape\d?)\/([-\w.]+)/i],[[tb,"Netscape"],tw],[/mobile vr; rv:([\w.]+)\).+firefox/i],[tw,[tb,`${tI} Reality`]],[/ekiohf.+(flow)\/([\w.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[/ ]?([\w.+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w.]+)$/i,/(firefox)\/([\w.]+)/i,/(mozilla)\/([\w.]+) .+rv:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[. ]?browser)[-/ ]?v?([\w.]+)/i,/(links) \(([\w.]+)/i,/panasonic;(viera)/i],[tb,tw],[/(cobalt)\/([\w.]+)/i],[tb,[tw,/master.|lts./,""]]],cpu:[[/(amd|x(?:(?:86|64)[-_])?|wow|win)64[;)]/i],[[tx,"amd64"]],[/(ia32(?=;))/i],[[tx,tK]],[/((?:i[346]|x)86)[;)]/i],[[tx,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[tx,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[tx,"armhf"]],[/windows (ce|mobile); ppc;/i],[[tx,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[tx,/ower/,"",tK]],[/(sun4\w)[;)]/i],[[tx,"sparc"]],[/(avr32|ia64(?=;)|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[tx,tK]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[tg,[ty,tB],[tv,tC]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?\d+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[tg,[ty,tB],[tv,tS]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[tg,[ty,tN],[tv,tS]],[/\((ipad);[-\w),; ]+apple/i,/applecoremedia\/[\w.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[tg,[ty,tN],[tv,tC]],[/(macintosh);/i],[tg,[ty,tN]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[tg,[ty,tH],[tv,tS]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[tg,[ty,tj],[tv,tC]],[/(?:huawei|honor)([-\w ]+)[;)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][0-359c][adn]?)\b(?!.+d\/s)/i],[tg,[ty,tj],[tv,tS]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?[\w ]+)(?: bui|\))/i,/oid[^)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?\d?\w?[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[tg,/_/g," "],[ty,tF],[tv,tS]],[/oid[^)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?pad[\w ]+)(?: bui|\))/i],[[tg,/_/g," "],[ty,tF],[tv,tC]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[tg,[ty,"OPPO"],[tv,tS]],[/\b(opd2\d{3}a?) bui/i],[tg,[ty,"OPPO"],[tv,tC]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[tg,[ty,"Vivo"],[tv,tS]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[tg,[ty,"Realme"],[tv,tS]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w() ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[tg,[ty,tO],[tv,tS]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[tg,[ty,tO],[tv,tC]],[/((?=lg)?[vl]k-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[tg,[ty,"LG"],[tv,tC]],[/(lm(?:-?f100[nv]?|-[\w.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?(\w+) bui/i],[tg,[ty,"LG"],[tv,tS]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab[\w ]+|yt[-\w]{6}|tb[-\w]{6})/i],[tg,[ty,"Lenovo"],[tv,tC]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w.]*)/i],[[tg,/_/g," "],[ty,"Nokia"],[tv,tS]],[/(pixel c)\b/i],[tg,[ty,tD],[tv,tC]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[tg,[ty,tD],[tv,tS]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]?\d\.))/i],[tg,[ty,tU],[tv,tS]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[tg,"Xperia Tablet"],[ty,tU],[tv,tC]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[tg,[ty,"OnePlus"],[tv,tS]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[tg,[ty,t_],[tv,tC]],[/((?:sd|kf)[0349hijor-uw]+)( bui|\)).+silk\//i],[[tg,/(.+)/g,"Fire Phone $1"],[ty,t_],[tv,tS]],[/(playbook);[-\w),; ]+(rim)/i],[tg,ty,[tv,tC]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[tg,[ty,tR],[tv,tS]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[tg,[ty,tT],[tv,tC]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[tg,[ty,tT],[tv,tS]],[/(nexus 9)/i],[tg,[ty,"HTC"],[tv,tC]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!;|\.)|sony(?!-bra))[-_ ]?([-\w]*)/i],[ty,[tg,/_/g," "],[tv,tS]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[tg,[ty,"Acer"],[tv,tC]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[tg,[ty,"Meizu"],[tv,tS]],[/; ((?:power )?armor[\w ]{0,8})(?: bui|\))/i],[tg,[ty,"Ulefone"],[tv,tS]],[/(blackberry|benq|palm(?=-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[ty,tg,[tv,tS]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[ty,tg,[tv,tC]],[/(surface duo)/i],[tg,[ty,t$],[tv,tC]],[/droid [\d.]+; (fp\du?)(?: b|\))/i],[tg,[ty,"Fairphone"],[tv,tS]],[/(u304aa)/i],[tg,[ty,"AT&T"],[tv,tS]],[/\bsie-(\w*)/i],[tg,[ty,"Siemens"],[tv,tS]],[/\b(rct\w+) b/i],[tg,[ty,"RCA"],[tv,tC]],[/\b(venue[\d ]{2,7}) b/i],[tg,[ty,"Dell"],[tv,tC]],[/\b(q(?:mv|ta)\w+) b/i],[tg,[ty,"Verizon"],[tv,tC]],[/\b(?:barnes[& ]+noble |bn[rt])([\w+ ]*) b/i],[tg,[ty,"Barnes & Noble"],[tv,tC]],[/\b(tm\d{3}\w+) b/i],[tg,[ty,"NuVision"],[tv,tC]],[/\b(k88) b/i],[tg,[ty,"ZTE"],[tv,tC]],[/\b(nx\d{3}j) b/i],[tg,[ty,"ZTE"],[tv,tS]],[/\b(gen\d{3}) b.+49h/i],[tg,[ty,"Swiss"],[tv,tS]],[/\b(zur\d{3}) b/i],[tg,[ty,"Swiss"],[tv,tC]],[/\b((zeki)?tb.*\b) b/i],[tg,[ty,"Zeki"],[tv,tC]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[ty,"Dragon Touch"],tg,[tv,tC]],[/\b(ns-?\w{0,9}) b/i],[tg,[ty,"Insignia"],[tv,tC]],[/\b((nxa|next)-?\w{0,9}) b/i],[tg,[ty,"NextBook"],[tv,tC]],[/\b(xtreme_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[ty,"Voice"],tg,[tv,tS]],[/\b(lvtel-)?(v1[12]) b/i],[[ty,"LvTel"],tg,[tv,tS]],[/\b(ph-1) /i],[tg,[ty,"Essential"],[tv,tS]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[tg,[ty,"Envizen"],[tv,tC]],[/\b(trio[-\w. ]+) b/i],[tg,[ty,"MachSpeed"],[tv,tC]],[/\btu_(1491) b/i],[tg,[ty,"Rotor"],[tv,tC]],[/(shield[\w ]+) b/i],[tg,[ty,"Nvidia"],[tv,tC]],[/(sprint) (\w+)/i],[ty,tg,[tv,tS]],[/(kin\.[onetw]{3})/i],[[tg,/\./g," "],[ty,t$],[tv,tS]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[tg,[ty,tG],[tv,tC]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[tg,[ty,tG],[tv,tS]],[/smart-tv.+(samsung)/i],[ty,[tv,tA]],[/hbbtv.+maple;(\d+)/i],[[tg,/^/,"SmartTV"],[ty,tB],[tv,tA]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[ty,"LG"],[tv,tA]],[/(apple) ?tv/i],[ty,[tg,`${tN} TV`],[tv,tA]],[/crkey/i],[[tg,`${tP}cast`],[ty,tD],[tv,tA]],[/droid.+aft(\w+)( bui|\))/i],[tg,[ty,t_],[tv,tA]],[/\(dtv[);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[tg,[ty,tH],[tv,tA]],[/(bravia[\w ]+)( bui|\))/i],[tg,[ty,tU],[tv,tA]],[/(mitv-\w{5}) bui/i],[tg,[ty,tF],[tv,tA]],[/Hbbtv.*(technisat) (.*);/i],[ty,tg,[tv,tA]],[/\b(roku)[\dx]*[)/]((?:dvp-)?[\d.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w+ ]*; *(\w[^;]*);([^;]*)/i],[[ty,tJ],[tg,tJ],[tv,tA]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[tv,tA]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[ty,tg,[tv,tk]],[/droid.+; (shield) bui/i],[tg,[ty,"Nvidia"],[tv,tk]],[/(playstation [345portablevi]+)/i],[tg,[ty,tU],[tv,tk]],[/\b(xbox(?: one)?(?!; xbox))[); ]/i],[tg,[ty,t$],[tv,tk]],[/((pebble))app/i],[ty,tg,[tv,tE]],[/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i],[tg,[ty,tN],[tv,tE]],[/droid.+; (glass) \d/i],[tg,[ty,tD],[tv,tE]],[/droid.+; (wt63?0{2,3})\)/i],[tg,[ty,tG],[tv,tE]],[/(quest( \d| pro)?)/i],[tg,[ty,tW],[tv,tE]],[/(tesla)(?: qtcarbrowser|\/[-\w.]+)/i],[ty,[tv,tL]],[/(aeobc)\b/i],[tg,[ty,t_],[tv,tL]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[tg,[tv,tS]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[tg,[tv,tC]],[/\b((tablet|tab)[;/]|focus\/\d(?!.+mobile))/i],[[tv,tC]],[/(phone|mobile(?:[;/]| [ \w/.]*safari)|pda(?=.+windows ce))/i],[[tv,tS]],[/(android[-\w. ]{0,9});.+buil/i],[tg,[ty,"Generic"]]],engine:[[/windows.+ edge\/([\w.]+)/i],[tw,[tb,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i],[tw,[tb,"Blink"]],[/(presto)\/([\w.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w.]+)/i,/ekioh(flow)\/([\w.]+)/i,/(khtml|tasman|links)[/ ]\(?([\w.]+)/i,/(icab)[/ ]([23]\.[\d.]+)/i,/\b(libweb)/i],[tb,tw],[/rv:([\w.]{1,9})\b.+(gecko)/i],[tw,tb]],os:[[/microsoft (windows) (vista|xp)/i],[tb,tw],[/(windows (?:phone(?: os)?|mobile))[/ ]?([.\w ]*)/i],[tb,[tw,tZ,t0]],[/windows nt 6\.2; (arm)/i,/windows[/ ]?([ntce\d. ]+\w)(?!.+xbox)/i,/(?:win(?=[39n])|win 9x )([nt\d.]+)/i],[[tw,tZ,t0],[tb,"Windows"]],[/ip[honead]{2,4}\b(?:.*os (\w+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[/ ])([\d.]+)/i,/cfnetwork\/.+darwin/i],[[tw,/_/g,"."],[tb,"iOS"]],[/(mac os x) ?([\w. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[tb,tV],[tw,/_/g,"."]],[/droid ([\w.]+)\b.+(android[- ]x86|harmonyos)/i],[tw,tb],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-/ ]?([\w.]*)/i,/(blackberry)\w*\/([\w.]*)/i,/(tizen|kaios)[/ ]([\w.]+)/i,/\((series40);/i],[tb,tw],[/\(bb(10);/i],[tw,[tb,tR]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-/ ]?([\w.]*)/i],[tw,[tb,"Symbian"]],[/mozilla\/[\d.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w.]+)/i],[tw,[tb,`${tI} OS`]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w.]+)/i],[tw,[tb,"webOS"]],[/watch(?: ?os[,/]|\d,\d\/)([\d.]+)/i],[tw,[tb,"watchOS"]],[/crkey\/([\d.]+)/i],[tw,[tb,`${tP}cast`]],[/(cros) \w+(?:\)| ([\w.]+)\b)/i],[[tb,tq],tw],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w.]*)/i,/(mint)[/() ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-/ ]?(?!chrom|package)([-\w.]*)/i,/(hurd|linux) ?([\w.]*)/i,/(gnu) ?([\w.]*)/i,/\b([-e-hrntopcs]{0,5}bsd|dragonfly)[/ ]?(?!amd|[ix346]{1,2}86)([\w.]*)/i,/(haiku) (\w+)/i],[tb,tw],[/(sunos) ?([\w.]*)/i],[[tb,"Solaris"],tw],[/((?:open)?solaris)[-/ ]?([\w.]*)/i,/(aix) ((\d)(?=[.) ])[\w.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w.]*)/i],[tb,tw]]};function t2(e){return"object"==typeof e&&null!==e}function t8(){if("u">typeof window&&window.navigator)return window.navigator}function t5(e){return e.length>500?tJ(e,500):e}Object.freeze(tX([tb,tw,"major"])),Object.freeze(tX([tx])),Object.freeze(tX([tg,ty,tv,tk,tS,tA,tC,tE,tL])),Object.freeze(tX([tb,tw])),Object.freeze(tX([tb,tw]));class t6 extends Error{name="DevframeConnectionError";kind;constructor(e,t,n){super(t,n),this.kind=e}}function t3(e){return e.includes(":")}function t4(e,t){return t3(t)?t:`${e}:${t}`}function t7(e,t,n){let r,i=`devframe:settings:${n}:${t}`;function o(){return r||(r=e.sharedState.get(i,{initialValue:{}})),r}return{get:async e=>(await o()).value()[e],async set(e,t){(await o()).mutate(n=>{n[e]=t})},async delete(e){(await o()).mutate(t=>{delete t[e]})},all:async()=>(await o()).value(),onChange:async e=>(await o()).on("updated",t=>e(t))}}let t9="__DEVFRAME_CONNECTION_META__",ne="__DEVFRAME_CONNECTION_AUTH_TOKEN__";function nt(e){try{localStorage.setItem(ne,e)}catch{}globalThis[ne]=e}async function nn(e={}){let t,n,r,{baseURL:i="./",rpcOptions:o={},cacheOptions:a=!1}=e,s=H(),l=Array.isArray(i)?i:[i],d=e.connectionMeta||function(){for(let e of[()=>window?.[t9],()=>globalThis?.[t9],()=>parent.window?.[t9]])try{let t=e();if(t)return t}catch{}}(),u=l[0]??"./",c=e.connectionMeta?void 0:d?.baseUrl;function h(){if(c)return c;let e=V(w,u);try{return new URL(e,globalThis.location?.href).href}catch{return e}}if(!d){let e=[];for(let t of l)try{d=await fetch(V(w,t)).then(e=>e.json()),u=t,globalThis[t9]={...d,baseUrl:h()};break}catch(t){e.push(t)}if(!d)throw Error(`Failed to get connection meta from ${l.join(", ")}`,{cause:e})}let f=new N({functions:[],..."object"==typeof e.cacheOptions?e.cacheOptions:{}}),p={rpc:void 0},m=function(e){for(let t of[()=>e,()=>localStorage.getItem(ne)??void 0,()=>window?.[ne],()=>globalThis?.[ne],()=>parent.window?.[ne]])try{let e=t();if(e)return e}catch{}}(e.authToken);m&&nt(m);let g=new z(p);async function b(e){let t=[u,...l.filter(e=>e!==u)].filter(e=>null!=e),n=[];for(let r of t)try{return await fetch(V(e,r)).then(t=>{if(!t.ok)throw Error(`Failed to fetch ${e} from ${r}: ${t.status}`);return t.json()})}catch(e){n.push(e)}throw Error(`Failed to load ${e} from ${t.join(", ")}`,{cause:n})}let v="static"===d.backend?await ta({fetchJsonFromBases:b}):function(e){let t,n,{authToken:r,connectionMeta:i,metaBaseUrl:o,events:a,clientRpc:s,rpcOptions:l={},wsOptions:d={},callTimeout:u=0}=e,c=!1,h="connecting",f=null,p={promise:new Promise((e,r)=>{t=e,n=r}),resolve:t,reject:n},m=function(e,t,n){let r="https:"===n.protocol?"wss:":"ws:",i=(()=>{try{return new URL(t,n.href)}catch{return new URL(n.href)}})();if(e&&"object"==typeof e){if(null!=e.host||null!=e.port){let t=e.host??`${n.hostname}:${e.port}`,i=new URL(e.path??"/",`${r}//${t}`);return i.protocol=r,i.href}let t=new URL(e.path??"",i);return t.protocol=r,t.href}if("number"==typeof e)return`${r}//${n.hostname}:${e}`;let o=e??"";if(/^wss?:\/\//i.test(o))return o;if(/^https?:\/\//i.test(o)){var a;let e;return a=/^https/i.test(o)?"wss://":"ws://",((e=o.match(F))||(e=o.match(/^\/{2,}/)),e)?a+o.slice(e[0].length):a+o}let s=new URL(o,i);return s.protocol=r,s.href}(i.websocket,o??"./",location);function g(e,t=null){if(t?f=t:"connected"===e&&(f=null),e===h)return;let n=h;h=e,a.emit("connection:status",e,n)}let b=new Set;function v(e){for(let t of[...b])t.reject(e)}function y(){return"disconnected"===h||"error"===h?new t6("connection","[devframe] Not connected to the devframe server",{cause:f??void 0}):"unauthorized"===h?new t6("auth","[devframe] Not authorized by the devframe server",{cause:f??void 0}):null}function w(e,t){return new Promise((n,r)=>{let i,o=!1,s={reject(e){o||(l(),a.emit("rpc:error",e,t),r(e))}};function l(){o=!0,b.delete(s),i&&clearTimeout(i)}b.add(s),u>0&&(i=setTimeout(()=>{s.reject(new t6("timeout",`[devframe] RPC call "${t}" timed out after ${u}ms`))},u)),e.then(e=>{o||(l(),n(e))},e=>{if(o)return;l();let n=e instanceof Error?e:Error(String(e));a.emit("rpc:error",n,t),r(n)})})}let x=new Map;for(let e of i.jsonSerializableMethods??[])x.set(e,{jsonSerializable:!0});let k=function(e,t){let{channel:n,rpcOptions:r={}}=t;return function(e,t){let n,r,{post:i,on:o,off:a=()=>{},eventNames:s=[],serialize:l=tu,deserialize:d=tu,resolver:u,bind:c="rpc",timeout:h=6e4,proxify:f=!0}=t,p=!1,m=new Map;async function g(e,o,a,s){let d,u,c;if(p)throw Error(`[birpc] rpc is closed, cannot call "${e}"`);let f={m:e,a:o,t:"q"};s&&(f.o=!0);let g=async e=>i(l(e));if(a)return void await g(f);if(n)try{await n}finally{n=void 0}let{promise:b,resolve:v,reject:y}={promise:new Promise((e,t)=>{u=e,c=t}),resolve:u,reject:c},w=function(e=21){let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*td()|0];return t}();async function x(n=f){return h>=0&&"object"==typeof(d=th(()=>{try{if(t.onTimeoutError?.call(r,e,o)!==!0)throw Error(`[birpc] timeout on calling "${e}"`)}catch(e){y(e)}m.delete(w)},h))&&(d=d.unref?.()),m.set(w,{resolve:v,reject:y,timeoutId:d,method:e}),await g(n),b}f.i=w;try{t.onRequest?await t.onRequest.call(r,f,x,v):await x()}catch(e){if(t.onGeneralError?.call(r,e)!==!0)throw e;return}finally{tc(d),m.delete(w)}return b}let b={$call:(e,...t)=>g(e,t,!1),$callOptional:(e,...t)=>g(e,t,!1,!0),$callEvent:(e,...t)=>g(e,t,!0),$callRaw:e=>g(e.method,e.args,e.event,e.optional),$rejectPendingCalls:function(e){let t=Array.from(m.values()).map(({method:t,reject:n})=>e?e({method:t,reject:n}):n(Error(`[birpc]: rejected pending call "${t}".`)));return m.clear(),t},get $closed(){return p},get $meta(){return t.meta},$close:function(e){p=!0,m.forEach(({reject:t,method:n})=>{let r=Error(`[birpc] rpc is closed, cannot call "${n}"`);if(e)return e.cause??=r,t(e);t(r)}),m.clear(),a(v)},$functions:e};async function v(n,...o){let a;try{a=d(n)}catch(e){if(t.onGeneralError?.call(r,e)!==!0)throw e;return}if("q"===a.t){let n,s,{m:d,a:h,o:f}=a,p=await (u?u.call(r,d,e[d]):e[d]);if(f&&(p||=()=>void 0),p)try{n=await p.apply("rpc"===c?r:e,h)}catch(e){s=e}else s=Error(`[birpc] function "${d}" not found`);if(a.i){if(s&&t.onFunctionError&&!0===t.onFunctionError.call(r,s,d,h))return;if(!s)try{await i(l({t:"s",i:a.i,r:n}),...o);return}catch(e){if(s=e,t.onGeneralError?.call(r,e,d,h)!==!0)throw e}try{await i(l({t:"s",i:a.i,e:s}),...o)}catch(e){if(t.onGeneralError?.call(r,e,d,h)!==!0)throw e}}}else{let{i:e,r:t,e:n}=a,r=m.get(e);r&&(tc(r.timeoutId),n?r.reject(n):r.resolve(t)),m.delete(e)}}return r=f?new Proxy({},{get(t,n){if(Object.prototype.hasOwnProperty.call(b,n))return b[n];if("then"===n&&!s.includes("then")&&!("then"in e))return;let r=(...e)=>g(n,e,!0);if(s.includes(n))return r.asEvent=r,r;let i=(...e)=>g(n,e,!1);return i.asEvent=r,i}}):b,n=o(v),r}(e,{...n,timeout:-1,...r,proxify:!1})}(s.functions,{channel:function(e){let t=e.url;e.authToken&&(t=`${t}?devframe_auth_token=${encodeURIComponent(e.authToken)}`);let n=new WebSocket(t),{onConnected:r=tp,onError:i=tp,onDisconnected:o=tp,definitions:a=tm}=e;n.addEventListener("open",e=>{r(e)}),n.addEventListener("error",e=>{i(e instanceof Error?e:Error(e.type))}),n.addEventListener("close",e=>{o(e)});let s=new Map;return{on:e=>{n.addEventListener("message",t=>{e(t.data)})},post:e=>{if(n.readyState===WebSocket.OPEN)return void n.send(e);if(n.readyState===WebSocket.CONNECTING){let r=()=>{t(),n.readyState===WebSocket.OPEN&&n.send(e)},i=()=>t();function t(){n.removeEventListener("open",r),n.removeEventListener("close",i)}n.addEventListener("open",r),n.addEventListener("close",i);return}i(Error("Devframe WebSocket is not open; message dropped"))},serialize:e=>{let t;return("q"===e.t?t=e.m:(t=s.get(e.i),s.delete(e.i)),!("s"===e.t&&"e"in e)&&t&&a.get(t)?.jsonSerializable===!0)?function(e,t=""){return JSON.stringify(e,function(e,n){let r=null!=this?this[e]:n;if(void 0===r){if(Array.isArray(this))throw tf(t,"undefined",this,e);return n}if(null===r)return n;if("bigint"==typeof r)throw tf(t,"BigInt",this,e);if("object"==typeof r){if(r instanceof Map)throw tf(t,"Map",this,e);if(r instanceof Set)throw tf(t,"Set",this,e);if(r instanceof Date)throw tf(t,"Date",this,e);if(Array.isArray(r))return n;let i=Object.getPrototypeOf(r);if(null!==i&&i!==Object.prototype)throw tf(t,r.constructor?.name??"class instance",this,e)}return n})}(e,t??""):`s:${tn(function(e,t={}){var n,r,i;let o,a,s=[];return(n=!(t.json||t.lossy),r=!!t.json,i=new Map,o=(e,t)=>{let n=s.push(e)-1;return i.set(t,n),n},a=e=>{if(i.has(e))return i.get(e);let[t,s]=e9(e);switch(t){case 0:{let r=e;switch(s){case"bigint":t=8,r=e.toString();break;case"function":case"symbol":if(n)throw TypeError(`unable to serialize ${s}`);r=null;break;case"undefined":return o([-1],e)}return o([t,r],e)}case 1:{if(s){let t=e;return"DataView"===s?t=new Uint8Array(e.buffer):"ArrayBuffer"===s&&(t=new Uint8Array(e)),o([s,[...t]],e)}let n=[],r=o([t,n],e);for(let t of e)n.push(a(t));return r}case 2:{if(s)switch(s){case"BigInt":return o([s,e.toString()],e);case"Boolean":case"Number":case"String":return o([s,e.valueOf()],e)}if(r&&"toJSON"in e)return a(e.toJSON());let i=[],l=o([t,i],e);for(let t of e7(e))(n||!te(e9(e[t])))&&i.push([a(t),a(e[t])]);return l}case 3:return o([t,e.toISOString()],e);case 4:{let{source:n,flags:r}=e;return o([t,{source:n,flags:r}],e)}case 5:{let r=[],i=o([t,r],e);for(let[t,i]of e)(n||!(te(e9(t))||te(e9(i))))&&r.push([a(t),a(i)]);return i}case 6:{let r=[],i=o([t,r],e);for(let t of e)(n||!te(e9(t)))&&r.push(a(t));return i}}let{message:l}=e;return o([t,{name:s,message:l}],e)})(e),s}(e,tr))}`},deserialize:e=>{let t=e.startsWith("s:")?e3(tt(e.slice(2))):JSON.parse(e);return"q"===t.t&&t.i&&t.m&&s.set(t.i,t.m),t}}}({url:m,authToken:r,definitions:x,...d,onConnected(e){d.onConnected?.(e)},onError(e){g("error",e),a.emit("connection:error",e),v(new t6("connection","[devframe] Connection to the devframe server failed",{cause:e})),d.onError?.(e)},onDisconnected(e){"error"!==h&&g("disconnected"),v(new t6("connection","[devframe] Disconnected from the devframe server",{cause:f??void 0})),d.onDisconnected?.(e)}}),rpcOptions:l});s.register({name:"devframe:auth:revoked",type:"event",handler:()=>{c=!1;let e=new t6("auth","[devframe] The devframe server revoked this client's trust");g("unauthorized",e),a.emit("connection:error",e),v(e),a.emit("rpc:is-trusted:updated",!1)}});let S=r;function C(){var e;let t,n,r,i,o,a,s,l=(e=navigator.userAgent,s=()=>t||=function(e,t){if(!t&&!t2(e)){if("string"==typeof e)return{ua:t5(e),isSelfNavigator:!1,navigator:void 0,userAgentData:void 0,regexMap:t1};let t=t8(),n=t5(t&&t.userAgent?t.userAgent:"");return{ua:n,isSelfNavigator:!!(t&&t.userAgent===n),navigator:t,userAgentData:t?.userAgentData,regexMap:t1}}let n=t8(),r=t2(e)?void 0:e,i=t2(e)?e:t,o=t5(r||(n&&n.userAgent?n.userAgent:"")),a=n?.userAgentData;return{ua:o,isSelfNavigator:!!(n&&n.userAgent===o),navigator:n,userAgentData:a,regexMap:i?function(e,t={}){let n={};for(let r of Object.keys(e)){let i=t[r];i&&i.length%2==0?n[r]=[...i,...e[r]]:n[r]=e[r]}return n}(t1,i):t1}}(e,void 0),{get ua(){return s().ua},get browser(){var d,u;let e;return n||=(d=s(),e={name:void 0,version:void 0,major:void 0},tQ(d.ua,d.regexMap.browser,e),e.major="string"==typeof(u=e.version)?u.replace(/[^\d.]/g,"").split(".")[0]:void 0,d.isSelfNavigator&&d.navigator?.brave&&"function"==typeof d.navigator.brave.isBrave&&(e.name="Brave"),e)},get engine(){var c;let e;return r||=(c=s(),e={name:void 0,version:void 0},tQ(c.ua,c.regexMap.engine,e),e)},get os(){var h;let e;return i||=(h=s(),e={name:void 0,version:void 0},tQ(h.ua,h.regexMap.os,e),h.isSelfNavigator&&!e.name&&h.userAgentData?.platform&&"Unknown"!==h.userAgentData.platform&&(e.name=h.userAgentData.platform.replace(/chrome os/i,tq).replace(/macos/i,tV)),e)},get device(){var f;let e;return o||=(f=s(),e={vendor:void 0,model:void 0,type:void 0},tQ(f.ua,f.regexMap.device,e),f.isSelfNavigator&&!e.type&&f.userAgentData?.mobile&&(e.type=tS),f.isSelfNavigator&&"Macintosh"===e.model&&f.navigator&&void 0!==f.navigator.standalone&&f.navigator.maxTouchPoints&&f.navigator.maxTouchPoints>2&&(e.model="iPad",e.type=tC),e)},get cpu(){var p;let e;return a||=(p=s(),e={architecture:void 0},tQ(p.ua,p.regexMap.cpu,e),e)}});return[l.browser.name,l.browser.version,"|",l.os.name,l.os.version,l.device.type].filter(e=>e).join(" ")}async function A(e){S=e;let t=await k.$call("anonymous:devframe:auth",{authToken:e,ua:C(),origin:location.origin});if(c=t.isTrusted)p.resolve(!0),g("connected");else{let e=new t6("auth","[devframe] The devframe server refused this client's credentials");g("unauthorized",e),a.emit("connection:error",e)}return a.emit("rpc:is-trusted:updated",c),t.isTrusted}return{get isTrusted(){return c},get status(){return h},get connectionError(){return f},requestTrust:async function(){return!!c||A(S??"")},requestTrustWithToken:A,requestTrustWithCode:async function(e){let t=await k.$call("anonymous:devframe:auth:exchange",{code:e,ua:C(),origin:location.origin}),n=t?.authToken??null;return n&&(S=n,c=!0,p.resolve(!0),g("connected"),a.emit("rpc:is-trusted:updated",!0)),n},ensureTrusted:async function(e=6e4){if(c&&p.resolve(!0),e<=0)return p.promise;let t=()=>{};return await Promise.race([p.promise.then(t),new Promise((n,r)=>{let i=setTimeout(()=>{r(Error("[devframe] Timeout waiting for rpc to be trusted"))},e);t=()=>clearTimeout(i)})]),c},call:(...e)=>{let t=String(e[0]),n=y();return n?(a.emit("rpc:error",n,t),Promise.reject(n)):w(k.$call(...e),t)},callEvent:(...e)=>{let t=y();return t?void a.emit("rpc:error",t,String(e[0])):k.$callEvent(...e)},callOptional:(...e)=>{let t=String(e[0]),n=y();return n?(a.emit("rpc:error",n,t),Promise.reject(n)):w(k.$callOptional(...e),t)}}}({authToken:m,connectionMeta:d,metaBaseUrl:h(),events:s,clientRpc:g,callTimeout:e.callTimeout,rpcOptions:{...o,async onRequest(e,t,n){if(await o.onRequest?.call(this,e,t,n),a&&f?.validate(e.m)){if(f.has(e.m,e.a))return n(f.cached(e.m,e.a));let r=await t(e);f.apply(e,r)}else await t(e)}},wsOptions:e.wsOptions});try{t=new BroadcastChannel("devframe-auth")}catch{}let y={events:s,get isTrusted(){return v.isTrusted},get status(){return v.status},get connectionError(){return v.connectionError},connectionMeta:d,ensureTrusted:v.ensureTrusted,requestTrust:v.requestTrust,requestTrustWithToken:async e=>(nt(e),v.requestTrustWithToken(e)),requestTrustWithCode:async e=>{let n=await v.requestTrustWithCode(e);if(!n)return!1;nt(n);try{t?.postMessage({type:"auth-update",authToken:n})}catch{}return!0},call:v.call,callEvent:v.callEvent,callOptional:v.callOptional,client:g,sharedState:void 0,streaming:void 0,cacheManager:f,scope:void 0};y.sharedState=function(e){let t=new Map,n=new Map,r=new Set,i="static"===e.connectionMeta.backend;function o(e,t){let r=n.get(e);return!r||"object"!=typeof r||Array.isArray(r)||"object"!=typeof t||Array.isArray(t)?t:{...r,...t}}function a(t,n){let r=[];return r.push(n.on("updated",(n,r,o)=>{i||(r?e.callEvent("devframe:rpc:server-state:patch",t,r,o):e.callEvent("devframe:rpc:server-state:set",t,n,o))})),()=>{for(let e of r)e()}}return e.client.register({name:"devframe:rpc:client-state:updated",type:"event",handler:(e,n,r)=>{let i=t.get(e);!i||i.syncIds.has(r)||i.mutate(()=>o(e,n),r)}}),e.client.register({name:"devframe:rpc:client-state:patch",type:"event",handler:(e,n,r)=>{let i=t.get(e);!i||i.syncIds.has(r)||i.patch(n,r)}}),{keys:()=>Array.from(t.keys()),onKeyAdded:e=>(r.add(e),()=>{r.delete(e)}),get:async(s,l)=>{if(l?.initialValue!==void 0&&n.set(s,l.initialValue),t.has(s))return t.get(s);let d=function(e){let{enablePatches:t=!1}=e,n=H(),r=e.initialValue,i=new Set;return{on:n.on,value:()=>r,patch:(e,t=e8())=>{i.has(t)||(!function(){let e="replace",t="remove";function n(e){if(!el(e))return e;if(eb(e))return e.map(n);if(ev(e))return new Map(Array.from(e.entries()).map(([e,t])=>[e,n(t)]));if(ey(e))return new Set(Array.from(e).map(n));let t=Object.create(ee(e));for(let r in e)t[r]=n(e[r]);return ep(e,Y)&&(t[Y]=e[Y]),t}function r(e){return es(e)?n(e):e}eT[e_]||(eT[e_]={applyPatches_:function(r,i){return i.forEach(i=>{let{path:o,op:a}=i,s=r;for(let e=0;e<o.length-1;e++){let t=ef(s),n=o[e];"string"!=typeof n&&"number"!=typeof n&&(n=""+n),(0===t||1===t)&&("__proto__"===n||n===et)&&Q(19),ex(s)&&n===en&&Q(19),ew(s=em(s,n))||Q(18,o.join("/"))}let l=ef(s),d=n(i.value),u=o[o.length-1];switch(a){case e:switch(l){case 2:return s.set(u,d);case 3:Q(16);default:return s[u]=d}case"add":switch(l){case 1:return"-"===u?s.push(d):s.splice(u,0,d);case 2:return s.set(u,d);case 3:return s.add(d);default:return s[u]=d}case t:switch(l){case 1:return s.splice(u,1);case 2:return s.delete(u);case 3:return s.delete(i.value);default:return delete s[u]}default:Q(17,a)}}),r},generatePatches_:function(n,i,o){if(n.scope_.processedForPatches_.has(n))return;n.scope_.processedForPatches_.add(n);let{patches_:a,inversePatches_:s}=o;switch(n.type_){case 0:case 2:return function(n,i,o,a){let{base_:s,copy_:l,type_:d}=n;eh(n.assigned_,(n,u)=>{let c=em(s,n,d),h=em(l,n,d),f=u?ep(s,n)?e:"add":t;if(c===h&&f===e)return;let p=i.concat(n);o.push(f===t?{op:f,path:p}:{op:f,path:p,value:r(h)}),a.push("add"===f?{op:t,path:p}:f===t?{op:"add",path:p,value:r(c)}:{op:e,path:p,value:r(c)})})}(n,i,a,s);case 1:return function(n,i,o,a){let{base_:s,assigned_:l}=n,d=n.copy_;d.length<s.length&&([s,d]=[d,s],[o,a]=[a,o]);let u=!0===n.allIndicesReassigned_;for(let t=0;t<s.length;t++){let n=d[t],c=s[t];if((u||l?.get(t.toString()))&&n!==c){let s=n?.[J];if(s&&s.modified_)continue;let l=i.concat([t]);o.push({op:e,path:l,value:r(n)}),a.push({op:e,path:l,value:r(c)})}}for(let e=s.length;e<d.length;e++){let t=i.concat([e]);o.push({op:"add",path:t,value:r(d[e])})}for(let e=d.length-1;s.length<=e;--e){let n=i.concat([e]);a.push({op:t,path:n})}}(n,i,a,s);case 3:return function(e,n,r,i){let{base_:o,copy_:a}=e,s=0;o.forEach(e=>{if(!a.has(e)){let o=n.concat([s]);r.push({op:t,path:o,value:e}),i.unshift({op:"add",path:o,value:e})}s++}),s=0,a.forEach(e=>{if(!o.has(e)){let o=n.concat([s]);r.push({op:"add",path:o,value:e}),i.unshift({op:t,path:o,value:e})}s++})}(n,i,a,s)}},generateReplacementPatches_:function(t,n,r){let{patches_:i,inversePatches_:o}=r;i.push({op:e,path:[],value:n===K?void 0:n}),o.push({op:e,path:[],value:t})},getPath:function e(t,n=[]){if(void 0!==t.key_){var r;let e,i=t.parent_.copy_??t.parent_.base_,o=ew(r=em(i,t.key_))?r?.[J]:null,a=em(i,t.key_);if(void 0===a||a!==t.draft_&&a!==t.base_&&a!==t.copy_||null!=o&&o.base_!==t.base_)return null;let s=3===t.parent_.type_;if(e=s?Array.from(t.parent_.drafts_.keys()).indexOf(t.key_):t.key_,!(s&&i.size>e||ep(i,e)))return null;n.push(e)}if(t.parent_)return e(t.parent_,n);n.reverse();try{var i=t.copy_,o=n;let e=i;for(let t=0;t<o.length-1;t++)if(!ew(e=em(e,o[t]))||null===e)throw Error(`Cannot resolve path at '${o.join("/")}'`)}catch(e){return null}return n}})}(),r=e2(r,e),e5(i,t),n.emit("updated",r,void 0,t))},mutate:(e,o=e8())=>{if(!i.has(o))if(e5(i,o),t){let[t,i]=e1(r,e);r=t,n.emit("updated",r,i,o)}else r=e0(r,e),n.emit("updated",r,void 0,o)},syncIds:i}}({initialValue:l?.initialValue,enablePatches:!1});async function u(){if(i||e.callEvent("devframe:rpc:server-state:subscribe",s),l?.initialValue!==void 0){for(let e of(t.set(s,d),r))e(s);return e.call("devframe:rpc:server-state:get",s).then(e=>{void 0!==e&&d.mutate(()=>o(s,e))}).catch(e=>{console.error("Error getting server state",e)}),a(s,d),d}{let n=await e.call("devframe:rpc:server-state:get",s);for(let e of(d.mutate(()=>o(s,n)),t.set(s,d),r))e(s);return a(s,d),d}}return new Promise(t=>{if(e.isTrusted)u().then(t);else{t(d);let n=!1;e.events.on("rpc:is-trusted:updated",e=>{e&&!n&&(n=!0,u())})}})}}}(y),n=new Map,r=new Map,y.client.register({name:"devframe:streaming:chunk",type:"event",handler(e,t,r,i){let o=n.get(tl(e,t));o?._push(r,i)}}),y.client.register({name:"devframe:streaming:end",type:"event",handler(e,t,r){let i=tl(e,t),o=n.get(i);o&&(o._end(r),n.delete(i))}}),y.client.register({name:"devframe:streaming:upload-cancel",type:"event",handler(e,t){let n=tl(e,t),i=r.get(n);i&&(i.abort("server cancelled upload"),r.delete(n))}}),y.events.on("rpc:is-trusted:updated",e=>{if(e)for(let[e,t]of n){if(t.cancelled||t.done)continue;let n=e.indexOf("\x1f");if(n<0)continue;let r=e.slice(0,n),i=e.slice(n+1);y.callEvent("devframe:streaming:subscribe",r,i,{afterSeq:t.lastSeenSeq})}}),y.streaming={subscribe:function(e,t,r={}){let i=tl(e,t),o=n.get(i);if(o)return o;let a=function(e={}){let t,n,r,i,o=e.id??e8(),a=Math.max(1,e.highWaterMark??256),s=[],l=0,d=!1,u=!1;function c(){if(n){if(s.length>0){let e=s.shift(),t=n;n=void 0,t.resolve({value:e,done:!1});return}if(d){let e=n;if(n=void 0,t){let n=Error(t.message);n.name=t.name,e.reject(n)}else e.resolve({value:void 0,done:!0})}}}function h(){if(r){for(;s.length>0;){let e=s.shift();try{r.enqueue(e)}catch{break}}if(d&&r){try{if(t){let e=Error(t.message);e.name=t.name,r.error(e)}else r.close()}catch{}r=void 0}}}function f(e){!d&&(d=!0,t=e,c(),i&&h())}function p(){u||d||(u=!0,e.onCancel?.(),f(void 0))}return{id:o,get cancelled(){return u},get done(){return d},get lastSeenSeq(){return l},get readable(){return i||(i=new ReadableStream({start(e){r=e,h()},cancel(){p()}}))},cancel:p,_push:function(t,n){if(!d&&!u&&!(t<=l)){if(l=t,s.push(n),s.length>a){let t=s.length-a;s.splice(0,t),e.onOverflow?.(t)}c(),i&&h()}},_end:f,[Symbol.asyncIterator]:()=>({next(){if(s.length>0)return Promise.resolve({value:s.shift(),done:!1});if(d){if(t){let e=Error(t.message);return e.name=t.name,Promise.reject(e)}return Promise.resolve({value:void 0,done:!0})}return new Promise((e,t)=>{n={resolve:e,reject:t}})},return:()=>(p(),Promise.resolve({value:void 0,done:!0}))})}}({id:t,highWaterMark:r.highWaterMark,onOverflow(n){console.warn(`[devframe] DF0029: Stream "${e}#${t}" dropped ${n} chunk(s) after exceeding the client high-water mark.`)},onCancel(){y.callEvent("devframe:streaming:cancel",e,t),n.delete(i)}});if(n.set(i,a),y.isTrusted)y.callEvent("devframe:streaming:subscribe",e,t,{afterSeq:0});else{let r=y.events.on("rpc:is-trusted:updated",o=>{o&&(r(),!n.has(i)||a.cancelled||a.done||y.callEvent("devframe:streaming:subscribe",e,t,{afterSeq:a.lastSeenSeq}))})}return a},upload:function(e,t){let n=tl(e,t),i=r.get(n);if(i)return i;let o=function(e={}){let t=e.id??e8(),n=Math.max(0,e.replayWindow??0),r=H(),i=new AbortController,o=[],a=!1,s=0;function l(e){if(a)throw new ts(`Cannot write to a closed stream "${t}"`);s+=1,n>0&&(o.push({seq:s,chunk:e}),o.length>n&&o.splice(0,o.length-n)),r.emit("chunk",s,e)}function d(e){if(a)return;a=!0;let t=function(e){if(e instanceof Error)return{name:e.name||"Error",message:e.message};if("string"==typeof e)return{name:"Error",message:e};try{return{name:"Error",message:JSON.stringify(e)}}catch{return{name:"Error",message:String(e)}}}(e);i.abort(e),r.emit("end",t)}function u(){a||(a=!0,i.signal.aborted||i.abort("stream closed"),r.emit("end",void 0))}let c=new WritableStream({write(e){l(e)},close(){u()},abort(e){d(e)}});return{id:t,signal:i.signal,get closed(){return a},get lastSeq(){return s},write:l,error:d,close:u,abort:function(e){!a&&(i.signal.aborted||i.abort(e??"aborted"))},writable:c,events:r,buffer:o}}({id:t});return o.events.on("chunk",(n,r)=>{y.callEvent("devframe:streaming:upload-chunk",e,t,n,r)}),o.events.on("end",i=>{y.callEvent("devframe:streaming:upload-end",e,t,i),r.delete(n)}),r.set(n,o),o}};let k=new Map;y.scope=e=>{if(!e)return y;let t=k.get(e);!t&&(t={namespace:e,base:y,rpc:{namespace:e,register(t){if(t3(t.name))throw Error(`[devframe] Scoped client RPC registration for namespace "${e}" received an already-namespaced function name "${t.name}". Pass a bare name without a ":" separator.`);y.client.register({...t,name:`${e}:${t.name}`})},call:(t,...n)=>y.call(t4(e,t),...n),callEvent:(t,...n)=>y.callEvent(t4(e,t),...n),callOptional:(t,...n)=>y.callOptional(t4(e,t),...n),sharedState:(t,n)=>y.sharedState.get(t4(e,t),n),streaming:{subscribe:(t,n,r)=>y.streaming.subscribe(t4(e,t),n,r),upload:(t,n)=>y.streaming.upload(t4(e,t),n)}},settings:{global:t7(y,e,"global"),project:t7(y,e,"project")},scope:y.scope},k.set(e,t));return t},p.rpc=y,v.requestTrust();let S=e.otpParam??x;return S&&X(y,{param:S}),t&&(t.onmessage=e=>{e.data?.type==="auth-update"&&e.data.authToken&&y.requestTrustWithToken(e.data.authToken)}),y}let nr=(0,g.createContext)({rpc:null,status:"connecting",error:null});function ni(){return(0,g.use)(nr)}function no({children:e}){let[t,n]=(0,g.useState)({rpc:null,status:"connecting",error:null});return(0,g.useEffect)(()=>{let e,t=!1,r=y.default.env.NEXT_PUBLIC_DEVFRAME_WS,i=r?/^\d+$/.test(r)?{port:Number(r),path:"__devframe_ws"}:r:void 0;return nn(i?{connectionMeta:{backend:"websocket",websocket:i}}:void 0).then(r=>{t||(n({rpc:r,status:r.status,error:r.connectionError?.message??null}),e=r.events.on("connection:status",e=>{n({rpc:r,status:e,error:r.connectionError?.message??null})}))},e=>{t||n({rpc:null,status:"error",error:e instanceof Error?e.message:String(e)})}),()=>{t=!0,e?.()}},[]),(0,m.jsx)(nr,{value:t,children:e})}function na(e){let{rpc:t}=ni(),[n,r]=(0,g.useState)(null),[i,o]=(0,g.useState)(!1),[a,s]=(0,g.useState)(null),l=(0,g.useCallback)(async()=>{if(t){o(!0),s(null);try{r(await e(t))}catch(e){s(e instanceof Error?e.message:String(e))}finally{o(!1)}}},[t,e]);return(0,g.useEffect)(()=>{l()},[l]),{data:n,loading:i,error:a,refresh:l,setData:r}}function ns(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function nl(...e){return g.useCallback(function(...e){return t=>{let n=!1,r=e.map(e=>{let r=ns(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():ns(e[t],null)}}}}(...e),e)}function nd(e){let t=g.forwardRef((t,n)=>{var r;let i,o,{children:a,...s}=t,l=null,d=!1,u=[];np(a)&&"function"==typeof nb&&(a=nb(a._payload)),g.Children.forEach(a,e=>{var t;if(t=e,g.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===nc){d=!0;let t="child"in e.props?e.props.child:e.props.children;np(t)&&"function"==typeof nb&&(t=nb(t._payload)),l=nh(e,t),u.push(l?.props?.children)}else u.push(e)}),l?l=g.cloneElement(l,void 0,u):!d&&1===g.Children.count(a)&&g.isValidElement(a)&&(l=a);let c=l?(r=l,(o=(i=Object.getOwnPropertyDescriptor(r.props,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?r.ref:(o=(i=Object.getOwnPropertyDescriptor(r,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?r.props.ref:r.props.ref||r.ref):void 0,h=nl(n,c);if(!l){if(a||0===a)throw Error(d?ng(e):nm(e));return a}let f=function(e,t){let n={...t};for(let r in t){let i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...e)=>{let t=o(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}(s,l.props??{});return l.type!==g.Fragment&&(f.ref=n?h:c),g.cloneElement(l,f)});return t.displayName=`${e}.Slot`,t}var nu=nd("Slot"),nc=Symbol.for("radix.slottable"),nh=(e,t)=>{if("child"in e.props){let t=e.props.child;return g.isValidElement(t)?g.cloneElement(t,void 0,e.props.children(t.props.children)):null}return g.isValidElement(t)?t:null},nf=Symbol.for("react.lazy");function np(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===nf&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var nm=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,ng=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,nb=g[" use ".trim().toString()];let nv=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ny=[],nw=(e,t,n)=>{if(0==e.length-t)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=nw(e,t+1,i);if(n)return n}let o=n.validators;if(null===o)return;let a=0===t?e.join("-"):e.slice(t).join("-"),s=o.length;for(let e=0;e<s;e++){let t=o[e];if(t.validator(a))return t.classGroupId}},nx=(e,t)=>{let n=nv();for(let r in e)nk(e[r],n,r,t);return n},nk=(e,t,n,r)=>{let i=e.length;for(let o=0;o<i;o++)nS(e[o],t,n,r)},nS=(e,t,n,r)=>{"string"==typeof e?nC(e,t,n):"function"==typeof e?nA(e,t,n,r):nE(e,t,n,r)},nC=(e,t,n)=>{(""===e?t:nL(t,e)).classGroupId=n},nA=(e,t,n,r)=>{n_(e)?nk(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push({classGroupId:n,validator:e}))},nE=(e,t,n,r)=>{let i=Object.entries(e),o=i.length;for(let e=0;e<o;e++){let[o,a]=i[e];nk(a,nL(t,o),n,r)}},nL=(e,t)=>{let n=e,r=t.split("-"),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=nv(),n.nextPart.set(t,i)),n=i}return n},n_=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,nN=[],nT=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),nR=/\s+/,nM=e=>{let t;if("string"==typeof e)return e;let n="";for(let r=0;r<e.length;r++)e[r]&&(t=nM(e[r]))&&(n&&(n+=" "),n+=t);return n},nP=[],nI=e=>{let t=t=>t[e]||nP;return t.isThemeGetter=!0,t},nD=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,nj=/^\((?:(\w[\w-]*):)?(.+)\)$/i,n$=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,nO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,nz=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,nB=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,nH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nU=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,nF=e=>n$.test(e),nG=e=>!!e&&!Number.isNaN(Number(e)),nW=e=>!!e&&Number.isInteger(Number(e)),nq=e=>e.endsWith("%")&&nG(e.slice(0,-1)),nV=e=>nO.test(e),nX=()=>!0,nK=e=>nz.test(e)&&!nB.test(e),nY=()=>!1,nJ=e=>nH.test(e),nQ=e=>nU.test(e),nZ=e=>!n2(e)&&!re(e),n0=e=>e.startsWith("@container")&&("/"===e[10]&&void 0!==e[11]||"s"===e[11]&&void 0!==e[16]&&e.startsWith("-size/",10)||"n"===e[11]&&void 0!==e[18]&&e.startsWith("-normal/",10)),n1=e=>rl(e,rh,nY),n2=e=>nD.test(e),n8=e=>rl(e,rf,nK),n5=e=>rl(e,rp,nG),n6=e=>rl(e,rg,nX),n3=e=>rl(e,rm,nY),n4=e=>rl(e,ru,nY),n7=e=>rl(e,rc,nQ),n9=e=>rl(e,rb,nJ),re=e=>nj.test(e),rt=e=>rd(e,rf),rn=e=>rd(e,rm),rr=e=>rd(e,ru),ri=e=>rd(e,rh),ro=e=>rd(e,rc),ra=e=>rd(e,rb,!0),rs=e=>rd(e,rg,!0),rl=(e,t,n)=>{let r=nD.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},rd=(e,t,n=!1)=>{let r=nj.exec(e);return!!r&&(r[1]?t(r[1]):n)},ru=e=>"position"===e||"percentage"===e,rc=e=>"image"===e||"url"===e,rh=e=>"length"===e||"size"===e||"bg-size"===e,rf=e=>"length"===e,rp=e=>"number"===e,rm=e=>"family-name"===e,rg=e=>"number"===e||"weight"===e,rb=e=>"shadow"===e,rv=((e,...t)=>{let n,r,i,o,a=e=>{let t=r(e);if(t)return t;let o=((e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o,postfixLookupClassGroupIds:a}=t,s=[],l=e.trim().split(nR),d="";for(let e=l.length-1;e>=0;e-=1){let t,u=l[e],{isExternal:c,modifiers:h,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(u);if(c){d=u+(d.length>0?" "+d:d);continue}let g=!!m;if(g){let e=(t=r(p.substring(0,m)))&&a[t]?r(p):void 0;e&&e!==t&&(t=e,g=!1)}else t=r(p);if(!t){if(!g||!(t=r(p))){d=u+(d.length>0?" "+d:d);continue}g=!1}let b=0===h.length?"":1===h.length?h[0]:o(h).join(":"),v=f?b+"!":b,y=v+t;if(s.indexOf(y)>-1)continue;s.push(y);let w=i(t,g);for(let e=0;e<w.length;++e){let t=w[e];s.push(v+t)}d=u+(d.length>0?" "+d:d)}return d})(e,n);return i(e,o),o};return o=s=>{var l;let d;return r=(n={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,o)=>{n[i]=o,++t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];return void 0!==t?t:void 0!==(t=r[e])?(i(e,t),t):void 0},set(e,t){e in n?n[e]=t:i(e,t)}}})((l=t.reduce((e,t)=>t(e),e())).cacheSize),parseClassName:(e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t,n=[],r=0,i=0,o=0,a=e.length;for(let s=0;s<a;s++){let a=e[s];if(0===r&&0===i){if(":"===a){n.push(e.slice(o,s)),o=s+1;continue}if("/"===a){t=s;continue}}"["===a?r++:"]"===a?r--:"("===a?i++:")"===a&&i--}let s=0===n.length?e:e.slice(o),l=s,d=!1;return s.endsWith("!")?(l=s.slice(0,-1),d=!0):s.startsWith("!")&&(l=s.slice(1),d=!0),nT(n,d,l,t&&t>o?t-o:void 0)};if(t){let e=t+":",n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):nT(nN,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r})(l),sortModifiers:(d=new Map,l.orderSensitiveModifiers.forEach((e,t)=>{d.set(e,1e6+t)}),e=>{let t=[],n=[];for(let r=0;r<e.length;r++){let i=e[r],o="["===i[0],a=d.has(i);o||a?(n.length>0&&(n.sort(),t.push(...n),n=[]),t.push(i)):n.push(i)}return n.length>0&&(n.sort(),t.push(...n)),t}),postfixLookupClassGroupIds:(e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t})(l),...(e=>{let t=(e=>{let{theme:t,classGroups:n}=e;return nx(n,t)})(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]")){var n;let t,r,i;return -1===(n=e).slice(1,-1).indexOf(":")?void 0:(r=(t=n.slice(1,-1)).indexOf(":"),(i=t.slice(0,r))?"arbitrary.."+i:void 0)}let r=e.split("-"),i=+(""===r[0]&&r.length>1);return nw(r,i,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];if(t){if(i){let e=Array(i.length+t.length);for(let t=0;t<i.length;t++)e[t]=i[t];for(let n=0;n<t.length;n++)e[i.length+n]=t[n];return e}return t}return i||ny}return n[e]||ny}}})(l)}).cache.get,i=n.cache.set,o=a,a(s)},(...e)=>o(((...e)=>{let t,n,r=0,i="";for(;r<e.length;)(t=e[r++])&&(n=nM(t))&&(i&&(i+=" "),i+=n);return i})(...e))})(()=>{let e=nI("color"),t=nI("font"),n=nI("text"),r=nI("font-weight"),i=nI("tracking"),o=nI("leading"),a=nI("breakpoint"),s=nI("container"),l=nI("spacing"),d=nI("radius"),u=nI("shadow"),c=nI("inset-shadow"),h=nI("text-shadow"),f=nI("drop-shadow"),p=nI("blur"),m=nI("perspective"),g=nI("aspect"),b=nI("ease"),v=nI("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],x=()=>[...w(),re,n2],k=()=>["auto","hidden","clip","visible","scroll"],S=()=>["auto","contain","none"],C=()=>[re,n2,l],A=()=>[nF,"full","auto",...C()],E=()=>[nW,"none","subgrid",re,n2],L=()=>["auto",{span:["full",nW,re,n2]},nW,re,n2],_=()=>[nW,"auto",re,n2],N=()=>["auto","min","max","fr",re,n2],T=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],R=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...C()],P=()=>[nF,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],I=()=>[nF,"screen","full","dvw","lvw","svw","min","max","fit",...C()],D=()=>[nF,"screen","full","lh","dvh","lvh","svh","min","max","fit",...C()],j=()=>[e,re,n2],$=()=>[...w(),rr,n4,{position:[re,n2]}],O=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",ri,n1,{size:[re,n2]}],B=()=>[nq,rt,n8],H=()=>["","none","full",d,re,n2],U=()=>["",nG,rt,n8],F=()=>["solid","dashed","dotted","double"],G=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>[nG,nq,rr,n4],q=()=>["","none",p,re,n2],V=()=>["none",nG,re,n2],X=()=>["none",nG,re,n2],K=()=>[nG,re,n2],Y=()=>[nF,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[nV],breakpoint:[nV],color:[nX],container:[nV],"drop-shadow":[nV],ease:["in","out","in-out"],font:[nZ],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[nV],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[nV],shadow:[nV],spacing:["px",nG],text:[nV],"text-shadow":[nV],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",nF,n2,re,g]}],container:["container"],"container-type":[{"@container":["","normal","size",re,n2]}],"container-named":[n0],columns:[{columns:[nG,n2,re,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:x()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{"inset-s":A(),start:A()}],end:[{"inset-e":A(),end:A()}],"inset-bs":[{"inset-bs":A()}],"inset-be":[{"inset-be":A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[nW,"auto",re,n2]}],basis:[{basis:[nF,"full","auto",s,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[nG,nF,"auto","initial","none",n2]}],grow:[{grow:["",nG,re,n2]}],shrink:[{shrink:["",nG,re,n2]}],order:[{order:[nW,"first","last","none",re,n2]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...T(),"normal"]}],"justify-items":[{"justify-items":[...R(),"normal"]}],"justify-self":[{"justify-self":["auto",...R()]}],"align-content":[{content:["normal",...T()]}],"align-items":[{items:[...R(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...R(),{baseline:["","last"]}]}],"place-content":[{"place-content":T()}],"place-items":[{"place-items":[...R(),"baseline"]}],"place-self":[{"place-self":["auto",...R()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:P()}],"inline-size":[{inline:["auto",...I()]}],"min-inline-size":[{"min-inline":["auto",...I()]}],"max-inline-size":[{"max-inline":["none",...I()]}],"block-size":[{block:["auto",...D()]}],"min-block-size":[{"min-block":["auto",...D()]}],"max-block-size":[{"max-block":["none",...D()]}],w:[{w:[s,"screen",...P()]}],"min-w":[{"min-w":[s,"screen","none",...P()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...P()]}],h:[{h:["screen","lh",...P()]}],"min-h":[{"min-h":["screen","lh","none",...P()]}],"max-h":[{"max-h":["screen","lh",...P()]}],"font-size":[{text:["base",n,rt,n8]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,rs,n6]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",nq,n2]}],"font-family":[{font:[rn,n3,t]}],"font-features":[{"font-features":[n2]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,re,n2]}],"line-clamp":[{"line-clamp":[nG,"none",re,n5]}],leading:[{leading:[o,...C()]}],"list-image":[{"list-image":["none",re,n2]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",re,n2]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:[nG,"from-font","auto",re,n8]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[nG,"auto",re,n2]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"tab-size":[{tab:[nW,re,n2]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",re,n2]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",re,n2]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:$()}],"bg-repeat":[{bg:O()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},nW,re,n2],radial:["",re,n2],conic:[nW,re,n2]},ro,n7]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:H()}],"rounded-s":[{"rounded-s":H()}],"rounded-e":[{"rounded-e":H()}],"rounded-t":[{"rounded-t":H()}],"rounded-r":[{"rounded-r":H()}],"rounded-b":[{"rounded-b":H()}],"rounded-l":[{"rounded-l":H()}],"rounded-ss":[{"rounded-ss":H()}],"rounded-se":[{"rounded-se":H()}],"rounded-ee":[{"rounded-ee":H()}],"rounded-es":[{"rounded-es":H()}],"rounded-tl":[{"rounded-tl":H()}],"rounded-tr":[{"rounded-tr":H()}],"rounded-br":[{"rounded-br":H()}],"rounded-bl":[{"rounded-bl":H()}],"border-w":[{border:U()}],"border-w-x":[{"border-x":U()}],"border-w-y":[{"border-y":U()}],"border-w-s":[{"border-s":U()}],"border-w-e":[{"border-e":U()}],"border-w-bs":[{"border-bs":U()}],"border-w-be":[{"border-be":U()}],"border-w-t":[{"border-t":U()}],"border-w-r":[{"border-r":U()}],"border-w-b":[{"border-b":U()}],"border-w-l":[{"border-l":U()}],"divide-x":[{"divide-x":U()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":U()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...F(),"hidden","none"]}],"divide-style":[{divide:[...F(),"hidden","none"]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-bs":[{"border-bs":j()}],"border-color-be":[{"border-be":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...F(),"none","hidden"]}],"outline-offset":[{"outline-offset":[nG,re,n2]}],"outline-w":[{outline:["",nG,rt,n8]}],"outline-color":[{outline:j()}],shadow:[{shadow:["","none",u,ra,n9]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",c,ra,n9]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[nG,n8]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":U()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":["none",h,ra,n9]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[nG,re,n2]}],"mix-blend":[{"mix-blend":[...G(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":G()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[nG]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[re,n2]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[nG]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:$()}],"mask-repeat":[{mask:O()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",re,n2]}],filter:[{filter:["","none",re,n2]}],blur:[{blur:q()}],brightness:[{brightness:[nG,re,n2]}],contrast:[{contrast:[nG,re,n2]}],"drop-shadow":[{"drop-shadow":["","none",f,ra,n9]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:["",nG,re,n2]}],"hue-rotate":[{"hue-rotate":[nG,re,n2]}],invert:[{invert:["",nG,re,n2]}],saturate:[{saturate:[nG,re,n2]}],sepia:[{sepia:["",nG,re,n2]}],"backdrop-filter":[{"backdrop-filter":["","none",re,n2]}],"backdrop-blur":[{"backdrop-blur":q()}],"backdrop-brightness":[{"backdrop-brightness":[nG,re,n2]}],"backdrop-contrast":[{"backdrop-contrast":[nG,re,n2]}],"backdrop-grayscale":[{"backdrop-grayscale":["",nG,re,n2]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[nG,re,n2]}],"backdrop-invert":[{"backdrop-invert":["",nG,re,n2]}],"backdrop-opacity":[{"backdrop-opacity":[nG,re,n2]}],"backdrop-saturate":[{"backdrop-saturate":[nG,re,n2]}],"backdrop-sepia":[{"backdrop-sepia":["",nG,re,n2]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",re,n2]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[nG,"initial",re,n2]}],ease:[{ease:["linear","initial",b,re,n2]}],delay:[{delay:[nG,re,n2]}],animate:[{animate:["none",v,re,n2]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,re,n2]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:V()}],"rotate-x":[{"rotate-x":V()}],"rotate-y":[{"rotate-y":V()}],"rotate-z":[{"rotate-z":V()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:K()}],"skew-x":[{"skew-x":K()}],"skew-y":[{"skew-y":K()}],transform:[{transform:[re,n2,"","none","gpu","cpu"]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Y()}],"translate-x":[{"translate-x":Y()}],"translate-y":[{"translate-y":Y()}],"translate-z":[{"translate-z":Y()}],"translate-none":["translate-none"],zoom:[{zoom:[nW,re,n2]}],accent:[{accent:j()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:j()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",re,n2]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":j()}],"scrollbar-track-color":[{"scrollbar-track":j()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",re,n2]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[nG,rt,n8,n5]}],stroke:[{stroke:["none",...j()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function ry(...e){return rv(function(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=function e(t){var n,r,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(n=0;n<o;n++)t[n]&&(r=e(t[n]))&&(i&&(i+=" "),i+=r)}else for(r in t)t[r]&&(i&&(i+=" "),i+=r);return i}(e))&&(r&&(r+=" "),r+=t);return r}(e))}function rw({className:e,variant:t="secondary",asChild:n=!1,...r}){return(0,m.jsx)(n?nu:"span",{"data-slot":"badge",className:ry(function({variant:e="secondary",class:t}={}){return b({primary:"badge-active",secondary:"badge-muted",success:"badge badge-color-green",warning:"badge badge-color-amber",destructive:"badge badge-color-red",outline:"badge border border-base"}[e],t)}({variant:t}),e),...r})}function rx({className:e,variant:t="primary",size:n="md",asChild:r=!1,...i}){return(0,m.jsx)(r?nu:"button",{"data-slot":"button",className:ry(v({variant:t,size:n}),e),...i})}function rk({className:e,variant:t="outline",size:n="md",asChild:r=!1,...i}){return(0,m.jsx)(r?nu:"button",{"data-slot":"icon-button",className:ry(function({variant:e="outline",size:t="md",class:n}={}){return b("ghost"===e?"btn-icon":"btn-icon-square","sm"===t?"w-7! h-7! text-sm":"",n)}({variant:t,size:n}),e),...i})}let rS=[{match:/package\.json$/,icon:"i-catppuccin:npm"},{match:/(?:^|\/)tsconfig(?:\.\w+)?\.json$/,icon:"i-catppuccin:typescript-config"},{match:/\.(?:test|spec)\.[cm]?[jt]sx?$/,icon:"i-catppuccin:typescript-test"},{match:/\.vue$/,icon:"i-catppuccin:vue"},{match:/\.svelte$/,icon:"i-catppuccin:svelte"},{match:/\.tsx$/,icon:"i-catppuccin:typescript-react"},{match:/\.jsx$/,icon:"i-catppuccin:javascript-react"},{match:/\.d\.[cm]?ts$/,icon:"i-catppuccin:typescript-def"},{match:/\.[cm]?ts$/,icon:"i-catppuccin:typescript"},{match:/\.[cm]?js$/,icon:"i-catppuccin:javascript"},{match:/\.json5?$/,icon:"i-catppuccin:json"},{match:/\.ya?ml$/,icon:"i-catppuccin:yaml"},{match:/\.toml$/,icon:"i-catppuccin:toml"},{match:/\.mdx?$/,icon:"i-catppuccin:markdown"},{match:/\.html?$/,icon:"i-catppuccin:html"},{match:/\.(?:css|postcss)$/,icon:"i-catppuccin:css"},{match:/\.s[ac]ss$/,icon:"i-catppuccin:sass"},{match:/\.less$/,icon:"i-catppuccin:less"},{match:/\.svg$/,icon:"i-catppuccin:svg"},{match:/\.(?:png|jpe?g|gif|webp|avif|ico)$/,icon:"i-catppuccin:image"},{match:/\.(?:woff2?|ttf|otf|eot)$/,icon:"i-catppuccin:font"},{match:/\.wasm$/,icon:"i-catppuccin:webassembly"},{match:/\.(?:sh|bash|zsh|fish)$/,icon:"i-catppuccin:bash"},{match:/\.py$/,icon:"i-catppuccin:python"},{match:/\.rs$/,icon:"i-catppuccin:rust"},{match:/\.go$/,icon:"i-catppuccin:go"},{match:/\.(?:xlsx?|csv)$/,icon:"i-catppuccin:table"},{match:/(?:^|\/)\.gitignore$/,icon:"i-catppuccin:git"},{match:/(?:^|\/)LICENSE(?:\.\w+)?$/,icon:"i-catppuccin:license"}];function rC({name:e,className:t,...n}){return(0,m.jsx)("span",{"aria-hidden":!0,className:ry(e,"inline-block shrink-0",t),...n})}function rA({path:e,className:t,...n}){return(0,m.jsx)(rC,{name:function(e){let t=e.replace(/[?#].*$/,"");for(let e of rS)if(e.match.test(t))return e.icon;return"i-catppuccin:file"}(e),className:ry("size-4",t),...n})}var rE=e.i(54737),rL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=nd(`Primitive.${t}`),r=g.forwardRef((e,r)=>{let{asChild:i,...o}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,m.jsx)(i?n:t,{...o,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),r_=globalThis?.document?g.useLayoutEffect:()=>{},rN=e=>{var t;let n,r,{present:i,children:o}=e,a=function(e){var t,n;let[r,i]=g.useState(),o=g.useRef(null),a=g.useRef(e),s=g.useRef("none"),l=g.useRef(void 0),[d,u]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},g.useReducer((e,t)=>n[e][t]??e,t));return g.useEffect(()=>{"mounted"===d?(s.current=l.current??rR(o.current),l.current=void 0):s.current="none"},[d]),r_(()=>{let t=o.current,n=a.current;if(n!==e){let r=s.current,i=rR(t);e?(l.current=i,u("MOUNT")):"none"===i||t?.display==="none"?u("UNMOUNT"):n&&r!==i?u("ANIMATION_OUT"):u("UNMOUNT"),a.current=e}},[e,u]),r_(()=>{if(r){let e,t=r.ownerDocument.defaultView??window,n=n=>{let i=rR(o.current).includes(CSS.escape(n.animationName));if(n.target===r&&i&&(u("ANIMATION_END"),!a.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&&(s.current=rR(o.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)}}u("ANIMATION_END")},[r,u]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:g.useCallback(e=>{if(e){let t=getComputedStyle(e);o.current=t,l.current=rR(t)}else o.current=null;i(e)},[])}}(i),s="function"==typeof o?o({present:a.isPresent}):g.Children.only(o),l=function(...e){let t=g.useRef(e);return t.current=e,g.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=rT(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():rT(n[e],null)}}},[])}(a.ref,(t=s,(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 o||a.isPresent?g.cloneElement(s,{ref:l}):null};function rT(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function rR(e){return e?.animationName||"none"}function rM(e){let t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...e)=>t.current?.(...e),[])}rN.displayName="Presence";var rP=g.createContext(void 0);function rI(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r||!r.defaultPrevented)return t?.(r)}}"u">typeof window&&window.document&&window.document.createElement;var rD="ScrollArea",[rj,r$]=function(e,t=[]){let n=[],r=()=>{let t=n.map(e=>g.createContext(e));return function(n){let r=n?.[e]||t;return g.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return r.scopeName=e,[function(t,r){let i=g.createContext(r);i.displayName=t+"Context";let o=n.length;n=[...n,r];let a=t=>{let{scope:n,children:r,...a}=t,s=n?.[e]?.[o]||i,l=g.useMemo(()=>a,Object.values(a));return(0,m.jsx)(s.Provider,{value:l,children:r})};return a.displayName=t+"Provider",[a,function(n,a,s={}){let{optional:l=!1}=s,d=a?.[e]?.[o]||i,u=g.useContext(d);if(u)return u;if(void 0!==r)return r;if(!l)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 g.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}(r,...t)]}(rD),[rO,rz]=rj(rD),rB=g.forwardRef((e,t)=>{let n,{__scopeScrollArea:r,type:i="hover",dir:o,scrollHideDelay:a=600,...s}=e,[l,d]=g.useState(null),[u,c]=g.useState(null),[h,f]=g.useState(null),[p,b]=g.useState(null),[v,y]=g.useState(null),[w,x]=g.useState(0),[k,S]=g.useState(0),[C,A]=g.useState(!1),[E,L]=g.useState(!1),_=nl(t,d),N=(n=g.useContext(rP),o||n||"ltr");return(0,m.jsx)(rO,{scope:r,type:i,dir:N,scrollHideDelay:a,scrollArea:l,viewport:u,onViewportChange:c,content:h,onContentChange:f,scrollbarX:p,onScrollbarXChange:b,scrollbarXEnabled:C,onScrollbarXEnabledChange:A,scrollbarY:v,onScrollbarYChange:y,scrollbarYEnabled:E,onScrollbarYEnabledChange:L,onCornerWidthChange:x,onCornerHeightChange:S,children:(0,m.jsx)(rL.div,{dir:N,...s,ref:_,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":k+"px",...e.style}})})});rB.displayName=rD;var rH="ScrollAreaViewport",rU=g.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...o}=e,a=rz(rH,n),s=nl(t,g.useRef(null),a.onViewportChange);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(rF,{nonce:i}),(0,m.jsx)(rL.div,{"data-radix-scroll-area-viewport":"",...o,ref:s,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,m.jsx)("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});rU.displayName=rH;var rF=g.memo(({nonce:e})=>(0,m.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:e}),(e,t)=>e.nonce===t.nonce),rG="ScrollAreaScrollbar",rW=g.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=rz(rG,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=i,s="horizontal"===e.orientation;return g.useEffect(()=>(s?o(!0):a(!0),()=>{s?o(!1):a(!1)}),[s,o,a]),"hover"===i.type?(0,m.jsx)(rq,{...r,ref:t,forceMount:n}):"scroll"===i.type?(0,m.jsx)(rV,{...r,ref:t,forceMount:n}):"auto"===i.type?(0,m.jsx)(rX,{...r,ref:t,forceMount:n}):"always"===i.type?(0,m.jsx)(rK,{...r,ref:t,"data-state":"visible"}):null});rW.displayName=rG;var rq=g.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=rz(rG,e.__scopeScrollArea),[o,a]=g.useState(!1);return g.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),a(!0)},r=()=>{t=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return e.addEventListener("pointerenter",n),e.addEventListener("pointerleave",r),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",n),e.removeEventListener("pointerleave",r)}}},[i.scrollArea,i.scrollHideDelay]),(0,m.jsx)(rN,{present:n||o,children:(0,m.jsx)(rX,{"data-state":o?"visible":"hidden",...r,ref:t})})}),rV=g.forwardRef((e,t)=>{var n;let{forceMount:r,...i}=e,o=rz(rG,e.__scopeScrollArea),a="horizontal"===e.orientation,s=ii(()=>d("SCROLL_END"),100),[l,d]=(n={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},g.useReducer((e,t)=>n[e][t]??e,"hidden"));return g.useEffect(()=>{if("idle"===l){let e=window.setTimeout(()=>d("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(e)}},[l,o.scrollHideDelay,d]),g.useEffect(()=>{let e=o.viewport,t=a?"scrollLeft":"scrollTop";if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(d("SCROLL"),s()),n=r};return e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}},[o.viewport,a,d,s]),(0,m.jsx)(rN,{present:r||"hidden"!==l,children:(0,m.jsx)(rK,{"data-state":"hidden"===l?"hidden":"visible",...i,ref:t,onPointerEnter:rI(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:rI(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),rX=g.forwardRef((e,t)=>{let n=rz(rG,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,a]=g.useState(!1),s="horizontal"===e.orientation,l=ii(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;a(s?e:t)}},10);return io(n.viewport,l),io(n.content,l),(0,m.jsx)(rN,{present:r||o,children:(0,m.jsx)(rK,{"data-state":o?"visible":"hidden",...i,ref:t})})}),rK=g.forwardRef((e,t)=>{let{orientation:n="vertical",...r}=e,i=rz(rG,e.__scopeScrollArea),o=g.useRef(null),a=g.useRef(0),[s,l]=g.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=r7(s.viewport,s.content),u={...r,sizes:s,onSizesChange:l,hasThumb:!!(d>0&&d<1),onThumbChange:e=>o.current=e,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:e=>a.current=e};function c(e,t){return function(e,t,n,r="ltr"){let i=r9(n),o=t||i/2,a=n.scrollbar.paddingStart+o,s=n.scrollbar.size-n.scrollbar.paddingEnd-(i-o),l=n.content-n.viewport;return it([a,s],"ltr"===r?[0,l]:[-1*l,0])(e)}(e,a.current,s,t)}return"horizontal"===n?(0,m.jsx)(rY,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){let e=ie(i.viewport.scrollLeft,s,i.dir);o.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=c(e,i.dir))}}):"vertical"===n?(0,m.jsx)(rJ,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){let e=ie(i.viewport.scrollTop,s);o.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=c(e))}}):null}),rY=g.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,o=rz(rG,e.__scopeScrollArea),[a,s]=g.useState(),l=g.useRef(null),d=nl(t,l,o.onScrollbarXChange);return g.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),(0,m.jsx)(r0,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{bottom:0,left:"rtl"===o.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===o.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":r9(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(o.viewport){var r,i;let a=o.viewport.scrollLeft+t.deltaX;e.onWheelScroll(a),r=a,i=n,r>0&&r<i&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&a&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:r4(a.paddingLeft),paddingEnd:r4(a.paddingRight)}})}})}),rJ=g.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,o=rz(rG,e.__scopeScrollArea),[a,s]=g.useState(),l=g.useRef(null),d=nl(t,l,o.onScrollbarYChange);return g.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),(0,m.jsx)(r0,{"data-orientation":"vertical",...i,ref:d,sizes:n,style:{top:0,right:"ltr"===o.dir?0:void 0,left:"rtl"===o.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":r9(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(o.viewport){var r,i;let a=o.viewport.scrollTop+t.deltaY;e.onWheelScroll(a),r=a,i=n,r>0&&r<i&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&a&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:r4(a.paddingTop),paddingEnd:r4(a.paddingBottom)}})}})}),[rQ,rZ]=rj(rG),r0=g.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:s,onThumbPositionChange:l,onDragScroll:d,onWheelScroll:u,onResize:c,...h}=e,f=rz(rG,n),[p,b]=g.useState(null),v=nl(t,b),y=g.useRef(null),w=g.useRef(""),x=f.viewport,k=r.content-r.viewport,S=rM(u),C=rM(l),A=ii(c,10);function E(e){y.current&&d({x:e.clientX-y.current.left,y:e.clientY-y.current.top})}return g.useEffect(()=>{let e=e=>{let t=e.target;p?.contains(t)&&S(e,k)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[x,p,k,S]),g.useEffect(C,[r,C]),io(p,A),io(f.content,A),(0,m.jsx)(rQ,{scope:n,scrollbar:p,hasThumb:i,onThumbChange:rM(o),onThumbPointerUp:rM(a),onThumbPositionChange:C,onThumbPointerDown:rM(s),children:(0,m.jsx)(rL.div,{...h,ref:v,style:{position:"absolute",...h.style},onPointerDown:rI(e.onPointerDown,e=>{0===e.button&&(e.target.setPointerCapture(e.pointerId),y.current=p.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),E(e))}),onPointerMove:rI(e.onPointerMove,E),onPointerUp:rI(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=w.current,f.viewport&&(f.viewport.style.scrollBehavior=""),y.current=null})})})}),r1="ScrollAreaThumb",r2=g.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=rZ(r1,e.__scopeScrollArea);return(0,m.jsx)(rN,{present:n||i.hasThumb,children:(0,m.jsx)(r8,{ref:t,...r})})}),r8=g.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,o=rz(r1,n),a=rZ(r1,n),{onThumbPositionChange:s}=a,l=nl(t,a.onThumbChange),d=g.useRef(void 0),u=ii(()=>{d.current&&(d.current(),d.current=void 0)},100);return g.useEffect(()=>{let e=o.viewport;if(e){let t=()=>{u(),d.current||(d.current=ir(e,s),s())};return s(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[o.viewport,u,s]),(0,m.jsx)(rL.div,{"data-state":a.hasThumb?"visible":"hidden",...i,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:rI(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;a.onThumbPointerDown({x:n,y:r})}),onPointerUp:rI(e.onPointerUp,a.onThumbPointerUp)})});r2.displayName=r1;var r5="ScrollAreaCorner",r6=g.forwardRef((e,t)=>{let n=rz(r5,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&r?(0,m.jsx)(r3,{...e,ref:t}):null});r6.displayName=r5;var r3=g.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=rz(r5,n),[o,a]=g.useState(0),[s,l]=g.useState(0),d=!!(o&&s),{onCornerWidthChange:u,onCornerHeightChange:c}=i;return io(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),l(e)}),io(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),a(e)}),g.useEffect(()=>()=>{u(0),c(0)},[u,c]),d?(0,m.jsx)(rL.div,{...r,ref:t,style:{width:o,height:s,position:"absolute",right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:0,...e.style}}):null});function r4(e){return e?parseInt(e,10):0}function r7(e,t){let n=e/t;return isNaN(n)?0:n}function r9(e){let t=r7(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd;return Math.max((e.scrollbar.size-n)*t,18)}function ie(e,t,n="ltr"){let r=r9(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,a=t.content-t.viewport,s=function(e,[t,n]){return Math.min(n,Math.max(t,e))}(e,"ltr"===n?[0,a]:[-1*a,0]);return it([0,a],[0,o-r])(s)}function it(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}var ir=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return!function i(){let o={left:e.scrollLeft,top:e.scrollTop},a=n.left!==o.left,s=n.top!==o.top;(a||s)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function ii(e,t){let n=rM(e),r=g.useRef(0);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),g.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function io(e,t){let n=rM(t);r_(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}function ia({className:e,children:t,...n}){return(0,m.jsxs)(rB,{"data-slot":"scroll-area",className:ry("relative",e),...n,children:[(0,m.jsx)(rU,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-primary-500/40 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),(0,m.jsx)(is,{}),(0,m.jsx)(r6,{})]})}function is({className:e,orientation:t="vertical",...n}){return(0,m.jsx)(rW,{"data-slot":"scroll-area-scrollbar",orientation:t,className:ry("flex touch-none p-px transition-colors select-none","vertical"===t&&"h-full w-2.5 border-l border-l-transparent","horizontal"===t&&"h-2.5 flex-col border-t border-t-transparent",e),...n,children:(0,m.jsx)(r2,{"data-slot":"scroll-area-thumb",className:"bg-[#8882] relative flex-1 rounded-full"})})}function il({className:e,...t}){return(0,m.jsx)("div",{"data-slot":"skeleton",className:ry("bg-active animate-pulse rounded-md",e),...t})}let id={modified:"M",added:"A",deleted:"D",renamed:"R",copied:"C","type-changed":"T",unmerged:"U",unknown:"?"},iu={added:"text-success",deleted:"text-error",modified:"text-warning",renamed:"color-active",copied:"color-active","type-changed":"text-warning",unmerged:"text-error",unknown:"color-muted"};function ic({code:e,className:t}){return(0,m.jsx)("span",{className:ry("w-3.5 shrink-0 text-center font-mono text-xs font-semibold",iu[e],t),title:e,"aria-label":e,children:id[e]})}let ih="diffs-container";(()=>{try{return!1}catch{return!1}})();let ip=/(?=^From [a-f0-9]+ .+$)/m,im=/(?=^diff --git)/gm,ig=/^(---|\+\+\+)\s+([^\t\r\n]+)/,ib=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,iv=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,iy=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,iw="header-prefix",ix="header-metadata",ik="header-custom",iS={dark:"pierre-dark",light:"pierre-light"},iC="--diffs-scrollbar-gutter-measured",iA={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...iA,hunkLineCount:1});let iE=Object.freeze({fromStart:0,fromEnd:0}),iL={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},i_={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};function iN(e){return e.replace(/\n$|\r\n$/,"")}let iT=new TextEncoder,iR=new TextDecoder("utf-8",{ignoreBOM:!0}),iM=/[\uD800-\uDFFF]/,iP=new Uint8Array(1024);function iI(){1024!==iP.length&&(iP=new Uint8Array(1024))}function iD(e){if(0===e.length)return e;if(iM.test(e))return JSON.parse(JSON.stringify(e));let t=3*e.length;iP.length<t&&(iP=new Uint8Array(t));let{written:n}=iT.encodeInto(e,iP);return iR.decode(iP.subarray(0,n))}function ij(e,{cacheKey:t,isGitDiff:n=im.test(e),oldFile:r,newFile:i,throwOnError:o=!1}={}){let a,s=0,l=iG(e,"@@ "),d=null==r||null==i,u=0,c=0;for(let e of l){let l,f,p=iO(e),m=p[0];if(null==m){if(o)throw Error("parsePatchContent: invalid hunk");console.error("parsePatchContent: invalid hunk",e);continue}let g=iU(m),b=0,v=0;if(null==g||null==a){if(null!=a){if(o)throw Error("parsePatchContent: Invalid hunk");console.error("parsePatchContent: Invalid hunk",e);continue}for(let e of(1===(a={name:"",type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:d,additionLines:d||null==r||null==i?[]:i$(i.contents),deletionLines:d||null==r||null==i?[]:i$(r.contents),cacheKey:iq(t)}).additionLines.length&&i?.contents===""&&(a.additionLines.length=0),1===a.deletionLines.length&&r?.contents===""&&(a.deletionLines.length=0),p)){if(e.startsWith("diff --git")){let t=e.trim().match(iv),n=t?.[1]??t?.[2],r=t?.[3]??t?.[4];if(null==n||null==r){if(o)throw Error("parsePatchContent: invalid git diff header");console.error("parsePatchContent: invalid git diff header",e);continue}a.name=iD(r.trim()),n!==r&&(a.prevName=iD(n.trim()));continue}let t=e.startsWith("---")||e.startsWith("+++")?e.match(n?ib:ig):null;if(null!=t){let[,e,n]=t;if("---"===e&&"/dev/null"!==n){let e=iD(n.trim());a.prevName=e,a.name=e}else"+++"===e&&"/dev/null"!==n&&(a.name=iD(n.trim()))}else if(n){if(e.startsWith("new mode ")&&(a.mode=iD(e.slice(8).trim())),e.startsWith("old mode ")&&(a.prevMode=iD(e.slice(8).trim())),e.startsWith("new file mode")&&(a.type="new",a.mode=iD(e.slice(13).trim())),e.startsWith("deleted file mode")&&(a.type="deleted",a.mode=iD(e.slice(17).trim())),e.startsWith("similarity index")&&(e.startsWith("similarity index 100%")?a.type="rename-pure":a.type="rename-changed"),e.startsWith("index ")){let[,t,n,r]=e.trim().match(iy)??[];null!=t&&(a.prevObjectId=iD(t)),null!=n&&(a.newObjectId=iD(n)),null!=r&&(a.mode=iD(r))}e.startsWith("rename from ")&&(a.prevName=iD(e.slice(12).trim())),e.startsWith("rename to ")&&(a.name=iD(e.slice(10).trim()))}}continue}for(;p.length>0&&("\n"===p[p.length-1]||"\r"===p[p.length-1]||"\r\n"===p[p.length-1]||""===p[p.length-1]);)p.pop();let{additionStart:y,deletionStart:w}=g;u=d?u:w-1,c=d?c:y-1;let x={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:g.additionCount,additionStart:y,additionLines:b,deletionCount:g.deletionCount,deletionStart:w,deletionLines:v,deletionLineIndex:u,additionLineIndex:c,hunkContent:[],hunkContext:iq(g.hunkContext),hunkSpecs:iD(m),noEOFCRAdditions:!1,noEOFCRDeletions:!1},k=0,S=0;for(let e=1;e<p.length;e++){var h;let t=p[e];if(k>=x.additionCount&&S>=x.deletionCount&&!t.startsWith("\\")){if(o&&function(e){let t=e[0];return"+"===t||"-"===t||" "===t}(t)&&!function(e){if(!e.startsWith("--"))return!1;for(let t=2;t<e.length;t++){let n=e[t];if(" "!==n&&" "!==n&&"\n"!==n&&"\r"!==n)return!1}return!0}(t))throw Error("parsePatchContent: hunk has more lines than expected");break}let n=t[0];if("+"!==n&&"-"!==n&&" "!==n&&"\\"!==n){if(o)throw Error("parsePatchContent: invalid hunk line");console.error(`parseLineType: Invalid firstChar: "${n}", full line: "${t}"`),console.error("processFile: invalid rawLine:",t);continue}let r=" "===(h=n)?"context":"\\"===h?"metadata":"+"===h?"addition":"deletion";if("addition"===r){if(o&&k>=x.additionCount)throw Error("parsePatchContent: hunk has too many addition lines");let e=iV(t);(null==l||"change"!==l.type)&&(l=iX("change",u,c),x.hunkContent.push(l)),c++,k++,d&&a.additionLines.push(e),l.additions++,b++,f="addition"}else if("deletion"===r){if(o&&S>=x.deletionCount)throw Error("parsePatchContent: hunk has too many deletion lines");let e=iV(t);(null==l||"change"!==l.type)&&(l=iX("change",u,c),x.hunkContent.push(l)),u++,S++,d&&a.deletionLines.push(e),l.deletions++,v++,f="deletion"}else if("context"===r){if(o&&(S>=x.deletionCount||k>=x.additionCount))throw Error("parsePatchContent: hunk has too many context lines");let e=iV(t);(null==l||"context"!==l.type)&&(l=iX("context",u,c),x.hunkContent.push(l)),c++,u++,k++,S++,d&&(a.deletionLines.push(e),a.additionLines.push(e)),l.lines++,f="context"}else if("metadata"===r&&null!=l){if("context"===l.type?(x.noEOFCRAdditions=!0,x.noEOFCRDeletions=!0):"deletion"===f?x.noEOFCRDeletions=!0:"addition"===f&&(x.noEOFCRAdditions=!0),d&&("addition"===f||"context"===f)){let e=a.additionLines.length-1;e>=0&&(a.additionLines[e]=iN(a.additionLines[e]))}if(d&&("deletion"===f||"context"===f)){let e=a.deletionLines.length-1;e>=0&&(a.deletionLines[e]=iN(a.deletionLines[e]))}}}if(o&&(k!==x.additionCount||S!==x.deletionCount))throw Error("parsePatchContent: hunk line count mismatch");for(let e of(x.additionLines=b,x.deletionLines=v,x.collapsedBefore=Math.max(x.additionStart-1-s,0),a.hunks.push(x),s=x.additionStart+x.additionCount-1,x.hunkContent))"context"===e.type?(x.splitLineCount+=e.lines,x.unifiedLineCount+=e.lines):(x.splitLineCount+=Math.max(e.additions,e.deletions),x.unifiedLineCount+=e.deletions+e.additions);x.splitLineStart=a.splitLineCount+x.collapsedBefore,x.unifiedLineStart=a.unifiedLineCount+x.collapsedBefore,a.splitLineCount+=x.collapsedBefore+x.splitLineCount,a.unifiedLineCount+=x.collapsedBefore+x.unifiedLineCount}if(null!=a){if(o&&d&&!n&&0===a.hunks.length)throw Error("parsePatchContent: unified file has no hunks");if(a.hunks.length>0&&!d&&a.additionLines.length>0&&a.deletionLines.length>0){let e=a.hunks[a.hunks.length-1],t=e.additionStart+e.additionCount-1,n=Math.max(a.additionLines.length-t,0);a.splitLineCount+=n,a.unifiedLineCount+=n}return n||(null!=a.prevName&&a.name!==a.prevName?a.hunks.length>0?a.type="rename-changed":a.type="rename-pure":(null==r||""===r.contents)&&null!=i&&""!==i.contents?a.type="new":null!=r&&""!==r.contents&&(null==i||""===i.contents)&&(a.type="deleted")),"rename-pure"!==a.type&&"rename-changed"!==a.type&&(a.prevName=void 0),a}}function i$(e){let t=iO(e);for(let e=0;e<t.length;e++)t[e]=iD(t[e]);return t}function iO(e){if(0===e.length)return[""];let t=[],n=0;for(;;){let r=e.indexOf("\n",n);if(-1===r)break;t.push(e.slice(n,r+1)),n=r+1}return n<e.length&&t.push(e.slice(n)),t}function iz(e,t){let n=iH(e,t);return iB(e,t,"---")&&iB(e,n,"+++")}function iB(e,t,n){if(!e.startsWith(n,t))return!1;let r=e[t+n.length];if(" "!==r&&" "!==r)return!1;for(let r=t+n.length+1;r<e.length;r++){let t=e[r];if("\n"===t||"\r"===t)break;if(" "!==t&&" "!==t)return!0}return!1}function iH(e,t){let n=e.indexOf("\n",t);return -1===n?e.length:n+1}function iU(e){var t;let n;if(!e.startsWith("@@ -"))return;let r=4,i=iF(e,4);if(null==i)return;let o=i.value;r=i.endIndex;let a=1;if(","===e[r]){let t=iF(e,r+1);if(null==t)return;a=t.value,r=t.endIndex}if(" "!==e[r]||"+"!==e[r+1])return;let s=iF(e,r+=2);if(null==s)return;let l=s.value;r=s.endIndex;let d=1;if(","===e[r]){let t=iF(e,r+1);if(null==t)return;d=t.value,r=t.endIndex}if(" "!==e[r]||"@"!==e[r+1]||"@"!==e[r+2])return;let u=r+3;return" "===e[u]&&(n=(t=e.slice(u+1)).endsWith("\r\n")?t.slice(0,-2):t.endsWith("\n")?t.slice(0,-1):t),{additionCount:d,additionStart:l,deletionCount:a,deletionStart:o,hunkContext:n}}function iF(e,t){let n=t,r=0;for(;n<e.length;n++){let t=e.charCodeAt(n)-48;if(t<0||t>9)break;r=10*r+t}if(n!==t)return{value:r,endIndex:n}}function iG(e,t){if(0===e.length)return[""];let n=`
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,82747,(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,o=l(e),a=o[0],s=o[1],d=new i((a+s)*3/4-s),u=0,c=s>0?a-4:a;for(n=0;n<c;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[u++]=t>>16&255,d[u++]=t>>8&255,d[u++]=255&t;return 2===s&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,d[u++]=255&t),1===s&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,d[u++]=t>>8&255,d[u++]=255&t),d},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;a<s;a+=16383)o.push(function(e,t,r){for(var i,o=[],a=t;a<r;a+=3)i=(e[a]<<16&0xff0000)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(n[i>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}(e,a,a+16383>s?s:a+16383));return 1===i?o.push(n[(t=e[r-1])>>2]+n[t<<4&63]+"=="):2===i&&o.push(n[(t=(e[r-2]<<8)+e[r-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),o.join("")};for(var n=[],r=[],i="u">typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a<s;++a)n[a]=o[a],r[o.charCodeAt(a)]=a;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),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(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 u(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"),!s.isEncoding(i))throw TypeError("Unknown encoding: "+i);var o=0|f(r,i),l=a(o),d=l.write(r,i);return d!==o&&(l=l.slice(0,d)),l}if(ArrayBuffer.isView(e))return c(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(N(e,ArrayBuffer)||e&&N(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(N(e,SharedArrayBuffer)||e&&N(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),s.prototype),r}(e,t,n);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var u=e.valueOf&&e.valueOf();if(null!=u&&u!==e)return s.from(u,t,n);var p=function(e){if(s.isBuffer(e)){var t=0|h(e.length),n=a(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)?a(0):c(e):"Buffer"===e.type&&Array.isArray(e.data)?c(e.data):void 0}(e);if(p)return p;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.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 u(e){return d(e),a(e<0?0:0|h(e))}function c(e){for(var t=e.length<0?0:0|h(e.length),n=a(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}t.Buffer=s,t.SlowBuffer=function(e){return+e!=e&&(e=0),s.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,s.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}}(),!s.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(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(e,t,n){return l(e,t,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(e,t,n){return(d(e),e<=0)?a(e):void 0!==t?"string"==typeof n?a(e).fill(t,n):a(e).fill(t):a(e)},s.allocUnsafe=function(e){return u(e)},s.allocUnsafeSlow=function(e){return u(e)};function h(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function f(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||N(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 A(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return L(e).length;default:if(i)return r?-1:A(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,n){var i,o,a,s=!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="",o=t;o<n;++o)i+=T[e[o]];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,o=t,a=n,0===o&&a===i.length?r.fromByteArray(i):r.fromByteArray(i.slice(o,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}(this,t,n);default:if(s)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),s=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function g(e,t,n,r,i){var o;if(0===e.length)return -1;if("string"==typeof n?(r=n,n=0):n>0x7fffffff?n=0x7fffffff:n<-0x80000000&&(n=-0x80000000),(o=n*=1)!=o&&(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=s.from(t,r)),s.isBuffer(t))return 0===t.length?-1:b(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 b(e,[t],n,r,i)}throw TypeError("val must be string, number or Buffer")}function b(e,t,n,r,i){var o,a=1,s=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;a=2,s/=2,l/=2,n/=2}function d(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var u=-1;for(o=n;o<s;o++)if(d(e,o)===d(t,-1===u?0:o-u)){if(-1===u&&(u=o),o-u+1===l)return u*a}else -1!==u&&(o-=o-u),u=-1}else for(n+l>s&&(n=s-l),o=n;o>=0;o--){for(var c=!0,h=0;h<l;h++)if(d(e,o+h)!==d(t,h)){c=!1;break}if(c)return o}return -1}s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(N(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),N(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.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,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:+(r<n)},s.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}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);if(void 0===t)for(n=0,t=0;n<e.length;++n)t+=e[n].length;var n,r=s.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(N(o,Uint8Array)&&(o=s.from(o)),!s.isBuffer(o))throw TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},s.byteLength=f,s.prototype._isBuffer=!0,s.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)m(this,t,t+1);return this},s.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)m(this,t,t+3),m(this,t+1,t+2);return this},s.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)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},s.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?v(this,0,e):p.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.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+">"},o&&(s.prototype[o]=s.prototype.inspect),s.prototype.compare=function(e,t,n,r,i){if(N(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.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 o=i-r,a=n-t,l=Math.min(o,a),d=this.slice(r,i),u=e.slice(t,n),c=0;c<l;++c)if(d[c]!==u[c]){o=d[c],a=u[c];break}return o<a?-1:+(a<o)},s.prototype.includes=function(e,t,n){return -1!==this.indexOf(e,t,n)},s.prototype.indexOf=function(e,t,n){return g(this,e,t,n,!0)},s.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 o,a,s,l,d=e[i],u=null,c=d>239?4:d>223?3:d>191?2:1;if(i+c<=n)switch(c){case 1:d<128&&(u=d);break;case 2:(192&(o=e[i+1]))==128&&(l=(31&d)<<6|63&o)>127&&(u=l);break;case 3:o=e[i+1],a=e[i+2],(192&o)==128&&(192&a)==128&&(l=(15&d)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],(192&o)==128&&(192&a)==128&&(192&s)==128&&(l=(15&d)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,c=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),i+=c}var h=r,f=h.length;if(f<=4096)return String.fromCharCode.apply(String,h);for(var p="",m=0;m<f;)p+=String.fromCharCode.apply(String,h.slice(m,m+=4096));return p}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 w(e,t,n,r,i,o){if(!s.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw RangeError('"value" argument is out of bounds');if(n+r>e.length)throw RangeError("Index out of range")}function x(e,t,n,r,i,o){if(n+r>e.length||n<0)throw RangeError("Index out of range")}function k(e,t,n,r,o){return t*=1,n>>>=0,o||x(e,t,n,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,n,r,23,4),n+4}function S(e,t,n,r,o){return t*=1,n>>>=0,o||x(e,t,n,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,n,r,52,8),n+8}s.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,o,a,s,l,d,u,c,h=this.length-t;if((void 0===n||n>h)&&(n=h),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var f=!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 o=t.length;r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s,l=parseInt(t.substr(2*a,2),16);if((s=l)!=s)break;e[n+a]=l}return a}(this,e,t,n);case"utf8":case"utf-8":return i=t,o=n,_(A(e,this.length-i),this,i,o);case"ascii":return a=t,s=n,_(E(e),this,a,s);case"latin1":case"binary":return function(e,t,n,r){return _(E(t),e,n,r)}(this,e,t,n);case"base64":return l=t,d=n,_(L(e),this,l,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u=t,c=n,_(function(e,t){for(var n,r,i=[],o=0;o<e.length&&!((t-=2)<0);++o)r=(n=e.charCodeAt(o))>>8,i.push(n%256),i.push(r);return i}(e,this.length-u),this,u,c);default:if(f)throw TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),f=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.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,s.prototype),r},s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||y(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},s.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},s.prototype.readUInt8=function(e,t){return e>>>=0,t||y(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]<<8|this[e+1]},s.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]},s.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])},s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||y(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||y(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},s.prototype.readInt8=function(e,t){return(e>>>=0,t||y(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},s.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},s.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},s.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},s.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]},s.prototype.readFloatLE=function(e,t){return e>>>=0,t||y(e,4,this.length),i.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||y(e,4,this.length),i.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||y(e,8,this.length),i.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||y(e,8,this.length),i.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,n,r){if(e*=1,t>>>=0,n>>>=0,!r){var i=Math.pow(2,8*n)-1;w(this,e,t,n,i,0)}var o=1,a=0;for(this[t]=255&e;++a<n&&(o*=256);)this[t+a]=e/o&255;return t+n},s.prototype.writeUIntBE=function(e,t,n,r){if(e*=1,t>>>=0,n>>>=0,!r){var i=Math.pow(2,8*n)-1;w(this,e,t,n,i,0)}var o=n-1,a=1;for(this[t+o]=255&e;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+n},s.prototype.writeUInt8=function(e,t,n){return e*=1,t>>>=0,n||w(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,n){return e*=1,t>>>=0,n||w(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUInt16BE=function(e,t,n){return e*=1,t>>>=0,n||w(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUInt32LE=function(e,t,n){return e*=1,t>>>=0,n||w(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},s.prototype.writeUInt32BE=function(e,t,n){return e*=1,t>>>=0,n||w(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},s.prototype.writeIntLE=function(e,t,n,r){if(e*=1,t>>>=0,!r){var i=Math.pow(2,8*n-1);w(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<n&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e*=1,t>>>=0,!r){var i=Math.pow(2,8*n-1);w(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e*=1,t>>>=0,n||w(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){return e*=1,t>>>=0,n||w(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e*=1,t>>>=0,n||w(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,n){return e*=1,t>>>=0,n||w(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},s.prototype.writeInt32BE=function(e,t,n){return e*=1,t>>>=0,n||w(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},s.prototype.writeFloatLE=function(e,t,n){return k(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return k(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return S(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return S(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.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 o=i-1;o>=0;--o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,r),t);return i},s.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&&!s.isEncoding(r))throw TypeError("Unknown encoding: "+r);if(1===e.length){var i,o=e.charCodeAt(0);("utf8"===r&&o<128||"latin1"===r)&&(e=o)}}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 a=s.isBuffer(e)?e:s.from(e,r),l=a.length;if(0===l)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=a[i%l]}return this};var C=/[^+/0-9A-Za-z-_]/g;function A(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319||a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else if(n<1114112){if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}else throw Error("Invalid code point")}return o}function E(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}function L(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(C,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function _(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 N(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var T=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 o,a,s=8*i-r-1,l=(1<<s)-1,d=l>>1,u=-7,c=n?i-1:0,h=n?-1:1,f=e[t+c];for(c+=h,o=f&(1<<-u)-1,f>>=-u,u+=s;u>0;o=256*o+e[t+c],c+=h,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=r;u>0;a=256*a+e[t+c],c+=h,u-=8);if(0===o)o=1-d;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),o-=d}return(f?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,l,d=8*o-i-1,u=(1<<d)-1,c=u>>1,h=5960464477539062e-23*(23===i),f=r?0:o-1,p=r?1:-1,m=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(s=+!!isNaN(t),a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+c>=1?t+=h/l:t+=h*Math.pow(2,1-c),t*l>=2&&(a++,l/=2),a+c>=u?(s=0,a=u):a+c>=1?(s=(t*l-1)*Math.pow(2,i),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;e[n+f]=255&s,f+=p,s/=256,i-=8);for(a=a<<i|s,d+=i;d>0;e[n+f]=255&a,f+=p,a/=256,d-=8);e[n+f-p]|=128*m}}},i={};function o(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}},a=!0;try{r[e](n,n.exports,o),a=!1}finally{a&&delete i[e]}return n.exports}o.ab="/ROOT/node_modules/.pnpm/next@16.2.10_@playwright+test@1.61.1_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/next/dist/compiled/buffer/",t.exports=o(72)},4135,(e,t,n)=>{e.e,function(e){let t=Symbol("newer"),n=Symbol("older");class r{constructor(e,t){"number"!=typeof e&&(t=e,e=0),this.size=0,this.limit=e,this.oldest=this.newest=void 0,this._keymap=new Map,t&&(this.assign(t),e<1&&(this.limit=this.size))}_markEntryAsUsed(e){e!==this.newest&&(e[t]&&(e===this.oldest&&(this.oldest=e[t]),e[t][n]=e[n]),e[n]&&(e[n][t]=e[t]),e[t]=void 0,e[n]=this.newest,this.newest&&(this.newest[t]=e),this.newest=e)}assign(e){let r,o=this.limit||Number.MAX_VALUE;this._keymap.clear();let a=e[Symbol.iterator]();for(let e=a.next();!e.done;e=a.next()){let a=new i(e.value[0],e.value[1]);if(this._keymap.set(a.key,a),r?(r[t]=a,a[n]=r):this.oldest=a,r=a,0==o--)throw Error("overflow")}this.newest=r,this.size=this._keymap.size}get(e){var t=this._keymap.get(e);return t?(this._markEntryAsUsed(t),t.value):void 0}set(e,r){var o=this._keymap.get(e);return o?(o.value=r,this._markEntryAsUsed(o)):(this._keymap.set(e,o=new i(e,r)),this.newest?(this.newest[t]=o,o[n]=this.newest):this.oldest=o,this.newest=o,++this.size,this.size>this.limit&&this.shift()),this}shift(){var e=this.oldest;if(e)return this.oldest[t]?(this.oldest=this.oldest[t],this.oldest[n]=void 0):(this.oldest=void 0,this.newest=void 0),e[t]=e[n]=void 0,this._keymap.delete(e.key),--this.size,[e.key,e.value]}find(e){let t=this._keymap.get(e);return t?t.value:void 0}has(e){return this._keymap.has(e)}delete(e){var r=this._keymap.get(e);return r?(this._keymap.delete(r.key),r[t]&&r[n]?(r[n][t]=r[t],r[t][n]=r[n]):r[t]?(r[t][n]=void 0,this.oldest=r[t]):r[n]?(r[n][t]=void 0,this.newest=r[n]):this.oldest=this.newest=void 0,this.size--,r.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new a(this.oldest)}values(){return new s(this.oldest)}entries(){return this}[Symbol.iterator](){return new o(this.oldest)}forEach(e,n){"object"!=typeof n&&(n=this);let r=this.oldest;for(;r;)e.call(n,r.value,r.key,this),r=r[t]}toJSON(){for(var e=Array(this.size),n=0,r=this.oldest;r;)e[n++]={key:r.key,value:r.value},r=r[t];return e}toString(){for(var e="",n=this.oldest;n;)e+=String(n.key)+":"+n.value,(n=n[t])&&(e+=" < ");return e}}function i(e,r){this.key=e,this.value=r,this[t]=void 0,this[n]=void 0}function o(e){this.entry=e}function a(e){this.entry=e}function s(e){this.entry=e}e.LRUMap=r,o.prototype[Symbol.iterator]=function(){return this},o.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:[e.key,e.value]}):{done:!0,value:void 0}},a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:e.key}):{done:!0,value:void 0}},s.prototype[Symbol.iterator]=function(){return this},s.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:e.value}):{done:!0,value:void 0}}}(n)},53567,e=>{"use strict";let t,n,r,i,o,a,s,l,d,u;var c,h,f,p,m=e.i(46369),g=e.i(19594);function b(...e){return e.filter(Boolean).join(" ")}function v({variant:e="primary",size:t="md",class:n}={}){return b({primary:"btn-primary",secondary:"btn-action",outline:"btn-action",ghost:"inline-flex items-center justify-center gap-1.5 rounded px2 py1 op75 hover:op100 hover:bg-active transition disabled:pointer-events-none disabled:op30!",destructive:"btn-action text-error border-error/30!",link:"inline-flex items-center gap-1.5 color-active hover:underline underline-offset-2"}[e],"sm"===t?"primary"===e?"text-sm px-2.5! py-1!":"text-sm":"lg"===t?"text-base px-4! py-2!":"",n)}var y=e.i(85053);let w="__connection.json",x="devframe_otp",k=function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return"string"===n&&"string"===r?e.localeCompare(t):"number"===n&&"number"===r?e-t:String.prototype.localeCompare.call(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(null===e)return"null";switch(typeof e){case"string":return t?e:`'${e}'`;case"bigint":return`${e}n`;case"object":return this.$object(e);case"function":return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if("[object Object]"!==t)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||void 0===n?"":n.name;if(""!==r&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if("function"==typeof e.toJSON){let t=e.toJSON();return r+(null!==t&&"object"==typeof t?this.$object(t):`(${this.serialize(t)})`)}return this.serializeObjectEntries(r,Object.entries(e))}serializeBuiltInType(e,t){let n=this["$"+e];if(n)return n.call(this,t);if("function"==typeof t?.entries)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=",")}return r+"}"}$object(e){let t=this.#e.get(e);return void 0===t&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return"[native code] }"===t.slice(-15)?`${e.name||""}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,"")}`}$Array(e){let t="[";for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=",");return t+"]"}$Date(e){try{return`Date(${e.toISOString()})`}catch{return"Date(null)"}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(",")}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries("Map",e.entries())}}for(let t of["Error","RegExp","URL"])e.prototype["$"+t]=function(e){return`${t}(${e})`};for(let t of["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"])e.prototype["$"+t]=function(e){return`${t}[${e.join(",")}]`};for(let t of["BigInt64Array","BigUint64Array"])e.prototype["$"+t]=function(e){return`${t}[${e.join("n,")}${e.length>0?"n":""}]`};return e}(),S=[0x6a09e667,-0x4498517b,0x3c6ef372,-0x5ab00ac6,0x510e527f,-0x64fa9774,0x1f83d9ab,0x5be0cd19],C=[0x428a2f98,0x71374491,-0x4a3f0431,-0x164a245b,0x3956c25b,0x59f111f1,-0x6dc07d5c,-0x54e3a12b,-0x27f85568,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,-0x7f214e02,-0x6423f959,-0x3e640e8c,-0x1b64963f,-0x1041b87a,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,-0x67c1aeae,-0x57ce3993,-0x4ffcd838,-0x40a68039,-0x391ff40d,-0x2a586eb9,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,-0x7e3d36d2,-0x6d8dd37b,-0x5d40175f,-0x57e599b5,-0x3db47490,-0x3893ae5d,-0x2e6d17e7,-0x2966f9dc,-0xbf1ca7b,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,-0x7b3787ec,-0x7338fdf8,-0x6f410006,-0x5baf9315,-0x41065c09,-0x398e870e],A=[];class E{_data=new L;_hash=new L([...S]);_nDataBytes=0;_minBufferSize=0;finalize(e){e&&this._append(e);let t=8*this._nDataBytes,n=8*this._data.sigBytes;return this._data.words[n>>>5]|=128<<24-n%32,this._data.words[(n+64>>>9<<4)+14]=Math.floor(t/0x100000000),this._data.words[(n+64>>>9<<4)+15]=t,this._data.sigBytes=4*this._data.words.length,this._process(),this._hash}_doProcessBlock(e,t){let n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],d=n[6],u=n[7];for(let n=0;n<64;n++){if(n<16)A[n]=0|e[t+n];else{let e=A[n-15],t=(e<<25|e>>>7)^(e<<14|e>>>18)^e>>>3,r=A[n-2],i=(r<<15|r>>>17)^(r<<13|r>>>19)^r>>>10;A[n]=t+A[n-7]+i+A[n-16]}let c=s&l^~s&d,h=r&i^r&o^i&o,f=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),p=u+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+c+C[n]+A[n],m=f+h;u=d,d=l,l=s,s=a+p|0,a=o,o=i,i=r,r=p+m|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+l|0,n[6]=n[6]+d|0,n[7]=n[7]+u|0}_append(e){"string"==typeof e&&(e=L.fromUtf8(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_process(e){let t,n=this._data.sigBytes/64,r=16*(n=e?Math.ceil(n):Math.max((0|n)-this._minBufferSize,0)),i=Math.min(4*r,this._data.sigBytes);if(r){for(let e=0;e<r;e+=16)this._doProcessBlock(this._data.words,e);t=this._data.words.splice(0,r),this._data.sigBytes-=i}return new L(t,i)}}class L{words;sigBytes;constructor(e,t){e=this.words=e||[],this.sigBytes=void 0===t?4*e.length:t}static fromUtf8(e){let t=unescape(encodeURIComponent(e)),n=t.length,r=[];for(let e=0;e<n;e++)r[e>>>2]|=(255&t.charCodeAt(e))<<24-e%4*8;return new L(r,n)}toBase64(){let e=[];for(let t=0;t<this.sigBytes;t+=3){let n=(this.words[t>>>2]>>>24-t%4*8&255)<<16|(this.words[t+1>>>2]>>>24-(t+1)%4*8&255)<<8|this.words[t+2>>>2]>>>24-(t+2)%4*8&255;for(let r=0;r<4&&8*t+6*r<8*this.sigBytes;r++)e.push("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".charAt(n>>>6*(3-r)&63))}return e.join("")}concat(e){if(this.words[this.sigBytes>>>2]&=0xffffffff<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4),this.sigBytes%4)for(let t=0;t<e.sigBytes;t++){let n=e.words[t>>>2]>>>24-t%4*8&255;this.words[this.sigBytes+t>>>2]|=n<<24-(this.sigBytes+t)%4*8}else for(let t=0;t<e.sigBytes;t+=4)this.words[this.sigBytes+t>>>2]=e.words[t>>>2];this.sigBytes+=e.sigBytes}}function _(e){var t;return t="string"==typeof e?`'${e}'`:new k().serialize(e),new E().finalize(t).toBase64()}class N{cacheMap=new Map;options;keySerializer;constructor(e){this.options=e,this.keySerializer=e.keySerializer||(e=>_(e))}updateOptions(e){this.options={...this.options,...e}}cached(e,t){let n=this.cacheMap.get(e);if(n)return n.get(this.keySerializer(t))}has(e,t){return this.cacheMap.get(e)?.has(this.keySerializer(t))??!1}apply(e,t){let n=this.cacheMap.get(e.m)||new Map;n.set(this.keySerializer(e.a),t),this.cacheMap.set(e.m,n)}validate(e){return this.options.functions.includes(e)}clear(e){e?this.cacheMap.delete(e):this.cacheMap.clear()}}function T(e,...t){return"function"==typeof e?e(...t):e}let R=Error.captureStackTrace;var M=class e extends Error{name="Diagnostic";docs;fix;sources;get why(){return this.message}constructor(t,n=e){super(t.why,{cause:t.cause}),this.fix=t.fix,this.docs=t.docs,this.sources=t.sources,R?.(this,n)}toJSON(){return{name:this.name,why:this.why,fix:this.fix,docs:this.docs,sources:this.sources,cause:this.cause,stack:this.stack}}};function P(e,t){let n=`\x1b[${e}m`,r=`\x1b[${t}m`;return(e,...t)=>{if(Array.isArray(e)&&"raw"in e){let i="";for(let n=0;n<e.length;n++)i+=e[n],n<t.length&&(i+=String(t[n]));return`${n}${i}${r}`}return`${n}${String(e)}${r}`}}let I={blue:P(34,39),cyan:P(36,39),gray:P(90,39),green:P(32,39),red:P(31,39),yellow:P(33,39),bold:P(1,22),dim:P(2,22),reset:P(0,0),underline:P(4,24)},D=e=>{let t=`${I.bold(I.red(`[${e.name}]`))} ${e.message}`,n=[];return(e.fix&&n.push(`${I.dim("fix:")} ${e.fix}`),e.sources?.length&&n.push(`${I.dim("sources:")} ${e.sources.join(", ")}`),e.docs&&n.push(`${I.dim("see:")} ${I.cyan(e.docs)}`),0===n.length)?t:[t,...n.map((e,t)=>`${I.dim(t<n.length-1?"├▶":"╰▶")} ${e}`)].join("\n")},j=function(e){let t=e.reporters??[],n={},{docsBase:r}=e;for(let i of Object.keys(e.codes)){let o=e.codes[i],a=!1===o.docs?void 0:o.docs||("string"==typeof r?`${r}/${i.toLowerCase()}`:r?.(i)),s=(e={},n={})=>{let r=new M({why:T(o.why,e),fix:T(o.fix,e),docs:a,cause:e.cause,sources:e.sources},s);for(let e of(r.name=i,t))e(r,n);return r};n[i]=s}return n}({docsBase:"https://devfra.me/errors",reporters:[function(e,{method:t="warn"}={}){console[t](D(e))}],codes:{DF0019:{why:e=>`RPC function "${e.name}" has \`agent\` set but \`jsonSerializable\` is not \`true\` — MCP requires JSON-serializable data.`,fix:"Set `jsonSerializable: true` if the payload is JSON-safe, or remove `agent` to keep it RPC-only."},DF0020:{why:e=>`RPC function "${e.name}" declares \`jsonSerializable: true\` but the value at "${e.path}" is a ${e.type}.`,fix:"Either drop `jsonSerializable: true` (falls back to structured-clone) or change the value to a JSON-safe shape."},DF0021:{why:e=>`RPC function "${e.name}" is already registered`,fix:"Use the `force` parameter to overwrite an existing registration."},DF0022:{why:e=>`RPC function "${e.name}" is not registered. Use register() to add new functions.`},DF0023:{why:e=>`RPC function "${e.name}" is not registered`},DF0024:{why:e=>`Either handler or setup function must be provided for RPC function "${e.name}"`},DF0025:{why:e=>`Function "${e.name}" not found in dump store`},DF0026:{why:e=>`No dump match for "${e.name}" with args: ${e.args}`},DF0027:{why:e=>`Function "${e.name}" with type "${e.type}" cannot have dump configuration. Only "static" and "query" types support dumps.`},DF0028:{why:e=>`Function "${e.name}" with type "${e.type}" cannot use \`snapshot: true\`. Only "query" functions support this sugar; "static" functions have equivalent default behavior already.`,fix:"Remove `snapshot: true`, or change the function type to `query`."}}});async function $(e,t){if(!e.setup)return{};if("object"==typeof t&&null!==t){e.__cache??=new WeakMap;let n=e.__cache,r=n.get(t);return r||((r=Promise.resolve(e.setup(t))).catch(()=>{n.get(t)===r&&n.delete(t)}),n.set(t,r)),await r}if(!e.__promise){let n=Promise.resolve(e.setup(t));n.catch(()=>{e.__promise===n&&(e.__promise=void 0)}),e.__promise=n}return await e.__promise}async function O(e,t){if(e.handler)return e.handler;let n=await $(e,t);if(!n.handler)throw j.DF0024({name:e.name});return n.handler}class z{context;definitions;functions;_onChanged;constructor(e){this.context=e,this.definitions=new Map,this._onChanged=[];const t=this.definitions,n=this;this.functions=new Proxy({},{get(e,r){let i=t.get(r);if(i)return O(i,n.context)},has:(e,n)=>t.has(n),getOwnPropertyDescriptor:(e,n)=>({value:t.get(n)?.handler,configurable:!0,enumerable:!0}),ownKeys:()=>Array.from(t.keys())})}register(e,t=!1){if(this.definitions.has(e.name)&&!t)throw j.DF0021({name:e.name});B(e),this.definitions.set(e.name,e),this._onChanged.forEach(t=>t(e.name))}update(e,t=!1){if(!this.definitions.has(e.name)&&!t)throw j.DF0022({name:e.name});B(e),this.definitions.set(e.name,e),this._onChanged.forEach(t=>t(e.name))}onChanged(e){return this._onChanged.push(e),()=>{let t=this._onChanged.indexOf(e);-1!==t&&this._onChanged.splice(t,1)}}async getHandler(e){return await O(this.definitions.get(e),this.context)}getSchema(e){let t=this.definitions.get(e);if(!t)throw j.DF0023({name:String(e)});return{args:t.args,returns:t.returns}}has(e){return this.definitions.has(e)}get(e){return this.definitions.get(e)}list(){return Array.from(this.definitions.keys())}}function B(e){if(e.agent&&!0!==e.jsonSerializable)throw j.DF0019({name:e.name})}function H(){let e={};function t(n,...r){let i=e[n]||[];for(let e=0,t=i.length;e<t;e++){let t=i[e];t&&t(...r)}}function n(t,n){return(e[t]||=[]).push(n),()=>{e[t]=e[t]?.filter(e=>n!==e)}}return{_listeners:e,emit:t,emitOnce:function(n,...r){t(n,...r),delete e[n]},on:n,once:function(e,t){let r=n(e,(...e)=>(r(),t(...e)));return r}}}let U=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,F=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,G=/^([/\\]\s*){2,}[^/\\]/,W=/\/$|\/\?|\/#/,q=/^\.?\//;function V(e,t){var n;if(!(n=t)||"/"===n||function(e,t={}){return("boolean"==typeof t&&(t={acceptRelative:t}),t.strict)?U.test(e):F.test(e)||!!t.acceptRelative&&G.test(e)}(e))return e;let r=function(e=""){return(!function(e=""){return e.endsWith("/")}(e)?e:e.slice(0,-1))||"/"}(t);if(e.startsWith(r)){let t=e[r.length];if(!t||"/"===t||"?"===t)return e}return function(e,...t){let n=e||"";for(let e of t.filter(e=>e&&"/"!==e))if(n){let t=e.replace(q,"");n=function(e=""){return e.endsWith("/")?e:e+"/"}(n)+t}else n=e;return n}(r,e)}async function X(e,t={}){let n=function(e=x){let t=function(e=x){try{return new URLSearchParams(globalThis.location?.search).get(e)||void 0}catch{return}}(e);return t&&function(e){try{let t=new URL(globalThis.location.href);if(!t.searchParams.has(e))return;t.searchParams.delete(e),globalThis.history?.replaceState(globalThis.history.state,"",t.href)}catch{}}(e),t}(t.param??x);return!!n&&(!!e.isTrusted||e.requestTrustWithCode(n))}Symbol.for("ufo:protocolRelative");var K=Symbol.for("immer-nothing"),Y=Symbol.for("immer-draftable"),J=Symbol.for("immer-state");function Q(e){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Z=Object,ee=Z.getPrototypeOf,et="constructor",en="prototype",er="configurable",ei="enumerable",eo="writable",ea="value",es=e=>!!e&&!!e[J];function el(e){return!!e&&(ec(e)||eb(e)||!!e[Y]||!!e[et]?.[Y]||ev(e)||ey(e))}var ed=Z[en][et].toString(),eu=new WeakMap;function ec(e){if(!e||!ew(e))return!1;let t=ee(e);if(null===t||t===Z[en])return!0;let n=Z.hasOwnProperty.call(t,et)&&t[et];if(n===Object)return!0;if(!ex(n))return!1;let r=eu.get(n);return void 0===r&&(r=Function.toString.call(n),eu.set(n,r)),r===ed}function eh(e,t,n=!0){0===ef(e)?(n?Reflect.ownKeys(e):Z.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function ef(e){let t=e[J];return t?t.type_:eb(e)?1:ev(e)?2:3*!!ey(e)}var ep=(e,t,n=ef(e))=>2===n?e.has(t):Z[en].hasOwnProperty.call(e,t),em=(e,t,n=ef(e))=>2===n?e.get(t):e[t],eg=(e,t,n,r=ef(e))=>{2===r?e.set(t,n):3===r?e.add(n):e[t]=n},eb=Array.isArray,ev=e=>e instanceof Map,ey=e=>e instanceof Set,ew=e=>"object"==typeof e,ex=e=>"function"==typeof e,ek=e=>e.modified_?e.copy_:e.base_;function eS(e,t){if(ev(e))return new Map(e);if(ey(e))return new Set(e);if(eb(e))return Array[en].slice.call(e);let n=ec(e);if(!0!==t&&("class_only"!==t||n)){let t=ee(e);if(null!==t&&n)return{...e};let r=Z.create(t);return Z.assign(r,e)}{let t=Z.getOwnPropertyDescriptors(e);delete t[J];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){let i=n[r],o=t[i];!1===o[eo]&&(o[eo]=!0,o[er]=!0),(o.get||o.set)&&(t[i]={[er]:!0,[eo]:!0,[ei]:o[ei],[ea]:e[i]})}return Z.create(ee(e),t)}}function eC(e,t=!1){return eE(e)||es(e)||!el(e)||(ef(e)>1&&Z.defineProperties(e,{set:eA,add:eA,clear:eA,delete:eA}),Z.freeze(e),t&&eh(e,(e,t)=>{eC(t,!0)},!1)),e}var eA={[ea]:function(){Q(2)}};function eE(e){return!(null!==e&&ew(e))||Z.isFrozen(e)}var eL="MapSet",e_="Patches",eN="ArrayMethods",eT={};function eR(e){let t=eT[e];return t||Q(0,e),t}var eM=e=>!!eT[e];function eP(e,t){t&&(e.patchPlugin_=eR(e_),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function eI(e){eD(e),e.drafts_.forEach(e$),e.drafts_=null}function eD(e){e===p&&(p=e.parent_)}var ej=e=>p={drafts_:[],parent_:p,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:eM(eL)?eR(eL):void 0,arrayMethodsPlugin_:eM(eN)?eR(eN):void 0};function e$(e){let t=e[J];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function eO(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(void 0!==e&&e!==n){n[J].modified_&&(eI(t),Q(4)),el(e)&&(e=ez(t,e));let{patchPlugin_:r}=t;r&&r.generateReplacementPatches_(n[J].base_,e,t)}else e=ez(t,n);return function(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&eC(t,n)}(t,e,!0),eI(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==K?e:void 0}function ez(e,t){if(eE(t))return t;let n=t[J];if(!n)return eW(t,e.handledSet_,e);if(!eH(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:t}=n;if(t)for(;t.length>0;)t.pop()(e);eG(n,e)}return n.copy_}function eB(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var eH=(e,t)=>e.scope_===t,eU=[];function eF(e,t,n,r){let i=e.copy_||e.base_,o=e.type_;if(void 0!==r&&em(i,r,o)===t)return void eg(i,r,n,o);if(!e.draftLocations_){let t=e.draftLocations_=new Map;eh(i,(e,n)=>{if(es(n)){let r=t.get(n)||[];r.push(e),t.set(n,r)}})}for(let r of e.draftLocations_.get(t)??eU)eg(i,r,n,o)}function eG(e,t){if(e.modified_&&!e.finalized_&&(3===e.type_||1===e.type_&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:n}=t;if(n){let r=n.getPath(e);r&&n.generatePatches_(e,r,t)}eB(e)}}function eW(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||es(e)||t.has(e)||!el(e)||eE(e)||(t.add(e),eh(e,(r,i)=>{if(es(i)){let t=i[J];eH(t,n)&&(eg(e,r,ek(t),e.type_),eB(t))}else el(i)&&eW(i,t,n)})),e}var eq={get(e,t){let n;if(t===J)return e;if("constructor"===t||"__proto__"===t)return new Proxy((e.copy_||e.base_)[t]||{},{get:(e,t)=>"__proto__"===t||"prototype"===t?Object.freeze(Object.create(null)):Reflect.get(e,t),set:()=>!0,apply:(e,t,n)=>Reflect.apply(e,t,n)});let r=e.scope_.arrayMethodsPlugin_,i=1===e.type_&&"string"==typeof t;if(i&&r?.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);let o=e.copy_||e.base_;if(!ep(o,t,e.type_)){var a;let n;return a=e,(n=eK(o,t))?ea in n?n[ea]:n.get?.call(a.draft_):void 0}let s=o[t];if(e.finalized_||!el(s)||i&&e.operationMethod&&r?.isMutatingArrayMethod(e.operationMethod)&&Number.isInteger(n=+t)&&String(n)===t)return s;if(s===eX(e.base_,t)){eJ(e);let n=1===e.type_?+t:t,r=eQ(e.scope_,s,e,n);return e.copy_[n]=r}return s},has:(e,t)=>"constructor"!==t&&"__proto__"!==t&&"prototype"!==t&&t in(e.copy_||e.base_),ownKeys:e=>Reflect.ownKeys(e.copy_||e.base_),set(e,t,n){if("constructor"===t||"__proto__"===t||"prototype"===t)return!0;let r=eK(e.copy_||e.base_,t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let r=eX(e.copy_||e.base_,t),i=r?.[J];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if((n===r?0!==n||1/n==1/r:n!=n&&r!=r)&&(void 0!==n||ep(e.base_,t,e.type_)))return!0;eJ(e),eY(e)}return!!(e.copy_[t]===n&&(void 0!==n||ep(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t]))||(e.copy_[t]=n,e.assigned_.set(t,!0),!function(e,t,n){let{scope_:r}=e;if(es(n)){let i=n[J];eH(i,r)&&i.callbacks_.push(function(){eJ(e),eF(e,n,ek(i),t)})}else el(n)&&e.callbacks_.push(function(){let i=e.copy_||e.base_;3===e.type_?i.has(n)&&eW(n,r.handledSet_,r):em(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&eW(em(e.copy_,t,e.type_),r.handledSet_,r)})}(e,t,n),!0)},deleteProperty:(e,t)=>(eJ(e),void 0!==eX(e.base_,t)||t in e.base_?(e.assigned_.set(t,!1),eY(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){let n=e.copy_||e.base_,r=Reflect.getOwnPropertyDescriptor(n,t);return r?{[eo]:!0,[er]:1!==e.type_||"length"!==t,[ei]:r[ei],[ea]:n[t]}:r},defineProperty(){Q(11)},getPrototypeOf:e=>ee(e.base_),setPrototypeOf(){Q(12)}},eV={};for(let e in eq){let t=eq[e];eV[e]=function(){let e=arguments;return e[0]=e[0][0],t.apply(this,e)}}function eX(e,t){let n=e[J];return(n?n.copy_||n.base_:e)[t]}function eK(e,t){if(!(t in e))return;let n=ee(e);for(;n;){let e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=ee(n)}}function eY(e){!e.modified_&&(e.modified_=!0,e.parent_&&eY(e.parent_))}function eJ(e){e.copy_||(e.assigned_=new Map,e.copy_=eS(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function eQ(e,t,n,r){let[i,o]=ev(t)?eR(eL).proxyMap_(t,n):ey(t)?eR(eL).proxySet_(t,n):function(e,t){let n=eb(e),r={type_:+!!n,scope_:t?t.scope_:p,modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},i=r,o=eq;n&&(i=[r],o=eV);let{revoke:a,proxy:s}=Proxy.revocable(i,o);return r.draft_=s,r.revoke_=a,[s,r]}(t,n);if((n?.scope_??p).drafts_.push(i),o.callbacks_=n?.callbacks_??[],o.key_=r,n&&void 0!==r)n.callbacks_.push(function(e){if(!o||!eH(o,e))return;e.mapSetPlugin_?.fixSetContents(o);let t=ek(o);eF(n,o.draft_??o,t,r),eG(o,e)});else o.callbacks_.push(function(e){e.mapSetPlugin_?.fixSetContents(o);let{patchPlugin_:t}=e;o.modified_&&t&&t.generatePatches_(o,[],e)});return i}eV.deleteProperty=function(e,t){return eV.set.call(this,e,t,void 0)},eV.set=function(e,t,n){return eq.set.call(this,e[0],t,n,e[0])};var eZ=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,n)=>{let r;if(ex(e)&&!ex(t)){let n=t;t=e;let r=this;return function(e=n,...i){return r.produce(e,e=>t.call(this,e,...i))}}if(ex(t)||Q(6),void 0===n||ex(n)||Q(7),el(e)){let i=ej(this),o=eQ(i,e,void 0),a=!0;try{r=t(o),a=!1}finally{a?eI(i):eD(i)}return eP(i,n),eO(r,i)}if(e&&ew(e))Q(1,e);else{if(void 0===(r=t(e))&&(r=e),r===K&&(r=void 0),this.autoFreeze_&&eC(r,!0),n){let t=[],i=[];eR(e_).generateReplacementPatches_(e,r,{patches_:t,inversePatches_:i}),n(t,i)}return r}},this.produceWithPatches=(e,t)=>{let n,r;return ex(e)?(t,...n)=>this.produceWithPatches(t,t=>e(t,...n)):[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},(e=>"boolean"==typeof e)(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),(e=>"boolean"==typeof e)(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),(e=>"boolean"==typeof e)(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){var t;el(e)||Q(8),es(e)&&(es(t=e)||Q(10,t),e=function e(t){let n;if(!el(t)||eE(t))return t;let r=t[J],i=!0;if(r){if(!r.modified_)return r.base_;r.finalized_=!0,n=eS(t,r.scope_.immer_.useStrictShallowCopy_),i=r.scope_.immer_.shouldUseStrictIteration()}else n=eS(t,!0);return eh(n,(t,r)=>{eg(n,t,e(r))},i),r&&(r.finalized_=!1),n}(t));let n=ej(this),r=eQ(n,e,void 0);return r[J].isManual_=!0,eD(n),r}finishDraft(e,t){let n=e&&e[J];n&&n.isManual_||Q(9);let{scope_:r}=n;return eP(r,t),eO(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));let r=eR(e_).applyPatches_;return es(e)?r(e,t):this.produce(e,e=>r(e,t))}},e0=eZ.produce,e1=eZ.produceWithPatches.bind(eZ),e2=eZ.applyPatches.bind(eZ);function e8(e=21){let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}function e5(e,t){if(e.add(t),e.size>1e3){let t=e.values().next().value;void 0!==t&&e.delete(t)}}let e6="object"==typeof self?self:globalThis;function e3(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[o,a]=e[i];switch(o){case 0:case -1:return n(a,i);case 1:{let e=n([],i);for(let t of a)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of a)e[r(t)]=r(n);return e}case 3:return n(new Date(a),i);case 4:{let{source:e,flags:t}=a;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of a)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of a)e.add(r(t));return e}case 7:{let{name:e,message:t}=a;return n(new e6[e](t),i)}case 8:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{let{buffer:e}=new Uint8Array(a);return n(new DataView(e),a)}}return n(new e6[o](a),i)})(0)}let{toString:e4}={},{keys:e7}=Object;function e9(e){let t=typeof e;if("object"!==t||!e)return[0,t];let n=e4.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]}function te([e,t]){return 0===e&&("function"===t||"symbol"===t)}let{parse:tt,stringify:tn}=JSON,tr={json:!0,lossy:!0};function ti(e){if(e.error)throw function e(t){var n;let r=t.cause instanceof Error?t.cause:"object"==typeof(n=t.cause)&&null!==n&&"string"==typeof n.message&&"string"==typeof n.name?e(t.cause):t.cause,i=void 0!==r?Error(t.message,{cause:r}):Error(t.message);for(let e of(i.name=t.name,Object.keys(t)))"name"!==e&&"message"!==e&&"cause"!==e&&(i[e]=t[e]);return i}(e.error);return e.output}function to(e){return e.some(e=>null!=e)}async function ta(e){let t=function(e,t){let n=new Map,r=new Map;function i(e,t){var n=null!==e&&"object"==typeof e&&"serialization"in e&&"data"in e?e.data:e;return"structured-clone"===t&&Array.isArray(n)?e3(n):n}async function o(e){n.has(e.path)||n.set(e.path,t(e.path).then(t=>i(t,e.serialization)));let r=await n.get(e.path);return"object"==typeof r&&null!==r&&("output"in r||"error"in r)?ti(r):r}async function a(e,n){return r.has(e)||r.set(e,t(e).then(e=>i(e,n))),await r.get(e)}async function s(t,n){if(!(t in e))throw Error(`[devframe-rpc] Function "${t}" not found in dump store`);let r=e[t];if("object"==typeof r&&null!==r&&"static"===r.type&&"string"==typeof r.path){if(to(n))throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`);return await o(r)}if("object"==typeof r&&null!==r&&"query"===r.type&&"object"==typeof r.records&&null!==r.records){let e=_(n),i=r.records[e];if(i)return ti(await a(i,r.serialization));if(r.fallback)return ti(await a(r.fallback,r.serialization));throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`)}if(!to(n))return r;throw Error(`[devframe-rpc] No dump match for "${t}" with args: ${JSON.stringify(n)}`)}return{call:async(e,t)=>await s(e,t),callOptional:async(t,n)=>{if(t in e)return await s(t,n)},callEvent:async(e,t)=>{}}}(await e.fetchJsonFromBases("__rpc-dump/index.json"),e.fetchJsonFromBases);return{isTrusted:!0,status:"connected",connectionError:null,requestTrust:async()=>!0,requestTrustWithToken:async()=>!0,requestTrustWithCode:async()=>null,ensureTrusted:async()=>!0,call:(...e)=>t.call(e[0],e.slice(1)),callEvent:(...e)=>t.callEvent(e[0],e.slice(1)),callOptional:(...e)=>t.callOptional(e[0],e.slice(1))}}class ts extends Error{name="StreamClosedError"}function tl(e,t){return`${e}\x1f${t}`}let td=Math.random.bind(Math),tu=e=>e,{clearTimeout:tc,setTimeout:th}=globalThis;function tf(e,t,n,r){var i,o;let a=(i=n,o=r,Array.isArray(i)?`[${o}]`:""===o?"<root>":o);return j.DF0020({name:e||"<anonymous>",type:t,path:a})}function tp(){}let tm=new Map,tg="model",tb="name",tv="type",ty="vendor",tw="version",tx="architecture",tk="console",tS="mobile",tC="tablet",tA="smarttv",tE="wearable",tL="embedded",t_="Amazon",tN="Apple",tT="ASUS",tR="BlackBerry",tM="Browser",tP="Chrome",tI="Firefox",tD="Google",tj="Huawei",t$="Microsoft",tO="Motorola",tz="Opera",tB="Samsung",tH="Sharp",tU="Sony",tF="Xiaomi",tG="Zebra",tW="Facebook",tq="Chromium OS",tV="Mac OS";function tX(e){let t={};for(let n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t}function tK(e){return e.toLowerCase()}function tY(e,t){return"string"==typeof e&&tK(t).includes(tK(e))}function tJ(e,t){let n=e.replace(/^\s+/,"");return void 0===t?n:n.substring(0,t)}function tQ(e,t,n){let r=n??{};for(let n=0;n<t.length;n+=2){let i=t[n],o=t[n+1];for(let t=0;t<i.length;t++){let n=i[t];if(!n)break;let a=n.exec(e);if(a){for(let e=0;e<o.length;e++){let t=a[e+1],n=o[e];if(Array.isArray(n)){let e=n[0],i=n.length;if(2===i){let i=n[1];"function"==typeof i?r[e]=i(t,void 0,r):r[e]=i}else if(3===i){let i=n[1],o=n[2];"function"!=typeof i||"exec"in i||"test"in i?r[e]=t?t.replace(i,o):void 0:r[e]=t?i(t,o,r):void 0}else 4===i&&(r[e]=t?n[3](t.replace(n[1],n[2]),void 0,r):void 0)}else r[n]=t||void 0}return r}}}return r}function tZ(e,t){for(let n in t){let r=t[n];if(Array.isArray(r)&&r.length>0){for(let t=0;t<r.length;t++)if(tY(r[t],e))return"?"===n?void 0:n}else if(tY(r,e))return"?"===n?void 0:n}return e}let t0={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},t1={browser:[[/\b(?:crmo|crios)\/([\w.]+)/i],[tw,[tb,"Chrome"]],[/edg(?:e|ios|a)?\/([\w.]+)/i],[tw,[tb,"Edge"]],[/(opera mini)\/([-\w.]+)/i,/(opera [mobileta]{3,6})\b.+version\/([-\w.]+)/i,/(opera)(?:.+version\/|[/ ]+)([\w.]+)/i],[tb,tw],[/opios[/ ]+([\w.]+)/i],[tw,[tb,`${tz} Mini`]],[/\bop(?:rg)?x\/([\w.]+)/i],[tw,[tb,`${tz} GX`]],[/\bopr\/([\w.]+)/i],[tw,[tb,tz]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[/ ]?([\w.]+)/i],[tw,[tb,"Baidu"]],[/(kindle)\/([\w.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[/ ]?([\w.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[/ ]?([\w.]*)/i,/(?:ms|\()(ie) ([\w.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w.]+)/i,/(heytap|ovi)browser\/([\d.]+)/i,/(weibo)__([\d.]+)/i],[tb,tw],[/\bddg\/([\w.]+)/i],[tw,[tb,"DuckDuckGo"]],[/(?:\buc? ?browser|juc.+ucweb)[/ ]?([\w.]+)/i],[tw,[tb,`UC${tM}`]],[/microm.+\bqbcore\/([\w.]+)/i,/\bqbcore\/([\w.]+).+microm/i,/micromessenger\/([\w.]+)/i],[tw,[tb,"WeChat"]],[/konqueror\/([\w.]+)/i],[tw,[tb,"Konqueror"]],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i],[tw,[tb,"IE"]],[/ya(?:search)?browser\/([\w.]+)/i],[tw,[tb,"Yandex"]],[/slbrowser\/([\w.]+)/i],[tw,[tb,`Smart Lenovo ${tM}`]],[/(avast|avg)\/([\w.]+)/i],[[tb,/(.+)/,`$1 Secure ${tM}`],tw],[/\bfocus\/([\w.]+)/i],[tw,[tb,`${tI} Focus`]],[/\bopt\/([\w.]+)/i],[tw,[tb,`${tz} Touch`]],[/coc_coc\w+\/([\w.]+)/i],[tw,[tb,"Coc Coc"]],[/dolfin\/([\w.]+)/i],[tw,[tb,"Dolphin"]],[/coast\/([\w.]+)/i],[tw,[tb,`${tz} Coast`]],[/miuibrowser\/([\w.]+)/i],[tw,[tb,`MIUI ${tM}`]],[/fxios\/([-\w.]+)/i],[tw,[tb,tI]],[/\bqihu|(qi?ho{0,2}|360)browser/i],[[tb,`360 ${tM}`]],[/(oculus|sailfish|huawei|vivo)browser\/([\w.]+)/i],[[tb,/(.+)/,`$1 ${tM}`],tw],[/samsungbrowser\/([\w.]+)/i],[tw,[tb,`${tB} Internet`]],[/(comodo_dragon)\/([\w.]+)/i],[[tb,/_/g," "],tw],[/metasr[/ ]?([\d.]+)/i],[tw,[tb,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d.]+)/i],[[tb,"Sogou Mobile"],tw],[/(electron)\/([\w.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w.]+))/i,/m?(qqbrowser|2345Explorer)[/ ]?([\w.]+)/i],[tb,tw],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[tb],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w.]+);)/i],[[tb,tW],tw],[/(Klarna)\/([\w.]+)/i,/(kakao(?:talk|story))[/ ]([\w.]+)/i,/(naver)\(.*?(\d+\.[\w.]+).*\)/i,/safari (line)\/([\w.]+)/i,/\b(line)\/([\w.]+)\/iab/i,/(alipay)client\/([\w.]+)/i,/(twitter)(?:and| f.+e\/([\w.]+))/i,/(chromium|instagram|snapchat)[/ ]([-\w.]+)/i],[tb,tw],[/\bgsa\/([\w.]+) .*safari\//i],[tw,[tb,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w.]+)/i],[tw,[tb,"TikTok"]],[/headlesschrome(?:\/([\w.]+)| )/i],[tw,[tb,`${tP} Headless`]],[/ wv\).+(chrome)\/([\w.]+)/i],[[tb,`${tP} WebView`],tw],[/droid.+ version\/([\w.]+)\b.+(?:mobile safari|safari)/i],[tw,[tb,`Android ${tM}`]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w.]+)/i],[tb,tw],[/version\/([\w.,]+) .*mobile\/\w+ (safari)/i],[tw,[tb,"Mobile Safari"]],[/version\/([\w(.|,)]+) .*(mobile ?safari|safari)/i],[tw,tb],[/webkit.+?(mobile ?safari|safari)(\/[\w.]+)/i],[tb,[tw,tZ,{"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w.]+)/i],[tb,tw],[/(navigator|netscape\d?)\/([-\w.]+)/i],[[tb,"Netscape"],tw],[/mobile vr; rv:([\w.]+)\).+firefox/i],[tw,[tb,`${tI} Reality`]],[/ekiohf.+(flow)\/([\w.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[/ ]?([\w.+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w.]+)$/i,/(firefox)\/([\w.]+)/i,/(mozilla)\/([\w.]+) .+rv:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[. ]?browser)[-/ ]?v?([\w.]+)/i,/(links) \(([\w.]+)/i,/panasonic;(viera)/i],[tb,tw],[/(cobalt)\/([\w.]+)/i],[tb,[tw,/master.|lts./,""]]],cpu:[[/(amd|x(?:(?:86|64)[-_])?|wow|win)64[;)]/i],[[tx,"amd64"]],[/(ia32(?=;))/i],[[tx,tK]],[/((?:i[346]|x)86)[;)]/i],[[tx,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[tx,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[tx,"armhf"]],[/windows (ce|mobile); ppc;/i],[[tx,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[tx,/ower/,"",tK]],[/(sun4\w)[;)]/i],[[tx,"sparc"]],[/(avr32|ia64(?=;)|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[tx,tK]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[tg,[ty,tB],[tv,tC]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?\d+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[tg,[ty,tB],[tv,tS]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[tg,[ty,tN],[tv,tS]],[/\((ipad);[-\w),; ]+apple/i,/applecoremedia\/[\w.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[tg,[ty,tN],[tv,tC]],[/(macintosh);/i],[tg,[ty,tN]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[tg,[ty,tH],[tv,tS]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[tg,[ty,tj],[tv,tC]],[/(?:huawei|honor)([-\w ]+)[;)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][0-359c][adn]?)\b(?!.+d\/s)/i],[tg,[ty,tj],[tv,tS]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?[\w ]+)(?: bui|\))/i,/oid[^)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?\d?\w?[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[tg,/_/g," "],[ty,tF],[tv,tS]],[/oid[^)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?pad[\w ]+)(?: bui|\))/i],[[tg,/_/g," "],[ty,tF],[tv,tC]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[tg,[ty,"OPPO"],[tv,tS]],[/\b(opd2\d{3}a?) bui/i],[tg,[ty,"OPPO"],[tv,tC]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[tg,[ty,"Vivo"],[tv,tS]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[tg,[ty,"Realme"],[tv,tS]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w() ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[tg,[ty,tO],[tv,tS]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[tg,[ty,tO],[tv,tC]],[/((?=lg)?[vl]k-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[tg,[ty,"LG"],[tv,tC]],[/(lm(?:-?f100[nv]?|-[\w.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?(\w+) bui/i],[tg,[ty,"LG"],[tv,tS]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab[\w ]+|yt[-\w]{6}|tb[-\w]{6})/i],[tg,[ty,"Lenovo"],[tv,tC]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w.]*)/i],[[tg,/_/g," "],[ty,"Nokia"],[tv,tS]],[/(pixel c)\b/i],[tg,[ty,tD],[tv,tC]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[tg,[ty,tD],[tv,tS]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]?\d\.))/i],[tg,[ty,tU],[tv,tS]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[tg,"Xperia Tablet"],[ty,tU],[tv,tC]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[tg,[ty,"OnePlus"],[tv,tS]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[tg,[ty,t_],[tv,tC]],[/((?:sd|kf)[0349hijor-uw]+)( bui|\)).+silk\//i],[[tg,/(.+)/g,"Fire Phone $1"],[ty,t_],[tv,tS]],[/(playbook);[-\w),; ]+(rim)/i],[tg,ty,[tv,tC]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[tg,[ty,tR],[tv,tS]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[tg,[ty,tT],[tv,tC]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[tg,[ty,tT],[tv,tS]],[/(nexus 9)/i],[tg,[ty,"HTC"],[tv,tC]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!;|\.)|sony(?!-bra))[-_ ]?([-\w]*)/i],[ty,[tg,/_/g," "],[tv,tS]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[tg,[ty,"Acer"],[tv,tC]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[tg,[ty,"Meizu"],[tv,tS]],[/; ((?:power )?armor[\w ]{0,8})(?: bui|\))/i],[tg,[ty,"Ulefone"],[tv,tS]],[/(blackberry|benq|palm(?=-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[ty,tg,[tv,tS]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[ty,tg,[tv,tC]],[/(surface duo)/i],[tg,[ty,t$],[tv,tC]],[/droid [\d.]+; (fp\du?)(?: b|\))/i],[tg,[ty,"Fairphone"],[tv,tS]],[/(u304aa)/i],[tg,[ty,"AT&T"],[tv,tS]],[/\bsie-(\w*)/i],[tg,[ty,"Siemens"],[tv,tS]],[/\b(rct\w+) b/i],[tg,[ty,"RCA"],[tv,tC]],[/\b(venue[\d ]{2,7}) b/i],[tg,[ty,"Dell"],[tv,tC]],[/\b(q(?:mv|ta)\w+) b/i],[tg,[ty,"Verizon"],[tv,tC]],[/\b(?:barnes[& ]+noble |bn[rt])([\w+ ]*) b/i],[tg,[ty,"Barnes & Noble"],[tv,tC]],[/\b(tm\d{3}\w+) b/i],[tg,[ty,"NuVision"],[tv,tC]],[/\b(k88) b/i],[tg,[ty,"ZTE"],[tv,tC]],[/\b(nx\d{3}j) b/i],[tg,[ty,"ZTE"],[tv,tS]],[/\b(gen\d{3}) b.+49h/i],[tg,[ty,"Swiss"],[tv,tS]],[/\b(zur\d{3}) b/i],[tg,[ty,"Swiss"],[tv,tC]],[/\b((zeki)?tb.*\b) b/i],[tg,[ty,"Zeki"],[tv,tC]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[ty,"Dragon Touch"],tg,[tv,tC]],[/\b(ns-?\w{0,9}) b/i],[tg,[ty,"Insignia"],[tv,tC]],[/\b((nxa|next)-?\w{0,9}) b/i],[tg,[ty,"NextBook"],[tv,tC]],[/\b(xtreme_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[ty,"Voice"],tg,[tv,tS]],[/\b(lvtel-)?(v1[12]) b/i],[[ty,"LvTel"],tg,[tv,tS]],[/\b(ph-1) /i],[tg,[ty,"Essential"],[tv,tS]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[tg,[ty,"Envizen"],[tv,tC]],[/\b(trio[-\w. ]+) b/i],[tg,[ty,"MachSpeed"],[tv,tC]],[/\btu_(1491) b/i],[tg,[ty,"Rotor"],[tv,tC]],[/(shield[\w ]+) b/i],[tg,[ty,"Nvidia"],[tv,tC]],[/(sprint) (\w+)/i],[ty,tg,[tv,tS]],[/(kin\.[onetw]{3})/i],[[tg,/\./g," "],[ty,t$],[tv,tS]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[tg,[ty,tG],[tv,tC]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[tg,[ty,tG],[tv,tS]],[/smart-tv.+(samsung)/i],[ty,[tv,tA]],[/hbbtv.+maple;(\d+)/i],[[tg,/^/,"SmartTV"],[ty,tB],[tv,tA]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[ty,"LG"],[tv,tA]],[/(apple) ?tv/i],[ty,[tg,`${tN} TV`],[tv,tA]],[/crkey/i],[[tg,`${tP}cast`],[ty,tD],[tv,tA]],[/droid.+aft(\w+)( bui|\))/i],[tg,[ty,t_],[tv,tA]],[/\(dtv[);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[tg,[ty,tH],[tv,tA]],[/(bravia[\w ]+)( bui|\))/i],[tg,[ty,tU],[tv,tA]],[/(mitv-\w{5}) bui/i],[tg,[ty,tF],[tv,tA]],[/Hbbtv.*(technisat) (.*);/i],[ty,tg,[tv,tA]],[/\b(roku)[\dx]*[)/]((?:dvp-)?[\d.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w+ ]*; *(\w[^;]*);([^;]*)/i],[[ty,tJ],[tg,tJ],[tv,tA]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[tv,tA]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[ty,tg,[tv,tk]],[/droid.+; (shield) bui/i],[tg,[ty,"Nvidia"],[tv,tk]],[/(playstation [345portablevi]+)/i],[tg,[ty,tU],[tv,tk]],[/\b(xbox(?: one)?(?!; xbox))[); ]/i],[tg,[ty,t$],[tv,tk]],[/((pebble))app/i],[ty,tg,[tv,tE]],[/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i],[tg,[ty,tN],[tv,tE]],[/droid.+; (glass) \d/i],[tg,[ty,tD],[tv,tE]],[/droid.+; (wt63?0{2,3})\)/i],[tg,[ty,tG],[tv,tE]],[/(quest( \d| pro)?)/i],[tg,[ty,tW],[tv,tE]],[/(tesla)(?: qtcarbrowser|\/[-\w.]+)/i],[ty,[tv,tL]],[/(aeobc)\b/i],[tg,[ty,t_],[tv,tL]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[tg,[tv,tS]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[tg,[tv,tC]],[/\b((tablet|tab)[;/]|focus\/\d(?!.+mobile))/i],[[tv,tC]],[/(phone|mobile(?:[;/]| [ \w/.]*safari)|pda(?=.+windows ce))/i],[[tv,tS]],[/(android[-\w. ]{0,9});.+buil/i],[tg,[ty,"Generic"]]],engine:[[/windows.+ edge\/([\w.]+)/i],[tw,[tb,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i],[tw,[tb,"Blink"]],[/(presto)\/([\w.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w.]+)/i,/ekioh(flow)\/([\w.]+)/i,/(khtml|tasman|links)[/ ]\(?([\w.]+)/i,/(icab)[/ ]([23]\.[\d.]+)/i,/\b(libweb)/i],[tb,tw],[/rv:([\w.]{1,9})\b.+(gecko)/i],[tw,tb]],os:[[/microsoft (windows) (vista|xp)/i],[tb,tw],[/(windows (?:phone(?: os)?|mobile))[/ ]?([.\w ]*)/i],[tb,[tw,tZ,t0]],[/windows nt 6\.2; (arm)/i,/windows[/ ]?([ntce\d. ]+\w)(?!.+xbox)/i,/(?:win(?=[39n])|win 9x )([nt\d.]+)/i],[[tw,tZ,t0],[tb,"Windows"]],[/ip[honead]{2,4}\b(?:.*os (\w+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[/ ])([\d.]+)/i,/cfnetwork\/.+darwin/i],[[tw,/_/g,"."],[tb,"iOS"]],[/(mac os x) ?([\w. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[tb,tV],[tw,/_/g,"."]],[/droid ([\w.]+)\b.+(android[- ]x86|harmonyos)/i],[tw,tb],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-/ ]?([\w.]*)/i,/(blackberry)\w*\/([\w.]*)/i,/(tizen|kaios)[/ ]([\w.]+)/i,/\((series40);/i],[tb,tw],[/\(bb(10);/i],[tw,[tb,tR]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-/ ]?([\w.]*)/i],[tw,[tb,"Symbian"]],[/mozilla\/[\d.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w.]+)/i],[tw,[tb,`${tI} OS`]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w.]+)/i],[tw,[tb,"webOS"]],[/watch(?: ?os[,/]|\d,\d\/)([\d.]+)/i],[tw,[tb,"watchOS"]],[/crkey\/([\d.]+)/i],[tw,[tb,`${tP}cast`]],[/(cros) \w+(?:\)| ([\w.]+)\b)/i],[[tb,tq],tw],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w.]*)/i,/(mint)[/() ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-/ ]?(?!chrom|package)([-\w.]*)/i,/(hurd|linux) ?([\w.]*)/i,/(gnu) ?([\w.]*)/i,/\b([-e-hrntopcs]{0,5}bsd|dragonfly)[/ ]?(?!amd|[ix346]{1,2}86)([\w.]*)/i,/(haiku) (\w+)/i],[tb,tw],[/(sunos) ?([\w.]*)/i],[[tb,"Solaris"],tw],[/((?:open)?solaris)[-/ ]?([\w.]*)/i,/(aix) ((\d)(?=[.) ])[\w.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w.]*)/i],[tb,tw]]};function t2(e){return"object"==typeof e&&null!==e}function t8(){if("u">typeof window&&window.navigator)return window.navigator}function t5(e){return e.length>500?tJ(e,500):e}Object.freeze(tX([tb,tw,"major"])),Object.freeze(tX([tx])),Object.freeze(tX([tg,ty,tv,tk,tS,tA,tC,tE,tL])),Object.freeze(tX([tb,tw])),Object.freeze(tX([tb,tw]));class t6 extends Error{name="DevframeConnectionError";kind;constructor(e,t,n){super(t,n),this.kind=e}}function t3(e){return e.includes(":")}function t4(e,t){return t3(t)?t:`${e}:${t}`}function t7(e,t,n){let r,i=`devframe:settings:${n}:${t}`;function o(){return r||(r=e.sharedState.get(i,{initialValue:{}})),r}return{get:async e=>(await o()).value()[e],async set(e,t){(await o()).mutate(n=>{n[e]=t})},async delete(e){(await o()).mutate(t=>{delete t[e]})},all:async()=>(await o()).value(),onChange:async e=>(await o()).on("updated",t=>e(t))}}let t9="__DEVFRAME_CONNECTION_META__",ne="__DEVFRAME_CONNECTION_AUTH_TOKEN__";function nt(e){try{localStorage.setItem(ne,e)}catch{}globalThis[ne]=e}async function nn(e={}){let t,n,r,{baseURL:i="./",rpcOptions:o={},cacheOptions:a=!1}=e,s=H(),l=Array.isArray(i)?i:[i],d=e.connectionMeta||function(){for(let e of[()=>window?.[t9],()=>globalThis?.[t9],()=>parent.window?.[t9]])try{let t=e();if(t)return t}catch{}}(),u=l[0]??"./",c=e.connectionMeta?void 0:d?.baseUrl;function h(){if(c)return c;let e=V(w,u);try{return new URL(e,globalThis.location?.href).href}catch{return e}}if(!d){let e=[];for(let t of l)try{d=await fetch(V(w,t)).then(e=>e.json()),u=t,globalThis[t9]={...d,baseUrl:h()};break}catch(t){e.push(t)}if(!d)throw Error(`Failed to get connection meta from ${l.join(", ")}`,{cause:e})}let f=new N({functions:[],..."object"==typeof e.cacheOptions?e.cacheOptions:{}}),p={rpc:void 0},m=function(e){for(let t of[()=>e,()=>localStorage.getItem(ne)??void 0,()=>window?.[ne],()=>globalThis?.[ne],()=>parent.window?.[ne]])try{let e=t();if(e)return e}catch{}}(e.authToken||d.authToken);m&&nt(m);let g=new z(p);async function b(e){let t=[u,...l.filter(e=>e!==u)].filter(e=>null!=e),n=[];for(let r of t)try{return await fetch(V(e,r)).then(t=>{if(!t.ok)throw Error(`Failed to fetch ${e} from ${r}: ${t.status}`);return t.json()})}catch(e){n.push(e)}throw Error(`Failed to load ${e} from ${t.join(", ")}`,{cause:n})}let v="static"===d.backend?await ta({fetchJsonFromBases:b}):function(e){let t,n,{authToken:r,connectionMeta:i,metaBaseUrl:o,events:a,clientRpc:s,rpcOptions:l={},wsOptions:d={},callTimeout:u=0}=e,c=!1,h="connecting",f=null,p={promise:new Promise((e,r)=>{t=e,n=r}),resolve:t,reject:n},m=function(e,t,n){let r="https:"===n.protocol?"wss:":"ws:",i=(()=>{try{return new URL(t,n.href)}catch{return new URL(n.href)}})();if(e&&"object"==typeof e){if(null!=e.host||null!=e.port){let t=e.host??`${n.hostname}:${e.port}`,i=new URL(e.path??"/",`${r}//${t}`);return i.protocol=r,i.href}let t=new URL(e.path??"",i);return t.protocol=r,t.href}if("number"==typeof e)return`${r}//${n.hostname}:${e}`;let o=e??"";if(/^wss?:\/\//i.test(o))return o;if(/^https?:\/\//i.test(o)){var a;let e;return a=/^https/i.test(o)?"wss://":"ws://",((e=o.match(F))||(e=o.match(/^\/{2,}/)),e)?a+o.slice(e[0].length):a+o}let s=new URL(o,i);return s.protocol=r,s.href}(i.websocket,o??"./",location);function g(e,t=null){if(t?f=t:"connected"===e&&(f=null),e===h)return;let n=h;h=e,a.emit("connection:status",e,n)}let b=new Set;function v(e){for(let t of[...b])t.reject(e)}function y(){return"disconnected"===h||"error"===h?new t6("connection","[devframe] Not connected to the devframe server",{cause:f??void 0}):"unauthorized"===h?new t6("auth","[devframe] Not authorized by the devframe server",{cause:f??void 0}):null}function w(e,t){return new Promise((n,r)=>{let i,o=!1,s={reject(e){o||(l(),a.emit("rpc:error",e,t),r(e))}};function l(){o=!0,b.delete(s),i&&clearTimeout(i)}b.add(s),u>0&&(i=setTimeout(()=>{s.reject(new t6("timeout",`[devframe] RPC call "${t}" timed out after ${u}ms`))},u)),e.then(e=>{o||(l(),n(e))},e=>{if(o)return;l();let n=e instanceof Error?e:Error(String(e));a.emit("rpc:error",n,t),r(n)})})}let x=new Map;for(let e of i.jsonSerializableMethods??[])x.set(e,{jsonSerializable:!0});let k=function(e,t){let{channel:n,rpcOptions:r={}}=t;return function(e,t){let n,r,{post:i,on:o,off:a=()=>{},eventNames:s=[],serialize:l=tu,deserialize:d=tu,resolver:u,bind:c="rpc",timeout:h=6e4,proxify:f=!0}=t,p=!1,m=new Map;async function g(e,o,a,s){let d,u,c;if(p)throw Error(`[birpc] rpc is closed, cannot call "${e}"`);let f={m:e,a:o,t:"q"};s&&(f.o=!0);let g=async e=>i(l(e));if(a)return void await g(f);if(n)try{await n}finally{n=void 0}let{promise:b,resolve:v,reject:y}={promise:new Promise((e,t)=>{u=e,c=t}),resolve:u,reject:c},w=function(e=21){let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*td()|0];return t}();async function x(n=f){return h>=0&&"object"==typeof(d=th(()=>{try{if(t.onTimeoutError?.call(r,e,o)!==!0)throw Error(`[birpc] timeout on calling "${e}"`)}catch(e){y(e)}m.delete(w)},h))&&(d=d.unref?.()),m.set(w,{resolve:v,reject:y,timeoutId:d,method:e}),await g(n),b}f.i=w;try{t.onRequest?await t.onRequest.call(r,f,x,v):await x()}catch(e){if(t.onGeneralError?.call(r,e)!==!0)throw e;return}finally{tc(d),m.delete(w)}return b}let b={$call:(e,...t)=>g(e,t,!1),$callOptional:(e,...t)=>g(e,t,!1,!0),$callEvent:(e,...t)=>g(e,t,!0),$callRaw:e=>g(e.method,e.args,e.event,e.optional),$rejectPendingCalls:function(e){let t=Array.from(m.values()).map(({method:t,reject:n})=>e?e({method:t,reject:n}):n(Error(`[birpc]: rejected pending call "${t}".`)));return m.clear(),t},get $closed(){return p},get $meta(){return t.meta},$close:function(e){p=!0,m.forEach(({reject:t,method:n})=>{let r=Error(`[birpc] rpc is closed, cannot call "${n}"`);if(e)return e.cause??=r,t(e);t(r)}),m.clear(),a(v)},$functions:e};async function v(n,...o){let a;try{a=d(n)}catch(e){if(t.onGeneralError?.call(r,e)!==!0)throw e;return}if("q"===a.t){let n,s,{m:d,a:h,o:f}=a,p=await (u?u.call(r,d,e[d]):e[d]);if(f&&(p||=()=>void 0),p)try{n=await p.apply("rpc"===c?r:e,h)}catch(e){s=e}else s=Error(`[birpc] function "${d}" not found`);if(a.i){if(s&&t.onFunctionError&&!0===t.onFunctionError.call(r,s,d,h))return;if(!s)try{await i(l({t:"s",i:a.i,r:n}),...o);return}catch(e){if(s=e,t.onGeneralError?.call(r,e,d,h)!==!0)throw e}try{await i(l({t:"s",i:a.i,e:s}),...o)}catch(e){if(t.onGeneralError?.call(r,e,d,h)!==!0)throw e}}}else{let{i:e,r:t,e:n}=a,r=m.get(e);r&&(tc(r.timeoutId),n?r.reject(n):r.resolve(t)),m.delete(e)}}return r=f?new Proxy({},{get(t,n){if(Object.prototype.hasOwnProperty.call(b,n))return b[n];if("then"===n&&!s.includes("then")&&!("then"in e))return;let r=(...e)=>g(n,e,!0);if(s.includes(n))return r.asEvent=r,r;let i=(...e)=>g(n,e,!1);return i.asEvent=r,i}}):b,n=o(v),r}(e,{...n,timeout:-1,...r,proxify:!1})}(s.functions,{channel:function(e){let t=e.url;e.authToken&&(t=`${t}?devframe_auth_token=${encodeURIComponent(e.authToken)}`);let n=new WebSocket(t),{onConnected:r=tp,onError:i=tp,onDisconnected:o=tp,definitions:a=tm}=e;n.addEventListener("open",e=>{r(e)}),n.addEventListener("error",e=>{i(e instanceof Error?e:Error(e.type))}),n.addEventListener("close",e=>{o(e)});let s=new Map;return{on:e=>{n.addEventListener("message",t=>{e(t.data)})},post:e=>{if(n.readyState===WebSocket.OPEN)return void n.send(e);if(n.readyState===WebSocket.CONNECTING){let r=()=>{t(),n.readyState===WebSocket.OPEN&&n.send(e)},i=()=>t();function t(){n.removeEventListener("open",r),n.removeEventListener("close",i)}n.addEventListener("open",r),n.addEventListener("close",i);return}i(Error("Devframe WebSocket is not open; message dropped"))},serialize:e=>{let t;return("q"===e.t?t=e.m:(t=s.get(e.i),s.delete(e.i)),!("s"===e.t&&"e"in e)&&t&&a.get(t)?.jsonSerializable===!0)?function(e,t=""){return JSON.stringify(e,function(e,n){let r=null!=this?this[e]:n;if(void 0===r){if(Array.isArray(this))throw tf(t,"undefined",this,e);return n}if(null===r)return n;if("bigint"==typeof r)throw tf(t,"BigInt",this,e);if("object"==typeof r){if(r instanceof Map)throw tf(t,"Map",this,e);if(r instanceof Set)throw tf(t,"Set",this,e);if(r instanceof Date)throw tf(t,"Date",this,e);if(Array.isArray(r))return n;let i=Object.getPrototypeOf(r);if(null!==i&&i!==Object.prototype)throw tf(t,r.constructor?.name??"class instance",this,e)}return n})}(e,t??""):`s:${tn(function(e,t={}){var n,r,i;let o,a,s=[];return(n=!(t.json||t.lossy),r=!!t.json,i=new Map,o=(e,t)=>{let n=s.push(e)-1;return i.set(t,n),n},a=e=>{if(i.has(e))return i.get(e);let[t,s]=e9(e);switch(t){case 0:{let r=e;switch(s){case"bigint":t=8,r=e.toString();break;case"function":case"symbol":if(n)throw TypeError(`unable to serialize ${s}`);r=null;break;case"undefined":return o([-1],e)}return o([t,r],e)}case 1:{if(s){let t=e;return"DataView"===s?t=new Uint8Array(e.buffer):"ArrayBuffer"===s&&(t=new Uint8Array(e)),o([s,[...t]],e)}let n=[],r=o([t,n],e);for(let t of e)n.push(a(t));return r}case 2:{if(s)switch(s){case"BigInt":return o([s,e.toString()],e);case"Boolean":case"Number":case"String":return o([s,e.valueOf()],e)}if(r&&"toJSON"in e)return a(e.toJSON());let i=[],l=o([t,i],e);for(let t of e7(e))(n||!te(e9(e[t])))&&i.push([a(t),a(e[t])]);return l}case 3:return o([t,e.toISOString()],e);case 4:{let{source:n,flags:r}=e;return o([t,{source:n,flags:r}],e)}case 5:{let r=[],i=o([t,r],e);for(let[t,i]of e)(n||!(te(e9(t))||te(e9(i))))&&r.push([a(t),a(i)]);return i}case 6:{let r=[],i=o([t,r],e);for(let t of e)(n||!te(e9(t)))&&r.push(a(t));return i}}let{message:l}=e;return o([t,{name:s,message:l}],e)})(e),s}(e,tr))}`},deserialize:e=>{let t=e.startsWith("s:")?e3(tt(e.slice(2))):JSON.parse(e);return"q"===t.t&&t.i&&t.m&&s.set(t.i,t.m),t}}}({url:m,authToken:r,definitions:x,...d,onConnected(e){d.onConnected?.(e)},onError(e){g("error",e),a.emit("connection:error",e),v(new t6("connection","[devframe] Connection to the devframe server failed",{cause:e})),d.onError?.(e)},onDisconnected(e){"error"!==h&&g("disconnected"),v(new t6("connection","[devframe] Disconnected from the devframe server",{cause:f??void 0})),d.onDisconnected?.(e)}}),rpcOptions:l});s.register({name:"devframe:auth:revoked",type:"event",handler:()=>{c=!1;let e=new t6("auth","[devframe] The devframe server revoked this client's trust");g("unauthorized",e),a.emit("connection:error",e),v(e),a.emit("rpc:is-trusted:updated",!1)}});let S=r;function C(){var e;let t,n,r,i,o,a,s,l=(e=navigator.userAgent,s=()=>t||=function(e,t){if(!t&&!t2(e)){if("string"==typeof e)return{ua:t5(e),isSelfNavigator:!1,navigator:void 0,userAgentData:void 0,regexMap:t1};let t=t8(),n=t5(t&&t.userAgent?t.userAgent:"");return{ua:n,isSelfNavigator:!!(t&&t.userAgent===n),navigator:t,userAgentData:t?.userAgentData,regexMap:t1}}let n=t8(),r=t2(e)?void 0:e,i=t2(e)?e:t,o=t5(r||(n&&n.userAgent?n.userAgent:"")),a=n?.userAgentData;return{ua:o,isSelfNavigator:!!(n&&n.userAgent===o),navigator:n,userAgentData:a,regexMap:i?function(e,t={}){let n={};for(let r of Object.keys(e)){let i=t[r];i&&i.length%2==0?n[r]=[...i,...e[r]]:n[r]=e[r]}return n}(t1,i):t1}}(e,void 0),{get ua(){return s().ua},get browser(){var d,u;let e;return n||=(d=s(),e={name:void 0,version:void 0,major:void 0},tQ(d.ua,d.regexMap.browser,e),e.major="string"==typeof(u=e.version)?u.replace(/[^\d.]/g,"").split(".")[0]:void 0,d.isSelfNavigator&&d.navigator?.brave&&"function"==typeof d.navigator.brave.isBrave&&(e.name="Brave"),e)},get engine(){var c;let e;return r||=(c=s(),e={name:void 0,version:void 0},tQ(c.ua,c.regexMap.engine,e),e)},get os(){var h;let e;return i||=(h=s(),e={name:void 0,version:void 0},tQ(h.ua,h.regexMap.os,e),h.isSelfNavigator&&!e.name&&h.userAgentData?.platform&&"Unknown"!==h.userAgentData.platform&&(e.name=h.userAgentData.platform.replace(/chrome os/i,tq).replace(/macos/i,tV)),e)},get device(){var f;let e;return o||=(f=s(),e={vendor:void 0,model:void 0,type:void 0},tQ(f.ua,f.regexMap.device,e),f.isSelfNavigator&&!e.type&&f.userAgentData?.mobile&&(e.type=tS),f.isSelfNavigator&&"Macintosh"===e.model&&f.navigator&&void 0!==f.navigator.standalone&&f.navigator.maxTouchPoints&&f.navigator.maxTouchPoints>2&&(e.model="iPad",e.type=tC),e)},get cpu(){var p;let e;return a||=(p=s(),e={architecture:void 0},tQ(p.ua,p.regexMap.cpu,e),e)}});return[l.browser.name,l.browser.version,"|",l.os.name,l.os.version,l.device.type].filter(e=>e).join(" ")}async function A(e){S=e;let t=await k.$call("anonymous:devframe:auth",{authToken:e,ua:C(),origin:location.origin});if(c=t.isTrusted)p.resolve(!0),g("connected");else{let e=new t6("auth","[devframe] The devframe server refused this client's credentials");g("unauthorized",e),a.emit("connection:error",e)}return a.emit("rpc:is-trusted:updated",c),t.isTrusted}return{get isTrusted(){return c},get status(){return h},get connectionError(){return f},requestTrust:async function(){return!!c||A(S??"")},requestTrustWithToken:A,requestTrustWithCode:async function(e){let t=await k.$call("anonymous:devframe:auth:exchange",{code:e,ua:C(),origin:location.origin}),n=t?.authToken??null;return n&&(S=n,c=!0,p.resolve(!0),g("connected"),a.emit("rpc:is-trusted:updated",!0)),n},ensureTrusted:async function(e=6e4){if(c&&p.resolve(!0),e<=0)return p.promise;let t=()=>{};return await Promise.race([p.promise.then(t),new Promise((n,r)=>{let i=setTimeout(()=>{r(Error("[devframe] Timeout waiting for rpc to be trusted"))},e);t=()=>clearTimeout(i)})]),c},call:(...e)=>{let t=String(e[0]),n=y();return n?(a.emit("rpc:error",n,t),Promise.reject(n)):w(k.$call(...e),t)},callEvent:(...e)=>{let t=y();return t?void a.emit("rpc:error",t,String(e[0])):k.$callEvent(...e)},callOptional:(...e)=>{let t=String(e[0]),n=y();return n?(a.emit("rpc:error",n,t),Promise.reject(n)):w(k.$callOptional(...e),t)}}}({authToken:m,connectionMeta:d,metaBaseUrl:h(),events:s,clientRpc:g,callTimeout:e.callTimeout,rpcOptions:{...o,async onRequest(e,t,n){if(await o.onRequest?.call(this,e,t,n),a&&f?.validate(e.m)){if(f.has(e.m,e.a))return n(f.cached(e.m,e.a));let r=await t(e);f.apply(e,r)}else await t(e)}},wsOptions:e.wsOptions});try{t=new BroadcastChannel("devframe-auth")}catch{}let y={events:s,get isTrusted(){return v.isTrusted},get status(){return v.status},get connectionError(){return v.connectionError},connectionMeta:d,ensureTrusted:v.ensureTrusted,requestTrust:v.requestTrust,requestTrustWithToken:async e=>(nt(e),v.requestTrustWithToken(e)),requestTrustWithCode:async e=>{let n=await v.requestTrustWithCode(e);if(!n)return!1;nt(n);try{t?.postMessage({type:"auth-update",authToken:n})}catch{}return!0},call:v.call,callEvent:v.callEvent,callOptional:v.callOptional,client:g,sharedState:void 0,streaming:void 0,cacheManager:f,scope:void 0};y.sharedState=function(e){let t=new Map,n=new Map,r=new Set,i="static"===e.connectionMeta.backend;function o(e,t){let r=n.get(e);return!r||"object"!=typeof r||Array.isArray(r)||"object"!=typeof t||Array.isArray(t)?t:{...r,...t}}function a(t,n){let r=[];return r.push(n.on("updated",(n,r,o)=>{i||(r?e.callEvent("devframe:rpc:server-state:patch",t,r,o):e.callEvent("devframe:rpc:server-state:set",t,n,o))})),()=>{for(let e of r)e()}}return e.client.register({name:"devframe:rpc:client-state:updated",type:"event",handler:(e,n,r)=>{let i=t.get(e);!i||i.syncIds.has(r)||i.mutate(()=>o(e,n),r)}}),e.client.register({name:"devframe:rpc:client-state:patch",type:"event",handler:(e,n,r)=>{let i=t.get(e);!i||i.syncIds.has(r)||i.patch(n,r)}}),{keys:()=>Array.from(t.keys()),onKeyAdded:e=>(r.add(e),()=>{r.delete(e)}),get:async(s,l)=>{if(l?.initialValue!==void 0&&n.set(s,l.initialValue),t.has(s))return t.get(s);let d=function(e){let{enablePatches:t=!1}=e,n=H(),r=e.initialValue,i=new Set;return{on:n.on,value:()=>r,patch:(e,t=e8())=>{i.has(t)||(!function(){let e="replace",t="remove";function n(e){if(!el(e))return e;if(eb(e))return e.map(n);if(ev(e))return new Map(Array.from(e.entries()).map(([e,t])=>[e,n(t)]));if(ey(e))return new Set(Array.from(e).map(n));let t=Object.create(ee(e));for(let r in e)t[r]=n(e[r]);return ep(e,Y)&&(t[Y]=e[Y]),t}function r(e){return es(e)?n(e):e}eT[e_]||(eT[e_]={applyPatches_:function(r,i){return i.forEach(i=>{let{path:o,op:a}=i,s=r;for(let e=0;e<o.length-1;e++){let t=ef(s),n=o[e];"string"!=typeof n&&"number"!=typeof n&&(n=""+n),(0===t||1===t)&&("__proto__"===n||n===et)&&Q(19),ex(s)&&n===en&&Q(19),ew(s=em(s,n))||Q(18,o.join("/"))}let l=ef(s),d=n(i.value),u=o[o.length-1];switch(a){case e:switch(l){case 2:return s.set(u,d);case 3:Q(16);default:return s[u]=d}case"add":switch(l){case 1:return"-"===u?s.push(d):s.splice(u,0,d);case 2:return s.set(u,d);case 3:return s.add(d);default:return s[u]=d}case t:switch(l){case 1:return s.splice(u,1);case 2:return s.delete(u);case 3:return s.delete(i.value);default:return delete s[u]}default:Q(17,a)}}),r},generatePatches_:function(n,i,o){if(n.scope_.processedForPatches_.has(n))return;n.scope_.processedForPatches_.add(n);let{patches_:a,inversePatches_:s}=o;switch(n.type_){case 0:case 2:return function(n,i,o,a){let{base_:s,copy_:l,type_:d}=n;eh(n.assigned_,(n,u)=>{let c=em(s,n,d),h=em(l,n,d),f=u?ep(s,n)?e:"add":t;if(c===h&&f===e)return;let p=i.concat(n);o.push(f===t?{op:f,path:p}:{op:f,path:p,value:r(h)}),a.push("add"===f?{op:t,path:p}:f===t?{op:"add",path:p,value:r(c)}:{op:e,path:p,value:r(c)})})}(n,i,a,s);case 1:return function(n,i,o,a){let{base_:s,assigned_:l}=n,d=n.copy_;d.length<s.length&&([s,d]=[d,s],[o,a]=[a,o]);let u=!0===n.allIndicesReassigned_;for(let t=0;t<s.length;t++){let n=d[t],c=s[t];if((u||l?.get(t.toString()))&&n!==c){let s=n?.[J];if(s&&s.modified_)continue;let l=i.concat([t]);o.push({op:e,path:l,value:r(n)}),a.push({op:e,path:l,value:r(c)})}}for(let e=s.length;e<d.length;e++){let t=i.concat([e]);o.push({op:"add",path:t,value:r(d[e])})}for(let e=d.length-1;s.length<=e;--e){let n=i.concat([e]);a.push({op:t,path:n})}}(n,i,a,s);case 3:return function(e,n,r,i){let{base_:o,copy_:a}=e,s=0;o.forEach(e=>{if(!a.has(e)){let o=n.concat([s]);r.push({op:t,path:o,value:e}),i.unshift({op:"add",path:o,value:e})}s++}),s=0,a.forEach(e=>{if(!o.has(e)){let o=n.concat([s]);r.push({op:"add",path:o,value:e}),i.unshift({op:t,path:o,value:e})}s++})}(n,i,a,s)}},generateReplacementPatches_:function(t,n,r){let{patches_:i,inversePatches_:o}=r;i.push({op:e,path:[],value:n===K?void 0:n}),o.push({op:e,path:[],value:t})},getPath:function e(t,n=[]){if(void 0!==t.key_){var r;let e,i=t.parent_.copy_??t.parent_.base_,o=ew(r=em(i,t.key_))?r?.[J]:null,a=em(i,t.key_);if(void 0===a||a!==t.draft_&&a!==t.base_&&a!==t.copy_||null!=o&&o.base_!==t.base_)return null;let s=3===t.parent_.type_;if(e=s?Array.from(t.parent_.drafts_.keys()).indexOf(t.key_):t.key_,!(s&&i.size>e||ep(i,e)))return null;n.push(e)}if(t.parent_)return e(t.parent_,n);n.reverse();try{var i=t.copy_,o=n;let e=i;for(let t=0;t<o.length-1;t++)if(!ew(e=em(e,o[t]))||null===e)throw Error(`Cannot resolve path at '${o.join("/")}'`)}catch(e){return null}return n}})}(),r=e2(r,e),e5(i,t),n.emit("updated",r,void 0,t))},mutate:(e,o=e8())=>{if(!i.has(o))if(e5(i,o),t){let[t,i]=e1(r,e);r=t,n.emit("updated",r,i,o)}else r=e0(r,e),n.emit("updated",r,void 0,o)},syncIds:i}}({initialValue:l?.initialValue,enablePatches:!1});async function u(){if(i||e.callEvent("devframe:rpc:server-state:subscribe",s),l?.initialValue!==void 0){for(let e of(t.set(s,d),r))e(s);return e.call("devframe:rpc:server-state:get",s).then(e=>{void 0!==e&&d.mutate(()=>o(s,e))}).catch(e=>{console.error("Error getting server state",e)}),a(s,d),d}{let n=await e.call("devframe:rpc:server-state:get",s);for(let e of(d.mutate(()=>o(s,n)),t.set(s,d),r))e(s);return a(s,d),d}}return new Promise(t=>{if(e.isTrusted)u().then(t);else{t(d);let n=!1;e.events.on("rpc:is-trusted:updated",e=>{e&&!n&&(n=!0,u())})}})}}}(y),n=new Map,r=new Map,y.client.register({name:"devframe:streaming:chunk",type:"event",handler(e,t,r,i){let o=n.get(tl(e,t));o?._push(r,i)}}),y.client.register({name:"devframe:streaming:end",type:"event",handler(e,t,r){let i=tl(e,t),o=n.get(i);o&&(o._end(r),n.delete(i))}}),y.client.register({name:"devframe:streaming:upload-cancel",type:"event",handler(e,t){let n=tl(e,t),i=r.get(n);i&&(i.abort("server cancelled upload"),r.delete(n))}}),y.events.on("rpc:is-trusted:updated",e=>{if(e)for(let[e,t]of n){if(t.cancelled||t.done)continue;let n=e.indexOf("\x1f");if(n<0)continue;let r=e.slice(0,n),i=e.slice(n+1);y.callEvent("devframe:streaming:subscribe",r,i,{afterSeq:t.lastSeenSeq})}}),y.streaming={subscribe:function(e,t,r={}){let i=tl(e,t),o=n.get(i);if(o)return o;let a=function(e={}){let t,n,r,i,o=e.id??e8(),a=Math.max(1,e.highWaterMark??256),s=[],l=0,d=!1,u=!1;function c(){if(n){if(s.length>0){let e=s.shift(),t=n;n=void 0,t.resolve({value:e,done:!1});return}if(d){let e=n;if(n=void 0,t){let n=Error(t.message);n.name=t.name,e.reject(n)}else e.resolve({value:void 0,done:!0})}}}function h(){if(r){for(;s.length>0;){let e=s.shift();try{r.enqueue(e)}catch{break}}if(d&&r){try{if(t){let e=Error(t.message);e.name=t.name,r.error(e)}else r.close()}catch{}r=void 0}}}function f(e){!d&&(d=!0,t=e,c(),i&&h())}function p(){u||d||(u=!0,e.onCancel?.(),f(void 0))}return{id:o,get cancelled(){return u},get done(){return d},get lastSeenSeq(){return l},get readable(){return i||(i=new ReadableStream({start(e){r=e,h()},cancel(){p()}}))},cancel:p,_push:function(t,n){if(!d&&!u&&!(t<=l)){if(l=t,s.push(n),s.length>a){let t=s.length-a;s.splice(0,t),e.onOverflow?.(t)}c(),i&&h()}},_end:f,[Symbol.asyncIterator]:()=>({next(){if(s.length>0)return Promise.resolve({value:s.shift(),done:!1});if(d){if(t){let e=Error(t.message);return e.name=t.name,Promise.reject(e)}return Promise.resolve({value:void 0,done:!0})}return new Promise((e,t)=>{n={resolve:e,reject:t}})},return:()=>(p(),Promise.resolve({value:void 0,done:!0}))})}}({id:t,highWaterMark:r.highWaterMark,onOverflow(n){console.warn(`[devframe] DF0029: Stream "${e}#${t}" dropped ${n} chunk(s) after exceeding the client high-water mark.`)},onCancel(){y.callEvent("devframe:streaming:cancel",e,t),n.delete(i)}});if(n.set(i,a),y.isTrusted)y.callEvent("devframe:streaming:subscribe",e,t,{afterSeq:0});else{let r=y.events.on("rpc:is-trusted:updated",o=>{o&&(r(),!n.has(i)||a.cancelled||a.done||y.callEvent("devframe:streaming:subscribe",e,t,{afterSeq:a.lastSeenSeq}))})}return a},upload:function(e,t){let n=tl(e,t),i=r.get(n);if(i)return i;let o=function(e={}){let t=e.id??e8(),n=Math.max(0,e.replayWindow??0),r=H(),i=new AbortController,o=[],a=!1,s=0;function l(e){if(a)throw new ts(`Cannot write to a closed stream "${t}"`);s+=1,n>0&&(o.push({seq:s,chunk:e}),o.length>n&&o.splice(0,o.length-n)),r.emit("chunk",s,e)}function d(e){if(a)return;a=!0;let t=function(e){if(e instanceof Error)return{name:e.name||"Error",message:e.message};if("string"==typeof e)return{name:"Error",message:e};try{return{name:"Error",message:JSON.stringify(e)}}catch{return{name:"Error",message:String(e)}}}(e);i.abort(e),r.emit("end",t)}function u(){a||(a=!0,i.signal.aborted||i.abort("stream closed"),r.emit("end",void 0))}let c=new WritableStream({write(e){l(e)},close(){u()},abort(e){d(e)}});return{id:t,signal:i.signal,get closed(){return a},get lastSeq(){return s},write:l,error:d,close:u,abort:function(e){!a&&(i.signal.aborted||i.abort(e??"aborted"))},writable:c,events:r,buffer:o}}({id:t});return o.events.on("chunk",(n,r)=>{y.callEvent("devframe:streaming:upload-chunk",e,t,n,r)}),o.events.on("end",i=>{y.callEvent("devframe:streaming:upload-end",e,t,i),r.delete(n)}),r.set(n,o),o}};let k=new Map;async function S(){if(!1!==e.simpleAuth&&function(){try{return window.self===window.top}catch{return!1}}()&&"function"==typeof globalThis.prompt)for(;!y.isTrusted;){let e=globalThis.prompt("devframe: enter the authentication code shown in your terminal");if(null==e)return;let t=e.trim();if(t&&await y.requestTrustWithCode(t))return}}return y.scope=e=>{if(!e)return y;let t=k.get(e);!t&&(t={namespace:e,base:y,rpc:{namespace:e,register(t){if(t3(t.name))throw Error(`[devframe] Scoped client RPC registration for namespace "${e}" received an already-namespaced function name "${t.name}". Pass a bare name without a ":" separator.`);y.client.register({...t,name:`${e}:${t.name}`})},call:(t,...n)=>y.call(t4(e,t),...n),callEvent:(t,...n)=>y.callEvent(t4(e,t),...n),callOptional:(t,...n)=>y.callOptional(t4(e,t),...n),sharedState:(t,n)=>y.sharedState.get(t4(e,t),n),streaming:{subscribe:(t,n,r)=>y.streaming.subscribe(t4(e,t),n,r),upload:(t,n)=>y.streaming.upload(t4(e,t),n)}},settings:{global:t7(y,e,"global"),project:t7(y,e,"project")},scope:y.scope},k.set(e,t));return t},p.rpc=y,async function(){let t=await v.requestTrust(),n=e.otpParam??x,r=!!n&&await X(y,{param:n});t||r||y.isTrusted||await S()}(),t&&(t.onmessage=e=>{e.data?.type==="auth-update"&&e.data.authToken&&y.requestTrustWithToken(e.data.authToken)}),y}let nr=(0,g.createContext)({rpc:null,status:"connecting",error:null});function ni(){return(0,g.use)(nr)}function no({children:e}){let[t,n]=(0,g.useState)({rpc:null,status:"connecting",error:null});return(0,g.useEffect)(()=>{let e,t=!1,r=y.default.env.NEXT_PUBLIC_DEVFRAME_WS,i=r?/^\d+$/.test(r)?{port:Number(r),path:"__devframe_ws"}:r:void 0;return nn(i?{connectionMeta:{backend:"websocket",websocket:i}}:void 0).then(r=>{t||(n({rpc:r,status:r.status,error:r.connectionError?.message??null}),e=r.events.on("connection:status",e=>{n({rpc:r,status:e,error:r.connectionError?.message??null})}))},e=>{t||n({rpc:null,status:"error",error:e instanceof Error?e.message:String(e)})}),()=>{t=!0,e?.()}},[]),(0,m.jsx)(nr,{value:t,children:e})}function na(e){let{rpc:t}=ni(),[n,r]=(0,g.useState)(null),[i,o]=(0,g.useState)(!1),[a,s]=(0,g.useState)(null),l=(0,g.useCallback)(async()=>{if(t){o(!0),s(null);try{r(await e(t))}catch(e){s(e instanceof Error?e.message:String(e))}finally{o(!1)}}},[t,e]);return(0,g.useEffect)(()=>{l()},[l]),{data:n,loading:i,error:a,refresh:l,setData:r}}function ns(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function nl(...e){return g.useCallback(function(...e){return t=>{let n=!1,r=e.map(e=>{let r=ns(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():ns(e[t],null)}}}}(...e),e)}function nd(e){let t=g.forwardRef((t,n)=>{var r;let i,o,{children:a,...s}=t,l=null,d=!1,u=[];np(a)&&"function"==typeof nb&&(a=nb(a._payload)),g.Children.forEach(a,e=>{var t;if(t=e,g.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===nc){d=!0;let t="child"in e.props?e.props.child:e.props.children;np(t)&&"function"==typeof nb&&(t=nb(t._payload)),l=nh(e,t),u.push(l?.props?.children)}else u.push(e)}),l?l=g.cloneElement(l,void 0,u):!d&&1===g.Children.count(a)&&g.isValidElement(a)&&(l=a);let c=l?(r=l,(o=(i=Object.getOwnPropertyDescriptor(r.props,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?r.ref:(o=(i=Object.getOwnPropertyDescriptor(r,"ref")?.get)&&"isReactWarning"in i&&i.isReactWarning)?r.props.ref:r.props.ref||r.ref):void 0,h=nl(n,c);if(!l){if(a||0===a)throw Error(d?ng(e):nm(e));return a}let f=function(e,t){let n={...t};for(let r in t){let i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...e)=>{let t=o(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}(s,l.props??{});return l.type!==g.Fragment&&(f.ref=n?h:c),g.cloneElement(l,f)});return t.displayName=`${e}.Slot`,t}var nu=nd("Slot"),nc=Symbol.for("radix.slottable"),nh=(e,t)=>{if("child"in e.props){let t=e.props.child;return g.isValidElement(t)?g.cloneElement(t,void 0,e.props.children(t.props.children)):null}return g.isValidElement(t)?t:null},nf=Symbol.for("react.lazy");function np(e){var t;return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===nf&&"_payload"in e&&"object"==typeof(t=e._payload)&&null!==t&&"then"in t}var nm=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,ng=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,nb=g[" use ".trim().toString()];let nv=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ny=[],nw=(e,t,n)=>{if(0==e.length-t)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=nw(e,t+1,i);if(n)return n}let o=n.validators;if(null===o)return;let a=0===t?e.join("-"):e.slice(t).join("-"),s=o.length;for(let e=0;e<s;e++){let t=o[e];if(t.validator(a))return t.classGroupId}},nx=(e,t)=>{let n=nv();for(let r in e)nk(e[r],n,r,t);return n},nk=(e,t,n,r)=>{let i=e.length;for(let o=0;o<i;o++)nS(e[o],t,n,r)},nS=(e,t,n,r)=>{"string"==typeof e?nC(e,t,n):"function"==typeof e?nA(e,t,n,r):nE(e,t,n,r)},nC=(e,t,n)=>{(""===e?t:nL(t,e)).classGroupId=n},nA=(e,t,n,r)=>{n_(e)?nk(e(r),t,n,r):(null===t.validators&&(t.validators=[]),t.validators.push({classGroupId:n,validator:e}))},nE=(e,t,n,r)=>{let i=Object.entries(e),o=i.length;for(let e=0;e<o;e++){let[o,a]=i[e];nk(a,nL(t,o),n,r)}},nL=(e,t)=>{let n=e,r=t.split("-"),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=nv(),n.nextPart.set(t,i)),n=i}return n},n_=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,nN=[],nT=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),nR=/\s+/,nM=e=>{let t;if("string"==typeof e)return e;let n="";for(let r=0;r<e.length;r++)e[r]&&(t=nM(e[r]))&&(n&&(n+=" "),n+=t);return n},nP=[],nI=e=>{let t=t=>t[e]||nP;return t.isThemeGetter=!0,t},nD=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,nj=/^\((?:(\w[\w-]*):)?(.+)\)$/i,n$=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,nO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,nz=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,nB=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,nH=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nU=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,nF=e=>n$.test(e),nG=e=>!!e&&!Number.isNaN(Number(e)),nW=e=>!!e&&Number.isInteger(Number(e)),nq=e=>e.endsWith("%")&&nG(e.slice(0,-1)),nV=e=>nO.test(e),nX=()=>!0,nK=e=>nz.test(e)&&!nB.test(e),nY=()=>!1,nJ=e=>nH.test(e),nQ=e=>nU.test(e),nZ=e=>!n2(e)&&!re(e),n0=e=>e.startsWith("@container")&&("/"===e[10]&&void 0!==e[11]||"s"===e[11]&&void 0!==e[16]&&e.startsWith("-size/",10)||"n"===e[11]&&void 0!==e[18]&&e.startsWith("-normal/",10)),n1=e=>rl(e,rh,nY),n2=e=>nD.test(e),n8=e=>rl(e,rf,nK),n5=e=>rl(e,rp,nG),n6=e=>rl(e,rg,nX),n3=e=>rl(e,rm,nY),n4=e=>rl(e,ru,nY),n7=e=>rl(e,rc,nQ),n9=e=>rl(e,rb,nJ),re=e=>nj.test(e),rt=e=>rd(e,rf),rn=e=>rd(e,rm),rr=e=>rd(e,ru),ri=e=>rd(e,rh),ro=e=>rd(e,rc),ra=e=>rd(e,rb,!0),rs=e=>rd(e,rg,!0),rl=(e,t,n)=>{let r=nD.exec(e);return!!r&&(r[1]?t(r[1]):n(r[2]))},rd=(e,t,n=!1)=>{let r=nj.exec(e);return!!r&&(r[1]?t(r[1]):n)},ru=e=>"position"===e||"percentage"===e,rc=e=>"image"===e||"url"===e,rh=e=>"length"===e||"size"===e||"bg-size"===e,rf=e=>"length"===e,rp=e=>"number"===e,rm=e=>"family-name"===e,rg=e=>"number"===e||"weight"===e,rb=e=>"shadow"===e,rv=((e,...t)=>{let n,r,i,o,a=e=>{let t=r(e);if(t)return t;let o=((e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o,postfixLookupClassGroupIds:a}=t,s=[],l=e.trim().split(nR),d="";for(let e=l.length-1;e>=0;e-=1){let t,u=l[e],{isExternal:c,modifiers:h,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(u);if(c){d=u+(d.length>0?" "+d:d);continue}let g=!!m;if(g){let e=(t=r(p.substring(0,m)))&&a[t]?r(p):void 0;e&&e!==t&&(t=e,g=!1)}else t=r(p);if(!t){if(!g||!(t=r(p))){d=u+(d.length>0?" "+d:d);continue}g=!1}let b=0===h.length?"":1===h.length?h[0]:o(h).join(":"),v=f?b+"!":b,y=v+t;if(s.indexOf(y)>-1)continue;s.push(y);let w=i(t,g);for(let e=0;e<w.length;++e){let t=w[e];s.push(v+t)}d=u+(d.length>0?" "+d:d)}return d})(e,n);return i(e,o),o};return o=s=>{var l;let d;return r=(n={cache:(e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,o)=>{n[i]=o,++t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];return void 0!==t?t:void 0!==(t=r[e])?(i(e,t),t):void 0},set(e,t){e in n?n[e]=t:i(e,t)}}})((l=t.reduce((e,t)=>t(e),e())).cacheSize),parseClassName:(e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t,n=[],r=0,i=0,o=0,a=e.length;for(let s=0;s<a;s++){let a=e[s];if(0===r&&0===i){if(":"===a){n.push(e.slice(o,s)),o=s+1;continue}if("/"===a){t=s;continue}}"["===a?r++:"]"===a?r--:"("===a?i++:")"===a&&i--}let s=0===n.length?e:e.slice(o),l=s,d=!1;return s.endsWith("!")?(l=s.slice(0,-1),d=!0):s.startsWith("!")&&(l=s.slice(1),d=!0),nT(n,d,l,t&&t>o?t-o:void 0)};if(t){let e=t+":",n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):nT(nN,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r})(l),sortModifiers:(d=new Map,l.orderSensitiveModifiers.forEach((e,t)=>{d.set(e,1e6+t)}),e=>{let t=[],n=[];for(let r=0;r<e.length;r++){let i=e[r],o="["===i[0],a=d.has(i);o||a?(n.length>0&&(n.sort(),t.push(...n),n=[]),t.push(i)):n.push(i)}return n.length>0&&(n.sort(),t.push(...n)),t}),postfixLookupClassGroupIds:(e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t})(l),...(e=>{let t=(e=>{let{theme:t,classGroups:n}=e;return nx(n,t)})(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]")){var n;let t,r,i;return -1===(n=e).slice(1,-1).indexOf(":")?void 0:(r=(t=n.slice(1,-1)).indexOf(":"),(i=t.slice(0,r))?"arbitrary.."+i:void 0)}let r=e.split("-"),i=+(""===r[0]&&r.length>1);return nw(r,i,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];if(t){if(i){let e=Array(i.length+t.length);for(let t=0;t<i.length;t++)e[t]=i[t];for(let n=0;n<t.length;n++)e[i.length+n]=t[n];return e}return t}return i||ny}return n[e]||ny}}})(l)}).cache.get,i=n.cache.set,o=a,a(s)},(...e)=>o(((...e)=>{let t,n,r=0,i="";for(;r<e.length;)(t=e[r++])&&(n=nM(t))&&(i&&(i+=" "),i+=n);return i})(...e))})(()=>{let e=nI("color"),t=nI("font"),n=nI("text"),r=nI("font-weight"),i=nI("tracking"),o=nI("leading"),a=nI("breakpoint"),s=nI("container"),l=nI("spacing"),d=nI("radius"),u=nI("shadow"),c=nI("inset-shadow"),h=nI("text-shadow"),f=nI("drop-shadow"),p=nI("blur"),m=nI("perspective"),g=nI("aspect"),b=nI("ease"),v=nI("animate"),y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],x=()=>[...w(),re,n2],k=()=>["auto","hidden","clip","visible","scroll"],S=()=>["auto","contain","none"],C=()=>[re,n2,l],A=()=>[nF,"full","auto",...C()],E=()=>[nW,"none","subgrid",re,n2],L=()=>["auto",{span:["full",nW,re,n2]},nW,re,n2],_=()=>[nW,"auto",re,n2],N=()=>["auto","min","max","fr",re,n2],T=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],R=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...C()],P=()=>[nF,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...C()],I=()=>[nF,"screen","full","dvw","lvw","svw","min","max","fit",...C()],D=()=>[nF,"screen","full","lh","dvh","lvh","svh","min","max","fit",...C()],j=()=>[e,re,n2],$=()=>[...w(),rr,n4,{position:[re,n2]}],O=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",ri,n1,{size:[re,n2]}],B=()=>[nq,rt,n8],H=()=>["","none","full",d,re,n2],U=()=>["",nG,rt,n8],F=()=>["solid","dashed","dotted","double"],G=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>[nG,nq,rr,n4],q=()=>["","none",p,re,n2],V=()=>["none",nG,re,n2],X=()=>["none",nG,re,n2],K=()=>[nG,re,n2],Y=()=>[nF,"full",...C()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[nV],breakpoint:[nV],color:[nX],container:[nV],"drop-shadow":[nV],ease:["in","out","in-out"],font:[nZ],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[nV],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[nV],shadow:[nV],spacing:["px",nG],text:[nV],"text-shadow":[nV],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",nF,n2,re,g]}],container:["container"],"container-type":[{"@container":["","normal","size",re,n2]}],"container-named":[n0],columns:[{columns:[nG,n2,re,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:x()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{"inset-s":A(),start:A()}],end:[{"inset-e":A(),end:A()}],"inset-bs":[{"inset-bs":A()}],"inset-be":[{"inset-be":A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[nW,"auto",re,n2]}],basis:[{basis:[nF,"full","auto",s,...C()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[nG,nF,"auto","initial","none",n2]}],grow:[{grow:["",nG,re,n2]}],shrink:[{shrink:["",nG,re,n2]}],order:[{order:[nW,"first","last","none",re,n2]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],gap:[{gap:C()}],"gap-x":[{"gap-x":C()}],"gap-y":[{"gap-y":C()}],"justify-content":[{justify:[...T(),"normal"]}],"justify-items":[{"justify-items":[...R(),"normal"]}],"justify-self":[{"justify-self":["auto",...R()]}],"align-content":[{content:["normal",...T()]}],"align-items":[{items:[...R(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...R(),{baseline:["","last"]}]}],"place-content":[{"place-content":T()}],"place-items":[{"place-items":[...R(),"baseline"]}],"place-self":[{"place-self":["auto",...R()]}],p:[{p:C()}],px:[{px:C()}],py:[{py:C()}],ps:[{ps:C()}],pe:[{pe:C()}],pbs:[{pbs:C()}],pbe:[{pbe:C()}],pt:[{pt:C()}],pr:[{pr:C()}],pb:[{pb:C()}],pl:[{pl:C()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":C()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":C()}],"space-y-reverse":["space-y-reverse"],size:[{size:P()}],"inline-size":[{inline:["auto",...I()]}],"min-inline-size":[{"min-inline":["auto",...I()]}],"max-inline-size":[{"max-inline":["none",...I()]}],"block-size":[{block:["auto",...D()]}],"min-block-size":[{"min-block":["auto",...D()]}],"max-block-size":[{"max-block":["none",...D()]}],w:[{w:[s,"screen",...P()]}],"min-w":[{"min-w":[s,"screen","none",...P()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[a]},...P()]}],h:[{h:["screen","lh",...P()]}],"min-h":[{"min-h":["screen","lh","none",...P()]}],"max-h":[{"max-h":["screen","lh",...P()]}],"font-size":[{text:["base",n,rt,n8]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,rs,n6]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",nq,n2]}],"font-family":[{font:[rn,n3,t]}],"font-features":[{"font-features":[n2]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,re,n2]}],"line-clamp":[{"line-clamp":[nG,"none",re,n5]}],leading:[{leading:[o,...C()]}],"list-image":[{"list-image":["none",re,n2]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",re,n2]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:[nG,"from-font","auto",re,n8]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[nG,"auto",re,n2]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:C()}],"tab-size":[{tab:[nW,re,n2]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",re,n2]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",re,n2]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:$()}],"bg-repeat":[{bg:O()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},nW,re,n2],radial:["",re,n2],conic:[nW,re,n2]},ro,n7]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:H()}],"rounded-s":[{"rounded-s":H()}],"rounded-e":[{"rounded-e":H()}],"rounded-t":[{"rounded-t":H()}],"rounded-r":[{"rounded-r":H()}],"rounded-b":[{"rounded-b":H()}],"rounded-l":[{"rounded-l":H()}],"rounded-ss":[{"rounded-ss":H()}],"rounded-se":[{"rounded-se":H()}],"rounded-ee":[{"rounded-ee":H()}],"rounded-es":[{"rounded-es":H()}],"rounded-tl":[{"rounded-tl":H()}],"rounded-tr":[{"rounded-tr":H()}],"rounded-br":[{"rounded-br":H()}],"rounded-bl":[{"rounded-bl":H()}],"border-w":[{border:U()}],"border-w-x":[{"border-x":U()}],"border-w-y":[{"border-y":U()}],"border-w-s":[{"border-s":U()}],"border-w-e":[{"border-e":U()}],"border-w-bs":[{"border-bs":U()}],"border-w-be":[{"border-be":U()}],"border-w-t":[{"border-t":U()}],"border-w-r":[{"border-r":U()}],"border-w-b":[{"border-b":U()}],"border-w-l":[{"border-l":U()}],"divide-x":[{"divide-x":U()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":U()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...F(),"hidden","none"]}],"divide-style":[{divide:[...F(),"hidden","none"]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-bs":[{"border-bs":j()}],"border-color-be":[{"border-be":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:[...F(),"none","hidden"]}],"outline-offset":[{"outline-offset":[nG,re,n2]}],"outline-w":[{outline:["",nG,rt,n8]}],"outline-color":[{outline:j()}],shadow:[{shadow:["","none",u,ra,n9]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",c,ra,n9]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[nG,n8]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":U()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":["none",h,ra,n9]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[nG,re,n2]}],"mix-blend":[{"mix-blend":[...G(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":G()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[nG]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[re,n2]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[nG]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:$()}],"mask-repeat":[{mask:O()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",re,n2]}],filter:[{filter:["","none",re,n2]}],blur:[{blur:q()}],brightness:[{brightness:[nG,re,n2]}],contrast:[{contrast:[nG,re,n2]}],"drop-shadow":[{"drop-shadow":["","none",f,ra,n9]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:["",nG,re,n2]}],"hue-rotate":[{"hue-rotate":[nG,re,n2]}],invert:[{invert:["",nG,re,n2]}],saturate:[{saturate:[nG,re,n2]}],sepia:[{sepia:["",nG,re,n2]}],"backdrop-filter":[{"backdrop-filter":["","none",re,n2]}],"backdrop-blur":[{"backdrop-blur":q()}],"backdrop-brightness":[{"backdrop-brightness":[nG,re,n2]}],"backdrop-contrast":[{"backdrop-contrast":[nG,re,n2]}],"backdrop-grayscale":[{"backdrop-grayscale":["",nG,re,n2]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[nG,re,n2]}],"backdrop-invert":[{"backdrop-invert":["",nG,re,n2]}],"backdrop-opacity":[{"backdrop-opacity":[nG,re,n2]}],"backdrop-saturate":[{"backdrop-saturate":[nG,re,n2]}],"backdrop-sepia":[{"backdrop-sepia":["",nG,re,n2]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":C()}],"border-spacing-x":[{"border-spacing-x":C()}],"border-spacing-y":[{"border-spacing-y":C()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",re,n2]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[nG,"initial",re,n2]}],ease:[{ease:["linear","initial",b,re,n2]}],delay:[{delay:[nG,re,n2]}],animate:[{animate:["none",v,re,n2]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[m,re,n2]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:V()}],"rotate-x":[{"rotate-x":V()}],"rotate-y":[{"rotate-y":V()}],"rotate-z":[{"rotate-z":V()}],scale:[{scale:X()}],"scale-x":[{"scale-x":X()}],"scale-y":[{"scale-y":X()}],"scale-z":[{"scale-z":X()}],"scale-3d":["scale-3d"],skew:[{skew:K()}],"skew-x":[{"skew-x":K()}],"skew-y":[{"skew-y":K()}],transform:[{transform:[re,n2,"","none","gpu","cpu"]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Y()}],"translate-x":[{"translate-x":Y()}],"translate-y":[{"translate-y":Y()}],"translate-z":[{"translate-z":Y()}],"translate-none":["translate-none"],zoom:[{zoom:[nW,re,n2]}],accent:[{accent:j()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:j()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",re,n2]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":j()}],"scrollbar-track-color":[{"scrollbar-track":j()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":C()}],"scroll-mx":[{"scroll-mx":C()}],"scroll-my":[{"scroll-my":C()}],"scroll-ms":[{"scroll-ms":C()}],"scroll-me":[{"scroll-me":C()}],"scroll-mbs":[{"scroll-mbs":C()}],"scroll-mbe":[{"scroll-mbe":C()}],"scroll-mt":[{"scroll-mt":C()}],"scroll-mr":[{"scroll-mr":C()}],"scroll-mb":[{"scroll-mb":C()}],"scroll-ml":[{"scroll-ml":C()}],"scroll-p":[{"scroll-p":C()}],"scroll-px":[{"scroll-px":C()}],"scroll-py":[{"scroll-py":C()}],"scroll-ps":[{"scroll-ps":C()}],"scroll-pe":[{"scroll-pe":C()}],"scroll-pbs":[{"scroll-pbs":C()}],"scroll-pbe":[{"scroll-pbe":C()}],"scroll-pt":[{"scroll-pt":C()}],"scroll-pr":[{"scroll-pr":C()}],"scroll-pb":[{"scroll-pb":C()}],"scroll-pl":[{"scroll-pl":C()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",re,n2]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[nG,rt,n8,n5]}],stroke:[{stroke:["none",...j()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function ry(...e){return rv(function(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=function e(t){var n,r,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t)if(Array.isArray(t)){var o=t.length;for(n=0;n<o;n++)t[n]&&(r=e(t[n]))&&(i&&(i+=" "),i+=r)}else for(r in t)t[r]&&(i&&(i+=" "),i+=r);return i}(e))&&(r&&(r+=" "),r+=t);return r}(e))}function rw({className:e,variant:t="secondary",asChild:n=!1,...r}){return(0,m.jsx)(n?nu:"span",{"data-slot":"badge",className:ry(function({variant:e="secondary",class:t}={}){return b({primary:"badge-active",secondary:"badge-muted",success:"badge badge-color-green",warning:"badge badge-color-amber",destructive:"badge badge-color-red",outline:"badge border border-base"}[e],t)}({variant:t}),e),...r})}function rx({className:e,variant:t="primary",size:n="md",asChild:r=!1,...i}){return(0,m.jsx)(r?nu:"button",{"data-slot":"button",className:ry(v({variant:t,size:n}),e),...i})}function rk({className:e,variant:t="outline",size:n="md",asChild:r=!1,...i}){return(0,m.jsx)(r?nu:"button",{"data-slot":"icon-button",className:ry(function({variant:e="outline",size:t="md",class:n}={}){return b("ghost"===e?"btn-icon":"btn-icon-square","sm"===t?"w-7! h-7! text-sm":"",n)}({variant:t,size:n}),e),...i})}let rS=[{match:/package\.json$/,icon:"i-catppuccin:npm"},{match:/(?:^|\/)tsconfig(?:\.\w+)?\.json$/,icon:"i-catppuccin:typescript-config"},{match:/\.(?:test|spec)\.[cm]?[jt]sx?$/,icon:"i-catppuccin:typescript-test"},{match:/\.vue$/,icon:"i-catppuccin:vue"},{match:/\.svelte$/,icon:"i-catppuccin:svelte"},{match:/\.tsx$/,icon:"i-catppuccin:typescript-react"},{match:/\.jsx$/,icon:"i-catppuccin:javascript-react"},{match:/\.d\.[cm]?ts$/,icon:"i-catppuccin:typescript-def"},{match:/\.[cm]?ts$/,icon:"i-catppuccin:typescript"},{match:/\.[cm]?js$/,icon:"i-catppuccin:javascript"},{match:/\.json5?$/,icon:"i-catppuccin:json"},{match:/\.ya?ml$/,icon:"i-catppuccin:yaml"},{match:/\.toml$/,icon:"i-catppuccin:toml"},{match:/\.mdx?$/,icon:"i-catppuccin:markdown"},{match:/\.html?$/,icon:"i-catppuccin:html"},{match:/\.(?:css|postcss)$/,icon:"i-catppuccin:css"},{match:/\.s[ac]ss$/,icon:"i-catppuccin:sass"},{match:/\.less$/,icon:"i-catppuccin:less"},{match:/\.svg$/,icon:"i-catppuccin:svg"},{match:/\.(?:png|jpe?g|gif|webp|avif|ico)$/,icon:"i-catppuccin:image"},{match:/\.(?:woff2?|ttf|otf|eot)$/,icon:"i-catppuccin:font"},{match:/\.wasm$/,icon:"i-catppuccin:webassembly"},{match:/\.(?:sh|bash|zsh|fish)$/,icon:"i-catppuccin:bash"},{match:/\.py$/,icon:"i-catppuccin:python"},{match:/\.rs$/,icon:"i-catppuccin:rust"},{match:/\.go$/,icon:"i-catppuccin:go"},{match:/\.(?:xlsx?|csv)$/,icon:"i-catppuccin:table"},{match:/(?:^|\/)\.gitignore$/,icon:"i-catppuccin:git"},{match:/(?:^|\/)LICENSE(?:\.\w+)?$/,icon:"i-catppuccin:license"}];function rC({name:e,className:t,...n}){return(0,m.jsx)("span",{"aria-hidden":!0,className:ry(e,"inline-block shrink-0",t),...n})}function rA({path:e,className:t,...n}){return(0,m.jsx)(rC,{name:function(e){let t=e.replace(/[?#].*$/,"");for(let e of rS)if(e.match.test(t))return e.icon;return"i-catppuccin:file"}(e),className:ry("size-4",t),...n})}var rE=e.i(54737),rL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=nd(`Primitive.${t}`),r=g.forwardRef((e,r)=>{let{asChild:i,...o}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,m.jsx)(i?n:t,{...o,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),r_=globalThis?.document?g.useLayoutEffect:()=>{},rN=e=>{var t;let n,r,{present:i,children:o}=e,a=function(e){var t,n;let[r,i]=g.useState(),o=g.useRef(null),a=g.useRef(e),s=g.useRef("none"),l=g.useRef(void 0),[d,u]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},g.useReducer((e,t)=>n[e][t]??e,t));return g.useEffect(()=>{"mounted"===d?(s.current=l.current??rR(o.current),l.current=void 0):s.current="none"},[d]),r_(()=>{let t=o.current,n=a.current;if(n!==e){let r=s.current,i=rR(t);e?(l.current=i,u("MOUNT")):"none"===i||t?.display==="none"?u("UNMOUNT"):n&&r!==i?u("ANIMATION_OUT"):u("UNMOUNT"),a.current=e}},[e,u]),r_(()=>{if(r){let e,t=r.ownerDocument.defaultView??window,n=n=>{let i=rR(o.current).includes(CSS.escape(n.animationName));if(n.target===r&&i&&(u("ANIMATION_END"),!a.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&&(s.current=rR(o.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)}}u("ANIMATION_END")},[r,u]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:g.useCallback(e=>{if(e){let t=getComputedStyle(e);o.current=t,l.current=rR(t)}else o.current=null;i(e)},[])}}(i),s="function"==typeof o?o({present:a.isPresent}):g.Children.only(o),l=function(...e){let t=g.useRef(e);return t.current=e,g.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=rT(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():rT(n[e],null)}}},[])}(a.ref,(t=s,(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 o||a.isPresent?g.cloneElement(s,{ref:l}):null};function rT(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function rR(e){return e?.animationName||"none"}function rM(e){let t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...e)=>t.current?.(...e),[])}rN.displayName="Presence";var rP=g.createContext(void 0);function rI(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r||!r.defaultPrevented)return t?.(r)}}"u">typeof window&&window.document&&window.document.createElement;var rD="ScrollArea",[rj,r$]=function(e,t=[]){let n=[],r=()=>{let t=n.map(e=>g.createContext(e));return function(n){let r=n?.[e]||t;return g.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return r.scopeName=e,[function(t,r){let i=g.createContext(r);i.displayName=t+"Context";let o=n.length;n=[...n,r];let a=t=>{let{scope:n,children:r,...a}=t,s=n?.[e]?.[o]||i,l=g.useMemo(()=>a,Object.values(a));return(0,m.jsx)(s.Provider,{value:l,children:r})};return a.displayName=t+"Provider",[a,function(n,a,s={}){let{optional:l=!1}=s,d=a?.[e]?.[o]||i,u=g.useContext(d);if(u)return u;if(void 0!==r)return r;if(!l)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 g.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}(r,...t)]}(rD),[rO,rz]=rj(rD),rB=g.forwardRef((e,t)=>{let n,{__scopeScrollArea:r,type:i="hover",dir:o,scrollHideDelay:a=600,...s}=e,[l,d]=g.useState(null),[u,c]=g.useState(null),[h,f]=g.useState(null),[p,b]=g.useState(null),[v,y]=g.useState(null),[w,x]=g.useState(0),[k,S]=g.useState(0),[C,A]=g.useState(!1),[E,L]=g.useState(!1),_=nl(t,d),N=(n=g.useContext(rP),o||n||"ltr");return(0,m.jsx)(rO,{scope:r,type:i,dir:N,scrollHideDelay:a,scrollArea:l,viewport:u,onViewportChange:c,content:h,onContentChange:f,scrollbarX:p,onScrollbarXChange:b,scrollbarXEnabled:C,onScrollbarXEnabledChange:A,scrollbarY:v,onScrollbarYChange:y,scrollbarYEnabled:E,onScrollbarYEnabledChange:L,onCornerWidthChange:x,onCornerHeightChange:S,children:(0,m.jsx)(rL.div,{dir:N,...s,ref:_,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":k+"px",...e.style}})})});rB.displayName=rD;var rH="ScrollAreaViewport",rU=g.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...o}=e,a=rz(rH,n),s=nl(t,g.useRef(null),a.onViewportChange);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(rF,{nonce:i}),(0,m.jsx)(rL.div,{"data-radix-scroll-area-viewport":"",...o,ref:s,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:(0,m.jsx)("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});rU.displayName=rH;var rF=g.memo(({nonce:e})=>(0,m.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:e}),(e,t)=>e.nonce===t.nonce),rG="ScrollAreaScrollbar",rW=g.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=rz(rG,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=i,s="horizontal"===e.orientation;return g.useEffect(()=>(s?o(!0):a(!0),()=>{s?o(!1):a(!1)}),[s,o,a]),"hover"===i.type?(0,m.jsx)(rq,{...r,ref:t,forceMount:n}):"scroll"===i.type?(0,m.jsx)(rV,{...r,ref:t,forceMount:n}):"auto"===i.type?(0,m.jsx)(rX,{...r,ref:t,forceMount:n}):"always"===i.type?(0,m.jsx)(rK,{...r,ref:t,"data-state":"visible"}):null});rW.displayName=rG;var rq=g.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=rz(rG,e.__scopeScrollArea),[o,a]=g.useState(!1);return g.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),a(!0)},r=()=>{t=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return e.addEventListener("pointerenter",n),e.addEventListener("pointerleave",r),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",n),e.removeEventListener("pointerleave",r)}}},[i.scrollArea,i.scrollHideDelay]),(0,m.jsx)(rN,{present:n||o,children:(0,m.jsx)(rX,{"data-state":o?"visible":"hidden",...r,ref:t})})}),rV=g.forwardRef((e,t)=>{var n;let{forceMount:r,...i}=e,o=rz(rG,e.__scopeScrollArea),a="horizontal"===e.orientation,s=ii(()=>d("SCROLL_END"),100),[l,d]=(n={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},g.useReducer((e,t)=>n[e][t]??e,"hidden"));return g.useEffect(()=>{if("idle"===l){let e=window.setTimeout(()=>d("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(e)}},[l,o.scrollHideDelay,d]),g.useEffect(()=>{let e=o.viewport,t=a?"scrollLeft":"scrollTop";if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(d("SCROLL"),s()),n=r};return e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}},[o.viewport,a,d,s]),(0,m.jsx)(rN,{present:r||"hidden"!==l,children:(0,m.jsx)(rK,{"data-state":"hidden"===l?"hidden":"visible",...i,ref:t,onPointerEnter:rI(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:rI(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),rX=g.forwardRef((e,t)=>{let n=rz(rG,e.__scopeScrollArea),{forceMount:r,...i}=e,[o,a]=g.useState(!1),s="horizontal"===e.orientation,l=ii(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;a(s?e:t)}},10);return io(n.viewport,l),io(n.content,l),(0,m.jsx)(rN,{present:r||o,children:(0,m.jsx)(rK,{"data-state":o?"visible":"hidden",...i,ref:t})})}),rK=g.forwardRef((e,t)=>{let{orientation:n="vertical",...r}=e,i=rz(rG,e.__scopeScrollArea),o=g.useRef(null),a=g.useRef(0),[s,l]=g.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=r7(s.viewport,s.content),u={...r,sizes:s,onSizesChange:l,hasThumb:!!(d>0&&d<1),onThumbChange:e=>o.current=e,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:e=>a.current=e};function c(e,t){return function(e,t,n,r="ltr"){let i=r9(n),o=t||i/2,a=n.scrollbar.paddingStart+o,s=n.scrollbar.size-n.scrollbar.paddingEnd-(i-o),l=n.content-n.viewport;return it([a,s],"ltr"===r?[0,l]:[-1*l,0])(e)}(e,a.current,s,t)}return"horizontal"===n?(0,m.jsx)(rY,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){let e=ie(i.viewport.scrollLeft,s,i.dir);o.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=c(e,i.dir))}}):"vertical"===n?(0,m.jsx)(rJ,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){let e=ie(i.viewport.scrollTop,s);o.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=c(e))}}):null}),rY=g.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,o=rz(rG,e.__scopeScrollArea),[a,s]=g.useState(),l=g.useRef(null),d=nl(t,l,o.onScrollbarXChange);return g.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),(0,m.jsx)(r0,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{bottom:0,left:"rtl"===o.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===o.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":r9(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(o.viewport){var r,i;let a=o.viewport.scrollLeft+t.deltaX;e.onWheelScroll(a),r=a,i=n,r>0&&r<i&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&a&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:r4(a.paddingLeft),paddingEnd:r4(a.paddingRight)}})}})}),rJ=g.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,o=rz(rG,e.__scopeScrollArea),[a,s]=g.useState(),l=g.useRef(null),d=nl(t,l,o.onScrollbarYChange);return g.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),(0,m.jsx)(r0,{"data-orientation":"vertical",...i,ref:d,sizes:n,style:{top:0,right:"ltr"===o.dir?0:void 0,left:"rtl"===o.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":r9(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(o.viewport){var r,i;let a=o.viewport.scrollTop+t.deltaY;e.onWheelScroll(a),r=a,i=n,r>0&&r<i&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&a&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:r4(a.paddingTop),paddingEnd:r4(a.paddingBottom)}})}})}),[rQ,rZ]=rj(rG),r0=g.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:s,onThumbPositionChange:l,onDragScroll:d,onWheelScroll:u,onResize:c,...h}=e,f=rz(rG,n),[p,b]=g.useState(null),v=nl(t,b),y=g.useRef(null),w=g.useRef(""),x=f.viewport,k=r.content-r.viewport,S=rM(u),C=rM(l),A=ii(c,10);function E(e){y.current&&d({x:e.clientX-y.current.left,y:e.clientY-y.current.top})}return g.useEffect(()=>{let e=e=>{let t=e.target;p?.contains(t)&&S(e,k)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[x,p,k,S]),g.useEffect(C,[r,C]),io(p,A),io(f.content,A),(0,m.jsx)(rQ,{scope:n,scrollbar:p,hasThumb:i,onThumbChange:rM(o),onThumbPointerUp:rM(a),onThumbPositionChange:C,onThumbPointerDown:rM(s),children:(0,m.jsx)(rL.div,{...h,ref:v,style:{position:"absolute",...h.style},onPointerDown:rI(e.onPointerDown,e=>{0===e.button&&(e.target.setPointerCapture(e.pointerId),y.current=p.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),E(e))}),onPointerMove:rI(e.onPointerMove,E),onPointerUp:rI(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=w.current,f.viewport&&(f.viewport.style.scrollBehavior=""),y.current=null})})})}),r1="ScrollAreaThumb",r2=g.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=rZ(r1,e.__scopeScrollArea);return(0,m.jsx)(rN,{present:n||i.hasThumb,children:(0,m.jsx)(r8,{ref:t,...r})})}),r8=g.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,o=rz(r1,n),a=rZ(r1,n),{onThumbPositionChange:s}=a,l=nl(t,a.onThumbChange),d=g.useRef(void 0),u=ii(()=>{d.current&&(d.current(),d.current=void 0)},100);return g.useEffect(()=>{let e=o.viewport;if(e){let t=()=>{u(),d.current||(d.current=ir(e,s),s())};return s(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[o.viewport,u,s]),(0,m.jsx)(rL.div,{"data-state":a.hasThumb?"visible":"hidden",...i,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:rI(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;a.onThumbPointerDown({x:n,y:r})}),onPointerUp:rI(e.onPointerUp,a.onThumbPointerUp)})});r2.displayName=r1;var r5="ScrollAreaCorner",r6=g.forwardRef((e,t)=>{let n=rz(r5,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&r?(0,m.jsx)(r3,{...e,ref:t}):null});r6.displayName=r5;var r3=g.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=rz(r5,n),[o,a]=g.useState(0),[s,l]=g.useState(0),d=!!(o&&s),{onCornerWidthChange:u,onCornerHeightChange:c}=i;return io(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),l(e)}),io(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),a(e)}),g.useEffect(()=>()=>{u(0),c(0)},[u,c]),d?(0,m.jsx)(rL.div,{...r,ref:t,style:{width:o,height:s,position:"absolute",right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:0,...e.style}}):null});function r4(e){return e?parseInt(e,10):0}function r7(e,t){let n=e/t;return isNaN(n)?0:n}function r9(e){let t=r7(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd;return Math.max((e.scrollbar.size-n)*t,18)}function ie(e,t,n="ltr"){let r=r9(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,a=t.content-t.viewport,s=function(e,[t,n]){return Math.min(n,Math.max(t,e))}(e,"ltr"===n?[0,a]:[-1*a,0]);return it([0,a],[0,o-r])(s)}function it(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}var ir=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return!function i(){let o={left:e.scrollLeft,top:e.scrollTop},a=n.left!==o.left,s=n.top!==o.top;(a||s)&&t(),n=o,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)};function ii(e,t){let n=rM(e),r=g.useRef(0);return g.useEffect(()=>()=>window.clearTimeout(r.current),[]),g.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function io(e,t){let n=rM(t);r_(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}function ia({className:e,children:t,...n}){return(0,m.jsxs)(rB,{"data-slot":"scroll-area",className:ry("relative",e),...n,children:[(0,m.jsx)(rU,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-primary-500/40 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),(0,m.jsx)(is,{}),(0,m.jsx)(r6,{})]})}function is({className:e,orientation:t="vertical",...n}){return(0,m.jsx)(rW,{"data-slot":"scroll-area-scrollbar",orientation:t,className:ry("flex touch-none p-px transition-colors select-none","vertical"===t&&"h-full w-2.5 border-l border-l-transparent","horizontal"===t&&"h-2.5 flex-col border-t border-t-transparent",e),...n,children:(0,m.jsx)(r2,{"data-slot":"scroll-area-thumb",className:"bg-[#8882] relative flex-1 rounded-full"})})}function il({className:e,...t}){return(0,m.jsx)("div",{"data-slot":"skeleton",className:ry("bg-active animate-pulse rounded-md",e),...t})}let id={modified:"M",added:"A",deleted:"D",renamed:"R",copied:"C","type-changed":"T",unmerged:"U",unknown:"?"},iu={added:"text-success",deleted:"text-error",modified:"text-warning",renamed:"color-active",copied:"color-active","type-changed":"text-warning",unmerged:"text-error",unknown:"color-muted"};function ic({code:e,className:t}){return(0,m.jsx)("span",{className:ry("w-3.5 shrink-0 text-center font-mono text-xs font-semibold",iu[e],t),title:e,"aria-label":e,children:id[e]})}let ih="diffs-container";(()=>{try{return!1}catch{return!1}})();let ip=/(?=^From [a-f0-9]+ .+$)/m,im=/(?=^diff --git)/gm,ig=/^(---|\+\+\+)\s+([^\t\r\n]+)/,ib=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,iv=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,iy=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,iw="header-prefix",ix="header-metadata",ik="header-custom",iS={dark:"pierre-dark",light:"pierre-light"},iC="--diffs-scrollbar-gutter-measured",iA={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...iA,hunkLineCount:1});let iE=Object.freeze({fromStart:0,fromEnd:0}),iL={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},i_={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};function iN(e){return e.replace(/\n$|\r\n$/,"")}let iT=new TextEncoder,iR=new TextDecoder("utf-8",{ignoreBOM:!0}),iM=/[\uD800-\uDFFF]/,iP=new Uint8Array(1024);function iI(){1024!==iP.length&&(iP=new Uint8Array(1024))}function iD(e){if(0===e.length)return e;if(iM.test(e))return JSON.parse(JSON.stringify(e));let t=3*e.length;iP.length<t&&(iP=new Uint8Array(t));let{written:n}=iT.encodeInto(e,iP);return iR.decode(iP.subarray(0,n))}function ij(e,{cacheKey:t,isGitDiff:n=im.test(e),oldFile:r,newFile:i,throwOnError:o=!1}={}){let a,s=0,l=iG(e,"@@ "),d=null==r||null==i,u=0,c=0;for(let e of l){let l,f,p=iO(e),m=p[0];if(null==m){if(o)throw Error("parsePatchContent: invalid hunk");console.error("parsePatchContent: invalid hunk",e);continue}let g=iU(m),b=0,v=0;if(null==g||null==a){if(null!=a){if(o)throw Error("parsePatchContent: Invalid hunk");console.error("parsePatchContent: Invalid hunk",e);continue}for(let e of(1===(a={name:"",type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:d,additionLines:d||null==r||null==i?[]:i$(i.contents),deletionLines:d||null==r||null==i?[]:i$(r.contents),cacheKey:iq(t)}).additionLines.length&&i?.contents===""&&(a.additionLines.length=0),1===a.deletionLines.length&&r?.contents===""&&(a.deletionLines.length=0),p)){if(e.startsWith("diff --git")){let t=e.trim().match(iv),n=t?.[1]??t?.[2],r=t?.[3]??t?.[4];if(null==n||null==r){if(o)throw Error("parsePatchContent: invalid git diff header");console.error("parsePatchContent: invalid git diff header",e);continue}a.name=iD(r.trim()),n!==r&&(a.prevName=iD(n.trim()));continue}let t=e.startsWith("---")||e.startsWith("+++")?e.match(n?ib:ig):null;if(null!=t){let[,e,n]=t;if("---"===e&&"/dev/null"!==n){let e=iD(n.trim());a.prevName=e,a.name=e}else"+++"===e&&"/dev/null"!==n&&(a.name=iD(n.trim()))}else if(n){if(e.startsWith("new mode ")&&(a.mode=iD(e.slice(8).trim())),e.startsWith("old mode ")&&(a.prevMode=iD(e.slice(8).trim())),e.startsWith("new file mode")&&(a.type="new",a.mode=iD(e.slice(13).trim())),e.startsWith("deleted file mode")&&(a.type="deleted",a.mode=iD(e.slice(17).trim())),e.startsWith("similarity index")&&(e.startsWith("similarity index 100%")?a.type="rename-pure":a.type="rename-changed"),e.startsWith("index ")){let[,t,n,r]=e.trim().match(iy)??[];null!=t&&(a.prevObjectId=iD(t)),null!=n&&(a.newObjectId=iD(n)),null!=r&&(a.mode=iD(r))}e.startsWith("rename from ")&&(a.prevName=iD(e.slice(12).trim())),e.startsWith("rename to ")&&(a.name=iD(e.slice(10).trim()))}}continue}for(;p.length>0&&("\n"===p[p.length-1]||"\r"===p[p.length-1]||"\r\n"===p[p.length-1]||""===p[p.length-1]);)p.pop();let{additionStart:y,deletionStart:w}=g;u=d?u:w-1,c=d?c:y-1;let x={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:g.additionCount,additionStart:y,additionLines:b,deletionCount:g.deletionCount,deletionStart:w,deletionLines:v,deletionLineIndex:u,additionLineIndex:c,hunkContent:[],hunkContext:iq(g.hunkContext),hunkSpecs:iD(m),noEOFCRAdditions:!1,noEOFCRDeletions:!1},k=0,S=0;for(let e=1;e<p.length;e++){var h;let t=p[e];if(k>=x.additionCount&&S>=x.deletionCount&&!t.startsWith("\\")){if(o&&function(e){let t=e[0];return"+"===t||"-"===t||" "===t}(t)&&!function(e){if(!e.startsWith("--"))return!1;for(let t=2;t<e.length;t++){let n=e[t];if(" "!==n&&" "!==n&&"\n"!==n&&"\r"!==n)return!1}return!0}(t))throw Error("parsePatchContent: hunk has more lines than expected");break}let n=t[0];if("+"!==n&&"-"!==n&&" "!==n&&"\\"!==n){if(o)throw Error("parsePatchContent: invalid hunk line");console.error(`parseLineType: Invalid firstChar: "${n}", full line: "${t}"`),console.error("processFile: invalid rawLine:",t);continue}let r=" "===(h=n)?"context":"\\"===h?"metadata":"+"===h?"addition":"deletion";if("addition"===r){if(o&&k>=x.additionCount)throw Error("parsePatchContent: hunk has too many addition lines");let e=iV(t);(null==l||"change"!==l.type)&&(l=iX("change",u,c),x.hunkContent.push(l)),c++,k++,d&&a.additionLines.push(e),l.additions++,b++,f="addition"}else if("deletion"===r){if(o&&S>=x.deletionCount)throw Error("parsePatchContent: hunk has too many deletion lines");let e=iV(t);(null==l||"change"!==l.type)&&(l=iX("change",u,c),x.hunkContent.push(l)),u++,S++,d&&a.deletionLines.push(e),l.deletions++,v++,f="deletion"}else if("context"===r){if(o&&(S>=x.deletionCount||k>=x.additionCount))throw Error("parsePatchContent: hunk has too many context lines");let e=iV(t);(null==l||"context"!==l.type)&&(l=iX("context",u,c),x.hunkContent.push(l)),c++,u++,k++,S++,d&&(a.deletionLines.push(e),a.additionLines.push(e)),l.lines++,f="context"}else if("metadata"===r&&null!=l){if("context"===l.type?(x.noEOFCRAdditions=!0,x.noEOFCRDeletions=!0):"deletion"===f?x.noEOFCRDeletions=!0:"addition"===f&&(x.noEOFCRAdditions=!0),d&&("addition"===f||"context"===f)){let e=a.additionLines.length-1;e>=0&&(a.additionLines[e]=iN(a.additionLines[e]))}if(d&&("deletion"===f||"context"===f)){let e=a.deletionLines.length-1;e>=0&&(a.deletionLines[e]=iN(a.deletionLines[e]))}}}if(o&&(k!==x.additionCount||S!==x.deletionCount))throw Error("parsePatchContent: hunk line count mismatch");for(let e of(x.additionLines=b,x.deletionLines=v,x.collapsedBefore=Math.max(x.additionStart-1-s,0),a.hunks.push(x),s=x.additionStart+x.additionCount-1,x.hunkContent))"context"===e.type?(x.splitLineCount+=e.lines,x.unifiedLineCount+=e.lines):(x.splitLineCount+=Math.max(e.additions,e.deletions),x.unifiedLineCount+=e.deletions+e.additions);x.splitLineStart=a.splitLineCount+x.collapsedBefore,x.unifiedLineStart=a.unifiedLineCount+x.collapsedBefore,a.splitLineCount+=x.collapsedBefore+x.splitLineCount,a.unifiedLineCount+=x.collapsedBefore+x.unifiedLineCount}if(null!=a){if(o&&d&&!n&&0===a.hunks.length)throw Error("parsePatchContent: unified file has no hunks");if(a.hunks.length>0&&!d&&a.additionLines.length>0&&a.deletionLines.length>0){let e=a.hunks[a.hunks.length-1],t=e.additionStart+e.additionCount-1,n=Math.max(a.additionLines.length-t,0);a.splitLineCount+=n,a.unifiedLineCount+=n}return n||(null!=a.prevName&&a.name!==a.prevName?a.hunks.length>0?a.type="rename-changed":a.type="rename-pure":(null==r||""===r.contents)&&null!=i&&""!==i.contents?a.type="new":null!=r&&""!==r.contents&&(null==i||""===i.contents)&&(a.type="deleted")),"rename-pure"!==a.type&&"rename-changed"!==a.type&&(a.prevName=void 0),a}}function i$(e){let t=iO(e);for(let e=0;e<t.length;e++)t[e]=iD(t[e]);return t}function iO(e){if(0===e.length)return[""];let t=[],n=0;for(;;){let r=e.indexOf("\n",n);if(-1===r)break;t.push(e.slice(n,r+1)),n=r+1}return n<e.length&&t.push(e.slice(n)),t}function iz(e,t){let n=iH(e,t);return iB(e,t,"---")&&iB(e,n,"+++")}function iB(e,t,n){if(!e.startsWith(n,t))return!1;let r=e[t+n.length];if(" "!==r&&" "!==r)return!1;for(let r=t+n.length+1;r<e.length;r++){let t=e[r];if("\n"===t||"\r"===t)break;if(" "!==t&&" "!==t)return!0}return!1}function iH(e,t){let n=e.indexOf("\n",t);return -1===n?e.length:n+1}function iU(e){var t;let n;if(!e.startsWith("@@ -"))return;let r=4,i=iF(e,4);if(null==i)return;let o=i.value;r=i.endIndex;let a=1;if(","===e[r]){let t=iF(e,r+1);if(null==t)return;a=t.value,r=t.endIndex}if(" "!==e[r]||"+"!==e[r+1])return;let s=iF(e,r+=2);if(null==s)return;let l=s.value;r=s.endIndex;let d=1;if(","===e[r]){let t=iF(e,r+1);if(null==t)return;d=t.value,r=t.endIndex}if(" "!==e[r]||"@"!==e[r+1]||"@"!==e[r+2])return;let u=r+3;return" "===e[u]&&(n=(t=e.slice(u+1)).endsWith("\r\n")?t.slice(0,-2):t.endsWith("\n")?t.slice(0,-1):t),{additionCount:d,additionStart:l,deletionCount:a,deletionStart:o,hunkContext:n}}function iF(e,t){let n=t,r=0;for(;n<e.length;n++){let t=e.charCodeAt(n)-48;if(t<0||t>9)break;r=10*r+t}if(n!==t)return{value:r,endIndex:n}}function iG(e,t){if(0===e.length)return[""];let n=`
2
2
  ${t}`,r=e.startsWith(t)?0:iW(e,n,0);if(-1===r)return[e];let i=[];r>0&&i.push(e.slice(0,r));let o=r;for(;;){let t=iW(e,n,o+1);if(-1===t)break;i.push(e.slice(o,t)),o=t}return i.push(e.slice(o)),i}function iW(e,t,n){let r=e.indexOf(t,n);return -1===r?-1:r+1}function iq(e){return null==e?e:iD(e)}function iV(e){let t=e.slice(1);return iD(""===t?"\n":t)}function iX(e,t,n){return"change"===e?{type:"change",additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:"context",lines:0,additionLineIndex:n,deletionLineIndex:t}}function iK(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}let iY={position:"absolute",top:0,bottom:0,textAlign:"center",whiteSpace:"normal",touchAction:"none"},iJ={display:"contents"};function iQ(){return null}function iZ(e,t,n){if(e===t||null==e||null==t)return e===t;let r=new Set(n),i=Object.keys(e),o=new Set(Object.keys(t));for(let n of i)if(o.delete(n),!r.has(n)&&(!(n in t)||e[n]!==t[n]))return!1;for(let e of Array.from(o))if(!r.has(e))return!1;return!0}function i0(e,t){return null==e||null==t||"string"==typeof e||"string"==typeof t?e===t:e.dark===t.dark&&e.light===t.light}function i1(e,t){let n=e?.theme??iS,r=t?.theme??iS,i=i2(e),o=i2(t);return i0(n,r)&&iZ(e,t,["theme","parseDiffOptions"])&&iZ(i,o)}function i2(e){if(null!=e&&"parseDiffOptions"in e)return e.parseDiffOptions}function i8(e){if("u">typeof HTMLStyleElement&&e instanceof HTMLStyleElement)return!0;let t=e.tagName??e.nodeName;return"string"==typeof t&&"style"===t.toLowerCase()}function i5(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function i6(e){return{type:"text",value:e}}function i3({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function i4({name:e,width:t=16,height:n=16,properties:r}){return i3({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...r},children:[i3({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function i7(e){return i3({tagName:"div",properties:{"data-gutter":""},children:e})}function i9(e,t,n){return i3({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":"annotation"===t?void 0:e,style:"annotation"===t?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}let oe=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class ot{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}}function on(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ot(n,r,t)}function or(e){return e.toLowerCase()}ot.prototype.normal={},ot.prototype.property={},ot.prototype.space=void 0;class oi{constructor(e,t){this.attribute=t,this.property=e}}oi.prototype.attribute="",oi.prototype.booleanish=!1,oi.prototype.boolean=!1,oi.prototype.commaOrSpaceSeparated=!1,oi.prototype.commaSeparated=!1,oi.prototype.defined=!1,oi.prototype.mustUseProperty=!1,oi.prototype.number=!1,oi.prototype.overloadedBoolean=!1,oi.prototype.property="",oi.prototype.spaceSeparated=!1,oi.prototype.space=void 0;let oo=0,oa=of(),os=of(),ol=of(),od=of(),ou=of(),oc=of(),oh=of();function of(){return 2**++oo}e.s(["boolean",0,oa,"booleanish",0,os,"commaOrSpaceSeparated",0,oh,"commaSeparated",0,oc,"number",0,od,"overloadedBoolean",0,ol,"spaceSeparated",0,ou],83954);var op=e.i(83954);let om=Object.keys(op);class og extends oi{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<om.length;){const e=om[i];!function(e,t,n){n&&(e[t]=n)}(this,om[i],(n&op[e])===op[e])}}}function ob(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let o=new og(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[or(r)]=r,n[or(o.attribute)]=r}return new ot(t,n,e.space)}og.prototype.defined=!0;let ov=ob({properties:{ariaActiveDescendant:null,ariaAtomic:os,ariaAutoComplete:null,ariaBusy:os,ariaChecked:os,ariaColCount:od,ariaColIndex:od,ariaColSpan:od,ariaControls:ou,ariaCurrent:null,ariaDescribedBy:ou,ariaDetails:null,ariaDisabled:os,ariaDropEffect:ou,ariaErrorMessage:null,ariaExpanded:os,ariaFlowTo:ou,ariaGrabbed:os,ariaHasPopup:null,ariaHidden:os,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:ou,ariaLevel:od,ariaLive:null,ariaModal:os,ariaMultiLine:os,ariaMultiSelectable:os,ariaOrientation:null,ariaOwns:ou,ariaPlaceholder:null,ariaPosInSet:od,ariaPressed:os,ariaReadOnly:os,ariaRelevant:null,ariaRequired:os,ariaRoleDescription:ou,ariaRowCount:od,ariaRowIndex:od,ariaRowSpan:od,ariaSelected:os,ariaSetSize:od,ariaSort:null,ariaValueMax:od,ariaValueMin:od,ariaValueNow:od,ariaValueText:null,role:null},transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase()});function oy(e,t){return t in e?e[t]:t}function ow(e,t){return oy(e,t.toLowerCase())}let ox=ob({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:oc,acceptCharset:ou,accessKey:ou,action:null,allow:null,allowFullScreen:oa,allowPaymentRequest:oa,allowUserMedia:oa,alt:null,as:null,async:oa,autoCapitalize:null,autoComplete:ou,autoFocus:oa,autoPlay:oa,blocking:ou,capture:null,charSet:null,checked:oa,cite:null,className:ou,cols:od,colSpan:null,content:null,contentEditable:os,controls:oa,controlsList:ou,coords:od|oc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:oa,defer:oa,dir:null,dirName:null,disabled:oa,download:ol,draggable:os,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:oa,formTarget:null,headers:ou,height:od,hidden:ol,high:od,href:null,hrefLang:null,htmlFor:ou,httpEquiv:ou,id:null,imageSizes:null,imageSrcSet:null,inert:oa,inputMode:null,integrity:null,is:null,isMap:oa,itemId:null,itemProp:ou,itemRef:ou,itemScope:oa,itemType:ou,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:oa,low:od,manifest:null,max:null,maxLength:od,media:null,method:null,min:null,minLength:od,multiple:oa,muted:oa,name:null,nonce:null,noModule:oa,noValidate:oa,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:oa,optimum:od,pattern:null,ping:ou,placeholder:null,playsInline:oa,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:oa,referrerPolicy:null,rel:ou,required:oa,reversed:oa,rows:od,rowSpan:od,sandbox:ou,scope:null,scoped:oa,seamless:oa,selected:oa,shadowRootClonable:oa,shadowRootDelegatesFocus:oa,shadowRootMode:null,shape:null,size:od,sizes:null,slot:null,span:od,spellCheck:os,src:null,srcDoc:null,srcLang:null,srcSet:null,start:od,step:null,style:null,tabIndex:od,target:null,title:null,translate:null,type:null,typeMustMatch:oa,useMap:null,value:os,width:od,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:ou,axis:null,background:null,bgColor:null,border:od,borderColor:null,bottomMargin:od,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:oa,declare:oa,event:null,face:null,frame:null,frameBorder:null,hSpace:od,leftMargin:od,link:null,longDesc:null,lowSrc:null,marginHeight:od,marginWidth:od,noResize:oa,noHref:oa,noShade:oa,noWrap:oa,object:null,profile:null,prompt:null,rev:null,rightMargin:od,rules:null,scheme:null,scrolling:os,standby:null,summary:null,text:null,topMargin:od,valueType:null,version:null,vAlign:null,vLink:null,vSpace:od,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:oa,disableRemotePlayback:oa,prefix:null,property:null,results:od,security:null,unselectable:null},space:"html",transform:ow}),ok=ob({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",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:oh,accentHeight:od,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:od,amplitude:od,arabicForm:null,ascent:od,attributeName:null,attributeType:null,azimuth:od,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:od,by:null,calcMode:null,capHeight:od,className:ou,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:od,diffuseConstant:od,direction:null,display:null,dur:null,divisor:od,dominantBaseline:null,download:oa,dx:null,dy:null,edgeMode:null,editable:null,elevation:od,enableBackground:null,end:null,event:null,exponent:od,externalResourcesRequired:null,fill:null,fillOpacity:od,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:oc,g2:oc,glyphName:oc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:od,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:od,horizOriginX:od,horizOriginY:od,id:null,ideographic:od,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:od,k:od,k1:od,k2:od,k3:od,k4:od,kernelMatrix:oh,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:od,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:od,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:od,overlineThickness:od,paintOrder:null,panose1:null,path:null,pathLength:od,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:ou,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:od,pointsAtY:od,pointsAtZ:od,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:oh,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:oh,rev:oh,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:oh,requiredFeatures:oh,requiredFonts:oh,requiredFormats:oh,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:od,specularExponent:od,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:od,strikethroughThickness:od,string:null,stroke:null,strokeDashArray:oh,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:od,strokeOpacity:od,strokeWidth:null,style:null,surfaceScale:od,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:oh,tabIndex:od,tableValues:null,target:null,targetX:od,targetY:od,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:oh,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:od,underlineThickness:od,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:od,values:null,vAlphabetic:od,vMathematical:od,vectorEffect:null,vHanging:od,vIdeographic:od,version:null,vertAdvY:od,vertOriginX:od,vertOriginY:od,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:od,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:oy}),oS=ob({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()}),oC=ob({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:ow}),oA=ob({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase()}),oE=on([ov,ox,oS,oC,oA],"html"),oL=on([ov,ok,oS,oC,oA],"svg"),o_={}.hasOwnProperty,oN=/["&'<>`]/g,oT=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,oR=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,oM=/[|\\{}()[\]^$+*?.]/g,oP=new WeakMap,oI=/[\dA-Fa-f]/,oD=/\d/,oj=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],o$={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},oO=["cent","copy","divide","gt","lt","not","para","times"],oz={}.hasOwnProperty,oB={};for(t in o$)oz.call(o$,t)&&(oB[o$[t]]=t);let oH=/[^\dA-Za-z]/;function oU(e,t,n){var r,i;let o,a,s=(r=n.omitOptionalSemicolons,o="&#x"+e.toString(16).toUpperCase(),r&&t&&!oI.test(String.fromCharCode(t))?o:o+";");if((n.useNamedReferences||n.useShortestReferences)&&(a=function(e,t,n,r){let i=String.fromCharCode(e);if(oz.call(oB,i)){let e=oB[i],o="&"+e;return n&&oj.includes(e)&&!oO.includes(e)&&(!r||t&&61!==t&&oH.test(String.fromCharCode(t)))?o:o+";"}return""}(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!a)&&n.useShortestReferences){let r,o=(i=n.omitOptionalSemicolons,r="&#"+String(e),i&&t&&!oD.test(String.fromCharCode(t))?r:r+";");o.length<s.length&&(s=o)}return a&&(!n.useShortestReferences||a.length<s.length)?a:s}function oF(e,t){let n;var r,i=e,o=Object.assign({format:oU},t);if(i=i.replace(o.subset?(r=o.subset,(n=oP.get(r))||(n=function(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(oM,"\\$&"));return RegExp("(?:"+t.join("|")+")","g")}(r),oP.set(r,n)),n):oN,a),o.subset||o.escapeOnly)return i;return i.replace(oT,function(e,t,n){return o.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,n.charCodeAt(t+2),o)}).replace(oR,a);function a(e,t,n){return o.format(e.charCodeAt(0),n.charCodeAt(t+1),o)}}let oG=/^>|^->|<!--|-->|--!>|<!-$/g,oW=[">"],oq=["<",">"];function oV(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 oX=/[A-Z]/g,oK=/-[a-z]/g,oY=/^data[-\w.:]+$/i;function oJ(e){return"-"+e.toLowerCase()}function oQ(e){return e.charAt(1).toUpperCase()}let oZ=/[ \t\n\f\r]/g;function o0(e){return"object"==typeof e?"text"===e.type&&o1(e.value):o1(e)}function o1(e){return""===e.replace(oZ,"")}let o2=o6(1),o8=o6(-1),o5=[];function o6(e){return function(t,n,r){let i=t?t.children:o5,o=(n||0)+e,a=i[o];if(!r)for(;a&&o0(a);)o+=e,a=i[o];return a}}let o3={}.hasOwnProperty;function o4(e){return function(t,n,r){return o3.call(e,t.tagName)&&e[t.tagName](t,n,r)}}let o7=o4({body:function(e,t,n){let r=o2(n,t);return!r||"comment"!==r.type},caption:o9,colgroup:o9,dd:function(e,t,n){let r=o2(n,t);return!r||"element"===r.type&&("dt"===r.tagName||"dd"===r.tagName)},dt:function(e,t,n){let r=o2(n,t);return!!(r&&"element"===r.type&&("dt"===r.tagName||"dd"===r.tagName))},head:o9,html:function(e,t,n){let r=o2(n,t);return!r||"comment"!==r.type},li:function(e,t,n){let r=o2(n,t);return!r||"element"===r.type&&"li"===r.tagName},optgroup:function(e,t,n){let r=o2(n,t);return!r||"element"===r.type&&"optgroup"===r.tagName},option:function(e,t,n){let r=o2(n,t);return!r||"element"===r.type&&("option"===r.tagName||"optgroup"===r.tagName)},p:function(e,t,n){let r=o2(n,t);return r?"element"===r.type&&("address"===r.tagName||"article"===r.tagName||"aside"===r.tagName||"blockquote"===r.tagName||"details"===r.tagName||"div"===r.tagName||"dl"===r.tagName||"fieldset"===r.tagName||"figcaption"===r.tagName||"figure"===r.tagName||"footer"===r.tagName||"form"===r.tagName||"h1"===r.tagName||"h2"===r.tagName||"h3"===r.tagName||"h4"===r.tagName||"h5"===r.tagName||"h6"===r.tagName||"header"===r.tagName||"hgroup"===r.tagName||"hr"===r.tagName||"main"===r.tagName||"menu"===r.tagName||"nav"===r.tagName||"ol"===r.tagName||"p"===r.tagName||"pre"===r.tagName||"section"===r.tagName||"table"===r.tagName||"ul"===r.tagName):!n||"element"!==n.type||"a"!==n.tagName&&"audio"!==n.tagName&&"del"!==n.tagName&&"ins"!==n.tagName&&"map"!==n.tagName&&"noscript"!==n.tagName&&"video"!==n.tagName},rp:ae,rt:ae,tbody:function(e,t,n){let r=o2(n,t);return!r||"element"===r.type&&("tbody"===r.tagName||"tfoot"===r.tagName)},td:at,tfoot:function(e,t,n){return!o2(n,t)},th:at,thead:function(e,t,n){let r=o2(n,t);return!!(r&&"element"===r.type&&("tbody"===r.tagName||"tfoot"===r.tagName))},tr:function(e,t,n){let r=o2(n,t);return!r||"element"===r.type&&"tr"===r.tagName}});function o9(e,t,n){let r=o2(n,t,!0);return!r||"comment"!==r.type&&!("text"===r.type&&o0(r.value.charAt(0)))}function ae(e,t,n){let r=o2(n,t);return!r||"element"===r.type&&("rp"===r.tagName||"rt"===r.tagName)}function at(e,t,n){let r=o2(n,t);return!r||"element"===r.type&&("td"===r.tagName||"th"===r.tagName)}let an=o4({body:function(e){let t=o2(e,-1,!0);return!t||"comment"!==t.type&&!("text"===t.type&&o0(t.value.charAt(0)))&&("element"!==t.type||"meta"!==t.tagName&&"link"!==t.tagName&&"script"!==t.tagName&&"style"!==t.tagName&&"template"!==t.tagName)},colgroup:function(e,t,n){let r=o8(n,t),i=o2(e,-1,!0);return!(n&&r&&"element"===r.type&&"colgroup"===r.tagName&&o7(r,n.children.indexOf(r),n))&&!!(i&&"element"===i.type&&"col"===i.tagName)},head:function(e){let t=new Set;for(let n of e.children)if("element"===n.type&&("base"===n.tagName||"title"===n.tagName)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||"element"===n.type},html:function(e){let t=o2(e,-1);return!t||"comment"!==t.type},tbody:function(e,t,n){let r=o8(n,t),i=o2(e,-1);return!(n&&r&&"element"===r.type&&("thead"===r.tagName||"tbody"===r.tagName)&&o7(r,n.children.indexOf(r),n))&&!!(i&&"element"===i.type&&"tr"===i.tagName)}}),ar={name:[[" \n\f\r &/=>".split("")," \n\f\r \"&'/=>`".split("")],["\0 \n\f\r \"&'/<=>".split(""),"\0 \n\f\r \"&'/<=>`".split("")]],unquoted:[[" \n\f\r &>".split(""),"\0 \n\f\r \"&'<=>`".split("")],["\0 \n\f\r \"&'<=>`".split(""),"\0 \n\f\r \"&'<=>`".split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]},ai=["<","&"];function ao(e,t,n,r){return n&&"element"===n.type&&("script"===n.tagName||"style"===n.tagName)?e.value:oF(e.value,Object.assign({},r.settings.characterReferences,{subset:ai}))}let aa=function(e,t){let n=t||{};function r(t,...n){let i=r.invalid,o=r.handlers;if(t&&o_.call(t,e)){let n=String(t[e]);i=o_.call(o,n)?o[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}("type",{invalid:function(e){throw Error("Expected node, not `"+e+"`")},unknown:function(e){throw Error("Cannot compile unknown node `"+e.type+"`")},handlers:{comment:function(e,t,n,r){return r.settings.bogusComments?"<?"+oF(e.value,Object.assign({},r.settings.characterReferences,{subset:oW}))+">":"<!--"+e.value.replace(oG,function(e){return oF(e,Object.assign({},r.settings.characterReferences,{subset:oq}))})+"-->"},doctype:function(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"},element:function(e,t,n,r){let i,o=r.schema,a="svg"!==o.space&&r.settings.omitOptionalTags,s="svg"===o.space?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),l=[];"html"===o.space&&"svg"===e.tagName&&(r.schema=oL);let d=function(e,t){let n,r=[],i=-1;if(t){for(n in t)if(null!==t[n]&&void 0!==t[n]){let i=function(e,t,n){let r,i=function(e,t){let n=or(t),r=t,i=oi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&oY.test(t)){if("-"===t.charAt(4)){let e=t.slice(5).replace(oK,oQ);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!oK.test(e)){let n=e.replace(oX,oJ);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}i=og}return new i(r,t)}(e.schema,t),o=e.settings.allowParseErrors&&"html"===e.schema.space?0:1,a=+!e.settings.allowDangerousCharacters,s=e.quote;if(i.overloadedBoolean&&(n===i.attribute||""===n)?n=!0:(i.boolean||i.overloadedBoolean)&&("string"!=typeof n||n===i.attribute||""===n)&&(n=!!n),null==n||!1===n||"number"==typeof n&&Number.isNaN(n))return"";let l=oF(i.attribute,Object.assign({},e.settings.characterReferences,{subset:ar.name[o][a]}));return!0===n||(n=Array.isArray(n)?(i.commaSeparated?function(e,t){let n=t||{};return(""===e[e.length-1]?[...e,""]:e).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}:function(e){return e.join(" ").trim()})(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?l:(e.settings.preferUnquoted&&(r=oF(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:ar.unquoted[o][a]}))),r!==n&&(e.settings.quoteSmart&&oV(n,s)>oV(n,e.alternative)&&(s=e.alternative),r=s+oF(n,Object.assign({},e.settings.characterReferences,{subset:("'"===s?ar.single:ar.double)[o][a],attribute:!0}))+s),l+(r?"="+r:r))}(e,n,t[n]);i&&r.push(i)}}for(;++i<r.length;){let t=e.settings.tightAttributes?r[i].charAt(r[i].length-1):void 0;i!==r.length-1&&'"'!==t&&"'"!==t&&(r[i]+=" ")}return r.join("")}(r,e.properties),u=r.all("html"===o.space&&"template"===e.tagName?e.content:e);return r.schema=o,u&&(s=!1),!d&&a&&an(e,t,n)||(l.push("<",e.tagName,d?" "+d:""),s&&("svg"===o.space||r.settings.closeSelfClosing)&&(i=d.charAt(d.length-1),(!r.settings.tightSelfClosing||"/"===i||i&&'"'!==i&&"'"!==i)&&l.push(" "),l.push("/")),l.push(">")),l.push(u),s||a&&o7(e,t,n)||l.push("</"+e.tagName+">"),l.join("")},raw:function(e,t,n,r){return r.settings.allowDangerousHtml?e.value:ao(e,t,n,r)},root:function(e,t,n,r){return r.all(e)},text:ao}}),as={},al={},ad=[];function au(e,t){let n=t||as,r=n.quote||'"';if('"'!==r&&"'"!==r)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return({one:ac,all:ah,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||oe,characterReferences:n.characterReferences||al,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:"svg"===n.space?oL:oE,quote:r,alternative:'"'===r?"'":'"'}).one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function ac(e,t,n){return aa(e,t,n,this)}function ah(e){let t=[],n=e&&e.children||ad,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}var af=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;proposedSelectedRange;renderedSelectionRange;selectionAnchor;queuedSelectionRender;pointerSession={mode:"idle"};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener("click",this.handlePointerClick),this.pre?.removeEventListener("pointerdown",this.handlePointerDown),this.pre?.removeEventListener("pointermove",this.handlePointerMove),this.pre?.removeEventListener("pointerleave",this.handlePointerLeave),this.pre?.removeAttribute("data-interactive-lines"),this.pre?.removeAttribute("data-interactive-line-numbers"),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),null!=this.queuedSelectionRender&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1}setup(e){this.setSelectionDirty();let{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?this.ensureGutterUtilityNode(t):null!=this.gutterUtilityContainer&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,"gutterSelecting"===this.pointerSession.mode&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectionRange=void 0}isSelectionDirty(){return null===this.renderedSelectionRange}setSelection(e,t){let n=!(e===this.selectedRange||i5(e??void 0,this.selectedRange??void 0));(this.isSelectionDirty()||n)&&(this.proposedSelectedRange=void 0,this.selectedRange=e,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted())}getSelection(){return this.selectedRange}getHoveredLine=()=>{let e=this.gutterUtilityLine??this.hoveredLine;if(null!=e){if("diff"===this.mode&&"diff-line"===e.type)return{lineNumber:e.lineNumber,side:e.annotationSide};if("file"===this.mode&&"line"===e.type)return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{let{onHunkExpand:t,onLineClick:n,onLineNumberClick:r,onTokenClick:i,onMergeConflictActionClick:o}=this.options;null==t&&null==n&&null==r&&null==o&&null==i||null!=this.options.onGutterUtilityClick&&aS(e.composedPath())||(aC(this.options.__debugPointerEvents,"click","FileDiff.DEBUG.handlePointerClick:",e),this.handlePointerEvent({eventType:"click",event:e}))};handlePointerMove=e=>{if("mouse"!==e.pointerType)return;let{lineHoverHighlight:t="disabled",onLineEnter:n,onLineLeave:r,onTokenEnter:i,onTokenLeave:o,enableGutterUtility:a=!1}=this.options;("disabled"!==t||a||null!=n||null!=r||null!=i||null!=o)&&(aC(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{let{__debugPointerEvents:t}=this.options;(aC(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),null==this.hoveredLine&&null==this.hoveredToken)?aC(t,"move","FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token"):(null!=this.hoveredToken&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),null!=this.hoveredLine&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility())};handlePointerEvent({eventType:e,event:t}){let{__debugPointerEvents:n}=this.options,r=t.composedPath();aC(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:r});let i=this.resolvePointerTarget(r);aC(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",i);let{onLineClick:o,onLineNumberClick:a,onLineEnter:s,onLineLeave:l,onTokenClick:d,onTokenEnter:u,onTokenLeave:c,onHunkExpand:h,onMergeConflictActionClick:f}=this.options;switch(e){case"move":{let e=ab(i)&&this.hoveredLine?.lineElement===i.lineElement;!(ag(i)&&this.hoveredToken?.tokenElement===i.tokenElement)&&(null!=this.hoveredToken&&(c?.(this.hoveredToken,t),this.clearHoveredToken()),ag(i)&&(this.setHoveredToken(this.toTokenEventBaseProps(i)),u?.(this.hoveredToken,t))),e||(null!=this.hoveredLine&&(l?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),ab(i)?(this.setHoveredLine(this.toEventBaseProps(i)),this.placeUtility(),s?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{var p,m;if(null==i)break;if("kind"in(p=i)&&"merge-conflict-action"===p.kind&&null!=f){f(i);break}if("type"in(m=i)&&"line-info"===m.type&&null!=h){h(i.hunkIndex,i.all||t.shiftKey?"both":i.direction,i.all||t.shiftKey?1/0:void 0);break}if(!ab(i))break;ag(i)&&null!=d&&d(this.toTokenEventBaseProps(i),t);let e=this.toEventBaseProps(i);null!=a&&i.numberColumn?a({...e,event:t}):null!=o&&o({...e,event:t})}}}syncPointerListeners(e){let{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:r,onLineNumberClick:i,onLineEnter:o,onLineLeave:a,onTokenClick:s,onTokenEnter:l,onTokenLeave:d,onHunkExpand:u,onMergeConflictActionClick:c,enableGutterUtility:h=!1,enableLineSelection:f=!1,onGutterUtilityClick:p}=this.options,m=null!=p,g="disabled"!==n||null!=r||null!=i||null!=o||null!=a||null!=s||null!=l||null!=d||null!=u||null!=c||h||f||m;if(g&&!this.hasPointerListeners){let n;e.addEventListener("click",this.handlePointerClick),e.addEventListener("pointerdown",this.handlePointerDown),e.addEventListener("pointermove",this.handlePointerMove),e.addEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!0,aC(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(n=[],("both"===t||"click"===t)&&(null!=r&&n.push("onLineClick"),null!=i&&n.push("onLineNumberClick"),null!=u&&n.push("expandable hunk separators"),null!=c&&n.push("merge conflict actions")),n)),aC(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),aC(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")}else!g&&this.hasPointerListeners&&(e.removeEventListener("click",this.handlePointerClick),e.removeEventListener("pointerdown",this.handlePointerDown),e.removeEventListener("pointermove",this.handlePointerMove),e.removeEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!1);let b="selecting"===this.pointerSession.mode||"pendingSingleLineUnselect"===this.pointerSession.mode,v="gutterSelecting"===this.pointerSession.mode;(!f&&b||!m&&v)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(null==this.pre)return;let{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,r=null!=e,i=null!=t||n;r&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!r&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),i&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!i&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute("data-interactive-line-numbers"),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if("mouse"===e.pointerType&&0!==e.button||null==this.pre||"idle"!==this.pointerSession.mode)return;let t=e.composedPath();aS(t)&&null!=this.options.onGutterUtilityClick?this.startGutterSelectionFromPointerDown(e):("mouse"!==e.pointerType&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){let{enableLineSelection:t=!1}=this.options;if(!t)return;let n=this.resolveSelectionInfo(e,{source:"event-path",requireNumberColumn:!0});if(null==n)return;let{pre:r}=this;if(null==r)return;let{lineNumber:i,eventSide:o,lineIndex:a}=n;if(e.shiftKey&&null!=this.selectedRange){let t=this.getIndexesFromSelection(this.selectedRange,"split"===r.getAttribute("data-diff-type"));if(null==t)return;let n=t.start<=t.end?a>=t.start:a<=t.end;this.selectionAnchor={lineNumber:n?this.selectedRange.start:this.selectedRange.end,side:n?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(i,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===i&&this.selectedRange?.end===i){let t={lineNumber:i,side:o};this.selectionAnchor=t,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:t,pending:t},this.attachDocumentPointerListeners();return}!0===this.options.controlledSelection?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:i,side:o},this.updateSelection(i,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){let{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;if(null==n)return;let r=this.currentSelectionEnds(),i=r?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),o=r?.top??i;null!=i&&null!=o&&(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:o,current:i},t&&(this.selectionAnchor={lineNumber:o.lineNumber,side:o.side},this.updateSelection(i.lineNumber,i.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange())),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{let{enableLineSelection:t=!1}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let n=this.resolveSelectionPoint(e,{source:"coordinates-first"});if(null==n)return;this.pointerSession.current=n,!0===t&&this.updateSelection(n.lineNumber,n.side);return}case"selecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(null==t||null==this.selectionAnchor)return;this.updateSelection(t.lineNumber,t.eventSide);return}case"pendingSingleLineUnselect":{var n;if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let t=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(null==t||null==this.selectionAnchor)return;let r={lineNumber:t.lineNumber,side:t.eventSide};if(n=this.pointerSession.pending,n.lineNumber===r.lineNumber&&n.side===r.side)return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{let{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();let r=this.resolveSelectionPoint(e,{source:"coordinates-first"});null!=r&&(this.pointerSession.current=r,t&&this.updateSelection(r.lineNumber,r.side)),n?.(this.buildSelectedLineRange(this.pointerSession.anchor,this.pointerSession.current)),this.selectionAnchor=void 0,t&&(this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case"pendingSingleLineUnselect":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection();return;case"selecting":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":case"selecting":case"pendingSingleLineUnselect":if("pointerId"in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){null!=this.hoveredLine&&(this.hoveredLine.lineElement.removeAttribute("data-hovered"),this.hoveredLine.numberElement.removeAttribute("data-hovered"),this.hoveredLine=void 0)}setHoveredLine(e){let{lineHoverHighlight:t="disabled"}=this.options;null!=this.hoveredLine&&this.clearHoveredLine(),this.hoveredLine=e,"disabled"!==t&&(("both"===t||"line"===t)&&this.hoveredLine.lineElement.setAttribute("data-hovered",""),("both"===t||"number"===t)&&this.hoveredLine.numberElement.setAttribute("data-hovered",""))}clearHoveredToken(){null!=this.hoveredToken&&(this.hoveredToken=void 0)}setHoveredToken(e){null!=this.hoveredToken&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(null==this.gutterUtilityContainer&&(this.gutterUtilityContainer=document.createElement("div"),this.gutterUtilityContainer.setAttribute("data-gutter-utility-slot","")),e)null!=this.gutterUtilityButton&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),null==this.gutterUtilitySlot&&(this.gutterUtilitySlot=document.createElement("slot"),this.gutterUtilitySlot.name="gutter-utility-slot"),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,null==this.gutterUtilityButton){let e=document.createElement("div");e.innerHTML=au(i3({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[i4({name:"diffs-icon-plus",properties:{"data-icon":""}})]}));let t=e.firstElementChild;if(!(t instanceof HTMLButtonElement))throw Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");t.remove(),this.gutterUtilityButton=t}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;let t=this.resolvePointerTarget(e);am(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(null!=this.hoveredLine)return void this.showUtilityOnLine(this.hoveredLine);this.hideUtility()}}placeUtilityFromSelection(){let e=this.currentSelectionEnds();if(null==e)return!1;let t=this.targetForSelectionPoint(e.bottom);return null==t?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){null!=this.gutterUtilityContainer&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){let e=this.getCurrentSelectionRange();return null==e?void 0:this.selectionEnds(e)}selectionEnds(e){let t={lineNumber:e.start,side:e.side},n={lineNumber:e.end,side:e.endSide??e.side},r=this.selectionPointRowIndex(t),i=this.selectionPointRowIndex(n);if(null!=r&&null!=i)return r>i?{top:n,bottom:t}:{top:t,bottom:n}}selectionPointRowIndex(e){let t=this.getLineIndex(e.lineNumber,e.side);if(null!=t)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(null==this.pre)return;let t=this.getLineIndex(e.lineNumber,e.side);if(null==t)return;let n="diff"===this.mode?`${t[0]},${t[1]}`:`${t[0]}`;for(let t of this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`)){if(!(t instanceof HTMLElement))continue;let n=this.resolvePointerTarget(ay(t));if(am(n)&&("diff"!==this.mode||null==e.side||n.side===e.side))return n}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||(document.addEventListener("pointermove",this.handleDocumentPointerMove),document.addEventListener("pointerup",this.handleDocumentPointerUp),document.addEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&(document.removeEventListener("pointermove",this.handleDocumentPointerMove),document.removeEventListener("pointerup",this.handleDocumentPointerUp),document.removeEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!1)}clearPointerSession(){this.pointerSession={mode:"idle"}}clearPendingSingleLineState(){"pendingSingleLineUnselect"===this.pointerSession.mode&&(this.pointerSession={mode:"idle"})}selectionInfoFromPath(e,t){let n=this.resolvePointerTarget(e);if(am(n)&&(!t||n.numberColumn)&&null!=n.splitLineIndex)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:"diff"===this.mode?n.side:void 0}}resolveSelectionInfo(e,t){let n=this.resolveSelectionPath(e,t);return null!=n?this.selectionInfoFromPath(n,t.requireNumberColumn):void 0}selectionPointFromPath(e){let t=this.resolvePointerTarget(e);if(am(t))return{lineNumber:t.lineNumber,side:"diff"===this.mode?t.side:void 0}}resolveSelectionPoint(e,t){let n=this.resolveSelectionPath(e,t);return null!=n?this.selectionPointFromPath(n):void 0}resolveSelectionPath(e,t){let n=!1!==t.excludeUtility;switch(t.source){case"event-path":return this.pathFromEventPath(e.composedPath(),n);case"coordinates-first":{let t=this.pathFromCoordinates(e,n);if(void 0!==t)return t??void 0;return this.pathFromEventPath(e.composedPath(),n)}}}pathFromCoordinates(e,t){let n=this.hitTest(e);if(void 0!==n)return null===n?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&aS(e))){for(let n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){let n=ay(e);if(t&&aS(n))return;let r=function(e){let t=e.closest("[data-line], [data-column-number]");if(t instanceof HTMLElement)return t;let n=e.closest('[data-line-annotation], [data-gutter-buffer="annotation"]');if(!(n instanceof HTMLElement))return;let r=n.previousElementSibling;return r instanceof HTMLElement&&(r.hasAttribute("data-line")||r.hasAttribute("data-column-number"))?r:void 0}(e);return null!=r?ay(r):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){let t=function(e){if(null==e)return;let t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(null==t)return;let n=Number.parseInt(t[2],10);if(Number.isFinite(n)&&!(n<=0))return{lineNumber:n,side:t[1]}}(function(e){let t=e.closest('[slot^="annotation-"]');if(t instanceof HTMLElement)return t.getAttribute("slot")??void 0;if(e instanceof HTMLElement){let t=e.getAttribute("name")??void 0;return null!=t&&t.startsWith("annotation-")?t:void 0}}(e));if(null==t)return;let n=this.targetForSelectionPoint(t);return null!=n?ay(n.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;let t=this.pre?.getRootNode(),n=aw(t)?t:aw(document)?document:void 0;if(null!=n)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){let{getLineIndex:n}=this.options;return null!=n?n(e,t):[e-1,e-1]}getCurrentSelectionRange(){return void 0!==this.proposedSelectedRange?this.proposedSelectedRange:this.selectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){let r,i=this.getCurrentSelectionRange();if(null==e)r=null;else{let n=this.selectionAnchor?.side??t,i=this.selectionAnchor?.lineNumber??e;r=this.buildSelectionRange(i,e,n,t)}!i5(i??void 0,r??void 0)&&(!0===this.options.controlledSelection?this.proposedSelectedRange=r:(this.selectedRange=r,this.queuedSelectionRender??=requestAnimationFrame(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(null==this.pre)return;let n=this.getLineIndex(e.start,e.side),r=this.getLineIndex(e.end,e.endSide??e.side);return null!=n&&null!=r?{start:t?n[1]:n[0],end:t?r[1]:r[0]}:void 0}renderSelection=()=>{if(null!=this.queuedSelectionRender&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),null==this.pre||this.renderedSelectionRange===this.selectedRange)return;for(let e of this.pre.querySelectorAll("[data-selected-line]"))e.removeAttribute("data-selected-line");if(this.renderedSelectionRange=this.selectedRange,null==this.selectedRange)return;let{children:e}=this.pre;if(0===e.length)return;if(e.length>2)throw console.error(e),Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");let t="split"===this.pre.getAttribute("data-diff-type"),n=this.getIndexesFromSelection(this.selectedRange,t);if(null==n)throw console.error({rowRange:n,selectedRange:this.selectedRange}),Error("InteractionManager.renderSelection: No valid rowRange");let r=n.start===n.end,i=Math.min(n.start,n.end),o=Math.max(n.start,n.end);for(let n of e){let[e,a]=n.children,s=a.children.length;if(s!==e.children.length)throw Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");for(let n=0;n<s;n++){let s=a.children[n],l=e.children[n];if(!(s instanceof HTMLElement)||!(l instanceof HTMLElement))continue;let d=this.parseLineIndex(s,t);if((d??0)>o)break;if(null==d||d<i)continue;let u=r?"single":d===i?"first":d===o?"last":"";s.setAttribute("data-selected-line",u),l.setAttribute("data-selected-line",u),l.nextSibling instanceof HTMLElement&&s.nextSibling instanceof HTMLElement&&(s.nextSibling.hasAttribute("data-line-annotation")||s.nextSibling.hasAttribute("data-merge-conflict-actions"))&&(r?(u="last",s.setAttribute("data-selected-line","first")):d===i?u="":d===o&&s.setAttribute("data-selected-line",""),s.nextSibling.setAttribute("data-selected-line",u),l.nextSibling.setAttribute("data-selected-line",u))}}};notifySelectionCommitted(){this.options.onLineSelected?.(this.getCurrentSelectionRange()??null)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return"file"===this.mode?{type:"line",lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:"diff-line",annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:o}){return"file"===this.mode?{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:i,tokenText:o}:{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,side:r,tokenElement:i,tokenText:o}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,r){return{start:e,end:t,...null!=n?{side:n}:{},...n!==r&&null!=r?{endSide:r}:{}}}resolvePointerTarget(e){let t,n,r,i,o,a,s,l,d,u,c=!1;for(let f of e){if(!(f instanceof HTMLElement))continue;if(null==u&&f.hasAttribute("data-merge-conflict-action")){var h;let e=f.getAttribute("data-merge-conflict-action")??void 0,t=f.getAttribute("data-merge-conflict-conflict-index")??void 0,n=null!=t?Number.parseInt(t,10):NaN;("current"===(h=e)||"incoming"===h||"both"===h)&&Number.isFinite(n)&&(u={kind:"merge-conflict-action",resolution:e,conflictIndex:n})}if(null==a&&f.hasAttribute("data-char")){a=f;let e=f.getAttribute("data-char");if(null!=e){let t=Number.parseInt(e,10);if(!Number.isNaN(t)){let e=f.textContent??"",n=t+e.length;(""!==e.trim()||!0===this.options.enableTokenInteractionsOnWhitespace)&&(s={tokenElement:a,lineCharStart:t,lineCharEnd:n,tokenText:e});continue}}}let e=null==o?f.getAttribute("data-column-number")??void 0:void 0;if(null!=e){o=f,d=Number.parseInt(e,10),c=!0,t=ak(f),i=f.getAttribute("data-line-index")??void 0;continue}let p=null==r?f.getAttribute("data-line")??void 0:void 0;if(null!=p){r=f,d=Number.parseInt(p,10),t=ak(f),i=f.getAttribute("data-line-index")??void 0;continue}if(null==l&&(f.hasAttribute("data-expand-button")||f.hasAttribute("data-unmodified-lines"))){l={hunkIndex:void 0,direction:f.hasAttribute("data-expand-up")?"up":f.hasAttribute("data-expand-down")?"down":"both",all:f.hasAttribute("data-expand-all-button")};continue}let m=null!=l?f.getAttribute("data-expand-index")??void 0:void 0;if(null!=l&&null!=m){let e=Number.parseInt(m,10);Number.isNaN(e)||(l.hunkIndex=e);continue}if(null==n&&f.hasAttribute("data-code")){n=f;break}}if(null!=u)return u;if(l?.hunkIndex!=null)return{type:"line-info",hunkIndex:l.hunkIndex,direction:l.direction,all:l.all};if(r??=null!=i?av(n,`[data-line][data-line-index="${i}"]`):void 0,o??=null!=i?av(n,`[data-column-number][data-line-index="${i}"]`):void 0,null==n||null==r||null==o||null==t||null==d||Number.isNaN(d))return;let f=this.parseLineIndex(r,this.isSplitDiff());return null!=s?"file"===this.mode?{kind:"token",lineType:t,lineElement:r,lineNumber:d,numberColumn:c,numberElement:o,side:void 0,splitLineIndex:f,...s}:{kind:"token",lineType:t,lineElement:r,lineNumber:d,numberColumn:c,numberElement:o,side:ax(t,n),splitLineIndex:f,...s}:"file"===this.mode?{kind:"line",lineType:t,lineElement:r,lineNumber:d,numberColumn:c,numberElement:o,side:void 0,splitLineIndex:f}:{kind:"line",lineType:t,lineElement:r,lineNumber:d,numberColumn:c,numberElement:o,side:ax(t,n),splitLineIndex:f}}isSplitDiff(){return this.pre?.getAttribute("data-diff-type")==="split"}parseLineIndex(e,t){let n=(e.getAttribute("data-line-index")??"").split(",").map(e=>Number.parseInt(e,10)).filter(e=>!Number.isNaN(e));return t&&2===n.length?n[1]:t?void 0:n[0]}};function ap({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:r,onLineClick:i,onLineEnter:o,onLineLeave:a,onLineNumberClick:s,onTokenClick:l,onTokenEnter:d,onTokenLeave:u,renderGutterUtility:c,__debugPointerEvents:h,enableLineSelection:f,controlledSelection:p,onLineSelected:m,onLineSelectionStart:g,onLineSelectionChange:b,onLineSelectionEnd:v},y,w,x){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:function({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(null!=n&&null!=t)throw Error("Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.");return e??!1}({enableGutterUtility:t,renderGutterUtility:c,onGutterUtilityClick:r}),usesCustomGutterUtility:null!=c,lineHoverHighlight:n,onGutterUtilityClick:r,onHunkExpand:y,onMergeConflictActionClick:x,onLineClick:i,onLineEnter:o,onLineLeave:a,onLineNumberClick:s,onTokenClick:l,onTokenEnter:d,onTokenLeave:u,__debugPointerEvents:h,enableLineSelection:f,controlledSelection:p,onLineSelected:m,onLineSelectionStart:g,onLineSelectionChange:b,onLineSelectionEnd:v,getLineIndex:w}}function am(e){return null!=e&&"kind"in e&&"line"===e.kind}function ag(e){return null!=e&&"kind"in e&&"token"===e.kind}function ab(e){return am(e)||ag(e)}function av(e,t){let n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function ay(e){let t=[],n=e;for(;null!=n;)t.push(n),n=n.parentNode;return t}function aw(e){return null!=e&&"function"==typeof e.elementFromPoint}function ax(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function ak(e){let t=e.getAttribute("data-line-type");if(null!=t)switch(t){case"change-deletion":case"change-addition":case"context":case"context-expanded":return t;default:return}}function aS(e){for(let t of e)if(t instanceof HTMLElement&&(t.hasAttribute("data-utility-button")||t.hasAttribute("data-gutter-utility-slot")||"gutter-utility-slot"===t.getAttribute("slot")||"gutter-utility-slot"===t.getAttribute("name")))return!0;return!1}function aC(e="none",t,...n){switch(e){case"none":return;case"both":break;case"click":if("click"!==t)return;break;case"move":if("move"!==t)return}console.log(...n)}var aA=class e{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){let t=e.resizeObserver??new ResizeObserver(e.handleSharedResizeEntries);return e.resizeObserver=t,t}static handleSharedResizeEntries(t){let n=new Map;for(let r of t){let t=e.managersByElement.get(r.target);if(null==t)continue;let i=n.get(t);null==i?n.set(t,[r]):i.push(r)}for(let[e,t]of n)e.handleResizeEntries(t)}observedNodes=new Map;setup(e,t){let n=new Set,r=0,i=new Map(this.observedNodes);for(let t of(this.observedNodes.clear(),e.children)){if(2===r)break;let e=(()=>{if(t instanceof HTMLElement&&"CODE"===t.tagName)return t})();if(null==e)continue;r++;let n=i.get(e);if(null!=n&&"code"!==n.type)throw Error("ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible");let o=e.firstElementChild;o instanceof HTMLElement||(o=null),null!=n?(this.observedNodes.set(e,n),i.delete(e),n.numberElement!==o?(null!=n.numberElement&&(this.unobserve(n.numberElement),i.delete(n.numberElement)),null!=o&&(this.observe(o),i.delete(o),this.observedNodes.set(o,n)),n.numberElement=o,n.numberWidth=0):null!=n.numberElement?(i.delete(n.numberElement),this.observedNodes.set(n.numberElement,n)):n.numberWidth=0):(n={type:"code",codeElement:e,numberElement:o,codeWidth:"auto",numberWidth:0},this.observedNodes.set(e,n),this.observe(e),null!=o&&(this.observedNodes.set(o,n),this.observe(o)))}if(r>1&&!t){let t=e.querySelectorAll('[data-line-annotation*=","]'),r=new Map;for(let e of t){if(!(e instanceof HTMLElement))continue;let t=e.getAttribute("data-line-annotation")??"";if(!/^-?\d+,-?\d+$/.test(t)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:t,element:e});continue}let n=r.get(t);null==n&&(n=[],r.set(t,n)),n.push(e)}for(let[e,t]of r){if(2!==t.length){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",e,t);continue}let[r,o]=t,a=r.firstElementChild,s=o.firstElementChild;if(!(r instanceof HTMLElement)||!(o instanceof HTMLElement)||!(a instanceof HTMLElement)||!(s instanceof HTMLElement))continue;let l=i.get(a);if(null!=l){this.observedNodes.set(a,l),this.observedNodes.set(s,l),i.delete(a),i.delete(s);continue}let d=a.getBoundingClientRect().height,u=s.getBoundingClientRect().height;l={type:"annotations",column1:{container:r,child:a,childHeight:d},column2:{container:o,child:s,childHeight:u},currentHeight:"auto"},n.add({child1:a,child2:s,item:l,newHeight:Math.max(d,u)})}for(let e of n)this.applyNewHeight(e.item,e.newHeight),this.observedNodes.set(e.child1,e.item),this.observedNodes.set(e.child2,e.item),this.observe(e.child1),this.observe(e.child2);n.clear()}for(let[e,t]of i){var o,a;this.unobserve(e),"code"===t.type?(o=t).codeElement.isConnected&&(o.codeElement.style.removeProperty("--diffs-column-content-width"),o.codeElement.style.removeProperty("--diffs-column-number-width"),o.codeElement.style.removeProperty("--diffs-column-width")):((a=t).column1.container.isConnected&&a.column1.container.style.removeProperty("--diffs-annotation-min-height"),a.column2.container.isConnected&&a.column2.container.style.removeProperty("--diffs-annotation-min-height"))}i.clear()}cleanUp(){for(let e of this.observedNodes.keys())this.unobserve(e);this.observedNodes.clear()}observe(t){let{managersByElement:n}=e,r=n.get(t);if(r!==this){if(null!=r&&r!==this)throw Error("ResizeManager.observe: element is already owned by another ResizeManager");n.set(t,this),e.getResizeObserver().observe(t)}}unobserve(t){let{managersByElement:n,resizeObserver:r}=e,i=n.get(t);if(null!=i){if(i!==this)throw Error("ResizeManager.unobserve: element is owned by another ResizeManager");n.delete(t),r?.unobserve(t),null!=r&&0===n.size&&(r.disconnect(),e.resizeObserver=void 0)}}handleResizeEntries(e){let t=new Map,n=new Set;for(let r of e){let{target:e,borderBoxSize:i,contentBoxSize:o}=r;if(!(e instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",r);continue}let a=this.observedNodes.get(e);if(null==a){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",r);continue}if("annotations"===a.type){let t=e===a.column1.child?a.column1:e===a.column2.child?a.column2:void 0;if(null==t){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:a,target:e});continue}t.childHeight=i[0].blockSize,n.add(a)}else if("code"===a.type){let n=t.get(a)??{},r=o[0].inlineSize;e===a.codeElement?n.codeInlineSize=r:e===a.numberElement&&(n.numberInlineSize=r),t.set(a,n)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(t),t.clear()}applyAnnotationUpdates(e){for(let t of e)this.applyNewHeight(t,Math.max(t.column1.childHeight,t.column2.childHeight))}applyColumnUpdates=e=>{for(let[t,n]of e){let e=null!=n.codeInlineSize?function(e){let t=Math.max(Math.floor(e),0);return 0===t?"auto":t}(n.codeInlineSize):t.codeWidth,r=null!=n.numberInlineSize?Math.max(Math.ceil(n.numberInlineSize),0):t.numberWidth,i=e!==t.codeWidth,o=r!==t.numberWidth;if((i||o)&&(t.codeWidth=e,t.numberWidth=r,i&&t.codeElement.style.setProperty("--diffs-column-width",`${"number"==typeof e?`${e}px`:"auto"}`),o&&t.codeElement.style.setProperty("--diffs-column-number-width",`${0===r?"auto":`${r}px`}`),i||o&&"auto"!==e)){let n="number"==typeof e?Math.max(e-r,0):0;t.codeElement.style.setProperty("--diffs-column-content-width",`${n>0?`${n}px`:"auto"}`)}}};applyNewHeight(e,t){t!==e.currentHeight&&(e.currentHeight=Math.max(t,0),e.column1.container.style.setProperty("--diffs-annotation-min-height",`${e.currentHeight}px`),e.column2.container.style.setProperty("--diffs-annotation-min-height",`${e.currentHeight}px`))}};function aE(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function aL(e,t){return null==e||null==t?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}let a_=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
3
3
  <symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
4
4
  <path d="M8.47 4.22a.75.75 0 0 0 0 1.06l1.97 1.97H3.75a.75.75 0 0 0 0 1.5h6.69l-1.97 1.97a.75.75 0 1 0 1.06 1.06l3.25-3.25a.75.75 0 0 0 0-1.06L9.53 4.22a.75.75 0 0 0-1.06 0"/>
@@ -198,4 +198,4 @@ XID_Start XIDS`.split(/\s/).map(e=>[ui(e),e])),uH=new Map([["s",u_(383)],[u_(383
198
198
  ${aR(n)}
199
199
  ${e}
200
200
  }
201
- }`}(t,o,l)}),this.appliedThemeCSS=null!=this.themeCSSStyle?{theme:s,themeStyles:t,themeType:o,baseThemeType:r,scrollbarGutter:l}:void 0}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;if(null!=e&&null!=this.themeCSSStyle){var t;let n;this.themeCSSStyle.textContent=(t=this.themeCSSStyle.textContent??"",n=aR(aT(e)),t.replace(aP,n))}}applyHunksToDOM(e,t){let{overflow:n="scroll"}=this.options,r=(this.options.hunkSeparators??"line-info")==="line-info",i="wrap"===n?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let o=!1,a=[],s=this.hunksRenderer.renderCodeAST("unified",t),l=this.hunksRenderer.renderCodeAST("deletions",t),d=this.hunksRenderer.renderCodeAST("additions",t);null!=s?(o=null==this.codeUnified||null!=this.codeAdditions||null!=this.codeDeletions,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=aI({code:this.codeUnified,columnType:"unified",rowSpan:i,containerSize:r}),this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s),a.push(this.codeUnified)):null!=l||null!=d?(null!=l?(o=null==this.codeDeletions||null!=this.codeUnified,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=aI({code:this.codeDeletions,columnType:"deletions",rowSpan:i,containerSize:r}),this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(l),a.push(this.codeDeletions)):(this.codeDeletions?.remove(),this.codeDeletions=void 0),null!=d?(o=o||null==this.codeAdditions||null!=this.codeUnified,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=aI({code:this.codeAdditions,columnType:"additions",rowSpan:i,containerSize:r}),this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(d),a.push(this.codeAdditions)):(this.codeAdditions?.remove(),this.codeAdditions=void 0)):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0),0===a.length?e.textContent="":o&&e.replaceChildren(...a),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:o,options:{diffStyle:a="split"}}=this;if(null==n||null==e||null==t||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||null==this.lastRowCount)return!1;let s=this.getCodeColumns(a,r,o,i);if(null==s)return!1;let l=e.startingLine,d=t.startingLine,u=l+e.totalLines,c=d+t.totalLines,h=Math.max(l,d),f=Math.min(u,c);if(f<=h)return!1;let p=Math.max(0,h-l),m=Math.max(0,u-f),g=this.trimColumns({columns:s,trimStart:p,trimEnd:m,previousStart:l,overlapStart:h,overlapEnd:f,diffStyle:a});if(g<0)throw Error("applyPartialRender: failed to trim to overlap");if(this.lastRowCount<g)throw Error("applyPartialRender: trimmed beyond DOM row count");let b=this.lastRowCount-g,v=(e,t)=>{if(!(t<=0)&&null!=this.fileDiff)return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},y=v(d,Math.max(h-d,0));if(null==y&&d<h)return!1;let w=v(f,Math.max(c-f,0));if(null==w&&c>f)return!1;let x=(e,t)=>{if(null!=e){if("unified"!==a||Array.isArray(s))if("split"===a&&Array.isArray(s))this.insertPartialHTML(a,s,e,t);else throw Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");else this.insertPartialHTML(a,s,e,t);b+=e.rowCount}};return this.cleanupErrorWrapper(),x(y,"afterbegin"),x(w,"beforeend"),this.lastRowCount!==b&&(this.applyRowSpan(a,s,b),this.lastRowCount=b),!0}insertPartialHTML(e,t,n,r){if("unified"!==e||Array.isArray(t))if("split"===e&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST("deletions",n),i=this.hunksRenderer.renderCodeAST("additions",n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error("FileDiff.insertPartialHTML: Invalid argument composition");else{let e=this.hunksRenderer.renderCodeAST("unified",n);this.renderPartialColumn(t,e,r)}}renderPartialColumn(e,t,n){if(null==e||null==t)return;let r=hy(t[0]),i=hy(t[1]);if(null==r||null==i)throw Error("FileDiff.insertPartialHTML: Unexpected AST structure");let o=i.at(0);"beforeend"===n&&o?.type==="element"&&"number"==typeof o.properties["data-buffer-size"]&&this.mergeBuffersIfNecessary(o.properties["data-buffer-size"],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let a=i.at(-1);"afterbegin"===n&&a?.type==="element"&&"number"==typeof a.properties["data-buffer-size"]&&this.mergeBuffersIfNecessary(a.properties["data-buffer-size"],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,o){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let a=this.getBufferSize(t.dataset);null!=a&&(o?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,a+e),this.updateBufferSize(n,a+e))}applyRowSpan(e,t,n){let r=e=>{null!=e&&(e.gutter.style.setProperty("grid-row",`span ${n}`),e.content.style.setProperty("grid-row",`span ${n}`))};if("unified"!==e||Array.isArray(t))if("split"===e&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error("dun fuuuuked up");else r(t)}trimColumnRows(e,t,n){let r=0,i=0,o=0,a=!1,s=n>=0;if(null==e)return 0;let l=Array.from(e.content.children),d=Array.from(e.gutter.children);if(l.length!==d.length)throw Error("FileDiff.trimColumnRows: columns do not match");for(;o<l.length&&(!(t<=0)||s||a);){let e=d[o],u=l[o];if(o++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error("FileDiff.trimColumnRows: invalid row elements");if(a&&(a=!1,"annotation"===e.dataset.gutterBuffer&&"lineAnnotation"in u.dataset||"metadata"===e.dataset.gutterBuffer&&"noNewline"in u.dataset)){e.remove(),u.remove(),i++;continue}if("lineIndex"in e.dataset&&"lineIndex"in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&0==--t&&(a=!0),i++),r++;continue}if("separator"in e.dataset&&"separator"in u.dataset||"annotation"===e.dataset.gutterBuffer&&"lineAnnotation"in u.dataset||"metadata"===e.dataset.gutterBuffer&&"noNewline"in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if("buffer"===e.dataset.gutterBuffer&&"contentBuffer"in u.dataset){let o=this.getBufferSize(u.dataset);if(null==o)throw Error("FileDiff.trimColumnRows: invalid element");if(t>0){let n=Math.min(t,o),r=o-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=o),0==(t-=n)&&0===r&&(a=!0)}else if(s){let t=r,a=r+o-1;if(n<=t)e.remove(),u.remove(),i+=o;else if(n<=a){let t=a-n+1,r=o-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=o;continue}throw console.error({gutterElement:e,contentElement:u}),Error("FileDiff.trimColumnRows: unknown row elements")}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:o,trimStart:a}){let s=Math.max(0,r-i),l=n-i;if(l<0)throw Error("FileDiff.trimColumns: overlap ends before previous");let d=a>0,u=o>0;if(!d&&!u)return 0;let c=d?s:0,h=u?l:-1;if("unified"===t&&!Array.isArray(e))return this.trimColumnRows(e,c,h);if("split"===t&&Array.isArray(e)){let t=this.trimColumnRows(e[0],c,h),n=this.trimColumnRows(e[1],c,h);if(null!=e[0]&&null!=e[1]&&t!==n)throw Error("FileDiff.trimColumns: split columns out of sync");return null!=e[0]?t:n}throw console.error({diffStyle:t,columns:e}),Error("FileDiff.trimColumns: Invalid columns for diffType")}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??"",10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty("grid-row",`span ${t}`),e.style.setProperty("min-height",`calc(${t} * 1lh)`)}getCodeColumns(e,t,n,r){function i(e){if(null==e)return;let t=e.children[0],n=e.children[1];if(t instanceof HTMLElement&&n instanceof HTMLElement&&null!=t.dataset.gutter&&null!=n.dataset.content)return{gutter:t,content:n}}if("unified"===e)return i(t);{let e=i(n),t=i(r);return null!=e||null!=t?[e,t]:void 0}}applyBuffers(e,t){if(null==t||this.shouldDisableVirtualizationBuffers()){null!=this.bufferBefore&&(this.bufferBefore.remove(),this.bufferBefore=void 0),null!=this.bufferAfter&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(null==this.bufferBefore&&(this.bufferBefore=document.createElement("div"),this.bufferBefore.dataset.virtualizerBuffer="before",e.before(this.bufferBefore)),this.bufferBefore.style.setProperty("height",`${t.bufferBefore}px`),this.bufferBefore.style.setProperty("contain","strict")):null!=this.bufferBefore&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(null==this.bufferAfter&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",e.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${t.bufferAfter}px`),this.bufferAfter.style.setProperty("contain","strict")):null!=this.bufferAfter&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){var o;let{diffIndicators:a="bars",disableBackground:s=!1,disableLineNumbers:l=!1,overflow:d="scroll",diffStyle:u="split"}=this.options,c={type:"diff",diffIndicators:a,disableBackground:s,disableLineNumbers:l,overflow:d,split:"unified"!==u&&null!=t&&null!=n,totalLines:r,customProperties:i};o=this.appliedPreAttributes,(null==c||null==o?c!==o:!function(e=aN,t=aN){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}(c.customProperties,o.customProperties)||c.type!==o.type||c.diffIndicators!==o.diffIndicators||c.disableBackground!==o.disableBackground||c.disableLineNumbers!==o.disableLineNumbers||c.overflow!==o.overflow||c.split!==o.split||c.totalLines!==o.totalLines)&&(!function(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:o,split:a,totalLines:s,customProperties:l}){if(null!=l)for(let t in l){let n=l[t];null!=n&&e.setAttribute(t,`${n}`)}switch("diff"===t?(e.setAttribute("data-diff",""),e.removeAttribute("data-file")):(e.setAttribute("data-file",""),e.removeAttribute("data-diff")),n){case"bars":case"classic":e.setAttribute("data-indicators",n);break;case"none":e.removeAttribute("data-indicators")}i?e.setAttribute("data-disable-line-numbers",""):e.removeAttribute("data-disable-line-numbers"),r?e.removeAttribute("data-background"):e.setAttribute("data-background",""),"diff"===t?e.setAttribute("data-diff-type",a?"split":"single"):e.removeAttribute("data-diff-type"),e.setAttribute("data-overflow",o),e.style.setProperty("--diffs-min-number-column-width-default",`${`${s}`.length}ch`)}(e,c),this.appliedPreAttributes=c)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",n.appendChild(this.errorWrapper);let r=document.createElement("div");r.dataset.errorMessage="",r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement("pre");i.dataset.errorStack="",i.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function hy(e){if(null!=e&&"element"===e.type)return e.children??[]}let hw=-1;var hx=class extends hv{__id=`little-virtualized-file-diff:${++hw}`;top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n,r,i=!1){super(e,r,i),this.virtualizer=t,this.metrics=cy(n)}setMetrics(e,t=!1){let n=cy(e);!t&&iZ(this.metrics,n)||(this.metrics=n,this.resetLayoutCache({includeEstimatedHeights:!0}))}setLineAnnotations(e){this.syncLineAnnotations(e)&&this.resetLayoutCache({includeEstimatedHeights:!1})}syncLineAnnotations(e){return null!=e&&e!==this.lineAnnotations&&(0!==e.length||0!==this.lineAnnotations.length)&&(super.setLineAnnotations(e),!0)}setFileAnnotationHeight(e){let t=this.cache.fileAnnotationHeight;return e!==t&&(this.cache.fileAnnotationHeight=e,this.cache.measuredHeightDeltaTotal+=e-t,!0)}hasFileAnnotations(e=this.fileDiff){var t;return null!=e&&(t=this.lineAnnotations,!!t?.some(e=>0===e.lineNumber))&&this.lineAnnotations.some(t=>0===t.lineNumber&&("new"===e.type?"additions"===t.side:"deleted"!==e.type||"deletions"===t.side))}getLineHeight(e,t=!1){return this.getEstimatedLineHeight(t)+(this.cache.heightDeltas.get(e)??0)}getEstimatedLineHeight(e=!1){return this.metrics.lineHeight*(e?2:1)}setOptions(e){var t,n,r,i;if(this.isAdvancedMode())throw Error("VirtualizedFileDiff.setOptions cannot be used inside CodeView. Update CodeView options instead.");if(null==e)return;let{options:o}=this,a=!i1(o,e),s=a&&(t=o,n=e,(t.diffStyle??"split")!==(n.diffStyle??"split")||(t.overflow??"scroll")!==(n.overflow??"scroll")||(t.collapsed??!1)!==(n.collapsed??!1)||(t.disableLineNumbers??!1)!==(n.disableLineNumbers??!1)||(t.disableFileHeader??!1)!==(n.disableFileHeader??!1)||(t.diffIndicators??"bars")!==(n.diffIndicators??"bars")||(t.hunkSeparators??"line-info")!==(n.hunkSeparators??"line-info")||(t.expandUnchanged??!1)!==(n.expandUnchanged??!1)||(t.collapsedContextThreshold??1)!==(n.collapsedContextThreshold??1)||t.unsafeCSS!==n.unsafeCSS);super.setOptions(e),s&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:(r=o,i=e,(r.disableFileHeader??!1)!==(i.disableFileHeader??!1)||(r.hunkSeparators??"line-info")!==(i.hunkSeparators??"line-info")||(r.expandUnchanged??!1)!==(i.expandUnchanged??!1)||(r.collapsedContextThreshold??1)!==(i.collapsedContextThreshold??1))}),a&&(this.forceRenderOverride=!0),a&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,s)}setThemeType(e){if(this.isAdvancedMode())throw Error("VirtualizedFileDiff.setThemeType cannot be used inside CodeView. Update CodeView options instead.");super.setThemeType(e)}resetLayoutCache({forceSimpleRecompute:e=!1,includeEstimatedHeights:t=!1}={}){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.size>0&&this.cache.heightDeltas.clear(),0!==this.cache.measuredHeightDeltaTotal&&(this.cache.measuredHeightDeltaTotal=0),this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),0!==this.cache.totalLines&&(this.cache.totalLines=0),t&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),null!=this.renderRange&&(this.renderRange=void 0),e&&this.isSimpleMode()&&this.computeApproximateSize()}reconcileHeights(){let e=!1,{overflow:t="scroll"}=this.options;if(null==this.fileContainer||null==this.fileDiff)return 0!==this.height&&(e=!0),this.height=0,e;if(this.top=this.getVirtualizedTop(),"scroll"===t&&0===this.lineAnnotations.length&&!this.isResizeDebuggingEnabled())return e;let n=this.getDiffStyle(),r="split"===n?[this.codeDeletions,this.codeAdditions]:[this.codeUnified],i=this.hasFileAnnotations(this.fileDiff);if(null!=this.renderRange&&i&&aK(this.renderRange)){let t=function(e){let t;for(let n of e){if(null==n)continue;let e=n.children[1];if(e instanceof HTMLElement)for(let n of e.children)n instanceof HTMLElement&&"-1,-1"===n.dataset.lineAnnotation&&(t=Math.max(t??0,n.getBoundingClientRect().height))}return t}(r)??0;this.setFileAnnotationHeight(t)&&(e=!0)}else!i&&this.setFileAnnotationHeight(0)&&(e=!0);for(let t of r){if(null==t)continue;let r=t.children[1];if(r instanceof HTMLElement)for(let t of r.children){if(!(t instanceof HTMLElement))continue;let r=t.dataset.lineIndex;if(null==r)continue;let i=function(e,t){let[n,r]=e.split(",").map(Number);return"split"===t?r:n}(r,n),o=t.getBoundingClientRect().height,a=!1;t.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in t.nextElementSibling.dataset||"noNewline"in t.nextElementSibling.dataset)&&("noNewline"in t.nextElementSibling.dataset&&(a=!0),o+=t.nextElementSibling.getBoundingClientRect().height);let s=this.getEstimatedLineHeight(a),l=this.cache.heightDeltas.get(i)??0,d=o-s;d!==l&&(e=!0,this.cache.measuredHeightDeltaTotal+=d-l,0===d?this.cache.heightDeltas.delete(i):this.cache.heightDeltas.set(i,d))}}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>null!=this.fileContainer&&(e&&(this.top=this.getVirtualizedTop()),this.render());prepareCodeViewItem(e,t,n,r){let i=!cv(this.fileDiff,e),o=this.syncLineAnnotations(r),a=n?.resetDiffLayoutCache===!0||i||o,s=i||n?.resetDiffLayoutCache===!0&&n.includeEstimatedDiffHeights;n?.metrics!=null&&(this.metrics=cy(n.metrics),a=!0,s=!0);let{collapsed:l=!1}=this.options;return this.currentCollapsed!==l&&(this.currentCollapsed=l,a=!0),a&&this.resetLayoutCache({includeEstimatedHeights:s}),this.fileDiff=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e,t="additions"){let n;if(null==this.fileDiff||e<1)return;let r=this.getLineIndex(e,t);if(null==r)return;let{disableFileHeader:i=!1,expandUnchanged:o=!1,collapsed:a=!1,collapsedContextThreshold:s=1}=this.options,l=this.getDiffStyle(),d=this.getHunkSeparatorType(),u="split"===l?r[1]:r[0];this.approximateLayoutCheckpoints();let c=cw(this.metrics,i),h=this.getLayoutCheckpointBeforeLineIndex(u),f=h?.top??c+this.cache.fileAnnotationHeight;return a?{top:c,height:0}:(cN({diff:this.fileDiff,diffStyle:l,startingLine:h?.renderedLineIndex??0,expandedHunks:!!o||this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s,callback:({hunkIndex:e,hunk:t,collapsedBefore:r,collapsedAfter:i,deletionLine:o,additionLine:a})=>{let s="split"===l?a?.splitLineIndex??o?.splitLineIndex:a?.unifiedLineIndex??o?.unifiedLineIndex;if(null==s)throw Error("VirtualizedFileDiff.getLinePosition: missing line index data");if(r>0){let i=cL({type:d,metrics:this.metrics,hunkIndex:e,hunkSpecs:t?.hunkSpecs});if(null!=i){if(f+=i.gapBefore,u>=s-r&&u<s)return n={top:f,height:i.height},!0;f+=i.height+i.gapAfter}}let c=this.getLineHeight(s,(a?.noEOFCR??!1)||(o?.noEOFCR??!1));if(s===u)return n={top:f,height:c},!0;if(f+=c,i>0){let e=c_({type:d,metrics:this.metrics});if(null!=e){if(u>s&&u<=s+i)return n={top:f+e.gapBefore,height:e.height},!0;f+=e.totalHeight}}return!1}}),n)}getNumericScrollAnchor(e){let t;if(null==this.fileDiff)return;let{disableFileHeader:n=!1,expandUnchanged:r=!1,collapsed:i=!1,collapsedContextThreshold:o=1}=this.options;if(i)return;let a=this.getDiffStyle(),s=this.getHunkSeparatorType();this.approximateLayoutCheckpoints();let l=this.getLayoutCheckpointBeforeTop(e),d=l?.top??cw(this.metrics,n)+this.cache.fileAnnotationHeight;return cN({diff:this.fileDiff,diffStyle:a,startingLine:l?.renderedLineIndex??0,expandedHunks:!!r||this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:n,hunk:r,collapsedBefore:i,collapsedAfter:o,deletionLine:l,additionLine:u})=>{let c="split"===a?u?.splitLineIndex??l?.splitLineIndex:u?.unifiedLineIndex??l?.unifiedLineIndex;if(null==c)throw Error("VirtualizedFileDiff.getNumericScrollAnchor: missing line index data");if(i>0){let e=cL({type:s,metrics:this.metrics,hunkIndex:n,hunkSpecs:r?.hunkSpecs});null!=e&&(d+=e.totalHeight)}if(d>=e&&(null!=l?t={lineNumber:l.lineNumber,side:"deletions",top:d}:null!=u&&(t={lineNumber:u.lineNumber,side:"additions",top:d}),null!=t))return!0;let h=this.getLineHeight(c,(u?.noEOFCR??!1)||(l?.noEOFCR??!1));if(d+=h,o>0){let e=c_({type:s,metrics:this.metrics});null!=e&&(d+=e.totalHeight)}return!1}}),t}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){if(null==this.top||null==this.fileDiff)return;if(!0===this.options.collapsed)return{topOffset:this.top,height:this.height};let t=null!=e?this.computeRenderRangeFromWindow(this.fileDiff,this.top,e):this.renderRange;if(null==t)return;let{bufferBefore:n,bufferAfter:r,totalLines:i}=t,o=0;if(0===i){let t=e??this.virtualizer.getWindowSpecs();this.top<t.top&&(o=r)}return{topOffset:this.top+n+o,height:this.height-(n+r)}}cleanUp(e=!1){null!=this.fileContainer&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||this.resetLayoutCache({includeEstimatedHeights:!0}),this.isSetup=!1,super.cleanUp(e)}expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.forceRenderOverride=!0,this.resetLayoutCache({includeEstimatedHeights:!0}),this.isSimpleMode()&&this.computeApproximateSize(),this.virtualizer.instanceChanged(this,!0)};setVisibility(e){this.isAdvancedMode()||null==this.fileContainer||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){this.enabled&&(null!=this.fileDiff||null!=this.additionFile||null!=this.deletionFile)&&(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}computeApproximateSize(e=!1){let t=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!t)return;let n=0===this.height;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,null==this.fileDiff){this.layoutDirty=!1;return}let{disableFileHeader:r=!1,collapsed:i=!1}=this.options,o=cw(this.metrics,r);if(this.height+=o,i){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight()+this.cache.measuredHeightDeltaTotal,t&&!n&&this.validateComputedHeight(),this.layoutDirty=!1}getActiveEstimatedHeight(){this.ensureEstimatedDiffHeights();let e="split"===this.getDiffStyle()?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(null==e)throw Error("VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height");return e}ensureEstimatedDiffHeights(){if(null==this.fileDiff){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(null!=this.cache.estimatedSplitHeight&&null!=this.cache.estimatedUnifiedHeight)return;let{disableFileHeader:e=!1,expandUnchanged:t=!1,collapsedContextThreshold:n=1}=this.options,{splitHeight:r,unifiedHeight:i}=function({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:r,expandUnchanged:i,expandedHunks:o,collapsedContextThreshold:a}){let s=cw(t,n),l=s,d=!!i||o,u=e.hunks.length-1;for(let n=0;n<e.hunks.length;n++){let i=e.hunks[n];if(null==i)throw Error("computeEstimatedDiffHeights: invalid hunk index");let o=ck({isPartial:e.isPartial,rangeSize:i.collapsedBefore,expandedHunks:d,hunkIndex:n,collapsedContextThreshold:a}),c=(o.fromStart+o.fromEnd)*t.lineHeight;if(s+=c,l+=c,o.collapsedLines>0){let e=cL({type:r,metrics:t,hunkIndex:n,hunkSpecs:i.hunkSpecs})?.totalHeight??0;s+=e,l+=e}s+=i.splitLineCount*t.lineHeight,l+=i.unifiedLineCount*t.lineHeight;let h=function(e){if(!e.noEOFCRAdditions&&!e.noEOFCRDeletions)return{split:0,unified:0};let t=e.hunkContent.at(-1);if(null==t)return{split:0,unified:0};if("context"===t.type){let e=+(t.lines>0);return{split:e,unified:e}}return function(e,t){let n=(t.deletions>0&&e.noEOFCRDeletions?1:0)+(t.additions>0&&e.noEOFCRAdditions?1:0),r=t.deletions>0&&e.noEOFCRDeletions,i=t.additions>0&&e.noEOFCRAdditions;return{split:r||i?1:0,unified:n}}(e,t)}(i);s+=h.split*t.lineHeight,l+=h.unified*t.lineHeight;let f=n===u?cC({fileDiff:e,hunkIndex:n,expandedHunks:d,collapsedContextThreshold:a,errorPrefix:"computeEstimatedDiffHeights"}):void 0;if(null!=f){let e=(f.fromStart+f.fromEnd)*t.lineHeight;if(s+=e,l+=e,f.collapsedLines>0){let e=c_({type:r,metrics:t})?.totalHeight??0;s+=e,l+=e}}}if(e.hunks.length>0){let e=cx(t);s+=e,l+=e}return{splitHeight:s,unifiedHeight:l}}({fileDiff:this.fileDiff,metrics:this.metrics,disableFileHeader:e,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:t,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:n});this.cache.estimatedSplitHeight=r,this.cache.estimatedUnifiedHeight=i}validateComputedHeight(){if(null==this.fileContainer||null==this.fileDiff)return;let e=this.fileContainer.getBoundingClientRect();e.height!==this.height?console.log("VirtualizedFileDiff.computeApproximateSize: computed height doesnt match",{name:this.fileDiff.name,elementHeight:e.height,computedHeight:this.height}):console.log("VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT")}render({fileContainer:e,oldFile:t,newFile:n,fileDiff:r,forceRender:i=!1,lineAnnotations:o,...a}={}){let{forceRenderOverride:s,isSetup:l}=this;this.forceRenderOverride=void 0;let d=this.syncLineAnnotations(o);if(d&&this.resetLayoutCache({includeEstimatedHeights:!1}),this.fileDiff??=r??(null!=t&&null!=n?aU(t,n,this.options.parseDiffOptions):void 0),e=this.getOrCreateFileContainer(e),null==this.fileDiff)return console.error("VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data"),!1;if(l)this.top??=this.getVirtualizedTop();else{this.computeApproximateSize();let t=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(null==t)throw Error("VirtualizedFileDiff.render: simple virtualizer is not available");t.connect(e,this),this.isVisible=t.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode())return this.renderPlaceholder(this.height);let u=this.virtualizer.getWindowSpecs(),c=this.top??0,h=this.computeRenderRangeFromWindow(this.fileDiff,c,u);return super.render({fileDiff:this.fileDiff,fileContainer:e,renderRange:h,oldFile:t,newFile:n,lineAnnotations:o,forceRender:(s??i)||d,...a})}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}isSimpleMode(){return"simple"===this.virtualizer.type}isAdvancedMode(){return"advanced"===this.virtualizer.type}getVirtualizedTop(){return"advanced"===this.virtualizer.type?this.virtualizer.getLocalTopForInstance(this):null!=this.fileContainer?this.virtualizer.getOffsetInScrollContainer(this.fileContainer):0}getSimpleVirtualizer(){return"simple"===this.virtualizer.type?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??"split"}getHunkSeparatorType(){var e;return"function"==typeof(e=this.options.hunkSeparators)?"custom":e??"line-info"}approximateLayoutCheckpoints(){if(this.cache.checkpoints.length>0||null==this.fileDiff||0===this.fileDiff.hunks.length||!0===this.options.collapsed)return;let{disableFileHeader:e=!1,expandUnchanged:t=!1,collapsedContextThreshold:n=1}=this.options,r=this.fileDiff.hunks.length-1,i=this.getDiffStyle(),o=this.getHunkSeparatorType(),a=!!t||this.hunksRenderer.getExpandedHunksMap(),s=function(e){let t=Array.from(e).sort((e,t)=>e[0]-t[0]),n=[],r=[0],i=0;for(let[e,o]of t)n.push(e),i+=o,r.push(i);return{lineIndexes:n,prefixTotals:r}}(this.cache.heightDeltas),l=cw(this.metrics,e)+this.cache.fileAnnotationHeight,d=0,u=({rowCount:e,startLineIndex:t,preSeparatorHeight:n=0,postSeparatorHeight:r=0,metadataOffsets:i=[]})=>{if(e<=0)return;let o=d,a=d+e,u=5e3*Math.ceil(o/5e3);for(;u<a;){let e=u-o,r=l+(e>0?n:0)+e*this.metrics.lineHeight+function(e,t){let n=0;for(let r of e)r<t&&n++;return n}(i,e)*this.metrics.lineHeight+hk(s,t,t+e);this.cache.checkpoints.push({renderedLineIndex:u,lineIndex:t+e,top:r}),u+=5e3}l+=n+e*this.metrics.lineHeight+i.length*this.metrics.lineHeight+hk(s,t,t+e)+r,d=a};for(let e=0;e<this.fileDiff.hunks.length;e++){let t=this.fileDiff.hunks[e];if(null==t)throw Error("VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index");let s=ck({isPartial:this.fileDiff.isPartial,rangeSize:t.collapsedBefore,expandedHunks:a,hunkIndex:e,collapsedContextThreshold:n}),l=s.collapsedLines>0?cL({type:o,metrics:this.metrics,hunkIndex:e,hunkSpecs:t.hunkSpecs})?.totalHeight??0:0;u({rowCount:s.fromStart,startLineIndex:("split"===i?t.splitLineStart:t.unifiedLineStart)-s.rangeSize});let d=l;u({rowCount:s.fromEnd,startLineIndex:("split"===i?t.splitLineStart:t.unifiedLineStart)-s.fromEnd,preSeparatorHeight:d}),s.fromEnd>0&&(d=0);let c=e===r?cC({fileDiff:this.fileDiff,hunkIndex:e,expandedHunks:a,collapsedContextThreshold:n,errorPrefix:"VirtualizedFileDiff"}):void 0,h=null!=c&&c.collapsedLines>0?c_({type:o,metrics:this.metrics})?.totalHeight??0:0,f=null!=c?c.fromStart+c.fromEnd:0,p="split"===i?t.splitLineCount:t.unifiedLineCount,m="split"===i?t.splitLineStart:t.unifiedLineStart;u({rowCount:p,startLineIndex:m,preSeparatorHeight:d,postSeparatorHeight:0===f?h:0,metadataOffsets:function({diffStyle:e,hunk:t,rowCount:n}){if(n<=0||!t.noEOFCRAdditions&&!t.noEOFCRDeletions)return[];let r=t.hunkContent.at(-1);if(null==r)return[];if("context"===r.type)return[n-1];let i=Math.max(r.deletions,r.additions),o=r.deletions+r.additions;if("split"===e)return i>0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];let a=[];return r.deletions>0&&t.noEOFCRDeletions&&a.push(n-o+r.deletions-1),r.additions>0&&t.noEOFCRAdditions&&a.push(n-1),a}({diffStyle:i,hunk:t,rowCount:p})}),null!=c&&f>0&&u({rowCount:f,startLineIndex:m+p,postSeparatorHeight:h})}this.cache.totalLines=d}getLayoutCheckpointBeforeLineIndex(e){let t;if(e<=0||0===this.cache.checkpoints.length)return;let n=0,r=this.cache.checkpoints.length-1;for(;n<=r;){let i=n+r>>1,o=this.cache.checkpoints[i];if(null==o)throw Error("VirtualizedFileDiff: invalid checkpoint index");o.lineIndex<=e?(t=o,n=i+1):r=i-1}return t}getLayoutCheckpointBeforeTop(e,t){let n=0,r=this.cache.checkpoints.length-1,i=-1;for(;n<=r;){let t=n+r>>1,o=this.cache.checkpoints[t];if(null==o)throw Error("VirtualizedFileDiff: invalid checkpoint index");o.top<=e?(i=t,n=t+1):r=t-1}if(null==t)return i>=0?this.cache.checkpoints[i]:void 0;for(let e=i;e>=0;e--){let n=this.cache.checkpoints[e];if(null==n)throw Error("VirtualizedFileDiff: invalid checkpoint index");if(n.renderedLineIndex%t==0)return n}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(let r of e.hunks)n+="split"===t?r.splitLineCount:r.unifiedLineCount;return n}let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,o=!!r||this.hunksRenderer.getExpandedHunksMap();for(let[r,a]of e.hunks.entries()){n+="split"===t?a.splitLineCount:a.unifiedLineCount;let s=Math.max(a.collapsedBefore,0),{fromStart:l,fromEnd:d,renderAll:u}=ck({isPartial:e.isPartial,rangeSize:s,expandedHunks:o,hunkIndex:r,collapsedContextThreshold:i});s>0&&(n+=u?s:l+d)}let a=cC({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:o,collapsedContextThreshold:i,errorPrefix:"VirtualizedFileDiff"});return null!=a&&(n+=a.fromStart+a.fromEnd),n}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){let i,o,a,{disableFileHeader:s=!1,expandUnchanged:l=!1,collapsedContextThreshold:d=1}=this.options,{hunkLineCount:u,lineHeight:c}=this.metrics,h=this.getDiffStyle(),f=this.getHunkSeparatorType(),p=this.height,m=this.cache.totalLines>0?this.cache.totalLines:this.getExpandedLineCount(e,h),g=cw(this.metrics,s),b=e.hunks.length>0?cx(this.metrics):0,{fileAnnotationHeight:v}=this.cache,y=g+v,w=Math.max(0,p-g-v-b),x=this.hasFileAnnotations(e),k=t+g;if(t<n-p||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:p-g-b};if(m<=u||0===e.hunks.length)return{startingLine:0,totalLines:u,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(),m=this.cache.totalLines>0?this.cache.totalLines:m;let S=Math.ceil(Math.ceil(Math.max(r-n,0)/c)/u)*u+u,C=S/u,A=[],E=(n+r)/2,L=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-S*c*2),u),_=t+(L?.top??y),N=L?.renderedLineIndex??0;if(cN({diff:e,diffStyle:h,startingLine:L?.renderedLineIndex??0,expandedHunks:!!l||this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:d,callback:({hunkIndex:e,hunk:s,collapsedBefore:l,collapsedAfter:d,deletionLine:c,additionLine:p})=>{let m=null!=p?p.splitLineIndex:c.splitLineIndex,g=null!=p?p.unifiedLineIndex:c.unifiedLineIndex,b=(p?.noEOFCR??!1)||(c?.noEOFCR??!1),v=(l>0?cL({type:f,metrics:this.metrics,hunkIndex:e,hunkSpecs:s?.hunkSpecs}):void 0)?.totalHeight??0;_+=v;let w=N%u==0,x=Math.floor(N/u);if(w&&(A[x]=_-(t+y+v),null!=a)){if(a<=0)return!0;a--}let k=this.getLineHeight("split"===h?m:g,b);return _>n-k&&_<r&&(i??=x),null==o&&_+k>E&&(o=x),null==a&&_>=r&&w&&(a=C),N++,_+=k,d>0&&(_+=c_({type:f,metrics:this.metrics})?.totalHeight??0),!1}}),null==i)if(!(v>0)||!x||!(k<r)||!(k+v>n))return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:p-g-b};else i=0,o=0;let T=Math.round((o??=i)-C/2),R=Math.max(0,Math.min(T,Math.max(0,Math.ceil(m/u)-C))),M=R*u,P=T<0?S+T*u:S,I=A[R]??0,D=R+P/u;return{startingLine:M,totalLines:P,bufferBefore:0===M?0:v+I,bufferAfter:Math.max(0,D<A.length?w-A[D]:w-(_-t-y))}}};function hk({lineIndexes:e,prefixTotals:t},n,r){if(n>=r||0===e.length)return 0;let i=hS(e,n);return(t[hS(e,r)]??0)-(t[i]??0)}function hS(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>1,o=e[i];if(null==o)throw Error("VirtualizedFileDiff: invalid prefix index");o<t?n=i+1:r=i}return n}e.i(4135),Symbol("IGNORE_RESPONSE");let hC=(0,g.createContext)(void 0),hA=new Set,hE=null;function hL(e){hA.add(e),hE??=requestAnimationFrame(h_)}function h_(e){let t=new Set(hA);for(let n of(hA.clear(),t))try{n(e)}catch(e){console.error(e)}hE=hA.size>0?requestAnimationFrame(h_):null}function hN({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:r=!1,fitPerfectlyOverscroll:i=0,overscrollSize:o}){let a=n+2*o,s=r?n+2*i:a;if(a>=(t=Math.max(t,s))||r){let n=Math.max(e-i,0);return{top:n,bottom:Math.max(Math.min(e+s,t),n)}}let l=e+n/2-a/2,d=l+a;return l<0&&(l=0),d>t&&(d=t),{top:l=Math.floor(Math.max(l,0)),bottom:Math.ceil(Math.max(Math.min(d,t),l))}}let hT=[0,1e-6,.99999,1],hR={overscrollSize:1e3,intersectionObserverMargin:4e3,resizeDebugging:!1},hM=0,hP=-1;function hI(e,t){let n=e.getBoundingClientRect(),r=t?.getBoundingClientRect().top??0;return n.top-r}(class e{static __STOP=!1;static __lastScrollPosition=0;__id=`virtualizer-${++hP}`;config;type="simple";intersectionObserver;scrollTop=0;height=0;scrollHeight=0;windowSpecs={top:0,bottom:0};root;contentContainer;resizeObserver;observers=new Map;visibleInstances=new Map;visibleInstancesDirty=!1;instancesChanged=new Set;scrollDirty=!0;heightDirty=!0;scrollHeightDirty=!0;renderedObservers=0;connectQueue=new Map;constructor(e){this.config={...hR,...e}}setup(t,n){if(null==this.root){for(let[r,i]of(this.root=t,this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.intersectionObserver=new IntersectionObserver(this.handleIntersectionChange,{root:this.root,threshold:hT,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),t instanceof Document?this.setupWindow():this.setupElement(n),window.__INSTANCE=this,window.__TOGGLE=()=>{e.__STOP?(e.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:e.__lastScrollPosition}),hL(this.computeRenderRangeAndEmit)):(e.__lastScrollPosition=this.getScrollTop(),e.__STOP=!0)},this.connectQueue.entries()))this.connect(r,i);this.connectQueue.clear(),this.markDOMDirty(),hL(this.computeRenderRangeAndEmit)}}instanceChanged(e,t){this.instancesChanged.add(e),t&&this.markDOMDirty(),hL(this.computeRenderRangeAndEmit)}getWindowSpecs(){return 0===this.windowSpecs.top&&0===this.windowSpecs.bottom&&(this.windowSpecs=hN({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize})),this.windowSpecs}isInstanceVisible(e,t){let n=this.getScrollTop(),r=this.getHeight(),i=this.config.intersectionObserverMargin;return!(e<n-i-t||e>n+r+i)}handleContainerResize=e=>{if(null==this.root)return;let t=!1;for(let n of e){let e=n.borderBoxSize[0].blockSize;this.root instanceof Document?e!==this.scrollHeight&&(this.scrollHeightDirty=!0,t=!0,this.config.resizeDebugging&&(console.log("Virtualizer: content size change",this.__id,{sizeChange:e-hM,newSize:e}),hM=e)):n.target===this.root?e!==this.height&&(this.heightDirty=!0,t=!0):n.target===this.contentContainer&&(this.scrollHeightDirty=!0,t=!0,this.config.resizeDebugging&&(console.log("Virtualizer: scroller size change",this.__id,{sizeChange:e-hM,newSize:e}),hM=e))}t&&hL(this.computeRenderRangeAndEmit)};setupWindow(){if(null==this.root||!(this.root instanceof Document))throw Error("Virtualizer.setupWindow: Invalid setup method");window.addEventListener("scroll",this.handleWindowScroll,{passive:!0}),window.addEventListener("resize",this.handleWindowResize,{passive:!0}),this.resizeObserver?.observe(this.root.documentElement)}setupElement(e){if(null==this.root||this.root instanceof Document)throw Error("Virtualizer.setupElement: Invalid setup method");this.root.addEventListener("scroll",this.handleElementScroll,{passive:!0}),this.resizeObserver?.observe(this.root),(e??=this.root.firstElementChild??void 0)instanceof HTMLElement&&(this.contentContainer=e,this.resizeObserver?.observe(e))}cleanUp(){this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.intersectionObserver?.disconnect(),this.intersectionObserver=void 0,this.root?.removeEventListener("scroll",this.handleElementScroll),window.removeEventListener("scroll",this.handleWindowScroll),window.removeEventListener("resize",this.handleWindowResize),this.root=void 0,this.contentContainer=void 0,this.observers.clear(),this.visibleInstances.clear(),this.instancesChanged.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0}getOffsetInScrollContainer(e){return this.getScrollTop()+hI(e,this.getScrollContainerElement())}connect(e,t){if(this.observers.has(e))throw Error("Virtualizer.connect: instance is already connected...");return null==this.intersectionObserver?this.connectQueue.set(e,t):(this.intersectionObserver.observe(e),this.observers.set(e,t),this.instancesChanged.add(t),this.markDOMDirty(),hL(this.computeRenderRangeAndEmit)),()=>this.disconnect(e)}disconnect(e){let t=this.observers.get(e);this.connectQueue.delete(e),null!=t&&(this.intersectionObserver?.unobserve(e),this.observers.delete(e),this.visibleInstances.delete(e)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),hL(this.computeRenderRangeAndEmit))}handleWindowResize=()=>{e.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,hL(this.computeRenderRangeAndEmit))};handleWindowScroll=()=>{!e.__STOP&&null!=this.root&&this.root instanceof Document&&(this.scrollDirty=!0,hL(this.computeRenderRangeAndEmit))};handleElementScroll=()=>{e.__STOP||null==this.root||this.root instanceof Document||(this.scrollDirty=!0,hL(this.computeRenderRangeAndEmit))};computeRenderRangeAndEmit=()=>{if(e.__STOP)return;let t=this.heightDirty||this.scrollHeightDirty;if(!this.scrollDirty&&!this.scrollHeightDirty&&!this.heightDirty&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&0===this.instancesChanged.size)return;let n=this.instancesChanged.size>0;if(0===this.instancesChanged.size){var r;let e=hN({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize});if(!t&&(r=this.windowSpecs,null==r||null==e?r===e:r.top===e.top&&r.bottom===e.bottom)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty)return;this.windowSpecs=e}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;let i=this.getScrollAnchor(this.height),o=new Set;for(let e of t?this.observers.values():this.visibleInstances.values())e.onRender(t)&&o.add(e);for(let e of this.instancesChanged)!o.has(e)&&e.onRender(t)&&o.add(e);for(let e of(this.scrollFix(i),o))e.reconcileHeights();(n||=this.instancesChanged.size>0)&&this.markDOMDirty(),(n||t)&&hL(this.computeRenderRangeAndEmit),o.clear(),this.instancesChanged.clear()};scrollFix(e){if(null==e)return;let t=this.getScrollContainerElement(),{lineIndex:n,lineOffset:r,fileElement:i,fileOffset:o,fileTypeOffset:a}=e;if(null!=n&&null!=r){let e=i.shadowRoot?.querySelector(`[data-line][data-line-index="${n}"]`);if(e instanceof HTMLElement){let n=hI(e,t);n!==r&&this.applyScrollFix(n-r);return}}let s=hI(i,t);if("top"===a)s!==o&&this.applyScrollFix(s-o);else{let e=s+i.getBoundingClientRect().height;e!==o&&this.applyScrollFix(e-o)}}applyScrollFix(e){null==this.root||this.root instanceof Document?window.scrollTo({top:window.scrollY+e,behavior:"instant"}):this.root.scrollTo({top:this.root.scrollTop+e,behavior:"instant"}),this.markDOMDirty()}getScrollAnchor(e){let t,n=this.getScrollContainerElement();for(let[r]of this.visibleInstances.entries()){let i,o,a,s,l=hI(r,n),d=l+r.offsetHeight;if(d<=0?(i=d,o="bottom"):(i=l,o="top"),d>0&&l<e)for(let e of r.shadowRoot?.querySelectorAll("[data-line][data-line-index]")??[]){if(!(e instanceof HTMLElement))continue;let t=e.dataset.lineIndex;if(null==t)continue;let r=hI(e,n);if(!(r<0)){a=t,s=r;break}}if(t?.lineOffset!=null&&null==s)continue;let u=!1;null==t||null!=s&&(null==t.lineOffset||s<t.lineOffset)?u=!0:null==s&&null==t.lineOffset&&(i>=0&&(t.fileOffset<0||i<t.fileOffset)?u=!0:i<0&&t.fileOffset<0&&i>t.fileOffset&&(u=!0)),u&&(t={fileElement:r,fileTypeOffset:o,fileOffset:i,lineIndex:a,lineOffset:s})}return t}handleIntersectionChange=e=>{for(let{target:t,isIntersecting:n}of(this.scrollDirty=!0,e)){if(!(t instanceof HTMLElement))throw Error("Virtualizer.handleIntersectionChange: target not an HTMLElement");let e=this.observers.get(t);null!=e&&(n&&!this.visibleInstances.has(t)?(e.setVisibility(!0),this.visibleInstances.set(t,e),this.visibleInstancesDirty=!0):!n&&this.visibleInstances.has(t)&&(e.setVisibility(!1),this.visibleInstances.delete(t),this.visibleInstancesDirty=!0))}this.visibleInstancesDirty&&hL(this.computeRenderRangeAndEmit)};getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let e=null==this.root?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return e=Math.max(0,Math.min(e,this.getScrollHeight()-this.getHeight())),this.scrollTop=e,e}getScrollHeight(){return this.scrollHeightDirty&&(this.scrollHeightDirty=!1,this.scrollHeight=null==this.root?0:this.root instanceof Document?this.root.documentElement.scrollHeight:this.root.scrollHeight),this.scrollHeight}getHeight(){return this.heightDirty&&(this.heightDirty=!1,this.height=null==this.root?0:this.root instanceof Document?globalThis.innerHeight:this.root.getBoundingClientRect().height),this.height}markDOMDirty(){this.scrollDirty=!0,this.scrollHeightDirty=!0,this.heightDirty=!0}getScrollContainerElement(){return null==this.root||this.root instanceof Document?void 0:this.root}});let hD=(0,g.createContext)(void 0),hj="u"<typeof window?g.useEffect:g.useLayoutEffect;function h$({options:e,controlledSelection:t,hasCustomHeader:n,hasGutterRenderUtility:r}){return t||r||n?{...e,controlledSelection:t,renderCustomHeader:n?iQ:e?.renderCustomHeader,renderGutterUtility:r?iQ:e?.renderGutterUtility}:e}function hO({fileDiff:e,options:t,metrics:n,lineAnnotations:r,selectedLines:i,className:o,style:a,prerenderedHTML:s,renderAnnotation:l,renderCustomHeader:d,renderHeaderPrefix:u,renderHeaderMetadata:c,renderGutterUtility:h,disableWorkerPool:f=!1}){var p;let{ref:b,getHoveredLine:v}=function({fileDiff:e,options:t,lineAnnotations:n,selectedLines:r,prerenderedHTML:i,metrics:o,hasGutterRenderUtility:a,hasCustomHeader:s,disableWorkerPool:l}){var d;let u,c=(0,g.useContext)(hD),h=void 0!==r,f=(0,g.useContext)(hC),p=(0,g.useRef)(null),m=(d=r=>{if(null!=r){if(null!=p.current)throw Error("useFileDiffInstance: An instance should not already exist when a node is created");null!=c?p.current=new hx(h$({controlledSelection:h,hasCustomHeader:s,hasGutterRenderUtility:a,options:t}),c,o,!l?f:void 0,!0):p.current=new hv(h$({controlledSelection:h,hasCustomHeader:s,hasGutterRenderUtility:a,options:t}),!l?f:void 0,!0),p.current.hydrate({fileDiff:e,fileContainer:r,lineAnnotations:n,prerenderedHTML:i})}else{if(null==p.current)throw Error("useFileDiffInstance: A FileDiff instance should exist when unmounting");p.current.cleanUp(),p.current=null}},u=(0,g.useRef)(d),(0,g.useInsertionEffect)(()=>void(u.current=d)),(0,g.useCallback)((...e)=>u.current(...e),[]));return hj(()=>{let{current:i}=p;if(null==i)return;let o=h$({controlledSelection:h,hasCustomHeader:s,hasGutterRenderUtility:a,options:t}),l=!i1(i.options,o);i.setOptions(o),i.render({forceRender:l,fileDiff:e,lineAnnotations:n}),void 0!==r&&i.setSelectedLines(r)}),{ref:m,getHoveredLine:(0,g.useCallback)(()=>p.current?.getHoveredLine(),[])}}({fileDiff:e,options:t,metrics:n,lineAnnotations:r,selectedLines:i,prerenderedHTML:s,hasGutterRenderUtility:null!=h,hasCustomHeader:null!=d,disableWorkerPool:f});return(0,m.jsx)(ih,{ref:b,className:o,style:a,children:(p=function({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:r,renderHeaderMetadata:i,renderAnnotation:o,renderGutterUtility:a,renderMergeConflictUtility:s,lineAnnotations:l,getHoveredLine:d,getInstance:u}){let c=n?.(e),h=r?.(e),f=i?.(e);return(0,m.jsxs)(m.Fragment,{children:[null!=c?(0,m.jsx)("div",{slot:ik,children:c}):(0,m.jsxs)(m.Fragment,{children:[null!=h&&(0,m.jsx)("div",{slot:"header-prefix",children:h}),null!=f&&(0,m.jsx)("div",{slot:"header-metadata",children:f})]}),null!=o&&l?.map((e,t)=>(0,m.jsx)("div",{slot:iK(e),children:o(e)},t)),null!=t&&null!=s&&null!=u&&t.map(t=>{var n;let r;if(null==t)return;let i=null!=(r=function(e,t){let n=t.hunks[e.hunkIndex];if(null!=n)return{hunkIndex:e.hunkIndex,lineIndex:function(e,t){let n=e.unifiedLineStart;for(let r=0;r<t;r++){let t=e.hunkContent[r];n+="context"===t.type?t.lines:t.deletions+t.additions}return n}(n,e.startContentIndex)}}(n=t,e))?function({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}({hunkIndex:r.hunkIndex,lineIndex:r.lineIndex,conflictIndex:n.conflictIndex}):void 0;return(0,m.jsx)("div",{slot:i,style:iJ,children:s(t,u)},i)}),null!=a&&(0,m.jsx)("div",{slot:"gutter-utility-slot",style:iY,children:a(d)})]})}({fileDiff:e,renderCustomHeader:d,renderHeaderPrefix:u,renderHeaderMetadata:c,renderAnnotation:l,renderGutterUtility:h,lineAnnotations:r,getHoveredLine:v}),"u"<typeof window&&null!=s?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("template",{shadowrootmode:"open",dangerouslySetInnerHTML:{__html:s}}),p]}):(0,m.jsx)(m.Fragment,{children:p}))})}let hz="devframe-git-theme",hB={light:"vitesse-light",dark:"vitesse-dark"};function hH({file:e,options:t,defaultOpen:n}){let[r,i]=(0,g.useState)(n),{additions:o,deletions:a}=function(e){let t=0,n=0;for(let r of e.hunks)t+=r.additionLines,n+=r.deletionLines;return{additions:t,deletions:n}}(e),s=e.prevName?`${e.prevName} → ${e.name}`:e.name;return(0,m.jsxs)("div",{children:[(0,m.jsxs)("button",{type:"button",onClick:()=>i(e=>!e),"aria-expanded":r,className:"hover:bg-active bg-secondary flex w-full items-center gap-1.5 px-2.5 py-1.5 text-left font-mono text-xs transition-colors",children:[(0,m.jsx)(rC,{name:"i-ph-caret-right",className:ry("color-faint size-3 transition-transform",r&&"rotate-90")}),(0,m.jsx)(ic,{code:function(e){switch(e){case"new":return"added";case"deleted":return"deleted";case"rename-pure":case"rename-changed":return"renamed";default:return"modified"}}(e.type)}),(0,m.jsx)(rA,{path:e.name,className:"size-3.5"}),(0,m.jsx)("span",{className:"min-w-0 flex-1 truncate",title:s,children:s}),e.hunks.length>0?(0,m.jsxs)("span",{className:"shrink-0 tabular-nums",children:[(0,m.jsx)("span",{className:"text-success",children:`+${o}`})," ",(0,m.jsx)("span",{className:"text-error",children:`−${a}`})]}):e.type.startsWith("rename")?(0,m.jsx)(rw,{variant:"secondary",className:"px-1.5 py-0 text-[10px]",children:"renamed"}):(0,m.jsx)(rw,{variant:"secondary",className:"px-1.5 py-0 text-[10px]",children:"bin"})]}),r&&(e.hunks.length>0?(0,m.jsx)(hO,{fileDiff:e,options:t,disableWorkerPool:!0}):(0,m.jsx)("p",{className:"color-muted px-3 py-2 text-xs",children:"No textual diff (binary or metadata-only change)."}))]})}function hU({patch:e,loading:t,truncated:n,scroll:r=!0,collapsible:i=!1}){let o=function(){let[e,t]=(0,g.useState)("dark");return(0,g.useEffect)(()=>{let e=document.documentElement,n=()=>t(e.classList.contains("dark")?"dark":"light");n();let r=new MutationObserver(n);return r.observe(e,{attributes:!0,attributeFilter:["class"]}),()=>r.disconnect()},[]),e}(),a=(0,g.useMemo)(()=>e?function(e){try{return(function(e,t=!1){var n;let r=[];for(let i of(n=e).startsWith("From ")||n.includes("\nFrom ")?e.split(ip):[e])try{r.push(function(e,t,n){try{return function(e,t,n=!1){var r,i,o;let a,s=(r=e).startsWith("diff --git")||r.includes("\ndiff --git"),l=s?(i=e,iG(i,"diff --git")):function(e){if(0===e.length)return[""];let t=[],n=0,r=0,i=0,o=0,a=!1;for(;r<e.length;){let s=iH(e,r);if(i<=0&&o<=0){if(iz(e,r)){r>n&&t.push(e.slice(n,r)),n=r,a=!0,r=iH(e,s);continue}if(a&&e.startsWith("@@ -",r)){let t=iU(e.slice(r,s));null!=t&&(i=t.deletionCount,o=t.additionCount)}r=s;continue}let l=e[r];if("\\"===l){r=s;continue}" "===l?(i=Math.max(i-1,0),o=Math.max(o-1,0)):"-"===l?i=Math.max(i-1,0):"+"===l&&(o=Math.max(o-1,0)),r=s}return t.push(e.slice(n)),t}(e),d=[];for(let e of l){if(s&&!im.test(e)){if(null==a)a=iD(e);else if(n)throw Error("parsePatchContent: unknown file blob");else console.error("parsePatchContent: unknown file blob:",e);continue}if(!s&&(o=e,!iz(o,0))){if(null==a)a=iD(e);else if(n)throw Error("parsePatchContent: unknown file blob");else console.error("parsePatchContent: unknown file blob:",e);continue}let r=ij(e,{cacheKey:null!=t?`${t}-${d.length}`:void 0,isGitDiff:s,throwOnError:n});null!=r&&d.push(r)}return{patchMetadata:a,files:d}}(e,t,n)}finally{iI()}}(i,void 0,t))}catch(e){if(t)throw e;console.error(e)}return r})(e).flatMap(e=>e.files)}catch{return[]}}(e):[],[e]),s=(0,g.useMemo)(()=>({theme:hB,themeType:o,diffStyle:"unified",diffIndicators:"classic",disableFileHeader:i}),[o,i]);if(t)return(0,m.jsx)(il,{className:"h-40 w-full"});if(!e||0===a.length)return(0,m.jsx)("p",{className:"color-muted p-3 text-sm",children:"No textual diff available (binary or unchanged)."});if(i)return(0,m.jsxs)("div",{className:"flex flex-col [&>*+*]:border-t [&>*+*]:border-base",children:[a.map((e,t)=>(0,m.jsx)(hH,{file:e,options:s,defaultOpen:1===a.length},e.name||t)),n&&(0,m.jsx)("p",{className:"text-warning px-3 py-1 text-xs",children:"Patch truncated."})]});let l=(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("div",{className:"flex flex-col text-sm [&>*+*]:border-t [&>*+*]:border-base",children:a.map((e,t)=>(0,m.jsx)(hO,{fileDiff:e,options:s,disableWorkerPool:!0},e.name||t))}),n&&(0,m.jsx)("p",{className:"text-warning px-3 py-1 text-xs",children:"Patch truncated."})]});return r?(0,m.jsx)(ia,{className:"h-72 w-full",children:l}):(0,m.jsx)("div",{children:l})}function hF({label:e}){let t=e.startsWith("tag: "),n=t?e.slice(5):e;return(0,m.jsxs)(rw,{variant:"secondary",className:"gap-1 font-mono text-[10px]",children:[t&&(0,m.jsx)(rC,{name:"i-ph-tag-duotone",className:"size-3"}),n]})}function hG({data:e,loading:t,error:n,onClose:r}){var i;return(0,m.jsxs)("div",{className:"flex h-full flex-col",children:[(0,m.jsxs)("div",{className:"flex items-start justify-between gap-2 pb-2",children:[(0,m.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,m.jsx)(rC,{name:"i-ph-git-commit-duotone",className:"color-active size-4"}),(0,m.jsx)("h2",{className:"text-sm leading-none font-semibold",children:"Commit details"})]}),r&&(0,m.jsx)(rk,{variant:"ghost",size:"sm",onClick:r,"aria-label":"Close commit details",children:(0,m.jsx)(rC,{name:"i-ph-x",className:"size-4"})})]}),n&&(0,m.jsx)("p",{className:"text-error text-sm",children:n}),!n&&(t||!e)&&(0,m.jsxs)("div",{className:"space-y-2",children:[(0,m.jsx)(il,{className:"h-5 w-3/4"}),(0,m.jsx)(il,{className:"h-4 w-1/2"}),(0,m.jsx)(il,{className:"h-24 w-full"})]}),!n&&e&&!e.found&&(0,m.jsx)("p",{className:"color-muted text-sm",children:"Commit not found."}),!n&&e&&e.found&&(0,m.jsx)(ia,{className:"min-h-0 flex-1 pr-2",children:(0,m.jsxs)("div",{className:"space-y-4",children:[(0,m.jsxs)("div",{className:"space-y-1.5",children:[(0,m.jsx)("p",{className:"text-sm leading-snug font-medium break-words",children:e.subject}),e.refs.length>0&&(0,m.jsx)("div",{className:"flex flex-wrap gap-1",children:e.refs.map(e=>(0,m.jsx)(hF,{label:e},e))})]}),(0,m.jsxs)("dl",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-xs",children:[(0,m.jsx)("dt",{className:"color-muted",children:"Commit"}),(0,m.jsx)("dd",{className:"truncate font-mono tabular-nums",title:e.hash,children:e.shortHash}),(0,m.jsx)("dt",{className:"color-muted",children:"Author"}),(0,m.jsxs)("dd",{className:"truncate",children:[e.author,(0,m.jsx)("span",{className:"color-muted",children:` <${e.email}>`})]}),(0,m.jsx)("dt",{className:"color-muted",children:"Authored"}),(0,m.jsx)("dd",{className:"truncate",children:(i=e.date)?new Date(i).toLocaleString():""}),e.committer!==e.author&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("dt",{className:"color-muted",children:"Committer"}),(0,m.jsx)("dd",{className:"truncate",children:e.committer})]}),e.parents.length>0&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("dt",{className:"color-muted",children:e.parents.length>1?"Parents":"Parent"}),(0,m.jsx)("dd",{className:"truncate font-mono tabular-nums",children:e.parents.map(e=>e.slice(0,7)).join(", ")})]})]}),e.body&&(0,m.jsx)("pre",{className:"bg-secondary max-h-48 overflow-auto rounded-md p-3 font-mono text-xs whitespace-pre-wrap",children:e.body}),(0,m.jsxs)("div",{className:"space-y-1.5",children:[(0,m.jsxs)("div",{className:"flex items-center justify-between",children:[(0,m.jsx)("span",{className:"color-muted text-xs font-medium tracking-wide uppercase",children:`${e.files.length} ${1===e.files.length?"file":"files"} changed`}),(0,m.jsxs)("span",{className:"text-xs tabular-nums",children:[(0,m.jsx)("span",{className:"text-success",children:`+${e.totalAdditions}`})," ",(0,m.jsx)("span",{className:"text-error",children:`−${e.totalDeletions}`})]})]}),null!==e.patch?(0,m.jsx)("div",{className:"overflow-hidden rounded-md border",children:(0,m.jsx)(hU,{patch:e.patch,loading:!1,truncated:e.truncated,scroll:!1,collapsible:!0})}):(0,m.jsx)("ul",{className:"space-y-0.5",children:e.files.map(e=>(0,m.jsxs)("li",{className:"flex items-center gap-2 text-xs",children:[(0,m.jsx)(ic,{code:e.status}),(0,m.jsx)(rA,{path:e.path,className:"size-4 shrink-0"}),(0,m.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono",title:e.path,children:e.path}),e.binary?(0,m.jsx)(rw,{variant:"secondary",className:"px-1.5 py-0 text-[10px]",children:"bin"}):(0,m.jsxs)("span",{className:"shrink-0 font-mono tabular-nums",children:[(0,m.jsx)("span",{className:"text-success",children:`+${e.additions}`})," ",(0,m.jsx)("span",{className:"text-error",children:`−${e.deletions}`})]})]},e.path))})]})]})})]})}function hW({hash:e,onClose:t}){let{data:n,loading:r,error:i}=na((0,g.useCallback)(t=>t.call("git:show",{hash:e}),[e]));return(0,m.jsx)(hG,{data:n,loading:r,error:i,onClose:t})}let hq={connecting:{icon:"i-ph-plugs-connected-duotone",title:"Connecting…",body:"Establishing a connection to the devframe server.",spin:!0},disconnected:{icon:"i-ph-plugs-duotone",title:"Disconnected",body:"Lost the connection to the devframe server. Reload once it is back up."},unauthorized:{icon:"i-ph-lock-key-duotone",title:"Not authorized",body:"This client isn’t authorized. Reopen the link printed by your dev server, then reload."},error:{icon:"i-ph-warning-octagon-duotone",title:"Connection failed",body:"Could not reach the devframe server."}};function hV({status:e,error:t}){if("connected"===e)return null;let n=hq[e];return(0,m.jsxs)("div",{className:"bg-base flex h-svh w-full flex-col items-center justify-center gap-4 p-8 text-center",children:[(0,m.jsx)(rC,{name:n.icon,className:`color-active size-10 ${n.spin?"animate-pulse":""}`}),(0,m.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,m.jsx)("p",{className:"color-base text-lg font-medium",children:n.title}),(0,m.jsx)("p",{className:"color-muted max-w-sm text-sm",children:n.body}),t&&"error"===e&&(0,m.jsx)("p",{className:"color-faint mt-1 max-w-sm break-words font-mono text-xs",children:t})]}),"connecting"!==e&&(0,m.jsxs)("button",{type:"button",className:v({variant:"primary",size:"sm"}),onClick:()=>location.reload(),children:[(0,m.jsx)(rC,{name:"i-ph-arrow-clockwise",className:"size-4"}),"Reload"]})]})}let hX=Math.min,hK=Math.max,hY=Math.round,hJ=Math.floor,hQ=e=>({x:e,y:e}),hZ={left:"right",right:"left",bottom:"top",top:"bottom"};function h0(e,t){return"function"==typeof e?e(t):e}function h1(e){return e.split("-")[0]}function h2(e){return e.split("-")[1]}function h8(e){return"x"===e?"y":"x"}function h5(e){return"y"===e?"height":"width"}function h6(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function h3(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let h4=["left","right"],h7=["right","left"],h9=["top","bottom"],fe=["bottom","top"];function ft(e){let t=h1(e);return hZ[t]+e.slice(t.length)}function fn(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function fr(e,t,n){let r,{reference:i,floating:o}=e,a=h6(t),s=h8(h6(t)),l=h5(s),d=h1(t),u=i.x+i.width/2-o.width/2,c=i.y+i.height/2-o.height/2,h=i[l]/2-o[l]/2;switch(d){case"top":r={x:u,y:i.y-o.height};break;case"bottom":r={x:u,y:i.y+i.height};break;case"right":r={x:i.x+i.width,y:c};break;case"left":r={x:i.x-o.width,y:c};break;default:r={x:i.x,y:i.y}}let f=h2(t);return f&&(r[s]+=h*("end"===f?1:-1)*(n&&"y"===a?-1:1)),r}async function fi(e,t){var n,r,i,o,a;void 0===t&&(t={});let{x:s,y:l,platform:d,rects:u,elements:c,strategy:h}=e,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:g=!1,padding:b=0}=h0(t,e),v="number"!=typeof b?{top:null!=(r=b.top)?r:0,right:null!=(i=b.right)?i:0,bottom:null!=(o=b.bottom)?o:0,left:null!=(a=b.left)?a:0}:{top:b,right:b,bottom:b,left:b},y=c[g?"floating"===m?"reference":"floating":m],w=fn(await d.getClippingRect({element:null==(n=await (null==d.isElement?void 0:d.isElement(y)))||n?y:y.contextElement||await (null==d.getDocumentElement?void 0:d.getDocumentElement(c.floating)),boundary:f,rootBoundary:p,strategy:h})),x="floating"===m?{x:s,y:l,width:u.floating.width,height:u.floating.height}:u.reference,k=await (null==d.getOffsetParent?void 0:d.getOffsetParent(c.floating)),S=await (null==d.isElement?void 0:d.isElement(k))&&await (null==d.getScale?void 0:d.getScale(k))||{x:1,y:1},C=fn(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:k,strategy:h}):x);return{top:(w.top-C.top+v.top)/S.y,bottom:(C.bottom-w.bottom+v.bottom)/S.y,left:(w.left-C.left+v.left)/S.x,right:(C.right-w.right+v.right)/S.x}}let fo=async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=a.detectOverflow?a:{...a,detectOverflow:fi},l=await (null==a.isRTL?void 0:a.isRTL(t)),d=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:c}=fr(d,r,l),h=r,f=0,p={};for(let n=0;n<o.length;n++){let m=o[n];if(!m)continue;let{name:g,fn:b}=m,{x:v,y:y,data:w,reset:x}=await b({x:u,y:c,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:d,platform:s,elements:{reference:e,floating:t}});u=null!=v?v:u,c=null!=y?y:c,p[g]={...p[g],...w},x&&f<50&&(f++,"object"==typeof x&&(x.placement&&(h=x.placement),x.rects&&(d=!0===x.rects?await a.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:c}=fr(d,h,l)),n=-1)}return{x:u,y:c,placement:h,strategy:i,middlewareData:p}},fa=new Set(["left","top"]);async function fs(e,t){let{placement:n,platform:r,elements:i}=e,o=await (null==r.isRTL?void 0:r.isRTL(i.floating)),a=h1(n),s=h2(n),l="y"===h6(n),d=fa.has(a)?-1:1,u=o&&l?-1:1,c=h0(t,e),{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof c?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return s&&"number"==typeof p&&(f="end"===s?-1*p:p),l?{x:f*u,y:h*d}:{x:h*d,y:f*u}}function fl(){return"u">typeof window}function fd(e){return fh(e)?(e.nodeName||"").toLowerCase():"#document"}function fu(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function fc(e){var t;return null==(t=(fh(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function fh(e){return!!fl()&&(e instanceof Node||e instanceof fu(e).Node)}function ff(e){return!!fl()&&(e instanceof Element||e instanceof fu(e).Element)}function fp(e){return!!fl()&&(e instanceof HTMLElement||e instanceof fu(e).HTMLElement)}function fm(e){return!(!fl()||"u"<typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof fu(e).ShadowRoot)}function fg(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=fC(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==i&&"contents"!==i}function fb(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let fv=/transform|translate|scale|rotate|perspective|filter/,fy=/paint|layout|strict|content/,fw=e=>!!e&&"none"!==e;function fx(e){let t=ff(e)?fC(e):e;return fw(t.transform)||fw(t.translate)||fw(t.scale)||fw(t.rotate)||fw(t.perspective)||!fk()&&(fw(t.backdropFilter)||fw(t.filter))||fv.test(t.willChange||"")||fy.test(t.contain||"")}function fk(){return null==a&&(a="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),a}function fS(e){return/^(html|body|#document)$/.test(fd(e))}function fC(e){return fu(e).getComputedStyle(e)}function fA(e){return ff(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fE(e){if("html"===fd(e))return e;let t=e.assignedSlot||e.parentNode||fm(e)&&e.host||fc(e);return fm(t)?t.host:t}function fL(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let i=function e(t){let n=fE(t);return fS(n)?(t.ownerDocument||t).body:fp(n)&&fg(n)?n:e(n)}(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),a=fu(i);if(!o)return t.concat(i,fL(i,[],n));{let e=f_(a);return t.concat(a,a.visualViewport||[],fg(i)?i:[],e&&n?fL(e):[])}}function f_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fN(e){let t=fC(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=fp(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=hY(n)!==o||hY(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function fT(e){return ff(e)?e:e.contextElement}function fR(e){let t=fT(e);if(!fp(t))return hQ(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:o}=fN(t),a=(o?hY(n.width):n.width)/r,s=(o?hY(n.height):n.height)/i;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}let fM=hQ(0);function fP(e){let t=fu(e);return fk()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:fM}function fI(e,t,n,r){var i;void 0===t&&(t=!1),void 0===n&&(n=!1);let o=e.getBoundingClientRect(),a=fT(e),s=hQ(1);t&&(r?ff(r)&&(s=fR(r)):s=fR(e));let l=(void 0===(i=n)&&(i=!1),r&&i&&r===fu(a))?fP(a):hQ(0),d=(o.left+l.x)/s.x,u=(o.top+l.y)/s.y,c=o.width/s.x,h=o.height/s.y;if(a&&r){let e=fu(a),t=ff(r)?fu(r):r,n=e,i=f_(n);for(;i&&t!==n;){let e=fR(i),t=i.getBoundingClientRect(),r=fC(i),o=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;d*=e.x,u*=e.y,c*=e.x,h*=e.y,d+=o,u+=a,i=f_(n=fu(i))}}return fn({width:c,height:h,x:d,y:u})}function fD(e,t){let n=fA(e).scrollLeft;return t?t.left+n:fI(fc(e)).left+n}function fj(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-fD(e,n),y:n.top+t.scrollTop}}function f$(e,t,n){var r;let i;if("viewport"===t||"layoutViewport"===t)i=function(e,t,n){void 0===n&&(n="viewport");let r="layoutViewport"===n,i=fu(e),o=fc(e),a=i.visualViewport,s=o.clientWidth,l=o.clientHeight,d=0,u=0;if(a){let e=!fk()||"fixed"===t;r?e||(d=-a.offsetLeft,u=-a.offsetTop):(s=a.width,l=a.height,e&&(d=a.offsetLeft,u=a.offsetTop))}if(0>=fD(o)){let e=o.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(o.clientWidth-t.clientWidth-r),a="stable both-edges"===getComputedStyle(o).scrollbarGutter?i/2:i;a<=25&&(s-=a)}return{width:s,height:l,x:d,y:u}}(e,n,t);else if("document"===t){let t,n,o,a,s,l;t=fA(r=fc(e)),n=r.ownerDocument.body,o=hK(r.scrollWidth,r.clientWidth,n.scrollWidth,n.clientWidth),a=hK(r.scrollHeight,r.clientHeight,n.scrollHeight,n.clientHeight),s=-t.scrollLeft+fD(r),l=-t.scrollTop,"rtl"===fC(n).direction&&(s+=hK(r.clientWidth,n.clientWidth)-o),i={width:o,height:a,x:s,y:l}}else if(ff(t)){let e,r,o,a,s,l;r=(e=fI(t,!0,"fixed"===n)).top+t.clientTop,o=e.left+t.clientLeft,a=fR(t),s=t.clientWidth*a.x,l=t.clientHeight*a.y,i={width:s,height:l,x:o*a.x,y:r*a.y}}else{let n=fP(e);i={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return fn(i)}function fO(e){return"static"===fC(e).position}function fz(e,t){if(!fp(e)||"fixed"===fC(e).position)return null;if(t)return t(e);let n=e.offsetParent;return fc(e)===n&&(n=n.ownerDocument.body),n}function fB(e,t){var n;let r=fu(e);if(fb(e))return r;if(!fp(e)){let t=fE(e);for(;t&&!fS(t);){if(ff(t)&&!fO(t))return t;t=fE(t)}return r}let i=fz(e,t);for(;i&&(n=i,/^(table|td|th)$/.test(fd(n)))&&fO(i);)i=fz(i,t);return i&&fS(i)&&fO(i)&&!fx(i)?r:i||function(e){let t=fE(e);for(;fp(t)&&!fS(t);){if(fx(t))return t;if(fb(t))break;t=fE(t)}return null}(e)||r}let fH=async function(e){let t=this.getOffsetParent||fB,n=this.getDimensions,r=await n(e.floating);return{reference:function(e,t,n){let r=fp(t),i=fc(t),o="fixed"===n,a=fI(e,!0,o,t),s={scrollLeft:0,scrollTop:0},l=hQ(0);if((r||!o)&&(("body"!==fd(t)||fg(i))&&(s=fA(t)),r)){let e=fI(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}!r&&i&&(l.x=fD(i));let d=!i||r||o?hQ(0):fj(i,s);return{x:a.left+s.scrollLeft-l.x-d.x,y:a.top+s.scrollTop-l.y-d.y,width:a.width,height:a.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},fU={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,o="fixed"===i,a=fc(r),s=!!t&&fb(t.floating);if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},d=hQ(1),u=hQ(0),c=fp(r);if((c||!o)&&(("body"!==fd(r)||fg(a))&&(l=fA(r)),c)){let e=fI(r);d=fR(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let h=!a||c||o?hQ(0):fj(a,l);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-l.scrollLeft*d.x+u.x+h.x,y:n.y*d.y-l.scrollTop*d.y+u.y+h.y}},getDocumentElement:fc,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,o=[..."clippingAncestors"===n?fb(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=fL(e,[],!1).filter(e=>ff(e)&&"body"!==fd(e)),i=null,o="fixed"===fC(e).position,a=o?fE(e):e;for(;ff(a)&&!fS(a);){let e=fC(a),t=fx(a),n=i?i.position:o?"fixed":"";t||"fixed"!==n&&("absolute"!==n||"static"!==e.position)?i=e:r=r.filter(e=>e!==a),a=fE(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=f$(t,o[0],i),s=a.top,l=a.right,d=a.bottom,u=a.left;for(let e=1;e<o.length;e++){let n=f$(t,o[e],i);s=hK(n.top,s),l=hX(n.right,l),d=hX(n.bottom,d),u=hK(n.left,u)}return{width:l-u,height:d-s,x:u,y:s}},getOffsetParent:fB,getElementRects:fH,getClientRects:function(e){return e.getClientRects?Array.from(e.getClientRects()):[]},getDimensions:function(e){let{width:t,height:n}=fN(e);return{width:t,height:n}},getScale:fR,isElement:ff,isRTL:function(e){return"rtl"===fC(e).direction}};function fF(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fG(e,t,n,r){let i;void 0===r&&(r={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:d=!1}=r,u=fT(e),c=o||a?[...u?fL(u):[],...t?fL(t):[]]:[];c.forEach(e=>{o&&e.addEventListener("scroll",n),a&&e.addEventListener("resize",n)});let h=u&&l?function(e,t,n){let r,i=null,o=fc(e);function a(){var e;clearTimeout(r),null==(e=i)||e.disconnect(),i=null}function s(n,l){void 0===n&&(n=!1),void 0===l&&(l=1),a();let d=e.getBoundingClientRect(),{left:u,top:c,width:h,height:f}=d;if(n||t(),!h||!f)return;let p={rootMargin:-hJ(c)+"px "+-hJ(o.clientWidth-(u+h))+"px "+-hJ(o.clientHeight-(c+f))+"px "+-hJ(u)+"px",threshold:hK(0,hX(1,l))||1},m=!0;function g(t){let n=t[0].intersectionRatio;if(!fF(d,e.getBoundingClientRect()))return s();if(n!==l){if(!m)return s();n?s(!1,n):r=setTimeout(()=>{s(!1,1e-7)},1e3)}m=!1}try{i=new IntersectionObserver(g,{...p,root:o.ownerDocument})}catch(e){i=new IntersectionObserver(g,p)}i.observe(e)}let l=fu(e),d=()=>s(n);return l.addEventListener("resize",d),s(!0),()=>{l.removeEventListener("resize",d),a()}}(u,n,a):null,f=-1,p=null;s&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),n()}),u&&!d&&p.observe(u),t&&p.observe(t));let m=d?fI(e):null;return d&&function t(){let r=fI(e);m&&!fF(m,r)&&n(),m=r,i=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach(e=>{o&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)}),null==h||h(),null==(e=p)||e.disconnect(),p=null,d&&cancelAnimationFrame(i)}}var fW="u">typeof document?g.useLayoutEffect:function(){};function fq(e,t){let n,r,i;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!fq(e[r],t[r]))return!1;return!0}if((n=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!=r--;){let n=i[r];if(("_owner"!==n||!e.$$typeof)&&!fq(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function fV(e){return"u"<typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fX(e,t){let n=fV(e);return Math.round(t*n)/n}function fK(e){let t=g.useRef(e);return fW(()=>{t.current=e}),t}var fY='input:not([inert]):not([inert] *),select:not([inert]):not([inert] *),textarea:not([inert]):not([inert] *),a[href]:not([inert]):not([inert] *),area[href]:not([inert]):not([inert] *),button:not([inert]):not([inert] *),[tabindex]:not(slot):not([inert]):not([inert] *),audio[controls]:not([inert]):not([inert] *),video[controls]:not([inert]):not([inert] *),[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *),details>summary:first-of-type:not([inert]):not([inert] *),details:not([inert]):not([inert] *)',fJ="u"<typeof Element,fQ=fJ?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,fZ=!fJ&&Element.prototype.getRootNode?function(e){var t;return null==e||null==(t=e.getRootNode)?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},f0=function(e,t){void 0===t&&(t=!0);var n,r=null==e||null==(n=e.getAttribute)?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):f0(e.parentNode))},f1=function(e){var t,n=null==e||null==(t=e.getAttribute)?void 0:t.call(e,"contenteditable");return""===n||"true"===n},f2=function(e,t,n){if(f0(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(fY));return t&&fQ.call(e,fY)&&r.unshift(e),r=r.filter(n)},f8=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var o=i.shift();if(!f0(o,!1))if("SLOT"===o.tagName){var a=o.assignedElements(),s=f8(a.length?a:o.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:o,candidates:s})}else{fQ.call(o,fY)&&n.filter(o)&&(t||!e.includes(o))&&r.push(o);var l=o.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(o),d=!f0(l,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(o));if(l&&d){var u=f8(!0===l?o.children:l.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:o,candidates:u})}else i.unshift.apply(i,o.children)}}return r},f5=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},f6=function(e){if(!e)throw Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||f1(e))&&!f5(e)?0:e.tabIndex},f3=function(e,t){var n=f6(e);return n<0&&t&&!f5(e)?0:n},f4=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},f7=function(e){return"INPUT"===e.tagName},f9=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},pe=function(e){if(!e.name)return!0;var t,n=e.form||fZ(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("u">typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var i=f9(t,e.form);return!i||i===e},pt=function(e){return f7(e)&&"radio"===e.type&&!pe(e)},pn=function(e){var t,n,r,i,o,a,s,l=e&&fZ(e),d=null==(t=l)?void 0:t.host,u=!1;if(l&&l!==e)for(u=!!(null!=(n=d)&&null!=(r=n.ownerDocument)&&r.contains(d)||null!=e&&null!=(i=e.ownerDocument)&&i.contains(e));!u&&d;)u=!!(null!=(a=d=null==(o=l=fZ(d))?void 0:o.host)&&null!=(s=a.ownerDocument)&&s.contains(d));return u},pr=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},pi=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("full-native"===n&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});var i=getComputedStyle(e).visibility;if("hidden"===i||"collapse"===i)return!0;var o=fQ.call(e,"details>summary:first-of-type")?e.parentElement:e;if(fQ.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return pr(e)}else{if("function"==typeof r){for(var a=e;e;){var s=e.parentElement,l=fZ(e);if(s&&!s.shadowRoot&&!0===r(s))return pr(e);e=e.assignedSlot?e.assignedSlot:s||l===e.ownerDocument?s:l.host}e=a}if(pn(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},po=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!fQ.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1},pa=function(e,t){return!(t.disabled||f7(t)&&"hidden"===t.type||pi(t,e)||"DETAILS"===t.tagName&&Array.prototype.slice.apply(t.children).some(function(e){return"SUMMARY"===e.tagName})||po(t))},ps=function(e,t){return!(pt(t)||0>f6(t))&&!!pa(e,t)},pl=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!isNaN(t)||!!(t>=0)},pd=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,o=i?e.scopeParent:e,a=f3(o,i),s=i?pd(e.candidates):o;0===a?i?t.push.apply(t,s):t.push(o):n.push({documentOrder:r,tabIndex:a,item:e,isScope:i,content:s})}),n.sort(f4).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},pu=function(e,t){return pd((t=t||{}).getShadowRoot?f8([e],t.includeContainer,{filter:ps.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:pl}):f2(e,t.includeContainer,ps.bind(null,t)))};function pc(){return/apple/i.test(navigator.vendor)}function ph(e){let t=e.activeElement;for(;(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function pf(e,t){if(!e||!t)return!1;let n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&fm(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function pp(e){return"composedPath"in e?e.composedPath()[0]:e.target}function pm(e,t){return null!=t&&("composedPath"in e?e.composedPath().includes(t):null!=e.target&&t.contains(e.target))}function pg(e){return(null==e?void 0:e.ownerDocument)||document}function pb(e,t,n){return void 0===n&&(n=!0),e.filter(e=>{var r;return e.parentId===t&&(!n||(null==(r=e.context)?void 0:r.open))}).flatMap(t=>[t,...pb(e,t.id,n)])}function pv(e,t){let n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var py="u">typeof document?g.useLayoutEffect:function(){};function pw(e){let t=g.useRef(e);return py(()=>{t.current=e}),t}let px={...g}.useInsertionEffect||(e=>e());function pk(e){let t=g.useRef(()=>{});return px(()=>{t.current=e}),g.useCallback(function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}let pS=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function pC(e,t){let n=pu(e,pS()),r=n.length;if(0===r)return;let i=ph(pg(e)),o=n.indexOf(i);return n[-1===o?1===t?0:r-1:o+t]}function pA(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!pf(n,r)}function pE(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}let pL="active",p_="selected",pN={...g},pT=!1,pR=0,pM=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+pR++,pP=pN.useId||function(){let[e,t]=g.useState(()=>pT?pM():void 0);return py(()=>{null==e&&t(pM())},[]),g.useEffect(()=>{pT=!0},[]),e},pI=g.createContext(null),pD=g.createContext(null),pj=()=>{var e;return(null==(e=g.useContext(pI))?void 0:e.id)||null};function p$(e){return"data-floating-ui-"+e}function pO(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}let pz=p$("safe-polygon");function pB(e,t,n){if(n&&!pv(n))return 0;if("number"==typeof e)return e;if("function"==typeof e){let n=e();return"number"==typeof n?n:null==n?void 0:n[t]}return null==e?void 0:e[t]}function pH(e){return"function"==typeof e?e():e}function pU(e,t){if(!e||!t)return!1;let n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&fm(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}let pF={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},pG=g.forwardRef(function(e,t){let[n,r]=g.useState();py(()=>{pc()&&r("button")},[]);let i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[p$("focus-guard")]:"",style:pF};return(0,m.jsx)("span",{...e,...i})}),pW={clipPath:"inset(50%)",position:"fixed",top:0,left:0},pq=g.createContext(null),pV=p$("portal");function pX(e){let{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,o=function(e){void 0===e&&(e={});let{id:t,root:n}=e,r=pP(),i=pK(),[o,a]=g.useState(null),s=g.useRef(null);return py(()=>()=>{null==o||o.remove(),queueMicrotask(()=>{s.current=null})},[o]),py(()=>{if(!r||s.current)return;let e=t?document.getElementById(t):null;if(!e)return;let n=document.createElement("div");n.id=r,n.setAttribute(pV,""),e.appendChild(n),s.current=n,a(n)},[t,r]),py(()=>{if(null===n||!r||s.current)return;let e=n||(null==i?void 0:i.portalNode);e&&!fh(e)&&(e=e.current),e=e||document.body;let o=null;t&&((o=document.createElement("div")).id=t,e.appendChild(o));let l=document.createElement("div");l.id=r,l.setAttribute(pV,""),(e=o||e).appendChild(l),s.current=l,a(l)},[t,n,r,i]),o}({id:n,root:r}),[a,s]=g.useState(null),l=g.useRef(null),d=g.useRef(null),u=g.useRef(null),c=g.useRef(null),h=null==a?void 0:a.modal,f=null==a?void 0:a.open,p=!!a&&!a.modal&&a.open&&i&&!!(r||o);return g.useEffect(()=>{if(o&&i&&!h)return o.addEventListener("focusin",e,!0),o.addEventListener("focusout",e,!0),()=>{o.removeEventListener("focusin",e,!0),o.removeEventListener("focusout",e,!0)};function e(e){o&&pA(e)&&("focusin"===e.type?pE:function(e){pu(e,pS()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})})(o)}},[o,i,h]),g.useEffect(()=>{!o||f||pE(o)},[f,o]),(0,m.jsxs)(pq.Provider,{value:g.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:d,beforeInsideRef:u,afterInsideRef:c,portalNode:o,setFocusManagerState:s}),[i,o]),children:[p&&o&&(0,m.jsx)(pG,{"data-type":"outside",ref:l,onFocus:e=>{var t,n;if(pA(e,o))null==(t=u.current)||t.focus();else{let e=pC(pg(n=a?a.domReference:null).body,-1)||n;null==e||e.focus()}}}),p&&o&&(0,m.jsx)("span",{"aria-owns":o.id,style:pW}),o&&rE.createPortal(t,o),p&&o&&(0,m.jsx)(pG,{"data-type":"outside",ref:d,onFocus:e=>{var t,n;if(pA(e,o))null==(t=c.current)||t.focus();else{let t=pC(pg(n=a?a.domReference:null).body,1)||n;null==t||t.focus(),(null==a?void 0:a.closeOnFocusOut)&&(null==a||a.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})}let pK=()=>g.useContext(pq),pY={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},pJ={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},pQ=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function pZ(){let e;return(null!=(e=navigator.userAgentData)&&e.platform?e.platform:navigator.platform).toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints&&pc()}function p0(e,t,n){let r=new Map,i="item"===n,o=e;if(i&&e){let{[pL]:t,[p_]:n,...r}=e;o=r}return{..."floating"===n&&{tabIndex:-1,"data-floating-ui-focusable":""},...o,...t.map(t=>{let r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,o]=t;if(!(i&&[pL,p_].includes(n)))if(0===n.indexOf("on")){if(r.has(n)||r.set(n,[]),"function"==typeof o){var a;null==(a=r.get(n))||a.push(o),e[n]=function(){for(var e,t=arguments.length,i=Array(t),o=0;o<t;o++)i[o]=arguments[o];return null==(e=r.get(n))?void 0:e.map(e=>e(...i)).find(e=>void 0!==e)}}}else e[n]=o}),e),{})}}function p1(e,t){let[n,r]=e,i=!1,o=t.length;for(let e=0,a=o-1;e<o;a=e++){let[o,s]=t[e]||[0,0],[l,d]=t[a]||[0,0];s>=r!=d>=r&&n<=(l-o)*(r-s)/(d-s)+o&&(i=!i)}return i}let p2=["#3b82f6","#f59e0b","#ef4444","#8b5cf6","#10b981","#ec4899","#06b6d4","#f97316"],p8={remote:0,head:1,tag:2,branch:3};function p5(e){return"branch"===e.kind&&e.current?4:p8[e.kind]}let p6=["#3b82f6","#f59e0b","#ef4444","#8b5cf6","#10b981","#ec4899","#06b6d4","#f97316","#14b8a6","#6366f1"];async function p3(e){let t=new TextEncoder().encode(e);return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",t)),e=>e.toString(16).padStart(2,"0")).join("")}let p4=/^(?:\d+\+)?([a-z0-9](?:[a-z0-9-]*[a-z0-9])?)@users\.noreply\.github\.com$/i;async function p7(e,t){let n=e.trim().toLowerCase();if(!n||!n.includes("@"))return null;let r=n.match(p4);if(r)return`https://github.com/${r[1]}.png?size=${t}`;if(!globalThis.crypto?.subtle)return null;let i=await p3(n);return`https://gravatar.com/avatar/${i}?s=${t}&d=404`}function p9({name:e,email:t,size:n=64,className:r,...i}){let o,a=p6[function(e){let t=0;for(let n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return Math.abs(t)}((t||e||"?").toLowerCase())%p6.length],[s,l]=(0,g.useState)(null),[d,u]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{let e=!0;return l(null),u(!1),p7(t??"",n).then(t=>e&&l(t)).catch(()=>{}),()=>{e=!1}},[t,n]),(0,m.jsxs)("span",{className:ry("relative inline-flex size-7 shrink-0 items-center justify-center overflow-hidden rounded-full text-[11px] font-semibold text-white select-none",r),style:{backgroundColor:a},title:e,...i,children:[0===(o=(e.trim()||(t??"").split("@")[0]||"?").split(/[\s._-]+/).filter(Boolean)).length?"?":1===o.length?o[0].slice(0,2).toUpperCase():(o[0][0]+o[o.length-1][0]).toUpperCase(),s&&!d&&(0,m.jsx)("img",{src:s,alt:"",loading:"lazy",referrerPolicy:"no-referrer",onError:()=>u(!0),className:"absolute inset-0 size-full rounded-full object-cover"})]})}function me(e,t){let n=Number.parseInt(e.slice(1,3),16),r=Number.parseInt(e.slice(3,5),16),i=Number.parseInt(e.slice(5,7),16);return`rgba(${n}, ${r}, ${i}, ${t})`}function mt(e){return 8+15*e+7.5}function mn(e,t,n,r){let i=mt(e),o=mt(n);if(e===n)return`M ${i} ${t} L ${o} ${r}`;let a=(t+r)/2;return`M ${i} ${t} C ${i} ${a} ${o} ${a} ${o} ${r}`}function mr({row:e,width:t,isHead:n,topStub:r}){return(0,m.jsxs)("svg",{width:t,height:30,className:"block shrink-0",style:{overflow:"visible"},"aria-hidden":!0,children:[r&&(0,m.jsx)("path",{d:mn(e.col,0,e.col,15),fill:"none",stroke:e.color,strokeWidth:2,strokeLinecap:"round"}),e.topLinks.map((e,t)=>(0,m.jsx)("path",{d:mn(e.from,0,e.to,15),fill:"none",stroke:e.color,strokeWidth:2,strokeLinecap:"round"},`t${t}`)),e.bottomLinks.map((e,t)=>(0,m.jsx)("path",{d:mn(e.from,15,e.to,30),fill:"none",stroke:e.color,strokeWidth:2,strokeLinecap:"round"},`b${t}`)),n&&(0,m.jsx)("circle",{cx:mt(e.col),cy:15,r:7.5,fill:"none",stroke:e.color,strokeWidth:1.5,opacity:.3}),(0,m.jsx)("circle",{cx:mt(e.col),cy:15,r:4,fill:n?void 0:e.color,className:n?"fill-white dark:fill-[#111]":void 0,stroke:e.color,strokeWidth:2.5})]})}function mi({refToken:e,color:t}){if("tag"===e.kind)return(0,m.jsxs)("span",{className:"inline-flex max-w-[140px] items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] leading-none font-medium",style:{color:t,borderColor:me(t,.5),backgroundColor:me(t,.12)},children:[(0,m.jsx)(rC,{name:"i-ph-tag-duotone",className:"size-2.5 shrink-0"}),(0,m.jsx)("span",{className:"truncate",title:e.name,children:e.name})]});if("head"===e.kind)return(0,m.jsx)("span",{className:"color-muted inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 font-mono text-[10px] leading-none font-medium",children:"HEAD"});let n="remote"===e.kind?`${e.remote}/${e.name}`:e.name,r="branch"===e.kind&&e.current;return(0,m.jsxs)("span",{className:"inline-flex max-w-[140px] items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px] leading-none font-medium",style:r?{color:"#fff",backgroundColor:t}:{color:t,borderColor:me(t,.5),backgroundColor:me(t,.12),borderWidth:1,borderStyle:"solid"},children:[r?(0,m.jsx)(rC,{name:"i-ph-check",className:"size-2.5 shrink-0"}):(0,m.jsx)(rC,{name:"i-ph-git-branch-duotone",className:"size-2.5 shrink-0 opacity-70"}),(0,m.jsx)("span",{className:"truncate",title:n,children:n})]})}function mo({additions:e,deletions:t}){return(0,m.jsxs)("span",{className:"tabular-nums",children:[(0,m.jsx)("span",{className:"text-success font-medium",children:`+${e}`})," ",(0,m.jsx)("span",{className:"text-error font-medium",children:`−${t}`})]})}function ma({commit:e,detail:t,onOpen:n}){let r=(t?.data?.body||e.body||e.subject).trim(),i=t?.data?.files.length??0;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("div",{className:"space-y-2.5 p-3.5",children:[(0,m.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,m.jsx)(p9,{name:e.author,email:e.email,className:"size-8 text-xs"}),(0,m.jsxs)("div",{className:"flex min-w-0 items-baseline gap-2",children:[(0,m.jsx)("span",{className:"color-base truncate font-semibold",children:e.author}),(0,m.jsx)("span",{className:"color-muted shrink-0 text-xs",title:new Date(e.date).toLocaleString(),children:function(e){let t=Math.round((Date.now()-e)/6e4);if(t<1)return"just now";if(t<60)return`${t} minute${1===t?"":"s"} ago`;let n=Math.round(t/60);if(n<24)return`${n} hour${1===n?"":"s"} ago`;let r=Math.round(n/24);return r<30?`${r} day${1===r?"":"s"} ago`:new Date(e).toLocaleDateString()}(e.date)})]})]}),(0,m.jsx)("p",{className:"color-muted line-clamp-3 text-sm leading-snug",children:r})]}),(0,m.jsxs)("div",{className:"border-base flex items-center justify-between border-t px-3.5 py-2.5 text-sm",children:[t?.loading||!t?(0,m.jsxs)("span",{className:"color-faint inline-flex items-center gap-1.5",children:[(0,m.jsx)(rC,{name:"i-ph-spinner-gap",className:"size-3.5 animate-spin"}),"Loading…"]}):t.data?(0,m.jsxs)("span",{className:"color-muted",children:[(0,m.jsxs)("span",{className:"color-base font-medium",children:[i," ",1===i?"file":"files"," ","changed"]})," ",(0,m.jsx)(mo,{additions:t.data.totalAdditions,deletions:t.data.totalDeletions})]}):(0,m.jsx)("code",{className:"color-muted tabular-nums",children:e.shortHash}),(0,m.jsx)(rk,{variant:"ghost",size:"sm",onClick:n,"aria-label":"Open commit details",children:(0,m.jsx)(rC,{name:"i-ph-arrow-right",className:"size-4"})})]})]})}let ms=(0,g.memo)(({commit:e,row:t,gutter:n,currentBranch:r,isHead:i,topStub:o,selected:a,onSelect:s,onLoadDetail:l})=>{var d,u,c,h,f,p,b,v;let y,w,x,k,S,C,A,E,L,_=(0,g.useMemo)(()=>(function(e,t){let n=[];for(let r of e){let e=r.trim();if(!e)continue;if(e.startsWith("tag: ")){n.push({kind:"tag",name:e.slice(5).trim()});continue}if(e.includes("->")){let t=e.split("->")[1]?.trim();t&&n.push({kind:"branch",name:t,current:!0});continue}if("HEAD"===e){n.push({kind:"head"});continue}let i=e.indexOf("/");if(i>0){let t=e.slice(0,i),r=e.slice(i+1);if("HEAD"===r)continue;n.push({kind:"remote",remote:t,name:r});continue}n.push({kind:"branch",name:e,current:t===e})}return n.sort((e,t)=>p5(e)-p5(t))})(e.refs,r),[e.refs,r]),[N,T]=(0,g.useState)(!1),[R,M]=(0,g.useState)(),P=0!==t.col&&!a&&!N,I=function(e){var t,n;let{elements:r,...i}=void 0===e?{}:e,{nodeId:o}=i,a=function(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=pP(),o=g.useRef({}),[a]=g.useState(()=>{let e;return e=new Map,{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;null==(r=e.get(t))||r.delete(n)}}}),s=null!=pj(),[l,d]=g.useState(r.reference),u=pk((e,t,r)=>{o.current.openEvent=e?t:void 0,a.emit("openchange",{open:e,event:t,reason:r,nested:s}),null==n||n(e,t,r)}),c=g.useMemo(()=>({setPositionReference:d}),[]),h=g.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return g.useMemo(()=>({dataRef:o,open:t,onOpenChange:u,elements:h,events:a,floatingId:i,refs:c}),[t,u,h,a,i,c])}({...i,elements:{reference:null!=(t=null==r?void 0:r.reference)?t:null,floating:null!=(n=null==r?void 0:r.floating)?n:null}}),s=i.rootContext||a,l=s.elements,[d,u]=g.useState(null),[c,h]=g.useState(null),f=(null==l?void 0:l.domReference)||d,p=g.useRef(null),m=g.useContext(pD);py(()=>{f&&(p.current=f)},[f]);let b=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:d}=e,[u,c]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=g.useState(r);fq(h,r)||f(r);let[p,m]=g.useState(null),[b,v]=g.useState(null),y=g.useCallback(e=>{e!==S.current&&(S.current=e,m(e))},[]),w=g.useCallback(e=>{e!==C.current&&(C.current=e,v(e))},[]),x=o||p,k=a||b,S=g.useRef(null),C=g.useRef(null),A=g.useRef(u),E=null!=l,L=fK(l),_=fK(i),N=fK(d),T=g.useCallback(()=>{var e,r;let i,o,a;if(!S.current||!C.current)return;let s={placement:t,strategy:n,middleware:h};_.current&&(s.platform=_.current),(e=S.current,r=C.current,i=new Map,o=null!=s?s:{},a={...fU,...o.platform,_c:i},fo(e,r,{...o,platform:a})).then(e=>{let t={...e,isPositioned:!1!==N.current};R.current&&!fq(A.current,t)&&(A.current=t,rE.flushSync(()=>{c(t)}))})},[h,t,n,_,N]);fW(()=>{!1===d&&A.current.isPositioned&&(A.current.isPositioned=!1,c(e=>({...e,isPositioned:!1})))},[d]);let R=g.useRef(!1);fW(()=>(R.current=!0,()=>{R.current=!1}),[]),fW(()=>{if(x&&(S.current=x),k&&(C.current=k),x&&k){if(L.current)return L.current(x,k,T);T()}},[x,k,T,L,E]);let M=g.useMemo(()=>({reference:S,floating:C,setReference:y,setFloating:w}),[y,w]),P=g.useMemo(()=>({reference:x,floating:k}),[x,k]),I=g.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=fX(P.floating,u.x),r=fX(P.floating,u.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...fV(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:T,refs:M,elements:P,floatingStyles:I}),[u,T,M,P,I])}({...i,elements:{...l,...c&&{reference:c}}}),v=g.useCallback(e=>{let t=ff(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;h(t),b.refs.setReference(t)},[b.refs]),y=g.useCallback(e=>{(ff(e)||null===e)&&(p.current=e,u(e)),(ff(b.refs.reference.current)||null===b.refs.reference.current||null!==e&&!ff(e))&&b.refs.setReference(e)},[b.refs]),w=g.useMemo(()=>({...b.refs,setReference:y,setPositionReference:v,domReference:p}),[b.refs,y,v]),x=g.useMemo(()=>({...b.elements,domReference:f}),[b.elements,f]),k=g.useMemo(()=>({...b,...s,refs:w,elements:x,nodeId:o}),[b,w,x,o,s]);return py(()=>{s.dataRef.current.floatingContext=k;let e=null==m?void 0:m.nodesRef.current.find(e=>e.id===o);e&&(e.context=k)}),g.useMemo(()=>({...b,context:k,refs:w,elements:x}),[b,w,x,k])}({open:N,onOpenChange:T,placement:"bottom-start",middleware:[{name:(y={name:"offset",options:6,async fn(e){var t,n;let{x:r,y:i,placement:o,middlewareData:a}=e,s=await fs(e,6);return o===(null==(t=a.offset)?void 0:t.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:o}}}}).name,fn:y.fn,options:[6,d]},{name:(w={name:"flip",options:h=u={padding:8},async fn(e){var t,n,r,i,o,a,s,l;let d,u,c,{placement:f,middlewareData:p,rects:m,initialPlacement:g,platform:b,elements:v}=e,{mainAxis:y=!0,crossAxis:w=!0,fallbackPlacements:x,fallbackStrategy:k="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:C=!0,...A}=h0(h,e);if(null!=(t=p.arrow)&&t.alignmentOffset)return{};let E=h1(f),L=h6(g),_=h1(g)===g,N=await (null==b.isRTL?void 0:b.isRTL(v.floating)),T=x||(_||!C?[ft(g)]:(d=ft(g),[h3(g),d,h3(d)])),R="none"!==S;!x&&R&&T.push(...(u=h2(g),c=function(e,t,n){switch(e){case"top":case"bottom":if(n)return t?h7:h4;return t?h4:h7;case"left":case"right":return t?h9:fe;default:return[]}}(h1(g),"start"===S,N),u&&(c=c.map(e=>e+"-"+u),C&&(c=c.concat(c.map(h3)))),c));let M=[g,...T],P=await b.detectOverflow(e,A),I=[],D=(null==(n=p.flip)?void 0:n.overflows)||[];if(y&&I.push(P[E]),w){let e,t,n,r,i=(a=f,s=m,void 0===(l=N)&&(l=!1),e=h2(a),n=h5(t=h8(h6(a))),r="x"===t?e===(l?"end":"start")?"right":"left":"start"===e?"bottom":"top",s.reference[n]>s.floating[n]&&(r=ft(r)),[r,ft(r)]);I.push(P[i[0]],P[i[1]])}if(D=[...D,{placement:f,overflows:I}],!I.every(e=>e<=0)){let e=((null==(r=p.flip)?void 0:r.index)||0)+1,t=M[e];if(t&&("alignment"!==w||L===h6(t)||D.every(e=>h6(e.placement)!==L||e.overflows[0]>0)))return{data:{index:e,overflows:D},reset:{placement:t}};let n=null==(i=D.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:i.placement;if(!n)switch(k){case"bestFit":{let e=null==(o=D.filter(e=>{if(R){let t=h6(e.placement);return t===L||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:o[0];e&&(n=e);break}case"initialPlacement":n=g}if(f!==n)return{reset:{placement:n}}}return{}}}).name,fn:w.fn,options:[u,c]},{name:(x={name:"shift",options:b=f={padding:8},async fn(e){let{x:t,y:n,placement:r,platform:i}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=h0(b,e),d={x:t,y:n},u=await i.detectOverflow(e,l),c=h6(r),h=h8(c),f=d[h],p=d[c],m=(e,t)=>hK(t+u["y"===e?"top":"left"],hX(t,t-u["y"===e?"bottom":"right"]));o&&(f=m(h,f)),a&&(p=m(c,p));let g=s.fn({...e,[h]:f,[c]:p});return{...g,data:{x:g.x-t,y:g.y-n,enabled:{[h]:o,[c]:a}}}}}).name,fn:x.fn,options:[f,p]}],whileElementsMounted:fG}),{getReferenceProps:D,getFloatingProps:j}=(k=(v=[function(e,t){void 0===t&&(t={});let{open:n,onOpenChange:r,dataRef:i,events:o,elements:a}=e,{enabled:s=!0,delay:l=0,handleClose:d=null,mouseOnly:u=!1,restMs:c=0,move:h=!0}=t,f=g.useContext(pD),p=pj(),m=pw(d),b=pw(l),v=pw(n),y=pw(c),w=g.useRef(),x=g.useRef(-1),k=g.useRef(),S=g.useRef(-1),C=g.useRef(!0),A=g.useRef(!1),E=g.useRef(()=>{}),L=g.useRef(!1),_=pk(()=>{var e;let t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t});g.useEffect(()=>{if(s)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{open:t}=e;t||(pO(x),pO(S),C.current=!0,L.current=!1)}},[s,o]),g.useEffect(()=>{if(!s||!m.current||!n)return;function e(e){_()&&r(!1,e,"hover")}let t=pg(a.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[a.floating,n,r,s,m,_]);let N=g.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");let i=pB(b.current,"close",w.current);i&&!k.current?(pO(x),x.current=window.setTimeout(()=>r(!1,e,n),i)):t&&(pO(x),r(!1,e,n))},[b,r]),T=pk(()=>{E.current(),k.current=void 0}),R=pk(()=>{if(A.current){let e=pg(a.floating).body;e.style.pointerEvents="",e.removeAttribute(pz),A.current=!1}}),M=pk(()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type));g.useEffect(()=>{if(s&&ff(a.domReference)){let r=a.domReference,i=a.floating;return n&&r.addEventListener("mouseleave",o),h&&r.addEventListener("mousemove",e,{once:!0}),r.addEventListener("mouseenter",e),r.addEventListener("mouseleave",t),i&&(i.addEventListener("mouseleave",o),i.addEventListener("mouseenter",l),i.addEventListener("mouseleave",d)),()=>{n&&r.removeEventListener("mouseleave",o),h&&r.removeEventListener("mousemove",e),r.removeEventListener("mouseenter",e),r.removeEventListener("mouseleave",t),i&&(i.removeEventListener("mouseleave",o),i.removeEventListener("mouseenter",l),i.removeEventListener("mouseleave",d))}}function e(e){if(pO(x),C.current=!1,u&&!pv(w.current)||pH(y.current)>0&&!pB(b.current,"open"))return;let t=pB(b.current,"open",w.current);t?x.current=window.setTimeout(()=>{v.current||r(!0,e,"hover")},t):n||r(!0,e,"hover")}function t(e){if(M())return void R();E.current();let t=pg(a.floating);if(pO(S),L.current=!1,m.current&&i.current.floatingContext){n||pO(x),k.current=m.current({...i.current.floatingContext,tree:f,x:e.clientX,y:e.clientY,onClose(){R(),T(),M()||N(e,!0,"safe-polygon")}});let r=k.current;t.addEventListener("mousemove",r),E.current=()=>{t.removeEventListener("mousemove",r)};return}"touch"===w.current&&pf(a.floating,e.relatedTarget)||N(e)}function o(e){M()||i.current.floatingContext&&(null==m.current||m.current({...i.current.floatingContext,tree:f,x:e.clientX,y:e.clientY,onClose(){R(),T(),M()||N(e)}})(e))}function l(){pO(x)}function d(e){M()||N(e,!1)}},[a,s,e,u,h,N,T,R,r,n,v,f,b,m,i,M,y]),py(()=>{var e,t;if(s&&n&&null!=(e=m.current)&&null!=(e=e.__options)&&e.blockPointerEvents&&_()){A.current=!0;let e=a.floating;if(ff(a.domReference)&&e){let n=pg(a.floating).body;n.setAttribute(pz,"");let r=a.domReference,i=null==f||null==(t=f.nodesRef.current.find(e=>e.id===p))||null==(t=t.context)?void 0:t.elements.floating;return i&&(i.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}},[s,n,p,a,f,m,_]),py(()=>{n||(w.current=void 0,L.current=!1,T(),R())},[n,T,R]),g.useEffect(()=>()=>{T(),pO(x),pO(S),R()},[s,a.domReference,T,R]);let P=g.useMemo(()=>{function e(e){w.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){C.current||v.current||r(!0,t,"hover")}u&&!pv(w.current)||n||0===pH(y.current)||L.current&&e.movementX**2+e.movementY**2<2||(pO(S),"touch"===w.current?i():(L.current=!0,S.current=window.setTimeout(i,pH(y.current))))}}},[u,r,n,v,y]);return g.useMemo(()=>s?{reference:P}:{},[s,P])}(I.context,{delay:{open:200,close:80},handleClose:function(e){void 0===e&&(e={});let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i={current:-1},o=!1,a=null,s=null,l="u">typeof performance?performance.now():0,d=e=>{let{x:n,y:d,placement:u,elements:c,onClose:h,nodeId:f,tree:p}=e;return function(e){function m(){pO(i),h()}if(pO(i),!c.domReference||!c.floating||null==u||null==n||null==d)return;let{clientX:g,clientY:b}=e,v=[g,b],y="composedPath"in e?e.composedPath()[0]:e.target,w="mouseleave"===e.type,x=pU(c.floating,y),k=pU(c.domReference,y),S=c.domReference.getBoundingClientRect(),C=c.floating.getBoundingClientRect(),A=u.split("-")[0],E=n>C.right-C.width/2,L=d>C.bottom-C.height/2,_=v[0]>=S.x&&v[0]<=S.x+S.width&&v[1]>=S.y&&v[1]<=S.y+S.height,N=C.width>S.width,T=C.height>S.height,R=(N?S:C).left,M=(N?S:C).right,P=(T?S:C).top,I=(T?S:C).bottom;if(x&&(o=!0,!w))return;if(k&&(o=!1),k&&!w){o=!0;return}if(w&&ff(e.relatedTarget)&&pU(c.floating,e.relatedTarget)||p&&function e(t,n,r){return void 0===r&&(r=!0),t.filter(e=>{var t;return e.parentId===n&&(!r||(null==(t=e.context)?void 0:t.open))}).flatMap(n=>[n,...e(t,n.id,r)])}(p.nodesRef.current,f).length)return;if("top"===A&&d>=S.bottom-1||"bottom"===A&&d<=S.top+1||"left"===A&&n>=S.right-1||"right"===A&&n<=S.left+1)return m();let D=[];switch(A){case"top":D=[[R,S.top+1],[R,C.bottom-1],[M,C.bottom-1],[M,S.top+1]];break;case"bottom":D=[[R,C.top+1],[R,S.bottom-1],[M,S.bottom-1],[M,C.top+1]];break;case"left":D=[[C.right-1,I],[C.right-1,P],[S.left+1,P],[S.left+1,I]];break;case"right":D=[[S.right-1,I],[S.right-1,P],[C.left+1,P],[C.left+1,I]]}if(!p1([g,b],D)){if(o&&!_)return m();if(!w&&r){let t=function(e,t){let n=performance.now(),r=n-l;if(null===a||null===s||0===r)return a=e,s=t,l=n,null;let i=e-a,o=t-s,d=Math.sqrt(i*i+o*o);return a=e,s=t,l=n,d/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return m()}p1([g,b],function(e){let[n,r]=e;switch(A){case"top":{let e=[[C.left,E||N?C.bottom-t:C.top],[C.right,E?N?C.bottom-t:C.top:C.bottom-t]];return[[N?n+t/2:E?n+4*t:n-4*t,r+t+1],[N?n-t/2:E?n+4*t:n-4*t,r+t+1],...e]}case"bottom":{let e=[[C.left,E||N?C.top+t:C.bottom],[C.right,E?N?C.top+t:C.bottom:C.top+t]];return[[N?n+t/2:E?n+4*t:n-4*t,r-t],[N?n-t/2:E?n+4*t:n-4*t,r-t],...e]}case"left":return[[L||T?C.right-t:C.left,C.top],[L?T?C.right-t:C.left:C.right-t,C.bottom],[n+t+1,T?r+t/2:L?r+4*t:r-4*t],[n+t+1,T?r-t/2:L?r+4*t:r-4*t]];case"right":{let e=[[L||T?C.left+t:C.right,C.top],[L?T?C.left+t:C.right:C.left+t,C.bottom]];return[[n-t,T?r+t/2:L?r+4*t:r-4*t],[n-t,T?r-t/2:L?r+4*t:r-4*t],...e]}}}([n,d]))?!o&&r&&(i.current=window.setTimeout(m,40)):m()}}};return d.__options={blockPointerEvents:n},d}()}),function(e,t){void 0===t&&(t={});let{open:n,onOpenChange:r,events:i,dataRef:o,elements:a}=e,{enabled:s=!0,visibleOnly:l=!0}=t,d=g.useRef(!1),u=g.useRef(-1),c=g.useRef(!0);g.useEffect(()=>{if(!s)return;let e=fu(a.domReference);function t(){!n&&fp(a.domReference)&&a.domReference===ph(pg(a.domReference))&&(d.current=!0)}function r(){c.current=!0}function i(){c.current=!1}return e.addEventListener("blur",t),pZ()&&(e.addEventListener("keydown",r,!0),e.addEventListener("pointerdown",i,!0)),()=>{e.removeEventListener("blur",t),pZ()&&(e.removeEventListener("keydown",r,!0),e.removeEventListener("pointerdown",i,!0))}},[a.domReference,n,s]),g.useEffect(()=>{if(s)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{reason:t}=e;("reference-press"===t||"escape-key"===t)&&(d.current=!0)}},[i,s]),g.useEffect(()=>()=>{pO(u)},[]);let h=g.useMemo(()=>({onMouseLeave(){d.current=!1},onFocus(e){if(d.current)return;let t=pp(e.nativeEvent);if(l&&ff(t)){if(pZ()&&!e.relatedTarget){if(!c.current&&!(fp(t)&&t.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")))return}else if(!function(e){let t;if(!e||((t=navigator.userAgentData)&&Array.isArray(t.brands)?t.brands.map(e=>{let{brand:t,version:n}=e;return t+"/"+n}).join(" "):navigator.userAgent).includes("jsdom/"))return!0;try{return e.matches(":focus-visible")}catch(e){return!0}}(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){d.current=!1;let t=e.relatedTarget,n=e.nativeEvent,i=ff(t)&&t.hasAttribute(p$("focus-guard"))&&"outside"===t.getAttribute("data-type");u.current=window.setTimeout(()=>{var e;let s=ph(a.domReference?a.domReference.ownerDocument:document);!t&&s===a.domReference||pf(null==(e=o.current.floatingContext)?void 0:e.refs.floating.current,s)||pf(a.domReference,s)||i||r(!1,n,"focus")})}}),[o,a.domReference,r,l]);return g.useMemo(()=>s?{reference:h}:{},[s,h])}(I.context),function(e,t){void 0===t&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:o}=e,{enabled:a=!0,escapeKey:s=!0,outsidePress:l=!0,outsidePressEvent:d="pointerdown",referencePress:u=!1,referencePressEvent:c="pointerdown",ancestorScroll:h=!1,bubbles:f,capture:p}=t,m=g.useContext(pD),b=pk("function"==typeof l?l:()=>!1),v="function"==typeof l?b:l,y=g.useRef(!1),{escapeKey:w,outsidePress:x}=pQ(f),{escapeKey:k,outsidePress:S}=pQ(p),C=g.useRef(!1),A=pk(e=>{var t;if(!n||!a||!s||"Escape"!==e.key||C.current)return;let i=null==(t=o.current.floatingContext)?void 0:t.nodeId,l=m?pb(m.nodesRef.current,i):[];if(!w&&(e.stopPropagation(),l.length>0)){let e=!0;if(l.forEach(t=>{var n;if(null!=(n=t.context)&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles){e=!1;return}}),!e)return}r(!1,"nativeEvent"in e?e.nativeEvent:e,"escape-key")}),E=pk(e=>{var t;let n=()=>{var t;A(e),null==(t=pp(e))||t.removeEventListener("keydown",n)};null==(t=pp(e))||t.addEventListener("keydown",n)}),L=pk(e=>{var t;let n=o.current.insideReactTree;o.current.insideReactTree=!1;let a=y.current;if(y.current=!1,"click"===d&&a||n||"function"==typeof v&&!v(e))return;let s=pp(e),l="["+p$("inert")+"]",u=pg(i.floating).querySelectorAll(l),c=ff(s)?s:null;for(;c&&!fS(c);){let e=fE(c);if(fS(e)||!ff(e))break;c=e}if(u.length&&ff(s)&&!s.matches("html,body")&&!pf(s,i.floating)&&Array.from(u).every(e=>!pf(c,e)))return;if(fp(s)&&T){let t=fS(s),n=fC(s),r=/auto|scroll/,i=t||r.test(n.overflowX),o=t||r.test(n.overflowY),a=i&&s.clientWidth>0&&s.scrollWidth>s.clientWidth,l=o&&s.clientHeight>0&&s.scrollHeight>s.clientHeight,d="rtl"===n.direction,u=l&&(d?e.offsetX<=s.offsetWidth-s.clientWidth:e.offsetX>s.clientWidth),c=a&&e.offsetY>s.clientHeight;if(u||c)return}let h=null==(t=o.current.floatingContext)?void 0:t.nodeId,f=m&&pb(m.nodesRef.current,h).some(t=>{var n;return pm(e,null==(n=t.context)?void 0:n.elements.floating)});if(pm(e,i.floating)||pm(e,i.domReference)||f)return;let p=m?pb(m.nodesRef.current,h):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;if(null!=(n=t.context)&&n.open&&!t.context.dataRef.current.__outsidePressBubbles){e=!1;return}}),!e)return}r(!1,e,"outside-press")}),_=pk(e=>{var t;let n=()=>{var t;L(e),null==(t=pp(e))||t.removeEventListener(d,n)};null==(t=pp(e))||t.addEventListener(d,n)});g.useEffect(()=>{if(!n||!a)return;o.current.__escapeKeyBubbles=w,o.current.__outsidePressBubbles=x;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function l(){window.clearTimeout(e),C.current=!0}function u(){e=window.setTimeout(()=>{C.current=!1},5*!!fk())}let c=pg(i.floating);s&&(c.addEventListener("keydown",k?E:A,k),c.addEventListener("compositionstart",l),c.addEventListener("compositionend",u)),v&&c.addEventListener(d,S?_:L,S);let f=[];return h&&(ff(i.domReference)&&(f=fL(i.domReference)),ff(i.floating)&&(f=f.concat(fL(i.floating))),!ff(i.reference)&&i.reference&&i.reference.contextElement&&(f=f.concat(fL(i.reference.contextElement)))),(f=f.filter(e=>{var t;return e!==(null==(t=c.defaultView)?void 0:t.visualViewport)})).forEach(e=>{e.addEventListener("scroll",t)}),()=>{s&&(c.removeEventListener("keydown",k?E:A,k),c.removeEventListener("compositionstart",l),c.removeEventListener("compositionend",u)),v&&c.removeEventListener(d,S?_:L,S),f.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[o,i,s,v,d,n,r,h,a,w,x,A,k,E,L,S,_]),g.useEffect(()=>{o.current.insideReactTree=!1},[o,v,d]);let N=g.useMemo(()=>({onKeyDown:A,...u&&{[pY[c]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==c&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}}),[A,r,u,c]),T=g.useMemo(()=>{function e(e){0===e.button&&(y.current=!0)}return{onKeyDown:A,onMouseDown:e,onMouseUp:e,[pJ[d]]:()=>{o.current.insideReactTree=!0}}},[A,d,o]);return g.useMemo(()=>a?{reference:N,floating:T}:{},[a,N,T])}(I.context)]).map(e=>null==e?void 0:e.reference),S=v.map(e=>null==e?void 0:e.floating),C=v.map(e=>null==e?void 0:e.item),A=g.useCallback(e=>p0(e,v,"reference"),k),E=g.useCallback(e=>p0(e,v,"floating"),S),L=g.useCallback(e=>p0(e,v,"item"),C),g.useMemo(()=>({getReferenceProps:A,getFloatingProps:E,getItemProps:L}),[A,E,L])),{isMounted:$,status:O}=function(e,t){void 0===t&&(t={});let{open:n,elements:{floating:r}}=e,{duration:i=250}=t,o=("number"==typeof i?i:i.close)||0,[a,s]=g.useState("unmounted"),l=function(e,t){let[n,r]=g.useState(e);return e&&!n&&r(!0),g.useEffect(()=>{if(!e&&n){let e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}(n,o);return l||"close"!==a||s("unmounted"),py(()=>{if(r){if(n){s("initial");let e=requestAnimationFrame(()=>{rE.flushSync(()=>{s("open")})});return()=>{cancelAnimationFrame(e)}}s("close")}},[n,r]),{isMounted:l,status:a}}(I.context,{duration:150});return(0,g.useEffect)(()=>{if(!N||R||!l)return;let t=!0;return M({loading:!0,data:null}),l(e.hash).then(e=>t&&M({loading:!1,data:e})).catch(()=>t&&M({loading:!1,data:null})),()=>{t=!1}},[N,R,l,e.hash]),(0,m.jsxs)("li",{children:[(0,m.jsxs)("button",{ref:I.refs.setReference,type:"button","aria-current":a?"true":void 0,className:ry("relative flex w-full items-stretch rounded-md text-left transition-colors","focus-visible:ring-primary-500/40 outline-none focus-visible:ring-2",a?"bg-active":"hover:bg-active"),style:{height:30},...D({onClick:()=>s?.(e.hash)}),children:[(0,m.jsx)("div",{className:"relative z-10",children:(0,m.jsx)(mr,{row:t,width:n,isHead:i,topStub:o})}),(0,m.jsxs)("div",{className:"relative z-10 flex min-w-0 flex-1 items-center gap-1.5 pr-2 pl-1.5",children:[(0,m.jsx)("span",{className:ry("truncate text-[13px] transition-colors",P?"color-faint font-normal":"color-base font-medium"),title:e.subject,children:e.subject}),_.map((e,n)=>(0,m.jsx)(mi,{refToken:e,color:t.color},n))]})]}),$&&(0,m.jsx)(pX,{children:(0,m.jsx)("div",{ref:I.refs.setFloating,style:I.floatingStyles,"data-af-animate":!0,"data-state":"open"===O?"open":"closed",className:"border-base bg-base z-tooltip w-80 overflow-hidden rounded-lg border shadow-lg",...j(),children:(0,m.jsx)(ma,{commit:e,detail:R,onOpen:()=>{s?.(e.hash),T(!1)}})})})]})});function ml({col:e,color:t,gutter:n,changes:r}){return(0,m.jsxs)("li",{className:"relative flex items-stretch",style:{height:30},children:[(0,m.jsx)("div",{className:"relative z-10",children:(0,m.jsxs)("svg",{width:n,height:30,className:"block shrink-0",style:{overflow:"visible"},"aria-hidden":!0,children:[(0,m.jsx)("path",{d:mn(e,15,e,30),fill:"none",stroke:t,strokeWidth:2,strokeDasharray:"2 3",strokeLinecap:"round"}),(0,m.jsx)("circle",{cx:mt(e),cy:15,r:4,className:"fill-white dark:fill-[#111]",stroke:t,strokeWidth:2,strokeDasharray:"2 2"})]})}),(0,m.jsxs)("div",{className:"relative z-10 flex min-w-0 flex-1 items-center gap-2 pr-2 pl-1.5",children:[(0,m.jsx)(rC,{name:"i-ph-pencil-simple-duotone",className:"color-muted size-3.5 shrink-0"}),(0,m.jsx)("span",{className:"text-[13px] font-medium",children:"Work in Progress"}),(0,m.jsxs)("span",{className:"color-muted text-xs",children:[r," ",1===r?"change":"changes"]})]})]})}function md(e){let{rpcConnected:t,isRepo:n,commits:r,hasMore:i,loading:o,error:a,selectedRef:s,currentBranch:l,workingChanges:d,selectedHash:u,onRefresh:c,onLoadMore:h,onSelectCommit:f,onLoadDetail:p}=e,b=(0,g.useMemo)(()=>(function(e){let t=[],n=0,r=()=>p2[n++%p2.length],i=()=>{let e=t.indexOf(null);return -1===e?t.length:e},o=[];for(let n of e){let e,{hash:a}=n,s=n.parents,l=[];for(let e=0;e<t.length;e++){let n=t[e];n&&l.push({col:e,hash:n.hash,color:n.color})}let d=t.findIndex(e=>e?.hash===a);-1===d?(d=i(),e=r()):e=t[d].color;for(let e=0;e<t.length;e++)t[e]?.hash===a&&(t[e]=null);t[d]=null;let u=[];for(s.forEach((n,o)=>{if(0===o){t[d]={hash:n,color:e},u.push({col:d,color:e});return}let a=t.findIndex(e=>e?.hash===n);-1===a&&(t[a=i()]={hash:n,color:r()}),u.push({col:a,color:t[a].color})}),0===s.length&&(t[d]=null);t.length>0&&null==t[t.length-1];)t.pop();let c=l.map(e=>({from:e.col,to:e.hash===a?d:e.col,color:e.color})),h=[];for(let e of l)e.hash!==a&&h.push({from:e.col,to:e.col,color:e.color});for(let e of u)h.push({from:d,to:e.col,color:e.color});o.push({col:d,color:e,topLinks:c,bottomLinks:h})}let a=0;for(let e of o){for(let t of(a=Math.max(a,e.col+1),e.topLinks))a=Math.max(a,t.from+1,t.to+1);for(let t of e.bottomLinks)a=Math.max(a,t.from+1,t.to+1)}return{rows:o,columns:a}})(r),[r]),v=15*Math.max(b.columns,1)+7.5+8,y=(d??0)>0&&r.length>0&&(!s||s===l),w=b.rows[0],x=(0,g.useRef)(null),k=(0,g.useRef)(null),S=(0,g.useRef)(!1),C=(0,g.useRef)(h);return C.current=h,(0,g.useEffect)(()=>{o||(S.current=!1)},[o]),(0,g.useEffect)(()=>{let e=x.current,t=k.current;if(!e||!t||!i)return;let n=new IntersectionObserver(e=>{!e[0]?.isIntersecting||S.current||o||(S.current=!0,C.current())},{root:e,rootMargin:"120px"});return n.observe(t),()=>n.disconnect()},[i,o,r.length]),(0,m.jsxs)("div",{className:"flex h-full min-h-0 flex-col gap-2",children:[(0,m.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,m.jsxs)("div",{className:"flex min-w-0 items-baseline gap-2.5",children:[(0,m.jsx)("h2",{className:"text-lg leading-none font-semibold tracking-tight",children:"Commit History"}),(0,m.jsx)("span",{className:"color-muted shrink-0 text-xs tabular-nums",children:n?`${r.length}${i?"+":""}${s?` \xb7 ${s}`:""}`:""})]}),(0,m.jsx)(rk,{variant:"ghost",size:"sm",onClick:c,disabled:o,"aria-label":"Refresh log",children:(0,m.jsx)(rC,{name:"i-ph-arrows-clockwise",className:ry("size-4",o&&"animate-spin")})})]}),!t&&(0,m.jsx)("div",{className:"space-y-1.5",children:Array.from({length:6}).map((e,t)=>(0,m.jsx)(il,{className:"h-8 w-full"},t))}),a&&(0,m.jsx)("p",{className:"text-error text-sm",children:a}),!1===n&&(0,m.jsx)("p",{className:"color-muted text-sm",children:"The working directory is not a git repository."}),!0===n&&0===r.length&&(0,m.jsx)("p",{className:"color-muted text-sm",children:"No commits yet."}),!0===n&&r.length>0&&(0,m.jsxs)("div",{ref:x,className:"min-h-0 flex-1 overflow-y-auto pr-1",children:[(0,m.jsxs)("ul",{children:[y&&w&&(0,m.jsx)(ml,{col:w.col,color:w.color,gutter:v,changes:d??0}),r.map((e,t)=>(0,m.jsx)(ms,{commit:e,row:b.rows[t],gutter:v,currentBranch:l,isHead:0===t,topStub:0===t&&y,selected:e.hash===u,onSelect:f,onLoadDetail:p},e.hash))]}),i&&(0,m.jsxs)("div",{ref:k,className:"color-muted flex items-center justify-center gap-2 py-3 text-xs",children:[(0,m.jsx)(rC,{name:"i-ph-spinner-gap",className:"size-3.5 animate-spin"}),"Loading more…"]})]})]})}function mu({branch:e,selectedHash:t,onSelectCommit:n}){let{rpc:r}=ni(),[i,o]=(0,g.useState)(null),[a,s]=(0,g.useState)([]),[l,d]=(0,g.useState)(0),[u,c]=(0,g.useState)(!1),[h,f]=(0,g.useState)(!1),[p,b]=(0,g.useState)(null),[v,y]=(0,g.useState)(null),[w,x]=(0,g.useState)(null),k=(0,g.useRef)([]);(0,g.useEffect)(()=>{k.current=a},[a]);let S=(0,g.useCallback)(async(t,n,r)=>{f(!0),b(null);try{let i=await t.call("git:log",{limit:30,skip:n,ref:e??void 0});if(o(i.isRepo),"replace"===r)s(i.commits),d(i.commits.length);else{let e=new Set(k.current.map(e=>e.hash)),t=i.commits.filter(t=>!e.has(t.hash)&&(e.add(t.hash),!0));if(0===t.length)return void c(!1);s(e=>[...e,...t]),d(e=>e+t.length)}c(i.hasMore)}catch(e){b(e instanceof Error?e.message:String(e))}finally{f(!1)}},[e]),C=(0,g.useCallback)(async e=>{try{let t=await e.call("git:status");y(t.branch),x(t.staged.length+t.unstaged.length+t.untracked.length)}catch{}},[]);(0,g.useEffect)(()=>{r&&(S(r,0,"replace"),C(r))},[r,S,C]);let A=(0,g.useCallback)(async()=>{r&&await Promise.all([S(r,0,"replace"),C(r)])},[r,S,C]),E=(0,g.useCallback)(async()=>{r&&await S(r,l,"append")},[r,l,S]),L=(0,g.useCallback)(e=>r?r.call("git:show",{hash:e,patch:!1}):Promise.reject(Error("rpc unavailable")),[r]);return(0,m.jsx)(md,{rpcConnected:!!r,isRepo:i,commits:a,hasMore:u,loading:h,error:p,selectedRef:e??null,currentBranch:v,workingChanges:w,selectedHash:t,onRefresh:A,onLoadMore:E,onSelectCommit:n,onLoadDetail:r?L:void 0})}function mc({className:e,...t}){return(0,m.jsx)("textarea",{"data-slot":"textarea",className:ry("border-base placeholder:color-muted focus-visible:ring-primary-500/40 flex min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t})}function mh(e,t){return`${t}:${e}`}function mf({entry:e,staged:t,selected:n,action:r,onSelect:i}){let o=e.from?`${e.from} → ${e.path}`:e.path;return(0,m.jsxs)("li",{className:ry("group flex items-center gap-1 rounded pr-1 transition-colors",n?"bg-active":"hover:bg-active"),children:[(0,m.jsxs)("button",{type:"button",onClick:()=>i?.(e.path,t),className:"flex min-w-0 flex-1 items-center gap-1.5 py-0.5 pl-1 text-left text-xs outline-none",children:[(0,m.jsx)(ic,{code:e.status}),(0,m.jsx)(rA,{path:e.path,className:"size-4"}),(0,m.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono",title:o,children:o})]}),r]})}function mp({title:e,count:t,headerAction:n,children:r}){return 0===t?null:(0,m.jsxs)("div",{className:"space-y-1",children:[(0,m.jsxs)("div",{className:"flex items-center justify-between",children:[(0,m.jsxs)("div",{className:"color-muted flex items-center gap-2 text-xs font-medium tracking-wide uppercase",children:[e,(0,m.jsx)(rw,{variant:"secondary",className:"px-1.5 py-0 text-[10px] tabular-nums",children:t})]}),n]}),(0,m.jsx)("ul",{children:r})]})}function mm(e){let{data:t,loading:n,busy:r,canWrite:i,message:o,note:a,selectedKey:s,onRefresh:l,onStage:d,onUnstage:u,onCommit:c,onMessageChange:h,onSelectFile:f,patchSlot:p}=e,g=(e,t)=>(0,m.jsx)(rk,{variant:"ghost",size:"sm",disabled:r,"aria-label":t,onClick:()=>d(e),children:(0,m.jsx)(rC,{name:"i-ph-plus",className:"size-4"})});return(0,m.jsxs)("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[(0,m.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-2",children:[(0,m.jsxs)("div",{className:"flex min-w-0 items-baseline gap-2.5",children:[(0,m.jsx)("h2",{className:"text-lg leading-none font-semibold tracking-tight",children:"Changes"}),t?.isRepo&&!t.clean&&(0,m.jsxs)("span",{className:"color-muted shrink-0 text-xs tabular-nums",children:[t.staged.length+t.unstaged.length+t.untracked.length," ","changed"]})]}),(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[t?.isRepo&&(t.ahead>0||t.behind>0)&&(0,m.jsxs)(rw,{variant:"secondary",className:"gap-1 font-mono",children:[t.ahead>0&&(0,m.jsxs)("span",{className:"text-success inline-flex items-center tabular-nums",children:[(0,m.jsx)(rC,{name:"i-ph-arrow-up",className:"size-3"}),t.ahead]}),t.behind>0&&(0,m.jsxs)("span",{className:"text-warning inline-flex items-center tabular-nums",children:[(0,m.jsx)(rC,{name:"i-ph-arrow-down",className:"size-3"}),t.behind]})]}),(0,m.jsx)(rk,{variant:"ghost",size:"sm",onClick:l,disabled:n||r,"aria-label":"Refresh status",children:(0,m.jsx)(rC,{name:"i-ph-arrows-clockwise",className:`size-4 ${n?"animate-spin":""}`})})]})]}),!t&&(0,m.jsx)("div",{className:"space-y-2",children:Array.from({length:4}).map((e,t)=>(0,m.jsx)(il,{className:"h-6 w-full"},t))}),t&&!t.isRepo&&(0,m.jsx)("p",{className:"color-muted text-sm",children:"The working directory is not a git repository."}),t?.isRepo&&t.clean&&(0,m.jsx)("p",{className:"color-muted text-sm",children:"Nothing to commit. The working tree is clean."}),t?.isRepo&&!t.clean&&(0,m.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3",children:[(0,m.jsx)(ia,{className:"min-h-0 flex-1 pr-3",children:(0,m.jsxs)("div",{className:"space-y-4",children:[(0,m.jsx)(mp,{title:"Staged",count:t.staged.length,headerAction:i&&t.staged.length>0?(0,m.jsx)(rx,{variant:"ghost",size:"sm",disabled:r,onClick:()=>u(t.staged.map(e=>e.path)),children:"Unstage all"}):void 0,children:t.staged.map(e=>{let t,n;return(0,m.jsx)(mf,{entry:e,staged:!0,selected:s===mh(e.path,!0),onSelect:f,action:i?(t=[e.path],n=`Unstage ${e.path}`,(0,m.jsx)(rk,{variant:"ghost",size:"sm",disabled:r,"aria-label":n,onClick:()=>u(t),children:(0,m.jsx)(rC,{name:"i-ph-minus",className:"size-4"})})):void 0},`s:${e.path}`)})}),(0,m.jsx)(mp,{title:"Unstaged",count:t.unstaged.length,headerAction:i&&t.unstaged.length>0?(0,m.jsx)(rx,{variant:"ghost",size:"sm",disabled:r,onClick:()=>d(t.unstaged.map(e=>e.path)),children:"Stage all"}):void 0,children:t.unstaged.map(e=>(0,m.jsx)(mf,{entry:e,staged:!1,selected:s===mh(e.path,!1),onSelect:f,action:i?g([e.path],`Stage ${e.path}`):void 0},`u:${e.path}`))}),(0,m.jsx)(mp,{title:"Untracked",count:t.untracked.length,headerAction:i&&t.untracked.length>0?(0,m.jsx)(rx,{variant:"ghost",size:"sm",disabled:r,onClick:()=>d(t.untracked),children:"Stage all"}):void 0,children:t.untracked.map(e=>(0,m.jsx)(mf,{entry:{path:e,status:"unknown"},staged:!1,selected:s===mh(e,!1),onSelect:f,action:i?g([e],`Stage ${e}`):void 0},`t:${e}`))})]})}),p&&(0,m.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden rounded-md border",children:p}),i&&t.staged.length>0&&(0,m.jsxs)("div",{className:"shrink-0 space-y-2 border-t pt-3",children:[(0,m.jsx)(mc,{value:o,onChange:e=>h(e.target.value),placeholder:"Commit message",rows:2,disabled:r,"aria-label":"Commit message"}),a&&(0,m.jsx)("p",{className:"text-error text-xs",children:a}),(0,m.jsx)(rx,{size:"sm",className:"tabular-nums",onClick:c,disabled:r||0===o.trim().length,children:`Commit ${t.staged.length} file${1===t.staged.length?"":"s"}`})]})]})]})}function mg({staged:e,path:t}){let{data:n,loading:r}=na((0,g.useCallback)(n=>n.call("git:diff",{staged:e,path:t}),[e,t]));return(0,m.jsx)(hU,{patch:n?.patch??null,loading:r||!n,truncated:n?.truncated??!1})}function mb(){let{rpc:e}=ni(),{data:t,loading:n,refresh:r,setData:i}=na((0,g.useCallback)(e=>e.call("git:status"),[])),[o,a]=(0,g.useState)(!1),[s,l]=(0,g.useState)(""),[d,u]=(0,g.useState)(null),[c,h]=(0,g.useState)(null),f=!!t?.canWrite&&e?.connectionMeta.backend==="websocket",p=(0,g.useCallback)(async t=>{if(e&&0!==t.length){a(!0),u(null);try{i(await e.call("git:stage",{paths:t}))}finally{a(!1)}}},[e,i]),b=(0,g.useCallback)(async t=>{if(e&&0!==t.length){a(!0),u(null);try{i(await e.call("git:unstage",{paths:t}))}finally{a(!1)}}},[e,i]),v=(0,g.useCallback)(async()=>{if(e){a(!0),u(null);try{let t=await e.call("git:commit",{message:s});i(t.status),t.ok?l(""):u(t.message)}finally{a(!1)}}},[e,s,i]),y=(0,g.useCallback)((e,t)=>{h(n=>n&&n.path===e&&n.staged===t?null:{path:e,staged:t})},[]);return(0,m.jsx)(mm,{data:t,loading:n,busy:o,canWrite:!!f,message:s,note:d,selectedKey:c?`${c.staged}:${c.path}`:null,onRefresh:r,onStage:p,onUnstage:b,onCommit:v,onMessageChange:l,onSelectFile:y,patchSlot:c?(0,m.jsx)(mg,{staged:c.staged,path:c.path},`${c.staged}:${c.path}`):null})}let mv=[{id:"commits",label:"Commits",icon:"i-ph-git-commit-duotone"},{id:"changes",label:"Changes",icon:"i-ph-git-diff-duotone"}];function my(e,t,n){return Math.min(Math.max(e,t),n)}function mw({onPointerDown:e,label:t}){return(0,m.jsx)("div",{role:"separator","aria-orientation":"vertical","aria-label":t,onPointerDown:e,className:"group bg-[#8882] relative w-px shrink-0 cursor-col-resize",children:(0,m.jsx)("div",{className:"group-hover:bg-primary/40 group-active:bg-primary/60 absolute inset-y-0 -left-1 -right-1 z-10 transition-colors"})})}function mx(){let{rpc:e,status:t}=ni();if("error"===t||"disconnected"===t)return(0,m.jsx)(rw,{variant:"destructive",children:t});if("unauthorized"===t)return(0,m.jsx)(rw,{variant:"warning",children:"unauthorized"});if("connecting"===t||!e)return(0,m.jsx)(rw,{variant:"secondary",children:"connecting…"});let n=e.connectionMeta.backend;return(0,m.jsx)(rw,{variant:"websocket"===n?"success":"secondary",className:"font-mono",children:"websocket"===n?"live":"static"})}function mk(){let{theme:e,toggle:t}=function(){let[e,t]=(0,g.useState)("dark");return(0,g.useEffect)(()=>{t(function(){try{let e=localStorage.getItem(hz);return"light"===e||"dark"===e?e:null}catch{return null}}()??(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"))},[]),(0,g.useEffect)(()=>{document.documentElement.classList.toggle("dark","dark"===e)},[e]),{theme:e,toggle:function(){t(e=>{let t="dark"===e?"light":"dark";try{localStorage.setItem(hz,t)}catch{}return t})}}}();return(0,m.jsx)(rk,{variant:"ghost",size:"sm",onClick:t,"aria-label":"Toggle light/dark theme",children:(0,m.jsx)(rC,{name:"dark"===e?"i-ph-sun-duotone":"i-ph-moon-duotone",className:"size-4"})})}function mS({branches:e,disabled:t,value:n,onSelect:r}){return(0,m.jsxs)("label",{className:"border-base bg-base focus-within:ring-primary-500/40 flex h-7 min-w-0 items-center gap-1.5 rounded-md border pr-1.5 pl-2 focus-within:ring-2",children:[(0,m.jsx)(rC,{name:"i-ph-git-branch-duotone",className:"color-active size-3.5 shrink-0"}),(0,m.jsxs)("select",{"aria-label":"Branch",value:n??"",onChange:e=>r(e.target.value),disabled:t,className:"color-base h-full max-w-44 min-w-0 cursor-pointer appearance-none truncate bg-transparent pr-4 text-sm outline-none disabled:cursor-default",children:[!e?.isRepo&&(0,m.jsx)("option",{value:"",children:"Not a repository"}),e?.isRepo&&0===e.branches.length&&(0,m.jsx)("option",{value:"",children:"No branches"}),e?.isRepo&&e.branches.map(e=>(0,m.jsx)("option",{value:e.name,children:e.name},e.name))]}),(0,m.jsx)(rC,{name:"i-ph-caret-up-down",className:"color-faint pointer-events-none -ml-4 size-3.5 shrink-0"})]})}function mC(){let[e,t]=(0,g.useState)("commits"),[n,r]=(0,g.useState)(null),[i,o]=(0,g.useState)(null),a=function(e){let[t,n]=(0,g.useState)(480),r=(0,g.useRef)(480);return r.current=t,(0,g.useEffect)(()=>{try{let t=Number(localStorage.getItem(e));Number.isFinite(t)&&t>0&&n(my(t,340,760))}catch{}},[e,340,760]),{width:t,onPointerDown:(0,g.useCallback)(t=>{t.preventDefault();let i=t.clientX,o=r.current,a=e=>n(my(o+-1*(e.clientX-i),340,760)),s=()=>{window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",s),document.body.style.cursor="",document.body.style.userSelect="";try{localStorage.setItem(e,String(Math.round(r.current)))}catch{}};window.addEventListener("pointermove",a),window.addEventListener("pointerup",s),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[e,340,760,-1])}}("devframe-git:rail-right"),{data:s,loading:l}=na((0,g.useCallback)(e=>e.call("git:branches"),[]));(0,g.useEffect)(()=>{if(!s?.isRepo)return void r(null);let e=s.branches.map(e=>e.name),t=s.current??s.branches.find(e=>e.current)?.name??null;r(n=>n&&e.includes(n)?n:t??e[0]??null)},[s]);let d="commits"===e&&null!==i;return(0,m.jsxs)("div",{className:"bg-base flex h-svh w-full flex-col overflow-hidden",children:[(0,m.jsxs)("header",{className:b("flex items-center gap-2 shrink-0 h-10 px-3 border-b border-base bg-base z-nav",void 0),children:[(0,m.jsxs)("div",{className:b("flex items-center gap-1.5 shrink-0 font-semibold text-sm select-none",void 0),children:[(0,m.jsx)(rC,{name:"i-ph-git-fork-duotone",className:"text-base color-active"}),(0,m.jsx)("span",{children:"Git"})]}),(0,m.jsx)(mS,{branches:s,disabled:l||!s?.isRepo||0===s.branches.length,value:n,onSelect:e=>{r(e),o(null),t("commits")}}),(0,m.jsx)("nav",{className:b("inline-flex items-center gap-1 p-1 rounded-lg bg-secondary w-max",void 0),role:"tablist","aria-label":"Git views",children:mv.map(({id:n,label:r,icon:i})=>(0,m.jsxs)("button",{type:"button",role:"tab","aria-selected":e===n,"data-state":e===n?"active":"inactive",className:b("px-3 py-1 rounded-md text-sm color-muted inline-flex gap-1.5 items-center whitespace-nowrap select-none cursor-pointer transition outline-none hover:color-base focus-visible:ring-2 focus-visible:ring-primary-500/40 data-[state=active]:bg-base data-[state=active]:color-base data-[state=active]:shadow-sm",void 0),onClick:()=>t(n),children:[(0,m.jsx)(rC,{name:i,className:"size-4"}),r]},n))}),(0,m.jsx)("div",{className:"flex-1"}),(0,m.jsx)(mx,{}),(0,m.jsx)(mk,{})]}),(0,m.jsxs)("div",{className:"flex min-h-0 flex-1",children:[(0,m.jsxs)("section",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:["commits"===e&&(0,m.jsx)("div",{className:"flex min-h-0 flex-1 flex-col px-3 py-2.5",children:(0,m.jsx)(mu,{branch:n,selectedHash:i,onSelectCommit:o})}),"changes"===e&&(0,m.jsx)("div",{className:"flex min-h-0 flex-1 flex-col px-3 py-2.5",children:(0,m.jsx)(mb,{})})]}),d&&i&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(mw,{onPointerDown:a.onPointerDown,label:"Resize commit details"}),(0,m.jsx)("aside",{className:"flex min-h-0 flex-col p-3",style:{width:a.width},children:(0,m.jsx)(hW,{hash:i,onClose:()=>o(null)})})]})]})]})}function mA(){let{status:e,error:t}=ni();return"connected"!==e?(0,m.jsx)(hV,{status:e,error:t}):(0,m.jsx)(mC,{})}e.s(["Dashboard",0,function(){return(0,m.jsx)(no,{children:(0,m.jsx)(mA,{})})}],53567)}]);
201
+ }`}(t,o,l)}),this.appliedThemeCSS=null!=this.themeCSSStyle?{theme:s,themeStyles:t,themeType:o,baseThemeType:r,scrollbarGutter:l}:void 0}hydrateMeasuredScrollbar(){let e=this.fileContainer?.shadowRoot;if(null!=e&&null!=this.themeCSSStyle){var t;let n;this.themeCSSStyle.textContent=(t=this.themeCSSStyle.textContent??"",n=aR(aT(e)),t.replace(aP,n))}}applyHunksToDOM(e,t){let{overflow:n="scroll"}=this.options,r=(this.options.hunkSeparators??"line-info")==="line-info",i="wrap"===n?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let o=!1,a=[],s=this.hunksRenderer.renderCodeAST("unified",t),l=this.hunksRenderer.renderCodeAST("deletions",t),d=this.hunksRenderer.renderCodeAST("additions",t);null!=s?(o=null==this.codeUnified||null!=this.codeAdditions||null!=this.codeDeletions,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=aI({code:this.codeUnified,columnType:"unified",rowSpan:i,containerSize:r}),this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(s),a.push(this.codeUnified)):null!=l||null!=d?(null!=l?(o=null==this.codeDeletions||null!=this.codeUnified,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=aI({code:this.codeDeletions,columnType:"deletions",rowSpan:i,containerSize:r}),this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(l),a.push(this.codeDeletions)):(this.codeDeletions?.remove(),this.codeDeletions=void 0),null!=d?(o=o||null==this.codeAdditions||null!=this.codeUnified,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=aI({code:this.codeAdditions,columnType:"additions",rowSpan:i,containerSize:r}),this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(d),a.push(this.codeAdditions)):(this.codeAdditions?.remove(),this.codeAdditions=void 0)):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0),0===a.length?e.textContent="":o&&e.replaceChildren(...a),this.lastRowCount=t.rowCount}applyPartialRender({previousRenderRange:e,renderRange:t}){let{pre:n,codeUnified:r,codeAdditions:i,codeDeletions:o,options:{diffStyle:a="split"}}=this;if(null==n||null==e||null==t||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||null==this.lastRowCount)return!1;let s=this.getCodeColumns(a,r,o,i);if(null==s)return!1;let l=e.startingLine,d=t.startingLine,u=l+e.totalLines,c=d+t.totalLines,h=Math.max(l,d),f=Math.min(u,c);if(f<=h)return!1;let p=Math.max(0,h-l),m=Math.max(0,u-f),g=this.trimColumns({columns:s,trimStart:p,trimEnd:m,previousStart:l,overlapStart:h,overlapEnd:f,diffStyle:a});if(g<0)throw Error("applyPartialRender: failed to trim to overlap");if(this.lastRowCount<g)throw Error("applyPartialRender: trimmed beyond DOM row count");let b=this.lastRowCount-g,v=(e,t)=>{if(!(t<=0)&&null!=this.fileDiff)return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:e,totalLines:t,bufferBefore:0,bufferAfter:0})},y=v(d,Math.max(h-d,0));if(null==y&&d<h)return!1;let w=v(f,Math.max(c-f,0));if(null==w&&c>f)return!1;let x=(e,t)=>{if(null!=e){if("unified"!==a||Array.isArray(s))if("split"===a&&Array.isArray(s))this.insertPartialHTML(a,s,e,t);else throw Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");else this.insertPartialHTML(a,s,e,t);b+=e.rowCount}};return this.cleanupErrorWrapper(),x(y,"afterbegin"),x(w,"beforeend"),this.lastRowCount!==b&&(this.applyRowSpan(a,s,b),this.lastRowCount=b),!0}insertPartialHTML(e,t,n,r){if("unified"!==e||Array.isArray(t))if("split"===e&&Array.isArray(t)){let e=this.hunksRenderer.renderCodeAST("deletions",n),i=this.hunksRenderer.renderCodeAST("additions",n);this.renderPartialColumn(t[0],e,r),this.renderPartialColumn(t[1],i,r)}else throw Error("FileDiff.insertPartialHTML: Invalid argument composition");else{let e=this.hunksRenderer.renderCodeAST("unified",n);this.renderPartialColumn(t,e,r)}}renderPartialColumn(e,t,n){if(null==e||null==t)return;let r=hy(t[0]),i=hy(t[1]);if(null==r||null==i)throw Error("FileDiff.insertPartialHTML: Unexpected AST structure");let o=i.at(0);"beforeend"===n&&o?.type==="element"&&"number"==typeof o.properties["data-buffer-size"]&&this.mergeBuffersIfNecessary(o.properties["data-buffer-size"],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],r,i,!0);let a=i.at(-1);"afterbegin"===n&&a?.type==="element"&&"number"==typeof a.properties["data-buffer-size"]&&this.mergeBuffersIfNecessary(a.properties["data-buffer-size"],e.content.children[0],e.gutter.children[0],r,i,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i))}mergeBuffersIfNecessary(e,t,n,r,i,o){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;let a=this.getBufferSize(t.dataset);null!=a&&(o?(r.shift(),i.shift()):(r.pop(),i.pop()),this.updateBufferSize(t,a+e),this.updateBufferSize(n,a+e))}applyRowSpan(e,t,n){let r=e=>{null!=e&&(e.gutter.style.setProperty("grid-row",`span ${n}`),e.content.style.setProperty("grid-row",`span ${n}`))};if("unified"!==e||Array.isArray(t))if("split"===e&&Array.isArray(t))r(t[0]),r(t[1]);else throw Error("dun fuuuuked up");else r(t)}trimColumnRows(e,t,n){let r=0,i=0,o=0,a=!1,s=n>=0;if(null==e)return 0;let l=Array.from(e.content.children),d=Array.from(e.gutter.children);if(l.length!==d.length)throw Error("FileDiff.trimColumnRows: columns do not match");for(;o<l.length&&(!(t<=0)||s||a);){let e=d[o],u=l[o];if(o++,!(e instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:e,contentElement:u}),Error("FileDiff.trimColumnRows: invalid row elements");if(a&&(a=!1,"annotation"===e.dataset.gutterBuffer&&"lineAnnotation"in u.dataset||"metadata"===e.dataset.gutterBuffer&&"noNewline"in u.dataset)){e.remove(),u.remove(),i++;continue}if("lineIndex"in e.dataset&&"lineIndex"in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),t>0&&0==--t&&(a=!0),i++),r++;continue}if("separator"in e.dataset&&"separator"in u.dataset||"annotation"===e.dataset.gutterBuffer&&"lineAnnotation"in u.dataset||"metadata"===e.dataset.gutterBuffer&&"noNewline"in u.dataset){(t>0||s&&r>=n)&&(e.remove(),u.remove(),i++);continue}if("buffer"===e.dataset.gutterBuffer&&"contentBuffer"in u.dataset){let o=this.getBufferSize(u.dataset);if(null==o)throw Error("FileDiff.trimColumnRows: invalid element");if(t>0){let n=Math.min(t,o),r=o-n;r>0?(this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=n):(e.remove(),u.remove(),i+=o),0==(t-=n)&&0===r&&(a=!0)}else if(s){let t=r,a=r+o-1;if(n<=t)e.remove(),u.remove(),i+=o;else if(n<=a){let t=a-n+1,r=o-t;this.updateBufferSize(e,r),this.updateBufferSize(u,r),i+=t}}r+=o;continue}throw console.error({gutterElement:e,contentElement:u}),Error("FileDiff.trimColumnRows: unknown row elements")}return i}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:r,previousStart:i,trimEnd:o,trimStart:a}){let s=Math.max(0,r-i),l=n-i;if(l<0)throw Error("FileDiff.trimColumns: overlap ends before previous");let d=a>0,u=o>0;if(!d&&!u)return 0;let c=d?s:0,h=u?l:-1;if("unified"===t&&!Array.isArray(e))return this.trimColumnRows(e,c,h);if("split"===t&&Array.isArray(e)){let t=this.trimColumnRows(e[0],c,h),n=this.trimColumnRows(e[1],c,h);if(null!=e[0]&&null!=e[1]&&t!==n)throw Error("FileDiff.trimColumns: split columns out of sync");return null!=e[0]?t:n}throw console.error({diffStyle:t,columns:e}),Error("FileDiff.trimColumns: Invalid columns for diffType")}getBufferSize(e){let t=Number.parseInt(e?.bufferSize??"",10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty("grid-row",`span ${t}`),e.style.setProperty("min-height",`calc(${t} * 1lh)`)}getCodeColumns(e,t,n,r){function i(e){if(null==e)return;let t=e.children[0],n=e.children[1];if(t instanceof HTMLElement&&n instanceof HTMLElement&&null!=t.dataset.gutter&&null!=n.dataset.content)return{gutter:t,content:n}}if("unified"===e)return i(t);{let e=i(n),t=i(r);return null!=e||null!=t?[e,t]:void 0}}applyBuffers(e,t){if(null==t||this.shouldDisableVirtualizationBuffers()){null!=this.bufferBefore&&(this.bufferBefore.remove(),this.bufferBefore=void 0),null!=this.bufferAfter&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(null==this.bufferBefore&&(this.bufferBefore=document.createElement("div"),this.bufferBefore.dataset.virtualizerBuffer="before",e.before(this.bufferBefore)),this.bufferBefore.style.setProperty("height",`${t.bufferBefore}px`),this.bufferBefore.style.setProperty("contain","strict")):null!=this.bufferBefore&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(null==this.bufferAfter&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",e.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${t.bufferAfter}px`),this.bufferAfter.style.setProperty("contain","strict")):null!=this.bufferAfter&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:n,totalLines:r},i){var o;let{diffIndicators:a="bars",disableBackground:s=!1,disableLineNumbers:l=!1,overflow:d="scroll",diffStyle:u="split"}=this.options,c={type:"diff",diffIndicators:a,disableBackground:s,disableLineNumbers:l,overflow:d,split:"unified"!==u&&null!=t&&null!=n,totalLines:r,customProperties:i};o=this.appliedPreAttributes,(null==c||null==o?c!==o:!function(e=aN,t=aN){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(e[r]!==t[r])return!1;return!0}(c.customProperties,o.customProperties)||c.type!==o.type||c.diffIndicators!==o.diffIndicators||c.disableBackground!==o.disableBackground||c.disableLineNumbers!==o.disableLineNumbers||c.overflow!==o.overflow||c.split!==o.split||c.totalLines!==o.totalLines)&&(!function(e,{type:t,diffIndicators:n,disableBackground:r,disableLineNumbers:i,overflow:o,split:a,totalLines:s,customProperties:l}){if(null!=l)for(let t in l){let n=l[t];null!=n&&e.setAttribute(t,`${n}`)}switch("diff"===t?(e.setAttribute("data-diff",""),e.removeAttribute("data-file")):(e.setAttribute("data-file",""),e.removeAttribute("data-diff")),n){case"bars":case"classic":e.setAttribute("data-indicators",n);break;case"none":e.removeAttribute("data-indicators")}i?e.setAttribute("data-disable-line-numbers",""):e.removeAttribute("data-disable-line-numbers"),r?e.removeAttribute("data-background"):e.setAttribute("data-background",""),"diff"===t?e.setAttribute("data-diff-type",a?"split":"single"):e.removeAttribute("data-diff-type"),e.setAttribute("data-overflow",o),e.style.setProperty("--diffs-min-number-column-width-default",`${`${s}`.length}ch`)}(e,c),this.appliedPreAttributes=c)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;let n=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",n.appendChild(this.errorWrapper);let r=document.createElement("div");r.dataset.errorMessage="",r.innerText=e.message,this.errorWrapper.appendChild(r);let i=document.createElement("pre");i.dataset.errorStack="",i.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(i)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function hy(e){if(null!=e&&"element"===e.type)return e.children??[]}let hw=-1;var hx=class extends hv{__id=`little-virtualized-file-diff:${++hw}`;top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n,r,i=!1){super(e,r,i),this.virtualizer=t,this.metrics=cy(n)}setMetrics(e,t=!1){let n=cy(e);!t&&iZ(this.metrics,n)||(this.metrics=n,this.resetLayoutCache({includeEstimatedHeights:!0}))}setLineAnnotations(e){this.syncLineAnnotations(e)&&this.resetLayoutCache({includeEstimatedHeights:!1})}syncLineAnnotations(e){return null!=e&&e!==this.lineAnnotations&&(0!==e.length||0!==this.lineAnnotations.length)&&(super.setLineAnnotations(e),!0)}setFileAnnotationHeight(e){let t=this.cache.fileAnnotationHeight;return e!==t&&(this.cache.fileAnnotationHeight=e,this.cache.measuredHeightDeltaTotal+=e-t,!0)}hasFileAnnotations(e=this.fileDiff){var t;return null!=e&&(t=this.lineAnnotations,!!t?.some(e=>0===e.lineNumber))&&this.lineAnnotations.some(t=>0===t.lineNumber&&("new"===e.type?"additions"===t.side:"deleted"!==e.type||"deletions"===t.side))}getLineHeight(e,t=!1){return this.getEstimatedLineHeight(t)+(this.cache.heightDeltas.get(e)??0)}getEstimatedLineHeight(e=!1){return this.metrics.lineHeight*(e?2:1)}setOptions(e){var t,n,r,i;if(this.isAdvancedMode())throw Error("VirtualizedFileDiff.setOptions cannot be used inside CodeView. Update CodeView options instead.");if(null==e)return;let{options:o}=this,a=!i1(o,e),s=a&&(t=o,n=e,(t.diffStyle??"split")!==(n.diffStyle??"split")||(t.overflow??"scroll")!==(n.overflow??"scroll")||(t.collapsed??!1)!==(n.collapsed??!1)||(t.disableLineNumbers??!1)!==(n.disableLineNumbers??!1)||(t.disableFileHeader??!1)!==(n.disableFileHeader??!1)||(t.diffIndicators??"bars")!==(n.diffIndicators??"bars")||(t.hunkSeparators??"line-info")!==(n.hunkSeparators??"line-info")||(t.expandUnchanged??!1)!==(n.expandUnchanged??!1)||(t.collapsedContextThreshold??1)!==(n.collapsedContextThreshold??1)||t.unsafeCSS!==n.unsafeCSS);super.setOptions(e),s&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:(r=o,i=e,(r.disableFileHeader??!1)!==(i.disableFileHeader??!1)||(r.hunkSeparators??"line-info")!==(i.hunkSeparators??"line-info")||(r.expandUnchanged??!1)!==(i.expandUnchanged??!1)||(r.collapsedContextThreshold??1)!==(i.collapsedContextThreshold??1))}),a&&(this.forceRenderOverride=!0),a&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,s)}setThemeType(e){if(this.isAdvancedMode())throw Error("VirtualizedFileDiff.setThemeType cannot be used inside CodeView. Update CodeView options instead.");super.setThemeType(e)}resetLayoutCache({forceSimpleRecompute:e=!1,includeEstimatedHeights:t=!1}={}){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.size>0&&this.cache.heightDeltas.clear(),0!==this.cache.measuredHeightDeltaTotal&&(this.cache.measuredHeightDeltaTotal=0),this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),0!==this.cache.totalLines&&(this.cache.totalLines=0),t&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),null!=this.renderRange&&(this.renderRange=void 0),e&&this.isSimpleMode()&&this.computeApproximateSize()}reconcileHeights(){let e=!1,{overflow:t="scroll"}=this.options;if(null==this.fileContainer||null==this.fileDiff)return 0!==this.height&&(e=!0),this.height=0,e;if(this.top=this.getVirtualizedTop(),"scroll"===t&&0===this.lineAnnotations.length&&!this.isResizeDebuggingEnabled())return e;let n=this.getDiffStyle(),r="split"===n?[this.codeDeletions,this.codeAdditions]:[this.codeUnified],i=this.hasFileAnnotations(this.fileDiff);if(null!=this.renderRange&&i&&aK(this.renderRange)){let t=function(e){let t;for(let n of e){if(null==n)continue;let e=n.children[1];if(e instanceof HTMLElement)for(let n of e.children)n instanceof HTMLElement&&"-1,-1"===n.dataset.lineAnnotation&&(t=Math.max(t??0,n.getBoundingClientRect().height))}return t}(r)??0;this.setFileAnnotationHeight(t)&&(e=!0)}else!i&&this.setFileAnnotationHeight(0)&&(e=!0);for(let t of r){if(null==t)continue;let r=t.children[1];if(r instanceof HTMLElement)for(let t of r.children){if(!(t instanceof HTMLElement))continue;let r=t.dataset.lineIndex;if(null==r)continue;let i=function(e,t){let[n,r]=e.split(",").map(Number);return"split"===t?r:n}(r,n),o=t.getBoundingClientRect().height,a=!1;t.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in t.nextElementSibling.dataset||"noNewline"in t.nextElementSibling.dataset)&&("noNewline"in t.nextElementSibling.dataset&&(a=!0),o+=t.nextElementSibling.getBoundingClientRect().height);let s=this.getEstimatedLineHeight(a),l=this.cache.heightDeltas.get(i)??0,d=o-s;d!==l&&(e=!0,this.cache.measuredHeightDeltaTotal+=d-l,0===d?this.cache.heightDeltas.delete(i):this.cache.heightDeltas.set(i,d))}}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>null!=this.fileContainer&&(e&&(this.top=this.getVirtualizedTop()),this.render());prepareCodeViewItem(e,t,n,r){let i=!cv(this.fileDiff,e),o=this.syncLineAnnotations(r),a=n?.resetDiffLayoutCache===!0||i||o,s=i||n?.resetDiffLayoutCache===!0&&n.includeEstimatedDiffHeights;n?.metrics!=null&&(this.metrics=cy(n.metrics),a=!0,s=!0);let{collapsed:l=!1}=this.options;return this.currentCollapsed!==l&&(this.currentCollapsed=l,a=!0),a&&this.resetLayoutCache({includeEstimatedHeights:s}),this.fileDiff=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e,t="additions"){let n;if(null==this.fileDiff||e<1)return;let r=this.getLineIndex(e,t);if(null==r)return;let{disableFileHeader:i=!1,expandUnchanged:o=!1,collapsed:a=!1,collapsedContextThreshold:s=1}=this.options,l=this.getDiffStyle(),d=this.getHunkSeparatorType(),u="split"===l?r[1]:r[0];this.approximateLayoutCheckpoints();let c=cw(this.metrics,i),h=this.getLayoutCheckpointBeforeLineIndex(u),f=h?.top??c+this.cache.fileAnnotationHeight;return a?{top:c,height:0}:(cN({diff:this.fileDiff,diffStyle:l,startingLine:h?.renderedLineIndex??0,expandedHunks:!!o||this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s,callback:({hunkIndex:e,hunk:t,collapsedBefore:r,collapsedAfter:i,deletionLine:o,additionLine:a})=>{let s="split"===l?a?.splitLineIndex??o?.splitLineIndex:a?.unifiedLineIndex??o?.unifiedLineIndex;if(null==s)throw Error("VirtualizedFileDiff.getLinePosition: missing line index data");if(r>0){let i=cL({type:d,metrics:this.metrics,hunkIndex:e,hunkSpecs:t?.hunkSpecs});if(null!=i){if(f+=i.gapBefore,u>=s-r&&u<s)return n={top:f,height:i.height},!0;f+=i.height+i.gapAfter}}let c=this.getLineHeight(s,(a?.noEOFCR??!1)||(o?.noEOFCR??!1));if(s===u)return n={top:f,height:c},!0;if(f+=c,i>0){let e=c_({type:d,metrics:this.metrics});if(null!=e){if(u>s&&u<=s+i)return n={top:f+e.gapBefore,height:e.height},!0;f+=e.totalHeight}}return!1}}),n)}getNumericScrollAnchor(e){let t;if(null==this.fileDiff)return;let{disableFileHeader:n=!1,expandUnchanged:r=!1,collapsed:i=!1,collapsedContextThreshold:o=1}=this.options;if(i)return;let a=this.getDiffStyle(),s=this.getHunkSeparatorType();this.approximateLayoutCheckpoints();let l=this.getLayoutCheckpointBeforeTop(e),d=l?.top??cw(this.metrics,n)+this.cache.fileAnnotationHeight;return cN({diff:this.fileDiff,diffStyle:a,startingLine:l?.renderedLineIndex??0,expandedHunks:!!r||this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:n,hunk:r,collapsedBefore:i,collapsedAfter:o,deletionLine:l,additionLine:u})=>{let c="split"===a?u?.splitLineIndex??l?.splitLineIndex:u?.unifiedLineIndex??l?.unifiedLineIndex;if(null==c)throw Error("VirtualizedFileDiff.getNumericScrollAnchor: missing line index data");if(i>0){let e=cL({type:s,metrics:this.metrics,hunkIndex:n,hunkSpecs:r?.hunkSpecs});null!=e&&(d+=e.totalHeight)}if(d>=e&&(null!=l?t={lineNumber:l.lineNumber,side:"deletions",top:d}:null!=u&&(t={lineNumber:u.lineNumber,side:"additions",top:d}),null!=t))return!0;let h=this.getLineHeight(c,(u?.noEOFCR??!1)||(l?.noEOFCR??!1));if(d+=h,o>0){let e=c_({type:s,metrics:this.metrics});null!=e&&(d+=e.totalHeight)}return!1}}),t}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){if(null==this.top||null==this.fileDiff)return;if(!0===this.options.collapsed)return{topOffset:this.top,height:this.height};let t=null!=e?this.computeRenderRangeFromWindow(this.fileDiff,this.top,e):this.renderRange;if(null==t)return;let{bufferBefore:n,bufferAfter:r,totalLines:i}=t,o=0;if(0===i){let t=e??this.virtualizer.getWindowSpecs();this.top<t.top&&(o=r)}return{topOffset:this.top+n+o,height:this.height-(n+r)}}cleanUp(e=!1){null!=this.fileContainer&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||this.resetLayoutCache({includeEstimatedHeights:!0}),this.isSetup=!1,super.cleanUp(e)}expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.forceRenderOverride=!0,this.resetLayoutCache({includeEstimatedHeights:!0}),this.isSimpleMode()&&this.computeApproximateSize(),this.virtualizer.instanceChanged(this,!0)};setVisibility(e){this.isAdvancedMode()||null==this.fileContainer||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){this.enabled&&(null!=this.fileDiff||null!=this.additionFile||null!=this.deletionFile)&&(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}computeApproximateSize(e=!1){let t=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!t)return;let n=0===this.height;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,null==this.fileDiff){this.layoutDirty=!1;return}let{disableFileHeader:r=!1,collapsed:i=!1}=this.options,o=cw(this.metrics,r);if(this.height+=o,i){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight()+this.cache.measuredHeightDeltaTotal,t&&!n&&this.validateComputedHeight(),this.layoutDirty=!1}getActiveEstimatedHeight(){this.ensureEstimatedDiffHeights();let e="split"===this.getDiffStyle()?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(null==e)throw Error("VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height");return e}ensureEstimatedDiffHeights(){if(null==this.fileDiff){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(null!=this.cache.estimatedSplitHeight&&null!=this.cache.estimatedUnifiedHeight)return;let{disableFileHeader:e=!1,expandUnchanged:t=!1,collapsedContextThreshold:n=1}=this.options,{splitHeight:r,unifiedHeight:i}=function({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:r,expandUnchanged:i,expandedHunks:o,collapsedContextThreshold:a}){let s=cw(t,n),l=s,d=!!i||o,u=e.hunks.length-1;for(let n=0;n<e.hunks.length;n++){let i=e.hunks[n];if(null==i)throw Error("computeEstimatedDiffHeights: invalid hunk index");let o=ck({isPartial:e.isPartial,rangeSize:i.collapsedBefore,expandedHunks:d,hunkIndex:n,collapsedContextThreshold:a}),c=(o.fromStart+o.fromEnd)*t.lineHeight;if(s+=c,l+=c,o.collapsedLines>0){let e=cL({type:r,metrics:t,hunkIndex:n,hunkSpecs:i.hunkSpecs})?.totalHeight??0;s+=e,l+=e}s+=i.splitLineCount*t.lineHeight,l+=i.unifiedLineCount*t.lineHeight;let h=function(e){if(!e.noEOFCRAdditions&&!e.noEOFCRDeletions)return{split:0,unified:0};let t=e.hunkContent.at(-1);if(null==t)return{split:0,unified:0};if("context"===t.type){let e=+(t.lines>0);return{split:e,unified:e}}return function(e,t){let n=(t.deletions>0&&e.noEOFCRDeletions?1:0)+(t.additions>0&&e.noEOFCRAdditions?1:0),r=t.deletions>0&&e.noEOFCRDeletions,i=t.additions>0&&e.noEOFCRAdditions;return{split:r||i?1:0,unified:n}}(e,t)}(i);s+=h.split*t.lineHeight,l+=h.unified*t.lineHeight;let f=n===u?cC({fileDiff:e,hunkIndex:n,expandedHunks:d,collapsedContextThreshold:a,errorPrefix:"computeEstimatedDiffHeights"}):void 0;if(null!=f){let e=(f.fromStart+f.fromEnd)*t.lineHeight;if(s+=e,l+=e,f.collapsedLines>0){let e=c_({type:r,metrics:t})?.totalHeight??0;s+=e,l+=e}}}if(e.hunks.length>0){let e=cx(t);s+=e,l+=e}return{splitHeight:s,unifiedHeight:l}}({fileDiff:this.fileDiff,metrics:this.metrics,disableFileHeader:e,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:t,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:n});this.cache.estimatedSplitHeight=r,this.cache.estimatedUnifiedHeight=i}validateComputedHeight(){if(null==this.fileContainer||null==this.fileDiff)return;let e=this.fileContainer.getBoundingClientRect();e.height!==this.height?console.log("VirtualizedFileDiff.computeApproximateSize: computed height doesnt match",{name:this.fileDiff.name,elementHeight:e.height,computedHeight:this.height}):console.log("VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT")}render({fileContainer:e,oldFile:t,newFile:n,fileDiff:r,forceRender:i=!1,lineAnnotations:o,...a}={}){let{forceRenderOverride:s,isSetup:l}=this;this.forceRenderOverride=void 0;let d=this.syncLineAnnotations(o);if(d&&this.resetLayoutCache({includeEstimatedHeights:!1}),this.fileDiff??=r??(null!=t&&null!=n?aU(t,n,this.options.parseDiffOptions):void 0),e=this.getOrCreateFileContainer(e),null==this.fileDiff)return console.error("VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data"),!1;if(l)this.top??=this.getVirtualizedTop();else{this.computeApproximateSize();let t=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(null==t)throw Error("VirtualizedFileDiff.render: simple virtualizer is not available");t.connect(e,this),this.isVisible=t.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode())return this.renderPlaceholder(this.height);let u=this.virtualizer.getWindowSpecs(),c=this.top??0,h=this.computeRenderRangeFromWindow(this.fileDiff,c,u);return super.render({fileDiff:this.fileDiff,fileContainer:e,renderRange:h,oldFile:t,newFile:n,lineAnnotations:o,forceRender:(s??i)||d,...a})}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}isSimpleMode(){return"simple"===this.virtualizer.type}isAdvancedMode(){return"advanced"===this.virtualizer.type}getVirtualizedTop(){return"advanced"===this.virtualizer.type?this.virtualizer.getLocalTopForInstance(this):null!=this.fileContainer?this.virtualizer.getOffsetInScrollContainer(this.fileContainer):0}getSimpleVirtualizer(){return"simple"===this.virtualizer.type?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??"split"}getHunkSeparatorType(){var e;return"function"==typeof(e=this.options.hunkSeparators)?"custom":e??"line-info"}approximateLayoutCheckpoints(){if(this.cache.checkpoints.length>0||null==this.fileDiff||0===this.fileDiff.hunks.length||!0===this.options.collapsed)return;let{disableFileHeader:e=!1,expandUnchanged:t=!1,collapsedContextThreshold:n=1}=this.options,r=this.fileDiff.hunks.length-1,i=this.getDiffStyle(),o=this.getHunkSeparatorType(),a=!!t||this.hunksRenderer.getExpandedHunksMap(),s=function(e){let t=Array.from(e).sort((e,t)=>e[0]-t[0]),n=[],r=[0],i=0;for(let[e,o]of t)n.push(e),i+=o,r.push(i);return{lineIndexes:n,prefixTotals:r}}(this.cache.heightDeltas),l=cw(this.metrics,e)+this.cache.fileAnnotationHeight,d=0,u=({rowCount:e,startLineIndex:t,preSeparatorHeight:n=0,postSeparatorHeight:r=0,metadataOffsets:i=[]})=>{if(e<=0)return;let o=d,a=d+e,u=5e3*Math.ceil(o/5e3);for(;u<a;){let e=u-o,r=l+(e>0?n:0)+e*this.metrics.lineHeight+function(e,t){let n=0;for(let r of e)r<t&&n++;return n}(i,e)*this.metrics.lineHeight+hk(s,t,t+e);this.cache.checkpoints.push({renderedLineIndex:u,lineIndex:t+e,top:r}),u+=5e3}l+=n+e*this.metrics.lineHeight+i.length*this.metrics.lineHeight+hk(s,t,t+e)+r,d=a};for(let e=0;e<this.fileDiff.hunks.length;e++){let t=this.fileDiff.hunks[e];if(null==t)throw Error("VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index");let s=ck({isPartial:this.fileDiff.isPartial,rangeSize:t.collapsedBefore,expandedHunks:a,hunkIndex:e,collapsedContextThreshold:n}),l=s.collapsedLines>0?cL({type:o,metrics:this.metrics,hunkIndex:e,hunkSpecs:t.hunkSpecs})?.totalHeight??0:0;u({rowCount:s.fromStart,startLineIndex:("split"===i?t.splitLineStart:t.unifiedLineStart)-s.rangeSize});let d=l;u({rowCount:s.fromEnd,startLineIndex:("split"===i?t.splitLineStart:t.unifiedLineStart)-s.fromEnd,preSeparatorHeight:d}),s.fromEnd>0&&(d=0);let c=e===r?cC({fileDiff:this.fileDiff,hunkIndex:e,expandedHunks:a,collapsedContextThreshold:n,errorPrefix:"VirtualizedFileDiff"}):void 0,h=null!=c&&c.collapsedLines>0?c_({type:o,metrics:this.metrics})?.totalHeight??0:0,f=null!=c?c.fromStart+c.fromEnd:0,p="split"===i?t.splitLineCount:t.unifiedLineCount,m="split"===i?t.splitLineStart:t.unifiedLineStart;u({rowCount:p,startLineIndex:m,preSeparatorHeight:d,postSeparatorHeight:0===f?h:0,metadataOffsets:function({diffStyle:e,hunk:t,rowCount:n}){if(n<=0||!t.noEOFCRAdditions&&!t.noEOFCRDeletions)return[];let r=t.hunkContent.at(-1);if(null==r)return[];if("context"===r.type)return[n-1];let i=Math.max(r.deletions,r.additions),o=r.deletions+r.additions;if("split"===e)return i>0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];let a=[];return r.deletions>0&&t.noEOFCRDeletions&&a.push(n-o+r.deletions-1),r.additions>0&&t.noEOFCRAdditions&&a.push(n-1),a}({diffStyle:i,hunk:t,rowCount:p})}),null!=c&&f>0&&u({rowCount:f,startLineIndex:m+p,postSeparatorHeight:h})}this.cache.totalLines=d}getLayoutCheckpointBeforeLineIndex(e){let t;if(e<=0||0===this.cache.checkpoints.length)return;let n=0,r=this.cache.checkpoints.length-1;for(;n<=r;){let i=n+r>>1,o=this.cache.checkpoints[i];if(null==o)throw Error("VirtualizedFileDiff: invalid checkpoint index");o.lineIndex<=e?(t=o,n=i+1):r=i-1}return t}getLayoutCheckpointBeforeTop(e,t){let n=0,r=this.cache.checkpoints.length-1,i=-1;for(;n<=r;){let t=n+r>>1,o=this.cache.checkpoints[t];if(null==o)throw Error("VirtualizedFileDiff: invalid checkpoint index");o.top<=e?(i=t,n=t+1):r=t-1}if(null==t)return i>=0?this.cache.checkpoints[i]:void 0;for(let e=i;e>=0;e--){let n=this.cache.checkpoints[e];if(null==n)throw Error("VirtualizedFileDiff: invalid checkpoint index");if(n.renderedLineIndex%t==0)return n}}getExpandedLineCount(e,t){let n=0;if(e.isPartial){for(let r of e.hunks)n+="split"===t?r.splitLineCount:r.unifiedLineCount;return n}let{expandUnchanged:r=!1,collapsedContextThreshold:i=1}=this.options,o=!!r||this.hunksRenderer.getExpandedHunksMap();for(let[r,a]of e.hunks.entries()){n+="split"===t?a.splitLineCount:a.unifiedLineCount;let s=Math.max(a.collapsedBefore,0),{fromStart:l,fromEnd:d,renderAll:u}=ck({isPartial:e.isPartial,rangeSize:s,expandedHunks:o,hunkIndex:r,collapsedContextThreshold:i});s>0&&(n+=u?s:l+d)}let a=cC({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:o,collapsedContextThreshold:i,errorPrefix:"VirtualizedFileDiff"});return null!=a&&(n+=a.fromStart+a.fromEnd),n}computeRenderRangeFromWindow(e,t,{top:n,bottom:r}){let i,o,a,{disableFileHeader:s=!1,expandUnchanged:l=!1,collapsedContextThreshold:d=1}=this.options,{hunkLineCount:u,lineHeight:c}=this.metrics,h=this.getDiffStyle(),f=this.getHunkSeparatorType(),p=this.height,m=this.cache.totalLines>0?this.cache.totalLines:this.getExpandedLineCount(e,h),g=cw(this.metrics,s),b=e.hunks.length>0?cx(this.metrics):0,{fileAnnotationHeight:v}=this.cache,y=g+v,w=Math.max(0,p-g-v-b),x=this.hasFileAnnotations(e),k=t+g;if(t<n-p||t>r)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:p-g-b};if(m<=u||0===e.hunks.length)return{startingLine:0,totalLines:u,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(),m=this.cache.totalLines>0?this.cache.totalLines:m;let S=Math.ceil(Math.ceil(Math.max(r-n,0)/c)/u)*u+u,C=S/u,A=[],E=(n+r)/2,L=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-S*c*2),u),_=t+(L?.top??y),N=L?.renderedLineIndex??0;if(cN({diff:e,diffStyle:h,startingLine:L?.renderedLineIndex??0,expandedHunks:!!l||this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:d,callback:({hunkIndex:e,hunk:s,collapsedBefore:l,collapsedAfter:d,deletionLine:c,additionLine:p})=>{let m=null!=p?p.splitLineIndex:c.splitLineIndex,g=null!=p?p.unifiedLineIndex:c.unifiedLineIndex,b=(p?.noEOFCR??!1)||(c?.noEOFCR??!1),v=(l>0?cL({type:f,metrics:this.metrics,hunkIndex:e,hunkSpecs:s?.hunkSpecs}):void 0)?.totalHeight??0;_+=v;let w=N%u==0,x=Math.floor(N/u);if(w&&(A[x]=_-(t+y+v),null!=a)){if(a<=0)return!0;a--}let k=this.getLineHeight("split"===h?m:g,b);return _>n-k&&_<r&&(i??=x),null==o&&_+k>E&&(o=x),null==a&&_>=r&&w&&(a=C),N++,_+=k,d>0&&(_+=c_({type:f,metrics:this.metrics})?.totalHeight??0),!1}}),null==i)if(!(v>0)||!x||!(k<r)||!(k+v>n))return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:p-g-b};else i=0,o=0;let T=Math.round((o??=i)-C/2),R=Math.max(0,Math.min(T,Math.max(0,Math.ceil(m/u)-C))),M=R*u,P=T<0?S+T*u:S,I=A[R]??0,D=R+P/u;return{startingLine:M,totalLines:P,bufferBefore:0===M?0:v+I,bufferAfter:Math.max(0,D<A.length?w-A[D]:w-(_-t-y))}}};function hk({lineIndexes:e,prefixTotals:t},n,r){if(n>=r||0===e.length)return 0;let i=hS(e,n);return(t[hS(e,r)]??0)-(t[i]??0)}function hS(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>1,o=e[i];if(null==o)throw Error("VirtualizedFileDiff: invalid prefix index");o<t?n=i+1:r=i}return n}e.i(4135),Symbol("IGNORE_RESPONSE");let hC=(0,g.createContext)(void 0),hA=new Set,hE=null;function hL(e){hA.add(e),hE??=requestAnimationFrame(h_)}function h_(e){let t=new Set(hA);for(let n of(hA.clear(),t))try{n(e)}catch(e){console.error(e)}hE=hA.size>0?requestAnimationFrame(h_):null}function hN({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:r=!1,fitPerfectlyOverscroll:i=0,overscrollSize:o}){let a=n+2*o,s=r?n+2*i:a;if(a>=(t=Math.max(t,s))||r){let n=Math.max(e-i,0);return{top:n,bottom:Math.max(Math.min(e+s,t),n)}}let l=e+n/2-a/2,d=l+a;return l<0&&(l=0),d>t&&(d=t),{top:l=Math.floor(Math.max(l,0)),bottom:Math.ceil(Math.max(Math.min(d,t),l))}}let hT=[0,1e-6,.99999,1],hR={overscrollSize:1e3,intersectionObserverMargin:4e3,resizeDebugging:!1},hM=0,hP=-1;function hI(e,t){let n=e.getBoundingClientRect(),r=t?.getBoundingClientRect().top??0;return n.top-r}(class e{static __STOP=!1;static __lastScrollPosition=0;__id=`virtualizer-${++hP}`;config;type="simple";intersectionObserver;scrollTop=0;height=0;scrollHeight=0;windowSpecs={top:0,bottom:0};root;contentContainer;resizeObserver;observers=new Map;visibleInstances=new Map;visibleInstancesDirty=!1;instancesChanged=new Set;scrollDirty=!0;heightDirty=!0;scrollHeightDirty=!0;renderedObservers=0;connectQueue=new Map;constructor(e){this.config={...hR,...e}}setup(t,n){if(null==this.root){for(let[r,i]of(this.root=t,this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.intersectionObserver=new IntersectionObserver(this.handleIntersectionChange,{root:this.root,threshold:hT,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),t instanceof Document?this.setupWindow():this.setupElement(n),window.__INSTANCE=this,window.__TOGGLE=()=>{e.__STOP?(e.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:e.__lastScrollPosition}),hL(this.computeRenderRangeAndEmit)):(e.__lastScrollPosition=this.getScrollTop(),e.__STOP=!0)},this.connectQueue.entries()))this.connect(r,i);this.connectQueue.clear(),this.markDOMDirty(),hL(this.computeRenderRangeAndEmit)}}instanceChanged(e,t){this.instancesChanged.add(e),t&&this.markDOMDirty(),hL(this.computeRenderRangeAndEmit)}getWindowSpecs(){return 0===this.windowSpecs.top&&0===this.windowSpecs.bottom&&(this.windowSpecs=hN({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize})),this.windowSpecs}isInstanceVisible(e,t){let n=this.getScrollTop(),r=this.getHeight(),i=this.config.intersectionObserverMargin;return!(e<n-i-t||e>n+r+i)}handleContainerResize=e=>{if(null==this.root)return;let t=!1;for(let n of e){let e=n.borderBoxSize[0].blockSize;this.root instanceof Document?e!==this.scrollHeight&&(this.scrollHeightDirty=!0,t=!0,this.config.resizeDebugging&&(console.log("Virtualizer: content size change",this.__id,{sizeChange:e-hM,newSize:e}),hM=e)):n.target===this.root?e!==this.height&&(this.heightDirty=!0,t=!0):n.target===this.contentContainer&&(this.scrollHeightDirty=!0,t=!0,this.config.resizeDebugging&&(console.log("Virtualizer: scroller size change",this.__id,{sizeChange:e-hM,newSize:e}),hM=e))}t&&hL(this.computeRenderRangeAndEmit)};setupWindow(){if(null==this.root||!(this.root instanceof Document))throw Error("Virtualizer.setupWindow: Invalid setup method");window.addEventListener("scroll",this.handleWindowScroll,{passive:!0}),window.addEventListener("resize",this.handleWindowResize,{passive:!0}),this.resizeObserver?.observe(this.root.documentElement)}setupElement(e){if(null==this.root||this.root instanceof Document)throw Error("Virtualizer.setupElement: Invalid setup method");this.root.addEventListener("scroll",this.handleElementScroll,{passive:!0}),this.resizeObserver?.observe(this.root),(e??=this.root.firstElementChild??void 0)instanceof HTMLElement&&(this.contentContainer=e,this.resizeObserver?.observe(e))}cleanUp(){this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.intersectionObserver?.disconnect(),this.intersectionObserver=void 0,this.root?.removeEventListener("scroll",this.handleElementScroll),window.removeEventListener("scroll",this.handleWindowScroll),window.removeEventListener("resize",this.handleWindowResize),this.root=void 0,this.contentContainer=void 0,this.observers.clear(),this.visibleInstances.clear(),this.instancesChanged.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0}getOffsetInScrollContainer(e){return this.getScrollTop()+hI(e,this.getScrollContainerElement())}connect(e,t){if(this.observers.has(e))throw Error("Virtualizer.connect: instance is already connected...");return null==this.intersectionObserver?this.connectQueue.set(e,t):(this.intersectionObserver.observe(e),this.observers.set(e,t),this.instancesChanged.add(t),this.markDOMDirty(),hL(this.computeRenderRangeAndEmit)),()=>this.disconnect(e)}disconnect(e){let t=this.observers.get(e);this.connectQueue.delete(e),null!=t&&(this.intersectionObserver?.unobserve(e),this.observers.delete(e),this.visibleInstances.delete(e)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),hL(this.computeRenderRangeAndEmit))}handleWindowResize=()=>{e.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,hL(this.computeRenderRangeAndEmit))};handleWindowScroll=()=>{!e.__STOP&&null!=this.root&&this.root instanceof Document&&(this.scrollDirty=!0,hL(this.computeRenderRangeAndEmit))};handleElementScroll=()=>{e.__STOP||null==this.root||this.root instanceof Document||(this.scrollDirty=!0,hL(this.computeRenderRangeAndEmit))};computeRenderRangeAndEmit=()=>{if(e.__STOP)return;let t=this.heightDirty||this.scrollHeightDirty;if(!this.scrollDirty&&!this.scrollHeightDirty&&!this.heightDirty&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&0===this.instancesChanged.size)return;let n=this.instancesChanged.size>0;if(0===this.instancesChanged.size){var r;let e=hN({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize});if(!t&&(r=this.windowSpecs,null==r||null==e?r===e:r.top===e.top&&r.bottom===e.bottom)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty)return;this.windowSpecs=e}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;let i=this.getScrollAnchor(this.height),o=new Set;for(let e of t?this.observers.values():this.visibleInstances.values())e.onRender(t)&&o.add(e);for(let e of this.instancesChanged)!o.has(e)&&e.onRender(t)&&o.add(e);for(let e of(this.scrollFix(i),o))e.reconcileHeights();(n||=this.instancesChanged.size>0)&&this.markDOMDirty(),(n||t)&&hL(this.computeRenderRangeAndEmit),o.clear(),this.instancesChanged.clear()};scrollFix(e){if(null==e)return;let t=this.getScrollContainerElement(),{lineIndex:n,lineOffset:r,fileElement:i,fileOffset:o,fileTypeOffset:a}=e;if(null!=n&&null!=r){let e=i.shadowRoot?.querySelector(`[data-line][data-line-index="${n}"]`);if(e instanceof HTMLElement){let n=hI(e,t);n!==r&&this.applyScrollFix(n-r);return}}let s=hI(i,t);if("top"===a)s!==o&&this.applyScrollFix(s-o);else{let e=s+i.getBoundingClientRect().height;e!==o&&this.applyScrollFix(e-o)}}applyScrollFix(e){null==this.root||this.root instanceof Document?window.scrollTo({top:window.scrollY+e,behavior:"instant"}):this.root.scrollTo({top:this.root.scrollTop+e,behavior:"instant"}),this.markDOMDirty()}getScrollAnchor(e){let t,n=this.getScrollContainerElement();for(let[r]of this.visibleInstances.entries()){let i,o,a,s,l=hI(r,n),d=l+r.offsetHeight;if(d<=0?(i=d,o="bottom"):(i=l,o="top"),d>0&&l<e)for(let e of r.shadowRoot?.querySelectorAll("[data-line][data-line-index]")??[]){if(!(e instanceof HTMLElement))continue;let t=e.dataset.lineIndex;if(null==t)continue;let r=hI(e,n);if(!(r<0)){a=t,s=r;break}}if(t?.lineOffset!=null&&null==s)continue;let u=!1;null==t||null!=s&&(null==t.lineOffset||s<t.lineOffset)?u=!0:null==s&&null==t.lineOffset&&(i>=0&&(t.fileOffset<0||i<t.fileOffset)?u=!0:i<0&&t.fileOffset<0&&i>t.fileOffset&&(u=!0)),u&&(t={fileElement:r,fileTypeOffset:o,fileOffset:i,lineIndex:a,lineOffset:s})}return t}handleIntersectionChange=e=>{for(let{target:t,isIntersecting:n}of(this.scrollDirty=!0,e)){if(!(t instanceof HTMLElement))throw Error("Virtualizer.handleIntersectionChange: target not an HTMLElement");let e=this.observers.get(t);null!=e&&(n&&!this.visibleInstances.has(t)?(e.setVisibility(!0),this.visibleInstances.set(t,e),this.visibleInstancesDirty=!0):!n&&this.visibleInstances.has(t)&&(e.setVisibility(!1),this.visibleInstances.delete(t),this.visibleInstancesDirty=!0))}this.visibleInstancesDirty&&hL(this.computeRenderRangeAndEmit)};getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let e=null==this.root?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return e=Math.max(0,Math.min(e,this.getScrollHeight()-this.getHeight())),this.scrollTop=e,e}getScrollHeight(){return this.scrollHeightDirty&&(this.scrollHeightDirty=!1,this.scrollHeight=null==this.root?0:this.root instanceof Document?this.root.documentElement.scrollHeight:this.root.scrollHeight),this.scrollHeight}getHeight(){return this.heightDirty&&(this.heightDirty=!1,this.height=null==this.root?0:this.root instanceof Document?globalThis.innerHeight:this.root.getBoundingClientRect().height),this.height}markDOMDirty(){this.scrollDirty=!0,this.scrollHeightDirty=!0,this.heightDirty=!0}getScrollContainerElement(){return null==this.root||this.root instanceof Document?void 0:this.root}});let hD=(0,g.createContext)(void 0),hj="u"<typeof window?g.useEffect:g.useLayoutEffect;function h$({options:e,controlledSelection:t,hasCustomHeader:n,hasGutterRenderUtility:r}){return t||r||n?{...e,controlledSelection:t,renderCustomHeader:n?iQ:e?.renderCustomHeader,renderGutterUtility:r?iQ:e?.renderGutterUtility}:e}function hO({fileDiff:e,options:t,metrics:n,lineAnnotations:r,selectedLines:i,className:o,style:a,prerenderedHTML:s,renderAnnotation:l,renderCustomHeader:d,renderHeaderPrefix:u,renderHeaderMetadata:c,renderGutterUtility:h,disableWorkerPool:f=!1}){var p;let{ref:b,getHoveredLine:v}=function({fileDiff:e,options:t,lineAnnotations:n,selectedLines:r,prerenderedHTML:i,metrics:o,hasGutterRenderUtility:a,hasCustomHeader:s,disableWorkerPool:l}){var d;let u,c=(0,g.useContext)(hD),h=void 0!==r,f=(0,g.useContext)(hC),p=(0,g.useRef)(null),m=(d=r=>{if(null!=r){if(null!=p.current)throw Error("useFileDiffInstance: An instance should not already exist when a node is created");null!=c?p.current=new hx(h$({controlledSelection:h,hasCustomHeader:s,hasGutterRenderUtility:a,options:t}),c,o,!l?f:void 0,!0):p.current=new hv(h$({controlledSelection:h,hasCustomHeader:s,hasGutterRenderUtility:a,options:t}),!l?f:void 0,!0),p.current.hydrate({fileDiff:e,fileContainer:r,lineAnnotations:n,prerenderedHTML:i})}else{if(null==p.current)throw Error("useFileDiffInstance: A FileDiff instance should exist when unmounting");p.current.cleanUp(),p.current=null}},u=(0,g.useRef)(d),(0,g.useInsertionEffect)(()=>void(u.current=d)),(0,g.useCallback)((...e)=>u.current(...e),[]));return hj(()=>{let{current:i}=p;if(null==i)return;let o=h$({controlledSelection:h,hasCustomHeader:s,hasGutterRenderUtility:a,options:t}),l=!i1(i.options,o);i.setOptions(o),i.render({forceRender:l,fileDiff:e,lineAnnotations:n}),void 0!==r&&i.setSelectedLines(r)}),{ref:m,getHoveredLine:(0,g.useCallback)(()=>p.current?.getHoveredLine(),[])}}({fileDiff:e,options:t,metrics:n,lineAnnotations:r,selectedLines:i,prerenderedHTML:s,hasGutterRenderUtility:null!=h,hasCustomHeader:null!=d,disableWorkerPool:f});return(0,m.jsx)(ih,{ref:b,className:o,style:a,children:(p=function({fileDiff:e,actions:t,renderCustomHeader:n,renderHeaderPrefix:r,renderHeaderMetadata:i,renderAnnotation:o,renderGutterUtility:a,renderMergeConflictUtility:s,lineAnnotations:l,getHoveredLine:d,getInstance:u}){let c=n?.(e),h=r?.(e),f=i?.(e);return(0,m.jsxs)(m.Fragment,{children:[null!=c?(0,m.jsx)("div",{slot:ik,children:c}):(0,m.jsxs)(m.Fragment,{children:[null!=h&&(0,m.jsx)("div",{slot:"header-prefix",children:h}),null!=f&&(0,m.jsx)("div",{slot:"header-metadata",children:f})]}),null!=o&&l?.map((e,t)=>(0,m.jsx)("div",{slot:iK(e),children:o(e)},t)),null!=t&&null!=s&&null!=u&&t.map(t=>{var n;let r;if(null==t)return;let i=null!=(r=function(e,t){let n=t.hunks[e.hunkIndex];if(null!=n)return{hunkIndex:e.hunkIndex,lineIndex:function(e,t){let n=e.unifiedLineStart;for(let r=0;r<t;r++){let t=e.hunkContent[r];n+="context"===t.type?t.lines:t.deletions+t.additions}return n}(n,e.startContentIndex)}}(n=t,e))?function({hunkIndex:e,lineIndex:t,conflictIndex:n}){return`merge-conflict-action-${e}-${t}-${n}`}({hunkIndex:r.hunkIndex,lineIndex:r.lineIndex,conflictIndex:n.conflictIndex}):void 0;return(0,m.jsx)("div",{slot:i,style:iJ,children:s(t,u)},i)}),null!=a&&(0,m.jsx)("div",{slot:"gutter-utility-slot",style:iY,children:a(d)})]})}({fileDiff:e,renderCustomHeader:d,renderHeaderPrefix:u,renderHeaderMetadata:c,renderAnnotation:l,renderGutterUtility:h,lineAnnotations:r,getHoveredLine:v}),"u"<typeof window&&null!=s?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("template",{shadowrootmode:"open",dangerouslySetInnerHTML:{__html:s}}),p]}):(0,m.jsx)(m.Fragment,{children:p}))})}let hz="devframe-git-theme",hB={light:"vitesse-light",dark:"vitesse-dark"};function hH({file:e,options:t,defaultOpen:n}){let[r,i]=(0,g.useState)(n),{additions:o,deletions:a}=function(e){let t=0,n=0;for(let r of e.hunks)t+=r.additionLines,n+=r.deletionLines;return{additions:t,deletions:n}}(e),s=e.prevName?`${e.prevName} → ${e.name}`:e.name;return(0,m.jsxs)("div",{children:[(0,m.jsxs)("button",{type:"button",onClick:()=>i(e=>!e),"aria-expanded":r,className:"hover:bg-active bg-secondary flex w-full items-center gap-1.5 px-2.5 py-1.5 text-left font-mono text-xs transition-colors",children:[(0,m.jsx)(rC,{name:"i-ph-caret-right",className:ry("color-faint size-3 transition-transform",r&&"rotate-90")}),(0,m.jsx)(ic,{code:function(e){switch(e){case"new":return"added";case"deleted":return"deleted";case"rename-pure":case"rename-changed":return"renamed";default:return"modified"}}(e.type)}),(0,m.jsx)(rA,{path:e.name,className:"size-3.5"}),(0,m.jsx)("span",{className:"min-w-0 flex-1 truncate",title:s,children:s}),e.hunks.length>0?(0,m.jsxs)("span",{className:"shrink-0 tabular-nums",children:[(0,m.jsx)("span",{className:"text-success",children:`+${o}`})," ",(0,m.jsx)("span",{className:"text-error",children:`−${a}`})]}):e.type.startsWith("rename")?(0,m.jsx)(rw,{variant:"secondary",className:"px-1.5 py-0 text-[10px]",children:"renamed"}):(0,m.jsx)(rw,{variant:"secondary",className:"px-1.5 py-0 text-[10px]",children:"bin"})]}),r&&(e.hunks.length>0?(0,m.jsx)(hO,{fileDiff:e,options:t,disableWorkerPool:!0}):(0,m.jsx)("p",{className:"color-muted px-3 py-2 text-xs",children:"No textual diff (binary or metadata-only change)."}))]})}function hU({patch:e,loading:t,truncated:n,scroll:r=!0,collapsible:i=!1}){let o=function(){let[e,t]=(0,g.useState)("dark");return(0,g.useEffect)(()=>{let e=document.documentElement,n=()=>t(e.classList.contains("dark")?"dark":"light");n();let r=new MutationObserver(n);return r.observe(e,{attributes:!0,attributeFilter:["class"]}),()=>r.disconnect()},[]),e}(),a=(0,g.useMemo)(()=>e?function(e){try{return(function(e,t=!1){var n;let r=[];for(let i of(n=e).startsWith("From ")||n.includes("\nFrom ")?e.split(ip):[e])try{r.push(function(e,t,n){try{return function(e,t,n=!1){var r,i,o;let a,s=(r=e).startsWith("diff --git")||r.includes("\ndiff --git"),l=s?(i=e,iG(i,"diff --git")):function(e){if(0===e.length)return[""];let t=[],n=0,r=0,i=0,o=0,a=!1;for(;r<e.length;){let s=iH(e,r);if(i<=0&&o<=0){if(iz(e,r)){r>n&&t.push(e.slice(n,r)),n=r,a=!0,r=iH(e,s);continue}if(a&&e.startsWith("@@ -",r)){let t=iU(e.slice(r,s));null!=t&&(i=t.deletionCount,o=t.additionCount)}r=s;continue}let l=e[r];if("\\"===l){r=s;continue}" "===l?(i=Math.max(i-1,0),o=Math.max(o-1,0)):"-"===l?i=Math.max(i-1,0):"+"===l&&(o=Math.max(o-1,0)),r=s}return t.push(e.slice(n)),t}(e),d=[];for(let e of l){if(s&&!im.test(e)){if(null==a)a=iD(e);else if(n)throw Error("parsePatchContent: unknown file blob");else console.error("parsePatchContent: unknown file blob:",e);continue}if(!s&&(o=e,!iz(o,0))){if(null==a)a=iD(e);else if(n)throw Error("parsePatchContent: unknown file blob");else console.error("parsePatchContent: unknown file blob:",e);continue}let r=ij(e,{cacheKey:null!=t?`${t}-${d.length}`:void 0,isGitDiff:s,throwOnError:n});null!=r&&d.push(r)}return{patchMetadata:a,files:d}}(e,t,n)}finally{iI()}}(i,void 0,t))}catch(e){if(t)throw e;console.error(e)}return r})(e).flatMap(e=>e.files)}catch{return[]}}(e):[],[e]),s=(0,g.useMemo)(()=>({theme:hB,themeType:o,diffStyle:"unified",diffIndicators:"classic",disableFileHeader:i}),[o,i]);if(t)return(0,m.jsx)(il,{className:"h-40 w-full"});if(!e||0===a.length)return(0,m.jsx)("p",{className:"color-muted p-3 text-sm",children:"No textual diff available (binary or unchanged)."});if(i)return(0,m.jsxs)("div",{className:"flex flex-col [&>*+*]:border-t [&>*+*]:border-base",children:[a.map((e,t)=>(0,m.jsx)(hH,{file:e,options:s,defaultOpen:1===a.length},e.name||t)),n&&(0,m.jsx)("p",{className:"text-warning px-3 py-1 text-xs",children:"Patch truncated."})]});let l=(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("div",{className:"flex flex-col text-sm [&>*+*]:border-t [&>*+*]:border-base",children:a.map((e,t)=>(0,m.jsx)(hO,{fileDiff:e,options:s,disableWorkerPool:!0},e.name||t))}),n&&(0,m.jsx)("p",{className:"text-warning px-3 py-1 text-xs",children:"Patch truncated."})]});return r?(0,m.jsx)(ia,{className:"h-72 w-full",children:l}):(0,m.jsx)("div",{children:l})}function hF({label:e}){let t=e.startsWith("tag: "),n=t?e.slice(5):e;return(0,m.jsxs)(rw,{variant:"secondary",className:"gap-1 font-mono text-[10px]",children:[t&&(0,m.jsx)(rC,{name:"i-ph-tag-duotone",className:"size-3"}),n]})}function hG({data:e,loading:t,error:n,onClose:r}){var i;return(0,m.jsxs)("div",{className:"flex h-full flex-col",children:[(0,m.jsxs)("div",{className:"flex items-start justify-between gap-2 pb-2",children:[(0,m.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,m.jsx)(rC,{name:"i-ph-git-commit-duotone",className:"color-active size-4"}),(0,m.jsx)("h2",{className:"text-sm leading-none font-semibold",children:"Commit details"})]}),r&&(0,m.jsx)(rk,{variant:"ghost",size:"sm",onClick:r,"aria-label":"Close commit details",children:(0,m.jsx)(rC,{name:"i-ph-x",className:"size-4"})})]}),n&&(0,m.jsx)("p",{className:"text-error text-sm",children:n}),!n&&(t||!e)&&(0,m.jsxs)("div",{className:"space-y-2",children:[(0,m.jsx)(il,{className:"h-5 w-3/4"}),(0,m.jsx)(il,{className:"h-4 w-1/2"}),(0,m.jsx)(il,{className:"h-24 w-full"})]}),!n&&e&&!e.found&&(0,m.jsx)("p",{className:"color-muted text-sm",children:"Commit not found."}),!n&&e&&e.found&&(0,m.jsx)(ia,{className:"min-h-0 flex-1 pr-2",children:(0,m.jsxs)("div",{className:"space-y-4",children:[(0,m.jsxs)("div",{className:"space-y-1.5",children:[(0,m.jsx)("p",{className:"text-sm leading-snug font-medium break-words",children:e.subject}),e.refs.length>0&&(0,m.jsx)("div",{className:"flex flex-wrap gap-1",children:e.refs.map(e=>(0,m.jsx)(hF,{label:e},e))})]}),(0,m.jsxs)("dl",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 text-xs",children:[(0,m.jsx)("dt",{className:"color-muted",children:"Commit"}),(0,m.jsx)("dd",{className:"truncate font-mono tabular-nums",title:e.hash,children:e.shortHash}),(0,m.jsx)("dt",{className:"color-muted",children:"Author"}),(0,m.jsxs)("dd",{className:"truncate",children:[e.author,(0,m.jsx)("span",{className:"color-muted",children:` <${e.email}>`})]}),(0,m.jsx)("dt",{className:"color-muted",children:"Authored"}),(0,m.jsx)("dd",{className:"truncate",children:(i=e.date)?new Date(i).toLocaleString():""}),e.committer!==e.author&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("dt",{className:"color-muted",children:"Committer"}),(0,m.jsx)("dd",{className:"truncate",children:e.committer})]}),e.parents.length>0&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("dt",{className:"color-muted",children:e.parents.length>1?"Parents":"Parent"}),(0,m.jsx)("dd",{className:"truncate font-mono tabular-nums",children:e.parents.map(e=>e.slice(0,7)).join(", ")})]})]}),e.body&&(0,m.jsx)("pre",{className:"bg-secondary max-h-48 overflow-auto rounded-md p-3 font-mono text-xs whitespace-pre-wrap",children:e.body}),(0,m.jsxs)("div",{className:"space-y-1.5",children:[(0,m.jsxs)("div",{className:"flex items-center justify-between",children:[(0,m.jsx)("span",{className:"color-muted text-xs font-medium tracking-wide uppercase",children:`${e.files.length} ${1===e.files.length?"file":"files"} changed`}),(0,m.jsxs)("span",{className:"text-xs tabular-nums",children:[(0,m.jsx)("span",{className:"text-success",children:`+${e.totalAdditions}`})," ",(0,m.jsx)("span",{className:"text-error",children:`−${e.totalDeletions}`})]})]}),null!==e.patch?(0,m.jsx)("div",{className:"overflow-hidden rounded-md border",children:(0,m.jsx)(hU,{patch:e.patch,loading:!1,truncated:e.truncated,scroll:!1,collapsible:!0})}):(0,m.jsx)("ul",{className:"space-y-0.5",children:e.files.map(e=>(0,m.jsxs)("li",{className:"flex items-center gap-2 text-xs",children:[(0,m.jsx)(ic,{code:e.status}),(0,m.jsx)(rA,{path:e.path,className:"size-4 shrink-0"}),(0,m.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono",title:e.path,children:e.path}),e.binary?(0,m.jsx)(rw,{variant:"secondary",className:"px-1.5 py-0 text-[10px]",children:"bin"}):(0,m.jsxs)("span",{className:"shrink-0 font-mono tabular-nums",children:[(0,m.jsx)("span",{className:"text-success",children:`+${e.additions}`})," ",(0,m.jsx)("span",{className:"text-error",children:`−${e.deletions}`})]})]},e.path))})]})]})})]})}function hW({hash:e,onClose:t}){let{data:n,loading:r,error:i}=na((0,g.useCallback)(t=>t.call("devframes:plugin:git:show",{hash:e}),[e]));return(0,m.jsx)(hG,{data:n,loading:r,error:i,onClose:t})}let hq={connecting:{icon:"i-ph-plugs-connected-duotone",title:"Connecting…",body:"Establishing a connection to the devframe server.",spin:!0},disconnected:{icon:"i-ph-plugs-duotone",title:"Disconnected",body:"Lost the connection to the devframe server. Reload once it is back up."},unauthorized:{icon:"i-ph-lock-key-duotone",title:"Not authorized",body:"This client isn’t authorized. Reopen the link printed by your dev server, then reload."},error:{icon:"i-ph-warning-octagon-duotone",title:"Connection failed",body:"Could not reach the devframe server."}};function hV({status:e,error:t}){if("connected"===e)return null;let n=hq[e];return(0,m.jsxs)("div",{className:"bg-base flex h-svh w-full flex-col items-center justify-center gap-4 p-8 text-center",children:[(0,m.jsx)(rC,{name:n.icon,className:`color-active size-10 ${n.spin?"animate-pulse":""}`}),(0,m.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,m.jsx)("p",{className:"color-base text-lg font-medium",children:n.title}),(0,m.jsx)("p",{className:"color-muted max-w-sm text-sm",children:n.body}),t&&"error"===e&&(0,m.jsx)("p",{className:"color-faint mt-1 max-w-sm break-words font-mono text-xs",children:t})]}),"connecting"!==e&&(0,m.jsxs)("button",{type:"button",className:v({variant:"primary",size:"sm"}),onClick:()=>location.reload(),children:[(0,m.jsx)(rC,{name:"i-ph-arrow-clockwise",className:"size-4"}),"Reload"]})]})}let hX=Math.min,hK=Math.max,hY=Math.round,hJ=Math.floor,hQ=e=>({x:e,y:e}),hZ={left:"right",right:"left",bottom:"top",top:"bottom"};function h0(e,t){return"function"==typeof e?e(t):e}function h1(e){return e.split("-")[0]}function h2(e){return e.split("-")[1]}function h8(e){return"x"===e?"y":"x"}function h5(e){return"y"===e?"height":"width"}function h6(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function h3(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let h4=["left","right"],h7=["right","left"],h9=["top","bottom"],fe=["bottom","top"];function ft(e){let t=h1(e);return hZ[t]+e.slice(t.length)}function fn(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function fr(e,t,n){let r,{reference:i,floating:o}=e,a=h6(t),s=h8(h6(t)),l=h5(s),d=h1(t),u=i.x+i.width/2-o.width/2,c=i.y+i.height/2-o.height/2,h=i[l]/2-o[l]/2;switch(d){case"top":r={x:u,y:i.y-o.height};break;case"bottom":r={x:u,y:i.y+i.height};break;case"right":r={x:i.x+i.width,y:c};break;case"left":r={x:i.x-o.width,y:c};break;default:r={x:i.x,y:i.y}}let f=h2(t);return f&&(r[s]+=h*("end"===f?1:-1)*(n&&"y"===a?-1:1)),r}async function fi(e,t){var n,r,i,o,a;void 0===t&&(t={});let{x:s,y:l,platform:d,rects:u,elements:c,strategy:h}=e,{boundary:f="clippingAncestors",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:g=!1,padding:b=0}=h0(t,e),v="number"!=typeof b?{top:null!=(r=b.top)?r:0,right:null!=(i=b.right)?i:0,bottom:null!=(o=b.bottom)?o:0,left:null!=(a=b.left)?a:0}:{top:b,right:b,bottom:b,left:b},y=c[g?"floating"===m?"reference":"floating":m],w=fn(await d.getClippingRect({element:null==(n=await (null==d.isElement?void 0:d.isElement(y)))||n?y:y.contextElement||await (null==d.getDocumentElement?void 0:d.getDocumentElement(c.floating)),boundary:f,rootBoundary:p,strategy:h})),x="floating"===m?{x:s,y:l,width:u.floating.width,height:u.floating.height}:u.reference,k=await (null==d.getOffsetParent?void 0:d.getOffsetParent(c.floating)),S=await (null==d.isElement?void 0:d.isElement(k))&&await (null==d.getScale?void 0:d.getScale(k))||{x:1,y:1},C=fn(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:k,strategy:h}):x);return{top:(w.top-C.top+v.top)/S.y,bottom:(C.bottom-w.bottom+v.bottom)/S.y,left:(w.left-C.left+v.left)/S.x,right:(C.right-w.right+v.right)/S.x}}let fo=async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=a.detectOverflow?a:{...a,detectOverflow:fi},l=await (null==a.isRTL?void 0:a.isRTL(t)),d=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:c}=fr(d,r,l),h=r,f=0,p={};for(let n=0;n<o.length;n++){let m=o[n];if(!m)continue;let{name:g,fn:b}=m,{x:v,y:y,data:w,reset:x}=await b({x:u,y:c,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:d,platform:s,elements:{reference:e,floating:t}});u=null!=v?v:u,c=null!=y?y:c,p[g]={...p[g],...w},x&&f<50&&(f++,"object"==typeof x&&(x.placement&&(h=x.placement),x.rects&&(d=!0===x.rects?await a.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:c}=fr(d,h,l)),n=-1)}return{x:u,y:c,placement:h,strategy:i,middlewareData:p}},fa=new Set(["left","top"]);async function fs(e,t){let{placement:n,platform:r,elements:i}=e,o=await (null==r.isRTL?void 0:r.isRTL(i.floating)),a=h1(n),s=h2(n),l="y"===h6(n),d=fa.has(a)?-1:1,u=o&&l?-1:1,c=h0(t,e),{mainAxis:h,crossAxis:f,alignmentAxis:p}="number"==typeof c?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return s&&"number"==typeof p&&(f="end"===s?-1*p:p),l?{x:f*u,y:h*d}:{x:h*d,y:f*u}}function fl(){return"u">typeof window}function fd(e){return fh(e)?(e.nodeName||"").toLowerCase():"#document"}function fu(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function fc(e){var t;return null==(t=(fh(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function fh(e){return!!fl()&&(e instanceof Node||e instanceof fu(e).Node)}function ff(e){return!!fl()&&(e instanceof Element||e instanceof fu(e).Element)}function fp(e){return!!fl()&&(e instanceof HTMLElement||e instanceof fu(e).HTMLElement)}function fm(e){return!(!fl()||"u"<typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof fu(e).ShadowRoot)}function fg(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=fC(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==i&&"contents"!==i}function fb(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let fv=/transform|translate|scale|rotate|perspective|filter/,fy=/paint|layout|strict|content/,fw=e=>!!e&&"none"!==e;function fx(e){let t=ff(e)?fC(e):e;return fw(t.transform)||fw(t.translate)||fw(t.scale)||fw(t.rotate)||fw(t.perspective)||!fk()&&(fw(t.backdropFilter)||fw(t.filter))||fv.test(t.willChange||"")||fy.test(t.contain||"")}function fk(){return null==a&&(a="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),a}function fS(e){return/^(html|body|#document)$/.test(fd(e))}function fC(e){return fu(e).getComputedStyle(e)}function fA(e){return ff(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fE(e){if("html"===fd(e))return e;let t=e.assignedSlot||e.parentNode||fm(e)&&e.host||fc(e);return fm(t)?t.host:t}function fL(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let i=function e(t){let n=fE(t);return fS(n)?(t.ownerDocument||t).body:fp(n)&&fg(n)?n:e(n)}(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),a=fu(i);if(!o)return t.concat(i,fL(i,[],n));{let e=f_(a);return t.concat(a,a.visualViewport||[],fg(i)?i:[],e&&n?fL(e):[])}}function f_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fN(e){let t=fC(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=fp(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=hY(n)!==o||hY(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function fT(e){return ff(e)?e:e.contextElement}function fR(e){let t=fT(e);if(!fp(t))return hQ(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:o}=fN(t),a=(o?hY(n.width):n.width)/r,s=(o?hY(n.height):n.height)/i;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}let fM=hQ(0);function fP(e){let t=fu(e);return fk()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:fM}function fI(e,t,n,r){var i;void 0===t&&(t=!1),void 0===n&&(n=!1);let o=e.getBoundingClientRect(),a=fT(e),s=hQ(1);t&&(r?ff(r)&&(s=fR(r)):s=fR(e));let l=(void 0===(i=n)&&(i=!1),r&&i&&r===fu(a))?fP(a):hQ(0),d=(o.left+l.x)/s.x,u=(o.top+l.y)/s.y,c=o.width/s.x,h=o.height/s.y;if(a&&r){let e=fu(a),t=ff(r)?fu(r):r,n=e,i=f_(n);for(;i&&t!==n;){let e=fR(i),t=i.getBoundingClientRect(),r=fC(i),o=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;d*=e.x,u*=e.y,c*=e.x,h*=e.y,d+=o,u+=a,i=f_(n=fu(i))}}return fn({width:c,height:h,x:d,y:u})}function fD(e,t){let n=fA(e).scrollLeft;return t?t.left+n:fI(fc(e)).left+n}function fj(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-fD(e,n),y:n.top+t.scrollTop}}function f$(e,t,n){var r;let i;if("viewport"===t||"layoutViewport"===t)i=function(e,t,n){void 0===n&&(n="viewport");let r="layoutViewport"===n,i=fu(e),o=fc(e),a=i.visualViewport,s=o.clientWidth,l=o.clientHeight,d=0,u=0;if(a){let e=!fk()||"fixed"===t;r?e||(d=-a.offsetLeft,u=-a.offsetTop):(s=a.width,l=a.height,e&&(d=a.offsetLeft,u=a.offsetTop))}if(0>=fD(o)){let e=o.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(o.clientWidth-t.clientWidth-r),a="stable both-edges"===getComputedStyle(o).scrollbarGutter?i/2:i;a<=25&&(s-=a)}return{width:s,height:l,x:d,y:u}}(e,n,t);else if("document"===t){let t,n,o,a,s,l;t=fA(r=fc(e)),n=r.ownerDocument.body,o=hK(r.scrollWidth,r.clientWidth,n.scrollWidth,n.clientWidth),a=hK(r.scrollHeight,r.clientHeight,n.scrollHeight,n.clientHeight),s=-t.scrollLeft+fD(r),l=-t.scrollTop,"rtl"===fC(n).direction&&(s+=hK(r.clientWidth,n.clientWidth)-o),i={width:o,height:a,x:s,y:l}}else if(ff(t)){let e,r,o,a,s,l;r=(e=fI(t,!0,"fixed"===n)).top+t.clientTop,o=e.left+t.clientLeft,a=fR(t),s=t.clientWidth*a.x,l=t.clientHeight*a.y,i={width:s,height:l,x:o*a.x,y:r*a.y}}else{let n=fP(e);i={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return fn(i)}function fO(e){return"static"===fC(e).position}function fz(e,t){if(!fp(e)||"fixed"===fC(e).position)return null;if(t)return t(e);let n=e.offsetParent;return fc(e)===n&&(n=n.ownerDocument.body),n}function fB(e,t){var n;let r=fu(e);if(fb(e))return r;if(!fp(e)){let t=fE(e);for(;t&&!fS(t);){if(ff(t)&&!fO(t))return t;t=fE(t)}return r}let i=fz(e,t);for(;i&&(n=i,/^(table|td|th)$/.test(fd(n)))&&fO(i);)i=fz(i,t);return i&&fS(i)&&fO(i)&&!fx(i)?r:i||function(e){let t=fE(e);for(;fp(t)&&!fS(t);){if(fx(t))return t;if(fb(t))break;t=fE(t)}return null}(e)||r}let fH=async function(e){let t=this.getOffsetParent||fB,n=this.getDimensions,r=await n(e.floating);return{reference:function(e,t,n){let r=fp(t),i=fc(t),o="fixed"===n,a=fI(e,!0,o,t),s={scrollLeft:0,scrollTop:0},l=hQ(0);if((r||!o)&&(("body"!==fd(t)||fg(i))&&(s=fA(t)),r)){let e=fI(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}!r&&i&&(l.x=fD(i));let d=!i||r||o?hQ(0):fj(i,s);return{x:a.left+s.scrollLeft-l.x-d.x,y:a.top+s.scrollTop-l.y-d.y,width:a.width,height:a.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},fU={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,o="fixed"===i,a=fc(r),s=!!t&&fb(t.floating);if(r===a||s&&o)return n;let l={scrollLeft:0,scrollTop:0},d=hQ(1),u=hQ(0),c=fp(r);if((c||!o)&&(("body"!==fd(r)||fg(a))&&(l=fA(r)),c)){let e=fI(r);d=fR(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let h=!a||c||o?hQ(0):fj(a,l);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-l.scrollLeft*d.x+u.x+h.x,y:n.y*d.y-l.scrollTop*d.y+u.y+h.y}},getDocumentElement:fc,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,o=[..."clippingAncestors"===n?fb(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=fL(e,[],!1).filter(e=>ff(e)&&"body"!==fd(e)),i=null,o="fixed"===fC(e).position,a=o?fE(e):e;for(;ff(a)&&!fS(a);){let e=fC(a),t=fx(a),n=i?i.position:o?"fixed":"";t||"fixed"!==n&&("absolute"!==n||"static"!==e.position)?i=e:r=r.filter(e=>e!==a),a=fE(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=f$(t,o[0],i),s=a.top,l=a.right,d=a.bottom,u=a.left;for(let e=1;e<o.length;e++){let n=f$(t,o[e],i);s=hK(n.top,s),l=hX(n.right,l),d=hX(n.bottom,d),u=hK(n.left,u)}return{width:l-u,height:d-s,x:u,y:s}},getOffsetParent:fB,getElementRects:fH,getClientRects:function(e){return e.getClientRects?Array.from(e.getClientRects()):[]},getDimensions:function(e){let{width:t,height:n}=fN(e);return{width:t,height:n}},getScale:fR,isElement:ff,isRTL:function(e){return"rtl"===fC(e).direction}};function fF(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fG(e,t,n,r){let i;void 0===r&&(r={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:d=!1}=r,u=fT(e),c=o||a?[...u?fL(u):[],...t?fL(t):[]]:[];c.forEach(e=>{o&&e.addEventListener("scroll",n),a&&e.addEventListener("resize",n)});let h=u&&l?function(e,t,n){let r,i=null,o=fc(e);function a(){var e;clearTimeout(r),null==(e=i)||e.disconnect(),i=null}function s(n,l){void 0===n&&(n=!1),void 0===l&&(l=1),a();let d=e.getBoundingClientRect(),{left:u,top:c,width:h,height:f}=d;if(n||t(),!h||!f)return;let p={rootMargin:-hJ(c)+"px "+-hJ(o.clientWidth-(u+h))+"px "+-hJ(o.clientHeight-(c+f))+"px "+-hJ(u)+"px",threshold:hK(0,hX(1,l))||1},m=!0;function g(t){let n=t[0].intersectionRatio;if(!fF(d,e.getBoundingClientRect()))return s();if(n!==l){if(!m)return s();n?s(!1,n):r=setTimeout(()=>{s(!1,1e-7)},1e3)}m=!1}try{i=new IntersectionObserver(g,{...p,root:o.ownerDocument})}catch(e){i=new IntersectionObserver(g,p)}i.observe(e)}let l=fu(e),d=()=>s(n);return l.addEventListener("resize",d),s(!0),()=>{l.removeEventListener("resize",d),a()}}(u,n,a):null,f=-1,p=null;s&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),n()}),u&&!d&&p.observe(u),t&&p.observe(t));let m=d?fI(e):null;return d&&function t(){let r=fI(e);m&&!fF(m,r)&&n(),m=r,i=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach(e=>{o&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)}),null==h||h(),null==(e=p)||e.disconnect(),p=null,d&&cancelAnimationFrame(i)}}var fW="u">typeof document?g.useLayoutEffect:function(){};function fq(e,t){let n,r,i;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!fq(e[r],t[r]))return!1;return!0}if((n=(i=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!=r--;){let n=i[r];if(("_owner"!==n||!e.$$typeof)&&!fq(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function fV(e){return"u"<typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function fX(e,t){let n=fV(e);return Math.round(t*n)/n}function fK(e){let t=g.useRef(e);return fW(()=>{t.current=e}),t}var fY='input:not([inert]):not([inert] *),select:not([inert]):not([inert] *),textarea:not([inert]):not([inert] *),a[href]:not([inert]):not([inert] *),area[href]:not([inert]):not([inert] *),button:not([inert]):not([inert] *),[tabindex]:not(slot):not([inert]):not([inert] *),audio[controls]:not([inert]):not([inert] *),video[controls]:not([inert]):not([inert] *),[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *),details>summary:first-of-type:not([inert]):not([inert] *),details:not([inert]):not([inert] *)',fJ="u"<typeof Element,fQ=fJ?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,fZ=!fJ&&Element.prototype.getRootNode?function(e){var t;return null==e||null==(t=e.getRootNode)?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},f0=function(e,t){void 0===t&&(t=!0);var n,r=null==e||null==(n=e.getAttribute)?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):f0(e.parentNode))},f1=function(e){var t,n=null==e||null==(t=e.getAttribute)?void 0:t.call(e,"contenteditable");return""===n||"true"===n},f2=function(e,t,n){if(f0(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(fY));return t&&fQ.call(e,fY)&&r.unshift(e),r=r.filter(n)},f8=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var o=i.shift();if(!f0(o,!1))if("SLOT"===o.tagName){var a=o.assignedElements(),s=f8(a.length?a:o.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:o,candidates:s})}else{fQ.call(o,fY)&&n.filter(o)&&(t||!e.includes(o))&&r.push(o);var l=o.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(o),d=!f0(l,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(o));if(l&&d){var u=f8(!0===l?o.children:l.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:o,candidates:u})}else i.unshift.apply(i,o.children)}}return r},f5=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},f6=function(e){if(!e)throw Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||f1(e))&&!f5(e)?0:e.tabIndex},f3=function(e,t){var n=f6(e);return n<0&&t&&!f5(e)?0:n},f4=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},f7=function(e){return"INPUT"===e.tagName},f9=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},pe=function(e){if(!e.name)return!0;var t,n=e.form||fZ(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("u">typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var i=f9(t,e.form);return!i||i===e},pt=function(e){return f7(e)&&"radio"===e.type&&!pe(e)},pn=function(e){var t,n,r,i,o,a,s,l=e&&fZ(e),d=null==(t=l)?void 0:t.host,u=!1;if(l&&l!==e)for(u=!!(null!=(n=d)&&null!=(r=n.ownerDocument)&&r.contains(d)||null!=e&&null!=(i=e.ownerDocument)&&i.contains(e));!u&&d;)u=!!(null!=(a=d=null==(o=l=fZ(d))?void 0:o.host)&&null!=(s=a.ownerDocument)&&s.contains(d));return u},pr=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},pi=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("full-native"===n&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});var i=getComputedStyle(e).visibility;if("hidden"===i||"collapse"===i)return!0;var o=fQ.call(e,"details>summary:first-of-type")?e.parentElement:e;if(fQ.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return pr(e)}else{if("function"==typeof r){for(var a=e;e;){var s=e.parentElement,l=fZ(e);if(s&&!s.shadowRoot&&!0===r(s))return pr(e);e=e.assignedSlot?e.assignedSlot:s||l===e.ownerDocument?s:l.host}e=a}if(pn(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},po=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!fQ.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1},pa=function(e,t){return!(t.disabled||f7(t)&&"hidden"===t.type||pi(t,e)||"DETAILS"===t.tagName&&Array.prototype.slice.apply(t.children).some(function(e){return"SUMMARY"===e.tagName})||po(t))},ps=function(e,t){return!(pt(t)||0>f6(t))&&!!pa(e,t)},pl=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!isNaN(t)||!!(t>=0)},pd=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,o=i?e.scopeParent:e,a=f3(o,i),s=i?pd(e.candidates):o;0===a?i?t.push.apply(t,s):t.push(o):n.push({documentOrder:r,tabIndex:a,item:e,isScope:i,content:s})}),n.sort(f4).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},pu=function(e,t){return pd((t=t||{}).getShadowRoot?f8([e],t.includeContainer,{filter:ps.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:pl}):f2(e,t.includeContainer,ps.bind(null,t)))};function pc(){return/apple/i.test(navigator.vendor)}function ph(e){let t=e.activeElement;for(;(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function pf(e,t){if(!e||!t)return!1;let n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&fm(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function pp(e){return"composedPath"in e?e.composedPath()[0]:e.target}function pm(e,t){return null!=t&&("composedPath"in e?e.composedPath().includes(t):null!=e.target&&t.contains(e.target))}function pg(e){return(null==e?void 0:e.ownerDocument)||document}function pb(e,t,n){return void 0===n&&(n=!0),e.filter(e=>{var r;return e.parentId===t&&(!n||(null==(r=e.context)?void 0:r.open))}).flatMap(t=>[t,...pb(e,t.id,n)])}function pv(e,t){let n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var py="u">typeof document?g.useLayoutEffect:function(){};function pw(e){let t=g.useRef(e);return py(()=>{t.current=e}),t}let px={...g}.useInsertionEffect||(e=>e());function pk(e){let t=g.useRef(()=>{});return px(()=>{t.current=e}),g.useCallback(function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}let pS=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function pC(e,t){let n=pu(e,pS()),r=n.length;if(0===r)return;let i=ph(pg(e)),o=n.indexOf(i);return n[-1===o?1===t?0:r-1:o+t]}function pA(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!pf(n,r)}function pE(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}let pL="active",p_="selected",pN={...g},pT=!1,pR=0,pM=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+pR++,pP=pN.useId||function(){let[e,t]=g.useState(()=>pT?pM():void 0);return py(()=>{null==e&&t(pM())},[]),g.useEffect(()=>{pT=!0},[]),e},pI=g.createContext(null),pD=g.createContext(null),pj=()=>{var e;return(null==(e=g.useContext(pI))?void 0:e.id)||null};function p$(e){return"data-floating-ui-"+e}function pO(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}let pz=p$("safe-polygon");function pB(e,t,n){if(n&&!pv(n))return 0;if("number"==typeof e)return e;if("function"==typeof e){let n=e();return"number"==typeof n?n:null==n?void 0:n[t]}return null==e?void 0:e[t]}function pH(e){return"function"==typeof e?e():e}function pU(e,t){if(!e||!t)return!1;let n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&fm(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}let pF={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},pG=g.forwardRef(function(e,t){let[n,r]=g.useState();py(()=>{pc()&&r("button")},[]);let i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[p$("focus-guard")]:"",style:pF};return(0,m.jsx)("span",{...e,...i})}),pW={clipPath:"inset(50%)",position:"fixed",top:0,left:0},pq=g.createContext(null),pV=p$("portal");function pX(e){let{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,o=function(e){void 0===e&&(e={});let{id:t,root:n}=e,r=pP(),i=pK(),[o,a]=g.useState(null),s=g.useRef(null);return py(()=>()=>{null==o||o.remove(),queueMicrotask(()=>{s.current=null})},[o]),py(()=>{if(!r||s.current)return;let e=t?document.getElementById(t):null;if(!e)return;let n=document.createElement("div");n.id=r,n.setAttribute(pV,""),e.appendChild(n),s.current=n,a(n)},[t,r]),py(()=>{if(null===n||!r||s.current)return;let e=n||(null==i?void 0:i.portalNode);e&&!fh(e)&&(e=e.current),e=e||document.body;let o=null;t&&((o=document.createElement("div")).id=t,e.appendChild(o));let l=document.createElement("div");l.id=r,l.setAttribute(pV,""),(e=o||e).appendChild(l),s.current=l,a(l)},[t,n,r,i]),o}({id:n,root:r}),[a,s]=g.useState(null),l=g.useRef(null),d=g.useRef(null),u=g.useRef(null),c=g.useRef(null),h=null==a?void 0:a.modal,f=null==a?void 0:a.open,p=!!a&&!a.modal&&a.open&&i&&!!(r||o);return g.useEffect(()=>{if(o&&i&&!h)return o.addEventListener("focusin",e,!0),o.addEventListener("focusout",e,!0),()=>{o.removeEventListener("focusin",e,!0),o.removeEventListener("focusout",e,!0)};function e(e){o&&pA(e)&&("focusin"===e.type?pE:function(e){pu(e,pS()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})})(o)}},[o,i,h]),g.useEffect(()=>{!o||f||pE(o)},[f,o]),(0,m.jsxs)(pq.Provider,{value:g.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:d,beforeInsideRef:u,afterInsideRef:c,portalNode:o,setFocusManagerState:s}),[i,o]),children:[p&&o&&(0,m.jsx)(pG,{"data-type":"outside",ref:l,onFocus:e=>{var t,n;if(pA(e,o))null==(t=u.current)||t.focus();else{let e=pC(pg(n=a?a.domReference:null).body,-1)||n;null==e||e.focus()}}}),p&&o&&(0,m.jsx)("span",{"aria-owns":o.id,style:pW}),o&&rE.createPortal(t,o),p&&o&&(0,m.jsx)(pG,{"data-type":"outside",ref:d,onFocus:e=>{var t,n;if(pA(e,o))null==(t=c.current)||t.focus();else{let t=pC(pg(n=a?a.domReference:null).body,1)||n;null==t||t.focus(),(null==a?void 0:a.closeOnFocusOut)&&(null==a||a.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})}let pK=()=>g.useContext(pq),pY={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},pJ={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},pQ=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function pZ(){let e;return(null!=(e=navigator.userAgentData)&&e.platform?e.platform:navigator.platform).toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints&&pc()}function p0(e,t,n){let r=new Map,i="item"===n,o=e;if(i&&e){let{[pL]:t,[p_]:n,...r}=e;o=r}return{..."floating"===n&&{tabIndex:-1,"data-floating-ui-focusable":""},...o,...t.map(t=>{let r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,o]=t;if(!(i&&[pL,p_].includes(n)))if(0===n.indexOf("on")){if(r.has(n)||r.set(n,[]),"function"==typeof o){var a;null==(a=r.get(n))||a.push(o),e[n]=function(){for(var e,t=arguments.length,i=Array(t),o=0;o<t;o++)i[o]=arguments[o];return null==(e=r.get(n))?void 0:e.map(e=>e(...i)).find(e=>void 0!==e)}}}else e[n]=o}),e),{})}}function p1(e,t){let[n,r]=e,i=!1,o=t.length;for(let e=0,a=o-1;e<o;a=e++){let[o,s]=t[e]||[0,0],[l,d]=t[a]||[0,0];s>=r!=d>=r&&n<=(l-o)*(r-s)/(d-s)+o&&(i=!i)}return i}let p2=["#3b82f6","#f59e0b","#ef4444","#8b5cf6","#10b981","#ec4899","#06b6d4","#f97316"],p8={remote:0,head:1,tag:2,branch:3};function p5(e){return"branch"===e.kind&&e.current?4:p8[e.kind]}let p6=["#3b82f6","#f59e0b","#ef4444","#8b5cf6","#10b981","#ec4899","#06b6d4","#f97316","#14b8a6","#6366f1"];async function p3(e){let t=new TextEncoder().encode(e);return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",t)),e=>e.toString(16).padStart(2,"0")).join("")}let p4=/^(?:\d+\+)?([a-z0-9](?:[a-z0-9-]*[a-z0-9])?)@users\.noreply\.github\.com$/i;async function p7(e,t){let n=e.trim().toLowerCase();if(!n||!n.includes("@"))return null;let r=n.match(p4);if(r)return`https://github.com/${r[1]}.png?size=${t}`;if(!globalThis.crypto?.subtle)return null;let i=await p3(n);return`https://gravatar.com/avatar/${i}?s=${t}&d=404`}function p9({name:e,email:t,size:n=64,className:r,...i}){let o,a=p6[function(e){let t=0;for(let n=0;n<e.length;n++)t=31*t+e.charCodeAt(n)|0;return Math.abs(t)}((t||e||"?").toLowerCase())%p6.length],[s,l]=(0,g.useState)(null),[d,u]=(0,g.useState)(!1);return(0,g.useEffect)(()=>{let e=!0;return l(null),u(!1),p7(t??"",n).then(t=>e&&l(t)).catch(()=>{}),()=>{e=!1}},[t,n]),(0,m.jsxs)("span",{className:ry("relative inline-flex size-7 shrink-0 items-center justify-center overflow-hidden rounded-full text-[11px] font-semibold text-white select-none",r),style:{backgroundColor:a},title:e,...i,children:[0===(o=(e.trim()||(t??"").split("@")[0]||"?").split(/[\s._-]+/).filter(Boolean)).length?"?":1===o.length?o[0].slice(0,2).toUpperCase():(o[0][0]+o[o.length-1][0]).toUpperCase(),s&&!d&&(0,m.jsx)("img",{src:s,alt:"",loading:"lazy",referrerPolicy:"no-referrer",onError:()=>u(!0),className:"absolute inset-0 size-full rounded-full object-cover"})]})}function me(e,t){let n=Number.parseInt(e.slice(1,3),16),r=Number.parseInt(e.slice(3,5),16),i=Number.parseInt(e.slice(5,7),16);return`rgba(${n}, ${r}, ${i}, ${t})`}function mt(e){return 8+15*e+7.5}function mn(e,t,n,r){let i=mt(e),o=mt(n);if(e===n)return`M ${i} ${t} L ${o} ${r}`;let a=(t+r)/2;return`M ${i} ${t} C ${i} ${a} ${o} ${a} ${o} ${r}`}function mr({row:e,width:t,isHead:n,topStub:r}){return(0,m.jsxs)("svg",{width:t,height:30,className:"block shrink-0",style:{overflow:"visible"},"aria-hidden":!0,children:[r&&(0,m.jsx)("path",{d:mn(e.col,0,e.col,15),fill:"none",stroke:e.color,strokeWidth:2,strokeLinecap:"round"}),e.topLinks.map((e,t)=>(0,m.jsx)("path",{d:mn(e.from,0,e.to,15),fill:"none",stroke:e.color,strokeWidth:2,strokeLinecap:"round"},`t${t}`)),e.bottomLinks.map((e,t)=>(0,m.jsx)("path",{d:mn(e.from,15,e.to,30),fill:"none",stroke:e.color,strokeWidth:2,strokeLinecap:"round"},`b${t}`)),n&&(0,m.jsx)("circle",{cx:mt(e.col),cy:15,r:7.5,fill:"none",stroke:e.color,strokeWidth:1.5,opacity:.3}),(0,m.jsx)("circle",{cx:mt(e.col),cy:15,r:4,fill:n?void 0:e.color,className:n?"fill-white dark:fill-[#111]":void 0,stroke:e.color,strokeWidth:2.5})]})}function mi({refToken:e,color:t}){if("tag"===e.kind)return(0,m.jsxs)("span",{className:"inline-flex max-w-[140px] items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] leading-none font-medium",style:{color:t,borderColor:me(t,.5),backgroundColor:me(t,.12)},children:[(0,m.jsx)(rC,{name:"i-ph-tag-duotone",className:"size-2.5 shrink-0"}),(0,m.jsx)("span",{className:"truncate",title:e.name,children:e.name})]});if("head"===e.kind)return(0,m.jsx)("span",{className:"color-muted inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 font-mono text-[10px] leading-none font-medium",children:"HEAD"});let n="remote"===e.kind?`${e.remote}/${e.name}`:e.name,r="branch"===e.kind&&e.current;return(0,m.jsxs)("span",{className:"inline-flex max-w-[140px] items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px] leading-none font-medium",style:r?{color:"#fff",backgroundColor:t}:{color:t,borderColor:me(t,.5),backgroundColor:me(t,.12),borderWidth:1,borderStyle:"solid"},children:[r?(0,m.jsx)(rC,{name:"i-ph-check",className:"size-2.5 shrink-0"}):(0,m.jsx)(rC,{name:"i-ph-git-branch-duotone",className:"size-2.5 shrink-0 opacity-70"}),(0,m.jsx)("span",{className:"truncate",title:n,children:n})]})}function mo({additions:e,deletions:t}){return(0,m.jsxs)("span",{className:"tabular-nums",children:[(0,m.jsx)("span",{className:"text-success font-medium",children:`+${e}`})," ",(0,m.jsx)("span",{className:"text-error font-medium",children:`−${t}`})]})}function ma({commit:e,detail:t,onOpen:n}){let r=(t?.data?.body||e.body||e.subject).trim(),i=t?.data?.files.length??0;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("div",{className:"space-y-2.5 p-3.5",children:[(0,m.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,m.jsx)(p9,{name:e.author,email:e.email,className:"size-8 text-xs"}),(0,m.jsxs)("div",{className:"flex min-w-0 items-baseline gap-2",children:[(0,m.jsx)("span",{className:"color-base truncate font-semibold",children:e.author}),(0,m.jsx)("span",{className:"color-muted shrink-0 text-xs",title:new Date(e.date).toLocaleString(),children:function(e){let t=Math.round((Date.now()-e)/6e4);if(t<1)return"just now";if(t<60)return`${t} minute${1===t?"":"s"} ago`;let n=Math.round(t/60);if(n<24)return`${n} hour${1===n?"":"s"} ago`;let r=Math.round(n/24);return r<30?`${r} day${1===r?"":"s"} ago`:new Date(e).toLocaleDateString()}(e.date)})]})]}),(0,m.jsx)("p",{className:"color-muted line-clamp-3 text-sm leading-snug",children:r})]}),(0,m.jsxs)("div",{className:"border-base flex items-center justify-between border-t px-3.5 py-2.5 text-sm",children:[t?.loading||!t?(0,m.jsxs)("span",{className:"color-faint inline-flex items-center gap-1.5",children:[(0,m.jsx)(rC,{name:"i-ph-spinner-gap",className:"size-3.5 animate-spin"}),"Loading…"]}):t.data?(0,m.jsxs)("span",{className:"color-muted",children:[(0,m.jsxs)("span",{className:"color-base font-medium",children:[i," ",1===i?"file":"files"," ","changed"]})," ",(0,m.jsx)(mo,{additions:t.data.totalAdditions,deletions:t.data.totalDeletions})]}):(0,m.jsx)("code",{className:"color-muted tabular-nums",children:e.shortHash}),(0,m.jsx)(rk,{variant:"ghost",size:"sm",onClick:n,"aria-label":"Open commit details",children:(0,m.jsx)(rC,{name:"i-ph-arrow-right",className:"size-4"})})]})]})}let ms=(0,g.memo)(({commit:e,row:t,gutter:n,currentBranch:r,isHead:i,topStub:o,selected:a,onSelect:s,onLoadDetail:l})=>{var d,u,c,h,f,p,b,v;let y,w,x,k,S,C,A,E,L,_=(0,g.useMemo)(()=>(function(e,t){let n=[];for(let r of e){let e=r.trim();if(!e)continue;if(e.startsWith("tag: ")){n.push({kind:"tag",name:e.slice(5).trim()});continue}if(e.includes("->")){let t=e.split("->")[1]?.trim();t&&n.push({kind:"branch",name:t,current:!0});continue}if("HEAD"===e){n.push({kind:"head"});continue}let i=e.indexOf("/");if(i>0){let t=e.slice(0,i),r=e.slice(i+1);if("HEAD"===r)continue;n.push({kind:"remote",remote:t,name:r});continue}n.push({kind:"branch",name:e,current:t===e})}return n.sort((e,t)=>p5(e)-p5(t))})(e.refs,r),[e.refs,r]),[N,T]=(0,g.useState)(!1),[R,M]=(0,g.useState)(),P=0!==t.col&&!a&&!N,I=function(e){var t,n;let{elements:r,...i}=void 0===e?{}:e,{nodeId:o}=i,a=function(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=pP(),o=g.useRef({}),[a]=g.useState(()=>{let e;return e=new Map,{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;null==(r=e.get(t))||r.delete(n)}}}),s=null!=pj(),[l,d]=g.useState(r.reference),u=pk((e,t,r)=>{o.current.openEvent=e?t:void 0,a.emit("openchange",{open:e,event:t,reason:r,nested:s}),null==n||n(e,t,r)}),c=g.useMemo(()=>({setPositionReference:d}),[]),h=g.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return g.useMemo(()=>({dataRef:o,open:t,onOpenChange:u,elements:h,events:a,floatingId:i,refs:c}),[t,u,h,a,i,c])}({...i,elements:{reference:null!=(t=null==r?void 0:r.reference)?t:null,floating:null!=(n=null==r?void 0:r.floating)?n:null}}),s=i.rootContext||a,l=s.elements,[d,u]=g.useState(null),[c,h]=g.useState(null),f=(null==l?void 0:l.domReference)||d,p=g.useRef(null),m=g.useContext(pD);py(()=>{f&&(p.current=f)},[f]);let b=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:d}=e,[u,c]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=g.useState(r);fq(h,r)||f(r);let[p,m]=g.useState(null),[b,v]=g.useState(null),y=g.useCallback(e=>{e!==S.current&&(S.current=e,m(e))},[]),w=g.useCallback(e=>{e!==C.current&&(C.current=e,v(e))},[]),x=o||p,k=a||b,S=g.useRef(null),C=g.useRef(null),A=g.useRef(u),E=null!=l,L=fK(l),_=fK(i),N=fK(d),T=g.useCallback(()=>{var e,r;let i,o,a;if(!S.current||!C.current)return;let s={placement:t,strategy:n,middleware:h};_.current&&(s.platform=_.current),(e=S.current,r=C.current,i=new Map,o=null!=s?s:{},a={...fU,...o.platform,_c:i},fo(e,r,{...o,platform:a})).then(e=>{let t={...e,isPositioned:!1!==N.current};R.current&&!fq(A.current,t)&&(A.current=t,rE.flushSync(()=>{c(t)}))})},[h,t,n,_,N]);fW(()=>{!1===d&&A.current.isPositioned&&(A.current.isPositioned=!1,c(e=>({...e,isPositioned:!1})))},[d]);let R=g.useRef(!1);fW(()=>(R.current=!0,()=>{R.current=!1}),[]),fW(()=>{if(x&&(S.current=x),k&&(C.current=k),x&&k){if(L.current)return L.current(x,k,T);T()}},[x,k,T,L,E]);let M=g.useMemo(()=>({reference:S,floating:C,setReference:y,setFloating:w}),[y,w]),P=g.useMemo(()=>({reference:x,floating:k}),[x,k]),I=g.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=fX(P.floating,u.x),r=fX(P.floating,u.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...fV(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return g.useMemo(()=>({...u,update:T,refs:M,elements:P,floatingStyles:I}),[u,T,M,P,I])}({...i,elements:{...l,...c&&{reference:c}}}),v=g.useCallback(e=>{let t=ff(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;h(t),b.refs.setReference(t)},[b.refs]),y=g.useCallback(e=>{(ff(e)||null===e)&&(p.current=e,u(e)),(ff(b.refs.reference.current)||null===b.refs.reference.current||null!==e&&!ff(e))&&b.refs.setReference(e)},[b.refs]),w=g.useMemo(()=>({...b.refs,setReference:y,setPositionReference:v,domReference:p}),[b.refs,y,v]),x=g.useMemo(()=>({...b.elements,domReference:f}),[b.elements,f]),k=g.useMemo(()=>({...b,...s,refs:w,elements:x,nodeId:o}),[b,w,x,o,s]);return py(()=>{s.dataRef.current.floatingContext=k;let e=null==m?void 0:m.nodesRef.current.find(e=>e.id===o);e&&(e.context=k)}),g.useMemo(()=>({...b,context:k,refs:w,elements:x}),[b,w,x,k])}({open:N,onOpenChange:T,placement:"bottom-start",middleware:[{name:(y={name:"offset",options:6,async fn(e){var t,n;let{x:r,y:i,placement:o,middlewareData:a}=e,s=await fs(e,6);return o===(null==(t=a.offset)?void 0:t.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:o}}}}).name,fn:y.fn,options:[6,d]},{name:(w={name:"flip",options:h=u={padding:8},async fn(e){var t,n,r,i,o,a,s,l;let d,u,c,{placement:f,middlewareData:p,rects:m,initialPlacement:g,platform:b,elements:v}=e,{mainAxis:y=!0,crossAxis:w=!0,fallbackPlacements:x,fallbackStrategy:k="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:C=!0,...A}=h0(h,e);if(null!=(t=p.arrow)&&t.alignmentOffset)return{};let E=h1(f),L=h6(g),_=h1(g)===g,N=await (null==b.isRTL?void 0:b.isRTL(v.floating)),T=x||(_||!C?[ft(g)]:(d=ft(g),[h3(g),d,h3(d)])),R="none"!==S;!x&&R&&T.push(...(u=h2(g),c=function(e,t,n){switch(e){case"top":case"bottom":if(n)return t?h7:h4;return t?h4:h7;case"left":case"right":return t?h9:fe;default:return[]}}(h1(g),"start"===S,N),u&&(c=c.map(e=>e+"-"+u),C&&(c=c.concat(c.map(h3)))),c));let M=[g,...T],P=await b.detectOverflow(e,A),I=[],D=(null==(n=p.flip)?void 0:n.overflows)||[];if(y&&I.push(P[E]),w){let e,t,n,r,i=(a=f,s=m,void 0===(l=N)&&(l=!1),e=h2(a),n=h5(t=h8(h6(a))),r="x"===t?e===(l?"end":"start")?"right":"left":"start"===e?"bottom":"top",s.reference[n]>s.floating[n]&&(r=ft(r)),[r,ft(r)]);I.push(P[i[0]],P[i[1]])}if(D=[...D,{placement:f,overflows:I}],!I.every(e=>e<=0)){let e=((null==(r=p.flip)?void 0:r.index)||0)+1,t=M[e];if(t&&("alignment"!==w||L===h6(t)||D.every(e=>h6(e.placement)!==L||e.overflows[0]>0)))return{data:{index:e,overflows:D},reset:{placement:t}};let n=null==(i=D.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:i.placement;if(!n)switch(k){case"bestFit":{let e=null==(o=D.filter(e=>{if(R){let t=h6(e.placement);return t===L||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:o[0];e&&(n=e);break}case"initialPlacement":n=g}if(f!==n)return{reset:{placement:n}}}return{}}}).name,fn:w.fn,options:[u,c]},{name:(x={name:"shift",options:b=f={padding:8},async fn(e){let{x:t,y:n,placement:r,platform:i}=e,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=h0(b,e),d={x:t,y:n},u=await i.detectOverflow(e,l),c=h6(r),h=h8(c),f=d[h],p=d[c],m=(e,t)=>hK(t+u["y"===e?"top":"left"],hX(t,t-u["y"===e?"bottom":"right"]));o&&(f=m(h,f)),a&&(p=m(c,p));let g=s.fn({...e,[h]:f,[c]:p});return{...g,data:{x:g.x-t,y:g.y-n,enabled:{[h]:o,[c]:a}}}}}).name,fn:x.fn,options:[f,p]}],whileElementsMounted:fG}),{getReferenceProps:D,getFloatingProps:j}=(k=(v=[function(e,t){void 0===t&&(t={});let{open:n,onOpenChange:r,dataRef:i,events:o,elements:a}=e,{enabled:s=!0,delay:l=0,handleClose:d=null,mouseOnly:u=!1,restMs:c=0,move:h=!0}=t,f=g.useContext(pD),p=pj(),m=pw(d),b=pw(l),v=pw(n),y=pw(c),w=g.useRef(),x=g.useRef(-1),k=g.useRef(),S=g.useRef(-1),C=g.useRef(!0),A=g.useRef(!1),E=g.useRef(()=>{}),L=g.useRef(!1),_=pk(()=>{var e;let t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t});g.useEffect(()=>{if(s)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{open:t}=e;t||(pO(x),pO(S),C.current=!0,L.current=!1)}},[s,o]),g.useEffect(()=>{if(!s||!m.current||!n)return;function e(e){_()&&r(!1,e,"hover")}let t=pg(a.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[a.floating,n,r,s,m,_]);let N=g.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");let i=pB(b.current,"close",w.current);i&&!k.current?(pO(x),x.current=window.setTimeout(()=>r(!1,e,n),i)):t&&(pO(x),r(!1,e,n))},[b,r]),T=pk(()=>{E.current(),k.current=void 0}),R=pk(()=>{if(A.current){let e=pg(a.floating).body;e.style.pointerEvents="",e.removeAttribute(pz),A.current=!1}}),M=pk(()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type));g.useEffect(()=>{if(s&&ff(a.domReference)){let r=a.domReference,i=a.floating;return n&&r.addEventListener("mouseleave",o),h&&r.addEventListener("mousemove",e,{once:!0}),r.addEventListener("mouseenter",e),r.addEventListener("mouseleave",t),i&&(i.addEventListener("mouseleave",o),i.addEventListener("mouseenter",l),i.addEventListener("mouseleave",d)),()=>{n&&r.removeEventListener("mouseleave",o),h&&r.removeEventListener("mousemove",e),r.removeEventListener("mouseenter",e),r.removeEventListener("mouseleave",t),i&&(i.removeEventListener("mouseleave",o),i.removeEventListener("mouseenter",l),i.removeEventListener("mouseleave",d))}}function e(e){if(pO(x),C.current=!1,u&&!pv(w.current)||pH(y.current)>0&&!pB(b.current,"open"))return;let t=pB(b.current,"open",w.current);t?x.current=window.setTimeout(()=>{v.current||r(!0,e,"hover")},t):n||r(!0,e,"hover")}function t(e){if(M())return void R();E.current();let t=pg(a.floating);if(pO(S),L.current=!1,m.current&&i.current.floatingContext){n||pO(x),k.current=m.current({...i.current.floatingContext,tree:f,x:e.clientX,y:e.clientY,onClose(){R(),T(),M()||N(e,!0,"safe-polygon")}});let r=k.current;t.addEventListener("mousemove",r),E.current=()=>{t.removeEventListener("mousemove",r)};return}"touch"===w.current&&pf(a.floating,e.relatedTarget)||N(e)}function o(e){M()||i.current.floatingContext&&(null==m.current||m.current({...i.current.floatingContext,tree:f,x:e.clientX,y:e.clientY,onClose(){R(),T(),M()||N(e)}})(e))}function l(){pO(x)}function d(e){M()||N(e,!1)}},[a,s,e,u,h,N,T,R,r,n,v,f,b,m,i,M,y]),py(()=>{var e,t;if(s&&n&&null!=(e=m.current)&&null!=(e=e.__options)&&e.blockPointerEvents&&_()){A.current=!0;let e=a.floating;if(ff(a.domReference)&&e){let n=pg(a.floating).body;n.setAttribute(pz,"");let r=a.domReference,i=null==f||null==(t=f.nodesRef.current.find(e=>e.id===p))||null==(t=t.context)?void 0:t.elements.floating;return i&&(i.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}},[s,n,p,a,f,m,_]),py(()=>{n||(w.current=void 0,L.current=!1,T(),R())},[n,T,R]),g.useEffect(()=>()=>{T(),pO(x),pO(S),R()},[s,a.domReference,T,R]);let P=g.useMemo(()=>{function e(e){w.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){C.current||v.current||r(!0,t,"hover")}u&&!pv(w.current)||n||0===pH(y.current)||L.current&&e.movementX**2+e.movementY**2<2||(pO(S),"touch"===w.current?i():(L.current=!0,S.current=window.setTimeout(i,pH(y.current))))}}},[u,r,n,v,y]);return g.useMemo(()=>s?{reference:P}:{},[s,P])}(I.context,{delay:{open:200,close:80},handleClose:function(e){void 0===e&&(e={});let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i={current:-1},o=!1,a=null,s=null,l="u">typeof performance?performance.now():0,d=e=>{let{x:n,y:d,placement:u,elements:c,onClose:h,nodeId:f,tree:p}=e;return function(e){function m(){pO(i),h()}if(pO(i),!c.domReference||!c.floating||null==u||null==n||null==d)return;let{clientX:g,clientY:b}=e,v=[g,b],y="composedPath"in e?e.composedPath()[0]:e.target,w="mouseleave"===e.type,x=pU(c.floating,y),k=pU(c.domReference,y),S=c.domReference.getBoundingClientRect(),C=c.floating.getBoundingClientRect(),A=u.split("-")[0],E=n>C.right-C.width/2,L=d>C.bottom-C.height/2,_=v[0]>=S.x&&v[0]<=S.x+S.width&&v[1]>=S.y&&v[1]<=S.y+S.height,N=C.width>S.width,T=C.height>S.height,R=(N?S:C).left,M=(N?S:C).right,P=(T?S:C).top,I=(T?S:C).bottom;if(x&&(o=!0,!w))return;if(k&&(o=!1),k&&!w){o=!0;return}if(w&&ff(e.relatedTarget)&&pU(c.floating,e.relatedTarget)||p&&function e(t,n,r){return void 0===r&&(r=!0),t.filter(e=>{var t;return e.parentId===n&&(!r||(null==(t=e.context)?void 0:t.open))}).flatMap(n=>[n,...e(t,n.id,r)])}(p.nodesRef.current,f).length)return;if("top"===A&&d>=S.bottom-1||"bottom"===A&&d<=S.top+1||"left"===A&&n>=S.right-1||"right"===A&&n<=S.left+1)return m();let D=[];switch(A){case"top":D=[[R,S.top+1],[R,C.bottom-1],[M,C.bottom-1],[M,S.top+1]];break;case"bottom":D=[[R,C.top+1],[R,S.bottom-1],[M,S.bottom-1],[M,C.top+1]];break;case"left":D=[[C.right-1,I],[C.right-1,P],[S.left+1,P],[S.left+1,I]];break;case"right":D=[[S.right-1,I],[S.right-1,P],[C.left+1,P],[C.left+1,I]]}if(!p1([g,b],D)){if(o&&!_)return m();if(!w&&r){let t=function(e,t){let n=performance.now(),r=n-l;if(null===a||null===s||0===r)return a=e,s=t,l=n,null;let i=e-a,o=t-s,d=Math.sqrt(i*i+o*o);return a=e,s=t,l=n,d/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return m()}p1([g,b],function(e){let[n,r]=e;switch(A){case"top":{let e=[[C.left,E||N?C.bottom-t:C.top],[C.right,E?N?C.bottom-t:C.top:C.bottom-t]];return[[N?n+t/2:E?n+4*t:n-4*t,r+t+1],[N?n-t/2:E?n+4*t:n-4*t,r+t+1],...e]}case"bottom":{let e=[[C.left,E||N?C.top+t:C.bottom],[C.right,E?N?C.top+t:C.bottom:C.top+t]];return[[N?n+t/2:E?n+4*t:n-4*t,r-t],[N?n-t/2:E?n+4*t:n-4*t,r-t],...e]}case"left":return[[L||T?C.right-t:C.left,C.top],[L?T?C.right-t:C.left:C.right-t,C.bottom],[n+t+1,T?r+t/2:L?r+4*t:r-4*t],[n+t+1,T?r-t/2:L?r+4*t:r-4*t]];case"right":{let e=[[L||T?C.left+t:C.right,C.top],[L?T?C.left+t:C.right:C.left+t,C.bottom]];return[[n-t,T?r+t/2:L?r+4*t:r-4*t],[n-t,T?r-t/2:L?r+4*t:r-4*t],...e]}}}([n,d]))?!o&&r&&(i.current=window.setTimeout(m,40)):m()}}};return d.__options={blockPointerEvents:n},d}()}),function(e,t){void 0===t&&(t={});let{open:n,onOpenChange:r,events:i,dataRef:o,elements:a}=e,{enabled:s=!0,visibleOnly:l=!0}=t,d=g.useRef(!1),u=g.useRef(-1),c=g.useRef(!0);g.useEffect(()=>{if(!s)return;let e=fu(a.domReference);function t(){!n&&fp(a.domReference)&&a.domReference===ph(pg(a.domReference))&&(d.current=!0)}function r(){c.current=!0}function i(){c.current=!1}return e.addEventListener("blur",t),pZ()&&(e.addEventListener("keydown",r,!0),e.addEventListener("pointerdown",i,!0)),()=>{e.removeEventListener("blur",t),pZ()&&(e.removeEventListener("keydown",r,!0),e.removeEventListener("pointerdown",i,!0))}},[a.domReference,n,s]),g.useEffect(()=>{if(s)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{reason:t}=e;("reference-press"===t||"escape-key"===t)&&(d.current=!0)}},[i,s]),g.useEffect(()=>()=>{pO(u)},[]);let h=g.useMemo(()=>({onMouseLeave(){d.current=!1},onFocus(e){if(d.current)return;let t=pp(e.nativeEvent);if(l&&ff(t)){if(pZ()&&!e.relatedTarget){if(!c.current&&!(fp(t)&&t.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")))return}else if(!function(e){let t;if(!e||((t=navigator.userAgentData)&&Array.isArray(t.brands)?t.brands.map(e=>{let{brand:t,version:n}=e;return t+"/"+n}).join(" "):navigator.userAgent).includes("jsdom/"))return!0;try{return e.matches(":focus-visible")}catch(e){return!0}}(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){d.current=!1;let t=e.relatedTarget,n=e.nativeEvent,i=ff(t)&&t.hasAttribute(p$("focus-guard"))&&"outside"===t.getAttribute("data-type");u.current=window.setTimeout(()=>{var e;let s=ph(a.domReference?a.domReference.ownerDocument:document);!t&&s===a.domReference||pf(null==(e=o.current.floatingContext)?void 0:e.refs.floating.current,s)||pf(a.domReference,s)||i||r(!1,n,"focus")})}}),[o,a.domReference,r,l]);return g.useMemo(()=>s?{reference:h}:{},[s,h])}(I.context),function(e,t){void 0===t&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:o}=e,{enabled:a=!0,escapeKey:s=!0,outsidePress:l=!0,outsidePressEvent:d="pointerdown",referencePress:u=!1,referencePressEvent:c="pointerdown",ancestorScroll:h=!1,bubbles:f,capture:p}=t,m=g.useContext(pD),b=pk("function"==typeof l?l:()=>!1),v="function"==typeof l?b:l,y=g.useRef(!1),{escapeKey:w,outsidePress:x}=pQ(f),{escapeKey:k,outsidePress:S}=pQ(p),C=g.useRef(!1),A=pk(e=>{var t;if(!n||!a||!s||"Escape"!==e.key||C.current)return;let i=null==(t=o.current.floatingContext)?void 0:t.nodeId,l=m?pb(m.nodesRef.current,i):[];if(!w&&(e.stopPropagation(),l.length>0)){let e=!0;if(l.forEach(t=>{var n;if(null!=(n=t.context)&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles){e=!1;return}}),!e)return}r(!1,"nativeEvent"in e?e.nativeEvent:e,"escape-key")}),E=pk(e=>{var t;let n=()=>{var t;A(e),null==(t=pp(e))||t.removeEventListener("keydown",n)};null==(t=pp(e))||t.addEventListener("keydown",n)}),L=pk(e=>{var t;let n=o.current.insideReactTree;o.current.insideReactTree=!1;let a=y.current;if(y.current=!1,"click"===d&&a||n||"function"==typeof v&&!v(e))return;let s=pp(e),l="["+p$("inert")+"]",u=pg(i.floating).querySelectorAll(l),c=ff(s)?s:null;for(;c&&!fS(c);){let e=fE(c);if(fS(e)||!ff(e))break;c=e}if(u.length&&ff(s)&&!s.matches("html,body")&&!pf(s,i.floating)&&Array.from(u).every(e=>!pf(c,e)))return;if(fp(s)&&T){let t=fS(s),n=fC(s),r=/auto|scroll/,i=t||r.test(n.overflowX),o=t||r.test(n.overflowY),a=i&&s.clientWidth>0&&s.scrollWidth>s.clientWidth,l=o&&s.clientHeight>0&&s.scrollHeight>s.clientHeight,d="rtl"===n.direction,u=l&&(d?e.offsetX<=s.offsetWidth-s.clientWidth:e.offsetX>s.clientWidth),c=a&&e.offsetY>s.clientHeight;if(u||c)return}let h=null==(t=o.current.floatingContext)?void 0:t.nodeId,f=m&&pb(m.nodesRef.current,h).some(t=>{var n;return pm(e,null==(n=t.context)?void 0:n.elements.floating)});if(pm(e,i.floating)||pm(e,i.domReference)||f)return;let p=m?pb(m.nodesRef.current,h):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;if(null!=(n=t.context)&&n.open&&!t.context.dataRef.current.__outsidePressBubbles){e=!1;return}}),!e)return}r(!1,e,"outside-press")}),_=pk(e=>{var t;let n=()=>{var t;L(e),null==(t=pp(e))||t.removeEventListener(d,n)};null==(t=pp(e))||t.addEventListener(d,n)});g.useEffect(()=>{if(!n||!a)return;o.current.__escapeKeyBubbles=w,o.current.__outsidePressBubbles=x;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function l(){window.clearTimeout(e),C.current=!0}function u(){e=window.setTimeout(()=>{C.current=!1},5*!!fk())}let c=pg(i.floating);s&&(c.addEventListener("keydown",k?E:A,k),c.addEventListener("compositionstart",l),c.addEventListener("compositionend",u)),v&&c.addEventListener(d,S?_:L,S);let f=[];return h&&(ff(i.domReference)&&(f=fL(i.domReference)),ff(i.floating)&&(f=f.concat(fL(i.floating))),!ff(i.reference)&&i.reference&&i.reference.contextElement&&(f=f.concat(fL(i.reference.contextElement)))),(f=f.filter(e=>{var t;return e!==(null==(t=c.defaultView)?void 0:t.visualViewport)})).forEach(e=>{e.addEventListener("scroll",t)}),()=>{s&&(c.removeEventListener("keydown",k?E:A,k),c.removeEventListener("compositionstart",l),c.removeEventListener("compositionend",u)),v&&c.removeEventListener(d,S?_:L,S),f.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[o,i,s,v,d,n,r,h,a,w,x,A,k,E,L,S,_]),g.useEffect(()=>{o.current.insideReactTree=!1},[o,v,d]);let N=g.useMemo(()=>({onKeyDown:A,...u&&{[pY[c]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==c&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}}),[A,r,u,c]),T=g.useMemo(()=>{function e(e){0===e.button&&(y.current=!0)}return{onKeyDown:A,onMouseDown:e,onMouseUp:e,[pJ[d]]:()=>{o.current.insideReactTree=!0}}},[A,d,o]);return g.useMemo(()=>a?{reference:N,floating:T}:{},[a,N,T])}(I.context)]).map(e=>null==e?void 0:e.reference),S=v.map(e=>null==e?void 0:e.floating),C=v.map(e=>null==e?void 0:e.item),A=g.useCallback(e=>p0(e,v,"reference"),k),E=g.useCallback(e=>p0(e,v,"floating"),S),L=g.useCallback(e=>p0(e,v,"item"),C),g.useMemo(()=>({getReferenceProps:A,getFloatingProps:E,getItemProps:L}),[A,E,L])),{isMounted:$,status:O}=function(e,t){void 0===t&&(t={});let{open:n,elements:{floating:r}}=e,{duration:i=250}=t,o=("number"==typeof i?i:i.close)||0,[a,s]=g.useState("unmounted"),l=function(e,t){let[n,r]=g.useState(e);return e&&!n&&r(!0),g.useEffect(()=>{if(!e&&n){let e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}(n,o);return l||"close"!==a||s("unmounted"),py(()=>{if(r){if(n){s("initial");let e=requestAnimationFrame(()=>{rE.flushSync(()=>{s("open")})});return()=>{cancelAnimationFrame(e)}}s("close")}},[n,r]),{isMounted:l,status:a}}(I.context,{duration:150});return(0,g.useEffect)(()=>{if(!N||R||!l)return;let t=!0;return M({loading:!0,data:null}),l(e.hash).then(e=>t&&M({loading:!1,data:e})).catch(()=>t&&M({loading:!1,data:null})),()=>{t=!1}},[N,R,l,e.hash]),(0,m.jsxs)("li",{children:[(0,m.jsxs)("button",{ref:I.refs.setReference,type:"button","aria-current":a?"true":void 0,className:ry("relative flex w-full items-stretch rounded-md text-left transition-colors","focus-visible:ring-primary-500/40 outline-none focus-visible:ring-2",a?"bg-active":"hover:bg-active"),style:{height:30},...D({onClick:()=>s?.(e.hash)}),children:[(0,m.jsx)("div",{className:"relative z-10",children:(0,m.jsx)(mr,{row:t,width:n,isHead:i,topStub:o})}),(0,m.jsxs)("div",{className:"relative z-10 flex min-w-0 flex-1 items-center gap-1.5 pr-2 pl-1.5",children:[(0,m.jsx)("span",{className:ry("truncate text-[13px] transition-colors",P?"color-faint font-normal":"color-base font-medium"),title:e.subject,children:e.subject}),_.map((e,n)=>(0,m.jsx)(mi,{refToken:e,color:t.color},n))]})]}),$&&(0,m.jsx)(pX,{children:(0,m.jsx)("div",{ref:I.refs.setFloating,style:I.floatingStyles,"data-af-animate":!0,"data-state":"open"===O?"open":"closed",className:"border-base bg-base z-tooltip w-80 overflow-hidden rounded-lg border shadow-lg",...j(),children:(0,m.jsx)(ma,{commit:e,detail:R,onOpen:()=>{s?.(e.hash),T(!1)}})})})]})});function ml({col:e,color:t,gutter:n,changes:r}){return(0,m.jsxs)("li",{className:"relative flex items-stretch",style:{height:30},children:[(0,m.jsx)("div",{className:"relative z-10",children:(0,m.jsxs)("svg",{width:n,height:30,className:"block shrink-0",style:{overflow:"visible"},"aria-hidden":!0,children:[(0,m.jsx)("path",{d:mn(e,15,e,30),fill:"none",stroke:t,strokeWidth:2,strokeDasharray:"2 3",strokeLinecap:"round"}),(0,m.jsx)("circle",{cx:mt(e),cy:15,r:4,className:"fill-white dark:fill-[#111]",stroke:t,strokeWidth:2,strokeDasharray:"2 2"})]})}),(0,m.jsxs)("div",{className:"relative z-10 flex min-w-0 flex-1 items-center gap-2 pr-2 pl-1.5",children:[(0,m.jsx)(rC,{name:"i-ph-pencil-simple-duotone",className:"color-muted size-3.5 shrink-0"}),(0,m.jsx)("span",{className:"text-[13px] font-medium",children:"Work in Progress"}),(0,m.jsxs)("span",{className:"color-muted text-xs",children:[r," ",1===r?"change":"changes"]})]})]})}function md(e){let{rpcConnected:t,isRepo:n,commits:r,hasMore:i,loading:o,error:a,selectedRef:s,currentBranch:l,workingChanges:d,selectedHash:u,onRefresh:c,onLoadMore:h,onSelectCommit:f,onLoadDetail:p}=e,b=(0,g.useMemo)(()=>(function(e){let t=[],n=0,r=()=>p2[n++%p2.length],i=()=>{let e=t.indexOf(null);return -1===e?t.length:e},o=[];for(let n of e){let e,{hash:a}=n,s=n.parents,l=[];for(let e=0;e<t.length;e++){let n=t[e];n&&l.push({col:e,hash:n.hash,color:n.color})}let d=t.findIndex(e=>e?.hash===a);-1===d?(d=i(),e=r()):e=t[d].color;for(let e=0;e<t.length;e++)t[e]?.hash===a&&(t[e]=null);t[d]=null;let u=[];for(s.forEach((n,o)=>{if(0===o){t[d]={hash:n,color:e},u.push({col:d,color:e});return}let a=t.findIndex(e=>e?.hash===n);-1===a&&(t[a=i()]={hash:n,color:r()}),u.push({col:a,color:t[a].color})}),0===s.length&&(t[d]=null);t.length>0&&null==t[t.length-1];)t.pop();let c=l.map(e=>({from:e.col,to:e.hash===a?d:e.col,color:e.color})),h=[];for(let e of l)e.hash!==a&&h.push({from:e.col,to:e.col,color:e.color});for(let e of u)h.push({from:d,to:e.col,color:e.color});o.push({col:d,color:e,topLinks:c,bottomLinks:h})}let a=0;for(let e of o){for(let t of(a=Math.max(a,e.col+1),e.topLinks))a=Math.max(a,t.from+1,t.to+1);for(let t of e.bottomLinks)a=Math.max(a,t.from+1,t.to+1)}return{rows:o,columns:a}})(r),[r]),v=15*Math.max(b.columns,1)+7.5+8,y=(d??0)>0&&r.length>0&&(!s||s===l),w=b.rows[0],x=(0,g.useRef)(null),k=(0,g.useRef)(null),S=(0,g.useRef)(!1),C=(0,g.useRef)(h);return C.current=h,(0,g.useEffect)(()=>{o||(S.current=!1)},[o]),(0,g.useEffect)(()=>{let e=x.current,t=k.current;if(!e||!t||!i)return;let n=new IntersectionObserver(e=>{!e[0]?.isIntersecting||S.current||o||(S.current=!0,C.current())},{root:e,rootMargin:"120px"});return n.observe(t),()=>n.disconnect()},[i,o,r.length]),(0,m.jsxs)("div",{className:"flex h-full min-h-0 flex-col gap-2",children:[(0,m.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,m.jsxs)("div",{className:"flex min-w-0 items-baseline gap-2.5",children:[(0,m.jsx)("h2",{className:"text-lg leading-none font-semibold tracking-tight",children:"Commit History"}),(0,m.jsx)("span",{className:"color-muted shrink-0 text-xs tabular-nums",children:n?`${r.length}${i?"+":""}${s?` \xb7 ${s}`:""}`:""})]}),(0,m.jsx)(rk,{variant:"ghost",size:"sm",onClick:c,disabled:o,"aria-label":"Refresh log",children:(0,m.jsx)(rC,{name:"i-ph-arrows-clockwise",className:ry("size-4",o&&"animate-spin")})})]}),!t&&(0,m.jsx)("div",{className:"space-y-1.5",children:Array.from({length:6}).map((e,t)=>(0,m.jsx)(il,{className:"h-8 w-full"},t))}),a&&(0,m.jsx)("p",{className:"text-error text-sm",children:a}),!1===n&&(0,m.jsx)("p",{className:"color-muted text-sm",children:"The working directory is not a git repository."}),!0===n&&0===r.length&&(0,m.jsx)("p",{className:"color-muted text-sm",children:"No commits yet."}),!0===n&&r.length>0&&(0,m.jsxs)("div",{ref:x,className:"min-h-0 flex-1 overflow-y-auto pr-1",children:[(0,m.jsxs)("ul",{children:[y&&w&&(0,m.jsx)(ml,{col:w.col,color:w.color,gutter:v,changes:d??0}),r.map((e,t)=>(0,m.jsx)(ms,{commit:e,row:b.rows[t],gutter:v,currentBranch:l,isHead:0===t,topStub:0===t&&y,selected:e.hash===u,onSelect:f,onLoadDetail:p},e.hash))]}),i&&(0,m.jsxs)("div",{ref:k,className:"color-muted flex items-center justify-center gap-2 py-3 text-xs",children:[(0,m.jsx)(rC,{name:"i-ph-spinner-gap",className:"size-3.5 animate-spin"}),"Loading more…"]})]})]})}function mu({branch:e,selectedHash:t,onSelectCommit:n}){let{rpc:r}=ni(),[i,o]=(0,g.useState)(null),[a,s]=(0,g.useState)([]),[l,d]=(0,g.useState)(0),[u,c]=(0,g.useState)(!1),[h,f]=(0,g.useState)(!1),[p,b]=(0,g.useState)(null),[v,y]=(0,g.useState)(null),[w,x]=(0,g.useState)(null),k=(0,g.useRef)([]);(0,g.useEffect)(()=>{k.current=a},[a]);let S=(0,g.useCallback)(async(t,n,r)=>{f(!0),b(null);try{let i=await t.call("devframes:plugin:git:log",{limit:30,skip:n,ref:e??void 0});if(o(i.isRepo),"replace"===r)s(i.commits),d(i.commits.length);else{let e=new Set(k.current.map(e=>e.hash)),t=i.commits.filter(t=>!e.has(t.hash)&&(e.add(t.hash),!0));if(0===t.length)return void c(!1);s(e=>[...e,...t]),d(e=>e+t.length)}c(i.hasMore)}catch(e){b(e instanceof Error?e.message:String(e))}finally{f(!1)}},[e]),C=(0,g.useCallback)(async e=>{try{let t=await e.call("devframes:plugin:git:status");y(t.branch),x(t.staged.length+t.unstaged.length+t.untracked.length)}catch{}},[]);(0,g.useEffect)(()=>{r&&(S(r,0,"replace"),C(r))},[r,S,C]);let A=(0,g.useCallback)(async()=>{r&&await Promise.all([S(r,0,"replace"),C(r)])},[r,S,C]),E=(0,g.useCallback)(async()=>{r&&await S(r,l,"append")},[r,l,S]),L=(0,g.useCallback)(e=>r?r.call("devframes:plugin:git:show",{hash:e,patch:!1}):Promise.reject(Error("rpc unavailable")),[r]);return(0,m.jsx)(md,{rpcConnected:!!r,isRepo:i,commits:a,hasMore:u,loading:h,error:p,selectedRef:e??null,currentBranch:v,workingChanges:w,selectedHash:t,onRefresh:A,onLoadMore:E,onSelectCommit:n,onLoadDetail:r?L:void 0})}function mc({className:e,...t}){return(0,m.jsx)("textarea",{"data-slot":"textarea",className:ry("border-base placeholder:color-muted focus-visible:ring-primary-500/40 flex min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t})}function mh(e,t){return`${t}:${e}`}function mf({entry:e,staged:t,selected:n,action:r,onSelect:i}){let o=e.from?`${e.from} → ${e.path}`:e.path;return(0,m.jsxs)("li",{className:ry("group flex items-center gap-1 rounded pr-1 transition-colors",n?"bg-active":"hover:bg-active"),children:[(0,m.jsxs)("button",{type:"button",onClick:()=>i?.(e.path,t),className:"flex min-w-0 flex-1 items-center gap-1.5 py-0.5 pl-1 text-left text-xs outline-none",children:[(0,m.jsx)(ic,{code:e.status}),(0,m.jsx)(rA,{path:e.path,className:"size-4"}),(0,m.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono",title:o,children:o})]}),r]})}function mp({title:e,count:t,headerAction:n,children:r}){return 0===t?null:(0,m.jsxs)("div",{className:"space-y-1",children:[(0,m.jsxs)("div",{className:"flex items-center justify-between",children:[(0,m.jsxs)("div",{className:"color-muted flex items-center gap-2 text-xs font-medium tracking-wide uppercase",children:[e,(0,m.jsx)(rw,{variant:"secondary",className:"px-1.5 py-0 text-[10px] tabular-nums",children:t})]}),n]}),(0,m.jsx)("ul",{children:r})]})}function mm(e){let{data:t,loading:n,busy:r,canWrite:i,message:o,note:a,selectedKey:s,onRefresh:l,onStage:d,onUnstage:u,onCommit:c,onMessageChange:h,onSelectFile:f,patchSlot:p}=e,g=(e,t)=>(0,m.jsx)(rk,{variant:"ghost",size:"sm",disabled:r,"aria-label":t,onClick:()=>d(e),children:(0,m.jsx)(rC,{name:"i-ph-plus",className:"size-4"})});return(0,m.jsxs)("div",{className:"flex h-full min-h-0 flex-col gap-3",children:[(0,m.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-2",children:[(0,m.jsxs)("div",{className:"flex min-w-0 items-baseline gap-2.5",children:[(0,m.jsx)("h2",{className:"text-lg leading-none font-semibold tracking-tight",children:"Changes"}),t?.isRepo&&!t.clean&&(0,m.jsxs)("span",{className:"color-muted shrink-0 text-xs tabular-nums",children:[t.staged.length+t.unstaged.length+t.untracked.length," ","changed"]})]}),(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[t?.isRepo&&(t.ahead>0||t.behind>0)&&(0,m.jsxs)(rw,{variant:"secondary",className:"gap-1 font-mono",children:[t.ahead>0&&(0,m.jsxs)("span",{className:"text-success inline-flex items-center tabular-nums",children:[(0,m.jsx)(rC,{name:"i-ph-arrow-up",className:"size-3"}),t.ahead]}),t.behind>0&&(0,m.jsxs)("span",{className:"text-warning inline-flex items-center tabular-nums",children:[(0,m.jsx)(rC,{name:"i-ph-arrow-down",className:"size-3"}),t.behind]})]}),(0,m.jsx)(rk,{variant:"ghost",size:"sm",onClick:l,disabled:n||r,"aria-label":"Refresh status",children:(0,m.jsx)(rC,{name:"i-ph-arrows-clockwise",className:`size-4 ${n?"animate-spin":""}`})})]})]}),!t&&(0,m.jsx)("div",{className:"space-y-2",children:Array.from({length:4}).map((e,t)=>(0,m.jsx)(il,{className:"h-6 w-full"},t))}),t&&!t.isRepo&&(0,m.jsx)("p",{className:"color-muted text-sm",children:"The working directory is not a git repository."}),t?.isRepo&&t.clean&&(0,m.jsx)("p",{className:"color-muted text-sm",children:"Nothing to commit. The working tree is clean."}),t?.isRepo&&!t.clean&&(0,m.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3",children:[(0,m.jsx)(ia,{className:"min-h-0 flex-1 pr-3",children:(0,m.jsxs)("div",{className:"space-y-4",children:[(0,m.jsx)(mp,{title:"Staged",count:t.staged.length,headerAction:i&&t.staged.length>0?(0,m.jsx)(rx,{variant:"ghost",size:"sm",disabled:r,onClick:()=>u(t.staged.map(e=>e.path)),children:"Unstage all"}):void 0,children:t.staged.map(e=>{let t,n;return(0,m.jsx)(mf,{entry:e,staged:!0,selected:s===mh(e.path,!0),onSelect:f,action:i?(t=[e.path],n=`Unstage ${e.path}`,(0,m.jsx)(rk,{variant:"ghost",size:"sm",disabled:r,"aria-label":n,onClick:()=>u(t),children:(0,m.jsx)(rC,{name:"i-ph-minus",className:"size-4"})})):void 0},`s:${e.path}`)})}),(0,m.jsx)(mp,{title:"Unstaged",count:t.unstaged.length,headerAction:i&&t.unstaged.length>0?(0,m.jsx)(rx,{variant:"ghost",size:"sm",disabled:r,onClick:()=>d(t.unstaged.map(e=>e.path)),children:"Stage all"}):void 0,children:t.unstaged.map(e=>(0,m.jsx)(mf,{entry:e,staged:!1,selected:s===mh(e.path,!1),onSelect:f,action:i?g([e.path],`Stage ${e.path}`):void 0},`u:${e.path}`))}),(0,m.jsx)(mp,{title:"Untracked",count:t.untracked.length,headerAction:i&&t.untracked.length>0?(0,m.jsx)(rx,{variant:"ghost",size:"sm",disabled:r,onClick:()=>d(t.untracked),children:"Stage all"}):void 0,children:t.untracked.map(e=>(0,m.jsx)(mf,{entry:{path:e,status:"unknown"},staged:!1,selected:s===mh(e,!1),onSelect:f,action:i?g([e],`Stage ${e}`):void 0},`t:${e}`))})]})}),p&&(0,m.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden rounded-md border",children:p}),i&&t.staged.length>0&&(0,m.jsxs)("div",{className:"shrink-0 space-y-2 border-t pt-3",children:[(0,m.jsx)(mc,{value:o,onChange:e=>h(e.target.value),placeholder:"Commit message",rows:2,disabled:r,"aria-label":"Commit message"}),a&&(0,m.jsx)("p",{className:"text-error text-xs",children:a}),(0,m.jsx)(rx,{size:"sm",className:"tabular-nums",onClick:c,disabled:r||0===o.trim().length,children:`Commit ${t.staged.length} file${1===t.staged.length?"":"s"}`})]})]})]})}function mg({staged:e,path:t}){let{data:n,loading:r}=na((0,g.useCallback)(n=>n.call("devframes:plugin:git:diff",{staged:e,path:t}),[e,t]));return(0,m.jsx)(hU,{patch:n?.patch??null,loading:r||!n,truncated:n?.truncated??!1})}function mb(){let{rpc:e}=ni(),{data:t,loading:n,refresh:r,setData:i}=na((0,g.useCallback)(e=>e.call("devframes:plugin:git:status"),[])),[o,a]=(0,g.useState)(!1),[s,l]=(0,g.useState)(""),[d,u]=(0,g.useState)(null),[c,h]=(0,g.useState)(null),f=!!t?.canWrite&&e?.connectionMeta.backend==="websocket",p=(0,g.useCallback)(async t=>{if(e&&0!==t.length){a(!0),u(null);try{i(await e.call("devframes:plugin:git:stage",{paths:t}))}finally{a(!1)}}},[e,i]),b=(0,g.useCallback)(async t=>{if(e&&0!==t.length){a(!0),u(null);try{i(await e.call("devframes:plugin:git:unstage",{paths:t}))}finally{a(!1)}}},[e,i]),v=(0,g.useCallback)(async()=>{if(e){a(!0),u(null);try{let t=await e.call("devframes:plugin:git:commit",{message:s});i(t.status),t.ok?l(""):u(t.message)}finally{a(!1)}}},[e,s,i]),y=(0,g.useCallback)((e,t)=>{h(n=>n&&n.path===e&&n.staged===t?null:{path:e,staged:t})},[]);return(0,m.jsx)(mm,{data:t,loading:n,busy:o,canWrite:!!f,message:s,note:d,selectedKey:c?`${c.staged}:${c.path}`:null,onRefresh:r,onStage:p,onUnstage:b,onCommit:v,onMessageChange:l,onSelectFile:y,patchSlot:c?(0,m.jsx)(mg,{staged:c.staged,path:c.path},`${c.staged}:${c.path}`):null})}let mv=[{id:"commits",label:"Commits",icon:"i-ph-git-commit-duotone"},{id:"changes",label:"Changes",icon:"i-ph-git-diff-duotone"}];function my(e,t,n){return Math.min(Math.max(e,t),n)}function mw({onPointerDown:e,label:t}){return(0,m.jsx)("div",{role:"separator","aria-orientation":"vertical","aria-label":t,onPointerDown:e,className:"group bg-[#8882] relative w-px shrink-0 cursor-col-resize",children:(0,m.jsx)("div",{className:"group-hover:bg-primary/40 group-active:bg-primary/60 absolute inset-y-0 -left-1 -right-1 z-10 transition-colors"})})}function mx(){let{rpc:e,status:t}=ni();if("error"===t||"disconnected"===t)return(0,m.jsx)(rw,{variant:"destructive",children:t});if("unauthorized"===t)return(0,m.jsx)(rw,{variant:"warning",children:"unauthorized"});if("connecting"===t||!e)return(0,m.jsx)(rw,{variant:"secondary",children:"connecting…"});let n=e.connectionMeta.backend;return(0,m.jsx)(rw,{variant:"websocket"===n?"success":"secondary",className:"font-mono",children:"websocket"===n?"live":"static"})}function mk(){let{theme:e,toggle:t}=function(){let[e,t]=(0,g.useState)("dark");return(0,g.useEffect)(()=>{t(function(){try{let e=localStorage.getItem(hz);return"light"===e||"dark"===e?e:null}catch{return null}}()??(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"))},[]),(0,g.useEffect)(()=>{document.documentElement.classList.toggle("dark","dark"===e)},[e]),{theme:e,toggle:function(){t(e=>{let t="dark"===e?"light":"dark";try{localStorage.setItem(hz,t)}catch{}return t})}}}();return(0,m.jsx)(rk,{variant:"ghost",size:"sm",onClick:t,"aria-label":"Toggle light/dark theme",children:(0,m.jsx)(rC,{name:"dark"===e?"i-ph-sun-duotone":"i-ph-moon-duotone",className:"size-4"})})}function mS({branches:e,disabled:t,value:n,onSelect:r}){return(0,m.jsxs)("label",{className:"border-base bg-base focus-within:ring-primary-500/40 flex h-7 min-w-0 items-center gap-1.5 rounded-md border pr-1.5 pl-2 focus-within:ring-2",children:[(0,m.jsx)(rC,{name:"i-ph-git-branch-duotone",className:"color-active size-3.5 shrink-0"}),(0,m.jsxs)("select",{"aria-label":"Branch",value:n??"",onChange:e=>r(e.target.value),disabled:t,className:"color-base h-full max-w-44 min-w-0 cursor-pointer appearance-none truncate bg-transparent pr-4 text-sm outline-none disabled:cursor-default",children:[!e?.isRepo&&(0,m.jsx)("option",{value:"",children:"Not a repository"}),e?.isRepo&&0===e.branches.length&&(0,m.jsx)("option",{value:"",children:"No branches"}),e?.isRepo&&e.branches.map(e=>(0,m.jsx)("option",{value:e.name,children:e.name},e.name))]}),(0,m.jsx)(rC,{name:"i-ph-caret-up-down",className:"color-faint pointer-events-none -ml-4 size-3.5 shrink-0"})]})}function mC(){let[e,t]=(0,g.useState)("commits"),[n,r]=(0,g.useState)(null),[i,o]=(0,g.useState)(null),a=function(e){let[t,n]=(0,g.useState)(480),r=(0,g.useRef)(480);return r.current=t,(0,g.useEffect)(()=>{try{let t=Number(localStorage.getItem(e));Number.isFinite(t)&&t>0&&n(my(t,340,760))}catch{}},[e,340,760]),{width:t,onPointerDown:(0,g.useCallback)(t=>{t.preventDefault();let i=t.clientX,o=r.current,a=e=>n(my(o+-1*(e.clientX-i),340,760)),s=()=>{window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",s),document.body.style.cursor="",document.body.style.userSelect="";try{localStorage.setItem(e,String(Math.round(r.current)))}catch{}};window.addEventListener("pointermove",a),window.addEventListener("pointerup",s),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[e,340,760,-1])}}("devframe-git:rail-right"),{data:s,loading:l}=na((0,g.useCallback)(e=>e.call("devframes:plugin:git:branches"),[]));(0,g.useEffect)(()=>{if(!s?.isRepo)return void r(null);let e=s.branches.map(e=>e.name),t=s.current??s.branches.find(e=>e.current)?.name??null;r(n=>n&&e.includes(n)?n:t??e[0]??null)},[s]);let d="commits"===e&&null!==i;return(0,m.jsxs)("div",{className:"bg-base flex h-svh w-full flex-col overflow-hidden",children:[(0,m.jsxs)("header",{className:b("flex items-center gap-2 shrink-0 h-10 px-3 border-b border-base bg-base z-nav",void 0),children:[(0,m.jsxs)("div",{className:b("flex items-center gap-1.5 shrink-0 font-semibold text-sm select-none",void 0),children:[(0,m.jsx)(rC,{name:"i-ph-git-fork-duotone",className:"text-base color-active"}),(0,m.jsx)("span",{children:"Git"})]}),(0,m.jsx)(mS,{branches:s,disabled:l||!s?.isRepo||0===s.branches.length,value:n,onSelect:e=>{r(e),o(null),t("commits")}}),(0,m.jsx)("nav",{className:b("inline-flex items-center gap-1 p-1 rounded-lg bg-secondary w-max",void 0),role:"tablist","aria-label":"Git views",children:mv.map(({id:n,label:r,icon:i})=>(0,m.jsxs)("button",{type:"button",role:"tab","aria-selected":e===n,"data-state":e===n?"active":"inactive",className:b("px-3 py-1 rounded-md text-sm color-muted inline-flex gap-1.5 items-center whitespace-nowrap select-none cursor-pointer transition outline-none hover:color-base focus-visible:ring-2 focus-visible:ring-primary-500/40 data-[state=active]:bg-base data-[state=active]:color-base data-[state=active]:shadow-sm",void 0),onClick:()=>t(n),children:[(0,m.jsx)(rC,{name:i,className:"size-4"}),r]},n))}),(0,m.jsx)("div",{className:"flex-1"}),(0,m.jsx)(mx,{}),(0,m.jsx)(mk,{})]}),(0,m.jsxs)("div",{className:"flex min-h-0 flex-1",children:[(0,m.jsxs)("section",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:["commits"===e&&(0,m.jsx)("div",{className:"flex min-h-0 flex-1 flex-col px-3 py-2.5",children:(0,m.jsx)(mu,{branch:n,selectedHash:i,onSelectCommit:o})}),"changes"===e&&(0,m.jsx)("div",{className:"flex min-h-0 flex-1 flex-col px-3 py-2.5",children:(0,m.jsx)(mb,{})})]}),d&&i&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(mw,{onPointerDown:a.onPointerDown,label:"Resize commit details"}),(0,m.jsx)("aside",{className:"flex min-h-0 flex-col p-3",style:{width:a.width},children:(0,m.jsx)(hW,{hash:i,onClose:()=>o(null)})})]})]})]})}function mA(){let{status:e,error:t}=ni();return"connected"!==e?(0,m.jsx)(hV,{status:e,error:t}):(0,m.jsx)(mC,{})}e.s(["Dashboard",0,function(){return(0,m.jsx)(no,{children:(0,m.jsx)(mA,{})})}],53567)}]);