dissentry 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,13 +8,13 @@ Error generating stack: `+e.message+`
8
8
  `+e.stack}}var ze=Object.prototype.hasOwnProperty,Be=t.unstable_scheduleCallback,Ve=t.unstable_cancelCallback,He=t.unstable_shouldYield,Ue=t.unstable_requestPaint,F=t.unstable_now,We=t.unstable_getCurrentPriorityLevel,Ge=t.unstable_ImmediatePriority,Ke=t.unstable_UserBlockingPriority,qe=t.unstable_NormalPriority,Je=t.unstable_LowPriority,I=t.unstable_IdlePriority,Ye=t.log,Xe=t.unstable_setDisableYieldValue,Ze=null,L=null;function Qe(e){if(typeof Ye==`function`&&Xe(e),L&&typeof L.setStrictMode==`function`)try{L.setStrictMode(Ze,e)}catch{}}var $e=Math.clz32?Math.clz32:nt,et=Math.log,tt=Math.LN2;function nt(e){return e>>>=0,e===0?32:31-(et(e)/tt|0)|0}var rt=256,it=262144,at=4194304;function ot(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function st(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=ot(n))):i=ot(o):i=ot(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ot(n))):i=ot(o)):i=ot(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function ct(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function lt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-$e(n),i=1<<r;t|=e[r],n&=~i}return t}function ut(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function dt(){var e=at;return at<<=1,!(at&62914560)&&(at=4194304),e}function ft(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function mt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-$e(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&ht(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ht(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-$e(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function gt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-$e(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function _t(e,t){var n=t&-t;return n=n&42?1:vt(n),(n&(e.suspendedLanes|t))===0?n:0}function vt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function yt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function bt(){var e=ve.p;return e===0?(e=window.event,e===void 0?32:Ah(e.type)):e}function xt(e,t){var n=ve.p;try{return ve.p=e,t()}finally{ve.p=n}}var St=Math.random().toString(36).slice(2),Ct=`__reactFiber$`+St,wt=`__reactProps$`+St,Tt=`__reactContainer$`+St,Et=`__reactEvents$`+St,Dt=`__reactListeners$`+St,Ot=`__reactHandles$`+St,kt=`__reactResources$`+St,At=`__reactMarker$`+St,jt=`__reactLoad$`+St;function Mt(e){delete e[Ct],delete e[wt],delete e[Dt],delete e[Ot]}function Nt(e){var t;if(t=e[Ct])return t;for(var n=e.parentNode;n;){if(t=n[Tt]||n[Ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ym(e);e!==null;){if(n=e[Ct])return n;e=ym(e)}return t}e=n,n=e.parentNode}return null}function Pt(e){if(e=e[Ct]||e[Tt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ft(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function It(e){var t=e[kt];return t||=e[kt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Lt(e){e[At]=!0}function Rt(e){e[jt]=void 0}var zt=new Set,Bt={};function Vt(e,t){Ht(e,t),Ht(e+`Capture`,t)}function Ht(e,t){for(Bt[e]=t,e=0;e<t.length;e++)zt.add(t[e])}var Ut=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Wt={},Gt={};function Kt(e){return ze.call(Gt,e)?!0:ze.call(Wt,e)?!1:Ut.test(e)?Gt[e]=!0:(Wt[e]=!0,!1)}var qt=!1;function Jt(){var e=qt;return qt=!1,e}function Yt(e,t,n){if(Kt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Xt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Zt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Qt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function $t(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function en(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function tn(e){if(!e._valueTracker){var t=$t(e)?`checked`:`value`;e._valueTracker=en(e,t,``+e[t])}}function nn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=$t(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var rn=/[\n"\\]/g;function an(e){return e.replace(rn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function on(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Qt(t)):e.value!==``+Qt(t)&&(e.value=``+Qt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):cn(e,Qt(n)):o===`number`&&e.value==t?cn(e,Qt(e.value)):cn(e,Qt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Qt(s):e.removeAttribute(`name`)}function sn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){tn(e);return}n=n==null?``:``+Qt(n),t=t==null?n:``+Qt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),tn(e)}function cn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function ln(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Qt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function un(e,t,n){t!=null&&(t=``+Qt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Qt(n)}function dn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ge(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Qt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),tn(e)}function fn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var pn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function mn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||pn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function hn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,qt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(mn(e,a,r),qt=!0)}else for(var o in t)t.hasOwnProperty(o)&&mn(e,o,t[o])}function gn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var _n=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),vn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function yn(e){return vn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function bn(){}var xn=null;function Sn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Cn=null,wn=null;function Tn(e){var t=Pt(e);if(t&&(e=t.stateNode)){var n=e[wt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(on(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+an(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[wt]||null;if(!a)throw Error(i(90));on(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&nn(r)}break a;case`textarea`:un(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&ln(e,!!n.multiple,t,!1)}}}var En=!1;function Dn(e,t,n){if(En)return e(t,n);En=!0;try{return e(t)}finally{if(En=!1,(Cn!==null||wn!==null)&&(Jd(),Cn&&(t=Cn,e=wn,wn=Cn=null,Tn(t),e)))for(t=0;t<e.length;t++)Tn(e[t])}}function On(e,t){var n=e.stateNode;if(n===null)return null;var r=n[wt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var R=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,kn=!1;if(R)try{var An={};Object.defineProperty(An,"passive",{get:function(){kn=!0}}),window.addEventListener(`test`,An,An),window.removeEventListener(`test`,An,An)}catch{kn=!1}var jn=null,Mn=null,Nn=null;function Pn(){if(Nn)return Nn;var e,t=Mn,n=t.length,r,i=`value`in jn?jn.value:jn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Nn=i.slice(e,1<r?1-r:void 0)}function Fn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function In(){return!0}function Ln(){return!1}function Rn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?In:Ln,this.isPropagationStopped=Ln,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=In)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=In)},persist:function(){},isPersistent:In}),t}var zn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bn=Rn(zn),Vn=D({},zn,{view:0,detail:0}),Hn=Rn(Vn),Un,Wn,Gn,Kn=D({},Vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rr,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Gn&&(Gn&&e.type===`mousemove`?(Un=e.screenX-Gn.screenX,Wn=e.screenY-Gn.screenY):Wn=Un=0,Gn=e),Un)},movementY:function(e){return`movementY`in e?e.movementY:Wn}}),qn=Rn(Kn),Jn=Rn(D({},Kn,{dataTransfer:0})),Yn=Rn(D({},Vn,{relatedTarget:0})),Xn=Rn(D({},zn,{animationName:0,elapsedTime:0,pseudoElement:0})),Zn=Rn(D({},zn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Qn=Rn(D({},zn,{data:0})),$n={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},er={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},tr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function nr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=tr[e])?!!t[e]:!1}function rr(){return nr}var ir=Rn(D({},Vn,{key:function(e){if(e.key){var t=$n[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Fn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?er[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rr,charCode:function(e){return e.type===`keypress`?Fn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Fn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),ar=Rn(D({},Kn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),or=Rn(D({},zn,{submitter:0})),sr=Rn(D({},Vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rr})),cr=Rn(D({},zn,{propertyName:0,elapsedTime:0,pseudoElement:0})),lr=Rn(D({},Kn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),ur=Rn(D({},zn,{newState:0,oldState:0,source:0})),dr=[9,13,27,32],fr=R&&`CompositionEvent`in window,pr=null;R&&`documentMode`in document&&(pr=document.documentMode);var mr=R&&`TextEvent`in window&&!pr,hr=R&&(!fr||pr&&8<pr&&11>=pr),gr=` `,_r=!1;function vr(e,t){switch(e){case`keyup`:return dr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function yr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var br=!1;function xr(e,t){switch(e){case`compositionend`:return yr(t);case`keypress`:return t.which===32?(_r=!0,gr):null;case`textInput`:return e=t.data,e===gr&&_r?null:e;default:return null}}function Sr(e,t){if(br)return e===`compositionend`||!fr&&vr(e,t)?(e=Pn(),Nn=Mn=jn=null,br=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return hr&&t.locale!==`ko`?null:t.data;default:return null}}var Cr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Cr[e.type]:t===`textarea`}function Tr(e,t,n,r){Cn?wn?wn.push(r):wn=[r]:Cn=r,t=ip(t,`onChange`),0<t.length&&(n=new Bn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Er=null,Dr=null;function Or(e){Zf(e,0)}function kr(e){if(nn(Ft(e)))return e}function Ar(e,t){if(e===`change`)return t}var jr=!1;if(R){var Mr;if(R){var Nr=`oninput`in document;if(!Nr){var Pr=document.createElement(`div`);Pr.setAttribute(`oninput`,`return;`),Nr=typeof Pr.oninput==`function`}Mr=Nr}else Mr=!1;jr=Mr&&(!document.documentMode||9<document.documentMode)}function Fr(){Er&&(Er.detachEvent(`onpropertychange`,Ir),Dr=Er=null)}function Ir(e){if(e.propertyName===`value`&&kr(Dr)){var t=[];Tr(t,Dr,e,Sn(e)),Dn(Or,t)}}function z(e,t,n){e===`focusin`?(Fr(),Er=t,Dr=n,Er.attachEvent(`onpropertychange`,Ir)):e===`focusout`&&Fr()}function Lr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return kr(Dr)}function Rr(e,t){if(e===`click`)return kr(t)}function zr(e,t){if(e===`input`||e===`change`)return kr(t)}function Br(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Vr=typeof Object.is==`function`?Object.is:Br;function Hr(e,t){if(Vr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ze.call(t,i)||!Vr(e[i],t[i]))return!1}return!0}function Ur(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Wr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Gr(e,t){var n=Wr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Wr(n)}}function Kr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Kr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function qr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ur(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ur(e.document)}return t}function Jr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Yr=R&&`documentMode`in document&&11>=document.documentMode,Xr=null,Zr=null,Qr=null,$r=!1;function ei(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;$r||Xr==null||Xr!==Ur(r)||(r=Xr,`selectionStart`in r&&Jr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Qr&&Hr(Qr,r)||(Qr=r,r=ip(Zr,`onSelect`),0<r.length&&(t=new Bn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Xr)))}function ti(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ni={animationend:ti(`Animation`,`AnimationEnd`),animationiteration:ti(`Animation`,`AnimationIteration`),animationstart:ti(`Animation`,`AnimationStart`),transitionrun:ti(`Transition`,`TransitionRun`),transitionstart:ti(`Transition`,`TransitionStart`),transitioncancel:ti(`Transition`,`TransitionCancel`),transitionend:ti(`Transition`,`TransitionEnd`)},ri={},ii={};R&&(ii=document.createElement(`div`).style,`AnimationEvent`in window||(delete ni.animationend.animation,delete ni.animationiteration.animation,delete ni.animationstart.animation),`TransitionEvent`in window||delete ni.transitionend.transition);function ai(e){if(ri[e])return ri[e];if(!ni[e])return e;var t=ni[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ii)return ri[e]=t[n];return e}var oi=ai(`animationend`),si=ai(`animationiteration`),ci=ai(`animationstart`),li=ai(`transitionrun`),ui=ai(`transitionstart`),di=ai(`transitioncancel`),fi=ai(`transitionend`),pi=new Map,mi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);mi.push(`scrollEnd`);function hi(e,t){pi.set(e,t),Vt(t,[e])}var gi=0;function _i(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=kd.identifierPrefix;var n=gi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function vi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ld;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function yi(e,t){return e=vi(e),t=vi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var bi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},xi=[],Si=0,Ci=0;function wi(){for(var e=Si,t=Ci=Si=0;t<e;){var n=xi[t];xi[t++]=null;var r=xi[t];xi[t++]=null;var i=xi[t];xi[t++]=null;var a=xi[t];if(xi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Oi(n,i,a)}}function Ti(e,t,n,r){xi[Si++]=e,xi[Si++]=t,xi[Si++]=n,xi[Si++]=r,Ci|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ei(e,t,n,r){return Ti(e,t,n,r),ki(e)}function Di(e,t){return Ti(e,null,null,t),ki(e)}function Oi(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-$e(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ki(e){if(50<Rd)throw Rd=0,zd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ai={};function ji(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mi(e,t,n,r){return new ji(e,t,n,r)}function Ni(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Pi(e,t){var n=e.alternate;return n===null?(n=Mi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Fi(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ii(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Ni(r)&&(s=1);else if(typeof r==`string`)s=eh(e,n,we.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case se:return e=Mi(31,n,t,a),e.elementType=se,e.lanes=o,e;case j:return Li(n.children,a,o,t);case M:s=8,a|=24;break;case ee:return e=Mi(12,n,t,a|2),e.elementType=ee,e.lanes=o,e;case re:return e=Mi(13,n,t,a),e.elementType=re,e.lanes=o,e;case ie:return e=Mi(19,n,t,a),e.elementType=ie,e.lanes=o,e;case ce:case ue:return e=a|32,e=Mi(30,n,t,e),e.elementType=ue,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case te:s=10;break a;case N:s=9;break a;case ne:s=11;break a;case ae:s=14;break a;case oe:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Mi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Li(e,t,n,r){return e=Mi(7,e,r,t),e.lanes=n,e}function Ri(e,t,n){return e=Mi(6,e,null,t),e.lanes=n,e}function zi(e){var t=Mi(18,null,null,0);return t.stateNode=e,t}function Bi(e,t,n){return t=Mi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Vi=new WeakMap;function Hi(e,t){if(typeof e==`object`&&e){var n=Vi.get(e);return n===void 0?(t={value:e,source:t,stack:Re(t)},Vi.set(e,t),t):n}return{value:e,source:t,stack:Re(t)}}var Ui=[],Wi=0,Gi=null,Ki=0,qi=[],Ji=0,Yi=null,Xi=1,Zi=``;function Qi(e,t){Ui[Wi++]=Ki,Ui[Wi++]=Gi,Gi=e,Ki=t}function $i(e,t,n){qi[Ji++]=Xi,qi[Ji++]=Zi,qi[Ji++]=Yi,Yi=e;var r=Xi;e=Zi;var i=32-$e(r)-1;r&=~(1<<i),n+=1;var a=32-$e(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Xi=1<<32-$e(t)+i|n<<i|r,Zi=a+e}else Xi=1<<a|n<<i|r,Zi=e}function ea(e){e.return!==null&&(Qi(e,1),$i(e,1,0))}function ta(e){for(;e===Gi;)Gi=Ui[--Wi],Ui[Wi]=null,Ki=Ui[--Wi],Ui[Wi]=null;for(;e===Yi;)Yi=qi[--Ji],qi[Ji]=null,Zi=qi[--Ji],qi[Ji]=null,Xi=qi[--Ji],qi[Ji]=null}function na(e,t){qi[Ji++]=Xi,qi[Ji++]=Zi,qi[Ji++]=Yi,Xi=t.id,Zi=t.overflow,Yi=e}var ra=null,ia=null,aa=!1,oa=null,sa=!1,ca=Error(i(519));function la(e){throw ma(Hi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ca}function ua(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ct]=e,t[wt]=r,n){case`dialog`:Qf(`cancel`,t),Qf(`close`,t);break;case`iframe`:case`object`:case`embed`:Qf(`load`,t);break;case`video`:case`audio`:for(n=0;n<Yf.length;n++)Qf(Yf[n],t);break;case`source`:Qf(`error`,t);break;case`img`:case`image`:case`link`:Qf(`error`,t),Qf(`load`,t);break;case`details`:Qf(`toggle`,t);break;case`input`:Qf(`invalid`,t),sn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Qf(`invalid`,t);break;case`textarea`:Qf(`invalid`,t),dn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||up(t.textContent,n)?(r.popover!=null&&(Qf(`beforetoggle`,t),Qf(`toggle`,t)),r.onScroll!=null&&Qf(`scroll`,t),r.onScrollEnd!=null&&Qf(`scrollend`,t),r.onClick!=null&&(t.onclick=bn),t=!0):t=!1,t||la(e,!0)}function da(e){for(ra=e.return;ra;)switch(ra.tag){case 5:case 31:case 13:sa=!1;return;case 27:case 3:sa=!0;return;default:ra=ra.return}}function fa(e){if(e!==ra)return!1;if(!aa)return da(e),aa=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||U(e.type,e.memoizedProps)),n=!n),n&&ia&&la(e),da(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ia=vm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ia=vm(e)}else t===27?(t=ia,Mp(e.type)?(e=_m,_m=null,ia=e):ia=t):ia=ra?gm(e.stateNode.nextSibling):null;return!0}function pa(){ia=ra=null,aa=!1}function B(){var e=oa;return e!==null&&(xd===null?xd=e:xd.push.apply(xd,e),oa=null),e}function ma(e){oa===null?oa=[e]:oa.push(e)}var ha=xe(null),ga=null,_a=null;function va(e,t,n){Ce(ha,t._currentValue),t._currentValue=n}function ya(e){e._currentValue=ha.current,Se(ha)}function ba(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function xa(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ba(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ba(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),ba(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Sa(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Vr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===De.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[mh]:e.push(mh))}a=a.return}return e!==null&&xa(t,e,n,r),t.flags|=262144,e!==null}function Ca(e){for(e=e.firstContext;e!==null;){if(!Vr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function wa(e){ga=e,_a=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ta(e){return Da(ga,e)}function Ea(e,t){return ga===null&&wa(e),Da(e,t)}function Da(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},_a===null){if(e===null)throw Error(i(308));_a=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else _a=_a.next=t;return n}var Oa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ka=t.unstable_scheduleCallback,Aa=t.unstable_NormalPriority,ja={$$typeof:te,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ma(){return{controller:new Oa,data:new Map,refCount:0}}function Na(e){e.refCount--,e.refCount===0&&ka(Aa,function(){e.controller.abort()})}function Pa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Fa=null;function Ia(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var La=null,Ra=0,za=0,Ba=null;function Va(e,t){if(La===null){var n=La=[];Ra=0,za=Wf(),Ba={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ra++,t.then(Ha,Ha),t}function Ha(){if(--Ra===0&&(Fa=null,La!==null)){Ba!==null&&(Ba.status=`fulfilled`);var e=La;La=null,za=0,Ba=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ua(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Wa=_e.S;_e.S=function(e,t){if(wd=F(),typeof t==`object`&&t&&typeof t.then==`function`&&Va(e,t),Fa!==null)for(var n=Af;n!==null;)Pa(n,Fa),n=n.next;if(n=e.types,n!==null){for(var r=Af;r!==null;)Pa(r,n),r=r.next;if(za!==0){r=Fa,r===null&&(r=Fa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Wa!==null&&Wa(e,t)};var Ga=xe(null);function Ka(){var e=Ga.current;return e===null?ad.pooledCache:e}function qa(e,t){t===null?Ce(Ga,Ga.current):Ce(Ga,t.pool)}function Ja(){var e=Ka();return e===null?null:{parent:ja._currentValue,pool:e}}var Ya=Error(i(460)),Xa=Error(i(474)),Za=Error(i(542)),Qa={then:function(){}};function $a(e){return e=e.status,e===`fulfilled`||e===`rejected`}function eo(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(bn,bn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ro(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(bn,bn);else{if(e=ad,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ro(e),e}throw no=t,Ya}}function to(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(no=e,Ya):e}}var no=null;function V(){if(no===null)throw Error(i(459));var e=no;return no=null,e}function ro(e){if(e===Ya||e===Za)throw Error(i(483))}var io=null,ao=0;function oo(e){var t=ao;return ao+=1,io===null&&(io=[]),eo(io,e,t)}function so(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function co(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function lo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Pi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ri(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===j?(e=d(e,t,n.props.children,r,n.key),so(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===oe&&to(i)===t.type)?(t=a(t,n.props),so(t,n),t.return=e,t):(t=Ii(n.type,n.key,n.props,null,e.mode,r),so(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Bi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Li(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Ri(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Ii(t.type,t.key,t.props,null,e.mode,n),so(n,t),n.return=e,n;case A:return t=Bi(t,e.mode,n),t.return=e,t;case oe:return t=to(t),f(e,t,n)}if(ge(t)||pe(t))return t=Li(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,oo(t),n);if(t.$$typeof===te)return f(e,Ea(e,t),n);co(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case k:return n.key===i?l(e,t,n,r):null;case A:return n.key===i?u(e,t,n,r):null;case oe:return n=to(n),p(e,t,n,r)}if(ge(n)||pe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,oo(n),r);if(n.$$typeof===te)return p(e,t,Ea(e,n),r);co(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case A:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case oe:return r=to(r),m(e,t,n,r,i)}if(ge(r)||pe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,oo(r),i);if(r.$$typeof===te)return m(e,t,n,Ea(t,r),i);co(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),aa&&Qi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return aa&&Qi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),aa&&Qi(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),aa&&Qi(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return aa&&Qi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),aa&&Qi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===j&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===j){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),so(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===oe&&to(l)===r.type){n(e,r.sibling),c=a(r,o.props),so(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===j?(c=Li(o.props.children,e.mode,c,o.key),so(c,o),c.return=e,e=c):(c=Ii(o.type,o.key,o.props,null,e.mode,c),so(c,o),c.return=e,e=c)}return s(e);case A:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Bi(o,e.mode,c),c.return=e,e=c}return s(e);case oe:return o=to(o),_(e,r,o,c)}if(ge(o))return h(e,r,o,c);if(pe(o)){if(l=pe(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,oo(o),c);if(o.$$typeof===te)return _(e,r,Ea(e,o),c);co(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Ri(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ao=0;var i=_(e,t,n,r);return io=null,i}catch(t){if(t===Ya||t===Za)throw t;var a=Mi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var uo=lo(!0),fo=lo(!1),po=!1;function mo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ho(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function go(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function _o(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,id&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ki(e),Oi(e,null,n),t}return Ti(e,r,t,n),ki(e)}function vo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gt(e,n)}}function yo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var bo=!1;function xo(){if(bo){var e=Ba;if(e!==null)throw e}}function So(e,t,n,r){bo=!1;var i=e.updateQueue;po=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(sd&f)===f:(r&f)===f){f!==0&&f===za&&(bo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:po=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),hd|=o,e.lanes=o,e.memoizedState=d}}function Co(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function wo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Co(n[e],t)}var To=xe(null),Eo=xe(0);function Do(e,t){e=pd,Ce(Eo,e),Ce(To,t),pd=e|t.baseLanes}function Oo(){Ce(Eo,pd),Ce(To,To.current)}function ko(){pd=Eo.current,Se(To),Se(Eo)}var Ao=xe(null),jo=null;function Mo(e){var t=e.alternate;Ce(Lo,Lo.current&1),Ce(Ao,e),jo===null&&(t===null||To.current!==null||t.memoizedState!==null)&&(jo=e)}function No(e){Ce(Lo,Lo.current),Ce(Ao,e),jo===null&&(jo=e)}function Po(e){e.tag===22?(Ce(Lo,Lo.current),Ce(Ao,e),jo===null&&(jo=e)):Fo()}function Fo(){Ce(Lo,Lo.current),Ce(Ao,Ao.current)}function Io(e){Se(Ao),jo===e&&(jo=null),Se(Lo)}var Lo=xe(0);function Ro(e,t){Ce(Ao,Ao.current),Ce(Lo,t)}function zo(e){Se(Lo),Se(Ao),jo===e&&(jo=null)}function Bo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||pm(n)||mm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Vo=0,Ho=null,Uo=null,Wo=null,Go=!1,Ko=!1,qo=!1,Jo=0,Yo=0,Xo=null,Zo=0;function Qo(){throw Error(i(321))}function $o(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Vr(e[n],t[n]))return!1;return!0}function es(e,t,n,r,i,a){return Vo=a,Ho=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,_e.H=e===null||e.memoizedState===null?_c:vc,qo=!1,a=n(r,i),qo=!1,Ko&&(a=ns(t,n,r,i)),ts(e),a}function ts(e){_e.H=gc;var t=Uo!==null&&Uo.next!==null;if(Vo=0,Wo=Uo=Ho=null,Go=!1,Yo=0,Xo=null,t)throw Error(i(300));e===null||Fc||(e=e.dependencies,e!==null&&Ca(e)&&(Fc=!0))}function ns(e,t,n,r){Ho=e;var a=0;do{if(Ko&&(Xo=null),Yo=0,Ko=!1,25<=a)throw Error(i(301));if(a+=1,Wo=Uo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}_e.H=yc,o=t(n,r)}while(Ko);return o}function rs(){var e=_e.H,t=e.useState()[0];return t=typeof t.then==`function`?us(t):t,e=e.useState()[0],(Uo===null?null:Uo.memoizedState)!==e&&(Ho.flags|=1024),t}function is(){var e=Jo!==0;return Jo=0,e}function as(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function os(e){if(Go){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Go=!1}Vo=0,Wo=Uo=Ho=null,Ko=!1,Yo=Jo=0,Xo=null}function ss(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Wo===null?Ho.memoizedState=Wo=e:Wo=Wo.next=e,Wo}function cs(){if(Uo===null){var e=Ho.alternate;e=e===null?null:e.memoizedState}else e=Uo.next;var t=Wo===null?Ho.memoizedState:Wo.next;if(t!==null)Wo=t,Uo=e;else{if(e===null)throw Ho.alternate===null?Error(i(467)):Error(i(310));Uo=e,e={memoizedState:Uo.memoizedState,baseState:Uo.baseState,baseQueue:Uo.baseQueue,queue:Uo.queue,next:null},Wo===null?Ho.memoizedState=Wo=e:Wo=Wo.next=e}return Wo}function ls(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function us(e){var t=Yo;return Yo+=1,Xo===null&&(Xo=[]),e=eo(Xo,e,t),t=Ho,(Wo===null?t.memoizedState:Wo.next)===null&&(t=t.alternate,_e.H=t===null||t.memoizedState===null?_c:vc),e}function ds(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return us(e);if(e.$$typeof===de)return;if(e.$$typeof===te)return Ta(e)}throw Error(i(438,String(e)))}function fs(e){var t=null,n=Ho.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Ho.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ls(),Ho.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=le;return t.index++,n}function ps(e,t){return typeof t==`function`?t(e):t}function ms(e){return hs(cs(),Uo,e)}function hs(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Vo&f)===f:(sd&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===za&&(d=!0);else if((Vo&p)===p){u=u.next,p===za&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,Ho.lanes|=p,hd|=p;f=u.action,qo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,Ho.lanes|=f,hd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Vr(o,e.memoizedState)&&(Fc=!0,d&&(n=Ba,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function gs(e){var t=cs(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Vr(o,t.memoizedState)||(Fc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function _s(e,t,n){var r=Ho,a=cs(),o=aa;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Vr((Uo||a).memoizedState,n);if(s&&(a.memoizedState=n,Fc=!0),a=a.queue,Hs(bs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Wo!==null&&!!(Wo.memoizedState.tag&1),Ls(e?9:8,{destroy:void 0},ys.bind(null,r,a,n,t),null),e){if(r.flags|=2048,ad===null)throw Error(i(349));o||Vo&127||vs(r,t,n)}return n}function vs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ho.updateQueue,t===null?(t=ls(),Ho.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ys(e,t,n,r){t.value=n,t.getSnapshot=r,xs(t)&&Ss(e)}function bs(e,t,n){return n(function(){xs(t)&&Ss(e)})}function xs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Vr(e,n)}catch{return!0}}function Ss(e){var t=Di(e,2);t!==null&&Ud(t,e,2)}function Cs(e){var t=ss();if(typeof e==`function`){var n=e;if(e=n(),qo){Qe(!0);try{n()}finally{Qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:e},t}function ws(e,t,n,r){return e.baseState=n,hs(e,Uo,typeof r==`function`?r:ps)}function Ts(e,t,n,r,a){if(pc(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};_e.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Es(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Es(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=_e.T,o={};o.types=a===null?null:a.types,_e.T=o;try{var s=n(i,r),c=_e.S;c!==null&&c(o,s),Ds(e,t,s)}catch(n){ks(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),_e.T=a}}else try{a=n(i,r),Ds(e,t,a)}catch(n){ks(e,t,n)}}function Ds(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Os(e,t,n)},function(n){return ks(e,t,n)}):Os(e,t,n)}function Os(e,t,n){t.status=`fulfilled`,t.value=n,As(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Es(e,n)))}function ks(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,As(t),t=t.next;while(t!==r)}e.action=null}function As(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function js(e,t){return t}function Ms(e,t){if(aa){var n=ad.formState;if(n!==null){a:{var r=Ho;if(aa){if(ia){b:{for(var i=ia,a=sa;i.nodeType!==8;)if(!a||(i=gm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ia=gm(i.nextSibling),r=i.data===`F!`;break a}}la(r)}r=!1}r&&(t=n[0])}}return n=ss(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:t},n.queue=r,n=uc.bind(null,Ho,r),r.dispatch=n,r=Cs(!1),a=fc.bind(null,Ho,!1,r.queue),r=ss(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ts.bind(null,Ho,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ns(e){return Ps(cs(),Uo,e)}function Ps(e,t,n){if(t=hs(e,t,js)[0],e=ms(ps)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=us(t)}catch(e){throw e===Ya?Za:e}else r=t;t=cs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Ho.flags|=2048,Ls(9,{destroy:void 0},Fs.bind(null,i,n),null)),[r,a,e]}function Fs(e,t){e.action=t}function Is(e){var t=cs(),n=Uo;if(n!==null)return Ps(t,n,e);cs(),t=t.memoizedState,n=cs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ls(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Ho.updateQueue,t===null&&(t=ls(),Ho.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Rs(){return cs().memoizedState}function zs(e,t,n,r){var i=ss();Ho.flags|=e,i.memoizedState=Ls(1|t,{destroy:void 0},n,r===void 0?null:r)}function Bs(e,t,n,r){var i=cs();r=r===void 0?null:r;var a=i.memoizedState.inst;Uo!==null&&r!==null&&$o(r,Uo.memoizedState.deps)?i.memoizedState=Ls(t,a,n,r):(Ho.flags|=e,i.memoizedState=Ls(1|t,a,n,r))}function Vs(e,t){zs(8390656,8,e,t)}function Hs(e,t){Bs(2048,8,e,t)}function Us(e){Ho.flags|=4;var t=Ho.updateQueue;if(t===null)t=ls(),Ho.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ws(e){var t=cs().memoizedState;return Us({ref:t,nextImpl:e}),function(){if(id&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Gs(e,t){return Bs(4,2,e,t)}function Ks(e,t){return Bs(4,4,e,t)}function qs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Js(e,t,n){n=n==null?null:n.concat([e]),Bs(4,4,qs.bind(null,t,e),n)}function Ys(){}function Xs(e,t){var n=cs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&$o(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Zs(e,t){var n=cs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&$o(t,r[1]))return r[0];if(r=e(),qo){Qe(!0);try{e()}finally{Qe(!1)}}return n.memoizedState=[r,t],r}function Qs(e,t,n){return n===void 0||Vo&1073741824&&!(sd&261930)?e.memoizedState=t:(e.memoizedState=n,e=Vd(),Ho.lanes|=e,hd|=e,n)}function $s(e,t,n,r){return Vr(n,t)?n:To.current===null?!(Vo&106)||Vo&1073741824&&!(sd&261930)?(Fc=!0,e.memoizedState=n):(e=Vd(),Ho.lanes|=e,hd|=e,t):(e=Qs(e,n,r),Vr(e,t)||(Fc=!0),e)}function ec(e,t,n,r,i){var a=ve.p;ve.p=a!==0&&8>a?a:8;var o=_e.T,s={};s.types=o===null?null:o.types,_e.T=s,fc(e,!1,t,n);try{var c=i(),l=_e.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?dc(e,t,Ua(c,r),Bd(e)):dc(e,t,r,Bd(e))}catch(n){dc(e,t,{then:function(){},status:`rejected`,reason:n},Bd())}finally{ve.p=a,o!==null&&s.types!==null&&(o.types=s.types),_e.T=o}}function tc(){}function nc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=rc(e).queue;ec(e,a,t,P,n===null?tc:function(){return ic(e),n(r)})}function rc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:P},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ic(e){var t=rc(e);t.next===null&&(t=e.alternate.memoizedState),dc(e,t.next.queue,{},Bd())}function ac(){return Ta(mh)}function oc(){return cs().memoizedState}function sc(){return cs().memoizedState}function cc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Bd();e=go(n);var r=_o(t,e,n);r!==null&&(Ud(r,t,n),vo(r,t,n)),t={cache:Ma()},e.payload=t;return}t=t.return}}function lc(e,t,n){var r=Bd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},pc(e)?mc(t,n):(n=Ei(e,t,n,r),n!==null&&(Ud(n,e,r),hc(n,t,r)))}function uc(e,t,n){dc(e,t,n,Bd())}function dc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(pc(e))mc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Vr(s,o))return Ti(e,t,i,0),ad===null&&wi(),!1}catch{}if(n=Ei(e,t,i,r),n!==null)return Ud(n,e,r),hc(n,t,r),!0}return!1}function fc(e,t,n,r){if(r={lane:2,revertLane:Wf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},pc(e)){if(t)throw Error(i(479))}else t=Ei(e,n,r,2),t!==null&&Ud(t,e,2)}function pc(e){var t=e.alternate;return e===Ho||t!==null&&t===Ho}function mc(e,t){Ko=Go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gt(e,n)}}var gc={readContext:Ta,use:ds,useCallback:Qo,useContext:Qo,useEffect:Qo,useImperativeHandle:Qo,useLayoutEffect:Qo,useInsertionEffect:Qo,useMemo:Qo,useReducer:Qo,useRef:Qo,useState:Qo,useDebugValue:Qo,useDeferredValue:Qo,useTransition:Qo,useSyncExternalStore:Qo,useId:Qo,useHostTransitionStatus:Qo,useFormState:Qo,useActionState:Qo,useOptimistic:Qo,useMemoCache:Qo,useCacheRefresh:Qo,useEffectEvent:Qo},_c={readContext:Ta,use:ds,useCallback:function(e,t){return ss().memoizedState=[e,t===void 0?null:t],e},useContext:Ta,useEffect:Vs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),zs(4194308,4,qs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zs(4194308,4,e,t)},useInsertionEffect:function(e,t){zs(4,2,e,t)},useMemo:function(e,t){var n=ss();t=t===void 0?null:t;var r=e();if(qo){Qe(!0);try{e()}finally{Qe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ss();if(n!==void 0){var i=n(t);if(qo){Qe(!0);try{n(t)}finally{Qe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=lc.bind(null,Ho,e),[r.memoizedState,e]},useRef:function(e){var t=ss();return e={current:e},t.memoizedState=e},useState:function(e){e=Cs(e);var t=e.queue,n=uc.bind(null,Ho,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ys,useDeferredValue:function(e,t){return Qs(ss(),e,t)},useTransition:function(){var e=Cs(!1);return e=ec.bind(null,Ho,e.queue,!0,!1),ss().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Ho,a=ss();if(aa){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),ad===null)throw Error(i(349));sd&127||vs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Vs(bs.bind(null,r,o,e),[e]),r.flags|=2048,Ls(9,{destroy:void 0},ys.bind(null,r,o,n,t),null),n},useId:function(){var e=ss(),t=ad.identifierPrefix;if(aa){var n=Zi,r=Xi;n=(r&~(1<<32-$e(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Jo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Zo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ac,useFormState:Ms,useActionState:Ms,useOptimistic:function(e){var t=ss();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=fc.bind(null,Ho,!0,n),n.dispatch=t,[e,t]},useMemoCache:fs,useCacheRefresh:function(){return ss().memoizedState=cc.bind(null,Ho)},useEffectEvent:function(e){var t=ss(),n={impl:e};return t.memoizedState=n,function(){if(id&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},vc={readContext:Ta,use:ds,useCallback:Xs,useContext:Ta,useEffect:Hs,useImperativeHandle:Js,useInsertionEffect:Gs,useLayoutEffect:Ks,useMemo:Zs,useReducer:ms,useRef:Rs,useState:function(){return ms(ps)},useDebugValue:Ys,useDeferredValue:function(e,t){return $s(cs(),Uo.memoizedState,e,t)},useTransition:function(){var e=ms(ps)[0],t=cs().memoizedState;return[typeof e==`boolean`?e:us(e),t]},useSyncExternalStore:_s,useId:oc,useHostTransitionStatus:ac,useFormState:Ns,useActionState:Ns,useOptimistic:function(e,t){return ws(cs(),Uo,e,t)},useMemoCache:fs,useCacheRefresh:sc,useEffectEvent:Ws},yc={readContext:Ta,use:ds,useCallback:Xs,useContext:Ta,useEffect:Hs,useImperativeHandle:Js,useInsertionEffect:Gs,useLayoutEffect:Ks,useMemo:Zs,useReducer:gs,useRef:Rs,useState:function(){return gs(ps)},useDebugValue:Ys,useDeferredValue:function(e,t){var n=cs();return Uo===null?Qs(n,e,t):$s(n,Uo.memoizedState,e,t)},useTransition:function(){var e=gs(ps)[0],t=cs().memoizedState;return[typeof e==`boolean`?e:us(e),t]},useSyncExternalStore:_s,useId:oc,useHostTransitionStatus:ac,useFormState:Is,useActionState:Is,useOptimistic:function(e,t){var n=cs();return Uo===null?(n.baseState=e,[e,n.queue.dispatch]):ws(n,Uo,e,t)},useMemoCache:fs,useCacheRefresh:sc,useEffectEvent:Ws};function bc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var xc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Bd(),i=go(r);i.payload=t,n!=null&&(i.callback=n),t=_o(e,i,r),t!==null&&(Ud(t,e,r),vo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Bd(),i=go(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=_o(e,i,r),t!==null&&(Ud(t,e,r),vo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Bd(),r=go(n);r.tag=2,t!=null&&(r.callback=t),t=_o(e,r,n),t!==null&&(Ud(t,e,n),vo(t,e,n))}};function Sc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Hr(n,r)||!Hr(i,a):!0}function Cc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&xc.enqueueReplaceState(t,t.state,null)}function wc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Tc(e){bi(e)}function Ec(e){console.error(e)}function Dc(e){bi(e)}function Oc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function kc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ac(e,t,n){return n=go(n),n.tag=3,n.payload={element:null},n.callback=function(){Oc(e,t)},n}function jc(e){return e=go(e),e.tag=3,e}function Mc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){kc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){kc(t,n,r),typeof i!=`function`&&(Dd===null?Dd=new Set([this]):Dd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Nc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Sa(t,n,a,!0),n=Ao.current,n!==null){switch(n.tag){case 31:case 13:case 19:return jo===null?tf():n.alternate===null&&md===0&&(md=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Qa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),wf(e,r,a)),!1;case 22:return n.flags|=65536,r===Qa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),wf(e,r,a)),!1}throw Error(i(435,n.tag))}return wf(e,r,a),tf(),!1}if(aa)return t=Ao.current,t===null?(r!==ca&&(t=Error(i(423),{cause:r}),ma(Hi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Hi(r,n),a=Ac(e.stateNode,r,a),yo(e,a),md!==4&&(md=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ca&&(e=Error(i(422),{cause:r}),ma(Hi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Hi(o,n),bd===null?bd=[o]:bd.push(o),md!==4&&(md=2),t===null)return!0;r=Hi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ac(n.stateNode,r,e),yo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Dd===null||!Dd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=jc(a),Mc(a,e,n,r),yo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Pc=Error(i(461)),Fc=!1;function Ic(e,t,n,r){t.child=e===null?fo(t,null,n,r):uo(t,e.child,n,r)}function Lc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return wa(t),r=es(e,t,n,o,a,i),s=is(),e!==null&&!Fc?(as(e,t,i),dl(e,t,i)):(aa&&s&&ea(t),t.flags|=1,Ic(e,t,r,i),t.child)}function Rc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ni(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,zc(e,t,a,r,i)):(e=Ii(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!fl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Hr:n,n(o,r)&&e.ref===t.ref)return dl(e,t,i)}return t.flags|=1,e=Pi(a,r),e.ref=t.ref,e.return=t,t.child=e}function zc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Hr(a,r)&&e.ref===t.ref){if(Fc=!1,t.pendingProps=r=a,fl(e,i))e.flags&131072&&(Fc=!0);else return t.lanes=e.lanes,dl(e,t,i)}}return qc(e,t,n,r,i)}function Bc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Hc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&qa(t,a===null?null:a.cachePool),a===null?Oo():Do(t,a),Po(t);else return r=t.lanes=536870912,Hc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&qa(t,null),Oo(),Fo()):(qa(t,a.cachePool),Do(t,a),Fo(),t.memoizedState=null);return Ic(e,t,i,n),t.child}function Vc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Hc(e,t,n,r,i){var a=Ka();return a=a===null?null:{parent:ja._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&qa(t,null),Oo(),Po(t),e!==null&&Sa(e,t,r,!0),t.childLanes=i,null}function Uc(e,t){return t=nl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Wc(e,t,n){return uo(t,e.child,null,n),e=Uc(t,t.pendingProps),e.flags|=2,Io(t),t.memoizedState=null,e}function Gc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(aa){if(r.mode===`hidden`)return e=Uc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Vc(null,e);if(No(t),(e=ia)?(e=fm(e,sa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Yi===null?null:{id:Xi,overflow:Zi},retryLane:536870912,hydrationErrors:null},n=zi(e),n.return=t,t.child=n,ra=t,ia=null)):e=null,e===null)throw la(t);return t.lanes=536870912,null}return Uc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(No(t),a){if(t.flags&256)t.flags&=-257,t=Wc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Fc||Sa(e,t,n,!1),a=(n&e.childLanes)!==0,Fc||a){if(To.current===null){if(r=ad,r!==null&&(s=_t(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Di(e,s),Ud(r,e,s),Pc;tf()}t=Wc(e,t,n)}else e=o.treeContext,ia=gm(s.nextSibling),ra=t,aa=!0,oa=null,sa=!1,e!==null&&na(t,e),t=Uc(t,r),t.flags|=134221824;return t}return e=Pi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Kc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function qc(e,t,n,r,i){return wa(t),n=es(e,t,n,r,void 0,i),r=is(),e!==null&&!Fc?(as(e,t,i),dl(e,t,i)):(aa&&r&&ea(t),t.flags|=1,Ic(e,t,n,i),t.child)}function Jc(e,t,n,r,i,a){return wa(t),t.updateQueue=null,n=ns(t,r,n,i),ts(e),r=is(),e!==null&&!Fc?(as(e,t,a),dl(e,t,a)):(aa&&r&&ea(t),t.flags|=1,Ic(e,t,n,a),t.child)}function Yc(e,t,n,r,i){if(wa(t),t.stateNode===null){var a=Ai,o=n.contextType;typeof o==`object`&&o&&(a=Ta(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=xc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},mo(t),o=n.contextType,a.context=typeof o==`object`&&o?Ta(o):Ai,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(bc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&xc.enqueueReplaceState(a,a.state,null),So(t,r,a,i),xo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=wc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ai,typeof u==`object`&&u&&(o=Ta(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Cc(t,a,r,o),po=!1;var f=t.memoizedState;a.state=f,So(t,r,a,i),xo(),l=t.memoizedState,s||f!==l||po?(typeof d==`function`&&(bc(t,n,d,r),l=t.memoizedState),(c=po||Sc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,ho(e,t),o=t.memoizedProps,u=wc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ai,typeof l==`object`&&l&&(c=Ta(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Cc(t,a,r,c),po=!1,f=t.memoizedState,a.state=f,So(t,r,a,i),xo();var p=t.memoizedState;o!==d||f!==p||po||e!==null&&e.dependencies!==null&&Ca(e.dependencies)?(typeof s==`function`&&(bc(t,n,s,r),p=t.memoizedState),(u=po||Sc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ca(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Kc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=uo(t,e.child,null,i),t.child=uo(t,null,n,i)):Ic(e,t,n,i),t.memoizedState=a.state,e=t.child):e=dl(e,t,i),e}function Xc(e,t,n,r){return pa(),t.flags|=256,Ic(e,t,n,r),t.child}var Zc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qc(e){return{baseLanes:e,cachePool:Ja()}}function $c(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=vd),e}function el(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Lo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(aa){if(i?Mo(t):Fo(),(e=ia)?(e=fm(e,sa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Yi===null?null:{id:Xi,overflow:Zi},retryLane:536870912,hydrationErrors:null},n=zi(e),n.return=t,t.child=n,ra=t,ia=null)):e=null,e===null)throw la(t);return t.lanes=mm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Fo(),i=t.mode,a=nl({mode:`hidden`,children:a},i),r=Li(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Qc(n),r.childLanes=$c(e,o,n),t.memoizedState=Zc,Vc(null,r)):(Mo(t),tl(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return il(e,t,a,o,r,c,s,n)}return i?(Fo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Pi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Li(i,a,n,null),i.flags|=2):i=Pi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Vc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Qc(n):(a=i.cachePool,a===null?a=Ja():(s=ja._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=$c(e,o,n),t.memoizedState=Zc,Vc(e.child,r)):(Mo(t),n=e.child,e=n.sibling,n=Pi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function tl(e,t){return t=nl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function nl(e,t){return e=Mi(22,e,null,t),e.lanes=0,e}function rl(e,t,n){return uo(t,e.child,null,n),e=tl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function il(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Mo(t),t.flags&=-257,rl(e,t,c)):t.memoizedState===null?(Fo(),o=a.fallback,s=t.mode,a=nl({mode:`visible`,children:a.children},s),o=Li(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,uo(t,e.child,null,c),a=t.child,a.memoizedState=Qc(c),a.childLanes=$c(e,r,c),t.memoizedState=Zc,Vc(null,a)):(Fo(),t.child=e.child,t.flags|=128,null);if(Mo(t),mm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ma({value:a,source:null,stack:null})),rl(e,t,c)}if(Fc||Sa(e,t,c,!1),r=(c&e.childLanes)!==0,Fc||r){if(To.current!==null)return rl(e,t,c);if(r=ad,r!==null&&(a=_t(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Di(e,a),Ud(r,e,a),Pc;return pm(o)||tf(),rl(e,t,c)}return pm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ia=gm(o.nextSibling),ra=t,aa=!0,oa=null,sa=!1,e!==null&&na(t,e),t=tl(t,a.children),t.flags|=134221824,t)}function al(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ba(e.return,t,n)}function ol(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Bo(n)===null&&(t=e),e=e.sibling}return t}function sl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function cl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function ll(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Lo.current;if(t.flags&128)return Ro(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Ro(t,o),i===`backwards`&&e!==null?(cl(e),Ic(e,t,r,n),cl(e)):Ic(e,t,r,n),r=aa?Ki:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&al(e,n,t);else if(e.tag===19)al(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=ol(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,cl(t)),sl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Bo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}sl(t,!0,n,null,a,r);break;case`together`:sl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=ol(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),sl(t,!1,i,n,a,r)}return t.child}function ul(e,t,n){var r=t.pendingProps;return va(t,t.type,r.value),Ic(e,t,r.children,n),t.child}function dl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),hd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Sa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Pi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Pi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function fl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ca(e)))}function pl(e,t,n){switch(t.tag){case 3:Oe(t,t.stateNode.containerInfo),va(t,ja,e.memoizedState.cache),pa();break;case 27:case 5:Ae(t);break;case 4:Oe(t,t.stateNode.containerInfo);break;case 10:va(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,No(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Mo(t),t.flags|=128,null;r=Sa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?el(e,t,n):(Mo(t),e=dl(e,t,n),e===null?null:e.sibling)}Mo(t);break;case 19:if(t.flags&128)return ll(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Sa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return ll(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ro(t,Lo.current),r)break;return null;case 22:return t.lanes=0,Bc(e,t,n,t.pendingProps);case 24:va(t,ja,e.memoizedState.cache)}return dl(e,t,n)}function ml(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Fc=!0;else{if(!fl(e,n)&&!(t.flags&128))return Fc=!1,pl(e,t,n);Fc=!!(e.flags&131072)}}else Fc=!1,aa&&t.flags&1048576&&$i(t,Ki,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=to(t.elementType),t.type=e,typeof e==`function`)Ni(e)?(r=wc(e,r),t.tag=1,t=Yc(null,t,e,r,n)):(t.tag=0,t=qc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===ne){t.tag=11,t=Lc(null,t,e,r,n);break a}if(a===ae){t.tag=14,t=Rc(null,t,e,r,n);break a}if(a===te){t.tag=10,t.type=e,t=ul(null,t,n);break a}}throw t=he(e)||e,Error(i(306,t,``))}}return t;case 0:return qc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=wc(r,t.pendingProps),Yc(e,t,r,a,n);case 3:a:{if(Oe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,ho(e,t),So(t,r,null,n);var s=t.memoizedState;if(r=s.cache,va(t,ja,r),r!==o.cache&&xa(t,[ja],n,!0),xo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Xc(e,t,r,n);break a}if(r!==a){a=Hi(Error(i(424)),t),ma(a),t=Xc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ia=gm(e.firstChild),ra=t,aa=!0,oa=null,sa=!0,n=fo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(pa(),r===a){t=dl(e,t,n);break a}Ic(e,t,r,n)}t=t.child}return t;case 26:return Kc(e,t),e===null?(n=Bm(t.type,null,t.pendingProps,null))?t.memoizedState=n:aa||(t.stateNode=Cp(t.type,t.pendingProps,Ee.current,t)):t.memoizedState=Bm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ae(t),e===null&&aa&&(r=t.stateNode=Sm(t.type,t.pendingProps,Ee.current),ra=t,sa=!0,a=ia,Mp(t.type)?(_m=a,ia=gm(r.firstChild)):ia=a),Ic(e,t,t.pendingProps.children,n),Kc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&aa&&((a=r=ia)&&(r=um(r,t.type,t.pendingProps,sa),r===null?a=!1:(t.stateNode=r,ra=t,ia=gm(r.firstChild),sa=!1,a=!0)),a||la(t)),Ae(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,U(a,o)?r=null:s!==null&&U(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=es(e,t,rs,null,null,n),mh._currentValue=a),Kc(e,t),Ic(e,t,r,n),t.child;case 6:return e===null&&aa&&((e=n=ia)&&(n=dm(n,t.pendingProps,sa),n===null?e=!1:(t.stateNode=n,ra=t,ia=null,e=!0)),e||la(t)),null;case 13:return el(e,t,n);case 4:return Oe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=uo(t,null,r,n):Ic(e,t,r,n),t.child;case 11:return Lc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Kc(e,t),Ic(e,t,r,n),t.child;case 8:return Ic(e,t,t.pendingProps.children,n),t.child;case 12:return Ic(e,t,t.pendingProps.children,n),t.child;case 10:return ul(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,wa(t),a=Ta(a),r=r(a),t.flags|=1,Ic(e,t,r,n),t.child;case 14:return Rc(e,t,t.type,t.pendingProps,n);case 15:return zc(e,t,t.type,t.pendingProps,n);case 19:return ll(e,t,n);case 31:return Gc(e,t,n);case 22:return Bc(e,t,n,t.pendingProps);case 24:return wa(t),r=Ta(ja),e===null?(a=Ka(),a===null&&(a=ad,o=Ma(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},mo(t),va(t,ja,a)):((e.lanes&n)!==0&&(ho(e,t),So(t,null,null,n),xo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,va(t,ja,r),r!==a.cache&&xa(t,[ja],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),va(t,ja,r))),Ic(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:aa&&ea(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Kc(e,t),Ic(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function hl(e){e.flags|=4}function gl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?th(t,r):th(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Qd())e.flags|=8192;else throw no=Qa,Xa}}else e.flags&=-16777217}function _l(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!nh(t)){if(Qd())e.flags|=8192;else throw no=Qa,Xa}}function vl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:dt(),e.lanes|=t,yd|=t)}function yl(e,t){if(!aa)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function bl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function xl(e,t,n){var r=t.pendingProps;switch(ta(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bl(t),null;case 1:return bl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ya(ja),ke(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(fa(t)?hl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,B())),bl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(hl(t),o===null?(bl(t),gl(t,a,null,r,n)):(bl(t),_l(t,o))):o?o===e.memoizedState?(bl(t),t.flags&=-16777217):(hl(t),bl(t),_l(t,o)):(e=e.memoizedProps,e!==r&&hl(t),bl(t),gl(t,a,e,r,n)),null;case 27:if(je(t),n=Ee.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return bl(t),t.subtreeFlags&=-33554433,null}e=we.current,fa(t)?ua(t,e):(e=Sm(a,r,n),t.stateNode=e,hl(t))}return bl(t),t.subtreeFlags&=-33554433,null;case 5:if(je(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return bl(t),t.subtreeFlags&=-33554433,null}if(o=we.current,fa(t))ua(t,o);else{var s=bp(Ee.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[Ct]=t,o[wt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(pp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&hl(t)}}return bl(t),t.subtreeFlags&=-33554433,gl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Ee.current,fa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ra,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Ct]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||up(e.nodeValue,n)),e||la(t,!0)}else e=bp(e).createTextNode(r),e[Ct]=t,t.stateNode=e}return bl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=fa(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[Ct]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;bl(t),e=!1}else n=B(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Io(t),t):(Io(t),null);if(t.flags&128)throw Error(i(558))}return bl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=fa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[Ct]=t}else pa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;bl(t),a=!1}else a=B(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Io(t),t):(Io(t),null)}return Io(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),vl(t,t.updateQueue),bl(t),null);case 4:return ke(),e===null&&ep(t.stateNode.containerInfo),t.flags|=67108864,bl(t),null;case 10:return ya(t.type),bl(t),null;case 19:if(zo(t),r=t.memoizedState,r===null)return bl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)yl(r,!1);else{if(md!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Bo(e),o!==null){for(t.flags|=128,yl(r,!1),e=o.updateQueue,t.updateQueue=e,vl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Fi(n,e),n=n.sibling;return Ro(t,Lo.current&1|2),aa&&Qi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&F()>Td&&(t.flags|=128,a=!0,yl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Bo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,vl(t,e),yl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!aa)return bl(t),null}else 2*F()-r.renderingStartTime>Td&&n!==536870912&&(t.flags|=128,a=!0,yl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=F(),e.sibling=null,o=Lo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||aa?Ro(t,o):(n=o,Ce(Ao,t),Ce(Lo,n),jo===null&&(jo=t)),aa&&Qi(t,r.treeForkCount),e}return bl(t),null;case 22:case 23:return Io(t),ko(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(bl(t),t.subtreeFlags&6&&(t.flags|=8192)):bl(t),n=t.updateQueue,n!==null&&vl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Se(Ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ya(ja),bl(t),null;case 25:return null;case 30:return t.flags|=33554432,bl(t),null}throw Error(i(156,t.tag))}function Sl(e,t){switch(ta(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ya(ja),ke(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return je(t),null;case 31:if(t.memoizedState!==null){if(Io(t),t.alternate===null)throw Error(i(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Io(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));pa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return zo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return ke(),null;case 10:return ya(t.type),null;case 22:case 23:return Io(t),ko(),e!==null&&Se(Ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ya(ja),null;case 25:return null;default:return null}}function Cl(e,t){switch(ta(t),t.tag){case 3:ya(ja),ke();break;case 26:case 27:case 5:je(t);break;case 4:ke();break;case 31:t.memoizedState!==null&&Io(t);break;case 13:Io(t);break;case 19:zo(t);break;case 10:ya(t.type);break;case 22:case 23:Io(t),ko(),e!==null&&Se(Ga);break;case 24:ya(ja)}}function wl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Cf(t,t.return,e)}}function Tl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Cf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Cf(t,t.return,e)}}function El(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{wo(t,n)}catch(t){Cf(e,e.return,t)}}}function Dl(e,t,n){n.props=wc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Cf(e,t,n)}}function Ol(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=_i(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Hp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Up(e);m(e.child,!1,am,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Cf(e,t,n)}}function kl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Cf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Cf(e,t,n)}else n.current=null}}function Al(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)sm(e.stateNode,t[n])}function jl(e){for(var t=e.return;t!==null&&(Pl(t)&&sm(e.stateNode,t.stateNode),!Nl(t));)t=t.return}function Ml(e){for(var t=e.return;t!==null&&(Pl(t)&&cm(e.stateNode,t.stateNode),!Nl(t));)t=t.return}function Nl(e){return e.tag===5||e.tag===3||e.tag===27}function Pl(e){return e&&e.tag===7&&e.stateNode!==null}function Fl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Cf(e,e.return,t)}}function Il(e,t,n){try{var r=e.stateNode;hp(r,e.type,n,t),r[wt]=t}catch(t){Cf(e,e.return,t)}}function Ll(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Mp(e.type)||e.tag===4}function Rl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ll(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Mp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function zl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=bn)),Al(e,r),qt=!0;else if(i!==4&&(i===27&&(Al(e,r),r=null,Mp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(zl(e,t,n,r),e=e.sibling;e!==null;)zl(e,t,n,r),e=e.sibling}function Bl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Al(e,r),qt=!0;else if(i!==4&&(i===27&&(Al(e,r),r=null,Mp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Bl(e,t,n,r),e=e.sibling;e!==null;)Bl(e,t,n,r),e=e.sibling}function Vl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);pp(t,r,n),t[Ct]=e,t[wt]=n}catch(t){Cf(e,e.return,t)}}var Hl=!1,Ul=null;function Wl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Hl=!0)}var Gl=null;function Kl(){var e=Gl;return Gl=null,e}var ql=0;function Jl(e,t,n,r,i){return ql=0,Yl(e.child,t,n,r,i)}function Yl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Lp(o);r.push(s),s.view&&(a=!0)}else a||Lp(o).view&&(a=!0);Hl=!0,Fp(o,ql===0?t:t+`_`+ql,n),ql++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Yl(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function Xl(e,t){for(;e!==null;)e.tag===5?Ip(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||Xl(e.child,t),e=e.sibling}function Zl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Zl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=yi(t.default,t.share),t!==`none`&&(Jl(e,n,t,null,!1)||Xl(e.child,!1))}e=e.sibling}}function Ql(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=_i(r,n),a=yi(r.default,n.paired?r.share:r.enter);a===`none`?Zl(e):Jl(e,i,a,null,!1)?(Zl(e),n.paired||t||Hd(e,r.onEnter)):Xl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e,t),e=e.sibling;else Zl(e)}function $l(e){if(Ul!==null&&Ul.size!==0){var t=Ul;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=yi(n.default,n.share);if(a!==`none`&&(Jl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Hd(e,n.onShare)):Xl(e.child,!1)),t.delete(r),t.size===0)break}}}$l(e)}e=e.sibling}}}function eu(e){if(e.tag===30){var t=e.memoizedProps,n=_i(t,e.stateNode),r=Ul===null?void 0:Ul.get(n),i=yi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Jl(e,n,i,null,!1)?r===void 0?Hd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Ul.delete(n),Hd(e,t.onShare)):Xl(e.child,!1)),Ul!==null&&$l(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)eu(e),e=e.sibling;else Ul!==null&&$l(e)}function tu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=_i(t,e.stateNode);t=yi(t.default,t.update),e.flags&=-5,t!==`none`&&Jl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&tu(e);e=e.sibling}}function nu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Xl(e.child,!1))}nu(e)}e=e.sibling}}function ru(e){if(e.tag===30)e.stateNode.paired=null,Xl(e.child,!1),nu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ru(e),e=e.sibling;else nu(e)}function iu(e){for(e=e.child;e!==null;)e.tag===30?Xl(e.child,!1):e.subtreeFlags&33554432&&iu(e),e=e.sibling}function au(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&ql<a.length){var l=a[ql],u=Lp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Fp(c,ql===0?n:n+`_`+ql,i),s&&e.flags&4||(Gl===null&&(Gl=[]),Gl.push(c,ql===0?r:r+`_`+ql,t.memoizedProps)),ql++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:au(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function ou(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=_i(n,r),a=yi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(G)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;ql=0,i=au(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Hd(e,n.onUpdate))}else e.subtreeFlags&33554432&&ou(e,t);e=e.sibling}}var su=!1,cu=!1,lu=!1,uu=!1,du=typeof WeakSet==`function`?WeakSet:Set,fu=null,pu=!1,mu=!1,hu=!1,gu=!1;function _u(e,t,n){if(e=e.containerInfo,vp=Ch,e=qr(e),Jr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(yp={focusedElem:e,selectionRange:r},Ch=!1,n=(n&335544064)===n,fu=t,t=n?9270:1024;fu!==null;){if(e=fu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&eu(r[a]);if(e.alternate===null&&e.flags&2)n&&Wl(e),vu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&eu(r),vu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Wl(e),vu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,fu=r):(n&&tu(e),vu(n))}}Ul=null}function vu(e){for(;fu!==null;){var t=fu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=wc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Cf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)lm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:lm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=_i(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=yi(a.default,a.update),a!==`none`&&Jl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,fu=r;break}fu=t.return}}function yu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:zu(e,n),r&4&&wl(5,n);break;case 1:if(zu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Cf(n,n.return,e)}else{var i=wc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Cf(n,n.return,e)}}}r&64&&El(n),r&512&&Ol(n,n.return);break;case 3:if(zu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{wo(e,t)}catch(e){Cf(n,n.return,e)}}break;case 27:t===null&&r&4&&Vl(n);case 26:case 5:zu(e,n),t===null&&r&4&&Fl(n),r&512&&Ol(n,n.return);break;case 12:zu(e,n);break;case 31:zu(e,n),r&4&&Ou(e,n);break;case 13:zu(e,n),r&4&&ku(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Df.bind(null,n),hm(e,n))));break;case 22:if(r=n.memoizedState!==null||su,!r){var a=t!==null&&t.memoizedState!==null||cu;t=su,i=cu,su=r,(cu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Vu(e,n,r)):zu(e,n),su=t,cu=i}break;case 30:zu(e,n),r&512&&Ol(n,n.return);break;case 7:r&512&&Ol(n,n.return);default:zu(e,n)}}function bu(e,t){for(e=e.child;e!==null;)xu(e,t),e=e.sibling}function xu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){Cf(e,e.return,t)}Su(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,qt=!0}catch(t){Cf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Pp(s,!0):Pp(e.stateNode,!1)}catch(t){Cf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&bu(e,t);break;default:bu(e,t)}}function Su(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:xu(n,r);break a;case 22:n.memoizedState===null&&Su(n,r);break a;default:Su(n,r)}}e=e.sibling}}function Cu(e){var t=e.alternate;t!==null&&(e.alternate=null,Cu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Mt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var wu=null,Tu=!1;function Eu(e,t,n){for(n=n.child;n!==null;)Du(e,t,n),n=n.sibling}function Du(e,t,n){if(L&&typeof L.onCommitFiberUnmount==`function`)try{L.onCommitFiberUnmount(Ze,n)}catch{}switch(n.tag){case 26:cu||kl(n,t),Eu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!cu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:cu||kl(n,t),Ml(n);var r=wu,i=Tu;Mp(n.type)&&(wu=n.stateNode,Tu=!1),Eu(e,t,n),Cm(n.stateNode,n.type,n.memoizedProps),wu=r,Tu=i;break;case 5:cu||kl(n,t),Ml(n);case 6:if(n.tag===6&&Ml(n),r=wu,i=Tu,wu=null,Eu(e,t,n),wu=r,Tu=i,wu!==null){if(Tu)try{(wu.nodeType===9?wu.body:wu.nodeName===`HTML`?wu.ownerDocument.body:wu).removeChild(n.stateNode),qt=!0}catch(e){Cf(n,t,e)}else try{wu.removeChild(n.stateNode),qt=!0}catch(e){Cf(n,t,e)}}break;case 18:wu!==null&&(Tu?(e=wu,Np(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Yh(e)):Np(wu,n.stateNode));break;case 4:r=wu,i=Tu,wu=n.stateNode.containerInfo,Tu=!0,Eu(e,t,n),wu=r,Tu=i;break;case 0:case 11:case 14:case 15:Tl(2,n,t),cu||Tl(4,n,t),Eu(e,t,n);break;case 1:cu||(kl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Dl(n,t,r)),Eu(e,t,n);break;case 21:Eu(e,t,n);break;case 22:cu=(r=cu)||n.memoizedState!==null,Eu(e,t,n),cu=r;break;case 30:kl(n,t),Eu(e,t,n);break;case 7:cu||kl(n,t),Eu(e,t,n);break;default:Eu(e,t,n)}}function Ou(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Yh(e)}catch(e){Cf(t,t.return,e)}}}function ku(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Yh(e)}catch(e){Cf(t,t.return,e)}}function Au(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new du),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new du),t;default:throw Error(i(435,e.tag))}}function ju(e,t){var n=Au(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Of.bind(null,e,t);t.then(r,r)}})}function Mu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Mp(l.type)){wu=l.stateNode,Tu=!1;break a}break;case 5:wu=l.stateNode,Tu=!1;break a;case 3:case 4:wu=l.stateNode.containerInfo,Tu=!0;break a}l=l.return}if(wu===null)throw Error(i(160));Du(s,c,o),wu=null,Tu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Pu(t,e,n),t=t.sibling}var Nu=null;function Pu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Mu(t,e,n),Fu(e),a&4&&(Tl(3,e,e.return),wl(3,e),Tl(5,e,e.return));break;case 1:Mu(t,e,n),Fu(e),a&512&&(cu||r===null||kl(r,r.return)),a&64&&su&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Nu,Mu(t,e,n),Fu(e),a&512&&(cu||r===null||kl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(su)e.stateNode=Cp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[At]||r[Ct]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),pp(r,t,n),r[Ct]=e,Lt(r),t=r;break a;case`link`:if(o=Qm(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),pp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Qm(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),pp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[Ct]=e,Lt(r),t=r}e.stateNode=t}}else su||$m(o,e.type,e.stateNode)}else e.stateNode=qm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Il(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||cu||t.parentNode.removeChild(t)):a.count--,n===null?su||$m(o,e.type,e.stateNode):qm(o,n,e.memoizedProps))}break;case 27:Mu(t,e,n),Fu(e),a&512&&(cu||r===null||kl(r,r.return)),r!==null&&a&4&&Il(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=lu,lu=!1,Mu(t,e,n),lu=o,Fu(e),a&512&&(cu||r===null||kl(r,r.return)),e.flags&32){t=e.stateNode;try{fn(t,``),qt=!0}catch(t){Cf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Il(e,t,r===null?t:r.memoizedProps)),a&1024&&(uu=!0);break;case 6:if(Mu(t,e,n),Fu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,qt=!0}catch(t){Cf(e,e.return,t)}}break;case 3:if(qt=!1,Zm=null,o=Nu,Nu=Dm(t.containerInfo),Mu(t,e,n),Nu=o,Fu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Yh(t.containerInfo)}catch(t){Cf(e,e.return,t)}uu&&(uu=!1,Iu(e)),qt=!1;break;case 4:a=lu,lu=su,r=Jt(),o=Nu,Nu=Dm(e.stateNode.containerInfo),Mu(t,e,n),Fu(e),Nu=o,qt&&mu&&(hu=!0),qt=r,lu=a;break;case 12:Mu(t,e,n),Fu(e);break;case 31:Mu(t,e,n),Fu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ju(e,t)));break;case 13:Mu(t,e,n),Fu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Cd=F()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ju(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=su,l=cu,u=lu;su=c||o,lu=u||o,cu=l||s,Mu(t,e,n),cu=l,lu=u,su=c,Fu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||su||cu||(t=s||cu,n=su,r=cu,su=o||su,cu=t,Bu(e,2),su=n,cu=r),!o&&lu||bu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,ju(e,n))));break;case 19:Mu(t,e,n),Fu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ju(e,t)));break;case 30:a&512&&(cu||r===null||kl(r,r.return)),a=Jt(),o=mu,s=(n&335544064)===n,c=e.memoizedProps,mu=s&&yi(c.default,c.update)!==`none`,Mu(t,e,n),Fu(e),s&&r!==null&&qt&&(e.flags|=4),mu=o,qt=a;break;case 21:break;case 7:a&512&&(cu||r===null||kl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Mu(t,e,n),Fu(e)}}function Fu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ll(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Pl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Nl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Bl(e,Rl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(fn(l,``),n.flags&=-33),Bl(e,Rl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;zl(e,Rl(e),u,s);break;default:throw Error(i(161))}}catch(t){Cf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Iu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Iu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Ch=!0,t.reset(),Ch=!1),e=e.sibling}}function Lu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Ru(t,e),t=t.sibling;else ou(t,!1)}function Ru(e,t){var n=e.alternate;if(n===null)Ql(e,!1);else switch(e.tag){case 3:if(gu=pu=!1,Kl(),Lu(t,e),!pu&&!hu){if(e=Gl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ip(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),gu=!0}Gl=null;break;case 5:Lu(t,e);break;case 4:r=pu,pu=!1,Lu(t,e),pu&&(hu=!0),pu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Lu(t,e):Ql(e,!1));break;case 30:r=pu,i=Kl(),pu=!1,Lu(t,e),pu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=_i(a,o),o=_i(n.memoizedProps,o);var s=yi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,ql=0,t=au(e,n,t,o,s,a,!0),ql!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Hd(e,e.memoizedProps.onUpdate),Gl=i):i!==null&&(i.push.apply(i,Gl),Gl=i),pu=e.flags&32?!0:r;break;default:Lu(t,e)}}function zu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)yu(e,t.alternate,t),t=t.sibling}function Bu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Tl(4,n,n.return),Bu(n,r);break;case 1:kl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Dl(n,n.return,i),Bu(n,r);break;case 27:r&2&&Cm(n.stateNode,n.type,n.memoizedProps);case 5:kl(n,n.return),n.tag!==5&&n.tag!==27||Ml(n),Bu(n,r);break;case 6:Ml(n);break;case 26:kl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||cu||i.parentNode.removeChild(i),Bu(n,r);break;case 22:n.memoizedState===null&&Bu(n,r);break;case 30:kl(n,n.return),Bu(n,r);break;case 7:kl(n,n.return);default:Bu(n,r)}e=e.sibling}}function Vu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Vu(i,a,n),wl(4,a);break;case 1:if(Vu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Cf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)Co(l[i],c)}catch(e){Cf(r,r.return,e)}}s&&o&64&&El(a),Ol(a,a.return);break;case 27:n&2&&Vl(a);case 5:a.tag!==5&&a.tag!==27||jl(a),Vu(i,a,n),s&&r===null&&o&4&&Fl(a),Ol(a,a.return);break;case 6:jl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||su||$m(Dm(c.ownerDocument),a.type,c),Vu(i,a,n),s&&r===null&&o&4&&Fl(a),Ol(a,a.return);break;case 12:Vu(i,a,n);break;case 31:Vu(i,a,n),s&&o&4&&Ou(i,a);break;case 13:Vu(i,a,n),s&&o&4&&ku(i,a);break;case 22:a.memoizedState===null&&Vu(i,a,n),Ol(a,a.return);break;case 30:Vu(i,a,n),Ol(a,a.return);break;case 7:Ol(a,a.return);default:Vu(i,a,n)}t=t.sibling}}function Hu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Na(n))}function Uu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Na(e))}function Wu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Gu(e,t,n,r),t=t.sibling;else i&&iu(t)}function Gu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&ru(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Wu(e,t,n,r),a&2048&&wl(9,t);break;case 1:Wu(e,t,n,r);break;case 3:Wu(e,t,n,r),i&&gu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Na(a)));break;case 12:if(a&2048){Wu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){Cf(t,t.return,e)}}else Wu(e,t,n,r);break;case 31:Wu(e,t,n,r);break;case 13:Wu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&ru(t),o._visibility&2?Wu(e,t,n,r):(o._visibility|=2,Ku(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&ru(s),o._visibility&2?Wu(e,t,n,r):qu(e,t)),a&2048&&Hu(s,t);break;case 24:Wu(e,t,n,r),a&2048&&Uu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Xl(a.child,!0),Xl(t.child,!0))),Wu(e,t,n,r);break;default:Wu(e,t,n,r)}}function Ku(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Ku(a,o,s,c,i),wl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ku(a,o,s,c,i)):u._visibility&2?Ku(a,o,s,c,i):qu(a,o),i&&l&2048&&Hu(o.alternate,o);break;case 24:Ku(a,o,s,c,i),i&&l&2048&&Uu(o.alternate,o);break;default:Ku(a,o,s,c,i)}t=t.sibling}}function qu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:qu(n,r),i&2048&&Hu(r.alternate,r);break;case 24:qu(n,r),i&2048&&Uu(r.alternate,r);break;default:qu(n,r)}t=t.sibling}}var Ju=8192;function Yu(e,t,n){if(e.subtreeFlags&Ju)for(e=e.child;e!==null;)Xu(e,t,n),e=e.sibling}function Xu(e,t,n){switch(e.tag){case 26:Yu(e,t,n),e.flags&Ju&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&ih(n,e)):ah(n,Nu,e.memoizedState,e.memoizedProps));break;case 5:Yu(e,t,n),e.flags&Ju&&(e=e.stateNode,(t&335544128)===t&&ih(n,e));break;case 3:case 4:var r=Nu;Nu=Dm(e.stateNode.containerInfo),Yu(e,t,n),Nu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ju,Ju=16777216,Yu(e,t,n),Ju=r):Yu(e,t,n));break;case 30:if((e.flags&Ju)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Ul===null&&(Ul=new Map),Ul.set(r,i)}Yu(e,t,n);break;default:Yu(e,t,n)}}function Zu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];fu=r,td(r,e)}Zu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)$u(e),e=e.sibling}function $u(e){switch(e.tag){case 0:case 11:case 15:Qu(e),e.flags&2048&&Tl(9,e,e.return);break;case 3:Qu(e);break;case 12:Qu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ed(e)):Qu(e);break;default:Qu(e)}}function ed(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];fu=r,td(r,e)}Zu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Tl(8,t,t.return),ed(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ed(t));break;default:ed(t)}e=e.sibling}}function td(e,t){for(;fu!==null;){var n=fu;switch(n.tag){case 0:case 11:case 15:Tl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Na(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,fu=r;else a:for(n=e;fu!==null;){r=fu;var i=r.sibling,a=r.return;if(Cu(r),r===n){fu=null;break a}if(i!==null){i.return=a,fu=i;break a}fu=a}}}var nd={getCacheForType:function(e){var t=Ta(ja),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ta(ja).controller.signal}},rd=typeof WeakMap==`function`?WeakMap:Map,id=0,ad=null,od=null,sd=0,cd=0,ld=null,ud=!1,dd=!1,fd=!1,pd=0,md=0,hd=0,gd=0,_d=0,vd=0,yd=0,bd=null,xd=null,Sd=!1,Cd=0,wd=0,Td=1/0,Ed=null,Dd=null,Od=0,kd=null,Ad=null,jd=0,Md=0,Nd=null,Pd=null,Fd=null,Id=null,Ld=null,Rd=0,zd=null;function Bd(){return id&2&&sd!==0?sd&-sd:_e.T===null?bt():Wf()}function Vd(){if(vd===0){if(!(sd&536870912)||aa){var e=it;it<<=1,!(it&3932160)&&(it=262144),vd=e}else vd=536870912}return e=Ao.current,e!==null&&(e.flags|=32),vd}function Hd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Hp(_i(e.memoizedProps,n))),Id===null&&(Id=[]),Id.push(t.bind(null,r))}}function Ud(e,t,n){(e===ad&&(cd===2||cd===9)||e.cancelPendingCommit!==null)&&(Xd(e,0),qd(e,sd,vd,!1)),pt(e,n),id&2&&e===ad||(e===ad&&(!(id&2)&&(gd|=n),md===4&&qd(e,sd,vd,!1)),If(e))}function Wd(e,t,n){if(id&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ct(e,t),a=r?af(e,t):nf(e,t,!0),o=r;do{if(a===0){dd&&!r&&qd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Kd(n))a=nf(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=bd;var l=c.current.memoizedState.isDehydrated;if(l&&(Xd(c,s).flags|=256),s=nf(c,s,!1),s!==2&&s!==6){if(fd&&!l){c.errorRecoveryDisabledLanes|=o,gd|=o,a=4;break a}o=xd,xd=a,o!==null&&(xd===null?xd=o:xd.push.apply(xd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Xd(e,0),qd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:qd(r,t,vd,!ud);break a;case 2:xd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Cd+300-F(),10<a)){if(qd(r,t,vd,!ud),st(r,0,!0)!==0)break a;jd=t,r.timeoutHandle=Ep(Gd.bind(null,r,n,xd,Ed,Sd,t,vd,gd,yd,ud,o,`Throttled`,-0,0),a);break a}Gd(r,n,xd,Ed,Sd,t,vd,gd,yd,ud,o,null,-0,0)}break}}while(1);If(e)}function Gd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:bn},Ul=null,Xu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=lh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?Cd-F():(a&4194048)===a?wd-F():0,m=sh(d,m),m!==null)?(jd=a,e.cancelPendingCommit=m(ff.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),qd(e,a,o,!l)):ff(e,t,a,n,r,i,o,s,c,l,u,d)}function Kd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Vr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function qd(e,t,n,r){t=lt(e,t),t&=~_d,t&=~gd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-$e(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ht(e,n,t)}function Jd(){return id&6?!0:(Lf(0,!1),!1)}function Yd(){if(od!==null){if(cd===0)var e=od.return;else e=od,_a=ga=null,os(e),io=null,ao=0,e=od;for(;e!==null;)Cl(e.alternate,e),e=e.return;od=null}}function Xd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Dp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),jd=0,Yd(),ad=e,od=n=Pi(e.current,null),sd=t,cd=0,ld=null,ud=!1,dd=ct(e,t),fd=!1,yd=vd=_d=gd=hd=md=0,xd=bd=null,Sd=!1,pd=lt(e,t),wi(),n}function Zd(e,t){Ho=null,_e.H=gc,t===Ya||t===Za?(t=V(),cd=3):t===Xa?(t=V(),cd=4):cd=t===Pc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ld=t,od===null&&(md=1,Oc(e,Hi(t,e.current)))}function Qd(){var e=Ao.current;return e===null?!0:(sd&4194048)===sd?jo===null:(sd&62914560)===sd||sd&536870912?e===jo:!1}function $d(){var e=_e.H;return _e.H=gc,e===null?gc:e}function ef(){var e=_e.A;return _e.A=nd,e}function tf(){md=4,ud||(sd&4194048)!==sd&&Ao.current!==null||(dd=!0),!(hd&134217727)&&!(gd&134217727)||ad===null||qd(ad,sd,vd,!1)}function nf(e,t,n){var r=id;id|=2;var i=$d(),a=ef();(ad!==e||sd!==t)&&(Ed=null,Xd(e,t)),t=!1;var o=md;a:do try{if(cd!==0&&od!==null){var s=od,c=ld;switch(cd){case 8:Yd(),o=6;break a;case 3:case 2:case 9:case 6:Ao.current===null&&(t=!0);var l=cd;if(cd=0,ld=null,lf(e,s,c,l),n&&dd){o=0;break a}break;default:l=cd,cd=0,ld=null,lf(e,s,c,l)}}rf(),o=md;break}catch(t){Zd(e,t)}while(1);return t&&e.shellSuspendCounter++,_a=ga=null,id=r,_e.H=i,_e.A=a,od===null&&(ad=null,sd=0,wi()),o}function rf(){for(;od!==null;)sf(od)}function af(e,t){var n=id;id|=2;var r=$d(),a=ef();ad!==e||sd!==t?(Ed=null,Td=F()+500,Xd(e,t)):dd=ct(e,t);a:do try{if(cd!==0&&od!==null){t=od;var o=ld;b:switch(cd){case 1:cd=0,ld=null,lf(e,t,o,1);break;case 2:case 9:if($a(o)){cd=0,ld=null,cf(t);break}t=function(){cd!==2&&cd!==9||ad!==e||(cd=7),If(e)},o.then(t,t);break a;case 3:cd=7;break a;case 4:cd=5;break a;case 7:$a(o)?(cd=0,ld=null,cf(t)):(cd=0,ld=null,lf(e,t,o,7));break;case 5:var s=null;switch(od.tag){case 26:s=od.memoizedState;case 5:case 27:var c=od;if(s?nh(s):c.stateNode.complete){cd=0,ld=null;var l=c.sibling;if(l!==null)od=l;else{var u=c.return;u===null?od=null:(od=u,uf(u))}break b}}cd=0,ld=null,lf(e,t,o,5);break;case 6:cd=0,ld=null,lf(e,t,o,6);break;case 8:Yd(),md=6;break a;default:throw Error(i(462))}}of();break}catch(t){Zd(e,t)}while(1);return _a=ga=null,_e.H=r,_e.A=a,id=n,od===null?(ad=null,sd=0,wi(),md):0}function of(){for(;od!==null&&!He();)sf(od)}function sf(e){var t=ml(e.alternate,e,pd);e.memoizedProps=e.pendingProps,t===null?uf(e):od=t}function cf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Jc(n,t,t.pendingProps,t.type,void 0,sd);break;case 11:t=Jc(n,t,t.pendingProps,t.type.render,t.ref,sd);break;case 5:os(t);var r=t;r===ra&&(aa?(da(r),r.tag===5&&r.stateNode!=null&&(ia=r.stateNode)):(da(r),aa=!0));default:Cl(n,t),t=od=Fi(t,pd),t=ml(n,t,pd)}e.memoizedProps=e.pendingProps,t===null?uf(e):od=t}function lf(e,t,n,r){_a=ga=null,os(t),io=null,ao=0;var i=t.return;try{if(Nc(e,i,t,n,sd)){md=1,Oc(e,Hi(n,e.current)),od=null;return}}catch(t){if(i!==null)throw od=i,t;md=1,Oc(e,Hi(n,e.current)),od=null;return}t.flags&32768?(aa||r===1?e=!0:dd||sd&536870912?e=!1:(ud=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ao.current,r!==null&&r.tag===13&&(r.flags|=16384))),df(t,e)):uf(t)}function uf(e){var t=e;do{if(t.flags&32768){df(t,ud);return}e=t.return;var n=xl(t.alternate,t,pd);if(n!==null){od=n;return}if(t=t.sibling,t!==null){od=t;return}od=t=e}while(t!==null);md===0&&(md=5)}function df(e,t){do{var n=Sl(e.alternate,e);if(n!==null){n.flags&=32767,od=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){od=e;return}od=e=n}while(e!==null);md=6,od=null}function ff(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do bf();while(Od!==0);if(id&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===ad&&(od=ad=null,sd=0),Ad=t,kd=e,jd=n,Nd=a,Pd=r,pf(e,t,n,s,c,l,f)}}function pf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Md=s,s|=Ci,mt(e,n,s,r,i,a),Id=null,(n&335544064)===n?(Ld=Ia(e),r=10262):(Ld=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,kf(qe,function(){return xf(),null})):(e.callbackNode=null,e.callbackPriority=0),Hl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=_e.T,_e.T=null,i=ve.p,ve.p=2,a=id,id|=4;try{_u(e,t,n)}finally{id=a,ve.p=i,_e.T=r}}Od=1,Hl?Fd=Bp(o,e.containerInfo,Ld,gf,_f,hf,vf,xf,mf,null,null):(gf(),_f(),vf())}function mf(e){if(Od!==0){var t=kd.onRecoverableError;t(e,{componentStack:null})}}function hf(){Od===3&&(Od=0,Ru(Ad,kd),Od=4)}function gf(){if(Od===1){Od=0;var e=kd,t=Ad,n=jd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=_e.T,_e.T=null;var i=ve.p;ve.p=2;var a=id;id|=4;try{mu=hu=!1,Pu(t,e,n),n=yp;var o=qr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Kr(s.ownerDocument.documentElement,s)){if(c!==null&&Jr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Gr(s,h),v=Gr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Ch=!!vp,yp=vp=null}finally{id=a,ve.p=i,_e.T=r}}e.current=t,Od=2}}function _f(){if(Od===2){Od=0;var e=kd,t=Ad,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=_e.T,_e.T=null;var r=ve.p;ve.p=2;var i=id;id|=4;try{yu(e,t.alternate,t)}finally{id=i,ve.p=r,_e.T=n}}Od=3}}function vf(){if(Od===4||Od===3){Od=0;var e=Fd;Fd=null,Ue();var t=kd,n=Ad,r=jd,i=Pd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Od=5:(Od=0,Ad=kd=null,yf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Dd=null),yt(r),n=n.stateNode,L&&typeof L.onCommitFiberRoot==`function`)try{L.onCommitFiberRoot(Ze,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=_e.T,a=ve.p,ve.p=2,_e.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{_e.T=n,ve.p=a}}if(i=Id,o=Ld,Ld=null,i!==null&&(Id=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);jd&3&&bf(),If(t),a=t.pendingLanes,r&261930&&a&42?t===zd?Rd++:(Rd=0,zd=t):(Rd=0,zd=null),Lf(0,!1)}}function yf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Na(t)))}function bf(){return Fd!==null&&(Fd.skipTransition(),Fd=null),gf(),_f(),vf(),xf()}function xf(){if(Od!==5)return!1;var e=kd,t=Md;Md=0;var n=yt(jd),r=_e.T,a=ve.p;try{ve.p=32>n?32:n,_e.T=null,n=Nd,Nd=null;var o=kd,s=jd;if(Od=0,Ad=kd=null,jd=0,id&6)throw Error(i(331));var c=id;if(id|=4,$u(o.current),Gu(o,o.current,s,n),id=c,Lf(0,!1),L&&typeof L.onPostCommitFiberRoot==`function`)try{L.onPostCommitFiberRoot(Ze,o)}catch{}return!0}finally{ve.p=a,_e.T=r,yf(e,t)}}function Sf(e,t,n){t=Hi(n,t),t=Ac(e.stateNode,t,2),e=_o(e,t,2),e!==null&&(pt(e,2),If(e))}function Cf(e,t,n){if(e.tag===3)Sf(e,e,n);else for(;t!==null;){if(t.tag===3){Sf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Dd===null||!Dd.has(r))){e=Hi(n,e),n=jc(2),r=_o(t,n,2),r!==null&&(Mc(n,r,t,e),pt(r,2),If(r));break}}t=t.return}}function wf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new rd;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(fd=!0,i.add(n),e=Tf.bind(null,e,t,n),t.then(e,e))}function Tf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ad===e&&(sd&n)===n&&(md===4||md===3&&(sd&62914560)===sd&&300>F()-Cd?id&2?_d|=n:Xd(e,0):_d|=n,yd===sd&&(yd=0)),If(e)}function Ef(e,t){t===0&&(t=dt()),e=Di(e,t),e!==null&&(pt(e,t),If(e))}function Df(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ef(e,n)}function Of(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Ef(e,n)}function kf(e,t){return Be(e,t)}var Af=null,jf=null,Mf=!1,Nf=!1,Pf=!1,Ff=0;function If(e){e!==jf&&e.next===null&&(jf===null?Af=jf=e:jf=jf.next=e),Nf=!0,Mf||(Mf=!0,Uf())}function Lf(e,t){if(!Pf&&Nf){Pf=!0;do for(var n=!1,r=Af;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-$e(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Hf(r,a))}else a=sd,a=st(r,r===ad?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ct(r,a)||(n=!0,Hf(r,a))}r=r.next}while(n);Pf=!1}}function Rf(){zf()}function zf(){Nf=Mf=!1;var e=0;Ff!==0&&Tp()&&(e=Ff);for(var t=F(),n=null,r=Af;r!==null;){var i=r.next,a=Bf(r,t);a===0?(r.next=null,n===null?Af=i:n.next=i,i===null&&(jf=n)):(n=r,(e!==0||a&3)&&(Nf=!0)),r=i}Od!==0&&Od!==5||Lf(e,!1),Ff!==0&&(Ff=0)}function Bf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-$e(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ut(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=ad,n=sd,n=st(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(cd===2||cd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ve(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ct(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ve(r),yt(n)){case 2:case 8:n=Ke;break;case 32:n=qe;break;case 268435456:n=I;break;default:n=qe}return r=Vf.bind(null,e),n=Be(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ve(r),e.callbackPriority=2,e.callbackNode=null,2}function Vf(e,t){if(Od!==0&&Od!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(bf()&&e.callbackNode!==n)return null;var r=sd;return r=st(e,e===ad?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Wd(e,r,t),Bf(e,F()),e.callbackNode!=null&&e.callbackNode===n?Vf.bind(null,e):null)}function Hf(e,t){if(bf())return null;Wd(e,t,!0)}function Uf(){Ap(function(){id&6?Be(Ge,Rf):zf()})}function Wf(){if(Ff===0){var e=za;e===0&&(e=rt,rt<<=1,!(rt&261888)&&(rt=256)),Ff=e}return Ff}function Gf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:yn(e)}function Kf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Gf((i[wt]||null).action),o=r.submitter;o&&(t=(t=o[wt]||null)?Gf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Bn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Ff!==0){var e=new FormData(i,o);nc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),nc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var qf=0;qf<mi.length;qf++){var Jf=mi[qf];hi(Jf.toLowerCase(),`on`+(Jf[0].toUpperCase()+Jf.slice(1)))}hi(oi,`onAnimationEnd`),hi(si,`onAnimationIteration`),hi(ci,`onAnimationStart`),hi(`dblclick`,`onDoubleClick`),hi(`focusin`,`onFocus`),hi(`focusout`,`onBlur`),hi(li,`onTransitionRun`),hi(ui,`onTransitionStart`),hi(di,`onTransitionCancel`),hi(fi,`onTransitionEnd`),Ht(`onMouseEnter`,[`mouseout`,`mouseover`]),Ht(`onMouseLeave`,[`mouseout`,`mouseover`]),Ht(`onPointerEnter`,[`pointerout`,`pointerover`]),Ht(`onPointerLeave`,[`pointerout`,`pointerover`]),Vt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Vt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Vt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Vt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Vt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Vt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Yf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Xf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Yf));function Zf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){bi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){bi(e)}i.currentTarget=null,a=c}}}}function Qf(e,t){var n=t[Et];n===void 0&&(n=t[Et]=new Set);var r=e+`__bubble`;n.has(r)||(tp(t,e,2,!1),n.add(r))}function H(e,t,n){var r=0;t&&(r|=4),tp(n,e,r,t)}var $f=`_reactListening`+Math.random().toString(36).slice(2);function ep(e){if(!e[$f]){e[$f]=!0,zt.forEach(function(t){t!==`selectionchange`&&(Xf.has(t)||H(t,!1,e),H(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$f]||(t[$f]=!0,H(`selectionchange`,!1,t))}}function tp(e,t,n,r){switch(Ah(t)){case 2:var i=wh;break;case 8:i=Th;break;default:i=Eh}n=i.bind(null,t,n,e),i=void 0,!kn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function np(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=Nt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}Dn(function(){var r=a,i=Sn(n),s=[];a:{var c=pi.get(e);if(c!==void 0){var l=Bn,u=e;switch(e){case`keypress`:if(Fn(n)===0)break a;case`keydown`:case`keyup`:l=ir;break;case`focusin`:u=`focus`,l=Yn;break;case`focusout`:u=`blur`,l=Yn;break;case`beforeblur`:case`afterblur`:l=Yn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=qn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Jn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=sr;break;case oi:case si:case ci:l=Xn;break;case fi:l=cr;break;case`scroll`:case`scrollend`:l=Hn;break;case`wheel`:l=lr;break;case`copy`:case`cut`:case`paste`:l=Zn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=ar;break;case`submit`:l=or;break;case`toggle`:case`beforetoggle`:l=ur}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=On(m,p),g!=null&&d.push(rp(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==xn&&(u=n.relatedTarget||n.fromElement)&&(Nt(u)||u[Tt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Nt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=qn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=ar,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Ft(c),h=l==null?u:Ft(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Nt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,ap):null,c!==null&&op(s,u,c,d,!1),l!==null&&f!==null&&op(s,f,l,d,!0)))}a:{if(c=r?Ft(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Ar;else if(wr(c)){if(jr)_=zr;else{_=Lr;var v=z}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&gn(r.elementType)&&(_=Ar):_=Rr;if(_&&=_(e,r)){Tr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Ft(r):window,e){case`focusin`:(wr(v)||v.contentEditable===`true`)&&(Xr=v,Zr=r,Qr=null);break;case`focusout`:Qr=Zr=Xr=null;break;case`mousedown`:$r=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:$r=!1,ei(s,n,i);break;case`selectionchange`:if(Yr)break;case`keydown`:case`keyup`:ei(s,n,i)}var y;if(fr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else br?vr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(hr&&n.locale!==`ko`&&(br||b!==`onCompositionStart`?b===`onCompositionEnd`&&br&&(y=Pn()):(jn=i,Mn=`value`in jn?jn.value:jn.textContent,br=!0)),v=ip(r,b),0<v.length&&(b=new Qn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=yr(n),y!==null&&(b.data=y)))),(y=mr?xr(e,n):Sr(e,n))&&(b=ip(r,`onBeforeInput`),0<b.length&&(v=new Qn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Kf(s,e,r,n,i)}Zf(s,t)})}function rp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ip(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=On(e,n),i!=null&&r.unshift(rp(e,i,a)),i=On(e,t),i!=null&&r.push(rp(e,i,a))),e.tag===3)return r;e=e.return}return[]}function ap(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function op(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=On(n,a),l!=null&&o.unshift(rp(n,l,c))):i||(l=On(n,a),l!=null&&o.push(rp(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var sp=/\r\n?/g,cp=/\u0000|\uFFFD/g;function lp(e){return(typeof e==`string`?e:``+e).replace(sp,`
9
9
  `).replace(cp,``)}function up(e,t){return t=lp(t),lp(e)===t}function dp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||fn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&fn(e,``+r);else return;break;case`className`:Xt(e,`class`,r);break;case`tabIndex`:Xt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Xt(e,n,r);break;case`style`:hn(e,r,o);return;case`data`:if(t!==`object`){Xt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=yn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&dp(e,t,`name`,a.name,a,null),dp(e,t,`formEncType`,a.formEncType,a,null),dp(e,t,`formMethod`,a.formMethod,a,null),dp(e,t,`formTarget`,a.formTarget,a,null)):(dp(e,t,`encType`,a.encType,a,null),dp(e,t,`method`,a.method,a,null),dp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=yn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=bn);return;case`onScroll`:r!=null&&Qf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Qf(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=yn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Qf(`beforetoggle`,e),Qf(`toggle`,e),Yt(e,`popover`,r);break;case`xlinkActuate`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Yt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=_n.get(n)||n,Yt(e,n,r);else return}qt=!0}function fp(e,t,n,r,a,o){switch(n){case`style`:hn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)fn(e,r);else if(typeof r==`number`||typeof r==`bigint`)fn(e,``+r);else return;break;case`onScroll`:r!=null&&Qf(`scroll`,e);return;case`onScrollEnd`:r!=null&&Qf(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=bn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Bt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[wt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}qt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Yt(e,n,r)}return}qt=!0}function pp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Qf(`error`,e),Qf(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:dp(e,t,o,s,n,null)}}a&&dp(e,t,`srcSet`,n.srcSet,n,null),r&&dp(e,t,`src`,n.src,n,null);return;case`input`:Qf(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:dp(e,t,r,d,n,null)}}sn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Qf(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:dp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&ln(e,!!r,n,!0):ln(e,!!r,t,!1);return;case`textarea`:for(s in Qf(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:dp(e,t,s,c,n,null)}dn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:dp(e,t,l,r,n,null)}return;case`dialog`:Qf(`beforetoggle`,e),Qf(`toggle`,e),Qf(`cancel`,e),Qf(`close`,e);break;case`iframe`:case`object`:Qf(`load`,e);break;case`video`:case`audio`:for(r=0;r<Yf.length;r++)Qf(Yf[r],e);break;case`image`:Qf(`error`,e),Qf(`load`,e);break;case`details`:Qf(`toggle`,e);break;case`embed`:case`source`:case`link`:Qf(`error`,e),Qf(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:dp(e,t,u,r,n,null)}return;default:if(gn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&fp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&dp(e,t,c,r,n,null))}var mp={};function hp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||dp(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(qt=!0),o=m;break;case`name`:m!==f&&(qt=!0),a=m;break;case`checked`:m!==f&&(qt=!0),u=m;break;case`defaultChecked`:m!==f&&(qt=!0),d=m;break;case`value`:m!==f&&(qt=!0),s=m;break;case`defaultValue`:m!==f&&(qt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&dp(e,t,p,m,r,f)}}on(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||dp(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(qt=!0),p=o;break;case`defaultValue`:o!==l&&(qt=!0),c=o;break;case`multiple`:o!==l&&(qt=!0),s=o;default:o!==l&&dp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?ln(e,!!n,n?[]:``,!1):ln(e,!!n,t,!0)):ln(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:dp(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(qt=!0),p=a;break;case`defaultValue`:a!==o&&(qt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&dp(e,t,s,a,r,o)}un(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:dp(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(qt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:dp(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&dp(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:dp(e,t,u,p,r,m)}return;default:if(gn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&fp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||fp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&dp(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||dp(e,t,f,p,r,m)}function gp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function _p(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&gp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&gp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var vp=null,yp=null;function bp(e){return e.nodeType===9?e:e.ownerDocument}function xp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Sp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Cp(e,t,n,r){return n=bp(n).createElement(e),n[Ct]=r,n[wt]=t,pp(n,e,t),Lt(n),n}function U(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var wp=null;function Tp(){var e=window.event;return e&&e.type===`popstate`?e!==wp&&(wp=e,!0):(wp=null,!1)}var Ep=typeof setTimeout==`function`?setTimeout:void 0,Dp=typeof clearTimeout==`function`?clearTimeout:void 0,Op=typeof Promise==`function`?Promise:void 0,kp=typeof requestAnimationFrame==`function`?requestAnimationFrame:Ep,Ap=typeof queueMicrotask==`function`?queueMicrotask:Op===void 0?Ep:function(e){return Op.resolve(null).then(e).catch(jp)};function jp(e){setTimeout(function(){throw e})}function Mp(e){return e===`head`}function Np(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Yh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)wm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,wm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[At]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&wm(e.ownerDocument.body)}n=i}while(n);Yh(t)}function Pp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Fp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Ip(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function W(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Lp(e){return W(e.getBoundingClientRect(),getComputedStyle(e),e)}function G(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return W(t,n,e)}function Rp(e){return e.documentElement.clientHeight}function zp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Bp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Rp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=rh(f),u>oh){s.length=o;break}f=new Promise(zp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Vp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Vp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Vp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Vp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Hp(e){return{name:e,group:new Vp(`group`,e),imagePair:new Vp(`image-pair`,e),old:new Vp(`old`,e),new:new Vp(`new`,e)}}function Up(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Up.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Jp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Kp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Wp,e,s,r)}this._eventListeners=a}};function Wp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Up.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Jp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Kp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Gp,e,n,i),r.splice(t,1),a!==null&&a()}};function Gp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Kp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function qp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Jp(e,t,n,r){if(e.length===0)return-1;r=qp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&qp(a.optionsOrUseCapture)===r)return i}return-1}Up.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Kp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Kp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Up.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Yp,e,void 0,void 0)};function Yp(e,t){return e.tag!==6&&(e=b(e),bm(e,t))}Up.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Xp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Yp(t[n],e);n--);};function Xp(e,t){return t.push(e),!1}Up.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=bp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Zp,e,void 0,void 0))};function Zp(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Up.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Qp,e,void 0,void 0)};function Qp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Up.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,K,e,void 0,void 0);for(var n=t=0;n<$p.length;n++){var r=$p[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):$p[t++]=r}$p.length=t}};function K(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var $p=[],em=!1;function tm(e,t,n){$p.push({fragmentInstance:e,observer:t,instance:n}),em||(em=!0,xm(function(){em=!1;var e=$p;$p=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Up.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,nm,e,void 0,void 0),e};function nm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Up.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Up.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Xp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||rm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function rm(e,t,n,r,i){var a=Nt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(m(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(m(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function im(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Up.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Xp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),im(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),im(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function am(e,t){return e=b(e),om(e,t),!1}function om(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function sm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Kp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<$p.length;i++){var a=$p[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&($p[r++]=a)}$p.length=r,n.observe(e)}),om(e,t))}function cm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Kp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?tm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function lm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:lm(n),Mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function um(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[At])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=gm(e.nextSibling),e===null)break}return null}function dm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=gm(e.nextSibling),e===null))return null;return e}function fm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=gm(e.nextSibling),e===null))return null;return e}function pm(e){return e.data===`$?`||e.data===`$~`}function mm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function hm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function gm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var _m=null;function vm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return gm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function ym(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function bm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function xm(e){kp(function(){kp(function(t){return e(t)})})}function Sm(e,t,n){switch(t=bp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Cm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&dp(e,t,r,null,mp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===bn&&(e.onclick=null),Mt(e)}function wm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Mt(e)}var Tm=new Map,Em=new Set;function Dm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Om=ve.d;ve.d={f:km,r:Am,D:Nm,C:Pm,L:Fm,m:Im,X:Rm,S:Lm,M:zm};function km(){var e=Om.f(),t=Jd();return e||t}function Am(e){var t=Pt(e);t!==null&&t.tag===5&&t.type===`form`?ic(t):Om.r(e)}var jm=typeof document>`u`?null:document;function Mm(e,t,n){var r=jm;if(r&&typeof t==`string`&&t){var i=an(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Em.has(i)||(Em.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),pp(t,`link`,e),Lt(t),r.head.appendChild(t)))}}function Nm(e){Om.D(e),Mm(`dns-prefetch`,e,null)}function Pm(e,t){Om.C(e,t),Mm(`preconnect`,e,t)}function Fm(e,t,n){Om.L(e,t,n);var r=jm;if(r&&e&&t){var i=`link[rel="preload"][as="`+an(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+an(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+an(n.imageSizes)+`"]`)):i+=`[href="`+an(e)+`"]`;var a=i;switch(t){case`style`:a=Vm(e);break;case`script`:a=Gm(e)}if(!(Tm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Tm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Hm(a))||t===`script`&&r.querySelector(Km(a))))){var o=r.createElement(`link`);pp(o,`link`,e),t===`style`&&(o[jt]=!0,o.onload=o.onerror=function(){Rt(o)}),Lt(o),r.head.appendChild(o)}}}function Im(e,t){Om.m(e,t);var n=jm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+an(r)+`"][href="`+an(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Gm(e)}if(!Tm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),Tm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Km(a)))return}r=n.createElement(`link`),pp(r,`link`,e),Lt(r),n.head.appendChild(r)}}}function Lm(e,t,n){Om.S(e,t,n);var r=jm;if(r&&e){var i=It(r).hoistableStyles,a=Vm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Hm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Tm.get(a))&&Ym(e,n);var c=o=r.createElement(`link`);Lt(c),pp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Jm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Rm(e,t){Om.X(e,t);var n=jm;if(n&&e){var r=It(n).hoistableScripts,i=Gm(e),a=r.get(i);a||(a=n.querySelector(Km(i)),a||(e=D({src:e,async:!0},t),(t=Tm.get(i))&&Xm(e,t),a=n.createElement(`script`),Lt(a),pp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zm(e,t){Om.M(e,t);var n=jm;if(n&&e){var r=It(n).hoistableScripts,i=Gm(e),a=r.get(i);a||(a=n.querySelector(Km(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=Tm.get(i))&&Xm(e,t),a=n.createElement(`script`),Lt(a),pp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bm(e,t,n,r){var a=(a=Ee.current)?Dm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Vm(n.href),t=It(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Vm(n.href);var o=It(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Hm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Tm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Tm.set(e,o)),Wm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Gm(n),t=It(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Vm(e){return`href="`+an(e)+`"`}function Hm(e){return`link[rel="stylesheet"][`+e+`]`}function Um(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Wm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[jt]){r.loading=1;return}}else t=e.createElement(`link`),t[jt]=!0,t.onload=t.onerror=Rt.bind(null,t),pp(t,`link`,n),Lt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Gm(e){return`[src="`+an(e)+`"]`}function Km(e){return`script[async]`+e}function qm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+an(n.href)+`"]`);if(r)return t.instance=r,Lt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Lt(r),pp(r,`style`,a),Jm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Vm(n.href);var o=e.querySelector(Hm(a));if(o)return t.state.loading|=4,t.instance=o,Lt(o),o;r=Um(n),(a=Tm.get(a))&&Ym(r,a),o=(e.ownerDocument||e).createElement(`link`),Lt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),pp(o,`link`,r),t.state.loading|=4,Jm(o,n.precedence,e),t.instance=o;case`script`:return o=Gm(n.src),(a=e.querySelector(Km(o)))?(t.instance=a,Lt(a),a):(r=n,(a=Tm.get(o))&&(r=D({},n),Xm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Lt(a),pp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Jm(r,n.precedence,e));return t.instance}function Jm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Ym(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Xm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Zm=null;function Qm(e,t,n){if(Zm===null){var r=new Map,i=Zm=new Map;i.set(n,r)}else i=Zm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[At]||a[Ct]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function $m(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function eh(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function th(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function nh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function rh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ih(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=rh(t),e.suspenseyImages.push(t)),e=uh.bind(e),t.decode().then(e,e))}function ah(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Vm(r.href),a=t.querySelector(Hm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=lh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Lt(a);return}a=t.ownerDocument||t,r=Um(r),(i=Tm.get(i))&&Ym(r,i),a=a.createElement(`link`),Lt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),pp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=lh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var oh=0;function sh(e,t){return e.stylesheets&&e.count===0&&fh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&fh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&oh===0&&(oh=62500*_p());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&fh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>oh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ch(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)fh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function lh(){this.count--,ch(this)}function uh(){this.imgCount--,ch(this)}var dh=null;function fh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,dh=new Map,t.forEach(ph,e),dh=null,lh.call(e))}function ph(e,t){if(!(t.state.loading&4)){var n=dh.get(e);if(n)var r=n.get(null);else{n=new Map,dh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=lh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var mh={$$typeof:te,Provider:null,Consumer:null,_currentValue:P,_currentValue2:P,_threadCount:0};function hh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ft(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ft(0),this.hiddenUpdates=ft(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function gh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new hh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Mi(3,null,null,t),e.current=a,a.stateNode=e,t=Ma(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},mo(a),e}function _h(e){return e?(e=Ai,e):Ai}function vh(e,t,n,r,i,a){i=_h(i),r.context===null?r.context=i:r.pendingContext=i,r=go(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=_o(e,r,t),n!==null&&(Ud(n,e,t),vo(n,e,t))}function yh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function bh(e,t){yh(e,t),(e=e.alternate)&&yh(e,t)}function xh(e){if(e.tag===13||e.tag===31){var t=Di(e,67108864);t!==null&&Ud(t,e,67108864),bh(e,67108864)}}function Sh(e){if(e.tag===13||e.tag===31){var t=Bd();t=vt(t);var n=Di(e,t);n!==null&&Ud(n,e,t),bh(e,t)}}var Ch=!0;function wh(e,t,n,r){var i=_e.T;_e.T=null;var a=ve.p;try{ve.p=2,Eh(e,t,n,r)}finally{ve.p=a,_e.T=i}}function Th(e,t,n,r){var i=_e.T;_e.T=null;var a=ve.p;try{ve.p=8,Eh(e,t,n,r)}finally{ve.p=a,_e.T=i}}function Eh(e,t,n,r){if(Ch){var i=Dh(r);if(i===null)np(e,t,r,Oh,n),zh(e,r);else if(Vh(i,e,t,n,r))r.stopPropagation();else if(zh(e,r),t&4&&-1<Rh.indexOf(e)){for(;i!==null;){var a=Pt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ot(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-$e(o);s.entanglements[1]|=c,o&=~c}If(a),!(id&6)&&(Td=F()+500,Lf(0,!1))}}break;case 31:case 13:s=Di(a,2),s!==null&&Ud(s,a,2),Jd(),bh(a,2)}if(a=Dh(r),a===null&&np(e,t,r,Oh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else np(e,t,r,null,n)}}function Dh(e){return e=Sn(e),kh(e)}var Oh=null;function kh(e){if(Oh=null,e=Nt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Oh=e,null}function Ah(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(We()){case Ge:return 2;case Ke:return 8;case qe:case Je:return 32;case I:return 268435456;default:return 32}default:return 32}}var jh=!1,Mh=null,Nh=null,Ph=null,Fh=new Map,Ih=new Map,Lh=[],Rh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function zh(e,t){switch(e){case`focusin`:case`focusout`:Mh=null;break;case`dragenter`:case`dragleave`:Nh=null;break;case`mouseover`:case`mouseout`:Ph=null;break;case`pointerover`:case`pointerout`:Fh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ih.delete(t.pointerId)}}function Bh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Pt(t),t!==null&&xh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Vh(e,t,n,r,i){switch(t){case`focusin`:return Mh=Bh(Mh,e,t,n,r,i),!0;case`dragenter`:return Nh=Bh(Nh,e,t,n,r,i),!0;case`mouseover`:return Ph=Bh(Ph,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Fh.set(a,Bh(Fh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ih.set(a,Bh(Ih.get(a)||null,e,t,n,r,i)),!0}return!1}function Hh(e){var t=Nt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,xt(e.priority,function(){Sh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,xt(e.priority,function(){Sh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Uh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Dh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);xn=r,n.target.dispatchEvent(r),xn=null}else return t=Pt(n),t!==null&&xh(t),e.blockedOn=n,!1;t.shift()}return!0}function Wh(e,t,n){Uh(e)&&n.delete(t)}function Gh(){jh=!1,Mh!==null&&Uh(Mh)&&(Mh=null),Nh!==null&&Uh(Nh)&&(Nh=null),Ph!==null&&Uh(Ph)&&(Ph=null),Fh.forEach(Wh),Ih.forEach(Wh)}function Kh(e,n){e.blockedOn===n&&(e.blockedOn=null,jh||(jh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Gh)))}var qh=null;function Jh(e){qh!==e&&(qh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){qh===e&&(qh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(kh(r||n)===null)continue;break}var a=Pt(n);a!==null&&(e.splice(t,3),t-=3,nc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Yh(e){function t(t){return Kh(t,e)}Mh!==null&&Kh(Mh,e),Nh!==null&&Kh(Nh,e),Ph!==null&&Kh(Ph,e),Fh.forEach(t),Ih.forEach(t);for(var n=0;n<Lh.length;n++){var r=Lh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Lh.length&&(n=Lh[0],n.blockedOn===null);)Hh(n),n.blockedOn===null&&Lh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[wt]||null;if(typeof a==`function`)o||Jh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[wt]||null)s=o.formAction;else if(kh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Jh(n)}}}function Xh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Zh(e){this._internalRoot=e}Qh.prototype.render=Zh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;vh(n,Bd(),e,t,null,null)},Qh.prototype.unmount=Zh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vh(e.current,2,null,e,null,null),Jd(),t[Tt]=null}};function Qh(e){this._internalRoot=e}Qh.prototype.unstable_scheduleHydration=function(e){if(e){var t=bt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Lh.length&&t!==0&&t<Lh[n].priority;n++);Lh.splice(n,0,e),n===0&&Hh(e)}};var $h=n.version;if($h!==`19.3.1`)throw Error(i(527,$h,`19.3.1`));ve.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var eg={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:_e,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var tg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tg.isDisabled&&tg.supportsFiber)try{Ze=tg.inject(eg),L=tg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Tc,s=Ec,c=Dc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=gh(e,1,!1,null,null,n,r,null,o,s,c,Xh),e[Tt]=t.current,ep(e),new Zh(t)}})),_=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=o(((e,t,n)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n.Dexie=r())})(n,(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};function t(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}var n=function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};function r(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var i=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global,a=Object.keys,o=Array.isArray;typeof Promise<`u`&&!i.Promise&&(i.Promise=Promise);function s(e,t){return typeof t==`object`&&a(t).forEach(function(n){e[n]=t[n]}),e}var c=Object.getPrototypeOf,l={}.hasOwnProperty;function u(e,t){return l.call(e,t)}function d(e,t){typeof t==`function`&&(t=t(c(e))),(typeof Reflect>`u`?a:Reflect.ownKeys)(t).forEach(function(n){p(e,n,t[n])})}var f=Object.defineProperty;function p(e,t,n,r){f(e,t,s(n&&u(n,`get`)&&typeof n.get==`function`?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function m(e){return{from:function(t){return e.prototype=Object.create(t.prototype),p(e.prototype,`constructor`,e),{extend:d.bind(null,e.prototype)}}}}var h=Object.getOwnPropertyDescriptor;function g(e,t){var n=h(e,t),r;return n||(r=c(e))&&g(r,t)}var _=[].slice;function v(e,t,n){return _.call(e,t,n)}function y(e,t){return t(e)}function b(e){if(!e)throw Error(`Assertion Failed`)}function x(e){i.setImmediate?setImmediate(e):setTimeout(e,0)}function S(e,t){return e.reduce(function(e,n,r){var i=t(n,r);return i&&(e[i[0]]=i[1]),e},{})}function C(e,t){if(typeof t==`string`&&u(e,t))return e[t];if(!t)return e;if(typeof t!=`string`){for(var n=[],r=0,i=t.length;r<i;++r){var a=C(e,t[r]);n.push(a)}return n}var o=t.indexOf(`.`);if(o!==-1){var s=e[t.substr(0,o)];return s==null?void 0:C(s,t.substr(o+1))}}function w(e,t,n){if(e&&t!==void 0&&!(`isFrozen`in Object&&Object.isFrozen(e))){if(typeof t!=`string`&&`length`in t){b(typeof n!=`string`&&`length`in n);for(var r=0,i=t.length;r<i;++r)w(e,t[r],n[r])}else{var a=t.indexOf(`.`);if(a!==-1){var s=t.substr(0,a),c=t.substr(a+1);if(c===``)n===void 0?o(e)&&!isNaN(parseInt(s))?e.splice(s,1):delete e[s]:e[s]=n;else{var l=e[s];if(!l||!u(e,s)){if(n===void 0)return;l=e[s]={}}w(l,c,n)}}else n===void 0?o(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}}function T(e,t){typeof t==`string`?w(e,t,void 0):`length`in t&&[].map.call(t,function(t){w(e,t,void 0)})}function E(e){var t={};for(var n in e)u(e,n)&&(t[n]=e[n]);return t}var D=[].concat;function O(e){return D.apply([],e)}var k=`BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey`.split(`,`).concat(O([8,16,32,64].map(function(e){return[`Int`,`Uint`,`Float`].map(function(t){return t+e+`Array`})}))).filter(function(e){return i[e]}),A=new Set(k.map(function(e){return i[e]}));function j(e){var t={};for(var n in e)if(u(e,n)){var r=e[n];t[n]=!r||typeof r!=`object`||A.has(r.constructor)?r:j(r)}return t}var M=null;function ee(e){M=new WeakMap;var t=N(e);return M=null,t}function N(e){if(!e||typeof e!=`object`)return e;var t=M.get(e);if(t)return t;if(o(e)){t=[],M.set(e,t);for(var n=0,r=e.length;n<r;++n)t.push(N(e[n]))}else if(A.has(e.constructor))t=e;else{var i=c(e);for(var a in t=i===Object.prototype?{}:Object.create(i),M.set(e,t),e)u(e,a)&&(t[a]=N(e[a]))}return t}var te={}.toString;function ne(e){return te.call(e).slice(8,-1)}var re=typeof Symbol<`u`?Symbol.iterator:`@@iterator`,ie=typeof re==`symbol`?function(e){var t;return e!=null&&(t=e[re])&&t.apply(e)}:function(){return null};function ae(e,t){var n=e.indexOf(t);return n>=0&&e.splice(n,1),n>=0}var oe={};function se(e){var t,n,r,i;if(arguments.length===1){if(o(e))return e.slice();if(this===oe&&typeof e==`string`)return[e];if(i=ie(e)){for(n=[];r=i.next(),!r.done;)n.push(r.value);return n}if(e==null)return[e];if(t=e.length,typeof t==`number`){for(n=Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=Array(t);t--;)n[t]=arguments[t];return n}var ce=typeof Symbol<`u`?function(e){return e[Symbol.toStringTag]===`AsyncFunction`}:function(){return!1},le=[`Modify`,`Bulk`,`OpenFailed`,`VersionChange`,`Schema`,`Upgrade`,`InvalidTable`,`MissingAPI`,`NoSuchDatabase`,`InvalidArgument`,`SubTransaction`,`Unsupported`,`Internal`,`DatabaseClosed`,`PrematureCommit`,`ForeignAwait`],ue=[`Unknown`,`Constraint`,`Data`,`TransactionInactive`,`ReadOnly`,`Version`,`NotFound`,`InvalidState`,`InvalidAccess`,`Abort`,`Timeout`,`QuotaExceeded`,`Syntax`,`DataClone`],de=le.concat(ue),fe={VersionChanged:`Database version changed by other database connection`,DatabaseClosed:`Database has been closed`,Abort:`Transaction aborted`,TransactionInactive:`Transaction has already completed or failed`,MissingAPI:`IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb`};function pe(e,t){this.name=e,this.message=t}m(pe).from(Error).extend({toString:function(){return this.name+`: `+this.message}});function me(e,t){return e+`. Errors: `+Object.keys(t).map(function(e){return t[e].toString()}).filter(function(e,t,n){return n.indexOf(e)===t}).join(`
10
10
  `)}function he(e,t,n,r){this.failures=t,this.failedKeys=r,this.successCount=n,this.message=me(e,t)}m(he).from(pe);function ge(e,t){this.name=`BulkError`,this.failures=Object.keys(t).map(function(e){return t[e]}),this.failuresByPos=t,this.message=me(e,this.failures)}m(ge).from(pe);var _e=de.reduce(function(e,t){return e[t]=t+`Error`,e},{}),ve=pe,P=de.reduce(function(e,t){var n=t+`Error`;function r(e,r){this.name=n,e?typeof e==`string`?(this.message=`${e}${r?`
11
- `+r:``}`,this.inner=r||null):typeof e==`object`&&(this.message=`${e.name} ${e.message}`,this.inner=e):(this.message=fe[t]||n,this.inner=null)}return m(r).from(ve),e[t]=r,e},{});P.Syntax=SyntaxError,P.Type=TypeError,P.Range=RangeError;var ye=ue.reduce(function(e,t){return e[t+`Error`]=P[t],e},{});function be(e,t){if(!e||e instanceof pe||e instanceof TypeError||e instanceof SyntaxError||!e.name||!ye[e.name])return e;var n=new ye[e.name](t||e.message,e);return`stack`in e&&p(n,`stack`,{get:function(){return this.inner.stack}}),n}var xe=de.reduce(function(e,t){return[`Syntax`,`Type`,`Range`].indexOf(t)===-1&&(e[t+`Error`]=P[t]),e},{});xe.ModifyError=he,xe.DexieError=pe,xe.BulkError=ge;function Se(){}function Ce(e){return e}function we(e,t){return e==null||e===Ce?t:function(n){return t(e(n))}}function Te(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Ee(e,t){return e===Se?t:function(){var n=e.apply(this,arguments);n!==void 0&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?Te(r,this.onsuccess):r),i&&(this.onerror=this.onerror?Te(i,this.onerror):i),a===void 0?n:a}}function De(e,t){return e===Se?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?Te(n,this.onsuccess):n),r&&(this.onerror=this.onerror?Te(r,this.onerror):r)}}function Oe(e,t){return e===Se?t:function(){var n=e.apply(this,arguments),r=arguments[0];s(r,n);var i=this.onsuccess,a=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?Te(i,this.onsuccess):i),a&&(this.onerror=this.onerror?Te(a,this.onerror):a),n===void 0?o===void 0?void 0:o:s(n,o)}}function ke(e,t){return e===Se?t:function(){return t.apply(this,arguments)!==!1&&e.apply(this,arguments)}}function Ae(e,t){return e===Se?t:function(){var n=e.apply(this,arguments);if(n&&typeof n.then==`function`){for(var r=this,i=arguments.length,a=Array(i);i--;)a[i]=arguments[i];return n.then(function(){return t.apply(r,a)})}return t.apply(this,arguments)}}var je=typeof location<`u`&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Me(e,t){je=e}var Ne={},Pe=100,Fe=typeof Promise>`u`?[]:(function(){var e=Promise.resolve();if(typeof crypto>`u`||!crypto.subtle)return[e,c(e),e];var t=crypto.subtle.digest(`SHA-512`,new Uint8Array([0]));return[t,c(t),e]})(),Ie=Fe[0],Le=Fe[1],Re=Fe[2],ze=Le&&Le.then,Be=Ie&&Ie.constructor,Ve=!!Re;function He(){queueMicrotask(at)}var Ue=function(e,t){Ye.push([e,t]),We&&=(He(),!1)},F=!0,We=!0,Ge=[],Ke=[],qe=Ce,Je={id:`global`,global:!0,ref:0,unhandleds:[],onunhandled:Se,pgp:!1,env:{},finalize:Se},I=Je,Ye=[],Xe=0,Ze=[];function L(e){if(typeof this!=`object`)throw TypeError(`Promises must be constructed via new`);this._listeners=[],this._lib=!1;var t=this._PSD=I;if(typeof e!=`function`){if(e!==Ne)throw TypeError(`Not a function`);this._state=arguments[1],this._value=arguments[2],this._state===!1&&tt(this,this._value)}else this._state=null,this._value=null,++t.ref,et(this,e)}var Qe={get:function(){var e=I,t=vt;function n(n,r){var i=this,a=!e.global&&(e!==I||t!==vt),o=a&&!St(),s=new L(function(t,s){rt(i,new $e(kt(n,e,a,o),kt(r,e,a,o),t,s,e))});return this._consoleTask&&(s._consoleTask=this._consoleTask),s}return n.prototype=Ne,n},set:function(e){p(this,`then`,e&&e.prototype===Ne?Qe:{get:function(){return e},set:Qe.set})}};d(L.prototype,{then:Qe,_then:function(e,t){rt(this,new $e(null,null,e,t,I))},catch:function(e){if(arguments.length===1)return this.then(null,e);var t=arguments[0],n=arguments[1];return typeof t==`function`?this.then(null,function(e){return e instanceof t?n(e):ft(e)}):this.then(null,function(e){return e&&e.name===t?n(e):ft(e)})},finally:function(e){return this.then(function(t){return L.resolve(e()).then(function(){return t})},function(t){return L.resolve(e()).then(function(){return ft(t)})})},timeout:function(e,t){var n=this;return e<1/0?new L(function(r,i){var a=setTimeout(function(){return i(new P.Timeout(t))},e);n.then(r,i).finally(clearTimeout.bind(null,a))}):this}}),typeof Symbol<`u`&&Symbol.toStringTag&&p(L.prototype,Symbol.toStringTag,`Dexie.Promise`),Je.env=Dt();function $e(e,t,n,r,i){this.onFulfilled=typeof e==`function`?e:null,this.onRejected=typeof t==`function`?t:null,this.resolve=n,this.reject=r,this.psd=i}d(L,{all:function(){var e=se.apply(null,arguments).map(Ct);return new L(function(t,n){e.length===0&&t([]);var r=e.length;e.forEach(function(i,a){return L.resolve(i).then(function(n){e[a]=n,--r||t(e)},n)})})},resolve:function(e){return e instanceof L?e:e&&typeof e.then==`function`?new L(function(t,n){e.then(t,n)}):new L(Ne,!0,e)},reject:ft,race:function(){var e=se.apply(null,arguments).map(Ct);return new L(function(t,n){e.map(function(e){return L.resolve(e).then(t,n)})})},PSD:{get:function(){return I},set:function(e){return I=e}},totalEchoes:{get:function(){return vt}},newPSD:bt,usePSD:Ot,scheduler:{get:function(){return Ue},set:function(e){Ue=e}},rejectionMapper:{get:function(){return qe},set:function(e){qe=e}},follow:function(e,t){return new L(function(n,r){return bt(function(t,n){var r=I;r.unhandleds=[],r.onunhandled=n,r.finalize=Te(function(){var e=this;lt(function(){e.unhandleds.length===0?t():n(e.unhandleds[0])})},r.finalize),e()},t,n,r)})}}),Be&&(Be.allSettled&&p(L,`allSettled`,function(){var e=se.apply(null,arguments).map(Ct);return new L(function(t){e.length===0&&t([]);var n=e.length,r=Array(n);e.forEach(function(e,i){return L.resolve(e).then(function(e){return r[i]={status:`fulfilled`,value:e}},function(e){return r[i]={status:`rejected`,reason:e}}).then(function(){return--n||t(r)})})})}),Be.any&&typeof AggregateError<`u`&&p(L,`any`,function(){var e=se.apply(null,arguments).map(Ct);return new L(function(t,n){e.length===0&&n(AggregateError([]));var r=e.length,i=Array(r);e.forEach(function(e,a){return L.resolve(e).then(function(e){return t(e)},function(e){i[a]=e,--r||n(AggregateError(i))})})})}),Be.withResolvers&&(L.withResolvers=Be.withResolvers));function et(e,t){try{t(function(t){if(e._state===null){if(t===e)throw TypeError(`A promise cannot be resolved with itself.`);var n=e._lib&&ot();t&&typeof t.then==`function`?et(e,function(e,n){t instanceof L?t._then(e,n):t.then(e,n)}):(e._state=!0,e._value=t,nt(e)),n&&st()}},tt.bind(null,e))}catch(t){tt(e,t)}}function tt(e,t){if(Ke.push(t),e._state===null){var n=e._lib&&ot();t=qe(t),e._state=!1,e._value=t,ut(e),nt(e),n&&st()}}function nt(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)rt(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),Xe===0&&(++Xe,Ue(function(){--Xe===0&&ct()},[]))}function rt(e,t){if(e._state===null)e._listeners.push(t);else{var n=e._state?t.onFulfilled:t.onRejected;if(n===null)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++Xe,Ue(it,[n,e,t])}}function it(e,t,n){try{var r,i=t._value;!t._state&&Ke.length&&(Ke=[]),r=je&&t._consoleTask?t._consoleTask.run(function(){return e(i)}):e(i),!t._state&&Ke.indexOf(i)===-1&&dt(t),n.resolve(r)}catch(e){n.reject(e)}finally{--Xe===0&&ct(),--n.psd.ref||n.psd.finalize()}}function at(){Ot(Je,function(){ot()&&st()})}function ot(){var e=F;return F=!1,We=!1,e}function st(){var e,t,n;do for(;Ye.length>0;)for(e=Ye,Ye=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}while(Ye.length>0);F=!0,We=!0}function ct(){var e=Ge;Ge=[],e.forEach(function(e){e._PSD.onunhandled.call(null,e._value,e)});for(var t=Ze.slice(0),n=t.length;n;)t[--n]()}function lt(e){function t(){e(),Ze.splice(Ze.indexOf(t),1)}Ze.push(t),++Xe,Ue(function(){--Xe===0&&ct()},[])}function ut(e){Ge.some(function(t){return t._value===e._value})||Ge.push(e)}function dt(e){for(var t=Ge.length;t;)if(Ge[--t]._value===e._value){Ge.splice(t,1);return}}function ft(e){return new L(Ne,!1,e)}function pt(e,t){var n=I;return function(){var r=ot(),i=I;try{return Et(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{Et(i,!1),r&&st()}}}var mt={awaits:0,echoes:0,id:0},ht=0,gt=[],_t=0,vt=0,yt=0;function bt(e,t,n,r){var i=I,a=Object.create(i);a.parent=i,a.ref=0,a.global=!1,a.id=++yt,Je.env,a.env=Ve?{Promise:L,PromiseProp:{value:L,configurable:!0,writable:!0},all:L.all,race:L.race,allSettled:L.allSettled,any:L.any,resolve:L.resolve,reject:L.reject}:{},t&&s(a,t),++i.ref,a.finalize=function(){--this.parent.ref||this.parent.finalize()};var o=Ot(a,e,n,r);return a.ref===0&&a.finalize(),o}function xt(){return mt.id||=++ht,++mt.awaits,mt.echoes+=Pe,mt.id}function St(){return mt.awaits?(--mt.awaits===0&&(mt.id=0),mt.echoes=mt.awaits*Pe,!0):!1}(``+ze).indexOf(`[native code]`)===-1&&(xt=St=Se);function Ct(e){return mt.echoes&&e&&e.constructor===Be?(xt(),e.then(function(e){return St(),e},function(e){return St(),jt(e)})):e}function wt(e){++vt,mt.echoes&&--mt.echoes!==0||(mt.echoes=mt.awaits=mt.id=0),gt.push(I),Et(e,!0)}function Tt(){var e=gt[gt.length-1];gt.pop(),Et(e,!1)}function Et(e,t){var n=I;if((t?mt.echoes&&(!_t++||e!==I):_t&&(!--_t||e!==I))&&queueMicrotask(t?wt.bind(null,e):Tt),e!==I&&(I=e,n===Je&&(Je.env=Dt()),Ve)){var r=Je.env.Promise,a=e.env;(n.global||e.global)&&(Object.defineProperty(i,"Promise",a.PromiseProp),r.all=a.all,r.race=a.race,r.resolve=a.resolve,r.reject=a.reject,a.allSettled&&(r.allSettled=a.allSettled),a.any&&(r.any=a.any))}}function Dt(){var e=i.Promise;return Ve?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(i,`Promise`),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject}:{}}function Ot(e,t,n,r,i){var a=I;try{return Et(e,!0),t(n,r,i)}finally{Et(a,!1)}}function kt(e,t,n,r){return typeof e==`function`?function(){var i=I;n&&xt(),Et(t,!0);try{return e.apply(this,arguments)}finally{Et(i,!1),r&&queueMicrotask(St)}}:e}function At(e){Promise===Be&&mt.echoes===0?_t===0?e():enqueueNativeMicroTask(e):setTimeout(e,0)}var jt=L.reject;function Mt(e,t,n,r){if(!e.idbdb||!e._state.openComplete&&!I.letThrough&&!e._vip){if(e._state.openComplete)return jt(new P.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._state.autoOpen)return jt(new P.DatabaseClosed);e.open().catch(Se)}return e._state.dbReadyPromise.then(function(){return Mt(e,t,n,r)})}var i=e._createTransaction(t,n,e._dbSchema);try{i.create(),e._state.PR1398_maxLoop=3}catch(i){return i.name===_e.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn(`Dexie: Need to reopen db`),e.close({disableAutoOpen:!1}),e.open().then(function(){return Mt(e,t,n,r)})):jt(i)}return i._promise(t,function(e,t){return bt(function(){return I.trans=i,r(e,t,i)})}).then(function(e){if(t===`readwrite`)try{i.idbtrans.commit()}catch{}return t===`readonly`?e:i._completion.then(function(){return e})})}var Nt=`4.4.7`,Pt=`￿`,Ft=-1/0,It=`Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.`,Lt=`String expected.`,Rt=1e3,zt=`__dbnames`,Bt=`readonly`,Vt=`readwrite`;function Ht(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var Ut={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Wt(e){return typeof e==`string`&&!/\./.test(e)?function(t){return t[e]===void 0&&e in t&&(t=ee(t),delete t[e]),t}:function(e){return e}}function Gt(){throw P.Type(`Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.`)}function Kt(e,t){try{var n=Yt(e),r=Yt(t);if(n!==r)return n===`Array`?1:r===`Array`?-1:n===`binary`?1:r===`binary`?-1:n===`string`?1:r===`string`?-1:n===`Date`?1:r===`Date`?-1:NaN;switch(n){case`number`:case`Date`:case`string`:return e>t?1:e<t?-1:0;case`binary`:return Jt(Xt(e),Xt(t));case`Array`:return qt(e,t)}}catch{}return NaN}function qt(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,a=0;a<i;++a){var o=Kt(e[a],t[a]);if(o!==0)return o}return n===r?0:n<r?-1:1}function Jt(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,a=0;a<i;++a)if(e[a]!==t[a])return e[a]<t[a]?-1:1;return n===r?0:n<r?-1:1}function Yt(e){var t=typeof e;if(t!==`object`)return t;if(ArrayBuffer.isView(e))return`binary`;var n=ne(e);return n===`ArrayBuffer`?`binary`:n}function Xt(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}function Zt(e,t,n){var r=e.schema.yProps;return r?(t&&n.numFailures>0&&(t=t.filter(function(e,t){return!n.failures[t]})),Promise.all(r.map(function(n){var r=n.updatesTable;return t?e.db.table(r).where(`k`).anyOf(t).delete():e.db.table(r).clear()})).then(function(){return n})):n}var Qt=function(){function e(e){this[`@@propmod`]=e}return e.prototype.execute=function(e){var t=this[`@@propmod`];if(t.add!==void 0){var n=t.add;if(o(n))return r(r([],o(e)?e:[],!0),n,!0).sort();if(typeof n==`number`)return(Number(e)||0)+n;if(typeof n==`bigint`)try{return BigInt(e)+n}catch{return BigInt(0)+n}throw TypeError(`Invalid term ${n}`)}if(t.remove!==void 0){var i=t.remove;if(o(i))return o(e)?e.filter(function(e){return!i.includes(e)}).sort():[];if(typeof i==`number`)return Number(e)-i;if(typeof i==`bigint`)try{return BigInt(e)-i}catch{return BigInt(0)-i}throw TypeError(`Invalid subtrahend ${i}`)}var a=t.replacePrefix?.[0];return a&&typeof e==`string`&&e.startsWith(a)?t.replacePrefix[1]+e.substring(a.length):e},e}();function $t(e,t){for(var n=a(t),r=n.length,i=!1,o=0;o<r;++o){var s=n[o],c=t[s],l=C(e,s);c instanceof Qt?(w(e,s,c.execute(l)),i=!0):l!==c&&(w(e,s,c),i=!0)}return i}var en=function(){function e(){}return e.prototype._trans=function(e,t,n){var r=this._tx||I.trans,i=this.name,a=je&&typeof console<`u`&&console.createTask&&console.createTask(`Dexie: ${e===`readonly`?`read`:`write`} ${this.name}`);function o(e,n,r){if(!r.schema[i])throw new P.NotFound(`Table `+i+` not part of transaction`);return t(r.idbtrans,r)}var s=ot();try{var c=r&&r.db._novip===this.db._novip?r===I.trans?r._promise(e,o,n):bt(function(){return r._promise(e,o,n)},{trans:r,transless:I.transless||I}):Mt(this.db,e,[this.name],o);return a&&(c._consoleTask=a,c=c.catch(function(e){return console.trace(e),jt(e)})),c}finally{s&&st()}},e.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):e==null?jt(new P.Type(`Invalid argument to Table.get()`)):this._trans(`readonly`,function(t){return n.core.get({trans:t,key:e}).then(function(e){return n.hook.reading.fire(e)})}).then(t)},e.prototype.where=function(e){if(typeof e==`string`)return new this.db.WhereClause(this,e);if(o(e))return new this.db.WhereClause(this,`[${e.join(`+`)}]`);var t=a(e);if(t.length===1)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter(function(e){if(e.compound&&t.every(function(t){return e.keyPath.indexOf(t)>=0})){for(var n=0;n<t.length;++n)if(t.indexOf(e.keyPath[n])===-1)return!1;return!0}return!1}).sort(function(e,t){return e.keyPath.length-t.keyPath.length})[0];if(n&&this.db._maxKey!==Pt){var r=n.keyPath.slice(0,t.length);return this.where(r).equals(r.map(function(t){return e[t]}))}!n&&je&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit from a compound index [${t.join(`+`)}]`);var i=this.schema.idxByName;function s(e,t){return Kt(e,t)===0}var c=t.reduce(function(t,n){var r=t[0],a=t[1],c=i[n],l=e[n];return[r||c,r||!c?Ht(a,c&&c.multi?function(e){var t=C(e,n);return o(t)&&t.some(function(e){return s(l,e)})}:function(e){return s(l,C(e,n))}):a]},[null,null]),l=c[0],u=c[1];return l?this.where(l.name).equals(e[l.keyPath]).filter(u):n?this.filter(u):this.where(t).equals(``)},e.prototype.filter=function(e){return this.toCollection().and(e)},e.prototype.count=function(e){return this.toCollection().count(e)},e.prototype.offset=function(e){return this.toCollection().offset(e)},e.prototype.limit=function(e){return this.toCollection().limit(e)},e.prototype.each=function(e){return this.toCollection().each(e)},e.prototype.toArray=function(e){return this.toCollection().toArray(e)},e.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},e.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,o(e)?`[${e.join(`+`)}]`:e))},e.prototype.reverse=function(){return this.toCollection().reverse()},e.prototype.mapToClass=function(e){var n=this,r=n.db,i=n.name;this.schema.mappedClass=e,e.prototype instanceof Gt&&(e=function(e){t(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(n.prototype,"db",{get:function(){return r},enumerable:!1,configurable:!0}),n.prototype.table=function(){return i},n}(e));for(var a=new Set,o=e.prototype;o;o=c(o))Object.getOwnPropertyNames(o).forEach(function(e){return a.add(e)});var s=function(t){if(!t)return t;var n=Object.create(e.prototype);for(var r in t)if(!a.has(r))try{n[r]=t[r]}catch{}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=s,this.hook(`reading`,s),e},e.prototype.defineClass=function(){function e(e){s(this,e)}return this.mapToClass(e)},e.prototype.add=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,a=r.keyPath,o=e;return a&&i&&(o=Wt(a)(e)),this._trans(`readwrite`,function(e){return n.core.mutate({trans:e,type:`add`,keys:t==null?null:[t],values:[o]})}).then(function(e){return e.numFailures?L.reject(e.failures[0]):e.lastResult}).then(function(t){if(a)try{w(e,a,t)}catch{}return t})},e.prototype.upsert=function(e,t){var n=this,r=this.schema.primKey.keyPath;return this._trans(`readwrite`,function(i){return n.core.get({trans:i,key:e}).then(function(a){var o=a??{};return $t(o,t),r&&w(o,r,e),n.core.mutate({trans:i,type:`put`,values:[o],keys:[e],upsert:!0,updates:{keys:[e],changeSpecs:[t]}}).then(function(e){return e.numFailures?L.reject(e.failures[0]):!!a})})})},e.prototype.update=function(e,t){if(typeof e==`object`&&!o(e)){var n=C(e,this.schema.primKey.keyPath);return n===void 0?jt(new P.InvalidArgument(`Given object does not contain its primary key`)):this.where(`:id`).equals(n).modify(t)}return this.where(`:id`).equals(e).modify(t)},e.prototype.put=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,a=r.keyPath,o=e;return a&&i&&(o=Wt(a)(e)),this._trans(`readwrite`,function(e){return n.core.mutate({trans:e,type:`put`,values:[o],keys:t==null?null:[t]})}).then(function(e){return e.numFailures?L.reject(e.failures[0]):e.lastResult}).then(function(t){if(a)try{w(e,a,t)}catch{}return t})},e.prototype.delete=function(e){var t=this;return this._trans(`readwrite`,function(n){return t.core.mutate({trans:n,type:`delete`,keys:[e]}).then(function(n){return Zt(t,[e],n)}).then(function(e){return e.numFailures?L.reject(e.failures[0]):void 0})})},e.prototype.clear=function(){var e=this;return this._trans(`readwrite`,function(t){return e.core.mutate({trans:t,type:`deleteRange`,range:Ut}).then(function(t){return Zt(e,null,t)})}).then(function(e){return e.numFailures?L.reject(e.failures[0]):void 0})},e.prototype.bulkGet=function(e){var t=this;return this._trans(`readonly`,function(n){return t.core.getMany({keys:e,trans:n}).then(function(e){return e.map(function(e){return t.hook.reading.fire(e)})})})},e.prototype.bulkAdd=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0;n||=i?void 0:t;var a=n?n.allKeys:void 0;return this._trans(`readwrite`,function(t){var n=r.schema.primKey,o=n.auto,s=n.keyPath;if(s&&i)throw new P.InvalidArgument(`bulkAdd(): keys argument invalid on tables with inbound keys`);if(i&&i.length!==e.length)throw new P.InvalidArgument(`Arguments objects and keys must have the same length`);var c=e.length,l=s&&o?e.map(Wt(s)):e;return r.core.mutate({trans:t,type:`add`,keys:i,values:l,wantResults:a}).then(function(e){var t=e.numFailures,n=e.results,i=e.lastResult,o=e.failures,s=a?n:i;if(t===0)return s;throw new ge(`${r.name}.bulkAdd(): ${t} of ${c} operations failed`,o)})})},e.prototype.bulkPut=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0;n||=i?void 0:t;var a=n?n.allKeys:void 0;return this._trans(`readwrite`,function(t){var n=r.schema.primKey,o=n.auto,s=n.keyPath;if(s&&i)throw new P.InvalidArgument(`bulkPut(): keys argument invalid on tables with inbound keys`);if(i&&i.length!==e.length)throw new P.InvalidArgument(`Arguments objects and keys must have the same length`);var c=e.length,l=s&&o?e.map(Wt(s)):e;return r.core.mutate({trans:t,type:`put`,keys:i,values:l,wantResults:a}).then(function(e){var t=e.numFailures,n=e.results,i=e.lastResult,o=e.failures,s=a?n:i;if(t===0)return s;throw new ge(`${r.name}.bulkPut(): ${t} of ${c} operations failed`,o)})})},e.prototype.bulkUpdate=function(e){var t=this,n=e.map(function(e){return e.key}),r=e.map(function(e){return e.changes}),i=[];return this._trans(`readwrite`,function(a){var o=t.core;return o.getMany({trans:a,keys:n,cache:`clone`}).then(function(s){var c=o.schema.primaryKey,l=c.outbound,u=c.extractKey,d=[],f=[];e.forEach(function(e,t){var n=e.key,r=e.changes,a=s[t];if(a){for(var o=0,c=Object.keys(r);o<c.length;o++){var p=c[o];w(a,p,r[p])}if(!l&&Kt(u(a),n)!==0)throw new P.Constraint(`Cannot update primary key in bulkUpdate()`);i.push(t),d.push(n),f.push(a)}});var p=d.length;return o.mutate({trans:a,type:`put`,keys:d,values:f,updates:{keys:n,changeSpecs:r}}).then(function(e){var n=e.numFailures,r=e.failures;if(n===0)return p;for(var a=0,o=Object.keys(r);a<o.length;a++){var s=o[a],c=i[Number(s)];if(c!=null){var l=r[s];delete r[s],r[c]=l}}throw new ge(`${t.name}.bulkUpdate(): ${n} of ${p} operations failed`,r)})})})},e.prototype.bulkDelete=function(e){var t=this,n=e.length;return this._trans(`readwrite`,function(n){return t.core.mutate({trans:n,type:`delete`,keys:e}).then(function(n){return Zt(t,e,n)})}).then(function(e){var r=e.numFailures,i=e.lastResult,a=e.failures;if(r===0)return i;throw new ge(`${t.name}.bulkDelete(): ${r} of ${n} operations failed`,a)})},e}();function tn(e){var t={},n=function(n,r){if(r){for(var i=arguments.length,a=Array(i-1);--i;)a[i-1]=arguments[i];return t[n].subscribe.apply(null,a),e}if(typeof n==`string`)return t[n]};n.addEventType=s;for(var r=1,i=arguments.length;r<i;++r)s(arguments[r]);return n;function s(e,r,i){if(typeof e==`object`)return c(e);r||=ke,i||=Se;var a={subscribers:[],fire:i,subscribe:function(e){a.subscribers.indexOf(e)===-1&&(a.subscribers.push(e),a.fire=r(a.fire,e))},unsubscribe:function(e){a.subscribers=a.subscribers.filter(function(t){return t!==e}),a.fire=a.subscribers.reduce(r,i)}};return t[e]=n[e]=a,a}function c(e){a(e).forEach(function(t){var n=e[t];if(o(n))s(t,e[t][0],e[t][1]);else if(n===`asap`)var r=s(t,Ce,function(){for(var e=arguments.length,t=Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach(function(e){x(function(){e.apply(null,t)})})});else throw new P.InvalidArgument(`Invalid event config`)})}}function nn(e,t){return m(t).from({prototype:e}),t}function rn(e){return nn(en.prototype,function(t,n,r){this.db=e,this._tx=r,this.name=t,this.schema=n,this.hook=e._allTables[t]?e._allTables[t].hook:tn(null,{creating:[Ee,Se],reading:[we,Ce],updating:[Oe,Se],deleting:[De,Se]})})}function an(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function on(e,t){e.filter=Ht(e.filter,t)}function sn(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return Ht(r(),t())}:t,e.justLimit=n&&!r}function cn(e,t){e.isMatch=Ht(e.isMatch,t)}function ln(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new P.Schema(`KeyPath `+e.index+` on object store `+t.name+` is not indexed`);return n}function un(e,t,n){var r=ln(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:e.dir===`prev`,unique:!!e.unique,query:{index:r,range:e.range}})}function dn(e,t,n,r){var i=e.replayFilter?Ht(e.filter,e.replayFilter()):e.filter;if(e.or){var a={},o=function(e,n,r){if(!i||i(n,r,function(e){return n.stop(e)},function(e){return n.fail(e)})){var o=n.primaryKey,s=``+o;s===`[object ArrayBuffer]`&&(s=``+new Uint8Array(o)),u(a,s)||(a[s]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(o,n),fn(un(e,r,n),e.algorithm,o,!e.keysOnly&&e.valueMapper)])}return fn(un(e,r,n),Ht(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function fn(e,t,n,r){var i=pt(r?function(e,t,i){return n(r(e),t,i)}:n);return e.then(function(e){if(e)return e.start(function(){var n=function(){return e.continue()};(!t||t(e,function(e){return n=e},function(t){e.stop(t),n=Se},function(t){e.fail(t),n=Se}))&&i(e.value,e,function(e){return n=e}),n()})})}var pn=function(){function e(){}return e.prototype._read=function(e,t){var n=this._ctx;return n.error?n.table._trans(null,jt.bind(null,n.error)):n.table._trans(`readonly`,e).then(t)},e.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,jt.bind(null,t.error)):t.table._trans(`readwrite`,e,`locked`)},e.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=Ht(t.algorithm,e)},e.prototype._iterate=function(e,t){return dn(this._ctx,e,t,this._ctx.table.core)},e.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&s(n,e),t._ctx=n,t},e.prototype.raw=function(){return this._ctx.valueMapper=null,this},e.prototype.each=function(e){var t=this._ctx;return this._read(function(n){return dn(t,e,n,t.table.core)})},e.prototype.count=function(e){var t=this;return this._read(function(e){var n=t._ctx,r=n.table.core;if(an(n,!0))return r.count({trans:e,query:{index:ln(n,r.schema),range:n.range}}).then(function(e){return Math.min(e,n.limit)});var i=0;return dn(n,function(){return++i,!1},e,r).then(function(){return i})}).then(e)},e.prototype.sortBy=function(e,t){var n=e.split(`.`).reverse(),r=n[0],i=n.length-1;function a(e,t){return t?a(e[n[t]],t-1):e[r]}var o=this._ctx.dir===`next`?1:-1;function s(e,t){return Kt(a(e,i),a(t,i))*o}return this.toArray(function(e){return e.slice().sort(s)}).then(t)},e.prototype.toArray=function(e){var t=this;return this._read(function(e){var n=t._ctx;if(an(n,!0)&&n.limit>0){var r=n.valueMapper,i=ln(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,direction:n.dir===`prev`?`prev`:void 0,query:{index:i,range:n.range}}).then(function(e){var t=e.result;return r?t.map(r):t})}var a=[];return dn(n,function(e){return a.push(e)},e,n.table.core).then(function(){return a})},e)},e.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,an(t)?sn(t,function(){var t=e;return function(e,n){return t===0?!0:t===1?(--t,!1):(n(function(){e.advance(t),t=0}),!1)}}):sn(t,function(){var t=e;return function(){return--t<0}})),this},e.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),sn(this._ctx,function(){var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}},!0),this},e.prototype.until=function(e,t){return on(this._ctx,function(n,r,i){return!e(n.value)||(r(i),t)}),this},e.prototype.first=function(e){return this.limit(1).toArray(function(e){return e[0]}).then(e)},e.prototype.last=function(e){return this.reverse().first(e)},e.prototype.filter=function(e){return on(this._ctx,function(t){return e(t.value)}),cn(this._ctx,e),this},e.prototype.and=function(e){return this.filter(e)},e.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},e.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir===`prev`?`next`:`prev`,this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},e.prototype.desc=function(){return this.reverse()},e.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.key,n)})},e.prototype.eachUniqueKey=function(e){return this._ctx.unique=`unique`,this.eachKey(e)},e.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.primaryKey,n)})},e.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.key)}).then(function(){return n}).then(e)},e.prototype.primaryKeys=function(e){var t=this._ctx;if(an(t,!0)&&t.limit>0)return this._read(function(e){var n=ln(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,direction:t.dir===`prev`?`prev`:void 0,query:{index:n,range:t.range}})}).then(function(e){return e.result}).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.primaryKey)}).then(function(){return n}).then(e)},e.prototype.uniqueKeys=function(e){return this._ctx.unique=`unique`,this.keys(e)},e.prototype.firstKey=function(e){return this.limit(1).keys(function(e){return e[0]}).then(e)},e.prototype.lastKey=function(e){return this.reverse().firstKey(e)},e.prototype.distinct=function(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return on(this._ctx,function(e){var t=e.primaryKey.toString(),r=u(n,t);return n[t]=!0,!r}),this},e.prototype.modify=function(e){var t=this,n=this._ctx;return this._write(function(r){var i=typeof e==`function`?e:function(t){return $t(t,e)},o=n.table.core,s=o.schema.primaryKey,c=s.outbound,l=s.extractKey,u=200,d=t.db._options.modifyChunkSize;d&&(u=typeof d==`object`?d[o.name]||d[`*`]||200:d);var f=[],p=0,m=[],h=function(e,t){var n=t.failures,r=t.numFailures;p+=e-r;for(var i=0,o=a(n);i<o.length;i++){var s=o[i];f.push(n[s])}},g=e===mn;return t.clone().primaryKeys().then(function(t){var a=an(n)&&n.limit===1/0&&(typeof e!=`function`||g)&&{index:n.index,range:n.range},s=function(d){var f=Math.min(u,t.length-d),p=t.slice(d,d+f);return(g?Promise.resolve([]):o.getMany({trans:r,keys:p,cache:`immutable`})).then(function(m){var _=[],v=[],y=c?[]:null,b=g?p:[];if(!g)for(var x=0;x<f;++x){var S=m[x],C={value:ee(S),primKey:t[d+x]};i.call(C,C.value,C)!==!1&&(C.value==null?b.push(t[d+x]):!c&&Kt(l(S),l(C.value))!==0?(b.push(t[d+x]),_.push(C.value)):(v.push(C.value),c&&y.push(t[d+x])))}return Promise.resolve(_.length>0&&o.mutate({trans:r,type:`add`,values:_}).then(function(e){for(var t in e.failures)b.splice(parseInt(t),1);h(_.length,e)})).then(function(){return(v.length>0||a&&typeof e==`object`)&&o.mutate({trans:r,type:`put`,keys:y,values:v,criteria:a,changeSpec:typeof e!=`function`&&e,isAdditionalChunk:d>0}).then(function(e){return h(v.length,e)})}).then(function(){return(b.length>0||a&&g)&&o.mutate({trans:r,type:`delete`,keys:b,criteria:a,isAdditionalChunk:d>0}).then(function(e){return Zt(n.table,b,e)}).then(function(e){return h(b.length,e)})}).then(function(){return t.length>d+f&&s(d+u)})})};return s(0).then(function(){if(f.length>0)throw new he(`Error modifying one or more objects`,f,p,m);return t.length})})})},e.prototype.delete=function(){var e=this._ctx,t=e.range;return an(e)&&!e.table.schema.yProps&&(e.isPrimKey||t.type===3)?this._write(function(n){var r=e.table.core.schema.primaryKey,i=t;return e.table.core.count({trans:n,query:{index:r,range:i}}).then(function(t){return e.table.core.mutate({trans:n,type:`deleteRange`,range:i}).then(function(e){var n=e.failures,r=e.numFailures;if(r)throw new he(`Could not delete some values`,Object.keys(n).map(function(e){return n[e]}),t-r);return t-r})})}):this.modify(mn)},e}(),mn=function(e,t){return t.value=null};function hn(e){return nn(pn.prototype,function(t,n){this.db=e;var r=Ut,i=null;if(n)try{r=n()}catch(e){i=e}var a=t._ctx,o=a.table,s=o.hook.reading.fire;this._ctx={table:o,index:a.index,isPrimKey:!a.index||o.schema.primKey.keyPath&&a.index===o.schema.primKey.name,range:r,keysOnly:!1,dir:`next`,unique:``,algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:i,or:a.or,valueMapper:s===Ce?null:s}})}function gn(e,t){return e<t?-1:e===t?0:1}function _n(e,t){return e>t?-1:e===t?0:1}function vn(e,t,n){var r=e instanceof En?new e.Collection(e):e;return r._ctx.error=n?new n(t):TypeError(t),r}function yn(e){var t=new e.Collection(e,function(){return Tn(``)});return t._addAlgorithm(function(){return!1}),t}function bn(e){return e===`next`?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()}}function xn(e){return e===`next`?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()}}function Sn(e,t,n,r,i,a){for(var o=Math.min(e.length,r.length),s=-1,c=0;c<o;++c){var l=t[c];if(l!==r[c])return i(e[c],n[c])<0?e.substr(0,c)+n[c]+n.substr(c+1):i(e[c],r[c])<0?e.substr(0,c)+r[c]+n.substr(c+1):s>=0?e.substr(0,s)+t[s]+n.substr(s+1):null;i(e[c],l)<0&&(s=c)}return o<r.length&&a===`next`?e+n.substr(e.length):o<e.length&&a===`prev`?e.substr(0,n.length):s<0?null:e.substr(0,s)+r[s]+n.substr(s+1)}function Cn(e,t,n,r){var i,a,o,s,c,l,u,d=n.length;if(!n.every(function(e){return typeof e==`string`}))return vn(e,Lt);function f(e){i=bn(e),a=xn(e),o=e===`next`?gn:_n;var t=n.map(function(e){return{lower:a(e),upper:i(e)}}).sort(function(e,t){return o(e.lower,t.lower)});s=t.map(function(e){return e.upper}),c=t.map(function(e){return e.lower}),l=e,u=e===`next`?``:r}f(`next`);var p=new e.Collection(e,function(){return wn(s[0],c[d-1]+r)});p._ondirectionchange=function(e){f(e)};var m=0;return p._addAlgorithm(function(e,n,r){var i=e.key;if(typeof i!=`string`)return!1;var f=a(i);if(t(f,c,m))return!0;for(var p=null,h=m;h<d;++h){var g=Sn(i,f,s[h],c[h],o,l);g===null&&p===null?m=h+1:(p===null||o(p,g)>0)&&(p=g)}return n(p===null?r:function(){e.continue(p+u)}),!1}),p}function wn(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function Tn(e){return{type:1,lower:e,upper:e}}var En=function(){function e(){}return Object.defineProperty(e.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),e.prototype.between=function(e,t,n,r){n=n!==!1,r=r===!0;try{return this._cmp(e,t)>0||this._cmp(e,t)===0&&(n||r)&&!(n&&r)?yn(this):new this.Collection(this,function(){return wn(e,t,!n,!r)})}catch{return vn(this,It)}},e.prototype.equals=function(e){return e==null?vn(this,It):new this.Collection(this,function(){return Tn(e)})},e.prototype.above=function(e){return e==null?vn(this,It):new this.Collection(this,function(){return wn(e,void 0,!0)})},e.prototype.aboveOrEqual=function(e){return e==null?vn(this,It):new this.Collection(this,function(){return wn(e,void 0,!1)})},e.prototype.below=function(e){return e==null?vn(this,It):new this.Collection(this,function(){return wn(void 0,e,!1,!0)})},e.prototype.belowOrEqual=function(e){return e==null?vn(this,It):new this.Collection(this,function(){return wn(void 0,e)})},e.prototype.startsWith=function(e){return typeof e==`string`?this.between(e,e+Pt,!0,!0):vn(this,Lt)},e.prototype.startsWithIgnoreCase=function(e){return e===``?this.startsWith(e):Cn(this,function(e,t){return e.indexOf(t[0])===0},[e],Pt)},e.prototype.equalsIgnoreCase=function(e){return Cn(this,function(e,t){return e===t[0]},[e],``)},e.prototype.anyOfIgnoreCase=function(){var e=se.apply(oe,arguments);return e.length===0?yn(this):Cn(this,function(e,t){return t.indexOf(e)!==-1},e,``)},e.prototype.startsWithAnyOfIgnoreCase=function(){var e=se.apply(oe,arguments);return e.length===0?yn(this):Cn(this,function(e,t){return t.some(function(t){return e.indexOf(t)===0})},e,Pt)},e.prototype.anyOf=function(){var e=this,t=se.apply(oe,arguments),n=this._cmp;try{t.sort(n)}catch{return vn(this,It)}if(t.length===0)return yn(this);var r=new this.Collection(this,function(){return wn(t[0],t[t.length-1])});r._ondirectionchange=function(r){n=r===`next`?e._ascending:e._descending,t.sort(n)};var i=0;return r._addAlgorithm(function(e,r,a){for(var o=e.key;n(o,t[i])>0;)if(++i,i===t.length)return r(a),!1;return n(o,t[i])===0||(r(function(){e.continue(t[i])}),!1)}),r},e.prototype.notEqual=function(e){return this.inAnyRange([[Ft,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},e.prototype.noneOf=function(){var e=se.apply(oe,arguments);if(e.length===0)return new this.Collection(this);try{e.sort(this._ascending)}catch{return vn(this,It)}var t=e.reduce(function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[Ft,t]]},null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},e.prototype.inAnyRange=function(e,t){var n=this,r=this._cmp,i=this._ascending,a=this._descending,o=this._min,s=this._max;if(e.length===0)return yn(this);if(!e.every(function(e){return e[0]!==void 0&&e[1]!==void 0&&i(e[0],e[1])<=0}))return vn(this,`First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower`,P.InvalidArgument);var c=!t||t.includeLowers!==!1,l=t&&t.includeUppers===!0;function u(e,t){for(var n=0,i=e.length;n<i;++n){var a=e[n];if(r(t[0],a[1])<0&&r(t[1],a[0])>0){a[0]=o(a[0],t[0]),a[1]=s(a[1],t[1]);break}}return n===i&&e.push(t),e}var d=i;function f(e,t){return d(e[0],t[0])}var p;try{p=e.reduce(u,[]),p.sort(f)}catch{return vn(this,It)}var m=0,h=l?function(e){return i(e,p[m][1])>0}:function(e){return i(e,p[m][1])>=0},g=c?function(e){return a(e,p[m][0])>0}:function(e){return a(e,p[m][0])>=0};function _(e){return!h(e)&&!g(e)}var v=h,y=new this.Collection(this,function(){return wn(p[0][0],p[p.length-1][1],!c,!l)});return y._ondirectionchange=function(e){e===`next`?(v=h,d=i):(v=g,d=a),p.sort(f)},y._addAlgorithm(function(e,t,r){for(var a=e.key;v(a);)if(++m,m===p.length)return t(r),!1;return _(a)?!0:(n._cmp(a,p[m][1])===0||n._cmp(a,p[m][0])===0||t(function(){d===i?e.continue(p[m][0]):e.continue(p[m][1])}),!1)}),y},e.prototype.startsWithAnyOf=function(){var e=se.apply(oe,arguments);return e.every(function(e){return typeof e==`string`})?e.length===0?yn(this):this.inAnyRange(e.map(function(e){return[e,e+Pt]})):vn(this,`startsWithAnyOf() only works with strings`)},e}();function Dn(e){return nn(En.prototype,function(t,n,r){if(this.db=e,this._ctx={table:t,index:n===`:id`?null:n,or:r},this._cmp=this._ascending=Kt,this._descending=function(e,t){return Kt(t,e)},this._max=function(e,t){return Kt(e,t)>0?e:t},this._min=function(e,t){return Kt(e,t)<0?e:t},this._IDBKeyRange=e._deps.IDBKeyRange,!this._IDBKeyRange)throw new P.MissingAPI})}function On(e){return pt(function(t){return R(t),e(t.target.error),!1})}function R(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var kn=`storagemutated`,An=`x-storagemutated-1`,jn=tn(null,kn),Mn=function(){function e(){}return e.prototype._lock=function(){return b(!I.global),++this._reculock,this._reculock===1&&!I.global&&(I.lockOwnerFor=this),this},e.prototype._unlock=function(){if(b(!I.global),--this._reculock===0)for(I.global||(I.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{Ot(e[1],e[0])}catch{}}return this},e.prototype._locked=function(){return this._reculock&&I.lockOwnerFor!==this},e.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(b(!this.idbtrans),!e&&!n)switch(r&&r.name){case`DatabaseClosedError`:throw new P.DatabaseClosed(r);case`MissingAPIError`:throw new P.MissingAPI(r.message,r);default:throw new P.OpenFailed(r)}if(!this.active)throw new P.TransactionInactive;return b(this._completion._state===null),e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):n.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})),e.onerror=pt(function(n){R(n),t._reject(e.error)}),e.onabort=pt(function(n){R(n),t.active&&t._reject(new P.Abort(e.error)),t.active=!1,t.on(`abort`).fire(n)}),e.oncomplete=pt(function(){t.active=!1,t._resolve(),`mutatedParts`in e&&jn.storagemutated.fire(e.mutatedParts)}),this},e.prototype._promise=function(e,t,n){var r=this;if(e===`readwrite`&&this.mode!==`readwrite`)return jt(new P.ReadOnly(`Transaction is readonly`));if(!this.active)return jt(new P.TransactionInactive);if(this._locked())return new L(function(i,a){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,a)},I])});if(n)return bt(function(){var e=new L(function(e,n){r._lock();var i=t(e,n,r);i&&i.then&&i.then(e,n)});return e.finally(function(){return r._unlock()}),e._lib=!0,e});var i=new L(function(e,n){var i=t(e,n,r);i&&i.then&&i.then(e,n)});return i._lib=!0,i},e.prototype._root=function(){return this.parent?this.parent._root():this},e.prototype.waitFor=function(e){var t=this._root(),n=L.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then(function(){return n});else{t._waitingFor=n,t._waitingQueue=[];var r=t.idbtrans.objectStore(t.storeNames[0]);(function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(r.get(-1/0).onsuccess=e)})()}var i=t._waitingFor;return new L(function(e,r){n.then(function(n){return t._waitingQueue.push(pt(e.bind(null,n)))},function(e){return t._waitingQueue.push(pt(r.bind(null,e)))}).finally(function(){t._waitingFor===i&&(t._waitingFor=null)})})},e.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new P.Abort))},e.prototype.table=function(e){var t=this._memoizedTables||={};if(u(t,e))return t[e];var n=this.schema[e];if(!n)throw new P.NotFound(`Table `+e+` not part of transaction`);var r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r},e}();function Nn(e){return nn(Mn.prototype,function(t,n,r,i,a){var o=this;t!==`readonly`&&n.forEach(function(e){var t=r[e]?.yProps;t&&(n=n.concat(t.map(function(e){return e.updatesTable})))}),this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.chromeTransactionDurability=i,this.idbtrans=null,this.on=tn(this,`complete`,`error`,`abort`),this.parent=a||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new L(function(e,t){o._resolve=e,o._reject=t}),this._completion.then(function(){o.active=!1,o.on.complete.fire()},function(e){var t=o.active;return o.active=!1,o.on.error.fire(e),o.parent?o.parent._reject(e):t&&o.idbtrans&&o.idbtrans.abort(),jt(e)})})}function Pn(e,t,n,r,i,a,o,s){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:a,src:(n&&!o?`&`:``)+(r?`*`:``)+(i?`++`:``)+Fn(t),type:s}}function Fn(e){return typeof e==`string`?e:e?`[`+[].join.call(e,`+`)+`]`:``}function In(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:S(n,function(e){return[e.name,e]})}}function Ln(e){return e.length===1?e[0]:e}var Rn=function(e){try{return e.only([[]]),Rn=function(){return[[]]},[[]]}catch{return Rn=function(){return Pt},Pt}};function zn(e){return e==null?function(){}:typeof e==`string`?Bn(e):function(t){return C(t,e)}}function Bn(e){return e.split(`.`).length===1?function(t){return t[e]}:function(t){return C(t,e)}}function Vn(e){return[].slice.call(e)}var Hn=0;function Un(e){return e==null?`:id`:typeof e==`string`?e:`[${e.join(`+`)}]`}function Wn(e,t,n){function r(e,t){var n=Vn(e.objectStoreNames),r=n.length>0?t.objectStore(n[0]):{};return{schema:{name:e.name,tables:n.map(function(e){return t.objectStore(e)}).map(function(e){var t=e.keyPath,n=e.autoIncrement,r=o(t),i=t==null,a={},s={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:zn(t)},indexes:Vn(e.indexNames).map(function(t){return e.index(t)}).map(function(e){var t=e.name,n=e.unique,r=e.multiEntry,i=e.keyPath,s={name:t,compound:o(i),keyPath:i,unique:n,multiEntry:r,extractKey:zn(i)};return a[Un(i)]=s,s}),getIndexByKeyPath:function(e){return a[Un(e)]}};return a[`:id`]=s.primaryKey,t!=null&&(a[Un(t)]=s.primaryKey),s})},hasGetAll:n.length>0&&`getAll`in r&&!(typeof navigator<`u`&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:`getAllRecords`in r}}function i(e){if(e.type===3)return null;if(e.type===4)throw Error(`Cannot convert never type to IDBKeyRange`);var n=e.lower,r=e.upper,i=e.lowerOpen,a=e.upperOpen;return n===void 0?r===void 0?null:t.upperBound(r,!!a):r===void 0?t.lowerBound(n,!!i):t.bound(n,r,!!i,!!a)}function a(e){var t=e.name;function n(e){var n=e.trans,r=e.type,a=e.keys,o=e.values,s=e.range;return new Promise(function(e,c){e=pt(e);var l=n.objectStore(t),u=l.keyPath==null,d=r===`put`||r===`add`;if(!d&&r!==`delete`&&r!==`deleteRange`)throw Error(`Invalid operation type: `+r);var f=(a||o||{length:1}).length;if(a&&o&&a.length!==o.length)throw Error(`Given keys array must have same length as given values array.`);if(f===0)return e({numFailures:0,failures:{},results:[],lastResult:void 0});var p,m=[],h=[],g=0,_=function(e){++g,R(e)};if(r===`deleteRange`){if(s.type===4)return e({numFailures:g,failures:h,results:[],lastResult:void 0});s.type===3?m.push(p=l.clear()):m.push(p=l.delete(i(s)))}else{var v=d?u?[o,a]:[o,null]:[a,null],y=v[0],b=v[1];if(d)for(var x=0;x<f;++x)m.push(p=b&&b[x]!==void 0?l[r](y[x],b[x]):l[r](y[x])),p.onerror=_;else for(var x=0;x<f;++x)m.push(p=l[r](y[x])),p.onerror=_}var S=function(t){var n=t.target.result;m.forEach(function(e,t){return e.error!=null&&(h[t]=e.error)}),e({numFailures:g,failures:h,results:r===`delete`?a:m.map(function(e){return e.result}),lastResult:n})};p.onerror=function(e){_(e),S(e)},p.onsuccess=S})}function r(e){var n=e.trans,r=e.values,a=e.query,o=e.reverse,s=e.unique;return new Promise(function(e,c){e=pt(e);var l=a.index,u=a.range,d=n.objectStore(t),f=l.isPrimaryKey?d:d.index(l.name),p=o?s?`prevunique`:`prev`:s?`nextunique`:`next`,m=r||!(`openKeyCursor`in f)?f.openCursor(i(u),p):f.openKeyCursor(i(u),p);m.onerror=On(c),m.onsuccess=pt(function(t){var r=m.result;if(!r)e(null);else{r.___id=++Hn,r.done=!1;var i=r.continue.bind(r),a=r.continuePrimaryKey;a&&=a.bind(r);var o=r.advance.bind(r),s=function(){throw Error(`Cursor not started`)},l=function(){throw Error(`Cursor not stopped`)};r.trans=n,r.stop=r.continue=r.continuePrimaryKey=r.advance=s,r.fail=pt(c),r.next=function(){var e=this,t=1;return this.start(function(){return t--?e.continue():e.stop()}).then(function(){return e})},r.start=function(e){var t=new Promise(function(e,t){e=pt(e),m.onerror=On(t),r.fail=t,r.stop=function(t){r.stop=r.continue=r.continuePrimaryKey=r.advance=l,e(t)}}),n=function(){if(m.result)try{e()}catch(e){r.fail(e)}else r.done=!0,r.start=function(){throw Error(`Cursor behind last entry`)},r.stop()};return m.onsuccess=pt(function(e){m.onsuccess=n,n()}),r.continue=i,r.continuePrimaryKey=a,r.advance=o,n(),t},e(r)}},c)})}function a(e,n){return function(r){return new Promise(function(a,o){a=pt(a);var s=r.trans,c=r.values,l=r.limit,u=r.query,d=r.direction??`next`,f=l===1/0?void 0:l,p=u.index,m=u.range,h=s.objectStore(t),g=p.isPrimaryKey?h:h.index(p.name),_=i(m);if(l===0)return a({result:[]});if(n){var v={query:_,count:f,direction:d},y=c?g.getAll(v):g.getAllKeys(v);y.onsuccess=function(e){return a({result:e.target.result})},y.onerror=On(o)}else if(e&&d===`next`){var y=c?g.getAll(_,f):g.getAllKeys(_,f);y.onsuccess=function(e){return a({result:e.target.result})},y.onerror=On(o)}else{var b=0,x=c||!(`openKeyCursor`in g)?g.openCursor(_,d):g.openKeyCursor(_,d),S=[];x.onsuccess=function(){var e=x.result;if(!e||(S.push(c?e.value:e.primaryKey),++b===l))return a({result:S});e.continue()},x.onerror=On(o)}})}}return{name:t,schema:e,mutate:n,getMany:function(e){var n=e.trans,r=e.keys;return new Promise(function(e,i){e=pt(e);for(var a=n.objectStore(t),o=r.length,s=Array(o),c=0,l=0,u,d=function(t){var n=t.target;s[n._pos]=n.result,++l===c&&e(s)},f=On(i),p=0;p<o;++p)r[p]!=null&&(u=a.get(r[p]),u._pos=p,u.onsuccess=d,u.onerror=f,++c);c===0&&e(s)})},get:function(e){var n=e.trans,r=e.key;return new Promise(function(e,i){e=pt(e);var a=n.objectStore(t).get(r);a.onsuccess=function(t){return e(t.target.result)},a.onerror=On(i)})},query:a(l,u),openCursor:r,count:function(e){var n=e.query,r=e.trans,a=n.index,o=n.range;return new Promise(function(e,n){var s=r.objectStore(t),c=a.isPrimaryKey?s:s.index(a.name),l=i(o),u=l?c.count(l):c.count();u.onsuccess=pt(function(t){return e(t.target.result)}),u.onerror=On(n)})}}}var s=r(e,n),c=s.schema,l=s.hasGetAll,u=s.hasIdb3Features,d=c.tables.map(function(e){return a(e)}),f={};return d.forEach(function(e){return f[e.name]=e}),{stack:`dbcore`,transaction:e.transaction.bind(e),table:function(e){if(!f[e])throw Error(`Table '${e}' not found`);return f[e]},MIN_KEY:-1/0,MAX_KEY:Rn(t),schema:c}}function Gn(e,t){return t.reduce(function(e,t){var r=t.create;return n(n({},e),r(e))},e)}function Kn(e,t,n,r){var i=n.IDBKeyRange;return n.indexedDB,{dbcore:Gn(Wn(t,i,r),e.dbcore)}}function qn(e,t){var n=t.db;e.core=Kn(e._middlewares,n,e._deps,t).dbcore,e.tables.forEach(function(t){var n=t.name;e.core.schema.tables.some(function(e){return e.name===n})&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))})}function Jn(e,t,n,r){n.forEach(function(n){var i=r[n];t.forEach(function(t){var r=g(t,n);(!r||`value`in r&&r.value===void 0)&&(t===e.Transaction.prototype||t instanceof e.Transaction?p(t,n,{get:function(){return this.table(n)},set:function(e){f(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,i))})})}function Yn(e,t){t.forEach(function(t){for(var n in t)t[n]instanceof e.Table&&delete t[n]})}function Xn(e,t){return e._cfg.version-t._cfg.version}function Zn(e,t,n,r){var i=e._dbSchema;n.objectStoreNames.contains(`$meta`)&&!i.$meta&&(i.$meta=In(`$meta`,ur(``)[0],[]),e._storeNames.push(`$meta`));var o=e._createTransaction(`readwrite`,e._storeNames,i);o.create(n),o._completion.catch(r);var s=o._reject.bind(o),c=I.transless||I;bt(function(){if(I.trans=o,I.transless=c,t===0)a(i).forEach(function(e){nr(n,e,i[e].primKey,i[e].indexes)}),qn(e,n),L.follow(function(){return e.on.populate.fire(o)}).catch(s);else return qn(e,n),$n(e,o,t).then(function(t){return er(e,t,o,n)}).catch(s)})}function Qn(e,t){rr(e._dbSchema,t),t.db.version%10==0&&!t.objectStoreNames.contains(`$meta`)&&t.db.createObjectStore(`$meta`).add(Math.ceil(t.db.version/10-1),`version`);var n=or(e,e.idbdb,t);lr(e,e._dbSchema,t);for(var r=tr(n,e._dbSchema),i=function(e){if(e.change.length||e.recreate)return console.warn(`Unable to patch indexes of table ${e.name} because it has changes on the type of index or primary key.`),{value:void 0};var n=t.objectStore(e.name);e.add.forEach(function(t){je&&console.debug(`Dexie upgrade patch: Creating missing index ${e.name}.${t.src}`),ar(n,t)})},a=0,o=r.change;a<o.length;a++){var s=o[a],c=i(s);if(typeof c==`object`)return c.value}}function $n(e,t,n){return t.storeNames.includes(`$meta`)?t.table(`$meta`).get(`version`).then(function(e){return e??n}):L.resolve(n)}function er(e,t,n,r){var i=[],o=e._versions,s=e._dbSchema=or(e,e.idbdb,r),c=o.filter(function(e){return e._cfg.version>=t});if(c.length===0)return L.resolve();c.forEach(function(o){i.push(function(){var i=s,c=o._cfg.dbschema;lr(e,i,r),lr(e,c,r),s=e._dbSchema=c;var l=tr(i,c);l.add.forEach(function(e){nr(r,e[0],e[1].primKey,e[1].indexes)}),l.change.forEach(function(e){if(e.recreate)throw new P.Upgrade(`Not yet support for changing primary key`);var t=r.objectStore(e.name);e.add.forEach(function(e){return ar(t,e)}),e.change.forEach(function(e){t.deleteIndex(e.name),ar(t,e)}),e.del.forEach(function(e){return t.deleteIndex(e)})});var u=o._cfg.contentUpgrade;if(u&&o._cfg.version>t){qn(e,r),n._memoizedTables={};var d=E(c);l.del.forEach(function(e){d[e]=i[e]}),Yn(e,[e.Transaction.prototype]),Jn(e,[e.Transaction.prototype],a(d),d),n.schema=d;var f=ce(u);f&&xt();var p,m=L.follow(function(){if(p=u(n),p&&f){var e=St.bind(null,null);p.then(e,e)}});return p&&typeof p.then==`function`?L.resolve(p):m.then(function(){return p})}}),i.push(function(t){var r=o._cfg.dbschema;ir(r,t),Yn(e,[e.Transaction.prototype]),Jn(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),n.schema=e._dbSchema}),i.push(function(t){e.idbdb.objectStoreNames.contains(`$meta`)&&(Math.ceil(e.idbdb.version/10)===o._cfg.version?(e.idbdb.deleteObjectStore(`$meta`),delete e._dbSchema.$meta,e._storeNames=e._storeNames.filter(function(e){return e!==`$meta`})):t.objectStore(`$meta`).put(o._cfg.version,`version`))})});function l(){return i.length?L.resolve(i.shift()(n.idbtrans)).then(l):L.resolve()}return l().then(function(){rr(s,r)})}function tr(e,t){var n={del:[],add:[],change:[]},r;for(r in e)t[r]||n.del.push(r);for(r in t){var i=e[r],a=t[r];if(!i)n.add.push([r,a]);else{var o={name:r,def:a,recreate:!1,del:[],add:[],change:[]};if(``+(i.primKey.keyPath||``)!=``+(a.primKey.keyPath||``)||i.primKey.auto!==a.primKey.auto)o.recreate=!0,n.change.push(o);else{var s=i.idxByName,c=a.idxByName,l=void 0;for(l in s)c[l]||o.del.push(l);for(l in c){var u=s[l],d=c[l];u?u.src!==d.src&&o.change.push(d):o.add.push(d)}(o.del.length>0||o.add.length>0||o.change.length>0)&&n.change.push(o)}}}return n}function nr(e,t,n,r){var i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach(function(e){return ar(i,e)}),i}function rr(e,t){a(e).forEach(function(n){t.db.objectStoreNames.contains(n)||(je&&console.debug(`Dexie: Creating missing table`,n),nr(t,n,e[n].primKey,e[n].indexes))})}function ir(e,t){[].slice.call(t.db.objectStoreNames).forEach(function(n){return e[n]==null&&t.db.deleteObjectStore(n)})}function ar(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function or(e,t,n){var r={};return v(t.objectStoreNames,0).forEach(function(e){for(var t=n.objectStore(e),i=t.keyPath,a=Pn(Fn(i),i||``,!0,!1,!!t.autoIncrement,i&&typeof i!=`string`,!0),o=[],s=0;s<t.indexNames.length;++s){var c=t.index(t.indexNames[s]);i=c.keyPath;var l=Pn(c.name,i,!!c.unique,!!c.multiEntry,!1,i&&typeof i!=`string`,!1);o.push(l)}r[e]=In(e,a,o)}),r}function sr(e,t,n){e.verno=t.version/10;var r=e._dbSchema=or(e,t,n);e._storeNames=v(t.objectStoreNames,0),Jn(e,[e._allTables],a(r),r)}function cr(e,t){var n=tr(or(e,e.idbdb,t),e._dbSchema);return!(n.add.length||n.change.some(function(e){return e.add.length||e.change.length}))}function lr(e,t,n){for(var r=n.db.objectStoreNames,a=0;a<r.length;++a){var o=r[a],s=n.objectStore(o);e._hasGetAll=`getAll`in s;for(var c=0;c<s.indexNames.length;++c){var l=s.indexNames[c],u=s.index(l).keyPath,d=typeof u==`string`?u:`[`+v(u).join(`+`)+`]`;if(t[o]){var f=t[o].idxByName[d];f&&(f.name=l,delete t[o].idxByName[d],t[o].idxByName[l]=f)}}}typeof navigator<`u`&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&i.WorkerGlobalScope&&i instanceof i.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}function ur(e){return e.split(`,`).map(function(e,t){var n=e.split(`:`),r=n[1]?.trim();e=n[0].trim();var i=e.replace(/([&*]|\+\+)/g,``),a=/^\[/.test(i)?i.match(/^\[(.*)\]$/)[1].split(`+`):i;return Pn(i,a||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),o(a),t===0,r)})}var dr=function(){function e(){}return e.prototype._createTableSchema=function(e,t,n){return In(e,t,n)},e.prototype._parseIndexSyntax=function(e){return ur(e)},e.prototype._parseStoresSpec=function(e,t){var n=this;a(e).forEach(function(r){if(e[r]!==null){var i=n._parseIndexSyntax(e[r]),a=i.shift();if(!a)throw new P.Schema(`Invalid schema for table `+r+`: `+e[r]);if(a.unique=!0,a.multi)throw new P.Schema(`Primary key cannot be multiEntry*`);i.forEach(function(e){if(e.auto)throw new P.Schema(`Only primary key can be marked as autoIncrement (++)`);if(!e.keyPath)throw new P.Schema(`Index must have a name and cannot be an empty string`)}),t[r]=n._createTableSchema(r,a,i)}})},e.prototype.stores=function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?s(this._cfg.storesSource,e):e;var n=t._versions,r={},i={};return n.forEach(function(e){s(r,e._cfg.storesSource),i=e._cfg.dbschema={},e._parseStoresSpec(r,i)}),t._dbSchema=i,Yn(t,[t._allTables,t,t.Transaction.prototype]),Jn(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],a(i),i),t._storeNames=a(i),this},e.prototype.upgrade=function(e){return this._cfg.contentUpgrade=Ae(this._cfg.contentUpgrade||Se,e),this},e}();function fr(e){return nn(dr.prototype,function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})}var pr=mr();function mr(){if(typeof FinalizationRegistry<`u`&&typeof WeakRef<`u`){var e=new Set,t=new FinalizationRegistry(function(t){e.delete(t)}),n=function(){return Array.from(e).map(function(e){return e.deref()}).filter(function(e){return e!==void 0})},r=function(n){var r=new WeakRef(n._novip);if(e.add(r),t.register(n._novip,r,r),e.size>n._options.maxConnections){var i=e.values().next().value;e.delete(i),t.unregister(i)}},i=function(n){if(n)for(var r=e.values(),i=r.next();!i.done;){var a=i.value;if(a.deref()===n._novip){e.delete(a),t.unregister(a);return}i=r.next()}};return{toArray:n,add:r,remove:i}}var a=[],n=function(){return a},r=function(e){a.push(e._novip)},i=function(e){if(e){var t=a.indexOf(e._novip);t!==-1&&a.splice(t,1)}};return{toArray:n,add:r,remove:i}}function hr(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new hi(zt,{addons:[],indexedDB:e,IDBKeyRange:t}),n.version(1).stores({dbnames:`name`})),n.table(`dbnames`)}function gr(e){return e&&typeof e.databases==`function`}function _r(e){var t=e.indexedDB,n=e.IDBKeyRange;return gr(t)?Promise.resolve(t.databases()).then(function(e){return e.map(function(e){return e.name}).filter(function(e){return e!==zt})}):hr(t,n).toCollection().primaryKeys()}function vr(e,t){var n=e.indexedDB,r=e.IDBKeyRange;!gr(n)&&t!==zt&&hr(n,r).put({name:t}).catch(Se)}function yr(e,t){var n=e.indexedDB,r=e.IDBKeyRange;!gr(n)&&t!==zt&&hr(n,r).delete(t).catch(Se)}function br(e){return bt(function(){return I.letThrough=!0,e()})}function xr(){if(navigator.userAgentData||!/Safari\//.test(navigator.userAgent)||/Chrom(e|ium)\//.test(navigator.userAgent)||!indexedDB.databases)return Promise.resolve();var e;return new Promise(function(t){var n=function(){return indexedDB.databases().finally(t)};e=setInterval(n,100),n()}).finally(function(){return clearInterval(e)})}var Sr;function Cr(e){return!(`from`in e)}var wr=function(e,t){if(this)s(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0});else{var n=new wr;return e&&`d`in e&&s(n,e),n}};d(wr.prototype,(Sr={add:function(e){return Er(this,e),this},addKey:function(e){return Tr(this,e,e),this},addKeys:function(e){var t=this;return e.forEach(function(e){return Tr(t,e,e)}),this},hasKey:function(e){var t=Or(this).next(e).value;return t&&Kt(t.from,e)<=0&&Kt(t.to,e)>=0}},Sr[re]=function(){return Or(this)},Sr));function Tr(e,t,n){var r=Kt(t,n);if(!isNaN(r)){if(r>0)throw RangeError();if(Cr(e))return s(e,{from:t,to:n,d:1});var i=e.l,a=e.r;if(Kt(n,e.from)<0)return i?Tr(i,t,n):e.l={from:t,to:n,d:1,l:null,r:null},kr(e);if(Kt(t,e.to)>0)return a?Tr(a,t,n):e.r={from:t,to:n,d:1,l:null,r:null},kr(e);Kt(t,e.from)<0&&(e.from=t,e.l=null,e.d=a?a.d+1:1),Kt(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);var o=!e.r;i&&!e.l&&Er(e,i),a&&o&&Er(e,a)}}function Er(e,t){function n(e,t){var r=t.from,i=t.to,a=t.l,o=t.r;Tr(e,r,i),a&&n(e,a),o&&n(e,o)}Cr(t)||n(e,t)}function Dr(e,t){var n=Or(t),r=n.next();if(r.done)return!1;for(var i=r.value,a=Or(e),o=a.next(i.from),s=o.value;!r.done&&!o.done;){if(Kt(s.from,i.to)<=0&&Kt(s.to,i.from)>=0)return!0;Kt(i.from,s.from)<0?i=(r=n.next(s.from)).value:s=(o=a.next(i.from)).value}return!1}function Or(e){var t=Cr(e)?null:{s:0,n:e};return{next:function(e){for(var n=arguments.length>0;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&Kt(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||Kt(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function kr(e){var t=(e.r?.d||0)-(e.l?.d||0),r=t>1?`r`:t<-1?`l`:``;if(r){var i=r===`r`?`l`:`r`,a=n({},e),o=e[r];e.from=o.from,e.to=o.to,e[r]=o[r],a[r]=o[i],e[i]=a,a.d=Ar(a)}e.d=Ar(e)}function Ar(e){var t=e.r,n=e.l;return(t?n?Math.max(t.d,n.d):t.d:n?n.d:0)+1}function jr(e,t){return a(t).forEach(function(n){e[n]?Er(e[n],t[n]):e[n]=j(t[n])}),e}function Mr(e,t){return e.all||t.all||Object.keys(e).some(function(n){return t[n]&&Dr(t[n],e[n])})}var Nr={},Pr={},Fr=!1;function Ir(e,t){jr(Pr,e),Fr||(Fr=!0,setTimeout(function(){Fr=!1;var e=Pr;Pr={},z(e,!1)},0))}function z(e,t){t===void 0&&(t=!1);var n=new Set;if(e.all)for(var r=0,i=Object.values(Nr);r<i.length;r++){var a=i[r];Lr(a,e,n,t)}else for(var o in e){var s=/^idb\:\/\/(.*)\/(.*)\//.exec(o);if(s){var a=Nr[`idb://${s[1]}/${s[2]}`];a&&Lr(a,e,n,t)}}n.forEach(function(e){return e()})}function Lr(e,t,n,r){for(var i=[],a=0,o=Object.entries(e.queries.query);a<o.length;a++){for(var s=o[a],c=s[0],l=s[1],u=[],d=0,f=l;d<f.length;d++){var p=f[d];Mr(t,p.obsSet)?p.subscribers.forEach(function(e){return n.add(e)}):r&&u.push(p)}r&&i.push([c,u])}if(r)for(var m=0,h=i;m<h.length;m++){var g=h[m],c=g[0],u=g[1];e.queries.query[c]=u}}function Rr(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then(function(){return t.dbOpenError?jt(t.dbOpenError):e});t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var r=t.openCanceller,a=Math.round(e.verno*10),o=!1;function s(){if(t.openCanceller!==r)throw new P.DatabaseClosed(`db.open() was cancelled`)}var c=t.dbReadyResolve,l=null,u=!1,d=function(){return new L(function(r,i){if(s(),!n)throw new P.MissingAPI;var c=e.name,f=t.autoSchema||!a?n.open(c):n.open(c,a);if(!f)throw new P.MissingAPI;f.onerror=On(i),f.onblocked=pt(e._fireOnBlocked),f.onupgradeneeded=pt(function(r){if(l=f.transaction,t.autoSchema&&!e._options.allowEmptyDB){f.onerror=R,l.abort(),f.result.close();var a=n.deleteDatabase(c);a.onsuccess=a.onerror=pt(function(){i(new P.NoSuchDatabase(`Database ${c} doesnt exist`))})}else{l.onerror=On(i);var s=r.oldVersion>2**62?0:r.oldVersion;u=s<1,e.idbdb=f.result,o&&Qn(e,l),Zn(e,s/10,l,i)}},i),f.onsuccess=pt(function(){l=null;var n=e.idbdb=f.result,i=v(n.objectStoreNames);if(i.length>0)try{var s=n.transaction(Ln(i),`readonly`);if(t.autoSchema)sr(e,n,s);else if(lr(e,e._dbSchema,s),!cr(e,s)&&!o)return console.warn(`Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this.`),n.close(),a=n.version+1,o=!0,r(d());qn(e,s)}catch{}pr.add(e),n.onversionchange=pt(function(n){t.vcFired=!0,e.on(`versionchange`).fire(n)}),n.onclose=pt(function(){e.close({disableAutoOpen:!1})}),u&&vr(e._deps,c),r()},i)}).catch(function(e){switch(e?.name){case`UnknownError`:if(t.PR1398_maxLoop>0)return t.PR1398_maxLoop--,console.warn(`Dexie: Workaround for Chrome UnknownError on open()`),d();break;case`VersionError`:if(a>0)return a=0,d()}return L.reject(e)})},f=typeof navigator<`u`&&!!n&&n===i.indexedDB;return L.race([r,(f?xr():L.resolve()).then(d)]).then(function(){return s(),t.onReadyBeingFired=[],L.resolve(br(function(){return e.on.ready.fire(e.vip)})).then(function n(){if(t.onReadyBeingFired.length>0){var r=t.onReadyBeingFired.reduce(Ae,Se);return t.onReadyBeingFired=[],L.resolve(br(function(){return r(e.vip)})).then(n)}})}).finally(function(){t.openCanceller===r&&(t.onReadyBeingFired=null,t.isBeingOpened=!1)}).catch(function(n){t.dbOpenError=n;try{l&&l.abort()}catch{}return r===t.openCanceller&&e._close(),jt(n)}).finally(function(){t.openComplete=!0,c()}).then(function(){if(u){var t={};e.tables.forEach(function(n){n.schema.indexes.forEach(function(r){r.name&&(t[`idb://${e.name}/${n.name}/${r.name}`]=new wr(-1/0,[[[]]]))}),t[`idb://${e.name}/${n.name}/`]=t[`idb://${e.name}/${n.name}/:dels`]=new wr(-1/0,[[[]]])}),jn(kn).fire(t),z(t,!0)}return e})}function zr(e){var t=function(t){return e.next(t)},n=function(t){return e.throw(t)},r=a(t),i=a(n);function a(e){return function(t){var n=e(t),a=n.value;return n.done?a:!a||typeof a.then!=`function`?o(a)?Promise.all(a).then(r,i):r(a):a.then(r,i)}}return a(t)()}function Br(e,t,n){var r=arguments.length;if(r<2)throw new P.InvalidArgument(`Too few arguments`);for(var i=Array(r-1);--r;)i[r-1]=arguments[r];return n=i.pop(),[e,O(i),n]}function Vr(e,t,n,r,i){return L.resolve().then(function(){var a=I.transless||I,o=e._createTransaction(t,n,e._dbSchema,r);o.explicit=!0;var s={trans:o,transless:a};if(r)o.idbtrans=r.idbtrans;else try{o.create(),o.idbtrans._explicit=!0,e._state.PR1398_maxLoop=3}catch(r){return r.name===_e.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn(`Dexie: Need to reopen db`),e.close({disableAutoOpen:!1}),e.open().then(function(){return Vr(e,t,n,null,i)})):jt(r)}var c=ce(i);c&&xt();var l,u=L.follow(function(){if(l=i.call(o,o),l){if(c){var e=St.bind(null,null);l.then(e,e)}else typeof l.next==`function`&&typeof l.throw==`function`&&(l=zr(l))}},s);return(l&&typeof l.then==`function`?L.resolve(l).then(function(e){return o.active?e:jt(new P.PrematureCommit(`Transaction committed too early. See http://bit.ly/2kdckMn`))}):u.then(function(){return l})).then(function(e){return r&&o._resolve(),o._completion.then(function(){return e})}).catch(function(e){return o._reject(e),jt(e)})})}function Hr(e,t,n){for(var r=o(e)?e.slice():[e],i=0;i<n;++i)r.push(t);return r}function Ur(e){return n(n({},e),{table:function(t){var r=e.table(t),i=r.schema,a=Object.create(null),o=[];function s(e,t,r){var i=Un(e),c=a[i]=a[i]||[],l=e==null?0:typeof e==`string`?1:e.length,u=t>0,d=n(n({},r),{name:u?`${i}(virtual-from:${r.name})`:r.name,lowLevelIndex:r,isVirtual:u,keyTail:t,keyLength:l,extractKey:zn(e),unique:!u&&r.unique});return c.push(d),d.isPrimaryKey||o.push(d),l>1&&s(l===2?e[0]:e.slice(0,l-1),t+1,r),c.sort(function(e,t){return e.keyTail-t.keyTail}),d}var c=s(i.primaryKey.keyPath,0,i.primaryKey);a[`:id`]=[c];for(var l=0,u=i.indexes;l<u.length;l++){var d=u[l];s(d.keyPath,0,d)}function f(e){var t=a[Un(e)];return t&&t[0]}function p(t,n){return{type:t.type===1?2:t.type,lower:Hr(t.lower,t.lowerOpen?e.MAX_KEY:e.MIN_KEY,n),lowerOpen:!0,upper:Hr(t.upper,t.upperOpen?e.MIN_KEY:e.MAX_KEY,n),upperOpen:!0}}function m(e){var t=e.query.index;return t.isVirtual?n(n({},e),{query:{index:t.lowLevelIndex,range:p(e.query.range,t.keyTail)}}):e}return n(n({},r),{schema:n(n({},i),{primaryKey:c,indexes:o,getIndexByKeyPath:f}),count:function(e){return r.count(m(e))},query:function(e){return r.query(m(e))},openCursor:function(t){var n=t.query.index,i=n.keyTail,a=n.isVirtual,o=n.keyLength;if(!a)return r.openCursor(t);function s(n){function r(r){r==null?t.unique?n.continue(n.key.slice(0,o).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,i)):n.continue():n.continue(Hr(r,t.reverse?e.MAX_KEY:e.MIN_KEY,i))}return Object.create(n,{continue:{value:r},continuePrimaryKey:{value:function(t,r){n.continuePrimaryKey(Hr(t,e.MAX_KEY,i),r)}},primaryKey:{get:function(){return n.primaryKey}},key:{get:function(){var e=n.key;return o===1?e[0]:e.slice(0,o)}},value:{get:function(){return n.value}}})}return r.openCursor(m(t)).then(function(e){return e&&s(e)})}})}})}var Wr={stack:`dbcore`,name:`VirtualIndexMiddleware`,level:1,create:Ur};function Gr(e,t,n,r){return n||={},r||=``,a(e).forEach(function(i){if(!u(t,i))n[r+i]=void 0;else{var a=e[i],o=t[i];if(typeof a==`object`&&typeof o==`object`&&a&&o){var s=ne(a);s===ne(o)?s===`Object`?Gr(a,o,n,r+i+`.`):a!==o&&(n[r+i]=t[i]):n[r+i]=t[i]}else a!==o&&(n[r+i]=t[i])}}),a(t).forEach(function(i){u(e,i)||(n[r+i]=t[i])}),n}function Kr(e,t){return t.type===`delete`?t.keys:t.keys||t.values.map(e.extractKey)}var qr={stack:`dbcore`,name:`HooksMiddleware`,level:2,create:function(e){return n(n({},e),{table:function(t){var i=e.table(t),a=i.schema.primaryKey;return n(n({},i),{mutate:function(e){var o=I.trans,s=o.table(t).hook,c=s.deleting,l=s.creating,d=s.updating;switch(e.type){case`add`:if(l.fire===Se)break;return o._promise(`readwrite`,function(){return f(e)},!0);case`put`:if(l.fire===Se&&d.fire===Se)break;return o._promise(`readwrite`,function(){return f(e)},!0);case`delete`:if(c.fire===Se)break;return o._promise(`readwrite`,function(){return f(e)},!0);case`deleteRange`:if(c.fire===Se)break;return o._promise(`readwrite`,function(){return p(e)},!0)}return i.mutate(e);function f(e){var t=I.trans,o=e.keys||Kr(a,e);if(!o)throw Error(`Keys missing`);return e=e.type===`add`||e.type===`put`?n(n({},e),{keys:o}):n({},e),e.type!==`delete`&&(e.values=r([],e.values,!0)),e.keys&&(e.keys=r([],e.keys,!0)),Jr(i,e,o).then(function(n){var r=o.map(function(r,i){var o=n[i],s={onerror:null,onsuccess:null};if(e.type===`delete`)c.fire.call(s,r,o,t);else if(e.type===`add`||o===void 0){var f=l.fire.call(s,r,e.values[i],t);r==null&&f!=null&&(r=f,e.keys[i]=r,a.outbound||w(e.values[i],a.keyPath,r))}else{var p=Gr(o,e.values[i]),m=d.fire.call(s,p,r,o,t);if(m){var h=e.values[i];Object.keys(m).forEach(function(e){u(h,e)?h[e]=m[e]:w(h,e,m[e])})}}return s});return i.mutate(e).then(function(t){for(var i=t.failures,a=t.results,s=t.numFailures,c=t.lastResult,l=0;l<o.length;++l){var u=a?a[l]:o[l],d=r[l];u==null?d.onerror&&d.onerror(i[l]):d.onsuccess&&d.onsuccess(e.type===`put`&&n[l]?e.values[l]:u)}return{failures:i,results:a,numFailures:s,lastResult:c}}).catch(function(e){return r.forEach(function(t){return t.onerror&&t.onerror(e)}),Promise.reject(e)})})}function p(e){return m(e.trans,e.range,1e4)}function m(e,t,r){return i.query({trans:e,values:!1,query:{index:a,range:t},limit:r}).then(function(i){var a=i.result;return f({type:`delete`,keys:a,trans:e}).then(function(i){return i.numFailures>0?Promise.reject(i.failures[0]):a.length<r?{failures:[],numFailures:0,lastResult:void 0}:m(e,n(n({},t),{lower:a[a.length-1],lowerOpen:!0}),r)})})}}})}})}};function Jr(e,t,n){return t.type===`add`?Promise.resolve([]):e.getMany({trans:t.trans,keys:n,cache:`immutable`})}function Yr(e,t,n){try{if(!t||t.keys.length<e.length)return null;for(var r=[],i=0,a=0;i<t.keys.length&&a<e.length;++i)Kt(t.keys[i],e[a])===0&&(r.push(n?ee(t.values[i]):t.values[i]),++a);return r.length===e.length?r:null}catch{return null}}var Xr={stack:`dbcore`,level:-1,create:function(e){return{table:function(t){var r=e.table(t);return n(n({},r),{getMany:function(e){if(!e.cache)return r.getMany(e);var t=Yr(e.keys,e.trans._cache,e.cache===`clone`);return t?L.resolve(t):r.getMany(e).then(function(t){return e.trans._cache={keys:e.keys,values:e.cache===`clone`?ee(t):t},t})},mutate:function(e){return e.type!==`add`&&(e.trans._cache=null),r.mutate(e)}})}}}};function Zr(e,t){return e.trans.mode===`readonly`&&!!e.subscr&&!e.trans.explicit&&e.trans.db._options.cache!==`disabled`&&!t.schema.primaryKey.outbound}function Qr(e,t){switch(e){case`query`:return t.values&&!t.unique;case`get`:return!1;case`getMany`:return!1;case`count`:return!1;case`openCursor`:return!1}}var $r={stack:`dbcore`,level:0,name:`Observability`,create:function(e){var t=e.schema.name,r=new wr(e.MIN_KEY,e.MAX_KEY);return n(n({},e),{transaction:function(t,n,r){if(I.subscr&&n!==`readonly`)throw new P.ReadOnly(`Readwrite transaction in liveQuery context. Querier source: ${I.querier}`);return e.transaction(t,n,r)},table:function(i){var s=e.table(i),c=s.schema,l=c.primaryKey,u=c.indexes,d=l.extractKey,f=l.outbound,p=l.autoIncrement&&u.filter(function(e){return e.compound&&e.keyPath.includes(l.keyPath)}),m=n(n({},s),{mutate:function(n){var a=n.trans,u=n.mutatedParts||={},d=function(e){var n=`idb://${t}/${i}/${e}`;return u[n]||(u[n]=new wr)},f=d(``),m=d(`:dels`),h=n.type,g=n.type===`deleteRange`?[n.range]:n.type===`delete`?[n.keys]:n.values.length<50?[Kr(l,n).filter(function(e){return e!=null}),n.values]:[],_=g[0],v=g[1],y=n.trans._cache;if(o(_)){f.addKeys(_);var b=h===`delete`||_.length===v.length?Yr(_,y):null;b||m.addKeys(_),(b||v)&&ei(d,c,b,v)}else if(_){var x={from:_.lower??e.MIN_KEY,to:_.upper??e.MAX_KEY};m.add(x),f.add(x)}else f.add(r),m.add(r),c.indexes.forEach(function(e){return d(e.name).add(r)});return s.mutate(n).then(function(e){return _&&(n.type===`add`||n.type===`put`)&&(f.addKeys(e.results),p&&p.forEach(function(t){for(var r=n.values.map(function(e){return t.extractKey(e)}),i=t.keyPath.findIndex(function(e){return e===l.keyPath}),a=0,o=e.results.length;a<o;++a)r[a][i]=e.results[a];d(t.name).addKeys(r)})),a.mutatedParts=jr(a.mutatedParts||{},u),e})}}),h=function(t){var n=t.query,r=n.index,i=n.range;return[r,new wr(i.lower??e.MIN_KEY,i.upper??e.MAX_KEY)]},g={get:function(e){return[l,new wr(e.key)]},getMany:function(e){return[l,new wr().addKeys(e.keys)]},count:h,query:h,openCursor:h};return a(g).forEach(function(e){m[e]=function(a){var o=I.subscr,c=!!o,l=Zr(I,s)&&Qr(e,a)?a.obsSet={}:o;if(c){var u=function(e){var n=`idb://${t}/${i}/${e}`;return l[n]||(l[n]=new wr)},p=u(``),m=u(`:dels`),h=g[e](a),_=h[0],v=h[1];if(e===`query`&&_.isPrimaryKey&&!a.values?m.add(v):u(_.name||``).add(v),!_.isPrimaryKey){if(e===`count`)m.add(r);else{var y=e===`query`&&f&&a.values&&s.query(n(n({},a),{values:!1}));return s[e].apply(this,arguments).then(function(t){if(e===`query`){if(f&&a.values)return y.then(function(e){var n=e.result;return p.addKeys(n),t});var n=a.values?t.result.map(d):t.result;a.values?p.addKeys(n):m.addKeys(n)}else if(e===`openCursor`){var r=t,i=a.values;return r&&Object.create(r,{key:{get:function(){return m.addKey(r.primaryKey),r.key}},primaryKey:{get:function(){var e=r.primaryKey;return m.addKey(e),e}},value:{get:function(){return i&&p.addKey(r.primaryKey),r.value}}})}return t})}}}return s[e].apply(this,arguments)}}),m}})}};function ei(e,t,n,r){function i(t){var i=e(t.name||``);function a(e){return e==null?null:t.extractKey(e)}var s=function(e){return t.multiEntry&&o(e)?e.forEach(function(e){return i.addKey(e)}):i.addKey(e)};(n||r).forEach(function(e,t){var i=n&&a(n[t]),o=r&&a(r[t]);Kt(i,o)!==0&&(i!=null&&s(i),o!=null&&s(o))})}t.indexes.forEach(i)}function ti(e,t,r){if(r.numFailures===0)return t;if(t.type===`deleteRange`)return null;var i=t.keys?t.keys.length:`values`in t&&t.values?t.values.length:1;if(r.numFailures===i)return null;var a=n({},t);return o(a.keys)&&(a.keys=a.keys.filter(function(e,t){return!(t in r.failures)})),`values`in a&&o(a.values)&&(a.values=a.values.filter(function(e,t){return!(t in r.failures)})),a}function ni(e,t){return t.lower===void 0?!0:t.lowerOpen?Kt(e,t.lower)>0:Kt(e,t.lower)>=0}function ri(e,t){return t.upper===void 0?!0:t.upperOpen?Kt(e,t.upper)<0:Kt(e,t.upper)<=0}function ii(e,t){return ni(e,t)&&ri(e,t)}function ai(e,t,n,r,i,a){if(!n||n.length===0)return e;var s=t.query.index,c=s.multiEntry,l=t.query.range,u=r.schema.primaryKey.extractKey,d=s.extractKey,f=(s.lowLevelIndex||s).extractKey,p=n.reduce(function(e,n){var r=e,i=[];if(n.type===`add`||n.type===`put`)for(var a=new wr,s=n.values.length-1;s>=0;--s){var f=n.values[s],p=u(f);if(!a.hasKey(p)){var m=d(f);(c&&o(m)?m.some(function(e){return ii(e,l)}):ii(m,l))&&(a.addKey(p),i.push(f))}}switch(n.type){case`add`:var h=new wr().addKeys(t.values?e.map(function(e){return u(e)}):e);r=e.concat(t.values?i.filter(function(e){var t=u(e);return!h.hasKey(t)&&(h.addKey(t),!0)}):i.map(function(e){return u(e)}).filter(function(e){return!h.hasKey(e)&&(h.addKey(e),!0)}));break;case`put`:var g=new wr().addKeys(n.values.map(function(e){return u(e)}));r=e.filter(function(e){return!g.hasKey(t.values?u(e):e)}).concat(t.values?i:i.map(function(e){return u(e)}));break;case`delete`:var _=new wr().addKeys(n.keys);r=e.filter(function(e){return!_.hasKey(t.values?u(e):e)});break;case`deleteRange`:var v=n.range;r=e.filter(function(e){return!ii(u(e),v)})}return r},e);if(p===e)return e;var m=function(e,t){return Kt(f(e),f(t))||Kt(u(e),u(t))};return p.sort(t.direction===`prev`||t.direction===`prevunique`?function(e,t){return m(t,e)}:m),t.limit&&t.limit<1/0&&(p.length>t.limit?p.length=t.limit:e.length===t.limit&&p.length<t.limit&&(i.dirty=!0)),a?Object.freeze(p):p}function oi(e,t){return Kt(e.lower,t.lower)===0&&Kt(e.upper,t.upper)===0&&!!e.lowerOpen==!!t.lowerOpen&&!!e.upperOpen==!!t.upperOpen}function si(e,t,n,r){if(e===void 0)return t===void 0?0:-1;if(t===void 0)return 1;var i=Kt(e,t);if(i===0){if(n&&r)return 0;if(n)return 1;if(r)return-1}return i}function ci(e,t,n,r){if(e===void 0)return t===void 0?0:1;if(t===void 0)return-1;var i=Kt(e,t);if(i===0){if(n&&r)return 0;if(n)return-1;if(r)return 1}return i}function li(e,t){return si(e.lower,t.lower,e.lowerOpen,t.lowerOpen)<=0&&ci(e.upper,t.upper,e.upperOpen,t.upperOpen)>=0}function ui(e,t,n,r){var i=Nr[`idb://${e}/${t}`];if(!i)return[];var a=i.queries[n];if(!a)return[null,!1,i,null];var o=a[(r.query?r.query.index.name:null)||``];if(!o)return[null,!1,i,null];switch(n){case`query`:var s=r.direction??`next`,c=o.find(function(e){return e.req.limit===r.limit&&e.req.values===r.values&&(e.req.direction??`next`)===s&&oi(e.req.query.range,r.query.range)});return c?[c,!0,i,o]:[o.find(function(e){return(`limit`in e.req?e.req.limit:1/0)>=r.limit&&(e.req.direction??`next`)===s&&(!r.values||e.req.values)&&li(e.req.query.range,r.query.range)}),!1,i,o];case`count`:var l=o.find(function(e){return oi(e.req.query.range,r.query.range)});return[l,!!l,i,o]}}function di(e,t,n,r){e.subscribers.add(n),r.addEventListener(`abort`,function(){e.subscribers.delete(n),e.subscribers.size===0&&fi(e,t)})}function fi(e,t){setTimeout(function(){e.subscribers.size===0&&ae(t,e)},3e3)}var pi={stack:`dbcore`,level:0,name:`Cache`,create:function(e){var t=e.schema.name;return n(n({},e),{transaction:function(n,r,i){var a=e.transaction(n,r,i);if(r===`readwrite`){var o=new AbortController,s=o.signal,c=function(i){return function(){if(o.abort(),r===`readwrite`){for(var s=new Set,c=0,l=n;c<l.length;c++){var u=l[c],d=Nr[`idb://${t}/${u}`];if(d){var f=e.table(u),p=d.optimisticOps.filter(function(e){return e.trans===a});if(a._explicit&&i&&a.mutatedParts)for(var m=0,h=Object.values(d.queries.query);m<h.length;m++)for(var g=h[m],_=0,v=g.slice();_<v.length;_++){var y=v[_];Mr(y.obsSet,a.mutatedParts)&&(ae(g,y),y.subscribers.forEach(function(e){return s.add(e)}))}else if(p.length>0){d.optimisticOps=d.optimisticOps.filter(function(e){return e.trans!==a});for(var b=0,x=Object.values(d.queries.query);b<x.length;b++)for(var g=x[b],S=0,C=g.slice();S<C.length;S++){var y=C[S];if(y.res!=null&&a.mutatedParts){if(i&&!y.dirty){var w=Object.isFrozen(y.res),T=ai(y.res,y.req,p,f,y,w);y.dirty?(ae(g,y),y.subscribers.forEach(function(e){return s.add(e)})):T!==y.res&&(y.res=T,y.promise=L.resolve({result:T}))}else y.dirty&&ae(g,y),y.subscribers.forEach(function(e){return s.add(e)})}}}}}s.forEach(function(e){return e()})}}};a.addEventListener(`abort`,c(!1),{signal:s}),a.addEventListener(`error`,c(!1),{signal:s}),a.addEventListener(`complete`,c(!0),{signal:s})}return a},table:function(r){var i=e.table(r),a=i.schema.primaryKey;return n(n({},i),{mutate:function(e){var o=I.trans;if(a.outbound||o.db._options.cache===`disabled`||o.explicit||o.idbtrans.mode!==`readwrite`)return i.mutate(e);var s=Nr[`idb://${t}/${r}`];if(!s)return i.mutate(e);var c=i.mutate(e);return(e.type===`add`||e.type===`put`)&&(e.values.length>=50||Kr(a,e).some(function(e){return e==null}))?c.then(function(t){var r=ti(s,n(n({},e),{values:e.values.map(function(e,r){if(t.failures[r])return e;var i=a.keyPath?.includes(`.`)?ee(e):n({},e);return w(i,a.keyPath,t.results[r]),i})}),t);s.optimisticOps.push(r),queueMicrotask(function(){return e.mutatedParts&&Ir(e.mutatedParts)})}):(s.optimisticOps.push(e),e.mutatedParts&&Ir(e.mutatedParts),c.then(function(t){if(t.numFailures>0){ae(s.optimisticOps,e);var n=ti(s,e,t);n&&s.optimisticOps.push(n),e.mutatedParts&&Ir(e.mutatedParts)}}),c.catch(function(){ae(s.optimisticOps,e),e.mutatedParts&&Ir(e.mutatedParts)})),c},query:function(e){if(!Zr(I,i)||!Qr(`query`,e))return i.query(e);var n=I.trans?.db._options.cache===`immutable`,a=I,o=a.requery,s=a.signal,c=ui(t,r,`query`,e),l=c[0],u=c[1],d=c[2],f=c[3];if(l&&u)l.obsSet=e.obsSet;else{var p=i.query(e).then(function(e){var t=e.result;if(l&&(l.res=t),n){for(var r=0,i=t.length;r<i;++r)Object.freeze(t[r]);Object.freeze(t)}return e}).catch(function(e){return f&&l&&ae(f,l),Promise.reject(e)});l={obsSet:e.obsSet,promise:p,subscribers:new Set,type:`query`,req:e,dirty:!1},f?f.push(l):(f=[l],d||=Nr[`idb://${t}/${r}`]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}},d.queries.query[e.query.index.name||``]=f)}return di(l,f,o,s),l.promise.then(function(t){var r=ai(t.result,e,d?.optimisticOps,i,l,n);return{result:n?r:ee(r)}})}})}})}};function mi(e,t){return new Proxy(e,{get:function(e,n,r){return n===`db`?t:Reflect.get(e,n,r)}})}var hi=function(){function e(t,r){var i=this;this._middlewares={},this.verno=0;var a=e.dependencies;this._options=r=n({addons:e.addons,autoOpen:!0,indexedDB:a.indexedDB,IDBKeyRange:a.IDBKeyRange,cache:`cloned`,maxConnections:Rt},r),this._deps={indexedDB:r.indexedDB,IDBKeyRange:r.IDBKeyRange};var o=r.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var s={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Se,dbReadyPromise:null,cancelOpen:Se,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:r.autoOpen};s.dbReadyPromise=new L(function(e){s.dbReadyResolve=e}),s.openCanceller=new L(function(e,t){s.cancelOpen=t}),this._state=s,this.name=t,this.on=tn(this,`populate`,`blocked`,`versionchange`,`close`,{ready:[Ae,Se]}),this.once=function(e,t){var n=function(){var r=[...arguments];i.on(e).unsubscribe(n),t.apply(i,r)};return i.on(e,n)},this.on.ready.subscribe=y(this.on.ready.subscribe,function(t){return function(n,r){e.vip(function(){var e=i._state;if(e.openComplete)e.dbOpenError||L.resolve().then(n),r&&t(n);else if(e.onReadyBeingFired)e.onReadyBeingFired.push(n),r&&t(n);else{t(n);var a=i;r||t(function e(){a.on.ready.unsubscribe(n),a.on.ready.unsubscribe(e)})}})}}),this.Collection=hn(this),this.Table=rn(this),this.Transaction=Nn(this),this.Version=fr(this),this.WhereClause=Dn(this),this.on(`versionchange`,function(e){e.newVersion>0?console.warn(`Another connection wants to upgrade database '${i.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${i.name}'. Closing db now to resume the delete request.`),i.close({disableAutoOpen:!1})}),this.on(`blocked`,function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn(`Dexie.delete('${i.name}') was blocked`):console.warn(`Upgrade '${i.name}' blocked by other connection holding version ${e.oldVersion/10}`)}),this._maxKey=Rn(r.IDBKeyRange),this._createTransaction=function(e,t,n,r){return new i.Transaction(e,t,n,i._options.chromeTransactionDurability,r)},this._fireOnBlocked=function(e){i.on(`blocked`).fire(e),pr.toArray().filter(function(e){return e.name===i.name&&e!==i&&!e._state.vcFired}).map(function(t){return t.on(`versionchange`).fire(e)})},this.use(Xr),this.use(pi),this.use($r),this.use(Wr),this.use(qr);var c=new Proxy(this,{get:function(e,t,n){if(t===`_vip`)return!0;if(t===`table`)return function(e){return mi(i.table(e),c)};var r=Reflect.get(e,t,n);return r instanceof en?mi(r,c):t===`tables`?r.map(function(e){return mi(e,c)}):t===`_createTransaction`?function(){return mi(r.apply(this,arguments),c)}:r}});this.vip=c,o.forEach(function(e){return e(i)})}return e.prototype.version=function(e){if(isNaN(e)||e<.1)throw new P.Type(`Given version is not a positive number`);if(e=Math.round(e*10)/10,this.idbdb||this._state.isBeingOpened)throw new P.Schema(`Cannot add version when database is open`);this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter(function(t){return t._cfg.version===e})[0];return n||(n=new this.Version(e),t.push(n),t.sort(Xn),n.stores({}),this._state.autoSchema=!1,n)},e.prototype._whenReady=function(e){var t=this;return this.idbdb&&(this._state.openComplete||I.letThrough||this._vip)?e():new L(function(e,n){if(t._state.openComplete)return n(new P.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen){n(new P.DatabaseClosed);return}t.open().catch(Se)}t._state.dbReadyPromise.then(e,n)}).then(e)},e.prototype.use=function(e){var t=e.stack,n=e.create,r=e.level,i=e.name;i&&this.unuse({stack:t,name:i});var a=this._middlewares[t]||(this._middlewares[t]=[]);return a.push({stack:t,create:n,level:r??10,name:i}),a.sort(function(e,t){return e.level-t.level}),this},e.prototype.unuse=function(e){var t=e.stack,n=e.name,r=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter(function(e){return r?e.create!==r:n?e.name!==n:!1})),this},e.prototype.open=function(){var e=this;return Ot(Je,function(){return Rr(e)})},e.prototype._close=function(){this.on.close.fire(new CustomEvent(`close`));var e=this._state;if(pr.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}e.isBeingOpened||(e.dbReadyPromise=new L(function(t){e.dbReadyResolve=t}),e.openCanceller=new L(function(t,n){e.cancelOpen=n}))},e.prototype.close=function(e){var t=(e===void 0?{disableAutoOpen:!0}:e).disableAutoOpen,n=this._state;t?(n.isBeingOpened&&n.cancelOpen(new P.DatabaseClosed),this._close(),n.autoOpen=!1,n.dbOpenError=new P.DatabaseClosed):(this._close(),n.autoOpen=this._options.autoOpen||n.isBeingOpened,n.openComplete=!1,n.dbOpenError=null)},e.prototype.delete=function(e){var t=this;e===void 0&&(e={disableAutoOpen:!0});var n=arguments.length>0&&typeof arguments[0]!=`object`,r=this._state;return new L(function(i,a){var o=function(){t.close(e);var n=t._deps.indexedDB.deleteDatabase(t.name);n.onsuccess=pt(function(){yr(t._deps,t.name),i()}),n.onerror=On(a),n.onblocked=t._fireOnBlocked};if(n)throw new P.InvalidArgument(`Invalid closeOptions argument to db.delete()`);r.isBeingOpened?r.dbReadyPromise.then(o):o()})},e.prototype.backendDB=function(){return this.idbdb},e.prototype.isOpen=function(){return this.idbdb!==null},e.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&e.name===`DatabaseClosedError`},e.prototype.hasFailed=function(){return this._state.dbOpenError!==null},e.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(e.prototype,"tables",{get:function(){var e=this;return a(this._allTables).map(function(t){return e._allTables[t]})},enumerable:!1,configurable:!0}),e.prototype.transaction=function(){var e=Br.apply(this,arguments);return this._transaction.apply(this,e)},e.prototype._transaction=function(e,t,n){var r=this,i=I.trans;i&&i.db===this&&e.indexOf(`!`)===-1||(i=null);var a=e.indexOf(`?`)!==-1;e=e.replace(`!`,``).replace(`?`,``);var o,s;try{if(s=t.map(function(e){var t=e instanceof r.Table?e.name:e;if(typeof t!=`string`)throw TypeError(`Invalid table argument to Dexie.transaction(). Only Table or String are allowed`);return t}),e==`r`||e===Bt)o=Bt;else if(e==`rw`||e==Vt)o=Vt;else throw new P.InvalidArgument(`Invalid transaction mode: `+e);if(i){if(i.mode===Bt&&o===Vt){if(a)i=null;else throw new P.SubTransaction(`Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY`)}i&&s.forEach(function(e){if(i&&i.storeNames.indexOf(e)===-1){if(a)i=null;else throw new P.SubTransaction(`Table `+e+` not included in parent transaction.`)}}),a&&i&&!i.active&&(i=null)}}catch(e){return i?i._promise(null,function(t,n){n(e)}):jt(e)}var c=Vr.bind(null,this,o,s,i,n);return i?i._promise(o,c,`lock`):I.trans?Ot(I.transless,function(){return r._whenReady(c)}):this._whenReady(c)},e.prototype.table=function(e){if(!u(this._allTables,e))throw new P.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]},e}(),gi=typeof Symbol<`u`&&`observable`in Symbol?Symbol.observable:`@@observable`,_i=function(){function e(e){this._subscribe=e}return e.prototype.subscribe=function(e,t,n){return this._subscribe(!e||typeof e==`function`?{next:e,error:t,complete:n}:e)},e.prototype[gi]=function(){return this},e}(),vi;try{vi={indexedDB:i.indexedDB||i.mozIndexedDB||i.webkitIndexedDB||i.msIndexedDB,IDBKeyRange:i.IDBKeyRange||i.webkitIDBKeyRange}}catch{vi={indexedDB:null,IDBKeyRange:null}}function yi(e){var t=!1,n,r=new _i(function(r){var i=ce(e);function a(t){var n=ot();try{i&&xt();var r=bt(e,t);return i&&(r=r.finally(St)),r}finally{n&&st()}}var o=!1,s,c={},l={},u={get closed(){return o},unsubscribe:function(){o||(o=!0,s&&s.abort(),d&&jn.storagemutated.unsubscribe(m))}};r.start&&r.start(u);var d=!1,f=function(){return At(h)};function p(){return Mr(l,c)}var m=function(e){jr(c,e),p()&&f()},h=function(){if(!o&&vi.indexedDB){c={};var i={};s&&s.abort(),s=new AbortController;var u={subscr:i,signal:s.signal,requery:f,querier:e,trans:null},h=a(u);d||=(jn.storagemutated.subscribe(m),!0),Promise.resolve(h).then(function(e){t=!0,n=e,o||u.signal.aborted||(p()?f():(l=i,p()?f():(c={},At(function(){return!o&&r.next&&r.next(e)}))))},function(e){o||u.signal.aborted||(t=!1,[`DatabaseClosedError`,`AbortError`].includes(e?.name)||o||At(function(){o||r.error&&r.error(e)}))})}};return setTimeout(f,0),u});return r.hasValue=function(){return t},r.getValue=function(){return n},r}var bi=hi;d(bi,n(n({},xe),{delete:function(e){return new bi(e,{addons:[]}).delete()},exists:function(e){return new bi(e,{addons:[]}).open().then(function(e){return e.close(),!0}).catch(`NoSuchDatabaseError`,function(){return!1})},getDatabaseNames:function(e){try{return _r(bi.dependencies).then(e)}catch{return jt(new P.MissingAPI)}},defineClass:function(){function e(e){s(this,e)}return e},ignoreTransaction:function(e){return I.trans?Ot(I.transless||Je,e):e()},vip:br,async:function(e){return function(){try{var t=zr(e.apply(this,arguments));return!t||typeof t.then!=`function`?L.resolve(t):t}catch(e){return jt(e)}}},spawn:function(e,t,n){try{var r=zr(e.apply(n,t||[]));return!r||typeof r.then!=`function`?L.resolve(r):r}catch(e){return jt(e)}},currentTransaction:{get:function(){return I.trans||null}},waitFor:function(e,t){var n=L.resolve(typeof e==`function`?bi.ignoreTransaction(e):e).timeout(t||6e4);return I.trans?I.trans.waitFor(n):n},Promise:L,debug:{get:function(){return je},set:function(e){Me(e)}},derive:m,extend:s,props:d,override:y,Events:tn,on:jn,liveQuery:yi,extendObservabilitySet:jr,getByKeyPath:C,setByKeyPath:w,delByKeyPath:T,shallowClone:E,deepClone:ee,getObjectDiff:Gr,cmp:Kt,asap:x,minKey:Ft,addons:[],connections:{get:pr.toArray},errnames:_e,dependencies:vi,cache:Nr,semVer:Nt,version:Nt.split(`.`).map(function(e){return parseInt(e)}).reduce(function(e,t,n){return e+t/10**(n*2)})})),bi.maxKey=Rn(bi.dependencies.IDBKeyRange),typeof dispatchEvent<`u`&&typeof addEventListener<`u`&&(jn(kn,function(e){if(!Si){var t=new CustomEvent(An,{detail:e});Si=!0,dispatchEvent(t),Si=!1}}),addEventListener(An,function(e){var t=e.detail;Si||xi(t)}));function xi(e){var t=Si;try{Si=!0,jn.storagemutated.fire(e),z(e,!0)}finally{Si=t}}var Si=!1,Ci,wi=function(){};typeof BroadcastChannel<`u`&&(wi=function(){Ci=new BroadcastChannel(An),Ci.onmessage=function(e){return e.data&&xi(e.data)}},wi(),typeof Ci.unref==`function`&&Ci.unref(),jn(kn,function(e){Si||Ci.postMessage(e)})),typeof addEventListener<`u`&&(addEventListener(`pagehide`,function(e){if(!hi.disableBfCache&&e.persisted){je&&console.debug(`Dexie: handling persisted pagehide`),Ci?.close();for(var t=0,n=pr.toArray();t<n.length;t++)n[t].close({disableAutoOpen:!1})}}),addEventListener(`pageshow`,function(e){!hi.disableBfCache&&e.persisted&&(je&&console.debug(`Dexie: handling persisted pageshow`),wi(),xi({all:new wr(-1/0,[[]])}))}));function Ti(e){return new Qt({add:e})}function Ei(e){return new Qt({remove:e})}function Di(e,t){return new Qt({replacePrefix:[e,t]})}return L.rejectionMapper=be,Me(je),n(hi,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:Rt,Dexie:hi,Entity:Gt,PropModification:Qt,RangeSet:wr,add:Ti,cmp:Kt,default:hi,liveQuery:yi,mergeRanges:Er,rangesOverlap:Dr,remove:Ei,replacePrefix:Di}),{default:hi}),hi}))})),y=l(d(),1),b=_(),x=l(v(),1),S=Symbol.for(`Dexie`),C=globalThis[S]||(globalThis[S]=x.default);if(x.default.semVer!==C.semVer)throw Error(`Two different versions of Dexie loaded in the same app: ${x.default.semVer} and ${C.semVer}`);var{liveQuery:w,mergeRanges:T,rangesOverlap:E,RangeSet:D,cmp:O,Entity:k,PropModification:A,replacePrefix:j,add:M,remove:ee,DexieYProvider:N}=C;function te(e,t,n){let r,i;typeof e==`function`?(r=t||[],i=n):(r=[],i=t);let a=y.useRef({hasResult:!1,result:i,error:null}),[o,s]=y.useReducer(e=>e+1,0),c=y.useMemo(()=>{let t=typeof e==`function`?e():e;if(!t||typeof t.subscribe!=`function`)throw TypeError(e===t?`Given argument to useObservable() was neither a valid observable nor a function.`:`Observable factory given to useObservable() did not return a valid observable.`);if(!a.current.hasResult&&typeof window<`u`&&(typeof t.hasValue!=`function`||t.hasValue())){if(typeof t.getValue==`function`)a.current.result=t.getValue(),a.current.hasResult=!0;else{let e=t.subscribe(e=>{a.current.result=e,a.current.hasResult=!0});typeof e==`function`?e():e.unsubscribe()}}return t},r);if(y.useDebugValue(a.current.result),y.useEffect(()=>{let e=c.subscribe(e=>{let{current:t}=a;(t.error!==null||t.result!==e)&&(t.error=null,t.result=e,t.hasResult=!0,s())},e=>{let{current:t}=a;t.error!==e&&(t.error=e,s())});return typeof e==`function`?e:e.unsubscribe.bind(e)},r),a.current.error)throw a.current.error;return a.current.result}function ne(e,t,n){return te(()=>C.liveQuery(e),t||[],n)}typeof FinalizationRegistry<`u`&&new FinalizationRegistry(e=>{let t=C.DexieYProvider;t&&t.release(e)}),Reflect.get(y,`use`);function re(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,a,o=[],s=``,c=e.split(`/`);for(c[0]||c.shift();i=c.shift();)n=i[0],n===`*`?(o.push(n),s+=i[1]===`?`?`(?:/(.*))?`:`/(.*)`):n===`:`?(r=i.indexOf(`?`,1),a=i.indexOf(`.`,1),o.push(i.substring(1,~r?r:~a?a:i.length)),s+=~r&&!~a?`(?:/([^/]+?))?`:`/([^/]+?)`,~a&&(s+=(~r?`?`:``)+`\\`+i.substring(a))):s+=`/`+i;return{keys:o,pattern:RegExp(`^`+s+(t?`(?=$|/)`:`/?$`),`i`)}}var ie=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),ae=o(((e,t)=>{t.exports=ie()}))(),oe=y.useInsertionEffect,se=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?y.useLayoutEffect:y.useEffect,ce=oe||se,le=e=>{let t=y.useRef([e,(...e)=>t[0](...e)]).current;return ce(()=>{t[0]=e}),t[1]},ue=[`popstate`,`pushState`,`replaceState`,`hashchange`],de=[],fe=()=>de.forEach(e=>e()),pe=e=>(de.push(e)===1&&ue.forEach(e=>addEventListener(e,fe)),()=>{de=de.filter(t=>t!==e),de.length||ue.forEach(e=>removeEventListener(e,fe))}),me=(e,t)=>(0,ae.useSyncExternalStore)(pe,e,t),he=()=>location.search,ge=({ssrSearch:e}={})=>me(he,e==null?he:()=>e),_e=()=>location.pathname,ve=({ssrPath:e}={})=>me(_e,e==null?_e:()=>e),P=(e,{replace:t=!1,state:n=null}={})=>history[t?`replaceState`:`pushState`](n,``,e),ye=e=>[ve(e),P],be=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[be]===void 0){for(let e of[`pushState`,`replaceState`]){let t=history[e];history[e]=function(){let n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,be,{value:!0})}var xe=(e=``)=>e===`/`?``:e,Se=(e,t)=>e[0]===`~`?e.slice(1):xe(t)+e,Ce=(e,t)=>(e=we(xe(e)),t=we(t),!e||(t.toLowerCase()+`/`).startsWith(e.toLowerCase()+`/`)?t.slice(e.length)||`/`:`~`+t),we=e=>{try{return e.includes(`%`)?decodeURI(e):e}catch{return e}},Te=e=>we(e[0]===`?`?e.slice(1):e),Ee={hook:ye,searchHook:ge,parser:re,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,n)=>e(t,n)},De=(0,y.createContext)(Ee),Oe=()=>(0,y.useContext)(De),ke={},Ae=(0,y.createContext)(ke),je=()=>(0,y.useContext)(Ae),Me=(e,t=e.base)=>Ce(t,e.hook(e)[0]),Ne=e=>{let[t,n]=e.hook(e);return[Ce(e.base,t),le((t,r)=>e.aroundNav(n,Se(t,e.base),r))]},Pe=()=>Ne(Oe()),Fe=()=>{let e=Oe();return Te(e.searchHook(e))},Ie=(e,t,n,r)=>{let{pattern:i,keys:a}=t instanceof RegExp?{pattern:t}:e(t||`*`,r),o=i.exec(n);if(!o)return[!1,null];let s={};for(let e=1;e<o.length;e++)s[e-1]=o[e];if(a)for(let e=0;e<a.length;e++)s[a[e]]=o[e+1];else Object.assign(s,o.groups);return r?[!0,s,o[0]]:[!0,s]},Le=({children:e,...t})=>{let n=Oe(),r=t.hook?Ee:n,i=r;if(t.ssrPath){let[e,n=t.ssrSearch??``]=t.ssrPath.split(`?`);e&&(t.ssrSearch=n,t.ssrPath=e)}t.hrefs=t.hrefs??t.hook?.hrefs,t.searchHook=t.searchHook??t.hook?.searchHook;let a=(0,y.useRef)(r),o=a.current,s=o;for(let e in r){let n=e===`base`?r[e]+(t[e]??``):t[e]??r[e];n!==s[e]&&(o===s&&(a.current=s={...s}),s[e]=n),(n!==r[e]||n!==i[e])&&(i=s)}return(0,y.createElement)(De.Provider,{value:i},e)},Re=({children:e,component:t},n)=>t?(0,y.createElement)(t,{params:n}):typeof e==`function`?e(n):e,ze=e=>{let t=(0,y.useRef)(ke),n=t.current,r=Object.keys(e);return t.current=r.length!==Object.keys(n).length||r.some(t=>e[t]!==n[t])?e:n},Be=({path:e,nest:t,match:n,...r})=>{let i=Oe(),a=Me(i),[o,s,c]=n??Ie(i.parser,e,a,t),l=ze({...je(),...s});if(!o)return null;let u=Re(r,l);return(0,y.createElement)(Ae.Provider,{value:l},c?(0,y.createElement)(Le,{base:c},u):u)},Ve=(0,y.forwardRef)((e,t)=>{let n=Oe(),[r,i]=Ne(n),{to:a=``,href:o=a,onClick:s,asChild:c,children:l,className:u,replace:d,state:f,transition:p,...m}=e;return m.onClick=le(t=>{t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button!==0||(s?.(t),t.defaultPrevented||(t.preventDefault(),i(o,e)))}),m.href=n.hrefs(o[0]===`~`?o.slice(1):n.base+o,n),u!==void 0&&(m.className=u?.call?u(r===o):u),t&&(m.ref=t),c&&(0,y.isValidElement)(l)?(0,y.cloneElement)(l,m):(0,y.createElement)(`a`,m,l)}),He=(e,t=[])=>{if(Array.isArray(e))for(let n of e)He(n&&n.type===y.Fragment?n.props.children:n,t);else t.push(e);return t},Ue=({children:e,location:t})=>{let n=Oe(),r=Me(n);for(let i of He(e)){let e=0;if((0,y.isValidElement)(i)&&(e=Ie(n.parser,i.props.path,t||r,i.props.nest))[0])return(0,y.cloneElement)(i,{match:e})}return null},F=new class extends C{profiles;posts;notes;checks;constructor(){super(`dissentry`),this.version(1).stores({profiles:`id, handle, createdAt`,posts:`id, rootId, parentId, quoteOfId, profileId, createdAt`,notes:`id, postId, profileId, status, createdAt`,checks:`[postId+profileId], postId, profileId`})}},We=()=>typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():Math.random().toString(36).slice(2)+Date.now().toString(36),Ge=e=>(e.match(/\d+[xX]\d+|[A-Z]?[a-z]+|[A-Z]|\d+/g)??[]).join(`-`).toLowerCase();function Ke(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Ge(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var qe=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},Je=e=>{let t=qe(e);return t.charAt(0).toUpperCase()+t.slice(1)},I=(...e)=>{let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of n.split(/\s+/))e&&t.add(e);return[...t].join(` `)},Ye={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Xe(e){return e!=null}function Ze(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Ye.width,a=e.size??e.height??Ye.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?I(...c):I(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Ye[`stroke-width`])*Number(e.size??e.width??Ye.width)/Number(t.size??t.width??Ye.width):t.strokeWidth??Ye[`stroke-width`];return[`svg`,{...Object.entries(Ye).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Xe(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Xe(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Xe(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function L(e,t={}){return Ze(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Qe=e=>{if(typeof e!=`object`||!e)return!1;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(t.startsWith(`aria-`)||t===`role`||t===`title`)&&e[t]!=null)return!0;return!1},$e=(0,y.createContext)({}),et=()=>(0,y.useContext)($e),tt=(0,y.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=et()??{},b=!!c||Qe(d),[x,S,C=[]]=L(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:I(v,s),hasA11yProp:b,attributes:d});return(0,y.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,y.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function nt(e,t=[],n=[]){let r=typeof e==`string`?Ke(e,t,n):e,i=(0,y.forwardRef)(({className:e,...t},n)=>(0,y.createElement)(tt,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Je(r.name)),i}var rt={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};rt.node;var it=nt(rt),at={name:`badge-check`,size:24,node:[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`verified`]};at.node;var ot=nt(at),st={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};st.node;var ct=nt(st),lt={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};lt.node;var ut=nt(lt),dt={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};dt.node;var ft=nt(dt),pt={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};pt.node;var mt=nt(pt),ht={name:`coins`,size:24,node:[[`path`,{d:`M13.744 17.736a6 6 0 1 1-7.48-7.48`,key:`bq4yh3`}],[`path`,{d:`M15 6h1v4`,key:`11y1tn`}],[`path`,{d:`m6.134 14.768.866-.5 2 3.464`,key:`17snzx`}],[`circle`,{cx:`16`,cy:`8`,r:`6`,key:`14bfc9`}]]};ht.node;var gt=nt(ht),_t={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};_t.node;var vt=nt(_t),yt={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};yt.node;var bt=nt(yt),xt={name:`earth`,size:24,node:[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]],aliases:[`globe-2`]};xt.node;var St=nt(xt),Ct={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};Ct.node;var wt=nt(Ct),Tt={name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]};Tt.node;var Et=nt(Tt),Dt={name:`image-down`,size:24,node:[[`path`,{d:`M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21`,key:`9csbqa`}],[`path`,{d:`m14 19 3 3v-5.5`,key:`9ldu5r`}],[`path`,{d:`m17 22 3-3`,key:`1nkfve`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]};Dt.node;var Ot=nt(Dt),kt={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};kt.node;var At=nt(kt),jt={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};jt.node;var Mt=nt(jt),Nt={name:`message-circle`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]};Nt.node;var Pt=nt(Nt),Ft={name:`message-square-reply`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`m10 8-3 3 3 3`,key:`fp6dz7`}],[`path`,{d:`M17 14v-1a2 2 0 0 0-2-2H7`,key:`1tkjnz`}]]};Ft.node;var It=nt(Ft),Lt={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Lt.node;var Rt=nt(Lt),zt={name:`quote`,size:24,node:[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]};zt.node;var Bt=nt(zt),Vt={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};Vt.node;var Ht=nt(Vt),Ut={name:`scan-search`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`m16 16-1.9-1.9`,key:`1dq9hf`}]]};Ut.node;var Wt=nt(Ut),Gt={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Gt.node;var Kt=nt(Gt),qt={name:`share-2`,size:24,node:[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]};qt.node;var Jt=nt(qt),Yt={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};Yt.node;var Xt=nt(Yt),Zt={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};Zt.node;var Qt=nt(Zt),$t={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]};$t.node;var en=nt($t),tn={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};tn.node;var nn=nt(tn),rn={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};rn.node;var an=nt(rn),on={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};on.node;var sn=nt(on),cn={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};cn.node;var ln=nt(cn),un={"common.back":`Back`,"common.cancel":`Cancel`,"common.checker":`Checker`,"common.close":`Close`,"common.edit":`Edit`,"common.notFound":`Page not found.`,"common.remove":`Remove`,"common.save":`Save`,"nav.home":`Home`,"nav.models":`Models`,"nav.trust":`Trust`,"nav.settings":`Settings`,"nav.newThread":`New thread`,"layout.language":`Language`,"layout.localFirst":`Local-first: your posts and keys stay in this browser.`,"layout.openSource":`Open source (MIT)`,"layout.recent":`Recent threads`,"panel.yourModels":`Your models`,"panel.manage":`Manage`,"panel.noModels":`No models yet. Add one with your own API key, or a local model.`,"panel.addModel":`Add model`,"panel.howTitle":`How it works`,"panel.how1":`@mention a model to ask it anything.`,"panel.how2":`Checker models review every answer and add a note only when something is wrong.`,"panel.how3":`Mark notes right or not helpful to see which models you can trust.`,"home.title":`Home`,"home.sub":`Ask one model. Let the others dissent.`,"home.more":`Show more`,"welcome.title":`Don’t take one model’s word for it.`,"welcome.body":`Ask any AI model a question. Your other models check the answer and add a note only when they find a mistake.`,"welcome.step1":`Add two or more models with your own API keys, or local models.`,"welcome.step2":`Mark the ones that should review answers as checkers.`,"welcome.step3":`@mention a model and watch the notes appear.`,"welcome.cta":`Or add a model with an API key`,"welcome.privacy":`Keys and posts stay in your browser. Nothing is sent to us.`,"tips.title":`Ask your first question`,"tips.body":`@mention a model, or tap one of the chips above. Checkers review the answer and add a note only if they find a problem.`,"tips.saving":`Tip: let a cheap or local model answer and a strong model check. You only pay for a long reply when it’s needed.`,"composer.placeholder":`Ask anything… @mention a model, e.g. @{handle}`,"composer.everyModel":`Every enabled model`,"composer.noModels":`Add a model to start. Cloud models use your own API key; local models (Ollama, LM Studio) need no key.`,"composer.addFirst":`Add your first model`,"composer.asking":`Asking`,"composer.checkedBy":`checked by`,"composer.mentionHint":`Mention a model with @ or tap a chip`,"composer.post":`Post`,"composer.reply":`Reply`,"composer.quote":`Quote`,"post.youName":`You`,"post.you":`you`,"post.deletedModel":`Deleted model`,"post.respondingTo":`Responding to a note from @{handle}`,"post.retry":`Retry`,"post.stopped":`Stopped.`,"post.checking":`Checking with {handles}`,"post.noDissent":`No dissent from {handles}`,"post.couldNotCheck":`@{handle} could not check`,"post.reply":`Reply`,"post.quote":`Quote`,"post.stop":`Stop`,"post.checkAgain":`Check again`,"post.regenerate":`Regenerate`,"post.copy":`Copy`,"post.copied":`Copied`,"post.delete":`Delete`,"post.deleteConfirm":`Delete this post and its replies?`,"note.title":`Dissent`,"note.from":`from @{handle}`,"note.agree":`{handles} agree`,"note.accepted":`You accepted this note`,"note.dismissed":`Dismissed`,"note.right":`Note is right`,"note.notHelpful":`Not helpful`,"note.undo":`Undo`,"note.askRespond":`Ask @{handle} to respond`,"note.seeResponse":`See @{handle}’s response →`,"sev.minor":`minor`,"sev.major":`major`,"sev.critical":`critical`,"quote.hint":`Quote with a note, then @mention who should respond`,"quote.placeholder":`Add a note, e.g. “@{handle} is this right?”`,"quote.placeholderPlain":`Add a note…`,"thread.title":`Thread`,"thread.deleted":`This post was deleted.`,"thread.quoted":`Quoted {n}×`,"thread.replyTo":`Reply to @{handle} (or @mention another model)`,"thread.replyMention":`Reply and @mention a model`,"thread.postReply":`Post your reply…`,"models.title":`Models`,"models.sub":`Bring your own keys, cloud or local`,"models.hostedTitle":`Your keys stay in this browser.`,"models.hostedBody":`Requests go straight from your browser to each provider and never touch our server.`,"models.hostedOllama":`For local models, start Ollama with`,"models.hostedNpx":`— or run Dissentry on your computer:`,"models.checkerHint":`Turn on Checker for models that should review other models’ answers.`,"models.add":`+ Add model`,"models.empty":`No models yet. Try Ollama for a free local model, or add a cloud provider with your API key. Keys are stored only in this browser and sent only to the provider you choose.`,"models.noModel":`no model selected`,"models.on":`On`,"editor.provider":`Provider`,"editor.name":`Display name`,"editor.handle":`Handle (for @mentions)`,"editor.handleTaken":`@{handle} is already used`,"editor.baseUrl":`Base URL`,"editor.key":`API key`,"editor.keyOptional":`API key (optional)`,"editor.keyPlaceholder":`Stored only in this browser`,"editor.keyLocal":`Not needed for local servers`,"editor.getKey":`Get a key →`,"editor.model":`Model`,"editor.fetch":`Fetch models`,"editor.fetching":`Fetching models…`,"editor.modelsFound":`{n} models available`,"editor.instructions":`Extra instructions (optional)`,"editor.instructionsPlaceholder":`e.g. Answer like a senior engineer. Cite sources.`,"editor.checker":`Checker: reviews other models’ answers`,"editor.color":`Color`,"editor.route":`Route through local server`,"editor.routeHint":`Send requests through the local Dissentry server: avoids browser CORS blocks and uses the network proxy from Settings. Keys are passed through, never stored.`,"editor.test":`Test connection`,"editor.testing":`Testing…`,"editor.connected":`Connected in {ms} ms. Replied “{reply}”`,"editor.removeConfirm":`Remove @{handle}? Its posts stay in your timeline.`,"trust.title":`Trust`,"trust.sub":`Who gets corrected, and whose notes hold up, on your questions`,"trust.summary":`answers you confirmed were wrong, out of {n} checked. Without a second opinion you might have trusted them.`,"trust.empty":`Add models and ask some questions to build your trust table.`,"trust.asAnswerer":`As answerer`,"trust.asChecker":`As checker`,"trust.heldUp":`held up`,"trust.notesRight":`of rated notes were right`,"trust.answers":`Answers: {a} · checked: {c}`,"trust.corrected":`{n} corrected by a note you accepted`,"trust.awaiting":`{n} notes awaiting your verdict`,"trust.reviewed":`Reviewed: {a} · notes: {n}`,"trust.acceptedDismissed":`{a} accepted · {d} dismissed`,"trust.footnote":`Numbers come only from your own votes on notes, so they describe how each model does on your questions.`,"settings.title":`Settings`,"settings.profile":`Profile`,"settings.name":`Your display name`,"settings.autoCheck":`Check every answer automatically`,"settings.autoCheckDesc":`Checkers review each answer when it finishes. Turn off to check manually with the 🔍 button (saves tokens).`,"settings.data":`Your data`,"settings.dataDesc":`Everything lives in this browser. Export to back up or move to another device.`,"settings.export":`Export (without keys)`,"settings.exportKeys":`Export with API keys`,"settings.import":`Import…`,"settings.imported":`Imported.`,"settings.importFailed":`Import failed: {error}`,"settings.clear":`Clear all data`,"settings.clearConfirm":`Delete all posts, notes and models from this browser? This cannot be undone.`,"settings.cleared":`All data cleared.`,"connection.title":`Connection`,"connection.hostedDesc":`Requests go directly from your browser to each AI provider, using your device’s network. If a provider is blocked where you are, turn on your VPN or system proxy and Dissentry will use it automatically.`,"proxy.title":`Network proxy`,"proxy.localDesc":`Provider requests go through the local Dissentry server (no CORS problems; keys are passed through, never stored). Choose how it connects out.`,"proxy.system":`System`,"proxy.systemFound":`Use the proxy from the environment:`,"proxy.systemNone":`Use HTTPS_PROXY / HTTP_PROXY if set when Dissentry starts. None detected, so requests go direct.`,"proxy.direct":`No proxy`,"proxy.directDesc":`Connect to every provider directly.`,"proxy.custom":`Custom proxy`,"proxy.customDesc":`For example your Clash, V2Ray or Shadowsocks client, or a company proxy.`,"proxy.address":`Proxy address`,"proxy.addressHelp":`HTTP, HTTPS and SOCKS5 are supported. For a login use http://user:pass@host:port.`,"proxy.bypass":`Don’t use the proxy for (optional)`,"proxy.bypassHelp":`Comma-separated hosts; a leading dot matches subdomains. Local addresses (Ollama, LM Studio) always connect directly.`,"proxy.enterAddress":`Enter a proxy address.`,"proxy.badScheme":`Use http://, https:// or socks5://`,"proxy.badUrl":`Looks like: http://127.0.0.1:7890 or socks5://127.0.0.1:1080`,"proxy.test":`Test connection`,"proxy.testing":`Testing…`,"proxy.reachable":`Reachable in {ms} ms (HTTP {status}; 401 is expected without a key).`,"err.auth":`Authentication failed for @{handle}: check the API key. ({msg})`,"err.model":`Model “{model}” not found for @{handle}. ({msg})`,"err.quota":`@{handle} hit a rate limit or ran out of credit. ({msg})`,"err.unreachable":`Could not reach {url}. Check your network or proxy.`,"err.localHosted":`Could not reach {url}. Is it running? Ollama must allow this site: start it with OLLAMA_ORIGINS={origin} ollama serve (your browser may also ask to allow local network access).`,"err.blockedHosted":`Your browser could not reach {url}. If this provider is blocked on your network, turn on your VPN or system proxy and try again.`,"err.empty":`The model returned an empty answer.`,"post.share":`Share as image`,"share.title":`Share as image`,"share.rendering":`Rendering…`,"share.includeQuestion":`Include the question`,"share.failed":`Could not create the image: {error}`,"share.postX":`Post on X`,"share.copy":`Copy image`,"share.download":`Download`,"share.native":`Share…`,"share.privacy":`The image is made on your device. Nothing is uploaded.`,"share.copied":`Image copied.`,"share.copyUnsupported":`This browser can’t copy images. Use Download instead.`,"share.pasteHint":`Image copied: paste it into your post (⌘V / Ctrl+V).`,"share.attachHint":`Image downloaded: attach it to your post.`,"share.tweetNote":`{author} sounded sure. {checkers} disagreed. 📝
11
+ `+r:``}`,this.inner=r||null):typeof e==`object`&&(this.message=`${e.name} ${e.message}`,this.inner=e):(this.message=fe[t]||n,this.inner=null)}return m(r).from(ve),e[t]=r,e},{});P.Syntax=SyntaxError,P.Type=TypeError,P.Range=RangeError;var ye=ue.reduce(function(e,t){return e[t+`Error`]=P[t],e},{});function be(e,t){if(!e||e instanceof pe||e instanceof TypeError||e instanceof SyntaxError||!e.name||!ye[e.name])return e;var n=new ye[e.name](t||e.message,e);return`stack`in e&&p(n,`stack`,{get:function(){return this.inner.stack}}),n}var xe=de.reduce(function(e,t){return[`Syntax`,`Type`,`Range`].indexOf(t)===-1&&(e[t+`Error`]=P[t]),e},{});xe.ModifyError=he,xe.DexieError=pe,xe.BulkError=ge;function Se(){}function Ce(e){return e}function we(e,t){return e==null||e===Ce?t:function(n){return t(e(n))}}function Te(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Ee(e,t){return e===Se?t:function(){var n=e.apply(this,arguments);n!==void 0&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?Te(r,this.onsuccess):r),i&&(this.onerror=this.onerror?Te(i,this.onerror):i),a===void 0?n:a}}function De(e,t){return e===Se?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?Te(n,this.onsuccess):n),r&&(this.onerror=this.onerror?Te(r,this.onerror):r)}}function Oe(e,t){return e===Se?t:function(){var n=e.apply(this,arguments),r=arguments[0];s(r,n);var i=this.onsuccess,a=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?Te(i,this.onsuccess):i),a&&(this.onerror=this.onerror?Te(a,this.onerror):a),n===void 0?o===void 0?void 0:o:s(n,o)}}function ke(e,t){return e===Se?t:function(){return t.apply(this,arguments)!==!1&&e.apply(this,arguments)}}function Ae(e,t){return e===Se?t:function(){var n=e.apply(this,arguments);if(n&&typeof n.then==`function`){for(var r=this,i=arguments.length,a=Array(i);i--;)a[i]=arguments[i];return n.then(function(){return t.apply(r,a)})}return t.apply(this,arguments)}}var je=typeof location<`u`&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Me(e,t){je=e}var Ne={},Pe=100,Fe=typeof Promise>`u`?[]:(function(){var e=Promise.resolve();if(typeof crypto>`u`||!crypto.subtle)return[e,c(e),e];var t=crypto.subtle.digest(`SHA-512`,new Uint8Array([0]));return[t,c(t),e]})(),Ie=Fe[0],Le=Fe[1],Re=Fe[2],ze=Le&&Le.then,Be=Ie&&Ie.constructor,Ve=!!Re;function He(){queueMicrotask(at)}var Ue=function(e,t){Ye.push([e,t]),We&&=(He(),!1)},F=!0,We=!0,Ge=[],Ke=[],qe=Ce,Je={id:`global`,global:!0,ref:0,unhandleds:[],onunhandled:Se,pgp:!1,env:{},finalize:Se},I=Je,Ye=[],Xe=0,Ze=[];function L(e){if(typeof this!=`object`)throw TypeError(`Promises must be constructed via new`);this._listeners=[],this._lib=!1;var t=this._PSD=I;if(typeof e!=`function`){if(e!==Ne)throw TypeError(`Not a function`);this._state=arguments[1],this._value=arguments[2],this._state===!1&&tt(this,this._value)}else this._state=null,this._value=null,++t.ref,et(this,e)}var Qe={get:function(){var e=I,t=vt;function n(n,r){var i=this,a=!e.global&&(e!==I||t!==vt),o=a&&!St(),s=new L(function(t,s){rt(i,new $e(kt(n,e,a,o),kt(r,e,a,o),t,s,e))});return this._consoleTask&&(s._consoleTask=this._consoleTask),s}return n.prototype=Ne,n},set:function(e){p(this,`then`,e&&e.prototype===Ne?Qe:{get:function(){return e},set:Qe.set})}};d(L.prototype,{then:Qe,_then:function(e,t){rt(this,new $e(null,null,e,t,I))},catch:function(e){if(arguments.length===1)return this.then(null,e);var t=arguments[0],n=arguments[1];return typeof t==`function`?this.then(null,function(e){return e instanceof t?n(e):ft(e)}):this.then(null,function(e){return e&&e.name===t?n(e):ft(e)})},finally:function(e){return this.then(function(t){return L.resolve(e()).then(function(){return t})},function(t){return L.resolve(e()).then(function(){return ft(t)})})},timeout:function(e,t){var n=this;return e<1/0?new L(function(r,i){var a=setTimeout(function(){return i(new P.Timeout(t))},e);n.then(r,i).finally(clearTimeout.bind(null,a))}):this}}),typeof Symbol<`u`&&Symbol.toStringTag&&p(L.prototype,Symbol.toStringTag,`Dexie.Promise`),Je.env=Dt();function $e(e,t,n,r,i){this.onFulfilled=typeof e==`function`?e:null,this.onRejected=typeof t==`function`?t:null,this.resolve=n,this.reject=r,this.psd=i}d(L,{all:function(){var e=se.apply(null,arguments).map(Ct);return new L(function(t,n){e.length===0&&t([]);var r=e.length;e.forEach(function(i,a){return L.resolve(i).then(function(n){e[a]=n,--r||t(e)},n)})})},resolve:function(e){return e instanceof L?e:e&&typeof e.then==`function`?new L(function(t,n){e.then(t,n)}):new L(Ne,!0,e)},reject:ft,race:function(){var e=se.apply(null,arguments).map(Ct);return new L(function(t,n){e.map(function(e){return L.resolve(e).then(t,n)})})},PSD:{get:function(){return I},set:function(e){return I=e}},totalEchoes:{get:function(){return vt}},newPSD:bt,usePSD:Ot,scheduler:{get:function(){return Ue},set:function(e){Ue=e}},rejectionMapper:{get:function(){return qe},set:function(e){qe=e}},follow:function(e,t){return new L(function(n,r){return bt(function(t,n){var r=I;r.unhandleds=[],r.onunhandled=n,r.finalize=Te(function(){var e=this;lt(function(){e.unhandleds.length===0?t():n(e.unhandleds[0])})},r.finalize),e()},t,n,r)})}}),Be&&(Be.allSettled&&p(L,`allSettled`,function(){var e=se.apply(null,arguments).map(Ct);return new L(function(t){e.length===0&&t([]);var n=e.length,r=Array(n);e.forEach(function(e,i){return L.resolve(e).then(function(e){return r[i]={status:`fulfilled`,value:e}},function(e){return r[i]={status:`rejected`,reason:e}}).then(function(){return--n||t(r)})})})}),Be.any&&typeof AggregateError<`u`&&p(L,`any`,function(){var e=se.apply(null,arguments).map(Ct);return new L(function(t,n){e.length===0&&n(AggregateError([]));var r=e.length,i=Array(r);e.forEach(function(e,a){return L.resolve(e).then(function(e){return t(e)},function(e){i[a]=e,--r||n(AggregateError(i))})})})}),Be.withResolvers&&(L.withResolvers=Be.withResolvers));function et(e,t){try{t(function(t){if(e._state===null){if(t===e)throw TypeError(`A promise cannot be resolved with itself.`);var n=e._lib&&ot();t&&typeof t.then==`function`?et(e,function(e,n){t instanceof L?t._then(e,n):t.then(e,n)}):(e._state=!0,e._value=t,nt(e)),n&&st()}},tt.bind(null,e))}catch(t){tt(e,t)}}function tt(e,t){if(Ke.push(t),e._state===null){var n=e._lib&&ot();t=qe(t),e._state=!1,e._value=t,ut(e),nt(e),n&&st()}}function nt(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)rt(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),Xe===0&&(++Xe,Ue(function(){--Xe===0&&ct()},[]))}function rt(e,t){if(e._state===null)e._listeners.push(t);else{var n=e._state?t.onFulfilled:t.onRejected;if(n===null)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++Xe,Ue(it,[n,e,t])}}function it(e,t,n){try{var r,i=t._value;!t._state&&Ke.length&&(Ke=[]),r=je&&t._consoleTask?t._consoleTask.run(function(){return e(i)}):e(i),!t._state&&Ke.indexOf(i)===-1&&dt(t),n.resolve(r)}catch(e){n.reject(e)}finally{--Xe===0&&ct(),--n.psd.ref||n.psd.finalize()}}function at(){Ot(Je,function(){ot()&&st()})}function ot(){var e=F;return F=!1,We=!1,e}function st(){var e,t,n;do for(;Ye.length>0;)for(e=Ye,Ye=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}while(Ye.length>0);F=!0,We=!0}function ct(){var e=Ge;Ge=[],e.forEach(function(e){e._PSD.onunhandled.call(null,e._value,e)});for(var t=Ze.slice(0),n=t.length;n;)t[--n]()}function lt(e){function t(){e(),Ze.splice(Ze.indexOf(t),1)}Ze.push(t),++Xe,Ue(function(){--Xe===0&&ct()},[])}function ut(e){Ge.some(function(t){return t._value===e._value})||Ge.push(e)}function dt(e){for(var t=Ge.length;t;)if(Ge[--t]._value===e._value){Ge.splice(t,1);return}}function ft(e){return new L(Ne,!1,e)}function pt(e,t){var n=I;return function(){var r=ot(),i=I;try{return Et(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{Et(i,!1),r&&st()}}}var mt={awaits:0,echoes:0,id:0},ht=0,gt=[],_t=0,vt=0,yt=0;function bt(e,t,n,r){var i=I,a=Object.create(i);a.parent=i,a.ref=0,a.global=!1,a.id=++yt,Je.env,a.env=Ve?{Promise:L,PromiseProp:{value:L,configurable:!0,writable:!0},all:L.all,race:L.race,allSettled:L.allSettled,any:L.any,resolve:L.resolve,reject:L.reject}:{},t&&s(a,t),++i.ref,a.finalize=function(){--this.parent.ref||this.parent.finalize()};var o=Ot(a,e,n,r);return a.ref===0&&a.finalize(),o}function xt(){return mt.id||=++ht,++mt.awaits,mt.echoes+=Pe,mt.id}function St(){return mt.awaits?(--mt.awaits===0&&(mt.id=0),mt.echoes=mt.awaits*Pe,!0):!1}(``+ze).indexOf(`[native code]`)===-1&&(xt=St=Se);function Ct(e){return mt.echoes&&e&&e.constructor===Be?(xt(),e.then(function(e){return St(),e},function(e){return St(),jt(e)})):e}function wt(e){++vt,mt.echoes&&--mt.echoes!==0||(mt.echoes=mt.awaits=mt.id=0),gt.push(I),Et(e,!0)}function Tt(){var e=gt[gt.length-1];gt.pop(),Et(e,!1)}function Et(e,t){var n=I;if((t?mt.echoes&&(!_t++||e!==I):_t&&(!--_t||e!==I))&&queueMicrotask(t?wt.bind(null,e):Tt),e!==I&&(I=e,n===Je&&(Je.env=Dt()),Ve)){var r=Je.env.Promise,a=e.env;(n.global||e.global)&&(Object.defineProperty(i,"Promise",a.PromiseProp),r.all=a.all,r.race=a.race,r.resolve=a.resolve,r.reject=a.reject,a.allSettled&&(r.allSettled=a.allSettled),a.any&&(r.any=a.any))}}function Dt(){var e=i.Promise;return Ve?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(i,`Promise`),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject}:{}}function Ot(e,t,n,r,i){var a=I;try{return Et(e,!0),t(n,r,i)}finally{Et(a,!1)}}function kt(e,t,n,r){return typeof e==`function`?function(){var i=I;n&&xt(),Et(t,!0);try{return e.apply(this,arguments)}finally{Et(i,!1),r&&queueMicrotask(St)}}:e}function At(e){Promise===Be&&mt.echoes===0?_t===0?e():enqueueNativeMicroTask(e):setTimeout(e,0)}var jt=L.reject;function Mt(e,t,n,r){if(!e.idbdb||!e._state.openComplete&&!I.letThrough&&!e._vip){if(e._state.openComplete)return jt(new P.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._state.autoOpen)return jt(new P.DatabaseClosed);e.open().catch(Se)}return e._state.dbReadyPromise.then(function(){return Mt(e,t,n,r)})}var i=e._createTransaction(t,n,e._dbSchema);try{i.create(),e._state.PR1398_maxLoop=3}catch(i){return i.name===_e.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn(`Dexie: Need to reopen db`),e.close({disableAutoOpen:!1}),e.open().then(function(){return Mt(e,t,n,r)})):jt(i)}return i._promise(t,function(e,t){return bt(function(){return I.trans=i,r(e,t,i)})}).then(function(e){if(t===`readwrite`)try{i.idbtrans.commit()}catch{}return t===`readonly`?e:i._completion.then(function(){return e})})}var Nt=`4.4.7`,Pt=`￿`,Ft=-1/0,It=`Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.`,Lt=`String expected.`,Rt=1e3,zt=`__dbnames`,Bt=`readonly`,Vt=`readwrite`;function Ht(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var Ut={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Wt(e){return typeof e==`string`&&!/\./.test(e)?function(t){return t[e]===void 0&&e in t&&(t=ee(t),delete t[e]),t}:function(e){return e}}function Gt(){throw P.Type(`Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.`)}function Kt(e,t){try{var n=Yt(e),r=Yt(t);if(n!==r)return n===`Array`?1:r===`Array`?-1:n===`binary`?1:r===`binary`?-1:n===`string`?1:r===`string`?-1:n===`Date`?1:r===`Date`?-1:NaN;switch(n){case`number`:case`Date`:case`string`:return e>t?1:e<t?-1:0;case`binary`:return Jt(Xt(e),Xt(t));case`Array`:return qt(e,t)}}catch{}return NaN}function qt(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,a=0;a<i;++a){var o=Kt(e[a],t[a]);if(o!==0)return o}return n===r?0:n<r?-1:1}function Jt(e,t){for(var n=e.length,r=t.length,i=n<r?n:r,a=0;a<i;++a)if(e[a]!==t[a])return e[a]<t[a]?-1:1;return n===r?0:n<r?-1:1}function Yt(e){var t=typeof e;if(t!==`object`)return t;if(ArrayBuffer.isView(e))return`binary`;var n=ne(e);return n===`ArrayBuffer`?`binary`:n}function Xt(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}function Zt(e,t,n){var r=e.schema.yProps;return r?(t&&n.numFailures>0&&(t=t.filter(function(e,t){return!n.failures[t]})),Promise.all(r.map(function(n){var r=n.updatesTable;return t?e.db.table(r).where(`k`).anyOf(t).delete():e.db.table(r).clear()})).then(function(){return n})):n}var Qt=function(){function e(e){this[`@@propmod`]=e}return e.prototype.execute=function(e){var t=this[`@@propmod`];if(t.add!==void 0){var n=t.add;if(o(n))return r(r([],o(e)?e:[],!0),n,!0).sort();if(typeof n==`number`)return(Number(e)||0)+n;if(typeof n==`bigint`)try{return BigInt(e)+n}catch{return BigInt(0)+n}throw TypeError(`Invalid term ${n}`)}if(t.remove!==void 0){var i=t.remove;if(o(i))return o(e)?e.filter(function(e){return!i.includes(e)}).sort():[];if(typeof i==`number`)return Number(e)-i;if(typeof i==`bigint`)try{return BigInt(e)-i}catch{return BigInt(0)-i}throw TypeError(`Invalid subtrahend ${i}`)}var a=t.replacePrefix?.[0];return a&&typeof e==`string`&&e.startsWith(a)?t.replacePrefix[1]+e.substring(a.length):e},e}();function $t(e,t){for(var n=a(t),r=n.length,i=!1,o=0;o<r;++o){var s=n[o],c=t[s],l=C(e,s);c instanceof Qt?(w(e,s,c.execute(l)),i=!0):l!==c&&(w(e,s,c),i=!0)}return i}var en=function(){function e(){}return e.prototype._trans=function(e,t,n){var r=this._tx||I.trans,i=this.name,a=je&&typeof console<`u`&&console.createTask&&console.createTask(`Dexie: ${e===`readonly`?`read`:`write`} ${this.name}`);function o(e,n,r){if(!r.schema[i])throw new P.NotFound(`Table `+i+` not part of transaction`);return t(r.idbtrans,r)}var s=ot();try{var c=r&&r.db._novip===this.db._novip?r===I.trans?r._promise(e,o,n):bt(function(){return r._promise(e,o,n)},{trans:r,transless:I.transless||I}):Mt(this.db,e,[this.name],o);return a&&(c._consoleTask=a,c=c.catch(function(e){return console.trace(e),jt(e)})),c}finally{s&&st()}},e.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):e==null?jt(new P.Type(`Invalid argument to Table.get()`)):this._trans(`readonly`,function(t){return n.core.get({trans:t,key:e}).then(function(e){return n.hook.reading.fire(e)})}).then(t)},e.prototype.where=function(e){if(typeof e==`string`)return new this.db.WhereClause(this,e);if(o(e))return new this.db.WhereClause(this,`[${e.join(`+`)}]`);var t=a(e);if(t.length===1)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter(function(e){if(e.compound&&t.every(function(t){return e.keyPath.indexOf(t)>=0})){for(var n=0;n<t.length;++n)if(t.indexOf(e.keyPath[n])===-1)return!1;return!0}return!1}).sort(function(e,t){return e.keyPath.length-t.keyPath.length})[0];if(n&&this.db._maxKey!==Pt){var r=n.keyPath.slice(0,t.length);return this.where(r).equals(r.map(function(t){return e[t]}))}!n&&je&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit from a compound index [${t.join(`+`)}]`);var i=this.schema.idxByName;function s(e,t){return Kt(e,t)===0}var c=t.reduce(function(t,n){var r=t[0],a=t[1],c=i[n],l=e[n];return[r||c,r||!c?Ht(a,c&&c.multi?function(e){var t=C(e,n);return o(t)&&t.some(function(e){return s(l,e)})}:function(e){return s(l,C(e,n))}):a]},[null,null]),l=c[0],u=c[1];return l?this.where(l.name).equals(e[l.keyPath]).filter(u):n?this.filter(u):this.where(t).equals(``)},e.prototype.filter=function(e){return this.toCollection().and(e)},e.prototype.count=function(e){return this.toCollection().count(e)},e.prototype.offset=function(e){return this.toCollection().offset(e)},e.prototype.limit=function(e){return this.toCollection().limit(e)},e.prototype.each=function(e){return this.toCollection().each(e)},e.prototype.toArray=function(e){return this.toCollection().toArray(e)},e.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},e.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,o(e)?`[${e.join(`+`)}]`:e))},e.prototype.reverse=function(){return this.toCollection().reverse()},e.prototype.mapToClass=function(e){var n=this,r=n.db,i=n.name;this.schema.mappedClass=e,e.prototype instanceof Gt&&(e=function(e){t(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}return Object.defineProperty(n.prototype,"db",{get:function(){return r},enumerable:!1,configurable:!0}),n.prototype.table=function(){return i},n}(e));for(var a=new Set,o=e.prototype;o;o=c(o))Object.getOwnPropertyNames(o).forEach(function(e){return a.add(e)});var s=function(t){if(!t)return t;var n=Object.create(e.prototype);for(var r in t)if(!a.has(r))try{n[r]=t[r]}catch{}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=s,this.hook(`reading`,s),e},e.prototype.defineClass=function(){function e(e){s(this,e)}return this.mapToClass(e)},e.prototype.add=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,a=r.keyPath,o=e;return a&&i&&(o=Wt(a)(e)),this._trans(`readwrite`,function(e){return n.core.mutate({trans:e,type:`add`,keys:t==null?null:[t],values:[o]})}).then(function(e){return e.numFailures?L.reject(e.failures[0]):e.lastResult}).then(function(t){if(a)try{w(e,a,t)}catch{}return t})},e.prototype.upsert=function(e,t){var n=this,r=this.schema.primKey.keyPath;return this._trans(`readwrite`,function(i){return n.core.get({trans:i,key:e}).then(function(a){var o=a??{};return $t(o,t),r&&w(o,r,e),n.core.mutate({trans:i,type:`put`,values:[o],keys:[e],upsert:!0,updates:{keys:[e],changeSpecs:[t]}}).then(function(e){return e.numFailures?L.reject(e.failures[0]):!!a})})})},e.prototype.update=function(e,t){if(typeof e==`object`&&!o(e)){var n=C(e,this.schema.primKey.keyPath);return n===void 0?jt(new P.InvalidArgument(`Given object does not contain its primary key`)):this.where(`:id`).equals(n).modify(t)}return this.where(`:id`).equals(e).modify(t)},e.prototype.put=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,a=r.keyPath,o=e;return a&&i&&(o=Wt(a)(e)),this._trans(`readwrite`,function(e){return n.core.mutate({trans:e,type:`put`,values:[o],keys:t==null?null:[t]})}).then(function(e){return e.numFailures?L.reject(e.failures[0]):e.lastResult}).then(function(t){if(a)try{w(e,a,t)}catch{}return t})},e.prototype.delete=function(e){var t=this;return this._trans(`readwrite`,function(n){return t.core.mutate({trans:n,type:`delete`,keys:[e]}).then(function(n){return Zt(t,[e],n)}).then(function(e){return e.numFailures?L.reject(e.failures[0]):void 0})})},e.prototype.clear=function(){var e=this;return this._trans(`readwrite`,function(t){return e.core.mutate({trans:t,type:`deleteRange`,range:Ut}).then(function(t){return Zt(e,null,t)})}).then(function(e){return e.numFailures?L.reject(e.failures[0]):void 0})},e.prototype.bulkGet=function(e){var t=this;return this._trans(`readonly`,function(n){return t.core.getMany({keys:e,trans:n}).then(function(e){return e.map(function(e){return t.hook.reading.fire(e)})})})},e.prototype.bulkAdd=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0;n||=i?void 0:t;var a=n?n.allKeys:void 0;return this._trans(`readwrite`,function(t){var n=r.schema.primKey,o=n.auto,s=n.keyPath;if(s&&i)throw new P.InvalidArgument(`bulkAdd(): keys argument invalid on tables with inbound keys`);if(i&&i.length!==e.length)throw new P.InvalidArgument(`Arguments objects and keys must have the same length`);var c=e.length,l=s&&o?e.map(Wt(s)):e;return r.core.mutate({trans:t,type:`add`,keys:i,values:l,wantResults:a}).then(function(e){var t=e.numFailures,n=e.results,i=e.lastResult,o=e.failures,s=a?n:i;if(t===0)return s;throw new ge(`${r.name}.bulkAdd(): ${t} of ${c} operations failed`,o)})})},e.prototype.bulkPut=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0;n||=i?void 0:t;var a=n?n.allKeys:void 0;return this._trans(`readwrite`,function(t){var n=r.schema.primKey,o=n.auto,s=n.keyPath;if(s&&i)throw new P.InvalidArgument(`bulkPut(): keys argument invalid on tables with inbound keys`);if(i&&i.length!==e.length)throw new P.InvalidArgument(`Arguments objects and keys must have the same length`);var c=e.length,l=s&&o?e.map(Wt(s)):e;return r.core.mutate({trans:t,type:`put`,keys:i,values:l,wantResults:a}).then(function(e){var t=e.numFailures,n=e.results,i=e.lastResult,o=e.failures,s=a?n:i;if(t===0)return s;throw new ge(`${r.name}.bulkPut(): ${t} of ${c} operations failed`,o)})})},e.prototype.bulkUpdate=function(e){var t=this,n=e.map(function(e){return e.key}),r=e.map(function(e){return e.changes}),i=[];return this._trans(`readwrite`,function(a){var o=t.core;return o.getMany({trans:a,keys:n,cache:`clone`}).then(function(s){var c=o.schema.primaryKey,l=c.outbound,u=c.extractKey,d=[],f=[];e.forEach(function(e,t){var n=e.key,r=e.changes,a=s[t];if(a){for(var o=0,c=Object.keys(r);o<c.length;o++){var p=c[o];w(a,p,r[p])}if(!l&&Kt(u(a),n)!==0)throw new P.Constraint(`Cannot update primary key in bulkUpdate()`);i.push(t),d.push(n),f.push(a)}});var p=d.length;return o.mutate({trans:a,type:`put`,keys:d,values:f,updates:{keys:n,changeSpecs:r}}).then(function(e){var n=e.numFailures,r=e.failures;if(n===0)return p;for(var a=0,o=Object.keys(r);a<o.length;a++){var s=o[a],c=i[Number(s)];if(c!=null){var l=r[s];delete r[s],r[c]=l}}throw new ge(`${t.name}.bulkUpdate(): ${n} of ${p} operations failed`,r)})})})},e.prototype.bulkDelete=function(e){var t=this,n=e.length;return this._trans(`readwrite`,function(n){return t.core.mutate({trans:n,type:`delete`,keys:e}).then(function(n){return Zt(t,e,n)})}).then(function(e){var r=e.numFailures,i=e.lastResult,a=e.failures;if(r===0)return i;throw new ge(`${t.name}.bulkDelete(): ${r} of ${n} operations failed`,a)})},e}();function tn(e){var t={},n=function(n,r){if(r){for(var i=arguments.length,a=Array(i-1);--i;)a[i-1]=arguments[i];return t[n].subscribe.apply(null,a),e}if(typeof n==`string`)return t[n]};n.addEventType=s;for(var r=1,i=arguments.length;r<i;++r)s(arguments[r]);return n;function s(e,r,i){if(typeof e==`object`)return c(e);r||=ke,i||=Se;var a={subscribers:[],fire:i,subscribe:function(e){a.subscribers.indexOf(e)===-1&&(a.subscribers.push(e),a.fire=r(a.fire,e))},unsubscribe:function(e){a.subscribers=a.subscribers.filter(function(t){return t!==e}),a.fire=a.subscribers.reduce(r,i)}};return t[e]=n[e]=a,a}function c(e){a(e).forEach(function(t){var n=e[t];if(o(n))s(t,e[t][0],e[t][1]);else if(n===`asap`)var r=s(t,Ce,function(){for(var e=arguments.length,t=Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach(function(e){x(function(){e.apply(null,t)})})});else throw new P.InvalidArgument(`Invalid event config`)})}}function nn(e,t){return m(t).from({prototype:e}),t}function rn(e){return nn(en.prototype,function(t,n,r){this.db=e,this._tx=r,this.name=t,this.schema=n,this.hook=e._allTables[t]?e._allTables[t].hook:tn(null,{creating:[Ee,Se],reading:[we,Ce],updating:[Oe,Se],deleting:[De,Se]})})}function an(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function on(e,t){e.filter=Ht(e.filter,t)}function sn(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return Ht(r(),t())}:t,e.justLimit=n&&!r}function cn(e,t){e.isMatch=Ht(e.isMatch,t)}function ln(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new P.Schema(`KeyPath `+e.index+` on object store `+t.name+` is not indexed`);return n}function un(e,t,n){var r=ln(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:e.dir===`prev`,unique:!!e.unique,query:{index:r,range:e.range}})}function dn(e,t,n,r){var i=e.replayFilter?Ht(e.filter,e.replayFilter()):e.filter;if(e.or){var a={},o=function(e,n,r){if(!i||i(n,r,function(e){return n.stop(e)},function(e){return n.fail(e)})){var o=n.primaryKey,s=``+o;s===`[object ArrayBuffer]`&&(s=``+new Uint8Array(o)),u(a,s)||(a[s]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(o,n),fn(un(e,r,n),e.algorithm,o,!e.keysOnly&&e.valueMapper)])}return fn(un(e,r,n),Ht(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function fn(e,t,n,r){var i=pt(r?function(e,t,i){return n(r(e),t,i)}:n);return e.then(function(e){if(e)return e.start(function(){var n=function(){return e.continue()};(!t||t(e,function(e){return n=e},function(t){e.stop(t),n=Se},function(t){e.fail(t),n=Se}))&&i(e.value,e,function(e){return n=e}),n()})})}var pn=function(){function e(){}return e.prototype._read=function(e,t){var n=this._ctx;return n.error?n.table._trans(null,jt.bind(null,n.error)):n.table._trans(`readonly`,e).then(t)},e.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,jt.bind(null,t.error)):t.table._trans(`readwrite`,e,`locked`)},e.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=Ht(t.algorithm,e)},e.prototype._iterate=function(e,t){return dn(this._ctx,e,t,this._ctx.table.core)},e.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&s(n,e),t._ctx=n,t},e.prototype.raw=function(){return this._ctx.valueMapper=null,this},e.prototype.each=function(e){var t=this._ctx;return this._read(function(n){return dn(t,e,n,t.table.core)})},e.prototype.count=function(e){var t=this;return this._read(function(e){var n=t._ctx,r=n.table.core;if(an(n,!0))return r.count({trans:e,query:{index:ln(n,r.schema),range:n.range}}).then(function(e){return Math.min(e,n.limit)});var i=0;return dn(n,function(){return++i,!1},e,r).then(function(){return i})}).then(e)},e.prototype.sortBy=function(e,t){var n=e.split(`.`).reverse(),r=n[0],i=n.length-1;function a(e,t){return t?a(e[n[t]],t-1):e[r]}var o=this._ctx.dir===`next`?1:-1;function s(e,t){return Kt(a(e,i),a(t,i))*o}return this.toArray(function(e){return e.slice().sort(s)}).then(t)},e.prototype.toArray=function(e){var t=this;return this._read(function(e){var n=t._ctx;if(an(n,!0)&&n.limit>0){var r=n.valueMapper,i=ln(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,direction:n.dir===`prev`?`prev`:void 0,query:{index:i,range:n.range}}).then(function(e){var t=e.result;return r?t.map(r):t})}var a=[];return dn(n,function(e){return a.push(e)},e,n.table.core).then(function(){return a})},e)},e.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,an(t)?sn(t,function(){var t=e;return function(e,n){return t===0?!0:t===1?(--t,!1):(n(function(){e.advance(t),t=0}),!1)}}):sn(t,function(){var t=e;return function(){return--t<0}})),this},e.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),sn(this._ctx,function(){var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}},!0),this},e.prototype.until=function(e,t){return on(this._ctx,function(n,r,i){return!e(n.value)||(r(i),t)}),this},e.prototype.first=function(e){return this.limit(1).toArray(function(e){return e[0]}).then(e)},e.prototype.last=function(e){return this.reverse().first(e)},e.prototype.filter=function(e){return on(this._ctx,function(t){return e(t.value)}),cn(this._ctx,e),this},e.prototype.and=function(e){return this.filter(e)},e.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},e.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir===`prev`?`next`:`prev`,this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},e.prototype.desc=function(){return this.reverse()},e.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.key,n)})},e.prototype.eachUniqueKey=function(e){return this._ctx.unique=`unique`,this.eachKey(e)},e.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.primaryKey,n)})},e.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.key)}).then(function(){return n}).then(e)},e.prototype.primaryKeys=function(e){var t=this._ctx;if(an(t,!0)&&t.limit>0)return this._read(function(e){var n=ln(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,direction:t.dir===`prev`?`prev`:void 0,query:{index:n,range:t.range}})}).then(function(e){return e.result}).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.primaryKey)}).then(function(){return n}).then(e)},e.prototype.uniqueKeys=function(e){return this._ctx.unique=`unique`,this.keys(e)},e.prototype.firstKey=function(e){return this.limit(1).keys(function(e){return e[0]}).then(e)},e.prototype.lastKey=function(e){return this.reverse().firstKey(e)},e.prototype.distinct=function(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return on(this._ctx,function(e){var t=e.primaryKey.toString(),r=u(n,t);return n[t]=!0,!r}),this},e.prototype.modify=function(e){var t=this,n=this._ctx;return this._write(function(r){var i=typeof e==`function`?e:function(t){return $t(t,e)},o=n.table.core,s=o.schema.primaryKey,c=s.outbound,l=s.extractKey,u=200,d=t.db._options.modifyChunkSize;d&&(u=typeof d==`object`?d[o.name]||d[`*`]||200:d);var f=[],p=0,m=[],h=function(e,t){var n=t.failures,r=t.numFailures;p+=e-r;for(var i=0,o=a(n);i<o.length;i++){var s=o[i];f.push(n[s])}},g=e===mn;return t.clone().primaryKeys().then(function(t){var a=an(n)&&n.limit===1/0&&(typeof e!=`function`||g)&&{index:n.index,range:n.range},s=function(d){var f=Math.min(u,t.length-d),p=t.slice(d,d+f);return(g?Promise.resolve([]):o.getMany({trans:r,keys:p,cache:`immutable`})).then(function(m){var _=[],v=[],y=c?[]:null,b=g?p:[];if(!g)for(var x=0;x<f;++x){var S=m[x],C={value:ee(S),primKey:t[d+x]};i.call(C,C.value,C)!==!1&&(C.value==null?b.push(t[d+x]):!c&&Kt(l(S),l(C.value))!==0?(b.push(t[d+x]),_.push(C.value)):(v.push(C.value),c&&y.push(t[d+x])))}return Promise.resolve(_.length>0&&o.mutate({trans:r,type:`add`,values:_}).then(function(e){for(var t in e.failures)b.splice(parseInt(t),1);h(_.length,e)})).then(function(){return(v.length>0||a&&typeof e==`object`)&&o.mutate({trans:r,type:`put`,keys:y,values:v,criteria:a,changeSpec:typeof e!=`function`&&e,isAdditionalChunk:d>0}).then(function(e){return h(v.length,e)})}).then(function(){return(b.length>0||a&&g)&&o.mutate({trans:r,type:`delete`,keys:b,criteria:a,isAdditionalChunk:d>0}).then(function(e){return Zt(n.table,b,e)}).then(function(e){return h(b.length,e)})}).then(function(){return t.length>d+f&&s(d+u)})})};return s(0).then(function(){if(f.length>0)throw new he(`Error modifying one or more objects`,f,p,m);return t.length})})})},e.prototype.delete=function(){var e=this._ctx,t=e.range;return an(e)&&!e.table.schema.yProps&&(e.isPrimKey||t.type===3)?this._write(function(n){var r=e.table.core.schema.primaryKey,i=t;return e.table.core.count({trans:n,query:{index:r,range:i}}).then(function(t){return e.table.core.mutate({trans:n,type:`deleteRange`,range:i}).then(function(e){var n=e.failures,r=e.numFailures;if(r)throw new he(`Could not delete some values`,Object.keys(n).map(function(e){return n[e]}),t-r);return t-r})})}):this.modify(mn)},e}(),mn=function(e,t){return t.value=null};function hn(e){return nn(pn.prototype,function(t,n){this.db=e;var r=Ut,i=null;if(n)try{r=n()}catch(e){i=e}var a=t._ctx,o=a.table,s=o.hook.reading.fire;this._ctx={table:o,index:a.index,isPrimKey:!a.index||o.schema.primKey.keyPath&&a.index===o.schema.primKey.name,range:r,keysOnly:!1,dir:`next`,unique:``,algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:i,or:a.or,valueMapper:s===Ce?null:s}})}function gn(e,t){return e<t?-1:e===t?0:1}function _n(e,t){return e>t?-1:e===t?0:1}function vn(e,t,n){var r=e instanceof En?new e.Collection(e):e;return r._ctx.error=n?new n(t):TypeError(t),r}function yn(e){var t=new e.Collection(e,function(){return Tn(``)});return t._addAlgorithm(function(){return!1}),t}function bn(e){return e===`next`?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()}}function xn(e){return e===`next`?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()}}function Sn(e,t,n,r,i,a){for(var o=Math.min(e.length,r.length),s=-1,c=0;c<o;++c){var l=t[c];if(l!==r[c])return i(e[c],n[c])<0?e.substr(0,c)+n[c]+n.substr(c+1):i(e[c],r[c])<0?e.substr(0,c)+r[c]+n.substr(c+1):s>=0?e.substr(0,s)+t[s]+n.substr(s+1):null;i(e[c],l)<0&&(s=c)}return o<r.length&&a===`next`?e+n.substr(e.length):o<e.length&&a===`prev`?e.substr(0,n.length):s<0?null:e.substr(0,s)+r[s]+n.substr(s+1)}function Cn(e,t,n,r){var i,a,o,s,c,l,u,d=n.length;if(!n.every(function(e){return typeof e==`string`}))return vn(e,Lt);function f(e){i=bn(e),a=xn(e),o=e===`next`?gn:_n;var t=n.map(function(e){return{lower:a(e),upper:i(e)}}).sort(function(e,t){return o(e.lower,t.lower)});s=t.map(function(e){return e.upper}),c=t.map(function(e){return e.lower}),l=e,u=e===`next`?``:r}f(`next`);var p=new e.Collection(e,function(){return wn(s[0],c[d-1]+r)});p._ondirectionchange=function(e){f(e)};var m=0;return p._addAlgorithm(function(e,n,r){var i=e.key;if(typeof i!=`string`)return!1;var f=a(i);if(t(f,c,m))return!0;for(var p=null,h=m;h<d;++h){var g=Sn(i,f,s[h],c[h],o,l);g===null&&p===null?m=h+1:(p===null||o(p,g)>0)&&(p=g)}return n(p===null?r:function(){e.continue(p+u)}),!1}),p}function wn(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function Tn(e){return{type:1,lower:e,upper:e}}var En=function(){function e(){}return Object.defineProperty(e.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),e.prototype.between=function(e,t,n,r){n=n!==!1,r=r===!0;try{return this._cmp(e,t)>0||this._cmp(e,t)===0&&(n||r)&&!(n&&r)?yn(this):new this.Collection(this,function(){return wn(e,t,!n,!r)})}catch{return vn(this,It)}},e.prototype.equals=function(e){return e==null?vn(this,It):new this.Collection(this,function(){return Tn(e)})},e.prototype.above=function(e){return e==null?vn(this,It):new this.Collection(this,function(){return wn(e,void 0,!0)})},e.prototype.aboveOrEqual=function(e){return e==null?vn(this,It):new this.Collection(this,function(){return wn(e,void 0,!1)})},e.prototype.below=function(e){return e==null?vn(this,It):new this.Collection(this,function(){return wn(void 0,e,!1,!0)})},e.prototype.belowOrEqual=function(e){return e==null?vn(this,It):new this.Collection(this,function(){return wn(void 0,e)})},e.prototype.startsWith=function(e){return typeof e==`string`?this.between(e,e+Pt,!0,!0):vn(this,Lt)},e.prototype.startsWithIgnoreCase=function(e){return e===``?this.startsWith(e):Cn(this,function(e,t){return e.indexOf(t[0])===0},[e],Pt)},e.prototype.equalsIgnoreCase=function(e){return Cn(this,function(e,t){return e===t[0]},[e],``)},e.prototype.anyOfIgnoreCase=function(){var e=se.apply(oe,arguments);return e.length===0?yn(this):Cn(this,function(e,t){return t.indexOf(e)!==-1},e,``)},e.prototype.startsWithAnyOfIgnoreCase=function(){var e=se.apply(oe,arguments);return e.length===0?yn(this):Cn(this,function(e,t){return t.some(function(t){return e.indexOf(t)===0})},e,Pt)},e.prototype.anyOf=function(){var e=this,t=se.apply(oe,arguments),n=this._cmp;try{t.sort(n)}catch{return vn(this,It)}if(t.length===0)return yn(this);var r=new this.Collection(this,function(){return wn(t[0],t[t.length-1])});r._ondirectionchange=function(r){n=r===`next`?e._ascending:e._descending,t.sort(n)};var i=0;return r._addAlgorithm(function(e,r,a){for(var o=e.key;n(o,t[i])>0;)if(++i,i===t.length)return r(a),!1;return n(o,t[i])===0||(r(function(){e.continue(t[i])}),!1)}),r},e.prototype.notEqual=function(e){return this.inAnyRange([[Ft,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},e.prototype.noneOf=function(){var e=se.apply(oe,arguments);if(e.length===0)return new this.Collection(this);try{e.sort(this._ascending)}catch{return vn(this,It)}var t=e.reduce(function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[Ft,t]]},null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},e.prototype.inAnyRange=function(e,t){var n=this,r=this._cmp,i=this._ascending,a=this._descending,o=this._min,s=this._max;if(e.length===0)return yn(this);if(!e.every(function(e){return e[0]!==void 0&&e[1]!==void 0&&i(e[0],e[1])<=0}))return vn(this,`First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower`,P.InvalidArgument);var c=!t||t.includeLowers!==!1,l=t&&t.includeUppers===!0;function u(e,t){for(var n=0,i=e.length;n<i;++n){var a=e[n];if(r(t[0],a[1])<0&&r(t[1],a[0])>0){a[0]=o(a[0],t[0]),a[1]=s(a[1],t[1]);break}}return n===i&&e.push(t),e}var d=i;function f(e,t){return d(e[0],t[0])}var p;try{p=e.reduce(u,[]),p.sort(f)}catch{return vn(this,It)}var m=0,h=l?function(e){return i(e,p[m][1])>0}:function(e){return i(e,p[m][1])>=0},g=c?function(e){return a(e,p[m][0])>0}:function(e){return a(e,p[m][0])>=0};function _(e){return!h(e)&&!g(e)}var v=h,y=new this.Collection(this,function(){return wn(p[0][0],p[p.length-1][1],!c,!l)});return y._ondirectionchange=function(e){e===`next`?(v=h,d=i):(v=g,d=a),p.sort(f)},y._addAlgorithm(function(e,t,r){for(var a=e.key;v(a);)if(++m,m===p.length)return t(r),!1;return _(a)?!0:(n._cmp(a,p[m][1])===0||n._cmp(a,p[m][0])===0||t(function(){d===i?e.continue(p[m][0]):e.continue(p[m][1])}),!1)}),y},e.prototype.startsWithAnyOf=function(){var e=se.apply(oe,arguments);return e.every(function(e){return typeof e==`string`})?e.length===0?yn(this):this.inAnyRange(e.map(function(e){return[e,e+Pt]})):vn(this,`startsWithAnyOf() only works with strings`)},e}();function Dn(e){return nn(En.prototype,function(t,n,r){if(this.db=e,this._ctx={table:t,index:n===`:id`?null:n,or:r},this._cmp=this._ascending=Kt,this._descending=function(e,t){return Kt(t,e)},this._max=function(e,t){return Kt(e,t)>0?e:t},this._min=function(e,t){return Kt(e,t)<0?e:t},this._IDBKeyRange=e._deps.IDBKeyRange,!this._IDBKeyRange)throw new P.MissingAPI})}function On(e){return pt(function(t){return R(t),e(t.target.error),!1})}function R(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var kn=`storagemutated`,An=`x-storagemutated-1`,jn=tn(null,kn),Mn=function(){function e(){}return e.prototype._lock=function(){return b(!I.global),++this._reculock,this._reculock===1&&!I.global&&(I.lockOwnerFor=this),this},e.prototype._unlock=function(){if(b(!I.global),--this._reculock===0)for(I.global||(I.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{Ot(e[1],e[0])}catch{}}return this},e.prototype._locked=function(){return this._reculock&&I.lockOwnerFor!==this},e.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(b(!this.idbtrans),!e&&!n)switch(r&&r.name){case`DatabaseClosedError`:throw new P.DatabaseClosed(r);case`MissingAPIError`:throw new P.MissingAPI(r.message,r);default:throw new P.OpenFailed(r)}if(!this.active)throw new P.TransactionInactive;return b(this._completion._state===null),e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):n.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})),e.onerror=pt(function(n){R(n),t._reject(e.error)}),e.onabort=pt(function(n){R(n),t.active&&t._reject(new P.Abort(e.error)),t.active=!1,t.on(`abort`).fire(n)}),e.oncomplete=pt(function(){t.active=!1,t._resolve(),`mutatedParts`in e&&jn.storagemutated.fire(e.mutatedParts)}),this},e.prototype._promise=function(e,t,n){var r=this;if(e===`readwrite`&&this.mode!==`readwrite`)return jt(new P.ReadOnly(`Transaction is readonly`));if(!this.active)return jt(new P.TransactionInactive);if(this._locked())return new L(function(i,a){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,a)},I])});if(n)return bt(function(){var e=new L(function(e,n){r._lock();var i=t(e,n,r);i&&i.then&&i.then(e,n)});return e.finally(function(){return r._unlock()}),e._lib=!0,e});var i=new L(function(e,n){var i=t(e,n,r);i&&i.then&&i.then(e,n)});return i._lib=!0,i},e.prototype._root=function(){return this.parent?this.parent._root():this},e.prototype.waitFor=function(e){var t=this._root(),n=L.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then(function(){return n});else{t._waitingFor=n,t._waitingQueue=[];var r=t.idbtrans.objectStore(t.storeNames[0]);(function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(r.get(-1/0).onsuccess=e)})()}var i=t._waitingFor;return new L(function(e,r){n.then(function(n){return t._waitingQueue.push(pt(e.bind(null,n)))},function(e){return t._waitingQueue.push(pt(r.bind(null,e)))}).finally(function(){t._waitingFor===i&&(t._waitingFor=null)})})},e.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new P.Abort))},e.prototype.table=function(e){var t=this._memoizedTables||={};if(u(t,e))return t[e];var n=this.schema[e];if(!n)throw new P.NotFound(`Table `+e+` not part of transaction`);var r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r},e}();function Nn(e){return nn(Mn.prototype,function(t,n,r,i,a){var o=this;t!==`readonly`&&n.forEach(function(e){var t=r[e]?.yProps;t&&(n=n.concat(t.map(function(e){return e.updatesTable})))}),this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.chromeTransactionDurability=i,this.idbtrans=null,this.on=tn(this,`complete`,`error`,`abort`),this.parent=a||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new L(function(e,t){o._resolve=e,o._reject=t}),this._completion.then(function(){o.active=!1,o.on.complete.fire()},function(e){var t=o.active;return o.active=!1,o.on.error.fire(e),o.parent?o.parent._reject(e):t&&o.idbtrans&&o.idbtrans.abort(),jt(e)})})}function Pn(e,t,n,r,i,a,o,s){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:a,src:(n&&!o?`&`:``)+(r?`*`:``)+(i?`++`:``)+Fn(t),type:s}}function Fn(e){return typeof e==`string`?e:e?`[`+[].join.call(e,`+`)+`]`:``}function In(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:S(n,function(e){return[e.name,e]})}}function Ln(e){return e.length===1?e[0]:e}var Rn=function(e){try{return e.only([[]]),Rn=function(){return[[]]},[[]]}catch{return Rn=function(){return Pt},Pt}};function zn(e){return e==null?function(){}:typeof e==`string`?Bn(e):function(t){return C(t,e)}}function Bn(e){return e.split(`.`).length===1?function(t){return t[e]}:function(t){return C(t,e)}}function Vn(e){return[].slice.call(e)}var Hn=0;function Un(e){return e==null?`:id`:typeof e==`string`?e:`[${e.join(`+`)}]`}function Wn(e,t,n){function r(e,t){var n=Vn(e.objectStoreNames),r=n.length>0?t.objectStore(n[0]):{};return{schema:{name:e.name,tables:n.map(function(e){return t.objectStore(e)}).map(function(e){var t=e.keyPath,n=e.autoIncrement,r=o(t),i=t==null,a={},s={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:zn(t)},indexes:Vn(e.indexNames).map(function(t){return e.index(t)}).map(function(e){var t=e.name,n=e.unique,r=e.multiEntry,i=e.keyPath,s={name:t,compound:o(i),keyPath:i,unique:n,multiEntry:r,extractKey:zn(i)};return a[Un(i)]=s,s}),getIndexByKeyPath:function(e){return a[Un(e)]}};return a[`:id`]=s.primaryKey,t!=null&&(a[Un(t)]=s.primaryKey),s})},hasGetAll:n.length>0&&`getAll`in r&&!(typeof navigator<`u`&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:`getAllRecords`in r}}function i(e){if(e.type===3)return null;if(e.type===4)throw Error(`Cannot convert never type to IDBKeyRange`);var n=e.lower,r=e.upper,i=e.lowerOpen,a=e.upperOpen;return n===void 0?r===void 0?null:t.upperBound(r,!!a):r===void 0?t.lowerBound(n,!!i):t.bound(n,r,!!i,!!a)}function a(e){var t=e.name;function n(e){var n=e.trans,r=e.type,a=e.keys,o=e.values,s=e.range;return new Promise(function(e,c){e=pt(e);var l=n.objectStore(t),u=l.keyPath==null,d=r===`put`||r===`add`;if(!d&&r!==`delete`&&r!==`deleteRange`)throw Error(`Invalid operation type: `+r);var f=(a||o||{length:1}).length;if(a&&o&&a.length!==o.length)throw Error(`Given keys array must have same length as given values array.`);if(f===0)return e({numFailures:0,failures:{},results:[],lastResult:void 0});var p,m=[],h=[],g=0,_=function(e){++g,R(e)};if(r===`deleteRange`){if(s.type===4)return e({numFailures:g,failures:h,results:[],lastResult:void 0});s.type===3?m.push(p=l.clear()):m.push(p=l.delete(i(s)))}else{var v=d?u?[o,a]:[o,null]:[a,null],y=v[0],b=v[1];if(d)for(var x=0;x<f;++x)m.push(p=b&&b[x]!==void 0?l[r](y[x],b[x]):l[r](y[x])),p.onerror=_;else for(var x=0;x<f;++x)m.push(p=l[r](y[x])),p.onerror=_}var S=function(t){var n=t.target.result;m.forEach(function(e,t){return e.error!=null&&(h[t]=e.error)}),e({numFailures:g,failures:h,results:r===`delete`?a:m.map(function(e){return e.result}),lastResult:n})};p.onerror=function(e){_(e),S(e)},p.onsuccess=S})}function r(e){var n=e.trans,r=e.values,a=e.query,o=e.reverse,s=e.unique;return new Promise(function(e,c){e=pt(e);var l=a.index,u=a.range,d=n.objectStore(t),f=l.isPrimaryKey?d:d.index(l.name),p=o?s?`prevunique`:`prev`:s?`nextunique`:`next`,m=r||!(`openKeyCursor`in f)?f.openCursor(i(u),p):f.openKeyCursor(i(u),p);m.onerror=On(c),m.onsuccess=pt(function(t){var r=m.result;if(!r)e(null);else{r.___id=++Hn,r.done=!1;var i=r.continue.bind(r),a=r.continuePrimaryKey;a&&=a.bind(r);var o=r.advance.bind(r),s=function(){throw Error(`Cursor not started`)},l=function(){throw Error(`Cursor not stopped`)};r.trans=n,r.stop=r.continue=r.continuePrimaryKey=r.advance=s,r.fail=pt(c),r.next=function(){var e=this,t=1;return this.start(function(){return t--?e.continue():e.stop()}).then(function(){return e})},r.start=function(e){var t=new Promise(function(e,t){e=pt(e),m.onerror=On(t),r.fail=t,r.stop=function(t){r.stop=r.continue=r.continuePrimaryKey=r.advance=l,e(t)}}),n=function(){if(m.result)try{e()}catch(e){r.fail(e)}else r.done=!0,r.start=function(){throw Error(`Cursor behind last entry`)},r.stop()};return m.onsuccess=pt(function(e){m.onsuccess=n,n()}),r.continue=i,r.continuePrimaryKey=a,r.advance=o,n(),t},e(r)}},c)})}function a(e,n){return function(r){return new Promise(function(a,o){a=pt(a);var s=r.trans,c=r.values,l=r.limit,u=r.query,d=r.direction??`next`,f=l===1/0?void 0:l,p=u.index,m=u.range,h=s.objectStore(t),g=p.isPrimaryKey?h:h.index(p.name),_=i(m);if(l===0)return a({result:[]});if(n){var v={query:_,count:f,direction:d},y=c?g.getAll(v):g.getAllKeys(v);y.onsuccess=function(e){return a({result:e.target.result})},y.onerror=On(o)}else if(e&&d===`next`){var y=c?g.getAll(_,f):g.getAllKeys(_,f);y.onsuccess=function(e){return a({result:e.target.result})},y.onerror=On(o)}else{var b=0,x=c||!(`openKeyCursor`in g)?g.openCursor(_,d):g.openKeyCursor(_,d),S=[];x.onsuccess=function(){var e=x.result;if(!e||(S.push(c?e.value:e.primaryKey),++b===l))return a({result:S});e.continue()},x.onerror=On(o)}})}}return{name:t,schema:e,mutate:n,getMany:function(e){var n=e.trans,r=e.keys;return new Promise(function(e,i){e=pt(e);for(var a=n.objectStore(t),o=r.length,s=Array(o),c=0,l=0,u,d=function(t){var n=t.target;s[n._pos]=n.result,++l===c&&e(s)},f=On(i),p=0;p<o;++p)r[p]!=null&&(u=a.get(r[p]),u._pos=p,u.onsuccess=d,u.onerror=f,++c);c===0&&e(s)})},get:function(e){var n=e.trans,r=e.key;return new Promise(function(e,i){e=pt(e);var a=n.objectStore(t).get(r);a.onsuccess=function(t){return e(t.target.result)},a.onerror=On(i)})},query:a(l,u),openCursor:r,count:function(e){var n=e.query,r=e.trans,a=n.index,o=n.range;return new Promise(function(e,n){var s=r.objectStore(t),c=a.isPrimaryKey?s:s.index(a.name),l=i(o),u=l?c.count(l):c.count();u.onsuccess=pt(function(t){return e(t.target.result)}),u.onerror=On(n)})}}}var s=r(e,n),c=s.schema,l=s.hasGetAll,u=s.hasIdb3Features,d=c.tables.map(function(e){return a(e)}),f={};return d.forEach(function(e){return f[e.name]=e}),{stack:`dbcore`,transaction:e.transaction.bind(e),table:function(e){if(!f[e])throw Error(`Table '${e}' not found`);return f[e]},MIN_KEY:-1/0,MAX_KEY:Rn(t),schema:c}}function Gn(e,t){return t.reduce(function(e,t){var r=t.create;return n(n({},e),r(e))},e)}function Kn(e,t,n,r){var i=n.IDBKeyRange;return n.indexedDB,{dbcore:Gn(Wn(t,i,r),e.dbcore)}}function qn(e,t){var n=t.db;e.core=Kn(e._middlewares,n,e._deps,t).dbcore,e.tables.forEach(function(t){var n=t.name;e.core.schema.tables.some(function(e){return e.name===n})&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))})}function Jn(e,t,n,r){n.forEach(function(n){var i=r[n];t.forEach(function(t){var r=g(t,n);(!r||`value`in r&&r.value===void 0)&&(t===e.Transaction.prototype||t instanceof e.Transaction?p(t,n,{get:function(){return this.table(n)},set:function(e){f(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,i))})})}function Yn(e,t){t.forEach(function(t){for(var n in t)t[n]instanceof e.Table&&delete t[n]})}function Xn(e,t){return e._cfg.version-t._cfg.version}function Zn(e,t,n,r){var i=e._dbSchema;n.objectStoreNames.contains(`$meta`)&&!i.$meta&&(i.$meta=In(`$meta`,ur(``)[0],[]),e._storeNames.push(`$meta`));var o=e._createTransaction(`readwrite`,e._storeNames,i);o.create(n),o._completion.catch(r);var s=o._reject.bind(o),c=I.transless||I;bt(function(){if(I.trans=o,I.transless=c,t===0)a(i).forEach(function(e){nr(n,e,i[e].primKey,i[e].indexes)}),qn(e,n),L.follow(function(){return e.on.populate.fire(o)}).catch(s);else return qn(e,n),$n(e,o,t).then(function(t){return er(e,t,o,n)}).catch(s)})}function Qn(e,t){rr(e._dbSchema,t),t.db.version%10==0&&!t.objectStoreNames.contains(`$meta`)&&t.db.createObjectStore(`$meta`).add(Math.ceil(t.db.version/10-1),`version`);var n=or(e,e.idbdb,t);lr(e,e._dbSchema,t);for(var r=tr(n,e._dbSchema),i=function(e){if(e.change.length||e.recreate)return console.warn(`Unable to patch indexes of table ${e.name} because it has changes on the type of index or primary key.`),{value:void 0};var n=t.objectStore(e.name);e.add.forEach(function(t){je&&console.debug(`Dexie upgrade patch: Creating missing index ${e.name}.${t.src}`),ar(n,t)})},a=0,o=r.change;a<o.length;a++){var s=o[a],c=i(s);if(typeof c==`object`)return c.value}}function $n(e,t,n){return t.storeNames.includes(`$meta`)?t.table(`$meta`).get(`version`).then(function(e){return e??n}):L.resolve(n)}function er(e,t,n,r){var i=[],o=e._versions,s=e._dbSchema=or(e,e.idbdb,r),c=o.filter(function(e){return e._cfg.version>=t});if(c.length===0)return L.resolve();c.forEach(function(o){i.push(function(){var i=s,c=o._cfg.dbschema;lr(e,i,r),lr(e,c,r),s=e._dbSchema=c;var l=tr(i,c);l.add.forEach(function(e){nr(r,e[0],e[1].primKey,e[1].indexes)}),l.change.forEach(function(e){if(e.recreate)throw new P.Upgrade(`Not yet support for changing primary key`);var t=r.objectStore(e.name);e.add.forEach(function(e){return ar(t,e)}),e.change.forEach(function(e){t.deleteIndex(e.name),ar(t,e)}),e.del.forEach(function(e){return t.deleteIndex(e)})});var u=o._cfg.contentUpgrade;if(u&&o._cfg.version>t){qn(e,r),n._memoizedTables={};var d=E(c);l.del.forEach(function(e){d[e]=i[e]}),Yn(e,[e.Transaction.prototype]),Jn(e,[e.Transaction.prototype],a(d),d),n.schema=d;var f=ce(u);f&&xt();var p,m=L.follow(function(){if(p=u(n),p&&f){var e=St.bind(null,null);p.then(e,e)}});return p&&typeof p.then==`function`?L.resolve(p):m.then(function(){return p})}}),i.push(function(t){var r=o._cfg.dbschema;ir(r,t),Yn(e,[e.Transaction.prototype]),Jn(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),n.schema=e._dbSchema}),i.push(function(t){e.idbdb.objectStoreNames.contains(`$meta`)&&(Math.ceil(e.idbdb.version/10)===o._cfg.version?(e.idbdb.deleteObjectStore(`$meta`),delete e._dbSchema.$meta,e._storeNames=e._storeNames.filter(function(e){return e!==`$meta`})):t.objectStore(`$meta`).put(o._cfg.version,`version`))})});function l(){return i.length?L.resolve(i.shift()(n.idbtrans)).then(l):L.resolve()}return l().then(function(){rr(s,r)})}function tr(e,t){var n={del:[],add:[],change:[]},r;for(r in e)t[r]||n.del.push(r);for(r in t){var i=e[r],a=t[r];if(!i)n.add.push([r,a]);else{var o={name:r,def:a,recreate:!1,del:[],add:[],change:[]};if(``+(i.primKey.keyPath||``)!=``+(a.primKey.keyPath||``)||i.primKey.auto!==a.primKey.auto)o.recreate=!0,n.change.push(o);else{var s=i.idxByName,c=a.idxByName,l=void 0;for(l in s)c[l]||o.del.push(l);for(l in c){var u=s[l],d=c[l];u?u.src!==d.src&&o.change.push(d):o.add.push(d)}(o.del.length>0||o.add.length>0||o.change.length>0)&&n.change.push(o)}}}return n}function nr(e,t,n,r){var i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach(function(e){return ar(i,e)}),i}function rr(e,t){a(e).forEach(function(n){t.db.objectStoreNames.contains(n)||(je&&console.debug(`Dexie: Creating missing table`,n),nr(t,n,e[n].primKey,e[n].indexes))})}function ir(e,t){[].slice.call(t.db.objectStoreNames).forEach(function(n){return e[n]==null&&t.db.deleteObjectStore(n)})}function ar(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function or(e,t,n){var r={};return v(t.objectStoreNames,0).forEach(function(e){for(var t=n.objectStore(e),i=t.keyPath,a=Pn(Fn(i),i||``,!0,!1,!!t.autoIncrement,i&&typeof i!=`string`,!0),o=[],s=0;s<t.indexNames.length;++s){var c=t.index(t.indexNames[s]);i=c.keyPath;var l=Pn(c.name,i,!!c.unique,!!c.multiEntry,!1,i&&typeof i!=`string`,!1);o.push(l)}r[e]=In(e,a,o)}),r}function sr(e,t,n){e.verno=t.version/10;var r=e._dbSchema=or(e,t,n);e._storeNames=v(t.objectStoreNames,0),Jn(e,[e._allTables],a(r),r)}function cr(e,t){var n=tr(or(e,e.idbdb,t),e._dbSchema);return!(n.add.length||n.change.some(function(e){return e.add.length||e.change.length}))}function lr(e,t,n){for(var r=n.db.objectStoreNames,a=0;a<r.length;++a){var o=r[a],s=n.objectStore(o);e._hasGetAll=`getAll`in s;for(var c=0;c<s.indexNames.length;++c){var l=s.indexNames[c],u=s.index(l).keyPath,d=typeof u==`string`?u:`[`+v(u).join(`+`)+`]`;if(t[o]){var f=t[o].idxByName[d];f&&(f.name=l,delete t[o].idxByName[d],t[o].idxByName[l]=f)}}}typeof navigator<`u`&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&i.WorkerGlobalScope&&i instanceof i.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}function ur(e){return e.split(`,`).map(function(e,t){var n=e.split(`:`),r=n[1]?.trim();e=n[0].trim();var i=e.replace(/([&*]|\+\+)/g,``),a=/^\[/.test(i)?i.match(/^\[(.*)\]$/)[1].split(`+`):i;return Pn(i,a||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),o(a),t===0,r)})}var dr=function(){function e(){}return e.prototype._createTableSchema=function(e,t,n){return In(e,t,n)},e.prototype._parseIndexSyntax=function(e){return ur(e)},e.prototype._parseStoresSpec=function(e,t){var n=this;a(e).forEach(function(r){if(e[r]!==null){var i=n._parseIndexSyntax(e[r]),a=i.shift();if(!a)throw new P.Schema(`Invalid schema for table `+r+`: `+e[r]);if(a.unique=!0,a.multi)throw new P.Schema(`Primary key cannot be multiEntry*`);i.forEach(function(e){if(e.auto)throw new P.Schema(`Only primary key can be marked as autoIncrement (++)`);if(!e.keyPath)throw new P.Schema(`Index must have a name and cannot be an empty string`)}),t[r]=n._createTableSchema(r,a,i)}})},e.prototype.stores=function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?s(this._cfg.storesSource,e):e;var n=t._versions,r={},i={};return n.forEach(function(e){s(r,e._cfg.storesSource),i=e._cfg.dbschema={},e._parseStoresSpec(r,i)}),t._dbSchema=i,Yn(t,[t._allTables,t,t.Transaction.prototype]),Jn(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],a(i),i),t._storeNames=a(i),this},e.prototype.upgrade=function(e){return this._cfg.contentUpgrade=Ae(this._cfg.contentUpgrade||Se,e),this},e}();function fr(e){return nn(dr.prototype,function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})}var pr=mr();function mr(){if(typeof FinalizationRegistry<`u`&&typeof WeakRef<`u`){var e=new Set,t=new FinalizationRegistry(function(t){e.delete(t)}),n=function(){return Array.from(e).map(function(e){return e.deref()}).filter(function(e){return e!==void 0})},r=function(n){var r=new WeakRef(n._novip);if(e.add(r),t.register(n._novip,r,r),e.size>n._options.maxConnections){var i=e.values().next().value;e.delete(i),t.unregister(i)}},i=function(n){if(n)for(var r=e.values(),i=r.next();!i.done;){var a=i.value;if(a.deref()===n._novip){e.delete(a),t.unregister(a);return}i=r.next()}};return{toArray:n,add:r,remove:i}}var a=[],n=function(){return a},r=function(e){a.push(e._novip)},i=function(e){if(e){var t=a.indexOf(e._novip);t!==-1&&a.splice(t,1)}};return{toArray:n,add:r,remove:i}}function hr(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new hi(zt,{addons:[],indexedDB:e,IDBKeyRange:t}),n.version(1).stores({dbnames:`name`})),n.table(`dbnames`)}function gr(e){return e&&typeof e.databases==`function`}function _r(e){var t=e.indexedDB,n=e.IDBKeyRange;return gr(t)?Promise.resolve(t.databases()).then(function(e){return e.map(function(e){return e.name}).filter(function(e){return e!==zt})}):hr(t,n).toCollection().primaryKeys()}function vr(e,t){var n=e.indexedDB,r=e.IDBKeyRange;!gr(n)&&t!==zt&&hr(n,r).put({name:t}).catch(Se)}function yr(e,t){var n=e.indexedDB,r=e.IDBKeyRange;!gr(n)&&t!==zt&&hr(n,r).delete(t).catch(Se)}function br(e){return bt(function(){return I.letThrough=!0,e()})}function xr(){if(navigator.userAgentData||!/Safari\//.test(navigator.userAgent)||/Chrom(e|ium)\//.test(navigator.userAgent)||!indexedDB.databases)return Promise.resolve();var e;return new Promise(function(t){var n=function(){return indexedDB.databases().finally(t)};e=setInterval(n,100),n()}).finally(function(){return clearInterval(e)})}var Sr;function Cr(e){return!(`from`in e)}var wr=function(e,t){if(this)s(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0});else{var n=new wr;return e&&`d`in e&&s(n,e),n}};d(wr.prototype,(Sr={add:function(e){return Er(this,e),this},addKey:function(e){return Tr(this,e,e),this},addKeys:function(e){var t=this;return e.forEach(function(e){return Tr(t,e,e)}),this},hasKey:function(e){var t=Or(this).next(e).value;return t&&Kt(t.from,e)<=0&&Kt(t.to,e)>=0}},Sr[re]=function(){return Or(this)},Sr));function Tr(e,t,n){var r=Kt(t,n);if(!isNaN(r)){if(r>0)throw RangeError();if(Cr(e))return s(e,{from:t,to:n,d:1});var i=e.l,a=e.r;if(Kt(n,e.from)<0)return i?Tr(i,t,n):e.l={from:t,to:n,d:1,l:null,r:null},kr(e);if(Kt(t,e.to)>0)return a?Tr(a,t,n):e.r={from:t,to:n,d:1,l:null,r:null},kr(e);Kt(t,e.from)<0&&(e.from=t,e.l=null,e.d=a?a.d+1:1),Kt(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);var o=!e.r;i&&!e.l&&Er(e,i),a&&o&&Er(e,a)}}function Er(e,t){function n(e,t){var r=t.from,i=t.to,a=t.l,o=t.r;Tr(e,r,i),a&&n(e,a),o&&n(e,o)}Cr(t)||n(e,t)}function Dr(e,t){var n=Or(t),r=n.next();if(r.done)return!1;for(var i=r.value,a=Or(e),o=a.next(i.from),s=o.value;!r.done&&!o.done;){if(Kt(s.from,i.to)<=0&&Kt(s.to,i.from)>=0)return!0;Kt(i.from,s.from)<0?i=(r=n.next(s.from)).value:s=(o=a.next(i.from)).value}return!1}function Or(e){var t=Cr(e)?null:{s:0,n:e};return{next:function(e){for(var n=arguments.length>0;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&Kt(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||Kt(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function kr(e){var t=(e.r?.d||0)-(e.l?.d||0),r=t>1?`r`:t<-1?`l`:``;if(r){var i=r===`r`?`l`:`r`,a=n({},e),o=e[r];e.from=o.from,e.to=o.to,e[r]=o[r],a[r]=o[i],e[i]=a,a.d=Ar(a)}e.d=Ar(e)}function Ar(e){var t=e.r,n=e.l;return(t?n?Math.max(t.d,n.d):t.d:n?n.d:0)+1}function jr(e,t){return a(t).forEach(function(n){e[n]?Er(e[n],t[n]):e[n]=j(t[n])}),e}function Mr(e,t){return e.all||t.all||Object.keys(e).some(function(n){return t[n]&&Dr(t[n],e[n])})}var Nr={},Pr={},Fr=!1;function Ir(e,t){jr(Pr,e),Fr||(Fr=!0,setTimeout(function(){Fr=!1;var e=Pr;Pr={},z(e,!1)},0))}function z(e,t){t===void 0&&(t=!1);var n=new Set;if(e.all)for(var r=0,i=Object.values(Nr);r<i.length;r++){var a=i[r];Lr(a,e,n,t)}else for(var o in e){var s=/^idb\:\/\/(.*)\/(.*)\//.exec(o);if(s){var a=Nr[`idb://${s[1]}/${s[2]}`];a&&Lr(a,e,n,t)}}n.forEach(function(e){return e()})}function Lr(e,t,n,r){for(var i=[],a=0,o=Object.entries(e.queries.query);a<o.length;a++){for(var s=o[a],c=s[0],l=s[1],u=[],d=0,f=l;d<f.length;d++){var p=f[d];Mr(t,p.obsSet)?p.subscribers.forEach(function(e){return n.add(e)}):r&&u.push(p)}r&&i.push([c,u])}if(r)for(var m=0,h=i;m<h.length;m++){var g=h[m],c=g[0],u=g[1];e.queries.query[c]=u}}function Rr(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then(function(){return t.dbOpenError?jt(t.dbOpenError):e});t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var r=t.openCanceller,a=Math.round(e.verno*10),o=!1;function s(){if(t.openCanceller!==r)throw new P.DatabaseClosed(`db.open() was cancelled`)}var c=t.dbReadyResolve,l=null,u=!1,d=function(){return new L(function(r,i){if(s(),!n)throw new P.MissingAPI;var c=e.name,f=t.autoSchema||!a?n.open(c):n.open(c,a);if(!f)throw new P.MissingAPI;f.onerror=On(i),f.onblocked=pt(e._fireOnBlocked),f.onupgradeneeded=pt(function(r){if(l=f.transaction,t.autoSchema&&!e._options.allowEmptyDB){f.onerror=R,l.abort(),f.result.close();var a=n.deleteDatabase(c);a.onsuccess=a.onerror=pt(function(){i(new P.NoSuchDatabase(`Database ${c} doesnt exist`))})}else{l.onerror=On(i);var s=r.oldVersion>2**62?0:r.oldVersion;u=s<1,e.idbdb=f.result,o&&Qn(e,l),Zn(e,s/10,l,i)}},i),f.onsuccess=pt(function(){l=null;var n=e.idbdb=f.result,i=v(n.objectStoreNames);if(i.length>0)try{var s=n.transaction(Ln(i),`readonly`);if(t.autoSchema)sr(e,n,s);else if(lr(e,e._dbSchema,s),!cr(e,s)&&!o)return console.warn(`Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this.`),n.close(),a=n.version+1,o=!0,r(d());qn(e,s)}catch{}pr.add(e),n.onversionchange=pt(function(n){t.vcFired=!0,e.on(`versionchange`).fire(n)}),n.onclose=pt(function(){e.close({disableAutoOpen:!1})}),u&&vr(e._deps,c),r()},i)}).catch(function(e){switch(e?.name){case`UnknownError`:if(t.PR1398_maxLoop>0)return t.PR1398_maxLoop--,console.warn(`Dexie: Workaround for Chrome UnknownError on open()`),d();break;case`VersionError`:if(a>0)return a=0,d()}return L.reject(e)})},f=typeof navigator<`u`&&!!n&&n===i.indexedDB;return L.race([r,(f?xr():L.resolve()).then(d)]).then(function(){return s(),t.onReadyBeingFired=[],L.resolve(br(function(){return e.on.ready.fire(e.vip)})).then(function n(){if(t.onReadyBeingFired.length>0){var r=t.onReadyBeingFired.reduce(Ae,Se);return t.onReadyBeingFired=[],L.resolve(br(function(){return r(e.vip)})).then(n)}})}).finally(function(){t.openCanceller===r&&(t.onReadyBeingFired=null,t.isBeingOpened=!1)}).catch(function(n){t.dbOpenError=n;try{l&&l.abort()}catch{}return r===t.openCanceller&&e._close(),jt(n)}).finally(function(){t.openComplete=!0,c()}).then(function(){if(u){var t={};e.tables.forEach(function(n){n.schema.indexes.forEach(function(r){r.name&&(t[`idb://${e.name}/${n.name}/${r.name}`]=new wr(-1/0,[[[]]]))}),t[`idb://${e.name}/${n.name}/`]=t[`idb://${e.name}/${n.name}/:dels`]=new wr(-1/0,[[[]]])}),jn(kn).fire(t),z(t,!0)}return e})}function zr(e){var t=function(t){return e.next(t)},n=function(t){return e.throw(t)},r=a(t),i=a(n);function a(e){return function(t){var n=e(t),a=n.value;return n.done?a:!a||typeof a.then!=`function`?o(a)?Promise.all(a).then(r,i):r(a):a.then(r,i)}}return a(t)()}function Br(e,t,n){var r=arguments.length;if(r<2)throw new P.InvalidArgument(`Too few arguments`);for(var i=Array(r-1);--r;)i[r-1]=arguments[r];return n=i.pop(),[e,O(i),n]}function Vr(e,t,n,r,i){return L.resolve().then(function(){var a=I.transless||I,o=e._createTransaction(t,n,e._dbSchema,r);o.explicit=!0;var s={trans:o,transless:a};if(r)o.idbtrans=r.idbtrans;else try{o.create(),o.idbtrans._explicit=!0,e._state.PR1398_maxLoop=3}catch(r){return r.name===_e.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn(`Dexie: Need to reopen db`),e.close({disableAutoOpen:!1}),e.open().then(function(){return Vr(e,t,n,null,i)})):jt(r)}var c=ce(i);c&&xt();var l,u=L.follow(function(){if(l=i.call(o,o),l){if(c){var e=St.bind(null,null);l.then(e,e)}else typeof l.next==`function`&&typeof l.throw==`function`&&(l=zr(l))}},s);return(l&&typeof l.then==`function`?L.resolve(l).then(function(e){return o.active?e:jt(new P.PrematureCommit(`Transaction committed too early. See http://bit.ly/2kdckMn`))}):u.then(function(){return l})).then(function(e){return r&&o._resolve(),o._completion.then(function(){return e})}).catch(function(e){return o._reject(e),jt(e)})})}function Hr(e,t,n){for(var r=o(e)?e.slice():[e],i=0;i<n;++i)r.push(t);return r}function Ur(e){return n(n({},e),{table:function(t){var r=e.table(t),i=r.schema,a=Object.create(null),o=[];function s(e,t,r){var i=Un(e),c=a[i]=a[i]||[],l=e==null?0:typeof e==`string`?1:e.length,u=t>0,d=n(n({},r),{name:u?`${i}(virtual-from:${r.name})`:r.name,lowLevelIndex:r,isVirtual:u,keyTail:t,keyLength:l,extractKey:zn(e),unique:!u&&r.unique});return c.push(d),d.isPrimaryKey||o.push(d),l>1&&s(l===2?e[0]:e.slice(0,l-1),t+1,r),c.sort(function(e,t){return e.keyTail-t.keyTail}),d}var c=s(i.primaryKey.keyPath,0,i.primaryKey);a[`:id`]=[c];for(var l=0,u=i.indexes;l<u.length;l++){var d=u[l];s(d.keyPath,0,d)}function f(e){var t=a[Un(e)];return t&&t[0]}function p(t,n){return{type:t.type===1?2:t.type,lower:Hr(t.lower,t.lowerOpen?e.MAX_KEY:e.MIN_KEY,n),lowerOpen:!0,upper:Hr(t.upper,t.upperOpen?e.MIN_KEY:e.MAX_KEY,n),upperOpen:!0}}function m(e){var t=e.query.index;return t.isVirtual?n(n({},e),{query:{index:t.lowLevelIndex,range:p(e.query.range,t.keyTail)}}):e}return n(n({},r),{schema:n(n({},i),{primaryKey:c,indexes:o,getIndexByKeyPath:f}),count:function(e){return r.count(m(e))},query:function(e){return r.query(m(e))},openCursor:function(t){var n=t.query.index,i=n.keyTail,a=n.isVirtual,o=n.keyLength;if(!a)return r.openCursor(t);function s(n){function r(r){r==null?t.unique?n.continue(n.key.slice(0,o).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,i)):n.continue():n.continue(Hr(r,t.reverse?e.MAX_KEY:e.MIN_KEY,i))}return Object.create(n,{continue:{value:r},continuePrimaryKey:{value:function(t,r){n.continuePrimaryKey(Hr(t,e.MAX_KEY,i),r)}},primaryKey:{get:function(){return n.primaryKey}},key:{get:function(){var e=n.key;return o===1?e[0]:e.slice(0,o)}},value:{get:function(){return n.value}}})}return r.openCursor(m(t)).then(function(e){return e&&s(e)})}})}})}var Wr={stack:`dbcore`,name:`VirtualIndexMiddleware`,level:1,create:Ur};function Gr(e,t,n,r){return n||={},r||=``,a(e).forEach(function(i){if(!u(t,i))n[r+i]=void 0;else{var a=e[i],o=t[i];if(typeof a==`object`&&typeof o==`object`&&a&&o){var s=ne(a);s===ne(o)?s===`Object`?Gr(a,o,n,r+i+`.`):a!==o&&(n[r+i]=t[i]):n[r+i]=t[i]}else a!==o&&(n[r+i]=t[i])}}),a(t).forEach(function(i){u(e,i)||(n[r+i]=t[i])}),n}function Kr(e,t){return t.type===`delete`?t.keys:t.keys||t.values.map(e.extractKey)}var qr={stack:`dbcore`,name:`HooksMiddleware`,level:2,create:function(e){return n(n({},e),{table:function(t){var i=e.table(t),a=i.schema.primaryKey;return n(n({},i),{mutate:function(e){var o=I.trans,s=o.table(t).hook,c=s.deleting,l=s.creating,d=s.updating;switch(e.type){case`add`:if(l.fire===Se)break;return o._promise(`readwrite`,function(){return f(e)},!0);case`put`:if(l.fire===Se&&d.fire===Se)break;return o._promise(`readwrite`,function(){return f(e)},!0);case`delete`:if(c.fire===Se)break;return o._promise(`readwrite`,function(){return f(e)},!0);case`deleteRange`:if(c.fire===Se)break;return o._promise(`readwrite`,function(){return p(e)},!0)}return i.mutate(e);function f(e){var t=I.trans,o=e.keys||Kr(a,e);if(!o)throw Error(`Keys missing`);return e=e.type===`add`||e.type===`put`?n(n({},e),{keys:o}):n({},e),e.type!==`delete`&&(e.values=r([],e.values,!0)),e.keys&&(e.keys=r([],e.keys,!0)),Jr(i,e,o).then(function(n){var r=o.map(function(r,i){var o=n[i],s={onerror:null,onsuccess:null};if(e.type===`delete`)c.fire.call(s,r,o,t);else if(e.type===`add`||o===void 0){var f=l.fire.call(s,r,e.values[i],t);r==null&&f!=null&&(r=f,e.keys[i]=r,a.outbound||w(e.values[i],a.keyPath,r))}else{var p=Gr(o,e.values[i]),m=d.fire.call(s,p,r,o,t);if(m){var h=e.values[i];Object.keys(m).forEach(function(e){u(h,e)?h[e]=m[e]:w(h,e,m[e])})}}return s});return i.mutate(e).then(function(t){for(var i=t.failures,a=t.results,s=t.numFailures,c=t.lastResult,l=0;l<o.length;++l){var u=a?a[l]:o[l],d=r[l];u==null?d.onerror&&d.onerror(i[l]):d.onsuccess&&d.onsuccess(e.type===`put`&&n[l]?e.values[l]:u)}return{failures:i,results:a,numFailures:s,lastResult:c}}).catch(function(e){return r.forEach(function(t){return t.onerror&&t.onerror(e)}),Promise.reject(e)})})}function p(e){return m(e.trans,e.range,1e4)}function m(e,t,r){return i.query({trans:e,values:!1,query:{index:a,range:t},limit:r}).then(function(i){var a=i.result;return f({type:`delete`,keys:a,trans:e}).then(function(i){return i.numFailures>0?Promise.reject(i.failures[0]):a.length<r?{failures:[],numFailures:0,lastResult:void 0}:m(e,n(n({},t),{lower:a[a.length-1],lowerOpen:!0}),r)})})}}})}})}};function Jr(e,t,n){return t.type===`add`?Promise.resolve([]):e.getMany({trans:t.trans,keys:n,cache:`immutable`})}function Yr(e,t,n){try{if(!t||t.keys.length<e.length)return null;for(var r=[],i=0,a=0;i<t.keys.length&&a<e.length;++i)Kt(t.keys[i],e[a])===0&&(r.push(n?ee(t.values[i]):t.values[i]),++a);return r.length===e.length?r:null}catch{return null}}var Xr={stack:`dbcore`,level:-1,create:function(e){return{table:function(t){var r=e.table(t);return n(n({},r),{getMany:function(e){if(!e.cache)return r.getMany(e);var t=Yr(e.keys,e.trans._cache,e.cache===`clone`);return t?L.resolve(t):r.getMany(e).then(function(t){return e.trans._cache={keys:e.keys,values:e.cache===`clone`?ee(t):t},t})},mutate:function(e){return e.type!==`add`&&(e.trans._cache=null),r.mutate(e)}})}}}};function Zr(e,t){return e.trans.mode===`readonly`&&!!e.subscr&&!e.trans.explicit&&e.trans.db._options.cache!==`disabled`&&!t.schema.primaryKey.outbound}function Qr(e,t){switch(e){case`query`:return t.values&&!t.unique;case`get`:return!1;case`getMany`:return!1;case`count`:return!1;case`openCursor`:return!1}}var $r={stack:`dbcore`,level:0,name:`Observability`,create:function(e){var t=e.schema.name,r=new wr(e.MIN_KEY,e.MAX_KEY);return n(n({},e),{transaction:function(t,n,r){if(I.subscr&&n!==`readonly`)throw new P.ReadOnly(`Readwrite transaction in liveQuery context. Querier source: ${I.querier}`);return e.transaction(t,n,r)},table:function(i){var s=e.table(i),c=s.schema,l=c.primaryKey,u=c.indexes,d=l.extractKey,f=l.outbound,p=l.autoIncrement&&u.filter(function(e){return e.compound&&e.keyPath.includes(l.keyPath)}),m=n(n({},s),{mutate:function(n){var a=n.trans,u=n.mutatedParts||={},d=function(e){var n=`idb://${t}/${i}/${e}`;return u[n]||(u[n]=new wr)},f=d(``),m=d(`:dels`),h=n.type,g=n.type===`deleteRange`?[n.range]:n.type===`delete`?[n.keys]:n.values.length<50?[Kr(l,n).filter(function(e){return e!=null}),n.values]:[],_=g[0],v=g[1],y=n.trans._cache;if(o(_)){f.addKeys(_);var b=h===`delete`||_.length===v.length?Yr(_,y):null;b||m.addKeys(_),(b||v)&&ei(d,c,b,v)}else if(_){var x={from:_.lower??e.MIN_KEY,to:_.upper??e.MAX_KEY};m.add(x),f.add(x)}else f.add(r),m.add(r),c.indexes.forEach(function(e){return d(e.name).add(r)});return s.mutate(n).then(function(e){return _&&(n.type===`add`||n.type===`put`)&&(f.addKeys(e.results),p&&p.forEach(function(t){for(var r=n.values.map(function(e){return t.extractKey(e)}),i=t.keyPath.findIndex(function(e){return e===l.keyPath}),a=0,o=e.results.length;a<o;++a)r[a][i]=e.results[a];d(t.name).addKeys(r)})),a.mutatedParts=jr(a.mutatedParts||{},u),e})}}),h=function(t){var n=t.query,r=n.index,i=n.range;return[r,new wr(i.lower??e.MIN_KEY,i.upper??e.MAX_KEY)]},g={get:function(e){return[l,new wr(e.key)]},getMany:function(e){return[l,new wr().addKeys(e.keys)]},count:h,query:h,openCursor:h};return a(g).forEach(function(e){m[e]=function(a){var o=I.subscr,c=!!o,l=Zr(I,s)&&Qr(e,a)?a.obsSet={}:o;if(c){var u=function(e){var n=`idb://${t}/${i}/${e}`;return l[n]||(l[n]=new wr)},p=u(``),m=u(`:dels`),h=g[e](a),_=h[0],v=h[1];if(e===`query`&&_.isPrimaryKey&&!a.values?m.add(v):u(_.name||``).add(v),!_.isPrimaryKey){if(e===`count`)m.add(r);else{var y=e===`query`&&f&&a.values&&s.query(n(n({},a),{values:!1}));return s[e].apply(this,arguments).then(function(t){if(e===`query`){if(f&&a.values)return y.then(function(e){var n=e.result;return p.addKeys(n),t});var n=a.values?t.result.map(d):t.result;a.values?p.addKeys(n):m.addKeys(n)}else if(e===`openCursor`){var r=t,i=a.values;return r&&Object.create(r,{key:{get:function(){return m.addKey(r.primaryKey),r.key}},primaryKey:{get:function(){var e=r.primaryKey;return m.addKey(e),e}},value:{get:function(){return i&&p.addKey(r.primaryKey),r.value}}})}return t})}}}return s[e].apply(this,arguments)}}),m}})}};function ei(e,t,n,r){function i(t){var i=e(t.name||``);function a(e){return e==null?null:t.extractKey(e)}var s=function(e){return t.multiEntry&&o(e)?e.forEach(function(e){return i.addKey(e)}):i.addKey(e)};(n||r).forEach(function(e,t){var i=n&&a(n[t]),o=r&&a(r[t]);Kt(i,o)!==0&&(i!=null&&s(i),o!=null&&s(o))})}t.indexes.forEach(i)}function ti(e,t,r){if(r.numFailures===0)return t;if(t.type===`deleteRange`)return null;var i=t.keys?t.keys.length:`values`in t&&t.values?t.values.length:1;if(r.numFailures===i)return null;var a=n({},t);return o(a.keys)&&(a.keys=a.keys.filter(function(e,t){return!(t in r.failures)})),`values`in a&&o(a.values)&&(a.values=a.values.filter(function(e,t){return!(t in r.failures)})),a}function ni(e,t){return t.lower===void 0?!0:t.lowerOpen?Kt(e,t.lower)>0:Kt(e,t.lower)>=0}function ri(e,t){return t.upper===void 0?!0:t.upperOpen?Kt(e,t.upper)<0:Kt(e,t.upper)<=0}function ii(e,t){return ni(e,t)&&ri(e,t)}function ai(e,t,n,r,i,a){if(!n||n.length===0)return e;var s=t.query.index,c=s.multiEntry,l=t.query.range,u=r.schema.primaryKey.extractKey,d=s.extractKey,f=(s.lowLevelIndex||s).extractKey,p=n.reduce(function(e,n){var r=e,i=[];if(n.type===`add`||n.type===`put`)for(var a=new wr,s=n.values.length-1;s>=0;--s){var f=n.values[s],p=u(f);if(!a.hasKey(p)){var m=d(f);(c&&o(m)?m.some(function(e){return ii(e,l)}):ii(m,l))&&(a.addKey(p),i.push(f))}}switch(n.type){case`add`:var h=new wr().addKeys(t.values?e.map(function(e){return u(e)}):e);r=e.concat(t.values?i.filter(function(e){var t=u(e);return!h.hasKey(t)&&(h.addKey(t),!0)}):i.map(function(e){return u(e)}).filter(function(e){return!h.hasKey(e)&&(h.addKey(e),!0)}));break;case`put`:var g=new wr().addKeys(n.values.map(function(e){return u(e)}));r=e.filter(function(e){return!g.hasKey(t.values?u(e):e)}).concat(t.values?i:i.map(function(e){return u(e)}));break;case`delete`:var _=new wr().addKeys(n.keys);r=e.filter(function(e){return!_.hasKey(t.values?u(e):e)});break;case`deleteRange`:var v=n.range;r=e.filter(function(e){return!ii(u(e),v)})}return r},e);if(p===e)return e;var m=function(e,t){return Kt(f(e),f(t))||Kt(u(e),u(t))};return p.sort(t.direction===`prev`||t.direction===`prevunique`?function(e,t){return m(t,e)}:m),t.limit&&t.limit<1/0&&(p.length>t.limit?p.length=t.limit:e.length===t.limit&&p.length<t.limit&&(i.dirty=!0)),a?Object.freeze(p):p}function oi(e,t){return Kt(e.lower,t.lower)===0&&Kt(e.upper,t.upper)===0&&!!e.lowerOpen==!!t.lowerOpen&&!!e.upperOpen==!!t.upperOpen}function si(e,t,n,r){if(e===void 0)return t===void 0?0:-1;if(t===void 0)return 1;var i=Kt(e,t);if(i===0){if(n&&r)return 0;if(n)return 1;if(r)return-1}return i}function ci(e,t,n,r){if(e===void 0)return t===void 0?0:1;if(t===void 0)return-1;var i=Kt(e,t);if(i===0){if(n&&r)return 0;if(n)return-1;if(r)return 1}return i}function li(e,t){return si(e.lower,t.lower,e.lowerOpen,t.lowerOpen)<=0&&ci(e.upper,t.upper,e.upperOpen,t.upperOpen)>=0}function ui(e,t,n,r){var i=Nr[`idb://${e}/${t}`];if(!i)return[];var a=i.queries[n];if(!a)return[null,!1,i,null];var o=a[(r.query?r.query.index.name:null)||``];if(!o)return[null,!1,i,null];switch(n){case`query`:var s=r.direction??`next`,c=o.find(function(e){return e.req.limit===r.limit&&e.req.values===r.values&&(e.req.direction??`next`)===s&&oi(e.req.query.range,r.query.range)});return c?[c,!0,i,o]:[o.find(function(e){return(`limit`in e.req?e.req.limit:1/0)>=r.limit&&(e.req.direction??`next`)===s&&(!r.values||e.req.values)&&li(e.req.query.range,r.query.range)}),!1,i,o];case`count`:var l=o.find(function(e){return oi(e.req.query.range,r.query.range)});return[l,!!l,i,o]}}function di(e,t,n,r){e.subscribers.add(n),r.addEventListener(`abort`,function(){e.subscribers.delete(n),e.subscribers.size===0&&fi(e,t)})}function fi(e,t){setTimeout(function(){e.subscribers.size===0&&ae(t,e)},3e3)}var pi={stack:`dbcore`,level:0,name:`Cache`,create:function(e){var t=e.schema.name;return n(n({},e),{transaction:function(n,r,i){var a=e.transaction(n,r,i);if(r===`readwrite`){var o=new AbortController,s=o.signal,c=function(i){return function(){if(o.abort(),r===`readwrite`){for(var s=new Set,c=0,l=n;c<l.length;c++){var u=l[c],d=Nr[`idb://${t}/${u}`];if(d){var f=e.table(u),p=d.optimisticOps.filter(function(e){return e.trans===a});if(a._explicit&&i&&a.mutatedParts)for(var m=0,h=Object.values(d.queries.query);m<h.length;m++)for(var g=h[m],_=0,v=g.slice();_<v.length;_++){var y=v[_];Mr(y.obsSet,a.mutatedParts)&&(ae(g,y),y.subscribers.forEach(function(e){return s.add(e)}))}else if(p.length>0){d.optimisticOps=d.optimisticOps.filter(function(e){return e.trans!==a});for(var b=0,x=Object.values(d.queries.query);b<x.length;b++)for(var g=x[b],S=0,C=g.slice();S<C.length;S++){var y=C[S];if(y.res!=null&&a.mutatedParts){if(i&&!y.dirty){var w=Object.isFrozen(y.res),T=ai(y.res,y.req,p,f,y,w);y.dirty?(ae(g,y),y.subscribers.forEach(function(e){return s.add(e)})):T!==y.res&&(y.res=T,y.promise=L.resolve({result:T}))}else y.dirty&&ae(g,y),y.subscribers.forEach(function(e){return s.add(e)})}}}}}s.forEach(function(e){return e()})}}};a.addEventListener(`abort`,c(!1),{signal:s}),a.addEventListener(`error`,c(!1),{signal:s}),a.addEventListener(`complete`,c(!0),{signal:s})}return a},table:function(r){var i=e.table(r),a=i.schema.primaryKey;return n(n({},i),{mutate:function(e){var o=I.trans;if(a.outbound||o.db._options.cache===`disabled`||o.explicit||o.idbtrans.mode!==`readwrite`)return i.mutate(e);var s=Nr[`idb://${t}/${r}`];if(!s)return i.mutate(e);var c=i.mutate(e);return(e.type===`add`||e.type===`put`)&&(e.values.length>=50||Kr(a,e).some(function(e){return e==null}))?c.then(function(t){var r=ti(s,n(n({},e),{values:e.values.map(function(e,r){if(t.failures[r])return e;var i=a.keyPath?.includes(`.`)?ee(e):n({},e);return w(i,a.keyPath,t.results[r]),i})}),t);s.optimisticOps.push(r),queueMicrotask(function(){return e.mutatedParts&&Ir(e.mutatedParts)})}):(s.optimisticOps.push(e),e.mutatedParts&&Ir(e.mutatedParts),c.then(function(t){if(t.numFailures>0){ae(s.optimisticOps,e);var n=ti(s,e,t);n&&s.optimisticOps.push(n),e.mutatedParts&&Ir(e.mutatedParts)}}),c.catch(function(){ae(s.optimisticOps,e),e.mutatedParts&&Ir(e.mutatedParts)})),c},query:function(e){if(!Zr(I,i)||!Qr(`query`,e))return i.query(e);var n=I.trans?.db._options.cache===`immutable`,a=I,o=a.requery,s=a.signal,c=ui(t,r,`query`,e),l=c[0],u=c[1],d=c[2],f=c[3];if(l&&u)l.obsSet=e.obsSet;else{var p=i.query(e).then(function(e){var t=e.result;if(l&&(l.res=t),n){for(var r=0,i=t.length;r<i;++r)Object.freeze(t[r]);Object.freeze(t)}return e}).catch(function(e){return f&&l&&ae(f,l),Promise.reject(e)});l={obsSet:e.obsSet,promise:p,subscribers:new Set,type:`query`,req:e,dirty:!1},f?f.push(l):(f=[l],d||=Nr[`idb://${t}/${r}`]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}},d.queries.query[e.query.index.name||``]=f)}return di(l,f,o,s),l.promise.then(function(t){var r=ai(t.result,e,d?.optimisticOps,i,l,n);return{result:n?r:ee(r)}})}})}})}};function mi(e,t){return new Proxy(e,{get:function(e,n,r){return n===`db`?t:Reflect.get(e,n,r)}})}var hi=function(){function e(t,r){var i=this;this._middlewares={},this.verno=0;var a=e.dependencies;this._options=r=n({addons:e.addons,autoOpen:!0,indexedDB:a.indexedDB,IDBKeyRange:a.IDBKeyRange,cache:`cloned`,maxConnections:Rt},r),this._deps={indexedDB:r.indexedDB,IDBKeyRange:r.IDBKeyRange};var o=r.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var s={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Se,dbReadyPromise:null,cancelOpen:Se,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:r.autoOpen};s.dbReadyPromise=new L(function(e){s.dbReadyResolve=e}),s.openCanceller=new L(function(e,t){s.cancelOpen=t}),this._state=s,this.name=t,this.on=tn(this,`populate`,`blocked`,`versionchange`,`close`,{ready:[Ae,Se]}),this.once=function(e,t){var n=function(){var r=[...arguments];i.on(e).unsubscribe(n),t.apply(i,r)};return i.on(e,n)},this.on.ready.subscribe=y(this.on.ready.subscribe,function(t){return function(n,r){e.vip(function(){var e=i._state;if(e.openComplete)e.dbOpenError||L.resolve().then(n),r&&t(n);else if(e.onReadyBeingFired)e.onReadyBeingFired.push(n),r&&t(n);else{t(n);var a=i;r||t(function e(){a.on.ready.unsubscribe(n),a.on.ready.unsubscribe(e)})}})}}),this.Collection=hn(this),this.Table=rn(this),this.Transaction=Nn(this),this.Version=fr(this),this.WhereClause=Dn(this),this.on(`versionchange`,function(e){e.newVersion>0?console.warn(`Another connection wants to upgrade database '${i.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${i.name}'. Closing db now to resume the delete request.`),i.close({disableAutoOpen:!1})}),this.on(`blocked`,function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn(`Dexie.delete('${i.name}') was blocked`):console.warn(`Upgrade '${i.name}' blocked by other connection holding version ${e.oldVersion/10}`)}),this._maxKey=Rn(r.IDBKeyRange),this._createTransaction=function(e,t,n,r){return new i.Transaction(e,t,n,i._options.chromeTransactionDurability,r)},this._fireOnBlocked=function(e){i.on(`blocked`).fire(e),pr.toArray().filter(function(e){return e.name===i.name&&e!==i&&!e._state.vcFired}).map(function(t){return t.on(`versionchange`).fire(e)})},this.use(Xr),this.use(pi),this.use($r),this.use(Wr),this.use(qr);var c=new Proxy(this,{get:function(e,t,n){if(t===`_vip`)return!0;if(t===`table`)return function(e){return mi(i.table(e),c)};var r=Reflect.get(e,t,n);return r instanceof en?mi(r,c):t===`tables`?r.map(function(e){return mi(e,c)}):t===`_createTransaction`?function(){return mi(r.apply(this,arguments),c)}:r}});this.vip=c,o.forEach(function(e){return e(i)})}return e.prototype.version=function(e){if(isNaN(e)||e<.1)throw new P.Type(`Given version is not a positive number`);if(e=Math.round(e*10)/10,this.idbdb||this._state.isBeingOpened)throw new P.Schema(`Cannot add version when database is open`);this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter(function(t){return t._cfg.version===e})[0];return n||(n=new this.Version(e),t.push(n),t.sort(Xn),n.stores({}),this._state.autoSchema=!1,n)},e.prototype._whenReady=function(e){var t=this;return this.idbdb&&(this._state.openComplete||I.letThrough||this._vip)?e():new L(function(e,n){if(t._state.openComplete)return n(new P.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen){n(new P.DatabaseClosed);return}t.open().catch(Se)}t._state.dbReadyPromise.then(e,n)}).then(e)},e.prototype.use=function(e){var t=e.stack,n=e.create,r=e.level,i=e.name;i&&this.unuse({stack:t,name:i});var a=this._middlewares[t]||(this._middlewares[t]=[]);return a.push({stack:t,create:n,level:r??10,name:i}),a.sort(function(e,t){return e.level-t.level}),this},e.prototype.unuse=function(e){var t=e.stack,n=e.name,r=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter(function(e){return r?e.create!==r:n?e.name!==n:!1})),this},e.prototype.open=function(){var e=this;return Ot(Je,function(){return Rr(e)})},e.prototype._close=function(){this.on.close.fire(new CustomEvent(`close`));var e=this._state;if(pr.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}e.isBeingOpened||(e.dbReadyPromise=new L(function(t){e.dbReadyResolve=t}),e.openCanceller=new L(function(t,n){e.cancelOpen=n}))},e.prototype.close=function(e){var t=(e===void 0?{disableAutoOpen:!0}:e).disableAutoOpen,n=this._state;t?(n.isBeingOpened&&n.cancelOpen(new P.DatabaseClosed),this._close(),n.autoOpen=!1,n.dbOpenError=new P.DatabaseClosed):(this._close(),n.autoOpen=this._options.autoOpen||n.isBeingOpened,n.openComplete=!1,n.dbOpenError=null)},e.prototype.delete=function(e){var t=this;e===void 0&&(e={disableAutoOpen:!0});var n=arguments.length>0&&typeof arguments[0]!=`object`,r=this._state;return new L(function(i,a){var o=function(){t.close(e);var n=t._deps.indexedDB.deleteDatabase(t.name);n.onsuccess=pt(function(){yr(t._deps,t.name),i()}),n.onerror=On(a),n.onblocked=t._fireOnBlocked};if(n)throw new P.InvalidArgument(`Invalid closeOptions argument to db.delete()`);r.isBeingOpened?r.dbReadyPromise.then(o):o()})},e.prototype.backendDB=function(){return this.idbdb},e.prototype.isOpen=function(){return this.idbdb!==null},e.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&e.name===`DatabaseClosedError`},e.prototype.hasFailed=function(){return this._state.dbOpenError!==null},e.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(e.prototype,"tables",{get:function(){var e=this;return a(this._allTables).map(function(t){return e._allTables[t]})},enumerable:!1,configurable:!0}),e.prototype.transaction=function(){var e=Br.apply(this,arguments);return this._transaction.apply(this,e)},e.prototype._transaction=function(e,t,n){var r=this,i=I.trans;i&&i.db===this&&e.indexOf(`!`)===-1||(i=null);var a=e.indexOf(`?`)!==-1;e=e.replace(`!`,``).replace(`?`,``);var o,s;try{if(s=t.map(function(e){var t=e instanceof r.Table?e.name:e;if(typeof t!=`string`)throw TypeError(`Invalid table argument to Dexie.transaction(). Only Table or String are allowed`);return t}),e==`r`||e===Bt)o=Bt;else if(e==`rw`||e==Vt)o=Vt;else throw new P.InvalidArgument(`Invalid transaction mode: `+e);if(i){if(i.mode===Bt&&o===Vt){if(a)i=null;else throw new P.SubTransaction(`Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY`)}i&&s.forEach(function(e){if(i&&i.storeNames.indexOf(e)===-1){if(a)i=null;else throw new P.SubTransaction(`Table `+e+` not included in parent transaction.`)}}),a&&i&&!i.active&&(i=null)}}catch(e){return i?i._promise(null,function(t,n){n(e)}):jt(e)}var c=Vr.bind(null,this,o,s,i,n);return i?i._promise(o,c,`lock`):I.trans?Ot(I.transless,function(){return r._whenReady(c)}):this._whenReady(c)},e.prototype.table=function(e){if(!u(this._allTables,e))throw new P.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]},e}(),gi=typeof Symbol<`u`&&`observable`in Symbol?Symbol.observable:`@@observable`,_i=function(){function e(e){this._subscribe=e}return e.prototype.subscribe=function(e,t,n){return this._subscribe(!e||typeof e==`function`?{next:e,error:t,complete:n}:e)},e.prototype[gi]=function(){return this},e}(),vi;try{vi={indexedDB:i.indexedDB||i.mozIndexedDB||i.webkitIndexedDB||i.msIndexedDB,IDBKeyRange:i.IDBKeyRange||i.webkitIDBKeyRange}}catch{vi={indexedDB:null,IDBKeyRange:null}}function yi(e){var t=!1,n,r=new _i(function(r){var i=ce(e);function a(t){var n=ot();try{i&&xt();var r=bt(e,t);return i&&(r=r.finally(St)),r}finally{n&&st()}}var o=!1,s,c={},l={},u={get closed(){return o},unsubscribe:function(){o||(o=!0,s&&s.abort(),d&&jn.storagemutated.unsubscribe(m))}};r.start&&r.start(u);var d=!1,f=function(){return At(h)};function p(){return Mr(l,c)}var m=function(e){jr(c,e),p()&&f()},h=function(){if(!o&&vi.indexedDB){c={};var i={};s&&s.abort(),s=new AbortController;var u={subscr:i,signal:s.signal,requery:f,querier:e,trans:null},h=a(u);d||=(jn.storagemutated.subscribe(m),!0),Promise.resolve(h).then(function(e){t=!0,n=e,o||u.signal.aborted||(p()?f():(l=i,p()?f():(c={},At(function(){return!o&&r.next&&r.next(e)}))))},function(e){o||u.signal.aborted||(t=!1,[`DatabaseClosedError`,`AbortError`].includes(e?.name)||o||At(function(){o||r.error&&r.error(e)}))})}};return setTimeout(f,0),u});return r.hasValue=function(){return t},r.getValue=function(){return n},r}var bi=hi;d(bi,n(n({},xe),{delete:function(e){return new bi(e,{addons:[]}).delete()},exists:function(e){return new bi(e,{addons:[]}).open().then(function(e){return e.close(),!0}).catch(`NoSuchDatabaseError`,function(){return!1})},getDatabaseNames:function(e){try{return _r(bi.dependencies).then(e)}catch{return jt(new P.MissingAPI)}},defineClass:function(){function e(e){s(this,e)}return e},ignoreTransaction:function(e){return I.trans?Ot(I.transless||Je,e):e()},vip:br,async:function(e){return function(){try{var t=zr(e.apply(this,arguments));return!t||typeof t.then!=`function`?L.resolve(t):t}catch(e){return jt(e)}}},spawn:function(e,t,n){try{var r=zr(e.apply(n,t||[]));return!r||typeof r.then!=`function`?L.resolve(r):r}catch(e){return jt(e)}},currentTransaction:{get:function(){return I.trans||null}},waitFor:function(e,t){var n=L.resolve(typeof e==`function`?bi.ignoreTransaction(e):e).timeout(t||6e4);return I.trans?I.trans.waitFor(n):n},Promise:L,debug:{get:function(){return je},set:function(e){Me(e)}},derive:m,extend:s,props:d,override:y,Events:tn,on:jn,liveQuery:yi,extendObservabilitySet:jr,getByKeyPath:C,setByKeyPath:w,delByKeyPath:T,shallowClone:E,deepClone:ee,getObjectDiff:Gr,cmp:Kt,asap:x,minKey:Ft,addons:[],connections:{get:pr.toArray},errnames:_e,dependencies:vi,cache:Nr,semVer:Nt,version:Nt.split(`.`).map(function(e){return parseInt(e)}).reduce(function(e,t,n){return e+t/10**(n*2)})})),bi.maxKey=Rn(bi.dependencies.IDBKeyRange),typeof dispatchEvent<`u`&&typeof addEventListener<`u`&&(jn(kn,function(e){if(!Si){var t=new CustomEvent(An,{detail:e});Si=!0,dispatchEvent(t),Si=!1}}),addEventListener(An,function(e){var t=e.detail;Si||xi(t)}));function xi(e){var t=Si;try{Si=!0,jn.storagemutated.fire(e),z(e,!0)}finally{Si=t}}var Si=!1,Ci,wi=function(){};typeof BroadcastChannel<`u`&&(wi=function(){Ci=new BroadcastChannel(An),Ci.onmessage=function(e){return e.data&&xi(e.data)}},wi(),typeof Ci.unref==`function`&&Ci.unref(),jn(kn,function(e){Si||Ci.postMessage(e)})),typeof addEventListener<`u`&&(addEventListener(`pagehide`,function(e){if(!hi.disableBfCache&&e.persisted){je&&console.debug(`Dexie: handling persisted pagehide`),Ci?.close();for(var t=0,n=pr.toArray();t<n.length;t++)n[t].close({disableAutoOpen:!1})}}),addEventListener(`pageshow`,function(e){!hi.disableBfCache&&e.persisted&&(je&&console.debug(`Dexie: handling persisted pageshow`),wi(),xi({all:new wr(-1/0,[[]])}))}));function Ti(e){return new Qt({add:e})}function Ei(e){return new Qt({remove:e})}function Di(e,t){return new Qt({replacePrefix:[e,t]})}return L.rejectionMapper=be,Me(je),n(hi,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:Rt,Dexie:hi,Entity:Gt,PropModification:Qt,RangeSet:wr,add:Ti,cmp:Kt,default:hi,liveQuery:yi,mergeRanges:Er,rangesOverlap:Dr,remove:Ei,replacePrefix:Di}),{default:hi}),hi}))})),y=l(d(),1),b=_(),x=l(v(),1),S=Symbol.for(`Dexie`),C=globalThis[S]||(globalThis[S]=x.default);if(x.default.semVer!==C.semVer)throw Error(`Two different versions of Dexie loaded in the same app: ${x.default.semVer} and ${C.semVer}`);var{liveQuery:w,mergeRanges:T,rangesOverlap:E,RangeSet:D,cmp:O,Entity:k,PropModification:A,replacePrefix:j,add:M,remove:ee,DexieYProvider:N}=C;function te(e,t,n){let r,i;typeof e==`function`?(r=t||[],i=n):(r=[],i=t);let a=y.useRef({hasResult:!1,result:i,error:null}),[o,s]=y.useReducer(e=>e+1,0),c=y.useMemo(()=>{let t=typeof e==`function`?e():e;if(!t||typeof t.subscribe!=`function`)throw TypeError(e===t?`Given argument to useObservable() was neither a valid observable nor a function.`:`Observable factory given to useObservable() did not return a valid observable.`);if(!a.current.hasResult&&typeof window<`u`&&(typeof t.hasValue!=`function`||t.hasValue())){if(typeof t.getValue==`function`)a.current.result=t.getValue(),a.current.hasResult=!0;else{let e=t.subscribe(e=>{a.current.result=e,a.current.hasResult=!0});typeof e==`function`?e():e.unsubscribe()}}return t},r);if(y.useDebugValue(a.current.result),y.useEffect(()=>{let e=c.subscribe(e=>{let{current:t}=a;(t.error!==null||t.result!==e)&&(t.error=null,t.result=e,t.hasResult=!0,s())},e=>{let{current:t}=a;t.error!==e&&(t.error=e,s())});return typeof e==`function`?e:e.unsubscribe.bind(e)},r),a.current.error)throw a.current.error;return a.current.result}function ne(e,t,n){return te(()=>C.liveQuery(e),t||[],n)}typeof FinalizationRegistry<`u`&&new FinalizationRegistry(e=>{let t=C.DexieYProvider;t&&t.release(e)}),Reflect.get(y,`use`);function re(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,a,o=[],s=``,c=e.split(`/`);for(c[0]||c.shift();i=c.shift();)n=i[0],n===`*`?(o.push(n),s+=i[1]===`?`?`(?:/(.*))?`:`/(.*)`):n===`:`?(r=i.indexOf(`?`,1),a=i.indexOf(`.`,1),o.push(i.substring(1,~r?r:~a?a:i.length)),s+=~r&&!~a?`(?:/([^/]+?))?`:`/([^/]+?)`,~a&&(s+=(~r?`?`:``)+`\\`+i.substring(a))):s+=`/`+i;return{keys:o,pattern:RegExp(`^`+s+(t?`(?=$|/)`:`/?$`),`i`)}}var ie=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),ae=o(((e,t)=>{t.exports=ie()}))(),oe=y.useInsertionEffect,se=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?y.useLayoutEffect:y.useEffect,ce=oe||se,le=e=>{let t=y.useRef([e,(...e)=>t[0](...e)]).current;return ce(()=>{t[0]=e}),t[1]},ue=[`popstate`,`pushState`,`replaceState`,`hashchange`],de=[],fe=()=>de.forEach(e=>e()),pe=e=>(de.push(e)===1&&ue.forEach(e=>addEventListener(e,fe)),()=>{de=de.filter(t=>t!==e),de.length||ue.forEach(e=>removeEventListener(e,fe))}),me=(e,t)=>(0,ae.useSyncExternalStore)(pe,e,t),he=()=>location.search,ge=({ssrSearch:e}={})=>me(he,e==null?he:()=>e),_e=()=>location.pathname,ve=({ssrPath:e}={})=>me(_e,e==null?_e:()=>e),P=(e,{replace:t=!1,state:n=null}={})=>history[t?`replaceState`:`pushState`](n,``,e),ye=e=>[ve(e),P],be=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[be]===void 0){for(let e of[`pushState`,`replaceState`]){let t=history[e];history[e]=function(){let n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,be,{value:!0})}var xe=(e=``)=>e===`/`?``:e,Se=(e,t)=>e[0]===`~`?e.slice(1):xe(t)+e,Ce=(e,t)=>(e=we(xe(e)),t=we(t),!e||(t.toLowerCase()+`/`).startsWith(e.toLowerCase()+`/`)?t.slice(e.length)||`/`:`~`+t),we=e=>{try{return e.includes(`%`)?decodeURI(e):e}catch{return e}},Te=e=>we(e[0]===`?`?e.slice(1):e),Ee={hook:ye,searchHook:ge,parser:re,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e,aroundNav:(e,t,n)=>e(t,n)},De=(0,y.createContext)(Ee),Oe=()=>(0,y.useContext)(De),ke={},Ae=(0,y.createContext)(ke),je=()=>(0,y.useContext)(Ae),Me=(e,t=e.base)=>Ce(t,e.hook(e)[0]),Ne=e=>{let[t,n]=e.hook(e);return[Ce(e.base,t),le((t,r)=>e.aroundNav(n,Se(t,e.base),r))]},Pe=()=>Ne(Oe()),Fe=()=>{let e=Oe();return Te(e.searchHook(e))},Ie=(e,t,n,r)=>{let{pattern:i,keys:a}=t instanceof RegExp?{pattern:t}:e(t||`*`,r),o=i.exec(n);if(!o)return[!1,null];let s={};for(let e=1;e<o.length;e++)s[e-1]=o[e];if(a)for(let e=0;e<a.length;e++)s[a[e]]=o[e+1];else Object.assign(s,o.groups);return r?[!0,s,o[0]]:[!0,s]},Le=({children:e,...t})=>{let n=Oe(),r=t.hook?Ee:n,i=r;if(t.ssrPath){let[e,n=t.ssrSearch??``]=t.ssrPath.split(`?`);e&&(t.ssrSearch=n,t.ssrPath=e)}t.hrefs=t.hrefs??t.hook?.hrefs,t.searchHook=t.searchHook??t.hook?.searchHook;let a=(0,y.useRef)(r),o=a.current,s=o;for(let e in r){let n=e===`base`?r[e]+(t[e]??``):t[e]??r[e];n!==s[e]&&(o===s&&(a.current=s={...s}),s[e]=n),(n!==r[e]||n!==i[e])&&(i=s)}return(0,y.createElement)(De.Provider,{value:i},e)},Re=({children:e,component:t},n)=>t?(0,y.createElement)(t,{params:n}):typeof e==`function`?e(n):e,ze=e=>{let t=(0,y.useRef)(ke),n=t.current,r=Object.keys(e);return t.current=r.length!==Object.keys(n).length||r.some(t=>e[t]!==n[t])?e:n},Be=({path:e,nest:t,match:n,...r})=>{let i=Oe(),a=Me(i),[o,s,c]=n??Ie(i.parser,e,a,t),l=ze({...je(),...s});if(!o)return null;let u=Re(r,l);return(0,y.createElement)(Ae.Provider,{value:l},c?(0,y.createElement)(Le,{base:c},u):u)},Ve=(0,y.forwardRef)((e,t)=>{let n=Oe(),[r,i]=Ne(n),{to:a=``,href:o=a,onClick:s,asChild:c,children:l,className:u,replace:d,state:f,transition:p,...m}=e;return m.onClick=le(t=>{t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button!==0||(s?.(t),t.defaultPrevented||(t.preventDefault(),i(o,e)))}),m.href=n.hrefs(o[0]===`~`?o.slice(1):n.base+o,n),u!==void 0&&(m.className=u?.call?u(r===o):u),t&&(m.ref=t),c&&(0,y.isValidElement)(l)?(0,y.cloneElement)(l,m):(0,y.createElement)(`a`,m,l)}),He=(e,t=[])=>{if(Array.isArray(e))for(let n of e)He(n&&n.type===y.Fragment?n.props.children:n,t);else t.push(e);return t},Ue=({children:e,location:t})=>{let n=Oe(),r=Me(n);for(let i of He(e)){let e=0;if((0,y.isValidElement)(i)&&(e=Ie(n.parser,i.props.path,t||r,i.props.nest))[0])return(0,y.cloneElement)(i,{match:e})}return null},F=new class extends C{profiles;posts;notes;checks;constructor(){super(`dissentry`),this.version(1).stores({profiles:`id, handle, createdAt`,posts:`id, rootId, parentId, quoteOfId, profileId, createdAt`,notes:`id, postId, profileId, status, createdAt`,checks:`[postId+profileId], postId, profileId`})}},We=()=>typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():Math.random().toString(36).slice(2)+Date.now().toString(36),Ge=e=>(e.match(/\d+[xX]\d+|[A-Z]?[a-z]+|[A-Z]|\d+/g)??[]).join(`-`).toLowerCase();function Ke(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Ge(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var qe=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},Je=e=>{let t=qe(e);return t.charAt(0).toUpperCase()+t.slice(1)},I=(...e)=>{let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of n.split(/\s+/))e&&t.add(e);return[...t].join(` `)},Ye={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Xe(e){return e!=null}function Ze(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Ye.width,a=e.size??e.height??Ye.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?I(...c):I(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Ye[`stroke-width`])*Number(e.size??e.width??Ye.width)/Number(t.size??t.width??Ye.width):t.strokeWidth??Ye[`stroke-width`];return[`svg`,{...Object.entries(Ye).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Xe(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Xe(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Xe(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function L(e,t={}){return Ze(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Qe=e=>{if(typeof e!=`object`||!e)return!1;for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&(t.startsWith(`aria-`)||t===`role`||t===`title`)&&e[t]!=null)return!0;return!1},$e=(0,y.createContext)({}),et=()=>(0,y.useContext)($e),tt=(0,y.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:_=`currentColor`,className:v=``}=et()??{},b=!!c||Qe(d),[x,S,C=[]]=L(u,{color:e??_,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:I(v,s),hasA11yProp:b,attributes:d});return(0,y.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,y.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function nt(e,t=[],n=[]){let r=typeof e==`string`?Ke(e,t,n):e,i=(0,y.forwardRef)(({className:e,...t},n)=>(0,y.createElement)(tt,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Je(r.name)),i}var rt={name:`arrow-right`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]};rt.node;var it=nt(rt),at={name:`badge-check`,size:24,node:[[`path`,{d:`M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z`,key:`3c2336`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`verified`]};at.node;var ot=nt(at),st={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};st.node;var ct=nt(st),lt={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};lt.node;var ut=nt(lt),dt={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};dt.node;var ft=nt(dt),pt={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};pt.node;var mt=nt(pt),ht={name:`coins`,size:24,node:[[`path`,{d:`M13.744 17.736a6 6 0 1 1-7.48-7.48`,key:`bq4yh3`}],[`path`,{d:`M15 6h1v4`,key:`11y1tn`}],[`path`,{d:`m6.134 14.768.866-.5 2 3.464`,key:`17snzx`}],[`circle`,{cx:`16`,cy:`8`,r:`6`,key:`14bfc9`}]]};ht.node;var gt=nt(ht),_t={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};_t.node;var vt=nt(_t),yt={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};yt.node;var bt=nt(yt),xt={name:`earth`,size:24,node:[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]],aliases:[`globe-2`]};xt.node;var St=nt(xt),Ct={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};Ct.node;var wt=nt(Ct),Tt={name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]};Tt.node;var Et=nt(Tt),Dt={name:`image-down`,size:24,node:[[`path`,{d:`M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21`,key:`9csbqa`}],[`path`,{d:`m14 19 3 3v-5.5`,key:`9ldu5r`}],[`path`,{d:`m17 22 3-3`,key:`1nkfve`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]};Dt.node;var Ot=nt(Dt),kt={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};kt.node;var At=nt(kt),jt={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};jt.node;var Mt=nt(jt),Nt={name:`message-circle`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]};Nt.node;var Pt=nt(Nt),Ft={name:`message-square-reply`,size:24,node:[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`m10 8-3 3 3 3`,key:`fp6dz7`}],[`path`,{d:`M17 14v-1a2 2 0 0 0-2-2H7`,key:`1tkjnz`}]]};Ft.node;var It=nt(Ft),Lt={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Lt.node;var Rt=nt(Lt),zt={name:`quote`,size:24,node:[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]};zt.node;var Bt=nt(zt),Vt={name:`refresh-cw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]};Vt.node;var Ht=nt(Vt),Ut={name:`scan-search`,size:24,node:[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`m16 16-1.9-1.9`,key:`1dq9hf`}]]};Ut.node;var Wt=nt(Ut),Gt={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Gt.node;var Kt=nt(Gt),qt={name:`share-2`,size:24,node:[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]};qt.node;var Jt=nt(qt),Yt={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};Yt.node;var Xt=nt(Yt),Zt={name:`sparkles`,size:24,node:[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]],aliases:[`stars`]};Zt.node;var Qt=nt(Zt),$t={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]};$t.node;var en=nt($t),tn={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};tn.node;var nn=nt(tn),rn={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};rn.node;var an=nt(rn),on={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};on.node;var sn=nt(on),cn={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};cn.node;var ln=nt(cn),un={"common.back":`Back`,"common.cancel":`Cancel`,"common.checker":`Checker`,"common.close":`Close`,"common.edit":`Edit`,"common.notFound":`Page not found.`,"common.remove":`Remove`,"common.save":`Save`,"nav.home":`Home`,"nav.models":`Models`,"nav.trust":`Trust`,"nav.settings":`Settings`,"nav.newThread":`New thread`,"layout.language":`Language`,"layout.localFirst":`Local-first: your posts and keys stay in this browser.`,"layout.openSource":`Open source (MIT)`,"layout.recent":`Recent threads`,"panel.yourModels":`Your models`,"panel.manage":`Manage`,"panel.noModels":`No models yet. Add one with your own API key, or a local model.`,"panel.addModel":`Add model`,"panel.howTitle":`How it works`,"panel.how1":`@mention a model to ask it anything.`,"panel.how2":`Checker models review every answer and add a note only when something is wrong.`,"panel.how3":`Mark notes right or not helpful to see which models you can trust.`,"home.title":`Home`,"home.sub":`Ask one model. Let the others dissent.`,"home.more":`Show more`,"welcome.title":`Don’t take one model’s word for it.`,"welcome.body":`Ask any AI model a question. Your other models check the answer and add a note only when they find a mistake.`,"welcome.step1":`Add two or more models with your own API keys, or local models.`,"welcome.step2":`Mark the ones that should review answers as checkers.`,"welcome.step3":`@mention a model and watch the notes appear.`,"welcome.cta":`Or add a model with an API key`,"welcome.privacy":`Keys and posts stay in your browser. Nothing is sent to us.`,"tips.title":`Ask your first question`,"tips.body":`@mention a model, or tap one of the chips above. Checkers review the answer and add a note only if they find a problem.`,"tips.saving":`Tip: let a cheap or local model answer and a strong model check. You only pay for a long reply when it’s needed.`,"composer.placeholder":`Ask anything… @mention a model, e.g. @{handle}`,"composer.everyModel":`Every enabled model`,"composer.noModels":`Add a model to start. Cloud models use your own API key; local models (Ollama, LM Studio) need no key.`,"composer.addFirst":`Add a model with an API key`,"composer.asking":`Asking`,"composer.checkedBy":`checked by`,"composer.mentionHint":`Mention a model with @ or tap a chip`,"composer.post":`Post`,"composer.reply":`Reply`,"composer.quote":`Quote`,"post.youName":`You`,"post.you":`you`,"post.deletedModel":`Deleted model`,"post.respondingTo":`Responding to a note from @{handle}`,"post.retry":`Retry`,"post.stopped":`Stopped.`,"post.checking":`Checking with {handles}`,"post.noDissent":`No dissent from {handles}`,"post.couldNotCheck":`@{handle} could not check`,"post.reply":`Reply`,"post.quote":`Quote`,"post.stop":`Stop`,"post.checkAgain":`Check again`,"post.regenerate":`Regenerate`,"post.copy":`Copy`,"post.copied":`Copied`,"post.delete":`Delete`,"post.deleteConfirm":`Delete this post and its replies?`,"note.title":`Dissent`,"note.from":`from @{handle}`,"note.agree":`{handles} agree`,"note.accepted":`You accepted this note`,"note.dismissed":`Dismissed`,"note.right":`Note is right`,"note.notHelpful":`Not helpful`,"note.undo":`Undo`,"note.askRespond":`Ask @{handle} to respond`,"note.seeResponse":`See @{handle}’s response →`,"sev.minor":`minor`,"sev.major":`major`,"sev.critical":`critical`,"quote.hint":`Quote with a note, then @mention who should respond`,"quote.placeholder":`Add a note, e.g. “@{handle} is this right?”`,"quote.placeholderPlain":`Add a note…`,"thread.title":`Thread`,"thread.deleted":`This post was deleted.`,"thread.quoted":`Quoted {n}×`,"thread.replyTo":`Reply to @{handle} (or @mention another model)`,"thread.replyMention":`Reply and @mention a model`,"thread.postReply":`Post your reply…`,"models.title":`Models`,"models.sub":`Bring your own keys, cloud or local`,"models.hostedTitle":`Your keys stay in this browser.`,"models.hostedBody":`Requests go straight from your browser to each provider and never touch our server.`,"models.hostedOllama":`For local models, start Ollama with`,"models.hostedNpx":`— or run Dissentry on your computer:`,"models.checkerHint":`Turn on Checker for models that should review other models’ answers.`,"models.add":`+ Add model`,"models.empty":`No models yet. Try Ollama for a free local model, or add a cloud provider with your API key. Keys are stored only in this browser and sent only to the provider you choose.`,"models.noModel":`no model selected`,"models.on":`On`,"editor.provider":`Provider`,"editor.name":`Display name`,"editor.handle":`Handle (for @mentions)`,"editor.handleTaken":`@{handle} is already used`,"editor.baseUrl":`Base URL`,"editor.key":`API key`,"editor.keyOptional":`API key (optional)`,"editor.keyPlaceholder":`Stored only in this browser`,"editor.keyLocal":`Not needed for local servers`,"editor.getKey":`Get a key →`,"editor.model":`Model`,"editor.fetch":`Fetch models`,"editor.fetching":`Fetching models…`,"editor.modelsFound":`{n} models available`,"editor.instructions":`Extra instructions (optional)`,"editor.instructionsPlaceholder":`e.g. Answer like a senior engineer. Cite sources.`,"editor.checker":`Checker: reviews other models’ answers`,"editor.color":`Color`,"editor.route":`Route through local server`,"editor.routeHint":`Send requests through the local Dissentry server: avoids browser CORS blocks and uses the network proxy from Settings. Keys are passed through, never stored.`,"editor.test":`Test connection`,"editor.testing":`Testing…`,"editor.connected":`Connected in {ms} ms. Replied “{reply}”`,"editor.removeConfirm":`Remove @{handle}? Its posts stay in your timeline.`,"trust.title":`Trust`,"trust.sub":`Who gets corrected, and whose notes hold up, on your questions`,"trust.summary":`answers you confirmed were wrong, out of {n} checked. Without a second opinion you might have trusted them.`,"trust.empty":`Add models and ask some questions to build your trust table.`,"trust.asAnswerer":`As answerer`,"trust.asChecker":`As checker`,"trust.heldUp":`held up`,"trust.notesRight":`of rated notes were right`,"trust.answers":`Answers: {a} · checked: {c}`,"trust.corrected":`{n} corrected by a note you accepted`,"trust.awaiting":`{n} notes awaiting your verdict`,"trust.reviewed":`Reviewed: {a} · notes: {n}`,"trust.acceptedDismissed":`{a} accepted · {d} dismissed`,"trust.footnote":`Numbers come only from your own votes on notes, so they describe how each model does on your questions.`,"settings.title":`Settings`,"settings.profile":`Profile`,"settings.name":`Your display name`,"settings.autoCheck":`Check every answer automatically`,"settings.autoCheckDesc":`Checkers review each answer when it finishes. Turn off to check manually with the 🔍 button (saves tokens).`,"settings.data":`Your data`,"settings.dataDesc":`Everything lives in this browser. Export to back up or move to another device.`,"settings.export":`Export (without keys)`,"settings.exportKeys":`Export with API keys`,"settings.import":`Import…`,"settings.imported":`Imported.`,"settings.importFailed":`Import failed: {error}`,"settings.clear":`Clear all data`,"settings.clearConfirm":`Delete all posts, notes and models from this browser? This cannot be undone.`,"settings.cleared":`All data cleared.`,"connection.title":`Connection`,"connection.hostedDesc":`Requests go directly from your browser to each AI provider, using your device’s network. If a provider is blocked where you are, turn on your VPN or system proxy and Dissentry will use it automatically.`,"proxy.title":`Network proxy`,"proxy.localDesc":`Provider requests go through the local Dissentry server (no CORS problems; keys are passed through, never stored). Choose how it connects out.`,"proxy.system":`System`,"proxy.systemFound":`Use the proxy from the environment:`,"proxy.systemNone":`Use HTTPS_PROXY / HTTP_PROXY if set when Dissentry starts. None detected, so requests go direct.`,"proxy.direct":`No proxy`,"proxy.directDesc":`Connect to every provider directly.`,"proxy.custom":`Custom proxy`,"proxy.customDesc":`For example your Clash, V2Ray or Shadowsocks client, or a company proxy.`,"proxy.address":`Proxy address`,"proxy.addressHelp":`HTTP, HTTPS and SOCKS5 are supported. For a login use http://user:pass@host:port.`,"proxy.bypass":`Don’t use the proxy for (optional)`,"proxy.bypassHelp":`Comma-separated hosts; a leading dot matches subdomains. Local addresses (Ollama, LM Studio) always connect directly.`,"proxy.enterAddress":`Enter a proxy address.`,"proxy.badScheme":`Use http://, https:// or socks5://`,"proxy.badUrl":`Looks like: http://127.0.0.1:7890 or socks5://127.0.0.1:1080`,"proxy.test":`Test connection`,"proxy.testing":`Testing…`,"proxy.reachable":`Reachable in {ms} ms (HTTP {status}; 401 is expected without a key).`,"err.auth":`Authentication failed for @{handle}: check the API key. ({msg})`,"err.model":`Model “{model}” not found for @{handle}. ({msg})`,"err.quota":`@{handle} hit a rate limit or ran out of credit. ({msg})`,"err.unreachable":`Could not reach {url}. Check your network or proxy.`,"err.localHosted":`Could not reach {url}. Is it running? Ollama must allow this site: start it with OLLAMA_ORIGINS={origin} ollama serve (your browser may also ask to allow local network access).`,"err.blockedHosted":`Your browser could not reach {url}. If this provider is blocked on your network, turn on your VPN or system proxy and try again.`,"err.empty":`The model returned an empty answer.`,"post.share":`Share as image`,"share.title":`Share as image`,"share.rendering":`Rendering…`,"share.includeQuestion":`Include the question`,"share.failed":`Could not create the image: {error}`,"share.postX":`Post on X`,"share.copy":`Copy image`,"share.download":`Download`,"share.native":`Share…`,"share.privacy":`The image is made on your device. Nothing is uploaded.`,"share.copied":`Image copied.`,"share.copyUnsupported":`This browser can’t copy images. Use Download instead.`,"share.pasteHint":`Image copied: paste it into your post (⌘V / Ctrl+V).`,"share.attachHint":`Image downloaded: attach it to your post.`,"share.tweetNote":`{author} sounded sure. {checkers} disagreed. 📝
12
12
 
13
- Don’t take one AI’s word for it.`,"share.tweetOk":`{checkers} checked {author}’s answer and found nothing wrong. ✓`,"share.tweetPlain":`Asked {author} on Dissentry, where other AI models fact-check the answer.`,"card.agree":`agree`,"card.noDissent":`No dissent from {handles}`,"card.tagline":`Don’t take one AI’s word for it.`,"card.byline":`Free & open source · bring your own keys`,"card.stampDissent":`Dissent`,"card.stampChecked":`Checked`,"or.signIn":`Sign in with OpenRouter`,"or.redirecting":`Opening OpenRouter…`,"or.pitch":`One login for Claude, GPT, Gemini, DeepSeek, Qwen, Grok and hundreds more, billed to your own OpenRouter account. No keys to copy.`,"or.cardTitle":`Fastest way to start`,"or.title":`Connect OpenRouter`,"or.connecting":`Connecting your OpenRouter account…`,"or.connected":`Your OpenRouter account is connected.`,"or.pickTitle":`Choose your models`,"or.pickSub":`The newest model from each family is pre-selected. All of them can check each other’s answers.`,"or.keyNote":`Dissentry received a key for your OpenRouter account. It stays in this browser; you can see or revoke it any time at openrouter.ai/keys.`,"or.add":`Add {n} models`,"or.more":`Pick other models later on the Models page`,"or.cancelled":`Sign-in was cancelled.`,"or.stateError":`This sign-in link expired or came from another tab. Please try again.`,"or.failed":`Could not connect OpenRouter ({error}). Please try again.`,"or.useKey":`Use an API key instead`,"or.perMillion":`per 1M tokens`,"or.priceHint":`Input / output price in US dollars per million tokens, charged by OpenRouter to your account.`,"trust.noAnswers":`No checked answers yet.`,"trust.noChecks":`Hasn’t checked any answers yet.`,"trust.noRated":`Reviewed {a} answers and wrote {n} notes. Rate its notes to see how often it’s right.`,"nav.usage":`Usage`,"usage.title":`Usage`,"usage.sub":`Tokens and estimated cost, recorded on this device`,"usage.tokens":`tokens`,"usage.range.today":`Today`,"usage.range.7d":`7 days`,"usage.range.30d":`30 days`,"usage.range.all":`All`,"usage.answering":`Answering`,"usage.checking":`Checking`,"usage.checkInsight":`Checking used {pct}% of your tokens. Tip: use a cheaper model to answer and a stronger one to check.`,"usage.byModel":`By model`,"usage.split":`Answers {a} · checks {c}`,"usage.empty":`No usage recorded in this period yet.`,"usage.noPrice":`Add this model’s price on the Models page to estimate cost.`,"usage.addPrice":`no price set`,"usage.footnote":`Estimates from the token counts each provider returns and the prices on your models. Your provider’s bill is the final word. Usage is recorded from this version on.`,"usage.postLine":`{a} tokens · checks {c}`,"usage.postTip":`Answer: {i} in / {o} out tokens · checks: {c} tokens`,"editor.inPrice":`Input price (USD / 1M tokens)`,"editor.outPrice":`Output price (USD / 1M tokens)`,"editor.priceHelp":`Optional: used to estimate cost on the Usage page. Filled in automatically for OpenRouter models.`,"land.navHow":`How it works`,"land.navFeatures":`Features`,"land.navFaq":`FAQ`,"land.openApp":`Open app`,"land.eyebrow":`Free & open source · Bring your own models`,"land.h1":`Don’t take one AI’s word for it.`,"land.sub":`Ask any AI model a question. Your other models fact-check the answer and add a note only when they find a mistake. You see who was right, and who you can trust.`,"land.ctaKeys":`Use your own API keys`,"land.trustLine":`No account needed. Your keys and chats stay in your browser.`,"land.shotAlt":`Dissentry showing an AI answer with a dissent note from three other models`,"land.cardAlt":`A shareable image of an answer and its dissent note`,"land.worksWith":`Works with`,"land.howTitle":`Three steps to answers you can trust`,"land.s1t":`Ask any model`,"land.s1b":`@mention Claude, GPT, Gemini, DeepSeek, Qwen, Grok or a local model, like replying on X.`,"land.s2t":`Others check it`,"land.s2b":`Checker models review the answer and add a note only when something is factually wrong, outdated or unsafe.`,"land.s3t":`You decide`,"land.s3b":`Mark notes right or not helpful. Over time you see which models get corrected and whose notes hold up.`,"land.featTitle":`Built for people who don’t trust a single model`,"land.f1t":`Notes only when it matters`,"land.f1b":`No nitpicking style. A note means a real problem, with the wrong sentence underlined in the answer.`,"land.f2t":`Consensus at a glance`,"land.f2b":`When several models flag the same claim, their notes merge: “@claude · @qwen · @gemini agree.”`,"land.f3t":`Your own trust scores`,"land.f3b":`See which models hold up on your questions, not on someone else’s benchmark.`,"land.f4t":`Share as image`,"land.f4b":`Turn any answer and its notes into a polished card for X or your team in one click.`,"land.f5t":`Private by design`,"land.f5b":`Keys and chats stay in your browser. Requests go straight to the provider you chose.`,"land.f6t":`Save on tokens`,"land.f6b":`Let a cheap or local model answer and a strong model check. The Usage page shows exactly what you spend.`,"land.faqTitle":`Questions`,"land.q1":`Is Dissentry free?`,"land.a1":`Yes. It’s free and open source (MIT). You pay only your AI providers, directly, for the tokens you use.`,"land.q2":`Where are my API keys stored?`,"land.a2":`Only in your browser. Requests go straight from your browser to each provider and never pass through our server.`,"land.q3":`Can I use my ChatGPT Plus or Claude Pro subscription?`,"land.a3":`Not directly: providers don’t allow third-party apps to use consumer subscriptions, and accounts that try can be suspended. Sign in with OpenRouter instead: one login, every major model, billed to your own account.`,"land.q4":`Which models are supported?`,"land.a4":`OpenAI, Anthropic, Google Gemini, DeepSeek, Qwen, xAI, Mistral, Groq, OpenRouter (hundreds of models), any OpenAI-compatible endpoint, and local models through Ollama or LM Studio.`,"land.q5":`Can I run it on my own computer?`,"land.a5":`Yes: run “npx dissentry”. The local version also works with local models and lets you route requests through a proxy.`,"land.ctaTitle":`Get a second opinion on every answer.`,"land.ctaSub":`Start in under a minute. No account, no install.`},dn={"common.back":`戻る`,"common.cancel":`キャンセル`,"common.checker":`チェッカー`,"common.close":`閉じる`,"common.edit":`編集`,"common.notFound":`ページが見つかりません。`,"common.remove":`削除`,"common.save":`保存`,"nav.home":`ホーム`,"nav.models":`モデル`,"nav.trust":`信頼度`,"nav.settings":`設定`,"nav.newThread":`新しいスレッド`,"layout.language":`言語`,"layout.localFirst":`ローカルファースト:投稿とキーはこのブラウザ内だけに保存されます。`,"layout.openSource":`オープンソース(MIT)`,"layout.recent":`最近のスレッド`,"panel.yourModels":`あなたのモデル`,"panel.manage":`管理`,"panel.noModels":`まだモデルがありません。自分の API キーかローカルモデルで追加しましょう。`,"panel.addModel":`モデルを追加`,"panel.howTitle":`使い方`,"panel.how1":`@でモデルをメンションして、何でも質問します。`,"panel.how2":`チェッカーのモデルがすべての回答を確認し、問題があるときだけ注記を付けます。`,"panel.how3":`注記を「正しい」「役に立たない」で評価すると、信頼できるモデルがわかります。`,"home.title":`ホーム`,"home.sub":`1つのモデルが答え、他のモデルが異議を唱える。`,"home.more":`もっと見る`,"welcome.title":`1つのモデルの言葉だけを信じない。`,"welcome.body":`どの AI モデルにでも質問できます。ほかのモデルが回答を確認し、誤りを見つけたときだけ注記を付けます。`,"welcome.step1":`自分の API キーで 2 つ以上のモデルを追加するか、ローカルモデルを使います。`,"welcome.step2":`回答を確認させたいモデルをチェッカーに設定します。`,"welcome.step3":`モデルを@で呼んで質問し、注記が付くのを見ます。`,"welcome.cta":`または API キーでモデルを追加`,"welcome.privacy":`キーと投稿はブラウザ内だけに保存され、当社には送信されません。`,"tips.title":`最初の質問をしてみましょう`,"tips.body":`@でモデルをメンションするか、上のチップをタップします。チェッカーが回答を確認し、問題があるときだけ注記を付けます。`,"tips.saving":`ヒント:安いモデルやローカルモデルに答えさせ、強いモデルにチェックさせましょう。長い回答の料金は必要なときだけです。`,"composer.placeholder":`何でも質問… @でモデルをメンション(例:@{handle})`,"composer.everyModel":`有効なすべてのモデル`,"composer.noModels":`まずモデルを追加してください。クラウドのモデルは自分の API キーを使い、ローカルモデル(Ollama、LM Studio)はキー不要です。`,"composer.addFirst":`最初のモデルを追加`,"composer.asking":`質問先`,"composer.checkedBy":`チェック`,"composer.mentionHint":`@でモデルをメンションするか、チップをタップ`,"composer.post":`投稿`,"composer.reply":`返信`,"composer.quote":`引用`,"post.youName":`あなた`,"post.you":`あなた`,"post.deletedModel":`削除されたモデル`,"post.respondingTo":`@{handle} の注記への返答`,"post.retry":`再試行`,"post.stopped":`停止しました。`,"post.checking":`{handles} がチェック中`,"post.noDissent":`{handles} から異議なし`,"post.couldNotCheck":`@{handle} はチェックできませんでした`,"post.reply":`返信`,"post.quote":`引用`,"post.stop":`停止`,"post.checkAgain":`再チェック`,"post.regenerate":`再生成`,"post.copy":`コピー`,"post.copied":`コピーしました`,"post.delete":`削除`,"post.deleteConfirm":`この投稿と返信をすべて削除しますか?`,"note.title":`異議`,"note.from":`@{handle} より`,"note.agree":`{handles} も同意`,"note.accepted":`この注記を採用しました`,"note.dismissed":`却下済み`,"note.right":`注記は正しい`,"note.notHelpful":`役に立たない`,"note.undo":`元に戻す`,"note.askRespond":`@{handle} に返答を求める`,"note.seeResponse":`@{handle} の返答を見る →`,"sev.minor":`軽微`,"sev.major":`重要`,"sev.critical":`重大`,"quote.hint":`コメントを付けて引用し、返答してほしいモデルを@で指定`,"quote.placeholder":`コメントを追加(例:「@{handle} これは正しい?」)`,"quote.placeholderPlain":`コメントを追加…`,"thread.title":`スレッド`,"thread.deleted":`この投稿は削除されました。`,"thread.quoted":`{n} 回引用`,"thread.replyTo":`@{handle} に返信(または別のモデルを@)`,"thread.replyMention":`返信してモデルを@で指定`,"thread.postReply":`返信を書く…`,"models.title":`モデル`,"models.sub":`自分のキーで、クラウドでもローカルでも`,"models.hostedTitle":`キーはこのブラウザ内だけに保存されます。`,"models.hostedBody":`リクエストはブラウザから各プロバイダーへ直接送られ、当社のサーバーを経由しません。`,"models.hostedOllama":`ローカルモデルを使うには、Ollama を次のように起動します:`,"models.hostedNpx":`— または自分のパソコンで Dissentry を実行:`,"models.checkerHint":`他のモデルの回答を確認させたいモデルは「チェッカー」をオンにします。`,"models.add":`+ モデルを追加`,"models.empty":`まだモデルがありません。無料のローカルモデル Ollama を試すか、API キーでクラウドのプロバイダーを追加しましょう。キーはこのブラウザ内だけに保存され、選んだプロバイダーにだけ送られます。`,"models.noModel":`モデル未選択`,"models.on":`有効`,"editor.provider":`プロバイダー`,"editor.name":`表示名`,"editor.handle":`ハンドル(@メンション用)`,"editor.handleTaken":`@{handle} はすでに使われています`,"editor.baseUrl":`ベース URL`,"editor.key":`API キー`,"editor.keyOptional":`API キー(任意)`,"editor.keyPlaceholder":`このブラウザ内だけに保存`,"editor.keyLocal":`ローカルサーバーには不要`,"editor.getKey":`キーを取得 →`,"editor.model":`モデル`,"editor.fetch":`モデル一覧を取得`,"editor.fetching":`モデルを取得中…`,"editor.modelsFound":`{n} 個のモデルが利用可能`,"editor.instructions":`追加の指示(任意)`,"editor.instructionsPlaceholder":`例:シニアエンジニアのように答え、出典を示す。`,"editor.checker":`チェッカー:他のモデルの回答を確認`,"editor.color":`色`,"editor.route":`ローカルサーバー経由で送信`,"editor.routeHint":`ローカルの Dissentry サーバー経由でリクエストを送ります。ブラウザの CORS 制限を回避し、設定のネットワークプロキシを使います。キーは転送のみで保存されません。`,"editor.test":`接続テスト`,"editor.testing":`テスト中…`,"editor.connected":`{ms} ミリ秒で接続しました。返答:「{reply}」`,"editor.removeConfirm":`@{handle} を削除しますか?投稿はタイムラインに残ります。`,"trust.title":`信頼度`,"trust.sub":`あなたの質問で、誰が訂正され、誰の注記が正しいか`,"trust.summary":`件の回答が誤りだと確認されました(チェック済み {n} 件中)。セカンドオピニオンがなければ信じていたかもしれません。`,"trust.empty":`モデルを追加していくつか質問すると、信頼度の表ができます。`,"trust.asAnswerer":`回答者として`,"trust.asChecker":`チェッカーとして`,"trust.heldUp":`正しかった`,"trust.notesRight":`評価した注記が正しかった`,"trust.answers":`回答 {a} 件 · チェック済み {c} 件`,"trust.corrected":`{n} 件が採用された注記で訂正`,"trust.awaiting":`{n} 件の注記があなたの評価待ち`,"trust.reviewed":`回答 {a} 件を確認 · 注記 {n} 件`,"trust.acceptedDismissed":`採用 {a} · 却下 {d}`,"trust.footnote":`数値はあなた自身の注記への評価だけから算出され、あなたの質問での各モデルの実力を表します。`,"settings.title":`設定`,"settings.profile":`プロフィール`,"settings.name":`表示名`,"settings.autoCheck":`すべての回答を自動でチェック`,"settings.autoCheckDesc":`回答が完了するたびにチェッカーが確認します。オフにすると🔍ボタンで手動チェックできます(トークンの節約)。`,"settings.data":`データ`,"settings.dataDesc":`すべてのデータはこのブラウザ内にあります。書き出してバックアップや別の端末への移行ができます。`,"settings.export":`書き出し(キーなし)`,"settings.exportKeys":`書き出し(API キー付き)`,"settings.import":`読み込み…`,"settings.imported":`読み込みました。`,"settings.importFailed":`読み込みに失敗しました:{error}`,"settings.clear":`すべてのデータを消去`,"settings.clearConfirm":`このブラウザからすべての投稿、注記、モデルを削除しますか?元に戻せません。`,"settings.cleared":`すべてのデータを消去しました。`,"connection.title":`接続`,"connection.hostedDesc":`リクエストはブラウザから各 AI プロバイダーへ、端末のネットワークを使って直接送られます。お住まいの地域でプロバイダーにつながらない場合は、VPN やシステムプロキシをオンにすれば Dissentry が自動で使います。`,"proxy.title":`ネットワークプロキシ`,"proxy.localDesc":`プロバイダーへのリクエストはローカルの Dissentry サーバーを経由します(CORS の問題なし。キーは転送のみで保存されません)。外部への接続方法を選んでください。`,"proxy.system":`システム`,"proxy.systemFound":`環境変数のプロキシを使用:`,"proxy.systemNone":`Dissentry の起動時に HTTPS_PROXY / HTTP_PROXY が設定されていれば使います。検出されなかったため直接接続します。`,"proxy.direct":`プロキシなし`,"proxy.directDesc":`すべてのプロバイダーに直接接続します。`,"proxy.custom":`カスタムプロキシ`,"proxy.customDesc":`Clash、V2Ray、Shadowsocks のクライアントや会社のプロキシなど。`,"proxy.address":`プロキシのアドレス`,"proxy.addressHelp":`HTTP、HTTPS、SOCKS5 に対応。ログインが必要なら http://ユーザー:パスワード@ホスト:ポート と入力します。`,"proxy.bypass":`プロキシを使わない宛先(任意)`,"proxy.bypassHelp":`カンマ区切りのホスト名。先頭のドットでサブドメインに一致します。ローカルのアドレス(Ollama、LM Studio)は常に直接接続します。`,"proxy.enterAddress":`プロキシのアドレスを入力してください。`,"proxy.badScheme":`http://、https://、socks5:// のいずれかを使ってください`,"proxy.badUrl":`例:http://127.0.0.1:7890 または socks5://127.0.0.1:1080`,"proxy.test":`接続テスト`,"proxy.testing":`テスト中…`,"proxy.reachable":`{ms} ミリ秒で到達しました(HTTP {status}。キーなしでは 401 が正常です)。`,"err.auth":`@{handle} の認証に失敗しました。API キーを確認してください。({msg})`,"err.model":`@{handle} でモデル「{model}」が見つかりません。({msg})`,"err.quota":`@{handle} がレート制限に達したか、残高が不足しています。({msg})`,"err.unreachable":`{url} に接続できません。ネットワークやプロキシを確認してください。`,"err.localHosted":`{url} に接続できません。起動していますか?Ollama でこのサイトを許可する必要があります:OLLAMA_ORIGINS={origin} ollama serve で起動してください(ブラウザがローカルネットワークへのアクセス許可を求めることもあります)。`,"err.blockedHosted":`ブラウザから {url} に接続できません。このプロバイダーがネットワークでブロックされている場合は、VPN かシステムプロキシをオンにして再試行してください。`,"err.empty":`モデルが空の回答を返しました。`,"post.share":`画像で共有`,"share.title":`画像で共有`,"share.rendering":`生成中…`,"share.includeQuestion":`質問を含める`,"share.failed":`画像を作成できませんでした:{error}`,"share.postX":`X に投稿`,"share.copy":`画像をコピー`,"share.download":`ダウンロード`,"share.native":`共有…`,"share.privacy":`画像はお使いの端末で作成され、何もアップロードされません。`,"share.copied":`画像をコピーしました。`,"share.copyUnsupported":`このブラウザは画像のコピーに対応していません。ダウンロードを使ってください。`,"share.pasteHint":`画像をコピーしました。投稿に貼り付けてください(⌘V / Ctrl+V)。`,"share.attachHint":`画像をダウンロードしました。投稿に添付してください。`,"share.tweetNote":`{author}は自信満々。でも{checkers}は異議あり。📝
13
+ Don’t take one AI’s word for it.`,"share.tweetOk":`{checkers} checked {author}’s answer and found nothing wrong. ✓`,"share.tweetPlain":`Asked {author} on Dissentry, where other AI models fact-check the answer.`,"card.agree":`agree`,"card.noDissent":`No dissent from {handles}`,"card.tagline":`Don’t take one AI’s word for it.`,"card.byline":`Free & open source · bring your own keys`,"card.stampDissent":`Dissent`,"card.stampChecked":`Checked`,"or.signIn":`Sign in with OpenRouter`,"or.redirecting":`Opening OpenRouter…`,"or.pitch":`One login for Claude, GPT, Gemini, DeepSeek, Qwen, Grok and hundreds more, billed to your own OpenRouter account. No keys to copy.`,"or.cardTitle":`Fastest way to start`,"or.title":`Connect OpenRouter`,"or.connecting":`Connecting your OpenRouter account…`,"or.connected":`Your OpenRouter account is connected.`,"or.pickTitle":`Choose your models`,"or.pickSub":`The newest model from each family is pre-selected. All of them can check each other’s answers.`,"or.keyNote":`Dissentry received a key for your OpenRouter account. It stays in this browser; you can see or revoke it any time at openrouter.ai/keys.`,"or.add":`Add {n} models`,"or.more":`Pick other models later on the Models page`,"or.cancelled":`Sign-in was cancelled.`,"or.stateError":`This sign-in link expired or came from another tab. Please try again.`,"or.failed":`Could not connect OpenRouter ({error}). Please try again.`,"or.useKey":`Use an API key instead`,"or.perMillion":`per 1M tokens`,"or.priceHint":`Input / output price in US dollars per million tokens, charged by OpenRouter to your account.`,"trust.noAnswers":`No checked answers yet.`,"trust.noChecks":`Hasn’t checked any answers yet.`,"trust.noRated":`Reviewed {a} answers and wrote {n} notes. Rate its notes to see how often it’s right.`,"nav.usage":`Usage`,"usage.title":`Usage`,"usage.sub":`Tokens and estimated cost, recorded on this device`,"usage.tokens":`tokens`,"usage.range.today":`Today`,"usage.range.7d":`7 days`,"usage.range.30d":`30 days`,"usage.range.all":`All`,"usage.answering":`Answering`,"usage.checking":`Checking`,"usage.checkInsight":`Checking used {pct}% of your tokens. Tip: use a cheaper model to answer and a stronger one to check.`,"usage.byModel":`By model`,"usage.split":`Answers {a} · checks {c}`,"usage.empty":`No usage recorded in this period yet.`,"usage.noPrice":`Add this model’s price on the Models page to estimate cost.`,"usage.addPrice":`no price set`,"usage.footnote":`Estimates from the token counts each provider returns and the prices on your models. Your provider’s bill is the final word. Usage is recorded from this version on.`,"usage.postLine":`{a} tokens · checks {c}`,"usage.postTip":`Answer: {i} in / {o} out tokens · checks: {c} tokens`,"editor.inPrice":`Input price (USD / 1M tokens)`,"editor.outPrice":`Output price (USD / 1M tokens)`,"editor.priceHelp":`Optional: used to estimate cost on the Usage page. Filled in automatically for OpenRouter models.`,"land.navHow":`How it works`,"land.navFeatures":`Features`,"land.navFaq":`FAQ`,"land.openApp":`Open app`,"land.eyebrow":`Free & open source · Bring your own models`,"land.h1":`Don’t take one AI’s word for it.`,"land.sub":`Ask any AI model a question. Your other models fact-check the answer and add a note only when they find a mistake. You see who was right, and who you can trust.`,"land.ctaKeys":`Use your own API keys`,"land.trustLine":`No account needed. Your keys and chats stay in your browser.`,"land.shotAlt":`Dissentry showing an AI answer with a dissent note from three other models`,"land.cardAlt":`A shareable image of an answer and its dissent note`,"land.worksWith":`Works with`,"land.howTitle":`Three steps to answers you can trust`,"land.s1t":`Ask any model`,"land.s1b":`@mention Claude, GPT, Gemini, DeepSeek, Qwen, Grok or a local model, like replying on X.`,"land.s2t":`Others check it`,"land.s2b":`Checker models review the answer and add a note only when something is factually wrong, outdated or unsafe.`,"land.s3t":`You decide`,"land.s3b":`Mark notes right or not helpful. Over time you see which models get corrected and whose notes hold up.`,"land.featTitle":`Built for people who don’t trust a single model`,"land.f1t":`Notes only when it matters`,"land.f1b":`No nitpicking style. A note means a real problem, with the wrong sentence underlined in the answer.`,"land.f2t":`Consensus at a glance`,"land.f2b":`When several models flag the same claim, their notes merge: “@claude · @qwen · @gemini agree.”`,"land.f3t":`Your own trust scores`,"land.f3b":`See which models hold up on your questions, not on someone else’s benchmark.`,"land.f4t":`Share as image`,"land.f4b":`Turn any answer and its notes into a polished card for X or your team in one click.`,"land.f5t":`Private by design`,"land.f5b":`Keys and chats stay in your browser. Requests go straight to the provider you chose.`,"land.f6t":`Save on tokens`,"land.f6b":`Let a cheap or local model answer and a strong model check. The Usage page shows exactly what you spend.`,"land.faqTitle":`Questions`,"land.q1":`Is Dissentry free?`,"land.a1":`Yes. It’s free and open source (MIT). You pay only your AI providers, directly, for the tokens you use.`,"land.q2":`Where are my API keys stored?`,"land.a2":`Only in your browser. Requests go straight from your browser to each provider and never pass through our server.`,"land.q3":`Can I use my ChatGPT Plus or Claude Pro subscription?`,"land.a3":`Not directly: providers don’t allow third-party apps to use consumer subscriptions, and accounts that try can be suspended. Sign in with OpenRouter instead: one login, every major model, billed to your own account.`,"land.q4":`Which models are supported?`,"land.a4":`OpenAI, Anthropic, Google Gemini, DeepSeek, Qwen, xAI, Mistral, Groq, OpenRouter (hundreds of models), any OpenAI-compatible endpoint, and local models through Ollama or LM Studio.`,"land.q5":`Can I run it on my own computer?`,"land.a5":`Yes: run “npx dissentry”. The local version also works with local models and lets you route requests through a proxy.`,"land.ctaTitle":`Get a second opinion on every answer.`,"land.ctaSub":`Start in under a minute. No account, no install.`},dn={"common.back":`戻る`,"common.cancel":`キャンセル`,"common.checker":`チェッカー`,"common.close":`閉じる`,"common.edit":`編集`,"common.notFound":`ページが見つかりません。`,"common.remove":`削除`,"common.save":`保存`,"nav.home":`ホーム`,"nav.models":`モデル`,"nav.trust":`信頼度`,"nav.settings":`設定`,"nav.newThread":`新しいスレッド`,"layout.language":`言語`,"layout.localFirst":`ローカルファースト:投稿とキーはこのブラウザ内だけに保存されます。`,"layout.openSource":`オープンソース(MIT)`,"layout.recent":`最近のスレッド`,"panel.yourModels":`あなたのモデル`,"panel.manage":`管理`,"panel.noModels":`まだモデルがありません。自分の API キーかローカルモデルで追加しましょう。`,"panel.addModel":`モデルを追加`,"panel.howTitle":`使い方`,"panel.how1":`@でモデルをメンションして、何でも質問します。`,"panel.how2":`チェッカーのモデルがすべての回答を確認し、問題があるときだけ注記を付けます。`,"panel.how3":`注記を「正しい」「役に立たない」で評価すると、信頼できるモデルがわかります。`,"home.title":`ホーム`,"home.sub":`1つのモデルが答え、他のモデルが異議を唱える。`,"home.more":`もっと見る`,"welcome.title":`1つのモデルの言葉だけを信じない。`,"welcome.body":`どの AI モデルにでも質問できます。ほかのモデルが回答を確認し、誤りを見つけたときだけ注記を付けます。`,"welcome.step1":`自分の API キーで 2 つ以上のモデルを追加するか、ローカルモデルを使います。`,"welcome.step2":`回答を確認させたいモデルをチェッカーに設定します。`,"welcome.step3":`モデルを@で呼んで質問し、注記が付くのを見ます。`,"welcome.cta":`または API キーでモデルを追加`,"welcome.privacy":`キーと投稿はブラウザ内だけに保存され、当社には送信されません。`,"tips.title":`最初の質問をしてみましょう`,"tips.body":`@でモデルをメンションするか、上のチップをタップします。チェッカーが回答を確認し、問題があるときだけ注記を付けます。`,"tips.saving":`ヒント:安いモデルやローカルモデルに答えさせ、強いモデルにチェックさせましょう。長い回答の料金は必要なときだけです。`,"composer.placeholder":`何でも質問… @でモデルをメンション(例:@{handle})`,"composer.everyModel":`有効なすべてのモデル`,"composer.noModels":`まずモデルを追加してください。クラウドのモデルは自分の API キーを使い、ローカルモデル(Ollama、LM Studio)はキー不要です。`,"composer.addFirst":`API キーでモデルを追加`,"composer.asking":`質問先`,"composer.checkedBy":`チェック`,"composer.mentionHint":`@でモデルをメンションするか、チップをタップ`,"composer.post":`投稿`,"composer.reply":`返信`,"composer.quote":`引用`,"post.youName":`あなた`,"post.you":`あなた`,"post.deletedModel":`削除されたモデル`,"post.respondingTo":`@{handle} の注記への返答`,"post.retry":`再試行`,"post.stopped":`停止しました。`,"post.checking":`{handles} がチェック中`,"post.noDissent":`{handles} から異議なし`,"post.couldNotCheck":`@{handle} はチェックできませんでした`,"post.reply":`返信`,"post.quote":`引用`,"post.stop":`停止`,"post.checkAgain":`再チェック`,"post.regenerate":`再生成`,"post.copy":`コピー`,"post.copied":`コピーしました`,"post.delete":`削除`,"post.deleteConfirm":`この投稿と返信をすべて削除しますか?`,"note.title":`異議`,"note.from":`@{handle} より`,"note.agree":`{handles} も同意`,"note.accepted":`この注記を採用しました`,"note.dismissed":`却下済み`,"note.right":`注記は正しい`,"note.notHelpful":`役に立たない`,"note.undo":`元に戻す`,"note.askRespond":`@{handle} に返答を求める`,"note.seeResponse":`@{handle} の返答を見る →`,"sev.minor":`軽微`,"sev.major":`重要`,"sev.critical":`重大`,"quote.hint":`コメントを付けて引用し、返答してほしいモデルを@で指定`,"quote.placeholder":`コメントを追加(例:「@{handle} これは正しい?」)`,"quote.placeholderPlain":`コメントを追加…`,"thread.title":`スレッド`,"thread.deleted":`この投稿は削除されました。`,"thread.quoted":`{n} 回引用`,"thread.replyTo":`@{handle} に返信(または別のモデルを@)`,"thread.replyMention":`返信してモデルを@で指定`,"thread.postReply":`返信を書く…`,"models.title":`モデル`,"models.sub":`自分のキーで、クラウドでもローカルでも`,"models.hostedTitle":`キーはこのブラウザ内だけに保存されます。`,"models.hostedBody":`リクエストはブラウザから各プロバイダーへ直接送られ、当社のサーバーを経由しません。`,"models.hostedOllama":`ローカルモデルを使うには、Ollama を次のように起動します:`,"models.hostedNpx":`— または自分のパソコンで Dissentry を実行:`,"models.checkerHint":`他のモデルの回答を確認させたいモデルは「チェッカー」をオンにします。`,"models.add":`+ モデルを追加`,"models.empty":`まだモデルがありません。無料のローカルモデル Ollama を試すか、API キーでクラウドのプロバイダーを追加しましょう。キーはこのブラウザ内だけに保存され、選んだプロバイダーにだけ送られます。`,"models.noModel":`モデル未選択`,"models.on":`有効`,"editor.provider":`プロバイダー`,"editor.name":`表示名`,"editor.handle":`ハンドル(@メンション用)`,"editor.handleTaken":`@{handle} はすでに使われています`,"editor.baseUrl":`ベース URL`,"editor.key":`API キー`,"editor.keyOptional":`API キー(任意)`,"editor.keyPlaceholder":`このブラウザ内だけに保存`,"editor.keyLocal":`ローカルサーバーには不要`,"editor.getKey":`キーを取得 →`,"editor.model":`モデル`,"editor.fetch":`モデル一覧を取得`,"editor.fetching":`モデルを取得中…`,"editor.modelsFound":`{n} 個のモデルが利用可能`,"editor.instructions":`追加の指示(任意)`,"editor.instructionsPlaceholder":`例:シニアエンジニアのように答え、出典を示す。`,"editor.checker":`チェッカー:他のモデルの回答を確認`,"editor.color":`色`,"editor.route":`ローカルサーバー経由で送信`,"editor.routeHint":`ローカルの Dissentry サーバー経由でリクエストを送ります。ブラウザの CORS 制限を回避し、設定のネットワークプロキシを使います。キーは転送のみで保存されません。`,"editor.test":`接続テスト`,"editor.testing":`テスト中…`,"editor.connected":`{ms} ミリ秒で接続しました。返答:「{reply}」`,"editor.removeConfirm":`@{handle} を削除しますか?投稿はタイムラインに残ります。`,"trust.title":`信頼度`,"trust.sub":`あなたの質問で、誰が訂正され、誰の注記が正しいか`,"trust.summary":`件の回答が誤りだと確認されました(チェック済み {n} 件中)。セカンドオピニオンがなければ信じていたかもしれません。`,"trust.empty":`モデルを追加していくつか質問すると、信頼度の表ができます。`,"trust.asAnswerer":`回答者として`,"trust.asChecker":`チェッカーとして`,"trust.heldUp":`正しかった`,"trust.notesRight":`評価した注記が正しかった`,"trust.answers":`回答 {a} 件 · チェック済み {c} 件`,"trust.corrected":`{n} 件が採用された注記で訂正`,"trust.awaiting":`{n} 件の注記があなたの評価待ち`,"trust.reviewed":`回答 {a} 件を確認 · 注記 {n} 件`,"trust.acceptedDismissed":`採用 {a} · 却下 {d}`,"trust.footnote":`数値はあなた自身の注記への評価だけから算出され、あなたの質問での各モデルの実力を表します。`,"settings.title":`設定`,"settings.profile":`プロフィール`,"settings.name":`表示名`,"settings.autoCheck":`すべての回答を自動でチェック`,"settings.autoCheckDesc":`回答が完了するたびにチェッカーが確認します。オフにすると🔍ボタンで手動チェックできます(トークンの節約)。`,"settings.data":`データ`,"settings.dataDesc":`すべてのデータはこのブラウザ内にあります。書き出してバックアップや別の端末への移行ができます。`,"settings.export":`書き出し(キーなし)`,"settings.exportKeys":`書き出し(API キー付き)`,"settings.import":`読み込み…`,"settings.imported":`読み込みました。`,"settings.importFailed":`読み込みに失敗しました:{error}`,"settings.clear":`すべてのデータを消去`,"settings.clearConfirm":`このブラウザからすべての投稿、注記、モデルを削除しますか?元に戻せません。`,"settings.cleared":`すべてのデータを消去しました。`,"connection.title":`接続`,"connection.hostedDesc":`リクエストはブラウザから各 AI プロバイダーへ、端末のネットワークを使って直接送られます。お住まいの地域でプロバイダーにつながらない場合は、VPN やシステムプロキシをオンにすれば Dissentry が自動で使います。`,"proxy.title":`ネットワークプロキシ`,"proxy.localDesc":`プロバイダーへのリクエストはローカルの Dissentry サーバーを経由します(CORS の問題なし。キーは転送のみで保存されません)。外部への接続方法を選んでください。`,"proxy.system":`システム`,"proxy.systemFound":`環境変数のプロキシを使用:`,"proxy.systemNone":`Dissentry の起動時に HTTPS_PROXY / HTTP_PROXY が設定されていれば使います。検出されなかったため直接接続します。`,"proxy.direct":`プロキシなし`,"proxy.directDesc":`すべてのプロバイダーに直接接続します。`,"proxy.custom":`カスタムプロキシ`,"proxy.customDesc":`Clash、V2Ray、Shadowsocks のクライアントや会社のプロキシなど。`,"proxy.address":`プロキシのアドレス`,"proxy.addressHelp":`HTTP、HTTPS、SOCKS5 に対応。ログインが必要なら http://ユーザー:パスワード@ホスト:ポート と入力します。`,"proxy.bypass":`プロキシを使わない宛先(任意)`,"proxy.bypassHelp":`カンマ区切りのホスト名。先頭のドットでサブドメインに一致します。ローカルのアドレス(Ollama、LM Studio)は常に直接接続します。`,"proxy.enterAddress":`プロキシのアドレスを入力してください。`,"proxy.badScheme":`http://、https://、socks5:// のいずれかを使ってください`,"proxy.badUrl":`例:http://127.0.0.1:7890 または socks5://127.0.0.1:1080`,"proxy.test":`接続テスト`,"proxy.testing":`テスト中…`,"proxy.reachable":`{ms} ミリ秒で到達しました(HTTP {status}。キーなしでは 401 が正常です)。`,"err.auth":`@{handle} の認証に失敗しました。API キーを確認してください。({msg})`,"err.model":`@{handle} でモデル「{model}」が見つかりません。({msg})`,"err.quota":`@{handle} がレート制限に達したか、残高が不足しています。({msg})`,"err.unreachable":`{url} に接続できません。ネットワークやプロキシを確認してください。`,"err.localHosted":`{url} に接続できません。起動していますか?Ollama でこのサイトを許可する必要があります:OLLAMA_ORIGINS={origin} ollama serve で起動してください(ブラウザがローカルネットワークへのアクセス許可を求めることもあります)。`,"err.blockedHosted":`ブラウザから {url} に接続できません。このプロバイダーがネットワークでブロックされている場合は、VPN かシステムプロキシをオンにして再試行してください。`,"err.empty":`モデルが空の回答を返しました。`,"post.share":`画像で共有`,"share.title":`画像で共有`,"share.rendering":`生成中…`,"share.includeQuestion":`質問を含める`,"share.failed":`画像を作成できませんでした:{error}`,"share.postX":`X に投稿`,"share.copy":`画像をコピー`,"share.download":`ダウンロード`,"share.native":`共有…`,"share.privacy":`画像はお使いの端末で作成され、何もアップロードされません。`,"share.copied":`画像をコピーしました。`,"share.copyUnsupported":`このブラウザは画像のコピーに対応していません。ダウンロードを使ってください。`,"share.pasteHint":`画像をコピーしました。投稿に貼り付けてください(⌘V / Ctrl+V)。`,"share.attachHint":`画像をダウンロードしました。投稿に添付してください。`,"share.tweetNote":`{author}は自信満々。でも{checkers}は異議あり。📝
14
14
 
15
- 1つのAIの言葉だけを信じない。`,"share.tweetOk":`{checkers}が{author}の回答をチェックし、問題は見つかりませんでした。✓`,"share.tweetPlain":`Dissentry で{author}に質問。ほかの AI モデルが回答をファクトチェックします。`,"card.agree":`同意`,"card.noDissent":`{handles} から異議なし`,"card.tagline":`1つのAIの言葉だけを信じない。`,"card.byline":`無料・オープンソース · 自分のキーで`,"card.stampDissent":`異議あり`,"card.stampChecked":`検証済み`,"or.signIn":`OpenRouter でサインイン`,"or.redirecting":`OpenRouter を開いています…`,"or.pitch":`1 回のログインで Claude、GPT、Gemini、DeepSeek、Qwen、Grok など数百のモデルを利用。料金はあなたの OpenRouter アカウントに請求されます。キーのコピーは不要です。`,"or.cardTitle":`いちばん早い始め方`,"or.title":`OpenRouter に接続`,"or.connecting":`OpenRouter アカウントに接続しています…`,"or.connected":`OpenRouter アカウントに接続しました。`,"or.pickTitle":`モデルを選ぶ`,"or.pickSub":`各ファミリーの最新モデルを選択済みです。どれも互いの回答をチェックできます。`,"or.keyNote":`Dissentry は OpenRouter アカウントのキーを受け取りました。キーはこのブラウザ内だけに保存され、openrouter.ai/keys でいつでも確認・取り消しできます。`,"or.add":`{n} 個のモデルを追加`,"or.more":`ほかのモデルは後で「モデル」ページで選べます`,"or.cancelled":`サインインはキャンセルされました。`,"or.stateError":`このサインインリンクは期限切れか、別のタブのものです。もう一度お試しください。`,"or.failed":`OpenRouter に接続できませんでした({error})。もう一度お試しください。`,"or.useKey":`API キーを使う`,"or.perMillion":`100万トークンあたり`,"or.priceHint":`入力 / 出力の価格(米ドル / 100 万トークン)。OpenRouter があなたのアカウントに請求します。`,"trust.noAnswers":`チェック済みの回答はまだありません。`,"trust.noChecks":`まだ回答をチェックしていません。`,"trust.noRated":`回答 {a} 件を確認し、注記を {n} 件書きました。注記を評価すると正解率がわかります。`,"nav.usage":`使用量`,"usage.title":`使用量`,"usage.sub":`トークン数と推定コスト(この端末に記録)`,"usage.tokens":`トークン`,"usage.range.today":`今日`,"usage.range.7d":`7日`,"usage.range.30d":`30日`,"usage.range.all":`すべて`,"usage.answering":`回答`,"usage.checking":`チェック`,"usage.checkInsight":`チェックがトークンの {pct}% を使いました。ヒント:回答には安いモデル、チェックには強いモデルを。`,"usage.byModel":`モデル別`,"usage.split":`回答 {a} · チェック {c}`,"usage.empty":`この期間の使用量はまだありません。`,"usage.noPrice":`「モデル」ページでこのモデルの価格を入れるとコストを推定できます。`,"usage.addPrice":`価格未設定`,"usage.footnote":`各プロバイダーが返すトークン数とモデルに設定した価格からの推定です。請求額はプロバイダーの請求書が正です。使用量はこのバージョンから記録されます。`,"usage.postLine":`{a} トークン · チェック {c}`,"usage.postTip":`回答:入力 {i} / 出力 {o} トークン · チェック:{c} トークン`,"editor.inPrice":`入力価格(米ドル / 100万トークン)`,"editor.outPrice":`出力価格(米ドル / 100万トークン)`,"editor.priceHelp":`任意:「使用量」ページでのコスト推定に使います。OpenRouter のモデルは自動入力されます。`,"land.navHow":`使い方`,"land.navFeatures":`機能`,"land.navFaq":`よくある質問`,"land.openApp":`アプリを開く`,"land.eyebrow":`無料・オープンソース · 自分のモデルで`,"land.h1":`1つのAIの言葉だけを信じない。`,"land.sub":`どの AI モデルにでも質問できます。ほかのモデルが回答をファクトチェックし、誤りを見つけたときだけ注記を付けます。誰が正しく、どのモデルを信頼できるかがわかります。`,"land.ctaKeys":`自分の API キーを使う`,"land.trustLine":`アカウント不要。キーと会話はブラウザ内だけに保存されます。`,"land.shotAlt":`3 つのモデルから異議の注記が付いた AI の回答を表示する Dissentry`,"land.cardAlt":`回答と異議の注記を共有用の画像にしたもの`,"land.worksWith":`対応`,"land.howTitle":`信頼できる答えまで 3 ステップ`,"land.s1t":`どのモデルにも質問`,"land.s1b":`X で返信するように、Claude、GPT、Gemini、DeepSeek、Qwen、Grok やローカルモデルを@で呼びます。`,"land.s2t":`他のモデルがチェック`,"land.s2b":`チェッカーのモデルが回答を確認し、事実の誤り・古い情報・危険な内容があるときだけ注記を付けます。`,"land.s3t":`判断するのはあなた`,"land.s3b":`注記を「正しい」「役に立たない」で評価。続けるうちに、どのモデルがよく訂正され、誰の注記が正しいかがわかります。`,"land.featTitle":`1 つのモデルを鵜呑みにしない人のために`,"land.f1t":`大事なときだけ注記`,"land.f1b":`言い回しの指摘はしません。注記は本当の問題のしるしで、回答の誤った文に下線が引かれます。`,"land.f2t":`合意がひと目でわかる`,"land.f2b":`複数のモデルが同じ主張を指摘すると、注記がまとまります:「@claude · @qwen · @gemini も同意」。`,"land.f3t":`あなただけの信頼度`,"land.f3b":`他人のベンチマークではなく、あなたの質問でどのモデルが正しいかがわかります。`,"land.f4t":`画像で共有`,"land.f4b":`回答と注記をワンクリックで美しいカードにして、X やチームに共有できます。`,"land.f5t":`プライバシー重視`,"land.f5b":`キーと会話はブラウザ内だけ。リクエストは選んだプロバイダーへ直接送られます。`,"land.f6t":`トークンを節約`,"land.f6b":`安いモデルやローカルモデルに答えさせ、強いモデルにチェックさせる。「使用量」ページで支出がわかります。`,"land.faqTitle":`よくある質問`,"land.q1":`Dissentry は無料ですか?`,"land.a1":`はい。無料のオープンソース(MIT)です。使ったトークン分を AI プロバイダーに直接支払うだけです。`,"land.q2":`API キーはどこに保存されますか?`,"land.a2":`ブラウザ内だけです。リクエストはブラウザから各プロバイダーへ直接送られ、当社のサーバーを経由しません。`,"land.q3":`ChatGPT Plus や Claude Pro のサブスクを使えますか?`,"land.a3":`直接は使えません。プロバイダーは個人向けサブスクをサードパーティのアプリで使うことを認めておらず、アカウントが停止される恐れがあります。代わりに OpenRouter でサインインすれば、1 回のログインで主要モデルをすべて使え、料金はあなたのアカウントに請求されます。`,"land.q4":`どのモデルに対応していますか?`,"land.a4":`OpenAI、Anthropic、Google Gemini、DeepSeek、Qwen、xAI、Mistral、Groq、OpenRouter(数百のモデル)、OpenAI 互換の任意のエンドポイント、Ollama や LM Studio のローカルモデルです。`,"land.q5":`自分のパソコンで動かせますか?`,"land.a5":`はい。「npx dissentry」を実行してください。ローカル版はローカルモデルにも対応し、プロキシ経由の送信もできます。`,"land.ctaTitle":`すべての回答にセカンドオピニオンを。`,"land.ctaSub":`1 分以内に始められます。アカウントもインストールも不要です。`},fn={"common.back":`뒤로`,"common.cancel":`취소`,"common.checker":`검증자`,"common.close":`닫기`,"common.edit":`편집`,"common.notFound":`페이지를 찾을 수 없습니다.`,"common.remove":`삭제`,"common.save":`저장`,"nav.home":`홈`,"nav.models":`모델`,"nav.trust":`신뢰도`,"nav.settings":`설정`,"nav.newThread":`새 스레드`,"layout.language":`언어`,"layout.localFirst":`로컬 우선: 게시물과 키는 이 브라우저에만 저장됩니다.`,"layout.openSource":`오픈소스 (MIT)`,"layout.recent":`최근 스레드`,"panel.yourModels":`내 모델`,"panel.manage":`관리`,"panel.noModels":`아직 모델이 없습니다. 내 API 키나 로컬 모델로 추가하세요.`,"panel.addModel":`모델 추가`,"panel.howTitle":`사용 방법`,"panel.how1":`@로 모델을 멘션해 무엇이든 물어보세요.`,"panel.how2":`검증자 모델이 모든 답변을 검토하고, 문제가 있을 때만 메모를 답니다.`,"panel.how3":`메모를 "맞음" 또는 "도움 안 됨"으로 평가하면 어떤 모델을 믿을 수 있는지 알 수 있습니다.`,"home.title":`홈`,"home.sub":`모델 하나가 답하고, 나머지가 이의를 제기합니다.`,"home.more":`더 보기`,"welcome.title":`모델 하나의 말만 믿지 마세요.`,"welcome.body":`어떤 AI 모델에게든 질문하세요. 다른 모델들이 답을 검토하고, 오류를 찾았을 때만 메모를 답니다.`,"welcome.step1":`내 API 키로 모델을 두 개 이상 추가하거나 로컬 모델을 연결하세요.`,"welcome.step2":`답변을 검토할 모델을 검증자로 지정하세요.`,"welcome.step3":`모델을 @로 멘션하고 메모가 달리는 것을 보세요.`,"welcome.cta":`또는 API 키로 모델 추가`,"welcome.privacy":`키와 게시물은 브라우저에만 저장되며, 저희에게 전송되지 않습니다.`,"tips.title":`첫 질문을 해 보세요`,"tips.body":`@로 모델을 멘션하거나 위의 칩을 누르세요. 검증자가 답을 검토하고 문제가 있을 때만 메모를 답니다.`,"tips.saving":`팁: 저렴하거나 로컬 모델이 답하게 하고, 강한 모델이 검증하게 하세요. 긴 답변 비용은 필요할 때만 냅니다.`,"composer.placeholder":`무엇이든 물어보세요… @로 모델 멘션 (예: @{handle})`,"composer.everyModel":`활성화된 모든 모델`,"composer.noModels":`먼저 모델을 추가하세요. 클라우드 모델은 내 API 키를 쓰고, 로컬 모델(Ollama, LM Studio)은 키가 필요 없습니다.`,"composer.addFirst":`첫 모델 추가하기`,"composer.asking":`질문 대상`,"composer.checkedBy":`검증`,"composer.mentionHint":`@로 모델을 멘션하거나 칩을 누르세요`,"composer.post":`게시`,"composer.reply":`답글`,"composer.quote":`인용`,"post.youName":`나`,"post.you":`나`,"post.deletedModel":`삭제된 모델`,"post.respondingTo":`@{handle}의 메모에 대한 응답`,"post.retry":`다시 시도`,"post.stopped":`중지됨.`,"post.checking":`{handles} 검증 중`,"post.noDissent":`{handles} 이의 없음`,"post.couldNotCheck":`@{handle} 검증 실패`,"post.reply":`답글`,"post.quote":`인용`,"post.stop":`중지`,"post.checkAgain":`다시 검증`,"post.regenerate":`다시 생성`,"post.copy":`복사`,"post.copied":`복사됨`,"post.delete":`삭제`,"post.deleteConfirm":`이 게시물과 모든 답글을 삭제할까요?`,"note.title":`이의`,"note.from":`@{handle} 작성`,"note.agree":`{handles} 동의`,"note.accepted":`이 메모를 채택했습니다`,"note.dismissed":`무시됨`,"note.right":`메모가 맞음`,"note.notHelpful":`도움 안 됨`,"note.undo":`실행 취소`,"note.askRespond":`@{handle}에게 응답 요청`,"note.seeResponse":`@{handle}의 응답 보기 →`,"sev.minor":`경미`,"sev.major":`중요`,"sev.critical":`심각`,"quote.hint":`코멘트를 달아 인용하고, 응답할 모델을 @로 지정하세요`,"quote.placeholder":`코멘트 추가 (예: "@{handle} 이거 맞아?")`,"quote.placeholderPlain":`코멘트 추가…`,"thread.title":`스레드`,"thread.deleted":`삭제된 게시물입니다.`,"thread.quoted":`{n}회 인용됨`,"thread.replyTo":`@{handle}에게 답글 (또는 다른 모델을 @)`,"thread.replyMention":`답글을 달고 모델을 @로 지정`,"thread.postReply":`답글 쓰기…`,"models.title":`모델`,"models.sub":`내 키로, 클라우드든 로컬이든`,"models.hostedTitle":`키는 이 브라우저에만 저장됩니다.`,"models.hostedBody":`요청은 브라우저에서 각 제공자에게 바로 전송되며, 저희 서버를 거치지 않습니다.`,"models.hostedOllama":`로컬 모델을 쓰려면 Ollama를 이렇게 실행하세요:`,"models.hostedNpx":`— 또는 내 컴퓨터에서 Dissentry 실행:`,"models.checkerHint":`다른 모델의 답변을 검토할 모델은 "검증자"를 켜세요.`,"models.add":`+ 모델 추가`,"models.empty":`아직 모델이 없습니다. 무료 로컬 모델 Ollama를 써 보거나, API 키로 클라우드 제공자를 추가하세요. 키는 이 브라우저에만 저장되고, 선택한 제공자에게만 전송됩니다.`,"models.noModel":`선택된 모델 없음`,"models.on":`사용`,"editor.provider":`제공자`,"editor.name":`표시 이름`,"editor.handle":`핸들 (@멘션용)`,"editor.handleTaken":`@{handle}은(는) 이미 사용 중입니다`,"editor.baseUrl":`Base URL`,"editor.key":`API 키`,"editor.keyOptional":`API 키 (선택)`,"editor.keyPlaceholder":`이 브라우저에만 저장됩니다`,"editor.keyLocal":`로컬 서버에는 필요 없음`,"editor.getKey":`키 발급받기 →`,"editor.model":`모델`,"editor.fetch":`모델 목록 가져오기`,"editor.fetching":`모델을 가져오는 중…`,"editor.modelsFound":`사용 가능한 모델 {n}개`,"editor.instructions":`추가 지시 (선택)`,"editor.instructionsPlaceholder":`예: 시니어 엔지니어처럼 답하고 출처를 밝혀 줘.`,"editor.checker":`검증자: 다른 모델의 답변을 검토`,"editor.color":`색상`,"editor.route":`로컬 서버를 통해 전송`,"editor.routeHint":`로컬 Dissentry 서버를 통해 요청을 보냅니다. 브라우저 CORS 차단을 피하고 설정의 네트워크 프록시를 사용합니다. 키는 전달만 되고 저장되지 않습니다.`,"editor.test":`연결 테스트`,"editor.testing":`테스트 중…`,"editor.connected":`{ms}ms 만에 연결됨. 응답: "{reply}"`,"editor.removeConfirm":`@{handle}을(를) 삭제할까요? 게시물은 타임라인에 남습니다.`,"trust.title":`신뢰도`,"trust.sub":`내 질문에서 누가 자주 정정되고, 누구의 메모가 맞는지`,"trust.summary":`개의 답변이 틀린 것으로 확인되었습니다 (검증된 {n}개 중). 두 번째 의견이 없었다면 믿었을지도 모릅니다.`,"trust.empty":`모델을 추가하고 몇 가지 질문을 하면 신뢰도 표가 만들어집니다.`,"trust.asAnswerer":`답변자로서`,"trust.asChecker":`검증자로서`,"trust.heldUp":`검증 통과`,"trust.notesRight":`평가한 메모가 맞음`,"trust.answers":`답변 {a}개 · 검증 {c}개`,"trust.corrected":`채택된 메모로 {n}개 정정`,"trust.awaiting":`평가를 기다리는 메모 {n}개`,"trust.reviewed":`답변 {a}개 검토 · 메모 {n}개`,"trust.acceptedDismissed":`채택 {a} · 무시 {d}`,"trust.footnote":`수치는 메모에 대한 내 평가로만 계산되므로, 내 질문에서 각 모델이 어떤지를 보여 줍니다.`,"settings.title":`설정`,"settings.profile":`프로필`,"settings.name":`표시 이름`,"settings.autoCheck":`모든 답변 자동 검증`,"settings.autoCheckDesc":`답변이 끝날 때마다 검증자가 검토합니다. 끄면 🔍 버튼으로 직접 검증할 수 있습니다(토큰 절약).`,"settings.data":`내 데이터`,"settings.dataDesc":`모든 데이터는 이 브라우저에 있습니다. 내보내서 백업하거나 다른 기기로 옮길 수 있습니다.`,"settings.export":`내보내기 (키 제외)`,"settings.exportKeys":`내보내기 (API 키 포함)`,"settings.import":`가져오기…`,"settings.imported":`가져왔습니다.`,"settings.importFailed":`가져오기 실패: {error}`,"settings.clear":`모든 데이터 삭제`,"settings.clearConfirm":`이 브라우저에서 모든 게시물, 메모, 모델을 삭제할까요? 되돌릴 수 없습니다.`,"settings.cleared":`모든 데이터를 삭제했습니다.`,"connection.title":`연결`,"connection.hostedDesc":`요청은 기기의 네트워크를 통해 브라우저에서 각 AI 제공자에게 바로 전송됩니다. 내 지역에서 제공자가 차단되어 있다면 VPN이나 시스템 프록시를 켜세요. Dissentry가 자동으로 사용합니다.`,"proxy.title":`네트워크 프록시`,"proxy.localDesc":`제공자 요청은 로컬 Dissentry 서버를 거칩니다(CORS 문제 없음, 키는 전달만 되고 저장되지 않음). 외부로 나가는 방식을 고르세요.`,"proxy.system":`시스템`,"proxy.systemFound":`환경 변수의 프록시 사용:`,"proxy.systemNone":`Dissentry를 시작할 때 HTTPS_PROXY / HTTP_PROXY가 설정되어 있으면 사용합니다. 감지되지 않아 직접 연결합니다.`,"proxy.direct":`프록시 사용 안 함`,"proxy.directDesc":`모든 제공자에 직접 연결합니다.`,"proxy.custom":`사용자 지정 프록시`,"proxy.customDesc":`Clash, V2Ray, Shadowsocks 클라이언트나 회사 프록시 등.`,"proxy.address":`프록시 주소`,"proxy.addressHelp":`HTTP, HTTPS, SOCKS5를 지원합니다. 로그인이 필요하면 http://사용자:비밀번호@호스트:포트 형식으로 입력하세요.`,"proxy.bypass":`프록시를 쓰지 않을 주소 (선택)`,"proxy.bypassHelp":`쉼표로 구분한 호스트 이름. 앞에 점을 붙이면 하위 도메인까지 일치합니다. 로컬 주소(Ollama, LM Studio)는 항상 직접 연결됩니다.`,"proxy.enterAddress":`프록시 주소를 입력하세요.`,"proxy.badScheme":`http://, https:// 또는 socks5://를 사용하세요`,"proxy.badUrl":`예: http://127.0.0.1:7890 또는 socks5://127.0.0.1:1080`,"proxy.test":`연결 테스트`,"proxy.testing":`테스트 중…`,"proxy.reachable":`{ms}ms 만에 연결됨 (HTTP {status}, 키 없이 401은 정상입니다).`,"err.auth":`@{handle} 인증 실패: API 키를 확인하세요. ({msg})`,"err.model":`@{handle}에서 모델 "{model}"을(를) 찾을 수 없습니다. ({msg})`,"err.quota":`@{handle}이(가) 요청 한도에 도달했거나 잔액이 부족합니다. ({msg})`,"err.unreachable":`{url}에 연결할 수 없습니다. 네트워크나 프록시를 확인하세요.`,"err.localHosted":`{url}에 연결할 수 없습니다. 실행 중인가요? Ollama가 이 사이트를 허용해야 합니다: OLLAMA_ORIGINS={origin} ollama serve 로 실행하세요(브라우저가 로컬 네트워크 접근 허용을 물을 수도 있습니다).`,"err.blockedHosted":`브라우저에서 {url}에 연결할 수 없습니다. 이 제공자가 네트워크에서 차단되어 있다면 VPN이나 시스템 프록시를 켜고 다시 시도하세요.`,"err.empty":`모델이 빈 답변을 반환했습니다.`,"post.share":`이미지로 공유`,"share.title":`이미지로 공유`,"share.rendering":`생성 중…`,"share.includeQuestion":`질문 포함`,"share.failed":`이미지를 만들 수 없습니다: {error}`,"share.postX":`X에 게시`,"share.copy":`이미지 복사`,"share.download":`다운로드`,"share.native":`공유…`,"share.privacy":`이미지는 내 기기에서 만들어지며, 아무것도 업로드되지 않습니다.`,"share.copied":`이미지를 복사했습니다.`,"share.copyUnsupported":`이 브라우저는 이미지 복사를 지원하지 않습니다. 다운로드를 이용하세요.`,"share.pasteHint":`이미지를 복사했습니다. 게시물에 붙여 넣으세요 (⌘V / Ctrl+V).`,"share.attachHint":`이미지를 다운로드했습니다. 게시물에 첨부하세요.`,"share.tweetNote":`{author}은(는) 확신에 찼지만, {checkers}은(는) 동의하지 않았습니다. 📝
15
+ 1つのAIの言葉だけを信じない。`,"share.tweetOk":`{checkers}が{author}の回答をチェックし、問題は見つかりませんでした。✓`,"share.tweetPlain":`Dissentry で{author}に質問。ほかの AI モデルが回答をファクトチェックします。`,"card.agree":`同意`,"card.noDissent":`{handles} から異議なし`,"card.tagline":`1つのAIの言葉だけを信じない。`,"card.byline":`無料・オープンソース · 自分のキーで`,"card.stampDissent":`異議あり`,"card.stampChecked":`検証済み`,"or.signIn":`OpenRouter でサインイン`,"or.redirecting":`OpenRouter を開いています…`,"or.pitch":`1 回のログインで Claude、GPT、Gemini、DeepSeek、Qwen、Grok など数百のモデルを利用。料金はあなたの OpenRouter アカウントに請求されます。キーのコピーは不要です。`,"or.cardTitle":`いちばん早い始め方`,"or.title":`OpenRouter に接続`,"or.connecting":`OpenRouter アカウントに接続しています…`,"or.connected":`OpenRouter アカウントに接続しました。`,"or.pickTitle":`モデルを選ぶ`,"or.pickSub":`各ファミリーの最新モデルを選択済みです。どれも互いの回答をチェックできます。`,"or.keyNote":`Dissentry は OpenRouter アカウントのキーを受け取りました。キーはこのブラウザ内だけに保存され、openrouter.ai/keys でいつでも確認・取り消しできます。`,"or.add":`{n} 個のモデルを追加`,"or.more":`ほかのモデルは後で「モデル」ページで選べます`,"or.cancelled":`サインインはキャンセルされました。`,"or.stateError":`このサインインリンクは期限切れか、別のタブのものです。もう一度お試しください。`,"or.failed":`OpenRouter に接続できませんでした({error})。もう一度お試しください。`,"or.useKey":`API キーを使う`,"or.perMillion":`100万トークンあたり`,"or.priceHint":`入力 / 出力の価格(米ドル / 100 万トークン)。OpenRouter があなたのアカウントに請求します。`,"trust.noAnswers":`チェック済みの回答はまだありません。`,"trust.noChecks":`まだ回答をチェックしていません。`,"trust.noRated":`回答 {a} 件を確認し、注記を {n} 件書きました。注記を評価すると正解率がわかります。`,"nav.usage":`使用量`,"usage.title":`使用量`,"usage.sub":`トークン数と推定コスト(この端末に記録)`,"usage.tokens":`トークン`,"usage.range.today":`今日`,"usage.range.7d":`7日`,"usage.range.30d":`30日`,"usage.range.all":`すべて`,"usage.answering":`回答`,"usage.checking":`チェック`,"usage.checkInsight":`チェックがトークンの {pct}% を使いました。ヒント:回答には安いモデル、チェックには強いモデルを。`,"usage.byModel":`モデル別`,"usage.split":`回答 {a} · チェック {c}`,"usage.empty":`この期間の使用量はまだありません。`,"usage.noPrice":`「モデル」ページでこのモデルの価格を入れるとコストを推定できます。`,"usage.addPrice":`価格未設定`,"usage.footnote":`各プロバイダーが返すトークン数とモデルに設定した価格からの推定です。請求額はプロバイダーの請求書が正です。使用量はこのバージョンから記録されます。`,"usage.postLine":`{a} トークン · チェック {c}`,"usage.postTip":`回答:入力 {i} / 出力 {o} トークン · チェック:{c} トークン`,"editor.inPrice":`入力価格(米ドル / 100万トークン)`,"editor.outPrice":`出力価格(米ドル / 100万トークン)`,"editor.priceHelp":`任意:「使用量」ページでのコスト推定に使います。OpenRouter のモデルは自動入力されます。`,"land.navHow":`使い方`,"land.navFeatures":`機能`,"land.navFaq":`よくある質問`,"land.openApp":`アプリを開く`,"land.eyebrow":`無料・オープンソース · 自分のモデルで`,"land.h1":`1つのAIの言葉だけを信じない。`,"land.sub":`どの AI モデルにでも質問できます。ほかのモデルが回答をファクトチェックし、誤りを見つけたときだけ注記を付けます。誰が正しく、どのモデルを信頼できるかがわかります。`,"land.ctaKeys":`自分の API キーを使う`,"land.trustLine":`アカウント不要。キーと会話はブラウザ内だけに保存されます。`,"land.shotAlt":`3 つのモデルから異議の注記が付いた AI の回答を表示する Dissentry`,"land.cardAlt":`回答と異議の注記を共有用の画像にしたもの`,"land.worksWith":`対応`,"land.howTitle":`信頼できる答えまで 3 ステップ`,"land.s1t":`どのモデルにも質問`,"land.s1b":`X で返信するように、Claude、GPT、Gemini、DeepSeek、Qwen、Grok やローカルモデルを@で呼びます。`,"land.s2t":`他のモデルがチェック`,"land.s2b":`チェッカーのモデルが回答を確認し、事実の誤り・古い情報・危険な内容があるときだけ注記を付けます。`,"land.s3t":`判断するのはあなた`,"land.s3b":`注記を「正しい」「役に立たない」で評価。続けるうちに、どのモデルがよく訂正され、誰の注記が正しいかがわかります。`,"land.featTitle":`1 つのモデルを鵜呑みにしない人のために`,"land.f1t":`大事なときだけ注記`,"land.f1b":`言い回しの指摘はしません。注記は本当の問題のしるしで、回答の誤った文に下線が引かれます。`,"land.f2t":`合意がひと目でわかる`,"land.f2b":`複数のモデルが同じ主張を指摘すると、注記がまとまります:「@claude · @qwen · @gemini も同意」。`,"land.f3t":`あなただけの信頼度`,"land.f3b":`他人のベンチマークではなく、あなたの質問でどのモデルが正しいかがわかります。`,"land.f4t":`画像で共有`,"land.f4b":`回答と注記をワンクリックで美しいカードにして、X やチームに共有できます。`,"land.f5t":`プライバシー重視`,"land.f5b":`キーと会話はブラウザ内だけ。リクエストは選んだプロバイダーへ直接送られます。`,"land.f6t":`トークンを節約`,"land.f6b":`安いモデルやローカルモデルに答えさせ、強いモデルにチェックさせる。「使用量」ページで支出がわかります。`,"land.faqTitle":`よくある質問`,"land.q1":`Dissentry は無料ですか?`,"land.a1":`はい。無料のオープンソース(MIT)です。使ったトークン分を AI プロバイダーに直接支払うだけです。`,"land.q2":`API キーはどこに保存されますか?`,"land.a2":`ブラウザ内だけです。リクエストはブラウザから各プロバイダーへ直接送られ、当社のサーバーを経由しません。`,"land.q3":`ChatGPT Plus や Claude Pro のサブスクを使えますか?`,"land.a3":`直接は使えません。プロバイダーは個人向けサブスクをサードパーティのアプリで使うことを認めておらず、アカウントが停止される恐れがあります。代わりに OpenRouter でサインインすれば、1 回のログインで主要モデルをすべて使え、料金はあなたのアカウントに請求されます。`,"land.q4":`どのモデルに対応していますか?`,"land.a4":`OpenAI、Anthropic、Google Gemini、DeepSeek、Qwen、xAI、Mistral、Groq、OpenRouter(数百のモデル)、OpenAI 互換の任意のエンドポイント、Ollama や LM Studio のローカルモデルです。`,"land.q5":`自分のパソコンで動かせますか?`,"land.a5":`はい。「npx dissentry」を実行してください。ローカル版はローカルモデルにも対応し、プロキシ経由の送信もできます。`,"land.ctaTitle":`すべての回答にセカンドオピニオンを。`,"land.ctaSub":`1 分以内に始められます。アカウントもインストールも不要です。`},fn={"common.back":`뒤로`,"common.cancel":`취소`,"common.checker":`검증자`,"common.close":`닫기`,"common.edit":`편집`,"common.notFound":`페이지를 찾을 수 없습니다.`,"common.remove":`삭제`,"common.save":`저장`,"nav.home":`홈`,"nav.models":`모델`,"nav.trust":`신뢰도`,"nav.settings":`설정`,"nav.newThread":`새 스레드`,"layout.language":`언어`,"layout.localFirst":`로컬 우선: 게시물과 키는 이 브라우저에만 저장됩니다.`,"layout.openSource":`오픈소스 (MIT)`,"layout.recent":`최근 스레드`,"panel.yourModels":`내 모델`,"panel.manage":`관리`,"panel.noModels":`아직 모델이 없습니다. 내 API 키나 로컬 모델로 추가하세요.`,"panel.addModel":`모델 추가`,"panel.howTitle":`사용 방법`,"panel.how1":`@로 모델을 멘션해 무엇이든 물어보세요.`,"panel.how2":`검증자 모델이 모든 답변을 검토하고, 문제가 있을 때만 메모를 답니다.`,"panel.how3":`메모를 "맞음" 또는 "도움 안 됨"으로 평가하면 어떤 모델을 믿을 수 있는지 알 수 있습니다.`,"home.title":`홈`,"home.sub":`모델 하나가 답하고, 나머지가 이의를 제기합니다.`,"home.more":`더 보기`,"welcome.title":`모델 하나의 말만 믿지 마세요.`,"welcome.body":`어떤 AI 모델에게든 질문하세요. 다른 모델들이 답을 검토하고, 오류를 찾았을 때만 메모를 답니다.`,"welcome.step1":`내 API 키로 모델을 두 개 이상 추가하거나 로컬 모델을 연결하세요.`,"welcome.step2":`답변을 검토할 모델을 검증자로 지정하세요.`,"welcome.step3":`모델을 @로 멘션하고 메모가 달리는 것을 보세요.`,"welcome.cta":`또는 API 키로 모델 추가`,"welcome.privacy":`키와 게시물은 브라우저에만 저장되며, 저희에게 전송되지 않습니다.`,"tips.title":`첫 질문을 해 보세요`,"tips.body":`@로 모델을 멘션하거나 위의 칩을 누르세요. 검증자가 답을 검토하고 문제가 있을 때만 메모를 답니다.`,"tips.saving":`팁: 저렴하거나 로컬 모델이 답하게 하고, 강한 모델이 검증하게 하세요. 긴 답변 비용은 필요할 때만 냅니다.`,"composer.placeholder":`무엇이든 물어보세요… @로 모델 멘션 (예: @{handle})`,"composer.everyModel":`활성화된 모든 모델`,"composer.noModels":`먼저 모델을 추가하세요. 클라우드 모델은 내 API 키를 쓰고, 로컬 모델(Ollama, LM Studio)은 키가 필요 없습니다.`,"composer.addFirst":`API 키로 모델 추가`,"composer.asking":`질문 대상`,"composer.checkedBy":`검증`,"composer.mentionHint":`@로 모델을 멘션하거나 칩을 누르세요`,"composer.post":`게시`,"composer.reply":`답글`,"composer.quote":`인용`,"post.youName":`나`,"post.you":`나`,"post.deletedModel":`삭제된 모델`,"post.respondingTo":`@{handle}의 메모에 대한 응답`,"post.retry":`다시 시도`,"post.stopped":`중지됨.`,"post.checking":`{handles} 검증 중`,"post.noDissent":`{handles} 이의 없음`,"post.couldNotCheck":`@{handle} 검증 실패`,"post.reply":`답글`,"post.quote":`인용`,"post.stop":`중지`,"post.checkAgain":`다시 검증`,"post.regenerate":`다시 생성`,"post.copy":`복사`,"post.copied":`복사됨`,"post.delete":`삭제`,"post.deleteConfirm":`이 게시물과 모든 답글을 삭제할까요?`,"note.title":`이의`,"note.from":`@{handle} 작성`,"note.agree":`{handles} 동의`,"note.accepted":`이 메모를 채택했습니다`,"note.dismissed":`무시됨`,"note.right":`메모가 맞음`,"note.notHelpful":`도움 안 됨`,"note.undo":`실행 취소`,"note.askRespond":`@{handle}에게 응답 요청`,"note.seeResponse":`@{handle}의 응답 보기 →`,"sev.minor":`경미`,"sev.major":`중요`,"sev.critical":`심각`,"quote.hint":`코멘트를 달아 인용하고, 응답할 모델을 @로 지정하세요`,"quote.placeholder":`코멘트 추가 (예: "@{handle} 이거 맞아?")`,"quote.placeholderPlain":`코멘트 추가…`,"thread.title":`스레드`,"thread.deleted":`삭제된 게시물입니다.`,"thread.quoted":`{n}회 인용됨`,"thread.replyTo":`@{handle}에게 답글 (또는 다른 모델을 @)`,"thread.replyMention":`답글을 달고 모델을 @로 지정`,"thread.postReply":`답글 쓰기…`,"models.title":`모델`,"models.sub":`내 키로, 클라우드든 로컬이든`,"models.hostedTitle":`키는 이 브라우저에만 저장됩니다.`,"models.hostedBody":`요청은 브라우저에서 각 제공자에게 바로 전송되며, 저희 서버를 거치지 않습니다.`,"models.hostedOllama":`로컬 모델을 쓰려면 Ollama를 이렇게 실행하세요:`,"models.hostedNpx":`— 또는 내 컴퓨터에서 Dissentry 실행:`,"models.checkerHint":`다른 모델의 답변을 검토할 모델은 "검증자"를 켜세요.`,"models.add":`+ 모델 추가`,"models.empty":`아직 모델이 없습니다. 무료 로컬 모델 Ollama를 써 보거나, API 키로 클라우드 제공자를 추가하세요. 키는 이 브라우저에만 저장되고, 선택한 제공자에게만 전송됩니다.`,"models.noModel":`선택된 모델 없음`,"models.on":`사용`,"editor.provider":`제공자`,"editor.name":`표시 이름`,"editor.handle":`핸들 (@멘션용)`,"editor.handleTaken":`@{handle}은(는) 이미 사용 중입니다`,"editor.baseUrl":`Base URL`,"editor.key":`API 키`,"editor.keyOptional":`API 키 (선택)`,"editor.keyPlaceholder":`이 브라우저에만 저장됩니다`,"editor.keyLocal":`로컬 서버에는 필요 없음`,"editor.getKey":`키 발급받기 →`,"editor.model":`모델`,"editor.fetch":`모델 목록 가져오기`,"editor.fetching":`모델을 가져오는 중…`,"editor.modelsFound":`사용 가능한 모델 {n}개`,"editor.instructions":`추가 지시 (선택)`,"editor.instructionsPlaceholder":`예: 시니어 엔지니어처럼 답하고 출처를 밝혀 줘.`,"editor.checker":`검증자: 다른 모델의 답변을 검토`,"editor.color":`색상`,"editor.route":`로컬 서버를 통해 전송`,"editor.routeHint":`로컬 Dissentry 서버를 통해 요청을 보냅니다. 브라우저 CORS 차단을 피하고 설정의 네트워크 프록시를 사용합니다. 키는 전달만 되고 저장되지 않습니다.`,"editor.test":`연결 테스트`,"editor.testing":`테스트 중…`,"editor.connected":`{ms}ms 만에 연결됨. 응답: "{reply}"`,"editor.removeConfirm":`@{handle}을(를) 삭제할까요? 게시물은 타임라인에 남습니다.`,"trust.title":`신뢰도`,"trust.sub":`내 질문에서 누가 자주 정정되고, 누구의 메모가 맞는지`,"trust.summary":`개의 답변이 틀린 것으로 확인되었습니다 (검증된 {n}개 중). 두 번째 의견이 없었다면 믿었을지도 모릅니다.`,"trust.empty":`모델을 추가하고 몇 가지 질문을 하면 신뢰도 표가 만들어집니다.`,"trust.asAnswerer":`답변자로서`,"trust.asChecker":`검증자로서`,"trust.heldUp":`검증 통과`,"trust.notesRight":`평가한 메모가 맞음`,"trust.answers":`답변 {a}개 · 검증 {c}개`,"trust.corrected":`채택된 메모로 {n}개 정정`,"trust.awaiting":`평가를 기다리는 메모 {n}개`,"trust.reviewed":`답변 {a}개 검토 · 메모 {n}개`,"trust.acceptedDismissed":`채택 {a} · 무시 {d}`,"trust.footnote":`수치는 메모에 대한 내 평가로만 계산되므로, 내 질문에서 각 모델이 어떤지를 보여 줍니다.`,"settings.title":`설정`,"settings.profile":`프로필`,"settings.name":`표시 이름`,"settings.autoCheck":`모든 답변 자동 검증`,"settings.autoCheckDesc":`답변이 끝날 때마다 검증자가 검토합니다. 끄면 🔍 버튼으로 직접 검증할 수 있습니다(토큰 절약).`,"settings.data":`내 데이터`,"settings.dataDesc":`모든 데이터는 이 브라우저에 있습니다. 내보내서 백업하거나 다른 기기로 옮길 수 있습니다.`,"settings.export":`내보내기 (키 제외)`,"settings.exportKeys":`내보내기 (API 키 포함)`,"settings.import":`가져오기…`,"settings.imported":`가져왔습니다.`,"settings.importFailed":`가져오기 실패: {error}`,"settings.clear":`모든 데이터 삭제`,"settings.clearConfirm":`이 브라우저에서 모든 게시물, 메모, 모델을 삭제할까요? 되돌릴 수 없습니다.`,"settings.cleared":`모든 데이터를 삭제했습니다.`,"connection.title":`연결`,"connection.hostedDesc":`요청은 기기의 네트워크를 통해 브라우저에서 각 AI 제공자에게 바로 전송됩니다. 내 지역에서 제공자가 차단되어 있다면 VPN이나 시스템 프록시를 켜세요. Dissentry가 자동으로 사용합니다.`,"proxy.title":`네트워크 프록시`,"proxy.localDesc":`제공자 요청은 로컬 Dissentry 서버를 거칩니다(CORS 문제 없음, 키는 전달만 되고 저장되지 않음). 외부로 나가는 방식을 고르세요.`,"proxy.system":`시스템`,"proxy.systemFound":`환경 변수의 프록시 사용:`,"proxy.systemNone":`Dissentry를 시작할 때 HTTPS_PROXY / HTTP_PROXY가 설정되어 있으면 사용합니다. 감지되지 않아 직접 연결합니다.`,"proxy.direct":`프록시 사용 안 함`,"proxy.directDesc":`모든 제공자에 직접 연결합니다.`,"proxy.custom":`사용자 지정 프록시`,"proxy.customDesc":`Clash, V2Ray, Shadowsocks 클라이언트나 회사 프록시 등.`,"proxy.address":`프록시 주소`,"proxy.addressHelp":`HTTP, HTTPS, SOCKS5를 지원합니다. 로그인이 필요하면 http://사용자:비밀번호@호스트:포트 형식으로 입력하세요.`,"proxy.bypass":`프록시를 쓰지 않을 주소 (선택)`,"proxy.bypassHelp":`쉼표로 구분한 호스트 이름. 앞에 점을 붙이면 하위 도메인까지 일치합니다. 로컬 주소(Ollama, LM Studio)는 항상 직접 연결됩니다.`,"proxy.enterAddress":`프록시 주소를 입력하세요.`,"proxy.badScheme":`http://, https:// 또는 socks5://를 사용하세요`,"proxy.badUrl":`예: http://127.0.0.1:7890 또는 socks5://127.0.0.1:1080`,"proxy.test":`연결 테스트`,"proxy.testing":`테스트 중…`,"proxy.reachable":`{ms}ms 만에 연결됨 (HTTP {status}, 키 없이 401은 정상입니다).`,"err.auth":`@{handle} 인증 실패: API 키를 확인하세요. ({msg})`,"err.model":`@{handle}에서 모델 "{model}"을(를) 찾을 수 없습니다. ({msg})`,"err.quota":`@{handle}이(가) 요청 한도에 도달했거나 잔액이 부족합니다. ({msg})`,"err.unreachable":`{url}에 연결할 수 없습니다. 네트워크나 프록시를 확인하세요.`,"err.localHosted":`{url}에 연결할 수 없습니다. 실행 중인가요? Ollama가 이 사이트를 허용해야 합니다: OLLAMA_ORIGINS={origin} ollama serve 로 실행하세요(브라우저가 로컬 네트워크 접근 허용을 물을 수도 있습니다).`,"err.blockedHosted":`브라우저에서 {url}에 연결할 수 없습니다. 이 제공자가 네트워크에서 차단되어 있다면 VPN이나 시스템 프록시를 켜고 다시 시도하세요.`,"err.empty":`모델이 빈 답변을 반환했습니다.`,"post.share":`이미지로 공유`,"share.title":`이미지로 공유`,"share.rendering":`생성 중…`,"share.includeQuestion":`질문 포함`,"share.failed":`이미지를 만들 수 없습니다: {error}`,"share.postX":`X에 게시`,"share.copy":`이미지 복사`,"share.download":`다운로드`,"share.native":`공유…`,"share.privacy":`이미지는 내 기기에서 만들어지며, 아무것도 업로드되지 않습니다.`,"share.copied":`이미지를 복사했습니다.`,"share.copyUnsupported":`이 브라우저는 이미지 복사를 지원하지 않습니다. 다운로드를 이용하세요.`,"share.pasteHint":`이미지를 복사했습니다. 게시물에 붙여 넣으세요 (⌘V / Ctrl+V).`,"share.attachHint":`이미지를 다운로드했습니다. 게시물에 첨부하세요.`,"share.tweetNote":`{author}은(는) 확신에 찼지만, {checkers}은(는) 동의하지 않았습니다. 📝
16
16
 
17
- AI 하나의 말만 믿지 마세요.`,"share.tweetOk":`{checkers}이(가) {author}의 답을 검증했고, 문제를 찾지 못했습니다. ✓`,"share.tweetPlain":`Dissentry에서 {author}에게 질문했습니다. 다른 AI 모델들이 답을 팩트체크합니다.`,"card.agree":`동의`,"card.noDissent":`{handles} 이의 없음`,"card.tagline":`AI 하나의 말만 믿지 마세요.`,"card.byline":`무료 오픈소스 · 내 키로 사용`,"card.stampDissent":`이의 있음`,"card.stampChecked":`검증 완료`,"or.signIn":`OpenRouter로 로그인`,"or.redirecting":`OpenRouter를 여는 중…`,"or.pitch":`한 번 로그인으로 Claude, GPT, Gemini, DeepSeek, Qwen, Grok 등 수백 개 모델을 사용하세요. 요금은 내 OpenRouter 계정으로 청구됩니다. 키를 복사할 필요가 없습니다.`,"or.cardTitle":`가장 빠른 시작 방법`,"or.title":`OpenRouter 연결`,"or.connecting":`OpenRouter 계정에 연결하는 중…`,"or.connected":`OpenRouter 계정이 연결되었습니다.`,"or.pickTitle":`모델 선택`,"or.pickSub":`각 계열의 최신 모델이 미리 선택되어 있습니다. 모두 서로의 답을 검증할 수 있습니다.`,"or.keyNote":`Dissentry가 내 OpenRouter 계정의 키를 받았습니다. 키는 이 브라우저에만 저장되며, openrouter.ai/keys에서 언제든 확인하거나 취소할 수 있습니다.`,"or.add":`모델 {n}개 추가`,"or.more":`다른 모델은 나중에 "모델" 페이지에서 고를 수 있습니다`,"or.cancelled":`로그인이 취소되었습니다.`,"or.stateError":`이 로그인 링크는 만료되었거나 다른 탭에서 온 것입니다. 다시 시도하세요.`,"or.failed":`OpenRouter에 연결할 수 없습니다 ({error}). 다시 시도하세요.`,"or.useKey":`API 키 사용`,"or.perMillion":`100만 토큰당`,"or.priceHint":`입력 / 출력 가격(미국 달러, 100만 토큰당). OpenRouter가 내 계정으로 청구합니다.`,"trust.noAnswers":`아직 검증된 답변이 없습니다.`,"trust.noChecks":`아직 답변을 검증하지 않았습니다.`,"trust.noRated":`답변 {a}개를 검토하고 메모 {n}개를 썼습니다. 메모를 평가하면 얼마나 자주 맞는지 알 수 있습니다.`,"nav.usage":`사용량`,"usage.title":`사용량`,"usage.sub":`토큰 수와 예상 비용 (이 기기에 기록)`,"usage.tokens":`토큰`,"usage.range.today":`오늘`,"usage.range.7d":`7일`,"usage.range.30d":`30일`,"usage.range.all":`전체`,"usage.answering":`답변`,"usage.checking":`검증`,"usage.checkInsight":`검증이 토큰의 {pct}%를 썼습니다. 팁: 답변은 저렴한 모델, 검증은 강한 모델에게 맡기세요.`,"usage.byModel":`모델별`,"usage.split":`답변 {a} · 검증 {c}`,"usage.empty":`이 기간에 기록된 사용량이 없습니다.`,"usage.noPrice":`"모델" 페이지에서 이 모델의 가격을 입력하면 비용을 추정할 수 있습니다.`,"usage.addPrice":`가격 미설정`,"usage.footnote":`각 제공자가 반환한 토큰 수와 모델에 설정한 가격으로 추정한 값입니다. 최종 금액은 제공자 청구서를 따릅니다. 사용량은 이 버전부터 기록됩니다.`,"usage.postLine":`{a} 토큰 · 검증 {c}`,"usage.postTip":`답변: 입력 {i} / 출력 {o} 토큰 · 검증: {c} 토큰`,"editor.inPrice":`입력 가격 (USD / 100만 토큰)`,"editor.outPrice":`출력 가격 (USD / 100만 토큰)`,"editor.priceHelp":`선택: "사용량" 페이지의 비용 추정에 쓰입니다. OpenRouter 모델은 자동으로 채워집니다.`,"land.navHow":`사용 방법`,"land.navFeatures":`기능`,"land.navFaq":`자주 묻는 질문`,"land.openApp":`앱 열기`,"land.eyebrow":`무료 오픈소스 · 내 모델로`,"land.h1":`AI 하나의 말만 믿지 마세요.`,"land.sub":`어떤 AI 모델에게든 질문하세요. 다른 모델들이 답을 팩트체크하고, 오류를 찾았을 때만 메모를 답니다. 누가 맞았는지, 어떤 모델을 믿을 수 있는지 알 수 있습니다.`,"land.ctaKeys":`내 API 키 사용하기`,"land.trustLine":`계정이 필요 없습니다. 키와 대화는 브라우저에만 저장됩니다.`,"land.shotAlt":`세 모델의 이의 메모가 달린 AI 답변을 보여 주는 Dissentry`,"land.cardAlt":`답변과 이의 메모를 공유용 이미지로 만든 것`,"land.worksWith":`지원`,"land.howTitle":`믿을 수 있는 답까지 3단계`,"land.s1t":`어떤 모델에게든 질문`,"land.s1b":`X에서 답글을 달듯 Claude, GPT, Gemini, DeepSeek, Qwen, Grok이나 로컬 모델을 @로 멘션하세요.`,"land.s2t":`다른 모델이 검증`,"land.s2b":`검증자 모델이 답을 검토하고, 사실 오류나 오래된 정보, 위험한 내용이 있을 때만 메모를 답니다.`,"land.s3t":`판단은 내가`,"land.s3b":`메모를 "맞음" 또는 "도움 안 됨"으로 평가하세요. 시간이 지나면 어떤 모델이 자주 정정되고 누구의 메모가 맞는지 보입니다.`,"land.featTitle":`모델 하나를 그대로 믿지 않는 사람들을 위해`,"land.f1t":`중요할 때만 메모`,"land.f1b":`표현 트집은 잡지 않습니다. 메모가 달렸다면 진짜 문제이며, 답변 속 틀린 문장에 밑줄이 그어집니다.`,"land.f2t":`합의가 한눈에`,"land.f2b":`여러 모델이 같은 주장을 지적하면 메모가 합쳐집니다: "@claude · @qwen · @gemini 동의".`,"land.f3t":`나만의 신뢰도`,"land.f3b":`남의 벤치마크가 아니라, 내 질문에서 어떤 모델이 맞는지 볼 수 있습니다.`,"land.f4t":`이미지로 공유`,"land.f4b":`답변과 메모를 한 번의 클릭으로 멋진 카드로 만들어 X나 팀에 공유하세요.`,"land.f5t":`프라이버시 우선`,"land.f5b":`키와 대화는 브라우저에만 있습니다. 요청은 내가 고른 제공자에게 바로 전송됩니다.`,"land.f6t":`토큰 절약`,"land.f6b":`저렴하거나 로컬 모델이 답하고 강한 모델이 검증하게 하세요. "사용량" 페이지에서 지출을 정확히 볼 수 있습니다.`,"land.faqTitle":`자주 묻는 질문`,"land.q1":`Dissentry는 무료인가요?`,"land.a1":`네. 무료 오픈소스(MIT)입니다. 사용한 토큰만큼 AI 제공자에게 직접 비용을 냅니다.`,"land.q2":`API 키는 어디에 저장되나요?`,"land.a2":`브라우저에만 저장됩니다. 요청은 브라우저에서 각 제공자에게 바로 전송되며 저희 서버를 거치지 않습니다.`,"land.q3":`ChatGPT Plus나 Claude Pro 구독을 쓸 수 있나요?`,"land.a3":`직접은 안 됩니다. 제공자들은 개인 구독을 타사 앱에서 쓰는 것을 허용하지 않으며, 시도한 계정은 정지될 수 있습니다. 대신 OpenRouter로 로그인하세요. 한 번 로그인으로 모든 주요 모델을 쓰고, 요금은 내 계정으로 청구됩니다.`,"land.q4":`어떤 모델을 지원하나요?`,"land.a4":`OpenAI, Anthropic, Google Gemini, DeepSeek, Qwen, xAI, Mistral, Groq, OpenRouter(수백 개 모델), 모든 OpenAI 호환 엔드포인트, 그리고 Ollama나 LM Studio의 로컬 모델입니다.`,"land.q5":`내 컴퓨터에서 실행할 수 있나요?`,"land.a5":`네. "npx dissentry"를 실행하세요. 로컬 버전은 로컬 모델도 지원하고 프록시를 통한 전송도 가능합니다.`,"land.ctaTitle":`모든 답변에 두 번째 의견을.`,"land.ctaSub":`1분 안에 시작하세요. 계정도 설치도 필요 없습니다.`},pn={"common.back":`返回`,"common.cancel":`取消`,"common.checker":`核查员`,"common.close":`关闭`,"common.edit":`编辑`,"common.notFound":`页面不存在。`,"common.remove":`删除`,"common.save":`保存`,"nav.home":`首页`,"nav.models":`模型`,"nav.trust":`可信度`,"nav.settings":`设置`,"nav.newThread":`新话题`,"layout.language":`语言`,"layout.localFirst":`本地优先:你的帖子和密钥只保存在这个浏览器里。`,"layout.openSource":`开源(MIT)`,"layout.recent":`最近的话题`,"panel.yourModels":`你的模型`,"panel.manage":`管理`,"panel.noModels":`还没有模型。用你自己的API密钥添加一个,或接入本地模型。`,"panel.addModel":`添加模型`,"panel.howTitle":`怎么用`,"panel.how1":`用@提到一个模型,问它任何问题。`,"panel.how2":`核查员模型会审阅每个回答,只在发现问题时加上纠错注释。`,"panel.how3":`把注释标为“正确”或“没帮助”,就能看出哪些模型更可信。`,"home.title":`首页`,"home.sub":`一个模型回答,其他模型挑错。`,"home.more":`显示更多`,"welcome.title":`别只信一个模型的话。`,"welcome.body":`向任何AI模型提问,你的其他模型会检查回答,只在发现错误时加上纠错注释。`,"welcome.step1":`用你自己的API密钥添加两个以上的模型,或接入本地模型。`,"welcome.step2":`把负责审阅回答的模型设为核查员。`,"welcome.step3":`@一个模型提问,看纠错注释出现。`,"welcome.cta":`或用API密钥添加模型`,"welcome.privacy":`密钥和帖子只保存在你的浏览器里,不会发给我们。`,"tips.title":`提出你的第一个问题`,"tips.body":`用@提到一个模型,或点上面的模型标签。核查员会审阅回答,只在发现问题时加注释。`,"tips.saving":`小技巧:让便宜的或本地的模型回答,让强模型核查。只有真需要时才为长回答付费。`,"composer.placeholder":`问点什么……用@提到模型,例如@{handle}`,"composer.everyModel":`所有已启用的模型`,"composer.noModels":`先添加一个模型。云端模型使用你自己的API密钥;本地模型(Ollama、LM Studio)不需要密钥。`,"composer.addFirst":`添加第一个模型`,"composer.asking":`提问`,"composer.checkedBy":`核查`,"composer.mentionHint":`用@提到模型,或点模型标签`,"composer.post":`发布`,"composer.reply":`回复`,"composer.quote":`引用`,"post.youName":`我`,"post.you":`你`,"post.deletedModel":`已删除的模型`,"post.respondingTo":`回应@{handle}的纠错注释`,"post.retry":`重试`,"post.stopped":`已停止。`,"post.checking":`{handles}正在核查`,"post.noDissent":`{handles}没有异议`,"post.couldNotCheck":`@{handle}无法核查`,"post.reply":`回复`,"post.quote":`引用`,"post.stop":`停止`,"post.checkAgain":`重新核查`,"post.regenerate":`重新生成`,"post.copy":`复制`,"post.copied":`已复制`,"post.delete":`删除`,"post.deleteConfirm":`删除这条帖子及其所有回复?`,"note.title":`异议`,"note.from":`来自@{handle}`,"note.agree":`{handles}同意`,"note.accepted":`你已采纳这条注释`,"note.dismissed":`已忽略`,"note.right":`注释正确`,"note.notHelpful":`没帮助`,"note.undo":`撤销`,"note.askRespond":`让@{handle}回应`,"note.seeResponse":`查看@{handle}的回应 →`,"sev.minor":`轻微`,"sev.major":`重要`,"sev.critical":`严重`,"quote.hint":`加一句评论引用它,再@应该回应的模型`,"quote.placeholder":`加一句评论,例如“@{handle} 这样对吗?”`,"quote.placeholderPlain":`加一句评论……`,"thread.title":`话题`,"thread.deleted":`这条帖子已被删除。`,"thread.quoted":`被引用{n}次`,"thread.replyTo":`回复@{handle}(或@其他模型)`,"thread.replyMention":`回复并@一个模型`,"thread.postReply":`发表回复……`,"models.title":`模型`,"models.sub":`使用你自己的密钥,云端或本地`,"models.hostedTitle":`你的密钥只保存在这个浏览器里。`,"models.hostedBody":`请求从你的浏览器直接发到各个服务商,不经过我们的服务器。`,"models.hostedOllama":`要用本地模型,请这样启动Ollama:`,"models.hostedNpx":`——或在自己电脑上运行Dissentry:`,"models.checkerHint":`为需要审阅其他模型回答的模型打开“核查员”。`,"models.add":`+ 添加模型`,"models.empty":`还没有模型。可以试试免费的本地模型Ollama,或用你的API密钥添加云端服务商。密钥只保存在这个浏览器里,只发给你选择的服务商。`,"models.noModel":`未选择模型`,"models.on":`启用`,"editor.provider":`服务商`,"editor.name":`显示名称`,"editor.handle":`账号名(用于@)`,"editor.handleTaken":`@{handle}已被使用`,"editor.baseUrl":`Base URL`,"editor.key":`API密钥`,"editor.keyOptional":`API密钥(可选)`,"editor.keyPlaceholder":`只保存在这个浏览器里`,"editor.keyLocal":`本地服务不需要`,"editor.getKey":`获取密钥 →`,"editor.model":`模型`,"editor.fetch":`获取模型列表`,"editor.fetching":`正在获取模型……`,"editor.modelsFound":`可用模型{n}个`,"editor.instructions":`额外指令(可选)`,"editor.instructionsPlaceholder":`例如:像资深工程师一样回答,并注明出处。`,"editor.checker":`核查员:审阅其他模型的回答`,"editor.color":`颜色`,"editor.route":`通过本地服务转发`,"editor.routeHint":`请求经由本地Dissentry服务转发:避免浏览器CORS拦截,并使用设置里的网络代理。密钥只转发,不保存。`,"editor.test":`测试连接`,"editor.testing":`正在测试……`,"editor.connected":`连接成功,用时{ms}毫秒。回复:“{reply}”`,"editor.removeConfirm":`删除@{handle}?它发过的帖子会保留在时间线里。`,"trust.title":`可信度`,"trust.sub":`在你的问题上,谁常被纠正,谁的注释靠得住`,"trust.summary":`个回答经你确认有错(共核查{n}个)。没有第二意见,你可能就信了。`,"trust.empty":`添加模型并提几个问题,就能建立你的可信度表。`,"trust.asAnswerer":`作为回答者`,"trust.asChecker":`作为核查员`,"trust.heldUp":`经得起核查`,"trust.notesRight":`已评价的注释是对的`,"trust.answers":`回答{a}个 · 已核查{c}个`,"trust.corrected":`{n}个被你采纳的注释纠正`,"trust.awaiting":`{n}条注释等你评价`,"trust.reviewed":`审阅回答{a}个 · 注释{n}条`,"trust.acceptedDismissed":`采纳{a} · 忽略{d}`,"trust.footnote":`数据只来自你对注释的评价,反映的是每个模型在你的问题上的表现。`,"settings.title":`设置`,"settings.profile":`个人资料`,"settings.name":`你的显示名称`,"settings.autoCheck":`自动核查每个回答`,"settings.autoCheckDesc":`每个回答完成后由核查员审阅。关闭后可用🔍按钮手动核查(更省token)。`,"settings.data":`你的数据`,"settings.dataDesc":`所有数据都保存在这个浏览器里。导出可以备份,或搬到另一台设备。`,"settings.export":`导出(不含密钥)`,"settings.exportKeys":`导出(含API密钥)`,"settings.import":`导入……`,"settings.imported":`已导入。`,"settings.importFailed":`导入失败:{error}`,"settings.clear":`清除所有数据`,"settings.clearConfirm":`从这个浏览器删除所有帖子、注释和模型?此操作无法撤销。`,"settings.cleared":`所有数据已清除。`,"connection.title":`网络连接`,"connection.hostedDesc":`请求从你的浏览器直接发到各个AI服务商,走你设备的网络。如果某个服务商在你所在的地区无法访问,打开你的VPN或系统代理即可,Dissentry会自动使用。`,"proxy.title":`网络代理`,"proxy.localDesc":`服务商请求经由本地Dissentry服务转发(不会被CORS拦截;密钥只转发,不保存)。选择它的出网方式。`,"proxy.system":`系统`,"proxy.systemFound":`使用环境变量中的代理:`,"proxy.systemNone":`如果Dissentry启动时设置了HTTPS_PROXY / HTTP_PROXY就使用它。当前未检测到,因此直接连接。`,"proxy.direct":`不使用代理`,"proxy.directDesc":`直接连接所有服务商。`,"proxy.custom":`自定义代理`,"proxy.customDesc":`例如你的Clash、V2Ray或Shadowsocks客户端,或公司代理。`,"proxy.address":`代理地址`,"proxy.addressHelp":`支持HTTP、HTTPS和SOCKS5。需要登录时写成http://用户名:密码@主机:端口。`,"proxy.bypass":`以下地址不走代理(可选)`,"proxy.bypassHelp":`用逗号分隔的主机名;以点开头可匹配子域名。本地地址(Ollama、LM Studio)始终直连。`,"proxy.enterAddress":`请输入代理地址。`,"proxy.badScheme":`请使用http://、https://或socks5://`,"proxy.badUrl":`格式类似:http://127.0.0.1:7890或socks5://127.0.0.1:1080`,"proxy.test":`测试连接`,"proxy.testing":`正在测试……`,"proxy.reachable":`可以连通,用时{ms}毫秒(HTTP {status};没有密钥时返回401是正常的)。`,"err.auth":`@{handle}认证失败:请检查API密钥。({msg})`,"err.model":`@{handle}找不到模型“{model}”。({msg})`,"err.quota":`@{handle}触发了速率限制或余额不足。({msg})`,"err.unreachable":`无法连接{url}。请检查网络或代理。`,"err.localHosted":`无法连接{url}。它在运行吗?Ollama需要允许本站访问:用OLLAMA_ORIGINS={origin} ollama serve启动(浏览器可能还会询问是否允许访问本地网络)。`,"err.blockedHosted":`你的浏览器无法连接{url}。如果这个服务商在你的网络中被屏蔽,请打开VPN或系统代理后重试。`,"err.empty":`模型返回了空回答。`,"post.share":`分享为图片`,"share.title":`分享为图片`,"share.rendering":`正在生成……`,"share.includeQuestion":`包含问题`,"share.failed":`无法生成图片:{error}`,"share.postX":`发到X`,"share.copy":`复制图片`,"share.download":`下载`,"share.native":`分享……`,"share.privacy":`图片在你的设备上生成,不会上传任何内容。`,"share.copied":`图片已复制。`,"share.copyUnsupported":`这个浏览器不支持复制图片,请改用下载。`,"share.pasteHint":`图片已复制:粘贴到帖子里即可(⌘V / Ctrl+V)。`,"share.attachHint":`图片已下载:把它添加到帖子里。`,"share.tweetNote":`{author}说得很肯定,{checkers}却不同意。📝
17
+ AI 하나의 말만 믿지 마세요.`,"share.tweetOk":`{checkers}이(가) {author}의 답을 검증했고, 문제를 찾지 못했습니다. ✓`,"share.tweetPlain":`Dissentry에서 {author}에게 질문했습니다. 다른 AI 모델들이 답을 팩트체크합니다.`,"card.agree":`동의`,"card.noDissent":`{handles} 이의 없음`,"card.tagline":`AI 하나의 말만 믿지 마세요.`,"card.byline":`무료 오픈소스 · 내 키로 사용`,"card.stampDissent":`이의 있음`,"card.stampChecked":`검증 완료`,"or.signIn":`OpenRouter로 로그인`,"or.redirecting":`OpenRouter를 여는 중…`,"or.pitch":`한 번 로그인으로 Claude, GPT, Gemini, DeepSeek, Qwen, Grok 등 수백 개 모델을 사용하세요. 요금은 내 OpenRouter 계정으로 청구됩니다. 키를 복사할 필요가 없습니다.`,"or.cardTitle":`가장 빠른 시작 방법`,"or.title":`OpenRouter 연결`,"or.connecting":`OpenRouter 계정에 연결하는 중…`,"or.connected":`OpenRouter 계정이 연결되었습니다.`,"or.pickTitle":`모델 선택`,"or.pickSub":`각 계열의 최신 모델이 미리 선택되어 있습니다. 모두 서로의 답을 검증할 수 있습니다.`,"or.keyNote":`Dissentry가 내 OpenRouter 계정의 키를 받았습니다. 키는 이 브라우저에만 저장되며, openrouter.ai/keys에서 언제든 확인하거나 취소할 수 있습니다.`,"or.add":`모델 {n}개 추가`,"or.more":`다른 모델은 나중에 "모델" 페이지에서 고를 수 있습니다`,"or.cancelled":`로그인이 취소되었습니다.`,"or.stateError":`이 로그인 링크는 만료되었거나 다른 탭에서 온 것입니다. 다시 시도하세요.`,"or.failed":`OpenRouter에 연결할 수 없습니다 ({error}). 다시 시도하세요.`,"or.useKey":`API 키 사용`,"or.perMillion":`100만 토큰당`,"or.priceHint":`입력 / 출력 가격(미국 달러, 100만 토큰당). OpenRouter가 내 계정으로 청구합니다.`,"trust.noAnswers":`아직 검증된 답변이 없습니다.`,"trust.noChecks":`아직 답변을 검증하지 않았습니다.`,"trust.noRated":`답변 {a}개를 검토하고 메모 {n}개를 썼습니다. 메모를 평가하면 얼마나 자주 맞는지 알 수 있습니다.`,"nav.usage":`사용량`,"usage.title":`사용량`,"usage.sub":`토큰 수와 예상 비용 (이 기기에 기록)`,"usage.tokens":`토큰`,"usage.range.today":`오늘`,"usage.range.7d":`7일`,"usage.range.30d":`30일`,"usage.range.all":`전체`,"usage.answering":`답변`,"usage.checking":`검증`,"usage.checkInsight":`검증이 토큰의 {pct}%를 썼습니다. 팁: 답변은 저렴한 모델, 검증은 강한 모델에게 맡기세요.`,"usage.byModel":`모델별`,"usage.split":`답변 {a} · 검증 {c}`,"usage.empty":`이 기간에 기록된 사용량이 없습니다.`,"usage.noPrice":`"모델" 페이지에서 이 모델의 가격을 입력하면 비용을 추정할 수 있습니다.`,"usage.addPrice":`가격 미설정`,"usage.footnote":`각 제공자가 반환한 토큰 수와 모델에 설정한 가격으로 추정한 값입니다. 최종 금액은 제공자 청구서를 따릅니다. 사용량은 이 버전부터 기록됩니다.`,"usage.postLine":`{a} 토큰 · 검증 {c}`,"usage.postTip":`답변: 입력 {i} / 출력 {o} 토큰 · 검증: {c} 토큰`,"editor.inPrice":`입력 가격 (USD / 100만 토큰)`,"editor.outPrice":`출력 가격 (USD / 100만 토큰)`,"editor.priceHelp":`선택: "사용량" 페이지의 비용 추정에 쓰입니다. OpenRouter 모델은 자동으로 채워집니다.`,"land.navHow":`사용 방법`,"land.navFeatures":`기능`,"land.navFaq":`자주 묻는 질문`,"land.openApp":`앱 열기`,"land.eyebrow":`무료 오픈소스 · 내 모델로`,"land.h1":`AI 하나의 말만 믿지 마세요.`,"land.sub":`어떤 AI 모델에게든 질문하세요. 다른 모델들이 답을 팩트체크하고, 오류를 찾았을 때만 메모를 답니다. 누가 맞았는지, 어떤 모델을 믿을 수 있는지 알 수 있습니다.`,"land.ctaKeys":`내 API 키 사용하기`,"land.trustLine":`계정이 필요 없습니다. 키와 대화는 브라우저에만 저장됩니다.`,"land.shotAlt":`세 모델의 이의 메모가 달린 AI 답변을 보여 주는 Dissentry`,"land.cardAlt":`답변과 이의 메모를 공유용 이미지로 만든 것`,"land.worksWith":`지원`,"land.howTitle":`믿을 수 있는 답까지 3단계`,"land.s1t":`어떤 모델에게든 질문`,"land.s1b":`X에서 답글을 달듯 Claude, GPT, Gemini, DeepSeek, Qwen, Grok이나 로컬 모델을 @로 멘션하세요.`,"land.s2t":`다른 모델이 검증`,"land.s2b":`검증자 모델이 답을 검토하고, 사실 오류나 오래된 정보, 위험한 내용이 있을 때만 메모를 답니다.`,"land.s3t":`판단은 내가`,"land.s3b":`메모를 "맞음" 또는 "도움 안 됨"으로 평가하세요. 시간이 지나면 어떤 모델이 자주 정정되고 누구의 메모가 맞는지 보입니다.`,"land.featTitle":`모델 하나를 그대로 믿지 않는 사람들을 위해`,"land.f1t":`중요할 때만 메모`,"land.f1b":`표현 트집은 잡지 않습니다. 메모가 달렸다면 진짜 문제이며, 답변 속 틀린 문장에 밑줄이 그어집니다.`,"land.f2t":`합의가 한눈에`,"land.f2b":`여러 모델이 같은 주장을 지적하면 메모가 합쳐집니다: "@claude · @qwen · @gemini 동의".`,"land.f3t":`나만의 신뢰도`,"land.f3b":`남의 벤치마크가 아니라, 내 질문에서 어떤 모델이 맞는지 볼 수 있습니다.`,"land.f4t":`이미지로 공유`,"land.f4b":`답변과 메모를 한 번의 클릭으로 멋진 카드로 만들어 X나 팀에 공유하세요.`,"land.f5t":`프라이버시 우선`,"land.f5b":`키와 대화는 브라우저에만 있습니다. 요청은 내가 고른 제공자에게 바로 전송됩니다.`,"land.f6t":`토큰 절약`,"land.f6b":`저렴하거나 로컬 모델이 답하고 강한 모델이 검증하게 하세요. "사용량" 페이지에서 지출을 정확히 볼 수 있습니다.`,"land.faqTitle":`자주 묻는 질문`,"land.q1":`Dissentry는 무료인가요?`,"land.a1":`네. 무료 오픈소스(MIT)입니다. 사용한 토큰만큼 AI 제공자에게 직접 비용을 냅니다.`,"land.q2":`API 키는 어디에 저장되나요?`,"land.a2":`브라우저에만 저장됩니다. 요청은 브라우저에서 각 제공자에게 바로 전송되며 저희 서버를 거치지 않습니다.`,"land.q3":`ChatGPT Plus나 Claude Pro 구독을 쓸 수 있나요?`,"land.a3":`직접은 안 됩니다. 제공자들은 개인 구독을 타사 앱에서 쓰는 것을 허용하지 않으며, 시도한 계정은 정지될 수 있습니다. 대신 OpenRouter로 로그인하세요. 한 번 로그인으로 모든 주요 모델을 쓰고, 요금은 내 계정으로 청구됩니다.`,"land.q4":`어떤 모델을 지원하나요?`,"land.a4":`OpenAI, Anthropic, Google Gemini, DeepSeek, Qwen, xAI, Mistral, Groq, OpenRouter(수백 개 모델), 모든 OpenAI 호환 엔드포인트, 그리고 Ollama나 LM Studio의 로컬 모델입니다.`,"land.q5":`내 컴퓨터에서 실행할 수 있나요?`,"land.a5":`네. "npx dissentry"를 실행하세요. 로컬 버전은 로컬 모델도 지원하고 프록시를 통한 전송도 가능합니다.`,"land.ctaTitle":`모든 답변에 두 번째 의견을.`,"land.ctaSub":`1분 안에 시작하세요. 계정도 설치도 필요 없습니다.`},pn={"common.back":`返回`,"common.cancel":`取消`,"common.checker":`核查员`,"common.close":`关闭`,"common.edit":`编辑`,"common.notFound":`页面不存在。`,"common.remove":`删除`,"common.save":`保存`,"nav.home":`首页`,"nav.models":`模型`,"nav.trust":`可信度`,"nav.settings":`设置`,"nav.newThread":`新话题`,"layout.language":`语言`,"layout.localFirst":`本地优先:你的帖子和密钥只保存在这个浏览器里。`,"layout.openSource":`开源(MIT)`,"layout.recent":`最近的话题`,"panel.yourModels":`你的模型`,"panel.manage":`管理`,"panel.noModels":`还没有模型。用你自己的API密钥添加一个,或接入本地模型。`,"panel.addModel":`添加模型`,"panel.howTitle":`怎么用`,"panel.how1":`用@提到一个模型,问它任何问题。`,"panel.how2":`核查员模型会审阅每个回答,只在发现问题时加上纠错注释。`,"panel.how3":`把注释标为“正确”或“没帮助”,就能看出哪些模型更可信。`,"home.title":`首页`,"home.sub":`一个模型回答,其他模型挑错。`,"home.more":`显示更多`,"welcome.title":`别只信一个模型的话。`,"welcome.body":`向任何AI模型提问,你的其他模型会检查回答,只在发现错误时加上纠错注释。`,"welcome.step1":`用你自己的API密钥添加两个以上的模型,或接入本地模型。`,"welcome.step2":`把负责审阅回答的模型设为核查员。`,"welcome.step3":`@一个模型提问,看纠错注释出现。`,"welcome.cta":`或用API密钥添加模型`,"welcome.privacy":`密钥和帖子只保存在你的浏览器里,不会发给我们。`,"tips.title":`提出你的第一个问题`,"tips.body":`用@提到一个模型,或点上面的模型标签。核查员会审阅回答,只在发现问题时加注释。`,"tips.saving":`小技巧:让便宜的或本地的模型回答,让强模型核查。只有真需要时才为长回答付费。`,"composer.placeholder":`问点什么……用@提到模型,例如@{handle}`,"composer.everyModel":`所有已启用的模型`,"composer.noModels":`先添加一个模型。云端模型使用你自己的API密钥;本地模型(Ollama、LM Studio)不需要密钥。`,"composer.addFirst":`用API密钥添加模型`,"composer.asking":`提问`,"composer.checkedBy":`核查`,"composer.mentionHint":`用@提到模型,或点模型标签`,"composer.post":`发布`,"composer.reply":`回复`,"composer.quote":`引用`,"post.youName":`我`,"post.you":`你`,"post.deletedModel":`已删除的模型`,"post.respondingTo":`回应@{handle}的纠错注释`,"post.retry":`重试`,"post.stopped":`已停止。`,"post.checking":`{handles}正在核查`,"post.noDissent":`{handles}没有异议`,"post.couldNotCheck":`@{handle}无法核查`,"post.reply":`回复`,"post.quote":`引用`,"post.stop":`停止`,"post.checkAgain":`重新核查`,"post.regenerate":`重新生成`,"post.copy":`复制`,"post.copied":`已复制`,"post.delete":`删除`,"post.deleteConfirm":`删除这条帖子及其所有回复?`,"note.title":`异议`,"note.from":`来自@{handle}`,"note.agree":`{handles}同意`,"note.accepted":`你已采纳这条注释`,"note.dismissed":`已忽略`,"note.right":`注释正确`,"note.notHelpful":`没帮助`,"note.undo":`撤销`,"note.askRespond":`让@{handle}回应`,"note.seeResponse":`查看@{handle}的回应 →`,"sev.minor":`轻微`,"sev.major":`重要`,"sev.critical":`严重`,"quote.hint":`加一句评论引用它,再@应该回应的模型`,"quote.placeholder":`加一句评论,例如“@{handle} 这样对吗?”`,"quote.placeholderPlain":`加一句评论……`,"thread.title":`话题`,"thread.deleted":`这条帖子已被删除。`,"thread.quoted":`被引用{n}次`,"thread.replyTo":`回复@{handle}(或@其他模型)`,"thread.replyMention":`回复并@一个模型`,"thread.postReply":`发表回复……`,"models.title":`模型`,"models.sub":`使用你自己的密钥,云端或本地`,"models.hostedTitle":`你的密钥只保存在这个浏览器里。`,"models.hostedBody":`请求从你的浏览器直接发到各个服务商,不经过我们的服务器。`,"models.hostedOllama":`要用本地模型,请这样启动Ollama:`,"models.hostedNpx":`——或在自己电脑上运行Dissentry:`,"models.checkerHint":`为需要审阅其他模型回答的模型打开“核查员”。`,"models.add":`+ 添加模型`,"models.empty":`还没有模型。可以试试免费的本地模型Ollama,或用你的API密钥添加云端服务商。密钥只保存在这个浏览器里,只发给你选择的服务商。`,"models.noModel":`未选择模型`,"models.on":`启用`,"editor.provider":`服务商`,"editor.name":`显示名称`,"editor.handle":`账号名(用于@)`,"editor.handleTaken":`@{handle}已被使用`,"editor.baseUrl":`Base URL`,"editor.key":`API密钥`,"editor.keyOptional":`API密钥(可选)`,"editor.keyPlaceholder":`只保存在这个浏览器里`,"editor.keyLocal":`本地服务不需要`,"editor.getKey":`获取密钥 →`,"editor.model":`模型`,"editor.fetch":`获取模型列表`,"editor.fetching":`正在获取模型……`,"editor.modelsFound":`可用模型{n}个`,"editor.instructions":`额外指令(可选)`,"editor.instructionsPlaceholder":`例如:像资深工程师一样回答,并注明出处。`,"editor.checker":`核查员:审阅其他模型的回答`,"editor.color":`颜色`,"editor.route":`通过本地服务转发`,"editor.routeHint":`请求经由本地Dissentry服务转发:避免浏览器CORS拦截,并使用设置里的网络代理。密钥只转发,不保存。`,"editor.test":`测试连接`,"editor.testing":`正在测试……`,"editor.connected":`连接成功,用时{ms}毫秒。回复:“{reply}”`,"editor.removeConfirm":`删除@{handle}?它发过的帖子会保留在时间线里。`,"trust.title":`可信度`,"trust.sub":`在你的问题上,谁常被纠正,谁的注释靠得住`,"trust.summary":`个回答经你确认有错(共核查{n}个)。没有第二意见,你可能就信了。`,"trust.empty":`添加模型并提几个问题,就能建立你的可信度表。`,"trust.asAnswerer":`作为回答者`,"trust.asChecker":`作为核查员`,"trust.heldUp":`经得起核查`,"trust.notesRight":`已评价的注释是对的`,"trust.answers":`回答{a}个 · 已核查{c}个`,"trust.corrected":`{n}个被你采纳的注释纠正`,"trust.awaiting":`{n}条注释等你评价`,"trust.reviewed":`审阅回答{a}个 · 注释{n}条`,"trust.acceptedDismissed":`采纳{a} · 忽略{d}`,"trust.footnote":`数据只来自你对注释的评价,反映的是每个模型在你的问题上的表现。`,"settings.title":`设置`,"settings.profile":`个人资料`,"settings.name":`你的显示名称`,"settings.autoCheck":`自动核查每个回答`,"settings.autoCheckDesc":`每个回答完成后由核查员审阅。关闭后可用🔍按钮手动核查(更省token)。`,"settings.data":`你的数据`,"settings.dataDesc":`所有数据都保存在这个浏览器里。导出可以备份,或搬到另一台设备。`,"settings.export":`导出(不含密钥)`,"settings.exportKeys":`导出(含API密钥)`,"settings.import":`导入……`,"settings.imported":`已导入。`,"settings.importFailed":`导入失败:{error}`,"settings.clear":`清除所有数据`,"settings.clearConfirm":`从这个浏览器删除所有帖子、注释和模型?此操作无法撤销。`,"settings.cleared":`所有数据已清除。`,"connection.title":`网络连接`,"connection.hostedDesc":`请求从你的浏览器直接发到各个AI服务商,走你设备的网络。如果某个服务商在你所在的地区无法访问,打开你的VPN或系统代理即可,Dissentry会自动使用。`,"proxy.title":`网络代理`,"proxy.localDesc":`服务商请求经由本地Dissentry服务转发(不会被CORS拦截;密钥只转发,不保存)。选择它的出网方式。`,"proxy.system":`系统`,"proxy.systemFound":`使用环境变量中的代理:`,"proxy.systemNone":`如果Dissentry启动时设置了HTTPS_PROXY / HTTP_PROXY就使用它。当前未检测到,因此直接连接。`,"proxy.direct":`不使用代理`,"proxy.directDesc":`直接连接所有服务商。`,"proxy.custom":`自定义代理`,"proxy.customDesc":`例如你的Clash、V2Ray或Shadowsocks客户端,或公司代理。`,"proxy.address":`代理地址`,"proxy.addressHelp":`支持HTTP、HTTPS和SOCKS5。需要登录时写成http://用户名:密码@主机:端口。`,"proxy.bypass":`以下地址不走代理(可选)`,"proxy.bypassHelp":`用逗号分隔的主机名;以点开头可匹配子域名。本地地址(Ollama、LM Studio)始终直连。`,"proxy.enterAddress":`请输入代理地址。`,"proxy.badScheme":`请使用http://、https://或socks5://`,"proxy.badUrl":`格式类似:http://127.0.0.1:7890或socks5://127.0.0.1:1080`,"proxy.test":`测试连接`,"proxy.testing":`正在测试……`,"proxy.reachable":`可以连通,用时{ms}毫秒(HTTP {status};没有密钥时返回401是正常的)。`,"err.auth":`@{handle}认证失败:请检查API密钥。({msg})`,"err.model":`@{handle}找不到模型“{model}”。({msg})`,"err.quota":`@{handle}触发了速率限制或余额不足。({msg})`,"err.unreachable":`无法连接{url}。请检查网络或代理。`,"err.localHosted":`无法连接{url}。它在运行吗?Ollama需要允许本站访问:用OLLAMA_ORIGINS={origin} ollama serve启动(浏览器可能还会询问是否允许访问本地网络)。`,"err.blockedHosted":`你的浏览器无法连接{url}。如果这个服务商在你的网络中被屏蔽,请打开VPN或系统代理后重试。`,"err.empty":`模型返回了空回答。`,"post.share":`分享为图片`,"share.title":`分享为图片`,"share.rendering":`正在生成……`,"share.includeQuestion":`包含问题`,"share.failed":`无法生成图片:{error}`,"share.postX":`发到X`,"share.copy":`复制图片`,"share.download":`下载`,"share.native":`分享……`,"share.privacy":`图片在你的设备上生成,不会上传任何内容。`,"share.copied":`图片已复制。`,"share.copyUnsupported":`这个浏览器不支持复制图片,请改用下载。`,"share.pasteHint":`图片已复制:粘贴到帖子里即可(⌘V / Ctrl+V)。`,"share.attachHint":`图片已下载:把它添加到帖子里。`,"share.tweetNote":`{author}说得很肯定,{checkers}却不同意。📝
18
18
 
19
19
  别只信一个AI的话。`,"share.tweetOk":`{checkers}核查了{author}的回答,没发现问题。✓`,"share.tweetPlain":`在Dissentry上问了{author},其他AI模型会核查它的回答。`,"card.agree":`同意`,"card.noDissent":`{handles}没有异议`,"card.tagline":`别只信一个AI的话。`,"card.byline":`免费开源 · 使用你自己的密钥`,"card.stampDissent":`有异议`,"card.stampChecked":`已核查`,"or.signIn":`用OpenRouter登录`,"or.redirecting":`正在打开OpenRouter……`,"or.pitch":`一次登录即可使用Claude、GPT、Gemini、DeepSeek、千问、Grok等数百个模型,费用从你自己的OpenRouter账户扣除。无需复制密钥。`,"or.cardTitle":`最快的开始方式`,"or.title":`连接OpenRouter`,"or.connecting":`正在连接你的OpenRouter账户……`,"or.connected":`你的OpenRouter账户已连接。`,"or.pickTitle":`选择你的模型`,"or.pickSub":`已为每个系列预选最新模型。它们都可以互相核查回答。`,"or.keyNote":`Dissentry已获得你OpenRouter账户的一个密钥,只保存在这个浏览器里;你可以随时在openrouter.ai/keys查看或撤销。`,"or.add":`添加{n}个模型`,"or.more":`以后可在“模型”页选择其他模型`,"or.cancelled":`登录已取消。`,"or.stateError":`这个登录链接已过期或来自另一个标签页,请重试。`,"or.failed":`无法连接OpenRouter({error}),请重试。`,"or.useKey":`改用API密钥`,"or.perMillion":`每百万token`,"or.priceHint":`输入/输出价格(美元/百万token),由OpenRouter从你的账户扣除。`,"trust.noAnswers":`还没有被核查过的回答。`,"trust.noChecks":`还没有核查过回答。`,"trust.noRated":`已审阅{a}个回答、写了{n}条注释。评价它的注释,就能看出它对的比例。`,"nav.usage":`用量`,"usage.title":`用量`,"usage.sub":`token数量与估算费用,记录在本设备上`,"usage.tokens":`token`,"usage.range.today":`今天`,"usage.range.7d":`7天`,"usage.range.30d":`30天`,"usage.range.all":`全部`,"usage.answering":`回答`,"usage.checking":`核查`,"usage.checkInsight":`核查用掉了你{pct}%的token。小技巧:用便宜的模型回答,用强模型核查。`,"usage.byModel":`按模型`,"usage.split":`回答{a} · 核查{c}`,"usage.empty":`这段时间还没有用量记录。`,"usage.noPrice":`在“模型”页填上这个模型的价格,就能估算费用。`,"usage.addPrice":`未设置价格`,"usage.footnote":`根据各服务商返回的token数和你为模型设置的价格估算,以服务商账单为准。用量从这个版本开始记录。`,"usage.postLine":`{a} token · 核查{c}`,"usage.postTip":`回答:输入{i} / 输出{o} token · 核查:{c} token`,"editor.inPrice":`输入价格(美元/百万token)`,"editor.outPrice":`输出价格(美元/百万token)`,"editor.priceHelp":`可选:用于在“用量”页估算费用。OpenRouter模型会自动填写。`,"land.navHow":`怎么用`,"land.navFeatures":`功能`,"land.navFaq":`常见问题`,"land.openApp":`打开应用`,"land.eyebrow":`免费开源 · 使用你自己的模型`,"land.h1":`别只信一个AI的话。`,"land.sub":`向任何AI模型提问,你的其他模型会核查回答,只在发现错误时加上纠错注释。谁对谁错、哪个模型更可信,一目了然。`,"land.ctaKeys":`使用自己的API密钥`,"land.trustLine":`无需注册账号。密钥和对话只保存在你的浏览器里。`,"land.shotAlt":`Dissentry界面:一个AI回答收到三个模型的纠错注释`,"land.cardAlt":`回答与纠错注释的分享图片`,"land.worksWith":`支持`,"land.howTitle":`三步得到可信的回答`,"land.s1t":`问任何模型`,"land.s1b":`像在X上回复一样,@Claude、GPT、Gemini、DeepSeek、千问、Grok或本地模型。`,"land.s2t":`其他模型核查`,"land.s2b":`核查员模型审阅回答,只在内容有事实错误、过时或不安全时加注释。`,"land.s3t":`由你判断`,"land.s3b":`把注释标为“正确”或“没帮助”。时间一长,你就知道哪个模型常被纠正、谁的注释靠得住。`,"land.featTitle":`为不轻信单一模型的人而做`,"land.f1t":`只在要紧时才加注释`,"land.f1b":`不挑措辞毛病。有注释就代表真有问题,回答里出错的那句话会被标出来。`,"land.f2t":`共识一目了然`,"land.f2b":`多个模型指出同一个说法时,注释会合并:“@claude · @qwen · @gemini同意”。`,"land.f3t":`你自己的可信度`,"land.f3b":`看哪些模型在你的问题上经得起核查,而不是在别人的评测榜上。`,"land.f4t":`分享为图片`,"land.f4b":`一键把回答和注释做成精美卡片,发到X或分享给团队。`,"land.f5t":`隐私优先`,"land.f5b":`密钥和对话只在你的浏览器里,请求直接发给你选择的服务商。`,"land.f6t":`更省token`,"land.f6b":`让便宜的或本地的模型回答,让强模型核查。“用量”页清楚显示你花了多少。`,"land.faqTitle":`常见问题`,"land.q1":`Dissentry免费吗?`,"land.a1":`免费,而且开源(MIT)。你只需按实际用量直接付费给AI服务商。`,"land.q2":`我的API密钥存在哪里?`,"land.a2":`只存在你的浏览器里。请求从浏览器直接发到各服务商,不经过我们的服务器。`,"land.q3":`能用我的ChatGPT Plus或Claude Pro订阅吗?`,"land.a3":`不能直接用:服务商不允许第三方应用使用个人订阅,这样做的账号可能被封。可以改用OpenRouter登录:一次登录,所有主流模型,费用从你自己的账户扣除。`,"land.q4":`支持哪些模型?`,"land.a4":`OpenAI、Anthropic、Google Gemini、DeepSeek、千问、xAI、Mistral、Groq、OpenRouter(数百个模型)、任何OpenAI兼容接口,以及通过Ollama或LM Studio运行的本地模型。`,"land.q5":`能在自己电脑上运行吗?`,"land.a5":`可以:运行“npx dissentry”。本地版还支持本地模型,并可以通过代理转发请求。`,"land.ctaTitle":`每个回答,都有第二意见。`,"land.ctaSub":`一分钟内开始。无需注册,无需安装。`},mn=[{id:`en`,label:`English`,html:`en`},{id:`zh`,label:`简体中文`,html:`zh-Hans`},{id:`ja`,label:`日本語`,html:`ja`},{id:`ko`,label:`한국어`,html:`ko`}],hn={en:un,zh:pn,ja:dn,ko:fn},gn=`dissentry.lang`,_n=new Set,vn=e=>!!e&&e in hn;function yn(){for(let e of navigator.languages??[navigator.language]){let t=e.toLowerCase().split(`-`)[0];if(vn(t))return t}return`en`}function bn(){try{let e=new URL(location.href),t=e.searchParams.get(`lang`)?.toLowerCase().replace(/^cn$/,`zh`).replace(/^jp$/,`ja`).replace(/^kr$/,`ko`);if(vn(t))return localStorage.setItem(gn,t),e.searchParams.delete(`lang`),history.replaceState(null,``,e.pathname+e.search+e.hash),t;let n=localStorage.getItem(gn);if(vn(n))return n}catch{}return typeof navigator<`u`?yn():`en`}var xn=typeof window<`u`?bn():`en`,Sn=()=>{typeof document<`u`&&(document.documentElement.lang=mn.find(e=>e.id===xn).html)};Sn();var Cn=()=>xn;function wn(e){xn=e,localStorage.setItem(gn,e),Sn(),_n.forEach(e=>e())}function Tn(){return(0,y.useSyncExternalStore)(e=>(_n.add(e),()=>_n.delete(e)),Cn,()=>`en`)}function En(e,t){let n=hn[xn][e]??un[e];if(t)for(let[e,r]of Object.entries(t))n=n.split(`{${e}}`).join(String(r));return n}function Dn(){return Tn(),En}var On=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),R=o(((e,t)=>{t.exports=On()}))();function kn({compact:e}){let t=Tn(),n=Dn();return(0,R.jsxs)(`label`,{className:`flex items-center gap-1.5 text-slate-500 text-[13px]`,title:n(`layout.language`),children:[(0,R.jsx)(wt,{size:15}),(0,R.jsx)(`select`,{value:t,onChange:e=>wn(e.target.value),"aria-label":n(`layout.language`),className:`cursor-pointer rounded-md bg-transparent py-1 pr-1 font-medium text-slate-600 outline-none hover:text-ink`,children:mn.map(e=>(0,R.jsx)(`option`,{value:e.id,children:e.label},e.id))})]})}function An({size:e=28}){return(0,R.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,R.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 64 64`,"aria-hidden":!0,children:[(0,R.jsx)(`rect`,{width:`64`,height:`64`,rx:`14`,className:`fill-slate-900`}),(0,R.jsx)(`path`,{d:`M18 16h14a16 16 0 0 1 0 32H18z`,fill:`none`,className:`stroke-white`,strokeWidth:`6`}),(0,R.jsx)(`circle`,{cx:`46`,cy:`18`,r:`7`,fill:`#f59e0b`})]}),(0,R.jsx)(`span`,{className:`text-lg font-extrabold tracking-tight`,children:`Dissentry`})]})}var jn=`data:image/svg+xml,%3csvg%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eClaude%3c/title%3e%3cpath%20d='M4.709%2015.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0%2011.784l.055-.352.48-.321.686.06%201.52.103%202.278.158%201.652.097%202.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686%201.908%201.476%202.491%201.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97%202.97%200%2001-.104-.729L6.283.134%206.696%200l.996.134.42.364.62%201.414%201.002%202.229%201.555%203.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286%201.851-.559%202.903-.364%201.942h.212l.243-.242.985-1.306%201.652-2.064.73-.82.85-.904.547-.431h1.033l.76%201.129-.34%201.166-1.064%201.347-.881%201.142-1.264%201.7-.79%201.36.073.11.188-.02%202.856-.606%201.543-.28%201.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061%201.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093%201.068%202.006%201.81%202.509%202.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649%202.345%203.521.122%201.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674%207.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434%201.967-2.18%202.945-1.726%201.845-.414.164-.717-.37.067-.662.401-.589%202.388-3.036%201.44-1.882.93-1.086-.006-.158h-.055L4.132%2018.56l-1.13.146-.487-.456.061-.746.231-.243%201.908-1.312-.006.006z'%20fill='%23D97757'%20fill-rule='nonzero'%3e%3c/path%3e%3c/svg%3e`,Mn=`data:image/svg+xml,%3csvg%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCohere%3c/title%3e%3cpath%20clip-rule='evenodd'%20d='M8.128%2014.099c.592%200%201.77-.033%203.398-.703%201.897-.781%205.672-2.2%208.395-3.656%201.905-1.018%202.74-2.366%202.74-4.18A4.56%204.56%200%200018.1%201H7.549A6.55%206.55%200%20001%207.55c0%203.617%202.745%206.549%207.128%206.549z'%20fill='%2339594D'%20fill-rule='evenodd'%3e%3c/path%3e%3cpath%20clip-rule='evenodd'%20d='M9.912%2018.61a4.387%204.387%200%20012.705-4.052l3.323-1.38c3.361-1.394%207.06%201.076%207.06%204.715a5.104%205.104%200%2001-5.105%205.104l-3.597-.001a4.386%204.386%200%2001-4.386-4.387z'%20fill='%23D18EE2'%20fill-rule='evenodd'%3e%3c/path%3e%3cpath%20d='M4.776%2014.962A3.775%203.775%200%20001%2018.738v.489a3.776%203.776%200%20007.551%200v-.49a3.775%203.775%200%2000-3.775-3.775z'%20fill='%23FF7759'%3e%3c/path%3e%3c/svg%3e`,Nn=`data:image/svg+xml,%3csvg%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDeepSeek%3c/title%3e%3cpath%20d='M23.748%204.482c-.254-.124-.364.113-.512.234-.051.039-.094.09-.137.136-.372.397-.806.657-1.373.626-.829-.046-1.537.214-2.163.848-.133-.782-.575-1.248-1.247-1.548-.352-.156-.708-.311-.955-.65-.172-.241-.219-.51-.305-.774-.055-.16-.11-.323-.293-.35-.2-.031-.278.136-.356.276-.313.572-.434%201.202-.422%201.84.027%201.436.633%202.58%201.838%203.393.137.093.172.187.129.323-.082.28-.18.552-.266.833-.055.179-.137.217-.329.14a5.526%205.526%200%2001-1.736-1.18c-.857-.828-1.631-1.742-2.597-2.458a11.365%2011.365%200%2000-.689-.471c-.985-.957.13-1.743.388-1.836.27-.098.093-.432-.779-.428-.872.004-1.67.295-2.687.684a3.055%203.055%200%2001-.465.137%209.597%209.597%200%2000-2.883-.102c-1.885.21-3.39%201.102-4.497%202.623C.082%208.606-.231%2010.684.152%2012.85c.403%202.284%201.569%204.175%203.36%205.653%201.858%201.533%203.997%202.284%206.438%202.14%201.482-.085%203.133-.284%204.994-1.86.47.234.962.327%201.78.397.63.059%201.236-.03%201.705-.128.735-.156.684-.837.419-.961-2.155-1.004-1.682-.595-2.113-.926%201.096-1.296%202.746-2.642%203.392-7.003.05-.347.007-.565%200-.845-.004-.17.035-.237.23-.256a4.173%204.173%200%20001.545-.475c1.396-.763%201.96-2.015%202.093-3.517.02-.23-.004-.467-.247-.588zM11.581%2018c-2.089-1.642-3.102-2.183-3.52-2.16-.392.024-.321.471-.235.763.09.288.207.486.371.739.114.167.192.416-.113.603-.673.416-1.842-.14-1.897-.167-1.361-.802-2.5-1.86-3.301-3.307-.774-1.393-1.224-2.887-1.298-4.482-.02-.386.093-.522.477-.592a4.696%204.696%200%20011.529-.039c2.132.312%203.946%201.265%205.468%202.774.868.86%201.525%201.887%202.202%202.891.72%201.066%201.494%202.082%202.48%202.914.348.292.625.514.891.677-.802.09-2.14.11-3.054-.614zm1-6.44a.306.306%200%2001.415-.287.302.302%200%2001.2.288.306.306%200%2001-.31.307.303.303%200%2001-.304-.308zm3.11%201.596c-.2.081-.399.151-.59.16a1.245%201.245%200%2001-.798-.254c-.274-.23-.47-.358-.552-.758a1.73%201.73%200%2001.016-.588c.07-.327-.008-.537-.239-.727-.187-.156-.426-.199-.688-.199a.559.559%200%2001-.254-.078c-.11-.054-.2-.19-.114-.358.028-.054.16-.186.192-.21.356-.202.767-.136%201.146.016.352.144.618.408%201.001.782.391.451.462.576.685.914.176.265.336.537.445.848.067.195-.019.354-.25.452z'%20fill='%234D6BFE'%3e%3c/path%3e%3c/svg%3e`,Pn=`data:image/svg+xml,%3csvg%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDoubao%3c/title%3e%3cpath%20d='M5.31%2015.756c.172-3.75%201.883-5.999%202.549-6.739-3.26%202.058-5.425%205.658-6.358%208.308v1.12C1.501%2021.513%204.226%2024%207.59%2024a6.59%206.59%200%20002.2-.375c.353-.12.7-.248%201.039-.378.913-.899%201.65-1.91%202.243-2.992-4.877%202.431-7.974.072-7.763-4.5l.002.001z'%20fill='%231E37FC'%3e%3c/path%3e%3cpath%20d='M22.57%2010.283c-1.212-.901-4.109-2.404-7.397-2.8.295%203.792.093%208.766-2.1%2012.773a12.782%2012.782%200%2001-2.244%202.992c3.764-1.448%206.746-3.457%208.596-5.219%202.82-2.683%203.353-5.178%203.361-6.66a2.737%202.737%200%2000-.216-1.084v-.002z'%20fill='%2337E1BE'%3e%3c/path%3e%3cpath%20d='M14.303%201.867C12.955.7%2011.248%200%209.39%200%207.532%200%205.883.677%204.545%201.807%202.791%203.29%201.627%205.557%201.5%208.125v9.201c.932-2.65%203.097-6.25%206.357-8.307.5-.318%201.025-.595%201.569-.829%201.883-.801%203.878-.932%205.746-.706-.222-2.83-.718-5.002-.87-5.617h.001z'%20fill='%23A569FF'%3e%3c/path%3e%3cpath%20d='M17.305%204.961a199.47%20199.47%200%2001-1.08-1.094c-.202-.213-.398-.419-.586-.622l-1.333-1.378c.151.615.648%202.786.869%205.617%203.288.395%206.185%201.898%207.396%202.8-1.306-1.275-3.475-3.487-5.266-5.323z'%20fill='%231E37FC'%3e%3c/path%3e%3c/svg%3e`,Fn=`data:image/svg+xml,%3csvg%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGemini%3c/title%3e%3cpath%20d='M20.616%2010.835a14.147%2014.147%200%2001-4.45-3.001%2014.111%2014.111%200%2001-3.678-6.452.503.503%200%2000-.975%200%2014.134%2014.134%200%2001-3.679%206.452%2014.155%2014.155%200%2001-4.45%203.001c-.65.28-1.318.505-2.002.678a.502.502%200%20000%20.975c.684.172%201.35.397%202.002.677a14.147%2014.147%200%20014.45%203.001%2014.112%2014.112%200%20013.679%206.453.502.502%200%2000.975%200c.172-.685.397-1.351.677-2.003a14.145%2014.145%200%20013.001-4.45%2014.113%2014.113%200%20016.453-3.678.503.503%200%20000-.975%2013.245%2013.245%200%2001-2.003-.678z'%20fill='%233186FF'%3e%3c/path%3e%3cpath%20d='M20.616%2010.835a14.147%2014.147%200%2001-4.45-3.001%2014.111%2014.111%200%2001-3.678-6.452.503.503%200%2000-.975%200%2014.134%2014.134%200%2001-3.679%206.452%2014.155%2014.155%200%2001-4.45%203.001c-.65.28-1.318.505-2.002.678a.502.502%200%20000%20.975c.684.172%201.35.397%202.002.677a14.147%2014.147%200%20014.45%203.001%2014.112%2014.112%200%20013.679%206.453.502.502%200%2000.975%200c.172-.685.397-1.351.677-2.003a14.145%2014.145%200%20013.001-4.45%2014.113%2014.113%200%20016.453-3.678.503.503%200%20000-.975%2013.245%2013.245%200%2001-2.003-.678z'%20fill='url(%23lobe-icons-gemini-0-_R_0_)'%3e%3c/path%3e%3cpath%20d='M20.616%2010.835a14.147%2014.147%200%2001-4.45-3.001%2014.111%2014.111%200%2001-3.678-6.452.503.503%200%2000-.975%200%2014.134%2014.134%200%2001-3.679%206.452%2014.155%2014.155%200%2001-4.45%203.001c-.65.28-1.318.505-2.002.678a.502.502%200%20000%20.975c.684.172%201.35.397%202.002.677a14.147%2014.147%200%20014.45%203.001%2014.112%2014.112%200%20013.679%206.453.502.502%200%2000.975%200c.172-.685.397-1.351.677-2.003a14.145%2014.145%200%20013.001-4.45%2014.113%2014.113%200%20016.453-3.678.503.503%200%20000-.975%2013.245%2013.245%200%2001-2.003-.678z'%20fill='url(%23lobe-icons-gemini-1-_R_0_)'%3e%3c/path%3e%3cpath%20d='M20.616%2010.835a14.147%2014.147%200%2001-4.45-3.001%2014.111%2014.111%200%2001-3.678-6.452.503.503%200%2000-.975%200%2014.134%2014.134%200%2001-3.679%206.452%2014.155%2014.155%200%2001-4.45%203.001c-.65.28-1.318.505-2.002.678a.502.502%200%20000%20.975c.684.172%201.35.397%202.002.677a14.147%2014.147%200%20014.45%203.001%2014.112%2014.112%200%20013.679%206.453.502.502%200%2000.975%200c.172-.685.397-1.351.677-2.003a14.145%2014.145%200%20013.001-4.45%2014.113%2014.113%200%20016.453-3.678.503.503%200%20000-.975%2013.245%2013.245%200%2001-2.003-.678z'%20fill='url(%23lobe-icons-gemini-2-_R_0_)'%3e%3c/path%3e%3cdefs%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20id='lobe-icons-gemini-0-_R_0_'%20x1='7'%20x2='11'%20y1='15.5'%20y2='12'%3e%3cstop%20stop-color='%2308B962'%3e%3c/stop%3e%3cstop%20offset='1'%20stop-color='%2308B962'%20stop-opacity='0'%3e%3c/stop%3e%3c/linearGradient%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20id='lobe-icons-gemini-1-_R_0_'%20x1='8'%20x2='11.5'%20y1='5.5'%20y2='11'%3e%3cstop%20stop-color='%23F94543'%3e%3c/stop%3e%3cstop%20offset='1'%20stop-color='%23F94543'%20stop-opacity='0'%3e%3c/stop%3e%3c/linearGradient%3e%3clinearGradient%20gradientUnits='userSpaceOnUse'%20id='lobe-icons-gemini-2-_R_0_'%20x1='3.5'%20x2='17.5'%20y1='13.5'%20y2='12'%3e%3cstop%20stop-color='%23FABC12'%3e%3c/stop%3e%3cstop%20offset='.46'%20stop-color='%23FABC12'%20stop-opacity='0'%3e%3c/stop%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e`,In=`data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGrok%3c/title%3e%3cpath%20d='M9.27%2015.29l7.978-5.897c.391-.29.95-.177%201.137.272.98%202.369.542%205.215-1.41%207.169-1.951%201.954-4.667%202.382-7.149%201.406l-2.711%201.257c3.889%202.661%208.611%202.003%2011.562-.953%202.341-2.344%203.066-5.539%202.388-8.42l.006.007c-.983-4.232.242-5.924%202.75-9.383.06-.082.12-.164.179-.248l-3.301%203.305v-.01L9.267%2015.292M7.623%2016.723c-2.792-2.67-2.31-6.801.071-9.184%201.761-1.763%204.647-2.483%207.166-1.425l2.705-1.25a7.808%207.808%200%2000-1.829-1A8.975%208.975%200%20005.984%205.83c-2.533%202.536-3.33%206.436-1.962%209.764%201.022%202.487-.653%204.246-2.34%206.022-.599.63-1.199%201.259-1.682%201.925l7.62-6.815'%3e%3c/path%3e%3c/svg%3e`,Ln=`data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGroq%3c/title%3e%3cpath%20d='M12.036%202c-3.853-.035-7%203-7.036%206.781-.035%203.782%203.055%206.872%206.908%206.907h2.42v-2.566h-2.292c-2.407.028-4.38-1.866-4.408-4.23-.029-2.362%201.901-4.298%204.308-4.326h.1c2.407%200%204.358%201.915%204.365%204.278v6.305c0%202.342-1.944%204.25-4.323%204.279a4.375%204.375%200%2001-3.033-1.252l-1.851%201.818A7%207%200%200012.029%2022h.092c3.803-.056%206.858-3.083%206.879-6.816v-6.5C18.907%204.963%2015.817%202%2012.036%202z'%3e%3c/path%3e%3c/svg%3e`,Rn=`data:image/svg+xml,%3csvg%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eKimi%3c/title%3e%3cpath%20d='M21.846%200a1.923%201.923%200%20110%203.846H20.15a.226.226%200%2001-.227-.226V1.923C19.923.861%2020.784%200%2021.846%200z'%20fill='%231783FF'%3e%3c/path%3e%3cpath%20d='M11.065%2011.199l7.257-7.2c.137-.136.06-.41-.116-.41H14.3a.164.164%200%2000-.117.051l-7.82%207.756c-.122.12-.302.013-.302-.179V3.82c0-.127-.083-.23-.185-.23H3.186c-.103%200-.186.103-.186.23V19.77c0%20.128.083.23.186.23h2.69c.103%200%20.186-.102.186-.23v-3.25c0-.069.025-.135.069-.178l2.424-2.406a.158.158%200%2001.205-.023l6.484%204.772a7.677%207.677%200%20003.453%201.283c.108.012.2-.095.2-.23v-3.06c0-.117-.07-.212-.164-.227a5.028%205.028%200%2001-2.027-.807l-5.613-4.064c-.117-.078-.132-.279-.028-.381z'%20fill='currentColor'%3e%3c/path%3e%3c/svg%3e`,zn=`data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eLM%20Studio%3c/title%3e%3cpath%20d='M2.84%202a1.273%201.273%200%20100%202.547h14.107a1.273%201.273%200%20100-2.547H2.84zM7.935%205.33a1.273%201.273%200%20000%202.548H22.04a1.274%201.274%200%20000-2.547H7.935zM3.624%209.935c0-.704.57-1.274%201.274-1.274h14.106a1.274%201.274%200%20010%202.547H4.898c-.703%200-1.274-.57-1.274-1.273zM1.273%2012.188a1.273%201.273%200%20100%202.547H15.38a1.274%201.274%200%20000-2.547H1.273zM3.624%2016.792c0-.704.57-1.274%201.274-1.274h14.106a1.273%201.273%200%20110%202.547H4.898c-.703%200-1.274-.57-1.274-1.273zM13.029%2018.849a1.273%201.273%200%20100%202.547h9.698a1.273%201.273%200%20100-2.547h-9.698z'%20fill-opacity='.3'%3e%3c/path%3e%3cpath%20d='M2.84%202a1.273%201.273%200%20100%202.547h10.287a1.274%201.274%200%20000-2.547H2.84zM7.935%205.33a1.273%201.273%200%20000%202.548H18.22a1.274%201.274%200%20000-2.547H7.935zM3.624%209.935c0-.704.57-1.274%201.274-1.274h10.286a1.273%201.273%200%20010%202.547H4.898c-.703%200-1.274-.57-1.274-1.273zM1.273%2012.188a1.273%201.273%200%20100%202.547H11.56a1.274%201.274%200%20000-2.547H1.273zM3.624%2016.792c0-.704.57-1.274%201.274-1.274h10.286a1.273%201.273%200%20110%202.547H4.898c-.703%200-1.274-.57-1.274-1.273zM13.029%2018.849a1.273%201.273%200%20100%202.547h5.78a1.273%201.273%200%20100-2.547h-5.78z'%3e%3c/path%3e%3c/svg%3e`,Bn=`/assets/meta-color-DjXqXA8M.svg`,Vn=`data:image/svg+xml,%3csvg%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eMinimax%3c/title%3e%3cdefs%3e%3clinearGradient%20id='lobe-icons-minimax-_R_0_'%20x1='0%25'%20x2='100.182%25'%20y1='50.057%25'%20y2='50.057%25'%3e%3cstop%20offset='0%25'%20stop-color='%23E2167E'%3e%3c/stop%3e%3cstop%20offset='100%25'%20stop-color='%23FE603C'%3e%3c/stop%3e%3c/linearGradient%3e%3c/defs%3e%3cpath%20d='M16.278%202c1.156%200%202.093.927%202.093%202.07v12.501a.74.74%200%2000.744.709.74.74%200%2000.743-.709V9.099a2.06%202.06%200%20012.071-2.049A2.06%202.06%200%200124%209.1v6.561a.649.649%200%2001-.652.645.649.649%200%2001-.653-.645V9.1a.762.762%200%2000-.766-.758.762.762%200%2000-.766.758v7.472a2.037%202.037%200%2001-2.048%202.026%202.037%202.037%200%2001-2.048-2.026v-12.5a.785.785%200%2000-.788-.753.785.785%200%2000-.789.752l-.001%2015.904A2.037%202.037%200%200113.441%2022a2.037%202.037%200%2001-2.048-2.026V18.04c0-.356.292-.645.652-.645.36%200%20.652.289.652.645v1.934c0%20.263.142.506.372.638.23.131.514.131.744%200a.734.734%200%2000.372-.638V4.07c0-1.143.937-2.07%202.093-2.07zm-5.674%200c1.156%200%202.093.927%202.093%202.07v11.523a.648.648%200%2001-.652.645.648.648%200%2001-.652-.645V4.07a.785.785%200%2000-.789-.78.785.785%200%2000-.789.78v14.013a2.06%202.06%200%2001-2.07%202.048%202.06%202.06%200%2001-2.071-2.048V9.1a.762.762%200%2000-.766-.758.762.762%200%2000-.766.758v3.8a2.06%202.06%200%2001-2.071%202.049A2.06%202.06%200%20010%2012.9v-1.378c0-.357.292-.646.652-.646.36%200%20.653.29.653.646V12.9c0%20.418.343.757.766.757s.766-.339.766-.757V9.099a2.06%202.06%200%20012.07-2.048%202.06%202.06%200%20012.071%202.048v8.984c0%20.419.343.758.767.758.423%200%20.766-.339.766-.758V4.07c0-1.143.937-2.07%202.093-2.07z'%20fill='url(%23lobe-icons-minimax-_R_0_)'%20fill-rule='nonzero'%3e%3c/path%3e%3c/svg%3e`,Hn=`data:image/svg+xml,%3csvg%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eMistral%3c/title%3e%3cpath%20d='M3.428%203.4h3.429v3.428H3.428V3.4zm13.714%200h3.43v3.428h-3.43V3.4z'%20fill='gold'%3e%3c/path%3e%3cpath%20d='M3.428%206.828h6.857v3.429H3.429V6.828zm10.286%200h6.857v3.429h-6.857V6.828z'%20fill='%23FFAF00'%3e%3c/path%3e%3cpath%20d='M3.428%2010.258h17.144v3.428H3.428v-3.428z'%20fill='%23FF8205'%3e%3c/path%3e%3cpath%20d='M3.428%2013.686h3.429v3.428H3.428v-3.428zm6.858%200h3.429v3.428h-3.429v-3.428zm6.856%200h3.43v3.428h-3.43v-3.428z'%20fill='%23FA500F'%3e%3c/path%3e%3cpath%20d='M0%2017.114h10.286v3.429H0v-3.429zm13.714%200H24v3.429H13.714v-3.429z'%20fill='%23E10500'%3e%3c/path%3e%3c/svg%3e`,Un=`data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOllama%3c/title%3e%3cpath%20d='M7.905%201.09c.216.085.411.225.588.41.295.306.544.744.734%201.263.191.522.315%201.1.362%201.68a5.054%205.054%200%20012.049-.636l.051-.004c.87-.07%201.73.087%202.48.474.101.053.2.11.297.17.05-.569.172-1.134.36-1.644.19-.52.439-.957.733-1.264a1.67%201.67%200%2001.589-.41c.257-.1.53-.118.796-.042.401.114.745.368%201.016.737.248.337.434.769.561%201.287.23.934.27%202.163.115%203.645l.053.04.026.019c.757.576%201.284%201.397%201.563%202.35.435%201.487.216%203.155-.534%204.088l-.018.021.002.003c.417.762.67%201.567.724%202.4l.002.03c.064%201.065-.2%202.137-.814%203.19l-.007.01.01.024c.472%201.157.62%202.322.438%203.486l-.006.039a.651.651%200%2001-.747.536.648.648%200%2001-.54-.742c.167-1.033.01-2.069-.48-3.123a.643.643%200%2001.04-.617l.004-.006c.604-.924.854-1.83.8-2.72-.046-.779-.325-1.544-.8-2.273a.644.644%200%2001.18-.886l.009-.006c.243-.159.467-.565.58-1.12a4.229%204.229%200%2000-.095-1.974c-.205-.7-.58-1.284-1.105-1.683-.595-.454-1.383-.673-2.38-.61a.653.653%200%2001-.632-.371c-.314-.665-.772-1.141-1.343-1.436a3.288%203.288%200%2000-1.772-.332c-1.245.099-2.343.801-2.67%201.686a.652.652%200%2001-.61.425c-1.067.002-1.893.252-2.497.703-.522.39-.878.935-1.066%201.588a4.07%204.07%200%2000-.068%201.886c.112.558.331%201.02.582%201.269l.008.007c.212.207.257.53.109.785-.36.622-.629%201.549-.673%202.44-.05%201.018.186%201.902.719%202.536l.016.019a.643.643%200%2001.095.69c-.576%201.236-.753%202.252-.562%203.052a.652.652%200%2001-1.269.298c-.243-1.018-.078-2.184.473-3.498l.014-.035-.008-.012a4.339%204.339%200%2001-.598-1.309l-.005-.019a5.764%205.764%200%2001-.177-1.785c.044-.91.278-1.842.622-2.59l.012-.026-.002-.002c-.293-.418-.51-.953-.63-1.545l-.005-.024a5.352%205.352%200%2001.093-2.49c.262-.915.777-1.701%201.536-2.269.06-.045.123-.09.186-.132-.159-1.493-.119-2.73.112-3.67.127-.518.314-.95.562-1.287.27-.368.614-.622%201.015-.737.266-.076.54-.059.797.042zm4.116%209.09c.936%200%201.8.313%202.446.855.63.527%201.005%201.235%201.005%201.94%200%20.888-.406%201.58-1.133%202.022-.62.375-1.451.557-2.403.557-1.009%200-1.871-.259-2.493-.734-.617-.47-.963-1.13-.963-1.845%200-.707.398-1.417%201.056-1.946.668-.537%201.55-.849%202.485-.849zm0%20.896a3.07%203.07%200%2000-1.916.65c-.461.37-.722.835-.722%201.25%200%20.428.21.829.61%201.134.455.347%201.124.548%201.943.548.799%200%201.473-.147%201.932-.426.463-.28.7-.686.7-1.257%200-.423-.246-.89-.683-1.256-.484-.405-1.14-.643-1.864-.643zm.662%201.21l.004.004c.12.151.095.37-.056.49l-.292.23v.446a.375.375%200%2001-.376.373.375.375%200%2001-.376-.373v-.46l-.271-.218a.347.347%200%2001-.052-.49.353.353%200%2001.494-.051l.215.172.22-.174a.353.353%200%2001.49.051zm-5.04-1.919c.478%200%20.867.39.867.871a.87.87%200%2001-.868.871.87.87%200%2001-.867-.87.87.87%200%2001.867-.872zm8.706%200c.48%200%20.868.39.868.871a.87.87%200%2001-.868.871.87.87%200%2001-.867-.87.87.87%200%2001.867-.872zM7.44%202.3l-.003.002a.659.659%200%2000-.285.238l-.005.006c-.138.189-.258.467-.348.832-.17.692-.216%201.631-.124%202.782.43-.128.899-.208%201.404-.237l.01-.001.019-.034c.046-.082.095-.161.148-.239.123-.771.022-1.692-.253-2.444-.134-.364-.297-.65-.453-.813a.628.628%200%2000-.107-.09L7.44%202.3zm9.174.04l-.002.001a.628.628%200%2000-.107.09c-.156.163-.32.45-.453.814-.29.794-.387%201.776-.23%202.572l.058.097.008.014h.03a5.184%205.184%200%20011.466.212c.086-1.124.038-2.043-.128-2.722-.09-.365-.21-.643-.349-.832l-.004-.006a.659.659%200%2000-.285-.239h-.004z'%3e%3c/path%3e%3c/svg%3e`,Wn=`data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenAI%3c/title%3e%3cpath%20d='M9.205%208.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357%201.356-.523%202.117-.523%202.854%200%204.662%202.212%204.662%204.566%200%20.167%200%20.357-.024.547l-4.71-2.759a.797.797%200%2000-.856%200l-5.97%203.473zm10.609%208.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473%201.95-1.118a.433.433%200%2001.476%200l4.543%202.617c1.309.76%202.189%202.378%202.189%203.948%200%201.808-1.07%203.473-2.76%204.163zM7.802%2012.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545%201.95-4.472%204.591-4.472%201%200%201.927.333%202.712.928L8.23%205.067c-.285.166-.428.404-.428.737v6.898zM12%2015.128l-2.795-1.57v-3.33L12%208.658l2.795%201.57v3.33L12%2015.128zm1.796%207.23c-1%200-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974%201.142c.167.095.238.238.238.428v5.233c0%202.545-1.974%204.472-4.614%204.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482%204.482%200%20014.21%206.327v5.423c0%20.333.143.571.428.738l5.947%203.449-1.95%201.118a.432.432%200%2001-.476%200zm-.262%203.9c-2.688%200-4.662-2.021-4.662-4.519%200-.19.024-.38.047-.57l4.686%202.71c.286.167.571.167.856%200l5.97-3.448v2.26c0%20.19-.07.333-.237.428l-4.543%202.616c-.619.357-1.356.523-2.117.523zm5.899%202.83a5.947%205.947%200%20005.827-4.756C22.287%2018.339%2024%2015.84%2024%2013.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498%200-3.401-2.759-5.947-5.946-5.947-.642%200-1.26.095-1.88.31A5.962%205.962%200%200010.205%200a5.947%205.947%200%2000-5.827%204.757C1.713%205.447%200%207.945%200%2010.49c0%201.666.713%203.283%201.998%204.448-.119.5-.19%201-.19%201.499%200%203.401%202.759%205.946%205.946%205.946.642%200%201.26-.095%201.88-.309a5.96%205.96%200%20004.162%201.713z'%3e%3c/path%3e%3c/svg%3e`,Gn=`data:image/svg+xml,%3csvg%20fill='currentColor'%20fill-rule='evenodd'%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eOpenRouter%3c/title%3e%3cpath%20d='M18.654%203.87a5.087%205.087%200%20110%2010.174L23.7%2019.09c.64.641.187%201.737-.72%201.737H8.48a8.479%208.479%200%20010-16.958h10.175zM8.479%207.26a5.087%205.087%200%20100%2010.176%205.087%205.087%200%20000-10.175z'%3e%3c/path%3e%3c/svg%3e`,Kn=`data:image/svg+xml,%3csvg%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3ePerplexity%3c/title%3e%3cpath%20d='M19.785%200v7.272H22.5V17.62h-2.935V24l-7.037-6.194v6.145h-1.091v-6.152L4.392%2024v-6.465H1.5V7.188h2.884V0l7.053%206.494V.19h1.09v6.49L19.786%200zm-7.257%209.044v7.319l5.946%205.234V14.44l-5.946-5.397zm-1.099-.08l-5.946%205.398v7.235l5.946-5.234V8.965zm8.136%207.58h1.844V8.349H13.46l6.105%205.54v2.655zm-8.982-8.28H2.59v8.195h1.8v-2.576l6.192-5.62zM5.475%202.476v4.71h5.115l-5.115-4.71zm13.219%200l-5.115%204.71h5.115v-4.71z'%20fill='%2322B8CD'%20fill-rule='nonzero'%3e%3c/path%3e%3c/svg%3e`,qn=`data:image/svg+xml,%3csvg%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eQwen%3c/title%3e%3cpath%20d='M19.713%202.825h-5.907c0-.251-.066-.503-.196-.728L12.819.728A1.46%201.46%200%200%200%2011.559%200h-1.58c-.52%200-1%20.275-1.26.728l-2.42%204.19a1.45%201.45%200%200%200%200%201.453l.791%201.37c.26.448.74.727%201.26.727h11.36c.52%200%201-.275%201.26-.728l.79-1.37a1.45%201.45%200%200%200%200-1.451l-.79-1.37a1.46%201.46%200%200%200-1.26-.728zM.195%209.905l2.951%205.115a1.46%201.46%200%200%200-.531.531l-.791%201.37a1.45%201.45%200%200%200%200%201.452l.79%201.37c.26.448.74.727%201.26.727h4.84c.52%200%201-.275%201.26-.728l.79-1.37a1.45%201.45%200%200%200%200-1.451L5.086%207.083a1.46%201.46%200%200%200-1.26-.728h-1.58c-.52%200-1%20.276-1.26.728l-.79%201.37a1.45%201.45%200%200%200%200%201.452m15.888%2013.367%202.951-5.115c.217.125.469.196.728.196h1.582c.52%200%201-.275%201.26-.728l.79-1.37a1.45%201.45%200%200%200%200-1.451l-2.42-4.191a1.46%201.46%200%200%200-1.259-.728h-1.582c-.52%200-1%20.276-1.259.728l-5.678%209.838a1.45%201.45%200%200%200%200%201.452l.79%201.37c.26.448.74.727%201.26.727h1.582c.52%200%201-.275%201.26-.728z'%20fill='%23082dff'%3e%3c/path%3e%3c/svg%3e`,Jn=[[/claude/,jn],[/(^|\/)(gpt|chatgpt|o[1-9](-|$)|openai)/,Wn],[/gemini|gemma/,Fn],[/deepseek/,Nn],[/qwen|qwq/,qn],[/grok/,In],[/mistral|mixtral|codestral|magistral|ministral|devstral/,Hn],[/llama/,Bn],[/kimi|moonshot/,Rn],[/glm|zhipu|chatglm/,`data:image/svg+xml,%3csvg%20height='1em'%20style='flex:none;line-height:1'%20viewBox='0%200%2024%2024'%20width='1em'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eZhipu%3c/title%3e%3cpath%20d='M11.991%2023.503a.24.24%200%2000-.244.248.24.24%200%2000.244.249.24.24%200%2000.245-.249.24.24%200%2000-.22-.247l-.025-.001zM9.671%205.365a1.697%201.697%200%20011.099%202.132l-.071.172-.016.04-.018.054c-.07.16-.104.32-.104.498-.035.71.47%201.279%201.186%201.314h.366c1.309.053%202.338%201.173%202.286%202.523-.052%201.332-1.152%202.38-2.478%202.327h-.174c-.715.018-1.274.64-1.239%201.368%200%20.124.018.23.053.337.209.373.54.658.96.8.75.23%201.517-.125%201.9-.782l.018-.035c.402-.64%201.17-.96%201.92-.711.854.284%201.378%201.226%201.099%202.167a1.661%201.661%200%2001-2.077%201.102%201.711%201.711%200%2001-.907-.711l-.017-.035c-.2-.323-.463-.58-.851-.711l-.056-.018a1.646%201.646%200%2000-1.954.746%201.66%201.66%200%2001-1.065.764%201.677%201.677%200%2001-1.989-1.279c-.209-.906.332-1.83%201.257-2.043a1.51%201.51%200%2001.296-.035h.018c.68-.071%201.151-.622%201.116-1.333a1.307%201.307%200%2000-.227-.693%202.515%202.515%200%2001-.366-1.403%202.39%202.39%200%2001.366-1.208c.14-.195.21-.444.227-.693.018-.71-.506-1.261-1.186-1.332l-.07-.018a1.43%201.43%200%2001-.299-.07l-.05-.019a1.7%201.7%200%2001-1.047-2.114%201.68%201.68%200%20012.094-1.101zm-5.575%2010.11c.26-.264.639-.367.994-.27.355.096.633.379.728.74.095.362-.007.748-.267%201.013-.402.41-1.053.41-1.455%200a1.062%201.062%200%20010-1.482zm14.845-.294c.359-.09.738.024.992.297.254.274.344.665.237%201.025-.107.36-.396.634-.756.718-.551.128-1.1-.22-1.23-.781a1.05%201.05%200%2001.757-1.26zm-.064-4.39c.314.32.49.753.49%201.206%200%20.452-.176.886-.49%201.206-.315.32-.74.5-1.185.5-.444%200-.87-.18-1.184-.5a1.727%201.727%200%20010-2.412%201.654%201.654%200%20012.369%200zm-11.243.163c.364.484.447%201.128.218%201.691a1.665%201.665%200%2001-2.188.923c-.855-.36-1.26-1.358-.907-2.228a1.68%201.68%200%20011.33-1.038c.593-.08%201.183.169%201.547.652zm11.545-4.221c.368%200%20.708.2.892.524.184.324.184.724%200%201.048a1.026%201.026%200%2001-.892.524c-.568%200-1.03-.47-1.03-1.048%200-.579.462-1.048%201.03-1.048zm-14.358%200c.368%200%20.707.2.891.524.184.324.184.724%200%201.048a1.026%201.026%200%2001-.891.524c-.569%200-1.03-.47-1.03-1.048%200-.579.461-1.048%201.03-1.048zm10.031-1.475c.925%200%201.675.764%201.675%201.706s-.75%201.705-1.675%201.705-1.674-.763-1.674-1.705c0-.942.75-1.706%201.674-1.706zm-2.626-.684c.362-.082.653-.356.761-.718a1.062%201.062%200%2000-.238-1.028%201.017%201.017%200%2000-.996-.294c-.547.14-.881.7-.752%201.257.13.558.675.907%201.225.783zm0%2016.876c.359-.087.644-.36.75-.72a1.062%201.062%200%2000-.237-1.019%201.018%201.018%200%2000-.985-.301%201.037%201.037%200%2000-.762.717c-.108.361-.017.754.239%201.028.245.263.606.377.953.305l.043-.01zM17.19%203.5a.631.631%200%2000.628-.64c0-.355-.279-.64-.628-.64a.631.631%200%2000-.628.64c0%20.355.28.64.628.64zm-10.38%200a.631.631%200%2000.628-.64c0-.355-.28-.64-.628-.64a.631.631%200%2000-.628.64c0%20.355.279.64.628.64zm-5.182%207.852a.631.631%200%2000-.628.64c0%20.354.28.639.628.639a.63.63%200%2000.627-.606l.001-.034a.62.62%200%2000-.628-.64zm5.182%209.13a.631.631%200%2000-.628.64c0%20.355.279.64.628.64a.631.631%200%2000.628-.64c0-.355-.28-.64-.628-.64zm10.38.018a.631.631%200%2000-.628.64c0%20.355.28.64.628.64a.631.631%200%2000.628-.64c0-.355-.279-.64-.628-.64zm5.182-9.148a.631.631%200%2000-.628.64c0%20.354.279.639.628.639a.631.631%200%2000.628-.64c0-.355-.28-.64-.628-.64zm-.384-4.992a.24.24%200%2000.244-.249.24.24%200%2000-.244-.249.24.24%200%2000-.244.249c0%20.142.122.249.244.249zM11.991.497a.24.24%200%2000.245-.248A.24.24%200%200011.99%200a.24.24%200%2000-.244.249c0%20.133.108.236.223.247l.021.001zM2.011%206.36a.24.24%200%2000.245-.249.24.24%200%2000-.244-.249.24.24%200%2000-.244.249.24.24%200%2000.244.249zm0%2011.263a.24.24%200%2000-.243.248.24.24%200%2000.244.249.24.24%200%2000.244-.249.252.252%200%2000-.244-.248zm19.995-.018a.24.24%200%2000-.245.248.24.24%200%2000.245.25.24.24%200%2000.244-.25.252.252%200%2000-.244-.248z'%20fill='%233859FF'%20fill-rule='nonzero'%3e%3c/path%3e%3c/svg%3e`],[/doubao/,Pn],[/minimax|abab/,Vn],[/command|cohere|aya/,Mn],[/sonar|perplexity/,Kn]],Yn={anthropic:jn,openai:Wn,google:Fn,openrouter:Gn,deepseek:Nn,qwen:qn,xai:In,groq:Ln,mistral:Hn,ollama:Un,lmstudio:zn};function Xn(e){let t=(e.modelId??``).toLowerCase();for(let[e,n]of Jn)if(e.test(t))return n;return Yn[e.presetId]}var Zn=e=>Yn[e],Qn=/(^|[^\w@])@([a-z0-9][a-z0-9_.-]*)/gi;function $n(e){return e.toLowerCase().trim().replace(/\s+/g,`-`).replace(/[^a-z0-9_.-]/g,``).replace(/^[^a-z0-9]+/,``).slice(0,30)}function er(e,t){let n=new Set(t.map(e=>e.toLowerCase())),r=[];for(let i of e.matchAll(Qn)){let e=i[2].toLowerCase().replace(/[.-]+$/,``);if(e===`all`)for(let e of t)r.includes(e.toLowerCase())||r.push(e.toLowerCase());else n.has(e)&&!r.includes(e)&&r.push(e)}return r}function tr(e,t){let n=e.slice(0,t),r=/(^|[^\w@])@([a-z0-9_.-]*)$/i.exec(n);return r?{query:r[2].toLowerCase(),start:t-r[2].length-1}:null}var nr=`https://openrouter.ai/api/v1`,rr=`dissentry.or.verifier`,ir=`dissentry.or.state`,ar=`/auth/openrouter`,or=e=>btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``),sr=(e=32)=>or(crypto.getRandomValues(new Uint8Array(e)));async function cr(){localStorage.setItem(`dissentry.started`,`1`);let e=sr(),t=sr(16);sessionStorage.setItem(rr,e),sessionStorage.setItem(ir,t);let n=or(await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(e))),r=new URL(`https://openrouter.ai/auth`);r.searchParams.set(`callback_url`,location.origin+ar),r.searchParams.set(`code_challenge`,n),r.searchParams.set(`code_challenge_method`,`S256`),r.searchParams.set(`state`,t),r.searchParams.set(`key_label`,`Dissentry`),location.assign(r.toString())}async function lr(e){let t=new URLSearchParams(e),n=t.get(`code`),r=sessionStorage.getItem(rr),i=sessionStorage.getItem(ir);if(sessionStorage.removeItem(rr),sessionStorage.removeItem(ir),!n)throw Error(`cancelled`);if(!r||i&&t.get(`state`)!==i)throw Error(`state`);let a=await fetch(`${nr}/auth/keys`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({code:n,code_verifier:r,code_challenge_method:`S256`})});if(!a.ok)throw Error(`HTTP ${a.status}`);let{key:o}=await a.json();if(!o)throw Error(`no key`);return o}var ur=[{vendor:`anthropic`,handle:`claude`,label:`Claude`,match:/sonnet|opus/},{vendor:`openai`,handle:`gpt`,label:`GPT`,match:/gpt/},{vendor:`google`,handle:`gemini`,label:`Gemini`,match:/gemini.*(flash|pro)/},{vendor:`deepseek`,handle:`deepseek`,label:`DeepSeek`},{vendor:`qwen`,handle:`qwen`,label:`Qwen`},{vendor:`x-ai`,handle:`grok`,label:`Grok`},{vendor:`meta-llama`,handle:`llama`,label:`Llama`},{vendor:`moonshotai`,handle:`kimi`,label:`Kimi`}],dr=3,fr=15,pr=/(:free|preview|image|audio|tts|embed|vision|search|online|guard|realtime|transcribe|-mini-?high|codex|distill|experimental|beta)/i;async function mr(){let e=await fetch(`${nr}/models`);if(!e.ok)throw Error(`HTTP ${e.status}`);return((await e.json()).data??[]).map(hr)}function hr(e){let t=e=>e!==void 0&&e!==``&&!Number.isNaN(Number(e))?Number(e)*1e6:void 0;return{id:e.id,name:e.name??e.id,created:e.created??0,inPrice:t(e.pricing?.prompt),outPrice:t(e.pricing?.completion)}}function gr(e){let t=[];for(let n of ur){let r=e.filter(e=>e.id.startsWith(`${n.vendor}/`)&&!pr.test(e.id)&&(!n.match||n.match.test(e.id))).sort((e,t)=>t.created-e.created),i=r.find(e=>(e.inPrice??0)<=dr&&(e.outPrice??0)<=fr)??r[0];i&&t.push({family:n,model:i})}return t}async function _r(e,t){let n=await F.profiles.toArray(),r=new Set(n.map(e=>e.handle)),i=Date.now(),a=t.map((t,n)=>{let a=$n(t.handle);for(let e=2;r.has(a);e++)a=`${$n(t.handle)}${e}`;return r.add(a),{id:We(),handle:a,name:t.label,color:`#6467f2`,presetId:`openrouter`,protocol:`openai`,baseUrl:nr,modelId:t.modelId,apiKey:e,useProxy:!0,systemPrompt:``,enabled:!0,isChecker:!0,inPrice:t.inPrice,outPrice:t.outPrice,createdAt:i+n}});return await F.profiles.bulkAdd(a),a}function vr({size:e=`md`,className:t=``}){let n=Dn(),[r,i]=(0,y.useState)(!1);return(0,R.jsxs)(`button`,{onClick:()=>{i(!0),cr()},disabled:r,className:`inline-flex items-center justify-center gap-2.5 rounded-full bg-ink font-semibold text-white shadow-sm shadow-slate-900/10 transition hover:bg-slate-800 active:scale-[.98] disabled:opacity-70 ${e===`lg`?`px-6 py-3 text-[15px]`:`px-4 py-2 text-[13.5px]`} ${t}`,children:[(0,R.jsx)(`span`,{className:`flex h-6 w-6 items-center justify-center rounded-full bg-white`,children:(0,R.jsx)(`img`,{src:Zn(`openrouter`),alt:``,className:`h-4 w-4`})}),n(r?`or.redirecting`:`or.signIn`)]})}var yr=`dissentry.started`,br=()=>localStorage.setItem(yr,`1`),xr=[`openai`,`anthropic`,`google`,`deepseek`,`qwen`,`xai`,`mistral`,`groq`,`openrouter`,`ollama`],Sr=[{icon:ot,title:`land.f1t`,body:`land.f1b`},{icon:At,title:`land.f2t`,body:`land.f2b`},{icon:Qt,title:`land.f3t`,body:`land.f3b`},{icon:Ot,title:`land.f4t`,body:`land.f4b`},{icon:Mt,title:`land.f5t`,body:`land.f5b`},{icon:gt,title:`land.f6t`,body:`land.f6b`}],Cr=[[`land.q1`,`land.a1`],[`land.q2`,`land.a2`],[`land.q3`,`land.a3`],[`land.q4`,`land.a4`],[`land.q5`,`land.a5`]];function wr(){let e=Dn();return(0,R.jsxs)(`div`,{className:`min-h-screen bg-white text-slate-900`,children:[(0,R.jsx)(`header`,{className:`sticky top-0 z-30 border-b border-slate-200/60 bg-white/80 backdrop-blur`,children:(0,R.jsxs)(`div`,{className:`mx-auto flex max-w-6xl items-center gap-6 px-5 py-3`,children:[(0,R.jsx)(Ve,{href:`/welcome`,className:`shrink-0`,children:(0,R.jsx)(An,{size:26})}),(0,R.jsxs)(`nav`,{className:`hidden items-center gap-5 text-[14px] text-slate-600 md:flex`,children:[(0,R.jsx)(`a`,{href:`#how`,className:`hover:text-ink`,children:e(`land.navHow`)}),(0,R.jsx)(`a`,{href:`#features`,className:`hover:text-ink`,children:e(`land.navFeatures`)}),(0,R.jsx)(`a`,{href:`#faq`,className:`hover:text-ink`,children:e(`land.navFaq`)}),(0,R.jsxs)(`a`,{href:`https://github.com/Lihaila/dissentry`,target:`_blank`,rel:`noreferrer`,className:`flex items-center gap-1 hover:text-ink`,children:[(0,R.jsx)(mt,{size:15}),`GitHub`]})]}),(0,R.jsxs)(`div`,{className:`ml-auto flex items-center gap-3`,children:[(0,R.jsx)(kn,{compact:!0}),(0,R.jsx)(Ve,{href:`/`,onClick:br,className:`rounded-full bg-ink px-4 py-2 text-[13.5px] font-semibold text-white hover:bg-slate-800`,children:e(`land.openApp`)})]})]})}),(0,R.jsxs)(`section`,{className:`relative overflow-hidden`,children:[(0,R.jsxs)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-0`,children:[(0,R.jsx)(`div`,{className:`absolute -left-40 -top-40 h-[520px] w-[520px] rounded-full bg-amber-200/60 blur-3xl`}),(0,R.jsx)(`div`,{className:`absolute -right-32 top-10 h-[460px] w-[460px] rounded-full bg-pink-200/50 blur-3xl`}),(0,R.jsx)(`div`,{className:`absolute bottom-[-200px] left-1/3 h-[520px] w-[620px] rounded-full bg-indigo-200/50 blur-3xl`})]}),(0,R.jsxs)(`div`,{className:`relative mx-auto grid max-w-6xl items-center gap-12 px-5 pb-20 pt-16 lg:grid-cols-[1.05fr_1fr] lg:pt-24`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-2 rounded-full border border-amber-200 bg-white/70 px-3 py-1 text-[12.5px] font-semibold text-amber-800 shadow-sm`,children:[(0,R.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-amber-500`}),e(`land.eyebrow`)]}),(0,R.jsx)(`h1`,{className:`mt-5 text-balance text-[44px] font-extrabold leading-[1.05] tracking-tight text-ink sm:text-[58px]`,children:e(`land.h1`)}),(0,R.jsx)(`p`,{className:`mt-5 max-w-xl text-pretty text-[18px] leading-relaxed text-slate-600`,children:e(`land.sub`)}),(0,R.jsxs)(`div`,{className:`mt-8 flex flex-wrap items-center gap-3`,children:[(0,R.jsx)(`span`,{onClick:br,children:(0,R.jsx)(vr,{size:`lg`})}),(0,R.jsxs)(Ve,{href:`/models`,onClick:br,className:`inline-flex items-center gap-1.5 rounded-full border border-slate-300 bg-white/80 px-5 py-3 text-[15px] font-semibold text-ink hover:bg-white`,children:[e(`land.ctaKeys`),` `,(0,R.jsx)(it,{size:16})]})]}),(0,R.jsx)(`p`,{className:`mt-4 text-[13px] text-slate-500`,children:e(`land.trustLine`)})]}),(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsxs)(`div`,{className:`overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-2xl shadow-slate-900/15`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-slate-100 bg-slate-50 px-3 py-2`,children:[(0,R.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full bg-red-300`}),(0,R.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full bg-amber-300`}),(0,R.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full bg-emerald-300`}),(0,R.jsx)(`span`,{className:`ml-3 truncate rounded-md bg-white px-2 py-0.5 text-[11px] text-slate-400 ring-1 ring-slate-200`,children:`dissentry.lihaila.com`})]}),(0,R.jsx)(`img`,{src:`/landing/thread.webp`,alt:e(`land.shotAlt`),className:`block w-full`,width:1512,height:714})]}),(0,R.jsx)(`img`,{src:`/landing/share-card.webp`,alt:e(`land.cardAlt`),width:1200,height:1030,className:`absolute -bottom-24 -left-10 hidden w-[36%] rotate-[-6deg] rounded-xl shadow-2xl shadow-slate-900/25 ring-1 ring-slate-200 sm:block`})]})]})]}),(0,R.jsx)(`section`,{className:`border-y border-slate-100 bg-slate-50/60`,children:(0,R.jsxs)(`div`,{className:`mx-auto flex max-w-6xl flex-wrap items-center justify-center gap-x-8 gap-y-4 px-5 py-7`,children:[(0,R.jsx)(`span`,{className:`text-[12.5px] font-semibold uppercase tracking-wider text-slate-400`,children:e(`land.worksWith`)}),xr.map(e=>(0,R.jsx)(`img`,{src:Zn(e),alt:e,title:e,className:`h-7 w-7 opacity-80 grayscale transition hover:opacity-100 hover:grayscale-0`},e))]})}),(0,R.jsxs)(`section`,{id:`how`,className:`mx-auto max-w-6xl scroll-mt-20 px-5 py-20`,children:[(0,R.jsx)(`h2`,{className:`text-center text-[34px] font-extrabold tracking-tight text-ink`,children:e(`land.howTitle`)}),(0,R.jsx)(`div`,{className:`mt-10 grid gap-5 md:grid-cols-3`,children:[[`land.s1t`,`land.s1b`],[`land.s2t`,`land.s2b`],[`land.s3t`,`land.s3b`]].map(([t,n],r)=>(0,R.jsxs)(`div`,{className:`rounded-3xl border border-slate-200/80 bg-white p-6 shadow-sm`,children:[(0,R.jsx)(`div`,{className:`flex h-9 w-9 items-center justify-center rounded-full bg-ink text-[15px] font-bold text-white`,children:r+1}),(0,R.jsx)(`h3`,{className:`mt-4 text-[18px] font-bold text-ink`,children:e(t)}),(0,R.jsx)(`p`,{className:`mt-2 text-[15px] leading-relaxed text-slate-600`,children:e(n)})]},t))})]}),(0,R.jsx)(`section`,{id:`features`,className:`scroll-mt-20 bg-gradient-to-b from-amber-50/60 to-white`,children:(0,R.jsxs)(`div`,{className:`mx-auto max-w-6xl px-5 py-20`,children:[(0,R.jsx)(`h2`,{className:`text-center text-[34px] font-extrabold tracking-tight text-ink`,children:e(`land.featTitle`)}),(0,R.jsx)(`div`,{className:`mt-10 grid gap-5 sm:grid-cols-2 lg:grid-cols-3`,children:Sr.map(({icon:t,title:n,body:r})=>(0,R.jsxs)(`div`,{className:`rounded-3xl border border-slate-200/80 bg-white p-6`,children:[(0,R.jsx)(`span`,{className:`flex h-10 w-10 items-center justify-center rounded-2xl bg-amber-100 text-amber-700`,children:(0,R.jsx)(t,{size:20})}),(0,R.jsx)(`h3`,{className:`mt-4 text-[17px] font-bold text-ink`,children:e(n)}),(0,R.jsx)(`p`,{className:`mt-1.5 text-[14.5px] leading-relaxed text-slate-600`,children:e(r)})]},n))}),(0,R.jsxs)(`div`,{className:`mt-8 flex flex-wrap items-center justify-center gap-2 text-[13px] text-slate-500`,children:[(0,R.jsx)(St,{size:15}),` English · 简体中文 · 日本語 · 한국어`]})]})}),(0,R.jsxs)(`section`,{id:`faq`,className:`mx-auto max-w-3xl scroll-mt-20 px-5 py-20`,children:[(0,R.jsx)(`h2`,{className:`text-center text-[34px] font-extrabold tracking-tight text-ink`,children:e(`land.faqTitle`)}),(0,R.jsx)(`div`,{className:`mt-8 divide-y divide-slate-200 rounded-3xl border border-slate-200`,children:Cr.map(([t,n])=>(0,R.jsxs)(`details`,{className:`group px-6 py-4`,children:[(0,R.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center justify-between gap-4 text-[16px] font-semibold text-ink`,children:[e(t),(0,R.jsx)(`span`,{className:`text-slate-400 transition group-open:rotate-45`,children:`+`})]}),(0,R.jsx)(`p`,{className:`mt-2 text-[15px] leading-relaxed text-slate-600`,children:e(n)})]},t))})]}),(0,R.jsx)(`section`,{className:`px-5 pb-20`,children:(0,R.jsxs)(`div`,{className:`relative mx-auto max-w-5xl overflow-hidden rounded-[36px] bg-gradient-to-br from-amber-100 via-rose-100 to-indigo-100 px-8 py-14 text-center`,children:[(0,R.jsx)(`h2`,{className:`text-balance text-[32px] font-extrabold tracking-tight text-ink sm:text-[40px]`,children:e(`land.ctaTitle`)}),(0,R.jsx)(`p`,{className:`mx-auto mt-3 max-w-xl text-[16px] text-slate-700`,children:e(`land.ctaSub`)}),(0,R.jsxs)(`div`,{className:`mt-7 flex flex-wrap justify-center gap-3`,children:[(0,R.jsx)(`span`,{onClick:br,children:(0,R.jsx)(vr,{size:`lg`})}),(0,R.jsx)(`code`,{className:`flex items-center rounded-full bg-white/80 px-5 py-3 font-mono text-[14px] text-ink ring-1 ring-slate-200`,children:`npx dissentry`})]})]})}),(0,R.jsx)(`footer`,{className:`border-t border-slate-100`,children:(0,R.jsxs)(`div`,{className:`mx-auto flex max-w-6xl flex-wrap items-center justify-between gap-4 px-5 py-8 text-[13px] text-slate-500`,children:[(0,R.jsx)(`span`,{children:`© 2026 Lihai La LLC · MIT`}),(0,R.jsxs)(`div`,{className:`flex gap-5`,children:[(0,R.jsx)(`a`,{href:`https://github.com/Lihaila/dissentry`,className:`hover:text-ink`,children:`GitHub`}),(0,R.jsx)(`a`,{href:`https://www.npmjs.com/package/dissentry`,className:`hover:text-ink`,children:`npm`}),(0,R.jsx)(`a`,{href:`https://lihaila.com`,className:`hover:text-ink`,children:`lihaila.com`})]})]})})]})}function Tr(){return ne(()=>F.profiles.orderBy(`createdAt`).toArray(),[])}function Er(){let e=Tr();return new Map((e??[]).map(e=>[e.id,e]))}function Dr(e=3e4){let[,t]=(0,y.useState)(0);(0,y.useEffect)(()=>{let n=setInterval(()=>t(e=>e+1),e);return()=>clearInterval(n)},[e])}var Or=!1,kr=new Set;function Ar(){Or=!0,kr.forEach(e=>e())}function jr(){Or=!1,kr.forEach(e=>e())}var Mr=()=>(0,y.useSyncExternalStore)(e=>(kr.add(e),()=>kr.delete(e)),()=>Or);function Nr(e,t=60){let n=e.replace(/@[a-z0-9][a-z0-9_.-]*/gi,``).replace(/\s+/g,` `).trim();return n.length>t?n.slice(0,t-1)+`…`:n||e.slice(0,t)}function Pr({profile:e,size:t=40,user:n}){if(n!==void 0)return(0,R.jsx)(`div`,{className:`flex shrink-0 select-none items-center justify-center rounded-full bg-sky-500 font-semibold text-white`,style:{width:t,height:t,fontSize:t*.4},"aria-hidden":!0,children:(n.trim()[0]??`Y`).toUpperCase()});let r=e?Xn(e):void 0;if(r)return(0,R.jsx)(`div`,{className:`flex shrink-0 select-none items-center justify-center rounded-full border border-slate-200 bg-white`,style:{width:t,height:t},"aria-hidden":!0,children:(0,R.jsx)(`img`,{src:r,alt:``,draggable:!1,style:{width:t*.58,height:t*.58}})});let i=(e?.name??`?`).replace(/[^\p{L}\p{N}]/gu,``).slice(0,2);return(0,R.jsx)(`div`,{className:`flex shrink-0 select-none items-center justify-center rounded-full font-semibold text-white`,style:{width:t,height:t,background:e?.color??`#64748b`,fontSize:t*.38},"aria-hidden":!0,children:i.toUpperCase()})}var Fr=`vercel.ai.error`,Ir=Symbol.for(Fr),z=class e extends Error{constructor({name:e,message:t,cause:n}){super(t),this[Ir]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,Fr)}static hasMarker(e,t){let n=Symbol.for(t);return typeof e==`object`&&!!e&&n in e&&typeof e[n]==`boolean`&&e[n]===!0}},Lr=`AI_DecisionUnsupportedQuestionTypeError`,Rr=`vercel.ai.error.${Lr}`,zr=Symbol.for(Rr),Br=class extends z{constructor({questionId:e,questionType:t,provider:n,modelId:r,message:i=`Question "${e}" has type "${t}", which is not supported by provider "${n}" and model "${r}".`}){super({name:Lr,message:i}),this[zr]=!0,this.questionId=e,this.questionType=t,this.provider=n,this.modelId=r}static isInstance(e){return z.hasMarker(e,Rr)}},Vr=`AI_APICallError`,Hr=`vercel.ai.error.${Vr}`,Ur=Symbol.for(Hr),Wr=class extends z{constructor({message:e,url:t,requestBodyValues:n,statusCode:r,responseHeaders:i,responseBody:a,cause:o,isRetryable:s=r!=null&&(r===408||r===409||r===429||r>=500),data:c}){super({name:Vr,message:e,cause:o}),this[Ur]=!0,this.url=t,this.requestBodyValues=n,this.statusCode=r,this.responseHeaders=i,this.responseBody=a,this.isRetryable=s,this.data=c}static isInstance(e){return z.hasMarker(e,Hr)}},Gr=`AI_EmptyResponseBodyError`,Kr=`vercel.ai.error.${Gr}`,qr=Symbol.for(Kr),Jr=class extends z{constructor({message:e=`Empty response body`}={}){super({name:Gr,message:e}),this[qr]=!0}static isInstance(e){return z.hasMarker(e,Kr)}},Yr=`AI_ExtractionUnsupportedFieldTypeError`,Xr=`vercel.ai.error.${Yr}`,Zr=Symbol.for(Xr),Qr=class extends z{constructor({fieldId:e,fieldType:t,provider:n,modelId:r,message:i=`Field "${e}" has type "${t}", which is not supported by provider "${n}" and model "${r}".`}){super({name:Yr,message:i}),this[Zr]=!0,this.fieldId=e,this.fieldType=t,this.provider=n,this.modelId=r}static isInstance(e){return z.hasMarker(e,Xr)}};function $r(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.toString():JSON.stringify(e)}var ei=`AI_InvalidArgumentError`,ti=`vercel.ai.error.${ei}`,ni=Symbol.for(ti),ri=class extends z{constructor({message:e,cause:t,argument:n}){super({name:ei,message:e,cause:t}),this[ni]=!0,this.argument=n}static isInstance(e){return z.hasMarker(e,ti)}},ii=`AI_InvalidPromptError`,ai=`vercel.ai.error.${ii}`,oi=Symbol.for(ai),si=class extends z{constructor({prompt:e,message:t,cause:n}){super({name:ii,message:`Invalid prompt: ${t}`,cause:n}),this[oi]=!0,this.prompt=e}static isInstance(e){return z.hasMarker(e,ai)}},ci=`AI_InvalidResponseDataError`,li=`vercel.ai.error.${ci}`,ui=Symbol.for(li),di=class extends z{constructor({data:e,message:t=`Invalid response data: ${JSON.stringify(e)}.`}){super({name:ci,message:t}),this[ui]=!0,this.data=e}static isInstance(e){return z.hasMarker(e,li)}},fi=`AI_JSONParseError`,pi=`vercel.ai.error.${fi}`,mi=Symbol.for(pi),hi=class extends z{constructor({text:e,cause:t}){super({name:fi,message:`JSON parsing failed: Text: ${e}.\nError message: ${$r(t)}`,cause:t}),this[mi]=!0,this.text=e}static isInstance(e){return z.hasMarker(e,pi)}},gi=`AI_LoadAPIKeyError`,_i=`vercel.ai.error.${gi}`,vi=Symbol.for(_i),yi=class extends z{constructor({message:e}){super({name:gi,message:e}),this[vi]=!0}static isInstance(e){return z.hasMarker(e,_i)}},bi=`AI_NoSuchModelError`,xi=`vercel.ai.error.${bi}`,Si=Symbol.for(xi),Ci=class extends z{constructor({errorName:e=bi,modelId:t,modelType:n,message:r=`No such ${n}: ${t}`}){super({name:e,message:r}),this[Si]=!0,this.modelId=t,this.modelType=n}static isInstance(e){return z.hasMarker(e,xi)}},wi=`AI_NoSuchProviderReferenceError`,Ti=`vercel.ai.error.${wi}`,Ei=Symbol.for(Ti),Di=class extends z{constructor({provider:e,reference:t,message:n=`No provider reference found for provider '${e}'. Available providers: ${Object.keys(t).join(`, `)}`}){super({name:wi,message:n}),this[Ei]=!0,this.provider=e,this.reference=t}static isInstance(e){return z.hasMarker(e,Ti)}},Oi=`AI_TooManyEmbeddingValuesForCallError`,ki=`vercel.ai.error.${Oi}`,Ai=Symbol.for(ki),ji=class extends z{constructor(e){super({name:Oi,message:`Too many values for a single embedding call. The ${e.provider} model "${e.modelId}" can only embed up to ${e.maxEmbeddingsPerCall} values per call, but ${e.values.length} values were provided.`}),this[Ai]=!0,this.provider=e.provider,this.modelId=e.modelId,this.maxEmbeddingsPerCall=e.maxEmbeddingsPerCall,this.values=e.values}static isInstance(e){return z.hasMarker(e,ki)}},Mi=`AI_TypeValidationError`,Ni=`vercel.ai.error.${Mi}`,Pi=Symbol.for(Ni),Fi=class e extends z{constructor({value:e,cause:t,context:n}){let r=`Type validation failed`;if(n?.field&&(r+=` for ${n.field}`),n?.entityName||n?.entityId){r+=` (`;let e=[];n.entityName&&e.push(n.entityName),n.entityId&&e.push(`id: "${n.entityId}"`),r+=e.join(`, `),r+=`)`}super({name:Mi,message:`${r}: Value: ${JSON.stringify(e)}.\nError message: ${$r(t)}`,cause:t}),this[Pi]=!0,this.value=e,this.context=n}static isInstance(e){return z.hasMarker(e,Ni)}static wrap({value:t,cause:n,context:r}){return e.isInstance(n)&&n.value===t&&n.context?.field===r?.field&&n.context?.entityName===r?.entityName&&n.context?.entityId===r?.entityId?n:new e({value:t,cause:n,context:r})}},Ii=`AI_UnsupportedFunctionalityError`,Li=`vercel.ai.error.${Ii}`,Ri=Symbol.for(Li),zi=class extends z{constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:Ii,message:t}),this[Ri]=!0,this.functionality=e}static isInstance(e){return z.hasMarker(e,Li)}};function Bi(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Vi(e,t=`|`){return e.map(e=>ma(e)).join(t)}function Hi(e,t){return typeof t==`bigint`?t.toString():t}var Ui=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function Wi(e){return new Ui(e)}function Gi(e){return e==null}function Ki(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function qi(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var Ji=Symbol(`evaluating`);function Yi(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ji)return r===void 0&&(r=Ji,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Xi(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Zi(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function Qi(e){return Zi(e._zod.def)??e._zod.def.shape}function $i(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return Xi(this,t,e),e},enumerable:!0,configurable:!0})}function ea(e,t,n){t in e?Xi(e,t,n):e[t]=n}function ta(e,t,n,r){let i=Qi(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?$i(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):ea(e,a,r?r(n.value,a):n.value))}}function na(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?$i(e,n,()=>t[n]):ea(e,n,r.value))}}function ra(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ia(e){return JSON.stringify(e)}function aa(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var oa=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function sa(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var ca=Wi(()=>{if(ao.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function la(e){if(sa(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return sa(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ua(e){return la(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var da=new Set([`string`,`number`,`symbol`]);function fa(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function pa(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function B(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function ma(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ha(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var ga={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},_a={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function va(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return ta(i,e,ya(e,t)),pa(e,ra(n,{shape:i,checks:[]}))}function ya(e,t){let n=Qi(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function ba(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(ya(e,t)),a={};return ta(a,e,Reflect.ownKeys(Qi(e)).filter(e=>!i.has(e))),pa(e,ra(n,{shape:a,checks:[]}))}function xa(e,t){if(!la(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=Qi(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return pa(e,ra(e._zod.def,{shape:Sa(e,t)}))}function Sa(e,t){let n={};return ta(n,e,Reflect.ownKeys(Qi(e))),na(n,t),n}function Ca(e,t){if(!la(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return pa(e,ra(e._zod.def,{shape:Sa(e,t)}))}function wa(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return ta(n,e,Reflect.ownKeys(Qi(e))),ta(n,t,Reflect.ownKeys(Qi(t))),pa(e,ra(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Ta(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(ya(t,n)):void 0,o={};return ta(o,t,Reflect.ownKeys(Qi(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),pa(t,ra(t._zod.def,{shape:o,checks:[]}))}function Ea(e,t,n){let r=n?new Set(ya(t,n)):void 0,i={};return ta(i,t,Reflect.ownKeys(Qi(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),pa(t,ra(t._zod.def,{shape:i}))}function Da(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Oa(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function ka(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Aa(e){return typeof e==`string`?e:e?.message}function ja(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Ma(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Na(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Aa(e.inst?._zod.def?.error?.(e))??Aa(a?.(e))??Aa(t?.error?.(e))??Aa(n.customError?.(e))??Aa(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var Pa=/[\uD800-\uDBFF]/;function Fa(e){let t=e.length;if(!Pa.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Ia(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function La(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Ra(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function za(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Ua(e,n,r.value)}}function Ba(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Va(e,t,n){return Ba(e,t,n,!1)}function Ha(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Ba(this,n,r(this))},set(e){Ba(this,n,e)}})}return t}function Ua(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Ba(this,t,n.bind(this))},set(e){Ba(this,t,e)}})}function Wa(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Ga,Ka=!1,qa={configurable:!0,get(){Ka=!0}};function Ja(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&Ga!==e._zod?Ga=void 0:(Ga=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,qa);let e=Ka;Ka=!1;try{let r=n(this);return Ka?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Ka||=e,r}catch(n){throw delete this[t],Ka||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function Ya(e,t,n,r){let i=Wa(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var Xa=`~constantCatch`;function Za(e){let t=()=>e;return t[Xa]=!0,t}var Qa,$a=Object.freeze({status:`aborted`}),eo={value:void 0,enumerable:!1},to=`captureStackTrace`in Error?Error:null;function no(e){let t=to;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return to=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function V(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){eo.value=new a(r);try{Object.defineProperty(n,"_zod",eo)}finally{eo.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),za(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?no(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var ro=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},io=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Qa=globalThis).__zod_globalConfig??(Qa.__zod_globalConfig={});var ao=globalThis.__zod_globalConfig;function oo(e){return e&&Object.assign(ao,e),ao}function so(){let e=this._zod;return e.message??=JSON.stringify(e.def,Hi,2),e.message}function co(e){this._zod.message=e}var lo={get:so,set:co,enumerable:!0,configurable:!0},uo={value:void 0,enumerable:!1},fo=new WeakSet([Object.prototype,Error.prototype]),po=(e,t)=>{e.name=`$ZodError`,uo.value=t,Object.defineProperty(e,"issues",uo),uo.value=void 0,Object.defineProperty(e,"message",lo);let n=Object.getPrototypeOf(e);fo.has(n)||(fo.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},mo=V(`$ZodError`,po),ho=V(`$ZodError`,po,void 0,{Parent:Error});function go(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function _o(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?go(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function vo(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function yo(e,t){return{callee:t?.callee??e,Err:t?.Err}}var bo=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new ro;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Na(e,o,oo())));throw oa(n,a?.callee??t),n}return s.value};return t},xo=bo(ho),So=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Na(e,o,oo())));throw oa(n,a?.callee??t),n}return s.value};return t},Co=So(ho),wo=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new ro;return a.issues.length?Eo(e,a.issues,i):{success:!0,data:a.value}},To=wo(ho);function Eo(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>Na(e,n,oo()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var Do=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?Eo(e,a.issues,i):{success:!0,data:a.value}},Oo=Do(ho),ko=Symbol.for(`zod.compile.invalid`),Ao=Symbol.for(`zod.compile.fallback`),jo=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==ko)return!0;if(r.definite===!0&&n===void 0)return!1}return Mo(e,t,n)});function Mo(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Ao]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new ro;return a.issues.length===0}var No=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},Po=e=>{let t=bo(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,yo(n,a))};return n},Fo=e=>{let t=bo(e),n=(e,r,i,a)=>t(e,r,i,yo(n,a));return n},Io=e=>{let t=So(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,yo(n,a))};return n},Lo=e=>{let t=So(e),n=async(e,r,i,a)=>await t(e,r,i,yo(n,a));return n},Ro=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return wo(e)(t,n,i)},zo=e=>(t,n,r)=>wo(e)(t,n,r),Bo=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Do(e)(t,n,i)},Vo=e=>async(t,n,r)=>Do(e)(t,n,r),Ho=/^[cC][0-9a-z]{6,}$/,Uo=/^[0-9a-z]+$/,Wo=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Go=/^[0-9a-vA-V]{20}$/,Ko=/^[A-Za-z0-9]{27}$/,qo=/^[a-zA-Z0-9_-]{21}$/;function Jo(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Yo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Xo=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Zo=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Qo=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,$o=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function es(){return new RegExp($o,`u`)}var ts=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ns=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,rs=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,is=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,as=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,os=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,ss=/^https?$/,cs=/^\+[1-9]\d{6,14}$/,ls=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function us(e){return RegExp(`^${e}$`)}var ds=us(ls);function fs(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ps(e){return RegExp(`^${fs(e)}$`)}function ms(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${fs({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${fs({precision:e.precision})}`:n;return RegExp(`^${ls}T(?:${r})$`)}var hs=/^[\s\S]{0,}$/,gs=/^-?\d+$/,_s=/^-?\d+(?:\.\d+)?$/,vs=/^(?:true|false)$/i,ys=/^null$/i,bs=/^[^A-Z]*$/,xs=/^[^a-z]*$/,Ss=V(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Cs=e=>{let t=e.value;return!Gi(t)&&t.length!==void 0},ws={number:`number`,bigint:`bigint`,object:`date`},Ts=V(`$ZodCheckLessThan`,(e,t)=>{Ss.init(e,t);let n=ws[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:ws[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Es=V(`$ZodCheckGreaterThan`,(e,t)=>{Ss.init(e,t);let n=ws[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:ws[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ds=V(`$ZodCheckMultipleOf`,(e,t)=>{Ss.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):qi(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Os=V(`$ZodCheckNumberFormat`,(e,t)=>{Ss.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=ga[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),ks=V(`$ZodCheckMaxLength`,(e,t)=>{var n;Ss.init(e,t),(n=e._zod.def).when??(n.when=Cs),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Fa(r):i)<=t.maximum)return;let a=Ia(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),As=V(`$ZodCheckMinLength`,(e,t)=>{var n;Ss.init(e,t),(n=e._zod.def).when??(n.when=Cs),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Fa(r):i)>=t.minimum)return;let a=Ia(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),js=V(`$ZodCheckLengthEquals`,(e,t)=>{var n;Ss.init(e,t),(n=e._zod.def).when??(n.when=Cs),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Fa(r):i;if(a===t.length)return;let o=Ia(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ms=V(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Ss.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Ns=V(`$ZodCheckRegex`,(e,t)=>{Ms.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ps=V(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=bs,Ms.init(e,t)}),Fs=V(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=xs,Ms.init(e,t)}),Is=V(`$ZodCheckIncludes`,(e,t)=>{Ss.init(e,t);let n=fa(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Ls=V(`$ZodCheckStartsWith`,(e,t)=>{Ss.init(e,t);let n=RegExp(`^${fa(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Rs=V(`$ZodCheckEndsWith`,(e,t)=>{Ss.init(e,t);let n=RegExp(`.*${fa(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function zs(e,t,n){e.issues.length&&t.issues.push(...ka(n,e.issues))}var Bs=V(`$ZodCheckProperties`,(e,t)=>{Ss.init(e,t),Va(e,Symbol.iterator,function*(){yield e});let n;e._zod.check=r=>{if(r.value==null){r.issues.push({expected:`object`,code:`invalid_type`,input:r.value,inst:e});return}n??=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]);let i=r.value,a;for(let[e,t]of n){let n=t._zod.run({value:i[e],issues:[]},{});n instanceof Promise?(a??=[],a.push(n.then(t=>zs(t,r,e)))):zs(n,r,e)}if(a)return Promise.all(a).then(()=>void 0)}}),Vs=V(`$ZodCheckOverwrite`,(e,t)=>{Ss.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Hs=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
20
20
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
@@ -152,7 +152,7 @@ At most 3 notes. Write claim and correction in the same language as the answer.`
152
152
 
153
153
  `):void 0,warnings:i}}function LB({part:e,warnings:t,mediaResolution:n}){if(e.data.type===`text`)return{type:`text`,text:e.data.text};let r=Vh(e.mediaType),i;switch(r){case`image`:i=`image`;break;case`audio`:i=`audio`;break;case`video`:i=`video`;break;case`application`:case`text`:i=`document`;break;default:i=void 0}if(i==null){t.push({type:`other`,message:`google.interactions: unsupported file media type "${e.mediaType}"; part dropped.`});return}let a=n!=null&&(i===`image`||i===`video`)?{resolution:n}:{},o=i===`video`?RB({part:e,warnings:t}):{};switch(e.data.type){case`data`:{let t=pv({part:e});return{type:i,data:ah(e.data.data),mime_type:t,...a,...o}}case`url`:return{type:i,uri:e.data.url.toString(),...Hh(e.mediaType)?{mime_type:e.mediaType}:{},...a,...o};case`reference`:{let t=mv({reference:e.data.reference,provider:`google`});return{type:i,uri:t,...Hh(e.mediaType)?{mime_type:e.mediaType}:{},...a,...o}}}}function RB({part:e,warnings:t}){let n=e.providerOptions?.google?.processing;if(n==null)return{};if(n===`agentic`||n===`static`)return{processing:n};if(typeof n==`object`&&!Array.isArray(n)&&n.type===`static`){let e=n;return{processing:{type:`static`,...typeof e.startOffset==`number`?{start_offset:`${e.startOffset}s`}:{},...typeof e.endOffset==`number`?{end_offset:`${e.endOffset}s`}:{},...typeof e.fps==`number`?{fps:e.fps}:{}}}}return t.push({type:`other`,message:`google.interactions: invalid providerOptions.google.processing on video file part; expected "agentic", "static", or a static processing configuration. Option dropped.`}),{}}function zB({prompt:e,previousInteractionId:t}){let n=[],r=new Set;for(let i of e)if(i.role===`assistant`){if(i.content.some(e=>e.providerOptions?.google?.interactionId===t)){for(let e of i.content)e.type===`tool-call`&&r.add(e.toolCallId);continue}n.push(i)}else if(i.role===`tool`){let e=i.content.filter(e=>e.type!==`tool-result`||!r.has(e.toolCallId));if(e.length===0)continue;n.push({...i,content:e})}else n.push(i);return n}function BB(e){try{let t=Lg(e);return typeof t==`object`&&t&&!Array.isArray(t)?t:{value:t}}catch{return{value:e}}}function VB({toolCallId:e,toolName:t,output:n,signature:r,warnings:i}){let a={type:`function_result`,call_id:e,name:t,...r==null?{}:{signature:r}};switch(n.type){case`text`:return{...a,result:n.value};case`json`:return{...a,result:JSON.stringify(n.value)};case`error-text`:return{...a,is_error:!0,result:n.value};case`error-json`:return{...a,is_error:!0,result:JSON.stringify(n.value)};case`execution-denied`:return{...a,is_error:!0,result:n.reason??`Tool execution denied by user.`};case`content`:{let e=[];for(let t of n.value)if(t.type===`text`)e.push({type:`text`,text:t.text});else if(t.type===`file`){if(Vh(t.mediaType)!==`image`){i.push({type:`other`,message:`google.interactions: tool-result file with mediaType "${t.mediaType}" is not supported (Interactions \`function_result.result\` accepts only text and image content); part dropped.`});continue}let n=HB({part:t,warnings:i});n!=null&&e.push(n)}else i.push({type:`other`,message:`google.interactions: tool-result content part type "${t.type}" is not supported; part dropped.`});return{...a,result:e}}}}function HB({part:e,warnings:t}){switch(e.data.type){case`data`:{let t=Hh(e.mediaType)?e.mediaType:pv({part:{type:`file`,mediaType:e.mediaType,data:e.data}});return{type:`image`,data:ah(e.data.data),mime_type:t}}case`url`:return{type:`image`,uri:e.data.url.toString(),...Hh(e.mediaType)?{mime_type:e.mediaType}:{}};case`reference`:return{type:`image`,uri:mv({reference:e.data.reference,provider:`google`}),...Hh(e.mediaType)?{mime_type:e.mediaType}:{}};case`text`:t.push({type:`other`,message:'google.interactions: tool-result image part with `data.type === "text"` is not representable as an image; part dropped.'});return}}function UB(e){if(e.length<2)return e;let t=[];for(let n of e){let e=t[t.length-1];if(n.type===`text`&&e!=null&&e.type===`text`&&e.annotations==null&&n.annotations==null){let r={type:`text`,text:`${e.text}\n\n${n.text}`};t[t.length-1]=r}else t.push(n)}return t}var WB=()=>G({modality:H().nullish(),tokens:U().nullish()}).loose(),GB=()=>G({total_input_tokens:U().nullish(),total_output_tokens:U().nullish(),total_thought_tokens:U().nullish(),total_cached_tokens:U().nullish(),total_tool_use_tokens:U().nullish(),total_tokens:U().nullish(),input_tokens_by_modality:W(WB()).nullish(),output_tokens_by_modality:W(WB()).nullish(),cached_tokens_by_modality:W(WB()).nullish(),tool_use_tokens_by_modality:W(WB()).nullish(),grounding_tool_count:W(G({type:H().nullish(),count:U().nullish()}).loose()).nullish()}).loose(),KB=()=>Zp([`in_progress`,`requires_action`,`completed`,`failed`,`cancelled`,`incomplete`]),qB=()=>Bp([G({type:K(`url_citation`),url:H().nullish(),title:H().nullish(),start_index:U().nullish(),end_index:U().nullish()}).loose(),G({type:K(`file_citation`),file_name:H().nullish(),document_uri:H().nullish(),url:H().nullish(),page_number:U().nullish(),media_id:H().nullish(),start_index:U().nullish(),end_index:U().nullish(),custom_metadata:Jp(H(),Np()).nullish()}).loose(),G({type:K(`place_citation`),name:H().nullish(),url:H().nullish(),place_id:H().nullish(),start_index:U().nullish(),end_index:U().nullish()}).loose(),G({type:H()}).loose()]),JB=()=>G({type:H(),text:H().nullish(),data:H().nullish(),mime_type:H().nullish()}).loose(),YB=()=>Bp([G({type:K(`text`),text:H(),annotations:W(qB()).nullish()}).loose(),G({type:K(`image`),data:H().nullish(),mime_type:H().nullish(),resolution:Zp([`low`,`medium`,`high`,`ultra_high`]).nullish(),uri:H().nullish()}).loose(),G({type:K(`video`),data:H().nullish(),mime_type:H().nullish(),uri:H().nullish()}).loose(),G({type:H()}).loose()]),XB=[`google_search_call`,`code_execution_call`,`url_context_call`,`file_search_call`,`google_maps_call`,`mcp_server_tool_call`],ZB=[`google_search_result`,`code_execution_result`,`url_context_result`,`file_search_result`,`google_maps_result`,`mcp_server_tool_result`],QB=()=>Bp([G({type:K(`user_input`),content:W(YB()).nullish()}).loose(),G({type:K(`model_output`),content:W(YB()).nullish()}).loose(),G({type:K(`function_call`),id:H(),name:H(),arguments:Jp(H(),Np()).nullish(),signature:H().nullish()}).loose(),G({type:K(`thought`),signature:H().nullish(),summary:W(JB()).nullish()}).loose(),G({type:K(`processing_call`),id:H(),signature:H().nullish()}).loose(),G({type:K(`processing_result`),call_id:H(),signature:H().nullish()}).loose(),G({type:Zp(XB),id:H(),arguments:Jp(H(),Np()).nullish(),name:H().nullish(),server_name:H().nullish(),search_type:H().nullish(),signature:H().nullish()}).loose(),G({type:Zp(ZB),call_id:H(),result:Np().nullish(),is_error:Dp().nullish(),name:H().nullish(),server_name:H().nullish(),signature:H().nullish()}).loose(),G({type:H()}).loose()]),$B=q(()=>J(G({id:H().nullish(),created:H().nullish(),updated:H().nullish(),status:KB(),model:H().nullish(),agent:H().nullish(),steps:W(QB()).nullish(),usage:GB().nullish(),service_tier:H().nullish(),previous_interaction_id:H().nullish(),response_modalities:W(H()).nullish()}).loose())),eV=q(()=>J((()=>{let e=KB(),t=qB(),n=JB(),r=G({event_type:K(`interaction.created`),event_id:H().nullish(),interaction:G({id:H().nullish(),created:H().nullish(),model:H().nullish(),agent:H().nullish(),status:e.nullish()}).loose()}).loose(),i=G({event_type:K(`step.start`),event_id:H().nullish(),index:U(),step:QB()}).loose(),a=G({type:K(`text`),text:H()}).loose(),o=G({type:K(`thought_summary`),content:n.nullish()}).loose(),s=G({type:K(`thought_signature`),signature:H().nullish()}).loose(),c=G({type:K(`arguments_delta`),arguments:H().nullish(),id:H().nullish(),signature:H().nullish()}).loose(),l=G({type:Zp([`text_annotation_delta`,`text_annotation`]),annotations:W(t).nullish()}).loose(),u=Bp([a,G({type:K(`image`),data:H().nullish(),mime_type:H().nullish(),resolution:Zp([`low`,`medium`,`high`,`ultra_high`]).nullish(),uri:H().nullish()}).loose(),G({type:K(`video`),data:H().nullish(),mime_type:H().nullish(),uri:H().nullish()}).loose(),o,s,c,l,G({type:Zp(XB),id:H().nullish(),arguments:Jp(H(),Np()).nullish(),name:H().nullish(),server_name:H().nullish(),search_type:H().nullish(),signature:H().nullish()}).loose(),G({type:Zp(ZB),call_id:H().nullish(),result:Np().nullish(),is_error:Dp().nullish(),name:H().nullish(),server_name:H().nullish(),signature:H().nullish()}).loose(),G({type:H()}).loose()]);return Bp([r,i,G({event_type:K(`step.delta`),event_id:H().nullish(),index:U(),delta:u}).loose(),G({event_type:K(`step.stop`),event_id:H().nullish(),index:U()}).loose(),G({event_type:K(`interaction.status_update`),event_id:H().nullish(),interaction_id:H().nullish(),status:e.nullish()}).loose(),G({event_type:K(`interaction.in_progress`),event_id:H().nullish(),interaction_id:H().nullish(),status:e.nullish()}).loose(),G({event_type:K(`interaction.requires_action`),event_id:H().nullish(),interaction_id:H().nullish(),status:e.nullish()}).loose(),G({event_type:K(`interaction.completed`),event_id:H().nullish(),interaction:G({id:H().nullish(),status:e.nullish(),usage:GB().nullish(),service_tier:H().nullish()}).loose()}).loose(),G({event_type:K(`error`),event_id:H().nullish(),error:G({code:H().nullish(),message:H().nullish()}).loose().nullish()}).loose(),G({event_type:H()}).loose()])})())),tV=q(()=>J(G({labels:Jp(H(),H()).nullish(),previousInteractionId:H().nullish(),store:Dp().nullish(),agent:H().nullish(),agentConfig:Bp([G({type:K(`dynamic`)}).loose(),G({type:K(`deep-research`),thinkingSummaries:Zp([`auto`,`none`]).nullish(),visualization:Zp([`off`,`auto`]).nullish(),collaborativePlanning:Dp().nullish()})]).nullish(),thinkingLevel:Zp([`minimal`,`low`,`medium`,`high`,`xhigh`]).nullish(),thinkingSummaries:Zp([`auto`,`none`]).nullish(),responseFormat:W(Bp([G({type:K(`text`),mimeType:H().nullish(),schema:Np().nullish()}).loose(),G({type:K(`image`),mimeType:H().nullish(),aspectRatio:Zp([`1:1`,`2:3`,`3:2`,`3:4`,`4:3`,`4:5`,`5:4`,`9:16`,`16:9`,`21:9`,`1:8`,`8:1`,`1:4`,`4:1`]).nullish(),imageSize:Zp([`1K`,`2K`,`4K`,`512`]).nullish()}).loose(),G({type:K(`audio`),mimeType:H().nullish()}).loose(),G({type:K(`video`),aspectRatio:Zp([`16:9`,`9:16`]).nullish(),resolution:Zp([`360p`,`720p`,`1080p`,`4k`]).nullish(),duration:H().nullish(),delivery:Zp([`inline`,`uri`]).nullish(),gcsUri:H().nullish()}).loose()])).nullish(),imageConfig:G({aspectRatio:Zp([`1:1`,`2:3`,`3:2`,`3:4`,`4:3`,`4:5`,`5:4`,`9:16`,`16:9`,`21:9`,`1:8`,`8:1`,`1:4`,`4:1`]).nullish(),imageSize:Zp([`1K`,`2K`,`4K`,`512`]).nullish()}).nullish(),mediaResolution:Zp([`low`,`medium`,`high`,`ultra_high`]).nullish(),responseModalities:W(Zp([`text`,`image`,`audio`,`video`,`document`])).nullish(),serviceTier:Zp([`flex`,`standard`,`priority`]).nullish(),systemInstruction:H().nullish(),signature:H().nullish(),interactionId:H().nullish(),pollingTimeoutMs:U().int().positive().nullish(),background:Dp().nullish(),environment:Bp([H(),G({type:K(`remote`),sources:W(Bp([G({type:K(`gcs`),source:H(),target:H().nullish()}),G({type:K(`repository`),source:H(),target:H().nullish()}),G({type:K(`inline`),content:H(),target:H()})])).nullish(),network:Bp([K(`disabled`),G({allowlist:W(G({domain:H(),transform:W(Jp(H(),H())).nullish()}))})]).nullish()})]).nullish()})));function nV({signature:e,interactionId:t,processingId:n,processingCallId:r}){let i={};return e!=null&&(i.signature=e),t!=null&&(i.interactionId=t),n!=null&&(i.processingId=n),r!=null&&(i.processingCallId=r),Object.keys(i).length>0?{providerMetadata:{google:i}}:{}}var rV=new Set([`google_search_call`,`code_execution_call`,`url_context_call`,`file_search_call`,`google_maps_call`,`mcp_server_tool_call`]),iV=new Set([`google_search_result`,`code_execution_result`,`url_context_result`,`file_search_result`,`google_maps_result`,`mcp_server_tool_result`]);function aV(e){return e.replace(/_call$/,``)}function oV(e){return e.replace(/_result$/,``)}function sV({steps:e,generateId:t,interactionId:n}){let r=[],i=!1;if(e==null)return{content:r,hasFunctionCall:i};for(let a of e){if(typeof a!=`object`||!a)continue;let e=a.type;if(typeof e==`string`)switch(e){case`user_input`:break;case`model_output`:{let e=a.content??[];for(let i of e){if(typeof i!=`object`||!i)continue;let e=i.type;if(e===`text`){let e=i.text??``,a=i.annotations;r.push({type:`text`,text:e,...nV({interactionId:n})});let o=kB({annotations:a,generateId:t});for(let e of o)r.push(e)}else if(e===`image`){let e=i;e.data!=null&&e.data.length>0?r.push({type:`file`,mediaType:e.mime_type??`image/png`,data:{type:`data`,data:e.data},...nV({interactionId:n})}):e.uri!=null&&e.uri.length>0&&r.push({type:`file`,mediaType:e.mime_type??`image/png`,data:{type:`url`,url:new URL(e.uri)},...nV({interactionId:n})})}else if(e===`video`){let e=i;e.data!=null&&e.data.length>0?r.push({type:`file`,mediaType:e.mime_type??`video/mp4`,data:{type:`data`,data:e.data},...nV({interactionId:n})}):e.uri!=null&&e.uri.length>0&&r.push({type:`file`,mediaType:e.mime_type??`video/mp4`,data:{type:`url`,url:new URL(e.uri)},...nV({interactionId:n})})}}break}case`thought`:{let e=a,t=(Array.isArray(e.summary)?e.summary:[]).filter(e=>e?.type===`text`&&typeof e.text==`string`).map(e=>e.text).join(`
154
154
  `);r.push({type:`reasoning`,text:t,...nV({signature:e.signature,interactionId:n})});break}case`processing_call`:{let e=a,i=e.id||t();r.push({type:`custom`,kind:`google.processing_call`,...nV({signature:e.signature,interactionId:n,processingId:i})});break}case`processing_result`:{let e=a,i=e.call_id||t();r.push({type:`custom`,kind:`google.processing_result`,...nV({signature:e.signature,interactionId:n,processingCallId:i})});break}case`function_call`:{i=!0;let e=a;r.push({type:`tool-call`,toolCallId:e.id,toolName:e.name,input:JSON.stringify(e.arguments??{}),...nV({signature:e.signature,interactionId:n})});break}default:if(rV.has(e)){let n=a,i=e===`mcp_server_tool_call`?n.name??`mcp_server_tool`:aV(e),o=JSON.stringify(n.arguments??{});r.push({type:`tool-call`,toolCallId:n.id||t(),toolName:i,input:o,providerExecuted:!0})}else if(iV.has(e)){let n=a,i=e===`mcp_server_tool_result`?n.name??`mcp_server_tool`:oV(e);r.push({type:`tool-result`,toolCallId:n.call_id||t(),toolName:i,result:n.result??null});let o=OB({block:a,generateId:t});for(let e of o)r.push(e)}}}return{content:r,hasFunctionCall:i}}var cV=()=>globalThis.fetch;async function lV({baseURL:e,interactionId:t,headers:n,fetch:r=cV()}){if(t==null||t.length===0)return;let i=`${e}/interactions/${encodeURIComponent(t)}/cancel`;try{let e=await r(i,{method:`POST`,headers:Th(Bm({"Content-Type":`application/json`},await Y(n)),_h()),body:`{}`});try{await e.text()}catch{}}catch{}}var uV=new Set([`completed`,`failed`,`cancelled`,`incomplete`]);function dV(e){return e!=null&&uV.has(e)}var fV=1e3,pV=1e4,mV=18e5;async function hV({baseURL:e,interactionId:t,headers:n,fetch:r,abortSignal:i,initialDelayMs:a=fV,maxDelayMs:o=pV,timeoutMs:s=mV}){if(t==null||t.length===0)throw Error(`google.interactions: cannot poll a background interaction without an id. The POST response did not include an interaction id.`);let c=Date.now(),l=a,u=`${e}/interactions/${encodeURIComponent(t)}`,d=()=>lV({baseURL:e,interactionId:t,headers:n,fetch:r});try{for(;;){if(i?.aborted)throw await d(),new DOMException(`Polling was aborted`,`AbortError`);if(Date.now()-c>s)throw Error(`google.interactions: timed out polling interaction ${t} after ${s}ms.`);await Hm(l,{abortSignal:i});let{value:e,rawValue:a,responseHeaders:f}=await _g({url:u,validateUrl:!1,headers:await Y(n),failedResponseHandler:RL,successfulResponseHandler:Uv($B),abortSignal:i,fetch:r});if(dV(e.status))return{response:e,rawResponse:a,responseHeaders:f};l=Math.min(l*2,o)}}catch(e){throw vh(e)&&await d(),e}}function gV({tools:e,toolChoice:t}){let n=[];if(t?.type===`none`)return{tools:void 0,toolChoice:void 0,toolWarnings:n};let r=e?.length?e:void 0;if(r==null)return{tools:void 0,toolChoice:void 0,toolWarnings:n};let i=[];for(let e of r)if(e.type===`function`)i.push({type:`function`,name:e.name,description:e.description??``,parameters:e.inputSchema});else if(e.type===`provider`){let t=e.args??{};switch(e.id){case`google.google_search`:{let e=t.searchTypes,n;if(typeof e==`object`&&e){let t=[];e.webSearch!=null&&t.push(`web_search`),e.imageSearch!=null&&t.push(`image_search`),t.length>0&&(n=t)}i.push({type:`google_search`,...n==null?{}:{search_types:n}});break}case`google.code_execution`:i.push({type:`code_execution`});break;case`google.url_context`:i.push({type:`url_context`});break;case`google.file_search`:i.push({type:`file_search`,...t.fileSearchStoreNames==null?{}:{file_search_store_names:t.fileSearchStoreNames},...t.topK==null?{}:{top_k:t.topK},...t.metadataFilter==null?{}:{metadata_filter:t.metadataFilter}});break;case`google.google_maps`:i.push({type:`google_maps`,...t.latitude==null?{}:{latitude:t.latitude},...t.longitude==null?{}:{longitude:t.longitude},...t.enableWidget==null?{}:{enable_widget:t.enableWidget}});break;case`google.computer_use`:i.push({type:`computer_use`,environment:t.environment??`browser`,...t.excludedPredefinedFunctions==null?{}:{excludedPredefinedFunctions:t.excludedPredefinedFunctions}});break;case`google.mcp_server`:i.push({type:`mcp_server`,...t.name==null?{}:{name:t.name},...t.url==null?{}:{url:t.url},...t.headers==null?{}:{headers:t.headers},...t.allowedTools==null?{}:{allowed_tools:t.allowedTools}});break;case`google.retrieval`:{let e=t.vertexAiSearchConfig??void 0;i.push({type:`retrieval`,...t.retrievalTypes==null?{retrieval_types:[`vertex_ai_search`]}:{retrieval_types:t.retrievalTypes},...e==null?{}:{vertex_ai_search_config:e}});break}default:n.push({type:`unsupported`,feature:`provider-defined tool ${e.id}`,details:`provider-defined tool ${e.id} is not supported by google.interactions; tool dropped.`})}}else n.push({type:`unsupported`,feature:`tool of type ${e.type}`,details:`Only function tools and google.* provider-defined tools are supported by google.interactions; tool dropped.`});let a=i.some(e=>e.type===`function`),o;if(t!=null&&a)switch(t.type){case`auto`:o=`auto`;break;case`required`:o=`any`;break;case`tool`:o={allowed_tools:{mode:`validated`,tools:[t.toolName]}}}return{tools:i.length>0?i:void 0,toolChoice:o,toolWarnings:n}}var _V=3,vV=500;function yV({baseURL:e,interactionId:t,headers:n,fetch:r,abortSignal:i,maxRetries:a=_V,retryDelayMs:o=vV}){if(t.length===0)throw Error(`google.interactions: cannot stream a background interaction without an id.`);let s,c=!1,l=0,u=!1,d,f=new AbortController,p=()=>f.abort();i!=null&&(i.aborted?f.abort():i.addEventListener(`abort`,p,{once:!0}));let m=f.signal;function h(){let n=`${e}/interactions/${encodeURIComponent(t)}`,r=new URLSearchParams({stream:`true`});return s!=null&&r.set(`last_event_id`,s),`${n}?${r.toString()}`}async function g(){let{value:e}=await _g({url:h(),validateUrl:!1,headers:{...await Y(n),accept:`text/event-stream`},failedResponseHandler:RL,successfulResponseHandler:Hv(eV),abortSignal:m,fetch:r});return e.getReader()}return new ReadableStream({async start(f){try{for(;!c&&!m.aborted;){if(d==null)try{d=await g(),u=!1}catch(e){if(vh(e)||m.aborted||(l++,l>=a)){f.error(e);return}await Hm(o*l,{abortSignal:m});continue}try{let{done:e,value:t}=await d.read();if(e){if(d=void 0,c)break;if(u)l=0;else{if(l++,l>=a){f.error(Error(`google.interactions: SSE stream closed without producing any events.`));return}await Hm(o*l,{abortSignal:m})}continue}if(u=!0,t.success){let e=t.value;typeof e.event_id==`string`&&e.event_id.length>0&&(s=e.event_id),(e.event_type===`interaction.completed`||e.event_type===`error`)&&(c=!0)}f.enqueue(t)}catch(e){if(vh(e)||m.aborted||(d=void 0,l++,l>=a)){f.error(e);return}await Hm(o*l,{abortSignal:m})}}f.close()}catch(e){f.error(e)}finally{i?.removeEventListener(`abort`,p),d?.cancel().catch(()=>{}),d=void 0,m.aborted&&!c&&await lV({baseURL:e,interactionId:t,headers:n,fetch:r})}},cancel(){f.abort(),d?.cancel().catch(()=>{}),d=void 0}})}function bV({response:e,warnings:t,generateId:n,includeRawChunks:r,headerServiceTier:i}){return new ReadableStream({start(a){a.enqueue({type:`stream-start`,warnings:t});let o=typeof e.id==`string`&&e.id.length>0?e.id:void 0,s,c=e.created;if(typeof c==`string`){let e=new Date(c);Number.isNaN(e.getTime())||(s=e)}a.enqueue({type:`response-metadata`,...o==null?{}:{id:o},modelId:e.model??void 0,...s?{timestamp:s}:{}}),r&&a.enqueue({type:`raw`,rawValue:e});let{content:l,hasFunctionCall:u}=sV({steps:e.steps??null,generateId:n,interactionId:o}),d=0,f=()=>`${o??`agent`}:${d++}`;for(let e of l)switch(e.type){case`text`:{let t=f(),n=e.providerMetadata;a.enqueue({type:`text-start`,id:t}),e.text.length>0&&a.enqueue({type:`text-delta`,id:t,delta:e.text}),a.enqueue({type:`text-end`,id:t,...n?{providerMetadata:n}:{}});break}case`reasoning`:{let t=f(),n=e.providerMetadata;a.enqueue({type:`reasoning-start`,id:t}),e.text.length>0&&a.enqueue({type:`reasoning-delta`,id:t,delta:e.text}),a.enqueue({type:`reasoning-end`,id:t,...n?{providerMetadata:n}:{}});break}case`tool-call`:{let t=e.providerMetadata;a.enqueue({type:`tool-input-start`,id:e.toolCallId,toolName:e.toolName,...e.providerExecuted?{providerExecuted:e.providerExecuted}:{}}),a.enqueue({type:`tool-input-delta`,id:e.toolCallId,delta:e.input}),a.enqueue({type:`tool-input-end`,id:e.toolCallId}),a.enqueue({type:`tool-call`,toolCallId:e.toolCallId,toolName:e.toolName,input:e.input,...e.providerExecuted?{providerExecuted:e.providerExecuted}:{},...t?{providerMetadata:t}:{}});break}case`tool-result`:a.enqueue({type:`tool-result`,toolCallId:e.toolCallId,toolName:e.toolName,result:e.result});break;case`source`:case`file`:a.enqueue(e)}let p=e.service_tier??i,m={unified:AB({status:e.status,hasFunctionCall:u}),raw:e.status},h={google:{...o==null?{}:{interactionId:o},...p==null?{}:{serviceTier:p}}};a.enqueue({type:`finish`,finishReason:m,usage:SB(e.usage),providerMetadata:h}),a.close()}})}var xV=class e{static[Lm](e){return{...ey({modelId:e.modelId,config:e.config}),agent:e.agent}}static[Rm](t){return new e(t.agent==null?t.modelId:{agent:t.agent},t.config)}constructor(e,t){this.specificationVersion=`v4`,typeof e==`string`?(this.modelId=e,this.agent=void 0):`managedAgent`in e?(this.modelId=e.managedAgent,this.agent=e.managedAgent):(this.modelId=e.agent,this.agent=e.agent),this.config=t}get provider(){return this.config.provider}get supportedUrls(){return this.config.supportedUrls?this.config.supportedUrls():{"image/*":[/^https?:\/\/.+/],"application/pdf":[/^https?:\/\/.+/],"audio/*":[/^https?:\/\/.+/],"video/*":[/^https?:\/\/(www\.)?youtube\.com\/watch\?v=.+/,/^https?:\/\/youtu\.be\/.+/,/^gs:\/\/.+/]}}async getArgs(e){let t=[],n=await ev({provider:`google`,providerOptions:e.providerOptions,schema:tV}),r=this.agent!=null;r||(e.frequencyPenalty!=null&&t.push({type:`unsupported`,feature:`frequencyPenalty`}),e.presencePenalty!=null&&t.push({type:`unsupported`,feature:`presencePenalty`}));let i=e.tools!=null&&e.tools.length>0,a,o;if(i){let n=gV({tools:e.tools,toolChoice:e.toolChoice});a=n.tools,o=n.toolChoice,t.push(...n.toolWarnings)}let s=[];if(e.responseFormat?.type===`json`){if(r)t.push({type:`other`,message:`google.interactions: structured output (responseFormat) is not supported when an agent is set; responseFormat will be ignored.`});else{let t={type:`text`,mime_type:`application/json`,...e.responseFormat.schema==null?{}:{schema:e.responseFormat.schema}};s.push(t)}}if(n?.responseFormat!=null)for(let e of n.responseFormat)e.type===`text`?s.push(SV({type:`text`,mime_type:e.mimeType??void 0,schema:e.schema??void 0})):e.type===`image`?s.push(SV({type:`image`,mime_type:e.mimeType??void 0,aspect_ratio:e.aspectRatio??void 0,image_size:e.imageSize??void 0})):e.type===`audio`?s.push(SV({type:`audio`,mime_type:e.mimeType??void 0})):e.type===`video`&&s.push(SV({type:`video`,aspect_ratio:e.aspectRatio??void 0,resolution:e.resolution??void 0,duration:e.duration??void 0,delivery:e.delivery??void 0,gcs_uri:e.gcsUri??void 0}));let{input:c,systemInstruction:l,warnings:u}=IB({prompt:e.prompt,previousInteractionId:n?.previousInteractionId??void 0,store:n?.store??void 0,mediaResolution:n?.mediaResolution??void 0});t.push(...u);let d=l,f=n?.systemInstruction??void 0;d!=null&&f!=null?t.push({type:`other`,message:`google.interactions: both AI SDK system message and providerOptions.google.systemInstruction were set; using the AI SDK system message.`}):d==null&&f!=null&&(d=f);let p;if(r){let r=[];e.temperature!=null&&r.push(`temperature`),e.topP!=null&&r.push(`topP`),e.topK!=null&&r.push(`topK`),e.frequencyPenalty!=null&&r.push(`frequencyPenalty`),e.presencePenalty!=null&&r.push(`presencePenalty`),e.seed!=null&&r.push(`seed`),e.stopSequences!=null&&e.stopSequences.length>0&&r.push(`stopSequences`),e.maxOutputTokens!=null&&r.push(`maxOutputTokens`),Dg(e.reasoning)&&r.push(`reasoning`),n?.thinkingLevel!=null&&r.push(`thinkingLevel`),n?.thinkingSummaries!=null&&r.push(`thinkingSummaries`),n?.imageConfig!=null&&r.push(`imageConfig`),r.length>0&&t.push({type:`other`,message:`google.interactions: ${r.join(`, `)} ${r.length===1?`is`:`are`} not supported when an agent is set; use providerOptions.google.agentConfig instead. Dropped from the request body.`}),p=void 0}else if(p=SV({temperature:e.temperature??void 0,top_p:e.topP??void 0,top_k:e.topK??void 0,seed:e.seed??void 0,stop_sequences:e.stopSequences!=null&&e.stopSequences.length>0?e.stopSequences:void 0,max_output_tokens:e.maxOutputTokens??void 0,thinking_level:Og({reasoning:e.reasoning,providerOptionsEffort:n?.thinkingLevel,effortMap:Object.fromEntries((kR(this.modelId).capabilities.language.reasoning.efforts??[]).map(e=>[e,e])),warnings:t}),thinking_summaries:n?.thinkingSummaries??void 0,tool_choice:o}),n?.imageConfig!=null){let e=s.some(e=>e.type===`image`);t.push({type:`other`,message:e?`google.interactions: providerOptions.google.imageConfig is deprecated and was ignored because providerOptions.google.responseFormat already supplies an image entry. Use responseFormat exclusively.`:`google.interactions: providerOptions.google.imageConfig is deprecated. Use providerOptions.google.responseFormat with a { type: "image", ... } entry instead.`}),e||s.push({type:`image`,mime_type:`image/png`,...n.imageConfig.aspectRatio==null?{}:{aspect_ratio:n.imageConfig.aspectRatio},...n.imageConfig.imageSize==null?{}:{image_size:n.imageConfig.imageSize}})}let m;if(r&&n?.agentConfig!=null){let e=n.agentConfig;e.type===`deep-research`?m=SV({type:`deep-research`,thinking_summaries:e.thinkingSummaries??void 0,visualization:e.visualization??void 0,collaborative_planning:e.collaborativePlanning??void 0}):e.type===`dynamic`&&(m={type:`dynamic`})}let h;if(n?.environment!=null){if(!r)t.push({type:`other`,message:`google.interactions: environment is only supported when an agent is set; environment will be omitted from the request body.`});else if(typeof n.environment==`string`)h=n.environment;else{let e=n.environment,t=e.sources?.map(e=>e.type===`inline`?{type:`inline`,content:e.content,target:e.target}:SV({type:e.type,source:e.source,target:e.target??void 0})),r;e.network===`disabled`?r=`disabled`:e.network!=null&&(r={allowlist:e.network.allowlist.map(e=>SV({domain:e.domain,transform:e.transform??void 0}))}),h=SV({type:`remote`,sources:t!=null&&t.length>0?t:void 0,network:r})}}return{args:Hz(SV({...r?{agent:this.agent}:{model:this.modelId},input:c,labels:n?.labels??void 0,system_instruction:d,tools:a,response_format:s.length>0?s:void 0,response_modalities:n?.responseModalities==null?void 0:n.responseModalities,previous_interaction_id:n?.previousInteractionId??void 0,service_tier:n?.serviceTier??void 0,store:n?.store??void 0,generation_config:p!=null&&Object.keys(p).length>0?p:void 0,agent_config:m,environment:h,background:n?.background??void 0})),warnings:t,isAgent:r,isBackground:n?.background===!0,pollingTimeoutMs:n?.pollingTimeoutMs??void 0}}async doGenerate(e){let{args:t,warnings:n,isAgent:r,isBackground:i,pollingTimeoutMs:a}=await this.getArgs(e),o=`${this.config.baseURL}/interactions`,s=async()=>Bm(await Y(this.config.headers),e.headers),{responseHeaders:c,value:l,rawValue:u}=await rv({url:o,headers:await Y(s),body:t,failedResponseHandler:RL,successfulResponseHandler:Uv($B),abortSignal:e.abortSignal,fetch:this.config.fetch});if((r||i)&&!dV(l.status)){let t=await hV({baseURL:this.config.baseURL,interactionId:l.id,headers:s,fetch:this.config.fetch,abortSignal:e.abortSignal,timeoutMs:a});l=t.response,u=t.rawResponse,c=t.responseHeaders??c}let d=typeof l.id==`string`&&l.id.length>0?l.id:void 0,{content:f,hasFunctionCall:p}=sV({steps:l.steps??null,generateId:this.config.generateId??hg,interactionId:d}),m={unified:AB({status:l.status,hasFunctionCall:p}),raw:l.status},h=l.service_tier??c?.[`x-gemini-service-tier`]??void 0,g=CB(l.usage),_={google:{...d==null?{}:{interactionId:d},...h==null?{}:{serviceTier:h},...g==null?{}:{outputTokensByModality:g}}},v;if(typeof l.created==`string`){let e=new Date(l.created);Number.isNaN(e.getTime())||(v=e)}return{content:f,finishReason:m,usage:SB(l.usage),warnings:n,providerMetadata:_,request:{body:t},response:{headers:c,body:u,...d==null?{}:{id:d},...v?{timestamp:v}:{},modelId:l.model??void 0}}}async doStream(e){let{args:t,warnings:n,isBackground:r,pollingTimeoutMs:i}=await this.getArgs(e),a=`${this.config.baseURL}/interactions`,o=async()=>Bm(await Y(this.config.headers),e.headers);if(r)return this.doStreamBackground({args:t,warnings:n,url:a,mergedHeaders:o,options:e,pollingTimeoutMs:i});let s=Hz({...t,stream:!0}),{responseHeaders:c,value:l}=await rv({url:a,headers:await Y(o),body:s,failedResponseHandler:RL,successfulResponseHandler:Hv(eV),abortSignal:e.abortSignal,fetch:this.config.fetch}),u=c?.[`x-gemini-service-tier`],d=FB({warnings:n,generateId:this.config.generateId??hg,includeRawChunks:e.includeRawChunks,serviceTier:u});return{stream:l.pipeThrough(d),request:{body:s},response:{headers:c}}}async doStreamBackground({args:e,warnings:t,url:n,mergedHeaders:r,options:i,pollingTimeoutMs:a}){let{responseHeaders:o,value:s}=await rv({url:n,headers:await Y(r),body:e,failedResponseHandler:RL,successfulResponseHandler:Uv($B),abortSignal:i.abortSignal,fetch:this.config.fetch}),c=s.id;if(c==null||c.length===0)throw Error(`google.interactions: background POST response did not include an interaction id; cannot stream the result.`);let l=o?.[`x-gemini-service-tier`];if(dV(s.status))return{stream:bV({response:s,warnings:t,generateId:this.config.generateId??hg,includeRawChunks:i.includeRawChunks,headerServiceTier:l}),request:{body:e},response:{headers:o}};let u=yV({baseURL:this.config.baseURL,interactionId:c,headers:r,fetch:this.config.fetch,abortSignal:i.abortSignal}),d=FB({warnings:t,generateId:this.config.generateId??hg,includeRawChunks:i.includeRawChunks,serviceTier:l});return{stream:u.pipeThrough(d),request:{body:e},response:{headers:o}}}};function SV(e){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}function CV(e){let t=new URL(e),n=t.pathname.split(`/`),r=n.at(-1);return(r===`v1beta`||r===`v1alpha`)&&(n.pop(),t.pathname=n.join(`/`)||`/`),t}function wV(e,t){let n=CV(e);return n.protocol=n.protocol===`https:`?`wss:`:`ws:`,n.pathname=`${n.pathname.replace(/\/$/,``)}/ws/${t}`,n}var TV=class{constructor(){this.turnCounter=0,this.inputTranscriptionCounter=0,this.inputTranscriptionBuffer=``,this.inputTranscriptionBoundary=`none`,this.preserveInputTranscriptionAcrossTurnComplete=!1,this.hasAudio=!1,this.hasText=!1,this.hasTranscript=!1,this.turnClosed=!1,this.inputAudioRate=16e3}get responseId(){return`google-resp-${this.turnCounter}`}get itemId(){return`google-item-${this.turnCounter}`}beginTurnIfClosed(){this.turnClosed&&(this.turnCounter++,this.hasAudio=!1,this.hasText=!1,this.hasTranscript=!1,this.turnClosed=!1,this.preserveInputTranscriptionAcrossTurnComplete=!1)}accumulateInputTranscription({text:e,finished:t}){if(!e){t===!0&&this.finishInputTranscription();return}let n=t!=null;this.inputTranscriptionBuffer!==``&&(this.inputTranscriptionBoundary===`interrupted`||this.inputTranscriptionBoundary===`turn-complete`&&!n)&&this.finishInputTranscription(),this.inputTranscriptionBoundary=`none`,this.inputTranscriptionBuffer+=e;let r={itemId:`google-input-${this.inputTranscriptionCounter}`,transcript:this.inputTranscriptionBuffer};return t===!0&&this.finishInputTranscription(),r}finishInputTranscription(){this.inputTranscriptionBuffer!==``&&(this.inputTranscriptionCounter++,this.inputTranscriptionBuffer=``)}parseServerEvent(e){let t=this.parseEvent(e),n=EV(e.usageMetadata);if(n==null)return t;let r=Array.isArray(t)?t:[t];if(r.some(e=>e.type===`response-done`)){let e=r.map(e=>e.type===`response-done`?{...e,usage:n}:e);return Array.isArray(t)?e:e[0]}let i={type:`custom`,rawType:`usageMetadata`,usage:n,raw:e};return r.length===1&&r[0].type===`custom`&&r[0].rawType===`usageMetadata`?i:[...r,i]}parseEvent(e){let t=e;if(t.setupComplete!=null)return{type:`session-created`,raw:e};if(t.toolCall!=null)return this.beginTurnIfClosed(),(t.toolCall.functionCalls??[]).flatMap(t=>{let n=JSON.stringify(t.args??{});return[{type:`function-call-arguments-delta`,responseId:this.responseId,itemId:this.itemId,callId:t.id,delta:n,raw:e},{type:`function-call-arguments-done`,responseId:this.responseId,itemId:this.itemId,callId:t.id,name:t.name,arguments:n,raw:e}]});if(t.toolCallCancellation!=null)return{type:`custom`,rawType:`toolCallCancellation`,raw:e};if(t.goAway!=null)return{type:`custom`,rawType:`goAway`,raw:e};if(t.sessionResumptionUpdate!=null)return{type:`custom`,rawType:`sessionResumptionUpdate`,raw:e};if(t.serverContent!=null)return this.parseServerContent(t.serverContent,e);if(t.inputTranscription!=null){let n=this.accumulateInputTranscription(t.inputTranscription);if(n!=null)return{type:`input-transcription-completed`,...n,raw:e}}return{type:`custom`,rawType:String(Object.keys(t)[0]),raw:e}}parseServerContent(e,t){let n=[];if(e.interrupted&&(this.inputTranscriptionBoundary=`interrupted`,this.preserveInputTranscriptionAcrossTurnComplete=!0,this.turnClosed=!0,n.push({type:`speech-started`,raw:t})),e.modelTurn?.parts){this.beginTurnIfClosed();for(let r of e.modelTurn.parts)r.inlineData?.data&&(this.hasAudio=!0,n.push({type:`audio-delta`,responseId:this.responseId,itemId:this.itemId,delta:r.inlineData.data,raw:t})),r.text&&(this.hasText=!0,n.push({type:`text-delta`,responseId:this.responseId,itemId:this.itemId,delta:r.text,raw:t}))}if(e.outputTranscription?.text&&(this.hasTranscript=!0,n.push({type:`audio-transcript-delta`,responseId:this.responseId,itemId:this.itemId,delta:e.outputTranscription.text,raw:t})),e.inputTranscription!=null){let r=this.accumulateInputTranscription(e.inputTranscription);r!=null&&n.push({type:`input-transcription-completed`,...r,raw:t})}return e.generationComplete&&n.push({type:`custom`,rawType:`generationComplete`,raw:t}),e.interactionStatus!=null&&n.push({type:`custom`,rawType:`interactionStatus`,raw:t}),e.waitingForInput&&n.push({type:`custom`,rawType:`waitingForInput`,raw:t}),e.turnComplete&&(this.hasAudio&&n.push({type:`audio-done`,responseId:this.responseId,itemId:this.itemId,raw:t}),this.hasText&&n.push({type:`text-done`,responseId:this.responseId,itemId:this.itemId,raw:t}),this.hasTranscript&&n.push({type:`audio-transcript-done`,responseId:this.responseId,itemId:this.itemId,raw:t}),n.push({type:`response-done`,responseId:this.responseId,status:`completed`,raw:t}),this.turnClosed=!0,this.preserveInputTranscriptionAcrossTurnComplete?this.preserveInputTranscriptionAcrossTurnComplete=!1:this.inputTranscriptionBoundary!==`interrupted`&&(this.inputTranscriptionBoundary=`turn-complete`)),n.length===0?{type:`custom`,rawType:`serverContent`,raw:t}:n.length===1?n[0]:n}serializeClientEvent(e,t){switch(e.type){case`session-update`:return e.config.inputAudioFormat?.rate!=null&&(this.inputAudioRate=e.config.inputAudioFormat.rate),{setup:MV(e.config,t)};case`input-audio-append`:return{realtimeInput:{audio:{data:e.audio,mimeType:`audio/pcm;rate=${this.inputAudioRate}`}}};case`input-audio-commit`:return{realtimeInput:{audioStreamEnd:!0}};case`input-audio-clear`:case`response-create`:case`response-cancel`:case`conversation-item-truncate`:return null;case`conversation-item-create`:{let t=e.item;switch(t.type){case`text-message`:return{realtimeInput:{text:t.text}};case`function-call-output`:return AV(t);case`audio-message`:return null}break}}return null}};function EV(e){if(e==null)return;let t=DV(e.promptTokensDetails),n=DV(e.responseTokensDetails);return OV({inputTokens:e.promptTokenCount==null?void 0:e.promptTokenCount+(e.toolUsePromptTokenCount??0),outputTokens:e.responseTokenCount==null?void 0:e.responseTokenCount+(e.thoughtsTokenCount??0),cachedInputTokens:e.cachedContentTokenCount,inputTextTokens:t.text,inputAudioTokens:t.audio,outputTextTokens:n.text,outputAudioTokens:n.audio})}function DV(e){if(e==null)return{};let t={};for(let n of e){let e=n.tokenCount;if(e==null)continue;let r=n.modality?.toUpperCase();r===`AUDIO`?t.audio=(t.audio??0)+e:r===`TEXT`&&(t.text=(t.text??0)+e)}return t}function OV(e){let t={};for(let[n,r]of Object.entries(e))r!=null&&(t[n]=r);return Object.keys(t).length>0?t:void 0}function kV(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:{output:e}}async function AV(e){let t=await Q_({text:e.output}),n=t.success?kV(t.value):{output:e.output};return{toolResponse:{functionResponses:[{id:e.callId,name:e.name,response:n}]}}}function jV(e){let t=e.split(`/`).at(-1)?.toLowerCase()??``;return/^gemini-\d+\.\d+-live\b.*thinking/.test(t)}function MV(e,t){let n={model:YL(t)},{google:r,...i}=e?.providerOptions??{},a=xg(r)?r:void 0,o={};o.responseModalities=e?.outputModalities==null?[`AUDIO`]:e.outputModalities.map(e=>e.toUpperCase()),e?.voice!=null&&(o.speechConfig={voiceConfig:{prebuiltVoiceConfig:{voiceName:e.voice}}}),n.generationConfig=o,e?.instructions!=null&&(n.systemInstruction={parts:[{text:e.instructions}]}),e?.tools!=null&&e.tools.length>0&&(n.tools=[{functionDeclarations:e.tools.map(e=>({name:e.name,description:e.description,parametersJsonSchema:e.parameters,...a?.defaultToolBehavior==null?{}:{behavior:a.defaultToolBehavior}}))}]),e?.inputAudioTranscription!=null&&(n.inputAudioTranscription={}),e?.outputAudioTranscription!=null&&(n.outputAudioTranscription={});let s=i.generationConfig,c=a?.thinkingConfig??(xg(s)&&xg(s.thinkingConfig)?s.thinkingConfig:void 0),l=jV(t)&&c?.thinkingLevel==null&&c?.thinkingBudget==null?{...c,thinkingLevel:`low`}:a?.thinkingConfig,u=()=>{if(l==null)return;let e=xg(n.generationConfig)?n.generationConfig:o;n.generationConfig={...e,thinkingConfig:l}};return e?.providerOptions==null?(u(),n):(Object.assign(n,i),a?.translationConfig!=null&&(n.generationConfig={...xg(n.generationConfig)?n.generationConfig:o,translationConfig:a.translationConfig}),u(),n)}var NV=`google.ai.generativelanguage.v1alpha.GenerativeService.BidiGenerateContentConstrained`,PV=`google.ai.generativelanguage.v1beta.GenerativeService.BidiGenerateContent`;function FV(e){let t=CV(e);return t.pathname=`${t.pathname.replace(/\/$/,``)}/v1alpha/auth_tokens`,t.toString()}function IV(e){return wV(e,NV).toString()}function LV(e){let t=CV(e);return t.protocol=t.protocol===`https:`?`wss:`:`ws:`,t.pathname=`${t.pathname.replace(/\/$/,``)}/ws/${PV}`,t.toString()}var RV=class{constructor(e,t){this.specificationVersion=`v4`,this.capabilities={conversation:`turn-based`,transports:[`websocket`],connections:[`client-secret-websocket`,`server-websocket`]},this.mapper=new TV,this.modelId=e,this.provider=t.provider,this.config=t}async doCreateClientSecret(e){let t=this.config.fetch??fetch,n=(await Y(this.config.headers))[`x-goog-api-key`];if(!n)throw Error(`Google Generative AI API key is required for realtime token creation.`);let r=Date.now(),i=(e.expiresAfterSeconds??60)*1e3,a=new Date(r+i).toISOString(),o=new Date(r+i+18e5).toISOString(),s=MV(e.sessionConfig,this.modelId),c=await t(`${FV(this.config.baseURL)}?key=${encodeURIComponent(n)}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({uses:0,expireTime:o,newSessionExpireTime:a,bidiGenerateContentSetup:s})});if(!c.ok){let e=await c.text();throw Error(`Google realtime auth token request failed: ${c.status} ${e}`)}let l=await c.json();return{token:l.name,url:IV(this.config.baseURL),expiresAt:l.expireTime?Math.floor(new Date(l.expireTime).getTime()/1e3):void 0}}getWebSocketConfig(e){return{url:`${e.url}?access_token=${encodeURIComponent(e.token)}`}}getServerWebSocketConfig(e){return this.assertConversationIntent(e),fv(this.config.headers,e=>({url:LV(this.config.baseURL),headers:Vm(e)}))}assertConversationIntent(e){if(e?.intent!=null&&e.intent!==`conversation`)throw Error(`Google realtime does not support the '${e.intent}' session intent.`)}parseServerEvent(e){return this.mapper.parseServerEvent(e)}createServerEventParser(){let e=new TV;return t=>e.parseServerEvent(t)}serializeClientEvent(e,t){return this.assertConversationIntent(t),this.mapper.serializeClientEvent(e,this.modelId)}buildSessionConfig(e,t){return this.assertConversationIntent(t),MV(e,this.modelId)}},zV=q(()=>J(G({languageCodes:W(H()).optional(),customVocabulary:W(H()).optional(),wordTimestamp:Dp().optional(),diarization:Dp().optional(),mode:Zp([`SMART`,`VERBATIM`]).optional(),streaming:G({automaticActivityDetection:G({disabled:Dp().optional()}).optional()}).optional()}))),BV=`google.ai.generativelanguage.v1beta.GenerativeService.BidiGenerateContent`,VV=3e3,HV=250;function UV(e,t){let n=wV(e,BV);return n.searchParams.set(`key`,t),n}function WV(e){return e.includes(`-live`)}var GV=class e{static[Lm](e){return ey({modelId:e.modelId,config:e.config})}static[Rm](t){return new e(t.modelId,t.config)}get provider(){return this.config.provider}constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion=`v4`}async parseOptions(e){return ev({provider:`google`,providerOptions:e,schema:zV})}async doGenerate(e){if(WV(this.modelId))throw new ri({argument:`modelId`,message:`Model '${this.modelId}' only supports streaming transcription. Use experimental_streamTranscribe, or a unary model such as 'gemini-3.5-transcribe'.`});let t=this.config._internal?.currentDate?.()??new Date,n=[],r=JV(await this.parseOptions(e.providerOptions)),i={model:this.modelId,input:[{type:`audio`,data:ah(e.audio),mime_type:e.mediaType}],...r==null?{}:{generation_config:{transcription_config:r}}},{value:a,responseHeaders:o,rawValue:s}=await rv({url:`${this.config.baseURL}/interactions`,headers:Bm(this.config.headers?await Y(this.config.headers):void 0,e.headers),body:i,failedResponseHandler:RL,successfulResponseHandler:Uv(QV),abortSignal:e.abortSignal,fetch:this.config.fetch}),c=``,l=[];for(let e of a.steps??[])for(let t of e.content??[])if(t.type===`text`&&t.text!=null){c+=t.text;for(let e of t.annotations??[]){if(e.type!==`word_info`)continue;let t=YV(e.start_offset),n=YV(e.end_offset);e.text!=null&&t!=null&&n!=null&&l.push({text:e.text,startSecond:t,endSecond:n})}}return{text:c,segments:l,language:void 0,durationInSeconds:void 0,warnings:n,...a.usage!=null&&{usage:a.usage},response:{timestamp:t,modelId:this.modelId,headers:o,body:s},...a.usage==null?{}:{providerMetadata:{google:{usage:a.usage}}}}}async doStream(e){if(!WV(this.modelId))throw new ri({argument:`modelId`,message:`Model '${this.modelId}' does not support streaming transcription. Use a live model such as 'gemini-3.5-transcribe-live'.`});let t=this.config._internal?.currentDate?.()??new Date,n=[],r=await this.parseOptions(e.providerOptions);XV(e.inputAudioFormat);let i=Bm(this.config.headers?await Y(this.config.headers):void 0,e.headers),a;for(let[e,t]of Object.entries(i))e.toLowerCase()===`x-goog-api-key`&&t!=null&&(a=t);if(a==null)throw Error(`Google Generative AI API key is required for streaming transcription.`);let o=Object.fromEntries(Object.entries(i).filter(([e])=>e.toLowerCase()!==`x-goog-api-key`)),s=r?.streaming?.automaticActivityDetection?.disabled===!0,c={model:YL(this.modelId),inputAudioTranscription:qV(r)??{},...s?{realtimeInputConfig:{automaticActivityDetection:{disabled:!0}}}:{}};return{request:{body:c},response:{timestamp:t,modelId:this.modelId},stream:KV({webSocket:this.config.webSocket,url:UV(this.config.baseURL,a),headers:o,setup:c,inputAudioRate:e.inputAudioFormat.rate??16e3,manualActivityDetection:s,finishGraceMs:this.config._internal?.finishGraceMs??VV,warnings:n,audio:e.audio,abortSignal:e.abortSignal,includeRawChunks:e.includeRawChunks})}}};function KV({webSocket:e,url:t,headers:n,setup:r,inputAudioRate:i,manualActivityDetection:a,finishGraceMs:o,warnings:s,audio:c,abortSignal:l,includeRawChunks:u}){let d=!1,f=()=>{};return new ReadableStream({start:p=>{let m,h,g,_=new Promise(e=>{g=e}),v=0,y=``,b=``,x=``,S,C=!1,w,T,E,D=0,O=()=>`google-segment-${v}`,k=()=>{T!=null&&(clearTimeout(T),T=void 0)},A=()=>{!d&&C&&(k(),T=setTimeout(()=>{T=void 0,te()},o))};f=e=>{k(),m==null?c.cancel().catch(()=>{}):m.cancel().catch(()=>{}),h?.close(e)};let j=e=>{d||(d=!0,f(),p.error(e))},M=()=>{if(y===``){if(x===``)return;y=x}x=``,p.enqueue({type:`transcript-final`,id:O(),text:y}),b+=b===``?y:` ${y}`,y=``,v++},ee=()=>D/(i*2)*1e3,N=()=>E?.type===`ACTIVITY_END`&&y===``&&x===``&&(E.audioOffsetMs??0)>=ee()-HV,te=()=>{d||(M(),d=!0,p.enqueue({type:`finish`,text:b,segments:[],language:S,durationInSeconds:void 0,usage:w,...w==null?{}:{providerMetadata:{google:{usageMetadata:w}}}}),p.close(),f(1e3))},ne=async e=>{a&&e.send(JSON.stringify({realtimeInput:{activityStart:{}}})),m=c.getReader();try{for(;;){let{done:t,value:n}=await m.read();if(t||d)break;let r=ah(n),a=r.endsWith(`==`)?2:+!!r.endsWith(`=`);D+=r.length*3/4-a,e.send(JSON.stringify({realtimeInput:{audio:{data:r,mimeType:`audio/pcm;rate=${i}`}}})),await Jm(e)}}finally{m.releaseLock(),m=void 0}d||(e.send(JSON.stringify({realtimeInput:a?{activityEnd:{}}:{audioStreamEnd:!0}})),C=!0,N()?te():A())};h=Ym({url:t,headers:n,webSocket:e,abortSignal:l,onAbort:j,onProcessingError:j,onOpen:e=>{p.enqueue({type:`stream-start`,warnings:s}),e.send(JSON.stringify({setup:r})),_.then(()=>d?void 0:ne(e)).catch(j)},onMessageText:async e=>{if(d)return;let t=await Q_({text:e});if(!t.success)return;let n=t.value;if(u&&p.enqueue({type:`raw`,rawValue:n}),n.setupComplete!=null&&g(),n.usageMetadata!=null&&(w=n.usageMetadata),n.voiceActivity?.type!=null){let e=YV(n.voiceActivity.audioOffset);E={type:n.voiceActivity.type,audioOffsetMs:e==null?void 0:e*1e3}}if(n.error!=null){j(Error(n.error.message??`Google Live API error`));return}let r=n.serverContent,i=r?.interimInputTranscription;i?.text&&(A(),x=i.text,p.enqueue({type:`transcript-partial`,id:O(),text:i.text}));let a=r?.inputTranscription??n.inputTranscription;a!=null&&(a.languageCode!=null&&(S=a.languageCode),a.text&&(A(),x=``,y+=a.text,p.enqueue({type:`transcript-delta`,id:O(),delta:a.text})),a.finished===!0&&M()),(r?.generationComplete||r?.turnComplete)&&M();let o=r?.interactionStatus;C&&(o===`IDLE`||o===`REQUIRES_ACTION`||r?.turnComplete===!0&&o==null||N())&&te()},onSocketError:()=>{j(Error(`Google Live transcription error`))},onClose:({code:e,reason:t})=>{d||(C?te():j(Error(`Google Live transcription WebSocket closed unexpectedly before finishing (code ${e??`unknown`}${t?`, reason: ${t}`:``}).`)))}})},cancel:()=>{d||(d=!0,f())}})}function qV(e){if(e==null)return;let t={};return e.languageCodes!=null&&(t.languageCodes=e.languageCodes),e.customVocabulary!=null&&(t.customVocabulary=e.customVocabulary),e.wordTimestamp!=null&&(t.wordTimestamp=e.wordTimestamp),e.diarization!=null&&(t.diarization=e.diarization),e.mode!=null&&(t.mode=e.mode),Object.keys(t).length>0?t:void 0}function JV(e){if(e==null)return;let t={};return e.languageCodes!=null&&(t.language_codes=e.languageCodes),e.customVocabulary!=null&&(t.custom_vocabulary=e.customVocabulary),(e.mode!=null||e.diarization===!0||e.wordTimestamp===!0)&&(t.mode={type:(e.mode??`VERBATIM`).toLowerCase(),...e.diarization===!0?{diarization_mode:`speaker`}:{},...e.wordTimestamp===!0?{timestamp_granularities:[`word`]}:{}}),Object.keys(t).length>0?t:void 0}function YV(e){if(e==null)return;let t=Number.parseFloat(e);return Number.isFinite(t)?t:void 0}function XV(e){if(e.type!==`audio/pcm`||e.rate!=null&&e.rate!==16e3)throw new ri({argument:`inputAudioFormat`,message:`The Gemini Live transcription API only supports 16kHz 16-bit PCM input audio.`})}var ZV=()=>G({type:H().nullish(),text:H().nullish(),speaker:H().nullish(),start_offset:H().nullish(),end_offset:H().nullish()}),QV=q(()=>J(G({status:H().nullish(),steps:W(G({type:H().nullish(),content:W(G({type:H().nullish(),text:H().nullish(),annotations:W(ZV()).nullish()})).nullish()})).nullish(),usage:Jp(H(),Dm()).nullish()}))),$V=q(()=>J(G({echoTargetLanguage:Dp().optional()}))),eH=`google.ai.generativelanguage.v1beta.GenerativeService.BidiGenerateContent`,tH=1e3,nH=24e3,rH=128;function iH(e,t){let n=wV(e,eH);return n.searchParams.set(`key`,t),n}var aH=class e{static[Lm](e){return ey({modelId:e.modelId,config:e.config})}static[Rm](t){return new e(t.modelId,t.config)}get provider(){return this.config.provider}constructor(e,t){this.specificationVersion=`v4`,this.modelId=e,this.config=t}async doStream(e){if(e.targetLanguage==null)throw new ri({argument:`targetLanguage`,message:`targetLanguage is required for translation model '${this.modelId}'.`});let t=this.config._internal?.currentDate?.()??new Date,n=await ev({provider:`google`,providerOptions:e.providerOptions,schema:$V}),r=[];uH(e.inputAudioFormat),e.sourceLanguage!=null&&r.push({type:`unsupported`,feature:`sourceLanguage`,details:`The Gemini Live translation API auto-detects the source language and does not accept a source language.`}),e.outputAudioFormat!=null&&r.push({type:`unsupported`,feature:`outputAudioFormat`,details:`The Gemini Live API always outputs 24kHz 16-bit PCM audio and does not accept an output audio format.`});let i=Bm(await Y(this.config.headers),e.headers),a;for(let[e,t]of Object.entries(i))e.toLowerCase()===`x-goog-api-key`&&t!=null&&(a=t);if(a==null)throw Error(`Google Generative AI API key is required for streaming translation.`);let o=Object.fromEntries(Object.entries(i).filter(([e])=>e.toLowerCase()!==`x-goog-api-key`)),s=lH({modelId:this.modelId,targetLanguage:e.targetLanguage,providerOptions:n});return{request:{body:s},response:{timestamp:t,modelId:this.modelId},stream:oH({webSocket:this.config.webSocket,url:iH(this.config.baseURL,a),headers:o,setup:s,inputAudioRate:e.inputAudioFormat.rate??16e3,finishGraceMs:this.config._internal?.finishGraceMs??tH,warnings:r,audio:e.audio,abortSignal:e.abortSignal,includeRawChunks:e.includeRawChunks})}}};function oH({webSocket:e,url:t,headers:n,setup:r,inputAudioRate:i,finishGraceMs:a,warnings:o,audio:s,abortSignal:c,includeRawChunks:l}){let u=!1,d=()=>{};return new ReadableStream({start:f=>{let p,m,h,g=new Promise(e=>{h=e}),_=0,v=``,y=``,b=``,x=``,S=!1,C,w=!1,T=!1,E=0,D,O=()=>`google-item-${_}`,k=()=>{D!=null&&(clearTimeout(D),D=void 0)},A=()=>{u||D!=null||(D=setTimeout(()=>{D=void 0,ee()},a))},j=()=>{w=!0,E=0,k()};d=e=>{k(),p==null?s.cancel().catch(()=>{}):p.cancel().catch(()=>{}),m?.close(e)};let M=e=>{u||(u=!0,d(),f.error(e))},ee=()=>{u||((y!==``||x!==``)&&N(),u=!0,f.enqueue({type:`finish`,sourceText:v,outputText:b,usage:C}),f.close(),d(1e3))},N=()=>{y!==``&&(f.enqueue({type:`source-transcript-final`,id:O(),text:y}),v+=y,y=``),x!==``&&(f.enqueue({type:`output-text-final`,id:O(),text:x}),b+=x,x=``),_++},te=async e=>{p=s.getReader();try{for(;;){let{done:t,value:n}=await p.read();if(t||u)break;e.send(JSON.stringify({realtimeInput:{audio:{data:ah(n),mimeType:`audio/pcm;rate=${i}`}}})),await Jm(e)}}finally{p.releaseLock(),p=void 0}u||(e.send(JSON.stringify({realtimeInput:{audioStreamEnd:!0}})),S=!0,T&&!w&&A())};m=Ym({url:t,headers:n,webSocket:e,abortSignal:c,onAbort:M,onProcessingError:M,onOpen:e=>{f.enqueue({type:`stream-start`,warnings:o}),e.send(JSON.stringify({setup:r})),g.then(()=>u?void 0:te(e)).catch(M)},onMessageText:async e=>{if(u)return;let t=await Q_({text:e});if(!t.success)return;let n=t.value;if(l&&f.enqueue({type:`raw`,rawValue:n}),n.setupComplete!=null&&h(),n.usageMetadata!=null&&(C=sH(C,n.usageMetadata)),n.error!=null){M(Error(n.error.message??`Google Live API error`));return}let r=n.serverContent?.inputTranscription?.text??n.inputTranscription?.text;r&&(j(),y+=r,f.enqueue({type:`source-transcript-delta`,id:O(),delta:r}));let i=n.serverContent;if(i!=null){for(let e of i.modelTurn?.parts??[])if(e.inlineData?.data){f.enqueue({type:`audio`,id:O(),audio:e.inlineData.data});let t=cH(e.inlineData.data);if(S&&t!=null){if(E+=t,E>=a){ee();return}}else j()}i.outputTranscription?.text&&(j(),x+=i.outputTranscription.text,f.enqueue({type:`output-text-delta`,id:O(),delta:i.outputTranscription.text})),i.turnComplete&&(N(),w=!1,T=!0,S&&A())}},onSocketError:()=>{M(Error(`Google Live translation error`))},onClose:({code:e,reason:t})=>{u||(D==null?M(Error(`Google Live translation WebSocket closed unexpectedly before finishing (code ${e??`unknown`}${t?`, reason: ${t}`:``}).`)):ee())}})},cancel:()=>{u||(u=!0,d())}})}function sH(e,t){let n=e?.inputAudioTokens,r=e?.outputAudioTokens;for(let e of t.promptTokensDetails??[])e.modality===`AUDIO`&&e.tokenCount!=null&&(n=(n??0)+e.tokenCount);for(let e of t.responseTokensDetails??[])e.modality===`AUDIO`&&e.tokenCount!=null&&(r=(r??0)+e.tokenCount);return n==null&&r==null?e:{...e,...n==null?{}:{inputAudioTokens:n},...r==null?{}:{outputAudioTokens:r}}}function cH(e){let t;try{t=$m(e)}catch{return}if(t.byteLength<2)return;let n=new DataView(t.buffer,t.byteOffset,t.byteLength),r=Math.floor(t.byteLength/2);for(let e=0;e<r;e++)if(Math.abs(n.getInt16(e*2,!0))>rH)return;return r/nH*1e3}function lH({modelId:e,targetLanguage:t,providerOptions:n}){return{model:YL(e),generationConfig:{responseModalities:[`AUDIO`],translationConfig:{targetLanguageCode:t,...n?.echoTargetLanguage==null?{}:{echoTargetLanguage:n.echoTargetLanguage}}},inputAudioTranscription:{},outputAudioTranscription:{}}}function uH(e){if(e.type!==`audio/pcm`||e.rate!=null&&e.rate!==16e3)throw new ri({argument:`inputAudioFormat`,message:`The Gemini Live translation API only supports 16kHz 16-bit PCM input audio.`})}var dH=`https://generativelanguage.googleapis.com/v1beta`,fH=/^https:\/\/generativelanguage\.googleapis\.com\/v1beta\/files\/.*$/,pH=[`text/html`,`text/css`,`text/plain`,`text/xml`,`text/csv`,`text/rtf`,`text/javascript`,`application/json`,`application/pdf`,`image/bmp`,`image/jpeg`,`image/png`,`image/webp`,`video/mp4`,`video/mpeg`,`video/quicktime`,`video/avi`,`video/x-flv`,`video/mpg`,`video/webm`,`video/wmv`,`video/3gpp`],mH=/^https:\/\/.*$/;function hH(e){return/(^|\/)gemini-/.test(e)&&!/(^|\/)gemini-2\.0/.test(e)}function gH(e={}){let t=Ty(e.baseURL)??dH,n=e.name??`google.generative-ai`,r=()=>fv(e.apiKey,t=>Th({"x-goog-api-key":wg({apiKey:t,environmentVariableName:`GOOGLE_GENERATIVE_AI_API_KEY`,description:`Google Generative AI`}),...e.headers},`ai-sdk-google/${HL}`)),i=(e,n=e==null||hH(e))=>({"*":[fH,RegExp(`^${t}/files/.*$`),RegExp(`^https://(?:www\\.)?youtube\\.com/watch\\?v=[\\w-]+(?:&[\\w=&.-]*)?$`),RegExp(`^https://youtu\\.be/[\\w-]+(?:\\?[\\w=&.-]*)?$`)],...n?Object.fromEntries(pH.map(e=>[e,[mH]])):{}}),a={provider:n,baseURL:t,headers:r,generateId:e.generateId??hg,fetch:e.fetch},o=e=>new XR(e,{...a,supportedUrls:()=>i(e)}),s=()=>new Oz({provider:`${n.replace(/\.generative-ai$/,``)}.batch`,maxLineBytes:e.batchResultDownloads?.maxLineBytes,config:a,supportedUrls:i(void 0,!1)}),c=i=>new GL(i,{provider:n,baseURL:t,headers:r,fetch:e.fetch}),l=(i,a={})=>new Yz(i,a,{provider:n,baseURL:t,headers:r,fetch:e.fetch}),u=()=>new Xz({provider:n,baseURL:t,headers:r,fetch:e.fetch}),d=i=>new cB(i,{provider:n,baseURL:t,headers:r,fetch:e.fetch,generateId:e.generateId??hg}),f=i=>new RV(i,{provider:`${n}.realtime`,baseURL:t,headers:r,fetch:e.fetch}),p=i=>new aH(i,{provider:`${n}.speech-translation`,baseURL:t,headers:r,webSocket:e.webSocket}),m=i=>new vB(i,{provider:`${n}.speech`,baseURL:t,headers:r,fetch:e.fetch}),h=i=>new GV(i,{provider:`${n}.transcription`,baseURL:t,headers:r,fetch:e.fetch,webSocket:e.webSocket}),g=Object.assign(e=>f(e),{getToken:async e=>{let t=await f(e.model).doCreateClientSecret({sessionConfig:e.sessionConfig,expiresAfterSeconds:e.expiresAfterSeconds});return{token:t.token,url:t.url,expiresAt:t.expiresAt}}}),_=i=>new xV(i,{provider:`${n}.interactions`,baseURL:t,headers:r,generateId:e.generateId??hg,fetch:e.fetch}),v=function(e){if(new.target)throw Error(`The Google Generative AI model function cannot be called with the new keyword.`);return o(e)};return v.specificationVersion=`v4`,v.languageModel=o,v.chat=o,v.generativeAI=o,v.decisionModel=i=>new BL(i,{provider:`${n.replace(/\.generative-ai$/,``)}.decision`,baseURL:t,headers:r,fetch:e.fetch}),v.evaluationModel=v.decisionModel,v.extractionModel=e=>new _P({model:o(e),provider:`${n.replace(/\.generative-ai$/,``)}.extraction`}),v.experimental_batch=s,v.embedding=c,v.embeddingModel=c,v.textEmbedding=c,v.textEmbeddingModel=c,v.image=l,v.imageModel=l,v.video=d,v.videoModel=d,v.experimental_realtime=g,v.files=u,v.speech=m,v.speechModel=m,v.transcription=h,v.transcriptionModel=h,v.translation=p,v.speechTranslationModel=p,v.interactions=_,v.tools=qz,v}gH();var _H={language:{user:{description:`A unique identifier representing your end-user, which can help providers to monitor and detect abuse.`},reasoningEffort:{description:'Reasoning effort for reasoning models. Defaults to `medium`. Set to `null` to send `"reasoning_effort": null`, for providers that treat an explicit `null` differently from an omitted field.'},textVerbosity:{description:"Controls the verbosity of the generated text. Defaults to `medium`."},strictJsonSchema:{description:`Whether to use strict JSON schema validation. When true, the model uses constrained decoding to guarantee schema compliance. Only used when the provider supports structured outputs and a schema is provided.`},echo:{description:`Echo back the prompt in addition to the completion.`},logitBias:{description:`Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100.`},suffix:{description:`The suffix that comes after a completion of inserted text.`}},embedding:{dimensions:{description:`The number of dimensions the resulting output embeddings should have. Only supported in text-embedding-3 and later models.`},user:{description:`A unique identifier representing your end-user, which can help providers to monitor and detect abuse.`}},image:{size:{description:`Dimensions of the generated image. Supported values depend on the provider and model.`},quality:{description:`Quality of the generated image. Supported values depend on the provider and model.`},output_format:{description:`File format of the generated image. Supported values depend on the provider and model.`},output_compression:{description:`Compression level for JPEG and WebP images.`},background:{description:`Background behavior for the generated image. Supported values depend on the provider and model.`}}},vH={embedding:{maxEmbeddingsPerCall:2048,supportsParallelCalls:!0},image:{maxImagesPerCall:10},language:{supportsStructuredOutputs:!1}};function yH(e){return{capabilities:{language:{inputs:{image:`unknown`,audio:`unknown`},objectGeneration:`unknown`,tools:{usage:`unknown`,streaming:`unknown`},reasoning:{support:`unknown`},sampling:{temperature:`unknown`,topP:`unknown`,logprobs:`unknown`}},image:{sizes:{description:`Depends on the configured backend and model.`},fileInput:`unknown`,maskInput:`unknown`,maxImagesPerCall:vH.image.maxImagesPerCall}},providerOptions:{language:Object.fromEntries(Object.keys(_H.language).map(e=>[e,`unknown`])),embedding:Object.fromEntries(Object.keys(_H.embedding).map(e=>[e,`unknown`])),image:Object.fromEntries(Object.keys(_H.image).map(e=>[e,`unknown`]))},requestConfig:vH}}yH(`*`);function bH(e){return e.replace(/[_-]([a-z])/g,e=>e[1].toUpperCase())}function xH(e,t){let n=bH(e);return n!==e&&t?.[n]!=null?n:e}function SH({rawName:e,providerOptions:t,warnings:n}){let r=bH(e);r!==e&&t?.[e]!=null&&n.push({type:`deprecated`,setting:`providerOptions key '${e}'`,message:`Use '${r}' instead.`})}var CH={errorSchema:G({error:G({message:H(),type:H().nullish(),param:jp().nullish(),code:Bp([H(),U()]).nullish()})}),errorToMessage:e=>e.error.message};function wH(e){if(e==null)return uh();let t=e.prompt_tokens??0,n=e.completion_tokens??0,r=e.prompt_tokens_details?.cached_tokens??0,i=e.completion_tokens_details?.reasoning_tokens??0;return{inputTokens:{total:t,noCache:t-r,cacheRead:r,cacheWrite:void 0},outputTokens:{total:n,text:Math.max(0,n-i),reasoning:i},raw:e}}function TH(e){return e?.providerOptions?.openaiCompatible??{}}function EH(e){switch(e){case`audio/wav`:return`wav`;case`audio/mp3`:case`audio/mpeg`:return`mp3`;default:return null}}function DH(e,t){let n=TH(e);switch(e.type){case`text`:return{type:`text`,text:e.text,...n};case`file`:switch(e.data.type){case`reference`:return{type:`file`,file:{file_id:mv({reference:e.data.reference,provider:t})},...n};case`text`:if(Vh(e.mediaType)===`text`)return{type:`text`,text:e.data.text,...n};throw new zi({functionality:`text file parts`});case`url`:case`data`:{let t=Vh(e.mediaType);if(t===`image`)return{type:`image_url`,image_url:{url:e.data.type===`url`?e.data.url.toString():`data:${pv({part:e})};base64,${ah(e.data.data)}`},...n};if(t===`video`)return{type:`video_url`,video_url:{url:e.data.type===`url`?e.data.url.toString():`data:${pv({part:e})};base64,${ah(e.data.data)}`},...n};if(t===`audio`){if(e.data.type===`url`)throw new zi({functionality:`audio file parts with URLs`});let t=pv({part:e}),r=EH(t);if(r===null)throw new zi({functionality:`audio media type ${t}`});return{type:`input_audio`,input_audio:{data:ah(e.data.data),format:r},...n}}if(t===`application`){if(e.data.type===`url`)throw new zi({functionality:`PDF file parts with URLs`});let t=pv({part:e});if(t!==`application/pdf`)throw new zi({functionality:`file part media type ${t}`});return{type:`file`,file:{filename:e.filename??`document.pdf`,file_data:`data:application/pdf;base64,${ah(e.data.data)}`},...n}}if(t===`text`)return{type:`text`,text:e.data.type===`url`?e.data.url.toString():typeof e.data.data==`string`?new TextDecoder().decode($m(e.data.data)):new TextDecoder().decode(e.data.data),...n};throw new zi({functionality:`file part media type ${e.mediaType}`})}}}}function OH(e,t){if(e.type===`custom`)throw new zi({functionality:`custom tool content parts`});return DH(e,t)}function kH(e){if(typeof e==`string`)try{return Lg(e),e}catch{return JSON.stringify(e)}return jy(e)}function AH(e,{provider:t=`openaiCompatible`,providerOptionsKey:n=`google`,supportsMultiPartToolContent:r=!1}={}){let i=[];for(let{role:a,content:o,...s}of e){let e=TH({...s});switch(a){case`system`:i.push({role:`system`,content:o,...e});break;case`user`:if(o.length===1&&o[0].type===`text`){i.push({role:`user`,content:o[0].text,...TH(o[0])});break}i.push({role:`user`,content:o.map(e=>DH(e,t)),...e});break;case`assistant`:{let t=``,r=``,a=[];for(let e of o){let i=TH(e);switch(e.type){case`text`:t+=e.text;break;case`reasoning`:r+=e.text;break;case`tool-call`:{let t=e.providerOptions?.[n]?.thoughtSignature??e.providerOptions?.google?.thoughtSignature;a.push({id:e.toolCallId,type:`function`,function:{name:e.toolName,arguments:kH(e.input)},...i,...t?{extra_content:{google:{thought_signature:String(t)}}}:{}});break}}}i.push({role:`assistant`,content:a.length>0?t||null:t,...r.length>0?{reasoning_content:r}:{},tool_calls:a.length>0?a:void 0,...e});break}case`tool`:for(let e of o){if(e.type===`tool-approval-response`)continue;let n=e.output,a;switch(n.type){case`text`:case`error-text`:a=n.value;break;case`execution-denied`:a=n.reason??`Tool call execution denied.`;break;case`json`:case`error-json`:a=jy(n.value);break;case`content`:a=r?n.value.map(e=>OH(e,t)):jy(n.value)}let o=TH(e);i.push({role:`tool`,tool_call_id:e.toolCallId,content:a,...o})}break;default:throw Error(`Unsupported role: ${a}`)}}return i}function jH({id:e,model:t,created:n}){return lh({id:e,model:t,created:n||void 0})}function MH(e,{hasRefusal:t=!1}={}){switch(e){case`stop`:return t?`content-filter`:`stop`;case`length`:return`length`;case`content_filter`:return`content-filter`;case`function_call`:case`tool_calls`:return`tool-calls`;default:return`other`}}var NH=G({user:H().optional(),reasoningEffort:H().nullish(),textVerbosity:H().optional(),strictJsonSchema:Dp().optional()});function PH({tools:e,toolChoice:t}){e=e?.length?e:void 0;let n=[];if(e==null)return{tools:void 0,toolChoice:void 0,toolWarnings:n};let r=[];for(let t of e)t.type===`provider`?n.push({type:`unsupported`,feature:`provider-defined tool ${t.id}`}):r.push({type:`function`,function:{name:t.name,description:t.description,parameters:t.inputSchema,...t.strict==null?{}:{strict:t.strict}}});if(t==null)return{tools:r,toolChoice:void 0,toolWarnings:n};let i=t.type;switch(i){case`auto`:case`none`:case`required`:return{tools:r,toolChoice:i,toolWarnings:n};case`tool`:return{tools:r,toolChoice:{type:`function`,function:{name:t.toolName}},toolWarnings:n};default:throw new zi({functionality:`tool choice type: ${i}`})}}var FH=class e{static[Lm](e){return ey({modelId:e.modelId,config:e.config})}static[Rm](t){return new e(t.modelId,t.config)}constructor(e,t){this.specificationVersion=`v4`,this.modelId=e,this.config=t;let n=t.errorStructure??CH;this.chunkSchema=VH(n.errorSchema),this.failedResponseHandler=Vv(n),this.supportsStructuredOutputs=t.supportsStructuredOutputs??vH.language.supportsStructuredOutputs}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(`.`)[0].trim()}get supportedUrls(){return this.config.supportedUrls?.()??{}}transformRequestBody(e,t){return this.config.transformRequestBody?.(e,t)??e}convertUsage(e){return this.config.convertUsage?.(e)??wH(e)}async getArgs({prompt:e,maxOutputTokens:t,temperature:n,topP:r,topK:i,frequencyPenalty:a,presencePenalty:o,reasoning:s,providerOptions:c,stopSequences:l,responseFormat:u,seed:d,toolChoice:f,tools:p}){let m=[],{options:h,namespaces:g}=await tv({providerOptions:c,namespaces:[`openai-compatible`,`openaiCompatible`,this.providerOptionsName,bH(this.providerOptionsName)],resolution:`merge`,schema:NH});g.includes(`openai-compatible`)&&m.push({type:`deprecated`,setting:`providerOptions key 'openai-compatible'`,message:`Use 'openaiCompatible' instead.`}),SH({rawName:this.providerOptionsName,providerOptions:c,warnings:m});let _=h??{},v=_?.strictJsonSchema??!0;i!=null&&m.push({type:`unsupported`,feature:`topK`}),u?.type===`json`&&u.schema!=null&&!this.supportsStructuredOutputs&&m.push({type:`unsupported`,feature:`responseFormat`,details:`JSON response format schema is only supported with structuredOutputs`});let{tools:y,toolChoice:b,toolWarnings:x}=PH({tools:p,toolChoice:f}),S=xH(this.providerOptionsName,c),C=_.reasoningEffort===void 0?Dg(s)?this.config.mapReasoning==null?s:this.config.mapReasoning({reasoning:s,warnings:m}):void 0:_.reasoningEffort;return{metadataKey:S,args:{model:this.modelId,user:_.user,max_tokens:t,temperature:n,top_p:r,frequency_penalty:a,presence_penalty:o,response_format:u?.type===`json`?this.supportsStructuredOutputs===!0&&u.schema!=null?{type:`json_schema`,json_schema:{schema:u.schema,strict:v,name:u.name??`response`,description:u.description}}:{type:`json_object`}:void 0,stop:l,seed:d,...Object.fromEntries(Object.entries({...c?.[this.providerOptionsName],...c?.[bH(this.providerOptionsName)]}).filter(([e])=>!Object.keys(NH.shape).includes(e))),...C===void 0?{}:{reasoning_effort:C},..._.textVerbosity===void 0?{}:{verbosity:_.textVerbosity},messages:AH(e,{provider:this.providerOptionsName,providerOptionsKey:S,supportsMultiPartToolContent:this.config.supportsMultiPartToolContent}),tools:y,tool_choice:b},warnings:[...m,...x]}}async prepareRequest(e){let{body:t,warnings:n}=await this.prepareGenerateRequest(e);return{body:t,warnings:n}}async convertResponse({body:e,providerOptions:t}){let n=await Y_({value:e,schema:zH});return{...await this.convertGenerateResponse({response:n,rawResponse:e,metadataKey:xH(this.providerOptionsName,t)}),warnings:[]}}async prepareGenerateRequest(e){let{args:t,warnings:n,metadataKey:r}=await this.getArgs({...e});return{body:this.transformRequestBody(t,n),warnings:n,metadataKey:r}}async convertGenerateResponse({response:e,rawResponse:t,metadataKey:n}){let r=e.choices[0];if(r==null)throw new di({data:t,message:`Response did not contain any choices.`});let i=[],a=r.message.reasoning_content??r.message.reasoning;a!=null&&a.length>0&&i.push({type:`reasoning`,text:a}),i.push(...RH(r.message.content));let o=r.message.refusal,s=o!=null&&o.length>0;if(s&&i.push({type:`text`,text:o}),r.message.tool_calls!=null)for(let e of r.message.tool_calls){let t=e.extra_content?.google?.thought_signature;i.push({type:`tool-call`,toolCallId:e.id||hg(),toolName:e.function.name,input:e.function.arguments,...t?{providerMetadata:{[n]:{thoughtSignature:t}}}:{}})}let c={[n]:{},...await this.config.metadataExtractor?.extractMetadata?.({parsedBody:t})},l=e.usage?.completion_tokens_details;return l?.accepted_prediction_tokens!=null&&(c[n].acceptedPredictionTokens=l?.accepted_prediction_tokens),l?.rejected_prediction_tokens!=null&&(c[n].rejectedPredictionTokens=l?.rejected_prediction_tokens),{content:i,finishReason:{unified:MH(r.finish_reason,{hasRefusal:s}),raw:r.finish_reason??void 0},usage:this.convertUsage(e.usage),providerMetadata:c,response:jH(e)}}async doGenerate(e){let{body:t,warnings:n,metadataKey:r}=await this.prepareGenerateRequest(e),i=JSON.stringify(t),{responseHeaders:a,value:o,rawValue:s}=await rv({url:this.config.url({path:`/chat/completions`,modelId:this.modelId}),headers:Bm(await Y(this.config.headers),e.headers),body:t,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:Uv(zH),abortSignal:e.abortSignal,fetch:this.config.fetch}),c=await this.convertGenerateResponse({response:o,rawResponse:s,metadataKey:r});return{...c,request:{body:i},response:{...c.response,headers:a,body:s},warnings:n}}async doStream(e){let{args:t,warnings:n,metadataKey:r}=await this.getArgs({...e}),i=this.transformRequestBody({...t,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0},n),a=this.config.metadataExtractor?.createStreamExtractor(),{responseHeaders:o,value:s}=await rv({url:this.config.url({path:`/chat/completions`,modelId:this.modelId}),headers:Bm(await Y(this.config.headers),e.headers),body:i,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:Hv(this.chunkSchema),abortSignal:e.abortSignal,fetch:this.config.fetch}),c=r,l,u=new Map,d=new Set,f=e=>{let t=e.index;if(t==null||d.has(t)){l.processDelta(e);return}let n=u.get(t);n==null?(n={id:e.id??null,bufferedArguments:``,extraContent:e.extra_content??null},u.set(t,n)):(n.id==null&&e.id!=null&&(n.id=e.id),n.extraContent==null&&e.extra_content!=null&&(n.extraContent=e.extra_content));let r=e.function?.arguments;r!=null&&(n.bufferedArguments+=r);let i=e.function?.name;if(i!=null){let e={index:t,id:n.id,function:{name:i,arguments:n.bufferedArguments},extra_content:n.extraContent??void 0};l.processDelta(e),u.delete(t),d.add(t)}},p,m,h,g=!1,_=!1,v=!1,y=!1,b=e=>this.convertUsage(e);return{stream:s.pipeThrough(new TransformStream({start(e){l=new hy(e,{generateId:hg,extractMetadata:e=>{let t=e.extra_content?.google?.thought_signature;return t?{[c]:{thoughtSignature:t}}:void 0},buildToolCallProviderMetadata:e=>e}),e.enqueue({type:`stream-start`,warnings:n})},transform(t,n){if(e.includeRawChunks&&n.enqueue({type:`raw`,rawValue:t.rawValue}),!t.success){p={unified:`error`,raw:void 0},m=void 0,n.enqueue({type:`error`,error:t.error});return}if(a?.processChunk(t.rawValue),`error`in t.value){p={unified:`error`,raw:void 0},m=void 0,n.enqueue({type:`error`,error:t.value.error});return}let r=t.value;if(!g){let e=jH(r);Object.values(e).some(Boolean)&&(g=!0,n.enqueue({type:`response-metadata`,...e}))}r.usage!=null&&(h=r.usage);let i=r.choices[0];if(i?.finish_reason!=null&&(m=i.finish_reason),i?.delta==null)return;let o=i.delta,s=e=>{v&&=(n.enqueue({type:`text-end`,id:`txt-0`}),!1),_||=(n.enqueue({type:`reasoning-start`,id:`reasoning-0`}),!0),n.enqueue({type:`reasoning-delta`,id:`reasoning-0`,delta:e})},c=e=>{_&&=(n.enqueue({type:`reasoning-end`,id:`reasoning-0`}),!1),v||=(n.enqueue({type:`text-start`,id:`txt-0`}),!0),n.enqueue({type:`text-delta`,id:`txt-0`,delta:e})},l=o.reasoning_content??o.reasoning;l&&s(l);for(let e of RH(o.content))e.type===`reasoning`?s(e.text):c(e.text);let u=o.refusal;if(u!=null&&u.length>0&&(y=!0,c(u)),o.tool_calls!=null&&o.tool_calls.length>0){_&&=(n.enqueue({type:`reasoning-end`,id:`reasoning-0`}),!1);for(let e of o.tool_calls)f(e)}},flush(e){_&&e.enqueue({type:`reasoning-end`,id:`reasoning-0`}),v&&e.enqueue({type:`text-end`,id:`txt-0`});for(let[e,t]of u)l.processDelta({index:e,id:t.id,function:{arguments:t.bufferedArguments}});u.clear(),l.flush(),m!=null&&(p={unified:MH(m,{hasRefusal:y}),raw:m}),p??(p={unified:`error`,raw:void 0},e.enqueue({type:`error`,error:new di({data:void 0,message:`Response stream ended without a finish reason.`})}));let t={[c]:{},...a?.buildMetadata()};h?.completion_tokens_details?.accepted_prediction_tokens!=null&&(t[c].acceptedPredictionTokens=h?.completion_tokens_details?.accepted_prediction_tokens),h?.completion_tokens_details?.rejected_prediction_tokens!=null&&(t[c].rejectedPredictionTokens=h?.completion_tokens_details?.rejected_prediction_tokens),e.enqueue({type:`finish`,finishReason:p,usage:b(h),providerMetadata:t})}})),request:{body:i},response:{headers:o}}}},IH=()=>Rp({prompt_tokens:U().nullish(),completion_tokens:U().nullish(),total_tokens:U().nullish(),prompt_tokens_details:Rp({cached_tokens:U().nullish()}).nullish(),completion_tokens_details:Rp({reasoning_tokens:U().nullish(),accepted_prediction_tokens:U().nullish(),rejected_prediction_tokens:U().nullish()}).nullish()}).nullish(),LH=()=>Bp([H(),W(Rp({type:H()}))]).nullish();function RH(e){if(e==null)return[];if(typeof e==`string`)return e.length>0?[{type:`text`,text:e}]:[];let t=[];for(let n of e)if(n.type===`text`&&typeof n.text==`string`)n.text.length>0&&t.push({type:`text`,text:n.text});else if(n.type===`thinking`&&Array.isArray(n.thinking)){let e=n.thinking.filter(e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`text`&&`text`in e&&typeof e.text==`string`).map(e=>e.text).join(``);e.length>0&&t.push({type:`reasoning`,text:e})}return t}var zH=q(()=>J(Rp({id:H().nullish(),created:U().nullish(),model:H().nullish(),choices:W(G({message:G({role:K(`assistant`).nullish(),content:LH(),refusal:Np().nullish().transform(e=>typeof e==`string`?e:void 0),reasoning_content:H().nullish(),reasoning:H().nullish(),tool_calls:W(G({id:H().nullish(),function:G({name:H(),arguments:H()}),extra_content:G({google:G({thought_signature:H().nullish()}).nullish()}).nullish()})).nullish()}),finish_reason:H().nullish()})),usage:IH()}))),BH=()=>Rp({id:H().nullish(),created:U().nullish(),model:H().nullish(),choices:W(G({delta:G({role:Zp([`assistant`,``]).nullish(),content:LH(),refusal:Np().nullish().transform(e=>typeof e==`string`?e:void 0),reasoning_content:H().nullish(),reasoning:H().nullish(),tool_calls:W(G({index:U().nullish(),id:H().nullish(),function:G({name:H().nullish(),arguments:H().nullish()}),extra_content:G({google:G({thought_signature:H().nullish()}).nullish()}).nullish()})).nullish()}).nullish(),finish_reason:H().nullish()})),usage:IH()}),VH=e=>Bp([BH(),e]);function HH(e){if(e==null)return uh();let t=e.prompt_tokens??0,n=e.completion_tokens??0;return{inputTokens:{total:t,noCache:t,cacheRead:void 0,cacheWrite:void 0},outputTokens:{total:n,text:n,reasoning:void 0},raw:e}}function UH({prompt:e,user:t=`user`,assistant:n=`assistant`}){let r=``;e[0].role===`system`&&(r+=`${e[0].content}\n\n`,e=e.slice(1));for(let{role:i,content:a}of e)switch(i){case`system`:throw new si({message:`Unexpected system message in prompt: ${a}`,prompt:e});case`user`:{let e=a.map(e=>{if(e.type===`text`)return e.text}).filter(Boolean).join(``);r+=`${t}:\n${e}\n\n`;break}case`assistant`:{let e=a.map(e=>{switch(e.type){case`text`:return e.text;case`tool-call`:throw new zi({functionality:`tool-call messages`})}}).join(``);r+=`${n}:\n${e}\n\n`;break}case`tool`:throw new zi({functionality:`tool messages`});default:throw Error(`Unsupported role: ${i}`)}return r+=`${n}:\n`,{prompt:r,stopSequences:[`\n${t}:`]}}function WH(e){switch(e){case`stop`:return`stop`;case`length`:return`length`;case`content_filter`:return`content-filter`;case`function_call`:case`tool_calls`:return`tool-calls`;default:return`other`}}var GH=q(()=>J(G({echo:Dp().optional(),logitBias:Jp(H(),U()).optional(),suffix:H().optional(),user:H().optional()}))),KH=class e{static[Lm](e){return ey({modelId:e.modelId,config:e.config})}static[Rm](t){return new e(t.modelId,t.config)}constructor(e,t){this.specificationVersion=`v4`,this.modelId=e,this.config=t;let n=t.errorStructure??CH;this.chunkSchema=YH(n.errorSchema),this.failedResponseHandler=Vv(n)}get provider(){return this.config.provider}get providerOptionsName(){return this.config.provider.split(`.`)[0].trim()}get supportedUrls(){return this.config.supportedUrls?.()??{}}async getArgs({prompt:e,maxOutputTokens:t,temperature:n,topP:r,topK:i,frequencyPenalty:a,presencePenalty:o,stopSequences:s,responseFormat:c,seed:l,providerOptions:u,tools:d,toolChoice:f}){let p=[];SH({rawName:this.providerOptionsName,providerOptions:u,warnings:p});let m=Object.assign(await ev({provider:this.providerOptionsName,providerOptions:u,schema:GH})??{},await ev({provider:bH(this.providerOptionsName),providerOptions:u,schema:GH})??{});i!=null&&p.push({type:`unsupported`,feature:`topK`}),d?.length&&p.push({type:`unsupported`,feature:`tools`}),f!=null&&p.push({type:`unsupported`,feature:`toolChoice`}),c!=null&&c.type!==`text`&&p.push({type:`unsupported`,feature:`responseFormat`,details:`JSON response format is not supported.`});let{prompt:h,stopSequences:g}=UH({prompt:e}),_=[...g??[],...s??[]];return{args:{model:this.modelId,echo:m.echo,logit_bias:m.logitBias,suffix:m.suffix,user:m.user,max_tokens:t,temperature:n,top_p:r,frequency_penalty:a,presence_penalty:o,seed:l,...u?.[this.providerOptionsName],...u?.[bH(this.providerOptionsName)],prompt:h,stop:_.length>0?_:void 0},warnings:p}}async doGenerate(e){let{args:t,warnings:n}=await this.getArgs(e),{responseHeaders:r,value:i,rawValue:a}=await rv({url:this.config.url({path:`/completions`,modelId:this.modelId}),headers:Bm(await Y(this.config.headers),e.headers),body:t,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:Uv(JH),abortSignal:e.abortSignal,fetch:this.config.fetch}),o=i.choices[0],s=[];return o.text!=null&&o.text.length>0&&s.push({type:`text`,text:o.text}),{content:s,usage:HH(i.usage),finishReason:{unified:WH(o.finish_reason),raw:o.finish_reason},request:{body:t},response:{...lh(i),headers:r,body:a},warnings:n}}async doStream(e){let{args:t,warnings:n}=await this.getArgs(e),r={...t,stream:!0,stream_options:this.config.includeUsage?{include_usage:!0}:void 0},{responseHeaders:i,value:a}=await rv({url:this.config.url({path:`/completions`,modelId:this.modelId}),headers:Bm(await Y(this.config.headers),e.headers),body:r,failedResponseHandler:this.failedResponseHandler,successfulResponseHandler:Hv(this.chunkSchema),abortSignal:e.abortSignal,fetch:this.config.fetch}),o={unified:`other`,raw:void 0},s,c=!0;return{stream:a.pipeThrough(new TransformStream({start(e){e.enqueue({type:`stream-start`,warnings:n})},transform(t,n){if(e.includeRawChunks&&n.enqueue({type:`raw`,rawValue:t.rawValue}),!t.success){o={unified:`error`,raw:void 0},n.enqueue({type:`error`,error:t.error});return}let r=t.value;if(`error`in r){o={unified:`error`,raw:void 0},n.enqueue({type:`error`,error:r.error});return}c&&(c=!1,n.enqueue({type:`response-metadata`,...lh(r)}),n.enqueue({type:`text-start`,id:`0`})),r.usage!=null&&(s=r.usage);let i=r.choices[0];i?.finish_reason!=null&&(o={unified:WH(i.finish_reason),raw:i.finish_reason??void 0}),i?.text!=null&&n.enqueue({type:`text-delta`,id:`0`,delta:i.text})},flush(e){c||e.enqueue({type:`text-end`,id:`0`}),e.enqueue({type:`finish`,finishReason:o,usage:HH(s)})}})),request:{body:r},response:{headers:i}}}},qH=()=>Rp({prompt_tokens:U(),completion_tokens:U(),total_tokens:U()}),JH=q(()=>J(G({id:H().nullish(),created:U().nullish(),model:H().nullish(),choices:W(G({text:H(),finish_reason:H()})),usage:qH().nullish()}))),YH=e=>Bp([G({id:H().nullish(),created:U().nullish(),model:H().nullish(),choices:W(G({text:H(),finish_reason:H().nullish(),index:U()})),usage:qH().nullish()}),e]),XH=q(()=>J(G({dimensions:U().optional(),user:H().optional()}))),ZH=class e{get provider(){return this.config.provider}get maxEmbeddingsPerCall(){return this.config.maxEmbeddingsPerCall??vH.embedding.maxEmbeddingsPerCall}get supportsParallelCalls(){return this.config.supportsParallelCalls??vH.embedding.supportsParallelCalls}static[Lm](e){return ey({modelId:e.modelId,config:e.config})}static[Rm](t){return new e(t.modelId,t.config)}constructor(e,t){this.specificationVersion=`v4`,this.modelId=e,this.config=t}get providerOptionsName(){return this.config.provider.split(`.`)[0].trim()}async doEmbed({values:e,dimensions:t,headers:n,abortSignal:r,providerOptions:i}){let a=[],o=await ev({provider:`openai-compatible`,providerOptions:i,schema:XH});o!=null&&a.push({type:`deprecated`,setting:`providerOptions key 'openai-compatible'`,message:`Use 'openaiCompatible' instead.`}),SH({rawName:this.providerOptionsName,providerOptions:i,warnings:a});let s=Object.assign(o??{},await ev({provider:`openaiCompatible`,providerOptions:i,schema:XH})??{},await ev({provider:this.providerOptionsName,providerOptions:i,schema:XH})??{});if(e.length>this.maxEmbeddingsPerCall)throw new ji({provider:this.provider,modelId:this.modelId,maxEmbeddingsPerCall:this.maxEmbeddingsPerCall,values:e});let{responseHeaders:c,value:l,rawValue:u}=await rv({url:this.config.url({path:`/embeddings`,modelId:this.modelId}),headers:Bm(await Y(this.config.headers),n),body:{model:this.modelId,input:e,encoding_format:`float`,dimensions:s.dimensions??t,user:s.user},failedResponseHandler:Vv(this.config.errorStructure??CH),successfulResponseHandler:Uv(QH),abortSignal:r,fetch:this.config.fetch});return{warnings:a,embeddings:l.data.map(e=>e.embedding),usage:l.usage?{tokens:l.usage.prompt_tokens}:void 0,providerMetadata:l.providerMetadata,response:{headers:c,body:u}}}},QH=q(()=>J(G({data:W(G({embedding:W(U())})),usage:G({prompt_tokens:U()}).nullish(),providerMetadata:Jp(H(),Jp(H(),jp())).optional()}))),$H=class e{get provider(){return this.config.provider}get providerOptionsKey(){return this.config.provider.split(`.`)[0].trim()}static[Lm](e){return ey({modelId:e.modelId,config:e.config})}static[Rm](t){return new e(t.modelId,t.config)}constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion=`v4`,this.maxImagesPerCall=vH.image.maxImagesPerCall,this.supportsFileInputs=void 0,this.supportsMaskInputs=void 0}getArgs(e,t){return SH({rawName:this.providerOptionsKey,providerOptions:e,warnings:t}),{...e[this.providerOptionsKey],...e[bH(this.providerOptionsKey)]}}async doGenerate({prompt:e,n:t,size:n,aspectRatio:r,seed:i,providerOptions:a,headers:o,abortSignal:s,files:c,mask:l}){let u=[];r!=null&&u.push({type:`unsupported`,feature:`aspectRatio`,details:"This model does not support aspect ratio. Use `size` instead."}),i!=null&&u.push({type:`unsupported`,feature:`seed`});let d=this.config._internal?.currentDate?.()??new Date,f=this.getArgs(a,u),p=c!=null&&c.length>0,m=this.config.url({path:p?`/images/edits`:`/images/generations`,modelId:this.modelId}),h=Bm(await Y(this.config.headers),o);if(p){let{value:r,responseHeaders:i}=await iv({url:m,headers:h,formData:ch({model:this.modelId,prompt:e,image:await Promise.all(c.map(e=>nU(e,this.config.fetch))),mask:l==null?void 0:await nU(l,this.config.fetch),n:t,size:n,...f}),failedResponseHandler:Vv(this.config.errorStructure??CH),successfulResponseHandler:Uv(tU),abortSignal:s,fetch:this.config.fetch});return{images:await this.getImages(r.data,{url:m,headers:o,abortSignal:s}),warnings:u,usage:eU(r.usage),response:{timestamp:d,modelId:this.modelId,headers:i}}}let{value:g,responseHeaders:_}=await rv({url:m,headers:h,body:{model:this.modelId,prompt:e,n:t,size:n,...f},failedResponseHandler:Vv(this.config.errorStructure??CH),successfulResponseHandler:Uv(tU),abortSignal:s,fetch:this.config.fetch});return{images:await this.getImages(g.data,{url:m,headers:o,abortSignal:s}),warnings:u,usage:eU(g.usage),response:{timestamp:d,modelId:this.modelId,headers:_}}}async getImages(e,t){return e.every(e=>e.b64_json!=null)?e.map(e=>e.b64_json):Promise.all(e.map(async e=>{if(e.b64_json!=null)return $m(e.b64_json);if(e.url==null)throw new di({data:e,message:`Expected url in the image response`});let{value:n}=await _g({url:e.url,validateUrl:!0,trustedOrigin:t.url,credentialedOrigin:t.url,headers:Bm(await Y(this.config.headers),t.headers),abortSignal:t.abortSignal,fetch:this.config.fetch,successfulResponseHandler:Kv(),failedResponseHandler:Jv()});return n}))}};function eU(e){return e==null?void 0:{inputTokens:e.input_tokens??void 0,outputTokens:e.output_tokens??void 0,totalTokens:e.total_tokens??void 0}}var tU=q(()=>J(G({data:W(G({b64_json:H().nullish(),url:H().nullish()}).refine(e=>e.b64_json!=null||e.url!=null,{message:`Expected b64_json or url in the image response`})),usage:G({input_tokens:U().nullish(),output_tokens:U().nullish(),total_tokens:U().nullish()}).nullish()})));async function nU(e,t){if(e.type===`url`)return ug(e.url,{fetch:t});let n=e.data instanceof Uint8Array?e.data:$m(e.data);return new Blob([n],{type:e.mediaType})}var rU=`3.0.94`;function iU(e){let t=Ty(e.baseURL),n=e.name,r=e.apiKey,i={...e.headers},a=()=>fv(r,e=>Th({...e&&{Authorization:`Bearer ${e}`},...i},`ai-sdk-openai-compatible/${rU}`)),o=r=>({provider:`${n}.${r}`,url:({path:n})=>{let r=new URL(`${t}${n}`);return e.queryParams&&(r.search=new URLSearchParams(e.queryParams).toString()),r.toString()},headers:a,fetch:e.fetch}),s=e=>c(e),c=t=>new FH(t,{...o(`chat`),includeUsage:e.includeUsage,supportsStructuredOutputs:e.supportsStructuredOutputs,supportsMultiPartToolContent:e.supportsMultiPartToolContent,supportedUrls:e.supportedUrls,transformRequestBody:e.transformRequestBody,metadataExtractor:e.metadataExtractor,convertUsage:e.convertUsage}),l=t=>new KH(t,{...o(`completion`),includeUsage:e.includeUsage}),u=e=>new ZH(e,{...o(`embedding`)}),d=e=>new $H(e,o(`image`)),f=e=>s(e);return f.specificationVersion=`v4`,f.languageModel=s,f.chatModel=c,f.completionModel=l,f.embeddingModel=u,f.textEmbeddingModel=u,f.imageModel=d,f}var aU=`dissentry.settings`,oU={userName:``,autoCheck:!0,proxyMode:`system`,proxyUrl:``,proxyBypass:``},sU=new Set,cU=(()=>{try{let e={...oU,...JSON.parse(localStorage.getItem(aU)??`{}`)};return e.userName===`You`&&(e.userName=``),e}catch{return oU}})(),lU=()=>cU;function uU(e){cU={...cU,...e},localStorage.setItem(aU,JSON.stringify(cU)),sU.forEach(e=>e())}function dU(){return(0,y.useSyncExternalStore)(e=>(sU.add(e),()=>sU.delete(e)),lU)}function fU(e,t){return e.userName.trim()||t}var pU=`x-dissentry-target`,mU=null,hU=null,gU=()=>hU;async function _U(){if(mU!==null)return mU;try{let e=await fetch(`/api/health`,{cache:`no-store`}),t=e.ok?await e.json():{};mU=t.proxy===!0,hU=t.systemProxy??null}catch{mU=!1}return mU}var vU=()=>mU===!0;function yU(e){return typeof e==`string`?e:e instanceof URL?e.toString():e.url}var bU=async(e,t)=>{let n=new Headers(t?.headers??(e instanceof Request?e.headers:void 0));n.set(pU,yU(e));let r=lU();return r.proxyMode===`direct`?n.set(`x-dissentry-proxy`,`direct`):r.proxyMode===`custom`&&r.proxyUrl.trim()&&(n.set(`x-dissentry-proxy`,r.proxyUrl.trim()),r.proxyBypass.trim()&&n.set(`x-dissentry-proxy-bypass`,r.proxyBypass.trim())),fetch(`/api/proxy`,{...t,method:t?.method??(e instanceof Request?e.method:`GET`),headers:n,body:t?.body??(e instanceof Request?e.body:void 0)})},xU=e=>e.useProxy&&vU()?bU:fetch,SU=e=>e.replace(/\/+$/,``);function CU(e,t){let n=t??xU(e),r=SU(e.baseUrl);switch(e.protocol){case`anthropic`:return FL({apiKey:e.apiKey,baseURL:r,fetch:n,headers:{"anthropic-dangerous-direct-browser-access":`true`}})(e.modelId);case`google`:return gH({apiKey:e.apiKey,baseURL:r,fetch:n})(e.modelId);default:return iU({name:e.handle||`custom`,baseURL:r,apiKey:e.apiKey||void 0,fetch:n,includeUsage:!0,headers:r.includes(`openrouter.ai`)?{"HTTP-Referer":`https://dissentry.lihaila.com`,"X-Title":`Dissentry`}:void 0})(e.modelId)}}async function wU(e){let t=e.useProxy&&vU()?bU:fetch,n=SU(e.baseUrl),r;if(r=e.protocol===`anthropic`?await t(`${n}/models?limit=100`,{headers:{"x-api-key":e.apiKey,"anthropic-version":`2023-06-01`,"anthropic-dangerous-direct-browser-access":`true`}}):e.protocol===`google`?await t(`${n}/models?pageSize=200`,{headers:{"x-goog-api-key":e.apiKey}}):await t(`${n}/models`,{headers:e.apiKey?{Authorization:`Bearer ${e.apiKey}`}:{}}),!r.ok)throw Error(await TU(r));let i=await r.json();return e.protocol===`google`?(i.models??[]).filter(e=>e.supportedGenerationMethods?.includes(`generateContent`)).map(e=>e.name.replace(/^models\//,``)):(i.data??i.models??[]).map(e=>e.id??e.name??``).filter(Boolean).sort()}async function TU(e){let t=await e.text().catch(()=>``);try{let n=JSON.parse(t),r=n.error?.message??n.error??n.message;if(r)return`${e.status}: ${typeof r==`string`?r:JSON.stringify(r)}`}catch{}return`${e.status} ${e.statusText}${t?`: ${t.slice(0,200)}`:``}`}function EU(e,t){let n=e;if(n?.name===`AbortError`)return En(`post.stopped`);let r=n?.message??String(e);if(n?.responseBody)try{let e=JSON.parse(n.responseBody),t=typeof e.error==`string`?e.error:e.error?.message??e.message??e.detail;typeof t==`string`&&t.trim()&&(r=t)}catch{n.responseBody.trim()&&(r=n.responseBody.slice(0,300))}if(r?.trim()||(r=n?.statusCode?`HTTP ${n.statusCode} · ${t.baseUrl}`:En(`err.unreachable`,{url:t.baseUrl})),/Failed to fetch|NetworkError|Load failed/i.test(r)){let e=t.baseUrl.includes(`localhost`)||t.baseUrl.includes(`127.0.0.1`);return vU()?En(`err.unreachable`,{url:t.baseUrl}):e?En(`err.localHosted`,{url:t.baseUrl,origin:location.origin}):En(`err.blockedHosted`,{url:t.baseUrl})}return n?.statusCode===401||/\b401\b|(invalid|incorrect|wrong).{0,20}key|key.{0,20}(not valid|invalid)|unauthori|authentication fail/i.test(r)?En(`err.auth`,{handle:t.handle,msg:r}):n?.statusCode===404||/model.*not.*found|does not exist/i.test(r)?En(`err.model`,{model:t.modelId,handle:t.handle,msg:r}):n?.statusCode===429||/rate.?limit|quota|insufficient.{0,10}(balance|credit)/i.test(r)?En(`err.quota`,{handle:t.handle,msg:r}):r}async function DU(e){let t=[e],n=e,r=new Set([e.id]);for(;n.parentId&&!r.has(n.parentId);){let e=await F.posts.get(n.parentId);if(!e)break;t.unshift(e),r.add(e.id),n=e}return t}async function OU(e){let t={};for(let n of e){if(!n.quoteOfId||t[n.quoteOfId])continue;let e=await F.posts.get(n.quoteOfId);e&&(t[e.id]=(await DU(e)).slice(-4))}return t}async function kU(){let e=await F.profiles.toArray();return new Map(e.map(e=>[e.id,e]))}async function AU(e){await F.transaction(`rw`,F.posts,F.notes,F.checks,async()=>{let t=[],n=[e];for(;n.length;){let e=n.shift();t.push(e);let r=await F.posts.where(`parentId`).equals(e).primaryKeys();n.push(...r)}await F.posts.bulkDelete(t),await F.notes.where(`postId`).anyOf(t).delete(),await F.checks.where(`postId`).anyOf(t).delete()})}async function jU(e){let t=(await F.profiles.toArray()).map(t=>e?t:{...t,apiKey:``});return{app:`dissentry`,version:1,exportedAt:new Date().toISOString(),profiles:t,posts:await F.posts.toArray(),notes:await F.notes.toArray(),checks:await F.checks.toArray()}}async function MU(e){if(e?.app!==`dissentry`)throw Error(`Not a Dissentry export file`);await F.transaction(`rw`,F.profiles,F.posts,F.notes,F.checks,async()=>{for(let t of e.profiles??[]){let e=await F.profiles.get(t.id);await F.profiles.put({...t,apiKey:t.apiKey||e?.apiKey||``})}await F.posts.bulkPut(e.posts??[]),await F.notes.bulkPut(e.notes??[]),await F.checks.bulkPut(e.checks??[])})}async function NU(){await F.transaction(`rw`,F.profiles,F.posts,F.notes,F.checks,async()=>{await Promise.all([F.profiles.clear(),F.posts.clear(),F.notes.clear(),F.checks.clear()])})}var PU=e=>e&&(e.inputTokens||e.outputTokens)?{input:e.inputTokens??0,output:e.outputTokens??0}:void 0,FU=new Map;function IU(e){FU.get(e)?.abort()}async function LU(e){return{chain:e,quotes:await OU(e),profiles:await kU()}}async function RU(){return(await F.profiles.toArray()).filter(e=>e.enabled)}async function zU(e){let t=e.text.trim(),n=e.parentId?await F.posts.get(e.parentId):void 0,r=We(),i={id:r,kind:`user`,text:t,parentId:n?.id,quoteOfId:e.quoteOfId,rootId:n?.rootId??r,status:`done`,createdAt:Date.now()};await F.posts.add(i);let a=await RU(),o=er(t,a.map(e=>e.handle)).map(e=>a.find(t=>t.handle===e)).filter(Boolean);if(!o.length&&n?.kind===`model`){let e=a.find(e=>e.id===n.profileId);e&&(o=[e])}for(let e of o)BU(e,i);return i}async function BU(e,t,n={}){let r={id:We(),kind:`model`,profileId:e.id,text:``,parentId:t.id,rootId:t.rootId,status:`streaming`,respondsToNoteId:n.respondsToNoteId,createdAt:Date.now()};await F.posts.add(r);let i=new AbortController;FU.set(r.id,i);let a=``,o=0;try{let s=await LU(await DU(t)),c=vA({model:CU(e),system:fj(e,[...s.profiles.values()].filter(e=>e.enabled)),messages:dj(s,e,n.extraUserMessage),abortSignal:i.signal,maxRetries:0});for await(let e of c.fullStream)if(e.type===`text-delta`)a+=e.text,Date.now()-o>60&&(o=Date.now(),await F.posts.update(r.id,{text:a}));else if(e.type===`error`)throw e.error;if(!a.trim())throw Error(En(`err.empty`));let l=PU(await Promise.resolve(c.totalUsage).catch(()=>void 0));await F.posts.update(r.id,{text:a,status:`done`,usage:l})}catch(t){let n=i.signal.aborted;return await F.posts.update(r.id,{text:a,status:n?`stopped`:`error`,error:n?void 0:EU(t,e)}),await F.posts.get(r.id)}finally{FU.delete(r.id)}let s=await F.posts.get(r.id);return lU().autoCheck&&!n.respondsToNoteId&&UU(s),s}var VU=new Map;function HU(e,t){let n=(VU.get(e)??Promise.resolve()).then(t,t);return VU.set(e,n.catch(()=>{})),n}async function UU(e,t){if(e.kind!==`model`||e.status!==`done`)return;let n=await RU(),r=n.find(t=>t.id===e.profileId)??await F.profiles.get(e.profileId);if(!r)return;let i=(t??n.filter(e=>e.isChecker)).filter(e=>e.id!==r.id);if(!i.length)return;let a=mj(await LU((await DU(e)).slice(0,-1)),e,r);await Promise.all(i.map(async t=>{await F.checks.put({postId:e.id,profileId:t.id,verdict:`pending`,createdAt:Date.now()});try{let n=await dk({model:CU(t),system:pj,messages:a,maxRetries:0}),r=PU(n.totalUsage),i=_j(n.text);await HU(e.id,async()=>{let n=await F.notes.where(`postId`).equals(e.id).toArray();for(let e of n)if(e.status===`open`){if(e.profileId===t.id){if(e.agreeProfileIds.length){let[t,...n]=e.agreeProfileIds;await F.notes.update(e.id,{profileId:t,agreeProfileIds:n})}else await F.notes.delete(e.id)}else e.agreeProfileIds.includes(t.id)&&await F.notes.update(e.id,{agreeProfileIds:e.agreeProfileIds.filter(e=>e!==t.id)})}let r=await F.notes.where(`postId`).equals(e.id).toArray();for(let n of i.notes){let i=xj(r,n,t.id);if(i)i.agreeProfileIds=[...i.agreeProfileIds,t.id],i.severity=Sj(i.severity,n.severity),await F.notes.update(i.id,{agreeProfileIds:i.agreeProfileIds,severity:i.severity});else{let i={id:We(),postId:e.id,profileId:t.id,agreeProfileIds:[],...n,status:`open`,createdAt:Date.now()};r.push(i),await F.notes.add(i)}}}),await F.checks.put({postId:e.id,profileId:t.id,verdict:i.verdict,usage:r,createdAt:Date.now()})}catch(n){await F.checks.put({postId:e.id,profileId:t.id,verdict:`error`,error:EU(n,t),createdAt:Date.now()})}}))}async function WU(e){if(e.kind!==`model`||!e.parentId)return;let[t,n]=await Promise.all([F.profiles.get(e.profileId),F.posts.get(e.parentId)]);t&&n&&await BU(t,n)}async function GU(e){let t=await F.posts.get(e.postId);if(!t?.profileId)return;let[n,r]=await Promise.all([F.profiles.get(t.profileId),F.profiles.get(e.profileId)]);if(!n)return;let i=e.agreeProfileIds.length?` (${e.agreeProfileIds.length} other model(s) agreed)`:``,a=await BU(n,t,{extraUserMessage:[`[note from @${r?.handle??`reviewer`}${i} on your answer above]`,`Claim: ${e.claim}`,`Correction: ${e.correction}`,``,`Respond to this note. If it is right, say so plainly and give the corrected answer. If it is wrong, explain why with evidence. Keep it short.`].join(`
155
- `),respondsToNoteId:e.id});await F.notes.update(e.id,{responsePostId:a.id})}var KU=(e,t)=>F.notes.update(e,{status:t});function qU({parentId:e,quoteOfId:t,placeholder:n,autoFocus:r,implicitHandle:i,onPosted:a,compact:o}){let s=Dn(),c=Tr(),l=dU(),u=(0,y.useMemo)(()=>(c??[]).filter(e=>e.enabled),[c]),[d,f]=(0,y.useState)(``),[p,m]=(0,y.useState)(!1),[h,g]=(0,y.useState)(null),[_,v]=(0,y.useState)(0),b=(0,y.useRef)(null),x=er(d,u.map(e=>e.handle)),S=x.length?x:i?[i]:[],C=S.map(e=>u.find(t=>t.handle===e)).filter(Boolean),w=u.filter(e=>e.isChecker&&(S.length!==1||S[0]!==e.handle)),T=h?[...u.filter(e=>e.handle.startsWith(h.query)||e.name.toLowerCase().includes(h.query)),...`all`.startsWith(h.query)&&u.length>1?[{id:`__all`,handle:`all`,name:s(`composer.everyModel`)}]:[]].slice(0,8):[],E=(e,t)=>{g(tr(e,t)),v(0)},D=e=>requestAnimationFrame(()=>{b.current?.focus(),b.current?.setSelectionRange(e,e)});function O(e){if(!h||!b.current)return;let t=b.current.selectionStart,n=`${d.slice(0,h.start)}@${e} ${d.slice(t)}`;f(n),g(null),D(h.start+e.length+2)}function k(e){let t=RegExp(`(^|\\s)@${e.replace(/[.]/g,`\\.`)}(?![\\w.-])\\s?`,`i`),n=t.test(d)?d.replace(t,`$1`).replace(/^\s+/,``):`@${e} ${d}`;f(n),D(n.length)}async function A(){if(!d.trim()||p)return;m(!0);let n=d;f(``),g(null);try{let r=await zU({text:n,parentId:e,quoteOfId:t});a?.(r.id)}finally{m(!1)}}function j(e){if(h&&T.length){if(e.key===`ArrowDown`){e.preventDefault(),v(e=>(e+1)%T.length);return}if(e.key===`ArrowUp`){e.preventDefault(),v(e=>(e-1+T.length)%T.length);return}if(e.key===`Enter`||e.key===`Tab`){e.preventDefault(),O(T[_].handle);return}if(e.key===`Escape`){e.stopPropagation(),g(null);return}}e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),A())}if(c&&c.length===0)return(0,R.jsxs)(`div`,{className:`px-5 py-6`,children:[(0,R.jsx)(`p`,{className:`text-[15px] text-slate-600`,children:s(`composer.noModels`)}),(0,R.jsx)(Ve,{href:`/models`,className:`mt-3 inline-flex rounded-full bg-ink px-4 py-2 text-sm font-semibold text-white hover:bg-slate-800`,children:s(`composer.addFirst`)})]});let M=s(e?`composer.reply`:t?`composer.quote`:`composer.post`);return(0,R.jsxs)(`div`,{className:`relative flex gap-3 px-4 ${o?`py-3`:`pb-3 pt-4`}`,children:[(0,R.jsx)(Pr,{user:fU(l,s(`post.youName`))}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`textarea`,{ref:b,value:d,autoFocus:r,rows:o?2:3,placeholder:n??s(`composer.placeholder`,{handle:u[0]?.handle??`claude`}),onChange:e=>{f(e.target.value),E(e.target.value,e.target.selectionStart)},onKeyDown:j,onClick:e=>E(d,e.target.selectionStart),onBlur:()=>setTimeout(()=>g(null),150),className:`w-full resize-none bg-transparent pt-1.5 text-[17px] leading-relaxed outline-none placeholder:text-slate-400`,style:{fieldSizing:`content`,minHeight:o?52:76}}),h&&T.length>0&&(0,R.jsx)(`ul`,{className:`absolute z-40 mt-1 w-72 overflow-hidden rounded-2xl border border-slate-200 bg-white py-1 shadow-xl shadow-slate-900/10`,children:T.map((e,t)=>{let n=u.find(t=>t.id===e.id);return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{type:`button`,onMouseDown:t=>{t.preventDefault(),O(e.handle)},className:`flex w-full items-center gap-3 px-3 py-2 text-left ${t===_?`bg-slate-100`:`hover:bg-slate-50`}`,children:[n?(0,R.jsx)(Pr,{profile:n,size:32}):(0,R.jsx)(`div`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-slate-100 text-[11px] font-bold text-slate-600`,children:`ALL`}),(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsx)(`span`,{className:`block truncate text-[14px] font-semibold`,children:e.name}),(0,R.jsxs)(`span`,{className:`block truncate text-[12px] text-slate-500`,children:[`@`,e.handle,n?` · ${n.modelId}`:``]})]})]})},e.id)})}),!e&&u.length>0&&(0,R.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:u.slice(0,8).map(e=>{let t=x.includes(e.handle);return(0,R.jsxs)(`button`,{type:`button`,onClick:()=>k(e.handle),title:`@${e.handle} · ${e.modelId}`,className:`flex items-center gap-1.5 rounded-full border py-0.5 pl-0.5 pr-2.5 text-[12.5px] font-medium transition ${t?`border-sky-300 bg-sky-50 text-sky-700`:`border-slate-200 text-slate-600 hover:border-slate-300 hover:bg-slate-50`}`,children:[(0,R.jsx)(Pr,{profile:e,size:22}),`@`,e.handle]},e.id)})}),(0,R.jsxs)(`div`,{className:`mt-3 flex items-center gap-3 border-t border-slate-100 pt-3`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-1 text-[12.5px] text-slate-500`,children:[C.length>0?(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[s(`composer.asking`),` `,(0,R.jsx)(JU,{profiles:C})]}):(0,R.jsx)(`span`,{children:s(`composer.mentionHint`)}),l.autoCheck&&w.length>0&&C.length>0&&(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[s(`composer.checkedBy`),` `,(0,R.jsx)(JU,{profiles:w})]})]}),(0,R.jsx)(`button`,{onClick:()=>void A(),disabled:!d.trim()||p,className:`shrink-0 rounded-full bg-ink px-5 py-2 text-[14.5px] font-semibold text-white transition hover:bg-slate-800 disabled:bg-slate-300`,title:`⌘/Ctrl + Enter`,children:M})]})]})]})}function JU({profiles:e}){return(0,R.jsxs)(`span`,{className:`flex -space-x-1.5`,children:[e.slice(0,5).map(e=>(0,R.jsx)(`span`,{title:`@${e.handle}`,className:`rounded-full ring-2 ring-white`,children:(0,R.jsx)(Pr,{profile:e,size:22})},e.id)),e.length>5&&(0,R.jsxs)(`span`,{className:`flex h-[22px] items-center pl-2.5 text-[11px]`,children:[`+`,e.length-5]})]})}function YU(){let e=Mr(),t=Dn(),[,n]=Pe();return(0,y.useEffect)(()=>{if(!e)return;let t=e=>e.key===`Escape`&&jr();return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e]),e?(0,R.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center bg-slate-900/30 p-3 pt-[10vh] backdrop-blur-[2px]`,onClick:e=>e.target===e.currentTarget&&jr(),children:(0,R.jsxs)(`div`,{className:`w-full max-w-[600px] overflow-hidden rounded-3xl bg-white shadow-2xl shadow-slate-900/20 ring-1 ring-slate-200`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between border-b border-slate-100 px-4 py-2.5`,children:[(0,R.jsx)(`button`,{onClick:jr,className:`flex h-8 w-8 items-center justify-center rounded-full text-slate-500 hover:bg-slate-100`,"aria-label":t(`common.close`),children:`✕`}),(0,R.jsx)(`span`,{className:`text-[14px] font-semibold`,children:t(`nav.newThread`)}),(0,R.jsx)(`span`,{className:`w-8`})]}),(0,R.jsx)(qU,{autoFocus:!0,onPosted:e=>{jr(),n(`/post/${e}`)}})]})}):null}function XU({children:e}){let t=Dn(),[n]=Pe(),r=[{href:`/`,label:t(`nav.home`),icon:Et},{href:`/models`,label:t(`nav.models`),icon:ct},{href:`/trust`,label:t(`nav.trust`),icon:Xt},{href:`/usage`,label:t(`nav.usage`),icon:ut},{href:`/settings`,label:t(`nav.settings`),icon:Kt}],i=e=>e===`/`?n===`/`:n.startsWith(e);return(0,y.useEffect)(()=>{let e=e=>{let t=e.target;e.key!==`n`||e.metaKey||e.ctrlKey||e.altKey||t.closest(`input,textarea,select,[contenteditable]`)||(e.preventDefault(),Ar())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,R.jsxs)(`div`,{className:`mx-auto flex min-h-screen max-w-[1280px] justify-center`,children:[(0,R.jsxs)(`aside`,{className:`sticky top-0 hidden h-screen w-[260px] shrink-0 flex-col px-4 py-5 md:flex`,children:[(0,R.jsx)(Ve,{href:`/`,className:`mb-6 px-2`,children:(0,R.jsx)(An,{})}),(0,R.jsxs)(`button`,{onClick:Ar,className:`mb-5 flex items-center justify-center gap-2 rounded-full bg-ink px-4 py-3 text-[15px] font-semibold text-white shadow-sm shadow-slate-900/10 transition hover:bg-slate-800 active:scale-[.98]`,children:[(0,R.jsx)(en,{size:18}),` `,t(`nav.newThread`)]}),(0,R.jsx)(`nav`,{className:`space-y-0.5`,children:r.map(({href:e,label:t,icon:n})=>(0,R.jsxs)(Ve,{href:e,className:`flex items-center gap-3.5 rounded-xl px-3 py-2.5 text-[15.5px] transition ${i(e)?`bg-slate-100 font-semibold text-ink`:`text-slate-600 hover:bg-slate-50 hover:text-ink`}`,children:[(0,R.jsx)(n,{size:20,strokeWidth:i(e)?2.4:1.8}),t]},e))}),(0,R.jsx)(ZU,{}),(0,R.jsxs)(`div`,{className:`mt-auto space-y-3 px-2 pt-4`,children:[(0,R.jsx)(kn,{}),(0,R.jsx)(`p`,{className:`text-[12px] leading-relaxed text-slate-400`,children:t(`layout.localFirst`)}),(0,R.jsxs)(`a`,{className:`flex items-center gap-1.5 text-[12px] text-slate-400 hover:text-slate-600`,href:`https://github.com/Lihaila/dissentry`,target:`_blank`,rel:`noreferrer`,children:[(0,R.jsx)(mt,{size:13}),` `,t(`layout.openSource`)]})]})]}),(0,R.jsxs)(`main`,{className:`min-h-screen w-full max-w-[640px] border-slate-200/80 bg-white pb-24 md:border-x md:pb-10`,children:[(0,R.jsxs)(`div`,{className:`sticky top-0 z-20 flex items-center justify-between border-b border-slate-200/80 bg-white/90 px-4 py-2.5 backdrop-blur md:hidden`,children:[(0,R.jsx)(Ve,{href:`/`,children:(0,R.jsx)(An,{size:24})}),(0,R.jsx)(kn,{compact:!0})]}),e]}),(0,R.jsx)(QU,{}),(0,R.jsx)(`nav`,{className:`fixed inset-x-0 bottom-0 z-30 flex items-center justify-around border-t border-slate-200 bg-white/95 pb-[env(safe-area-inset-bottom)] backdrop-blur md:hidden`,children:r.map(({href:e,label:t,icon:n})=>(0,R.jsx)(Ve,{href:e,"aria-label":t,className:`p-3.5 ${i(e)?`text-ink`:`text-slate-400`}`,children:(0,R.jsx)(n,{size:23,strokeWidth:i(e)?2.4:1.8})},e))}),(0,R.jsx)(`button`,{onClick:Ar,"aria-label":t(`nav.newThread`),className:`fixed bottom-20 right-5 z-30 flex h-14 w-14 items-center justify-center rounded-full bg-ink text-white shadow-lg shadow-slate-900/25 md:hidden`,children:(0,R.jsx)(Rt,{size:26})}),(0,R.jsx)(YU,{})]})}function ZU(){let e=Dn(),[t]=Pe(),n=ne(()=>F.posts.orderBy(`createdAt`).reverse().filter(e=>!e.parentId).limit(12).toArray(),[]);return n?.length?(0,R.jsxs)(`div`,{className:`mt-6 min-h-0 flex-1 overflow-y-auto`,children:[(0,R.jsx)(`h3`,{className:`px-3 pb-1.5 text-[11.5px] font-semibold uppercase tracking-wider text-slate-400`,children:e(`layout.recent`)}),n.map(e=>(0,R.jsx)(Ve,{href:`/post/${e.id}`,className:`block truncate rounded-lg px-3 py-1.5 text-[13.5px] transition ${t===`/post/${e.id}`?`bg-slate-100 text-ink`:`text-slate-600 hover:bg-slate-50`}`,children:Nr(e.text,48)},e.id))]}):null}function QU(){let e=Dn(),t=(Tr()??[]).filter(e=>e.enabled);return(0,R.jsxs)(`aside`,{className:`sticky top-0 hidden h-screen w-[320px] shrink-0 space-y-4 overflow-y-auto px-5 py-5 xl:block`,children:[(0,R.jsxs)(`section`,{className:`rounded-2xl border border-slate-200/80 bg-white p-4`,children:[(0,R.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,R.jsx)(`h2`,{className:`text-[15px] font-bold`,children:e(`panel.yourModels`)}),(0,R.jsx)(Ve,{href:`/models`,className:`text-[13px] font-medium text-sky-600 hover:underline`,children:e(`panel.manage`)})]}),t.length===0&&(0,R.jsx)(`p`,{className:`text-[13.5px] text-slate-500`,children:e(`panel.noModels`)}),(0,R.jsx)(`ul`,{className:`space-y-2.5`,children:t.map(t=>(0,R.jsxs)(`li`,{className:`flex items-center gap-2.5`,children:[(0,R.jsx)(Pr,{profile:t,size:32}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`div`,{className:`truncate text-[14px] font-semibold leading-tight`,children:t.name}),(0,R.jsxs)(`div`,{className:`truncate text-[12px] text-slate-500`,children:[`@`,t.handle,` · `,t.modelId]})]}),t.isChecker&&(0,R.jsx)(`span`,{className:`rounded-full bg-amber-100 px-2 py-0.5 text-[11px] font-semibold text-amber-800`,children:e(`common.checker`)})]},t.id))}),(0,R.jsxs)(Ve,{href:`/models`,className:`mt-3 flex items-center gap-1.5 text-[13px] font-medium text-slate-600 hover:text-ink`,children:[(0,R.jsx)(Rt,{size:15}),` `,e(`panel.addModel`)]})]}),(0,R.jsxs)(`section`,{className:`rounded-2xl bg-slate-50 p-4`,children:[(0,R.jsx)(`h2`,{className:`mb-2.5 text-[15px] font-bold`,children:e(`panel.howTitle`)}),(0,R.jsx)(`ol`,{className:`space-y-2.5 text-[13.5px] leading-relaxed text-slate-600`,children:[`panel.how1`,`panel.how2`,`panel.how3`].map((t,n)=>(0,R.jsxs)(`li`,{className:`flex gap-2.5`,children:[(0,R.jsx)(`span`,{className:`mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-white text-[11px] font-bold text-ink ring-1 ring-slate-200`,children:n+1}),(0,R.jsx)(`span`,{children:e(t)})]},t))})]})]})}function $U({title:e,sub:t,back:n}){let r=Dn();return(0,R.jsxs)(`header`,{className:`sticky top-0 z-10 flex items-center gap-4 border-b border-slate-200/80 bg-white/85 px-4 py-3 backdrop-blur max-md:top-[49px]`,children:[n&&(0,R.jsx)(`button`,{onClick:()=>history.length>1?history.back():location.href=`/`,"aria-label":r(`common.back`),className:`-ml-1.5 flex h-9 w-9 items-center justify-center rounded-full text-lg hover:bg-slate-100`,children:`←`}),(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`h1`,{className:`truncate text-[19px] font-bold leading-tight tracking-tight`,children:e}),t&&(0,R.jsx)(`p`,{className:`truncate text-[13px] text-slate-500`,children:t})]})]})}var eW={en:[`s`,`m`,`h`],zh:[`秒`,`分钟`,`小时`],ja:[`秒`,`分`,`時間`],ko:[`초`,`분`,`시간`]};function tW(e){let t=Cn(),[n,r,i]=eW[t]??eW.en,a=Math.max(0,Math.round((Date.now()-e)/1e3));if(a<60)return`${a}${n}`;let o=Math.round(a/60);if(o<60)return`${o}${r}`;let s=Math.round(o/60);if(s<24)return`${s}${i}`;let c=new Date(e),l={en:`en-US`,zh:`zh-CN`,ja:`ja-JP`,ko:`ko-KR`}[t]??`en-US`;return c.toLocaleDateString(l,{month:`short`,day:`numeric`,...c.getFullYear()===new Date().getFullYear()?{}:{year:`numeric`}})}function nW(e){let t={en:`en-US`,zh:`zh-CN`,ja:`ja-JP`,ko:`ko-KR`}[Cn()]??`en-US`;return new Date(e).toLocaleString(t)}var rW=e=>e.replace(/[*_`]/g,``).replace(/\s+/g,` `).trim().toLowerCase();function iW(e,t){let n=t.filter(e=>e.status!==`dismissed`).map(e=>e.claim.replace(/^["“'‘]+|["”'’.。!?!?]+$/g,``).trim()).filter(e=>e.length>=8);return n.length?e.split(/(```[\s\S]*?```)/g).map((e,t)=>{if(t%2==1)return e;let r=e;for(let e of n){let t=rW(e),n=[],i=``;for(let e=0;e<r.length;e++){let t=r[e];if(!/[*_`]/.test(t)){if(/\s/.test(t)){if(i.endsWith(` `))continue;i+=` `,n.push(e)}else i+=t.toLowerCase(),n.push(e)}}let a=i.indexOf(t);if(a<0){r=aW(r,e);continue}let o=n[a],s=n[a+t.length-1]+1;if((r.slice(o,s).match(/\*\*|__/g)??[]).length%2==1){let e=r.slice(s,s+2);e===`**`||e===`__`?s+=2:[`**`,`__`].includes(r.slice(o-2,o))&&(o-=2)}let c=r.slice(o,s).replace(/\*\*|__/g,``);c.includes(`
155
+ `),respondsToNoteId:e.id});await F.notes.update(e.id,{responsePostId:a.id})}var KU=(e,t)=>F.notes.update(e,{status:t});function qU({parentId:e,quoteOfId:t,placeholder:n,autoFocus:r,implicitHandle:i,onPosted:a,compact:o}){let s=Dn(),c=Tr(),l=dU(),u=(0,y.useMemo)(()=>(c??[]).filter(e=>e.enabled),[c]),[d,f]=(0,y.useState)(``),[p,m]=(0,y.useState)(!1),[h,g]=(0,y.useState)(null),[_,v]=(0,y.useState)(0),b=(0,y.useRef)(null),x=er(d,u.map(e=>e.handle)),S=x.length?x:i?[i]:[],C=S.map(e=>u.find(t=>t.handle===e)).filter(Boolean),w=u.filter(e=>e.isChecker&&(S.length!==1||S[0]!==e.handle)),T=h?[...u.filter(e=>e.handle.startsWith(h.query)||e.name.toLowerCase().includes(h.query)),...`all`.startsWith(h.query)&&u.length>1?[{id:`__all`,handle:`all`,name:s(`composer.everyModel`)}]:[]].slice(0,8):[],E=(e,t)=>{g(tr(e,t)),v(0)},D=e=>requestAnimationFrame(()=>{b.current?.focus(),b.current?.setSelectionRange(e,e)});function O(e){if(!h||!b.current)return;let t=b.current.selectionStart,n=`${d.slice(0,h.start)}@${e} ${d.slice(t)}`;f(n),g(null),D(h.start+e.length+2)}function k(e){let t=RegExp(`(^|\\s)@${e.replace(/[.]/g,`\\.`)}(?![\\w.-])\\s?`,`i`),n=t.test(d)?d.replace(t,`$1`).replace(/^\s+/,``):`@${e} ${d}`;f(n),D(n.length)}async function A(){if(!d.trim()||p)return;m(!0);let n=d;f(``),g(null);try{let r=await zU({text:n,parentId:e,quoteOfId:t});a?.(r.id)}finally{m(!1)}}function j(e){if(h&&T.length){if(e.key===`ArrowDown`){e.preventDefault(),v(e=>(e+1)%T.length);return}if(e.key===`ArrowUp`){e.preventDefault(),v(e=>(e-1+T.length)%T.length);return}if(e.key===`Enter`||e.key===`Tab`){e.preventDefault(),O(T[_].handle);return}if(e.key===`Escape`){e.stopPropagation(),g(null);return}}e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),A())}if(c&&c.length===0)return(0,R.jsxs)(`div`,{className:`px-5 py-6`,children:[(0,R.jsx)(`p`,{className:`text-[15px] text-slate-600`,children:s(`composer.noModels`)}),(0,R.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-3`,children:[(0,R.jsx)(`span`,{onClick:jr,children:(0,R.jsx)(vr,{})}),(0,R.jsx)(Ve,{href:`/models?add=1`,onClick:jr,className:`inline-flex rounded-full border border-slate-200 px-4 py-2 text-[13.5px] font-semibold text-ink hover:bg-slate-50`,children:s(`composer.addFirst`)})]})]});let M=s(e?`composer.reply`:t?`composer.quote`:`composer.post`);return(0,R.jsxs)(`div`,{className:`relative flex gap-3 px-4 ${o?`py-3`:`pb-3 pt-4`}`,children:[(0,R.jsx)(Pr,{user:fU(l,s(`post.youName`))}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`textarea`,{ref:b,value:d,autoFocus:r,rows:o?2:3,placeholder:n??s(`composer.placeholder`,{handle:u[0]?.handle??`claude`}),onChange:e=>{f(e.target.value),E(e.target.value,e.target.selectionStart)},onKeyDown:j,onClick:e=>E(d,e.target.selectionStart),onBlur:()=>setTimeout(()=>g(null),150),className:`w-full resize-none bg-transparent pt-1.5 text-[17px] leading-relaxed outline-none placeholder:text-slate-400`,style:{fieldSizing:`content`,minHeight:o?52:76}}),h&&T.length>0&&(0,R.jsx)(`ul`,{className:`absolute z-40 mt-1 w-72 overflow-hidden rounded-2xl border border-slate-200 bg-white py-1 shadow-xl shadow-slate-900/10`,children:T.map((e,t)=>{let n=u.find(t=>t.id===e.id);return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{type:`button`,onMouseDown:t=>{t.preventDefault(),O(e.handle)},className:`flex w-full items-center gap-3 px-3 py-2 text-left ${t===_?`bg-slate-100`:`hover:bg-slate-50`}`,children:[n?(0,R.jsx)(Pr,{profile:n,size:32}):(0,R.jsx)(`div`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-slate-100 text-[11px] font-bold text-slate-600`,children:`ALL`}),(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsx)(`span`,{className:`block truncate text-[14px] font-semibold`,children:e.name}),(0,R.jsxs)(`span`,{className:`block truncate text-[12px] text-slate-500`,children:[`@`,e.handle,n?` · ${n.modelId}`:``]})]})]})},e.id)})}),!e&&u.length>0&&(0,R.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:u.slice(0,8).map(e=>{let t=x.includes(e.handle);return(0,R.jsxs)(`button`,{type:`button`,onClick:()=>k(e.handle),title:`@${e.handle} · ${e.modelId}`,className:`flex items-center gap-1.5 rounded-full border py-0.5 pl-0.5 pr-2.5 text-[12.5px] font-medium transition ${t?`border-sky-300 bg-sky-50 text-sky-700`:`border-slate-200 text-slate-600 hover:border-slate-300 hover:bg-slate-50`}`,children:[(0,R.jsx)(Pr,{profile:e,size:22}),`@`,e.handle]},e.id)})}),(0,R.jsxs)(`div`,{className:`mt-3 flex items-center gap-3 border-t border-slate-100 pt-3`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-wrap items-center gap-x-3 gap-y-1 text-[12.5px] text-slate-500`,children:[C.length>0?(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[s(`composer.asking`),` `,(0,R.jsx)(JU,{profiles:C})]}):(0,R.jsx)(`span`,{children:s(`composer.mentionHint`)}),l.autoCheck&&w.length>0&&C.length>0&&(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[s(`composer.checkedBy`),` `,(0,R.jsx)(JU,{profiles:w})]})]}),(0,R.jsx)(`button`,{onClick:()=>void A(),disabled:!d.trim()||p,className:`shrink-0 rounded-full bg-ink px-5 py-2 text-[14.5px] font-semibold text-white transition hover:bg-slate-800 disabled:bg-slate-300`,title:`⌘/Ctrl + Enter`,children:M})]})]})]})}function JU({profiles:e}){return(0,R.jsxs)(`span`,{className:`flex -space-x-1.5`,children:[e.slice(0,5).map(e=>(0,R.jsx)(`span`,{title:`@${e.handle}`,className:`rounded-full ring-2 ring-white`,children:(0,R.jsx)(Pr,{profile:e,size:22})},e.id)),e.length>5&&(0,R.jsxs)(`span`,{className:`flex h-[22px] items-center pl-2.5 text-[11px]`,children:[`+`,e.length-5]})]})}function YU(){let e=Mr(),t=Dn(),[,n]=Pe();return(0,y.useEffect)(()=>{if(!e)return;let t=e=>e.key===`Escape`&&jr();return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e]),e?(0,R.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-start justify-center bg-slate-900/30 p-3 pt-[10vh] backdrop-blur-[2px]`,onClick:e=>e.target===e.currentTarget&&jr(),children:(0,R.jsxs)(`div`,{className:`w-full max-w-[600px] overflow-hidden rounded-3xl bg-white shadow-2xl shadow-slate-900/20 ring-1 ring-slate-200`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between border-b border-slate-100 px-4 py-2.5`,children:[(0,R.jsx)(`button`,{onClick:jr,className:`flex h-8 w-8 items-center justify-center rounded-full text-slate-500 hover:bg-slate-100`,"aria-label":t(`common.close`),children:`✕`}),(0,R.jsx)(`span`,{className:`text-[14px] font-semibold`,children:t(`nav.newThread`)}),(0,R.jsx)(`span`,{className:`w-8`})]}),(0,R.jsx)(qU,{autoFocus:!0,onPosted:e=>{jr(),n(`/post/${e}`)}})]})}):null}function XU({children:e}){let t=Dn(),[n]=Pe(),r=[{href:`/`,label:t(`nav.home`),icon:Et},{href:`/models`,label:t(`nav.models`),icon:ct},{href:`/trust`,label:t(`nav.trust`),icon:Xt},{href:`/usage`,label:t(`nav.usage`),icon:ut},{href:`/settings`,label:t(`nav.settings`),icon:Kt}],i=e=>e===`/`?n===`/`:n.startsWith(e);return(0,y.useEffect)(()=>{let e=e=>{let t=e.target;e.key!==`n`||e.metaKey||e.ctrlKey||e.altKey||t.closest(`input,textarea,select,[contenteditable]`)||(e.preventDefault(),Ar())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,R.jsxs)(`div`,{className:`mx-auto flex min-h-screen max-w-[1280px] justify-center`,children:[(0,R.jsxs)(`aside`,{className:`sticky top-0 hidden h-screen w-[260px] shrink-0 flex-col px-4 py-5 md:flex`,children:[(0,R.jsx)(Ve,{href:`/`,className:`mb-6 px-2`,children:(0,R.jsx)(An,{})}),(0,R.jsxs)(`button`,{onClick:Ar,className:`mb-5 flex items-center justify-center gap-2 rounded-full bg-ink px-4 py-3 text-[15px] font-semibold text-white shadow-sm shadow-slate-900/10 transition hover:bg-slate-800 active:scale-[.98]`,children:[(0,R.jsx)(en,{size:18}),` `,t(`nav.newThread`)]}),(0,R.jsx)(`nav`,{className:`space-y-0.5`,children:r.map(({href:e,label:t,icon:n})=>(0,R.jsxs)(Ve,{href:e,className:`flex items-center gap-3.5 rounded-xl px-3 py-2.5 text-[15.5px] transition ${i(e)?`bg-slate-100 font-semibold text-ink`:`text-slate-600 hover:bg-slate-50 hover:text-ink`}`,children:[(0,R.jsx)(n,{size:20,strokeWidth:i(e)?2.4:1.8}),t]},e))}),(0,R.jsx)(ZU,{}),(0,R.jsxs)(`div`,{className:`mt-auto space-y-3 px-2 pt-4`,children:[(0,R.jsx)(kn,{}),(0,R.jsx)(`p`,{className:`text-[12px] leading-relaxed text-slate-400`,children:t(`layout.localFirst`)}),(0,R.jsxs)(`a`,{className:`flex items-center gap-1.5 text-[12px] text-slate-400 hover:text-slate-600`,href:`https://github.com/Lihaila/dissentry`,target:`_blank`,rel:`noreferrer`,children:[(0,R.jsx)(mt,{size:13}),` `,t(`layout.openSource`)]})]})]}),(0,R.jsxs)(`main`,{className:`min-h-screen w-full max-w-[640px] border-slate-200/80 bg-white pb-24 md:border-x md:pb-10`,children:[(0,R.jsxs)(`div`,{className:`sticky top-0 z-20 flex items-center justify-between border-b border-slate-200/80 bg-white/90 px-4 py-2.5 backdrop-blur md:hidden`,children:[(0,R.jsx)(Ve,{href:`/`,children:(0,R.jsx)(An,{size:24})}),(0,R.jsx)(kn,{compact:!0})]}),e]}),(0,R.jsx)(QU,{}),(0,R.jsx)(`nav`,{className:`fixed inset-x-0 bottom-0 z-30 flex items-center justify-around border-t border-slate-200 bg-white/95 pb-[env(safe-area-inset-bottom)] backdrop-blur md:hidden`,children:r.map(({href:e,label:t,icon:n})=>(0,R.jsx)(Ve,{href:e,"aria-label":t,className:`p-3.5 ${i(e)?`text-ink`:`text-slate-400`}`,children:(0,R.jsx)(n,{size:23,strokeWidth:i(e)?2.4:1.8})},e))}),(0,R.jsx)(`button`,{onClick:Ar,"aria-label":t(`nav.newThread`),className:`fixed bottom-20 right-5 z-30 flex h-14 w-14 items-center justify-center rounded-full bg-ink text-white shadow-lg shadow-slate-900/25 md:hidden`,children:(0,R.jsx)(Rt,{size:26})}),(0,R.jsx)(YU,{})]})}function ZU(){let e=Dn(),[t]=Pe(),n=ne(()=>F.posts.orderBy(`createdAt`).reverse().filter(e=>!e.parentId).limit(12).toArray(),[]);return n?.length?(0,R.jsxs)(`div`,{className:`mt-6 min-h-0 flex-1 overflow-y-auto`,children:[(0,R.jsx)(`h3`,{className:`px-3 pb-1.5 text-[11.5px] font-semibold uppercase tracking-wider text-slate-400`,children:e(`layout.recent`)}),n.map(e=>(0,R.jsx)(Ve,{href:`/post/${e.id}`,className:`block truncate rounded-lg px-3 py-1.5 text-[13.5px] transition ${t===`/post/${e.id}`?`bg-slate-100 text-ink`:`text-slate-600 hover:bg-slate-50`}`,children:Nr(e.text,48)},e.id))]}):null}function QU(){let e=Dn(),t=(Tr()??[]).filter(e=>e.enabled);return(0,R.jsxs)(`aside`,{className:`sticky top-0 hidden h-screen w-[320px] shrink-0 space-y-4 overflow-y-auto px-5 py-5 xl:block`,children:[(0,R.jsxs)(`section`,{className:`rounded-2xl border border-slate-200/80 bg-white p-4`,children:[(0,R.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,R.jsx)(`h2`,{className:`text-[15px] font-bold`,children:e(`panel.yourModels`)}),(0,R.jsx)(Ve,{href:`/models`,className:`text-[13px] font-medium text-sky-600 hover:underline`,children:e(`panel.manage`)})]}),t.length===0&&(0,R.jsx)(`p`,{className:`text-[13.5px] text-slate-500`,children:e(`panel.noModels`)}),(0,R.jsx)(`ul`,{className:`space-y-2.5`,children:t.map(t=>(0,R.jsxs)(`li`,{className:`flex items-center gap-2.5`,children:[(0,R.jsx)(Pr,{profile:t,size:32}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`div`,{className:`truncate text-[14px] font-semibold leading-tight`,children:t.name}),(0,R.jsxs)(`div`,{className:`truncate text-[12px] text-slate-500`,children:[`@`,t.handle,` · `,t.modelId]})]}),t.isChecker&&(0,R.jsx)(`span`,{className:`rounded-full bg-amber-100 px-2 py-0.5 text-[11px] font-semibold text-amber-800`,children:e(`common.checker`)})]},t.id))}),(0,R.jsxs)(Ve,{href:`/models`,className:`mt-3 flex items-center gap-1.5 text-[13px] font-medium text-slate-600 hover:text-ink`,children:[(0,R.jsx)(Rt,{size:15}),` `,e(`panel.addModel`)]})]}),(0,R.jsxs)(`section`,{className:`rounded-2xl bg-slate-50 p-4`,children:[(0,R.jsx)(`h2`,{className:`mb-2.5 text-[15px] font-bold`,children:e(`panel.howTitle`)}),(0,R.jsx)(`ol`,{className:`space-y-2.5 text-[13.5px] leading-relaxed text-slate-600`,children:[`panel.how1`,`panel.how2`,`panel.how3`].map((t,n)=>(0,R.jsxs)(`li`,{className:`flex gap-2.5`,children:[(0,R.jsx)(`span`,{className:`mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-white text-[11px] font-bold text-ink ring-1 ring-slate-200`,children:n+1}),(0,R.jsx)(`span`,{children:e(t)})]},t))})]})]})}function $U({title:e,sub:t,back:n}){let r=Dn();return(0,R.jsxs)(`header`,{className:`sticky top-0 z-10 flex items-center gap-4 border-b border-slate-200/80 bg-white/85 px-4 py-3 backdrop-blur max-md:top-[49px]`,children:[n&&(0,R.jsx)(`button`,{onClick:()=>history.length>1?history.back():location.href=`/`,"aria-label":r(`common.back`),className:`-ml-1.5 flex h-9 w-9 items-center justify-center rounded-full text-lg hover:bg-slate-100`,children:`←`}),(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`h1`,{className:`truncate text-[19px] font-bold leading-tight tracking-tight`,children:e}),t&&(0,R.jsx)(`p`,{className:`truncate text-[13px] text-slate-500`,children:t})]})]})}var eW={en:[`s`,`m`,`h`],zh:[`秒`,`分钟`,`小时`],ja:[`秒`,`分`,`時間`],ko:[`초`,`분`,`시간`]};function tW(e){let t=Cn(),[n,r,i]=eW[t]??eW.en,a=Math.max(0,Math.round((Date.now()-e)/1e3));if(a<60)return`${a}${n}`;let o=Math.round(a/60);if(o<60)return`${o}${r}`;let s=Math.round(o/60);if(s<24)return`${s}${i}`;let c=new Date(e),l={en:`en-US`,zh:`zh-CN`,ja:`ja-JP`,ko:`ko-KR`}[t]??`en-US`;return c.toLocaleDateString(l,{month:`short`,day:`numeric`,...c.getFullYear()===new Date().getFullYear()?{}:{year:`numeric`}})}function nW(e){let t={en:`en-US`,zh:`zh-CN`,ja:`ja-JP`,ko:`ko-KR`}[Cn()]??`en-US`;return new Date(e).toLocaleString(t)}var rW=e=>e.replace(/[*_`]/g,``).replace(/\s+/g,` `).trim().toLowerCase();function iW(e,t){let n=t.filter(e=>e.status!==`dismissed`).map(e=>e.claim.replace(/^["“'‘]+|["”'’.。!?!?]+$/g,``).trim()).filter(e=>e.length>=8);return n.length?e.split(/(```[\s\S]*?```)/g).map((e,t)=>{if(t%2==1)return e;let r=e;for(let e of n){let t=rW(e),n=[],i=``;for(let e=0;e<r.length;e++){let t=r[e];if(!/[*_`]/.test(t)){if(/\s/.test(t)){if(i.endsWith(` `))continue;i+=` `,n.push(e)}else i+=t.toLowerCase(),n.push(e)}}let a=i.indexOf(t);if(a<0){r=aW(r,e);continue}let o=n[a],s=n[a+t.length-1]+1;if((r.slice(o,s).match(/\*\*|__/g)??[]).length%2==1){let e=r.slice(s,s+2);e===`**`||e===`__`?s+=2:[`**`,`__`].includes(r.slice(o-2,o))&&(o-=2)}let c=r.slice(o,s).replace(/\*\*|__/g,``);c.includes(`
156
156
  `)||c.includes(`~~`)||(r=`${r.slice(0,o)}~~${c}~~${r.slice(s)}`)}return r}).join(``):e}function aW(e,t){let n=vj(t);if(n.size<3)return e;let r=null;for(let t of e.matchAll(/[^.!?。!?\n]+[.!?。!?]?/g)){let e=t[0];if(e.includes(`~~`)||/^\s*([#>|-]|\d+\.)/.test(e))continue;let i=vj(e),a=0;for(let e of n)i.has(e)&&a++;let o=a/n.size;if(o>=.7&&(!r||o>r.score)){let n=e.length-e.trimStart().length;r={start:t.index+n,end:t.index+e.trimEnd().length,score:o}}}if(!r)return e;let i=e.slice(r.start,r.end).replace(/\*\*|__/g,``);return`${e.slice(0,r.start)}~~${i}~~${e.slice(r.end)}`}var oW=(e,t)=>e&&t?.inPrice!==void 0&&t?.outPrice!==void 0?(e.input*t.inPrice+e.output*t.outPrice)/1e6:void 0;function sW(e){return e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(+(e<1e4))}k`:`${(e/1e6).toFixed(2)}M`}function cW(e){return e===0?`$0`:e<.01?`$${e.toFixed(4)}`:e<1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`}function lW(e,t,n,r=0){let i=new Map(e.map(e=>[e.id,e])),a=new Map,o=e=>{let t=i.get(e);if(t)return a.has(e)||a.set(e,{profile:t,answerTokens:0,checkTokens:0,cost:0,priced:!0,calls:0}),a.get(e)},s=(e,t,n)=>{if(!e||!t)return;let r=t.input+t.output;n===`answer`?e.answerTokens+=r:e.checkTokens+=r;let i=oW(t,e.profile);i===void 0?e.priced=!1:e.cost+=i,e.calls++};for(let e of t)e.kind===`model`&&e.profileId&&e.createdAt>=r&&s(o(e.profileId),e.usage,`answer`);for(let e of n)e.createdAt>=r&&s(o(e.profileId),e.usage,`check`);let c=[...a.values()].filter(e=>e.calls>0).sort((e,t)=>t.answerTokens+t.checkTokens-(e.answerTokens+e.checkTokens));return{rows:c,total:c.reduce((e,t)=>({tokens:e.tokens+t.answerTokens+t.checkTokens,cost:e.cost+t.cost,answerTokens:e.answerTokens+t.answerTokens,checkTokens:e.checkTokens+t.checkTokens,priced:e.priced&&t.priced}),{tokens:0,cost:0,answerTokens:0,checkTokens:0,priced:!0})}}function uW(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var dW=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fW=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pW={};function mW(e,t){return((t||pW).jsx?fW:dW).test(e)}var hW=/[ \t\n\f\r]/g;function gW(e){return typeof e==`object`?e.type===`text`&&_W(e.value):_W(e)}function _W(e){return e.replace(hW,``)===``}var vW=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};vW.prototype.normal={},vW.prototype.property={},vW.prototype.space=void 0;function yW(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new vW(n,r,t)}function bW(e){return e.toLowerCase()}var xW=class{constructor(e,t){this.attribute=t,this.property=e}};xW.prototype.attribute=``,xW.prototype.booleanish=!1,xW.prototype.boolean=!1,xW.prototype.commaOrSpaceSeparated=!1,xW.prototype.commaSeparated=!1,xW.prototype.defined=!1,xW.prototype.mustUseProperty=!1,xW.prototype.number=!1,xW.prototype.overloadedBoolean=!1,xW.prototype.property=``,xW.prototype.spaceSeparated=!1,xW.prototype.space=void 0;var SW=s({boolean:()=>wW,booleanish:()=>TW,commaOrSpaceSeparated:()=>kW,commaSeparated:()=>OW,number:()=>$,overloadedBoolean:()=>EW,spaceSeparated:()=>DW}),CW=0,wW=AW(),TW=AW(),EW=AW(),$=AW(),DW=AW(),OW=AW(),kW=AW();function AW(){return 2**++CW}var jW=Object.keys(SW),MW=class extends xW{constructor(e,t,n,r){let i=-1;if(super(e,t),NW(this,`space`,r),typeof n==`number`)for(;++i<jW.length;){let e=jW[i];NW(this,jW[i],(n&SW[e])===SW[e])}}};MW.prototype.defined=!0;function NW(e,t,n){n&&(e[t]=n)}function PW(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new MW(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[bW(r)]=r,n[bW(a.attribute)]=r}return new vW(t,n,e.space)}var FW=PW({properties:{ariaActiveDescendant:null,ariaAtomic:TW,ariaAutoComplete:null,ariaBusy:TW,ariaChecked:TW,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:DW,ariaCurrent:null,ariaDescribedBy:DW,ariaDetails:null,ariaDisabled:TW,ariaDropEffect:DW,ariaErrorMessage:null,ariaExpanded:TW,ariaFlowTo:DW,ariaGrabbed:TW,ariaHasPopup:null,ariaHidden:TW,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:DW,ariaLevel:$,ariaLive:null,ariaModal:TW,ariaMultiLine:TW,ariaMultiSelectable:TW,ariaOrientation:null,ariaOwns:DW,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:TW,ariaReadOnly:TW,ariaRelevant:null,ariaRequired:TW,ariaRoleDescription:DW,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:TW,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function IW(e,t){return t in e?e[t]:t}function LW(e,t){return IW(e,t.toLowerCase())}var RW=PW({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:OW,acceptCharset:DW,accessKey:DW,action:null,allow:null,allowFullScreen:wW,allowPaymentRequest:wW,allowUserMedia:wW,alpha:wW,alt:null,as:null,async:wW,autoCapitalize:null,autoComplete:DW,autoFocus:wW,autoPlay:wW,blocking:DW,capture:null,charSet:null,checked:wW,cite:null,className:DW,closedBy:null,colorSpace:null,cols:$,colSpan:$,command:null,commandFor:null,content:null,contentEditable:TW,controls:wW,controlsList:DW,coords:$|OW,crossOrigin:null,data:null,dateTime:null,decoding:null,default:wW,defer:wW,dir:null,dirName:null,disabled:wW,download:EW,draggable:TW,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:wW,formTarget:null,headers:DW,height:$,hidden:EW,high:$,href:null,hrefLang:null,htmlFor:DW,httpEquiv:DW,id:null,imageSizes:null,imageSrcSet:null,inert:wW,inputMode:null,integrity:null,is:null,isMap:wW,itemId:null,itemProp:DW,itemRef:DW,itemScope:wW,itemType:DW,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:wW,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:wW,muted:wW,name:null,nonce:null,noModule:wW,noValidate:wW,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:wW,optimum:$,pattern:null,ping:DW,placeholder:null,playsInline:wW,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:wW,referrerPolicy:null,rel:DW,required:wW,reversed:wW,rows:$,rowSpan:$,sandbox:DW,scope:null,scoped:wW,seamless:wW,selected:wW,shadowRootClonable:wW,shadowRootCustomElementRegistry:wW,shadowRootDelegatesFocus:wW,shadowRootMode:null,shadowRootSerializable:wW,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:TW,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:wW,useMap:null,value:TW,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:DW,axis:null,background:null,bgColor:null,border:$,borderColor:null,bottomMargin:$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:wW,declare:wW,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:wW,noHref:wW,noShade:wW,noWrap:wW,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:TW,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:wW,disablePictureInPicture:wW,disableRemotePlayback:wW,exportParts:OW,part:DW,prefix:null,property:null,results:$,security:null,unselectable:null},space:`html`,transform:LW}),zW=PW({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:kW,accentHeight:$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$,amplitude:$,arabicForm:null,ascent:$,attributeName:null,attributeType:null,azimuth:$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$,by:null,calcMode:null,capHeight:$,className:DW,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:$,diffuseConstant:$,direction:null,display:null,dur:null,divisor:$,dominantBaseline:null,download:wW,dx:null,dy:null,edgeMode:null,editable:null,elevation:$,enableBackground:null,end:null,event:null,exponent:$,externalResourcesRequired:null,fill:null,fillOpacity:$,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:OW,g2:OW,glyphName:OW,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$,horizOriginX:$,horizOriginY:$,id:null,ideographic:$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$,k:$,k1:$,k2:$,k3:$,k4:$,kernelMatrix:kW,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:$,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:$,overlineThickness:$,paintOrder:null,panose1:null,path:null,pathLength:$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:DW,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:kW,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:kW,rev:kW,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:kW,requiredFeatures:kW,requiredFonts:kW,requiredFormats:kW,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:$,specularExponent:$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$,strikethroughThickness:$,string:null,stroke:null,strokeDashArray:kW,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:kW,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:kW,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$,underlineThickness:$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$,values:null,vAlphabetic:$,vMathematical:$,vectorEffect:null,vHanging:$,vIdeographic:$,version:null,vertAdvY:$,vertOriginX:$,vertOriginY:$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:IW}),BW=PW({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),VW=PW({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:LW}),HW=PW({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),UW={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},WW=/[A-Z]/g,GW=/-[a-z]/g,KW=/^data[-\w.:]+$/i;function qW(e,t){let n=bW(t),r=t,i=xW;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&KW.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(GW,YW);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!GW.test(e)){let n=e.replace(WW,JW);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=MW}return new i(r,t)}function JW(e){return`-`+e.toLowerCase()}function YW(e){return e.charAt(1).toUpperCase()}var XW=yW([FW,RW,BW,VW,HW],`html`),ZW=yW([FW,zW,BW,VW,HW],`svg`);function QW(e){return e.join(` `).trim()}var $W=/\/\*(?:[^*]|\*(?!\/))*\*\//g,eG=/\n/g,tG=/^\s*/,nG=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,rG=/^:\s*/,iG=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,aG=/^[;\s]*/,oG=`
157
157
  `,sG=`/`,cG=`*`,lG=``,uG=`comment`,dG=`declaration`;function fG(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(eG);t&&(n+=t.length);var i=e.lastIndexOf(oG);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(tG)}function u(e){for(var t;t=d();)e.push(t);return e}function d(){var t=a();if(sG==e.charAt(0)&&cG==e.charAt(1)){for(var n=2;lG!=e.charAt(n)&&(cG!=e.charAt(n)||sG!=e.charAt(n+1));)++n;if(n+=2,lG===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:uG,comment:o})}}function f(){var e=a(),t=c(nG);if(t){if(d(),!c(rG))return s(`property missing ':'`);var n=c(iG),r=e({type:dG,property:t[0].replace($W,lG).trim(),value:n?n[0].replace($W,lG).trim():lG});return c(aG),r}}function p(){var e=[];u(e);for(var t;t=f();)e.push(t),u(e);return e}return l(),p()}function pG(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=fG(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n??={},n[r]=a)}),n}var mG=gG(`end`),hG=gG(`start`);function gG(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function _G(e){let t=hG(e),n=mG(e);if(t&&n)return{start:t,end:n}}function vG(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?bG(e.position):`start`in e||`end`in e?bG(e):`line`in e||`column`in e?yG(e):``}function yG(e){return xG(e&&e.line)+`:`+xG(e&&e.column)}function bG(e){return yG(e&&e.start)+`-`+yG(e&&e.end)}function xG(e){return e&&typeof e==`number`?e:1}var SG=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=vG(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Object.defineProperties(SG.prototype,{file:{configurable:!0,enumerable:!0,value:``,writable:!0},name:{configurable:!0,enumerable:!0,value:``,writable:!0},reason:{configurable:!0,enumerable:!0,value:``,writable:!0},message:{configurable:!0,enumerable:!0,value:``,writable:!0},stack:{configurable:!0,enumerable:!0,value:``,writable:!0},column:{configurable:!0,enumerable:!0,writable:!0},line:{configurable:!0,enumerable:!0,writable:!0},ancestors:{configurable:!0,enumerable:!0,writable:!0},cause:{configurable:!0,enumerable:!0,writable:!0},fatal:{configurable:!0,enumerable:!0,writable:!0},place:{configurable:!0,enumerable:!0,writable:!0},ruleId:{configurable:!0,enumerable:!0,writable:!0},source:{configurable:!0,enumerable:!0,writable:!0}});var CG={}.hasOwnProperty,wG=new Map,TG=/[A-Z]/g,EG=/-([a-z])/g,DG=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),OG=new Set([`td`,`th`]),kG=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function AG(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=VG(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=BG(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?ZW:XW,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=jG(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function jG(e,t,n){if(t.type===`element`)return MG(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return NG(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return FG(e,t,n);if(t.type===`mdxjsEsm`)return PG(e,t);if(t.type===`root`)return IG(e,t,n);if(t.type===`text`)return LG(e,t)}function MG(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=ZW,e.schema=i),e.ancestors.push(t);let a=qG(e,t.tagName,!1),o=HG(e,t),s=WG(e,t);return DG.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!gW(e)})),RG(e,o,a,t),zG(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function NG(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}JG(e,t.position)}function PG(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);JG(e,t.position)}function FG(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=ZW,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:qG(e,t.name,!0),o=UG(e,t),s=WG(e,t);return RG(e,o,a,t),zG(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function IG(e,t,n){let r={};return zG(r,WG(e,t)),e.create(t,e.Fragment,r,n)}function LG(e,t){return t.value}function RG(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function zG(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function BG(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function VG(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=hG(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function HG(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&CG.call(t.properties,i)){let a=GG(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&OG.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function UG(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else JG(e,t.position)}else{let{name:i}=r,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else JG(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function WG(e,t){let n=[],r=-1,i=e.passKeys?new Map:wG;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=jG(e,a,o);s!==void 0&&n.push(s)}return n}function GG(e,t,n){if(n==null||typeof n==`number`&&Number.isNaN(n))return;let r=qW(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?uW(n):QW(n)),r.property===`style`?[`style`,typeof n==`object`?e.stylePropertyNameCase===`dom`?n:YG(n):KG(e,String(n))]:[e.elementAttributeNameCase===`react`&&r.space?UW[r.property]||r.property:r.attribute,n]}function KG(e,t){let n={};try{pG(t,function(t,r){if(t&&r){let i=t;i.slice(0,2)!==`--`&&(i=i.toLowerCase(),e.stylePropertyNameCase===`dom`&&(i.slice(0,4)===`-ms-`&&(i=i.slice(1)),i=i.replace(EG,QG))),n[i]=r}})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new SG("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=kG+`#cannot-parse-style-attribute`,r}return n}function qG(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=mW(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=mW(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return CG.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);JG(e)}function JG(e,t){let n=new SG("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=kG+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function YG(e){let t={},n;for(n in e)CG.call(e,n)&&(t[XG(n)]=e[n]);return t}function XG(e){if(e.slice(0,2)===`--`)return e;let t=e.replace(TG,ZG);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function ZG(e){return`-`+e.toLowerCase()}function QG(e,t){return t.toUpperCase()}var $G={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},eK={};function tK(e,t){let n=t||eK;return nK(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function nK(e,t,n){if(iK(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return rK(e.children,t,n)}return Array.isArray(e)?rK(e,t,n):``}function rK(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=nK(e[i],t,n);return r.join(``)}function iK(e){return!!(e&&typeof e==`object`)}var aK=document.createElement(`i`);function oK(e){let t=`&`+e+`;`;aK.innerHTML=t;let n=aK.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function sK(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function cK(e,t){return e.length>0?(sK(e,e.length,0,t),e):t}var lK={}.hasOwnProperty;function uK(e){let t={},n=-1;for(;++n<e.length;)dK(t,e[n]);return t}function dK(e,t){let n;for(n in t){let r=(lK.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){lK.call(r,a)||(r[a]=[]);let e=i[a];fK(r[a],Array.isArray(e)?e:e?[e]:[])}}}function fK(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);sK(e,0,0,r)}function pK(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function mK(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var hK=DK(/[A-Za-z]/),gK=DK(/[\dA-Za-z]/),_K=DK(/[#-'*+\--9=?A-Z^-~]/);function vK(e){return e!==null&&(e<32||e===127)}var yK=DK(/\d/),bK=DK(/[\dA-Fa-f]/),xK=DK(/[!-/:-@[-`{-~]/);function SK(e){return e!==null&&e<-2}function CK(e){return e!==null&&(e<0||e===32)}function wK(e){return e===-2||e===-1||e===32}var TK=DK(/\p{P}|\p{S}/u),EK=DK(/\s/);function DK(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function OK(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&gK(e.charCodeAt(n+1))&&gK(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function kK(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return wK(r)?(e.enter(n),s(r)):t(r)}function s(r){return wK(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function AK(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&wK(t)?(e.enter(r),c(t)):l(t)}function c(t){return wK(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var jK={tokenize:MK};function MK(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),kK(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return SK(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var NK=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){PK(this,e,t,n,!1)}addBefore(e,t,n){PK(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function PK(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var FK={tokenize:LK},IK={tokenize:RK};function LK(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new NK;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(IK,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(IK,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return SK(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new NK;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function RK(e,t,n){return kK(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function zK(e){if(e===null||CK(e)||EK(e))return 1;if(TK(e))return 2}function BK(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var VK={name:`attention`,resolveAll:HK,tokenize:UK};function HK(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};WK(o,-a),WK(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=cK(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=cK(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=cK(r,BK(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=cK(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=cK(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),sK(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function UK(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=zK(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=zK(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function WK(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var GK={name:`autolink`,tokenize:KK};function KK(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return hK(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||gK(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||gK(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||vK(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):_K(t)?(e.consume(t),l):n(t)}function u(e){return gK(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||gK(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var qK={partial:!0,tokenize:JK};function JK(e,t,n){return r;function r(t){return wK(t)?kK(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||SK(e)?t(e):n(e)}}var YK={continuation:{tokenize:ZK},exit:QK,name:`blockQuote`,tokenize:XK};function XK(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return wK(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function ZK(e,t,n){let r=this;return i;function i(t){return wK(t)?kK(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(YK,t,n)(r)}}function QK(e){e.exit(`blockQuote`)}var $K={name:`characterEscape`,tokenize:eq};function eq(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return xK(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var tq={name:`characterReference`,tokenize:nq};function nq(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=gK,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=bK,u):(e.enter(`characterReferenceValue`),a=7,o=yK,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===gK&&!oK(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var rq={partial:!0,tokenize:iq};function iq(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var aq={concrete:!0,name:`codeFenced`,tokenize:oq};function oq(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),wK(t)?kK(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||SK(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(rq,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||SK(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):wK(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),kK(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||SK(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||SK(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&wK(t)?kK(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||SK(t)?e.check(rq,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||SK(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),wK(t)?kK(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),wK(t)?kK(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||SK(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var sq={name:`codeIndented`,tokenize:lq},cq={partial:!0,tokenize:uq};function lq(e,t,n){return r;function r(t){return e.enter(`codeIndented`),AK(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):SK(t)?e.attempt(cq,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||SK(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function uq(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):SK(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):AK(e,t,a,`linePrefix`,4,4)(o)}function a(e){return SK(e)?i(e):n(e)}}var dq={name:`codeText`,previous:pq,resolve:fq,tokenize:mq};function fq(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function pq(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function mq(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):SK(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||SK(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var hq=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&gq(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),gq(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),gq(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);gq(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);gq(this.left,t.reverse())}}}};function gq(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function _q(e){let t={},n=-1,r,i,a,o,s,c,l,u=new hq(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,vq(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return sK(e,0,1/0,u.slice(0)),!l}function vq(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var yq={resolve:xq,tokenize:Sq},bq={partial:!0,tokenize:Cq};function xq(e){return _q(e),e}function Sq(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):SK(t)?e.check(bq,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Cq(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),kK(e,a,`linePrefix`)}function a(i){if(i===null||SK(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function wq(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||vK(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||SK(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||CK(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||vK(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Tq(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):SK(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||SK(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!wK(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Eq(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):SK(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),kK(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||SK(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Dq(e,t){let n;return r;function r(i){return SK(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):wK(i)?kK(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Oq={name:`definition`,tokenize:Aq},kq={partial:!0,tokenize:jq};function Aq(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Tq.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=mK(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return CK(t)?Dq(e,l)(t):l(t)}function l(t){return wq(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(kq,d,d)(t)}function d(t){return wK(t)?kK(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||SK(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function jq(e,t,n){return r;function r(t){return CK(t)?Dq(e,i)(t):n(t)}function i(t){return Eq(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return wK(t)?kK(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||SK(e)?t(e):n(e)}}var Mq={name:`hardBreakEscape`,tokenize:Nq};function Nq(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return SK(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Pq={name:`headingAtx`,resolve:Fq,tokenize:Iq};function Fq(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};sK(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function Iq(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||CK(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||SK(n)?(e.exit(`atxHeading`),t(n)):wK(n)?kK(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||CK(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Lq=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Rq=[`pre`,`script`,`style`,`textarea`],zq={concrete:!0,name:`htmlFlow`,resolveTo:Vq,tokenize:Hq},Bq={partial:!0,tokenize:Uq};function Vq(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Hq(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:ne):hK(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):hK(a)?(e.consume(a),i=4,r.interrupt?t:ne):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:ne):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return hK(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||CK(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Rq.includes(l)?(i=1,r.interrupt?t(s):O(s)):Lq.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||gK(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return wK(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||hK(t)?(e.consume(t),b):wK(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||gK(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):wK(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):wK(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||SK(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||CK(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||wK(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||SK(t)?O(t):wK(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),ee):t===62&&i===4?(e.consume(t),re):t===63&&i===3?(e.consume(t),ne):t===93&&i===5?(e.consume(t),te):SK(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Bq,ie,k)(t)):t===null||SK(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(rq,A,ie)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||SK(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),ne):O(t)}function ee(t){return t===47?(e.consume(t),o=``,N):O(t)}function N(t){if(t===62){let n=o.toLowerCase();return Rq.includes(n)?(e.consume(t),re):O(t)}return hK(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),N):O(t)}function te(t){return t===93?(e.consume(t),ne):O(t)}function ne(t){return t===62?(e.consume(t),re):t===45&&i===2?(e.consume(t),ne):O(t)}function re(t){return t===null||SK(t)?(e.exit(`htmlFlowData`),ie(t)):(e.consume(t),re)}function ie(n){return e.exit(`htmlFlow`),t(n)}}function Uq(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(qK,t,n)}}var Wq={name:`htmlText`,tokenize:Gq};function Gq(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):hK(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):hK(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):SK(t)?(o=d,ee(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):SK(t)?(o=h,ee(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):SK(t)?(o=v,ee(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):SK(t)?(o=y,ee(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return hK(t)?(e.consume(t),S):n(t)}function S(t){return t===45||gK(t)?(e.consume(t),S):C(t)}function C(t){return SK(t)?(o=C,ee(t)):wK(t)?(e.consume(t),C):M(t)}function w(t){return t===45||gK(t)?(e.consume(t),w):t===47||t===62||CK(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||hK(t)?(e.consume(t),E):SK(t)?(o=T,ee(t)):wK(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||gK(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):SK(t)?(o=D,ee(t)):wK(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):SK(t)?(o=O,ee(t)):wK(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):SK(t)?(o=k,ee(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||CK(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||CK(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function ee(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),N}function N(t){return wK(t)?kK(e,te,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):te(t)}function te(t){return e.enter(`htmlTextData`),o(t)}}var Kq={name:`labelEnd`,resolveAll:Xq,resolveTo:Zq,tokenize:Qq},qq={tokenize:$q},Jq={tokenize:eJ},Yq={tokenize:tJ};function Xq(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&sK(e,0,e.length,n),e}function Zq(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=cK(o,e.slice(i+1,i+r+3)),o=cK(o,[[`enter`,l,t]]),o=cK(o,BK(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=cK(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=cK(o,e.slice(a+1)),o=cK(o,[[`exit`,s,t]]),sK(e,i,e.length,o),e}function Qq(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(mK(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(qq,u,o?u:d)(t):t===91?e.attempt(Jq,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Yq,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function $q(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return CK(t)?Dq(e,a)(t):a(t)}function a(t){return t===41?u(t):wq(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return CK(t)?Dq(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Eq(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return CK(t)?Dq(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function eJ(e,t,n){let r=this;return i;function i(t){return Tq.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(mK(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function tJ(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var nJ={name:`labelStartImage`,resolveAll:Kq.resolveAll,tokenize:rJ};function rJ(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var iJ={name:`labelStartLink`,resolveAll:Kq.resolveAll,tokenize:aJ};function aJ(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var oJ={name:`lineEnding`,tokenize:sJ};function sJ(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),kK(e,t,`linePrefix`)}}var cJ={name:`thematicBreak`,tokenize:lJ};function lJ(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||SK(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),wK(t)?kK(e,s,`whitespace`)(t):s(t))}}var uJ={continuation:{tokenize:mJ},exit:gJ,name:`list`,tokenize:pJ},dJ={partial:!0,tokenize:_J},fJ={partial:!0,tokenize:hJ};function pJ(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:yK(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(cJ,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return yK(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(qK,r.interrupt?n:u,e.attempt(dJ,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return wK(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function mJ(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(qK,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,kK(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!wK(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(fJ,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,kK(e,e.attempt(uJ,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function hJ(e,t,n){let r=this;return kK(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function gJ(e){e.exit(this.containerState.type)}function _J(e,t,n){let r=this;return kK(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!wK(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var vJ={name:`setextUnderline`,resolveTo:yJ,tokenize:bJ};function yJ(e,t){let n=new NK,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function bJ(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),wK(t)?kK(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||SK(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var xJ={tokenize:SJ};function SJ(e){let t=this,n=e.attempt(qK,r,e.attempt(this.parser.constructs.flowInitial,i,kK(e,e.attempt(this.parser.constructs.flow,i,e.attempt(yq,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var CJ={resolveAll:DJ()},wJ=EJ(`string`),TJ=EJ(`text`);function EJ(e){return{resolveAll:DJ(e===`text`?OJ:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function DJ(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):t[r]&&t[r][1].type===`data`||(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function OJ(e,t){let n=new NK,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var kJ=s({attentionMarkers:()=>LJ,contentInitial:()=>jJ,disable:()=>RJ,document:()=>AJ,flow:()=>NJ,flowInitial:()=>MJ,insideSpan:()=>IJ,string:()=>PJ,text:()=>FJ}),AJ={42:uJ,43:uJ,45:uJ,48:uJ,49:uJ,50:uJ,51:uJ,52:uJ,53:uJ,54:uJ,55:uJ,56:uJ,57:uJ,62:YK},jJ={91:Oq},MJ={[-2]:sq,[-1]:sq,32:sq},NJ={35:Pq,42:cJ,45:[vJ,cJ],60:zq,61:vJ,95:cJ,96:aq,126:aq},PJ={38:tq,92:$K},FJ={[-5]:oJ,[-4]:oJ,[-3]:oJ,33:nJ,38:tq,42:VK,60:[GK,Wq],91:iJ,92:[Mq,$K],93:Kq,95:VK,96:dq},IJ={null:[VK,CJ]},LJ={null:[42,95]},RJ={null:[]};function zJ(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=cK(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=BK(a,l.events,l),l.events):[]}function f(e,t){return VJ(p(e),t)}function p(e){return BJ(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){SK(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&sK(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function BJ(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function VJ(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
158
158
  `;break;case-3:o=`\r
@@ -205,4 +205,4 @@ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(
205
205
  }
206
206
  `}),o.appendChild(r.createTextNode(e))}i.timeEnd(`clone node`),await f?.(h),l!==!1&&Q4(h)&&(i.time(`embed web font`),await C6(h,n),i.timeEnd(`embed web font`)),i.time(`embed node`),S6(h,n);let g=a.length,_=0,v=async()=>{for(;;){let e=a.pop();if(!e)break;try{await e}catch(e){n.log.warn(`Failed to run task`,e)}u?.(++_,g)}};u?.(_,g),await Promise.all([...Array.from({length:4})].map(v)),i.timeEnd(`embed node`),await p?.(h);let y=P6(h,n);return s&&y.insertBefore(s,y.children[0]),o&&y.insertBefore(o,y.children[0]),d&&u6(n),await m?.(y),y}function P6(e,t){let{width:n,height:r}=t,i=x3(n,r,e.ownerDocument),a=i.ownerDocument.createElementNS(i.namespaceURI,`foreignObject`);return a.setAttributeNS(null,`x`,`0%`),a.setAttributeNS(null,`y`,`0%`),a.setAttributeNS(null,`width`,`100%`),a.setAttributeNS(null,`height`,`100%`),a.append(e),i.appendChild(a),i}async function F6(e,t){let n=await I3(e,t),r=await N6(n),i=S3(r,n.isEnable(`removeControlCharacter`));return n.autoDestruct||(n.svgStyleElement=R3(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(b3,`defs`),n.svgStyles.clear()),await B3(O3(i,r.ownerDocument),n)}async function I6(e,t){let n=await I3(e,t),{log:r,type:i,quality:a,dpi:o}=n,s=await F6(n);r.time(`canvas to blob`);let c=await C3(s,i,a);if([`image/png`,`image/jpeg`].includes(i)&&o){let e=await D3(c.slice(0,33)),t=new Uint8Array(e);return i===`image/png`?t=z4(t,o):i===`image/jpeg`&&(t=A4(t,o)),r.timeEnd(`canvas to blob`),new Blob([t,c.slice(33)],{type:i})}return r.timeEnd(`canvas to blob`),c}var L6=`https://dissentry.lihaila.com`;function R6(e,t=900){if(e.length<=t)return e;let n=e.slice(0,t),r=n.lastIndexOf(`
207
207
 
208
- `),i=Math.max(n.lastIndexOf(`. `),n.lastIndexOf(`。`),n.lastIndexOf(`! `),n.lastIndexOf(`? `));return r>t*.5?n=n.slice(0,r):i>t*.5&&(n=n.slice(0,i+1)),(n.match(/```/g)??[]).length%2==1&&(n+="\n```"),`${n.trimEnd()}\n\n…`}async function z6(e){return await document.fonts?.ready,I6(e,{scale:2,backgroundColor:`#ffffff`,type:`image/png`,font:!1})}function B6(e,t){let n=URL.createObjectURL(e);Object.assign(document.createElement(`a`),{href:n,download:t}).click(),setTimeout(()=>URL.revokeObjectURL(n),2e3)}async function V6(e){try{return!(`ClipboardItem`in window)||!navigator.clipboard?.write?!1:(await navigator.clipboard.write([new ClipboardItem({"image/png":Promise.resolve(e)})]),!0)}catch{return!1}}function H6(){try{let e=new File([new Blob],`x.png`,{type:`image/png`});return!!navigator.canShare?.({files:[e]})}catch{return!1}}var U6=e=>`https://x.com/intent/post?text=${encodeURIComponent(e)}`,W6={minor:{bg:`#fef3c7`,fg:`#92400e`},major:{bg:`#ffedd5`,fg:`#9a3412`},critical:{bg:`#fee2e2`,fg:`#b91c1c`}},G6=(0,y.forwardRef)(function({question:e,answer:t,author:n,notes:r,checks:i,profiles:a,userName:o},s){let c=Dn(),l=r.filter(e=>e.status!==`dismissed`).slice(0,2),u=i.filter(e=>e.verdict===`ok`).map(e=>a.get(e.profileId)).filter(Boolean),d=L6.replace(/^https:\/\//,``);return(0,R.jsxs)(`div`,{ref:s,className:`share-card`,style:{width:1200,padding:56,fontFamily:`var(--font-sans)`,position:`relative`,overflow:`hidden`,background:`radial-gradient(900px 500px at 0% 0%, #fde68a 0%, transparent 60%), radial-gradient(800px 600px at 100% 10%, #fbcfe8 0%, transparent 55%), radial-gradient(900px 700px at 60% 110%, #c7d2fe 0%, transparent 60%), #fff7ed`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:36},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14},children:[(0,R.jsxs)(`svg`,{width:`44`,height:`44`,viewBox:`0 0 64 64`,"aria-hidden":!0,children:[(0,R.jsx)(`rect`,{width:`64`,height:`64`,rx:`14`,fill:`#0f172a`}),(0,R.jsx)(`path`,{d:`M18 16h14a16 16 0 0 1 0 32H18z`,fill:`none`,stroke:`#fff`,strokeWidth:`6`}),(0,R.jsx)(`circle`,{cx:`46`,cy:`18`,r:`7`,fill:`#f59e0b`})]}),(0,R.jsx)(`span`,{style:{fontSize:30,fontWeight:800,letterSpacing:-.5,color:`#0f172a`},children:`Dissentry`})]}),(0,R.jsx)(K6,{kind:l.length?`dissent`:u.length?`checked`:null,label:l.length?c(`card.stampDissent`):c(`card.stampChecked`)})]}),(0,R.jsxs)(`div`,{style:{background:`#fff`,borderRadius:36,boxShadow:`0 1px 0 rgba(15,23,42,.04), 0 30px 80px -30px rgba(15,23,42,.35)`,padding:48},children:[e&&(0,R.jsxs)(`div`,{style:{display:`flex`,gap:20,marginBottom:32,paddingBottom:32,borderBottom:`1px solid #f1f5f9`},children:[(0,R.jsx)(Pr,{user:o,size:56}),(0,R.jsx)(`p`,{style:{fontSize:30,lineHeight:1.45,color:`#0f172a`,margin:0,whiteSpace:`pre-wrap`,wordBreak:`break-word`},children:R6(e.text,400)})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:20},children:[(0,R.jsx)(Pr,{profile:n,size:64}),(0,R.jsxs)(`div`,{style:{minWidth:0,flex:1},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`baseline`,gap:12,marginBottom:10,flexWrap:`wrap`},children:[(0,R.jsx)(`span`,{style:{fontSize:28,fontWeight:800,color:`#0f172a`},children:n?.name??`—`}),(0,R.jsxs)(`span`,{style:{fontSize:24,color:`#64748b`},children:[`@`,n?.handle]}),n&&(0,R.jsx)(`span`,{style:{fontSize:18,color:`#64748b`,background:`#f1f5f9`,borderRadius:8,padding:`3px 10px`},children:n.modelId})]}),(0,R.jsx)(`div`,{className:`share-md`,children:(0,R.jsx)(T4,{text:iW(R6(t.text),l)})})]})]}),l.map(e=>{let t=[a.get(e.profileId),...e.agreeProfileIds.map(e=>a.get(e))].filter(Boolean),n=W6[e.severity];return(0,R.jsxs)(`div`,{style:{marginTop:28,borderRadius:24,border:`2px solid #fcd34d`,background:`linear-gradient(180deg,#fffbeb,#fffdf5)`,padding:`26px 30px`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,flexWrap:`wrap`},children:[(0,R.jsx)(`span`,{style:{display:`flex`},children:t.slice(0,4).map((e,t)=>(0,R.jsx)(`span`,{style:{marginLeft:t?-10:0,borderRadius:999,boxShadow:`0 0 0 3px #fffbeb`},children:(0,R.jsx)(Pr,{profile:e,size:36})},e.id))}),(0,R.jsxs)(`span`,{style:{fontSize:24,fontWeight:800,color:`#78350f`},children:[`📝 `,c(`note.title`)]}),(0,R.jsxs)(`span`,{style:{fontSize:22,color:`#57534e`},children:[t.map(e=>`@${e.handle}`).join(` · `),t.length>1?` · ${c(`card.agree`)}`:``]}),(0,R.jsx)(`span`,{style:{fontSize:16,fontWeight:800,textTransform:`uppercase`,letterSpacing:1,background:n.bg,color:n.fg,borderRadius:999,padding:`4px 12px`},children:c(`sev.${e.severity}`)})]}),(0,R.jsx)(`p`,{style:{margin:`16px 0 0`,paddingLeft:16,borderLeft:`4px solid #fcd34d`,fontSize:24,fontStyle:`italic`,color:`#57534e`,lineHeight:1.45},children:e.claim}),(0,R.jsx)(`div`,{className:`share-md share-md-note`,style:{marginTop:12},children:(0,R.jsx)(T4,{text:R6(e.correction,420)})})]},e.id)}),l.length===0&&u.length>0&&(0,R.jsxs)(`div`,{style:{marginTop:28,display:`flex`,alignItems:`center`,gap:14,borderRadius:20,background:`#ecfdf5`,border:`1px solid #a7f3d0`,padding:`18px 24px`},children:[(0,R.jsx)(`span`,{style:{fontSize:26,color:`#047857`,fontWeight:800},children:`✓`}),(0,R.jsx)(`span`,{style:{display:`flex`},children:u.slice(0,5).map((e,t)=>(0,R.jsx)(`span`,{style:{marginLeft:t?-10:0,borderRadius:999,boxShadow:`0 0 0 3px #ecfdf5`},children:(0,R.jsx)(Pr,{profile:e,size:34})},e.id))}),(0,R.jsx)(`span`,{style:{fontSize:24,color:`#065f46`},children:c(`card.noDissent`,{handles:u.map(e=>`@${e.handle}`).join(` `)})})]})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginTop:30},children:[(0,R.jsx)(`span`,{style:{fontSize:26,fontWeight:800,color:`#0f172a`,letterSpacing:-.3},children:c(`card.tagline`)}),(0,R.jsx)(`span`,{style:{fontSize:22,fontWeight:600,color:`#0f172a`,background:`rgba(255,255,255,.7)`,borderRadius:999,padding:`8px 18px`},children:d})]})]})});function K6({kind:e,label:t}){if(!e)return null;let n=e===`dissent`?{fg:`#b45309`,ring:`#f59e0b`,bg:`#fffbeb`}:{fg:`#047857`,ring:`#10b981`,bg:`#ecfdf5`};return(0,R.jsxs)(`span`,{style:{transform:`rotate(-4deg)`,display:`inline-flex`,alignItems:`center`,gap:10,padding:`10px 22px`,borderRadius:14,border:`4px solid ${n.ring}`,background:n.bg,color:n.fg,fontSize:26,fontWeight:900,letterSpacing:3,textTransform:`uppercase`,boxShadow:`0 10px 30px -12px rgba(15,23,42,.3)`},children:[e===`dissent`?`📝`:`✓`,` `,t]})}function q6({post:e,profiles:t,onClose:n}){let r=Dn(),i=dU(),a=(0,y.useRef)(null),[o,s]=(0,y.useState)(!0),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(!0),[f,p]=(0,y.useState)(``),[m,h]=(0,y.useState)(``),g=ne(async()=>({question:[...(await DU(e)).slice(0,-1)].reverse().find(e=>e.kind===`user`),notes:await F.notes.where(`postId`).equals(e.id).sortBy(`createdAt`),checks:await F.checks.where(`postId`).equals(e.id).toArray()}),[e.id]),_=e.profileId?t.get(e.profileId):void 0,v=(0,y.useMemo)(()=>c?URL.createObjectURL(c):``,[c]);(0,y.useEffect)(()=>()=>{v&&URL.revokeObjectURL(v)},[v]),(0,y.useEffect)(()=>{if(!g||!a.current)return;let e=!1;d(!0);let t=setTimeout(async()=>{try{let t=await z6(a.current);e||(l(t),h(``))}catch(t){e||h(r(`share.failed`,{error:t.message}))}finally{e||d(!1)}},250);return()=>{e=!0,clearTimeout(t)}},[g,o,r]),(0,y.useEffect)(()=>{let e=e=>e.key===`Escape`&&n();return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n]);let b=(g?.notes??[]).filter(e=>e.status!==`dismissed`),x=(g?.checks??[]).filter(e=>e.verdict===`ok`),S=_?.name??`AI`,C=e=>[...new Set(e)].map(e=>t.get(e)?.name).filter(Boolean).join(`, `),w=b.length?r(`share.tweetNote`,{author:S,checkers:C(b.flatMap(e=>[e.profileId,...e.agreeProfileIds]))}):x.length?r(`share.tweetOk`,{author:S,checkers:C(x.map(e=>e.profileId))}):r(`share.tweetPlain`,{author:S}),T=`dissentry-${_?.handle??`answer`}-${e.id.slice(0,6)}.png`,E=e=>{p(e),setTimeout(()=>p(``),2500)};async function D(){c&&E(await V6(c)?r(`share.copied`):r(`share.copyUnsupported`))}async function O(){if(!c)return;let e=await V6(c);e||B6(c,T),window.open(U6(`${w}\n\n${L6}`),`_blank`,`noopener`),E(r(e?`share.pasteHint`:`share.attachHint`))}async function k(){if(c)try{await navigator.share({files:[new File([c],T,{type:`image/png`})],text:`${w} ${L6}`})}catch{}}let A=`flex items-center justify-center gap-1.5 rounded-full px-4 py-2.5 text-[14px] font-semibold transition disabled:opacity-50`;return(0,R.jsx)(`div`,{className:`fixed inset-0 z-50 flex cursor-default items-start justify-center overflow-y-auto bg-slate-900/40 p-3 py-[5vh] backdrop-blur-[2px]`,onClick:e=>{e.stopPropagation(),e.target===e.currentTarget&&n()},children:(0,R.jsxs)(`div`,{className:`w-full max-w-[600px] rounded-3xl bg-white shadow-2xl shadow-slate-900/20 ring-1 ring-slate-200`,onClick:e=>e.stopPropagation(),children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between border-b border-slate-100 px-4 py-2.5`,children:[(0,R.jsx)(`button`,{onClick:n,className:`flex h-8 w-8 items-center justify-center rounded-full text-slate-500 hover:bg-slate-100`,"aria-label":r(`common.close`),children:`✕`}),(0,R.jsx)(`span`,{className:`text-[14px] font-semibold`,children:r(`share.title`)}),(0,R.jsx)(`span`,{className:`w-8`})]}),(0,R.jsxs)(`div`,{className:`p-6 pb-4`,children:[(0,R.jsxs)(`div`,{className:`relative overflow-hidden rounded-2xl bg-slate-100 ring-1 ring-slate-200`,style:{aspectRatio:v?void 0:`1200 / 900`},children:[v&&(0,R.jsx)(`img`,{src:v,alt:r(`share.title`),className:`block w-full`}),u&&(0,R.jsx)(`div`,{className:`flex items-center justify-center ${v?`absolute inset-0 bg-white/40`:`h-full`}`,children:(0,R.jsx)(`span`,{className:`rounded-full bg-white px-3 py-1.5 text-[12.5px] font-medium text-slate-600 shadow-sm`,children:r(`share.rendering`)})})]}),(0,R.jsx)(`div`,{"aria-hidden":!0,style:{position:`fixed`,left:-1e5,top:0,pointerEvents:`none`},children:g&&(0,R.jsx)(G6,{ref:a,question:o?g.question:void 0,answer:e,author:_,notes:g.notes,checks:g.checks,profiles:t,userName:fU(i,r(`post.youName`))})}),g?.question&&(0,R.jsxs)(`label`,{className:`mt-3 flex cursor-pointer items-center gap-2 text-[13.5px] text-slate-600`,children:[(0,R.jsx)(`input`,{type:`checkbox`,className:`accent-slate-900`,checked:o,onChange:e=>s(e.target.checked)}),r(`share.includeQuestion`)]}),m&&(0,R.jsx)(`p`,{className:`mt-2 rounded-xl bg-red-50 px-3 py-2 text-[13px] text-red-700`,children:m}),(0,R.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-2 sm:grid-cols-3`,children:[(0,R.jsxs)(`button`,{onClick:()=>void O(),disabled:!c,className:`${A} col-span-2 bg-ink text-white hover:bg-slate-800 sm:col-span-1`,children:[(0,R.jsx)(J6,{}),` `,r(`share.postX`)]}),(0,R.jsxs)(`button`,{onClick:()=>void D(),disabled:!c,className:`${A} border border-slate-200 hover:bg-slate-50`,children:[(0,R.jsx)(vt,{size:16}),` `,r(`share.copy`)]}),(0,R.jsxs)(`button`,{onClick:()=>c&&B6(c,T),disabled:!c,className:`${A} border border-slate-200 hover:bg-slate-50`,children:[(0,R.jsx)(bt,{size:16}),` `,r(`share.download`)]}),H6()&&(0,R.jsxs)(`button`,{onClick:()=>void k(),disabled:!c,className:`${A} col-span-2 border border-slate-200 hover:bg-slate-50 sm:col-span-3`,children:[(0,R.jsx)(Jt,{size:16}),` `,r(`share.native`)]})]}),(0,R.jsx)(`p`,{className:`mt-3 flex min-h-[20px] items-center gap-1.5 text-[12.5px] text-slate-500`,children:f?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(ft,{size:14,className:`text-emerald-600`}),f]}):r(`share.privacy`)})]})]})})}function J6(){return(0,R.jsx)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":!0,children:(0,R.jsx)(`path`,{d:`M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z`})})}function Y6({post:e,profiles:t,lineBelow:n,focused:r,onReply:i}){let a=Dn(),[,o]=Pe(),s=dU(),[c,l]=(0,y.useState)(!1),[u,d]=(0,y.useState)(!1),[f,p]=(0,y.useState)(!1),m=e.profileId?t.get(e.profileId):void 0,h=ne(()=>F.notes.where(`postId`).equals(e.id).sortBy(`createdAt`),[e.id])??[],g=ne(()=>F.checks.where(`postId`).equals(e.id).toArray(),[e.id])??[],_=ne(()=>F.posts.where(`parentId`).equals(e.id).count(),[e.id])??0,v=ne(()=>e.quoteOfId?F.posts.get(e.quoteOfId):void 0,[e.quoteOfId]),b=ne(()=>e.respondsToNoteId?F.notes.get(e.respondsToNoteId):void 0,[e.respondsToNoteId]),x=e=>e.map(e=>`@${t.get(e)?.handle??`?`}`).join(` `),S=g.filter(e=>e.verdict===`pending`).map(e=>e.profileId),C=g.filter(e=>e.verdict===`ok`).map(e=>e.profileId),w=g.filter(e=>e.verdict===`error`),T=h.filter(e=>e.status!==`dismissed`||r),E=e.kind===`user`,D=E?fU(s,a(`post.youName`)):m?.name??a(`post.deletedModel`),O=E?a(`post.you`):m?.handle??`—`,k=()=>{r||o(`/post/${e.id}`)};return(0,R.jsxs)(`article`,{onClick:e=>{!e.target.closest(`a,button,pre,input,textarea`)&&!window.getSelection()?.toString()&&k()},className:`relative flex gap-3 px-4 pt-3.5 ${n?`pb-0.5`:`pb-2`} ${r?``:`cursor-pointer transition-colors hover:bg-slate-50/60`}`,children:[(0,R.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,R.jsx)(Pr,{profile:m,user:E?fU(s,a(`post.youName`)):void 0}),n&&(0,R.jsx)(`div`,{className:`mt-1.5 w-0.5 flex-1 rounded-full bg-slate-200`})]}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1 pb-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline gap-1.5 text-[15px]`,children:[(0,R.jsx)(`span`,{className:`truncate font-bold text-ink`,children:D}),(0,R.jsxs)(`span`,{className:`truncate text-slate-500`,children:[`@`,O]}),m&&(0,R.jsx)(`span`,{className:`hidden truncate rounded-md bg-slate-100 px-1.5 py-px text-[11px] font-medium text-slate-500 sm:inline`,children:m.modelId}),(0,R.jsx)(`span`,{className:`text-slate-300`,children:`·`}),(0,R.jsx)(`span`,{className:`shrink-0 text-slate-500`,title:nW(e.createdAt),children:tW(e.createdAt)})]}),b&&(0,R.jsx)(`p`,{className:`text-[13px] text-slate-500`,children:a(`post.respondingTo`,{handle:t.get(b.profileId)?.handle??`?`})}),(0,R.jsx)(`div`,{className:`mt-0.5 text-slate-800 ${r?`text-[16.5px]`:``}`,children:E?(0,R.jsx)(`p`,{className:`whitespace-pre-wrap text-[15px] leading-relaxed`,children:Q6(e.text)}):e.text?(0,R.jsx)(T4,{text:e.status===`done`?iW(e.text,h):e.text,streaming:e.status===`streaming`}):e.status===`streaming`&&(0,R.jsxs)(`span`,{className:`dots text-2xl leading-none text-slate-400`,children:[(0,R.jsx)(`span`,{children:`•`}),(0,R.jsx)(`span`,{children:`•`}),(0,R.jsx)(`span`,{children:`•`})]})}),e.status===`error`&&(0,R.jsxs)(`div`,{className:`mt-2 flex items-start gap-2 rounded-xl border border-red-200 bg-red-50 p-2.5 text-[13.5px] text-red-800`,children:[(0,R.jsx)(`span`,{className:`flex-1`,children:e.error}),(0,R.jsx)(`button`,{onClick:t=>{t.stopPropagation(),WU(e)},className:`shrink-0 font-semibold underline`,children:a(`post.retry`)})]}),e.status===`stopped`&&(0,R.jsx)(`p`,{className:`mt-1 text-[13px] text-slate-500`,children:a(`post.stopped`)}),v&&(0,R.jsxs)(`div`,{onClick:e=>{e.stopPropagation(),o(`/post/${v.id}`)},className:`mt-2.5 max-h-56 cursor-pointer overflow-hidden rounded-2xl border border-slate-200 p-3 transition [mask-image:linear-gradient(to_bottom,black_75%,transparent)] hover:bg-slate-50/60`,children:[(0,R.jsx)(Z6,{post:v,profiles:t,userName:fU(s,a(`post.youName`))}),(0,R.jsx)(`div`,{className:`text-[14px]`,children:(0,R.jsx)(T4,{text:v.text})})]}),T.map(e=>(0,R.jsx)(D4,{note:e,profiles:t,author:m},e.id)),e.kind===`model`&&g.length>0&&(0,R.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-x-3 gap-y-0.5 text-[12.5px] text-slate-500`,children:[S.length>0&&(0,R.jsxs)(`span`,{children:[a(`post.checking`,{handles:x(S)}),(0,R.jsxs)(`span`,{className:`dots`,children:[(0,R.jsx)(`span`,{children:`.`}),(0,R.jsx)(`span`,{children:`.`}),(0,R.jsx)(`span`,{children:`.`})]})]}),C.length>0&&(0,R.jsxs)(`span`,{className:`flex items-center gap-1 text-emerald-700`,children:[(0,R.jsx)(ft,{size:13}),a(`post.noDissent`,{handles:x(C)})]}),w.map(e=>(0,R.jsxs)(`span`,{className:`text-red-500`,title:e.error,children:[`⚠ `,a(`post.couldNotCheck`,{handle:t.get(e.profileId)?.handle??`?`})]},e.profileId))]}),e.kind===`model`&&e.usage&&(0,R.jsx)($6,{post:e,checks:g,profiles:t}),(0,R.jsxs)(`div`,{className:`-ml-2 mt-1 flex max-w-md justify-between text-slate-400`,children:[(0,R.jsx)(X6,{label:a(`post.reply`),onClick:()=>i?i():o(`/post/${e.id}?reply=1`),icon:(0,R.jsx)(Pt,{size:17}),count:_,hover:`hover:text-sky-600 hover:bg-sky-50`}),(0,R.jsx)(X6,{label:a(`post.quote`),onClick:()=>l(!0),icon:(0,R.jsx)(Bt,{size:17}),hover:`hover:text-emerald-600 hover:bg-emerald-50`}),e.kind===`model`&&e.status===`streaming`&&(0,R.jsx)(X6,{label:a(`post.stop`),onClick:()=>IU(e.id),icon:(0,R.jsx)(nn,{size:16}),hover:`hover:text-red-600 hover:bg-red-50`}),e.kind===`model`&&e.status===`done`&&(0,R.jsx)(X6,{label:a(`post.checkAgain`),onClick:()=>void UU(e),icon:(0,R.jsx)(Wt,{size:17}),hover:`hover:text-amber-600 hover:bg-amber-50`}),e.kind===`model`&&e.status===`done`&&(0,R.jsx)(X6,{label:a(`post.share`),onClick:()=>d(!0),icon:(0,R.jsx)(Ot,{size:17}),hover:`hover:text-ink hover:bg-slate-100`}),e.kind===`model`&&e.status!==`streaming`&&(0,R.jsx)(X6,{label:a(`post.regenerate`),onClick:()=>void WU(e),icon:(0,R.jsx)(Ht,{size:16}),hover:`hover:text-violet-600 hover:bg-violet-50`}),(0,R.jsx)(X6,{label:a(f?`post.copied`:`post.copy`),onClick:()=>{navigator.clipboard.writeText(e.text),p(!0),setTimeout(()=>p(!1),1200)},icon:f?(0,R.jsx)(ft,{size:16}):(0,R.jsx)(vt,{size:16}),hover:`hover:text-sky-600 hover:bg-sky-50`}),(0,R.jsx)(X6,{label:a(`post.delete`),onClick:()=>{window.confirm(a(`post.deleteConfirm`))&&AU(e.id).then(()=>r&&o(`/`))},icon:(0,R.jsx)(an,{size:16}),hover:`hover:text-red-600 hover:bg-red-50`})]})]}),c&&(0,R.jsx)(k4,{post:e,profiles:t,onClose:()=>l(!1)}),u&&(0,R.jsx)(q6,{post:e,profiles:t,onClose:()=>d(!1)})]})}function X6({label:e,onClick:t,icon:n,count:r,hover:i}){return(0,R.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),t()},title:e,"aria-label":e,className:`flex items-center gap-1 rounded-full p-2 text-[13px] transition-colors ${i}`,children:[n,r?(0,R.jsx)(`span`,{children:r}):null]})}function Z6({post:e,profiles:t,userName:n}){let r=Dn(),i=e.profileId?t.get(e.profileId):void 0;return(0,R.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[14px]`,children:[(0,R.jsx)(Pr,{profile:i,user:e.kind===`user`?n:void 0,size:20}),(0,R.jsx)(`b`,{className:`truncate`,children:e.kind===`user`?n:i?.name}),(0,R.jsxs)(`span`,{className:`truncate text-slate-500`,children:[`@`,e.kind===`user`?r(`post.you`):i?.handle,` · `,tW(e.createdAt)]})]})}function Q6(e){return e.split(/(@[a-z0-9][a-z0-9_.-]*)/gi).map((e,t)=>e.startsWith(`@`)?(0,R.jsx)(`span`,{className:`font-medium text-sky-600`,children:e},t):e)}function $6({post:e,checks:t,profiles:n}){let r=Dn(),i=e.profileId?n.get(e.profileId):void 0,a=e.usage,o=t.filter(e=>e.usage),s=o.reduce((e,t)=>e+t.usage.input+t.usage.output,0),c=[oW(a,i),...o.map(e=>oW(e.usage,n.get(e.profileId)))],l=c.every(e=>e!==void 0),u=c.reduce((e,t)=>e+(t??0),0),d=r(`usage.postTip`,{i:a.input,o:a.output,c:s});return(0,R.jsxs)(`p`,{className:`mt-1.5 text-[11.5px] tabular-nums text-slate-400`,title:d,children:[r(`usage.postLine`,{a:sW(a.input+a.output),c:sW(s)}),u>0&&(0,R.jsxs)(R.Fragment,{children:[` · `,l?``:`≥ `,cW(u)]})]})}var e8=30;function t8(){let e=Dn();Dr();let t=Er(),[n,r]=(0,y.useState)(e8),i=ne(async()=>{let e=await F.posts.orderBy(`createdAt`).reverse().filter(e=>!e.parentId).limit(n).toArray(),t=await F.posts.where(`parentId`).anyOf(e.map(e=>e.id)).sortBy(`createdAt`),r=new Map;for(let e of t)r.set(e.parentId,[...r.get(e.parentId)??[],e]);return e.map(e=>({post:e,replies:r.get(e.id)??[]}))},[n]);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($U,{title:e(`home.title`),sub:e(`home.sub`)}),t.size===0?(0,R.jsx)(r8,{}):(0,R.jsx)(`div`,{className:`border-b border-slate-200/80`,children:(0,R.jsx)(qU,{})}),i?.length===0&&t.size>0&&(0,R.jsx)(i8,{}),i?.map(({post:e,replies:n})=>(0,R.jsxs)(`div`,{className:`border-b border-slate-200/80`,children:[(0,R.jsx)(Y6,{post:e,profiles:t,lineBelow:n.length>0}),n.map((e,r)=>(0,R.jsx)(Y6,{post:e,profiles:t,lineBelow:r<n.length-1},e.id))]},e.id)),i&&i.length>=n&&(0,R.jsx)(`button`,{onClick:()=>r(e=>e+e8),className:`w-full py-4 text-[14px] font-medium text-sky-600 hover:bg-slate-50`,children:e(`home.more`)})]})}var n8=[`openai`,`anthropic`,`google`,`deepseek`,`qwen`,`xai`];function r8(){let e=Dn();return(0,R.jsxs)(`div`,{className:`px-6 pb-12 pt-10 text-center sm:px-10`,children:[(0,R.jsxs)(`div`,{className:`mx-auto mb-7 flex w-fit -space-x-2.5`,children:[n8.map((e,t)=>(0,R.jsx)(`span`,{className:`flex h-12 w-12 items-center justify-center rounded-full border border-slate-200 bg-white shadow-sm ring-4 ring-white`,style:{transform:`translateY(${t%2?6:0}px)`},children:(0,R.jsx)(`img`,{src:Zn(e),alt:``,className:`h-6 w-6`})},e)),(0,R.jsx)(`span`,{className:`flex h-12 w-12 items-center justify-center rounded-full bg-amber-400 text-xl shadow-sm ring-4 ring-white`,children:`📝`})]}),(0,R.jsx)(`h2`,{className:`text-balance text-[28px] font-extrabold leading-tight tracking-tight text-ink sm:text-[32px]`,children:e(`welcome.title`)}),(0,R.jsx)(`p`,{className:`mx-auto mt-3 max-w-md text-balance text-[15.5px] leading-relaxed text-slate-600`,children:e(`welcome.body`)}),(0,R.jsx)(`div`,{className:`mx-auto mt-8 grid max-w-lg gap-3 text-left sm:grid-cols-3`,children:[`welcome.step1`,`welcome.step2`,`welcome.step3`].map((t,n)=>(0,R.jsxs)(`div`,{className:`rounded-2xl border border-slate-200/80 bg-slate-50/60 p-3.5`,children:[(0,R.jsx)(`div`,{className:`mb-1.5 flex h-6 w-6 items-center justify-center rounded-full bg-ink text-[12px] font-bold text-white`,children:n+1}),(0,R.jsx)(`p`,{className:`text-[13.5px] leading-snug text-slate-700`,children:e(t)})]},t))}),(0,R.jsxs)(`div`,{className:`mt-8 flex flex-col items-center gap-3`,children:[(0,R.jsx)(vr,{size:`lg`}),(0,R.jsx)(`p`,{className:`max-w-xs text-[12.5px] text-slate-500`,children:e(`or.pitch`)}),(0,R.jsx)(Ve,{href:`/models`,className:`text-[14px] font-semibold text-slate-600 underline-offset-4 hover:text-ink hover:underline`,children:e(`welcome.cta`)})]}),(0,R.jsx)(`p`,{className:`mx-auto mt-4 max-w-sm text-[12.5px] text-slate-400`,children:e(`welcome.privacy`)})]})}function i8(){let e=Dn();return(0,R.jsxs)(`div`,{className:`px-8 py-12 text-center`,children:[(0,R.jsx)(`div`,{className:`mb-3 text-3xl`,children:`📝`}),(0,R.jsx)(`h2`,{className:`text-[22px] font-extrabold tracking-tight text-ink`,children:e(`tips.title`)}),(0,R.jsx)(`p`,{className:`mx-auto mt-2 max-w-md text-[14.5px] leading-relaxed text-slate-600`,children:e(`tips.body`)}),(0,R.jsx)(`p`,{className:`mx-auto mt-4 max-w-md rounded-xl bg-amber-50 px-4 py-2.5 text-[13px] text-amber-900`,children:e(`tips.saving`)})]})}function a8({id:e}){let t=Dn();Dr();let n=Er(),r=Fe(),[i,a]=(0,y.useState)(!1),o=(0,y.useRef)(null),s=ne(async()=>{let t=await F.posts.get(e);if(!t)return{missing:!0};let n=await DU(t),r=await F.posts.where(`parentId`).equals(e).sortBy(`createdAt`),i=await F.posts.where(`quoteOfId`).equals(e).count();return{missing:!1,post:t,ancestors:n.slice(0,-1),root:n[0],replies:r,quotes:i}},[e]);if((0,y.useEffect)(()=>{a(new URLSearchParams(r).has(`reply`))},[r,e]),(0,y.useEffect)(()=>{o.current?.scrollIntoView({block:`start`})},[e,s?.missing]),!s)return(0,R.jsx)($U,{title:t(`thread.title`),back:!0});if(s.missing)return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($U,{title:t(`thread.title`),back:!0}),(0,R.jsx)(`p`,{className:`p-8 text-slate-500`,children:t(`thread.deleted`)})]});let{post:c,ancestors:l,replies:u,quotes:d,root:f}=s,p=c.profileId?n.get(c.profileId):void 0;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($U,{title:Nr(f.text,50),sub:t(`thread.title`),back:!0}),l.map(e=>(0,R.jsx)(Y6,{post:e,profiles:n,lineBelow:!0},e.id)),(0,R.jsx)(`div`,{ref:o,className:`scroll-mt-16`,children:(0,R.jsx)(Y6,{post:c,profiles:n,focused:!0,onReply:()=>a(!0)})}),d>0&&(0,R.jsx)(`p`,{className:`border-t border-slate-100 px-4 py-2 text-[13px] text-slate-500`,children:t(`thread.quoted`,{n:d})}),(0,R.jsx)(`div`,{className:`border-y border-slate-200/80 bg-slate-50/40`,children:i||u.length===0?(0,R.jsx)(qU,{compact:!0,parentId:c.id,autoFocus:i,implicitHandle:p?.handle,placeholder:p?t(`thread.replyTo`,{handle:p.handle}):t(`thread.replyMention`),onPosted:()=>a(!1)},e):(0,R.jsx)(`button`,{onClick:()=>a(!0),className:`w-full px-4 py-3.5 text-left text-[15px] text-slate-400 hover:bg-slate-50`,children:t(`thread.postReply`)})}),u.map(e=>(0,R.jsx)(`div`,{className:`border-b border-slate-200/80`,children:(0,R.jsx)(Y6,{post:e,profiles:n})},e.id))]})}var o8=[{id:`anthropic`,label:`Anthropic (Claude)`,protocol:`anthropic`,baseUrl:`https://api.anthropic.com/v1`,handle:`claude`,color:`#d97757`,needsKey:!0,keyUrl:`https://console.anthropic.com/settings/keys`,modelHint:`claude-sonnet-5-5`},{id:`openai`,label:`OpenAI`,protocol:`openai`,baseUrl:`https://api.openai.com/v1`,handle:`gpt`,color:`#10a37f`,needsKey:!0,keyUrl:`https://platform.openai.com/api-keys`,modelHint:`pick from Fetch models`},{id:`google`,label:`Google Gemini`,protocol:`google`,baseUrl:`https://generativelanguage.googleapis.com/v1beta`,handle:`gemini`,color:`#4285f4`,needsKey:!0,keyUrl:`https://aistudio.google.com/apikey`,modelHint:`pick from Fetch models`},{id:`openrouter`,label:`OpenRouter (hundreds of models)`,protocol:`openai`,baseUrl:`https://openrouter.ai/api/v1`,handle:`router`,color:`#6467f2`,needsKey:!0,keyUrl:`https://openrouter.ai/keys`,modelHint:`vendor/model, e.g. qwen/…`},{id:`deepseek`,label:`DeepSeek`,protocol:`openai`,baseUrl:`https://api.deepseek.com/v1`,handle:`deepseek`,color:`#4d6bfe`,needsKey:!0,keyUrl:`https://platform.deepseek.com/api_keys`,modelHint:`deepseek-chat`},{id:`qwen`,label:`Qwen (Alibaba Model Studio)`,protocol:`openai`,baseUrl:`https://dashscope-intl.aliyuncs.com/compatible-mode/v1`,handle:`qwen`,color:`#615ced`,needsKey:!0,keyUrl:`https://modelstudio.console.alibabacloud.com/`,modelHint:`qwen-plus`,note:`Mainland China accounts use https://dashscope.aliyuncs.com/compatible-mode/v1`},{id:`xai`,label:`xAI (Grok)`,protocol:`openai`,baseUrl:`https://api.x.ai/v1`,handle:`grok`,color:`#111827`,needsKey:!0,keyUrl:`https://console.x.ai/`,modelHint:`pick from Fetch models`},{id:`groq`,label:`Groq`,protocol:`openai`,baseUrl:`https://api.groq.com/openai/v1`,handle:`groq`,color:`#f55036`,needsKey:!0,keyUrl:`https://console.groq.com/keys`,modelHint:`pick from Fetch models`},{id:`mistral`,label:`Mistral`,protocol:`openai`,baseUrl:`https://api.mistral.ai/v1`,handle:`mistral`,color:`#fa520f`,needsKey:!0,keyUrl:`https://console.mistral.ai/api-keys`,modelHint:`mistral-large-latest`},{id:`ollama`,label:`Ollama (local)`,protocol:`openai`,baseUrl:`http://localhost:11434/v1`,handle:`llama`,color:`#334155`,needsKey:!1,local:!0,modelHint:`e.g. llama3.2, qwen3`,note:`Runs on your machine. In Docker use http://host.docker.internal:11434/v1`},{id:`lmstudio`,label:`LM Studio (local)`,protocol:`openai`,baseUrl:`http://localhost:1234/v1`,handle:`local`,color:`#7c3aed`,needsKey:!1,local:!0,modelHint:`model loaded in LM Studio`,note:`Start the server in LM Studio → Developer.`},{id:`custom`,label:`Custom (OpenAI-compatible)`,protocol:`openai`,baseUrl:`http://localhost:8000/v1`,handle:`custom`,color:`#64748b`,needsKey:!1,modelHint:`model id`,note:`vLLM, llama.cpp server, LiteLLM, Together, Fireworks, …`}],s8=e=>o8.find(t=>t.id===e)??o8[o8.length-1];function c8(e=`anthropic`,t=[]){let n=s8(e),r=n.handle;for(let e=2;t.includes(r);e++)r=`${n.handle}${e}`;return{id:We(),handle:r,name:n.label.replace(/ \(.*\)$/,``),color:n.color,presetId:n.id,protocol:n.protocol,baseUrl:n.baseUrl,modelId:``,apiKey:``,useProxy:!0,systemPrompt:``,enabled:!0,isChecker:!1,createdAt:Date.now()}}function l8(){let e=Dn(),t=Tr(),[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)(!1),o=(e,t)=>F.profiles.update(e.id,{[t]:!e[t]});return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($U,{title:e(`models.title`),sub:e(`models.sub`)}),!vU()&&(0,R.jsxs)(`div`,{className:`border-b border-slate-200/80 bg-slate-50 px-4 py-3 text-[13px] leading-relaxed text-slate-600`,children:[(0,R.jsx)(`b`,{className:`text-ink`,children:e(`models.hostedTitle`)}),` `,e(`models.hostedBody`),` `,e(`models.hostedOllama`),` `,(0,R.jsxs)(`code`,{className:`rounded bg-white px-1 ring-1 ring-slate-200`,children:[`OLLAMA_ORIGINS=`,location.origin]}),` `,e(`models.hostedNpx`),` `,(0,R.jsx)(`code`,{className:`rounded bg-white px-1 ring-1 ring-slate-200`,children:`npx dissentry`})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2 border-b border-slate-200/80 bg-gradient-to-r from-indigo-50/70 to-white px-4 py-4`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`p`,{className:`text-[14.5px] font-semibold text-ink`,children:e(`or.cardTitle`)}),(0,R.jsx)(`p`,{className:`text-[12.5px] text-slate-500`,children:e(`or.pitch`)})]}),(0,R.jsx)(vr,{})]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-slate-200/80 px-4 py-3`,children:[(0,R.jsx)(`p`,{className:`text-[13px] text-slate-500`,children:e(`models.checkerHint`)}),(0,R.jsx)(`button`,{onClick:()=>{r(c8(`anthropic`,(t??[]).map(e=>e.handle))),a(!0)},className:`shrink-0 rounded-full bg-ink px-4 py-2 text-[13.5px] font-semibold text-white hover:bg-slate-800`,children:e(`models.add`)})]}),t?.length===0&&!n&&(0,R.jsx)(`div`,{className:`p-6 text-[14.5px] leading-relaxed text-slate-500`,children:e(`models.empty`)}),n&&i&&(0,R.jsx)(d8,{value:n,isNew:!0,taken:(t??[]).map(e=>e.handle),onDone:()=>r(null)}),t?.map(s=>n?.id===s.id&&!i?(0,R.jsx)(d8,{value:n,taken:(t??[]).filter(e=>e.id!==s.id).map(e=>e.handle),onDone:()=>r(null)},s.id):(0,R.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-slate-200/80 px-4 py-3.5 transition ${s.enabled?``:`opacity-50`}`,children:[(0,R.jsx)(Pr,{profile:s,size:42}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,children:[(0,R.jsx)(`b`,{className:`truncate text-ink`,children:s.name}),(0,R.jsxs)(`span`,{className:`truncate text-[14px] text-slate-500`,children:[`@`,s.handle]})]}),(0,R.jsxs)(`div`,{className:`truncate text-[12.5px] text-slate-500`,children:[s.modelId||(0,R.jsx)(`i`,{children:e(`models.noModel`)}),` · `,s8(s.presetId).label]})]}),(0,R.jsx)(u8,{label:e(`common.checker`),on:s.isChecker,onClick:()=>o(s,`isChecker`),tone:`amber`}),(0,R.jsx)(u8,{label:e(`models.on`),on:s.enabled,onClick:()=>o(s,`enabled`)}),(0,R.jsx)(`button`,{onClick:()=>{r({...s}),a(!1)},className:`rounded-full border border-slate-200 px-3.5 py-1.5 text-[13px] font-semibold hover:bg-slate-50`,children:e(`common.edit`)})]},s.id))]})}function u8({label:e,on:t,onClick:n,tone:r}){return(0,R.jsxs)(`button`,{onClick:n,className:`hidden rounded-full px-2.5 py-1 text-[12px] font-semibold ring-1 transition sm:block ${t?r===`amber`?`bg-amber-100 text-amber-800 ring-amber-200`:`bg-emerald-50 text-emerald-700 ring-emerald-200`:`bg-white text-slate-400 ring-slate-200 hover:text-slate-600`}`,children:[t?`✓ `:``,e]})}function d8({value:e,isNew:t,taken:n,onDone:r}){let i=Dn(),[a,o]=(0,y.useState)(e),[s,c]=(0,y.useState)([]),[l,u]=(0,y.useState)(null),d=s8(a.presetId),f=e=>o(t=>({...t,...e})),p=n.includes(a.handle),m=a.handle&&!p&&a.modelId&&a.baseUrl&&(!d.needsKey||a.apiKey);function h(e){let r=s8(e),i=c8(e,n);o(n=>({...n,presetId:e,protocol:r.protocol,baseUrl:r.baseUrl,color:r.color,modelId:``,...t?{handle:i.handle,name:i.name}:{}})),c([]),u(null)}async function g(){u({kind:`busy`,text:i(`editor.fetching`)});try{let e=await wU(a);c(e),u({kind:`ok`,text:i(`editor.modelsFound`,{n:e.length})}),!a.modelId&&e[0]&&f({modelId:e[0]})}catch(e){u({kind:`err`,text:EU(e,a)})}}async function _(){u({kind:`busy`,text:i(`editor.testing`)});try{let e=performance.now(),{text:t}=await dk({model:CU(a),prompt:`Reply with the single word: OK`,maxRetries:0});u({kind:`ok`,text:i(`editor.connected`,{ms:Math.round(performance.now()-e),reply:t.trim().slice(0,40)})})}catch(e){u({kind:`err`,text:EU(e,a)})}}async function v(){await F.profiles.put({...a,handle:$n(a.handle)}),r()}async function b(){window.confirm(i(`editor.removeConfirm`,{handle:a.handle}))&&(await F.profiles.delete(a.id),r())}let x=`w-full rounded-xl border border-slate-200 bg-white px-3 py-2 text-[15px] outline-none transition focus:border-sky-400 focus:ring-4 focus:ring-sky-100`;return(0,R.jsxs)(`div`,{className:`space-y-3.5 border-b border-slate-200/80 bg-slate-50/70 px-4 py-5`,children:[(0,R.jsxs)(f8,{label:i(`editor.provider`),children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(Pr,{profile:a,size:40}),(0,R.jsx)(`select`,{value:a.presetId,onChange:e=>h(e.target.value),className:x,children:o8.map(e=>(0,R.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),d.note&&(0,R.jsx)(`p`,{className:`mt-1 text-[12px] text-slate-500`,children:d.note})]}),(0,R.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,R.jsx)(f8,{label:i(`editor.name`),children:(0,R.jsx)(`input`,{className:x,value:a.name,onChange:e=>f({name:e.target.value})})}),(0,R.jsxs)(f8,{label:i(`editor.handle`),children:[(0,R.jsx)(`input`,{className:x,value:a.handle,onChange:e=>f({handle:$n(e.target.value)})}),p&&(0,R.jsx)(`p`,{className:`mt-1 text-[12px] text-red-500`,children:i(`editor.handleTaken`,{handle:a.handle})})]})]}),(0,R.jsx)(f8,{label:i(`editor.baseUrl`),children:(0,R.jsx)(`input`,{className:x,value:a.baseUrl,onChange:e=>f({baseUrl:e.target.value})})}),(0,R.jsxs)(f8,{label:d.needsKey?i(`editor.key`):i(`editor.keyOptional`),children:[(0,R.jsx)(`input`,{className:x,type:`password`,autoComplete:`off`,value:a.apiKey,placeholder:d.needsKey?i(`editor.keyPlaceholder`):i(`editor.keyLocal`),onChange:e=>f({apiKey:e.target.value.trim()})}),d.keyUrl&&(0,R.jsx)(`a`,{href:d.keyUrl,target:`_blank`,rel:`noreferrer`,className:`mt-1 inline-block text-[12px] font-medium text-sky-600 hover:underline`,children:i(`editor.getKey`)})]}),(0,R.jsx)(f8,{label:i(`editor.model`),children:(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(`input`,{className:x,list:`models-${a.id}`,value:a.modelId,placeholder:d.modelHint,onChange:e=>f({modelId:e.target.value.trim()})}),(0,R.jsx)(`datalist`,{id:`models-${a.id}`,children:s.map(e=>(0,R.jsx)(`option`,{value:e},e))}),(0,R.jsx)(`button`,{onClick:()=>void g(),className:`shrink-0 rounded-xl border border-slate-200 bg-white px-3 text-[13px] font-semibold hover:bg-slate-50`,children:i(`editor.fetch`)})]})}),(0,R.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,R.jsx)(f8,{label:i(`editor.inPrice`),children:(0,R.jsx)(`input`,{className:x,inputMode:`decimal`,placeholder:`—`,value:a.inPrice??``,onChange:e=>f({inPrice:e.target.value===``?void 0:Math.max(0,Number(e.target.value))||0})})}),(0,R.jsx)(f8,{label:i(`editor.outPrice`),children:(0,R.jsx)(`input`,{className:x,inputMode:`decimal`,placeholder:`—`,value:a.outPrice??``,onChange:e=>f({outPrice:e.target.value===``?void 0:Math.max(0,Number(e.target.value))||0})})})]}),(0,R.jsx)(`p`,{className:`-mt-2 text-[12px] text-slate-500`,children:i(`editor.priceHelp`)}),(0,R.jsx)(f8,{label:i(`editor.instructions`),children:(0,R.jsx)(`textarea`,{className:x,rows:2,value:a.systemPrompt,placeholder:i(`editor.instructionsPlaceholder`),onChange:e=>f({systemPrompt:e.target.value})})}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-2 text-[14px]`,children:[(0,R.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`input`,{type:`checkbox`,className:`accent-amber-500`,checked:a.isChecker,onChange:e=>f({isChecker:e.target.checked})}),` `,i(`editor.checker`)]}),(0,R.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`input`,{type:`color`,value:a.color,onChange:e=>f({color:e.target.value}),className:`h-6 w-8 cursor-pointer rounded bg-transparent`}),` `,i(`editor.color`)]}),vU()&&(0,R.jsxs)(`label`,{className:`flex items-center gap-2`,title:i(`editor.routeHint`),children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:a.useProxy,onChange:e=>f({useProxy:e.target.checked})}),` `,i(`editor.route`)]})]}),l&&(0,R.jsx)(`p`,{className:`rounded-xl px-3 py-2 text-[13px] ${l.kind===`ok`?`bg-emerald-50 text-emerald-800`:l.kind===`err`?`bg-red-50 text-red-800`:`bg-white text-slate-600 ring-1 ring-slate-200`}`,children:l.text}),(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-2 pt-1`,children:[(0,R.jsx)(`button`,{disabled:!m,onClick:()=>void v(),className:`rounded-full bg-ink px-5 py-2 text-[13.5px] font-semibold text-white hover:bg-slate-800 disabled:bg-slate-300`,children:i(`common.save`)}),(0,R.jsx)(`button`,{disabled:!a.modelId,onClick:()=>void _(),className:`rounded-full border border-slate-200 bg-white px-4 py-2 text-[13.5px] font-semibold hover:bg-slate-50 disabled:opacity-50`,children:i(`editor.test`)}),(0,R.jsx)(`button`,{onClick:r,className:`rounded-full px-4 py-2 text-[13.5px] font-semibold text-slate-500 hover:text-ink`,children:i(`common.cancel`)}),!t&&(0,R.jsx)(`button`,{onClick:()=>void b(),className:`ml-auto rounded-full px-3 py-2 text-[13.5px] font-semibold text-red-500 hover:bg-red-50`,children:i(`common.remove`)})]})]})}function f8({label:e,children:t}){return(0,R.jsxs)(`label`,{className:`block`,children:[(0,R.jsx)(`span`,{className:`mb-1.5 block text-[12.5px] font-semibold text-slate-600`,children:e}),t]})}function p8(e,t,n,r){let i=t.filter(e=>e.kind===`model`&&e.status===`done`&&!e.respondsToNoteId),a=new Map;for(let e of n)a.set(e.postId,[...a.get(e.postId)??[],e]);let o=new Set(r.filter(e=>e.verdict===`ok`||e.verdict===`note`).map(e=>e.postId));return e.map(e=>{let t=i.filter(t=>t.profileId===e.id),s=t.flatMap(e=>a.get(e.id)??[]),c=n.filter(t=>t.profileId===e.id||t.agreeProfileIds.includes(e.id));return{profile:e,answers:t.length,checkedAnswers:t.filter(e=>o.has(e.id)).length,correctedAnswers:t.filter(e=>(a.get(e.id)??[]).some(e=>e.status===`accepted`)).length,openNotesReceived:s.filter(e=>e.status===`open`).length,checksRun:r.filter(t=>t.profileId===e.id&&(t.verdict===`ok`||t.verdict===`note`)).length,notesWritten:c.length,notesAccepted:c.filter(e=>e.status===`accepted`).length,notesDismissed:c.filter(e=>e.status===`dismissed`).length}}).sort((e,t)=>t.answers+t.checksRun-(e.answers+e.checksRun))}var m8=(e,t)=>t?`${Math.round(e/t*100)}%`:`–`;function h8(){let e=Dn(),t=ne(async()=>p8(await F.profiles.toArray(),await F.posts.toArray(),await F.notes.toArray(),await F.checks.toArray()),[]),n=t?.reduce((e,t)=>({corrected:e.corrected+t.correctedAnswers,checked:e.checked+t.checkedAnswers}),{corrected:0,checked:0});return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($U,{title:e(`trust.title`),sub:e(`trust.sub`)}),n&&n.checked>0&&(0,R.jsxs)(`div`,{className:`border-b border-slate-200/80 bg-gradient-to-br from-amber-50 to-white px-5 py-6`,children:[(0,R.jsx)(`p`,{className:`text-[40px] font-extrabold leading-none tracking-tight text-ink`,children:n.corrected}),(0,R.jsx)(`p`,{className:`mt-2 text-[14px] text-slate-600`,children:e(`trust.summary`,{n:n.checked})})]}),t?.length===0&&(0,R.jsx)(`p`,{className:`p-6 text-slate-500`,children:e(`trust.empty`)}),t?.map(t=>(0,R.jsxs)(`div`,{className:`border-b border-slate-200/80 px-4 py-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(Pr,{profile:t.profile,size:38}),(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`b`,{className:`text-ink`,children:t.profile.name}),` `,(0,R.jsxs)(`span`,{className:`text-slate-500`,children:[`@`,t.profile.handle]}),(0,R.jsx)(`div`,{className:`truncate text-[12px] text-slate-500`,children:t.profile.modelId})]})]}),(0,R.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-3 text-[13px]`,children:[(0,R.jsx)(g8,{title:e(`trust.asAnswerer`),empty:t.checkedAnswers===0?e(`trust.noAnswers`):``,big:m8(t.checkedAnswers-t.correctedAnswers,t.checkedAnswers),bigLabel:e(`trust.heldUp`),lines:[e(`trust.answers`,{a:t.answers,c:t.checkedAnswers}),e(`trust.corrected`,{n:t.correctedAnswers}),t.openNotesReceived?e(`trust.awaiting`,{n:t.openNotesReceived}):``]}),(0,R.jsx)(g8,{title:e(`trust.asChecker`),empty:t.checksRun===0?e(`trust.noChecks`):t.notesAccepted+t.notesDismissed===0?e(`trust.noRated`,{a:t.checksRun,n:t.notesWritten}):``,big:m8(t.notesAccepted,t.notesAccepted+t.notesDismissed),bigLabel:e(`trust.notesRight`),lines:[e(`trust.reviewed`,{a:t.checksRun,n:t.notesWritten}),e(`trust.acceptedDismissed`,{a:t.notesAccepted,d:t.notesDismissed})]})]})]},t.profile.id)),(0,R.jsx)(`p`,{className:`px-4 py-4 text-[12px] text-slate-400`,children:e(`trust.footnote`)})]})}function g8({title:e,big:t,bigLabel:n,lines:r,empty:i}){return(0,R.jsxs)(`div`,{className:`rounded-2xl border p-3.5 ${i?`border-dashed border-slate-200 bg-slate-50/50`:`border-slate-200/80 bg-white`}`,children:[(0,R.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wider text-slate-400`,children:e}),i?(0,R.jsx)(`p`,{className:`mt-2 text-[13px] leading-snug text-slate-400`,children:i}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`mt-1`,children:[(0,R.jsx)(`span`,{className:`text-[26px] font-extrabold tracking-tight text-ink`,children:t}),` `,(0,R.jsx)(`span`,{className:`text-slate-500`,children:n})]}),r.filter(Boolean).map(e=>(0,R.jsx)(`div`,{className:`text-slate-500`,children:e},e))]})]})}var _8=864e5,v8=[{id:`today`,days:0},{id:`7d`,days:7},{id:`30d`,days:30},{id:`all`,days:1/0}];function y8(){let e=Dn(),[t,n]=(0,y.useState)(`30d`),r=ne(async()=>({profiles:await F.profiles.toArray(),posts:await F.posts.toArray(),checks:await F.checks.toArray()}),[]);if(!r)return(0,R.jsx)($U,{title:e(`usage.title`)});let i=new Date;i.setHours(0,0,0,0);let a=e=>e===0?i.getTime():e===1/0?0:Date.now()-e*_8,o=v8.slice(0,3).map(e=>({r:e,s:lW(r.profiles,r.posts,r.checks,a(e.days))})),s=lW(r.profiles,r.posts,r.checks,a(v8.find(e=>e.id===t).days)),c=s.total.tokens?Math.round(s.total.checkTokens/s.total.tokens*100):0,l=(e,t)=>t?cW(e):`≥ ${cW(e)}`;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($U,{title:e(`usage.title`),sub:e(`usage.sub`)}),(0,R.jsx)(`div`,{className:`grid grid-cols-3 gap-3 border-b border-slate-200/80 px-4 py-5`,children:o.map(({r,s:i})=>(0,R.jsxs)(`button`,{onClick:()=>n(r.id),className:`rounded-2xl border p-3.5 text-left transition ${t===r.id?`border-ink bg-white ring-4 ring-slate-100`:`border-slate-200/80 bg-white hover:border-slate-300`}`,children:[(0,R.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wider text-slate-400`,children:e(`usage.range.${r.id}`)}),(0,R.jsx)(`div`,{className:`mt-1 text-[24px] font-extrabold tracking-tight text-ink`,children:sW(i.total.tokens)}),(0,R.jsxs)(`div`,{className:`text-[12.5px] text-slate-500`,children:[e(`usage.tokens`),` · `,i.total.tokens?l(i.total.cost,i.total.priced):`$0`]})]},r.id))}),s.total.tokens>0&&(0,R.jsxs)(`div`,{className:`border-b border-slate-200/80 px-4 py-4`,children:[(0,R.jsxs)(`div`,{className:`mb-2 flex justify-between text-[12.5px] text-slate-500`,children:[(0,R.jsxs)(`span`,{children:[e(`usage.answering`),` · `,sW(s.total.answerTokens)]}),(0,R.jsxs)(`span`,{children:[e(`usage.checking`),` · `,sW(s.total.checkTokens),` (`,c,`%)`]})]}),(0,R.jsxs)(`div`,{className:`flex h-2.5 overflow-hidden rounded-full bg-slate-100`,children:[(0,R.jsx)(`div`,{className:`bg-sky-500`,style:{width:`${100-c}%`}}),(0,R.jsx)(`div`,{className:`bg-amber-400`,style:{width:`${c}%`}})]}),(0,R.jsx)(`p`,{className:`mt-2 text-[12.5px] text-slate-500`,children:e(`usage.checkInsight`,{pct:c})})]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between px-4 pb-1 pt-4`,children:[(0,R.jsx)(`h2`,{className:`text-[15px] font-bold text-ink`,children:e(`usage.byModel`)}),(0,R.jsx)(`div`,{className:`flex rounded-full bg-slate-100 p-0.5 text-[12px] font-medium`,children:v8.map(r=>(0,R.jsx)(`button`,{onClick:()=>n(r.id),className:`rounded-full px-2.5 py-1 ${t===r.id?`bg-white text-ink shadow-sm`:`text-slate-500`}`,children:e(`usage.range.${r.id}`)},r.id))})]}),s.rows.length===0&&(0,R.jsx)(`p`,{className:`px-4 py-8 text-[14px] text-slate-500`,children:e(`usage.empty`)}),s.rows.map(t=>{let n=t.answerTokens+t.checkTokens;return(0,R.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-slate-100 px-4 py-3`,children:[(0,R.jsx)(Pr,{profile:t.profile,size:34}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`div`,{className:`truncate text-[14px] font-semibold text-ink`,children:[t.profile.name,` `,(0,R.jsxs)(`span`,{className:`font-normal text-slate-500`,children:[`@`,t.profile.handle]})]}),(0,R.jsx)(`div`,{className:`text-[12px] text-slate-500`,children:e(`usage.split`,{a:sW(t.answerTokens),c:sW(t.checkTokens)})})]}),(0,R.jsxs)(`div`,{className:`text-right`,children:[(0,R.jsx)(`div`,{className:`text-[14px] font-semibold tabular-nums text-ink`,children:sW(n)}),(0,R.jsx)(`div`,{className:`text-[12px] tabular-nums text-slate-500`,title:t.priced?``:e(`usage.noPrice`),children:t.priced?cW(t.cost):e(`usage.addPrice`)})]})]},t.profile.id)}),(0,R.jsx)(`p`,{className:`px-4 py-4 text-[12px] leading-relaxed text-slate-400`,children:e(`usage.footnote`)})]})}var b8=[{label:`OpenAI`,url:`https://api.openai.com/v1/models`},{label:`Anthropic`,url:`https://api.anthropic.com/v1/models`},{label:`Google Gemini`,url:`https://generativelanguage.googleapis.com/v1beta/models`},{label:`xAI`,url:`https://api.x.ai/v1/models`},{label:`DeepSeek`,url:`https://api.deepseek.com/v1/models`},{label:`Qwen (China)`,url:`https://dashscope.aliyuncs.com/compatible-mode/v1/models`}];function x8(e,t){if(!e.trim())return t(`proxy.enterAddress`);try{let n=new URL(e.trim());return[`http:`,`https:`,`socks5:`,`socks5h:`,`socks:`].includes(n.protocol)?n.hostname?null:t(`proxy.badUrl`):t(`proxy.badScheme`)}catch{return t(`proxy.badUrl`)}}function S8(){let e=Dn(),t=dU(),[n,r]=(0,y.useState)(b8[0].url),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(!1),c=gU(),l=t.proxyMode===`custom`?x8(t.proxyUrl,e):null;async function u(){s(!0),a(null);let t=performance.now();try{let r=await bU(n,{method:`GET`}),i=Math.round(performance.now()-t);if(r.status===502||r.status===400){let e=await r.json().catch(()=>({}));a({ok:!1,text:e.error?.message??`HTTP ${r.status}`})}else a({ok:!0,text:e(`proxy.reachable`,{ms:i,status:r.status})})}catch(e){a({ok:!1,text:e.message})}finally{s(!1)}}let d=(e,n,r)=>(0,R.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3 rounded-2xl border px-3.5 py-3 transition ${t.proxyMode===e?`border-sky-300 bg-sky-50/60 ring-4 ring-sky-50`:`border-slate-200 hover:bg-slate-50`}`,children:[(0,R.jsx)(`input`,{type:`radio`,name:`proxyMode`,className:`mt-1 accent-sky-600`,checked:t.proxyMode===e,onChange:()=>{uU({proxyMode:e}),a(null)}}),(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`b`,{className:`text-[14px] text-ink`,children:n}),(0,R.jsx)(`br`,{}),(0,R.jsx)(`span`,{className:`text-[13px] text-slate-500`,children:r})]})]}),f=`w-full rounded-xl border border-slate-200 bg-white px-3 py-2 text-[14px] outline-none focus:border-sky-400 focus:ring-4 focus:ring-sky-100`;return(0,R.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[d(`system`,e(`proxy.system`),c?(0,R.jsxs)(R.Fragment,{children:[e(`proxy.systemFound`),` `,(0,R.jsx)(`code`,{children:c})]}):e(`proxy.systemNone`)),d(`direct`,e(`proxy.direct`),e(`proxy.directDesc`)),d(`custom`,e(`proxy.custom`),e(`proxy.customDesc`)),t.proxyMode===`custom`&&(0,R.jsxs)(`div`,{className:`space-y-3 px-1 pt-1`,children:[(0,R.jsxs)(`label`,{className:`block`,children:[(0,R.jsx)(`span`,{className:`mb-1.5 block text-[12.5px] font-semibold text-slate-600`,children:e(`proxy.address`)}),(0,R.jsx)(`input`,{className:f,value:t.proxyUrl,placeholder:`http://127.0.0.1:7890 · socks5://127.0.0.1:1080`,onChange:e=>{uU({proxyUrl:e.target.value}),a(null)},spellCheck:!1,autoComplete:`off`}),(0,R.jsx)(`span`,{className:`mt-1 block text-[12px] text-slate-500`,children:e(`proxy.addressHelp`)}),t.proxyUrl&&l&&(0,R.jsx)(`span`,{className:`mt-1 block text-[12px] text-red-500`,children:l})]}),(0,R.jsxs)(`label`,{className:`block`,children:[(0,R.jsx)(`span`,{className:`mb-1.5 block text-[12.5px] font-semibold text-slate-600`,children:e(`proxy.bypass`)}),(0,R.jsx)(`input`,{className:f,value:t.proxyBypass,placeholder:`.aliyuncs.com, api.deepseek.com`,onChange:e=>uU({proxyBypass:e.target.value}),spellCheck:!1}),(0,R.jsx)(`span`,{className:`mt-1 block text-[12px] text-slate-500`,children:e(`proxy.bypassHelp`)})]})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-1`,children:[(0,R.jsx)(`select`,{value:n,onChange:e=>{r(e.target.value),a(null)},className:`rounded-full border border-slate-200 bg-white px-3 py-1.5 text-[13px]`,children:b8.map(e=>(0,R.jsx)(`option`,{value:e.url,children:e.label},e.url))}),(0,R.jsx)(`button`,{onClick:()=>void u(),disabled:o||!!l,className:`rounded-full border border-slate-200 bg-white px-4 py-1.5 text-[13px] font-semibold hover:bg-slate-50 disabled:opacity-50`,children:e(o?`proxy.testing`:`proxy.test`)})]}),i&&(0,R.jsx)(`p`,{className:`rounded-xl px-3 py-2 text-[13px] ${i.ok?`bg-emerald-50 text-emerald-800`:`bg-red-50 text-red-800`}`,children:i.text})]})}function C8(){let e=Dn(),t=dU(),n=(0,y.useRef)(null),[r,i]=(0,y.useState)(``);async function a(e){let t=await jU(e),n=URL.createObjectURL(new Blob([JSON.stringify(t,null,2)],{type:`application/json`}));Object.assign(document.createElement(`a`),{href:n,download:`dissentry-${new Date().toISOString().slice(0,10)}.json`}).click(),URL.revokeObjectURL(n)}async function o(t){try{await MU(JSON.parse(await t.text())),i(e(`settings.imported`))}catch(t){i(e(`settings.importFailed`,{error:t.message}))}}let s=`border-b border-slate-200/80 px-4 py-5`,c=`rounded-full border border-slate-200 bg-white px-4 py-2 text-[13px] font-semibold hover:bg-slate-50`;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($U,{title:e(`settings.title`)}),(0,R.jsxs)(`div`,{className:s,children:[(0,R.jsx)(`h2`,{className:`text-[15px] font-bold text-ink`,children:e(`settings.profile`)}),(0,R.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-end gap-6`,children:[(0,R.jsxs)(`label`,{className:`block`,children:[(0,R.jsx)(`span`,{className:`mb-1.5 block text-[12.5px] font-semibold text-slate-600`,children:e(`settings.name`)}),(0,R.jsx)(`input`,{value:t.userName,placeholder:e(`post.youName`),onChange:e=>uU({userName:e.target.value}),className:`w-56 rounded-xl border border-slate-200 px-3 py-2 outline-none focus:border-sky-400 focus:ring-4 focus:ring-sky-100`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`mb-1.5 block text-[12.5px] font-semibold text-slate-600`,children:e(`layout.language`)}),(0,R.jsx)(`div`,{className:`rounded-xl border border-slate-200 px-3 py-1`,children:(0,R.jsx)(kn,{})})]})]})]}),(0,R.jsxs)(`label`,{className:`${s} flex cursor-pointer items-start gap-3`,children:[(0,R.jsx)(`input`,{type:`checkbox`,className:`mt-1 accent-amber-500`,checked:t.autoCheck,onChange:e=>uU({autoCheck:e.target.checked})}),(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`b`,{className:`text-[15px] text-ink`,children:e(`settings.autoCheck`)}),(0,R.jsx)(`br`,{}),(0,R.jsx)(`span`,{className:`text-[13px] text-slate-500`,children:e(`settings.autoCheckDesc`)})]})]}),(0,R.jsx)(`div`,{className:s,children:vU()?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`h2`,{className:`text-[15px] font-bold text-ink`,children:e(`proxy.title`)}),(0,R.jsx)(`p`,{className:`mt-1 text-[13px] text-slate-500`,children:e(`proxy.localDesc`)}),(0,R.jsx)(S8,{})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`h2`,{className:`text-[15px] font-bold text-ink`,children:e(`connection.title`)}),(0,R.jsx)(`p`,{className:`mt-1 text-[13px] leading-relaxed text-slate-500`,children:e(`connection.hostedDesc`)})]})}),(0,R.jsxs)(`div`,{className:s,children:[(0,R.jsx)(`h2`,{className:`text-[15px] font-bold text-ink`,children:e(`settings.data`)}),(0,R.jsx)(`p`,{className:`mt-1 text-[13px] text-slate-500`,children:e(`settings.dataDesc`)}),(0,R.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,R.jsx)(`button`,{className:c,onClick:()=>void a(!1),children:e(`settings.export`)}),(0,R.jsx)(`button`,{className:c,onClick:()=>void a(!0),children:e(`settings.exportKeys`)}),(0,R.jsx)(`button`,{className:c,onClick:()=>n.current?.click(),children:e(`settings.import`)}),(0,R.jsx)(`input`,{ref:n,type:`file`,accept:`application/json`,hidden:!0,onChange:e=>e.target.files?.[0]&&void o(e.target.files[0])}),(0,R.jsx)(`button`,{className:`${c} border-red-200 text-red-600 hover:bg-red-50`,onClick:()=>{window.confirm(e(`settings.clearConfirm`))&&NU().then(()=>i(e(`settings.cleared`)))},children:e(`settings.clear`)})]}),r&&(0,R.jsx)(`p`,{className:`mt-2 text-[13px]`,children:r})]})]})}var w8=e=>e===void 0?`?`:e<.1?e.toFixed(3):e<10?e.toFixed(2):e.toFixed(0);function T8(){let e=Dn(),t=Fe(),[,n]=Pe(),[r,i]=(0,y.useState)(`working`),[a,o]=(0,y.useState)(``),[s,c]=(0,y.useState)([]),l=(0,y.useRef)(``),u=(0,y.useRef)(!1);(0,y.useEffect)(()=>{u.current||(u.current=!0,(async()=>{try{l.current=await lr(t),history.replaceState(null,``,location.pathname);let e=gr(await mr());c(e.map((e,t)=>({handle:e.family.handle,label:e.family.label,modelId:e.model.id,on:t<4,inPrice:e.model.inPrice,outPrice:e.model.outPrice}))),i(`pick`)}catch(t){let n=t.message;o(n===`cancelled`?e(`or.cancelled`):n===`state`?e(`or.stateError`):e(`or.failed`,{error:n})),i(`error`)}})())},[t,e]);async function d(){let e=s.filter(e=>e.on);e.length&&(await _r(l.current,e.map(({handle:e,label:t,modelId:n,inPrice:r,outPrice:i})=>({handle:e,label:t,modelId:n,inPrice:r,outPrice:i}))),l.current=``,n(`/`))}let f=e=>({id:e.handle,handle:e.handle,name:e.label,color:`#64748b`,presetId:`openrouter`,protocol:`openai`,baseUrl:nr,modelId:e.modelId,apiKey:``,useProxy:!0,systemPrompt:``,enabled:!0,isChecker:!0,createdAt:0});return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($U,{title:e(`or.title`)}),r===`working`&&(0,R.jsx)(`p`,{className:`px-6 py-16 text-center text-[15px] text-slate-500`,children:e(`or.connecting`)}),r===`error`&&(0,R.jsxs)(`div`,{className:`px-6 py-14 text-center`,children:[(0,R.jsx)(`p`,{className:`mx-auto max-w-sm text-[15px] text-slate-600`,children:a}),(0,R.jsxs)(`div`,{className:`mt-6 flex justify-center gap-3`,children:[(0,R.jsx)(vr,{}),(0,R.jsx)(Ve,{href:`/models`,className:`rounded-full border border-slate-200 px-4 py-2 text-[13.5px] font-semibold`,children:e(`or.useKey`)})]})]}),r===`pick`&&(0,R.jsxs)(`div`,{className:`px-5 py-6`,children:[(0,R.jsxs)(`div`,{className:`mb-5 flex items-center gap-2.5 rounded-2xl bg-emerald-50 px-4 py-3 text-[14px] text-emerald-800`,children:[(0,R.jsx)(ft,{size:18}),e(`or.connected`)]}),(0,R.jsx)(`h2`,{className:`text-[18px] font-bold tracking-tight text-ink`,children:e(`or.pickTitle`)}),(0,R.jsx)(`p`,{className:`mt-1 text-[13.5px] text-slate-500`,children:e(`or.pickSub`)}),(0,R.jsx)(`ul`,{className:`mt-4 divide-y divide-slate-100 overflow-hidden rounded-2xl border border-slate-200`,children:s.map((t,n)=>(0,R.jsx)(`li`,{children:(0,R.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 px-4 py-3 transition ${t.on?`bg-sky-50/50`:`hover:bg-slate-50`}`,children:[(0,R.jsx)(`input`,{type:`checkbox`,className:`h-4 w-4 accent-slate-900`,checked:t.on,onChange:()=>c(e=>e.map((e,t)=>t===n?{...e,on:!e.on}:e))}),(0,R.jsx)(Pr,{profile:f(t),size:34}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`div`,{className:`text-[14.5px] font-semibold text-ink`,children:[t.label,` `,(0,R.jsxs)(`span`,{className:`font-normal text-slate-500`,children:[`@`,t.handle]})]}),(0,R.jsx)(`div`,{className:`truncate text-[12.5px] text-slate-500`,children:t.modelId})]}),(0,R.jsxs)(`div`,{className:`shrink-0 text-right text-[11.5px] leading-tight text-slate-500`,title:e(`or.priceHint`),children:[(0,R.jsxs)(`div`,{className:`font-semibold text-slate-700`,children:[`$`,w8(t.inPrice),` / $`,w8(t.outPrice)]}),(0,R.jsx)(`div`,{children:e(`or.perMillion`)})]})]})},t.modelId))}),(0,R.jsx)(`p`,{className:`mt-3 text-[12.5px] leading-relaxed text-slate-500`,children:e(`or.keyNote`)}),(0,R.jsxs)(`div`,{className:`mt-5 flex items-center gap-3`,children:[(0,R.jsx)(`button`,{onClick:()=>void d(),disabled:!s.some(e=>e.on),className:`rounded-full bg-ink px-6 py-2.5 text-[14.5px] font-semibold text-white hover:bg-slate-800 disabled:bg-slate-300`,children:e(`or.add`,{n:s.filter(e=>e.on).length})}),(0,R.jsx)(Ve,{href:`/models`,className:`text-[13.5px] font-medium text-slate-500 hover:text-ink`,children:e(`or.more`)})]})]})]})}function E8(){let e=Dn(),[t]=Pe(),n=ne(async()=>await F.profiles.count()===0&&await F.posts.count()===0,[]);return t===`/welcome`||t===`/`&&n&&!localStorage.getItem(`dissentry.started`)?(0,R.jsx)(wr,{}):t===`/`&&n===void 0?null:(0,R.jsx)(XU,{children:(0,R.jsxs)(Ue,{children:[(0,R.jsx)(Be,{path:`/`,component:t8}),(0,R.jsx)(Be,{path:`/post/:id`,children:e=>(0,R.jsx)(a8,{id:e.id})}),(0,R.jsx)(Be,{path:`/models`,component:l8}),(0,R.jsx)(Be,{path:`/trust`,component:h8}),(0,R.jsx)(Be,{path:`/usage`,component:y8}),(0,R.jsx)(Be,{path:`/settings`,component:C8}),(0,R.jsx)(Be,{path:`/auth/openrouter`,component:T8}),(0,R.jsx)(Be,{children:(0,R.jsx)(`div`,{className:`p-8 text-slate-500`,children:e(`common.notFound`)})})]})})}_U().finally(()=>{(0,b.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(y.StrictMode,{children:(0,R.jsx)(E8,{})}))});
208
+ `),i=Math.max(n.lastIndexOf(`. `),n.lastIndexOf(`。`),n.lastIndexOf(`! `),n.lastIndexOf(`? `));return r>t*.5?n=n.slice(0,r):i>t*.5&&(n=n.slice(0,i+1)),(n.match(/```/g)??[]).length%2==1&&(n+="\n```"),`${n.trimEnd()}\n\n…`}async function z6(e){return await document.fonts?.ready,I6(e,{scale:2,backgroundColor:`#ffffff`,type:`image/png`,font:!1})}function B6(e,t){let n=URL.createObjectURL(e);Object.assign(document.createElement(`a`),{href:n,download:t}).click(),setTimeout(()=>URL.revokeObjectURL(n),2e3)}async function V6(e){try{return!(`ClipboardItem`in window)||!navigator.clipboard?.write?!1:(await navigator.clipboard.write([new ClipboardItem({"image/png":Promise.resolve(e)})]),!0)}catch{return!1}}function H6(){try{let e=new File([new Blob],`x.png`,{type:`image/png`});return!!navigator.canShare?.({files:[e]})}catch{return!1}}var U6=e=>`https://x.com/intent/post?text=${encodeURIComponent(e)}`,W6={minor:{bg:`#fef3c7`,fg:`#92400e`},major:{bg:`#ffedd5`,fg:`#9a3412`},critical:{bg:`#fee2e2`,fg:`#b91c1c`}},G6=(0,y.forwardRef)(function({question:e,answer:t,author:n,notes:r,checks:i,profiles:a,userName:o},s){let c=Dn(),l=r.filter(e=>e.status!==`dismissed`).slice(0,2),u=i.filter(e=>e.verdict===`ok`).map(e=>a.get(e.profileId)).filter(Boolean),d=L6.replace(/^https:\/\//,``);return(0,R.jsxs)(`div`,{ref:s,className:`share-card`,style:{width:1200,padding:56,fontFamily:`var(--font-sans)`,position:`relative`,overflow:`hidden`,background:`radial-gradient(900px 500px at 0% 0%, #fde68a 0%, transparent 60%), radial-gradient(800px 600px at 100% 10%, #fbcfe8 0%, transparent 55%), radial-gradient(900px 700px at 60% 110%, #c7d2fe 0%, transparent 60%), #fff7ed`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginBottom:36},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14},children:[(0,R.jsxs)(`svg`,{width:`44`,height:`44`,viewBox:`0 0 64 64`,"aria-hidden":!0,children:[(0,R.jsx)(`rect`,{width:`64`,height:`64`,rx:`14`,fill:`#0f172a`}),(0,R.jsx)(`path`,{d:`M18 16h14a16 16 0 0 1 0 32H18z`,fill:`none`,stroke:`#fff`,strokeWidth:`6`}),(0,R.jsx)(`circle`,{cx:`46`,cy:`18`,r:`7`,fill:`#f59e0b`})]}),(0,R.jsx)(`span`,{style:{fontSize:30,fontWeight:800,letterSpacing:-.5,color:`#0f172a`},children:`Dissentry`})]}),(0,R.jsx)(K6,{kind:l.length?`dissent`:u.length?`checked`:null,label:l.length?c(`card.stampDissent`):c(`card.stampChecked`)})]}),(0,R.jsxs)(`div`,{style:{background:`#fff`,borderRadius:36,boxShadow:`0 1px 0 rgba(15,23,42,.04), 0 30px 80px -30px rgba(15,23,42,.35)`,padding:48},children:[e&&(0,R.jsxs)(`div`,{style:{display:`flex`,gap:20,marginBottom:32,paddingBottom:32,borderBottom:`1px solid #f1f5f9`},children:[(0,R.jsx)(Pr,{user:o,size:56}),(0,R.jsx)(`p`,{style:{fontSize:30,lineHeight:1.45,color:`#0f172a`,margin:0,whiteSpace:`pre-wrap`,wordBreak:`break-word`},children:R6(e.text,400)})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,gap:20},children:[(0,R.jsx)(Pr,{profile:n,size:64}),(0,R.jsxs)(`div`,{style:{minWidth:0,flex:1},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`baseline`,gap:12,marginBottom:10,flexWrap:`wrap`},children:[(0,R.jsx)(`span`,{style:{fontSize:28,fontWeight:800,color:`#0f172a`},children:n?.name??`—`}),(0,R.jsxs)(`span`,{style:{fontSize:24,color:`#64748b`},children:[`@`,n?.handle]}),n&&(0,R.jsx)(`span`,{style:{fontSize:18,color:`#64748b`,background:`#f1f5f9`,borderRadius:8,padding:`3px 10px`},children:n.modelId})]}),(0,R.jsx)(`div`,{className:`share-md`,children:(0,R.jsx)(T4,{text:iW(R6(t.text),l)})})]})]}),l.map(e=>{let t=[a.get(e.profileId),...e.agreeProfileIds.map(e=>a.get(e))].filter(Boolean),n=W6[e.severity];return(0,R.jsxs)(`div`,{style:{marginTop:28,borderRadius:24,border:`2px solid #fcd34d`,background:`linear-gradient(180deg,#fffbeb,#fffdf5)`,padding:`26px 30px`},children:[(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:14,flexWrap:`wrap`},children:[(0,R.jsx)(`span`,{style:{display:`flex`},children:t.slice(0,4).map((e,t)=>(0,R.jsx)(`span`,{style:{marginLeft:t?-10:0,borderRadius:999,boxShadow:`0 0 0 3px #fffbeb`},children:(0,R.jsx)(Pr,{profile:e,size:36})},e.id))}),(0,R.jsxs)(`span`,{style:{fontSize:24,fontWeight:800,color:`#78350f`},children:[`📝 `,c(`note.title`)]}),(0,R.jsxs)(`span`,{style:{fontSize:22,color:`#57534e`},children:[t.map(e=>`@${e.handle}`).join(` · `),t.length>1?` · ${c(`card.agree`)}`:``]}),(0,R.jsx)(`span`,{style:{fontSize:16,fontWeight:800,textTransform:`uppercase`,letterSpacing:1,background:n.bg,color:n.fg,borderRadius:999,padding:`4px 12px`},children:c(`sev.${e.severity}`)})]}),(0,R.jsx)(`p`,{style:{margin:`16px 0 0`,paddingLeft:16,borderLeft:`4px solid #fcd34d`,fontSize:24,fontStyle:`italic`,color:`#57534e`,lineHeight:1.45},children:e.claim}),(0,R.jsx)(`div`,{className:`share-md share-md-note`,style:{marginTop:12},children:(0,R.jsx)(T4,{text:R6(e.correction,420)})})]},e.id)}),l.length===0&&u.length>0&&(0,R.jsxs)(`div`,{style:{marginTop:28,display:`flex`,alignItems:`center`,gap:14,borderRadius:20,background:`#ecfdf5`,border:`1px solid #a7f3d0`,padding:`18px 24px`},children:[(0,R.jsx)(`span`,{style:{fontSize:26,color:`#047857`,fontWeight:800},children:`✓`}),(0,R.jsx)(`span`,{style:{display:`flex`},children:u.slice(0,5).map((e,t)=>(0,R.jsx)(`span`,{style:{marginLeft:t?-10:0,borderRadius:999,boxShadow:`0 0 0 3px #ecfdf5`},children:(0,R.jsx)(Pr,{profile:e,size:34})},e.id))}),(0,R.jsx)(`span`,{style:{fontSize:24,color:`#065f46`},children:c(`card.noDissent`,{handles:u.map(e=>`@${e.handle}`).join(` `)})})]})]}),(0,R.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,marginTop:30},children:[(0,R.jsx)(`span`,{style:{fontSize:26,fontWeight:800,color:`#0f172a`,letterSpacing:-.3},children:c(`card.tagline`)}),(0,R.jsx)(`span`,{style:{fontSize:22,fontWeight:600,color:`#0f172a`,background:`rgba(255,255,255,.7)`,borderRadius:999,padding:`8px 18px`},children:d})]})]})});function K6({kind:e,label:t}){if(!e)return null;let n=e===`dissent`?{fg:`#b45309`,ring:`#f59e0b`,bg:`#fffbeb`}:{fg:`#047857`,ring:`#10b981`,bg:`#ecfdf5`};return(0,R.jsxs)(`span`,{style:{transform:`rotate(-4deg)`,display:`inline-flex`,alignItems:`center`,gap:10,padding:`10px 22px`,borderRadius:14,border:`4px solid ${n.ring}`,background:n.bg,color:n.fg,fontSize:26,fontWeight:900,letterSpacing:3,textTransform:`uppercase`,boxShadow:`0 10px 30px -12px rgba(15,23,42,.3)`},children:[e===`dissent`?`📝`:`✓`,` `,t]})}function q6({post:e,profiles:t,onClose:n}){let r=Dn(),i=dU(),a=(0,y.useRef)(null),[o,s]=(0,y.useState)(!0),[c,l]=(0,y.useState)(null),[u,d]=(0,y.useState)(!0),[f,p]=(0,y.useState)(``),[m,h]=(0,y.useState)(``),g=ne(async()=>({question:[...(await DU(e)).slice(0,-1)].reverse().find(e=>e.kind===`user`),notes:await F.notes.where(`postId`).equals(e.id).sortBy(`createdAt`),checks:await F.checks.where(`postId`).equals(e.id).toArray()}),[e.id]),_=e.profileId?t.get(e.profileId):void 0,v=(0,y.useMemo)(()=>c?URL.createObjectURL(c):``,[c]);(0,y.useEffect)(()=>()=>{v&&URL.revokeObjectURL(v)},[v]),(0,y.useEffect)(()=>{if(!g||!a.current)return;let e=!1;d(!0);let t=setTimeout(async()=>{try{let t=await z6(a.current);e||(l(t),h(``))}catch(t){e||h(r(`share.failed`,{error:t.message}))}finally{e||d(!1)}},250);return()=>{e=!0,clearTimeout(t)}},[g,o,r]),(0,y.useEffect)(()=>{let e=e=>e.key===`Escape`&&n();return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n]);let b=(g?.notes??[]).filter(e=>e.status!==`dismissed`),x=(g?.checks??[]).filter(e=>e.verdict===`ok`),S=_?.name??`AI`,C=e=>[...new Set(e)].map(e=>t.get(e)?.name).filter(Boolean).join(`, `),w=b.length?r(`share.tweetNote`,{author:S,checkers:C(b.flatMap(e=>[e.profileId,...e.agreeProfileIds]))}):x.length?r(`share.tweetOk`,{author:S,checkers:C(x.map(e=>e.profileId))}):r(`share.tweetPlain`,{author:S}),T=`dissentry-${_?.handle??`answer`}-${e.id.slice(0,6)}.png`,E=e=>{p(e),setTimeout(()=>p(``),2500)};async function D(){c&&E(await V6(c)?r(`share.copied`):r(`share.copyUnsupported`))}async function O(){if(!c)return;let e=await V6(c);e||B6(c,T),window.open(U6(`${w}\n\n${L6}`),`_blank`,`noopener`),E(r(e?`share.pasteHint`:`share.attachHint`))}async function k(){if(c)try{await navigator.share({files:[new File([c],T,{type:`image/png`})],text:`${w} ${L6}`})}catch{}}let A=`flex items-center justify-center gap-1.5 rounded-full px-4 py-2.5 text-[14px] font-semibold transition disabled:opacity-50`;return(0,R.jsx)(`div`,{className:`fixed inset-0 z-50 flex cursor-default items-start justify-center overflow-y-auto bg-slate-900/40 p-3 py-[5vh] backdrop-blur-[2px]`,onClick:e=>{e.stopPropagation(),e.target===e.currentTarget&&n()},children:(0,R.jsxs)(`div`,{className:`w-full max-w-[600px] rounded-3xl bg-white shadow-2xl shadow-slate-900/20 ring-1 ring-slate-200`,onClick:e=>e.stopPropagation(),children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between border-b border-slate-100 px-4 py-2.5`,children:[(0,R.jsx)(`button`,{onClick:n,className:`flex h-8 w-8 items-center justify-center rounded-full text-slate-500 hover:bg-slate-100`,"aria-label":r(`common.close`),children:`✕`}),(0,R.jsx)(`span`,{className:`text-[14px] font-semibold`,children:r(`share.title`)}),(0,R.jsx)(`span`,{className:`w-8`})]}),(0,R.jsxs)(`div`,{className:`p-6 pb-4`,children:[(0,R.jsxs)(`div`,{className:`relative overflow-hidden rounded-2xl bg-slate-100 ring-1 ring-slate-200`,style:{aspectRatio:v?void 0:`1200 / 900`},children:[v&&(0,R.jsx)(`img`,{src:v,alt:r(`share.title`),className:`block w-full`}),u&&(0,R.jsx)(`div`,{className:`flex items-center justify-center ${v?`absolute inset-0 bg-white/40`:`h-full`}`,children:(0,R.jsx)(`span`,{className:`rounded-full bg-white px-3 py-1.5 text-[12.5px] font-medium text-slate-600 shadow-sm`,children:r(`share.rendering`)})})]}),(0,R.jsx)(`div`,{"aria-hidden":!0,style:{position:`fixed`,left:-1e5,top:0,pointerEvents:`none`},children:g&&(0,R.jsx)(G6,{ref:a,question:o?g.question:void 0,answer:e,author:_,notes:g.notes,checks:g.checks,profiles:t,userName:fU(i,r(`post.youName`))})}),g?.question&&(0,R.jsxs)(`label`,{className:`mt-3 flex cursor-pointer items-center gap-2 text-[13.5px] text-slate-600`,children:[(0,R.jsx)(`input`,{type:`checkbox`,className:`accent-slate-900`,checked:o,onChange:e=>s(e.target.checked)}),r(`share.includeQuestion`)]}),m&&(0,R.jsx)(`p`,{className:`mt-2 rounded-xl bg-red-50 px-3 py-2 text-[13px] text-red-700`,children:m}),(0,R.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-2 sm:grid-cols-3`,children:[(0,R.jsxs)(`button`,{onClick:()=>void O(),disabled:!c,className:`${A} col-span-2 bg-ink text-white hover:bg-slate-800 sm:col-span-1`,children:[(0,R.jsx)(J6,{}),` `,r(`share.postX`)]}),(0,R.jsxs)(`button`,{onClick:()=>void D(),disabled:!c,className:`${A} border border-slate-200 hover:bg-slate-50`,children:[(0,R.jsx)(vt,{size:16}),` `,r(`share.copy`)]}),(0,R.jsxs)(`button`,{onClick:()=>c&&B6(c,T),disabled:!c,className:`${A} border border-slate-200 hover:bg-slate-50`,children:[(0,R.jsx)(bt,{size:16}),` `,r(`share.download`)]}),H6()&&(0,R.jsxs)(`button`,{onClick:()=>void k(),disabled:!c,className:`${A} col-span-2 border border-slate-200 hover:bg-slate-50 sm:col-span-3`,children:[(0,R.jsx)(Jt,{size:16}),` `,r(`share.native`)]})]}),(0,R.jsx)(`p`,{className:`mt-3 flex min-h-[20px] items-center gap-1.5 text-[12.5px] text-slate-500`,children:f?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(ft,{size:14,className:`text-emerald-600`}),f]}):r(`share.privacy`)})]})]})})}function J6(){return(0,R.jsx)(`svg`,{width:`15`,height:`15`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":!0,children:(0,R.jsx)(`path`,{d:`M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z`})})}function Y6({post:e,profiles:t,lineBelow:n,focused:r,onReply:i}){let a=Dn(),[,o]=Pe(),s=dU(),[c,l]=(0,y.useState)(!1),[u,d]=(0,y.useState)(!1),[f,p]=(0,y.useState)(!1),m=e.profileId?t.get(e.profileId):void 0,h=ne(()=>F.notes.where(`postId`).equals(e.id).sortBy(`createdAt`),[e.id])??[],g=ne(()=>F.checks.where(`postId`).equals(e.id).toArray(),[e.id])??[],_=ne(()=>F.posts.where(`parentId`).equals(e.id).count(),[e.id])??0,v=ne(()=>e.quoteOfId?F.posts.get(e.quoteOfId):void 0,[e.quoteOfId]),b=ne(()=>e.respondsToNoteId?F.notes.get(e.respondsToNoteId):void 0,[e.respondsToNoteId]),x=e=>e.map(e=>`@${t.get(e)?.handle??`?`}`).join(` `),S=g.filter(e=>e.verdict===`pending`).map(e=>e.profileId),C=g.filter(e=>e.verdict===`ok`).map(e=>e.profileId),w=g.filter(e=>e.verdict===`error`),T=h.filter(e=>e.status!==`dismissed`||r),E=e.kind===`user`,D=E?fU(s,a(`post.youName`)):m?.name??a(`post.deletedModel`),O=E?a(`post.you`):m?.handle??`—`,k=()=>{r||o(`/post/${e.id}`)};return(0,R.jsxs)(`article`,{onClick:e=>{!e.target.closest(`a,button,pre,input,textarea`)&&!window.getSelection()?.toString()&&k()},className:`relative flex gap-3 px-4 pt-3.5 ${n?`pb-0.5`:`pb-2`} ${r?``:`cursor-pointer transition-colors hover:bg-slate-50/60`}`,children:[(0,R.jsxs)(`div`,{className:`flex flex-col items-center`,children:[(0,R.jsx)(Pr,{profile:m,user:E?fU(s,a(`post.youName`)):void 0}),n&&(0,R.jsx)(`div`,{className:`mt-1.5 w-0.5 flex-1 rounded-full bg-slate-200`})]}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1 pb-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline gap-1.5 text-[15px]`,children:[(0,R.jsx)(`span`,{className:`truncate font-bold text-ink`,children:D}),(0,R.jsxs)(`span`,{className:`truncate text-slate-500`,children:[`@`,O]}),m&&(0,R.jsx)(`span`,{className:`hidden truncate rounded-md bg-slate-100 px-1.5 py-px text-[11px] font-medium text-slate-500 sm:inline`,children:m.modelId}),(0,R.jsx)(`span`,{className:`text-slate-300`,children:`·`}),(0,R.jsx)(`span`,{className:`shrink-0 text-slate-500`,title:nW(e.createdAt),children:tW(e.createdAt)})]}),b&&(0,R.jsx)(`p`,{className:`text-[13px] text-slate-500`,children:a(`post.respondingTo`,{handle:t.get(b.profileId)?.handle??`?`})}),(0,R.jsx)(`div`,{className:`mt-0.5 text-slate-800 ${r?`text-[16.5px]`:``}`,children:E?(0,R.jsx)(`p`,{className:`whitespace-pre-wrap text-[15px] leading-relaxed`,children:Q6(e.text)}):e.text?(0,R.jsx)(T4,{text:e.status===`done`?iW(e.text,h):e.text,streaming:e.status===`streaming`}):e.status===`streaming`&&(0,R.jsxs)(`span`,{className:`dots text-2xl leading-none text-slate-400`,children:[(0,R.jsx)(`span`,{children:`•`}),(0,R.jsx)(`span`,{children:`•`}),(0,R.jsx)(`span`,{children:`•`})]})}),e.status===`error`&&(0,R.jsxs)(`div`,{className:`mt-2 flex items-start gap-2 rounded-xl border border-red-200 bg-red-50 p-2.5 text-[13.5px] text-red-800`,children:[(0,R.jsx)(`span`,{className:`flex-1`,children:e.error}),(0,R.jsx)(`button`,{onClick:t=>{t.stopPropagation(),WU(e)},className:`shrink-0 font-semibold underline`,children:a(`post.retry`)})]}),e.status===`stopped`&&(0,R.jsx)(`p`,{className:`mt-1 text-[13px] text-slate-500`,children:a(`post.stopped`)}),v&&(0,R.jsxs)(`div`,{onClick:e=>{e.stopPropagation(),o(`/post/${v.id}`)},className:`mt-2.5 max-h-56 cursor-pointer overflow-hidden rounded-2xl border border-slate-200 p-3 transition [mask-image:linear-gradient(to_bottom,black_75%,transparent)] hover:bg-slate-50/60`,children:[(0,R.jsx)(Z6,{post:v,profiles:t,userName:fU(s,a(`post.youName`))}),(0,R.jsx)(`div`,{className:`text-[14px]`,children:(0,R.jsx)(T4,{text:v.text})})]}),T.map(e=>(0,R.jsx)(D4,{note:e,profiles:t,author:m},e.id)),e.kind===`model`&&g.length>0&&(0,R.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-x-3 gap-y-0.5 text-[12.5px] text-slate-500`,children:[S.length>0&&(0,R.jsxs)(`span`,{children:[a(`post.checking`,{handles:x(S)}),(0,R.jsxs)(`span`,{className:`dots`,children:[(0,R.jsx)(`span`,{children:`.`}),(0,R.jsx)(`span`,{children:`.`}),(0,R.jsx)(`span`,{children:`.`})]})]}),C.length>0&&(0,R.jsxs)(`span`,{className:`flex items-center gap-1 text-emerald-700`,children:[(0,R.jsx)(ft,{size:13}),a(`post.noDissent`,{handles:x(C)})]}),w.map(e=>(0,R.jsxs)(`span`,{className:`text-red-500`,title:e.error,children:[`⚠ `,a(`post.couldNotCheck`,{handle:t.get(e.profileId)?.handle??`?`})]},e.profileId))]}),e.kind===`model`&&e.usage&&(0,R.jsx)($6,{post:e,checks:g,profiles:t}),(0,R.jsxs)(`div`,{className:`-ml-2 mt-1 flex max-w-md justify-between text-slate-400`,children:[(0,R.jsx)(X6,{label:a(`post.reply`),onClick:()=>i?i():o(`/post/${e.id}?reply=1`),icon:(0,R.jsx)(Pt,{size:17}),count:_,hover:`hover:text-sky-600 hover:bg-sky-50`}),(0,R.jsx)(X6,{label:a(`post.quote`),onClick:()=>l(!0),icon:(0,R.jsx)(Bt,{size:17}),hover:`hover:text-emerald-600 hover:bg-emerald-50`}),e.kind===`model`&&e.status===`streaming`&&(0,R.jsx)(X6,{label:a(`post.stop`),onClick:()=>IU(e.id),icon:(0,R.jsx)(nn,{size:16}),hover:`hover:text-red-600 hover:bg-red-50`}),e.kind===`model`&&e.status===`done`&&(0,R.jsx)(X6,{label:a(`post.checkAgain`),onClick:()=>void UU(e),icon:(0,R.jsx)(Wt,{size:17}),hover:`hover:text-amber-600 hover:bg-amber-50`}),e.kind===`model`&&e.status===`done`&&(0,R.jsx)(X6,{label:a(`post.share`),onClick:()=>d(!0),icon:(0,R.jsx)(Ot,{size:17}),hover:`hover:text-ink hover:bg-slate-100`}),e.kind===`model`&&e.status!==`streaming`&&(0,R.jsx)(X6,{label:a(`post.regenerate`),onClick:()=>void WU(e),icon:(0,R.jsx)(Ht,{size:16}),hover:`hover:text-violet-600 hover:bg-violet-50`}),(0,R.jsx)(X6,{label:a(f?`post.copied`:`post.copy`),onClick:()=>{navigator.clipboard.writeText(e.text),p(!0),setTimeout(()=>p(!1),1200)},icon:f?(0,R.jsx)(ft,{size:16}):(0,R.jsx)(vt,{size:16}),hover:`hover:text-sky-600 hover:bg-sky-50`}),(0,R.jsx)(X6,{label:a(`post.delete`),onClick:()=>{window.confirm(a(`post.deleteConfirm`))&&AU(e.id).then(()=>r&&o(`/`))},icon:(0,R.jsx)(an,{size:16}),hover:`hover:text-red-600 hover:bg-red-50`})]})]}),c&&(0,R.jsx)(k4,{post:e,profiles:t,onClose:()=>l(!1)}),u&&(0,R.jsx)(q6,{post:e,profiles:t,onClose:()=>d(!1)})]})}function X6({label:e,onClick:t,icon:n,count:r,hover:i}){return(0,R.jsxs)(`button`,{onClick:e=>{e.stopPropagation(),t()},title:e,"aria-label":e,className:`flex items-center gap-1 rounded-full p-2 text-[13px] transition-colors ${i}`,children:[n,r?(0,R.jsx)(`span`,{children:r}):null]})}function Z6({post:e,profiles:t,userName:n}){let r=Dn(),i=e.profileId?t.get(e.profileId):void 0;return(0,R.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[14px]`,children:[(0,R.jsx)(Pr,{profile:i,user:e.kind===`user`?n:void 0,size:20}),(0,R.jsx)(`b`,{className:`truncate`,children:e.kind===`user`?n:i?.name}),(0,R.jsxs)(`span`,{className:`truncate text-slate-500`,children:[`@`,e.kind===`user`?r(`post.you`):i?.handle,` · `,tW(e.createdAt)]})]})}function Q6(e){return e.split(/(@[a-z0-9][a-z0-9_.-]*)/gi).map((e,t)=>e.startsWith(`@`)?(0,R.jsx)(`span`,{className:`font-medium text-sky-600`,children:e},t):e)}function $6({post:e,checks:t,profiles:n}){let r=Dn(),i=e.profileId?n.get(e.profileId):void 0,a=e.usage,o=t.filter(e=>e.usage),s=o.reduce((e,t)=>e+t.usage.input+t.usage.output,0),c=[oW(a,i),...o.map(e=>oW(e.usage,n.get(e.profileId)))],l=c.every(e=>e!==void 0),u=c.reduce((e,t)=>e+(t??0),0),d=r(`usage.postTip`,{i:a.input,o:a.output,c:s});return(0,R.jsxs)(`p`,{className:`mt-1.5 text-[11.5px] tabular-nums text-slate-400`,title:d,children:[r(`usage.postLine`,{a:sW(a.input+a.output),c:sW(s)}),u>0&&(0,R.jsxs)(R.Fragment,{children:[` · `,l?``:`≥ `,cW(u)]})]})}var e8=30;function t8(){let e=Dn();Dr();let t=Er(),[n,r]=(0,y.useState)(e8),i=ne(async()=>{let e=await F.posts.orderBy(`createdAt`).reverse().filter(e=>!e.parentId).limit(n).toArray(),t=await F.posts.where(`parentId`).anyOf(e.map(e=>e.id)).sortBy(`createdAt`),r=new Map;for(let e of t)r.set(e.parentId,[...r.get(e.parentId)??[],e]);return e.map(e=>({post:e,replies:r.get(e.id)??[]}))},[n]);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($U,{title:e(`home.title`),sub:e(`home.sub`)}),t.size===0?(0,R.jsx)(r8,{}):(0,R.jsx)(`div`,{className:`border-b border-slate-200/80`,children:(0,R.jsx)(qU,{})}),i?.length===0&&t.size>0&&(0,R.jsx)(i8,{}),i?.map(({post:e,replies:n})=>(0,R.jsxs)(`div`,{className:`border-b border-slate-200/80`,children:[(0,R.jsx)(Y6,{post:e,profiles:t,lineBelow:n.length>0}),n.map((e,r)=>(0,R.jsx)(Y6,{post:e,profiles:t,lineBelow:r<n.length-1},e.id))]},e.id)),i&&i.length>=n&&(0,R.jsx)(`button`,{onClick:()=>r(e=>e+e8),className:`w-full py-4 text-[14px] font-medium text-sky-600 hover:bg-slate-50`,children:e(`home.more`)})]})}var n8=[`openai`,`anthropic`,`google`,`deepseek`,`qwen`,`xai`];function r8(){let e=Dn();return(0,R.jsxs)(`div`,{className:`px-6 pb-12 pt-10 text-center sm:px-10`,children:[(0,R.jsxs)(`div`,{className:`mx-auto mb-7 flex w-fit -space-x-2.5`,children:[n8.map((e,t)=>(0,R.jsx)(`span`,{className:`flex h-12 w-12 items-center justify-center rounded-full border border-slate-200 bg-white shadow-sm ring-4 ring-white`,style:{transform:`translateY(${t%2?6:0}px)`},children:(0,R.jsx)(`img`,{src:Zn(e),alt:``,className:`h-6 w-6`})},e)),(0,R.jsx)(`span`,{className:`flex h-12 w-12 items-center justify-center rounded-full bg-amber-400 text-xl shadow-sm ring-4 ring-white`,children:`📝`})]}),(0,R.jsx)(`h2`,{className:`text-balance text-[28px] font-extrabold leading-tight tracking-tight text-ink sm:text-[32px]`,children:e(`welcome.title`)}),(0,R.jsx)(`p`,{className:`mx-auto mt-3 max-w-md text-balance text-[15.5px] leading-relaxed text-slate-600`,children:e(`welcome.body`)}),(0,R.jsx)(`div`,{className:`mx-auto mt-8 grid max-w-lg gap-3 text-left sm:grid-cols-3`,children:[`welcome.step1`,`welcome.step2`,`welcome.step3`].map((t,n)=>(0,R.jsxs)(`div`,{className:`rounded-2xl border border-slate-200/80 bg-slate-50/60 p-3.5`,children:[(0,R.jsx)(`div`,{className:`mb-1.5 flex h-6 w-6 items-center justify-center rounded-full bg-ink text-[12px] font-bold text-white`,children:n+1}),(0,R.jsx)(`p`,{className:`text-[13.5px] leading-snug text-slate-700`,children:e(t)})]},t))}),(0,R.jsxs)(`div`,{className:`mt-8 flex flex-col items-center gap-3`,children:[(0,R.jsx)(vr,{size:`lg`}),(0,R.jsx)(`p`,{className:`max-w-xs text-[12.5px] text-slate-500`,children:e(`or.pitch`)}),(0,R.jsx)(Ve,{href:`/models`,className:`text-[14px] font-semibold text-slate-600 underline-offset-4 hover:text-ink hover:underline`,children:e(`welcome.cta`)})]}),(0,R.jsx)(`p`,{className:`mx-auto mt-4 max-w-sm text-[12.5px] text-slate-400`,children:e(`welcome.privacy`)})]})}function i8(){let e=Dn();return(0,R.jsxs)(`div`,{className:`px-8 py-12 text-center`,children:[(0,R.jsx)(`div`,{className:`mb-3 text-3xl`,children:`📝`}),(0,R.jsx)(`h2`,{className:`text-[22px] font-extrabold tracking-tight text-ink`,children:e(`tips.title`)}),(0,R.jsx)(`p`,{className:`mx-auto mt-2 max-w-md text-[14.5px] leading-relaxed text-slate-600`,children:e(`tips.body`)}),(0,R.jsx)(`p`,{className:`mx-auto mt-4 max-w-md rounded-xl bg-amber-50 px-4 py-2.5 text-[13px] text-amber-900`,children:e(`tips.saving`)})]})}function a8({id:e}){let t=Dn();Dr();let n=Er(),r=Fe(),[i,a]=(0,y.useState)(!1),o=(0,y.useRef)(null),s=ne(async()=>{let t=await F.posts.get(e);if(!t)return{missing:!0};let n=await DU(t),r=await F.posts.where(`parentId`).equals(e).sortBy(`createdAt`),i=await F.posts.where(`quoteOfId`).equals(e).count();return{missing:!1,post:t,ancestors:n.slice(0,-1),root:n[0],replies:r,quotes:i}},[e]);if((0,y.useEffect)(()=>{a(new URLSearchParams(r).has(`reply`))},[r,e]),(0,y.useEffect)(()=>{o.current?.scrollIntoView({block:`start`})},[e,s?.missing]),!s)return(0,R.jsx)($U,{title:t(`thread.title`),back:!0});if(s.missing)return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($U,{title:t(`thread.title`),back:!0}),(0,R.jsx)(`p`,{className:`p-8 text-slate-500`,children:t(`thread.deleted`)})]});let{post:c,ancestors:l,replies:u,quotes:d,root:f}=s,p=c.profileId?n.get(c.profileId):void 0;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($U,{title:Nr(f.text,50),sub:t(`thread.title`),back:!0}),l.map(e=>(0,R.jsx)(Y6,{post:e,profiles:n,lineBelow:!0},e.id)),(0,R.jsx)(`div`,{ref:o,className:`scroll-mt-16`,children:(0,R.jsx)(Y6,{post:c,profiles:n,focused:!0,onReply:()=>a(!0)})}),d>0&&(0,R.jsx)(`p`,{className:`border-t border-slate-100 px-4 py-2 text-[13px] text-slate-500`,children:t(`thread.quoted`,{n:d})}),(0,R.jsx)(`div`,{className:`border-y border-slate-200/80 bg-slate-50/40`,children:i||u.length===0?(0,R.jsx)(qU,{compact:!0,parentId:c.id,autoFocus:i,implicitHandle:p?.handle,placeholder:p?t(`thread.replyTo`,{handle:p.handle}):t(`thread.replyMention`),onPosted:()=>a(!1)},e):(0,R.jsx)(`button`,{onClick:()=>a(!0),className:`w-full px-4 py-3.5 text-left text-[15px] text-slate-400 hover:bg-slate-50`,children:t(`thread.postReply`)})}),u.map(e=>(0,R.jsx)(`div`,{className:`border-b border-slate-200/80`,children:(0,R.jsx)(Y6,{post:e,profiles:n})},e.id))]})}var o8=[{id:`anthropic`,label:`Anthropic (Claude)`,protocol:`anthropic`,baseUrl:`https://api.anthropic.com/v1`,handle:`claude`,color:`#d97757`,needsKey:!0,keyUrl:`https://console.anthropic.com/settings/keys`,modelHint:`claude-sonnet-5-5`},{id:`openai`,label:`OpenAI`,protocol:`openai`,baseUrl:`https://api.openai.com/v1`,handle:`gpt`,color:`#10a37f`,needsKey:!0,keyUrl:`https://platform.openai.com/api-keys`,modelHint:`pick from Fetch models`},{id:`google`,label:`Google Gemini`,protocol:`google`,baseUrl:`https://generativelanguage.googleapis.com/v1beta`,handle:`gemini`,color:`#4285f4`,needsKey:!0,keyUrl:`https://aistudio.google.com/apikey`,modelHint:`pick from Fetch models`},{id:`openrouter`,label:`OpenRouter (hundreds of models)`,protocol:`openai`,baseUrl:`https://openrouter.ai/api/v1`,handle:`router`,color:`#6467f2`,needsKey:!0,keyUrl:`https://openrouter.ai/keys`,modelHint:`vendor/model, e.g. qwen/…`},{id:`deepseek`,label:`DeepSeek`,protocol:`openai`,baseUrl:`https://api.deepseek.com/v1`,handle:`deepseek`,color:`#4d6bfe`,needsKey:!0,keyUrl:`https://platform.deepseek.com/api_keys`,modelHint:`deepseek-chat`},{id:`qwen`,label:`Qwen (Alibaba Model Studio)`,protocol:`openai`,baseUrl:`https://dashscope-intl.aliyuncs.com/compatible-mode/v1`,handle:`qwen`,color:`#615ced`,needsKey:!0,keyUrl:`https://modelstudio.console.alibabacloud.com/`,modelHint:`qwen-plus`,note:`Mainland China accounts use https://dashscope.aliyuncs.com/compatible-mode/v1`},{id:`xai`,label:`xAI (Grok)`,protocol:`openai`,baseUrl:`https://api.x.ai/v1`,handle:`grok`,color:`#111827`,needsKey:!0,keyUrl:`https://console.x.ai/`,modelHint:`pick from Fetch models`},{id:`groq`,label:`Groq`,protocol:`openai`,baseUrl:`https://api.groq.com/openai/v1`,handle:`groq`,color:`#f55036`,needsKey:!0,keyUrl:`https://console.groq.com/keys`,modelHint:`pick from Fetch models`},{id:`mistral`,label:`Mistral`,protocol:`openai`,baseUrl:`https://api.mistral.ai/v1`,handle:`mistral`,color:`#fa520f`,needsKey:!0,keyUrl:`https://console.mistral.ai/api-keys`,modelHint:`mistral-large-latest`},{id:`ollama`,label:`Ollama (local)`,protocol:`openai`,baseUrl:`http://localhost:11434/v1`,handle:`llama`,color:`#334155`,needsKey:!1,local:!0,modelHint:`e.g. llama3.2, qwen3`,note:`Runs on your machine. In Docker use http://host.docker.internal:11434/v1`},{id:`lmstudio`,label:`LM Studio (local)`,protocol:`openai`,baseUrl:`http://localhost:1234/v1`,handle:`local`,color:`#7c3aed`,needsKey:!1,local:!0,modelHint:`model loaded in LM Studio`,note:`Start the server in LM Studio → Developer.`},{id:`custom`,label:`Custom (OpenAI-compatible)`,protocol:`openai`,baseUrl:`http://localhost:8000/v1`,handle:`custom`,color:`#64748b`,needsKey:!1,modelHint:`model id`,note:`vLLM, llama.cpp server, LiteLLM, Together, Fireworks, …`}],s8=e=>o8.find(t=>t.id===e)??o8[o8.length-1];function c8(e=`anthropic`,t=[]){let n=s8(e),r=n.handle;for(let e=2;t.includes(r);e++)r=`${n.handle}${e}`;return{id:We(),handle:r,name:n.label.replace(/ \(.*\)$/,``),color:n.color,presetId:n.id,protocol:n.protocol,baseUrl:n.baseUrl,modelId:``,apiKey:``,useProxy:!0,systemPrompt:``,enabled:!0,isChecker:!1,createdAt:Date.now()}}function l8(){let e=Dn(),t=Tr(),[n,r]=(0,y.useState)(null),[i,a]=(0,y.useState)(!1),o=Fe(),[,s]=Pe();(0,y.useEffect)(()=>{t&&new URLSearchParams(o).has(`add`)&&(r(c8(`anthropic`,t.map(e=>e.handle))),a(!0),s(`/models`,{replace:!0}))},[o,t,s]);let c=(e,t)=>F.profiles.update(e.id,{[t]:!e[t]});return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($U,{title:e(`models.title`),sub:e(`models.sub`)}),!vU()&&(0,R.jsxs)(`div`,{className:`border-b border-slate-200/80 bg-slate-50 px-4 py-3 text-[13px] leading-relaxed text-slate-600`,children:[(0,R.jsx)(`b`,{className:`text-ink`,children:e(`models.hostedTitle`)}),` `,e(`models.hostedBody`),` `,e(`models.hostedOllama`),` `,(0,R.jsxs)(`code`,{className:`rounded bg-white px-1 ring-1 ring-slate-200`,children:[`OLLAMA_ORIGINS=`,location.origin]}),` `,e(`models.hostedNpx`),` `,(0,R.jsx)(`code`,{className:`rounded bg-white px-1 ring-1 ring-slate-200`,children:`npx dissentry`})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2 border-b border-slate-200/80 bg-gradient-to-r from-indigo-50/70 to-white px-4 py-4`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`p`,{className:`text-[14.5px] font-semibold text-ink`,children:e(`or.cardTitle`)}),(0,R.jsx)(`p`,{className:`text-[12.5px] text-slate-500`,children:e(`or.pitch`)})]}),(0,R.jsx)(vr,{})]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-slate-200/80 px-4 py-3`,children:[(0,R.jsx)(`p`,{className:`text-[13px] text-slate-500`,children:e(`models.checkerHint`)}),(0,R.jsx)(`button`,{onClick:()=>{r(c8(`anthropic`,(t??[]).map(e=>e.handle))),a(!0)},className:`shrink-0 rounded-full bg-ink px-4 py-2 text-[13.5px] font-semibold text-white hover:bg-slate-800`,children:e(`models.add`)})]}),t?.length===0&&!n&&(0,R.jsx)(`div`,{className:`p-6 text-[14.5px] leading-relaxed text-slate-500`,children:e(`models.empty`)}),n&&i&&(0,R.jsx)(d8,{value:n,isNew:!0,taken:(t??[]).map(e=>e.handle),onDone:()=>r(null)}),t?.map(o=>n?.id===o.id&&!i?(0,R.jsx)(d8,{value:n,taken:(t??[]).filter(e=>e.id!==o.id).map(e=>e.handle),onDone:()=>r(null)},o.id):(0,R.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-slate-200/80 px-4 py-3.5 transition ${o.enabled?``:`opacity-50`}`,children:[(0,R.jsx)(Pr,{profile:o,size:42}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline gap-1.5`,children:[(0,R.jsx)(`b`,{className:`truncate text-ink`,children:o.name}),(0,R.jsxs)(`span`,{className:`truncate text-[14px] text-slate-500`,children:[`@`,o.handle]})]}),(0,R.jsxs)(`div`,{className:`truncate text-[12.5px] text-slate-500`,children:[o.modelId||(0,R.jsx)(`i`,{children:e(`models.noModel`)}),` · `,s8(o.presetId).label]})]}),(0,R.jsx)(u8,{label:e(`common.checker`),on:o.isChecker,onClick:()=>c(o,`isChecker`),tone:`amber`}),(0,R.jsx)(u8,{label:e(`models.on`),on:o.enabled,onClick:()=>c(o,`enabled`)}),(0,R.jsx)(`button`,{onClick:()=>{r({...o}),a(!1)},className:`rounded-full border border-slate-200 px-3.5 py-1.5 text-[13px] font-semibold hover:bg-slate-50`,children:e(`common.edit`)})]},o.id))]})}function u8({label:e,on:t,onClick:n,tone:r}){return(0,R.jsxs)(`button`,{onClick:n,className:`hidden rounded-full px-2.5 py-1 text-[12px] font-semibold ring-1 transition sm:block ${t?r===`amber`?`bg-amber-100 text-amber-800 ring-amber-200`:`bg-emerald-50 text-emerald-700 ring-emerald-200`:`bg-white text-slate-400 ring-slate-200 hover:text-slate-600`}`,children:[t?`✓ `:``,e]})}function d8({value:e,isNew:t,taken:n,onDone:r}){let i=Dn(),[a,o]=(0,y.useState)(e),[s,c]=(0,y.useState)([]),[l,u]=(0,y.useState)(null),d=s8(a.presetId),f=e=>o(t=>({...t,...e})),p=n.includes(a.handle),m=a.handle&&!p&&a.modelId&&a.baseUrl&&(!d.needsKey||a.apiKey);function h(e){let r=s8(e),i=c8(e,n);o(n=>({...n,presetId:e,protocol:r.protocol,baseUrl:r.baseUrl,color:r.color,modelId:``,...t?{handle:i.handle,name:i.name}:{}})),c([]),u(null)}async function g(){u({kind:`busy`,text:i(`editor.fetching`)});try{let e=await wU(a);c(e),u({kind:`ok`,text:i(`editor.modelsFound`,{n:e.length})}),!a.modelId&&e[0]&&f({modelId:e[0]})}catch(e){u({kind:`err`,text:EU(e,a)})}}async function _(){u({kind:`busy`,text:i(`editor.testing`)});try{let e=performance.now(),{text:t}=await dk({model:CU(a),prompt:`Reply with the single word: OK`,maxRetries:0});u({kind:`ok`,text:i(`editor.connected`,{ms:Math.round(performance.now()-e),reply:t.trim().slice(0,40)})})}catch(e){u({kind:`err`,text:EU(e,a)})}}async function v(){await F.profiles.put({...a,handle:$n(a.handle)}),r()}async function b(){window.confirm(i(`editor.removeConfirm`,{handle:a.handle}))&&(await F.profiles.delete(a.id),r())}let x=`w-full rounded-xl border border-slate-200 bg-white px-3 py-2 text-[15px] outline-none transition focus:border-sky-400 focus:ring-4 focus:ring-sky-100`;return(0,R.jsxs)(`div`,{className:`space-y-3.5 border-b border-slate-200/80 bg-slate-50/70 px-4 py-5`,children:[(0,R.jsxs)(f8,{label:i(`editor.provider`),children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(Pr,{profile:a,size:40}),(0,R.jsx)(`select`,{value:a.presetId,onChange:e=>h(e.target.value),className:x,children:o8.map(e=>(0,R.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),d.note&&(0,R.jsx)(`p`,{className:`mt-1 text-[12px] text-slate-500`,children:d.note})]}),(0,R.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,R.jsx)(f8,{label:i(`editor.name`),children:(0,R.jsx)(`input`,{className:x,value:a.name,onChange:e=>f({name:e.target.value})})}),(0,R.jsxs)(f8,{label:i(`editor.handle`),children:[(0,R.jsx)(`input`,{className:x,value:a.handle,onChange:e=>f({handle:$n(e.target.value)})}),p&&(0,R.jsx)(`p`,{className:`mt-1 text-[12px] text-red-500`,children:i(`editor.handleTaken`,{handle:a.handle})})]})]}),(0,R.jsx)(f8,{label:i(`editor.baseUrl`),children:(0,R.jsx)(`input`,{className:x,value:a.baseUrl,onChange:e=>f({baseUrl:e.target.value})})}),(0,R.jsxs)(f8,{label:d.needsKey?i(`editor.key`):i(`editor.keyOptional`),children:[(0,R.jsx)(`input`,{className:x,type:`password`,autoComplete:`off`,value:a.apiKey,placeholder:d.needsKey?i(`editor.keyPlaceholder`):i(`editor.keyLocal`),onChange:e=>f({apiKey:e.target.value.trim()})}),d.keyUrl&&(0,R.jsx)(`a`,{href:d.keyUrl,target:`_blank`,rel:`noreferrer`,className:`mt-1 inline-block text-[12px] font-medium text-sky-600 hover:underline`,children:i(`editor.getKey`)})]}),(0,R.jsx)(f8,{label:i(`editor.model`),children:(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(`input`,{className:x,list:`models-${a.id}`,value:a.modelId,placeholder:d.modelHint,onChange:e=>f({modelId:e.target.value.trim()})}),(0,R.jsx)(`datalist`,{id:`models-${a.id}`,children:s.map(e=>(0,R.jsx)(`option`,{value:e},e))}),(0,R.jsx)(`button`,{onClick:()=>void g(),className:`shrink-0 rounded-xl border border-slate-200 bg-white px-3 text-[13px] font-semibold hover:bg-slate-50`,children:i(`editor.fetch`)})]})}),(0,R.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,R.jsx)(f8,{label:i(`editor.inPrice`),children:(0,R.jsx)(`input`,{className:x,inputMode:`decimal`,placeholder:`—`,value:a.inPrice??``,onChange:e=>f({inPrice:e.target.value===``?void 0:Math.max(0,Number(e.target.value))||0})})}),(0,R.jsx)(f8,{label:i(`editor.outPrice`),children:(0,R.jsx)(`input`,{className:x,inputMode:`decimal`,placeholder:`—`,value:a.outPrice??``,onChange:e=>f({outPrice:e.target.value===``?void 0:Math.max(0,Number(e.target.value))||0})})})]}),(0,R.jsx)(`p`,{className:`-mt-2 text-[12px] text-slate-500`,children:i(`editor.priceHelp`)}),(0,R.jsx)(f8,{label:i(`editor.instructions`),children:(0,R.jsx)(`textarea`,{className:x,rows:2,value:a.systemPrompt,placeholder:i(`editor.instructionsPlaceholder`),onChange:e=>f({systemPrompt:e.target.value})})}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-2 text-[14px]`,children:[(0,R.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`input`,{type:`checkbox`,className:`accent-amber-500`,checked:a.isChecker,onChange:e=>f({isChecker:e.target.checked})}),` `,i(`editor.checker`)]}),(0,R.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`input`,{type:`color`,value:a.color,onChange:e=>f({color:e.target.value}),className:`h-6 w-8 cursor-pointer rounded bg-transparent`}),` `,i(`editor.color`)]}),vU()&&(0,R.jsxs)(`label`,{className:`flex items-center gap-2`,title:i(`editor.routeHint`),children:[(0,R.jsx)(`input`,{type:`checkbox`,checked:a.useProxy,onChange:e=>f({useProxy:e.target.checked})}),` `,i(`editor.route`)]})]}),l&&(0,R.jsx)(`p`,{className:`rounded-xl px-3 py-2 text-[13px] ${l.kind===`ok`?`bg-emerald-50 text-emerald-800`:l.kind===`err`?`bg-red-50 text-red-800`:`bg-white text-slate-600 ring-1 ring-slate-200`}`,children:l.text}),(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-2 pt-1`,children:[(0,R.jsx)(`button`,{disabled:!m,onClick:()=>void v(),className:`rounded-full bg-ink px-5 py-2 text-[13.5px] font-semibold text-white hover:bg-slate-800 disabled:bg-slate-300`,children:i(`common.save`)}),(0,R.jsx)(`button`,{disabled:!a.modelId,onClick:()=>void _(),className:`rounded-full border border-slate-200 bg-white px-4 py-2 text-[13.5px] font-semibold hover:bg-slate-50 disabled:opacity-50`,children:i(`editor.test`)}),(0,R.jsx)(`button`,{onClick:r,className:`rounded-full px-4 py-2 text-[13.5px] font-semibold text-slate-500 hover:text-ink`,children:i(`common.cancel`)}),!t&&(0,R.jsx)(`button`,{onClick:()=>void b(),className:`ml-auto rounded-full px-3 py-2 text-[13.5px] font-semibold text-red-500 hover:bg-red-50`,children:i(`common.remove`)})]})]})}function f8({label:e,children:t}){return(0,R.jsxs)(`label`,{className:`block`,children:[(0,R.jsx)(`span`,{className:`mb-1.5 block text-[12.5px] font-semibold text-slate-600`,children:e}),t]})}function p8(e,t,n,r){let i=t.filter(e=>e.kind===`model`&&e.status===`done`&&!e.respondsToNoteId),a=new Map;for(let e of n)a.set(e.postId,[...a.get(e.postId)??[],e]);let o=new Set(r.filter(e=>e.verdict===`ok`||e.verdict===`note`).map(e=>e.postId));return e.map(e=>{let t=i.filter(t=>t.profileId===e.id),s=t.flatMap(e=>a.get(e.id)??[]),c=n.filter(t=>t.profileId===e.id||t.agreeProfileIds.includes(e.id));return{profile:e,answers:t.length,checkedAnswers:t.filter(e=>o.has(e.id)).length,correctedAnswers:t.filter(e=>(a.get(e.id)??[]).some(e=>e.status===`accepted`)).length,openNotesReceived:s.filter(e=>e.status===`open`).length,checksRun:r.filter(t=>t.profileId===e.id&&(t.verdict===`ok`||t.verdict===`note`)).length,notesWritten:c.length,notesAccepted:c.filter(e=>e.status===`accepted`).length,notesDismissed:c.filter(e=>e.status===`dismissed`).length}}).sort((e,t)=>t.answers+t.checksRun-(e.answers+e.checksRun))}var m8=(e,t)=>t?`${Math.round(e/t*100)}%`:`–`;function h8(){let e=Dn(),t=ne(async()=>p8(await F.profiles.toArray(),await F.posts.toArray(),await F.notes.toArray(),await F.checks.toArray()),[]),n=t?.reduce((e,t)=>({corrected:e.corrected+t.correctedAnswers,checked:e.checked+t.checkedAnswers}),{corrected:0,checked:0});return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($U,{title:e(`trust.title`),sub:e(`trust.sub`)}),n&&n.checked>0&&(0,R.jsxs)(`div`,{className:`border-b border-slate-200/80 bg-gradient-to-br from-amber-50 to-white px-5 py-6`,children:[(0,R.jsx)(`p`,{className:`text-[40px] font-extrabold leading-none tracking-tight text-ink`,children:n.corrected}),(0,R.jsx)(`p`,{className:`mt-2 text-[14px] text-slate-600`,children:e(`trust.summary`,{n:n.checked})})]}),t?.length===0&&(0,R.jsx)(`p`,{className:`p-6 text-slate-500`,children:e(`trust.empty`)}),t?.map(t=>(0,R.jsxs)(`div`,{className:`border-b border-slate-200/80 px-4 py-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,R.jsx)(Pr,{profile:t.profile,size:38}),(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`b`,{className:`text-ink`,children:t.profile.name}),` `,(0,R.jsxs)(`span`,{className:`text-slate-500`,children:[`@`,t.profile.handle]}),(0,R.jsx)(`div`,{className:`truncate text-[12px] text-slate-500`,children:t.profile.modelId})]})]}),(0,R.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-3 text-[13px]`,children:[(0,R.jsx)(g8,{title:e(`trust.asAnswerer`),empty:t.checkedAnswers===0?e(`trust.noAnswers`):``,big:m8(t.checkedAnswers-t.correctedAnswers,t.checkedAnswers),bigLabel:e(`trust.heldUp`),lines:[e(`trust.answers`,{a:t.answers,c:t.checkedAnswers}),e(`trust.corrected`,{n:t.correctedAnswers}),t.openNotesReceived?e(`trust.awaiting`,{n:t.openNotesReceived}):``]}),(0,R.jsx)(g8,{title:e(`trust.asChecker`),empty:t.checksRun===0?e(`trust.noChecks`):t.notesAccepted+t.notesDismissed===0?e(`trust.noRated`,{a:t.checksRun,n:t.notesWritten}):``,big:m8(t.notesAccepted,t.notesAccepted+t.notesDismissed),bigLabel:e(`trust.notesRight`),lines:[e(`trust.reviewed`,{a:t.checksRun,n:t.notesWritten}),e(`trust.acceptedDismissed`,{a:t.notesAccepted,d:t.notesDismissed})]})]})]},t.profile.id)),(0,R.jsx)(`p`,{className:`px-4 py-4 text-[12px] text-slate-400`,children:e(`trust.footnote`)})]})}function g8({title:e,big:t,bigLabel:n,lines:r,empty:i}){return(0,R.jsxs)(`div`,{className:`rounded-2xl border p-3.5 ${i?`border-dashed border-slate-200 bg-slate-50/50`:`border-slate-200/80 bg-white`}`,children:[(0,R.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wider text-slate-400`,children:e}),i?(0,R.jsx)(`p`,{className:`mt-2 text-[13px] leading-snug text-slate-400`,children:i}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`mt-1`,children:[(0,R.jsx)(`span`,{className:`text-[26px] font-extrabold tracking-tight text-ink`,children:t}),` `,(0,R.jsx)(`span`,{className:`text-slate-500`,children:n})]}),r.filter(Boolean).map(e=>(0,R.jsx)(`div`,{className:`text-slate-500`,children:e},e))]})]})}var _8=864e5,v8=[{id:`today`,days:0},{id:`7d`,days:7},{id:`30d`,days:30},{id:`all`,days:1/0}];function y8(){let e=Dn(),[t,n]=(0,y.useState)(`30d`),r=ne(async()=>({profiles:await F.profiles.toArray(),posts:await F.posts.toArray(),checks:await F.checks.toArray()}),[]);if(!r)return(0,R.jsx)($U,{title:e(`usage.title`)});let i=new Date;i.setHours(0,0,0,0);let a=e=>e===0?i.getTime():e===1/0?0:Date.now()-e*_8,o=v8.slice(0,3).map(e=>({r:e,s:lW(r.profiles,r.posts,r.checks,a(e.days))})),s=lW(r.profiles,r.posts,r.checks,a(v8.find(e=>e.id===t).days)),c=s.total.tokens?Math.round(s.total.checkTokens/s.total.tokens*100):0,l=(e,t)=>t?cW(e):`≥ ${cW(e)}`;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($U,{title:e(`usage.title`),sub:e(`usage.sub`)}),(0,R.jsx)(`div`,{className:`grid grid-cols-3 gap-3 border-b border-slate-200/80 px-4 py-5`,children:o.map(({r,s:i})=>(0,R.jsxs)(`button`,{onClick:()=>n(r.id),className:`rounded-2xl border p-3.5 text-left transition ${t===r.id?`border-ink bg-white ring-4 ring-slate-100`:`border-slate-200/80 bg-white hover:border-slate-300`}`,children:[(0,R.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wider text-slate-400`,children:e(`usage.range.${r.id}`)}),(0,R.jsx)(`div`,{className:`mt-1 text-[24px] font-extrabold tracking-tight text-ink`,children:sW(i.total.tokens)}),(0,R.jsxs)(`div`,{className:`text-[12.5px] text-slate-500`,children:[e(`usage.tokens`),` · `,i.total.tokens?l(i.total.cost,i.total.priced):`$0`]})]},r.id))}),s.total.tokens>0&&(0,R.jsxs)(`div`,{className:`border-b border-slate-200/80 px-4 py-4`,children:[(0,R.jsxs)(`div`,{className:`mb-2 flex justify-between text-[12.5px] text-slate-500`,children:[(0,R.jsxs)(`span`,{children:[e(`usage.answering`),` · `,sW(s.total.answerTokens)]}),(0,R.jsxs)(`span`,{children:[e(`usage.checking`),` · `,sW(s.total.checkTokens),` (`,c,`%)`]})]}),(0,R.jsxs)(`div`,{className:`flex h-2.5 overflow-hidden rounded-full bg-slate-100`,children:[(0,R.jsx)(`div`,{className:`bg-sky-500`,style:{width:`${100-c}%`}}),(0,R.jsx)(`div`,{className:`bg-amber-400`,style:{width:`${c}%`}})]}),(0,R.jsx)(`p`,{className:`mt-2 text-[12.5px] text-slate-500`,children:e(`usage.checkInsight`,{pct:c})})]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between px-4 pb-1 pt-4`,children:[(0,R.jsx)(`h2`,{className:`text-[15px] font-bold text-ink`,children:e(`usage.byModel`)}),(0,R.jsx)(`div`,{className:`flex rounded-full bg-slate-100 p-0.5 text-[12px] font-medium`,children:v8.map(r=>(0,R.jsx)(`button`,{onClick:()=>n(r.id),className:`rounded-full px-2.5 py-1 ${t===r.id?`bg-white text-ink shadow-sm`:`text-slate-500`}`,children:e(`usage.range.${r.id}`)},r.id))})]}),s.rows.length===0&&(0,R.jsx)(`p`,{className:`px-4 py-8 text-[14px] text-slate-500`,children:e(`usage.empty`)}),s.rows.map(t=>{let n=t.answerTokens+t.checkTokens;return(0,R.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-slate-100 px-4 py-3`,children:[(0,R.jsx)(Pr,{profile:t.profile,size:34}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`div`,{className:`truncate text-[14px] font-semibold text-ink`,children:[t.profile.name,` `,(0,R.jsxs)(`span`,{className:`font-normal text-slate-500`,children:[`@`,t.profile.handle]})]}),(0,R.jsx)(`div`,{className:`text-[12px] text-slate-500`,children:e(`usage.split`,{a:sW(t.answerTokens),c:sW(t.checkTokens)})})]}),(0,R.jsxs)(`div`,{className:`text-right`,children:[(0,R.jsx)(`div`,{className:`text-[14px] font-semibold tabular-nums text-ink`,children:sW(n)}),(0,R.jsx)(`div`,{className:`text-[12px] tabular-nums text-slate-500`,title:t.priced?``:e(`usage.noPrice`),children:t.priced?cW(t.cost):e(`usage.addPrice`)})]})]},t.profile.id)}),(0,R.jsx)(`p`,{className:`px-4 py-4 text-[12px] leading-relaxed text-slate-400`,children:e(`usage.footnote`)})]})}var b8=[{label:`OpenAI`,url:`https://api.openai.com/v1/models`},{label:`Anthropic`,url:`https://api.anthropic.com/v1/models`},{label:`Google Gemini`,url:`https://generativelanguage.googleapis.com/v1beta/models`},{label:`xAI`,url:`https://api.x.ai/v1/models`},{label:`DeepSeek`,url:`https://api.deepseek.com/v1/models`},{label:`Qwen (China)`,url:`https://dashscope.aliyuncs.com/compatible-mode/v1/models`}];function x8(e,t){if(!e.trim())return t(`proxy.enterAddress`);try{let n=new URL(e.trim());return[`http:`,`https:`,`socks5:`,`socks5h:`,`socks:`].includes(n.protocol)?n.hostname?null:t(`proxy.badUrl`):t(`proxy.badScheme`)}catch{return t(`proxy.badUrl`)}}function S8(){let e=Dn(),t=dU(),[n,r]=(0,y.useState)(b8[0].url),[i,a]=(0,y.useState)(null),[o,s]=(0,y.useState)(!1),c=gU(),l=t.proxyMode===`custom`?x8(t.proxyUrl,e):null;async function u(){s(!0),a(null);let t=performance.now();try{let r=await bU(n,{method:`GET`}),i=Math.round(performance.now()-t);if(r.status===502||r.status===400){let e=await r.json().catch(()=>({}));a({ok:!1,text:e.error?.message??`HTTP ${r.status}`})}else a({ok:!0,text:e(`proxy.reachable`,{ms:i,status:r.status})})}catch(e){a({ok:!1,text:e.message})}finally{s(!1)}}let d=(e,n,r)=>(0,R.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-3 rounded-2xl border px-3.5 py-3 transition ${t.proxyMode===e?`border-sky-300 bg-sky-50/60 ring-4 ring-sky-50`:`border-slate-200 hover:bg-slate-50`}`,children:[(0,R.jsx)(`input`,{type:`radio`,name:`proxyMode`,className:`mt-1 accent-sky-600`,checked:t.proxyMode===e,onChange:()=>{uU({proxyMode:e}),a(null)}}),(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`b`,{className:`text-[14px] text-ink`,children:n}),(0,R.jsx)(`br`,{}),(0,R.jsx)(`span`,{className:`text-[13px] text-slate-500`,children:r})]})]}),f=`w-full rounded-xl border border-slate-200 bg-white px-3 py-2 text-[14px] outline-none focus:border-sky-400 focus:ring-4 focus:ring-sky-100`;return(0,R.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[d(`system`,e(`proxy.system`),c?(0,R.jsxs)(R.Fragment,{children:[e(`proxy.systemFound`),` `,(0,R.jsx)(`code`,{children:c})]}):e(`proxy.systemNone`)),d(`direct`,e(`proxy.direct`),e(`proxy.directDesc`)),d(`custom`,e(`proxy.custom`),e(`proxy.customDesc`)),t.proxyMode===`custom`&&(0,R.jsxs)(`div`,{className:`space-y-3 px-1 pt-1`,children:[(0,R.jsxs)(`label`,{className:`block`,children:[(0,R.jsx)(`span`,{className:`mb-1.5 block text-[12.5px] font-semibold text-slate-600`,children:e(`proxy.address`)}),(0,R.jsx)(`input`,{className:f,value:t.proxyUrl,placeholder:`http://127.0.0.1:7890 · socks5://127.0.0.1:1080`,onChange:e=>{uU({proxyUrl:e.target.value}),a(null)},spellCheck:!1,autoComplete:`off`}),(0,R.jsx)(`span`,{className:`mt-1 block text-[12px] text-slate-500`,children:e(`proxy.addressHelp`)}),t.proxyUrl&&l&&(0,R.jsx)(`span`,{className:`mt-1 block text-[12px] text-red-500`,children:l})]}),(0,R.jsxs)(`label`,{className:`block`,children:[(0,R.jsx)(`span`,{className:`mb-1.5 block text-[12.5px] font-semibold text-slate-600`,children:e(`proxy.bypass`)}),(0,R.jsx)(`input`,{className:f,value:t.proxyBypass,placeholder:`.aliyuncs.com, api.deepseek.com`,onChange:e=>uU({proxyBypass:e.target.value}),spellCheck:!1}),(0,R.jsx)(`span`,{className:`mt-1 block text-[12px] text-slate-500`,children:e(`proxy.bypassHelp`)})]})]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-1`,children:[(0,R.jsx)(`select`,{value:n,onChange:e=>{r(e.target.value),a(null)},className:`rounded-full border border-slate-200 bg-white px-3 py-1.5 text-[13px]`,children:b8.map(e=>(0,R.jsx)(`option`,{value:e.url,children:e.label},e.url))}),(0,R.jsx)(`button`,{onClick:()=>void u(),disabled:o||!!l,className:`rounded-full border border-slate-200 bg-white px-4 py-1.5 text-[13px] font-semibold hover:bg-slate-50 disabled:opacity-50`,children:e(o?`proxy.testing`:`proxy.test`)})]}),i&&(0,R.jsx)(`p`,{className:`rounded-xl px-3 py-2 text-[13px] ${i.ok?`bg-emerald-50 text-emerald-800`:`bg-red-50 text-red-800`}`,children:i.text})]})}function C8(){let e=Dn(),t=dU(),n=(0,y.useRef)(null),[r,i]=(0,y.useState)(``);async function a(e){let t=await jU(e),n=URL.createObjectURL(new Blob([JSON.stringify(t,null,2)],{type:`application/json`}));Object.assign(document.createElement(`a`),{href:n,download:`dissentry-${new Date().toISOString().slice(0,10)}.json`}).click(),URL.revokeObjectURL(n)}async function o(t){try{await MU(JSON.parse(await t.text())),i(e(`settings.imported`))}catch(t){i(e(`settings.importFailed`,{error:t.message}))}}let s=`border-b border-slate-200/80 px-4 py-5`,c=`rounded-full border border-slate-200 bg-white px-4 py-2 text-[13px] font-semibold hover:bg-slate-50`;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($U,{title:e(`settings.title`)}),(0,R.jsxs)(`div`,{className:s,children:[(0,R.jsx)(`h2`,{className:`text-[15px] font-bold text-ink`,children:e(`settings.profile`)}),(0,R.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-end gap-6`,children:[(0,R.jsxs)(`label`,{className:`block`,children:[(0,R.jsx)(`span`,{className:`mb-1.5 block text-[12.5px] font-semibold text-slate-600`,children:e(`settings.name`)}),(0,R.jsx)(`input`,{value:t.userName,placeholder:e(`post.youName`),onChange:e=>uU({userName:e.target.value}),className:`w-56 rounded-xl border border-slate-200 px-3 py-2 outline-none focus:border-sky-400 focus:ring-4 focus:ring-sky-100`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`span`,{className:`mb-1.5 block text-[12.5px] font-semibold text-slate-600`,children:e(`layout.language`)}),(0,R.jsx)(`div`,{className:`rounded-xl border border-slate-200 px-3 py-1`,children:(0,R.jsx)(kn,{})})]})]})]}),(0,R.jsxs)(`label`,{className:`${s} flex cursor-pointer items-start gap-3`,children:[(0,R.jsx)(`input`,{type:`checkbox`,className:`mt-1 accent-amber-500`,checked:t.autoCheck,onChange:e=>uU({autoCheck:e.target.checked})}),(0,R.jsxs)(`span`,{children:[(0,R.jsx)(`b`,{className:`text-[15px] text-ink`,children:e(`settings.autoCheck`)}),(0,R.jsx)(`br`,{}),(0,R.jsx)(`span`,{className:`text-[13px] text-slate-500`,children:e(`settings.autoCheckDesc`)})]})]}),(0,R.jsx)(`div`,{className:s,children:vU()?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`h2`,{className:`text-[15px] font-bold text-ink`,children:e(`proxy.title`)}),(0,R.jsx)(`p`,{className:`mt-1 text-[13px] text-slate-500`,children:e(`proxy.localDesc`)}),(0,R.jsx)(S8,{})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`h2`,{className:`text-[15px] font-bold text-ink`,children:e(`connection.title`)}),(0,R.jsx)(`p`,{className:`mt-1 text-[13px] leading-relaxed text-slate-500`,children:e(`connection.hostedDesc`)})]})}),(0,R.jsxs)(`div`,{className:s,children:[(0,R.jsx)(`h2`,{className:`text-[15px] font-bold text-ink`,children:e(`settings.data`)}),(0,R.jsx)(`p`,{className:`mt-1 text-[13px] text-slate-500`,children:e(`settings.dataDesc`)}),(0,R.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,R.jsx)(`button`,{className:c,onClick:()=>void a(!1),children:e(`settings.export`)}),(0,R.jsx)(`button`,{className:c,onClick:()=>void a(!0),children:e(`settings.exportKeys`)}),(0,R.jsx)(`button`,{className:c,onClick:()=>n.current?.click(),children:e(`settings.import`)}),(0,R.jsx)(`input`,{ref:n,type:`file`,accept:`application/json`,hidden:!0,onChange:e=>e.target.files?.[0]&&void o(e.target.files[0])}),(0,R.jsx)(`button`,{className:`${c} border-red-200 text-red-600 hover:bg-red-50`,onClick:()=>{window.confirm(e(`settings.clearConfirm`))&&NU().then(()=>i(e(`settings.cleared`)))},children:e(`settings.clear`)})]}),r&&(0,R.jsx)(`p`,{className:`mt-2 text-[13px]`,children:r})]})]})}var w8=e=>e===void 0?`?`:e<.1?e.toFixed(3):e<10?e.toFixed(2):e.toFixed(0);function T8(){let e=Dn(),t=Fe(),[,n]=Pe(),[r,i]=(0,y.useState)(`working`),[a,o]=(0,y.useState)(``),[s,c]=(0,y.useState)([]),l=(0,y.useRef)(``),u=(0,y.useRef)(!1);(0,y.useEffect)(()=>{u.current||(u.current=!0,(async()=>{try{l.current=await lr(t),history.replaceState(null,``,location.pathname);let e=gr(await mr());c(e.map((e,t)=>({handle:e.family.handle,label:e.family.label,modelId:e.model.id,on:t<4,inPrice:e.model.inPrice,outPrice:e.model.outPrice}))),i(`pick`)}catch(t){let n=t.message;o(n===`cancelled`?e(`or.cancelled`):n===`state`?e(`or.stateError`):e(`or.failed`,{error:n})),i(`error`)}})())},[t,e]);async function d(){let e=s.filter(e=>e.on);e.length&&(await _r(l.current,e.map(({handle:e,label:t,modelId:n,inPrice:r,outPrice:i})=>({handle:e,label:t,modelId:n,inPrice:r,outPrice:i}))),l.current=``,n(`/`))}let f=e=>({id:e.handle,handle:e.handle,name:e.label,color:`#64748b`,presetId:`openrouter`,protocol:`openai`,baseUrl:nr,modelId:e.modelId,apiKey:``,useProxy:!0,systemPrompt:``,enabled:!0,isChecker:!0,createdAt:0});return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)($U,{title:e(`or.title`)}),r===`working`&&(0,R.jsx)(`p`,{className:`px-6 py-16 text-center text-[15px] text-slate-500`,children:e(`or.connecting`)}),r===`error`&&(0,R.jsxs)(`div`,{className:`px-6 py-14 text-center`,children:[(0,R.jsx)(`p`,{className:`mx-auto max-w-sm text-[15px] text-slate-600`,children:a}),(0,R.jsxs)(`div`,{className:`mt-6 flex justify-center gap-3`,children:[(0,R.jsx)(vr,{}),(0,R.jsx)(Ve,{href:`/models`,className:`rounded-full border border-slate-200 px-4 py-2 text-[13.5px] font-semibold`,children:e(`or.useKey`)})]})]}),r===`pick`&&(0,R.jsxs)(`div`,{className:`px-5 py-6`,children:[(0,R.jsxs)(`div`,{className:`mb-5 flex items-center gap-2.5 rounded-2xl bg-emerald-50 px-4 py-3 text-[14px] text-emerald-800`,children:[(0,R.jsx)(ft,{size:18}),e(`or.connected`)]}),(0,R.jsx)(`h2`,{className:`text-[18px] font-bold tracking-tight text-ink`,children:e(`or.pickTitle`)}),(0,R.jsx)(`p`,{className:`mt-1 text-[13.5px] text-slate-500`,children:e(`or.pickSub`)}),(0,R.jsx)(`ul`,{className:`mt-4 divide-y divide-slate-100 overflow-hidden rounded-2xl border border-slate-200`,children:s.map((t,n)=>(0,R.jsx)(`li`,{children:(0,R.jsxs)(`label`,{className:`flex cursor-pointer items-center gap-3 px-4 py-3 transition ${t.on?`bg-sky-50/50`:`hover:bg-slate-50`}`,children:[(0,R.jsx)(`input`,{type:`checkbox`,className:`h-4 w-4 accent-slate-900`,checked:t.on,onChange:()=>c(e=>e.map((e,t)=>t===n?{...e,on:!e.on}:e))}),(0,R.jsx)(Pr,{profile:f(t),size:34}),(0,R.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,R.jsxs)(`div`,{className:`text-[14.5px] font-semibold text-ink`,children:[t.label,` `,(0,R.jsxs)(`span`,{className:`font-normal text-slate-500`,children:[`@`,t.handle]})]}),(0,R.jsx)(`div`,{className:`truncate text-[12.5px] text-slate-500`,children:t.modelId})]}),(0,R.jsxs)(`div`,{className:`shrink-0 text-right text-[11.5px] leading-tight text-slate-500`,title:e(`or.priceHint`),children:[(0,R.jsxs)(`div`,{className:`font-semibold text-slate-700`,children:[`$`,w8(t.inPrice),` / $`,w8(t.outPrice)]}),(0,R.jsx)(`div`,{children:e(`or.perMillion`)})]})]})},t.modelId))}),(0,R.jsx)(`p`,{className:`mt-3 text-[12.5px] leading-relaxed text-slate-500`,children:e(`or.keyNote`)}),(0,R.jsxs)(`div`,{className:`mt-5 flex items-center gap-3`,children:[(0,R.jsx)(`button`,{onClick:()=>void d(),disabled:!s.some(e=>e.on),className:`rounded-full bg-ink px-6 py-2.5 text-[14.5px] font-semibold text-white hover:bg-slate-800 disabled:bg-slate-300`,children:e(`or.add`,{n:s.filter(e=>e.on).length})}),(0,R.jsx)(Ve,{href:`/models`,className:`text-[13.5px] font-medium text-slate-500 hover:text-ink`,children:e(`or.more`)})]})]})]})}function E8(){let e=Dn(),[t]=Pe(),n=ne(async()=>await F.profiles.count()===0&&await F.posts.count()===0,[]);return t===`/welcome`||t===`/`&&n&&!localStorage.getItem(`dissentry.started`)?(0,R.jsx)(wr,{}):t===`/`&&n===void 0?null:(0,R.jsx)(XU,{children:(0,R.jsxs)(Ue,{children:[(0,R.jsx)(Be,{path:`/`,component:t8}),(0,R.jsx)(Be,{path:`/post/:id`,children:e=>(0,R.jsx)(a8,{id:e.id})}),(0,R.jsx)(Be,{path:`/models`,component:l8}),(0,R.jsx)(Be,{path:`/trust`,component:h8}),(0,R.jsx)(Be,{path:`/usage`,component:y8}),(0,R.jsx)(Be,{path:`/settings`,component:C8}),(0,R.jsx)(Be,{path:`/auth/openrouter`,component:T8}),(0,R.jsx)(Be,{children:(0,R.jsx)(`div`,{className:`p-8 text-slate-500`,children:e(`common.notFound`)})})]})})}_U().finally(()=>{(0,b.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(y.StrictMode,{children:(0,R.jsx)(E8,{})}))});