claude-codex-wechat 0.1.22 → 0.1.23

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.
@@ -12,7 +12,7 @@ import { networkInterfaces } from "node:os";
12
12
  // src/daemon/server.ts
13
13
  import { mkdtempSync } from "node:fs";
14
14
  import { tmpdir as tmpdir2 } from "node:os";
15
- import { dirname as dirname10, join as join9 } from "node:path";
15
+ import { dirname as dirname11, join as join10 } from "node:path";
16
16
  import Fastify from "fastify";
17
17
 
18
18
  // src/channels/platforms.ts
@@ -4450,6 +4450,20 @@ var RelayTunnelRouter = class {
4450
4450
  }
4451
4451
  };
4452
4452
 
4453
+ // src/shared/version.ts
4454
+ import { readFileSync as readFileSync7 } from "node:fs";
4455
+ import { dirname as dirname10, join as join9 } from "node:path";
4456
+ import { fileURLToPath } from "node:url";
4457
+ function readClientVersion() {
4458
+ try {
4459
+ const here2 = dirname10(fileURLToPath(import.meta.url));
4460
+ const pkg = JSON.parse(readFileSync7(join9(here2, "..", "..", "package.json"), "utf8"));
4461
+ return typeof pkg.version === "string" && pkg.version ? pkg.version : "0.0.0";
4462
+ } catch {
4463
+ return "0.0.0";
4464
+ }
4465
+ }
4466
+
4453
4467
  // src/daemon/server.ts
