@forsion/clip 0.0.0-stage → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +138 -2
- package/chrome-mv3/_locales/en/messages.json +17 -0
- package/chrome-mv3/_locales/zh_CN/messages.json +17 -0
- package/chrome-mv3/assets/App-CTFaMeAz.css +1 -0
- package/chrome-mv3/assets/document-export-Dk8vjRKk.css +1 -0
- package/chrome-mv3/assets/imageHosts-4UXWVpSw.css +1 -0
- package/chrome-mv3/background.js +162 -0
- package/chrome-mv3/chunks/App-CjD26llS.js +408 -0
- package/chrome-mv3/chunks/_virtual_wxt-html-plugins-DPbbfBKe.js +1 -0
- package/chrome-mv3/chunks/document-export-DNFinZCF.js +22 -0
- package/chrome-mv3/chunks/imageHosts-Cmp3E2vS.js +58 -0
- package/chrome-mv3/chunks/offscreen-CogL61qx.js +1 -0
- package/chrome-mv3/content-scripts/content.js +668 -0
- package/chrome-mv3/document-export.html +27 -0
- package/chrome-mv3/icon/128.png +0 -0
- package/chrome-mv3/icon/16.png +0 -0
- package/chrome-mv3/icon/32.png +0 -0
- package/chrome-mv3/icon/48.png +0 -0
- package/chrome-mv3/icon/logo.png +0 -0
- package/chrome-mv3/manifest.json +1 -0
- package/chrome-mv3/offscreen.html +3 -0
- package/chrome-mv3/options.html +16 -0
- package/chrome-mv3/sidepanel.html +16 -0
- package/package.json +54 -4
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
var CS=Object.defineProperty;var ES=(a,l,u)=>l in a?CS(a,l,{enumerable:!0,configurable:!0,writable:!0,value:u}):a[l]=u;var jv=(a,l,u)=>ES(a,typeof l!="symbol"?l+"":l,u);import{E as TS,r as Md,u as Rd,D as pd,I as _v}from"./imageHosts-Cmp3E2vS.js";var gd={exports:{}},ps={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var zv;function AS(){if(zv)return ps;zv=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function u(s,f,d){var m=null;if(d!==void 0&&(m=""+d),f.key!==void 0&&(m=""+f.key),"key"in f){d={};for(var p in f)p!=="key"&&(d[p]=f[p])}else d=f;return f=d.ref,{$$typeof:a,type:s,key:m,ref:f!==void 0?f:null,props:d}}return ps.Fragment=l,ps.jsx=u,ps.jsxs=u,ps}var wv;function OS(){return wv||(wv=1,gd.exports=AS()),gd.exports}var o=OS(),vd={exports:{}},Re={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Nv;function kS(){if(Nv)return Re;Nv=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),m=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),S=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),j=Symbol.for("react.view_transition"),w=Symbol.iterator;function E(C){return C===null||typeof C!="object"?null:(C=w&&C[w]||C["@@iterator"],typeof C=="function"?C:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,Z={};function Y(C,V,de){this.props=C,this.context=V,this.refs=Z,this.updater=de||T}Y.prototype.isReactComponent={},Y.prototype.setState=function(C,V){if(typeof C!="object"&&typeof C!="function"&&C!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,C,V,"setState")},Y.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function ye(){}ye.prototype=Y.prototype;function te(C,V,de){this.props=C,this.context=V,this.refs=Z,this.updater=de||T}var ue=te.prototype=new ye;ue.constructor=te,A(ue,Y.prototype),ue.isPureReactComponent=!0;var I=Array.isArray;function Q(){}var G={H:null,A:null,T:null,S:null},ie=Object.prototype.hasOwnProperty;function _e(C,V,de){var re=de.ref;return{$$typeof:a,type:C,key:V,ref:re!==void 0?re:null,props:de}}function ce(C,V){return _e(C.type,V,C.props)}function Se(C){return typeof C=="object"&&C!==null&&C.$$typeof===a}function he(C){var V={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(de){return V[de]})}var le=/\/+/g;function X(C,V){return typeof C=="object"&&C!==null&&C.key!=null?he(""+C.key):V.toString(36)}function z(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(Q,Q):(C.status="pending",C.then(function(V){C.status==="pending"&&(C.status="fulfilled",C.value=V)},function(V){C.status==="pending"&&(C.status="rejected",C.reason=V)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function U(C,V,de,re,Ne){var ee=typeof C;(ee==="undefined"||ee==="boolean")&&(C=null);var fe=!1;if(C===null)fe=!0;else switch(ee){case"bigint":case"string":case"number":fe=!0;break;case"object":switch(C.$$typeof){case a:case l:fe=!0;break;case y:return fe=C._init,U(fe(C._payload),V,de,re,Ne)}}if(fe)return Ne=Ne(C),fe=re===""?"."+X(C,0):re,I(Ne)?(de="",fe!=null&&(de=fe.replace(le,"$&/")+"/"),U(Ne,V,de,"",function(He){return He})):Ne!=null&&(Se(Ne)&&(Ne=ce(Ne,de+(Ne.key==null||C&&C.key===Ne.key?"":(""+Ne.key).replace(le,"$&/")+"/")+fe)),V.push(Ne)),1;fe=0;var oe=re===""?".":re+":";if(I(C))for(var pe=0;pe<C.length;pe++)re=C[pe],ee=oe+X(re,pe),fe+=U(re,V,de,ee,Ne);else if(pe=E(C),typeof pe=="function")for(C=pe.call(C),pe=0;!(re=C.next()).done;)re=re.value,ee=oe+X(re,pe++),fe+=U(re,V,de,ee,Ne);else if(ee==="object"){if(typeof C.then=="function")return U(z(C),V,de,re,Ne);throw V=String(C),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return fe}function B(C,V,de){if(C==null)return C;var re=[],Ne=0;return U(C,re,"","",function(ee){return V.call(de,ee,Ne++)}),re}function se(C){if(C._status===-1){var V=C._result,de=V();de.then(function(re){(C._status===0||C._status===-1)&&(C._status=1,C._result=re,de.status===void 0&&(de.status="fulfilled",de.value=re))},function(re){(C._status===0||C._status===-1)&&(C._status=2,C._result=re,de.status===void 0&&(de.status="rejected",de.reason=re))}),C._status===-1&&(C._status=0,C._result=de)}if(C._status===1)return C._result.default;throw C._result}var ae=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)};function je(C){var V=G.T,de={};de.types=V!==null?V.types:null,G.T=de;try{var re=C(),Ne=G.S;Ne!==null&&Ne(de,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(Q,ae)}catch(ee){ae(ee)}finally{V!==null&&de.types!==null&&(V.types=de.types),G.T=V}}function Te(C){var V=G.T;if(V!==null){var de=V.types;de===null?V.types=[C]:de.indexOf(C)===-1&&de.push(C)}else je(Te.bind(null,C))}var ke={map:B,forEach:function(C,V,de){B(C,function(){V.apply(this,arguments)},de)},count:function(C){var V=0;return B(C,function(){V++}),V},toArray:function(C){return B(C,function(V){return V})||[]},only:function(C){if(!Se(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return Re.Activity=v,Re.Children=ke,Re.Component=Y,Re.Fragment=u,Re.Profiler=f,Re.PureComponent=te,Re.StrictMode=s,Re.Suspense=g,Re.ViewTransition=j,Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=G,Re.__COMPILER_RUNTIME={__proto__:null,c:function(C){return G.H.useMemoCache(C)}},Re.addTransitionType=Te,Re.cache=function(C){return function(){return C.apply(null,arguments)}},Re.cacheSignal=function(){return null},Re.cloneElement=function(C,V,de){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var re=A({},C.props),Ne=C.key;if(V!=null)for(ee in V.key!==void 0&&(Ne=""+V.key),V)!ie.call(V,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&V.ref===void 0||(re[ee]=V[ee]);var ee=arguments.length-2;if(ee===1)re.children=de;else if(1<ee){for(var fe=Array(ee),oe=0;oe<ee;oe++)fe[oe]=arguments[oe+2];re.children=fe}return _e(C.type,Ne,re)},Re.createContext=function(C){return C={$$typeof:m,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:d,_context:C},C},Re.createElement=function(C,V,de){var re,Ne={},ee=null;if(V!=null)for(re in V.key!==void 0&&(ee=""+V.key),V)ie.call(V,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(Ne[re]=V[re]);var fe=arguments.length-2;if(fe===1)Ne.children=de;else if(1<fe){for(var oe=Array(fe),pe=0;pe<fe;pe++)oe[pe]=arguments[pe+2];Ne.children=oe}if(C&&C.defaultProps)for(re in fe=C.defaultProps,fe)Ne[re]===void 0&&(Ne[re]=fe[re]);return _e(C,ee,Ne)},Re.createRef=function(){return{current:null}},Re.forwardRef=function(C){return{$$typeof:p,render:C}},Re.isValidElement=Se,Re.lazy=function(C){return{$$typeof:y,_payload:{_status:-1,_result:C},_init:se}},Re.memo=function(C,V){return{$$typeof:S,type:C,compare:V===void 0?null:V}},Re.startTransition=je,Re.unstable_useCacheRefresh=function(){return G.H.useCacheRefresh()},Re.use=function(C){return G.H.use(C)},Re.useActionState=function(C,V,de){return G.H.useActionState(C,V,de)},Re.useCallback=function(C,V){return G.H.useCallback(C,V)},Re.useContext=function(C){return G.H.useContext(C)},Re.useDebugValue=function(){},Re.useDeferredValue=function(C,V){return G.H.useDeferredValue(C,V)},Re.useEffect=function(C,V){return G.H.useEffect(C,V)},Re.useEffectEvent=function(C){return G.H.useEffectEvent(C)},Re.useId=function(){return G.H.useId()},Re.useImperativeHandle=function(C,V,de){return G.H.useImperativeHandle(C,V,de)},Re.useInsertionEffect=function(C,V){return G.H.useInsertionEffect(C,V)},Re.useLayoutEffect=function(C,V){return G.H.useLayoutEffect(C,V)},Re.useMemo=function(C,V){return G.H.useMemo(C,V)},Re.useOptimistic=function(C,V){return G.H.useOptimistic(C,V)},Re.useReducer=function(C,V,de){return G.H.useReducer(C,V,de)},Re.useRef=function(C){return G.H.useRef(C)},Re.useState=function(C){return G.H.useState(C)},Re.useSyncExternalStore=function(C,V,de){return G.H.useSyncExternalStore(C,V,de)},Re.useTransition=function(){return G.H.useTransition()},Re.version="19.3.0",Re}var Cv;function nh(){return Cv||(Cv=1,vd.exports=kS()),vd.exports}var k=nh();const Ev="2.1.0";var yd={exports:{}},gs={},bd={exports:{}},xd={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var Tv;function DS(){return Tv||(Tv=1,(function(a){function l(z,U){var B=z.length;z.push(U);e:for(;0<B;){var se=B-1>>>1,ae=z[se];if(0<f(ae,U))z[se]=U,z[B]=ae,B=se;else break e}}function u(z){return z.length===0?null:z[0]}function s(z){if(z.length===0)return null;var U=z[0],B=z.pop();if(B!==U){z[0]=B;e:for(var se=0,ae=z.length,je=ae>>>1;se<je;){var Te=2*(se+1)-1,ke=z[Te],C=Te+1,V=z[C];if(0>f(ke,B))C<ae&&0>f(V,ke)?(z[se]=V,z[C]=B,se=C):(z[se]=ke,z[Te]=B,se=Te);else if(C<ae&&0>f(V,B))z[se]=V,z[C]=B,se=C;else break e}}return U}function f(z,U){var B=z.sortIndex-U.sortIndex;return B!==0?B:z.id-U.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;a.unstable_now=function(){return d.now()}}else{var m=Date,p=m.now();a.unstable_now=function(){return m.now()-p}}var g=[],S=[],y=1,v=null,j=3,w=!1,E=!1,T=!1,A=!1,Z=typeof setTimeout=="function"?setTimeout:null,Y=typeof clearTimeout=="function"?clearTimeout:null,ye=typeof setImmediate<"u"?setImmediate:null;function te(z){for(var U=u(S);U!==null;){if(U.callback===null)s(S);else if(U.startTime<=z)s(S),U.sortIndex=U.expirationTime,l(g,U);else break;U=u(S)}}function ue(z){if(T=!1,te(z),!E)if(u(g)!==null)E=!0,I||(I=!0,Se());else{var U=u(S);U!==null&&X(ue,U.startTime-z)}}var I=!1,Q=-1,G=5,ie=-1;function _e(){return A?!0:!(a.unstable_now()-ie<G)}function ce(){if(A=!1,I){var z=a.unstable_now();ie=z;var U=!0;try{e:{E=!1,T&&(T=!1,Y(Q),Q=-1),w=!0;var B=j;try{t:{for(te(z),v=u(g);v!==null&&!(v.expirationTime>z&&_e());){var se=v.callback;if(typeof se=="function"){v.callback=null,j=v.priorityLevel;var ae=se(v.expirationTime<=z);if(z=a.unstable_now(),typeof ae=="function"){v.callback=ae,te(z),U=!0;break t}v===u(g)&&s(g),te(z)}else s(g);v=u(g)}if(v!==null)U=!0;else{var je=u(S);je!==null&&X(ue,je.startTime-z),U=!1}}break e}finally{v=null,j=B,w=!1}U=void 0}}finally{U?Se():I=!1}}}var Se;if(typeof ye=="function")Se=function(){ye(ce)};else if(typeof MessageChannel<"u"){var he=new MessageChannel,le=he.port2;he.port1.onmessage=ce,Se=function(){le.postMessage(null)}}else Se=function(){Z(ce,0)};function X(z,U){Q=Z(function(){z(a.unstable_now())},U)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(z){z.callback=null},a.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):G=0<z?Math.floor(1e3/z):5},a.unstable_getCurrentPriorityLevel=function(){return j},a.unstable_next=function(z){switch(j){case 1:case 2:case 3:var U=3;break;default:U=j}var B=j;j=U;try{return z()}finally{j=B}},a.unstable_requestPaint=function(){A=!0},a.unstable_runWithPriority=function(z,U){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var B=j;j=z;try{return U()}finally{j=B}},a.unstable_scheduleCallback=function(z,U,B){var se=a.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?se+B:se):B=se,z){case 1:var ae=-1;break;case 2:ae=250;break;case 5:ae=1073741823;break;case 4:ae=1e4;break;default:ae=5e3}return ae=B+ae,z={id:y++,callback:U,priorityLevel:z,startTime:B,expirationTime:ae,sortIndex:-1},B>se?(z.sortIndex=B,l(S,z),u(g)===null&&z===u(S)&&(T?(Y(Q),Q=-1):T=!0,X(ue,B-se))):(z.sortIndex=ae,l(g,z),E||w||(E=!0,I||(I=!0,Se()))),z},a.unstable_shouldYield=_e,a.unstable_wrapCallback=function(z){var U=j;return function(){var B=j;j=U;try{return z.apply(this,arguments)}finally{j=B}}}})(xd)),xd}var Av;function MS(){return Av||(Av=1,bd.exports=DS()),bd.exports}var Sd={exports:{}},Jt={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var Ov;function RS(){if(Ov)return Jt;Ov=1;var a=nh();function l(y){var v="https://react.dev/errors/"+y;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var j=2;j<arguments.length;j++)v+="&args[]="+encodeURIComponent(arguments[j])}return"Minified React error #"+y+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var s={d:{f:u,r:function(){throw Error(l(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},f=Symbol.for("react.portal"),d=Symbol.for("react.recoverable"),m=Symbol.for("react.optimistic_key");function p(y,v,j){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:w==null?null:w===m?m:""+w,children:y,containerInfo:v,implementation:j}}var g=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function S(y,v){if(y==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return Jt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Jt.browser=function(y){return{$$typeof:d,_reason:y}},Jt.createPortal=function(y,v){var j=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(l(299));return p(y,v,null,j)},Jt.flushSync=function(y){var v=g.T,j=s.p;try{if(g.T=null,s.p=2,y)return y()}finally{g.T=v,s.p=j,s.d.f()}},Jt.preconnect=function(y,v){typeof y=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,s.d.C(y,v))},Jt.prefetchDNS=function(y){typeof y=="string"&&s.d.D(y)},Jt.preinit=function(y,v){if(typeof y=="string"&&v&&typeof v.as=="string"){var j=v.as,w=S(j,v.crossOrigin),E=typeof v.integrity=="string"?v.integrity:void 0,T=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;j==="style"?s.d.S(y,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:w,integrity:E,fetchPriority:T}):j==="script"&&s.d.X(y,{crossOrigin:w,integrity:E,fetchPriority:T,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},Jt.preinitModule=function(y,v){if(typeof y=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var j=S(v.as,v.crossOrigin);s.d.M(y,{crossOrigin:j,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0})}}else v==null&&s.d.M(y)},Jt.preload=function(y,v){if(typeof y=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var j=v.as,w=S(j,v.crossOrigin);s.d.L(y,j,{crossOrigin:w,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},Jt.preloadModule=function(y,v){if(typeof y=="string")if(v){var j=S(v.as,v.crossOrigin);s.d.m(y,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:j,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0})}else s.d.m(y)},Jt.requestFormReset=function(y){s.d.r(y)},Jt.unstable_batchedUpdates=function(y,v){return y(v)},Jt.useFormState=function(y,v,j){return g.H.useFormState(y,v,j)},Jt.useFormStatus=function(){return g.H.useHostTransitionStatus()},Jt.version="19.3.0",Jt}var kv;function US(){if(kv)return Sd.exports;kv=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),Sd.exports=RS(),Sd.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var Dv;function ZS(){if(Dv)return gs;Dv=1;var a=MS(),l=nh(),u=US();function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){for(var t=e,n=t;n&&!n.alternate;)t=n,(t.flags&4098)!==0&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(d(e)!==e)throw Error(s(188))}function S(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(s(188));return t!==e?null:e}for(var n=e,i=t;;){var r=n.return;if(r===null)break;var c=r.alternate;if(c===null){if(i=r.return,i!==null){n=i;continue}break}if(r.child===c.child){for(c=r.child;c;){if(c===n)return g(r),e;if(c===i)return g(r),t;c=c.sibling}throw Error(s(188))}if(n.return!==i.return)n=r,i=c;else{for(var h=!1,b=r.child;b;){if(b===n){h=!0,n=r,i=c;break}if(b===i){h=!0,i=r,n=c;break}b=b.sibling}if(!h){for(b=c.child;b;){if(b===n){h=!0,n=c,i=r;break}if(b===i){h=!0,i=c,n=r;break}b=b.sibling}if(!h)throw Error(s(189))}}if(n.alternate!==i)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}function v(e,t,n,i,r,c){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,i,r,c)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&v(e.child,t,n,i,r,c))return!0;e=e.sibling}return!1}function j(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function w(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function E(e){var t=[null,null],n=j(e);return n===null||T(t,e,n.child,{foundSelf:!1}),t}function T(e,t,n,i){for(;n!==null;){if(n===t)i.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(i.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&T(e,t,n.child,i))return!0;n=n.sibling}return!1}function A(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(s(559))}}var Z=null,Y=null;function ye(e,t,n){return e===n?!0:e===t?(Z=e,!0):!1}function te(e,t,n){return e===n?(Y=e,!1):e===t?(Y!==null&&(Z=e),!0):!1}function ue(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function I(e,t,n){for(var i=0,r=e;r;r=n(r))i++;r=0;for(var c=t;c;c=n(c))r++;for(;0<i-r;)e=n(e),i--;for(;0<r-i;)t=n(t),r--;for(;i--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var Q=Object.assign,G=Symbol.for("react.element"),ie=Symbol.for("react.transitional.element"),_e=Symbol.for("react.portal"),ce=Symbol.for("react.fragment"),Se=Symbol.for("react.strict_mode"),he=Symbol.for("react.profiler"),le=Symbol.for("react.consumer"),X=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),se=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),je=Symbol.for("react.activity"),Te=Symbol.for("react.legacy_hidden"),ke=Symbol.for("react.memo_cache_sentinel"),C=Symbol.for("react.view_transition"),V=Symbol.for("react.recoverable"),de=Symbol.iterator;function re(e){return e===null||typeof e!="object"?null:(e=de&&e[de]||e["@@iterator"],typeof e=="function"?e:null)}var Ne=Symbol.for("react.client.reference");function ee(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ne?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ce:return"Fragment";case he:return"Profiler";case Se:return"StrictMode";case U:return"Suspense";case B:return"SuspenseList";case je:return"Activity";case C:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case _e:return"Portal";case X:return e.displayName||"Context";case le:return(e._context.displayName||"Context")+".Consumer";case z:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case se:return t=e.displayName||null,t!==null?t:ee(e.type)||"Memo";case ae:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var fe=Array.isArray,oe=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pe=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,He={pending:!1,data:null,method:null,action:null},xn=[],ma=-1;function Gt(e){return{current:e}}function xt(e){0>ma||(e.current=xn[ma],xn[ma]=null,ma--)}function Pe(e,t){ma++,xn[ma]=e.current,e.current=t}var sn=Gt(null),Wt=Gt(null),en=Gt(null),Tn=Gt(null);function Da(e,t){switch(Pe(en,t),Pe(Wt,e),Pe(sn,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Og(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Og(t),e=kg(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}xt(sn),Pe(sn,e)}function $t(){xt(sn),xt(Wt),xt(en)}function ea(e){var t=e.memoizedState;t!==null&&(ir._currentValue=t.memoizedState,Pe(Tn,e)),t=sn.current;var n=kg(t,e.type);t!==n&&(Pe(Wt,e),Pe(sn,n))}function Ma(e){Wt.current===e&&(xt(sn),xt(Wt)),Tn.current===e&&(xt(Tn),ir._currentValue=He)}var pa,Ll;function tn(e){if(pa===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);pa=t&&t[1]||"",Ll=-1<n.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+pa+e+Ll}var ne=!1;function Le(e,t){if(!e||ne)return"";ne=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var P=function(){throw Error()};if(Object.defineProperty(P.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(P,[])}catch(me){var D=me}Reflect.construct(e,[],P)}else{try{P.call()}catch(me){D=me}P=!1;try{var H=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),P=!0,new e}finally{P&&(H!==void 0?Object.defineProperty(e.prototype,"props",H):delete e.prototype.props)}}}else{try{throw Error()}catch(me){D=me}(P=e())&&typeof P.catch=="function"&&P.catch(function(){})}}catch(me){if(me&&D&&typeof me.stack=="string")return[me.stack,D.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=i.DetermineComponentFrameRoot(),h=c[0],b=c[1];if(h&&b){var N=h.split(`
|
|
44
|
+
`),R=b.split(`
|
|
45
|
+
`);for(r=i=0;i<N.length&&!N[i].includes("DetermineComponentFrameRoot");)i++;for(;r<R.length&&!R[r].includes("DetermineComponentFrameRoot");)r++;if(i===N.length||r===R.length)for(i=N.length-1,r=R.length-1;1<=i&&0<=r&&N[i]!==R[r];)r--;for(;1<=i&&0<=r;i--,r--)if(N[i]!==R[r]){if(i!==1||r!==1)do if(i--,r--,0>r||N[i]!==R[r]){var L=`
|
|
46
|
+
`+N[i].replace(" at new "," at ");return e.displayName&&L.includes("<anonymous>")&&(L=L.replace("<anonymous>",e.displayName)),L}while(1<=i&&0<=r);break}}}finally{ne=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?tn(n):""}function Ae(e,t){switch(e.tag){case 26:case 27:case 5:return tn(e.type);case 16:return tn("Lazy");case 13:return e.child!==t&&t!==null?tn("Suspense Fallback"):tn("Suspense");case 19:return tn("SuspenseList");case 0:case 15:return Le(e.type,!1);case 11:return Le(e.type.render,!1);case 1:return Le(e.type,!0);case 31:return tn("Activity");case 30:return tn("ViewTransition");default:return""}}function ft(e){try{var t="",n=null;do t+=Ae(e,n),n=e,e=e.return;while(e);return t}catch(i){return`
|
|
47
|
+
Error generating stack: `+i.message+`
|
|
48
|
+
`+i.stack}}var Ot=Object.prototype.hasOwnProperty,ga=a.unstable_scheduleCallback,un=a.unstable_cancelCallback,yi=a.unstable_shouldYield,ta=a.unstable_requestPaint,Ht=a.unstable_now,ze=a.unstable_getCurrentPriorityLevel,ot=a.unstable_ImmediatePriority,Ue=a.unstable_UserBlockingPriority,_t=a.unstable_NormalPriority,Vo=a.unstable_LowPriority,Us=a.unstable_IdlePriority,Ra=a.log,Zs=a.unstable_setDisableYieldValue,va=null,nn=null;function on(e){if(typeof Ra=="function"&&Zs(e),nn&&typeof nn.setStrictMode=="function")try{nn.setStrictMode(va,e)}catch{}}var kt=Math.clz32?Math.clz32:_,Go=Math.log,bi=Math.LN2;function _(e){return e>>>=0,e===0?32:31-(Go(e)/bi|0)|0}var Vn=256,Me=262144,Sn=4194304;function cn(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 ql(e,t,n){var i=e.pendingLanes;if(i===0)return 0;var r=0,c=e.suspendedLanes,h=e.pingedLanes;e=e.warmLanes;var b=i&134217727;return b!==0?(i=b&~c,i!==0?r=cn(i):(h&=b,h!==0?r=cn(h):n||(n=b&~e,n!==0&&(r=cn(n))))):(b=i&~c,b!==0?r=cn(b):h!==0?r=cn(h):n||(n=i&~e,n!==0&&(r=cn(n)))),r===0?0:t!==0&&t!==r&&(t&c)===0&&(c=r&-r,n=t&-t,c>=n||c===32&&(n&4194048)!==0)?t:r}function Ua(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function vr(e,t){(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var i=31-kt(n),r=1<<i;t|=e[i],n&=~r}return t}function $s(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 xi(){var e=Sn;return Sn<<=1,(Sn&62914560)===0&&(Sn=4194304),e}function yr(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Yl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function br(e,t,n,i,r,c){var h=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 b=e.entanglements,N=e.expirationTimes,R=e.hiddenUpdates;for(n=h&~n;0<n;){var L=31-kt(n),P=1<<L;b[L]=0,N[L]=-1;var D=R[L];if(D!==null)for(R[L]=null,L=0;L<D.length;L++){var H=D[L];H!==null&&(H.lane&=-536870913)}n&=~P}i!==0&&st(e,i,0),c!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=c&~(h&~t))}function st(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-kt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|n&261930}function jn(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var i=31-kt(n),r=1<<i;r&t|e[i]&t&&(e[i]|=t),n&=~r}}function Bs(e,t){var n=t&-t;return n=(n&42)!==0?1:Si(n),(n&(e.suspendedLanes|t))!==0?0:n}function Si(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 il(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ji(){var e=pe.p;return e!==0?e:(e=window.event,e===void 0?32:pv(e.type))}function Hs(e,t){var n=pe.p;try{return pe.p=e,t()}finally{pe.p=n}}var fn=Math.random().toString(36).slice(2),zt="__reactFiber$"+fn,an="__reactProps$"+fn,Za="__reactContainer$"+fn,Vl="__reactEvents$"+fn,Ls="__reactListeners$"+fn,Xo="__reactHandles$"+fn,qs="__reactResources$"+fn,ya="__reactMarker$"+fn,Gl="__reactLoad$"+fn;function $a(e){delete e[zt],delete e[an],delete e[Ls],delete e[Xo]}function ln(e){var t;if(t=e[zt])return t;for(var n=e.parentNode;n;){if(t=n[Za]||n[zt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Kg(e);e!==null;){if(n=e[zt])return n;e=Kg(e)}return t}e=n,n=e.parentNode}return null}function na(e){if(e=e[zt]||e[Za]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Xl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function rl(e){var t=e[qs];return t||(t=e[qs]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Tt(e){e[ya]=!0}function xr(e){e[Gl]=void 0}var Sr=new Set,jr={};function ba(e,t){Ba(e,t),Ba(e+"Capture",t)}function Ba(e,t){for(jr[e]=t,e=0;e<t.length;e++)Sr.add(t[e])}var Ys=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]*$"),_r={},zr={};function Vs(e){return Ot.call(zr,e)?!0:Ot.call(_r,e)?!1:Ys.test(e)?zr[e]=!0:(_r[e]=!0,!1)}var Fe=!1;function x(){var e=Fe;return Fe=!1,e}function K(e,t,n){if(Vs(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,n)}}function q(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 De(e,t,n,i){if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,i)}}function xe(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ge(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function pt(e,t,n){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var r=i.get,c=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(h){n=""+h,c.call(this,h)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(h){n=""+h},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function dt(e){if(!e._valueTracker){var t=Ge(e)?"checked":"value";e._valueTracker=pt(e,t,""+e[t])}}function Lt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=Ge(e)?e.checked?"true":"false":e.value),e=i,e!==n?(t.setValue(e),!0):!1}var sl=/[\n"\\]/g;function dn(e){return e.replace(sl,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function _i(e,t,n,i,r,c,h,b){e.name="",h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"?e.type=h:e.removeAttribute("type"),t!=null?h==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+xe(t)):e.value!==""+xe(t)&&(e.value=""+xe(t)):h!=="submit"&&h!=="reset"||e.removeAttribute("value"),t!=null?h==="number"&&e.value==t?F(e,xe(e.value)):F(e,xe(t)):n!=null?F(e,xe(n)):i!=null&&e.removeAttribute("value"),r==null&&c!=null&&(e.defaultChecked=!!c),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+xe(b):e.removeAttribute("name")}function wr(e,t,n,i,r,c,h,b){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||n!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){dt(e);return}n=n!=null?""+xe(n):"",t=t!=null?""+xe(t):n,b||t===e.value||(e.value=t),e.defaultValue=t}i=i??r,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=b?e.checked:!!i,e.defaultChecked=!!i,h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.name=h),dt(e)}function F(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function ge(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&i&&(e[n].defaultSelected=!0)}else{for(n=""+xe(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,i&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function et(e,t,n){if(t!=null&&(t=""+xe(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+xe(n):""}function We(e,t,n,i){if(t==null){if(i!=null){if(n!=null)throw Error(s(92));if(fe(i)){if(1<i.length)throw Error(s(93));i=i[0]}n=i}n==null&&(n=""),t=n}n=xe(t),e.defaultValue=n,i=e.textContent,i===n&&i!==""&&i!==null&&(e.value=i),dt(e)}function Ke(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Nr=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 Gs(e,t,n){var i=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,n):typeof n!="number"||n===0||Nr.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function zi(e,t,n){if(t!=null&&typeof t!="object")throw Error(s(62));if(e=e.style,n!=null){for(var i in n)!n.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="",Fe=!0);for(var r in t)i=t[r],t.hasOwnProperty(r)&&n[r]!==i&&(Gs(e,r,i),Fe=!0)}else for(var c in t)t.hasOwnProperty(c)&&Gs(e,c,t[c])}function Qo(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 Ib=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"]]),Jb=/^[\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 Xs(e){return Jb.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function xa(){}var Fo=null;function Ko(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wi=null,Ni=null;function wh(e){var t=na(e);if(t&&(e=t.stateNode)){var n=e[an]||null;e:switch(e=t.stateNode,t.type){case"input":if(_i(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="'+dn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var r=i[an]||null;if(!r)throw Error(s(90));_i(i,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<n.length;t++)i=n[t],i.form===e.form&&Lt(i)}break e;case"textarea":et(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&ge(e,!!n.multiple,t,!1)}}}var Io=!1;function Nh(e,t,n){if(Io)return e(t,n);Io=!0;try{var i=e(t);return i}finally{if(Io=!1,(wi!==null||Ni!==null)&&(Xu(),wi&&(t=wi,e=Ni,Ni=wi=null,wh(t),e)))for(t=0;t<e.length;t++)wh(e[t])}}function Cr(e,t){var n=e.stateNode;if(n===null)return null;var i=n[an]||null;if(i===null)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(s(231,t,typeof n));return n}var Ha=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Jo=!1;if(Ha)try{var Er={};Object.defineProperty(Er,"passive",{get:function(){Jo=!0}}),window.addEventListener("test",Er,Er),window.removeEventListener("test",Er,Er)}catch{Jo=!1}var ul=null,Po=null,Qs=null;function Ch(){if(Qs)return Qs;var e,t=Po,n=t.length,i,r="value"in ul?ul.value:ul.textContent,c=r.length;for(e=0;e<n&&t[e]===r[e];e++);var h=n-e;for(i=1;i<=h&&t[n-i]===r[c-i];i++);return Qs=r.slice(e,1<i?1-i:void 0)}function Fs(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 Ks(){return!0}function Eh(){return!1}function hn(e){function t(n,i,r,c,h){this._reactName=n,this._targetInst=r,this.type=i,this.nativeEvent=c,this.target=h,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(n=e[b],this[b]=n?n(c):c[b]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Ks:Eh,this.isPropagationStopped=Eh,this}return Q(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ks)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ks)},persist:function(){},isPersistent:Ks}),t}var ol={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Is=hn(ol),Tr=Q({},ol,{view:0,detail:0}),Pb=hn(Tr),Wo,ec,Ar,Js=Q({},Tr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nc,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!==Ar&&(Ar&&e.type==="mousemove"?(Wo=e.screenX-Ar.screenX,ec=e.screenY-Ar.screenY):ec=Wo=0,Ar=e),Wo)},movementY:function(e){return"movementY"in e?e.movementY:ec}}),Th=hn(Js),Wb=Q({},Js,{dataTransfer:0}),e1=hn(Wb),t1=Q({},Tr,{relatedTarget:0}),tc=hn(t1),n1=Q({},ol,{animationName:0,elapsedTime:0,pseudoElement:0}),a1=hn(n1),l1=Q({},ol,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),i1=hn(l1),r1=Q({},ol,{data:0}),Ah=hn(r1),s1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},u1={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"},o1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function c1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=o1[e])?!!t[e]:!1}function nc(){return c1}var f1=Q({},Tr,{key:function(e){if(e.key){var t=s1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Fs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?u1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nc,charCode:function(e){return e.type==="keypress"?Fs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),d1=hn(f1),h1=Q({},Js,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Oh=hn(h1),m1=Q({},ol,{submitter:0}),p1=hn(m1),g1=Q({},Tr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nc}),v1=hn(g1),y1=Q({},ol,{propertyName:0,elapsedTime:0,pseudoElement:0}),b1=hn(y1),x1=Q({},Js,{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}),S1=hn(x1),j1=Q({},ol,{newState:0,oldState:0,source:0}),_1=hn(j1),z1=[9,13,27,32],ac=Ha&&"CompositionEvent"in window,Or=null;Ha&&"documentMode"in document&&(Or=document.documentMode);var w1=Ha&&"TextEvent"in window&&!Or,kh=Ha&&(!ac||Or&&8<Or&&11>=Or),Dh=" ",Mh=!1;function Rh(e,t){switch(e){case"keyup":return z1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Uh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ci=!1;function N1(e,t){switch(e){case"compositionend":return Uh(t);case"keypress":return t.which!==32?null:(Mh=!0,Dh);case"textInput":return e=t.data,e===Dh&&Mh?null:e;default:return null}}function C1(e,t){if(Ci)return e==="compositionend"||!ac&&Rh(e,t)?(e=Ch(),Qs=Po=ul=null,Ci=!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 kh&&t.locale!=="ko"?null:t.data;default:return null}}var E1={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 Zh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!E1[e.type]:t==="textarea"}function $h(e,t,n,i){wi?Ni?Ni.push(i):Ni=[i]:wi=i,t=Pu(t,"onChange"),0<t.length&&(n=new Is("onChange","change",null,n,i),e.push({event:n,listeners:t}))}var kr=null,Dr=null;function T1(e){wg(e,0)}function Ps(e){var t=Xl(e);if(Lt(t))return e}function Bh(e,t){if(e==="change")return t}var Hh=!1;if(Ha){var lc;if(Ha){var ic="oninput"in document;if(!ic){var Lh=document.createElement("div");Lh.setAttribute("oninput","return;"),ic=typeof Lh.oninput=="function"}lc=ic}else lc=!1;Hh=lc&&(!document.documentMode||9<document.documentMode)}function qh(){kr&&(kr.detachEvent("onpropertychange",Yh),Dr=kr=null)}function Yh(e){if(e.propertyName==="value"&&Ps(Dr)){var t=[];$h(t,Dr,e,Ko(e)),Nh(T1,t)}}function A1(e,t,n){e==="focusin"?(qh(),kr=t,Dr=n,kr.attachEvent("onpropertychange",Yh)):e==="focusout"&&qh()}function O1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ps(Dr)}function k1(e,t){if(e==="click")return Ps(t)}function D1(e,t){if(e==="input"||e==="change")return Ps(t)}function M1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var An=typeof Object.is=="function"?Object.is:M1;function Mr(e,t){if(An(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++){var r=n[i];if(!Ot.call(t,r)||!An(e[r],t[r]))return!1}return!0}function rc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Vh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Gh(e,t){var n=Vh(e);e=0;for(var i;n;){if(n.nodeType===3){if(i=e+n.textContent.length,e<=t&&i>=t)return{node:n,offset:t-e};e=i}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Vh(n)}}function Xh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Xh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=rc(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=rc(e.document)}return t}function sc(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 R1=Ha&&"documentMode"in document&&11>=document.documentMode,Ei=null,uc=null,Rr=null,oc=!1;function Fh(e,t,n){var i=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;oc||Ei==null||Ei!==rc(i)||(i=Ei,"selectionStart"in i&&sc(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Rr&&Mr(Rr,i)||(Rr=i,i=Pu(uc,"onSelect"),0<i.length&&(t=new Is("onSelect","select",null,t,n),e.push({event:t,listeners:i}),t.target=Ei)))}function Ql(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ti={animationend:Ql("Animation","AnimationEnd"),animationiteration:Ql("Animation","AnimationIteration"),animationstart:Ql("Animation","AnimationStart"),transitionrun:Ql("Transition","TransitionRun"),transitionstart:Ql("Transition","TransitionStart"),transitioncancel:Ql("Transition","TransitionCancel"),transitionend:Ql("Transition","TransitionEnd")},cc={},Kh={};Ha&&(Kh=document.createElement("div").style,"AnimationEvent"in window||(delete Ti.animationend.animation,delete Ti.animationiteration.animation,delete Ti.animationstart.animation),"TransitionEvent"in window||delete Ti.transitionend.transition);function Fl(e){if(cc[e])return cc[e];if(!Ti[e])return e;var t=Ti[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Kh)return cc[e]=t[n];return e}var Ih=Fl("animationend"),Jh=Fl("animationiteration"),Ph=Fl("animationstart"),U1=Fl("transitionrun"),Z1=Fl("transitionstart"),$1=Fl("transitioncancel"),Wh=Fl("transitionend"),em=new Map,fc="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(" ");fc.push("scrollEnd");function aa(e,t){em.set(e,t),ba(t,[e])}var B1=0;function La(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=sa.identifierPrefix;var n=B1++;return e="_"+e+"t_"+n.toString(32)+"_",t.autoName=e}function tm(e){if(e==null||typeof e=="string")return e;var t=null,n=Ki;if(n!==null)for(var i=0;i<n.length;i++){var r=e[n[i]];if(r!=null){if(r==="none")return"none";t=t==null?r:t+(" "+r)}}return t??e.default}function qa(e,t){return e=tm(e),t=tm(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var Ws=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!==null&&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)},Gn=[],Ai=0,dc=0;function eu(){for(var e=Ai,t=dc=Ai=0;t<e;){var n=Gn[t];Gn[t++]=null;var i=Gn[t];Gn[t++]=null;var r=Gn[t];Gn[t++]=null;var c=Gn[t];if(Gn[t++]=null,i!==null&&r!==null){var h=i.pending;h===null?r.next=r:(r.next=h.next,h.next=r),i.pending=r}c!==0&&nm(n,r,c)}}function tu(e,t,n,i){Gn[Ai++]=e,Gn[Ai++]=t,Gn[Ai++]=n,Gn[Ai++]=i,dc|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function hc(e,t,n,i){return tu(e,t,n,i),nu(e)}function Kl(e,t){return tu(e,null,null,t),nu(e)}function nm(e,t,n){e.lanes|=n;var i=e.alternate;i!==null&&(i.lanes|=n);for(var r=!1,c=e.return;c!==null;)c.childLanes|=n,i=c.alternate,i!==null&&(i.childLanes|=n),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(r=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,r&&t!==null&&(r=31-kt(n),e=c.hiddenUpdates,i=e[r],i===null?e[r]=[t]:i.push(t),t.lane=n|536870912),c):null}function nu(e){if(50<as)throw as=0,Gu=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Oi={};function H1(e,t,n,i){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=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _n(e,t,n,i){return new H1(e,t,n,i)}function mc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ya(e,t){var n=e.alternate;return n===null?(n=_n(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 am(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 au(e,t,n,i,r,c){var h=0;if(i=e,typeof i=="function")mc(i)&&(h=1);else if(typeof i=="string")h=mS(e,n,sn.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(i){case je:return e=_n(31,n,t,r),e.elementType=je,e.lanes=c,e;case ce:return Il(n.children,r,c,t);case Se:h=8,r|=24;break;case he:return e=_n(12,n,t,r|2),e.elementType=he,e.lanes=c,e;case U:return e=_n(13,n,t,r),e.elementType=U,e.lanes=c,e;case B:return e=_n(19,n,t,r),e.elementType=B,e.lanes=c,e;case Te:case C:return e=r|32,e=_n(30,n,t,e),e.elementType=C,e.lanes=c,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case X:h=10;break e;case le:h=9;break e;case z:h=11;break e;case se:h=14;break e;case ae:h=16,i=null;break e}h=29,n=Error(s(130,e===null?"null":typeof e,"")),i=null}return t=_n(h,n,t,r),t.elementType=e,t.type=i,t.lanes=c,t}function Il(e,t,n,i){return e=_n(7,e,i,t),e.lanes=n,e}function pc(e,t,n){return e=_n(6,e,null,t),e.lanes=n,e}function lm(e){var t=_n(18,null,null,0);return t.stateNode=e,t}function gc(e,t,n){return t=_n(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var im=new WeakMap;function Xn(e,t){if(typeof e=="object"&&e!==null){var n=im.get(e);return n!==void 0?n:(t={value:e,source:t,stack:ft(t)},im.set(e,t),t)}return{value:e,source:t,stack:ft(t)}}var ki=[],Di=0,lu=null,Ur=0,Qn=[],Fn=0,cl=null,Sa=1,ja="";function Va(e,t){ki[Di++]=Ur,ki[Di++]=lu,lu=e,Ur=t}function rm(e,t,n){Qn[Fn++]=Sa,Qn[Fn++]=ja,Qn[Fn++]=cl,cl=e;var i=Sa;e=ja;var r=32-kt(i)-1;i&=~(1<<r),n+=1;var c=32-kt(t)+r;if(30<c){var h=r-r%5;c=(i&(1<<h)-1).toString(32),i>>=h,r-=h,Sa=1<<32-kt(t)+r|n<<r|i,ja=c+e}else Sa=1<<c|n<<r|i,ja=e}function iu(e){e.return!==null&&(Va(e,1),rm(e,1,0))}function vc(e){for(;e===lu;)lu=ki[--Di],ki[Di]=null,Ur=ki[--Di],ki[Di]=null;for(;e===cl;)cl=Qn[--Fn],Qn[Fn]=null,ja=Qn[--Fn],Qn[Fn]=null,Sa=Qn[--Fn],Qn[Fn]=null}function sm(e,t){Qn[Fn++]=Sa,Qn[Fn++]=ja,Qn[Fn++]=cl,Sa=t.id,ja=t.overflow,cl=e}var qt=null,ht=null,Be=!1,fl=null,Kn=!1,yc=Error(s(519));function dl(e){var t=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Zr(Xn(t,e)),yc}function um(e){var t=e.stateNode,n=e.type,i=e.memoizedProps;switch(t[zt]=e,t[an]=i,n){case"dialog":Ye("cancel",t),Ye("close",t);break;case"iframe":case"object":case"embed":Ye("load",t);break;case"video":case"audio":for(n=0;n<is.length;n++)Ye(is[n],t);break;case"source":Ye("error",t);break;case"img":case"image":case"link":Ye("error",t),Ye("load",t);break;case"details":Ye("toggle",t);break;case"input":Ye("invalid",t),wr(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Ye("invalid",t);break;case"textarea":Ye("invalid",t),We(t,i.value,i.defaultValue,i.children)}n=i.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||i.suppressHydrationWarning===!0||Tg(t.textContent,n)?(i.popover!=null&&(Ye("beforetoggle",t),Ye("toggle",t)),i.onScroll!=null&&Ye("scroll",t),i.onScrollEnd!=null&&Ye("scrollend",t),i.onClick!=null&&(t.onclick=xa),t=!0):t=!1,t||dl(e,!0)}function ru(e){for(qt=e.return;qt;)switch(qt.tag){case 5:case 31:case 13:Kn=!1;return;case 27:case 3:Kn=!0;return;default:qt=qt.return}}function Mi(e){if(e!==qt)return!1;if(!Be)return ru(e),Be=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Kf(e.type,e.memoizedProps)),n=!n),n&&ht&&dl(e),ru(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));ht=Fg(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));ht=Fg(e)}else t===27?(t=ht,El(e.type)?(e=ld,ld=null,ht=e):ht=t):ht=qt?Jn(e.stateNode.nextSibling):null;return!0}function Jl(){ht=qt=null,Be=!1}function bc(){var e=fl;return e!==null&&(Nn===null?Nn=e:Nn.push.apply(Nn,e),fl=null),e}function Zr(e){fl===null?fl=[e]:fl.push(e)}var xc=Gt(null),Pl=null,Ga=null;function hl(e,t,n){Pe(xc,t._currentValue),t._currentValue=n}function Xa(e){e._currentValue=xc.current,xt(xc)}function su(e,t,n){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===n)break;e=e.return}}function Sc(e,t,n,i){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var c=r.dependencies;if(c!==null){var h=r.child;c=c.firstContext;e:for(;c!==null;){var b=c;c=r;for(var N=0;N<t.length;N++)if(b.context===t[N]){c.lanes|=n,b=c.alternate,b!==null&&(b.lanes|=n),su(c.return,n,e),i||(h=null);break e}c=b.next}}else if(r.tag===18){if(h=r.return,h===null)throw Error(s(341));h.lanes|=n,c=h.alternate,c!==null&&(c.lanes|=n),su(h,n,e),h=null}else r.tag===13&&r.memoizedState!==null&&r.memoizedState.dehydrated===null?(r.lanes|=n,h=r.alternate,h!==null&&(h.lanes|=n),su(r.return,n,e),h=r.child,h=h!==null?h.sibling:null):h=r.child;if(h!==null)h.return=r;else for(h=r;h!==null;){if(h===e){h=null;break}if(r=h.sibling,r!==null){r.return=h.return,h=r;break}h=h.return}r=h}}function Wl(e,t,n,i){e=null;for(var r=t,c=!1;r!==null;){if(!c){if((r.flags&524288)!==0)c=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var h=r.alternate;if(h===null)throw Error(s(387));if(h=h.memoizedProps,h!==null){var b=r.type;An(r.pendingProps.value,h.value)||(e!==null?e.push(b):e=[b])}}else if(r===Tn.current){if(h=r.alternate,h===null)throw Error(s(387));h.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(ir):e=[ir])}r=r.return}return e!==null&&Sc(t,e,n,i),t.flags|=262144,e!==null}function uu(e){for(e=e.firstContext;e!==null;){if(!An(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ei(e){Pl=e,Ga=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Xt(e){return om(Pl,e)}function ou(e,t){return Pl===null&&ei(e),om(e,t)}function om(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ga===null){if(e===null)throw Error(s(308));Ga=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ga=Ga.next=t;return n}var L1=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},q1=a.unstable_scheduleCallback,Y1=a.unstable_NormalPriority,Dt={$$typeof:X,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function jc(){return{controller:new L1,data:new Map,refCount:0}}function $r(e){e.refCount--,e.refCount===0&&q1(Y1,function(){e.controller.abort()})}function cm(e,t){if((e.pendingLanes&4194048)!==0){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var i=t[e];n.indexOf(i)===-1&&n.push(i)}}}var Br=null;function V1(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Hr=null,_c=0,ti=0,Ri=null;function G1(e,t){if(Hr===null){var n=Hr=[];_c=0,ti=Hf(),Ri={status:"pending",value:void 0,then:function(i){n.push(i)}}}return _c++,t.then(fm,fm),t}function fm(){if(--_c===0&&(Br=null,Hr!==null)){Ri!==null&&(Ri.status="fulfilled");var e=Hr;Hr=null,ti=0,Ri=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function X1(e,t){var n=[],i={status:"pending",value:null,reason:null,then:function(r){n.push(r)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var r=0;r<n.length;r++)(0,n[r])(t)},function(r){for(i.status="rejected",i.reason=r,r=0;r<n.length;r++)(0,n[r])(void 0)}),i}var dm=oe.S;oe.S=function(e,t){if(lg=Ht(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&G1(e,t),Br!==null)for(var n=Wi;n!==null;)cm(n,Br),n=n.next;if(n=e.types,n!==null){for(var i=Wi;i!==null;)cm(i,n),i=i.next;if(ti!==0){i=Br,i===null&&(i=Br=[]);for(var r=0;r<n.length;r++){var c=n[r];i.indexOf(c)===-1&&i.push(c)}}}dm!==null&&dm(e,t)};var ni=Gt(null);function zc(){var e=ni.current;return e!==null?e:ct.pooledCache}function cu(e,t){t===null?Pe(ni,ni.current):Pe(ni,t.pool)}function hm(){var e=zc();return e===null?null:{parent:Dt._currentValue,pool:e}}var Ui=Error(s(460)),wc=Error(s(474)),fu=Error(s(542)),du={then:function(){}};function mm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function pm(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(xa,xa),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,vm(e),e===void 0&&!("reason"in t)?Error(s(600)):e;default:if(typeof t.status=="string")t.then(xa,xa);else{if(e=ct,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=i}},function(i){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,vm(e),e}throw li=t,Ui}}function ai(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(li=n,Ui):n}}var li=null;function gm(){if(li===null)throw Error(s(459));var e=li;return li=null,e}function vm(e){if(e===Ui||e===fu)throw Error(s(483))}var Zi=null,Lr=0;function hu(e){var t=Lr;return Lr+=1,Zi===null&&(Zi=[]),pm(Zi,e,t)}function ml(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function mu(e,t){throw t.$$typeof===G?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function ym(e){function t(M,O){if(e){var $=M.deletions;$===null?(M.deletions=[O],M.flags|=16):$.push(O)}}function n(M,O){if(!e)return null;for(;O!==null;)t(M,O),O=O.sibling;return null}function i(M){for(var O=new Map;M!==null;)M.key===null?O.set(M.index,M):O.set(M.key,M),M=M.sibling;return O}function r(M,O){return M=Ya(M,O),M.index=0,M.sibling=null,M}function c(M,O,$){return M.index=$,e?($=M.alternate,$!==null?($=$.index,$<O?(M.flags|=2,O):$):(M.flags|=134217730,O)):(M.flags|=1048576,O)}function h(M){return e&&M.alternate===null&&(M.flags|=134217730),M}function b(M,O,$,J){return O===null||O.tag!==6?(O=pc($,M.mode,J),O.return=M,O):(O=r(O,$),O.return=M,O)}function N(M,O,$,J){var be=$.type;return be===ce?(M=L(M,O,$.props.children,J,$.key),ml(M,$),M):O!==null&&(O.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===ae&&ai(be)===O.type)?(O=r(O,$.props),ml(O,$),O.return=M,O):(O=au($.type,$.key,$.props,null,M.mode,J),ml(O,$),O.return=M,O)}function R(M,O,$,J){return O===null||O.tag!==4||O.stateNode.containerInfo!==$.containerInfo||O.stateNode.implementation!==$.implementation?(O=gc($,M.mode,J),O.return=M,O):(O=r(O,$.children||[]),O.return=M,O)}function L(M,O,$,J,be){return O===null||O.tag!==7?(O=Il($,M.mode,J,be),O.return=M,O):(O=r(O,$),O.return=M,O)}function P(M,O,$){if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return O=pc(""+O,M.mode,$),O.return=M,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case ie:return $=au(O.type,O.key,O.props,null,M.mode,$),ml($,O),$.return=M,$;case _e:return O=gc(O,M.mode,$),O.return=M,O;case ae:return O=ai(O),P(M,O,$)}if(fe(O)||re(O))return O=Il(O,M.mode,$,null),O.return=M,O;if(typeof O.then=="function")return P(M,hu(O),$);if(O.$$typeof===X)return P(M,ou(M,O),$);mu(M,O)}return null}function D(M,O,$,J){var be=O!==null?O.key:null;if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return be!==null?null:b(M,O,""+$,J);if(typeof $=="object"&&$!==null){switch($.$$typeof){case ie:return $.key===be?N(M,O,$,J):null;case _e:return $.key===be?R(M,O,$,J):null;case ae:return $=ai($),D(M,O,$,J)}if(fe($)||re($))return be!==null?null:L(M,O,$,J,null);if(typeof $.then=="function")return D(M,O,hu($),J);if($.$$typeof===X)return D(M,O,ou(M,$),J);mu(M,$)}return null}function H(M,O,$,J,be){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return M=M.get($)||null,b(O,M,""+J,be);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case ie:return M=M.get(J.key===null?$:J.key)||null,N(O,M,J,be);case _e:return M=M.get(J.key===null?$:J.key)||null,R(O,M,J,be);case ae:return J=ai(J),H(M,O,$,J,be)}if(fe(J)||re(J))return M=M.get($)||null,L(O,M,J,be,null);if(typeof J.then=="function")return H(M,O,$,hu(J),be);if(J.$$typeof===X)return H(M,O,$,ou(O,J),be);mu(O,J)}return null}function me(M,O,$,J){for(var be=null,Qe=null,Ce=O,Oe=O=0,Ut=null;Ce!==null&&Oe<$.length;Oe++){Ce.index>Oe?(Ut=Ce,Ce=null):Ut=Ce.sibling;var Ie=D(M,Ce,$[Oe],J);if(Ie===null){Ce===null&&(Ce=Ut);break}e&&Ce&&Ie.alternate===null&&t(M,Ce),O=c(Ie,O,Oe),Qe===null?be=Ie:Qe.sibling=Ie,Qe=Ie,Ce=Ut}if(Oe===$.length)return n(M,Ce),Be&&Va(M,Oe),be;if(Ce===null){for(;Oe<$.length;Oe++)Ce=P(M,$[Oe],J),Ce!==null&&(O=c(Ce,O,Oe),Qe===null?be=Ce:Qe.sibling=Ce,Qe=Ce);return Be&&Va(M,Oe),be}for(Ce=i(Ce);Oe<$.length;Oe++)Ut=H(Ce,M,Oe,$[Oe],J),Ut!==null&&(e&&(Ie=Ut.alternate,Ie!==null&&Ce.delete(Ie.key===null?Oe:Ie.key)),O=c(Ut,O,Oe),Qe===null?be=Ut:Qe.sibling=Ut,Qe=Ut);return e&&Ce.forEach(function(Dl){return t(M,Dl)}),Be&&Va(M,Oe),be}function we(M,O,$,J){if($==null)throw Error(s(151));for(var be=null,Qe=null,Ce=O,Oe=O=0,Ut=null,Ie=$.next();Ce!==null&&!Ie.done;Oe++,Ie=$.next()){Ce.index>Oe?(Ut=Ce,Ce=null):Ut=Ce.sibling;var Dl=D(M,Ce,Ie.value,J);if(Dl===null){Ce===null&&(Ce=Ut);break}e&&Ce&&Dl.alternate===null&&t(M,Ce),O=c(Dl,O,Oe),Qe===null?be=Dl:Qe.sibling=Dl,Qe=Dl,Ce=Ut}if(Ie.done)return n(M,Ce),Be&&Va(M,Oe),be;if(Ce===null){for(;!Ie.done;Oe++,Ie=$.next())Ie=P(M,Ie.value,J),Ie!==null&&(O=c(Ie,O,Oe),Qe===null?be=Ie:Qe.sibling=Ie,Qe=Ie);return Be&&Va(M,Oe),be}for(Ce=i(Ce);!Ie.done;Oe++,Ie=$.next())Ie=H(Ce,M,Oe,Ie.value,J),Ie!==null&&(e&&(Ut=Ie.alternate,Ut!==null&&Ce.delete(Ut.key===null?Oe:Ut.key)),O=c(Ie,O,Oe),Qe===null?be=Ie:Qe.sibling=Ie,Qe=Ie);return e&&Ce.forEach(function(NS){return t(M,NS)}),Be&&Va(M,Oe),be}function $e(M,O,$,J){if(typeof $=="object"&&$!==null&&$.type===ce&&$.key===null&&$.props.ref===void 0&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case ie:e:{for(var be=$.key;O!==null;){if(O.key===be){if(be=$.type,be===ce){if(O.tag===7){n(M,O.sibling),J=r(O,$.props.children),ml(J,$),J.return=M,M=J;break e}}else if(O.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===ae&&ai(be)===O.type){n(M,O.sibling),J=r(O,$.props),ml(J,$),J.return=M,M=J;break e}n(M,O);break}else t(M,O);O=O.sibling}$.type===ce?(J=Il($.props.children,M.mode,J,$.key),ml(J,$),J.return=M,M=J):(J=au($.type,$.key,$.props,null,M.mode,J),ml(J,$),J.return=M,M=J)}return h(M);case _e:e:{for(be=$.key;O!==null;){if(O.key===be)if(O.tag===4&&O.stateNode.containerInfo===$.containerInfo&&O.stateNode.implementation===$.implementation){n(M,O.sibling),J=r(O,$.children||[]),J.return=M,M=J;break e}else{n(M,O);break}else t(M,O);O=O.sibling}J=gc($,M.mode,J),J.return=M,M=J}return h(M);case ae:return $=ai($),$e(M,O,$,J)}if(fe($))return me(M,O,$,J);if(re($)){if(be=re($),typeof be!="function")throw Error(s(150));return $=be.call($),we(M,O,$,J)}if(typeof $.then=="function")return $e(M,O,hu($),J);if($.$$typeof===X)return $e(M,O,ou(M,$),J);mu(M,$)}return typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint"?($=""+$,O!==null&&O.tag===6?(n(M,O.sibling),J=r(O,$),J.return=M,M=J):(n(M,O),J=pc($,M.mode,J),J.return=M,M=J),h(M)):n(M,O)}return function(M,O,$,J){try{Lr=0;var be=$e(M,O,$,J);return Zi=null,be}catch(Ce){if(Ce===Ui||Ce===fu)throw Ce;var Qe=_n(29,Ce,null,M.mode);return Qe.lanes=J,Qe.return=M,Qe}finally{}}}var ii=ym(!0),bm=ym(!1),pl=!1;function Nc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Cc(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 gl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vl(e,t,n){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(tt&2)!==0){var r=i.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),i.pending=t,t=nu(e),nm(e,null,n),t}return tu(e,i,t,n),nu(e)}function qr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,jn(e,n)}}function Ec(e,t){var n=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,n===i)){var r=null,c=null;if(n=n.firstBaseUpdate,n!==null){do{var h={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};c===null?r=c=h:c=c.next=h,n=n.next}while(n!==null);c===null?r=c=t:c=c.next=t}else r=c=t;n={baseState:i.baseState,firstBaseUpdate:r,lastBaseUpdate:c,shared:i.shared,callbacks:i.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Tc=!1;function Yr(){if(Tc){var e=Ri;if(e!==null)throw e}}function Vr(e,t,n,i){Tc=!1;var r=e.updateQueue;pl=!1;var c=r.firstBaseUpdate,h=r.lastBaseUpdate,b=r.shared.pending;if(b!==null){r.shared.pending=null;var N=b,R=N.next;N.next=null,h===null?c=R:h.next=R,h=N;var L=e.alternate;L!==null&&(L=L.updateQueue,b=L.lastBaseUpdate,b!==h&&(b===null?L.firstBaseUpdate=R:b.next=R,L.lastBaseUpdate=N))}if(c!==null){var P=r.baseState;h=0,L=R=N=null,b=c;do{var D=b.lane&-536870913,H=D!==b.lane;if(H?(Xe&D)===D:(i&D)===D){D!==0&&D===ti&&(Tc=!0),L!==null&&(L=L.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var me=e,we=b;D=t;var $e=n;switch(we.tag){case 1:if(me=we.payload,typeof me=="function"){P=me.call($e,P,D);break e}P=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=we.payload,D=typeof me=="function"?me.call($e,P,D):me,D==null)break e;P=Q({},P,D);break e;case 2:pl=!0}}D=b.callback,D!==null&&(e.flags|=64,H&&(e.flags|=8192),H=r.callbacks,H===null?r.callbacks=[D]:H.push(D))}else H={lane:D,tag:b.tag,payload:b.payload,callback:b.callback,next:null},L===null?(R=L=H,N=P):L=L.next=H,h|=D;if(b=b.next,b===null){if(b=r.shared.pending,b===null)break;H=b,b=H.next,H.next=null,r.lastBaseUpdate=H,r.shared.pending=null}}while(!0);L===null&&(N=P),r.baseState=N,r.firstBaseUpdate=R,r.lastBaseUpdate=L,c===null&&(r.shared.lanes=0),zl|=h,e.lanes=h,e.memoizedState=P}}function xm(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function Sm(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)xm(n[e],t)}var yl=Gt(null),pu=Gt(0);function jm(e,t){e=Ja,Pe(pu,e),Pe(yl,t),Ja=e|t.baseLanes}function Ac(){Pe(pu,Ja),Pe(yl,yl.current)}function Oc(){Ja=pu.current,xt(yl),xt(pu)}var Qt=Gt(null),rn=null;function bl(e){var t=e.alternate;Pe(Ft,Ft.current&1),Pe(Qt,e),rn===null&&(t===null||yl.current!==null||t.memoizedState!==null)&&(rn=e)}function kc(e){Pe(Ft,Ft.current),Pe(Qt,e),rn===null&&(rn=e)}function _m(e){e.tag===22?(Pe(Ft,Ft.current),Pe(Qt,e),rn===null&&(rn=e)):xl()}function xl(){Pe(Ft,Ft.current),Pe(Qt,Qt.current)}function On(e){xt(Qt),rn===e&&(rn=null),xt(Ft)}var Ft=Gt(0);function Gr(e,t){Pe(Qt,Qt.current),Pe(Ft,t)}function Dc(e){xt(Ft),xt(Qt),rn===e&&(rn=null)}function gu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||nd(n)||ad(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){if((t.flags&128)!==0)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 Qa=0,Ze=null,ut=null,Mt=null,vu=!1,$i=!1,ri=!1,yu=0,Xr=0,Bi=null,Q1=0;function wt(){throw Error(s(321))}function Mc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!An(e[n],t[n]))return!1;return!0}function Rc(e,t,n,i,r,c){return Qa=c,Ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,oe.H=e===null||e.memoizedState===null?rp:sp,ri=!1,c=n(i,r),ri=!1,$i&&(c=wm(t,n,i,r)),zm(e),c}function zm(e){oe.H=wu;var t=ut!==null&&ut.next!==null;if(Qa=0,Mt=ut=Ze=null,vu=!1,Xr=0,Bi=null,t)throw Error(s(300));e===null||Rt||(e=e.dependencies,e!==null&&uu(e)&&(Rt=!0))}function wm(e,t,n,i){Ze=e;var r=0;do{if($i&&(Bi=null),Xr=0,$i=!1,25<=r)throw Error(s(301));if(r+=1,Mt=ut=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}oe.H=tx,c=t(n,i)}while($i);return c}function F1(){var e=oe.H,t=e.useState()[0];return t=typeof t.then=="function"?Qr(t):t,e=e.useState()[0],(ut!==null?ut.memoizedState:null)!==e&&(Ze.flags|=1024),t}function Uc(){var e=yu!==0;return yu=0,e}function Zc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function $c(e){if(vu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}vu=!1}Qa=0,Mt=ut=Ze=null,$i=!1,Xr=yu=0,Bi=null}function mn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?Ze.memoizedState=Mt=e:Mt=Mt.next=e,Mt}function At(){if(ut===null){var e=Ze.alternate;e=e!==null?e.memoizedState:null}else e=ut.next;var t=Mt===null?Ze.memoizedState:Mt.next;if(t!==null)Mt=t,ut=e;else{if(e===null)throw Ze.alternate===null?Error(s(467)):Error(s(310));ut=e,e={memoizedState:ut.memoizedState,baseState:ut.baseState,baseQueue:ut.baseQueue,queue:ut.queue,next:null},Mt===null?Ze.memoizedState=Mt=e:Mt=Mt.next=e}return Mt}function bu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Qr(e){var t=Xr;return Xr+=1,Bi===null&&(Bi=[]),e=pm(Bi,e,t),t=Ze,(Mt===null?t.memoizedState:Mt.next)===null&&(t=t.alternate,oe.H=t===null||t.memoizedState===null?rp:sp),e}function xu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Qr(e);if(e.$$typeof===V)return;if(e.$$typeof===X)return Xt(e)}throw Error(s(438,String(e)))}function Bc(e){var t=null,n=Ze.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var i=Ze.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=bu(),Ze.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),i=0;i<e;i++)n[i]=ke;return t.index++,n}function Fa(e,t){return typeof t=="function"?t(e):t}function Su(e){var t=At();return Hc(t,ut,e)}function Hc(e,t,n){var i=e.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=n;var r=e.baseQueue,c=i.pending;if(c!==null){if(r!==null){var h=r.next;r.next=c.next,c.next=h}t.baseQueue=r=c,i.pending=null}if(c=e.baseState,r===null)e.memoizedState=c;else{t=r.next;var b=h=null,N=null,R=t,L=!1;do{var P=R.lane&-536870913;if(P!==R.lane?(Xe&P)===P:(Qa&P)===P){var D=R.revertLane;if(D===0)N!==null&&(N=N.next={lane:0,revertLane:0,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null}),P===ti&&(L=!0);else if((Qa&D)===D){R=R.next,D===ti&&(L=!0);continue}else P={lane:0,revertLane:R.revertLane,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},N===null?(b=N=P,h=c):N=N.next=P,Ze.lanes|=D,zl|=D;P=R.action,ri&&n(c,P),c=R.hasEagerState?R.eagerState:n(c,P)}else D={lane:P,revertLane:R.revertLane,gesture:R.gesture,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},N===null?(b=N=D,h=c):N=N.next=D,Ze.lanes|=P,zl|=P;R=R.next}while(R!==null&&R!==t);if(N===null?h=c:N.next=b,!An(c,e.memoizedState)&&(Rt=!0,L&&(n=Ri,n!==null)))throw n;e.memoizedState=c,e.baseState=h,e.baseQueue=N,i.lastRenderedState=c}return r===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Lc(e){var t=At(),n=t.queue;if(n===null)throw Error(s(311));n.lastRenderedReducer=e;var i=n.dispatch,r=n.pending,c=t.memoizedState;if(r!==null){n.pending=null;var h=r=r.next;do c=e(c,h.action),h=h.next;while(h!==r);An(c,t.memoizedState)||(Rt=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),n.lastRenderedState=c}return[c,i]}function Nm(e,t,n){var i=Ze,r=At(),c=Be;if(c){if(n===void 0)throw Error(s(407));n=n()}else n=t();var h=!An((ut||r).memoizedState,n);if(h&&(r.memoizedState=n,Rt=!0),r=r.queue,Vc(Tm.bind(null,i,r,e),[e]),e=r.getSnapshot!==t||h||Mt!==null&&(Mt.memoizedState.tag&1)!==0,Hi(e?9:8,{destroy:void 0},Em.bind(null,i,r,n,t),null),e){if(i.flags|=2048,ct===null)throw Error(s(349));c||(Qa&127)!==0||Cm(i,t,n)}return n}function Cm(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ze.updateQueue,t===null?(t=bu(),Ze.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Em(e,t,n,i){t.value=n,t.getSnapshot=i,Am(t)&&Om(e)}function Tm(e,t,n){return n(function(){Am(t)&&Om(e)})}function Am(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!An(e,n)}catch{return!0}}function Om(e){var t=Kl(e,2);t!==null&&Cn(t,e,2)}function qc(e){var t=mn();if(typeof e=="function"){var n=e;if(e=n(),ri){on(!0);try{n()}finally{on(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fa,lastRenderedState:e},t}function km(e,t,n,i){return e.baseState=n,Hc(e,ut,typeof i=="function"?i:Fa)}function K1(e,t,n,i,r){if(zu(e))throw Error(s(485));if(e=t.action,e!==null){var c={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(h){c.listeners.push(h)}};oe.T!==null?n(!0):c.isTransition=!1,i(c),n=t.pending,n===null?(c.next=t.pending=c,Dm(t,c)):(c.next=n.next,t.pending=n.next=c)}}function Dm(e,t){var n=t.action,i=t.payload,r=e.state;if(t.isTransition){var c=oe.T,h={};h.types=c!==null?c.types:null,oe.T=h;try{var b=n(r,i),N=oe.S;N!==null&&N(h,b),Mm(e,t,b)}catch(R){Yc(e,t,R)}finally{c!==null&&h.types!==null&&(c.types=h.types),oe.T=c}}else try{c=n(r,i),Mm(e,t,c)}catch(R){Yc(e,t,R)}}function Mm(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(i){Rm(e,t,i)},function(i){return Yc(e,t,i)}):Rm(e,t,n)}function Rm(e,t,n){t.status="fulfilled",t.value=n,Um(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Dm(e,n)))}function Yc(e,t,n){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=n,Um(t),t=t.next;while(t!==i)}e.action=null}function Um(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zm(e,t){return t}function $m(e,t){if(Be){var n=ct.formState;if(n!==null){e:{var i=Ze;if(Be){if(ht){t:{for(var r=ht,c=Kn;r.nodeType!==8;){if(!c){r=null;break t}if(r=Jn(r.nextSibling),r===null){r=null;break t}}c=r.data,r=c==="F!"||c==="F"?r:null}if(r){ht=Jn(r.nextSibling),i=r.data==="F!";break e}}dl(i)}i=!1}i&&(t=n[0])}}return n=mn(),n.memoizedState=n.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zm,lastRenderedState:t},n.queue=i,n=ap.bind(null,Ze,i),i.dispatch=n,i=qc(!1),c=Kc.bind(null,Ze,!1,i.queue),i=mn(),r={state:t,dispatch:null,action:e,pending:null},i.queue=r,n=K1.bind(null,Ze,r,c,n),r.dispatch=n,i.memoizedState=e,[t,n,!1]}function Bm(e){var t=At();return Hm(t,ut,e)}function Hm(e,t,n){if(t=Hc(e,t,Zm)[0],e=Su(Fa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=Qr(t)}catch(h){throw h===Ui?fu:h}else i=t;t=At();var r=t.queue,c=r.dispatch;return n!==t.memoizedState&&(Ze.flags|=2048,Hi(9,{destroy:void 0},I1.bind(null,r,n),null)),[i,c,e]}function I1(e,t){e.action=t}function Lm(e){var t=At(),n=ut;if(n!==null)return Hm(t,n,e);At(),t=t.memoizedState,n=At();var i=n.queue.dispatch;return n.memoizedState=e,[t,i,!1]}function Hi(e,t,n,i){return e={tag:e,create:n,deps:i,inst:t,next:null},t=Ze.updateQueue,t===null&&(t=bu(),Ze.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function qm(){return At().memoizedState}function ju(e,t,n,i){var r=mn();Ze.flags|=e,r.memoizedState=Hi(1|t,{destroy:void 0},n,i===void 0?null:i)}function _u(e,t,n,i){var r=At();i=i===void 0?null:i;var c=r.memoizedState.inst;ut!==null&&i!==null&&Mc(i,ut.memoizedState.deps)?r.memoizedState=Hi(t,c,n,i):(Ze.flags|=e,r.memoizedState=Hi(1|t,c,n,i))}function Ym(e,t){ju(8390656,8,e,t)}function Vc(e,t){_u(2048,8,e,t)}function J1(e){Ze.flags|=4;var t=Ze.updateQueue;if(t===null)t=bu(),Ze.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Vm(e){var t=At().memoizedState;return J1({ref:t,nextImpl:e}),function(){if((tt&2)!==0)throw Error(s(440));return t.impl.apply(void 0,arguments)}}function Gm(e,t){return _u(4,2,e,t)}function Xm(e,t){return _u(4,4,e,t)}function Qm(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 Fm(e,t,n){n=n!=null?n.concat([e]):null,_u(4,4,Qm.bind(null,t,e),n)}function Gc(){}function Km(e,t){var n=At();t=t===void 0?null:t;var i=n.memoizedState;return t!==null&&Mc(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function Im(e,t){var n=At();t=t===void 0?null:t;var i=n.memoizedState;if(t!==null&&Mc(t,i[1]))return i[0];if(i=e(),ri){on(!0);try{e()}finally{on(!1)}}return n.memoizedState=[i,t],i}function Xc(e,t,n){return n===void 0||(Qa&1073741824)!==0&&(Xe&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=rg(),Ze.lanes|=e,zl|=e,n)}function Jm(e,t,n,i){return An(n,t)?n:yl.current!==null?(e=Xc(e,n,i),An(e,t)||(Rt=!0),e):(Qa&106)===0||(Qa&1073741824)!==0&&(Xe&261930)===0?(Rt=!0,e.memoizedState=n):(e=rg(),Ze.lanes|=e,zl|=e,t)}function Pm(e,t,n,i,r){var c=pe.p;pe.p=c!==0&&8>c?c:8;var h=oe.T,b={};b.types=h!==null?h.types:null,oe.T=b,Kc(e,!1,t,n);try{var N=r(),R=oe.S;if(R!==null&&R(b,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var L=X1(N,i);Fr(e,t,L,Rn(e))}else Fr(e,t,i,Rn(e))}catch(P){Fr(e,t,{then:function(){},status:"rejected",reason:P},Rn())}finally{pe.p=c,h!==null&&b.types!==null&&(h.types=b.types),oe.T=h}}function P1(){}function Qc(e,t,n,i){if(e.tag!==5)throw Error(s(476));var r=Wm(e).queue;Pm(e,r,t,He,n===null?P1:function(){return ep(e),n(i)})}function Wm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:He,baseState:He,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fa,lastRenderedState:He},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fa,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ep(e){var t=Wm(e);t.next===null&&(t=e.alternate.memoizedState),Fr(e,t.next.queue,{},Rn())}function Fc(){return Xt(ir)}function tp(){return At().memoizedState}function np(){return At().memoizedState}function W1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Rn();e=gl(n);var i=vl(t,e,n);i!==null&&(Cn(i,t,n),qr(i,t,n)),t={cache:jc()},e.payload=t;return}t=t.return}}function ex(e,t,n){var i=Rn();n={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},zu(e)?lp(t,n):(n=hc(e,t,n,i),n!==null&&(Cn(n,e,i),ip(n,t,i)))}function ap(e,t,n){var i=Rn();Fr(e,t,n,i)}function Fr(e,t,n,i){var r={lane:i,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(zu(e))lp(t,r);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var h=t.lastRenderedState,b=c(h,n);if(r.hasEagerState=!0,r.eagerState=b,An(b,h))return tu(e,t,r,0),ct===null&&eu(),!1}catch{}finally{}if(n=hc(e,t,r,i),n!==null)return Cn(n,e,i),ip(n,t,i),!0}return!1}function Kc(e,t,n,i){if(i={lane:2,revertLane:Hf(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},zu(e)){if(t)throw Error(s(479))}else t=hc(e,n,i,2),t!==null&&Cn(t,e,2)}function zu(e){var t=e.alternate;return e===Ze||t!==null&&t===Ze}function lp(e,t){$i=vu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ip(e,t,n){if((n&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,n|=i,t.lanes=n,jn(e,n)}}var wu={readContext:Xt,use:xu,useCallback:wt,useContext:wt,useEffect:wt,useImperativeHandle:wt,useLayoutEffect:wt,useInsertionEffect:wt,useMemo:wt,useReducer:wt,useRef:wt,useState:wt,useDebugValue:wt,useDeferredValue:wt,useTransition:wt,useSyncExternalStore:wt,useId:wt,useHostTransitionStatus:wt,useFormState:wt,useActionState:wt,useOptimistic:wt,useMemoCache:wt,useCacheRefresh:wt,useEffectEvent:wt},rp={readContext:Xt,use:xu,useCallback:function(e,t){return mn().memoizedState=[e,t===void 0?null:t],e},useContext:Xt,useEffect:Ym,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,ju(4194308,4,Qm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ju(4194308,4,e,t)},useInsertionEffect:function(e,t){ju(4,2,e,t)},useMemo:function(e,t){var n=mn();t=t===void 0?null:t;var i=e();if(ri){on(!0);try{e()}finally{on(!1)}}return n.memoizedState=[i,t],i},useReducer:function(e,t,n){var i=mn();if(n!==void 0){var r=n(t);if(ri){on(!0);try{n(t)}finally{on(!1)}}}else r=t;return i.memoizedState=i.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},i.queue=e,e=e.dispatch=ex.bind(null,Ze,e),[i.memoizedState,e]},useRef:function(e){var t=mn();return e={current:e},t.memoizedState=e},useState:function(e){e=qc(e);var t=e.queue,n=ap.bind(null,Ze,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Gc,useDeferredValue:function(e,t){var n=mn();return Xc(n,e,t)},useTransition:function(){var e=qc(!1);return e=Pm.bind(null,Ze,e.queue,!0,!1),mn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var i=Ze,r=mn();if(Be){if(n===void 0)throw Error(s(407));n=n()}else{if(n=t(),ct===null)throw Error(s(349));(Xe&127)!==0||Cm(i,t,n)}r.memoizedState=n;var c={value:n,getSnapshot:t};return r.queue=c,Ym(Tm.bind(null,i,c,e),[e]),i.flags|=2048,Hi(9,{destroy:void 0},Em.bind(null,i,c,n,t),null),n},useId:function(){var e=mn(),t=ct.identifierPrefix;if(Be){var n=ja,i=Sa;n=(i&~(1<<32-kt(i)-1)).toString(32)+n,t="_"+t+"R_"+n,n=yu++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=Q1++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Fc,useFormState:$m,useActionState:$m,useOptimistic:function(e){var t=mn();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Kc.bind(null,Ze,!0,n),n.dispatch=t,[e,t]},useMemoCache:Bc,useCacheRefresh:function(){return mn().memoizedState=W1.bind(null,Ze)},useEffectEvent:function(e){var t=mn(),n={impl:e};return t.memoizedState=n,function(){if((tt&2)!==0)throw Error(s(440));return n.impl.apply(void 0,arguments)}}},sp={readContext:Xt,use:xu,useCallback:Km,useContext:Xt,useEffect:Vc,useImperativeHandle:Fm,useInsertionEffect:Gm,useLayoutEffect:Xm,useMemo:Im,useReducer:Su,useRef:qm,useState:function(){return Su(Fa)},useDebugValue:Gc,useDeferredValue:function(e,t){var n=At();return Jm(n,ut.memoizedState,e,t)},useTransition:function(){var e=Su(Fa)[0],t=At().memoizedState;return[typeof e=="boolean"?e:Qr(e),t]},useSyncExternalStore:Nm,useId:tp,useHostTransitionStatus:Fc,useFormState:Bm,useActionState:Bm,useOptimistic:function(e,t){var n=At();return km(n,ut,e,t)},useMemoCache:Bc,useCacheRefresh:np,useEffectEvent:Vm},tx={readContext:Xt,use:xu,useCallback:Km,useContext:Xt,useEffect:Vc,useImperativeHandle:Fm,useInsertionEffect:Gm,useLayoutEffect:Xm,useMemo:Im,useReducer:Lc,useRef:qm,useState:function(){return Lc(Fa)},useDebugValue:Gc,useDeferredValue:function(e,t){var n=At();return ut===null?Xc(n,e,t):Jm(n,ut.memoizedState,e,t)},useTransition:function(){var e=Lc(Fa)[0],t=At().memoizedState;return[typeof e=="boolean"?e:Qr(e),t]},useSyncExternalStore:Nm,useId:tp,useHostTransitionStatus:Fc,useFormState:Lm,useActionState:Lm,useOptimistic:function(e,t){var n=At();return ut!==null?km(n,ut,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Bc,useCacheRefresh:np,useEffectEvent:Vm};function Ic(e,t,n,i){t=e.memoizedState,n=n(i,t),n=n==null?t:Q({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Jc={enqueueSetState:function(e,t,n){e=e._reactInternals;var i=Rn(),r=gl(i);r.payload=t,n!=null&&(r.callback=n),t=vl(e,r,i),t!==null&&(Cn(t,e,i),qr(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var i=Rn(),r=gl(i);r.tag=1,r.payload=t,n!=null&&(r.callback=n),t=vl(e,r,i),t!==null&&(Cn(t,e,i),qr(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Rn(),i=gl(n);i.tag=2,t!=null&&(i.callback=t),t=vl(e,i,n),t!==null&&(Cn(t,e,n),qr(t,e,n))}};function up(e,t,n,i,r,c,h){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,c,h):t.prototype&&t.prototype.isPureReactComponent?!Mr(n,i)||!Mr(r,c):!0}function op(e,t,n,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&Jc.enqueueReplaceState(t,t.state,null)}function si(e,t){var n=t;if("ref"in t){n={};for(var i in t)i!=="ref"&&(n[i]=t[i])}if(e=e.defaultProps){n===t&&(n=Q({},n));for(var r in e)n[r]===void 0&&(n[r]=e[r])}return n}function cp(e){Ws(e)}function fp(e){console.error(e)}function dp(e){Ws(e)}function Nu(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function hp(e,t,n){try{var i=e.onCaughtError;i(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Pc(e,t,n){return n=gl(n),n.tag=3,n.payload={element:null},n.callback=function(){Nu(e,t)},n}function mp(e){return e=gl(e),e.tag=3,e}function pp(e,t,n,i){var r=n.type.getDerivedStateFromError;if(typeof r=="function"){var c=i.value;e.payload=function(){return r(c)},e.callback=function(){hp(t,n,i)}}var h=n.stateNode;h!==null&&typeof h.componentDidCatch=="function"&&(e.callback=function(){hp(t,n,i),typeof r!="function"&&(wl===null?wl=new Set([this]):wl.add(this));var b=i.stack;this.componentDidCatch(i.value,{componentStack:b!==null?b:""})})}function nx(e,t,n,i,r){if(n.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=n.alternate,t!==null&&Wl(t,n,r,!0),n=Qt.current,n!==null){switch(n.tag){case 31:case 13:case 19:return rn===null?Qu():n.alternate===null&&Nt===0&&(Nt=3),n.flags&=-257,n.flags|=65536,n.lanes=r,i===du?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([i]):t.add(i),Zf(e,i,r)),!1;case 22:return n.flags|=65536,i===du?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([i]):n.add(i)),Zf(e,i,r)),!1}throw Error(s(435,n.tag))}return Zf(e,i,r),Qu(),!1}if(Be)return t=Qt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,i!==yc&&(e=Error(s(422),{cause:i}),Zr(Xn(e,n)))):(i!==yc&&(t=Error(s(423),{cause:i}),Zr(Xn(t,n))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,i=Xn(i,n),r=Pc(e.stateNode,i,r),Ec(e,r),Nt!==4&&(Nt=2)),!1;var c=Error(s(520),{cause:i});if(c=Xn(c,n),ns===null?ns=[c]:ns.push(c),Nt!==4&&(Nt=2),t===null)return!0;i=Xn(i,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=r&-r,n.lanes|=e,e=Pc(n.stateNode,i,e),Ec(n,e),!1;case 1:if(t=n.type,c=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(wl===null||!wl.has(c))))return n.flags|=65536,r&=-r,n.lanes|=r,r=mp(r),pp(r,e,n,i),Ec(n,r),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Wc=Error(s(461)),Rt=!1;function Bt(e,t,n,i){t.child=e===null?bm(t,null,n,i):ii(t,e.child,n,i)}function gp(e,t,n,i,r){n=n.render;var c=t.ref;if("ref"in i){var h={};for(var b in i)b!=="ref"&&(h[b]=i[b])}else h=i;return ei(t),i=Rc(e,t,n,h,c,r),b=Uc(),e!==null&&!Rt?(Zc(e,t,r),Ka(e,t,r)):(Be&&b&&iu(t),t.flags|=1,Bt(e,t,i,r),t.child)}function vp(e,t,n,i,r){if(e===null){var c=n.type;return typeof c=="function"&&!mc(c)&&c.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=c,yp(e,t,c,i,r)):(e=au(n.type,null,i,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!uf(e,r)){var h=c.memoizedProps;if(n=n.compare,n=n!==null?n:Mr,n(h,i)&&e.ref===t.ref)return Ka(e,t,r)}return t.flags|=1,e=Ya(c,i),e.ref=t.ref,e.return=t,t.child=e}function yp(e,t,n,i,r){if(e!==null){var c=e.memoizedProps;if(Mr(c,i)&&e.ref===t.ref)if(Rt=!1,t.pendingProps=i=c,uf(e,r))(e.flags&131072)!==0&&(Rt=!0);else return t.lanes=e.lanes,Ka(e,t,r)}return ef(e,t,n,i,r)}function bp(e,t,n,i){var r=i.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|n:n,e!==null){for(i=t.child=e.child,r=0;i!==null;)r=r|i.lanes|i.childLanes,i=i.sibling;i=r&~c}else i=0,t.child=null;return xp(e,t,c,n,i)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&cu(t,c!==null?c.cachePool:null),c!==null?jm(t,c):Ac(),_m(t);else return i=t.lanes=536870912,xp(e,t,c!==null?c.baseLanes|n:n,n,i)}else c!==null?(cu(t,c.cachePool),jm(t,c),xl(),t.memoizedState=null):(e!==null&&cu(t,null),Ac(),xl());return Bt(e,t,r,n),t.child}function Kr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function xp(e,t,n,i,r){var c=zc();return c=c===null?null:{parent:Dt._currentValue,pool:c},t.memoizedState={baseLanes:n,cachePool:c},e!==null&&cu(t,null),Ac(),_m(t),e!==null&&Wl(e,t,i,!0),t.childLanes=r,null}function Cu(e,t){return t=Eu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Sp(e,t,n){return ii(t,e.child,null,n),e=Cu(t,t.pendingProps),e.flags|=2,On(t),t.memoizedState=null,e}function ax(e,t,n){var i=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Be){if(i.mode==="hidden")return e=Cu(t,i),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Kr(null,e);if(kc(t),(e=ht)?(e=Qg(e,Kn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:cl!==null?{id:Sa,overflow:ja}:null,retryLane:536870912,hydrationErrors:null},n=lm(e),n.return=t,t.child=n,qt=t,ht=null)):e=null,e===null)throw dl(t);return t.lanes=536870912,null}return Cu(t,i)}var c=e.memoizedState;if(c!==null){var h=c.dehydrated;if(kc(t),r)if(t.flags&256)t.flags&=-257,t=Sp(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(s(558));else if(Rt||Wl(e,t,n,!1),r=(n&e.childLanes)!==0,Rt||r){if(yl.current===null){if(i=ct,i!==null&&(h=Bs(i,n),h!==0&&h!==c.retryLane))throw c.retryLane=h,Kl(e,h),Cn(i,e,h),Wc;Qu()}t=Sp(e,t,n)}else e=c.treeContext,ht=Jn(h.nextSibling),qt=t,Be=!0,fl=null,Kn=!1,e!==null&&sm(t,e),t=Cu(t,i),t.flags|=134221824;return t}return e=Ya(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Li(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(s(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function ef(e,t,n,i,r){return ei(t),n=Rc(e,t,n,i,void 0,r),i=Uc(),e!==null&&!Rt?(Zc(e,t,r),Ka(e,t,r)):(Be&&i&&iu(t),t.flags|=1,Bt(e,t,n,r),t.child)}function jp(e,t,n,i,r,c){return ei(t),t.updateQueue=null,n=wm(t,i,n,r),zm(e),i=Uc(),e!==null&&!Rt?(Zc(e,t,c),Ka(e,t,c)):(Be&&i&&iu(t),t.flags|=1,Bt(e,t,n,c),t.child)}function _p(e,t,n,i,r){if(ei(t),t.stateNode===null){var c=Oi,h=n.contextType;typeof h=="object"&&h!==null&&(c=Xt(h)),c=new n(i,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Jc,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=i,c.state=t.memoizedState,c.refs={},Nc(t),h=n.contextType,c.context=typeof h=="object"&&h!==null?Xt(h):Oi,c.state=t.memoizedState,h=n.getDerivedStateFromProps,typeof h=="function"&&(Ic(t,n,h,i),c.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(h=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),h!==c.state&&Jc.enqueueReplaceState(c,c.state,null),Vr(t,i,c,r),Yr(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){c=t.stateNode;var b=t.memoizedProps,N=si(n,b);c.props=N;var R=c.context,L=n.contextType;h=Oi,typeof L=="object"&&L!==null&&(h=Xt(L));var P=n.getDerivedStateFromProps;L=typeof P=="function"||typeof c.getSnapshotBeforeUpdate=="function",b=t.pendingProps!==b,L||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(b||R!==h)&&op(t,c,i,h),pl=!1;var D=t.memoizedState;c.state=D,Vr(t,i,c,r),Yr(),R=t.memoizedState,b||D!==R||pl?(typeof P=="function"&&(Ic(t,n,P,i),R=t.memoizedState),(N=pl||up(t,n,N,i,D,R,h))?(L||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=R),c.props=i,c.state=R,c.context=h,i=N):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{c=t.stateNode,Cc(e,t),h=t.memoizedProps,L=si(n,h),c.props=L,P=t.pendingProps,D=c.context,R=n.contextType,N=Oi,typeof R=="object"&&R!==null&&(N=Xt(R)),b=n.getDerivedStateFromProps,(R=typeof b=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(h!==P||D!==N)&&op(t,c,i,N),pl=!1,D=t.memoizedState,c.state=D,Vr(t,i,c,r),Yr();var H=t.memoizedState;h!==P||D!==H||pl||e!==null&&e.dependencies!==null&&uu(e.dependencies)?(typeof b=="function"&&(Ic(t,n,b,i),H=t.memoizedState),(L=pl||up(t,n,L,i,D,H,N)||e!==null&&e.dependencies!==null&&uu(e.dependencies))?(R||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(i,H,N),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(i,H,N)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=H),c.props=i,c.state=H,c.context=N,i=L):(typeof c.componentDidUpdate!="function"||h===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||h===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),i=!1)}return c=i,Li(e,t),i=(t.flags&128)!==0,c||i?(c=t.stateNode,n=i&&typeof n.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&i?(t.child=ii(t,e.child,null,r),t.child=ii(t,null,n,r)):Bt(e,t,n,r),t.memoizedState=c.state,e=t.child):e=Ka(e,t,r),e}function zp(e,t,n,i){return Jl(),t.flags|=256,Bt(e,t,n,i),t.child}var tf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function nf(e){return{baseLanes:e,cachePool:hm()}}function af(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Mn),e}function wp(e,t,n){var i=t.pendingProps,r=!1,c=(t.flags&128)!==0,h;if((h=c)||(h=e!==null&&e.memoizedState===null?!1:(Ft.current&2)!==0),h&&(r=!0,t.flags&=-129),h=(t.flags&32)!==0,t.flags&=-33,e===null){if(Be){if(r?bl(t):xl(),(e=ht)?(e=Qg(e,Kn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:cl!==null?{id:Sa,overflow:ja}:null,retryLane:536870912,hydrationErrors:null},n=lm(e),n.return=t,t.child=n,qt=t,ht=null)):e=null,e===null)throw dl(t);return ad(e)?t.lanes=32:t.lanes=536870912,null}return c=i.children,i=i.fallback,r?(xl(),r=t.mode,c=Eu({mode:"hidden",children:c},r),i=Il(i,r,n,null),c.return=t,i.return=t,c.sibling=i,t.child=c,i=t.child,i.memoizedState=nf(n),i.childLanes=af(e,h,n),t.memoizedState=tf,Kr(null,i)):(bl(t),lf(t,c))}var b=e.memoizedState;if(b!==null){var N=b.dehydrated;if(N!==null)return lx(e,t,c,h,i,N,b,n)}return r?(xl(),r=i.fallback,c=t.mode,b=e.child,N=b.sibling,i=Ya(b,{mode:"hidden",children:i.children}),i.subtreeFlags=b.subtreeFlags&1206910976,N!==null?r=Ya(N,r):(r=Il(r,c,n,null),r.flags|=2),r.return=t,i.return=t,i.sibling=r,t.child=i,Kr(null,i),i=t.child,r=e.child.memoizedState,r===null?r=nf(n):(c=r.cachePool,c!==null?(b=Dt._currentValue,c=c.parent!==b?{parent:b,pool:b}:c):c=hm(),r={baseLanes:r.baseLanes|n,cachePool:c}),i.memoizedState=r,i.childLanes=af(e,h,n),t.memoizedState=tf,Kr(e.child,i)):(bl(t),n=e.child,e=n.sibling,n=Ya(n,{mode:"visible",children:i.children}),n.return=t,n.sibling=null,e!==null&&(h=t.deletions,h===null?(t.deletions=[e],t.flags|=16):h.push(e)),t.child=n,t.memoizedState=null,n)}function lf(e,t){return t=Eu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Eu(e,t){return e=_n(22,e,null,t),e.lanes=0,e}function Tu(e,t,n){return ii(t,e.child,null,n),e=lf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function lx(e,t,n,i,r,c,h,b){if(n)return t.flags&256?(bl(t),t.flags&=-257,Tu(e,t,b)):t.memoizedState!==null?(xl(),t.child=e.child,t.flags|=128,null):(xl(),c=r.fallback,h=t.mode,r=Eu({mode:"visible",children:r.children},h),c=Il(c,h,b,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,ii(t,e.child,null,b),r=t.child,r.memoizedState=nf(b),r.childLanes=af(e,i,b),t.memoizedState=tf,Kr(null,r));if(bl(t),ad(c)){if(i=c.nextSibling&&c.nextSibling.dataset,i)var N=i.dgst;return i=N,i!==""&&(r=Error(s(419)),r.stack="",r.digest=i,Zr({value:r,source:null,stack:null})),Tu(e,t,b)}if(Rt||Wl(e,t,b,!1),i=(b&e.childLanes)!==0,Rt||i){if(yl.current!==null)return Tu(e,t,b);if(i=ct,i!==null&&(r=Bs(i,b),r!==0&&r!==h.retryLane))throw h.retryLane=r,Kl(e,r),Cn(i,e,r),Wc;return nd(c)||Qu(),Tu(e,t,b)}return nd(c)?(t.flags|=192,t.child=e.child,null):(e=h.treeContext,ht=Jn(c.nextSibling),qt=t,Be=!0,fl=null,Kn=!1,e!==null&&sm(t,e),t=lf(t,r.children),t.flags|=134221824,t)}function Np(e,t,n){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),su(e.return,t,n)}function Cp(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&gu(n)===null&&(t=e),e=e.sibling}return t}function Au(e,t,n,i,r,c){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailMode:r,treeForkCount:c}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=i,h.tail=n,h.tailMode=r,h.treeForkCount=c)}function rf(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 sf(e,t,n){var i=t.pendingProps,r=i.revealOrder,c=i.tail;i=i.children;var h=Ft.current;if(t.flags&128)return Gr(t,h),null;var b=(h&2)!==0;if(b?(h=h&1|2,t.flags|=128):h&=1,Gr(t,h),r==="backwards"&&e!==null?(rf(e),Bt(e,t,i,n),rf(e)):Bt(e,t,i,n),i=Be?Ur:0,!b&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Np(e,n,t);else if(e.tag===19)Np(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(r){case"backwards":n=Cp(t.child),n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null,rf(t)),Au(t,!0,r,null,c,i);break;case"unstable_legacy-backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&gu(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}Au(t,!0,n,null,c,i);break;case"together":Au(t,!1,null,null,void 0,i);break;case"independent":t.memoizedState=null;break;default:n=Cp(t.child),n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),Au(t,!1,r,n,c,i)}return t.child}function Ep(e,t,n){var i=t.pendingProps;return hl(t,t.type,i.value),Bt(e,t,i.children,n),t.child}function Ka(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),zl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Wl(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,n=Ya(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ya(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function uf(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&uu(e)))}function ix(e,t,n){switch(t.tag){case 3:Da(t,t.stateNode.containerInfo),hl(t,Dt,e.memoizedState.cache),Jl();break;case 27:case 5:ea(t);break;case 4:Da(t,t.stateNode.containerInfo);break;case 10:hl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,kc(t),null;break;case 13:var i=t.memoizedState;if(i!==null){if(i.dehydrated!==null)return bl(t),t.flags|=128,null;i=Wl(e,t,n,!1);var r=t.child.childLanes;return i||(n&r)!==0?wp(e,t,n):(bl(t),e=Ka(e,t,n),e!==null?e.sibling:null)}bl(t);break;case 19:if(t.flags&128)return sf(e,t,n);if(r=(e.flags&128)!==0,i=(n&t.childLanes)!==0,i||(Wl(e,t,n,!1),i=(n&t.childLanes)!==0),r){if(i)return sf(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Gr(t,Ft.current),i)break;return null;case 22:return t.lanes=0,bp(e,t,n,t.pendingProps);case 24:hl(t,Dt,e.memoizedState.cache)}return Ka(e,t,n)}function Tp(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Rt=!0;else{if(!uf(e,n)&&(t.flags&128)===0)return Rt=!1,ix(e,t,n);Rt=(e.flags&131072)!==0}else Rt=!1,Be&&(t.flags&1048576)!==0&&rm(t,Ur,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=ai(t.elementType),t.type=e,typeof e=="function")mc(e)?(i=si(e,i),t.tag=1,t=_p(null,t,e,i,n)):(t.tag=0,t=ef(null,t,e,i,n));else{if(e!=null){var r=e.$$typeof;if(r===z){t.tag=11,t=gp(null,t,e,i,n);break e}else if(r===se){t.tag=14,t=vp(null,t,e,i,n);break e}else if(r===X){t.tag=10,t.type=e,t=Ep(null,t,n);break e}}throw t=ee(e)||e,Error(s(306,t,""))}}return t;case 0:return ef(e,t,t.type,t.pendingProps,n);case 1:return i=t.type,r=si(i,t.pendingProps),_p(e,t,i,r,n);case 3:e:{if(Da(t,t.stateNode.containerInfo),e===null)throw Error(s(387));i=t.pendingProps;var c=t.memoizedState;r=c.element,Cc(e,t),Vr(t,i,null,n);var h=t.memoizedState;if(i=h.cache,hl(t,Dt,i),i!==c.cache&&Sc(t,[Dt],n,!0),Yr(),i=h.element,c.isDehydrated)if(c={element:i,isDehydrated:!1,cache:h.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=zp(e,t,i,n);break e}else if(i!==r){r=Xn(Error(s(424)),t),Zr(r),t=zp(e,t,i,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ht=Jn(e.firstChild),qt=t,Be=!0,fl=null,Kn=!0,n=bm(t,null,i,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(Jl(),i===r){t=Ka(e,t,n);break e}Bt(e,t,i,n)}t=t.child}return t;case 26:return Li(e,t),e===null?(n=ev(t.type,null,t.pendingProps,null))?t.memoizedState=n:Be||(t.stateNode=Dg(t.type,t.pendingProps,en.current,t)):t.memoizedState=ev(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ea(t),e===null&&Be&&(i=t.stateNode=Ig(t.type,t.pendingProps,en.current),qt=t,Kn=!0,r=ht,El(t.type)?(ld=r,ht=Jn(i.firstChild)):ht=r),Bt(e,t,t.pendingProps.children,n),Li(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Be&&((r=i=ht)&&(i=Wx(i,t.type,t.pendingProps,Kn),i!==null?(t.stateNode=i,qt=t,ht=Jn(i.firstChild),Kn=!1,r=!0):r=!1),r||dl(t)),ea(t),r=t.type,c=t.pendingProps,h=e!==null?e.memoizedProps:null,i=c.children,Kf(r,c)?i=null:h!==null&&Kf(r,h)&&(t.flags|=32),t.memoizedState!==null&&(r=Rc(e,t,F1,null,null,n),ir._currentValue=r),Li(e,t),Bt(e,t,i,n),t.child;case 6:return e===null&&Be&&((e=n=ht)&&(n=eS(n,t.pendingProps,Kn),n!==null?(t.stateNode=n,qt=t,ht=null,e=!0):e=!1),e||dl(t)),null;case 13:return wp(e,t,n);case 4:return Da(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=ii(t,null,i,n):Bt(e,t,i,n),t.child;case 11:return gp(e,t,t.type,t.pendingProps,n);case 7:return i=t.pendingProps,Li(e,t),Bt(e,t,i,n),t.child;case 8:return Bt(e,t,t.pendingProps.children,n),t.child;case 12:return Bt(e,t,t.pendingProps.children,n),t.child;case 10:return Ep(e,t,n);case 9:return r=t.type._context,i=t.pendingProps.children,ei(t),r=Xt(r),i=i(r),t.flags|=1,Bt(e,t,i,n),t.child;case 14:return vp(e,t,t.type,t.pendingProps,n);case 15:return yp(e,t,t.type,t.pendingProps,n);case 19:return sf(e,t,n);case 31:return ax(e,t,n);case 22:return bp(e,t,n,t.pendingProps);case 24:return ei(t),i=Xt(Dt),e===null?(r=zc(),r===null&&(r=ct,c=jc(),r.pooledCache=c,c.refCount++,c!==null&&(r.pooledCacheLanes|=n),r=c),t.memoizedState={parent:i,cache:r},Nc(t),hl(t,Dt,r)):((e.lanes&n)!==0&&(Cc(e,t),Vr(t,null,null,n),Yr()),r=e.memoizedState,c=t.memoizedState,r.parent!==i?(r={parent:i,cache:i},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),hl(t,Dt,i)):(i=c.cache,hl(t,Dt,i),i!==r.cache&&Sc(t,[Dt],n,!0))),Bt(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),i=t.pendingProps,i.name!=null&&i.name!=="auto"?t.flags|=e===null?18882560:18874368:Be&&iu(t),e!==null&&e.memoizedProps.name!==i.name?t.flags|=4194816:Li(e,t),Bt(e,t,i.children,n),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function Ia(e){e.flags|=4}function of(e,t,n,i,r){var c;if((c=(e.mode&32)!==0)&&(c=n===null?lv(t,i):lv(t,i)&&(i.src!==n.src||i.srcSet!==n.srcSet)),c){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(cg())e.flags|=8192;else throw li=du,wc}else e.flags&=-16777217}function Ap(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!iv(t))if(cg())e.flags|=8192;else throw li=du,wc}function Ou(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?xi():536870912,e.lanes|=t,Xi|=t)}function Ir(e,t){if(!Be)switch(e.tailMode){case"visible":break;case"collapsed":for(var n=e.tail,i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.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 mt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,i=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags&1206910976,i|=r.flags&1206910976,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,i|=r.subtreeFlags,i|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=i,e.childLanes=n,t}function rx(e,t,n){var i=t.pendingProps;switch(vc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(t),null;case 1:return mt(t),null;case 3:return n=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Xa(Dt),$t(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Mi(t)?Ia(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,bc())),mt(t),null;case 26:var r=t.type,c=t.memoizedState;return e===null?(Ia(t),c!==null?(mt(t),Ap(t,c)):(mt(t),of(t,r,null,i,n))):c?c!==e.memoizedState?(Ia(t),mt(t),Ap(t,c)):(mt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&Ia(t),mt(t),of(t,r,e,i,n)),null;case 27:if(Ma(t),n=en.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Ia(t);else{if(!i){if(t.stateNode===null)throw Error(s(166));return mt(t),t.subtreeFlags&=-33554433,null}e=sn.current,Mi(t)?um(t):(e=Ig(r,i,n),t.stateNode=e,Ia(t))}return mt(t),t.subtreeFlags&=-33554433,null;case 5:if(Ma(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Ia(t);else{if(!i){if(t.stateNode===null)throw Error(s(166));return mt(t),t.subtreeFlags&=-33554433,null}if(c=sn.current,Mi(t))um(t);else{var h=ss(en.current);switch(c){case 1:c=h.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:c=h.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":c=h.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":c=h.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":c=h.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof i.is=="string"?h.createElement("select",{is:i.is}):h.createElement("select"),i.multiple?c.multiple=!0:i.size&&(c.size=i.size);break;default:c=typeof i.is=="string"?h.createElement(r,{is:i.is}):h.createElement(r)}}c[zt]=t,c[an]=i;e:for(h=t.child;h!==null;){if(h.tag===5||h.tag===6)c.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}t.stateNode=c;e:switch(It(c,r,i),r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Ia(t)}}return mt(t),t.subtreeFlags&=-33554433,of(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Ia(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(s(166));if(e=en.current,Mi(t)){if(e=t.stateNode,n=t.memoizedProps,i=null,r=qt,r!==null)switch(r.tag){case 27:case 5:i=r.memoizedProps}e[zt]=t,e=!!(e.nodeValue===n||i!==null&&i.suppressHydrationWarning===!0||Tg(e.nodeValue,n)),e||dl(t,!0)}else e=ss(e).createTextNode(i),e[zt]=t,t.stateNode=e}return mt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(i=Mi(t),n!==null){if(e===null){if(!i)throw Error(s(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[zt]=t}else Jl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;mt(t),e=!1}else n=bc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(On(t),t):(On(t),null);if((t.flags&128)!==0)throw Error(s(558))}return mt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=Mi(t),i!==null&&i.dehydrated!==null){if(e===null){if(!r)throw Error(s(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));r[zt]=t}else Jl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;mt(t),r=!1}else r=bc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(On(t),t):(On(t),null)}return On(t),(t.flags&128)!==0?(t.lanes=n,t):(n=i!==null,e=e!==null&&e.memoizedState!==null,n&&(i=t.child,r=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(r=i.alternate.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==r&&(i.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ou(t,t.updateQueue),mt(t),null);case 4:return $t(),e===null&&Vf(t.stateNode.containerInfo),t.flags|=67108864,mt(t),null;case 10:return Xa(t.type),mt(t),null;case 19:if(Dc(t),i=t.memoizedState,i===null)return mt(t),null;if(r=(t.flags&128)!==0,c=i.rendering,c===null)if(r)Ir(i,!1);else{if(Nt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=gu(e),c!==null){for(t.flags|=128,Ir(i,!1),e=c.updateQueue,t.updateQueue=e,Ou(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)am(n,e),n=n.sibling;return Gr(t,Ft.current&1|2),Be&&Va(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Ht()>Yu&&(t.flags|=128,r=!0,Ir(i,!1),t.lanes=4194304)}else{if(!r)if(e=gu(c),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Ou(t,e),Ir(i,!0),i.tail===null&&i.tailMode!=="collapsed"&&i.tailMode!=="visible"&&!c.alternate&&!Be)return mt(t),null}else 2*Ht()-i.renderingStartTime>Yu&&n!==536870912&&(t.flags|=128,r=!0,Ir(i,!1),t.lanes=4194304);i.isBackwards?(c.sibling=t.child,t.child=c):(e=i.last,e!==null?e.sibling=c:t.child=c,i.last=c)}if(i.tail!==null){e=i.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Ht(),e.sibling=null,c=Ft.current,c=r?c&1|2:c&1,i.tailMode==="visible"||i.tailMode==="collapsed"||!n||Be?Gr(t,c):(n=c,Pe(Qt,t),Pe(Ft,n),rn===null&&(rn=t)),Be&&Va(t,i.treeForkCount),e}return mt(t),null;case 22:case 23:return On(t),Oc(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(n&536870912)!==0&&(t.flags&128)===0&&(mt(t),t.subtreeFlags&6&&(t.flags|=8192)):mt(t),n=t.updateQueue,n!==null&&Ou(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==n&&(t.flags|=2048),e!==null&&xt(ni),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Xa(Dt),mt(t),null;case 25:return null;case 30:return t.flags|=33554432,mt(t),null}throw Error(s(156,t.tag))}function sx(e,t){switch(vc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xa(Dt),$t(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ma(t),null;case 31:if(t.memoizedState!==null){if(On(t),t.alternate===null)throw Error(s(340));Jl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(On(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));Jl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Dc(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 $t(),null;case 10:return Xa(t.type),null;case 22:case 23:return On(t),Oc(),e!==null&&xt(ni),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Xa(Dt),null;case 25:return null;default:return null}}function Op(e,t){switch(vc(t),t.tag){case 3:Xa(Dt),$t();break;case 26:case 27:case 5:Ma(t);break;case 4:$t();break;case 31:t.memoizedState!==null&&On(t);break;case 13:On(t);break;case 19:Dc(t);break;case 10:Xa(t.type);break;case 22:case 23:On(t),Oc(),e!==null&&xt(ni);break;case 24:Xa(Dt)}}function Jr(e,t){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&e)===e){i=void 0;var c=n.create,h=n.inst;i=c(),h.destroy=i}n=n.next}while(n!==r)}}catch(b){lt(t,t.return,b)}}function Sl(e,t,n){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var c=r.next;i=c;do{if((i.tag&e)===e){var h=i.inst,b=h.destroy;if(b!==void 0){h.destroy=void 0,r=t;var N=n,R=b;try{R()}catch(L){lt(r,N,L)}}}i=i.next}while(i!==c)}}catch(L){lt(t,t.return,L)}}function kp(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Sm(t,n)}catch(i){lt(e,e.return,i)}}}function Dp(e,t,n){n.props=si(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(i){lt(e,t,i)}}function _a(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:var r=e.stateNode,c=La(e.memoizedProps,r);(r.ref===null||r.ref.name!==c)&&(r.ref=Hg(c)),i=r.ref;break;case 7:if(e.stateNode===null){var h=new Un(e);v(e.child,!1,Jx,h,void 0,void 0),e.stateNode=h}i=e.stateNode;break;default:i=e.stateNode}typeof n=="function"?e.refCleanup=n(i):n.current=i}}catch(b){lt(e,t,b)}}function Kt(e,t){var n=e.ref,i=e.refCleanup;if(n!==null)if(typeof i=="function")try{i()}catch(r){lt(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(r){lt(e,t,r)}else n.current=null}function ku(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++)Xg(e.stateNode,t[n])}function Mp(e){for(var t=e.return;t!==null&&(ff(t)&&Xg(e.stateNode,t.stateNode),!cf(t));)t=t.return}function Pr(e){for(var t=e.return;t!==null&&(ff(t)&&Px(e.stateNode,t.stateNode),!cf(t));)t=t.return}function cf(e){return e.tag===5||e.tag===3||e.tag===27}function ff(e){return e&&e.tag===7&&e.stateNode!==null}function df(e){var t=e.type,n=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&i.focus();break e;case"img":n.src?i.src=n.src:n.srcSet&&(i.srcset=n.srcSet)}}catch(r){lt(e,e.return,r)}}function hf(e,t,n){try{var i=e.stateNode;Dx(i,e.type,n,t),i[an]=t}catch(r){lt(e,e.return,r)}}function Rp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&El(e.type)||e.tag===4}function mf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Rp(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&&El(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function pf(e,t,n,i){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(r,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(r),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=xa)),ku(e,i),Fe=!0;else if(r!==4&&(r===27&&(ku(e,i),i=null,El(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(pf(e,t,n,i),e=e.sibling;e!==null;)pf(e,t,n,i),e=e.sibling}function Du(e,t,n,i){var r=e.tag;if(r===5||r===6)r=e.stateNode,t?n.insertBefore(r,t):n.appendChild(r),ku(e,i),Fe=!0;else if(r!==4&&(r===27&&(ku(e,i),i=null,El(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Du(e,t,n,i),e=e.sibling;e!==null;)Du(e,t,n,i),e=e.sibling}function Up(e){var t=e.stateNode,n=e.memoizedProps;try{for(var i=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);It(t,i,n),t[zt]=e,t[an]=n}catch(c){lt(e,e.return,c)}}var Mu=!1,kn=null;function Zp(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Mu=!0)}var za=null;function $p(){var e=za;return za=null,e}var zn=0;function qi(e,t,n,i,r){return zn=0,Bp(e.child,t,n,i,r)}function Bp(e,t,n,i,r){for(var c=!1;e!==null;){if(e.tag===5){var h=e.stateNode;if(i!==null){var b=Pf(h);i.push(b),b.view&&(c=!0)}else c||Pf(h).view&&(c=!0);Mu=!0,$g(h,zn===0?t:t+"_"+zn,n),zn++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&r||Bp(e.child,t,n,i,r)&&(c=!0));e=e.sibling}return c}function wa(e,t){for(;e!==null;)e.tag===5?Bg(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||wa(e.child,t)),e=e.sibling}function Ru(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Ru(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(s(544));var n=t.name;t=qa(t.default,t.share),t!=="none"&&(qi(e,n,t,null,!1)||wa(e.child,!1))}e=e.sibling}}function gf(e,t){if(e.tag===30){var n=e.stateNode,i=e.memoizedProps,r=La(i,n),c=qa(i.default,n.paired?i.share:i.enter);c!=="none"?qi(e,r,c,null,!1)?(Ru(e),n.paired||t||Ii(e,i.onEnter)):wa(e.child,!1):Ru(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)gf(e,t),e=e.sibling;else Ru(e)}function vf(e){if(kn!==null&&kn.size!==0){var t=kn;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var n=e.memoizedProps,i=n.name;if(i!=null&&i!=="auto"){var r=t.get(i);if(r!==void 0){var c=qa(n.default,n.share);if(c!=="none"&&(qi(e,i,c,null,!1)?(c=e.stateNode,r.paired=c,c.paired=r,Ii(e,n.onShare)):wa(e.child,!1)),t.delete(i),t.size===0)break}}}vf(e)}e=e.sibling}}}function yf(e){if(e.tag===30){var t=e.memoizedProps,n=La(t,e.stateNode),i=kn!==null?kn.get(n):void 0,r=qa(t.default,i!==void 0?t.share:t.exit);r!=="none"&&(qi(e,n,r,null,!1)?i!==void 0?(r=e.stateNode,i.paired=r,r.paired=i,kn.delete(n),Ii(e,t.onShare)):Ii(e,t.onExit):wa(e.child,!1)),kn!==null&&vf(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)yf(e),e=e.sibling;else kn!==null&&vf(e)}function Hp(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=La(t,e.stateNode);t=qa(t.default,t.update),e.flags&=-5,t!=="none"&&qi(e,n,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&Hp(e);e=e.sibling}}function bf(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,wa(e.child,!1))}bf(e)}e=e.sibling}}function Uu(e){if(e.tag===30)e.stateNode.paired=null,wa(e.child,!1),bf(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Uu(e),e=e.sibling;else bf(e)}function Lp(e){for(e=e.child;e!==null;)e.tag===30?wa(e.child,!1):(e.subtreeFlags&33554432)!==0&&Lp(e),e=e.sibling}function xf(e,t,n,i,r,c,h){for(var b=!1;t!==null;){if(t.tag===5){var N=t.stateNode;if(c!==null&&zn<c.length){var R=c[zn],L=Pf(N);(R.view||L.view)&&(b=!0);var P;if(P=(e.flags&4)===0)if(L.clip)P=!0;else{P=R.rect;var D=L.rect;P=P.y!==D.y||P.x!==D.x||P.height!==D.height||P.width!==D.width}P&&(e.flags|=4),L.abs?L=!R.abs:(R=R.rect,L=L.rect,L=R.height!==L.height||R.width!==L.width),L&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&$g(N,zn===0?n:n+"_"+zn,r),b&&(e.flags&4)!==0||(za===null&&(za=[]),za.push(N,zn===0?i:i+"_"+zn,t.memoizedProps)),zn++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&h?e.flags|=t.flags&32:xf(e,t.child,n,i,r,c,h)&&(b=!0));t=t.sibling}return b}function qp(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,i=e.stateNode,r=La(n,i),c=qa(n.default,n.update),h;h=e.memoizedState,e.memoizedState=null,i=e;var b=e.child;zn=0,r=xf(i,b,r,r,c,h,!1),(e.flags&4)!==0&&r&&Ii(e,n.onUpdate)}else(e.subtreeFlags&33554432)!==0&&qp(e);e=e.sibling}}var Yt=!1,nt=!1,Na=!1,Sf=!1,Yp=typeof WeakSet=="function"?WeakSet:Set,Vt=null,Ca=!1,Wr=!1,Zu=!1,jf=!1;function ux(e,t,n){if(e=e.containerInfo,Qf=rr,e=Qh(e),sc(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var r=i.getSelection&&i.getSelection();if(r&&r.rangeCount!==0){i=r.anchorNode;var c=r.anchorOffset,h=r.focusNode;r=r.focusOffset;try{i.nodeType,h.nodeType}catch{i=null;break e}var b=0,N=-1,R=-1,L=0,P=0,D=e,H=null;t:for(;;){for(var me;D!==i||c!==0&&D.nodeType!==3||(N=b+c),D!==h||r!==0&&D.nodeType!==3||(R=b+r),D.nodeType===3&&(b+=D.nodeValue.length),(me=D.firstChild)!==null;)H=D,D=me;for(;;){if(D===e)break t;if(H===i&&++L===c&&(N=b),H===h&&++P===r&&(R=b),(me=D.nextSibling)!==null)break;D=H,H=D.parentNode}D=me}i=N===-1||R===-1?null:{start:N,end:R}}else i=null}i=i||{start:0,end:0}}else i=null;for(Ff={focusedElem:e,selectionRange:i},rr=!1,n=(n&335544064)===n,Vt=t,t=n?9270:1024;Vt!==null;){if(e=Vt,n&&(i=e.deletions,i!==null))for(c=0;c<i.length;c++)n&&yf(i[c]);if(e.alternate===null&&(e.flags&2)!==0)n&&Zp(e),$u(n);else{if(e.tag===22){if(i=e.alternate,e.memoizedState!==null){i!==null&&i.memoizedState===null&&n&&yf(i),$u(n);continue}else if(i!==null&&i.memoizedState!==null){n&&Zp(e),$u(n);continue}}i=e.child,(e.subtreeFlags&t)!==0&&i!==null?(i.return=e,Vt=i):(n&&Hp(e),$u(n))}}kn=null}function $u(e){for(;Vt!==null;){var t=Vt,n=e,i=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((r&1024)!==0&&i!==null){n=void 0,r=i.memoizedProps,i=i.memoizedState;var c=t.stateNode;try{var h=si(t.type,r);n=c.getSnapshotBeforeUpdate(h,i),c.__reactInternalSnapshotBeforeUpdate=n}catch(b){lt(t,t.return,b)}}break;case 3:if((r&1024)!==0){if(i=t.stateNode.containerInfo,n=i.nodeType,n===9)td(i);else if(n===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":td(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&i!==null&&(n=La(i.memoizedProps,i.stateNode),r=t.memoizedProps,r=qa(r.default,r.update),r!=="none"&&qi(i,n,r,i.memoizedState=[],!0));break;default:if((r&1024)!==0)throw Error(s(163))}if(i=t.sibling,i!==null){i.return=t.return,Vt=i;break}Vt=t.return}}function Vp(e,t,n){var i=n.flags;switch(n.tag){case 0:case 11:case 15:Ea(e,n),i&4&&Jr(5,n);break;case 1:if(Ea(e,n),i&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(h){lt(n,n.return,h)}else{var r=si(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(h){lt(n,n.return,h)}}i&64&&kp(n),i&512&&_a(n,n.return);break;case 3:if(Ea(e,n),i&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{Sm(e,t)}catch(h){lt(n,n.return,h)}}break;case 27:t===null&&i&4&&Up(n);case 26:case 5:Ea(e,n),t===null&&i&4&&df(n),i&512&&_a(n,n.return);break;case 12:Ea(e,n);break;case 31:Ea(e,n),i&4&&Fp(e,n);break;case 13:Ea(e,n),i&4&&Kp(e,n),i&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=xx.bind(null,n),tS(e,n))));break;case 22:if(i=n.memoizedState!==null||Yt,!i){var c=t!==null&&t.memoizedState!==null||nt;t=Yt,r=nt,Yt=i,(nt=c)&&!r?(i=2,(n.subtreeFlags&8772)!==0&&(i|=1),ra(e,n,i)):Ea(e,n),Yt=t,nt=r}break;case 30:Ea(e,n),i&512&&_a(n,n.return);break;case 7:i&512&&_a(n,n.return);default:Ea(e,n)}}function _f(e,t){for(e=e.child;e!==null;)Gp(e,t),e=e.sibling}function Gp(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var i=n.style;typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"}else{var r=e.stateNode,c=e.memoizedProps.style,h=c!=null&&c.hasOwnProperty("display")?c.display:null;r.style.display=h==null||typeof h=="boolean"?"":(""+h).trim()}}catch(N){lt(e,e.return,N)}zf(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,Fe=!0}catch(N){lt(e,e.return,N)}break;case 18:try{var b=e.stateNode;t?Zg(b,!0):Zg(e.stateNode,!1)}catch(N){lt(e,e.return,N)}break;case 22:case 23:e.memoizedState===null&&_f(e,t);break;default:_f(e,t)}}function zf(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var n=e,i=t;switch(n.tag){case 4:Gp(n,i);break e;case 22:n.memoizedState===null&&zf(n,i);break e;default:zf(n,i)}}e=e.sibling}}function Xp(e){var t=e.alternate;t!==null&&(e.alternate=null,Xp(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&$a(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 yt=null,wn=!1;function la(e,t,n){for(n=n.child;n!==null;)Qp(e,t,n),n=n.sibling}function Qp(e,t,n){if(nn&&typeof nn.onCommitFiberUnmount=="function")try{nn.onCommitFiberUnmount(va,n)}catch{}switch(n.tag){case 26:nt||Kt(n,t),la(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!nt&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:nt||Kt(n,t),Pr(n);var i=yt,r=wn;El(n.type)&&(yt=n.stateNode,wn=!1),la(e,t,n),Jg(n.stateNode,n.type,n.memoizedProps),yt=i,wn=r;break;case 5:nt||Kt(n,t),Pr(n);case 6:if(n.tag===6&&Pr(n),i=yt,r=wn,yt=null,la(e,t,n),yt=i,wn=r,yt!==null)if(wn)try{(yt.nodeType===9?yt.body:yt.nodeName==="HTML"?yt.ownerDocument.body:yt).removeChild(n.stateNode),Fe=!0}catch(c){lt(n,t,c)}else try{yt.removeChild(n.stateNode),Fe=!0}catch(c){lt(n,t,c)}break;case 18:yt!==null&&(wn?(e=yt,Ug(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),sr(e)):Ug(yt,n.stateNode));break;case 4:i=yt,r=wn,yt=n.stateNode.containerInfo,wn=!0,la(e,t,n),yt=i,wn=r;break;case 0:case 11:case 14:case 15:Sl(2,n,t),nt||Sl(4,n,t),la(e,t,n);break;case 1:nt||(Kt(n,t),i=n.stateNode,typeof i.componentWillUnmount=="function"&&Dp(n,t,i)),la(e,t,n);break;case 21:la(e,t,n);break;case 22:nt=(i=nt)||n.memoizedState!==null,la(e,t,n),nt=i;break;case 30:Kt(n,t),la(e,t,n);break;case 7:nt||Kt(n,t),la(e,t,n);break;default:la(e,t,n)}}function Fp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{sr(e)}catch(n){lt(t,t.return,n)}}}function Kp(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{sr(e)}catch(n){lt(t,t.return,n)}}function ox(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Yp),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Yp),t;default:throw Error(s(435,e.tag))}}function Bu(e,t){var n=ox(e);t.forEach(function(i){if(!n.has(i)){n.add(i);var r=Sx.bind(null,e,i);i.then(r,r)}})}function pn(e,t,n){var i=t.deletions;if(i!==null)for(var r=0;r<i.length;r++){var c=i[r],h=e,b=t,N=b;e:for(;N!==null;){switch(N.tag){case 27:if(El(N.type)){yt=N.stateNode,wn=!1;break e}break;case 5:yt=N.stateNode,wn=!1;break e;case 3:case 4:yt=N.stateNode.containerInfo,wn=!0;break e}N=N.return}if(yt===null)throw Error(s(160));Qp(h,b,c),yt=null,wn=!1,h=c.alternate,h!==null&&(h.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ip(t,e,n),t=t.sibling}var ia=null;function Ip(e,t,n){var i=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(r&4&&(i=e.updateQueue,i=i!==null?i.events:null,i!==null))for(var c=0;c<i.length;c++){var h=i[c];h.ref.impl=h.nextImpl}pn(t,e,n),gn(e),r&4&&(Sl(3,e,e.return),Jr(3,e),Sl(5,e,e.return));break;case 1:pn(t,e,n),gn(e),r&512&&(nt||i===null||Kt(i,i.return)),r&64&&Yt&&(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(c=ia,pn(t,e,n),gn(e),r&512&&(nt||i===null||Kt(i,i.return)),r&4)if(r=i!==null?i.memoizedState:null,n=e.memoizedState,i===null)if(n===null)if(e.stateNode===null)if(Yt)e.stateNode=Dg(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,n=e.memoizedProps,r=c.ownerDocument||c;t:switch(t){case"title":i=r.getElementsByTagName("title")[0],(!i||i[ya]||i[zt]||i.namespaceURI==="http://www.w3.org/2000/svg"||i.hasAttribute("itemprop"))&&(i=r.createElement(t),r.head.insertBefore(i,r.querySelector("head > title"))),It(i,t,n),i[zt]=e,Tt(i),t=i;break e;case"link":if(c=av("link","href",r).get(t+(n.href||""))){for(h=0;h<c.length;h++)if(i=c[h],i.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&i.getAttribute("rel")===(n.rel==null?null:n.rel)&&i.getAttribute("title")===(n.title==null?null:n.title)&&i.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){c.splice(h,1);break t}}i=r.createElement(t),It(i,t,n),r.head.appendChild(i);break;case"meta":if(c=av("meta","content",r).get(t+(n.content||""))){for(h=0;h<c.length;h++)if(i=c[h],i.getAttribute("content")===(n.content==null?null:""+n.content)&&i.getAttribute("name")===(n.name==null?null:n.name)&&i.getAttribute("property")===(n.property==null?null:n.property)&&i.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&i.getAttribute("charset")===(n.charSet==null?null:n.charSet)){c.splice(h,1);break t}}i=r.createElement(t),It(i,t,n),r.head.appendChild(i);break;default:throw Error(s(468,t))}i[zt]=e,Tt(i),t=i}e.stateNode=t}else Yt||ud(c,e.type,e.stateNode);else e.stateNode=nv(c,n,e.memoizedProps);else r!==n?(r===null?(t=i.stateNode,t===null||nt||t.parentNode.removeChild(t)):r.count--,n===null?Yt||ud(c,e.type,e.stateNode):nv(c,n,e.memoizedProps)):n===null&&e.stateNode!==null&&hf(e,e.memoizedProps,i.memoizedProps);break;case 27:pn(t,e,n),gn(e),r&512&&(nt||i===null||Kt(i,i.return)),i!==null&&r&4&&hf(e,e.memoizedProps,i.memoizedProps);break;case 5:if(c=Na,Na=!1,pn(t,e,n),Na=c,gn(e),r&512&&(nt||i===null||Kt(i,i.return)),e.flags&32){t=e.stateNode;try{Ke(t,""),Fe=!0}catch(L){lt(e,e.return,L)}}r&4&&e.stateNode!=null&&(t=e.memoizedProps,hf(e,t,i!==null?i.memoizedProps:t)),r&1024&&(Sf=!0);break;case 6:if(pn(t,e,n),gn(e),r&4){if(e.stateNode===null)throw Error(s(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Fe=!0}catch(L){lt(e,e.return,L)}}break;case 3:if(Fe=!1,eo=null,c=ia,ia=us(t.containerInfo),pn(t,e,n),ia=c,gn(e),r&4&&i!==null&&i.memoizedState.isDehydrated)try{sr(t.containerInfo)}catch(L){lt(e,e.return,L)}Sf&&(Sf=!1,Jp(e)),Fe=!1;break;case 4:r=Na,Na=Yt,i=x(),c=ia,ia=us(e.stateNode.containerInfo),pn(t,e,n),gn(e),ia=c,Fe&&Wr&&(Zu=!0),Fe=i,Na=r;break;case 12:pn(t,e,n),gn(e);break;case 31:pn(t,e,n),gn(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Bu(e,t)));break;case 13:pn(t,e,n),gn(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(qu=Ht()),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Bu(e,t)));break;case 22:c=e.memoizedState!==null,h=i!==null&&i.memoizedState!==null;var b=Yt,N=nt,R=Na;Yt=b||c,Na=R||c,nt=N||h,pn(t,e,n),nt=N,Na=R,Yt=b,gn(e),r&8192&&(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,!c||i===null||h||Yt||nt||(t=h||nt,n=Yt,i=nt,Yt=c||Yt,nt=t,jl(e,2),Yt=n,nt=i),!c&&Na||_f(e,c)),r&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Bu(e,n))));break;case 19:pn(t,e,n),gn(e),r&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Bu(e,t)));break;case 30:r&512&&(nt||i===null||Kt(i,i.return)),r=x(),c=Wr,h=(n&335544064)===n,b=e.memoizedProps,Wr=h&&qa(b.default,b.update)!=="none",pn(t,e,n),gn(e),h&&i!==null&&Fe&&(e.flags|=4),Wr=c,Fe=r;break;case 21:break;case 7:r&512&&(nt||i===null||Kt(i,i.return)),i&&i.stateNode!==null&&(i.stateNode._fragmentFiber=e);default:pn(t,e,n),gn(e)}}function gn(e){var t=e.flags;if(t&2){try{for(var n,i=e.return;i!==null;){if(Rp(i)){n=i;break}i=i.return}i=null;for(var r=e.return;r!==null;){if(ff(r)){var c=r.stateNode;i===null?i=[c]:i.push(c)}if(cf(r))break;r=r.return}var h=i;if(n==null)throw Error(s(160));switch(n.tag){case 27:var b=n.stateNode,N=mf(e);Du(e,N,b,h);break;case 5:var R=n.stateNode;n.flags&32&&(Ke(R,""),n.flags&=-33);var L=mf(e);Du(e,L,R,h);break;case 3:case 4:var P=n.stateNode.containerInfo,D=mf(e);pf(e,D,P,h);break;default:throw Error(s(161))}}catch(H){lt(e,e.return,H)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Jp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Jp(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,rr=!0,t.reset(),rr=!1),e=e.sibling}}function Yi(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Pp(t,e),t=t.sibling;else qp(t)}function Pp(e,t){var n=e.alternate;if(n===null)gf(e,!1);else switch(e.tag){case 3:if(jf=Ca=!1,$p(),Yi(t,e),!Ca&&!Zu){if(e=za,e!==null)for(var i=0;i<e.length;i+=3){n=e[i];var r=e[i+1];Bg(n,e[i+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+r+")"})}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"})),jf=!0}za=null;break;case 5:Yi(t,e);break;case 4:i=Ca,Ca=!1,Yi(t,e),Ca&&(Zu=!0),Ca=i;break;case 22:e.memoizedState===null&&(n.memoizedState!==null?gf(e,!1):Yi(t,e));break;case 30:i=Ca,r=$p(),Ca=!1,Yi(t,e),Ca&&(e.flags|=4);var c=e.memoizedProps,h=e.stateNode;t=La(c,h),h=La(n.memoizedProps,h);var b=qa(c.default,c.update);b==="none"?t=!1:(c=n.memoizedState,n.memoizedState=null,n=e.child,zn=0,t=xf(e,n,t,h,b,c,!0),zn!==(c===null?0:c.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(Ii(e,e.memoizedProps.onUpdate),za=r):r!==null&&(r.push.apply(r,za),za=r),Ca=(e.flags&32)!==0?!0:i;break;default:Yi(t,e)}}function Ea(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Vp(e,t.alternate,t),t=t.sibling}function jl(e,t){for(e=e.child;e!==null;){var n=e,i=t;switch(n.tag){case 0:case 11:case 14:case 15:Sl(4,n,n.return),jl(n,i);break;case 1:Kt(n,n.return);var r=n.stateNode;typeof r.componentWillUnmount=="function"&&Dp(n,n.return,r),jl(n,i);break;case 27:(i&2)!==0&&Jg(n.stateNode,n.type,n.memoizedProps);case 5:Kt(n,n.return),n.tag!==5&&n.tag!==27||Pr(n),jl(n,i);break;case 6:Pr(n);break;case 26:Kt(n,n.return),r=n.stateNode,n.memoizedState!==null||r===null||nt||r.parentNode.removeChild(r),jl(n,i);break;case 22:n.memoizedState===null&&jl(n,i);break;case 30:Kt(n,n.return),jl(n,i);break;case 7:Kt(n,n.return);default:jl(n,i)}e=e.sibling}}function ra(e,t,n){for(n=(t.subtreeFlags&8772)!==0?n:n&-2,t=t.child;t!==null;){var i=t.alternate,r=e,c=t,h=c.flags,b=(n&1)!==0;switch(c.tag){case 0:case 11:case 15:ra(r,c,n),Jr(4,c);break;case 1:if(ra(r,c,n),i=c,r=i.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(L){lt(i,i.return,L)}if(i=c,r=i.updateQueue,r!==null){var N=i.stateNode;try{var R=r.shared.hiddenCallbacks;if(R!==null)for(r.shared.hiddenCallbacks=null,r=0;r<R.length;r++)xm(R[r],N)}catch(L){lt(i,i.return,L)}}b&&h&64&&kp(c),_a(c,c.return);break;case 27:(n&2)!==0&&Up(c);case 5:c.tag!==5&&c.tag!==27||Mp(c),ra(r,c,n),b&&i===null&&h&4&&df(c),_a(c,c.return);break;case 6:Mp(c);break;case 26:N=c.stateNode,c.memoizedState!==null||N===null||Yt||ud(us(N.ownerDocument),c.type,N),ra(r,c,n),b&&i===null&&h&4&&df(c),_a(c,c.return);break;case 12:ra(r,c,n);break;case 31:ra(r,c,n),b&&h&4&&Fp(r,c);break;case 13:ra(r,c,n),b&&h&4&&Kp(r,c);break;case 22:c.memoizedState===null&&ra(r,c,n),_a(c,c.return);break;case 30:ra(r,c,n),_a(c,c.return);break;case 7:_a(c,c.return);default:ra(r,c,n)}t=t.sibling}}function wf(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&&$r(n))}function Nf(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&$r(e))}function In(e,t,n,i){var r=(n&335544064)===n;if(t.subtreeFlags&(r?10262:10256))for(t=t.child;t!==null;)Wp(e,t,n,i),t=t.sibling;else r&&Lp(t)}function Wp(e,t,n,i){var r=(n&335544064)===n;r&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Uu(t);var c=t.flags;switch(t.tag){case 0:case 11:case 15:In(e,t,n,i),c&2048&&Jr(9,t);break;case 1:In(e,t,n,i);break;case 3:In(e,t,n,i),r&&jf&&(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="")),c&2048&&(c=null,t.alternate!==null&&(c=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==c&&(t.refCount++,c!=null&&$r(c)));break;case 12:if(c&2048){In(e,t,n,i),c=t.stateNode;try{var h=t.memoizedProps,b=h.id,N=h.onPostCommit;typeof N=="function"&&N(b,t.alternate===null?"mount":"update",c.passiveEffectDuration,-0)}catch(R){lt(t,t.return,R)}}else In(e,t,n,i);break;case 31:In(e,t,n,i);break;case 13:In(e,t,n,i);break;case 23:break;case 22:h=t.stateNode,b=t.alternate,t.memoizedState!==null?(r&&b!==null&&b.memoizedState===null&&Uu(b),h._visibility&2?In(e,t,n,i):es(e,t)):(r&&b!==null&&b.memoizedState!==null&&Uu(t),h._visibility&2?In(e,t,n,i):(h._visibility|=2,Vi(e,t,n,i,(t.subtreeFlags&10256)!==0||!1))),c&2048&&wf(b,t);break;case 24:In(e,t,n,i),c&2048&&Nf(t.alternate,t);break;case 30:r&&(c=t.alternate,c!==null&&(wa(c.child,!0),wa(t.child,!0))),In(e,t,n,i);break;default:In(e,t,n,i)}}function Vi(e,t,n,i,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,h=t,b=n,N=i,R=h.flags;switch(h.tag){case 0:case 11:case 15:Vi(c,h,b,N,r),Jr(8,h);break;case 23:break;case 22:var L=h.stateNode;h.memoizedState!==null?L._visibility&2?Vi(c,h,b,N,r):es(c,h):(L._visibility|=2,Vi(c,h,b,N,r)),r&&R&2048&&wf(h.alternate,h);break;case 24:Vi(c,h,b,N,r),r&&R&2048&&Nf(h.alternate,h);break;default:Vi(c,h,b,N,r)}t=t.sibling}}function es(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,i=t,r=i.flags;switch(i.tag){case 22:es(n,i),r&2048&&wf(i.alternate,i);break;case 24:es(n,i),r&2048&&Nf(i.alternate,i);break;default:es(n,i)}t=t.sibling}}var ui=8192;function oi(e,t,n){if(e.subtreeFlags&ui)for(e=e.child;e!==null;)eg(e,t,n),e=e.sibling}function eg(e,t,n){switch(e.tag){case 26:oi(e,t,n),e.flags&ui&&(e.memoizedState!==null?pS(n,ia,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&sv(n,e)));break;case 5:oi(e,t,n),e.flags&ui&&(e=e.stateNode,(t&335544128)===t&&sv(n,e));break;case 3:case 4:var i=ia;ia=us(e.stateNode.containerInfo),oi(e,t,n),ia=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=ui,ui=16777216,oi(e,t,n),ui=i):oi(e,t,n));break;case 30:if((e.flags&ui)!==0&&(i=e.memoizedProps.name,i!=null&&i!=="auto")){var r=e.stateNode;r.paired=null,kn===null&&(kn=new Map),kn.set(i,r)}oi(e,t,n);break;default:oi(e,t,n)}}function tg(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 ts(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];Vt=i,ag(i,e)}tg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ng(e),e=e.sibling}function ng(e){switch(e.tag){case 0:case 11:case 15:ts(e),e.flags&2048&&Sl(9,e,e.return);break;case 3:ts(e);break;case 12:ts(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Hu(e)):ts(e);break;default:ts(e)}}function Hu(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var i=t[n];Vt=i,ag(i,e)}tg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Sl(8,t,t.return),Hu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Hu(t));break;default:Hu(t)}e=e.sibling}}function ag(e,t){for(;Vt!==null;){var n=Vt;switch(n.tag){case 0:case 11:case 15:Sl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var i=n.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:$r(n.memoizedState.cache)}if(i=n.child,i!==null)i.return=n,Vt=i;else e:for(n=e;Vt!==null;){i=Vt;var r=i.sibling,c=i.return;if(Xp(i),i===n){Vt=null;break e}if(r!==null){r.return=c,Vt=r;break e}Vt=c}}}var cx={getCacheForType:function(e){var t=Xt(Dt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Xt(Dt).controller.signal}},fx=typeof WeakMap=="function"?WeakMap:Map,tt=0,ct=null,qe=null,Xe=0,at=0,Dn=null,_l=!1,Gi=!1,Cf=!1,Ja=0,Nt=0,zl=0,ci=0,Lu=0,Mn=0,Xi=0,ns=null,Nn=null,Ef=!1,qu=0,lg=0,Yu=1/0,Vu=null,wl=null,St=0,sa=null,fi=null,Ta=0,Tf=0,Af=null,ig=null,Qi=null,Fi=null,Ki=null,as=0,Gu=null;function Rn(){return(tt&2)!==0&&Xe!==0?Xe&-Xe:oe.T!==null?Hf():ji()}function rg(){if(Mn===0)if((Xe&536870912)===0||Be){var e=Me;Me<<=1,(Me&3932160)===0&&(Me=262144),Mn=e}else Mn=536870912;return e=Qt.current,e!==null&&(e.flags|=32),Mn}function Ii(e,t){if(t!=null){var n=e.stateNode,i=n.ref;i===null&&(i=n.ref=Hg(La(e.memoizedProps,n))),Fi===null&&(Fi=[]),Fi.push(t.bind(null,i))}}function Cn(e,t,n){(e===ct&&(at===2||at===9)||e.cancelPendingCommit!==null)&&(Ji(e,0),Nl(e,Xe,Mn,!1)),Yl(e,n),((tt&2)===0||e!==ct)&&(e===ct&&((tt&2)===0&&(ci|=n),Nt===4&&Nl(e,Xe,Mn,!1)),Aa(e))}function sg(e,t,n){if((tt&6)!==0)throw Error(s(327));var i=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Ua(e,t),r=i?mx(e,t):kf(e,t,!0),c=i;do{if(r===0){Gi&&!i&&Nl(e,t,0,!1);break}else{if(n=e.current.alternate,c&&!dx(n)){r=kf(e,t,!1),c=!1;continue}if(r===2){if(c=t,e.errorRecoveryDisabledLanes&c)var h=0;else h=e.pendingLanes&-536870913,h=h!==0?h:h&536870912?536870912:0;if(h!==0){t=h;e:{var b=e;r=ns;var N=b.current.memoizedState.isDehydrated;if(N&&(Ji(b,h).flags|=256),h=kf(b,h,!1),h!==2&&h!==6){if(Cf&&!N){b.errorRecoveryDisabledLanes|=c,ci|=c,r=4;break e}c=Nn,Nn=r,c!==null&&(Nn===null?Nn=c:Nn.push.apply(Nn,c))}r=h}if(c=!1,r!==2)continue}}if(r===1){Ji(e,0),Nl(e,t,0,!0);break}e:{switch(i=e,c=r,c){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Nl(i,t,Mn,!_l);break e;case 2:Nn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(r=qu+300-Ht(),10<r)){if(Nl(i,t,Mn,!_l),ql(i,0,!0)!==0)break e;Ta=t,i.timeoutHandle=Jf(ug.bind(null,i,n,Nn,Vu,Ef,t,Mn,ci,Xi,_l,c,"Throttled",-0,0),r);break e}ug(i,n,Nn,Vu,Ef,t,Mn,ci,Xi,_l,c,null,-0,0)}}break}while(!0);Aa(e)}function ug(e,t,n,i,r,c,h,b,N,R,L,P,D,H){e.timeoutHandle=-1;var me=t.subtreeFlags,we=(c&335544064)===c;if(P=null,(we||me&8192||(me&16785408)===16785408)&&(P={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:xa},kn=null,eg(t,c,P),we&&(me=P,we=e.containerInfo,we=(we.nodeType===9?we:we.ownerDocument).__reactViewTransition,we!=null&&(me.count++,me.waitingForViewTransition=!0,me=fs.bind(me),we.finished.then(me,me))),me=(c&62914560)===c?qu-Ht():(c&4194048)===c?lg-Ht():0,me=gS(P,me),me!==null)){Ta=c,e.cancelPendingCommit=me(gg.bind(null,e,t,c,n,i,r,h,b,N,R,L,P,null,D,H)),Nl(e,c,h,!R);return}gg(e,t,c,n,i,r,h,b,N,R,L,P)}function dx(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 i=0;i<n.length;i++){var r=n[i],c=r.getSnapshot;r=r.value;try{if(!An(c(),r))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 Nl(e,t,n,i){t=vr(e,t),t&=~Lu,t&=~ci,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var r=t;0<r;){var c=31-kt(r),h=1<<c;i[c]=-1,r&=~h}n!==0&&st(e,n,t)}function Xu(){return(tt&6)===0?(ls(0),!1):!0}function Of(){if(qe!==null){if(at===0)var e=qe.return;else e=qe,Ga=Pl=null,$c(e),Zi=null,Lr=0,e=qe;for(;e!==null;)Op(e.alternate,e),e=e.return;qe=null}}function Ji(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Ux(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Ta=0,Of(),ct=e,qe=n=Ya(e.current,null),Xe=t,at=0,Dn=null,_l=!1,Gi=Ua(e,t),Cf=!1,Xi=Mn=Lu=ci=zl=Nt=0,Nn=ns=null,Ef=!1,Ja=vr(e,t),eu(),n}function og(e,t){Ze=null,oe.H=wu,t===Ui||t===fu?(t=gm(),at=3):t===wc?(t=gm(),at=4):at=t===Wc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Dn=t,qe===null&&(Nt=1,Nu(e,Xn(t,e.current)))}function cg(){var e=Qt.current;return e===null?!0:(Xe&4194048)===Xe?rn===null:(Xe&62914560)===Xe||(Xe&536870912)!==0?e===rn:!1}function fg(){var e=oe.H;return oe.H=wu,e===null?wu:e}function dg(){var e=oe.A;return oe.A=cx,e}function Qu(){Nt=4,_l||(Xe&4194048)!==Xe&&Qt.current!==null||(Gi=!0),(zl&134217727)===0&&(ci&134217727)===0||ct===null||Nl(ct,Xe,Mn,!1)}function kf(e,t,n){var i=tt;tt|=2;var r=fg(),c=dg();(ct!==e||Xe!==t)&&(Vu=null,Ji(e,t)),t=!1;var h=Nt;e:do try{if(at!==0&&qe!==null){var b=qe,N=Dn;switch(at){case 8:Of(),h=6;break e;case 3:case 2:case 9:case 6:Qt.current===null&&(t=!0);var R=at;if(at=0,Dn=null,Pi(e,b,N,R),n&&Gi){h=0;break e}break;default:R=at,at=0,Dn=null,Pi(e,b,N,R)}}hx(),h=Nt;break}catch(L){og(e,L)}while(!0);return t&&e.shellSuspendCounter++,Ga=Pl=null,tt=i,oe.H=r,oe.A=c,qe===null&&(ct=null,Xe=0,eu()),h}function hx(){for(;qe!==null;)hg(qe)}function mx(e,t){var n=tt;tt|=2;var i=fg(),r=dg();ct!==e||Xe!==t?(Vu=null,Yu=Ht()+500,Ji(e,t)):Gi=Ua(e,t);e:do try{if(at!==0&&qe!==null){t=qe;var c=Dn;t:switch(at){case 1:at=0,Dn=null,Pi(e,t,c,1);break;case 2:case 9:if(mm(c)){at=0,Dn=null,mg(t);break}t=function(){at!==2&&at!==9||ct!==e||(at=7),Aa(e)},c.then(t,t);break e;case 3:at=7;break e;case 4:at=5;break e;case 7:mm(c)?(at=0,Dn=null,mg(t)):(at=0,Dn=null,Pi(e,t,c,7));break;case 5:var h=null;switch(qe.tag){case 26:h=qe.memoizedState;case 5:case 27:var b=qe;if(h?iv(h):b.stateNode.complete){at=0,Dn=null;var N=b.sibling;if(N!==null)qe=N;else{var R=b.return;R!==null?(qe=R,Fu(R)):qe=null}break t}}at=0,Dn=null,Pi(e,t,c,5);break;case 6:at=0,Dn=null,Pi(e,t,c,6);break;case 8:Of(),Nt=6;break e;default:throw Error(s(462))}}px();break}catch(L){og(e,L)}while(!0);return Ga=Pl=null,oe.H=i,oe.A=r,tt=n,qe!==null?0:(ct=null,Xe=0,eu(),Nt)}function px(){for(;qe!==null&&!yi();)hg(qe)}function hg(e){var t=Tp(e.alternate,e,Ja);e.memoizedProps=e.pendingProps,t===null?Fu(e):qe=t}function mg(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=jp(n,t,t.pendingProps,t.type,void 0,Xe);break;case 11:t=jp(n,t,t.pendingProps,t.type.render,t.ref,Xe);break;case 5:$c(t);var i=t;i===qt&&(Be?(ru(i),i.tag===5&&i.stateNode!=null&&(ht=i.stateNode)):(ru(i),Be=!0));default:Op(n,t),t=qe=am(t,Ja),t=Tp(n,t,Ja)}e.memoizedProps=e.pendingProps,t===null?Fu(e):qe=t}function Pi(e,t,n,i){Ga=Pl=null,$c(t),Zi=null,Lr=0;var r=t.return;try{if(nx(e,r,t,n,Xe)){Nt=1,Nu(e,Xn(n,e.current)),qe=null;return}}catch(c){if(r!==null)throw qe=r,c;Nt=1,Nu(e,Xn(n,e.current)),qe=null;return}t.flags&32768?(Be||i===1?e=!0:Gi||(Xe&536870912)!==0?e=!1:(_l=e=!0,(i===2||i===9||i===3||i===6)&&(i=Qt.current,i!==null&&i.tag===13&&(i.flags|=16384))),pg(t,e)):Fu(t)}function Fu(e){var t=e;do{if((t.flags&32768)!==0){pg(t,_l);return}e=t.return;var n=rx(t.alternate,t,Ja);if(n!==null){qe=n;return}if(t=t.sibling,t!==null){qe=t;return}qe=t=e}while(t!==null);Nt===0&&(Nt=5)}function pg(e,t){do{var n=sx(e.alternate,e);if(n!==null){n.flags&=32767,qe=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){qe=e;return}qe=e=n}while(e!==null);Nt=6,qe=null}function gg(e,t,n,i,r,c,h,b,N,R,L,P){e.cancelPendingCommit=null;do Ku();while(St!==0);if((tt&6)!==0)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));e===ct&&(qe=ct=null,Xe=0),fi=t,sa=e,Ta=n,Af=r,ig=i,gx(e,t,n,h,b,N,P)}}function gx(e,t,n,i,r,c,h){var b=t.lanes|t.childLanes;if(Tf=b,b|=dc,br(e,n,b,i,r,c),Fi=null,(n&335544064)===n?(Ki=V1(e),i=10262):(Ki=null,i=10256),(t.subtreeFlags&i)!==0||(t.flags&i)!==0?(e.callbackNode=null,e.callbackPriority=0,jx(_t,function(){return Uf(),null})):(e.callbackNode=null,e.callbackPriority=0),Mu=!1,i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=oe.T,oe.T=null,r=pe.p,pe.p=2,c=tt,tt|=4;try{ux(e,t,n)}finally{tt=c,pe.p=r,oe.T=i}}St=1,Mu?Qi=qx(h,e.containerInfo,Ki,Df,Mf,yx,Rf,Uf,vx):(Df(),Mf(),Rf())}function vx(e){if(St!==0){var t=sa.onRecoverableError;t(e,{componentStack:null})}}function yx(){St===3&&(St=0,Pp(fi,sa),St=4)}function Df(){if(St===1){St=0;var e=sa,t=fi,n=Ta,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=oe.T,oe.T=null;var r=pe.p;pe.p=2;var c=tt;tt|=4;try{Wr=Zu=!1,Ip(t,e,n),n=Ff;var h=Qh(e.containerInfo),b=n.focusedElem,N=n.selectionRange;if(h!==b&&b&&b.ownerDocument&&Xh(b.ownerDocument.documentElement,b)){if(N!==null&&sc(b)){var R=N.start,L=N.end;if(L===void 0&&(L=R),"selectionStart"in b)b.selectionStart=R,b.selectionEnd=Math.min(L,b.value.length);else{var P=b.ownerDocument||document,D=P&&P.defaultView||window;if(D.getSelection){var H=D.getSelection(),me=b.textContent.length,we=Math.min(N.start,me),$e=N.end===void 0?we:Math.min(N.end,me);!H.extend&&we>$e&&(h=$e,$e=we,we=h);var M=Gh(b,we),O=Gh(b,$e);if(M&&O&&(H.rangeCount!==1||H.anchorNode!==M.node||H.anchorOffset!==M.offset||H.focusNode!==O.node||H.focusOffset!==O.offset)){var $=P.createRange();$.setStart(M.node,M.offset),H.removeAllRanges(),we>$e?(H.addRange($),H.extend(O.node,O.offset)):($.setEnd(O.node,O.offset),H.addRange($))}}}}for(P=[],H=b;H=H.parentNode;)H.nodeType===1&&P.push({element:H,left:H.scrollLeft,top:H.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<P.length;b++){var J=P[b];J.element.scrollLeft=J.left,J.element.scrollTop=J.top}}rr=!!Qf,Ff=Qf=null}finally{tt=c,pe.p=r,oe.T=i}}e.current=t,St=2}}function Mf(){if(St===2){St=0;var e=sa,t=fi,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=oe.T,oe.T=null;var i=pe.p;pe.p=2;var r=tt;tt|=4;try{Vp(e,t.alternate,t)}finally{tt=r,pe.p=i,oe.T=n}}St=3}}function Rf(){if(St===4||St===3){St=0;var e=Qi;Qi=null,ta();var t=sa,n=fi,i=Ta,r=ig,c=(i&335544064)===i?10262:10256;if((n.subtreeFlags&c)!==0||(n.flags&c)!==0?St=5:(St=0,fi=sa=null,vg(t,t.pendingLanes)),c=t.pendingLanes,c===0&&(wl=null),il(i),n=n.stateNode,nn&&typeof nn.onCommitFiberRoot=="function")try{nn.onCommitFiberRoot(va,n,void 0,(n.current.flags&128)===128)}catch{}if(r!==null){n=oe.T,c=pe.p,pe.p=2,oe.T=null;try{for(var h=t.onRecoverableError,b=0;b<r.length;b++){var N=r[b];h(N.value,{componentStack:N.stack})}}finally{oe.T=n,pe.p=c}}if(r=Fi,h=Ki,Ki=null,r!==null&&(Fi=null,h===null&&(h=[]),e!==null))for(N=0;N<r.length;N++)n=(0,r[N])(h),n!==void 0&&e.finished.finally(n);(Ta&3)!==0&&Ku(),Aa(t),c=t.pendingLanes,(i&261930)!==0&&(c&42)!==0?t===Gu?as++:(as=0,Gu=t):(as=0,Gu=null),ls(0)}}function vg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,$r(t)))}function Ku(){return Qi!==null&&(Qi.skipTransition(),Qi=null),Df(),Mf(),Rf(),Uf()}function Uf(){if(St!==5)return!1;var e=sa,t=Tf;Tf=0;var n=il(Ta),i=oe.T,r=pe.p;try{pe.p=32>n?32:n,oe.T=null,n=Af,Af=null;var c=sa,h=Ta;if(St=0,fi=sa=null,Ta=0,(tt&6)!==0)throw Error(s(331));var b=tt;if(tt|=4,ng(c.current),Wp(c,c.current,h,n),tt=b,ls(0,!1),nn&&typeof nn.onPostCommitFiberRoot=="function")try{nn.onPostCommitFiberRoot(va,c)}catch{}return!0}finally{pe.p=r,oe.T=i,vg(e,t)}}function yg(e,t,n){t=Xn(n,t),t=Pc(e.stateNode,t,2),e=vl(e,t,2),e!==null&&(Yl(e,2),Aa(e))}function lt(e,t,n){if(e.tag===3)yg(e,e,n);else for(;t!==null;){if(t.tag===3){yg(t,e,n);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(wl===null||!wl.has(i))){e=Xn(n,e),n=mp(2),i=vl(t,n,2),i!==null&&(pp(n,i,t,e),Yl(i,2),Aa(i));break}}t=t.return}}function Zf(e,t,n){var i=e.pingCache;if(i===null){i=e.pingCache=new fx;var r=new Set;i.set(t,r)}else r=i.get(t),r===void 0&&(r=new Set,i.set(t,r));r.has(n)||(Cf=!0,r.add(n),e=bx.bind(null,e,t,n),t.then(e,e))}function bx(e,t,n){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ct===e&&(Xe&n)===n&&((Nt===4||Nt===3&&(Xe&62914560)===Xe&&300>Ht()-qu)&&(tt&2)===0?Ji(e,0):Lu|=n,Xi===Xe&&(Xi=0)),Aa(e)}function bg(e,t){t===0&&(t=xi()),e=Kl(e,t),e!==null&&(Yl(e,t),Aa(e))}function xx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),bg(e,n)}function Sx(e,t){var n=0;switch(e.tag){case 31:case 13:var i=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(s(314))}i!==null&&i.delete(t),bg(e,n)}function jx(e,t){return ga(e,t)}var Wi=null,er=null,$f=!1,Iu=!1,Bf=!1,Cl=0;function Aa(e){e!==er&&e.next===null&&(er===null?Wi=er=e:er=er.next=e),Iu=!0,$f||($f=!0,zx())}function ls(e,t){if(!Bf&&Iu){Bf=!0;do for(var n=!1,i=Wi;i!==null;){if(e!==0){var r=i.pendingLanes;if(r===0)var c=0;else{var h=i.suspendedLanes,b=i.pingedLanes;c=(1<<31-kt(42|e)+1)-1,c&=r&~(h&~b),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(n=!0,_g(i,c))}else c=Xe,c=ql(i,i===ct?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(c&3)===0||Ua(i,c)||(n=!0,_g(i,c));i=i.next}while(n);Bf=!1}}function _x(){xg()}function xg(){Iu=$f=!1;var e=0;Cl!==0&&Rx()&&(e=Cl);for(var t=Ht(),n=null,i=Wi;i!==null;){var r=i.next,c=Sg(i,t);c===0?(i.next=null,n===null?Wi=r:n.next=r,r===null&&(er=n)):(n=i,(e!==0||(c&3)!==0)&&(Iu=!0)),i=r}St!==0&&St!==5||ls(e),Cl!==0&&(Cl=0)}function Sg(e,t){for(var n=e.suspendedLanes,i=e.pingedLanes,r=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var h=31-kt(c),b=1<<h,N=r[h];N===-1?((b&n)===0||(b&i)!==0)&&(r[h]=$s(b,t)):N<=t&&(e.expiredLanes|=b),c&=~b}if(t=ct,n=Xe,n=ql(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,n===0||e===t&&(at===2||at===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&un(i),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Ua(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(i!==null&&un(i),il(n)){case 2:case 8:n=Ue;break;case 32:n=_t;break;case 268435456:n=Us;break;default:n=_t}return i=jg.bind(null,e),n=ga(n,i),e.callbackPriority=t,e.callbackNode=n,t}return i!==null&&i!==null&&un(i),e.callbackPriority=2,e.callbackNode=null,2}function jg(e,t){if(St!==0&&St!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ku()&&e.callbackNode!==n)return null;var i=Xe;return i=ql(e,e===ct?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(sg(e,i,t),Sg(e,Ht()),e.callbackNode!=null&&e.callbackNode===n?jg.bind(null,e):null)}function _g(e,t){if(Ku())return null;sg(e,t,!0)}function zx(){Zx(function(){(tt&6)!==0?ga(ot,_x):xg()})}function Hf(){if(Cl===0){var e=ti;e===0&&(e=Vn,Vn<<=1,(Vn&261888)===0&&(Vn=256)),Cl=e}return Cl}function zg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Xs(e)}function wx(e,t,n,i,r){if(t==="submit"&&n&&n.stateNode===r){var c=zg((r[an]||null).action),h=i.submitter;h&&(t=(t=h[an]||null)?zg(t.formAction):h.getAttribute("formAction"),t!==null&&(c=t,h=null));var b=new Is("action","action",null,i,r);e.push({event:b,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Cl!==0){var N=new FormData(r,h);Qc(n,{pending:!0,data:N,method:r.method,action:c},null,N)}}else typeof c=="function"&&(b.preventDefault(),N=new FormData(r,h),Qc(n,{pending:!0,data:N,method:r.method,action:c},c,N))},currentTarget:r}]})}}for(var Lf=0;Lf<fc.length;Lf++){var qf=fc[Lf],Nx=qf.toLowerCase(),Cx=qf[0].toUpperCase()+qf.slice(1);aa(Nx,"on"+Cx)}aa(Ih,"onAnimationEnd"),aa(Jh,"onAnimationIteration"),aa(Ph,"onAnimationStart"),aa("dblclick","onDoubleClick"),aa("focusin","onFocus"),aa("focusout","onBlur"),aa(U1,"onTransitionRun"),aa(Z1,"onTransitionStart"),aa($1,"onTransitionCancel"),aa(Wh,"onTransitionEnd"),Ba("onMouseEnter",["mouseout","mouseover"]),Ba("onMouseLeave",["mouseout","mouseover"]),Ba("onPointerEnter",["pointerout","pointerover"]),Ba("onPointerLeave",["pointerout","pointerover"]),ba("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ba("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ba("onBeforeInput",["compositionend","keypress","textInput","paste"]),ba("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ba("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ba("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var is="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(" "),Ex=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(is));function wg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var i=e[n],r=i.event;i=i.listeners;e:{var c=void 0;if(t)for(var h=i.length-1;0<=h;h--){var b=i[h],N=b.instance,R=b.currentTarget;if(b=b.listener,N!==c&&r.isPropagationStopped())break e;c=b,r.currentTarget=R;try{c(r)}catch(L){Ws(L)}r.currentTarget=null,c=N}else for(h=0;h<i.length;h++){if(b=i[h],N=b.instance,R=b.currentTarget,b=b.listener,N!==c&&r.isPropagationStopped())break e;c=b,r.currentTarget=R;try{c(r)}catch(L){Ws(L)}r.currentTarget=null,c=N}}}}function Ye(e,t){var n=t[Vl];n===void 0&&(n=t[Vl]=new Set);var i=e+"__bubble";n.has(i)||(Ng(t,e,2,!1),n.add(i))}function Yf(e,t,n){var i=0;t&&(i|=4),Ng(n,e,i,t)}var Ju="_reactListening"+Math.random().toString(36).slice(2);function Vf(e){if(!e[Ju]){e[Ju]=!0,Sr.forEach(function(n){n!=="selectionchange"&&(Ex.has(n)||Yf(n,!1,e),Yf(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ju]||(t[Ju]=!0,Yf("selectionchange",!1,t))}}function Ng(e,t,n,i){switch(pv(t)){case 2:var r=xS;break;case 8:r=SS;break;default:r=cd}n=r.bind(null,t,n,e),r=void 0,!Jo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),i?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function Gf(e,t,n,i,r){var c=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var h=i.tag;if(h===3||h===4){var b=i.stateNode.containerInfo;if(b===r)break;if(h===4)for(h=i.return;h!==null;){var N=h.tag;if((N===3||N===4)&&h.stateNode.containerInfo===r)return;h=h.return}for(;b!==null;){if(h=ln(b),h===null)return;if(N=h.tag,N===5||N===6||N===26||N===27){i=c=h;continue e}b=b.parentNode}}i=i.return}Nh(function(){var R=c,L=Ko(n),P=[];e:{var D=em.get(e);if(D!==void 0){var H=Is,me=e;switch(e){case"keypress":if(Fs(n)===0)break e;case"keydown":case"keyup":H=d1;break;case"focusin":me="focus",H=tc;break;case"focusout":me="blur",H=tc;break;case"beforeblur":case"afterblur":H=tc;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":H=Th;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":H=e1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":H=v1;break;case Ih:case Jh:case Ph:H=a1;break;case Wh:H=b1;break;case"scroll":case"scrollend":H=Pb;break;case"wheel":H=S1;break;case"copy":case"cut":case"paste":H=i1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":H=Oh;break;case"submit":H=p1;break;case"toggle":case"beforetoggle":H=_1}var we=(t&4)!==0,$e=!we&&(e==="scroll"||e==="scrollend"),M=we?D!==null?D+"Capture":null:D;we=[];for(var O=R,$;O!==null;){var J=O;if($=J.stateNode,J=J.tag,J!==5&&J!==26&&J!==27||$===null||M===null||(J=Cr(O,M),J!=null&&we.push(rs(O,J,$))),$e)break;O=O.return}0<we.length&&(D=new H(D,me,null,n,L),P.push({event:D,listeners:we}))}}if((t&7)===0){e:{if(H=e==="mouseover"||e==="pointerover",D=e==="mouseout"||e==="pointerout",H&&n!==Fo&&(me=n.relatedTarget||n.fromElement)&&(ln(me)||me[Za]))break e;(D||H)&&(me=L.window===L?L:(H=L.ownerDocument)?H.defaultView||H.parentWindow:window,D?(H=n.relatedTarget||n.toElement,D=R,H=H?ln(H):null,H!==null&&($e=d(H),we=H.tag,H!==$e||we!==5&&we!==27&&we!==6)&&(H=null)):(D=null,H=R),D!==H&&(we=Th,J="onMouseLeave",M="onMouseEnter",O="mouse",(e==="pointerout"||e==="pointerover")&&(we=Oh,J="onPointerLeave",M="onPointerEnter",O="pointer"),$e=D==null?me:Xl(D),$=H==null?me:Xl(H),me=new we(J,O+"leave",D,n,L),me.target=$e,me.relatedTarget=$,J=null,ln(L)===R&&(we=new we(M,O+"enter",H,n,L),we.target=$,we.relatedTarget=$e,J=we),$e=J,we=D&&H?I(D,H,Tx):null,D!==null&&Cg(P,me,D,we,!1),H!==null&&$e!==null&&Cg(P,$e,H,we,!0)))}e:{if(D=R?Xl(R):window,H=D.nodeName&&D.nodeName.toLowerCase(),H==="select"||H==="input"&&D.type==="file")var be=Bh;else if(Zh(D))if(Hh)be=D1;else{be=O1;var Qe=A1}else H=D.nodeName,!H||H.toLowerCase()!=="input"||D.type!=="checkbox"&&D.type!=="radio"?R&&Qo(R.elementType)&&(be=Bh):be=k1;if(be&&(be=be(e,R))){$h(P,be,n,L);break e}Qe&&Qe(e,D,R)}switch(Qe=R?Xl(R):window,e){case"focusin":(Zh(Qe)||Qe.contentEditable==="true")&&(Ei=Qe,uc=R,Rr=null);break;case"focusout":Rr=uc=Ei=null;break;case"mousedown":oc=!0;break;case"contextmenu":case"mouseup":case"dragend":oc=!1,Fh(P,n,L);break;case"selectionchange":if(R1)break;case"keydown":case"keyup":Fh(P,n,L)}var Ce;if(ac)e:{switch(e){case"compositionstart":var Oe="onCompositionStart";break e;case"compositionend":Oe="onCompositionEnd";break e;case"compositionupdate":Oe="onCompositionUpdate";break e}Oe=void 0}else Ci?Rh(e,n)&&(Oe="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Oe="onCompositionStart");Oe&&(kh&&n.locale!=="ko"&&(Ci||Oe!=="onCompositionStart"?Oe==="onCompositionEnd"&&Ci&&(Ce=Ch()):(ul=L,Po="value"in ul?ul.value:ul.textContent,Ci=!0)),Qe=Pu(R,Oe),0<Qe.length&&(Oe=new Ah(Oe,e,null,n,L),P.push({event:Oe,listeners:Qe}),Ce?Oe.data=Ce:(Ce=Uh(n),Ce!==null&&(Oe.data=Ce)))),(Ce=w1?N1(e,n):C1(e,n))&&(Oe=Pu(R,"onBeforeInput"),0<Oe.length&&(Qe=new Ah("onBeforeInput","beforeinput",null,n,L),P.push({event:Qe,listeners:Oe}),Qe.data=Ce)),wx(P,e,R,n,L)}wg(P,t)})}function rs(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Pu(e,t){for(var n=t+"Capture",i=[];e!==null;){var r=e,c=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||c===null||(r=Cr(e,n),r!=null&&i.unshift(rs(e,r,c)),r=Cr(e,t),r!=null&&i.push(rs(e,r,c))),e.tag===3)return i;e=e.return}return[]}function Tx(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Cg(e,t,n,i,r){for(var c=t._reactName,h=[];n!==null&&n!==i;){var b=n,N=b.alternate,R=b.stateNode;if(b=b.tag,N!==null&&N===i)break;b!==5&&b!==26&&b!==27||R===null||(N=R,r?(R=Cr(n,c),R!=null&&h.unshift(rs(n,R,N))):r||(R=Cr(n,c),R!=null&&h.push(rs(n,R,N)))),n=n.return}h.length!==0&&e.push({event:t,listeners:h})}var Ax=/\r\n?/g,Ox=/\u0000|\uFFFD/g;function Eg(e){return(typeof e=="string"?e:""+e).replace(Ax,`
|
|
49
|
+
`).replace(Ox,"")}function Tg(e,t){return t=Eg(t),Eg(e)===t}function it(e,t,n,i,r,c){switch(n){case"children":if(typeof i=="string")t==="body"||t==="textarea"&&i===""||Ke(e,i);else if(typeof i=="number"||typeof i=="bigint")t!=="body"&&Ke(e,""+i);else return;break;case"className":q(e,"class",i);break;case"tabIndex":q(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":q(e,n,i);break;case"style":zi(e,i,c);return;case"data":if(t!=="object"){q(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=Xs(i),e.setAttribute(n,i);break;case"action":case"formAction":if(typeof i=="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}else typeof c=="function"&&(n==="formAction"?(t!=="input"&&it(e,t,"name",r.name,r,null),it(e,t,"formEncType",r.formEncType,r,null),it(e,t,"formMethod",r.formMethod,r,null),it(e,t,"formTarget",r.formTarget,r,null)):(it(e,t,"encType",r.encType,r,null),it(e,t,"method",r.method,r,null),it(e,t,"target",r.target,r,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(n);break}i=Xs(i),e.setAttribute(n,i);break;case"onClick":i!=null&&(e.onclick=xa);return;case"onScroll":i!=null&&Ye("scroll",e);return;case"onScrollEnd":i!=null&&Ye("scrollend",e);return;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(s(60));(c!=null?c.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}n=Xs(i),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":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,i):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":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":i===!0?e.setAttribute(n,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(n,i):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(n,i):e.removeAttribute(n);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(n):e.setAttribute(n,i);break;case"popover":Ye("beforetoggle",e),Ye("toggle",e),K(e,"popover",i);break;case"xlinkActuate":De(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":De(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":De(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":De(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":De(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":De(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":De(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":De(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":De(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":K(e,"is",i);break;case"innerText":case"textContent":return;default:if(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")n=Ib.get(n)||n,K(e,n,i);else return}Fe=!0}function Xf(e,t,n,i,r,c){switch(n){case"style":zi(e,i,c);return;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(n=i.__html,n!=null){if(r.children!=null)throw Error(s(60));(c!=null?c.__html:void 0)!==n&&(e.innerHTML=n)}}break;case"children":if(typeof i=="string")Ke(e,i);else if(typeof i=="number"||typeof i=="bigint")Ke(e,""+i);else return;break;case"onScroll":i!=null&&Ye("scroll",e);return;case"onScrollEnd":i!=null&&Ye("scrollend",e);return;case"onClick":i!=null&&(e.onclick=xa);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!jr.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(r=n.endsWith("Capture"),c=n.slice(2,r?n.length-7:void 0),t=e[an]||null,t=t!=null?t[n]:null,typeof t=="function"&&e.removeEventListener(c,t,r),typeof i=="function")){typeof t!="function"&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(c,i,r);break e}Fe=!0,n in e?e[n]=i:i===!0?e.setAttribute(n,""):K(e,n,i)}return}Fe=!0}function It(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ye("error",e),Ye("load",e);var i=!1,r=!1,c;for(c in n)if(n.hasOwnProperty(c)){var h=n[c];if(h!=null)switch(c){case"src":i=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:it(e,t,c,h,n,null)}}r&&it(e,t,"srcSet",n.srcSet,n,null),i&&it(e,t,"src",n.src,n,null);return;case"input":Ye("invalid",e);var b=c=h=r=null,N=null,R=null;for(i in n)if(n.hasOwnProperty(i)){var L=n[i];if(L!=null)switch(i){case"name":r=L;break;case"type":h=L;break;case"checked":N=L;break;case"defaultChecked":R=L;break;case"value":c=L;break;case"defaultValue":b=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(s(137,t));break;default:it(e,t,i,L,n,null)}}wr(e,c,b,N,R,h,r,!1);return;case"select":Ye("invalid",e),i=h=c=null;for(r in n)if(n.hasOwnProperty(r)&&(b=n[r],b!=null))switch(r){case"value":c=b;break;case"defaultValue":h=b;break;case"multiple":i=b;default:it(e,t,r,b,n,null)}t=c,n=h,e.multiple=!!i,t!=null?ge(e,!!i,t,!1):n!=null&&ge(e,!!i,n,!0);return;case"textarea":Ye("invalid",e),c=r=i=null;for(h in n)if(n.hasOwnProperty(h)&&(b=n[h],b!=null))switch(h){case"value":i=b;break;case"defaultValue":r=b;break;case"children":c=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(s(91));break;default:it(e,t,h,b,n,null)}We(e,i,r,c);return;case"option":for(N in n)if(n.hasOwnProperty(N)&&(i=n[N],i!=null))switch(N){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:it(e,t,N,i,n,null)}return;case"dialog":Ye("beforetoggle",e),Ye("toggle",e),Ye("cancel",e),Ye("close",e);break;case"iframe":case"object":Ye("load",e);break;case"video":case"audio":for(i=0;i<is.length;i++)Ye(is[i],e);break;case"image":Ye("error",e),Ye("load",e);break;case"details":Ye("toggle",e);break;case"embed":case"source":case"link":Ye("error",e),Ye("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(R in n)if(n.hasOwnProperty(R)&&(i=n[R],i!=null))switch(R){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:it(e,t,R,i,n,null)}return;default:if(Qo(t)){for(L in n)n.hasOwnProperty(L)&&(i=n[L],i!==void 0&&Xf(e,t,L,i,n,void 0));return}}for(b in n)n.hasOwnProperty(b)&&(i=n[b],i!=null&&it(e,t,b,i,n,null))}var kx={};function Dx(e,t,n,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,c=null,h=null,b=null,N=null,R=null,L=null;for(H in n){var P=n[H];if(n.hasOwnProperty(H)&&P!=null)switch(H){case"checked":break;case"value":break;case"defaultValue":N=P;default:i.hasOwnProperty(H)||it(e,t,H,null,i,P)}}for(var D in i){var H=i[D];if(P=n[D],i.hasOwnProperty(D)&&(H!=null||P!=null))switch(D){case"type":H!==P&&(Fe=!0),c=H;break;case"name":H!==P&&(Fe=!0),r=H;break;case"checked":H!==P&&(Fe=!0),R=H;break;case"defaultChecked":H!==P&&(Fe=!0),L=H;break;case"value":H!==P&&(Fe=!0),h=H;break;case"defaultValue":H!==P&&(Fe=!0),b=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(s(137,t));break;default:H!==P&&it(e,t,D,H,i,P)}}_i(e,h,b,N,R,L,c,r);return;case"select":H=h=b=D=null;for(c in n)if(N=n[c],n.hasOwnProperty(c)&&N!=null)switch(c){case"value":break;case"multiple":H=N;default:i.hasOwnProperty(c)||it(e,t,c,null,i,N)}for(r in i)if(c=i[r],N=n[r],i.hasOwnProperty(r)&&(c!=null||N!=null))switch(r){case"value":c!==N&&(Fe=!0),D=c;break;case"defaultValue":c!==N&&(Fe=!0),b=c;break;case"multiple":c!==N&&(Fe=!0),h=c;default:c!==N&&it(e,t,r,c,i,N)}t=b,n=h,i=H,D!=null?ge(e,!!n,D,!1):!!i!=!!n&&(t!=null?ge(e,!!n,t,!0):ge(e,!!n,n?[]:"",!1));return;case"textarea":H=D=null;for(b in n)if(r=n[b],n.hasOwnProperty(b)&&r!=null&&!i.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:it(e,t,b,null,i,r)}for(h in i)if(r=i[h],c=n[h],i.hasOwnProperty(h)&&(r!=null||c!=null))switch(h){case"value":r!==c&&(Fe=!0),D=r;break;case"defaultValue":r!==c&&(Fe=!0),H=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(s(91));break;default:r!==c&&it(e,t,h,r,i,c)}et(e,D,H);return;case"option":for(var me in n)if(D=n[me],n.hasOwnProperty(me)&&D!=null&&!i.hasOwnProperty(me))switch(me){case"selected":e.selected=!1;break;default:it(e,t,me,null,i,D)}for(N in i)if(D=i[N],H=n[N],i.hasOwnProperty(N)&&D!==H&&(D!=null||H!=null))switch(N){case"selected":D!==H&&(Fe=!0),e.selected=D&&typeof D!="function"&&typeof D!="symbol";break;default:it(e,t,N,D,i,H)}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 we in n)D=n[we],n.hasOwnProperty(we)&&D!=null&&!i.hasOwnProperty(we)&&it(e,t,we,null,i,D);for(R in i)if(D=i[R],H=n[R],i.hasOwnProperty(R)&&D!==H&&(D!=null||H!=null))switch(R){case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(s(137,t));break;default:it(e,t,R,D,i,H)}return;default:if(Qo(t)){for(var $e in n)D=n[$e],n.hasOwnProperty($e)&&D!==void 0&&!i.hasOwnProperty($e)&&Xf(e,t,$e,void 0,i,D);for(L in i)D=i[L],H=n[L],!i.hasOwnProperty(L)||D===H||D===void 0&&H===void 0||Xf(e,t,L,D,i,H);return}}for(var M in n)D=n[M],n.hasOwnProperty(M)&&D!=null&&!i.hasOwnProperty(M)&&it(e,t,M,null,i,D);for(P in i)D=i[P],H=n[P],!i.hasOwnProperty(P)||D===H||D==null&&H==null||it(e,t,P,D,i,H)}function Ag(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Mx(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),i=0;i<n.length;i++){var r=n[i],c=r.transferSize,h=r.initiatorType,b=r.duration;if(c&&b&&Ag(h)){for(h=0,b=r.responseEnd,i+=1;i<n.length;i++){var N=n[i],R=N.startTime;if(R>b)break;var L=N.transferSize,P=N.initiatorType;L&&Ag(P)&&(N=N.responseEnd,h+=L*(N<b?1:(b-R)/(N-R)))}if(--i,t+=8*(c+h)/(r.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 Qf=null,Ff=null;function ss(e){return e.nodeType===9?e:e.ownerDocument}function Og(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 kg(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 Dg(e,t,n,i){return n=ss(n).createElement(e),n[zt]=i,n[an]=t,It(n,e,t),Tt(n),n}function Kf(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 If=null;function Rx(){var e=window.event;return e&&e.type==="popstate"?e===If?!1:(If=e,!0):(If=null,!1)}var Jf=typeof setTimeout=="function"?setTimeout:void 0,Ux=typeof clearTimeout=="function"?clearTimeout:void 0,Mg=typeof Promise=="function"?Promise:void 0,Rg=typeof requestAnimationFrame=="function"?requestAnimationFrame:Jf,Zx=typeof queueMicrotask=="function"?queueMicrotask:typeof Mg<"u"?function(e){return Mg.resolve(null).then(e).catch($x)}:Jf;function $x(e){setTimeout(function(){throw e})}function El(e){return e==="head"}function Ug(e,t){var n=t,i=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"||n==="/&"){if(i===0){e.removeChild(r),sr(t);return}i--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")i++;else if(n==="html")id(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,id(n);for(var c=n.firstChild;c;){var h=c.nextSibling,b=c.nodeName;c[ya]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&c.rel.toLowerCase()==="stylesheet"||n.removeChild(c),c=h}}else n==="body"&&id(e.ownerDocument.body);n=r}while(n);sr(t)}function Zg(e,t){var n=e;e=0;do{var i=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||""),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=i}while(n)}function $g(e,t,n){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display==="inline"){if(t=e.getClientRects(),t.length===1)var i=1;else for(var r=i=0;r<t.length;r++){var c=t[r];0<c.width&&0<c.height&&i++}i===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+n.paddingTop,e.marginBottom="-"+n.paddingBottom)}}function Bg(e,t){e=e.style,t=t.style;var n=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=n==null||typeof n=="boolean"?"":(""+n).trim(),n=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null: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?e.margin=n:(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)))}function Bx(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 Pf(e){var t=e.getBoundingClientRect(),n=getComputedStyle(e);return Bx(t,n,e)}function Hx(e){return e.documentElement.clientHeight}function Lx(e){this.addEventListener("load",e),this.addEventListener("error",e)}function qx(e,t,n,i,r,c,h,b,N){var R=t.nodeType===9?t:t.ownerDocument;try{var L=R.startViewTransition({update:function(){var D=R.defaultView,H=D.navigation&&D.navigation.transition,me=R.fonts.status;i();var we=[];if(me==="loaded"&&(Hx(R),R.fonts.status==="loading"&&we.push(R.fonts.ready)),me=we.length,e!==null)for(var $e=e.suspenseyImages,M=0,O=0;O<$e.length;O++){var $=$e[O];if(!$.complete){var J=$.getBoundingClientRect();if(0<J.bottom&&0<J.right&&J.top<D.innerHeight&&J.left<D.innerWidth){if(M+=rv($),M>to){we.length=me;break}$=new Promise(Lx.bind($)),we.push($)}}}if(0<we.length)return D=Promise.race([Promise.all(we),new Promise(function(be){return setTimeout(be,500)})]).then(r,r),(H?Promise.allSettled([H.finished,D]):D).then(c,c);if(r(),H)return H.finished.then(c,c);c()},types:n});R.__reactViewTransition=L;var P=[];return L.ready.then(function(){for(var D=R.documentElement.getAnimations({subtree:!0}),H=0;H<D.length;H++){var me=D[H],we=me.effect,$e=we.pseudoElement;if($e!=null&&$e.startsWith("::view-transition")){P.push(me),me=we.getKeyframes();for(var M=$e=void 0,O=!0,$=0;$<me.length;$++){var J=me[$],be=J.width;if($e===void 0)$e=be;else if($e!==be){O=!1;break}if(be=J.height,M===void 0)M=be;else if(M!==be){O=!1;break}delete J.width,delete J.height,J.transform==="none"&&delete J.transform}O&&$e!==void 0&&M!==void 0&&(we.setKeyframes(me),O=getComputedStyle(we.target,we.pseudoElement),O.width!==$e||O.height!==M)&&(O=me[0],O.width=$e,O.height=M,O=me[me.length-1],O.width=$e,O.height=M,we.setKeyframes(me))}}h()},function(D){R.__reactViewTransition===L&&(R.__reactViewTransition=null);try{if(typeof D=="object"&&D!==null)switch(D.name){case"InvalidStateError":(D.message==="View transition was skipped because document visibility state is hidden."||D.message==="Skipping view transition because document visibility state has become hidden."||D.message==="Skipping view transition because viewport size changed."||D.message==="Transition was aborted because of invalid state")&&(D=null)}D!==null&&N(D)}finally{i(),r(),h()}}),L.finished.finally(function(){for(var D=0;D<P.length;D++)P[D].cancel();R.__reactViewTransition===L&&(R.__reactViewTransition=null),b()}),L}catch{return i(),r(),h(),null}}function di(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}di.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:Q({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},di.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),i=[],r=0;r<n.length;r++){var c=n[r].effect;c!==null&&c.target===e&&c.pseudoElement===t&&i.push(n[r])}return i},di.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Hg(e){return{name:e,group:new di("group",e),imagePair:new di("image-pair",e),old:new di("old",e),new:new di("new",e)}}function Un(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Un.prototype.addEventListener=function(e,t,n){var i=null,r=null;if(!(n!=null&&typeof n!="boolean"&&(i=n.signal||null,i!==null&&i.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var c=this._eventListeners;if(qg(c,e,t,n)===-1){var h=this,b=t;n!=null&&typeof n!="boolean"&&n.once===!0&&(b=function(N){h.removeEventListener(e,t,n),typeof t=="function"?t.call(this,N):t.handleEvent(N)}),i!==null&&(r=h.removeEventListener.bind(h,e,t,n),i.addEventListener("abort",r,{once:!0}),r=i.removeEventListener.bind(i,"abort",r)),i=tr(n),c.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:b,cleanup:r}),v(this._fragmentFiber.child,!1,Yx,e,b,i)}this._eventListeners=c}};function Yx(e,t,n,i){return A(e).addEventListener(t,n,i),!1}Un.prototype.removeEventListener=function(e,t,n){var i=this._eventListeners;if(i!==null&&(t=qg(i,e,t,n),t!==-1)){var r=i[t];n=r.attachedListener;var c=r.cleanup;r=tr(r.optionsOrUseCapture),v(this._fragmentFiber.child,!1,Vx,e,n,r),i.splice(t,1),c!==null&&c()}};function Vx(e,t,n,i){return A(e).removeEventListener(t,n,i),!1}function tr(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Lg(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function qg(e,t,n,i){if(e.length===0)return-1;i=Lg(i);for(var r=0;r<e.length;r++){var c=e[r];if(c.type===t&&c.listener===n&&Lg(c.optionsOrUseCapture)===i)return r}return-1}Un.prototype.dispatchEvent=function(e){var t=j(this._fragmentFiber);if(t===null)return!0;t=A(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var i=t.nodeType===9?t.createComment(""):document.createTextNode("");if(n)for(var r=0;r<n.length;r++){var c=n[r];i.addEventListener(c.type,c.attachedListener,tr(c.optionsOrUseCapture))}if(t.appendChild(i),e=i.dispatchEvent(e),n)for(r=0;r<n.length;r++)c=n[r],i.removeEventListener(c.type,c.attachedListener,tr(c.optionsOrUseCapture));return t.removeChild(i),e}return t.dispatchEvent(e)},Un.prototype.focus=function(e){v(this._fragmentFiber.child,!0,Yg,e,void 0,void 0)};function Yg(e,t){return e.tag===6?!1:(e=A(e),nS(e,t))}Un.prototype.focusLast=function(e){var t=[];v(this._fragmentFiber.child,!0,Wf,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Yg(t[n],e);n--);};function Wf(e,t){return t.push(e),!1}Un.prototype.blur=function(){var e=j(this._fragmentFiber);e!==null&&(e=A(e),e=ss(e).activeElement,e!==null&&v(this._fragmentFiber.child,!1,Gx,e,void 0,void 0))};function Gx(e,t){return e.tag===6?!1:(e=A(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Un.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),v(this._fragmentFiber.child,!1,Xx,e,void 0,void 0)};function Xx(e,t){return e.tag===6||(e=A(e),t.observe(e)),!1}Un.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),v(this._fragmentFiber.child,!1,Qx,e,void 0,void 0);for(var n=t=0;n<ua.length;n++){var i=ua[n];i.fragmentInstance===this&&i.observer===e?e.unobserve(i.instance):ua[t++]=i}ua.length=t}};function Qx(e,t){return e.tag===6||(e=A(e),t.unobserve(e)),!1}var ua=[],ed=!1;function Fx(e,t,n){ua.push({fragmentInstance:e,observer:t,instance:n}),ed||(ed=!0,aS(function(){ed=!1;var i=ua;ua=[];for(var r=0;r<i.length;r++){var c=i[r];c.observer.unobserve(c.instance)}}))}Un.prototype.getClientRects=function(){var e=[];return v(this._fragmentFiber.child,!1,Kx,e,void 0,void 0),e};function Kx(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=A(e),t.push.apply(t,e.getClientRects());return!1}Un.prototype.getRootNode=function(e){var t=j(this._fragmentFiber);return t===null?this:A(t).getRootNode(e)},Un.prototype.compareDocumentPosition=function(e){var t=j(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];v(this._fragmentFiber.child,!1,Wf,n,void 0,void 0);var i=A(t);if(n.length===0){if(n=i,w(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var r=i=n.compareDocumentPosition(e);return n===e?r=Node.DOCUMENT_POSITION_CONTAINS:i&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=E(t)[1],n===null?r=Node.DOCUMENT_POSITION_PRECEDING:(e=A(n).compareDocumentPosition(e),r=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),r|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=A(n[0]),r=A(n[n.length-1]);var c=w(this._fragmentFiber)?t.parentElement:i;if(c==null)return Node.DOCUMENT_POSITION_DISCONNECTED;i=c.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,c=c.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_CONTAINED_BY;var h=t.compareDocumentPosition(e),b=r.compareDocumentPosition(e),N=h&Node.DOCUMENT_POSITION_CONTAINED_BY||b&Node.DOCUMENT_POSITION_CONTAINED_BY;return b=i&&c&&h&Node.DOCUMENT_POSITION_FOLLOWING&&b&Node.DOCUMENT_POSITION_PRECEDING,t=i&&t===e||c&&r===e||N||b?Node.DOCUMENT_POSITION_CONTAINED_BY:!i&&t===e||!c&&r===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:h,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Ix(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Ix(e,t,n,i,r){var c=ln(r);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!c)e:{for(;c!==null;){if(c.tag===7&&(c===t||c.alternate===t)){n=!0;break e}c=c.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(c===null)return c=r.ownerDocument,r===c||r===c.documentElement||r===c.body;e:{for(c=t,t=j(t);c!==null;){if(!(c.tag!==5&&c.tag!==3&&c.tag!==27||c!==t&&c.alternate!==t)){c=!0;break e}c=c.return}c=!1}return c}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!c)&&!(t=c===n)&&(t=I(n,c,ue),t===null?t=!1:(v(t,!0,ye,c,n),c=Z,Z=null,t=c!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!c)&&!(t=c===i)&&(t=I(i,c,ue),t===null?t=!1:(v(t,!0,te,c,i),c=Z,Y=Z=null,t=c!==null)),t):!1}function Vg(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)}Un.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(s(566));var t=[];v(this._fragmentFiber.child,!1,Wf,t,void 0,void 0);var n=e!==!1;if(t.length===0){var i=E(this._fragmentFiber);if(i=n?i[1]||i[0]||j(this._fragmentFiber):i[0]||i[1],i===null)return;if(i.tag===6){e=A(i),Vg(e,n);return}if(i=A(i),i.nodeType!==9){if(i.nodeType===11){n="host"in i?i.host:null,n!==null&&n.scrollIntoView(e);return}i.scrollIntoView(e)}}for(i=n?t.length-1:0;i!==(n?-1:t.length);){var r=t[i];r.tag===6?(r=A(r),Vg(r,n)):A(r).scrollIntoView(e),i+=n?-1:1}};function Jx(e,t){return e=A(e),Gg(e,t),!1}function Gg(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function Xg(e,t){var n=t._eventListeners;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i];e.addEventListener(r.type,r.attachedListener,tr(r.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(c){for(var h=0,b=0;b<ua.length;b++){var N=ua[b];(N.fragmentInstance!==t||N.observer!==c||N.instance!==e)&&(ua[h++]=N)}ua.length=h,c.observe(e)}),Gg(e,t))}function Px(e,t){var n=t._eventListeners;if(n!==null)for(var i=0;i<n.length;i++){var r=n[i];e.removeEventListener(r.type,r.attachedListener,tr(r.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(c){typeof c.rootMargin=="string"?Fx(t,c,e):c.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function td(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":td(n),$a(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Wx(e,t,n,i){for(;e.nodeType===1;){var r=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[ya])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=Jn(e.nextSibling),e===null)break}return null}function eS(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Jn(e.nextSibling),e===null))return null;return e}function Qg(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Jn(e.nextSibling),e===null))return null;return e}function nd(e){return e.data==="$?"||e.data==="$~"}function ad(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function tS(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var i=function(){t(),n.removeEventListener("DOMContentLoaded",i)};n.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function Jn(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 ld=null;function Fg(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Jn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Kg(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 nS(e,t){function n(){i=!0}if(e.ownerDocument.activeElement===e)return!0;var i=!1;try{e.ownerDocument.addEventListener("focus",n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",n,!0)}return i}function aS(e){Rg(function(){Rg(function(t){return e(t)})})}function Ig(e,t,n){switch(t=ss(n),e){case"html":if(e=t.documentElement,!e)throw Error(s(452));return e;case"head":if(e=t.head,!e)throw Error(s(453));return e;case"body":if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function Jg(e,t,n){for(var i in n){var r=n[i];n.hasOwnProperty(i)&&r!=null&&it(e,t,i,null,kx,r)}n.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===xa&&(e.onclick=null),$a(e)}function id(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);$a(e)}var Pn=new Map,Pg=new Set;function us(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 Pa=pe.d;pe.d={f:lS,r:iS,D:rS,C:sS,L:uS,m:oS,X:fS,S:cS,M:dS};function lS(){var e=Pa.f(),t=Xu();return e||t}function iS(e){var t=na(e);t!==null&&t.tag===5&&t.type==="form"?ep(t):Pa.r(e)}var nr=typeof document>"u"?null:document;function Wg(e,t,n){var i=nr;if(i&&typeof t=="string"&&t){var r=dn(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof n=="string"&&(r+='[crossorigin="'+n+'"]'),Pg.has(r)||(Pg.add(r),e={rel:e,crossOrigin:n,href:t},i.querySelector(r)===null&&(t=i.createElement("link"),It(t,"link",e),Tt(t),i.head.appendChild(t)))}}function rS(e){Pa.D(e),Wg("dns-prefetch",e,null)}function sS(e,t){Pa.C(e,t),Wg("preconnect",e,t)}function uS(e,t,n){Pa.L(e,t,n);var i=nr;if(i&&e&&t){var r='link[rel="preload"][as="'+dn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(r+='[imagesrcset="'+dn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(r+='[imagesizes="'+dn(n.imageSizes)+'"]')):r+='[href="'+dn(e)+'"]';var c=r;switch(t){case"style":c=ar(e);break;case"script":c=lr(e)}if(!(Pn.has(c)||(e=Q({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Pn.set(c,e),i.querySelector(r)!==null||t==="style"&&i.querySelector(os(c))||t==="script"&&i.querySelector(cs(c))))){var h=i.createElement("link");It(h,"link",e),t==="style"&&(h[Gl]=!0,h.onload=h.onerror=function(){xr(h)}),Tt(h),i.head.appendChild(h)}}}function oS(e,t){Pa.m(e,t);var n=nr;if(n&&e){var i=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+dn(i)+'"][href="'+dn(e)+'"]',c=r;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=lr(e)}if(!Pn.has(c)&&(e=Q({rel:"modulepreload",href:e},t),Pn.set(c,e),n.querySelector(r)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(cs(c)))return}i=n.createElement("link"),It(i,"link",e),Tt(i),n.head.appendChild(i)}}}function cS(e,t,n){Pa.S(e,t,n);var i=nr;if(i&&e){var r=rl(i).hoistableStyles,c=ar(e);t=t||"default";var h=r.get(c);if(!h){var b={loading:0,preload:null};if(h=i.querySelector(os(c)))b.loading=5;else{e=Q({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Pn.get(c))&&rd(e,n);var N=h=i.createElement("link");Tt(N),It(N,"link",e),N._p=new Promise(function(R,L){N.onload=R,N.onerror=L}),N.addEventListener("load",function(){b.loading|=1}),N.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Wu(h,t,i)}h={type:"stylesheet",instance:h,count:1,state:b},r.set(c,h)}}}function fS(e,t){Pa.X(e,t);var n=nr;if(n&&e){var i=rl(n).hoistableScripts,r=lr(e),c=i.get(r);c||(c=n.querySelector(cs(r)),c||(e=Q({src:e,async:!0},t),(t=Pn.get(r))&&sd(e,t),c=n.createElement("script"),Tt(c),It(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(r,c))}}function dS(e,t){Pa.M(e,t);var n=nr;if(n&&e){var i=rl(n).hoistableScripts,r=lr(e),c=i.get(r);c||(c=n.querySelector(cs(r)),c||(e=Q({src:e,async:!0,type:"module"},t),(t=Pn.get(r))&&sd(e,t),c=n.createElement("script"),Tt(c),It(c,"link",e),n.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(r,c))}}function ev(e,t,n,i){var r=(r=en.current)?us(r):null;if(!r)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(n=ar(n.href),t=rl(r).hoistableStyles,i=t.get(n),i||(i={type:"style",instance:null,count:0,state:null},t.set(n,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=ar(n.href);var c=rl(r).hoistableStyles,h=c.get(e);if(h||(r=r.ownerDocument||r,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,h),(c=r.querySelector(os(e)))?c._p||(h.instance=c,h.state.loading=5):(c=Pn.get(e),c||(c={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Pn.set(e,c)),hS(r,e,c,h.state))),t&&i===null)throw Error(s(528,""));return h}if(t&&i!==null)throw Error(s(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(n=lr(n),t=rl(r).hoistableScripts,i=t.get(n),i||(i={type:"script",instance:null,count:0,state:null},t.set(n,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function ar(e){return'href="'+dn(e)+'"'}function os(e){return'link[rel="stylesheet"]['+e+"]"}function tv(e){return Q({},e,{"data-precedence":e.precedence,precedence:null})}function hS(e,t,n,i){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Gl]!==!0){i.loading=1;return}}else t=e.createElement("link"),t[Gl]=!0,t.onload=t.onerror=xr.bind(null,t),It(t,"link",n),Tt(t),e.head.appendChild(t);i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2})}function lr(e){return'[src="'+dn(e)+'"]'}function cs(e){return"script[async]"+e}function nv(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+dn(n.href)+'"]');if(i)return t.instance=i,Tt(i),i;var r=Q({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Tt(i),It(i,"style",r),Wu(i,n.precedence,e),t.instance=i;case"stylesheet":r=ar(n.href);var c=e.querySelector(os(r));if(c)return t.state.loading|=4,t.instance=c,Tt(c),c;i=tv(n),(r=Pn.get(r))&&rd(i,r),c=(e.ownerDocument||e).createElement("link"),Tt(c);var h=c;return h._p=new Promise(function(b,N){h.onload=b,h.onerror=N}),It(c,"link",i),t.state.loading|=4,Wu(c,n.precedence,e),t.instance=c;case"script":return c=lr(n.src),(r=e.querySelector(cs(c)))?(t.instance=r,Tt(r),r):(i=n,(r=Pn.get(c))&&(i=Q({},n),sd(i,r)),e=e.ownerDocument||e,r=e.createElement("script"),Tt(r),It(r,"link",i),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Wu(i,n.precedence,e));return t.instance}function Wu(e,t,n){for(var i=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=i.length?i[i.length-1]:null,c=r,h=0;h<i.length;h++){var b=i[h];if(b.dataset.precedence===t)c=b;else if(c!==r)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function rd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function sd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var eo=null;function av(e,t,n){if(eo===null){var i=new Map,r=eo=new Map;r.set(n,i)}else r=eo,i=r.get(n),i||(i=new Map,r.set(n,i));if(i.has(e))return i;for(i.set(e,null),n=n.getElementsByTagName(e),r=0;r<n.length;r++){var c=n[r];if(!(c[ya]||c[zt]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var h=c.getAttribute(t)||"";h=e+h;var b=i.get(h);b?b.push(c):i.set(h,[c])}}return i}function ud(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function mS(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 lv(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function iv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function rv(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function sv(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=rv(t),e.suspenseyImages.push(t)),e=vS.bind(e),t.decode().then(e,e))}function pS(e,t,n,i){if(n.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var r=ar(i.href),c=t.querySelector(os(r));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=fs.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=c,Tt(c);return}c=t.ownerDocument||t,i=tv(i),(r=Pn.get(r))&&rd(i,r),c=c.createElement("link"),Tt(c);var h=c;h._p=new Promise(function(b,N){h.onload=b,h.onerror=N}),It(c,"link",i),n.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=fs.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var to=0;function gS(e,t){return e.stylesheets&&e.count===0&&ao(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var i=setTimeout(function(){if(e.stylesheets&&ao(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&to===0&&(to=62500*Mx());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ao(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>to?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(r)}}:null}function uv(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ao(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function fs(){this.count--,uv(this)}function vS(){this.imgCount--,uv(this)}var no=null;function ao(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,no=new Map,t.forEach(yS,e),no=null,fs.call(e))}function yS(e,t){if(!(t.state.loading&4)){var n=no.get(e);if(n)var i=n.get(null);else{n=new Map,no.set(e,n);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<r.length;c++){var h=r[c];(h.nodeName==="LINK"||h.getAttribute("media")!=="not all")&&(n.set(h.dataset.precedence,h),i=h)}i&&n.set(null,i)}r=t.instance,h=r.getAttribute("data-precedence"),c=n.get(h)||i,c===i&&n.set(null,r),n.set(h,r),this.count++,i=fs.bind(this),r.addEventListener("load",i),r.addEventListener("error",i),c?c.parentNode.insertBefore(r,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var ir={$$typeof:X,Provider:null,Consumer:null,_currentValue:He,_currentValue2:He,_threadCount:0};function bS(e,t,n,i,r,c,h,b,N){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=yr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yr(0),this.hiddenUpdates=yr(null),this.identifierPrefix=i,this.onUncaughtError=r,this.onCaughtError=c,this.onRecoverableError=h,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.transitionTypes=null,this.incompleteTransitions=new Map}function ov(e,t,n,i,r,c,h,b,N,R,L,P){return e=new bS(e,t,n,h,N,R,L,P,b),t=1,c===!0&&(t|=24),c=_n(3,null,null,t),e.current=c,c.stateNode=e,t=jc(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:i,isDehydrated:n,cache:t},Nc(c),e}function cv(e){return e?(e=Oi,e):Oi}function fv(e,t,n,i,r,c){r=cv(r),i.context===null?i.context=r:i.pendingContext=r,i=gl(t),i.payload={element:n},c=c===void 0?null:c,c!==null&&(i.callback=c),n=vl(e,i,t),n!==null&&(Cn(n,e,t),qr(n,e,t))}function dv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function od(e,t){dv(e,t),(e=e.alternate)&&dv(e,t)}function hv(e){if(e.tag===13||e.tag===31){var t=Kl(e,67108864);t!==null&&Cn(t,e,67108864),od(e,67108864)}}function mv(e){if(e.tag===13||e.tag===31){var t=Rn();t=Si(t);var n=Kl(e,t);n!==null&&Cn(n,e,t),od(e,t)}}var rr=!0;function xS(e,t,n,i){var r=oe.T;oe.T=null;var c=pe.p;try{pe.p=2,cd(e,t,n,i)}finally{pe.p=c,oe.T=r}}function SS(e,t,n,i){var r=oe.T;oe.T=null;var c=pe.p;try{pe.p=8,cd(e,t,n,i)}finally{pe.p=c,oe.T=r}}function cd(e,t,n,i){if(rr){var r=fd(i);if(r===null)Gf(e,t,i,lo,n),gv(e,i);else if(_S(r,e,t,n,i))i.stopPropagation();else if(gv(e,i),t&4&&-1<jS.indexOf(e)){for(;r!==null;){var c=na(r);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var h=cn(c.pendingLanes);if(h!==0){var b=c;for(b.pendingLanes|=2,b.entangledLanes|=2;h;){var N=1<<31-kt(h);b.entanglements[1]|=N,h&=~N}Aa(c),(tt&6)===0&&(Yu=Ht()+500,ls(0))}}break;case 31:case 13:b=Kl(c,2),b!==null&&Cn(b,c,2),Xu(),od(c,2)}if(c=fd(i),c===null&&Gf(e,t,i,lo,n),c===r)break;r=c}r!==null&&i.stopPropagation()}else Gf(e,t,i,null,n)}}function fd(e){return e=Ko(e),dd(e)}var lo=null;function dd(e){if(lo=null,e=ln(e),e!==null){var t=d(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=m(t),e!==null)return e;e=null}else if(n===31){if(e=p(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 lo=e,null}function pv(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(ze()){case ot:return 2;case Ue:return 8;case _t:case Vo:return 32;case Us:return 268435456;default:return 32}default:return 32}}var hd=!1,Tl=null,Al=null,Ol=null,ds=new Map,hs=new Map,kl=[],jS="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 gv(e,t){switch(e){case"focusin":case"focusout":Tl=null;break;case"dragenter":case"dragleave":Al=null;break;case"mouseover":case"mouseout":Ol=null;break;case"pointerover":case"pointerout":ds.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":hs.delete(t.pointerId)}}function ms(e,t,n,i,r,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:n,eventSystemFlags:i,nativeEvent:c,targetContainers:[r]},t!==null&&(t=na(t),t!==null&&hv(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function _S(e,t,n,i,r){switch(t){case"focusin":return Tl=ms(Tl,e,t,n,i,r),!0;case"dragenter":return Al=ms(Al,e,t,n,i,r),!0;case"mouseover":return Ol=ms(Ol,e,t,n,i,r),!0;case"pointerover":var c=r.pointerId;return ds.set(c,ms(ds.get(c)||null,e,t,n,i,r)),!0;case"gotpointercapture":return c=r.pointerId,hs.set(c,ms(hs.get(c)||null,e,t,n,i,r)),!0}return!1}function vv(e){var t=ln(e.target);if(t!==null){var n=d(t);if(n!==null){if(t=n.tag,t===13){if(t=m(n),t!==null){e.blockedOn=t,Hs(e.priority,function(){mv(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,Hs(e.priority,function(){mv(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 io(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=fd(e.nativeEvent);if(n===null){n=e.nativeEvent;var i=new n.constructor(n.type,n);Fo=i,n.target.dispatchEvent(i),Fo=null}else return t=na(n),t!==null&&hv(t),e.blockedOn=n,!1;t.shift()}return!0}function yv(e,t,n){io(e)&&n.delete(t)}function zS(){hd=!1,Tl!==null&&io(Tl)&&(Tl=null),Al!==null&&io(Al)&&(Al=null),Ol!==null&&io(Ol)&&(Ol=null),ds.forEach(yv),hs.forEach(yv)}function ro(e,t){e.blockedOn===t&&(e.blockedOn=null,hd||(hd=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,zS)))}var so=null;function bv(e){so!==e&&(so=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){so===e&&(so=null);for(var t=0;t<e.length;t+=3){var n=e[t],i=e[t+1],r=e[t+2];if(typeof i!="function"){if(dd(i||n)===null)continue;break}var c=na(n);c!==null&&(e.splice(t,3),t-=3,Qc(c,{pending:!0,data:r,method:n.method,action:i},i,r))}}))}function sr(e){function t(N){return ro(N,e)}Tl!==null&&ro(Tl,e),Al!==null&&ro(Al,e),Ol!==null&&ro(Ol,e),ds.forEach(t),hs.forEach(t);for(var n=0;n<kl.length;n++){var i=kl[n];i.blockedOn===e&&(i.blockedOn=null)}for(;0<kl.length&&(n=kl[0],n.blockedOn===null);)vv(n),n.blockedOn===null&&kl.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(i=0;i<n.length;i+=3){var r=n[i],c=n[i+1],h=r[an]||null;if(typeof c=="function")h||bv(n);else if(h){var b=null;if(c&&c.hasAttribute("formAction")){if(r=c,h=c[an]||null)b=h.formAction;else if(dd(r)!==null)continue}else b=h.action;typeof b=="function"?n[i+1]=b:(n.splice(i,3),i-=3),bv(n)}}}function xv(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(h){return r=h})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),i||setTimeout(n,20)}function n(){if(!i&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,r=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),r!==null&&(r(),r=null)}}}function md(e){this._internalRoot=e}uo.prototype.render=md.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var n=t.current,i=Rn();fv(n,i,e,t,null,null)},uo.prototype.unmount=md.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;fv(e.current,2,null,e,null,null),Xu(),t[Za]=null}};function uo(e){this._internalRoot=e}uo.prototype.unstable_scheduleHydration=function(e){if(e){var t=ji();e={blockedOn:null,target:e,priority:t};for(var n=0;n<kl.length&&t!==0&&t<kl[n].priority;n++);kl.splice(n,0,e),n===0&&vv(e)}};var Sv=l.version;if(Sv!=="19.3.0")throw Error(s(527,Sv,"19.3.0"));pe.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=S(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var wS={bundleType:0,version:"19.3.0",rendererPackageName:"react-dom",currentDispatcherRef:oe,reconcilerVersion:"19.3.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var oo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!oo.isDisabled&&oo.supportsFiber)try{va=oo.inject(wS),nn=oo}catch{}}return gs.createRoot=function(e,t){if(!f(e))throw Error(s(299));var n=!1,i="",r=cp,c=fp,h=dp;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(h=t.onRecoverableError)),t=ov(e,1,!1,null,null,n,i,null,r,c,h,xv),e[Za]=t.current,Vf(e),new md(t)},gs.hydrateRoot=function(e,t,n){if(!f(e))throw Error(s(299));var i=!1,r="",c=cp,h=fp,b=dp,N=null;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(r=n.identifierPrefix),n.onUncaughtError!==void 0&&(c=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(b=n.onRecoverableError),n.formState!==void 0&&(N=n.formState)),t=ov(e,1,!0,t,n??null,i,r,N,c,h,b,xv),t.context=cv(null),n=t.current,i=Rn(),i=Si(i),r=gl(i),r.callback=null,vl(n,r,i),n=i,t.current.lanes=n,Yl(t,n),Aa(t),e[Za]=t.current,Vf(e),new uo(t)},gs.version="19.3.0",gs}var Mv;function $S(){if(Mv)return yd.exports;Mv=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),yd.exports=ZS(),yd.exports}var BS=$S();const HS=k.forwardRef(function({className:l="",...u},s){return o.jsx("div",{...u,ref:s,className:`t2c-card ${l}`,"data-ui-component":"chat-box"})}),LS=k.forwardRef(function({className:l="",autoSize:u=!0,...s},f){const d=k.useRef(null);return k.useLayoutEffect(()=>{var y;const m=d.current;if(!m||!u)return;const p=()=>{m.style.height="auto",m.style.height=`${m.scrollHeight}px`};p();let g=(y=m.parentElement)==null?void 0:y.clientWidth;const S=new ResizeObserver(([v])=>{v.contentRect.width!==g&&(g=v.contentRect.width,p())});return m.parentElement&&S.observe(m.parentElement),()=>S.disconnect()},[u,s.value,s.placeholder]),o.jsx("textarea",{...s,rows:s.rows??1,className:`t2c-ta ${l}`,ref:m=>{d.current=m,typeof f=="function"?f(m):f&&(f.current=m)}})});function qS({className:a="",...l}){return o.jsx("div",{...l,className:`t2c-row ${a}`})}function YS({className:a="",children:l,...u}){return o.jsx("button",{type:"button",...u,className:`t2c-send ${a}`,children:l??o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("path",{d:"M12 19V5m-6 6 6-6 6 6"})})})}function VS({value:a,onValueChange:l,onSubmit:u,submitLabel:s,disabled:f,submitDisabled:d,submitOn:m="modifier-enter",className:p,inputRef:g,inputProps:S,beforeInput:y,afterInput:v,controls:j,submitContent:w,submitClassName:E}){const T=()=>{!f&&!d&&u()};return o.jsxs(HS,{className:p,children:[y,o.jsx(LS,{...S,ref:g,value:a,disabled:f,onChange:A=>l(A.target.value),onKeyDown:A=>{var Z;(Z=S==null?void 0:S.onKeyDown)==null||Z.call(S,A),!A.defaultPrevented&&A.key==="Enter"&&!A.shiftKey&&!A.nativeEvent.isComposing&&(m==="enter"||A.metaKey||A.ctrlKey)&&(A.preventDefault(),T())}}),v,o.jsxs(qS,{children:[j,o.jsx("span",{className:"t2c-grow"}),o.jsx(YS,{className:E,disabled:f||d,title:s,"aria-label":s,onClick:T,children:w})]})]})}function gt(a){return o.jsxs("div",{className:`settings-control-row settings-setting-row${a.className?` ${a.className}`:""}`,"data-setting-anchor":a.anchor,children:[o.jsx("div",{className:"settings-control-copy",children:o.jsxs("span",{children:[o.jsx("strong",{children:a.label}),a.description&&o.jsx("small",{children:a.description})]})}),a.control&&o.jsx("div",{className:"settings-row-control",children:a.control}),a.children]})}function Ln(a){return o.jsx("button",{type:"button",role:"switch","aria-checked":a.checked,"aria-label":a.label,className:`settings-switch${a.checked?" active":""}`,disabled:a.disabled,onClick:()=>a.onChange(!a.checked),children:o.jsx("span",{})})}/**
|
|
50
|
+
* @license lucide-react v1.55.0 - ISC
|
|
51
|
+
*
|
|
52
|
+
* This source code is licensed under the ISC license.
|
|
53
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
+
*/const GS=a=>a==null?void 0:a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
55
|
+
* @license lucide-react v1.55.0 - ISC
|
|
56
|
+
*
|
|
57
|
+
* This source code is licensed under the ISC license.
|
|
58
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
+
*/function XS(a,l,u=[]){if(l==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:GS(a),size:24,node:l,...u.length>0?{aliases:u}:{}}}/**
|
|
60
|
+
* @license lucide-react v1.55.0 - ISC
|
|
61
|
+
*
|
|
62
|
+
* This source code is licensed under the ISC license.
|
|
63
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
+
*/const QS=a=>{let l="",u=!1;for(const s of a){if(s==="-"||s==="_"||s<=" "){u=l.length>0;continue}l.length===0?l+=s.toLowerCase():l+=u?s.toUpperCase():s,u=!1}return l};/**
|
|
65
|
+
* @license lucide-react v1.55.0 - ISC
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the ISC license.
|
|
68
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/const FS=a=>{const l=QS(a);return l.charAt(0).toUpperCase()+l.slice(1)};/**
|
|
70
|
+
* @license lucide-react v1.55.0 - ISC
|
|
71
|
+
*
|
|
72
|
+
* This source code is licensed under the ISC license.
|
|
73
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
+
*/const Ud=(...a)=>a.filter((l,u,s)=>!!l&&l.trim()!==""&&s.indexOf(l)===u).join(" ").trim();/**
|
|
75
|
+
* @license lucide-react v1.55.0 - ISC
|
|
76
|
+
*
|
|
77
|
+
* This source code is licensed under the ISC license.
|
|
78
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
+
*/const hi={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"};/**
|
|
80
|
+
* @license lucide-react v1.55.0 - ISC
|
|
81
|
+
*
|
|
82
|
+
* This source code is licensed under the ISC license.
|
|
83
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
+
*/function jd(a){return a!=null}function KS(a,l={}){var j,w;const u=l.attributeNames??{},s=E=>u[E]??E,f=a.size??a.width??hi.width,d=a.size??a.height??hi.height,m=((j=a.aliases)==null?void 0:j.filter(E=>typeof E=="string"&&E.trim()!=="").map(E=>`lucide-${E}`))??[],p=[...a.name?[`lucide-${a.name}`]:[],...m],g=((w=l.className)==null?void 0:w.split(" ").filter(Boolean))??[],S=l.includeDefaultClasses===!1?Ud(...g):Ud("lucide",...p,...g),y=l.absoluteStrokeWidth?Number(l.strokeWidth??hi["stroke-width"])*Number(a.size??a.width??hi.width)/Number(l.size??l.width??hi.width):l.strokeWidth??hi["stroke-width"];return["svg",{...Object.entries(hi).reduce((E,[T,A])=>(E[s(T)]=A,E),{}),..."color"in l&&l.color&&{[s("stroke")]:l.color},..."size"in l&&jd(l.size)&&{[s("width")]:l.size,[s("height")]:l.size},..."width"in l&&jd(l.width)&&{[s("width")]:l.width},..."height"in l&&jd(l.height)&&{[s("height")]:l.height},[s("stroke-width")]:y,...S&&{[s("class")]:S},[s("viewBox")]:`0 0 ${f} ${d}`,...l.hasA11yProp===!1?{[s("aria-hidden")]:"true"}:{},..."attributes"in l&&l.attributes},a.node.map(E=>{const[T,A,Z]=E,Y=l.nonScalingStroke?{[s("vector-effect")]:"non-scaling-stroke",...A}:A;return Z?[T,Y,Z]:[T,Y]})]}/**
|
|
85
|
+
* @license lucide-react v1.55.0 - ISC
|
|
86
|
+
*
|
|
87
|
+
* This source code is licensed under the ISC license.
|
|
88
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
+
*/function IS(a,l={}){return KS(a,{...l,attributeNames:{...l.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}/**
|
|
90
|
+
* @license lucide-react v1.55.0 - ISC
|
|
91
|
+
*
|
|
92
|
+
* This source code is licensed under the ISC license.
|
|
93
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
+
*/const JS=a=>{for(const l in a)if(l.startsWith("aria-")||l==="role"||l==="title")return!0;return!1},PS=k.createContext({}),WS=()=>k.useContext(PS),ej=k.forwardRef(({color:a,size:l,width:u,height:s,strokeWidth:f,absoluteStrokeWidth:d,nonScalingStroke:m,className:p="",children:g,iconNode:S=[],icon:y={node:S,aliases:[],size:24},...v},j)=>{const{size:w=24,strokeWidth:E=2,absoluteStrokeWidth:T=!1,nonScalingStroke:A=!1,color:Z="currentColor",className:Y=""}=WS()??{},ye=!!g||JS(v),[te,ue,I=[]]=IS(y,{color:a??Z,width:u??l??w,height:s??l??w,strokeWidth:f??E,absoluteStrokeWidth:d??T,nonScalingStroke:m??A,className:Ud(Y,p),hasA11yProp:ye,attributes:v});return k.createElement(te,{ref:j,...ue},[...I.map(([Q,G])=>k.createElement(Q,G)),...Array.isArray(g)?g:[g]])});/**
|
|
95
|
+
* @license lucide-react v1.55.0 - ISC
|
|
96
|
+
*
|
|
97
|
+
* This source code is licensed under the ISC license.
|
|
98
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
+
*/function Ve(a,l=[],u=[]){const s=typeof a=="string"?XS(a,l,u):a,f=k.forwardRef(({className:d,...m},p)=>k.createElement(ej,{ref:p,icon:s,className:d,...m}));return s.name&&(f.displayName=FS(s.name)),f}/**
|
|
100
|
+
* @license lucide-react v1.55.0 - ISC
|
|
101
|
+
*
|
|
102
|
+
* This source code is licensed under the ISC license.
|
|
103
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
+
*/const Ly={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};Ly.node;const ah=Ve(Ly);/**
|
|
105
|
+
* @license lucide-react v1.55.0 - ISC
|
|
106
|
+
*
|
|
107
|
+
* This source code is licensed under the ISC license.
|
|
108
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
+
*/const qy={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};qy.node;const tj=Ve(qy);/**
|
|
110
|
+
* @license lucide-react v1.55.0 - ISC
|
|
111
|
+
*
|
|
112
|
+
* This source code is licensed under the ISC license.
|
|
113
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
+
*/const Yy={name:"arrow-up-right",size:24,node:[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]};Yy.node;const _d=Ve(Yy);/**
|
|
115
|
+
* @license lucide-react v1.55.0 - ISC
|
|
116
|
+
*
|
|
117
|
+
* This source code is licensed under the ISC license.
|
|
118
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
+
*/const Vy={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};Vy.node;const lh=Ve(Vy);/**
|
|
120
|
+
* @license lucide-react v1.55.0 - ISC
|
|
121
|
+
*
|
|
122
|
+
* This source code is licensed under the ISC license.
|
|
123
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
+
*/const Gy={name:"book-open",size:24,node:[["path",{d:"M12 5v16",key:"1f6ucr"}],["path",{d:"M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z",key:"1fyvmf"}]]};Gy.node;const Zd=Ve(Gy);/**
|
|
125
|
+
* @license lucide-react v1.55.0 - ISC
|
|
126
|
+
*
|
|
127
|
+
* This source code is licensed under the ISC license.
|
|
128
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
+
*/const Xy={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};Xy.node;const Mo=Ve(Xy);/**
|
|
130
|
+
* @license lucide-react v1.55.0 - ISC
|
|
131
|
+
*
|
|
132
|
+
* This source code is licensed under the ISC license.
|
|
133
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
+
*/const Qy={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};Qy.node;const Rv=Ve(Qy);/**
|
|
135
|
+
* @license lucide-react v1.55.0 - ISC
|
|
136
|
+
*
|
|
137
|
+
* This source code is licensed under the ISC license.
|
|
138
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
+
*/const Fy={name:"circle-stop",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],aliases:["stop-circle"]};Fy.node;const nj=Ve(Fy);/**
|
|
140
|
+
* @license lucide-react v1.55.0 - ISC
|
|
141
|
+
*
|
|
142
|
+
* This source code is licensed under the ISC license.
|
|
143
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
+
*/const Ky={name:"cloud",size:24,node:[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]};Ky.node;const Uv=Ve(Ky);/**
|
|
145
|
+
* @license lucide-react v1.55.0 - ISC
|
|
146
|
+
*
|
|
147
|
+
* This source code is licensed under the ISC license.
|
|
148
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
+
*/const Iy={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"}]]};Iy.node;const aj=Ve(Iy);/**
|
|
150
|
+
* @license lucide-react v1.55.0 - ISC
|
|
151
|
+
*
|
|
152
|
+
* This source code is licensed under the ISC license.
|
|
153
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
+
*/const Jy={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"}]]};Jy.node;const Oa=Ve(Jy);/**
|
|
155
|
+
* @license lucide-react v1.55.0 - ISC
|
|
156
|
+
*
|
|
157
|
+
* This source code is licensed under the ISC license.
|
|
158
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
+
*/const Py={name:"external-link",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]};Py.node;const Ro=Ve(Py);/**
|
|
160
|
+
* @license lucide-react v1.55.0 - ISC
|
|
161
|
+
*
|
|
162
|
+
* This source code is licensed under the ISC license.
|
|
163
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
+
*/const Wy={name:"highlighter",size:24,node:[["path",{d:"m9 11-6 6v3h9l3-3",key:"1a3l36"}],["path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4",key:"14a9rk"}]]};Wy.node;const e0=Ve(Wy);/**
|
|
165
|
+
* @license lucide-react v1.55.0 - ISC
|
|
166
|
+
*
|
|
167
|
+
* This source code is licensed under the ISC license.
|
|
168
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
+
*/const t0={name:"image-plus",size:24,node:[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]};t0.node;const lj=Ve(t0);/**
|
|
170
|
+
* @license lucide-react v1.55.0 - ISC
|
|
171
|
+
*
|
|
172
|
+
* This source code is licensed under the ISC license.
|
|
173
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
+
*/const n0={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};n0.node;const ij=Ve(n0);/**
|
|
175
|
+
* @license lucide-react v1.55.0 - ISC
|
|
176
|
+
*
|
|
177
|
+
* This source code is licensed under the ISC license.
|
|
178
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
+
*/const a0={name:"list-todo",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]};a0.node;const l0=Ve(a0);/**
|
|
180
|
+
* @license lucide-react v1.55.0 - ISC
|
|
181
|
+
*
|
|
182
|
+
* This source code is licensed under the ISC license.
|
|
183
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
+
*/const i0={name:"log-out",size:24,node:[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]};i0.node;const rj=Ve(i0);/**
|
|
185
|
+
* @license lucide-react v1.55.0 - ISC
|
|
186
|
+
*
|
|
187
|
+
* This source code is licensed under the ISC license.
|
|
188
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
+
*/const r0={name:"monitor",size:24,node:[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]};r0.node;const sj=Ve(r0);/**
|
|
190
|
+
* @license lucide-react v1.55.0 - ISC
|
|
191
|
+
*
|
|
192
|
+
* This source code is licensed under the ISC license.
|
|
193
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
+
*/const s0={name:"moon",size:24,node:[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]};s0.node;const uj=Ve(s0);/**
|
|
195
|
+
* @license lucide-react v1.55.0 - ISC
|
|
196
|
+
*
|
|
197
|
+
* This source code is licensed under the ISC license.
|
|
198
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
+
*/const u0={name:"notebook-pen",size:24,node:[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]]};u0.node;const zs=Ve(u0);/**
|
|
200
|
+
* @license lucide-react v1.55.0 - ISC
|
|
201
|
+
*
|
|
202
|
+
* This source code is licensed under the ISC license.
|
|
203
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
+
*/const o0={name:"panel-left",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],aliases:["sidebar"]};o0.node;const oj=Ve(o0);/**
|
|
205
|
+
* @license lucide-react v1.55.0 - ISC
|
|
206
|
+
*
|
|
207
|
+
* This source code is licensed under the ISC license.
|
|
208
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
+
*/const c0={name:"paperclip",size:24,node:[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]};c0.node;const ws=Ve(c0);/**
|
|
210
|
+
* @license lucide-react v1.55.0 - ISC
|
|
211
|
+
*
|
|
212
|
+
* This source code is licensed under the ISC license.
|
|
213
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
+
*/const f0={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};f0.node;const d0=Ve(f0);/**
|
|
215
|
+
* @license lucide-react v1.55.0 - ISC
|
|
216
|
+
*
|
|
217
|
+
* This source code is licensed under the ISC license.
|
|
218
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
+
*/const h0={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};h0.node;const mi=Ve(h0);/**
|
|
220
|
+
* @license lucide-react v1.55.0 - ISC
|
|
221
|
+
*
|
|
222
|
+
* This source code is licensed under the ISC license.
|
|
223
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
+
*/const m0={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"}]]};m0.node;const Es=Ve(m0);/**
|
|
225
|
+
* @license lucide-react v1.55.0 - ISC
|
|
226
|
+
*
|
|
227
|
+
* This source code is licensed under the ISC license.
|
|
228
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
+
*/const p0={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};p0.node;const g0=Ve(p0);/**
|
|
230
|
+
* @license lucide-react v1.55.0 - ISC
|
|
231
|
+
*
|
|
232
|
+
* This source code is licensed under the ISC license.
|
|
233
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
+
*/const v0={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};v0.node;const ih=Ve(v0);/**
|
|
235
|
+
* @license lucide-react v1.55.0 - ISC
|
|
236
|
+
*
|
|
237
|
+
* This source code is licensed under the ISC license.
|
|
238
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
+
*/const y0={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"}]]};y0.node;const $d=Ve(y0);/**
|
|
240
|
+
* @license lucide-react v1.55.0 - ISC
|
|
241
|
+
*
|
|
242
|
+
* This source code is licensed under the ISC license.
|
|
243
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
+
*/const b0={name:"shield-off",size:24,node:[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]]};b0.node;const cj=Ve(b0);/**
|
|
245
|
+
* @license lucide-react v1.55.0 - ISC
|
|
246
|
+
*
|
|
247
|
+
* This source code is licensed under the ISC license.
|
|
248
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
+
*/const x0={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"]};x0.node;const vs=Ve(x0);/**
|
|
250
|
+
* @license lucide-react v1.55.0 - ISC
|
|
251
|
+
*
|
|
252
|
+
* This source code is licensed under the ISC license.
|
|
253
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
+
*/const S0={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};S0.node;const fj=Ve(S0);/**
|
|
255
|
+
* @license lucide-react v1.55.0 - ISC
|
|
256
|
+
*
|
|
257
|
+
* This source code is licensed under the ISC license.
|
|
258
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
+
*/const j0={name:"sun",size:24,node:[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]};j0.node;const dj=Ve(j0);/**
|
|
260
|
+
* @license lucide-react v1.55.0 - ISC
|
|
261
|
+
*
|
|
262
|
+
* This source code is licensed under the ISC license.
|
|
263
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
+
*/const _0={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"]};_0.node;const Ul=Ve(_0);/**
|
|
265
|
+
* @license lucide-react v1.55.0 - ISC
|
|
266
|
+
*
|
|
267
|
+
* This source code is licensed under the ISC license.
|
|
268
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
+
*/const z0={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};z0.node;const w0=Ve(z0);/**
|
|
270
|
+
* @license lucide-react v1.55.0 - ISC
|
|
271
|
+
*
|
|
272
|
+
* This source code is licensed under the ISC license.
|
|
273
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
+
*/const N0={name:"volume-2",size:24,node:[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]};N0.node;const C0=Ve(N0);/**
|
|
275
|
+
* @license lucide-react v1.55.0 - ISC
|
|
276
|
+
*
|
|
277
|
+
* This source code is licensed under the ISC license.
|
|
278
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
+
*/const E0={name:"wand-sparkles",size:24,node:[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],aliases:["wand-2"]};E0.node;const hj=Ve(E0);/**
|
|
280
|
+
* @license lucide-react v1.55.0 - ISC
|
|
281
|
+
*
|
|
282
|
+
* This source code is licensed under the ISC license.
|
|
283
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
+
*/const T0={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};T0.node;const cr=Ve(T0);async function ve(a,l={}){const u=await chrome.runtime.sendMessage({type:"forsion-rpc",method:a,params:l});if(!(u!=null&&u.ok))throw new Error((u==null?void 0:u.error)||"Forsion Clip service unavailable");return u.data}const mj=5e6,A0=1e4;class ca extends Error{constructor(l,u){super(`Vocabulary import ${l}${u?` at row ${u}`:""}`),this.reason=l,this.row=u,this.name="VocabularyTransferError"}}function pj(a,l){const u=a instanceof Error?a.message:String(a),s=/^Vocabulary import (size|csv|empty|row)(?: at row (\d+))?$/.exec(u);if(!s)return;const f=s[2]||"?";return{size:["CSV 不能超过 5 MB 或 10000 条记录。原有生词未修改。","CSV cannot exceed 5 MB or 10,000 records. Existing vocabulary is unchanged."],csv:["CSV 格式无效,请检查引号、分隔符和列数。原有生词未修改。","Invalid CSV. Check quotes, separators, and column counts. Existing vocabulary is unchanged."],empty:["CSV 中没有可导入的词语。","The CSV contains no words to import."],row:[`第 ${f} 条记录格式无效,请检查词语、字段长度、日期和掌握状态。整批未导入。`,`Record ${f} is invalid. Check its word, field lengths, date, and mastery status. No records were imported.`]}[s[1]][l==="zh"?0:1]}function gj(a){if(!Array.isArray(a)||a.length>A0)throw new ca("size");if(!a.length)throw new ca("empty");return a.map((l,u)=>{const s=()=>{throw new ca("row",u+1)};if(!l||typeof l!="object"||Array.isArray(l))return s();const f=l;if(typeof f.word!="string"||!f.word.trim()||f.word.trim().length>300)return s();for(const[d,m]of Object.entries({meaning:2e4,sentence:2e4,url:4096,title:2e3}))if(f[d]!==void 0&&(typeof f[d]!="string"||f[d].length>m))return s();return f.createdAt!==void 0&&(typeof f.createdAt!="string"||f.createdAt.length>64||!Number.isFinite(Date.parse(f.createdAt)))||f.reviewed!==void 0&&typeof f.reviewed!="boolean"?s():{word:f.word.trim(),meaning:f.meaning??"",sentence:f.sentence??"",url:f.url??"",title:f.title??"",...f.createdAt?{createdAt:new Date(f.createdAt).toISOString()}:{},...f.reviewed!==void 0?{reviewed:f.reviewed}:{}}})}function vj(a){if(a.length>mj)throw new ca("size");a=a.replace(/^\uFEFF/,"");const l=[];let u=[],s="",f=!1,d=!1;const m=()=>{u.push(s),s="",d=!1},p=()=>{if(m(),u.some(g=>g.trim())&&l.push(u),u=[],l.length>A0+1)throw new ca("size")};for(let g=0;g<a.length;g++){const S=a[g];if(f)S==='"'?a[g+1]==='"'?(s+='"',g++):(f=!1,d=!0):s+=S;else if(S===",")m();else if(S===`
|
|
285
|
+
`||S==="\r")S==="\r"&&a[g+1]===`
|
|
286
|
+
`&&g++,p();else if(S==='"'&&!s&&!d)f=!0;else{if(d||S==='"')throw new ca("csv");s+=S}}if(f)throw new ca("csv");return(s||u.length||d)&&p(),l}const yj={word:"word",term:"word",单词:"word",词语:"word",definition:"meaning",meaning:"meaning",释义:"meaning",sentence:"sentence",context:"sentence",句子:"sentence",例句:"sentence",上下文:"sentence",sourceurl:"url",url:"url",来源链接:"url",来源网址:"url",链接:"url",sourcetitle:"title",title:"title",来源标题:"title",来源:"title",标题:"title",createdat:"createdAt",added:"createdAt",添加时间:"createdAt",创建时间:"createdAt",reviewed:"reviewed",mastered:"reviewed",已掌握:"reviewed",掌握状态:"reviewed",forsioncsvescaping:"escaping"},bj=a=>a.trim().toLowerCase().replace(/[\s_-]+/g,""),O0=/^(?:\s*[=+\-@]|[\t\r\n])/,xj=a=>a.startsWith("'")||O0.test(a)?"'"+a:a,Sj=a=>a.startsWith("'")&&(a[1]==="'"||O0.test(a.slice(1)))?a.slice(1):a;function jj(a){const l=vj(a);if(!l.length)throw new ca("empty");const u=l[0].map(p=>yj[bj(p)]),s=u.includes("word")&&u.some(p=>p&&p!=="word"),f=s?u:["word","meaning","sentence","url","title","createdAt"];if(s&&new Set(u.filter(Boolean)).size!==u.filter(Boolean).length)throw new ca("csv");const m=(s?l.slice(1):l).map((p,g)=>{if(p.length>f.length||s&&p.length!==f.length)throw new ca("row",g+1);const S={},y=s&&p[u.indexOf("escaping")]==="apostrophe-v1";return p.forEach((v,j)=>{const w=f[j];if(!w||w==="escaping")return;const E=y?Sj(v):v;if(w==="reviewed"){if(!E.trim())return;if(/^(true|1|yes|mastered|已掌握)$/i.test(E.trim()))S.reviewed=!0;else if(/^(false|0|no|learning|学习中)$/i.test(E.trim()))S.reviewed=!1;else throw new ca("row",g+1)}else w==="createdAt"?E.trim()&&(S.createdAt=E.trim()):S[w]=E}),S});return gj(m)}function _j(a,l){const u=l==="zh"?["词语","释义","例句","来源链接","来源标题","添加时间","已掌握","forsionCsvEscaping"]:["word","definition","sentence","sourceUrl","sourceTitle","createdAt","reviewed","forsionCsvEscaping"],s=f=>`"${xj(f).replace(/"/g,'""')}"`;return"\uFEFF"+[u.join(","),...a.map(f=>[f.word,f.meaning||"",f.sentence,f.url,f.title,f.createdAt,String(f.reviewed),"apostrophe-v1"].map(s).join(","))].join(`\r
|
|
287
|
+
`)+`\r
|
|
288
|
+
`}async function zj(a,l){const u=await chrome.downloads.download({url:`data:text/csv;charset=utf-8,${encodeURIComponent(_j(a,l))}`,filename:`${l==="zh"?"生词本":"vocabulary"}-${new Date().toISOString().slice(0,10)}.csv`,saveAs:!0,conflictAction:"uniquify"});if(!Number.isInteger(u))throw new Error(l==="zh"?"无法开始 CSV 下载,请重试。":"Could not start CSV download. Please retry.");return u}function wj(a,l,u=new Date){const s=new Date(u.getFullYear(),u.getMonth(),u.getDate());return l.time==="week"&&s.setDate(s.getDate()-7),l.time==="month"&&s.setMonth(s.getMonth()-1),Ej(a,l.query,l.mastery).filter(f=>(!l.source||f.title===l.source)&&(!l.time||l.time==="all"||Date.parse(f.createdAt)>=s.getTime())).sort((f,d)=>l.sort==="alphabetical"?f.word.localeCompare(d.word):(l.sort==="oldest"?1:-1)*((Date.parse(f.createdAt)||0)-(Date.parse(d.createdAt)||0)))}const k0={read:{zh:"无法读取生词本,请重试。现有数据未被覆盖。",en:"Could not read vocabulary. Retry; existing data has not been overwritten."},write:{zh:"生词未保存,请检查浏览器存储空间后重试。",en:"Vocabulary was not saved. Check browser storage space and retry."},invalid:{zh:"生词本数据格式异常,已停止修改以保留原始数据。",en:"Vocabulary data is invalid. Changes were stopped to preserve the original data."},full:{zh:"生词本已达到 2000 条,请先导出并移除不需要的词语。",en:"Vocabulary has reached 2,000 words. Export it and remove words you no longer need."},missing:{zh:"该生词已被移除,请刷新列表。",en:"This word has been removed. Refresh the list."},word:{zh:"词语不能为空,且不能超过 300 个字符。",en:"Enter a word of no more than 300 characters."},meaning:{zh:"释义不能超过 20000 个字符。",en:"The meaning cannot exceed 20,000 characters."},sentence:{zh:"例句必须是文本,且不能超过 20000 个字符。",en:"Context must be text of no more than 20,000 characters."},duplicate:{zh:"生词本中已有这个词语,请编辑原有条目。",en:"This word already exists. Edit the existing entry instead."},download:{zh:"无法开始下载,请重试。",en:"Could not start the download. Please retry."}};class Nj extends Error{constructor(l){super(k0[l].en),this.code=l,this.name="VocabularyError"}}function Cj(a,l){const u=a instanceof Error?a.message:String(a),s=Object.values(k0).find(f=>f.en===u);return s?s[l]:u}Promise.resolve();const Zv=a=>a.normalize("NFC").trim().toLowerCase();function Ej(a,l="",u="all"){const s=Zv(l).split(/\s+/).filter(Boolean);return a.filter(f=>{if(u==="learning"&&f.reviewed||u==="mastered"&&!f.reviewed)return!1;const d=Zv([f.word,f.meaning,f.sentence,f.title,f.url].join(`
|
|
289
|
+
`));return s.every(m=>d.includes(m))})}function D0(a){try{const l=new URL(a);return["https:","http:"].includes(l.protocol)&&!l.username&&!l.password?l.href:null}catch{return null}}const ys=a=>a.replace(/&/g,"&").replace(/\\/g,"\\\\").replace(/[\[\]`*_{}#!|>~]/g,"\\$&").replace(/</g,"<");function Tj(a,l="en"){const u=(s,f)=>l==="zh"?s:f;return`# ${u("生词本","Vocabulary")}
|
|
290
|
+
|
|
291
|
+
`+a.map(s=>{const f=D0(s.url),d=ys(s.sentence).split(/\r?\n/).map(m=>`> ${m}`).join(`
|
|
292
|
+
`);return[`## ${ys(s.word).replace(/\r?\n/g," ")}`,`**${u("释义","Meaning")}**
|
|
293
|
+
|
|
294
|
+
${ys(s.meaning||"")||u("尚未填写","Not added yet")}`,d||"",f?`[${ys(s.title||f).replace(/\r?\n/g," ")}](${f.replace(/[()<>\\\s]/g,m=>encodeURIComponent(m).replace(/\(/g,"%28").replace(/\)/g,"%29"))})`:"",`- ${u("状态:","Status: ")}${s.reviewed?u("已掌握","Mastered"):u("学习中","Learning")}`,`- ${u("添加时间:","Added: ")}${ys(s.createdAt)}`].filter(Boolean).join(`
|
|
295
|
+
|
|
296
|
+
`)}).join(`
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
`)+`
|
|
301
|
+
`}async function Aj(a,l){try{const u=await chrome.downloads.download({url:`data:text/markdown;charset=utf-8,${encodeURIComponent(Tj(a,l))}`,filename:l==="zh"?"生词本.md":"vocabulary.md",saveAs:!0,conflictAction:"uniquify"});if(!Number.isInteger(u))throw new Error("No download ID");return u}catch{throw new Nj("download")}}function Oj({locale:a,words:l,onRefresh:u,run:s}){const f=(ee,fe)=>a==="zh"?ee:fe,[d,m]=k.useState(""),[p,g]=k.useState("all"),[S,y]=k.useState("all"),[v,j]=k.useState(""),[w,E]=k.useState("newest"),[T,A]=k.useState(!1),[Z,Y]=k.useState(null),[ye,te]=k.useState(""),[ue,I]=k.useState(""),[Q,G]=k.useState(""),[ie,_e]=k.useState(!1),ce=k.useRef(!1),[Se,he]=k.useState(null),[le,X]=k.useState(!1),z=k.useMemo(()=>wj(l,{query:d,mastery:p,time:S,source:v,sort:w}),[l,d,p,S,v,w]),U=k.useMemo(()=>[...new Set(l.map(ee=>ee.title).filter(Boolean))].sort(),[l]),B=k.useMemo(()=>{const ee=new Set(l.map(pe=>pe.word.normalize("NFC").trim().toLowerCase()));let fe=0,oe=0;for(const pe of Z||[]){const He=pe.word.normalize("NFC").trim().toLowerCase();ee.has(He)?oe++:(ee.add(He),fe++)}return{added:fe,skipped:oe}},[l,Z]),se=z.filter(ee=>!ee.reviewed),ae=Se?l.find(ee=>ee.id===Se.ids[Se.index]):void 0,je=!!Se&&Se.index>=Se.ids.length,Te=k.useRef(null);function ke(){var ee;Te.current&&(Te.current.onend=null,Te.current.onerror=null,(ee=window.speechSynthesis)==null||ee.cancel(),Te.current=null)}k.useEffect(()=>()=>ke(),[]),k.useEffect(()=>{ke(),X(!1)},[ae==null?void 0:ae.id]),k.useEffect(()=>{Se&&!je&&!ae&&he(ee=>ee?{...ee,index:ee.index+1}:null)},[Se,je,ae]);const C=async(ee,fe)=>{if(ce.current)return!1;ce.current=!0,_e(!0),I(""),G("");let oe=!1;const pe=async()=>{try{await ee(),fe==null||fe(),oe=!0}catch(He){throw I(pj(He,a)||Cj(He,a)),He}};try{s?await s("vocabulary",pe):await pe()}catch{}finally{ce.current=!1,_e(!1)}return oe};async function V(ee,fe){await ve(ee,fe),await u()}function de(ee){if(I(""),!("speechSynthesis"in window)||!("SpeechSynthesisUtterance"in window)){I(f("此浏览器不支持朗读。","This browser does not support speech playback."));return}ke();try{const fe=new window.SpeechSynthesisUtterance(ee);fe.lang=/[\u3040-\u30ff]/u.test(ee)?"ja-JP":/[\u3400-\u9fff]/u.test(ee)?"zh-CN":"en-US";const oe=window.speechSynthesis.getVoices().filter(He=>He.lang.split("-")[0]===fe.lang.split("-")[0]),pe=oe.find(He=>He.localService)||oe[0];pe&&(fe.voice=pe),fe.onerror=He=>{He.error!=="canceled"&&He.error!=="interrupted"&&I(f("朗读失败,请检查系统语音设置后重试。","Speech playback failed. Check system voice settings and retry.")),Te.current=null},fe.onend=()=>{Te.current=null},Te.current=fe,window.speechSynthesis.speak(fe)}catch{I(f("无法开始朗读。","Could not start speech playback."))}}function re(){ke(),he(null),X(!1)}function Ne(ee){ae&&C(()=>V("vocab-review",{id:ae.id,reviewed:ee}),()=>{X(!1),he(fe=>fe?{...fe,index:fe.index+1}:null)})}return o.jsxs("section",{"aria-label":f("生词本","Vocabulary"),children:[o.jsxs("div",{className:"page-heading",style:{flexWrap:"wrap"},children:[o.jsxs("div",{children:[o.jsx("h1",{children:f("生词本","Vocabulary")}),o.jsx("p",{children:f("记录释义,保留上下文,逐词复习。","Add meanings, keep context, and review at your own pace.")})]}),o.jsxs("div",{className:"actions",children:[o.jsxs("button",{type:"button",className:"btn",disabled:ie||!!Se,"aria-expanded":T,onClick:()=>A(ee=>!ee),children:[o.jsx(w0,{size:15}),f("导入 CSV","Import CSV")]}),o.jsxs("button",{type:"button",className:"btn",disabled:ie||!z.length,onClick:()=>void C(async()=>{await zj(z,a),G(f("已开始下载当前筛选结果的 CSV。","CSV download started for the current results."))}),children:[o.jsx(Oa,{size:15}),f("导出筛选结果 CSV","Export results as CSV")]}),o.jsxs("button",{type:"button",className:"btn",disabled:ie||!l.length,onClick:()=>void C(async()=>{await Aj(l,a),G(f("下载已开始,请在浏览器中查看进度。","Download started. Check its progress in your browser."))}),children:[o.jsx(Oa,{size:15}),f("导出全部","Export all")]}),!Se&&o.jsxs("button",{type:"button",className:"btn primary",disabled:ie||!se.length,onClick:()=>{he({ids:se.map(ee=>ee.id),index:0}),X(!1),I(""),G("")},children:[o.jsx(Zd,{size:15}),f("复习未掌握","Review unmastered")]})]})]}),ue&&o.jsx("p",{role:"alert",className:"failed",style:{marginBottom:14,overflowWrap:"anywhere"},children:ue}),Q&&o.jsx("p",{role:"status",className:"muted",style:{marginBottom:14},children:Q}),T&&!Se&&o.jsxs("section",{className:"vocabulary-import","aria-label":f("CSV 导入","CSV import"),children:[o.jsx("p",{className:"caption",children:f("兼容原插件的中英文 CSV。导入只新增词语,重复词语会跳过;原有释义和复习状态保留。","Accepts the original extension’s Chinese and English CSV files. Only new words are added; duplicates are skipped and existing meanings and review states are preserved.")}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:f("选择 CSV 文件","Choose a CSV file")}),o.jsx("input",{type:"file",accept:".csv,text/csv",disabled:ie,onChange:ee=>{var oe;const fe=(oe=ee.currentTarget.files)==null?void 0:oe[0];Y(null),te(""),fe&&C(async()=>{if(fe.size>5e6)throw new Error(a==="zh"?"CSV 不能超过 5 MB。":"CSV cannot exceed 5 MB.");const pe=jj(await fe.text());Y(pe),te(fe.name)})}})]}),Z&&o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"caption",role:"status",children:[ye," · ",f(`将新增 ${B.added} 条,跳过 ${B.skipped} 条重复记录。`,`${B.added} new words; ${B.skipped} duplicates will be skipped.`)]}),o.jsxs("div",{className:"actions",children:[o.jsx("button",{type:"button",className:"btn primary",disabled:ie,onClick:()=>void C(async()=>{const ee=await ve("vocab-import",{rows:Z});await u(),Y(null),te(""),A(!1),G(f(`已新增 ${ee.added} 条,跳过 ${ee.skipped} 条;生词本共 ${ee.total} 条。`,`Added ${ee.added}, skipped ${ee.skipped}; ${ee.total} words in vocabulary.`))}),children:f("确认导入","Import words")}),o.jsx("button",{type:"button",className:"btn",disabled:ie,onClick:()=>{Y(null),te(""),A(!1)},children:f("取消","Cancel")})]})]})]}),Se?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"actions",style:{justifyContent:"space-between"},children:[o.jsxs("span",{className:"caption",children:[f("本轮进度","Session progress")," ",Math.min(Se.index,Se.ids.length)," / ",Se.ids.length]}),o.jsxs("button",{type:"button",className:"btn",disabled:ie,onClick:re,children:[o.jsx(cr,{size:14}),f("结束复习","End review")]})]}),je?o.jsxs("div",{className:"card",children:[o.jsx("h2",{children:f("本轮复习完成","Review complete")}),o.jsx("p",{className:"muted",style:{marginBlock:12},children:f("掌握状态已保存。标记为「再练一次」的词语仍会出现在下次复习中。","Your progress is saved. Words marked “Again” remain available for your next review.")}),o.jsx("button",{type:"button",className:"btn",onClick:re,children:f("返回生词本","Back to vocabulary")})]}):ae&&o.jsxs("article",{className:"card word","aria-label":f("复习卡片","Review card"),children:[o.jsxs("div",{className:"section-title",children:[o.jsx("h2",{className:"grow",style:{overflowWrap:"anywhere"},children:ae.word}),o.jsx("button",{type:"button",className:"btn","aria-label":f("朗读词语","Read word aloud"),onClick:()=>de(ae.word),children:o.jsx(C0,{size:16})})]}),le?o.jsxs(o.Fragment,{children:[o.jsx("p",{style:{whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:ae.meaning||f("尚未填写释义,可返回列表编辑。","No meaning yet. Add one in the vocabulary list.")}),ae.sentence&&o.jsx("blockquote",{style:{whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:ae.sentence}),o.jsx(M0,{word:ae}),o.jsxs("div",{className:"actions",style:{marginTop:20},children:[o.jsx("button",{type:"button",className:"btn",disabled:ie,onClick:()=>Ne(!1),children:f("再练一次","Again")}),o.jsxs("button",{type:"button",className:"btn primary",disabled:ie,onClick:()=>Ne(!0),children:[o.jsx(Mo,{size:15}),f("已经掌握","Mastered")]})]})]}):o.jsx("button",{type:"button",className:"btn",disabled:ie,onClick:()=>X(!0),children:f("显示释义与例句","Show meaning and context")})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("label",{className:"search",style:{maxWidth:"none"},children:[o.jsx(ih,{size:15}),o.jsx("input",{type:"search","aria-label":f("搜索生词","Search vocabulary"),placeholder:f("搜索词语、释义或例句","Search words, meanings, or context"),value:d,onChange:ee=>m(ee.target.value)})]}),o.jsxs("div",{className:"vocabulary-filters",children:[o.jsxs("label",{className:"field",children:[o.jsx("span",{children:f("添加时间","Added")}),o.jsxs("select",{"aria-label":f("按添加时间筛选","Filter by added date"),value:S,onChange:ee=>y(ee.target.value),children:[o.jsx("option",{value:"all",children:f("全部时间","Any time")}),o.jsx("option",{value:"today",children:f("今天","Today")}),o.jsx("option",{value:"week",children:f("过去一周","Past week")}),o.jsx("option",{value:"month",children:f("过去一个月","Past month")})]})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:f("来源","Source")}),o.jsxs("select",{"aria-label":f("按来源筛选","Filter by source"),value:v,onChange:ee=>j(ee.target.value),children:[o.jsx("option",{value:"",children:f("全部来源","All sources")}),U.map(ee=>o.jsx("option",{value:ee,children:ee},ee)),v&&!U.includes(v)&&o.jsx("option",{value:v,children:v})]})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:f("排序","Sort")}),o.jsxs("select",{"aria-label":f("生词排序","Sort vocabulary"),value:w,onChange:ee=>E(ee.target.value),children:[o.jsx("option",{value:"newest",children:f("最新添加","Newest first")}),o.jsx("option",{value:"oldest",children:f("最早添加","Oldest first")}),o.jsx("option",{value:"alphabetical",children:f("字母顺序","Alphabetically")})]})]})]}),o.jsxs("div",{className:"actions",children:[o.jsx("span",{className:"caption",children:f(`显示 ${z.length} / ${l.length} 条`,`Showing ${z.length} of ${l.length}`)}),(d||p!=="all"||S!=="all"||v)&&o.jsx("button",{type:"button",className:"btn",onClick:()=>{m(""),g("all"),y("all"),j("")},children:f("清除筛选","Clear filters")})]}),o.jsx("div",{className:"actions","aria-label":f("掌握状态筛选","Filter by mastery"),children:["all","learning","mastered"].map(ee=>o.jsxs("button",{type:"button",className:"btn","aria-pressed":p===ee,onClick:()=>g(ee),style:p===ee?{background:"var(--overlay-medium)"}:void 0,children:[ee==="all"?f("全部","All"):ee==="learning"?f("学习中","Learning"):f("已掌握","Mastered")," ",ee==="all"?l.length:l.filter(fe=>ee==="mastered"?fe.reviewed:!fe.reviewed).length]},ee))}),!z.length&&o.jsxs("div",{className:"empty",children:[o.jsx(Zd,{size:30}),o.jsx("p",{children:l.length?f("没有符合当前搜索与筛选条件的词语。","No words match your search and filter."):f("在网页中选中词语,点击「加入生词本」。","Select a word on a web page and choose “Add to vocabulary”.")})]}),z.map(ee=>o.jsx(kj,{word:ee,locale:a,busy:ie,perform:C,mutate:V,speak:de},ee.id))]})]})}function M0({word:a}){const l=D0(a.url);return l?o.jsx("a",{href:l,target:"_blank",rel:"noopener noreferrer",style:{overflowWrap:"anywhere"},children:a.title||l}):null}function kj({word:a,locale:l,busy:u,perform:s,mutate:f,speak:d}){const m=(ue,I)=>l==="zh"?ue:I,[p,g]=k.useState(!1),[S,y]=k.useState(a.word),[v,j]=k.useState(a.meaning||""),[w,E]=k.useState(a.sentence),[T,A]=k.useState(!1),Z=k.useRef(null),Y=k.useRef(null),ye=S.trim()!==a.word||v.trim()!==(a.meaning||"")||w!==a.sentence;function te(){var ue;g(!1),(ue=Y.current)==null||ue.focus()}return o.jsxs("article",{className:"card word","data-word-id":a.id,children:[o.jsxs("div",{className:"section-title",style:{flexWrap:"wrap"},children:[o.jsx("h2",{className:"grow",style:{overflowWrap:"anywhere"},children:a.word}),o.jsx("button",{type:"button",className:"btn","aria-label":m("朗读词语","Read word aloud"),onClick:()=>d(a.word),children:o.jsx(C0,{size:16})}),o.jsx("button",{type:"button",className:"btn",ref:Y,"aria-label":m("编辑词语与释义","Edit word and meaning"),disabled:u||p,onClick:()=>{y(a.word),j(a.meaning||""),E(a.sentence),g(!0),A(!1)},children:o.jsx(d0,{size:15})}),o.jsx("button",{type:"button",className:"btn",ref:Z,"aria-label":m("移除词语","Remove word"),disabled:u||p,onClick:()=>A(!0),children:o.jsx(Ul,{size:15})})]}),p?o.jsxs("form",{onSubmit:ue=>{ue.preventDefault(),s(()=>f("vocab-meaning",{id:a.id,meaning:v,word:S,sentence:w}),()=>g(!1))},children:[o.jsxs("label",{className:"field",children:[o.jsx("span",{children:m("词语","Word")}),o.jsx("input",{value:S,autoFocus:!0,required:!0,maxLength:300,disabled:u,onChange:ue=>y(ue.target.value)})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:m("释义","Meaning")}),o.jsx("textarea",{value:v,maxLength:2e4,disabled:u,placeholder:m("填写释义或自己的理解","Add a definition or your own explanation"),onChange:ue=>j(ue.target.value)})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:m("例句与上下文","Example and context")}),o.jsx("textarea",{"aria-label":m("例句与上下文","Example and context"),value:w,maxLength:2e4,disabled:u,onChange:ue=>E(ue.target.value)})]}),o.jsxs("div",{className:"actions",children:[o.jsx("button",{type:"submit",className:"btn primary",disabled:u||!S.trim()||!ye,children:m("保存","Save")}),o.jsx("button",{type:"button",className:"btn",disabled:u,onClick:te,children:m("取消","Cancel")})]})]}):o.jsx("p",{className:a.meaning?void 0:"muted",style:{whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:a.meaning||m("尚未填写释义","No meaning yet")}),a.sentence&&o.jsx("blockquote",{style:{whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:a.sentence}),o.jsx(M0,{word:a}),o.jsxs("label",{className:"check",children:[o.jsx("input",{type:"checkbox",checked:a.reviewed,disabled:u||p,onChange:ue=>void s(()=>f("vocab-review",{id:a.id,reviewed:ue.target.checked}))}),m("已经掌握","Mastered")]}),T&&o.jsxs("div",{role:"group","aria-label":m("确认移除词语","Confirm word removal"),children:[o.jsx("p",{className:"muted",style:{marginBottom:8},children:m(`移除「${a.word}」及其释义和例句?此操作无法撤销。`,`Remove “${a.word}” and its meaning and context? This cannot be undone.`)}),o.jsxs("div",{className:"actions",children:[o.jsx("button",{type:"button",className:"btn",disabled:u,autoFocus:!0,onClick:()=>{var ue;A(!1),(ue=Z.current)==null||ue.focus()},children:m("取消","Cancel")}),o.jsx("button",{type:"button",className:"btn failed",disabled:u,onClick:()=>void s(()=>f("vocab-remove",{id:a.id})),children:m("确认移除","Confirm removal")})]})]})]})}const fr=[{name:"yellow",hex:"#F8F3DE",label:"重点"},{name:"red",hex:"#FBE3E3",label:"疑问"},{name:"green",hex:"#E1F3E5",label:"启发"},{name:"blue",hex:"#DFEBFB",label:"定义"},{name:"purple",hex:"#EFE4FA",label:"行动"}];function Dj(a){const l=fr.find(u=>u.hex.toLowerCase()===(a||"").toLowerCase());return l&&l.name!=="yellow"?l.label:null}function Bd(a){const l=Object.values(a).filter(s=>typeof s=="number");return Object.entries(a).filter(([s,f])=>l.indexOf(+s)===-1).map(([s,f])=>f)}function $v(a,l="|"){return a.map(u=>H0(u)).join(l)}function Hd(a,l){return typeof l=="bigint"?l.toString():l}class Mj{constructor(l){this._getter=l,this._value=void 0}get value(){const l=this._getter;return l!==void 0&&(this._value=l(),this._getter=void 0),this._value}}function rh(a){return new Mj(a)}function Rj(a){return a==null}function sh(a){const l=a.startsWith("^")?1:0,u=a.endsWith("$")?a.length-1:a.length;return a.slice(l,u)}function Uj(a,l){const u=a/l,s=Math.round(u),f=4*Number.EPSILON*Math.max(Math.abs(u),1);return Math.abs(u-s)<f?0:u-s}function Bl(a,l,u){Object.defineProperty(a,l,{value:u,writable:!0,enumerable:!0,configurable:!0})}function R0(a){const l=Object.getOwnPropertyDescriptor(a,"shape");return l!=null&&l.get?l.get.raw:l==null?void 0:l.value}function ll(a){return R0(a._zod.def)??a._zod.def.shape}function U0(a,l,u){Object.defineProperty(a,l,{get(){const s=u();return Bl(this,l,s),s},enumerable:!0,configurable:!0})}function Z0(a,l,u){l in a?Bl(a,l,u):a[l]=u}function gi(a,l,u,s){const f=ll(l);for(const d of u){const m=Object.getOwnPropertyDescriptor(f,d);m.enumerable&&(m.get?U0(a,d,()=>{const p=l._zod.def.shape[d];return s?s(p,d):p}):Z0(a,d,s?s(m.value,d):m.value))}}function Zj(a,l){for(const u of Reflect.ownKeys(l)){const s=Object.getOwnPropertyDescriptor(l,u);s.enumerable&&(s.get?U0(a,u,()=>l[u]):Z0(a,u,s.value))}}function qn(...a){const l={};for(const u of a){const s=Object.getOwnPropertyDescriptors(u);Object.assign(l,s)}return Object.defineProperties({},l)}function $j(a){return JSON.stringify(a)}function Bj(a){return a.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const $0="captureStackTrace"in Error?Error.captureStackTrace:(...a)=>{};function wo(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)}const Hj=rh(()=>{var a;if(ha.jitless||typeof navigator<"u"&&((a=navigator==null?void 0:navigator.userAgent)!=null&&a.includes("Cloudflare")))return!1;try{const l=Function;return new l(""),!0}catch{return!1}});function dr(a){if(wo(a)===!1)return!1;const l=a.constructor;if(l===void 0||typeof l!="function")return!0;const u=l.prototype;return!(wo(u)===!1||Object.prototype.hasOwnProperty.call(u,"isPrototypeOf")===!1)}function B0(a){return dr(a)?{...a}:Array.isArray(a)?[...a]:a instanceof Map?new Map(a):a instanceof Set?new Set(a):a}const Lj=new Set(["string","number","symbol"]);function Uo(a){return a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Hl(a,l,u){const s=new a._zod.constr(l??a._zod.def);return(!l||u!=null&&u.parent)&&(s._zod.parent=a),s}function Ee(a){const l=a;if(!l)return{};if(typeof l=="string")return{error:()=>l};if((l==null?void 0:l.message)!==void 0){if((l==null?void 0:l.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");l.error=l.message}return delete l.message,typeof l.error=="string"?{...l,error:()=>l.error}:l}function H0(a){return typeof a=="bigint"?a.toString()+"n":typeof a=="string"?`"${a}"`:`${a}`}function qj(a){return Object.keys(a).filter(l=>a[l]._zod.optin!==void 0&&a[l]._zod.optout==="optional")}const L0={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Yj={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Vj(a,l){const u=a._zod.def,s=u.checks;if(s&&s.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const d={};return gi(d,a,Zo(a,l)),Hl(a,qn(u,{shape:d,checks:[]}))}function Zo(a,l){var f;const u=ll(a),s=[];for(const d of Reflect.ownKeys(l)){if(!((f=Object.getOwnPropertyDescriptor(u,d))!=null&&f.enumerable))throw new Error(`Unrecognized key: "${String(d)}"`);l[d]&&s.push(d)}return s}function Gj(a,l){const u=a._zod.def,s=u.checks;if(s&&s.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const d=new Set(Zo(a,l)),m={};return gi(m,a,Reflect.ownKeys(ll(a)).filter(p=>!d.has(p))),Hl(a,qn(u,{shape:m,checks:[]}))}function Xj(a,l){if(!dr(l))throw new Error("Invalid input to extend: expected a plain object");const u=a._zod.def.checks;if(u&&u.length>0){const f=ll(a);for(const d of Reflect.ownKeys(l))if(Object.getOwnPropertyDescriptor(f,d)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Hl(a,qn(a._zod.def,{shape:q0(a,l)}))}function q0(a,l){const u={};return gi(u,a,Reflect.ownKeys(ll(a))),Zj(u,l),u}function Qj(a,l){if(!dr(l))throw new Error("Invalid input to safeExtend: expected a plain object");return Hl(a,qn(a._zod.def,{shape:q0(a,l)}))}function Fj(a,l){var f,d;if(!((f=l==null?void 0:l._zod)!=null&&f.def))throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if((d=a._zod.def.checks)!=null&&d.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const u={};gi(u,a,Reflect.ownKeys(ll(a))),gi(u,l,Reflect.ownKeys(ll(l)));const s=qn(a._zod.def,{shape:u,get catchall(){return l._zod.def.catchall},checks:l._zod.def.checks??[]});return Hl(a,s)}function Bv(a,l,u,s="partial"){const d=l._zod.def.checks;if(d&&d.length>0)throw new Error(`.${s}() cannot be used on object schemas containing refinements`);const p=u?new Set(Zo(l,u)):void 0,g={};return gi(g,l,Reflect.ownKeys(ll(l)),a&&((S,y)=>p&&!p.has(y)?S:new a({type:"optional",innerType:S}))),Hl(l,qn(l._zod.def,{shape:g,checks:[]}))}function Kj(a,l,u){const s=u?new Set(Zo(l,u)):void 0,f={};return gi(f,l,Reflect.ownKeys(ll(l)),(d,m)=>s&&!s.has(m)?d:new a({type:"nonoptional",innerType:d})),Hl(l,qn(l._zod.def,{shape:f}))}function tl(a,l=0){var u;if(a.aborted===!0)return!0;for(let s=l;s<a.issues.length;s++)if(((u=a.issues[s])==null?void 0:u.continue)!==!0)return!0;return!1}function Ij(a,l=0){var u;if(a.aborted===!0)return!0;for(let s=l;s<a.issues.length;s++)if(((u=a.issues[s])==null?void 0:u.continue)===!1)return!0;return!1}function or(a,l){return l.map(u=>{var s;return(s=u).path??(s.path=[]),u.path.unshift(a),u})}function bs(a){return typeof a=="string"?a:a==null?void 0:a.message}function Hv(a){const l=[];for(const u of a??[]){const s=u._zod.def;if(!/_(length|size)$|_equals$/.test(s.check))break;const f=s.maximum??s.length??s.size;f>=0&&l.push([f,u])}return l}function Ld(a,l,u){var s;for(let f=l;f<a.length;f++)(s=a[f]).schema??(s.schema=u)}function Zl(a,l,u){var g,S,y,v,j,w,E,T,A,Z;var s;const f=(S=(g=a.inst)==null?void 0:g._zod)==null?void 0:S.traits;f!=null&&f.has("$ZodType")&&(f.has("$ZodCheck")?(s=a).schema??(s.schema=a.inst):a.schema=a.inst);const d=a.schema!==a.inst?(v=(y=a.schema)==null?void 0:y._zod.def)==null?void 0:v.error:void 0,m=a.message?a.message:bs((E=(w=(j=a.inst)==null?void 0:j._zod.def)==null?void 0:w.error)==null?void 0:E.call(w,a))??bs(d==null?void 0:d(a))??bs((T=l==null?void 0:l.error)==null?void 0:T.call(l,a))??bs((A=u.customError)==null?void 0:A.call(u,a))??bs((Z=u.localeError)==null?void 0:Z.call(u,a))??"Invalid input",p={};for(const Y of Object.keys(a))Y==="inst"||Y==="schema"||Y==="continue"||Y==="input"||Y==="__proto__"||(p[Y]=a[Y]);return p.path??(p.path=[]),p.message=m,l!=null&&l.reportInput&&(p.input=a.input),p}const Jj=/[\uD800-\uDBFF]/;function uh(a){const l=a.length;if(!Jj.test(a))return l;let u=l;for(let s=0;s<l-1;s++)(a.charCodeAt(s)&64512)===55296&&(a.charCodeAt(s+1)&64512)===56320&&(u--,s++);return u}function oh(a){return Array.isArray(a)?"array":typeof a=="string"?"string":"unknown"}function Pj(a){const l=typeof a;switch(l){case"number":return Number.isNaN(a)?"nan":"number";case"object":{if(a===null)return"null";if(Array.isArray(a))return"array";const u=a;if(u&&Object.getPrototypeOf(u)!==Object.prototype&&"constructor"in u&&u.constructor)return u.constructor.name}}return l}function Ms(...a){const[l,u,s]=a;return typeof l=="string"?{message:l,code:"custom",input:u,inst:s}:{...l}}function Wj(a,l){for(const u in l){const s=Object.getOwnPropertyDescriptor(l,u);s.get?Object.defineProperty(a,u,{...s,enumerable:!1}):e2(a,u,s.value)}}function $l(a,l,u,s=!0){return Object.defineProperty(a,l,{configurable:!0,writable:!0,enumerable:s,value:u}),u}function Y0(a,l,u){return $l(a,l,u,!1)}function V0(a,l){for(const u in a){const s=a[u];Object.defineProperty(l,u,{configurable:!0,enumerable:!0,get(){return $l(this,u,s(this))},set(f){$l(this,u,f)}})}return l}function e2(a,l,u){Object.defineProperty(a,l,{configurable:!0,get(){return this==null?u:$l(this,l,u.bind(this))},set(s){$l(this,l,s)}})}function t2(a,l){const u=Object.getPrototypeOf(a);return l in u?void 0:u}let zd,Rl=!1;const n2={configurable:!0,get(){Rl=!0}};function rt(a,l,u){const s=Object.getPrototypeOf(a._zod);if(l in s&&zd!==a._zod){zd=void 0;return}zd=a._zod,Object.defineProperty(s,l,{configurable:!0,get(){Object.defineProperty(this,l,n2);const f=Rl;Rl=!1;try{const d=u(this);return Rl?delete this[l]:Object.defineProperty(this,l,{configurable:!0,writable:!0,value:d}),Rl=Rl||f,d}catch(d){throw delete this[l],Rl=Rl||f,d}},set(f){Object.defineProperty(this,l,{configurable:!0,writable:!0,value:f})}})}function a2(a,l,u,s){const f=t2(a,l);f&&Object.defineProperty(f,l,{configurable:!0,get(){const d={configurable:!0,writable:!0,enumerable:s,value:void 0};return Object.defineProperty(this,l,d),d.value=u(this),Object.defineProperty(this,l,d),d.value},set(d){Object.defineProperty(this,l,{configurable:!0,writable:!0,enumerable:s,value:d})}})}const l2="~constantCatch";function i2(a){const l=()=>a;return l[l2]=!0,l}var Lv;const wd={value:void 0,enumerable:!1};let qv="captureStackTrace"in Error?Error:null;function r2(a){const l=qv;if(l){const u=l.stackTraceLimit;if(typeof u=="number"){try{l.stackTraceLimit=0}catch{return qv=null,new a}try{return new a}finally{l.stackTraceLimit=u}}}return new a}function W(a,l,u,s){const f={};function d(j){this.def=j,this.constr=v,this.traits=new Set}d.prototype=f;const m=u,p=m&&new WeakSet;function g(j,w){if(j._zod){if(j._zod.traits.has(a))return}else{wd.value=new d(w);try{Object.defineProperty(j,"_zod",wd)}finally{wd.value=void 0}}if(j._zod.traits.add(a),l(j,w),p){const T=Object.getPrototypeOf(j),A=j._zod.constr.prototype;let Z=T;for(;Z&&Z!==A;)Z=Object.getPrototypeOf(Z);const Y=Z??T;p.has(Y)||(p.add(Y),Wj(Y,m))}const E=v.prototype;for(const T in E)Object.prototype.hasOwnProperty.call(E,T)&&(T in j||(j[T]=E[T].bind(j)))}const S=(s==null?void 0:s.Parent)??Object;class y extends S{}Object.defineProperty(y,"name",{value:a});function v(j){var A;const w=s!=null&&s.Parent?r2(y):this;g(w,j);const E=w._zod.deferred;if(E){for(const Z of E)Z();w._zod.deferred=void 0}const T=(A=globalThis.__zod_globalConfig)==null?void 0:A.postProcessor;return T&&T(w),w}return Object.defineProperty(v,"init",{value:g}),Object.defineProperty(v,Symbol.hasInstance,{value:j=>{var w,E;return s!=null&&s.Parent&&j instanceof s.Parent?!0:(E=(w=j==null?void 0:j._zod)==null?void 0:w.traits)==null?void 0:E.has(a)}}),Object.defineProperty(v,"name",{value:a}),v}class pi extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class G0 extends Error{constructor(l){super(`Encountered unidirectional transform during encode: ${l}`),this.name="ZodEncodeError"}}(Lv=globalThis).__zod_globalConfig??(Lv.__zod_globalConfig={});const ha=globalThis.__zod_globalConfig;function ka(a){return a&&Object.assign(ha,a),ha}function s2(){const a=this._zod;return a.message??(a.message=JSON.stringify(a.def,Hd,2)),a.message}function u2(a){this._zod.message=a}const o2={get:s2,set:u2,enumerable:!0,configurable:!0},Nd={value:void 0,enumerable:!1},Yv=new WeakSet([Object.prototype,Error.prototype]),c2=(a,l)=>{a.name="$ZodError",Nd.value=l,Object.defineProperty(a,"issues",Nd),Nd.value=void 0,Object.defineProperty(a,"message",o2);const u=Object.getPrototypeOf(a);Yv.has(u)||(Yv.add(u),Object.defineProperty(u,"toString",{configurable:!0,enumerable:!1,get(){const s=()=>this.message;return Object.defineProperty(this,"toString",{value:s,configurable:!0,writable:!0}),s},set(s){Object.defineProperty(this,"toString",{value:s,configurable:!0,writable:!0})}}))},f2=W("$ZodError",c2);function d2(a,l,u){return Object.prototype.hasOwnProperty.call(a,l)||(l==="__proto__"?Object.defineProperty(a,l,{value:u(),writable:!0,enumerable:!0,configurable:!0}):a[l]=u()),a[l]}function h2(a,l=u=>u.message){const u={},s=[];for(const f of a.issues)f.path.length>0?d2(u,f.path[0],()=>[]).push(l(f)):s.push(l(f));return{formErrors:s,fieldErrors:u}}function m2(a,l=u=>u.message){const u={_errors:[]},s=(f,d=[])=>{for(const m of f.issues)if(m.code==="invalid_union"&&m.errors.length)m.errors.map(p=>s({issues:p},[...d,...m.path]));else if(m.code==="invalid_key")s({issues:m.issues},[...d,...m.path]);else if(m.code==="invalid_element")s({issues:m.issues},[...d,...m.path]);else{const p=[...d,...m.path];if(p.length===0)u._errors.push(l(m));else{let g=u,S=0;for(;S<p.length;){const y=p[S],v=S===p.length-1;if(y==="_errors"){v&&g._errors.push(l(m)),S++;continue}Object.prototype.hasOwnProperty.call(g,y)||Object.defineProperty(g,y,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});const j=g[y];v&&j._errors.push(l(m)),g=j,S++}}}};return s(a),u}function $o(a,l){return{callee:(l==null?void 0:l.callee)??a,Err:l==null?void 0:l.Err}}const ch=a=>{const l=(u,s,f,d)=>{const m=f?{...f,async:!1}:{async:!1},p=u._zod.run({value:s,issues:[]},m);if(p instanceof Promise)throw new pi;if(p.issues.length){const g=new((d==null?void 0:d.Err)??a)(p.issues.map(S=>Zl(S,m,ka())));throw $0(g,(d==null?void 0:d.callee)??l),g}return p.value};return l},fh=a=>{const l=async(u,s,f,d)=>{const m=f?{...f,async:!0}:{async:!0};let p=u._zod.run({value:s,issues:[]},m);if(p instanceof Promise&&(p=await p),p.issues.length){const g=new((d==null?void 0:d.Err)??a)(p.issues.map(S=>Zl(S,m,ka())));throw $0(g,(d==null?void 0:d.callee)??l),g}return p.value};return l},dh=a=>(l,u,s)=>{const f=s?{...s,async:!1}:{async:!1},d=l._zod.run({value:u,issues:[]},f);if(d instanceof Promise)throw new pi;return d.issues.length?X0(a,d.issues,f):{success:!0,data:d.value}};function X0(a,l,u){let s;return{success:!1,get error(){return s||(s=new a(l.map(f=>Zl(f,u,ka()))),l=void 0,u=void 0),s},set error(f){s=f,l=void 0,u=void 0}}}const hh=a=>async(l,u,s)=>{const f=s?{...s,async:!0}:{async:!0};let d=l._zod.run({value:u,issues:[]},f);return d instanceof Promise&&(d=await d),d.issues.length?X0(a,d.issues,f):{success:!0,data:d.value}},p2=Symbol.for("zod.compile.invalid"),g2=Symbol.for("zod.compile.fallback"),v2=((a,l,u)=>{const s=a._zod.bag.validator;if(s!==void 0){if(s(l)!==p2)return!0;if(s.definite===!0&&u===void 0)return!1}return y2(a,l,u)});function y2(a,l,u){const s=u?{...u,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},f=a._zod.bag.fallbackRun;let d;if(f?(s[g2]=!0,d=f({value:l,issues:[]},s)):d=a._zod.run({value:l,issues:[]},s),d instanceof Promise)throw new pi;return d.issues.length===0}const b2=async(a,l,u)=>{const s=u?{...u,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0};let f=a._zod.run({value:l,issues:[]},s);return f instanceof Promise&&(f=await f),f.issues.length===0},x2=a=>{const l=ch(a),u=(s,f,d,m)=>{const p=d?{...d,direction:"backward"}:{direction:"backward"};return l(s,f,p,$o(u,m))};return u},S2=a=>{const l=ch(a),u=(s,f,d,m)=>l(s,f,d,$o(u,m));return u},j2=a=>{const l=fh(a),u=async(s,f,d,m)=>{const p=d?{...d,direction:"backward"}:{direction:"backward"};return await l(s,f,p,$o(u,m))};return u},_2=a=>{const l=fh(a),u=async(s,f,d,m)=>await l(s,f,d,$o(u,m));return u},z2=a=>(l,u,s)=>{const f=s?{...s,direction:"backward"}:{direction:"backward"};return dh(a)(l,u,f)},w2=a=>(l,u,s)=>dh(a)(l,u,s),N2=a=>async(l,u,s)=>{const f=s?{...s,direction:"backward"}:{direction:"backward"};return hh(a)(l,u,f)},C2=a=>async(l,u,s)=>hh(a)(l,u,s),E2=/^[cC][0-9a-z]{6,}$/,T2=/^[0-9a-z]+$/,A2=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,O2=/^[0-9a-vA-V]{20}$/,k2=/^[A-Za-z0-9]{27}$/,D2=/^[a-zA-Z0-9_-]{21}$/;function M2(a){return new RegExp(`^[a-zA-Z0-9_-]{${a}}$`)}const R2=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,U2=/^([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})$/,Vv=a=>a?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${a}[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)$/,Z2=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,$2="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function B2(){return new RegExp($2,"u")}const H2=/^(?:(?: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])$/,L2=/^(([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}|:))$/,q2=/^((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])$/,Y2=/^(([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])$/,V2=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,G2=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,X2=/^https?$/,Q2=/^\+[1-9]\d{6,14}$/,Q0="(?:(?:\\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 F2(a){return new RegExp(`^${a}$`)}const K2=F2(Q0);function qd(a){const l="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof a.precision=="number"?a.precision===-1?`${l}`:a.precision===0?`${l}:[0-5]\\d`:`${l}:[0-5]\\d\\.\\d{${a.precision}}`:a.seconds?`${l}:[0-5]\\d(?:\\.\\d+)?`:`${l}(?::[0-5]\\d(?:\\.\\d+)?)?`}function I2(a){return new RegExp(`^${qd(a)}$`)}function J2(a){const l=["Z"];a.offset&&l.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const u=`${qd({precision:a.precision,seconds:!0})}(?:${l.join("|")})`,s=a.local?`${u}|${qd({precision:a.precision})}`:u;return new RegExp(`^${Q0}T(?:${s})$`)}const P2=/^[\s\S]{0,}$/,W2=/^-?\d+$/,mh=/^-?\d+(?:\.\d+)?$/,e_=/^(?:true|false)$/i,t_=/^[^A-Z]*$/,n_=/^[^a-z]*$/,En=W("$ZodCheck",(a,l)=>{var u;a._zod??(a._zod={}),a._zod.def=l,(u=a._zod).onattach??(u.onattach=[])}),ph=a=>{const l=a.value;return!Rj(l)&&l.length!==void 0},No={number:"number",bigint:"bigint",object:"date"},F0=W("$ZodCheckLessThan",(a,l)=>{En.init(a,l);const u=No[typeof l.value];a._zod.check=s=>{(l.inclusive?s.value<=l.value:s.value<l.value)||s.issues.push({origin:No[typeof s.value]??u,code:"too_big",maximum:typeof l.value=="object"?l.value.getTime():l.value,input:s.value,inclusive:l.inclusive,inst:a,continue:!l.abort})}}),K0=W("$ZodCheckGreaterThan",(a,l)=>{En.init(a,l);const u=No[typeof l.value];a._zod.check=s=>{(l.inclusive?s.value>=l.value:s.value>l.value)||s.issues.push({origin:No[typeof s.value]??u,code:"too_small",minimum:typeof l.value=="object"?l.value.getTime():l.value,input:s.value,inclusive:l.inclusive,inst:a,continue:!l.abort})}}),a_=W("$ZodCheckMultipleOf",(a,l)=>{En.init(a,l),a._zod.check=u=>{if(typeof u.value!=typeof l.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof u.value=="bigint"?l.value!==BigInt(0)&&u.value%l.value===BigInt(0):Uj(u.value,l.value)===0)||u.issues.push({origin:typeof u.value,code:"not_multiple_of",divisor:l.value,input:u.value,inst:a,continue:!l.abort})}}),l_=W("$ZodCheckNumberFormat",(a,l)=>{var m;En.init(a,l),l.format=l.format||"float64";const u=(m=l.format)==null?void 0:m.includes("int"),s=u?"int":"number",[f,d]=L0[l.format];a._zod.check=p=>{const g=p.value;if(u){if(!Number.isInteger(g)){p.issues.push({expected:s,format:l.format,code:"invalid_type",continue:!1,input:g,inst:a});return}if(!Number.isSafeInteger(g)){g>0?p.issues.push({input:g,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:a,origin:s,inclusive:!0,continue:!l.abort}):p.issues.push({input:g,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:a,origin:s,inclusive:!0,continue:!l.abort});return}}g<f&&p.issues.push({origin:"number",input:g,code:"too_small",minimum:f,inclusive:!0,inst:a,continue:!l.abort}),g>d&&p.issues.push({origin:"number",input:g,code:"too_big",maximum:d,inclusive:!0,inst:a,continue:!l.abort})}}),i_=W("$ZodCheckMaxLength",(a,l)=>{var u;En.init(a,l),(u=a._zod.def).when??(u.when=ph),a._zod.check=s=>{const f=s.value,d=f.length;if((typeof f=="string"&&d>l.maximum?uh(f):d)<=l.maximum)return;const p=oh(f);s.issues.push({origin:p,code:"too_big",maximum:l.maximum,inclusive:!0,input:f,inst:a,continue:!l.abort})}}),r_=W("$ZodCheckMinLength",(a,l)=>{var u;En.init(a,l),(u=a._zod.def).when??(u.when=ph),a._zod.check=s=>{const f=s.value,d=f.length;if((typeof f=="string"&&d>=l.minimum&&d<l.minimum*2?uh(f):d)>=l.minimum)return;const p=oh(f);s.issues.push({origin:p,code:"too_small",minimum:l.minimum,inclusive:!0,input:f,inst:a,continue:!l.abort})}}),s_=W("$ZodCheckLengthEquals",(a,l)=>{var u;En.init(a,l),(u=a._zod.def).when??(u.when=ph),a._zod.check=s=>{const f=s.value,d=f.length,m=typeof f=="string"&&d>=l.length&&d<=l.length*2?uh(f):d;if(m===l.length)return;const p=oh(f),g=m>l.length;s.issues.push({origin:p,...g?{code:"too_big",maximum:l.length}:{code:"too_small",minimum:l.length},inclusive:!0,exact:!0,input:s.value,inst:a,continue:!l.abort})}}),Bo=W("$ZodCheckStringFormat",(a,l)=>{var u,s;En.init(a,l),l.pattern?(u=a._zod).check??(u.check=f=>{l.pattern.lastIndex=0,!l.pattern.test(f.value)&&f.issues.push({origin:"string",code:"invalid_format",format:l.format,input:f.value,...l.pattern?{pattern:l.pattern.toString()}:{},inst:a,continue:!l.abort})}):(s=a._zod).check??(s.check=()=>{})}),u_=W("$ZodCheckRegex",(a,l)=>{Bo.init(a,l),a._zod.check=u=>{l.pattern.lastIndex=0,!l.pattern.test(u.value)&&u.issues.push({origin:"string",code:"invalid_format",format:"regex",input:u.value,pattern:l.pattern.toString(),inst:a,continue:!l.abort})}}),o_=W("$ZodCheckLowerCase",(a,l)=>{l.pattern??(l.pattern=t_),Bo.init(a,l)}),c_=W("$ZodCheckUpperCase",(a,l)=>{l.pattern??(l.pattern=n_),Bo.init(a,l)}),f_=W("$ZodCheckIncludes",(a,l)=>{En.init(a,l);const u=Uo(l.includes),s=new RegExp(typeof l.position=="number"?`^.{${l.position},}${u}`:u);l.pattern=s,a._zod.check=f=>{f.value.includes(l.includes,l.position)||f.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:l.includes,input:f.value,inst:a,continue:!l.abort})}}),d_=W("$ZodCheckStartsWith",(a,l)=>{En.init(a,l);const u=new RegExp(`^${Uo(l.prefix)}.*`);l.pattern??(l.pattern=u),a._zod.check=s=>{s.value.startsWith(l.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:l.prefix,input:s.value,inst:a,continue:!l.abort})}}),h_=W("$ZodCheckEndsWith",(a,l)=>{En.init(a,l);const u=new RegExp(`.*${Uo(l.suffix)}$`);l.pattern??(l.pattern=u),a._zod.check=s=>{s.value.endsWith(l.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:l.suffix,input:s.value,inst:a,continue:!l.abort})}}),m_=W("$ZodCheckOverwrite",(a,l)=>{En.init(a,l),a._zod.check=u=>{u.value=l.tx(u.value)}});class p_{constructor(l=[],u={}){this.content=[],this.indent=0,this.args=l,this.closed=u}indented(l){this.indent+=1;try{l(this)}finally{this.indent-=1}}write(l){if(typeof l=="function"){l(this,{execution:"sync"}),l(this,{execution:"async"});return}const s=l.split(`
|
|
302
|
+
`).filter(m=>m),f=Math.min(...s.map(m=>m.length-m.trimStart().length)),d=s.map(m=>m.slice(f)).map(m=>" ".repeat(this.indent*2)+m);for(const m of d)this.content.push(m)}compile(){const l=Function,u=(this==null?void 0:this.content)??[""];return new l(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
303
|
+
${u.join(`
|
|
304
|
+
`)}
|
|
305
|
+
};`)(...Object.values(this.closed))}}const g_={major:4,minor:6,patch:7},Ct=W("$ZodType",(a,l)=>{var d;var u;a??(a={}),a._zod.def=l,a._zod.bag=a._zod.bag||{},a._zod.version=g_;const s=a._zod.def.checks,f=a._zod.traits.has("$ZodCheck")?[a,...s??[]]:s!=null&&s.length?[...s]:[];for(const m of f)for(const p of m._zod.onattach)p(a);if(f.length===0)(u=a._zod).deferred??(u.deferred=[]),(d=a._zod.deferred)==null||d.push(()=>{a._zod.run=a._zod.parse});else{const m=(g,S,y)=>{if(g.memo)return g;let v=tl(g),j;for(const w of S){if(w._zod.def.when){if(Ij(g)||!w._zod.def.when(g))continue}else if(v)continue;const E=g.issues.length,T=w._zod.check(g);if(T instanceof Promise&&(y==null?void 0:y.async)===!1)throw new pi;if(j||T instanceof Promise)j=(j??Promise.resolve()).then(async()=>{await T,g.issues.length!==E&&(Ld(g.issues,E,a),v||(v=tl(g,E)))});else{if(g.issues.length===E)continue;Ld(g.issues,E,a),v||(v=tl(g,E))}}return j?j.then(()=>g):g},p=(g,S,y)=>{if(tl(g))return g.aborted=!0,g;const v=m(S,f,y);if(v instanceof Promise){if(y.async===!1)throw new pi;return v.then(j=>a._zod.parse(j,y))}return a._zod.parse(v,y)};a._zod.run=(g,S)=>{if(S.skipChecks)return a._zod.parse(g,S);if(S.direction==="backward"){const v=a._zod.parse({value:g.value,issues:[]},{...S,skipChecks:!0});return v instanceof Promise?v.then(j=>p(j,g,S)):p(v,g,S)}const y=a._zod.parse(g,S);if(y instanceof Promise){if(S.async===!1)throw new pi;return y.then(v=>m(v,f,S))}return m(y,f,S)}}},{get"~standard"(){return Y0(this,"~standard",J0(this))},set"~standard"(a){$l(this,"~standard",a)}}),I0=(a,l)=>a.issues.length?{issues:a.issues.map(u=>Zl(u,l,ka()))}:{value:a.value};async function v_(a,l){const u={async:!0};return I0(await a._zod.run({value:l,issues:[]},u),u)}function J0(a){return{validate:l=>{const u={async:!1};try{const s=a._zod.run({value:l,issues:[]},u);if(!(s instanceof Promise))return I0(s,u)}catch{}return v_(a,l)},vendor:"zod",version:1}}const gh=W("$ZodString",(a,l)=>{Ct.init(a,l),a._zod.pattern=l.pattern??P2,a._zod.parse=(u,s)=>{if(l.coerce)try{u.value=String(u.value)}catch{}return typeof u.value=="string"||u.issues.push({expected:"string",code:"invalid_type",input:u.value,inst:a}),u}}),bt=W("$ZodStringFormat",(a,l)=>{Bo.init(a,l),gh.init(a,l)}),y_=W("$ZodGUID",(a,l)=>{l.pattern??(l.pattern=U2),bt.init(a,l)}),b_=W("$ZodUUID",(a,l)=>{if(l.version){const s={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[l.version];if(s===void 0)throw new Error(`Invalid UUID version: "${l.version}"`);l.pattern??(l.pattern=Vv(s))}else l.pattern??(l.pattern=Vv());bt.init(a,l)}),x_=W("$ZodEmail",(a,l)=>{l.pattern??(l.pattern=Z2),bt.init(a,l)}),P0=1,Co=2;function W0(a){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(a):(new URL(a),!0)}catch{return!1}}function S_(a,l){return!("normalize"in l)&&!("hostname"in l)&&!("protocol"in l)?W0(a)||Co:j_(a,l)}function j_(a,l){var u;if(!l.normalize&&((u=l.protocol)==null?void 0:u.source)===X2.source&&!/^https?:\/\//i.test(a))return P0;try{if(typeof URL<"u"){const s=URL;if(typeof s.parse=="function")return s.parse(a)??Co}return new URL(a)}catch{return Co}}const __=/[\t\n\r]/g;function Gv(a){return a.replace(__,"")}function z_(a,l){return l.lastIndex=0,l.test(a.hostname)}function w_(a,l){return l.lastIndex=0,l.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)}const N_=W("$ZodURL",(a,l)=>{bt.init(a,l),a._zod.check=u=>{try{const s=u.value.trim(),f=S_(s,l);if(f===P0){u.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:u.value,inst:a,continue:!l.abort});return}if(f===Co){u.issues.push({code:"invalid_format",format:"url",input:u.value,inst:a,continue:!l.abort});return}if(f===!0){u.value=Gv(s);return}l.hostname&&!z_(f,l.hostname)&&u.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:l.hostname.source,input:u.value,inst:a,continue:!l.abort}),l.protocol&&!w_(f,l.protocol)&&u.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:l.protocol.source,input:u.value,inst:a,continue:!l.abort}),u.value=l.normalize?f.href:Gv(s);return}catch{u.issues.push({code:"invalid_format",format:"url",input:u.value,inst:a,continue:!l.abort})}}}),C_=W("$ZodEmoji",(a,l)=>{l.pattern??(l.pattern=B2()),bt.init(a,l)}),E_=W("$ZodNanoID",(a,l)=>{if(l.length!==void 0&&(!Number.isInteger(l.length)||l.length<1))throw new Error(`Invalid nanoid length: ${l.length}`);l.pattern??(l.pattern=l.length===void 0?D2:M2(l.length)),bt.init(a,l)}),T_=W("$ZodCUID",(a,l)=>{l.pattern??(l.pattern=E2),bt.init(a,l)}),A_=W("$ZodCUID2",(a,l)=>{l.pattern??(l.pattern=T2),bt.init(a,l)}),O_=W("$ZodULID",(a,l)=>{l.pattern??(l.pattern=A2),bt.init(a,l)}),k_=W("$ZodXID",(a,l)=>{l.pattern??(l.pattern=O2),bt.init(a,l)}),D_=W("$ZodKSUID",(a,l)=>{l.pattern??(l.pattern=k2),bt.init(a,l)}),M_=W("$ZodISODateTime",(a,l)=>{l.pattern??(l.pattern=J2(l)),bt.init(a,l)}),R_=W("$ZodISODate",(a,l)=>{l.pattern??(l.pattern=K2),bt.init(a,l)}),U_=W("$ZodISOTime",(a,l)=>{l.pattern??(l.pattern=I2(l)),bt.init(a,l)}),Z_=W("$ZodISODuration",(a,l)=>{l.pattern??(l.pattern=R2),bt.init(a,l)}),$_=W("$ZodIPv4",(a,l)=>{l.pattern??(l.pattern=H2),bt.init(a,l)}),B_=/^[0-9a-fA-F:.]+$/;function eb(a){return B_.test(a)?W0(`http://[${a}]`):!1}const H_=W("$ZodIPv6",(a,l)=>{l.pattern??(l.pattern=L2),bt.init(a,l),a._zod.check=u=>{eb(u.value)||u.issues.push({code:"invalid_format",format:"ipv6",input:u.value,inst:a,continue:!l.abort})}}),L_=W("$ZodCIDRv4",(a,l)=>{l.pattern??(l.pattern=q2),bt.init(a,l)});function q_(a){const l=a.split("/");if(l.length!==2)return!1;const[u,s]=l;if(!s)return!1;const f=Number(s);return`${f}`!==s||f<0||f>128?!1:eb(u)}const Y_=W("$ZodCIDRv6",(a,l)=>{l.pattern??(l.pattern=Y2),bt.init(a,l),a._zod.check=u=>{q_(u.value)||u.issues.push({code:"invalid_format",format:"cidrv6",input:u.value,inst:a,continue:!l.abort})}});function tb(a){if(a==="")return!0;if(/\s/.test(a)||a.length%4!==0)return!1;try{return atob(a),!0}catch{return!1}}const nb=/^[0-9a-zA-Z+/]*={0,2}$/,V_=W("$ZodBase64",(a,l)=>{l.pattern??(l.pattern=nb),bt.init(a,l),a._zod.check=u=>{tb(u.value)||u.issues.push({code:"invalid_format",format:"base64",input:u.value,inst:a,continue:!l.abort})}}),vh=/^[A-Za-z0-9_-]*$/;function G_(a){if(!vh.test(a))return!1;const l=a.replace(/[-_]/g,s=>s==="-"?"+":"/"),u=l.padEnd(Math.ceil(l.length/4)*4,"=");return tb(u)}const X_=W("$ZodBase64URL",(a,l)=>{l.pattern??(l.pattern=vh),bt.init(a,l),a._zod.check=u=>{G_(u.value)||u.issues.push({code:"invalid_format",format:"base64url",input:u.value,inst:a,continue:!l.abort})}}),Q_=W("$ZodE164",(a,l)=>{l.pattern??(l.pattern=Q2),bt.init(a,l)});function F_(a,l=null){try{const u=a.split(".");if(u.length!==3)return!1;const[s]=u;if(!s)return!1;const f=JSON.parse(atob(s));return!("typ"in f&&(f==null?void 0:f.typ)!=="JWT"||!f.alg||l&&(!("alg"in f)||f.alg!==l))}catch{return!1}}const K_=W("$ZodJWT",(a,l)=>{bt.init(a,l),a._zod.check=u=>{F_(u.value,l.alg)||u.issues.push({code:"invalid_format",format:"jwt",input:u.value,inst:a,continue:!l.abort})}}),ab=W("$ZodNumber",(a,l)=>{Ct.init(a,l),a._zod.pattern=mh,a._zod.parse=(u,s)=>{if(l.coerce)try{u.value=Number(u.value)}catch{}const f=u.value;if(typeof f=="number"&&!Number.isNaN(f)&&Number.isFinite(f))return u;const d=typeof f=="number"?Number.isNaN(f)?"NaN":Number.isFinite(f)?void 0:String(f):void 0;return u.issues.push({expected:"number",code:"invalid_type",input:f,inst:a,...d?{received:d}:{}}),u}}),I_=W("$ZodNumberFormat",(a,l)=>{l_.init(a,l),ab.init(a,l)}),J_=W("$ZodBoolean",(a,l)=>{Ct.init(a,l),a._zod.pattern=e_,a._zod.parse=(u,s)=>{if(l.coerce)try{u.value=!!u.value}catch{}const f=u.value;return typeof f=="boolean"||u.issues.push({expected:"boolean",code:"invalid_type",input:f,inst:a}),u}}),P_=W("$ZodUnknown",(a,l)=>{Ct.init(a,l),a._zod.parse=u=>u}),W_=W("$ZodNever",(a,l)=>{Ct.init(a,l),a._zod.parse=(u,s)=>(u.issues.push({expected:"never",code:"invalid_type",input:u.value,inst:a}),u)});function ez(a,l){const u=Hv(a._zod.def.checks);if(!u.length)return;const s=Math.min(...u.map(d=>d[0])),f=a._zod.parse;a._zod.parse=(d,m)=>{const p=l(d.value);if(p>s&&!(m!=null&&m.skipChecks)&&(m==null?void 0:m.direction)!=="backward"){for(const[g,S]of Hv(a._zod.def.checks))if(p>g&&S._zod.def.when(d)){const y=d.issues.length;return S._zod.check(d),d.issues[y].continue=!1,Ld(d.issues,y,a),d}}return f(d,m)}}const tz=a=>Array.isArray(a)?a.length:-1;function Xv(a,l,u){a.issues.length&&l.issues.push(...or(u,a.issues)),l.value[u]=a.value}const nz=W("$ZodArray",(a,l)=>{Ct.init(a,l);const u=ha.memoizer;u==null||u.attach(a),a._zod.parse=(s,f)=>{const d=s.value;if(!Array.isArray(d))return s.issues.push({expected:"array",code:"invalid_type",input:d,inst:a}),s;s.value=u?u.alloc(a,s,Array(d.length),f):Array(d.length);const m=[],p=f==null?void 0:f.abortEarly;for(let g=0;g<d.length;g++){const S=d[g],y=l.element._zod.run({value:S,issues:[]},f);if(y instanceof Promise)m.push(y.then(v=>Xv(v,s,g)));else if(Xv(y,s,g),p&&y.issues.length!==0&&tl(y))break}return m.length?Promise.all(m).then(()=>s):s},ez(a,tz)});function Eo(a,l,u,s,f,d){const m=u in s,p=d==="optional";if(!(!m&&p&&f==="optional")){if(a.issues.length){if(f!==void 0&&p&&!m)return;l.issues.push(...or(u,a.issues))}if(!m&&f===void 0){a.issues.length||l.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[u]});return}a.value===void 0?(m||f==="defaulted"&&!p)&&(l.value[u]=void 0):l.value[u]=a.value}}const az=[];function lb(a){var m,p,g,S;const l=Object.keys(a.shape),u=Object.getOwnPropertySymbols(a.shape),s=u.length?u:az,f=s.length?[...l,...s]:l;for(const y of f)if(!((S=(g=(p=(m=a.shape)==null?void 0:m[y])==null?void 0:p._zod)==null?void 0:g.traits)!=null&&S.has("$ZodType")))throw new Error(`Invalid element at key "${String(y)}": expected a Zod schema`);const d=qj(a.shape);return{...a,allKeys:f,symbolKeys:s,keySet:new Set(l),numKeys:l.length,optionalKeys:new Set(d)}}function ib(a,l,u,s,f,d,m){const p=[],g=f.keySet,S=f.catchall._zod,y=S.def.type,v=S.optin,j=S.optout;let w=0;for(const E in l){if(m&&u.issues.length!==w){if(tl(u,w))break;w=u.issues.length}if(g.has(E))continue;if(E==="__proto__"){y==="never"&&p.push(E);continue}if(y==="never"){p.push(E);continue}const T=S.run({value:l[E],issues:[]},s);T instanceof Promise?a.push(T.then(A=>Eo(A,u,E,l,v,j))):Eo(T,u,E,l,v,j)}return p.length&&u.issues.push({code:"unrecognized_keys",keys:p,input:l,inst:d,continue:!0}),a.length?Promise.all(a).then(()=>u):u}const lz=W("$ZodObject",(a,l)=>{Ct.init(a,l);const u=Object.getOwnPropertyDescriptor(l,"shape"),s=u!=null&&u.get?u.get.raw:l.shape??{};if(s){const S=()=>{const y={...s};return Object.defineProperty(l,"shape",{value:y}),S.raw=y,y};S.raw=s,Object.defineProperty(l,"shape",{get:S})}const f=rh(()=>lb(l));rt(a,"propValues",S=>{const y=S.def.shape,v={};for(const j in y){const w=y[j]._zod;if(w.values){Object.prototype.hasOwnProperty.call(v,j)||Bl(v,j,new Set);for(const E of w.values)v[j].add(E);w.optin!==void 0&&v[j].add(void 0)}}return v});const d=wo,m=l.catchall;let p;const g=ha.memoizer;g==null||g.attach(a),a._zod.parse=(S,y)=>{p??(p=f.value);const v=S.value;if(!d(v))return S.issues.push({expected:"object",code:"invalid_type",input:v,inst:a}),S;S.value=g?g.alloc(a,S,{},y):{};const j=[],w=p.shape,E=y==null?void 0:y.abortEarly;let T=S.issues.length;for(const A of p.allKeys){if(E&&S.issues.length!==T){if(tl(S,T))break;T=S.issues.length}if(A==="__proto__")continue;const Z=w[A],Y=Z._zod.optin,ye=Z._zod.optout,te=Z._zod.run({value:v[A],issues:[]},y);te instanceof Promise?j.push(te.then(ue=>Eo(ue,S,A,v,Y,ye))):Eo(te,S,A,v,Y,ye)}return m?ib(j,v,S,y,f.value,a,E===!0):j.length?Promise.all(j).then(()=>S):S}}),iz=W("$ZodObjectJIT",(a,l)=>{lz.init(a,l);const u=a._zod.parse,s=rh(()=>lb(l)),f=ha.memoizer,d=w=>{var ue,I;const E=s.value,T=E.symbolKeys,A=new p_(["payload","ctx"],{shape:w,inst:a,memo:f,syms:T}),Z=Q=>`shape[${Q}]._zod.run({ value: input[${Q}], issues: [] }, ctx)`,Y=(Q,G)=>`
|
|
306
|
+
let ${Q}_ab = false;
|
|
307
|
+
for (let i = 0; i < ${Q}.issues.length; i++) {
|
|
308
|
+
const iss = ${Q}.issues[i];
|
|
309
|
+
iss.path = iss.path ? [${G}, ...iss.path] : [${G}];
|
|
310
|
+
payload.issues.push(iss);
|
|
311
|
+
if (iss.continue !== true) ${Q}_ab = true;
|
|
312
|
+
}
|
|
313
|
+
if (${Q}_ab && ctx && ctx.abortEarly) {
|
|
314
|
+
payload.value = newResult;
|
|
315
|
+
return payload;
|
|
316
|
+
}`;A.write("const input = payload.value;");const ye=Object.create(null);let te=0;for(const Q of E.allKeys)ye[Q]=`key_${te++}`;A.write(f?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(const Q of E.allKeys){if(Q==="__proto__")continue;const G=ye[Q],ie=typeof Q=="symbol"?`syms[${T.indexOf(Q)}]`:$j(Q),_e=`${ie} in input`,ce=w[Q],Se=(ue=ce==null?void 0:ce._zod)==null?void 0:ue.optin,he=Se!==void 0,le=((I=ce==null?void 0:ce._zod)==null?void 0:I.optout)==="optional";if(A.write(`const ${G} = ${Z(ie)};`),he&&le){const X=Se==="optional"?`${G}_present`:`${G}.value !== undefined || ${G}_present`;A.write(`
|
|
317
|
+
const ${G}_present = ${_e};
|
|
318
|
+
if (!${G}.issues.length || ${G}_present) {
|
|
319
|
+
if (${G}.issues.length) {${Y(G,ie)}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
if (${X}) {
|
|
323
|
+
newResult[${ie}] = ${G}.value;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
`)}else he?(A.write(`
|
|
328
|
+
if (${G}.issues.length) {${Y(G,ie)}
|
|
329
|
+
}
|
|
330
|
+
`),Se==="defaulted"?A.write(`newResult[${ie}] = ${G}.value;`):A.write(`
|
|
331
|
+
if (${G}.value !== undefined || ${_e}) {
|
|
332
|
+
newResult[${ie}] = ${G}.value;
|
|
333
|
+
}
|
|
334
|
+
`)):A.write(`
|
|
335
|
+
const ${G}_present = ${_e};
|
|
336
|
+
if (${G}.issues.length) {${Y(G,ie)}
|
|
337
|
+
}
|
|
338
|
+
if (!${G}_present && !${G}.issues.length) {
|
|
339
|
+
payload.issues.push({
|
|
340
|
+
code: "invalid_type",
|
|
341
|
+
expected: "nonoptional",
|
|
342
|
+
input: undefined,
|
|
343
|
+
path: [${ie}]
|
|
344
|
+
});
|
|
345
|
+
if (ctx && ctx.abortEarly) {
|
|
346
|
+
payload.value = newResult;
|
|
347
|
+
return payload;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
if (${G}_present) {
|
|
352
|
+
newResult[${ie}] = ${G}.value;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
`)}return A.write("payload.value = newResult;"),A.write("return payload;"),A.compile()};let m;const p=wo,g=!ha.jitless,y=g&&Hj.value,v=l.catchall;let j;a._zod.parse=(w,E)=>{j??(j=s.value);const T=w.value;return p(T)?g&&y&&(E==null?void 0:E.async)===!1&&E.jitless!==!0?(m||(m=d(l.shape)),w=m(w,E),v?ib([],T,w,E,j,a,(E==null?void 0:E.abortEarly)===!0):w):u(w,E):(w.issues.push({expected:"object",code:"invalid_type",input:T,inst:a}),w)}});function Qv(a,l,u,s){for(const d of a)if(d.issues.length===0)return l.value=d.value,l;const f=a.filter(d=>!tl(d));return f.length===1?(l.value=f[0].value,f[0]):(l.issues.push({code:"invalid_union",input:l.value,inst:u,errors:a.map(d=>d.issues.map(m=>Zl(m,s,ka())))}),l)}const rz=W("$ZodUnion",(a,l)=>{Ct.init(a,l),rt(a,"optin",s=>s.def.options.some(f=>f._zod.optin==="defaulted")?"defaulted":s.def.options.some(f=>f._zod.optin!==void 0)?"optional":void 0),rt(a,"optout",s=>s.def.options.some(f=>f._zod.optout==="optional")?"optional":void 0),rt(a,"values",s=>{if(s.def.options.every(f=>f._zod.values))return new Set(s.def.options.flatMap(f=>Array.from(f._zod.values)))}),rt(a,"pattern",s=>{if(s.def.options.every(f=>f._zod.pattern)){const f=s.def.options.map(d=>d._zod.pattern);return new RegExp(`^(${f.map(d=>sh(d.source)).join("|")})$`)}});const u=l.options.length===1?l.options[0]._zod.run:null;a._zod.parse=(s,f)=>{if(u)return u(s,f);let d=!1;const m=[];for(const p of l.options){const g=p._zod.run({value:s.value,issues:[]},f);if(g instanceof Promise)m.push(g),d=!0;else{if(g.issues.length===0)return g;m.push(g)}}return d?Promise.all(m).then(p=>Qv(p,s,a,f)):Qv(m,s,a,f)}}),sz=W("$ZodIntersection",(a,l)=>{Ct.init(a,l),a._zod.parse=(u,s)=>{const f=u.value,d=l.left._zod.run({value:f,issues:[]},s),m=l.right._zod.run({value:f,issues:[]},s);return d instanceof Promise||m instanceof Promise?Promise.all([d,m]).then(([g,S])=>Fv(u,g,S)):Fv(u,d,m)}});function Yd(a,l){if(a===l)return{valid:!0,data:a};if(a instanceof Date&&l instanceof Date&&+a==+l)return{valid:!0,data:a};if(dr(a)&&dr(l)){const u=Object.keys(l),s=Object.keys(a).filter(d=>u.indexOf(d)!==-1),f={...a,...l};Object.prototype.hasOwnProperty.call(f,"__proto__")&&delete f.__proto__;for(const d of s){if(d==="__proto__")continue;const m=Yd(a[d],l[d]);if(!m.valid)return{valid:!1,mergeErrorPath:[d,...m.mergeErrorPath]};f[d]=m.data}return{valid:!0,data:f}}if(Array.isArray(a)&&Array.isArray(l)){if(a.length!==l.length)return{valid:!1,mergeErrorPath:[]};const u=[];for(let s=0;s<a.length;s++){const f=a[s],d=l[s],m=Yd(f,d);if(!m.valid)return{valid:!1,mergeErrorPath:[s,...m.mergeErrorPath]};u.push(m.data)}return{valid:!0,data:u}}return{valid:!1,mergeErrorPath:[]}}function Fv(a,l,u){const s=new Map;let f;const d=new Map,m=(S,y)=>{var j,w;let v;if(S.code==="unrecognized_keys"&&!((j=S.path)!=null&&j.length))f??(f=S),v=S.keys;else if(S.code==="invalid_key"&&S.origin==="record"&&((w=S.path)==null?void 0:w.length)===1){const E=String(S.path[0]);d.has(E)||d.set(E,S),v=[E]}else return!1;for(const E of v)s.has(E)||s.set(E,{}),s.get(E)[y]=!0;return!0};for(const S of l.issues)m(S,"l")||a.issues.push(S);for(const S of u.issues)m(S,"r")||a.issues.push(S);const p=[...s].filter(([,S])=>S.l&&S.r).map(([S])=>S);if(p.length){const S=f?p.filter(y=>f.keys.includes(y)):[];S.length&&a.issues.push({...f,keys:S});for(const y of p)!S.includes(y)&&d.has(y)&&a.issues.push(d.get(y))}const g=Yd(l.value,u.value);if(!g.valid){if(tl(a))return a;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(g.mergeErrorPath)}`)}return a.value=g.data,a}const uz=W("$ZodRecord",(a,l)=>{Ct.init(a,l);const u=ha.memoizer;u==null||u.attach(a),a._zod.parse=(s,f)=>{const d=s.value;if(!dr(d))return s.issues.push({expected:"record",code:"invalid_type",input:d,inst:a}),s;const m=[],p=l.keyType._zod.values;if(p&&!l.partial){s.value=u?u.alloc(a,s,{},f):{};const g=new Set;for(const y of p)if(typeof y=="string"||typeof y=="number"||typeof y=="symbol"){if(g.add(typeof y=="number"?y.toString():y),y==="__proto__")continue;const v=l.keyType._zod.run({value:y,issues:[]},f);if(v instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(v.issues.length){s.issues.push({code:"invalid_key",origin:"record",issues:v.issues.map(E=>Zl(E,f,ka())),input:y,path:[y],inst:a});continue}const j=v.value;if(j==="__proto__")continue;const w=l.valueType._zod.run({value:d[y],issues:[]},f);w instanceof Promise?m.push(w.then(E=>{E.issues.length&&s.issues.push(...or(y,E.issues)),s.value[j]=E.value})):(w.issues.length&&s.issues.push(...or(y,w.issues)),s.value[j]=w.value)}let S;for(const y in d)if(!g.has(y))if(l.mode==="loose"){if(y==="__proto__")continue;s.value[y]=d[y]}else S=S??[],S.push(y);S&&S.length>0&&s.issues.push({code:"unrecognized_keys",input:d,inst:a,keys:S,continue:!0})}else{s.value=u?u.alloc(a,s,{},f):{};let g;for(const S of Reflect.ownKeys(d)){if(S==="__proto__"||!Object.prototype.propertyIsEnumerable.call(d,S))continue;let y=l.keyType._zod.run({value:S,issues:[]},f);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof S=="string"&&mh.test(S)&&y.issues.length){const E=l.keyType._zod.run({value:Number(S),issues:[]},f);if(E instanceof Promise)throw new Error("Async schemas not supported in object keys currently");E.issues.length===0&&(y=E)}if(y.issues.length){l.mode==="loose"?s.value[S]=d[S]:p?(g=g??[],g.push(S)):s.issues.push({code:"invalid_key",origin:"record",issues:y.issues.map(E=>Zl(E,f,ka())),input:S,path:[S],inst:a});continue}const j=y.value;if(j==="__proto__")continue;const w=l.valueType._zod.run({value:d[S],issues:[]},f);w instanceof Promise?m.push(w.then(E=>{E.issues.length&&s.issues.push(...or(S,E.issues)),s.value[j]=E.value})):(w.issues.length&&s.issues.push(...or(S,w.issues)),s.value[j]=w.value)}g&&g.length>0&&s.issues.push({code:"unrecognized_keys",input:d,inst:a,keys:g,continue:!0})}return m.length?Promise.all(m).then(()=>s):s}}),oz=W("$ZodEnum",(a,l)=>{Ct.init(a,l);const u=Bd(l.entries),s=new Set(u);a._zod.values=s,rt(a,"pattern",f=>{const d=Bd(f.def.entries).filter(m=>Lj.has(typeof m));return new RegExp(d.length?`^(${d.map(m=>Uo(m.toString())).join("|")})$`:"^[^\\s\\S]$")}),a._zod.parse=(f,d)=>{const m=f.value;return s.has(m)||f.issues.push({code:"invalid_value",values:u,input:m,inst:a}),f}}),cz=W("$ZodTransform",(a,l)=>{var u;Ct.init(a,l),a._zod.optin="optional",(u=ha.memoizer)==null||u.guard(a),a._zod.parse=(s,f)=>{if(f.direction==="backward")throw new G0(a.constructor.name);const d=l.transform(s.value,s);if(f.async)return(d instanceof Promise?d:Promise.resolve(d)).then(p=>(s.value=p,s));if(d instanceof Promise)throw new pi;return s.value=d,s}});function Kv(a,l){return a.value=l.issues.length?void 0:l.value,a}const rb=W("$ZodOptional",(a,l)=>{Ct.init(a,l),rt(a,"optin",u=>u.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),a._zod.optout="optional",rt(a,"values",u=>{const s=u.def.innerType._zod.values;return s?new Set([...s,void 0]):void 0}),rt(a,"pattern",u=>{const s=u.def.innerType._zod.pattern;return s?new RegExp(`^(${sh(s.source)})?$`):void 0}),a._zod.parse=(u,s)=>{if(u.value===void 0){if(l.innerType._zod.optin!=="defaulted")return u;const f=l.innerType._zod.run({value:u.value,issues:[]},s);return f instanceof Promise?f.then(d=>Kv(u,d)):Kv(u,f)}return l.innerType._zod.run(u,s)}}),fz=W("$ZodExactOptional",(a,l)=>{rb.init(a,l),rt(a,"values",u=>u.def.innerType._zod.values),rt(a,"pattern",u=>u.def.innerType._zod.pattern),a._zod.parse=(u,s)=>l.innerType._zod.run(u,s)}),dz=W("$ZodNullable",(a,l)=>{Ct.init(a,l),rt(a,"optin",u=>u.def.innerType._zod.optin),rt(a,"optout",u=>u.def.innerType._zod.optout),rt(a,"pattern",u=>{const s=u.def.innerType._zod.pattern;return s?new RegExp(`^(${sh(s.source)}|null)$`):void 0}),rt(a,"values",u=>u.def.innerType._zod.values?new Set([...u.def.innerType._zod.values,null]):void 0),a._zod.parse=(u,s)=>u.value===null?u:l.innerType._zod.run(u,s)}),hz=W("$ZodDefault",(a,l)=>{Ct.init(a,l),a._zod.optin="defaulted",rt(a,"values",u=>u.def.innerType._zod.values),a._zod.parse=(u,s)=>{if(s.direction==="backward")return l.innerType._zod.run(u,s);if(u.value===void 0)return u.value=l.defaultValue,u;const f=l.innerType._zod.run(u,s);return f instanceof Promise?f.then(d=>Iv(d,l)):Iv(f,l)}});function Iv(a,l){return a.value===void 0&&(a.value=l.defaultValue),a}const mz=W("$ZodPrefault",(a,l)=>{Ct.init(a,l),a._zod.optin="defaulted",rt(a,"values",u=>u.def.innerType._zod.values),a._zod.parse=(u,s)=>(s.direction==="backward"||u.value===void 0&&(u.value=l.defaultValue),l.innerType._zod.run(u,s))}),pz=W("$ZodNonOptional",(a,l)=>{Ct.init(a,l),rt(a,"values",u=>{const s=u.def.innerType._zod.values;return s?new Set([...s].filter(f=>f!==void 0)):void 0}),a._zod.parse=(u,s)=>{const f=l.innerType._zod.run(u,s);return f instanceof Promise?f.then(d=>Jv(d,a)):Jv(f,a)}});function Jv(a,l){return!a.issues.length&&a.value===void 0&&a.issues.push({code:"invalid_type",expected:"nonoptional",input:a.value,inst:l}),a}function Pv(a,l,u,s){return l.issues.length?(a.value=u.catchValue({...l,value:a.value,error:{issues:l.issues.map(f=>Zl(f,s,ka()))},input:a.value}),a):(a.value=l.value,l.memo&&(a.memo=!0),a)}const gz=W("$ZodCatch",(a,l)=>{Ct.init(a,l),rt(a,"optin",u=>u.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),rt(a,"optout",u=>u.def.innerType._zod.optout),rt(a,"values",u=>u.def.innerType._zod.values),a._zod.parse=(u,s)=>{if(s.direction==="backward")return l.innerType._zod.run(u,s);const f=l.innerType._zod.run({value:u.value,issues:[]},s);return f instanceof Promise?f.then(d=>Pv(u,d,l,s)):Pv(u,f,l,s)}}),vz=W("$ZodPipe",(a,l)=>{Ct.init(a,l),rt(a,"values",u=>u.def.in._zod.values),rt(a,"optin",u=>u.def.in._zod.optin),rt(a,"optout",u=>u.def.out._zod.optout),rt(a,"propValues",u=>u.def.in._zod.propValues),a._zod.parse=(u,s)=>{if(s.direction==="backward"){const d=l.out._zod.run(u,s);return d instanceof Promise?d.then(m=>co(m,l.in,s)):co(d,l.in,s)}const f=l.in._zod.run(u,s);return f instanceof Promise?f.then(d=>co(d,l.out,s)):co(f,l.out,s)}});function co(a,l,u){return a.issues.some(s=>s.code!=="unrecognized_keys")?(a.aborted=!0,a):l._zod.run({value:a.value,issues:a.issues},u)}const yz=W("$ZodReadonly",(a,l)=>{Ct.init(a,l),rt(a,"propValues",u=>u.def.innerType._zod.propValues),rt(a,"values",u=>u.def.innerType._zod.values),rt(a,"optin",u=>{var s,f;return(f=(s=u.def.innerType)==null?void 0:s._zod)==null?void 0:f.optin}),rt(a,"optout",u=>{var s,f;return(f=(s=u.def.innerType)==null?void 0:s._zod)==null?void 0:f.optout}),a._zod.parse=(u,s)=>{if(s.direction==="backward")return l.innerType._zod.run(u,s);const f=l.innerType._zod.run(u,s);return f instanceof Promise?f.then(Wv):Wv(f)}});function Wv(a){return a.memo||(a.value=Object.freeze(a.value)),a}const bz=W("$ZodCustom",(a,l)=>{En.init(a,l),Ct.init(a,l),a._zod.parse=(u,s)=>u,a._zod.check=u=>{const s=u.value,f=l.fn(s);if(f instanceof Promise)return f.then(d=>ey(d,u,s,a));ey(f,u,s,a)}});function ey(a,l,u,s){if(!a){const f={code:"custom",input:u,inst:s,path:[...s._zod.def.path??[]],continue:!s._zod.def.abort};s._zod.def.params&&(f.params=s._zod.def.params),l.issues.push(Ms(f))}}class xz extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}const Vd="~memo",ty=[];function sb(a){return a!==null&&typeof a=="object"}function Cd(a){return a.map(l=>l.path?{...l,path:l.path.slice()}:{...l})}const ub=new WeakMap,Ns=0,xo=1,Ts=2;function So(a,l,u){const s=ub.get(a);if(s!==void 0)return s?Ts:Ns;if(l.has(a))return Ts;l.add(a);let f=Ns;const d=y=>{if(f!==Ts&&(y!=null&&y._zod)){const v=So(y,l);v>f&&(f=v)}},m=(y,v)=>{var w;let j=Ns;for(const E of Reflect.ownKeys(y)){const T=Object.getOwnPropertyDescriptor(y,E);if(!T.enumerable)continue;const A=T.get?xo:(w=T.value)!=null&&w._zod?So(T.value,l):Ns;A>j&&(j=A)}return j},p=y=>{y>f&&(f=y)},g=a._zod.def;switch(g.type){case"object":{const y=R0(g);p(y?m(y):xo),d(g.catchall);break}case"array":d(g.element);break;case"tuple":for(const y of g.items)d(y);d(g.rest);break;case"record":case"map":d(g.keyType),d(g.valueType);break;case"set":d(g.valueType);break;case"union":for(const y of g.options)d(y);break;case"intersection":d(g.left),d(g.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":d(g.innerType);break;case"pipe":d(g.in),d(g.out);break;case"function":d(g.input),d(g.output);break;case"lazy":{const y=g._cachedInner??void 0;p(y?So(y,l):xo);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(const y in g){const v=Object.getOwnPropertyDescriptor(g,y);if(!v||v.get)continue;const j=v.value;if(!(!j||typeof j!="object")){if(j._zod)d(j);else if(Array.isArray(j))for(const w of j)d(w)}}}return l.delete(a),Sz(a,f)}function Sz(a,l){return l!==xo&&ub.set(a,l===Ts),l}function jz(a,l){let u=a.buckets.get(l);return u||(u=new WeakMap,a.buckets.set(l,u)),u}let fo;const ho=[],_z={alloc(a,l,u){const s=fo;if(!s)return u;fo=void 0;const f={value:u,issues:null};return s.set(l.value,f),ho.push(f),u},guard(a){var l;(l=a._zod).deferred??(l.deferred=[]),a._zod.deferred.push(()=>{const u=a._zod.parse,s=(f,d)=>{if(d.direction!=="backward"&&wz(d,f.value))throw new xz;return u(f,d)};a._zod.parse=s,a._zod.run===u&&(a._zod.run=s)})},attach(a){var l;let u,s=!1,f,d;(l=a._zod).deferred??(l.deferred=[]),a._zod.deferred.push(()=>{const m=a._zod.parse,p=(g,S)=>{if(u===void 0){const Z=So(a,new Set);if(Z===Ns)return a._zod.parse=m,a._zod.run===p&&(a._zod.run=m),m(g,S);Z===Ts||s?u=!0:s=!0}const y=g.value;if(!sb(y))return m(g,S);let v=S[Vd];v||(v={buckets:new WeakMap,backEdges:void 0},S[Vd]=v);let j;f===S?j=d:(j=jz(v,a),f=S,d=j);const w=j.get(y);if(w)return g.value=w.value,w.issues?w.issues.length&&g.issues.push(...Cd(w.issues)):(g.memo=!0,v.backEdges??(v.backEdges=new WeakSet),v.backEdges.add(w.value)),g;fo=j;const E=ho.length,T=m(g,S);fo=void 0;const A=ho.length>E?ho.pop():void 0;return T instanceof Promise?T.then(Z=>(A&&(A.issues=Z.issues.length?Cd(Z.issues):ty),Z)):(A&&(A.issues=T.issues.length?Cd(T.issues):ty),T)};a._zod.parse=p,a._zod.run===m&&(a._zod.run=p)})}};function zz(){return _z}function wz(a,l){var s;const u=(s=a[Vd])==null?void 0:s.backEdges;return u!==void 0&&sb(l)&&u.has(l)}const Nz=()=>{const a={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function l(d){return a[d]??null}const u={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},s={nan:"NaN"};function f(d,m){return d==="number"&&typeof m=="number"&&!Number.isFinite(m)?String(m):s[d]??d}return d=>{switch(d.code){case"invalid_type":{const m=f(d.expected),p=Pj(d.input),g=f(p,d.input);return`Invalid input: expected ${m}, received ${g}`}case"invalid_value":return d.values.length===1?`Invalid input: expected ${H0(d.values[0])}`:`Invalid option: expected one of ${$v(d.values,"|")}`;case"too_big":{const m=d.exact?"exactly ":d.inclusive?"<=":"<",p=l(d.origin);return p?`Too big: expected ${d.origin??"value"} to have ${m}${d.maximum.toString()} ${p.unit??"elements"}`:`Too big: expected ${d.origin??"value"} to be ${m}${d.maximum.toString()}`}case"too_small":{const m=d.exact?"exactly ":d.inclusive?">=":">",p=l(d.origin);return p?`Too small: expected ${d.origin} to have ${m}${d.minimum.toString()} ${p.unit}`:`Too small: expected ${d.origin} to be ${m}${d.minimum.toString()}`}case"invalid_format":{const m=d;return m.format==="starts_with"?`Invalid string: must start with "${m.prefix}"`:m.format==="ends_with"?`Invalid string: must end with "${m.suffix}"`:m.format==="includes"?`Invalid string: must include "${m.includes}"`:m.format==="regex"?`Invalid string: must match pattern ${m.pattern}`:`Invalid ${u[m.format]??d.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${d.divisor}`;case"unrecognized_keys":return`Unrecognized key${d.keys.length>1?"s":""}: ${$v(d.keys,", ")}`;case"invalid_key":return`Invalid key in ${d.origin}`;case"invalid_union":return d.options&&Array.isArray(d.options)&&d.options.length>0?`Invalid discriminator value. Expected ${d.options.map(p=>`'${p}'`).join(" | ")}`:d.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${d.origin}`;default:return"Invalid input"}}};function Cz(){return{localeError:Nz()}}var ny;class Ez{constructor(){this._map=new WeakMap,this._idmap=new Map}add(l,...u){const s=u[0];return this._map.set(l,s),s&&typeof s=="object"&&"id"in s&&this._idmap.set(s.id,l),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(l){const u=this._map.get(l);return u&&typeof u=="object"&&"id"in u&&this._idmap.delete(u.id),this._map.delete(l),this}get(l){const u=l._zod.parent;if(u){const s={...this.get(u)??{}};delete s.id;const f={...s,...this._map.get(l)};return Object.keys(f).length?f:void 0}return this._map.get(l)}has(l){return this._map.has(l)}}function Tz(){return new Ez}(ny=globalThis).__zod_globalRegistry??(ny.__zod_globalRegistry=Tz());const Cs=globalThis.__zod_globalRegistry;function ob(a){return a.checks&&(a.checks=[...a.checks]),a}function Az(a,l){return new a(ob({type:"string",...Ee(l)}))}function Oz(a,l){return new a({type:"string",format:"email",check:"string_format",abort:!1,...Ee(l)})}function kz(a,l){return new a({type:"string",format:"guid",check:"string_format",abort:!1,...Ee(l)})}function Dz(a,l){return new a({type:"string",format:"uuid",check:"string_format",abort:!1,...Ee(l)})}function Mz(a,l){return new a({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ee(l)})}function Rz(a,l){return new a({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ee(l)})}function Uz(a,l){return new a({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ee(l)})}function Zz(a,l){return new a({type:"string",format:"url",check:"string_format",abort:!1,...Ee(l)})}function $z(a,l){return new a({type:"string",format:"emoji",check:"string_format",abort:!1,...Ee(l)})}function Bz(a,l){return new a({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ee(l)})}function Hz(a,l){return new a({type:"string",format:"cuid",check:"string_format",abort:!1,...Ee(l)})}function Lz(a,l){return new a({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ee(l)})}function qz(a,l){return new a({type:"string",format:"ulid",check:"string_format",abort:!1,...Ee(l)})}function Yz(a,l){return new a({type:"string",format:"xid",check:"string_format",abort:!1,...Ee(l)})}function Vz(a,l){return new a({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ee(l)})}function Gz(a,l){return new a({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ee(l)})}function Xz(a,l){return new a({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ee(l)})}function Qz(a,l){return new a({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ee(l)})}function Fz(a,l){return new a({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ee(l)})}function Kz(a,l){return new a({type:"string",format:"base64",check:"string_format",abort:!1,...Ee(l)})}function Iz(a,l){return new a({type:"string",format:"base64url",check:"string_format",abort:!1,...Ee(l)})}function Jz(a,l){return new a({type:"string",format:"e164",check:"string_format",abort:!1,...Ee(l)})}function Pz(a,l){return new a({type:"string",format:"jwt",check:"string_format",abort:!1,...Ee(l)})}function Wz(a,l){return new a({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ee(l)})}function ew(a,l){return new a({type:"string",format:"date",check:"string_format",...Ee(l)})}function tw(a,l){return new a({type:"string",format:"time",check:"string_format",precision:null,...Ee(l)})}function nw(a,l){return new a({type:"string",format:"duration",check:"string_format",...Ee(l)})}function aw(a,l){return new a(ob({type:"number",checks:[],...Ee(l)}))}function lw(a,l){return new a({type:"number",check:"number_format",abort:!1,format:"safeint",...Ee(l)})}function iw(a,l){return new a({type:"boolean",...Ee(l)})}function rw(a){return new a({type:"unknown"})}function sw(a,l){return new a({type:"never",...Ee(l)})}function ay(a,l){return new F0({check:"less_than",...Ee(l),value:a,inclusive:!1})}function Ed(a,l){return new F0({check:"less_than",...Ee(l),value:a,inclusive:!0})}function ly(a,l){return new K0({check:"greater_than",...Ee(l),value:a,inclusive:!1})}function Td(a,l){return new K0({check:"greater_than",...Ee(l),value:a,inclusive:!0})}function iy(a,l){return new a_({check:"multiple_of",...Ee(l),value:a})}function cb(a,l){return new i_({check:"max_length",...Ee(l),maximum:a})}function To(a,l){return new r_({check:"min_length",...Ee(l),minimum:a})}function fb(a,l){return new s_({check:"length_equals",...Ee(l),length:a})}function uw(a,l){return new u_({check:"string_format",format:"regex",...Ee(l),pattern:a})}function ow(a){return new o_({check:"string_format",format:"lowercase",...Ee(a)})}function cw(a){return new c_({check:"string_format",format:"uppercase",...Ee(a)})}function fw(a,l){return new f_({check:"string_format",format:"includes",...Ee(l),includes:a})}function dw(a,l){return new d_({check:"string_format",format:"starts_with",...Ee(l),prefix:a})}function hw(a,l){return new h_({check:"string_format",format:"ends_with",...Ee(l),suffix:a})}function pr(a){return new m_({check:"overwrite",tx:a})}function mw(a){return pr(l=>l.normalize(a))}function pw(){return pr(a=>a.trim())}function gw(){return pr(a=>a.toLowerCase())}function vw(){return pr(a=>a.toUpperCase())}function yw(){return pr(a=>Bj(a))}function bw(a,l,u){return new a({type:"array",element:l,...Ee(u)})}function xw(a,l,u){return new a({type:"custom",check:"custom",fn:l,...Ee(u)})}function Sw(a,l){const u=jw(s=>(s.addIssue=f=>{if(typeof f=="string")s.issues.push(Ms(f,s.value,u._zod.def));else{const d=f;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),"input"in d||(d.input=s.value),d.inst??(d.inst=u),d.continue??(d.continue=!u._zod.def.abort),s.issues.push(Ms(d))}},a(s.value,s)),l);return u}function jw(a,l){const u=new En({check:"custom",...Ee(l)});return u._zod.check=a,u}function As(a,...l){for(const u of l)for(const s of Reflect.ownKeys(u))Object.prototype.propertyIsEnumerable.call(u,s)&&Bl(a,s,u[s]);return a}function db(a){let l=(a==null?void 0:a.target)??"draft-2020-12";return l==="draft-4"&&(l="draft-04"),l==="draft-7"&&(l="draft-07"),{processors:a.processors??{},metadataRegistry:(a==null?void 0:a.metadata)??Cs,target:l,unrepresentable:(a==null?void 0:a.unrepresentable)??"throw",override:(a==null?void 0:a.override)??(()=>{}),io:(a==null?void 0:a.io)??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:(a==null?void 0:a.cycles)??"ref",reused:(a==null?void 0:a.reused)??"inline",intersections:[],deferred:[],external:(a==null?void 0:a.external)??void 0}}function gr(a,l,u,s,f){const d=typeof l.unrepresentable=="function"?l.unrepresentable({zodSchema:a,path:s.path,message:f}):l.unrepresentable;if(d==="any")return!1;if(d===void 0||d==="throw")throw new Error(f);return Object.assign(u,d),!0}function Zt(a,l,u={path:[],schemaPath:[]}){var y,v;var s;const f=a._zod.def,d=l.seen.get(a);if(d)return d.count++,u.schemaPath.includes(a)&&(d.cycle=u.path),d.schema;const m={schema:{},count:1,cycle:void 0,path:u.path};l.seen.set(a,m),l.sharedDefsExtractedFor=void 0,l.sharedEmitDoneFor=void 0;const p=(v=(y=a._zod).toJSONSchema)==null?void 0:v.call(y);if(p)m.schema=p;else{const j={...u,schemaPath:[...u.schemaPath,a],path:u.path};if(a._zod.processJSONSchema)a._zod.processJSONSchema(l,m.schema,j);else{const E=m.schema,T=l.processors[f.type];if(!T)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${f.type}`);T(a,l,E,j)}const w=a._zod.parent;w&&(m.ref||(m.ref=w),Zt(w,l,j),l.seen.get(w).isParent=!0)}const g=l.metadataRegistry.get(a);return g&&As(m.schema,g),l.io==="input"&&vn(a)&&(delete m.schema.examples,delete m.schema.default),l.io==="input"&&"_prefault"in m.schema&&((s=m.schema).default??(s.default=m.schema._prefault)),delete m.schema._prefault,l.seen.get(a).schema}function ry(a){return a.replace(/~/g,"~0").replace(/\//g,"~1")}function hb(a,l){var m,p,g,S;const u=a.seen.get(l);if(!u)throw new Error("Unprocessed schema. This is a bug in Zod.");if(a.external&&a.sharedDefsExtractedFor===a.external)return;const s=new Map;for(const y of a.seen.entries()){const v=(m=a.metadataRegistry.get(y[0]))==null?void 0:m.id;if(v){const j=s.get(v);if(j&&j!==y[0])throw new Error(`Duplicate schema id "${v}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);s.set(v,y[0])}}const f=y=>{var T;const v=a.target==="draft-2020-12"?"$defs":"definitions";if(a.external){const A=(T=a.external.registry.get(y[0]))==null?void 0:T.id,Z=a.external.uri??(ye=>ye);if(A)return{ref:Z(A)};const Y=y[1].defId??y[1].schema.id??`schema${a.counter++}`;return y[1].defId=Y,{defId:Y,ref:`${Z("__shared")}#/${v}/${ry(Y)}`}}const j="#",w=`${j}/${v}/`;if(y[1]===u&&!y[1].schema.id)return{ref:j};const E=y[1].schema.id??`__schema${a.counter++}`;return{defId:E,ref:w+ry(E)}},d=y=>{if(y[1].schema.$ref)return;const v=y[1],{ref:j,defId:w}=f(y);v.def={...v.schema},w&&(v.defId=w);const E=v.schema;for(const T in E)delete E[T];E.$ref=j};if(a.cycles==="throw")for(const y of a.seen.entries()){const v=y[1];if(v.cycle)throw new Error(`Cycle detected: #/${(p=v.cycle)==null?void 0:p.join("/")}/<root>
|
|
356
|
+
|
|
357
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const y of a.seen.entries()){const v=y[1];if(l===y[0]){d(y);continue}if(a.external){const w=(g=a.external.registry.get(y[0]))==null?void 0:g.id;if(l!==y[0]&&w){d(y);continue}}if((S=a.metadataRegistry.get(y[0]))==null?void 0:S.id){d(y);continue}if(v.cycle){d(y);continue}v.count>1&&a.reused==="ref"&&d(y)}a.external&&(a.sharedDefsExtractedFor=a.external)}function mb(a){const l=a.anyOf;if(!Array.isArray(l)||l.length===0||a.type!==void 0)return;const u=[];for(const s of l){if(!s||typeof s!="object")return;mb(s);const f=Object.keys(s);if(f.length!==1||f[0]!=="type")return;const d=s.type;for(const m of Array.isArray(d)?d:[d]){if(typeof m!="string")return;u.includes(m)||u.push(m)}}delete a.anyOf,a.type=u.length===1?u[0]:u}const pb=new Set(["type","properties","required","additionalProperties"]),sy=["oneOf","anyOf"];function uy(a){const l=a.additionalProperties;return l===void 0||l===!1||typeof l!="object"||l===null?null:Object.keys(l).length?l:null}function Gd(a){var d;const l=[];for(const m of a){if(typeof m!="object"||m.type!=="object")return null;for(const p in m)if(!pb.has(p))return null;l.push(m)}const u={},s=new Set;for(const m of l){for(const p in m.properties){if(Object.prototype.hasOwnProperty.call(u,p))continue;const g=[];for(const y of l){const v=((d=y.properties)==null?void 0:d[p])??uy(y);v!=null&&(g.some(j=>JSON.stringify(j)===JSON.stringify(v))||g.push(v))}const S=g.length===1?g[0]:Gd(g)??{allOf:g};Bl(u,p,S)}for(const p of m.required??[])s.add(p)}const f={type:"object",properties:u};if(s.size&&(f.required=[...s]),l.every(m=>m.additionalProperties===!1))f.additionalProperties=!1;else{const m=[];for(const p of l){const g=uy(p);g&&!m.some(S=>JSON.stringify(S)===JSON.stringify(g))&&m.push(g)}m.length===1?f.additionalProperties=m[0]:m.length>1&&(f.additionalProperties={allOf:m})}return f}function _w(a){const l=a.allOf;if(!Array.isArray(l)||l.length<2)return;for(const f of pb)if(f in a)return;const u=l.filter(f=>sy.some(d=>Array.isArray(f[d])));let s=null;if(!u.length)s=Gd(l);else{const f=u[0],d=sy.find(g=>Array.isArray(f[g]));if(Object.keys(f).length!==1)return;const m=l.filter(g=>g!==f),p=f[d].map(g=>Gd([...m,g]));if(p.some(g=>!g))return;s={[d]:p}}s&&(delete a.allOf,As(a,s))}function gb(a,l){var p,g,S,y;const u=a.seen.get(l);if(!u)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=v=>{const j=a.seen.get(v);if(j.ref===null)return;const w=j.def??j.schema,E={...w},T=j.ref;if(j.ref=null,T){s(T);const Z=a.seen.get(T),Y=Z.schema;if(Y.$ref&&(a.target==="draft-07"||a.target==="draft-04"||a.target==="openapi-3.0")?(w.allOf=w.allOf??[],w.allOf.push(Y)):As(w,Y),As(w,E),v._zod.parent===T)for(const te in w)te==="$ref"||te==="allOf"||te in E||delete w[te];if(Y.$ref&&Z.def)for(const te in w)te==="$ref"||te==="allOf"||te in Z.def&&JSON.stringify(w[te])===JSON.stringify(Z.def[te])&&delete w[te]}const A=v._zod.parent;if(A&&A!==T){s(A);const Z=a.seen.get(A);if(Z!=null&&Z.schema.$ref&&(w.$ref=Z.schema.$ref,Z.def))for(const Y in w)Y==="$ref"||Y==="allOf"||Y in Z.def&&JSON.stringify(w[Y])===JSON.stringify(Z.def[Y])&&delete w[Y]}a.override({zodSchema:v,jsonSchema:w,path:j.path??[]})};if(!a.external||a.sharedEmitDoneFor!==a.external){for(const v of[...a.seen.entries()].reverse())s(v[0]);if(a.target!=="openapi-3.0")for(const v of a.seen.entries())mb(v[1].def??v[1].schema);for(const v of a.deferred)v();if(a.intersections.length){const v=new Map;for(const j of a.seen.values())for(const w of[j.schema,j.def]){const E=w==null?void 0:w.allOf;if(!Array.isArray(E))continue;const T=v.get(E);T?T.push(w):v.set(E,[w])}for(const j of a.intersections)for(const w of v.get(j)??[])_w(w)}}const f={};if(a.target==="draft-2020-12"?f.$schema="https://json-schema.org/draft/2020-12/schema":a.target==="draft-07"?f.$schema="http://json-schema.org/draft-07/schema#":a.target==="draft-04"?f.$schema="http://json-schema.org/draft-04/schema#":a.target,(p=a.external)!=null&&p.uri){const v=(g=a.external.registry.get(l))==null?void 0:g.id;if(!v)throw new Error("Schema is missing an `id` property");f.$id=a.external.uri(v)}As(f,u.defId?u.schema:u.def??u.schema);const d=(S=a.metadataRegistry.get(l))==null?void 0:S.id;d!==void 0&&f.id===d&&delete f.id;const m=((y=a.external)==null?void 0:y.defs)??{};if(!a.external||a.sharedEmitDoneFor!==a.external)for(const v of a.seen.entries()){const j=v[1];j.def&&j.defId&&(j.def.id===j.defId&&delete j.def.id,Bl(m,j.defId,j.def))}a.external&&(a.sharedEmitDoneFor=a.external),a.external||Object.keys(m).length>0&&(a.target==="draft-2020-12"?f.$defs=m:f.definitions=m);try{const v=JSON.parse(JSON.stringify(f));return Object.defineProperty(v,"~standard",{value:{...l["~standard"],jsonSchema:{input:Ao(l,"input",a.processors),output:Ao(l,"output",a.processors)}},enumerable:!1,writable:!1}),v}catch{throw new Error("Error converting schema to JSON.")}}function vn(a,l){const u=l??{seen:new Set};if(u.seen.has(a))return!1;u.seen.add(a);const s=a._zod.def;if(s.type==="transform")return!0;if(s.type==="array")return vn(s.element,u);if(s.type==="set")return vn(s.valueType,u);if(s.type==="lazy")return vn(s.getter(),u);if(s.type==="promise"||s.type==="optional"||s.type==="nonoptional"||s.type==="nullable"||s.type==="readonly"||s.type==="default"||s.type==="prefault"||s.type==="catch")return vn(s.innerType,u);if(s.type==="intersection")return vn(s.left,u)||vn(s.right,u);if(s.type==="record"||s.type==="map")return vn(s.keyType,u)||vn(s.valueType,u);if(s.type==="pipe")return a._zod.traits.has("$ZodCodec")?!0:vn(s.in,u)||vn(s.out,u);if(s.type==="object"){for(const f in s.shape)if(vn(s.shape[f],u))return!0;return!1}if(s.type==="union"){for(const f of s.options)if(vn(f,u))return!0;return!1}if(s.type==="tuple"){for(const f of s.items)if(vn(f,u))return!0;return!!(s.rest&&vn(s.rest,u))}return!1}const zw=(a,l={})=>u=>{const s=db({...u,processors:l});return Zt(a,s),hb(s,a),gb(s,a)},Ao=(a,l,u={})=>s=>{const{libraryOptions:f,target:d}=s??{},m=db({...f??{},target:d,io:l,processors:u});return Zt(a,m),hb(m,a),gb(m,a)},hr=(a,l,u)=>{(a[l]===void 0||u>a[l])&&(a[l]=u)},mr=(a,l,u)=>{(a[l]===void 0||u<a[l])&&(a[l]=u)},oy=(a,l)=>{hr(a,"minimum",l),mr(a,"maximum",l)},vb=(a,l)=>{a.multipleOf??(a.multipleOf=[]),a.multipleOf.includes(l)||a.multipleOf.push(l)},yb=(a,l)=>{a.patterns??(a.patterns=new Set),a.patterns.add(l)},bb=(a,l)=>{a.mime=a.mime?a.mime.filter(u=>l.includes(u)):[...l]},xb=(a,l)=>{a.format=l,l.includes("int")&&(a.isInt=!0)},cy=(a,l)=>hr(a,"minimum",l.minimum),fy=(a,l)=>mr(a,"maximum",l.maximum),dy=a=>(l,u)=>{xb(l,u.format);const[s,f]=a[u.format];hr(l,"minimum",s),mr(l,"maximum",f)},Ad={greater_than:(a,l)=>hr(a,l.inclusive?"minimum":"exclusiveMinimum",l.value),less_than:(a,l)=>mr(a,l.inclusive?"maximum":"exclusiveMaximum",l.value),multiple_of:(a,l)=>vb(a,l.value),number_format:dy(L0),bigint_format:dy(Yj),min_length:cy,max_length:fy,length_equals:(a,l)=>oy(a,l.length),min_size:cy,max_size:fy,size_equals:(a,l)=>oy(a,l.size),string_format:(a,l)=>{xb(a,l.format),l.pattern&&yb(a,l.pattern),(l.format==="base64"||l.format==="base64url")&&(a.contentEncoding=l.format),(l.local||l.precision===-1)&&(a.laxFormat=!0)},mime_type:(a,l)=>bb(a,l.mime)};function fa(a){var d;const l={},u=a._zod.def,s=a._zod.traits.has("$ZodCheck")?[a,...u.checks??[]]:u.checks??[];for(const m of s)(d=Ad[m._zod.def.check])==null||d.call(Ad,l,m._zod.def);const f=a._zod.bag;f.minimum!==void 0&&hr(l,"minimum",f.minimum),f.exclusiveMinimum!==void 0&&hr(l,"exclusiveMinimum",f.exclusiveMinimum),f.maximum!==void 0&&mr(l,"maximum",f.maximum),f.exclusiveMaximum!==void 0&&mr(l,"exclusiveMaximum",f.exclusiveMaximum),f.multipleOf!==void 0&&vb(l,f.multipleOf),f.format!==void 0&&(l.format??(l.format=f.format),f.format.includes("int")&&(l.isInt=!0)),f.mime&&bb(l,f.mime);for(const m of f.patterns??[])yb(l,m);return l}const ww={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Nw=new Map([[nb,V2],[vh,G2]]),Sb=a=>Nw.get(a)??a,Cw=(a,l,u,s)=>{const f=u;f.type="string";const{minimum:d,maximum:m,format:p,patterns:g,contentEncoding:S,laxFormat:y}=fa(a);if(typeof d=="number"&&(f.minLength=d),typeof m=="number"&&(f.maxLength=m),p&&(f.format=ww[p]??p,f.format===""&&delete f.format,(p==="time"||y)&&delete f.format),S&&(f.contentEncoding=S),g&&g.size>0){const v=[...g].map(Sb);v.length===1?f.pattern=v[0].source:v.length>1&&(f.allOf=[...v.map(j=>({...l.target==="draft-07"||l.target==="draft-04"||l.target==="openapi-3.0"?{type:"string"}:{},pattern:j.source}))])}},Ew=(a,l,u,s)=>{const f=u,{minimum:d,maximum:m,multipleOf:p,exclusiveMaximum:g,exclusiveMinimum:S,isInt:y}=fa(a);f.type=y?"integer":"number";const v=typeof S=="number"&&S>=(d??Number.NEGATIVE_INFINITY),j=typeof g=="number"&&g<=(m??Number.POSITIVE_INFINITY),w=l.target==="draft-04"||l.target==="openapi-3.0";if(v?w?(f.minimum=S,f.exclusiveMinimum=!0):f.exclusiveMinimum=S:typeof d=="number"&&(f.minimum=d),j?w?(f.maximum=g,f.exclusiveMaximum=!0):f.exclusiveMaximum=g:typeof m=="number"&&(f.maximum=m),p){const E=new Set;for(const Z of p)Number.isFinite(Z)&&Z!==0?E.add(Math.abs(Z)):gr(a,l,f,s,`A multipleOf divisor of ${Z} cannot be represented in JSON Schema`);const[T,...A]=E;T!==void 0&&(f.multipleOf=T),A.length&&(f.allOf=[...f.allOf??[],...A.map(Z=>({multipleOf:Z}))])}},Tw=(a,l,u,s)=>{u.type="boolean"},Aw=(a,l,u,s)=>{u.not={}},Ow=(a,l,u,s)=>{},kw=(a,l,u,s)=>{const f=a._zod.def,d=Bd(f.entries);if(d.length===0){u.not={};return}d.every(m=>typeof m=="number")&&(u.type="number"),d.every(m=>typeof m=="string")&&(u.type="string"),u.enum=d},Dw=(a,l,u,s)=>{gr(a,l,u,s,"Custom types cannot be represented in JSON Schema")},Mw=(a,l,u,s)=>{gr(a,l,u,s,"Transforms cannot be represented in JSON Schema")},Rw=(a,l,u,s)=>{const f=u,d=a._zod.def,{minimum:m,maximum:p}=fa(a);typeof m=="number"&&(f.minItems=m),typeof p=="number"&&(f.maxItems=p),f.type="array",f.items=Zt(d.element,l,{...s,path:[...s.path,"items"]})};function Oo(a){const l=a._zod.def;return l.type==="pipe"&&l.in._zod.traits.has("$ZodTransform")?Oo(l.out):l.type==="catch"?Oo(l.innerType):a._zod.optin}const Uw=(a,l,u,s)=>{var S;const f=u,d=a._zod.def,m=d.shape;if(Object.getOwnPropertySymbols(m).length&&gr(a,l,f,s,"Symbol keys cannot be represented in JSON Schema"))return;f.type="object",f.properties={};for(const y in m)Bl(f.properties,y,Zt(m[y],l,{...s,path:[...s.path,"properties",y]}));const g=[];for(const y of Object.keys(m)){const v=d.shape[y];(l.io==="input"?Oo(v)===void 0:v._zod.optout===void 0)&&g.push(y)}g.length>0&&(f.required=g),((S=d.catchall)==null?void 0:S._zod.def.type)==="never"?f.additionalProperties=!1:d.catchall?d.catchall&&(f.additionalProperties=Zt(d.catchall,l,{...s,path:[...s.path,"additionalProperties"]})):l.io==="output"&&(f.additionalProperties=!1)},Zw=(a,l,u,s)=>{const f=a._zod.def,d=f.inclusive===!1,m=f.options.map((p,g)=>Zt(p,l,{...s,path:[...s.path,d?"oneOf":"anyOf",g]}));d?u.oneOf=m:u.anyOf=m},$w=(a,l,u,s)=>{const f=a._zod.def,d=Zt(f.left,l,{...s,path:[...s.path,"allOf",0]}),m=Zt(f.right,l,{...s,path:[...s.path,"allOf",1]}),p=S=>"allOf"in S&&Object.keys(S).length===1,g=[...p(d)?d.allOf:[d],...p(m)?m.allOf:[m]];u.allOf=g,l.intersections.push(g)};function Xd(a,l,u){var E;if(l.$ref){if(u.has(l))return l;u.add(l);const T=(E=a.get(l))==null?void 0:E.def;if(!T)return l;const A=Xd(a,T,u);return A===T?l:A}for(const T of["anyOf","oneOf"]){const A=l[T];if(!Array.isArray(A))continue;const Z=A.map(Y=>Xd(a,Y,u));Z.some((Y,ye)=>Y!==A[ye])&&(l={...l,[T]:Z})}const s=Array.isArray(l.type)?l.type:[l.type],f=!s.includes("string")&&s.some(T=>T==="number"||T==="integer"),d=l.enum??(l.const!==void 0?[l.const]:void 0);if(!f&&!(d!=null&&d.some(T=>typeof T=="number")))return l;const{minimum:m,maximum:p,exclusiveMinimum:g,exclusiveMaximum:S,multipleOf:y,format:v,id:j,...w}=l;return w.enum?w.enum=w.enum.map(T=>typeof T=="number"?String(T):T):typeof w.const=="number"&&(w.const=String(w.const)),f&&(w.type="string",d||(w.pattern=(s.includes("number")?mh:W2).source)),w}const Qd=new WeakMap;function Bw(a){var s;const l=new Map;for(const f of a.seen.values())f.def&&!l.has(f.schema)&&l.set(f.schema,f);const u=new Map;for(const f of Qd.get(a)??[]){const d=a.seen.get(f),m=(s=(d==null?void 0:d.def)??(d==null?void 0:d.schema))==null?void 0:s.propertyNames;if(!m||m===!0||u.has(m))continue;const p=Xd(l,m,new Set);p!==m&&u.set(m,p)}if(u.size)for(const f of a.seen.values())for(const d of[f.schema,f.def]){const m=d&&u.get(d.propertyNames);m&&(d.propertyNames=m)}}const Hw=(a,l,u,s)=>{const f=u,d=a._zod.def;f.type="object";const m=d.keyType,p=fa(m).patterns;if(d.mode==="loose"&&p&&p.size>0){const y=Zt(d.valueType,l,{...s,path:[...s.path,"patternProperties","*"]});f.patternProperties={};for(const v of p)Bl(f.patternProperties,Sb(v).source,y)}else{if(l.target==="draft-07"||l.target==="draft-2020-12"){f.propertyNames=Zt(d.keyType,l,{...s,path:[...s.path,"propertyNames"]});let y=Qd.get(l);y||(y=[],Qd.set(l,y),l.deferred.push(()=>Bw(l))),y.push(a)}f.additionalProperties=Zt(d.valueType,l,{...s,path:[...s.path,"additionalProperties"]})}const g=m._zod.values,S=l.io==="input"&&Oo(d.valueType)!==void 0;if(g&&!d.partial&&!S){const y=[...g].filter(v=>typeof v=="string"||typeof v=="number");y.length>0&&(f.required=y.map(String))}},Lw=(a,l,u,s)=>{const f=a._zod.def,d=Zt(f.innerType,l,s),m=l.seen.get(a);l.target==="openapi-3.0"?(m.ref=f.innerType,u.nullable=!0):u.anyOf=[d,{type:"null"}]},qw=(a,l,u,s)=>{const f=a._zod.def;Zt(f.innerType,l,s);const d=l.seen.get(a);d.ref=f.innerType},yh=Symbol();function jb(a,l,u,s,f){let d=!1;const m=JSON.stringify(a,(p,g)=>typeof g!="bigint"?g:(d=!0,null));return d?(gr(l,u,s,f,"BigInt defaults cannot be represented in JSON Schema"),yh):JSON.parse(m)}const Yw=(a,l,u,s)=>{const f=a._zod.def;Zt(f.innerType,l,s);const d=l.seen.get(a);d.ref=f.innerType;const m=jb(f.defaultValue,a,l,u,s);m!==yh&&(u.default=m)},Vw=(a,l,u,s)=>{const f=a._zod.def;Zt(f.innerType,l,s);const d=l.seen.get(a);if(d.ref=f.innerType,l.io!=="input")return;const m=jb(f.defaultValue,a,l,u,s);m!==yh&&(u._prefault=m)},Gw=(a,l,u,s)=>{const f=a._zod.def;Zt(f.innerType,l,s);const d=l.seen.get(a);d.ref=f.innerType;let m;try{m=f.catchValue(void 0)}catch{gr(a,l,u,s,"Dynamic catch values are not supported in JSON Schema");return}u.default=m},Xw=(a,l,u,s)=>{const f=a._zod.def,d=f.in._zod.traits.has("$ZodTransform"),m=l.io==="input"?d?f.out:f.in:f.out;Zt(m,l,s);const p=l.seen.get(a);p.ref=m},Qw=(a,l,u,s)=>{const f=a._zod.def;Zt(f.innerType,l,s);const d=l.seen.get(a);d.ref=f.innerType,u.readOnly=!0},_b=(a,l,u,s)=>{const f=a._zod.def;Zt(f.innerType,l,s);const d=l.seen.get(a);d.ref=f.innerType},hy=new WeakSet([Object.prototype,Error.prototype]);function mo(a,l,u){Object.defineProperty(a,l,{configurable:!0,enumerable:!1,get(){const s=u(this);return Object.defineProperty(this,l,{value:s,configurable:!0,writable:!0}),s},set(s){Object.defineProperty(this,l,{value:s,configurable:!0,writable:!0})}})}const Fw=(a,l)=>{f2.init(a,l),a.name="ZodError";const u=Object.getPrototypeOf(a);hy.has(u)||(hy.add(u),mo(u,"format",s=>f=>m2(s,f)),mo(u,"flatten",s=>f=>h2(s,f)),mo(u,"addIssue",s=>f=>{s.issues.push(f),s.message=JSON.stringify(s.issues,Hd,2)}),mo(u,"addIssues",s=>f=>{s.issues.push(...f),s.message=JSON.stringify(s.issues,Hd,2)}),Object.defineProperty(u,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Wn=W("ZodError",Fw,void 0,{Parent:Error}),Kw=ch(Wn),Iw=fh(Wn),Jw=dh(Wn),Pw=hh(Wn),Ww=x2(Wn),eN=S2(Wn),tN=j2(Wn),nN=_2(Wn),aN=z2(Wn),lN=w2(Wn),iN=N2(Wn),rN=C2(Wn);function sN(){ha.localeError||ka(Cz())}function Ho(){ha.memoizer||ka({memoizer:zz()})}const Et=W("ZodType",(a,l)=>(sN(),Ct.init(a,l),a.def=l,a.type=l.type,a),{check(...a){const l=this.def;return this.clone(qn(l,{checks:[...l.checks??[],...a.map(u=>typeof u=="function"?{_zod:{check:u,def:{check:"custom"},onattach:[]}}:u)]}),{parent:!0})},with(...a){return this.check(...a)},clone(a,l){return Hl(this,a,l)},brand(){return this},register(a,l){return a.add(this,l),this},refine(a,l){return this.check(l4(a,l))},superRefine(a,l){return this.check(i4(a,l))},overwrite(a){return this.check(pr(a))},optional(){return gy(this)},exactOptional(){return GN(this)},nullable(){return vy(this)},nullish(){return gy(vy(this))},nonoptional(a){return JN(this,a)},array(){return oa(this)},or(a){return BN([this,a])},and(a){return LN(this,a)},transform(a){return yy(this,VN(a))},default(a){return FN(this,a)},prefault(a){return IN(this,a)},catch(a){return WN(this,a)},pipe(a){return yy(this,a)},readonly(){return n4(this)},describe(a){const l=this.clone();return Cs.add(l,{description:a}),l},meta(...a){if(a.length===0)return Cs.get(this);const l=this.clone();return Cs.add(l,a[0]),l},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(a,...l){return l.length===0?a(this):a(this,...l)},get"~standard"(){return Y0(this,"~standard",{...J0(this),jsonSchema:{input:Ao(this,"input"),output:Ao(this,"output")}})},set"~standard"(a){$l(this,"~standard",a)},parse:function a(l,u){return Kw(this,l,u,{callee:a})},parseAsync:async function a(l,u){return await Iw(this,l,u,{callee:a})},safeParse(a,l){return Jw(this,a,l)},async safeParseAsync(a,l){return Pw(this,a,l)},get spa(){return this==null?void 0:this.safeParseAsync},set spa(a){$l(this,"spa",a)},validate(a,l){return v2(this,a,l)},validateAsync(a,l){return b2(this,a,l)},encode:function a(l,u){return Ww(this,l,u,{callee:a})},decode:function a(l,u){return eN(this,l,u,{callee:a})},encodeAsync:async function a(l,u){return await tN(this,l,u,{callee:a})},decodeAsync:async function a(l,u){return await nN(this,l,u,{callee:a})},safeEncode(a,l){return aN(this,a,l)},safeDecode(a,l){return lN(this,a,l)},async safeEncodeAsync(a,l){return iN(this,a,l)},async safeDecodeAsync(a,l){return rN(this,a,l)},toJSONSchema(a){return zw(this,{})(a)},get description(){var a;return(a=Cs.get(this))==null?void 0:a.description},get _def(){return this._zod.def}}),zb=W("_ZodString",(a,l)=>{gh.init(a,l),Et.init(a,l),a._zod.processJSONSchema=(u,s,f)=>Cw(a,u,s)},V0({format:a=>fa(a).format??null,minLength:a=>fa(a).minimum??null,maxLength:a=>fa(a).maximum??null},{regex(...a){return this.check(uw(...a))},includes(...a){return this.check(fw(...a))},startsWith(...a){return this.check(dw(...a))},endsWith(...a){return this.check(hw(...a))},min(...a){return this.check(To(...a))},max(...a){return this.check(cb(...a))},length(...a){return this.check(fb(...a))},nonempty(...a){return this.check(To(1,...a))},lowercase(a){return this.check(ow(a))},uppercase(a){return this.check(cw(a))},trim(){return this.check(pw())},normalize(...a){return this.check(mw(...a))},toLowerCase(){return this.check(gw())},toUpperCase(){return this.check(vw())},slugify(){return this.check(yw())}})),uN=W("ZodString",(a,l)=>{gh.init(a,l),zb.init(a,l)},{email(a){return this.check(Oz(hN,a))},url(a){return this.check(Zz(pN,a))},jwt(a){return this.check(Pz(AN,a))},emoji(a){return this.check($z(gN,a))},guid(a){return this.check(kz(mN,a))},uuid(a){return this.check(Dz(po,a))},uuidv4(a){return this.check(Mz(po,a))},uuidv6(a){return this.check(Rz(po,a))},uuidv7(a){return this.check(Uz(po,a))},nanoid(a){return this.check(Bz(vN,a))},cuid(a){return this.check(Hz(yN,a))},cuid2(a){return this.check(Lz(bN,a))},ulid(a){return this.check(qz(xN,a))},base64(a){return this.check(Kz(CN,a))},base64url(a){return this.check(Iz(EN,a))},xid(a){return this.check(Yz(SN,a))},ksuid(a){return this.check(Vz(jN,a))},ipv4(a){return this.check(Gz(_N,a))},ipv6(a){return this.check(Xz(zN,a))},cidrv4(a){return this.check(Qz(wN,a))},cidrv6(a){return this.check(Fz(NN,a))},e164(a){return this.check(Jz(TN,a))},datetime(a){return this.check(Wz(oN,a))},date(a){return this.check(ew(cN,a))},time(a){return this.check(tw(fN,a))},duration(a){return this.check(nw(dN,a))}});function Je(a){return Az(uN,a)}const jt=W("ZodStringFormat",(a,l)=>{bt.init(a,l),zb.init(a,l)}),oN=W("ZodISODateTime",(a,l)=>{M_.init(a,l),jt.init(a,l)}),cN=W("ZodISODate",(a,l)=>{R_.init(a,l),jt.init(a,l)}),fN=W("ZodISOTime",(a,l)=>{U_.init(a,l),jt.init(a,l)}),dN=W("ZodISODuration",(a,l)=>{Z_.init(a,l),jt.init(a,l)}),hN=W("ZodEmail",(a,l)=>{x_.init(a,l),jt.init(a,l)}),mN=W("ZodGUID",(a,l)=>{y_.init(a,l),jt.init(a,l)}),po=W("ZodUUID",(a,l)=>{b_.init(a,l),jt.init(a,l)}),pN=W("ZodURL",(a,l)=>{N_.init(a,l),jt.init(a,l)}),gN=W("ZodEmoji",(a,l)=>{C_.init(a,l),jt.init(a,l)}),vN=W("ZodNanoID",(a,l)=>{E_.init(a,l),jt.init(a,l)}),yN=W("ZodCUID",(a,l)=>{T_.init(a,l),jt.init(a,l)}),bN=W("ZodCUID2",(a,l)=>{A_.init(a,l),jt.init(a,l)}),xN=W("ZodULID",(a,l)=>{O_.init(a,l),jt.init(a,l)}),SN=W("ZodXID",(a,l)=>{k_.init(a,l),jt.init(a,l)}),jN=W("ZodKSUID",(a,l)=>{D_.init(a,l),jt.init(a,l)}),_N=W("ZodIPv4",(a,l)=>{$_.init(a,l),jt.init(a,l)}),zN=W("ZodIPv6",(a,l)=>{H_.init(a,l),jt.init(a,l)}),wN=W("ZodCIDRv4",(a,l)=>{L_.init(a,l),jt.init(a,l)}),NN=W("ZodCIDRv6",(a,l)=>{Y_.init(a,l),jt.init(a,l)}),CN=W("ZodBase64",(a,l)=>{V_.init(a,l),jt.init(a,l)}),EN=W("ZodBase64URL",(a,l)=>{X_.init(a,l),jt.init(a,l)}),TN=W("ZodE164",(a,l)=>{Q_.init(a,l),jt.init(a,l)}),AN=W("ZodJWT",(a,l)=>{K_.init(a,l),jt.init(a,l)}),wb=W("ZodNumber",(a,l)=>{ab.init(a,l),Et.init(a,l),a._zod.processJSONSchema=(u,s,f)=>Ew(a,u,s,f),a.isFinite=!0},V0({minValue:a=>{const{minimum:l,exclusiveMinimum:u}=fa(a);return Math.max(l??Number.NEGATIVE_INFINITY,u??Number.NEGATIVE_INFINITY)},maxValue:a=>{const{maximum:l,exclusiveMaximum:u}=fa(a);return Math.min(l??Number.POSITIVE_INFINITY,u??Number.POSITIVE_INFINITY)},isInt:a=>{const{isInt:l,multipleOf:u}=fa(a);return!!l||!!(u!=null&&u.some(Number.isSafeInteger))},format:a=>fa(a).format??null},{gt(a,l){return this.check(ly(a,l))},gte(a,l){return this.check(Td(a,l))},min(a,l){return this.check(Td(a,l))},lt(a,l){return this.check(ay(a,l))},lte(a,l){return this.check(Ed(a,l))},max(a,l){return this.check(Ed(a,l))},int(a){return this.check(my(a))},safe(a){return this.check(my(a))},positive(a){return this.check(ly(0,a))},nonnegative(a){return this.check(Td(0,a))},negative(a){return this.check(ay(0,a))},nonpositive(a){return this.check(Ed(0,a))},multipleOf(a,l){return this.check(iy(a,l))},step(a,l){return this.check(iy(a,l))},finite(){return this}}));function $n(a){return aw(wb,a)}const ON=W("ZodNumberFormat",(a,l)=>{I_.init(a,l),wb.init(a,l)});function my(a){return lw(ON,a)}const kN=W("ZodBoolean",(a,l)=>{J_.init(a,l),Et.init(a,l),a._zod.processJSONSchema=(u,s,f)=>Tw(a,u,s)});function Bn(a){return iw(kN,a)}const DN=W("ZodUnknown",(a,l)=>{P_.init(a,l),Et.init(a,l),a._zod.processJSONSchema=(u,s,f)=>Ow()});function Fd(){return rw(DN)}const MN=W("ZodNever",(a,l)=>{W_.init(a,l),Et.init(a,l),a._zod.processJSONSchema=(u,s,f)=>Aw(a,u,s)});function RN(a){return sw(MN,a)}const UN=W("ZodArray",(a,l)=>{Ho(),nz.init(a,l),Et.init(a,l),a._zod.processJSONSchema=(u,s,f)=>Rw(a,u,s,f),a.element=l.element},{min(a,l){return this.check(To(a,l))},nonempty(a){return this.check(To(1,a))},max(a,l){return this.check(cb(a,l))},length(a,l){return this.check(fb(a,l))},unwrap(){return this.element}});function oa(a,l){return bw(UN,a,l)}const ZN=W("ZodObject",(a,l)=>{Ho(),iz.init(a,l),Et.init(a,l),a._zod.processJSONSchema=(u,s,f)=>Uw(a,u,s,f),a2(a,"shape",u=>u._zod.def.shape,!1)},{keyof(){return Hn(Object.keys(this._zod.def.shape))},catchall(a){return this.clone(qn(this._zod.def,{catchall:a}))},passthrough(){return this.clone(qn(this._zod.def,{catchall:Fd()}))},loose(){return this.clone(qn(this._zod.def,{catchall:Fd()}))},strict(){return this.clone(qn(this._zod.def,{catchall:RN()}))},strip(){return this.clone(qn(this._zod.def,{catchall:void 0}))},extend(a){return Xj(this,a)},safeExtend(a){return Qj(this,a)},merge(a){return Fj(this,a)},pick(a){return Vj(this,a)},omit(a){return Gj(this,a)},partial(...a){return Bv(Nb,this,a[0])},exactPartial(...a){return Bv(Cb,this,a[0],"exactPartial")},required(...a){return Kj(Eb,this,a[0])}});function yn(a,l){const u={type:"object",shape:a??{},...Ee(l)};return new ZN(u)}const $N=W("ZodUnion",(a,l)=>{rz.init(a,l),Et.init(a,l),a._zod.processJSONSchema=(u,s,f)=>Zw(a,u,s,f),a.options=l.options});function BN(a,l){return new $N({type:"union",options:a,...Ee(l)})}const HN=W("ZodIntersection",(a,l)=>{sz.init(a,l),Et.init(a,l),a._zod.processJSONSchema=(u,s,f)=>$w(a,u,s,f)});function LN(a,l){return new HN({type:"intersection",left:a,right:l})}const py=W("ZodRecord",(a,l)=>{Ho(),uz.init(a,l),Et.init(a,l),a._zod.processJSONSchema=(u,s,f)=>Hw(a,u,s,f),a.keyType=l.keyType,a.valueType=l.valueType});function qN(a,l,u){return!l||!l._zod?new py({type:"record",keyType:Je(),valueType:a,...Ee(l)}):new py({type:"record",keyType:a,valueType:l,...Ee(u)})}const Kd=W("ZodEnum",(a,l)=>{oz.init(a,l),Et.init(a,l),a._zod.processJSONSchema=(s,f,d)=>kw(a,s,f),a.enum=l.entries,a.options=[...a._zod.values];const u=new Set(Object.keys(l.entries));a.extract=(s,f)=>{const d={};for(const m of s)if(u.has(m))d[m]=l.entries[m];else throw new Error(`Key ${m} not found in enum`);return new Kd({...l,checks:[],...Ee(f),entries:d})},a.exclude=(s,f)=>{const d={...l.entries};for(const m of s)if(u.has(m))delete d[m];else throw new Error(`Key ${m} not found in enum`);return new Kd({...l,checks:[],...Ee(f),entries:d})}});function Hn(a,l){const u=Array.isArray(a)?Object.fromEntries(a.map(s=>[s,s])):a;return new Kd({type:"enum",entries:u,...Ee(l)})}const YN=W("ZodTransform",(a,l)=>{Ho(),cz.init(a,l),Et.init(a,l),a._zod.processJSONSchema=(u,s,f)=>Mw(a,u,s,f),a._zod.parse=(u,s)=>{if(s.direction==="backward")throw new G0(a.constructor.name);u.addIssue=d=>{if(typeof d=="string")u.issues.push(Ms(d,u.value,l));else{const m=d;m.fatal&&(m.continue=!1),m.code??(m.code="custom"),"input"in m||(m.input=u.value),m.inst??(m.inst=a),u.issues.push(Ms(m))}};const f=l.transform(u.value,u);return f instanceof Promise?f.then(d=>(u.value=d,u)):(u.value=f,u)}});function VN(a){return new YN({type:"transform",transform:a})}const Nb=W("ZodOptional",(a,l)=>{rb.init(a,l),Et.init(a,l),a._zod.processJSONSchema=(u,s,f)=>_b(a,u,s,f),a.unwrap=()=>a._zod.def.innerType});function gy(a){return new Nb({type:"optional",innerType:a})}const Cb=W("ZodExactOptional",(a,l)=>{fz.init(a,l),Et.init(a,l),a._zod.processJSONSchema=(u,s,f)=>_b(a,u,s,f),a.unwrap=()=>a._zod.def.innerType});function GN(a){return new Cb({type:"optional",innerType:a})}const XN=W("ZodNullable",(a,l)=>{dz.init(a,l),Et.init(a,l),a._zod.processJSONSchema=(u,s,f)=>Lw(a,u,s,f),a.unwrap=()=>a._zod.def.innerType});function vy(a){return new XN({type:"nullable",innerType:a})}const QN=W("ZodDefault",(a,l)=>{hz.init(a,l),Et.init(a,l),a._zod.processJSONSchema=(u,s,f)=>Yw(a,u,s,f),a.unwrap=()=>a._zod.def.innerType,a.removeDefault=a.unwrap});function FN(a,l){return new QN({type:"default",innerType:a,get defaultValue(){return typeof l=="function"?l():B0(l)}})}const KN=W("ZodPrefault",(a,l)=>{mz.init(a,l),Et.init(a,l),a._zod.processJSONSchema=(u,s,f)=>Vw(a,u,s,f),a.unwrap=()=>a._zod.def.innerType});function IN(a,l){return new KN({type:"prefault",innerType:a,get defaultValue(){return typeof l=="function"?l():B0(l)}})}const Eb=W("ZodNonOptional",(a,l)=>{pz.init(a,l),Et.init(a,l),a._zod.processJSONSchema=(u,s,f)=>qw(a,u,s,f),a.unwrap=()=>a._zod.def.innerType});function JN(a,l){return new Eb({type:"nonoptional",innerType:a,...Ee(l)})}const PN=W("ZodCatch",(a,l)=>{gz.init(a,l),Et.init(a,l),a._zod.processJSONSchema=(u,s,f)=>Gw(a,u,s,f),a.unwrap=()=>a._zod.def.innerType,a.removeCatch=a.unwrap});function WN(a,l){return new PN({type:"catch",innerType:a,catchValue:typeof l=="function"?l:i2(l)})}const e4=W("ZodPipe",(a,l)=>{vz.init(a,l),Et.init(a,l),a._zod.processJSONSchema=(u,s,f)=>Xw(a,u,s,f),a.in=l.in,a.out=l.out});function yy(a,l){return new e4({type:"pipe",in:a,out:l})}const t4=W("ZodReadonly",(a,l)=>{yz.init(a,l),Et.init(a,l),a._zod.processJSONSchema=(u,s,f)=>Qw(a,u,s,f),a.unwrap=()=>a._zod.def.innerType});function n4(a){return new t4({type:"readonly",innerType:a})}const a4=W("ZodCustom",(a,l)=>{bz.init(a,l),Et.init(a,l),a._zod.processJSONSchema=(u,s,f)=>Dw(a,u,s,f)});function l4(a,l={}){return xw(a4,a,l)}function i4(a,l){return Sw(a,l)}class r4 extends Error{}Promise.resolve();const ko=[{id:"summary",zh:"总结要点",en:"Summarize",prompt:"Summarize the main points with specific supporting details."},{id:"translate",zh:"翻译全文",en:"Translate",prompt:"Translate the supplied page faithfully. Preserve headings and lists."},{id:"explain",zh:"解释概念",en:"Explain",prompt:"Explain the key concepts with concrete examples and distinguish claims from evidence."},{id:"followup",zh:"继续追问",en:"Explore further",prompt:"Suggest useful follow-up questions, and explain why each matters."},{id:"grammar",zh:"语法分析",en:"Analyze grammar",prompt:"Analyze important sentences, grammar and vocabulary in this text."},{id:"card",zh:"整理阅读卡",en:"Make reading notes",prompt:"Create a concise reading card in Markdown with a title, key quotation, interpretation and practical action. Only use the supplied source."}],Tb=yn({id:Je().min(1).max(100).regex(/^[a-zA-Z0-9_-]+$/),name:Je().trim().min(1).max(100),prompt:Je().trim().min(1).max(12e3),enabled:Bn(),order:$n().int().min(0).max(1e4)}),Lo=oa(Tb).max(100).refine(a=>new Set(a.map(l=>l.id)).size===a.length,"Reading presets must have unique IDs").refine(a=>a.filter(l=>!ko.some(u=>u.id===l.id)).length+ko.length<=100,"Reading presets are limited to 100 including built-ins");function bh(a,l){const u=Lo.parse(a),s=new Set(ko.map(d=>d.id));return[...ko.map((d,m)=>{const p=u.find(g=>g.id===d.id);return{id:d.id,prompt:d.prompt,enabled:!0,order:m,...p,name:p&&![d.zh,d.en].some(g=>g===p.name)?p.name:l==="zh"?d.zh:d.en,isBuiltin:!0,isModified:!!p}}),...u.filter(d=>!s.has(d.id)).map(d=>({...d,isBuiltin:!1,isModified:!0}))].sort((d,m)=>d.order-m.order)}function by(a,l){const u=Tb.parse(l);return Lo.parse([...a.filter(s=>s.id!==u.id),u])}function xy(a,l,u,s){const f=bh(a,l),d=f.findIndex(p=>p.id===u),m=d+s;return d<0||m<0||m>=f.length?a:([f[d],f[m]]=[f[m],f[d]],Lo.parse(f.map(({isBuiltin:p,isModified:g,...S},y)=>({...S,order:y}))))}const nl=[{key:"title",name:"Title",type:"text",isBuiltin:!0,enabled:!0},{key:"source",name:"Url",type:"text",isBuiltin:!0,enabled:!0,visibleInSidepanel:!1},{key:"author",name:"Author",type:"text",isBuiltin:!0,enabled:!0},{key:"origin",name:"Origin",type:"select",isBuiltin:!0,enabled:!0},{key:"description",name:"Description",type:"text",isBuiltin:!0,enabled:!0},{key:"tags",name:"Tags",type:"multiselect",isBuiltin:!0,enabled:!0},{key:"created",name:"Created",type:"datetime",isBuiltin:!0,enabled:!0,visibleInSidepanel:!1},{key:"cover",name:"Cover",type:"text",isBuiltin:!0,enabled:!0}],xh={fields:nl.map(a=>({...a})),dateFormat:"YYYY-MM-DD HH:mm:ss"},Sh=["text","select","multiselect","datetime","date","number","checkbox"],Ab=new Set(["__proto__","prototype","constructor"]),Ob=a=>typeof a=="string"&&a.length<=80&&/^[\p{L}_][\p{L}\p{N}_ -]*$/u.test(a)&&!Ab.has(a),kb=a=>typeof a=="string"&&/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/.test(a)&&!Ab.has(a);function s4(a){const l=a&&typeof a=="object"?a:{},u=Array.isArray(l.fields)?l.fields.slice(0,64):[],s=new Set,f=[],d=new Map(nl.map(j=>[j.key,j])),m=new Map(nl.map(j=>[j.name,j.key]));for(const j of u){if(!j||typeof j!="object")continue;const w=typeof j.key=="string"?j.key.trim():"";if(!kb(w)||s.has(w))continue;const E=d.get(w),T=typeof j.name=="string"?j.name.trim():"",A=Ob(T)&&(!m.has(T)||m.get(T)===w)?T:(E==null?void 0:E.name)||w;f.push({key:w,name:A,type:(E==null?void 0:E.type)||(Sh.includes(j.type)?j.type:"text"),isBuiltin:!!E,enabled:j.enabled!==!1,visibleInSidepanel:typeof j.visibleInSidepanel=="boolean"?j.visibleInSidepanel:(E==null?void 0:E.visibleInSidepanel)??!0}),s.add(w)}const p=new Map(f.map(j=>[j.key,j])),g=new Set,S=nl.map(j=>{const w={...p.get(j.key)||j};return g.has(w.name)&&(w.name=j.name),g.add(w.name),w}),y=f.filter(j=>j.isBuiltin||g.has(j.name)?!1:(g.add(j.name),!0)).slice(0,64-S.length),v=typeof l.dateFormat=="string"&&l.dateFormat.trim()&&l.dateFormat.length<=120&&!/[\u0000-\u001f\u007f]/.test(l.dateFormat)?l.dateFormat:xh.dateFormat;return{fields:[...S,...y],dateFormat:v}}function Os(a,l){var u;return(u=(a||nl).find(s=>s.key===l&&s.enabled))==null?void 0:u.name}function Sy(a,l=!1){if(typeof a!="string")return"";const u=l&&/^\d{4}-\d\d-\d\d \d\d:\d\d:\d\d$/.test(a)?a.replace(" ","T"):a,s=u.match(/^(\d{4})-(\d\d)-(\d\d)(?:T(\d\d):(\d\d)(?::(\d\d)(?:\.\d{1,3})?)?(?:Z|[+-]\d\d:\d\d)?)?$/);if(!s)return"";const[,f,d,m,p,g,S]=s,y=new Date(Date.UTC(Number(f),Number(d),0)).getUTCDate();if(Number(d)<1||Number(d)>12||Number(m)<1||Number(m)>y||Number(p||0)>23||Number(g||0)>59||Number(S||0)>59)return"";const v=new Date(u);return Number.isFinite(v.getTime())?u.length===10?u:v.toISOString():""}function u4(a){var s;const l=Sy(a.createdAt);if(l)return l;const u=Os(a.frontMatterFields,"created");return u?Sy((s=a.frontMatter)==null?void 0:s[u],!0):""}class o4 extends Error{constructor(u){super(`${u.zh} / ${u.en}`);jv(this,"code","frontmatter-settings");this.localized=u,this.name="FrontMatterValidationError"}}function Zn(a,l){throw new o4({zh:a,en:l})}function Db(a){(!a||typeof a!="object"||Array.isArray(a))&&Zn("属性设置必须是对象。","Front-matter settings must be an object.");const l=a;Object.keys(l).some(m=>!["fields","dateFormat"].includes(m))&&Zn("属性设置包含未知选项。","Front-matter settings contain an unknown option."),(!Array.isArray(l.fields)||l.fields.length>64)&&Zn("属性列表最多允许 64 个字段。","At most 64 front-matter fields are allowed."),(typeof l.dateFormat!="string"||!l.dateFormat.trim()||l.dateFormat.length>120||/[\u0000-\u001f\u007f]/.test(l.dateFormat))&&Zn("日期格式不能为空、不能含控制字符,且最多 120 个字符。","The date format must contain 1–120 characters and no control characters.");const u=new Map(nl.map(m=>[m.key,m])),s=new Set,f=new Set;for(const m of l.fields){(!m||typeof m!="object"||Array.isArray(m)||Object.keys(m).some(S=>!["key","name","type","isBuiltin","enabled","visibleInSidepanel"].includes(S)))&&Zn("属性字段格式无效或包含未知选项。","A front-matter field has an invalid format or unknown option."),(!kb(m.key)||m.key.trim()!==m.key)&&Zn("字段标识须以英文字母开头,仅含字母、数字、下划线或连字符,最多 64 字符。","Field keys must start with a letter and contain only letters, numbers, underscores or hyphens, up to 64 characters."),(!Ob(m.name)||m.name.trim()!==m.name)&&Zn("输出名称须以字母或下划线开头,仅含文字、数字、空格、下划线或连字符,最多 80 字符。","Output names must start with a letter or underscore and contain only letters, numbers, spaces, underscores or hyphens, up to 80 characters."),(s.has(m.key)||f.has(m.name))&&Zn("字段标识和输出名称不能重复。","Field keys and output names must be unique.");const p=u.get(m.key);(!Sh.includes(m.type)||p&&m.type!==p.type)&&Zn("属性类型无效;内置字段的类型不可更改。","The field type is invalid; builtin field types cannot be changed."),(typeof m.enabled!="boolean"||m.visibleInSidepanel!==void 0&&typeof m.visibleInSidepanel!="boolean"||m.isBuiltin!==void 0&&(typeof m.isBuiltin!="boolean"||m.isBuiltin!==!!p))&&Zn("字段启用、可见性和内置标志无效。","Field enabled, visibility or builtin flags are invalid."),nl.find(S=>S.name===m.name&&S.key!==m.key)&&Zn("输出名称与内置字段冲突,请使用另一个名称。","The output name conflicts with a builtin field; choose another name."),s.add(m.key),f.add(m.name)}const d=nl.filter(m=>!s.has(m.key));return l.fields.length+d.length>64&&Zn("保留内置字段后,属性总数不能超过 64。","The total including builtin fields cannot exceed 64."),d.some(m=>f.has(m.name))&&Zn("输出名称与补回的内置字段冲突。","An output name conflicts with a restored builtin field."),s4(l)}var jo={exports:{}},c4=jo.exports,jy;function f4(){return jy||(jy=1,(function(a,l){(function(u,s){a.exports=s()})(c4,(function(){var u=1e3,s=6e4,f=36e5,d="millisecond",m="second",p="minute",g="hour",S="day",y="week",v="month",j="quarter",w="year",E="date",T="Invalid Date",A=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Z=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,Y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(le){var X=["th","st","nd","rd"],z=le%100;return"["+le+(X[(z-20)%10]||X[z]||X[0])+"]"}},ye=function(le,X,z){var U=String(le);return!U||U.length>=X?le:""+Array(X+1-U.length).join(z)+le},te={s:ye,z:function(le){var X=-le.utcOffset(),z=Math.abs(X),U=Math.floor(z/60),B=z%60;return(X<=0?"+":"-")+ye(U,2,"0")+":"+ye(B,2,"0")},m:function le(X,z){if(X.date()<z.date())return-le(z,X);var U=12*(z.year()-X.year())+(z.month()-X.month()),B=X.clone().add(U,v),se=z-B<0,ae=X.clone().add(U+(se?-1:1),v);return+(-(U+(z-B)/(se?B-ae:ae-B))||0)},a:function(le){return le<0?Math.ceil(le)||0:Math.floor(le)},p:function(le){return{M:v,y:w,w:y,d:S,D:E,h:g,m:p,s:m,ms:d,Q:j}[le]||String(le||"").toLowerCase().replace(/s$/,"")},u:function(le){return le===void 0}},ue="en",I={};I[ue]=Y;var Q="$isDayjsObject",G=function(le){return le instanceof Se||!(!le||!le[Q])},ie=function le(X,z,U){var B;if(!X)return ue;if(typeof X=="string"){var se=X.toLowerCase();I[se]&&(B=se),z&&(I[se]=z,B=se);var ae=X.split("-");if(!B&&ae.length>1)return le(ae[0])}else{var je=X.name;I[je]=X,B=je}return!U&&B&&(ue=B),B||!U&&ue},_e=function(le,X){if(G(le))return le.clone();var z=typeof X=="object"?X:{};return z.date=le,z.args=arguments,new Se(z)},ce=te;ce.l=ie,ce.i=G,ce.w=function(le,X){return _e(le,{locale:X.$L,utc:X.$u,x:X.$x,$offset:X.$offset})};var Se=(function(){function le(z){this.$L=ie(z.locale,null,!0),this.parse(z),this.$x=this.$x||z.x||{},this[Q]=!0}var X=le.prototype;return X.parse=function(z){this.$d=(function(U){var B=U.date,se=U.utc;if(B===null)return new Date(NaN);if(ce.u(B))return new Date;if(B instanceof Date)return new Date(B);if(typeof B=="string"&&!/Z$/i.test(B)){var ae=B.match(A);if(ae){var je=ae[2]-1||0,Te=(ae[7]||"0").substring(0,3);return se?new Date(Date.UTC(ae[1],je,ae[3]||1,ae[4]||0,ae[5]||0,ae[6]||0,Te)):new Date(ae[1],je,ae[3]||1,ae[4]||0,ae[5]||0,ae[6]||0,Te)}}return new Date(B)})(z),this.init()},X.init=function(){var z=this.$d;this.$y=z.getFullYear(),this.$M=z.getMonth(),this.$D=z.getDate(),this.$W=z.getDay(),this.$H=z.getHours(),this.$m=z.getMinutes(),this.$s=z.getSeconds(),this.$ms=z.getMilliseconds()},X.$utils=function(){return ce},X.isValid=function(){return this.$d.toString()!==T},X.isSame=function(z,U){var B=_e(z);return this.startOf(U)<=B&&B<=this.endOf(U)},X.isAfter=function(z,U){return _e(z)<this.startOf(U)},X.isBefore=function(z,U){return this.endOf(U)<_e(z)},X.$g=function(z,U,B){return ce.u(z)?this[U]:this.set(B,z)},X.unix=function(){return Math.floor(this.valueOf()/1e3)},X.valueOf=function(){return this.$d.getTime()},X.startOf=function(z,U){var B=this,se=!!ce.u(U)||U,ae=ce.p(z),je=function(ee,fe){var oe=ce.w(B.$u?Date.UTC(B.$y,fe,ee):new Date(B.$y,fe,ee),B);return se?oe:oe.endOf(S)},Te=function(ee,fe){return ce.w(B.toDate()[ee].apply(B.toDate("s"),(se?[0,0,0,0]:[23,59,59,999]).slice(fe)),B)},ke=this.$W,C=this.$M,V=this.$D,de="set"+(this.$u?"UTC":"");switch(ae){case w:return se?je(1,0):je(31,11);case v:return se?je(1,C):je(0,C+1);case y:var re=this.$locale().weekStart||0,Ne=(ke<re?ke+7:ke)-re;return je(se?V-Ne:V+(6-Ne),C);case S:case E:return Te(de+"Hours",0);case g:return Te(de+"Minutes",1);case p:return Te(de+"Seconds",2);case m:return Te(de+"Milliseconds",3);default:return this.clone()}},X.endOf=function(z){return this.startOf(z,!1)},X.$set=function(z,U){var B,se=ce.p(z),ae="set"+(this.$u?"UTC":""),je=(B={},B[S]=ae+"Date",B[E]=ae+"Date",B[v]=ae+"Month",B[w]=ae+"FullYear",B[g]=ae+"Hours",B[p]=ae+"Minutes",B[m]=ae+"Seconds",B[d]=ae+"Milliseconds",B)[se],Te=se===S?this.$D+(U-this.$W):U;if(se===v||se===w){var ke=this.clone().set(E,1);ke.$d[je](Te),ke.init(),this.$d=ke.set(E,Math.min(this.$D,ke.daysInMonth())).$d}else je&&this.$d[je](Te);return this.init(),this},X.set=function(z,U){return this.clone().$set(z,U)},X.get=function(z){return this[ce.p(z)]()},X.add=function(z,U){var B,se=this;z=Number(z);var ae=ce.p(U),je=function(C){var V=_e(se);return ce.w(V.date(V.date()+Math.round(C*z)),se)};if(ae===v)return this.set(v,this.$M+z);if(ae===w)return this.set(w,this.$y+z);if(ae===S)return je(1);if(ae===y)return je(7);var Te=(B={},B[p]=s,B[g]=f,B[m]=u,B)[ae]||1,ke=this.$d.getTime()+z*Te;return ce.w(ke,this)},X.subtract=function(z,U){return this.add(-1*z,U)},X.format=function(z){var U=this,B=this.$locale();if(!this.isValid())return B.invalidDate||T;var se=z||"YYYY-MM-DDTHH:mm:ssZ",ae=ce.z(this),je=this.$H,Te=this.$m,ke=this.$M,C=B.weekdays,V=B.months,de=B.meridiem,re=function(fe,oe,pe,He){return fe&&(fe[oe]||fe(U,se))||pe[oe].slice(0,He)},Ne=function(fe){return ce.s(je%12||12,fe,"0")},ee=de||function(fe,oe,pe){var He=fe<12?"AM":"PM";return pe?He.toLowerCase():He};return se.replace(Z,(function(fe,oe){return oe||(function(pe){switch(pe){case"YY":return String(U.$y).slice(-2);case"YYYY":return ce.s(U.$y,4,"0");case"M":return ke+1;case"MM":return ce.s(ke+1,2,"0");case"MMM":return re(B.monthsShort,ke,V,3);case"MMMM":return re(V,ke);case"D":return U.$D;case"DD":return ce.s(U.$D,2,"0");case"d":return String(U.$W);case"dd":return re(B.weekdaysMin,U.$W,C,2);case"ddd":return re(B.weekdaysShort,U.$W,C,3);case"dddd":return C[U.$W];case"H":return String(je);case"HH":return ce.s(je,2,"0");case"h":return Ne(1);case"hh":return Ne(2);case"a":return ee(je,Te,!0);case"A":return ee(je,Te,!1);case"m":return String(Te);case"mm":return ce.s(Te,2,"0");case"s":return String(U.$s);case"ss":return ce.s(U.$s,2,"0");case"SSS":return ce.s(U.$ms,3,"0");case"Z":return ae}return null})(fe)||ae.replace(":","")}))},X.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},X.diff=function(z,U,B){var se,ae=this,je=ce.p(U),Te=_e(z),ke=(Te.utcOffset()-this.utcOffset())*s,C=this-Te,V=function(){return ce.m(ae,Te)};switch(je){case w:se=V()/12;break;case v:se=V();break;case j:se=V()/3;break;case y:se=(C-ke)/6048e5;break;case S:se=(C-ke)/864e5;break;case g:se=C/f;break;case p:se=C/s;break;case m:se=C/u;break;default:se=C}return B?se:ce.a(se)},X.daysInMonth=function(){return this.endOf(v).$D},X.$locale=function(){return I[this.$L]},X.locale=function(z,U){if(!z)return this.$L;var B=this.clone(),se=ie(z,U,!0);return se&&(B.$L=se),B},X.clone=function(){return ce.w(this.$d,this)},X.toDate=function(){return new Date(this.valueOf())},X.toJSON=function(){return this.isValid()?this.toISOString():null},X.toISOString=function(){return this.$d.toISOString()},X.toString=function(){return this.$d.toUTCString()},le})(),he=Se.prototype;return _e.prototype=he,[["$ms",d],["$s",m],["$m",p],["$H",g],["$W",S],["$M",v],["$y",w],["$D",E]].forEach((function(le){he[le[1]]=function(X){return this.$g(X,le[0],le[1])}})),_e.extend=function(le,X){return le.$i||(le(X,Se,_e),le.$i=!0),_e},_e.locale=ie,_e.isDayjs=G,_e.unix=function(le){return _e(1e3*le)},_e.en=I[ue],_e.Ls=I,_e.p={},_e}))})(jo)),jo.exports}f4();const _o=["highlight","copy","save","save-all","flomo","translate","explain","grammar","mnemonic","vocabulary"],d4=["#F8F3DE","#FBE3E3","#E1F3E5","#DFEBFB","#EFE4FA"],Mb={translateEnabled:!0,explainEnabled:!0,grammarEnabled:!0,mnemonicEnabled:!0,toolbarPosition:"above",rememberColor:!0,defaultColor:"#F8F3DE",showDestinationSelector:!0,autoAddVocabulary:!0,resultPosition:"top_left",resultX:16,resultY:16,targetLanguage:"zh-CN",translationProvider:"google",disabledSites:[],actions:[..._o],prompts:{explain:"",grammar:"",mnemonic:""}},Rb={fontSize:16,width:760,fontFamily:"system",chineseFont:"system",lineHeight:1.75},zo=["save","panel","ai","vocab","toggle","region","highlights","hide"],Ub={actions:[...zo],enabled:!0,side:"right",y:50,disabledSites:[]},Zb={concurrency:3,destinationConcurrency:3,maxRetries:3,retryDelayMs:1e3},xs={frontmatter:structuredClone(xh),readerPresets:[],preview:{...Rb},floating:structuredClone(Ub),queue:{...Zb},locale:typeof navigator<"u"&&navigator.language.toLowerCase().startsWith("zh")?"zh":"en",theme:"system",defaultTarget:"download",targets:[{id:"download",enabled:!0,options:{}}],cloudVault:"default",cloudFolder:"Forsion Clip",desktopFolder:"Forsion Clip",provider:"forsion",providers:[{id:"forsion",name:"Forsion AI",kind:"forsion",endpoint:"",apiKey:"",model:""}],daily:{enabled:!1,hour:9,minute:0,urls:[]},imageHost:{enabled:!1,id:"s3",options:{}},mcp:{enabled:!1,endpoint:"ws://127.0.0.1:18365",token:""},autoClipSites:[],selection:structuredClone(Mb)},_y=qN(Je(),Je().max(2e4)),$b=Je().max(253).transform(a=>a.trim().toLowerCase().replace(/\.$/,"")).refine(a=>{try{return!/[\s/*?#@]/.test(a)&&new URL(`https://${a}`).hostname===a}catch{return!1}},"Enter an exact hostname without a URL, port or wildcard"),Bb=yn({translateEnabled:Bn().default(!0),explainEnabled:Bn().default(!0),grammarEnabled:Bn().default(!0),mnemonicEnabled:Bn().default(!0),toolbarPosition:Hn(["above","below","hidden"]).default("above"),rememberColor:Bn().default(!0),defaultColor:Hn(d4).default("#F8F3DE"),showDestinationSelector:Bn().default(!0),autoAddVocabulary:Bn().default(!0),resultPosition:Hn(["top_left","top_right","below_selection","custom"]).default("top_left"),resultX:$n().min(0).max(1e5).default(16),resultY:$n().min(0).max(1e5).default(16),targetLanguage:Je().regex(/^[a-zA-Z]{2,8}(?:-[a-zA-Z0-9]{1,8})*$/).max(35).default("zh-CN"),translationProvider:Hn(["google","bing","ai"]).default("google"),disabledSites:oa($b).max(200).transform(a=>[...new Set(a)]).default([]),actions:oa(Hn(_o)).max(_o.length).transform(a=>[...new Set(a)]).default([..._o]),prompts:yn({explain:Je().max(8e3).default(""),grammar:Je().max(8e3).default(""),mnemonic:Je().max(8e3).default("")}).default({explain:"",grammar:"",mnemonic:""})}),h4=yn({readerPresets:Lo.default([]),frontmatter:Fd().transform(a=>Db(a??xh)),preview:yn({fontSize:$n().min(12).max(28).default(16),width:$n().min(360).max(1200).default(760),fontFamily:Hn(["system","serif","mono"]).default("system"),chineseFont:Hn(["system","serif"]).default("system"),lineHeight:$n().min(1.2).max(2.4).default(1.75)}).default(()=>({...Rb})),floating:yn({actions:oa(Hn(zo)).max(zo.length).transform(a=>[...new Set(a)]).default([...zo]),enabled:Bn().default(!0),side:Hn(["left","right"]).default("right"),y:$n().min(0).max(100).default(50),disabledSites:oa($b).max(200).default([])}).default(()=>structuredClone(Ub)),queue:yn({concurrency:$n().int().min(1).max(5).default(3),destinationConcurrency:$n().int().min(1).max(6).default(3),maxRetries:$n().int().min(0).max(5).default(3),retryDelayMs:$n().int().min(1e3).max(6e4).default(1e3)}).default(()=>({...Zb})),locale:Hn(["zh","en"]),theme:Hn(["light","dark","system"]),defaultTarget:Je().max(60),targets:oa(yn({id:Je().max(60),enabled:Bn(),options:_y})).max(24),cloudVault:Je().max(100),cloudFolder:Je().max(500),desktopFolder:Je().max(500),provider:Je().max(100),providers:oa(yn({id:Je().max(100),name:Je().max(100),kind:Hn(["forsion","openai","anthropic","google","ollama"]),endpoint:Je().max(2048),apiKey:Je().max(1e4),model:Je().max(200)})).max(30),daily:yn({enabled:Bn(),hour:$n().int().min(0).max(23),minute:$n().int().min(0).max(59),urls:oa(Je().url()).max(200)}),imageHost:yn({enabled:Bn(),id:Je().max(60),options:_y}),mcp:yn({enabled:Bn(),endpoint:Je().max(2048),token:Je().max(256)}),autoClipSites:oa(Je().max(255)).max(100),selection:Bb.default(()=>structuredClone(Mb))});Promise.resolve();function qo(a){const l=new URL(a);if(!["http:","https:"].includes(l.protocol)||l.username||l.password)throw new Error("Only HTTP(S) URLs without embedded credentials are supported");return l.href}function m4(a){const l=new URL(qo(a));return l.hash="",l.href}function al(a,l,u){return a==="zh"?l:u}const Hb=["Key point","Question","Insight","Definition","Action"],Lb=1e7,Ss=a=>a.reduce((l,u)=>l+u.highlights.length,0),zy=a=>a instanceof Error?a.message:String(a);function p4(a,l){const u=()=>new Error(l==="zh"?"备份格式无效,请选择 Forsion Clip 划线 JSON 备份。":"Invalid backup. Choose a Forsion Clip highlights JSON backup.");if(a.length>Lb)throw u();let s;try{s=JSON.parse(a)}catch{throw u()}if(!Array.isArray(s)&&((s==null?void 0:s.format)!=="forsion-clip-highlights"||s.version!==1))throw u();const f=Array.isArray(s)?s:s.pages;if(!Array.isArray(f)||f.length>1e3)throw u();return f.map(d=>{if(!d||typeof d.url!="string"||!Array.isArray(d.highlights)||d.highlights.length>2e3)throw u();const m=m4(d.url);for(const p of d.highlights)if(!p||typeof p.id!="string"||!p.id||typeof p.text!="string"||typeof p.html!="string"||typeof p.xpath!="string"||typeof p.createdAt!="string"||!/^#[0-9a-f]{6}$/i.test(p.color)||!Number.isInteger(p.startOffset)||p.startOffset<0||!Number.isInteger(p.endOffset)||p.endOffset<0||p.note!==void 0&&(typeof p.note!="string"||p.note.length>2e4))throw u();return{url:m,highlights:d.highlights}})}async function wy(a,l,u){const s=URL.createObjectURL(new Blob([l],{type:`${u};charset=utf-8`}));try{await chrome.downloads.download({url:s,filename:a,saveAs:!0,conflictAction:"uniquify"}),setTimeout(()=>URL.revokeObjectURL(s),6e4)}catch(f){throw URL.revokeObjectURL(s),f}}function g4(a,l){const u=[`# ${l==="zh"?"划线与批注":"Highlights and annotations"}`,""];for(const s of a){u.push(`## ${new URL(s.url).hostname}`,"",`[${l==="zh"?"原网页":"Source page"}](<${s.url.replace(/[<>]/g,encodeURIComponent)}>)`,"");for(const f of s.highlights){if(f.type==="image"&&f.imageUrl){let m;try{m=qo(f.imageUrl)}catch{}m&&u.push(`![${(f.imageAlt||f.text||"").replace(/[\[\]\r\n]/g," ")}](<${m.replace(/[<>]/g,encodeURIComponent)}>)`,"")}f.text&&u.push(...f.text.split(/\r?\n/).map(m=>`> ${m}`),""),f.note&&u.push(`**${l==="zh"?"批注":"Note"}**`,"",f.note,"");const d=fr.findIndex(m=>m.hex.toLowerCase()===f.color.toLowerCase());u.push(`${l==="zh"?"颜色":"Color"}: ${d<0?f.color:l==="zh"?fr[d].label:Hb[d]}`,"","---","")}}return u.join(`
|
|
358
|
+
`)}function v4({pageUrl:a,highlight:l,locale:u,disabled:s,update:f}){const d=(Z,Y)=>u==="zh"?Z:Y,m=k.useId(),[p,g]=k.useState(l.note||""),[S,y]=k.useState(l.color),[v,j]=k.useState(!1);k.useEffect(()=>{g(l.note||""),y(l.color)},[l.note,l.color]);const w=p!==(l.note||"")||S!==l.color,E=fr.find(Z=>Z.hex.toLowerCase()===S.toLowerCase());let T;try{l.type==="image"&&l.imageUrl&&(T=qo(l.imageUrl))}catch{}const A=new Date(l.createdAt);return o.jsxs("article",{className:"highlight",style:{borderLeftColor:/^#[0-9a-f]{6}$/i.test(S)?S:"var(--border)"},children:[l.type==="image"&&o.jsxs("p",{className:"caption",style:{marginBottom:8},children:[o.jsx(ij,{size:13,"aria-hidden":"true"})," ",l.imageAlt||d("图片批注","Image annotation")]}),T&&o.jsxs("a",{href:T,target:"_blank",rel:"noopener noreferrer",className:"caption",children:[d("打开图片","Open image")," ",o.jsx(Ro,{size:12,"aria-hidden":"true"})]}),l.text&&o.jsx("blockquote",{style:{whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:l.text}),o.jsxs("label",{className:"field",htmlFor:m,style:{margin:"10px 0"},children:[o.jsx("span",{children:d("批注","Note")}),o.jsx("textarea",{id:m,value:p,maxLength:2e4,disabled:s,placeholder:d("留下你的想法…","Add your thoughts…"),onChange:Z=>g(Z.target.value)})]}),o.jsxs("footer",{className:"actions",style:{flexWrap:"wrap"},children:[o.jsxs("select",{"aria-label":d("划线颜色","Highlight color"),value:(E==null?void 0:E.hex)||S,disabled:s,onChange:Z=>y(Z.target.value),children:[!E&&o.jsxs("option",{value:S,children:[d("原颜色","Original color")," ",S]}),fr.map((Z,Y)=>o.jsx("option",{value:Z.hex,children:u==="zh"?Z.label:Hb[Y]},Z.hex))]}),o.jsxs("button",{className:"btn",disabled:s||!w,onClick:()=>void f(a,l.id,{note:p,color:S}),children:[o.jsx(Mo,{size:14}),d("保存","Save")]}),w&&o.jsx("button",{className:"btn",disabled:s,onClick:()=>{g(l.note||""),y(l.color)},children:d("还原","Revert")}),o.jsx("span",{className:"grow"}),Number.isFinite(A.getTime())&&o.jsx("time",{className:"caption",dateTime:l.createdAt,children:A.toLocaleDateString(u==="zh"?"zh-CN":"en-GB")}),o.jsx("button",{className:"btn",disabled:s,"aria-label":d("删除这条划线","Delete this highlight"),onClick:()=>j(!0),children:o.jsx(Ul,{size:14})})]}),v&&o.jsxs("div",{className:"card",role:"alertdialog","aria-label":d("确认删除划线","Confirm highlight deletion"),style:{marginBottom:0},children:[o.jsx("p",{children:d("删除这条划线及其批注?此操作不能撤销。","Delete this highlight and its note? This cannot be undone.")}),o.jsxs("div",{className:"actions",style:{marginTop:10},children:[o.jsx("button",{className:"btn",disabled:s,onClick:()=>j(!1),children:d("保留","Keep")}),o.jsxs("button",{className:"btn",style:{color:"var(--danger)"},disabled:s,onClick:()=>void f(a,l.id,{remove:!0}).then(Z=>{Z&&j(!1)}),children:[o.jsx(Ul,{size:14}),d("确认删除","Delete highlight")]})]})]})]})}function y4({locale:a}){const l=(he,le)=>a==="zh"?he:le,[u,s]=k.useState([]),[f,d]=k.useState(""),[m,p]=k.useState(50),[g,S]=k.useState(!0),[y,v]=k.useState(!1),[j,w]=k.useState(""),[E,T]=k.useState(""),[A,Z]=k.useState(null),Y=k.useRef(null),ye=k.useRef(0),te=k.useCallback(async()=>{const he=++ye.current;S(!0);try{const le=await ve("highlights-list");if(!Array.isArray(le))throw new Error("Invalid annotation response");he===ye.current&&s(le.filter(X=>X.highlights.length).sort((X,z)=>X.url.localeCompare(z.url)))}finally{he===ye.current&&S(!1)}},[]);k.useEffect(()=>(te().catch(he=>w(zy(he))),()=>{ye.current++}),[te]);const ue=k.useMemo(()=>{const he=f.trim().toLocaleLowerCase();return u.map(le=>({...le,highlights:!he||le.url.toLocaleLowerCase().includes(he)?le.highlights:le.highlights.filter(X=>[X.text,X.note,X.imageAlt].some(z=>z==null?void 0:z.toLocaleLowerCase().includes(he)))})).filter(le=>le.highlights.length)},[u,f]),I=k.useMemo(()=>{let he=m;return ue.map(le=>{const X=le.highlights.slice(0,Math.max(0,he));return he-=X.length,{...le,highlights:X}}).filter(le=>le.highlights.length)},[ue,m]),Q=Ss(u),G=Ss(ue),ie=async(he,le)=>{v(!0),w(""),T("");try{return await he(),T(le),!0}catch(X){return w(zy(X)),!1}finally{v(!1)}},_e=(he,le,X)=>ie(async()=>{await ve("highlights-update",{url:he,id:le,...X}),s(z=>z.map(U=>U.url!==he?U:{...U,highlights:X.remove?U.highlights.filter(B=>B.id!==le):U.highlights.map(B=>B.id===le?{...B,...X}:B)}).filter(U=>U.highlights.length))},X.remove?l("划线已删除。","Highlight deleted."):l("批注已保存。","Annotation saved.")),ce=async he=>{he&&await ie(async()=>{if(he.size>Lb)throw new Error(l("备份不能超过 10 MB。","Backup must not exceed 10 MB."));Z({name:he.name,pages:p4(await he.text(),a)})},"")},Se=()=>new Date().toISOString().slice(0,10);return o.jsxs("section",{"aria-label":l("全部划线","All highlights"),children:[o.jsxs("div",{className:"section-title",children:[o.jsx(e0,{size:18,"aria-hidden":"true"}),o.jsx("h3",{children:l("全部划线","All highlights")}),o.jsx("span",{className:"caption",children:l(`${Q} 条 · ${u.length} 个网页`,`${Q} highlights · ${u.length} pages`)})]}),o.jsxs("div",{className:"actions",style:{marginBottom:15},children:[o.jsxs("button",{className:"btn",disabled:y||g,onClick:()=>void ie(te,""),children:[o.jsx(Es,{size:14}),l("刷新","Refresh")]}),o.jsxs("button",{className:"btn",disabled:y||g||!Q,onClick:()=>void ie(async()=>{const he={format:"forsion-clip-highlights",version:1,exportedAt:new Date().toISOString(),pages:u};await wy(`forsion-highlights-${Se()}.json`,JSON.stringify(he,null,2),"application/json")},l("备份下载已开始。","Backup download started.")),children:[o.jsx(Oa,{size:14}),l("JSON 全量备份","JSON backup (all)")]}),o.jsxs("button",{className:"btn",disabled:y||g||!G,onClick:()=>void ie(()=>wy(`forsion-highlights-${Se()}.md`,g4(ue,a),"text/markdown"),l("Markdown 下载已开始。","Markdown download started.")),children:[o.jsx(Oa,{size:14}),l("导出筛选结果","Export results")]}),o.jsxs("button",{className:"btn",disabled:y||g,onClick:()=>{var he;return(he=Y.current)==null?void 0:he.click()},children:[o.jsx(w0,{size:14}),l("导入备份","Import backup")]}),o.jsx("input",{ref:Y,type:"file",accept:"application/json,.json",hidden:!0,onChange:he=>{var X;const le=(X=he.target.files)==null?void 0:X[0];he.target.value="",ce(le)}})]}),j&&o.jsx("div",{className:"error",role:"alert",children:j}),E&&o.jsx("p",{className:"notice-inline",role:"status",children:E}),A&&o.jsxs("section",{className:"card","aria-label":l("导入预览","Import preview"),children:[o.jsx("h3",{children:l("导入划线备份","Import highlights backup")}),o.jsxs("p",{className:"muted",style:{marginTop:8,overflowWrap:"anywhere"},children:[A.name," · ",l(`${Ss(A.pages)} 条划线,${A.pages.length} 个网页`,`${Ss(A.pages)} highlights, ${A.pages.length} pages`)]}),o.jsx("p",{className:"caption",style:{marginTop:8},children:l("按网页与划线 ID 合并;已有记录会保留。","Merge by page and highlight ID; existing records are kept.")}),o.jsxs("div",{className:"actions",style:{marginTop:12},children:[o.jsxs("button",{className:"btn primary",disabled:y||!Ss(A.pages),onClick:()=>void ie(async()=>{try{await ve("highlights-import",{pages:A.pages}),Z(null)}finally{await te()}},l("备份已合并。","Backup merged.")),children:[o.jsx(Mo,{size:14}),l("确认导入","Import highlights")]}),o.jsxs("button",{className:"btn",disabled:y,onClick:()=>Z(null),children:[o.jsx(cr,{size:14}),l("取消","Cancel")]})]})]}),o.jsxs("label",{className:"search",style:{maxWidth:"100%"},children:[o.jsx(ih,{size:15,"aria-hidden":"true"}),o.jsx("input",{type:"search","aria-label":l("搜索网址、划线和批注","Search URLs, highlights and notes"),placeholder:l("搜索网址、文字或批注","Search URL, text or note"),value:f,onChange:he=>{d(he.target.value),p(50)}})]}),f&&o.jsx("p",{className:"caption",role:"status",children:l(`找到 ${G} 条划线`,`${G} matching highlights`)}),g&&!Q?o.jsx("div",{className:"empty",role:"status",children:l("正在读取划线…","Loading highlights…")}):G?I.map(he=>o.jsxs("section",{className:"card",children:[o.jsxs("a",{href:qo(he.url),target:"_blank",rel:"noopener noreferrer",style:{display:"flex",gap:8,alignItems:"baseline",overflowWrap:"anywhere"},children:[o.jsx("span",{style:{minWidth:0,flex:1},children:he.url}),o.jsx(Ro,{size:14,style:{flexShrink:0},"aria-hidden":"true"})]}),he.highlights.map(le=>o.jsx(v4,{pageUrl:he.url,highlight:le,locale:a,disabled:y,update:_e},le.id))]},he.url)):o.jsx("div",{className:"empty",children:f?l("没有匹配的划线。","No matching highlights."):l("还没有划线。选中网页文字或标注图片后,会在这里显示。","No highlights yet. Highlight text or annotate an image on a page to see it here.")}),G>m&&o.jsx("button",{className:"btn",onClick:()=>p(he=>he+50),children:l(`再显示 ${Math.min(50,G-m)} 条`,`Show ${Math.min(50,G-m)} more`)})]})}const Ny=[{id:"highlight",zh:"划线",en:"Highlight"},{id:"copy",zh:"复制",en:"Copy"},{id:"save",zh:"剪藏选区",en:"Clip selection"},{id:"save-all",zh:"剪藏全文",en:"Clip full page"},{id:"flomo",zh:"发送到 flomo",en:"Send to flomo"},{id:"translate",zh:"翻译",en:"Translate",feature:"translateEnabled"},{id:"explain",zh:"解释",en:"Explain",feature:"explainEnabled"},{id:"grammar",zh:"语法分析",en:"Grammar",feature:"grammarEnabled"},{id:"mnemonic",zh:"助记",en:"Mnemonic",feature:"mnemonicEnabled"},{id:"vocabulary",zh:"加入生词本",en:"Add to vocabulary"}],Cy=[{value:"zh-CN",zh:"简体中文",en:"Simplified Chinese"},{value:"zh-TW",zh:"繁体中文",en:"Traditional Chinese"},{value:"en",zh:"英语",en:"English"},{value:"ja",zh:"日语",en:"Japanese"},{value:"ko",zh:"韩语",en:"Korean"},{value:"fr",zh:"法语",en:"French"},{value:"de",zh:"德语",en:"German"},{value:"es",zh:"西班牙语",en:"Spanish"},{value:"it",zh:"意大利语",en:"Italian"},{value:"pt",zh:"葡萄牙语",en:"Portuguese"},{value:"ru",zh:"俄语",en:"Russian"},{value:"ar",zh:"阿拉伯语",en:"Arabic"}],Ey={yellow:{zh:"黄色",en:"Yellow"},red:{zh:"红色",en:"Red"},green:{zh:"绿色",en:"Green"},blue:{zh:"蓝色",en:"Blue"},purple:{zh:"紫色",en:"Purple"}},ur=a=>({...a,actions:[...a.actions],disabledSites:[...a.disabledSites],prompts:{...a.prompts}}),go=({resultX:a,resultY:l,...u})=>JSON.stringify(u);function b4({locale:a,value:l,enabled:u,providerName:s,onChange:f,onEnabledChange:d,onOpenAiSettings:m}){const p=(z,U)=>a==="zh"?z:U,[g,S]=k.useState(()=>ur(l)),[y,v]=k.useState(()=>ur(l)),[j,w]=k.useState(()=>l.disabledSites.join(`
|
|
359
|
+
`)),[E,T]=k.useState(""),[A,Z]=k.useState(""),[Y,ye]=k.useState(!1),te=k.useRef(!1),ue=go(l),I=go(g)!==go(y)||j!==y.disabledSites.join(`
|
|
360
|
+
`),Q=ue!==go(y);function G(){S(ur(l)),v(ur(l)),w(l.disabledSites.join(`
|
|
361
|
+
`)),T(""),Z("")}k.useEffect(()=>{I||G()},[ue]);function ie(z){S(U=>({...U,...z})),Z(""),T("")}async function _e(z,U){if(!te.current){te.current=!0,ye(!0),T(""),Z("");try{await z(),U()}catch(B){T(`${p("未能保存更改,请重试。","Could not save changes. Please retry.")} ${B instanceof Error?B.message:String(B)}`)}finally{te.current=!1,ye(!1)}}}function ce(){const z=[...new Set(j.split(/\r?\n/).map(ae=>ae.trim().toLowerCase().replace(/\.$/,"")).filter(Boolean))];if(z.length>200){T(p("最多可禁用 200 个站点。","You can disable up to 200 sites."));return}const U=z.find(ae=>{try{const je=new URL(`https://${ae}`);return ae.length>253||/[\s/*?#@]/.test(ae)||je.hostname!==ae||!!je.port||je.pathname!=="/"}catch{return!0}});if(U){T(p(`请输入精确域名,不含协议、路径或通配符:${U}`,`Enter an exact hostname without a protocol, path, or wildcard: ${U}`));return}const B=Bb.safeParse({...g,disabledSites:z});if(!B.success){T(p("设置格式无效,请检查语言、站点和提示词长度。","Invalid settings. Check the language, sites, and prompt lengths."));return}const se=B.data;_e(()=>f(se,y),()=>{S(ur(se)),v(ur(se)),w(z.join(`
|
|
362
|
+
`)),Z(p("选区工具栏设置已保存。","Selection toolbar settings saved."))})}function Se(z,U){const B=[...g.actions],se=B.indexOf(z),ae=se+U;se<0||ae<0||ae>=B.length||([B[se],B[ae]]=[B[ae],B[se]],ie({actions:B}))}const he=g.actions.map(z=>Ny.find(U=>U.id===z)).filter(z=>!!z),le=Ny.filter(z=>!g.actions.includes(z.id)),X=[{key:"translateEnabled",zh:"翻译",en:"Translation",descZh:"使用下方选择的翻译服务。",descEn:"Use the translation service selected below."},{key:"explainEnabled",zh:"解释",en:"Explanation",descZh:"使用当前 AI 解释所选内容。",descEn:"Explain selected content with the current AI provider."},{key:"grammarEnabled",zh:"语法分析",en:"Grammar analysis",descZh:"使用当前 AI 分析句式和语法。",descEn:"Analyze sentence structure and grammar with the current AI provider."},{key:"mnemonicEnabled",zh:"助记",en:"Mnemonics",descZh:"使用当前 AI 生成帮助记忆的线索。",descEn:"Generate memory cues with the current AI provider."}];return o.jsxs("section",{className:"selection-settings",children:[o.jsx("h1",{children:p("选区工具栏","Selection toolbar")}),o.jsx("p",{className:"muted",children:p("选择网页文字后,按自己的阅读习惯安排操作。下方更改在保存后生效。","Arrange actions for selected web text to match the way you read. Save changes below to apply them.")}),o.jsx(gt,{label:p("显示选区工具栏","Show selection toolbar"),description:p("控制网页选区工具栏的总开关,切换后立即生效。","The main switch for the page selection toolbar. Applies immediately."),control:o.jsx(Ln,{checked:u,label:p("显示选区工具栏","Show selection toolbar"),disabled:Y,onChange:z=>void _e(()=>d(z),()=>Z(p("工具栏开关已更新。","Toolbar switch updated.")))})}),!u&&o.jsx("p",{className:"caption",children:p("工具栏已关闭。仍可修改设置和恢复禁用站点。","The toolbar is off. You can still edit preferences and restore disabled sites.")}),o.jsx("h2",{children:p("工具栏与划线","Toolbar and highlighting")}),o.jsx(gt,{label:p("工具栏位置","Toolbar position"),description:g.toolbarPosition==="hidden"?p("不显示网页浮动工具栏。仍可在此修改设置和恢复禁用站点。","Hide the floating page toolbar. Preferences and site recovery remain available here."):p("选择浮动工具栏在所选文字上方或下方显示。","Show the floating toolbar above or below the selected text."),control:o.jsxs("select",{"aria-label":p("工具栏位置","Toolbar position"),value:g.toolbarPosition,disabled:Y,onChange:z=>ie({toolbarPosition:z.target.value}),children:[o.jsx("option",{value:"above",children:p("选区上方","Above selection")}),o.jsx("option",{value:"below",children:p("选区下方","Below selection")}),o.jsx("option",{value:"hidden",children:p("隐藏","Hidden")})]})}),o.jsx(gt,{label:p("记住划线颜色","Remember highlight color"),description:p("继续使用上次选择的划线颜色;关闭后使用下方默认颜色。","Reuse the last highlight color you chose. Turn off to use the default color below."),control:o.jsx(Ln,{checked:g.rememberColor,label:p("记住划线颜色","Remember highlight color"),disabled:Y,onChange:z=>ie({rememberColor:z})})}),o.jsx(gt,{label:p("默认划线颜色","Default highlight color"),description:p("首次划线或不记忆颜色时使用。","Used for the first highlight or when color memory is off."),control:o.jsxs("div",{className:"selection-color-control",children:[o.jsx("span",{className:"selection-color-preview",style:{backgroundColor:g.defaultColor},"aria-hidden":"true"}),o.jsx("select",{"aria-label":p("默认划线颜色","Default highlight color"),value:g.defaultColor,disabled:Y,onChange:z=>ie({defaultColor:z.target.value}),children:fr.map(z=>o.jsx("option",{value:z.hex,children:p(Ey[z.name].zh,Ey[z.name].en)},z.hex))})]})}),o.jsx(gt,{label:p("显示保存目标选择器","Show save destination selector"),description:p("启用至少两个保存目标时,在工具栏中选择本次剪藏的目标。","Choose the destination for each clip in the toolbar when at least two save destinations are enabled."),control:o.jsx(Ln,{checked:g.showDestinationSelector,label:p("显示保存目标选择器","Show save destination selector"),disabled:Y,onChange:z=>ie({showDestinationSelector:z})})}),o.jsx("h2",{children:p("语言与阅读","Language and reading")}),X.map(z=>o.jsx(gt,{label:p(z.zh,z.en),description:p(z.descZh,z.descEn),control:o.jsx(Ln,{checked:g[z.key],label:p(z.zh,z.en),disabled:Y,onChange:U=>ie({[z.key]:U})})},z.key)),o.jsx(gt,{label:p("翻译目标语言","Translate into"),control:o.jsxs("select",{"aria-label":p("翻译目标语言","Translate into"),value:g.targetLanguage,disabled:Y,onChange:z=>ie({targetLanguage:z.target.value}),children:[!Cy.some(z=>z.value===g.targetLanguage)&&o.jsx("option",{value:g.targetLanguage,children:g.targetLanguage}),Cy.map(z=>o.jsx("option",{value:z.value,children:p(z.zh,z.en)},z.value))]})}),o.jsx(gt,{label:p("翻译服务","Translation service"),description:p("Google 和 Bing 翻译无需配置 AI。其他阅读功能使用当前 AI。","Google and Bing translation do not require AI setup. Other reading actions use the current AI provider."),control:o.jsxs("select",{"aria-label":p("翻译服务","Translation service"),value:g.translationProvider,disabled:Y,onChange:z=>ie({translationProvider:z.target.value}),children:[o.jsx("option",{value:"google",children:"Google"}),o.jsx("option",{value:"bing",children:"Bing"}),o.jsx("option",{value:"ai",children:p("当前 AI","Current AI provider")})]})}),o.jsx(gt,{label:p("当前 AI","Current AI provider"),description:s||p("尚未选择","Not selected"),control:o.jsxs("button",{type:"button",className:"btn",disabled:Y||I,onClick:m,children:[o.jsx(Ro,{size:14}),p("配置 AI","Configure AI")]})}),o.jsx("p",{className:"caption",children:p("未配置 AI 时,划线、复制、剪藏和生词本仍可使用。","Highlighting, copying, clipping, and vocabulary remain available without AI setup.")}),o.jsx(gt,{label:p("自动加入生词本","Automatically add to vocabulary"),description:p("翻译成功后,将不超过 200 个字符的选词或短语连同释义和来源句保存到生词本。长段落不会自动加入。","After a successful translation, save selected words or phrases of up to 200 characters with their meaning and source sentence. Longer passages are not added automatically."),control:o.jsx(Ln,{checked:g.autoAddVocabulary,label:p("自动加入生词本","Automatically add to vocabulary"),disabled:Y,onChange:z=>ie({autoAddVocabulary:z})})}),o.jsx(gt,{label:p("结果面板位置","Result panel position"),description:g.resultPosition==="custom"?p("拖动结果面板来调整并保存自定义位置。","Drag the result panel to adjust and save its custom position."):p("选择翻译和 AI 结果面板的初始位置。","Choose where translation and AI results first appear."),control:o.jsxs("select",{"aria-label":p("结果面板位置","Result panel position"),disabled:Y,value:g.resultPosition,onChange:z=>ie({resultPosition:z.target.value}),children:[o.jsx("option",{value:"top_left",children:p("左上角","Top left")}),o.jsx("option",{value:"top_right",children:p("右上角","Top right")}),o.jsx("option",{value:"below_selection",children:p("选区下方","Below selection")}),o.jsx("option",{value:"custom",children:p("自定义位置","Custom position")})]})}),o.jsx("h2",{children:p("操作顺序与显示","Action order and visibility")}),o.jsx("p",{className:"muted",children:p("按上下箭头调整顺序,开关决定是否显示。关闭上方功能后,对应操作仍保留排序。","Use the arrows to change order and switches to show or hide actions. Turning a feature off above preserves its position.")}),o.jsx("ol",{className:"selection-action-list",children:[...he,...le].map(z=>{const U=g.actions.indexOf(z.id),B=U>=0,se=p(z.zh,z.en);return o.jsx("li",{children:o.jsx(gt,{label:se,description:B?z.feature&&!g[z.feature]?p("功能已关闭,开启后按此顺序显示。","Feature is off; this position is kept for when you turn it on."):p(`显示位置 ${U+1}`,`Position ${U+1}`):p("已隐藏","Hidden"),control:o.jsxs("div",{className:"actions",children:[o.jsx("button",{type:"button",className:"btn","aria-label":p(`上移${z.zh}`,`Move ${z.en.toLowerCase()} up`),title:p("上移","Move up"),disabled:Y||!B||U===0,onClick:()=>Se(z.id,-1),children:o.jsx(lh,{size:14})}),o.jsx("button",{type:"button",className:"btn","aria-label":p(`下移${z.zh}`,`Move ${z.en.toLowerCase()} down`),title:p("下移","Move down"),disabled:Y||!B||U===g.actions.length-1,onClick:()=>Se(z.id,1),children:o.jsx(ah,{size:14})}),o.jsx(Ln,{checked:B,label:p(`显示${z.zh}`,`Show ${z.en.toLowerCase()}`),disabled:Y,onChange:ae=>ie({actions:ae?[...g.actions,z.id]:g.actions.filter(je=>je!==z.id)})})]})})},z.id)})}),o.jsx(gt,{label:p("站点管理入口","Site management action"),description:p("始终保留,不能隐藏。可从工具栏禁用当前站点,并在下方恢复。","Always available and cannot be hidden. Disable the current site from the toolbar and restore it below."),control:o.jsx("span",{className:"caption",children:p("固定显示","Always shown")})}),o.jsx("h2",{children:p("禁用站点","Disabled sites")}),o.jsx("p",{className:"muted",children:p("仅匹配精确域名,每行一个。例如 example.com 不包含 news.example.com。不填写协议、路径或通配符。","Use one exact hostname per line. For example, example.com does not include news.example.com. Omit protocols, paths, and wildcards.")}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:p("不显示工具栏的站点","Sites without the toolbar")}),o.jsx("textarea",{rows:4,"aria-label":p("禁用站点列表","Disabled sites list"),value:j,spellCheck:!1,placeholder:"example.com",disabled:Y,onChange:z=>{w(z.target.value),Z(""),T("")}})]}),o.jsxs("button",{type:"button",className:"btn",disabled:Y||!j.trim(),onClick:()=>{w(""),Z("")},children:[o.jsx(cj,{size:14}),p("恢复所有站点","Restore all sites")]}),o.jsx("p",{className:"caption",children:p("从列表中移除域名并保存,即可恢复该站点;工具栏总开关关闭时也可操作。","Remove a hostname and save to restore that site. This remains available even when the main toolbar switch is off.")}),o.jsx("h2",{children:p("自定义提示词","Custom prompts")}),o.jsx("p",{className:"muted",children:p("留空使用默认提示词。可用 {text} 插入所选文字,也可直接填写自然语言指令。插件会同时提供所选文字及其上下文。","Leave empty to use the default prompt. Use {text} to insert the selection, or write a natural-language instruction. The plugin also provides the selected text and its context.")}),[{key:"explain",zh:"解释提示词",en:"Explanation prompt",placeholderZh:"用简洁的语言解释这段内容,补充理解所需的背景。",placeholderEn:"Explain the passage clearly and add any background needed to understand it."},{key:"grammar",zh:"语法分析提示词",en:"Grammar prompt",placeholderZh:"分析句子结构、重要语法点,并举一个相似例句。",placeholderEn:"Analyze the sentence structure and key grammar, then give a similar example."},{key:"mnemonic",zh:"助记提示词",en:"Mnemonic prompt",placeholderZh:"给出准确、简短且容易记忆的联想方法。",placeholderEn:"Suggest an accurate, concise, and memorable association."}].map(z=>o.jsxs("label",{className:"field",children:[o.jsx("span",{children:p(z.zh,z.en)}),o.jsx("textarea",{rows:4,maxLength:8e3,value:g.prompts[z.key],placeholder:p(z.placeholderZh,z.placeholderEn),disabled:Y,onChange:U=>ie({prompts:{...g.prompts,[z.key]:U.target.value}})}),o.jsxs("small",{children:[g.prompts[z.key].length," / 8000"]})]},z.key)),o.jsxs("div",{className:"selection-settings-footer",children:[E&&o.jsx("p",{role:"alert",className:"failed",children:E}),Q&&I&&o.jsx("p",{role:"alert",className:"muted",children:p("设置已在其他页面更新。请先重新载入当前设置,再继续修改。","Settings changed in another page. Reload the current settings before editing further.")}),A&&o.jsx("p",{role:"status",className:"muted",children:A}),o.jsxs("div",{className:"actions",children:[o.jsx("button",{type:"button",className:"btn primary",disabled:Y||!I||Q,onClick:ce,children:Y?p("正在保存…","Saving…"):p("保存更改","Save changes")}),o.jsxs("button",{type:"button",className:"btn",disabled:Y||!I&&!Q,onClick:G,children:[o.jsx(g0,{size:14}),Q?p("重新载入设置","Reload settings"):p("放弃更改","Discard changes")]}),o.jsx("span",{className:"caption",children:I?p("有未保存的更改","Unsaved changes"):p("更改已保存","Changes saved")})]})]})]})}function x4({field:a,value:l,onChange:u}){const[s,f]=k.useState(l),d=k.useRef(!1),m=k.useRef(0),p=k.useRef(0);return k.useEffect(()=>{d.current||f(l)},[l]),o.jsx("input",{type:a.secret?"password":"text",autoComplete:"off",value:s,placeholder:a.placeholder,onChange:g=>{d.current=!0,m.current++,f(g.target.value)},onBlur:async()=>{if(s===l){p.current||(d.current=!1);return}const g=m.current;p.current++;try{await u(s)!==!1&&m.current===g&&(d.current=!1)}finally{p.current--}}})}function S4({fields:a,values:l,locale:u,onChange:s}){return o.jsx(o.Fragment,{children:a.filter(f=>f.key!=="fieldMappings").map(f=>{const d=l[f.key]??f.default??"",m=al(u,f.label.zh,f.label.en),p=g=>s({...l,[f.key]:g});return o.jsxs("label",{className:"field",children:[o.jsxs("span",{children:[m,f.required?" *":""]}),f.choices?o.jsxs("select",{value:d,onChange:g=>p(g.target.value),children:[!f.choices.some(g=>g.value===d)&&o.jsx("option",{value:d,children:d||al(u,"请选择","Choose an option")}),f.choices.map(g=>o.jsx("option",{value:g.value,children:al(u,g.label.zh,g.label.en)},g.value))]}):f.commitOnBlur?o.jsx(x4,{field:f,value:d,onChange:p}):o.jsx("input",{type:f.secret?"password":"text",autoComplete:"off",value:d,placeholder:f.placeholder,onChange:g=>p(g.target.value)})]},f.key)})})}function j4(a,l,u,s){const f=k.useRef(0),d=k.useRef({setValue:a,save:l,reload:u,onError:s});return d.current={setValue:a,save:l,reload:u,onError:s},k.useCallback(async m=>{const p=++f.current,g=d.current;g.setValue(S=>({...S,...m}));try{const S=await g.save(m);return p===f.current&&g.setValue(S),!0}catch(S){if(g.onError(S),p!==f.current)return!1;try{const y=await g.reload();p===f.current&&g.setValue(y)}catch(y){g.onError(y)}return!1}},[])}const _4=["title","url","tags","createdAt","author","description","siteName","constant"],z4=["title","rich_text","url","multi_select","select","date","number","checkbox","email","phone_number"],vo=a=>new TS("configuration",{zh:`字段映射无效:${a}`,en:`Invalid property mapping: ${a}`});function Ty(a=""){if(!a.trim())return[];let l;try{l=JSON.parse(a)}catch{throw vo("JSON")}if(!Array.isArray(l)||l.length>50)throw vo("Expected up to 50 rows.");const u=new Set;return l.map(s=>{if(!s||typeof s!="object"||typeof s.property!="string"||!s.property.trim()||/[\x00-\x1f]/.test(s.property)||["__proto__","prototype","constructor"].includes(s.property.trim())||!_4.includes(s.source)||!z4.includes(s.type)||s.value!==void 0&&typeof s.value!="string")throw vo("Property, source or type.");const f=s.property.trim();if(u.has(f))throw vo("Duplicate property.");return u.add(f),{property:f,source:s.source,type:s.type,...s.value===void 0?{}:{value:s.value}}})}const w4=[["title","标题","Title"],["url","来源网址","Source URL"],["tags","标签","Tags"],["createdAt","剪藏时间","Clipped at"],["author","作者","Author"],["description","摘要","Description"],["siteName","站点","Site"],["constant","固定值","Constant value"]],N4=[["title","标题","Title"],["rich_text","文本","Text"],["url","网址","URL"],["multi_select","多选","Multiple selection"],["select","单选","Single selection"],["date","日期","Date"],["number","数字","Number"],["checkbox","复选框","Checkbox"],["email","邮箱","Email"],["phone_number","电话号码","Phone number"]];function C4({value:a,locale:l,onSave:u}){const s=(te,ue)=>al(l,te,ue),[f,d]=k.useState([]),[m,p]=k.useState(a),[g,S]=k.useState(!1),[y,v]=k.useState(!1),[j,w]=k.useState(!1),[E,T]=k.useState(""),A=()=>{try{d(Ty(a)),v(!1)}catch{d([]),v(!0)}p(a),S(!1),T("")};k.useEffect(()=>{g||A()},[a]);const Z=te=>{d(te),S(!0),T("")},Y=f.some((te,ue)=>f.some((I,Q)=>Q!==ue&&I.property.trim()===te.property.trim())),ye=g&&m!==a;return o.jsxs("section",{className:"property-mappings",children:[o.jsx("h3",{children:s("属性映射","Property mappings")}),o.jsx("p",{className:"caption",children:s("将网页字段写入目标多维表的指定列。留空时沿用自动匹配;列名和类型须与目标一致。","Map page fields to columns in the destination database. Leave empty for automatic matching; column names and types must match the destination.")}),y?o.jsx("p",{role:"alert",className:"failed",children:s("已保存的映射格式无法识别。请检查导入的配置,原始内容仍被保留。","The saved mappings are invalid. Check the imported configuration; the original value is preserved.")}):o.jsxs(o.Fragment,{children:[f.map((te,ue)=>o.jsxs("div",{className:"mapping-row",children:[o.jsxs("label",{className:"field",children:[o.jsx("span",{children:s("目标列名","Column name")}),o.jsx("input",{value:te.property,maxLength:200,onChange:I=>Z(f.map((Q,G)=>G===ue?{...Q,property:I.target.value}:Q))})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:s("字段来源","Value source")}),o.jsx("select",{value:te.source,onChange:I=>Z(f.map((Q,G)=>G===ue?{...Q,source:I.target.value}:Q)),children:w4.map(([I,Q,G])=>o.jsx("option",{value:I,children:s(Q,G)},I))})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:s("列类型","Column type")}),o.jsx("select",{value:te.type,onChange:I=>Z(f.map((Q,G)=>G===ue?{...Q,type:I.target.value}:Q)),children:N4.map(([I,Q,G])=>o.jsx("option",{value:I,children:s(Q,G)},I))})]}),o.jsx("button",{type:"button",title:s("移除映射","Remove mapping"),onClick:()=>Z(f.filter((I,Q)=>Q!==ue)),children:o.jsx(Ul,{size:14})}),te.source==="constant"&&o.jsxs("label",{className:"field mapping-value",children:[o.jsx("span",{children:s("固定值","Constant value")}),o.jsx("input",{value:te.value||"",maxLength:2e3,placeholder:te.type==="checkbox"?"true / false":te.type==="multi_select"?s("用逗号分隔多个值","Separate values with commas"):"",onChange:I=>Z(f.map((Q,G)=>G===ue?{...Q,value:I.target.value}:Q))})]})]},ue)),(Y||ye||E)&&o.jsx("p",{role:"alert",className:"failed",children:E||(ye?s("映射已被其他操作更新,请重新载入后再编辑。","Mappings changed elsewhere. Reload before editing."):s("每个目标列只能映射一次。","Each destination column can be mapped only once."))}),o.jsxs("div",{className:"actions",children:[o.jsxs("button",{type:"button",className:"btn",disabled:f.length>=50||j,onClick:()=>Z([...f,{property:"",source:"title",type:"rich_text"}]),children:[o.jsx(mi,{size:14}),s("添加映射","Add mapping")]}),g&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:"btn",disabled:j,onClick:A,children:s("重新载入","Reload")}),o.jsx("button",{type:"button",className:"btn primary",disabled:j||Y||ye||f.some(te=>!te.property.trim()),onClick:async()=>{w(!0),T("");try{await u(JSON.stringify(Ty(JSON.stringify(f.map(te=>({...te,property:te.property.trim(),value:te.source==="constant"?te.value||"":void 0})))))),S(!1)}catch(te){T(te instanceof Error?te.message:String(te))}finally{w(!1)}},children:j?s("保存中…","Saving…"):s("保存映射","Save mappings")})]})]})]})]})}function E4({value:a,locale:l,onChange:u}){const s=(f,d)=>al(l,f,d);return o.jsxs("details",{className:"queue-settings card",children:[o.jsx("summary",{children:s("并发与自动重试","Concurrency and automatic retries")}),o.jsx("p",{className:"caption",children:s("自动重试仅用于可确认未送达的暂时性错误,等待时间逐次加倍。已成功的目标不会重复保存;送达不明或已创建部分内容的任务需先检查目标。","Only transient failures confirmed not to have arrived are retried, with a doubling delay. Successful destinations are skipped. Uncertain deliveries or partially created content need a destination check first.")}),o.jsxs("div",{className:"queue-fields",children:[[["concurrency","同时剪藏网页","Concurrent pages",5],["destinationConcurrency","每页同时导出目标","Concurrent destinations per page",6],["maxRetries","自动重试次数","Automatic retries",5]].map(([f,d,m,p])=>o.jsxs("label",{className:"field",children:[o.jsx("span",{children:s(d,m)}),o.jsx("select",{value:a[f],onChange:g=>u({[f]:Number(g.target.value)}),children:Array.from({length:f==="maxRetries"?p+1:p},(g,S)=>f==="maxRetries"?S:S+1).map(g=>o.jsx("option",{value:g,children:g===0?s("关闭","Off"):g},g))})]},f)),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:s("首次重试等待","Initial retry delay")}),o.jsx("select",{value:a.retryDelayMs,onChange:f=>u({retryDelayMs:Number(f.target.value)}),children:[...new Set([1e3,2e3,5e3,1e4,3e4,6e4,a.retryDelayMs])].sort((f,d)=>f-d).map(f=>o.jsxs("option",{value:f,children:[f/1e3," ",s("秒","seconds")]},f))})]})]})]})}function T4(a){const l=a.trim().match(/^tangu:(\d{2,5}):([0-9a-f]{16,})$/i);if(!l)return null;const u=Number(l[1]);return u>0&&u<65536?{port:u,token:l[2].toLowerCase()}:null}const Ay={connected:["notice-inline","已连接","Connected"],connecting:["caption","正在连接…","Connecting…"],idle:["caption","正在连接…","Connecting…"],offline:["error","连不上 Forsion 桌面,确认它正在运行","Can't reach Forsion Desktop. Make sure it is running"],"bad-code":["error","连接码已失效,请到桌面复制新的","This connect code no longer works. Copy a new one from Desktop"],"not-paired":["caption","还没配对","Not paired yet"]};function A4({locale:a}){const l=(T,A)=>al(a,T,A),[u,s]=k.useState("idle"),[f,d]=k.useState(""),[m,p]=k.useState(!1),[g,S]=k.useState(""),[y,v]=k.useState(!1);k.useEffect(()=>{const T=async()=>{const Z=await chrome.storage.session.get(["tanguStatus","tanguEngine"]);s(String(Z.tanguStatus||"idle")),d(String(Z.tanguEngine||"")),p(!!(await chrome.storage.local.get("tanguPairing")).tanguPairing)},A=(Z,Y)=>{(Y==="session"||Y==="local")&&T()};return T(),chrome.storage.onChanged.addListener(A),()=>chrome.storage.onChanged.removeListener(A)},[]);const[j,w,E]=Ay[u]||Ay.idle;return o.jsxs(o.Fragment,{children:[o.jsx("h2",{children:l("Tangu 浏览器控制","Tangu browser control")}),o.jsx("p",{children:l("配对后,Forsion 桌面里的 Tangu 能看到你打开的标签页,并在自己的「Tangu」标签组里后台操作,不占用你正在看的页面。","Once paired, Tangu in Forsion Desktop can see your open tabs and work in its own “Tangu” tab group in the background, without taking over the page you are on.")}),o.jsx("div",{className:j,"data-testid":"tangu-status",children:u==="connected"&&f?`${l(w,E)} · ${f}`:l(w,E)}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:l("连接码","Connect code")}),o.jsx("input",{value:g,autoComplete:"off",spellCheck:!1,placeholder:"tangu:47654:…",onChange:T=>{S(T.target.value),v(!1)}})]}),y&&o.jsx("div",{className:"error",children:l("连接码格式不对,请从桌面整段复制","That doesn't look like a connect code. Copy the whole code from Desktop")}),o.jsx("p",{className:"caption",children:l("在 Forsion 桌面打开「设置 › 浏览器」复制连接码,只需要粘贴一次。","Copy the connect code from Settings › Browser in Forsion Desktop. You only need to do this once.")}),o.jsxs("div",{className:"actions",children:[o.jsx("button",{className:"btn primary",disabled:!g.trim(),onClick:()=>{const T=T4(g);v(!T),T&&(chrome.storage.local.set({tanguPairing:T}),S(""))},children:l("配对","Pair")}),m&&o.jsx("button",{className:"btn",onClick:()=>void chrome.storage.local.remove("tanguPairing"),children:l("取消配对","Unpair")})]})]})}const Od=[["save","保存全文","Save article"],["panel","打开侧栏","Open side panel"],["ai","AI 阅读","AI reading"],["vocab","生词卡","Vocabulary cards"],["toggle","切换划词菜单","Toggle selection menu"],["region","选择区域","Select region"],["highlights","保存本页划线","Save page highlights"],["hide","在此网站隐藏","Hide on this site"]];function O4({value:a,locale:l,onChange:u}){const s=(T,A)=>al(l,T,A),[f,d]=k.useState(a.disabledSites.join(`
|
|
363
|
+
`)),[m,p]=k.useState(!1),[g,S]=k.useState(!1),[y,v]=k.useState(""),j=a.actions||Od.map(T=>T[0]),w=async T=>{S(!0),v("");try{await u({actions:T})}catch(A){v(String(A))}finally{S(!1)}},E=(T,A)=>{const Z=[...j];[Z[T],Z[T+A]]=[Z[T+A],Z[T]],w(Z)};return k.useEffect(()=>{m||d(a.disabledSites.join(`
|
|
364
|
+
`))},[a.disabledSites,m]),o.jsxs("section",{className:"floating-settings",children:[o.jsx("h2",{children:s("网页悬浮入口","Floating page launcher")}),o.jsx(gt,{label:s("显示悬浮入口","Show floating launcher"),description:s("从网页边缘打开剪藏、区域选择和划线入口。","Open clipping, region selection and highlights from the edge of a page."),control:o.jsx(Ln,{label:s("显示悬浮入口","Show floating launcher"),checked:a.enabled,onChange:()=>void u({enabled:!a.enabled}).catch(T=>v(String(T)))})}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:s("停靠位置","Dock position")}),o.jsxs("select",{value:a.side,onChange:T=>void u({side:T.target.value}).catch(A=>v(String(A))),children:[o.jsx("option",{value:"left",children:s("左侧","Left")}),o.jsx("option",{value:"right",children:s("右侧","Right")})]})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:s("在这些站点隐藏(每行一个域名)","Hide on these sites (one hostname per line)")}),o.jsx("textarea",{value:f,placeholder:"example.com",onChange:T=>{d(T.target.value),p(!0),v("")}})]}),o.jsx("p",{className:"caption",children:s("移除域名并保存,可恢复该站点的悬浮入口。","Remove a hostname and save to restore the launcher on that site.")}),o.jsx("h3",{children:s("菜单动作","Menu actions")}),o.jsx("ol",{className:"selection-action-list",children:[...j.map(T=>Od.find(A=>A[0]===T)),...Od.filter(T=>!j.includes(T[0]))].map(([T,A,Z])=>{const Y=j.indexOf(T),ye=Y>=0;return o.jsx("li",{children:o.jsx(gt,{label:s(A,Z),description:ye?s(`显示位置 ${Y+1}`,`Position ${Y+1}`):s("已隐藏","Hidden"),control:o.jsxs("div",{className:"actions",children:[o.jsx("button",{className:"btn","aria-label":s(`上移${A}`,`Move ${Z.toLowerCase()} up`),disabled:g||Y<=0,onClick:()=>E(Y,-1),children:o.jsx(lh,{size:14})}),o.jsx("button",{className:"btn","aria-label":s(`下移${A}`,`Move ${Z.toLowerCase()} down`),disabled:g||!ye||Y===j.length-1,onClick:()=>E(Y,1),children:o.jsx(ah,{size:14})}),o.jsx(Ln,{label:s(`显示${A}`,`Show ${Z.toLowerCase()}`),checked:ye,disabled:g,onChange:te=>void w(te?[...j,T]:j.filter(ue=>ue!==T))})]})})},T)})}),y&&o.jsx("p",{role:"alert",className:"failed",children:y}),o.jsx("button",{type:"button",className:"btn",disabled:!m,onClick:async()=>{try{await u({disabledSites:f.split(`
|
|
365
|
+
`).map(T=>T.trim()).filter(Boolean)}),p(!1)}catch(T){v(T instanceof Error?T.message:String(T))}},children:s("保存隐藏站点","Save hidden sites")})]})}const k4={text:["文本","Text"],select:["选项","Select"],multiselect:["多选","Multi-select"],datetime:["日期时间","Date and time"],date:["日期","Date"],number:["数字","Number"],checkbox:["复选框","Checkbox"]},D4=(a,l)=>{if(a&&typeof a=="object"&&"localized"in a)return a.localized[l];const u=a instanceof Error?a.message:String(a),s=u.split(" / ");return s.length===2?s[l==="zh"?0:1]:u};function M4({value:a,locale:l,onSave:u}){const s=(A,Z)=>l==="zh"?A:Z,[f,d]=k.useState(a),[m,p]=k.useState(a),[g,S]=k.useState(!1),[y,v]=k.useState(!1),[j,w]=k.useState("");k.useEffect(()=>{g||(d(a),p(a))},[a,g]);const E=(A,Z)=>{S(!0),d(Y=>({...Y,fields:Y.fields.map(ye=>ye.key===A?{...ye,...Z}:ye)}))},T=async()=>{w(""),v(!0);try{const A=Db(f);await u(A,m),S(!1)}catch(A){w(D4(A,l))}finally{v(!1)}};return o.jsxs("section",{className:"frontmatter-settings",children:[o.jsx("h2",{children:s("文档属性","Document properties")}),o.jsx("p",{children:s("设置后续剪藏的字段名称、类型和日期格式。已有草稿保留剪藏时的字段。","Choose field names, types and date formatting for future captures. Existing drafts retain their captured fields.")}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:s("日期格式","Date format")}),o.jsx("input",{"aria-label":s("日期格式","Date format"),value:f.dateFormat,maxLength:120,disabled:y,onChange:A=>{S(!0),d({...f,dateFormat:A.target.value})}}),o.jsx("small",{children:"YYYY-MM-DD HH:mm:ss · YYYY/MM/DD · MMM D, YYYY"})]}),o.jsx("div",{className:"fm-fields",children:f.fields.map(A=>o.jsxs("fieldset",{className:"fm-field",disabled:y,children:[o.jsx("legend",{children:A.key}),o.jsxs("div",{className:"fm-field-row",children:[o.jsx(Ln,{label:s("启用字段","Enable field")+" "+A.key,checked:A.enabled,onChange:()=>E(A.key,{enabled:!A.enabled})}),o.jsx("input",{"aria-label":s("字段名称","Field name")+" "+A.key,value:A.name,maxLength:80,onChange:Z=>E(A.key,{name:Z.target.value})}),o.jsx("select",{"aria-label":s("字段类型","Field type")+" "+A.key,value:A.type,disabled:A.isBuiltin,onChange:Z=>E(A.key,{type:Z.target.value}),children:Sh.map(Z=>o.jsx("option",{value:Z,children:k4[Z][l==="zh"?0:1]},Z))})]}),o.jsxs("div",{className:"fm-field-row",children:[o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:A.visibleInSidepanel!==!1,onChange:Z=>E(A.key,{visibleInSidepanel:Z.target.checked})}),s("显示在剪藏属性中","Show in clip properties")]}),!A.isBuiltin&&o.jsx("button",{className:"btn subtle",onClick:()=>{S(!0),d({...f,fields:f.fields.filter(Z=>Z.key!==A.key)})},children:s("移除字段","Remove field")})]})]},A.key))}),j&&o.jsx("p",{className:"error",role:"alert",children:j}),o.jsxs("div",{className:"button-row",children:[o.jsx("button",{className:"btn",disabled:y||f.fields.length>=64,onClick:()=>{let A=1;for(;f.fields.some(Z=>Z.key===`custom${A}`||Z.name===`Custom ${A}`);)A++;S(!0),d({...f,fields:[...f.fields,{key:`custom${A}`,name:`Custom ${A}`,type:"text",enabled:!0,visibleInSidepanel:!0,isBuiltin:!1}]})},children:s("添加字段","Add field")}),o.jsx("button",{className:"btn primary",disabled:!g||y,onClick:()=>void T(),children:y?s("正在保存…","Saving…"):s("保存文档属性","Save document properties")}),g&&o.jsx("button",{className:"btn subtle",disabled:y,onClick:()=>{d(a),p(a),S(!1),w("")},children:s("放弃修改","Discard changes")})]})]})}function R4({clip:a,locale:l,onChange:u}){const s=a.frontMatterFields||nl,f=(m,p)=>l==="zh"?m:p,d=s.filter(m=>m.enabled&&m.visibleInSidepanel!==!1&&!["title","tags"].includes(m.key));return o.jsx(o.Fragment,{children:d.map(m=>{const p=a.frontMatter[m.name],g=S=>u({...a.frontMatter,[m.name]:S});return o.jsxs("label",{className:"field",children:[o.jsx("span",{children:m.name}),m.type==="checkbox"?o.jsx("input",{type:"checkbox","aria-label":m.name,checked:p===!0,onChange:S=>g(S.target.checked)}):o.jsx("input",{"aria-label":m.name,type:m.type==="number"?"number":"text",step:m.type==="number"?"any":void 0,value:Array.isArray(p)?p.join(", "):String(p??""),onChange:S=>g(m.type==="number"?S.target.value===""?"":Number(S.target.value):m.type==="multiselect"?S.target.value.split(/[,,]/).map(y=>y.trim()).filter(Boolean):S.target.value)}),m.type==="multiselect"&&o.jsx("small",{children:f("用逗号分隔多个值","Separate values with commas")})]},m.key)})})}function U4({markdown:a,value:l,locale:u,onChange:s}){const f=(y,v)=>al(u,y,v),d=k.useRef(null),[m,p]=k.useState([]);k.useEffect(()=>{var y;p(Array.from(((y=d.current)==null?void 0:y.querySelectorAll("h1,h2,h3,h4,h5,h6"))||[]).map(v=>({text:v.textContent||"",level:Number(v.tagName.slice(1))})))},[a]);const g=l.fontFamily==="serif"?'Georgia, "Times New Roman"':l.fontFamily==="mono"?"Menlo, Consolas":"Arial, Helvetica",S=l.chineseFont==="serif"?'"Songti SC", "Noto Serif CJK SC", serif':'"PingFang SC", "Microsoft YaHei", sans-serif';return o.jsxs(o.Fragment,{children:[o.jsxs("details",{className:"reading-tools",children:[o.jsx("summary",{children:f("阅读样式与提纲","Reading style and outline")}),o.jsxs("div",{className:"reading-fields",children:[o.jsxs("label",{className:"field",children:[o.jsx("span",{children:f("西文字体","Latin font")}),o.jsxs("select",{value:l.fontFamily,onChange:y=>s({fontFamily:y.target.value}),children:[o.jsx("option",{value:"system",children:f("无衬线","Sans serif")}),o.jsx("option",{value:"serif",children:f("衬线","Serif")}),o.jsx("option",{value:"mono",children:f("等宽","Monospace")})]})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:f("中文字体","Chinese font")}),o.jsxs("select",{value:l.chineseFont,onChange:y=>s({chineseFont:y.target.value}),children:[o.jsx("option",{value:"system",children:f("黑体","Sans serif")}),o.jsx("option",{value:"serif",children:f("宋体","Serif")})]})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:f("正文字号","Text size")}),o.jsx("select",{value:l.fontSize,onChange:y=>s({fontSize:Number(y.target.value)}),children:[...new Set([12,14,16,18,20,24,28,32,l.fontSize])].sort((y,v)=>y-v).map(y=>o.jsxs("option",{value:y,children:[y," px"]},y))})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:f("阅读宽度","Reading width")}),o.jsx("select",{value:l.width,onChange:y=>s({width:Number(y.target.value)}),children:[...new Set([480,600,760,900,1100,l.width])].sort((y,v)=>y-v).map(y=>o.jsxs("option",{value:y,children:[y," px"]},y))})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:f("行距","Line height")}),o.jsx("select",{value:l.lineHeight,onChange:y=>s({lineHeight:Number(y.target.value)}),children:[...new Set([1.4,1.6,1.75,2,2.25,l.lineHeight])].sort((y,v)=>y-v).map(y=>o.jsx("option",{value:y,children:y},y))})]})]}),o.jsx("nav",{className:"reading-outline","aria-label":f("文章提纲","Article outline"),children:m.length?m.map((y,v)=>o.jsx("button",{type:"button",style:{paddingInlineStart:8+Math.min(y.level-1,3)*12},onClick:()=>{var j,w;return(w=(j=d.current)==null?void 0:j.querySelectorAll("h1,h2,h3,h4,h5,h6")[v])==null?void 0:w.scrollIntoView({behavior:matchMedia("(prefers-reduced-motion: reduce)").matches?"instant":"smooth",block:"start"})},children:y.text},v)):o.jsx("p",{className:"caption",children:f("正文没有标题。可在 AI 阅读中生成提纲。","This article has no headings. You can generate an outline in AI reading.")})})]}),o.jsx("div",{ref:d,className:"markdown clip-preview reading-preview",style:{fontFamily:`${g}, ${S}`,fontSize:l.fontSize,lineHeight:l.lineHeight,maxWidth:l.width},dangerouslySetInnerHTML:{__html:Md(a)}})]})}function Z4({value:a,locale:l,onSave:u}){const s=(I,Q)=>l==="zh"?I:Q,[f,d]=k.useState(null),[m,p]=k.useState(""),[g,S]=k.useState(!1),[y,v]=k.useState(""),[j,w]=k.useState(""),E=k.useRef(!1),T=k.useRef(a);T.current=a;const A=JSON.stringify(a),Z=!!f&&m!==A,Y=k.useMemo(()=>bh(a,l),[a,l]),ye=k.useRef(null);k.useEffect(()=>{var I;f&&((I=ye.current)==null||I.focus())},[f==null?void 0:f.id]);async function te(I,Q=!1){if(!E.current&&!(Q&&m!==JSON.stringify(T.current))){E.current=!0,S(!0),v(""),w("");try{await u(I,Q?JSON.parse(m):T.current),Q&&d(null),w(s("阅读预设已保存。","Reading presets saved."))}catch(G){v(G instanceof Error?G.message:String(G))}finally{E.current=!1,S(!1)}}}function ue(I){p(A),d({...I}),v(""),w("")}return o.jsxs("section",{className:"reader-preset-settings","aria-label":s("阅读预设","Reading presets"),children:[o.jsxs("div",{className:"page-heading",children:[o.jsxs("div",{children:[o.jsx("h2",{children:s("阅读预设","Reading presets")}),o.jsx("p",{className:"caption",children:s("把常用问题保存为快捷操作。仅在点击预设时发送文章和指令。","Save frequent questions as quick actions. The article and instruction are sent only when you click a preset.")})]}),o.jsxs("button",{type:"button",className:"btn",disabled:g||!!f||Y.length>=100,onClick:()=>ue({id:`custom-${crypto.randomUUID()}`,name:"",prompt:"",enabled:!0,order:Y.length}),children:[o.jsx(mi,{size:14}),s("添加预设","Add preset")]})]}),y&&o.jsx("p",{role:"alert",className:"failed",children:y}),j&&o.jsx("p",{role:"status",className:"caption",children:j}),f&&o.jsxs("form",{className:"reader-preset-editor",onSubmit:I=>{I.preventDefault(),!(!f.name.trim()||!f.prompt.trim()||Z)&&te(by(T.current,f),!0)},children:[o.jsxs("label",{className:"field",children:[o.jsx("span",{children:s("名称","Name")}),o.jsx("input",{ref:ye,"aria-label":s("预设名称","Preset name"),value:f.name,maxLength:100,disabled:g,onChange:I=>d({...f,name:I.target.value})})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:s("阅读指令","Reading instruction")}),o.jsx("textarea",{"aria-label":s("阅读指令","Reading instruction"),value:f.prompt,maxLength:12e3,rows:6,disabled:g,onChange:I=>d({...f,prompt:I.target.value})})]}),Z&&o.jsx("p",{role:"alert",className:"failed",children:s("预设已在其他窗口修改。草稿保留,请取消后重新打开条目再保存。","Presets changed in another window. Your draft is preserved; cancel and reopen the entry before saving.")}),o.jsxs("div",{className:"actions",children:[o.jsx("button",{type:"submit",className:"btn primary",disabled:g||Z||!f.name.trim()||!f.prompt.trim(),children:s("保存预设","Save preset")}),o.jsx("button",{type:"button",className:"btn",disabled:g,onClick:()=>d(null),children:s("取消","Cancel")})]})]}),o.jsx("div",{className:"reader-preset-list",children:Y.map((I,Q)=>o.jsxs("div",{className:"reader-preset-row",children:[o.jsxs("label",{className:"reader-preset-name",children:[o.jsx("input",{type:"checkbox","aria-label":s(`启用 ${I.name}`,`Enable ${I.name}`),checked:I.enabled,disabled:g||!!f,onChange:G=>void te(by(T.current,{...I,enabled:G.target.checked}))}),o.jsx("span",{children:I.name})]}),o.jsxs("div",{className:"actions",children:[o.jsx("button",{type:"button",className:"icon-btn",disabled:g||!!f||Q===0,"aria-label":s(`上移 ${I.name}`,`Move ${I.name} up`),onClick:()=>void te(xy(T.current,l,I.id,-1)),children:o.jsx(lh,{size:14})}),o.jsx("button",{type:"button",className:"icon-btn",disabled:g||!!f||Q===Y.length-1,"aria-label":s(`下移 ${I.name}`,`Move ${I.name} down`),onClick:()=>void te(xy(T.current,l,I.id,1)),children:o.jsx(ah,{size:14})}),o.jsx("button",{type:"button",className:"icon-btn",disabled:g||!!f,"aria-label":s(`编辑 ${I.name}`,`Edit ${I.name}`),onClick:()=>ue(I),children:o.jsx(d0,{size:14})}),I.isBuiltin?o.jsx("button",{type:"button",className:"icon-btn",disabled:g||!!f||!I.isModified,"aria-label":s(`恢复 ${I.name} 默认值`,`Restore ${I.name} default`),onClick:()=>void te(T.current.filter(G=>G.id!==I.id)),children:o.jsx(g0,{size:14})}):o.jsx("button",{type:"button",className:"icon-btn",disabled:g||!!f,"aria-label":s(`移除 ${I.name}`,`Remove ${I.name}`),onClick:()=>void te(T.current.filter(G=>G.id!==I.id)),children:o.jsx(Ul,{size:14})})]})]},I.id))})]})}function yo(a){if(typeof a=="boolean"||typeof a=="number"&&Number.isFinite(a))return String(a);const l=String(a),u=/^(?:null|true|false|yes|no|on|off|y|n|~|[-+]?(?:\.(?:inf|nan)|(?:\d[\d_]*(?:\.\d*)?|\.\d+)(?:e[-+]?\d+)?|0[xob][a-f0-9_]+))$/i.test(l)||/^\d{4}-\d{1,2}-\d{1,2}(?:$|[Tt\s])/.test(l);return!l||u||/^[\s]|[\s]$|[:#\-?{}\[\],&*!|<>'"%@`]|[\x00-\x1f\x7f\u0085\u2028\u2029]/.test(l)?JSON.stringify(l).replace(/[\u0085\u2028\u2029]/g,s=>`\\u${s.charCodeAt(0).toString(16).padStart(4,"0")}`):l}function $4(a){const l=[];for(const[u,s]of Object.entries(a))if(!(s==null||s===""||Array.isArray(s)&&s.length===0))if(Array.isArray(s)){l.push(`${yo(u)}:`);for(const f of s)l.push(` - ${yo(f)}`)}else l.push(`${yo(u)}: ${yo(s)}`);return l.length?`---
|
|
366
|
+
${l.join(`
|
|
367
|
+
`)}
|
|
368
|
+
---
|
|
369
|
+
|
|
370
|
+
`:""}function B4(a,l="zh"){const u=a.filter(s=>s.type==="image"?!!s.imageUrl:!!s.text).map(s=>{var m;const f=l==="zh"?Dj(s.color):{red:"Question",green:"Insight",blue:"Definition",purple:"Action"}[["#FBE3E3","#E1F3E5","#DFEBFB","#EFE4FA"].includes(s.color.toUpperCase())?{"#FBE3E3":"red","#E1F3E5":"green","#DFEBFB":"blue","#EFE4FA":"purple"}[s.color.toUpperCase()]:""];if(s.type==="image"&&s.imageUrl&&/^https?:\/\//i.test(s.imageUrl))return`> ![${(s.imageAlt||s.text||"").replace(/[\[\]\n]/g," ")}](<${s.imageUrl.replace(/[<>\s]/g,encodeURIComponent)}>)${s.note?`
|
|
371
|
+
> `+s.note.replace(/\n/g," "):""}`;let d="> "+(f?`**[${f}]** `:"")+s.text.replace(/\s*\n\s*/g," ").trim();return(m=s.note)!=null&&m.trim()&&(d+=(l==="zh"?`
|
|
372
|
+
> — 备注:`:`
|
|
373
|
+
> — Note: `)+s.note.replace(/\s*\n\s*/g," ").trim()),d});return u.length?`
|
|
374
|
+
|
|
375
|
+
## ${l==="zh"?"划线摘录":"Highlights"}
|
|
376
|
+
|
|
377
|
+
${u.join(`
|
|
378
|
+
>
|
|
379
|
+
`)}
|
|
380
|
+
`:""}function Id(a){const l=a.includeFrontMatter&&a.frontMatter?$4(a.frontMatter):"",u=(a.includeHighlights??!0)&&a.highlights?B4(a.highlights,a.locale):"";return l+a.body+u}function H4(a,l,u,s,f=!0){const d=u?new Set(u):void 0,m=l.filter(v=>(!d||d.has(v.id))&&v.content.trim());if(!m.length)throw new Error(s==="zh"?"没有可保存的消息。":"There are no messages to save.");const p=`${a.title} — ${s==="zh"?"阅读对话":"Reading conversation"}`,g=m.map(v=>`## ${v.role==="user"?s==="zh"?"提问":"Question":s==="zh"?"回答":"Answer"}
|
|
381
|
+
|
|
382
|
+
${v.content}`).join(`
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
`),S={...a.frontMatter},y=Os(a.frontMatterFields,"title");return y&&(S[y]=p),{...a,title:p,markdown:g,frontMatter:S,highlights:[],document:Id({frontMatter:S,body:g,includeFrontMatter:f,locale:s})}}var bn=Uint8Array,Yn=Uint16Array,jh=Int32Array,_h=new bn([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),zh=new bn([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Oy=new bn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),qb=function(a,l){for(var u=new Yn(31),s=0;s<31;++s)u[s]=l+=1<<a[s-1];for(var f=new jh(u[30]),s=1;s<30;++s)for(var d=u[s];d<u[s+1];++d)f[d]=d-u[s]<<5|s;return{b:u,r:f}},Yb=qb(_h,2),L4=Yb.b,Jd=Yb.r;L4[28]=258,Jd[258]=28;var q4=qb(zh,0),ky=q4.r,Pd=new Yn(32768);for(var vt=0;vt<32768;++vt){var Ml=(vt&43690)>>1|(vt&21845)<<1;Ml=(Ml&52428)>>2|(Ml&13107)<<2,Ml=(Ml&61680)>>4|(Ml&3855)<<4,Pd[vt]=((Ml&65280)>>8|(Ml&255)<<8)>>1}var ks=(function(a,l,u){for(var s=a.length,f=0,d=new Yn(l);f<s;++f)a[f]&&++d[a[f]-1];var m=new Yn(l);for(f=1;f<l;++f)m[f]=m[f-1]+d[f-1]<<1;var p;if(u){p=new Yn(1<<l);var g=15-l;for(f=0;f<s;++f)if(a[f])for(var S=f<<4|a[f],y=l-a[f],v=m[a[f]-1]++<<y,j=v|(1<<y)-1;v<=j;++v)p[Pd[v]>>g]=S}else for(p=new Yn(s),f=0;f<s;++f)a[f]&&(p[f]=Pd[m[a[f]-1]++]>>15-a[f]);return p}),vi=new bn(288);for(var vt=0;vt<144;++vt)vi[vt]=8;for(var vt=144;vt<256;++vt)vi[vt]=9;for(var vt=256;vt<280;++vt)vi[vt]=7;for(var vt=280;vt<288;++vt)vi[vt]=8;var Do=new bn(32);for(var vt=0;vt<32;++vt)Do[vt]=5;var Y4=ks(vi,9,0),V4=ks(Do,5,0),Vb=function(a){return(a+7)/8|0},Gb=function(a,l,u){return(u==null||u>a.length)&&(u=a.length),new bn(a.subarray(l,u))},G4=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Yo=function(a,l,u){var s=new Error(l||G4[a]);if(s.code=a,Error.captureStackTrace&&Error.captureStackTrace(s,Yo),!u)throw s;return s},Wa=function(a,l,u){u<<=l&7;var s=l/8|0;a[s]|=u,a[s+1]|=u>>8},js=function(a,l,u){u<<=l&7;var s=l/8|0;a[s]|=u,a[s+1]|=u>>8,a[s+2]|=u>>16},kd=function(a,l){for(var u=[],s=0;s<a.length;++s)a[s]&&u.push({s,f:a[s]});var f=u.length,d=u.slice();if(!f)return{t:Qb,l:0};if(f==1){var m=new bn(u[0].s+1);return m[u[0].s]=1,{t:m,l:1}}u.sort(function(ue,I){return ue.f-I.f}),u.push({s:-1,f:25001});var p=u[0],g=u[1],S=0,y=1,v=2;for(u[0]={s:-1,f:p.f+g.f,l:p,r:g};y!=f-1;)p=u[u[S].f<u[v].f?S++:v++],g=u[S!=y&&u[S].f<u[v].f?S++:v++],u[y++]={s:-1,f:p.f+g.f,l:p,r:g};for(var j=d[0].s,s=1;s<f;++s)d[s].s>j&&(j=d[s].s);var w=new Yn(j+1),E=Wd(u[y-1],w,0);if(E>l){var s=0,T=0,A=E-l,Z=1<<A;for(d.sort(function(I,Q){return w[Q.s]-w[I.s]||I.f-Q.f});s<f;++s){var Y=d[s].s;if(w[Y]>l)T+=Z-(1<<E-w[Y]),w[Y]=l;else break}for(T>>=A;T>0;){var ye=d[s].s;w[ye]<l?T-=1<<l-w[ye]++-1:++s}for(;s>=0&&T;--s){var te=d[s].s;w[te]==l&&(--w[te],++T)}E=l}return{t:new bn(w),l:E}},Wd=function(a,l,u){return a.s==-1?Math.max(Wd(a.l,l,u+1),Wd(a.r,l,u+1)):l[a.s]=u},Dy=function(a){for(var l=a.length;l&&!a[--l];);for(var u=new Yn(++l),s=0,f=a[0],d=1,m=function(g){u[s++]=g},p=1;p<=l;++p)if(a[p]==f&&p!=l)++d;else{if(!f&&d>2){for(;d>138;d-=138)m(32754);d>2&&(m(d>10?d-11<<5|28690:d-3<<5|12305),d=0)}else if(d>3){for(m(f),--d;d>6;d-=6)m(8304);d>2&&(m(d-3<<5|8208),d=0)}for(;d--;)m(f);d=1,f=a[p]}return{c:u.subarray(0,s),n:l}},_s=function(a,l){for(var u=0,s=0;s<l.length;++s)u+=a[s]*l[s];return u},Xb=function(a,l,u){var s=u.length,f=Vb(l+2);a[f]=s&255,a[f+1]=s>>8,a[f+2]=a[f]^255,a[f+3]=a[f+1]^255;for(var d=0;d<s;++d)a[f+d+4]=u[d];return(f+4+s)*8},My=function(a,l,u,s,f,d,m,p,g,S,y){Wa(l,y++,u),++f[256];for(var v=kd(f,15),j=v.t,w=v.l,E=kd(d,15),T=E.t,A=E.l,Z=Dy(j),Y=Z.c,ye=Z.n,te=Dy(T),ue=te.c,I=te.n,Q=new Yn(19),G=0;G<Y.length;++G)++Q[Y[G]&31];for(var G=0;G<ue.length;++G)++Q[ue[G]&31];for(var ie=kd(Q,7),_e=ie.t,ce=ie.l,Se=19;Se>4&&!_e[Oy[Se-1]];--Se);var he=S+5<<3,le=_s(f,vi)+_s(d,Do)+m,X=_s(f,j)+_s(d,T)+m+14+3*Se+_s(Q,_e)+2*Q[16]+3*Q[17]+7*Q[18];if(g>=0&&he<=le&&he<=X)return Xb(l,y,a.subarray(g,g+S));var z,U,B,se;if(Wa(l,y,1+(X<le)),y+=2,X<le){z=ks(j,w,0),U=j,B=ks(T,A,0),se=T;var ae=ks(_e,ce,0);Wa(l,y,ye-257),Wa(l,y+5,I-1),Wa(l,y+10,Se-4),y+=14;for(var G=0;G<Se;++G)Wa(l,y+3*G,_e[Oy[G]]);y+=3*Se;for(var je=[Y,ue],Te=0;Te<2;++Te)for(var ke=je[Te],G=0;G<ke.length;++G){var C=ke[G]&31;Wa(l,y,ae[C]),y+=_e[C],C>15&&(Wa(l,y,ke[G]>>5&127),y+=ke[G]>>12)}}else z=Y4,U=vi,B=V4,se=Do;for(var G=0;G<p;++G){var V=s[G];if(V>255){var C=V>>18&31;js(l,y,z[C+257]),y+=U[C+257],C>7&&(Wa(l,y,V>>23&31),y+=_h[C]);var de=V&31;js(l,y,B[de]),y+=se[de],de>3&&(js(l,y,V>>5&8191),y+=zh[de])}else js(l,y,z[V]),y+=U[V]}return js(l,y,z[256]),y+U[256]},X4=new jh([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Qb=new bn(0),Q4=function(a,l,u,s,f,d){var m=d.z||a.length,p=new bn(s+m+5*(1+Math.ceil(m/7e3))+f),g=p.subarray(s,p.length-f),S=d.l,y=(d.r||0)&7;if(l){y&&(g[0]=d.r>>3);for(var v=X4[l-1],j=v>>13,w=v&8191,E=(1<<u)-1,T=d.p||new Yn(32768),A=d.h||new Yn(E+1),Z=Math.ceil(u/3),Y=2*Z,ye=function(xn){return(a[xn]^a[xn+1]<<Z^a[xn+2]<<Y)&E},te=new jh(25e3),ue=new Yn(288),I=new Yn(32),Q=0,G=0,ie=d.i||0,_e=0,ce=d.w||0,Se=0;ie+2<m;++ie){var he=ye(ie),le=ie&32767,X=A[he];if(T[le]=X,A[he]=le,ce<=ie){var z=m-ie;if((Q>7e3||_e>24576)&&(z>423||!S)){y=My(a,g,0,te,ue,I,G,_e,Se,ie-Se,y),_e=Q=G=0,Se=ie;for(var U=0;U<286;++U)ue[U]=0;for(var U=0;U<30;++U)I[U]=0}var B=2,se=0,ae=w,je=le-X&32767;if(z>2&&he==ye(ie-je))for(var Te=Math.min(j,z)-1,ke=Math.min(32767,ie),C=Math.min(258,z);je<=ke&&--ae&&le!=X;){if(a[ie+B]==a[ie+B-je]){for(var V=0;V<C&&a[ie+V]==a[ie+V-je];++V);if(V>B){if(B=V,se=je,V>Te)break;for(var de=Math.min(je,V-2),re=0,U=0;U<de;++U){var Ne=ie-je+U&32767,ee=T[Ne],fe=Ne-ee&32767;fe>re&&(re=fe,X=Ne)}}}le=X,X=T[le],je+=le-X&32767}if(se){te[_e++]=268435456|Jd[B]<<18|ky[se];var oe=Jd[B]&31,pe=ky[se]&31;G+=_h[oe]+zh[pe],++ue[257+oe],++I[pe],ce=ie+B,++Q}else te[_e++]=a[ie],++ue[a[ie]]}}for(ie=Math.max(ie,ce);ie<m;++ie)te[_e++]=a[ie],++ue[a[ie]];y=My(a,g,S,te,ue,I,G,_e,Se,ie-Se,y),S||(d.r=y&7|g[y/8|0]<<3,y-=7,d.h=A,d.p=T,d.i=ie,d.w=ce)}else{for(var ie=d.w||0;ie<m+S;ie+=65535){var He=ie+65535;He>=m&&(g[y/8|0]=S,He=m),y=Xb(g,y+1,a.subarray(ie,He))}d.i=m}return Gb(p,0,s+Vb(y)+f)},F4=(function(){for(var a=new Int32Array(256),l=0;l<256;++l){for(var u=l,s=9;--s;)u=(u&1&&-306674912)^u>>>1;a[l]=u}return a})(),K4=function(){var a=-1;return{p:function(l){for(var u=a,s=0;s<l.length;++s)u=F4[u&255^l[s]]^u>>>8;a=u},d:function(){return~a}}},I4=function(a,l,u,s,f){if(!f&&(f={l:1},l.dictionary)){var d=l.dictionary.subarray(-32768),m=new bn(d.length+a.length);m.set(d),m.set(a,d.length),a=m,f.w=d.length}return Q4(a,l.level==null?6:l.level,l.mem==null?f.l?Math.ceil(Math.max(8,Math.min(13,Math.log(a.length)))*1.5):20:12+l.mem,u,s,f)},Fb=function(a,l){var u={};for(var s in a)u[s]=a[s];for(var s in l)u[s]=l[s];return u},Pt=function(a,l,u){for(;u;++l)a[l]=u,u>>>=8};function J4(a,l){return I4(a,l||{},0,0)}var Kb=function(a,l,u,s){for(var f in a){var d=a[f],m=l+f,p=s;Array.isArray(d)&&(p=Fb(s,d[1]),d=d[0]),ArrayBuffer.isView(d)?u[m]=[d,p]:(u[m+="/"]=[new bn(0),p],Kb(d,m,u,s))}},Ry=typeof TextEncoder<"u"&&new TextEncoder,P4=typeof TextDecoder<"u"&&new TextDecoder,W4=0;try{P4.decode(Qb,{stream:!0}),W4=1}catch{}function Uy(a,l){var u;if(Ry)return Ry.encode(a);for(var s=a.length,f=new bn(a.length+(a.length>>1)),d=0,m=function(S){f[d++]=S},u=0;u<s;++u){if(d+5>f.length){var p=new bn(d+8+(s-u<<1));p.set(f),f=p}var g=a.charCodeAt(u);g<128||l?m(g):g<2048?(m(192|g>>6),m(128|g&63)):g>55295&&g<57344?(g=65536+(g&1047552)|a.charCodeAt(++u)&1023,m(240|g>>18),m(128|g>>12&63),m(128|g>>6&63),m(128|g&63)):(m(224|g>>12),m(128|g>>6&63),m(128|g&63))}return Gb(f,0,d)}var eh=function(a){var l=0;if(a)for(var u in a){var s=a[u].length;s>65535&&Yo(9),l+=s+4}return l},Zy=function(a,l,u,s,f,d,m,p){var g=s.length,S=u.extra,y=p&&p.length,v=eh(S);Pt(a,l,m!=null?33639248:67324752),l+=4,m!=null&&(a[l++]=20,a[l++]=u.os),a[l]=20,l+=2,a[l++]=u.flag<<1|(d<0&&8),a[l++]=f&&8,a[l++]=u.compression&255,a[l++]=u.compression>>8;var j=new Date(u.mtime==null?Date.now():u.mtime),w=j.getFullYear()-1980;if((w<0||w>119)&&Yo(10),Pt(a,l,w<<25|j.getMonth()+1<<21|j.getDate()<<16|j.getHours()<<11|j.getMinutes()<<5|j.getSeconds()>>1),l+=4,d!=-1&&(Pt(a,l,u.crc),Pt(a,l+4,d<0?-d-2:d),Pt(a,l+8,u.size)),Pt(a,l+12,g),Pt(a,l+14,v),l+=16,m!=null&&(Pt(a,l,y),Pt(a,l+6,u.attrs),Pt(a,l+10,m),l+=14),a.set(s,l),l+=g,v)for(var E in S){var T=S[E],A=T.length;Pt(a,l,+E),Pt(a,l+2,A),a.set(T,l+4),l+=4+A}return y&&(a.set(p,l),l+=y),l},e3=function(a,l,u,s,f){Pt(a,l,101010256),Pt(a,l+8,u),Pt(a,l+10,u),Pt(a,l+12,s),Pt(a,l+16,f)};function t3(a,l){l||(l={});var u={},s=[];Kb(a,"",u,l);var f=0,d=0;for(var m in u){var p=u[m],g=p[0],S=p[1],y=S.level==0?0:8,v=Uy(m),j=v.length,w=S.comment,E=w&&Uy(w),T=E&&E.length,A=eh(S.extra);j>65535&&Yo(11);var Z=y?J4(g,S):g,Y=Z.length,ye=K4();ye.p(g),s.push(Fb(S,{size:g.length,crc:ye.d(),c:Z,f:v,m:E,u:j!=m.length||E&&w.length!=T,o:f,compression:y})),f+=30+j+A+Y,d+=76+2*(j+A)+(T||0)+Y}for(var te=new bn(d+22),ue=f,I=d-f,Q=0;Q<s.length;++Q){var v=s[Q];Zy(te,v.o,v,v.f,v.u,v.c.length);var G=30+v.f.length+eh(v.extra);te.set(v.c,v.o+G),Zy(te,f,v,v.f,v.u,v.c.length,v.o,v.m),f+=16+G+(v.m?v.m.length:0)}return e3(te,f,s.length,I,ue),te}const da=Object.freeze({cards:6,source:12e4,prompt:12e3,imageBytes:20*1024*1024,totalBytes:100*1024*1024,responseBytes:29*1024*1024}),n3=["1:1","2:3","3:2","16:9","9:16"];function th(a,l,u){if(!["png","jpg","webp","gif","zip"].includes(l))throw new Error("Unsupported image-card filename extension");let s=a.replace(/[\x00-\x1f\x7f<>:"/\\|?*]/g,"-").replace(/^[. ]+|[. ]+$/g,"").trim()||"Untitled";const f=u!==void 0?`${String(u).padStart(2,"0")}-`:/^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i.test(s)?"Clip-":"",d=`${l==="zip"?"-cards":""}.${l}`,m=200-Rd(f+d).length;let p="",g=0;for(const S of s){const y=Rd(S).length;if(g+y>m)break;p+=S,g+=y}return s=p.replace(/[. ]+$/g,"")||"Untitled",f+s+d}class Rs extends Error{constructor(l,u,s){super(s),this.code=l,this.zh=u,this.en=s}}const a3=()=>new Rs("plan","模型未返回完整且有效的图文卡提纲,请重新规划。","The model did not return a complete, valid card plan. Plan again."),Ds=()=>new Rs("image","生图服务未返回有效的 PNG、JPEG、WebP 或 GIF 图片。","The image service did not return a valid PNG, JPEG, WebP or GIF image.");function $y(a,l){return a instanceof Rs?l==="zh"?a.zh:a.en:a instanceof r4?l==="zh"?"请先登录 Forsion 账号。":"Sign in to Forsion first.":a instanceof DOMException&&a.name==="AbortError"?l==="zh"?"已停止;已生成的图片仍保留。":"Stopped; completed images are retained.":l==="zh"?"图文卡请求失败;已完成的图片仍保留,请检查模型与连接。":"The image-card request failed; completed images are retained. Check the model and connection."}yn({title:Je().max(500),url:Je().max(4e3),body:Je().min(1).max(da.source)}).strict();yn({title:Je().trim().min(1).max(200),cards:oa(yn({title:Je().trim().min(1).max(200),caption:Je().max(2e3),prompt:Je().trim().min(1).max(da.prompt)}).strict()).min(1).max(da.cards)}).strict();function l3(a){if(a.length<8)throw Ds();if([137,80,78,71,13,10,26,10].every((u,s)=>a[s]===u))return{mime:"image/png",extension:"png"};if(a[0]===255&&a[1]===216&&a[2]===255)return{mime:"image/jpeg",extension:"jpg"};const l=String.fromCharCode(...a.slice(0,12));if(/^GIF8[79]a/.test(l))return{mime:"image/gif",extension:"gif"};if(l.startsWith("RIFF")&&l.slice(8,12)==="WEBP")return{mime:"image/webp",extension:"webp"};throw Ds()}function i3(a){if(typeof a!="string"||!a||a.length%4!==0||a.length>Math.ceil(da.imageBytes/3)*4||!/^[A-Za-z0-9+/]*={0,2}$/.test(a))throw Ds();let l;try{l=atob(a)}catch{throw Ds()}if(!l.length||l.length>da.imageBytes)throw Ds();const u=Uint8Array.from(l,s=>s.charCodeAt(0));return{...l3(u),base64:a,bytes:u.length}}function r3(a,l,u){if(a.cards.length<1||a.cards.length>da.cards)throw a3();const s=Object.create(null);let f=0,d=0;const m=a.cards.map((p,g)=>{const S=l.find(v=>v.cardId===p.id);let y;if(S!=null&&S.image){const v=i3(S.image.base64);if(f+=v.bytes,f>da.totalBytes)throw new Rs("size","图片总量超过 100 MiB,请分别下载。","The images exceed 100 MiB in total. Download them individually.");y=th(p.title,v.extension,g+1),s[y]=[Uint8Array.from(atob(v.base64),j=>j.charCodeAt(0)),{level:0}],d++}return{...p,status:y?S!=null&&S.generatedPrompt&&S.generatedPrompt!==p.prompt?"previous-version":"generated":S!=null&&S.error?"failed":"pending",filename:y,...S!=null&&S.generatedPrompt?{generatedPrompt:S.generatedPrompt}:{},...S!=null&&S.error?{error:S.error}:{}}});if(!d)throw new Rs("empty","尚无可下载的图片。","No generated images are available to download.");return s["manifest.json"]=Rd(JSON.stringify({title:a.title,source:{title:u.title,url:u.url},cards:m},null,2)),{bytes:t3(s,{level:0}),filename:th(a.title,"zip"),count:d}}function By(a,l,u){const s=URL.createObjectURL(new Blob([a],{type:u})),f=document.createElement("a");f.href=s,f.download=l,document.body.append(f),f.click(),f.remove(),setTimeout(()=>URL.revokeObjectURL(s),3e4)}function s3({locale:a,providers:l,defaultProviderId:u,source:s,onClose:f,session:d,onSessionChange:m}){var ea,Ma,pa,Ll,tn;const p=(ne,Le)=>a==="zh"?ne:Le,g=l.filter(ne=>["forsion","openai"].includes(ne.kind)),[S,y]=k.useState((d==null?void 0:d.planner)||((ea=l.find(ne=>ne.id===u))==null?void 0:ea.id)||((Ma=l[0])==null?void 0:Ma.id)||""),[v,j]=k.useState((d==null?void 0:d.imageProvider)||((pa=g.find(ne=>ne.id===u))==null?void 0:pa.id)||((Ll=g[0])==null?void 0:Ll.id)||""),[w,E]=k.useState((d==null?void 0:d.model)||""),[T,A]=k.useState([]),[Z,Y]=k.useState(!1),[ye,te]=k.useState(""),[ue,I]=k.useState((d==null?void 0:d.count)||3),[Q,G]=k.useState((d==null?void 0:d.style)||""),[ie,_e]=k.useState((d==null?void 0:d.size)||"2:3"),[ce,Se]=k.useState((d==null?void 0:d.plan)||null),[he,le]=k.useState((d==null?void 0:d.planSource)||null),[X,z]=k.useState((d==null?void 0:d.results)||[]),[U,B]=k.useState(""),[se,ae]=k.useState(""),[je,Te]=k.useState(""),[ke,C]=k.useState(d!=null&&d.interrupted?p("上次请求因离开面板而停止;已完成图片保留。已提交给服务的请求仍可能计费。","The previous request stopped when the panel closed; completed images are retained. A request already submitted to the service may still incur a charge."):""),V=k.useRef(!1),de=k.useRef(!1),re=k.useRef(""),Ne=k.useRef(!0),ee=k.useRef({planner:S,imageProvider:v,model:w,count:ue,style:Q,size:ie,plan:ce,planSource:he,results:X}),fe=k.useRef(m),oe=k.useRef(v);fe.current=m,ee.current={planner:S,imageProvider:v,model:w,count:ue,style:Q,size:ie,plan:ce,planSource:he,results:X},k.useEffect(()=>{m==null||m(ee.current)},[S,v,w,ue,Q,ie,ce,he,X,m]),k.useEffect(()=>(Ne.current=!0,()=>{var ne;Ne.current=!1,de.current=!0,(ne=fe.current)==null||ne.call(fe,{...ee.current,interrupted:!!re.current}),re.current&&ve("image-card-cancel",{requestId:re.current}).catch(()=>{})}),[]),k.useEffect(()=>{let ne=!0;const Le=oe.current===v?ee.current.model:"";oe.current=v,A([]),E(Le),te("");const Ae=g.find(ft=>ft.id===v);if(!Ae||Ae.kind!=="forsion"){Y(!1);return}return Y(!0),ve("image-card-models",{providerId:v}).then(ft=>{ne&&(A(ft.models),E(ft.models.some(Ot=>Ot.id===Le)?Le:ft.defaultModelId||""),ft.models.length||te(p("当前 Forsion 账号没有可用生图模型。","No image models are available for this Forsion account.")))}).catch(ft=>{ne&&te(ft instanceof Error?ft.message:p("无法读取生图模型。","Could not load image models."))}).finally(()=>{ne&&Y(!1)}),()=>{ne=!1}},[v,a]);const pe=ne=>V.current?!1:(V.current=!0,de.current=!1,B(ne),Te(""),C(""),!0),He=()=>{V.current=!1,re.current="",Ne.current&&(B(""),ae(""))},xn=ne=>ne instanceof Error?ne.message:$y(ne,a);async function ma(){if(pe("plan")){re.current=crypto.randomUUID();try{const ne=await ve("image-card-plan",{requestId:re.current,providerId:S,source:s,count:ue,style:Q,locale:a});if(de.current||!Ne.current)return;Se(ne),le({...s}),z([]),C(p("提纲已完成。检查每张卡片的提示词,再开始生成图片。","The plan is ready. Review each card prompt before generating images."))}catch(ne){Ne.current&&Te(de.current?p("规划已停止,原有结果仍保留。","Planning stopped; existing results are retained."):xn(ne))}finally{He()}}}async function Gt(ne){if(!(!ce||!ne.length||!pe("generate")))try{for(const Le of ce.cards.filter(Ae=>ne.includes(Ae.id))){if(de.current||!Ne.current)break;re.current=crypto.randomUUID(),ae(Le.id);try{const Ae=await ve("image-card-generate",{requestId:re.current,providerId:v,model:w,prompt:Le.prompt,size:ie});Ne.current&&z(ft=>[...ft.filter(Ot=>Ot.cardId!==Le.id),{cardId:Le.id,image:Ae,generatedPrompt:Le.prompt}])}catch(Ae){Ne.current&&z(ft=>{const Ot=ft.find(ga=>ga.cardId===Le.id);return[...ft.filter(ga=>ga.cardId!==Le.id),{...Ot,cardId:Le.id,error:de.current?p("已停止;服务端已提交的请求可能仍会计费。","Stopped; a request already submitted to the service may still incur a charge."):xn(Ae)}]});break}}}finally{He()}}async function xt(){de.current=!0,C(p("正在停止;已完成的图片仍保留。","Stopping; completed images are retained.")),re.current&&await ve("image-card-cancel",{requestId:re.current}).catch(ne=>Te(xn(ne)))}function Pe(ne,Le){Se(Ae=>Ae&&{...Ae,cards:Ae.cards.map(ft=>ft.id===ne?{...ft,...Le}:ft)})}function sn(ne,Le){By(Uint8Array.from(atob(Le.base64),Ae=>Ae.charCodeAt(0)),th(ne.title,Le.extension),Le.mime)}function Wt(){try{const ne=r3(ce,X,he);By(ne.bytes,ne.filename,"application/zip"),C(p(`已交给浏览器下载 ${ne.count} 张图片及提纲记录。`,`${ne.count} images and the plan manifest were passed to browser downloads.`))}catch(ne){Te($y(ne,a))}}const en=X.filter(ne=>ne.image).length,Tn=(ce==null?void 0:ce.cards.filter(ne=>!X.some(Le=>Le.cardId===ne.id&&Le.image&&Le.generatedPrompt===ne.prompt)).map(ne=>ne.id))||[],Da=!!he&&(he.title!==s.title||he.url!==s.url||he.body!==s.body),$t=!U&&!!v&&!!w.trim()&&!Z;return o.jsxs("section",{className:"image-card-studio","aria-label":p("图文卡工作室","Image card studio"),children:[o.jsxs("div",{className:"ics-heading",children:[o.jsxs("div",{children:[o.jsx("h2",{children:p("图文卡","Image cards")}),o.jsx("p",{className:"caption",children:p("先审提纲,再用生图模型绘制。","Review the outline, then render with an image model.")})]}),f&&o.jsx("button",{className:"icon-btn",onClick:f,"aria-label":p("关闭图文卡","Close image cards"),children:o.jsx(cr,{size:17})})]}),o.jsxs("p",{className:"ics-source",children:[p("当前来源:","Current source: "),s.title||p("所选内容","Selected content")," · ",s.body.length.toLocaleString()," ",p("字符","characters")]}),o.jsxs("div",{className:"ics-controls",children:[o.jsxs("label",{children:[p("规划模型","Planning provider"),o.jsx("select",{value:S,disabled:!!U,onChange:ne=>y(ne.target.value),children:l.map(ne=>o.jsxs("option",{value:ne.id,children:[ne.name,ne.model?` · ${ne.model}`:""]},ne.id))})]}),o.jsxs("label",{children:[p("卡片数量","Number of cards"),o.jsx("select",{value:ue,disabled:!!U,onChange:ne=>I(Number(ne.target.value)),children:Array.from({length:da.cards},(ne,Le)=>o.jsx("option",{value:Le+1,children:Le+1},Le))})]})]}),o.jsxs("label",{className:"ics-field",children:[p("风格与重点(可选)","Style and emphasis (optional)"),o.jsx("textarea",{rows:2,maxLength:1e3,value:Q,disabled:!!U,placeholder:p("例如:简洁的科普插画,强调原文的三个结论","For example: simple educational illustrations emphasizing three conclusions"),onChange:ne=>G(ne.target.value)})]}),o.jsxs("div",{className:"ics-actions",children:[o.jsxs("button",{className:"btn primary",disabled:!!U||!S||!s.body.trim()||s.body.length>da.source,onClick:()=>void ma(),children:[o.jsx(hj,{size:15}),U==="plan"?p("正在规划…","Planning…"):ce?p("重新规划(替换结果)","Plan again (replace results)"):p("生成提纲","Plan cards")]}),U&&o.jsxs("button",{className:"btn",onClick:()=>void xt(),children:[o.jsx(fj,{size:14}),p("停止","Stop")]})]}),s.body.length>da.source&&o.jsx("p",{role:"alert",className:"ics-error",children:p("来源超过 120,000 字符,请先选取较小的片段。","The source exceeds 120,000 characters. Select a smaller passage first.")}),Da&&o.jsx("p",{className:"caption",children:p("来源已变化。下方提纲与图片仍属于之前的来源;重新规划才会替换它们。","The source changed. The outline and images below still belong to the previous source; planning again replaces them.")}),ce&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"ics-divider"}),o.jsx("h3",{children:ce.title}),o.jsxs("div",{className:"ics-controls",children:[o.jsxs("label",{children:[p("生图服务","Image provider"),o.jsx("select",{value:v,disabled:!!U,onChange:ne=>j(ne.target.value),children:g.map(ne=>o.jsx("option",{value:ne.id,children:ne.name},ne.id))})]}),o.jsxs("label",{children:[p("画面比例","Aspect ratio"),o.jsx("select",{value:ie,disabled:!!U,onChange:ne=>_e(ne.target.value),children:n3.map(ne=>o.jsx("option",{children:ne},ne))})]})]}),o.jsxs("label",{className:"ics-field",children:[p("生图模型","Image model"),((tn=g.find(ne=>ne.id===v))==null?void 0:tn.kind)==="forsion"?o.jsxs("select",{value:w,disabled:!!U||Z,onChange:ne=>E(ne.target.value),children:[o.jsx("option",{value:"",children:Z?p("读取中…","Loading…"):p("选择生图模型","Choose an image model")}),T.map(ne=>o.jsx("option",{value:ne.id,children:ne.name},ne.id))]}):o.jsx("input",{value:w,maxLength:300,disabled:!!U,placeholder:p("输入该服务提供的生图模型 ID","Enter an image model ID supplied by this provider"),onChange:ne=>E(ne.target.value)})]}),ye&&o.jsx("p",{role:"alert",className:"ics-error",children:ye}),o.jsx("p",{className:"caption",children:p("生图使用所选服务的账号额度。停止不会撤回已提交的请求;失败后不会自动重试。兼容服务的竖图/横图尺寸由模型支持范围决定。","Generation uses the selected service’s quota. Stop does not retract submitted requests; failures are never retried automatically. Compatible services render portrait/landscape sizes supported by their models.")}),o.jsxs("div",{className:"ics-actions",children:[o.jsxs("button",{className:"btn primary",disabled:!$t||!Tn.length||ce.cards.some(ne=>!ne.prompt.trim()),onClick:()=>void Gt(Tn),children:[o.jsx(lj,{size:15}),U==="generate"?p("正在生成…","Generating…"):p(`生成已审核的 ${Tn.length} 张图`,`Generate ${Tn.length} reviewed cards`)]}),o.jsxs("button",{className:"btn",disabled:!!U||!en,onClick:Wt,children:[o.jsx(Oa,{size:15}),p(`下载 ZIP(${en} 张)`,`Download ZIP (${en})`)]})]}),o.jsx("p",{className:"caption",children:p("结果保存在当前扩展页面会话中;关闭或重载页面前请下载。","Results stay in this extension page’s session. Download them before closing or reloading the page.")}),o.jsx("div",{className:"ics-deck",children:ce.cards.map((ne,Le)=>{const Ae=X.find(Ot=>Ot.cardId===ne.id),ft=!!(Ae!=null&&Ae.image)&&Ae.generatedPrompt!==ne.prompt;return o.jsxs("article",{className:"ics-card",children:[o.jsxs("div",{className:"ics-card-label",children:[o.jsx("strong",{children:String(Le+1).padStart(2,"0")}),o.jsx("span",{children:se===ne.id?p("生成中…","Generating…"):Ae!=null&&Ae.image?ft?p("保留上一版图片","Previous image retained"):p("已生成","Generated"):p("待生成","Ready to generate")})]}),o.jsxs("label",{children:[p("标题","Title"),o.jsx("input",{maxLength:200,value:ne.title,disabled:!!U,onChange:Ot=>Pe(ne.id,{title:Ot.target.value})})]}),o.jsxs("label",{children:[p("配文","Caption"),o.jsx("textarea",{rows:2,maxLength:2e3,value:ne.caption,disabled:!!U,onChange:Ot=>Pe(ne.id,{caption:Ot.target.value})})]}),o.jsxs("label",{children:[p("生图提示词(确认后发送)","Image prompt (sent after your review)"),o.jsx("textarea",{rows:6,maxLength:da.prompt,value:ne.prompt,disabled:!!U,onChange:Ot=>Pe(ne.id,{prompt:Ot.target.value})})]}),(Ae==null?void 0:Ae.image)&&o.jsx("img",{className:"ics-image",src:`data:${Ae.image.mime};base64,${Ae.image.base64}`,alt:ne.title}),(Ae==null?void 0:Ae.error)&&o.jsx("p",{role:"alert",className:"ics-error",children:Ae.error}),o.jsxs("div",{className:"ics-actions",children:[o.jsxs("button",{className:"btn",disabled:!$t||!ne.prompt.trim(),onClick:()=>void Gt([ne.id]),children:[o.jsx(Es,{size:14}),Ae!=null&&Ae.image?p("重新生成此图","Regenerate this card"):Ae!=null&&Ae.error?p("重试此图","Retry this card"):p("生成此图","Generate this card")]}),(Ae==null?void 0:Ae.image)&&o.jsxs("button",{className:"btn",onClick:()=>sn(ne,Ae.image),children:[o.jsx(Oa,{size:14}),p("下载图片","Download image")]})]})]},ne.id)})})]}),je&&o.jsx("p",{role:"alert",className:"ics-error",children:je}),ke&&o.jsx("p",{role:"status",className:"caption",children:ke})]})}const el=location.pathname.includes("options"),bo=(a,l)=>"clip-draft-v2:"+a.split("#")[0]+":"+l,Hy={clip:ws,collection:zs,tasks:l0,vocab:Zd,settings:$d};function u3(){var Tt,xr,Sr,jr,ba,Ba,Ys,_r,zr,Vs,Fe;const[a,l]=k.useState(xs),[u,s]=k.useState(null),[f,d]=k.useState(el?"collection":"clip"),[m,p]=k.useState("account"),[g,S]=k.useState("clip"),[y,v]=k.useState(!1),[j,w]=k.useState(null),[E,T]=k.useState(""),[A,Z]=k.useState(""),[Y,ye]=k.useState(""),[te,ue]=k.useState("full"),[I,Q]=k.useState(),[G,ie]=k.useState(!1),[_e,ce]=k.useState(!1),[Se,he]=k.useState(!1),[le,X]=k.useState(!0),[z,U]=k.useState(!0),[B,se]=k.useState(!1),[ae,je]=k.useState(!1),[Te,ke]=k.useState(""),[C,V]=k.useState(null),[de,re]=k.useState(""),[Ne,ee]=k.useState([]),[fe,oe]=k.useState([]),[pe,He]=k.useState([]),[xn,ma]=k.useState(""),[Gt,xt]=k.useState(""),[Pe,sn]=k.useState(""),[Wt,en]=k.useState([]),[Tn,Da]=k.useState(""),[$t,ea]=k.useState(!1),[Ma,pa]=k.useState([]),[Ll,tn]=k.useState([]),[ne,Le]=k.useState(null),[Ae,ft]=k.useState(null),[Ot,ga]=k.useState("http://127.0.0.1:8791"),[un,yi]=k.useState(null),[ta,Ht]=k.useState(null),[ze,ot]=k.useState(null),[Ue,_t]=k.useState(null),[Vo,Us]=k.useState([]),[Ra,Zs]=k.useState(""),[va,nn]=k.useState("clips"),on=k.useRef({clip:j,title:E,body:A,tags:Y,scope:te,sourceTab:I,dirty:_e});on.current={clip:j,title:E,body:A,tags:Y,scope:te,sourceTab:I,dirty:_e};const kt=k.useRef(null),Go=k.useRef(!1),bi=k.useRef(""),_=(x,K)=>al(a.locale,x,K),Vn=x=>typeof x=="string"?x:(x==null?void 0:x[a.locale])||(x==null?void 0:x.en)||"",Me=async(x,K)=>{Zs(x),re("");try{return await K()}catch(q){return re(q instanceof Error?q.message:String(q)),null}finally{Zs("")}},Sn=async()=>{const x=await ve("state");return s(x),l(x.settings),U(x.config.frontMatter),yi(x.login),Ht(x.pair),ga(x.desktop.endpoint),sn(x.settings.daily.urls.join(`
|
|
387
|
+
`)),x},[cn,ql]=k.useState([]),[Ua,vr]=k.useState(!1),[$s,xi]=k.useState(null),[yr,Yl]=k.useState(null);async function br(x){if(j){vr(!0),re("");try{const K=H4(zt(),Wt,x,a.locale,z),q=await ve("save",{clip:K,targets:[a.defaultTarget],requestId:crypto.randomUUID()});if(V(q),!q.ok)throw new Error(Object.values(q.results).map(De=>De.error).filter(Boolean).join(`
|
|
388
|
+
`));ke(_("对话保存结果已更新","Conversation save results updated")),await jn()}catch(K){re(String(K))}finally{vr(!1)}}}const st=j4(l,x=>ve("settings",x),async()=>(await ve("state")).settings,x=>re(String(x))),jn=async()=>{const[x,K,q]=await Promise.all([ve("history"),ve("jobs"),ve("vocab")]);ee(x),oe(K),He(q)};k.useEffect(()=>{(async()=>{try{const q=await Sn();await jn(),Go.current=!0;const De=new URLSearchParams(location.search).get("page");["clip","collection","tasks","vocab","settings"].includes(De||"")&&d(De),el||(await il("full"),q.panelIntent&&q.panelIntent.nonce!==bi.current&&(bi.current=q.panelIntent.nonce,d(q.panelIntent.view==="vocab"?"vocab":"clip"),S(q.panelIntent.view==="ai"?"ai":"clip"))),q.local.forsionUser&&ve("me").then(()=>Sn()).catch(()=>{})}catch(q){re(String(q))}})();const x=q=>{var De,xe;if(!el&&q.type==="clip-panel-intent"&&q.nonce!==bi.current&&(bi.current=q.nonce,d(q.view==="vocab"?"vocab":"clip"),S(q.view==="ai"?"ai":"clip")),q.type==="active-tab-changed"){const Ge=on.current;(Ge.sourceTab!==q.tabId||q.url&&q.url!==((De=Ge.clip)==null?void 0:De.url))&&ie(!0)}q.type==="region-clip-ready"&&Hs(q.tabId),q.type==="clip-highlights-changed"&&q.url===((xe=on.current.clip)==null?void 0:xe.url)&&fn()};chrome.runtime.onMessage.addListener(x);const K=q=>{var De,xe,Ge;(q.forsion_clip_jobs_v2||q.forsion_history||q.forsion_vocab)&&jn(),(xe=(De=q.forsion_workbench_v2)==null?void 0:De.newValue)!=null&&xe.selection&&l(pt=>pt&&{...pt,selection:q.forsion_workbench_v2.newValue.selection}),(Ge=q.forsion_config)!=null&&Ge.newValue&&s(pt=>pt&&{...pt,config:q.forsion_config.newValue})};return chrome.storage.onChanged.addListener(K),()=>{var q;chrome.runtime.onMessage.removeListener(x),chrome.storage.onChanged.removeListener(K),(q=kt.current)==null||q.disconnect()}},[]),k.useEffect(()=>{const x=a.theme==="dark"||a.theme==="system"&&matchMedia("(prefers-color-scheme: dark)").matches,K=document.documentElement;K.dataset.theme="lovable",K.dataset.skin="ink",K.dataset.bg="ink",K.dataset.mode=x?"dark":"light",K.classList.toggle("dark",x),K.lang=a.locale;const q=matchMedia("(prefers-color-scheme: dark)"),De=()=>{a.theme==="system"&&(K.dataset.mode=q.matches?"dark":"light",K.classList.toggle("dark",q.matches))};return q.addEventListener("change",De),()=>q.removeEventListener("change",De)},[a.theme,a.locale]),k.useEffect(()=>{if(!j||!_e)return;const x={fields:j.frontMatter,fieldDefinitions:j.frontMatterFields,createdAt:j.createdAt,title:E,body:A,tags:Y,includeHighlights:le,frontMatter:z,updatedAt:Date.now()},K=setTimeout(()=>{chrome.storage.local.set({[bo(j.url,te)]:x}).catch(q=>re(String(q)))},180);return()=>clearTimeout(K)},[j==null?void 0:j.url,j==null?void 0:j.frontMatter,E,A,Y,le,z,te,_e]),k.useEffect(()=>{var xe;if(!ze)return;const x=document.activeElement,K=document.querySelector('[role="dialog"]'),q=()=>Array.from((K==null?void 0:K.querySelectorAll("button:not(:disabled),input:not(:disabled),select:not(:disabled),textarea:not(:disabled),a[href]"))||[]);(xe=q()[0])==null||xe.focus();const De=Ge=>{if(Ge.key==="Escape")Ge.preventDefault(),ot(null);else if(Ge.key==="Tab"){const pt=q(),dt=pt[0],Lt=pt.at(-1);Ge.shiftKey&&document.activeElement===dt?(Ge.preventDefault(),Lt==null||Lt.focus()):!Ge.shiftKey&&document.activeElement===Lt&&(Ge.preventDefault(),dt==null||dt.focus())}};return document.addEventListener("keydown",De),()=>{document.removeEventListener("keydown",De),x!=null&&x.isConnected&&x.focus()}},[ze==null?void 0:ze.type]),k.useEffect(()=>{if(!un)return;const x=setInterval(()=>void Me("",async()=>{const K=await ve("login-poll",{id:un.id});K.status!=="pending"&&(yi(null),await Sn(),K.status==="approved"?ke(_("已登录 Forsion 账号","Signed in to Forsion")):re(_("授权已结束,请重新登录","Authorization ended. Try signing in again.")))}),Math.max(2e3,un.intervalMs));return()=>clearInterval(x)},[un==null?void 0:un.id]),k.useEffect(()=>{if(!ta)return;const x=setInterval(()=>void Me("",async()=>{const K=await ve("desktop-poll",{requestId:ta.requestId});K.status!=="pending"&&(Ht(null),await Sn(),K.status==="approved"?await Vl():re(_("配对未完成","Pairing was not completed")))}),2e3);return()=>clearInterval(x)},[ta==null?void 0:ta.requestId]);async function Bs(){const x=on.current;x.clip&&x.dirty&&await chrome.storage.local.set({[bo(x.clip.url,x.scope)]:{fields:x.clip.frontMatter,fieldDefinitions:x.clip.frontMatterFields,createdAt:x.clip.createdAt,title:x.title,body:x.body,tags:x.tags,includeHighlights:le,frontMatter:z,updatedAt:Date.now()}})}async function Si(x,K,q){var dt;await Bs();const xe=(await chrome.storage.local.get(bo(x.url,K)))[bo(x.url,K)],Ge={...x,frontMatter:(xe==null?void 0:xe.fields)??x.frontMatter,frontMatterFields:xe!=null&&xe.fields?xe.fieldDefinitions:x.frontMatterFields,createdAt:xe!=null&&xe.fields?xe.createdAt:x.createdAt};w({...Ge,createdAt:u4(Ge)||void 0}),T((xe==null?void 0:xe.title)??x.title),Z((xe==null?void 0:xe.body)??x.markdown);const pt=(dt=x.frontMatter)==null?void 0:dt[Os(x.frontMatterFields,"tags")||""];ye((xe==null?void 0:xe.tags)??(Array.isArray(pt)?pt:[]).join(", ")),X((xe==null?void 0:xe.includeHighlights)??!0),(xe==null?void 0:xe.frontMatter)!==void 0&&U(xe.frontMatter),ue(K),Q(q),ce(!!xe),ie(!1),V(null),en([]),ql([])}async function il(x=te,K){var q,De,xe;se(!0),re("");try{const Ge=await ve("tabs"),pt=K??((q=Ge.find(Lt=>Lt.id===I))==null?void 0:q.id)??((De=Ge.find(Lt=>Lt.active))==null?void 0:De.id)??((xe=Ge[0])==null?void 0:xe.id);if(pt==null)throw new Error(_("打开一个网页后,再点击扩展图标。","Open a web page, then click the extension icon."));const dt=await ve("extract",{tabId:pt,scope:x});await Si(dt,x,pt)}catch(Ge){re(String(Ge))}finally{se(!1)}}async function ji(){var K;const x=await chrome.tabs.query({active:!0,currentWindow:!0});await il(te,(K=x[0])==null?void 0:K.id)}async function Hs(x){const K=x??on.current.sourceTab;try{const q=await ve("content",{tabId:K,message:{type:"get-pending-clip"}});q!=null&&q.ok&&(await Si(q,"selection",K),d("clip"))}catch(q){re(String(q))}}async function fn(){const x=on.current;if(!x.clip||!x.sourceTab)return;const K=await ve("content",{tabId:x.sourceTab,message:{type:"get-highlights"}});K!=null&&K.highlights&&w(q=>q&&{...q,highlights:K.highlights})}function zt(){if(!j)throw new Error("No clip");const x={...j.frontMatter},K=Os(j.frontMatterFields,"title"),q=Os(j.frontMatterFields,"tags");return K&&(x[K]=E),q&&(x[q]=Y.split(/[,,]/).map(De=>De.trim()).filter(Boolean)),{...j,title:E,markdown:A,frontMatter:x,document:Id({frontMatter:x,body:A,highlights:j.highlights,includeFrontMatter:z,includeHighlights:le,locale:a.locale})}}async function an(x){je(!0),re("");try{const K=await ve("save",{clip:zt(),targets:x||[a.defaultTarget,...a.targets.filter(q=>q.enabled&&q.id!==a.defaultTarget).map(q=>q.id)],requestId:crypto.randomUUID()});if(V(K),!K.ok)throw new Error(Object.values(K.results).map(q=>q.error).join(`
|
|
389
|
+
`));ke(_("保存结果已更新","Save results updated")),await jn()}catch(K){re(String(K))}finally{je(!1)}}function Za(x,K){if(!j||$t||!x.trim())return;const q={id:crypto.randomUUID(),role:"user",content:x},De={id:crypto.randomUUID(),role:"assistant",content:""},xe=[...Wt,q];en([...xe,De]),S("ai"),Da(""),ea(!0),re("");const Ge=chrome.runtime.connect({name:"reader-ai"});kt.current=Ge;let pt=!1;Ge.onMessage.addListener(dt=>{(dt.type==="text"||dt.type==="done")&&en(Lt=>Lt.map(sl=>sl.id===De.id?{...sl,content:dt.text}:sl)),(dt.type==="done"||dt.type==="error")&&(pt=!0,ea(!1),dt.type==="error"&&re(dt.error),Ge.disconnect(),kt.current=null)}),Ge.onDisconnect.addListener(()=>{pt||(ea(!1),re(_("阅读已停止。已收到的内容已保留。","Reading stopped. Received text has been preserved.")))}),Ge.postMessage({type:"read",title:E,url:j.url,body:A,messages:xe.map(({role:dt,content:Lt})=>({role:dt,content:Lt})),preset:K})}async function Vl(){const x=await ve("desktop-status");if(ft(x),x.connected&&x.paired){const K=await ve("desktop-vault");Le(K),tn(await ve("desktop-folders"))}return x}async function Ls(){ot({type:"destination"}),a.defaultTarget==="desktop"?await Me("vault",Vl):u!=null&&u.local.forsionUser&&await Me("vault",async()=>{pa(await ve("cloud-vaults")),tn(await ve("cloud-folders",{vaultId:a.cloudVault}))})}async function Xo(){await Me("chat-options",async()=>{var K;const x=await ve("desktop-chat-options");ot({type:"desktop-chat",options:x,modelId:x.defaultModelId||((K=x.models[0])==null?void 0:K.id)||"",instruction:_("请概括这篇剪藏的要点,帮助我继续阅读和讨论。","Summarize this clip and help me continue reading and discussing it.")})})}async function qs(){await Me("chat",async()=>{const x=await ve("desktop-chat",{title:E,document:zt().document,modelId:ze.modelId,instruction:ze.instruction,locale:a.locale});if(ot({...ze,result:x}),!x.ok)throw new Error(x.error);ke(_("已在桌面 Chat 发起阅读","Started reading in Desktop Chat"))})}const ya=[{id:"clip",zh:"浏览器剪藏",en:"Web clipper"},{id:"collection",zh:"收藏集",en:"Collection"},{id:"tasks",zh:"批量任务",en:"Batch tasks"},{id:"vocab",zh:"生词本",en:"Vocabulary"}],Gl=[{id:"account",zh:"Forsion 账号",en:"Forsion account"},{id:"save",zh:"保存与同步",en:"Save & sync"},{id:"ai",zh:"AI 与模型",en:"AI & models"},{id:"selection",zh:"选区工具栏",en:"Selection toolbar"},{id:"templates",zh:"站点与模板",en:"Sites & templates"},{id:"images",zh:"图片与图床",en:"Images & hosting"},{id:"desktop",zh:"桌面联动与 MCP",en:"Desktop & MCP"},{id:"general",zh:"通用设置",en:"General"}],$a=(x,K,q,De,xe,Ge)=>o.jsx(gt,{label:_(x,K),description:_(q,De),control:o.jsx(Ln,{checked:xe,label:_(x,K),onChange:()=>Ge(!xe)})}),ln=x=>{var K;return x==="cloud"?_("云端智库","Cloud vault"):x==="desktop"?_("桌面智库","Desktop vault"):Vn((K=pd.find(q=>q.id===x))==null?void 0:K.label)||x};function na(x){d(x),re(""),x!=="clip"&&jn()}const Xl=()=>chrome.tabs.create({url:chrome.runtime.getURL("options.html")});return o.jsxs("div",{className:`app-shell ${el?"workbench":"sidepanel"} ${y?"collapsed":""}`,children:[el&&o.jsxs("nav",{className:"ribbon","aria-label":_("视图切换","View switcher"),children:[o.jsx("button",{title:_("侧栏","Sidebar"),onClick:()=>v(!y),children:o.jsx(oj,{size:19})}),ya.map(x=>{const K=Hy[x.id];return o.jsx("button",{title:_(x.zh,x.en),"aria-label":_(x.zh,x.en),className:f===x.id?"active":"",onClick:()=>na(x.id),children:o.jsx(K,{size:20})},x.id)}),o.jsx("span",{className:"grow"}),o.jsx("button",{title:_("切换明暗","Toggle theme"),onClick:()=>void st({theme:document.documentElement.dataset.mode==="dark"?"light":"dark"}),children:a.theme==="dark"?o.jsx(dj,{size:19}):o.jsx(uj,{size:19})}),o.jsx("button",{title:_("设置","Settings"),onClick:()=>na("settings"),children:o.jsx($d,{size:19})})]}),el&&o.jsxs("aside",{className:"sidebar",children:[o.jsxs("div",{className:"brand",children:[o.jsx("img",{src:chrome.runtime.getURL("icon/32.png"),alt:""}),o.jsx("strong",{children:"Forsion Clip"})]}),f==="settings"?o.jsxs(o.Fragment,{children:[o.jsx("small",{children:_("设置","Settings")}),Gl.map(x=>o.jsx("button",{className:m===x.id?"active":"",onClick:()=>p(x.id),children:_(x.zh,x.en)},x.id))]}):o.jsxs(o.Fragment,{children:[ya.map(x=>{const K=Hy[x.id];return o.jsxs("button",{className:f===x.id?"active":"",onClick:()=>na(x.id),children:[o.jsx(K,{size:17}),_(x.zh,x.en)]},x.id)}),o.jsx("small",{children:_("智库","Vault")}),o.jsxs("div",{className:"sidebar-vault",children:[o.jsx(Uv,{size:17}),o.jsxs("div",{children:[ln(a.defaultTarget),o.jsx("small",{children:a.defaultTarget==="desktop"?a.desktopFolder:a.cloudFolder})]})]}),o.jsx("small",{children:_("最近剪藏","Recent clips")}),Ne.slice(0,5).map(x=>o.jsxs("button",{title:x.title,onClick:()=>ot({type:"history",item:x}),children:[o.jsx(zs,{size:15}),o.jsx("span",{className:"ellipsis",children:x.title})]},x.id))]}),o.jsx("span",{className:"grow"}),o.jsxs("button",{className:"account-link",onClick:()=>{d("settings"),p("account")},children:[o.jsx("span",{className:"avatar",children:(((Tt=u==null?void 0:u.local.forsionUser)==null?void 0:Tt.nickname)||((xr=u==null?void 0:u.local.forsionUser)==null?void 0:xr.username)||"F").slice(0,1)}),o.jsxs("span",{children:[((Sr=u==null?void 0:u.local.forsionUser)==null?void 0:Sr.nickname)||((jr=u==null?void 0:u.local.forsionUser)==null?void 0:jr.username)||_("登录 Forsion","Sign in to Forsion"),o.jsx("small",{children:_("账号与连接","Account & connections")})]})]})]}),o.jsxs("section",{className:"workspace",children:[o.jsxs("header",{className:"workspace-header",children:[o.jsxs("span",{children:[o.jsx(ws,{size:15})," ",f==="settings"?_("设置","Settings"):_(((ba=ya.find(x=>x.id===f))==null?void 0:ba.zh)||"剪藏",((Ba=ya.find(x=>x.id===f))==null?void 0:Ba.en)||"Clip")]}),o.jsx("span",{className:"grow"}),!el&&o.jsx("button",{title:_("打开收藏与设置","Open collection & settings"),onClick:Xl,children:o.jsx(_d,{size:16})}),o.jsx("button",{"aria-label":"Switch language",onClick:()=>void st({locale:a.locale==="zh"?"en":"zh"}),children:a.locale==="zh"?"EN":"中文"}),!el&&o.jsx("button",{title:_("设置","Settings"),onClick:()=>void chrome.tabs.create({url:chrome.runtime.getURL("options.html?page=settings")}),children:o.jsx($d,{size:16})})]}),o.jsxs("main",{className:f==="clip"?"clip-main":"page-main",children:[de&&o.jsxs("div",{className:"error",role:"alert",children:[de,o.jsx("button",{"aria-label":_("关闭错误","Dismiss error"),onClick:()=>re(""),children:o.jsx(cr,{size:14})})]}),f==="clip"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"panel-heading",children:[o.jsx("strong",{children:"Forsion Clip"}),o.jsx("span",{className:"grow"}),B?o.jsx("span",{className:"muted",children:_("正在提取…","Extracting…")}):o.jsx("button",{title:_("重新提取","Refresh extraction"),onClick:()=>void ji(),children:o.jsx(Es,{size:15})})]}),o.jsx("div",{className:"panel-tabs",role:"tablist",children:[["clip","剪藏","Clip",ws],["ai","AI 阅读","AI reading",vs],["highlights","划线","Highlights",e0]].map(([x,K,q,De])=>{var xe;return o.jsxs("button",{role:"tab","aria-selected":g===x,onClick:()=>S(x),className:g===x?"active":"",children:[o.jsx(De,{size:15}),_(K,q),x==="highlights"&&((xe=j==null?void 0:j.highlights)!=null&&xe.length)?" "+j.highlights.length:""]},x)})}),G&&o.jsxs("div",{className:"notice-inline",children:[_("网页已切换。当前草稿仍然保留。","The active page changed. Your draft is preserved."),o.jsx("button",{onClick:()=>void ji(),children:_("剪藏当前页","Clip current page")})]}),j?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"panel-content",role:"tabpanel",children:[g==="clip"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"seg range",children:[["full","正文","Article"],["selection","选区","Selection"],["link","链接","Link"]].map(([x,K,q])=>o.jsx("button",{className:te===x?"on":"","aria-pressed":te===x,disabled:B,onClick:()=>void il(x,I),children:_(K,q)},x))}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("标题","Title")}),o.jsx("input",{value:E,onChange:x=>{T(x.target.value),ce(!0),V(null)}})]}),o.jsxs("div",{className:"source",children:[o.jsx("span",{children:_("来源","Source")}),o.jsxs("a",{href:j.url,target:"_blank",rel:"noreferrer",children:[j.site,o.jsx(Ro,{size:11})]})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("标签","Tags")}),o.jsx("input",{placeholder:_("用逗号分隔","Separate with commas"),value:Y,onChange:x=>{ye(x.target.value),ce(!0)}})]}),o.jsxs("details",{className:"metadata-fields",children:[o.jsx("summary",{children:_("编辑网页属性","Edit page properties")}),o.jsx(R4,{clip:j,locale:a.locale,onChange:x=>{w({...j,frontMatter:x}),ce(!0),V(null)}})]}),o.jsxs("section",{className:"preview",children:[o.jsxs("header",{children:[o.jsx("strong",{children:_("内容预览","Content preview")}),o.jsx("span",{className:"grow"}),o.jsx("button",{onClick:()=>he(!Se),children:Se?_("预览","Preview"):_("编辑","Edit")}),o.jsx("button",{title:_("在网页中选择多个区域","Select multiple regions on the page"),onClick:()=>void Me("regions",()=>ve("content",{tabId:I,message:{type:"start-region-pick"}})),children:o.jsx(mi,{size:14})})]}),Se?o.jsx("textarea",{"aria-label":_("剪藏正文","Clip body"),className:"body-editor",value:A,onChange:x=>{Z(x.target.value),ce(!0),V(null)}}):o.jsx(U4,{markdown:A,value:a.preview||xs.preview,locale:a.locale,onChange:x=>void Me("preview-settings",async()=>l(await ve("settings",{preview:x})))}),o.jsxs("footer",{children:[A.length.toLocaleString()," ",_("字符","characters"),o.jsx("span",{className:"grow"}),"Markdown"]})]}),o.jsx("div",{className:"actions document-export-actions",children:[["png","导出长图","Export long image"],["print","打印 / PDF","Print / PDF"]].map(([x,K,q])=>o.jsxs("button",{className:"btn",disabled:!!Ra,onClick:()=>void Me("document-export",async()=>{await ve("document-export",{clip:zt(),markdown:Id({body:A,highlights:j.highlights,includeFrontMatter:!1,includeHighlights:le,locale:a.locale}),title:E,mode:x}),ke(_("已打开独立导出页","Opened export page"))}),children:[o.jsx(Oa,{size:14}),_(K,q)]},x))}),o.jsxs("label",{className:"check",children:[o.jsx("input",{type:"checkbox",checked:le,onChange:x=>{X(x.target.checked),ce(!0)}}),_("附带划线与批注","Include highlights & notes")," ·"," ",((Ys=j.highlights)==null?void 0:Ys.length)||0]}),o.jsxs("label",{className:"check",children:[o.jsx("input",{type:"checkbox",checked:z,onChange:x=>{U(x.target.checked),ce(!0)}}),_("保留来源与属性","Include source metadata")]}),o.jsxs("button",{className:"subtle",onClick:()=>{d("settings"),p("save")},children:[o.jsx(_d,{size:15}),_("同时导出","Additional destinations"),o.jsx("span",{className:"grow"}),a.targets.filter(x=>x.enabled).map(x=>ln(x.id)).join(", ")||_("无","None")]})]}),g==="highlights"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"section-title",children:[o.jsx("h3",{children:_("划线与批注","Highlights & notes")}),o.jsx("button",{title:_("刷新","Refresh"),onClick:()=>void Me("highlights",fn),children:o.jsx(Es,{size:14})})]}),!((_r=j.highlights)!=null&&_r.length)&&o.jsx("p",{className:"muted",children:_("在网页中选中文字,或悬停图片添加批注。","Select text on the page, or hover an image to annotate it.")}),(zr=j.highlights)==null?void 0:zr.map(x=>o.jsxs("article",{className:"highlight",style:{borderLeftColor:x.color},children:[x.type==="image"&&x.imageUrl?o.jsx("img",{src:x.imageUrl,alt:x.imageAlt||""}):o.jsx("blockquote",{children:x.text}),o.jsx("textarea",{"aria-label":_("批注","Annotation"),placeholder:_("留下你的想法…","Add your thoughts…"),defaultValue:x.note||"",onBlur:K=>void Me("note",async()=>{await ve("content",{tabId:I,message:{type:"set-highlight-note",id:x.id,note:K.target.value}}),await fn()})}),o.jsxs("footer",{children:[o.jsx("select",{"aria-label":_("划线颜色","Highlight color"),value:x.color,onChange:K=>void Me("color",async()=>{await ve("content",{tabId:I,message:{type:"set-highlight-color",id:x.id,color:K.target.value}}),await fn()}),children:[["#F8F3DE","重点","Key point"],["#FBE3E3","疑问","Question"],["#E1F3E5","想法","Insight"],["#DFEBFB","定义","Definition"],["#EFE4FA","行动","Action"]].map(([K,q,De])=>o.jsx("option",{value:K,children:_(q,De)},K))}),o.jsx("span",{className:"grow"}),o.jsx("button",{title:_("移除划线","Remove highlight"),onClick:()=>void Me("remove",async()=>{await ve("content",{tabId:I,message:{type:"remove-highlight",id:x.id}}),await fn()}),children:o.jsx(Ul,{size:14})})]})]},x.id))]}),g==="ai"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"context",children:[o.jsx(zs,{size:13}),_("当前文章已附加","Current article attached")]}),o.jsx("h3",{children:_("读懂,然后继续想。","Understand, then explore.")}),o.jsx("p",{className:"muted",children:_("围绕原文提问,也可以把新想法写回剪藏。","Ask about the source and bring new ideas back into your note.")}),o.jsxs("div",{className:"presets",children:[bh(a.readerPresets||[],a.locale).filter(x=>x.enabled).map(x=>o.jsxs("button",{disabled:$t,onClick:()=>Za(x.prompt,x.id),children:[o.jsx(vs,{size:13}),x.name]},x.id)),o.jsxs("button",{disabled:!A.trim(),onClick:()=>xi({title:E,url:(j==null?void 0:j.url)||"",body:A}),children:[o.jsx(vs,{size:13}),_("文章生成图文卡","Create illustrated cards")]}),Wt.some(x=>x.role==="assistant"&&x.content.trim())&&o.jsxs("button",{disabled:$t,onClick:()=>xi({title:E,url:(j==null?void 0:j.url)||"",body:Wt.filter(x=>x.content.trim()&&(!cn.length||cn.includes(x.id))).map(x=>`${x.role==="assistant"?_("回答","Answer"):_("问题","Question")}
|
|
390
|
+
${x.content}`).join(`
|
|
391
|
+
|
|
392
|
+
`)}),children:[o.jsx(vs,{size:13}),_(cn.length?"所选对话生成图文卡":"对话生成图文卡",cn.length?"Cards from selected messages":"Cards from conversation")]})]}),$s&&o.jsx(s3,{locale:a.locale,providers:a.providers,defaultProviderId:a.provider,source:$s,session:yr,onSessionChange:Yl,onClose:()=>xi(null)}),Wt.some(x=>x.content.trim())&&o.jsxs("div",{className:"button-row",children:[o.jsx("button",{className:"btn",disabled:$t||Ua||!Wt.some(x=>x.content.trim()&&cn.includes(x.id)),onClick:()=>void br(cn),children:_("保存已选消息","Save selected messages")}),o.jsx("button",{className:"btn",disabled:$t||Ua,onClick:()=>void br(),children:_("保存全部对话","Save conversation")})]}),o.jsx("div",{className:"messages",children:Wt.map(x=>o.jsxs("article",{className:"message "+x.role,children:[x.content&&o.jsxs("div",{className:"chat-selection-row",children:[o.jsxs("label",{children:[o.jsx("input",{type:"checkbox","aria-label":_("选择消息","Select message")+" "+(Wt.indexOf(x)+1),checked:cn.includes(x.id),onChange:K=>ql(q=>K.target.checked?[...q,x.id]:q.filter(De=>De!==x.id))}),_("选择","Select")]}),o.jsx("button",{className:"btn subtle",disabled:$t||Ua,onClick:()=>void br([x.id]),children:_("保存这条消息","Save message")})]}),x.role==="assistant"?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"markdown",dangerouslySetInnerHTML:{__html:Md(x.content)}}),x.content&&o.jsxs("div",{className:"actions",children:[o.jsxs("button",{onClick:()=>{Z(K=>K+`
|
|
393
|
+
|
|
394
|
+
`+x.content),ce(!0),ke(_("已追加到剪藏草稿","Appended to clip draft"))},children:[o.jsx(mi,{size:13}),_("写入剪藏","Append to clip")]}),o.jsx("button",{title:_("复制","Copy"),onClick:()=>void navigator.clipboard.writeText(x.content),children:o.jsx(aj,{size:13})})]})]}):x.content]},x.id))}),o.jsx(VS,{value:Tn,onValueChange:Da,onSubmit:()=>Za(Tn),submitLabel:_("发送","Send"),submitDisabled:$t||!Tn.trim(),inputProps:{placeholder:_("对这篇文章,你想了解什么?","What would you like to know?"),maxLength:12e3,"aria-label":_("提问","Ask a question")},beforeInput:o.jsxs("div",{className:"context",children:["↳ ",E]}),controls:o.jsxs(o.Fragment,{children:[o.jsx("select",{"aria-label":_("AI 服务","AI provider"),value:a.provider,disabled:$t,onChange:x=>void st({provider:x.target.value}),children:a.providers.map(x=>o.jsx("option",{value:x.id,children:x.name},x.id))}),$t&&o.jsx("button",{"aria-label":_("停止生成","Stop generating"),onClick:()=>{var x,K;(x=kt.current)==null||x.postMessage({type:"cancel"}),(K=kt.current)==null||K.disconnect(),kt.current=null,ea(!1)},children:o.jsx(nj,{size:17})})]})}),o.jsx("p",{className:"caption",children:_("发送时,文章内容与问题将交给所选 AI 服务。","When you send, the article and question go to the selected AI provider.")})]})]}),o.jsxs("footer",{className:"save-footer",children:[o.jsxs("button",{className:"destination",onClick:()=>void Ls(),children:[a.defaultTarget==="desktop"?o.jsx(sj,{size:16}):o.jsx(Uv,{size:16}),o.jsx("span",{children:ln(a.defaultTarget)}),o.jsx(Rv,{size:13}),o.jsx("span",{className:"grow"}),o.jsx("small",{children:a.defaultTarget==="desktop"?a.desktopFolder:a.defaultTarget==="cloud"?a.cloudFolder:""})]}),C&&o.jsxs("div",{className:"save-results",children:[Object.entries(C.results).map(([x,K])=>o.jsxs("div",{className:K.status==="failed"?"failed":"",children:[K.status==="failed"?o.jsx(cr,{size:13}):o.jsx(Mo,{size:13}),o.jsxs("span",{children:[ln(x)," ·"," ",K.status==="failed"?K.error:K.status==="handed-off"?_("已交给应用,请在目标应用确认","Handed off; confirm in the target app"):K.status==="downloaded"?_("已交给浏览器下载","Queued in browser downloads"):_("已保存","Saved")]}),K.warning&&o.jsx("small",{children:Vn(K.warning)}),K.url&&o.jsx("button",{title:_("打开","Open"),onClick:()=>void chrome.tabs.create({url:K.url}),children:o.jsx(_d,{size:13})})]},x)),(Vs=C.warnings)==null?void 0:Vs.map((x,K)=>o.jsx("p",{children:x},K)),((Fe=C.results.desktop)==null?void 0:Fe.status)==="saved"&&o.jsxs("div",{className:"actions",children:[o.jsxs("button",{onClick:()=>void Xo(),children:[o.jsx(vs,{size:13}),_("在 Chat 继续","Continue in Chat")]}),o.jsxs("button",{onClick:()=>ot({type:"reading-todo",dueDate:new Date(Date.now()+864e5).toLocaleDateString("sv-SE"),requestId:crypto.randomUUID()}),children:[o.jsx(l0,{size:13}),_("添加阅读待办","Add reading task")]})]})]}),o.jsxs("button",{className:"btn primary save",disabled:ae||B,onClick:()=>void an(),children:[o.jsx(ws,{size:16}),ae?_("正在保存…","Saving…"):_("保存剪藏","Save clip")]}),o.jsx("small",{children:u!=null&&u.local.forsionUser?_("已连接 Forsion 账号","Forsion account connected"):_("本地功能无需登录","Local features work without signing in")})]})]}):o.jsxs("div",{className:"empty",children:[o.jsx(ws,{size:30}),o.jsx("h2",{children:_("把发现带回 Forsion","Bring discoveries to Forsion")}),o.jsx("p",{children:_("打开网页,点击扩展图标开始剪藏。","Open a web page and click the extension icon to begin.")}),o.jsx("button",{className:"btn primary",disabled:B,onClick:()=>void ji(),children:_("提取当前网页","Extract current page")}),el&&o.jsx("button",{className:"btn",onClick:()=>void Me("tabs",async()=>ot({type:"tabs",items:await ve("tabs")})),children:_("选择打开的网页","Choose an open page")})]})]}),f==="collection"&&o.jsxs("div",{className:"panel-tabs",children:[o.jsx("button",{className:va==="clips"?"active":"",onClick:()=>nn("clips"),children:_("剪藏记录","Saved clips")}),o.jsx("button",{className:va==="highlights"?"active":"",onClick:()=>nn("highlights"),children:_("全部划线","All highlights")})]}),f==="collection"&&va==="highlights"&&o.jsx(y4,{locale:a.locale}),f==="collection"&&va==="clips"&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"page-heading",children:[o.jsxs("div",{children:[o.jsx("h1",{children:_("我的收藏集","My collection")}),o.jsx("p",{children:_("所有好想法,都有一个可以回去的地方。","A place to return to every good idea.")})]}),o.jsxs("button",{className:"btn",onClick:()=>na("clip"),children:[o.jsx(mi,{size:15}),_("继续剪藏","Keep clipping")]})]}),o.jsxs("div",{className:"search",children:[o.jsx(ih,{size:16}),o.jsx("input",{"aria-label":_("搜索收藏","Search collection"),placeholder:_("搜索标题和正文","Search titles and content"),value:xn,onChange:x=>ma(x.target.value)})]}),o.jsxs("p",{className:"caption",children:[Ne.length," ",_("条已保存记录 · 正文保存在本机","saved records · Content stored on this device")]}),!Ne.length&&o.jsxs("div",{className:"empty",children:[o.jsx(zs,{size:30}),o.jsx("h3",{children:_("从第一篇剪藏开始","Start with your first clip")}),o.jsx("p",{children:_("成功保存的内容会出现在这里。","Successfully saved clips will appear here.")})]}),Ne.filter(x=>(x.title+" "+x.document).toLowerCase().includes(xn.toLowerCase())).map(x=>o.jsxs("article",{className:"collection-row",children:[o.jsxs("button",{onClick:()=>ot({type:"history",item:x}),children:[o.jsx(zs,{size:22}),o.jsxs("span",{children:[o.jsx("strong",{children:x.title}),o.jsxs("small",{children:[x.site," · ",ln(x.dest)," ·"," ",new Date(x.at).toLocaleDateString(a.locale)]})]})]}),o.jsx("button",{title:_("下载 Markdown","Download Markdown"),onClick:()=>Dd(x.document,x.title+".md"),children:o.jsx(Oa,{size:16})}),o.jsx("button",{title:_("移除记录","Remove record"),onClick:()=>ot({type:"remove-history",item:x}),children:o.jsx(Ul,{size:15})})]},x.id))]}),f==="tasks"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"page-heading",children:o.jsxs("div",{children:[o.jsx("h1",{children:_("批量与每日任务","Batch & daily collection")}),o.jsx("p",{children:_("把多个来源,按你的节奏汇入智库。","Bring multiple sources into your vault at your own pace.")})]})}),o.jsxs("section",{className:"card",children:[o.jsxs("div",{className:"section-title",children:[o.jsx("h3",{children:_("添加链接","Add links")}),o.jsx("span",{className:"grow"}),o.jsx("button",{onClick:()=>void Me("import",async()=>{const x=await ve("bookmarks");ot({type:"import-links",items:x,selected:new Set})}),children:_("书签导入","Import bookmarks")}),o.jsx("button",{onClick:()=>void Me("import",async()=>{const x=await ve("tabs");ot({type:"import-links",items:x,selected:new Set})}),children:_("打开的网页","Open tabs")})]}),o.jsx("textarea",{className:"batch-input","aria-label":_("待剪藏链接","URLs to clip"),placeholder:"https://…",value:Gt,onChange:x=>xt(x.target.value)}),o.jsxs("div",{className:"actions",children:[o.jsx("span",{className:"caption",children:ln(a.defaultTarget)}),o.jsx("span",{className:"grow"}),o.jsx("button",{className:"btn primary",disabled:!Gt.trim()||Ra==="queue",onClick:()=>void Me("queue",async()=>{await ve("queue",{urls:Gt.split(/\n/).map(x=>x.trim()).filter(Boolean),targets:[a.defaultTarget,...a.targets.filter(x=>x.enabled&&x.id!==a.defaultTarget).map(x=>x.id)]}),xt(""),await jn()}),children:_("开始剪藏","Start batch")})]})]}),o.jsxs("section",{className:"card daily",children:[$a("每日阅读收集","Daily reading collection","浏览器运行时,在指定时间处理以下链接。","Process these links at the selected time while the browser is running.",a.daily.enabled,x=>void st({daily:{...a.daily,enabled:x}})),o.jsxs("div",{className:"actions",children:[o.jsx("input",{"aria-label":_("每日时间","Daily time"),type:"time",value:`${String(a.daily.hour).padStart(2,"0")}:${String(a.daily.minute).padStart(2,"0")}`,onChange:x=>{const[K,q]=x.target.value.split(":").map(Number);st({daily:{...a.daily,hour:K,minute:q}})}}),o.jsx("span",{children:_("本地时间","Local time")})]}),o.jsx("textarea",{value:Pe,"aria-label":_("每日链接","Daily links"),placeholder:_("每行一条链接","One URL per line"),onChange:x=>sn(x.target.value),onBlur:()=>void st({daily:{...a.daily,urls:Pe.split(`
|
|
395
|
+
`).map(x=>x.trim()).filter(Boolean)}})})]}),o.jsx(E4,{value:a.queue||xs.queue,locale:a.locale,onChange:x=>void Me("queue-settings",async()=>l(await ve("settings",{queue:x})))}),o.jsxs("div",{className:"section-title queue-heading",children:[o.jsx("h3",{children:_("任务队列","Task queue")}),o.jsx("button",{onClick:()=>void Me("clear-jobs",async()=>{await ve("clear-finished-jobs"),await jn()}),children:_("清理已完成和已取消记录","Clear finished and cancelled records")}),o.jsx("button",{onClick:()=>void Me("cancel",async()=>{await ve("cancel-jobs"),await jn()}),children:_("取消等待与运行中的任务","Cancel pending & running")})]}),fe.slice().reverse().map(x=>o.jsxs("article",{className:"job",children:[o.jsx("span",{className:"job-dot "+x.status}),o.jsxs("div",{children:[o.jsx("strong",{children:x.title||x.url}),o.jsxs("small",{children:[x.status==="queued"&&x.nextRetryAt?_("等待自动重试","Waiting to retry"):{queued:_("等待中","Queued"),running:_("运行中","Running"),saved:_("已保存","Saved"),failed:_("失败","Failed"),cancelled:_("已取消","Cancelled"),interrupted:_("已中断","Interrupted")}[x.status]," ","· ",x.attempts," ",_("次尝试","attempts")]}),x.status==="queued"&&x.nextRetryAt&&o.jsxs("small",{children:[_("下次尝试:","Next attempt: "),new Date(x.nextRetryAt).toLocaleString(a.locale)]}),x.error&&o.jsx("p",{className:"failed",children:x.error}),Object.entries(x.results).map(([K,q])=>o.jsxs("div",{className:"job-result",children:[o.jsxs("small",{children:[ln(K)," ·"," ",q.status==="saved"?_("已保存","Saved"):q.status==="downloaded"?_("已下载","Downloaded"):q.status==="handed-off"?_("已交接","Handed off"):_("失败","Failed")]}),q.warning&&o.jsx("p",{children:q.warning}),q.error&&o.jsx("p",{className:"failed",children:q.error}),q.deliveryUnknown&&o.jsx("p",{children:_("送达情况尚未确认,请先检查目标。","Delivery is unconfirmed. Check the destination first.")}),q.partial&&o.jsxs("p",{children:[_("已创建部分内容:","Partially created content: "),q.partial.url&&/^https?:\/\//.test(q.partial.url)?o.jsx("a",{href:q.partial.url,target:"_blank",rel:"noopener noreferrer",children:q.partial.id}):q.partial.id]}),(q.path||q.url)&&o.jsx("p",{children:q.path||q.url})]},K))]}),o.jsx("span",{className:"grow"}),["failed","cancelled","interrupted"].includes(x.status)&&o.jsx("button",{className:"btn",onClick:()=>ot({type:"retry",item:x}),children:_("重试","Retry")})]},x.id))]}),f==="vocab"&&o.jsx(Oj,{locale:a.locale,words:pe,onRefresh:jn}),f==="settings"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"settings-mobile",children:o.jsx("select",{"aria-label":_("设置分类","Settings category"),value:m,onChange:x=>p(x.target.value),children:Gl.map(x=>o.jsx("option",{value:x.id,children:_(x.zh,x.en)},x.id))})}),o.jsx("div",{className:"settings-content",children:rl()})]})]}),o.jsxs("footer",{className:"status",children:[o.jsx("span",{children:Te||_("Forsion Clip · 保存在此浏览器","Forsion Clip · Stored in this browser")}),o.jsx("span",{className:"grow"}),Ev]})]}),ze&&o.jsx("div",{className:"modal-backdrop",onMouseDown:x=>{x.target===x.currentTarget&&ot(null)},children:o.jsxs("section",{className:"modal",role:"dialog","aria-modal":"true","aria-label":_("Forsion Clip 对话框","Forsion Clip dialog"),children:[o.jsxs("header",{children:[o.jsx("h2",{children:ze.type==="desktop-chat"?_("在桌面 Chat 继续","Continue in Desktop Chat"):ze.type==="reading-todo"?_("阅读待办","Reading task"):ze.type==="destination"?_("保存位置","Save destination"):ze.type==="history"?ze.item.title:ze.type==="import-links"?_("选择链接","Select links"):ze.type==="retry"?_("重试任务","Retry task"):ze.type==="remove-history"?_("移除收藏记录","Remove collection record"):_("选择网页","Choose a page")}),o.jsx("button",{"aria-label":_("关闭","Close"),onClick:()=>ot(null),children:o.jsx(cr,{size:18})})]}),o.jsxs("div",{className:"modal-body",children:[ze.type==="desktop-chat"&&o.jsx(o.Fragment,{children:ze.options.enabled?o.jsxs(o.Fragment,{children:[o.jsx("p",{children:_("将当前剪藏发送给桌面端所选模型,创建一个真实 Chat 会话。","Send this clip to the selected Desktop model and start a new Chat session.")}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("桌面模型","Desktop model")}),o.jsx("select",{disabled:!!ze.result,value:ze.modelId,onChange:x=>ot({...ze,modelId:x.target.value}),children:ze.options.models.map(x=>o.jsx("option",{value:x.id,children:x.name},x.id))})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("想讨论什么?","What would you like to discuss?")}),o.jsx("textarea",{value:ze.instruction,disabled:!!ze.result,onChange:x=>ot({...ze,instruction:x.target.value})})]}),ze.result?o.jsxs(o.Fragment,{children:[o.jsx("p",{children:ze.result.ok?_("会话已启动。模型回答可在桌面端查看。","Session started. View the model response in Desktop."):ze.result.error}),ze.result.url&&o.jsx("button",{className:"btn primary",onClick:()=>void chrome.tabs.create({url:ze.result.url}),children:_("打开会话检查结果","Open session and check")})]}):o.jsx("button",{className:"btn primary",disabled:!!Ra||!ze.modelId,onClick:()=>void qs(),children:_("发送到桌面 Chat","Send to Desktop Chat")})]}):o.jsx("p",{children:_("请先在 Forsion 桌面端设置中启用远程会话。","Enable remote sessions in Forsion Desktop settings first.")})}),ze.type==="reading-todo"&&o.jsxs(o.Fragment,{children:[o.jsx("p",{children:_("在同一智库中新建带日期的 Markdown 待办,并链接这篇剪藏。","Create a dated Markdown task in the same vault, linked to this clip.")}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("阅读日期","Reading date")}),o.jsx("input",{type:"date",value:ze.dueDate,onChange:x=>ot({...ze,dueDate:x.target.value})})]}),ze.result?o.jsx("p",{children:ze.result.ok?_("已创建阅读待办","Reading task created"):ze.result.error}):o.jsx("button",{className:"btn primary",disabled:!!Ra||!ze.dueDate,onClick:()=>void Me("todo",async()=>{const x=await ve("desktop-todo",{title:E,notePath:C.results.desktop.path,vaultId:C.results.desktop.vaultId,dueDate:ze.dueDate,requestId:ze.requestId,locale:a.locale});if(ot({...ze,result:x}),!x.ok)throw new Error(x.error)}),children:_("创建待办","Create task")})]}),ze.type==="destination"&&o.jsxs(o.Fragment,{children:[o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("保存到","Save to")}),o.jsxs("select",{value:a.defaultTarget,onChange:x=>void st({defaultTarget:x.target.value}),children:[o.jsx("option",{value:"cloud",children:_("Forsion 云端智库","Forsion cloud vault")}),o.jsx("option",{value:"desktop",children:_("Forsion 桌面智库","Forsion Desktop vault")}),pd.map(x=>o.jsx("option",{value:x.id,children:Vn(x.label)},x.id))]})]}),a.defaultTarget==="cloud"?o.jsxs(o.Fragment,{children:[o.jsx("button",{className:"btn",onClick:()=>void Me("vault",async()=>{pa(await ve("cloud-vaults")),tn(await ve("cloud-folders",{vaultId:a.cloudVault}))}),children:_("刷新云智库","Refresh cloud vaults")}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("智库","Vault")}),o.jsxs("select",{value:a.cloudVault,onChange:x=>void Me("folders",async()=>{await st({cloudVault:x.target.value}),tn(await ve("cloud-folders",{vaultId:x.target.value}))}),children:[o.jsx("option",{value:"default",children:_("默认智库","Default vault")}),Ma.map(x=>o.jsx("option",{value:x.id,disabled:x.role==="viewer",children:x.name},x.id))]})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("文件夹","Folder")}),o.jsx("input",{list:"folders",value:a.cloudFolder,onChange:x=>void st({cloudFolder:x.target.value})})]})]}):a.defaultTarget==="desktop"?o.jsxs(o.Fragment,{children:[o.jsx("button",{className:"btn",onClick:()=>void Me("vault",Vl),children:_("刷新桌面智库","Refresh Desktop vault")}),o.jsx("p",{children:(ne==null?void 0:ne.name)||(ne==null?void 0:ne.root)||_("先到设置配对桌面端","Pair with Desktop in settings first")}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("文件夹","Folder")}),o.jsx("input",{list:"folders",value:a.desktopFolder,onChange:x=>void st({desktopFolder:x.target.value})})]})]}):o.jsx("p",{children:_("连接参数可在“设置 → 保存与同步”中配置。","Configure connection details under Settings → Save & sync.")}),o.jsx("datalist",{id:"folders",children:Ll.map(x=>o.jsx("option",{value:x},x))})]}),ze.type==="history"&&o.jsxs(o.Fragment,{children:[o.jsx("a",{href:ze.item.url,target:"_blank",rel:"noreferrer",children:ze.item.url}),o.jsx("div",{className:"markdown",dangerouslySetInnerHTML:{__html:Md(ze.item.document)}}),o.jsxs("button",{className:"btn",onClick:()=>Dd(ze.item.document,ze.item.title+".md"),children:[o.jsx(Oa,{size:15}),_("下载 Markdown","Download Markdown")]})]}),ze.type==="import-links"&&o.jsxs(o.Fragment,{children:[ze.items.map(x=>o.jsxs("label",{className:"import-row",children:[o.jsx("input",{type:"checkbox",checked:ze.selected.has(x.url),onChange:K=>{const q=new Set(ze.selected);K.target.checked?q.add(x.url):q.delete(x.url),ot({...ze,selected:q})}}),o.jsxs("span",{children:[x.title||x.url,o.jsx("small",{children:x.url})]})]},x.url)),o.jsxs("button",{className:"btn primary",disabled:!ze.selected.size,onClick:()=>{xt(x=>[x,...ze.selected].filter(Boolean).join(`
|
|
396
|
+
`)),ot(null)},children:[_("添加所选链接","Add selected links")," (",ze.selected.size,")"]})]}),ze.type==="tabs"&&ze.items.map(x=>o.jsx("button",{className:"import-row",onClick:()=>{ot(null),il("full",x.id)},children:x.title},x.id)),ze.type==="retry"&&o.jsxs(o.Fragment,{children:[o.jsx("p",{children:_("中断或超时的任务可能已经送达。请先检查目标,避免重复保存。已确认成功的目标不会重跑。","Interrupted or timed-out exports may already have arrived. Check the destination to avoid duplicates. Confirmed successful targets will not run again.")}),o.jsx("button",{className:"btn primary",onClick:()=>void Me("retry",async()=>{await ve("retry-job",{id:ze.item.id}),ot(null),await jn()}),children:_("重试失败目标","Retry failed targets")})]}),ze.type==="remove-history"&&o.jsxs(o.Fragment,{children:[o.jsx("p",{children:_("仅移除此浏览器的收藏记录,不删除已保存到目标的文件。","Remove this browser’s record. Files already saved to destinations are kept.")}),o.jsx("button",{className:"btn",onClick:()=>void Me("remove",async()=>{await ve("history-remove",{id:ze.item.id}),ot(null),await jn()}),children:_("移除记录","Remove record")})]})]}),o.jsx("footer",{children:o.jsx("button",{className:"btn",onClick:()=>ot(null),children:_("完成","Done")})})]})})]});function rl(){var pt,dt,Lt,sl,dn,_i,wr;const x=(u==null?void 0:u.local)||{templates:[],persistentSites:[],cloudOrigin:"https://api.forsion.net"},K=async F=>{await ve("local-settings",F),await Sn()},q=a.providers.find(F=>F.id===a.provider)||a.providers[0],De=F=>void st({providers:a.providers.map(ge=>ge.id===q.id?{...ge,...F}:ge)}),xe=(F,ge)=>{const et=a.targets.find(We=>We.id===F)||{id:F,enabled:!1,options:{}};return st({targets:[...a.targets.filter(We=>We.id!==F),{...et,...ge}]})},Ge=(F,ge,et)=>o.jsx(S4,{fields:F,values:ge,locale:a.locale,onChange:et});if(m==="selection")return o.jsxs(o.Fragment,{children:[o.jsx(b4,{locale:a.locale,value:a.selection,enabled:(u==null?void 0:u.config.selectionToolbar)!==!1,providerName:(q==null?void 0:q.name)||"",onChange:async(F,ge)=>{const et=await ve("selection-settings",{selection:F,expected:ge});l(et)},onEnabledChange:async F=>{await ve("config",{selectionToolbar:F}),await Sn()},onOpenAiSettings:()=>p("ai")}),o.jsx(O4,{locale:a.locale,value:a.floating||xs.floating,onChange:async F=>{const ge=await ve("settings",{floating:F});l(ge)}})]});if(m==="account")return o.jsxs(o.Fragment,{children:[o.jsx("h1",{children:_("同一个 Forsion 账号","One Forsion account")}),o.jsx("p",{children:_("连接浏览器里的发现,和 Forsion 中正在进行的思考。","Connect discoveries in your browser with your work in Forsion.")}),o.jsxs("div",{className:"account-card",children:[o.jsx("span",{className:"avatar",children:(((pt=x.forsionUser)==null?void 0:pt.nickname)||((dt=x.forsionUser)==null?void 0:dt.username)||"F").slice(0,1)}),o.jsxs("div",{children:[o.jsx("strong",{children:((Lt=x.forsionUser)==null?void 0:Lt.nickname)||((sl=x.forsionUser)==null?void 0:sl.username)||_("尚未登录","Not signed in")}),o.jsx("small",{children:((dn=x.forsionUser)==null?void 0:dn.email)||_("本地剪藏和导出始终可用","Local clipping and export are always available")})]})]}),x.forsionUser?o.jsx(gt,{label:_("Forsion 账号","Forsion account"),description:_("退出不会删除本机剪藏。","Signing out keeps your local clips."),control:o.jsxs("button",{className:"btn",onClick:()=>void Me("logout",async()=>{await ve("logout"),await Sn(),pa([])}),children:[o.jsx(rj,{size:14}),_("退出登录","Sign out")]})}):o.jsx(gt,{label:_("安全登录","Sign in securely"),description:_("在 Forsion 官方页面确认设备授权。扩展不收集密码。","Approve device access on the official Forsion page. The extension never asks for your password."),control:o.jsx("button",{className:"btn primary",disabled:!!Ra||!!un,onClick:()=>void Me("login",async()=>{const F=await ve("login-start");yi(F),await chrome.tabs.create({url:F.url})}),children:_("登录 Forsion","Sign in to Forsion")})})," ",un&&o.jsxs("div",{className:"card auth-code",children:[o.jsx("h3",{children:_("等待你确认授权","Waiting for your approval")}),o.jsx("code",{children:un.userCode}),o.jsx("p",{children:_("在打开的授权页核对代码,然后确认。","Check this code on the authorization page, then approve.")}),o.jsx("button",{className:"btn",onClick:()=>void chrome.tabs.create({url:un.url}),children:_("重新打开授权页","Reopen authorization")}),o.jsx("button",{className:"btn",onClick:()=>void Me("cancel",async()=>{await ve("login-cancel",{id:un.id}),yi(null)}),children:_("取消","Cancel")})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("Forsion 服务地址","Forsion service address")}),o.jsx("input",{defaultValue:x.cloudOrigin,onBlur:F=>{F.target.value!==x.cloudOrigin&&Me("origin",()=>K({cloudOrigin:F.target.value}))}})]}),o.jsx("p",{className:"caption",children:_("更换服务地址后需重新登录。云端权益沿用 Forsion 账号。","Changing the service requires signing in again. Your Forsion account determines cloud entitlements.")})]});if(m==="save")return o.jsxs(o.Fragment,{children:[o.jsx("h1",{children:_("保存与同步","Save & sync")}),o.jsx(gt,{label:_("默认保存位置","Default destination"),description:_("每次剪藏仍可更换智库与文件夹。","You can change the vault and folder for each clip."),control:o.jsxs("button",{className:"btn",onClick:()=>void Ls(),children:[ln(a.defaultTarget),o.jsx(Rv,{size:13})]})}),$a("保留来源与属性","Include source metadata","将网页 URL、作者和标签写入 Markdown 属性。","Write source URL, author and tags into Markdown metadata.",z,F=>{U(F),ve("config",{frontMatter:F})}),o.jsx(M4,{locale:a.locale,value:a.frontmatter||xs.frontmatter,onSave:async(F,ge)=>{l(await ve("frontmatter-settings",{frontmatter:F,expected:ge}))}}),o.jsx("h2",{children:_("额外导出目标","Additional destinations")}),o.jsx("p",{children:_("启用后,每次保存同时发送到这些目标。凭据仅存于本机扩展。","Enabled destinations receive each saved clip. Credentials stay in this extension on this device.")}),o.jsx("div",{className:"destination-settings",children:pd.map(F=>{var et;const ge=a.targets.find(We=>We.id===F.id)||{id:F.id,enabled:!1,options:{}};return o.jsxs("details",{children:[o.jsxs("summary",{children:[o.jsx("span",{children:Vn(F.label)}),o.jsx("span",{className:"grow"}),o.jsx("span",{children:ge.enabled?_("已启用","Enabled"):_("未启用","Disabled")})]}),o.jsx(gt,{label:_("同时保存到此目标","Also save to this destination"),control:o.jsx(Ln,{label:Vn(F.label),checked:ge.enabled,onChange:()=>xe(F.id,{enabled:!ge.enabled})})}),F.note&&o.jsx("p",{className:"caption",children:Vn(F.note)}),Ge(F.fields||[],ge.options,We=>xe(F.id,{options:We})),["notion","wolai","flowus"].includes(F.id)&&(F.id==="wolai"||ge.options.parentType!=="page"&&(F.id!=="flowus"||ge.options.parentType==="database"))&&o.jsx(C4,{value:ge.options.fieldMappings||"",locale:a.locale,onSave:async We=>{const Ke=await ve("settings",{}),Nr=Ke.targets.find(zi=>zi.id===F.id)||ge;if((Nr.options.fieldMappings||"")!==(ge.options.fieldMappings||""))throw new Error(_("映射已被其他页面修改,请重新载入设置。","Mappings changed in another page. Reload settings."));const Gs=await ve("settings",{targets:[...Ke.targets.filter(zi=>zi.id!==F.id),{...Nr,options:{...Nr.options,fieldMappings:We}}]});l(Gs)}}),!((et=F.fields)!=null&&et.length)&&o.jsx("p",{className:"caption",children:_("无需额外配置。","No additional configuration needed.")})]},F.id)})})]});if(m==="ai")return o.jsxs(o.Fragment,{children:[o.jsx("h1",{children:_("AI 与模型","AI & models")}),o.jsx(Z4,{value:a.readerPresets||[],locale:a.locale,onSave:async(F,ge)=>{l(await ve("reader-presets-settings",{readerPresets:F,expected:ge}))}}),o.jsx("p",{children:_("使用 Forsion AI,或连接自己的模型服务。只在你点击发送时传输阅读内容。","Use Forsion AI or connect your own model service. Reading content is sent only when you ask.")}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("当前服务","Current provider")}),o.jsx("select",{value:a.provider,onChange:F=>void st({provider:F.target.value}),children:a.providers.map(F=>o.jsx("option",{value:F.id,children:F.name},F.id))})]}),o.jsxs("div",{className:"actions",children:[o.jsxs("button",{className:"btn",onClick:()=>{const F=crypto.randomUUID();st({provider:F,providers:[...a.providers,{id:F,name:_("新模型服务","New provider"),kind:"openai",endpoint:"https://api.openai.com/v1",apiKey:"",model:""}]})},children:[o.jsx(mi,{size:14}),_("添加服务","Add provider")]}),(q==null?void 0:q.kind)!=="forsion"&&o.jsx("button",{className:"btn",onClick:()=>void st({provider:"forsion",providers:a.providers.filter(F=>F.id!==q.id)}),children:_("移除服务","Remove provider")})]}),q&&o.jsxs(o.Fragment,{children:[o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("名称","Name")}),o.jsx("input",{value:q.name,onChange:F=>De({name:F.target.value})})]}),q.kind!=="forsion"&&o.jsxs(o.Fragment,{children:[o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("接口类型","API type")}),o.jsxs("select",{value:q.kind,onChange:F=>{const ge=F.target.value;De({kind:ge,endpoint:{openai:"https://api.openai.com/v1",anthropic:"https://api.anthropic.com",google:"https://generativelanguage.googleapis.com",ollama:"http://127.0.0.1:11434"}[ge]})},children:[o.jsx("option",{value:"openai",children:"OpenAI / OpenAI compatible"}),o.jsx("option",{value:"anthropic",children:"Anthropic"}),o.jsx("option",{value:"google",children:"Google Gemini"}),o.jsx("option",{value:"ollama",children:"Ollama"})]})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("接口地址","API endpoint")}),o.jsx("input",{value:q.endpoint,onChange:F=>De({endpoint:F.target.value})})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:"API key"}),o.jsx("input",{type:"password",autoComplete:"off",value:q.apiKey,onChange:F=>De({apiKey:F.target.value})})]})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("模型 ID","Model ID")}),o.jsx("input",{list:"models",value:q.model,placeholder:q.kind==="forsion"?_("使用账号默认模型","Use account default model"):"gpt-…",onChange:F=>De({model:F.target.value})}),o.jsx("datalist",{id:"models",children:Vo.map(F=>o.jsx("option",{value:F.id,children:F.name},F.id))})]}),q.kind==="forsion"&&o.jsx("button",{className:"btn",onClick:()=>void Me("models",async()=>Us((await ve("models")).models)),children:_("刷新可用模型","Refresh available models")})]})]});if(m==="templates")return o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"section-title",children:[o.jsx("h1",{children:_("站点与模板","Sites & templates")}),o.jsxs("button",{className:"btn",onClick:()=>_t({id:crypto.randomUUID(),name:"",pattern:"",enabled:!0,include:[],exclude:[]}),children:[o.jsx(mi,{size:14}),_("新增","Add")]})]}),o.jsx("p",{children:_("用站点规则排除导航与广告,或只保留指定区域。","Remove navigation and ads, or include only specific regions.")}),x.templates.map(F=>o.jsxs("article",{className:"template-row",children:[o.jsxs("button",{onClick:()=>_t(structuredClone(F)),children:[o.jsx("strong",{children:F.name}),o.jsx("small",{children:F.pattern})]}),o.jsx(Ln,{label:F.name,checked:F.enabled,onChange:()=>void Me("template",()=>K({templates:x.templates.map(ge=>ge.id===F.id?{...ge,enabled:!ge.enabled}:ge)}))}),o.jsx("button",{title:_("移除模板","Remove template"),onClick:()=>void Me("template",()=>K({templates:x.templates.filter(ge=>ge.id!==F.id)})),children:o.jsx(Ul,{size:14})})]},F.id)),Ue&&o.jsxs("section",{className:"card",children:[o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("模板名称","Template name")}),o.jsx("input",{value:Ue.name,onChange:F=>_t({...Ue,name:F.target.value})})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("网址匹配","URL pattern")}),o.jsx("input",{placeholder:"*.example.com/*",value:Ue.pattern,onChange:F=>_t({...Ue,pattern:F.target.value})})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("保留 CSS 选择器,每行一条","Include CSS selectors, one per line")}),o.jsx("textarea",{value:Ue.include.join(`
|
|
397
|
+
`),onChange:F=>_t({...Ue,include:F.target.value.split(`
|
|
398
|
+
`)})})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("排除 CSS 选择器,每行一条","Exclude CSS selectors, one per line")}),o.jsx("textarea",{value:Ue.exclude.join(`
|
|
399
|
+
`),onChange:F=>_t({...Ue,exclude:F.target.value.split(`
|
|
400
|
+
`)})})]}),o.jsxs("div",{className:"field",children:[o.jsx("span",{children:_("元数据选择器(可选)","Metadata selectors (optional)")}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("标题选择器","Title selector")}),o.jsx("input",{value:((_i=Ue.metadataSelectors)==null?void 0:_i.titleSelector)||"",onChange:F=>_t({...Ue,metadataSelectors:{...Ue.metadataSelectors,titleSelector:F.target.value}})})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("作者选择器","Author selector")}),o.jsx("input",{value:((wr=Ue.metadataSelectors)==null?void 0:wr.authorSelector)||"",onChange:F=>_t({...Ue,metadataSelectors:{...Ue.metadataSelectors,authorSelector:F.target.value}})})]})]}),o.jsx("h3",{children:_("重复内容块","Repeated content blocks")}),o.jsx("p",{className:"caption",children:_("为列表中的每条消息或卡片设置容器与保留区域。","Choose the container and included regions for each message or card in a list.")}),(Ue.repeatedBlocks||[]).map((F,ge)=>o.jsxs("div",{className:"card",children:[o.jsx(gt,{label:_("启用此规则","Enable this rule"),control:o.jsx(Ln,{label:_("启用此规则","Enable this rule"),checked:F.enabled!==!1,onChange:()=>_t({...Ue,repeatedBlocks:Ue.repeatedBlocks.map((et,We)=>We===ge?{...et,enabled:et.enabled===!1}:et)})})}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("规则名称","Rule name")}),o.jsx("input",{value:F.name||"",onChange:et=>_t({...Ue,repeatedBlocks:Ue.repeatedBlocks.map((We,Ke)=>Ke===ge?{...We,name:et.target.value}:We)})})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("容器选择器","Container selector")}),o.jsx("input",{value:F.container,onChange:et=>_t({...Ue,repeatedBlocks:Ue.repeatedBlocks.map((We,Ke)=>Ke===ge?{...We,container:et.target.value}:We)})})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("保留选择器,每行一条","Included selectors, one per line")}),o.jsx("textarea",{value:(F.include||[]).join(`
|
|
401
|
+
`),onChange:et=>_t({...Ue,repeatedBlocks:Ue.repeatedBlocks.map((We,Ke)=>Ke===ge?{...We,include:et.target.value.split(`
|
|
402
|
+
`)}:We)})})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("排除选择器,每行一条","Excluded selectors, one per line")}),o.jsx("textarea",{value:(F.exclude||[]).join(`
|
|
403
|
+
`),onChange:et=>_t({...Ue,repeatedBlocks:Ue.repeatedBlocks.map((We,Ke)=>Ke===ge?{...We,exclude:et.target.value.split(`
|
|
404
|
+
`)}:We)})})]}),o.jsx("button",{className:"btn",onClick:()=>_t({...Ue,repeatedBlocks:Ue.repeatedBlocks.filter((et,We)=>We!==ge)}),children:_("移除此规则","Remove rule")})]},ge)),o.jsx("button",{className:"btn",onClick:()=>_t({...Ue,repeatedBlocks:[...Ue.repeatedBlocks||[],{container:"",include:[],exclude:[],enabled:!0}]}),children:_("添加重复块规则","Add repeated block rule")}),o.jsxs("div",{className:"actions",children:[o.jsx("button",{className:"btn",onClick:()=>_t(null),children:_("取消","Cancel")}),o.jsx("button",{className:"btn primary",disabled:!Ue.name||!Ue.pattern,onClick:()=>void Me("template",async()=>{var ge,et,We;const F=[...Ue.include,...Ue.exclude,(ge=Ue.metadataSelectors)==null?void 0:ge.titleSelector,(et=Ue.metadataSelectors)==null?void 0:et.authorSelector,...(Ue.repeatedBlocks||[]).flatMap(Ke=>[Ke.container,...Ke.include||[],...Ke.exclude||[]])];for(const Ke of F)if(Ke!=null&&Ke.trim())try{document.createDocumentFragment().querySelector(Ke)}catch{throw new Error(_("CSS 选择器无效:","Invalid CSS selector: ")+Ke)}if((We=Ue.repeatedBlocks)!=null&&We.some(Ke=>Ke.enabled!==!1&&!Ke.container.trim()))throw new Error(_("已启用的重复块规则需要容器选择器。","Enabled repeated block rules require a container selector."));await K({templates:[...x.templates.filter(Ke=>Ke.id!==Ue.id),Ue]}),_t(null)}),children:_("保存模板","Save template")})]})]}),o.jsx("h2",{children:_("常驻站点","Persistent sites")}),o.jsx("p",{children:_("仅在这些站点自动恢复划线并显示选择工具条,每行一个域名。","Automatically restore highlights and show the selection toolbar on these domains, one per line.")}),o.jsx("textarea",{defaultValue:x.persistentSites.join(`
|
|
405
|
+
`),onBlur:F=>void Me("sites",()=>K({persistentSites:F.target.value.split(`
|
|
406
|
+
`).map(ge=>ge.trim()).filter(Boolean)}))}),o.jsx("h2",{children:_("自动剪藏站点","Auto-clip sites")}),o.jsx("p",{children:_("这些域名的网页载入完成后,自动加入默认保存队列。请仅填写希望自动保存的站点。","Pages on these exact domains are queued automatically after loading. Add only sites you want saved automatically.")}),o.jsx("textarea",{value:a.autoClipSites.join(`
|
|
407
|
+
`),onChange:F=>void st({autoClipSites:F.target.value.split(`
|
|
408
|
+
`)})})]});if(m==="images"){const F=_v.find(ge=>ge.id===a.imageHost.id);return o.jsxs(o.Fragment,{children:[o.jsx("h1",{children:_("图片与图床","Images & hosting")}),$a("保存时上传图片","Upload images on save","仅上传剪藏正文引用的图片。失败时保留原链接并显示错误。","Upload images referenced in the clip. Failed uploads keep the original URL and show an error.",a.imageHost.enabled,ge=>void st({imageHost:{...a.imageHost,enabled:ge}})),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("图床","Image host")}),o.jsx("select",{value:a.imageHost.id,onChange:ge=>void st({imageHost:{...a.imageHost,id:ge.target.value,options:{}}}),children:_v.map(ge=>o.jsx("option",{value:ge.id,children:Vn(ge.label)},ge.id))})]}),Ge((F==null?void 0:F.fields)||[],a.imageHost.options,ge=>void st({imageHost:{...a.imageHost,options:ge}}))]})}return m==="desktop"?o.jsxs(o.Fragment,{children:[o.jsx("h1",{children:_("桌面联动","Desktop connection")}),o.jsx("p",{children:_("配对后可保存到桌面端当前选择的本地智库。","Pair to save into the local vault currently selected in Forsion Desktop.")}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("桌面地址","Desktop address")}),o.jsx("input",{value:Ot,onChange:F=>ga(F.target.value)})]}),o.jsx("p",{className:"caption",children:_("这使用 Forsion 的设备配对。允许后,扩展将获得该设备的智库访问权限;你可以在桌面端撤销配对。","This uses Forsion device pairing. Approval grants vault access on that device; revoke the pairing in Desktop at any time.")}),o.jsxs("div",{className:"actions",children:[o.jsxs("button",{className:"btn",disabled:!!Ra,onClick:()=>void Me("status",Vl),children:[o.jsx(Es,{size:14}),_("检查连接","Check connection")]}),o.jsx("button",{className:"btn primary",disabled:!!Ra||!!ta,onClick:()=>void Me("pair",async()=>{const F=await ve("desktop-pair",{endpoint:Ot});Ht(F)}),children:_("请求配对","Request pairing")}),(u==null?void 0:u.desktop.paired)&&o.jsx("button",{className:"btn",onClick:()=>void Me("disconnect",async()=>{await ve("desktop-disconnect"),await Sn(),ft(null),Le(null)}),children:_("断开连接","Disconnect")})]}),Ae&&o.jsx("div",{className:Ae.connected?"notice-inline":"error",children:Ae.connected?`${Ae.name||"Forsion Desktop"} · ${Ae.paired?_("已配对","Paired"):_("尚未配对","Not paired")}`:Ae.error}),ta&&o.jsxs("div",{className:"card auth-code",children:[o.jsx("h3",{children:_("请在 Forsion 桌面端确认","Confirm in Forsion Desktop")}),o.jsx("code",{children:ta.code}),o.jsx("p",{children:ta.name}),o.jsx("button",{className:"btn",onClick:()=>void Me("disconnect",async()=>{await ve("desktop-disconnect"),Ht(null)}),children:_("取消配对","Cancel pairing")})]}),ne&&o.jsxs("p",{children:[_("已选择智库:","Selected vault: "),ne.name||ne.root]}),o.jsx("hr",{}),o.jsx(A4,{locale:a.locale}),o.jsx("hr",{}),o.jsx("h2",{children:"MCP"}),o.jsx("p",{children:_("让你授权的本机 AI 客户端列出网页、提取内容和保存剪藏。开启前,在本机启动随包提供的 MCP 服务。","Allow your local AI client to list pages, extract content and save clips. Start the included MCP service before enabling the connection.")}),$a("连接 MCP 服务","Connect MCP service","只连接本机地址,需填写双方一致的连接密钥。","Localhost only. Both sides must use the same connection key.",a.mcp.enabled,F=>void st({mcp:{...a.mcp,enabled:F}})),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("服务地址","Service address")}),o.jsx("input",{value:a.mcp.endpoint,onChange:F=>void st({mcp:{...a.mcp,endpoint:F.target.value}})})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("连接密钥","Connection key")}),o.jsx("input",{type:"password",autoComplete:"off",value:a.mcp.token,onChange:F=>void st({mcp:{...a.mcp,token:F.target.value}})})]}),o.jsx("button",{className:"btn",onClick:()=>void st({mcp:{...a.mcp,token:crypto.randomUUID()+crypto.randomUUID()}}),children:_("生成连接密钥","Generate connection key")}),o.jsx("p",{className:"caption",children:_("MCP 客户端配置与启动方法见扩展包的 README。","See the extension package README for MCP client setup.")})]}):o.jsxs(o.Fragment,{children:[o.jsx("h1",{children:_("通用设置","General")}),o.jsx(gt,{label:_("界面语言","Language"),control:o.jsxs("select",{value:a.locale,onChange:F=>void st({locale:F.target.value}),children:[o.jsx("option",{value:"zh",children:"中文"}),o.jsx("option",{value:"en",children:"English"})]})}),o.jsx(gt,{label:_("外观","Appearance"),control:o.jsxs("select",{value:a.theme,onChange:F=>void st({theme:F.target.value}),children:[o.jsx("option",{value:"system",children:_("跟随系统","System")}),o.jsx("option",{value:"light",children:_("浅色","Light")}),o.jsx("option",{value:"dark",children:_("深色","Dark")})]})}),o.jsx(gt,{label:_("选区工具栏","Selection toolbar"),description:_("管理工具栏开关、翻译、阅读功能与禁用站点。","Manage the toolbar, translation, reading actions, and disabled sites."),control:o.jsxs("button",{type:"button",className:"btn",onClick:()=>p("selection"),children:[_("配置","Configure"),o.jsx(tj,{size:14})]})}),o.jsx(gt,{label:_("导出配置","Export preferences"),description:_("包含模板与偏好,不包含账号、密钥或配对令牌。","Includes templates and preferences, without credentials or pairing tokens."),control:o.jsxs("button",{className:"btn",onClick:()=>void Me("export",async()=>Dd(JSON.stringify(await ve("preferences-export"),null,2),"forsion-clip-preferences.json","application/json")),children:[o.jsx(Oa,{size:14}),_("导出","Export")]})}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:_("导入配置","Import preferences")}),o.jsx("input",{type:"file",accept:"application/json,.json",onChange:F=>void Me("import",async()=>{var Ke;const ge=(Ke=F.target.files)==null?void 0:Ke[0];if(!ge)return;if(ge.size>1e6)throw new Error("Configuration file too large");const et=JSON.parse(await ge.text()),We=h4.parse(et.settings);await ve("settings",We),Array.isArray(et.templates)&&await K({templates:et.templates}),await Sn(),ke(_("已导入配置","Preferences imported"))})})]}),o.jsxs("p",{className:"caption",children:["Forsion Clip ",Ev," ·"," ",_("共享 Genesis UI 组件","Shared Genesis UI components")]})]})}}function Dd(a,l,u="text/markdown"){const s=new Blob([a],{type:u+";charset=utf-8"}),f=URL.createObjectURL(s);chrome.downloads.download({url:f,filename:l.replace(/[\\/:*?"<>|]/g,"-").slice(0,180),saveAs:!0}).finally(()=>setTimeout(()=>URL.revokeObjectURL(f),6e4))}BS.createRoot(document.getElementById("app")).render(o.jsx(u3,{}));
|