diff --git "a/_next/static/chunks/960.ec54c3efd0889db1.js" "b/_next/static/chunks/960.ec54c3efd0889db1.js" deleted file mode 100644--- "a/_next/static/chunks/960.ec54c3efd0889db1.js" +++ /dev/null @@ -1,16 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[960],{1957:function(e,t,r){"use strict";r.d(t,{J:function(){return l}});var n=r(2265),o=r(2989),i=r(7470),a=r(2281);let s=e=>{let{color:t="black",size:r=24,...n}=e;return(0,a.jsx)(o.ny,{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...n,children:(0,a.jsx)(o.y$,{d:"M20 6 9 17l-5-5",stroke:t})})};s.displayName="Check";let l=(0,n.memo)((0,i.H)(s))},1569:function(e,t,r){"use strict";r.d(t,{_:function(){return l}});var n=r(2265),o=r(2989),i=r(7470),a=r(2281);let s=e=>{let{color:t="black",size:r=24,...n}=e;return(0,a.jsx)(o.ny,{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...n,children:(0,a.jsx)(o.y$,{d:"m6 9 6 6 6-6",stroke:t})})};s.displayName="ChevronDown";let l=(0,n.memo)((0,i.H)(s))},1378:function(e,t,r){"use strict";r.d(t,{K:function(){return l}});var n=r(2265),o=r(2989),i=r(7470),a=r(2281);let s=e=>{let{color:t="black",size:r=24,...n}=e;return(0,a.jsx)(o.ny,{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...n,children:(0,a.jsx)(o.y$,{d:"m18 15-6-6-6 6",stroke:t})})};s.displayName="ChevronUp";let l=(0,n.memo)((0,i.H)(s))},6916:function(e,t,r){"use strict";r.d(t,{l:function(){return l}});var n=r(2265),o=r(2989),i=r(7470),a=r(2281);let s=e=>{let{color:t="black",size:r=24,...n}=e;return(0,a.jsxs)(o.ny,{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...n,children:[(0,a.jsx)(o.y$,{d:"m5 8 6 6",stroke:t}),(0,a.jsx)(o.y$,{d:"m4 14 6-6 2-3",stroke:t}),(0,a.jsx)(o.y$,{d:"M2 5h12",stroke:t}),(0,a.jsx)(o.y$,{d:"M7 2h1",stroke:t}),(0,a.jsx)(o.y$,{d:"m22 22-5-10-5 10",stroke:t}),(0,a.jsx)(o.y$,{d:"M14 18h6",stroke:t})]})};s.displayName="Languages";let l=(0,n.memo)((0,i.H)(s))},8738:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,i=l(e),a=i[0],s=i[1],u=new o((a+s)*3/4-s),c=0,d=s>0?a-4:a;for(r=0;r>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=0,s=n-o;a>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return i.join("")}(e,a,a+16383>s?s:a+16383));return 1===o?i.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===o&&i.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=i.length;a0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},9109:function(e,t,r){"use strict";/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */var n=r(8738),o=r(6868),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function a(e){if(e>2147483647)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,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return c(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!s.isEncoding(t))throw TypeError("Unknown encoding: "+t);var r=0|p(e,t),n=a(r),o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(T(e,Uint8Array)){var t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(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(T(e,ArrayBuffer)||e&&T(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(T(e,SharedArrayBuffer)||e&&T(e.buffer,SharedArrayBuffer)))return f(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return s.from(n,t,r);var o=function(e){if(s.isBuffer(e)){var t,r=0|h(e.length),n=a(r);return 0===n.length||e.copy(n,0,0,r),n}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?a(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),a(e<0?0:0|h(e))}function d(e){for(var t=e.length<0?0:0|h(e.length),r=a(t),n=0;n=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function p(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||T(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 r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return R(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return C(e).length;default:if(o)return n?-1:R(e).length;t=(""+t).toLowerCase(),o=!0}}function m(e,t,r){var o,i,a=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=t;i2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),(i=r=+r)!=i&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return -1;r=e.length-1}else if(r<0){if(!o)return -1;r=0}if("string"==typeof t&&(t=s.from(t,n)),s.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,o);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,o);throw TypeError("val must be string, number or Buffer")}function v(e,t,r,n,o){var i,a=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;a=2,s/=2,l/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var c=-1;for(i=r;is&&(r=s-l),i=r;i>=0;i--){for(var d=!0,f=0;f239?4:u>223?3:u>191?2:1;if(o+d<=r)switch(d){case 1:u<128&&(c=u);break;case 2:(192&(i=e[o+1]))==128&&(l=(31&u)<<6|63&i)>127&&(c=l);break;case 3:i=e[o+1],a=e[o+2],(192&i)==128&&(192&a)==128&&(l=(15&u)<<12|(63&i)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:i=e[o+1],a=e[o+2],s=e[o+3],(192&i)==128&&(192&a)==128&&(192&s)==128&&(l=(15&u)<<18|(63&i)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,d=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),o+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var r="",n=0;nr)throw RangeError("Trying to access beyond buffer length")}function _(e,t,r,n,o,i){if(!s.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw RangeError("Index out of range")}function x(e,t,r,n,o,i){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function E(e,t,r,n,i){return t=+t,r>>>=0,i||x(e,t,r,4,34028234663852886e22,-34028234663852886e22),o.write(e,t,r,n,23,4),r+4}function S(e,t,r,n,i){return t=+t,r>>>=0,i||x(e,t,r,8,17976931348623157e292,-17976931348623157e292),o.write(e,t,r,n,52,8),r+8}t.lW=s,t.h2=50,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||"undefined"==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,r){return l(e,t,r)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(e,t,r){return(u(e),e<=0)?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)},s.allocUnsafe=function(e){return c(e)},s.allocUnsafeSlow=function(e){return c(e)},s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(T(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),T(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 r=e.length,n=t.length,o=0,i=Math.min(r,n);on.length?s.from(i).copy(n,o):Uint8Array.prototype.set.call(n,i,o);else if(s.isBuffer(i))i.copy(n,o);else throw TypeError('"list" argument must be an Array of Buffers');o+=i.length}return n},s.byteLength=p,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;tr&&(e+=" ... "),""},i&&(s.prototype[i]=s.prototype.inspect),s.prototype.compare=function(e,t,r,n,o){if(T(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===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,o>>>=0,this===e)return 0;for(var i=o-n,a=r-t,l=Math.min(i,a),u=this.slice(n,o),c=e.slice(t,r),d=0;d>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o,i,a,s,l,u,c,d,f=this.length-t;if((void 0===r||r>f)&&(r=f),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var h=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=t.length;n>i/2&&(n=i/2);for(var a=0;a>8,o.push(r%256),o.push(n);return o}(e,this.length-c),this,c,d);default:if(h)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),h=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},s.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||b(e,t,this.length);for(var n=this[e],o=1,i=0;++i>>=0,t>>>=0,r||b(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||b(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||b(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||b(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||b(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var n=this[e],o=1,i=0;++i=(o*=128)&&(n-=Math.pow(2,8*t)),n},s.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||b(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},s.prototype.readInt8=function(e,t){return(e>>>=0,t||b(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||b(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(e,t){e>>>=0,t||b(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||b(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||b(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||b(e,4,this.length),o.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||b(e,4,this.length),o.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||b(e,8,this.length),o.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||b(e,8,this.length),o.read(this,e,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){var o=Math.pow(2,8*r)-1;_(this,e,t,r,o,0)}var i=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,!n){var o=Math.pow(2,8*r)-1;_(this,e,t,r,o,0)}var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,4,4294967295,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=s.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,4,4294967295,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,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);_(this,e,t,r,o-1,-o)}var i=0,a=1,s=0;for(this[t]=255&e;++i>0)-s&255;return t+r},s.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var o=Math.pow(2,8*r-1);_(this,e,t,r,o-1,-o)}var i=r-1,a=1,s=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/a>>0)-s&255;return t+r},s.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,4,2147483647,-2147483648),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,r){return e=+e,t>>>=0,r||_(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+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,r){return E(this,e,t,!0,r)},s.prototype.writeFloatBE=function(e,t,r){return E(this,e,t,!1,r)},s.prototype.writeDoubleLE=function(e,t,r){return S(this,e,t,!0,r)},s.prototype.writeDoubleBE=function(e,t,r){return S(this,e,t,!1,r)},s.prototype.copy=function(e,t,r,n){if(!s.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!o){if(r>56319||a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return i}function C(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(k,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function A(e,t,r,n){for(var o=0;o=t.length)&&!(o>=e.length);++o)t[o+r]=e[o];return o}function T(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var M=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,o=0;o<16;++o)t[n+o]=e[r]+e[o];return t}()},7563:function(e){"use strict";function t(e){return function(){return e}}var r=function(){};r.thatReturns=t,r.thatReturnsFalse=t(!1),r.thatReturnsTrue=t(!0),r.thatReturnsNull=t(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},9895:function(e,t,r){"use strict";var n=r(7563);e.exports=n},6868:function(e,t){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */t.read=function(e,t,r,n,o){var i,a,s=8*o-n-1,l=(1<>1,c=-7,d=r?o-1:0,f=r?-1:1,h=e[t+d];for(d+=f,i=h&(1<<-c)-1,h>>=-c,c+=s;c>0;i=256*i+e[t+d],d+=f,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=n;c>0;a=256*a+e[t+d],d+=f,c-=8);if(0===i)i=1-u;else{if(i===l)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=u}return(h?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,s,l,u=8*i-o-1,c=(1<>1,f=23===o?5960464477539062e-23:0,h=n?0:i-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+d>=1?t+=f/l:t+=f*Math.pow(2,1-d),t*l>=2&&(a++,l/=2),a+d>=c?(s=0,a=c):a+d>=1?(s=(t*l-1)*Math.pow(2,o),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[r+h]=255&s,h+=p,s/=256,o-=8);for(a=a<0;e[r+h]=255&a,h+=p,a/=256,u-=8);e[r+h-p]|=128*m}},8464:function(e,t,r){!function(){var t={452:function(e){"use strict";e.exports=r(6405)}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var i=n[e]={exports:{}},a=!0;try{t[e](i,i.exports,o),a=!1}finally{a&&delete n[e]}return i.exports}o.ab="//";var i={};!function(){var e,t=(e=o(452))&&"object"==typeof e&&"default"in e?e.default:e,r=/https?|ftp|gopher|file/;function n(e){"string"==typeof e&&(e=y(e));var n,o,i,a,s,l,u,c,d,f=(o=(n=e).auth,i=n.hostname,a=n.protocol||"",s=n.pathname||"",l=n.hash||"",u=n.query||"",c=!1,o=o?encodeURIComponent(o).replace(/%3A/i,":")+"@":"",n.host?c=o+n.host:i&&(c=o+(~i.indexOf(":")?"["+i+"]":i),n.port&&(c+=":"+n.port)),u&&"object"==typeof u&&(u=t.encode(u)),d=n.search||u&&"?"+u||"",a&&":"!==a.substr(-1)&&(a+=":"),n.slashes||(!a||r.test(a))&&!1!==c?(c="//"+(c||""),s&&"/"!==s[0]&&(s="/"+s)):c||(c=""),l&&"#"!==l[0]&&(l="#"+l),d&&"?"!==d[0]&&(d="?"+d),{protocol:a,host:c,pathname:s=s.replace(/[?#]/g,encodeURIComponent),search:d=d.replace("#","%23"),hash:l});return""+f.protocol+f.host+f.pathname+f.search+f.hash}var a="http://",s=a+"w.w",l=/^([a-z0-9.+-]*:\/\/\/)([a-z0-9.+-]:\/*)?/i,u=/https?|ftp|gopher|file/;function c(e,t){var r="string"==typeof e?y(e):e;e="object"==typeof e?n(e):e;var o=y(t),i="";r.protocol&&!r.slashes&&(i=r.protocol,e=e.replace(r.protocol,""),i+="/"===t[0]||"/"===e[0]?"/":""),i&&o.protocol&&(i="",o.slashes||(i=o.protocol,t=t.replace(o.protocol,"")));var c=e.match(l);c&&!o.protocol&&(e=e.substr((i=c[1]+(c[2]||"")).length),/^\/\/[^/]/.test(t)&&(i=i.slice(0,-1)));var d=new URL(e,s+"/"),f=new URL(t,d).toString().replace(s,""),h=o.protocol||r.protocol;return h+=r.slashes||o.slashes?"//":"",!i&&h?f=f.replace(a,h):i&&(f=f.replace(a,"")),u.test(f)||~t.indexOf(".")||"/"===e.slice(-1)||"/"===t.slice(-1)||"/"!==f.slice(-1)||(f=f.slice(0,-1)),i&&(f=i+("/"===f[0]?f.substr(1):f)),f}function d(){}d.prototype.parse=y,d.prototype.format=n,d.prototype.resolve=c,d.prototype.resolveObject=c;var f=/^https?|ftp|gopher|file/,h=/^(.*?)([#?].*)/,p=/^([a-z0-9.+-]*:)(\/{0,3})(.*)/i,m=/^([a-z0-9.+-]*:)?\/\/\/*/i,g=/^([a-z0-9.+-]*:)(\/{0,2})\[(.*)\]$/i;function y(e,r,o){if(void 0===r&&(r=!1),void 0===o&&(o=!1),e&&"object"==typeof e&&e instanceof d)return e;var i=(e=e.trim()).match(h);e=i?i[1].replace(/\\/g,"/")+i[2]:e.replace(/\\/g,"/"),g.test(e)&&"/"!==e.slice(-1)&&(e+="/");var a=!/(^javascript)/.test(e)&&e.match(p),l=m.test(e),u="";a&&(f.test(a[1])||(u=a[1].toLowerCase(),e=""+a[2]+a[3]),a[2]||(l=!1,f.test(a[1])?(u=a[1],e=""+a[3]):e="//"+a[3]),3!==a[2].length&&1!==a[2].length||(u=a[1],e="/"+a[3]));var c,y=(i?i[1]:e).match(/^https?:\/\/[^/]+(:[0-9]+)(?=\/|$)/),v=y&&y[1],w=new d,b="",_="";try{c=new URL(e)}catch(t){b=t,u||o||!/^\/\//.test(e)||/^\/\/.+[@.]/.test(e)||(_="/",e=e.substr(1));try{c=new URL(e,s)}catch(e){return w.protocol=u,w.href=u,w}}w.slashes=l&&!_,w.host="w.w"===c.host?"":c.host,w.hostname="w.w"===c.hostname?"":c.hostname.replace(/(\[|\])/g,""),w.protocol=b?u||null:c.protocol,w.search=c.search.replace(/\\/g,"%5C"),w.hash=c.hash.replace(/\\/g,"%5C");var x=e.split("#");!w.search&&~x[0].indexOf("?")&&(w.search="?"),w.hash||""!==x[1]||(w.hash="#"),w.query=r?t.decode(c.search.substr(1)):w.search.substr(1),w.pathname=_+(a?c.pathname.replace(/['^|`]/g,function(e){return"%"+e.charCodeAt().toString(16).toUpperCase()}).replace(/((?:%[0-9A-F]{2})+)/g,function(e,t){try{return decodeURIComponent(t).split("").map(function(e){var t=e.charCodeAt();return t>256||/^[a-z0-9]$/i.test(e)?e:"%"+t.toString(16).toUpperCase()}).join("")}catch(e){return t}}):c.pathname),"about:"===w.protocol&&"blank"===w.pathname&&(w.protocol="",w.pathname=""),b&&"/"!==e[0]&&(w.pathname=w.pathname.substr(1)),u&&!f.test(u)&&"/"!==e.slice(-1)&&"/"===w.pathname&&(w.pathname=""),w.path=w.pathname+w.search,w.auth=[c.username,c.password].map(decodeURIComponent).filter(Boolean).join(":"),w.port=c.port,v&&!w.host.endsWith(v)&&(w.host+=v,w.port=v.slice(1)),w.href=_?""+w.pathname+w.search+w.hash:n(w);var E=/^(file)/.test(w.href)?["host","hostname"]:[];return Object.keys(w).forEach(function(e){~E.indexOf(e)||(w[e]=w[e]||null)}),w}i.parse=y,i.format=n,i.resolve=c,i.resolveObject=function(e,t){return y(c(e,t))},i.Url=d}(),e.exports=i}()},6405:function(e){!function(){"use strict";var t={815:function(e){e.exports=function(e,r,n,o){r=r||"&",n=n||"=";var i={};if("string"!=typeof e||0===e.length)return i;var a=/\+/g;e=e.split(r);var s=1e3;o&&"number"==typeof o.maxKeys&&(s=o.maxKeys);var l=e.length;s>0&&l>s&&(l=s);for(var u=0;u=0?(c=p.substr(0,m),d=p.substr(m+1)):(c=p,d=""),f=decodeURIComponent(c),h=decodeURIComponent(d),Object.prototype.hasOwnProperty.call(i,f))?t(i[f])?i[f].push(h):i[f]=[i[f],h]:i[f]=h}return i};var t=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},577:function(e){var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,i,a,s){return(i=i||"&",a=a||"=",null===e&&(e=void 0),"object"==typeof e)?n(o(e),function(o){var s=encodeURIComponent(t(o))+a;return r(e[o])?n(e[o],function(e){return s+encodeURIComponent(t(e))}).join(i):s+encodeURIComponent(t(e[o]))}).join(i):s?encodeURIComponent(t(s))+a+encodeURIComponent(t(e)):""};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function n(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n{if(t&&"function"==typeof t.init&&"function"==typeof t.createSessionHandler){let i=n[e];if(void 0===i)n[e]={backend:t,priority:r};else if(i.priority>r)return;else if(i.priority===r&&i.backend!==t)throw Error(`cannot register backend "${e}" using priority ${r}`);if(r>=0){let t=o.indexOf(e);-1!==t&&o.splice(t,1);for(let t=0;t{let t=0===e.length?o:e,r=[];for(let e of t){let t=n[e];if(t){if(t.initialized)return t.backend;if(t.aborted)continue;let n=!!t.initPromise;try{return n||(t.initPromise=t.backend.init()),await t.initPromise,t.initialized=!0,t.backend}catch(o){n||r.push({name:e,err:o}),t.aborted=!0}finally{delete t.initPromise}}}throw Error(`no available backend found. ERR: ${r.map(e=>`[${e.name}] ${e.err}`).join(", ")}`)};class s{constructor(){this.wasm={},this.webgl={},this.logLevelInternal="warning"}set logLevel(e){if(void 0!==e){if("string"!=typeof e||-1===["verbose","info","warning","error","fatal"].indexOf(e))throw Error(`Unsupported logging level: ${e}`);this.logLevelInternal=e}}get logLevel(){return this.logLevelInternal}}let l=new s,u="undefined"!=typeof BigInt64Array&&"function"==typeof BigInt64Array.from,c="undefined"!=typeof BigUint64Array&&"function"==typeof BigUint64Array.from,d=new Map([["float32",Float32Array],["uint8",Uint8Array],["int8",Int8Array],["uint16",Uint16Array],["int16",Int16Array],["int32",Int32Array],["bool",Uint8Array],["float64",Float64Array],["uint32",Uint32Array]]),f=new Map([[Float32Array,"float32"],[Uint8Array,"uint8"],[Int8Array,"int8"],[Uint16Array,"uint16"],[Int16Array,"int16"],[Int32Array,"int32"],[Float64Array,"float64"],[Uint32Array,"uint32"]]);u&&(d.set("int64",BigInt64Array),f.set(BigInt64Array,"int64")),c&&(d.set("uint64",BigUint64Array),f.set(BigUint64Array,"uint64"));let h=e=>{let t=1;for(let r=0;r{let o=document.createElement("canvas"),i=o.getContext("2d");if(!e||!i)return n();let a=new Image;a.crossOrigin="Anonymous",a.src=e,a.onload=()=>{o.width=a.width,o.height=a.height,i.drawImage(a,0,0,o.width,o.height);let e=i.getImageData(0,0,o.width,o.height);if(void 0!==t){if(void 0!==t.height&&t.height!==o.height)throw Error("Image input config height doesn't match ImageBitmap height");if(s.height=o.height,void 0!==t.width&&t.width!==o.width)throw Error("Image input config width doesn't match ImageBitmap width");s.width=o.width}else s.height=o.height,s.width=o.width;r(p.bufferToTensor(e.data,s))}});else throw Error("Input data provided is not supported - aborted tensor creation");if(void 0!==r)return p.bufferToTensor(r,s);throw Error("Input data provided is not supported - aborted tensor creation")}toImageData(e){var t,r;let n;let o=document.createElement("canvas").getContext("2d");if(null!=o){let i=this.dims[3],a=this.dims[2],s=this.dims[1],l=void 0!==e&&void 0!==e.format?e.format:"RGB",u=void 0!==e&&(null===(t=e.norm)||void 0===t?void 0:t.mean)!==void 0?e.norm.mean:255,c=void 0!==e&&(null===(r=e.norm)||void 0===r?void 0:r.bias)!==void 0?e.norm.bias:0,d=a*i;if(void 0!==e){if(void 0!==e.height&&e.height!==a)throw Error("Image output config height doesn't match tensor height");if(void 0!==e.width&&e.width!==i)throw Error("Image output config width doesn't match tensor width");if(void 0!==e.format&&4===s&&"RGBA"!==e.format||3===s&&"RGB"!==e.format&&"BGR"!==e.format)throw Error("Tensor format doesn't match input tensor dims")}let f=0,h=1,p=2,m=3,g=0,y=d,v=2*d,w=-1;"RGBA"===l?(g=0,y=d,v=2*d,w=3*d):"RGB"===l?(g=0,y=d,v=2*d):"RBG"===l&&(g=0,v=d,y=2*d),n=o.createImageData(i,a);for(let e=0;e=e.byteLength)throw RangeError(`'byteOffset' is out of range [0, ${e.byteLength}).`);if(s=e.byteLength-a,"number"==typeof r){if(!Number.isSafeInteger(s=r))throw RangeError("'byteLength' must be an integer.");if(s<=0||a+s>e.byteLength)throw RangeError(`'byteLength' is out of range (0, ${e.byteLength-a}].`);if("object"==typeof n&&null!==n)i=n;else if(void 0!==n)throw TypeError("'options' must be an object.")}else if(void 0!==r)throw TypeError("'byteLength' must be a number.")}else if(void 0!==t)throw TypeError("'options' must be an object.");o=new Uint8Array(e,a,s)}else throw TypeError("Unexpected argument[0]: must be 'path' or 'buffer'.");let s=(i.executionProviders||[]).map(e=>"string"==typeof e?e:e.name),l=await a(s);return new g(await l.createSessionHandler(o,i))}startProfiling(){this.handler.startProfiling()}endProfiling(){this.handler.endProfiling()}get inputNames(){return this.handler.inputNames}get outputNames(){return this.handler.outputNames}}let y=g},2319:function(e,t,r){"use strict";r.d(t,{Z:function(){return c}});var n={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexOrder:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,gridRow:!0,gridRowEnd:!0,gridRowGap:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnGap:!0,gridColumnStart:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,scale:!0,scaleX:!0,scaleY:!0,scaleZ:!0,shadowOpacity:!0},o=["ms","Moz","O","Webkit"],i=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1);Object.keys(n).forEach(e=>{o.forEach(t=>{n[i(t,e)]=n[e]})});var a=function(e,t){var r=e.style;for(var o in t)if(t.hasOwnProperty(o)){var i,a,s=0===o.indexOf("--"),l=(i=o,null==(a=t[o])||"boolean"==typeof a||""===a?"":s||"number"!=typeof a||0===a||n.hasOwnProperty(i)&&n[i]?(""+a).trim():a+"px");"float"===o&&(o="cssFloat"),s?r.setProperty(o,l):r[o]=l}},s=e=>{var t=e.offsetHeight,r=e.offsetWidth,n=e.offsetLeft,o=e.offsetTop;for(e=e.offsetParent;e&&1===e.nodeType;)n+=e.offsetLeft+e.clientLeft-e.scrollLeft,o+=e.offsetTop+e.clientTop-e.scrollTop,e=e.offsetParent;return{width:r,height:t,top:o-=window.scrollY,left:n-=window.scrollX}},l=(e,t,r)=>{var n=t||e&&e.parentNode;e&&n&&setTimeout(()=>{if(e.isConnected&&n.isConnected){var t=s(n),o=s(e),i=o.height,a=o.left,l=o.top,u=o.width;r(a-t.left,l-t.top,u,i,a,l)}},0)},u={A:!0,BODY:!0,INPUT:!0,SELECT:!0,TEXTAREA:!0},c={blur(e){try{e.blur()}catch(e){}},focus(e){try{var t=e.nodeName;null==e.getAttribute("tabIndex")&&!0!==e.isContentEditable&&null==u[t]&&e.setAttribute("tabIndex","-1"),e.focus()}catch(e){}},measure(e,t){l(e,null,t)},measureInWindow(e,t){e&&setTimeout(()=>{var r=s(e),n=r.height;t(r.left,r.top,r.width,n)},0)},measureLayout(e,t,r,n){l(e,t,n)},updateView(e,t){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var n=t[r];switch(r){case"style":a(e,n);break;case"class":case"className":e.setAttribute("class",n);break;case"text":case"value":e.value=n;break;default:e.setAttribute(r,n)}}},configureNextLayoutAnimation(e,t){t()},setLayoutAnimationEnabledExperimental(){}}},5275:function(e,t,r){"use strict";r.d(t,{Z:function(){return b}});var n=r(3950),o=r(2265),i=r(5803),a=r(7792),s=r(2675),l=r(9647),u=r(9926),c=r(5158),d=r(4834),f=r(929),h=(0,o.createContext)(!1),p=r(3201),m=["hrefAttrs","onLayout","onMoveShouldSetResponder","onMoveShouldSetResponderCapture","onResponderEnd","onResponderGrant","onResponderMove","onResponderReject","onResponderRelease","onResponderStart","onResponderTerminate","onResponderTerminationRequest","onScrollShouldSetResponder","onScrollShouldSetResponderCapture","onSelectionChangeShouldSetResponder","onSelectionChangeShouldSetResponderCapture","onStartShouldSetResponder","onStartShouldSetResponderCapture"],g=Object.assign({},a.lG,a.LO,a._T,a.YB,a.Uy,a.hJ,a.E5,a.vr,{href:!0,lang:!0,onScroll:!0,onWheel:!0,pointerEvents:!0}),y=e=>(0,s.Z)(e,g),v=o.forwardRef((e,t)=>{var r=e.hrefAttrs,a=e.onLayout,s=e.onMoveShouldSetResponder,f=e.onMoveShouldSetResponderCapture,g=e.onResponderEnd,v=e.onResponderGrant,b=e.onResponderMove,_=e.onResponderReject,x=e.onResponderRelease,E=e.onResponderStart,S=e.onResponderTerminate,k=e.onResponderTerminationRequest,R=e.onScrollShouldSetResponder,C=e.onScrollShouldSetResponderCapture,A=e.onSelectionChangeShouldSetResponder,T=e.onSelectionChangeShouldSetResponderCapture,M=e.onStartShouldSetResponder,I=e.onStartShouldSetResponderCapture,O=(0,n.Z)(e,m),z=o.useContext(h),L=o.useRef(null),P=(0,p.PE)().direction;(0,l.Z)(L,a),(0,d.Z)(L,{onMoveShouldSetResponder:s,onMoveShouldSetResponderCapture:f,onResponderEnd:g,onResponderGrant:v,onResponderMove:b,onResponderReject:_,onResponderRelease:x,onResponderStart:E,onResponderTerminate:S,onResponderTerminationRequest:k,onScrollShouldSetResponder:R,onScrollShouldSetResponderCapture:C,onSelectionChangeShouldSetResponder:A,onSelectionChangeShouldSetResponderCapture:T,onStartShouldSetResponder:M,onStartShouldSetResponderCapture:I});var N="div",B=null!=e.lang?(0,p.w1)(e.lang):null,j=e.dir||B,F=j||P,U=y(O);if(U.dir=j,U.style=[w.view$raw,z&&w.inline,e.style],null!=e.href&&(N="a",null!=r)){var $=r.download,D=r.rel,H=r.target;null!=$&&(U.download=$),null!=D&&(U.rel=D),"string"==typeof H&&(U.target="_"!==H.charAt(0)?"_"+H:H)}var V=(0,c.Z)(U),W=(0,u.Z)(L,V,t);return U.ref=W,(0,i.Z)(N,U,{writingDirection:F})});v.displayName="View";var w=f.Z.create({view$raw:{alignItems:"stretch",backgroundColor:"transparent",border:"0 solid black",boxSizing:"border-box",display:"flex",flexBasis:"auto",flexDirection:"column",flexShrink:0,listStyle:"none",margin:0,minHeight:0,minWidth:0,padding:0,position:"relative",textDecoration:"none",zIndex:0},inline:{display:"inline-flex"}}),b=v},3013:function(e,t,r){"use strict";var n=r(2319);t.Z={_currentlyFocusedNode:null,currentlyFocusedField(){return document.activeElement!==this._currentlyFocusedNode&&(this._currentlyFocusedNode=null),this._currentlyFocusedNode},focusTextInput(e){null!==e&&(this._currentlyFocusedNode=e,document.activeElement!==e&&n.Z.focus(e))},blurTextInput(e){null!==e&&(this._currentlyFocusedNode=null,document.activeElement===e&&n.Z.blur(e))}}},7792:function(e,t,r){"use strict";r.d(t,{E5:function(){return u},LO:function(){return o},Uy:function(){return s},YB:function(){return a},_T:function(){return i},hJ:function(){return l},lG:function(){return n},vr:function(){return c}});var n={children:!0,dataSet:!0,dir:!0,id:!0,ref:!0,suppressHydrationWarning:!0,tabIndex:!0,testID:!0,focusable:!0,nativeID:!0},o={"aria-activedescendant":!0,"aria-atomic":!0,"aria-autocomplete":!0,"aria-busy":!0,"aria-checked":!0,"aria-colcount":!0,"aria-colindex":!0,"aria-colspan":!0,"aria-controls":!0,"aria-current":!0,"aria-describedby":!0,"aria-details":!0,"aria-disabled":!0,"aria-errormessage":!0,"aria-expanded":!0,"aria-flowto":!0,"aria-haspopup":!0,"aria-hidden":!0,"aria-invalid":!0,"aria-keyshortcuts":!0,"aria-label":!0,"aria-labelledby":!0,"aria-level":!0,"aria-live":!0,"aria-modal":!0,"aria-multiline":!0,"aria-multiselectable":!0,"aria-orientation":!0,"aria-owns":!0,"aria-placeholder":!0,"aria-posinset":!0,"aria-pressed":!0,"aria-readonly":!0,"aria-required":!0,role:!0,"aria-roledescription":!0,"aria-rowcount":!0,"aria-rowindex":!0,"aria-rowspan":!0,"aria-selected":!0,"aria-setsize":!0,"aria-sort":!0,"aria-valuemax":!0,"aria-valuemin":!0,"aria-valuenow":!0,"aria-valuetext":!0,accessibilityActiveDescendant:!0,accessibilityAtomic:!0,accessibilityAutoComplete:!0,accessibilityBusy:!0,accessibilityChecked:!0,accessibilityColumnCount:!0,accessibilityColumnIndex:!0,accessibilityColumnSpan:!0,accessibilityControls:!0,accessibilityCurrent:!0,accessibilityDescribedBy:!0,accessibilityDetails:!0,accessibilityDisabled:!0,accessibilityErrorMessage:!0,accessibilityExpanded:!0,accessibilityFlowTo:!0,accessibilityHasPopup:!0,accessibilityHidden:!0,accessibilityInvalid:!0,accessibilityKeyShortcuts:!0,accessibilityLabel:!0,accessibilityLabelledBy:!0,accessibilityLevel:!0,accessibilityLiveRegion:!0,accessibilityModal:!0,accessibilityMultiline:!0,accessibilityMultiSelectable:!0,accessibilityOrientation:!0,accessibilityOwns:!0,accessibilityPlaceholder:!0,accessibilityPosInSet:!0,accessibilityPressed:!0,accessibilityReadOnly:!0,accessibilityRequired:!0,accessibilityRole:!0,accessibilityRoleDescription:!0,accessibilityRowCount:!0,accessibilityRowIndex:!0,accessibilityRowSpan:!0,accessibilitySelected:!0,accessibilitySetSize:!0,accessibilitySort:!0,accessibilityValueMax:!0,accessibilityValueMin:!0,accessibilityValueNow:!0,accessibilityValueText:!0},i={onClick:!0,onAuxClick:!0,onContextMenu:!0,onGotPointerCapture:!0,onLostPointerCapture:!0,onPointerCancel:!0,onPointerDown:!0,onPointerEnter:!0,onPointerMove:!0,onPointerLeave:!0,onPointerOut:!0,onPointerOver:!0,onPointerUp:!0},a={onBlur:!0,onFocus:!0},s={onKeyDown:!0,onKeyDownCapture:!0,onKeyUp:!0,onKeyUpCapture:!0},l={onMouseDown:!0,onMouseEnter:!0,onMouseLeave:!0,onMouseMove:!0,onMouseOver:!0,onMouseOut:!0,onMouseUp:!0},u={onTouchCancel:!0,onTouchCancelCapture:!0,onTouchEnd:!0,onTouchEndCapture:!0,onTouchMove:!0,onTouchMoveCapture:!0,onTouchStart:!0,onTouchStartCapture:!0},c={style:!0}},2050:function(e,t,r){"use strict";function n(){for(var e=arguments.length,t=Array(e),r=0;r{if(null!=t){if("function"==typeof t){t(e);return}if("object"==typeof t){t.current=e;return}console.error("mergeRefs cannot handle Refs of type boolean, number or string, received ref "+String(t))}})}}r.d(t,{Z:function(){return n}}),r(2265)},2675:function(e,t,r){"use strict";function n(e,t){var r={};for(var n in e)e.hasOwnProperty(n)&&!0===t[n]&&(r[n]=e[n]);return r}r.d(t,{Z:function(){return n}})},9647:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var n=r(1435),o=r(2319),i=r(1213),a="__reactLayoutHandler",s=(i.Z,null);function l(e,t){var r=(i.Z&&void 0!==window.ResizeObserver&&null==s&&(s=new window.ResizeObserver(function(e){e.forEach(e=>{var t=e.target,r=t[a];"function"==typeof r&&o.Z.measure(t,(t,n,o,i,a,s)=>{var l={nativeEvent:{layout:{x:t,y:n,width:o,height:i,left:a,top:s}},timeStamp:Date.now()};Object.defineProperty(l.nativeEvent,"target",{enumerable:!0,get:()=>e.target}),r(l)})})})),s);(0,n.Z)(()=>{var r=e.current;null!=r&&(r[a]=t)},[e,t]),(0,n.Z)(()=>{var t=e.current;return null!=t&&null!=r&&("function"==typeof t[a]?r.observe(t):r.unobserve(t)),()=>{null!=t&&null!=r&&r.unobserve(t)}},[e,r])}},1435:function(e,t,r){"use strict";var n=r(2265),o=r(1213).Z?n.useLayoutEffect:n.useEffect;t.Z=o},9926:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(2265),o=r(2050);function i(){for(var e=arguments.length,t=Array(e),r=0;r(0,o.Z)(...t),[...t])}},5158:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(2319),o=r(2265),i="function"==typeof Symbol&&"symbol"==typeof Symbol()?Symbol():Object.freeze({});function a(e){var t,r;return e.pointerEvents,e.style,t=()=>e=>{null!=e&&(e.measure=t=>n.Z.measure(e,t),e.measureLayout=(t,r,o)=>n.Z.measureLayout(e,t,o,r),e.measureInWindow=t=>n.Z.measureInWindow(e,t))},(r=o.useRef(i)).current===i&&(r.current=t()),r.current}},4834:function(e,t,r){"use strict";r.d(t,{Z:function(){return F}});var n=r(2265),o=e=>{if(null!=e&&1===e.nodeType&&"function"==typeof e.getBoundingClientRect)return e.getBoundingClientRect()},i=()=>{},a={},s=[];function l(e){return e>20?e%20:e}function u(e,t){var r,n,u,c=!1,d=e.changedTouches,f=e.type,h=!0===e.metaKey,p=!0===e.shiftKey,m=d&&d[0].force||0,g=l(d&&d[0].identifier||0),y=d&&d[0].clientX||e.clientX,v=d&&d[0].clientY||e.clientY,w=d&&d[0].pageX||e.pageX,b=d&&d[0].pageY||e.pageY,_="function"==typeof e.preventDefault?e.preventDefault.bind(e):i,x=e.timeStamp;function E(e){return Array.prototype.slice.call(e).map(e=>({force:e.force,identifier:l(e.identifier),get locationX(){return R(e.clientX)},get locationY(){return C(e.clientY)},pageX:e.pageX,pageY:e.pageY,target:e.target,timestamp:x}))}if(null!=d)n=E(d),u=E(e.touches);else{var S=[{force:m,identifier:g,get locationX(){return R(y)},get locationY(){return C(v)},pageX:w,pageY:b,target:e.target,timestamp:x}];n=S,u="mouseup"===f||"dragstart"===f?s:S}var k={bubbles:!0,cancelable:!0,currentTarget:null,defaultPrevented:e.defaultPrevented,dispatchConfig:a,eventPhase:e.eventPhase,isDefaultPrevented:()=>e.defaultPrevented,isPropagationStopped:()=>c,isTrusted:e.isTrusted,nativeEvent:{altKey:!1,ctrlKey:!1,metaKey:h,shiftKey:p,changedTouches:n,force:m,identifier:g,get locationX(){return R(y)},get locationY(){return C(v)},pageX:w,pageY:b,target:e.target,timestamp:x,touches:u,type:f},persist:i,preventDefault:_,stopPropagation(){c=!0},target:e.target,timeStamp:x,touchHistory:t.touchHistory};function R(e){if(r=r||o(k.currentTarget))return e-r.left}function C(e){if(r=r||o(k.currentTarget))return e-r.top}return k}function c(e){return"touchstart"===e||"mousedown"===e}function d(e){return"touchmove"===e||"mousemove"===e}function f(e){return"touchend"===e||"mouseup"===e||h(e)}function h(e){return"touchcancel"===e||"dragstart"===e}var p="__reactResponderId";function m(e){for(var t=[];null!=e&&e!==document.body;)t.push(e),e=e.parentNode;return t}function g(e){return e.timeStamp||e.timestamp}function y(e){var t=e.identifier;return null==t&&console.error("Touch object is missing identifier."),t}function v(e){return JSON.stringify({identifier:e.identifier,pageX:e.pageX,pageY:e.pageY,timestamp:g(e)})}function w(e){var t=e.touchBank,r=JSON.stringify(t.slice(0,20));return t.length>20&&(r+=" (original size: "+t.length+")"),r}class b{constructor(){this._touchHistory={touchBank:[],numberActiveTouches:0,indexOfSingleActiveTouch:-1,mostRecentTimeStamp:0}}recordTouchTrack(e,t){var r=this._touchHistory;if(d(e))t.changedTouches.forEach(e=>{var t;(t=r.touchBank[y(e)])?(t.touchActive=!0,t.previousPageX=t.currentPageX,t.previousPageY=t.currentPageY,t.previousTimeStamp=t.currentTimeStamp,t.currentPageX=e.pageX,t.currentPageY=e.pageY,t.currentTimeStamp=g(e),r.mostRecentTimeStamp=g(e)):console.warn("Cannot record touch move without a touch start.\n","Touch Move: "+v(e)+"\n","Touch Bank: "+w(r))});else if(c(e))t.changedTouches.forEach(e=>{var t,n,o,i;return t=e,n=r,o=y(t),void((i=n.touchBank[o])?(i.touchActive=!0,i.startPageX=t.pageX,i.startPageY=t.pageY,i.startTimeStamp=g(t),i.currentPageX=t.pageX,i.currentPageY=t.pageY,i.currentTimeStamp=g(t),i.previousPageX=t.pageX,i.previousPageY=t.pageY,i.previousTimeStamp=g(t)):n.touchBank[o]={touchActive:!0,startPageX:t.pageX,startPageY:t.pageY,startTimeStamp:g(t),currentPageX:t.pageX,currentPageY:t.pageY,currentTimeStamp:g(t),previousPageX:t.pageX,previousPageY:t.pageY,previousTimeStamp:g(t)},n.mostRecentTimeStamp=g(t))}),r.numberActiveTouches=t.touches.length,1===r.numberActiveTouches&&(r.indexOfSingleActiveTouch=t.touches[0].identifier);else if(f(e)&&(t.changedTouches.forEach(e=>{var t;(t=r.touchBank[y(e)])?(t.touchActive=!1,t.previousPageX=t.currentPageX,t.previousPageY=t.currentPageY,t.previousTimeStamp=t.currentTimeStamp,t.currentPageX=e.pageX,t.currentPageY=e.pageY,t.currentTimeStamp=g(e),r.mostRecentTimeStamp=g(e)):console.warn("Cannot record touch end without a touch start.\n","Touch End: "+v(e)+"\n","Touch Bank: "+w(r))}),r.numberActiveTouches=t.touches.length,1===r.numberActiveTouches))for(var n=r.touchBank,o=0;o1)&&(A=!1),("mousedown"!==l||!A)&&("mousemove"!==l||!A)&&("mousemove"!==l||!(T<1))){if(A&&"mouseup"===l){0===T&&(A=!1);return}var y=c(l)&&(t=e.altKey,r=e.button,n=e.buttons,o=e.ctrlKey,i=e.type,a=!1===t&&!1===o,"touchstart"===i||"touchmove"===i||"mousedown"===i&&(0===r||1===n)&&!!a||"mousemove"===i&&1===n&&!!a),v=d(l),w=f(l),b="scroll"===l,_="select"===l||"selectionchange"===l,x=u(e,I);(y||v||w)&&(e.touches?T=e.touches.length:y?T=1:w&&(T=0),I.recordTouchTrack(l,x.nativeEvent));var E=function(e){for(var t=[],r=[],n="selectionchange"===e.type?m(window.getSelection().anchorNode):null!=e.composedPath?e.composedPath():m(e.target),o=0;o0){var C=M.idPath,z=E.idPath;if(null!=C&&null!=z){var L=function(e,t){var r=e.length,n=t.length;if(0===r||0===n||e[r-1]!==t[n-1])return null;var o=e[0],i=0,a=t[0],s=0;r-n>0&&(o=e[i=r-n],r=n),n-r>0&&(a=t[s=n-r],n=r);for(var l=r;l--;){if(o===a)return o;o=e[i++],a=t[s++]}return null}(C,z);if(null!=L){var P=z.indexOf(L)+(L===M.id?1:0);E={idPath:z.slice(P),nodePath:E.nodePath.slice(P)}}else E=null}null!=E&&null!=(s=function(e,t,r){var n=k[t.type];if(null!=n){for(var o=e.idPath,i=e.nodePath,a=n[0],s=n[1],l=n[2].bubbles,u=function(e,t,n){var i=O(e)[n];if(null!=i&&(r.currentTarget=t,!0===i(r))){var a=o.slice(o.indexOf(e));return{id:e,node:t,idPath:a}}},c=o.length-1;c>=0;c--){var d=u(o[c],i[c],a);if(null!=d)return d;if(!0===r.isPropagationStopped())return}if(l)for(var f=0;f=1&&"\n"!==r&&i}return"select"===e.type}(e),X=w&&!q&&!function(e,t){if(!t||0===t.length)return!1;for(var r=0;rj++,null==(o=n.useRef(null)).current&&(o.current=r()),o.current),a=n.useRef(!1);n.useEffect(()=>(_.Z&&null==window.__reactResponderSystemActive&&(window.addEventListener("blur",z),P.forEach(e=>{document.addEventListener(e,z)}),L.forEach(e=>{document.addEventListener(e,z,!0)}),window.__reactResponderSystemActive=!0),()=>{N(i)}),[i]),n.useEffect(()=>{var r,n=t,o=n.onMoveShouldSetResponder,s=n.onMoveShouldSetResponderCapture,l=n.onScrollShouldSetResponder,u=n.onScrollShouldSetResponderCapture,c=n.onSelectionChangeShouldSetResponder,d=n.onSelectionChangeShouldSetResponderCapture,f=n.onStartShouldSetResponder,h=n.onStartShouldSetResponderCapture,m=e.current;null!=o||null!=s||null!=l||null!=u||null!=c||null!=d||null!=f||null!=h?(r=t,null!=m&&(m[p]=i),C.set(i,r),a.current=!0):a.current&&(N(i),a.current=!1)},[t,e,i]),n.useDebugValue({isResponder:e.current===M.node}),n.useDebugValue(t)}},2988:function(e,t,r){"use strict";function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t=",n.ComparisonBinaryOperator],["==",n.ComparisonBinaryOperator],["!=",n.ComparisonBinaryOperator],["<",n.ComparisonBinaryOperator],[">",n.ComparisonBinaryOperator],["+",n.AdditiveBinaryOperator],["-",n.AdditiveBinaryOperator],["*",n.MultiplicativeBinaryOperator],["/",n.MultiplicativeBinaryOperator],["%",n.MultiplicativeBinaryOperator],["=",n.Equals]],u=new Map([["n","\n"],["t"," "],["r","\r"],["b","\b"],["f","\f"],["v","\v"],["'","'"],['"','"'],["\\","\\"]]),c=class{type="Statement"},d=class extends c{constructor(e){super(),this.body=e}type="Program"},f=class extends c{constructor(e,t,r){super(),this.test=e,this.body=t,this.alternate=r}type="If"},h=class extends c{constructor(e,t,r){super(),this.loopvar=e,this.iterable=t,this.body=r}type="For"},p=class extends c{constructor(e,t){super(),this.assignee=e,this.value=t}type="Set"},m=class extends c{type="Expression"},g=class extends m{constructor(e,t,r){super(),this.object=e,this.property=t,this.computed=r}type="MemberExpression"},y=class extends m{constructor(e,t){super(),this.callee=e,this.args=t}type="CallExpression"},v=class extends m{constructor(e){super(),this.value=e}type="Identifier"},w=class extends m{constructor(e){super(),this.value=e}type="Literal"},b=class extends w{type="NumericLiteral"},_=class extends w{type="StringLiteral"},x=class extends w{type="BooleanLiteral"},E=class extends w{type="ArrayLiteral"},S=class extends w{type="TupleLiteral"},k=class extends w{type="ObjectLiteral"},R=class extends m{constructor(e,t,r){super(),this.operator=e,this.left=t,this.right=r}type="BinaryExpression"},C=class extends m{constructor(e,t){super(),this.operand=e,this.filter=t}type="FilterExpression"},A=class extends m{constructor(e,t,r){super(),this.operand=e,this.negate=t,this.test=r}type="TestExpression"},T=class extends m{constructor(e,t){super(),this.operator=e,this.argument=t}type="UnaryExpression"},M=class extends m{constructor(e,t,r){super(),this.start=e,this.stop=t,this.step=r}type="SliceExpression"},I=class extends m{constructor(e,t){super(),this.key=e,this.value=t}type="KeywordArgumentExpression"};function O(e,t,r=1){void 0===t&&(t=e,e=0);let n=[];for(let o=e;o=0?(t=(t??=0)<0?Math.max(e.length+t,0):Math.min(t,e.length),r=(r??=e.length)<0?Math.max(e.length+r,0):Math.min(r,e.length)):(t=(t??=e.length-1)<0?Math.max(e.length+t,-1):Math.min(t,e.length-1),r=(r??=-1)<-1?Math.max(e.length+r,-1):Math.min(r,e.length-1));let i=[];for(let a=t;o*ae.toUpperCase())}var P=class{type="RuntimeValue";value;builtins=new Map;constructor(e){this.value=e}__bool__(){return new j(!!this.value)}},N=class extends P{type="NumericValue"},B=class extends P{type="StringValue";builtins=new Map([["upper",new D(()=>new B(this.value.toUpperCase()))],["lower",new D(()=>new B(this.value.toLowerCase()))],["strip",new D(()=>new B(this.value.trim()))],["title",new D(()=>new B(L(this.value)))],["length",new N(this.value.length)]])},j=class extends P{type="BooleanValue"},F=class extends P{type="ObjectValue";__bool__(){return new j(this.value.size>0)}builtins=new Map([["get",new D(([e,t])=>{if(!(e instanceof B))throw Error(`Object key must be a string: got ${e.type}`);return this.value.get(e.value)??t??new H})],["items",new D(()=>new U(Array.from(this.value.entries()).map(([e,t])=>new U([new B(e),t]))))]])},U=class extends P{type="ArrayValue";builtins=new Map([["length",new N(this.value.length)]]);__bool__(){return new j(this.value.length>0)}},$=class extends U{type="TupleValue"},D=class extends P{type="FunctionValue"},H=class extends P{type="NullValue"},V=class extends P{type="UndefinedValue"},W=class{constructor(e){this.parent=e}variables=new Map([["namespace",new D(e=>{if(0===e.length)return new F(new Map);if(1!==e.length||!(e[0]instanceof F))throw Error("`namespace` expects either zero arguments or a single object argument");return e[0]})]]);tests=new Map([["boolean",e=>"BooleanValue"===e.type],["callable",e=>e instanceof D],["odd",e=>{if("NumericValue"!==e.type)throw Error(`Cannot apply test "odd" to type: ${e.type}`);return e.value%2!=0}],["even",e=>{if("NumericValue"!==e.type)throw Error(`Cannot apply test "even" to type: ${e.type}`);return e.value%2==0}],["false",e=>"BooleanValue"===e.type&&!e.value],["true",e=>"BooleanValue"===e.type&&e.value],["number",e=>"NumericValue"===e.type],["integer",e=>"NumericValue"===e.type&&Number.isInteger(e.value)],["iterable",e=>e instanceof U||e instanceof B],["lower",e=>{let t=e.value;return"StringValue"===e.type&&t===t.toLowerCase()}],["upper",e=>{let t=e.value;return"StringValue"===e.type&&t===t.toUpperCase()}],["none",e=>"NullValue"===e.type],["defined",e=>"UndefinedValue"!==e.type],["undefined",e=>"UndefinedValue"===e.type],["equalto",(e,t)=>e.value===t.value]]);set(e,t){return this.declareVariable(e,function e(t){switch(typeof t){case"number":return new N(t);case"string":return new B(t);case"boolean":return new j(t);case"object":if(null===t)return new H;if(Array.isArray(t))return new U(t.map(e));return new F(new Map(Object.entries(t).map(([t,r])=>[t,e(r)])));case"function":return new D((r,n)=>e(t(...r.map(e=>e.value))??null));default:throw Error(`Cannot convert to runtime value: ${t}`)}}(t))}declareVariable(e,t){if(this.variables.has(e))throw SyntaxError(`Variable already declared: ${e}`);return this.variables.set(e,t),t}setVariable(e,t){return this.variables.set(e,t),t}resolve(e){if(this.variables.has(e))return this;if(this.parent)return this.parent.resolve(e);throw Error(`Unknown variable: ${e}`)}lookupVariable(e){try{return this.resolve(e).variables.get(e)??new V}catch{return new V}}},q=class{global;constructor(e){this.global=e??new W}run(e){return this.evaluate(e,this.global)}evaluateBinaryExpression(e,t){let r=this.evaluate(e.left,t);switch(e.operator.value){case"and":return r.__bool__().value?this.evaluate(e.right,t):r;case"or":return r.__bool__().value?r:this.evaluate(e.right,t)}let n=this.evaluate(e.right,t);switch(e.operator.value){case"==":return new j(r.value==n.value);case"!=":return new j(r.value!=n.value)}if(r instanceof V||n instanceof V)throw Error("Cannot perform operation on undefined values");if(r instanceof H||n instanceof H)throw Error("Cannot perform operation on null values");if(r instanceof N&&n instanceof N)switch(e.operator.value){case"+":return new N(r.value+n.value);case"-":return new N(r.value-n.value);case"*":return new N(r.value*n.value);case"/":return new N(r.value/n.value);case"%":return new N(r.value%n.value);case"<":return new j(r.value":return new j(r.value>n.value);case">=":return new j(r.value>=n.value);case"<=":return new j(r.value<=n.value)}else if(r instanceof U&&n instanceof U){if("+"===e.operator.value)return new U(r.value.concat(n.value))}else if(n instanceof U){let t=void 0!==n.value.find(e=>e.value===r.value);switch(e.operator.value){case"in":return new j(t);case"not in":return new j(!t)}}if((r instanceof B||n instanceof B)&&"+"===e.operator.value)return new B(r.value.toString()+n.value.toString());if(r instanceof B&&n instanceof B)switch(e.operator.value){case"in":return new j(n.value.includes(r.value));case"not in":return new j(!n.value.includes(r.value))}if(r instanceof B&&n instanceof F)switch(e.operator.value){case"in":return new j(n.value.has(r.value));case"not in":return new j(!n.value.has(r.value))}throw SyntaxError(`Unknown operator "${e.operator.value}" between ${r.type} and ${n.type}`)}evaluateFilterExpression(e,t){let r=this.evaluate(e.operand,t);if("Identifier"===e.filter.type){let t=e.filter;if(r instanceof U)switch(t.value){case"list":return r;case"first":return r.value[0];case"last":return r.value[r.value.length-1];case"length":return new N(r.value.length);case"reverse":return new U(r.value.reverse());case"sort":return new U(r.value.sort((e,t)=>{if(e.type!==t.type)throw Error(`Cannot compare different types: ${e.type} and ${t.type}`);switch(e.type){case"NumericValue":return e.value-t.value;case"StringValue":return e.value.localeCompare(t.value);default:throw Error(`Cannot compare type: ${e.type}`)}}));default:throw Error(`Unknown ArrayValue filter: ${t.value}`)}else if(r instanceof B)switch(t.value){case"length":return new N(r.value.length);case"upper":return new B(r.value.toUpperCase());case"lower":return new B(r.value.toLowerCase());case"title":return new B(L(r.value));case"capitalize":return new B(r.value.charAt(0).toUpperCase()+r.value.slice(1));case"trim":return new B(r.value.trim());default:throw Error(`Unknown StringValue filter: ${t.value}`)}else if(r instanceof N){if("abs"===t.value)return new N(Math.abs(r.value));throw Error(`Unknown NumericValue filter: ${t.value}`)}else if(r instanceof F)switch(t.value){case"items":return new U(Array.from(r.value.entries()).map(([e,t])=>new U([new B(e),t])));case"length":return new N(r.value.size);default:throw Error(`Unknown ObjectValue filter: ${t.value}`)}throw Error(`Cannot apply filter "${t.value}" to type: ${r.type}`)}if("CallExpression"===e.filter.type){let n=e.filter;if("Identifier"!==n.callee.type)throw Error(`Unknown filter: ${n.callee.type}`);let o=n.callee.value;if(r instanceof U){if("selectattr"===o){let e;if(r.value.some(e=>!(e instanceof F)))throw Error("`selectattr` can only be applied to array of objects");if(n.args.some(e=>"StringLiteral"!==e.type))throw Error("arguments of `selectattr` must be strings");let[o,i,a]=n.args.map(e=>this.evaluate(e,t));if(i){let r=t.tests.get(i.value);if(!r)throw Error(`Unknown test: ${i.value}`);e=r}else e=(...e)=>e[0].__bool__().value;return new U(r.value.filter(t=>{let r=t.value.get(o.value);return!!r&&e(r,a)}))}throw Error(`Unknown ArrayValue filter: ${o}`)}throw Error(`Cannot apply filter "${o}" to type: ${r.type}`)}throw Error(`Unknown filter: ${e.filter.type}`)}evaluateTestExpression(e,t){let r=this.evaluate(e.operand,t),n=t.tests.get(e.test.value);if(!n)throw Error(`Unknown test: ${e.test.value}`);let o=n(r);return new j(e.negate?!o:o)}evaluateUnaryExpression(e,t){let r=this.evaluate(e.argument,t);if("not"===e.operator.value)return new j(!r.value);throw SyntaxError(`Unknown operator: ${e.operator.value}`)}evalProgram(e,t){return this.evaluateBlock(e.body,t)}evaluateBlock(e,t){let r="";for(let n of e){let e=this.evaluate(n,t);"NullValue"!==e.type&&"UndefinedValue"!==e.type&&(r+=e.value)}return new B(r)}evaluateIdentifier(e,t){return t.lookupVariable(e.value)}evaluateCallExpression(e,t){let r=[],n=new Map;for(let o of e.args)"KeywordArgumentExpression"===o.type?n.set(o.key.value,this.evaluate(o.value,t)):r.push(this.evaluate(o,t));n.size>0&&r.push(new F(n));let o=this.evaluate(e.callee,t);if("FunctionValue"!==o.type)throw Error(`Cannot call something that is not a function: got ${o.type}`);return o.value(r,t)}evaluateSliceExpression(e,t,r){if(!(e instanceof U||e instanceof B))throw Error("Slice object must be an array or string");let n=this.evaluate(t.start,r),o=this.evaluate(t.stop,r),i=this.evaluate(t.step,r);if(!(n instanceof N||n instanceof V))throw Error("Slice start must be numeric or undefined");if(!(o instanceof N||o instanceof V))throw Error("Slice stop must be numeric or undefined");if(!(i instanceof N||i instanceof V))throw Error("Slice step must be numeric or undefined");return e instanceof U?new U(z(e.value,n.value,o.value,i.value)):new B(z(Array.from(e.value),n.value,o.value,i.value).join(""))}evaluateMemberExpression(e,t){let r,n;let o=this.evaluate(e.object,t);if(e.computed){if("SliceExpression"===e.property.type)return this.evaluateSliceExpression(o,e.property,t);r=this.evaluate(e.property,t)}else r=new B(e.property.value);if(o instanceof F){if(!(r instanceof B))throw Error(`Cannot access property with non-string: got ${r.type}`);n=o.value.get(r.value)??o.builtins.get(r.value)}else if(o instanceof U||o instanceof B){if(r instanceof N)n=o.value.at(r.value),o instanceof B&&(n=new B(o.value.at(r.value)));else if(r instanceof B)n=o.builtins.get(r.value);else throw Error(`Cannot access property with non-string/non-number: got ${r.type}`)}else{if(!(r instanceof B))throw Error(`Cannot access property with non-string: got ${r.type}`);n=o.builtins.get(r.value)}return n instanceof P?n:new V}evaluateSet(e,t){let r=this.evaluate(e.value,t);if("Identifier"===e.assignee.type){let n=e.assignee.value;t.setVariable(n,r)}else if("MemberExpression"===e.assignee.type){let n=e.assignee,o=this.evaluate(n.object,t);if(!(o instanceof F))throw Error("Cannot assign to member of non-object");if("Identifier"!==n.property.type)throw Error("Cannot assign to member with non-identifier property");o.value.set(n.property.value,r)}else throw Error(`Invalid LHS inside assignment expression: ${JSON.stringify(e.assignee)}`);return new H}evaluateIf(e,t){let r=this.evaluate(e.test,t);return this.evaluateBlock(r.__bool__().value?e.body:e.alternate,t)}evaluateFor(e,t){let r=new W(t),n=this.evaluate(e.iterable,r);if(!(n instanceof U))throw Error(`Expected iterable type in for loop: got ${n.type}`);let o="";for(let t=0;t0?n.value[t-1]:new V],["nextitem",ta.value.length?"few":"many"} items to unpack`);for(let e=0;ethis.evaluate(e,t)));case"TupleLiteral":return new $(e.value.map(e=>this.evaluate(e,t)));case"ObjectLiteral":{let r=new Map;for(let[n,o]of e.value){let e=this.evaluate(n,t);if(!(e instanceof B))throw Error(`Object keys must be strings: got ${e.type}`);r.set(e.value,this.evaluate(o,t))}return new F(r)}case"Identifier":return this.evaluateIdentifier(e,t);case"CallExpression":return this.evaluateCallExpression(e,t);case"MemberExpression":return this.evaluateMemberExpression(e,t);case"UnaryExpression":return this.evaluateUnaryExpression(e,t);case"BinaryExpression":return this.evaluateBinaryExpression(e,t);case"FilterExpression":return this.evaluateFilterExpression(e,t);case"TestExpression":return this.evaluateTestExpression(e,t);default:throw SyntaxError(`Unknown node type: ${e.type}`)}}},X=class{parsed;constructor(e){let t=function(e,t={}){let r=[],c=function(e,t={}){return e.endsWith("\n")&&(e=e.slice(0,-1)),e=e.replace(/{#.*?#}/gs,"{##}"),t.lstrip_blocks&&(e=e.replace(/^[ \t]*({[#%])/gm,"$1")),t.trim_blocks&&(e=e.replace(/([#%]})\n/g,"$1")),e.replace(/{##}/g,"").replace(/-%}\s*/g,"%}").replace(/\s*{%-/g,"{%").replace(/-}}\s*/g,"}}").replace(/\s*{{-/g,"{{")}(e,t),d=0,f=e=>{let t="";for(;e(c[d]);){if("\\"===c[d]){if(++d>=c.length)throw SyntaxError("Unexpected end of input");let e=c[d++],r=u.get(e);if(void 0===r)throw SyntaxError(`Unexpected escaped character: ${e}`);t+=r;continue}if(t+=c[d++],d>=c.length)throw SyntaxError("Unexpected end of input")}return t};e:for(;d0){r.push(new i(e,n.Text));continue}}f(e=>/\s/.test(e));let t=c[d];if("-"===t||"+"===t){let e=r.at(-1)?.type;if(e===n.Text||void 0===e)throw SyntaxError(`Unexpected character: ${t}`);switch(e){case n.Identifier:case n.NumericLiteral:case n.BooleanLiteral:case n.StringLiteral:case n.CloseParen:case n.CloseSquareBracket:break;default:{++d;let e=f(s);r.push(new i(`${t}${e}`,e.length>0?n.NumericLiteral:n.UnaryOperator));continue}}}for(let[e,t]of l)if(c.slice(d,d+e.length)===e){r.push(new i(e,t)),d+=e.length;continue e}if("'"===t||'"'===t){++d;let e=f(e=>e!==t);r.push(new i(e,n.StringLiteral)),++d;continue}if(s(t)){let e=f(s);r.push(new i(e,n.NumericLiteral));continue}if(a(t)){let e=f(a),t=Object.hasOwn(o,e)?o[e]:n.Identifier;t===n.In&&r.at(-1)?.type===n.Not?(r.pop(),r.push(new i("not in",n.NotIn))):r.push(new i(e,t));continue}throw SyntaxError(`Unexpected character: ${t}`)}return r}(e,{lstrip_blocks:!0,trim_blocks:!0});this.parsed=function(e){let t=new d([]),r=0;function o(t,n){let o=e[r++];if(!o||o.type!==t)throw Error(`Parser Error: ${n}. ${o.type} !== ${t}.`);return o}function i(...t){return r+t.length<=e.length&&t.every((t,n)=>t===e[r+n].type)}function a(e=!1){let t=e?L:s,o=[t()],a=i(n.Comma);for(;a&&(++r,o.push(t()),i(n.Comma)););return a?new S(o):o[0]}function s(){return function(){let e=l();if(i(n.If)){++r;let t=l();return o(n.Else,"Expected else token"),new f(t,[e],[l()])}return e}()}function l(){let t=u();for(;i(n.Or);){let n=e[r];++r,t=new R(n,t,u())}return t}function u(){let t=c();for(;i(n.And);){let n=e[r];++r,t=new R(n,t,c())}return t}function c(){let t;for(;i(n.Not);){let n=e[r];++r,t=new T(n,c())}return t??function(){let t=m();for(;i(n.ComparisonBinaryOperator)||i(n.In)||i(n.NotIn);){let n=e[r];++r,t=new R(n,t,m())}return t}()}function m(){let t=O();for(;i(n.AdditiveBinaryOperator);){let n=e[r];++r,t=new R(n,t,O())}return t}function w(e){let t=new y(e,function(){o(n.OpenParen,"Expected opening parenthesis for arguments list");let e=function(){let e=[];for(;!i(n.CloseParen);){let t=s();if(i(n.Equals)){if(++r,!(t instanceof v))throw SyntaxError("Expected identifier for keyword argument");t=new I(t,s())}e.push(t),i(n.Comma)&&++r}return e}();return o(n.CloseParen,"Expected closing parenthesis for arguments list"),e}());return i(n.OpenParen)&&(t=w(t)),t}function O(){let t=z();for(;i(n.MultiplicativeBinaryOperator);){let n=e[r];++r,t=new R(n,t,z())}return t}function z(){let t=function(){let t=function(){let t=function(){let t=L();for(;i(n.Dot)||i(n.OpenSquareBracket);){let a;let l=e[r];++r;let u=l.type!==n.Dot;if(u)a=function(){let e=[],t=!1;for(;!i(n.CloseSquareBracket);)i(n.Colon)?(e.push(void 0),++r,t=!0):(e.push(s()),i(n.Colon)&&(++r,t=!0));if(0===e.length)throw SyntaxError("Expected at least one argument for member/slice expression");if(t){if(e.length>3)throw SyntaxError("Expected 0-3 arguments for slice expression");return new M(...e)}return e[0]}(),o(n.CloseSquareBracket,"Expected closing square bracket");else if("Identifier"!==(a=L()).type)throw SyntaxError("Expected identifier following dot operator");t=new g(t,a,u)}return t}();return i(n.OpenParen)?w(t):t}();for(;i(n.Pipe);){++r;let e=L();if(!(e instanceof v))throw SyntaxError("Expected identifier for the filter");i(n.OpenParen)&&(e=w(e)),t=new C(t,e)}return t}();for(;i(n.Is);){++r;let e=i(n.Not);e&&++r;let o=L();if(o instanceof x&&(o=new v(o.value.toString())),!(o instanceof v))throw SyntaxError("Expected identifier for the test");t=new A(t,e,o)}return t}function L(){let t=e[r];switch(t.type){case n.NumericLiteral:return++r,new b(Number(t.value));case n.StringLiteral:return++r,new _(t.value);case n.BooleanLiteral:return++r,new x("true"===t.value);case n.Identifier:return++r,new v(t.value);case n.OpenParen:{++r;let t=a();if(e[r].type!==n.CloseParen)throw SyntaxError(`Expected closing parenthesis, got ${e[r].type} instead`);return++r,t}case n.OpenSquareBracket:{++r;let e=[];for(;!i(n.CloseSquareBracket);)e.push(s()),i(n.Comma)&&++r;return++r,new E(e)}case n.OpenCurlyBracket:{++r;let e=new Map;for(;!i(n.CloseCurlyBracket);){let t=s();o(n.Colon,"Expected colon between key and value in object literal");let a=s();e.set(t,a),i(n.Comma)&&++r}return++r,new k(e)}default:throw SyntaxError(`Unexpected token: ${t.type}`)}}for(;rt!==e[r+n].type)}(n.OpenStatement,n.EndFor);)u.push(t());return new h(i,l,u)}(),o(n.OpenStatement,"Expected {% token"),o(n.EndFor,"Expected endfor token"),o(n.CloseStatement,"Expected %} token");break;default:throw SyntaxError(`Unknown statement type: ${e[r].type}`)}return l}();case n.OpenExpression:return function(){o(n.OpenExpression,"Expected opening expression token");let e=s();return o(n.CloseExpression,"Expected closing expression token"),e}();default:throw SyntaxError(`Unexpected token type: ${e[r].type}`)}}());return t}(t)}render(e){let t=new W;for(let[r,n]of(t.set("false",!1),t.set("true",!0),t.set("raise_exception",e=>{throw Error(e)}),t.set("range",O),Object.entries(e)))t.set(r,n);return new q(t).run(this.parsed).value}}},3370:function(e,t,r){"use strict";r.d(t,{Tr:function(){return d},fG:function(){return l},pV:function(){return c}});var n=r(281),o=r(9097),i=r(8338),a=r(2265),s=r(2281);let l=(0,a.createContext)(null),u=e=>{let t=(0,a.useContext)(l);if(!t?.Contents)throw Error("tamagui.dev/docs/intro/errors#warning-002");return(0,a.createElement)(t.Contents,e)};u.shouldForwardSpace=!0;let c=({Contents:e})=>{let[t,r]=(0,a.useState)(null);return{AdaptProvider:(0,a.useMemo)(()=>{let t={Contents:e,setWhen:r};return function(e){return(0,s.jsx)(l.Provider,{value:t,children:e.children})}},[e]),when:t}},d=(0,i.$e)(function({platform:e,when:t,children:r}){let i=(0,a.useContext)(l),s=(0,o.GS)(),u=!e;return"touch"===e&&(u=n.wT),"native"===e&&(u=!n.$L),"web"===e&&(u=n.$L),"ios"===e&&(u=n.s),"android"===e&&(u=n.Dt),t&&!s[t]&&(u=!1),(0,n.LI)(()=>{u&&i?.setWhen(t||u)},[t,i,u]),u?r:null},{Contents:u})},9085:function(e,t,r){"use strict";r.d(t,{M:function(){return h}});var n=r(2265);let o=typeof window>"u",i=()=>{},a=(0,n.createContext)({});var s=r(3020),l=r(5390),u=r(2281);let c=n.memo(({children:e,initial:t,isPresent:r,onExitComplete:o,exitVariant:i,enterVariant:a,enterExitVariant:c,presenceAffectsLayout:f,custom:h})=>{let p=(0,s.h)(d),m=(0,n.useId)()||"",g=n.useMemo(()=>({id:m,initial:t,isPresent:r,custom:h,exitVariant:i,enterVariant:a,enterExitVariant:c,onExitComplete:()=>{for(let e of(p.set(m,!0),p.values()))if(!e)return;o?.()},register:()=>(p.set(m,!1),()=>p.delete(m))}),f?void 0:[r,i,a]);return n.useMemo(()=>{p.forEach((e,t)=>p.set(t,!1))},[r]),n.useEffect(()=>{r||p.size||o?.()},[r]),(0,u.jsx)(l.Oy.Provider,{value:g,children:e})});function d(){return new Map}let f=e=>e.key||"",h=({children:e,enterVariant:t,exitVariant:r,enterExitVariant:s,initial:l=!0,onExitComplete:d,exitBeforeEnter:h,presenceAffectsLayout:p=!0,custom:m})=>{let g=(0,n.useContext)(a).forceRender??(o?i:(0,n.useReducer)(e=>Math.random(),0)[1]),y=function(e){let t=[];return n.Children.forEach(e,e=>{(0,n.isValidElement)(e)&&t.push(e)}),t}(e),v=(0,n.useRef)(y),w=(0,n.useRef)(new Map).current,b=(0,n.useRef)(new Set).current;!function(e,t){e.forEach(e=>{let r=f(e);t.set(r,e)})}(y,w);let _=(0,n.useRef)(!0);if(_.current)return _.current=!1,(0,u.jsx)(u.Fragment,{children:y.map(e=>(0,u.jsx)(c,{isPresent:!0,enterExitVariant:s,exitVariant:r,enterVariant:t,initial:!!l&&void 0,presenceAffectsLayout:p,custom:m,children:e},f(e)))});let x=[...y],E=v.current.map(f),S=y.map(f),k=E.length;for(let e=0;e{if(-1!==S.indexOf(e))return;let n=w.get(e);if(!n)return;let o=E.indexOf(e),i=(0,u.jsx)(c,{isPresent:!1,onExitComplete:()=>{w.delete(e),b.delete(e);let t=v.current.findIndex(t=>t.key===e);v.current.splice(t,1),b.size||(v.current=y,g(),d?.())},presenceAffectsLayout:p,enterExitVariant:s,enterVariant:t,exitVariant:r,custom:m,children:n},f(n));x.splice(o,0,i)}),x=x.map(e=>{let n=e.key;return b.has(n)?e:(0,u.jsx)(c,{isPresent:!0,exitVariant:r,enterVariant:t,enterExitVariant:s,presenceAffectsLayout:p,custom:m,children:e},f(e))}),v.current=x,(0,u.jsx)(u.Fragment,{children:b.size?x:x.map(e=>(0,n.cloneElement)(e))})};h.displayName="AnimatePresence"},301:function(e,t,r){"use strict";r.d(t,{b:function(){return i}});var n=r(2265),o=r(2281);function i(e,t=[]){let r=[],i=()=>{let t=r.map(e=>n.createContext(e));return function(r){let o=r?.[e]||t;return n.useMemo(()=>({[`__scope${e}`]:{...r,[e]:o}}),[r,o])}};return i.scopeName=e,[function(t,i){let a=n.createContext(i),s=r.length;function l(t){let{scope:r,children:i,...l}=t,u=r?.[e]?.[s]||a,c=n.useMemo(()=>l,Object.values(l));return(0,o.jsx)(u.Provider,{value:c,children:i})}return r=[...r,i],l.displayName=`${t}Provider`,[l,function(r,o,l){let u=o?.[e]?.[s]||a,c=n.useContext(u);if(c)return c;if(void 0!==i)return i;let d=`\`${r}\` must be used within \`${t}\``;if(l?.fallback)return l?.warn!==!1&&console.warn(d),l.fallback;throw Error(d)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let o=r.reduce((t,{useScope:r,scopeName:n})=>{let o=r(e)[`__scope${n}`];return{...t,...o}},{});return n.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}(i,...t)]}},8030:function(e,t,r){"use strict";r.d(t,{o:function(){return h}});var n=r(4975),o=r(1386),i=r(8411),a=r(5377),s=r(2117),l=r(2265),u=r(5275),c=r(2281);function d({colors:e,locations:t,start:r,end:n,...o}){let[{height:i,width:a},d]=l.useState({height:1,width:1}),f=l.useMemo(()=>(function(e,t,r,n,o=1,i=1){let a=e.map((e,r)=>{let n=(0,s.ut)(e);if(t&&t[r]){let e=100*Math.max(0,Math.min(1,t[r]));return`${n} ${e}%`}return n});return`linear-gradient(${function(e,t,r,n){let o,i;let[a,s]=(o=[0,0],Array.isArray(r)&&(o=[null!=r[0]?r[0]:0,null!=r[1]?r[1]:0]),i=[0,1],Array.isArray(n)&&(i=[null!=n[0]?n[0]:0,null!=n[1]?n[1]:1]),[o,i]);return a[0]*=e,s[0]*=e,a[1]*=t,s[1]*=t,90+180*Math.atan2(s[1]-a[1],s[0]-a[0])/Math.PI}(o,i,r,n)}deg, ${a.join(", ")})`})(e,t,r,n,a,i),[e,t,r,n,a,i]);return(0,c.jsx)(u.Z,{...o,style:[o.style,{backgroundImage:f}],onLayout:e=>{let{width:t,height:r}=e.nativeEvent.layout;d(e=>t!==e.width||r!==e.height?{height:r,width:t}:e),o.onLayout&&o.onLayout(e)}})}let f=(0,n.z)(a.FA,{name:"LinearGradient",overflow:"hidden",position:"relative"}),h=f.styleable((e,t)=>{let r=(0,o.wN)(e),{start:n,end:a,colors:s,locations:l,children:u,...h}=r,m=(0,i.Fg)(),g=r.colors?.map(e=>m[e]?.get("web")??e)||[];return(0,c.jsxs)(f,{ref:t,...h,children:[(0,c.jsx)(d,{start:n,end:a,colors:g,locations:l,style:p}),u]})}),p={position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:0}},663:function(e,t,r){"use strict";r.d(t,{Ex:function(){return S}});var n=r(4975),o=r(2202),i=r(301),a=r(6748),s=r(8338),l=r(1092),u=r(2265),c=r(2281),d=r(357);let f="Progress",[h,p]=(0,i.b)(f),[m,g]=h(f),y="ProgressIndicator",v=(0,n.z)(l.K,{name:y,variants:{unstyled:{false:{height:"100%",width:"100%",backgrounded:!0}}},defaultVariants:{unstyled:"1"===d.env.TAMAGUI_HEADLESS}}),w=v.styleable(function(e,t){let{__scopeProgress:r,...n}=e,o=g(y,r),i=o.max-(o.value??0),a=-(0===o.width?300:o.width)*(i/100);return(0,c.jsx)(v,{"data-state":_(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,x:a,width:o.width,...!e.unstyled&&{animateOnly:["transform"],opacity:0===o.width?0:1},...n,ref:t})});function b(e,t){return`${Math.round(e/t*100)}%`}function _(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}function x(e){return"number"==typeof e}let E=(0,n.z)(l.K,{name:"Progress",variants:{unstyled:{false:{borderRadius:1e5,overflow:"hidden",backgrounded:!0}},size:{"...size":e=>{let t=Math.round(.25*(0,o.Ve)((0,a.ap)(e)));return{height:t,minWidth:20*(0,o.Ve)(t),width:"100%"}}}},defaultVariants:{unstyled:"1"===d.env.TAMAGUI_HEADLESS}}),S=(0,s.$e)(E.styleable(function(e,t){let{__scopeProgress:r,value:n,max:o,getValueLabel:i=b,size:a="$true",...s}=e,l=x(o)&&!Number.isNaN(o)&&o>0?o:100,d=x(n)&&!Number.isNaN(n)&&n<=l&&n>=0?n:null,f=x(d)?i(d,l):void 0,[h,p]=u.useState(0);return(0,c.jsx)(m,{scope:r,value:d,max:l,width:h,children:(0,c.jsx)(E,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":x(d)?d:void 0,"aria-valuetext":f,role:"progressbar","data-state":_(d,l),"data-value":d??void 0,"data-max":l,...!0!==s.unstyled&&{size:a},...s,onLayout:e=>{p(e.nativeEvent.layout.width),s.onLayout?.(e)},ref:t})})}),{Indicator:w})},4363:function(e,t,r){"use strict";let n,o;r.d(t,{Ph:function(){return nR}});var i=r(3370),a=r(9046),s=r(281),l=r(4975),u=r(2202),c=r(9087),d=r(6748),f=r(8338),h=r(3924),p=r(8970),m=r(1676),g=r(1092),y=r(5377),v=r(2026),w=r(2875),b=r(1386),_=r(5986),x=r(9100),E=r(2281),S=r(357);let k=(0,l.z)(g.K,{name:"ListItem",tag:"li",variants:{unstyled:{false:{size:"$true",alignItems:"center",justifyContent:"space-between",flexWrap:"nowrap",width:"100%",borderColor:"$borderColor",maxWidth:"100%",overflow:"hidden",flexDirection:"row",backgroundColor:"$background"}},size:{"...size":(e,{tokens:t})=>({minHeight:t.size[e],paddingHorizontal:t.space[e],paddingVertical:(0,d.Pj)(t.space[e],{shift:-4})})},active:{true:{hoverStyle:{backgroundColor:"$background"}}},disabled:{true:{opacity:.5,pointerEvents:"none"}}},defaultVariants:{unstyled:"1"===S.env.TAMAGUI_HEADLESS}}),R=(0,l.z)(v.J,{name:"ListItemText",variants:{unstyled:{false:{color:"$color",size:"$true",flexGrow:1,flexShrink:1,ellipse:!0,cursor:"default"}}},defaultVariants:{unstyled:"1"===S.env.TAMAGUI_HEADLESS}}),C=(0,l.z)(R,{name:"ListItemSubtitle",variants:{unstyled:{false:{opacity:.6,maxWidth:"100%",color:"$color"}},size:{"...size":(e,t)=>{let r=(0,d.ap)(e,{shift:-1,excludeHalfSteps:!0});return(0,p.H)(r.key,t)}}},defaultVariants:{unstyled:"1"===S.env.TAMAGUI_HEADLESS}}),A=(0,l.z)(R,{name:"ListItemTitle"}),T=(e,{Text:t=R,Subtitle:r=C,Title:n=A}={Text:R,Subtitle:C,Title:A})=>{let o=(0,b.wN)(e),{children:i,icon:a,iconAfter:s,noTextWrap:l,theme:c,space:d,spaceFlex:f,scaleIcon:p=1,scaleSpace:g=1,unstyled:v=!1,subTitle:S,title:k,color:T,fontWeight:M,fontSize:I,fontFamily:O,letterSpacing:z,textAlign:L,ellipse:P,...N}=o,B=o.size||"$true",j=(0,h.yv)(B)*p,[F,U]=[a,s].map((0,m.Zw)({size:j,color:T})),$=(0,u.Ve)((0,_.lz)().space[o.space]??j)*g,D=(0,w.k)(t,{color:T,fontWeight:M,fontSize:I,fontFamily:O,letterSpacing:z,textAlign:L,ellipse:P,children:i});return{props:{...N,children:(0,E.jsxs)(E.Fragment,{children:[F?(0,E.jsxs)(E.Fragment,{children:[F,(0,E.jsx)(x.LZ,{size:$})]}):null,k||S?(0,E.jsxs)(y.FA,{flex:1,children:["all"===l?k:(0,E.jsx)(n,{size:B,children:k}),S?(0,E.jsx)(E.Fragment,{children:"string"==typeof S&&"all"!==l?(0,E.jsx)(r,{unstyled:v,size:B,children:S}):S}):null,D]}):D,U?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(x.LZ,{size:$}),U]}):null]})}}},M=k.styleable(function(e,t){let{props:r}=T(e);return(0,E.jsx)(k,{ref:t,...r})}),I=(0,f.$e)(M,{Text:R,Subtitle:C});var O=r(4624),z=r(6505),L=r(2265),P=r.t(L,2),N=r(7657);let B=({children:e,onOpenChange:t,...r})=>{let n=(0,c.z)(t),o=(0,L.useMemo)(()=>({open:r.open,hidden:r.hidden,disableDrag:r.disableDrag,onOpenChange:n}),[n,r.open,r.hidden,r.disableDrag]);return(0,E.jsx)(N.W.Provider,{value:o,children:e})};var j=r(8619),F=r(1217),U=r(3277);let $={leading:!1},D="Select",H="SelectViewport";var V=r(301);let[W,q]=(0,V.b)(D),[X,Z]=W(D),[K,G]=(0,V.b)(D),[Y,J]=W(D),Q=({__scopeSelect:e,context:t,itemContext:r,children:n})=>(0,E.jsx)(X,{isInSheet:!0,scope:e,...t,children:(0,E.jsx)(Y,{scope:e,...r,children:n})});function ee(e){return en(e)?(e.nodeName||"").toLowerCase():"#document"}function et(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function er(e){var t;return null==(t=(en(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function en(e){return e instanceof Node||e instanceof et(e).Node}function eo(e){return e instanceof Element||e instanceof et(e).Element}function ei(e){return e instanceof HTMLElement||e instanceof et(e).HTMLElement}function ea(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof et(e).ShadowRoot)}function es(e){let{overflow:t,overflowX:r,overflowY:n,display:o}=ed(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function el(e){let t=eu(),r=ed(e);return"none"!==r.transform||"none"!==r.perspective||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||["transform","perspective","filter"].some(e=>(r.willChange||"").includes(e))||["paint","layout","strict","content"].some(e=>(r.contain||"").includes(e))}function eu(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}function ec(e){return["html","body","#document"].includes(ee(e))}function ed(e){return et(e).getComputedStyle(e)}function ef(e){return eo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function eh(e){if("html"===ee(e))return e;let t=e.assignedSlot||e.parentNode||ea(e)&&e.host||er(e);return ea(t)?t.host:t}function ep(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);let o=function e(t){let r=eh(t);return ec(r)?t.ownerDocument?t.ownerDocument.body:t.body:ei(r)&&es(r)?r:e(r)}(e),i=o===(null==(n=e.ownerDocument)?void 0:n.body),a=et(o);return i?t.concat(a,a.visualViewport||[],es(o)?o:[],a.frameElement&&r?ep(a.frameElement):[]):t.concat(o,ep(o,[],r))}function em(e){let t=e.activeElement;for(;(null==(r=t)||null==(r=r.shadowRoot)?void 0:r.activeElement)!=null;){var r;t=t.shadowRoot.activeElement}return t}function eg(e,t){if(!e||!t)return!1;let r=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(r&&ea(r)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function ey(){let e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function ev(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:r}=e;return t+"/"+r}).join(" "):navigator.userAgent}function ew(e){return 0===e.mozInputSource&&!!e.isTrusted||(ex()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function eb(e){return!ev().includes("jsdom/")&&(!ex()&&0===e.width&&0===e.height||ex()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function e_(){return/apple/i.test(navigator.vendor)}function ex(){let e=/android/i;return e.test(ey())||e.test(ev())}function eE(e,t){let r=["mouse","pen"];return t||r.push("",void 0),r.includes(e)}function eS(e){return(null==e?void 0:e.ownerDocument)||document}function ek(e,t){return null!=t&&("composedPath"in e?e.composedPath().includes(t):null!=e.target&&t.contains(e.target))}function eR(e){return"composedPath"in e?e.composedPath()[0]:e.target}function eC(e){return ei(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function eA(e){e.preventDefault(),e.stopPropagation()}function eT(e){return!!e&&"combobox"===e.getAttribute("role")&&eC(e)}let eM=Math.min,eI=Math.max,eO=Math.round,ez=Math.floor,eL=e=>({x:e,y:e});function eP(e,t){return"function"==typeof e?e(t):e}function eN(e){return e.split("-")[0]}function eB(e){return e.split("-")[1]}function ej(e){return["top","bottom"].includes(eN(e))?"y":"x"}function eF(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function eU(e,t,r){let n,{reference:o,floating:i}=e,a=ej(t),s="x"===ej(t)?"y":"x",l="y"===s?"height":"width",u=eN(t),c="y"===a,d=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,h=o[l]/2-i[l]/2;switch(u){case"top":n={x:d,y:o.y-i.height};break;case"bottom":n={x:d,y:o.y+o.height};break;case"right":n={x:o.x+o.width,y:f};break;case"left":n={x:o.x-i.width,y:f};break;default:n={x:o.x,y:o.y}}switch(eB(t)){case"start":n[s]-=h*(r&&c?-1:1);break;case"end":n[s]+=h*(r&&c?-1:1)}return n}let e$=async(e,t,r)=>{let{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:a}=r,s=i.filter(Boolean),l=await (null==a.isRTL?void 0:a.isRTL(t)),u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=eU(u,n,l),f=n,h={},p=0;for(let r=0;r{try{return e.matches(t)}catch(e){return!1}})}function eQ(e){return eG(er(e)).left+ef(e).scrollLeft}function e0(e,t,r){let n;if("viewport"===t)n=function(e,t){let r=et(e),n=er(e),o=r.visualViewport,i=n.clientWidth,a=n.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;let e=eu();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,r);else if("document"===t)n=function(e){let t=er(e),r=ef(e),n=e.ownerDocument.body,o=eI(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=eI(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),a=-r.scrollLeft+eQ(e),s=-r.scrollTop;return"rtl"===ed(n).direction&&(a+=eI(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:a,y:s}}(er(e));else if(eo(t))n=function(e,t){let r=eG(e,!0,"fixed"===t),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=ei(e)?eX(e):eL(1),a=e.clientWidth*i.x;return{width:a,height:e.clientHeight*i.y,x:o*i.x,y:n*i.y}}(t,r);else{let r=eK(e);n={...t,x:t.x-r.x,y:t.y-r.y}}return eF(n)}function e1(e,t){return ei(e)&&"fixed"!==ed(e).position?t?t(e):e.offsetParent:null}function e2(e,t){let r=et(e);if(!ei(e)||eJ(e))return r;let n=e1(e,t);for(;n&&["table","td","th"].includes(ee(n))&&"static"===ed(n).position;)n=e1(n,t);return n&&("html"===ee(n)||"body"===ee(n)&&"static"===ed(n).position&&!el(n))?r:n||function(e){let t=eh(e);for(;ei(t)&&!ec(t);){if(el(t))return t;t=eh(t)}return null}(e)||r}let e6=async function(e){let t=this.getOffsetParent||e2,r=this.getDimensions;return{reference:function(e,t,r){let n=ei(t),o=er(t),i="fixed"===r,a=eG(e,!0,i,t),s={scrollLeft:0,scrollTop:0},l=eL(0);if(n||!n&&!i){if(("body"!==ee(t)||es(o))&&(s=ef(t)),n){let e=eG(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=eQ(o))}return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await r(e.floating)}}},e5={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e,i="fixed"===o,a=er(n),s=!!t&&eJ(t.floating);if(n===a||s&&i)return r;let l={scrollLeft:0,scrollTop:0},u=eL(1),c=eL(0),d=ei(n);if((d||!d&&!i)&&(("body"!==ee(n)||es(a))&&(l=ef(n)),ei(n))){let e=eG(n);u=eX(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x,y:r.y*u.y-l.scrollTop*u.y+c.y}},getDocumentElement:er,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e,i=[..."clippingAncestors"===r?function(e,t){let r=t.get(e);if(r)return r;let n=ep(e,[],!1).filter(e=>eo(e)&&"body"!==ee(e)),o=null,i="fixed"===ed(e).position,a=i?eh(e):e;for(;eo(a)&&!ec(a);){let t=ed(a),r=el(a);r||"fixed"!==t.position||(o=null),(i?!r&&!o:!r&&"static"===t.position&&!!o&&["absolute","fixed"].includes(o.position)||es(a)&&!r&&function e(t,r){let n=eh(t);return!(n===r||!eo(n)||ec(n))&&("fixed"===ed(n).position||e(n,r))}(e,a))?n=n.filter(e=>e!==a):o=t,a=eh(a)}return t.set(e,n),n}(t,this._c):[].concat(r),n],a=i[0],s=i.reduce((e,r)=>{let n=e0(t,r,o);return e.top=eI(n.top,e.top),e.right=eM(n.right,e.right),e.bottom=eM(n.bottom,e.bottom),e.left=eI(n.left,e.left),e},e0(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:e2,getElementRects:e6,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=eW(e);return{width:t,height:r}},getScale:eX,isElement:eo,isRTL:function(e){return"rtl"===ed(e).direction}};function e3(e,t,r,n){let o;void 0===n&&(n={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:u=!1}=n,c=eq(e),d=i||a?[...c?ep(c):[],...ep(t)]:[];d.forEach(e=>{i&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});let f=c&&l?function(e,t){let r,n=null,o=er(e);function i(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();let{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;let h=ez(c),p=ez(o.clientWidth-(u+d)),m={rootMargin:-h+"px "+-p+"px "+-ez(o.clientHeight-(c+f))+"px "+-ez(u)+"px",threshold:eI(0,eM(1,l))||1},g=!0;function y(e){let t=e[0].intersectionRatio;if(t!==l){if(!g)return a();t?a(!1,t):r=setTimeout(()=>{a(!1,1e-7)},100)}g=!1}try{n=new IntersectionObserver(y,{...m,root:o.ownerDocument})}catch(e){n=new IntersectionObserver(y,m)}n.observe(e)}(!0),i}(c,r):null,h=-1,p=null;s&&(p=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),r()}),c&&!u&&p.observe(c),p.observe(t));let m=u?eG(e):null;return u&&function t(){let n=eG(e);m&&(n.x!==m.x||n.y!==m.y||n.width!==m.width||n.height!==m.height)&&r(),m=n,o=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{i&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==f||f(),null==(e=p)||e.disconnect(),p=null,u&&cancelAnimationFrame(o)}}let e8=(e,t,r)=>{let n=new Map,o={platform:e5,...r},i={...o.platform,_c:n};return e$(e,t,{...o,platform:i})};var e4=r(4887),e7="undefined"!=typeof document?L.useLayoutEffect:L.useEffect;function e9(e,t){let r,n,o;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((r=e.length)!==t.length)return!1;for(n=r;0!=n--;)if(!e9(e[n],t[n]))return!1;return!0}if((r=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!({}).hasOwnProperty.call(t,o[n]))return!1;for(n=r;0!=n--;){let r=o[n];if(("_owner"!==r||!e.$$typeof)&&!e9(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function te(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tt(e,t){let r=te(e);return Math.round(t*r)/r}function tr(e){let t=L.useRef(e);return e7(()=>{t.current=e}),t}var tn='input:not([inert]),select:not([inert]),textarea:not([inert]),a[href]:not([inert]),button:not([inert]),[tabindex]:not(slot):not([inert]),audio[controls]:not([inert]),video[controls]:not([inert]),[contenteditable]:not([contenteditable="false"]):not([inert]),details>summary:first-of-type:not([inert]),details:not([inert])',to="undefined"==typeof Element,ti=to?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ta=!to&&Element.prototype.getRootNode?function(e){var t;return null==e?void 0:null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},ts=function e(t,r){void 0===r&&(r=!0);var n,o=null==t?void 0:null===(n=t.getAttribute)||void 0===n?void 0:n.call(t,"inert");return""===o||"true"===o||r&&t&&e(t.parentNode)},tl=function(e){var t,r=null==e?void 0:null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===r||"true"===r},tu=function(e,t,r){if(ts(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(tn));return t&&ti.call(e,tn)&&n.unshift(e),n=n.filter(r)},tc=function e(t,r,n){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(!ts(a,!1)){if("SLOT"===a.tagName){var s=a.assignedElements(),l=e(s.length?s:a.children,!0,n);n.flatten?o.push.apply(o,l):o.push({scopeParent:a,candidates:l})}else{ti.call(a,tn)&&n.filter(a)&&(r||!t.includes(a))&&o.push(a);var u=a.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(a),c=!ts(u,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(u&&c){var d=e(!0===u?a.children:u.children,!0,n);n.flatten?o.push.apply(o,d):o.push({scopeParent:a,candidates:d})}else i.unshift.apply(i,a.children)}}}return o},td=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},tf=function(e){if(!e)throw Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||tl(e))&&!td(e)?0:e.tabIndex},th=function(e,t){var r=tf(e);return r<0&&t&&!td(e)?0:r},tp=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},tm=function(e){return"INPUT"===e.tagName},tg=function(e,t){for(var r=0;rsummary:first-of-type")?e.parentElement:e;if(ti.call(o,"details:not([open]) *"))return!0;if(r&&"full"!==r&&"legacy-full"!==r){if("non-zero-area"===r)return tw(e)}else{if("function"==typeof n){for(var i=e;e;){var a=e.parentElement,s=ta(e);if(a&&!a.shadowRoot&&!0===n(a))return tw(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host}e=i}if(tv(e))return!e.getClientRects().length;if("legacy-full"!==r)return!0}return!1},t_=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var r=0;rtf(t))&&(n=e,!((o=t).disabled||ts(o)||tm(o)&&"hidden"===o.type||tb(o,n)||"DETAILS"===o.tagName&&Array.prototype.slice.apply(o.children).some(function(e){return"SUMMARY"===e.tagName})||t_(o)))},tE=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!isNaN(t)||t>=0},tS=function e(t){var r=[],n=[];return t.forEach(function(t,o){var i=!!t.scopeParent,a=i?t.scopeParent:t,s=th(a,i),l=i?e(t.candidates):a;0===s?i?r.push.apply(r,l):r.push(a):n.push({documentOrder:o,tabIndex:s,item:t,isScope:i,content:l})}),n.sort(tp).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(r)},tk=function(e,t){return tS((t=t||{}).getShadowRoot?tc([e],t.includeContainer,{filter:tx.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:tE}):tu(e,t.includeContainer,tx.bind(null,t)))},tR=function(e,t){if(t=t||{},!e)throw Error("No node provided");return!1!==ti.call(e,tn)&&tx(t,e)};let tC={...P},tA=tC.useInsertionEffect||(e=>e());function tT(e){let t=L.useRef(()=>{});return tA(()=>{t.current=e}),L.useCallback(function(){for(var e=arguments.length,r=Array(e),n=0;n=e.current.length}function tN(e,t){return tj(e,{disabledIndices:t})}function tB(e,t){return tj(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function tj(e,t){let{startingIndex:r=-1,decrement:n=!1,disabledIndices:o,amount:i=1}=void 0===t?{}:t,a=e.current,s=o?e=>o.includes(e):e=>{let t=a[e];return null==t||t.hasAttribute("disabled")||"true"===t.getAttribute("aria-disabled")},l=r;do l+=n?-i:i;while(l>=0&&l<=a.length-1&&s(l));return l}let tF=0;function tU(e,t){void 0===t&&(t={});let{preventScroll:r=!1,cancelPrevious:n=!0,sync:o=!1}=t;n&&cancelAnimationFrame(tF);let i=()=>null==e?void 0:e.focus({preventScroll:r});o?i():tF=requestAnimationFrame(i)}var t$="undefined"!=typeof document?L.useLayoutEffect:L.useEffect;function tD(){return(tD=Object.assign?Object.assign.bind():function(e){for(var t=1;t"floating-ui-"+Math.random().toString(36).slice(2,6)+tV++,tq=tC.useId||function(){let[e,t]=L.useState(()=>tH?tW():void 0);return t$(()=>{null==e&&t(tW())},[]),L.useEffect(()=>{tH=!0},[]),e},tX=L.createContext(null),tZ=L.createContext(null),tK=()=>{var e;return(null==(e=L.useContext(tX))?void 0:e.id)||null},tG=()=>L.useContext(tZ);function tY(e){return"data-floating-ui-"+e}function tJ(e){let t=(0,L.useRef)(e);return t$(()=>{t.current=e}),t}function tQ(e,t){let r=e.filter(e=>{var r;return e.parentId===t&&(null==(r=e.context)?void 0:r.open)}),n=r;for(;n.length;)n=e.filter(e=>{var t;return null==(t=n)?void 0:t.some(t=>{var r;return e.parentId===t.id&&(null==(r=e.context)?void 0:r.open)})}),r=r.concat(n);return r}let t0=new WeakMap,t1=new WeakSet,t2={},t6=0,t5=()=>"undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,t3=e=>e&&(e.host||t3(e.parentNode)),t8=(e,t)=>t.map(t=>{if(e.contains(t))return t;let r=t3(t);return e.contains(r)?r:null}).filter(e=>null!=e);function t4(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);let n=eS(e[0]).body;return function(e,t,r,n){let o="data-floating-ui-inert",i=n?"inert":r?"aria-hidden":null,a=t8(t,e),s=new Set,l=new Set(a),u=[];t2[o]||(t2[o]=new WeakMap);let c=t2[o];return a.forEach(function e(t){!(!t||s.has(t))&&(s.add(t),t.parentNode&&e(t.parentNode))}),function e(t){!t||l.has(t)||Array.prototype.forEach.call(t.children,t=>{if(s.has(t))e(t);else{let e=i?t.getAttribute(i):null,r=null!==e&&"false"!==e,n=(t0.get(t)||0)+1,a=(c.get(t)||0)+1;t0.set(t,n),c.set(t,a),u.push(t),1===n&&r&&t1.add(t),1===a&&t.setAttribute(o,""),!r&&i&&t.setAttribute(i,"true")}})}(t),s.clear(),t6++,()=>{u.forEach(e=>{let t=(t0.get(e)||0)-1,r=(c.get(e)||0)-1;t0.set(e,t),c.set(e,r),t||(!t1.has(e)&&i&&e.removeAttribute(i),t1.delete(e)),r||e.removeAttribute(o)}),--t6||(t0=new WeakMap,t0=new WeakMap,t1=new WeakSet,t2={})}}(e.concat(Array.from(n.querySelectorAll("[aria-live]"))),n,t,r)}let t7=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function t9(e,t){let r=tk(e,t7());"prev"===t&&r.reverse();let n=r.indexOf(em(eS(e)));return r.slice(n+1)[0]}function re(){return t9(document.body,"next")}function rt(){return t9(document.body,"prev")}function rr(e,t){let r=t||e.currentTarget,n=e.relatedTarget;return!n||!eg(r,n)}let rn={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};function ro(e){"Tab"===e.key&&(e.target,clearTimeout(n))}let ri=L.forwardRef(function(e,t){let[r,n]=L.useState();t$(()=>(e_()&&n("button"),document.addEventListener("keydown",ro),()=>{document.removeEventListener("keydown",ro)}),[]);let o={ref:t,tabIndex:0,role:r,"aria-hidden":!r||void 0,[tY("focus-guard")]:"",style:rn};return L.createElement("span",tD({},e,o))}),ra=L.createContext(null),rs=tY("portal");function rl(e){let{children:t,id:r,root:n=null,preserveTabOrder:o=!0}=e,i=function(e){void 0===e&&(e={});let{id:t,root:r}=e,n=tq(),o=ru(),[i,a]=L.useState(null),s=L.useRef(null);return t$(()=>()=>{null==i||i.remove(),queueMicrotask(()=>{s.current=null})},[i]),t$(()=>{if(s.current)return;let e=t?document.getElementById(t):null;if(!e)return;let r=document.createElement("div");r.id=n,r.setAttribute(rs,""),e.appendChild(r),s.current=r,a(r)},[t,n]),t$(()=>{if(s.current)return;let e=r||(null==o?void 0:o.portalNode);e&&!eo(e)&&(e=e.current),e=e||document.body;let i=null;t&&((i=document.createElement("div")).id=t,e.appendChild(i));let l=document.createElement("div");l.id=n,l.setAttribute(rs,""),(e=i||e).appendChild(l),s.current=l,a(l)},[t,r,n,o]),i}({id:r,root:n}),[a,s]=L.useState(null),l=L.useRef(null),u=L.useRef(null),c=L.useRef(null),d=L.useRef(null),f=!!a&&!a.modal&&a.open&&o&&!!(n||i);return L.useEffect(()=>{if(i&&o&&(null==a||!a.modal))return i.addEventListener("focusin",e,!0),i.addEventListener("focusout",e,!0),()=>{i.removeEventListener("focusin",e,!0),i.removeEventListener("focusout",e,!0)};function e(e){i&&rr(e)&&("focusin"===e.type?function(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}:function(e){tk(e,t7()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})})(i)}},[i,o,null==a?void 0:a.modal]),L.createElement(ra.Provider,{value:L.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:c,afterInsideRef:d,portalNode:i,setFocusManagerState:s}),[o,i])},f&&i&&L.createElement(ri,{"data-type":"outside",ref:l,onFocus:e=>{if(rr(e,i)){var t;null==(t=c.current)||t.focus()}else{let e=rt()||(null==a?void 0:a.refs.domReference.current);null==e||e.focus()}}}),f&&i&&L.createElement("span",{"aria-owns":i.id,style:rn}),i&&(0,e4.createPortal)(t,i),f&&i&&L.createElement(ri,{"data-type":"outside",ref:u,onFocus:e=>{if(rr(e,i)){var t;null==(t=d.current)||t.focus()}else{let t=re()||(null==a?void 0:a.refs.domReference.current);null==t||t.focus(),(null==a?void 0:a.closeOnFocusOut)&&(null==a||a.onOpenChange(!1,e.nativeEvent))}}}))}let ru=()=>L.useContext(ra),rc=[];function rd(e){rc=rc.filter(e=>e.isConnected);let t=e;if(t&&"body"!==ee(t)){if(!tR(t,t7())){let e=tk(t,t7())[0];if(!e)return;t=e}rc.push(t),rc.length>20&&(rc=rc.slice(-20))}}function rf(){return rc.slice().reverse().find(e=>e.isConnected)}let rh=L.forwardRef(function(e,t){return L.createElement("button",tD({},e,{type:"button",ref:t,tabIndex:-1,style:rn}))});function rp(e){let{context:t,children:r,disabled:n=!1,order:o=["content"],guards:i=!0,initialFocus:a=0,returnFocus:s=!0,modal:l=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:c=!0}=e,{open:d,refs:f,nodeId:h,onOpenChange:p,events:m,dataRef:g,elements:{domReference:y,floating:v}}=t,w="number"==typeof a&&a<0,b=eT(y)&&w,_=!t5()||i,x=tJ(o),E=tJ(a),S=tJ(s),k=tG(),R=ru(),C=L.useRef(null),A=L.useRef(null),T=L.useRef(!1),M=L.useRef(!1),I=null!=R,O=L.useCallback(function(e){return void 0===e&&(e=v),e?tk(e,t7()):[]},[v]),z=L.useCallback(e=>{let t=O(e);return x.current.map(e=>y&&"reference"===e?y:v&&"floating"===e?v:t).filter(Boolean).flat()},[y,v,x,O]);function P(e){return!n&&u&&l?L.createElement(rh,{ref:"start"===e?C:A,onClick:e=>p(!1,e.nativeEvent)},"string"==typeof u?u:"Dismiss"):null}L.useEffect(()=>{if(n||!l)return;function e(e){if("Tab"===e.key){eg(v,em(eS(v)))&&0===O().length&&!b&&eA(e);let t=z(),r=eR(e);"reference"===x.current[0]&&r===y&&(eA(e),e.shiftKey?tU(t[t.length-1]):tU(t[1])),"floating"===x.current[1]&&r===v&&e.shiftKey&&(eA(e),tU(t[0]))}}let t=eS(v);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[n,y,v,l,x,b,O,z]),L.useEffect(()=>{if(!n&&c&&v&&ei(y))return y.addEventListener("focusout",t),y.addEventListener("pointerdown",e),l||v.addEventListener("focusout",t),()=>{y.removeEventListener("focusout",t),y.removeEventListener("pointerdown",e),l||v.removeEventListener("focusout",t)};function e(){M.current=!0,setTimeout(()=>{M.current=!1})}function t(e){let t=e.relatedTarget;queueMicrotask(()=>{let r=!(eg(y,t)||eg(v,t)||eg(t,v)||eg(null==R?void 0:R.portalNode,t)||null!=t&&t.hasAttribute(tY("focus-guard"))||k&&(tQ(k.nodesRef.current,h).find(e=>{var r,n;return eg(null==(r=e.context)?void 0:r.elements.floating,t)||eg(null==(n=e.context)?void 0:n.elements.domReference,t)})||(function(e,t){var r;let n=[],o=null==(r=e.find(e=>e.id===t))?void 0:r.parentId;for(;o;){let t=e.find(e=>e.id===o);o=null==t?void 0:t.parentId,t&&(n=n.concat(t))}return n})(k.nodesRef.current,h).find(e=>{var r,n;return(null==(r=e.context)?void 0:r.elements.floating)===t||(null==(n=e.context)?void 0:n.elements.domReference)===t})));t&&r&&!M.current&&t!==rf()&&(T.current=!0,p(!1,e))})}},[n,y,v,l,h,k,R,p,c]),L.useEffect(()=>{var e;if(n)return;let t=Array.from((null==R||null==(e=R.portalNode)?void 0:e.querySelectorAll("["+tY("portal")+"]"))||[]);if(v){let e=[v,...t,C.current,A.current,x.current.includes("reference")||b?y:null].filter(e=>null!=e),r=l||b?t4(e,_,!_):t4(e);return()=>{r()}}},[n,y,v,l,x,R,b,_]),t$(()=>{if(n||!v)return;let e=em(eS(v));queueMicrotask(()=>{let t=z(v),r=E.current,n=("number"==typeof r?t[r]:r.current)||v,o=eg(v,e);w||o||!d||tU(n,{preventScroll:n===v})})},[n,d,v,w,z,E]),t$(()=>{if(n||!v)return;let e=!1,t=eS(v),r=em(t),o=g.current;function i(t){let{reason:r,event:n,nested:o}=t;"escape-key"===r&&f.domReference.current&&rd(f.domReference.current),"hover"===r&&"mouseleave"===n.type&&(T.current=!0),"outside-press"===r&&(o?(T.current=!1,e=!0):T.current=!(ew(n)||eb(n)))}return rd(r),m.on("openchange",i),()=>{m.off("openchange",i);let r=em(t),n=eg(v,r)||k&&tQ(k.nodesRef.current,h).some(e=>{var t;return eg(null==(t=e.context)?void 0:t.elements.floating,r)});(n||o.openEvent&&["click","mousedown"].includes(o.openEvent.type))&&f.domReference.current&&rd(f.domReference.current);let a=rf();S.current&&!T.current&&ei(a)&&(a===r||r===t.body||n)&&tU(a,{cancelPrevious:!1,preventScroll:e})}},[n,v,S,g,f,m,k,h]),t$(()=>{if(!n&&R)return R.setFocusManagerState({modal:l,closeOnFocusOut:c,open:d,onOpenChange:p,refs:f}),()=>{R.setFocusManagerState(null)}},[n,R,l,d,p,f,c]),t$(()=>{if(n||!v||"function"!=typeof MutationObserver||w)return;let e=()=>{let e=v.getAttribute("tabindex");x.current.includes("floating")||em(eS(v))!==f.domReference.current&&0===O().length?"0"!==e&&v.setAttribute("tabindex","0"):"-1"!==e&&v.setAttribute("tabindex","-1")};e();let t=new MutationObserver(e);return t.observe(v,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}},[n,v,f,x,O,w]);let N=!n&&_&&(I||l);return L.createElement(L.Fragment,null,N&&L.createElement(ri,{"data-type":"inside",ref:null==R?void 0:R.beforeInsideRef,onFocus:e=>{if(l){let e=z();tU("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=R&&R.preserveTabOrder&&R.portalNode){if(T.current=!1,rr(e,R.portalNode)){let e=re()||y;null==e||e.focus()}else{var t;null==(t=R.beforeOutsideRef.current)||t.focus()}}}}),!b&&P("start"),r,P("end"),N&&L.createElement(ri,{"data-type":"inside",ref:null==R?void 0:R.afterInsideRef,onFocus:e=>{if(l)tU(z()[0]);else if(null!=R&&R.preserveTabOrder&&R.portalNode){if(c&&(T.current=!0),rr(e,R.portalNode)){let e=rt()||y;null==e||e.focus()}else{var t;null==(t=R.afterOutsideRef.current)||t.focus()}}}}))}let rm=new Set,rg=L.forwardRef(function(e,t){let{lockScroll:r=!1,...n}=e,o=tq();return t$(()=>{if(!r)return;rm.add(o);let e=/iP(hone|ad|od)|iOS/.test(ey()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",i=window.innerWidth-document.documentElement.clientWidth,a=t.left?parseFloat(t.left):window.pageXOffset,s=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",i&&(t[n]=i+"px"),e){var l,u;let e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0;Object.assign(t,{position:"fixed",top:-(s-Math.floor((null==(u=window.visualViewport)?void 0:u.offsetTop)||0))+"px",left:-(a-Math.floor(e))+"px",right:"0"})}return()=>{rm.delete(o),0===rm.size&&(Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(a,s)))}},[o,r]),L.createElement("div",tD({ref:t},n,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...n.style}}))});function ry(e){return ei(e.target)&&"BUTTON"===e.target.tagName}let rv={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},rw={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},rb=e=>{var t,r;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(r=null==e?void 0:e.outsidePress)||r}};function r_(e){var t;void 0===e&&(e={});let{open:r=!1,onOpenChange:n,nodeId:o}=e,[i,a]=L.useState(null),[s,l]=L.useState(null),u=(null==(t=e.elements)?void 0:t.reference)||i;t$(()=>{u&&(p.current=u)},[u]);let c=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[c,d]=L.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,h]=L.useState(n);e9(f,n)||h(n);let[p,m]=L.useState(null),[g,y]=L.useState(null),v=L.useCallback(e=>{e!==x.current&&(x.current=e,m(e))},[]),w=L.useCallback(e=>{e!==E.current&&(E.current=e,y(e))},[]),b=i||p,_=a||g,x=L.useRef(null),E=L.useRef(null),S=L.useRef(c),k=null!=l,R=tr(l),C=tr(o),A=L.useCallback(()=>{if(!x.current||!E.current)return;let e={placement:t,strategy:r,middleware:f};C.current&&(e.platform=C.current),e8(x.current,E.current,e).then(e=>{let t={...e,isPositioned:!0};T.current&&!e9(S.current,t)&&(S.current=t,e4.flushSync(()=>{d(t)}))})},[f,t,r,C]);e7(()=>{!1===u&&S.current.isPositioned&&(S.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[u]);let T=L.useRef(!1);e7(()=>(T.current=!0,()=>{T.current=!1}),[]),e7(()=>{if(b&&(x.current=b),_&&(E.current=_),b&&_){if(R.current)return R.current(b,_,A);A()}},[b,_,A,R,k]);let M=L.useMemo(()=>({reference:x,floating:E,setReference:v,setFloating:w}),[v,w]),I=L.useMemo(()=>({reference:b,floating:_}),[b,_]),O=L.useMemo(()=>{let e={position:r,left:0,top:0};if(!I.floating)return e;let t=tt(I.floating,c.x),n=tt(I.floating,c.y);return s?{...e,transform:"translate("+t+"px, "+n+"px)",...te(I.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,s,I.floating,c.x,c.y]);return L.useMemo(()=>({...c,update:A,refs:M,elements:I,floatingStyles:O}),[c,A,M,I,O])}({...e,elements:{...e.elements,...s&&{reference:s}}}),d=tG(),f=null!=tK(),h=tT((e,t,r)=>{m.current.openEvent=e?t:void 0,g.emit("openchange",{open:e,event:t,reason:r,nested:f}),null==n||n(e,t,r)}),p=L.useRef(null),m=L.useRef({}),g=L.useState(()=>(function(){let e=new Map;return{emit(t,r){var n;null==(n=e.get(t))||n.forEach(e=>e(r))},on(t,r){e.set(t,[...e.get(t)||[],r])},off(t,r){var n;e.set(t,(null==(n=e.get(t))?void 0:n.filter(e=>e!==r))||[])}}})())[0],y=tq(),v=L.useCallback(e=>{let t=eo(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l(t),c.refs.setReference(t)},[c.refs]),w=L.useCallback(e=>{(eo(e)||null===e)&&(p.current=e,a(e)),(eo(c.refs.reference.current)||null===c.refs.reference.current||null!==e&&!eo(e))&&c.refs.setReference(e)},[c.refs]),b=L.useMemo(()=>({...c.refs,setReference:w,setPositionReference:v,domReference:p}),[c.refs,w,v]),_=L.useMemo(()=>({...c.elements,domReference:u}),[c.elements,u]),x=L.useMemo(()=>({...c,refs:b,elements:_,dataRef:m,nodeId:o,floatingId:y,events:g,open:r,onOpenChange:h}),[c,o,y,g,r,h,b,_]);return t$(()=>{let e=null==d?void 0:d.nodesRef.current.find(e=>e.id===o);e&&(e.context=x)}),L.useMemo(()=>({...c,context:x,refs:b,elements:_}),[c,b,_,x])}let rx="active",rE="selected";function rS(e,t,r){let n=new Map,o="item"===r,i=e;if(o&&e){let{[rx]:t,[rE]:r,...n}=e;i=n}return{..."floating"===r&&{tabIndex:-1},...i,...t.map(t=>{let n=t?t[r]:null;return"function"==typeof n?e?n(e):null:n}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[r,i]=t;if(!(o&&[rx,rE].includes(r))){if(0===r.indexOf("on")){if(n.has(r)||n.set(r,[]),"function"==typeof i){var a;null==(a=n.get(r))||a.push(i),e[r]=function(){for(var e,t=arguments.length,o=Array(t),i=0;ie(...o)).find(e=>void 0!==e)}}}else e[r]=i}}),e),{})}}let rk=!1;function rR(e,t,r){switch(e){case"vertical":return t;case"horizontal":return r;default:return t||r}}function rC(e,t){return rR(t,e===tM||e===tI,e===tO||e===tz)}function rA(e,t,r){return rR(t,e===tI,r?e===tO:e===tz)||"Enter"===e||" "===e||""===e}function rT(e,t,r){return rR(t,r?e===tz:e===tO,e===tM)}let rM=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function rI(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}let rO=e=>({name:"inner",options:e,async fn(t){let{listRef:r,overflowRef:n,onFallbackChange:o,offset:i=0,index:a=0,minItemsVisible:s=4,referenceOverflowThreshold:l=0,scrollRef:u,...c}=e,{rects:d,elements:{floating:f}}=t,h=r.current[a];if(!h)return{};let p={...t,...await eV(-h.offsetTop-f.clientTop-d.reference.height/2-h.offsetHeight/2-i).fn(t)},m=(null==u?void 0:u.current)||f,g=await eD(rI(p,m.scrollHeight),c),y=await eD(p,{...c,elementContext:"reference"}),v=Math.max(0,g.top),w=p.y+v,b=Math.max(0,m.scrollHeight-v-Math.max(0,g.bottom));return m.style.maxHeight=b+"px",m.scrollTop=v,o&&(m.offsetHeight=-l||y.bottom>=-l?(0,e4.flushSync)(()=>o(!0)):(0,e4.flushSync)(()=>o(!1))),n&&(n.current=await eD(rI({...p,y:w},m.offsetHeight),c)),{y:w}}});var rz=r(4582),rL=r(1130),rP=r(6616);let rN=()=>!s.$L||!!(0,rP.S)()&&s.wT,rB="focusScope.autoFocusOnMount",rj="focusScope.autoFocusOnUnmount",rF={bubbles:!1,cancelable:!0},rU=L.forwardRef(function(e,t){let r=function(e,t){let{loop:r=!1,enabled:n=!0,trapped:o=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,forceUnmount:l,children:u,...d}=e,[f,h]=L.useState(null),p=(0,c.z)(i),m=(0,c.z)(s),g=L.useRef(null),y=(0,a.ex)(t,e=>h(e)),v=L.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;L.useEffect(()=>{if(!n||!o)return;let e=new AbortController;function t(t){if(v.paused||!f)return;let r=t.target;f.contains(r)?(r?.addEventListener("blur",i,{signal:e.signal}),g.current=r):rH(g.current,{select:!0})}function r(t){e.abort(),!(v.paused||!f)&&(f.contains(t.relatedTarget)||rH(g.current,{select:!0}))}function i(){g.current=f}return document.addEventListener("focusin",t),document.addEventListener("focusout",r),()=>{e.abort(),document.removeEventListener("focusin",t),document.removeEventListener("focusout",r)}},[o,l,f,v.paused]),L.useEffect(()=>{if(!n||!f||l)return;rV.add(v);let e=document.activeElement;if(!f.contains(e)){let t=new CustomEvent(rB,rF);f.addEventListener(rB,p),f.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){let r=document.activeElement;for(let n of e)if(rH(n,{select:t}),document.activeElement!==r)return}(r$(f).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&rH(f))}return()=>{f.removeEventListener(rB,p);let t=new CustomEvent(rj,rF);f.addEventListener(rj,m),f.dispatchEvent(t),t.defaultPrevented||rH(e??document.body,{select:!0}),f.removeEventListener(rj,m),rV.remove(v)}},[n,f,l,p,m,v]);let w=L.useCallback(e=>{if(!o||!r||v.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){let t=e.currentTarget,[o,i]=function(e){let t=r$(e);return[rD(t,e),rD(t.reverse(),e)]}(t);o&&i?e.shiftKey||n!==i?e.shiftKey&&n===o&&(e.preventDefault(),r&&rH(i,{select:!0})):(e.preventDefault(),r&&rH(o,{select:!0})):n===t&&e.preventDefault()}},[r,o,v.paused]);return{tabIndex:-1,...d,ref:y,onKeyDown:w}}(e,t);return"function"==typeof e.children?(0,E.jsx)(E.Fragment,{children:e.children(r)}):L.cloneElement(L.Children.only(e.children),r)});function r$(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function rD(e,t){for(let r of e)if(!function(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(r,{upTo:t}))return r}function rH(e,{select:t=!1}={}){if(e?.focus){var r;let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&(r=e)instanceof HTMLInputElement&&"select"in r&&t&&e.select()}}let rV=(o=[],{add(e){let t=o[0];e!==t&&t?.pause(),(o=rW(o,e)).unshift(e)},remove(e){o=rW(o,e),o[0]?.resume()}});function rW(e,t){let r=[...e],n=r.indexOf(t);return -1!==n&&r.splice(n,1),r}var rq=r(9097);let rX=e=>{let t=(0,rq.GS)();return!!e&&(!0===e||!!e&&t[e])},rZ=e=>{let t=rX(e.sheetBreakpoint);return!1!==e.open&&t},rK="SelectContent",rG=e=>{var t;let{__scopeSelect:r,children:n,open:o=!1,selectedIndexRef:i,listContentRef:a}=e,l=Z("SelectSheetImpl",r),u=J("SelectSheetImpl",r),{setActiveIndex:d,selectedIndex:f,activeIndex:h,forceUpdate:p}=l,{setOpen:m,setSelectedIndex:g}=u,[y,v]=L.useState(0),w=rN(),b=L.useRef([]),_=L.useRef(null),x=L.useRef(null),S=L.useRef(null),k=L.useRef(!1),R=L.useRef(!0),C=L.useRef(),A=L.useRef({isMouseOutside:!1}),[T,M]=L.useState(!1),[I,O]=L.useState(!1),[z,P]=L.useState(0),[N,B]=L.useState(!1),j=L.useRef({});(0,s.LI)(()=>{queueMicrotask(()=>{o||(v(0),O(!1),d(null),M(!1))})},[o,d]),s.$L&&s.C5&&(0,s.LI)(()=>{if(!o)return;let e=e=>{A.current.isMouseOutside&&m(!1)};return document.addEventListener("mouseup",e),()=>{document.removeEventListener("mouseup",e)}},[o]);let{x:F,y:U,strategy:$,context:D,refs:H,update:V}=r_({open:o,onOpenChange:m,placement:"bottom-start",whileElementsMounted:e3,middleware:[{name:"size",options:t={apply({rects:{reference:{width:e}}}){Object.assign(j.current,{minWidth:e+8}),H.floating.current&&Object.assign(H.floating.current.style,j.current)}},async fn(e){let r,n;let{placement:o,rects:i,platform:a,elements:s}=e,{apply:l=()=>{},...u}=eP(t,e),c=await eD(e,u),d=eN(o),f=eB(o),h="y"===ej(o),{width:p,height:m}=i.floating;"top"===d||"bottom"===d?(r=d,n=f===(await (null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(n=d,r="end"===f?"top":"bottom");let g=m-c[r],y=p-c[n],v=!e.middlewareData.shift,w=g,b=y;if(h){let e=p-c.left-c.right;b=f||v?eM(y,e):e}else{let e=m-c.top-c.bottom;w=f||v?eM(g,e):e}if(v&&!f){let e=eI(c.left,0),t=eI(c.right,0),r=eI(c.top,0),n=eI(c.bottom,0);h?b=p-2*(0!==e||0!==t?e+t:eI(c.left,c.right)):w=m-2*(0!==r||0!==n?r+n:eI(c.top,c.bottom))}await l({...e,availableWidth:b,availableHeight:w});let _=await a.getDimensions(s.floating);return p!==_.width||m!==_.height?{reset:{rects:!0}}:{}}},rO({listRef:b,overflowRef:_,index:f,offset:z,onFallbackChange:O,padding:10,minItemsVisible:w?10:4,referenceOverflowThreshold:20}),eV({crossAxis:-5})]}),W=H.floating,q=o&&y>8,K=o&&W.current&&y(window.addEventListener("resize",V),o&&V(),()=>window.removeEventListener("resize",V)),[V,o]);let G=(0,c.z)(e=>(o?d:g)(e)),Q=[function(e,t){void 0===t&&(t={});let{open:r,onOpenChange:n,dataRef:o,elements:{domReference:i}}=e,{enabled:a=!0,event:s="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:c=!0}=t,d=L.useRef(),f=L.useRef(!1);return L.useMemo(()=>a?{reference:{onPointerDown(e){d.current=e.pointerType},onMouseDown(e){0!==e.button||eE(d.current,!0)&&u||"click"===s||(r&&l&&(!o.current.openEvent||"mousedown"===o.current.openEvent.type)?n(!1,e.nativeEvent,"click"):(e.preventDefault(),n(!0,e.nativeEvent,"click")))},onClick(e){if("mousedown"===s&&d.current){d.current=void 0;return}eE(d.current,!0)&&u||(r&&l&&(!o.current.openEvent||"click"===o.current.openEvent.type)?n(!1,e.nativeEvent,"click"):n(!0,e.nativeEvent,"click"))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!c||ry(e)||(" "!==e.key||eC(i)||(e.preventDefault(),f.current=!0),"Enter"===e.key&&(r&&l?n(!1,e.nativeEvent,"click"):n(!0,e.nativeEvent,"click")))},onKeyUp(e){!(e.defaultPrevented||!c||ry(e)||eC(i))&&" "===e.key&&f.current&&(f.current=!1,r&&l?n(!1,e.nativeEvent,"click"):n(!0,e.nativeEvent,"click"))}}}:{},[a,o,s,u,c,i,l,r,n])}(D,{event:"mousedown",keyboardHandlers:!1}),function(e,t){void 0===t&&(t={});let{open:r,onOpenChange:n,nodeId:o,elements:{reference:i,domReference:a,floating:s},dataRef:l}=e,{enabled:u=!0,escapeKey:c=!0,outsidePress:d=!0,outsidePressEvent:f="pointerdown",referencePress:h=!1,referencePressEvent:p="pointerdown",ancestorScroll:m=!1,bubbles:g,capture:y}=t,v=tG(),w=tT("function"==typeof d?d:()=>!1),b="function"==typeof d?w:d,_=L.useRef(!1),x=L.useRef(!1),{escapeKey:E,outsidePress:S}=rb(g),{escapeKey:k,outsidePress:R}=rb(y),C=tT(e=>{if(!r||!u||!c||"Escape"!==e.key)return;let t=v?tQ(v.nodesRef.current,o):[];if(!E&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach(t=>{var r;if(null!=(r=t.context)&&r.open&&!t.context.dataRef.current.__escapeKeyBubbles){e=!1;return}}),!e)return}n(!1,"nativeEvent"in e?e.nativeEvent:e,"escape-key")}),A=tT(e=>{var t;let r=()=>{var t;C(e),null==(t=eR(e))||t.removeEventListener("keydown",r)};null==(t=eR(e))||t.addEventListener("keydown",r)}),T=tT(e=>{let t=_.current;_.current=!1;let r=x.current;if(x.current=!1,"click"===f&&r||t||"function"==typeof b&&!b(e))return;let i=eR(e),l="["+tY("inert")+"]",u=eS(s).querySelectorAll(l),c=eo(i)?i:null;for(;c&&!ec(c);){let e=eh(c);if(ec(e)||!eo(e))break;c=e}if(u.length&&eo(i)&&!i.matches("html,body")&&!eg(i,s)&&Array.from(u).every(e=>!eg(c,e)))return;if(ei(i)&&s){let t=i.clientWidth>0&&i.scrollWidth>i.clientWidth,r=i.clientHeight>0&&i.scrollHeight>i.clientHeight,n=r&&e.offsetX>i.clientWidth;if(r&&"rtl"===ed(i).direction&&(n=e.offsetX<=i.offsetWidth-i.clientWidth),n||t&&e.offsetY>i.clientHeight)return}let d=v&&tQ(v.nodesRef.current,o).some(t=>{var r;return ek(e,null==(r=t.context)?void 0:r.elements.floating)});if(ek(e,s)||ek(e,a)||d)return;let h=v?tQ(v.nodesRef.current,o):[];if(h.length>0){let e=!0;if(h.forEach(t=>{var r;if(null!=(r=t.context)&&r.open&&!t.context.dataRef.current.__outsidePressBubbles){e=!1;return}}),!e)return}n(!1,e,"outside-press")}),M=tT(e=>{var t;let r=()=>{var t;T(e),null==(t=eR(e))||t.removeEventListener(f,r)};null==(t=eR(e))||t.addEventListener(f,r)});return L.useEffect(()=>{if(!r||!u)return;function e(e){n(!1,e,"ancestor-scroll")}l.current.__escapeKeyBubbles=E,l.current.__outsidePressBubbles=S;let t=eS(s);c&&t.addEventListener("keydown",k?A:C,k),b&&t.addEventListener(f,R?M:T,R);let o=[];return m&&(eo(a)&&(o=ep(a)),eo(s)&&(o=o.concat(ep(s))),!eo(i)&&i&&i.contextElement&&(o=o.concat(ep(i.contextElement)))),(o=o.filter(e=>{var r;return e!==(null==(r=t.defaultView)?void 0:r.visualViewport)})).forEach(t=>{t.addEventListener("scroll",e,{passive:!0})}),()=>{c&&t.removeEventListener("keydown",k?A:C,k),b&&t.removeEventListener(f,R?M:T,R),o.forEach(t=>{t.removeEventListener("scroll",e)})}},[l,s,a,i,c,b,f,r,n,m,u,E,S,C,k,A,T,R,M]),L.useEffect(()=>{_.current=!1},[b,f]),L.useMemo(()=>u?{reference:{onKeyDown:C,[rv[p]]:e=>{h&&n(!1,e.nativeEvent,"reference-press")}},floating:{onKeyDown:C,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[rw[f]]:()=>{_.current=!0}}}:{},[u,h,f,p,n,C])}(D,{outsidePress:!1}),function(e,t){var r;void 0===t&&(t={});let{open:n,floatingId:o}=e,{enabled:i=!0,role:a="dialog"}=t,s=null!=(r=rM.get(a))?r:a,l=tq(),u=null!=tK();return L.useMemo(()=>{if(!i)return{};let e={id:o,...s&&{role:s}};return"tooltip"===s||"label"===a?{reference:{["aria-"+("label"===a?"labelledby":"describedby")]:n?o:void 0},floating:e}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":"alertdialog"===s?"dialog":s,"aria-controls":n?o:void 0,..."listbox"===s&&{role:"combobox"},..."menu"===s&&{id:l},..."menu"===s&&u&&{role:"menuitem"},..."select"===a&&{"aria-autocomplete":"none"},..."combobox"===a&&{"aria-autocomplete":"list"}},floating:{...e,..."menu"===s&&{"aria-labelledby":l}},item(e){let{active:t,selected:r}=e,n={role:"option",...t&&{id:o+"-option"}};switch(a){case"select":return{...n,"aria-selected":t&&r};case"combobox":return{...n,...t&&{"aria-selected":!0}}}return{}}}},[i,a,s,n,o,l,u])}(D,{role:"listbox"}),function(e,t){let{open:r,elements:n}=e,{enabled:o=!0,overflowRef:i,scrollRef:a,onChange:s}=t,l=tT(s),u=L.useRef(!1),c=L.useRef(null),d=L.useRef(null);return L.useEffect(()=>{if(!o)return;function e(e){if(e.ctrlKey||!t||null==i.current)return;let r=e.deltaY,n=i.current.top>=-.5,o=i.current.bottom>=-.5,a=t.scrollHeight-t.clientHeight,s=r<0?-1:1,u=r<0?"max":"min";!(t.scrollHeight<=t.clientHeight)&&(!n&&r>0||!o&&r<0?(e.preventDefault(),(0,e4.flushSync)(()=>{l(e=>e+Math[u](r,a*s))})):/firefox/i.test(ev())&&(t.scrollTop+=r))}let t=(null==a?void 0:a.current)||n.floating;if(r&&t)return t.addEventListener("wheel",e),requestAnimationFrame(()=>{c.current=t.scrollTop,null!=i.current&&(d.current={...i.current})}),()=>{c.current=null,d.current=null,t.removeEventListener("wheel",e)}},[o,r,n.floating,i,a,l]),L.useMemo(()=>o?{floating:{onKeyDown(){u.current=!0},onWheel(){u.current=!1},onPointerMove(){u.current=!1},onScroll(){let e=(null==a?void 0:a.current)||n.floating;if(i.current&&e&&u.current){if(null!==c.current){let t=e.scrollTop-c.current;(i.current.bottom<-.5&&t<-1||i.current.top<-.5&&t>1)&&(0,e4.flushSync)(()=>l(e=>e+t))}requestAnimationFrame(()=>{c.current=e.scrollTop})}}}}:{},[o,i,n.floating,a,l])}(D,{enabled:!I&&(K||q),onChange:P,overflowRef:_,scrollRef:H.floating}),function(e,t){let{open:r,onOpenChange:n,refs:o,elements:{domReference:i,floating:a}}=e,{listRef:s,activeIndex:l,onNavigate:u=()=>{},enabled:c=!0,selectedIndex:d=null,allowEscape:f=!1,loop:h=!1,nested:p=!1,rtl:m=!1,virtual:g=!1,focusItemOnOpen:y="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:w=!0,disabledIndices:b,orientation:_="vertical",cols:x=1,scrollItemIntoView:E=!0,virtualItemRef:S,itemSizes:k,dense:R=!1}=t,C=tK(),A=tG(),T=tT(u),M=L.useRef(y),I=L.useRef(null!=d?d:-1),O=L.useRef(null),z=L.useRef(!0),P=L.useRef(T),N=L.useRef(!!a),B=L.useRef(!1),j=L.useRef(!1),F=tJ(b),U=tJ(r),$=tJ(E),[D,H]=L.useState(),[V,W]=L.useState(),q=tT(function(e,t,r){void 0===r&&(r=!1);let n=e.current[t.current];n&&(g?(H(n.id),null==A||A.events.emit("virtualfocus",n),S&&(S.current=n)):tU(n,{preventScroll:!0,sync:!!(ey().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints&&e_())&&(rk||B.current)}),requestAnimationFrame(()=>{let e=$.current;e&&n&&(r||!z.current)&&(null==n.scrollIntoView||n.scrollIntoView("boolean"==typeof e?{block:"nearest",inline:"nearest"}:e))}))});t$(()=>{document.createElement("div").focus({get preventScroll(){return rk=!0,!1}})},[]),t$(()=>{c&&(r&&a?M.current&&null!=d&&(j.current=!0,I.current=d,T(d)):N.current&&(I.current=-1,P.current(null)))},[c,r,a,d,T]),t$(()=>{if(c&&r&&a){if(null==l){if(B.current=!1,null==d&&(N.current&&(I.current=-1,q(s,I)),!N.current&&M.current&&(null!=O.current||!0===M.current&&null==O.current))){let e=0,t=()=>{null==s.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(I.current=null==O.current||rA(O.current,_,m)||p?tN(s,F.current):tB(s,F.current),O.current=null,T(I.current))};t()}}else tP(s,l)||(I.current=l,q(s,I,j.current),j.current=!1)}},[c,r,a,l,d,p,s,_,m,T,q,F]),t$(()=>{var e;if(!c||a||!A||g||!N.current)return;let t=A.nodesRef.current,r=null==(e=t.find(e=>e.id===C))||null==(e=e.context)?void 0:e.elements.floating,n=em(eS(a)),o=t.some(e=>e.context&&eg(e.context.elements.floating,n));r&&!o&&z.current&&r.focus({preventScroll:!0})},[c,a,A,C,g]),t$(()=>{if(c&&A&&g&&!C)return A.events.on("virtualfocus",e),()=>{A.events.off("virtualfocus",e)};function e(e){W(e.id),S&&(S.current=e)}},[c,A,g,C,S]),t$(()=>{P.current=T,N.current=!!a}),t$(()=>{r||(O.current=null)},[r]);let X=null!=l,Z=L.useMemo(()=>{function e(e){if(!r)return;let t=s.current.indexOf(e);-1!==t&&T(t)}return{onFocus(t){let{currentTarget:r}=t;e(r)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...v&&{onMouseMove(t){let{currentTarget:r}=t;e(r)},onPointerLeave(e){let{pointerType:t}=e;z.current&&"touch"!==t&&(I.current=-1,q(s,I),T(null),g||tU(o.floating.current,{preventScroll:!0}))}}}},[r,o,q,v,s,T,g]);return L.useMemo(()=>{if(!c)return{};let e=F.current;function t(t){if(z.current=!1,B.current=!0,!U.current&&t.currentTarget===o.floating.current)return;if(p&&rT(t.key,_,m)){eA(t),n(!1,t.nativeEvent,"list-navigation"),ei(i)&&!g&&i.focus();return}let a=I.current,l=tN(s,e),u=tB(s,e);if("Home"===t.key&&(eA(t),I.current=l,T(I.current)),"End"===t.key&&(eA(t),I.current=u,T(I.current)),x>1){var c;let r=k||Array.from({length:s.current.length},()=>({width:1,height:1})),n=function(e,t,r){let n=[],o=0;return e.forEach((e,i)=>{let{width:a,height:s}=e,l=!1;for(r&&(o=0);!l;){let e=[];for(let r=0;rnull==n[e])?(e.forEach(e=>{n[e]=i}),l=!0):o++}}),[...n]}(r,x,R),o=n.findIndex(t=>null!=t&&!(null!=e&&e.includes(t))),i=n.reduce((t,r,n)=>null==r||null!=e&&e.includes(r)?t:n,-1);if(I.current=n[function(e,t){let{event:r,orientation:n,loop:o,cols:i,disabledIndices:a,minIndex:s,maxIndex:l,prevIndex:u,stopEvent:c=!1}=t,d=u;if(r.key===tM){if(c&&eA(r),-1===u)d=l;else if(d=tj(e,{startingIndex:d,amount:i,decrement:!0,disabledIndices:a}),o&&(u-ie?r:r-i}tP(e,d)&&(d=u)}if(r.key===tI&&(c&&eA(r),-1===u?d=s:(d=tj(e,{startingIndex:u,amount:i,disabledIndices:a}),o&&u+i>l&&(d=tj(e,{startingIndex:u%i-i,amount:i,disabledIndices:a}))),tP(e,d)&&(d=u)),"both"===n){let t=ez(u/i);r.key===tz&&(c&&eA(r),u%i!=i-1?(d=tj(e,{startingIndex:u,disabledIndices:a}),o&&tL(d,i,t)&&(d=tj(e,{startingIndex:u-u%i-1,disabledIndices:a}))):o&&(d=tj(e,{startingIndex:u-u%i-1,disabledIndices:a})),tL(d,i,t)&&(d=u)),r.key===tO&&(c&&eA(r),u%i!=0?(d=tj(e,{startingIndex:u,disabledIndices:a,decrement:!0}),o&&tL(d,i,t)&&(d=tj(e,{startingIndex:u+(i-u%i),decrement:!0,disabledIndices:a}))):o&&(d=tj(e,{startingIndex:u+(i-u%i),decrement:!0,disabledIndices:a})),tL(d,i,t)&&(d=u));let n=ez(l/i)===t;tP(e,d)&&(d=o&&n?r.key===tO?l:tj(e,{startingIndex:u-u%i-1,disabledIndices:a}):u)}return d}({current:n.map(e=>null!=e?s.current[e]:null)},{event:t,orientation:_,loop:h,cols:x,disabledIndices:(c=[...e||[],void 0],n.flatMap((e,t)=>c.includes(e)?[t]:[])),minIndex:o,maxIndex:i,prevIndex:function(e,t,r,n,o){if(-1===e)return -1;let i=r.indexOf(e);switch(o){case"tl":return i;case"tr":return i+t[e].width-1;case"bl":return i+(t[e].height-1)*n;case"br":return r.lastIndexOf(e)}}(I.current,r,n,x,t.key===tI?"bl":t.key===tz?"tr":"tl"),stopEvent:!0})],T(I.current),"both"===_)return}if(rC(t.key,_)){if(eA(t),r&&!g&&em(t.currentTarget.ownerDocument)===t.currentTarget){I.current=rA(t.key,_,m)?l:u,T(I.current);return}rA(t.key,_,m)?h?I.current=a>=u?f&&a!==s.current.length?-1:l:tj(s,{startingIndex:a,disabledIndices:e}):I.current=Math.min(u,tj(s,{startingIndex:a,disabledIndices:e})):h?I.current=a<=l?f&&-1!==a?s.current.length:u:tj(s,{startingIndex:a,decrement:!0,disabledIndices:e}):I.current=Math.max(l,tj(s,{startingIndex:a,decrement:!0,disabledIndices:e})),tP(s,I.current)?T(null):T(I.current)}}function a(e){"auto"===y&&ew(e.nativeEvent)&&(M.current=!0)}let l=g&&r&&X&&{"aria-activedescendant":V||D},u=s.current.find(e=>(null==e?void 0:e.id)===D);return{reference:{...l,onKeyDown(o){var i,a,l,c,f,h;z.current=!1;let y=0===o.key.indexOf("Arrow"),v=(i=o.key,rR(_,m?i===tO:i===tz,i===tI)),b=rT(o.key,_,m),x=rC(o.key,_),E=(p?v:x)||"Enter"===o.key||""===o.key.trim();if(g&&r){let e,r;let n=null==A?void 0:A.nodesRef.current.find(e=>null==e.parentId),i=A&&n?(a=A.nodesRef.current,l=n.id,r=-1,!function t(n,o){o>r&&(e=n,r=o),tQ(a,n).forEach(e=>{t(e.id,o+1)})}(l,0),a.find(t=>t.id===e)):null;if(y&&i&&S){let e=new KeyboardEvent("keydown",{key:o.key,bubbles:!0});if(v||b){let t=(null==(c=i.context)?void 0:c.elements.domReference)===o.currentTarget,r=b&&!t?null==(f=i.context)?void 0:f.elements.domReference:v?u:null;r&&(eA(o),r.dispatchEvent(e),W(void 0))}if(x&&i.context&&i.context.open&&i.parentId&&o.currentTarget!==i.context.elements.domReference){eA(o),null==(h=i.context.elements.domReference)||h.dispatchEvent(e);return}}return t(o)}if(r||w||!y){if(E&&(O.current=p&&x?null:o.key),p){v&&(eA(o),r?(I.current=tN(s,e),T(I.current)):n(!0,o.nativeEvent,"list-navigation"));return}x&&(null!=d&&(I.current=d),eA(o),!r&&w?n(!0,o.nativeEvent,"list-navigation"):t(o),r&&T(I.current))}},onFocus(){r&&T(null)},onPointerDown:function(e){M.current=y,"auto"===y&&eb(e.nativeEvent)&&(M.current=!0)},onMouseDown:a,onClick:a},floating:{"aria-orientation":"both"===_?void 0:_,...!eT(i)&&l,onKeyDown:t,onPointerMove(){z.current=!0}},item:Z}},[i,o,D,V,F,U,s,c,_,m,g,r,X,p,d,w,f,x,h,y,T,n,Z,A,S,k,R])}(D,{listRef:b,activeIndex:h||0,selectedIndex:f,onNavigate:d}),function(e,t){var r;let{open:n,dataRef:o}=e,{listRef:i,activeIndex:a,onMatch:s,onTypingChange:l,enabled:u=!0,findMatch:c=null,resetMs:d=750,ignoreKeys:f=[],selectedIndex:h=null}=t,p=L.useRef(),m=L.useRef(""),g=L.useRef(null!=(r=null!=h?h:a)?r:-1),y=L.useRef(null),v=tT(s),w=tT(l),b=tJ(c),_=tJ(f);return t$(()=>{n&&(clearTimeout(p.current),y.current=null,m.current="")},[n]),t$(()=>{if(n&&""===m.current){var e;g.current=null!=(e=null!=h?h:a)?e:-1}},[n,h,a]),L.useMemo(()=>{if(!u)return{};function e(e){e?o.current.typing||(o.current.typing=e,w(e)):o.current.typing&&(o.current.typing=e,w(e))}function t(e,t,r){let n=b.current?b.current(t,r):t.find(e=>(null==e?void 0:e.toLocaleLowerCase().indexOf(r.toLocaleLowerCase()))===0);return n?e.indexOf(n):-1}function r(r){let o=i.current;if(m.current.length>0&&" "!==m.current[0]&&(-1===t(o,o,m.current)?e(!1):" "===r.key&&eA(r)),null==o||_.current.includes(r.key)||1!==r.key.length||r.ctrlKey||r.metaKey||r.altKey)return;n&&" "!==r.key&&(eA(r),e(!0)),o.every(e=>{var t,r;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(r=e[1])?void 0:r.toLocaleLowerCase())})&&m.current===r.key&&(m.current="",g.current=y.current),m.current+=r.key,clearTimeout(p.current),p.current=setTimeout(()=>{m.current="",g.current=y.current,e(!1)},d);let a=g.current,s=t(o,[...o.slice((a||0)+1),...o.slice(0,(a||0)+1)],m.current);-1!==s?(v(s),y.current=s):" "!==r.key&&(m.current="",e(!1))}return{reference:{onKeyDown:r},floating:{onKeyDown:r,onKeyUp(t){" "===t.key&&e(!1)}}}},[u,n,o,i,d,_,b,v,w])}(D,{listRef:a,onMatch:G,selectedIndex:f,activeIndex:h})],ee=function(e){void 0===e&&(e=[]);let t=e,r=L.useCallback(t=>rS(t,e,"reference"),t),n=L.useCallback(t=>rS(t,e,"floating"),t),o=L.useCallback(t=>rS(t,e,"item"),e.map(e=>null==e?void 0:e.item));return L.useMemo(()=>({getReferenceProps:r,getFloatingProps:n,getItemProps:o}),[r,n,o])}(L.useMemo(()=>Q,Q)),et=L.useMemo(()=>({...ee,getReferenceProps:()=>ee.getReferenceProps({ref:H.reference,className:"SelectTrigger",onKeyDown(e){"Enter"!==e.key&&"Space"!==e.code&&(" "!==e.key||D.dataRef.current.typing)||(e.preventDefault(),m(!0))}}),getFloatingProps:e=>ee.getFloatingProps({ref:H.floating,className:"Select",...e,style:{position:$,top:U??"",left:F??"",outline:0,scrollbarWidth:"none",...j.current,...e?.style},onPointerEnter(){M(!1),A.current.isMouseOutside=!1},onPointerLeave(){A.current.isMouseOutside=!0},onPointerMove(){A.current.isMouseOutside=!1,M(!1)},onKeyDown(){M(!0)},onContextMenu(e){e.preventDefault()},onScroll(e){(0,e4.flushSync)(()=>{v(e.currentTarget.scrollTop)})}})}),[H.reference.current,F,U,H.floating.current,ee]);return(0,s.LI)(()=>{if(o)return C.current=setTimeout(()=>{k.current=!0},300),()=>{clearTimeout(C.current)};k.current=!1,R.current=!0,P(0),O(!1),B(!1)},[o]),(0,s.LI)(()=>{!o&&A.current.isMouseOutside&&(A.current.isMouseOutside=!1)},[o]),(0,s.LI)(()=>{function e(e){let t=e.target;H.floating.current?.contains(t)||x.current?.contains(t)||S.current?.contains(t)||(m(!1),M(!1))}if(o)return document.addEventListener("pointerdown",e),()=>{document.removeEventListener("pointerdown",e)}},[o,H,m]),L.useEffect(()=>{o&&T&&null!=h&&b.current[h]?.scrollIntoView({block:"nearest"}),v(H.floating.current?.scrollTop??0)},[o,H,T,h]),L.useEffect(()=>{o&&I&&null!=f&&b.current[f]?.scrollIntoView({block:"nearest"})},[o,I,f]),(0,s.LI)(()=>{H.floating.current&&I&&(H.floating.current.style.maxHeight="")},[H,I]),(0,E.jsx)(X,{scope:r,...l,setScrollTop:v,setInnerOffset:P,fallback:I,floatingContext:D,activeIndex:h,canScrollDown:!!K,canScrollUp:!!q,controlledScrolling:T,blockSelection:N,upArrowRef:x,downArrowRef:S,update:V,children:(0,E.jsx)(Y,{scope:r,...u,allowMouseUpRef:R,allowSelectRef:k,dataRef:D.dataRef,interactions:et,listRef:b,selectTimeoutRef:C,children:n})})},rY="SelectItem",[rJ,rQ]=W(rY),r0=k.styleable(function(e,t){let{__scopeSelect:r,value:n,disabled:o=!1,textValue:i,index:l,...u}=e,{props:c}=T({...!e.unstyled&&{ellipse:!0},...u}),{setSelectedIndex:d,listRef:f,setOpen:h,onChange:p,activeIndexSubscribe:m,valueSubscribe:g,allowMouseUpRef:y,allowSelectRef:v,setValueAtIndex:w,selectTimeoutRef:b,dataRef:_,interactions:x,shouldRenderWebNative:S,size:R,onActiveChange:C,initialValue:A}=J(rY,r),[M,I]=L.useState(A===n);L.useEffect(()=>m(e=>{l===e&&(C(n,l),f?.current[l]?.focus())}),[l]),L.useEffect(()=>g(e=>{I(e===n)}),[n]);let O=L.useId(),z=(0,a.ex)(t,e=>{s.$L&&e instanceof HTMLElement&&f&&(f.current[l]=e)});function P(){d(l),p(n),h(!1)}(0,s.LI)(()=>{w(l,n)},[l,w,n]);let N=L.useMemo(()=>x?x.getItemProps({onTouchMove(){v.current=!0,y.current=!1},onTouchEnd(){v.current=!1,y.current=!0},onKeyDown(e){"Enter"!==e.key&&(" "!==e.key||_?.current.typing)?v.current=!0:(e.preventDefault(),P())},onClick(){v.current&&P()},onMouseUp(){y.current&&(v.current&&P(),clearTimeout(b.current),b.current=setTimeout(()=>{v.current=!0}))}}):{onPress:P},[P]);return(0,E.jsx)(rJ,{scope:r,value:n,textId:O||"",isSelected:M,children:S?(0,E.jsx)("option",{value:n,children:e.children}):(0,E.jsx)(k,{tag:"div",componentName:rY,ref:z,"aria-labelledby":O,"aria-selected":M,"data-state":M?"active":"inactive","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...!e.unstyled&&{backgrounded:!0,pressTheme:!0,hoverTheme:!0,focusTheme:!0,cursor:"default",size:R,outlineOffset:-.5,focusVisibleStyle:{outlineColor:"$outlineColor",outlineWidth:1,outlineStyle:"solid"}},...c,...N})})},{disableTheme:!0});var r1=r(357);let r2="SelectItemText",r6=(0,l.z)(v.J,{name:r2,variants:{unstyled:{false:{userSelect:"none",color:"$color",ellipse:!0}}},defaultVariants:{unstyled:"1"===r1.env.TAMAGUI_HEADLESS}}),r5=r6.styleable(function(e,t){let{__scopeSelect:r,className:n,...o}=e,i=Z(r2,r),s=J(r2,r),l=L.useRef(null),u=(0,a.ex)(t,l),c=rQ(r2,r),d=L.useRef();return d.current=(0,E.jsx)(r6,{className:n,size:s.size,id:c.textId,...o,ref:u}),L.useEffect(()=>{s.initialValue!==c.value||i.selectedIndex||i.setSelectedItem(d.current)},[]),L.useEffect(()=>s.valueSubscribe(e=>{e===c.value&&i.setSelectedItem(d.current)}),[c.value]),s.shouldRenderWebNative?(0,E.jsx)(E.Fragment,{children:e.children}):(0,E.jsx)(E.Fragment,{children:d.current})}),r3="SelectScrollUpButton",r8=L.forwardRef((e,t)=>(0,E.jsx)(r9,{componentName:r3,...e,dir:"up",ref:t}));r8.displayName=r3;let r4="SelectScrollDownButton",r7=L.forwardRef((e,t)=>(0,E.jsx)(r9,{componentName:r4,...e,dir:"down",ref:t}));r7.displayName=r4;let r9=L.memo(L.forwardRef((e,t)=>{let{__scopeSelect:r,dir:n,componentName:o,...i}=e,{forceUpdate:s,open:l,fallback:u,setScrollTop:c,setInnerOffset:d,...f}=Z(o,r),h=f.floatingContext?.refs.floating,p=L.useRef("idle"),m=f["down"===n?"canScrollDown":"canScrollUp"],g=L.useRef(),{x:v,y:w,refs:b,strategy:_}=r_({open:l&&m,strategy:"fixed",elements:{reference:h?.current},placement:"up"===n?"top":"bottom",middleware:[eV(({rects:e})=>-e.floating.height)],whileElementsMounted:(...e)=>e3(...e,{animationFrame:!0})}),x=(0,a.ex)(t,b.setFloating);if(!m)return null;let S=e=>{h&&(u?h.current&&(h.current.scrollTop-=e,(0,e4.flushSync)(()=>c(h.current?.scrollTop??0))):(0,e4.flushSync)(()=>d(t=>t-e)))};return(0,E.jsx)(y.FA,{ref:x,componentName:o,"aria-hidden":!0,...i,zIndex:1e3,position:_,left:v||0,top:w||0,width:`calc(${(h?.current?.offsetWidth??0)-2}px)`,onPointerEnter:()=>{p.current="active";let e=Date.now();cancelAnimationFrame(g.current),g.current=requestAnimationFrame(function t(){let r=h?.current;if(r){let o=Date.now(),i=o-e;e=o;let a=i/2,s="up"===n?r.scrollTop:r.scrollHeight-r.clientHeight-r.scrollTop,l="up"===n?r.scrollTop-a>0:r.scrollTop+a{p.current="idle",cancelAnimationFrame(g.current)}})})),ne="SelectTrigger",nt=!s.$L||!s.C5||window.matchMedia("(pointer:coarse)").matches,nr=L.forwardRef(function(e,t){let{__scopeSelect:r,disabled:n=!1,unstyled:o=!1,...i}=e,s=Z(ne,r),l=J(ne,r),u=(0,a.ex)(t,s.floatingContext?.refs.setReference);return l.shouldRenderWebNative?null:(0,E.jsx)(I,{componentName:ne,unstyled:o,tag:"button",id:l.id,...!o&&{backgrounded:!0,radiused:!0,hoverTheme:!0,pressTheme:!0,focusable:!0,focusVisibleStyle:{outlineStyle:"solid",outlineWidth:2,outlineColor:"$outlineColor"},borderWidth:1,size:l.size},"aria-expanded":s.open,"aria-autocomplete":"none",dir:s.dir,disabled:n,"data-disabled":n?"":void 0,...i,ref:u,...l.interactions?{...l.interactions.getReferenceProps(),...nt?{onPress(){l.setOpen(!s.open)}}:{onMouseDown(){s.floatingContext?.update(),l.setOpen(!s.open)}}}:{onPress(){l.setOpen(!s.open)}}})});var nn=r(9085),no=r(357);let ni=(0,l.z)(g.K,{name:H,variants:{unstyled:{false:{size:"$2",backgroundColor:"$background",elevate:!0,bordered:!0,userSelect:"none",outlineWidth:0}},size:{"...size":(e,{tokens:t})=>({borderRadius:t.radius[e]??e})}},defaultVariants:{unstyled:"1"===no.env.TAMAGUI_HEADLESS}}),na=ni.styleable(function(e,t){let{__scopeSelect:r,children:n,disableScroll:o,...i}=e,l=Z(H,r),u=J(H,r),c=rX(l.sheetBreakpoint);if((0,s.LI)(()=>{l.update&&l.update()},[c]),u.shouldRenderWebNative)return(0,E.jsx)(E.Fragment,{children:n});if(c||!s.$L)return(0,E.jsx)(O.b5,{hostName:`${l.scopeKey}SheetContents`,children:(0,E.jsx)(Q,{__scopeSelect:r,itemContext:u,context:l,children:n})});if(!u.interactions)return null;let{style:d,className:f,onScroll:h,...p}=u.interactions.getFloatingProps(),m=(0,a.FE)(t,l.floatingContext?.refs.setFloating);return(0,E.jsxs)(E.Fragment,{children:[!o&&!e.unstyled&&(0,E.jsx)("style",{dangerouslySetInnerHTML:{__html:ns}}),(0,E.jsx)(nn.M,{children:l.open?(0,E.jsx)(rp,{context:l.floatingContext,modal:!1,children:(0,E.jsx)(ni,{size:u.size,role:"presentation",...i,...d,...p,...!e.unstyled&&{overflowY:o?void 0:d.overflow??"auto"},ref:m,children:n},"select-viewport")}):null}),!l.open&&(0,E.jsx)("div",{style:{display:"none"},children:e.children})]})}),ns=` -.is_SelectViewport { - scrollbar-width: none; - -webkit-overflow-scrolling: touch; - overscroll-behavior: contain; -} - -.is_SelectViewport::-webkit-scrollbar{ - display:none -} -`,nl="SelectValue",nu=(0,l.z)(v.J,{name:nl,userSelect:"none"}),nc=nu.styleable(function({__scopeSelect:e,children:t,placeholder:r,...n},o){let i=Z(nl,e),s=J(nl,e),l=(0,a.ex)(o,i.onValueNodeChange),u=t??i.selectedItem,c=null==i.value||""===i.value?r??u:u;return(0,E.jsx)(nu,{...!n.unstyled&&{size:s.size,ellipse:!0,pointerEvents:"none"},ref:l,...n,children:function e(t){return L.Children.map(t,t=>{if(t){if(t.type?.staticConfig?.componentName===r2)return t.props.children;if(t.props?.children)return e(t.props.children)}return t})}(c)})}),nd=(0,l.z)(y.sL,{name:"SelectIcon","aria-hidden":!0,children:(0,E.jsx)(F.n,{children:"â–¼"})}),nf="SelectItemIndicator",nh=(0,l.z)(y.sL,{name:r2}),np=L.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,o=J(nf,r),i=rQ(nf,r);return o.shouldRenderWebNative?null:i.isSelected?(0,E.jsx)(nh,{"aria-hidden":!0,...n,ref:t}):null});np.displayName=nf;let nm="SelectGroup",[ng,ny]=W(nm),nv=(0,l.z)(y.FA,{name:nm,width:"100%"}),nw=(0,l.z)(v.J,{tag:"select",backgroundColor:"$background",borderColor:"$borderColor",hoverStyle:{backgroundColor:"$backgroundHover"}}),nb=(0,l.z)(g.K,{name:"NativeSelect",bordered:!0,userSelect:"none",outlineWidth:0,paddingRight:10,variants:{size:{"...size":(e,t)=>{let{tokens:r}=t,n=(0,u.Ve)(r.space[e]);return{borderRadius:r.radius[e]??e,minHeight:r.size[e],paddingRight:n+20,paddingLeft:n,paddingVertical:(0,d.Pj)(e,{shift:-3})}}}},defaultVariants:{size:"$2"}}),n_=L.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,o=L.useId(),i=Z(nm,r),a=J(nm,r),s=a.size??"$true",l=L.useRef(null),u=a.shouldRenderWebNative?(0,E.jsx)(nb,{asChild:!0,size:s,value:i.value,id:a.id,children:(0,E.jsx)(nw,{onChange:e=>{a.onChange(e.currentTarget.value)},size:s,ref:l,style:{color:"var(--color)",appearance:"none"},children:e.children})}):(0,E.jsx)(nv,{role:"group","aria-labelledby":o,...n,ref:t});return(0,E.jsx)(ng,{scope:r,id:o||"",children:u})});n_.displayName=nm;let nx="SelectLabel",nE=L.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,o=J(nx,r),i=ny(nx,r);return o.shouldRenderWebNative?null:(0,E.jsx)(I,{tag:"div",componentName:nx,fontWeight:"800",id:i.id,size:o.size,...n,ref:t})});nE.displayName=nx,(0,l.z)(z.Z,{name:"SelectSeparator"});let nS=e=>{let t=Z("SelectSheetController",e.__scopeSelect),r=rZ(t),n=rX(t.sheetBreakpoint),o=(0,c.X)(r);return(0,E.jsx)(B,{onOpenChange:t=>{o()&&e.onOpenChange(t)},open:t.open,hidden:!1===n,children:e.children})},nk=e=>(0,E.jsx)(E.Fragment,{children:e.children}),nR=(0,f.$e)(e=>{let{__scopeSelect:t,native:r,children:n,open:o,defaultOpen:a,onOpenChange:l,value:u,defaultValue:d,onValueChange:f,disablePreventBodyScroll:h,size:p="$true",onActiveChange:m,dir:g,id:y}=e,v=L.useId(),w=t?Object.keys(t)[0]??v:v,{when:b,AdaptProvider:_}=(0,i.pV)({Contents:L.useCallback(()=>(0,E.jsx)(O.$2,{name:`${w}SheetContents`}),[w])}),x=rX(b)||!s.$L?nk:rG,S=L.useReducer(()=>({}),{})[1],[k,R]=L.useState(null),[C,A]=(0,U.T)({prop:o,defaultProp:a||!1,onChange:l}),[T,M]=(0,U.T)({prop:u,defaultProp:d||"",onChange:f,transition:!0});L.useEffect(()=>{C&&P(T)},[C]),L.useEffect(()=>{P(T)},[T]);let[I,z]=L.useState(0),[P,N]=nC(),[B,j]=nC(),F=L.useRef(null),D=L.useRef(null),H=L.useRef([]),[V,W]=L.useState(0),[q,Z]=L.useState(null);(0,s.LI)(()=>{F.current=V,D.current=I});let K=s.$L&&(!0===r||"web"===r||Array.isArray(r)&&r.includes("web")),G=function(e,t,r=$,n=[e]){let o=(0,L.useRef)(null);return(0,L.useEffect)(()=>()=>{o.current?.cancel()},[]),(0,L.useMemo)(()=>(o.current=function(e,t,r){let n,o=!1;function i(){o=!1;let i=arguments;r&&!n&&e.apply(this,i),clearTimeout(n),n=setTimeout(()=>{n=null,r||o||e.apply(this,i),o=!1},t)}return i.cancel=()=>{o=!0},i}(e,1,r.leading),o.current),[r.leading,...n])}(e=>{z(t=>t!==e?("number"==typeof e&&B(e),e):t)},0,{},[]);return(0,E.jsx)(_,{children:(0,E.jsx)(Y,{scope:t,initialValue:L.useMemo(()=>T,[C]),size:p,activeIndexSubscribe:j,valueSubscribe:N,setOpen:A,id:y,onChange:L.useCallback(e=>{M(e),P(e)},[]),onActiveChange:(0,c.z)((...e)=>{m?.(...e)}),setSelectedIndex:W,setValueAtIndex:L.useCallback((e,t)=>{H.current[e]=t},[]),shouldRenderWebNative:K,children:(0,E.jsx)(X,{scope:t,disablePreventBodyScroll:h,dir:g,blockSelection:!1,fallback:!1,selectedItem:k,setSelectedItem:R,forceUpdate:S,valueNode:q,onValueNodeChange:Z,scopeKey:w,sheetBreakpoint:b,activeIndex:I,selectedIndex:V,setActiveIndex:G,value:T,open:C,native:r,children:(0,E.jsx)(nS,{onOpenChange:A,__scopeSelect:t,children:K?n:(0,E.jsx)(x,{activeIndexRef:D,listContentRef:H,selectedIndexRef:F,...e,open:C,value:T,children:n})})})})})},{Adapt:i.Tr,Content:({children:e,__scopeSelect:t,zIndex:r=1e3,...n})=>{let o=Z(rK,t),i=J(rK,t),a=(0,rz.C)(),s=rZ(o),l=(0,E.jsx)(rL.Q,{forceClassName:!0,name:a,children:e}),u=rN(),c=(0,L.useMemo)(()=>({zIndex:r,pointerEvents:o.open?"auto":"none"}),[o.open]);return i.shouldRenderWebNative?(0,E.jsx)(E.Fragment,{children:e}):s?o.open?(0,E.jsx)(E.Fragment,{children:l}):null:(0,E.jsx)(rl,{children:(0,E.jsx)(rg,{style:c,lockScroll:!o.disablePreventBodyScroll&&!!o.open&&!u,children:(0,E.jsx)(rU,{loop:!0,enabled:!!o.open,trapped:!0,...n,children:l})})})},Group:n_,Icon:nd,Item:r0,ItemIndicator:np,ItemText:r5,Label:nE,ScrollDownButton:r7,ScrollUpButton:r8,Trigger:nr,Value:nc,Viewport:na,Sheet:j.yo.Controlled});function nC(){let e=L.useRef();return e.current||(e.current=new Set),[t=>{e.current.forEach(e=>e(t))},L.useCallback(t=>(e.current.add(t),()=>{e.current.delete(t)}),[])]}nR.displayName=D},8619:function(e,t,r){"use strict";r.d(t,{yo:function(){return tz}});var n,o,i,a,s,l,u,c=r(4975),d=r(5377),f=r(1092),h=r(281);let p="Sheet",m="SheetHandle",g="SheetOverlay",y=h.C5?document.createElement("style"):null;y&&"u">typeof document.head&&document.head.appendChild(y);var v=r(9046),w=r(2166),b=r(8338),_=r(2265),x=function(){return(x=Object.assign||function(e){for(var t,r=1,n=arguments.length;rt.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}"function"==typeof SuppressedError&&SuppressedError;var S="right-scroll-bar-position",k="width-before-scroll-bar";function R(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var C="undefined"!=typeof window?_.useLayoutEffect:_.useEffect,A=new WeakMap,T=(void 0===n&&(n={}),(void 0===o&&(o=function(e){return e}),i=[],a=!1,s={read:function(){if(a)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:null},useMedium:function(e){var t=o(e,a);return i.push(t),function(){i=i.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(a=!0;i.length;){var t=i;i=[],t.forEach(e)}i={push:function(t){return e(t)},filter:function(){return i}}},assignMedium:function(e){a=!0;var t=[];if(i.length){var r=i;i=[],r.forEach(e),t=i}var n=function(){var r=t;t=[],r.forEach(e)},o=function(){return Promise.resolve().then(n)};o(),i={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),i}}}}).options=x({async:!0,ssr:!1},n),s),M=function(){},I=_.forwardRef(function(e,t){var r,n,o,i,a=_.useRef(null),s=_.useState({onScrollCapture:M,onWheelCapture:M,onTouchMoveCapture:M}),l=s[0],u=s[1],c=e.forwardProps,d=e.children,f=e.className,h=e.removeScrollBar,p=e.enabled,m=e.shards,g=e.sideCar,y=e.noIsolation,v=e.inert,w=e.allowPinchZoom,b=e.as,S=E(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),k=(r=[a,t],n=function(e){return r.forEach(function(t){return R(t,e)})},(o=(0,_.useState)(function(){return{value:null,callback:n,facade:{get current(){return o.value},set current(value){var e=o.value;e!==value&&(o.value=value,o.callback(value,e))}}}})[0]).callback=n,i=o.facade,C(function(){var e=A.get(i);if(e){var t=new Set(e),n=new Set(r),o=i.current;t.forEach(function(e){n.has(e)||R(e,null)}),n.forEach(function(e){t.has(e)||R(e,o)})}A.set(i,r)},[r]),i),I=x(x({},S),l);return _.createElement(_.Fragment,null,p&&_.createElement(g,{sideCar:T,removeScrollBar:h,shards:m,noIsolation:y,inert:v,setCallbacks:u,allowPinchZoom:!!w,lockRef:a}),c?_.cloneElement(_.Children.only(d),x(x({},I),{ref:k})):_.createElement(void 0===b?"div":b,x({},I,{className:f,ref:k}),d))});I.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},I.classNames={fullWidth:k,zeroRight:S};var O=function(e){var t=e.sideCar,r=E(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw Error("Sidecar medium not found");return _.createElement(n,x({},r))};O.isSideCarExport=!0;var z=function(){var e=0,t=null;return{add:function(n){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=u||r.nc;return t&&e.setAttribute("nonce",t),e}())){var o,i;(o=t).styleSheet?o.styleSheet.cssText=n:o.appendChild(document.createTextNode(n)),i=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(i)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},L=function(){var e=z();return function(t,r){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},P=function(){var e=L();return function(t){return e(t.styles,t.dynamic),null}},N={left:0,top:0,right:0,gap:0},B=function(e){return parseInt(e||"",10)||0},j=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[B(r),B(n),B(o)]},F=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return N;var t=j(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},U=P(),$="data-scroll-locked",D=function(e,t,r,n){var o=e.left,i=e.top,a=e.right,s=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(s,"px ").concat(n,";\n }\n body[").concat($,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(s,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(S," {\n right: ").concat(s,"px ").concat(n,";\n }\n \n .").concat(k," {\n margin-right: ").concat(s,"px ").concat(n,";\n }\n \n .").concat(S," .").concat(S," {\n right: 0 ").concat(n,";\n }\n \n .").concat(k," .").concat(k," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat($,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},H=function(){var e=parseInt(document.body.getAttribute($)||"0",10);return isFinite(e)?e:0},V=function(){_.useEffect(function(){return document.body.setAttribute($,(H()+1).toString()),function(){var e=H()-1;e<=0?document.body.removeAttribute($):document.body.setAttribute($,e.toString())}},[])},W=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=void 0===n?"margin":n;V();var i=_.useMemo(function(){return F(o)},[o]);return _.createElement(U,{styles:D(i,!t,o,r?"":"!important")})},q=!1;if("undefined"!=typeof window)try{var X=Object.defineProperty({},"passive",{get:function(){return q=!0,!0}});window.addEventListener("test",X,X),window.removeEventListener("test",X,X)}catch(e){q=!1}var Z=!!q&&{passive:!1},K=function(e,t){var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&"TEXTAREA"!==e.tagName&&"visible"===r[t])},G=function(e,t){var r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),Y(e,r)){var n=J(e,r);if(n[1]>n[2])return!0}r=r.parentNode}while(r&&r!==document.body);return!1},Y=function(e,t){return"v"===e?K(t,"overflowY"):K(t,"overflowX")},J=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},Q=function(e,t,r,n,o){var i,a=(i=window.getComputedStyle(t).direction,"h"===e&&"rtl"===i?-1:1),s=a*n,l=r.target,u=t.contains(l),c=!1,d=s>0,f=0,h=0;do{var p=J(e,l),m=p[0],g=p[1]-p[2]-a*m;(m||g)&&Y(e,l)&&(f+=g,h+=m),l=l.parentNode}while(!u&&l!==document.body||u&&(t.contains(l)||t===l));return d&&(o&&0===f||!o&&s>f)?c=!0:!d&&(o&&0===h||!o&&-s>h)&&(c=!0),c},ee=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},et=function(e){return[e.deltaX,e.deltaY]},er=function(e){return e&&"current"in e?e.current:e},en=0,eo=[],ei=(l=function(e){var t=_.useRef([]),r=_.useRef([0,0]),n=_.useRef(),o=_.useState(en++)[0],i=_.useState(function(){return P()})[0],a=_.useRef(e);_.useEffect(function(){a.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=(function(e,t,r){if(r||2==arguments.length)for(var n,o=0,i=t.length;oMath.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var f=G(d,c);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=G(d,c)),!f)return!1;if(!n.current&&"changedTouches"in e&&(l||u)&&(n.current=o),!o)return!0;var h=n.current||o;return Q(h,t,e,"h"===h?l:u,!0)},[]),l=_.useCallback(function(e){if(eo.length&&eo[eo.length-1]===i){var r="deltaY"in e?et(e):ee(e),n=t.current.filter(function(t){var n;return t.name===e.type&&t.target===e.target&&(n=t.delta)[0]===r[0]&&n[1]===r[1]})[0];if(n&&n.should){e.cancelable&&e.preventDefault();return}if(!n){var o=(a.current.shards||[]).map(er).filter(Boolean).filter(function(t){return t.contains(e.target)});(o.length>0?s(e,o[0]):!a.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),u=_.useCallback(function(e,r,n,o){var i={name:e,delta:r,target:n,should:o};t.current.push(i),setTimeout(function(){t.current=t.current.filter(function(e){return e!==i})},1)},[]),c=_.useCallback(function(e){r.current=ee(e),n.current=void 0},[]),d=_.useCallback(function(t){u(t.type,et(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){u(t.type,ee(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return eo.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Z),document.addEventListener("touchmove",l,Z),document.addEventListener("touchstart",c,Z),function(){eo=eo.filter(function(e){return e!==i}),document.removeEventListener("wheel",l,Z),document.removeEventListener("touchmove",l,Z),document.removeEventListener("touchstart",c,Z)}},[]);var h=e.removeScrollBar,p=e.inert;return _.createElement(_.Fragment,null,p?_.createElement(i,{styles:"\n .block-interactivity-".concat(o," {pointer-events: none;}\n .allow-interactivity-").concat(o," {pointer-events: all;}\n")}):null,h?_.createElement(W,{gapMode:"margin"}):null)},T.useMedium(l),O),ea=_.forwardRef(function(e,t){return _.createElement(I,x({},e,{ref:t,sideCar:ei}))});ea.classNames=I.classNames;var es=r(2281);let el=(0,_.memo)(e=>e.children?(0,es.jsx)(ea,{...e}):null);ea.classNames;var eu=r(6616),ec={OS:"web",select:e=>"web"in e?e.web:e.default,get isTesting(){return!1}};let[ed,ef]=(0,r(301).b)(p),[eh,ep]=ed(p,{});var em=r(3370),eg=r(9085),ey=r(9235),ev=r(5986),ew=r(7562);let eb=()=>{let{groups:e,animationDriver:t,...r}=(0,_.useContext)(ew.s),{animations:n,...o}=(0,ev.iE)();return{...o,...r,animationDriver:t??(0,ev.iE)().animations}};var e_=r(9087),ex=r(4582),eE=r(1130),eS=r(4624),ek=r(3013),eR=()=>{ek.Z.blurTextInput(ek.Z.currentlyFocusedField())},eC={addListener:()=>({remove:()=>{}}),dismiss(){eR()},removeAllListeners(){},removeListener(){}};let eA=()=>{let[e,t]=(0,_.useState)(!1);return(0,_.useEffect)(()=>{let e=eC.addListener("keyboardDidShow",()=>{t(!0)}),r=eC.addListener("keyboardDidHide",()=>{t(!1)});return()=>{r.remove(),e.remove()}},[]),e};var eT=r(7445),eM=r.n(eT),eI=r(7998);class eO{constructor(e){var t=e.onMoreTasks;this._onMoreTasks=t,this._queueStack=[{tasks:[],popable:!0}]}enqueue(e){this._getCurrentQueue().push(e)}enqueueTasks(e){e.forEach(e=>this.enqueue(e))}cancelTasks(e){this._queueStack=this._queueStack.map(t=>(0,eI.Z)((0,eI.Z)({},t),{},{tasks:t.tasks.filter(t=>-1===e.indexOf(t))})).filter((e,t)=>e.tasks.length>0||0===t)}hasTasksToProcess(){return this._getCurrentQueue().length>0}processNext(){var e=this._getCurrentQueue();if(e.length){var t=e.shift();try{"object"==typeof t&&t.gen?this._genPromise(t):"object"==typeof t&&t.run?t.run():(eM()("function"==typeof t,"Expected Function, SimpleTask, or PromiseTask, but got:\n"+JSON.stringify(t,null,2)),t())}catch(e){throw e.message="TaskQueue: Error with task "+(t.name||"")+": "+e.message,e}}}_getCurrentQueue(){var e=this._queueStack.length-1,t=this._queueStack[e];return t.popable&&0===t.tasks.length&&e>0?(this._queueStack.pop(),this._getCurrentQueue()):t.tasks}_genPromise(e){var t=this._queueStack.push({tasks:[],popable:!1}),r=this._queueStack[t-1];e.gen().then(()=>{r.popable=!0,this.hasTasksToProcess()&&this._onMoreTasks()}).catch(t=>{setTimeout(()=>{throw t.message="TaskQueue: Error resolving Promise in task "+e.name+": "+t.message,t},0)})}}class ez{constructor(){this._registry={}}addListener(e,t,r){var n,o,i=(null==(o=(n=this._registry)[e])&&(o=new Set,n[e]=o),o),a={context:r,listener:t,remove(){i.delete(a)}};return i.add(a),a}emit(e){var t=this._registry[e];if(null!=t){for(var r=arguments.length,n=Array(r>1?r-1:0),o=1;o{var t=Date.now();e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})},1)};eP&&window.cancelIdleCallback;var eB=new ez,ej={Events:{interactionStart:"interactionStart",interactionComplete:"interactionComplete"},runAfterInteractions(e){var t=[],r=new Promise(r=>{eq(),e&&t.push(e),t.push({run:r,name:"resolve "+(e&&e.name||"?")}),eD.enqueueTasks(t)});return{then:r.then.bind(r),done:r.then.bind(r),cancel:()=>{eD.cancelTasks(t)}}},createInteractionHandle(){eq();var e=++eV;return eU.add(e),e},clearInteractionHandle(e){eM()(!!e,"Must provide a handle to clear."),eq(),eU.delete(e),e$.add(e)},addListener:eB.addListener.bind(eB),setDeadline(e){eW=e}},eF=new Set,eU=new Set,e$=new Set,eD=new eO({onMoreTasks:eq}),eH=0,eV=0,eW=-1;function eq(){eH||(eH=eW>0?setTimeout(eX):eN(eX))}function eX(){eH=0;var e=eF.size;eU.forEach(e=>eF.add(e)),e$.forEach(e=>eF.delete(e));var t=eF.size;if(0!==e&&0===t?eB.emit(ej.Events.interactionComplete):0===e&&0!==t&&eB.emit(ej.Events.interactionStart),0===t){for(var r=Date.now();eD.hasTasksToProcess();)if(eD.processNext(),eW>0&&Date.now()-r>=eW){eq();break}}eU.clear(),e$.clear()}var eZ={centroidDimension:function(e,t,r,n){var o=e.touchBank,i=0,a=0,s=1===e.numberActiveTouches?e.touchBank[e.indexOfSingleActiveTouch]:null;if(null!==s)s.touchActive&&s.currentTimeStamp>t&&(i+=n&&r?s.currentPageX:n&&!r?s.currentPageY:!n&&r?s.previousPageX:s.previousPageY,a=1);else for(var l=0;l=t&&(i+=n&&r?u.currentPageX:n&&!r?u.currentPageY:!n&&r?u.previousPageX:u.previousPageY,a++)}return a>0?i/a:eZ.noCentroid},currentCentroidXOfTouchesChangedAfter:function(e,t){return eZ.centroidDimension(e,t,!0,!0)},currentCentroidYOfTouchesChangedAfter:function(e,t){return eZ.centroidDimension(e,t,!1,!0)},previousCentroidXOfTouchesChangedAfter:function(e,t){return eZ.centroidDimension(e,t,!0,!1)},previousCentroidYOfTouchesChangedAfter:function(e,t){return eZ.centroidDimension(e,t,!1,!1)},currentCentroidX:function(e){return eZ.centroidDimension(e,0,!0,!0)},currentCentroidY:function(e){return eZ.centroidDimension(e,0,!1,!0)},noCentroid:-1},eK=eZ.currentCentroidXOfTouchesChangedAfter,eG=eZ.currentCentroidYOfTouchesChangedAfter,eY=eZ.previousCentroidXOfTouchesChangedAfter,eJ=eZ.previousCentroidYOfTouchesChangedAfter,eQ=eZ.currentCentroidX,e0=eZ.currentCentroidY,e1={_initializeGestureState(e){e.moveX=0,e.moveY=0,e.x0=0,e.y0=0,e.dx=0,e.dy=0,e.vx=0,e.vy=0,e.numberActiveTouches=0,e._accountsForMovesUpTo=0},_updateGestureStateOnMove(e,t){e.numberActiveTouches=t.numberActiveTouches,e.moveX=eK(t,e._accountsForMovesUpTo),e.moveY=eG(t,e._accountsForMovesUpTo);var r=e._accountsForMovesUpTo,n=eY(t,r),o=eK(t,r),i=eJ(t,r),a=eG(t,r),s=e.dx+(o-n),l=e.dy+(a-i),u=t.mostRecentTimeStamp-e._accountsForMovesUpTo;e.vx=(s-e.dx)/u,e.vy=(l-e.dy)/u,e.dx=s,e.dy=l,e._accountsForMovesUpTo=t.mostRecentTimeStamp},create(e){var t={handle:null,shouldCancelClick:!1,timeout:null},r={stateID:Math.random(),moveX:0,moveY:0,x0:0,y0:0,dx:0,dy:0,vx:0,vy:0,numberActiveTouches:0,_accountsForMovesUpTo:0};return{panHandlers:{onStartShouldSetResponder:t=>null!=e.onStartShouldSetPanResponder&&e.onStartShouldSetPanResponder(t,r),onMoveShouldSetResponder:t=>null!=e.onMoveShouldSetPanResponder&&e.onMoveShouldSetPanResponder(t,r),onStartShouldSetResponderCapture:t=>(1===t.nativeEvent.touches.length&&e1._initializeGestureState(r),r.numberActiveTouches=t.touchHistory.numberActiveTouches,null!=e.onStartShouldSetPanResponderCapture&&e.onStartShouldSetPanResponderCapture(t,r)),onMoveShouldSetResponderCapture(t){var n=t.touchHistory;return r._accountsForMovesUpTo!==n.mostRecentTimeStamp&&(e1._updateGestureStateOnMove(r,n),!!e.onMoveShouldSetPanResponderCapture&&e.onMoveShouldSetPanResponderCapture(t,r))},onResponderGrant:n=>(t.handle||(t.handle=ej.createInteractionHandle()),t.timeout&&clearTimeout(t.timeout),t.shouldCancelClick=!0,r.x0=eQ(n.touchHistory),r.y0=e0(n.touchHistory),r.dx=0,r.dy=0,e.onPanResponderGrant&&e.onPanResponderGrant(n,r),null==e.onShouldBlockNativeResponder||e.onShouldBlockNativeResponder(n,r)),onResponderReject(n){e2(t,e.onPanResponderReject,n,r)},onResponderRelease(n){e2(t,e.onPanResponderRelease,n,r),e6(t),e1._initializeGestureState(r)},onResponderStart(t){var n=t.touchHistory;r.numberActiveTouches=n.numberActiveTouches,e.onPanResponderStart&&e.onPanResponderStart(t,r)},onResponderMove(t){var n=t.touchHistory;r._accountsForMovesUpTo!==n.mostRecentTimeStamp&&(e1._updateGestureStateOnMove(r,n),e.onPanResponderMove&&e.onPanResponderMove(t,r))},onResponderEnd(n){var o=n.touchHistory;r.numberActiveTouches=o.numberActiveTouches,e2(t,e.onPanResponderEnd,n,r)},onResponderTerminate(n){e2(t,e.onPanResponderTerminate,n,r),e6(t),e1._initializeGestureState(r)},onResponderTerminationRequest:t=>null==e.onPanResponderTerminationRequest||e.onPanResponderTerminationRequest(t,r),onClickCapture:e=>{!0===t.shouldCancelClick&&(e.stopPropagation(),e.preventDefault())}},getInteractionHandle:()=>t.handle}}};function e2(e,t,r,n){e.handle&&(ej.clearInteractionHandle(e.handle),e.handle=null),t&&t(r,n)}function e6(e){e.timeout=setTimeout(()=>{e.shouldCancelClick=!1},250)}var e5={window:{fontScale:1,height:0,scale:1,width:0},screen:{fontScale:1,height:0,scale:1,width:0}},e3={},e8=eL.Z;function e4(){if(eL.Z){var e,t,r=window;if(r.visualViewport){var n=r.visualViewport;e=Math.round(n.height*n.scale),t=Math.round(n.width*n.scale)}else{var o=r.document.documentElement;e=o.clientHeight,t=o.clientWidth}e5.window={fontScale:1,height:e,scale:r.devicePixelRatio||1,width:t},e5.screen={fontScale:1,height:r.screen.height,scale:r.devicePixelRatio||1,width:r.screen.width}}}function e7(){e4(),Array.isArray(e3.change)&&e3.change.forEach(e=>e(e5))}class e9{static get(e){return e8&&(e8=!1,e4()),eM()(e5[e],"No dimension set for key "+e),e5[e]}static set(e){e&&(eL.Z?eM()(!1,"Dimensions cannot be set in the browser"):(null!=e.screen&&(e5.screen=e.screen),null!=e.window&&(e5.window=e.window)))}static addEventListener(e,t){return e3[e]=e3[e]||[],e3[e].push(t),{remove:()=>{this.removeEventListener(e,t)}}}static removeEventListener(e,t){Array.isArray(e3[e])&&(e3[e]=e3[e].filter(e=>e!==t))}}eL.Z&&(window.visualViewport?window.visualViewport.addEventListener("resize",e7,!1):window.addEventListener("resize",e7,!1));var te=r(5275);let tt=(0,_.createContext)({zIndex:1e5}),tr=(0,_.createContext)(null);function tn(e,t,r=25){return e{let{isHidden:t,controller:r}=(0,ti.$)(),[n,o]=(0,to.T)({prop:r?.open??e.open,defaultProp:e.defaultOpen??!1,onChange:t=>{r?.onOpenChange?.(t),e.onOpenChange?.(t)},strategy:"most-recent-wins",transition:!0});return{open:n,setOpen:o,isHidden:t,controller:r}};var ts=r(3020);let tl=(0,ey.Y)((0,_.forwardRef)(function(e,t){let r=(0,_.useContext)(tt),{animation:n,animationConfig:o,modal:i=!1,zIndex:a=r.zIndex+1,moveOnKeyboardChange:s=!1,unmountChildrenWhenHidden:l=!1,portalProps:u,containerComponent:c=_.Fragment}=e,d=eA(),f=ta(e),[p,m]=(0,_.useState)(null),g=function(e,t,r={}){let n=_.useRef(null),o=_.useRef(null),[i,a]=(0,_.useState)(0),[s,l]=(0,_.useState)(0),u=e.snapPointsMode??"percent",c=e.snapPoints??("percent"===u?[80]:"constant"===u?[256]:["fit"]),d="fit"===c[0],f=(0,_.useMemo)(()=>e.dismissOnSnapToBottom?[...c,0]:c,[JSON.stringify(c),e.dismissOnSnapToBottom]),[h,p]=(0,to.T)({prop:e.position,defaultProp:e.defaultPosition||(t.open?0:-1),onChange:e.onPositionChange,strategy:"most-recent-wins",transition:!0}),m=!1===t.open?-1:h,{open:g}=t,y=(0,_.useCallback)(r=>{e.dismissOnSnapToBottom&&r===f.length-1?t.setOpen(!1):p(r)},[e.dismissOnSnapToBottom,f.length,p,t.setOpen]);g&&e.dismissOnSnapToBottom&&m===f.length-1&&p(0);let v=g&&m<0;(0,_.useEffect)(()=>{v&&y(0)},[y,v]);let{animationDriver:w}=eb();if(!w)throw Error("Must set animations in tamagui.config.ts");let b=(0,ts.h)(()=>({enabled:!1,y:0,paneY:0,paneMinY:0,scrollStartY:-1,drag:()=>{},release:()=>{},scrollLock:!1})),x=e.forceRemoveScrollEnabled??(g&&e.modal),E=f[0];return{screenSize:"percent"===u?i/(("number"==typeof E?E:100)/100):s,maxSnapPoint:E,removeScrollEnabled:x,scrollBridge:b,modal:!!e.modal,open:t.open,setOpen:t.setOpen,hidden:!!t.isHidden,contentRef:o,handleRef:n,frameSize:i,setFrameSize:a,dismissOnOverlayPress:e.dismissOnOverlayPress??!0,dismissOnSnapToBottom:e.dismissOnSnapToBottom??!1,onOverlayComponent:r.onOverlayComponent,scope:e.__scopeSheet,hasFit:d,position:m,snapPoints:f,snapPointsMode:u,setMaxContentSize:l,setPosition:y,setPositionImmediate:p,onlyShowFrame:!1}}(e,f,{onOverlayComponent:m}),{frameSize:b,setFrameSize:x,snapPoints:E,snapPointsMode:S,hasFit:k,position:R,setPosition:C,scrollBridge:A,screenSize:T,setMaxContentSize:M,maxSnapPoint:I}=g,{open:O,controller:z,isHidden:L}=f,P=(0,_.useRef)(null),N=(0,v.ex)(t,P),B=(()=>{let[e,t]=n?Array.isArray(n)?n:[n]:[];return o??(e?{...(0,ev.iE)().animations.animations[e],...t}:null)})(),[j,F]=(0,_.useState)(!1),U=!h.$L&&i&&j,$=(0,_.useContext)(tr),D=(0,_.useCallback)(e=>{F(e)},[]),H=(0,_.useMemo)(()=>E.map(e=>(function(e,t,r,n){if(!r||!n)return 0;if("mixed"===e){if("number"==typeof t)return r-Math.min(r,Math.max(0,t));if("fit"===t)return r-Math.min(r,n);if(t.endsWith("%")){let e=Math.min(100,Math.max(0,Number(t.slice(0,-1))))/100;return Number.isNaN(e)?(console.warn("Invalid snapPoint percentage string"),0):Math.round(r-e*r)}return console.warn("Invalid snapPoint unknown value"),0}if("fit"===e)return 0===t?r:r-Math.min(r,n);if("constant"===e&&"number"==typeof t)return r-Math.min(r,Math.max(0,t));let o=Math.min(100,Math.max(0,Number(t)))/100;return Number.isNaN(o)?(console.warn("Invalid snapPoint percentage"),0):Math.round(r-o*r)})(S,e,T,b)),[T,b,E,S]),{animationDriver:V}=eb(),{useAnimatedNumber:W,useAnimatedNumberStyle:q,useAnimatedNumberReaction:X}=V,Z=V.View??w.Kq;(0,h.LI)(()=>{if($&&O)return $(!0),()=>{$(!1)}},[$,O]);let K=(0,_.useMemo)(()=>({zIndex:a}),[a]),G=W(10000.1),Y=(0,_.useRef)(10000.1);function J(){G.stop(),A.onFinishAnimate&&(A.onFinishAnimate(),A.onFinishAnimate=void 0)}X({value:G,hostRef:P},(0,_.useCallback)(e=>{Y.current=e,A.paneY=e},[V]));let Q=10000.1===Y.current,ee=(0,e_.z)(e=>{if(0===b)return;let t=L||-1===e?T:H[e];if(Y.current!==t){if(Y.current=t,J(),Q||L){if(G.setValue(T,{type:"timing",duration:0}),L)return;t=H[e],Y.current=t}G.setValue(t,{type:"spring",...B})}});(0,h.LI)(()=>{T&&Q&&G.setValue(T,{type:"timing",duration:0})},[Q,T]),(0,h.LI)(()=>{b&&T&&!L&&(!Q||O)&&ee(R)},[L,b,T,O,R]);let et=e.disableDrag??z?.disableDrag,er=(0,ex.C)(),[en,eo]=(0,_.useState)(!1),ei=(0,_.useMemo)(()=>{if(et||!b||j)return;let e=H[0];A.paneMinY=e;let t=Y.current;function r(e){eo(e),y&&(e?y.innerText=":root * { user-select: none !important; -webkit-user-select: none !important; }":y.innerText="")}let n=({vy:e,dragAt:n})=>{a=!1,r(!1);let o=n+t+b*e*.2,i=0,s=1/0;for(let e=0;et?o-t:t-o;r{n({vy:t.vy,dragAt:t.dy})},i=()=>{r(!0),J(),t=Y.current},a=!1;return A.drag=r=>{a||(a=!0,i());let n=r+t;G.setValue(tn(n,e),{type:"direct"})},A.release=n,e1.create({onMoveShouldSetPanResponder:(e,{dy:t})=>{if(e.target===g.handleRef.current)return!0;let r=0!==A.y,n=A.paneY-5<=A.paneMinY;return!r&&(!n||!!r||!(t<0)||!!h.$L)&&Math.abs(t)>5},onPanResponderGrant:i,onPanResponderMove:(r,{dy:n})=>{let o=tn(n+t,e);G.setValue(o,{type:"direct"})},onPanResponderEnd:o,onPanResponderTerminate:o,onPanResponderRelease:o})},[et,j,ee,b,H,C]),ea=(0,_.useCallback)(e=>{let t=Math.min(e.nativeEvent?.layout.height,e9.get("window").height);t&&x(t)},[d]),el=(0,_.useCallback)(e=>{let t=Math.min(e.nativeEvent?.layout.height,e9.get("window").height);t&&M(t)},[d]),eu=q(G,e=>({transform:[{translateY:0===b?10000.1:e}]})),ec=(0,_.useRef)(null);(0,_.useEffect)(()=>{if(h.$L||!s)return;let e=eC.addListener("keyboardDidShow",e=>{null===ec.current&&(ec.current=G.getValue(),G.setValue(Math.max(G.getValue()-e.endCoordinates.height,0)))}),t=eC.addListener("keyboardDidHide",()=>{null!==ec.current&&(G.setValue(ec.current),ec.current=null)});return()=>{t.remove(),e.remove()}},[s]);let[ed,ef]=(0,_.useState)(O?1:0);O&&0===ed&&ef(1),(0,_.useEffect)(()=>{if(!O){let e=setTimeout(()=>{ef(0)},400);return()=>{clearTimeout(e)}}},[O]);let ep=k?void 0:"percent"===S?`${I}${h.$L?"dvh":"%"}`:I,ey=(0,es.jsx)(tt.Provider,{value:K,children:(0,es.jsxs)(eh,{...g,children:[(0,es.jsx)(eg.M,{custom:{open:O},children:U||!O?null:p}),"percent"!==S&&(0,es.jsx)(te.Z,{style:{opacity:0,position:"absolute",top:0,left:0,right:0,bottom:0,pointerEvents:"none"},onLayout:el}),(0,es.jsx)(Z,{ref:N,...ei?.panHandlers,onLayout:ea,...!en&&{animation:n},disableClassName:!0,style:[{position:"absolute",zIndex:a,width:"100%",height:ep,minHeight:ep,opacity:ed,...(U||!O)&&{pointerEvents:"none"}},eu],children:e.children})]})}),ew=(0,_.useContext)(em.fG);if(i){let e=(0,es.jsx)(eS.h_,{zIndex:a,...u,children:!!(ed||!l)&&(0,es.jsx)(c,{children:(0,es.jsx)(eE.Q,{forceClassName:!0,name:er,children:(0,es.jsx)(em.fG.Provider,{value:ew,children:ey})})})});return h.$L?e:(0,es.jsx)(tr.Provider,{value:D,children:e})}return ey}));var tu=r(2988),tc=r(3950),td=r(2050),tf=r(929),th=r(9926),tp=["onScroll","onTouchMove","onWheel","scrollEnabled","scrollEventThrottle","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","style"];function tm(e){return{nativeEvent:{contentOffset:{get x(){return e.target.scrollLeft},get y(){return e.target.scrollTop}},contentSize:{get height(){return e.target.scrollHeight},get width(){return e.target.scrollWidth}},layoutMeasurement:{get height(){return e.target.offsetHeight},get width(){return e.target.offsetWidth}}},timeStamp:Date.now()}}var tg=_.forwardRef((e,t)=>{var r=e.onScroll,n=e.onTouchMove,o=e.onWheel,i=e.scrollEnabled,a=void 0===i||i,s=e.scrollEventThrottle,l=void 0===s?0:s,u=e.showsHorizontalScrollIndicator,c=e.showsVerticalScrollIndicator,d=e.style,f=(0,tc.Z)(e,tp),h=_.useRef({isScrolling:!1,scrollLastTick:0}),p=_.useRef(null),m=_.useRef(null);function g(e){return t=>{a&&e&&e(t)}}function y(e){h.current.scrollLastTick=Date.now(),r&&r(tm(e))}return _.createElement(te.Z,(0,tu.Z)({},f,{onScroll:function(e){if(e.stopPropagation(),e.target===m.current){var t,n;(e.persist(),null!=p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{h.current.isScrolling=!1,r&&r(tm(e))},100),h.current.isScrolling)?(t=h.current.scrollLastTick,n=Date.now()-t,l>0&&n>=l&&y(e)):(h.current.isScrolling=!0,y(e))}},onTouchMove:g(n),onWheel:g(o),ref:(0,th.Z)(m,t),style:[d,!a&&ty.scrollDisabled,(!1===u||!1===c)&&ty.hideScrollbar]}))}),ty=tf.Z.create({scrollDisabled:{overflowX:"hidden",overflowY:"hidden",touchAction:"none"},hideScrollbar:{scrollbarWidth:"none"}}),tv=r(2319),tw=r(9895),tb=r.n(tw),t_=["contentContainerStyle","horizontal","onContentSizeChange","refreshControl","stickyHeaderIndices","pagingEnabled","forwardedRef","keyboardDismissMode","onScroll","centerContent"],tx={};class tE extends _.Component{constructor(){super(...arguments),this._scrollNodeRef=null,this._innerViewRef=null,this.isTouching=!1,this.lastMomentumScrollBeginTime=0,this.lastMomentumScrollEndTime=0,this.observedScrollSinceBecomingResponder=!1,this.becameResponderWhileAnimating=!1,this.scrollResponderHandleScrollShouldSetResponder=()=>this.isTouching,this.scrollResponderHandleStartShouldSetResponderCapture=e=>this.scrollResponderIsAnimating(),this.scrollResponderHandleTerminationRequest=()=>!this.observedScrollSinceBecomingResponder,this.scrollResponderHandleTouchEnd=e=>{var t=e.nativeEvent;this.isTouching=0!==t.touches.length,this.props.onTouchEnd&&this.props.onTouchEnd(e)},this.scrollResponderHandleResponderRelease=e=>{this.props.onResponderRelease&&this.props.onResponderRelease(e);var t=ek.Z.currentlyFocusedField();this.props.keyboardShouldPersistTaps||null==t||e.target===t||this.observedScrollSinceBecomingResponder||this.becameResponderWhileAnimating||(this.props.onScrollResponderKeyboardDismissed&&this.props.onScrollResponderKeyboardDismissed(e),ek.Z.blurTextInput(t))},this.scrollResponderHandleScroll=e=>{this.observedScrollSinceBecomingResponder=!0,this.props.onScroll&&this.props.onScroll(e)},this.scrollResponderHandleResponderGrant=e=>{this.observedScrollSinceBecomingResponder=!1,this.props.onResponderGrant&&this.props.onResponderGrant(e),this.becameResponderWhileAnimating=this.scrollResponderIsAnimating()},this.scrollResponderHandleScrollBeginDrag=e=>{this.props.onScrollBeginDrag&&this.props.onScrollBeginDrag(e)},this.scrollResponderHandleScrollEndDrag=e=>{this.props.onScrollEndDrag&&this.props.onScrollEndDrag(e)},this.scrollResponderHandleMomentumScrollBegin=e=>{this.lastMomentumScrollBeginTime=Date.now(),this.props.onMomentumScrollBegin&&this.props.onMomentumScrollBegin(e)},this.scrollResponderHandleMomentumScrollEnd=e=>{this.lastMomentumScrollEndTime=Date.now(),this.props.onMomentumScrollEnd&&this.props.onMomentumScrollEnd(e)},this.scrollResponderHandleTouchStart=e=>{this.isTouching=!0,this.props.onTouchStart&&this.props.onTouchStart(e)},this.scrollResponderHandleTouchMove=e=>{this.props.onTouchMove&&this.props.onTouchMove(e)},this.scrollResponderIsAnimating=()=>Date.now()-this.lastMomentumScrollEndTime<16||this.lastMomentumScrollEndTime{if("number"==typeof e)console.warn("`scrollResponderScrollTo(x, y, animated)` is deprecated. Use `scrollResponderScrollTo({x: 5, y: 5, animated: true})` instead.");else{var n=e||tx;e=n.x,t=n.y,r=n.animated}var o=this.getScrollableNode(),i=e||0,a=t||0;null!=o&&("function"==typeof o.scroll?o.scroll({top:a,left:i,behavior:r?"smooth":"auto"}):(o.scrollLeft=i,o.scrollTop=a))},this.scrollResponderZoomTo=(e,t)=>{"ios"!==ec.OS&&eM()("zoomToRect is not implemented")},this.scrollResponderScrollNativeHandleToKeyboard=(e,t,r)=>{this.additionalScrollOffset=t||0,this.preventNegativeScrollOffset=!!r,tv.Z.measureLayout(e,this.getInnerViewNode(),this.scrollResponderTextInputFocusError,this.scrollResponderInputMeasureAndScrollToKeyboard)},this.scrollResponderInputMeasureAndScrollToKeyboard=(e,t,r,n)=>{var o=e9.get("window").height;this.keyboardWillOpenTo&&(o=this.keyboardWillOpenTo.endCoordinates.screenY);var i=t-o+n+this.additionalScrollOffset;this.preventNegativeScrollOffset&&(i=Math.max(0,i)),this.scrollResponderScrollTo({x:0,y:i,animated:!0}),this.additionalOffset=0,this.preventNegativeScrollOffset=!1},this.scrollResponderKeyboardWillShow=e=>{this.keyboardWillOpenTo=e,this.props.onKeyboardWillShow&&this.props.onKeyboardWillShow(e)},this.scrollResponderKeyboardWillHide=e=>{this.keyboardWillOpenTo=null,this.props.onKeyboardWillHide&&this.props.onKeyboardWillHide(e)},this.scrollResponderKeyboardDidShow=e=>{e&&(this.keyboardWillOpenTo=e),this.props.onKeyboardDidShow&&this.props.onKeyboardDidShow(e)},this.scrollResponderKeyboardDidHide=e=>{this.keyboardWillOpenTo=null,this.props.onKeyboardDidHide&&this.props.onKeyboardDidHide(e)},this.flashScrollIndicators=()=>{this.scrollResponderFlashScrollIndicators()},this.getScrollResponder=()=>this,this.getScrollableNode=()=>this._scrollNodeRef,this.getInnerViewRef=()=>this._innerViewRef,this.getInnerViewNode=()=>this._innerViewRef,this.getNativeScrollRef=()=>this._scrollNodeRef,this.scrollTo=(e,t,r)=>{if("number"==typeof e)console.warn("`scrollTo(y, x, animated)` is deprecated. Use `scrollTo({x: 5, y: 5, animated: true})` instead.");else{var n=e||tx;t=n.x,e=n.y,r=n.animated}this.scrollResponderScrollTo({x:t||0,y:e||0,animated:!1!==r})},this.scrollToEnd=e=>{var t=!1!==(e&&e.animated),r=this.props.horizontal,n=this.getScrollableNode(),o=r?n.scrollWidth:0,i=r?0:n.scrollHeight;this.scrollResponderScrollTo({x:o,y:i,animated:t})},this._handleContentOnLayout=e=>{var t=e.nativeEvent.layout,r=t.width,n=t.height;this.props.onContentSizeChange(r,n)},this._handleScroll=e=>{"on-drag"===this.props.keyboardDismissMode&&eR(),this.scrollResponderHandleScroll(e)},this._setInnerViewRef=e=>{this._innerViewRef=e},this._setScrollNodeRef=e=>{this._scrollNodeRef=e,null!=e&&(e.getScrollResponder=this.getScrollResponder,e.getInnerViewNode=this.getInnerViewNode,e.getInnerViewRef=this.getInnerViewRef,e.getNativeScrollRef=this.getNativeScrollRef,e.getScrollableNode=this.getScrollableNode,e.scrollTo=this.scrollTo,e.scrollToEnd=this.scrollToEnd,e.flashScrollIndicators=this.flashScrollIndicators,e.scrollResponderZoomTo=this.scrollResponderZoomTo,e.scrollResponderScrollNativeHandleToKeyboard=this.scrollResponderScrollNativeHandleToKeyboard),(0,td.Z)(this.props.forwardedRef)(e)}}scrollResponderHandleStartShouldSetResponder(){return!1}scrollResponderHandleResponderReject(){tb()(!1,"ScrollView doesn't take rejection well - scrolls anyway")}scrollResponderFlashScrollIndicators(){}scrollResponderTextInputFocusError(e){console.error("Error measuring text field: ",e)}render(){var e=this.props,t=e.contentContainerStyle,r=e.horizontal,n=e.onContentSizeChange,o=e.refreshControl,i=e.stickyHeaderIndices,a=e.pagingEnabled,s=(e.forwardedRef,e.keyboardDismissMode,e.onScroll,e.centerContent),l=(0,tc.Z)(e,t_),u={};n&&(u={onLayout:this._handleContentOnLayout});var c=!r&&Array.isArray(i),d=c||a?_.Children.map(this.props.children,(e,t)=>{var r=c&&i.indexOf(t)>-1;return null!=e&&(r||a)?_.createElement(te.Z,{style:[r&&tk.stickyHeader,a&&tk.pagingEnabledChild]},e):e}):this.props.children,f=_.createElement(te.Z,(0,tu.Z)({},u,{children:d,collapsable:!1,ref:this._setInnerViewRef,style:[r&&tk.contentContainerHorizontal,s&&tk.contentContainerCenterContent,t]})),h=r?tk.baseHorizontal:tk.baseVertical,p=r?tk.pagingEnabledHorizontal:tk.pagingEnabledVertical,m=(0,eI.Z)((0,eI.Z)({},l),{},{style:[h,a&&p,this.props.style],onTouchStart:this.scrollResponderHandleTouchStart,onTouchMove:this.scrollResponderHandleTouchMove,onTouchEnd:this.scrollResponderHandleTouchEnd,onScrollBeginDrag:this.scrollResponderHandleScrollBeginDrag,onScrollEndDrag:this.scrollResponderHandleScrollEndDrag,onMomentumScrollBegin:this.scrollResponderHandleMomentumScrollBegin,onMomentumScrollEnd:this.scrollResponderHandleMomentumScrollEnd,onStartShouldSetResponder:this.scrollResponderHandleStartShouldSetResponder,onStartShouldSetResponderCapture:this.scrollResponderHandleStartShouldSetResponderCapture,onScrollShouldSetResponder:this.scrollResponderHandleScrollShouldSetResponder,onScroll:this._handleScroll,onResponderGrant:this.scrollResponderHandleResponderGrant,onResponderTerminationRequest:this.scrollResponderHandleTerminationRequest,onResponderTerminate:this.scrollResponderHandleTerminate,onResponderRelease:this.scrollResponderHandleResponderRelease,onResponderReject:this.scrollResponderHandleResponderReject});eM()(void 0!==tg,"ScrollViewClass must not be undefined");var g=_.createElement(tg,(0,tu.Z)({},m,{ref:this._setScrollNodeRef}),f);return o?_.cloneElement(o,{style:m.style},g):g}}var tS={flexGrow:1,flexShrink:1,transform:"translateZ(0)",WebkitOverflowScrolling:"touch"},tk=tf.Z.create({baseVertical:(0,eI.Z)((0,eI.Z)({},tS),{},{flexDirection:"column",overflowX:"hidden",overflowY:"auto"}),baseHorizontal:(0,eI.Z)((0,eI.Z)({},tS),{},{flexDirection:"row",overflowX:"auto",overflowY:"hidden"}),contentContainerHorizontal:{flexDirection:"row"},contentContainerCenterContent:{justifyContent:"center",flexGrow:1},stickyHeader:{position:"sticky",top:0,zIndex:10},pagingEnabledHorizontal:{scrollSnapType:"x mandatory"},pagingEnabledVertical:{scrollSnapType:"y mandatory"},pagingEnabledChild:{scrollSnapAlign:"start"}}),tR=_.forwardRef((e,t)=>_.createElement(tE,(0,tu.Z)({},e,{forwardedRef:t})));tR.displayName="ScrollView";let tC=(0,c.z)(tR,{name:"ScrollView",scrollEnabled:!0,variants:{fullscreen:{true:d.Xu}}},{accept:{contentContainerStyle:"style"}}),tA=(0,_.forwardRef)(({__scopeSheet:e,children:t,onScroll:r,...n},o)=>{let{scrollBridge:i}=ep("SheetScrollView",e),a=(0,_.useRef)(null),s=(0,_.useRef)({lastPageY:0,dragAt:0,dys:[],isScrolling:!1,isDragging:!1});return(0,es.jsx)(tC,{ref:(0,v.FE)(a,o),flex:1,scrollEventThrottle:8,onScroll:e=>{let{y:t}=e.nativeEvent.contentOffset;i.y=t,t>0&&(i.scrollStartY=-1),r?.(e)},onStartShouldSetResponder:()=>(i.scrollStartY=-1,s.current.isDragging=!0,!0),onMoveShouldSetResponder:()=>!1,onResponderRelease:()=>{if(!s.current.isDragging)return;s.current.isDragging=!1,i.scrollStartY=-1,s.current.isScrolling=!1;let e=0;if(s.current.dys.length){let t=s.current.dys.slice(-10);e=(t.length?t.reduce((e,t)=>e+t,0):0)/t.length*.04}s.current.dys=[],i.release({dragAt:s.current.dragAt,vy:e})},className:"_ovs-contain",...n,children:(0,_.useMemo)(()=>t,[t])})}),tT=({snapPoints:e,position:t,screenSize:r,frameSize:n,snapPointsMode:o})=>{if("fit"===o)return 0;if("constant"===o)return Number(e[0])-Number(e[t]??0);if("percent"===o)return(Number(e[0])/100-Number(e[t]??0)/100)*r;let i=e[0];if("fit"===i)return 0;let a="string"==typeof i?Number(i.slice(0,-1))/100*r:i,s=e[t]??0,l=a-("string"==typeof s?Number(s.slice(0,-1))/100*r:s);return Number.isNaN(l)?0:l};var tM=r(357);let tI=(0,c.z)(d.sL,{name:m,variants:{open:{true:{pointerEvents:"auto"},false:{opacity:0,pointerEvents:"none"}},unstyled:{false:{height:10,borderRadius:100,backgroundColor:"$background",zIndex:10,marginHorizontal:"35%",marginBottom:"$2",opacity:.5,hoverStyle:{opacity:.7}}}},defaultVariants:{unstyled:"1"===tM.env.TAMAGUI_HEADLESS}}),tO=(0,c.z)(f.K,{name:g,variants:{open:{true:{opacity:1,pointerEvents:"auto"},false:{opacity:0,pointerEvents:"none"}},unstyled:{false:{fullscreen:!0,position:"absolute",backgrounded:!0,zIndex:99999,pointerEvents:"auto"}}},defaultVariants:{unstyled:"1"===tM.env.TAMAGUI_HEADLESS}}),tz=function({Handle:e,Frame:t,Overlay:r}){let n=e.styleable(({__scopeSheet:t,...r},n)=>{let o=ep(m,t),i=(0,v.ex)(o.handleRef,n);return o.onlyShowFrame?null:(0,es.jsx)(e,{ref:i,onPress:()=>{let e=o.snapPoints.length+(o.dismissOnSnapToBottom?-1:0),t=(o.position+1)%e;o.setPosition(t)},open:o.open,...r})}),o=r.extractable((0,_.memo)(e=>{let{__scopeSheet:t,...n}=e,o=ep(g,t),i=(0,_.useMemo)(()=>(0,es.jsx)(r,{...n,debug:"verbose",onPress:(0,b.Mj)(n.onPress,o.dismissOnOverlayPress?()=>{o.setOpen(!1)}:void 0)}),[n.onPress,o.dismissOnOverlayPress]);return(0,h.LI)(()=>{o.onOverlayComponent?.(i)},[i]),o.onlyShowFrame,null})),i=t.extractable((0,_.forwardRef)(({__scopeSheet:e,adjustPaddingForOffscreenContent:r,disableHideBottomOverflow:n,children:o,...i},a)=>{let s=ep(p,e),{hasFit:l,removeScrollEnabled:u,frameSize:c,contentRef:d,open:f}=s,h=(0,v.ex)(a,d),m=tT(s),g=(0,_.useMemo)(()=>(0,es.jsxs)(t,{ref:h,flex:l?0:1,height:l?void 0:c,pointerEvents:f?"auto":"none",...i,children:[o,r&&(0,es.jsx)(w.Kq,{"data-sheet-offscreen-pad":!0,height:m,width:"100%"})]}),[f,i,c,m,r,l]);return(0,es.jsxs)(es.Fragment,{children:[(0,es.jsx)(el,{forwardProps:!0,enabled:u,allowPinchZoom:!0,shards:[d],removeScrollBar:!1,children:g}),!n&&(0,es.jsx)(t,{...i,componentName:"SheetCover",children:null,position:"absolute",bottom:"-100%",zIndex:-1,height:s.frameSize,left:0,right:0,borderWidth:0,borderRadius:0,shadowOpacity:0})]})})),a=(0,_.forwardRef)(function(e,t){let r=(0,eu.S)(),{isShowingNonSheet:n}=(0,ti.$)();return e.native&&ec.OS,n||!r?null:(0,es.jsx)(tl,{ref:t,...e})}),s={Frame:i,Overlay:o,Handle:n,ScrollView:tA},l=(0,b.$e)(a,s);return(0,b.$e)(a,{...s,Controlled:l})}({Frame:(0,c.z)(d.FA,{name:p,variants:{unstyled:{false:{flex:1,backgroundColor:"$background",borderTopLeftRadius:"$true",borderTopRightRadius:"$true",width:"100%",maxHeight:"100%",overflow:"hidden"}}},defaultVariants:{unstyled:"1"===tM.env.TAMAGUI_HEADLESS}}),Handle:tI,Overlay:tO})},7657:function(e,t,r){"use strict";r.d(t,{$:function(){return o},W:function(){return i}});var n=r(2265);let o=()=>{let e=(0,n.useContext)(i),t=e?.hidden,r=t&&e?.open;return{controller:e,isHidden:t,isShowingNonSheet:r,disableDrag:e?.disableDrag}},i=(0,n.createContext)(null)},3020:function(e,t,r){"use strict";r.d(t,{h:function(){return o}});var n=r(2265);function o(e){if(typeof document>"u")return(0,n.useMemo)(()=>e(),[]);let t=(0,n.useRef)();return t.current||(t.current={v:e()}),t.current.v}},3277:function(e,t,r){"use strict";r.d(t,{T:function(){return a}});var n=r(9087),o=r(2265);let i=e=>e();function a({prop:e,defaultProp:t,onChange:r,strategy:a="prop-wins",preventUpdate:l,transition:u}){let[c,d]=(0,o.useState)(e??t),f=(0,o.useRef)(c),h="prop-wins"===a&&void 0!==e,p=h?e:c,m=(0,n.z)(r||s),g=u?o.startTransition:i;return(0,o.useEffect)(()=>{void 0!==e&&(f.current=e,g(()=>{d(e)}))},[e]),(0,o.useEffect)(()=>{h||c!==f.current&&(f.current=c,m(c))},[m,c,h]),[p,(0,n.z)(e=>{l||(h?m("function"==typeof e?e(f.current):e):g(()=>{d(e)}))})]}let s=()=>{}},4582:function(e,t,r){"use strict";r.d(t,{C:function(){return s}});var n=r(281),o=r(2265),i=r(9033),a=r(8411);function s(e){let t=(0,a.q4)((0,o.useContext)(i.s)),[r,s]=(0,o.useState)(t?.state.name||"");return(0,n.LI)(()=>{if(t)return s(t.state.name),t.onChangeTheme((t,r)=>{let n=e?.parent&&r.state.parentName||t;n&&s(n)})},[t?.state.name]),r}},967:function(e,t,r){"use strict";let n;r.d(t,{ONNX:function(){return n},p:function(){return u}});var o,i,a=r(495),s=r(6388),l=r(357);let u=["wasm"];void 0!==l&&l?.release?.name==="node"?(n=a??(o||(o=r.t(a,2))),u.unshift("cpu")):(n=s??(i||(i=r.t(s,2))),"undefined"!=typeof navigator&&/iP(hone|od|ad).+16_4.+AppleWebKit/.test(navigator.userAgent)&&(n.env.wasm.simd=!1))},16:function(e,t,r){"use strict";r.d(t,{z:function(){return a}});var n=r(911);async function o(e,t){return await (0,n.yM)(e,"config.json",!0,t)}class i{constructor(e){this.model_type=null,this.is_encoder_decoder=!1,Object.assign(this,e)}static async from_pretrained(e,{progress_callback:t=null,config:r=null,cache_dir:n=null,local_files_only:i=!1,revision:a="main"}={}){return new this(r??await o(e,{progress_callback:t,config:r,cache_dir:n,local_files_only:i,revision:a}))}}class a{static async from_pretrained(...e){return i.from_pretrained(...e)}}},851:function(e,t,r){"use strict";r.d(t,{O:function(){return g}});var n=r(8386),o=r(3342),i=r(8464);let{env:a}=r(967).ONNX,s="2.17.1",l="undefined"!=typeof self&&"caches"in self,u=!y(n),c=!y(o),d=u&&c,f=d?o.dirname(o.dirname(i.fileURLToPath("file:///mnt/c/tools/projects/translator-tamagui/node_modules/@xenova/transformers/src/env.js"))):"./",h=d?o.join(f,"/.cache/"):null,p="/models/",m=d?o.join(f,p):p;a?.wasm&&(a.wasm.wasmPaths=d?o.join(f,"/dist/"):`https://cdn.jsdelivr.net/npm/@xenova/transformers@${s}/dist/`);let g={backends:{onnx:a,tfjs:{}},__dirname:f,version:s,allowRemoteModels:!0,remoteHost:"https://huggingface.co/",remotePathTemplate:"{model}/resolve/{revision}/",allowLocalModels:!0,localModelPath:m,useFS:u,useBrowserCache:l,useFSCache:u,cacheDir:h,useCustomCache:!1,customCache:null};function y(e){return 0===Object.keys(e).length}},9078:function(e,t,r){"use strict";let n,o,i;r.d(t,{qCb:function(){return c.qC},EUT:function(){return eG}});var a=r(2018),s=r(9454),l=r(761),u=r(911),c=r(8709),d=r(2414),f=r(851),h=r(8741);let p="undefined"!=typeof self,m=p&&"DedicatedWorkerGlobalScope"===self.constructor.name;if(p)n=(e,t)=>{if(!self.OffscreenCanvas)throw Error("OffscreenCanvas not supported by this browser.");return new self.OffscreenCanvas(e,t)},i=self.createImageBitmap,o=self.ImageData;else if(h)i=async e=>{let t=(await e.metadata()).channels,{data:r,info:n}=await e.raw().toBuffer({resolveWithObject:!0}),o=new v(new Uint8ClampedArray(r),n.width,n.height,n.channels);return void 0!==t&&t!==n.channels&&o.convert(t),o};else throw Error("Unable to load image processing library.");let g={0:"nearest",1:"lanczos",2:"bilinear",3:"bicubic",4:"box",5:"hamming"},y=new Map([["png","image/png"],["jpg","image/jpeg"],["jpeg","image/jpeg"],["gif","image/gif"]]);class v{constructor(e,t,r,n){this.data=e,this.width=t,this.height=r,this.channels=n}get size(){return[this.width,this.height]}static async read(e){if(e instanceof v)return e;if("string"==typeof e||e instanceof URL)return await this.fromURL(e);throw Error(`Unsupported input type: ${typeof e}`)}static async fromURL(e){let t=await (0,u.hn)(e);if(200!==t.status)throw Error(`Unable to read image from "${e}" (${t.status} ${t.statusText})`);let r=await t.blob();return this.fromBlob(r)}static async fromBlob(e){if(p){let t=await i(e),r=n(t.width,t.height).getContext("2d");return r.drawImage(t,0,0),new this(r.getImageData(0,0,t.width,t.height).data,t.width,t.height,4)}{let t=h(await e.arrayBuffer());return await i(t)}}static fromTensor(e,t="CHW"){if(3!==e.dims.length)throw Error(`Tensor should have 3 dimensions, but has ${e.dims.length} dimensions.`);if("CHW"===t)e=e.transpose(1,2,0);else if("HWC"===t);else throw Error(`Unsupported channel format: ${t}`);if(!(e.data instanceof Uint8ClampedArray||e.data instanceof Uint8Array))throw Error(`Unsupported tensor type: ${e.type}`);switch(e.dims[2]){case 1:case 2:case 3:case 4:return new v(e.data,e.dims[1],e.dims[0],e.dims[2]);default:throw Error(`Unsupported number of channels: ${e.dims[2]}`)}}grayscale(){if(1===this.channels)return this;let e=new Uint8ClampedArray(this.width*this.height*1);switch(this.channels){case 3:case 4:for(let t=0,r=0;t=0?l=r:c=-r,o>=0?u=o:d=-o,s.drawImage(a,l,u,e,t,c,d,e,t),new v(s.getImageData(0,0,e,t).data,e,t,4).convert(i)}{let n=this.toSharp();if(r>=0&&o>=0)n=n.extract({left:Math.floor(r),top:Math.floor(o),width:e,height:t});else if(r<=0&&o<=0){let i=Math.floor(-o),a=Math.floor(-r);n=n.extend({top:i,left:a,right:e-this.width-a,bottom:t-this.height-i})}else{let i=[0,0],a=0;o<0?(i[0]=Math.floor(-o),i[1]=t-this.height-i[0]):a=Math.floor(o);let s=[0,0],l=0;r<0?(s[0]=Math.floor(-r),s[1]=e-this.width-s[0]):l=Math.floor(r),n=n.extend({top:i[0],bottom:i[1],left:s[0],right:s[1]}).extract({left:l,top:a,width:e,height:t})}return await i(n)}}async toBlob(e="image/png",t=1){if(!p)throw Error("toBlob() is only supported in browser environments.");let r=this.toCanvas();return await r.convertToBlob({type:e,quality:t})}toTensor(e="CHW"){let t=new d.es("uint8",new Uint8Array(this.data),[this.height,this.width,this.channels]);if("HWC"===e);else if("CHW"===e)t=t.permute(2,0,1);else throw Error(`Unsupported channel format: ${e}`);return t}toCanvas(){if(!p)throw Error("toCanvas() is only supported in browser environments.");let e=this.clone().rgba(),t=n(e.width,e.height),r=new o(e.data,e.width,e.height);return t.getContext("2d").putImageData(r,0,0),t}_update(e,t,r,n=null){return this.data=e,this.width=t,this.height=r,null!==n&&(this.channels=n),this}clone(){return new v(this.data.slice(),this.width,this.height,this.channels)}convert(e){if(this.channels===e)return this;switch(e){case 1:this.grayscale();break;case 3:this.rgb();break;case 4:this.rgba();break;default:throw Error(`Conversion failed due to unsupported number of channels: ${this.channels}`)}return this}async save(e){if(p){if(m)throw Error("Unable to save an image from a Web Worker.");let t=e.split(".").pop().toLowerCase(),r=y.get(t)??"image/png",n=await this.toBlob(r),o=URL.createObjectURL(n),i=document.createElement("a");i.href=o,i.download=e,i.click(),i.remove()}else if(f.O.useFS){let t=this.toSharp();return await t.toFile(e)}else throw Error("Unable to save the image because filesystem is disabled in this environment.")}toSharp(){if(p)throw Error("toSharp() is only supported in server-side environments.");return h(this.data,{raw:{width:this.width,height:this.height,channels:this.channels}})}}async function w(e,t){let r;if("undefined"==typeof AudioContext)throw Error("Unable to load audio from path/URL since `AudioContext` is not available in your environment. Instead, audio data should be passed directly to the pipeline/processor. For more information and some example code, see https://huggingface.co/docs/transformers.js/guides/node-audio-processing.");let n=await (await (0,u.hn)(e)).arrayBuffer(),o=new AudioContext({sampleRate:t});void 0===t&&console.warn(`No sampling rate provided, using default of ${o.sampleRate}Hz.`);let i=await o.decodeAudioData(n);if(2===i.numberOfChannels){let e=Math.sqrt(2),t=i.getChannelData(0),n=i.getChannelData(1);r=new Float32Array(t.length);for(let o=0;o2595*Math.log10(1+e/700),kaldi:e=>1127*Math.log(1+e/700),slaney:(e,t=1e3,r=15,n=27/Math.log(6.4))=>e>=t?r+Math.log(e/t)*n:3*e/200};function x(e,t="htk"){let r=_[t];if(!r)throw Error('mel_scale should be one of "htk", "slaney" or "kaldi".');return"number"==typeof e?r(e):e.map(e=>r(e))}let E={htk:e=>700*(10**(e/2595)-1),kaldi:e=>700*(Math.exp(e/1127)-1),slaney:(e,t=1e3,r=15,n=Math.log(6.4)/27)=>e>=r?t*Math.exp(n*(e-r)):200*e/3};function S(e,t,r){let n=(t-e)/(r-1);return Float64Array.from({length:r},(t,r)=>e+n*r)}function k(e,t,r,n,o,i=null,a="htk",s=!1){let l;if(null!==i&&"slaney"!==i)throw Error('norm must be one of null or "slaney"');let u=S(x(r,a),x(n,a),t+2),c=function(e,t="htk"){let r=E[t];if(!r)throw Error('mel_scale should be one of "htk", "slaney" or "kaldi".');return"number"==typeof e?r(e):e.map(e=>r(e))}(u,a);if(s){let t=o/(2*e);l=x(Float64Array.from({length:e},(e,r)=>r*t),a),c=u}else l=S(0,Math.floor(o/2),e);let d=function(e,t){let r=Float64Array.from({length:t.length-1},(e,r)=>t[r+1]-t[r]),n=Array.from({length:e.length},()=>Array(t.length));for(let r=0;rArray(e.length));for(let t=0;to)throw Error(`frame_length (${r}) may not be larger than fft_length (${o})`);if(x!==r)throw Error(`Length of the window (${x}) must equal frame_length (${r})`);if(n<=0)throw Error("hop_length must be greater than zero");if(a){if("reflect"!==s)throw Error(`pad_mode="${s}" not implemented yet.`);let t=Math.floor((o-1)/2)+1;e=function(e,t,r){let n=new e.constructor(e.length+t+r),o=e.length-1;for(let r=0;rE?b&&(C=w):C=k=w);let A=new c.vw(o),T=new Float64Array(o),M=new Float64Array(A.outputBufferSize),I=Array(k);for(let o=0;o=1;--e)T[e]-=d*T[e-1];T[0]*=1-d}for(let e=0;eMath.pow(e,.85));break;default:throw Error(`Unknown window type ${t}.`)}if(r&&(i=i.subarray(0,e)),null===n)return i;if(e>n)throw Error(`Length of the window (${e}) may not be larger than frame_length (${n})`);return i}function T(e,t=.5,r=null,n=!1){let o=e.logits,i=e.pred_boxes,[a,s,l]=o.dims;if(null!==r&&r.length!==a)throw Error("Make sure that you pass in as many target sizes as the batch dimension of the logits");let u=[];for(let e=0;et&&i.push(e)}else{let e=(0,c.Fp)(o.data)[1];if(e===l-1)continue;i.push(e),r=(0,c.XA)(o.data)}for(let t of i){let n=h[e].data;n=function([e,t,r,n]){return[e-r/2,t-n/2,e+r/2,t+n/2]}(n),null!==a&&(n=n.map((e,t)=>e*a[(t+1)%2])),d.boxes.push(n),d.classes.push(t),d.scores.push(r[t])}}u.push(d)}return u}function M(e,t){if(!(e instanceof Float32Array||e instanceof Float64Array))throw Error(`${t} expects input to be a Float32Array or a Float64Array, but got ${e?.constructor?.name??typeof e} instead. If using the feature extractor directly, remember to use \`read_audio(url, sampling_rate)\` to obtain the raw audio data of the file/url.`)}function I(e,t,r=0,n=null){let o=e/t,i=(0,c.eT)(o)*t;return null!==n&&i>n&&(i=Math.floor(o)*t),io?l=Math.floor(o*s/n):o>n&&(s=Math.floor(n*l/o)),await e.resize(l,s,{resample:r}))}async crop_margin(e,t=200){let r=e.clone().grayscale(),n=(0,c.VV)(r.data)[0],o=(0,c.Fp)(r.data)[0]-n;if(0===o)return e;let i=t/255,a=r.width,s=r.height,l=0,u=0;for(let e=0;ethis.preprocess(e)));return{pixel_values:(0,d.kn)(r.map(e=>e.pixel_values),0),original_sizes:r.map(e=>e.original_size),reshaped_input_sizes:r.map(e=>e.reshaped_input_size)}}}class P extends L{post_process_semantic_segmentation(e,t=null){let r=e.logits,n=r.dims[0];if(null!==t&&t.length!==n)throw Error("Make sure that you pass in as many target sizes as the batch dimension of the logits");let o=[];for(let e=0;eu[r]&&(u[r]=t[r],l.data[r]=e)}let c=Array(i.dims[0]),f=l.data;for(let e=0;evoid 0!==e);o.push({segmentation:l,labels:h})}return o}}class N extends L{}class B extends N{}class j extends L{}class F extends L{}class U extends L{}class $ extends L{}class D extends L{}class H extends L{constructor(e){super(e),this.crop_pct=this.config.crop_pct??.875}async resize(e){let t=this.size?.shortest_edge;if(void 0===t)throw Error("Size dictionary must contain 'shortest_edge' key.");if(t<384){let r=Math.floor(t/this.crop_pct),[n,o]=this.get_resize_output_image_size(e,{shortest_edge:r});e=await e.resize(n,o,{resample:this.resample}),e=await e.center_crop(t,t)}else e=await e.resize(t,t,{resample:this.resample});return e}}class V extends H{}class W extends L{}class q extends L{}class X extends L{constructor(e){super(e),this.include_top=this.config.include_top??!0,this.include_top&&(this.image_std=this.image_std.map(e=>e*e))}}class Z extends L{}class K extends L{post_process_object_detection(...e){return T(...e)}}class G extends K{}class Y extends L{}class J extends L{}class Q extends L{pad_image(e,t,r,n={}){let[o,i,a]=t,s=this.image_mean;Array.isArray(this.image_mean)||(s=Array(a).fill(s));let l=this.image_std;Array.isArray(l)||(l=Array(a).fill(s));let u=s.map((e,t)=>-e/l[t]);return super.pad_image(e,t,r,{center:!0,constant_values:u,...n})}}class ee extends Q{}class et extends L{async _call(e){let t=await super._call(e),r=[t.pixel_values.dims[0],64,64],n=new d.es("int64",new BigInt64Array(r.reduce((e,t)=>e*t)).fill(1n),r);return{...t,pixel_mask:n}}post_process_object_detection(...e){return T(...e)}remove_low_and_no_objects(e,t,r,n){let o=[],i=[],a=[];for(let s=0;sr&&(o.push(u),i.push(f),a.push(d))}return[o,i,a]}check_segment_validity(e,t,r,n=.5,o=.8){let i=[],a=0,s=0;for(let o=0;o=n&&++s;let l=a>0&&s>0;return l&&(l=a/s>o),[l,i]}compute_segments(e,t,r,n,o,i=null,a=null){let[s,l]=a??e[0].dims,u=new d.es("int32",new Int32Array(s*l),[s,l]),c=[];if(null!==a)for(let t=0;th[t]&&(f[t]=r,h[t]=e[r].data[t])}let p=0;for(let i=0;ie!==t.dims[r]))throw Error(`The first ${r.length} dimensions of 'input_points' and 'input_labels' must be the same.`);return new d.es("int64",e.flat(1/0).map(BigInt),r)}async _call(e,t=null,r=null){let n=await super._call(e);if(t&&(n.input_points=this.reshape_input_points(t,n.original_sizes,n.reshaped_input_sizes)),r){if(!n.input_points)throw Error("`input_points` must be provided if `input_labels` are provided.");n.input_labels=this.add_input_labels(r,n.input_points)}return n}post_process_masks(e,t,r,{mask_threshold:n=0,binarize:o=!0,pad_size:i=null}={}){let a=[],s=[(i=i??this.pad_size).height,i.width];for(let i=0;in&&(e[t]=1);r=new d.es("bool",e,r.dims)}f.push(r)}a.push((0,d.kn)(f))}return a}}class eo extends L{pad_image(e,t,r,n={}){let[o,i,a]=t;return super.pad_image(e,t,{width:i+(r-i%r)%r,height:o+(r-o%r)%r},{mode:"symmetric",center:!1,constant_values:-1,...n})}}class ei extends L{async _call(e,t){Array.isArray(e)||(e=[e]),Array.isArray(t)||(t=[t]);let r=await Promise.all(e.map(e=>this.preprocess(e))),n=await Promise.all(t.map(e=>this.preprocess(e,{do_normalize:!1,do_convert_rgb:!1,do_convert_grayscale:!0})));return{pixel_values:(0,d.kn)(r.map((e,t)=>(0,d.d3)([e.pixel_values,n[t].pixel_values],0)),0),original_sizes:r.map(e=>e.original_size),reshaped_input_sizes:r.map(e=>e.reshaped_input_size)}}}class ea extends z{constructor(e){super(e),this.config.mel_filters??=k(Math.floor(1+this.config.n_fft/2),this.config.feature_size,0,8e3,this.config.sampling_rate,"slaney","slaney"),this.window=A(this.config.n_fft,"hann")}_extract_fbank_features(e){let{data:t,dims:r}=C(e,this.window,this.config.n_fft,this.config.hop_length,{power:2,mel_filters:this.config.mel_filters,log_mel:"log10",max_num_frames:this.config.nb_max_frames}),n=(0,c.Fp)(t)[0];for(let e=0;ethis.config.n_samples?(console.warn("Attempting to extract features for audio longer than 30 seconds. If using a pipeline to extract transcript from a long audio clip, remember to specify `chunk_length_s` and/or `stride_length_s`."),t=e.slice(0,this.config.n_samples)):(t=new Float32Array(this.config.n_samples)).set(e);let{data:r,dims:n}=this._extract_fbank_features(t);return{input_features:new d.es("float32",r,[1,...n])}}}class es extends z{_zero_mean_unit_var_norm(e){let t=e.reduce((e,t)=>e+t,0)/e.length,r=e.reduce((e,r)=>e+(r-t)**2,0)/e.length;return e.map(e=>(e-t)/Math.sqrt(r+1e-7))}async _call(e){M(e,"Wav2Vec2FeatureExtractor"),e instanceof Float64Array&&(e=new Float32Array(e));let t=e;this.config.do_normalize&&(t=this._zero_mean_unit_var_norm(t));let r=[1,t.length];return{input_values:new d.es("float32",t,r),attention_mask:new d.es("int64",new BigInt64Array(t.length).fill(1n),r)}}}class el extends z{constructor(e){super(e);let t=this.config.sampling_rate,r=k(256,this.config.num_mel_bins,20,Math.floor(t/2),t,null,"kaldi",!0);for(let e=0;e32768*e),this.window,400,160,{fft_length:512,power:2,center:!1,preemphasis:.97,mel_filters:this.mel_filters,log_mel:"log",mel_floor:1192092955078125e-22,remove_dc_offset:!0,max_num_frames:t,transpose:!0})}async _call(e,{padding:t=!0,pad_to_multiple_of:r=2,do_normalize_per_mel_bins:n=!0,return_attention_mask:o=!0}={}){let i;M(e,"SeamlessM4TFeatureExtractor");let a=this._extract_fbank_features(e,this.config.max_length);if(n){let[e,t]=a.dims;for(let r=0;r0){let r=new Float32Array(t*(e+n));r.set(a.data),r.fill(this.config.padding_value,a.data.length);let s=e+n;a={data:r,dims:[s,t]},o&&(i=new d.es("int64",new BigInt64Array(s),[1,s])).data.fill(1n,0,e)}}let[s,l]=a.dims,u=this.config.stride;if(0!=s%u)throw Error(`The number of frames (${s}) must be a multiple of the stride (${u}).`);let c=new d.es("float32",a.data,a.dims).view(1,Math.floor(s/u),l*u),f={input_features:c};if(o){let e=c.dims[1],t=new d.es("int64",new BigInt64Array(e),[1,e]);if(i)for(let e=1,r=0;e0){if("rand_trunc"===r){i=!0;let r=Math.floor(Math.random()*(a+1));e=e.subarray(r,r+t),(o=this._extract_fbank_features(e,this.mel_filters_slaney,this.config.nb_max_samples)).dims=[1,...o.dims]}else throw Error(`Truncation strategy "${r}" not implemented`)}else{if(a<0){let r=new Float64Array(t);if(r.set(e),"repeat"===n)for(let n=e.length;nv.read(e)))}async function eb(e,t){return Array.isArray(e)||(e=[e]),await Promise.all(e.map(e=>"string"==typeof e||e instanceof URL?w(e,t):e instanceof Float64Array?new Float32Array(e):e))}function e_(e,t){t&&(e=e.map(e=>0|e));let[r,n,o,i]=e;return{xmin:r,ymin:n,xmax:o,ymax:i}}class ex extends l.Ag{constructor({task:e,model:t,tokenizer:r=null,processor:n=null}){super(),this.task=e,this.model=t,this.tokenizer=r,this.processor=n}async dispose(){await this.model.dispose()}}class eE extends ex{constructor(e){super(e)}async _call(e,{topk:t=1}={}){let r=this.tokenizer(e,{padding:!0,truncation:!0}),n=await this.model(r),o="multi_label_classification"===this.model.config.problem_type?e=>e.sigmoid().data:e=>(0,c.XA)(e.data),i=this.model.config.id2label,a=[];for(let e of n.logits){let r=o(e),n=(0,c.em)(r,t).map(e=>({label:i[e[0]],score:e[1]}));1===t?a.push(...n):a.push(n)}return Array.isArray(e)||1===t?a:a[0]}}class eS extends ex{constructor(e){super(e)}async _call(e,{ignore_labels:t=["O"]}={}){let r=Array.isArray(e),n=this.tokenizer(r?e:[e],{padding:!0,truncation:!0}),o=(await this.model(n)).logits,i=this.model.config.id2label,a=[];for(let e=0;e[e,t]).filter(e=>e[1]>a),u=Array.from((0,c.XA)(o.end_logits[e].data)).map((e,t)=>[e,t]).filter(e=>e[1]>a),d=(0,l.O7)(s,u).filter(e=>e[0][1]<=e[1][1]).map(e=>[e[0][1],e[1][1],e[0][0]*e[1][0]]).sort((e,t)=>t[2]-e[2]);for(let e=0;e{let t=[...i];return t[a]=e[0],{score:e[1],token:e[0],token_str:this.tokenizer.model.vocab[e[0]],sequence:this.tokenizer.decode(t,{skip_special_tokens:!0})}}))}return Array.isArray(e)?o:o[0]}}class eC extends ex{_key="generated_text";constructor(e){super(e)}async _call(e,t={}){let r;Array.isArray(e)||(e=[e]),this.model.config.prefix&&(e=e.map(e=>this.model.config.prefix+e));let n=this.model.config.task_specific_params;n&&n[this.task]&&n[this.task].prefix&&(e=e.map(e=>n[this.task].prefix+e));let o=this.tokenizer,i={padding:!0,truncation:!0};r=this instanceof eT&&"_build_translation_inputs"in o?o._build_translation_inputs(e,i,t).input_ids:o(e,i).input_ids;let a=await this.model.generate(r,t);return o.batch_decode(a,{skip_special_tokens:!0}).map(e=>({[this._key]:e}))}}class eA extends eC{_key="summary_text";constructor(e){super(e)}}class eT extends eC{_key="translation_text";constructor(e){super(e)}}function eM(e){return Array.isArray(e)&&e.every(e=>"role"in e&&"content"in e)}class eI extends ex{constructor(e){super(e)}async _call(e,t={}){let r,n,o=!1,i=!1;if("string"==typeof e)r=e=[e];else if(Array.isArray(e)&&e.every(e=>"string"==typeof e))o=!0,r=e;else{if(eM(e))e=[e];else if(Array.isArray(e)&&e.every(eM))o=!0;else throw Error("Input must be a string, an array of strings, a Chat, or an array of Chats");i=!0,r=e.map(e=>this.tokenizer.apply_chat_template(e,{tokenize:!1,add_generation_prompt:!0}))}let a=t.add_special_tokens??!1,s=!i&&(t.return_full_text??!0);this.tokenizer.padding_side="left";let{input_ids:l,attention_mask:u}=this.tokenizer(r,{add_special_tokens:a,padding:!0,truncation:!0}),c=await this.model.generate(l,t,null,{inputs_attention_mask:u}),d=this.tokenizer.batch_decode(c,{skip_special_tokens:!0});!s&&l.dims.at(-1)>0&&(n=this.tokenizer.batch_decode(l,{skip_special_tokens:!0}).map(e=>e.length));let f=Array.from({length:e.length},e=>[]);for(let t=0;t[e.toLowerCase(),t])),this.entailment_id=this.label2id.entailment,void 0===this.entailment_id&&(console.warn("Could not find 'entailment' in label2id mapping. Using 2 as entailment_id."),this.entailment_id=2),this.contradiction_id=this.label2id.contradiction??this.label2id.not_entailment,void 0===this.contradiction_id&&(console.warn("Could not find 'contradiction' in label2id mapping. Using 0 as contradiction_id."),this.contradiction_id=0)}async _call(e,t,{hypothesis_template:r="This example is {}.",multi_label:n=!1}={}){let o=Array.isArray(e);o||(e=[e]),Array.isArray(t)||(t=[t]);let i=t.map(e=>r.replace("{}",e)),a=n||1===t.length,s=[];for(let r of e){let e=[];for(let t of i){let n=this.tokenizer(r,{text_pair:t,padding:!0,truncation:!0}),o=await this.model(n);a?e.push([o.logits.data[this.contradiction_id],o.logits.data[this.entailment_id]]):e.push(o.logits.data[this.entailment_id])}let n=(a?e.map(e=>(0,c.XA)(e)[1]):(0,c.XA)(e)).map((e,t)=>[e,t]).sort((e,t)=>t[0]-e[0]);s.push({sequence:r,labels:n.map(e=>t[e[1]]),scores:n.map(e=>e[0])})}return o?s:s[0]}}class ez extends ex{constructor(e){super(e)}async _call(e,{pooling:t="none",normalize:r=!1,quantize:n=!1,precision:o="binary"}={}){let i=this.tokenizer(e,{padding:!0,truncation:!0}),a=await this.model(i),s=a.last_hidden_state??a.logits;if("none"===t);else if("mean"===t)s=(0,d.v6)(s,i.attention_mask);else if("cls"===t)s=s.slice(null,0);else throw Error(`Pooling method '${t}' not supported.`);return r&&(s=s.normalize(2,-1)),n&&(s=(0,d.e)(s,o)),s}}class eL extends ex{constructor(e){super(e)}async _call(e,{pool:t=null}={}){let r;let n=await ew(e),{pixel_values:o}=await this.processor(n),i=await this.model({pixel_values:o});if(t){if(!("pooler_output"in i))throw Error("No pooled output was returned. Make sure the model has a 'pooler' layer when using the 'pool' option.");r=i.pooler_output}else r=i.last_hidden_state??i.logits??i.image_embeds;return r}}class eP extends ex{constructor(e){super(e)}async _call(e,{topk:t=null}={}){let r=!Array.isArray(e),n=this.processor.feature_extractor.config.sampling_rate,o=await eb(e,n),i=this.model.config.id2label,a=[];for(let e of o){let r=await this.processor(e),n=(await this.model(r)).logits[0],o=(0,c.em)((0,c.XA)(n.data),t).map(e=>({label:i[e[0]],score:e[1]}));1===t?a.push(...o):a.push(o)}return r&&1!==t?a[0]:a}}class eN extends ex{constructor(e){super(e)}async _call(e,t,{hypothesis_template:r="This is a sound of {}."}={}){let n=!Array.isArray(e);n&&(e=[e]);let o=t.map(e=>r.replace("{}",e)),i=this.tokenizer(o,{padding:!0,truncation:!0}),a=this.processor.feature_extractor.config.sampling_rate,s=await eb(e,a),l=[];for(let e of s){let r=await this.processor(e),n=await this.model({...i,...r}),o=(0,c.XA)(n.logits_per_audio.data);l.push([...o].map((e,r)=>({score:e,label:t[r]})))}return n?l[0]:l}}class eB extends ex{constructor(e){super(e)}async _call(e,t={}){switch(this.model.config.model_type){case"whisper":return this._call_whisper(e,t);case"wav2vec2":case"wav2vec2-bert":case"unispeech":case"unispeech-sat":case"hubert":return this._call_wav2vec2(e,t);default:throw Error(`AutomaticSpeechRecognitionPipeline does not support model type '${this.model.config.model_type}'.`)}}async _call_wav2vec2(e,t={}){t.language&&console.warn('`language` parameter is not yet supported for `wav2vec2` models, defaulting to "English".'),t.task&&console.warn('`task` parameter is not yet supported for `wav2vec2` models, defaulting to "transcribe".');let r=!Array.isArray(e);r&&(e=[e]);let n=this.processor.feature_extractor.config.sampling_rate,o=await eb(e,n),i=[];for(let e of o){let t=await this.processor(e),r=(await this.model(t)).logits[0],n=[];for(let e of r)n.push((0,c.Fp)(e.data)[1]);let o=this.tokenizer.decode(n);i.push({text:o})}return r?i[0]:i}async _call_whisper(e,t={}){let r=t.return_timestamps??!1,n=t.chunk_length_s??0,o=t.chunk_callback??null,i=t.force_full_sequences??!1,a=t.stride_length_s??null;"word"===r&&(t.return_token_timestamps=!0);let s=(0,l.Sw)(t,"language",null),u=(0,l.Sw)(t,"task",null);if(s||u||r){if(t.forced_decoder_ids)throw Error("Cannot specify `language`/`task`/`return_timestamps` and `forced_decoder_ids` at the same time.");let e=this.tokenizer.get_decoder_prompt_ids({language:s,task:u,no_timestamps:!r});e.length>0&&(t.forced_decoder_ids=e)}let d=!Array.isArray(e);d&&(e=[e]);let f=this.processor.feature_extractor.config.chunk_length/this.model.config.max_source_positions,h=this.processor.feature_extractor.config.hop_length,p=this.processor.feature_extractor.config.sampling_rate,m=await eb(e,p),g=[];for(let e of m){let s=[];if(n>0){if(null===a)a=n/6;else if(n<=a)throw Error("`chunk_length_s` must be larger than `stride_length_s`.");let t=p*n,r=p*a,o=t-2*r,i=0;for(;i=e.length;s.push({stride:[n.length,l?0:r,u?0:r],input_features:a.input_features,is_last:u}),i+=o}}else s=[{stride:[e.length,0,0],input_features:(await this.processor(e)).input_features,is_last:!0}];for(let e of s){t.num_frames=Math.floor(e.stride[0]/h);let n=await this.model.generate(e.input_features,t);"word"===r?(e.tokens=n.sequences[0],e.token_timestamps=n.token_timestamps.tolist()[0].map(e=>(0,c.NM)(e,2))):e.tokens=n[0],e.stride=e.stride.map(e=>e/p),null!==o&&o(e)}let[l,u]=this.tokenizer._decode_asr(s,{time_precision:f,return_timestamps:r,force_full_sequences:i});g.push({text:l,...u})}return d?g[0]:g}}class ej extends ex{constructor(e){super(e)}async _call(e,t={}){let r=Array.isArray(e),n=await ew(e),{pixel_values:o}=await this.processor(n),i=[];for(let e of o){e.dims=[1,...e.dims];let r=await this.model.generate(e,t),n=this.tokenizer.batch_decode(r,{skip_special_tokens:!0}).map(e=>({generated_text:e.trim()}));i.push(n)}return r?i:i[0]}}class eF extends ex{constructor(e){super(e)}async _call(e,{topk:t=1}={}){let r=Array.isArray(e),n=await ew(e),{pixel_values:o}=await this.processor(n),i=await this.model({pixel_values:o}),a=this.model.config.id2label,s=[];for(let e of i.logits){let r=(0,c.em)((0,c.XA)(e.data),t).map(e=>({label:a[e[0]],score:e[1]}));1===t?s.push(...r):s.push(r)}return r||1===t?s:s[0]}}class eU extends ex{constructor(e){super(e),this.subtasks_mapping={panoptic:"post_process_panoptic_segmentation",instance:"post_process_instance_segmentation",semantic:"post_process_semantic_segmentation"}}async _call(e,{threshold:t=.5,mask_threshold:r=.5,overlap_mask_area_threshold:n=.8,label_ids_to_fuse:o=null,target_sizes:i=null,subtask:a=null}={}){if(Array.isArray(e)&&1!==e.length)throw Error("Image segmentation pipeline currently only supports a batch size of 1.");let s=await ew(e),l=s.map(e=>[e.height,e.width]),{pixel_values:u,pixel_mask:c}=await this.processor(s),d=await this.model({pixel_values:u,pixel_mask:c}),f=null;if(null!==a)f=this.subtasks_mapping[a];else for(let[e,t]of Object.entries(this.subtasks_mapping))if(t in this.processor.feature_extractor){f=this.processor.feature_extractor[t].bind(this.processor.feature_extractor),a=e;break}let h=this.model.config.id2label,p=[];if("panoptic"===a||"instance"===a){let e=f(d,t,r,n,o,i??l)[0],a=e.segmentation;for(let t of e.segments_info){let e=new Uint8ClampedArray(a.data.length);for(let r=0;rr.replace("{}",e)),a=this.tokenizer(i,{padding:"siglip"!==this.model.config.model_type||"max_length",truncation:!0}),{pixel_values:s}=await this.processor(o),l=await this.model({...a,pixel_values:s}),u="siglip"===this.model.config.model_type?e=>e.sigmoid().data:e=>(0,c.XA)(e.data),d=[];for(let e of l.logits_per_image){let r=[...u(e)].map((e,r)=>({score:e,label:t[r]}));r.sort((e,t)=>t.score-e.score),d.push(r)}return n?d:d[0]}}class eD extends ex{constructor(e){super(e)}async _call(e,{threshold:t=.9,percentage:r=!1}={}){let n=Array.isArray(e);if(n&&1!==e.length)throw Error("Object detection pipeline currently only supports a batch size of 1.");let o=await ew(e),i=r?null:o.map(e=>[e.height,e.width]),{pixel_values:a,pixel_mask:s}=await this.processor(o),l=await this.model({pixel_values:a,pixel_mask:s}),u=this.processor.feature_extractor.post_process_object_detection(l,t,i),c=this.model.config.id2label,d=u.map(e=>e.boxes.map((t,n)=>({score:e.scores[n],label:c[e.classes[n]],box:e_(t,!r)})));return n?d:d[0]}}class eH extends ex{constructor(e){super(e)}async _call(e,t,{threshold:r=.1,topk:n=null,percentage:o=!1}={}){let i=Array.isArray(e),a=await ew(e),s=this.tokenizer(t,{padding:!0,truncation:!0}),l=await this.processor(a),u=[];for(let e=0;e({score:h.scores[r],label:t[h.classes[r]],box:e_(e,!o)})).sort((e,t)=>t.score-e.score);null!==n&&(p=p.slice(0,n)),u.push(p)}return i?u:u[0]}}class eV extends ex{constructor(e){super(e)}async _call(e,t,r={}){let n=(await ew(e))[0],{pixel_values:o}=await this.processor(n),i=`${t}`,a=this.tokenizer(i,{add_special_tokens:!1,padding:!0,truncation:!0}).input_ids,s=await this.model.generate(o,{...r,decoder_input_ids:a,max_length:this.model.config.decoder.max_position_embeddings}),l=this.tokenizer.batch_decode(s)[0].match(/(.*?)<\/s_answer>/),u=null;return l&&l.length>=2&&(u=l[1].trim()),[{answer:u}]}}class eW extends ex{DEFAULT_VOCODER_ID="Xenova/speecht5_hifigan";constructor(e){super(e),this.vocoder=e.vocoder??null}async _call(e,{speaker_embeddings:t=null}={}){return this.processor?this._call_text_to_spectrogram(e,{speaker_embeddings:t}):this._call_text_to_waveform(e)}async _call_text_to_waveform(e){let t=this.tokenizer(e,{padding:!0,truncation:!0}),{waveform:r}=await this.model(t),n=this.model.config.sampling_rate;return{audio:r.data,sampling_rate:n}}async _call_text_to_spectrogram(e,{speaker_embeddings:t}){if(this.vocoder||(console.log("No vocoder specified, using default HifiGan vocoder."),this.vocoder=await s.$Sz.from_pretrained(this.DEFAULT_VOCODER_ID,{quantized:!1})),("string"==typeof t||t instanceof URL)&&(t=new Float32Array(await (await fetch(t)).arrayBuffer())),t instanceof Float32Array)t=new d.es("float32",t,[1,t.length]);else if(!(t instanceof d.es))throw Error("Speaker embeddings must be a `Tensor`, `Float32Array`, `string`, or `URL`.");let{input_ids:r}=this.tokenizer(e,{padding:!0,truncation:!0}),{waveform:n}=await this.model.generate_speech(r,t,{vocoder:this.vocoder}),o=this.processor.feature_extractor.config.sampling_rate;return{audio:n.data,sampling_rate:o}}}class eq extends ex{constructor(e){super(e)}async _call(e){let t=await ew(e),r=await this.processor(t),n=await this.model(r),o=[];for(let e of n.reconstruction){let t=e.squeeze().clamp_(0,1).mul_(255).round_().to("uint8");o.push(v.fromTensor(t))}return o.length>1?o:o[0]}}class eX extends ex{constructor(e){super(e)}async _call(e){let t=await ew(e),r=await this.processor(t),{predicted_depth:n}=await this.model(r),o=[];for(let e=0;e1?o:o[0]}}let eZ=Object.freeze({"text-classification":{tokenizer:a.t2,pipeline:eE,model:s.o$X,default:{model:"Xenova/distilbert-base-uncased-finetuned-sst-2-english"},type:"text"},"token-classification":{tokenizer:a.t2,pipeline:eS,model:s.OjJ,default:{model:"Xenova/bert-base-multilingual-cased-ner-hrl"},type:"text"},"question-answering":{tokenizer:a.t2,pipeline:ek,model:s.wiU,default:{model:"Xenova/distilbert-base-cased-distilled-squad"},type:"text"},"fill-mask":{tokenizer:a.t2,pipeline:eR,model:s.t78,default:{model:"Xenova/bert-base-uncased"},type:"text"},summarization:{tokenizer:a.t2,pipeline:eA,model:s.Kf0,default:{model:"Xenova/distilbart-cnn-6-6"},type:"text"},translation:{tokenizer:a.t2,pipeline:eT,model:s.Kf0,default:{model:"Xenova/t5-small"},type:"text"},"text2text-generation":{tokenizer:a.t2,pipeline:eC,model:s.Kf0,default:{model:"Xenova/flan-t5-small"},type:"text"},"text-generation":{tokenizer:a.t2,pipeline:eI,model:s.Hqk,default:{model:"Xenova/gpt2"},type:"text"},"zero-shot-classification":{tokenizer:a.t2,pipeline:eO,model:s.o$X,default:{model:"Xenova/distilbert-base-uncased-mnli"},type:"text"},"audio-classification":{pipeline:eP,model:s.K2m,processor:ev,default:{model:"Xenova/wav2vec2-base-superb-ks"},type:"audio"},"zero-shot-audio-classification":{tokenizer:a.t2,pipeline:eN,model:s.$Sz,processor:ev,default:{model:"Xenova/clap-htsat-unfused"},type:"multimodal"},"automatic-speech-recognition":{tokenizer:a.t2,pipeline:eB,model:[s.hZO,s.ENH],processor:ev,default:{model:"Xenova/whisper-tiny.en"},type:"multimodal"},"text-to-audio":{tokenizer:a.t2,pipeline:eW,model:[s.z6E,s.lbf],processor:[ev,null],default:{model:"Xenova/speecht5_tts"},type:"text"},"image-to-text":{tokenizer:a.t2,pipeline:ej,model:s.tLj,processor:ev,default:{model:"Xenova/vit-gpt2-image-captioning"},type:"multimodal"},"image-classification":{pipeline:eF,model:s.En$,processor:ev,default:{model:"Xenova/vit-base-patch16-224"},type:"multimodal"},"image-segmentation":{pipeline:eU,model:[s.U$$,s.$Bv],processor:ev,default:{model:"Xenova/detr-resnet-50-panoptic"},type:"multimodal"},"zero-shot-image-classification":{tokenizer:a.t2,pipeline:e$,model:s.$Sz,processor:ev,default:{model:"Xenova/clip-vit-base-patch32"},type:"multimodal"},"object-detection":{pipeline:eD,model:s.Zn,processor:ev,default:{model:"Xenova/detr-resnet-50"},type:"multimodal"},"zero-shot-object-detection":{tokenizer:a.t2,pipeline:eH,model:s.LdW,processor:ev,default:{model:"Xenova/owlvit-base-patch32"},type:"multimodal"},"document-question-answering":{tokenizer:a.t2,pipeline:eV,model:s.DcG,processor:ev,default:{model:"Xenova/donut-base-finetuned-docvqa"},type:"multimodal"},"image-to-image":{pipeline:eq,model:s.S2d,processor:ev,default:{model:"Xenova/swin2SR-classical-sr-x2-64"},type:"image"},"depth-estimation":{pipeline:eX,model:s.hY6,processor:ev,default:{model:"Xenova/dpt-large"},type:"image"},"feature-extraction":{tokenizer:a.t2,pipeline:ez,model:s.$Sz,default:{model:"Xenova/all-MiniLM-L6-v2"},type:"text"},"image-feature-extraction":{processor:ev,pipeline:eL,model:[s.IFL,s.$Sz],default:{model:"Xenova/vit-base-patch16-224-in21k"},type:"image"}}),eK=Object.freeze({"sentiment-analysis":"text-classification",ner:"token-classification",asr:"automatic-speech-recognition","text-to-speech":"text-to-audio",embeddings:"feature-extraction"});async function eG(e,t=null,{quantized:r=!0,progress_callback:n=null,config:o=null,cache_dir:i=null,local_files_only:a=!1,revision:s="main"}={}){let u=eZ[(e=eK[e]??e).split("_",1)[0]];if(!u)throw Error(`Unsupported pipeline: ${e}. Must be one of [${Object.keys(eZ)}]`);t||(t=u.default.model,console.log(`No model specified. Using default model: "${t}".`));let c=new Map([["tokenizer",u.tokenizer],["model",u.model],["processor",u.processor]]),d=await eY(c,t,{quantized:r,progress_callback:n,config:o,cache_dir:i,local_files_only:a,revision:s});return d.task=e,(0,l.T2)(n,{status:"ready",task:e,model:t}),new u.pipeline(d)}async function eY(e,t,r){let n=Object.create(null),o=[];for(let[i,a]of e.entries()){let e;a&&(e=Array.isArray(a)?new Promise(async(e,n)=>{let o;for(let n of a){if(null===n){e(null);return}try{e(await n.from_pretrained(t,r));return}catch(e){o=e}}n(o)}):a.from_pretrained(t,r),n[i]=e,o.push(e))}for(let[e,t]of(await Promise.all(o),Object.entries(n)))n[e]=await t;return n}r(16)},761:function(e,t,r){"use strict";function n(e,t){e&&e(t)}function o(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[t,e]))}function i(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}r.d(t,{$2:function(){return o},Ag:function(){return a},Gg:function(){return u},O7:function(){return h},Sw:function(){return d},T2:function(){return n},Wy:function(){return l},eG:function(){return f},fU:function(){return s},hr:function(){return i},hs:function(){return p},jg:function(){return c}});let a=class{constructor(){let e=function(...t){return e._call(...t)};return Object.setPrototypeOf(e,new.target.prototype)}_call(...e){throw Error("Must implement _call method in subclass")}};function s(e){return e?.prototype?.__proto__?.constructor?.name==="TypedArray"}function l(e){return Number.isInteger(e)||"bigint"==typeof e}function u(e){return null!=e}function c(e){let t=[],r=e;for(;Array.isArray(r);)t.push(r.length),r=r[0];return t}function d(e,t,r){let n=e[t];if(void 0!==n)return delete e[t],n;if(void 0===r)throw Error(`Key ${t} does not exist in object.`);return r}function f(...e){return Array.prototype.concat.apply([],e)}function h(...e){return e.reduce((e,t)=>e.flatMap(e=>t.map(t=>[e,t])))}function p(e,t){return Math.abs((e+t)%(2*t)-t)}},1510:function(e,t,r){"use strict";r.d(t,{GA:function(){return o},Z3:function(){return n},pQ:function(){return a}});class n{constructor(e=(e,t)=>e>t){this._heap=[],this._comparator=e}get size(){return this._heap.length}isEmpty(){return 0===this.size}peek(){return this._heap[0]}push(...e){return this.extend(e)}extend(e){for(let t of e)this._heap.push(t),this._siftUp();return this.size}pop(){let e=this.peek(),t=this.size-1;return t>0&&this._swap(0,t),this._heap.pop(),this._siftDown(),e}replace(e){let t=this.peek();return this._heap[0]=e,this._siftDown(),t}_parent(e){return(e+1>>>1)-1}_left(e){return(e<<1)+1}_right(e){return e+1<<1}_greater(e,t){return this._comparator(this._heap[e],this._heap[t])}_swap(e,t){let r=this._heap[e];this._heap[e]=this._heap[t],this._heap[t]=r}_siftUp(){let e=this.size-1;for(;e>0&&this._greater(e,this._parent(e));)this._swap(e,this._parent(e)),e=this._parent(e)}_siftDown(){let e=0;for(;this._left(e)[]),this.endNodes=Array.from({length:this.len+1},()=>[]);let n=new s(this.bosTokenId,0,0,0,0),o=new s(this.eosTokenId,1,this.len,0,0);this.nodes.push(n.clone()),this.nodes.push(o.clone()),this.beginNodes[this.len].push(o),this.endNodes[0].push(n)}insert(e,t,r,n){let o=new s(n,this.nodes.length,e,t,r);this.beginNodes[e].push(o),this.endNodes[e+t].push(o),this.nodes.push(o)}viterbi(){let e=this.len,t=0;for(;t<=e;){if(0==this.beginNodes[t].length)return[];for(let e of this.beginNodes[t]){e.prev=null;let r=0,n=null;for(let o of this.endNodes[t]){let t=o.backtraceScore+e.score;(null===n||t>r)&&(n=o.clone(),r=t)}if(null===n)return[];e.prev=n,e.backtraceScore=r}++t}let r=[],n=this.beginNodes[e][0].prev;if(null===n)return[];let o=n.clone();for(;null!==o.prev;)r.push(o.clone()),o=o.clone().prev.clone();return r.reverse(),r}piece(e){return this.sentence.slice(e.pos,e.pos+e.length)}tokens(){return this.viterbi().map(e=>this.piece(e))}tokenIds(){return this.viterbi().map(e=>e.tokenId)}}class s{constructor(e,t,r,n,o){this.tokenId=e,this.nodeId=t,this.pos=r,this.length=n,this.score=o,this.prev=null,this.backtraceScore=0}clone(){let e=new s(this.tokenId,this.nodeId,this.pos,this.length,this.score);return e.prev=this.prev,e.backtraceScore=this.backtraceScore,e}}},5774:function(e,t,r){"use strict";r.d(t,{AE:function(){return g},C9:function(){return l},CJ:function(){return m},E:function(){return s},GU:function(){return c},Jj:function(){return h},Jm:function(){return i},Pg:function(){return d},Z4:function(){return v},aP:function(){return y},dZ:function(){return u},ez:function(){return p},jF:function(){return f}}),r(2414);var n=r(761),o=r(8709);class i extends n.Ag{constructor(){super(),this.processors=[]}push(e){this.processors.push(e)}extend(e){this.processors.push(...e)}_call(e,t){for(let r of t)this.processors.forEach(t=>t(e,r))}[Symbol.iterator](){return this.processors.values()}}class a extends n.Ag{_call(e,t){throw Error("`_call` should be implemented in a subclass")}}class s extends a{constructor(e){super(),this.force_token_map=Object.fromEntries(e??[])}_call(e,t){let r=this.force_token_map[e.length];return(0,n.Gg)(r)&&(t.data.fill(-1/0),t.data[r]=0),t}}class l extends a{constructor(e){super(),this.bos_token_id=e}_call(e,t){return 1===e.length&&(t.data.fill(-1/0),t.data[this.bos_token_id]=0),t}}class u extends a{constructor(e,t){super(),this.max_length=e,this.forced_eos_token_id=t}_call(e,t){}}class c extends a{constructor(e,t){super(),this.begin_suppress_tokens=e,this.begin_index=t}_call(e,t){if(e.length===this.begin_index)for(let e of this.begin_suppress_tokens)t.data[e]=-1/0;return t}}class d extends a{constructor(e){super(),this.eos_token_id=e.eos_token_id,this.no_timestamps_token_id=e.no_timestamps_token_id,this.timestamp_begin=this.no_timestamps_token_id+1,this.begin_index=(e.forced_decoder_ids||[]).length+2,e.forced_decoder_ids.slice(-1)[0][1]===this.no_timestamps_token_id&&(this.begin_index-=1),this.max_initial_timestamp_index=e.max_initial_timestamp_index}_call(e,t){let r=t.data;if(r[this.no_timestamps_token_id]=-1/0,e.length===this.begin_index-1)return r.fill(-1/0),r[this.timestamp_begin]=0,t;let n=e.slice(this.begin_index),i=n.length>=1&&n[n.length-1]>=this.timestamp_begin,a=n.length<2||n[n.length-2]>=this.timestamp_begin;if(i&&(a?r.subarray(this.timestamp_begin).fill(-1/0):r.subarray(0,this.eos_token_id).fill(-1/0)),e.length===this.begin_index&&null!==this.max_initial_timestamp_index){let e=this.timestamp_begin+this.max_initial_timestamp_index;r.subarray(e+1).fill(-1/0)}let s=(0,o.CI)(r);return Math.log(s.subarray(this.timestamp_begin).map(Math.exp).reduce((e,t)=>e+t))>(0,o.Fp)(s.subarray(0,this.timestamp_begin))[0]&&r.subarray(0,this.timestamp_begin).fill(-1/0),t}}class f extends a{constructor(e){super(),this.no_repeat_ngram_size=e}getNgrams(e){let t=e.length,r=[];for(let n=0;n0&&(n=n.map(e=>e/this.generation_config.temperature)),n}randomSelect(e){let t=Math.random()*e.reduce((e,t)=>e+t,0);for(let r=0;r1)return new _(e);if(e.num_return_sequences>1)throw Error(`num_return_sequences has to be 1 when doing greedy search, but is ${e.num_return_sequences}.`);return new w(e)}}class w extends v{sample(e,t=-1){let r=this.getLogits(e,t);return[[(0,o.Fp)(r)[1],0]]}}class b extends v{sample(e,t=-1){let r=e.dims.at(-1);this.generation_config.top_k>0&&(r=Math.min(this.generation_config.top_k,r));let n=this.getLogits(e,t),i=(0,o.em)(n,r),a=(0,o.XA)(i.map(e=>e[1]));return Array.from({length:this.generation_config.num_beams},()=>{let e=this.randomSelect(a);return[i[e][0],Math.log(a[e])]})}}class _ extends v{sample(e,t=-1){let r=e.dims.at(-1);this.generation_config.top_k>0&&(r=Math.min(this.generation_config.top_k,r));let n=this.getLogits(e,t),i=(0,o.em)(n,r),a=(0,o.XA)(i.map(e=>e[1]));return Array.from({length:this.generation_config.num_beams},(e,t)=>[i[t][0],Math.log(a[t])])}}},911:function(e,t,r){"use strict";r.d(t,{hn:function(){return f},st:function(){return g},yM:function(){return y}});var n=r(7147),o=r(1418),i=r(319),a=r(851),s=r(761),l=r(357),u=r(9109).lW;globalThis.ReadableStream||(globalThis.ReadableStream=i.ReadableStream);class c{_CONTENT_TYPE_MAP={txt:"text/plain",html:"text/html",css:"text/css",js:"text/javascript",json:"application/json",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif"};constructor(e){if(this.filePath=e,this.headers=new Headers,this.exists=n.existsSync(e),this.exists){this.status=200,this.statusText="OK";let t=n.statSync(e);this.headers.set("content-length",t.size.toString()),this.updateContentType();let r=this;this.body=new ReadableStream({start(e){r.arrayBuffer().then(t=>{e.enqueue(new Uint8Array(t)),e.close()})}})}else this.status=404,this.statusText="Not Found",this.body=null}updateContentType(){let e=this.filePath.toString().split(".").pop().toLowerCase();this.headers.set("content-type",this._CONTENT_TYPE_MAP[e]??"application/octet-stream")}clone(){let e=new c(this.filePath);return e.exists=this.exists,e.status=this.status,e.statusText=this.statusText,e.headers=new Headers(this.headers),e}async arrayBuffer(){return(await n.promises.readFile(this.filePath)).buffer}async blob(){return new Blob([await n.promises.readFile(this.filePath)],{type:this.headers.get("content-type")})}async text(){return await n.promises.readFile(this.filePath,"utf8")}async json(){return JSON.parse(await this.text())}}function d(e,t=null){let r;try{r=new URL(e)}catch(e){return!1}return(!t||!!t.includes(r.hostname))&&("http:"===r.protocol||"https:"===r.protocol)}async function f(e){if(a.O.useFS&&!d(e))return new c(e);if(void 0===l||l?.release?.name!=="node")return fetch(e);{let t=!!l.env?.TESTING_REMOTELY,r=a.O.version,n=new Headers;if(n.set("User-Agent",`transformers.js/${r}; is_ci/${t};`),d(e,["huggingface.co","hf.co"])){let e=l.env?.HF_TOKEN??l.env?.HF_ACCESS_TOKEN;e&&n.set("Authorization",`Bearer ${e}`)}return fetch(e,{headers:n})}}let h={400:"Bad request error occurred while trying to load file",401:"Unauthorized access to file",403:"Forbidden access to file",404:"Could not locate file",408:"Request timeout error occurred while trying to load file",500:"Internal server error error occurred while trying to load file",502:"Bad gateway error occurred while trying to load file",503:"Service unavailable error occurred while trying to load file",504:"Gateway timeout error occurred while trying to load file"};class p{constructor(e){this.path=e}async match(e){let t=new c(o.join(this.path,e));return t.exists?t:void 0}async put(e,t){let r=u.from(await t.arrayBuffer()),i=o.join(this.path,e);try{await n.promises.mkdir(o.dirname(i),{recursive:!0}),await n.promises.writeFile(i,r)}catch(e){console.warn("An error occurred while writing the file to cache:",e)}}}async function m(e,...t){for(let r of t)try{let t=await e.match(r);if(t)return t}catch(e){continue}}async function g(e,t,r=!0,n={}){let o,i,l,u;if(!a.O.allowLocalModels){if(n.local_files_only)throw Error("Invalid configuration detected: local models are disabled (`env.allowLocalModels=false`) but you have requested to only use local models (`local_files_only=true`).");if(!a.O.allowRemoteModels)throw Error("Invalid configuration detected: both local and remote models are disabled. Fix by setting `env.allowLocalModels` or `env.allowRemoteModels` to `true`.")}if((0,s.T2)(n.progress_callback,{status:"initiate",name:e,file:t}),!o&&a.O.useBrowserCache){if("undefined"==typeof caches)throw Error("Browser cache is not available in this environment.");try{o=await caches.open("transformers-cache")}catch(e){console.warn("An error occurred while opening the browser cache:",e)}}if(!o&&a.O.useFSCache&&(o=new p(n.cache_dir??a.O.cacheDir)),!o&&a.O.useCustomCache){if(!a.O.customCache)throw Error("`env.useCustomCache=true`, but `env.customCache` is not defined.");if(!a.O.customCache.match||!a.O.customCache.put)throw Error("`env.customCache` must be an object which implements the `match` and `put` functions of the Web Cache API. For more information, see https://developer.mozilla.org/en-US/docs/Web/API/Cache");o=a.O.customCache}let c=n.revision??"main",g=w(e,t),y=w(a.O.localModelPath,g),b=w(a.O.remoteHost,a.O.remotePathTemplate.replaceAll("{model}",e).replaceAll("{revision}",encodeURIComponent(c)),t),_="main"===c?g:w(e,c,t),x=o instanceof p?_:b,E=!1;o&&(l=await m(o,y,x));let S=void 0!==l;if(void 0===l){if(a.O.allowLocalModels){if(d(g)){if(n.local_files_only)throw Error(`\`local_files_only=true\`, but attempted to load a remote file from: ${g}.`);if(!a.O.allowRemoteModels)throw Error(`\`env.allowRemoteModels=false\`, but attempted to load a remote file from: ${g}.`)}else try{l=await f(y),i=y}catch(e){console.warn(`Unable to load from local path "${y}": "${e}"`)}}if(void 0===l||404===l.status){if(n.local_files_only||!a.O.allowRemoteModels){if(!r)return null;throw Error(`\`local_files_only=true\` or \`env.allowRemoteModels=false\` and file was not found locally at "${y}".`)}if(200!==(l=await f(b)).status)return function(e,t,r){if(!r)return null;let n=h[e]??`Error (${e}) occurred while trying to load file`;throw Error(`${n}: "${t}".`)}(l.status,b,r);i=x}E=o&&"undefined"!=typeof Response&&l instanceof Response&&200===l.status}(0,s.T2)(n.progress_callback,{status:"download",name:e,file:t});let k={status:"progress",name:e,file:t};return n.progress_callback?S&&"undefined"!=typeof navigator&&/firefox/i.test(navigator.userAgent)?(u=new Uint8Array(await l.arrayBuffer()),(0,s.T2)(n.progress_callback,{...k,progress:100,loaded:u.length,total:u.length})):u=await v(l,e=>{(0,s.T2)(n.progress_callback,{...k,...e})}):u=new Uint8Array(await l.arrayBuffer()),E&&i&&await o.match(i)===void 0&&await o.put(i,new Response(u,{headers:l.headers})).catch(e=>{console.warn(`Unable to add response to browser cache: ${e}.`)}),(0,s.T2)(n.progress_callback,{status:"done",name:e,file:t}),u}async function y(e,t,r=!0,n={}){let o=await g(e,t,r,n);return null===o?{}:JSON.parse(new TextDecoder("utf-8").decode(o))}async function v(e,t){let r=e.headers.get("Content-Length");null===r&&console.warn("Unable to determine content-length from response headers. Will expand buffer when needed.");let n=parseInt(r??"0"),o=new Uint8Array(n),i=0,a=e.body.getReader();async function s(){let{done:e,value:r}=await a.read();if(e)return;let l=i+r.length;if(l>n){let e=new Uint8Array(n=l);e.set(o),o=e}return o.set(r,i),t({progress:(i=l)/n*100,loaded:i,total:n}),s()}return await s(),o}function w(...e){return(e=e.map((t,r)=>(r&&(t=t.replace(RegExp("^/"),"")),r!==e.length-1&&(t=t.replace(RegExp("/$"),"")),t))).join("/")}},8709:function(e,t,r){"use strict";function n(e,[t,r,n],[o,i],a="bilinear",s=!1){let l=i/n,u=o/r,c=new e.constructor(o*i*t),d=r*n,f=o*i;for(let a=0;a=0;--e)o[e]=i,n[e]=t[r[e]],i*=n[e];let i=r.map((e,t)=>o[r.indexOf(t)]),a=new e.constructor(e.length);for(let r=0;r=0;--e)n+=o%t[e]*i[e],o=Math.floor(o/t[e]);a[n]=e[r]}return[a,n]}function i(e){let t=u(e)[0],r=e.map(e=>Math.exp(e-t)),n=r.reduce((e,t)=>e+t,0);return r.map(e=>e/n)}function a(e){return i(e).map(e=>Math.log(e))}function s(e,t=0){return e=Array.from(e).map((e,t)=>[t,e]).sort((e,t)=>t[1]-e[1]),null!==t&&t>0&&(e=e.slice(0,t)),e}function l(e){if(0===e.length)throw Error("Array must not be empty");let t=e[0],r=0;for(let n=1;nt&&(t=e[n],r=n);return[Number(t),r]}function c(e){return e>0&&(e&e-1)==0}r.d(t,{CI:function(){return a},Fp:function(){return u},NM:function(){return m},Nq:function(){return n},VV:function(){return l},XA:function(){return i},eT:function(){return g},em:function(){return s},nu:function(){return o},qC:function(){return p},vw:function(){return h}});class d{constructor(e){if(this.size=0|e,this.size<=1||!c(this.size))throw Error("FFT size must be a power of two larger than 1");this._csize=e<<1,this.table=new Float64Array(2*this.size);for(let e=0;ee;e<<=1)++t;this._width=t%2==0?t-1:t,this._bitrev=new Int32Array(1<>>t&3)<>>1);for(let t=0;t>>1]=e[t];return r}toComplexArray(e,t){let r=t||this.createComplexArray();for(let t=0;t>>1],r[t+1]=0;return r}completeSpectrum(e){let t=this._csize,r=t>>>1;for(let n=2;n>=2;a>=2;a>>=2){let t=(s=i/a<<1)>>>2;for(n=0;n>>1,a>>>1)}else for(n=0,o=0;n>>1,a>>>1,r)}for(a>>=2;a>=2;a>>=2){let t=(s=i/a<<1)>>>2;for(n=0;n>1;++t){let r=(t+1-e)**2/2,n=Math.sqrt(s**2+l**2)**r,a=r*Math.atan2(l,s),u=2*t;o[u]=n*Math.cos(a),o[u+1]=n*Math.sin(a),i[u]=o[u],i[u+1]=-o[u+1]}this._slicedChirpBuffer=o.subarray(t,r),this._f=new d(n>>1),this._f.transform(this._chirpBuffer,i)}_transform(e,t,r){let n=this._buffer1,o=this._buffer2,i=this._outBuffer1,a=this._outBuffer2,s=this._chirpBuffer,l=this._slicedChirpBuffer,u=this._a;if(r)for(let e=0;e>1];n[e]=o*l[e],n[r]=o*l[r]}else for(let e=0;e=e.length&&(o=2*(e.length-1)-o),n[i++]=e[o]}n.sort(),r[t]=n[o]}return r}function m(e,t){let r=Math.pow(10,t);return Math.round(e*r)/r}function g(e){let t=Math.round(e);return Math.abs(e)%1==.5?t%2==0?t:t-1:t}},2414:function(e,t,r){"use strict";r.d(t,{J6:function(){return g},Ks:function(){return y},d3:function(){return h},e:function(){return w},es:function(){return s},f3:function(){return m},kn:function(){return p},r6:function(){return v},sX:function(){return l},v6:function(){return u}});var n=r(967),o=r(8709);let i=Object.freeze({float32:Float32Array,float64:Float64Array,string:Array,int8:Int8Array,uint8:Uint8Array,int16:Int16Array,uint16:Uint16Array,int32:Int32Array,uint32:Uint32Array,int64:BigInt64Array,uint64:BigUint64Array,bool:Uint8Array}),a=n.ONNX.Tensor;class s{dims;type;data;size;constructor(...e){return e[0]instanceof a?Object.assign(this,e[0]):Object.assign(this,new a(e[0],e[1],e[2])),new Proxy(this,{get:(e,t)=>{if("string"==typeof t){let r=Number(t);if(Number.isInteger(r))return e._getitem(r)}return e[t]},set:(e,t,r)=>e[t]=r})}*[Symbol.iterator](){let[e,...t]=this.dims;if(t.length>0){let r=t.reduce((e,t)=>e*t);for(let n=0;n0))return new s(this.type,[this.data[e]],r);{let t=r.reduce((e,t)=>e*t);return this._subarray(e,t,r)}}indexOf(e){for(let t=0;te*t))throw Error(`cannot reshape array of size ${r} into shape (${t})`);let n=e;for(let e=t.length-1;e>=0;e--)n=n.reduce((r,n)=>{let o=r[r.length-1];return o.lengtho[1])throw Error(`Invalid slice: ${o}`);let e=[Math.max(o[0],0),Math.min(o[1],this.dims[n])];r.push(e),t.push(e[1]-e[0])}else throw Error(`Invalid slice: ${o}`)}let n=r.map(([e,t])=>t-e),o=n.reduce((e,t)=>e*t),i=new this.data.constructor(o),a=this.stride();for(let e=0;e=0;--o){let e=n[o];t+=(i%e+r[o][0])*a[o],i=Math.floor(i/e)}i[e]=this.data[t]}return new s(this.type,i,t)}permute(...e){return function(e,t){let[r,n]=(0,o.nu)(e.data,e.dims,t);return new s(e.type,r,n)}(this,e)}transpose(...e){return this.permute(...e)}sum(e=null,t=!1){return this.norm(1,e,t)}norm(e="fro",t=null,r=!1){if("fro"===e)e=2;else if("string"==typeof e)throw Error(`Unsupported norm: ${e}`);if(null===t){let t=this.data.reduce((t,r)=>t+r**e,0)**(1/e);return new s(this.type,[t],[])}t=f(t,this.dims.length);let n=this.dims.slice();n[t]=1;let o=new this.data.constructor(this.data.length/this.dims[t]);for(let r=0;r=0;--e){let r=this.dims[e];e!==t&&(i+=o%r*a,a*=n[e]),o=Math.floor(o/r)}o[i]+=this.data[r]**e}if(1!==e)for(let t=0;t=0;--r){let e=this.dims[r];r!==t&&(n+=o%e*i,i*=this.dims[r]),o=Math.floor(o/e)}this.data[e]/=r.data[n]}return this}normalize(e=2,t=1){return this.clone().normalize_(e,t)}stride(){return function(e){let t=Array(e.length);for(let r=e.length-1,n=1;r>=0;--r)t[r]=n,n*=e[r];return t}(this.dims)}squeeze(e=null){return new s(this.type,this.data,c(this.dims,e))}squeeze_(e=null){return this.dims=c(this.dims,e),this}unsqueeze(e=null){return new s(this.type,this.data,d(this.dims,e))}unsqueeze_(e=null){return this.dims=d(this.dims,e),this}flatten_(e=0,t=-1){t=(t+this.dims.length)%this.dims.length;let r=this.dims.slice(0,e),n=this.dims.slice(e,t+1),o=this.dims.slice(t+1);return this.dims=[...r,n.reduce((e,t)=>e*t,1),...o],this}flatten(e=0,t=-1){return this.clone().flatten_(e,t)}view(...e){let t=-1;for(let r=0;rn!==t?e*r:e,1);e[t]=this.data.length/r}return new s(this.type,this.data,e)}neg_(){for(let e=0;e1!==e):"number"==typeof t?1===e[t]&&e.splice(t,1):Array.isArray(t)&&(e=e.filter((e,r)=>1!==e||!t.includes(r))),e}function d(e,t){return t=f(t,e.length+1),(e=e.slice()).splice(t,0,1),e}function f(e,t,r=null){if(e<-t||e>=t)throw Error(`IndexError: index ${e} is out of bounds for dimension${null===r?"":" "+r} with size ${t}`);return e<0&&(e=(e%t+t)%t),e}function h(e,t=0){t=f(t,e[0].dims.length);let r=e[0].dims.slice();r[t]=e.reduce((e,r)=>e+r.dims[t],0);let n=r.reduce((e,t)=>e*t,1),o=new e[0].data.constructor(n),i=e[0].type;if(0===t){let t=0;for(let r of e)o.set(r.data,t),t+=r.data.length}else{let n=0;for(let i=0;i=0;--o){let e=a.dims[o],u=s%e;o===t&&(u+=n),i+=u*l,l*=r[o],s=Math.floor(s/e)}o[i]=a.data[e]}n+=a.dims[t]}}return new s(i,o,r)}function p(e,t=0){return h(e.map(e=>e.unsqueeze(t)),t)}function m(e,t=null,r=1,n=!1){if(null===t){let t=e.data.reduce((e,t)=>e+t,0)/e.data.length,n=Math.sqrt(e.data.reduce((e,r)=>e+(r-t)**2,0)/(e.data.length-r)),o=new s(e.type,[t],[]);return[new s(e.type,[n],[]),o]}t=f(t,e.dims.length);let o=g(e,t,n),i=e.dims.slice();i[t]=1;let a=new e.data.constructor(e.data.length/e.dims[t]);for(let r=0;r=0;--o){let r=e.dims[o];o!==t&&(n+=a%r*s,s*=i[o]),a=Math.floor(a/r)}a[n]+=(e.data[r]-o.data[n])**2}for(let n=0;ne+t,0);return new s(e.type,[t/e.data.length],[])}t=f(t,e.dims.length);let n=e.dims.slice();n[t]=1;let o=new e.data.constructor(e.data.length/e.dims[t]);for(let r=0;r=0;--o){let r=e.dims[o];o!==t&&(i+=a%r*s,s*=n[o]),a=Math.floor(a/r)}o[i]+=e.data[r]}if(1!==e.dims[t])for(let r=0;r0||l>0;)switch(u.push(a-1),c.push(l-1),i[a][l].item()){case 0:--a,--l;break;case 1:--a;break;case 2:--l;break;default:throw Error(`Internal error in dynamic time warping. Unexpected trace[${a}, ${l}]. Please file a bug report.`)}return u.reverse(),c.reverse(),[u,c]}function v(e){var t;return new s("int64",new BigInt64Array((t=e.dims).reduce((e,t)=>e*t,1)).fill(1n),t)}function w(e,t){if(2!==e.dims.length)throw Error("The tensor must have 2 dimensions");if(e.dims.at(-1)%8!=0)throw Error("The last dimension of the tensor must be a multiple of 8");if(!["binary","ubinary"].includes(t))throw Error("The precision must be either 'binary' or 'ubinary'");let r="binary"===t,n=r?Int8Array:Uint8Array,o=e.data,i=new n(o.length/8);for(let e=0;e0?1:0,n=Math.floor(e/8),a=e%8;i[n]|=t<<7-a,r&&0===a&&(i[n]-=128)}return new s(r?"int8":"uint8",i,[e.dims[0],e.dims[1]/8])}},2869:function(e,t,r){"use strict";r.d(t,{$:function(){return v}});var n=r(9235),o=r(8411),i=r(2202),a=r(5377),s=r(2265),l=r(2988),u=r(3950),c=r(929),d=r(5275),f=["animating","color","hidesWhenStopped","size","style"],h=e=>s.createElement("circle",{cx:"16",cy:"16",fill:"none",r:"14",strokeWidth:"4",style:e}),p=s.forwardRef((e,t)=>{var r=e.animating,n=void 0===r||r,o=e.color,i=void 0===o?"#1976D2":o,a=e.hidesWhenStopped,c=e.size,p=void 0===c?"small":c,y=e.style,v=(0,u.Z)(e,f),w=s.createElement("svg",{height:"100%",viewBox:"0 0 32 32",width:"100%"},h({stroke:i,opacity:.2}),h({stroke:i,strokeDasharray:80,strokeDashoffset:60}));return s.createElement(d.Z,(0,l.Z)({},v,{"aria-valuemax":1,"aria-valuemin":0,ref:t,role:"progressbar",style:[m.container,y]}),s.createElement(d.Z,{children:w,style:["number"==typeof p?{height:p,width:p}:g[p],m.animation,!n&&m.animationPause,!n&&(void 0===a||a)&&m.hidesWhenStopped]}))});p.displayName="ActivityIndicator";var m=c.Z.create({container:{alignItems:"center",justifyContent:"center"},hidesWhenStopped:{visibility:"hidden"},animation:{animationDuration:"0.75s",animationKeyframes:[{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}],animationTimingFunction:"linear",animationIterationCount:"infinite"},animationPause:{animationPlayState:"paused"}}),g=c.Z.create({small:{width:20,height:20},large:{width:36,height:36}}),y=r(2281);let v=a.FA.extractable((0,n.Y)(s.forwardRef((e,t)=>{let{size:r,color:n,...s}=e,l=(0,o.Fg)(),u=n;return u&&"$"===u[0]&&(u=(0,i.lk)(l[u])),(0,y.jsx)(a.FA,{ref:t,...s,children:(0,y.jsx)(p,{size:r,color:u})})}),{componentName:"Spinner"}))},9175:function(e,t,r){"use strict";r.d(t,{K:function(){return $}});var n=r(281),o=r(4975),i=r(9046),a=r(2202),s=r(8306),l=r(8970),u=r(6748);let c=(e="$true",t)=>{let{props:r}=t,n=(0,s.f)(e,t),o=(0,l.H)(e,t),i=r.rows??r.numberOfLines,c="number"==typeof i?i*(0,a.Ve)(o.lineHeight):"auto",d=(0,u.Pj)(e,{shift:-2,bounds:[2]}),f=(0,u.Pj)(e,{shift:-1,bounds:[2]});return{...n,...o,paddingVertical:d,paddingHorizontal:f,height:c}};var d=r(8411),f=r(9087),h=r(2265);let p=(e,t)=>()=>{};var m=r(2281),g=r(5803),y=r(7792),v=r(2675),w=r(9647),b=r(1435),_=r(9926),x=r(5158),E=r(4834),S=r(3201),k=r(929),R=r(3013),C=r(131),A=(e,t)=>{var r=e.selectionEnd,n=e.selectionStart,o=t.start,i=t.end;return o!==n||i!==r},T=(e,t)=>{if(A(e,t)){var r=t.start,n=t.end;try{e.setSelectionRange(r,n||r)}catch(e){}}},M=Object.assign({},y.lG,y.LO,y._T,y.YB,y.Uy,y.hJ,y.E5,y.vr,{autoCapitalize:!0,autoComplete:!0,autoCorrect:!0,autoFocus:!0,defaultValue:!0,disabled:!0,lang:!0,maxLength:!0,onChange:!0,onScroll:!0,placeholder:!0,pointerEvents:!0,readOnly:!0,rows:!0,spellCheck:!0,value:!0,type:!0}),I=e=>(0,v.Z)(e,M),O=null,z=h.forwardRef((e,t)=>{var r,n,o=e.autoCapitalize,i=e.autoComplete,a=e.autoCompleteType,s=e.autoCorrect,l=void 0===s||s,u=e.blurOnSubmit,c=e.caretHidden,d=e.clearTextOnFocus,f=e.dir,p=e.editable,m=e.enterKeyHint,y=e.inputMode,v=e.keyboardType,k=e.multiline,A=void 0!==k&&k,M=e.numberOfLines,z=e.onBlur,P=e.onChange,N=e.onChangeText,B=e.onContentSizeChange,j=e.onFocus,F=e.onKeyPress,U=e.onLayout,$=e.onMoveShouldSetResponder,D=e.onMoveShouldSetResponderCapture,H=e.onResponderEnd,V=e.onResponderGrant,W=e.onResponderMove,q=e.onResponderReject,X=e.onResponderRelease,Z=e.onResponderStart,K=e.onResponderTerminate,G=e.onResponderTerminationRequest,Y=e.onScrollShouldSetResponder,J=e.onScrollShouldSetResponderCapture,Q=e.onSelectionChange,ee=e.onSelectionChangeShouldSetResponder,et=e.onSelectionChangeShouldSetResponderCapture,er=e.onStartShouldSetResponder,en=e.onStartShouldSetResponderCapture,eo=e.onSubmitEditing,ei=e.placeholderTextColor,ea=e.readOnly,es=e.returnKeyType,el=e.rows,eu=e.secureTextEntry,ec=void 0!==eu&&eu,ed=e.selection,ef=e.selectTextOnFocus,eh=e.spellCheck;if(null!=y)n=y,r="email"===y?"email":"tel"===y?"tel":"search"===y?"search":"url"===y?"url":"text";else if(null!=v)switch((0,C.O)("keyboardType","keyboardType is deprecated. Use inputMode."),v){case"email-address":r="email";break;case"number-pad":case"numeric":n="numeric";break;case"decimal-pad":n="decimal";break;case"phone-pad":r="tel";break;case"search":case"web-search":r="search";break;case"url":r="url";break;default:r="text"}ec&&(r="password");var ep=h.useRef({height:null,width:null}),em=h.useRef(null),eg=h.useRef(null),ey=h.useRef(!1);h.useEffect(()=>{em.current&&eg.current&&T(em.current,eg.current),ey.current=ec},[ec]);var ev=h.useCallback(e=>{if(A&&B&&null!=e){var t=e.scrollHeight,r=e.scrollWidth;(t!==ep.current.height||r!==ep.current.width)&&(ep.current.height=t,ep.current.width=r,B({nativeEvent:{contentSize:{height:ep.current.height,width:ep.current.width}}}))}},[A,B]),ew=h.useMemo(()=>e=>{null!=e&&(e.clear=function(){null!=e&&(e.value="")},e.isFocused=function(){return null!=e&&R.Z.currentlyFocusedField()===e},ev(e))},[ev]);(0,b.Z)(()=>{var e=em.current;null!=e&&null!=ed&&T(e,ed),document.activeElement===e&&(R.Z._currentlyFocusedNode=e)},[em,ed]),(0,w.Z)(em,U),(0,E.Z)(em,{onMoveShouldSetResponder:$,onMoveShouldSetResponderCapture:D,onResponderEnd:H,onResponderGrant:V,onResponderMove:W,onResponderReject:q,onResponderRelease:X,onResponderStart:Z,onResponderTerminate:K,onResponderTerminationRequest:G,onScrollShouldSetResponder:Y,onScrollShouldSetResponderCapture:J,onSelectionChangeShouldSetResponder:ee,onSelectionChangeShouldSetResponderCapture:et,onStartShouldSetResponder:er,onStartShouldSetResponderCapture:en});var eb=(0,S.PE)().direction,e_=I(e);e_.autoCapitalize=void 0===o?"sentences":o,e_.autoComplete=i||a||"on",e_.autoCorrect=l?"on":"off",e_.dir=void 0!==f?f:"auto",null!=es&&(0,C.O)("returnKeyType","returnKeyType is deprecated. Use enterKeyHint."),e_.enterKeyHint=m||es,e_.inputMode=n,e_.onBlur=function(e){R.Z._currentlyFocusedNode=null,z&&(e.nativeEvent.text=e.target.value,z(e))},e_.onChange=function(e){var t=e.target,r=t.value;e.nativeEvent.text=r,ev(t),P&&P(e),N&&N(r)},e_.onFocus=function(e){var t=e.target;j&&(e.nativeEvent.text=t.value,j(e)),null!=t&&(R.Z._currentlyFocusedNode=t,d&&(t.value=""),ef&&(null!=O&&clearTimeout(O),O=setTimeout(()=>{null!=t&&t.select()},0)))},e_.onKeyDown=function(e){var t=e.target;e.stopPropagation();var r=!A,n=e.nativeEvent,o=n.isComposing||229===n.keyCode;F&&F(e),"Enter"!==e.key||e.shiftKey||o||e.isDefaultPrevented()||((u||!A)&&eo&&(e.preventDefault(),n.text=e.target.value,eo(e)),(null==u?r:u)&&null!=t&&setTimeout(()=>t.blur(),0))},e_.onSelect=function(e){try{var t=e.target,r=t.selectionStart,n=t.selectionEnd,o={start:r,end:n};Q&&(e.nativeEvent.selection=o,e.nativeEvent.text=e.target.value,Q(e)),ey.current===ec&&(eg.current=o)}catch(e){}},null!=p&&(0,C.O)("editable","editable is deprecated. Use readOnly."),e_.readOnly=!0===(void 0!==ea&&ea)||!1===p,null!=M&&(0,C.O)("numberOfLines","TextInput numberOfLines is deprecated. Use rows."),e_.rows=A?null!=el?el:M:1,e_.spellCheck=null!=eh?eh:l,e_.style=[{"--placeholderTextColor":ei},L.textinput$raw,L.placeholder,e.style,c&&L.caretHidden],e_.type=A?void 0:r;var ex=(0,x.Z)(e_),eE=(0,_.Z)(em,ex,ew,t);e_.ref=eE;var eS=null!=e.lang?(0,S.w1)(e.lang):null,ek=e.dir||eS;return(0,g.Z)(A?"textarea":"input",e_,{writingDirection:ek||eb})});z.displayName="TextInput",z.State=R.Z;var L=k.Z.create({textinput$raw:{MozAppearance:"textfield",WebkitAppearance:"none",backgroundColor:"transparent",border:"0 solid black",borderRadius:0,boxSizing:"border-box",font:"14px System",margin:0,padding:0,resize:"none"},placeholder:{placeholderTextColor:"var(--placeholderTextColor)"},caretHidden:{caretColor:"transparent"}}),P=r(357);let N={size:"$true",fontFamily:"$body",borderWidth:1,outlineWidth:0,color:"$color",...n.$L?{tabIndex:0}:{focusable:!0},borderColor:"$borderColor",backgroundColor:"$background",minWidth:0,hoverStyle:{borderColor:"$borderColorHover"},focusStyle:{borderColor:"$borderColorFocus"},focusVisibleStyle:{outlineColor:"$outlineColor",outlineWidth:2,outlineStyle:"solid"}},B=(0,o.z)(z,{name:"Input",variants:{unstyled:{false:N},size:{"...size":(e="$true",t)=>{if(t.props.multiline||t.props.numberOfLines>1)return c(e,t);let r=(0,s.f)(e,t),o=(0,u.Pj)(e,{shift:-1,bounds:[2]}),i=(0,l.H)(e,t);return!n.$L&&i&&delete i.lineHeight,{...i,...r,paddingHorizontal:o}}},disabled:{true:{}}},defaultVariants:{unstyled:"1"===P.env.TAMAGUI_HEADLESS}},{isInput:!0,accept:{placeholderTextColor:"color",selectionColor:"color"}});function j(e,t){let r=(0,d.Fg)(),{onChangeText:n,ref:o}=function({isInput:e,props:t,ref:r}){let{id:n,onChangeText:o,value:a,defaultValue:s}=t,l=(0,h.useRef)(a||s||""),u=(0,h.useRef)(),c=(0,h.useCallback)(t=>{n&&t&&(u.current?.(),u.current=p(n,{focus:t.focus,...e&&{focusAndSelect(){t.focus(),t.setSelection&&"string"==typeof l.current&&t.setSelection(0,l.current.length)}}}))},[e,n]),d=(0,i.FE)(r,c);return(0,h.useEffect)(()=>()=>{u.current?.()},[]),{ref:d,onChangeText:(0,f.z)(e=>{l.current=e,o?.(e)})}}({props:e,ref:t,isInput:!0}),a=e.placeholderTextColor,s=r[a]?.get()??a??r.placeholderColor?.get();return{ref:o,readOnly:e.disabled,...e,placeholderTextColor:s,onChangeText:n}}B.styleable((e,t)=>{let r=(0,h.useRef)(null),n=j(e,(0,i.ex)(t,r));return(0,m.jsx)(B,{...n})});var F=r(357);let U=(0,o.z)(B,{name:"TextArea",multiline:!0,whiteSpace:"pre-wrap",variants:{unstyled:{false:{height:"auto",...N}},size:{"...size":c}},defaultVariants:{unstyled:"1"===F.env.TAMAGUI_HEADLESS}}),$=U.styleable((e,t)=>{let r=(0,h.useRef)(null),o=j(e,(0,i.ex)(t,r)),a={[n.$L?"rows":"numberOfLines"]:e.unstyled?void 0:4};return(0,m.jsx)(U,{...a,...o})})}}]); \ No newline at end of file