4454
4468
  function readUpdateStatusBestEffort(configPath) {
4455
4469
  if (!configPath) return { ok: false };
@@ -4462,7 +4476,7 @@ function readUpdateStatusBestEffort(configPath) {
4462
4476
  function createDaemonServer(options = {}) {
4463
4477
  const app = Fastify({ logger: true });
4464
4478
  const events = new BridgeEventHub();
4465
- const configPath = options.configPath ?? process.env.BRIDGE_CONFIG ?? join9(mkdtempSync(join9(tmpdir2(), "claude-codex-wechat-")), "config.json");
4479
+ const configPath = options.configPath ?? process.env.BRIDGE_CONFIG ?? join10(mkdtempSync(join10(tmpdir2(), "claude-codex-wechat-")), "config.json");
4466
4480
  const persistedConfig = loadBridgeConfig(configPath);
4467
4481
  const bridgeDefaults = {
4468
4482
  defaultProvider: options.bridgeDefaults?.defaultProvider ?? persistedConfig.bridge?.defaultProvider ?? "claude-code",
@@ -4519,7 +4533,7 @@ function createDaemonServer(options = {}) {
4519
4533
  });
4520
4534
  }
4521
4535
  const weixinStateStore = configPath ? new FileWeixinStateStore(configPath) : void 0;
4522
- const weixinMediaDir = configPath ? join9(dirname10(configPath), "media") : void 0;
4536
+ const weixinMediaDir = configPath ? join10(dirname11(configPath), "media") : void 0;
4523
4537
  const managedWechatChannel = options.channel ? null : new ManagedWeixinDirectAdapter(options.wechat, weixinStateStore, weixinMediaDir);
4524
4538
  const channel = options.channel ?? managedWechatChannel;
4525
4539
  const weixinOutboundGate = managedWechatChannel && weixinStateStore ? new WeixinOutboundGate({
@@ -4634,6 +4648,7 @@ function createDaemonServer(options = {}) {
4634
4648
  const update = read.ok ? read.update ?? null : persistedConfig.update ?? null;
4635
4649
  return {
4636
4650
  ok: true,
4651
+ version: readClientVersion(),
4637
4652
  sessions: conversation.getCurrent() ? [conversation.getCurrent()] : [],
4638
4653
  update,
4639
4654
  preferredLocalUrl: (() => {
@@ -4750,20 +4765,6 @@ function createUpdateChecker(opts) {
4750
4765
  };
4751
4766
  }
4752
4767
 
4753
- // src/shared/version.ts
4754
- import { readFileSync as readFileSync7 } from "node:fs";
4755
- import { dirname as dirname11, join as join10 } from "node:path";
4756
- import { fileURLToPath } from "node:url";
4757
- function readClientVersion() {
4758
- try {
4759
- const here2 = dirname11(fileURLToPath(import.meta.url));
4760
- const pkg = JSON.parse(readFileSync7(join10(here2, "..", "..", "package.json"), "utf8"));
4761
- return typeof pkg.version === "string" && pkg.version ? pkg.version : "0.0.0";
4762
- } catch {
4763
- return "0.0.0";
4764
- }
4765
- }
4766
-
4767
4768
  // src/daemon/bootstrap.ts
4768
4769
  async function startDaemon(options) {
4769
4770
  const port = options.port ?? Number(process.env.BRIDGE_PORT ?? 8787);
@@ -9,4 +9,4 @@ Error generating stack: `+e.message+`
9
9
  `).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function $(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Qt(e,``+r);break;case`className`:It(e,`class`,r);break;case`tabIndex`:It(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:It(e,n,r);break;case`style`:tn(e,r,o);break;case`data`:if(t!==`object`){It(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=on(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&$(e,t,`name`,a.name,a,null),$(e,t,`formEncType`,a.formEncType,a,null),$(e,t,`formMethod`,a.formMethod,a,null),$(e,t,`formTarget`,a.formTarget,a,null)):($(e,t,`encType`,a.encType,a,null),$(e,t,`method`,a.method,a,null),$(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=on(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=sn);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=on(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),Ft(e,`popover`,r);break;case`xlinkActuate`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Lt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Lt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ft(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=rn.get(n)||n,Ft(e,n,r))}}function Nd(e,t,n,r,a,o){switch(n){case`style`:tn(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Qt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Qt(e,``+r);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=sn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Ot.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ht]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ft(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,o,s,n,null)}}a&&$(e,t,`srcSet`,n.srcSet,n,null),r&&$(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:$(e,t,r,d,n,null)}}qt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:$(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Yt(e,!!r,n,!0):Yt(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:$(e,t,s,c,n,null)}Zt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:$(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)Q(_d[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:$(e,t,u,r,n,null)}return;default:if(nn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&$(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||$(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&$(e,t,p,m,r,f)}}Kt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||$(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&$(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Yt(e,!!n,n?[]:``,!1):Yt(e,!!n,t,!0)):Yt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:$(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&$(e,t,s,a,r,o)}Xt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:$(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:$(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&$(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:$(e,t,u,p,r,m)}return;default:if(nn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&$(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||$(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(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 Hd(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 Ud(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 Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[xt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(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`:ef(n),St(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[xt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(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 lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(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 ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);St(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=D.d;D.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=bu();return e||t}function yf(e){var t=wt(e);t!==null&&t.tag===5&&t.type===`form`?ks(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Gt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),j(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Gt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Gt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Gt(n.imageSizes)+`"]`)):i+=`[href="`+Gt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),j(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Gt(r)+`"][href="`+Gt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),j(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=Et(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);j(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=Et(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),j(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=Et(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),j(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=ge.current)?gf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=Et(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=Et(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=Et(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+Gt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),j(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Gt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Gt(n.href)+`"]`);if(r)return t.instance=r,j(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),j(r),Pd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,j(o),o;r=Mf(n),(a=mf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),j(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,j(a),a):(r=n,(a=mf.get(o))&&(r=h({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),j(a),Pd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[xt]||a[mt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(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 Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,j(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),j(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=rt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rt(0),this.hiddenUpdates=rt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=hi(3,null,null,t),e.current=a,a.stateNode=e,t=pa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ka(a),e}function tp(e){return e?(e=pi,e):pi}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ja(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ya(e,r,t),n!==null&&(hu(n,e,t),Xa(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=ui(e,67108864);t!==null&&hu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=pu();t=lt(t);var n=ui(e,t);n!==null&&hu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=E.T;E.T=null;var a=D.p;try{D.p=2,up(e,t,n,r)}finally{D.p=a,E.T=i}}function lp(e,t,n,r){var i=E.T;E.T=null;var a=D.p;try{D.p=8,up(e,t,n,r)}finally{D.p=a,E.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)wd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=wt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=$e(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ke(o);s.entanglements[1]|=c,o&=~c}rd(a),!(G&6)&&(tu=Pe()+500,id(0,!1))}}break;case 31:case 13:s=ui(a,2),s!==null&&hu(s,a,2),bu(),ip(a,2)}if(a=dp(r),a===null&&wd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function dp(e){return e=ln(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=Ct(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(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`resize`: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`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`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Fe()){case Ie:return 2;case Le:return 8;case Re:case ze:return 32;case Be:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`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 Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=wt(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=Ct(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,ft(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,ft(e.priority,function(){op(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 Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);cn=r,n.target.dispatchEvent(r),cn=null}else return t=wt(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=wt(n);a!==null&&(e.splice(t,3),t-=3,Ds(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ht]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ht]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,pu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),bu(),t[gt]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=dt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.7`)throw Error(i(527,Lp,`19.2.7`));D.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:E,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Ue=zp.inject(Rp),We=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Xs,s=Zs,c=Qs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[gt]=t.current,Sd(e),new Fp(t)}})),g=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=c(f()),v=g();function y(e,t){if(typeof e.__bridgeApiOrigin==`string`&&e.__bridgeApiOrigin)return e.__bridgeApiOrigin;let n=typeof t.origin==`string`&&t.origin?t.origin:``,r=(typeof t.pathname==`string`?t.pathname:``).split(`/`).filter(Boolean)[0]??``;return n?r?`${n}/${r}`:n:``}function b(){return typeof window<`u`?y(window,window.location):``}function x(e){return`${b()}${e}`}async function S(e,t){let n=await fetch(x(e),t);if(!n.ok)throw Error(`${e}_failed:${n.status}`);return await n.json()}async function C(e,t){let n=await fetch(x(e),t);if(n.status===404)return null;if(!n.ok)throw Error(`${e}_failed:${n.status}`);return await n.json()}async function w(){return await S(`/api/status`)}async function ee(){return await S(`/api/providers/status`)}async function T(){return await S(`/api/tunnel/status`)}async function te(e,t){let n=new URLSearchParams;e&&n.set(`path`,e),t&&n.set(`keep`,t);let r=n.toString();return await S(`/api/fs/list${r?`?${r}`:``}`)}async function ne(){return await S(`/api/channel/state`)}async function re(e){await S(`/api/channel/plugins/enable`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({plugin_id:`weixin`,config:{...e.baseUrl?{baseUrl:e.baseUrl}:{},credentials:{account_id:e.accountId,bot_token:e.botToken,...e.baseUrl?{baseUrl:e.baseUrl}:{}}}})})}async function ie(){await S(`/api/channel/plugins/disable`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({plugin_id:`weixin`})})}async function ae(){return await C(`/api/channel/current-session`)||((await C(`/api/channel/sessions`))?.[0]??null)}async function oe(e,t){let n=new URLSearchParams;typeof t?.limit==`number`&&t.limit>0&&n.set(`limit`,String(t.limit)),t?.cursor&&n.set(`cursor`,t.cursor);let r=n.size>0?`?${n.toString()}`:``,i=await S(`/api/channel/providers/${encodeURIComponent(e)}/recoverable-sessions${r}`);return Array.isArray(i)?{items:i,nextCursor:null}:i}async function se(e){await S(`/api/channel/sessions/attach`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)})}async function ce(e){await S(`/api/channel/sessions/new`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)})}async function le(){return await S(`/api/settings`)}var E=Object.defineProperty,D=Object.getOwnPropertySymbols,ue=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable,fe=(e,t,n)=>t in e?E(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pe=(e,t)=>{for(var n in t||={})ue.call(t,n)&&fe(e,n,t[n]);if(D)for(var n of D(t))de.call(t,n)&&fe(e,n,t[n]);return e},O=(e,t)=>{var n={};for(var r in e)ue.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&D)for(var r of D(e))t.indexOf(r)<0&&de.call(e,r)&&(n[r]=e[r]);return n},k;(e=>{let t=class t{constructor(e,n,r,a){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version value out of range`);if(a<-1||a>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let o=[];for(let e=0;e<this.size;e++)o.push(!1);for(let e=0;e<this.size;e++)this.modules.push(o.slice()),this.isFunction.push(o.slice());this.drawFunctionPatterns();let s=this.addEccAndInterleave(r);if(this.drawCodewords(s),a==-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(a=t,e=n),this.applyMask(t)}}i(0<=a&&a<=7),this.mask=a,this.applyMask(a),this.drawFormatBits(a),this.isFunction=[]}static encodeText(n,r){let i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,r)}static encodeBinary(n,r){let i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],r)}static encodeSegments(e,r,a=1,s=40,c=-1,l=!0){if(!(t.MIN_VERSION<=a&&a<=s&&s<=t.MAX_VERSION)||c<-1||c>7)throw RangeError(`Invalid value`);let u,d;for(u=a;;u++){let n=t.getNumDataCodewords(u,r)*8,i=o.getTotalBits(e,u);if(i<=n){d=i;break}if(u>=s)throw RangeError(`Data too long`)}for(let e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&d<=t.getNumDataCodewords(u,e)*8&&(r=e);let f=[];for(let t of e){n(t.mode.modeBits,4,f),n(t.numChars,t.mode.numCharCountBits(u),f);for(let e of t.getData())f.push(e)}i(f.length==d);let p=t.getNumDataCodewords(u,r)*8;i(f.length<=p),n(0,Math.min(4,p-f.length),f),n(0,(8-f.length%8)%8,f),i(f.length%8==0);for(let e=236;f.length<p;e^=253)n(e,8,f);let m=[];for(;m.length*8<f.length;)m.push(0);return f.forEach((e,t)=>m[t>>>3]|=e<<7-(t&7)),new t(u,r,m,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n==0&&r==0||n==0&&r==t-1||n==t-1&&r==0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.errorCorrectionLevel.formatBits<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let a=(t<<10|n)^21522;i(a>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,r(a,e));this.setFunctionModule(8,7,r(a,6)),this.setFunctionModule(8,8,r(a,7)),this.setFunctionModule(7,8,r(a,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,r(a,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,r(a,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,r(a,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;i(t>>>18==0);for(let e=0;e<18;e++){let n=r(t,e),i=this.size-11+e%3,a=Math.floor(e/3);this.setFunctionModule(i,a,n),this.setFunctionModule(a,i,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;0<=a&&a<this.size&&0<=o&&o<this.size&&this.setFunctionModule(a,o,i!=2&&i!=4)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!=1)}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){let n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw RangeError(`Invalid argument`);let a=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],o=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],s=Math.floor(t.getNumRawDataModules(n)/8),c=a-s%a,l=Math.floor(s/a),u=[],d=t.reedSolomonComputeDivisor(o);for(let n=0,r=0;n<a;n++){let i=e.slice(r,r+l-o+(n<c?0:1));r+=i.length;let a=t.reedSolomonComputeRemainder(i,d);n<c&&i.push(0),u.push(i.concat(a))}let f=[];for(let e=0;e<u[0].length;e++)u.forEach((t,n)=>{(e!=l-o||n>=c)&&f.push(t[e])});return i(f.length==s),f}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw RangeError(`Invalid argument`);let n=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let i=0;i<this.size;i++)for(let a=0;a<2;a++){let o=t-a,s=t+1&2?i:this.size-1-i;!this.isFunction[s][o]&&n<e.length*8&&(this.modules[s][o]=r(e[n>>>3],7-(n&7)),n++)}}i(n==e.length*8)}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[n][o]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[n][o],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[o][n]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[o][n],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){let i=this.modules[n][r];i==this.modules[n][r+1]&&i==this.modules[n+1][r]&&i==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(let e of this.modules)n=e.reduce((e,t)=>e+ +!!t,n);let r=this.size*this.size,a=Math.ceil(Math.abs(n*20-r*10)/r)-1;return i(0<=a&&a<=9),e+=a*t.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{let e=Math.floor(this.version/7)+2,t=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version number out of range`);let n=(16*e+128)*e+64;if(e>=2){let t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return i(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let i=0;i<e;i++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map(e=>0);for(let i of e){let e=i^r.shift();r.push(0),n.forEach((n,i)=>r[i]^=t.reedSolomonMultiply(n,e))}return r}static reedSolomonMultiply(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return i(n>>>8==0),n}finderPenaltyCountPatterns(e){let t=e[1];i(t<=this.size*3);let n=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function r(e,t){return(e>>>t&1)!=0}function i(e){if(!e)throw Error(`Assertion error`)}let a=class e{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}static makeBytes(t){let r=[];for(let e of t)n(e,8,r);return new e(e.Mode.BYTE,t.length,r)}static makeNumeric(t){if(!e.isNumeric(t))throw RangeError(`String contains non-numeric characters`);let r=[];for(let e=0;e<t.length;){let i=Math.min(t.length-e,3);n(parseInt(t.substring(e,e+i),10),i*3+1,r),e+=i}return new e(e.Mode.NUMERIC,t.length,r)}static makeAlphanumeric(t){if(!e.isAlphanumeric(t))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let r=[],i;for(i=0;i+2<=t.length;i+=2){let a=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i))*45;a+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i+1)),n(a,11,r)}return i<t.length&&n(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i)),6,r),new e(e.Mode.ALPHANUMERIC,t.length,r)}static makeSegments(t){return t==``?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let r=[];if(t<0)throw RangeError(`ECI assignment value out of range`);if(t<128)n(t,8,r);else if(t<16384)n(2,2,r),n(t,14,r);else if(t<1e6)n(6,3,r),n(t,21,r);else throw RangeError(`ECI assignment value out of range`);return new e(e.Mode.ECI,0,r)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(let r of e){let e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)==`%`?(t.push(parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}};a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`;let o=a;e.QrSegment=a})(k||={}),(e=>{(e=>{let t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),e.Ecc=t})(e.QrCode||={})})(k||={}),(e=>{(e=>{let t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),e.Mode=t})(e.QrSegment||={})})(k||={});var me=k,he={L:me.QrCode.Ecc.LOW,M:me.QrCode.Ecc.MEDIUM,Q:me.QrCode.Ecc.QUARTILE,H:me.QrCode.Ecc.HIGH},ge=128,_e=`L`,ve=`#FFFFFF`,ye=`#000000`,be=!1,xe=1,Se=4,Ce=0,we=.1;function Te(e,t=0){let n=[];return e.forEach(function(e,r){let i=null;e.forEach(function(a,o){if(!a&&i!==null){n.push(`M${i+t} ${r+t}h${o-i}v1H${i+t}z`),i=null;return}if(o===e.length-1){if(!a)return;i===null?n.push(`M${o+t},${r+t} h1v1H${o+t}z`):n.push(`M${i+t},${r+t} h${o+1-i}v1H${i+t}z`);return}a&&i===null&&(i=o)})}),n.join(``)}function Ee(e,t){return e.slice().map((e,n)=>n<t.y||n>=t.y+t.h?e:e.map((e,n)=>n<t.x||n>=t.x+t.w?e:!1))}function De(e,t,n,r){if(r==null)return null;let i=e.length+n*2,a=Math.floor(t*we),o=i/t,s=(r.width||a)*o,c=(r.height||a)*o,l=r.x==null?e.length/2-s/2:r.x*o,u=r.y==null?e.length/2-c/2:r.y*o,d=r.opacity==null?1:r.opacity,f=null;if(r.excavate){let e=Math.floor(l),t=Math.floor(u);f={x:e,y:t,w:Math.ceil(s+l-e),h:Math.ceil(c+u-t)}}let p=r.crossOrigin;return{x:l,y:u,h:c,w:s,excavation:f,opacity:d,crossOrigin:p}}function Oe(e,t){return t==null?e?Se:Ce:Math.max(Math.floor(t),0)}function ke({value:e,level:t,minVersion:n,includeMargin:r,marginSize:i,imageSettings:a,size:o,boostLevel:s}){let c=_.useMemo(()=>{let r=(Array.isArray(e)?e:[e]).reduce((e,t)=>(e.push(...me.QrSegment.makeSegments(t)),e),[]);return me.QrCode.encodeSegments(r,he[t],n,void 0,void 0,s)},[e,t,n,s]),{cells:l,margin:u,numCells:d,calculatedImageSettings:f}=_.useMemo(()=>{let e=c.getModules(),t=Oe(r,i);return{cells:e,margin:t,numCells:e.length+t*2,calculatedImageSettings:De(e,o,t,a)}},[c,o,a,r,i]);return{qrcode:c,margin:u,cells:l,numCells:d,calculatedImageSettings:f}}var Ae=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),je=_.forwardRef(function(e,t){let n=e,{value:r,size:i=ge,level:a=_e,bgColor:o=ve,fgColor:s=ye,includeMargin:c=be,minVersion:l=xe,boostLevel:u,marginSize:d,imageSettings:f}=n,p=O(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`marginSize`,`imageSettings`]),{style:m}=p,h=O(p,[`style`]),g=f?.src,v=_.useRef(null),y=_.useRef(null),b=_.useCallback(e=>{v.current=e,typeof t==`function`?t(e):t&&(t.current=e)},[t]),[x,S]=_.useState(!1),{margin:C,cells:w,numCells:ee,calculatedImageSettings:T}=ke({value:r,level:a,minVersion:l,boostLevel:u,includeMargin:c,marginSize:d,imageSettings:f,size:i});_.useEffect(()=>{if(v.current!=null){let e=v.current,t=e.getContext(`2d`);if(!t)return;let n=w,r=y.current,a=T!=null&&r!==null&&r.complete&&r.naturalHeight!==0&&r.naturalWidth!==0;a&&T.excavation!=null&&(n=Ee(w,T.excavation));let c=window.devicePixelRatio||1;e.height=e.width=i*c;let l=i/ee*c;t.scale(l,l),t.fillStyle=o,t.fillRect(0,0,ee,ee),t.fillStyle=s,Ae?t.fill(new Path2D(Te(n,C))):w.forEach(function(e,n){e.forEach(function(e,r){e&&t.fillRect(r+C,n+C,1,1)})}),T&&(t.globalAlpha=T.opacity),a&&t.drawImage(r,T.x+C,T.y+C,T.w,T.h)}}),_.useEffect(()=>{S(!1)},[g]);let te=pe({height:i,width:i},m),ne=null;return g!=null&&(ne=_.createElement(`img`,{src:g,key:g,style:{display:`none`},onLoad:()=>{S(!0)},ref:y,crossOrigin:T?.crossOrigin})),_.createElement(_.Fragment,null,_.createElement(`canvas`,pe({style:te,height:i,width:i,ref:b,role:`img`},h)),ne)});je.displayName=`QRCodeCanvas`;var Me=_.forwardRef(function(e,t){let n=e,{value:r,size:i=ge,level:a=_e,bgColor:o=ve,fgColor:s=ye,includeMargin:c=be,minVersion:l=xe,boostLevel:u,title:d,marginSize:f,imageSettings:p}=n,m=O(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`title`,`marginSize`,`imageSettings`]),{margin:h,cells:g,numCells:v,calculatedImageSettings:y}=ke({value:r,level:a,minVersion:l,boostLevel:u,includeMargin:c,marginSize:f,imageSettings:p,size:i}),b=g,x=null;p!=null&&y!=null&&(y.excavation!=null&&(b=Ee(g,y.excavation)),x=_.createElement(`image`,{href:p.src,height:y.h,width:y.w,x:y.x+h,y:y.y+h,preserveAspectRatio:`none`,opacity:y.opacity,crossOrigin:y.crossOrigin}));let S=Te(b,h);return _.createElement(`svg`,pe({height:i,width:i,viewBox:`0 0 ${v} ${v}`,ref:t,role:`img`},m),!!d&&_.createElement(`title`,null,d),_.createElement(`path`,{fill:o,d:`M0,0 h${v}v${v}H0z`,shapeRendering:`crispEdges`}),_.createElement(`path`,{fill:s,d:S,shapeRendering:`crispEdges`}),x)});Me.displayName=`QRCodeSVG`;async function Ne(e,t){let n=e.getReader(),r;for(;!(r=await n.read()).done;)t(r.value)}function Pe(e){let t,n,r,i=!1;return function(a){t===void 0?(t=a,n=0,r=-1):t=Ie(t,a);let o=t.length,s=0;for(;n<o;){i&&=(t[n]===10&&(s=++n),!1);let a=-1;for(;n<o&&a===-1;++n)switch(t[n]){case 58:r===-1&&(r=n-s);break;case 13:i=!0;case 10:a=n;break}if(a===-1)break;e(t.subarray(s,a),r),s=n,r=-1}s===o?t=void 0:s!==0&&(t=t.subarray(s),n-=s)}}function Fe(e,t,n){let r=Le(),i=new TextDecoder;return function(a,o){if(a.length===0)n?.(r),r=Le();else if(o>0){let n=i.decode(a.subarray(0,o)),s=o+(a[o+1]===32?2:1),c=i.decode(a.subarray(s));switch(n){case`data`:r.data=r.data?r.data+`
10
10
  `+c:c;break;case`event`:r.event=c;break;case`id`:e(r.id=c);break;case`retry`:let n=parseInt(c,10);isNaN(n)||t(r.retry=n);break}}}}function Ie(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function Le(){return{data:``,event:``,id:``,retry:void 0}}var Re=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},ze=`text/event-stream`,Be=1e3,Ve=`last-event-id`;function He(e,t){var{signal:n,headers:r,onopen:i,onmessage:a,onclose:o,onerror:s,openWhenHidden:c,fetch:l}=t,u=Re(t,[`signal`,`headers`,`onopen`,`onmessage`,`onclose`,`onerror`,`openWhenHidden`,`fetch`]);return new Promise((t,d)=>{let f=Object.assign({},r);f.accept||=ze;let p;function m(){p.abort(),document.hidden||b()}c||document.addEventListener(`visibilitychange`,m);let h=Be,g=0;function _(){document.removeEventListener(`visibilitychange`,m),window.clearTimeout(g),p.abort()}n?.addEventListener(`abort`,()=>{_(),t()});let v=l??window.fetch,y=i??Ue;async function b(){p=new AbortController;try{let n=await v(e,Object.assign(Object.assign({},u),{headers:f,signal:p.signal}));await y(n),await Ne(n.body,Pe(Fe(e=>{e?f[Ve]=e:delete f[Ve]},e=>{h=e},a))),o?.(),_(),t()}catch(e){if(!p.signal.aborted)try{let t=s?.(e)??h;window.clearTimeout(g),g=window.setTimeout(b,t)}catch(e){_(),d(e)}}}b()})}function Ue(e){let t=e.headers.get(`content-type`);if(!t?.startsWith(`text/event-stream`))throw Error(`Expected content-type to be ${ze}, Actual: ${t}`)}var We=new Set,Ge=null,Ke=null,qe=500;function Je(e){for(let t of We)try{t(e)}catch{}}function Ye(){if(Ge)return;let e=new AbortController;Ge=e,He(x(`/api/bridge-events`),{method:`POST`,signal:e.signal,openWhenHidden:!0,onmessage(e){if(!e.data)return;let t;try{t=JSON.parse(e.data)}catch{return}t.type===`connected`||t.type===`ping`||Je(t)},onerror(e){throw e}}).catch(()=>{Ge===e&&(Ge=null),We.size>0&&setTimeout(Ye,2e3)})}function Xe(e){return Ke&&=(clearTimeout(Ke),null),We.add(e),Ye(),()=>{We.delete(e),We.size===0&&(Ke&&clearTimeout(Ke),Ke=setTimeout(()=>{Ke=null,!(We.size>0)&&(Ge?.abort(),Ge=null)},qe))}}var Ze=`直接发送文字即可与 AI 对话。`,Qe=[{title:`会话管理`,entries:[{command:`/help`,desc:`显示本帮助`},{command:`/status`,desc:`查看当前会话(provider、工作目录、状态)`},{command:`/new`,desc:`按当前 provider 新建会话`},{command:`/new claude|codex`,desc:`新建指定 provider 会话`},{command:`/new <目录>`,desc:`在指定目录按当前 provider 新建会话`},{command:`/new claude:<目录>`,desc:`新建指定 provider + 指定目录会话`},{command:`/stop`,desc:`中断当前正在生成的回复(会话保留)`}]},{title:`历史会话`,entries:[{command:`/sessions`,desc:`列出最近的历史会话第 1 页(按更新时间倒序)`},{command:`/sessions p2`,desc:"查看第 2 页;页码语法固定为 `p<number>`"},{command:`/sessions <关键词>`,desc:`按标题/目录筛选,第 1 页`},{command:`/sessions <关键词> p2`,desc:`查看筛选结果的第 2 页`},{command:`/resume <编号>`,desc:`按 /sessions 列表编号恢复(也可直接用会话 id)`}]}],$e=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),A=o(((e,t)=>{t.exports=$e()}))(),et=`/`;function tt(e){let t=e.split(`/`).filter(Boolean),n=[],r=``;for(let e of t)r+=`/`+e,n.push(r);return n}function nt(e){let{value:t,onChange:n,showHeader:r=!0}=e,[i,a]=(0,_.useState)({}),[o,s]=(0,_.useState)(()=>new Set),[c,l]=(0,_.useState)(()=>new Set),[u,d]=(0,_.useState)(null),f=(0,_.useRef)(null),p=(0,_.useRef)(null),m=(0,_.useRef)(!1),h=(0,_.useCallback)((e,t)=>{l(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})},[]),g=(0,_.useCallback)(async e=>{h(e,!0);try{let n=await te(e,t||void 0);a(e=>({...e,[n.path]:n})),d(null)}catch{d(`无法读取该目录`)}finally{h(e,!1)}},[h,t]);(0,_.useEffect)(()=>{(async()=>{if(await g(et),t&&t.startsWith(`/`)){let e=tt(t);s(t=>new Set([...t,...e])),await Promise.all(e.map(e=>g(e)))}})()},[]);let v=(0,_.useCallback)(e=>{s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):(n.add(e),i[e]||g(e)),n})},[i,g]);(0,_.useEffect)(()=>{if(m.current)return;let e=f.current,t=p.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();e.scrollTop+=r.top-n.top-(e.clientHeight-t.clientHeight)/2,m.current=!0});let y=(e,r)=>{let a=o.has(e.path),s=e.path===t,l=i[e.path];return(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`div`,{ref:s?p:void 0,className:`dir-tree-row d-flex align-items-center gap-1 ${s?`dir-tree-row-selected`:``}`,style:{paddingLeft:6+r*16},children:[(0,A.jsx)(`button`,{type:`button`,className:`dir-tree-chevron btn btn-sm p-0 border-0 bg-transparent d-inline-flex`,onClick:()=>v(e.path),"aria-label":a?`折叠`:`展开`,children:(0,A.jsx)(`i`,{className:`bi ${a?`bi-chevron-down`:`bi-chevron-right`}`})}),(0,A.jsxs)(`button`,{type:`button`,className:`dir-tree-name btn btn-sm p-0 border-0 bg-transparent d-inline-flex align-items-center gap-1 text-truncate`,onClick:()=>n(e.path),title:e.path,children:[(0,A.jsx)(`i`,{className:`bi ${a?`bi-folder2-open`:`bi-folder`}`}),(0,A.jsx)(`span`,{className:`text-truncate`,children:e.name})]})]}),a?c.has(e.path)?(0,A.jsx)(`div`,{className:`text-muted-soft small`,style:{paddingLeft:6+(r+1)*16},children:`加载中…`}):l?l.entries.length?l.entries.map(e=>y(e,r+1)):(0,A.jsx)(`div`,{className:`text-muted-soft small`,style:{paddingLeft:6+(r+1)*16},children:`(无子目录)`}):null:null]},e.path)},b=i[et];return(0,A.jsxs)(`div`,{className:`dir-tree w-100`,children:[r?(0,A.jsxs)(`div`,{className:`dir-tree-head d-flex align-items-center gap-2 mb-1`,children:[(0,A.jsx)(`i`,{className:`bi bi-hdd flex-shrink-0 text-muted-soft`}),(0,A.jsx)(`span`,{className:`font-monospace small text-truncate`,title:t||``,children:t||`(未选择目录)`})]}):null,(0,A.jsx)(`div`,{ref:f,className:`dir-tree-body border rounded`,style:{maxHeight:220,overflowY:`auto`,padding:4},children:u?(0,A.jsx)(`div`,{className:`text-danger small px-1`,children:u}):b?b.entries.length?b.entries.map(e=>y(e,0)):(0,A.jsx)(`div`,{className:`text-muted-soft small px-1`,children:`(无子目录)`}):(0,A.jsx)(`div`,{className:`text-muted-soft small px-1`,children:`加载中…`})})]})}var rt=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),it=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),at=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),ot=e=>{let t=at(e);return t.charAt(0).toUpperCase()+t.slice(1)},st={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ct=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},lt=(0,_.createContext)({}),ut=()=>(0,_.useContext)(lt),dt=(0,_.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=ut()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,_.createElement)(`svg`,{ref:c,...st,width:t??l??st.width,height:t??l??st.height,stroke:e??f,strokeWidth:m,className:rt(`lucide`,p,i),...!a&&!ct(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),ft=(e,t)=>{let n=(0,_.forwardRef)(({className:n,...r},i)=>(0,_.createElement)(dt,{ref:i,iconNode:t,className:rt(`lucide-${it(ot(e))}`,`lucide-${e}`,n),...r}));return n.displayName=ot(e),n},pt=ft(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),mt=ft(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),ht=ft(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]);function gt(e){let{value:t,onChange:n,ariaLabel:r}=e,[i,a]=(0,_.useState)(!1),o=(0,_.useRef)(null);return(0,_.useEffect)(()=>{if(!i)return;let e=e=>{o.current&&!o.current.contains(e.target)&&a(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[i]),(0,A.jsxs)(`div`,{className:`dir-picker position-relative w-100`,ref:o,children:[(0,A.jsxs)(`button`,{type:`button`,className:`form-control form-control-sm d-flex align-items-center gap-2 text-start`,onClick:()=>a(e=>!e),title:t||``,"aria-label":r,"aria-expanded":i,children:[(0,A.jsx)(ht,{size:16,className:`text-muted-soft flex-shrink-0`}),(0,A.jsx)(`span`,{className:`font-monospace text-truncate flex-grow-1`,children:t||`选择工作目录…`}),i?(0,A.jsx)(mt,{size:16,className:`flex-shrink-0`}):(0,A.jsx)(pt,{size:16,className:`flex-shrink-0`})]}),i?(0,A.jsx)(`div`,{className:`dir-picker-pop position-absolute bg-white border rounded shadow-sm p-2`,style:{zIndex:1050,left:0,right:0,top:`100%`,marginTop:4},children:(0,A.jsx)(nt,{value:t,showHeader:!1,onChange:e=>{n(e),a(!1)}})}):null]})}var _t={minWidth:0,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`};function vt(e){return e?.enabled===!0&&e.connected===!0}function yt(e){return e?.enabled?e.connected?`已连接`:e.status===`session_timeout`?`会话超时`:e.status===`connecting`?`连接中`:e.status===`poll_error`?`轮询异常`:`未连接`:`未连接`}function bt(e){return vt(e)?`badge-solid-success`:e?.status===`session_timeout`||e?.status===`poll_error`?`badge-solid-error`:e?.status===`connecting`?`badge-soft-accent`:`badge-soft-neutral`}function xt(e){return e?.enabled?e.status===`session_timeout`?`微信 bot 会话已失效,请重新扫码登录以刷新 token。`:e.status===`poll_error`?`微信消息轮询异常,请检查网络或重新扫码登录。`:e.status===`connecting`?`微信通道正在建立轮询连接。`:null:null}function St(e){switch(e){case`running`:case`active`:return{icon:`🟢`,label:`运行中`,badgeClass:`badge-solid-success`};case`starting`:return{icon:`⏳`,label:`启动中`,badgeClass:`badge-soft-accent`};case`idle`:return{icon:`✅`,label:`就绪`,badgeClass:`badge-soft-success`};case`accepted`:return{icon:`✅`,label:`已就绪`,badgeClass:`badge-soft-success`};case`error`:case`failed`:return{icon:`❌`,label:`异常`,badgeClass:`badge-solid-error`};default:return{icon:`🟡`,label:e,badgeClass:`badge-soft-neutral`}}}function Ct(e,t=Date.now()){if(!e)return`-`;let n=t-e;if(!Number.isFinite(n))return`-`;if(n<0)return`刚刚`;let r=Math.floor(n/1e3);if(r<10)return`刚刚`;if(r<60)return`${r}秒前`;let i=Math.floor(r/60);if(i<60)return`${i}分钟前`;let a=Math.floor(i/60);if(a<24)return`${a}小时前`;let o=Math.floor(a/24);if(o<30)return`${o}天前`;let s=Math.floor(o/30);return s<12?`${s}个月前`:`${Math.floor(o/365)}年前`}function wt(e){if(!e||typeof e!=`object`)return null;let t=e;return typeof t.command==`string`&&t.command?t.command:null}function Tt(e){if(!e||typeof e!=`object`)return`未知`;let t=e;return t.detected===!0?typeof t.version==`string`&&t.version?`v${t.version}`:`已检测`:t.reason===`missing_binary`?`未找到可执行文件`:t.reason===`command_failed`?`命令执行失败`:typeof t.reason==`string`&&t.reason?String(t.reason):`未知`}function Et(e){if(!e||typeof e!=`object`)return`neutral`;let t=e;return t.detected===!0?`success`:typeof t.reason==`string`&&t.reason?`warning`:`neutral`}function j(e){return e===`success`?`status-dot-success`:e===`warning`?`status-dot-warning`:`status-dot-neutral`}function Dt(e){return e?e.status===`running`||e.status===`active`?`success`:e.status===`error`||e.status===`failed`?`warning`:`neutral`:`neutral`}function Ot(e){let t=vt(e.plugin),n=t?`success`:`neutral`,r=e.loginState===`loading_qr`?`正在加载二维码...`:e.plugin?.status===`session_timeout`?`重新扫码登录`:`扫码登录`;return(0,A.jsx)(`div`,{className:`soft-card channel-strip mb-2`,children:(0,A.jsxs)(`div`,{className:`d-flex align-items-center gap-2 flex-wrap`,children:[(0,A.jsx)(`span`,{className:`status-dot ${j(n)}`}),(0,A.jsx)(`span`,{className:`fw-semibold`,children:`微信通道`}),(0,A.jsx)(`span`,{className:`badge ${bt(e.plugin)}`,children:yt(e.plugin)}),e.activeUser?(0,A.jsxs)(`span`,{className:`channel-meta d-flex align-items-center gap-1`,children:[(0,A.jsx)(`span`,{className:`text-muted-soft small`,children:`当前活跃用户`}),(0,A.jsx)(`span`,{className:`small`,style:_t,title:e.activeUser.displayName??e.activeUser.platformUserId,children:e.activeUser.displayName??e.activeUser.platformUserId})]}):null,e.activeUser&&e.quota?(0,A.jsxs)(`span`,{className:`channel-meta d-flex align-items-center gap-1`,children:[(0,A.jsx)(`span`,{className:`text-muted-soft small`,children:`推送额度`}),(0,A.jsx)(`span`,{className:`small`,title:`iLink 限制:每个 24h 窗口内 bot 最多主动推送 10 条;用户在微信回条消息即可重置窗口与额度`,children:kt(e.quota)})]}):null,e.gateway?(0,A.jsxs)(`span`,{className:`channel-meta d-flex align-items-center gap-1`,style:{minWidth:0},children:[(0,A.jsx)(`span`,{className:`text-muted-soft small`,children:`网关`}),(0,A.jsx)(`span`,{className:`font-monospace text-muted-soft small`,style:{..._t,maxWidth:220},title:e.gateway,children:e.gateway})]}):null,(0,A.jsx)(`span`,{className:`ms-auto`,children:t?(0,A.jsx)(`button`,{className:`btn btn-sm btn-outline-danger`,disabled:e.busy,onClick:e.onDisconnect,type:`button`,children:e.busy?`断开中...`:`断开连接`}):(0,A.jsx)(`button`,{className:`btn btn-sm btn-accent`,disabled:e.loginState===`loading_qr`,onClick:e.onLogin,type:`button`,children:r})})]})})}function kt(e){if(e.expired||e.windowEndsAt===0)return`已用尽 · 请在微信回条消息恢复`;let t=Math.max(0,Math.round((e.windowEndsAt-Date.now())/(3600*1e3)));return`剩 ${e.remaining}/${e.limit} · 窗口约 ${t}h`}function At(e){let[t,n]=(0,_.useState)(e.defaultCwd),r=(0,_.useRef)(!1);(0,_.useEffect)(()=>{r.current||n(e.defaultCwd)},[e.defaultCwd]);let i=()=>{let n=t.trim();n&&e.onCreate?.(n)},a=e.active&&e.session?Dt(e.session):Et(e.providerInfo),o=wt(e.providerInfo);return(0,A.jsxs)(`div`,{className:`soft-card engine-bay ${e.active?`engine-bay-active`:``}`,style:{padding:14},children:[(0,A.jsxs)(`div`,{className:`d-flex align-items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`status-dot ${j(a)}`}),(0,A.jsx)(`span`,{className:`fw-semibold`,style:{fontSize:15},children:e.name}),(0,A.jsx)(`span`,{className:`badge badge-soft-accent`,children:Tt(e.providerInfo)}),e.active&&e.session?(()=>{let t=St(e.session.status);return(0,A.jsxs)(`span`,{className:`badge ${t.badgeClass} ms-auto d-inline-flex align-items-center gap-1`,children:[(0,A.jsx)(`span`,{"aria-hidden":`true`,children:t.icon}),t.label]})})():(0,A.jsxs)(`span`,{className:`badge badge-soft-neutral ms-auto d-inline-flex align-items-center gap-1`,children:[(0,A.jsx)(`span`,{"aria-hidden":`true`,children:`💤`}),`待命`]})]}),o?(0,A.jsx)(`div`,{className:`font-monospace text-muted-soft small mt-2`,style:_t,title:o,children:o}):null,e.active&&e.session?(0,A.jsxs)(`div`,{className:`engine-session-detail mt-2 pt-2 d-flex flex-column gap-1`,children:[(0,A.jsx)(`div`,{className:`text-muted-soft small`,children:`当前会话`}),(0,A.jsxs)(`div`,{className:`d-flex justify-content-between align-items-center gap-3`,children:[(0,A.jsx)(`span`,{className:`text-muted-soft small flex-shrink-0`,children:`会话 ID`}),(0,A.jsx)(`span`,{className:`font-monospace small`,style:_t,title:e.session.providerSessionId??`-`,children:e.session.providerSessionId??`-`})]}),(0,A.jsxs)(`div`,{className:`d-flex justify-content-between align-items-center gap-3`,children:[(0,A.jsx)(`span`,{className:`text-muted-soft small flex-shrink-0`,children:`工作目录`}),(0,A.jsx)(`span`,{className:`font-monospace small`,style:_t,title:e.session.cwd,children:e.session.cwd})]}),e.session.nativeTitle??e.session.resumeTitle?(0,A.jsxs)(`div`,{className:`d-flex justify-content-between align-items-center gap-3`,children:[(0,A.jsx)(`span`,{className:`text-muted-soft small flex-shrink-0`,children:`标题`}),(0,A.jsx)(`span`,{className:`small`,style:_t,title:e.session.nativeTitle??e.session.resumeTitle,children:e.session.nativeTitle??e.session.resumeTitle})]}):null,(0,A.jsxs)(`div`,{className:`text-muted-soft small`,children:[`创建 `,Ct(e.session.createdAt),` · 最后活跃 `,Ct(e.session.lastActivityAt)]})]}):e.lastSession?(0,A.jsxs)(`div`,{className:`engine-session-detail mt-2 pt-2 d-flex flex-column gap-1`,children:[(0,A.jsx)(`div`,{className:`text-muted-soft small`,children:`最近会话`}),(0,A.jsxs)(`div`,{className:`d-flex justify-content-between align-items-center gap-3`,children:[(0,A.jsx)(`span`,{className:`text-muted-soft small flex-shrink-0`,children:`会话 ID`}),(0,A.jsx)(`span`,{className:`font-monospace small`,style:_t,title:e.lastSession.providerSessionId,children:e.lastSession.providerSessionId})]}),(0,A.jsxs)(`div`,{className:`d-flex justify-content-between align-items-center gap-3`,children:[(0,A.jsx)(`span`,{className:`text-muted-soft small flex-shrink-0`,children:`工作目录`}),(0,A.jsx)(`span`,{className:`font-monospace small`,style:_t,title:e.lastSession.cwd,children:e.lastSession.cwd})]}),(0,A.jsxs)(`div`,{className:`text-muted-soft small`,children:[`最后活跃 `,Ct(e.lastSession.updatedAt)]})]}):null,e.canCreate?(0,A.jsxs)(`div`,{className:`engine-create mt-2 pt-2 d-flex flex-column gap-2`,children:[(0,A.jsx)(gt,{value:t,ariaLabel:`${e.name} 工作目录`,onChange:e=>{r.current=!0,n(e)}}),(0,A.jsxs)(`button`,{className:`engine-create-btn d-inline-flex align-items-center align-self-end flex-shrink-0`,disabled:e.creating||!t.trim(),onClick:i,title:e.active?`新开会话`:`新建会话`,"aria-label":e.active?`新开会话`:`新建会话`,type:`button`,children:[(0,A.jsxs)(`svg`,{width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`currentColor`,"aria-hidden":`true`,children:[(0,A.jsx)(`path`,{d:`M6 9a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3A.5.5 0 0 1 6 9M3.854 4.146a.5.5 0 1 0-.708.708L4.793 6.5 3.146 8.146a.5.5 0 1 0 .708.708l2-2a.5.5 0 0 0 0-.708z`}),(0,A.jsx)(`path`,{d:`M2 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2zm12 1a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1z`})]}),(0,A.jsx)(`span`,{children:`新会话`})]})]}):null]})}function jt(e){let t=vt(e.plugin)&&e.currentSession?e.currentSession.providerId===`codex`?`codex`:`claude`:null,n=e.lastProviderSessions??{},r=e.canCreateSession??!1,i=e.defaultWorkspace??``;return(0,A.jsxs)(`div`,{className:`engine-bays mb-2`,children:[(0,A.jsx)(At,{name:`Claude`,providerId:`claude-code`,providerInfo:e.providerStatus?.claude,active:t===`claude`,session:t===`claude`?e.currentSession:null,lastSession:t===`claude`?null:n[`claude-code`]??null,canCreate:r,defaultCwd:t===`claude`?e.currentSession?.cwd??i:n[`claude-code`]?.cwd??i,creating:e.creatingProvider===`claude-code`,onCreate:t=>e.onCreateSession?.(`claude-code`,t)},`claude`),(0,A.jsx)(At,{name:`Codex`,providerId:`codex`,providerInfo:e.providerStatus?.codex,active:t===`codex`,session:t===`codex`?e.currentSession:null,lastSession:t===`codex`?null:n.codex??null,canCreate:r,defaultCwd:t===`codex`?e.currentSession?.cwd??i:n.codex?.cwd??i,creating:e.creatingProvider===`codex`,onCreate:t=>e.onCreateSession?.(`codex`,t)},`codex`)]})}var Mt=10,Nt=100;function Pt(e){return`'${e.replace(/'/g,`'\\''`)}'`}function Ft(e){return`"${e.replace(/"/g,`""`)}"`}function It(e){if(!e.providerResumeCommand)return null;if(!e.cwd?.trim())return e.providerResumeCommand;let t=e.cwd.trim();return/^[A-Za-z]:[\\/]/.test(t)||t.startsWith(`\\\\`)?`cd /d ${Ft(t)} && ${e.providerResumeCommand}`:`cd ${Pt(t)} && ${e.providerResumeCommand}`}function Lt(e,t=Nt){return e.length<=t?e:`${e.slice(0,Math.max(0,t-1))}…`}function Rt(e){let[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)({}),[p,m]=(0,_.useState)([]),[h,g]=(0,_.useState)(null),[v,y]=(0,_.useState)(`help`),[b,S]=(0,_.useState)(`idle`),[C,w]=(0,_.useState)(null),[ee,T]=(0,_.useState)(null),[te,le]=(0,_.useState)(!1),[E,D]=(0,_.useState)(null),[ue,de]=(0,_.useState)(null),[fe,pe]=(0,_.useState)(!1),O=(0,_.useRef)(null),k=(0,_.useCallback)(async()=>{T(null);try{let e=await ne();n(e.activeUser),i(e.quota??null),u(e.settings),c(e.runtimeConfig),f(e.lastProviderSessions??{}),o(e.plugin),vt(e.plugin)?(S(`connected`),w(null)):S(e=>e===`connected`?`idle`:e)}catch(e){T(e instanceof Error?e.message:String(e))}},[]),me=(0,_.useCallback)(async e=>{try{let t=await oe(e,{limit:Mt});m(t.items),g(t.nextCursor)}catch(e){T(e instanceof Error?e.message:String(e))}},[]),he=(0,_.useCallback)(async e=>{if(!(!h||fe)){pe(!0);try{let t=await oe(e,{limit:Mt,cursor:h});m(e=>[...e,...t.items]),g(t.nextCursor)}catch(e){T(e instanceof Error?e.message:String(e))}finally{pe(!1)}}},[fe,h]),ge=(0,_.useCallback)(async t=>{try{await navigator.clipboard.writeText(t),e.onNotice?.(`已复制恢复命令`)}catch(e){T(e instanceof Error?e.message:String(e))}},[e]);(0,_.useEffect)(()=>{k()},[k]),(0,_.useEffect)(()=>{t&&(v===`claude-native`?me(`claude-code`):v===`codex-native`&&me(`codex`))},[v,t,me]),(0,_.useEffect)(()=>Xe(t=>{if(t.type===`channel.user-authorized`){n(zt(t.user)),k();return}if(t.type===`channel.current-session-changed`){ae().then(t=>e.onRefreshCurrentSession?.(t)).catch(()=>void 0);return}t.type===`channel.plugin-status-changed`&&(o(t.status),t.status.enabled&&t.status.connected?(S(`connected`),w(null)):t.status.status===`session_timeout`?(S(`idle`),w(null)):S(`idle`),t.status.enabled||(c(null),f({}),n(null)),t.status.connected||e.onRefreshCurrentSession?.(null))}),[]);let _e=async()=>{le(!0);try{await ie(),o(e=>e&&{...e,enabled:!1,connected:!1,hasToken:!1,status:`disabled`}),c(null),f({}),n(null),e.onRefreshCurrentSession?.(null),S(`idle`),w(null)}catch(e){T(e instanceof Error?e.message:String(e))}finally{le(!1)}},ve=async n=>{if(!t?.platformUserId){T(`no_active_wechat_user`);return}T(null),D(n.id);try{await se({providerId:n.providerId,providerSessionId:n.id,platformUserId:t.platformUserId,chatId:t.platformUserId,cwd:n.cwd});let r=await ae();e.onRefreshCurrentSession?.(r),await k(),e.onNotice?.(`已接入会话`)}catch(e){T(e instanceof Error?e.message:String(e))}finally{D(null)}},ye=async(n,r)=>{if(!t?.platformUserId){T(`no_active_wechat_user`);return}if(!ue){T(null),de(n);try{await ce({providerId:n,cwd:r.trim(),platformUserId:t.platformUserId,chatId:t.platformUserId});let i=await ae();e.onRefreshCurrentSession?.(i),await k();let a=n===`codex`?`Codex CLI`:`Claude Code`;e.onNotice?.(`已新建 ${a} 会话 · ${r.trim()}`)}catch(e){T(e instanceof Error?e.message:String(e))}finally{de(null)}}},be=()=>{O.current?.close(),T(null),S(`loading_qr`),w(null);let e=new EventSource(x(`/api/channel/weixin/login`));O.current=e,e.addEventListener(`qr`,e=>{w(JSON.parse(e.data).qrcodeData??null),S(`showing_qr`)}),e.addEventListener(`scanned`,()=>{S(`scanned`)}),e.addEventListener(`done`,t=>{let n=JSON.parse(t.data);if(e.close(),O.current=null,!n.accountId||!n.botToken){T(`wechat_login_missing_credentials`),S(`idle`);return}re({accountId:n.accountId,botToken:n.botToken,baseUrl:n.baseUrl}).then(async()=>{S(`connected`),w(null),await k()}).catch(e=>{T(e instanceof Error?e.message:String(e)),S(`idle`)})}),e.addEventListener(`error`,t=>{e.close(),O.current=null,T((t.data?JSON.parse(t.data):{}).message??`wechat_login_failed`),S(`idle`),w(null)}),e.onerror=()=>{e.close(),O.current=null,T(`wechat_login_failed`),S(`idle`),w(null)}},xe=p.filter(e=>v===`claude-native`?e.providerId===`claude-code`:e.providerId===`codex`),Se=!!(t&&vt(a));return(0,A.jsxs)(`section`,{children:[ee?(0,A.jsx)(`div`,{className:`alert alert-danger`,role:`alert`,children:ee}):null,(0,A.jsx)(Ot,{plugin:a,activeUser:t,quota:r,gateway:s?.baseUrl,busy:te,loginState:b,onLogin:be,onDisconnect:()=>void _e()}),(0,A.jsx)(jt,{providerStatus:e.providerStatus,plugin:a,currentSession:e.currentSession,lastProviderSessions:d,canCreateSession:Se,defaultWorkspace:l?.defaultWorkspace,creatingProvider:ue,onCreateSession:(e,t)=>void ye(e,t)}),xt(a)?(0,A.jsx)(`div`,{className:`soft-card mb-2`,children:(0,A.jsx)(`div`,{className:`card-body text-muted-soft small`,children:xt(a)})}):null,a?.lastError?(0,A.jsx)(`div`,{className:`soft-card mb-2`,children:(0,A.jsxs)(`div`,{className:`card-body text-muted-soft small`,children:[`错误:`,a.lastError]})}):null,b===`showing_qr`||b===`scanned`?(0,A.jsx)(`div`,{className:`soft-card mb-2`,children:(0,A.jsxs)(`div`,{className:`card-body p-3 text-center`,children:[C?(0,A.jsx)(`div`,{className:`border rounded p-3 bg-white d-inline-flex justify-content-center`,"data-testid":`weixin-login-qr`,children:(0,A.jsx)(Me,{value:C,size:220,marginSize:2,bgColor:`#ffffff`,fgColor:`#111827`,title:`微信登录二维码`})}):null,(0,A.jsx)(`p`,{className:`text-muted-soft small mt-3 mb-0`,children:b===`scanned`?`已扫码,等待确认...`:`请使用微信扫描二维码`})]})}):null,(0,A.jsxs)(`ul`,{className:`nav nav-accent mb-2`,children:[(0,A.jsx)(`li`,{className:`nav-item`,children:(0,A.jsx)(`button`,{type:`button`,className:`nav-link ${v===`help`?`active`:``}`,onClick:()=>y(`help`),children:`帮助说明`})}),(0,A.jsx)(`li`,{className:`nav-item`,children:(0,A.jsx)(`button`,{type:`button`,className:`nav-link ${v===`claude-native`?`active`:``}`,onClick:()=>y(`claude-native`),children:`Claude 会话`})}),(0,A.jsx)(`li`,{className:`nav-item`,children:(0,A.jsx)(`button`,{type:`button`,className:`nav-link ${v===`codex-native`?`active`:``}`,onClick:()=>y(`codex-native`),children:`Codex 会话`})})]}),(0,A.jsx)(`div`,{className:`soft-card mb-2`,children:(0,A.jsx)(`div`,{className:`card-body`,children:v===`help`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`p`,{className:`text-muted-soft small mb-3`,children:[`微信端可发送以下命令;`,Ze]}),Qe.map(e=>(0,A.jsxs)(`div`,{className:`mb-3`,children:[(0,A.jsxs)(`div`,{className:`fw-semibold mb-1`,children:[e.title,e.note?(0,A.jsxs)(`span`,{className:`text-muted-soft small fw-normal`,children:[`(`,e.note,`)`]}):null]}),(0,A.jsx)(`ul`,{className:`list-unstyled mb-0`,children:e.entries.map(e=>(0,A.jsxs)(`li`,{className:`d-flex flex-column flex-md-row gap-md-2 mb-1`,children:[(0,A.jsx)(`code`,{className:`flex-shrink-0`,children:e.command}),(0,A.jsx)(`span`,{className:`text-muted-soft small`,children:e.desc})]},e.command))})]},e.title))]}):(0,A.jsx)(A.Fragment,{children:xe.length===0?(0,A.jsx)(`p`,{className:`mb-0`,children:`暂无可恢复会话。`}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`ul`,{className:`list-unstyled mb-0`,children:xe.map(e=>(0,A.jsx)(`li`,{className:`border rounded p-3 mb-2`,children:(()=>{let t=It(e);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`div`,{className:`fw-semibold`,title:e.title??e.id,children:Lt(e.title??e.id)}),(0,A.jsx)(`div`,{className:`small text-muted-soft`,children:e.id}),t?(0,A.jsxs)(`div`,{className:`d-flex flex-wrap align-items-center gap-2`,children:[(0,A.jsxs)(`span`,{children:[`按 ID 恢复:`,t]}),(0,A.jsx)(`button`,{className:`resume-copy-btn`,"aria-label":`复制恢复命令`,onClick:()=>void ge(t),title:`复制恢复命令`,type:`button`,children:(0,A.jsx)(`i`,{className:`bi bi-copy`,"aria-hidden":`true`})})]}):null,e.cwd?(0,A.jsx)(`div`,{className:`small text-muted-soft`,children:e.cwd}):null,e.lastActivityAt?(0,A.jsxs)(`div`,{className:`small text-muted-soft`,children:[`最后活跃 `,Ct(e.lastActivityAt)]}):null,(0,A.jsx)(`button`,{className:`btn btn-accent btn-sm mt-2`,disabled:E===e.id,onClick:()=>void ve(e),type:`button`,children:E===e.id?`接入中...`:`接入会话`})]})})()},`${e.providerId}:${e.id}`))}),h?(0,A.jsx)(`div`,{className:`recoverable-load-more-wrap`,children:(0,A.jsx)(`button`,{className:`recoverable-load-more-btn`,disabled:fe,onClick:()=>void he(v===`codex-native`?`codex`:`claude-code`),type:`button`,children:fe?`加载中...`:`加载更多`})}):null]})})})})]})}function zt(e){return{id:e.id,platform:`weixin`,platformUserId:e.platformUserId,displayName:e.display_name,role:`user`,createdAt:e.authorizedAt,updatedAt:e.lastActive}}function Bt(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(null),[m,h]=(0,_.useState)(null),[,g]=(0,_.useState)(0);(0,_.useEffect)(()=>{if(!m)return;let e=setTimeout(()=>h(null),2500);return()=>clearTimeout(e)},[m]),(0,_.useEffect)(()=>{let e=setInterval(()=>g(e=>e+1),3e4);return()=>clearInterval(e)},[]),(0,_.useEffect)(()=>{let e=setInterval(()=>{T().then(e=>s(e)).catch(()=>void 0)},1e4);return()=>clearInterval(e)},[]);let v=(0,_.useCallback)(async()=>{p(null);try{let[e,n,r,i]=await Promise.all([w(),ee(),T(),le()]);t(e),a(n),s(r),l(i),d(e.sessions[0]??null)}catch(e){p(e instanceof Error?e.message:String(e))}},[]);(0,_.useEffect)(()=>{v()},[v]);let y=e?.preferredLocalUrl??(typeof window<`u`&&window.location?.host?`http://${window.location.host}`:`http://127.0.0.1`),b=o?.running&&o.publicUrl?o.publicUrl:y;o?.running&&o.publicUrl;let x=b,S=o?.installed||o?.running||o?.enabled?null:`未配置 Relay Server`;return(0,A.jsx)(`div`,{className:`app-bg`,children:(0,A.jsxs)(`main`,{className:`container-fluid py-4`,style:{maxWidth:1200},children:[e?.update?.updateAvailable&&e.update.latestVersion!==n?(0,A.jsxs)(`div`,{className:`alert alert-soft-warning d-flex justify-content-between align-items-start gap-3 mb-3`,role:`alert`,children:[(0,A.jsxs)(`div`,{style:{minWidth:0},children:[(0,A.jsxs)(`strong`,{children:[`发现新版 v`,e.update.latestVersion]}),e.update.currentVersion?(0,A.jsxs)(`span`,{className:`text-muted-soft`,children:[`(当前 v`,e.update.currentVersion,`)`]}):null,(0,A.jsx)(`div`,{className:`small mt-1`,children:`更新命令(更新后需重启服务生效):`}),(0,A.jsxs)(`code`,{className:`d-block mt-1`,style:{whiteSpace:`pre-wrap`,wordBreak:`break-all`},children:[`npm install -g claude-codex-wechat@latest --registry=https://registry.npmmirror.com/`,`
11
11
  `,`claude-codex-wechat restart`]})]}),(0,A.jsxs)(`div`,{className:`d-flex gap-2 flex-shrink-0`,children:[(0,A.jsx)(`button`,{type:`button`,className:`btn btn-sm btn-outline-secondary`,onClick:()=>{navigator.clipboard?.writeText(`npm install -g claude-codex-wechat@latest --registry=https://registry.npmmirror.com/
12
- claude-codex-wechat restart`)},children:`复制`}),(0,A.jsx)(`button`,{type:`button`,className:`btn-close`,"aria-label":`关闭`,onClick:()=>r(e.update?.latestVersion??null)})]})]}):null,(0,A.jsxs)(`header`,{className:`d-flex justify-content-between align-items-center flex-wrap gap-2 mb-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h1`,{style:{margin:0,fontSize:22,fontWeight:700},children:`微信远程控制台`}),(0,A.jsx)(`p`,{className:`text-muted-soft`,style:{margin:`4px 0 0`,fontSize:13},children:`通过微信控制本地 Claude Code / Codex 会话。`})]}),(0,A.jsxs)(`div`,{className:`d-flex flex-column align-items-end gap-1`,style:{minWidth:260},children:[(0,A.jsx)(`div`,{className:`d-flex align-items-center justify-content-end gap-2`,children:(0,A.jsx)(`span`,{className:`badge ${e?.ok===!0?`badge-solid-success`:`badge-soft-accent`}`,children:e?.ok===!0?`在线`:`待确认`})}),(0,A.jsx)(`a`,{className:`font-monospace text-muted-soft`,style:{fontSize:12,maxWidth:320,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},href:x,target:`_blank`,rel:`noreferrer`,title:b,children:b})]})]}),m?(0,A.jsx)(`div`,{style:{position:`fixed`,top:16,left:`50%`,transform:`translateX(-50%)`,zIndex:1050,whiteSpace:`nowrap`},className:`alert alert-success py-2 px-3 shadow-sm`,role:`status`,children:m}):null,f?(0,A.jsx)(`div`,{className:`alert alert-danger`,role:`alert`,children:f}):null,S?(0,A.jsx)(`div`,{className:`alert alert-soft-warning py-2 px-3 mb-3`,role:`status`,children:S}):null,(0,A.jsx)(Rt,{providerStatus:i,currentSession:u,onRefreshCurrentSession:d,onNotice:h})]})})}(0,v.createRoot)(document.getElementById(`root`)).render((0,A.jsx)(Bt,{}));
12
+ claude-codex-wechat restart`)},children:`复制`}),(0,A.jsx)(`button`,{type:`button`,className:`btn-close`,"aria-label":`关闭`,onClick:()=>r(e.update?.latestVersion??null)})]})]}):null,(0,A.jsxs)(`header`,{className:`d-flex justify-content-between align-items-center flex-wrap gap-2 mb-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`h1`,{style:{margin:0,fontSize:22,fontWeight:700},className:`d-flex align-items-baseline gap-2`,children:[`微信远程控制台`,e?.version?(0,A.jsxs)(`span`,{className:`text-muted-soft font-monospace fw-normal`,style:{fontSize:12},children:[`v`,e.version]}):null]}),(0,A.jsx)(`p`,{className:`text-muted-soft`,style:{margin:`4px 0 0`,fontSize:13},children:`通过微信控制本地 Claude Code / Codex 会话。`})]}),(0,A.jsxs)(`div`,{className:`d-flex flex-column align-items-end gap-1`,style:{minWidth:260},children:[(0,A.jsx)(`div`,{className:`d-flex align-items-center justify-content-end gap-2`,children:(0,A.jsx)(`span`,{className:`badge ${e?.ok===!0?`badge-solid-success`:`badge-soft-accent`}`,children:e?.ok===!0?`在线`:`待确认`})}),(0,A.jsx)(`a`,{className:`font-monospace text-muted-soft`,style:{fontSize:12,maxWidth:320,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},href:x,target:`_blank`,rel:`noreferrer`,title:b,children:b})]})]}),m?(0,A.jsx)(`div`,{style:{position:`fixed`,top:16,left:`50%`,transform:`translateX(-50%)`,zIndex:1050,whiteSpace:`nowrap`},className:`alert alert-success py-2 px-3 shadow-sm`,role:`status`,children:m}):null,f?(0,A.jsx)(`div`,{className:`alert alert-danger`,role:`alert`,children:f}):null,S?(0,A.jsx)(`div`,{className:`alert alert-soft-warning py-2 px-3 mb-3`,role:`status`,children:S}):null,(0,A.jsx)(Rt,{providerStatus:i,currentSession:u,onRefreshCurrentSession:d,onNotice:h})]})})}(0,v.createRoot)(document.getElementById(`root`)).render((0,A.jsx)(Bt,{}));
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Claude Codex WeChat</title>
7
- <script type="module" crossorigin src="/assets/index-DCJsgDkK.js"></script>
7
+ <script type="module" crossorigin src="/assets/index-Cq5-20Rf.js"></script>
8
8
  <link rel="stylesheet" crossorigin href="/assets/index-Bwj6FqtM.css">
9
9
  </head>
10
10
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-codex-wechat",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@11.5.0",